@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,994 @@
1
+ import type { ModelInfo } from "@cerebriline/llms";
2
+ import type { AgentConfig, AgentHooks, AgentMode, AgentTool, BasicLogger, ConsecutiveMistakeLimitContext, ConsecutiveMistakeLimitDecision, ExtensionContext, HookErrorMode, ITelemetryService, MessageWithMetadata, RenderedPromptTemplate, SessionExecutionConfig, SessionPromptConfig, SessionWorkspaceConfig } from "@cerebriline/shared";
3
+ import type { CompactionRevisions } from "../extensions/context/compaction-revisions";
4
+ import type { DocumentReaderSettings } from "../extensions/tools/executors/document/ocr";
5
+ import type { ToolRoutingRule } from "../extensions/tools/model-tool-routing";
6
+ import type { QaCredential } from "../extensions/tools/qa-credentials";
7
+ import type { TaskProgressState } from "../extensions/tools/task-progress";
8
+ import type { AgentProfileConnection, AgentProviderConnection, TeamEvent } from "../extensions/tools/team";
9
+ import type { CheckApprover } from "../runtime/atomic/proposal";
10
+ import type { EscalationApproval } from "../runtime/escalation/escalation-session";
11
+ import type { StruggleThresholds } from "../runtime/safety/struggle-detector";
12
+ import type { ProviderConfig } from "./provider-settings";
13
+ export type CoreAgentMode = AgentMode;
14
+ export interface CoreModelConfig {
15
+ providerId: string;
16
+ modelId: string;
17
+ apiKey?: string;
18
+ baseUrl?: string;
19
+ headers?: Record<string, string>;
20
+ providerConfig?: ProviderConfig;
21
+ knownModels?: Record<string, ModelInfo>;
22
+ /**
23
+ * Request model-side thinking/reasoning when supported.
24
+ */
25
+ thinking?: boolean;
26
+ /**
27
+ * Explicit reasoning effort override for capable models.
28
+ */
29
+ reasoningEffort?: ProviderConfig["reasoningEffort"];
30
+ /**
31
+ * Explicit thinking/reasoning token budget for capable models.
32
+ */
33
+ thinkingBudgetTokens?: number;
34
+ /**
35
+ * Maximum output tokens per API call.
36
+ */
37
+ maxTokensPerTurn?: number;
38
+ /**
39
+ * How much of one tool result reaches the provider before the message
40
+ * builder middle-truncates it. Omit for the built-in default.
41
+ */
42
+ maxToolResultChars?: number;
43
+ /**
44
+ * `false` stops the message builder rewriting a superseded file read to
45
+ * `[outdated ...]`. For a model that keeps state keyed on the history --
46
+ * an xOllama council hashes the messages its compaction replaced, and a
47
+ * rewritten one drops that record -- every earlier message must go out as
48
+ * it went out before. Omit for the builder's own rule.
49
+ */
50
+ staleReadRewrites?: boolean;
51
+ /**
52
+ * Sampling temperature per API call.
53
+ */
54
+ temperature?: number;
55
+ }
56
+ /**
57
+ * A connection for delegated agents that is not the session's own.
58
+ *
59
+ * Subagents and teammates inherit the lead's whole connection — provider,
60
+ * model, sampler, and the context window with it. That is the right default and
61
+ * the wrong only option: it leaves no way to run a team of small agents under a
62
+ * strong lead, and no way to give them a window sized for the narrower job.
63
+ *
64
+ * Deliberately only the connection: which model to call, where, and with what
65
+ * provider settings. Everything else about a delegated agent — its tools, its
66
+ * prompt, its iteration cap — still comes from the session that spawned it. And
67
+ * only the fields actually set are taken, so an override naming a model and
68
+ * nothing else keeps the session's sampler and thinking budget.
69
+ */
70
+ export type DelegatedAgentConnectionOverride = Pick<CoreModelConfig, "providerId" | "modelId" | "apiKey" | "baseUrl" | "headers" | "providerConfig" | "knownModels" | "maxToolResultChars" | "staleReadRewrites" | "thinking" | "reasoningEffort" | "thinkingBudgetTokens" | "maxTokensPerTurn" | "temperature">;
71
+ /**
72
+ * A second, costlier model the session's own can hand a stuck task to.
73
+ *
74
+ * The expert is not a better default -- it is a model whose call is worth
75
+ * avoiding: a metered account, a limited allowance, or hardware shared with
76
+ * other people. So the whole configuration is about *when* it is allowed to be
77
+ * called and what happens to it afterwards, and none of it is about making the
78
+ * expert easier to reach.
79
+ *
80
+ * The connection is the same shape a delegated agent takes, for the same
81
+ * reason: `providers.json` holds one entry per provider and the session's model
82
+ * owns it, so an expert on that provider needs a configuration of its own
83
+ * rather than a share of the session's. See {@link
84
+ * DelegatedAgentConnectionOverride}.
85
+ */
86
+ export interface CoreEscalationConfig {
87
+ /**
88
+ * Where the expert runs. Absent means no expert is configured, and every
89
+ * escalation path is closed -- the tool is not offered and no guard hands
90
+ * over to it.
91
+ */
92
+ connection?: DelegatedAgentConnectionOverride;
93
+ /**
94
+ * Release the expert's conversation when an escalation ends, rather than
95
+ * holding it for the next one.
96
+ *
97
+ * Off by default, and the two answers are right on different hardware. A
98
+ * held conversation keeps a hosted provider's prompt cache warm, so a
99
+ * follow-up an hour later does not pay to send the whole exchange again. A
100
+ * released one frees the slot a local server was holding, which is what
101
+ * lets another model load at all.
102
+ */
103
+ closeAfterEscalation?: boolean;
104
+ /**
105
+ * Ask the user before each escalation, showing the brief and the
106
+ * assessment.
107
+ *
108
+ * Off by default. The model's own account of why it needs help is the one
109
+ * piece of evidence it has an interest in, so a host that turns this on
110
+ * gets the harness's independent assessment beside it.
111
+ */
112
+ requireApproval?: boolean;
113
+ /**
114
+ * Puts the escalation to the user, where `requireApproval` is set.
115
+ *
116
+ * Supplied by hosts that have somewhere to ask. A host with nobody there --
117
+ * cron, automation, a CLI with no terminal -- leaves this out, and then
118
+ * `requireApproval` can only refuse: an approval nobody can give is not an
119
+ * approval, and escalating anyway would be the setting doing the opposite of
120
+ * what it says.
121
+ */
122
+ approve?: (request: {
123
+ brief: string;
124
+ index: number;
125
+ of: number;
126
+ }) => Promise<EscalationApproval>;
127
+ /**
128
+ * The expert's own prompt template, already resolved by the host.
129
+ *
130
+ * The expert is a different model from the session's, often a different
131
+ * family, and until this existed it received neither: `openExpert` built a
132
+ * hand-written role preamble and handed the delegated agent the built-in
133
+ * tool descriptions, so a glm or qwen expert read upstream Cline's prompt --
134
+ * written for frontier models, which is the reason family templates exist
135
+ * at all. Resolution lives in the host because only the host can ask
136
+ * `/api/show` what a local tag actually is; core composes what it is given.
137
+ *
138
+ * The system text does NOT replace the role preamble, it follows it. The
139
+ * preamble says who is asking and what is expected back -- that the caller
140
+ * is a model rather than a user, and that a suggested patch in a code block
141
+ * is the one answer that is useless here. Put the family text first and the
142
+ * model reads a general-purpose coding prompt and answers as if to a user,
143
+ * which is the exact failure the preamble was written to stop.
144
+ */
145
+ promptTemplate?: RenderedPromptTemplate;
146
+ /**
147
+ * Let the session's own model keep running while the expert works.
148
+ *
149
+ * Off by default, and the default is not conservatism about the feature --
150
+ * it is that the cost cannot be found out from here. A local ollama serves
151
+ * a cloud expert through the same endpoint as the local base, so the two
152
+ * sharing an endpoint says nothing about whether they contend for it; and
153
+ * between two local models on a server holding one at a time, every
154
+ * alternation is an unload and a load. Only the host knows which of those
155
+ * its hardware is doing, so only the host can answer this.
156
+ *
157
+ * Off is the hand-over this feature started as: the base blocks inside
158
+ * `escalate` until the delivery, and no notes are collected
159
+ * (`local-runtime-host.ts` builds the notes only on the stand-down). The
160
+ * delivery still names the revision each changed file can be read at.
161
+ */
162
+ alternateWithBase?: boolean;
163
+ /**
164
+ * Keep the base running, and relay nothing to it until the delivery.
165
+ *
166
+ * Read only when {@link alternateWithBase} is set, and there for the
167
+ * machine where a model swap is expensive. The base still runs -- it may
168
+ * read, run the check and think about the problem while it stands down from
169
+ * edits, and a steer from the user still reaches it -- but nothing about
170
+ * the expert's work is relayed while that work is happening: no note
171
+ * batches, no guards on the expert's channels, no messages either way.
172
+ *
173
+ * The notes are not saved up for the end, either. A batch is only worth a
174
+ * wake-up while it can still change something, and a model handed four
175
+ * hundred of them at the delivery is reading a transcript of work that has
176
+ * already finished -- which costs the swap it was avoiding and buys nothing
177
+ * (user, 2026-09-14: "the batches are not useful and would be processed
178
+ * when the runs end and there will be a ton").
179
+ */
180
+ relayNothing?: boolean;
181
+ /**
182
+ * An outside reading of the task, added to the assessment.
183
+ *
184
+ * Supplied by a host with a scorer configured (Jev, on VS Code). Given the
185
+ * user's task, the model's goal and reason, and what the harness measured;
186
+ * returns lines worded for the assessment, or none. Its failure, or its
187
+ * being slow, must never hold up an escalation: it is bounded where it is
188
+ * called and its errors read as silence.
189
+ */
190
+ appraise?: (context: {
191
+ task?: string;
192
+ goal?: string;
193
+ reason?: string;
194
+ measured?: string;
195
+ }) => Promise<readonly string[] | undefined>;
196
+ /** Escalations allowed in one task. Three by default. */
197
+ maxEscalations?: number;
198
+ /** Follow-ups within one escalation, after the first delivery. Twenty by default. */
199
+ maxFollowUps?: number;
200
+ /**
201
+ * When the struggle detector offers an escalation.
202
+ *
203
+ * Exposed because the right numbers are still an open question and the
204
+ * setting is load-bearing: on one measured arm the trigger fired zero times
205
+ * in three runs, because the change protocol produces successful tool calls
206
+ * carrying bad verdicts rather than failed ones. Omitted fields keep the
207
+ * corpus-fitted defaults.
208
+ */
209
+ struggleThresholds?: StruggleThresholds;
210
+ }
211
+ export interface CoreRuntimeFeatures {
212
+ enableTools: boolean;
213
+ enableSpawnAgent: boolean;
214
+ enableAgentTeams: boolean;
215
+ /**
216
+ * Whether a delegated agent may run commands. When on, an agent's commands
217
+ * run in a sandbox rooted at a native launcher (and only where one exists for
218
+ * the platform); when off, the agent is offered no shell. Independent of the
219
+ * agent's model. The overlay file-isolation and hand-back apply whenever
220
+ * delegation is on, regardless of this.
221
+ */
222
+ subagentCommandsEnabled?: boolean;
223
+ /**
224
+ * Whether a delegated agent's commands are confined: the system is readable
225
+ * and only the workspace (the agent's copy of it) and a temp folder are
226
+ * writable. On unless set to `false`. It covers every delegated agent,
227
+ * whichever provider it runs on.
228
+ */
229
+ subagentSandboxConfine?: boolean;
230
+ /**
231
+ * The same confinement for the lead's own commands, with the workspace
232
+ * writable in place. Off unless set to `true`: tools that write outside the
233
+ * workspace (a package cache, a global git config) fail under it.
234
+ */
235
+ leadSandboxConfine?: boolean;
236
+ /**
237
+ * Directory holding the native command-sandbox binaries (per platform:
238
+ * `cerebriline-sandbox-<arch>` on Linux, `-darwin-<arch>` on macOS,
239
+ * `cerebriline-sandbox.exe` + `hook.dll` on Windows), which the host ships.
240
+ * When present and the binaries exist for this platform, a delegated agent's
241
+ * commands are rooted there; when absent, agents get file isolation but no
242
+ * shell.
243
+ */
244
+ sandboxBinariesDir?: string;
245
+ /**
246
+ * Whether a turn that calls no tool is nudged to continue even when nothing
247
+ * says work is unfinished. Defaults to true, which is what every host did
248
+ * before this was a setting.
249
+ *
250
+ * A coding session wants that reading: a silent turn there is nearly always
251
+ * one that should have acted, and a needless nudge costs a turn where a
252
+ * missed one costs the task. A session used mostly for questions wants the
253
+ * opposite -- see `completionPolicy.strongNudges`.
254
+ */
255
+ strongNudges?: boolean;
256
+ /**
257
+ * Whether `extract_document` is offered, to the lead and to every agent it
258
+ * delegates to. Off unless set: the tool is a niche reader, and each request
259
+ * that offers it pays for its schema.
260
+ */
261
+ enableExtractDocument?: boolean;
262
+ /**
263
+ * How `extract_document` reads scanned pages (tesseract, the vision model,
264
+ * or not at all) and whether it describes pictures. Read only when the
265
+ * tool is on; the vision model is `describeImages`.
266
+ */
267
+ documentReader?: DocumentReaderSettings;
268
+ disableMcpSettingsTools?: boolean;
269
+ yolo?: boolean;
270
+ }
271
+ export type CoreCompactionMode = "auto" | "manual" | "overflow_recovery";
272
+ export interface CoreCompactionBudget {
273
+ request: {
274
+ /** Estimated tokens for the full provider request. */
275
+ inputTokens: number;
276
+ /** Effective provider input limit. */
277
+ maxInputTokens: number;
278
+ /** Full-request token count that triggers automatic compaction. */
279
+ triggerTokens: number;
280
+ /** Full-request token count the strategy output should fit within. */
281
+ targetTokens: number;
282
+ /** Fixed system-prompt, tool-definition, and request framing cost. */
283
+ overheadTokens: number;
284
+ thresholdRatio: number;
285
+ utilizationRatio: number;
286
+ };
287
+ messages: {
288
+ /** Estimated tokens in the compactable message transcript. */
289
+ inputTokens: number;
290
+ /** Message budget corresponding to the full-request trigger. */
291
+ triggerTokens: number;
292
+ /** Message budget the strategy should compact toward. */
293
+ targetTokens: number;
294
+ };
295
+ }
296
+ export interface CoreCompactionContext {
297
+ agentId: string;
298
+ conversationId: string;
299
+ parentAgentId: string | null;
300
+ iteration: number;
301
+ messages: MessageWithMetadata[];
302
+ model: {
303
+ id: string;
304
+ provider: string;
305
+ info?: ModelInfo;
306
+ };
307
+ mode: CoreCompactionMode;
308
+ budget: CoreCompactionBudget;
309
+ /**
310
+ * Aborted when the turn is cancelled. Custom `compact` implementations
311
+ * that call models or external services should observe it so a cancelled
312
+ * or recovering turn is not blocked on a stalled compaction.
313
+ */
314
+ abortSignal?: AbortSignal;
315
+ /**
316
+ * Where a compaction says how far through its own model calls it is.
317
+ *
318
+ * A compaction is several sequential requests and reads as one spinner
319
+ * from outside; on a local model the whole sequence can run for minutes.
320
+ * Supplied by the pipeline, which owns the channel -- absent means the
321
+ * compaction simply says nothing, as it did before.
322
+ */
323
+ emitStatusNotice?: (message: string, metadata?: Record<string, unknown>) => void;
324
+ }
325
+ export type CoreCompactionBudgetPolicyIntent = "agentic_summary" | "basic_compaction_projection" | "normal_provider_request";
326
+ export type CoreCompactionLiveTailHandling = "included_verbatim" | "included_degraded" | "summarized_as_context" | "omitted_with_warning" | "preserved_out_of_band";
327
+ export interface CoreCompactionBudgetMetadata {
328
+ policyIntent: CoreCompactionBudgetPolicyIntent;
329
+ actionCount: number;
330
+ warningCount: number;
331
+ liveTailHandling: CoreCompactionLiveTailHandling;
332
+ }
333
+ export interface CoreCompactionResult {
334
+ messages: MessageWithMetadata[];
335
+ budget?: CoreCompactionBudgetMetadata;
336
+ }
337
+ export interface CoreCompactionSummarizerConfig {
338
+ providerId: string;
339
+ modelId: string;
340
+ apiKey?: string;
341
+ baseUrl?: string;
342
+ headers?: Record<string, string>;
343
+ /**
344
+ * Optional pre-resolved model metadata for the summarizer. Supplying either
345
+ * this or `knownModels` lets agentic compaction budget summary input against
346
+ * the summarizer model's actual context window instead of falling back to the
347
+ * active model's window.
348
+ */
349
+ modelInfo?: ModelInfo;
350
+ knownModels?: Record<string, ModelInfo>;
351
+ providerConfig?: ProviderConfig;
352
+ maxOutputTokens?: number;
353
+ }
354
+ /**
355
+ * Session settings for the model's task checklist.
356
+ *
357
+ * Off unless a host asks for it: the checklist costs a parameter on every tool
358
+ * description and re-sent text every few calls, which is a trade a host makes
359
+ * knowingly rather than inherits.
360
+ */
361
+ export interface CoreTaskProgressConfig {
362
+ enabled: boolean;
363
+ /** Tool calls between reminders. Non-positive disables reminding only. */
364
+ reminderInterval?: number;
365
+ /** Called whenever the model sends a new checklist. */
366
+ onUpdate?: (state: TaskProgressState) => void;
367
+ }
368
+ /**
369
+ * How firmly the session insists an edited file be checked before it finishes.
370
+ *
371
+ * Three states rather than a boolean, because "ask the model once" and "do not
372
+ * let it finish" are different products and the user owns the choice. It lives
373
+ * in settings rather than in the conversation on purpose: a question asked
374
+ * after every file change is a round trip per edit, and "always" is not an
375
+ * answer a model should be giving on the user's behalf.
376
+ */
377
+ export type CoreEditVerificationMode = "off" | "nudge" | "require";
378
+ export interface CoreEditVerificationConfig {
379
+ mode?: CoreEditVerificationMode;
380
+ /** Tools whose calls mark a file changed. Defaults to the built-in editors. */
381
+ editTools?: string[];
382
+ /**
383
+ * Tools whose calls mark a file verified. Named by the host rather than
384
+ * assumed: the checker on the VS Code path is `check_file`, which lives in
385
+ * the extension. A host that names none gets no guard at all.
386
+ */
387
+ checkTools?: string[];
388
+ }
389
+ /**
390
+ * When a task is run as a sequence of judged, revertible transactions.
391
+ *
392
+ * This says where the protocol is configured from and who decides to run it,
393
+ * not whether a change can be judged — that question is answered by whether
394
+ * there is an oracle and whether the model may propose one, and it is the same
395
+ * question in both modes.
396
+ *
397
+ * `static` engages on every task from the moment it starts, configured once and
398
+ * unaffected by anything said in the conversation. It is the mode to measure a
399
+ * model in, because a run must not depend on what a panel happened to be
400
+ * showing. `on` makes the protocol available and leaves the engaging to the
401
+ * user, per task, at the point they hit something worth judging — which is how
402
+ * a developer meets it: not at the start of the work, but partway through.
403
+ *
404
+ * Off is the default: the protocol costs a check per attempt and holds a copy
405
+ * of the workspace in memory, which is not a bargain for a one-line edit.
406
+ *
407
+ * Replaced `off | auto | always`. `auto` stood down where nothing could judge a
408
+ * change and `always` engaged anyway with the model as the check — a
409
+ * distinction that had stopped carrying its own weight, because `proposeCheck`
410
+ * already decides that same case and says so in plainer words. Both old values
411
+ * engaged by themselves, so both migrate to `static`; migrating them to `on`
412
+ * would leave the protocol switched on and never engaging.
413
+ */
414
+ export type CoreAtomicProtocolMode = "off" | "on" | "static";
415
+ export interface CoreAtomicProtocolConfig {
416
+ mode?: CoreAtomicProtocolMode;
417
+ /**
418
+ * What the model must run for this task to count as done, as a shell line.
419
+ *
420
+ * The user's own check, and it outranks anything detection finds. Detection
421
+ * answers "does this workspace still hold together", which a model can leave
422
+ * green with the asked-for thing still broken — a typecheck passes over a
423
+ * game that no longer starts. A line written for the task in front of the
424
+ * user is the narrower question and the one worth judging on.
425
+ */
426
+ oracleCommand?: string;
427
+ /**
428
+ * A pattern that command's output must match, on top of a clean exit.
429
+ *
430
+ * For the large class of checks that report a verdict and exit zero anyway.
431
+ * Without it, such a check keeps every transaction it is ever pointed at:
432
+ * the harness's own oracle prints `{"ok":false,"error":"…"}` and exits 0
433
+ * whether the game runs or not.
434
+ */
435
+ oracleExpect?: string;
436
+ /** Longest that command may run before the transaction is judged on nothing. */
437
+ oracleTimeoutMs?: number;
438
+ /** Changes the model may declare per transaction. Three by default. */
439
+ maxChanges?: number;
440
+ /** Attempts before the task stops. Six by default, as the harness runs it. */
441
+ maxTransactions?: number;
442
+ /**
443
+ * Asks the user to approve a check the model proposed for this task.
444
+ *
445
+ * Supplied by hosts that have somewhere to ask. Where a workspace holds
446
+ * nothing runnable, this is the difference between a real verdict and the
447
+ * model's own account of its work — and the approval is a boundary rather
448
+ * than a formality, since an approved command is then run repeatedly and
449
+ * trusted as the judge. A host without a user leaves it out and gets the
450
+ * behaviour it had before.
451
+ */
452
+ approveCheck?: CheckApprover;
453
+ /**
454
+ * Whether the model may propose its own check where nothing can be run.
455
+ *
456
+ * Defaults on. Off restores the verdict that preceded it -- the model's own
457
+ * account of its work -- which is weaker evidence and measurably faster:
458
+ * across one workspace the proposed-check runs took four to six times the
459
+ * model time of the self-declared ones and closed nothing. This is here so
460
+ * the two can be compared on the same task rather than across releases.
461
+ */
462
+ proposeCheck?: boolean;
463
+ /**
464
+ * Proposals put to the user before the run gives up on having a check.
465
+ *
466
+ * Two by default. A host that approves everything automatically wants a
467
+ * different number from one where a person answers each time.
468
+ */
469
+ maxCheckProposals?: number;
470
+ /**
471
+ * Discarded attempts before a check that has never passed may be replaced.
472
+ *
473
+ * Two by default, and zero turns it off. The freeze on a proposed check is
474
+ * what stops a model weakening it until one passes; this is the one crack
475
+ * in it, for the case the freeze cannot survive — a check that cannot pass
476
+ * at all, which freezes the run into failure. Measured over ten runs on one
477
+ * workspace, that cost two of them outright, and in the second the model
478
+ * proposed the correct check twice and was refused both times.
479
+ *
480
+ * Only ever applies to a check the model proposed. A check the user wrote,
481
+ * or one detected in the tree, is the specification and is never revisited.
482
+ */
483
+ checkReconsideredAfter?: number;
484
+ /**
485
+ * Retires what the model had read about a file the protocol put back.
486
+ *
487
+ * Supplied by hosts that own the read receipts, for the same reason
488
+ * `approveCheck` is supplied by hosts that have somewhere to ask. The
489
+ * protocol's `restore_file` moves every line in the file it restores, so
490
+ * reads taken before it no longer describe it, and the editor's
491
+ * read-before-edit guard would otherwise accept an edit aimed at code that
492
+ * has since moved. A host that leaves this out still gets the restore.
493
+ */
494
+ forgetReads?: (absolutePath: string) => void;
495
+ }
496
+ export type CoreCompactionStrategy = "basic" | "agentic";
497
+ export interface CoreCompactionConfig {
498
+ enabled?: boolean;
499
+ strategy?: CoreCompactionStrategy;
500
+ preserveRecentTokens?: number;
501
+ /**
502
+ * Minimum share of the transcript's messages the preserved tail should reach
503
+ * before `preserveRecentTokens` alone is allowed to end it (0–1).
504
+ *
505
+ * A token budget is a poor proxy for how much conversation survives, and the
506
+ * two diverge exactly when messages are heavy: measured live, a 113-message
507
+ * transcript satisfied a 20,000-token budget after six messages and compacted
508
+ * to seven while the post-compaction budget allowed ~73,000. Defaults to
509
+ * {@link DEFAULT_PRESERVE_RECENT_MESSAGES_RATIO}; the token budget for the
510
+ * compacted request still caps it, so this can only ask, never overrun.
511
+ */
512
+ preserveRecentMessagesRatio?: number;
513
+ /**
514
+ * Whether the most recent messages survive a compaction verbatim.
515
+ *
516
+ * On (the default) the summary is a preface: it is prepended to a recency
517
+ * tail the model then reads in its own words, and `summaryPrompt` is written
518
+ * for that — first person, same prose, no seam. Off, the summary *is* the
519
+ * context and `fullSummaryPrompt` applies instead, which is a different
520
+ * artifact rather than a longer one.
521
+ *
522
+ * The two are separate settings because they are separate jobs, and a user
523
+ * who has tuned one should not lose it by trying the other.
524
+ */
525
+ keepRecentMessages?: boolean;
526
+ /**
527
+ * The compaction from which the tail is dropped anyway, counting from 1.
528
+ *
529
+ * Only meaningful while {@link keepRecentMessages} is on; with it off every
530
+ * compaction already keeps nothing. `1` drops the tail on every compaction
531
+ * and anything below `1` never does. Unset takes
532
+ * `FORCE_FULL_FROM_COMPACTION`, which is now `0` -- off.
533
+ *
534
+ * It defaulted to `2` and should not have. That made the tail policy change
535
+ * part-way through every run: the first compaction kept the tail, every
536
+ * later one dropped it. The first was then the weak one by construction,
537
+ * and no experiment could compare keeping a tail with dropping one, because
538
+ * neither arm ever did either for a whole run. Left as an override for
539
+ * anyone who wants that behaviour on purpose.
540
+ */
541
+ forceFullFromCompaction?: number;
542
+ /**
543
+ * The session's file revision log, when the host keeps one.
544
+ *
545
+ * Compaction is the only thing that can answer either of the log's two open
546
+ * questions: which revisions a summary still refers to, and therefore which
547
+ * histories are worth holding. Supplied by the host for the same reason
548
+ * `forgetReads` is -- the log lives in the runtime, and a host without one
549
+ * still compacts, with ledger entries that say nothing about files.
550
+ */
551
+ revisions?: CompactionRevisions;
552
+ /**
553
+ * Whether each summary carries the harness's own record of the calls it
554
+ * stands for.
555
+ *
556
+ * Defaults on. Set `false` with the Checkpoints switch, which owns the
557
+ * revision addresses the ledger quotes: a ledger naming revisions on a
558
+ * session that has no `restore_file` to reach them is an offer the session
559
+ * cannot honour.
560
+ */
561
+ toolLedgerEnabled?: boolean;
562
+ /**
563
+ * Replaces the built-in instruction the summarizer is given when a recency
564
+ * tail survives — see {@link keepRecentMessages}.
565
+ *
566
+ * The summary is all that survives the turns it stands for, and what a good
567
+ * one contains depends on the work and on the model writing it, so this is
568
+ * worth being able to change without a rebuild. `{{files_read}}` and
569
+ * `{{files_edited}}` are substituted; the transcript is appended by the
570
+ * caller either way. Blank or unset uses the default.
571
+ */
572
+ summaryPrompt?: string;
573
+ /**
574
+ * Replaces the built-in instruction used when no recency tail survives.
575
+ *
576
+ * Ignored while {@link keepRecentMessages} is on. Blank or unset uses the
577
+ * default, which is written for a reader that has this text and nothing
578
+ * else: a fixed section list rather than a request for detail, because
579
+ * length adjectives are a measured non-lever and structure is not.
580
+ */
581
+ fullSummaryPrompt?: string;
582
+ /**
583
+ * Whether compaction also writes a retrospective over the reasoning it is
584
+ * discarding, prepended to the summary as its own thinking block.
585
+ *
586
+ * The summary records what happened; the reasoning that produced it is
587
+ * thrown away with the turns, and with it every wrong approach the model
588
+ * already ruled out. A model that resumes from a summary alone has no memory
589
+ * of having been wrong, which is how a long task repeats its own mistakes.
590
+ *
591
+ * Costs one extra model call per compaction. Defaults to on.
592
+ */
593
+ thinkingSummaryEnabled?: boolean;
594
+ /**
595
+ * Whether the summary and the retrospective are reviewed before they
596
+ * replace the transcript.
597
+ *
598
+ * Two reviewers each receive one half of the transcript along with the
599
+ * whole summary, and correct it against the half they hold; a synthesiser
600
+ * merges the two corrections. The summary is the one artifact in the
601
+ * system that is never checked against the thing it describes, and from
602
+ * the turn it is written it *is* the thing it describes -- so a claim that
603
+ * went in wrong is never caught by anything downstream.
604
+ *
605
+ * Costs three extra model calls per compaction and cannot fail one: every
606
+ * path through the review returns the summary it was given. Defaults to on.
607
+ */
608
+ councilEnabled?: boolean;
609
+ /**
610
+ * Replaces the built-in retrospective instruction.
611
+ *
612
+ * Worth changing per model for the same reason as `summaryPrompt`, and more
613
+ * so: a model that habitually reasons to its cap needs a firmer hand about
614
+ * terseness than one that thinks in three lines. Blank or unset uses the
615
+ * default.
616
+ */
617
+ thinkingSummaryPrompt?: string;
618
+ /**
619
+ * Replaces the council's instruction to the replay's writer -- where to put
620
+ * the `<<<HALFWAY>>>` line the review splits on. Appended to whichever
621
+ * summary prompt runs, and only while {@link councilEnabled} is on. Blank
622
+ * or unset uses the default.
623
+ */
624
+ councilWriterPrompt?: string;
625
+ /**
626
+ * Replaces the council reviewers' instruction. `{{half}}`, `{{other_half}}`
627
+ * and `{{half_length}}` are substituted; the halves, the record and the
628
+ * transcript are appended after it either way.
629
+ */
630
+ councilCriticPrompt?: string;
631
+ /**
632
+ * Replaces the council synthesiser's instruction. `{{original_length}}` and
633
+ * `{{max_length}}` are substituted; the answer format and the halves are
634
+ * appended after it either way, because the reply is parsed by its headings.
635
+ */
636
+ councilSynthesizerPrompt?: string;
637
+ /**
638
+ * Whether a turn whose reasoning hit the thinking cap has that reasoning
639
+ * replaced, for the next request, with a note of what it settled.
640
+ *
641
+ * A capped turn is cut mid-sentence, and the next turn re-derives the same
642
+ * reasoning from the beginning rather than continuing from it. Defaults on
643
+ * where a thinking budget is known; without one there is nothing to detect.
644
+ */
645
+ cappedThinkingEnabled?: boolean;
646
+ /** Replaces the built-in continuation-note instruction. */
647
+ cappedThinkingPrompt?: string;
648
+ /**
649
+ * What the server appends to reasoning it cut at the budget, when the
650
+ * session knows the wording. Confirms or denies a capped turn outright;
651
+ * without one the condenser measures instead.
652
+ */
653
+ cappedThinkingBudgetMessage?: string;
654
+ /** The per-turn thinking allowance this session sends, when one is known. */
655
+ thinkingBudgetTokens?: number;
656
+ summarizer?: CoreCompactionSummarizerConfig;
657
+ compact?: (context: CoreCompactionContext) => Promise<CoreCompactionResult | undefined> | CoreCompactionResult | undefined;
658
+ }
659
+ /**
660
+ * Context passed to a custom `createCheckpoint` implementation.
661
+ */
662
+ export interface CoreCheckpointContext {
663
+ /** Absolute path to the working directory of the session. */
664
+ cwd: string;
665
+ /** The session identifier. */
666
+ sessionId: string;
667
+ /** Monotonically increasing run counter for this session (starts at 1). */
668
+ runCount: number;
669
+ }
670
+ /**
671
+ * Configuration for the built-in git-based checkpoint feature.
672
+ *
673
+ * Checkpoints capture a restorable snapshot of the workspace at the start of
674
+ * each root-agent run so that changes made during a session can be rolled back.
675
+ *
676
+ * @example Disable checkpoints entirely:
677
+ * ```ts
678
+ * checkpoint: { enabled: false }
679
+ * ```
680
+ *
681
+ * @example Bring your own checkpoint implementation:
682
+ * ```ts
683
+ * checkpoint: {
684
+ * createCheckpoint: async ({ cwd, sessionId, runCount }) => {
685
+ * const ref = await mySnapshotFn(cwd);
686
+ * return { ref, createdAt: Date.now(), runCount };
687
+ * },
688
+ * }
689
+ * ```
690
+ */
691
+ export interface CoreCheckpointConfig {
692
+ /**
693
+ * Whether to create checkpoints on each root-agent run start.
694
+ * Defaults to `false` — checkpoints are **opt-in**. Set to `true` to
695
+ * enable the built-in git stash/ref checkpoint behaviour for this session.
696
+ */
697
+ enabled?: boolean;
698
+ /**
699
+ * Replace the built-in git stash/ref checkpoint logic with a custom
700
+ * implementation. Called once at the start of each root-agent run (before
701
+ * the first agent iteration).
702
+ *
703
+ * Return an object with at least `ref`, `createdAt`, and `runCount` to have
704
+ * the entry recorded in session metadata, or return `undefined` to skip
705
+ * writing a checkpoint for that run.
706
+ */
707
+ createCheckpoint?: (context: CoreCheckpointContext) => Promise<{
708
+ ref: string;
709
+ createdAt: number;
710
+ runCount: number;
711
+ kind?: "stash" | "commit";
712
+ } | undefined> | {
713
+ ref: string;
714
+ createdAt: number;
715
+ runCount: number;
716
+ kind?: "stash" | "commit";
717
+ } | undefined;
718
+ }
719
+ export interface CoreSessionConfig extends CoreModelConfig, CoreRuntimeFeatures, Omit<SessionWorkspaceConfig, "workspaceRoot">, Omit<SessionPromptConfig, "systemPrompt">, Omit<SessionExecutionConfig, "enableTools" | "teamName" | "missionLogIntervalSteps" | "missionLogIntervalMs" | "maxConsecutiveMistakes"> {
720
+ /**
721
+ * Core/hub runtime session identifier.
722
+ *
723
+ * When provided, this becomes the host-owned id for persistence, hub
724
+ * subscriptions, send/abort/stop commands, and approval routing. When
725
+ * omitted, the runtime host creates one. This is distinct from the agent
726
+ * conversation id, which is generated by the conversation store for
727
+ * transcript/tool/hook context.
728
+ */
729
+ sessionId?: string;
730
+ /**
731
+ * Turn images into text with a second model, so the session's model never
732
+ * sees one. See `AgentConfig.describeImages`.
733
+ *
734
+ * Declared here because it is a session-level setting that hosts already
735
+ * pass: the VS Code host has set both of these since the vision model
736
+ * shipped, and only got away with it because it adds them through a
737
+ * conditional spread, which excess-property checking does not inspect. A
738
+ * host assigning them directly — the CLI — was rejected for setting a field
739
+ * that has always been read.
740
+ */
741
+ describeImages?: AgentConfig["describeImages"];
742
+ /** See `AgentConfig.alwaysDescribeImages`. */
743
+ alwaysDescribeImages?: boolean;
744
+ /**
745
+ * Run subagents and teammates on this connection instead of the session's.
746
+ *
747
+ * Omitted means what it always meant: they inherit the lead's. See
748
+ * `DelegatedAgentConnectionOverride`.
749
+ */
750
+ delegatedAgentConnection?: DelegatedAgentConnectionOverride;
751
+ /**
752
+ * Most delegated agents that may run at once against their endpoint.
753
+ *
754
+ * Resolved by the host, because answering it can mean asking the server: a
755
+ * local one has a fixed number of slots (`OLLAMA_NUM_PARALLEL`,
756
+ * `--parallel N`) and *queues* the request that finds none free rather than
757
+ * refusing it, so over-spawning reads as a slow run rather than a blocked
758
+ * one. Hosted providers have the same shape with a plan's allowance in place
759
+ * of slots.
760
+ *
761
+ * `0` means no cap of ours -- not "unlimited", but "something else decides":
762
+ * opencoti with PolyKV on, where agents share a slot and admission control
763
+ * answers against measured KV headroom. `undefined` means no host resolved
764
+ * one at all, which leaves every previous behaviour exactly as it was.
765
+ */
766
+ maxConcurrentAgents?: number;
767
+ /**
768
+ * The same bound, per endpoint, for the endpoints that are not the
769
+ * session's.
770
+ *
771
+ * An agent that names a `profile:` or a `providerId:` runs somewhere else,
772
+ * and how many requests *that* server serves at once is its own number. Held
773
+ * to the lead's, a four-slot server ran one agent while its siblings queued
774
+ * for slots it had free.
775
+ *
776
+ * Given as connections rather than as keys so the host never has to spell an
777
+ * endpoint key: two spellings of one server -- a trailing slash, a capital
778
+ * letter -- are the same endpoint, and only `agentEndpointKey` knows that.
779
+ * The first entry naming an endpoint wins, so a host may list the specific
780
+ * answers (a profile's own count) ahead of the general ones (the shared
781
+ * provider entry's).
782
+ *
783
+ * Host-resolved like `maxConcurrentAgents`, but from configuration alone:
784
+ * the one thing that can only be answered by asking a server -- opencoti
785
+ * with PolyKV, where the cap is lifted because admission control decides --
786
+ * is not asked here, because that probe is unbounded and these endpoints are
787
+ * merely configured, not necessarily running. A server that is switched off
788
+ * would otherwise hold up starting a session that was never going near it.
789
+ *
790
+ * An endpoint nobody named takes `maxConcurrentAgents`, which is what every
791
+ * endpoint took before this existed.
792
+ */
793
+ /**
794
+ * Agent Nodes: where delegated agents run, in priority order.
795
+ *
796
+ * A node is a complete agents configuration -- its own provider, model,
797
+ * context window, sampler and budget -- so a set of them is heterogeneous
798
+ * by design. 1 is the highest priority and a lower tier is used only when
799
+ * no node in a higher one has a free slot; within a tier, round-robin.
800
+ * When all of them are full the next agent WAITS, in spawn order.
801
+ *
802
+ * Resolved by the host, capacity included: the unit differs by provider
803
+ * (a parallel-sessions setting for ollama, llama.cpp and the cloud ones;
804
+ * the sub-pools inside one session for opencoti).
805
+ *
806
+ * Empty or absent is every session that predates this: delegated agents
807
+ * take `delegatedAgentConnection`, or the session's own.
808
+ */
809
+ agentNodes?: ReadonlyArray<{
810
+ id: string;
811
+ priority: number;
812
+ /**
813
+ * How many delegated agents this node runs at once.
814
+ *
815
+ * `0` is the node turned OFF -- it is never placed on. "The endpoint
816
+ * decides" is `Number.POSITIVE_INFINITY`, not `0`: the two readings
817
+ * collided once already, and a node meaning the second was read as
818
+ * the first and silently took no agents at all.
819
+ */
820
+ capacity: number;
821
+ /**
822
+ * An uncapped node whose engine admits each agent itself (PolyKV). Only
823
+ * these take agents one at a time, the next once the last is admitted;
824
+ * any other uncapped node takes them together.
825
+ */
826
+ pacedAdmission?: boolean;
827
+ /** What the settings panel calls it: `Node1`, `Node2`, `Node3`. */
828
+ label?: string;
829
+ connection: DelegatedAgentConnectionOverride;
830
+ /**
831
+ * "Agent window", 0..100: the least window this node's opencoti agents
832
+ * accept, as a share between the minimum a turn needs and the node's
833
+ * window. Merged onto the agents' provider config as `agentWindow`,
834
+ * beside what that config already carries. A host that builds the
835
+ * provider config itself may put `agentWindow` there instead.
836
+ */
837
+ windowShare?: number;
838
+ /**
839
+ * The lead's own session as priority 0. Added by core from
840
+ * `polykvAgentsPriorityZero`, never by a host: one a host lists is
841
+ * dropped. See `sessionAgentNodes`.
842
+ */
843
+ polykvLead?: boolean;
844
+ }>;
845
+ /**
846
+ * "Use PolyKV agents as Priority 0" (PLANS §9g). Off by default.
847
+ *
848
+ * On, delegated agents are placed first as sub-pools of THIS session's own
849
+ * opencoti window -- priority 0, above every node, at most eight -- and
850
+ * overflow into `agentNodes` when those are taken or the lead's window is
851
+ * below the room it keeps for the conversation. It spends the
852
+ * conversation's own window on agent work, which is why it is opt-in.
853
+ *
854
+ * The host sets it only with the setting on AND `pools_enabled` confirmed
855
+ * from this endpoint's `/props`; core ignores it on any provider but
856
+ * opencoti. See `sessionAgentNodes`.
857
+ */
858
+ polykvAgentsPriorityZero?: boolean;
859
+ agentSlotLimits?: ReadonlyArray<{
860
+ providerId?: string;
861
+ baseUrl?: string;
862
+ /** As `maxConcurrentAgents`: `0` means admission control decides. */
863
+ limit: number;
864
+ }>;
865
+ /**
866
+ * Resolves a provider other than the session's, for a configured subagent
867
+ * whose frontmatter names one.
868
+ *
869
+ * Host-supplied because only the host knows where its provider store lives:
870
+ * the CLI's follows `--config`, the extension's follows its own data
871
+ * directory. Core reaching for a default path would read the wrong file in
872
+ * one of them and call the wrong server with the wrong key. Absent means an
873
+ * agent on a second provider is refused rather than silently run on the
874
+ * session's connection.
875
+ */
876
+ resolveProviderConnection?: (providerId: string) => AgentProviderConnection | undefined;
877
+ /**
878
+ * Resolves a saved API configuration profile by name, for an agent whose
879
+ * frontmatter names one.
880
+ *
881
+ * Host-supplied for the same reason as the provider resolver, and absent on
882
+ * a host that has no profiles at all — the CLI has providers and no named
883
+ * configurations over them. An agent naming a profile on such a host is
884
+ * refused rather than run on the session's, which is the same rule the
885
+ * provider case follows and for the same reason: a subagent silently running
886
+ * the wrong model is worse than one that does not run.
887
+ */
888
+ resolveProfileConnection?: (name: string) => AgentProfileConnection | undefined;
889
+ /**
890
+ * The profile names this host currently has, so a refusal can say what to
891
+ * pick instead of only what is missing. Profiles are deleted long after the
892
+ * agent files that name them were written.
893
+ */
894
+ listProfileNames?: () => string[];
895
+ workspaceRoot?: string;
896
+ systemPrompt: string;
897
+ teamName?: string;
898
+ missionLogIntervalSteps?: number;
899
+ missionLogIntervalMs?: number;
900
+ hooks?: AgentHooks;
901
+ hookErrorMode?: HookErrorMode;
902
+ logger?: BasicLogger;
903
+ telemetry?: ITelemetryService;
904
+ extensionContext?: ExtensionContext;
905
+ extraTools?: AgentTool[];
906
+ /**
907
+ * The checklist the model keeps while it works.
908
+ *
909
+ * Applied to the whole session toolset — builtins and `extraTools` alike.
910
+ * A host that replaces a builtin (VS Code swaps `run_commands` for its own
911
+ * terminal-aware version) would otherwise leave the most-used tool in a
912
+ * coding run as the one tool carrying no checklist.
913
+ */
914
+ taskProgress?: CoreTaskProgressConfig;
915
+ /**
916
+ * Whether the run may end with a file the model changed and never checked.
917
+ *
918
+ * Measured on a live session: the linter ran once *before* anything was
919
+ * touched, then four consecutive edits landed unchecked, and the file was
920
+ * left with sixteen problems. The tool was present and already used — what
921
+ * was missing was anything that noticed.
922
+ */
923
+ editVerification?: CoreEditVerificationConfig;
924
+ /**
925
+ * Whether the task runs as judged, revertible transactions.
926
+ *
927
+ * A stronger claim than edit verification and a different one: verification
928
+ * asks that a changed file be checked, while this decides what happens when
929
+ * the check says no. A transaction that fails is not reported and left on
930
+ * disk — every file it touched goes back to what it was, and the next
931
+ * attempt starts from the same place this one did, carrying the record of
932
+ * what was already tried.
933
+ */
934
+ atomicProtocol?: CoreAtomicProtocolConfig;
935
+ /**
936
+ * A costlier model this session may hand a stuck task to.
937
+ *
938
+ * Absent means no escalation path exists, which is every previous build's
939
+ * behaviour. See {@link CoreEscalationConfig}.
940
+ */
941
+ escalation?: CoreEscalationConfig;
942
+ /**
943
+ * The project's own checker, for the `check_file` this host supplies.
944
+ *
945
+ * Without one that tool answers a narrower question than the extension's
946
+ * does — syntax and brackets, where VS Code reads its language servers —
947
+ * and the two hosts ship measurably different tools under one name. Naming
948
+ * a command closes the distance and changes what the tool tells the model
949
+ * it is, which is the half that matters: a model that believes it has only
950
+ * a syntax check goes and runs the linter through `run_commands` anyway.
951
+ *
952
+ * `${file}` marks where the path goes; a command without it gets the path
953
+ * appended.
954
+ */
955
+ checkFile?: {
956
+ lintCommand?: string;
957
+ };
958
+ /**
959
+ * Named secrets a QA command can ask for.
960
+ *
961
+ * Supplied by the host because only the host has a secret store; core never
962
+ * reads or writes them anywhere, it only routes a value into the environment
963
+ * of the one command that asked and masks it back out of what comes home.
964
+ * See `extensions/tools/qa-credentials.ts` for why that is the whole design.
965
+ */
966
+ qaCredentials?: QaCredential[];
967
+ pluginPaths?: string[];
968
+ /**
969
+ * Additional Agent Plugins v1 package roots. Paths are resolved by the
970
+ * execution host, so hub clients do not load package contents themselves.
971
+ */
972
+ agentPluginPaths?: string[];
973
+ extensions?: AgentConfig["extensions"];
974
+ execution?: AgentConfig["execution"];
975
+ compaction?: CoreCompactionConfig;
976
+ checkpoint?: CoreCheckpointConfig;
977
+ onTeamEvent?: (event: TeamEvent) => void;
978
+ onConsecutiveMistakeLimitReached?: (context: ConsecutiveMistakeLimitContext) => Promise<ConsecutiveMistakeLimitDecision> | ConsecutiveMistakeLimitDecision;
979
+ toolRoutingRules?: ToolRoutingRule[];
980
+ /**
981
+ * Optional skill allowlist for the `skills` tool. When provided, only these
982
+ * skills are surfaced in tool metadata and invocable by name.
983
+ */
984
+ skills?: string[];
985
+ workspaceMetadata?: string;
986
+ }
987
+ /**
988
+ * Public ClineCore start configuration. The execution host resolves `cwd`
989
+ * before constructing a runtime, assigning the shared chat workspace when both
990
+ * workspace paths are omitted.
991
+ */
992
+ export type ClineCoreStartConfig = Omit<CoreSessionConfig, "cwd"> & {
993
+ cwd?: string;
994
+ };