@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,328 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A delegated agent at its iteration cap waits for the lead; its work is kept.
|
|
3
|
+
*
|
|
4
|
+
* Ruled (lead-agent-control spec, D): hitting `maxIterations` must not lose
|
|
5
|
+
* the work -- the lead decides whether to resume it with a raised cap, or stop
|
|
6
|
+
* or restart it. Until now the cap ended the run like an error, the agent's
|
|
7
|
+
* overlay was handed back and disposed, and the transcript went with the
|
|
8
|
+
* agent object.
|
|
9
|
+
*
|
|
10
|
+
* So a run that stops at its cap is *suspended* here, in state
|
|
11
|
+
* `awaiting_lead`, with everything it needs to go on: the conversation (the
|
|
12
|
+
* agent object, alive), its private workspace (its path does not tear it down
|
|
13
|
+
* while it waits) and its place in the round. The lead is told -- once for all
|
|
14
|
+
* the agents of a session that stop together -- and answers with
|
|
15
|
+
* {@link resumeSuspended} (the `resume_agent` tool) or a stop. A blocking
|
|
16
|
+
* round does not return while one of its agents waits: the spawn call is the
|
|
17
|
+
* thing waiting, and the lead's side turn is where it decides.
|
|
18
|
+
*
|
|
19
|
+
* **A loop is treated like the cap.** A run the repeated-call loop guard
|
|
20
|
+
* stopped -- the same call, arguments unchanged, sent again after its warning
|
|
21
|
+
* -- is suspended the same way (user ruling, 2026-09-26: the lead is told the
|
|
22
|
+
* agent was looping and picks resume_agent or restart_agent with new
|
|
23
|
+
* instructions). Ending it there threw its work away: three workers of the
|
|
24
|
+
* 0926b swarm were ended so, reported only as "stopped".
|
|
25
|
+
*
|
|
26
|
+
* With nobody to ask -- a host that registered no lead listener, so no side
|
|
27
|
+
* turn and no queue -- the agent is *detached*: its spawn returns at once with
|
|
28
|
+
* the agent reported `awaiting_lead`, and the agent stays suspended with its
|
|
29
|
+
* resources held until `resume_agent` continues it in the background or it is
|
|
30
|
+
* stopped. {@link createDelegatedAgentLifetime} is how the spawn path defers
|
|
31
|
+
* its teardown to that point.
|
|
32
|
+
*
|
|
33
|
+
* **The engine session is kept while a listening lead decides**, and released
|
|
34
|
+
* only for an agent detached with nobody to ask. Released on every wait, it
|
|
35
|
+
* cost more than it freed (bs2 8244, 2026-09-26, 64 suspensions of 32 agents,
|
|
36
|
+
* the lead answering in about two minutes): closing the session erases the
|
|
37
|
+
* engine's running mark, so the resumed agent was admitted as a new session,
|
|
38
|
+
* and the pool's enforced tps floor -- which holds new sessions back and lets
|
|
39
|
+
* running ones through -- refused it every minute for up to half an hour. Its
|
|
40
|
+
* owner, with no finished request in five minutes, lapsed, and its pools with
|
|
41
|
+
* it. A swarm worker's window is its owner's booking anyway; kept, the agent
|
|
42
|
+
* also resumes on its own cache instead of re-prefilling its transcript.
|
|
43
|
+
* The client-side node lease (or endpoint slot) is kept either way: it pins
|
|
44
|
+
* the agent to the node its transcript was produced on, and giving it up would
|
|
45
|
+
* let the harness re-place it onto a different model mid-conversation.
|
|
46
|
+
*/
|
|
47
|
+
import type { AgentResult } from "@cerebriline/shared";
|
|
48
|
+
import type { AgentOracleResult, DelegatedAgentCheck } from "./agent-check";
|
|
49
|
+
import { type SubagentStopActor } from "./subagent-cancellation";
|
|
50
|
+
/** The tool the lead continues a waiting agent with (built on {@link resumeSuspended}). */
|
|
51
|
+
export declare const RESUME_AGENT_TOOL_NAME = "resume_agent";
|
|
52
|
+
/**
|
|
53
|
+
* What a resume adds when neither the lead names an amount nor the agent was
|
|
54
|
+
* spawned with a cap (a loop-guard or supervisor stop of an uncapped agent,
|
|
55
|
+
* where the amount is not used).
|
|
56
|
+
*/
|
|
57
|
+
export declare const DEFAULT_RESUME_ITERATIONS = 30;
|
|
58
|
+
/** How long agents stopping together wait for each other's notice. */
|
|
59
|
+
export declare const AWAITING_LEAD_BATCH_MS = 3000;
|
|
60
|
+
/** What the agent-layer needs of the agent it runs: a `SessionRuntime`. */
|
|
61
|
+
export interface CappableAgent {
|
|
62
|
+
getAgentId(): string;
|
|
63
|
+
/** Optional so a stand-in agent need not have it; a `SessionRuntime` does. */
|
|
64
|
+
getMaxIterations?(): number | undefined;
|
|
65
|
+
setMaxIterations?(maxIterations: number | undefined): void;
|
|
66
|
+
continue(message?: string): Promise<AgentResult>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Why an agent waits on the lead: its iteration cap, a loop the guard
|
|
70
|
+
* stopped, or a grind the struggle supervisor stopped.
|
|
71
|
+
*/
|
|
72
|
+
export type AwaitingLeadReason = "iteration_cap" | "looping" | "struggling";
|
|
73
|
+
/** An agent waiting on the lead, as the lead and the status tool see it. */
|
|
74
|
+
export interface AwaitingLeadView {
|
|
75
|
+
/** The agent's own id (its runtime's). */
|
|
76
|
+
agentId: string;
|
|
77
|
+
/** What the round calls it. */
|
|
78
|
+
name: string;
|
|
79
|
+
sessionId?: string;
|
|
80
|
+
/** The id `stop_agents` and the chat row know it by, when it has one. */
|
|
81
|
+
cancelId?: string;
|
|
82
|
+
/** Iterations it has used, over every run so far. */
|
|
83
|
+
iterations: number;
|
|
84
|
+
/** Its cap so far: the first one plus every raise. */
|
|
85
|
+
maxIterations: number;
|
|
86
|
+
/**
|
|
87
|
+
* The cap it was spawned with: what a resume that names no amount adds
|
|
88
|
+
* (60 -> 120 -> 180). Absent when it had none.
|
|
89
|
+
*/
|
|
90
|
+
firstCap?: number;
|
|
91
|
+
/** When it stopped at the cap. */
|
|
92
|
+
since: number;
|
|
93
|
+
/** Its spawn call has returned; a resume runs it in the background. */
|
|
94
|
+
detached: boolean;
|
|
95
|
+
/** Why it waits; absent is the cap. */
|
|
96
|
+
reason?: AwaitingLeadReason;
|
|
97
|
+
/**
|
|
98
|
+
* For a loop: the guard's own words, naming the call it repeated. For a
|
|
99
|
+
* supervisor stop: the supervisor's, saying what it measured.
|
|
100
|
+
*/
|
|
101
|
+
detail?: string;
|
|
102
|
+
}
|
|
103
|
+
/** Why an agent's run came to an end, as far as the cap is concerned. */
|
|
104
|
+
export type DelegatedStopReason = "iteration_cap" | "loop_guard" | "supervisor"
|
|
105
|
+
/** Stopped gracefully: its last turn was a report, and it ends on that. */
|
|
106
|
+
| "wrap_up";
|
|
107
|
+
/** A delegated run, with what the cap and the check made of it. */
|
|
108
|
+
export interface DelegatedRunOutcome {
|
|
109
|
+
/** The last run's result, with iterations and usage summed over every run. */
|
|
110
|
+
result: AgentResult;
|
|
111
|
+
/** Iterations used, over the first run and every resume. */
|
|
112
|
+
iterations: number;
|
|
113
|
+
/** The cap it ended under: the first plus every raise. Absent is no cap. */
|
|
114
|
+
maxIterations?: number;
|
|
115
|
+
/** Set when the cap is what ended it (stopped at the cap by the lead or a user). */
|
|
116
|
+
stopReason?: DelegatedStopReason;
|
|
117
|
+
/** Set when it is still waiting on the lead: its spawn returned detached. */
|
|
118
|
+
state?: "awaiting_lead";
|
|
119
|
+
/** The lead's check, when one was set. */
|
|
120
|
+
oracle?: AgentOracleResult;
|
|
121
|
+
}
|
|
122
|
+
export type AwaitingLeadEvent = {
|
|
123
|
+
type: "suspended";
|
|
124
|
+
agent: AwaitingLeadView;
|
|
125
|
+
} | {
|
|
126
|
+
type: "resumed";
|
|
127
|
+
agent: AwaitingLeadView;
|
|
128
|
+
extraIterations: number;
|
|
129
|
+
} | {
|
|
130
|
+
type: "stopped";
|
|
131
|
+
agent: AwaitingLeadView;
|
|
132
|
+
reason: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: "finished";
|
|
135
|
+
agent: AwaitingLeadView;
|
|
136
|
+
outcome: DelegatedRunOutcome;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Be told as agents stop at their cap, resume, are stopped there, or -- a
|
|
140
|
+
* detached one -- finish. For the round registry and the status tool.
|
|
141
|
+
*/
|
|
142
|
+
export declare function onAwaitingLead(listener: (event: AwaitingLeadEvent) => void): () => void;
|
|
143
|
+
/** Every agent waiting on the lead, or those of one session. */
|
|
144
|
+
export declare function listAwaitingLead(sessionId?: string): AwaitingLeadView[];
|
|
145
|
+
export interface ResumeSuspendedResult {
|
|
146
|
+
ok: boolean;
|
|
147
|
+
message: string;
|
|
148
|
+
agent?: AwaitingLeadView;
|
|
149
|
+
/** The iterations it was given: the lead's amount, or its first cap. */
|
|
150
|
+
extraIterations?: number;
|
|
151
|
+
/**
|
|
152
|
+
* For a detached agent: its run from here, to its end or its next stop at
|
|
153
|
+
* the cap. Absent for an agent whose spawn call is still open -- that call
|
|
154
|
+
* returns its report.
|
|
155
|
+
*/
|
|
156
|
+
completion?: Promise<DelegatedRunOutcome>;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Continue an agent waiting at its cap, with `extraIterations` more turns --
|
|
160
|
+
* by default as many as it was spawned with.
|
|
161
|
+
*
|
|
162
|
+
* The primitive `resume_agent` is built on. `idOrName` is the agent's id, its
|
|
163
|
+
* row's id, or its name in the round; `sessionId` scopes the search to the
|
|
164
|
+
* lead's session, which a caller should always pass.
|
|
165
|
+
*/
|
|
166
|
+
export declare function resumeSuspended(idOrName: string, extraIterations: number | undefined, sessionId?: string, instructions?: string): ResumeSuspendedResult;
|
|
167
|
+
/**
|
|
168
|
+
* End an agent waiting at its cap, keeping what it did: its report is its last
|
|
169
|
+
* output, its changes are handed back as they would be on any other end.
|
|
170
|
+
*/
|
|
171
|
+
export declare function stopSuspended(idOrName: string, options?: {
|
|
172
|
+
sessionId?: string;
|
|
173
|
+
reason?: string;
|
|
174
|
+
report?: boolean;
|
|
175
|
+
}): {
|
|
176
|
+
ok: boolean;
|
|
177
|
+
message: string;
|
|
178
|
+
agent?: AwaitingLeadView;
|
|
179
|
+
};
|
|
180
|
+
/** What a stop did: asked for a report, ended it, or found nothing to stop. */
|
|
181
|
+
export type SubagentStopOutcome = "graceful" | "stopped" | "not_running";
|
|
182
|
+
/**
|
|
183
|
+
* Stop one agent, the one way every control does it -- the lead's
|
|
184
|
+
* `stop_agents`, the row's Stop and the panel's Stop all.
|
|
185
|
+
*
|
|
186
|
+
* Graceful by default: a running agent finishes its step and reports
|
|
187
|
+
* (`subagentCancellation.wrapUp`), one waiting on the lead writes its report
|
|
188
|
+
* where it stopped. `immediate` ends it at once, work kept and no report --
|
|
189
|
+
* also the way to end one already stopping gracefully. A running agent whose
|
|
190
|
+
* path has no segment to take a report turn is stopped at once.
|
|
191
|
+
*/
|
|
192
|
+
export declare function stopSubagent(options: {
|
|
193
|
+
cancelId?: string;
|
|
194
|
+
/** Its id or name, for one waiting on the lead that has no cancel id. */
|
|
195
|
+
ref?: string;
|
|
196
|
+
sessionId?: string;
|
|
197
|
+
by: SubagentStopActor;
|
|
198
|
+
immediate?: boolean;
|
|
199
|
+
}): SubagentStopOutcome;
|
|
200
|
+
/** The notice for agents that stopped at their cap, as the lead reads it. */
|
|
201
|
+
export declare function describeAwaitingLead(views: readonly AwaitingLeadView[]): string;
|
|
202
|
+
/** Send what is batched for a session now, rather than when its timer fires. */
|
|
203
|
+
export declare function flushAwaitingLeadNotices(sessionId?: string): void;
|
|
204
|
+
/**
|
|
205
|
+
* When a spawn path's teardown runs: at once, or -- for an agent detached at
|
|
206
|
+
* its cap -- once the agent is finally done.
|
|
207
|
+
*/
|
|
208
|
+
export interface DelegatedAgentLifetime {
|
|
209
|
+
/**
|
|
210
|
+
* Run `cleanup` now, or -- for a detached agent -- schedule it for when the
|
|
211
|
+
* agent is finally done and return at once, so the spawn call can return
|
|
212
|
+
* while the agent waits. Never throws.
|
|
213
|
+
*/
|
|
214
|
+
end(cleanup: () => Promise<void> | void): Promise<void>;
|
|
215
|
+
/** Settles once the cleanup handed to {@link end} has run. */
|
|
216
|
+
readonly ended: Promise<void>;
|
|
217
|
+
/** Whether the agent was detached (its spawn returned while it waits). */
|
|
218
|
+
readonly detached: boolean;
|
|
219
|
+
/** Set by the run when it detaches: teardown waits for `done`. */
|
|
220
|
+
holdUntil(done: Promise<unknown>): void;
|
|
221
|
+
}
|
|
222
|
+
export declare function createDelegatedAgentLifetime(): DelegatedAgentLifetime;
|
|
223
|
+
export interface RunDelegatedWithCapOptions {
|
|
224
|
+
agent: CappableAgent;
|
|
225
|
+
/** The first run: `agent.run(task)` or `agent.runWithHead(...)`. */
|
|
226
|
+
start: () => Promise<AgentResult>;
|
|
227
|
+
/** What the round calls it. */
|
|
228
|
+
name: string;
|
|
229
|
+
/** The cap it was built with, when the agent cannot say. */
|
|
230
|
+
maxIterations?: number;
|
|
231
|
+
/** The lead's session. */
|
|
232
|
+
sessionId?: string;
|
|
233
|
+
/** The id its row and `stop_agents` know it by. */
|
|
234
|
+
cancelId?: string;
|
|
235
|
+
/** Its stop: a stop while it waits ends it at the cap, work kept. */
|
|
236
|
+
signal?: AbortSignal;
|
|
237
|
+
/** Its row. */
|
|
238
|
+
emitUpdate?: (update: unknown) => void;
|
|
239
|
+
/** The lead's check on it, already wired into its completion boundary. */
|
|
240
|
+
check?: DelegatedAgentCheck;
|
|
241
|
+
/** Gives the engine session back while it waits; see the file comment. */
|
|
242
|
+
releaseEngineSession?: () => Promise<unknown>;
|
|
243
|
+
/**
|
|
244
|
+
* Where teardown is deferred to when the agent is detached. Without one it
|
|
245
|
+
* is never detached: with nobody to ask, it is ended at the cap instead,
|
|
246
|
+
* its work kept.
|
|
247
|
+
*/
|
|
248
|
+
lifetime?: DelegatedAgentLifetime;
|
|
249
|
+
/**
|
|
250
|
+
* The agent's struggle supervisor, when it has one: a resume after its
|
|
251
|
+
* stop is watched from zero again.
|
|
252
|
+
*/
|
|
253
|
+
supervisor?: {
|
|
254
|
+
rearm(): void;
|
|
255
|
+
};
|
|
256
|
+
/** A detached agent's final outcome, for the path's own end-of-run work. */
|
|
257
|
+
onDetachedFinish?: (outcome: DelegatedRunOutcome) => Promise<void> | void;
|
|
258
|
+
/**
|
|
259
|
+
* Where a detached agent's resume runs: its path's placement -- the node
|
|
260
|
+
* lease on the node it ran on, or the endpoint's slot gate. Its spawn call
|
|
261
|
+
* returned and gave those back, so without this the resumed agent would
|
|
262
|
+
* run outside every bound. An agent held inside its call keeps its lease
|
|
263
|
+
* and does not use it.
|
|
264
|
+
*/
|
|
265
|
+
resumeThrough?: <T>(run: () => Promise<T>) => Promise<T>;
|
|
266
|
+
}
|
|
267
|
+
/** What an agent is told when the lead raises its cap, or lets it go on after a loop. */
|
|
268
|
+
export declare function resumeNote(extraIterations: number, reason?: AwaitingLeadReason, instructions?: string): string;
|
|
269
|
+
/** Whether the struggle supervisor, not a stop from outside, ended this run. */
|
|
270
|
+
export declare function stoppedBySupervisor(result: Pick<AgentResult, "finishReason"> & {
|
|
271
|
+
abortReason?: string;
|
|
272
|
+
}, signal?: AbortSignal): boolean;
|
|
273
|
+
/** Whether the repeated-call loop guard, not a stop from outside, ended this run. */
|
|
274
|
+
export declare function stoppedByLoopGuard(result: Pick<AgentResult, "finishReason"> & {
|
|
275
|
+
abortReason?: string;
|
|
276
|
+
}, signal?: AbortSignal): boolean;
|
|
277
|
+
/**
|
|
278
|
+
* The last turn of an agent the lead stopped at its cap: its report. At the
|
|
279
|
+
* cap an agent's last output is usually a tool call's preamble -- the lead
|
|
280
|
+
* got "Now let me check line 90" as the report of 60 iterations of work.
|
|
281
|
+
*/
|
|
282
|
+
export declare const FINAL_REPORT_NOTE = "[SYSTEM MESSAGE] Your iteration budget is spent and the lead is taking your work as it is. Do not call any tool. In this one reply, report: what you changed (files and what for), what you verified and how, and what is still broken or unfinished -- exactly where you stopped.";
|
|
283
|
+
/**
|
|
284
|
+
* The last turn of an agent stopped gracefully while it was working: what it
|
|
285
|
+
* has, before it goes. A stop that aborted it outright left the lead its file
|
|
286
|
+
* changes and no word of what they were (13 of 15 agents, swarm czbnh).
|
|
287
|
+
*/
|
|
288
|
+
export declare function wrapUpNote(by: "lead" | "user" | undefined): string;
|
|
289
|
+
/** What the lead reads above a graceful stop's report. */
|
|
290
|
+
export declare function wrapUpHeading(by: "lead" | "user" | undefined): string;
|
|
291
|
+
/**
|
|
292
|
+
* A graceful stop's last turn, run on the transcript the stopped segment
|
|
293
|
+
* left: one reply, no check, no cap to wait at. Its answer is the agent's
|
|
294
|
+
* report; with none, the run reads as stopped with no answer, as an
|
|
295
|
+
* outright stop does.
|
|
296
|
+
*/
|
|
297
|
+
export declare function runWrapUpReport(options: {
|
|
298
|
+
agent: CappableAgent & {
|
|
299
|
+
restore(messages: never): void;
|
|
300
|
+
};
|
|
301
|
+
messages: readonly unknown[];
|
|
302
|
+
by: "lead" | "user" | undefined;
|
|
303
|
+
}): Promise<DelegatedRunOutcome>;
|
|
304
|
+
/** Turns before the cap at which an agent is told to wrap up. */
|
|
305
|
+
export declare function capWarningMargin(cap: number): number;
|
|
306
|
+
/**
|
|
307
|
+
* A warning for an agent nearing its cap, once per run: finish and report,
|
|
308
|
+
* rather than be cut off mid-step. Fed the agent's events for its turn count;
|
|
309
|
+
* `take` is read at each turn boundary (`consumePendingUserMessage`). A
|
|
310
|
+
* resume starts a new run with its own allowance, and a new warning.
|
|
311
|
+
*/
|
|
312
|
+
export declare function createCapWarning(getCap: () => number | undefined): {
|
|
313
|
+
observe(event: {
|
|
314
|
+
type: string;
|
|
315
|
+
iteration?: number;
|
|
316
|
+
}): void;
|
|
317
|
+
take(): string | undefined;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Run a delegated agent to its end, suspending it at its cap for the lead.
|
|
321
|
+
*
|
|
322
|
+
* Every spawn path runs its agent through this, so the cap behaves the same
|
|
323
|
+
* on all of them. A run with no cap, or one that finishes under it, passes
|
|
324
|
+
* straight through.
|
|
325
|
+
*/
|
|
326
|
+
export declare function runDelegatedWithCap(options: RunDelegatedWithCapOptions): Promise<DelegatedRunOutcome>;
|
|
327
|
+
/** Test seam. */
|
|
328
|
+
export declare function __resetAwaitingLead(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agents of one call named apart.
|
|
3
|
+
*
|
|
4
|
+
* The lead is free to give several agents the same name -- asked for five
|
|
5
|
+
* reviews, it sends five entries called `code-review` -- and nothing refused
|
|
6
|
+
* it, so a round held five agents answering to one name: their rows, the
|
|
7
|
+
* notices about them ("code-review: refused 13x") and the round index could
|
|
8
|
+
* not tell them apart (pandorum h0o2o, 2026-09-28, 25 agents under 5 names).
|
|
9
|
+
*
|
|
10
|
+
* Failing the call would make the lead spend a turn on a formality. So a name
|
|
11
|
+
* used more than once becomes `<name>-1`, `<name>-2`, ... in the order given,
|
|
12
|
+
* the way `count` names its copies, skipping any name already taken in the
|
|
13
|
+
* call, and the lead is told what was renamed. A name used once is left alone.
|
|
14
|
+
*
|
|
15
|
+
* The host keys an agent's row by its position and shows this name, so it
|
|
16
|
+
* applies the same function (`spawnBatchMembers`); both have to agree.
|
|
17
|
+
*/
|
|
18
|
+
export declare function uniqueAgentNames(names: readonly string[]): {
|
|
19
|
+
names: string[];
|
|
20
|
+
renamed: Array<{
|
|
21
|
+
from: string;
|
|
22
|
+
to: string[];
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
/** The sentence that tells the lead which agents were renamed. */
|
|
26
|
+
export declare function describeRenamedAgents(renamed: ReadonlyArray<{
|
|
27
|
+
from: string;
|
|
28
|
+
to: string[];
|
|
29
|
+
}>): string | undefined;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { type AcquireOptions } from "./agent-placement-queue";
|
|
2
|
+
import type { DelegatedAgentConfigProvider, DelegatedAgentConnectionConfig } from "./delegated-agent";
|
|
3
|
+
/** What a host says about one node. */
|
|
4
|
+
export interface AgentNodeRuntimeConfig {
|
|
5
|
+
id: string;
|
|
6
|
+
/** 1 highest. `0` is the lead's own PolyKV session; see the plan's §9g. */
|
|
7
|
+
priority: number;
|
|
8
|
+
/**
|
|
9
|
+
* Agents this node may run at once.
|
|
10
|
+
*
|
|
11
|
+
* Resolved by the host, where the unit differs by provider: a
|
|
12
|
+
* parallel-sessions setting for ollama, llama.cpp and the cloud providers,
|
|
13
|
+
* and for opencoti the sub-pools inside its one session.
|
|
14
|
+
*/
|
|
15
|
+
capacity: number;
|
|
16
|
+
/** See {@link AgentNode.pacedAdmission}: set by the host for PolyKV. */
|
|
17
|
+
pacedAdmission?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* What the settings panel calls this node -- `Node1`, `Node2`, `Node3`.
|
|
20
|
+
*
|
|
21
|
+
* The id is a storage key (`node-mucuczcm`), generated when the node is
|
|
22
|
+
* added and shown nowhere in the UI, so a chat row that printed it named
|
|
23
|
+
* something the user had no way to look up. Reported exactly that way:
|
|
24
|
+
* "on node-mucuczcm" -- what is this? I expect to see Node1 or Node2.
|
|
25
|
+
*
|
|
26
|
+
* Carried rather than derived here because the numbering belongs to the
|
|
27
|
+
* stored list, including the nodes this one skips: a node that names no
|
|
28
|
+
* provider is dropped before it reaches the placement engine, and
|
|
29
|
+
* renumbering around the gap would call Node3 "Node2" on the one screen
|
|
30
|
+
* where the user is trying to tell them apart.
|
|
31
|
+
*/
|
|
32
|
+
label?: string;
|
|
33
|
+
/** The node's own connection, in the shape the Agents tab already stores. */
|
|
34
|
+
connection: Partial<DelegatedAgentConnectionConfig>;
|
|
35
|
+
/** See `CoreSessionConfig.agentNodes[].windowShare`. */
|
|
36
|
+
windowShare?: number;
|
|
37
|
+
/**
|
|
38
|
+
* This node is the lead conversation's own opencoti session: priority 0,
|
|
39
|
+
* "Use PolyKV agents as Priority 0" (PLANS §9g). Its agents are built as
|
|
40
|
+
* sub-pools of the lead's window, its priority is 0 and its capacity at
|
|
41
|
+
* most {@link LEAD_SUBPOOL_CAPACITY}, whatever else the entry says.
|
|
42
|
+
*/
|
|
43
|
+
polykvLead?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** The id and label the priority-0 node goes by. */
|
|
46
|
+
export declare const POLYKV_LEAD_NODE_ID = "polykv-lead";
|
|
47
|
+
export declare const POLYKV_LEAD_NODE_LABEL = "Model (PolyKV)";
|
|
48
|
+
/** What {@link sessionAgentNodes} reads of a session's config. */
|
|
49
|
+
export interface SessionAgentNodesInput {
|
|
50
|
+
providerId: string;
|
|
51
|
+
modelId: string;
|
|
52
|
+
agentNodes?: readonly AgentNodeRuntimeConfig[];
|
|
53
|
+
/**
|
|
54
|
+
* The host's word that the setting is on AND this session's endpoint
|
|
55
|
+
* confirmed `pools_enabled`. The provider is checked again here.
|
|
56
|
+
*/
|
|
57
|
+
polykvAgentsPriorityZero?: boolean;
|
|
58
|
+
/** The lead's own connection, from which the priority-0 node is built. */
|
|
59
|
+
lead: Partial<DelegatedAgentConnectionConfig>;
|
|
60
|
+
/**
|
|
61
|
+
* The session's own agent concurrency (`maxConcurrentAgents`), for the
|
|
62
|
+
* overflow node made when the host lists none. `0` or absent is "the
|
|
63
|
+
* endpoint decides", which a node spells `Infinity`.
|
|
64
|
+
*/
|
|
65
|
+
overflowCapacity?: number;
|
|
66
|
+
}
|
|
67
|
+
/** The overflow tier made when priority 0 is on and the host lists no node. */
|
|
68
|
+
export declare const PRIMARY_OVERFLOW_NODE_ID = "primary";
|
|
69
|
+
export declare function sessionAgentNodes(input: SessionAgentNodesInput): AgentNodeRuntimeConfig[];
|
|
70
|
+
/** Somewhere to run one agent, held until it is given back. */
|
|
71
|
+
export interface PlacedAgentNode {
|
|
72
|
+
nodeId: string;
|
|
73
|
+
/** What the settings panel calls it; see {@link AgentNodeRuntimeConfig.label}. */
|
|
74
|
+
nodeLabel?: string;
|
|
75
|
+
configProvider: DelegatedAgentConfigProvider;
|
|
76
|
+
/**
|
|
77
|
+
* Runs `fn` on this node. The lease IS the gate.
|
|
78
|
+
*
|
|
79
|
+
* A placed agent is deliberately NOT also held behind the shared
|
|
80
|
+
* per-endpoint gate. Two nodes that resolve to one base URL are two lanes
|
|
81
|
+
* on that server, not one: they are two of its slots, and how many
|
|
82
|
+
* requests it will take at once is the server's own answer -- `--parallel`
|
|
83
|
+
* on a llama.cpp family engine, `OLLAMA_NUM_PARALLEL` on ollama, more than
|
|
84
|
+
* either under PolyKV admission with elastic slots. A node's capacity is
|
|
85
|
+
* the user saying how much of that to use, and the sum across nodes is
|
|
86
|
+
* what they asked for.
|
|
87
|
+
*
|
|
88
|
+
* It used to apply both, which made the node capacities decorative: the
|
|
89
|
+
* endpoint gate is one object per provider+baseUrl, so three nodes on one
|
|
90
|
+
* opencoti ran strictly one agent at a time however they were configured.
|
|
91
|
+
* Measured on pandorum 2026-09-22 -- three agents, 80s/108s/148s, each
|
|
92
|
+
* starting only as the one before it finished.
|
|
93
|
+
*
|
|
94
|
+
* The server refusing is the backstop, and it is the right one: it knows
|
|
95
|
+
* its own admission, and we do not.
|
|
96
|
+
*/
|
|
97
|
+
run<T>(fn: () => Promise<T>): Promise<T>;
|
|
98
|
+
/** Idempotent: the first call frees the slot. */
|
|
99
|
+
release(): void;
|
|
100
|
+
/** The engine took the agent; see {@link PlacementLease.admitted}. */
|
|
101
|
+
admitted(): void;
|
|
102
|
+
/**
|
|
103
|
+
* The engine refused the agent before admitting it. Frees the slot and
|
|
104
|
+
* holds the node; see {@link PlacementLease.refused}.
|
|
105
|
+
*/
|
|
106
|
+
refused(holdMs?: number): void;
|
|
107
|
+
/**
|
|
108
|
+
* This node could not be reached at all; leave it out of the rotation for
|
|
109
|
+
* a cool-off. See {@link AgentPlacementQueue.markUnreachable}.
|
|
110
|
+
*
|
|
111
|
+
* `coolOffMs` overrides the default, for a condition that heals on a
|
|
112
|
+
* different scale -- a model the server does not have, which no amount of
|
|
113
|
+
* waiting fixes on its own.
|
|
114
|
+
*/
|
|
115
|
+
markUnreachable(coolOffMs?: number): void;
|
|
116
|
+
}
|
|
117
|
+
export interface AgentNodePlacement {
|
|
118
|
+
/** The node for the next agent, waiting for one when all are full. */
|
|
119
|
+
place(signal?: AbortSignal, options?: AcquireOptions): Promise<PlacedAgentNode>;
|
|
120
|
+
/** The session's own delegated connection, for callers that skip placement. */
|
|
121
|
+
base: DelegatedAgentConfigProvider;
|
|
122
|
+
occupancy(): ReadonlyMap<string, number>;
|
|
123
|
+
/**
|
|
124
|
+
* Whether a node other than `nodeId` has room now; see the queue's
|
|
125
|
+
* `hasRoomElsewhere`. Optional for hand-built placements in tests.
|
|
126
|
+
*/
|
|
127
|
+
hasRoomElsewhere?(nodeId: string): boolean;
|
|
128
|
+
readonly waiting: number;
|
|
129
|
+
/**
|
|
130
|
+
* Every node as the lead's status tool reports it: what it runs, how full
|
|
131
|
+
* it is, and whether it is out of rotation. Optional for hand-built
|
|
132
|
+
* placements in tests.
|
|
133
|
+
*/
|
|
134
|
+
describe?(): AgentNodeStatus[];
|
|
135
|
+
}
|
|
136
|
+
/** One node, for `agents_status`. */
|
|
137
|
+
export interface AgentNodeStatus {
|
|
138
|
+
nodeId: string;
|
|
139
|
+
label?: string;
|
|
140
|
+
priority: number;
|
|
141
|
+
providerId?: string;
|
|
142
|
+
modelId?: string;
|
|
143
|
+
baseUrl?: string;
|
|
144
|
+
/** The node's provider config: its PolyKV section, when it has one. */
|
|
145
|
+
providerConfig?: unknown;
|
|
146
|
+
capacity: number;
|
|
147
|
+
running: number;
|
|
148
|
+
/** Out of rotation until then: not answering, or without its model. */
|
|
149
|
+
downUntil?: number;
|
|
150
|
+
/** Held after a refusal until then. */
|
|
151
|
+
heldUntil?: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* `undefined` when no node is configured, which is every session that predates
|
|
155
|
+
* this: the caller then takes the single delegated connection it always took.
|
|
156
|
+
*/
|
|
157
|
+
export declare function createAgentNodePlacement(input: {
|
|
158
|
+
nodes: readonly AgentNodeRuntimeConfig[];
|
|
159
|
+
base: DelegatedAgentConfigProvider;
|
|
160
|
+
}): AgentNodePlacement | undefined;
|