@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.
- package/LICENSE +201 -0
- package/README.md +16 -0
- package/assets/office-oxide/LICENSE-APACHE +176 -0
- package/assets/office-oxide/LICENSE-MIT +25 -0
- package/assets/office-oxide/office_oxide_bg.wasm +0 -0
- package/assets/prompt-templates/claude.md +516 -0
- package/assets/prompt-templates/deepseek.md +331 -0
- package/assets/prompt-templates/default.md +386 -0
- package/assets/prompt-templates/gemma.md +352 -0
- package/assets/prompt-templates/glm.md +334 -0
- package/assets/prompt-templates/kimi-k3.md +408 -0
- package/assets/prompt-templates/kimi.md +402 -0
- package/assets/prompt-templates/minimax.md +473 -0
- package/assets/prompt-templates/nemotron.md +358 -0
- package/assets/prompt-templates/qwen.md +612 -0
- package/dist/ClineCore.d.ts +365 -0
- package/dist/account/cline-account-service.d.ts +41 -0
- package/dist/account/index.d.ts +3 -0
- package/dist/account/rpc.d.ts +40 -0
- package/dist/account/types.d.ts +122 -0
- package/dist/auth/bounded-ttl-cache.d.ts +13 -0
- package/dist/auth/client.d.ts +30 -0
- package/dist/auth/cline.d.ts +71 -0
- package/dist/auth/codex.d.ts +40 -0
- package/dist/auth/oca.d.ts +21 -0
- package/dist/auth/provider-auth-registry.d.ts +52 -0
- package/dist/auth/server.d.ts +54 -0
- package/dist/auth/types.d.ts +103 -0
- package/dist/auth/utils.d.ts +31 -0
- package/dist/cline-core/automation.d.ts +34 -0
- package/dist/cline-core/runtime-services.d.ts +5 -0
- package/dist/cline-core/start-input.d.ts +10 -0
- package/dist/cline-core/telemetry.d.ts +10 -0
- package/dist/cline-core/types.d.ts +236 -0
- package/dist/cron/events/cron-event-ingress.d.ts +37 -0
- package/dist/cron/reports/cron-report-writer.d.ts +42 -0
- package/dist/cron/runner/cron-materializer.d.ts +35 -0
- package/dist/cron/runner/cron-runner.d.ts +60 -0
- package/dist/cron/runner/resource-limiter.d.ts +8 -0
- package/dist/cron/schedule/scheduler.d.ts +12 -0
- package/dist/cron/service/cron-service.d.ts +56 -0
- package/dist/cron/service/schedule-command-service.d.ts +14 -0
- package/dist/cron/service/schedule-service.d.ts +116 -0
- package/dist/cron/service/schedule-tool.d.ts +81 -0
- package/dist/cron/specs/cron-reconciler.d.ts +61 -0
- package/dist/cron/specs/cron-spec-parser.d.ts +26 -0
- package/dist/cron/specs/cron-watcher.d.ts +22 -0
- package/dist/cron/store/cron-schema.d.ts +2 -0
- package/dist/cron/store/sqlite-cron-store.d.ts +261 -0
- package/dist/extensions/agent-plugin/agent-skill.d.ts +21 -0
- package/dist/extensions/agent-plugin/index.d.ts +4 -0
- package/dist/extensions/agent-plugin/loader.d.ts +10 -0
- package/dist/extensions/agent-plugin/types.d.ts +67 -0
- package/dist/extensions/complexity/grammars.d.ts +92 -0
- package/dist/extensions/complexity/walker.d.ts +115 -0
- package/dist/extensions/config/builtin-templates.d.ts +10 -0
- package/dist/extensions/config/builtin-templates.generated.d.ts +5 -0
- package/dist/extensions/config/index.d.ts +15 -0
- package/dist/extensions/config/prompt-template-compaction.d.ts +92 -0
- package/dist/extensions/config/prompt-template-delta.d.ts +107 -0
- package/dist/extensions/config/prompt-template-hooks.d.ts +47 -0
- package/dist/extensions/config/prompt-template-loader.d.ts +79 -0
- package/dist/extensions/config/prompt-template-parser.d.ts +56 -0
- package/dist/extensions/config/prompt-template-review.d.ts +327 -0
- package/dist/extensions/config/prompt-template-session.d.ts +46 -0
- package/dist/extensions/config/runtime-commands.d.ts +23 -0
- package/dist/extensions/config/shipped-tool-signatures.d.ts +36 -0
- package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
- package/dist/extensions/config/unified-config-file-watcher.d.ts +77 -0
- package/dist/extensions/config/user-instruction-config-loader.d.ts +77 -0
- package/dist/extensions/config/user-instruction-plugin.d.ts +26 -0
- package/dist/extensions/config/user-instruction-service.d.ts +31 -0
- package/dist/extensions/context/agentic-compaction.d.ts +129 -0
- package/dist/extensions/context/basic-compaction.d.ts +19 -0
- package/dist/extensions/context/budget-projection/index.d.ts +2 -0
- package/dist/extensions/context/budget-projection/project.d.ts +4 -0
- package/dist/extensions/context/budget-projection/types.d.ts +58 -0
- package/dist/extensions/context/capped-thinking.d.ts +195 -0
- package/dist/extensions/context/compaction-cause.d.ts +27 -0
- package/dist/extensions/context/compaction-journal.d.ts +65 -0
- package/dist/extensions/context/compaction-revisions.d.ts +72 -0
- package/dist/extensions/context/compaction-shared.d.ts +608 -0
- package/dist/extensions/context/compaction.d.ts +161 -0
- package/dist/extensions/context/context-minimum-warning.d.ts +27 -0
- package/dist/extensions/context/continuation-compaction.d.ts +260 -0
- package/dist/extensions/context/council-compaction.d.ts +262 -0
- package/dist/extensions/context/full-compaction.d.ts +44 -0
- package/dist/extensions/context/kv-pressure.d.ts +258 -0
- package/dist/extensions/context/polykv-session.d.ts +372 -0
- package/dist/extensions/context/replay-compaction.d.ts +90 -0
- package/dist/extensions/context/tool-ledger.d.ts +198 -0
- package/dist/extensions/context/work-digest.d.ts +92 -0
- package/dist/extensions/index.d.ts +7 -0
- package/dist/extensions/mcp/client.d.ts +28 -0
- package/dist/extensions/mcp/config-loader.d.ts +102 -0
- package/dist/extensions/mcp/index.d.ts +15 -0
- package/dist/extensions/mcp/manager.d.ts +23 -0
- package/dist/extensions/mcp/name-transform.d.ts +2 -0
- package/dist/extensions/mcp/oauth.d.ts +68 -0
- package/dist/extensions/mcp/plugin-server-registration.d.ts +18 -0
- package/dist/extensions/mcp/policies.d.ts +14 -0
- package/dist/extensions/mcp/remote-proxy.d.ts +9 -0
- package/dist/extensions/mcp/timeout.d.ts +2 -0
- package/dist/extensions/mcp/tools.d.ts +3 -0
- package/dist/extensions/mcp/types.d.ts +133 -0
- package/dist/extensions/plugin/plugin-config-loader.d.ts +44 -0
- package/dist/extensions/plugin/plugin-load-report.d.ts +18 -0
- package/dist/extensions/plugin/plugin-loader.d.ts +23 -0
- package/dist/extensions/plugin/plugin-module-import.d.ts +4 -0
- package/dist/extensions/plugin/plugin-sandbox.d.ts +82 -0
- package/dist/extensions/plugin/plugin-targeting.d.ts +6 -0
- package/dist/extensions/plugin-sandbox-bootstrap.js +1 -0
- package/dist/extensions/tools/ask-lsp.d.ts +150 -0
- package/dist/extensions/tools/audio-tools.d.ts +156 -0
- package/dist/extensions/tools/browser.d.ts +137 -0
- package/dist/extensions/tools/check-file.d.ts +218 -0
- package/dist/extensions/tools/check-on-failure.d.ts +49 -0
- package/dist/extensions/tools/code-intel.d.ts +131 -0
- package/dist/extensions/tools/command-guard-extension.d.ts +22 -0
- package/dist/extensions/tools/command-guard.d.ts +29 -0
- package/dist/extensions/tools/constants.d.ts +28 -0
- package/dist/extensions/tools/definitions.d.ts +178 -0
- package/dist/extensions/tools/delimiter-balance.d.ts +121 -0
- package/dist/extensions/tools/edit-verification.d.ts +86 -0
- package/dist/extensions/tools/error-locations.d.ts +53 -0
- package/dist/extensions/tools/executors/apply-patch-parser.d.ts +68 -0
- package/dist/extensions/tools/executors/apply-patch.d.ts +48 -0
- package/dist/extensions/tools/executors/awk-parser.d.ts +163 -0
- package/dist/extensions/tools/executors/awk.d.ts +41 -0
- package/dist/extensions/tools/executors/bash.d.ts +119 -0
- package/dist/extensions/tools/executors/document/assets.d.ts +22 -0
- package/dist/extensions/tools/executors/document/ebook.d.ts +11 -0
- package/dist/extensions/tools/executors/document/formats.d.ts +83 -0
- package/dist/extensions/tools/executors/document/images.d.ts +73 -0
- package/dist/extensions/tools/executors/document/legacy.d.ts +20 -0
- package/dist/extensions/tools/executors/document/ocr.d.ts +67 -0
- package/dist/extensions/tools/executors/document/office-oxide.d.ts +19 -0
- package/dist/extensions/tools/executors/document/office-oxide.generated.d.ts +82 -0
- package/dist/extensions/tools/executors/document/office.d.ts +10 -0
- package/dist/extensions/tools/executors/document/pdf.d.ts +6 -0
- package/dist/extensions/tools/executors/document/pdfjs.d.ts +30 -0
- package/dist/extensions/tools/executors/document/range.d.ts +18 -0
- package/dist/extensions/tools/executors/document/recognition.d.ts +67 -0
- package/dist/extensions/tools/executors/document-extract.d.ts +55 -0
- package/dist/extensions/tools/executors/editor.d.ts +68 -0
- package/dist/extensions/tools/executors/file-locks.d.ts +41 -0
- package/dist/extensions/tools/executors/file-read.d.ts +136 -0
- package/dist/extensions/tools/executors/grep.d.ts +35 -0
- package/dist/extensions/tools/executors/index.d.ts +97 -0
- package/dist/extensions/tools/executors/line-endings.d.ts +23 -0
- package/dist/extensions/tools/executors/output-limits.d.ts +58 -0
- package/dist/extensions/tools/executors/overlay-receipts.d.ts +25 -0
- package/dist/extensions/tools/executors/posix-regex.d.ts +52 -0
- package/dist/extensions/tools/executors/read-receipts.d.ts +93 -0
- package/dist/extensions/tools/executors/run-command-execution-controller.d.ts +16 -0
- package/dist/extensions/tools/executors/search.d.ts +50 -0
- package/dist/extensions/tools/executors/sed.d.ts +92 -0
- package/dist/extensions/tools/executors/unchanged-reads.d.ts +55 -0
- package/dist/extensions/tools/executors/web-fetch.d.ts +58 -0
- package/dist/extensions/tools/helpers.d.ts +59 -0
- package/dist/extensions/tools/image-edit.d.ts +76 -0
- package/dist/extensions/tools/image-generation.d.ts +183 -0
- package/dist/extensions/tools/index.d.ts +68 -0
- package/dist/extensions/tools/jev.d.ts +336 -0
- package/dist/extensions/tools/list-files.d.ts +128 -0
- package/dist/extensions/tools/media-endpoint.d.ts +160 -0
- package/dist/extensions/tools/media-tools.d.ts +140 -0
- package/dist/extensions/tools/model-tool-routing.d.ts +33 -0
- package/dist/extensions/tools/presets.d.ts +154 -0
- package/dist/extensions/tools/qa-credentials.d.ts +133 -0
- package/dist/extensions/tools/runtime.d.ts +39 -0
- package/dist/extensions/tools/schemas.d.ts +845 -0
- package/dist/extensions/tools/task-progress.d.ts +217 -0
- package/dist/extensions/tools/team/agent-admission.d.ts +127 -0
- package/dist/extensions/tools/team/agent-check.d.ts +152 -0
- package/dist/extensions/tools/team/agent-controls.d.ts +55 -0
- package/dist/extensions/tools/team/agent-file.d.ts +28 -0
- package/dist/extensions/tools/team/agent-iteration-cap.d.ts +328 -0
- package/dist/extensions/tools/team/agent-names.d.ts +29 -0
- package/dist/extensions/tools/team/agent-node-placement.d.ts +160 -0
- package/dist/extensions/tools/team/agent-placement-queue.d.ts +199 -0
- package/dist/extensions/tools/team/agent-placement.d.ts +118 -0
- package/dist/extensions/tools/team/agent-reports.d.ts +53 -0
- package/dist/extensions/tools/team/agent-rounds.d.ts +666 -0
- package/dist/extensions/tools/team/agent-sandbox-executors.d.ts +79 -0
- package/dist/extensions/tools/team/agent-slot-gate.d.ts +186 -0
- package/dist/extensions/tools/team/agent-status.d.ts +84 -0
- package/dist/extensions/tools/team/agent-trouble.d.ts +91 -0
- package/dist/extensions/tools/team/background-delegations.d.ts +106 -0
- package/dist/extensions/tools/team/batch-report.d.ts +151 -0
- package/dist/extensions/tools/team/configured-agent-config.d.ts +37 -0
- package/dist/extensions/tools/team/configured-agent-tool.d.ts +135 -0
- package/dist/extensions/tools/team/create-agent-tool.d.ts +45 -0
- package/dist/extensions/tools/team/delegate-to-agent.d.ts +105 -0
- package/dist/extensions/tools/team/delegated-agent.d.ts +272 -0
- package/dist/extensions/tools/team/delegated-sandboxes.d.ts +125 -0
- package/dist/extensions/tools/team/delegated-tools.d.ts +40 -0
- package/dist/extensions/tools/team/delegation-call-hooks.d.ts +30 -0
- package/dist/extensions/tools/team/engine-evictions.d.ts +38 -0
- package/dist/extensions/tools/team/index.d.ts +20 -0
- package/dist/extensions/tools/team/lead-agent-tools.d.ts +92 -0
- package/dist/extensions/tools/team/multi-agent.d.ts +364 -0
- package/dist/extensions/tools/team/node-reachability.d.ts +53 -0
- package/dist/extensions/tools/team/node-throughput.d.ts +40 -0
- package/dist/extensions/tools/team/placed-run.d.ts +114 -0
- package/dist/extensions/tools/team/projections.d.ts +8 -0
- package/dist/extensions/tools/team/runtime.d.ts +6 -0
- package/dist/extensions/tools/team/session-window-retry.d.ts +28 -0
- package/dist/extensions/tools/team/spawn-agent-tool.d.ts +450 -0
- package/dist/extensions/tools/team/spawn-sampling.d.ts +188 -0
- package/dist/extensions/tools/team/spawn-swarm-tool.d.ts +330 -0
- package/dist/extensions/tools/team/subagent-cancellation.d.ts +188 -0
- package/dist/extensions/tools/team/subagent-layout.d.ts +90 -0
- package/dist/extensions/tools/team/subagent-output.d.ts +73 -0
- package/dist/extensions/tools/team/subagent-progress.d.ts +211 -0
- package/dist/extensions/tools/team/subagent-prompts.d.ts +3 -0
- package/dist/extensions/tools/team/team-state-dates.d.ts +10 -0
- package/dist/extensions/tools/team/team-tools.d.ts +56 -0
- package/dist/extensions/tools/team/teammates-off.d.ts +14 -0
- package/dist/extensions/tools/team/token-split.d.ts +28 -0
- package/dist/extensions/tools/team/turn-fault-recovery.d.ts +71 -0
- package/dist/extensions/tools/types.d.ts +410 -0
- package/dist/extensions/tools/video-generation.d.ts +94 -0
- package/dist/hooks/checkpoint-hooks.d.ts +39 -0
- package/dist/hooks/hook-extension.d.ts +2 -0
- package/dist/hooks/hook-file-config.d.ts +24 -0
- package/dist/hooks/hook-file-hooks.d.ts +22 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/subprocess-runner.d.ts +21 -0
- package/dist/hooks/subprocess.d.ts +74 -0
- package/dist/hub/client/connect.d.ts +14 -0
- package/dist/hub/client/index.d.ts +146 -0
- package/dist/hub/client/managed-hub-build-watcher.d.ts +62 -0
- package/dist/hub/client/session-client.d.ts +138 -0
- package/dist/hub/client/ui-client.d.ts +52 -0
- package/dist/hub/daemon/entry.d.ts +15 -0
- package/dist/hub/daemon/entry.js +2033 -0
- package/dist/hub/daemon/index.d.ts +125 -0
- package/dist/hub/daemon/runtime-handlers.d.ts +12 -0
- package/dist/hub/daemon/shutdown-coordinator.d.ts +31 -0
- package/dist/hub/daemon/start-shared-server.d.ts +18 -0
- package/dist/hub/daemon/telemetry.d.ts +19 -0
- package/dist/hub/discovery/defaults.d.ts +16 -0
- package/dist/hub/discovery/index.d.ts +139 -0
- package/dist/hub/discovery/instance-lock.d.ts +51 -0
- package/dist/hub/discovery/workspace.d.ts +13 -0
- package/dist/hub/index.d.ts +38 -0
- package/dist/hub/index.js +2023 -0
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +83 -0
- package/dist/hub/runtime-host/remote-runtime-host.d.ts +9 -0
- package/dist/hub/server/browser-websocket.d.ts +22 -0
- package/dist/hub/server/command-transport.d.ts +29 -0
- package/dist/hub/server/handlers/approval-handlers.d.ts +24 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +12 -0
- package/dist/hub/server/handlers/client-handlers.d.ts +6 -0
- package/dist/hub/server/handlers/connector-handlers.d.ts +20 -0
- package/dist/hub/server/handlers/context.d.ts +98 -0
- package/dist/hub/server/handlers/run-handlers.d.ts +6 -0
- package/dist/hub/server/handlers/run-queue-handlers.d.ts +33 -0
- package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +30 -0
- package/dist/hub/server/hub-client-contributions.d.ts +19 -0
- package/dist/hub/server/hub-event-log.d.ts +57 -0
- package/dist/hub/server/hub-notifications.d.ts +7 -0
- package/dist/hub/server/hub-run-queue.d.ts +82 -0
- package/dist/hub/server/hub-schedule-events.d.ts +2 -0
- package/dist/hub/server/hub-server-logging.d.ts +2 -0
- package/dist/hub/server/hub-server-options.d.ts +94 -0
- package/dist/hub/server/hub-server-transport.d.ts +71 -0
- package/dist/hub/server/hub-session-records.d.ts +9 -0
- package/dist/hub/server/hub-websocket-server.d.ts +12 -0
- package/dist/hub/server/index.d.ts +4 -0
- package/dist/hub/server/native-transport.d.ts +25 -0
- package/dist/hub/server/task-command-service.d.ts +11 -0
- package/dist/index.d.ts +172 -0
- package/dist/index.js +5435 -0
- package/dist/logging/early-logger.d.ts +37 -0
- package/dist/remote-config/integration.d.ts +17 -0
- package/dist/runtime/atomic/base-revision-reads.d.ts +106 -0
- package/dist/runtime/atomic/base-revision.d.ts +77 -0
- package/dist/runtime/atomic/check-first-edits.d.ts +79 -0
- package/dist/runtime/atomic/file-revisions.d.ts +268 -0
- package/dist/runtime/atomic/oracle.d.ts +178 -0
- package/dist/runtime/atomic/page-check.d.ts +39 -0
- package/dist/runtime/atomic/plan-capture.d.ts +40 -0
- package/dist/runtime/atomic/plan-text.d.ts +33 -0
- package/dist/runtime/atomic/plan-tool.d.ts +159 -0
- package/dist/runtime/atomic/proposal.d.ts +112 -0
- package/dist/runtime/atomic/propose-check-tool.d.ts +76 -0
- package/dist/runtime/atomic/protocol.d.ts +233 -0
- package/dist/runtime/atomic/restore-file-tool.d.ts +196 -0
- package/dist/runtime/atomic/revision-capture.d.ts +75 -0
- package/dist/runtime/atomic/run-check-tool.d.ts +64 -0
- package/dist/runtime/atomic/session-protocol.d.ts +304 -0
- package/dist/runtime/atomic/session-revisions.d.ts +77 -0
- package/dist/runtime/atomic/snapshot.d.ts +77 -0
- package/dist/runtime/atomic/stalled-checks.d.ts +106 -0
- package/dist/runtime/atomic/submit-transaction-tool.d.ts +50 -0
- package/dist/runtime/atomic/tool-activity.d.ts +15 -0
- package/dist/runtime/atomic/transaction-controller.d.ts +364 -0
- package/dist/runtime/atomic/unparseable-change.d.ts +35 -0
- package/dist/runtime/capabilities/index.d.ts +2 -0
- package/dist/runtime/capabilities/normalize-runtime-capabilities.d.ts +2 -0
- package/dist/runtime/capabilities/runtime-capabilities.d.ts +18 -0
- package/dist/runtime/config/agent-message-codec.d.ts +6 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +93 -0
- package/dist/runtime/config/connection-update.d.ts +40 -0
- package/dist/runtime/escalation/a2a.d.ts +109 -0
- package/dist/runtime/escalation/assessment.d.ts +54 -0
- package/dist/runtime/escalation/brief.d.ts +70 -0
- package/dist/runtime/escalation/escalate-tool.d.ts +93 -0
- package/dist/runtime/escalation/escalation-controller.d.ts +62 -0
- package/dist/runtime/escalation/escalation-session.d.ts +241 -0
- package/dist/runtime/escalation/expert-failure.d.ts +20 -0
- package/dist/runtime/escalation/expert-guards.d.ts +46 -0
- package/dist/runtime/escalation/expert-mailbox.d.ts +34 -0
- package/dist/runtime/escalation/expert-notes.d.ts +115 -0
- package/dist/runtime/escalation/expert-prompt.d.ts +29 -0
- package/dist/runtime/escalation/expert-revisions.d.ts +62 -0
- package/dist/runtime/escalation/expert-session.d.ts +164 -0
- package/dist/runtime/escalation/expert-transcript.d.ts +32 -0
- package/dist/runtime/escalation/forced-escalation.d.ts +58 -0
- package/dist/runtime/escalation/stand-down.d.ts +66 -0
- package/dist/runtime/escalation/struggle-offer.d.ts +100 -0
- package/dist/runtime/escalation/watch-tool.d.ts +34 -0
- package/dist/runtime/host/history.d.ts +19 -0
- package/dist/runtime/host/host.d.ts +7 -0
- package/dist/runtime/host/local/agent-event-bridge.d.ts +50 -0
- package/dist/runtime/host/local/session-record.d.ts +6 -0
- package/dist/runtime/host/local/session-service-invoker.d.ts +4 -0
- package/dist/runtime/host/local/spawn-tool.d.ts +57 -0
- package/dist/runtime/host/local/user-files.d.ts +1 -0
- package/dist/runtime/host/local-runtime-host.d.ts +298 -0
- package/dist/runtime/host/runtime-host-support.d.ts +39 -0
- package/dist/runtime/host/runtime-host.d.ts +280 -0
- package/dist/runtime/host/steer-side-turn.d.ts +119 -0
- package/dist/runtime/orchestration/runtime-builder.d.ts +14 -0
- package/dist/runtime/orchestration/runtime-event-adapter.d.ts +104 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +28 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +339 -0
- package/dist/runtime/orchestration/session-runtime.d.ts +118 -0
- package/dist/runtime/orchestration/user-input-builder.d.ts +15 -0
- package/dist/runtime/process-start-token.d.ts +23 -0
- package/dist/runtime/safety/loop-detection.d.ts +160 -0
- package/dist/runtime/safety/mistake-tracker.d.ts +84 -0
- package/dist/runtime/safety/rules.d.ts +6 -0
- package/dist/runtime/safety/struggle-detector.d.ts +414 -0
- package/dist/runtime/safety/worker-struggle-stop.d.ts +20 -0
- package/dist/runtime/safety/worker-struggle.d.ts +166 -0
- package/dist/runtime/sandbox/agent-sandbox.d.ts +111 -0
- package/dist/runtime/sandbox/overlay-fs.d.ts +71 -0
- package/dist/runtime/sandbox/sandbox-binaries.d.ts +10 -0
- package/dist/runtime/tools/subprocess-sandbox-lifecycle.d.ts +9 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +62 -0
- package/dist/runtime/tools/tool-approval.d.ts +9 -0
- package/dist/runtime/turn-queue/harness-notes.d.ts +18 -0
- package/dist/runtime/turn-queue/pending-prompt-service.d.ts +117 -0
- package/dist/services/agent-events.d.ts +59 -0
- package/dist/services/config.d.ts +2 -0
- package/dist/services/connectors/active-connectors.d.ts +2 -0
- package/dist/services/connectors/connector-autostart.d.ts +33 -0
- package/dist/services/connectors/connector-child-env.d.ts +14 -0
- package/dist/services/connectors/connector-cleanup.d.ts +20 -0
- package/dist/services/connectors/connector-supervisor.d.ts +134 -0
- package/dist/services/connectors/daemon-connector-reconnect.d.ts +15 -0
- package/dist/services/feature-flags/FeatureFlagsService.d.ts +49 -0
- package/dist/services/feature-flags/index.d.ts +2 -0
- package/dist/services/feature-flags/posthog.d.ts +24 -0
- package/dist/services/feature-flags/posthog.js +1 -0
- package/dist/services/feature-flags/providers.d.ts +7 -0
- package/dist/services/global-settings.d.ts +113 -0
- package/dist/services/llms/apihandler-agent-model-adapter.d.ts +26 -0
- package/dist/services/llms/cline-recommended-models.d.ts +62 -0
- package/dist/services/llms/configured-provider-registry.d.ts +27 -0
- package/dist/services/llms/handler-factory.d.ts +23 -0
- package/dist/services/llms/provider-defaults.d.ts +36 -0
- package/dist/services/llms/provider-settings.d.ts +420 -0
- package/dist/services/llms/runtime-config.d.ts +3 -0
- package/dist/services/llms/runtime-registry.d.ts +19 -0
- package/dist/services/llms/runtime-types.d.ts +84 -0
- package/dist/services/llms/session-budget.d.ts +88 -0
- package/dist/services/local-runtime-bootstrap.d.ts +62 -0
- package/dist/services/marketplace.d.ts +41 -0
- package/dist/services/mcp-install.d.ts +35 -0
- package/dist/services/plugin-install.d.ts +52 -0
- package/dist/services/plugin-mcp-settings.d.ts +31 -0
- package/dist/services/plugin-tools.d.ts +40 -0
- package/dist/services/plugin-uninstall.d.ts +13 -0
- package/dist/services/providers/local-provider-registry.d.ts +354 -0
- package/dist/services/providers/local-provider-service.d.ts +101 -0
- package/dist/services/providers/model-source.d.ts +3 -0
- package/dist/services/providers/provider-config-fields.d.ts +37 -0
- package/dist/services/providers/provider-readiness.d.ts +10 -0
- package/dist/services/session-artifacts.d.ts +18 -0
- package/dist/services/session-data.d.ts +61 -0
- package/dist/services/session-import/claude-code.d.ts +16 -0
- package/dist/services/session-import/codex.d.ts +34 -0
- package/dist/services/session-import/index.d.ts +6 -0
- package/dist/services/session-import/opencode.d.ts +25 -0
- package/dist/services/session-import/sanitize.d.ts +16 -0
- package/dist/services/session-import/service.d.ts +31 -0
- package/dist/services/session-import/types.d.ts +87 -0
- package/dist/services/session-telemetry.d.ts +15 -0
- package/dist/services/storage/file-team-store.d.ts +32 -0
- package/dist/services/storage/provider-settings-legacy-migration.d.ts +38 -0
- package/dist/services/storage/provider-settings-manager.d.ts +31 -0
- package/dist/services/storage/sqlite-session-store.d.ts +35 -0
- package/dist/services/storage/sqlite-team-store.d.ts +42 -0
- package/dist/services/storage/team-events-retention.d.ts +25 -0
- package/dist/services/storage/team-store.d.ts +16 -0
- package/dist/services/telemetry/ITelemetryAdapter.d.ts +54 -0
- package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +43 -0
- package/dist/services/telemetry/OpenTelemetryProvider.d.ts +99 -0
- package/dist/services/telemetry/TelemetryLoggerSink.d.ts +27 -0
- package/dist/services/telemetry/TelemetryService.d.ts +40 -0
- package/dist/services/telemetry/core-events.d.ts +396 -0
- package/dist/services/telemetry/distinct-id.d.ts +2 -0
- package/dist/services/telemetry/index.d.ts +4 -0
- package/dist/services/telemetry/index.js +1 -0
- package/dist/services/usage.d.ts +19 -0
- package/dist/services/workspace/agent-schedules-workspace.d.ts +8 -0
- package/dist/services/workspace/chat-workspace.d.ts +9 -0
- package/dist/services/workspace/file-indexer.d.ts +5 -0
- package/dist/services/workspace/index.d.ts +6 -0
- package/dist/services/workspace/mention-enricher.d.ts +13 -0
- package/dist/services/workspace/workspace-manager.d.ts +27 -0
- package/dist/services/workspace/workspace-manifest.d.ts +42 -0
- package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
- package/dist/session/checkpoint-diff.d.ts +25 -0
- package/dist/session/checkpoint-restore.d.ts +34 -0
- package/dist/session/display-messages.d.ts +28 -0
- package/dist/session/history-origin.d.ts +19 -0
- package/dist/session/models/session-compaction.d.ts +22 -0
- package/dist/session/models/session-graph.d.ts +15 -0
- package/dist/session/models/session-manifest.d.ts +32 -0
- package/dist/session/models/session-row.d.ts +107 -0
- package/dist/session/persisted-tool-result-content.d.ts +8 -0
- package/dist/session/search/index.d.ts +1 -0
- package/dist/session/search/session-history-search.d.ts +51 -0
- package/dist/session/services/file-session-service.d.ts +10 -0
- package/dist/session/services/message-builder.d.ts +208 -0
- package/dist/session/services/persistence-service.d.ts +92 -0
- package/dist/session/services/read-overlap.d.ts +40 -0
- package/dist/session/services/session-service.d.ts +15 -0
- package/dist/session/session-snapshot.d.ts +59 -0
- package/dist/session/session-versioning-service.d.ts +50 -0
- package/dist/session/stores/atomic-file.d.ts +1 -0
- package/dist/session/stores/conversation-store.d.ts +29 -0
- package/dist/session/stores/session-manifest-store.d.ts +49 -0
- package/dist/session/stores/team-persistence-store.d.ts +23 -0
- package/dist/session/team/index.d.ts +2 -0
- package/dist/session/team/team-child-session-manager.d.ts +35 -0
- package/dist/session/team/team-session-coordinator.d.ts +13 -0
- package/dist/session/user-run-messages.d.ts +20 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/settings-service.d.ts +8 -0
- package/dist/settings/types.d.ts +83 -0
- package/dist/tasks/agenda-task-api.d.ts +20 -0
- package/dist/tasks/agenda-task-manager.d.ts +109 -0
- package/dist/tasks/agenda-task-tool.d.ts +94 -0
- package/dist/tasks/index.d.ts +9 -0
- package/dist/tasks/specs/task-spec-file-store.d.ts +38 -0
- package/dist/tasks/specs/task-spec-parser.d.ts +65 -0
- package/dist/tasks/store/sqlite-task-store.d.ts +73 -0
- package/dist/tasks/store/task-schema.d.ts +2 -0
- package/dist/tasks/task-location.d.ts +14 -0
- package/dist/tasks/task-tool.d.ts +143 -0
- package/dist/types/chat-schema.d.ts +194 -0
- package/dist/types/common.d.ts +35 -0
- package/dist/types/config.d.ts +994 -0
- package/dist/types/events.d.ts +102 -0
- package/dist/types/provider-settings.d.ts +29 -0
- package/dist/types/session.d.ts +187 -0
- package/dist/types/sessions.d.ts +42 -0
- package/dist/types/storage.d.ts +36 -0
- package/dist/types.d.ts +34 -0
- package/dist/version.d.ts +1 -0
- package/package.json +98 -0
- 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
|
+
};
|