@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.
Files changed (151) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/dist/{agent-K3PQBS7D.js → agent-6WM4QOWS.js} +15 -14
  3. package/dist/{agent-K3PQBS7D.js.map → agent-6WM4QOWS.js.map} +1 -1
  4. package/dist/{agent-PJMBK7HQ.cjs → agent-MIYY7TXV.cjs} +16 -15
  5. package/dist/{agent-PJMBK7HQ.cjs.map → agent-MIYY7TXV.cjs.map} +1 -1
  6. package/dist/agent-session-store-G2BMUZQV.js +7 -0
  7. package/dist/{agent-session-store-P6V3FINW.js.map → agent-session-store-G2BMUZQV.js.map} +1 -1
  8. package/dist/agent-session-store-WAKLOKWK.cjs +24 -0
  9. package/dist/{agent-session-store-ZJ3JSRS4.cjs.map → agent-session-store-WAKLOKWK.cjs.map} +1 -1
  10. package/dist/{chunk-6VLKVX7O.cjs → chunk-27AXGJMV.cjs} +26 -15
  11. package/dist/chunk-27AXGJMV.cjs.map +1 -0
  12. package/dist/{chunk-HLPSLDGL.cjs → chunk-43GFJ5SD.cjs} +7 -7
  13. package/dist/{chunk-HLPSLDGL.cjs.map → chunk-43GFJ5SD.cjs.map} +1 -1
  14. package/dist/{chunk-M7UHYBEY.js → chunk-5QOIQJ5J.js} +3 -3
  15. package/dist/{chunk-M7UHYBEY.js.map → chunk-5QOIQJ5J.js.map} +1 -1
  16. package/dist/{chunk-E3WZ6Y4H.cjs → chunk-7BG5UH3T.cjs} +8 -8
  17. package/dist/{chunk-E3WZ6Y4H.cjs.map → chunk-7BG5UH3T.cjs.map} +1 -1
  18. package/dist/chunk-AQO3NSRG.cjs +41 -0
  19. package/dist/chunk-AQO3NSRG.cjs.map +1 -0
  20. package/dist/{chunk-JHPGF3FP.cjs → chunk-BUIK7GUA.cjs} +22 -2
  21. package/dist/chunk-BUIK7GUA.cjs.map +1 -0
  22. package/dist/{chunk-KBXWEWKS.js → chunk-CF5OMCZG.js} +87 -43
  23. package/dist/chunk-CF5OMCZG.js.map +1 -0
  24. package/dist/{chunk-DZBSJX6J.js → chunk-FKMUFNQE.js} +21 -4
  25. package/dist/chunk-FKMUFNQE.js.map +1 -0
  26. package/dist/{chunk-BMAZLQQ4.js → chunk-G24KZRSA.js} +3 -3
  27. package/dist/{chunk-BMAZLQQ4.js.map → chunk-G24KZRSA.js.map} +1 -1
  28. package/dist/{chunk-MVAPK2BX.js → chunk-IACR5LEM.js} +3 -3
  29. package/dist/{chunk-MVAPK2BX.js.map → chunk-IACR5LEM.js.map} +1 -1
  30. package/dist/{chunk-U2AC6JUP.cjs → chunk-J2UROOIG.cjs} +2 -27
  31. package/dist/chunk-J2UROOIG.cjs.map +1 -0
  32. package/dist/{chunk-V2UUGUY4.cjs → chunk-KKK3FZ4A.cjs} +6 -6
  33. package/dist/{chunk-V2UUGUY4.cjs.map → chunk-KKK3FZ4A.cjs.map} +1 -1
  34. package/dist/{chunk-ZNW6V4Y6.cjs → chunk-LKFET5A3.cjs} +23 -2
  35. package/dist/chunk-LKFET5A3.cjs.map +1 -0
  36. package/dist/{chunk-YMA4S2WO.js → chunk-MZ2FGBLZ.js} +33 -11
  37. package/dist/chunk-MZ2FGBLZ.js.map +1 -0
  38. package/dist/{chunk-LQYQHXIW.cjs → chunk-N47KLTKD.cjs} +163 -119
  39. package/dist/chunk-N47KLTKD.cjs.map +1 -0
  40. package/dist/{chunk-53CBTBWO.cjs → chunk-P6H23T43.cjs} +33 -11
  41. package/dist/chunk-P6H23T43.cjs.map +1 -0
  42. package/dist/{chunk-YPJ5NH5N.cjs → chunk-QI7WE46I.cjs} +29 -6
  43. package/dist/chunk-QI7WE46I.cjs.map +1 -0
  44. package/dist/{chunk-H5GOSXSC.cjs → chunk-QIRDQZYL.cjs} +4 -4
  45. package/dist/{chunk-H5GOSXSC.cjs.map → chunk-QIRDQZYL.cjs.map} +1 -1
  46. package/dist/{chunk-7FHZ4VQX.js → chunk-SAVIWMZB.js} +3 -3
  47. package/dist/{chunk-7FHZ4VQX.js.map → chunk-SAVIWMZB.js.map} +1 -1
  48. package/dist/{chunk-UPRJR6IP.js → chunk-UCBJBJ27.js} +3 -25
  49. package/dist/chunk-UCBJBJ27.js.map +1 -0
  50. package/dist/chunk-UFLD2HEV.js +35 -0
  51. package/dist/chunk-UFLD2HEV.js.map +1 -0
  52. package/dist/{chunk-GTKFV7O5.js → chunk-WFC26L6Y.js} +23 -2
  53. package/dist/chunk-WFC26L6Y.js.map +1 -0
  54. package/dist/{chunk-OHBIUXKM.js → chunk-WG7R5W6R.js} +4 -4
  55. package/dist/{chunk-OHBIUXKM.js.map → chunk-WG7R5W6R.js.map} +1 -1
  56. package/dist/{chunk-ODTZ7HX3.js → chunk-WLZ7XRWH.js} +25 -15
  57. package/dist/chunk-WLZ7XRWH.js.map +1 -0
  58. package/dist/{chunk-HJBMA5MB.cjs → chunk-WNTAPVU5.cjs} +47 -6
  59. package/dist/chunk-WNTAPVU5.cjs.map +1 -0
  60. package/dist/{chunk-GJ6RK75E.js → chunk-YJDH3CKG.js} +29 -6
  61. package/dist/chunk-YJDH3CKG.js.map +1 -0
  62. package/dist/{chunk-CTCGWIUD.cjs → chunk-Z4BCLVTI.cjs} +5 -5
  63. package/dist/{chunk-CTCGWIUD.cjs.map → chunk-Z4BCLVTI.cjs.map} +1 -1
  64. package/dist/{chunk-2QKTVKH3.js → chunk-ZHPWGIUX.js} +48 -8
  65. package/dist/chunk-ZHPWGIUX.js.map +1 -0
  66. package/dist/{compact-session-FUJDVF7B.js → compact-session-QGDNP45U.js} +4 -4
  67. package/dist/{compact-session-FUJDVF7B.js.map → compact-session-QGDNP45U.js.map} +1 -1
  68. package/dist/{compact-session-LEWF554G.cjs → compact-session-YHFQIXV5.cjs} +12 -12
  69. package/dist/{compact-session-LEWF554G.cjs.map → compact-session-YHFQIXV5.cjs.map} +1 -1
  70. package/dist/context/index.cjs +7 -7
  71. package/dist/context/index.js +3 -3
  72. package/dist/{context-VMIE4BMD.cjs → context-LCKNH2XI.cjs} +7 -6
  73. package/dist/{context-VMIE4BMD.cjs.map → context-LCKNH2XI.cjs.map} +1 -1
  74. package/dist/context-MZSKGKYR.js +7 -0
  75. package/dist/{context-FDOON2DB.js.map → context-MZSKGKYR.js.map} +1 -1
  76. package/dist/cron.cjs +15 -14
  77. package/dist/cron.js +14 -13
  78. package/dist/eval.cjs +14 -13
  79. package/dist/eval.cjs.map +1 -1
  80. package/dist/eval.js +13 -12
  81. package/dist/eval.js.map +1 -1
  82. package/dist/{fs-session-store-IN7JTTXD.js → fs-session-store-4BHGIWRE.js} +4 -4
  83. package/dist/{fs-session-store-IN7JTTXD.js.map → fs-session-store-4BHGIWRE.js.map} +1 -1
  84. package/dist/{fs-session-store-3MOJQGP2.cjs → fs-session-store-XZ7ZTB3A.cjs} +5 -5
  85. package/dist/{fs-session-store-3MOJQGP2.cjs.map → fs-session-store-XZ7ZTB3A.cjs.map} +1 -1
  86. package/dist/{index-manager-WC5ZVJWO.cjs → index-manager-J2QIDI6I.cjs} +5 -4
  87. package/dist/{index-manager-WC5ZVJWO.cjs.map → index-manager-J2QIDI6I.cjs.map} +1 -1
  88. package/dist/{index-manager-WBIMDVQT.js → index-manager-WYESAVTX.js} +4 -3
  89. package/dist/{index-manager-WBIMDVQT.js.map → index-manager-WYESAVTX.js.map} +1 -1
  90. package/dist/index.cjs +44 -45
  91. package/dist/index.cjs.map +1 -1
  92. package/dist/index.d.cts +1 -1
  93. package/dist/index.d.ts +1 -1
  94. package/dist/index.js +17 -18
  95. package/dist/index.js.map +1 -1
  96. package/dist/{inject-session-WQGGMCQY.cjs → inject-session-MLCJMYDG.cjs} +7 -7
  97. package/dist/{inject-session-WQGGMCQY.cjs.map → inject-session-MLCJMYDG.cjs.map} +1 -1
  98. package/dist/{inject-session-BJMJH5BX.js → inject-session-RBQZ45UM.js} +5 -5
  99. package/dist/{inject-session-BJMJH5BX.js.map → inject-session-RBQZ45UM.js.map} +1 -1
  100. package/dist/internal/memory/storage/markdown-store.d.ts +13 -0
  101. package/dist/internal/persistence/index.cjs +17 -16
  102. package/dist/internal/persistence/index.cjs.map +1 -1
  103. package/dist/internal/persistence/index.js +2 -1
  104. package/dist/internal/persistence/index.js.map +1 -1
  105. package/dist/internal/persistence/paths.d.cts +42 -0
  106. package/dist/internal/persistence/paths.d.ts +42 -0
  107. package/dist/internal/persistence/session-transcript.d.cts +40 -1
  108. package/dist/internal/persistence/session-transcript.d.ts +40 -1
  109. package/dist/internal/runtime/plugins/plugin-bundles.d.ts +19 -0
  110. package/dist/persistence.cjs +4 -4
  111. package/dist/persistence.js +1 -1
  112. package/dist/project.cjs +3 -3
  113. package/dist/project.js +1 -1
  114. package/dist/session-transcript-HF5GEU5M.cjs +63 -0
  115. package/dist/{session-transcript-JXHFTB7G.cjs.map → session-transcript-HF5GEU5M.cjs.map} +1 -1
  116. package/dist/session-transcript-P462ZRHX.js +6 -0
  117. package/dist/{session-transcript-AKDYYGXQ.js.map → session-transcript-P462ZRHX.js.map} +1 -1
  118. package/dist/subagents-loader-6ATCDEKN.js +8 -0
  119. package/dist/{subagents-loader-J54ESLDV.js.map → subagents-loader-6ATCDEKN.js.map} +1 -1
  120. package/dist/subagents-loader-X5QKODCL.cjs +17 -0
  121. package/dist/{subagents-loader-AZIXJ7D3.cjs.map → subagents-loader-X5QKODCL.cjs.map} +1 -1
  122. package/dist/subagents-loader.cjs +3 -2
  123. package/dist/subagents-loader.cjs.map +1 -1
  124. package/dist/subagents-loader.js +2 -1
  125. package/dist/subagents-loader.js.map +1 -1
  126. package/docs/error-codes.md +19 -19
  127. package/docs/harness-capability-map.md +1 -1
  128. package/package.json +5 -9
  129. package/dist/agent-session-store-P6V3FINW.js +0 -7
  130. package/dist/agent-session-store-ZJ3JSRS4.cjs +0 -24
  131. package/dist/chunk-2QKTVKH3.js.map +0 -1
  132. package/dist/chunk-53CBTBWO.cjs.map +0 -1
  133. package/dist/chunk-6VLKVX7O.cjs.map +0 -1
  134. package/dist/chunk-DZBSJX6J.js.map +0 -1
  135. package/dist/chunk-GJ6RK75E.js.map +0 -1
  136. package/dist/chunk-GTKFV7O5.js.map +0 -1
  137. package/dist/chunk-HJBMA5MB.cjs.map +0 -1
  138. package/dist/chunk-JHPGF3FP.cjs.map +0 -1
  139. package/dist/chunk-KBXWEWKS.js.map +0 -1
  140. package/dist/chunk-LQYQHXIW.cjs.map +0 -1
  141. package/dist/chunk-ODTZ7HX3.js.map +0 -1
  142. package/dist/chunk-U2AC6JUP.cjs.map +0 -1
  143. package/dist/chunk-UPRJR6IP.js.map +0 -1
  144. package/dist/chunk-YMA4S2WO.js.map +0 -1
  145. package/dist/chunk-YPJ5NH5N.cjs.map +0 -1
  146. package/dist/chunk-ZNW6V4Y6.cjs.map +0 -1
  147. package/dist/context-FDOON2DB.js +0 -6
  148. package/dist/session-transcript-AKDYYGXQ.js +0 -6
  149. package/dist/session-transcript-JXHFTB7G.cjs +0 -51
  150. package/dist/subagents-loader-AZIXJ7D3.cjs +0 -16
  151. package/dist/subagents-loader-J54ESLDV.js +0 -7
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/internal/persistence/fs-session-store.ts"],"names":[],"mappings":";;;;;;;AA2DA,IAAM,YAAA,uBAAmB,GAAA,EAAyD;AAElF,eAAe,cAAc,IAAA,EAA2C;AACtE,EAAA,MAAM,QAAA,GAAW,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACtC,EAAA,IAAI,aAAa,MAAA,EAAW;AAC1B,IAAA,QAAA,CAAS,IAAA,EAAA;AACT,IAAA,OAAO,YAAY,IAAI,CAAA;AAAA,EACzB;AACA,EAAA,MAAM,KAAA,GAAQ,MAAM,oBAAA,CAAqB,IAAI,CAAA;AAC7C,EAAA,YAAA,CAAa,IAAI,IAAA,EAAM,EAAE,KAAA,EAAO,IAAA,EAAM,GAAG,CAAA;AACzC,EAAA,OAAO,YAAY,IAAI,CAAA;AACzB;AAGA,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IAAA,CAAK,QAAQ,GAAA,CAAI,OAAA,EAAS,MAAM,aAAA,CAAc,IAAI,CAAC,CAAA;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,QAAQ,OAAA,EAAgC;AAC5C,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,OAAA,CAAQ,GAAA,CAAI,OAAO,CAAA;AACtC,IAAA,IAAI,UAAU,MAAA,EAAW;AACzB,IAAA,IAAA,CAAK,OAAA,CAAQ,OAAO,OAAO,CAAA;AAC3B,IAAA,MAAM,MAAM,OAAA,EAAQ;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,OAAA,GAAyB;AAC7B,IAAA,MAAM,SAAS,CAAC,GAAG,IAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA;AACxC,IAAA,IAAA,CAAK,QAAQ,KAAA,EAAM;AACnB,IAAA,KAAA,MAAW,KAAA,IAAS,MAAA,EAAQ,MAAM,KAAA,CAAM,OAAA,EAAQ;AAAA,EAClD;AACF","file":"chunk-YJDH3CKG.js","sourcesContent":["/**\n * SE41 — `FsSessionStore`, the DEFAULT reference implementation of the pluggable\n * {@link SessionStore} seam. It reads and append-writes the native Claude-shaped\n * `.jsonl` transcript at `<baseDir>/projects/<encoded-cwd>/<agentId>.jsonl` — the\n * exact on-disk format SE40 introduced (the file the Claude Code CLI can\n * `--continue`). Omitting `local.sessionStore` resolves to this store, so the\n * default persistence path is byte-identical to SE40 behavior.\n *\n * `readRecords` is `readTranscript(transcriptPath(...))` (a missing session →\n * `[]`, not an error — a fresh agent has no history). `appendRecords` is a TRUE\n * append: it reads the prior records, concatenates the new-turn delta, and\n * rewrites the whole line set atomically under the SE40 cross-process file lock\n * (`writeTranscript` never shrinks — the native format is an append-only\n * `parentUuid` DAG). The parent dir is created BEFORE acquiring the lock because\n * the lock's companion `<path>.lock` file needs an existing parent dir (the SE40\n * `mkdir(dirname)`-before-lock fix).\n *\n * @internal\n */\n\nimport { existsSync } from \"node:fs\";\nimport { mkdir } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { withFileLock } from \"./file-lock.js\";\nimport { appendJsonl } from \"./jsonl.js\";\nimport {\n legacyTranscriptPath,\n readTranscript,\n type SessionRecord,\n transcriptPath,\n} from \"./session-transcript.js\";\nimport { acquireSessionWriter, type SessionWriterLease } from \"./session-writer.js\";\n\n/** Options identifying the on-disk transcript location for the FS default store. */\nexport interface FsSessionStoreOptions {\n /** Transcript base dir (`~/.theokit` default, `~/.claude` for CLI interop) — already `~`-expanded. */\n baseDir: string;\n /** The workspace cwd whose encoded form is the transcript project dir. */\n cwd: string;\n}\n\n/**\n * Reference-counted leases, shared per path.\n *\n * `acquireSessionWriter` is STRICT on purpose: two concurrent acquisitions of the same path, and\n * exactly one wins — \"a lease that let both through would be decorative\" (the M81 test says exactly\n * that, and it is right). That is the primitive's contract, and it does not change.\n *\n * But within ONE process it is normal to have more than one store over the same session: the golden\n * compaction tests and the concurrent-send tests do exactly that, and they record real runtime\n * behavior. Applying the raw primitive there would turn a legitimate pattern into a\n * `SessionBusyError`.\n *\n * The reconciliation belongs here, in the primitive's consumer: the process takes ONE lease per path\n * and counts how many stores use it. The last to release actually frees it. Cross-process stays\n * strict — which is the problem M81 states (\"`exec resume --last` can write into the TUI's live\n * session\").\n */\nconst sharedLeases = new Map<string, { lease: SessionWriterLease; refs: number }>();\n\nasync function acquireShared(path: string): Promise<SessionWriterLease> {\n const existing = sharedLeases.get(path);\n if (existing !== undefined) {\n existing.refs++;\n return createProxy(path);\n }\n const lease = await acquireSessionWriter(path);\n sharedLeases.set(path, { lease, refs: 1 });\n return createProxy(path);\n}\n\n/** A handle that decrements the count; the last to release frees the real lease. */\nfunction createProxy(path: string): SessionWriterLease {\n let released = false;\n return {\n sessionPath: path,\n // The proxy forwards the renewal to the ONE real lease this path shares. Renewing through any\n // holder is correct and is the point: the record must say \"someone in this process is still\n // writing\", and the refcount already guarantees they are all the same owner.\n renew: (): void => {\n if (released) return;\n sharedLeases.get(path)?.lease.renew();\n },\n release: async (): Promise<void> => {\n if (released) return;\n released = true;\n const entry = sharedLeases.get(path);\n if (entry === undefined) return;\n entry.refs--;\n if (entry.refs > 0) return;\n sharedLeases.delete(path);\n await entry.lease.release();\n },\n };\n}\n\n/**\n * The default `SessionStore` — reads/append-writes the native `.jsonl` transcript.\n */\nexport class FsSessionStore implements SessionStore {\n readonly #baseDir: string;\n readonly #cwd: string;\n /** One lease per `agentId` — a store serves more than one session over the process lifetime. */\n readonly #leases = new Map<string, SessionWriterLease>();\n /** Memoized per agent so read, append and lease can never disagree about which file is the session. */\n readonly #paths = new Map<string, string>();\n\n constructor(options: FsSessionStoreOptions) {\n this.#baseDir = options.baseDir;\n this.#cwd = options.cwd;\n }\n\n /**\n * The file that IS this agent's session.\n *\n * #400 made transcript filenames UUIDs so `claude --continue` can find them. A transcript written\n * before that lives under the old name, and switching to the new one would not lose the file but\n * would abandon it: the agent would start a second, empty history beside its real one. So an\n * existing legacy file wins, and only a session with no file yet gets the new name.\n *\n * Resolved ONCE per agent. Re-deciding per call would let `acquire` lock one path while\n * `appendRecords` wrote another — the lease would be guarding a file nobody was writing.\n */\n #pathFor(agentId: string): string {\n const memoized = this.#paths.get(agentId);\n if (memoized !== undefined) return memoized;\n const canonical = transcriptPath(this.#baseDir, this.#cwd, agentId);\n const legacy = legacyTranscriptPath(this.#baseDir, this.#cwd, agentId);\n const resolved = legacy !== canonical && existsSync(legacy) ? legacy : canonical;\n this.#paths.set(agentId, resolved);\n return resolved;\n }\n\n async readRecords(agentId: string): Promise<SessionRecord[]> {\n return readTranscript(this.#pathFor(agentId));\n }\n\n async appendRecords(agentId: string, records: readonly SessionRecord[]): Promise<void> {\n // Empty delta → nothing to persist (avoids an unnecessary lock + rewrite).\n if (records.length === 0) return;\n const path = this.#pathFor(agentId);\n // mkdir BEFORE the lock: withFileLock's companion `<path>.lock` needs the parent dir.\n await mkdir(dirname(path), { recursive: true });\n\n await withFileLock(path, async () => {\n // M93 — appends the DELTA instead of rewriting the whole file.\n //\n // Before: `readTranscript` + `writeTranscript` of everything, per turn. O(n) of I/O **and** of\n // parsing on every turn, O(n^2) per session — the consumer note in\n // `agents/lib/session/backtrack.ts` records 1.4 MB / 3000 lines over 200 turns.\n //\n // Correct because the format **is already append-only**: the `parentUuid` DAG does not depend\n // on line order, and every record carries its own parent. `appendJsonl` **already existed in\n // the package** and had a single caller (`eval/runner.ts`) — the primitive was there, it was\n // the store that ignored it (rung 4).\n //\n // `withFileLock` stays — but the earlier claim that \"it is what serializes two concurrent\n // `appendRecords`\" was too strong, and M93's adversarial review measured it: removing it fails\n // no test. The reason is the paragraph above — the `parentUuid` DAG does not depend on line\n // order, so two interleaved batches reconstruct identically. The work the lock was doing\n // (protecting a read-modify-write) disappeared along with the rewrite.\n //\n // What it still covers is the TOCTOU window in `needsLineBreakBefore` (read the last byte,\n // then write): without it, two processes can both conclude \"a \\n is missing\" and produce a\n // blank line — which the reader discards, i.e. benign. It stays as a **declared, not\n // mechanized** defense (the discipline in `error-handling.md` § 4: enumerate the residue\n // rather than let a missing test pass for coverage).\n //\n // `writeTranscript` still exists for **compaction**, the one operation that legitimately\n // rewrites the file.\n for (const record of records) appendJsonl(path, record);\n });\n }\n\n /**\n * Takes the session's writer lease. Throws `SessionBusyError` when another process holds it.\n *\n * **Explicit, and NOT inside `appendRecords`** — M95's adversarial review measured why that\n * matters: the `SessionStore` contract states that \"an `appendRecords` rejection is logged to\n * stderr, NOT thrown to the caller (best-effort write)\". Acquiring there made the\n * `SessionBusyError` get **swallowed**, and the result was worse than the original problem:\n * instead of two writers interleaving lines, the loser **lost the turn silently** — nothing on\n * disk, a stderr warning invisible under the TUI, and no way for the caller to react.\n *\n * At init the error reaches someone who can act: `exec` forks to a new id, which is exactly what\n * the error message itself prescribes. It is the difference between failing where a decision is\n * possible and failing where only loss is.\n */\n async acquire(agentId: string): Promise<void> {\n if (this.#leases.has(agentId)) return;\n const path = this.#pathFor(agentId);\n await mkdir(dirname(path), { recursive: true });\n this.#leases.set(agentId, await acquireShared(path));\n }\n\n /**\n * Releases ONE agent's lease.\n *\n * It exists because `dispose()` releases **every** lease the store holds, and a store injected by\n * the consumer may serve several agents: an init that fails for agent B must not free agent A's\n * lease, which is still live and writing.\n */\n async release(agentId: string): Promise<void> {\n const lease = this.#leases.get(agentId);\n if (lease === undefined) return;\n this.#leases.delete(agentId);\n await lease.release();\n }\n\n /**\n * Releases every lease this store holds.\n *\n * Without it the `.writer.lock` outlives the process and the next open would have to wait out the\n * heartbeat window — recoverable, but 30 s of waiting after a CLEAN shutdown would be an avoidable\n * defect. Idempotent: calling it twice is not an error.\n */\n async dispose(): Promise<void> {\n const leases = [...this.#leases.values()];\n this.#leases.clear();\n for (const lease of leases) await lease.release();\n }\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkJHPGF3FP_cjs = require('./chunk-JHPGF3FP.cjs');
3
+ var chunkBUIK7GUA_cjs = require('./chunk-BUIK7GUA.cjs');
4
4
 
5
5
  // src/internal/session/agent-session-store.ts
6
6
  function seedTranscript(prior, opts) {
7
- return chunkJHPGF3FP_cjs.SessionTranscript.fromRecords(prior, opts);
7
+ return chunkBUIK7GUA_cjs.SessionTranscript.fromRecords(prior, opts);
8
8
  }
9
9
  function applyThinkingStep(assistant, message) {
10
10
  assistant.thinking = message.text;
@@ -46,7 +46,7 @@ function appendConversation(transcript, conversation) {
46
46
  }
47
47
  async function readSessionMessages(store, agentId) {
48
48
  const records = await store.readRecords(agentId);
49
- return chunkJHPGF3FP_cjs.reconstructMessages(records).map(narrowToSessionMessage);
49
+ return chunkBUIK7GUA_cjs.reconstructMessages(records).map(narrowToSessionMessage);
50
50
  }
51
51
  function partToText(p) {
52
52
  if (p.type === "text") return p.text ?? "";
@@ -105,5 +105,5 @@ async function appendCompactBoundaryRecord(store, loc, sessionId, meta) {
105
105
  exports.appendCompactBoundaryRecord = appendCompactBoundaryRecord;
106
106
  exports.persistTurn = persistTurn;
107
107
  exports.readSessionMessages = readSessionMessages;
108
- //# sourceMappingURL=chunk-CTCGWIUD.cjs.map
109
- //# sourceMappingURL=chunk-CTCGWIUD.cjs.map
108
+ //# sourceMappingURL=chunk-Z4BCLVTI.cjs.map
109
+ //# sourceMappingURL=chunk-Z4BCLVTI.cjs.map
@@ -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,K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,MAAM,KAAA,CAAM,WAAA,CAAY,IAAI,OAAO,CAAA;AACjD,EAAA,MAAM,UAAA,GAAa,cAAA,CAAe,KAAA,EAAO,EAAE,GAAA,EAAK,GAAA,CAAI,GAAA,EAAK,SAAA,EAAW,KAAA,EAAO,GAAA,CAAI,KAAA,EAAO,CAAA;AACtF,EAAA,UAAA,CAAW,sBAAsB,IAAI,CAAA;AACrC,EAAA,MAAM,KAAA,CAAM,cAAc,GAAA,CAAI,OAAA,EAAS,aAAa,UAAA,EAAY,KAAA,CAAM,MAAM,CAAC,CAAA;AAC/E","file":"chunk-CTCGWIUD.cjs","sourcesContent":["/**\n * SE40 — native session store over the Claude-shaped `.jsonl` transcript.\n *\n * The theokit session format IS the Claude Code record shape (see\n * `../../persistence/session-transcript.ts`). This module owns the FS lifecycle:\n * read existing records, seed a {@link SessionTranscript}'s parent chain, append\n * the new turn (user + assistant/tool blocks), and write append-only. Compaction\n * appends a `compact_boundary` record (a new root) — it NEVER shrinks the line\n * set (that would break the DAG). Reads reconstruct `LlmMessage[]` via\n * {@link reconstructMessages}, narrowed to the in-memory {@link SessionMessage}.\n *\n * @internal\n */\n\nimport type { ToolResultContentBlock } from \"../../types/content-blocks.js\";\nimport type { ConversationStep, ConversationTurn } from \"../../types/conversation.js\";\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport {\n type AssistantTurn,\n reconstructMessages,\n type SessionRecord,\n SessionTranscript,\n} from \"../persistence/session-transcript.js\";\nimport type { SessionMessage, SessionMessagePart } from \"./session-types.js\";\n\n/**\n * Seed a {@link SessionTranscript} from the already-on-disk records so a new\n * append parents correctly on the existing DAG leaf. The transcript re-emits the\n * seeded records verbatim before the new turn, so the whole file rewrites atomically\n * as one append-only line set. Returns the transcript primed with the prior records.\n */\nfunction seedTranscript(\n prior: readonly SessionRecord[],\n opts: { cwd: string; sessionId: string; model: string },\n): SessionTranscript {\n return SessionTranscript.fromRecords(prior, opts);\n}\n\n/** The turn to persist: the user's text plus the rich per-turn conversation view. */\nexport interface PersistTurnInput {\n userText: string;\n conversation: readonly ConversationTurn[];\n /**\n * M50 — when supplied, size-driven auto-compaction runs in the SAME write chain after the turn\n * persists (usage real vs the model's context window; summarizer injected by the caller).\n */\n autoCompact?: {\n usageTotal?: number | undefined;\n contextWindow?: number | undefined;\n summarize: (\n messages: readonly import(\"../../compaction.js\").CompressibleMessage[],\n ) => Promise<string>;\n };\n}\n\ninterface MappedTurn {\n assistant: AssistantTurn;\n toolResults: Array<{ toolUseId: string; content: string; isError?: boolean }>;\n}\n\n/**\n * theokit#122 — record the turn's thinking block, signature included.\n *\n * The signature is what makes the block replayable: without it the resumed turn is rejected by\n * Anthropic with `400 \"thinking blocks cannot be modified\"`.\n */\nfunction applyThinkingStep(\n assistant: AssistantTurn,\n message: { text: string; signature?: string },\n): void {\n assistant.thinking = message.text;\n if (message.signature !== undefined) assistant.thinkingSignature = message.signature;\n}\n\n/** Fold one agent turn's steps into an assistant record + paired tool results. */\nfunction mapAgentTurn(steps: readonly ConversationStep[]): MappedTurn {\n const assistant: AssistantTurn = {};\n const toolResults: MappedTurn[\"toolResults\"] = [];\n const toolCalls: NonNullable<AssistantTurn[\"toolCalls\"]> = [];\n for (const step of steps) {\n if (step.type === \"thinkingMessage\") applyThinkingStep(assistant, step.message);\n else if (step.type === \"assistantMessage\") assistant.text = step.message.text;\n else if (step.type === \"toolCall\")\n toolCalls.push({\n id: step.message.callId,\n name: step.message.name,\n input: (step.message.args as Record<string, unknown> | undefined) ?? {},\n });\n else\n toolResults.push({\n toolUseId: step.message.callId,\n content: step.message.result,\n isError: step.message.isError,\n });\n }\n if (toolCalls.length > 0) assistant.toolCalls = toolCalls;\n return { assistant, toolResults };\n}\n\n/** True when the assistant record carries any content worth emitting. */\nfunction hasAssistantContent(a: AssistantTurn): boolean {\n return a.text !== undefined || a.thinking !== undefined || (a.toolCalls?.length ?? 0) > 0;\n}\n\n/**\n * Map the rich `ConversationTurn[]` (from `run.conversation()`) into the native\n * assistant/tool records. One transcript turn is: an `assistant` record carrying\n * thinking + text + tool_use blocks, then (when present) a `user` record carrying\n * the paired tool_result blocks. Tool results pair with tool_use by `callId`.\n */\nfunction appendConversation(\n transcript: SessionTranscript,\n conversation: readonly ConversationTurn[],\n): void {\n for (const ct of conversation) {\n if (ct.type !== \"agentConversationTurn\") continue;\n const { assistant, toolResults } = mapAgentTurn(ct.turn.steps);\n if (hasAssistantContent(assistant)) transcript.appendAssistantTurn(assistant);\n if (toolResults.length > 0) transcript.appendToolResults(toolResults);\n }\n}\n\n/**\n * The per-agent transcript metadata used to seed a {@link SessionTranscript}. The\n * actual record I/O goes through the injected {@link SessionStore} (SE41), so this\n * no longer carries a `baseDir` — the store is already bound to its location.\n */\nexport interface TranscriptLocation {\n cwd: string;\n agentId: string;\n model: string;\n}\n\n/**\n * Read the session's records via the {@link SessionStore} and reconstruct the\n * resumable history, narrowed to the in-memory {@link SessionMessage} shape\n * (user/assistant text). Tool turns fold into assistant-role context so resume\n * keeps tool history. Works identically for the FS default and an external store.\n */\nexport async function readSessionMessages(\n store: SessionStore,\n agentId: string,\n): Promise<SessionMessage[]> {\n const records = await store.readRecords(agentId);\n return reconstructMessages(records).map(narrowToSessionMessage);\n}\n\ntype NarrowPart = {\n type: string;\n text?: string;\n content?: unknown;\n name?: string;\n id?: string;\n toolUseId?: string;\n input?: unknown;\n isError?: boolean;\n};\n\n/** Render one reconstructed content part as folded session text. */\nfunction partToText(p: NarrowPart): string {\n if (p.type === \"text\") return p.text ?? \"\";\n if (p.type === \"tool_use\") return `[tool call] ${p.name ?? \"\"}`;\n if (p.type === \"tool_result\") {\n const body = typeof p.content === \"string\" ? p.content : JSON.stringify(p.content);\n return `[tool result] ${body}`;\n }\n return \"\";\n}\n\n/**\n * theokit#146 — the same part, kept as STRUCTURE.\n *\n * `partToText` above is what the model replay wants; a host rendering tool cards needs the call id,\n * the tool name and the arguments, none of which survive `[tool call] NAME`. Both projections are\n * produced from the one reconstructed part, so they cannot drift apart.\n *\n * Returns `undefined` for a part with no display meaning (e.g. an image placeholder the session\n * projection does not model), which the caller filters out.\n */\nfunction partToStructured(p: NarrowPart): SessionMessagePart | undefined {\n if (p.type === \"text\") return { type: \"text\", text: p.text ?? \"\" };\n if (p.type === \"tool_use\") {\n return {\n type: \"tool_use\",\n id: p.id ?? \"\",\n name: p.name ?? \"\",\n input: (p.input ?? {}) as Record<string, unknown>,\n };\n }\n if (p.type === \"tool_result\") {\n return {\n type: \"tool_result\",\n toolUseId: p.toolUseId ?? \"\",\n // Reconstructed tool results carry either a string or the SE7 content blocks; both are\n // already the session shape, so this narrows `unknown` rather than converting anything.\n content: p.content as string | ReadonlyArray<ToolResultContentBlock>,\n ...(p.isError === true ? { isError: true } : {}),\n };\n }\n return undefined;\n}\n\n/** Flatten a reconstructed `LlmMessage` to the narrowed in-memory `SessionMessage`. */\nfunction narrowToSessionMessage(m: {\n role: \"system\" | \"user\" | \"assistant\";\n content: NarrowPart[];\n}): SessionMessage {\n const role = m.role === \"user\" ? \"user\" : \"assistant\";\n const text = m.content\n .map(partToText)\n .filter((s) => s.length > 0)\n .join(\"\\n\");\n const parts = m.content\n .map(partToStructured)\n .filter((p): p is SessionMessagePart => p !== undefined);\n return { role, text, parts };\n}\n\n/** The records appended by the last turn (the delta beyond the seeded prior). */\nfunction deltaRecords(\n transcript: SessionTranscript,\n priorLength: number,\n): readonly SessionRecord[] {\n return transcript.records().slice(priorLength);\n}\n\n/**\n * Persist one conversation turn (user + assistant/tool records) to the session\n * store, append-only. Reads the prior records to seed the parent chain, folds the\n * new turn, and appends ONLY the delta via {@link SessionStore.appendRecords}\n * (the store owns the append atomicity — the FS default serializes under a file\n * lock). Within one process, turns for an agent are already chained upstream, so\n * the read→append is ordered; cross-host ordering is the external store's contract.\n */\nexport async function persistTurn(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n turn: PersistTurnInput,\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendUserTurn(turn.userText);\n appendConversation(transcript, turn.conversation);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n\n/**\n * Append-only compaction: add a `compact_boundary` system record (a new root) so\n * resume replays only the post-boundary continuation. Appends only the boundary\n * record via the store — NEVER rewrites or shrinks the prior records.\n */\nexport async function appendCompactBoundaryRecord(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n meta: { preTokens: number; trigger: string },\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendCompactBoundary(meta);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/agent-session-store.ts"],"names":["SessionTranscript","reconstructMessages"],"mappings":";;;;;AA+BA,SAAS,cAAA,CACP,OACA,IAAA,EACmB;AACnB,EAAA,OAAOA,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO,IAAI,CAAA;AAClD;AA8BA,SAAS,iBAAA,CACP,WACA,OAAA,EACM;AACN,EAAA,SAAA,CAAU,WAAW,OAAA,CAAQ,IAAA;AAC7B,EAAA,IAAI,OAAA,CAAQ,SAAA,KAAc,MAAA,EAAW,SAAA,CAAU,oBAAoB,OAAA,CAAQ,SAAA;AAC7E;AAGA,SAAS,aAAa,KAAA,EAAgD;AACpE,EAAA,MAAM,YAA2B,EAAC;AAClC,EAAA,MAAM,cAAyC,EAAC;AAChD,EAAA,MAAM,YAAqD,EAAC;AAC5D,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,IAAA,IAAI,KAAK,IAAA,KAAS,iBAAA,EAAmB,iBAAA,CAAkB,SAAA,EAAW,KAAK,OAAO,CAAA;AAAA,SAAA,IACrE,KAAK,IAAA,KAAS,kBAAA,EAAoB,SAAA,CAAU,IAAA,GAAO,KAAK,OAAA,CAAQ,IAAA;AAAA,SAAA,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GAAA,CAAI,OAAA,EAAS,aAAa,UAAA,EAAY,KAAA,CAAM,MAAM,CAAC,CAAA;AAC/E;AAOA,eAAsB,2BAAA,CACpB,KAAA,EACA,GAAA,EACA,SAAA,EACA,IAAA,EACe;AACf,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,WAAA,CAAY,IAAI,OAAO,CAAA;AACjD,EAAA,MAAM,UAAA,GAAa,cAAA,CAAe,KAAA,EAAO,EAAE,GAAA,EAAK,GAAA,CAAI,GAAA,EAAK,SAAA,EAAW,KAAA,EAAO,GAAA,CAAI,KAAA,EAAO,CAAA;AACtF,EAAA,UAAA,CAAW,sBAAsB,IAAI,CAAA;AACrC,EAAA,MAAM,KAAA,CAAM,cAAc,GAAA,CAAI,OAAA,EAAS,aAAa,UAAA,EAAY,KAAA,CAAM,MAAM,CAAC,CAAA;AAC/E","file":"chunk-Z4BCLVTI.cjs","sourcesContent":["/**\n * SE40 — native session store over the Claude-shaped `.jsonl` transcript.\n *\n * The theokit session format IS the Claude Code record shape (see\n * `../../persistence/session-transcript.ts`). This module owns the FS lifecycle:\n * read existing records, seed a {@link SessionTranscript}'s parent chain, append\n * the new turn (user + assistant/tool blocks), and write append-only. Compaction\n * appends a `compact_boundary` record (a new root) — it NEVER shrinks the line\n * set (that would break the DAG). Reads reconstruct `LlmMessage[]` via\n * {@link reconstructMessages}, narrowed to the in-memory {@link SessionMessage}.\n *\n * @internal\n */\n\nimport type { ToolResultContentBlock } from \"../../types/content-blocks.js\";\nimport type { ConversationStep, ConversationTurn } from \"../../types/conversation.js\";\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport {\n type AssistantTurn,\n reconstructMessages,\n type SessionRecord,\n SessionTranscript,\n} from \"../persistence/session-transcript.js\";\nimport type { SessionMessage, SessionMessagePart } from \"./session-types.js\";\n\n/**\n * Seed a {@link SessionTranscript} from the already-on-disk records so a new\n * append parents correctly on the existing DAG leaf. The transcript re-emits the\n * seeded records verbatim before the new turn, so the whole file rewrites atomically\n * as one append-only line set. Returns the transcript primed with the prior records.\n */\nfunction seedTranscript(\n prior: readonly SessionRecord[],\n opts: { cwd: string; sessionId: string; model: string },\n): SessionTranscript {\n return SessionTranscript.fromRecords(prior, opts);\n}\n\n/** The turn to persist: the user's text plus the rich per-turn conversation view. */\nexport interface PersistTurnInput {\n userText: string;\n conversation: readonly ConversationTurn[];\n /**\n * M50 — when supplied, size-driven auto-compaction runs in the SAME write chain after the turn\n * persists (usage real vs the model's context window; summarizer injected by the caller).\n */\n autoCompact?: {\n usageTotal?: number | undefined;\n contextWindow?: number | undefined;\n summarize: (\n messages: readonly import(\"../../compaction.js\").CompressibleMessage[],\n ) => Promise<string>;\n };\n}\n\ninterface MappedTurn {\n assistant: AssistantTurn;\n toolResults: Array<{ toolUseId: string; content: string; isError?: boolean }>;\n}\n\n/**\n * theokit#122 — record the turn's thinking block, signature included.\n *\n * The signature is what makes the block replayable: without it the resumed turn is rejected by\n * Anthropic with `400 \"thinking blocks cannot be modified\"`.\n */\nfunction applyThinkingStep(\n assistant: AssistantTurn,\n message: { text: string; signature?: string },\n): void {\n assistant.thinking = message.text;\n if (message.signature !== undefined) assistant.thinkingSignature = message.signature;\n}\n\n/** Fold one agent turn's steps into an assistant record + paired tool results. */\nfunction mapAgentTurn(steps: readonly ConversationStep[]): MappedTurn {\n const assistant: AssistantTurn = {};\n const toolResults: MappedTurn[\"toolResults\"] = [];\n const toolCalls: NonNullable<AssistantTurn[\"toolCalls\"]> = [];\n for (const step of steps) {\n if (step.type === \"thinkingMessage\") applyThinkingStep(assistant, step.message);\n else if (step.type === \"assistantMessage\") assistant.text = step.message.text;\n else if (step.type === \"toolCall\")\n toolCalls.push({\n id: step.message.callId,\n name: step.message.name,\n input: (step.message.args as Record<string, unknown> | undefined) ?? {},\n });\n else\n toolResults.push({\n toolUseId: step.message.callId,\n content: step.message.result,\n isError: step.message.isError,\n });\n }\n if (toolCalls.length > 0) assistant.toolCalls = toolCalls;\n return { assistant, toolResults };\n}\n\n/** True when the assistant record carries any content worth emitting. */\nfunction hasAssistantContent(a: AssistantTurn): boolean {\n return a.text !== undefined || a.thinking !== undefined || (a.toolCalls?.length ?? 0) > 0;\n}\n\n/**\n * Map the rich `ConversationTurn[]` (from `run.conversation()`) into the native\n * assistant/tool records. One transcript turn is: an `assistant` record carrying\n * thinking + text + tool_use blocks, then (when present) a `user` record carrying\n * the paired tool_result blocks. Tool results pair with tool_use by `callId`.\n */\nfunction appendConversation(\n transcript: SessionTranscript,\n conversation: readonly ConversationTurn[],\n): void {\n for (const ct of conversation) {\n if (ct.type !== \"agentConversationTurn\") continue;\n const { assistant, toolResults } = mapAgentTurn(ct.turn.steps);\n if (hasAssistantContent(assistant)) transcript.appendAssistantTurn(assistant);\n if (toolResults.length > 0) transcript.appendToolResults(toolResults);\n }\n}\n\n/**\n * The per-agent transcript metadata used to seed a {@link SessionTranscript}. The\n * actual record I/O goes through the injected {@link SessionStore} (SE41), so this\n * no longer carries a `baseDir` — the store is already bound to its location.\n */\nexport interface TranscriptLocation {\n cwd: string;\n agentId: string;\n model: string;\n}\n\n/**\n * Read the session's records via the {@link SessionStore} and reconstruct the\n * resumable history, narrowed to the in-memory {@link SessionMessage} shape\n * (user/assistant text). Tool turns fold into assistant-role context so resume\n * keeps tool history. Works identically for the FS default and an external store.\n */\nexport async function readSessionMessages(\n store: SessionStore,\n agentId: string,\n): Promise<SessionMessage[]> {\n const records = await store.readRecords(agentId);\n return reconstructMessages(records).map(narrowToSessionMessage);\n}\n\ntype NarrowPart = {\n type: string;\n text?: string;\n content?: unknown;\n name?: string;\n id?: string;\n toolUseId?: string;\n input?: unknown;\n isError?: boolean;\n};\n\n/** Render one reconstructed content part as folded session text. */\nfunction partToText(p: NarrowPart): string {\n if (p.type === \"text\") return p.text ?? \"\";\n if (p.type === \"tool_use\") return `[tool call] ${p.name ?? \"\"}`;\n if (p.type === \"tool_result\") {\n const body = typeof p.content === \"string\" ? p.content : JSON.stringify(p.content);\n return `[tool result] ${body}`;\n }\n return \"\";\n}\n\n/**\n * theokit#146 — the same part, kept as STRUCTURE.\n *\n * `partToText` above is what the model replay wants; a host rendering tool cards needs the call id,\n * the tool name and the arguments, none of which survive `[tool call] NAME`. Both projections are\n * produced from the one reconstructed part, so they cannot drift apart.\n *\n * Returns `undefined` for a part with no display meaning (e.g. an image placeholder the session\n * projection does not model), which the caller filters out.\n */\nfunction partToStructured(p: NarrowPart): SessionMessagePart | undefined {\n if (p.type === \"text\") return { type: \"text\", text: p.text ?? \"\" };\n if (p.type === \"tool_use\") {\n return {\n type: \"tool_use\",\n id: p.id ?? \"\",\n name: p.name ?? \"\",\n input: (p.input ?? {}) as Record<string, unknown>,\n };\n }\n if (p.type === \"tool_result\") {\n return {\n type: \"tool_result\",\n toolUseId: p.toolUseId ?? \"\",\n // Reconstructed tool results carry either a string or the SE7 content blocks; both are\n // already the session shape, so this narrows `unknown` rather than converting anything.\n content: p.content as string | ReadonlyArray<ToolResultContentBlock>,\n ...(p.isError === true ? { isError: true } : {}),\n };\n }\n return undefined;\n}\n\n/** Flatten a reconstructed `LlmMessage` to the narrowed in-memory `SessionMessage`. */\nfunction narrowToSessionMessage(m: {\n role: \"system\" | \"user\" | \"assistant\";\n content: NarrowPart[];\n}): SessionMessage {\n const role = m.role === \"user\" ? \"user\" : \"assistant\";\n const text = m.content\n .map(partToText)\n .filter((s) => s.length > 0)\n .join(\"\\n\");\n const parts = m.content\n .map(partToStructured)\n .filter((p): p is SessionMessagePart => p !== undefined);\n return { role, text, parts };\n}\n\n/** The records appended by the last turn (the delta beyond the seeded prior). */\nfunction deltaRecords(\n transcript: SessionTranscript,\n priorLength: number,\n): readonly SessionRecord[] {\n return transcript.records().slice(priorLength);\n}\n\n/**\n * Persist one conversation turn (user + assistant/tool records) to the session\n * store, append-only. Reads the prior records to seed the parent chain, folds the\n * new turn, and appends ONLY the delta via {@link SessionStore.appendRecords}\n * (the store owns the append atomicity — the FS default serializes under a file\n * lock). Within one process, turns for an agent are already chained upstream, so\n * the read→append is ordered; cross-host ordering is the external store's contract.\n */\nexport async function persistTurn(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n turn: PersistTurnInput,\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendUserTurn(turn.userText);\n appendConversation(transcript, turn.conversation);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n\n/**\n * Append-only compaction: add a `compact_boundary` system record (a new root) so\n * resume replays only the post-boundary continuation. Appends only the boundary\n * record via the store — NEVER rewrites or shrinks the prior records.\n */\nexport async function appendCompactBoundaryRecord(\n store: SessionStore,\n loc: TranscriptLocation,\n sessionId: string,\n meta: { preTokens: number; trigger: string },\n): Promise<void> {\n const prior = await store.readRecords(loc.agentId);\n const transcript = seedTranscript(prior, { cwd: loc.cwd, sessionId, model: loc.model });\n transcript.appendCompactBoundary(meta);\n await store.appendRecords(loc.agentId, deltaRecords(transcript, prior.length));\n}\n"]}
@@ -1,8 +1,27 @@
1
+ import { pluginBundleRoots, projectConfigRoots } from './chunk-UFLD2HEV.js';
1
2
  import { readWorkspaceDir, parseSimpleYaml } from './chunk-AG5JPQIY.js';
2
3
  import { ConfigurationError } from './chunk-IDCKSLYH.js';
3
- import { readFile } from 'fs/promises';
4
+ import { diag } from './chunk-T7O6K6PX.js';
5
+ import { readdir, readFile } from 'fs/promises';
4
6
  import { join } from 'path';
5
7
 
8
+ async function pluginBundleDirs(cwd) {
9
+ const dirs = [];
10
+ for (const root of pluginBundleRoots(cwd)) {
11
+ let entries;
12
+ try {
13
+ entries = await readdir(root, { withFileTypes: true });
14
+ } catch {
15
+ continue;
16
+ }
17
+ for (const entry of entries) {
18
+ if (entry.isDirectory()) dirs.push(join(root, entry.name));
19
+ }
20
+ }
21
+ return dirs;
22
+ }
23
+
24
+ // src/internal/runtime/skills/subagents-loader.ts
6
25
  async function loadSubagents(cwd, settingSourcesIncludeProject, inline) {
7
26
  const result = {};
8
27
  if (settingSourcesIncludeProject) {
@@ -19,17 +38,30 @@ async function loadSubagents(cwd, settingSourcesIncludeProject, inline) {
19
38
  return result;
20
39
  }
21
40
  async function readProjectSubagents(cwd) {
22
- const root = join(cwd, ".theokit", "agents");
23
- const entries = await readWorkspaceDir(root, "subagents_read_error", "subagents directory");
24
41
  const subagents = {};
42
+ for (const configRoot of projectConfigRoots(cwd)) {
43
+ await readSubagentsFrom(join(configRoot, "agents"), subagents);
44
+ }
45
+ for (const bundle of await pluginBundleDirs(cwd)) {
46
+ await readSubagentsFrom(join(bundle, "agents"), subagents);
47
+ }
48
+ return subagents;
49
+ }
50
+ async function readSubagentsFrom(root, subagents) {
51
+ const entries = await readWorkspaceDir(root, "subagents_read_error", "subagents directory");
25
52
  for (const entry of entries) {
26
53
  if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
27
54
  const path = join(root, entry.name);
28
55
  const raw = await readFile(path, "utf8");
56
+ if (!hasFrontmatter(raw)) {
57
+ diag(`[theokit-sdk] ${entry.name} has no frontmatter \u2014 not an agent declaration, skipping`);
58
+ continue;
59
+ }
29
60
  const definition = parseSubagentMarkdown(raw, entry.name);
30
- subagents[definition.name] = definition.definition;
61
+ if (subagents[definition.name] === void 0) {
62
+ subagents[definition.name] = definition.definition;
63
+ }
31
64
  }
32
- return subagents;
33
65
  }
34
66
  var ACCEPTED_FIELDS = /* @__PURE__ */ new Set([
35
67
  "name",
@@ -40,6 +72,10 @@ var ACCEPTED_FIELDS = /* @__PURE__ */ new Set([
40
72
  "mcp",
41
73
  "sandbox"
42
74
  ]);
75
+ var INERT_CLAUDE_CODE_FIELDS = /* @__PURE__ */ new Set([
76
+ /** The CLI's label colour for the agent. Presentation only. */
77
+ "color"
78
+ ]);
43
79
  function parseSubagentMarkdown(raw, filename) {
44
80
  const { frontmatter, body } = splitFrontmatter(raw, filename);
45
81
  const fields = parseFrontmatterFields(frontmatter);
@@ -60,6 +96,7 @@ function parseSubagentMarkdown(raw, filename) {
60
96
  }
61
97
  function rejectUnknownFields(fields, filename) {
62
98
  for (const key of Object.keys(fields)) {
99
+ if (INERT_CLAUDE_CODE_FIELDS.has(key)) continue;
63
100
  if (!ACCEPTED_FIELDS.has(key)) {
64
101
  throw new ConfigurationError(
65
102
  `Subagent ${filename}: unknown frontmatter field "${key}" (accepted: ${[...ACCEPTED_FIELDS].join(", ")})`,
@@ -111,6 +148,9 @@ function toStringList(v) {
111
148
  }
112
149
  return [];
113
150
  }
151
+ function hasFrontmatter(raw) {
152
+ return /^---\s*\n/.test(raw);
153
+ }
114
154
  function splitFrontmatter(raw, filename) {
115
155
  const match = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/.exec(raw);
116
156
  if (match === null) {
@@ -124,6 +164,6 @@ function parseFrontmatterFields(frontmatter) {
124
164
  return parseSimpleYaml(frontmatter);
125
165
  }
126
166
 
127
- export { loadSubagents };
128
- //# sourceMappingURL=chunk-2QKTVKH3.js.map
129
- //# sourceMappingURL=chunk-2QKTVKH3.js.map
167
+ export { loadSubagents, pluginBundleDirs };
168
+ //# sourceMappingURL=chunk-ZHPWGIUX.js.map
169
+ //# sourceMappingURL=chunk-ZHPWGIUX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/internal/runtime/plugins/plugin-bundles.ts","../src/internal/runtime/skills/subagents-loader.ts"],"names":["join"],"mappings":";;;;;;;AAwBA,eAAsB,iBAAiB,GAAA,EAAgC;AACrE,EAAA,MAAM,OAAiB,EAAC;AACxB,EAAA,KAAA,MAAW,IAAA,IAAQ,iBAAA,CAAkB,GAAG,CAAA,EAAG;AACzC,IAAA,IAAI,OAAA;AACJ,IAAA,IAAI;AACF,MAAA,OAAA,GAAU,MAAM,OAAA,CAAQ,IAAA,EAAM,EAAE,aAAA,EAAe,MAAM,CAAA;AAAA,IACvD,CAAA,CAAA,MAAQ;AACN,MAAA;AAAA,IACF;AACA,IAAA,KAAA,MAAW,SAAS,OAAA,EAAS;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;AAAA,KACP,CAAA;AAAA,EACH;AACA,EAAA,OAAO,EAAE,WAAA,EAAa,KAAA,CAAM,CAAC,CAAA,IAAK,EAAA,EAAI,IAAA,EAAA,CAAO,KAAA,CAAM,CAAC,CAAA,IAAK,EAAA,EAAI,IAAA,EAAK,EAAE;AACtE;AAEA,SAAS,uBAAuB,WAAA,EAAmE;AAIjG,EAAA,OAAO,gBAAgB,WAAW,CAAA;AACpC","file":"chunk-ZHPWGIUX.js","sourcesContent":["/**\n * Locating the plugin bundles a project carries.\n *\n * Shared by the skills and subagents loaders, which both need the same answer to \"which folders in\n * this project are plugins\" and would otherwise each grow their own copy of the directory walk.\n *\n * @internal\n */\n\nimport type { Dirent } from \"node:fs\";\nimport { readdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pluginBundleRoots } from \"../../persistence/paths.js\";\n\n/**\n * Every plugin folder under the project's plugin roots.\n *\n * Returns the FOLDERS, not their contents — what a bundle contributes (`skills/`, `agents/`) is the\n * caller's business, and a loader that also knew the layout would have to change whenever the other\n * one did.\n *\n * A missing root is not an error: most projects carry no plugins, and treating their absence as a\n * failure would make \"none installed\" indistinguishable from \"the directory could not be read\".\n */\nexport async function pluginBundleDirs(cwd: string): Promise<string[]> {\n const dirs: string[] = [];\n for (const root of pluginBundleRoots(cwd)) {\n let entries: Dirent[];\n try {\n entries = await readdir(root, { withFileTypes: true });\n } catch {\n continue;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) dirs.push(join(root, entry.name));\n }\n }\n return dirs;\n}\n","import { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport { ConfigurationError } from \"../../../errors.js\";\nimport type { AgentDefinition } from \"../../../types/agent.js\";\nimport type { ModelSelection } from \"../../../types/agent-prims.js\";\nimport { diag } from \"../../diagnostics.js\";\nimport { projectConfigRoots } from \"../../persistence/paths.js\";\nimport { readWorkspaceDir } from \"../config/workspace-dir.js\";\nimport { type FrontmatterValue, parseSimpleYaml } from \"../context/yaml-frontmatter.js\";\nimport { pluginBundleDirs } from \"../plugins/plugin-bundles.js\";\n\n/**\n * Load file-based subagents from `.theokit/agents/*.md` and merge with\n * inline definitions. Inline overrides file-based on name conflict.\n *\n * Each markdown file has YAML frontmatter (description + optional model)\n * and a body that becomes the subagent prompt.\n *\n * @internal\n */\nexport async function loadSubagents(\n cwd: string,\n settingSourcesIncludeProject: boolean,\n inline: Record<string, AgentDefinition> | undefined,\n): Promise<Record<string, AgentDefinition>> {\n const result: Record<string, AgentDefinition> = {};\n if (settingSourcesIncludeProject) {\n const projectAgents = await readProjectSubagents(cwd);\n for (const [name, definition] of Object.entries(projectAgents)) {\n result[name] = definition;\n }\n }\n if (inline !== undefined) {\n for (const [name, definition] of Object.entries(inline)) {\n result[name] = definition;\n }\n }\n return result;\n}\n\n/**\n * Read agent declarations from every project config root (`.theokit`, then `.claude`).\n *\n * FIRST occurrence of a name wins, which is what makes `projectConfigRoots`' order a contract rather\n * than a detail: a project declaring the same agent in both means the explicit namespace.\n */\nasync function readProjectSubagents(cwd: string): Promise<Record<string, AgentDefinition>> {\n const subagents: Record<string, AgentDefinition> = {};\n for (const configRoot of projectConfigRoots(cwd)) {\n await readSubagentsFrom(join(configRoot, \"agents\"), subagents);\n }\n // A Claude Code plugin is a BUNDLE, and its `agents/` is what it exists to contribute. Read after\n // the project's own, so a project can shadow an agent a plugin ships without editing the plugin.\n for (const bundle of await pluginBundleDirs(cwd)) {\n await readSubagentsFrom(join(bundle, \"agents\"), subagents);\n }\n return subagents;\n}\n\nasync function readSubagentsFrom(\n root: string,\n subagents: Record<string, AgentDefinition>,\n): Promise<void> {\n const entries = await readWorkspaceDir(root, \"subagents_read_error\", \"subagents directory\");\n for (const entry of entries) {\n if (!entry.isFile() || !entry.name.endsWith(\".md\")) continue;\n const path = join(root, entry.name);\n const raw = await readFile(path, \"utf8\");\n // A markdown file with NO frontmatter is not an agent declaration — a directory of agents\n // written for the Claude Code CLI conventionally carries documentation beside them, and\n // `.claude/agents/README.md` exists in this repository. Throwing on it made ONE such file stop\n // every agent in the directory from loading.\n //\n // Skipped with a warn rather than in silence, and ONLY for the no-frontmatter case: a file that\n // HAS frontmatter and gets it wrong is a broken agent and still fails loudly, which is what\n // keeps a typo'd `sandbox` from returning as a silent gate through this door.\n if (!hasFrontmatter(raw)) {\n diag(`[theokit-sdk] ${entry.name} has no frontmatter — not an agent declaration, skipping`);\n continue;\n }\n const definition = parseSubagentMarkdown(raw, entry.name);\n if (subagents[definition.name] === undefined) {\n subagents[definition.name] = definition.definition;\n }\n }\n}\n\n// The frontmatter keys a disk subagent may declare. Any other key is a typed load\n// error rather than a silent drop — a dropped `sandbox` an operator wrote believing\n// it confines the child is exactly the silent-gate failure class this guards against.\nconst ACCEPTED_FIELDS = new Set([\n \"name\",\n \"description\",\n \"model\",\n \"tools\",\n \"reasoning_effort\",\n \"mcp\",\n \"sandbox\",\n]);\n\n// Fields the Claude Code CLI writes that carry NO behaviour for this runtime. Accepted and ignored,\n// so an agent authored for the CLI loads here unchanged — measured 2026-08-26 across the 59 agent\n// files on one machine, where `color` appeared in 38 of them and made every one of those a\n// `subagent_unknown_field` load error.\n//\n// Named explicitly instead of loosening the check above, because that check's reason is sound: a\n// dropped `sandbox` an operator wrote believing it confines the child is a silent gate. A field that\n// COULD change behaviour must still fail loudly. This set is the difference between \"we know this\n// one and it does nothing\" and \"we have never heard of this\" — two facts a bare allow-everything\n// would collapse into one.\n//\n// Anything added here needs the same justification: inert for THIS runtime, not merely unfamiliar.\nconst INERT_CLAUDE_CODE_FIELDS = new Set([\n /** The CLI's label colour for the agent. Presentation only. */\n \"color\",\n]);\n\nfunction parseSubagentMarkdown(\n raw: string,\n filename: string,\n): { name: string; definition: AgentDefinition } {\n const { frontmatter, body } = splitFrontmatter(raw, filename);\n const fields = parseFrontmatterFields(frontmatter);\n rejectUnknownFields(fields, filename);\n rejectMcp(fields, filename);\n\n const definition: AgentDefinition = {\n description: asString(fields.description) ?? \"\",\n prompt: body,\n };\n const model = resolveModel(fields, filename);\n if (model !== undefined) definition.model = model;\n const tools = toStringList(fields.tools);\n if (tools.length > 0) definition.tools = tools;\n const sandbox = resolveSandbox(fields, filename);\n if (sandbox !== undefined) definition.sandbox = sandbox;\n\n const name = asString(fields.name) ?? filename.replace(/\\.md$/, \"\");\n return { name, definition };\n}\n\nfunction rejectUnknownFields(\n fields: Record<string, FrontmatterValue | undefined>,\n filename: string,\n): void {\n for (const key of Object.keys(fields)) {\n if (INERT_CLAUDE_CODE_FIELDS.has(key)) continue;\n if (!ACCEPTED_FIELDS.has(key)) {\n throw new ConfigurationError(\n `Subagent ${filename}: unknown frontmatter field \"${key}\" (accepted: ${[...ACCEPTED_FIELDS].join(\", \")})`,\n { code: \"subagent_unknown_field\" },\n );\n }\n }\n}\n\n// mcp: a known field, but not yet honored on the LOCAL delegation path. The frontmatter YAML can only\n// express server NAMES (parseSimpleYaml has no nested-object support), while a child's `Agent.create`\n// needs `mcpServers` as a Record<name, config>; resolving names→config per-subagent in local delegation\n// is its own follow-up. Rather than silently drop it (the M26/M32 silent-gate class), it is a typed load\n// error that names the field and points at the alternative.\nfunction rejectMcp(fields: Record<string, FrontmatterValue | undefined>, filename: string): void {\n if (fields.mcp !== undefined) {\n throw new ConfigurationError(\n `Subagent ${filename}: per-subagent \"mcp\" is not yet supported on the local delegation path; declare MCP servers in .theokit/mcp.json (or the parent) instead`,\n { code: \"subagent_mcp_unsupported_local\" },\n );\n }\n}\n\n// model + reasoning_effort — effort rides inside `model.params[thinking]`, so it requires a concrete\n// model id to attach to (a child inheriting the parent's model cannot carry the parent's provider-\n// specific effort param safely).\nfunction resolveModel(\n fields: Record<string, FrontmatterValue | undefined>,\n filename: string,\n): ModelSelection | \"inherit\" | undefined {\n const modelId = asString(fields.model);\n const effort = asString(fields.reasoning_effort);\n // reasoning_effort rides in model.params[thinking], so it needs a CONCRETE model id to attach to.\n // Neither an absent model NOR `model: inherit` can carry it (the inherited id is unknown at load), so\n // both are typed errors rather than a silently-dropped effort — the silent-gate class this guards.\n if (effort !== undefined && (modelId === undefined || modelId === \"inherit\")) {\n throw new ConfigurationError(\n `Subagent ${filename}: reasoning_effort requires a concrete model (effort is a model parameter; an absent model or \"inherit\" cannot carry it)`,\n { code: \"subagent_reasoning_effort_without_model\" },\n );\n }\n if (modelId === undefined) return undefined;\n if (modelId === \"inherit\") return \"inherit\";\n return effort !== undefined\n ? { id: modelId, params: [{ id: \"thinking\", value: effort }] }\n : { id: modelId };\n}\n\n// sandbox: boolean only. A granular mode string (read-only/…) is unsupported by the SDK runtime and is\n// a typed error rather than a silent coercion to a boolean.\nfunction resolveSandbox(\n fields: Record<string, FrontmatterValue | undefined>,\n filename: string,\n): boolean | undefined {\n if (fields.sandbox === undefined) return undefined;\n if (typeof fields.sandbox !== \"boolean\") {\n throw new ConfigurationError(\n `Subagent ${filename}: sandbox must be a boolean (got \"${String(fields.sandbox)}\"); granular sandbox modes are not supported by the runtime`,\n { code: \"subagent_sandbox_not_boolean\" },\n );\n }\n return fields.sandbox;\n}\n\nfunction asString(v: FrontmatterValue | undefined): string | undefined {\n if (typeof v !== \"string\") return undefined;\n // parseSimpleYaml does not strip quotes (documented), and `model`/`reasoning_effort` are fields users\n // habitually quote (`model: \"openai/gpt-4o\"`). Strip a single matching surrounding quote pair so a\n // quoted id/effort does not slip past validation and fail only at the provider.\n const m = /^([\"'])(.*)\\1$/.exec(v);\n return m ? m[2] : v;\n}\n\n/** Accept a YAML list (`string[]`) or a comma/space-separated scalar; trim + drop empties. */\nfunction toStringList(v: FrontmatterValue | undefined): string[] {\n if (Array.isArray(v)) return v.map((t) => t.trim()).filter((t) => t.length > 0);\n if (typeof v === \"string\") {\n return v\n .split(/[\\s,]+/)\n .map((t) => t.trim())\n .filter((t) => t.length > 0);\n }\n return [];\n}\n\n/** Does this file open with a frontmatter block at all? Its ABSENCE means \"not an agent\". */\nfunction hasFrontmatter(raw: string): boolean {\n return /^---\\s*\\n/.test(raw);\n}\n\nfunction splitFrontmatter(raw: string, filename: string): { frontmatter: string; body: string } {\n const match = /^---\\s*\\n([\\s\\S]*?)\\n---\\s*\\n([\\s\\S]*)$/.exec(raw);\n if (match === null) {\n throw new ConfigurationError(`Subagent ${filename} is missing frontmatter`, {\n code: \"subagent_missing_frontmatter\",\n });\n }\n return { frontmatter: match[1] ?? \"\", body: (match[2] ?? \"\").trim() };\n}\n\nfunction parseFrontmatterFields(frontmatter: string): Record<string, FrontmatterValue | undefined> {\n // Preserve the rich YAML value types (boolean/number/string[]): `sandbox: true` and\n // `mcp: [a, b]` are meaningful here, so narrowing everything to string (as the\n // pre-M33 loader did) would drop them. Per-field validation happens in parseSubagentMarkdown.\n return parseSimpleYaml(frontmatter);\n}\n"]}
@@ -1,4 +1,4 @@
1
- export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, isCompactSummary, resolveSummarizerRoute, shouldAutoCompact } from './chunk-MVAPK2BX.js';
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-DZBSJX6J.js';
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-FUJDVF7B.js.map
22
- //# sourceMappingURL=compact-session-FUJDVF7B.js.map
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-FUJDVF7B.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-QGDNP45U.js"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHLPSLDGL_cjs = require('./chunk-HLPSLDGL.cjs');
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-JHPGF3FP.cjs');
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 chunkHLPSLDGL_cjs.COMPACT_SUMMARY_MARKER; }
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 chunkHLPSLDGL_cjs.COMPACT_USER_MESSAGE_MAX_TOKENS; }
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 chunkHLPSLDGL_cjs.autoCompactIfNeeded; }
36
+ get: function () { return chunk43GFJ5SD_cjs.autoCompactIfNeeded; }
37
37
  });
38
38
  Object.defineProperty(exports, "buildDefaultSummarizer", {
39
39
  enumerable: true,
40
- get: function () { return chunkHLPSLDGL_cjs.buildDefaultSummarizer; }
40
+ get: function () { return chunk43GFJ5SD_cjs.buildDefaultSummarizer; }
41
41
  });
42
42
  Object.defineProperty(exports, "compactSessionTranscript", {
43
43
  enumerable: true,
44
- get: function () { return chunkHLPSLDGL_cjs.compactSessionTranscript; }
44
+ get: function () { return chunk43GFJ5SD_cjs.compactSessionTranscript; }
45
45
  });
46
46
  Object.defineProperty(exports, "isCompactSummary", {
47
47
  enumerable: true,
48
- get: function () { return chunkHLPSLDGL_cjs.isCompactSummary; }
48
+ get: function () { return chunk43GFJ5SD_cjs.isCompactSummary; }
49
49
  });
50
50
  Object.defineProperty(exports, "resolveSummarizerRoute", {
51
51
  enumerable: true,
52
- get: function () { return chunkHLPSLDGL_cjs.resolveSummarizerRoute; }
52
+ get: function () { return chunk43GFJ5SD_cjs.resolveSummarizerRoute; }
53
53
  });
54
54
  Object.defineProperty(exports, "shouldAutoCompact", {
55
55
  enumerable: true,
56
- get: function () { return chunkHLPSLDGL_cjs.shouldAutoCompact; }
56
+ get: function () { return chunk43GFJ5SD_cjs.shouldAutoCompact; }
57
57
  });
58
- //# sourceMappingURL=compact-session-LEWF554G.cjs.map
59
- //# sourceMappingURL=compact-session-LEWF554G.cjs.map
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-LEWF554G.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-YHFQIXV5.cjs"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkE3WZ6Y4H_cjs = require('../chunk-E3WZ6Y4H.cjs');
3
+ var chunk7BG5UH3T_cjs = require('../chunk-7BG5UH3T.cjs');
4
4
  require('../chunk-KRD3GQAA.cjs');
5
- var chunkZNW6V4Y6_cjs = require('../chunk-ZNW6V4Y6.cjs');
5
+ var chunkLKFET5A3_cjs = require('../chunk-LKFET5A3.cjs');
6
6
  require('../chunk-VKJ7V7EB.cjs');
7
7
 
8
8
  // src/context/index.ts
@@ -13,24 +13,24 @@ function resolveContextImports(content, basePath, options) {
13
13
  maxBytesPerFile: options.maxBytesPerFile,
14
14
  projectRoot: options.projectRoot
15
15
  };
16
- return chunkE3WZ6Y4H_cjs.resolveImports(content, basePath, internalOptions);
16
+ return chunk7BG5UH3T_cjs.resolveImports(content, basePath, internalOptions);
17
17
  }
18
18
 
19
19
  Object.defineProperty(exports, "parseRules", {
20
20
  enumerable: true,
21
- get: function () { return chunkE3WZ6Y4H_cjs.parseRules; }
21
+ get: function () { return chunk7BG5UH3T_cjs.parseRules; }
22
22
  });
23
23
  Object.defineProperty(exports, "runDiscovery", {
24
24
  enumerable: true,
25
- get: function () { return chunkE3WZ6Y4H_cjs.runDiscovery; }
25
+ get: function () { return chunk7BG5UH3T_cjs.runDiscovery; }
26
26
  });
27
27
  Object.defineProperty(exports, "shouldActivateRule", {
28
28
  enumerable: true,
29
- get: function () { return chunkE3WZ6Y4H_cjs.shouldActivateRule; }
29
+ get: function () { return chunk7BG5UH3T_cjs.shouldActivateRule; }
30
30
  });
31
31
  Object.defineProperty(exports, "DEFAULT_DISCOVERY_SPECS", {
32
32
  enumerable: true,
33
- get: function () { return chunkZNW6V4Y6_cjs.DEFAULT_DISCOVERY_SPECS; }
33
+ get: function () { return chunkLKFET5A3_cjs.DEFAULT_DISCOVERY_SPECS; }
34
34
  });
35
35
  exports.resolveContextImports = resolveContextImports;
36
36
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
- import { resolveImports } from '../chunk-7FHZ4VQX.js';
2
- export { parseRules, runDiscovery, shouldActivateRule } from '../chunk-7FHZ4VQX.js';
1
+ import { resolveImports } from '../chunk-SAVIWMZB.js';
2
+ export { parseRules, runDiscovery, shouldActivateRule } from '../chunk-SAVIWMZB.js';
3
3
  import '../chunk-KVNWIAO4.js';
4
- export { DEFAULT_DISCOVERY_SPECS } from '../chunk-GTKFV7O5.js';
4
+ export { DEFAULT_DISCOVERY_SPECS } from '../chunk-WFC26L6Y.js';
5
5
  import '../chunk-RIAM53CP.js';
6
6
 
7
7
  // src/context/index.ts
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk53CBTBWO_cjs = require('./chunk-53CBTBWO.cjs');
3
+ var chunkP6H23T43_cjs = require('./chunk-P6H23T43.cjs');
4
+ require('./chunk-AQO3NSRG.cjs');
4
5
  require('./chunk-K3FW2XZD.cjs');
5
6
  require('./chunk-JTB5Q42C.cjs');
6
7
  require('./chunk-NUKRL3I6.cjs');
@@ -9,15 +10,15 @@ require('./chunk-NUKRL3I6.cjs');
9
10
 
10
11
  Object.defineProperty(exports, "currentPersonalityContext", {
11
12
  enumerable: true,
12
- get: function () { return chunk53CBTBWO_cjs.currentPersonalityContext; }
13
+ get: function () { return chunkP6H23T43_cjs.currentPersonalityContext; }
13
14
  });
14
15
  Object.defineProperty(exports, "warnPersonalitySwitchInsideFork", {
15
16
  enumerable: true,
16
- get: function () { return chunk53CBTBWO_cjs.warnPersonalitySwitchInsideFork; }
17
+ get: function () { return chunkP6H23T43_cjs.warnPersonalitySwitchInsideFork; }
17
18
  });
18
19
  Object.defineProperty(exports, "withPersonalityContext", {
19
20
  enumerable: true,
20
- get: function () { return chunk53CBTBWO_cjs.withPersonalityContext; }
21
+ get: function () { return chunkP6H23T43_cjs.withPersonalityContext; }
21
22
  });
22
- //# sourceMappingURL=context-VMIE4BMD.cjs.map
23
- //# sourceMappingURL=context-VMIE4BMD.cjs.map
23
+ //# sourceMappingURL=context-LCKNH2XI.cjs.map
24
+ //# sourceMappingURL=context-LCKNH2XI.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"context-VMIE4BMD.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"context-LCKNH2XI.cjs"}
@@ -0,0 +1,7 @@
1
+ export { currentPersonalityContext, warnPersonalitySwitchInsideFork, withPersonalityContext } from './chunk-MZ2FGBLZ.js';
2
+ import './chunk-UFLD2HEV.js';
3
+ import './chunk-IDCKSLYH.js';
4
+ import './chunk-T7XEKOVW.js';
5
+ import './chunk-T7O6K6PX.js';
6
+ //# sourceMappingURL=context-MZSKGKYR.js.map
7
+ //# sourceMappingURL=context-MZSKGKYR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"context-FDOON2DB.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"context-MZSKGKYR.js"}
package/dist/cron.cjs CHANGED
@@ -1,25 +1,25 @@
1
1
  'use strict';
2
2
 
3
- var chunkH5GOSXSC_cjs = require('./chunk-H5GOSXSC.cjs');
4
- require('./chunk-LQYQHXIW.cjs');
5
- require('./chunk-V2UUGUY4.cjs');
6
- require('./chunk-6VLKVX7O.cjs');
7
- require('./chunk-53CBTBWO.cjs');
3
+ var chunkQIRDQZYL_cjs = require('./chunk-QIRDQZYL.cjs');
4
+ require('./chunk-N47KLTKD.cjs');
5
+ require('./chunk-KKK3FZ4A.cjs');
6
+ require('./chunk-27AXGJMV.cjs');
7
+ require('./chunk-P6H23T43.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-YPJ5NH5N.cjs');
14
- require('./chunk-HLPSLDGL.cjs');
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-CTCGWIUD.cjs');
18
+ require('./chunk-Z4BCLVTI.cjs');
19
19
  require('./chunk-2ZPEDVLM.cjs');
20
- require('./chunk-E3WZ6Y4H.cjs');
20
+ require('./chunk-7BG5UH3T.cjs');
21
21
  require('./chunk-KRD3GQAA.cjs');
22
- require('./chunk-U2AC6JUP.cjs');
22
+ require('./chunk-J2UROOIG.cjs');
23
23
  require('./chunk-MUUQ2WFJ.cjs');
24
24
  require('./chunk-WJVHMTKB.cjs');
25
25
  require('./chunk-6JSIEDKL.cjs');
@@ -27,20 +27,21 @@ require('./chunk-FRITRLZQ.cjs');
27
27
  require('./chunk-4O5TGQBW.cjs');
28
28
  require('./chunk-NINIJCHU.cjs');
29
29
  require('./chunk-3YJNUKYN.cjs');
30
- require('./chunk-ZNW6V4Y6.cjs');
30
+ require('./chunk-LKFET5A3.cjs');
31
31
  require('./chunk-VJ26EKGJ.cjs');
32
32
  require('./chunk-R3UPQFKK.cjs');
33
33
  require('./chunk-VKJ7V7EB.cjs');
34
34
  require('./chunk-ILCGLTSA.cjs');
35
35
  require('./chunk-CQGYNZ3K.cjs');
36
36
  require('./chunk-4I55V454.cjs');
37
- require('./chunk-JHPGF3FP.cjs');
37
+ require('./chunk-BUIK7GUA.cjs');
38
38
  require('./chunk-SKXBJ2NU.cjs');
39
39
  require('./chunk-2ADR2GSO.cjs');
40
40
  require('./chunk-ZF2LDKQQ.cjs');
41
41
  require('./chunk-2C72DXQF.cjs');
42
42
  require('./chunk-I6TGFUCO.cjs');
43
- require('./chunk-HJBMA5MB.cjs');
43
+ require('./chunk-WNTAPVU5.cjs');
44
+ require('./chunk-AQO3NSRG.cjs');
44
45
  require('./chunk-IWBGCBR6.cjs');
45
46
  require('./chunk-XSX2UU6Y.cjs');
46
47
  require('./chunk-3EE6LVWT.cjs');
@@ -57,7 +58,7 @@ require('./chunk-NUKRL3I6.cjs');
57
58
 
58
59
  Object.defineProperty(exports, "Cron", {
59
60
  enumerable: true,
60
- get: function () { return chunkH5GOSXSC_cjs.Cron; }
61
+ get: function () { return chunkQIRDQZYL_cjs.Cron; }
61
62
  });
62
63
  //# sourceMappingURL=cron.cjs.map
63
64
  //# sourceMappingURL=cron.cjs.map
package/dist/cron.js CHANGED
@@ -1,23 +1,23 @@
1
- export { Cron } from './chunk-M7UHYBEY.js';
2
- import './chunk-KBXWEWKS.js';
3
- import './chunk-OHBIUXKM.js';
4
- import './chunk-ODTZ7HX3.js';
5
- import './chunk-YMA4S2WO.js';
1
+ export { Cron } from './chunk-5QOIQJ5J.js';
2
+ import './chunk-CF5OMCZG.js';
3
+ import './chunk-WG7R5W6R.js';
4
+ import './chunk-WLZ7XRWH.js';
5
+ import './chunk-MZ2FGBLZ.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-GJ6RK75E.js';
12
- import './chunk-MVAPK2BX.js';
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-BMAZLQQ4.js';
16
+ import './chunk-G24KZRSA.js';
17
17
  import './chunk-HKCKOAIO.js';
18
- import './chunk-7FHZ4VQX.js';
18
+ import './chunk-SAVIWMZB.js';
19
19
  import './chunk-KVNWIAO4.js';
20
- import './chunk-UPRJR6IP.js';
20
+ import './chunk-UCBJBJ27.js';
21
21
  import './chunk-FD2UT76F.js';
22
22
  import './chunk-4VPXM6UU.js';
23
23
  import './chunk-U54XCYG3.js';
@@ -25,20 +25,21 @@ import './chunk-NAF4L3T6.js';
25
25
  import './chunk-RNB4APBZ.js';
26
26
  import './chunk-6X6ID4MO.js';
27
27
  import './chunk-4ERPXIVB.js';
28
- import './chunk-GTKFV7O5.js';
28
+ import './chunk-WFC26L6Y.js';
29
29
  import './chunk-7AD3ZTZL.js';
30
30
  import './chunk-QARJGQSA.js';
31
31
  import './chunk-RIAM53CP.js';
32
32
  import './chunk-UC3HT2S4.js';
33
33
  import './chunk-OC4NTGMN.js';
34
34
  import './chunk-44JAAH4X.js';
35
- import './chunk-DZBSJX6J.js';
35
+ import './chunk-FKMUFNQE.js';
36
36
  import './chunk-CQ2TQ32Y.js';
37
37
  import './chunk-CV7XMBHP.js';
38
38
  import './chunk-Q5EWJPRY.js';
39
39
  import './chunk-RUDY2GTT.js';
40
40
  import './chunk-VF7EWVDG.js';
41
- import './chunk-2QKTVKH3.js';
41
+ import './chunk-ZHPWGIUX.js';
42
+ import './chunk-UFLD2HEV.js';
42
43
  import './chunk-AG5JPQIY.js';
43
44
  import './chunk-F7AQV62G.js';
44
45
  import './chunk-R7WIIPUR.js';