rulvar API reference / @rulvar/rulvar / projectHistory
Function: projectHistory()
ts
function projectHistory(messages, targetProvider): Msg[];Defined in: packages/core/dist/index.d.ts
Projects the canonical history into the target provider's view: provider-raw parts of a DIFFERENT provider are omitted; everything else (text, images, tool calls, tool results, compaction content) passes through untouched. Messages whose parts all belong to another provider vanish entirely rather than ride as empty messages.
Parameters
| Parameter | Type |
|---|---|
messages | Msg[] |
targetProvider | string |
Returns
Msg[]