@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,304 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolDefinition } from "@cerebriline/shared";
|
|
2
|
+
import type { CoreAtomicProtocolConfig } from "../../types/config";
|
|
3
|
+
import { type RevisionOverlay } from "./base-revision-reads";
|
|
4
|
+
import type { RevisionLog } from "./file-revisions";
|
|
5
|
+
import { type Oracle } from "./oracle";
|
|
6
|
+
import type { CheckApprover } from "./proposal";
|
|
7
|
+
import { type SelfReport, TransactionController, type TransactionEvent } from "./transaction-controller";
|
|
8
|
+
/**
|
|
9
|
+
* Changes a transaction may declare, unless the user says otherwise.
|
|
10
|
+
*
|
|
11
|
+
* Six. It was three, from the harness campaign that produced this protocol,
|
|
12
|
+
* where the models under test were large enough that three declared changes
|
|
13
|
+
* was a comfortable budget and the limit did what it was for -- stopping a
|
|
14
|
+
* shotgun rewrite. On a 9B it does something else. Measured on a JackDelta 9B
|
|
15
|
+
* session: the model made 56 editor calls in TX-01 against a ceiling of three
|
|
16
|
+
* declared changes, so the ceiling was not restraining the work, it was only
|
|
17
|
+
* making the declaration a fiction the model abandoned. A small model that
|
|
18
|
+
* needs four small edits to remove one symptom has to either under-declare or
|
|
19
|
+
* ignore the number, and it ignored it.
|
|
20
|
+
*
|
|
21
|
+
* Six leaves the limit meaning what it says while giving a model that works in
|
|
22
|
+
* smaller steps room to describe what it is actually going to do. It is still
|
|
23
|
+
* a ceiling and the prompt still says so.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DEFAULT_MAX_CHANGES = 6;
|
|
26
|
+
/**
|
|
27
|
+
* Attempts a task gets. Six, as the harness this comes from runs it: measured
|
|
28
|
+
* across that campaign the fix landed in the first three transactions or not at
|
|
29
|
+
* all, and the later ones bought re-readings of the same symptom.
|
|
30
|
+
*/
|
|
31
|
+
export declare const DEFAULT_MAX_TRANSACTIONS = 6;
|
|
32
|
+
/**
|
|
33
|
+
* Empty submissions a transaction absorbs before it is spent.
|
|
34
|
+
*
|
|
35
|
+
* One, and bounded for the same reason the runtime bounds its no-tool-call
|
|
36
|
+
* nudge: asking a model that has stopped working to carry on is worth a turn,
|
|
37
|
+
* and asking a third time is a spin with a wall clock on it.
|
|
38
|
+
*
|
|
39
|
+
* Measured on the harness this protocol comes from. A run whose first
|
|
40
|
+
* transaction was discarded closed the remaining five in about nine minutes
|
|
41
|
+
* without a single edit between them — one iteration each, no tool calls, and
|
|
42
|
+
* the work file byte-identical to the seeded source at the end. It read as six
|
|
43
|
+
* failed attempts and it was one.
|
|
44
|
+
*
|
|
45
|
+
* What happens after the budget is spent is not the run ending. The transaction
|
|
46
|
+
* is settled like any other, which closes it, writes the retrospective and
|
|
47
|
+
* opens the next with the rules in full — so a model that keeps submitting
|
|
48
|
+
* nothing is stopped by running out of transactions rather than by a second
|
|
49
|
+
* rule nobody counted.
|
|
50
|
+
*/
|
|
51
|
+
export declare const DEFAULT_MAX_EMPTY_ATTEMPTS = 1;
|
|
52
|
+
/**
|
|
53
|
+
* Empty submissions a transaction absorbs when **no tool was called in it at
|
|
54
|
+
* all**, before the run is stopped and told why.
|
|
55
|
+
*
|
|
56
|
+
* Separate from the budget above, and much larger, because it counts a
|
|
57
|
+
* different thing. A transaction the model worked in — read files, ran the
|
|
58
|
+
* check, had an edit refused — and then submitted with nothing changed is an
|
|
59
|
+
* attempt that failed, and spending it is fair. A transaction it spent
|
|
60
|
+
* thinking, calling nothing, is not an attempt at all, and spending it charges
|
|
61
|
+
* the model for work it never got to do.
|
|
62
|
+
*
|
|
63
|
+
* A reasoning model takes turns without calling tools; that is what reasoning
|
|
64
|
+
* models do. Under the old rule one nudge and two quiet turns spent a
|
|
65
|
+
* transaction, so roughly four turns of thinking cost an attempt and the whole
|
|
66
|
+
* six-transaction budget could go in about twenty turns without one edit ever
|
|
67
|
+
* being tried. The note on `DEFAULT_MAX_EMPTY_ATTEMPTS` describes that run
|
|
68
|
+
* exactly — "it read as six failed attempts and it was one" — and answers it by
|
|
69
|
+
* spending faster, which makes the misreading arrive sooner rather than
|
|
70
|
+
* removing it.
|
|
71
|
+
*
|
|
72
|
+
* So an unstarted transaction is no longer spent. It is held open, and the
|
|
73
|
+
* turn-level non-convergence guard in the runtime does the nudging, which is
|
|
74
|
+
* what that guard is for and why it is documented as nudging and never ending.
|
|
75
|
+
* This number is only the backstop that keeps a model which will never call a
|
|
76
|
+
* tool from holding a session open forever — and when it fires the run ends
|
|
77
|
+
* saying that, instead of leaving behind six discarded transactions that
|
|
78
|
+
* suggest six attempts were made.
|
|
79
|
+
*/
|
|
80
|
+
export declare const DEFAULT_MAX_UNSTARTED_ATTEMPTS = 6;
|
|
81
|
+
/**
|
|
82
|
+
* Silent turns the boundary absorbs before it submits the transaction itself.
|
|
83
|
+
*
|
|
84
|
+
* The boundary used to BE the submission. `onCompletionAttempt` is reached from
|
|
85
|
+
* one place in the runtime — a turn that called no tools — so a model that
|
|
86
|
+
* thought a turn through and called nothing had, as far as the protocol was
|
|
87
|
+
* concerned, submitted. It was then told so, in those words, for something it
|
|
88
|
+
* had not done. Measured on pandorum 2026-09-12 under 4.100.103: ten turns, no
|
|
89
|
+
* tool calls, six boundary messages, and reasoning that reads "I keep failing
|
|
90
|
+
* to emit actual tool calls" and "I have called none of those yet". The model
|
|
91
|
+
* was not confused about the task; it was reacting to a report of an act it had
|
|
92
|
+
* not performed.
|
|
93
|
+
*
|
|
94
|
+
* It is also the one thing the rest of the contract forbids. The no-tool-call
|
|
95
|
+
* nudge exists to stop a turn ending without a call, and the protocol's only
|
|
96
|
+
* exit was to do exactly that. A model strong enough to hold both ideas at once
|
|
97
|
+
* absorbs the contradiction; a smaller one either breaks on it or calls tools
|
|
98
|
+
* it does not need in order to avoid ending a turn.
|
|
99
|
+
*
|
|
100
|
+
* So `submit_transaction` is the submission now, and the model decides when.
|
|
101
|
+
* This is what the boundary is demoted to: a guard for a run that has stopped
|
|
102
|
+
* calling anything at all. Three, because one silent turn is a model thinking
|
|
103
|
+
* and two is a model thinking twice — neither is a run that has stopped.
|
|
104
|
+
*/
|
|
105
|
+
export declare const DEFAULT_SILENT_TURNS_BEFORE_GUARD = 3;
|
|
106
|
+
export interface AtomicProtocolSessionOptions {
|
|
107
|
+
/**
|
|
108
|
+
* The session's file-history log, shared rather than made here.
|
|
109
|
+
*
|
|
110
|
+
* See `TransactionControllerOptions.revisions`. The host keeps one per
|
|
111
|
+
* session so the ledger and recovery work with the protocol off.
|
|
112
|
+
*/
|
|
113
|
+
revisions?: RevisionLog;
|
|
114
|
+
workspaceRoot: string;
|
|
115
|
+
config: CoreAtomicProtocolConfig | undefined;
|
|
116
|
+
onEvent?: (event: TransactionEvent) => void;
|
|
117
|
+
/**
|
|
118
|
+
* `log`, not `debug`. Which check a change will be judged by — and whether
|
|
119
|
+
* there is one at all — is operational rather than diagnostic, and on the
|
|
120
|
+
* CLI a debug line is below the default level: the first live check of this
|
|
121
|
+
* feature read as "the config never arrived" for exactly that reason.
|
|
122
|
+
*/
|
|
123
|
+
logger?: {
|
|
124
|
+
log?: (message: string) => void;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Said to the user, not to the log: whether the protocol engaged, and why.
|
|
128
|
+
*
|
|
129
|
+
* A log line is the wrong place for this. Measured on the first live use:
|
|
130
|
+
* the protocol was on, the workspace held one HTML file and nothing
|
|
131
|
+
* that could be run, so the protocol stood down exactly as designed — and
|
|
132
|
+
* from the chat that is indistinguishable from a feature that is broken, or
|
|
133
|
+
* from one that is running and has had nothing to judge yet. The user's
|
|
134
|
+
* report was "I don't see any engagement of the atomic transaction even if
|
|
135
|
+
* it's enabled", which is the only thing they could have concluded.
|
|
136
|
+
*/
|
|
137
|
+
onStatus?: (status: {
|
|
138
|
+
armed: boolean;
|
|
139
|
+
message: string;
|
|
140
|
+
}) => void;
|
|
141
|
+
/**
|
|
142
|
+
* Asks the user to approve a check the model proposed.
|
|
143
|
+
*
|
|
144
|
+
* Its presence is what makes a workspace with nothing to run worth arming
|
|
145
|
+
* at all: the alternative there is the model judging its own work, and
|
|
146
|
+
* a host with nobody to ask -- cron, automation, a CLI with no terminal --
|
|
147
|
+
* leaves this out and gets the old behaviour.
|
|
148
|
+
*/
|
|
149
|
+
approveCheck?: CheckApprover;
|
|
150
|
+
/**
|
|
151
|
+
* A second file history that answers `revision` while it is live.
|
|
152
|
+
*
|
|
153
|
+
* The escalation's, when the host wired one up. Passed through rather than
|
|
154
|
+
* decorated on top, because `read_files` can only be widened once: an outer
|
|
155
|
+
* decoration would consume `revision` and the protocol's own would never
|
|
156
|
+
* see it. See `RevisionOverlay`.
|
|
157
|
+
*/
|
|
158
|
+
revisionOverlay?: RevisionOverlay;
|
|
159
|
+
/**
|
|
160
|
+
* Whether the model may propose its own check where nothing can be run.
|
|
161
|
+
*
|
|
162
|
+
* Defaults on. Off restores the verdict that preceded it -- the model's own
|
|
163
|
+
* account of its work -- which is weaker evidence and measurably faster:
|
|
164
|
+
* across one workspace the proposed-check runs took four to six times the
|
|
165
|
+
* model time of the self-declared ones and closed nothing. This is here so
|
|
166
|
+
* the two can be compared on the same task rather than across releases.
|
|
167
|
+
*/
|
|
168
|
+
proposeCheck?: boolean;
|
|
169
|
+
/** Proposals put to the user before the run gives up on having a check. */
|
|
170
|
+
maxCheckProposals?: number;
|
|
171
|
+
/**
|
|
172
|
+
* Discarded attempts before a check that has never passed may be replaced.
|
|
173
|
+
*
|
|
174
|
+
* Zero is off, and off is the freeze exactly as it was. See
|
|
175
|
+
* `TransactionController.checkIsUnderReconsideration`.
|
|
176
|
+
*/
|
|
177
|
+
checkReconsideredAfter?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Retires what the model had read about a file the protocol put back.
|
|
180
|
+
*
|
|
181
|
+
* Supplied by hosts that own the read receipts. `restore_file` moves every
|
|
182
|
+
* line in the file it restores, so a read taken before it no longer
|
|
183
|
+
* describes the file — and the editor's read-before-edit guard is the only
|
|
184
|
+
* thing between a stale line number and the file on disk. A host that
|
|
185
|
+
* leaves this out still gets the restore; what it loses is the guard
|
|
186
|
+
* noticing.
|
|
187
|
+
*/
|
|
188
|
+
forgetReads?: (absolutePath: string) => void;
|
|
189
|
+
/**
|
|
190
|
+
* Something the host wants said on the last transaction's opening prompt.
|
|
191
|
+
*
|
|
192
|
+
* Opaque: the protocol does not know what it is for. The escalation path
|
|
193
|
+
* uses it to offer the expert while there is still a transaction to hold
|
|
194
|
+
* whatever it does.
|
|
195
|
+
*/
|
|
196
|
+
describeLastTransaction?: () => string | undefined;
|
|
197
|
+
}
|
|
198
|
+
export interface AtomicProtocolSession {
|
|
199
|
+
readonly controller: TransactionController;
|
|
200
|
+
/**
|
|
201
|
+
* The check this task is judged by, or nothing when it has none.
|
|
202
|
+
*
|
|
203
|
+
* Read through the controller rather than captured, because a check the
|
|
204
|
+
* user approves mid-run arrives after this session was built.
|
|
205
|
+
*/
|
|
206
|
+
readonly oracle: Oracle | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* Tools this protocol adds to the session, if any.
|
|
209
|
+
*
|
|
210
|
+
* Only `propose_check`, and only where there is nothing to run and someone
|
|
211
|
+
* to ask. A tool the model cannot usefully call is a tool that gets called.
|
|
212
|
+
*/
|
|
213
|
+
readonly tools: AgentTool[];
|
|
214
|
+
/**
|
|
215
|
+
* The session's other tools, with what the protocol adds to them.
|
|
216
|
+
*
|
|
217
|
+
* Only `read_files`, which gains a `revision` for reading the file as this
|
|
218
|
+
* transaction found it. A decoration rather than a tool of its own, and
|
|
219
|
+
* applied here rather than at the tool's definition, so that a host running
|
|
220
|
+
* without the protocol keeps byte-for-byte the schema it had: there is no
|
|
221
|
+
* base revision without an open transaction, and advertising one anyway
|
|
222
|
+
* teaches a call that can only be refused.
|
|
223
|
+
*/
|
|
224
|
+
decorateTools<T extends AgentToolDefinition>(tools: readonly T[]): T[];
|
|
225
|
+
/**
|
|
226
|
+
* The first transaction's rules, to go out with the task itself, once.
|
|
227
|
+
*
|
|
228
|
+
* In the user's message rather than the system prompt, which is where this
|
|
229
|
+
* started. The harness this protocol comes from puts the identical text in
|
|
230
|
+
* the opening message, and this matches the arm the campaign was measured
|
|
231
|
+
* on; it is not a demonstrated improvement, and nothing here should be read
|
|
232
|
+
* as one.
|
|
233
|
+
*
|
|
234
|
+
* A warning for anyone measuring this, learned by getting it wrong: count
|
|
235
|
+
* applied edits, not editor calls. Two system-prompt runs looked like eight
|
|
236
|
+
* and twenty-six changes against a limit of three, which reads as a limit
|
|
237
|
+
* nobody honours. Read against the tool results, they applied seven and
|
|
238
|
+
* three: the twenty-six was twenty-three failed calls -- no-match, read
|
|
239
|
+
* before edit, wrong insert mode -- around three changes that landed, which
|
|
240
|
+
* is the limit exactly.
|
|
241
|
+
*
|
|
242
|
+
* Returns the text once and nothing after. Every later transaction's rules
|
|
243
|
+
* arrive the same way, on the message that reopens it.
|
|
244
|
+
*/
|
|
245
|
+
takeOpeningRules(): string | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* A clause for the no-tool-call nudge naming a transaction nothing has
|
|
248
|
+
* landed in, or undefined when there is nothing to say.
|
|
249
|
+
*
|
|
250
|
+
* The runtime's nudge tells a silent turn that it called nothing. That is
|
|
251
|
+
* the whole message, and with the protocol engaged it omits the state the
|
|
252
|
+
* model is actually in. Measured on pandorum session 1789230811792_qnyfa:
|
|
253
|
+
* TX-01 open, three turns of prose describing edits, two nudges, neither
|
|
254
|
+
* naming the transaction, and the run ended with the file untouched and no
|
|
255
|
+
* tool ever called. The transaction machinery could not intervene because
|
|
256
|
+
* every one of its entry points is a tool call.
|
|
257
|
+
*/
|
|
258
|
+
describeUnstartedWork(): Promise<string | undefined>;
|
|
259
|
+
/** The boundary. Judges the open transaction and keeps it or puts it back. */
|
|
260
|
+
onCompletionAttempt(context: {
|
|
261
|
+
text?: string;
|
|
262
|
+
forced?: boolean;
|
|
263
|
+
}): Promise<string | undefined>;
|
|
264
|
+
/**
|
|
265
|
+
* The user turned the protocol off. Judge what is open and stand down.
|
|
266
|
+
*
|
|
267
|
+
* Whoever calls this owns the timing, and the timing is the hard part: a
|
|
268
|
+
* discarded transaction puts every file it touched back, and doing that
|
|
269
|
+
* while a tool call is open would rewrite a file underneath the call that is
|
|
270
|
+
* writing it. The host calls this where no call is in flight -- idle, or at
|
|
271
|
+
* the top of an agent-loop iteration -- and nowhere else.
|
|
272
|
+
*
|
|
273
|
+
* Returns what to tell the model, already written. After it returns, the
|
|
274
|
+
* protocol is inert: its tools refuse, and the completion boundary judges
|
|
275
|
+
* nothing, so the message's claim that the tools have gone is true for the
|
|
276
|
+
* rest of this session rather than only after the next rebuild.
|
|
277
|
+
*
|
|
278
|
+
* Calling it twice is a no-op and returns nothing: the second caller has
|
|
279
|
+
* nothing to tell the model that the first did not already say.
|
|
280
|
+
*/
|
|
281
|
+
disengage(): Promise<string | undefined>;
|
|
282
|
+
/** Whether it has stood down. */
|
|
283
|
+
readonly disengaged: boolean;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Arm the protocol for a session, or decline and say why.
|
|
287
|
+
*
|
|
288
|
+
* `auto` engages only where a change can actually be judged — an oracle the
|
|
289
|
+
* user named, or something in the workspace that can be run. Without one the
|
|
290
|
+
* verdict would come from the model's own account of its work, and the whole
|
|
291
|
+
* reason the protocol exists is that this account and the program disagree.
|
|
292
|
+
* `always` engages anyway, and is honest in the prompt about what is judging.
|
|
293
|
+
*/
|
|
294
|
+
export declare function createAtomicProtocolSession(options: AtomicProtocolSessionOptions): Promise<AtomicProtocolSession | undefined>;
|
|
295
|
+
/**
|
|
296
|
+
* What a model's closing message says about whether its change worked.
|
|
297
|
+
*
|
|
298
|
+
* A heuristic, and only reached where there is no oracle. It looks for doubt
|
|
299
|
+
* rather than for confidence: a model that ends a run is already asserting that
|
|
300
|
+
* it is done, so the thing worth finding is the sentence where it says it is
|
|
301
|
+
* not sure, and returning `undefined` means "it did not say otherwise" rather
|
|
302
|
+
* than "it said yes".
|
|
303
|
+
*/
|
|
304
|
+
export declare function readSelfReport(text: string | undefined): SelfReport | undefined;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File history for a whole session, whether or not the change protocol is on.
|
|
3
|
+
*
|
|
4
|
+
* The log used to belong to the transaction: `createRevisionLog()` was a field
|
|
5
|
+
* on `TransactionController`, `withRevisionCapture` had two call sites and both
|
|
6
|
+
* were anchored to a base `Snapshot`, and `--atomic off` therefore recorded
|
|
7
|
+
* nothing at all. Two things that do not depend on the protocol depended on it
|
|
8
|
+
* anyway:
|
|
9
|
+
*
|
|
10
|
+
* - the compaction ledger's closing section, `src/parser.ts #1–#7`, which is
|
|
11
|
+
* how a summary says "the content is not here, it is at this address". It
|
|
12
|
+
* rendered empty in every one of the 36 compactions of the 12-run A/B,
|
|
13
|
+
* because that arm ran with the protocol off;
|
|
14
|
+
* - and recovery, which is the reason the whole thing exists. A session that
|
|
15
|
+
* destroys a file wants its earlier content back; whether a transaction was
|
|
16
|
+
* open when it happened is not the model's question.
|
|
17
|
+
*
|
|
18
|
+
* So the log is the session's, and the transaction is one consumer of it. The
|
|
19
|
+
* protocol is handed this object instead of making its own, which also keeps
|
|
20
|
+
* the numbering continuous: a session that engages the protocol part-way
|
|
21
|
+
* through does not restart `#1` underneath a model that has already been told
|
|
22
|
+
* where `#4` is.
|
|
23
|
+
*/
|
|
24
|
+
import type { AgentTool, AgentToolDefinition } from "@cerebriline/shared";
|
|
25
|
+
import type { CompactionRevisions } from "../../extensions/context/compaction-revisions";
|
|
26
|
+
import { type RevisionLog } from "./file-revisions";
|
|
27
|
+
export interface SessionRevisions {
|
|
28
|
+
/** The log itself, to hand to the change protocol so both share one. */
|
|
29
|
+
readonly log: RevisionLog;
|
|
30
|
+
/** What compaction reads and writes. */
|
|
31
|
+
readonly port: CompactionRevisions;
|
|
32
|
+
/**
|
|
33
|
+
* Tools that exist because the history does.
|
|
34
|
+
*
|
|
35
|
+
* Just `restore_file` today, and it is the reason any of this is worth
|
|
36
|
+
* having: it was added by the change protocol's `decorateTools` and by
|
|
37
|
+
* nothing else, so a session with the protocol off could record nothing and
|
|
38
|
+
* undo nothing. Added by the host only when the protocol is absent — with
|
|
39
|
+
* it, the protocol adds its own, bound to the transaction.
|
|
40
|
+
*/
|
|
41
|
+
readonly tools: readonly AgentTool[];
|
|
42
|
+
/**
|
|
43
|
+
* Wrap the session's tools so writes are recorded.
|
|
44
|
+
*
|
|
45
|
+
* Called by the host **only when the protocol is not installed**: the
|
|
46
|
+
* protocol's own `decorateTools` already wraps the same list against the
|
|
47
|
+
* same log, and wrapping twice would record every write as two revisions.
|
|
48
|
+
*/
|
|
49
|
+
decorate<T extends AgentToolDefinition>(tools: readonly T[]): T[];
|
|
50
|
+
/**
|
|
51
|
+
* Reads only: `read_files` learns `revision`, and nothing is recorded.
|
|
52
|
+
*
|
|
53
|
+
* For Checkpoints off. The lead's own writes are then not recorded, as the
|
|
54
|
+
* switch says, but a delegated agent's changes still come back as
|
|
55
|
+
* revisions in this log -- the only way they reach the lead -- and a lead
|
|
56
|
+
* with no tool to read or adopt them loses the agent's work.
|
|
57
|
+
*/
|
|
58
|
+
decorateReads<T extends AgentToolDefinition>(tools: readonly T[]): T[];
|
|
59
|
+
}
|
|
60
|
+
export declare function createSessionRevisions(options: {
|
|
61
|
+
/** Where relative paths resolve, and the edge of what is tracked. */
|
|
62
|
+
root: string;
|
|
63
|
+
/** Supplied by tests; the default reads the real file. */
|
|
64
|
+
readFile?: (absolutePath: string) => Promise<Buffer | undefined>;
|
|
65
|
+
/** What the checker last said, appended to a revision's label. */
|
|
66
|
+
lastCheck?: () => string | undefined;
|
|
67
|
+
/** Supplied by tests that want to inspect the log they passed in. */
|
|
68
|
+
log?: RevisionLog;
|
|
69
|
+
/** Retires what the model had read about a file a restore has moved. */
|
|
70
|
+
forgetReads?: (absolutePath: string) => void;
|
|
71
|
+
/** For the host to say, in its own voice, that a file was put back. */
|
|
72
|
+
onRestored?: (event: {
|
|
73
|
+
path: string;
|
|
74
|
+
deleted: boolean;
|
|
75
|
+
}) => void;
|
|
76
|
+
onError?: (message: string, error: unknown) => void;
|
|
77
|
+
}): SessionRevisions;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The undo a transaction is built on.
|
|
3
|
+
*
|
|
4
|
+
* The rollback is the whole protocol: if the undo is unreliable, every
|
|
5
|
+
* transaction after the first measures wreckage rather than a fresh attempt.
|
|
6
|
+
* Cline's checkpoints cannot serve here — `beginWorktreeRestoreTransaction`
|
|
7
|
+
* runs `git rev-parse --is-inside-work-tree` and throws on anything that is
|
|
8
|
+
* not a repository, so a workspace that is a plain directory would have no
|
|
9
|
+
* undo at all. Worse is the quiet failure: a sibling project's git snapshot
|
|
10
|
+
* had `git add --sparse` fail on git 2.30, swallowed it, wrote the empty tree,
|
|
11
|
+
* and reported success while reverting nothing.
|
|
12
|
+
*
|
|
13
|
+
* So this is a copy with a checksum manifest and no git in it anywhere. It is
|
|
14
|
+
* slower than a commit and it cannot lie about what it holds.
|
|
15
|
+
*/
|
|
16
|
+
export interface Snapshot {
|
|
17
|
+
/** Absolute paths, with the content each held when the transaction opened. */
|
|
18
|
+
readonly files: ReadonlyMap<string, {
|
|
19
|
+
hash: string;
|
|
20
|
+
body: Buffer;
|
|
21
|
+
}>;
|
|
22
|
+
/** The root the snapshot covers. */
|
|
23
|
+
readonly root: string;
|
|
24
|
+
/** Files that existed but were too large to hold; never rolled back. */
|
|
25
|
+
readonly skipped: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
export interface SnapshotLimits {
|
|
28
|
+
/** Most files a snapshot will hold before it gives up on covering the tree. */
|
|
29
|
+
maxFiles?: number;
|
|
30
|
+
/** Largest single file held, in bytes. */
|
|
31
|
+
maxFileBytes?: number;
|
|
32
|
+
/** Most bytes held in total. */
|
|
33
|
+
maxTotalBytes?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Read every file under `root` that a transaction could plausibly change.
|
|
37
|
+
*
|
|
38
|
+
* Taken at the open of every transaction rather than once per task: a kept
|
|
39
|
+
* transaction becomes the base the next one rolls back to, which is what makes
|
|
40
|
+
* a sequence of them additive rather than a single undo point.
|
|
41
|
+
*/
|
|
42
|
+
export declare function takeSnapshot(root: string, limits?: SnapshotLimits): Promise<Snapshot>;
|
|
43
|
+
export interface RestoreReport {
|
|
44
|
+
/** Files put back because their contents had changed. */
|
|
45
|
+
restored: string[];
|
|
46
|
+
/** Files the transaction created, and which are now gone again. */
|
|
47
|
+
removed: string[];
|
|
48
|
+
/** Files the transaction deleted, and which are now back. */
|
|
49
|
+
recreated: string[];
|
|
50
|
+
/** Paths the snapshot never held, listed so nobody assumes they reverted. */
|
|
51
|
+
uncovered: string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Put the tree back exactly as the snapshot found it.
|
|
55
|
+
*
|
|
56
|
+
* Deletions are undone as carefully as edits, which is not hypothetical: a
|
|
57
|
+
* model was measured deleting the file under test twelve times in one
|
|
58
|
+
* transaction to get a clean slate for a whole-file write, and the last
|
|
59
|
+
* deletion outlived the transaction.
|
|
60
|
+
*/
|
|
61
|
+
export declare function restoreSnapshot(snapshot: Snapshot, limits?: SnapshotLimits): Promise<RestoreReport>;
|
|
62
|
+
/** A file that differs from the snapshot, with the content it holds now. */
|
|
63
|
+
export interface SnapshotChange {
|
|
64
|
+
readonly path: string;
|
|
65
|
+
readonly body: Buffer;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* What the open transaction has changed, as it stands right now.
|
|
69
|
+
*
|
|
70
|
+
* Files only, and only files that exist: a deletion is a change, but there is
|
|
71
|
+
* nothing to read back from one, and every caller of this is asking about the
|
|
72
|
+
* content. The order is the tree walk's, so the answer is stable between two
|
|
73
|
+
* calls that see the same disk.
|
|
74
|
+
*/
|
|
75
|
+
export declare function snapshotChanges(snapshot: Snapshot, limits?: SnapshotLimits): Promise<SnapshotChange[]>;
|
|
76
|
+
/** Whether anything under the snapshot's root differs from it now. */
|
|
77
|
+
export declare function snapshotIsClean(snapshot: Snapshot, limits?: SnapshotLimits): Promise<boolean>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Close a transaction whose check is being re-run over files nobody is changing.
|
|
3
|
+
*
|
|
4
|
+
* `run_check` settles nothing, by design: that is what makes it safe to run
|
|
5
|
+
* after every edit, and the protocol asks the model to do exactly that. The
|
|
6
|
+
* cost is that a model which never yields its turn never reaches
|
|
7
|
+
* `onCompletionAttempt`, which is the only place `settle` is called from -- so
|
|
8
|
+
* it never settles at all. That is the timeout signature: the three JackOD4-AC
|
|
9
|
+
* 9B timeouts closed zero transactions between them, over 308-428 iterations
|
|
10
|
+
* each.
|
|
11
|
+
*
|
|
12
|
+
* The trigger is deliberately *not* "three failed checks". Under the
|
|
13
|
+
* one-edit-one-check rule a healthy transaction fails its check repeatedly on
|
|
14
|
+
* the way to passing -- the check is the task's own oracle, so it keeps failing
|
|
15
|
+
* until the last fix lands, and the model is told to run it on the unmodified
|
|
16
|
+
* files first to see the failure in the check's own words. Three failures is
|
|
17
|
+
* the opening of a transaction that is working, and counting those would
|
|
18
|
+
* guillotine one that was an edit away from passing.
|
|
19
|
+
*
|
|
20
|
+
* What separates the two is whether anything changed between one check and the
|
|
21
|
+
* next. Longest run of checks with no edit in between, over the JackOD4-AC arm:
|
|
22
|
+
*
|
|
23
|
+
* 0207 FIXED 481s 1 check streak 1
|
|
24
|
+
* 0208 FIXED 2649s 41 checks streak 6
|
|
25
|
+
* 0209 broken 862s 21 checks streak 6
|
|
26
|
+
* 0213 broken 2688s 49 checks streak 4
|
|
27
|
+
* 0214 broken 615s 22 checks streak 10
|
|
28
|
+
* 0215 broken 5014s 22 checks streak 4
|
|
29
|
+
*
|
|
30
|
+
* The one run that fixed the task quickly never re-ran the check over untouched
|
|
31
|
+
* files at all. Every other run did, four to ten times over. Three sits above
|
|
32
|
+
* the working run and below all the rest, and it is defensible without the
|
|
33
|
+
* measurement too: a check re-run over bytes that have not moved cannot return
|
|
34
|
+
* anything the run before it did not.
|
|
35
|
+
*/
|
|
36
|
+
import type { AgentToolDefinition } from "@cerebriline/shared";
|
|
37
|
+
/** Checks over untouched files before the model is told the check has stopped moving. */
|
|
38
|
+
export declare const DEFAULT_MAX_CHECKS_WITHOUT_EDIT = 3;
|
|
39
|
+
/**
|
|
40
|
+
* Checks over untouched files before the transaction is closed for the model.
|
|
41
|
+
*
|
|
42
|
+
* Two more after the nudge, and the gap is the point. Settling is a rollback --
|
|
43
|
+
* every change in the transaction goes back -- which is the most expensive
|
|
44
|
+
* possible answer to "that check told you nothing new", and the measured
|
|
45
|
+
* evidence says a sentence is usually enough. On the pandorum run of
|
|
46
|
+
* 2026-09-13, eleven of eighteen check runs returned the previous answer byte
|
|
47
|
+
* for byte; what ended the loop was the non-convergence guard quoting the
|
|
48
|
+
* model's own "I'm stuck in an infinite loop of edits that keep regressing"
|
|
49
|
+
* back at it, after which it converged in three minutes and one edit. Nothing
|
|
50
|
+
* was rolled back to achieve that.
|
|
51
|
+
*
|
|
52
|
+
* So the guard speaks first and cuts second. A model that ignores the sentence
|
|
53
|
+
* still reaches the same settlement it did before, two checks later.
|
|
54
|
+
*/
|
|
55
|
+
export declare const DEFAULT_MAX_CHECKS_BEFORE_SETTLING = 5;
|
|
56
|
+
/** What the counter needs to know, and nothing more. */
|
|
57
|
+
export interface StalledCheckSource {
|
|
58
|
+
/** Which transaction is open, so the count can reset when it changes. */
|
|
59
|
+
readonly transaction: number;
|
|
60
|
+
/** How many checks over untouched files earn the nudge. */
|
|
61
|
+
readonly max?: number;
|
|
62
|
+
/** How many end the transaction. Defaults to two more than the nudge. */
|
|
63
|
+
readonly settleAt?: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* What a check over untouched files has earned.
|
|
67
|
+
*
|
|
68
|
+
* `nudge` is said once per transaction and judges nothing; `settle` closes the
|
|
69
|
+
* transaction the way this guard always did.
|
|
70
|
+
*/
|
|
71
|
+
export type StalledCheckVerdict = "ok" | "nudge" | "settle";
|
|
72
|
+
export interface StalledChecks {
|
|
73
|
+
/** Record a check that has just run, and say what it has earned. */
|
|
74
|
+
checked(passed: boolean): StalledCheckVerdict;
|
|
75
|
+
/** Record a change: whatever the next check says, it is judging new bytes. */
|
|
76
|
+
changed(): void;
|
|
77
|
+
/** The current run of checks over untouched files. */
|
|
78
|
+
readonly streak: number;
|
|
79
|
+
}
|
|
80
|
+
export declare function createStalledChecks(source: StalledCheckSource): StalledChecks;
|
|
81
|
+
/**
|
|
82
|
+
* Wrap the changing tools so the counter hears about them.
|
|
83
|
+
*
|
|
84
|
+
* Wrap *inside* `withCheckFirstEdits`, never outside: an edit that gate refuses
|
|
85
|
+
* never reaches the file, and letting a refused edit clear the count would hand
|
|
86
|
+
* the model a way to hold a stalled transaction open with edits that do not
|
|
87
|
+
* land.
|
|
88
|
+
*
|
|
89
|
+
* The signal is the call, not the write. A tool that reports a refusal of its
|
|
90
|
+
* own -- a range that matched nothing, one edit of a batch held back -- still
|
|
91
|
+
* clears the count, so the guard needs one more check than it strictly should
|
|
92
|
+
* before it fires. That is the right way round: a check re-run after a change
|
|
93
|
+
* that did land is the case this must never cut short.
|
|
94
|
+
*/
|
|
95
|
+
export declare function withChangeSignal<T extends AgentToolDefinition>(tools: readonly T[], onChange: () => void): T[];
|
|
96
|
+
/**
|
|
97
|
+
* What the model is told the first time the check stops moving.
|
|
98
|
+
*
|
|
99
|
+
* It judges nothing and puts nothing back -- saying otherwise would have the
|
|
100
|
+
* model report a transaction that is still open. What it adds is the thing the
|
|
101
|
+
* re-run cannot give it: the check names where the parser gave up, and
|
|
102
|
+
* `check_file` names the line that is actually wrong.
|
|
103
|
+
*/
|
|
104
|
+
export declare function describeStalledCheckNudge(runs: number, label: string): string;
|
|
105
|
+
/** What the model is told when the check is closed out from under it. */
|
|
106
|
+
export declare function describeStalledChecks(runs: number, label: string): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Submit the open transaction, deliberately, when the model judges it done.
|
|
3
|
+
*
|
|
4
|
+
* Why it exists. Until now there was no way for a model to submit anything.
|
|
5
|
+
* `onCompletionAttempt` — the only path that judges a transaction — is reached
|
|
6
|
+
* from exactly one place in the runtime: a turn that called no tools. So the
|
|
7
|
+
* submission was never a decision. The model would think a turn through, call
|
|
8
|
+
* nothing, and be told "TX-01 was submitted", which is a report of something it
|
|
9
|
+
* had not done.
|
|
10
|
+
*
|
|
11
|
+
* And it is told the opposite everywhere else. The no-tool-call nudge exists
|
|
12
|
+
* precisely to stop a turn ending without a call; the protocol's only exit was
|
|
13
|
+
* to do that on purpose. Measured on pandorum 2026-09-12 under 4.100.103: ten
|
|
14
|
+
* turns, no tool calls, six boundary messages, and the model's own reasoning
|
|
15
|
+
* reading "I keep failing to emit actual tool calls", "I have called none of
|
|
16
|
+
* those yet", "this loop above shows exactly why things keep ending". It was
|
|
17
|
+
* not confused about the task. It was reacting to being told it had submitted.
|
|
18
|
+
*
|
|
19
|
+
* With this, submission is a tool call like everything else: the model decides
|
|
20
|
+
* when it is confident, the check runs, and the verdict comes back as the
|
|
21
|
+
* result. The completion boundary stays, demoted to what it should always have
|
|
22
|
+
* been — a guard for a run that has stopped calling anything at all.
|
|
23
|
+
*/
|
|
24
|
+
import { type AgentTool } from "@cerebriline/shared";
|
|
25
|
+
export declare const SUBMIT_TRANSACTION_TOOL_NAME = "submit_transaction";
|
|
26
|
+
export declare const SUBMIT_TRANSACTION_TOOL_DESCRIPTION = "Submit this transaction for judging, when you have made the changes you planned and you are confident in them.\n\nThis is how a transaction ends. Nothing else submits it: finishing your turn without calling anything does not, and describing the work in your reply does not.\n\nWhat happens when you call it: the check runs, and the answer comes straight back to you. If it passes the transaction is kept and the task is done. If it does not, every change in this transaction is rolled back for you, and you are given the next transaction with a record of what this one tried.\n\nSo call it when you believe the work is finished \u2014 not to ask whether it is. Use `run_check` for that, as often as you like; it settles nothing. Submitting is the commitment.";
|
|
27
|
+
export declare const SUBMIT_TRANSACTION_TOOL_INPUT_SCHEMA: {
|
|
28
|
+
readonly type: "object";
|
|
29
|
+
readonly properties: {
|
|
30
|
+
readonly account: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
readonly description: "What you changed and why you believe it works. One or two sentences. This is recorded with the transaction and, where nothing here can run a check, it is what the verdict is based on.";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly required: readonly [];
|
|
36
|
+
};
|
|
37
|
+
export interface SubmitTransactionToolOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Settles the open transaction and returns what the model should be told:
|
|
40
|
+
* the verdict, and the next transaction's rules where there is one.
|
|
41
|
+
*
|
|
42
|
+
* Owned by the session rather than passed a controller, because settling
|
|
43
|
+
* touches per-session bookkeeping — whether the run has finished, how many
|
|
44
|
+
* empty submissions this transaction has absorbed — that does not live on
|
|
45
|
+
* the controller and would be bypassed by settling directly.
|
|
46
|
+
*/
|
|
47
|
+
submit: (account: string | undefined) => Promise<string>;
|
|
48
|
+
onError?: (message: string, error: unknown) => void;
|
|
49
|
+
}
|
|
50
|
+
export declare function createSubmitTransactionTool(options: SubmitTransactionToolOptions): AgentTool;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AgentToolDefinition } from "@cerebriline/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Signal every tool call, whatever the tool and whatever it returns.
|
|
4
|
+
*
|
|
5
|
+
* `withChangeSignal` answers "did a file change in this transaction". This
|
|
6
|
+
* answers the question before it — "was this transaction ever attempted" — and
|
|
7
|
+
* the two are not the same. A transaction the model worked in for twenty turns
|
|
8
|
+
* and left with no net change was attempted and failed. A transaction it spent
|
|
9
|
+
* thinking, calling nothing, was not attempted at all, and the difference
|
|
10
|
+
* decides whether it is fair to spend it.
|
|
11
|
+
*
|
|
12
|
+
* Wrapped outermost, so it counts calls the check-first gate refuses. A refused
|
|
13
|
+
* edit is still the model reaching for a tool: it began.
|
|
14
|
+
*/
|
|
15
|
+
export declare function withAnyToolSignal<T extends AgentToolDefinition>(tools: readonly T[], onCall: (name: string) => void): T[];
|