@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,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The thing that decides whether a transaction is kept.
|
|
3
|
+
*
|
|
4
|
+
* The harness this protocol comes from runs its oracle from the shell and
|
|
5
|
+
* reads only the exit code, deliberately: a model asked whether its own edit
|
|
6
|
+
* worked answers about the edit it meant to make. Measured across the atomic
|
|
7
|
+
* campaign, transactions that reported success and failed the oracle were
|
|
8
|
+
* routine — the model had fixed the error it was looking at and not the one
|
|
9
|
+
* the program still had.
|
|
10
|
+
*
|
|
11
|
+
* So the verdict is a command's exit status wherever a command can be found,
|
|
12
|
+
* and the model's own word only where none can.
|
|
13
|
+
*/
|
|
14
|
+
interface OracleCommon {
|
|
15
|
+
/** Shown to the model, and to the user, as what will judge the change. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Where it runs. */
|
|
18
|
+
cwd: string;
|
|
19
|
+
/** Why this one was chosen, for the log. */
|
|
20
|
+
reason: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CommandOracle extends OracleCommon {
|
|
23
|
+
kind?: "command";
|
|
24
|
+
/** The executable and its arguments. Never a shell string. */
|
|
25
|
+
command: string;
|
|
26
|
+
args: string[];
|
|
27
|
+
/**
|
|
28
|
+
* A pattern the output must match, on top of exiting zero.
|
|
29
|
+
*
|
|
30
|
+
* For the large class of checks that report their verdict and exit zero
|
|
31
|
+
* anyway. The harness's own oracle is one: `run_game.js` prints
|
|
32
|
+
* `{"ok":false,"error":"…"}` and exits 0 whether the game runs or not, so a
|
|
33
|
+
* protocol reading only the exit status would keep every transaction it was
|
|
34
|
+
* ever pointed at. Read as a regular expression against stdout and stderr
|
|
35
|
+
* together, in this process — never through a shell.
|
|
36
|
+
*/
|
|
37
|
+
expect?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the output must match `expect` (the default) or must not.
|
|
40
|
+
*
|
|
41
|
+
* `not_match` is for the check that names its failure rather than its
|
|
42
|
+
* success -- a linter's `ERROR`, a test runner's `FAIL` -- where "it exited
|
|
43
|
+
* zero and did not say that" is the pass. The exit status still has to be
|
|
44
|
+
* zero either way.
|
|
45
|
+
*/
|
|
46
|
+
must?: "match" | "not_match";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* How a command is started somewhere other than straight on the host: the
|
|
50
|
+
* shape of `ShellExecutorOptions.wrapSpawn`, which is how a delegated agent's
|
|
51
|
+
* shell is rooted at the sandbox launcher.
|
|
52
|
+
*/
|
|
53
|
+
export type OracleSpawnWrapper = (spec: {
|
|
54
|
+
executable: string;
|
|
55
|
+
args: string[];
|
|
56
|
+
cwd: string;
|
|
57
|
+
env: Record<string, string>;
|
|
58
|
+
}) => {
|
|
59
|
+
executable: string;
|
|
60
|
+
args: string[];
|
|
61
|
+
cwd: string;
|
|
62
|
+
env: Record<string, string>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* A check the harness runs itself, with no external program involved.
|
|
66
|
+
*
|
|
67
|
+
* The reason this kind exists: every other oracle is a command, and a command
|
|
68
|
+
* only judges anything where one is installed. The workspaces this protocol
|
|
69
|
+
* falls back to self-declaration on are exactly the ones with no test runner
|
|
70
|
+
* and no build — a single page, a script, a game — and telling the model to
|
|
71
|
+
* name a command there produces one that may not exist on the machine. This
|
|
72
|
+
* one always does. See `page-check.ts`.
|
|
73
|
+
*/
|
|
74
|
+
export interface PageOracle extends OracleCommon {
|
|
75
|
+
kind: "page";
|
|
76
|
+
/** The file to load, absolute or relative to `cwd`. */
|
|
77
|
+
path: string;
|
|
78
|
+
/** How many animation frames to pump before calling it working. */
|
|
79
|
+
frames?: number;
|
|
80
|
+
}
|
|
81
|
+
export type Oracle = CommandOracle | PageOracle;
|
|
82
|
+
/** Whether this oracle is one the harness runs itself. */
|
|
83
|
+
export declare function isPageOracle(oracle: Oracle): oracle is PageOracle;
|
|
84
|
+
export interface OracleVerdict {
|
|
85
|
+
passed: boolean;
|
|
86
|
+
/** Exit status, or `null` when the oracle could not be run at all. */
|
|
87
|
+
exitCode: number | null;
|
|
88
|
+
/** Combined output, truncated. The record a failed transaction carries. */
|
|
89
|
+
output: string;
|
|
90
|
+
/** Set when the oracle exceeded its budget: an unfinished run is not a pass. */
|
|
91
|
+
timedOut: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Set when the command succeeded but its output did not say the change did.
|
|
94
|
+
* A different failure from a non-zero exit and reported as one, because "it
|
|
95
|
+
* ran and reported a problem" reads nothing like "it crashed".
|
|
96
|
+
*/
|
|
97
|
+
unmatched?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* What went wrong, where the check can say it better than an exit code can.
|
|
100
|
+
*
|
|
101
|
+
* A check the harness runs itself has no exit status worth reporting, and
|
|
102
|
+
* "the check failed (exit 1)" would be the least informative true thing
|
|
103
|
+
* available about a page that threw a ReferenceError on frame 2.
|
|
104
|
+
*/
|
|
105
|
+
summary?: string;
|
|
106
|
+
}
|
|
107
|
+
/** Longest an oracle may run before the transaction is judged on nothing. */
|
|
108
|
+
export declare const DEFAULT_ORACLE_TIMEOUT_MS = 120000;
|
|
109
|
+
/**
|
|
110
|
+
* Directories a workspace scan must not descend into.
|
|
111
|
+
*
|
|
112
|
+
* Not a nicety: a snapshot or a scan that walks `node_modules` on a real
|
|
113
|
+
* project reads hundreds of thousands of files and the feature becomes slower
|
|
114
|
+
* than the change it is protecting.
|
|
115
|
+
*/
|
|
116
|
+
export declare const SCAN_IGNORED_DIRECTORIES: ReadonlySet<string>;
|
|
117
|
+
/**
|
|
118
|
+
* Where an oracle may come from, strongest claim first.
|
|
119
|
+
*
|
|
120
|
+
* `manual` is the one the user writes for the task in front of them, and it is
|
|
121
|
+
* the answer to a failure mode the rest of the ladder cannot reach: an oracle
|
|
122
|
+
* chosen by detection judges whether the workspace still holds together, not
|
|
123
|
+
* whether the thing the user asked for now works. A model can leave a
|
|
124
|
+
* typecheck green and the feature broken, and detection would keep that
|
|
125
|
+
* transaction.
|
|
126
|
+
*/
|
|
127
|
+
export interface OracleSources {
|
|
128
|
+
/** Written by the user for this task. Beats everything below it. */
|
|
129
|
+
manual?: string;
|
|
130
|
+
/** A default the user set once, in settings, for every task. */
|
|
131
|
+
explicit?: string;
|
|
132
|
+
/**
|
|
133
|
+
* What the output must say for a user-named check to count as passed.
|
|
134
|
+
*
|
|
135
|
+
* Applies to a named command only. A check found by looking at the
|
|
136
|
+
* workspace is a test runner or a compiler, and those already answer with
|
|
137
|
+
* their exit status; a command the user wrote may be neither.
|
|
138
|
+
*/
|
|
139
|
+
expect?: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Flags an `expect` pattern is compiled with: `s`, so `.` crosses line ends.
|
|
143
|
+
*
|
|
144
|
+
* A check's output is several lines more often than one, and a pattern written
|
|
145
|
+
* as `"ok":true.*"passed":23` means "this, then later that" to whoever wrote
|
|
146
|
+
* it. Without the flag it only held while the program printed one line (the
|
|
147
|
+
* wlafh lead noticed it had been lucky).
|
|
148
|
+
*/
|
|
149
|
+
export declare const ORACLE_EXPECT_FLAGS = "s";
|
|
150
|
+
export declare function shellOracle(line: string, cwd: string, reason: string, expect?: string): CommandOracle;
|
|
151
|
+
/**
|
|
152
|
+
* Find something in this workspace that can say whether a change is good.
|
|
153
|
+
*
|
|
154
|
+
* Returns `undefined` when nothing does — a documentation edit, a config file,
|
|
155
|
+
* a repository with no runnable anything. That is not a failure: it is the
|
|
156
|
+
* case where the verdict falls to the model, and the caller says so out loud
|
|
157
|
+
* rather than pretending a check happened.
|
|
158
|
+
*/
|
|
159
|
+
export declare function discoverOracle(workspaceRoot: string, options?: OracleSources): Promise<Oracle | undefined>;
|
|
160
|
+
/**
|
|
161
|
+
* Run the oracle and read its exit status.
|
|
162
|
+
*
|
|
163
|
+
* A non-zero exit, a signal, a timeout and a command that could not be started
|
|
164
|
+
* are all failures. The last of those is the one worth naming: an oracle that
|
|
165
|
+
* cannot run has judged nothing, and treating "not found" as a pass would keep
|
|
166
|
+
* every transaction it was pointed at.
|
|
167
|
+
*/
|
|
168
|
+
export declare function runOracle(oracle: Oracle, options?: {
|
|
169
|
+
timeoutMs?: number;
|
|
170
|
+
env?: NodeJS.ProcessEnv;
|
|
171
|
+
/**
|
|
172
|
+
* Start the command through this instead of directly: a delegated
|
|
173
|
+
* agent's check runs under the same launcher as its shell, so it sees
|
|
174
|
+
* the agent's own files. Absent is the host, as before.
|
|
175
|
+
*/
|
|
176
|
+
wrapSpawn?: OracleSpawnWrapper;
|
|
177
|
+
}): Promise<OracleVerdict>;
|
|
178
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A check the harness provides, for the workspaces that have none.
|
|
3
|
+
*
|
|
4
|
+
* `discoverOracle` finds a check by looking for a test runner, a compiler or a
|
|
5
|
+
* build. A single-file page has none of those, and that is exactly the shape
|
|
6
|
+
* of task this protocol keeps failing on: the model edits a game, cannot run
|
|
7
|
+
* it, and the verdict falls back to its own word.
|
|
8
|
+
*
|
|
9
|
+
* Asking the model to name a shell command instead does not fix it — the
|
|
10
|
+
* command it names may not be installed, and a check that cannot run judges
|
|
11
|
+
* nothing. So this one is ours: no external program, no browser, nothing to
|
|
12
|
+
* install. It builds a stub DOM, executes every `<script>` in the file and
|
|
13
|
+
* pumps a bounded number of animation frames. A page that throws while
|
|
14
|
+
* loading, throws in a frame, or never schedules a frame at all did not work.
|
|
15
|
+
*
|
|
16
|
+
* Ported from the harness oracle the atomic campaign was measured with, where
|
|
17
|
+
* it decided every verdict across ~90 runs.
|
|
18
|
+
*/
|
|
19
|
+
/** Frames pumped by default: enough for a game to have run its loop. */
|
|
20
|
+
export declare const DEFAULT_PAGE_FRAMES = 30;
|
|
21
|
+
export interface PageCheckResult {
|
|
22
|
+
ok: boolean;
|
|
23
|
+
/** Why it failed, in the form the transaction's message quotes. */
|
|
24
|
+
error?: string;
|
|
25
|
+
framesRun: number;
|
|
26
|
+
/** Whether the page had to be told to start rather than starting itself. */
|
|
27
|
+
started: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Load a page the way a browser would, and say whether it ran.
|
|
31
|
+
*
|
|
32
|
+
* `source` is passed in rather than read here so the caller decides which
|
|
33
|
+
* copy of the file is being judged — the working tree, or a snapshot restored
|
|
34
|
+
* behind it, which is what validating a proposed check against the unmodified
|
|
35
|
+
* files needs.
|
|
36
|
+
*/
|
|
37
|
+
export declare function checkPage(filePath: string, source: string, options?: {
|
|
38
|
+
frames?: number;
|
|
39
|
+
}): PageCheckResult;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notice the plan the moment it is written, wherever it was written.
|
|
3
|
+
*
|
|
4
|
+
* The protocol asks for the plan in the reply. A 9B put it in its reasoning
|
|
5
|
+
* four times out of four (session 1789032320523_q29ta, assistant messages 7,
|
|
6
|
+
* 61, 77 and 79 — one of them a WHERE/WHAT/WHY table — every one of them with
|
|
7
|
+
* a reply of zero characters). The instruction was followed; the clause about
|
|
8
|
+
* where to put it was not, and nothing downstream reads reasoning, so the plan
|
|
9
|
+
* reached neither the user nor the transaction record.
|
|
10
|
+
*
|
|
11
|
+
* Rather than ask again in stronger words, read it. The assistant message for
|
|
12
|
+
* the current turn is already in `context.snapshot.messages` by the time its
|
|
13
|
+
* tool calls execute -- the runtime pushes it before running them -- so any
|
|
14
|
+
* tool call is a place to look, and the first one of the turn is the earliest
|
|
15
|
+
* moment the plan can be surfaced.
|
|
16
|
+
*
|
|
17
|
+
* Every tool is wrapped, not only the editing ones: a turn that states a plan
|
|
18
|
+
* and then reads a file before editing is stating a plan just as much as one
|
|
19
|
+
* that edits immediately, and the gate that asked for it fires on edits alone.
|
|
20
|
+
*
|
|
21
|
+
* Reported once per transaction. A plan is what opens a transaction; repeating
|
|
22
|
+
* it on every later tool call would turn one message into forty.
|
|
23
|
+
*/
|
|
24
|
+
import type { AgentToolDefinition } from "@cerebriline/shared";
|
|
25
|
+
/** Where the plan was found, which decides whether the user needs telling. */
|
|
26
|
+
export type PlanSource = "reply" | "reasoning";
|
|
27
|
+
export interface PlanCaptureSource {
|
|
28
|
+
/** Which transaction is open, so a new one can be given its own plan. */
|
|
29
|
+
readonly transaction: number;
|
|
30
|
+
/** Called at most once per transaction, with the plan as the model wrote it. */
|
|
31
|
+
readonly onPlan: (plan: string, from: PlanSource) => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Wrap every tool so the first plan of each transaction is reported once.
|
|
35
|
+
*
|
|
36
|
+
* The reply is preferred over the reasoning, and the source is passed on:
|
|
37
|
+
* a plan the model already put in its reply is on screen, and repeating it
|
|
38
|
+
* back to the user would be noise.
|
|
39
|
+
*/
|
|
40
|
+
export declare function withPlanCapture<T extends AgentToolDefinition>(tools: readonly T[], source: PlanCaptureSource): T[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the plan in what a model wrote, wherever it wrote it.
|
|
3
|
+
*
|
|
4
|
+
* The protocol asks for a plan before the first edit -- a numbered list, each
|
|
5
|
+
* entry naming WHERE, WHAT and WHY -- and says to put it in the reply "so it
|
|
6
|
+
* is on the record and the user can see it, not only in your reasoning". A 9B
|
|
7
|
+
* measured on a manic_miner session complied with the instruction and ignored
|
|
8
|
+
* that last clause, four times out of four: assistant messages 7, 61, 77 and
|
|
9
|
+
* 79 each carried a full `TX-01 Plan` with WHERE/WHAT/WHY -- one of them as a
|
|
10
|
+
* table -- and every one of them had a reply of exactly zero characters.
|
|
11
|
+
*
|
|
12
|
+
* That costs twice. The user never sees the plan, and `report.plan` is read
|
|
13
|
+
* off the reply, so the transaction record carries none either and the next
|
|
14
|
+
* transaction is told nothing about what the last one intended.
|
|
15
|
+
*
|
|
16
|
+
* Asking harder is not the fix at this size. Reading the reasoning is: the
|
|
17
|
+
* plan is there, in full, and it only has to be found.
|
|
18
|
+
*
|
|
19
|
+
* The danger in doing that is a false positive -- reasoning is long and
|
|
20
|
+
* discursive, and pasting the wrong part of it into the chat and into the
|
|
21
|
+
* transaction record would be worse than showing nothing. So recognition is
|
|
22
|
+
* deliberately strict: a plan must name all three of WHERE, WHAT and WHY, and
|
|
23
|
+
* must have list or table structure. Prose that merely discusses a plan does
|
|
24
|
+
* not qualify.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The plan stated in `text`, or nothing.
|
|
28
|
+
*
|
|
29
|
+
* Returns the block verbatim, trimmed. Verbatim matters: this is shown to the
|
|
30
|
+
* user as the model's own words and stored as the transaction's plan, and a
|
|
31
|
+
* summary of a plan is not a plan.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readPlan(text: string | undefined): string | undefined;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hold the plan, so that what worked is not lost the next time the model looks.
|
|
3
|
+
*
|
|
4
|
+
* The protocol asks for a numbered list of changes before the first edit, and
|
|
5
|
+
* `plan-text.ts` next door finds that list wherever the model wrote it. Both
|
|
6
|
+
* treat the plan as *text stated once*. Measured, that is not how a small model
|
|
7
|
+
* uses it.
|
|
8
|
+
*
|
|
9
|
+
* Session 1789139763721_ive21 on pandorum, 2026-09-11, a 9B on manic_miner:
|
|
10
|
+
* eleven separate blocks headed `## TX-01 Plan` or `## TX-02 Plan`, each one
|
|
11
|
+
* written from scratch against whatever the last check had just reported. Three
|
|
12
|
+
* things went wrong, and they compound:
|
|
13
|
+
*
|
|
14
|
+
* * **The header disagreed with the list.** Six of the eleven announced "2
|
|
15
|
+
* changes" or "4 changes" and then listed one. Nothing counted them.
|
|
16
|
+
*
|
|
17
|
+
* * **Nothing was carried forward.** Message 37 says, in prose, "I've already
|
|
18
|
+
* made two edits that landed" — and then plans four more as if starting
|
|
19
|
+
* from the original file. The two that landed are named nowhere.
|
|
20
|
+
*
|
|
21
|
+
* * **The same line was re-planned five times.** Line 90 at messages 7, 9 and
|
|
22
|
+
* 11, then again at 144 after the transaction boundary. It was re-deriving
|
|
23
|
+
* one fix from one error, repeatedly, because the fix existed only as a
|
|
24
|
+
* side effect on disk and never as something it could read back.
|
|
25
|
+
*
|
|
26
|
+
* When TX-01 was discarded, the disk side effects went with it and there was
|
|
27
|
+
* nothing left at all. The user's words for it: "the banked wins are lost".
|
|
28
|
+
*
|
|
29
|
+
* So this is a place to put them. Three things follow from the failure above
|
|
30
|
+
* and are the whole design:
|
|
31
|
+
*
|
|
32
|
+
* * **The tool numbers the items**, so a count can never disagree with a
|
|
33
|
+
* list — there is no count to write.
|
|
34
|
+
* * **Every call returns the whole plan**, so the current state is in front
|
|
35
|
+
* of the model at the moment it is deciding what to do next, rather than
|
|
36
|
+
* forty messages up.
|
|
37
|
+
* * **A discard does not erase the record.** The items survive with their
|
|
38
|
+
* history: an item that landed in TX-01 comes back marked `pending` (the
|
|
39
|
+
* file really was rolled back) but reads `landed in TX-01, rolled back`,
|
|
40
|
+
* which is the sentence the model needed and never had.
|
|
41
|
+
*
|
|
42
|
+
* There is a second failure the same session showed, and it is why this tool
|
|
43
|
+
* writes the retrospective rather than only holding the plan.
|
|
44
|
+
*
|
|
45
|
+
* From TX-02 onward the protocol asks for four lines before the plan — WORKED,
|
|
46
|
+
* DID NOT, RE-USE, DIFFERENT. The model obliged, and then **stopped writing
|
|
47
|
+
* plans altogether**: every later block is headed "TX-02 Retrospective & Plan"
|
|
48
|
+
* and the plan half has collapsed into the DIFFERENT line as prose ("Make ONE
|
|
49
|
+
* precise editor call replacing line 89..."). The retrospective displaced the
|
|
50
|
+
* thing it was meant to precede.
|
|
51
|
+
*
|
|
52
|
+
* It is also the half the model is worst at. WORKED and DID NOT are questions
|
|
53
|
+
* about what happened, asked of a model whose recollection of what happened is
|
|
54
|
+
* exactly what failed — the same session reported "I've exhausted my 71
|
|
55
|
+
* restore_file attempts" when nothing had been exhausted. But this tool knows
|
|
56
|
+
* what happened: it recorded it. So when a transaction rolls over it writes
|
|
57
|
+
* WORKED, DID NOT and RE-USE itself, from the record, and asks the model only
|
|
58
|
+
* for DIFFERENT — which is the new plan, and is the one part no record can
|
|
59
|
+
* supply.
|
|
60
|
+
*
|
|
61
|
+
* It stores nothing about the files and changes nothing on disk. A plan is a
|
|
62
|
+
* statement of intent, and this keeps the statement.
|
|
63
|
+
*/
|
|
64
|
+
import { type AgentTool } from "@cerebriline/shared";
|
|
65
|
+
export declare const PLAN_TOOL_NAME = "plan";
|
|
66
|
+
/** Where an item stands in the transaction that is open now. */
|
|
67
|
+
export type PlanItemStatus = "pending" | "done" | "failed";
|
|
68
|
+
/** What happened to an item in a transaction that has since closed. */
|
|
69
|
+
interface PlanItemAttempt {
|
|
70
|
+
readonly transaction: number;
|
|
71
|
+
readonly status: Exclude<PlanItemStatus, "pending">;
|
|
72
|
+
readonly note?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface PlanItem {
|
|
75
|
+
/** 1-based, assigned here, and stable for the life of the run. */
|
|
76
|
+
readonly id: number;
|
|
77
|
+
readonly where: string;
|
|
78
|
+
readonly what: string;
|
|
79
|
+
readonly why: string;
|
|
80
|
+
status: PlanItemStatus;
|
|
81
|
+
note?: string;
|
|
82
|
+
/** Every closed transaction this item was touched in, oldest first. */
|
|
83
|
+
readonly history: PlanItemAttempt[];
|
|
84
|
+
}
|
|
85
|
+
/** Declarations allowed per transaction, so re-planning is bounded. */
|
|
86
|
+
export declare const MAX_DECLARATIONS_PER_TRANSACTION = 3;
|
|
87
|
+
export declare const PLAN_TOOL_DESCRIPTION = "Keep the plan for this task: what you intend to change, and which of those changes have landed.\n\nCall it three ways.\n\nTo state the plan, send `changes`: a list, each entry naming WHERE (the function, or the exact text you will match on), WHAT (the single concrete edit) and WHY (the symptom it removes). Numbering is done for you \u2014 send the list, not a count.\n\nTo record that an item landed, send `done` with its number, and optionally `note`. Do this the moment the edit applies, not at the end. An item you do not mark is an item you will plan again.\n\nTo record that an item did not work, send `failed` with its number and a `note` saying what happened.\n\nEvery call returns the whole plan with its current state, so you never have to remember it or scroll back for it. Read what comes back before deciding what to do next.\n\nThe plan survives a discarded transaction. An item that landed and was then rolled back comes back as work still to do, but it is still on the record as something that once worked \u2014 which is the fastest route back to a working file.";
|
|
88
|
+
export declare const PLAN_TOOL_INPUT_SCHEMA: {
|
|
89
|
+
readonly type: "object";
|
|
90
|
+
readonly properties: {
|
|
91
|
+
readonly changes: {
|
|
92
|
+
readonly type: "array";
|
|
93
|
+
readonly description: "The plan, as a list. Each entry names where, what and why. Replaces any plan already stated.";
|
|
94
|
+
readonly items: {
|
|
95
|
+
readonly type: "object";
|
|
96
|
+
readonly properties: {
|
|
97
|
+
readonly where: {
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly description: "The function, or the exact text you will match on.";
|
|
100
|
+
};
|
|
101
|
+
readonly what: {
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
readonly description: "The single concrete edit you will make there.";
|
|
104
|
+
};
|
|
105
|
+
readonly why: {
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
readonly description: "The specific symptom it removes.";
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly required: readonly ["where", "what", "why"];
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly done: {
|
|
114
|
+
readonly type: "number";
|
|
115
|
+
readonly description: "The number of an item whose edit has just landed.";
|
|
116
|
+
};
|
|
117
|
+
readonly failed: {
|
|
118
|
+
readonly type: "number";
|
|
119
|
+
readonly description: "The number of an item that did not work.";
|
|
120
|
+
};
|
|
121
|
+
readonly note: {
|
|
122
|
+
readonly type: "string";
|
|
123
|
+
readonly description: "What happened, for the item named by `done` or `failed`.";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
readonly required: readonly [];
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* The part of the controller this tool reads.
|
|
130
|
+
*
|
|
131
|
+
* Only the transaction number. The change budget arrives as an option instead
|
|
132
|
+
* of being read off the controller, because the controller does not publish it
|
|
133
|
+
* and widening its surface for one number is the wrong trade.
|
|
134
|
+
*/
|
|
135
|
+
export interface PlanTransactionSource {
|
|
136
|
+
/** Which transaction is open. A change here means the last one closed. */
|
|
137
|
+
readonly transaction: number;
|
|
138
|
+
}
|
|
139
|
+
export interface PlanToolOptions {
|
|
140
|
+
controller: PlanTransactionSource;
|
|
141
|
+
/** The protocol's change budget, which bounds the list. */
|
|
142
|
+
maxChanges: number;
|
|
143
|
+
/** Called when the plan changes, so a host can show it. */
|
|
144
|
+
onPlan?: (items: readonly PlanItem[]) => void;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* What the closed transaction actually did, in the protocol's own four heads.
|
|
148
|
+
*
|
|
149
|
+
* Written from the record rather than from recollection. WORKED is what landed
|
|
150
|
+
* before the rollback, DID NOT is what was tried and refused, RE-USE is both of
|
|
151
|
+
* those together — they are the findings that survive a rollback even though
|
|
152
|
+
* the edits do not. DIFFERENT is left blank on purpose: it is the new plan, and
|
|
153
|
+
* asking for it is the point.
|
|
154
|
+
*/
|
|
155
|
+
export declare function renderRetrospective(items: readonly PlanItem[], closed: number): string;
|
|
156
|
+
/** The whole plan as the model reads it back. */
|
|
157
|
+
export declare function renderPlan(items: readonly PlanItem[], transaction: number): string;
|
|
158
|
+
export declare function createPlanTool(options: PlanToolOptions): AgentTool;
|
|
159
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A check the model proposes and the user approves.
|
|
3
|
+
*
|
|
4
|
+
* `discoverOracle` answers "what can this workspace run", and where the answer
|
|
5
|
+
* is nothing the protocol falls back to the model's own account of its work —
|
|
6
|
+
* which is the weakest thing in this area and the source of every wrong
|
|
7
|
+
* verdict measured so far. The model, though, has just read the code and knows
|
|
8
|
+
* what would demonstrate the fix. What it cannot do is decide that its own
|
|
9
|
+
* exam is fair, so the user approves it.
|
|
10
|
+
*
|
|
11
|
+
* Two properties hold this together, and neither is optional:
|
|
12
|
+
*
|
|
13
|
+
* 1. *The user approves the exact text.* A proposed command is arbitrary shell
|
|
14
|
+
* that the host will then run repeatedly and trust as a judge, so approval
|
|
15
|
+
* is a security boundary rather than a convenience. It never falls under
|
|
16
|
+
* auto-approve, and a proposal that differs by one character is a new one.
|
|
17
|
+
* 2. *It is frozen once approved.* A model that may re-propose after a failed
|
|
18
|
+
* transaction will weaken the check until one passes, which is an elaborate
|
|
19
|
+
* way of producing `self-declared`. Changing it costs a user interaction.
|
|
20
|
+
*/
|
|
21
|
+
import type { Oracle, OracleVerdict } from "./oracle";
|
|
22
|
+
/** What the model asks for, before anything has agreed to it. */
|
|
23
|
+
export interface CheckProposal {
|
|
24
|
+
/**
|
|
25
|
+
* `page` is the harness's own check and needs nothing installed; `command`
|
|
26
|
+
* is a line for the shell, which may not exist on this machine and is why
|
|
27
|
+
* a proposal is validated before it is trusted.
|
|
28
|
+
*/
|
|
29
|
+
kind: "page" | "command";
|
|
30
|
+
/** For `page`: the file to load, relative to the workspace root. */
|
|
31
|
+
path?: string;
|
|
32
|
+
/** For `command`: the line to run, exactly as the user would type it. */
|
|
33
|
+
command?: string;
|
|
34
|
+
/** For `command`: what the output must say, on top of exiting cleanly. */
|
|
35
|
+
expect?: string;
|
|
36
|
+
/** Why this check answers the task. Shown to the user, who decides. */
|
|
37
|
+
reason: string;
|
|
38
|
+
}
|
|
39
|
+
/** The tool the model names a check with. Here so the prompt can say it without importing the tool. */
|
|
40
|
+
export declare const PROPOSE_CHECK_TOOL_NAME = "propose_check";
|
|
41
|
+
/** How many rounds of proposing the model gets before the protocol moves on. */
|
|
42
|
+
export declare const MAX_CHECK_PROPOSALS = 2;
|
|
43
|
+
/**
|
|
44
|
+
* Discarded attempts before a check that has never passed may be replaced.
|
|
45
|
+
*
|
|
46
|
+
* The freeze is what stops a model weakening its check until one passes, so it
|
|
47
|
+
* is not lifted lightly — but a check that cannot pass at all freezes the run
|
|
48
|
+
* into failure, and measured over ten runs that cost two of them outright.
|
|
49
|
+
* Both spent every transaction they had. See `TransactionController`, which
|
|
50
|
+
* owns the condition; this is only the number of attempts of evidence needed
|
|
51
|
+
* before the check itself is allowed to be the suspect.
|
|
52
|
+
*
|
|
53
|
+
* Zero turns it off, which is the behaviour that preceded it.
|
|
54
|
+
*/
|
|
55
|
+
export declare const DEFAULT_CHECK_RECONSIDERED_AFTER = 2;
|
|
56
|
+
export type CheckApproval = {
|
|
57
|
+
approved: true;
|
|
58
|
+
}
|
|
59
|
+
/** Declined, with what the user wants instead — the model's next round. */
|
|
60
|
+
| {
|
|
61
|
+
approved: false;
|
|
62
|
+
feedback?: string;
|
|
63
|
+
};
|
|
64
|
+
/** Asks the user. Absent on a host with nobody to ask, which is not a failure. */
|
|
65
|
+
export type CheckApprover = (proposal: CheckProposal, described: string) => Promise<CheckApproval>;
|
|
66
|
+
/** A proposal that cannot be used, and the sentence the model is told why. */
|
|
67
|
+
export interface ProposalRejection {
|
|
68
|
+
problem: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Read a proposal off a tool call, or say what is wrong with it.
|
|
72
|
+
*
|
|
73
|
+
* Through a typed tool and validated here, never by reading the model's prose.
|
|
74
|
+
* `readSelfReport` is already a phrase-matching heuristic and it is the
|
|
75
|
+
* weakest thing in this protocol; a second one deciding what the check is
|
|
76
|
+
* would compound it.
|
|
77
|
+
*/
|
|
78
|
+
export declare function readCheckProposal(input: unknown, workspaceRoot: string): CheckProposal | ProposalRejection;
|
|
79
|
+
/**
|
|
80
|
+
* The proposal as the user reads it before approving.
|
|
81
|
+
*
|
|
82
|
+
* Who runs it comes first, and this is not a style point. Measured on the
|
|
83
|
+
* first live use: the model proposed the page check — headless, in this
|
|
84
|
+
* process, no browser window and no human — and the dialog opened "Load and
|
|
85
|
+
* run `manic_miner.html`", which reads as an instruction to the person
|
|
86
|
+
* reading it. The model's own reason said "loading the page in a browser will
|
|
87
|
+
* confirm…", and the one line saying it runs inside Cline came last. The user
|
|
88
|
+
* declined it as manual work they would have to repeat every attempt. It was
|
|
89
|
+
* never manual, and this now says so before anything else.
|
|
90
|
+
*
|
|
91
|
+
* The exact text that will run still goes on its own line, because for a
|
|
92
|
+
* command that is the thing being approved.
|
|
93
|
+
*/
|
|
94
|
+
export declare function describeCheckProposal(proposal: CheckProposal): string;
|
|
95
|
+
/** The approved proposal as the thing that judges transactions. */
|
|
96
|
+
export declare function proposalToOracle(proposal: CheckProposal, workspaceRoot: string): Oracle;
|
|
97
|
+
/** Whether two proposals are the same one, for "approved already" purposes. */
|
|
98
|
+
export declare function sameProposal(a: CheckProposal, b: CheckProposal): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the output is an interpreter rejecting the check, not a verdict.
|
|
101
|
+
*
|
|
102
|
+
* Exported for the tests that pin each signature to the run that produced it.
|
|
103
|
+
*/
|
|
104
|
+
export declare function readBrokenCheck(verdict: OracleVerdict): {
|
|
105
|
+
what: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
export declare function judgeCandidateCheck(verdict: OracleVerdict, proposal?: CheckProposal): {
|
|
108
|
+
usable: true;
|
|
109
|
+
} | {
|
|
110
|
+
usable: false;
|
|
111
|
+
problem: string;
|
|
112
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tool a model proposes its own check with.
|
|
3
|
+
*
|
|
4
|
+
* Offered only where there is nothing to run: `discoverOracle` found no test
|
|
5
|
+
* runner, no build and no compiler, so without this the transaction's verdict
|
|
6
|
+
* is the model's own account of its work. Measured, that account is wrong
|
|
7
|
+
* often enough to be the reason this protocol exists — and the model is
|
|
8
|
+
* nonetheless the only party that has read the code and knows what would
|
|
9
|
+
* demonstrate the fix. So it proposes, and the user decides.
|
|
10
|
+
*
|
|
11
|
+
* The check it adopts is reachable from `run_check` for the rest of the run.
|
|
12
|
+
* That is not decoration: this tool used to promise a feedback loop that did
|
|
13
|
+
* not exist -- the check ran once, at the completion attempt -- and a model
|
|
14
|
+
* that believes it is being checked stops checking itself.
|
|
15
|
+
*
|
|
16
|
+
* A tool rather than a sentence in the closing message. `readSelfReport` is
|
|
17
|
+
* already a phrase-matching heuristic and it is the weakest thing here; a
|
|
18
|
+
* second one deciding what the check *is* would compound it.
|
|
19
|
+
*/
|
|
20
|
+
import { type AgentTool } from "@cerebriline/shared";
|
|
21
|
+
import type { Oracle, OracleVerdict } from "./oracle";
|
|
22
|
+
import { type CheckApprover, type CheckProposal, PROPOSE_CHECK_TOOL_NAME } from "./proposal";
|
|
23
|
+
export { PROPOSE_CHECK_TOOL_NAME };
|
|
24
|
+
export declare const PROPOSE_CHECK_TOOL_DESCRIPTION = "Propose the check that will decide whether your change worked, and ask the user to approve it once.\n\nNothing in this workspace can be run to judge a change, so without a check your own account of the work is the verdict \u2014 and that is the weakest evidence there is. Propose one instead. You have read the code; name the thing that would show the fix.\n\n**It must run without a person.** Once it is approved you run it yourself with `run_check`, as often as you like, and it is also run once when you finish. Never propose something a human performs \u2014 \"open it in a browser and see\", \"confirm the layout looks right\", \"check that it feels responsive\". Propose the mechanical thing that would catch the bug: running the file, a parse, a test, a linter, a script that exits non-zero when it is still broken.\n\nTwo kinds:\n- `kind: \"page\"` \u2014 Cline loads `path` in this process, runs its scripts and pumps animation frames. No browser window opens and nobody looks at it. It fails if the file does not parse, throws while loading, throws in a frame, or never draws. Nothing has to be installed, so prefer this for a page, a game or a script.\n- `kind: \"command\"` \u2014 a line for the shell, run unattended, with the workspace root as its working directory: write paths relative to it and do not `cd` anywhere first. Only worth proposing when you know it exists on this machine; a check that cannot run judges nothing. Add `expect` when the command reports its verdict in its output and exits cleanly either way \u2014 without one its exit code is the whole verdict, and a command that exits zero on a broken tree would keep every change you make.\n\nGive a `reason` in one sentence: what passing this check proves about the task. Write it about the code, not about how a person would test it \u2014 \"the level data is built before the first frame draws\", not \"loading it in a browser will confirm it works\". The user reads that sentence to decide.\n\nPropose once, early \u2014 as soon as you know what you are fixing. What is approved judges every attempt for the rest of the run and cannot be changed, so do not propose something you can already make pass.\n\nThen use it. `run_check` runs it against the files as they stand, settles nothing and rolls nothing back. Run it before you edit, to see the failure in the check's own words, and after each change. A check you only meet when you finish is a check that can only ever throw the transaction away.\n\nOnce the user approves it, it is tried against the files as they were before your changes, and it has to FAIL there. A check that already passes on the unmodified files cannot tell a fix from no fix, and is refused.";
|
|
25
|
+
export declare const PROPOSE_CHECK_TOOL_INPUT_SCHEMA: {
|
|
26
|
+
readonly type: "object";
|
|
27
|
+
readonly properties: {
|
|
28
|
+
readonly kind: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly enum: readonly ["page", "command"];
|
|
31
|
+
readonly description: "`page` for a file Cline loads and runs itself; `command` for a shell line.";
|
|
32
|
+
};
|
|
33
|
+
readonly path: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly description: "For `page`: the file to load, relative to the workspace root.";
|
|
36
|
+
};
|
|
37
|
+
readonly command: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly description: "For `command`: the exact line to run.";
|
|
40
|
+
};
|
|
41
|
+
readonly expect: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly description: "For `command`: a regular expression the output must match, on top of exiting cleanly. Matched inside Cline; never a command.";
|
|
44
|
+
};
|
|
45
|
+
readonly reason: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly description: "One sentence: what passing this check proves.";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly required: readonly ["kind", "reason"];
|
|
51
|
+
};
|
|
52
|
+
/** The part of the controller this tool drives. */
|
|
53
|
+
export interface CheckAdopter {
|
|
54
|
+
readonly canAdoptOracle: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the check in force is up for replacement, this transaction.
|
|
57
|
+
*
|
|
58
|
+
* Absent on a controller that does not offer it, which reads as never.
|
|
59
|
+
*/
|
|
60
|
+
readonly checkIsUnderReconsideration?: boolean;
|
|
61
|
+
adoptOracle(oracle: Oracle): void;
|
|
62
|
+
/** Runs a candidate against the files this transaction opened on. */
|
|
63
|
+
judgeAgainstBase(oracle: Oracle): Promise<OracleVerdict>;
|
|
64
|
+
}
|
|
65
|
+
export interface ProposeCheckToolOptions {
|
|
66
|
+
workspaceRoot: string;
|
|
67
|
+
controller: CheckAdopter;
|
|
68
|
+
/** Rounds put to the user before the run gives up on having a check. */
|
|
69
|
+
maxProposals?: number;
|
|
70
|
+
/** Asks the user. The security boundary, and never auto-approved. */
|
|
71
|
+
approve: CheckApprover;
|
|
72
|
+
/** For the host to say, in its own voice, what now judges the run. */
|
|
73
|
+
onAdopted?: (oracle: Oracle, proposal: CheckProposal) => void;
|
|
74
|
+
onError?: (message: string, error: unknown) => void;
|
|
75
|
+
}
|
|
76
|
+
export declare function createProposeCheckTool(options: ProposeCheckToolOptions): AgentTool;
|