@cleocode/core 2026.6.12 → 2026.6.13

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 (385) hide show
  1. package/dist/conduit/local-transport.d.ts +12 -0
  2. package/dist/conduit/local-transport.d.ts.map +1 -1
  3. package/dist/conduit/local-transport.js +53 -23
  4. package/dist/conduit/local-transport.js.map +1 -1
  5. package/dist/crypto/credentials.d.ts +37 -0
  6. package/dist/crypto/credentials.d.ts.map +1 -1
  7. package/dist/crypto/credentials.js +110 -0
  8. package/dist/crypto/credentials.js.map +1 -1
  9. package/dist/dispatch/contracts/derive-output-contract.d.ts +86 -0
  10. package/dist/dispatch/contracts/derive-output-contract.d.ts.map +1 -0
  11. package/dist/dispatch/contracts/derive-output-contract.js +347 -0
  12. package/dist/dispatch/contracts/derive-output-contract.js.map +1 -0
  13. package/dist/dispatch/contracts/ensures-schema.d.ts +77 -0
  14. package/dist/dispatch/contracts/ensures-schema.d.ts.map +1 -0
  15. package/dist/dispatch/contracts/ensures-schema.js +91 -0
  16. package/dist/dispatch/contracts/ensures-schema.js.map +1 -0
  17. package/dist/dispatch/contracts/output-contracts.d.ts +27 -5
  18. package/dist/dispatch/contracts/output-contracts.d.ts.map +1 -1
  19. package/dist/dispatch/contracts/output-contracts.js +29 -6
  20. package/dist/dispatch/contracts/output-contracts.js.map +1 -1
  21. package/dist/docs/export-document.js +2294 -1250
  22. package/dist/docs/export-document.js.map +3 -3
  23. package/dist/go/driver.d.ts +132 -7
  24. package/dist/go/driver.d.ts.map +1 -1
  25. package/dist/go/driver.js +135 -10
  26. package/dist/go/driver.js.map +1 -1
  27. package/dist/go/index.d.ts +1 -1
  28. package/dist/go/index.d.ts.map +1 -1
  29. package/dist/go/index.js +1 -1
  30. package/dist/go/index.js.map +1 -1
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +5 -0
  34. package/dist/index.js.map +1 -1
  35. package/dist/internal.d.ts +13 -10
  36. package/dist/internal.d.ts.map +1 -1
  37. package/dist/internal.js +11 -11
  38. package/dist/internal.js.map +1 -1
  39. package/dist/lifecycle/engine-ops.d.ts.map +1 -1
  40. package/dist/lifecycle/engine-ops.js +7 -4
  41. package/dist/lifecycle/engine-ops.js.map +1 -1
  42. package/dist/lifecycle/ivtr-loop.d.ts +108 -183
  43. package/dist/lifecycle/ivtr-loop.d.ts.map +1 -1
  44. package/dist/lifecycle/ivtr-loop.js +207 -522
  45. package/dist/lifecycle/ivtr-loop.js.map +1 -1
  46. package/dist/llm/auxiliary-fallback.js +1 -1
  47. package/dist/llm/auxiliary-fallback.js.map +1 -1
  48. package/dist/llm/cli-ops.d.ts +14 -1
  49. package/dist/llm/cli-ops.d.ts.map +1 -1
  50. package/dist/llm/cli-ops.js +41 -12
  51. package/dist/llm/cli-ops.js.map +1 -1
  52. package/dist/llm/concrete-session.d.ts.map +1 -1
  53. package/dist/llm/concrete-session.js +4 -0
  54. package/dist/llm/concrete-session.js.map +1 -1
  55. package/dist/llm/credentials.d.ts +35 -0
  56. package/dist/llm/credentials.d.ts.map +1 -1
  57. package/dist/llm/credentials.js +49 -0
  58. package/dist/llm/credentials.js.map +1 -1
  59. package/dist/llm/index.d.ts +4 -0
  60. package/dist/llm/index.d.ts.map +1 -1
  61. package/dist/llm/index.js +4 -0
  62. package/dist/llm/index.js.map +1 -1
  63. package/dist/llm/pi/gondolin-loader.d.ts +241 -0
  64. package/dist/llm/pi/gondolin-loader.d.ts.map +1 -0
  65. package/dist/llm/pi/gondolin-loader.js +195 -0
  66. package/dist/llm/pi/gondolin-loader.js.map +1 -0
  67. package/dist/llm/pi/index.d.ts +28 -0
  68. package/dist/llm/pi/index.d.ts.map +1 -0
  69. package/dist/llm/pi/index.js +27 -0
  70. package/dist/llm/pi/index.js.map +1 -0
  71. package/dist/llm/pi/pi-agent-adapter.d.ts +135 -0
  72. package/dist/llm/pi/pi-agent-adapter.d.ts.map +1 -0
  73. package/dist/llm/pi/pi-agent-adapter.js +329 -0
  74. package/dist/llm/pi/pi-agent-adapter.js.map +1 -0
  75. package/dist/llm/pi/pi-errors.d.ts +161 -0
  76. package/dist/llm/pi/pi-errors.d.ts.map +1 -0
  77. package/dist/llm/pi/pi-errors.js +296 -0
  78. package/dist/llm/pi/pi-errors.js.map +1 -0
  79. package/dist/llm/pi/pi-execution-env.d.ts +286 -0
  80. package/dist/llm/pi/pi-execution-env.d.ts.map +1 -0
  81. package/dist/llm/pi/pi-execution-env.js +406 -0
  82. package/dist/llm/pi/pi-execution-env.js.map +1 -0
  83. package/dist/llm/pi/pi-gondolin-env.d.ts +227 -0
  84. package/dist/llm/pi/pi-gondolin-env.d.ts.map +1 -0
  85. package/dist/llm/pi/pi-gondolin-env.js +541 -0
  86. package/dist/llm/pi/pi-gondolin-env.js.map +1 -0
  87. package/dist/llm/pi/pi-session-storage.d.ts +154 -0
  88. package/dist/llm/pi/pi-session-storage.d.ts.map +1 -0
  89. package/dist/llm/pi/pi-session-storage.js +314 -0
  90. package/dist/llm/pi/pi-session-storage.js.map +1 -0
  91. package/dist/llm/pi/pi-stream-fn.d.ts +124 -0
  92. package/dist/llm/pi/pi-stream-fn.d.ts.map +1 -0
  93. package/dist/llm/pi/pi-stream-fn.js +504 -0
  94. package/dist/llm/pi/pi-stream-fn.js.map +1 -0
  95. package/dist/llm/pi/pi-tool-bridge.d.ts +99 -0
  96. package/dist/llm/pi/pi-tool-bridge.d.ts.map +1 -0
  97. package/dist/llm/pi/pi-tool-bridge.js +117 -0
  98. package/dist/llm/pi/pi-tool-bridge.js.map +1 -0
  99. package/dist/llm/pi/pi-types.d.ts +56 -0
  100. package/dist/llm/pi/pi-types.d.ts.map +1 -0
  101. package/dist/llm/pi/pi-types.js +16 -0
  102. package/dist/llm/pi/pi-types.js.map +1 -0
  103. package/dist/llm/pi/resolve-execution-env.d.ts +194 -0
  104. package/dist/llm/pi/resolve-execution-env.d.ts.map +1 -0
  105. package/dist/llm/pi/resolve-execution-env.js +132 -0
  106. package/dist/llm/pi/resolve-execution-env.js.map +1 -0
  107. package/dist/llm/plugin-facade.js +2253 -1151
  108. package/dist/llm/plugin-facade.js.map +3 -3
  109. package/dist/llm/role-executor.d.ts.map +1 -1
  110. package/dist/llm/role-executor.js +8 -5
  111. package/dist/llm/role-executor.js.map +1 -1
  112. package/dist/llm/role-resolver.d.ts +46 -14
  113. package/dist/llm/role-resolver.d.ts.map +1 -1
  114. package/dist/llm/role-resolver.js +178 -20
  115. package/dist/llm/role-resolver.js.map +1 -1
  116. package/dist/llm/sealed-credential.d.ts +125 -0
  117. package/dist/llm/sealed-credential.d.ts.map +1 -0
  118. package/dist/llm/sealed-credential.js +133 -0
  119. package/dist/llm/sealed-credential.js.map +1 -0
  120. package/dist/llm/session-factory.d.ts.map +1 -1
  121. package/dist/llm/session-factory.js +6 -2
  122. package/dist/llm/session-factory.js.map +1 -1
  123. package/dist/llm/system-key.d.ts +67 -0
  124. package/dist/llm/system-key.d.ts.map +1 -0
  125. package/dist/llm/system-key.js +87 -0
  126. package/dist/llm/system-key.js.map +1 -0
  127. package/dist/llm/system-of-use-registry.d.ts +119 -0
  128. package/dist/llm/system-of-use-registry.d.ts.map +1 -0
  129. package/dist/llm/system-of-use-registry.js +200 -0
  130. package/dist/llm/system-of-use-registry.js.map +1 -0
  131. package/dist/llm/system-resolver.d.ts +32 -10
  132. package/dist/llm/system-resolver.d.ts.map +1 -1
  133. package/dist/llm/system-resolver.js +70 -18
  134. package/dist/llm/system-resolver.js.map +1 -1
  135. package/dist/memory/brain-writer-thread.d.ts.map +1 -1
  136. package/dist/memory/brain-writer-thread.js +116 -11
  137. package/dist/memory/brain-writer-thread.js.map +1 -1
  138. package/dist/memory/claude-mem-migration.d.ts.map +1 -1
  139. package/dist/memory/claude-mem-migration.js +21 -0
  140. package/dist/memory/claude-mem-migration.js.map +1 -1
  141. package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
  142. package/dist/memory/graph-memory-bridge.js +32 -25
  143. package/dist/memory/graph-memory-bridge.js.map +1 -1
  144. package/dist/memory/llm-backend-resolver.js +23 -5
  145. package/dist/memory/llm-backend-resolver.js.map +1 -1
  146. package/dist/nexus/migrations/M-split-graph.d.ts.map +1 -1
  147. package/dist/nexus/migrations/M-split-graph.js +60 -53
  148. package/dist/nexus/migrations/M-split-graph.js.map +1 -1
  149. package/dist/orchestrate/pivot.d.ts.map +1 -1
  150. package/dist/orchestrate/pivot.js +20 -2
  151. package/dist/orchestrate/pivot.js.map +1 -1
  152. package/dist/release/engine-ops.js +2 -2
  153. package/dist/release/engine-ops.js.map +1 -1
  154. package/dist/routing/capability-matrix.d.ts.map +1 -1
  155. package/dist/routing/capability-matrix.js +0 -57
  156. package/dist/routing/capability-matrix.js.map +1 -1
  157. package/dist/selfimprove/budget.d.ts +206 -0
  158. package/dist/selfimprove/budget.d.ts.map +1 -0
  159. package/dist/selfimprove/budget.js +203 -0
  160. package/dist/selfimprove/budget.js.map +1 -0
  161. package/dist/selfimprove/dhq-adapter.d.ts +105 -0
  162. package/dist/selfimprove/dhq-adapter.d.ts.map +1 -0
  163. package/dist/selfimprove/dhq-adapter.js +95 -0
  164. package/dist/selfimprove/dhq-adapter.js.map +1 -0
  165. package/dist/selfimprove/draft-pr.d.ts +129 -0
  166. package/dist/selfimprove/draft-pr.d.ts.map +1 -0
  167. package/dist/selfimprove/draft-pr.js +158 -0
  168. package/dist/selfimprove/draft-pr.js.map +1 -0
  169. package/dist/selfimprove/envelope-diff.d.ts +162 -0
  170. package/dist/selfimprove/envelope-diff.d.ts.map +1 -0
  171. package/dist/selfimprove/envelope-diff.js +321 -0
  172. package/dist/selfimprove/envelope-diff.js.map +1 -0
  173. package/dist/selfimprove/replay.d.ts +121 -0
  174. package/dist/selfimprove/replay.d.ts.map +1 -0
  175. package/dist/selfimprove/replay.js +109 -0
  176. package/dist/selfimprove/replay.js.map +1 -0
  177. package/dist/selfimprove/run-loop.d.ts +148 -0
  178. package/dist/selfimprove/run-loop.d.ts.map +1 -0
  179. package/dist/selfimprove/run-loop.js +240 -0
  180. package/dist/selfimprove/run-loop.js.map +1 -0
  181. package/dist/selfimprove/scenario.d.ts +145 -0
  182. package/dist/selfimprove/scenario.d.ts.map +1 -0
  183. package/dist/selfimprove/scenario.js +243 -0
  184. package/dist/selfimprove/scenario.js.map +1 -0
  185. package/dist/sentient/daemon-entry.js +5 -0
  186. package/dist/sentient/daemon-entry.js.map +1 -1
  187. package/dist/sentient/daemon.d.ts.map +1 -1
  188. package/dist/sentient/daemon.js +19 -0
  189. package/dist/sentient/daemon.js.map +1 -1
  190. package/dist/sentient/hygiene-scan.d.ts.map +1 -1
  191. package/dist/sentient/hygiene-scan.js +14 -6
  192. package/dist/sentient/hygiene-scan.js.map +1 -1
  193. package/dist/sessions/briefing.d.ts.map +1 -1
  194. package/dist/sessions/briefing.js +13 -9
  195. package/dist/sessions/briefing.js.map +1 -1
  196. package/dist/sessions/connection-session-handle.d.ts +161 -0
  197. package/dist/sessions/connection-session-handle.d.ts.map +1 -0
  198. package/dist/sessions/connection-session-handle.js +168 -0
  199. package/dist/sessions/connection-session-handle.js.map +1 -0
  200. package/dist/sessions/handoff.d.ts.map +1 -1
  201. package/dist/sessions/handoff.js +9 -0
  202. package/dist/sessions/handoff.js.map +1 -1
  203. package/dist/sessions/index.d.ts +4 -1
  204. package/dist/sessions/index.d.ts.map +1 -1
  205. package/dist/sessions/index.js +31 -1
  206. package/dist/sessions/index.js.map +1 -1
  207. package/dist/sessions/session-id.d.ts +34 -0
  208. package/dist/sessions/session-id.d.ts.map +1 -1
  209. package/dist/sessions/session-id.js +37 -0
  210. package/dist/sessions/session-id.js.map +1 -1
  211. package/dist/sessions/session-manifest-mirror.d.ts +115 -0
  212. package/dist/sessions/session-manifest-mirror.d.ts.map +1 -0
  213. package/dist/sessions/session-manifest-mirror.js +250 -0
  214. package/dist/sessions/session-manifest-mirror.js.map +1 -0
  215. package/dist/sessions/session-switch.d.ts.map +1 -1
  216. package/dist/sessions/session-switch.js +5 -2
  217. package/dist/sessions/session-switch.js.map +1 -1
  218. package/dist/store/converters.d.ts.map +1 -1
  219. package/dist/store/converters.js +2 -0
  220. package/dist/store/converters.js.map +1 -1
  221. package/dist/store/db-helpers.d.ts.map +1 -1
  222. package/dist/store/db-helpers.js +2 -0
  223. package/dist/store/db-helpers.js.map +1 -1
  224. package/dist/store/dual-scope-db.d.ts.map +1 -1
  225. package/dist/store/dual-scope-db.js +87 -47
  226. package/dist/store/dual-scope-db.js.map +1 -1
  227. package/dist/store/pi-session-store.d.ts +151 -0
  228. package/dist/store/pi-session-store.d.ts.map +1 -0
  229. package/dist/store/pi-session-store.js +166 -0
  230. package/dist/store/pi-session-store.js.map +1 -0
  231. package/dist/store/safety-data-accessor.d.ts +1 -0
  232. package/dist/store/safety-data-accessor.d.ts.map +1 -1
  233. package/dist/store/safety-data-accessor.js +5 -0
  234. package/dist/store/safety-data-accessor.js.map +1 -1
  235. package/dist/store/schema/cleo-global/accounts.d.ts +357 -0
  236. package/dist/store/schema/cleo-global/accounts.d.ts.map +1 -0
  237. package/dist/store/schema/cleo-global/accounts.js +136 -0
  238. package/dist/store/schema/cleo-global/accounts.js.map +1 -0
  239. package/dist/store/schema/cleo-global/index.d.ts +2 -0
  240. package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
  241. package/dist/store/schema/cleo-global/index.js +2 -0
  242. package/dist/store/schema/cleo-global/index.js.map +1 -1
  243. package/dist/store/schema/cleo-global/session-manifest.d.ts +217 -0
  244. package/dist/store/schema/cleo-global/session-manifest.d.ts.map +1 -0
  245. package/dist/store/schema/cleo-global/session-manifest.js +99 -0
  246. package/dist/store/schema/cleo-global/session-manifest.js.map +1 -0
  247. package/dist/store/schema/cleo-project/tasks-core.d.ts +16 -0
  248. package/dist/store/schema/cleo-project/tasks-core.d.ts.map +1 -1
  249. package/dist/store/schema/cleo-project/tasks-core.js +14 -0
  250. package/dist/store/schema/cleo-project/tasks-core.js.map +1 -1
  251. package/dist/store/schema/tasks.d.ts +16 -0
  252. package/dist/store/schema/tasks.d.ts.map +1 -1
  253. package/dist/store/schema/tasks.js +10 -0
  254. package/dist/store/schema/tasks.js.map +1 -1
  255. package/dist/store/selfimprove-dhq-schema.d.ts +284 -0
  256. package/dist/store/selfimprove-dhq-schema.d.ts.map +1 -0
  257. package/dist/store/selfimprove-dhq-schema.js +128 -0
  258. package/dist/store/selfimprove-dhq-schema.js.map +1 -0
  259. package/dist/store/selfimprove-dhq-store.d.ts +175 -0
  260. package/dist/store/selfimprove-dhq-store.d.ts.map +1 -0
  261. package/dist/store/selfimprove-dhq-store.js +182 -0
  262. package/dist/store/selfimprove-dhq-store.js.map +1 -0
  263. package/dist/store/session-store.d.ts +52 -13
  264. package/dist/store/session-store.d.ts.map +1 -1
  265. package/dist/store/session-store.js +71 -13
  266. package/dist/store/session-store.js.map +1 -1
  267. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  268. package/dist/store/sqlite-data-accessor.js +7 -0
  269. package/dist/store/sqlite-data-accessor.js.map +1 -1
  270. package/dist/store/umbrella-data-accessor.d.ts +1 -0
  271. package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
  272. package/dist/store/umbrella-data-accessor.js +5 -0
  273. package/dist/store/umbrella-data-accessor.js.map +1 -1
  274. package/dist/store/validation-schemas.d.ts +32 -0
  275. package/dist/store/validation-schemas.d.ts.map +1 -1
  276. package/dist/store/writer-lease-schema.d.ts +392 -0
  277. package/dist/store/writer-lease-schema.d.ts.map +1 -0
  278. package/dist/store/writer-lease-schema.js +142 -0
  279. package/dist/store/writer-lease-schema.js.map +1 -0
  280. package/dist/store/writer-lease.d.ts +368 -0
  281. package/dist/store/writer-lease.d.ts.map +1 -0
  282. package/dist/store/writer-lease.js +1002 -0
  283. package/dist/store/writer-lease.js.map +1 -0
  284. package/dist/tasks/backfill-child-projections.d.ts.map +1 -1
  285. package/dist/tasks/backfill-child-projections.js +14 -9
  286. package/dist/tasks/backfill-child-projections.js.map +1 -1
  287. package/dist/tasks/complete.d.ts.map +1 -1
  288. package/dist/tasks/complete.js +7 -10
  289. package/dist/tasks/complete.js.map +1 -1
  290. package/dist/tasks/duplicate-detector.d.ts.map +1 -1
  291. package/dist/tasks/duplicate-detector.js +14 -7
  292. package/dist/tasks/duplicate-detector.js.map +1 -1
  293. package/dist/telemetry/index.d.ts.map +1 -1
  294. package/dist/telemetry/index.js +10 -4
  295. package/dist/telemetry/index.js.map +1 -1
  296. package/dist/tools/agent-registry.d.ts +250 -0
  297. package/dist/tools/agent-registry.d.ts.map +1 -0
  298. package/dist/tools/agent-registry.js +292 -0
  299. package/dist/tools/agent-registry.js.map +1 -0
  300. package/dist/tools/agent-tool-families.d.ts +107 -0
  301. package/dist/tools/agent-tool-families.d.ts.map +1 -0
  302. package/dist/tools/agent-tool-families.js +527 -0
  303. package/dist/tools/agent-tool-families.js.map +1 -0
  304. package/dist/tools/browser-driver.d.ts +183 -0
  305. package/dist/tools/browser-driver.d.ts.map +1 -0
  306. package/dist/tools/browser-driver.js +242 -0
  307. package/dist/tools/browser-driver.js.map +1 -0
  308. package/dist/tools/builtin-agent-tools.d.ts +36 -0
  309. package/dist/tools/builtin-agent-tools.d.ts.map +1 -0
  310. package/dist/tools/builtin-agent-tools.js +150 -0
  311. package/dist/tools/builtin-agent-tools.js.map +1 -0
  312. package/dist/tools/dispatch.d.ts +370 -0
  313. package/dist/tools/dispatch.d.ts.map +1 -0
  314. package/dist/tools/dispatch.js +505 -0
  315. package/dist/tools/dispatch.js.map +1 -0
  316. package/dist/tools/env-scrub.d.ts +93 -0
  317. package/dist/tools/env-scrub.d.ts.map +1 -0
  318. package/dist/tools/env-scrub.js +176 -0
  319. package/dist/tools/env-scrub.js.map +1 -0
  320. package/dist/tools/fs.d.ts +30 -0
  321. package/dist/tools/fs.d.ts.map +1 -1
  322. package/dist/tools/fs.js +55 -2
  323. package/dist/tools/fs.js.map +1 -1
  324. package/dist/tools/guard.d.ts +15 -0
  325. package/dist/tools/guard.d.ts.map +1 -1
  326. package/dist/tools/guard.js +49 -12
  327. package/dist/tools/guard.js.map +1 -1
  328. package/dist/tools/index.d.ts +10 -0
  329. package/dist/tools/index.d.ts.map +1 -1
  330. package/dist/tools/index.js +37 -0
  331. package/dist/tools/index.js.map +1 -1
  332. package/dist/tools/pty.d.ts +45 -0
  333. package/dist/tools/pty.d.ts.map +1 -0
  334. package/dist/tools/pty.js +166 -0
  335. package/dist/tools/pty.js.map +1 -0
  336. package/dist/tools/schema-gen.d.ts +57 -0
  337. package/dist/tools/schema-gen.d.ts.map +1 -0
  338. package/dist/tools/schema-gen.js +52 -0
  339. package/dist/tools/schema-gen.js.map +1 -0
  340. package/dist/tools/shell.d.ts +12 -0
  341. package/dist/tools/shell.d.ts.map +1 -1
  342. package/dist/tools/shell.js +14 -1
  343. package/dist/tools/shell.js.map +1 -1
  344. package/dist/tools/web-agent-tools.d.ts +72 -0
  345. package/dist/tools/web-agent-tools.d.ts.map +1 -0
  346. package/dist/tools/web-agent-tools.js +393 -0
  347. package/dist/tools/web-agent-tools.js.map +1 -0
  348. package/dist/tools/web-search-backends.d.ts +156 -0
  349. package/dist/tools/web-search-backends.d.ts.map +1 -0
  350. package/dist/tools/web-search-backends.js +290 -0
  351. package/dist/tools/web-search-backends.js.map +1 -0
  352. package/dist/validation/ops.d.ts +1 -15
  353. package/dist/validation/ops.d.ts.map +1 -1
  354. package/dist/validation/ops.js +0 -20
  355. package/dist/validation/ops.js.map +1 -1
  356. package/migrations/drizzle-cleo-global/20260607000000_t11891-writer-leases/migration.sql +55 -0
  357. package/migrations/drizzle-cleo-global/20260607010000_t11639-session-manifest/migration.sql +43 -0
  358. package/migrations/drizzle-cleo-global/20260608000000_t11899-pi-session-tree/migration.sql +52 -0
  359. package/migrations/drizzle-cleo-global/20260608010000_t11709-accounts-credential-pool/migration.sql +72 -0
  360. package/migrations/drizzle-cleo-global/20260608020000_t11889-selfimprove-dhq/migration.sql +64 -0
  361. package/migrations/drizzle-cleo-project/20260607000000_t11891-writer-leases/migration.sql +55 -0
  362. package/migrations/drizzle-cleo-project/20260607010000_t11639-session-parent/migration.sql +22 -0
  363. package/migrations/drizzle-cleo-project/20260608000000_t11899-pi-session-tree/migration.sql +52 -0
  364. package/migrations/drizzle-cleo-project/20260608020000_t11889-selfimprove-dhq/migration.sql +64 -0
  365. package/package.json +15 -13
  366. package/dist/lifecycle/chain-composition.d.ts +0 -30
  367. package/dist/lifecycle/chain-composition.d.ts.map +0 -1
  368. package/dist/lifecycle/chain-composition.js +0 -152
  369. package/dist/lifecycle/chain-composition.js.map +0 -1
  370. package/dist/lifecycle/chain-store.d.ts +0 -70
  371. package/dist/lifecycle/chain-store.d.ts.map +0 -1
  372. package/dist/lifecycle/chain-store.js +0 -246
  373. package/dist/lifecycle/chain-store.js.map +0 -1
  374. package/dist/lifecycle/default-chain.d.ts +0 -39
  375. package/dist/lifecycle/default-chain.d.ts.map +0 -1
  376. package/dist/lifecycle/default-chain.js +0 -176
  377. package/dist/lifecycle/default-chain.js.map +0 -1
  378. package/dist/lifecycle/tessera-engine.d.ts +0 -48
  379. package/dist/lifecycle/tessera-engine.d.ts.map +0 -1
  380. package/dist/lifecycle/tessera-engine.js +0 -249
  381. package/dist/lifecycle/tessera-engine.js.map +0 -1
  382. package/dist/validation/chain-validation.d.ts +0 -43
  383. package/dist/validation/chain-validation.d.ts.map +0 -1
  384. package/dist/validation/chain-validation.js +0 -146
  385. package/dist/validation/chain-validation.js.map +0 -1
@@ -0,0 +1,370 @@
1
+ /**
2
+ * Agent tool-call dispatch engine (T1740 · epic T11456 · SG-TOOLS).
3
+ *
4
+ * The SINGLE chokepoint that turns a model-emitted tool-call `{ name, args }`
5
+ * into an executed, LLM-safe result. It is the SDK-side dispatch path the T1738
6
+ * architecture (D11141) names: **core DISPATCHES, cleo-os DRIVES**. Given a tool
7
+ * call from the agent loop, it:
8
+ *
9
+ * 1. **Looks up** the tool in the injected {@link AgentToolRegistry} (the
10
+ * name→descriptor catalog). An unknown name is a typed
11
+ * `tool-not-found` result — never a throw.
12
+ * 2. **Validates** the model-supplied arguments against the tool's Zod schema
13
+ * (defense in depth: the wire layer advertised the JSON-schema, but the
14
+ * model's emitted args are re-validated here before any side effect). A
15
+ * schema failure is a typed `invalid-args` result carrying the FLATTENED
16
+ * issue list — not the raw Zod error (no internals leak).
17
+ * 3. **Checks availability** for the current {@link ToolAvailabilityContext}
18
+ * (network egress, binaries on PATH, capability flags). An unavailable tool
19
+ * is a typed `guard-denied` result — the model is told the tool is not
20
+ * offered right now, with no precondition internals.
21
+ * 4. **Charges the budget** ({@link ToolCallBudget}) — per-call count / wall-time
22
+ * ceilings. An exhausted budget short-circuits with a typed `guard-denied`
23
+ * result BEFORE the tool runs; a per-call timeout races the execution and
24
+ * yields a typed `timeout` result.
25
+ * 5. **Executes** the bound {@link AgentToolExecutable} over the injected
26
+ * {@link GuardedToolSurface} — the deny-first chokepoint
27
+ * ({@link ./guard.js}). Every fs/shell side effect therefore still funnels
28
+ * through the guard's path allowlist + command denylist + env scrub; there
29
+ * is NO raw-primitive bypass.
30
+ * 6. **Formats** the outcome for LLM consumption ({@link formatToolResultForLlm})
31
+ * — a `tool_result`-shaped payload the Pi loop feeds back to the model. On
32
+ * ANY error the message is a redacted, classified summary; a raw secret,
33
+ * stack trace, or guard internal NEVER reaches the model-facing string.
34
+ *
35
+ * ## Sync + async handlers (AC2)
36
+ *
37
+ * A registered {@link AgentToolExecutable} returns a `Promise<unknown>`, but a
38
+ * synchronous handler that returns a plain value is equally supported: the
39
+ * engine `await`s the call so a non-thenable return is normalized to a resolved
40
+ * value, and a synchronous throw is caught the same as a rejected promise.
41
+ *
42
+ * ## Why it lives in `core/src/tools` (Gate-11)
43
+ *
44
+ * The dispatch engine is a CORE-SDK concern, built entirely against the frozen
45
+ * {@link AgentToolRegistry} + {@link GuardedToolSurface} contracts. It defines
46
+ * NO new atomic tool primitive (Gate-11 Tools-vs-Skills boundary) and makes NO
47
+ * LLM call (Gate-13): result-formatting is pure serialization. The harness
48
+ * (`cleo-os`) and the in-process Pi adapter merely SUPPLY the registry, the
49
+ * guard, and the workspace context, then read the {@link ToolDispatchResult}.
50
+ *
51
+ * @task T1740
52
+ * @epic T11456
53
+ * @see ./agent-registry.js — the name→descriptor catalog + availability checks
54
+ * @see ./guard.js — the deny-first surface every executable routes side effects through
55
+ * @see ../llm/pi/pi-tool-bridge.js — the AC6 consumer wiring this into the Pi loop
56
+ */
57
+ import type { GuardedToolSurface } from '@cleocode/contracts/tools/skill-executor';
58
+ import type { z } from 'zod';
59
+ import type { AgentToolRegistry, ToolAvailabilityContext } from './agent-registry.js';
60
+ /**
61
+ * The typed failure classes a dispatch can produce (AC3). Each maps a distinct
62
+ * failure mode to a stable, model-safe category so the loop (and any UI) can
63
+ * branch on the KIND without parsing a free-text message:
64
+ *
65
+ * - `tool-not-found` — the model named a tool not in the registry.
66
+ * - `invalid-args` — arguments failed the tool's Zod schema.
67
+ * - `guard-denied` — the tool is unavailable for this context, or the
68
+ * per-call budget was exhausted before it ran.
69
+ * - `execution-error`— the tool ran but threw (incl. a `GuardDeniedError`
70
+ * from the deny-first surface during the side effect), OR
71
+ * the call was cancelled via its abort signal before it
72
+ * completed (the run was cancelled out from under it).
73
+ * - `timeout` — the tool exceeded the per-call wall-time ceiling.
74
+ */
75
+ export type ToolDispatchErrorKind = 'tool-not-found' | 'invalid-args' | 'guard-denied' | 'execution-error' | 'timeout';
76
+ /**
77
+ * Stable machine-readable error codes, one per {@link ToolDispatchErrorKind}.
78
+ * Surfaced on the failure envelope so a programmatic caller never string-matches
79
+ * the human message.
80
+ */
81
+ export declare const TOOL_DISPATCH_ERROR_CODE: Readonly<Record<ToolDispatchErrorKind, string>>;
82
+ /**
83
+ * A single tool call as the model emits it — the dispatch engine's input. The
84
+ * `name` is the model-visible tool name; `arguments` is the JSON-parsed argument
85
+ * object (the engine never sees the raw JSON string — parsing is the loop's job,
86
+ * the engine validates the parsed shape).
87
+ */
88
+ export interface ToolCall {
89
+ /** Stable id correlating the call to its `tool_result` (loop-supplied). */
90
+ readonly id: string;
91
+ /** Model-visible tool name to dispatch. */
92
+ readonly name: string;
93
+ /** JSON-parsed argument object the model supplied. */
94
+ readonly arguments: Readonly<Record<string, unknown>>;
95
+ }
96
+ /**
97
+ * The successful outcome of a dispatch (AC4). `value` is the tool's raw return
98
+ * (opaque to the engine); `display` is the LLM-facing string the loop feeds back
99
+ * in the `tool_result` message.
100
+ */
101
+ export interface ToolDispatchSuccess {
102
+ /** Discriminant. */
103
+ readonly ok: true;
104
+ /** The dispatched tool's name (echoed for correlation). */
105
+ readonly name: string;
106
+ /** The raw tool return value (for structured logging / details). */
107
+ readonly value: unknown;
108
+ /** The LLM-facing rendering of `value` (the `tool_result` body). */
109
+ readonly display: string;
110
+ }
111
+ /**
112
+ * The failed outcome of a dispatch (AC3 + AC4). Carries the typed
113
+ * {@link ToolDispatchErrorKind}, a stable code, and a REDACTED, model-safe
114
+ * `message` — a raw secret / stack / guard internal is never placed here.
115
+ */
116
+ export interface ToolDispatchFailure {
117
+ /** Discriminant. */
118
+ readonly ok: false;
119
+ /** The dispatched tool's name (echoed for correlation). */
120
+ readonly name: string;
121
+ /** The typed failure class (AC3). */
122
+ readonly kind: ToolDispatchErrorKind;
123
+ /** Stable machine-readable code ({@link TOOL_DISPATCH_ERROR_CODE}). */
124
+ readonly code: string;
125
+ /** Redacted, model-safe failure summary (the `tool_result` body). */
126
+ readonly message: string;
127
+ /**
128
+ * For `invalid-args`, the flattened schema issues (path + reason) — safe to
129
+ * show the model so it can correct its call. Absent for other kinds.
130
+ */
131
+ readonly issues?: readonly ToolArgIssue[];
132
+ }
133
+ /** A flattened Zod issue: the field path and the human-readable reason. */
134
+ export interface ToolArgIssue {
135
+ /** Dotted field path, e.g. `path` or `args.0`. Empty for a root issue. */
136
+ readonly path: string;
137
+ /** Human-readable validation reason. */
138
+ readonly message: string;
139
+ }
140
+ /** The terminal result of a single dispatch — success or a classified failure. */
141
+ export type ToolDispatchResult = ToolDispatchSuccess | ToolDispatchFailure;
142
+ /** Caps for {@link ToolCallBudget}. A cap of `undefined` means "unbounded". */
143
+ export interface ToolBudgetLimits {
144
+ /** Max number of tool calls this budget admits. */
145
+ readonly maxCalls?: number;
146
+ /** Per-call wall-time ceiling in milliseconds (a slower call → `timeout`). */
147
+ readonly perCallTimeoutMs?: number;
148
+ /** Cumulative wall-time ceiling across all calls in milliseconds. */
149
+ readonly totalTimeBudgetMs?: number;
150
+ }
151
+ /**
152
+ * A snapshot of a {@link ToolCallBudget}'s consumption — surfaced so a consumer
153
+ * (the Pi loop / a UI) can report remaining headroom (AC5).
154
+ */
155
+ export interface ToolBudgetSnapshot {
156
+ /** Calls charged so far. */
157
+ readonly callsUsed: number;
158
+ /** Calls remaining (`Infinity` when uncapped). */
159
+ readonly callsRemaining: number;
160
+ /** Cumulative wall-time charged so far, in ms. */
161
+ readonly timeUsedMs: number;
162
+ /** Cumulative wall-time remaining, in ms (`Infinity` when uncapped). */
163
+ readonly timeRemainingMs: number;
164
+ }
165
+ /**
166
+ * Per-run tool-call budget (AC5). Tracks call count + cumulative wall-time
167
+ * against the configured {@link ToolBudgetLimits}. The engine consults
168
+ * {@link admit} BEFORE running a tool (rejecting once a ceiling is hit) and
169
+ * {@link charge}s the elapsed time AFTER. A single budget instance is threaded
170
+ * across all calls of one run, so the count/time caps are run-scoped.
171
+ */
172
+ export declare class ToolCallBudget {
173
+ #private;
174
+ /**
175
+ * @param limits - The ceilings this budget enforces (each optional → uncapped).
176
+ */
177
+ constructor(limits?: ToolBudgetLimits);
178
+ /** The per-call timeout ceiling in ms, or `undefined` when uncapped. */
179
+ get perCallTimeoutMs(): number | undefined;
180
+ /**
181
+ * Whether another call is admitted right now. Returns a typed denial reason
182
+ * (or `null` when admitted) so the engine can map it onto the precise
183
+ * `guard-denied` message WITHOUT exposing the limit internals to the model.
184
+ *
185
+ * @returns `null` when a call is admitted; otherwise the human-readable reason.
186
+ */
187
+ admit(): string | null;
188
+ /**
189
+ * Charge one completed call against the budget.
190
+ *
191
+ * @param elapsedMs - The call's measured wall-time in milliseconds.
192
+ */
193
+ charge(elapsedMs: number): void;
194
+ /** A read-only snapshot of current consumption (AC5). */
195
+ snapshot(): ToolBudgetSnapshot;
196
+ }
197
+ /** Maximum length of a formatted `tool_result` body before truncation (AC4). */
198
+ export declare const MAX_TOOL_RESULT_CHARS = 16000;
199
+ /**
200
+ * Construction dependencies for {@link ToolDispatchEngine}.
201
+ */
202
+ export interface ToolDispatchEngineDeps {
203
+ /** The frozen tool catalog the engine dispatches against (name→descriptor). */
204
+ readonly registry: AgentToolRegistry;
205
+ /**
206
+ * The deny-first guarded surface every executable performs side effects
207
+ * through. Injected — the engine never constructs a guard (Gate-11).
208
+ */
209
+ readonly tools: GuardedToolSurface;
210
+ /**
211
+ * Availability context (AC5 of the registry): a tool whose
212
+ * {@link AgentToolDescriptor.available} predicate is false for this context is
213
+ * `guard-denied` before it runs. Defaults to `{}` (everything available).
214
+ */
215
+ readonly availability?: ToolAvailabilityContext;
216
+ /**
217
+ * Optional run-scoped budget (AC5). When omitted an unbounded budget is used,
218
+ * so a call count / time ceiling is opt-in. Threaded across all
219
+ * {@link ToolDispatchEngine.dispatch} calls of one run.
220
+ */
221
+ readonly budget?: ToolCallBudget;
222
+ }
223
+ /**
224
+ * The agent tool-call dispatch engine (AC1).
225
+ *
226
+ * One instance per agent run: it holds the frozen registry, the guarded surface,
227
+ * the availability context, and the run-scoped budget, and dispatches each
228
+ * model-emitted {@link ToolCall} to a classified {@link ToolDispatchResult}.
229
+ * {@link dispatch} NEVER throws — every failure mode is encoded as a typed
230
+ * {@link ToolDispatchFailure} (AC3), so the agent loop can always feed a
231
+ * `tool_result` back and continue.
232
+ *
233
+ * @example
234
+ * ```ts
235
+ * const registry = await createAgentToolRegistry();
236
+ * const tools = createToolGuard({ allowedRoots: [root], mode: 'enforce' });
237
+ * const engine = new ToolDispatchEngine({
238
+ * registry,
239
+ * tools,
240
+ * budget: new ToolCallBudget({ maxCalls: 50, perCallTimeoutMs: 30_000 }),
241
+ * });
242
+ * const result = await engine.dispatch({ id: 'c1', name: 'read_file_paged', arguments: { path } });
243
+ * // result.ok ? feed result.display : feed the classified result.message
244
+ * ```
245
+ */
246
+ export declare class ToolDispatchEngine {
247
+ #private;
248
+ /**
249
+ * @param deps - The registry, guarded surface, availability context, and
250
+ * optional run-scoped budget.
251
+ */
252
+ constructor(deps: ToolDispatchEngineDeps);
253
+ /** A read-only snapshot of the run's budget consumption (AC5). */
254
+ budgetSnapshot(): ToolBudgetSnapshot;
255
+ /**
256
+ * Dispatch a single model-emitted tool call to a classified result (AC1–AC5).
257
+ *
258
+ * The full pipeline — lookup → validate → availability → budget admit →
259
+ * (timed) execute → charge → format — runs here. It NEVER throws: a thrown
260
+ * executable (incl. a deny-first `GuardDeniedError` during the side effect)
261
+ * becomes an `execution-error`, a slow executable a `timeout`, a cancelled call
262
+ * an `execution-error`, an unknown name a `tool-not-found`, bad args an
263
+ * `invalid-args`, and an unavailable tool / exhausted budget a `guard-denied`.
264
+ *
265
+ * ## Abort handling (honest contract)
266
+ *
267
+ * A `signal` (when supplied) is honoured REGARDLESS of whether a per-call
268
+ * timeout is configured — including the default no-budget production path: an
269
+ * already-aborted signal short-circuits before the executable is awaited, and
270
+ * an abort RACED in flight rejects with an `execution-error`. BUT this is
271
+ * abandon-the-promise cancellation, NOT preemptive kill: the frozen
272
+ * {@link AgentToolExecutable}/{@link GuardedToolSurface} contracts expose no
273
+ * signal channel, so a tool that already spawned an OS process keeps that
274
+ * process running until the tool's own internal bound fires. The engine
275
+ * returns promptly; the side effect may still be settling. See
276
+ * {@link ToolDispatchEngine.#runWithTimeout} for the full rationale.
277
+ *
278
+ * @param call - The model-emitted tool call (`{ id, name, arguments }`).
279
+ * @param signal - Optional abort signal honoured on every path (timeout or
280
+ * not); aborting yields an `execution-error` but cannot preemptively kill an
281
+ * in-flight OS process (frozen-contract limitation).
282
+ * @returns The terminal {@link ToolDispatchResult}.
283
+ */
284
+ dispatch(call: ToolCall, signal?: AbortSignal): Promise<ToolDispatchResult>;
285
+ }
286
+ /** Thrown internally when a tool call exceeds its per-call timeout (AC5). */
287
+ export declare class ToolTimeoutError extends Error {
288
+ /** Machine-readable code. */
289
+ readonly code = "E_TOOL_TIMEOUT";
290
+ constructor(message: string);
291
+ }
292
+ /**
293
+ * Thrown internally when a tool call is cancelled via its {@link AbortSignal}
294
+ * (containment-managed run cancel / OOM-guard / budget kill). Distinct from
295
+ * {@link ToolTimeoutError}: a timeout means "the call was too slow", an abort
296
+ * means "the run was cancelled out from under the call". The engine maps it to a
297
+ * typed `execution-error` result (the call did not complete).
298
+ *
299
+ * @remarks Winning the abort race only ABANDONS the executable promise — it does
300
+ * NOT preemptively kill a tool that already spawned an OS process, because the
301
+ * frozen {@link AgentToolExecutable}/{@link GuardedToolSurface} contracts carry
302
+ * no signal channel (see {@link ToolDispatchEngine.dispatch}).
303
+ */
304
+ export declare class ToolAbortError extends Error {
305
+ /** Machine-readable code. */
306
+ readonly code = "E_TOOL_ABORTED";
307
+ constructor(message: string);
308
+ }
309
+ /**
310
+ * Render a tool's raw return value into the LLM-facing `tool_result` body (AC4).
311
+ *
312
+ * A string passes through; everything else is JSON-serialized (pretty, stable).
313
+ * A circular / non-serializable value degrades to its `String(...)` form rather
314
+ * than throwing. The result is hard-capped at {@link MAX_TOOL_RESULT_CHARS} with
315
+ * a truncation marker so one tool call cannot blow the model's context window.
316
+ *
317
+ * @param value - The raw tool return.
318
+ * @returns The model-safe `tool_result` string.
319
+ */
320
+ export declare function formatToolValueForLlm(value: unknown): string;
321
+ /**
322
+ * Project a terminal {@link ToolDispatchResult} onto the `tool_result` message
323
+ * shape the agent loop feeds back to the model (AC4).
324
+ *
325
+ * The `content` is `result.display` on success or the redacted, classified
326
+ * `result.message` on failure (with the flattened arg issues appended when
327
+ * present). `isError` lets the loop / transport mark the turn so the model knows
328
+ * the call did not succeed.
329
+ *
330
+ * @param result - The dispatch outcome.
331
+ * @returns A `{ toolCallId, toolName, content, isError }` envelope.
332
+ */
333
+ export declare function formatToolResultForLlm(call: Pick<ToolCall, 'id'>, result: ToolDispatchResult): ToolResultPayload;
334
+ /**
335
+ * The LLM-facing `tool_result` payload shape (AC4) — the minimal subset the loop
336
+ * needs to build a provider `tool_result` / `toolResult` message. Structurally a
337
+ * subset of `pi-ai`'s `ToolResultMessage`, so the Pi bridge maps it 1:1.
338
+ */
339
+ export interface ToolResultPayload {
340
+ /** Correlates back to the originating {@link ToolCall.id}. */
341
+ readonly toolCallId: string;
342
+ /** The tool's name (echoed for the provider message). */
343
+ readonly toolName: string;
344
+ /** The model-facing result body (display on success, redacted summary on error). */
345
+ readonly content: string;
346
+ /** Whether the turn is an error result. */
347
+ readonly isError: boolean;
348
+ }
349
+ /**
350
+ * Produce a REDACTED, model-safe message from a thrown executable error (AC3).
351
+ *
352
+ * Only the error's single-line `message` is kept — never the stack trace (which
353
+ * can leak absolute paths / internal module structure) and never an attached
354
+ * `cause`. The message itself is scrubbed for obvious secret-looking tokens so a
355
+ * tool that interpolates a credential into its error string cannot leak it to
356
+ * the model. A non-`Error` throw degrades to a fixed, generic summary.
357
+ *
358
+ * @param err - The thrown value.
359
+ * @returns A single-line, secret-scrubbed message safe for the model.
360
+ */
361
+ export declare function redactErrorMessage(err: unknown): string;
362
+ /**
363
+ * Flatten a {@link z.ZodError} into the minimal, model-safe
364
+ * {@link ToolArgIssue}[] — path + reason only, no raw Zod internals.
365
+ *
366
+ * @param error - The Zod validation error.
367
+ * @returns The flattened issues.
368
+ */
369
+ export declare function flattenZodIssues(error: z.ZodError): readonly ToolArgIssue[];
370
+ //# sourceMappingURL=dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/tools/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,K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