@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,183 @@
1
+ /**
2
+ * A tool that makes a picture.
3
+ *
4
+ * Cline can write the CSS for a theme and the loader for a sprite, and then has
5
+ * nothing to say about what either one looks like. Every visual question --
6
+ * "which of these layouts", "an icon for this app", "a placeholder texture" --
7
+ * left the session: the user generated the asset somewhere else and came back
8
+ * with a path. That is the gap mann1x/cline#53 describes.
9
+ *
10
+ * The half of it that already worked is the display: a tool result may carry an
11
+ * `image` content part, the browser tool has returned screenshots that way for
12
+ * a while, and the webview renders them inline. What was missing was anything
13
+ * that produces one.
14
+ *
15
+ * The wire format is the OpenAI images API (`POST {endpoint}/images/generations`)
16
+ * because it is the one every local server already speaks -- LocalAI, an
17
+ * Automatic1111 or ComfyUI shim, a llama.cpp image build -- as well as the
18
+ * hosted services. Deliberately not Ollama-specific: this fork's own Ollama
19
+ * refuses image models outright ("image generation models are not currently
20
+ * supported"), so a tool that only spoke to Ollama would have no backend at all
21
+ * on Linux.
22
+ */
23
+ import { type AgentTool } from "@cerebriline/shared";
24
+ import { normalizeBaseUrl } from "./media-endpoint";
25
+ export { normalizeBaseUrl };
26
+ /**
27
+ * A text part, optionally followed by an image the model can actually see.
28
+ *
29
+ * Declared here as it is in `browser.ts`, and for the same reason: this is the
30
+ * shape a tool result takes, not something `@cerebriline/shared` publishes.
31
+ */
32
+ export type ToolOutput = string | Array<{
33
+ type: "text";
34
+ text: string;
35
+ } | {
36
+ type: "image";
37
+ data: string;
38
+ mediaType: string;
39
+ }>;
40
+ export declare const GENERATE_IMAGE_TOOL_NAME = "generate_image";
41
+ export declare const GENERATE_IMAGE_TOOL_DESCRIPTION = "Generate an image from a text description and save it into the workspace. Use it for visual work you would otherwise have to ask the user to do elsewhere: an app icon, a placeholder texture or sprite, a logo, a background, or a mockup of a layout or theme you are about to build.\n\nThe image is written to a file and, if you can see images, returned to you as well \u2014 so you can look at what you made and generate again with a changed prompt if it is wrong.\n\nArguments:\n- `prompt` \u2014 what to draw. Describe the subject, the style and the background. Say \"flat vector icon, solid background, no text\" rather than \"an icon\": these models render text badly, so ask for lettering only when you must.\n- `path` \u2014 where to save it, relative to the workspace. Optional; defaults to a file under `.cline/generated-images/`. Give a real path when the image is an asset the project will use.\n- `size` \u2014 `WxH` in pixels, e.g. `1024x1024`. Optional, and the backend may round it.\n\nThis costs real time \u2014 seconds to a minute per image \u2014 and on a hosted backend it costs money. Generate one image and look at it before generating variations.";
42
+ export declare const GENERATE_IMAGE_TOOL_INPUT_SCHEMA: {
43
+ readonly type: "object";
44
+ readonly properties: {
45
+ readonly prompt: {
46
+ readonly type: "string";
47
+ readonly description: "What to draw, including style and background. Be specific; avoid asking for text in the image.";
48
+ };
49
+ readonly path: {
50
+ readonly type: "string";
51
+ readonly description: "Where to save it, relative to the workspace. Optional; defaults to a file under .cline/generated-images/.";
52
+ };
53
+ readonly size: {
54
+ readonly type: "string";
55
+ readonly description: "Pixel size as \"WIDTHxHEIGHT\", e.g. \"1024x1024\". Optional.";
56
+ };
57
+ };
58
+ readonly required: readonly ["prompt"];
59
+ };
60
+ export interface GenerateImageToolInput {
61
+ prompt?: unknown;
62
+ path?: unknown;
63
+ size?: unknown;
64
+ }
65
+ /**
66
+ * Where images are generated and what to call the model there.
67
+ *
68
+ * Read per call rather than captured once: the settings behind these can change
69
+ * mid-session, and a tool built at session start would go on using the endpoint
70
+ * that was configured then.
71
+ */
72
+ export interface ImageGenerationEndpoint {
73
+ /** Base URL, with or without a trailing `/v1`. */
74
+ baseUrl: string;
75
+ model: string;
76
+ apiKey?: string;
77
+ /** Default for calls that do not ask for a size. */
78
+ size?: string;
79
+ }
80
+ /**
81
+ * The image models an OpenAI-compatible `/v1/models` listing offers.
82
+ *
83
+ * Every server answering that route returns `{data: [{id}]}`, and a plain one
84
+ * says nothing more -- so an entry that carries no hint is kept, because
85
+ * guessing which of a local server's models draws is worse than a longer list.
86
+ * Servers that do say get taken at their word: pollinations.ai returns 388
87
+ * models, of which 36 generate images, and a picker holding the other 352 is a
88
+ * picker nobody scrolls.
89
+ */
90
+ export declare function selectImageGenerationModels(payload: unknown): string[];
91
+ export interface GenerateImageToolOptions {
92
+ cwd: string;
93
+ /**
94
+ * May be asynchronous: a host that resolves the endpoint against the
95
+ * session's own provider has to ask that server what it serves.
96
+ */
97
+ getEndpoint: () => ImageGenerationEndpoint | undefined | Promise<ImageGenerationEndpoint | undefined>;
98
+ writeFile: (absolutePath: string, data: Buffer) => Promise<void>;
99
+ fetchImpl?: typeof fetch;
100
+ /** Milliseconds before a generation is abandoned. Defaults to 3 minutes. */
101
+ timeoutMs?: number;
102
+ onError?: (message: string, error: unknown) => void;
103
+ }
104
+ /**
105
+ * A filename that says what the image is.
106
+ *
107
+ * From the prompt rather than a counter, because these accumulate in a
108
+ * directory nobody curates and `image-4.png` tells you nothing a month later.
109
+ */
110
+ export declare function defaultImagePath(prompt: string, now: number): string;
111
+ /** What the bytes should be called, for the paths this tool chose itself. */
112
+ export declare function extensionForMediaType(mediaType: string): string;
113
+ /**
114
+ * Keep the written file inside the workspace.
115
+ *
116
+ * The path comes from the model, and `../../.ssh/authorized_keys` is a path.
117
+ * Resolved and compared rather than pattern-matched, so a symlinked prefix or a
118
+ * doubled separator cannot slip past.
119
+ */
120
+ export declare function resolveInsideWorkspace(cwd: string, relativePath: string): string | undefined;
121
+ /** `"1024x1024"` and nothing else -- a backend given nonsense returns nonsense. */
122
+ export declare function parseSize(size: unknown): string | undefined;
123
+ export interface ImagesApiResponse {
124
+ data?: Array<{
125
+ b64_json?: string;
126
+ url?: string;
127
+ /** What the bytes actually are, when the server bothers to say. */
128
+ media_type?: string;
129
+ revised_prompt?: string;
130
+ }>;
131
+ error?: {
132
+ message?: string;
133
+ } | string;
134
+ }
135
+ /**
136
+ * What the bytes are, according to the bytes.
137
+ *
138
+ * Trusted ahead of anything the server said, because most say nothing and one
139
+ * of them is wrong: `gen.pollinations.ai` answers `/v1/images/generations` with
140
+ * a JPEG in `b64_json` and no `media_type` at all. Assuming PNG there writes
141
+ * JPEG bytes into a `.png` and tells the model it is looking at a PNG.
142
+ */
143
+ export declare function sniffMediaType(data: Buffer): string | undefined;
144
+ export declare function readGeneratedImage(body: ImagesApiResponse, fetchImpl: typeof fetch, signal: AbortSignal | undefined): Promise<{
145
+ data: Buffer;
146
+ mediaType: string;
147
+ } | {
148
+ error: string;
149
+ }>;
150
+ /**
151
+ * Write the image and say what happened, for every tool that makes one.
152
+ *
153
+ * A path the model chose is the model's business, extension and all. One the
154
+ * tool made up says `.png` before anything knows what came back, and a vector
155
+ * model returns an SVG.
156
+ */
157
+ export declare function saveAndReportImage(input: {
158
+ image: {
159
+ data: Buffer;
160
+ mediaType: string;
161
+ };
162
+ /** "Generated" or "Edited": the first word of the report. */
163
+ verb: string;
164
+ askedPath: string | undefined;
165
+ requestedPath: string;
166
+ absolutePath: string;
167
+ size?: string;
168
+ revisedPrompt?: string;
169
+ writeFile: (absolutePath: string, data: Buffer) => Promise<void>;
170
+ context: {
171
+ metadata?: Record<string, unknown>;
172
+ emitUpdate?: (update: unknown) => void;
173
+ } | undefined;
174
+ }): Promise<ToolOutput>;
175
+ /**
176
+ * Create the `generate_image` tool.
177
+ *
178
+ * The host is expected to omit this tool entirely when no endpoint is
179
+ * configured; `getEndpoint` returning nothing is handled anyway, because the
180
+ * setting can be cleared while a session is running and the model would
181
+ * otherwise get a stack trace where an explanation belongs.
182
+ */
183
+ export declare function createGenerateImageTool(options: GenerateImageToolOptions): AgentTool;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Default Tools
3
+ *
4
+ * This module provides a set of configurable default tools for agents.
5
+ */
6
+ export { validateWithZod, zodToJsonSchema } from "@cerebriline/shared";
7
+ export { createPlanModeCommandGuardExtension, PLAN_MODE_COMMAND_GUARD_EXTENSION_NAME, type PlanModeCommandGuardOptions, } from "./command-guard-extension";
8
+ export { ALL_DEFAULT_TOOL_NAMES, DefaultToolNames } from "./constants";
9
+ export { createApplyPatchTool, createAskQuestionTool, createAwkTool, createDefaultTools, createEditorTool, createExtractDocumentTool, createGrepTool, createReadFilesTool, createSearchTool, createSedTool, createShellTool, createSkillsTool, createSubmitAndExitTool, createWebFetchTool, } from "./definitions";
10
+ export { type ApplyPatchExecutorOptions, type AwkExecutorOptions, CommandExitError, computePatchChanges, createApplyPatchExecutor, createAwkExecutor, createDefaultExecutors, createDefaultShellExecutor, createDocumentExtractExecutor, createEditorExecutor, createFileReadExecutor, createGrepExecutor, createReadReceipts, createSearchExecutor, createSedExecutor, createShellExecutor, createWebFetchExecutor, DEFAULT_EXTRACTION_DIR, type DefaultExecutorsOptions, DOCUMENT_EXTENSIONS, type DocumentExtractExecutorOptions, type EditorExecutorOptions, type FileReadExecutorOptions, type GrepExecutorOptions, PATCH_MARKERS, PatchActionType, type PatchFileChange, type ReadReceipts, RunCommandExecutionController, type RunningCommandRegistration, type SearchExecutorOptions, type SedExecutorOptions, type ShellExecutorOptions, type WebFetchExecutorOptions, } from "./executors/index";
11
+ export { MAX_COMMAND_OUTPUT_CHARS, MAX_READ_REFUSAL_CHARS, truncateCommandOutput, } from "./executors/output-limits";
12
+ export { DEFAULT_MODEL_TOOL_ROUTING_RULES, resolveToolRoutingConfig, type ToolRoutingRule, } from "./model-tool-routing";
13
+ export { createDefaultToolsWithPreset, createToolPoliciesWithPreset, resolveToolPresetName, type ToolPolicyPresetName, type ToolPresetName, ToolPresets, } from "./presets";
14
+ export { commandText, createSecretRedactor, describeQaCredentials, type NormalizedQaCredentials, normalizeQaCredentials, QA_CREDENTIAL_MIN_VALUE_LENGTH, QA_CREDENTIAL_NAME_PATTERN, type QaCredential, qaCredentialNames, type RejectedQaCredential, referencedCredentialNames, resolveCredentialEnv, } from "./qa-credentials";
15
+ export { type BuiltinToolAvailabilityContext, getCoreAcpToolNames, getCoreBuiltinToolCatalog, getCoreDefaultEnabledToolIds, getCoreHeadlessToolNames, isCoreBuiltinToolAvailable, isSkillsToolAvailable, resolveCoreSelectedToolIds, resolveToolClientType, type ToolCatalogEntry, type ToolClientType, } from "./runtime";
16
+ export { type ApplyPatchInput, ApplyPatchInputSchema, type AskQuestionInput, AskQuestionInputSchema, AwkInputSchema, type AwkToolInput, type EditFileInput, EditFileInputSchema, type ExtractDocumentInput, ExtractDocumentInputSchema, type FetchWebContentInput, FetchWebContentInputSchema, GrepInputSchema, type GrepToolInput, type ReadFileRequest, ReadFileRequestSchema, type ReadFilesInput, ReadFilesInputSchema, type RunCommandsInput, RunCommandsInputSchema, type SearchCodebaseInput, SearchCodebaseInputSchema, SedInputSchema, type SedToolInput, type SkillsInput, SkillsInputSchema, type StructuredCommandInput, StructuredCommandInputSchema, type SubmitInput, SubmitInputSchema, type WebFetchRequest, WebFetchRequestSchema, } from "./schemas";
17
+ export { buildTaskProgressReminder, buildTaskProgressState, DEFAULT_TASK_PROGRESS_REMINDER_INTERVAL, parseTaskProgress, readTaskProgress, TASK_PROGRESS_PARAM, TASK_PROGRESS_PARAM_DESCRIPTION, type TaskProgressItem, type TaskProgressState, TaskProgressTracker, type TaskProgressTrackerOptions, withTaskProgressCapture, withTaskProgressParam, } from "./task-progress";
18
+ export { TEAM_TOOL_NAMES } from "./team/team-tools";
19
+ export type { ApplyPatchExecutor, AskQuestionExecutor, AwkExecutor, CreateDefaultToolsOptions, DefaultToolName, DefaultToolsConfig, EditorExecutor, FileReadExecutor, GrepExecutor, SearchExecutor, SedExecutor, ShellExecutionOptions, ShellExecutor, SkillsExecutor, SkillsExecutorSkillMetadata, SkillsExecutorWithMetadata, ToolExecutors, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor, } from "./types";
20
+ import { type AgentTool } from "@cerebriline/shared";
21
+ import { type DefaultExecutorsOptions } from "./executors/index";
22
+ import type { CreateDefaultToolsOptions, ToolExecutors } from "./types";
23
+ /**
24
+ * Options for creating default tools with built-in executors
25
+ */
26
+ export interface CreateBuiltinToolsOptions extends Omit<CreateDefaultToolsOptions, "executors"> {
27
+ /**
28
+ * Configuration for the built-in executors. `bash.shell` is used when the
29
+ * top-level `shell` option is not set; the top-level option takes precedence.
30
+ */
31
+ executorOptions?: DefaultExecutorsOptions;
32
+ /**
33
+ * Optional executor overrides/additions for tools without built-ins.
34
+ * An overriding `bash` executor replaces the built-in one wholesale: it
35
+ * decides its own shell, and the resolved `shell` option only shapes the
36
+ * run_commands description. Overriders must honor that shell themselves
37
+ * to keep the description truthful.
38
+ */
39
+ executors?: Partial<ToolExecutors>;
40
+ }
41
+ /**
42
+ * Create default tools with built-in Node.js executors
43
+ *
44
+ * This is a convenience function that creates the default tools with
45
+ * working implementations using Node.js built-in modules.
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * import { Agent, createBuiltinTools } from "@cerebriline/core"
50
+ *
51
+ * const tools = createBuiltinTools({
52
+ * cwd: "/path/to/project",
53
+ * enableBash: true,
54
+ * enableWebFetch: false, // Disable web fetching
55
+ * executorOptions: {
56
+ * bash: { timeoutMs: 60000 },
57
+ * },
58
+ * })
59
+ *
60
+ * const agent = new Agent({
61
+ * providerId: "anthropic",
62
+ * modelId: "claude-sonnet-4-20250514",
63
+ * systemPrompt: "You are a coding assistant.",
64
+ * tools,
65
+ * })
66
+ * ```
67
+ */
68
+ export declare function createBuiltinTools(options?: CreateBuiltinToolsOptions): AgentTool[];
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Jev: a second opinion with a number on it.
3
+ *
4
+ * TypeSafe's System One model, Jev, is not a chat model. It takes a piece of
5
+ * text -- the "state" -- and a set of typed questions, and answers each with a
6
+ * probability: a yes/no (`noul`), a pick among options you name (`choice`), or
7
+ * a rating on levels you name (`score`). Choice and score answers also carry a
8
+ * confidence derived from the distribution. It writes no prose, so it cannot
9
+ * explain an answer; what it gives is the one thing a coding model is bad at
10
+ * reporting about itself, which is how sure to be.
11
+ *
12
+ * Three consumers, one client:
13
+ * - the `jev` tool, which the model calls when it is unsure of a reading, a
14
+ * fact or a choice (the rule that tells it when is the host's);
15
+ * - {@link rankQuestionOptions}, which the host runs over a model-authored
16
+ * `ask_question` before the user sees it;
17
+ * - {@link appraiseEscalation}, which scores a task about to be handed to the
18
+ * expert, for the assessment the user and the expert both read.
19
+ *
20
+ * What the documentation says to design around, and this file does
21
+ * (docs/knowledge-base/jev):
22
+ * - Questions in one request run in parallel and the state is billed once:
23
+ * thirteen questions in one call measured ~12x cheaper and ~10x faster than
24
+ * thirteen calls. So every consumer here asks everything in one request.
25
+ * - The state plus the longest question must fit 32k tokens, and irrelevant
26
+ * context lowers accuracy. So the state is bounded and made of named parts.
27
+ * - A noul has no confidence field; its value is the signal. Here it gets the
28
+ * same two-outcome confidence a choice between yes and no would, `2p - 1`
29
+ * for the likelier side, so one floor reads all three kinds.
30
+ * - It is literal and weak at arithmetic and multi-hop reasoning, and text in
31
+ * the state can steer it. Its answers are evidence, never an instruction,
32
+ * and everything here words them that way.
33
+ */
34
+ import { type AgentTool } from "@cerebriline/shared";
35
+ export declare const JEV_TOOL_NAME = "jev";
36
+ export declare const JEV_DEFAULT_BASE_URL = "https://api.typesafe.ai/v1";
37
+ export declare const JEV_DEFAULT_MODEL = "jev-latest";
38
+ /** The documented starting point for confidence-gated routing. */
39
+ export declare const JEV_DEFAULT_FLOOR = 0.6;
40
+ /** The documented bar for decisions that are costly to get wrong. */
41
+ export declare const JEV_DEFAULT_HIGH_STAKES_FLOOR = 0.85;
42
+ export declare const JEV_DEFAULT_TIMEOUT_MS = 15000;
43
+ /**
44
+ * A ceiling on each named part of a state, in characters.
45
+ *
46
+ * The documented bound is 32k tokens for the state plus the longest question,
47
+ * and no tokenizer is published, so this cannot be checked exactly. At the
48
+ * usual ~4 characters a token, six parts at this size stay well inside it.
49
+ */
50
+ export declare const JEV_MAX_PART_CHARS = 12000;
51
+ export declare const JEV_MAX_QUESTIONS = 10;
52
+ /**
53
+ * Which server's rules an endpoint follows.
54
+ *
55
+ * Ollama (0.35 and later, and xollama) serves the same request and answer at
56
+ * `/v1/systemone`, field for field, and computes score and confidence the same
57
+ * way. What differs is what it accepts and how it refuses (decision/ and
58
+ * server/routes.go upstream): the body is capped at 64 KiB, a choice at 26
59
+ * options, errors are 400/404/413 with `{"error": …}` instead of 401/422/429/529,
60
+ * no key is needed, and only a local model it has pulled can answer.
61
+ */
62
+ export type JevDialect = "typesafe" | "ollama";
63
+ /** Where Jev is and how sure an answer has to be before it counts. */
64
+ export interface JevEndpoint {
65
+ /** Sent as a bearer token when set. TypeSafe needs one; Ollama none. */
66
+ apiKey?: string;
67
+ /**
68
+ * Defaults to {@link JEV_DEFAULT_BASE_URL}. A custom one may be a server
69
+ * root (`http://host:11434`), its `/v1`, or the full `/v1/systemone`.
70
+ */
71
+ baseUrl?: string;
72
+ /** Known ahead, for tests; otherwise found by {@link detectJevDialect}. */
73
+ dialect?: JevDialect;
74
+ /** Defaults to {@link JEV_DEFAULT_MODEL}. Pin a version to keep tuned floors valid. */
75
+ model?: string;
76
+ /** Confidence at or above which an answer is acted on. */
77
+ floor?: number;
78
+ /** The same, for a question the caller marks as costly to get wrong. */
79
+ highStakesFloor?: number;
80
+ timeoutMs?: number;
81
+ }
82
+ export type JevQuestion = {
83
+ type: "noul";
84
+ instructions: unknown;
85
+ criteria?: {
86
+ true?: unknown;
87
+ false?: unknown;
88
+ };
89
+ } | {
90
+ type: "choice";
91
+ instructions: unknown;
92
+ criteria: Record<string, unknown>;
93
+ } | {
94
+ type: "score";
95
+ instructions: unknown;
96
+ criteria: unknown[];
97
+ };
98
+ export type JevAnswer = {
99
+ type: "noul";
100
+ noul: number;
101
+ } | {
102
+ type: "choice";
103
+ choice: string;
104
+ probabilities: Record<string, number>;
105
+ confidence: number;
106
+ } | {
107
+ type: "score";
108
+ score: number;
109
+ legend?: Record<string, string>;
110
+ probabilities: Record<string, number>;
111
+ confidence: number;
112
+ };
113
+ export interface JevResponse {
114
+ model: string;
115
+ answers: Record<string, JevAnswer>;
116
+ usage?: {
117
+ input_tokens?: number;
118
+ output_tokens?: number;
119
+ };
120
+ }
121
+ export interface JevCallOptions {
122
+ signal?: AbortSignal;
123
+ fetchImpl?: typeof fetch;
124
+ /** Waits between retries, for tests. */
125
+ sleep?: (ms: number) => Promise<void>;
126
+ }
127
+ /** A failed Jev call, worded for whoever has to act on it. */
128
+ export declare class JevError extends Error {
129
+ readonly status?: number | undefined;
130
+ constructor(message: string, status?: number | undefined);
131
+ }
132
+ /** Ollama's `http.MaxBytesReader` on `/v1/systemone`. */
133
+ export declare const OLLAMA_JEV_MAX_BODY_BYTES: number;
134
+ /** Ollama answers each option with one letter, A to Z. */
135
+ export declare const OLLAMA_JEV_MAX_OPTIONS = 26;
136
+ /** The URLs an endpoint is called at. */
137
+ export interface JevRoutes {
138
+ systemone: string;
139
+ models: string;
140
+ /** The server root, where Ollama answers `/api/version` and `/api/tags`. */
141
+ root: string;
142
+ /** Anything but TypeSafe's own API. */
143
+ custom: boolean;
144
+ }
145
+ /**
146
+ * Where to call, from what the user typed.
147
+ *
148
+ * TypeSafe's SDK takes the API base (`…/v1`), Ollama's blog post the server
149
+ * root (`TYPESAFE_BASE_URL=http://localhost:11434`), and a pasted curl line the
150
+ * full path. All three name one endpoint, so all three are accepted.
151
+ */
152
+ export declare function resolveJevRoutes(baseUrl?: string): JevRoutes;
153
+ /** Forget what was learned about each endpoint, for tests. */
154
+ export declare function resetJevDialectCache(): void;
155
+ /**
156
+ * Whether an endpoint is TypeSafe's or Ollama's, asked of the server.
157
+ *
158
+ * TypeSafe's own URL needs no asking. Any other is asked once for
159
+ * `/api/version`, which every Ollama answers and nothing else does; the answer
160
+ * is kept per server. A probe that could not connect is not kept, so a server
161
+ * started after the first call is still recognised, and until then the call
162
+ * goes out under TypeSafe's rules, which only means looser bounds.
163
+ */
164
+ export declare function detectJevDialect(endpoint: Pick<JevEndpoint, "baseUrl" | "dialect">, options?: Pick<JevCallOptions, "fetchImpl" | "signal">): Promise<JevDialect>;
165
+ /**
166
+ * One evaluation: a state and its questions, answered.
167
+ *
168
+ * Retries only what the API says to retry, a 429 or a 529, and inside one
169
+ * deadline for the whole call rather than per attempt: the SDK's default of 10 s
170
+ * an attempt with two retries is 30 s nobody budgeted for, and every caller
171
+ * here is holding up either a question to the user or an escalation.
172
+ */
173
+ export declare function evaluateJev(endpoint: JevEndpoint, request: {
174
+ state: unknown;
175
+ questions: Record<string, JevQuestion>;
176
+ }, options?: JevCallOptions): Promise<JevResponse>;
177
+ /**
178
+ * The decision models an endpoint serves, for the Jev tab's picker.
179
+ *
180
+ * Ollama lists every model it has, so only those whose `capabilities` include
181
+ * `decision` are offered (`/api/tags`; its `/v1/models` carries no
182
+ * capabilities). TypeSafe's `/v1/models` is `{models: [{name}]}`; an
183
+ * OpenAI-shaped `{data: [{id}]}` from another compatible server is read too.
184
+ * Empty on any failure: the field still takes a typed name.
185
+ */
186
+ export declare function listJevModels(endpoint: Pick<JevEndpoint, "apiKey" | "baseUrl" | "dialect">, options?: Pick<JevCallOptions, "fetchImpl" | "signal">): Promise<string[]>;
187
+ /**
188
+ * How sure an answer is, on one 0-1 scale for all three kinds.
189
+ *
190
+ * Choice and score carry their own. A noul is a choice between two outcomes,
191
+ * so it gets the two-outcome form of the same measure: `2·p − 1` for the
192
+ * likelier side, 0 at a coin flip and 1 at certainty. At the default floor of
193
+ * 0.6 that asks for p ≥ 0.8 either way, which is where the documentation's own
194
+ * examples draw the yes and no bands.
195
+ */
196
+ export declare function jevConfidence(answer: JevAnswer): number;
197
+ /** Cut a state part to its ceiling, keeping the head and the tail. */
198
+ export declare function boundJevText(text: string, max?: number): string;
199
+ export declare const JEV_TOOL_DESCRIPTION = "Get a calibrated confidence score from Jev, an external scoring model, before acting on something you are not sure of. Jev reads the context you give it and answers typed questions with probabilities; it writes no text and cannot explain itself.\n\nUse it when you are unsure:\n- whether you understood the user's request \u2014 ask whether the request is ambiguous, or which of your readings it means;\n- whether a fact your answer rests on is supported by what you have read \u2014 put the source text in the context and ask whether it states the claim;\n- which approach, option or file to choose;\n- how complex the task is, before deciding to escalate or delegate it.\n\nArguments:\n- `context` \u2014 the situation, in plain text: what the user asked, what you found, what you are deciding. Only what the questions need; unrelated text makes the answers worse.\n- `questions` \u2014 1 to 10, all asked in one call. Each has an `id`, a `kind` and a `question`:\n - `yes_no` \u2014 a yes/no question. Returns the probability of yes.\n - `choice` \u2014 pick one of `options` (2 to 50). Include a \"none of these\" option when that is possible: a choice always picks something.\n - `score` \u2014 rate on `levels` (2 to 10, lowest first).\n Set `high_stakes: true` on a question whose wrong answer is costly; it must clear a higher bar.\n\nEach answer comes back as confident or unsure against the user's confidence floor. Act on a confident answer. On an unsure one, verify it yourself or ask the user \u2014 do not treat it as settled. Jev is weak at arithmetic, counting and multi-step reasoning, so check those in code, and ask one property per question rather than one broad question.";
200
+ export declare const JEV_TOOL_INPUT_SCHEMA: {
201
+ readonly type: "object";
202
+ readonly properties: {
203
+ readonly context: {
204
+ readonly type: "string";
205
+ readonly description: "The situation Jev should judge: the request, the evidence, the decision. Only what the questions need.";
206
+ };
207
+ readonly questions: {
208
+ readonly type: "array";
209
+ readonly description: "1 to 10 questions, answered together.";
210
+ readonly items: {
211
+ readonly type: "object";
212
+ readonly properties: {
213
+ readonly id: {
214
+ readonly type: "string";
215
+ readonly description: "A short name for the question; the answer comes back under it.";
216
+ };
217
+ readonly kind: {
218
+ readonly type: "string";
219
+ readonly enum: readonly ["yes_no", "choice", "score"];
220
+ };
221
+ readonly question: {
222
+ readonly type: "string";
223
+ };
224
+ readonly options: {
225
+ readonly type: "array";
226
+ readonly items: {
227
+ readonly type: "string";
228
+ };
229
+ readonly description: "For `choice`: the options, 2 to 50.";
230
+ };
231
+ readonly levels: {
232
+ readonly type: "array";
233
+ readonly items: {
234
+ readonly type: "string";
235
+ };
236
+ readonly description: "For `score`: the levels, lowest first, 2 to 10.";
237
+ };
238
+ readonly high_stakes: {
239
+ readonly type: "boolean";
240
+ readonly description: "Hold this answer to the higher confidence bar.";
241
+ };
242
+ };
243
+ readonly required: readonly ["id", "kind", "question"];
244
+ };
245
+ };
246
+ };
247
+ readonly required: readonly ["context", "questions"];
248
+ };
249
+ interface ToolQuestion {
250
+ id: string;
251
+ kind: "yes_no" | "choice" | "score";
252
+ question: string;
253
+ options?: string[];
254
+ levels?: string[];
255
+ highStakes: boolean;
256
+ }
257
+ /** The model's questions, checked, or the reason they cannot be asked. */
258
+ export declare function readJevToolQuestions(value: unknown): {
259
+ questions: ToolQuestion[];
260
+ } | {
261
+ error: string;
262
+ };
263
+ /** One answer, worded for the model, with its verdict against the floor. */
264
+ export declare function describeJevAnswer(question: ToolQuestion, answer: JevAnswer | undefined, floor: number): {
265
+ line: string;
266
+ sure: boolean;
267
+ };
268
+ export interface JevToolOptions {
269
+ /** Read per call; nothing means Jev is not configured. */
270
+ getEndpoint: () => JevEndpoint | undefined;
271
+ fetchImpl?: typeof fetch;
272
+ onError?: (message: string, error: unknown) => void;
273
+ }
274
+ /**
275
+ * Create the `jev` tool.
276
+ *
277
+ * The host omits it when Jev is not enabled or has no key; an endpoint that
278
+ * disappears mid-session is still answered in words rather than a stack trace.
279
+ */
280
+ export declare function createJevTool(options: JevToolOptions): AgentTool;
281
+ /** Options under this share of the probability are dropped. */
282
+ export declare const JEV_DROP_BELOW = 0.05;
283
+ export interface RankedOptions {
284
+ /** What the user is shown, in the model's order, one marked recommended at most. */
285
+ options: string[];
286
+ /** The options Jev put under {@link JEV_DROP_BELOW}, as the model wrote them. */
287
+ dropped: string[];
288
+ /** The option marked recommended, if any cleared the floor. */
289
+ recommended?: string;
290
+ confidence: number;
291
+ /** One line per option the user sees, for the question text. */
292
+ scores: {
293
+ option: string;
294
+ probability: number;
295
+ }[];
296
+ }
297
+ /**
298
+ * Apply Jev's answer to a question's options.
299
+ *
300
+ * Pure, so the rules are testable without a network: drop what Jev puts under
301
+ * 5%, but never below two options, since a question with one answer is not a
302
+ * question; recommend the top option only when the answer clears the floor,
303
+ * and then replace the model's own mark rather than add a second one, because
304
+ * the webview only honours a marker that appears exactly once.
305
+ */
306
+ export declare function applyOptionRanking(options: readonly string[], probabilities: Readonly<Record<string, number>>, confidence: number, floor: number): RankedOptions;
307
+ /**
308
+ * Ask Jev which of a question's options the user is most likely to want.
309
+ *
310
+ * One choice question over the options, judged against the conversation the
311
+ * host passes in. The options go in bare: a model's own "(recommended)" mark
312
+ * is exactly the kind of text in a state that steers the answer.
313
+ */
314
+ export declare function rankQuestionOptions(endpoint: JevEndpoint, input: {
315
+ conversation: string;
316
+ question: string;
317
+ options: readonly string[];
318
+ }, call?: JevCallOptions): Promise<RankedOptions>;
319
+ /** The scores as a markdown footer for the question the user is shown. */
320
+ export declare function describeOptionRanking(ranked: RankedOptions): string;
321
+ export declare const JEV_COMPLEXITY_LEVELS: readonly ["Trivial: a one-line or mechanical change", "Routine: a clear change in one or two places", "Involved: several parts must change together, with some design judgement", "Hard: subtle behaviour, many interacting parts, or unclear requirements", "Very hard: needs deep expertise or research to get right"];
322
+ /**
323
+ * Score a task about to be escalated, worded as lines for the assessment.
324
+ *
325
+ * Two questions in one call: how complex the task is, and whether the run so
326
+ * far looks stuck rather than progressing. Both are Jev's reading of the text it
327
+ * was given -- the user's task, the model's own reason, the harness's counts --
328
+ * and the lines say so, beside the measured ones rather than above them.
329
+ */
330
+ export declare function appraiseEscalation(endpoint: JevEndpoint, input: {
331
+ task?: string;
332
+ goal?: string;
333
+ reason?: string;
334
+ measured?: string;
335
+ }, call?: JevCallOptions): Promise<string[]>;
336
+ export {};