@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,211 @@
|
|
|
1
|
+
import { type PolykvReleaseResult } from "@cerebriline/llms";
|
|
2
|
+
import { type AgentEvent, type TeamAgentActivity } from "@cerebriline/shared";
|
|
3
|
+
import { type CompactionCause } from "../../context/compaction-cause";
|
|
4
|
+
import type { RealizedSpawnSampling } from "./spawn-sampling";
|
|
5
|
+
/**
|
|
6
|
+
* What a delegated agent is doing, reported on the tool call that started it.
|
|
7
|
+
*
|
|
8
|
+
* A sub-agent's own events are deliberately kept out of the main chat -- one
|
|
9
|
+
* agent's internals are already a conversation, and three at once is a flood.
|
|
10
|
+
* The consequence was that nothing about a running sub-agent reached the user
|
|
11
|
+
* at all: the UI reads `latestToolCall` off the spawn tool's progress, and no
|
|
12
|
+
* spawn path had ever emitted any, so the field was declared, parsed, rendered
|
|
13
|
+
* and always empty.
|
|
14
|
+
*
|
|
15
|
+
* Measured on pandorum 2026-09-22: three configured agents ran for between 80
|
|
16
|
+
* and 148 seconds each, and for all of it the only thing on screen was the
|
|
17
|
+
* lead's last tool call. Whether an agent was working, queued behind the
|
|
18
|
+
* endpoint, or dead was not answerable without the extension log.
|
|
19
|
+
*
|
|
20
|
+
* This closes over one spawn call, so no identity has to be reconstructed --
|
|
21
|
+
* the events it is given are its own agent's, and the update lands on its own
|
|
22
|
+
* tool call.
|
|
23
|
+
*/
|
|
24
|
+
export interface SubagentProgress {
|
|
25
|
+
/** Feed every event the delegated agent emits. */
|
|
26
|
+
observe(event: AgentEvent): void;
|
|
27
|
+
}
|
|
28
|
+
/** How much of an agent's latest output the UI is given. */
|
|
29
|
+
export declare const SUBAGENT_OUTPUT_TAIL_CHARS = 400;
|
|
30
|
+
/**
|
|
31
|
+
* How often output progress is reported, at most.
|
|
32
|
+
*
|
|
33
|
+
* Deltas arrive per token; fifty agents reporting each one would be thousands
|
|
34
|
+
* of chat updates a second for a tail nobody reads that fast.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SUBAGENT_OUTPUT_REPORT_MS = 2000;
|
|
37
|
+
/**
|
|
38
|
+
* The agent is waiting for a node: every node that could take it is full.
|
|
39
|
+
*
|
|
40
|
+
* Without this the UI had no way to tell a queued agent from a working one --
|
|
41
|
+
* every agent was shown running from the moment it was spawned, so a fan-out
|
|
42
|
+
* of seventy-five on nodes that take three looked like seventy-five at work.
|
|
43
|
+
*/
|
|
44
|
+
export declare function reportSubagentQueued(emitUpdate: ((update: unknown) => void) | undefined): void;
|
|
45
|
+
/**
|
|
46
|
+
* The agent has a node and starts now. Sent at placement, not at the end: the
|
|
47
|
+
* node is what explains a slow agent while it is slow.
|
|
48
|
+
*/
|
|
49
|
+
export declare function reportSubagentPlaced(emitUpdate: ((update: unknown) => void) | undefined, placed: {
|
|
50
|
+
nodeId?: string;
|
|
51
|
+
nodeLabel?: string;
|
|
52
|
+
} | undefined): void;
|
|
53
|
+
/**
|
|
54
|
+
* Which model the agent runs on, sent when its attempt is built -- right after
|
|
55
|
+
* placement, next to `queued: false`. The row named the model only from the
|
|
56
|
+
* final result, so while an agent ran (the part where a slow or wrong model is
|
|
57
|
+
* worth knowing about) nothing said which one it was. Re-sent per attempt: a
|
|
58
|
+
* re-placement can land it on a node with a different model.
|
|
59
|
+
*/
|
|
60
|
+
export declare function reportSubagentModel(emitUpdate: ((update: unknown) => void) | undefined, model: {
|
|
61
|
+
providerId?: string;
|
|
62
|
+
modelId?: string;
|
|
63
|
+
/** The connection's model catalog, for the model's context window. */
|
|
64
|
+
knownModels?: Record<string, {
|
|
65
|
+
contextWindow?: number;
|
|
66
|
+
} | undefined>;
|
|
67
|
+
/** The iteration cap this attempt runs under, for the lead's status. */
|
|
68
|
+
maxIterations?: number;
|
|
69
|
+
}): void;
|
|
70
|
+
/**
|
|
71
|
+
* The sampler the agent was built with -- its realized seed and temperature,
|
|
72
|
+
* and when they were drawn, what around -- sent per build beside the model.
|
|
73
|
+
* A swarm experiment needs each agent's values to reproduce it, and the row
|
|
74
|
+
* (persisted with the task) is where they are kept. A requested value that
|
|
75
|
+
* could not be applied is also an info line on the row, never a warning.
|
|
76
|
+
*/
|
|
77
|
+
export declare function reportSubagentSampling(emitUpdate: ((update: unknown) => void) | undefined, sampling: RealizedSpawnSampling | undefined): void;
|
|
78
|
+
/**
|
|
79
|
+
* The agent has ended: its row finishes now, with its result, and not when the
|
|
80
|
+
* whole call does.
|
|
81
|
+
*
|
|
82
|
+
* A batch or a swarm closed every row at the call's end, so an agent that was
|
|
83
|
+
* done sat on a "running" row, its output showing, until the slowest one
|
|
84
|
+
* finished -- sixteen rows running on 2026-09-24 while the server processed
|
|
85
|
+
* one. `report` is the member's own entry of the call's `results`, and an
|
|
86
|
+
* `error` on it is what marks the row failed.
|
|
87
|
+
*/
|
|
88
|
+
export declare function reportSubagentFinished(emitUpdate: ((update: unknown) => void) | undefined, report: object): void;
|
|
89
|
+
/**
|
|
90
|
+
* What an agent's engine release said, for the log: a close that failed, an
|
|
91
|
+
* id the engine held no session under -- for an agent that sent requests,
|
|
92
|
+
* ours and the engine's have diverged -- and a session left to the idle TTL
|
|
93
|
+
* because the server has no close route. A clean release says nothing.
|
|
94
|
+
*/
|
|
95
|
+
export declare function logEngineRelease(log: ((line: string) => void) | undefined, released: PolykvReleaseResult | undefined, prefix: string): void;
|
|
96
|
+
/**
|
|
97
|
+
* Between a restarted attempt and the next: the row says so, and the engine
|
|
98
|
+
* session the abandoned attempt held goes back -- after a server restart it is
|
|
99
|
+
* still booked there, and the new attempt would be charged to it.
|
|
100
|
+
*/
|
|
101
|
+
export declare function restarted(emitUpdate: ((update: unknown) => void) | undefined, engineSessionId: string | undefined): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* The lead requeued the agent: it stopped at a boundary and goes back to the
|
|
104
|
+
* placement queue with its transcript. The row says so, and the engine
|
|
105
|
+
* session it held goes back -- it may be placed on another node.
|
|
106
|
+
*/
|
|
107
|
+
export declare function requeued(emitUpdate: ((update: unknown) => void) | undefined, engineSessionId: string | undefined, reason?: string): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Keep an agent's row honest while its requests wait for room on the engine.
|
|
110
|
+
*
|
|
111
|
+
* A PolyKV worker whose window is full is held inside the opencoti vendor's
|
|
112
|
+
* fetch, re-asking until another agent finishes. Nothing there can reach the
|
|
113
|
+
* agent's row, so it went on saying "running": 75 rows running on 2026-09-24
|
|
114
|
+
* while the server processed 27. The vendor reports each change under the
|
|
115
|
+
* agent's engine session; this turns it into the same `queued` the placement
|
|
116
|
+
* queue sends, with the reason as the row's output line.
|
|
117
|
+
*
|
|
118
|
+
* Returns the unsubscribe; call it when the agent is done, not between
|
|
119
|
+
* re-placements -- the listener belongs to the delegation.
|
|
120
|
+
*/
|
|
121
|
+
export declare function watchPolykvRoom(engineSessionId: string | undefined, emitUpdate: ((update: unknown) => void) | undefined,
|
|
122
|
+
/**
|
|
123
|
+
* Where a warning also goes, beside the row: a lost priority-0 sub-pool
|
|
124
|
+
* is a full prefill nobody sees on a row that has scrolled away.
|
|
125
|
+
*/
|
|
126
|
+
logger?: {
|
|
127
|
+
log?: (message: string, metadata?: {
|
|
128
|
+
severity?: "warn";
|
|
129
|
+
}) => void;
|
|
130
|
+
},
|
|
131
|
+
/** Told when a wait starts, with its reason: for the lead's report. */
|
|
132
|
+
onWaiting?: (reason: string | undefined) => void): () => void;
|
|
133
|
+
/**
|
|
134
|
+
* What every delegating tool tells the model about launching many agents.
|
|
135
|
+
*
|
|
136
|
+
* Measured on pandorum 2026-09-23 (sx4bp): asked for 75 reports, the lead
|
|
137
|
+
* spent its planning turn arguing with itself -- "that's 75 tool calls which
|
|
138
|
+
* is a LOT", "I'll do this in waves", "can I really make 75 tool calls at
|
|
139
|
+
* once?" -- five reversals before it launched them all together, which was
|
|
140
|
+
* right all along: placement queues what does not fit. Nothing in any
|
|
141
|
+
* description said so, so the model reasoned as if every call it made
|
|
142
|
+
* started a process on the spot.
|
|
143
|
+
*/
|
|
144
|
+
export declare const DELEGATION_PACING_NOTE = "Launching many is safe: the harness paces them. Each agent starts when a node has room for it and waits in a queue until then, so asking for more than can run at once overloads nothing -- it only means some start later. A call that waits returns when every agent in it has finished, and your next message is sent only after that -- so ask for the whole job at once: one `spawn_agent` call whose `agents` list holds every agent (a configured agent by `type`, several of one kind with `count`), or every call in the same message.";
|
|
145
|
+
/**
|
|
146
|
+
* What an agent is doing right now, for the lead's `agents_status`: the
|
|
147
|
+
* stretch it is in, not its last event. A compaction or a condensation is a
|
|
148
|
+
* model call of its own that streams nothing the agent's row shows, and on a
|
|
149
|
+
* PolyKV node throughput drops to zero while it runs -- the lead read those
|
|
150
|
+
* silences as stuck agents and cancelled them (swarm 2026-09-27).
|
|
151
|
+
*/
|
|
152
|
+
export type AgentPhase = "requesting" | "server_queued" | "prefill" | "generating" | "thinking" | "writing" | "writing_tool_call" | "tool" | "compacting" | "condensing_thinking" | "recovering" | "waiting_room";
|
|
153
|
+
/** The update that carries it: `{ phase: { name, detail? } }`. */
|
|
154
|
+
export interface AgentPhaseUpdate {
|
|
155
|
+
name: AgentPhase;
|
|
156
|
+
detail?: string;
|
|
157
|
+
}
|
|
158
|
+
/** The phase a notice starts or ends, or `undefined` for one that says none. */
|
|
159
|
+
export declare function phaseOfNotice(event: AgentEvent): AgentPhaseUpdate | "ended" | undefined;
|
|
160
|
+
/** One finished compaction, as the agent's row reports it. */
|
|
161
|
+
export interface SubagentCompaction {
|
|
162
|
+
cause: CompactionCause;
|
|
163
|
+
tokensBefore?: number;
|
|
164
|
+
tokensAfter?: number;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* A compaction that has finished, read off the status notice the compaction
|
|
168
|
+
* pipeline emits (`phase: "completed"`). The `started` notice and a skipped
|
|
169
|
+
* one are not compactions. `cause` refines the kind where the pipeline knew
|
|
170
|
+
* more -- an automatic compaction the server's KV pressure caused -- and a
|
|
171
|
+
* notice from before that field existed falls back to the kind.
|
|
172
|
+
*/
|
|
173
|
+
export declare function readCompactionNotice(event: AgentEvent): SubagentCompaction | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* A compaction observer that logs one info line per completed compaction:
|
|
176
|
+
* the agent, the cause, and its tokens before and after. The row shows the
|
|
177
|
+
* count; the log is what is left to analyse after a run (swarm 0926).
|
|
178
|
+
*/
|
|
179
|
+
export declare function compactionLogger(name: string, logger: {
|
|
180
|
+
log?: (message: string) => void;
|
|
181
|
+
} | undefined): ((compaction: SubagentCompaction) => void) | undefined;
|
|
182
|
+
export declare function createSubagentProgress(emitUpdate: ((update: unknown) => void) | undefined, forward?: (event: AgentEvent) => void, now?: () => number, options?: {
|
|
183
|
+
/** Told of each completed compaction, row or no row. */
|
|
184
|
+
onCompaction?: (compaction: SubagentCompaction) => void;
|
|
185
|
+
/**
|
|
186
|
+
* The agent's `subagentCancellation` id: its whole current step is
|
|
187
|
+
* kept under it for the row's Inspect view.
|
|
188
|
+
*/
|
|
189
|
+
outputId?: string;
|
|
190
|
+
}): SubagentProgress;
|
|
191
|
+
/**
|
|
192
|
+
* A running count of what an agent does -- tool calls and compactions -- for a
|
|
193
|
+
* holder that has no tool call to report on: a teammate, which outlives any
|
|
194
|
+
* one call. Built on the same observer every `spawn_agent` row is counted by,
|
|
195
|
+
* so the two can never count differently.
|
|
196
|
+
*
|
|
197
|
+
* `base` is where it starts: a restored teammate carries on from the count it
|
|
198
|
+
* was saved with. `observe` says whether the count moved, so a caller can
|
|
199
|
+
* report only on a change -- a teammate's every streamed token is an event.
|
|
200
|
+
*/
|
|
201
|
+
export interface ActivityCounter {
|
|
202
|
+
observe(event: AgentEvent): boolean;
|
|
203
|
+
snapshot(): TeamAgentActivity;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Whether a finished tool call failed: an error, or a result that says so.
|
|
207
|
+
* The file and command tools report a refusal as `success: false` in their
|
|
208
|
+
* output rather than as an error.
|
|
209
|
+
*/
|
|
210
|
+
export declare function toolFailed(error: unknown, output: unknown): boolean;
|
|
211
|
+
export declare function createActivityCounter(base?: TeamAgentActivity): ActivityCounter;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DelegatedAgentRuntimeConfig } from "./delegated-agent";
|
|
2
|
+
export declare function buildTeammateSystemPrompt(prompt: string, config: DelegatedAgentRuntimeConfig): string;
|
|
3
|
+
export declare function buildSubAgentSystemPrompt(prompt: string, config: DelegatedAgentRuntimeConfig): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TeamRuntimeState } from "@cerebriline/shared";
|
|
2
|
+
/**
|
|
3
|
+
* A team's state as it was saved, with its dates made dates again.
|
|
4
|
+
*
|
|
5
|
+
* The one reviver every reader of a saved team goes through: the SQLite
|
|
6
|
+
* store, the file store, the session's team file and the team tools. There
|
|
7
|
+
* were four copies, and a field added to one (B-10's `lastProgressAt`) had to
|
|
8
|
+
* be found and added to the other three by hand.
|
|
9
|
+
*/
|
|
10
|
+
export declare function reviveTeamStateDates(state: TeamRuntimeState): TeamRuntimeState;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type AgentTool, type TeamTeammateSpec } from "@cerebriline/shared";
|
|
2
|
+
import { type DelegatedAgentConfigProvider, type DelegatedAgentRuntimeConfig } from "./delegated-agent";
|
|
3
|
+
import type { AgentTeamsRuntime } from "./multi-agent";
|
|
4
|
+
export type TeamTeammateRuntimeConfig = DelegatedAgentRuntimeConfig;
|
|
5
|
+
export interface CreateAgentTeamsToolsOptions {
|
|
6
|
+
runtime: AgentTeamsRuntime;
|
|
7
|
+
requesterId: string;
|
|
8
|
+
teammateConfigProvider: DelegatedAgentConfigProvider;
|
|
9
|
+
/**
|
|
10
|
+
* The builtin tools for one teammate, by its id: a sandboxing host opens the
|
|
11
|
+
* teammate's private workspace here and binds the tools to it.
|
|
12
|
+
*/
|
|
13
|
+
createBaseTools?: (agentId: string) => AgentTool[];
|
|
14
|
+
allowSpawn?: boolean;
|
|
15
|
+
includeSpawnTool?: boolean;
|
|
16
|
+
includeManagementTools?: boolean;
|
|
17
|
+
onLeadToolsUnlocked?: (tools: AgentTool[]) => void;
|
|
18
|
+
/**
|
|
19
|
+
* The tools are a teammate's: {@link TEAMMATE_TEAM_TOOL_NAMES} only, and
|
|
20
|
+
* its `team_task` works the board without adding to it.
|
|
21
|
+
*/
|
|
22
|
+
teammate?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface BootstrapAgentTeamsOptions {
|
|
25
|
+
runtime: AgentTeamsRuntime;
|
|
26
|
+
teammateConfigProvider: DelegatedAgentConfigProvider;
|
|
27
|
+
/**
|
|
28
|
+
* The builtin tools for one teammate, by its id: a sandboxing host opens the
|
|
29
|
+
* teammate's private workspace here and binds the tools to it.
|
|
30
|
+
*/
|
|
31
|
+
createBaseTools?: (agentId: string) => AgentTool[];
|
|
32
|
+
leadAgentId?: string;
|
|
33
|
+
restoredTeammates?: TeamTeammateSpec[];
|
|
34
|
+
restoredFromPersistence?: boolean;
|
|
35
|
+
includeLeadSpawnTool?: boolean;
|
|
36
|
+
includeLeadManagementTools?: boolean;
|
|
37
|
+
onLeadToolsUnlocked?: (tools: AgentTool[]) => void;
|
|
38
|
+
}
|
|
39
|
+
export interface BootstrapAgentTeamsResult {
|
|
40
|
+
tools: AgentTool[];
|
|
41
|
+
restoredFromPersistence: boolean;
|
|
42
|
+
restoredTeammates: string[];
|
|
43
|
+
}
|
|
44
|
+
export declare const TEAM_TOOL_NAMES: readonly ["team_spawn_teammate", "team_shutdown_teammate", "team_status", "team_task", "team_run_task", "team_cancel_run", "team_list_runs", "team_await_runs", "team_send_message", "team_broadcast", "team_read_mailbox", "team_mission_log", "team_cleanup", "team_create_outcome", "team_attach_outcome_fragment", "team_review_outcome_fragment", "team_finalize_outcome", "team_list_outcomes"];
|
|
45
|
+
/**
|
|
46
|
+
* A teammate's team tools: the board, the mailbox, the mission log. The rest
|
|
47
|
+
* are the lead's. With them a teammate cancelled the lead's runs, finalized
|
|
48
|
+
* its outcomes, routed tasks to other teammates out of the lead's sight, and
|
|
49
|
+
* -- two teammates each awaiting "all runs" -- deadlocked (audit G-6, B-8).
|
|
50
|
+
* Their schemas were also a third of every teammate request's team tools.
|
|
51
|
+
*/
|
|
52
|
+
export declare const TEAMMATE_TEAM_TOOL_NAMES: ReadonlySet<string>;
|
|
53
|
+
export declare function bootstrapAgentTeams(options: BootstrapAgentTeamsOptions): BootstrapAgentTeamsResult;
|
|
54
|
+
export declare function createAgentTeamsTools(options: CreateAgentTeamsToolsOptions): AgentTool[];
|
|
55
|
+
export { reviveTeamStateDates } from "./team-state-dates";
|
|
56
|
+
export declare function sanitizeTeamName(name: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teammates are a setting, off by default, and a session can outlive a change
|
|
3
|
+
* to it: one that used teammates can be reopened after they were switched off.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is restored then -- the team store is not opened and no `team_*`
|
|
6
|
+
* tool is offered, so the transcript's earlier team calls stay history -- and
|
|
7
|
+
* that is correct, but it is also invisible. This names it once, so a user
|
|
8
|
+
* reading the log after "where did my teammates go" finds the answer.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TEAMMATES_OFF_RESTORE_NOTE = "[Agents] This session used teammates, but Teammates is off in settings: the team tools are not offered and its teammates are not restored. Turn Teammates on to bring them back.";
|
|
11
|
+
/** Whether a transcript holds a call to any `team_*` tool. */
|
|
12
|
+
export declare function historyUsedTeammates(messages: readonly {
|
|
13
|
+
content?: unknown;
|
|
14
|
+
}[] | undefined): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An input count split into what the provider had cached and what it read
|
|
3
|
+
* fresh. `input` stays the whole prompt, every turn summed: an agent that
|
|
4
|
+
* sends a 30k prefix twenty times shows 600k, nearly all of it cached, and
|
|
5
|
+
* without the split that read as 600k of work (lead report, swarm wlafh).
|
|
6
|
+
*
|
|
7
|
+
* A gateway's input count holds the cached part; a provider that reports the
|
|
8
|
+
* cache apart (more cached than sent) gets it added. `cached` and `fresh` are
|
|
9
|
+
* absent when the provider reported no cache figure.
|
|
10
|
+
*/
|
|
11
|
+
export declare function splitInputTokens(input: number, cached: number | undefined): {
|
|
12
|
+
input: number;
|
|
13
|
+
cached?: number;
|
|
14
|
+
fresh?: number;
|
|
15
|
+
};
|
|
16
|
+
/** Usage as an agent's result states it to the lead. */
|
|
17
|
+
export interface MemberUsage {
|
|
18
|
+
inputTokens: number;
|
|
19
|
+
outputTokens: number;
|
|
20
|
+
/** Of `inputTokens`, what the provider served from its cache. */
|
|
21
|
+
cachedInputTokens?: number;
|
|
22
|
+
}
|
|
23
|
+
/** A runtime's usage as the lead is told it, the cached part of the input named. */
|
|
24
|
+
export declare function memberUsage(usage: {
|
|
25
|
+
inputTokens?: number;
|
|
26
|
+
outputTokens?: number;
|
|
27
|
+
cacheReadTokens?: number;
|
|
28
|
+
} | undefined): MemberUsage;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type TurnFaultRecovery } from "@cerebriline/shared";
|
|
2
|
+
/** First wait after a refusal; doubles with each one in a row. */
|
|
3
|
+
export declare const REFUSAL_BACKOFF_FIRST_MS = 2000;
|
|
4
|
+
/**
|
|
5
|
+
* Longest wait between refused attempts: the one guard against a tight loop,
|
|
6
|
+
* and short enough that a pool that frees up is used within a minute.
|
|
7
|
+
*/
|
|
8
|
+
export declare const REFUSAL_BACKOFF_MAX_MS = 60000;
|
|
9
|
+
/** Wait before the `attempt`th retry of a refusal (1-based). */
|
|
10
|
+
export declare function refusalBackoffMs(attempt: number): number;
|
|
11
|
+
/** What a waiting agent is waiting on. */
|
|
12
|
+
export interface TurnFaultWait {
|
|
13
|
+
kind: "transport" | "refusal";
|
|
14
|
+
/** The node or server. */
|
|
15
|
+
where: string;
|
|
16
|
+
/** The refusal's text, or why the server is gone. */
|
|
17
|
+
detail: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TurnFaultRecoveryOptions {
|
|
20
|
+
/** The agent, as its row and the log name it. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Where it runs, for the waiting line: a node label, or undefined. */
|
|
23
|
+
where?: () => string | undefined;
|
|
24
|
+
/** The server's base URL, for the health probe. Absent: back off only. */
|
|
25
|
+
baseUrl?: () => string | undefined;
|
|
26
|
+
headers?: () => Record<string, string> | undefined;
|
|
27
|
+
/** The agent's own stop, on top of the run's. */
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
/** The agent's row. */
|
|
30
|
+
emitUpdate?: (update: unknown) => void;
|
|
31
|
+
logger?: {
|
|
32
|
+
log: (message: string) => void;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Placed agents only: whether the engine has admitted this agent. Before
|
|
36
|
+
* it has, the fault goes back to the spawn queue, which can re-place it.
|
|
37
|
+
*/
|
|
38
|
+
isAdmitted?: () => boolean;
|
|
39
|
+
/** A transport fault was seen: take the node out of rotation for a while. */
|
|
40
|
+
onTransportFault?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* A refused turn, on an admitted agent: move it to another node with room
|
|
43
|
+
* instead of waiting here. `true` when it is being moved; `false` when no
|
|
44
|
+
* other node has room (or the agent cannot be moved), and it waits.
|
|
45
|
+
*
|
|
46
|
+
* User ruling 2026-09-28: an agent the engine keeps refusing is moved,
|
|
47
|
+
* by priority, to a node that is free. Before this only `requeue_agent`
|
|
48
|
+
* moved an admitted agent, and the lead in h0o2o did it 21 times by hand.
|
|
49
|
+
*/
|
|
50
|
+
relocate?: (reason: string) => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Told on every wait, and again on each health probe that finds the server
|
|
53
|
+
* still gone: what the agent is waiting on. For whoever tracks how long an
|
|
54
|
+
* agent has been stuck.
|
|
55
|
+
*/
|
|
56
|
+
onWaiting?: (state: TurnFaultWait) => void;
|
|
57
|
+
/** Seams for tests. */
|
|
58
|
+
fetch?: typeof fetch;
|
|
59
|
+
sleep?: (ms: number, signal?: AbortSignal | null) => Promise<void>;
|
|
60
|
+
probe?: (root: string) => Promise<boolean>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The server answered and failed the whole decode batch the turn was in:
|
|
64
|
+
* opencoti's "Invalid input batch." or its speculative sub-batch throw. The
|
|
65
|
+
* node is up and serving; calling it unreachable made the lead stop agents
|
|
66
|
+
* on a working node (swarm 0926).
|
|
67
|
+
*/
|
|
68
|
+
export declare const FAILED_BATCH_REASON = "it failed the batch this turn was in";
|
|
69
|
+
/** Why the server went away, in the words the row uses. */
|
|
70
|
+
export declare function transportFaultReason(message: string): string;
|
|
71
|
+
export declare function createTurnFaultRecovery(options: TurnFaultRecoveryOptions): TurnFaultRecovery;
|