@cerebriline/core 4.100.240

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 (479) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +16 -0
  3. package/assets/office-oxide/LICENSE-APACHE +176 -0
  4. package/assets/office-oxide/LICENSE-MIT +25 -0
  5. package/assets/office-oxide/office_oxide_bg.wasm +0 -0
  6. package/assets/prompt-templates/claude.md +516 -0
  7. package/assets/prompt-templates/deepseek.md +331 -0
  8. package/assets/prompt-templates/default.md +386 -0
  9. package/assets/prompt-templates/gemma.md +352 -0
  10. package/assets/prompt-templates/glm.md +334 -0
  11. package/assets/prompt-templates/kimi-k3.md +408 -0
  12. package/assets/prompt-templates/kimi.md +402 -0
  13. package/assets/prompt-templates/minimax.md +473 -0
  14. package/assets/prompt-templates/nemotron.md +358 -0
  15. package/assets/prompt-templates/qwen.md +612 -0
  16. package/dist/ClineCore.d.ts +365 -0
  17. package/dist/account/cline-account-service.d.ts +41 -0
  18. package/dist/account/index.d.ts +3 -0
  19. package/dist/account/rpc.d.ts +40 -0
  20. package/dist/account/types.d.ts +122 -0
  21. package/dist/auth/bounded-ttl-cache.d.ts +13 -0
  22. package/dist/auth/client.d.ts +30 -0
  23. package/dist/auth/cline.d.ts +71 -0
  24. package/dist/auth/codex.d.ts +40 -0
  25. package/dist/auth/oca.d.ts +21 -0
  26. package/dist/auth/provider-auth-registry.d.ts +52 -0
  27. package/dist/auth/server.d.ts +54 -0
  28. package/dist/auth/types.d.ts +103 -0
  29. package/dist/auth/utils.d.ts +31 -0
  30. package/dist/cline-core/automation.d.ts +34 -0
  31. package/dist/cline-core/runtime-services.d.ts +5 -0
  32. package/dist/cline-core/start-input.d.ts +10 -0
  33. package/dist/cline-core/telemetry.d.ts +10 -0
  34. package/dist/cline-core/types.d.ts +236 -0
  35. package/dist/cron/events/cron-event-ingress.d.ts +37 -0
  36. package/dist/cron/reports/cron-report-writer.d.ts +42 -0
  37. package/dist/cron/runner/cron-materializer.d.ts +35 -0
  38. package/dist/cron/runner/cron-runner.d.ts +60 -0
  39. package/dist/cron/runner/resource-limiter.d.ts +8 -0
  40. package/dist/cron/schedule/scheduler.d.ts +12 -0
  41. package/dist/cron/service/cron-service.d.ts +56 -0
  42. package/dist/cron/service/schedule-command-service.d.ts +14 -0
  43. package/dist/cron/service/schedule-service.d.ts +116 -0
  44. package/dist/cron/service/schedule-tool.d.ts +81 -0
  45. package/dist/cron/specs/cron-reconciler.d.ts +61 -0
  46. package/dist/cron/specs/cron-spec-parser.d.ts +26 -0
  47. package/dist/cron/specs/cron-watcher.d.ts +22 -0
  48. package/dist/cron/store/cron-schema.d.ts +2 -0
  49. package/dist/cron/store/sqlite-cron-store.d.ts +261 -0
  50. package/dist/extensions/agent-plugin/agent-skill.d.ts +21 -0
  51. package/dist/extensions/agent-plugin/index.d.ts +4 -0
  52. package/dist/extensions/agent-plugin/loader.d.ts +10 -0
  53. package/dist/extensions/agent-plugin/types.d.ts +67 -0
  54. package/dist/extensions/complexity/grammars.d.ts +92 -0
  55. package/dist/extensions/complexity/walker.d.ts +115 -0
  56. package/dist/extensions/config/builtin-templates.d.ts +10 -0
  57. package/dist/extensions/config/builtin-templates.generated.d.ts +5 -0
  58. package/dist/extensions/config/index.d.ts +15 -0
  59. package/dist/extensions/config/prompt-template-compaction.d.ts +92 -0
  60. package/dist/extensions/config/prompt-template-delta.d.ts +107 -0
  61. package/dist/extensions/config/prompt-template-hooks.d.ts +47 -0
  62. package/dist/extensions/config/prompt-template-loader.d.ts +79 -0
  63. package/dist/extensions/config/prompt-template-parser.d.ts +56 -0
  64. package/dist/extensions/config/prompt-template-review.d.ts +327 -0
  65. package/dist/extensions/config/prompt-template-session.d.ts +46 -0
  66. package/dist/extensions/config/runtime-commands.d.ts +23 -0
  67. package/dist/extensions/config/shipped-tool-signatures.d.ts +36 -0
  68. package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
  69. package/dist/extensions/config/unified-config-file-watcher.d.ts +77 -0
  70. package/dist/extensions/config/user-instruction-config-loader.d.ts +77 -0
  71. package/dist/extensions/config/user-instruction-plugin.d.ts +26 -0
  72. package/dist/extensions/config/user-instruction-service.d.ts +31 -0
  73. package/dist/extensions/context/agentic-compaction.d.ts +129 -0
  74. package/dist/extensions/context/basic-compaction.d.ts +19 -0
  75. package/dist/extensions/context/budget-projection/index.d.ts +2 -0
  76. package/dist/extensions/context/budget-projection/project.d.ts +4 -0
  77. package/dist/extensions/context/budget-projection/types.d.ts +58 -0
  78. package/dist/extensions/context/capped-thinking.d.ts +195 -0
  79. package/dist/extensions/context/compaction-cause.d.ts +27 -0
  80. package/dist/extensions/context/compaction-journal.d.ts +65 -0
  81. package/dist/extensions/context/compaction-revisions.d.ts +72 -0
  82. package/dist/extensions/context/compaction-shared.d.ts +608 -0
  83. package/dist/extensions/context/compaction.d.ts +161 -0
  84. package/dist/extensions/context/context-minimum-warning.d.ts +27 -0
  85. package/dist/extensions/context/continuation-compaction.d.ts +260 -0
  86. package/dist/extensions/context/council-compaction.d.ts +262 -0
  87. package/dist/extensions/context/full-compaction.d.ts +44 -0
  88. package/dist/extensions/context/kv-pressure.d.ts +258 -0
  89. package/dist/extensions/context/polykv-session.d.ts +372 -0
  90. package/dist/extensions/context/replay-compaction.d.ts +90 -0
  91. package/dist/extensions/context/tool-ledger.d.ts +198 -0
  92. package/dist/extensions/context/work-digest.d.ts +92 -0
  93. package/dist/extensions/index.d.ts +7 -0
  94. package/dist/extensions/mcp/client.d.ts +28 -0
  95. package/dist/extensions/mcp/config-loader.d.ts +102 -0
  96. package/dist/extensions/mcp/index.d.ts +15 -0
  97. package/dist/extensions/mcp/manager.d.ts +23 -0
  98. package/dist/extensions/mcp/name-transform.d.ts +2 -0
  99. package/dist/extensions/mcp/oauth.d.ts +68 -0
  100. package/dist/extensions/mcp/plugin-server-registration.d.ts +18 -0
  101. package/dist/extensions/mcp/policies.d.ts +14 -0
  102. package/dist/extensions/mcp/remote-proxy.d.ts +9 -0
  103. package/dist/extensions/mcp/timeout.d.ts +2 -0
  104. package/dist/extensions/mcp/tools.d.ts +3 -0
  105. package/dist/extensions/mcp/types.d.ts +133 -0
  106. package/dist/extensions/plugin/plugin-config-loader.d.ts +44 -0
  107. package/dist/extensions/plugin/plugin-load-report.d.ts +18 -0
  108. package/dist/extensions/plugin/plugin-loader.d.ts +23 -0
  109. package/dist/extensions/plugin/plugin-module-import.d.ts +4 -0
  110. package/dist/extensions/plugin/plugin-sandbox.d.ts +82 -0
  111. package/dist/extensions/plugin/plugin-targeting.d.ts +6 -0
  112. package/dist/extensions/plugin-sandbox-bootstrap.js +1 -0
  113. package/dist/extensions/tools/ask-lsp.d.ts +150 -0
  114. package/dist/extensions/tools/audio-tools.d.ts +156 -0
  115. package/dist/extensions/tools/browser.d.ts +137 -0
  116. package/dist/extensions/tools/check-file.d.ts +218 -0
  117. package/dist/extensions/tools/check-on-failure.d.ts +49 -0
  118. package/dist/extensions/tools/code-intel.d.ts +131 -0
  119. package/dist/extensions/tools/command-guard-extension.d.ts +22 -0
  120. package/dist/extensions/tools/command-guard.d.ts +29 -0
  121. package/dist/extensions/tools/constants.d.ts +28 -0
  122. package/dist/extensions/tools/definitions.d.ts +178 -0
  123. package/dist/extensions/tools/delimiter-balance.d.ts +121 -0
  124. package/dist/extensions/tools/edit-verification.d.ts +86 -0
  125. package/dist/extensions/tools/error-locations.d.ts +53 -0
  126. package/dist/extensions/tools/executors/apply-patch-parser.d.ts +68 -0
  127. package/dist/extensions/tools/executors/apply-patch.d.ts +48 -0
  128. package/dist/extensions/tools/executors/awk-parser.d.ts +163 -0
  129. package/dist/extensions/tools/executors/awk.d.ts +41 -0
  130. package/dist/extensions/tools/executors/bash.d.ts +119 -0
  131. package/dist/extensions/tools/executors/document/assets.d.ts +22 -0
  132. package/dist/extensions/tools/executors/document/ebook.d.ts +11 -0
  133. package/dist/extensions/tools/executors/document/formats.d.ts +83 -0
  134. package/dist/extensions/tools/executors/document/images.d.ts +73 -0
  135. package/dist/extensions/tools/executors/document/legacy.d.ts +20 -0
  136. package/dist/extensions/tools/executors/document/ocr.d.ts +67 -0
  137. package/dist/extensions/tools/executors/document/office-oxide.d.ts +19 -0
  138. package/dist/extensions/tools/executors/document/office-oxide.generated.d.ts +82 -0
  139. package/dist/extensions/tools/executors/document/office.d.ts +10 -0
  140. package/dist/extensions/tools/executors/document/pdf.d.ts +6 -0
  141. package/dist/extensions/tools/executors/document/pdfjs.d.ts +30 -0
  142. package/dist/extensions/tools/executors/document/range.d.ts +18 -0
  143. package/dist/extensions/tools/executors/document/recognition.d.ts +67 -0
  144. package/dist/extensions/tools/executors/document-extract.d.ts +55 -0
  145. package/dist/extensions/tools/executors/editor.d.ts +68 -0
  146. package/dist/extensions/tools/executors/file-locks.d.ts +41 -0
  147. package/dist/extensions/tools/executors/file-read.d.ts +136 -0
  148. package/dist/extensions/tools/executors/grep.d.ts +35 -0
  149. package/dist/extensions/tools/executors/index.d.ts +97 -0
  150. package/dist/extensions/tools/executors/line-endings.d.ts +23 -0
  151. package/dist/extensions/tools/executors/output-limits.d.ts +58 -0
  152. package/dist/extensions/tools/executors/overlay-receipts.d.ts +25 -0
  153. package/dist/extensions/tools/executors/posix-regex.d.ts +52 -0
  154. package/dist/extensions/tools/executors/read-receipts.d.ts +93 -0
  155. package/dist/extensions/tools/executors/run-command-execution-controller.d.ts +16 -0
  156. package/dist/extensions/tools/executors/search.d.ts +50 -0
  157. package/dist/extensions/tools/executors/sed.d.ts +92 -0
  158. package/dist/extensions/tools/executors/unchanged-reads.d.ts +55 -0
  159. package/dist/extensions/tools/executors/web-fetch.d.ts +58 -0
  160. package/dist/extensions/tools/helpers.d.ts +59 -0
  161. package/dist/extensions/tools/image-edit.d.ts +76 -0
  162. package/dist/extensions/tools/image-generation.d.ts +183 -0
  163. package/dist/extensions/tools/index.d.ts +68 -0
  164. package/dist/extensions/tools/jev.d.ts +336 -0
  165. package/dist/extensions/tools/list-files.d.ts +128 -0
  166. package/dist/extensions/tools/media-endpoint.d.ts +160 -0
  167. package/dist/extensions/tools/media-tools.d.ts +140 -0
  168. package/dist/extensions/tools/model-tool-routing.d.ts +33 -0
  169. package/dist/extensions/tools/presets.d.ts +154 -0
  170. package/dist/extensions/tools/qa-credentials.d.ts +133 -0
  171. package/dist/extensions/tools/runtime.d.ts +39 -0
  172. package/dist/extensions/tools/schemas.d.ts +845 -0
  173. package/dist/extensions/tools/task-progress.d.ts +217 -0
  174. package/dist/extensions/tools/team/agent-admission.d.ts +127 -0
  175. package/dist/extensions/tools/team/agent-check.d.ts +152 -0
  176. package/dist/extensions/tools/team/agent-controls.d.ts +55 -0
  177. package/dist/extensions/tools/team/agent-file.d.ts +28 -0
  178. package/dist/extensions/tools/team/agent-iteration-cap.d.ts +328 -0
  179. package/dist/extensions/tools/team/agent-names.d.ts +29 -0
  180. package/dist/extensions/tools/team/agent-node-placement.d.ts +160 -0
  181. package/dist/extensions/tools/team/agent-placement-queue.d.ts +199 -0
  182. package/dist/extensions/tools/team/agent-placement.d.ts +118 -0
  183. package/dist/extensions/tools/team/agent-reports.d.ts +53 -0
  184. package/dist/extensions/tools/team/agent-rounds.d.ts +666 -0
  185. package/dist/extensions/tools/team/agent-sandbox-executors.d.ts +79 -0
  186. package/dist/extensions/tools/team/agent-slot-gate.d.ts +186 -0
  187. package/dist/extensions/tools/team/agent-status.d.ts +84 -0
  188. package/dist/extensions/tools/team/agent-trouble.d.ts +91 -0
  189. package/dist/extensions/tools/team/background-delegations.d.ts +106 -0
  190. package/dist/extensions/tools/team/batch-report.d.ts +151 -0
  191. package/dist/extensions/tools/team/configured-agent-config.d.ts +37 -0
  192. package/dist/extensions/tools/team/configured-agent-tool.d.ts +135 -0
  193. package/dist/extensions/tools/team/create-agent-tool.d.ts +45 -0
  194. package/dist/extensions/tools/team/delegate-to-agent.d.ts +105 -0
  195. package/dist/extensions/tools/team/delegated-agent.d.ts +272 -0
  196. package/dist/extensions/tools/team/delegated-sandboxes.d.ts +125 -0
  197. package/dist/extensions/tools/team/delegated-tools.d.ts +40 -0
  198. package/dist/extensions/tools/team/delegation-call-hooks.d.ts +30 -0
  199. package/dist/extensions/tools/team/engine-evictions.d.ts +38 -0
  200. package/dist/extensions/tools/team/index.d.ts +20 -0
  201. package/dist/extensions/tools/team/lead-agent-tools.d.ts +92 -0
  202. package/dist/extensions/tools/team/multi-agent.d.ts +364 -0
  203. package/dist/extensions/tools/team/node-reachability.d.ts +53 -0
  204. package/dist/extensions/tools/team/node-throughput.d.ts +40 -0
  205. package/dist/extensions/tools/team/placed-run.d.ts +114 -0
  206. package/dist/extensions/tools/team/projections.d.ts +8 -0
  207. package/dist/extensions/tools/team/runtime.d.ts +6 -0
  208. package/dist/extensions/tools/team/session-window-retry.d.ts +28 -0
  209. package/dist/extensions/tools/team/spawn-agent-tool.d.ts +450 -0
  210. package/dist/extensions/tools/team/spawn-sampling.d.ts +188 -0
  211. package/dist/extensions/tools/team/spawn-swarm-tool.d.ts +330 -0
  212. package/dist/extensions/tools/team/subagent-cancellation.d.ts +188 -0
  213. package/dist/extensions/tools/team/subagent-layout.d.ts +90 -0
  214. package/dist/extensions/tools/team/subagent-output.d.ts +73 -0
  215. package/dist/extensions/tools/team/subagent-progress.d.ts +211 -0
  216. package/dist/extensions/tools/team/subagent-prompts.d.ts +3 -0
  217. package/dist/extensions/tools/team/team-state-dates.d.ts +10 -0
  218. package/dist/extensions/tools/team/team-tools.d.ts +56 -0
  219. package/dist/extensions/tools/team/teammates-off.d.ts +14 -0
  220. package/dist/extensions/tools/team/token-split.d.ts +28 -0
  221. package/dist/extensions/tools/team/turn-fault-recovery.d.ts +71 -0
  222. package/dist/extensions/tools/types.d.ts +410 -0
  223. package/dist/extensions/tools/video-generation.d.ts +94 -0
  224. package/dist/hooks/checkpoint-hooks.d.ts +39 -0
  225. package/dist/hooks/hook-extension.d.ts +2 -0
  226. package/dist/hooks/hook-file-config.d.ts +24 -0
  227. package/dist/hooks/hook-file-hooks.d.ts +22 -0
  228. package/dist/hooks/index.d.ts +5 -0
  229. package/dist/hooks/subprocess-runner.d.ts +21 -0
  230. package/dist/hooks/subprocess.d.ts +74 -0
  231. package/dist/hub/client/connect.d.ts +14 -0
  232. package/dist/hub/client/index.d.ts +146 -0
  233. package/dist/hub/client/managed-hub-build-watcher.d.ts +62 -0
  234. package/dist/hub/client/session-client.d.ts +138 -0
  235. package/dist/hub/client/ui-client.d.ts +52 -0
  236. package/dist/hub/daemon/entry.d.ts +15 -0
  237. package/dist/hub/daemon/entry.js +2033 -0
  238. package/dist/hub/daemon/index.d.ts +125 -0
  239. package/dist/hub/daemon/runtime-handlers.d.ts +12 -0
  240. package/dist/hub/daemon/shutdown-coordinator.d.ts +31 -0
  241. package/dist/hub/daemon/start-shared-server.d.ts +18 -0
  242. package/dist/hub/daemon/telemetry.d.ts +19 -0
  243. package/dist/hub/discovery/defaults.d.ts +16 -0
  244. package/dist/hub/discovery/index.d.ts +139 -0
  245. package/dist/hub/discovery/instance-lock.d.ts +51 -0
  246. package/dist/hub/discovery/workspace.d.ts +13 -0
  247. package/dist/hub/index.d.ts +38 -0
  248. package/dist/hub/index.js +2023 -0
  249. package/dist/hub/runtime-host/hub-runtime-host.d.ts +83 -0
  250. package/dist/hub/runtime-host/remote-runtime-host.d.ts +9 -0
  251. package/dist/hub/server/browser-websocket.d.ts +22 -0
  252. package/dist/hub/server/command-transport.d.ts +29 -0
  253. package/dist/hub/server/handlers/approval-handlers.d.ts +24 -0
  254. package/dist/hub/server/handlers/capability-handlers.d.ts +12 -0
  255. package/dist/hub/server/handlers/client-handlers.d.ts +6 -0
  256. package/dist/hub/server/handlers/connector-handlers.d.ts +20 -0
  257. package/dist/hub/server/handlers/context.d.ts +98 -0
  258. package/dist/hub/server/handlers/run-handlers.d.ts +6 -0
  259. package/dist/hub/server/handlers/run-queue-handlers.d.ts +33 -0
  260. package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
  261. package/dist/hub/server/handlers/session-handlers.d.ts +30 -0
  262. package/dist/hub/server/hub-client-contributions.d.ts +19 -0
  263. package/dist/hub/server/hub-event-log.d.ts +57 -0
  264. package/dist/hub/server/hub-notifications.d.ts +7 -0
  265. package/dist/hub/server/hub-run-queue.d.ts +82 -0
  266. package/dist/hub/server/hub-schedule-events.d.ts +2 -0
  267. package/dist/hub/server/hub-server-logging.d.ts +2 -0
  268. package/dist/hub/server/hub-server-options.d.ts +94 -0
  269. package/dist/hub/server/hub-server-transport.d.ts +71 -0
  270. package/dist/hub/server/hub-session-records.d.ts +9 -0
  271. package/dist/hub/server/hub-websocket-server.d.ts +12 -0
  272. package/dist/hub/server/index.d.ts +4 -0
  273. package/dist/hub/server/native-transport.d.ts +25 -0
  274. package/dist/hub/server/task-command-service.d.ts +11 -0
  275. package/dist/index.d.ts +172 -0
  276. package/dist/index.js +5435 -0
  277. package/dist/logging/early-logger.d.ts +37 -0
  278. package/dist/remote-config/integration.d.ts +17 -0
  279. package/dist/runtime/atomic/base-revision-reads.d.ts +106 -0
  280. package/dist/runtime/atomic/base-revision.d.ts +77 -0
  281. package/dist/runtime/atomic/check-first-edits.d.ts +79 -0
  282. package/dist/runtime/atomic/file-revisions.d.ts +268 -0
  283. package/dist/runtime/atomic/oracle.d.ts +178 -0
  284. package/dist/runtime/atomic/page-check.d.ts +39 -0
  285. package/dist/runtime/atomic/plan-capture.d.ts +40 -0
  286. package/dist/runtime/atomic/plan-text.d.ts +33 -0
  287. package/dist/runtime/atomic/plan-tool.d.ts +159 -0
  288. package/dist/runtime/atomic/proposal.d.ts +112 -0
  289. package/dist/runtime/atomic/propose-check-tool.d.ts +76 -0
  290. package/dist/runtime/atomic/protocol.d.ts +233 -0
  291. package/dist/runtime/atomic/restore-file-tool.d.ts +196 -0
  292. package/dist/runtime/atomic/revision-capture.d.ts +75 -0
  293. package/dist/runtime/atomic/run-check-tool.d.ts +64 -0
  294. package/dist/runtime/atomic/session-protocol.d.ts +304 -0
  295. package/dist/runtime/atomic/session-revisions.d.ts +77 -0
  296. package/dist/runtime/atomic/snapshot.d.ts +77 -0
  297. package/dist/runtime/atomic/stalled-checks.d.ts +106 -0
  298. package/dist/runtime/atomic/submit-transaction-tool.d.ts +50 -0
  299. package/dist/runtime/atomic/tool-activity.d.ts +15 -0
  300. package/dist/runtime/atomic/transaction-controller.d.ts +364 -0
  301. package/dist/runtime/atomic/unparseable-change.d.ts +35 -0
  302. package/dist/runtime/capabilities/index.d.ts +2 -0
  303. package/dist/runtime/capabilities/normalize-runtime-capabilities.d.ts +2 -0
  304. package/dist/runtime/capabilities/runtime-capabilities.d.ts +18 -0
  305. package/dist/runtime/config/agent-message-codec.d.ts +6 -0
  306. package/dist/runtime/config/agent-runtime-config-builder.d.ts +93 -0
  307. package/dist/runtime/config/connection-update.d.ts +40 -0
  308. package/dist/runtime/escalation/a2a.d.ts +109 -0
  309. package/dist/runtime/escalation/assessment.d.ts +54 -0
  310. package/dist/runtime/escalation/brief.d.ts +70 -0
  311. package/dist/runtime/escalation/escalate-tool.d.ts +93 -0
  312. package/dist/runtime/escalation/escalation-controller.d.ts +62 -0
  313. package/dist/runtime/escalation/escalation-session.d.ts +241 -0
  314. package/dist/runtime/escalation/expert-failure.d.ts +20 -0
  315. package/dist/runtime/escalation/expert-guards.d.ts +46 -0
  316. package/dist/runtime/escalation/expert-mailbox.d.ts +34 -0
  317. package/dist/runtime/escalation/expert-notes.d.ts +115 -0
  318. package/dist/runtime/escalation/expert-prompt.d.ts +29 -0
  319. package/dist/runtime/escalation/expert-revisions.d.ts +62 -0
  320. package/dist/runtime/escalation/expert-session.d.ts +164 -0
  321. package/dist/runtime/escalation/expert-transcript.d.ts +32 -0
  322. package/dist/runtime/escalation/forced-escalation.d.ts +58 -0
  323. package/dist/runtime/escalation/stand-down.d.ts +66 -0
  324. package/dist/runtime/escalation/struggle-offer.d.ts +100 -0
  325. package/dist/runtime/escalation/watch-tool.d.ts +34 -0
  326. package/dist/runtime/host/history.d.ts +19 -0
  327. package/dist/runtime/host/host.d.ts +7 -0
  328. package/dist/runtime/host/local/agent-event-bridge.d.ts +50 -0
  329. package/dist/runtime/host/local/session-record.d.ts +6 -0
  330. package/dist/runtime/host/local/session-service-invoker.d.ts +4 -0
  331. package/dist/runtime/host/local/spawn-tool.d.ts +57 -0
  332. package/dist/runtime/host/local/user-files.d.ts +1 -0
  333. package/dist/runtime/host/local-runtime-host.d.ts +298 -0
  334. package/dist/runtime/host/runtime-host-support.d.ts +39 -0
  335. package/dist/runtime/host/runtime-host.d.ts +280 -0
  336. package/dist/runtime/host/steer-side-turn.d.ts +119 -0
  337. package/dist/runtime/orchestration/runtime-builder.d.ts +14 -0
  338. package/dist/runtime/orchestration/runtime-event-adapter.d.ts +104 -0
  339. package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +28 -0
  340. package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +339 -0
  341. package/dist/runtime/orchestration/session-runtime.d.ts +118 -0
  342. package/dist/runtime/orchestration/user-input-builder.d.ts +15 -0
  343. package/dist/runtime/process-start-token.d.ts +23 -0
  344. package/dist/runtime/safety/loop-detection.d.ts +160 -0
  345. package/dist/runtime/safety/mistake-tracker.d.ts +84 -0
  346. package/dist/runtime/safety/rules.d.ts +6 -0
  347. package/dist/runtime/safety/struggle-detector.d.ts +414 -0
  348. package/dist/runtime/safety/worker-struggle-stop.d.ts +20 -0
  349. package/dist/runtime/safety/worker-struggle.d.ts +166 -0
  350. package/dist/runtime/sandbox/agent-sandbox.d.ts +111 -0
  351. package/dist/runtime/sandbox/overlay-fs.d.ts +71 -0
  352. package/dist/runtime/sandbox/sandbox-binaries.d.ts +10 -0
  353. package/dist/runtime/tools/subprocess-sandbox-lifecycle.d.ts +9 -0
  354. package/dist/runtime/tools/subprocess-sandbox.d.ts +62 -0
  355. package/dist/runtime/tools/tool-approval.d.ts +9 -0
  356. package/dist/runtime/turn-queue/harness-notes.d.ts +18 -0
  357. package/dist/runtime/turn-queue/pending-prompt-service.d.ts +117 -0
  358. package/dist/services/agent-events.d.ts +59 -0
  359. package/dist/services/config.d.ts +2 -0
  360. package/dist/services/connectors/active-connectors.d.ts +2 -0
  361. package/dist/services/connectors/connector-autostart.d.ts +33 -0
  362. package/dist/services/connectors/connector-child-env.d.ts +14 -0
  363. package/dist/services/connectors/connector-cleanup.d.ts +20 -0
  364. package/dist/services/connectors/connector-supervisor.d.ts +134 -0
  365. package/dist/services/connectors/daemon-connector-reconnect.d.ts +15 -0
  366. package/dist/services/feature-flags/FeatureFlagsService.d.ts +49 -0
  367. package/dist/services/feature-flags/index.d.ts +2 -0
  368. package/dist/services/feature-flags/posthog.d.ts +24 -0
  369. package/dist/services/feature-flags/posthog.js +1 -0
  370. package/dist/services/feature-flags/providers.d.ts +7 -0
  371. package/dist/services/global-settings.d.ts +113 -0
  372. package/dist/services/llms/apihandler-agent-model-adapter.d.ts +26 -0
  373. package/dist/services/llms/cline-recommended-models.d.ts +62 -0
  374. package/dist/services/llms/configured-provider-registry.d.ts +27 -0
  375. package/dist/services/llms/handler-factory.d.ts +23 -0
  376. package/dist/services/llms/provider-defaults.d.ts +36 -0
  377. package/dist/services/llms/provider-settings.d.ts +420 -0
  378. package/dist/services/llms/runtime-config.d.ts +3 -0
  379. package/dist/services/llms/runtime-registry.d.ts +19 -0
  380. package/dist/services/llms/runtime-types.d.ts +84 -0
  381. package/dist/services/llms/session-budget.d.ts +88 -0
  382. package/dist/services/local-runtime-bootstrap.d.ts +62 -0
  383. package/dist/services/marketplace.d.ts +41 -0
  384. package/dist/services/mcp-install.d.ts +35 -0
  385. package/dist/services/plugin-install.d.ts +52 -0
  386. package/dist/services/plugin-mcp-settings.d.ts +31 -0
  387. package/dist/services/plugin-tools.d.ts +40 -0
  388. package/dist/services/plugin-uninstall.d.ts +13 -0
  389. package/dist/services/providers/local-provider-registry.d.ts +354 -0
  390. package/dist/services/providers/local-provider-service.d.ts +101 -0
  391. package/dist/services/providers/model-source.d.ts +3 -0
  392. package/dist/services/providers/provider-config-fields.d.ts +37 -0
  393. package/dist/services/providers/provider-readiness.d.ts +10 -0
  394. package/dist/services/session-artifacts.d.ts +18 -0
  395. package/dist/services/session-data.d.ts +61 -0
  396. package/dist/services/session-import/claude-code.d.ts +16 -0
  397. package/dist/services/session-import/codex.d.ts +34 -0
  398. package/dist/services/session-import/index.d.ts +6 -0
  399. package/dist/services/session-import/opencode.d.ts +25 -0
  400. package/dist/services/session-import/sanitize.d.ts +16 -0
  401. package/dist/services/session-import/service.d.ts +31 -0
  402. package/dist/services/session-import/types.d.ts +87 -0
  403. package/dist/services/session-telemetry.d.ts +15 -0
  404. package/dist/services/storage/file-team-store.d.ts +32 -0
  405. package/dist/services/storage/provider-settings-legacy-migration.d.ts +38 -0
  406. package/dist/services/storage/provider-settings-manager.d.ts +31 -0
  407. package/dist/services/storage/sqlite-session-store.d.ts +35 -0
  408. package/dist/services/storage/sqlite-team-store.d.ts +42 -0
  409. package/dist/services/storage/team-events-retention.d.ts +25 -0
  410. package/dist/services/storage/team-store.d.ts +16 -0
  411. package/dist/services/telemetry/ITelemetryAdapter.d.ts +54 -0
  412. package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +43 -0
  413. package/dist/services/telemetry/OpenTelemetryProvider.d.ts +99 -0
  414. package/dist/services/telemetry/TelemetryLoggerSink.d.ts +27 -0
  415. package/dist/services/telemetry/TelemetryService.d.ts +40 -0
  416. package/dist/services/telemetry/core-events.d.ts +396 -0
  417. package/dist/services/telemetry/distinct-id.d.ts +2 -0
  418. package/dist/services/telemetry/index.d.ts +4 -0
  419. package/dist/services/telemetry/index.js +1 -0
  420. package/dist/services/usage.d.ts +19 -0
  421. package/dist/services/workspace/agent-schedules-workspace.d.ts +8 -0
  422. package/dist/services/workspace/chat-workspace.d.ts +9 -0
  423. package/dist/services/workspace/file-indexer.d.ts +5 -0
  424. package/dist/services/workspace/index.d.ts +6 -0
  425. package/dist/services/workspace/mention-enricher.d.ts +13 -0
  426. package/dist/services/workspace/workspace-manager.d.ts +27 -0
  427. package/dist/services/workspace/workspace-manifest.d.ts +42 -0
  428. package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
  429. package/dist/session/checkpoint-diff.d.ts +25 -0
  430. package/dist/session/checkpoint-restore.d.ts +34 -0
  431. package/dist/session/display-messages.d.ts +28 -0
  432. package/dist/session/history-origin.d.ts +19 -0
  433. package/dist/session/models/session-compaction.d.ts +22 -0
  434. package/dist/session/models/session-graph.d.ts +15 -0
  435. package/dist/session/models/session-manifest.d.ts +32 -0
  436. package/dist/session/models/session-row.d.ts +107 -0
  437. package/dist/session/persisted-tool-result-content.d.ts +8 -0
  438. package/dist/session/search/index.d.ts +1 -0
  439. package/dist/session/search/session-history-search.d.ts +51 -0
  440. package/dist/session/services/file-session-service.d.ts +10 -0
  441. package/dist/session/services/message-builder.d.ts +208 -0
  442. package/dist/session/services/persistence-service.d.ts +92 -0
  443. package/dist/session/services/read-overlap.d.ts +40 -0
  444. package/dist/session/services/session-service.d.ts +15 -0
  445. package/dist/session/session-snapshot.d.ts +59 -0
  446. package/dist/session/session-versioning-service.d.ts +50 -0
  447. package/dist/session/stores/atomic-file.d.ts +1 -0
  448. package/dist/session/stores/conversation-store.d.ts +29 -0
  449. package/dist/session/stores/session-manifest-store.d.ts +49 -0
  450. package/dist/session/stores/team-persistence-store.d.ts +23 -0
  451. package/dist/session/team/index.d.ts +2 -0
  452. package/dist/session/team/team-child-session-manager.d.ts +35 -0
  453. package/dist/session/team/team-session-coordinator.d.ts +13 -0
  454. package/dist/session/user-run-messages.d.ts +20 -0
  455. package/dist/settings/index.d.ts +2 -0
  456. package/dist/settings/settings-service.d.ts +8 -0
  457. package/dist/settings/types.d.ts +83 -0
  458. package/dist/tasks/agenda-task-api.d.ts +20 -0
  459. package/dist/tasks/agenda-task-manager.d.ts +109 -0
  460. package/dist/tasks/agenda-task-tool.d.ts +94 -0
  461. package/dist/tasks/index.d.ts +9 -0
  462. package/dist/tasks/specs/task-spec-file-store.d.ts +38 -0
  463. package/dist/tasks/specs/task-spec-parser.d.ts +65 -0
  464. package/dist/tasks/store/sqlite-task-store.d.ts +73 -0
  465. package/dist/tasks/store/task-schema.d.ts +2 -0
  466. package/dist/tasks/task-location.d.ts +14 -0
  467. package/dist/tasks/task-tool.d.ts +143 -0
  468. package/dist/types/chat-schema.d.ts +194 -0
  469. package/dist/types/common.d.ts +35 -0
  470. package/dist/types/config.d.ts +994 -0
  471. package/dist/types/events.d.ts +102 -0
  472. package/dist/types/provider-settings.d.ts +29 -0
  473. package/dist/types/session.d.ts +187 -0
  474. package/dist/types/sessions.d.ts +42 -0
  475. package/dist/types/storage.d.ts +36 -0
  476. package/dist/types.d.ts +34 -0
  477. package/dist/version.d.ts +1 -0
  478. package/package.json +98 -0
  479. package/scripts/document-reader-assets.mjs +161 -0
@@ -0,0 +1,364 @@
1
+ import { type RevisionLog } from "./file-revisions";
2
+ import { type Oracle, type OracleVerdict } from "./oracle";
3
+ import { type TransactionOutcome, type TransactionVerdictSource } from "./protocol";
4
+ import { type RestoreReport, type Snapshot, type SnapshotLimits } from "./snapshot";
5
+ /** What the model said about its own change, where nothing else could say it. */
6
+ export type SelfReport = "success" | "failure" | "unsure";
7
+ export interface TransactionReport {
8
+ /** The plan as the model declared it, carried forward if this one fails. */
9
+ plan?: string;
10
+ /** What the model said when it tried to end the turn. */
11
+ account?: string;
12
+ /**
13
+ * The model's own verdict, where there is no oracle. `undefined` means it
14
+ * never gave one — which is not the same as saying it could not tell.
15
+ */
16
+ selfReport?: SelfReport;
17
+ /**
18
+ * The run is ending because the no-tool-call nudges ran out, not because the
19
+ * model chose to stop. It changes what silence means: a model cut off
20
+ * mid-work has not declined to report, it never got to.
21
+ */
22
+ forced?: boolean;
23
+ }
24
+ export type TransactionSettlement = {
25
+ kept: true;
26
+ message: string;
27
+ verdict?: OracleVerdict;
28
+ } | {
29
+ kept: false;
30
+ message: string;
31
+ verdict?: OracleVerdict;
32
+ restore: RestoreReport;
33
+ /**
34
+ * Whether the work stayed on disk instead of being rolled back.
35
+ *
36
+ * See `carriedOn` on the controller. `restore` is empty when this is
37
+ * set -- nothing was put back, so there is nothing to report.
38
+ */
39
+ carried?: boolean;
40
+ /** The next transaction's rules and record, or nothing when out of them. */
41
+ nextPrompt?: string;
42
+ };
43
+ export type TransactionEvent = {
44
+ type: "opened";
45
+ transaction: number;
46
+ oracle?: Oracle;
47
+ }
48
+ /** A check was proposed, approved and taken on for the rest of the run. */
49
+ | {
50
+ type: "adopted";
51
+ transaction: number;
52
+ oracle: Oracle;
53
+ } | {
54
+ type: "judging";
55
+ transaction: number;
56
+ oracle?: Oracle;
57
+ }
58
+ /**
59
+ * A transaction the model tried to end without changing anything.
60
+ *
61
+ * Not a settlement: nothing was judged and nothing was put back, so it
62
+ * carries no verdict. `continued` says which of the two things happened —
63
+ * the transaction was handed back to the model, or the run was let go.
64
+ */
65
+ | {
66
+ type: "empty";
67
+ transaction: number;
68
+ message: string;
69
+ continued: boolean;
70
+ }
71
+ /**
72
+ * The plan for this transaction, the first time one is seen.
73
+ *
74
+ * `from` says where it was found. A plan stated in the reply is already in
75
+ * front of the user; one found in the reasoning is not, and is the reason
76
+ * this event exists — the protocol asks for the plan in the reply and a 9B
77
+ * put it in its reasoning four times out of four, so nothing downstream
78
+ * ever saw it.
79
+ */
80
+ | {
81
+ type: "plan";
82
+ transaction: number;
83
+ plan: string;
84
+ from: "reply" | "reasoning";
85
+ } | {
86
+ type: "settled";
87
+ transaction: number;
88
+ kept: boolean;
89
+ /** Not kept, and not rolled back either: the check's answer moved. */
90
+ carried?: boolean;
91
+ /**
92
+ * Who judged it. A consumer counting successes has to be able to
93
+ * separate "the check passed" from "nothing checked and nobody
94
+ * said" -- both arrive here as `kept: true`.
95
+ */
96
+ source: TransactionVerdictSource;
97
+ message: string;
98
+ /**
99
+ * Wall-clock from `open()` to this settlement.
100
+ *
101
+ * The settlement line said what happened to the transaction and
102
+ * never how long it took, so a run that looped for forty minutes
103
+ * and one that landed first try read identically in the transcript
104
+ * -- and the completion message above it carries no time either, so
105
+ * there was nowhere else to look.
106
+ */
107
+ elapsedMs?: number;
108
+ verdict?: OracleVerdict;
109
+ restore?: RestoreReport;
110
+ };
111
+ export interface TransactionControllerOptions {
112
+ workspaceRoot: string;
113
+ /** Hard limit on changes declared per transaction. */
114
+ maxChanges: number;
115
+ /** Transactions this task gets before it stops. */
116
+ maxTransactions: number;
117
+ /** The check that decides, or nothing when the workspace has none. */
118
+ oracle?: Oracle;
119
+ /**
120
+ * Whether the model may name its own check while there is none.
121
+ *
122
+ * Set by the host that has somewhere to ask the user. It stops mattering
123
+ * the moment a check exists, since one is frozen once taken on.
124
+ */
125
+ allowCheckProposal?: boolean;
126
+ /**
127
+ * Discarded attempts before a check that has never passed may be replaced.
128
+ *
129
+ * Zero, or absent, is the freeze as it was. See `checkIsUnderReconsideration`
130
+ * for the condition and why it is scoped the way it is.
131
+ */
132
+ checkReconsideredAfter?: number;
133
+ oracleTimeoutMs?: number;
134
+ snapshotLimits?: SnapshotLimits;
135
+ /**
136
+ * The session's file-history log, when the host keeps one.
137
+ *
138
+ * Given rather than made, so the transaction and the session share a single
139
+ * history: the numbering the model has been told about stays continuous
140
+ * across engaging and disengaging the protocol, and the compaction ledger
141
+ * keeps answering from the same store. Absent, this makes its own, which is
142
+ * what every caller did before the log became session-scoped.
143
+ */
144
+ revisions?: RevisionLog;
145
+ /**
146
+ * Something for the last transaction's opening prompt, asked for once.
147
+ *
148
+ * The host's, and opaque here: this is where the escalation offer is said,
149
+ * and the protocol does not know what an expert is.
150
+ */
151
+ describeLastTransaction?: () => string | undefined;
152
+ onEvent?: (event: TransactionEvent) => void;
153
+ }
154
+ /**
155
+ * The protocol as a state machine the host drives: snapshot, change, judge,
156
+ * keep or put back — bounded.
157
+ *
158
+ * Written this way round because the boundary belongs to the host. The model
159
+ * gets no tool to close a transaction with: one it forgot to call would leave
160
+ * every change in that transaction unjudged, so a forgotten call would become
161
+ * silently discarded work. A boundary the host owns cannot be forgotten — the
162
+ * agent runtime asks this object at the moment the model tries to end its
163
+ * turn, and the answer either lets it end or puts the files back and hands it
164
+ * the next transaction.
165
+ *
166
+ * The rollback is the part that has to be right. Cline's checkpoints cannot
167
+ * serve it — they require a git work tree and throw without one — so this uses
168
+ * the copy-and-checksum snapshot next door instead.
169
+ */
170
+ export declare class TransactionController {
171
+ private readonly options;
172
+ private readonly history;
173
+ private readonly uncoveredPaths;
174
+ /**
175
+ * Every version of every file a tool has written in the open transaction.
176
+ *
177
+ * Lives here because its lifetime is the base snapshot's: #1 of each file is
178
+ * what the base holds, so a log that outlived its base would offer the model
179
+ * a revision the rollback cannot honour.
180
+ */
181
+ private readonly revisionLog;
182
+ /** What a rollback goes back to. Outlives a transaction that was carried. */
183
+ private snapshot?;
184
+ /**
185
+ * The tree as the open transaction found it.
186
+ *
187
+ * The same object as `snapshot` in the ordinary case, and older than it
188
+ * after a carry -- "has this transaction changed anything" and "what does a
189
+ * rollback undo" stop being the same question once work outlives the
190
+ * transaction that made it.
191
+ */
192
+ private openedWith?;
193
+ private current;
194
+ /** When the open transaction started, for the settlement line. */
195
+ private openedAt;
196
+ private adopted?;
197
+ /** Whether the adopted check has ever passed, on any files, since adoption. */
198
+ private adoptedEverPassed;
199
+ /** Attempts that changed something and were thrown away, since adoption. */
200
+ private discardedSinceAdoption;
201
+ /** Open while the model may replace a check that has never passed. Once. */
202
+ private reconsidering;
203
+ /**
204
+ * Every distinct thing this run's check has said, and whether it has ever
205
+ * said the same thing twice.
206
+ *
207
+ * The repeat is what makes the novelty mean anything. A check that prints a
208
+ * duration, a timestamp or a seed says something new every single time it
209
+ * runs, and treating that as evidence the edits are landing would tell a
210
+ * model its work was progressing while nothing moved -- the same trap
211
+ * `describeStuckHostCheck` documents from the other direction. A check that
212
+ * has repeated itself once is demonstrably deterministic on the path it
213
+ * takes, and only then is "it has never said this before" a fact about the
214
+ * files rather than about the clock.
215
+ */
216
+ private readonly checkOutputs;
217
+ private checkHasRepeated;
218
+ /** Set by a carried settlement, so the next `open` keeps the older base. */
219
+ private carrying;
220
+ private reconsiderationsUsed;
221
+ constructor(options: TransactionControllerOptions);
222
+ /** One-based number of the open transaction, or 0 before the first opens. */
223
+ get transaction(): number;
224
+ /** The check that judges this run, however it came by one. */
225
+ get oracle(): Oracle | undefined;
226
+ /**
227
+ * Whether a check can still be taken on — which is only ever while there is
228
+ * none. See `adoptOracle`.
229
+ */
230
+ get canAdoptOracle(): boolean;
231
+ /**
232
+ * Whether the check the model named is currently up for replacement.
233
+ *
234
+ * Scoped to a check the model proposed and nothing else: `adopted` is set
235
+ * only by `adoptOracle`, and `options.oracle` being absent is what says
236
+ * discovery found nothing to run. A check the user wrote, or one detected
237
+ * in the tree, is the specification and is never reconsidered — it is not
238
+ * the model's to disagree with.
239
+ *
240
+ * The condition is "it has never passed once, across attempts that really
241
+ * changed something". That is the only observable separating a check that
242
+ * cannot pass from a task that is hard, and measured over ten runs the two
243
+ * that died looked like this from the first transaction onward.
244
+ */
245
+ get checkIsUnderReconsideration(): boolean;
246
+ /**
247
+ * Take a check for the rest of the run, once.
248
+ *
249
+ * For a check the model proposed and the user approved, in a workspace
250
+ * where discovery found nothing. It can only ever be set while there is no
251
+ * check at all, and that is the freeze: a model allowed to re-propose after
252
+ * a transaction fails will weaken the check until one passes, which is an
253
+ * elaborate way of arriving back at `self-declared`. Replacing it costs a
254
+ * new session, not a tool call.
255
+ */
256
+ adoptOracle(oracle: Oracle): void;
257
+ /**
258
+ * Run a candidate check against the files as this transaction found them.
259
+ *
260
+ * The question a proposed check has to answer before it is trusted: does it
261
+ * fail on the unmodified files? A check that already passes there is not a
262
+ * check of anything — `echo ok`, `node --version`, a test that never
263
+ * touches the bug — and approving one produces `self-declared` with a
264
+ * ceremony around it. Failing first and passing after is the definition of
265
+ * a regression test, and it is the property this enforces.
266
+ *
267
+ * Where nothing has been edited yet, the working tree *is* the base and it
268
+ * is simply run. Where something has, the base is put back for the length
269
+ * of the run and the edits are put back after it — the same restore the
270
+ * protocol performs on a discarded transaction, in both directions, with
271
+ * the return leg in a `finally` so a check that throws cannot cost the
272
+ * model its work.
273
+ */
274
+ judgeAgainstBase(oracle: Oracle): Promise<OracleVerdict>;
275
+ /**
276
+ * Record what the check just said, and answer whether it is new.
277
+ *
278
+ * One funnel for every run of the oracle in this controller, so the record
279
+ * covers the checks the model asked for as well as the ones that judged a
280
+ * transaction.
281
+ */
282
+ private noteCheckOutput;
283
+ /**
284
+ * Run the check against the working tree, and settle nothing.
285
+ *
286
+ * The check the transaction is judged by was reachable from exactly one
287
+ * place -- `settle`, at the completion attempt -- so a model working under
288
+ * it got no verdict until the transaction was over, and a failing one threw
289
+ * the whole transaction away. Measured on a live run: 341 messages and 65
290
+ * edits with no check result, then one `SyntaxError` and a full rollback,
291
+ * after which the model restored the original file and started again.
292
+ *
293
+ * The arm that works never had this problem, because there the check is a
294
+ * shell line named in the prompt and the model simply reruns it -- 88 times
295
+ * in one successful run. This is that, for a check the model cannot type.
296
+ */
297
+ runCheck(): Promise<OracleVerdict>;
298
+ /** Every transaction so far, in order, kept or not. */
299
+ get outcomes(): readonly TransactionOutcome[];
300
+ /** Files no snapshot could hold, so nobody assumes they were protected. */
301
+ get uncovered(): string[];
302
+ /**
303
+ * The base the open transaction would roll back to, or nothing when none is
304
+ * open. What a host hands the user when a run is cut short mid-transaction.
305
+ */
306
+ get pending(): Snapshot | undefined;
307
+ /** The open transaction's per-file history. Empty before the first write. */
308
+ get revisions(): RevisionLog;
309
+ /** Whether the open transaction has changed anything on disk. */
310
+ isUntouched(): Promise<boolean>;
311
+ /**
312
+ * Take the base this transaction rolls back to, and return the rules to put
313
+ * to the model.
314
+ *
315
+ * Taken at the open of every transaction rather than once per task: a kept
316
+ * transaction becomes the base the next one rolls back to, which is what
317
+ * makes a sequence of them additive rather than a single undo point.
318
+ */
319
+ /**
320
+ * Whether this transaction should offer the model its check back.
321
+ *
322
+ * Every clause earns its place. The check must be the model's own; it must
323
+ * never have passed; enough attempts must have really been thrown away to
324
+ * rule out an unlucky one; it can happen once; and there has to be a
325
+ * transaction left after this one, or a replacement judges nothing.
326
+ *
327
+ * The threshold is bounded by `maxTransactions` because that is a setting:
328
+ * a fixed two would fire on the last attempt of a three-attempt task and be
329
+ * useless there.
330
+ */
331
+ private shouldReconsiderCheck;
332
+ open(): Promise<string>;
333
+ /**
334
+ * Judge the open transaction, and keep it or put every file back.
335
+ *
336
+ * Called at the boundary — the model calling a completion tool, or ending a
337
+ * turn with nothing left to call. Both are the same event to this: the model
338
+ * believes it is done, which is exactly when its belief is worth checking.
339
+ */
340
+ settle(report?: TransactionReport): Promise<TransactionSettlement>;
341
+ /**
342
+ * Put back what the open transaction changed, without judging it.
343
+ *
344
+ * For a run the user cut short. Offered rather than done: rolling back on a
345
+ * cancel would destroy work the user interrupted for their own reasons, so
346
+ * the host decides and this carries it out.
347
+ */
348
+ discard(): Promise<RestoreReport | undefined>;
349
+ private emit;
350
+ }
351
+ /**
352
+ * Whether a model's own account of its change is enough to keep it.
353
+ *
354
+ * The three answers are not symmetric. "It worked" keeps; "it did not" and "I
355
+ * cannot tell" both discard, because a model reporting its own doubt is real
356
+ * evidence about the change.
357
+ *
358
+ * Saying nothing at all is a fourth thing and is treated as none of them. It is
359
+ * a reporting failure, not a statement about the change, and discarding real
360
+ * work over a line the model forgot to write is precisely the failure a
361
+ * host-owned boundary exists to avoid. So silence keeps the change and labels
362
+ * it unverified, where the user can see the diff and decide.
363
+ */
364
+ export declare function judgeSelfReport(report: SelfReport | undefined): boolean;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Why a failed check sometimes says nothing about the change that failed it.
3
+ *
4
+ * Measured on the 39-minute run analysed today: the check ran eighteen times,
5
+ * eleven of them byte-identical, over a file that at several points did not
6
+ * parse at all. A check run against a file the engine refuses measures the
7
+ * refusal, not the fix -- but the verdict it produced read like any other
8
+ * failure, so the model reconsidered a plan that had never been tried.
9
+ *
10
+ * This names that case, at the one moment it is cheap to name: the transaction
11
+ * has failed and the files it changed are still on disk, one call before the
12
+ * rollback puts them back.
13
+ *
14
+ * Deliberately past-tense, and deliberately without the scan's prescribed
15
+ * `editor` call. By the time the model reads this the rollback has happened
16
+ * and the column the scan named is a column of a file that no longer exists;
17
+ * handing a 9B a precise instruction against a stale file is how a report
18
+ * meant to save a transaction spends the next one.
19
+ */
20
+ /** Whether the check's output names a parse failure. */
21
+ export declare function looksLikeSyntaxError(output: string): boolean;
22
+ /** A file as it stood when the transaction failed. */
23
+ export interface ChangedFile {
24
+ /** Absolute path. */
25
+ readonly path: string;
26
+ readonly text: string;
27
+ }
28
+ /**
29
+ * Say that the check measured a file that does not parse, or nothing.
30
+ *
31
+ * Nothing is the common case and the right default: a check fails for real
32
+ * reasons far more often than for a bracket, and a verdict that guessed would
33
+ * be worse than one that stayed quiet.
34
+ */
35
+ export declare function describeUnparseableChange(changed: readonly ChangedFile[], root: string): string | null;
@@ -0,0 +1,2 @@
1
+ export { normalizeRuntimeCapabilities } from "./normalize-runtime-capabilities";
2
+ export type { RuntimeCapabilities } from "./runtime-capabilities";
@@ -0,0 +1,2 @@
1
+ import type { RuntimeCapabilities } from "./runtime-capabilities";
2
+ export declare function normalizeRuntimeCapabilities(...sources: Array<RuntimeCapabilities | undefined>): RuntimeCapabilities | undefined;
@@ -0,0 +1,18 @@
1
+ import type { ToolApprovalRequest, ToolApprovalResult } from "@cerebriline/shared";
2
+ import type { ReadReceipts, ToolExecutors } from "../../extensions/tools";
3
+ export interface RuntimeCapabilities {
4
+ toolExecutors?: Partial<ToolExecutors>;
5
+ /**
6
+ * The host's record of what has been read.
7
+ *
8
+ * A host that replaces `readFile` or `editor` replaces the half of the
9
+ * read-before-write guard that WRITES the record, while `grep`, `sed` and
10
+ * `awk` keep the one core built -- which nothing then writes to. The result
11
+ * is a guard that refuses every `sed` in-place run for a file the model has
12
+ * just read, and says the file "has not been read in this session" while
13
+ * `read_files` calls on it sit in the same transcript. Hand the registry
14
+ * over with the executors and all of them share one.
15
+ */
16
+ readReceipts?: ReadReceipts;
17
+ requestToolApproval?: (request: ToolApprovalRequest) => Promise<ToolApprovalResult> | ToolApprovalResult;
18
+ }
@@ -0,0 +1,6 @@
1
+ import type { AgentMessage, Message, MessageWithMetadata } from "@cerebriline/shared";
2
+ export declare function messageToAgentMessages(message: MessageWithMetadata): AgentMessage[];
3
+ export declare function messagesToAgentMessages(messages: readonly MessageWithMetadata[]): AgentMessage[];
4
+ export declare function agentMessageToMessageWithMetadata(message: AgentMessage): MessageWithMetadata;
5
+ export declare function agentMessagesToMessagesWithMetadata(messages: readonly AgentMessage[]): MessageWithMetadata[];
6
+ export declare function agentMessagesToMessages(messages: readonly AgentMessage[]): Message[];
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Build an `AgentRuntimeConfig` from an `AgentConfig` plus session-owned
3
+ * supporting objects (model handler, tools, hooks, plugins, telemetry).
4
+ *
5
+ * The function is intentionally **pure**: it does not create handlers or tools
6
+ * itself; it receives them already resolved from the caller (`SessionRuntime`)
7
+ * and wires them into an `AgentRuntimeConfig`.
8
+ *
9
+ * Fields that do **not** round-trip into `AgentRuntimeConfig`
10
+ * (e.g. `execution.maxConsecutiveMistakes`, `execution.loopDetection`) are
11
+ * consumed by `SessionRuntime` / `MistakeTracker` /
12
+ * `LoopDetectionTracker` — not passed through here.
13
+ * `execution.reasoningLoopDetection` is the exception: it is enforced inside
14
+ * the model stream, so it does round-trip.
15
+ */
16
+ import type { AgentConfig, AgentMessage, AgentModel, AgentRuntimeConfig, AgentRuntimeHooks, AgentRuntimePlugin, AgentRuntimePrepareTurnContext, AgentRuntimePrepareTurnResult, AgentTool, BasicLogger, ITelemetryService } from "@cerebriline/shared";
17
+ /**
18
+ * Inputs required to assemble an `AgentRuntimeConfig`. Distinct from
19
+ * `AgentConfig` because some of these (the model adapter, the hook
20
+ * bridge's runtime-hooks bag, a resolved plugin list) can only be
21
+ * produced inside `SessionRuntime`.
22
+ */
23
+ export interface CreateAgentRuntimeConfigInput {
24
+ readonly agentConfig: AgentConfig;
25
+ /**
26
+ * Core/hub runtime session identifier used for host lifecycle operations,
27
+ * event routing, persistence, and approval delivery.
28
+ */
29
+ readonly sessionId?: string;
30
+ readonly agentId: string;
31
+ /**
32
+ * Agent conversation/transcript identifier used by tools, hooks, telemetry,
33
+ * and model history correlation.
34
+ */
35
+ readonly conversationId?: string;
36
+ readonly parentAgentId?: string;
37
+ /** The role label for teammates (`AgentConfig.role` in sub-agent configs). */
38
+ readonly agentRole?: string;
39
+ /** Pre-built model adapter (produced by `apiHandlerToAgentModel`). */
40
+ readonly model: AgentModel;
41
+ readonly logger?: BasicLogger;
42
+ readonly telemetry?: ITelemetryService;
43
+ /** Pre-built tool array (builtins + plugin-contributed + session extras). */
44
+ readonly tools?: readonly AgentTool<unknown, unknown>[];
45
+ readonly toolContextMetadata?: Record<string, unknown>;
46
+ /** Pre-resolved plugin list from the plugin loader. */
47
+ readonly plugins?: readonly AgentRuntimePlugin[];
48
+ /** Runtime hooks supplied by the session/runtime builder. */
49
+ readonly hooks?: Partial<AgentRuntimeHooks>;
50
+ /** Host-owned context pipeline invoked before runtime model hooks. */
51
+ readonly prepareTurn?: (context: AgentRuntimePrepareTurnContext) => Promise<AgentRuntimePrepareTurnResult | undefined> | AgentRuntimePrepareTurnResult | undefined;
52
+ /** Seed messages (usually `session.conversation.getMessages()`). */
53
+ readonly initialMessages?: readonly AgentMessage[];
54
+ /**
55
+ * Optional completion-policy override. Pass `null` for model modes that
56
+ * cannot call tools (for example image generation).
57
+ */
58
+ readonly completionPolicy?: AgentRuntimeConfig["completionPolicy"] | null;
59
+ /**
60
+ * Override for `AgentRuntimeConfig.systemPrompt` — useful when
61
+ * the caller has composed additional guidance (e.g. via
62
+ * `LocalRuntimeHost.composeSystemPrompt`). Defaults to
63
+ * `agentConfig.systemPrompt`.
64
+ */
65
+ readonly systemPrompt?: string;
66
+ }
67
+ /**
68
+ * Produce an `AgentRuntimeConfig` from session-owned runtime inputs.
69
+ */
70
+ export declare function createAgentRuntimeConfig(input: CreateAgentRuntimeConfigInput): AgentRuntimeConfig;
71
+ /**
72
+ * Collect the provider-/reasoning-related fields from `AgentConfig`
73
+ * into `AgentRuntimeConfig.modelOptions`. Kept undefined when every
74
+ * field is undefined so the runtime does not receive an empty object.
75
+ */
76
+ export declare function buildModelOptions(config: AgentConfig): Record<string, unknown> | undefined;
77
+ /**
78
+ * Compose `messageModelInfo` from the provider-related fields per
79
+ * §3.2.1: `{ id: modelId, provider: providerId, family:
80
+ * providerConfig?.family }`.
81
+ */
82
+ export declare function buildMessageModelInfo(config: AgentConfig): AgentMessage["modelInfo"];
83
+ /**
84
+ * `"parallel"` when `maxParallelToolCalls ≥ 2`, `"sequential"` when
85
+ * `1`, `undefined` when the caller did not specify.
86
+ *
87
+ * `undefined` stays `undefined` on purpose: it means *this host has no
88
+ * opinion*, and the default that answers it lives in one place, the runtime's
89
+ * `resolveParallelToolCallBound`. Returning `"sequential"` here would put a
90
+ * second default in a second file, which is how this setting came to have a
91
+ * documented default of 8 that nothing ever applied.
92
+ */
93
+ export declare function resolveToolExecution(maxParallelToolCalls: number | undefined): "sequential" | "parallel" | undefined;
@@ -0,0 +1,40 @@
1
+ import type { CoreSessionConfig } from "../../types/config";
2
+ export interface ConnectionUpdate {
3
+ providerId?: string;
4
+ modelId?: string;
5
+ apiKey?: string;
6
+ baseUrl?: string;
7
+ headers?: Record<string, string>;
8
+ providerConfig?: CoreSessionConfig["providerConfig"];
9
+ reasoningEffort?: CoreSessionConfig["reasoningEffort"] | null;
10
+ thinking?: CoreSessionConfig["thinking"] | null;
11
+ thinkingBudgetTokens?: CoreSessionConfig["thinkingBudgetTokens"] | null;
12
+ }
13
+ export interface ConnectionUpdateInput {
14
+ providerId?: string;
15
+ modelId?: string;
16
+ apiKey?: string;
17
+ baseUrl?: string;
18
+ headers?: Record<string, string>;
19
+ providerConfig?: CoreSessionConfig["providerConfig"];
20
+ thinking?: boolean;
21
+ reasoningEffort?: CoreSessionConfig["reasoningEffort"];
22
+ thinkingBudgetTokens?: number;
23
+ }
24
+ /**
25
+ * Builds a ConnectionUpdate for switching a live session's provider/model
26
+ * connection. Shared by clients (CLI, desktop sidecar, …) so the
27
+ * thinking/reasoning transition rules stay consistent:
28
+ * - `thinking: false` disables reasoning and clears effort/budget.
29
+ * - `thinking: true` (or a provided effort/budget) enables reasoning; an
30
+ * explicit `thinking: true` resets the reasoning state, so a stale effort or
31
+ * token budget from the previous connection is cleared unless a replacement
32
+ * accompanies it. A bare effort/budget without a `thinking` flag updates
33
+ * only the provided field.
34
+ * - `thinking: undefined` leaves the session's reasoning state untouched.
35
+ * Connection fields are included only when defined; an empty string is passed
36
+ * through (it means "clear"), so callers that want to skip blanks must drop
37
+ * them before calling.
38
+ */
39
+ export declare function buildConnectionUpdate(input: ConnectionUpdateInput): ConnectionUpdate;
40
+ export declare function normalizeConnectionUpdate(updates: ConnectionUpdate): ConnectionUpdate;
@@ -0,0 +1,109 @@
1
+ /**
2
+ * The A2A vocabulary, and only the vocabulary.
3
+ *
4
+ * Agent2Agent is a wire protocol for agents that do not share a process: three
5
+ * transports, an AgentCard served over HTTPS for discovery, push-notification
6
+ * webhooks, security schemes. Our base model and our expert are two
7
+ * `SessionRuntime` instances in one process editing one workspace, so none of
8
+ * that is ours to run and the official SDK would ship a client, a server and
9
+ * three transports we would never call.
10
+ *
11
+ * What is worth having is the nouns. They are the part of the spec that had to
12
+ * be argued about, and adopting them costs nothing and settles questions we
13
+ * would otherwise settle badly one at a time:
14
+ *
15
+ * TaskState escalation had no state machine at all -- everything was
16
+ * prose. `input-required` is the expert asking the base a
17
+ * question; `canceled` is the base telling a circling expert to
18
+ * stop; `rejected` is the expert refusing the brief. Each of
19
+ * those is a thing we now have to have an answer for, which is
20
+ * the point of borrowing the enum rather than inventing three
21
+ * booleans later.
22
+ * Message one shape for both directions, carrying structure and prose
23
+ * side by side rather than forcing notes through a string.
24
+ * Part the reason a note can be read by a 9B model and by the panel
25
+ * at the same time: the text part is for the model, the data
26
+ * part is for everything else.
27
+ * Artifact the expert's delivery as a thing with an identity, instead of
28
+ * a paragraph the base has to parse by reading.
29
+ *
30
+ * Deliberately absent: AgentCard (discovery between hosts that cannot see each
31
+ * other -- here "you can message each other" is two sentences of prompt),
32
+ * every transport, push-notification config, and the SDK.
33
+ *
34
+ * Field names follow the spec exactly, including the camelCase and including
35
+ * `messageId` rather than `id`, so that a reader who knows A2A recognises
36
+ * these and a reader who does not can look them up.
37
+ *
38
+ * Spec: https://a2a-protocol.org/latest/specification/
39
+ */
40
+ /**
41
+ * Where a task is, in the spec's own words.
42
+ *
43
+ * The three interrupted/terminal distinctions are the load-bearing part:
44
+ * `working` and `input-required` both mean the expert is alive, but only one
45
+ * of them means the base owes it an answer.
46
+ */
47
+ export type TaskState = "submitted" | "working" | "input-required" | "completed" | "failed" | "canceled" | "rejected";
48
+ export declare const TERMINAL_TASK_STATES: ReadonlySet<TaskState>;
49
+ export declare function isTerminal(state: TaskState): boolean;
50
+ /** Who sent a message. The spec has no third role, and neither do we. */
51
+ export type Role = "user" | "agent";
52
+ /** Text meant to be read by a model. */
53
+ export interface TextPart {
54
+ kind: "text";
55
+ text: string;
56
+ }
57
+ /**
58
+ * Structure meant to be read by code.
59
+ *
60
+ * This is what keeps the informational notes honest. The panel needs the tool
61
+ * name and the revision number; the base model needs a sentence. Putting both
62
+ * in one part would mean one of them is parsed out of the other, and the
63
+ * parser would be the thing that breaks.
64
+ */
65
+ export interface DataPart {
66
+ kind: "data";
67
+ data: Record<string, unknown>;
68
+ }
69
+ export type Part = TextPart | DataPart;
70
+ /** One thing said, in either direction. */
71
+ export interface Message {
72
+ messageId: string;
73
+ role: Role;
74
+ parts: Part[];
75
+ taskId?: string;
76
+ contextId?: string;
77
+ metadata?: Record<string, unknown>;
78
+ }
79
+ /**
80
+ * Something the task produced.
81
+ *
82
+ * For us that is the expert's delivery: what it changed and what it ran, with
83
+ * the files it touched named in a data part rather than described in the prose.
84
+ */
85
+ export interface Artifact {
86
+ artifactId: string;
87
+ parts: Part[];
88
+ name?: string;
89
+ description?: string;
90
+ metadata?: Record<string, unknown>;
91
+ }
92
+ export interface TaskStatus {
93
+ state: TaskState;
94
+ message?: Message;
95
+ /** Milliseconds since the epoch. The spec says timestamp; this is ours. */
96
+ timestamp?: number;
97
+ }
98
+ export interface Task {
99
+ id: string;
100
+ status: TaskStatus;
101
+ contextId?: string;
102
+ artifacts?: Artifact[];
103
+ history?: Message[];
104
+ metadata?: Record<string, unknown>;
105
+ }
106
+ export declare function textPart(text: string): TextPart;
107
+ export declare function dataPart(data: Record<string, unknown>): DataPart;
108
+ /** Every text part, joined. Data parts are not prose and are not included. */
109
+ export declare function textOf(parts: readonly Part[]): string;