@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,128 @@
|
|
|
1
|
+
import { type AgentTool } from "@cerebriline/shared";
|
|
2
|
+
/**
|
|
3
|
+
* A tool that answers "what is here?".
|
|
4
|
+
*
|
|
5
|
+
* There was no such tool. The model had `read_files`, `search_codebase`,
|
|
6
|
+
* `editor`, `ask_lsp`, `check_file` and `browser` — everything for working
|
|
7
|
+
* on a file it could already name, and nothing for finding out what files
|
|
8
|
+
* exist. So it shelled out. Measured on a live session, the only two shell
|
|
9
|
+
* commands in the whole run were:
|
|
10
|
+
*
|
|
11
|
+
* run_commands {"commands": ["dir /s manic_miner.html"]}
|
|
12
|
+
* run_commands {"commands": ["ls"]}
|
|
13
|
+
*
|
|
14
|
+
* A recursive scan from whatever directory the shell happened to start in,
|
|
15
|
+
* then a bare listing of it — the reflex of a model that has been given no
|
|
16
|
+
* other way to look around, in a session that otherwise never touched a shell.
|
|
17
|
+
*
|
|
18
|
+
* Doing it through the shell is worse than doing it here in three ways. It is
|
|
19
|
+
* unbounded: `dir /s` from the wrong root walks the entire drive. It is
|
|
20
|
+
* unscoped: the shell's working directory is not the workspace, so the results
|
|
21
|
+
* can name files the user never opened and the model was never meant to touch.
|
|
22
|
+
* And it is inconsistent: `ls`, `dir`, `Get-ChildItem` and `find` all format
|
|
23
|
+
* differently, so the model has to parse whatever the host's shell produced.
|
|
24
|
+
*
|
|
25
|
+
* So the host is asked instead, through `WorkspaceLister`. VS Code's answers
|
|
26
|
+
* from `workspace.findFiles`, which searches the folders the user opened and
|
|
27
|
+
* nothing else and honours the `files.exclude` and `search.exclude` they have
|
|
28
|
+
* already set — so `node_modules` and `.git` stay out without anyone naming
|
|
29
|
+
* them. `createLocalWorkspaceLister` below answers the same questions from the
|
|
30
|
+
* filesystem, for a host with no editor behind it. The containment check
|
|
31
|
+
* extends the same guarantee to a plain directory listing whichever lister is
|
|
32
|
+
* in use. The boundary is enforced here rather than requested in a prompt,
|
|
33
|
+
* which is the difference between a rule and a suggestion.
|
|
34
|
+
*
|
|
35
|
+
* The tool lives in core rather than in the extension because the reflex it
|
|
36
|
+
* displaces is not VS Code's. A CLI run has the same six tools for working on
|
|
37
|
+
* a file it can already name and the same nothing for finding out what exists,
|
|
38
|
+
* and it reaches for `ls` for exactly the same reason.
|
|
39
|
+
*/
|
|
40
|
+
export declare const LIST_FILES_TOOL_NAME = "list_files";
|
|
41
|
+
export declare const LIST_FILES_TOOL_DESCRIPTION = "List the files in the workspace. Use this to find out what exists \u2014 do not run `ls`, `dir`, `find` or `Get-ChildItem` through `run_commands` to look around, because this is scoped to the workspace and those are not.\n\nTwo ways to ask:\n- `path` \u2014 list what is directly inside one directory. Omit it to list the workspace root.\n- `pattern` \u2014 a glob searched across the whole workspace, e.g. `**/*.html`, `src/**/*.ts`, `**/manic_miner.*`. Use this when you know part of a name but not where it lives.\n\nResults are limited to the workspace folders the user opened, and directories the user's settings exclude from search \u2014 `node_modules`, `.git`, build output \u2014 are left out. A path outside the workspace is refused rather than listed.\n\nThis tells you which files exist, not what is in them. To find files by their contents use `search_codebase`, which reports the line each match is on and is the right way to locate the part of a file worth reading.";
|
|
42
|
+
export declare const LIST_FILES_TOOL_INPUT_SCHEMA: {
|
|
43
|
+
readonly type: "object";
|
|
44
|
+
readonly properties: {
|
|
45
|
+
readonly path: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly description: "Directory to list. Absolute, or relative to the workspace root. Defaults to the workspace root.";
|
|
48
|
+
};
|
|
49
|
+
readonly pattern: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly description: "Glob searched across the workspace, e.g. `**/*.html`. Given this, `path` is ignored.";
|
|
52
|
+
};
|
|
53
|
+
readonly max_results: {
|
|
54
|
+
readonly type: "number";
|
|
55
|
+
readonly description: "Most entries to return. Default 200, maximum 1000.";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly required: readonly [];
|
|
59
|
+
};
|
|
60
|
+
export interface DirectoryEntry {
|
|
61
|
+
name: string;
|
|
62
|
+
kind: "file" | "directory";
|
|
63
|
+
/** Bytes, when the host could say cheaply. */
|
|
64
|
+
size?: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The workspace operations this tool needs.
|
|
68
|
+
*
|
|
69
|
+
* Structural, like `BrowserDriver`: a unit test should be able to check how a
|
|
70
|
+
* listing is rendered and where the boundary is drawn without standing up the
|
|
71
|
+
* VS Code API.
|
|
72
|
+
*/
|
|
73
|
+
export interface WorkspaceLister {
|
|
74
|
+
/** Absolute paths of the folders the user opened. Empty when there are none. */
|
|
75
|
+
roots(): string[];
|
|
76
|
+
readDirectory(absolutePath: string): Promise<DirectoryEntry[]>;
|
|
77
|
+
/** Absolute paths matching a glob, already filtered by the user's excludes. */
|
|
78
|
+
findFiles(pattern: string, maxResults: number): Promise<string[]>;
|
|
79
|
+
}
|
|
80
|
+
export interface ListFilesToolOptions {
|
|
81
|
+
cwd: string;
|
|
82
|
+
createLister: () => WorkspaceLister | Promise<WorkspaceLister>;
|
|
83
|
+
/**
|
|
84
|
+
* Files read this session, so a fruitless workspace search can say what it
|
|
85
|
+
* could not have covered instead of asserting the file does not exist.
|
|
86
|
+
*/
|
|
87
|
+
getReadPaths?: () => string[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Whether `candidate` is inside `root`, as this platform judges paths.
|
|
91
|
+
*
|
|
92
|
+
* Compared segment-wise rather than by prefix: `/repo/testing` starts with the
|
|
93
|
+
* string `/repo/test` without being inside it.
|
|
94
|
+
*/
|
|
95
|
+
export declare function isWithin(root: string, candidate: string): boolean;
|
|
96
|
+
/** Clamp a caller-supplied limit into something a conversation can hold. */
|
|
97
|
+
export declare function normalizeMaxResults(value: unknown): number;
|
|
98
|
+
/**
|
|
99
|
+
* Render one directory's contents.
|
|
100
|
+
*
|
|
101
|
+
* Directories first and marked with a trailing separator, because the next
|
|
102
|
+
* question is almost always "which of these do I descend into".
|
|
103
|
+
*/
|
|
104
|
+
export declare function renderDirectory(displayPath: string, entries: DirectoryEntry[], limit: number): string;
|
|
105
|
+
/** Render a glob search, as paths relative to the root they were found under. */
|
|
106
|
+
export declare function renderMatches(pattern: string, absolutePaths: string[], roots: string[], limit: number, readPaths?: string[]): string;
|
|
107
|
+
/**
|
|
108
|
+
* Translate a glob into a regular expression over slash-separated paths.
|
|
109
|
+
*
|
|
110
|
+
* Supports what the description promises and what a model actually writes: a
|
|
111
|
+
* double star across directories, a single star and `?` within one segment,
|
|
112
|
+
* `{a,b}` alternation and `[...]` classes.
|
|
113
|
+
*
|
|
114
|
+
* A double star followed by a slash matches no directories as readily as many,
|
|
115
|
+
* so a pattern that opens with one finds a file sitting at the root too. A
|
|
116
|
+
* model writing it means "anywhere", and the root is anywhere.
|
|
117
|
+
*/
|
|
118
|
+
export declare function globToRegExp(pattern: string): RegExp;
|
|
119
|
+
/**
|
|
120
|
+
* A lister backed by the filesystem, for a host with no editor to ask.
|
|
121
|
+
*
|
|
122
|
+
* One root, because that is what a host without a workspace concept has: the
|
|
123
|
+
* directory the run was started in. Everything the tool guarantees — the
|
|
124
|
+
* containment check, the result cap, the excludes — is the same either way,
|
|
125
|
+
* which is the point of the interface.
|
|
126
|
+
*/
|
|
127
|
+
export declare function createLocalWorkspaceLister(root: string): WorkspaceLister;
|
|
128
|
+
export declare function createListFilesTool(options: ListFilesToolOptions): AgentTool;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a media tool sends its request, and whether it should exist at all.
|
|
3
|
+
*
|
|
4
|
+
* `generate_image` had its own answer to this -- a typed URL, a typed model --
|
|
5
|
+
* and four more tools need one: image edits, transcription, speech and video.
|
|
6
|
+
* They share everything but the route: the same OpenAI-shaped servers, the same
|
|
7
|
+
* question of what a server serves, the same `503` while an engine is busy.
|
|
8
|
+
*
|
|
9
|
+
* Three kinds of server answer these routes, and they say different amounts:
|
|
10
|
+
* - **opencoti** names what is loaded in `features` on `/props`
|
|
11
|
+
* (`images_generate_v1`, `images_edit_v1`, `audio_transcriptions_v1`,
|
|
12
|
+
* `audio_speech_v1`, `videos_generate_v1`), and its `/v1/models` rows carry
|
|
13
|
+
* `capabilities`. One process can serve the LLM and every media kind.
|
|
14
|
+
* - **xOllama** answers `/api/xollama`, and its `/v1/models` rows carry
|
|
15
|
+
* `input_modalities` / `output_modalities` for models with media.
|
|
16
|
+
* - anything else that lists `/v1/models` says nothing, and nothing is not
|
|
17
|
+
* "no": such a server is taken to serve whatever it is asked for.
|
|
18
|
+
*
|
|
19
|
+
* The owner's rule for which endpoint a tool uses (2026-10-02):
|
|
20
|
+
* 1. with the "use the configured provider" flag on, the session's own
|
|
21
|
+
* opencoti or xOllama provider, when it serves this kind;
|
|
22
|
+
* 2. otherwise the typed URL;
|
|
23
|
+
* 3. a typed URL that is empty, or names no model, means the tool is not
|
|
24
|
+
* offered.
|
|
25
|
+
*
|
|
26
|
+
* A typed endpoint that does not answer is still offered (owner, 2026-10-02):
|
|
27
|
+
* these servers may be started on request, and a tool left out at session
|
|
28
|
+
* start stays out for the whole session. The tab's own switch is how a user
|
|
29
|
+
* says they do not want the tool. What the probe found is a warning, not a
|
|
30
|
+
* gate.
|
|
31
|
+
*/
|
|
32
|
+
export type MediaKind = "image_generation" | "image_edit" | "transcription" | "speech" | "video";
|
|
33
|
+
export declare const MEDIA_KINDS: readonly MediaKind[];
|
|
34
|
+
export type MediaServer = "opencoti" | "xollama" | "openai";
|
|
35
|
+
export interface MediaEndpoint {
|
|
36
|
+
/** Base URL, with or without a trailing `/v1`. */
|
|
37
|
+
baseUrl: string;
|
|
38
|
+
model: string;
|
|
39
|
+
apiKey?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface MediaModel {
|
|
42
|
+
id: string;
|
|
43
|
+
/** What the server says this model serves. Absent when it says nothing. */
|
|
44
|
+
kinds?: MediaKind[];
|
|
45
|
+
/**
|
|
46
|
+
* The kinds this model is the server's default for: xOllama's
|
|
47
|
+
* `default_for`, set by whoever runs the server. Only ever kinds it serves.
|
|
48
|
+
*/
|
|
49
|
+
defaultFor?: MediaKind[];
|
|
50
|
+
}
|
|
51
|
+
export interface MediaEndpointProbe {
|
|
52
|
+
server: MediaServer;
|
|
53
|
+
/**
|
|
54
|
+
* `true` served, `false` the server says it is not, absent unknown. Only
|
|
55
|
+
* opencoti and xOllama ever say `false`.
|
|
56
|
+
*/
|
|
57
|
+
kinds: Partial<Record<MediaKind, boolean>>;
|
|
58
|
+
models: MediaModel[];
|
|
59
|
+
}
|
|
60
|
+
/** `.../v1`, whether or not the user typed it. */
|
|
61
|
+
export declare function normalizeBaseUrl(baseUrl: string): string;
|
|
62
|
+
/** The server's root, under which `/props` and `/api/xollama` live. */
|
|
63
|
+
export declare function mediaServerOrigin(baseUrl: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* What one `/v1/models` row says it serves, or nothing when it says nothing.
|
|
66
|
+
*
|
|
67
|
+
* Capabilities are exact and win. Modalities are xOllama's listing and need
|
|
68
|
+
* reading: an edit model takes an image and returns one, a transcription model
|
|
69
|
+
* takes audio and returns text.
|
|
70
|
+
*/
|
|
71
|
+
export declare function mediaKindsOfModelRow(row: unknown): MediaKind[] | undefined;
|
|
72
|
+
export interface MediaProbeOptions {
|
|
73
|
+
apiKey?: string;
|
|
74
|
+
fetchImpl?: typeof fetch;
|
|
75
|
+
signal?: AbortSignal;
|
|
76
|
+
/** Milliseconds each of the three reads may take. Defaults to 5 seconds. */
|
|
77
|
+
timeoutMs?: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* What answers at `baseUrl` and what it serves, or nothing when nothing does.
|
|
81
|
+
*
|
|
82
|
+
* Three reads at once rather than one after another: the picker waits on this,
|
|
83
|
+
* and two of the three are 404s on any given server.
|
|
84
|
+
*/
|
|
85
|
+
export declare function probeMediaEndpoint(baseUrl: string, options?: MediaProbeOptions): Promise<MediaEndpointProbe | undefined>;
|
|
86
|
+
/**
|
|
87
|
+
* The models to offer in a picker for one kind: those the server says serve
|
|
88
|
+
* it, and those it says nothing about.
|
|
89
|
+
*/
|
|
90
|
+
export declare function listMediaModels(probe: MediaEndpointProbe, kind: MediaKind): string[];
|
|
91
|
+
/** The session's own provider, as far as a media tool cares. */
|
|
92
|
+
export interface MediaSessionProvider {
|
|
93
|
+
providerId: string;
|
|
94
|
+
baseUrl?: string;
|
|
95
|
+
apiKey?: string;
|
|
96
|
+
modelId?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface ResolveMediaEndpointInput {
|
|
99
|
+
kind: MediaKind;
|
|
100
|
+
/** The tab's "use the configured opencoti or xOllama provider" flag. */
|
|
101
|
+
useProvider: boolean;
|
|
102
|
+
provider?: MediaSessionProvider;
|
|
103
|
+
/** What the tab holds: the typed URL, and the model named for this kind. */
|
|
104
|
+
typed?: {
|
|
105
|
+
baseUrl?: string;
|
|
106
|
+
model?: string;
|
|
107
|
+
apiKey?: string;
|
|
108
|
+
};
|
|
109
|
+
probe: (baseUrl: string, apiKey: string | undefined) => Promise<MediaEndpointProbe | undefined>;
|
|
110
|
+
}
|
|
111
|
+
export type ResolvedMediaEndpoint = {
|
|
112
|
+
endpoint: MediaEndpoint;
|
|
113
|
+
source: "provider" | "typed";
|
|
114
|
+
/** `unknown` is a typed endpoint that did not answer the probe. */
|
|
115
|
+
server: MediaServer | "unknown";
|
|
116
|
+
/** Why a call may fail right now. The tool is offered all the same. */
|
|
117
|
+
warning?: string;
|
|
118
|
+
} | {
|
|
119
|
+
disabled: string;
|
|
120
|
+
};
|
|
121
|
+
export declare function resolveMediaEndpoint(input: ResolveMediaEndpointInput): Promise<ResolvedMediaEndpoint>;
|
|
122
|
+
/** `Retry-After` in milliseconds: seconds or a date, bounded, 5 s by default. */
|
|
123
|
+
export declare function retryAfterMs(header: string | null, now?: number): number;
|
|
124
|
+
export interface MediaRequestOptions {
|
|
125
|
+
fetchImpl?: typeof fetch;
|
|
126
|
+
/** The caller's cancellation. The only thing that ends the waiting. */
|
|
127
|
+
signal?: AbortSignal;
|
|
128
|
+
/**
|
|
129
|
+
* Milliseconds one attempt may take. Waiting on a busy engine is not
|
|
130
|
+
* counted: the limit is on the work, not on the queue in front of it.
|
|
131
|
+
*/
|
|
132
|
+
attemptTimeoutMs?: number;
|
|
133
|
+
/**
|
|
134
|
+
* How long to keep asking a busy engine, 30 minutes by default. xOllama
|
|
135
|
+
* answers `503` only once 16 requests wait or one has waited 10 minutes, so
|
|
136
|
+
* this is several full queues; past it the `503` is handed back, and the
|
|
137
|
+
* tool says the engine is still busy rather than that it failed.
|
|
138
|
+
*/
|
|
139
|
+
maxBusyMs?: number;
|
|
140
|
+
/** Told each time the engine was busy, before the wait. */
|
|
141
|
+
onBusy?: (waitMs: number, attempt: number) => void;
|
|
142
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
143
|
+
}
|
|
144
|
+
/** An attempt ran past `attemptTimeoutMs`. */
|
|
145
|
+
export declare class MediaRequestTimeoutError extends Error {
|
|
146
|
+
readonly timeoutMs: number;
|
|
147
|
+
constructor(timeoutMs: number);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* One media request, waited out while the engine is busy.
|
|
151
|
+
*
|
|
152
|
+
* opencoti and xOllama run one request per engine and answer `503` with
|
|
153
|
+
* `Retry-After` to the rest. That is the server saying when to come back, not
|
|
154
|
+
* a failure, so it is not handed to the model as one: the request is sent
|
|
155
|
+
* again until it is taken, the caller stops, or `maxBusyMs` of waiting has
|
|
156
|
+
* passed. Nothing else is retried: a `400` is a model that does not do this, a
|
|
157
|
+
* `404` no such model, a `500` an engine that failed to start. `init` is a function because a
|
|
158
|
+
* multipart body is spent by the attempt that sent it.
|
|
159
|
+
*/
|
|
160
|
+
export declare function sendMediaRequest(url: string, init: () => RequestInit, options?: MediaRequestOptions): Promise<Response>;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The media tools as one set, built from one configuration.
|
|
3
|
+
*
|
|
4
|
+
* Five tools -- `generate_image`, `edit_image`, `transcribe_audio`,
|
|
5
|
+
* `synthesize_speech`, `generate_video` -- share one rule for where a request
|
|
6
|
+
* goes (see `media-endpoint.ts`), and two hosts offer them: the extension from
|
|
7
|
+
* its settings tabs and the CLI from a file. If each host wrote its own
|
|
8
|
+
* "which tools, pointed where", the two would drift the first time one of them
|
|
9
|
+
* changed. So the hosts differ only in how they *read* a `MediaToolsConfig`;
|
|
10
|
+
* which tools that makes, and where each one goes, is decided here.
|
|
11
|
+
*
|
|
12
|
+
* A section that is absent is a tool that is not wanted: it is the host's
|
|
13
|
+
* "use an endpoint for ..." switch. A section that is present is offered as
|
|
14
|
+
* soon as it names somewhere to go, whether or not that server answers now.
|
|
15
|
+
*/
|
|
16
|
+
import type { AgentTool } from "@cerebriline/shared";
|
|
17
|
+
import { type SpeechEndpoint, type TranscriptionEndpoint } from "./audio-tools";
|
|
18
|
+
import { type ImageGenerationEndpoint } from "./image-generation";
|
|
19
|
+
import { type MediaEndpointProbe, type MediaSessionProvider, type ResolvedMediaEndpoint } from "./media-endpoint";
|
|
20
|
+
import { type VideoGenerationEndpoint } from "./video-generation";
|
|
21
|
+
/** What every media section holds. */
|
|
22
|
+
export interface MediaSectionSettings {
|
|
23
|
+
/** Use the session's own opencoti or xOllama when it serves this. */
|
|
24
|
+
useProvider?: boolean;
|
|
25
|
+
/** Where requests go otherwise. */
|
|
26
|
+
baseUrl?: string;
|
|
27
|
+
model?: string;
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface MediaToolsConfig {
|
|
31
|
+
/** `generate_image`, and `edit_image` unless `edit` is `false`. */
|
|
32
|
+
image?: MediaSectionSettings & {
|
|
33
|
+
/** Default size, as `WIDTHxHEIGHT`. */
|
|
34
|
+
size?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Edits go where generation goes unless this names another endpoint or
|
|
37
|
+
* model. `false` keeps `generate_image` without `edit_image`.
|
|
38
|
+
*/
|
|
39
|
+
edit?: false | {
|
|
40
|
+
baseUrl?: string;
|
|
41
|
+
model?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/** `transcribe_audio`. */
|
|
45
|
+
transcription?: MediaSectionSettings;
|
|
46
|
+
/** `synthesize_speech`. */
|
|
47
|
+
speech?: MediaSectionSettings & {
|
|
48
|
+
voice?: string;
|
|
49
|
+
format?: string;
|
|
50
|
+
};
|
|
51
|
+
/** `generate_video`. */
|
|
52
|
+
video?: MediaSectionSettings & {
|
|
53
|
+
size?: string;
|
|
54
|
+
seconds?: number;
|
|
55
|
+
format?: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export declare const MEDIA_TOOL_NAMES: readonly ["generate_image", "edit_image", "transcribe_audio", "synthesize_speech", "generate_video"];
|
|
59
|
+
export type MediaToolName = (typeof MEDIA_TOOL_NAMES)[number];
|
|
60
|
+
interface MediaToolEndpoints {
|
|
61
|
+
generate_image: ImageGenerationEndpoint;
|
|
62
|
+
edit_image: ImageGenerationEndpoint;
|
|
63
|
+
transcribe_audio: TranscriptionEndpoint;
|
|
64
|
+
synthesize_speech: SpeechEndpoint;
|
|
65
|
+
generate_video: VideoGenerationEndpoint;
|
|
66
|
+
}
|
|
67
|
+
export type ResolvedMediaTool<T extends MediaToolName = MediaToolName> = (Omit<Exclude<ResolvedMediaEndpoint, {
|
|
68
|
+
disabled: string;
|
|
69
|
+
}>, "endpoint"> & {
|
|
70
|
+
endpoint: MediaToolEndpoints[T];
|
|
71
|
+
}) | {
|
|
72
|
+
disabled: string;
|
|
73
|
+
};
|
|
74
|
+
export type MediaProbe = (baseUrl: string, apiKey: string | undefined) => Promise<MediaEndpointProbe | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* One probe per server for half a minute. Five tools resolve at session start,
|
|
77
|
+
* and on an opencoti serving everything they all ask the same three routes.
|
|
78
|
+
*/
|
|
79
|
+
export declare function createMediaProbeCache(options?: {
|
|
80
|
+
fetchImpl?: typeof fetch;
|
|
81
|
+
now?: () => number;
|
|
82
|
+
}): MediaProbe;
|
|
83
|
+
/**
|
|
84
|
+
* Where one media tool goes, or why it is not offered.
|
|
85
|
+
*
|
|
86
|
+
* The endpoint carries the section's defaults (size, voice, format, length),
|
|
87
|
+
* so what comes back is what the tool's `getEndpoint` returns.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveMediaTool<T extends MediaToolName>(tool: T, config: MediaToolsConfig, provider: MediaSessionProvider | undefined, probe: MediaProbe): Promise<ResolvedMediaTool<T>>;
|
|
90
|
+
export interface CreateMediaToolsOptions {
|
|
91
|
+
cwd: string;
|
|
92
|
+
/**
|
|
93
|
+
* Read again on every call as well as at session start: a settings tab can
|
|
94
|
+
* change mid-session, and the probe behind the resolution is cached.
|
|
95
|
+
*/
|
|
96
|
+
getConfig: () => MediaToolsConfig;
|
|
97
|
+
/** The provider the session runs on, for the sections that may use it. */
|
|
98
|
+
provider?: MediaSessionProvider;
|
|
99
|
+
probe?: MediaProbe;
|
|
100
|
+
readFile: (absolutePath: string) => Promise<Buffer>;
|
|
101
|
+
/** Must create the directory: the default paths are under `.cline/`. */
|
|
102
|
+
writeFile: (absolutePath: string, data: Buffer) => Promise<void>;
|
|
103
|
+
fetchImpl?: typeof fetch;
|
|
104
|
+
onError?: (message: string, error: unknown) => void;
|
|
105
|
+
/** One line per tool: where it goes, or why it was left out. */
|
|
106
|
+
log?: (message: string) => void;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The media tools this configuration offers, each pointed where it resolves.
|
|
110
|
+
*
|
|
111
|
+
* A tool is left out only when its section is absent or names nowhere to go.
|
|
112
|
+
* An endpoint that is down, or says it lacks the kind, is offered with a
|
|
113
|
+
* warning in the log: these servers are started on request.
|
|
114
|
+
*/
|
|
115
|
+
export declare function createMediaTools(options: CreateMediaToolsOptions): Promise<AgentTool[]>;
|
|
116
|
+
/**
|
|
117
|
+
* A `MediaToolsConfig` from a JSON document, for a host with no settings tabs.
|
|
118
|
+
*
|
|
119
|
+
* ```json
|
|
120
|
+
* {
|
|
121
|
+
* "useProvider": true,
|
|
122
|
+
* "baseUrl": "http://127.0.0.1:8080",
|
|
123
|
+
* "image": { "model": "flux2-klein", "size": "1024x1024" },
|
|
124
|
+
* "transcription": true,
|
|
125
|
+
* "speech": { "voice": "alloy" },
|
|
126
|
+
* "video": { "baseUrl": "http://other:8090", "model": "wan2.1" }
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* The top-level `useProvider`, `baseUrl` and `apiKey` are what each section
|
|
131
|
+
* starts from, since one server usually serves them all; a section overrides
|
|
132
|
+
* them. A section is on when it is an object or `true`. `all: true` switches
|
|
133
|
+
* every section on that the document does not mention -- the "use whatever the
|
|
134
|
+
* session's provider serves" setting.
|
|
135
|
+
*/
|
|
136
|
+
export declare function parseMediaToolsConfig(raw: unknown, options?: {
|
|
137
|
+
all?: boolean;
|
|
138
|
+
useProvider?: boolean;
|
|
139
|
+
}): MediaToolsConfig;
|
|
140
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CoreAgentMode } from "../../types/config";
|
|
2
|
+
import type { DefaultToolName, DefaultToolsConfig } from "./types";
|
|
3
|
+
export interface ToolRoutingRule {
|
|
4
|
+
/**
|
|
5
|
+
* Optional rule label for debugging and logs.
|
|
6
|
+
*/
|
|
7
|
+
name?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Which mode the rule applies to.
|
|
10
|
+
* @default "any"
|
|
11
|
+
*/
|
|
12
|
+
mode?: CoreAgentMode | "any";
|
|
13
|
+
/**
|
|
14
|
+
* Case-insensitive substrings that must match the model ID.
|
|
15
|
+
* When omitted/empty, the rule is not constrained by model ID.
|
|
16
|
+
*/
|
|
17
|
+
modelIdIncludes?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Case-insensitive substrings that must match the provider ID.
|
|
20
|
+
* When omitted/empty, the rule is not constrained by provider ID.
|
|
21
|
+
*/
|
|
22
|
+
providerIdIncludes?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Enable these tools when the rule matches.
|
|
25
|
+
*/
|
|
26
|
+
enableTools?: DefaultToolName[];
|
|
27
|
+
/**
|
|
28
|
+
* Disable these tools when the rule matches.
|
|
29
|
+
*/
|
|
30
|
+
disableTools?: DefaultToolName[];
|
|
31
|
+
}
|
|
32
|
+
export declare const DEFAULT_MODEL_TOOL_ROUTING_RULES: ToolRoutingRule[];
|
|
33
|
+
export declare function resolveToolRoutingConfig(providerId: string, modelId: string, mode: CoreAgentMode, rules: ToolRoutingRule[] | undefined): Partial<DefaultToolsConfig>;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentTool Presets
|
|
3
|
+
*
|
|
4
|
+
* Pre-configured tool combinations for common use cases.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentMode, AgentTool, ToolPolicy } from "@cerebriline/shared";
|
|
7
|
+
import type { CreateDefaultToolsOptions, DefaultToolsConfig } from "./types";
|
|
8
|
+
export interface ToolPresetConfig extends DefaultToolsConfig {
|
|
9
|
+
enableSpawnAgent?: boolean;
|
|
10
|
+
enableAgentTeams?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Preset configurations for common use cases
|
|
14
|
+
*/
|
|
15
|
+
export declare const ToolPresets: {
|
|
16
|
+
/**
|
|
17
|
+
* Act mode (full development tools)
|
|
18
|
+
* Good for coding assistants and task automation
|
|
19
|
+
*/
|
|
20
|
+
readonly act: {
|
|
21
|
+
readonly enableReadFiles: true;
|
|
22
|
+
readonly enableSearch: true;
|
|
23
|
+
readonly enableBash: true;
|
|
24
|
+
readonly enableWebFetch: true;
|
|
25
|
+
readonly enableApplyPatch: false;
|
|
26
|
+
readonly enableEditor: true;
|
|
27
|
+
readonly enableGrep: true;
|
|
28
|
+
readonly enableSed: true;
|
|
29
|
+
readonly enableAwk: true;
|
|
30
|
+
readonly enableExtractDocument: true;
|
|
31
|
+
readonly enableSkills: true;
|
|
32
|
+
readonly enableAskQuestion: true;
|
|
33
|
+
readonly enableSubmitAndExit: false;
|
|
34
|
+
readonly enableSpawnAgent: true;
|
|
35
|
+
readonly enableAgentTeams: true;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Plan mode (read-only)
|
|
39
|
+
* Good for analysis and documentation agents. Shell access stays enabled
|
|
40
|
+
* for read-only investigation; file-editing commands are hard-blocked by
|
|
41
|
+
* the plan-mode command-guard hook the runtime builder registers.
|
|
42
|
+
*/
|
|
43
|
+
readonly plan: {
|
|
44
|
+
readonly enableReadFiles: true;
|
|
45
|
+
readonly enableSearch: true;
|
|
46
|
+
readonly enableBash: true;
|
|
47
|
+
readonly enableWebFetch: true;
|
|
48
|
+
readonly enableApplyPatch: false;
|
|
49
|
+
readonly enableEditor: false;
|
|
50
|
+
readonly enableGrep: true;
|
|
51
|
+
readonly enableSed: true;
|
|
52
|
+
readonly enableAwk: true;
|
|
53
|
+
readonly enableExtractDocument: true;
|
|
54
|
+
readonly enableSkills: true;
|
|
55
|
+
readonly enableAskQuestion: true;
|
|
56
|
+
readonly enableSubmitAndExit: false;
|
|
57
|
+
readonly enableSpawnAgent: true;
|
|
58
|
+
readonly enableAgentTeams: true;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Search-focused tools (read_files + search_codebase)
|
|
62
|
+
* Good for code exploration and analysis agents
|
|
63
|
+
*/
|
|
64
|
+
readonly search: {
|
|
65
|
+
readonly enableReadFiles: true;
|
|
66
|
+
readonly enableSearch: true;
|
|
67
|
+
readonly enableBash: false;
|
|
68
|
+
readonly enableWebFetch: false;
|
|
69
|
+
readonly enableApplyPatch: false;
|
|
70
|
+
readonly enableEditor: false;
|
|
71
|
+
readonly enableGrep: true;
|
|
72
|
+
readonly enableSed: false;
|
|
73
|
+
readonly enableAwk: true;
|
|
74
|
+
readonly enableExtractDocument: true;
|
|
75
|
+
readonly enableSkills: false;
|
|
76
|
+
readonly enableAskQuestion: false;
|
|
77
|
+
readonly enableSubmitAndExit: false;
|
|
78
|
+
readonly enableSpawnAgent: true;
|
|
79
|
+
readonly enableAgentTeams: true;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Minimal tools for focused tasks
|
|
83
|
+
*/
|
|
84
|
+
readonly minimal: {
|
|
85
|
+
readonly enableReadFiles: false;
|
|
86
|
+
readonly enableSearch: false;
|
|
87
|
+
readonly enableBash: true;
|
|
88
|
+
readonly enableWebFetch: false;
|
|
89
|
+
readonly enableApplyPatch: false;
|
|
90
|
+
readonly enableEditor: false;
|
|
91
|
+
readonly enableGrep: false;
|
|
92
|
+
readonly enableSed: false;
|
|
93
|
+
readonly enableAwk: false;
|
|
94
|
+
readonly enableExtractDocument: false;
|
|
95
|
+
readonly enableSkills: false;
|
|
96
|
+
readonly enableAskQuestion: false;
|
|
97
|
+
readonly enableSubmitAndExit: false;
|
|
98
|
+
readonly enableSpawnAgent: true;
|
|
99
|
+
readonly enableAgentTeams: false;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* YOLO mode (automation-focused tools + no approval required)
|
|
103
|
+
* Good for trusted local automation workflows.
|
|
104
|
+
*/
|
|
105
|
+
readonly yolo: {
|
|
106
|
+
readonly enableReadFiles: true;
|
|
107
|
+
readonly enableSearch: false;
|
|
108
|
+
readonly enableBash: true;
|
|
109
|
+
readonly enableWebFetch: false;
|
|
110
|
+
readonly enableApplyPatch: false;
|
|
111
|
+
readonly enableEditor: true;
|
|
112
|
+
readonly enableGrep: true;
|
|
113
|
+
readonly enableSed: true;
|
|
114
|
+
readonly enableAwk: true;
|
|
115
|
+
readonly enableExtractDocument: true;
|
|
116
|
+
readonly enableSkills: false;
|
|
117
|
+
readonly enableAskQuestion: false;
|
|
118
|
+
readonly enableSubmitAndExit: true;
|
|
119
|
+
readonly enableSpawnAgent: false;
|
|
120
|
+
readonly enableAgentTeams: false;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Type for preset names
|
|
125
|
+
*/
|
|
126
|
+
export type ToolPresetName = keyof typeof ToolPresets;
|
|
127
|
+
export declare function resolveToolPresetName(options: {
|
|
128
|
+
mode?: AgentMode;
|
|
129
|
+
}): ToolPresetName;
|
|
130
|
+
/**
|
|
131
|
+
* AgentTool policy preset names
|
|
132
|
+
*/
|
|
133
|
+
export type ToolPolicyPresetName = "default" | "yolo";
|
|
134
|
+
/**
|
|
135
|
+
* Build tool policies for a preset.
|
|
136
|
+
* `yolo` guarantees tool policies are enabled and auto-approved.
|
|
137
|
+
*/
|
|
138
|
+
export declare function createToolPoliciesWithPreset(presetName: ToolPolicyPresetName): Record<string, ToolPolicy>;
|
|
139
|
+
/**
|
|
140
|
+
* Create default tools using a preset configuration
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* const tools = createDefaultToolsWithPreset("plan", {
|
|
145
|
+
* executors: {
|
|
146
|
+
* readFile: async ({ path }) => fs.readFile(path, "utf-8"),
|
|
147
|
+
* search: async (query, cwd) => searchFiles(query, cwd),
|
|
148
|
+
* webFetch: async (url, prompt) => fetchAndAnalyze(url, prompt),
|
|
149
|
+
* },
|
|
150
|
+
* cwd: "/path/to/project",
|
|
151
|
+
* })
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare function createDefaultToolsWithPreset(presetName: ToolPresetName, options: Omit<CreateDefaultToolsOptions, keyof DefaultToolsConfig> & Partial<DefaultToolsConfig>): AgentTool[];
|