@theokit/sdk 4.55.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 +134 -0
- package/dist/a2a/index.cjs +13 -4
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.d.cts +1 -1
- package/dist/a2a/index.d.ts +1 -1
- package/dist/a2a/index.js +13 -5
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/message-bus.d.cts +33 -4
- package/dist/a2a/message-bus.d.ts +33 -4
- package/dist/{agent-R2HOJFZJ.cjs → agent-2T2EJIP6.cjs} +12 -11
- package/dist/{agent-R2HOJFZJ.cjs.map → agent-2T2EJIP6.cjs.map} +1 -1
- package/dist/{agent-HDEVVUBS.js → agent-ZIYCVEZL.js} +11 -10
- package/dist/{agent-HDEVVUBS.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-5PHVENFV.js → chunk-7FHZ4VQX.js} +3 -55
- package/dist/chunk-7FHZ4VQX.js.map +1 -0
- package/dist/{chunk-I5BE5M5L.js → chunk-7TCRNXNK.js} +51 -31
- 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-Q47R5E2X.cjs → chunk-E3WZ6Y4H.cjs} +7 -59
- package/dist/chunk-E3WZ6Y4H.cjs.map +1 -0
- package/dist/{chunk-5UOVYM3P.cjs → chunk-E7JHD6QJ.cjs} +132 -54
- 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-DAPSQZT4.js → chunk-G6EEYRDD.js} +132 -55
- 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-KRD3GQAA.cjs +71 -0
- package/dist/chunk-KRD3GQAA.cjs.map +1 -0
- package/dist/chunk-KVNWIAO4.js +68 -0
- package/dist/chunk-KVNWIAO4.js.map +1 -0
- package/dist/{chunk-IVNNSANC.js → chunk-LEM2GOMI.js} +3 -3
- package/dist/{chunk-IVNNSANC.js.map → chunk-LEM2GOMI.js.map} +1 -1
- package/dist/{chunk-F5WMX4EA.cjs → chunk-M2JWHKO6.cjs} +107 -87
- 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-ITSSOVOB.cjs → chunk-X7O4255I.cjs} +4 -4
- package/dist/{chunk-ITSSOVOB.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/context/index.cjs +6 -5
- package/dist/context/index.cjs.map +1 -1
- package/dist/context/index.js +3 -2
- package/dist/context/index.js.map +1 -1
- package/dist/cron.cjs +11 -10
- package/dist/cron.js +10 -9
- package/dist/eval.cjs +10 -9
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +9 -8
- package/dist/eval.js.map +1 -1
- 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-NG5YENWO.cjs → index-manager-AO4LJQZ4.cjs} +5 -4
- package/dist/{index-manager-NG5YENWO.cjs.map → index-manager-AO4LJQZ4.cjs.map} +1 -1
- package/dist/{index-manager-ZMRJ6ZII.js → index-manager-QDPIYIGV.js} +4 -3
- package/dist/{index-manager-ZMRJ6ZII.js.map → index-manager-QDPIYIGV.js.map} +1 -1
- package/dist/index.cjs +40 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- 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/memory/storage/markdown-store.d.ts +14 -2
- package/dist/internal/memory/storage/memory-file.d.ts +54 -0
- package/dist/internal/memory/types.d.ts +28 -0
- 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/sandbox/index.cjs +1 -1
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/sandbox/index.js.map +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 +7 -5
- package/docs/harness-capability-map.md +3 -2
- 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-5PHVENFV.js.map +0 -1
- package/dist/chunk-5UOVYM3P.cjs.map +0 -1
- package/dist/chunk-DAPSQZT4.js.map +0 -1
- package/dist/chunk-DZBSJX6J.js.map +0 -1
- package/dist/chunk-F5WMX4EA.cjs.map +0 -1
- package/dist/chunk-GJ6RK75E.js.map +0 -1
- package/dist/chunk-I5BE5M5L.js.map +0 -1
- package/dist/chunk-JHPGF3FP.cjs.map +0 -1
- package/dist/chunk-Q47R5E2X.cjs.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,EAAA,EAAI,KAAK,OAAA,CAAQ,MAAA;AAAA,QACjB,IAAA,EAAM,KAAK,OAAA,CAAQ,IAAA;AAAA,QACnB,KAAA,EAAQ,IAAA,CAAK,OAAA,CAAQ,IAAA,IAAgD;AAAC,OACvE,CAAA;AAAA;AAED,MAAA,WAAA,CAAY,IAAA,CAAK;AAAA,QACf,SAAA,EAAW,KAAK,OAAA,CAAQ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AA,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,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,EAAA,EAAI,KAAK,OAAA,CAAQ,MAAA;AAAA,QACjB,IAAA,EAAM,KAA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A,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/context/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkE3WZ6Y4H_cjs = require('../chunk-E3WZ6Y4H.cjs');
|
|
4
|
+
require('../chunk-KRD3GQAA.cjs');
|
|
4
5
|
var chunkZNW6V4Y6_cjs = require('../chunk-ZNW6V4Y6.cjs');
|
|
5
6
|
require('../chunk-VKJ7V7EB.cjs');
|
|
6
7
|
|
|
@@ -12,20 +13,20 @@ function resolveContextImports(content, basePath, options) {
|
|
|
12
13
|
maxBytesPerFile: options.maxBytesPerFile,
|
|
13
14
|
projectRoot: options.projectRoot
|
|
14
15
|
};
|
|
15
|
-
return
|
|
16
|
+
return chunkE3WZ6Y4H_cjs.resolveImports(content, basePath, internalOptions);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
Object.defineProperty(exports, "parseRules", {
|
|
19
20
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkE3WZ6Y4H_cjs.parseRules; }
|
|
21
22
|
});
|
|
22
23
|
Object.defineProperty(exports, "runDiscovery", {
|
|
23
24
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkE3WZ6Y4H_cjs.runDiscovery; }
|
|
25
26
|
});
|
|
26
27
|
Object.defineProperty(exports, "shouldActivateRule", {
|
|
27
28
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkE3WZ6Y4H_cjs.shouldActivateRule; }
|
|
29
30
|
});
|
|
30
31
|
Object.defineProperty(exports, "DEFAULT_DISCOVERY_SPECS", {
|
|
31
32
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/index.ts"],"names":["resolveImports"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/context/index.ts"],"names":["resolveImports"],"mappings":";;;;;;;;AA+FO,SAAS,qBAAA,CACd,OAAA,EACA,QAAA,EACA,OAAA,EACiB;AACjB,EAAA,MAAM,eAAA,GAAyC;AAAA,IAC7C,OAAA,EAAS,OAAA,CAAQ,OAAA,oBAAW,IAAI,GAAA,EAAY;AAAA,IAC5C,KAAA,EAAO,QAAQ,KAAA,IAAS,CAAA;AAAA,IACxB,iBAAiB,OAAA,CAAQ,eAAA;AAAA,IACzB,aAAa,OAAA,CAAQ;AAAA,GACvB;AACA,EAAA,OAAOA,gCAAA,CAAuB,OAAA,EAAS,QAAA,EAAU,eAAe,CAAA;AAClE","file":"index.cjs","sourcesContent":["/**\n * `@theokit/sdk/context` — context assembly, as a SANCTIONED PUBLIC surface.\n *\n * Everything re-exported here is under semver. That is the whole difference from the\n * `internal/*` subpaths (`internal/persistence`, `internal/security`, `internal/memory-adapters`),\n * which the package documents as \"internal API — semver-exempt\" and is retiring:\n * `internal/persistence` is `@deprecated` in favour of the sanctioned `@theokit/sdk/persistence`,\n * and `internal/plugins` + `internal/observability` were deleted as dead public surface in July.\n *\n * **The list is explicit and there is no `export *`.** The tree behind it holds 13 files, including\n * YAML shims and parser internals a consumer never needs. Publishing the directory would commit\n * this package to every file in it; widening this list is a deliberate act.\n *\n * @public\n */\n\nimport {\n type ResolveImportsOptions,\n resolveImports as resolveImportsInternal,\n} from \"../internal/runtime/context/context-import-resolver.js\";\n\nexport type {\n DiscoveryParser,\n DiscoveryScope,\n DiscoverySpec,\n} from \"../internal/runtime/context/context-discovery.js\";\n/**\n * The seven conventions {@link runDiscovery} looks for when `specs` is omitted — `AGENTS.md`,\n * `GEMINI.md`, `CLAUDE.md`, `.cursor/rules/*.mdc`, `.theokit/rules/*.md`, `.theokit/context/*.md`\n * and `.theokit/THEO.md`.\n *\n * Exported because `specs` REPLACES this list rather than extending it. Without the constant, a\n * consumer registering one convention of its own silently loses every built-in one, and the loss is\n * invisible — discovery simply returns fewer sources. Spread it to extend:\n *\n * ```ts\n * await runDiscovery({ cwd, maxBytesPerFile, specs: [...DEFAULT_DISCOVERY_SPECS, mySpec] });\n * ```\n *\n * @public\n */\nexport { DEFAULT_DISCOVERY_SPECS } from \"../internal/runtime/context/context-discovery.js\";\nexport {\n type DiscoveryRunnerOptions,\n runDiscovery,\n} from \"../internal/runtime/context/context-discovery-runner.js\";\nexport {\n parseRules,\n shouldActivateRule,\n} from \"../internal/runtime/context/context-rules-frontmatter.js\";\n\n/**\n * Options for {@link resolveContextImports}.\n *\n * `projectRoot` is REQUIRED here and OPTIONAL on the internal `resolveImports`, and the asymmetry\n * is the point rather than an oversight.\n *\n * Internally the field has to be optional: it was added in 4.41.1 to close a defect where a\n * repository-supplied `CLAUDE.md` could name `@~/.ssh/id_rsa` and have that file inlined into the\n * agent's system prompt, and making it required would have broken every caller that predates it.\n *\n * As a PUBLIC contract the same optionality inverts into a trap. The obvious call omits the field,\n * compiles, and silently restores the un-contained behaviour — so the easiest way to use the API\n * would be the unsafe one, published under semver and therefore unfixable without a breaking\n * change. Requiring it makes the safe call the only call.\n *\n * @public\n */\nexport interface ResolveContextImportsOptions {\n /**\n * The directory an `@import` may not escape, compared after symlink resolution.\n *\n * A document carrying imports is repository-controlled — untrusted input whenever the repository\n * came from somewhere else — so the boundary is not optional.\n */\n readonly projectRoot: string;\n /** Per-import file cap, forwarded to the loader. */\n readonly maxBytesPerFile: number;\n /** Absolute paths already resolved, for cycle detection. Defaults to an empty set. */\n readonly visited?: Set<string>;\n /** Current recursion depth. Defaults to 0; the resolver caps at 5 hops. */\n readonly depth?: number;\n}\n\n/**\n * Expand `@path` import directives in `content`, confined to `options.projectRoot`.\n *\n * A line that is exactly `@some/path` is replaced with that file's content, recursively, with cycle\n * detection and a 5-hop cap. A target resolving outside the root — by `..`, by an absolute path, by\n * `~/`, or through a symlink — is replaced with a refusal placeholder rather than its bytes, and the\n * placeholder echoes the path as the author wrote it rather than as resolved, so a refusal does not\n * leak the layout of the machine back into the same untrusted document.\n *\n * @public\n */\nexport function resolveContextImports(\n content: string,\n basePath: string,\n options: ResolveContextImportsOptions,\n): Promise<string> {\n const internalOptions: ResolveImportsOptions = {\n visited: options.visited ?? new Set<string>(),\n depth: options.depth ?? 0,\n maxBytesPerFile: options.maxBytesPerFile,\n projectRoot: options.projectRoot,\n };\n return resolveImportsInternal(content, basePath, internalOptions);\n}\n"]}
|
package/dist/context/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { resolveImports } from '../chunk-
|
|
2
|
-
export { parseRules, runDiscovery, shouldActivateRule } from '../chunk-
|
|
1
|
+
import { resolveImports } from '../chunk-7FHZ4VQX.js';
|
|
2
|
+
export { parseRules, runDiscovery, shouldActivateRule } from '../chunk-7FHZ4VQX.js';
|
|
3
|
+
import '../chunk-KVNWIAO4.js';
|
|
3
4
|
export { DEFAULT_DISCOVERY_SPECS } from '../chunk-GTKFV7O5.js';
|
|
4
5
|
import '../chunk-RIAM53CP.js';
|
|
5
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/context/index.ts"],"names":[],"mappings":";;;;;;;AA+FO,SAAS,qBAAA,CACd,OAAA,EACA,QAAA,EACA,OAAA,EACiB;AACjB,EAAA,MAAM,eAAA,GAAyC;AAAA,IAC7C,OAAA,EAAS,OAAA,CAAQ,OAAA,oBAAW,IAAI,GAAA,EAAY;AAAA,IAC5C,KAAA,EAAO,QAAQ,KAAA,IAAS,CAAA;AAAA,IACxB,iBAAiB,OAAA,CAAQ,eAAA;AAAA,IACzB,aAAa,OAAA,CAAQ;AAAA,GACvB;AACA,EAAA,OAAO,cAAA,CAAuB,OAAA,EAAS,QAAA,EAAU,eAAe,CAAA;AAClE","file":"index.js","sourcesContent":["/**\n * `@theokit/sdk/context` — context assembly, as a SANCTIONED PUBLIC surface.\n *\n * Everything re-exported here is under semver. That is the whole difference from the\n * `internal/*` subpaths (`internal/persistence`, `internal/security`, `internal/memory-adapters`),\n * which the package documents as \"internal API — semver-exempt\" and is retiring:\n * `internal/persistence` is `@deprecated` in favour of the sanctioned `@theokit/sdk/persistence`,\n * and `internal/plugins` + `internal/observability` were deleted as dead public surface in July.\n *\n * **The list is explicit and there is no `export *`.** The tree behind it holds 13 files, including\n * YAML shims and parser internals a consumer never needs. Publishing the directory would commit\n * this package to every file in it; widening this list is a deliberate act.\n *\n * @public\n */\n\nimport {\n type ResolveImportsOptions,\n resolveImports as resolveImportsInternal,\n} from \"../internal/runtime/context/context-import-resolver.js\";\n\nexport type {\n DiscoveryParser,\n DiscoveryScope,\n DiscoverySpec,\n} from \"../internal/runtime/context/context-discovery.js\";\n/**\n * The seven conventions {@link runDiscovery} looks for when `specs` is omitted — `AGENTS.md`,\n * `GEMINI.md`, `CLAUDE.md`, `.cursor/rules/*.mdc`, `.theokit/rules/*.md`, `.theokit/context/*.md`\n * and `.theokit/THEO.md`.\n *\n * Exported because `specs` REPLACES this list rather than extending it. Without the constant, a\n * consumer registering one convention of its own silently loses every built-in one, and the loss is\n * invisible — discovery simply returns fewer sources. Spread it to extend:\n *\n * ```ts\n * await runDiscovery({ cwd, maxBytesPerFile, specs: [...DEFAULT_DISCOVERY_SPECS, mySpec] });\n * ```\n *\n * @public\n */\nexport { DEFAULT_DISCOVERY_SPECS } from \"../internal/runtime/context/context-discovery.js\";\nexport {\n type DiscoveryRunnerOptions,\n runDiscovery,\n} from \"../internal/runtime/context/context-discovery-runner.js\";\nexport {\n parseRules,\n shouldActivateRule,\n} from \"../internal/runtime/context/context-rules-frontmatter.js\";\n\n/**\n * Options for {@link resolveContextImports}.\n *\n * `projectRoot` is REQUIRED here and OPTIONAL on the internal `resolveImports`, and the asymmetry\n * is the point rather than an oversight.\n *\n * Internally the field has to be optional: it was added in 4.41.1 to close a defect where a\n * repository-supplied `CLAUDE.md` could name `@~/.ssh/id_rsa` and have that file inlined into the\n * agent's system prompt, and making it required would have broken every caller that predates it.\n *\n * As a PUBLIC contract the same optionality inverts into a trap. The obvious call omits the field,\n * compiles, and silently restores the un-contained behaviour — so the easiest way to use the API\n * would be the unsafe one, published under semver and therefore unfixable without a breaking\n * change. Requiring it makes the safe call the only call.\n *\n * @public\n */\nexport interface ResolveContextImportsOptions {\n /**\n * The directory an `@import` may not escape, compared after symlink resolution.\n *\n * A document carrying imports is repository-controlled — untrusted input whenever the repository\n * came from somewhere else — so the boundary is not optional.\n */\n readonly projectRoot: string;\n /** Per-import file cap, forwarded to the loader. */\n readonly maxBytesPerFile: number;\n /** Absolute paths already resolved, for cycle detection. Defaults to an empty set. */\n readonly visited?: Set<string>;\n /** Current recursion depth. Defaults to 0; the resolver caps at 5 hops. */\n readonly depth?: number;\n}\n\n/**\n * Expand `@path` import directives in `content`, confined to `options.projectRoot`.\n *\n * A line that is exactly `@some/path` is replaced with that file's content, recursively, with cycle\n * detection and a 5-hop cap. A target resolving outside the root — by `..`, by an absolute path, by\n * `~/`, or through a symlink — is replaced with a refusal placeholder rather than its bytes, and the\n * placeholder echoes the path as the author wrote it rather than as resolved, so a refusal does not\n * leak the layout of the machine back into the same untrusted document.\n *\n * @public\n */\nexport function resolveContextImports(\n content: string,\n basePath: string,\n options: ResolveContextImportsOptions,\n): Promise<string> {\n const internalOptions: ResolveImportsOptions = {\n visited: options.visited ?? new Set<string>(),\n depth: options.depth ?? 0,\n maxBytesPerFile: options.maxBytesPerFile,\n projectRoot: options.projectRoot,\n };\n return resolveImportsInternal(content, basePath, internalOptions);\n}\n"]}
|
package/dist/cron.cjs
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
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
|
-
require('./chunk-
|
|
20
|
+
require('./chunk-E3WZ6Y4H.cjs');
|
|
21
|
+
require('./chunk-KRD3GQAA.cjs');
|
|
21
22
|
require('./chunk-U2AC6JUP.cjs');
|
|
22
23
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
23
24
|
require('./chunk-WJVHMTKB.cjs');
|
|
@@ -33,7 +34,7 @@ require('./chunk-VKJ7V7EB.cjs');
|
|
|
33
34
|
require('./chunk-ILCGLTSA.cjs');
|
|
34
35
|
require('./chunk-CQGYNZ3K.cjs');
|
|
35
36
|
require('./chunk-4I55V454.cjs');
|
|
36
|
-
require('./chunk-
|
|
37
|
+
require('./chunk-BUIK7GUA.cjs');
|
|
37
38
|
require('./chunk-SKXBJ2NU.cjs');
|
|
38
39
|
require('./chunk-2ADR2GSO.cjs');
|
|
39
40
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
@@ -56,7 +57,7 @@ require('./chunk-NUKRL3I6.cjs');
|
|
|
56
57
|
|
|
57
58
|
Object.defineProperty(exports, "Cron", {
|
|
58
59
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkX7O4255I_cjs.Cron; }
|
|
60
61
|
});
|
|
61
62
|
//# sourceMappingURL=cron.cjs.map
|
|
62
63
|
//# sourceMappingURL=cron.cjs.map
|
package/dist/cron.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
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
|
-
import './chunk-
|
|
18
|
+
import './chunk-7FHZ4VQX.js';
|
|
19
|
+
import './chunk-KVNWIAO4.js';
|
|
19
20
|
import './chunk-UPRJR6IP.js';
|
|
20
21
|
import './chunk-FD2UT76F.js';
|
|
21
22
|
import './chunk-4VPXM6UU.js';
|
|
@@ -31,7 +32,7 @@ import './chunk-RIAM53CP.js';
|
|
|
31
32
|
import './chunk-UC3HT2S4.js';
|
|
32
33
|
import './chunk-OC4NTGMN.js';
|
|
33
34
|
import './chunk-44JAAH4X.js';
|
|
34
|
-
import './chunk-
|
|
35
|
+
import './chunk-FKMUFNQE.js';
|
|
35
36
|
import './chunk-CQ2TQ32Y.js';
|
|
36
37
|
import './chunk-CV7XMBHP.js';
|
|
37
38
|
import './chunk-Q5EWJPRY.js';
|
package/dist/eval.cjs
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
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
|
-
require('./chunk-
|
|
20
|
+
require('./chunk-E3WZ6Y4H.cjs');
|
|
21
|
+
require('./chunk-KRD3GQAA.cjs');
|
|
21
22
|
require('./chunk-U2AC6JUP.cjs');
|
|
22
23
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
23
24
|
require('./chunk-WJVHMTKB.cjs');
|
|
@@ -33,7 +34,7 @@ require('./chunk-VKJ7V7EB.cjs');
|
|
|
33
34
|
require('./chunk-ILCGLTSA.cjs');
|
|
34
35
|
require('./chunk-CQGYNZ3K.cjs');
|
|
35
36
|
require('./chunk-4I55V454.cjs');
|
|
36
|
-
require('./chunk-
|
|
37
|
+
require('./chunk-BUIK7GUA.cjs');
|
|
37
38
|
require('./chunk-SKXBJ2NU.cjs');
|
|
38
39
|
var chunk2ADR2GSO_cjs = require('./chunk-2ADR2GSO.cjs');
|
|
39
40
|
require('./chunk-ZF2LDKQQ.cjs');
|
|
@@ -779,7 +780,7 @@ function makeDefaultEmbedder(opts) {
|
|
|
779
780
|
let runtime;
|
|
780
781
|
return (texts) => {
|
|
781
782
|
if (runtime === void 0) {
|
|
782
|
-
runtime =
|
|
783
|
+
runtime = chunkM2JWHKO6_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
|
|
783
784
|
}
|
|
784
785
|
return runtime.then((rt) => rt.embed(texts));
|
|
785
786
|
};
|