@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,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A checker for hosts that have no language server.
|
|
3
|
+
*
|
|
4
|
+
* VS Code's `check_file` asks the editor's own language servers and is as good
|
|
5
|
+
* as whatever the user has installed. Every other host — the CLI above all —
|
|
6
|
+
* had nothing, and the edit-verification guard stands aside when no checker is
|
|
7
|
+
* named. Measured on the CLI: a run made ten `editor` calls, checked nothing,
|
|
8
|
+
* and reported "the implementation is complete" on a file that does not parse.
|
|
9
|
+
* The model was not being careless so much as blind; `run_commands` was its
|
|
10
|
+
* only way to find out and it did not think to use it.
|
|
11
|
+
*
|
|
12
|
+
* So this answers the narrower question the editor cannot be asked here: does
|
|
13
|
+
* this file still parse, and where do its brackets stop matching. It is not a
|
|
14
|
+
* type checker and does not pretend to be — the description says so, because a
|
|
15
|
+
* model that believes a clean result means "correct" is worse off than one
|
|
16
|
+
* that knows the bound.
|
|
17
|
+
*
|
|
18
|
+
* Compilation is `vm.Script`, which parses without running: an HTML page that
|
|
19
|
+
* starts a game must not start one because someone asked whether it parses.
|
|
20
|
+
*
|
|
21
|
+
* A host that can name a real checker gets to close the rest of the distance:
|
|
22
|
+
* pass a lint command and this runs it too, and says so in its description. The
|
|
23
|
+
* point of that is not convenience — it is that the two hosts stop shipping
|
|
24
|
+
* different tools under one name. Without it the extension tells the model
|
|
25
|
+
* `check_file` is the linter and the type checker while the CLI tells it the
|
|
26
|
+
* same tool is a syntax check, and an edit-verification mode of `require`
|
|
27
|
+
* therefore forces a much weaker check on the CLI than the words suggest.
|
|
28
|
+
*/
|
|
29
|
+
import type { AgentTool } from "@cerebriline/shared";
|
|
30
|
+
export declare const CHECK_FILE_TOOL_NAME = "check_file";
|
|
31
|
+
/**
|
|
32
|
+
* Written at the model that gets this wrong.
|
|
33
|
+
*
|
|
34
|
+
* The failure is not ignorance of what a linter is: it is that `run_commands`
|
|
35
|
+
* is the tool a model reaches for by reflex. So the commands it would
|
|
36
|
+
* otherwise type are named here, in the description of the tool that replaces
|
|
37
|
+
* them, which is where the model is standing when it is about to type one.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CHECK_FILE_TOOL_DESCRIPTION = "Check files for syntax errors and unbalanced brackets. **This is the syntax check.** Whichever word the question uses \u2014 parse error, syntax error, \"is it valid\", \"is it clean now\", \"what is still broken\" \u2014 this is the tool that answers it, for the files you name, in milliseconds, without running anything.\n\nAsk this instead of running `node --check`, `python -m py_compile`, `tsc --noEmit` or a bracket-counting script of your own. It parses the file without executing it, so it is safe on a page that would otherwise start a game or a server.\n\nWhen to call it:\n- After editing a file, to confirm the edit is valid before moving on.\n- Before reporting a task finished, on every file you changed. An edit you have not looked at is not a change you can report as done.\n- On a file you are about to change, to see what was already wrong with it.\n\nPass every file you want checked in one call.\n\nFor `.html` files each `<script>` block is parsed as JavaScript and the line numbers reported are the line numbers in the HTML file, not in the block.\n\nRead the bound carefully. This reports **syntax**, not meaning: a file that parses may still call a function that does not exist, and this will not say so. It is not a type checker, it does not run tests, and it does not know your project's lint rules \u2014 for those, use `run_commands`.\n\nOutput: JSON, in the shape a language server answers in. `files` holds one entry per path you named, each with `uri`, `checked` and `diagnostics`. There is no `success` field \u2014 diagnostics being listed is this tool working, not failing.\n\n`checked` says which check actually ran, and you have to read it before calling a file clean: `parsed` a real parser was satisfied, `delimiters` only the bracket scan reads this language so anything past brackets is unchecked, `none` nothing here reads this file type at all \u2014 empty `diagnostics` there means nothing was checked, not that the file is sound.\n\nEach diagnostic carries `range` (zero-based line and character), `severity` (1 = error) and `message`. `located: false` means the parser could not name a position, so the range is a placeholder rather than a claim about the top of the file. `complexity` appears on a file big enough to be worth a word about \u2014 a note to you, not a diagnostic.\n\nWhen a file's brackets do not match, a diagnostic names the line to edit and how many brackets that line is out by, one line per place the trouble starts \u2014 a file can be broken in several spots at once, so work through every line it lists before re-checking rather than re-checking after each one. Edit the lines it names; do not re-derive the balance by hand or with a script you write, which costs more thinking than you have and counts brackets inside strings, comments and regex literals that this scan skips. A parse error is always reported where the parser gave up, which is the closing bracket; the line named here is the one the error cannot name.";
|
|
40
|
+
/**
|
|
41
|
+
* The description when the host has a real checker to point at.
|
|
42
|
+
*
|
|
43
|
+
* The bound paragraph above is the whole reason this is a second string rather
|
|
44
|
+
* than a suffix: with a lint command wired in, "it is not a type checker, it
|
|
45
|
+
* does not know your project's lint rules" is no longer true, and a model that
|
|
46
|
+
* believes it will go and run the command through `run_commands` anyway --
|
|
47
|
+
* which is the reflex this tool exists to displace.
|
|
48
|
+
*
|
|
49
|
+
* The command is named rather than described, because a model deciding whether
|
|
50
|
+
* to trust a result wants to know what produced it.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildCheckFileDescription(lintCommand: string): string;
|
|
53
|
+
export declare const CHECK_FILE_TOOL_INPUT_SCHEMA: {
|
|
54
|
+
readonly type: "object";
|
|
55
|
+
readonly properties: {
|
|
56
|
+
readonly paths: {
|
|
57
|
+
readonly type: "array";
|
|
58
|
+
readonly items: {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
};
|
|
61
|
+
readonly description: "Files to check. Absolute, or relative to the working directory. Pass all of them in one call.";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
readonly required: readonly ["paths"];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The token a user writes in their lint command to mark where the path goes.
|
|
68
|
+
*
|
|
69
|
+
* Escaped rather than written plainly: as a plain literal it reads to the
|
|
70
|
+
* linter as an unescaped template placeholder, which is exactly what it is not
|
|
71
|
+
* — it is data the user types, and it has to stay a string to be matched.
|
|
72
|
+
*/
|
|
73
|
+
export declare const LINT_COMMAND_FILE_PLACEHOLDER = "${file}";
|
|
74
|
+
export interface LintCommandResult {
|
|
75
|
+
exitCode: number;
|
|
76
|
+
output: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Substitute the file into the configured command.
|
|
80
|
+
*
|
|
81
|
+
* A command without the placeholder gets the path appended, because `"eslint"`
|
|
82
|
+
* is what a user will actually type and refusing it would be pedantry.
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildLintCommand(template: string, filePath: string): string;
|
|
85
|
+
export interface CheckFinding {
|
|
86
|
+
line: number;
|
|
87
|
+
/** Whether the runtime named that line, or it is just the start of the file. */
|
|
88
|
+
located: boolean;
|
|
89
|
+
message: string;
|
|
90
|
+
/**
|
|
91
|
+
* The text of the line the parser stopped on, when it named one.
|
|
92
|
+
*
|
|
93
|
+
* Not `source`: LSP spends that name on the producer of a diagnostic
|
|
94
|
+
* ("tsc", "eslint"), and the structured report speaks LSP. A familiar key
|
|
95
|
+
* holding an unfamiliar value is worse than an unfamiliar key.
|
|
96
|
+
*/
|
|
97
|
+
sourceText?: string;
|
|
98
|
+
}
|
|
99
|
+
/** Compile without running, and say what and where. */
|
|
100
|
+
export declare function compileCheck(code: string, label: string, lineOffset?: number): CheckFinding | undefined;
|
|
101
|
+
/** A `<script>` body, and the line the body starts on. */
|
|
102
|
+
export interface ScriptBlock {
|
|
103
|
+
code: string;
|
|
104
|
+
startLine: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The inline scripts of an HTML page.
|
|
108
|
+
*
|
|
109
|
+
* Blocks with a `src` are somebody else's file, and a `type` that is not
|
|
110
|
+
* JavaScript (`application/json`, an import map, a template) is not ours to
|
|
111
|
+
* parse — reporting a syntax error in a JSON island as a script error would
|
|
112
|
+
* send a model to edit something that was correct.
|
|
113
|
+
*/
|
|
114
|
+
export declare function extractScripts(html: string): ScriptBlock[];
|
|
115
|
+
/** Everything this can say about one file. */
|
|
116
|
+
/**
|
|
117
|
+
* What a check found, in the shape the model already reads.
|
|
118
|
+
*
|
|
119
|
+
* The redesign, and the reason for it is measured rather than aesthetic: the
|
|
120
|
+
* A/B that added a sentence telling the model to call `check_file` tripled the
|
|
121
|
+
* calls and bought nothing (9/20 vs 6/20 FIXED, p=0.51) at 1.8x the wall time.
|
|
122
|
+
* Telling a model to use a tool harder does not make the tool legible. So the
|
|
123
|
+
* result now arrives in the vocabulary the LSP surface already taught it —
|
|
124
|
+
* `range`, `severity`, `message` — where it has to learn nothing at all.
|
|
125
|
+
*
|
|
126
|
+
* Positions are LSP's: zero-based line and character. Converting at the edge
|
|
127
|
+
* rather than carrying one-based numbers under LSP names, because a familiar
|
|
128
|
+
* shape holding unfamiliar values is worse than an unfamiliar shape.
|
|
129
|
+
*/
|
|
130
|
+
export interface CheckDiagnostic {
|
|
131
|
+
range: {
|
|
132
|
+
start: {
|
|
133
|
+
line: number;
|
|
134
|
+
character: number;
|
|
135
|
+
};
|
|
136
|
+
end: {
|
|
137
|
+
line: number;
|
|
138
|
+
character: number;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
/** LSP severity: 1 error, 2 warning. Everything here is an error. */
|
|
142
|
+
severity: 1 | 2;
|
|
143
|
+
/** LSP's `source` is the producer of the diagnostic, not the code. */
|
|
144
|
+
source: string;
|
|
145
|
+
message: string;
|
|
146
|
+
/**
|
|
147
|
+
* Whether the parser actually named this position.
|
|
148
|
+
*
|
|
149
|
+
* Every LSP diagnostic must carry a range, so an error located nowhere has
|
|
150
|
+
* to be given one -- and the only honest choice is the top of the file,
|
|
151
|
+
* which is exactly the lie the text renderer refused to print. Marked
|
|
152
|
+
* rather than omitted: a reader that trusts the range needs to be told
|
|
153
|
+
* when it is a placeholder.
|
|
154
|
+
*/
|
|
155
|
+
located: boolean;
|
|
156
|
+
/** The text of the line the parser stopped on, when it named one. */
|
|
157
|
+
sourceLine?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Which check actually ran, because `diagnostics: []` cannot say.
|
|
161
|
+
*
|
|
162
|
+
* `parsed` a real parser was satisfied; `delimiters` only the bracket scan
|
|
163
|
+
* ran, which is real but narrow; `none` nothing here reads this language and
|
|
164
|
+
* the empty list means nothing at all. Reporting the third as clean tells a
|
|
165
|
+
* model its file is sound on the authority of a check that never happened,
|
|
166
|
+
* which is the failure the prose version was careful to avoid and which a bare
|
|
167
|
+
* list would quietly reintroduce.
|
|
168
|
+
*/
|
|
169
|
+
export type CheckCoverage = "parsed" | "delimiters" | "none";
|
|
170
|
+
export interface CheckFileReport {
|
|
171
|
+
uri: string;
|
|
172
|
+
checked: CheckCoverage;
|
|
173
|
+
diagnostics: CheckDiagnostic[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Check one file and report it structurally.
|
|
177
|
+
*
|
|
178
|
+
* The source of truth; {@link checkSource} renders this for hosts still
|
|
179
|
+
* reading prose, so the two can never disagree about what was found.
|
|
180
|
+
*/
|
|
181
|
+
export declare function checkFileReport(filePath: string, text: string): CheckFileReport;
|
|
182
|
+
export declare function checkSource(filePath: string, text: string): string;
|
|
183
|
+
/** One file in the tool's answer. Either it was checked, or it could not be. */
|
|
184
|
+
export type CheckFileEntry = (CheckFileReport & {
|
|
185
|
+
lint?: CheckFileLint;
|
|
186
|
+
complexity?: string;
|
|
187
|
+
}) | {
|
|
188
|
+
uri: string;
|
|
189
|
+
error: string;
|
|
190
|
+
};
|
|
191
|
+
/** What the user's own checker said, when one is configured. */
|
|
192
|
+
export interface CheckFileLint {
|
|
193
|
+
command: string;
|
|
194
|
+
/** Absent when the command could not be run at all. */
|
|
195
|
+
exitCode?: number;
|
|
196
|
+
output: string;
|
|
197
|
+
/** Set when the command itself failed to launch. */
|
|
198
|
+
error?: string;
|
|
199
|
+
}
|
|
200
|
+
export interface CheckFileAnswer {
|
|
201
|
+
files: CheckFileEntry[];
|
|
202
|
+
/** Present only when more files were named than could be checked. */
|
|
203
|
+
notChecked?: {
|
|
204
|
+
named: number;
|
|
205
|
+
limit: number;
|
|
206
|
+
};
|
|
207
|
+
/** Present only when the call could not be served at all. */
|
|
208
|
+
error?: string;
|
|
209
|
+
}
|
|
210
|
+
export declare function createCheckFileTool(options?: {
|
|
211
|
+
cwd?: string;
|
|
212
|
+
/** The user's lint command, if they configured one. */
|
|
213
|
+
lintCommand?: string;
|
|
214
|
+
/** Runs it. Injected so tests never spawn anything. */
|
|
215
|
+
runLintCommand?: (template: string, filePath: string, signal?: AbortSignal) => Promise<LintCommandResult>;
|
|
216
|
+
}): AgentTool<{
|
|
217
|
+
paths: string[];
|
|
218
|
+
}, string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When a command fails, ask the checker about the file it blamed.
|
|
3
|
+
*
|
|
4
|
+
* The two halves of a diagnosis sit in two tools and the model has to think of
|
|
5
|
+
* joining them. Measured over four transactions, it did not: given `run_commands`
|
|
6
|
+
* output that named a file and a line, it wrote its own analyser — `find_error.js`,
|
|
7
|
+
* then `diagnose.mjs`, `diagnose2.mjs`, `diagnose3.mjs` — twenty-two editor calls
|
|
8
|
+
* across three scratch scripts and not one call to `check_file`. The transaction
|
|
9
|
+
* that instead read the checker's report fixed the file in one.
|
|
10
|
+
*
|
|
11
|
+
* Wording did not close that gap, so the join is made here. It is a wrapper
|
|
12
|
+
* around the shell tool that calls the host's own checker on the file the
|
|
13
|
+
* failure names — in the output where the output names one, and otherwise on
|
|
14
|
+
* the command line itself, which on the measured transaction was 95 commands
|
|
15
|
+
* out of 96 — and appends the answer to the same result. Nothing about it is
|
|
16
|
+
* language-specific: the paths are extracted by shape, and the checker is
|
|
17
|
+
* whichever one the host installed — VS Code's language servers know Python and
|
|
18
|
+
* Go, the CLI's built-in knows JavaScript and brackets, and both are asked the
|
|
19
|
+
* same way.
|
|
20
|
+
*/
|
|
21
|
+
import type { AgentTool } from "@cerebriline/shared";
|
|
22
|
+
export interface CheckOnFailureOptions {
|
|
23
|
+
/** Where relative paths in command output resolve from. */
|
|
24
|
+
cwd: string;
|
|
25
|
+
/** The checker to ask. Its report is appended verbatim. */
|
|
26
|
+
checker: Pick<AgentTool<{
|
|
27
|
+
paths: string[];
|
|
28
|
+
}, unknown>, "execute">;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Wrap a shell tool so failing commands come back with the checker's verdict.
|
|
32
|
+
*
|
|
33
|
+
* The wrapper is transparent on success and on output that names no workspace
|
|
34
|
+
* file, which is most of them: the extraction has to resolve a real path inside
|
|
35
|
+
* the workspace before anything is run.
|
|
36
|
+
*/
|
|
37
|
+
export declare function withCheckOnFailure<TInput>(shell: AgentTool<TInput, unknown>, options: CheckOnFailureOptions): AgentTool<TInput, unknown>;
|
|
38
|
+
/**
|
|
39
|
+
* Find the shell tool and the checker in an assembled toolset and join them.
|
|
40
|
+
*
|
|
41
|
+
* By name on both sides: a host that swapped in its own `run_commands` or its
|
|
42
|
+
* own `check_file` gets the same wiring as the builtins, and a host missing
|
|
43
|
+
* either gets its list back untouched.
|
|
44
|
+
*/
|
|
45
|
+
export declare function joinCheckerToShell<TTool extends AgentTool<never, unknown>>(tools: readonly TTool[], options: {
|
|
46
|
+
cwd: string;
|
|
47
|
+
shellName: string;
|
|
48
|
+
checkerName: string;
|
|
49
|
+
}): TTool[];
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type AgentTool } from "@cerebriline/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Hand the model the workspace's language servers.
|
|
4
|
+
*
|
|
5
|
+
* VS Code already runs a language server for every language in the workspace,
|
|
6
|
+
* and those servers already know what every symbol means: where it is defined,
|
|
7
|
+
* everywhere it is used, what its type is, which classes implement it. None of
|
|
8
|
+
* that reached the model. It had regex search — `search_codebase` — and a regex
|
|
9
|
+
* cannot tell a definition from a mention, a method on this class from a method
|
|
10
|
+
* with the same name on another, or a live reference from one inside a comment.
|
|
11
|
+
*
|
|
12
|
+
* So the model compensates by reading. It greps a name, gets forty hits, reads
|
|
13
|
+
* six files to work out which one is the definition, and spends the turns on
|
|
14
|
+
* work the editor had already done and would have answered instantly. This is
|
|
15
|
+
* free capability that was sitting one `executeCommand` away.
|
|
16
|
+
*
|
|
17
|
+
* Position resolution is the part that makes it usable. Every LSP request is
|
|
18
|
+
* addressed by line and character, and a model almost never has those — it has
|
|
19
|
+
* a name it read in a file. So `symbol` is the primary way to ask, and the
|
|
20
|
+
* position is found on the model's behalf; line/character are accepted too, for
|
|
21
|
+
* when it does know.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CODE_INTEL_TOOL_NAME = "code_intel";
|
|
24
|
+
export declare const CODE_INTEL_OPERATIONS: readonly ["definition", "references", "implementations", "type_definition", "hover", "document_symbols", "workspace_symbols", "callers"];
|
|
25
|
+
export type CodeIntelOperation = (typeof CODE_INTEL_OPERATIONS)[number];
|
|
26
|
+
export declare const CODE_INTEL_TOOL_DESCRIPTION = "Ask the language servers \u2014 the LSP \u2014 about a symbol. If you are reaching for an LSP tool or an MCP server that wraps one, this is it: the same protocol, already running against this workspace and its open files, with no server to start. This answers questions a text search cannot, because it understands the code: it distinguishes a definition from a mention, and this class's method from another class's method of the same name.\n\nUse this before falling back to `search_codebase` for anything about a symbol. It is faster, exact, and does not need you to read files to interpret the result.\n\nReach for it the moment you are about to do one of these by hand:\n- search for a name to find where it is defined -> `definition`\n- search for a name to find what uses it, or what would break -> `references` or `callers`\n- open a file just to read a signature, type or doc comment -> `hover`\n- scroll a file, or count brackets, to work out its structure -> `document_symbols`\n- grep the repo to find which file something lives in -> `workspace_symbols`\n\nOperations:\n- `definition` \u2014 where a symbol is defined.\n- `references` \u2014 every place it is actually used.\n- `implementations` \u2014 the classes or functions implementing an interface or abstract method.\n- `type_definition` \u2014 where the type of an expression is defined.\n- `hover` \u2014 the signature, type and documentation, as an editor shows on hover.\n- `document_symbols` \u2014 an outline of one file: its classes, functions and methods.\n- `workspace_symbols` \u2014 find a symbol by name across the whole project when you do not know which file it is in.\n- `callers` \u2014 what calls this function.\n\nHow to address a symbol:\n- Usually: `path` plus `symbol` \u2014 the name as it appears in that file.\n- If you know the exact position: `path`, `line` and `character` (both 1-based).\n- If you do not know the file: `symbol` alone, with `operation: \"workspace_symbols\"`.\n\nOutput: plain text, one result per line as `file:line:column` followed by that source line, so you can go straight to the one you want rather than reading each candidate. `hover` returns the signature and documentation as text instead, and `document_symbols` and `workspace_symbols` name each symbol's kind. No results is a definite answer \u2014 the language server understands this symbol and nothing matches \u2014 so do not fall back to a text search for the same question.";
|
|
27
|
+
/** Exported for the same reason as `CHECK_FILE_TOOL_INPUT_SCHEMA`. */
|
|
28
|
+
export declare const CODE_INTEL_TOOL_INPUT_SCHEMA: {
|
|
29
|
+
readonly type: "object";
|
|
30
|
+
readonly properties: {
|
|
31
|
+
readonly operation: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly enum: readonly ["definition", "references", "implementations", "type_definition", "hover", "document_symbols", "workspace_symbols", "callers"];
|
|
34
|
+
readonly description: "What to ask the language server.";
|
|
35
|
+
};
|
|
36
|
+
readonly path: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
readonly description: "File the symbol appears in. Absolute, or relative to the working directory.";
|
|
39
|
+
};
|
|
40
|
+
readonly symbol: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly description: "The symbol's name, as written in that file. The usual way to address a symbol.";
|
|
43
|
+
};
|
|
44
|
+
readonly line: {
|
|
45
|
+
readonly type: "number";
|
|
46
|
+
readonly description: "1-based line, if you know the exact position.";
|
|
47
|
+
};
|
|
48
|
+
readonly character: {
|
|
49
|
+
readonly type: "number";
|
|
50
|
+
readonly description: "1-based column, if you know the exact position.";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly required: readonly ["operation"];
|
|
54
|
+
};
|
|
55
|
+
/** A location in a file. Lines and characters are 0-based, as LSP has them. */
|
|
56
|
+
export interface CodeIntelLocation {
|
|
57
|
+
filePath: string;
|
|
58
|
+
line: number;
|
|
59
|
+
character: number;
|
|
60
|
+
}
|
|
61
|
+
export interface CodeIntelSymbol {
|
|
62
|
+
name: string;
|
|
63
|
+
/** "class", "function", "method", … — whatever the server calls it. */
|
|
64
|
+
kind: string;
|
|
65
|
+
location: CodeIntelLocation;
|
|
66
|
+
/** The class or module the symbol sits in, when the server says. */
|
|
67
|
+
containerName?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Everything this tool needs from the editor.
|
|
71
|
+
*
|
|
72
|
+
* An interface rather than direct `vscode` calls so the tool's behaviour — the
|
|
73
|
+
* position resolution, the fallbacks, the rendering — is testable without an
|
|
74
|
+
* extension host. `check-file-tool.ts` is built the same way.
|
|
75
|
+
*/
|
|
76
|
+
export interface CodeIntelProvider {
|
|
77
|
+
/** Locate a name inside one file, for the position-addressed requests. */
|
|
78
|
+
findSymbolPosition(filePath: string, symbol: string): Promise<CodeIntelLocation | undefined>;
|
|
79
|
+
definitions(at: CodeIntelLocation): Promise<CodeIntelLocation[]>;
|
|
80
|
+
typeDefinitions(at: CodeIntelLocation): Promise<CodeIntelLocation[]>;
|
|
81
|
+
implementations(at: CodeIntelLocation): Promise<CodeIntelLocation[]>;
|
|
82
|
+
references(at: CodeIntelLocation): Promise<CodeIntelLocation[]>;
|
|
83
|
+
hover(at: CodeIntelLocation): Promise<string | undefined>;
|
|
84
|
+
documentSymbols(filePath: string): Promise<CodeIntelSymbol[]>;
|
|
85
|
+
workspaceSymbols(query: string): Promise<CodeIntelSymbol[]>;
|
|
86
|
+
callers(at: CodeIntelLocation): Promise<CodeIntelSymbol[]>;
|
|
87
|
+
/** The source line, so a result is readable without opening the file. */
|
|
88
|
+
readLine(filePath: string, line: number): Promise<string | undefined>;
|
|
89
|
+
}
|
|
90
|
+
export interface CodeIntelToolOptions {
|
|
91
|
+
cwd: string;
|
|
92
|
+
provider: CodeIntelProvider;
|
|
93
|
+
/**
|
|
94
|
+
* Where a failed request goes. Injected rather than imported: this tool is
|
|
95
|
+
* shared by the extension and the CLI, and each has its own logger.
|
|
96
|
+
*/
|
|
97
|
+
onError?: (message: string, error: unknown) => void;
|
|
98
|
+
}
|
|
99
|
+
interface CodeIntelInput {
|
|
100
|
+
operation?: unknown;
|
|
101
|
+
path?: unknown;
|
|
102
|
+
symbol?: unknown;
|
|
103
|
+
/**
|
|
104
|
+
* Accepted as a spelling of `symbol`. `search_codebase` sits next to this
|
|
105
|
+
* tool and takes `queries`, so a model reaching for a name-search here
|
|
106
|
+
* reasonably guesses `query` -- observed doing exactly that, which cost a
|
|
107
|
+
* turn and a fall back to a text search for a question the language server
|
|
108
|
+
* had already been asked.
|
|
109
|
+
*/
|
|
110
|
+
query?: unknown;
|
|
111
|
+
line?: unknown;
|
|
112
|
+
character?: unknown;
|
|
113
|
+
}
|
|
114
|
+
export interface ParsedCodeIntelRequest {
|
|
115
|
+
operation: CodeIntelOperation;
|
|
116
|
+
filePath?: string;
|
|
117
|
+
symbol?: string;
|
|
118
|
+
/** 0-based, converted from the 1-based numbers the description asks for. */
|
|
119
|
+
line?: number;
|
|
120
|
+
character?: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Read a request, or say what is missing from it.
|
|
124
|
+
*
|
|
125
|
+
* Returns a message rather than throwing: an unusable call should cost the
|
|
126
|
+
* model one sentence telling it what to send, not a tool error it has to
|
|
127
|
+
* interpret.
|
|
128
|
+
*/
|
|
129
|
+
export declare function parseCodeIntelRequest(input: CodeIntelInput | undefined): ParsedCodeIntelRequest | string;
|
|
130
|
+
export declare function createCodeIntelTool(options: CodeIntelToolOptions): AgentTool;
|
|
131
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan-Mode Command Guard Extension
|
|
3
|
+
*
|
|
4
|
+
* Runtime extension that enforces the plan-mode command blacklist
|
|
5
|
+
* (./command-guard.ts) as a `beforeTool` hook. The runtime builder registers
|
|
6
|
+
* it for plan-mode sessions, making command blocking session policy in one
|
|
7
|
+
* shared place: the hook fires for every `run_commands` tool in the runtime —
|
|
8
|
+
* the SDK built-in and host-provided replacements like the VS Code
|
|
9
|
+
* extension's terminal-backed tool — without threading a flag through each
|
|
10
|
+
* layer.
|
|
11
|
+
*
|
|
12
|
+
* Because `beforeTool` hooks run before tool policies and user approval,
|
|
13
|
+
* a blocked call is rejected up front: the user is never asked to approve a
|
|
14
|
+
* command that would only fail, and the model receives the plan-mode error
|
|
15
|
+
* as the tool result (`skip`, not `stop`, so the run continues).
|
|
16
|
+
*/
|
|
17
|
+
import type { AgentExtension, ITelemetryService } from "@cerebriline/shared";
|
|
18
|
+
export declare const PLAN_MODE_COMMAND_GUARD_EXTENSION_NAME = "core.plan-mode-command-guard";
|
|
19
|
+
export interface PlanModeCommandGuardOptions {
|
|
20
|
+
telemetry?: ITelemetryService;
|
|
21
|
+
}
|
|
22
|
+
export declare function createPlanModeCommandGuardExtension(options?: PlanModeCommandGuardOptions): AgentExtension;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan-mode command blacklist for run_commands.
|
|
3
|
+
*
|
|
4
|
+
* Plan mode keeps run_commands available for read-only investigation, but
|
|
5
|
+
* models (especially weaker ones) use it to edit files anyway. When the plan
|
|
6
|
+
* preset sets `blockFileEditingCommands`, createShellTool checks each command
|
|
7
|
+
* against this blacklist before executing and returns a tool error instead of
|
|
8
|
+
* running anything that looks like a file modification.
|
|
9
|
+
*
|
|
10
|
+
* This is a simple blacklist, not a shell interpreter. Commands are lightly
|
|
11
|
+
* preprocessed (quoted text, heredoc bodies, escapes, and comments are masked
|
|
12
|
+
* so they cannot false-positive), split on shell separators, and the leading
|
|
13
|
+
* command word of each part is compared against the lists below; output
|
|
14
|
+
* redirection to files is also rejected. It will not catch every possible
|
|
15
|
+
* mutation (e.g. `python -c "open(..., 'w')"` or commands hidden inside a
|
|
16
|
+
* quoted `bash -c` string) — it exists to stop the common ways models edit
|
|
17
|
+
* files from the shell, and entries are easy to add.
|
|
18
|
+
*/
|
|
19
|
+
import type { StructuredCommandInput } from "./schemas";
|
|
20
|
+
/**
|
|
21
|
+
* Inspect a run_commands entry and return a short description of the first
|
|
22
|
+
* file-modifying construct found, or undefined when the command looks
|
|
23
|
+
* read-only.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findFileEditingCommand(command: string | StructuredCommandInput): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Tool error returned in place of executing a blocked command in plan mode.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatPlanModeBlockedCommandError(reason: string): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for Default Tools
|
|
3
|
+
*
|
|
4
|
+
* Tool name constants and utility arrays.
|
|
5
|
+
*/
|
|
6
|
+
import type { DefaultToolName } from "./types";
|
|
7
|
+
/**
|
|
8
|
+
* Constants for default tool names
|
|
9
|
+
*/
|
|
10
|
+
export declare const DefaultToolNames: {
|
|
11
|
+
readonly READ_FILES: "read_files";
|
|
12
|
+
readonly SEARCH_CODEBASE: "search_codebase";
|
|
13
|
+
readonly RUN_COMMANDS: "run_commands";
|
|
14
|
+
readonly FETCH_WEB_CONTENT: "fetch_web_content";
|
|
15
|
+
readonly APPLY_PATCH: "apply_patch";
|
|
16
|
+
readonly EDITOR: "editor";
|
|
17
|
+
readonly GREP: "grep";
|
|
18
|
+
readonly SED: "sed";
|
|
19
|
+
readonly AWK: "awk";
|
|
20
|
+
readonly EXTRACT_DOCUMENT: "extract_document";
|
|
21
|
+
readonly SKILLS: "skills";
|
|
22
|
+
readonly ASK: "ask_question";
|
|
23
|
+
readonly SUBMIT_AND_EXIT: "submit_and_exit";
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Array of all default tool names
|
|
27
|
+
*/
|
|
28
|
+
export declare const ALL_DEFAULT_TOOL_NAMES: DefaultToolName[];
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default AgentTool Definitions
|
|
3
|
+
*
|
|
4
|
+
* Factory functions for creating the default tools.
|
|
5
|
+
*/
|
|
6
|
+
import { type AgentTool, type ShellKind } from "@cerebriline/shared";
|
|
7
|
+
import { type QaCredential } from "./qa-credentials";
|
|
8
|
+
import { type ApplyPatchInput, type AskQuestionInput, type AwkToolInput, type EditFileInput, type ExtractDocumentInput, type FetchWebContentInput, type GrepToolInput, type ReadFileRequest, type ReadFilesInput, type SearchCodebaseInput, type SedToolInput, type SkillsInput, type SubmitInput } from "./schemas";
|
|
9
|
+
import type { ApplyPatchExecutor, AskQuestionExecutor, AwkExecutor, CreateDefaultToolsOptions, DefaultToolsConfig, EditorExecutor, ExtractDocumentExecutor, FileReadExecutor, GrepExecutor, SearchExecutor, SedExecutor, ShellExecutor, SkillsExecutorWithMetadata, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor } from "./types";
|
|
10
|
+
/**
|
|
11
|
+
* What a successful read with no content is told to mean.
|
|
12
|
+
*
|
|
13
|
+
* A range whose start is past the end of the file is not an error — the read
|
|
14
|
+
* succeeds and returns nothing. To a model that is paging through a file, an
|
|
15
|
+
* empty successful result reads as "nothing here yet, try again", and it does:
|
|
16
|
+
* measured against a local model, 15 identical `read_files` calls in a row,
|
|
17
|
+
* which no instruction and no output budget broke out of, because every one of
|
|
18
|
+
* them looked like a retryable miss. Saying what the emptiness means, and that
|
|
19
|
+
* there is nothing further to ask for, is what ends the loop.
|
|
20
|
+
*/
|
|
21
|
+
export declare const EMPTY_READ_EXPLANATION = "[no content returned: the requested line range starts past the end of this file, or the file is empty. Do not request another range for this file - use the content you already have.]";
|
|
22
|
+
/**
|
|
23
|
+
* Create the read_files tool
|
|
24
|
+
*
|
|
25
|
+
* Reads the content of one or more files from the filesystem.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Every shape `read_files` accepts, reduced to the list of reads it means.
|
|
29
|
+
*
|
|
30
|
+
* Exported because the change protocol serves `revision: "base"` from the
|
|
31
|
+
* transaction's snapshot rather than from disk, and it has to understand a
|
|
32
|
+
* call exactly as the tool itself does. A second parser would drift, and it
|
|
33
|
+
* would drift silently: the two only disagree on the odd shapes -- a bare
|
|
34
|
+
* string, a bracketed path list, a range that arrived detached from its path
|
|
35
|
+
* -- which are the calls a smaller model actually makes.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readFileRequestsFrom(input: unknown): ReadFileRequest[];
|
|
38
|
+
export declare function createReadFilesTool(executor: FileReadExecutor, config?: Pick<DefaultToolsConfig, "fileReadTimeoutMs">): AgentTool<ReadFilesInput, ToolOperationResult[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Create the search_codebase tool
|
|
41
|
+
*
|
|
42
|
+
* Performs regex pattern searches across the codebase.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createSearchTool(executor: SearchExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "searchTimeoutMs">): AgentTool<SearchCodebaseInput, ToolOperationResult[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Build the run_commands tool description for the shell that will actually
|
|
47
|
+
* execute the commands. The shell kind decides the syntax guidance (quoting,
|
|
48
|
+
* sequencing, heredocs), and isWindows adds environment context for POSIX
|
|
49
|
+
* shells running on a Windows host (e.g. Git Bash).
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildRunCommandsDescription(shellKind: ShellKind, isWindows: boolean): string;
|
|
52
|
+
/**
|
|
53
|
+
* Create the run_commands shell tool for the current platform.
|
|
54
|
+
*
|
|
55
|
+
* This preserves the SDK's platform-specific prompting/schema choices while
|
|
56
|
+
* exposing a single generic shell-tool factory for host integrations. Pass
|
|
57
|
+
* config.shell (matching the executor's shell) so the syntax guidance in the
|
|
58
|
+
* tool description matches the shell that actually runs the commands.
|
|
59
|
+
*
|
|
60
|
+
* config.shell may be a provider function instead of a string. The runtime
|
|
61
|
+
* reads `description` when building each model request, so a provider is
|
|
62
|
+
* consulted at that boundary: a shell change made while the model is
|
|
63
|
+
* generating does not affect the request in flight, and the next request
|
|
64
|
+
* names the new shell. The provider must return the shell the executor will
|
|
65
|
+
* use for tool calls issued by that next request.
|
|
66
|
+
*/
|
|
67
|
+
export declare function createShellTool(executor: ShellExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "bashTimeoutMs" | "telemetry"> & {
|
|
68
|
+
shell?: string | (() => string);
|
|
69
|
+
/**
|
|
70
|
+
* QA credentials the user configured.
|
|
71
|
+
*
|
|
72
|
+
* A provider rather than a list because the set is editable while a
|
|
73
|
+
* session runs, and because reading it late keeps the values out of this
|
|
74
|
+
* closure until a command actually needs one.
|
|
75
|
+
*/
|
|
76
|
+
qaCredentials?: readonly QaCredential[] | (() => readonly QaCredential[]);
|
|
77
|
+
}): AgentTool<unknown, ToolOperationResult[]>;
|
|
78
|
+
/**
|
|
79
|
+
* The checklist as a tool in its own right.
|
|
80
|
+
*
|
|
81
|
+
* It carries no behaviour: `withTaskProgressCapture` reads the checklist off
|
|
82
|
+
* the raw input of every tool call, this one included, so the work is already
|
|
83
|
+
* done by the time `execute` runs. What it adds is a name the model can call
|
|
84
|
+
* when it has nothing else to do at that moment -- which is exactly when a
|
|
85
|
+
* plan is usually written, and exactly when there is no other call to attach
|
|
86
|
+
* it to.
|
|
87
|
+
*/
|
|
88
|
+
export declare function createTaskProgressTool(): AgentTool<Record<string, unknown>, ToolOperationResult[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Create the fetch_web_content tool
|
|
91
|
+
*
|
|
92
|
+
* Fetches content from URLs and analyzes them using provided prompts.
|
|
93
|
+
*/
|
|
94
|
+
export declare function createWebFetchTool(executor: WebFetchExecutor, config?: Pick<DefaultToolsConfig, "webFetchTimeoutMs">): AgentTool<FetchWebContentInput, ToolOperationResult[]>;
|
|
95
|
+
/**
|
|
96
|
+
* Create the apply_patch tool
|
|
97
|
+
*
|
|
98
|
+
* Applies the canonical apply_patch format to one or more files.
|
|
99
|
+
*/
|
|
100
|
+
export declare function createApplyPatchTool(executor: ApplyPatchExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "applyPatchTimeoutMs">): AgentTool<ApplyPatchInput, ToolOperationResult>;
|
|
101
|
+
/**
|
|
102
|
+
* Create the editor tool
|
|
103
|
+
*
|
|
104
|
+
* Supports controlled filesystem edits with create, replace, and insert commands.
|
|
105
|
+
*/
|
|
106
|
+
export declare function createEditorTool(executor: EditorExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "editorTimeoutMs">): AgentTool<EditFileInput, ToolOperationResult>;
|
|
107
|
+
/**
|
|
108
|
+
* Create the grep tool.
|
|
109
|
+
*/
|
|
110
|
+
export declare function createGrepTool(executor: GrepExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "textToolsTimeoutMs">): AgentTool<GrepToolInput, ToolOperationResult>;
|
|
111
|
+
/**
|
|
112
|
+
* Create the extract_document tool.
|
|
113
|
+
*
|
|
114
|
+
* A reader, and flagged `readOnly`, although it writes: what it writes is its
|
|
115
|
+
* own output (the text and the pictures of the document it was asked to
|
|
116
|
+
* read), inside the workspace, never a file the user made.
|
|
117
|
+
*/
|
|
118
|
+
export declare function createExtractDocumentTool(executor: ExtractDocumentExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "extractDocumentTimeoutMs">): AgentTool<ExtractDocumentInput, ToolOperationResult>;
|
|
119
|
+
/**
|
|
120
|
+
* Create the sed tool.
|
|
121
|
+
*/
|
|
122
|
+
export declare function createSedTool(executor: SedExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "textToolsTimeoutMs">): AgentTool<SedToolInput, ToolOperationResult[]>;
|
|
123
|
+
/**
|
|
124
|
+
* Create the awk tool.
|
|
125
|
+
*/
|
|
126
|
+
export declare function createAwkTool(executor: AwkExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "textToolsTimeoutMs">): AgentTool<AwkToolInput, ToolOperationResult>;
|
|
127
|
+
/**
|
|
128
|
+
* Create the skills tool
|
|
129
|
+
*
|
|
130
|
+
* Invokes a configured skill by name and optional arguments.
|
|
131
|
+
*/
|
|
132
|
+
export declare function createSkillsTool(executor: SkillsExecutorWithMetadata, config?: Pick<DefaultToolsConfig, "skillsTimeoutMs">): AgentTool<SkillsInput, string>;
|
|
133
|
+
/**
|
|
134
|
+
* Create the ask_question tool
|
|
135
|
+
*
|
|
136
|
+
* Asks the user a single clarifying question with 2-5 selectable options.
|
|
137
|
+
*/
|
|
138
|
+
export declare function createAskQuestionTool(executor: AskQuestionExecutor): AgentTool<AskQuestionInput, string>;
|
|
139
|
+
export declare function createSubmitAndExitTool(executor: VerifySubmitExecutor, config?: Pick<DefaultToolsConfig, "submitTimeoutMs">): AgentTool<SubmitInput, string>;
|
|
140
|
+
/**
|
|
141
|
+
* Create a set of default tools for an agent
|
|
142
|
+
*
|
|
143
|
+
* This function creates the default tools based on the provided configuration
|
|
144
|
+
* and executors. Only tools that are enabled AND have an executor provided
|
|
145
|
+
* will be included in the returned array.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* import { Agent, createDefaultTools } from "@cerebriline/core"
|
|
150
|
+
* import * as fs from "fs/promises"
|
|
151
|
+
* import { exec } from "child_process"
|
|
152
|
+
*
|
|
153
|
+
* const tools = createDefaultTools({
|
|
154
|
+
* executors: {
|
|
155
|
+
* readFile: async ({ path }) => fs.readFile(path, "utf-8"),
|
|
156
|
+
* bash: async (cmd, cwd) => {
|
|
157
|
+
* return new Promise((resolve, reject) => {
|
|
158
|
+
* exec(cmd, { cwd }, (err, stdout, stderr) => {
|
|
159
|
+
* if (err) reject(new Error(stderr || err.message))
|
|
160
|
+
* else resolve(stdout)
|
|
161
|
+
* })
|
|
162
|
+
* })
|
|
163
|
+
* },
|
|
164
|
+
* },
|
|
165
|
+
* enableReadFiles: true,
|
|
166
|
+
* enableBash: true,
|
|
167
|
+
* enableSearch: false, // Disabled
|
|
168
|
+
* enableWebFetch: false, // Disabled
|
|
169
|
+
* cwd: "/path/to/project",
|
|
170
|
+
* })
|
|
171
|
+
*
|
|
172
|
+
* const agent = new Agent({
|
|
173
|
+
* // ... provider config
|
|
174
|
+
* tools,
|
|
175
|
+
* })
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
export declare function createDefaultTools(options: CreateDefaultToolsOptions): AgentTool[];
|