@theokit/sdk 4.56.0 → 4.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +71 -0
- package/dist/{agent-PJMBK7HQ.cjs → agent-2T2EJIP6.cjs} +10 -10
- package/dist/{agent-PJMBK7HQ.cjs.map → agent-2T2EJIP6.cjs.map} +1 -1
- package/dist/{agent-K3PQBS7D.js → agent-ZIYCVEZL.js} +9 -9
- package/dist/{agent-K3PQBS7D.js.map → agent-ZIYCVEZL.js.map} +1 -1
- package/dist/agent-session-store-G2BMUZQV.js +7 -0
- package/dist/{agent-session-store-P6V3FINW.js.map → agent-session-store-G2BMUZQV.js.map} +1 -1
- package/dist/agent-session-store-WAKLOKWK.cjs +24 -0
- package/dist/{agent-session-store-ZJ3JSRS4.cjs.map → agent-session-store-WAKLOKWK.cjs.map} +1 -1
- package/dist/{chunk-HLPSLDGL.cjs → chunk-43GFJ5SD.cjs} +7 -7
- package/dist/{chunk-HLPSLDGL.cjs.map → chunk-43GFJ5SD.cjs.map} +1 -1
- package/dist/{chunk-KBXWEWKS.js → chunk-7TCRNXNK.js} +50 -30
- package/dist/chunk-7TCRNXNK.js.map +1 -0
- package/dist/{chunk-JHPGF3FP.cjs → chunk-BUIK7GUA.cjs} +22 -2
- package/dist/chunk-BUIK7GUA.cjs.map +1 -0
- package/dist/{chunk-6VLKVX7O.cjs → chunk-E7JHD6QJ.cjs} +4 -3
- package/dist/chunk-E7JHD6QJ.cjs.map +1 -0
- package/dist/{chunk-DZBSJX6J.js → chunk-FKMUFNQE.js} +21 -4
- package/dist/chunk-FKMUFNQE.js.map +1 -0
- package/dist/{chunk-BMAZLQQ4.js → chunk-G24KZRSA.js} +3 -3
- package/dist/{chunk-BMAZLQQ4.js.map → chunk-G24KZRSA.js.map} +1 -1
- package/dist/{chunk-ODTZ7HX3.js → chunk-G6EEYRDD.js} +3 -3
- package/dist/chunk-G6EEYRDD.js.map +1 -0
- package/dist/{chunk-MVAPK2BX.js → chunk-IACR5LEM.js} +3 -3
- package/dist/{chunk-MVAPK2BX.js.map → chunk-IACR5LEM.js.map} +1 -1
- package/dist/{chunk-V2UUGUY4.cjs → chunk-KKK3FZ4A.cjs} +6 -6
- package/dist/{chunk-V2UUGUY4.cjs.map → chunk-KKK3FZ4A.cjs.map} +1 -1
- package/dist/{chunk-M7UHYBEY.js → chunk-LEM2GOMI.js} +3 -3
- package/dist/{chunk-M7UHYBEY.js.map → chunk-LEM2GOMI.js.map} +1 -1
- package/dist/{chunk-LQYQHXIW.cjs → chunk-M2JWHKO6.cjs} +103 -83
- package/dist/chunk-M2JWHKO6.cjs.map +1 -0
- package/dist/{chunk-YPJ5NH5N.cjs → chunk-QI7WE46I.cjs} +29 -6
- package/dist/chunk-QI7WE46I.cjs.map +1 -0
- package/dist/{chunk-OHBIUXKM.js → chunk-WG7R5W6R.js} +4 -4
- package/dist/{chunk-OHBIUXKM.js.map → chunk-WG7R5W6R.js.map} +1 -1
- package/dist/{chunk-H5GOSXSC.cjs → chunk-X7O4255I.cjs} +4 -4
- package/dist/{chunk-H5GOSXSC.cjs.map → chunk-X7O4255I.cjs.map} +1 -1
- package/dist/{chunk-GJ6RK75E.js → chunk-YJDH3CKG.js} +29 -6
- package/dist/chunk-YJDH3CKG.js.map +1 -0
- package/dist/{chunk-CTCGWIUD.cjs → chunk-Z4BCLVTI.cjs} +5 -5
- package/dist/{chunk-CTCGWIUD.cjs.map → chunk-Z4BCLVTI.cjs.map} +1 -1
- package/dist/{compact-session-FUJDVF7B.js → compact-session-QGDNP45U.js} +4 -4
- package/dist/{compact-session-FUJDVF7B.js.map → compact-session-QGDNP45U.js.map} +1 -1
- package/dist/{compact-session-LEWF554G.cjs → compact-session-YHFQIXV5.cjs} +12 -12
- package/dist/{compact-session-LEWF554G.cjs.map → compact-session-YHFQIXV5.cjs.map} +1 -1
- package/dist/cron.cjs +9 -9
- package/dist/cron.js +8 -8
- package/dist/eval.cjs +8 -8
- package/dist/eval.js +7 -7
- package/dist/{fs-session-store-IN7JTTXD.js → fs-session-store-4BHGIWRE.js} +4 -4
- package/dist/{fs-session-store-IN7JTTXD.js.map → fs-session-store-4BHGIWRE.js.map} +1 -1
- package/dist/{fs-session-store-3MOJQGP2.cjs → fs-session-store-XZ7ZTB3A.cjs} +5 -5
- package/dist/{fs-session-store-3MOJQGP2.cjs.map → fs-session-store-XZ7ZTB3A.cjs.map} +1 -1
- package/dist/{index-manager-WC5ZVJWO.cjs → index-manager-AO4LJQZ4.cjs} +4 -4
- package/dist/{index-manager-WC5ZVJWO.cjs.map → index-manager-AO4LJQZ4.cjs.map} +1 -1
- package/dist/{index-manager-WBIMDVQT.js → index-manager-QDPIYIGV.js} +3 -3
- package/dist/{index-manager-WBIMDVQT.js.map → index-manager-QDPIYIGV.js.map} +1 -1
- package/dist/index.cjs +38 -38
- package/dist/index.js +11 -11
- package/dist/{inject-session-WQGGMCQY.cjs → inject-session-MLCJMYDG.cjs} +7 -7
- package/dist/{inject-session-WQGGMCQY.cjs.map → inject-session-MLCJMYDG.cjs.map} +1 -1
- package/dist/{inject-session-BJMJH5BX.js → inject-session-RBQZ45UM.js} +5 -5
- package/dist/{inject-session-BJMJH5BX.js.map → inject-session-RBQZ45UM.js.map} +1 -1
- package/dist/internal/persistence/session-transcript.d.cts +40 -1
- package/dist/internal/persistence/session-transcript.d.ts +40 -1
- package/dist/persistence.cjs +4 -4
- package/dist/persistence.js +1 -1
- package/dist/session-transcript-HF5GEU5M.cjs +63 -0
- package/dist/{session-transcript-JXHFTB7G.cjs.map → session-transcript-HF5GEU5M.cjs.map} +1 -1
- package/dist/session-transcript-P462ZRHX.js +6 -0
- package/dist/{session-transcript-AKDYYGXQ.js.map → session-transcript-P462ZRHX.js.map} +1 -1
- package/docs/error-codes.md +4 -4
- package/docs/harness-capability-map.md +1 -1
- package/package.json +5 -9
- package/dist/agent-session-store-P6V3FINW.js +0 -7
- package/dist/agent-session-store-ZJ3JSRS4.cjs +0 -24
- package/dist/chunk-6VLKVX7O.cjs.map +0 -1
- package/dist/chunk-DZBSJX6J.js.map +0 -1
- package/dist/chunk-GJ6RK75E.js.map +0 -1
- package/dist/chunk-JHPGF3FP.cjs.map +0 -1
- package/dist/chunk-KBXWEWKS.js.map +0 -1
- package/dist/chunk-LQYQHXIW.cjs.map +0 -1
- package/dist/chunk-ODTZ7HX3.js.map +0 -1
- package/dist/chunk-YPJ5NH5N.cjs.map +0 -1
- package/dist/session-transcript-AKDYYGXQ.js +0 -6
- package/dist/session-transcript-JXHFTB7G.cjs +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/session/agent-session-store.ts"],"names":["SessionTranscript","reconstructMessages"],"mappings":";;;;;AA+BA,SAAS,cAAA,CACP,OACA,IAAA,EACmB;AACnB,EAAA,OAAOA,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO,IAAI,CAAA;AAClD;AA8BA,SAAS,iBAAA,CACP,WACA,OAAA,EACM;AACN,EAAA,SAAA,CAAU,WAAW,OAAA,CAAQ,IAAA;AAC7B,EAAA,IAAI,OAAA,CAAQ,SAAA,KAAc,MAAA,EAAW,SAAA,CAAU,oBAAoB,OAAA,CAAQ,SAAA;AAC7E;AAGA,SAAS,aAAa,KAAA,EAAgD;AACpE,EAAA,MAAM,YAA2B,EAAC;AAClC,EAAA,MAAM,cAAyC,EAAC;AAChD,EAAA,MAAM,YAAqD,EAAC;AAC5D,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,IAAA,IAAI,KAAK,IAAA,KAAS,iBAAA,EAAmB,iBAAA,CAAkB,SAAA,EAAW,KAAK,OAAO,CAAA;AAAA,SAAA,IACrE,KAAK,IAAA,KAAS,kBAAA,EAAoB,SAAA,CAAU,IAAA,GAAO,KAAK,OAAA,CAAQ,IAAA;AAAA,SAAA,IAChE,KAAK,IAAA,KAAS,UAAA;AACrB,MAAA,SAAA,CAAU,IAAA,CAAK;AAAA,QACb,EA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AAOA,eAAsB,2BAAA,CACpB,KAAA,EACA,GAAA,EACA,SAAA,EACA,IAAA,EACe;AACf,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,WAAA,CAAY,IAAI,OAAO,CAAA;AACjD,EAAA,MAAM,UAAA,GAAa,cAAA,CAAe,KAAA,EAAO,EAAE,GAAA,EAAK,GAAA,CAAI,GAAA,EAAK,SAAA,EAAW,KAAA,EAAO,GAAA,CAAI,KAAA,EAAO,CAAA;AACtF,EAAA,UAAA,CAAW,sBAAsB,IAAI,CAAA;AACrC,EAAA,MAAM,KAAA,CAAM,cAAc,GAAA,CAAI,OAAA,EAAS,aAAa,UAAA,EAAY,KAAA,CAAM,MAAM,CAAC,CAAA;AAC/E","file":"chunk-CTCGWIUD.cjs","sourcesContent":["/**\n * SE40 — native session store over the Claude-shaped `.jsonl` transcript.\n *\n * The theokit session format IS the Claude Code record shape (see\n * `../../persistence/session-transcript.ts`). This module owns the FS lifecycle:\n * read existing records, seed a {@link SessionTranscript}'s parent chain, append\n * the new turn (user + assistant/tool blocks), and write append-only. Compaction\n * appends a `compact_boundary` record (a new root) — it NEVER shrinks the line\n * set (that would break the DAG). Reads reconstruct `LlmMessage[]` via\n * {@link reconstructMessages}, narrowed to the in-memory {@link SessionMessage}.\n *\n * @internal\n */\n\nimport type { ToolResultContentBlock } from \"../../types/content-blocks.js\";\nimport type { ConversationStep, ConversationTurn } from \"../../types/conversation.js\";\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport {\n type AssistantTurn,\n reconstructMessages,\n type SessionRecord,\n SessionTranscript,\n} from \"../persistence/session-transcript.js\";\nimport type { SessionMessage, SessionMessagePart } from \"./session-types.js\";\n\n/**\n * Seed a {@link SessionTranscript} from the already-on-disk records so a new\n * append parents correctly on the existing DAG leaf. The transcript re-emits the\n * seeded records verbatim before the new turn, so the whole file rewrites atomically\n * as one append-only line set. Returns the transcript primed with the prior records.\n */\nfunction seedTranscript(\n prior: readonly SessionRecord[],\n opts: { cwd: string; sessionId: string; model: string },\n): SessionTranscript {\n return SessionTranscript.fromRecords(prior, opts);\n}\n\n/** The turn to persist: the user's text plus the rich per-turn conversation view. */\nexport interface PersistTurnInput {\n userText: string;\n conversation: readonly ConversationTurn[];\n /**\n * M50 — when supplied, size-driven auto-compaction runs in the SAME write chain after the turn\n * persists (usage real vs the model's context window; summarizer injected by the caller).\n */\n autoCompact?: {\n usageTotal?: number | undefined;\n contextWindow?: number | undefined;\n summarize: (\n messages: readonly import(\"../../compaction.js\").CompressibleMessage[],\n ) => Promise<string>;\n };\n}\n\ninterface MappedTurn {\n assistant: AssistantTurn;\n toolResults: Array<{ toolUseId: string; content: string; isError?: boolean }>;\n}\n\n/**\n * theokit#122 — record the turn's thinking block, signature included.\n *\n * The signature is what makes the block replayable: without it the resumed turn is rejected by\n * Anthropic with `400 \"thinking blocks cannot be modified\"`.\n */\nfunction applyThinkingStep(\n assistant: AssistantTurn,\n message: { text: string; signature?: string },\n): void {\n assistant.thinking = message.text;\n if (message.signature !== undefined) assistant.thinkingSignature = message.signature;\n}\n\n/** Fold one agent turn's steps into an assistant record + paired tool results. */\nfunction mapAgentTurn(steps: readonly ConversationStep[]): MappedTurn {\n const assistant: AssistantTurn = {};\n const toolResults: MappedTurn[\"toolResults\"] = [];\n const toolCalls: NonNullable<AssistantTurn[\"toolCalls\"]> = [];\n for (const step of steps) {\n if (step.type === \"thinkingMessage\") applyThinkingStep(assistant, step.message);\n else if (step.type === \"assistantMessage\") assistant.text = step.message.text;\n else if (step.type === \"toolCall\")\n toolCalls.push({\n id: step.message.callId,\n name: step.message.name,\n input: (step.message.args as Record<string, unknown> | undefined) ?? {},\n });\n else\n toolResults.push({\n toolUseId: step.message.callId,\n content: step.message.result,\n isError: step.message.isError,\n });\n }\n if (toolCalls.length > 0) assistant.toolCalls = toolCalls;\n return { assistant, toolResults };\n}\n\n/** True when the assistant record carries any content worth emitting. */\nfunction hasAssistantContent(a: AssistantTurn): boolean {\n return a.text !== undefined || a.thinking !== undefined || (a.toolCalls?.length ?? 0) > 0;\n}\n\n/**\n * Map the rich `ConversationTurn[]` (from `run.conversation()`) into the native\n * assistant/tool records. One transcript turn is: an `assistant` record carrying\n * thinking + text + tool_use blocks, then (when present) a `user` record carrying\n * the paired tool_result blocks. Tool results pair with tool_use by `callId`.\n */\nfunction appendConversation(\n transcript: SessionTranscript,\n conversation: readonly ConversationTurn[],\n): void {\n for (const ct of conversation) {\n if (ct.type !== \"agentConversationTurn\") continue;\n const { assistant, toolResults } = mapAgentTurn(ct.turn.steps);\n if (hasAssistantContent(assistant)) transcript.appendAssistantTurn(assistant);\n if (toolResults.length > 0) transcript.appendToolResults(toolResults);\n }\n}\n\n/**\n * The per-agent transcript metadata used to seed a {@link SessionTranscript}. The\n * actual record I/O goes through the injected {@link SessionStore} (SE41), so this\n * no longer carries a `baseDir` — the store is already bound to its location.\n */\nexport interface TranscriptLocation {\n cwd: string;\n agentId: string;\n model: string;\n}\n\n/**\n * Read the session's records via the {@link SessionStore} and reconstruct the\n * resumable history, narrowed to the in-memory {@link SessionMessage} shape\n * (user/assistant text). Tool turns fold into assistant-role context so resume\n * keeps tool history. Works identically for the FS default and an external store.\n */\nexport async function readSessionMessages(\n store: SessionStore,\n agentId: string,\n): Promise<SessionMessage[]> {\n const records = await store.readRecords(agentId);\n return reconstructMessages(records).map(narrowToSessionMessage);\n}\n\ntype NarrowPart = {\n type: string;\n text?: string;\n content?: unknown;\n name?: string;\n id?: string;\n toolUseId?: string;\n input?: unknown;\n isError?: boolean;\n};\n\n/** Render one reconstructed content part as folded session text. */\nfunction partToText(p: NarrowPart): string {\n if (p.type === \"text\") return p.text ?? \"\";\n if (p.type === \"tool_use\") return `[tool call] ${p.name ?? \"\"}`;\n if (p.type === \"tool_result\") {\n const body = typeof p.content === \"string\" ? p.content : JSON.stringify(p.content);\n return `[tool result] ${body}`;\n }\n return \"\";\n}\n\n/**\n * theokit#146 — the same part, kept as STRUCTURE.\n *\n * `partToText` above is what the model replay wants; a host rendering tool cards needs the call id,\n * the tool name and the arguments, none of which survive `[tool call] NAME`. Both projections are\n * produced from the one reconstructed part, so they cannot drift apart.\n *\n * Returns `undefined` for a part with no display meaning (e.g. an image placeholder the session\n * projection does not model), which the caller filters out.\n */\nfunction partToStructured(p: NarrowPart): SessionMessagePart | undefined {\n if (p.type === \"text\") return { type: \"text\", text: p.text ?? \"\" };\n if (p.type === \"tool_use\") {\n return {\n type: \"tool_use\",\n id: p.id ?? \"\",\n name: p.name ?? \"\",\n input: (p.input ?? {}) as Record<string, unknown>,\n };\n }\n if (p.type === \"tool_result\") {\n return {\n type: \"tool_result\",\n toolUseId: p.toolUseId ?? \"\",\n // Reconstructed tool results carry either a string or the SE7 content blocks; both are\n // already the session shape, so this narrows `unknown` rather than converting anything.\n content: p.content as string | ReadonlyArray<ToolResultContentBlock>,\n ...(p.isError === true ? { isError: true } : {}),\n };\n }\n return undefined;\n}\n\n/** Flatten a reconstructed `LlmMessage` to the narrowed in-memory `SessionMessage`. */\nfunction narrowToSessionMessage(m: {\n role: \"system\" | \"user\" | \"assistant\";\n content: NarrowPart[];\n}): SessionMessage {\n const role = m.role === \"user\" ? \"user\" : \"assistant\";\n const text = m.content\n .map(partToText)\n .filter((s) => s.length > 0)\n .join(\"\\n\");\n const parts = m.content\n .map(partToStructured)\n .filter((p): p is SessionMessagePart => p !== undefined);\n return { role, text, parts };\n}\n\n/** The records appended by the last turn (the delta beyond the seeded prior). */\nfunction deltaRecords(\n transcript: SessionTranscript,\n priorLength: number,\n): readonly SessionRecord[] {\n return transcript.records().slice(priorLength);\n}\n\n/**\n * Persist one conversation turn (user + assistant/tool records) to the session\n * store, append-only. Reads the prior records to seed the parent chain, folds the\n * new turn, and appends ONLY the delta via {@link SessionStore.appendRecords}\n * (the store owns the append atomicity — the FS default serializes under a file\n * lock). Within one process, turns for an agent are already chained upstream, so\n * the read→append is ordered; cross-host ordering is the external store's contract.\n */\nexport async function persistTurn(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n turn: PersistTurnInput,\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendUserTurn(turn.userText);\n appendConversation(transcript, turn.conversation);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n\n/**\n * Append-only compaction: add a `compact_boundary` system record (a new root) so\n * resume replays only the post-boundary continuation. Appends only the boundary\n * record via the store — NEVER rewrites or shrinks the prior records.\n */\nexport async function appendCompactBoundaryRecord(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n meta: { preTokens: number; trigger: string },\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendCompactBoundary(meta);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/internal/session/agent-session-store.ts"],"names":["SessionTranscript","reconstructMessages"],"mappings":";;;;;AA+BA,SAAS,cAAA,CACP,OACA,IAAA,EACmB;AACnB,EAAA,OAAOA,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO,IAAI,CAAA;AAClD;AA8BA,SAAS,iBAAA,CACP,WACA,OAAA,EACM;AACN,EAAA,SAAA,CAAU,WAAW,OAAA,CAAQ,IAAA;AAC7B,EAAA,IAAI,OAAA,CAAQ,SAAA,KAAc,MAAA,EAAW,SAAA,CAAU,oBAAoB,OAAA,CAAQ,SAAA;AAC7E;AAGA,SAAS,aAAa,KAAA,EAAgD;AACpE,EAAA,MAAM,YAA2B,EAAC;AAClC,EAAA,MAAM,cAAyC,EAAC;AAChD,EAAA,MAAM,YAAqD,EAAC;AAC5D,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,IAAA,IAAI,KAAK,IAAA,KAAS,iBAAA,EAAmB,iBAAA,CAAkB,SAAA,EAAW,KAAK,OAAO,CAAA;AAAA,S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AAQ,CAAA;AACvC,EAAA,kBAAA,CAAmB,UAAA,EAAY,KAAK,YAAY,CAAA;AAChD,EAAA,MAAM,KAAA,CAAM,cAAc,GAAA,CAAI,OAAA,EAAS,aAAa,UAAA,EAAY,KAAA,CAAM,MAAM,CAAC,CAAA;AAC/E;AAOA,eAAsB,2BAAA,CACpB,KAAA,EACA,GAAA,EACA,SAAA,EACA,IAAA,EACe;AACf,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,WAAA,CAAY,IAAI,OAAO,CAAA;AACjD,EAAA,MAAM,UAAA,GAAa,cAAA,CAAe,KAAA,EAAO,EAAE,GAAA,EAAK,GAAA,CAAI,GAAA,EAAK,SAAA,EAAW,KAAA,EAAO,GAAA,CAAI,KAAA,EAAO,CAAA;AACtF,EAAA,UAAA,CAAW,sBAAsB,IAAI,CAAA;AACrC,EAAA,MAAM,KAAA,CAAM,cAAc,GAAA,CAAI,OAAA,EAAS,aAAa,UAAA,EAAY,KAAA,CAAM,MAAM,CAAC,CAAA;AAC/E","file":"chunk-Z4BCLVTI.cjs","sourcesContent":["/**\n * SE40 — native session store over the Claude-shaped `.jsonl` transcript.\n *\n * The theokit session format IS the Claude Code record shape (see\n * `../../persistence/session-transcript.ts`). This module owns the FS lifecycle:\n * read existing records, seed a {@link SessionTranscript}'s parent chain, append\n * the new turn (user + assistant/tool blocks), and write append-only. Compaction\n * appends a `compact_boundary` record (a new root) — it NEVER shrinks the line\n * set (that would break the DAG). Reads reconstruct `LlmMessage[]` via\n * {@link reconstructMessages}, narrowed to the in-memory {@link SessionMessage}.\n *\n * @internal\n */\n\nimport type { ToolResultContentBlock } from \"../../types/content-blocks.js\";\nimport type { ConversationStep, ConversationTurn } from \"../../types/conversation.js\";\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport {\n type AssistantTurn,\n reconstructMessages,\n type SessionRecord,\n SessionTranscript,\n} from \"../persistence/session-transcript.js\";\nimport type { SessionMessage, SessionMessagePart } from \"./session-types.js\";\n\n/**\n * Seed a {@link SessionTranscript} from the already-on-disk records so a new\n * append parents correctly on the existing DAG leaf. The transcript re-emits the\n * seeded records verbatim before the new turn, so the whole file rewrites atomically\n * as one append-only line set. Returns the transcript primed with the prior records.\n */\nfunction seedTranscript(\n prior: readonly SessionRecord[],\n opts: { cwd: string; sessionId: string; model: string },\n): SessionTranscript {\n return SessionTranscript.fromRecords(prior, opts);\n}\n\n/** The turn to persist: the user's text plus the rich per-turn conversation view. */\nexport interface PersistTurnInput {\n userText: string;\n conversation: readonly ConversationTurn[];\n /**\n * M50 — when supplied, size-driven auto-compaction runs in the SAME write chain after the turn\n * persists (usage real vs the model's context window; summarizer injected by the caller).\n */\n autoCompact?: {\n usageTotal?: number | undefined;\n contextWindow?: number | undefined;\n summarize: (\n messages: readonly import(\"../../compaction.js\").CompressibleMessage[],\n ) => Promise<string>;\n };\n}\n\ninterface MappedTurn {\n assistant: AssistantTurn;\n toolResults: Array<{ toolUseId: string; content: string; isError?: boolean }>;\n}\n\n/**\n * theokit#122 — record the turn's thinking block, signature included.\n *\n * The signature is what makes the block replayable: without it the resumed turn is rejected by\n * Anthropic with `400 \"thinking blocks cannot be modified\"`.\n */\nfunction applyThinkingStep(\n assistant: AssistantTurn,\n message: { text: string; signature?: string },\n): void {\n assistant.thinking = message.text;\n if (message.signature !== undefined) assistant.thinkingSignature = message.signature;\n}\n\n/** Fold one agent turn's steps into an assistant record + paired tool results. */\nfunction mapAgentTurn(steps: readonly ConversationStep[]): MappedTurn {\n const assistant: AssistantTurn = {};\n const toolResults: MappedTurn[\"toolResults\"] = [];\n const toolCalls: NonNullable<AssistantTurn[\"toolCalls\"]> = [];\n for (const step of steps) {\n if (step.type === \"thinkingMessage\") applyThinkingStep(assistant, step.message);\n else if (step.type === \"assistantMessage\") assistant.text = step.message.text;\n else if (step.type === \"toolCall\")\n toolCalls.push({\n id: step.message.callId,\n name: step.message.name,\n input: (step.message.args as Record<string, unknown> | undefined) ?? {},\n });\n else\n toolResults.push({\n toolUseId: step.message.callId,\n content: step.message.result,\n isError: step.message.isError,\n });\n }\n if (toolCalls.length > 0) assistant.toolCalls = toolCalls;\n return { assistant, toolResults };\n}\n\n/** True when the assistant record carries any content worth emitting. */\nfunction hasAssistantContent(a: AssistantTurn): boolean {\n return a.text !== undefined || a.thinking !== undefined || (a.toolCalls?.length ?? 0) > 0;\n}\n\n/**\n * Map the rich `ConversationTurn[]` (from `run.conversation()`) into the native\n * assistant/tool records. One transcript turn is: an `assistant` record carrying\n * thinking + text + tool_use blocks, then (when present) a `user` record carrying\n * the paired tool_result blocks. Tool results pair with tool_use by `callId`.\n */\nfunction appendConversation(\n transcript: SessionTranscript,\n conversation: readonly ConversationTurn[],\n): void {\n for (const ct of conversation) {\n if (ct.type !== \"agentConversationTurn\") continue;\n const { assistant, toolResults } = mapAgentTurn(ct.turn.steps);\n if (hasAssistantContent(assistant)) transcript.appendAssistantTurn(assistant);\n if (toolResults.length > 0) transcript.appendToolResults(toolResults);\n }\n}\n\n/**\n * The per-agent transcript metadata used to seed a {@link SessionTranscript}. The\n * actual record I/O goes through the injected {@link SessionStore} (SE41), so this\n * no longer carries a `baseDir` — the store is already bound to its location.\n */\nexport interface TranscriptLocation {\n cwd: string;\n agentId: string;\n model: string;\n}\n\n/**\n * Read the session's records via the {@link SessionStore} and reconstruct the\n * resumable history, narrowed to the in-memory {@link SessionMessage} shape\n * (user/assistant text). Tool turns fold into assistant-role context so resume\n * keeps tool history. Works identically for the FS default and an external store.\n */\nexport async function readSessionMessages(\n store: SessionStore,\n agentId: string,\n): Promise<SessionMessage[]> {\n const records = await store.readRecords(agentId);\n return reconstructMessages(records).map(narrowToSessionMessage);\n}\n\ntype NarrowPart = {\n type: string;\n text?: string;\n content?: unknown;\n name?: string;\n id?: string;\n toolUseId?: string;\n input?: unknown;\n isError?: boolean;\n};\n\n/** Render one reconstructed content part as folded session text. */\nfunction partToText(p: NarrowPart): string {\n if (p.type === \"text\") return p.text ?? \"\";\n if (p.type === \"tool_use\") return `[tool call] ${p.name ?? \"\"}`;\n if (p.type === \"tool_result\") {\n const body = typeof p.content === \"string\" ? p.content : JSON.stringify(p.content);\n return `[tool result] ${body}`;\n }\n return \"\";\n}\n\n/**\n * theokit#146 — the same part, kept as STRUCTURE.\n *\n * `partToText` above is what the model replay wants; a host rendering tool cards needs the call id,\n * the tool name and the arguments, none of which survive `[tool call] NAME`. Both projections are\n * produced from the one reconstructed part, so they cannot drift apart.\n *\n * Returns `undefined` for a part with no display meaning (e.g. an image placeholder the session\n * projection does not model), which the caller filters out.\n */\nfunction partToStructured(p: NarrowPart): SessionMessagePart | undefined {\n if (p.type === \"text\") return { type: \"text\", text: p.text ?? \"\" };\n if (p.type === \"tool_use\") {\n return {\n type: \"tool_use\",\n id: p.id ?? \"\",\n name: p.name ?? \"\",\n input: (p.input ?? {}) as Record<string, unknown>,\n };\n }\n if (p.type === \"tool_result\") {\n return {\n type: \"tool_result\",\n toolUseId: p.toolUseId ?? \"\",\n // Reconstructed tool results carry either a string or the SE7 content blocks; both are\n // already the session shape, so this narrows `unknown` rather than converting anything.\n content: p.content as string | ReadonlyArray<ToolResultContentBlock>,\n ...(p.isError === true ? { isError: true } : {}),\n };\n }\n return undefined;\n}\n\n/** Flatten a reconstructed `LlmMessage` to the narrowed in-memory `SessionMessage`. */\nfunction narrowToSessionMessage(m: {\n role: \"system\" | \"user\" | \"assistant\";\n content: NarrowPart[];\n}): SessionMessage {\n const role = m.role === \"user\" ? \"user\" : \"assistant\";\n const text = m.content\n .map(partToText)\n .filter((s) => s.length > 0)\n .join(\"\\n\");\n const parts = m.content\n .map(partToStructured)\n .filter((p): p is SessionMessagePart => p !== undefined);\n return { role, text, parts };\n}\n\n/** The records appended by the last turn (the delta beyond the seeded prior). */\nfunction deltaRecords(\n transcript: SessionTranscript,\n priorLength: number,\n): readonly SessionRecord[] {\n return transcript.records().slice(priorLength);\n}\n\n/**\n * Persist one conversation turn (user + assistant/tool records) to the session\n * store, append-only. Reads the prior records to seed the parent chain, folds the\n * new turn, and appends ONLY the delta via {@link SessionStore.appendRecords}\n * (the store owns the append atomicity — the FS default serializes under a file\n * lock). Within one process, turns for an agent are already chained upstream, so\n * the read→append is ordered; cross-host ordering is the external store's contract.\n */\nexport async function persistTurn(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n turn: PersistTurnInput,\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendUserTurn(turn.userText);\n appendConversation(transcript, turn.conversation);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n\n/**\n * Append-only compaction: add a `compact_boundary` system record (a new root) so\n * resume replays only the post-boundary continuation. Appends only the boundary\n * record via the store — NEVER rewrites or shrinks the prior records.\n */\nexport async function appendCompactBoundaryRecord(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n meta: { preTokens: number; trigger: string },\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendCompactBoundary(meta);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, isCompactSummary, resolveSummarizerRoute, shouldAutoCompact } from './chunk-
|
|
1
|
+
export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, isCompactSummary, resolveSummarizerRoute, shouldAutoCompact } from './chunk-IACR5LEM.js';
|
|
2
2
|
import './chunk-3E77SX4H.js';
|
|
3
3
|
import './chunk-WTMU7J4U.js';
|
|
4
4
|
import './chunk-5JLFFPCH.js';
|
|
@@ -7,7 +7,7 @@ import './chunk-U54XCYG3.js';
|
|
|
7
7
|
import './chunk-NAF4L3T6.js';
|
|
8
8
|
import './chunk-QARJGQSA.js';
|
|
9
9
|
import './chunk-RIAM53CP.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-FKMUFNQE.js';
|
|
11
11
|
import './chunk-Q5EWJPRY.js';
|
|
12
12
|
import './chunk-VF7EWVDG.js';
|
|
13
13
|
import './chunk-F7AQV62G.js';
|
|
@@ -18,5 +18,5 @@ import './chunk-3OR54XG4.js';
|
|
|
18
18
|
import './chunk-IDCKSLYH.js';
|
|
19
19
|
import './chunk-T7XEKOVW.js';
|
|
20
20
|
import './chunk-T7O6K6PX.js';
|
|
21
|
-
//# sourceMappingURL=compact-session-
|
|
22
|
-
//# sourceMappingURL=compact-session-
|
|
21
|
+
//# sourceMappingURL=compact-session-QGDNP45U.js.map
|
|
22
|
+
//# sourceMappingURL=compact-session-QGDNP45U.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-QGDNP45U.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk43GFJ5SD_cjs = require('./chunk-43GFJ5SD.cjs');
|
|
4
4
|
require('./chunk-F3YZMOAU.cjs');
|
|
5
5
|
require('./chunk-4OTIXDMU.cjs');
|
|
6
6
|
require('./chunk-DQKERTND.cjs');
|
|
@@ -9,7 +9,7 @@ require('./chunk-6JSIEDKL.cjs');
|
|
|
9
9
|
require('./chunk-FRITRLZQ.cjs');
|
|
10
10
|
require('./chunk-R3UPQFKK.cjs');
|
|
11
11
|
require('./chunk-VKJ7V7EB.cjs');
|
|
12
|
-
require('./chunk-
|
|
12
|
+
require('./chunk-BUIK7GUA.cjs');
|
|
13
13
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
14
14
|
require('./chunk-I6TGFUCO.cjs');
|
|
15
15
|
require('./chunk-XSX2UU6Y.cjs');
|
|
@@ -25,35 +25,35 @@ require('./chunk-NUKRL3I6.cjs');
|
|
|
25
25
|
|
|
26
26
|
Object.defineProperty(exports, "COMPACT_SUMMARY_MARKER", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunk43GFJ5SD_cjs.COMPACT_SUMMARY_MARKER; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "COMPACT_USER_MESSAGE_MAX_TOKENS", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunk43GFJ5SD_cjs.COMPACT_USER_MESSAGE_MAX_TOKENS; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "autoCompactIfNeeded", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunk43GFJ5SD_cjs.autoCompactIfNeeded; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "buildDefaultSummarizer", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunk43GFJ5SD_cjs.buildDefaultSummarizer; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "compactSessionTranscript", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunk43GFJ5SD_cjs.compactSessionTranscript; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "isCompactSummary", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunk43GFJ5SD_cjs.isCompactSummary; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "resolveSummarizerRoute", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunk43GFJ5SD_cjs.resolveSummarizerRoute; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "shouldAutoCompact", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunk43GFJ5SD_cjs.shouldAutoCompact; }
|
|
57
57
|
});
|
|
58
|
-
//# sourceMappingURL=compact-session-
|
|
59
|
-
//# sourceMappingURL=compact-session-
|
|
58
|
+
//# sourceMappingURL=compact-session-YHFQIXV5.cjs.map
|
|
59
|
+
//# sourceMappingURL=compact-session-YHFQIXV5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-YHFQIXV5.cjs"}
|
package/dist/cron.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var chunkX7O4255I_cjs = require('./chunk-X7O4255I.cjs');
|
|
4
|
+
require('./chunk-M2JWHKO6.cjs');
|
|
5
|
+
require('./chunk-KKK3FZ4A.cjs');
|
|
6
|
+
require('./chunk-E7JHD6QJ.cjs');
|
|
7
7
|
require('./chunk-53CBTBWO.cjs');
|
|
8
8
|
require('./chunk-BV2MWEMV.cjs');
|
|
9
9
|
require('./chunk-NGESVVJN.cjs');
|
|
10
10
|
require('./chunk-BUUUWQMB.cjs');
|
|
11
11
|
require('./chunk-EI2Q7SJ5.cjs');
|
|
12
12
|
require('./chunk-GHX4P3V2.cjs');
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-QI7WE46I.cjs');
|
|
14
|
+
require('./chunk-43GFJ5SD.cjs');
|
|
15
15
|
require('./chunk-F3YZMOAU.cjs');
|
|
16
16
|
require('./chunk-4OTIXDMU.cjs');
|
|
17
17
|
require('./chunk-DQKERTND.cjs');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-Z4BCLVTI.cjs');
|
|
19
19
|
require('./chunk-2ZPEDVLM.cjs');
|
|
20
20
|
require('./chunk-E3WZ6Y4H.cjs');
|
|
21
21
|
require('./chunk-KRD3GQAA.cjs');
|
|
@@ -34,7 +34,7 @@ require('./chunk-VKJ7V7EB.cjs');
|
|
|
34
34
|
require('./chunk-ILCGLTSA.cjs');
|
|
35
35
|
require('./chunk-CQGYNZ3K.cjs');
|
|
36
36
|
require('./chunk-4I55V454.cjs');
|
|
37
|
-
require('./chunk-
|
|
37
|
+
require('./chunk-BUIK7GUA.cjs');
|
|
38
38
|
require('./chunk-SKXBJ2NU.cjs');
|
|
39
39
|
require('./chunk-2ADR2GSO.cjs');
|
|
40
40
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
@@ -57,7 +57,7 @@ require('./chunk-NUKRL3I6.cjs');
|
|
|
57
57
|
|
|
58
58
|
Object.defineProperty(exports, "Cron", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkX7O4255I_cjs.Cron; }
|
|
61
61
|
});
|
|
62
62
|
//# sourceMappingURL=cron.cjs.map
|
|
63
63
|
//# sourceMappingURL=cron.cjs.map
|
package/dist/cron.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { Cron } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { Cron } from './chunk-LEM2GOMI.js';
|
|
2
|
+
import './chunk-7TCRNXNK.js';
|
|
3
|
+
import './chunk-WG7R5W6R.js';
|
|
4
|
+
import './chunk-G6EEYRDD.js';
|
|
5
5
|
import './chunk-YMA4S2WO.js';
|
|
6
6
|
import './chunk-2SFBB54R.js';
|
|
7
7
|
import './chunk-SUKXXLWD.js';
|
|
8
8
|
import './chunk-K2BQQ445.js';
|
|
9
9
|
import './chunk-XN7NOENA.js';
|
|
10
10
|
import './chunk-H73MEMQB.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
11
|
+
import './chunk-YJDH3CKG.js';
|
|
12
|
+
import './chunk-IACR5LEM.js';
|
|
13
13
|
import './chunk-3E77SX4H.js';
|
|
14
14
|
import './chunk-WTMU7J4U.js';
|
|
15
15
|
import './chunk-5JLFFPCH.js';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-G24KZRSA.js';
|
|
17
17
|
import './chunk-HKCKOAIO.js';
|
|
18
18
|
import './chunk-7FHZ4VQX.js';
|
|
19
19
|
import './chunk-KVNWIAO4.js';
|
|
@@ -32,7 +32,7 @@ import './chunk-RIAM53CP.js';
|
|
|
32
32
|
import './chunk-UC3HT2S4.js';
|
|
33
33
|
import './chunk-OC4NTGMN.js';
|
|
34
34
|
import './chunk-44JAAH4X.js';
|
|
35
|
-
import './chunk-
|
|
35
|
+
import './chunk-FKMUFNQE.js';
|
|
36
36
|
import './chunk-CQ2TQ32Y.js';
|
|
37
37
|
import './chunk-CV7XMBHP.js';
|
|
38
38
|
import './chunk-Q5EWJPRY.js';
|
package/dist/eval.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkJ24VJOH3_cjs = require('./chunk-J24VJOH3.cjs');
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var chunkM2JWHKO6_cjs = require('./chunk-M2JWHKO6.cjs');
|
|
5
|
+
require('./chunk-KKK3FZ4A.cjs');
|
|
6
|
+
require('./chunk-E7JHD6QJ.cjs');
|
|
7
7
|
require('./chunk-53CBTBWO.cjs');
|
|
8
8
|
require('./chunk-BV2MWEMV.cjs');
|
|
9
9
|
require('./chunk-NGESVVJN.cjs');
|
|
10
10
|
var chunkBUUUWQMB_cjs = require('./chunk-BUUUWQMB.cjs');
|
|
11
11
|
require('./chunk-EI2Q7SJ5.cjs');
|
|
12
12
|
require('./chunk-GHX4P3V2.cjs');
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-QI7WE46I.cjs');
|
|
14
|
+
require('./chunk-43GFJ5SD.cjs');
|
|
15
15
|
require('./chunk-F3YZMOAU.cjs');
|
|
16
16
|
require('./chunk-4OTIXDMU.cjs');
|
|
17
17
|
require('./chunk-DQKERTND.cjs');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-Z4BCLVTI.cjs');
|
|
19
19
|
require('./chunk-2ZPEDVLM.cjs');
|
|
20
20
|
require('./chunk-E3WZ6Y4H.cjs');
|
|
21
21
|
require('./chunk-KRD3GQAA.cjs');
|
|
@@ -34,7 +34,7 @@ require('./chunk-VKJ7V7EB.cjs');
|
|
|
34
34
|
require('./chunk-ILCGLTSA.cjs');
|
|
35
35
|
require('./chunk-CQGYNZ3K.cjs');
|
|
36
36
|
require('./chunk-4I55V454.cjs');
|
|
37
|
-
require('./chunk-
|
|
37
|
+
require('./chunk-BUIK7GUA.cjs');
|
|
38
38
|
require('./chunk-SKXBJ2NU.cjs');
|
|
39
39
|
var chunk2ADR2GSO_cjs = require('./chunk-2ADR2GSO.cjs');
|
|
40
40
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
@@ -780,7 +780,7 @@ function makeDefaultEmbedder(opts) {
|
|
|
780
780
|
let runtime;
|
|
781
781
|
return (texts) => {
|
|
782
782
|
if (runtime === void 0) {
|
|
783
|
-
runtime =
|
|
783
|
+
runtime = chunkM2JWHKO6_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
|
|
784
784
|
}
|
|
785
785
|
return runtime.then((rt) => rt.embed(texts));
|
|
786
786
|
};
|
package/dist/eval.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { shellEscapePosix, LocalSandbox } from './chunk-2D34UTDC.js';
|
|
2
|
-
import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
2
|
+
import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-7TCRNXNK.js';
|
|
3
|
+
import './chunk-WG7R5W6R.js';
|
|
4
|
+
import './chunk-G6EEYRDD.js';
|
|
5
5
|
import './chunk-YMA4S2WO.js';
|
|
6
6
|
import './chunk-2SFBB54R.js';
|
|
7
7
|
import './chunk-SUKXXLWD.js';
|
|
8
8
|
import { getTracer } from './chunk-K2BQQ445.js';
|
|
9
9
|
import './chunk-XN7NOENA.js';
|
|
10
10
|
import './chunk-H73MEMQB.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
11
|
+
import './chunk-YJDH3CKG.js';
|
|
12
|
+
import './chunk-IACR5LEM.js';
|
|
13
13
|
import './chunk-3E77SX4H.js';
|
|
14
14
|
import './chunk-WTMU7J4U.js';
|
|
15
15
|
import './chunk-5JLFFPCH.js';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-G24KZRSA.js';
|
|
17
17
|
import './chunk-HKCKOAIO.js';
|
|
18
18
|
import './chunk-7FHZ4VQX.js';
|
|
19
19
|
import './chunk-KVNWIAO4.js';
|
|
@@ -32,7 +32,7 @@ import './chunk-RIAM53CP.js';
|
|
|
32
32
|
import './chunk-UC3HT2S4.js';
|
|
33
33
|
import './chunk-OC4NTGMN.js';
|
|
34
34
|
import './chunk-44JAAH4X.js';
|
|
35
|
-
import './chunk-
|
|
35
|
+
import './chunk-FKMUFNQE.js';
|
|
36
36
|
import './chunk-CQ2TQ32Y.js';
|
|
37
37
|
import { readJsonlIds, appendJsonl } from './chunk-CV7XMBHP.js';
|
|
38
38
|
export { JsonlParseError, loadJsonl } from './chunk-CV7XMBHP.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { FsSessionStore } from './chunk-
|
|
1
|
+
export { FsSessionStore } from './chunk-YJDH3CKG.js';
|
|
2
2
|
import './chunk-44JAAH4X.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-FKMUFNQE.js';
|
|
4
4
|
import './chunk-CV7XMBHP.js';
|
|
5
5
|
import './chunk-Q5EWJPRY.js';
|
|
6
6
|
import './chunk-VF7EWVDG.js';
|
|
7
7
|
import './chunk-IDCKSLYH.js';
|
|
8
8
|
import './chunk-T7XEKOVW.js';
|
|
9
9
|
import './chunk-T7O6K6PX.js';
|
|
10
|
-
//# sourceMappingURL=fs-session-store-
|
|
11
|
-
//# sourceMappingURL=fs-session-store-
|
|
10
|
+
//# sourceMappingURL=fs-session-store-4BHGIWRE.js.map
|
|
11
|
+
//# sourceMappingURL=fs-session-store-4BHGIWRE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-4BHGIWRE.js"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQI7WE46I_cjs = require('./chunk-QI7WE46I.cjs');
|
|
4
4
|
require('./chunk-4I55V454.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-BUIK7GUA.cjs');
|
|
6
6
|
require('./chunk-2ADR2GSO.cjs');
|
|
7
7
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
8
8
|
require('./chunk-I6TGFUCO.cjs');
|
|
@@ -14,7 +14,7 @@ require('./chunk-NUKRL3I6.cjs');
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "FsSessionStore", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkQI7WE46I_cjs.FsSessionStore; }
|
|
18
18
|
});
|
|
19
|
-
//# sourceMappingURL=fs-session-store-
|
|
20
|
-
//# sourceMappingURL=fs-session-store-
|
|
19
|
+
//# sourceMappingURL=fs-session-store-XZ7ZTB3A.cjs.map
|
|
20
|
+
//# sourceMappingURL=fs-session-store-XZ7ZTB3A.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"fs-session-store-XZ7ZTB3A.cjs"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkE7JHD6QJ_cjs = require('./chunk-E7JHD6QJ.cjs');
|
|
4
4
|
require('./chunk-GHX4P3V2.cjs');
|
|
5
5
|
require('./chunk-KRD3GQAA.cjs');
|
|
6
6
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
@@ -17,7 +17,7 @@ require('./chunk-NUKRL3I6.cjs');
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "IndexManager", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkE7JHD6QJ_cjs.IndexManager; }
|
|
21
21
|
});
|
|
22
|
-
//# sourceMappingURL=index-manager-
|
|
23
|
-
//# sourceMappingURL=index-manager-
|
|
22
|
+
//# sourceMappingURL=index-manager-AO4LJQZ4.cjs.map
|
|
23
|
+
//# sourceMappingURL=index-manager-AO4LJQZ4.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-AO4LJQZ4.cjs"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { IndexManager } from './chunk-
|
|
1
|
+
export { IndexManager } from './chunk-G6EEYRDD.js';
|
|
2
2
|
import './chunk-H73MEMQB.js';
|
|
3
3
|
import './chunk-KVNWIAO4.js';
|
|
4
4
|
import './chunk-FD2UT76F.js';
|
|
@@ -10,5 +10,5 @@ import './chunk-VF7EWVDG.js';
|
|
|
10
10
|
import './chunk-IDCKSLYH.js';
|
|
11
11
|
import './chunk-T7XEKOVW.js';
|
|
12
12
|
import './chunk-T7O6K6PX.js';
|
|
13
|
-
//# sourceMappingURL=index-manager-
|
|
14
|
-
//# sourceMappingURL=index-manager-
|
|
13
|
+
//# sourceMappingURL=index-manager-QDPIYIGV.js.map
|
|
14
|
+
//# sourceMappingURL=index-manager-QDPIYIGV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-QDPIYIGV.js"}
|