@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,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a file's brackets stop matching.
|
|
3
|
+
*
|
|
4
|
+
* A language server reports a parse error at the point the parser gave up,
|
|
5
|
+
* which for a crossed bracket is the closer — never the opener it failed to
|
|
6
|
+
* match. That leaves the one question a model actually needs answered
|
|
7
|
+
* unanswered: *which* opening bracket does this belong to.
|
|
8
|
+
*
|
|
9
|
+
* Measured on a 265-message session: 23 of 29 shell commands were a
|
|
10
|
+
* brace-counting Python script the model wrote itself, because nothing here
|
|
11
|
+
* answered the question. It then declared the two remaining errors "parser
|
|
12
|
+
* artifacts from the very long single line" and stopped. They were not — the
|
|
13
|
+
* scan below locates both in one pass:
|
|
14
|
+
*
|
|
15
|
+
* MISMATCH: '{' opened at column 2352 closed by ')' at column 2707
|
|
16
|
+
* MISMATCH: '(' opened at column 2348 closed by '}' at column 3744
|
|
17
|
+
*
|
|
18
|
+
* which is exactly where `node --check` fails.
|
|
19
|
+
*/
|
|
20
|
+
export interface DelimiterFinding {
|
|
21
|
+
kind: "mismatch" | "unmatched-close" | "unclosed";
|
|
22
|
+
/** 1-based position of the delimiter that is wrong. */
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
25
|
+
/** The character at that position, when there is one. */
|
|
26
|
+
found?: string;
|
|
27
|
+
/** 1-based position of the opener involved, for a mismatch or unclosed. */
|
|
28
|
+
openLine?: number;
|
|
29
|
+
openColumn?: number;
|
|
30
|
+
opener?: string;
|
|
31
|
+
/**
|
|
32
|
+
* What was still open around this point, innermost first — the chain a
|
|
33
|
+
* model otherwise rebuilds by hand. Recorded with the opener this finding
|
|
34
|
+
* names already taken off, so it reads as the context the fix sits in.
|
|
35
|
+
*/
|
|
36
|
+
enclosing?: Array<{
|
|
37
|
+
opener: string;
|
|
38
|
+
line: number;
|
|
39
|
+
column: number;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
interface Cursor {
|
|
43
|
+
line: number;
|
|
44
|
+
column: number;
|
|
45
|
+
}
|
|
46
|
+
/** Opens minus closes on one line, per bracket kind, counting code only. */
|
|
47
|
+
export interface LineBalance {
|
|
48
|
+
round: number;
|
|
49
|
+
square: number;
|
|
50
|
+
curly: number;
|
|
51
|
+
}
|
|
52
|
+
export interface DelimiterScan {
|
|
53
|
+
findings: DelimiterFinding[];
|
|
54
|
+
/** Keyed by 1-based line number. Absent means the line held no brackets. */
|
|
55
|
+
balance: Map<number, LineBalance>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Scan one span of C-family source and report where its delimiters cross.
|
|
59
|
+
*
|
|
60
|
+
* Strings, template literals, comments and regex literals are skipped, so a
|
|
61
|
+
* brace inside `"}"` does not count — which is the difference between this and
|
|
62
|
+
* counting characters, and the reason a hand-rolled counter misleads.
|
|
63
|
+
*/
|
|
64
|
+
export declare function scanDelimiters(text: string, origin?: Cursor): DelimiterFinding[];
|
|
65
|
+
/**
|
|
66
|
+
* The same scan, keeping the per-line tally it passes over anyway.
|
|
67
|
+
*
|
|
68
|
+
* The tally is what turns a crossing into an instruction. A report can say
|
|
69
|
+
* where two brackets cross, but not whether the fix is to delete one, add one
|
|
70
|
+
* or move one — and on a minified line those are very different edits. The
|
|
71
|
+
* counts settle it, and they are free: the walk already visits every bracket
|
|
72
|
+
* in code and skips every one in a string.
|
|
73
|
+
*/
|
|
74
|
+
export declare function scanWithBalance(text: string, origin?: Cursor): DelimiterScan;
|
|
75
|
+
/**
|
|
76
|
+
* How a prescribed repair opens, so a caller can tell a scan that names the
|
|
77
|
+
* exact call from one that only names the line.
|
|
78
|
+
*
|
|
79
|
+
* Exported rather than matched by hand: the editor appends to this line, and a
|
|
80
|
+
* reworded prescription that silently stopped being recognised would take the
|
|
81
|
+
* follow-up with it.
|
|
82
|
+
*/
|
|
83
|
+
export declare const PRESCRIPTION_MARKER = "that edit is `editor` with ";
|
|
84
|
+
/**
|
|
85
|
+
* Whether this scanner reads the given file's language at all.
|
|
86
|
+
*
|
|
87
|
+
* `describeDelimiterBalance` returns null for two different reasons — nothing
|
|
88
|
+
* is wrong, and nothing was looked at — and a caller that reports the result
|
|
89
|
+
* has to tell them apart. Saying "no problems" about a file no checker opened
|
|
90
|
+
* is the one output worse than silence.
|
|
91
|
+
*/
|
|
92
|
+
export declare function canScanDelimiters(filePath: string): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether a file's scripts parse at all, asked of a real parser.
|
|
95
|
+
*
|
|
96
|
+
* Not a second delimiter scan. The scan is a heuristic and is here to *place*
|
|
97
|
+
* a parse error the browser could only name; this answers the prior question —
|
|
98
|
+
* is there one — with the engine's own answer, so it can be trusted where a
|
|
99
|
+
* heuristic cannot: to contradict a browser that reported a clean page.
|
|
100
|
+
*
|
|
101
|
+
* Measured, and this is why it exists: a run edited a 14 KB page into a state
|
|
102
|
+
* where `forEach(e=>{…};` left a `;` inside an argument list, opened it in the
|
|
103
|
+
* browser, and was told "Console: nothing. The page printed no messages and
|
|
104
|
+
* threw no errors." The page had never run. The model reported the task
|
|
105
|
+
* finished on that evidence, and the transaction was kept over a file that
|
|
106
|
+
* does not parse.
|
|
107
|
+
*
|
|
108
|
+
* `new Function` rather than `vm.Script`, which parses lazily under Bun and
|
|
109
|
+
* throws nothing at all on broken source. The body is wrapped in a function,
|
|
110
|
+
* so a `return` at the top level passes here and would not in a real script —
|
|
111
|
+
* a miss, which is the safe direction: this only ever speaks up when a parser
|
|
112
|
+
* has actually refused the source.
|
|
113
|
+
*/
|
|
114
|
+
export declare function findScriptSyntaxError(filePath: string, text: string): string | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Render the balance findings for a file, or null when there is nothing
|
|
117
|
+
* useful to say — the file's language is not one this understands, or its
|
|
118
|
+
* delimiters match.
|
|
119
|
+
*/
|
|
120
|
+
export declare function describeDelimiterBalance(filePath: string, text: string): string | null;
|
|
121
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { AgentTool } from "@cerebriline/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Files the model changed and has not checked since.
|
|
4
|
+
*
|
|
5
|
+
* A run that edits and never re-checks is the ordinary failure, not the
|
|
6
|
+
* exceptional one. Measured on a live session, the whole tool sequence:
|
|
7
|
+
*
|
|
8
|
+
* ```
|
|
9
|
+
* list_files → browser → read_files → check_file → editor → editor → editor → editor
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* The linter ran once, *before* anything was touched, and then four consecutive
|
|
13
|
+
* edits landed with nothing checking them. Sixteen problems in the file
|
|
14
|
+
* afterwards. The model was not missing a tool — `check_file` was right there
|
|
15
|
+
* and it had already used it once.
|
|
16
|
+
*
|
|
17
|
+
* So this is a guard rather than a paragraph of instruction. A model that
|
|
18
|
+
* ignores a linter it has already run will ignore a sentence asking it to run
|
|
19
|
+
* one again; what it cannot ignore is not being allowed to finish. The same
|
|
20
|
+
* reasoning, and the same two-strike shape, as the checklist close-out.
|
|
21
|
+
*
|
|
22
|
+
* Deliberately generic. The checker on the VS Code path is `check_file`, which
|
|
23
|
+
* lives in the extension rather than in the SDK, and a host may have another
|
|
24
|
+
* one or none at all — so the tool names are supplied rather than assumed, and
|
|
25
|
+
* a host that names no checker gets no guard.
|
|
26
|
+
*/
|
|
27
|
+
/** How the host names the tools that edit and the tools that verify. */
|
|
28
|
+
export interface EditVerificationConfig {
|
|
29
|
+
/** Tools whose calls mark a file as changed. */
|
|
30
|
+
editTools: readonly string[];
|
|
31
|
+
/** Tools whose calls mark a file as verified. */
|
|
32
|
+
checkTools: readonly string[];
|
|
33
|
+
/**
|
|
34
|
+
* How many times the guard may hold the run back. Beyond this it stands
|
|
35
|
+
* aside: the model has been told twice and the work is the user's to judge.
|
|
36
|
+
*/
|
|
37
|
+
attempts?: number;
|
|
38
|
+
}
|
|
39
|
+
export declare const EDIT_VERIFICATION_ATTEMPTS = 2;
|
|
40
|
+
/** Files edited since they were last checked, in the order they were edited. */
|
|
41
|
+
export interface EditVerificationState {
|
|
42
|
+
unchecked: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Every file path an argument bag names, whatever shape it names them in.
|
|
46
|
+
*
|
|
47
|
+
* `editor` sends `path`, `check_file` sends `paths`, and `read_files` sends
|
|
48
|
+
* `files: [{ path }]`. Reading one shape would silently cover one tool, which
|
|
49
|
+
* is the failure mode this whole module exists to answer, so all three are
|
|
50
|
+
* read and anything unrecognised contributes nothing.
|
|
51
|
+
*/
|
|
52
|
+
export declare function extractPaths(input: unknown): string[];
|
|
53
|
+
/** Tracks which edited files are still unverified. */
|
|
54
|
+
export declare class EditVerificationTracker {
|
|
55
|
+
private readonly editTools;
|
|
56
|
+
private readonly checkTools;
|
|
57
|
+
/** Normalised path → the path as the model wrote it, for the message. */
|
|
58
|
+
private readonly unchecked;
|
|
59
|
+
constructor(config: EditVerificationConfig);
|
|
60
|
+
/** Whether this tracker can ever have anything to say. */
|
|
61
|
+
get armed(): boolean;
|
|
62
|
+
recordToolCall(toolName: string, input: unknown): void;
|
|
63
|
+
getState(): EditVerificationState;
|
|
64
|
+
reset(): void;
|
|
65
|
+
}
|
|
66
|
+
/** What the model is told, naming the files rather than the rule. */
|
|
67
|
+
export declare function buildUncheckedEditsNudge(unchecked: readonly string[], checkTool: string, attempt: 1 | 2): string;
|
|
68
|
+
/**
|
|
69
|
+
* A completion guard that holds the run back while an edit is unverified.
|
|
70
|
+
*
|
|
71
|
+
* Returns `undefined` — letting the run end — when there is nothing unchecked,
|
|
72
|
+
* when the host named no checker, or once the attempts are spent. It never
|
|
73
|
+
* blocks indefinitely: two refusals is a warning, a third would be an argument.
|
|
74
|
+
*/
|
|
75
|
+
export declare function createEditVerificationCompletionGuard(tracker: EditVerificationTracker, config: EditVerificationConfig): () => string | undefined;
|
|
76
|
+
/** Whether a tool has already been wrapped for edit tracking. */
|
|
77
|
+
export declare function isEditVerificationWrapped(tool: object): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Watch a tool's calls without changing what it does.
|
|
80
|
+
*
|
|
81
|
+
* Only the call is observed — not the result. A failed edit still counts as
|
|
82
|
+
* having touched the file: the tool may have written part of it, and a guard
|
|
83
|
+
* that trusted `success` would be answering a different question than "is this
|
|
84
|
+
* file in a state anyone has looked at".
|
|
85
|
+
*/
|
|
86
|
+
export declare function withEditVerificationCapture<TInput, TOutput>(tool: AgentTool<TInput, TOutput>, tracker: EditVerificationTracker): AgentTool<TInput, TOutput>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The files a command's output blames, whatever produced the output.
|
|
3
|
+
*
|
|
4
|
+
* A model that runs the build gets told *that* something is broken and where
|
|
5
|
+
* the tool gave up. A checker tells it *which line to edit*. Measured across
|
|
6
|
+
* four transactions on three builds of the harness arm: the model that had the
|
|
7
|
+
* first and not the second wrote its own analyser rather than asking for the
|
|
8
|
+
* second — `find_error.js`, then five checkers in one transaction, then
|
|
9
|
+
* `diagnose.mjs`, `diagnose2.mjs`, `diagnose3.mjs`. Sixty-two minutes of one
|
|
10
|
+
* transaction went into scripts and the broken file was never opened.
|
|
11
|
+
*
|
|
12
|
+
* Instructions did not move that. So the two halves are joined here instead:
|
|
13
|
+
* name a file in a failing command's output and the host's own checker is asked
|
|
14
|
+
* about it, without the model having to think of it.
|
|
15
|
+
*
|
|
16
|
+
* Nothing here knows a language. It matches the shapes compilers, linters and
|
|
17
|
+
* runtimes use to say "here", and every candidate has to resolve to a file that
|
|
18
|
+
* actually exists inside the workspace before it is believed — which is what
|
|
19
|
+
* rejects a URL, a version string and a line of prose that happens to hold a
|
|
20
|
+
* colon.
|
|
21
|
+
*/
|
|
22
|
+
export interface ErrorLocation {
|
|
23
|
+
/** Absolute path, verified to exist and to sit inside the workspace. */
|
|
24
|
+
path: string;
|
|
25
|
+
/** The line the output blamed, when it gave one. */
|
|
26
|
+
line?: number;
|
|
27
|
+
}
|
|
28
|
+
/** Whether this output is worth asking a checker about at all. */
|
|
29
|
+
export declare function looksLikeFailure(output: string, exitedNonZero: boolean): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The workspace files a command names in its own arguments.
|
|
32
|
+
*
|
|
33
|
+
* The fallback for the case the output patterns cannot cover, and it is the
|
|
34
|
+
* common one rather than the exotic one. Measured on the harness arm: of 96
|
|
35
|
+
* commands in one transaction, exactly one printed a `file:line` — because the
|
|
36
|
+
* page under repair is HTML, `node` cannot run it directly, and the model's own
|
|
37
|
+
* wrapper scripts caught the parse error and printed a summary of their own
|
|
38
|
+
* devising. The file was named on the command line every time: `node
|
|
39
|
+
* run_game.js manic_miner.html`, `node diagnose8.js manic_miner.html`.
|
|
40
|
+
*
|
|
41
|
+
* Argument order is kept, which puts the runner script before the file it runs;
|
|
42
|
+
* both are checked, and a broken runner is worth hearing about too.
|
|
43
|
+
*/
|
|
44
|
+
export declare function findCommandFileTargets(command: string, workspace: string): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Every workspace file the output points at, in the order it points at them.
|
|
47
|
+
*
|
|
48
|
+
* Resolution against the workspace is the whole filter. A path that does not
|
|
49
|
+
* exist was never a path, and one that exists outside the workspace belongs to
|
|
50
|
+
* a dependency or the toolchain — asking a checker about `node_modules` or
|
|
51
|
+
* `/usr/lib/python3` answers a question nobody asked.
|
|
52
|
+
*/
|
|
53
|
+
export declare function findErrorLocations(output: string, workspace: string): ErrorLocation[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply Patch parser and patch model types.
|
|
3
|
+
*
|
|
4
|
+
* This parser supports the Cline apply_patch format used by the legacy runtime.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PATCH_MARKERS: {
|
|
7
|
+
readonly BEGIN: "*** Begin Patch";
|
|
8
|
+
readonly END: "*** End Patch";
|
|
9
|
+
readonly ADD: "*** Add File: ";
|
|
10
|
+
readonly UPDATE: "*** Update File: ";
|
|
11
|
+
readonly DELETE: "*** Delete File: ";
|
|
12
|
+
readonly MOVE: "*** Move to: ";
|
|
13
|
+
readonly SECTION: "@@";
|
|
14
|
+
readonly END_FILE: "*** End of File";
|
|
15
|
+
};
|
|
16
|
+
export declare const BASH_WRAPPERS: readonly ["%%bash", "apply_patch", "EOF", "```"];
|
|
17
|
+
export declare enum PatchActionType {
|
|
18
|
+
ADD = "add",
|
|
19
|
+
DELETE = "delete",
|
|
20
|
+
UPDATE = "update"
|
|
21
|
+
}
|
|
22
|
+
export interface PatchChunk {
|
|
23
|
+
origIndex: number;
|
|
24
|
+
delLines: string[];
|
|
25
|
+
insLines: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface PatchAction {
|
|
28
|
+
type: PatchActionType;
|
|
29
|
+
newFile?: string;
|
|
30
|
+
chunks: PatchChunk[];
|
|
31
|
+
movePath?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PatchWarning {
|
|
34
|
+
path: string;
|
|
35
|
+
chunkIndex?: number;
|
|
36
|
+
message: string;
|
|
37
|
+
context?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Patch {
|
|
40
|
+
actions: Record<string, PatchAction>;
|
|
41
|
+
warnings?: PatchWarning[];
|
|
42
|
+
}
|
|
43
|
+
export declare class DiffError extends Error {
|
|
44
|
+
constructor(message: string);
|
|
45
|
+
}
|
|
46
|
+
export declare class PatchParser {
|
|
47
|
+
private readonly lines;
|
|
48
|
+
private readonly currentFiles;
|
|
49
|
+
private patch;
|
|
50
|
+
private index;
|
|
51
|
+
private fuzz;
|
|
52
|
+
private currentPath?;
|
|
53
|
+
constructor(lines: string[], currentFiles: Record<string, string>);
|
|
54
|
+
parse(): {
|
|
55
|
+
patch: Patch;
|
|
56
|
+
fuzz: number;
|
|
57
|
+
};
|
|
58
|
+
private addWarning;
|
|
59
|
+
private skipBeginSentinel;
|
|
60
|
+
private hasMoreLines;
|
|
61
|
+
private isEndMarker;
|
|
62
|
+
private parseNextAction;
|
|
63
|
+
private checkDuplicate;
|
|
64
|
+
private parseUpdate;
|
|
65
|
+
private parseUpdateFile;
|
|
66
|
+
private parseDelete;
|
|
67
|
+
private parseAdd;
|
|
68
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply Patch Executor
|
|
3
|
+
*
|
|
4
|
+
* Built-in implementation for the documented GPT-5 apply_patch grammar.
|
|
5
|
+
* It accepts the freeform patch body directly and tolerates the legacy shell
|
|
6
|
+
* wrapper form used by older prompts.
|
|
7
|
+
*/
|
|
8
|
+
import type { AgentOverlay } from "../../../runtime/sandbox/overlay-fs";
|
|
9
|
+
import type { ApplyPatchExecutor } from "../types";
|
|
10
|
+
import { PatchActionType } from "./apply-patch-parser";
|
|
11
|
+
export interface PatchFileChange {
|
|
12
|
+
type: PatchActionType;
|
|
13
|
+
oldContent?: string;
|
|
14
|
+
newContent?: string;
|
|
15
|
+
movePath?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Options for the apply_patch executor
|
|
19
|
+
*/
|
|
20
|
+
export interface ApplyPatchExecutorOptions {
|
|
21
|
+
/**
|
|
22
|
+
* File encoding used for read/write operations
|
|
23
|
+
* @default "utf-8"
|
|
24
|
+
*/
|
|
25
|
+
encoding?: BufferEncoding;
|
|
26
|
+
/**
|
|
27
|
+
* Restrict relative-path file operations to paths inside cwd.
|
|
28
|
+
* Absolute paths are always accepted as-is.
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
restrictToCwd?: boolean;
|
|
32
|
+
/** A delegated agent's overlay; the patch reads and writes the agent's copies. */
|
|
33
|
+
overlay?: AgentOverlay;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Parse a patch and compute the per-file changes it would apply, without
|
|
37
|
+
* writing anything to disk. Reads the current contents of the files the patch
|
|
38
|
+
* references. Exposed so hosts can preview a patch (e.g. in a diff editor)
|
|
39
|
+
* before the executor applies it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function computePatchChanges(patchText: string, cwd: string, options?: ApplyPatchExecutorOptions): Promise<{
|
|
42
|
+
changes: Record<string, PatchFileChange>;
|
|
43
|
+
fuzz: number;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Create an apply_patch executor using Node.js fs module.
|
|
47
|
+
*/
|
|
48
|
+
export declare function createApplyPatchExecutor(options?: ApplyPatchExecutorOptions): ApplyPatchExecutor;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lexer and parser for the POSIX awk language.
|
|
3
|
+
*
|
|
4
|
+
* Split from the interpreter because the two fail for entirely different
|
|
5
|
+
* reasons and a model needs to be told which: a parse error means the program
|
|
6
|
+
* it wrote is not awk, and a run error means the program is awk but did
|
|
7
|
+
* something impossible. Reporting both as "awk failed" would teach it nothing.
|
|
8
|
+
*
|
|
9
|
+
* The subset is the one a coding model actually writes: `{print $1}`,
|
|
10
|
+
* `-F, '$3>10 {print $1}'`, `NR>1 {sum+=$2} END {print sum}`,
|
|
11
|
+
* `/ERROR/ {print NR": "$0}`. User-defined functions and `getline` are not
|
|
12
|
+
* supported and are refused by name — see the interpreter's note on why
|
|
13
|
+
* refusing beats silently doing nothing.
|
|
14
|
+
*/
|
|
15
|
+
export type Token = {
|
|
16
|
+
kind: "number";
|
|
17
|
+
value: number;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "string";
|
|
20
|
+
value: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "regex";
|
|
23
|
+
value: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "name";
|
|
26
|
+
value: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "builtin";
|
|
29
|
+
value: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "keyword";
|
|
32
|
+
value: string;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "punct";
|
|
35
|
+
value: string;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "newline";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "eof";
|
|
40
|
+
};
|
|
41
|
+
export declare function tokenizeAwk(source: string): Token[];
|
|
42
|
+
export type Expr = {
|
|
43
|
+
type: "number";
|
|
44
|
+
value: number;
|
|
45
|
+
} | {
|
|
46
|
+
type: "string";
|
|
47
|
+
value: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: "regex";
|
|
50
|
+
value: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: "var";
|
|
53
|
+
name: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: "field";
|
|
56
|
+
index: Expr;
|
|
57
|
+
} | {
|
|
58
|
+
type: "index";
|
|
59
|
+
name: string;
|
|
60
|
+
keys: Expr[];
|
|
61
|
+
} | {
|
|
62
|
+
type: "assign";
|
|
63
|
+
op: string;
|
|
64
|
+
target: Expr;
|
|
65
|
+
value: Expr;
|
|
66
|
+
} | {
|
|
67
|
+
type: "binary";
|
|
68
|
+
op: string;
|
|
69
|
+
left: Expr;
|
|
70
|
+
right: Expr;
|
|
71
|
+
} | {
|
|
72
|
+
type: "unary";
|
|
73
|
+
op: string;
|
|
74
|
+
operand: Expr;
|
|
75
|
+
} | {
|
|
76
|
+
type: "postfix";
|
|
77
|
+
op: string;
|
|
78
|
+
target: Expr;
|
|
79
|
+
} | {
|
|
80
|
+
type: "prefix";
|
|
81
|
+
op: string;
|
|
82
|
+
target: Expr;
|
|
83
|
+
} | {
|
|
84
|
+
type: "ternary";
|
|
85
|
+
test: Expr;
|
|
86
|
+
then: Expr;
|
|
87
|
+
other: Expr;
|
|
88
|
+
} | {
|
|
89
|
+
type: "match";
|
|
90
|
+
negated: boolean;
|
|
91
|
+
left: Expr;
|
|
92
|
+
right: Expr;
|
|
93
|
+
} | {
|
|
94
|
+
type: "in";
|
|
95
|
+
key: Expr;
|
|
96
|
+
array: string;
|
|
97
|
+
} | {
|
|
98
|
+
type: "call";
|
|
99
|
+
name: string;
|
|
100
|
+
args: Expr[];
|
|
101
|
+
} | {
|
|
102
|
+
type: "concat";
|
|
103
|
+
parts: Expr[];
|
|
104
|
+
} | {
|
|
105
|
+
type: "grouping";
|
|
106
|
+
inner: Expr;
|
|
107
|
+
};
|
|
108
|
+
export type Stmt = {
|
|
109
|
+
type: "print";
|
|
110
|
+
args: Expr[];
|
|
111
|
+
} | {
|
|
112
|
+
type: "printf";
|
|
113
|
+
args: Expr[];
|
|
114
|
+
} | {
|
|
115
|
+
type: "expr";
|
|
116
|
+
expr: Expr;
|
|
117
|
+
} | {
|
|
118
|
+
type: "if";
|
|
119
|
+
test: Expr;
|
|
120
|
+
then: Stmt;
|
|
121
|
+
other?: Stmt;
|
|
122
|
+
} | {
|
|
123
|
+
type: "while";
|
|
124
|
+
test: Expr;
|
|
125
|
+
body: Stmt;
|
|
126
|
+
} | {
|
|
127
|
+
type: "for";
|
|
128
|
+
init?: Stmt;
|
|
129
|
+
test?: Expr;
|
|
130
|
+
update?: Stmt;
|
|
131
|
+
body: Stmt;
|
|
132
|
+
} | {
|
|
133
|
+
type: "forIn";
|
|
134
|
+
name: string;
|
|
135
|
+
array: string;
|
|
136
|
+
body: Stmt;
|
|
137
|
+
} | {
|
|
138
|
+
type: "block";
|
|
139
|
+
body: Stmt[];
|
|
140
|
+
} | {
|
|
141
|
+
type: "next";
|
|
142
|
+
} | {
|
|
143
|
+
type: "exit";
|
|
144
|
+
code?: Expr;
|
|
145
|
+
} | {
|
|
146
|
+
type: "break";
|
|
147
|
+
} | {
|
|
148
|
+
type: "continue";
|
|
149
|
+
} | {
|
|
150
|
+
type: "delete";
|
|
151
|
+
name: string;
|
|
152
|
+
keys: Expr[];
|
|
153
|
+
};
|
|
154
|
+
export interface Rule {
|
|
155
|
+
kind: "begin" | "end" | "pattern";
|
|
156
|
+
pattern?: Expr;
|
|
157
|
+
/** For a range pattern: `/a/,/b/`. */
|
|
158
|
+
patternEnd?: Expr;
|
|
159
|
+
action?: Stmt;
|
|
160
|
+
/** Range state while executing. */
|
|
161
|
+
active?: boolean;
|
|
162
|
+
}
|
|
163
|
+
export declare function parseAwk(source: string): Rule[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AgentOverlay } from "../../../runtime/sandbox/overlay-fs";
|
|
2
|
+
import { type Rule } from "./awk-parser";
|
|
3
|
+
import { type ReadReceipts } from "./read-receipts";
|
|
4
|
+
/** An awk value: a number, a string, or a string that looks like a number. */
|
|
5
|
+
type Value = string | number;
|
|
6
|
+
export declare function awkSprintf(format: string, args: Value[]): string;
|
|
7
|
+
export interface RunAwkOptions {
|
|
8
|
+
/** `-F`: the field separator. */
|
|
9
|
+
fieldSeparator?: string;
|
|
10
|
+
/** `-v`: variables set before BEGIN. */
|
|
11
|
+
variables?: Record<string, string>;
|
|
12
|
+
/** Named so FILENAME can answer. */
|
|
13
|
+
fileName?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function runAwkProgram(rules: Rule[], input: string, options?: RunAwkOptions): {
|
|
16
|
+
output: string;
|
|
17
|
+
exitCode: number;
|
|
18
|
+
};
|
|
19
|
+
export interface AwkExecutorOptions {
|
|
20
|
+
cwd?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Recorded, not enforced.
|
|
23
|
+
*
|
|
24
|
+
* awk here cannot write a file — there is no in-place mode, `getline` and
|
|
25
|
+
* output redirection are both refused — so there is nothing for a write
|
|
26
|
+
* guard to guard. What it does do is note that the file was read, so a
|
|
27
|
+
* later `sed -i` or `editor` call on the same file is not refused for a
|
|
28
|
+
* file the model has in fact just been through.
|
|
29
|
+
*/
|
|
30
|
+
receipts?: ReadReceipts;
|
|
31
|
+
/** A delegated agent's overlay; awk reads the agent's version of a file. */
|
|
32
|
+
overlay?: AgentOverlay;
|
|
33
|
+
}
|
|
34
|
+
export interface AwkInput {
|
|
35
|
+
program: string;
|
|
36
|
+
files?: string[];
|
|
37
|
+
field_separator?: string;
|
|
38
|
+
variables?: Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
export declare function createAwkExecutor(options?: AwkExecutorOptions): (input: AwkInput, callCwd?: string) => Promise<string>;
|
|
41
|
+
export {};
|