@theokit/sdk 4.56.0 → 4.58.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 +170 -0
- package/dist/{agent-K3PQBS7D.js → agent-6WM4QOWS.js} +15 -14
- package/dist/{agent-K3PQBS7D.js.map → agent-6WM4QOWS.js.map} +1 -1
- package/dist/{agent-PJMBK7HQ.cjs → agent-MIYY7TXV.cjs} +16 -15
- package/dist/{agent-PJMBK7HQ.cjs.map → agent-MIYY7TXV.cjs.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-6VLKVX7O.cjs → chunk-27AXGJMV.cjs} +26 -15
- package/dist/chunk-27AXGJMV.cjs.map +1 -0
- 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-M7UHYBEY.js → chunk-5QOIQJ5J.js} +3 -3
- package/dist/{chunk-M7UHYBEY.js.map → chunk-5QOIQJ5J.js.map} +1 -1
- package/dist/{chunk-E3WZ6Y4H.cjs → chunk-7BG5UH3T.cjs} +8 -8
- package/dist/{chunk-E3WZ6Y4H.cjs.map → chunk-7BG5UH3T.cjs.map} +1 -1
- package/dist/chunk-AQO3NSRG.cjs +41 -0
- package/dist/chunk-AQO3NSRG.cjs.map +1 -0
- package/dist/{chunk-JHPGF3FP.cjs → chunk-BUIK7GUA.cjs} +22 -2
- package/dist/chunk-BUIK7GUA.cjs.map +1 -0
- package/dist/{chunk-KBXWEWKS.js → chunk-CF5OMCZG.js} +87 -43
- package/dist/chunk-CF5OMCZG.js.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-MVAPK2BX.js → chunk-IACR5LEM.js} +3 -3
- package/dist/{chunk-MVAPK2BX.js.map → chunk-IACR5LEM.js.map} +1 -1
- package/dist/{chunk-U2AC6JUP.cjs → chunk-J2UROOIG.cjs} +2 -27
- package/dist/chunk-J2UROOIG.cjs.map +1 -0
- 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-ZNW6V4Y6.cjs → chunk-LKFET5A3.cjs} +23 -2
- package/dist/chunk-LKFET5A3.cjs.map +1 -0
- package/dist/{chunk-YMA4S2WO.js → chunk-MZ2FGBLZ.js} +33 -11
- package/dist/chunk-MZ2FGBLZ.js.map +1 -0
- package/dist/{chunk-LQYQHXIW.cjs → chunk-N47KLTKD.cjs} +163 -119
- package/dist/chunk-N47KLTKD.cjs.map +1 -0
- package/dist/{chunk-53CBTBWO.cjs → chunk-P6H23T43.cjs} +33 -11
- package/dist/chunk-P6H23T43.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-H5GOSXSC.cjs → chunk-QIRDQZYL.cjs} +4 -4
- package/dist/{chunk-H5GOSXSC.cjs.map → chunk-QIRDQZYL.cjs.map} +1 -1
- package/dist/{chunk-7FHZ4VQX.js → chunk-SAVIWMZB.js} +3 -3
- package/dist/{chunk-7FHZ4VQX.js.map → chunk-SAVIWMZB.js.map} +1 -1
- package/dist/{chunk-UPRJR6IP.js → chunk-UCBJBJ27.js} +3 -25
- package/dist/chunk-UCBJBJ27.js.map +1 -0
- package/dist/chunk-UFLD2HEV.js +35 -0
- package/dist/chunk-UFLD2HEV.js.map +1 -0
- package/dist/{chunk-GTKFV7O5.js → chunk-WFC26L6Y.js} +23 -2
- package/dist/chunk-WFC26L6Y.js.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-ODTZ7HX3.js → chunk-WLZ7XRWH.js} +25 -15
- package/dist/chunk-WLZ7XRWH.js.map +1 -0
- package/dist/{chunk-HJBMA5MB.cjs → chunk-WNTAPVU5.cjs} +47 -6
- package/dist/chunk-WNTAPVU5.cjs.map +1 -0
- 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/{chunk-2QKTVKH3.js → chunk-ZHPWGIUX.js} +48 -8
- package/dist/chunk-ZHPWGIUX.js.map +1 -0
- 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 +7 -7
- package/dist/context/index.js +3 -3
- package/dist/{context-VMIE4BMD.cjs → context-LCKNH2XI.cjs} +7 -6
- package/dist/{context-VMIE4BMD.cjs.map → context-LCKNH2XI.cjs.map} +1 -1
- package/dist/context-MZSKGKYR.js +7 -0
- package/dist/{context-FDOON2DB.js.map → context-MZSKGKYR.js.map} +1 -1
- package/dist/cron.cjs +15 -14
- package/dist/cron.js +14 -13
- package/dist/eval.cjs +14 -13
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +13 -12
- 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-WC5ZVJWO.cjs → index-manager-J2QIDI6I.cjs} +5 -4
- package/dist/{index-manager-WC5ZVJWO.cjs.map → index-manager-J2QIDI6I.cjs.map} +1 -1
- package/dist/{index-manager-WBIMDVQT.js → index-manager-WYESAVTX.js} +4 -3
- package/dist/{index-manager-WBIMDVQT.js.map → index-manager-WYESAVTX.js.map} +1 -1
- package/dist/index.cjs +44 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -18
- 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 +13 -0
- package/dist/internal/persistence/index.cjs +17 -16
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js +2 -1
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/persistence/paths.d.cts +42 -0
- package/dist/internal/persistence/paths.d.ts +42 -0
- package/dist/internal/persistence/session-transcript.d.cts +40 -1
- package/dist/internal/persistence/session-transcript.d.ts +40 -1
- package/dist/internal/runtime/plugins/plugin-bundles.d.ts +19 -0
- package/dist/persistence.cjs +4 -4
- package/dist/persistence.js +1 -1
- package/dist/project.cjs +3 -3
- package/dist/project.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/dist/subagents-loader-6ATCDEKN.js +8 -0
- package/dist/{subagents-loader-J54ESLDV.js.map → subagents-loader-6ATCDEKN.js.map} +1 -1
- package/dist/subagents-loader-X5QKODCL.cjs +17 -0
- package/dist/{subagents-loader-AZIXJ7D3.cjs.map → subagents-loader-X5QKODCL.cjs.map} +1 -1
- package/dist/subagents-loader.cjs +3 -2
- package/dist/subagents-loader.cjs.map +1 -1
- package/dist/subagents-loader.js +2 -1
- package/dist/subagents-loader.js.map +1 -1
- package/docs/error-codes.md +19 -19
- 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-2QKTVKH3.js.map +0 -1
- package/dist/chunk-53CBTBWO.cjs.map +0 -1
- 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-GTKFV7O5.js.map +0 -1
- package/dist/chunk-HJBMA5MB.cjs.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-U2AC6JUP.cjs.map +0 -1
- package/dist/chunk-UPRJR6IP.js.map +0 -1
- package/dist/chunk-YMA4S2WO.js.map +0 -1
- package/dist/chunk-YPJ5NH5N.cjs.map +0 -1
- package/dist/chunk-ZNW6V4Y6.cjs.map +0 -1
- package/dist/context-FDOON2DB.js +0 -6
- package/dist/session-transcript-AKDYYGXQ.js +0 -6
- package/dist/session-transcript-JXHFTB7G.cjs +0 -51
- package/dist/subagents-loader-AZIXJ7D3.cjs +0 -16
- package/dist/subagents-loader-J54ESLDV.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/persistence/session-transcript.ts"],"names":["redactSecrets","randomUUID","join","homedir","createHash","path","mkdir","dirname","replaceFileAtomic","readFile"],"mappings":";;;;;;;;;AAkDO,SAAS,iBAAiB,GAAA,EAAqB;AACpD,EAAA,OAAO,GAAA,CAAI,OAAA,CAAQ,eAAA,EAAiB,GAAG,CAAA;AACzC;AAGO,SAAS,cAAc,EAAA,EAAoB;AAChD,EAAA,OAAO,EAAA,CAAG,OAAA,CAAQ,iBAAA,EAAmB,GAAG,CAAA;AAC1C;AAEA,IAAM,GAAA,GAAM,CAAC,CAAA,KAAsBA,+BAAA,CAAc,CAAC,CAAA;AAGlD,SAAS,YAAY,KAAA,EAAyB;AAC5C,EAAA,IAAI;AACF,IAAA,OAAO,IAAA,CAAK,MAAMA,+BAAA,CAAc,IAAA,CAAK,UAAU,KAAA,IAAS,IAAI,CAAC,CAAC,CAAA;AAAA,EAChE,CAAA,CAAA,MAAQ;AACN,IAAA,OAAOA,+BAAA,CAAc,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,EACpC;AACF;AAWO,IAAM,iBAAA,GAAN,MAAM,kBAAA,CAAkB;AAAA,EAC7B,WAA4B,EAAC;AAAA,EAC7B,KAAA,GAAuB,IAAA;AAAA,EACvB,KAAA;AAAA,EAEA,YAAY,IAAA,EAAgC;AAC1C,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAA;AAAA,EACf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V,GAAA,CAAI,eAAe,CAAA,CACnB,MAAA,CAAO,CAAC,CAAA,KAA0B,CAAA,KAAM,MAAS,CAAA;AACtD","file":"chunk-BUIK7GUA.cjs","sourcesContent":["/**\n * SE40 — native session transcript (Claude-Code-compatible on-disk shape, theokit-native names).\n *\n * The theokit session format IS the Claude Code record shape (a `uuid`/`parentUuid` DAG of records with\n * structured `text`/`tool_use`/`tool_result`/`thinking` blocks) — so the ecosystem's read-side tools\n * parse our sessions AND, pointed at `~/.claude`, the Claude Code CLI can `--continue` them. This module\n * is the PURE core: append-per-turn record builders + the DAG reader that rebuilds `LlmMessage[]` for\n * resume. File I/O + loop wiring + append-only compaction live in the FS store.\n *\n * Reader mirrors `claude-code-log` dag.py: leaf = a uuid never used as a parentUuid; walk parentUuid to a\n * root (cycle-break); dedup a uuid across sessions keeping the earliest; a `compact_boundary` root\n * terminates the walk so a resume-after-compaction replays only the post-boundary continuation.\n *\n * reference: knowledge-base/references/claude-code-log/claude_code_log/dag.py + models.py\n */\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { mkdir, readFile } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nimport type { SessionRecord, TranscriptBlock } from \"../../types/session-record.js\";\nimport type { LlmContentPart, LlmMessage, LlmToolResultPart } from \"../llm/types.js\";\nimport { redactSecrets } from \"../security/redact.js\";\nimport { replaceFileAtomic } from \"./atomic-write.js\";\n\n// The `SessionRecord` contract now lives in the domain `types/` layer (SE46 DIP\n// direction). Re-exported here so existing importers of this DAG-core module\n// keep resolving the same name.\nexport type { SessionRecord } from \"../../types/session-record.js\";\n\nexport interface SessionTranscriptOptions {\n cwd: string;\n sessionId: string;\n model: string;\n version?: string;\n}\n\nexport interface AssistantTurn {\n text?: string;\n thinking?: string;\n /**\n * theokit#122 — the provider's signature for the thinking block. Written into the `thinking`\n * record block (`Block` already declared `signature?`), so a resumed session can replay the block\n * exactly as the provider issued it.\n */\n thinkingSignature?: string;\n toolCalls?: Array<{ id: string; name: string; input: Record<string, unknown> }>;\n}\n\n/** Claude Code path convention: cwd with every non-alphanumeric replaced by `-`. */\nexport function encodeProjectDir(cwd: string): string {\n return cwd.replace(/[^a-zA-Z0-9]/g, \"-\");\n}\n\n/** Make a caller-supplied session id safe as a path component (no traversal). */\nexport function safeSessionId(id: string): string {\n return id.replace(/[^a-zA-Z0-9_-]/g, \"-\");\n}\n\nconst red = (s: string): string => redactSecrets(s);\n\n/** Deep-redact a structured value (tool input) preserving object shape. */\nfunction redactValue(value: unknown): unknown {\n try {\n return JSON.parse(redactSecrets(JSON.stringify(value ?? null)));\n } catch {\n return redactSecrets(String(value));\n }\n}\n\n// M94 — it was `Record<string, unknown>`. The published type describes the same shape this file\n// has always produced; the local alias now points at it so writer and reader cannot\n// diverge silently.\ntype Block = TranscriptBlock;\n\n/**\n * Builds a session transcript append-by-append, maintaining the `parentUuid` chain. Each turn mints a\n * fresh `uuid` and parents on the previous record; `appendCompactBoundary` starts a NEW ROOT.\n */\nexport class SessionTranscript {\n #records: SessionRecord[] = [];\n #last: string | null = null;\n #opts: SessionTranscriptOptions;\n\n constructor(opts: SessionTranscriptOptions) {\n this.#opts = opts;\n }\n\n /**\n * Seed a transcript from records already on disk so a subsequent append parents\n * on the existing DAG leaf (the last record in file order). Prior records are\n * re-emitted verbatim by {@link records}, so the whole file rewrites atomically\n * as one append-only line set — never shrinking (SE40 compaction is append-only).\n */\n static fromRecords(\n prior: readonly SessionRecord[],\n opts: SessionTranscriptOptions,\n ): SessionTranscript {\n const t = new SessionTranscript(opts);\n t.#records = [...prior];\n t.#last = prior.length > 0 ? (prior[prior.length - 1]?.uuid ?? null) : null;\n return t;\n }\n\n #push(\n rec: Omit<SessionRecord, \"uuid\" | \"parentUuid\" | \"sessionId\" | \"timestamp\">,\n ): SessionRecord {\n const full: SessionRecord = {\n ...rec,\n uuid: randomUUID(),\n parentUuid: this.#last,\n sessionId: this.#opts.sessionId,\n timestamp: new Date().toISOString(),\n isSidechain: false,\n userType: \"external\",\n cwd: this.#opts.cwd,\n version: this.#opts.version ?? \"1.0.0-theokit\",\n };\n this.#records.push(full);\n this.#last = full.uuid;\n return full;\n }\n\n appendUserTurn(text: string): SessionRecord {\n return this.#push({\n type: \"user\",\n message: { role: \"user\", content: [{ type: \"text\", text: red(text) }] },\n });\n }\n\n appendAssistantTurn(turn: AssistantTurn): SessionRecord {\n const content: Block[] = [];\n if (turn.thinking) {\n // theokit#122 — the signature is computed by the provider over the ORIGINAL text, so it is\n // only valid while the text is byte-identical. Redaction rewrites the text; keeping the\n // signature next to a masked body persists a pair that Anthropic rejects with\n // `400 \"thinking blocks cannot be modified\"` — the very failure this issue exists to remove.\n //\n // So redaction WINS and the signature is dropped. The block survives as display-only history\n // (`thinkingToWireBlock` already refuses to replay an unsigned block), which loses one block\n // of context; keeping a signature that cannot verify would lose the whole turn.\n //\n // The signature itself is never redacted — it is an opaque provider token with no user\n // content — but that was only half the reasoning the first version of this fix wrote down.\n const redactedThinking = red(turn.thinking);\n const signatureStillValid =\n turn.thinkingSignature !== undefined && redactedThinking === turn.thinking;\n content.push({\n type: \"thinking\",\n thinking: redactedThinking,\n ...(signatureStillValid ? { signature: turn.thinkingSignature } : {}),\n });\n }\n if (turn.text) content.push({ type: \"text\", text: red(turn.text) });\n for (const c of turn.toolCalls ?? []) {\n content.push({ type: \"tool_use\", id: c.id, name: c.name, input: redactValue(c.input) });\n }\n return this.#push({\n type: \"assistant\",\n message: {\n id: randomUUID(),\n type: \"message\",\n role: \"assistant\",\n model: this.#opts.model,\n content,\n },\n });\n }\n\n appendToolResults(\n results: Array<{ toolUseId: string; content: string; isError?: boolean }>,\n ): SessionRecord {\n const content: Block[] = results.map((r) => ({\n type: \"tool_result\",\n tool_use_id: r.toolUseId,\n content: red(r.content),\n is_error: r.isError === true,\n }));\n return this.#push({ type: \"user\", message: { role: \"user\", content } });\n }\n\n /** Append-only compaction: a `compact_boundary` system record becomes a NEW ROOT (parentUuid null). */\n appendCompactBoundary(meta: { preTokens: number; trigger: string }): SessionRecord {\n const rec: SessionRecord = {\n type: \"system\",\n uuid: randomUUID(),\n parentUuid: null,\n sessionId: this.#opts.sessionId,\n timestamp: new Date().toISOString(),\n subtype: \"compact_boundary\",\n compactMetadata: meta,\n isSidechain: false,\n userType: \"external\",\n cwd: this.#opts.cwd,\n version: this.#opts.version ?? \"1.0.0-theokit\",\n };\n this.#records.push(rec);\n this.#last = rec.uuid;\n return rec;\n }\n\n records(): readonly SessionRecord[] {\n return this.#records;\n }\n}\n\n// ─── Reader (DAG → LlmMessage[]) ──────────────────────────────────────────────────────────────────\n\n/** Earliest timestamp seen per session id. */\nfunction sessionFirstTimestamps(records: readonly SessionRecord[]): Map<string, string> {\n const first = new Map<string, string>();\n for (const r of records) {\n const cur = first.get(r.sessionId);\n if (cur === undefined || r.timestamp < cur) first.set(r.sessionId, r.timestamp);\n }\n return first;\n}\n\n/** Dedup a uuid across sessions: keep the record whose session's earliest timestamp is smallest. */\nfunction dedupByUuid(records: readonly SessionRecord[]): Map<string, SessionRecord> {\n const firstTs = sessionFirstTimestamps(records);\n const byUuid = new Map<string, SessionRecord>();\n for (const r of records) {\n const existing = byUuid.get(r.uuid);\n const wins =\n existing === undefined ||\n (firstTs.get(r.sessionId) ?? \"\") < (firstTs.get(existing.sessionId) ?? \"\");\n if (wins) byUuid.set(r.uuid, r);\n }\n return byUuid;\n}\n\n/**\n * Map one structured block to an `LlmContentPart`.\n *\n * theokit#122 — thinking blocks used to be DROPPED here, which is why an extended-thinking session\n * could not be resumed: the block never made it back into the replayed messages, so the provider saw\n * a conversation whose assistant turn had lost its thinking. They are now reconstructed with their\n * signature; the Anthropic wire re-serializes signed blocks and skips unsigned ones.\n */\nfunction thinkingBlockToPart(b: Extract<Block, { type: \"thinking\" }>): LlmContentPart {\n return {\n type: \"thinking\",\n text: String(b.thinking ?? \"\"),\n ...(b.signature !== undefined ? { signature: String(b.signature) } : {}),\n };\n}\n\nfunction blockToPart(b: Block): LlmContentPart | undefined {\n if (b.type === \"text\") return { type: \"text\", text: String(b.text ?? \"\") };\n if (b.type === \"thinking\") return thinkingBlockToPart(b);\n if (b.type === \"tool_use\") {\n return {\n type: \"tool_use\",\n id: String(b.id),\n name: String(b.name),\n input: (b.input as Record<string, unknown>) ?? {},\n };\n }\n if (b.type === \"tool_result\") {\n const tr: LlmToolResultPart = {\n type: \"tool_result\",\n toolUseId: String(b.tool_use_id),\n content: typeof b.content === \"string\" ? b.content : JSON.stringify(b.content),\n isError: b.is_error === true,\n };\n return tr;\n }\n return undefined;\n}\n\n/** Map one record to an LlmMessage; `undefined` for non-conversational (system) records. */\nfunction recordToMessage(rec: SessionRecord): LlmMessage | undefined {\n if (rec.type !== \"user\" && rec.type !== \"assistant\") return undefined;\n const blocks = rec.message?.content ?? [];\n const parts = blocks.map(blockToPart).filter((p): p is LlmContentPart => p !== undefined);\n return { role: rec.type, content: parts };\n}\n\n/** The most-recent leaf: the LAST record (in input order) whose uuid is never used as a parentUuid. */\nfunction findLatestLeaf(\n records: readonly SessionRecord[],\n byUuid: Map<string, SessionRecord>,\n parents: Set<string>,\n): SessionRecord | undefined {\n let leaf: SessionRecord | undefined;\n for (const r of records) {\n if (byUuid.get(r.uuid) === r && !parents.has(r.uuid)) leaf = r;\n }\n return leaf;\n}\n\n/** Walk parentUuid from a leaf to a root (cycle-safe), returning root→leaf order. */\nfunction walkToRoot(leaf: SessionRecord, byUuid: Map<string, SessionRecord>): SessionRecord[] {\n const chain: SessionRecord[] = [];\n const seen = new Set<string>();\n let cur: SessionRecord | undefined = leaf;\n while (cur !== undefined && !seen.has(cur.uuid)) {\n seen.add(cur.uuid);\n chain.push(cur);\n cur = cur.parentUuid !== null ? byUuid.get(cur.parentUuid) : undefined;\n }\n return chain.reverse();\n}\n\n/**\n * Rebuild the resumable `LlmMessage[]` from transcript records: dedup → find the most-recent leaf →\n * walk `parentUuid` to a root (a `compact_boundary` root terminates the walk) → map to LlmMessages.\n * Returns them in root→leaf (chronological replay) order.\n */\nexport function reconstructMessages(records: readonly SessionRecord[]): LlmMessage[] {\n const byUuid = dedupByUuid(records);\n const parents = new Set<string>();\n for (const r of byUuid.values()) if (r.parentUuid) parents.add(r.parentUuid);\n const leaf = findLatestLeaf(records, byUuid, parents);\n if (leaf === undefined) return [];\n\n const msgs: LlmMessage[] = [];\n for (const rec of walkToRoot(leaf, byUuid)) {\n const m = recordToMessage(rec);\n if (m !== undefined) msgs.push(m);\n }\n return msgs;\n}\n\n// ─── File I/O (the on-disk Claude layout) ─────────────────────────────────────────────────────────\n\n/**\n * Root of the transcript state.\n *\n * `THEOKIT_HOME` wins; the fallback is `~/.theokit`. Home-anchored on purpose, and NOT\n * `paths.ts`'s `getTheokitHome(cwd)`: that one falls back to `<cwd>/.theokit`, and switching\n * by it would move the transcript of everyone who does **not** set the variable. The sibling with the\n * right shape is `catalog-source-models-dev.ts` (M94 ADR-2).\n *\n * Before M94 this function ignored the env var, so whoever set it had their state split in\n * two silently — sessions stayed in `~/.theokit` while the rest of the SDK migrated.\n */\nexport function transcriptRoot(): string {\n const override = process.env.THEOKIT_HOME?.trim();\n if (override !== undefined && override.length > 0) return override;\n return join(homedir(), \".theokit\");\n}\n\n/** @deprecated Use {@link transcriptRoot}. Kept as an alias — same value. */\nexport function defaultBaseDir(): string {\n return transcriptRoot();\n}\n\n/**\n * Expand a leading `~` / `~/` to the user's home dir. `node:path` does NOT expand `~`, so a\n * `baseDir: \"~/.claude\"` (the documented Claude Code CLI interop path) would otherwise resolve to a\n * literal `./~/.claude` under cwd and the CLI would never find the session. Absolute or relative\n * paths without a leading tilde pass through untouched.\n */\nexport function expandTilde(p: string): string {\n if (p === \"~\") return homedir();\n if (p.startsWith(\"~/\")) return join(homedir(), p.slice(2));\n return p;\n}\n\n/**\n * The fixed namespace for deriving a session UUID from an agent id (RFC 9562 § 5.8, version 8).\n *\n * A constant, because the derivation must be STABLE FOREVER: it is what lets the SDK find the\n * session it wrote last week without storing an id-to-filename map anywhere. Changing this value\n * orphans every transcript ever written.\n */\nconst SESSION_NAMESPACE = Buffer.from(\"b7a1f0c94e3d4a1b8f26d05c3a91e7d2\", \"hex\");\n\nconst UUID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/** Is this id already a canonical UUID, and therefore usable as a filename verbatim? */\nexport function isSessionUuid(id: string): boolean {\n return UUID_SHAPE.test(id);\n}\n\n/**\n * The transcript filename for an agent id — always a UUID.\n *\n * #400: the Claude Code CLI resumes a transcript ONLY when its basename is a UUID. Measured against\n * CLI 2.1.236: `<uuid>.jsonl` resumes; `agent-<uuid>.jsonl` and `billing-bot.jsonl` are both ignored,\n * with no error — the session simply is not offered. So a session written under a human-readable\n * agent id was invisible to `claude --continue`, which is the interoperability this project claims\n * as its difference from a proprietary session store.\n *\n * An id that is ALREADY a UUID passes through verbatim, so a transcript Claude Code wrote keeps its\n * own name and the two directions stay symmetric. Anything else is derived with a UUIDv8, which is\n * deterministic: the same agent id always yields the same filename, so nothing has to be persisted\n * to map one back to the other.\n *\n * A DERIVED name is version 8 — RFC 9562's slot for a UUID whose bits come from an\n * implementation-defined scheme, which is exactly what this is. The obvious alternative was v5, but\n * RFC 4122 fixes v5's hash to SHA-1, and reaching for SHA-1 in 2026 means either shipping a weak\n * primitive or arguing with every scanner that flags it, forever. v8 lets the hash be SHA-256 and\n * lets the version nibble say honestly that this is our scheme rather than a standard one.\n *\n * There is no security claim here either way — no secret, no signature, and nothing an attacker\n * gains by colliding two agent ids inside one consumer's own directory. The hash is a naming\n * function. The point of preferring SHA-256 is not that SHA-1 was exploitable here; it is that a\n * weak primitive in the tree costs a permanent argument with every scanner that sees it.\n *\n * The version nibble was measured, not assumed: CLI 2.1.236 resumes a v8-named transcript exactly as\n * it does a v4 one.\n */\nexport function sessionUuidFor(id: string): string {\n if (isSessionUuid(id)) return id.toLowerCase();\n const hash = createHash(\"sha256\")\n .update(Buffer.concat([SESSION_NAMESPACE, Buffer.from(id, \"utf8\")]))\n .digest();\n const bytes = Buffer.from(hash.subarray(0, 16));\n bytes[6] = ((bytes[6] as number) & 0x0f) | 0x80; // version 8 — RFC 9562 custom\n bytes[8] = ((bytes[8] as number) & 0x3f) | 0x80; // RFC 9562 variant\n const hex = bytes.toString(\"hex\");\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n\n/** The `.jsonl` path for a session: `<baseDir>/projects/<encoded-cwd>/<session-uuid>.jsonl`. */\nexport function transcriptPath(baseDir: string, cwd: string, sessionId: string): string {\n return join(baseDir, \"projects\", encodeProjectDir(cwd), `${sessionUuidFor(sessionId)}.jsonl`);\n}\n\n/**\n * The path this session used BEFORE #400 made transcript filenames UUIDs.\n *\n * Kept so an existing transcript is never orphaned: {@link FsSessionStore} prefers this file when it\n * exists, so history written under the old scheme keeps accumulating in the same file instead of\n * being silently abandoned for a fresh one under the new name.\n */\nexport function legacyTranscriptPath(baseDir: string, cwd: string, sessionId: string): string {\n return join(baseDir, \"projects\", encodeProjectDir(cwd), `${safeSessionId(sessionId)}.jsonl`);\n}\n\n/** Write records as one JSONL line each (atomic; parent dir created). Returns the path. */\nexport async function writeTranscript(\n path: string,\n records: readonly SessionRecord[],\n): Promise<string> {\n await mkdir(dirname(path), { recursive: true });\n const body = records.map((r) => JSON.stringify(r)).join(\"\\n\");\n await replaceFileAtomic(path, records.length > 0 ? `${body}\\n` : \"\");\n return path;\n}\n\n/** Parse one JSONL line to a record; `undefined` for blank/torn/invalid lines (skipped on read). */\nfunction parseRecordLine(line: string): SessionRecord | undefined {\n const trimmed = line.trim();\n if (trimmed.length === 0) return undefined;\n try {\n const rec = JSON.parse(trimmed) as SessionRecord;\n return typeof rec.uuid === \"string\" && typeof rec.type === \"string\" ? rec : undefined;\n } catch {\n return undefined; // a torn last line (crash mid-write) — the rest of the DAG still reconstructs\n }\n}\n\n/** Parse a transcript `.jsonl` into records; a missing file yields `[]`; malformed lines are skipped. */\nexport async function readTranscript(path: string): Promise<SessionRecord[]> {\n let raw: string;\n try {\n raw = await readFile(path, \"utf8\");\n } catch (cause) {\n if ((cause as NodeJS.ErrnoException).code === \"ENOENT\") return [];\n throw cause;\n }\n return raw\n .split(\"\\n\")\n .map(parseRecordLine)\n .filter((r): r is SessionRecord => r !== undefined);\n}\n"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-
|
|
2
|
-
import { IndexManager, writeSessionSummary, memoryDir, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-
|
|
3
|
-
import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-
|
|
1
|
+
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-WG7R5W6R.js';
|
|
2
|
+
import { IndexManager, writeSessionSummary, memoryDir, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-WLZ7XRWH.js';
|
|
3
|
+
import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-MZ2FGBLZ.js';
|
|
4
4
|
import { extractCodePlugins } from './chunk-2SFBB54R.js';
|
|
5
5
|
import { submit, emitRunEvent } from './chunk-SUKXXLWD.js';
|
|
6
6
|
import { createOpenAiCompatibleRuntime } from './chunk-XN7NOENA.js';
|
|
7
|
-
import { FsSessionStore } from './chunk-
|
|
8
|
-
import { discoverProviderPlugins, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, CircuitBreaker, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, resolveProviderChain, inferProviderFromApiKey, detectPrimaryProvider, warnProviderPrecedenceOnce, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-
|
|
7
|
+
import { FsSessionStore } from './chunk-YJDH3CKG.js';
|
|
8
|
+
import { discoverProviderPlugins, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, CircuitBreaker, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, resolveProviderChain, inferProviderFromApiKey, detectPrimaryProvider, warnProviderPrecedenceOnce, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-IACR5LEM.js';
|
|
9
9
|
import { resolveChildEnv } from './chunk-HKCKOAIO.js';
|
|
10
|
-
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-
|
|
11
|
-
import { readVersionedJson,
|
|
10
|
+
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-SAVIWMZB.js';
|
|
11
|
+
import { readVersionedJson, writeVersionedJson } from './chunk-UCBJBJ27.js';
|
|
12
12
|
import { toJsonSchema } from './chunk-4VPXM6UU.js';
|
|
13
13
|
import { sanitizeToolInput } from './chunk-U54XCYG3.js';
|
|
14
14
|
import { withInheritedSubAgentCredentials, subAgentToolsFromDefinitions } from './chunk-RNB4APBZ.js';
|
|
@@ -18,11 +18,12 @@ import { withToolWhitelist, checkToolWhitelist } from './chunk-7AD3ZTZL.js';
|
|
|
18
18
|
import { validateArtifactPath, PathTraversalError, safePathJoin } from './chunk-QARJGQSA.js';
|
|
19
19
|
import { insideRoot, atOrInsideRoot } from './chunk-RIAM53CP.js';
|
|
20
20
|
import { mapWithConcurrency } from './chunk-UC3HT2S4.js';
|
|
21
|
-
import { expandTilde, defaultBaseDir } from './chunk-
|
|
21
|
+
import { expandTilde, defaultBaseDir } from './chunk-FKMUFNQE.js';
|
|
22
22
|
import { withFileLock } from './chunk-CV7XMBHP.js';
|
|
23
23
|
import { withCwdMutex } from './chunk-Q5EWJPRY.js';
|
|
24
24
|
import { atomicWriteJson } from './chunk-VF7EWVDG.js';
|
|
25
|
-
import { loadSubagents } from './chunk-
|
|
25
|
+
import { loadSubagents, pluginBundleDirs } from './chunk-ZHPWGIUX.js';
|
|
26
|
+
import { getTheokitHome, projectConfigRoots, pluginBundleRoots } from './chunk-UFLD2HEV.js';
|
|
26
27
|
import { readWorkspaceDir, parseSimpleYaml } from './chunk-AG5JPQIY.js';
|
|
27
28
|
import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-F7AQV62G.js';
|
|
28
29
|
import { parseModelId } from './chunk-R7WIIPUR.js';
|
|
@@ -915,14 +916,21 @@ async function migrateLegacyJson(cwd, config) {
|
|
|
915
916
|
}
|
|
916
917
|
|
|
917
918
|
// src/internal/runtime/memory/memory-store.ts
|
|
918
|
-
var REMEMBER_PATTERN = /^\s*Remember(?:\s+this\s+durable\s+preference)?\s*:\s*(.+)$/i;
|
|
919
|
+
var REMEMBER_PATTERN = /^\s*Remember(?:\s+this\s+durable\s+preference)?\s*(?:\((user|feedback|project|reference)\))?\s*:\s*(.+)$/i;
|
|
919
920
|
function isMemoryWritePrompt(message) {
|
|
920
921
|
return REMEMBER_PATTERN.test(message) || message.includes("Remember this durable");
|
|
921
922
|
}
|
|
922
923
|
function extractMemoryFact(message) {
|
|
923
924
|
const match = REMEMBER_PATTERN.exec(message);
|
|
924
|
-
if (match === null || match[
|
|
925
|
-
return match[
|
|
925
|
+
if (match === null || match[2] === void 0) return "";
|
|
926
|
+
return match[2].trim().replace(/\.$/, "");
|
|
927
|
+
}
|
|
928
|
+
function extractMemoryKind(message) {
|
|
929
|
+
const match = REMEMBER_PATTERN.exec(message);
|
|
930
|
+
const declared = match?.[1];
|
|
931
|
+
if (declared === void 0) return void 0;
|
|
932
|
+
const lowered = declared.toLowerCase();
|
|
933
|
+
return MEMORY_KINDS.includes(lowered) ? lowered : void 0;
|
|
926
934
|
}
|
|
927
935
|
async function readMemoryFacts(cwd, config) {
|
|
928
936
|
if (!config.enabled) return [];
|
|
@@ -932,7 +940,10 @@ async function readMemoryFacts(cwd, config) {
|
|
|
932
940
|
async function appendMemoryFact(cwd, config, fact) {
|
|
933
941
|
if (!config.enabled) return;
|
|
934
942
|
await migrateLegacyJson(cwd, config);
|
|
935
|
-
const sanitized = {
|
|
943
|
+
const sanitized = {
|
|
944
|
+
text: redactSecrets(fact.text),
|
|
945
|
+
...fact.kind === void 0 ? {} : { kind: fact.kind }
|
|
946
|
+
};
|
|
936
947
|
await appendFact(cwd, config, sanitized);
|
|
937
948
|
}
|
|
938
949
|
|
|
@@ -2913,13 +2924,24 @@ var SkillsManager = class {
|
|
|
2913
2924
|
await this.refresh();
|
|
2914
2925
|
}
|
|
2915
2926
|
async refresh() {
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2927
|
+
const roots = this.skillsDir === void 0 ? [
|
|
2928
|
+
...projectConfigRoots(this.cwd).map((root) => join(root, "skills")),
|
|
2929
|
+
...(await pluginBundleDirs(this.cwd)).map((bundle) => join(bundle, "skills"))
|
|
2930
|
+
] : [this.skillsDir];
|
|
2931
|
+
const discovered = [];
|
|
2932
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2933
|
+
for (const root of roots) {
|
|
2934
|
+
for (const skill of await discoverSkills(root, {
|
|
2935
|
+
onInvalidSkill: (info) => {
|
|
2936
|
+
diag(`[theokit-sdk] skill ${info.name} skipped (${info.code}): ${info.message}
|
|
2920
2937
|
`);
|
|
2938
|
+
}
|
|
2939
|
+
})) {
|
|
2940
|
+
if (seen.has(skill.name)) continue;
|
|
2941
|
+
seen.add(skill.name);
|
|
2942
|
+
discovered.push(skill);
|
|
2921
2943
|
}
|
|
2922
|
-
}
|
|
2944
|
+
}
|
|
2923
2945
|
this.skills = this.mergeInline(discovered);
|
|
2924
2946
|
}
|
|
2925
2947
|
/** M22 — merge inline skills over discovered ones; inline wins on a name conflict. */
|
|
@@ -4235,14 +4257,26 @@ var PluginsManager = class {
|
|
|
4235
4257
|
}
|
|
4236
4258
|
await this.refresh();
|
|
4237
4259
|
}
|
|
4238
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: MD-first + JSON fallback + both-present detection per plugin folder — branch table is clearer inlined.
|
|
4239
4260
|
async refresh() {
|
|
4240
4261
|
this.plugins = [];
|
|
4241
|
-
const pluginsRoot
|
|
4262
|
+
for (const pluginsRoot of pluginBundleRoots(this.cwd)) {
|
|
4263
|
+
await this.refreshRoot(pluginsRoot);
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: MD-first + JSON fallback + CLI location + both-present detection per plugin folder — branch table is clearer inlined.
|
|
4267
|
+
async refreshRoot(pluginsRoot) {
|
|
4242
4268
|
const entries = await readWorkspaceDir(pluginsRoot, "plugins_read_error", "plugins directory");
|
|
4243
4269
|
for (const entry of entries) {
|
|
4244
4270
|
if (!entry.isDirectory()) continue;
|
|
4245
4271
|
const folderName = entry.name;
|
|
4272
|
+
const cliPath = join(pluginsRoot, folderName, ".claude-plugin", "plugin.json");
|
|
4273
|
+
if (existsSync(cliPath)) {
|
|
4274
|
+
const cliMetadata = await loadPluginManifestFromJson(cliPath, folderName);
|
|
4275
|
+
if (this.enabled === void 0 || this.enabled.includes(cliMetadata.name)) {
|
|
4276
|
+
this.plugins.push(cliMetadata);
|
|
4277
|
+
}
|
|
4278
|
+
continue;
|
|
4279
|
+
}
|
|
4246
4280
|
const mdPath = join(pluginsRoot, folderName, "PLUGIN.md");
|
|
4247
4281
|
const jsonPath = join(pluginsRoot, folderName, "plugin.json");
|
|
4248
4282
|
const metadata = existsSync(mdPath) ? await loadPluginManifestFromMarkdown(pluginsRoot, folderName) : await loadPluginManifestFromJson(jsonPath, folderName);
|
|
@@ -8952,7 +8986,7 @@ async function* localAgentStreamToCompletion(agent, message, options) {
|
|
|
8952
8986
|
async function localAgentFork(parent, options) {
|
|
8953
8987
|
const { forkAgentImpl } = await import('./fork-agent-RSV4E3EA.js');
|
|
8954
8988
|
const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
|
|
8955
|
-
const { withPersonalityContext } = await import('./context-
|
|
8989
|
+
const { withPersonalityContext } = await import('./context-MZSKGKYR.js');
|
|
8956
8990
|
const create = getAgentFacade().create;
|
|
8957
8991
|
return withPersonalityContext(
|
|
8958
8992
|
{ slug: parent.personalitySlugSnapshot, isFork: true },
|
|
@@ -8964,8 +8998,12 @@ async function persistMemoryFactIfWritePrompt(workspaceCwd, memoryConfig, userTe
|
|
|
8964
8998
|
if (!isMemoryWritePrompt(userText)) return;
|
|
8965
8999
|
const fact = extractMemoryFact(userText);
|
|
8966
9000
|
if (fact.length === 0) return;
|
|
9001
|
+
const kind = extractMemoryKind(userText);
|
|
8967
9002
|
await safeCall(
|
|
8968
|
-
() => appendMemoryFact(workspaceCwd, memoryConfig, {
|
|
9003
|
+
() => appendMemoryFact(workspaceCwd, memoryConfig, {
|
|
9004
|
+
text: fact,
|
|
9005
|
+
...kind === void 0 ? {} : { kind }
|
|
9006
|
+
}),
|
|
8969
9007
|
void 0,
|
|
8970
9008
|
"memory write"
|
|
8971
9009
|
);
|
|
@@ -9844,22 +9882,28 @@ function missingApiKeyMessage() {
|
|
|
9844
9882
|
if (present.length === 0) return `${base}.`;
|
|
9845
9883
|
return `${base}. ${present.join(" and ")} ${present.length === 1 ? "is" : "are"} set, but a provider credential is not read from the environment automatically \u2014 pass it explicitly, e.g. \`Agent.create({ apiKey: process.env.${present[0]}, ... })\`.`;
|
|
9846
9884
|
}
|
|
9885
|
+
function providerNeedsCallerKey(provider) {
|
|
9886
|
+
if (provider === void 0) return true;
|
|
9887
|
+
const profile = getProviderProfile(provider);
|
|
9888
|
+
if (profile === void 0) return true;
|
|
9889
|
+
return profile.authType === "api_key";
|
|
9890
|
+
}
|
|
9847
9891
|
async function createLocalAgent(options) {
|
|
9892
|
+
const provider = providerFromModelId(normalizeModel(options.model)?.id);
|
|
9848
9893
|
const apiKey = resolveApiKey(options.apiKey);
|
|
9849
9894
|
if (apiKey === void 0) {
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
throw new AuthenticationError(shape.message, { code: "malformed_api_key" });
|
|
9895
|
+
if (providerNeedsCallerKey(provider)) {
|
|
9896
|
+
throw new AuthenticationError(missingApiKeyMessage(), { code: "missing_api_key" });
|
|
9897
|
+
}
|
|
9898
|
+
} else {
|
|
9899
|
+
const willFlowToProvider = keyWillFlowToProvider(apiKey, provider);
|
|
9900
|
+
const shape = validateApiKeyShape(apiKey, {
|
|
9901
|
+
strict: willFlowToProvider,
|
|
9902
|
+
...willFlowToProvider ? { provider } : {}
|
|
9903
|
+
});
|
|
9904
|
+
if (shape.malformed) {
|
|
9905
|
+
throw new AuthenticationError(shape.message, { code: "malformed_api_key" });
|
|
9906
|
+
}
|
|
9863
9907
|
}
|
|
9864
9908
|
const agent = new LocalAgent(options);
|
|
9865
9909
|
await agent.initialize();
|
|
@@ -10356,7 +10400,7 @@ var Agent = class _Agent {
|
|
|
10356
10400
|
`No local agent "${agentId}" registered \u2014 compact targets local sessions.`
|
|
10357
10401
|
);
|
|
10358
10402
|
}
|
|
10359
|
-
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-
|
|
10403
|
+
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-QGDNP45U.js');
|
|
10360
10404
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
10361
10405
|
return enqueueSessionWrite(
|
|
10362
10406
|
cwd,
|
|
@@ -10392,7 +10436,7 @@ var Agent = class _Agent {
|
|
|
10392
10436
|
`No local agent "${agentId}" registered \u2014 injectSessionTurn targets local sessions.`
|
|
10393
10437
|
);
|
|
10394
10438
|
}
|
|
10395
|
-
const { injectSessionTurn } = await import('./inject-session-
|
|
10439
|
+
const { injectSessionTurn } = await import('./inject-session-RBQZ45UM.js');
|
|
10396
10440
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
10397
10441
|
await injectSessionTurn({
|
|
10398
10442
|
store,
|
|
@@ -10431,7 +10475,7 @@ var Agent = class _Agent {
|
|
|
10431
10475
|
`No local agent "${agentId}" registered \u2014 transcript targets local sessions.`
|
|
10432
10476
|
);
|
|
10433
10477
|
}
|
|
10434
|
-
const { readSessionMessages } = await import('./agent-session-store-
|
|
10478
|
+
const { readSessionMessages } = await import('./agent-session-store-G2BMUZQV.js');
|
|
10435
10479
|
const { store } = await openLocalStore(reg);
|
|
10436
10480
|
return readSessionMessages(store, agentId);
|
|
10437
10481
|
}
|
|
@@ -10452,7 +10496,7 @@ var Agent = class _Agent {
|
|
|
10452
10496
|
*/
|
|
10453
10497
|
static async describe(agentId) {
|
|
10454
10498
|
const agent = await getRegisteredAgentOrThrow(agentId);
|
|
10455
|
-
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-
|
|
10499
|
+
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-6ATCDEKN.js');
|
|
10456
10500
|
const settingSources = agent.options.local?.settingSources;
|
|
10457
10501
|
const subagents = await loadSubagents2(
|
|
10458
10502
|
agent.cwd ?? process.cwd(),
|
|
@@ -10519,13 +10563,13 @@ async function openLocalStore(reg) {
|
|
|
10519
10563
|
const cwd = reg.cwd ?? process.cwd();
|
|
10520
10564
|
const optModel = reg.options.model;
|
|
10521
10565
|
const model = reg.model?.id ?? (typeof optModel === "string" ? optModel : optModel?.id) ?? "unknown";
|
|
10522
|
-
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-
|
|
10523
|
-
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-
|
|
10566
|
+
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-4BHGIWRE.js');
|
|
10567
|
+
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-P462ZRHX.js');
|
|
10524
10568
|
const configuredSessionDir = reg.options.local?.sessionDir ?? reg.options.local?.baseDir;
|
|
10525
10569
|
const baseDir = configuredSessionDir !== void 0 ? expandTilde2(configuredSessionDir) : defaultBaseDir2();
|
|
10526
10570
|
return { cwd, model, store: new FsSessionStore2({ baseDir, cwd }) };
|
|
10527
10571
|
}
|
|
10528
10572
|
|
|
10529
10573
|
export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, openRouterMemoryEmbeddingProviderAdapter };
|
|
10530
|
-
//# sourceMappingURL=chunk-
|
|
10531
|
-
//# sourceMappingURL=chunk-
|
|
10574
|
+
//# sourceMappingURL=chunk-CF5OMCZG.js.map
|
|
10575
|
+
//# sourceMappingURL=chunk-CF5OMCZG.js.map
|