@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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Early SDK logger for components that operate before/outside of `ClineCore`
|
|
3
|
+
* sessions, plus a secret-hashing helper for credential diagnostics.
|
|
4
|
+
*
|
|
5
|
+
* `ClineCore.create({ logger })` receives a `BasicLogger` but it is only
|
|
6
|
+
* threaded to session-scoped components. `ProviderSettingsManager`,
|
|
7
|
+
* `RuntimeOAuthTokenManager`, and the Cline auth functions in `cline.ts` are
|
|
8
|
+
* constructed or called before `ClineCore` exists or outside a session.
|
|
9
|
+
* Hosts call `setSdkLogger()` once at startup and every early component picks
|
|
10
|
+
* it up without threading loggers through every constructor.
|
|
11
|
+
*
|
|
12
|
+
* When no logger is registered, every call is a no-op.
|
|
13
|
+
*
|
|
14
|
+
* Secrets are never logged in cleartext; {@link hashSecret} produces an
|
|
15
|
+
* 8-hex-digit fingerprint that is stable for the same value but irreversible.
|
|
16
|
+
*/
|
|
17
|
+
import type { BasicLogger } from "@cerebriline/shared";
|
|
18
|
+
/**
|
|
19
|
+
* Register the logger used by {@link sdkDebug}. Pass `undefined` to disable.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setSdkLogger(logger: BasicLogger | undefined): void;
|
|
22
|
+
/** @internal Returns the currently registered early logger (for testing). */
|
|
23
|
+
export declare function getSdkLogger(): BasicLogger | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Short, stable fingerprint of a secret for debug logging (8 hex digits of a
|
|
26
|
+
* SHA-256 digest). The same input always yields the same hash, making it easy
|
|
27
|
+
* to eyeball whether a token changed across log entries without leaking it.
|
|
28
|
+
*
|
|
29
|
+
* Returns `"unset"` for undefined/null/empty so absence is still visible.
|
|
30
|
+
*/
|
|
31
|
+
export declare function hashSecret(value: unknown): string;
|
|
32
|
+
/**
|
|
33
|
+
* Emit a debug-level SDK diagnostic message (already a formatted string).
|
|
34
|
+
* Best-effort: swallows errors from the underlying logger so logging never
|
|
35
|
+
* breaks auth/storage flows.
|
|
36
|
+
*/
|
|
37
|
+
export declare function sdkDebug(message: string): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AgentExtension, buildRemoteConfigSessionBlobUploadMetadata, type ITelemetryService, type OpenTelemetryClientConfig, type PreparedRemoteConfigRuntime, type PrepareRemoteConfigRuntimeOptions, REMOTE_CONFIG_SESSION_BLOB_UPLOAD_METADATA_KEY, readRemoteConfigSessionBlobUploadMetadata, registerRemoteConfigSessionBlobUpload } from "@cerebriline/shared";
|
|
2
|
+
import type { ClineCoreStartInput } from "../cline-core/types";
|
|
3
|
+
import type { CreateOpenTelemetryTelemetryServiceOptions } from "../services/telemetry/OpenTelemetryProvider";
|
|
4
|
+
import type { SessionMessagesArtifactUploader } from "../types/session";
|
|
5
|
+
export interface PrepareRemoteConfigCoreIntegrationOptions extends PrepareRemoteConfigRuntimeOptions {
|
|
6
|
+
telemetryService?: Omit<CreateOpenTelemetryTelemetryServiceOptions, keyof OpenTelemetryClientConfig>;
|
|
7
|
+
}
|
|
8
|
+
export interface PreparedRemoteConfigCoreIntegration {
|
|
9
|
+
prepared: PreparedRemoteConfigRuntime;
|
|
10
|
+
extensions: AgentExtension[];
|
|
11
|
+
telemetry?: ITelemetryService;
|
|
12
|
+
applyToStartSessionInput(input: ClineCoreStartInput): ClineCoreStartInput;
|
|
13
|
+
dispose(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createRemoteConfigSessionMessagesArtifactUploader(): SessionMessagesArtifactUploader;
|
|
16
|
+
export declare function prepareRemoteConfigCoreIntegration(options: PrepareRemoteConfigCoreIntegrationOptions): Promise<PreparedRemoteConfigCoreIntegration>;
|
|
17
|
+
export { buildRemoteConfigSessionBlobUploadMetadata, REMOTE_CONFIG_SESSION_BLOB_UPLOAD_METADATA_KEY, readRemoteConfigSessionBlobUploadMetadata, registerRemoteConfigSessionBlobUpload, };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `read_files` with a `revision`, offered wherever a file history is being kept.
|
|
3
|
+
*
|
|
4
|
+
* Built for the change protocol and worded for it; the escalation keeps a
|
|
5
|
+
* history of its own -- the expert's writes, so the base model can check a note
|
|
6
|
+
* against the bytes it was about -- and needs the same reads under different
|
|
7
|
+
* words. `RevisionWording` below is that seam, and the change protocol's words
|
|
8
|
+
* remain the default, so nothing that called this before sees any change.
|
|
9
|
+
*
|
|
10
|
+
* A decoration rather than a parameter on the built-in tool, and deliberately:
|
|
11
|
+
* without an open transaction there is no base revision, and a schema that
|
|
12
|
+
* advertises one anyway teaches the model a call that can only ever be
|
|
13
|
+
* refused. Every host that runs without the protocol sees exactly the tool it
|
|
14
|
+
* saw before this existed — same description, same schema, same behaviour.
|
|
15
|
+
*
|
|
16
|
+
* The read is the safe half of this pair. `restore_file` next door hands the
|
|
17
|
+
* model a lever it can pull too often; this one only ever adds information, so
|
|
18
|
+
* a model that leans on it cannot thrash with it.
|
|
19
|
+
*/
|
|
20
|
+
import type { AgentToolDefinition } from "@cerebriline/shared";
|
|
21
|
+
import { type RevisionLog } from "./file-revisions";
|
|
22
|
+
import type { Snapshot } from "./snapshot";
|
|
23
|
+
/** The value that asks for the transaction's copy instead of the file on disk. */
|
|
24
|
+
export declare const BASE_REVISION = "base";
|
|
25
|
+
/** What the decoration needs from the controller, and nothing more. */
|
|
26
|
+
export interface BaseRevisionSource {
|
|
27
|
+
/** The open transaction's base, or nothing when none is open. */
|
|
28
|
+
readonly pending: Snapshot | undefined;
|
|
29
|
+
/** Which transaction is open, for messages that need to name it. */
|
|
30
|
+
readonly transaction: number;
|
|
31
|
+
/** Every version of every file a tool has written. */
|
|
32
|
+
readonly revisions: RevisionLog;
|
|
33
|
+
/**
|
|
34
|
+
* Where paths resolve when no transaction is open.
|
|
35
|
+
*
|
|
36
|
+
* Supplying it lets a session read its own history with the change protocol
|
|
37
|
+
* off. There is no base snapshot then, so `#1` comes from the log, seeded
|
|
38
|
+
* from the file itself at first touch — which is what the compaction
|
|
39
|
+
* ledger's addresses point at either way.
|
|
40
|
+
*/
|
|
41
|
+
readonly root?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The words that differ between the two histories this decoration can serve.
|
|
45
|
+
*
|
|
46
|
+
* One machinery, two arrangements. The change protocol's log holds the base
|
|
47
|
+
* model's own edits inside its open transaction; the escalation's holds the
|
|
48
|
+
* expert's edits while the base model stands down and watches. The numbering,
|
|
49
|
+
* the de-duplication and the reads are identical. What is not identical is who
|
|
50
|
+
* wrote the versions and what the reader means to do with them -- and a reader
|
|
51
|
+
* told "your own edits are not in it" about somebody else's edits has been
|
|
52
|
+
* told something false.
|
|
53
|
+
*/
|
|
54
|
+
export interface RevisionWording {
|
|
55
|
+
/** Appended to `read_files`' description. */
|
|
56
|
+
readonly description: string;
|
|
57
|
+
/** The `revision` parameter's own description. */
|
|
58
|
+
readonly parameter: string;
|
|
59
|
+
/** What a refusal calls the span: "this transaction", "this escalation". */
|
|
60
|
+
readonly span: string;
|
|
61
|
+
/** What a served revision #1 is called. */
|
|
62
|
+
readonly baseLabel: string;
|
|
63
|
+
/** The refusal when nothing is open at all. */
|
|
64
|
+
readonly closed: string;
|
|
65
|
+
}
|
|
66
|
+
/** How the change protocol talks about its own revisions. The default. */
|
|
67
|
+
export declare const TRANSACTION_REVISION_WORDING: RevisionWording;
|
|
68
|
+
/** How the escalation talks about the expert's revisions. */
|
|
69
|
+
/**
|
|
70
|
+
* The words for a session that has no transactions.
|
|
71
|
+
*
|
|
72
|
+
* Same machinery, third arrangement. `#1` here is the file as this session
|
|
73
|
+
* first found it rather than a base a rollback returns the tree to, and the
|
|
74
|
+
* "closed" line has to say something the model can act on: with the protocol
|
|
75
|
+
* off there is no transaction to open, so "no transaction is open" would be
|
|
76
|
+
* true forever and mean nothing.
|
|
77
|
+
*/
|
|
78
|
+
export declare const SESSION_REVISION_WORDING: RevisionWording;
|
|
79
|
+
export declare const ESCALATION_REVISION_WORDING: RevisionWording;
|
|
80
|
+
/**
|
|
81
|
+
* A second history that takes over while it is live.
|
|
82
|
+
*
|
|
83
|
+
* The escalation's, in practice. Two logs exist at once during a hand-over --
|
|
84
|
+
* the base model's open transaction and the expert's writes -- and they cannot
|
|
85
|
+
* both answer `revision: "#3"`. They do not have to: while the expert has the
|
|
86
|
+
* pen the base model is standing down and its own transaction is not moving,
|
|
87
|
+
* so the only numbers that mean anything are the expert's, and those are the
|
|
88
|
+
* ones the notes are quoting. When the escalation closes and the log is
|
|
89
|
+
* purged, this stops being live and the transaction answers again.
|
|
90
|
+
*
|
|
91
|
+
* Stacking two decorations instead would not work: the outer one would take
|
|
92
|
+
* `revision` off the input and the inner would never see it.
|
|
93
|
+
*/
|
|
94
|
+
export interface RevisionOverlay {
|
|
95
|
+
readonly source: BaseRevisionSource;
|
|
96
|
+
readonly wording: RevisionWording;
|
|
97
|
+
/** Whether this is the history a `revision` means right now. */
|
|
98
|
+
live(): boolean;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Return the tool list with `read_files` able to serve the transaction's base.
|
|
102
|
+
*
|
|
103
|
+
* Wraps rather than rebuilds, so every wrapper already applied to the tool —
|
|
104
|
+
* task-progress capture, edit verification — still sees an ordinary read.
|
|
105
|
+
*/
|
|
106
|
+
export declare function withBaseRevisionReads<T extends AgentToolDefinition>(tools: readonly T[], source: BaseRevisionSource, wording?: RevisionWording, overlay?: RevisionOverlay): T[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transaction's base revision, addressed by path.
|
|
3
|
+
*
|
|
4
|
+
* A transaction already holds what every file said when it opened — that copy
|
|
5
|
+
* is the undo the whole protocol is built on. Until now only the rollback
|
|
6
|
+
* could read it, and the model, having mangled a file, had to reconstruct the
|
|
7
|
+
* original from memory.
|
|
8
|
+
*
|
|
9
|
+
* Measured on the run that prompted this (pandorum, 2026-09-05, 7328s, three
|
|
10
|
+
* discarded transactions): 22 of 43 edits re-edited a line the same
|
|
11
|
+
* transaction had already edited, and 91% of the run's wall clock fell after
|
|
12
|
+
* the model first wrote "I accidentally deleted the entire `dDec` method. Let
|
|
13
|
+
* me restore it correctly" — restoring, from memory, a 400-character minified
|
|
14
|
+
* line. The snapshot next door had it exactly.
|
|
15
|
+
*
|
|
16
|
+
* So: one resolver, shared by the read side and the restore side, and it
|
|
17
|
+
* distinguishes the cases rather than collapsing them into "not found". A file
|
|
18
|
+
* the transaction created and a file the snapshot could not hold both have no
|
|
19
|
+
* base revision, and they mean opposite things.
|
|
20
|
+
*/
|
|
21
|
+
import type { Snapshot } from "./snapshot";
|
|
22
|
+
/** How a requested path relates to the transaction's base. */
|
|
23
|
+
export type BaseFileLookup =
|
|
24
|
+
/** The snapshot holds it, with these bytes. */
|
|
25
|
+
{
|
|
26
|
+
readonly kind: "held";
|
|
27
|
+
readonly absolutePath: string;
|
|
28
|
+
readonly body: Buffer;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Inside the snapshot's root, and the snapshot does not hold it — so this
|
|
32
|
+
* transaction created it. Its base revision is the file not existing, which
|
|
33
|
+
* is a real answer and not a failure.
|
|
34
|
+
*/
|
|
35
|
+
| {
|
|
36
|
+
readonly kind: "created";
|
|
37
|
+
readonly absolutePath: string;
|
|
38
|
+
}
|
|
39
|
+
/** The snapshot skipped it: too large, a symlink, or past the limits. */
|
|
40
|
+
| {
|
|
41
|
+
readonly kind: "uncovered";
|
|
42
|
+
readonly absolutePath: string;
|
|
43
|
+
}
|
|
44
|
+
/** Outside the root the transaction covers, so nothing was ever held. */
|
|
45
|
+
| {
|
|
46
|
+
readonly kind: "outside";
|
|
47
|
+
readonly absolutePath: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Resolve a path the model gave against the transaction's base.
|
|
51
|
+
*
|
|
52
|
+
* Relative paths resolve against the snapshot's root rather than the process
|
|
53
|
+
* working directory: the root is what the transaction covers, and resolving
|
|
54
|
+
* elsewhere would report "outside the transaction" for a file sitting in it.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveBaseFile(snapshot: Snapshot, requestedPath: string): BaseFileLookup;
|
|
57
|
+
/**
|
|
58
|
+
* Why a path has no base text to show, in the words the model gets.
|
|
59
|
+
*
|
|
60
|
+
* Never "not found": each of these is a different fact about the transaction,
|
|
61
|
+
* and a model told the wrong one goes looking for the wrong thing.
|
|
62
|
+
*/
|
|
63
|
+
export declare function describeMissingBase(lookup: Exclude<BaseFileLookup, {
|
|
64
|
+
kind: "held";
|
|
65
|
+
}>): string;
|
|
66
|
+
/** Whether a snapshot's bytes can be shown as text at all. */
|
|
67
|
+
export declare function isTextBody(body: Buffer): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve a path against the workspace, for a session with no transaction.
|
|
70
|
+
*
|
|
71
|
+
* The same answers `resolveBaseFile` gives, minus the one that needs a
|
|
72
|
+
* snapshot: there is no `uncovered`, because nothing was skipped by a snapshot
|
|
73
|
+
* that was never taken. A file inside the root reads as `created`, which here
|
|
74
|
+
* means "the log decides what it had" — and the log is seeded from the file
|
|
75
|
+
* itself at first touch, so that is exactly right.
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveSessionFile(root: string, requestedPath: string): BaseFileLookup;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hold the first edit of a transaction until the model has run the check.
|
|
3
|
+
*
|
|
4
|
+
* The protocol has said "before you edit anything, so you see the failure in
|
|
5
|
+
* its own words" since it was written, and it is the sentence models skip.
|
|
6
|
+
* Measured on a JackDelta 9B session, per transaction, counting from the first
|
|
7
|
+
* tool call:
|
|
8
|
+
*
|
|
9
|
+
* TX-01 first `run_check` at tool call #25, after ten edits
|
|
10
|
+
* TX-02 #3
|
|
11
|
+
* TX-03 #0
|
|
12
|
+
* TX-04 #7
|
|
13
|
+
* TX-05 #0
|
|
14
|
+
*
|
|
15
|
+
* TX-01 is the expensive one and the pattern is the same every time it
|
|
16
|
+
* happens: the model reads the file, forms a theory from the source alone,
|
|
17
|
+
* edits against that theory, and only then asks the program what was actually
|
|
18
|
+
* wrong. In that run the first theory was a delimiter fault; the check, when
|
|
19
|
+
* it was finally run, reported `ReferenceError: collide is not defined`. Two
|
|
20
|
+
* dozen tool calls were spent before anything told it which of those it was
|
|
21
|
+
* looking at.
|
|
22
|
+
*
|
|
23
|
+
* So the sentence is turned into a gate. Not a permanent one: it refuses one
|
|
24
|
+
* edit, once per transaction. It is a nudge with a mechanism, not a new rule.
|
|
25
|
+
*
|
|
26
|
+
* It also asks for the plan, because that is the other thing the same run did
|
|
27
|
+
* not do: TX-01, TX-02 and TX-03 produced no plan text of any kind, the model
|
|
28
|
+
* going straight from reading to editing.
|
|
29
|
+
*
|
|
30
|
+
* Those two used to be one condition, and that was wrong. The gate fired only
|
|
31
|
+
* when the check had not been run, so a transaction that opened *with* the
|
|
32
|
+
* check bought an exemption from stating its plan. Measured on a later
|
|
33
|
+
* jackdelta-9b session that did exactly the right thing first: `run_check` was
|
|
34
|
+
* tool call #1 in TX-01, the gate therefore never fired, and no plan was
|
|
35
|
+
* stated -- 362 messages produced exactly one plan, in TX-02, and it appeared
|
|
36
|
+
* because the gate fired there. The model was rewarded for running the check
|
|
37
|
+
* by being asked for less.
|
|
38
|
+
*
|
|
39
|
+
* So the gate always fires once per transaction, and only the message changes:
|
|
40
|
+
* a model that has already run the check is asked for the plan alone, and is
|
|
41
|
+
* not told to re-run something it just ran.
|
|
42
|
+
*
|
|
43
|
+
* "Once" is once per turn, not once per call. A model that sends its edits as
|
|
44
|
+
* a parallel batch used to have exactly one of them refused while the rest
|
|
45
|
+
* applied, which is the worst of both: it was told its edit did not happen and
|
|
46
|
+
* asked for a plan, while two other edits it had not planned were already on
|
|
47
|
+
* disk. Measured on session 1789032320523_q29ta, assistant message 9: three
|
|
48
|
+
* `editor` calls in one message, the first held and the other two applied. So
|
|
49
|
+
* the hold covers every edit sharing the held call's iteration, and stands
|
|
50
|
+
* down from the next turn — which is the first moment the model could have
|
|
51
|
+
* read the refusal and answered it.
|
|
52
|
+
*/
|
|
53
|
+
import type { AgentToolDefinition } from "@cerebriline/shared";
|
|
54
|
+
/** What the gate needs to know, and nothing more. */
|
|
55
|
+
export interface CheckFirstSource {
|
|
56
|
+
/** Which transaction is open, so the gate can reset when it changes. */
|
|
57
|
+
readonly transaction: number;
|
|
58
|
+
/** How the check is named to the model, for a message it can act on. */
|
|
59
|
+
readonly checkLabel: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* What the model is told instead of its first edit.
|
|
63
|
+
*
|
|
64
|
+
* Written as the two things to do next rather than as a rule it broke: a
|
|
65
|
+
* refusal that argues is one a model answers, and the turn is worth more spent
|
|
66
|
+
* on the check than on the disagreement. It says the edit did not happen, in
|
|
67
|
+
* as many words, because a model that thinks the change landed will build the
|
|
68
|
+
* next one on top of it.
|
|
69
|
+
*/
|
|
70
|
+
export declare function describeCheckFirst(checkLabel: string, checkAlreadyRun?: boolean): string;
|
|
71
|
+
/**
|
|
72
|
+
* Wrap the editing tools so the first one waits for the check.
|
|
73
|
+
*
|
|
74
|
+
* Wrapping rather than asking the controller: whether the check has been run is
|
|
75
|
+
* a fact about this transaction's tool calls, and the tool list is where those
|
|
76
|
+
* are already passing. It also keeps the gate off entirely for a host with no
|
|
77
|
+
* check to run, which is the case it must not fire in.
|
|
78
|
+
*/
|
|
79
|
+
export declare function withCheckFirstEdits<T extends AgentToolDefinition>(tools: readonly T[], source: CheckFirstSource): T[];
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A per-file history inside the open transaction.
|
|
3
|
+
*
|
|
4
|
+
* The transaction's base snapshot is one point in time, and `restore_file`
|
|
5
|
+
* could only ever go back to it. That is the whole complaint: a model that
|
|
6
|
+
* has fixed three things and broken the fourth has to choose between keeping
|
|
7
|
+
* the break and throwing away the three (user, 2026-09-13: "restoring to
|
|
8
|
+
* original doesn't work, the model is loosing all the wins or half wins and
|
|
9
|
+
* starts from scratch"). Measured in the same shape on arm p01 -- three
|
|
10
|
+
* transactions, 8 discards, not one kept.
|
|
11
|
+
*
|
|
12
|
+
* So every write to a file appends a revision holding what the file said
|
|
13
|
+
* afterwards, and the model can go back to any of them by number. Revision 1
|
|
14
|
+
* is always the file as the transaction opened, which is what `restore_file`
|
|
15
|
+
* used to be able to do and nothing more.
|
|
16
|
+
*
|
|
17
|
+
* Why per-file and not a tree snapshot per change. `takeSnapshot` walks the
|
|
18
|
+
* whole workspace and reads every file; doing that after each edit would make
|
|
19
|
+
* a 5,000-file repository unusable. A revision is already addressed per file
|
|
20
|
+
* -- the model asks to put *one file* back -- so only the file a tool wrote is
|
|
21
|
+
* captured.
|
|
22
|
+
*
|
|
23
|
+
* Why numbers and not hashes. The audience is a 9B model reading its own
|
|
24
|
+
* conversation. `#4` is orderable, self-describing and cannot be confused with
|
|
25
|
+
* a path; `a3f9c21` is a token this model class invents when it half-remembers
|
|
26
|
+
* one, and a fabricated hash is indistinguishable from a real one until it is
|
|
27
|
+
* refused.
|
|
28
|
+
*
|
|
29
|
+
* Append-only. Restoring to #2 does not renumber anything -- it appends a new
|
|
30
|
+
* revision whose content equals #2. A model re-reads its own history
|
|
31
|
+
* constantly, and a #3 that silently stops meaning what it meant is worse than
|
|
32
|
+
* a larger number.
|
|
33
|
+
*/
|
|
34
|
+
/** What a file said at one point in the transaction. */
|
|
35
|
+
export interface FileRevision {
|
|
36
|
+
/** One-based, in the order they were made. #1 is the transaction's base. */
|
|
37
|
+
readonly index: number;
|
|
38
|
+
/** The content, or nothing when the file did not exist at that point. */
|
|
39
|
+
readonly body: Buffer | undefined;
|
|
40
|
+
readonly hash: string;
|
|
41
|
+
/** What produced it: a tool name, or `transaction open` for #1. */
|
|
42
|
+
readonly by: string;
|
|
43
|
+
/**
|
|
44
|
+
* One line saying what this revision is, so the list can be chosen from.
|
|
45
|
+
*
|
|
46
|
+
* Without it every entry reads `editor — 136 lines` and the only one
|
|
47
|
+
* carrying meaning is `#1 original`, which is measurably the only one the
|
|
48
|
+
* model ever asked for: 132 restores across three runs, 132 to the
|
|
49
|
+
* original. A number is an address; this is the reason to go to it.
|
|
50
|
+
*
|
|
51
|
+
* `model` when the tool call said what it was for, `derived` when we had to
|
|
52
|
+
* work it out. Never absent — an unlabelled revision is one the model
|
|
53
|
+
* cannot choose, which is the whole defect.
|
|
54
|
+
*/
|
|
55
|
+
readonly note: string;
|
|
56
|
+
readonly noteSource: "model" | "derived";
|
|
57
|
+
readonly lines: number;
|
|
58
|
+
readonly bytes: number;
|
|
59
|
+
/** Content released to stay under the memory cap; the entry remains. */
|
|
60
|
+
readonly dropped: boolean;
|
|
61
|
+
/** Kept for reading and restoring, never written to this workspace. */
|
|
62
|
+
readonly held?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The earliest revision holding exactly these bytes, when it is not this
|
|
65
|
+
* one.
|
|
66
|
+
*
|
|
67
|
+
* Worth surfacing rather than just exploiting. A model that edits, undoes
|
|
68
|
+
* and edits back to the same text is in the loop this whole feature exists
|
|
69
|
+
* to break, and its own history is the one place that can show it the shape
|
|
70
|
+
* of what it has been doing.
|
|
71
|
+
*/
|
|
72
|
+
readonly sameAs?: number;
|
|
73
|
+
}
|
|
74
|
+
export type RevisionLookup = {
|
|
75
|
+
kind: "found";
|
|
76
|
+
revision: FileRevision;
|
|
77
|
+
} | {
|
|
78
|
+
kind: "untracked";
|
|
79
|
+
} | {
|
|
80
|
+
kind: "dropped";
|
|
81
|
+
index: number;
|
|
82
|
+
} | {
|
|
83
|
+
kind: "unknown";
|
|
84
|
+
requested: string;
|
|
85
|
+
available: readonly number[];
|
|
86
|
+
};
|
|
87
|
+
export interface RevisionLimits {
|
|
88
|
+
/** Content held for one file before the middle is released. */
|
|
89
|
+
maxBytesPerFile?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Content held across every file before the middle is released.
|
|
92
|
+
*
|
|
93
|
+
* The per-file cap alone is only a bound when the log's lifetime is a
|
|
94
|
+
* transaction, which is short and touches a handful of files. A log that
|
|
95
|
+
* lives for the session touches as many files as the session does, and 32 MB
|
|
96
|
+
* each is not a limit — it is a limit per file, multiplied by a number
|
|
97
|
+
* nobody chose.
|
|
98
|
+
*/
|
|
99
|
+
maxBytesTotal?: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Content held per file before revisions start being released.
|
|
103
|
+
*
|
|
104
|
+
* A 4 MB file -- the snapshot's own per-file ceiling -- edited fifty times is
|
|
105
|
+
* 200 MB for one transaction, and a transaction is not the only thing in the
|
|
106
|
+
* process. 32 MB covers the realistic case (a 15 KB source file has room for
|
|
107
|
+
* two thousand revisions) and bounds the pathological one.
|
|
108
|
+
*/
|
|
109
|
+
export declare const DEFAULT_MAX_REVISION_BYTES_PER_FILE: number;
|
|
110
|
+
/**
|
|
111
|
+
* Content held across all files before the oldest is released.
|
|
112
|
+
*
|
|
113
|
+
* 128 MB: four times the per-file cap, so one pathological file cannot starve
|
|
114
|
+
* the rest, and small enough that a session holding the maximum is a number a
|
|
115
|
+
* person would recognise as deliberate rather than a leak. A session editing
|
|
116
|
+
* fifteen-kilobyte source files reaches it after roughly eight thousand
|
|
117
|
+
* revisions, which is not a session.
|
|
118
|
+
*/
|
|
119
|
+
export declare const DEFAULT_MAX_REVISION_BYTES_TOTAL: number;
|
|
120
|
+
/** Revisions listed in a receipt before the middle is elided. */
|
|
121
|
+
export declare const DEFAULT_REVISION_LIST_LIMIT = 10;
|
|
122
|
+
/** The name for the transaction's own base revision. */
|
|
123
|
+
export declare const ORIGINAL_REVISION = "original";
|
|
124
|
+
/** The state before the most recent change. */
|
|
125
|
+
export declare const LAST_REVISION = "last";
|
|
126
|
+
/** What a caller can say about a revision it is recording. */
|
|
127
|
+
export interface RevisionNote {
|
|
128
|
+
/** The model's own words, when the tool call carried them. */
|
|
129
|
+
readonly intent?: string;
|
|
130
|
+
/** What the writing tool reported doing, e.g. "Replaced line 90". */
|
|
131
|
+
readonly summary?: string;
|
|
132
|
+
/** What the checker said about this file afterwards, when it said anything. */
|
|
133
|
+
readonly check?: string;
|
|
134
|
+
/**
|
|
135
|
+
* The content was never written to this workspace: a delegated agent's
|
|
136
|
+
* version, kept so the lead can read or restore it. The file on disk is
|
|
137
|
+
* still the newest revision that is not held.
|
|
138
|
+
*/
|
|
139
|
+
readonly held?: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The revisions a file has, as one short label like `#1–#7`.
|
|
143
|
+
*
|
|
144
|
+
* What the compaction ledger prints beside a file, so the model reading a
|
|
145
|
+
* summary knows the earlier content exists and what to ask for. A range rather
|
|
146
|
+
* than a count because the numbers are the addresses: `3 revisions` leaves the
|
|
147
|
+
* reader to guess whether they are numbered from zero.
|
|
148
|
+
*
|
|
149
|
+
* A single revision is `#1`, never `#1–#1` — a range with nothing in the
|
|
150
|
+
* middle reads as a mistake, and this audience is a small model that will
|
|
151
|
+
* repeat what it reads.
|
|
152
|
+
*/
|
|
153
|
+
export declare function revisionSpan(revisions: readonly FileRevision[]): string | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* What `#1` is, in the two worlds this log lives in.
|
|
156
|
+
*
|
|
157
|
+
* `transaction` is the base snapshot — a rollback can return the whole tree to
|
|
158
|
+
* it. `session` is the file's own content at first touch, which undoes this
|
|
159
|
+
* session's writes to that file and promises nothing about the tree.
|
|
160
|
+
*/
|
|
161
|
+
export type RevisionOrigin = "transaction" | "session";
|
|
162
|
+
export interface RevisionLog {
|
|
163
|
+
/**
|
|
164
|
+
* Record the file as it was found. Ignored if already seeded.
|
|
165
|
+
*
|
|
166
|
+
* `origin` is what `#1` is said to be, and it is not cosmetic: inside a
|
|
167
|
+
* transaction `#1` is the base the rollback goes back to, and outside one it
|
|
168
|
+
* is merely what the file said the first time this session wrote to it. The
|
|
169
|
+
* second is a weaker promise, and a label claiming the first would teach the
|
|
170
|
+
* model to expect a rollback that cannot happen.
|
|
171
|
+
*/
|
|
172
|
+
seed(absolutePath: string, body: Buffer | undefined, origin?: RevisionOrigin): void;
|
|
173
|
+
/**
|
|
174
|
+
* Record what a tool left behind. Returns the new revision, or nothing when
|
|
175
|
+
* the content is what it already was -- a tool that reported a refusal, or
|
|
176
|
+
* an edit that replaced text with itself, has not made a revision.
|
|
177
|
+
*/
|
|
178
|
+
record(absolutePath: string, body: Buffer | undefined, by: string, note?: RevisionNote): FileRevision | undefined;
|
|
179
|
+
revisions(absolutePath: string): readonly FileRevision[];
|
|
180
|
+
resolve(absolutePath: string, requested: string): RevisionLookup;
|
|
181
|
+
tracked(): readonly string[];
|
|
182
|
+
/** Distinct bytes held for one file, after de-duplication. */
|
|
183
|
+
heldBytes(absolutePath: string): number;
|
|
184
|
+
/** Forget everything. A discard puts the tree back, so the history goes too. */
|
|
185
|
+
reset(): void;
|
|
186
|
+
/**
|
|
187
|
+
* Close the current compaction span and release what the next one cannot use.
|
|
188
|
+
*
|
|
189
|
+
* The retention policy, and it is semantic rather than a size. A revision
|
|
190
|
+
* exists so the ledger in a compaction summary can say "the content is not
|
|
191
|
+
* here, it is at `#4`", and so the model can go back to it. Both of those
|
|
192
|
+
* stop being possible two compactions later: the summary that named `#4`
|
|
193
|
+
* has itself been folded into a newer summary, and nothing the model can
|
|
194
|
+
* still read mentions it. Holding it after that is holding bytes no one can
|
|
195
|
+
* address.
|
|
196
|
+
*
|
|
197
|
+
* So a file's history survives while it was written inside the last two
|
|
198
|
+
* spans, and beyond that only while something the model can still see names
|
|
199
|
+
* it — the summary just written, and the retained tail when there is one.
|
|
200
|
+
* `keep` is that whitelist, and a file in it is never dropped however old.
|
|
201
|
+
*
|
|
202
|
+
* Whole files, not individual revisions. A file written inside the window is
|
|
203
|
+
* live and its whole history is worth having; one that has not been touched
|
|
204
|
+
* for two compactions and is named nowhere is not half-interesting. Dropping
|
|
205
|
+
* revisions out of the middle of a surviving file is what the byte cap does,
|
|
206
|
+
* for a different reason, and mixing the two would leave histories with
|
|
207
|
+
* holes that mean two different things.
|
|
208
|
+
*
|
|
209
|
+
* Returns how many files it released, for the log line.
|
|
210
|
+
*/
|
|
211
|
+
noteCompaction(keep?: Iterable<string>): number;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Which version a `restore_file` call asked for, as something that can be said
|
|
215
|
+
* out loud.
|
|
216
|
+
*
|
|
217
|
+
* The chat row that reports a restore has to name its target, and it only has
|
|
218
|
+
* the call's arguments to name it from -- the row is built when the call
|
|
219
|
+
* starts. It used to name none of them: the header was the constant sentence
|
|
220
|
+
* "put this file back as the transaction found it", written when the base was
|
|
221
|
+
* the only place the tool could go. A restore to `#3` was reported as a
|
|
222
|
+
* restore to the base.
|
|
223
|
+
*
|
|
224
|
+
* This goes through `parseRevision`, the same reader the tool itself uses, so
|
|
225
|
+
* the aliases stay one set. Add an alias there and every caller says the right
|
|
226
|
+
* thing without being told.
|
|
227
|
+
*/
|
|
228
|
+
export type RestoreTarget = {
|
|
229
|
+
readonly kind: "original";
|
|
230
|
+
} | {
|
|
231
|
+
readonly kind: "last";
|
|
232
|
+
} | {
|
|
233
|
+
readonly kind: "numbered";
|
|
234
|
+
readonly index: number;
|
|
235
|
+
} | {
|
|
236
|
+
readonly kind: "unreadable";
|
|
237
|
+
readonly requested: string;
|
|
238
|
+
};
|
|
239
|
+
export declare function describeRestoreTarget(requested: string | undefined | null): RestoreTarget;
|
|
240
|
+
export declare function createRevisionLog(_unused?: unknown, limits?: RevisionLimits): RevisionLog;
|
|
241
|
+
/**
|
|
242
|
+
* The history, written for the model rather than for a log file.
|
|
243
|
+
*
|
|
244
|
+
* Stated in full on every read of a covered file, and not only in the receipt
|
|
245
|
+
* for an edit. The ids are useless if they live only in scrollback: run 0295
|
|
246
|
+
* auto-compacted eight times, and a long thrashing run -- the exact run that
|
|
247
|
+
* needs to go back three revisions -- is the one whose early receipts are gone.
|
|
248
|
+
* Re-stating the list makes it recoverable from one call.
|
|
249
|
+
*/
|
|
250
|
+
export declare function describeRevisions(display: string, revisions: readonly FileRevision[], options?: {
|
|
251
|
+
limit?: number;
|
|
252
|
+
span?: string;
|
|
253
|
+
}): string;
|
|
254
|
+
/**
|
|
255
|
+
* Find the revisions that contain something, so a number can be looked up
|
|
256
|
+
* rather than remembered.
|
|
257
|
+
*
|
|
258
|
+
* The list answers "what are my options"; this answers "which one had the thing
|
|
259
|
+
* I want back". Those are different questions, and only the second one is
|
|
260
|
+
* asked by a model that has just deleted a method and knows exactly what it is
|
|
261
|
+
* looking for. Without it the model's only recourse is to restore candidates
|
|
262
|
+
* one at a time and read the file after each, which spends the restore budget
|
|
263
|
+
* on searching.
|
|
264
|
+
*
|
|
265
|
+
* Notes are searched as well as content: once a revision is labelled with the
|
|
266
|
+
* model's own sentence, "the dBoss brace" is a likelier query than the code.
|
|
267
|
+
*/
|
|
268
|
+
export declare function searchRevisions(display: string, revisions: readonly FileRevision[], query: string): string;
|