@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,410 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for Default Tools
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for executors, configuration, and results.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentToolContext, ImageContent, ITelemetryService, TextContent } from "@cerebriline/shared";
|
|
7
|
+
import type { SedFileOutcome } from "./executors/sed";
|
|
8
|
+
import type { QaCredential } from "./qa-credentials";
|
|
9
|
+
import type { ApplyPatchInput, AwkToolInput, EditFileInput, ExtractDocumentInput, GrepToolInput, ReadFileRequest, SedToolInput, StructuredCommandInput } from "./schemas";
|
|
10
|
+
import type { TaskProgressTracker } from "./task-progress";
|
|
11
|
+
/**
|
|
12
|
+
* Result from a single tool operation
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolOperationResult {
|
|
15
|
+
/** The query/input that was executed */
|
|
16
|
+
query: string;
|
|
17
|
+
/** The result content (if successful) */
|
|
18
|
+
result: unknown;
|
|
19
|
+
/** Error message (if failed) */
|
|
20
|
+
error?: string;
|
|
21
|
+
/** Whether the operation succeeded */
|
|
22
|
+
success: boolean;
|
|
23
|
+
/** Duration in MS */
|
|
24
|
+
duration?: number;
|
|
25
|
+
}
|
|
26
|
+
export type FileReadResultContent = string | Array<TextContent | ImageContent>;
|
|
27
|
+
/**
|
|
28
|
+
* Executor for reading files
|
|
29
|
+
*
|
|
30
|
+
* @param request - File path and optional inclusive line range to read
|
|
31
|
+
* @param context - Tool execution context
|
|
32
|
+
* @returns The file content as a string
|
|
33
|
+
*/
|
|
34
|
+
export type FileReadExecutor = (request: ReadFileRequest, context: AgentToolContext) => Promise<FileReadResultContent>;
|
|
35
|
+
/**
|
|
36
|
+
* Executor for searching the codebase
|
|
37
|
+
*
|
|
38
|
+
* @param query - Regex pattern to search for
|
|
39
|
+
* @param cwd - Current working directory for the search
|
|
40
|
+
* @param context - Tool execution context
|
|
41
|
+
* @returns Search results as a formatted string
|
|
42
|
+
*/
|
|
43
|
+
/** Per-call overrides for one search, on top of the executor's defaults. */
|
|
44
|
+
export interface SearchQueryOptions {
|
|
45
|
+
/** Lines shown either side of a match. */
|
|
46
|
+
contextLines?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Matches reported per file. One by default, which answers "which files
|
|
49
|
+
* mention this" and cannot answer "how many times, and where".
|
|
50
|
+
*/
|
|
51
|
+
maxPerFile?: number;
|
|
52
|
+
}
|
|
53
|
+
export type SearchExecutor = (query: string, cwd: string, context: AgentToolContext, options?: SearchQueryOptions) => Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Per-call execution options for a shell executor.
|
|
56
|
+
*/
|
|
57
|
+
export interface ShellExecutionOptions {
|
|
58
|
+
/**
|
|
59
|
+
* Environment for this command and no other.
|
|
60
|
+
*
|
|
61
|
+
* Separate from the executor's own `env` because it carries QA credentials,
|
|
62
|
+
* which are scoped to the single command that asked for them. An executor
|
|
63
|
+
* that cannot honour per-command environment -- a persistent terminal, where
|
|
64
|
+
* anything exported outlives the command -- must not silently ignore this;
|
|
65
|
+
* see the VS Code `run_commands` tool, which routes such a command to a
|
|
66
|
+
* child process instead.
|
|
67
|
+
*/
|
|
68
|
+
env?: Record<string, string>;
|
|
69
|
+
/**
|
|
70
|
+
* Names to strip from the inherited environment before `env` is applied.
|
|
71
|
+
*
|
|
72
|
+
* Without this the gate is decorative wherever the host itself holds the
|
|
73
|
+
* secret: the CLI is started with `QA_PASSWORD` exported, `spawn` inherits
|
|
74
|
+
* the parent environment, and every command in the run sees it whether it
|
|
75
|
+
* asked or not. Withholding the declared names and re-adding only the ones a
|
|
76
|
+
* command asked for gives that host the same guarantee as one with a secret
|
|
77
|
+
* store.
|
|
78
|
+
*/
|
|
79
|
+
withhold?: readonly string[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Executor for running shell commands
|
|
83
|
+
*
|
|
84
|
+
* @param command - Shell command to execute
|
|
85
|
+
* @param cwd - Current working directory for execution
|
|
86
|
+
* @param context - Tool execution context
|
|
87
|
+
* @param options - Per-call options, currently the command's own environment
|
|
88
|
+
* @returns Command output (stdout)
|
|
89
|
+
*/
|
|
90
|
+
export type ShellExecutor = (command: string | StructuredCommandInput, cwd: string, context: AgentToolContext, options?: ShellExecutionOptions) => Promise<string>;
|
|
91
|
+
/**
|
|
92
|
+
* Executor for fetching web content
|
|
93
|
+
*
|
|
94
|
+
* @param url - URL to fetch
|
|
95
|
+
* @param prompt - Analysis prompt for the content
|
|
96
|
+
* @param context - Tool execution context
|
|
97
|
+
* @returns Analyzed/extracted content
|
|
98
|
+
*/
|
|
99
|
+
export type WebFetchExecutor = (url: string, prompt: string, context: AgentToolContext) => Promise<string>;
|
|
100
|
+
/**
|
|
101
|
+
* Executor for editing files
|
|
102
|
+
*
|
|
103
|
+
* @param input - Editor command input
|
|
104
|
+
* @param cwd - Current working directory for filesystem operations
|
|
105
|
+
* @param context - Tool execution context
|
|
106
|
+
* @returns A formatted operation result string
|
|
107
|
+
*/
|
|
108
|
+
export type EditorExecutor = (input: EditFileInput, cwd: string, context: AgentToolContext) => Promise<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Executor for the in-process `grep`.
|
|
111
|
+
*
|
|
112
|
+
* Read-only, so there is no write guard to satisfy — but it does record what it
|
|
113
|
+
* read, which is why it belongs to the same executor set as the editor rather
|
|
114
|
+
* than being constructed wherever it is called.
|
|
115
|
+
*
|
|
116
|
+
* @param input - grep command input
|
|
117
|
+
* @param cwd - Current working directory; paths are resolved against it
|
|
118
|
+
* @param context - Tool execution context
|
|
119
|
+
*/
|
|
120
|
+
export type GrepExecutor = (input: GrepToolInput, cwd: string, context: AgentToolContext) => Promise<string>;
|
|
121
|
+
/**
|
|
122
|
+
* Executor for the in-process `sed`.
|
|
123
|
+
*
|
|
124
|
+
* `in_place: true` writes, so it takes the same read receipt the editor takes:
|
|
125
|
+
* a file the model has not read is not a file it may rewrite.
|
|
126
|
+
*
|
|
127
|
+
* @param input - sed command input
|
|
128
|
+
* @param cwd - Current working directory; paths are resolved against it
|
|
129
|
+
* @param context - Tool execution context
|
|
130
|
+
*/
|
|
131
|
+
export type SedExecutor = (input: SedToolInput, cwd: string, context: AgentToolContext) => Promise<SedFileOutcome[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Executor for the in-process `awk`.
|
|
134
|
+
*
|
|
135
|
+
* Read-only by construction — output redirection, pipes and `getline` are all
|
|
136
|
+
* refused — so, like grep, it records reads and guards no writes.
|
|
137
|
+
*
|
|
138
|
+
* @param input - awk command input
|
|
139
|
+
* @param cwd - Current working directory; paths are resolved against it
|
|
140
|
+
* @param context - Tool execution context
|
|
141
|
+
*/
|
|
142
|
+
export type AwkExecutor = (input: AwkToolInput, cwd: string, context: AgentToolContext) => Promise<string>;
|
|
143
|
+
/**
|
|
144
|
+
* Executor for `extract_document`: a document to markdown or text, its
|
|
145
|
+
* pictures written as files. Returns image parts too when `images: "inline"`.
|
|
146
|
+
*/
|
|
147
|
+
export type ExtractDocumentExecutor = (input: ExtractDocumentInput, cwd: string, context: AgentToolContext) => Promise<FileReadResultContent>;
|
|
148
|
+
/**
|
|
149
|
+
* Executor for apply_patch operations
|
|
150
|
+
*
|
|
151
|
+
* @param input - apply_patch command payload
|
|
152
|
+
* @param cwd - Current working directory for filesystem operations
|
|
153
|
+
* @param context - Tool execution context
|
|
154
|
+
* @returns A formatted operation result string
|
|
155
|
+
*/
|
|
156
|
+
export type ApplyPatchExecutor = (input: ApplyPatchInput, cwd: string, context: AgentToolContext) => Promise<string>;
|
|
157
|
+
/**
|
|
158
|
+
* Executor for invoking configured skills
|
|
159
|
+
*
|
|
160
|
+
* @param skill - Skill name to invoke
|
|
161
|
+
* @param args - Optional arguments for the skill
|
|
162
|
+
* @param context - Tool execution context
|
|
163
|
+
* @returns Skill loading/invocation result
|
|
164
|
+
*/
|
|
165
|
+
export type SkillsExecutor = (skill: string, args: string | undefined, context: AgentToolContext) => Promise<string>;
|
|
166
|
+
/**
|
|
167
|
+
* Executor for asking a single follow-up question with selectable options
|
|
168
|
+
*
|
|
169
|
+
* @param question - Single clarifying question for the user
|
|
170
|
+
* @param options - 2-5 selectable answer options
|
|
171
|
+
* @param context - Tool execution context
|
|
172
|
+
* @returns Executor-specific result payload
|
|
173
|
+
*/
|
|
174
|
+
export type AskQuestionExecutor = (question: string, options: string[], context: AgentToolContext) => Promise<string>;
|
|
175
|
+
/**
|
|
176
|
+
* Skill metadata exposed by SkillsExecutor for clients/UI
|
|
177
|
+
*/
|
|
178
|
+
export interface SkillsExecutorSkillMetadata {
|
|
179
|
+
/** Normalized skill id (usually lowercased name) */
|
|
180
|
+
id: string;
|
|
181
|
+
/** Display name for the skill */
|
|
182
|
+
name: string;
|
|
183
|
+
/** Optional short description */
|
|
184
|
+
description?: string;
|
|
185
|
+
/** True when configured but intentionally disabled */
|
|
186
|
+
disabled: boolean;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* A callable executor that can also expose configured skill metadata.
|
|
190
|
+
*/
|
|
191
|
+
export interface SkillsExecutorWithMetadata {
|
|
192
|
+
(skill: string, args: string | undefined, context: AgentToolContext): Promise<string>;
|
|
193
|
+
configuredSkills?: SkillsExecutorSkillMetadata[];
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Executor for verifying a user's response to a question
|
|
197
|
+
*
|
|
198
|
+
* @param summary - Summary of the solution ans steps taken
|
|
199
|
+
* @param verified - Boolean indicating if the solution has been verified
|
|
200
|
+
* @param context - Tool execution context
|
|
201
|
+
* @returns Executor-specific result payload
|
|
202
|
+
*/
|
|
203
|
+
export type VerifySubmitExecutor = (summary: string, verified: boolean, context: AgentToolContext) => Promise<string>;
|
|
204
|
+
/**
|
|
205
|
+
* Collection of all tool executors
|
|
206
|
+
*/
|
|
207
|
+
export interface ToolExecutors {
|
|
208
|
+
/** File reading implementation */
|
|
209
|
+
readFile?: FileReadExecutor;
|
|
210
|
+
/** Codebase search implementation */
|
|
211
|
+
search?: SearchExecutor;
|
|
212
|
+
/** Shell command execution implementation */
|
|
213
|
+
bash?: ShellExecutor;
|
|
214
|
+
/** Web content fetching implementation */
|
|
215
|
+
webFetch?: WebFetchExecutor;
|
|
216
|
+
/** Filesystem editor implementation */
|
|
217
|
+
editor?: EditorExecutor;
|
|
218
|
+
/** In-process grep implementation */
|
|
219
|
+
grep?: GrepExecutor;
|
|
220
|
+
/** In-process sed implementation */
|
|
221
|
+
sed?: SedExecutor;
|
|
222
|
+
/** In-process awk implementation */
|
|
223
|
+
awk?: AwkExecutor;
|
|
224
|
+
/** Document to text/markdown, pictures to files */
|
|
225
|
+
extractDocument?: ExtractDocumentExecutor;
|
|
226
|
+
/** Apply patch implementation */
|
|
227
|
+
applyPatch?: ApplyPatchExecutor;
|
|
228
|
+
/** Skill invocation implementation */
|
|
229
|
+
skills?: SkillsExecutorWithMetadata;
|
|
230
|
+
/** Follow-up question implementation */
|
|
231
|
+
askQuestion?: AskQuestionExecutor;
|
|
232
|
+
/** Final submission implementation */
|
|
233
|
+
submit?: VerifySubmitExecutor;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Names of available default tools
|
|
237
|
+
*/
|
|
238
|
+
export type DefaultToolName = "read_files" | "search_codebase" | "run_commands" | "fetch_web_content" | "apply_patch" | "editor" | "grep" | "sed" | "awk" | "extract_document" | "skills" | "ask_question" | "submit_and_exit";
|
|
239
|
+
/**
|
|
240
|
+
* Configuration for enabling/disabling default tools
|
|
241
|
+
*/
|
|
242
|
+
export interface DefaultToolsConfig {
|
|
243
|
+
/**
|
|
244
|
+
* QA credentials available to `run_commands`, from the host's secret store.
|
|
245
|
+
* A function when the set can change while a session runs.
|
|
246
|
+
*/
|
|
247
|
+
qaCredentials?: readonly QaCredential[] | (() => readonly QaCredential[]);
|
|
248
|
+
/**
|
|
249
|
+
* Host telemetry service, injected at tool construction time. Tools that
|
|
250
|
+
* emit operational telemetry (e.g. run_commands timeouts) close over this
|
|
251
|
+
* service. It is a live host object and must never travel on the per-call
|
|
252
|
+
* AgentToolContext, which crosses process boundaries over JSON IPC.
|
|
253
|
+
*/
|
|
254
|
+
telemetry?: ITelemetryService;
|
|
255
|
+
/**
|
|
256
|
+
* Enable the read_files tool
|
|
257
|
+
* @default true
|
|
258
|
+
*/
|
|
259
|
+
enableReadFiles?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Enable the search_codebase tool
|
|
262
|
+
* @default true
|
|
263
|
+
*/
|
|
264
|
+
enableSearch?: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Enable the run_commands tool
|
|
267
|
+
* @default true
|
|
268
|
+
*/
|
|
269
|
+
enableBash?: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Enable the fetch_web_content tool
|
|
272
|
+
* @default true
|
|
273
|
+
*/
|
|
274
|
+
enableWebFetch?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Enable the apply_patch tool
|
|
277
|
+
* @default true
|
|
278
|
+
*/
|
|
279
|
+
enableApplyPatch?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Enable the editor tool
|
|
282
|
+
* @default true
|
|
283
|
+
*/
|
|
284
|
+
enableEditor?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Enable the grep tool
|
|
287
|
+
* @default true
|
|
288
|
+
*/
|
|
289
|
+
enableGrep?: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* Enable the sed tool
|
|
292
|
+
* @default true
|
|
293
|
+
*/
|
|
294
|
+
enableSed?: boolean;
|
|
295
|
+
/**
|
|
296
|
+
* Enable the awk tool
|
|
297
|
+
* @default true
|
|
298
|
+
*/
|
|
299
|
+
enableAwk?: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Enable the extract_document tool. Off unless asked for: it is a niche
|
|
302
|
+
* reader, and a session pays for its schema on every request.
|
|
303
|
+
* @default false
|
|
304
|
+
*/
|
|
305
|
+
enableExtractDocument?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Enable the skills tool
|
|
308
|
+
* @default true
|
|
309
|
+
*/
|
|
310
|
+
enableSkills?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* Enable the ask_followup_question tool
|
|
313
|
+
* @default true
|
|
314
|
+
*/
|
|
315
|
+
enableAskQuestion?: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Enable the submit_and_exit tool
|
|
318
|
+
* @default false
|
|
319
|
+
*/
|
|
320
|
+
enableSubmitAndExit?: boolean;
|
|
321
|
+
/**
|
|
322
|
+
* Current working directory for tools that need it
|
|
323
|
+
*/
|
|
324
|
+
cwd?: string;
|
|
325
|
+
/**
|
|
326
|
+
* Shell executable (name or full path) the run_commands executor will use.
|
|
327
|
+
* The tool description tells the model which shell syntax to write, so this
|
|
328
|
+
* must match the shell configured on the executor.
|
|
329
|
+
* @default getDefaultShell(process.platform) — "/bin/bash" on Unix, "powershell" on Windows
|
|
330
|
+
*/
|
|
331
|
+
shell?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Timeout for file read operations in milliseconds
|
|
334
|
+
* @default 10000
|
|
335
|
+
*/
|
|
336
|
+
fileReadTimeoutMs?: number;
|
|
337
|
+
/**
|
|
338
|
+
* Timeout for bash command execution in milliseconds
|
|
339
|
+
* @default 30000
|
|
340
|
+
*/
|
|
341
|
+
bashTimeoutMs?: number;
|
|
342
|
+
/**
|
|
343
|
+
* Timeout for web fetch operations in milliseconds
|
|
344
|
+
* @default 30000
|
|
345
|
+
*/
|
|
346
|
+
webFetchTimeoutMs?: number;
|
|
347
|
+
/**
|
|
348
|
+
* Timeout for search operations in milliseconds
|
|
349
|
+
* @default 30000
|
|
350
|
+
*/
|
|
351
|
+
searchTimeoutMs?: number;
|
|
352
|
+
/**
|
|
353
|
+
* Timeout for apply_patch operations in milliseconds
|
|
354
|
+
* @default 30000
|
|
355
|
+
*/
|
|
356
|
+
applyPatchTimeoutMs?: number;
|
|
357
|
+
/**
|
|
358
|
+
* Timeout for editor operations in milliseconds
|
|
359
|
+
* @default 30000
|
|
360
|
+
*/
|
|
361
|
+
editorTimeoutMs?: number;
|
|
362
|
+
/**
|
|
363
|
+
* Timeout for the grep / sed / awk tools, in milliseconds.
|
|
364
|
+
*
|
|
365
|
+
* One value for all three: they are the same kind of work — a pattern over
|
|
366
|
+
* a set of local files — and splitting it into three knobs would invite a
|
|
367
|
+
* host to set one and leave the others at a default it did not choose.
|
|
368
|
+
*
|
|
369
|
+
* @default 30000
|
|
370
|
+
*/
|
|
371
|
+
textToolsTimeoutMs?: number;
|
|
372
|
+
/**
|
|
373
|
+
* Timeout for extract_document, in milliseconds. Long, because a
|
|
374
|
+
* several-hundred-page PDF with pictures is minutes of work, and each
|
|
375
|
+
* scanned page read by a vision model is a request.
|
|
376
|
+
*
|
|
377
|
+
* @default 600000
|
|
378
|
+
*/
|
|
379
|
+
extractDocumentTimeoutMs?: number;
|
|
380
|
+
/**
|
|
381
|
+
* Timeout for skills operations in milliseconds
|
|
382
|
+
* @default 15000
|
|
383
|
+
*/
|
|
384
|
+
skillsTimeoutMs?: number;
|
|
385
|
+
/**
|
|
386
|
+
* Timeout for submit_and_exit operations in milliseconds
|
|
387
|
+
* @default 15000
|
|
388
|
+
*/
|
|
389
|
+
submitTimeoutMs?: number;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Options for creating default tools
|
|
393
|
+
*/
|
|
394
|
+
export interface CreateDefaultToolsOptions extends DefaultToolsConfig {
|
|
395
|
+
/**
|
|
396
|
+
* Executor implementations for the tools
|
|
397
|
+
* Only tools with provided executors will be available
|
|
398
|
+
*/
|
|
399
|
+
executors: ToolExecutors;
|
|
400
|
+
/**
|
|
401
|
+
* Session-scoped checklist tracker. When provided, every tool gains the
|
|
402
|
+
* optional `task_progress` parameter, and results carry the checklist back
|
|
403
|
+
* to the model periodically.
|
|
404
|
+
*
|
|
405
|
+
* Absent by default: the tracker holds per-session state, so a shared or
|
|
406
|
+
* missing one is the difference between a checklist and a leak between
|
|
407
|
+
* tasks. Hosts opt in by constructing one per session.
|
|
408
|
+
*/
|
|
409
|
+
taskProgress?: TaskProgressTracker;
|
|
410
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tool that makes a short video clip.
|
|
3
|
+
*
|
|
4
|
+
* The fourth media tool, and the one that is not a single request. An image
|
|
5
|
+
* takes seconds and comes back in the response; a clip takes from most of a
|
|
6
|
+
* minute to many, so the OpenAI videos API is a job: `POST {endpoint}/videos`
|
|
7
|
+
* answers at once with an id, `GET {endpoint}/videos/{id}` says how far it
|
|
8
|
+
* is, and `GET {endpoint}/videos/{id}/content` hands over the bytes when it is
|
|
9
|
+
* done. opencoti serves exactly that (its M7.5), and keeps a finished clip for
|
|
10
|
+
* ten minutes by default, so the content is fetched the moment the job
|
|
11
|
+
* completes.
|
|
12
|
+
*
|
|
13
|
+
* A job outlives the request that made it. So a call that is stopped -- by
|
|
14
|
+
* the user, or by this tool's own limit -- deletes its job, or the engine
|
|
15
|
+
* would go on rendering a clip nobody is waiting for while the next request
|
|
16
|
+
* queues behind it.
|
|
17
|
+
*/
|
|
18
|
+
import { type AgentTool } from "@cerebriline/shared";
|
|
19
|
+
export declare const GENERATE_VIDEO_TOOL_NAME = "generate_video";
|
|
20
|
+
export declare const GENERATE_VIDEO_TOOL_DESCRIPTION = "Generate a short video clip from a text description and save it as a file in the workspace. Use it for a few seconds of footage you would otherwise have to ask the user to make elsewhere: a background loop, a product shot, a placeholder for a scene, an animated version of an image you already have.\n\nThe clip is written to a file and its path is returned. You cannot watch it, so tell the user where it is and let them judge it.\n\nArguments:\n- `prompt` \u2014 what the clip shows: the subject, what moves and how, the camera, the style. One scene; these models do not follow a storyboard.\n- `image` \u2014 optional workspace path of an image to start from. The clip animates it. Only some video models take one; the backend says so if it does not.\n- `path` \u2014 where to save the clip, relative to the workspace. Optional; defaults to a file under `.cline/generated-videos/`.\n- `size` \u2014 `WxH` in pixels, e.g. `832x480`. Optional; the backend has a default and supports only a few shapes.\n- `seconds` \u2014 the length of the clip. Optional; a few seconds is what these models make, and longer costs more than proportionally.\n- `seed` \u2014 optional integer. The same request with the same seed gives the same clip.\n\nThis is slow: a clip takes from most of a minute to many minutes, and on a hosted backend it costs money. Generate one only when the task needs it, and do not retry to \"improve\" a clip you have not been told is wrong.";
|
|
21
|
+
export declare const GENERATE_VIDEO_TOOL_INPUT_SCHEMA: {
|
|
22
|
+
readonly type: "object";
|
|
23
|
+
readonly properties: {
|
|
24
|
+
readonly prompt: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "What the clip shows: the subject, what moves and how, the camera, the style.";
|
|
27
|
+
};
|
|
28
|
+
readonly image: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly description: "Workspace path of an image to start from. Optional; only some video models take one.";
|
|
31
|
+
};
|
|
32
|
+
readonly path: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "Where to save the clip, relative to the workspace. Optional; defaults to a file under .cline/generated-videos/.";
|
|
35
|
+
};
|
|
36
|
+
readonly size: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
readonly description: "Pixel size as \"WIDTHxHEIGHT\", e.g. \"832x480\". Optional.";
|
|
39
|
+
};
|
|
40
|
+
readonly seconds: {
|
|
41
|
+
readonly type: "number";
|
|
42
|
+
readonly description: "The length of the clip in seconds. Optional.";
|
|
43
|
+
};
|
|
44
|
+
readonly seed: {
|
|
45
|
+
readonly type: "integer";
|
|
46
|
+
readonly description: "Optional. The same request with the same seed gives the same clip.";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly required: readonly ["prompt"];
|
|
50
|
+
};
|
|
51
|
+
export interface VideoGenerationEndpoint {
|
|
52
|
+
/** Base URL, with or without a trailing `/v1`. */
|
|
53
|
+
baseUrl: string;
|
|
54
|
+
model: string;
|
|
55
|
+
apiKey?: string;
|
|
56
|
+
/** Default for calls that name no size. */
|
|
57
|
+
size?: string;
|
|
58
|
+
/** Default for calls that name no length. */
|
|
59
|
+
seconds?: number;
|
|
60
|
+
/** The container to ask for, e.g. `mp4`. The engine's own when unset. */
|
|
61
|
+
format?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface GenerateVideoToolOptions {
|
|
64
|
+
cwd: string;
|
|
65
|
+
getEndpoint: () => VideoGenerationEndpoint | undefined | Promise<VideoGenerationEndpoint | undefined>;
|
|
66
|
+
readFile: (absolutePath: string) => Promise<Buffer>;
|
|
67
|
+
writeFile: (absolutePath: string, data: Buffer) => Promise<void>;
|
|
68
|
+
fetchImpl?: typeof fetch;
|
|
69
|
+
/**
|
|
70
|
+
* Milliseconds one clip may take from the request to the bytes, queueing
|
|
71
|
+
* included. Defaults to 60 minutes.
|
|
72
|
+
*/
|
|
73
|
+
timeoutMs?: number;
|
|
74
|
+
/** Milliseconds between two looks at the job. Defaults to 5 seconds. */
|
|
75
|
+
pollMs?: number;
|
|
76
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
77
|
+
onError?: (message: string, error: unknown) => void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* What the bytes are, according to the bytes, as a file extension.
|
|
81
|
+
*
|
|
82
|
+
* The engine decides the container: opencoti answers mp4 with its codec
|
|
83
|
+
* sidecar loaded and AVI without it, whatever the file was going to be called.
|
|
84
|
+
*/
|
|
85
|
+
export declare function sniffVideoExtension(data: Buffer): string | undefined;
|
|
86
|
+
/** A filename that says what the clip shows. */
|
|
87
|
+
export declare function defaultVideoPath(prompt: string, now: number): string;
|
|
88
|
+
/**
|
|
89
|
+
* Create the `generate_video` tool.
|
|
90
|
+
*
|
|
91
|
+
* Like the other media tools, the host leaves it out when nothing is
|
|
92
|
+
* configured, and `getEndpoint` returning nothing is handled anyway.
|
|
93
|
+
*/
|
|
94
|
+
export declare function createGenerateVideoTool(options: GenerateVideoToolOptions): AgentTool;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AgentHooks, BasicLogger } from "@cerebriline/shared";
|
|
2
|
+
export declare function isCheckpointStashMessage(message: string): boolean;
|
|
3
|
+
export interface CheckpointEntry {
|
|
4
|
+
ref: string;
|
|
5
|
+
createdAt: number;
|
|
6
|
+
runCount: number;
|
|
7
|
+
kind?: "stash" | "commit";
|
|
8
|
+
}
|
|
9
|
+
export interface CheckpointMetadata {
|
|
10
|
+
latest: CheckpointEntry;
|
|
11
|
+
history: CheckpointEntry[];
|
|
12
|
+
}
|
|
13
|
+
type CreateCheckpointHooksOptions = {
|
|
14
|
+
cwd: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
logger?: BasicLogger;
|
|
17
|
+
readSessionMetadata: () => Promise<Record<string, unknown> | undefined>;
|
|
18
|
+
writeSessionMetadata: (metadata: Record<string, unknown>) => Promise<void> | void;
|
|
19
|
+
/**
|
|
20
|
+
* Optional custom checkpoint implementation. When provided, the built-in
|
|
21
|
+
* git stash/ref logic is skipped entirely and this function is called
|
|
22
|
+
* instead. Return `undefined` to skip writing a checkpoint for that run.
|
|
23
|
+
*/
|
|
24
|
+
createCheckpoint?: (context: {
|
|
25
|
+
cwd: string;
|
|
26
|
+
sessionId: string;
|
|
27
|
+
runCount: number;
|
|
28
|
+
}) => Promise<CheckpointEntry | undefined> | CheckpointEntry | undefined;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Deletes all private git refs under refs/cline/checkpoints/{sessionId}/ that
|
|
32
|
+
* were created by the checkpoint system to keep stash objects reachable.
|
|
33
|
+
* Errors are swallowed - if the cwd is not a git repo or the refs don't exist,
|
|
34
|
+
* the delete is a no-op.
|
|
35
|
+
*/
|
|
36
|
+
export declare function deleteCheckpointRefs(cwd: string | null | undefined, sessionId: string): Promise<void>;
|
|
37
|
+
export declare function retainCheckpointRefs(cwd: string | null | undefined, sessionId: string, checkpoints: readonly CheckpointEntry[]): Promise<void>;
|
|
38
|
+
export declare function createCheckpointHooks(options: CreateCheckpointHooksOptions): AgentHooks;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HOOKS_CONFIG_DIRECTORY_NAME } from "@cerebriline/shared/storage";
|
|
2
|
+
import type { HookEventName } from "./subprocess";
|
|
3
|
+
export { HOOKS_CONFIG_DIRECTORY_NAME };
|
|
4
|
+
export declare function resolveHooksConfigSearchPaths(workspacePath?: string): string[];
|
|
5
|
+
export declare enum HookConfigFileName {
|
|
6
|
+
TaskStart = "TaskStart",
|
|
7
|
+
TaskResume = "TaskResume",
|
|
8
|
+
TaskCancel = "TaskCancel",
|
|
9
|
+
TaskComplete = "TaskComplete",
|
|
10
|
+
TaskError = "TaskError",
|
|
11
|
+
PreToolUse = "PreToolUse",
|
|
12
|
+
PostToolUse = "PostToolUse",
|
|
13
|
+
UserPromptSubmit = "UserPromptSubmit",
|
|
14
|
+
PreCompact = "PreCompact",
|
|
15
|
+
SessionShutdown = "SessionShutdown"
|
|
16
|
+
}
|
|
17
|
+
export declare const HOOK_CONFIG_FILE_EVENT_MAP: Readonly<Record<HookConfigFileName, HookEventName | undefined>>;
|
|
18
|
+
export declare function toHookConfigFileName(fileName: string): HookConfigFileName | undefined;
|
|
19
|
+
export interface HookConfigFileEntry {
|
|
20
|
+
fileName: HookConfigFileName;
|
|
21
|
+
hookEventName?: HookEventName;
|
|
22
|
+
path: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function listHookConfigFiles(workspacePath?: string): HookConfigFileEntry[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AgentExtension, AgentHooks, BasicLogger, WorkspaceInfo } from "@cerebriline/shared";
|
|
2
|
+
type HookRuntimeOptions = {
|
|
3
|
+
cwd: string;
|
|
4
|
+
workspacePath: string;
|
|
5
|
+
rootSessionId?: string;
|
|
6
|
+
logger?: BasicLogger;
|
|
7
|
+
toolCallTimeoutMs?: number;
|
|
8
|
+
/** Keep asynchronous hooks attached until exit. Intended for deterministic tests. */
|
|
9
|
+
detachAsyncHooks?: boolean;
|
|
10
|
+
/** Structured git + path metadata forwarded into every hook payload. */
|
|
11
|
+
workspaceInfo?: WorkspaceInfo;
|
|
12
|
+
};
|
|
13
|
+
export declare function getWindowsPythonFallbackCommand(command: string[], platform?: NodeJS.Platform, error?: unknown): string[] | undefined;
|
|
14
|
+
export declare function createHookAuditHooks(options: {
|
|
15
|
+
rootSessionId?: string;
|
|
16
|
+
workspacePath: string;
|
|
17
|
+
workspaceInfo?: WorkspaceInfo;
|
|
18
|
+
}): AgentHooks;
|
|
19
|
+
export declare function createHookConfigFileHooks(options: HookRuntimeOptions): AgentHooks | undefined;
|
|
20
|
+
export declare function createHookConfigFileExtension(options: HookRuntimeOptions): AgentExtension | undefined;
|
|
21
|
+
export declare function mergeAgentHooks(layers: Array<AgentHooks | undefined>): AgentHooks | undefined;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createAgentHooksExtension } from "./hook-extension";
|
|
2
|
+
export { HOOK_CONFIG_FILE_EVENT_MAP, HOOKS_CONFIG_DIRECTORY_NAME, type HookConfigFileEntry, HookConfigFileName, listHookConfigFiles, resolveHooksConfigSearchPaths, toHookConfigFileName, } from "./hook-file-config";
|
|
3
|
+
export { createHookAuditHooks, createHookConfigFileExtension, createHookConfigFileHooks, mergeAgentHooks, } from "./hook-file-hooks";
|
|
4
|
+
export { createSubprocessHooks, type HookEventName, HookEventNameSchema, type HookEventPayload, HookEventPayloadSchema, parseHookEventPayload, type RunHookOptions, type RunHookResult, runHook, type SubprocessHookControl, type SubprocessHooksOptions, } from "./subprocess";
|
|
5
|
+
export { type RunSubprocessEventOptions, type RunSubprocessEventResult, runSubprocessEvent, } from "./subprocess-runner";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface RunSubprocessEventOptions {
|
|
2
|
+
command: string[];
|
|
3
|
+
cwd?: string;
|
|
4
|
+
env?: NodeJS.ProcessEnv;
|
|
5
|
+
detached?: boolean;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
onSpawn?: (event: {
|
|
8
|
+
command: string[];
|
|
9
|
+
pid?: number;
|
|
10
|
+
detached: boolean;
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface RunSubprocessEventResult {
|
|
14
|
+
exitCode: number | null;
|
|
15
|
+
stdout: string;
|
|
16
|
+
stderr: string;
|
|
17
|
+
parsedJson?: unknown;
|
|
18
|
+
parseError?: string;
|
|
19
|
+
timedOut?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function runSubprocessEvent(payload: unknown, options: RunSubprocessEventOptions): Promise<RunSubprocessEventResult | undefined>;
|