@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,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The queue in front of {@link placeAgent}: every tier full means wait.
|
|
3
|
+
*
|
|
4
|
+
* §9h's ruling. A swarm of thirty against twenty slots completes, more slowly;
|
|
5
|
+
* refusing would make a swarm larger than total capacity partly fail, and a
|
|
6
|
+
* bounded wait only moves where that failure happens.
|
|
7
|
+
*
|
|
8
|
+
* Two consequences the queue exists to get right:
|
|
9
|
+
*
|
|
10
|
+
* - **It drains in spawn order.** An agent asked for first starts first. A
|
|
11
|
+
* newcomer never jumps a waiter, and it could not usefully try: while
|
|
12
|
+
* anyone is waiting, every node is full, because a free slot would already
|
|
13
|
+
* have gone to them.
|
|
14
|
+
* - **It dequeues by the live-occupancy rule, not by where the last agent
|
|
15
|
+
* went.** Each freed slot runs {@link placeAgent} again for the head of the
|
|
16
|
+
* queue, so a slot freed in tier 1 takes the head of the queue back up to
|
|
17
|
+
* tier 1 rather than leaving it for tier 2 to fill.
|
|
18
|
+
*
|
|
19
|
+
* - **A PolyKV node is paced by admission, one agent at a time.** A node
|
|
20
|
+
* with no ceiling whose engine admits each agent (`Infinity` with
|
|
21
|
+
* `pacedAdmission`: a PolyKV opencoti) takes one agent, and the next only once the engine has
|
|
22
|
+
* admitted that one -- its first output is the proof. Before this an
|
|
23
|
+
* uncapped node "had room" by definition, so at t=0 every queued agent was
|
|
24
|
+
* leased to it and waited inside the engine instead of here. Measured in
|
|
25
|
+
* the 75-agent sx4bp run (2026-09-23): two opencoti nodes took all 75 at
|
|
26
|
+
* once, and an ollama node that finished its one agent in 66 s sat idle for
|
|
27
|
+
* the rest of the run with 70 agents queued -- queued on a node, not here.
|
|
28
|
+
* - **A spawn that fails goes back to the head.** A lease given back through
|
|
29
|
+
* {@link AcquireOptions.front} is re-placed before any waiter, so an agent
|
|
30
|
+
* that was refused or landed on a dead node keeps its place in the FIFO.
|
|
31
|
+
*
|
|
32
|
+
* The occupancy it keeps is its own ledger of leases: a node's capacity is a
|
|
33
|
+
* count of agents *we* may run on it -- its Parallel Sessions setting, or for
|
|
34
|
+
* opencoti the sub-pools inside its one session -- so what we have put there
|
|
35
|
+
* is the measure that capacity is stated in.
|
|
36
|
+
*/
|
|
37
|
+
import { type AgentNode } from "./agent-placement";
|
|
38
|
+
export interface PlacementLease {
|
|
39
|
+
nodeId: string;
|
|
40
|
+
/** Frees the slot. Safe to call more than once; only the first counts. */
|
|
41
|
+
release(): void;
|
|
42
|
+
/**
|
|
43
|
+
* The engine took this agent: its first output arrived.
|
|
44
|
+
*
|
|
45
|
+
* On an uncapped node this is what opens the node to the next agent.
|
|
46
|
+
* Idempotent, and a no-op on a capped node, whose room is its count.
|
|
47
|
+
*/
|
|
48
|
+
admitted(): void;
|
|
49
|
+
/**
|
|
50
|
+
* The engine refused this agent before admitting it. The node takes no
|
|
51
|
+
* one else until one of its agents finishes or `holdMs` passes, whichever
|
|
52
|
+
* is first -- capped or not: a count says nothing about what the engine
|
|
53
|
+
* will take. Frees the slot, like {@link release}.
|
|
54
|
+
*/
|
|
55
|
+
refused(holdMs?: number): void;
|
|
56
|
+
}
|
|
57
|
+
export interface AcquireOptions {
|
|
58
|
+
/**
|
|
59
|
+
* Go before every waiter: an agent coming back from a spawn that failed.
|
|
60
|
+
* It was first in the queue when it was placed, and a refusal is not a
|
|
61
|
+
* reason to lose that.
|
|
62
|
+
*/
|
|
63
|
+
front?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* A node to place this agent anywhere but, when another has room: the one
|
|
66
|
+
* the lead requeued it off for being slow or misbehaving. Deprioritised,
|
|
67
|
+
* not banned -- with no other room it still goes there rather than wait.
|
|
68
|
+
*/
|
|
69
|
+
avoid?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The one node this agent may take: an agent resumed on the transcript it
|
|
72
|
+
* produced there. It waits for that node, and while it waits, agents that
|
|
73
|
+
* can go elsewhere are not held up behind it.
|
|
74
|
+
*/
|
|
75
|
+
only?: string;
|
|
76
|
+
}
|
|
77
|
+
/** One node as the queue sees it, for the lead's status report. */
|
|
78
|
+
export interface PlacementNodeState {
|
|
79
|
+
nodeId: string;
|
|
80
|
+
capacity: number;
|
|
81
|
+
running: number;
|
|
82
|
+
/** Out of rotation (not answering, or without the model) until then. */
|
|
83
|
+
downUntil?: number;
|
|
84
|
+
/** Held after a refusal until then. */
|
|
85
|
+
heldUntil?: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* How long a refused node is held when the engine gave no time.
|
|
89
|
+
*
|
|
90
|
+
* Short: a refusal describes this moment, and it usually ends when one of the
|
|
91
|
+
* node's own agents finishes, which reopens it at once. This is only the
|
|
92
|
+
* fallback for a refusal with nothing of ours running there to finish.
|
|
93
|
+
*/
|
|
94
|
+
export declare const NODE_REFUSED_HOLD_MS = 5000;
|
|
95
|
+
/**
|
|
96
|
+
* How long a node that could not be reached is left out of the rotation.
|
|
97
|
+
*
|
|
98
|
+
* Long enough that a dead LAN box is not retried on every spawn -- with
|
|
99
|
+
* round-robin that is once a lap, each costing a connect timeout -- and short
|
|
100
|
+
* enough that a box which came back is used again within one agent's work.
|
|
101
|
+
*/
|
|
102
|
+
export declare const NODE_COOL_OFF_MS = 30000;
|
|
103
|
+
/**
|
|
104
|
+
* How often a node in its cool-off is asked whether it is back.
|
|
105
|
+
*
|
|
106
|
+
* The cool-off is an upper bound, not a sentence. Measured on 1tmrl: the
|
|
107
|
+
* opencoti server behind Node1 restarted and was listening again ten seconds
|
|
108
|
+
* later, and the node sat out the rest of the 30 s regardless. A node whose
|
|
109
|
+
* `/health` answers is put back at once; one that never answers still comes
|
|
110
|
+
* back when the cool-off ends, as before.
|
|
111
|
+
*/
|
|
112
|
+
export declare const NODE_PROBE_INTERVAL_MS = 5000;
|
|
113
|
+
/**
|
|
114
|
+
* The cool-off for a node whose model is not on its server.
|
|
115
|
+
*
|
|
116
|
+
* Longer, because the two conditions heal on different scales. A box that was
|
|
117
|
+
* unplugged can be back in thirty seconds; a model tag that the server has
|
|
118
|
+
* never heard of does not appear on its own, and until someone pulls it every
|
|
119
|
+
* agent sent there dies the same way. Measured on pandorum 2026-09-22: a node
|
|
120
|
+
* configured for `ornith-27b_tb:iq4_xs-128k` against a server holding 193
|
|
121
|
+
* models and not that one, killing two agents of a five-agent fan-out and
|
|
122
|
+
* taking a third when the lead retried.
|
|
123
|
+
*
|
|
124
|
+
* Still a cool-off rather than a removal: `ollama pull` during a long session
|
|
125
|
+
* is an ordinary thing to do, and a node that is out for good would stay out
|
|
126
|
+
* after the user fixed it.
|
|
127
|
+
*/
|
|
128
|
+
export declare const NODE_MODEL_MISSING_COOL_OFF_MS = 600000;
|
|
129
|
+
/**
|
|
130
|
+
* How many nodes one agent may be placed on before its failure is its own.
|
|
131
|
+
*
|
|
132
|
+
* Bounded rather than "every node": a request that fails the same way
|
|
133
|
+
* everywhere -- a malformed tool schema, an oversized prompt -- would
|
|
134
|
+
* otherwise walk the whole rotation and take every node out of it on the way
|
|
135
|
+
* past. Three is enough to step over a misconfigured node in any realistic
|
|
136
|
+
* setup and small enough that a systematic failure is reported as one.
|
|
137
|
+
*/
|
|
138
|
+
export declare const MAX_NODE_PLACEMENT_ATTEMPTS = 3;
|
|
139
|
+
export interface AgentPlacementQueue {
|
|
140
|
+
/**
|
|
141
|
+
* A slot on the best node with room, waiting for one if none has.
|
|
142
|
+
*
|
|
143
|
+
* Rejects only when `signal` aborts, or when no node could ever take an
|
|
144
|
+
* agent -- see {@link NoAgentCapacityError}.
|
|
145
|
+
*/
|
|
146
|
+
acquire(signal?: AbortSignal, options?: AcquireOptions): Promise<PlacementLease>;
|
|
147
|
+
/**
|
|
148
|
+
* Would an agent be placed on a node other than `nodeId` right now?
|
|
149
|
+
*
|
|
150
|
+
* Asked by an admitted agent that `nodeId` has just refused a turn: if
|
|
151
|
+
* another node has room it moves there, by the queue's own priority order,
|
|
152
|
+
* instead of waiting on the node that said no. Nothing is taken; the move
|
|
153
|
+
* itself goes through {@link acquire} at the front of the queue.
|
|
154
|
+
*/
|
|
155
|
+
hasRoomElsewhere(nodeId: string): boolean;
|
|
156
|
+
/** Agents waiting for a slot, for a status line. */
|
|
157
|
+
readonly waiting: number;
|
|
158
|
+
/** Node id to agents running on it now. A copy. */
|
|
159
|
+
occupancy(): ReadonlyMap<string, number>;
|
|
160
|
+
/** Every node's capacity, load and holds, for a status line. */
|
|
161
|
+
nodeStates(): PlacementNodeState[];
|
|
162
|
+
/**
|
|
163
|
+
* Take a node out of the rotation for a cool-off.
|
|
164
|
+
*
|
|
165
|
+
* Called when an agent could not reach it at all -- a refused connection,
|
|
166
|
+
* an unknown host -- never for a refusal or an ordinary model error, which
|
|
167
|
+
* say the node is alive and answering.
|
|
168
|
+
*
|
|
169
|
+
* The exception is a model the server does not have. That is an answer,
|
|
170
|
+
* so it is not unreachable, but it is a node that cannot run anything
|
|
171
|
+
* until its configuration changes: see
|
|
172
|
+
* {@link NODE_MODEL_MISSING_COOL_OFF_MS}, which callers pass as
|
|
173
|
+
* `coolOffMs`.
|
|
174
|
+
*/
|
|
175
|
+
markUnreachable(nodeId: string, coolOffMs?: number): void;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* No node has any capacity at all, so waiting would never end.
|
|
179
|
+
*
|
|
180
|
+
* Distinct from full on purpose. Full is a state that ends when an agent
|
|
181
|
+
* finishes; every node configured to zero is a configuration, and an agent
|
|
182
|
+
* queued behind it would hang the spawn for the life of the session.
|
|
183
|
+
*/
|
|
184
|
+
export declare class NoAgentCapacityError extends Error {
|
|
185
|
+
constructor();
|
|
186
|
+
}
|
|
187
|
+
export declare function createAgentPlacementQueue(configuredNodes: readonly AgentNode[], options?: {
|
|
188
|
+
/** Injected so the cool-off can be tested without waiting for it. */
|
|
189
|
+
now?: () => number;
|
|
190
|
+
/** Injected for the same reason; returns a canceller. */
|
|
191
|
+
schedule?: (fn: () => void, ms: number) => void;
|
|
192
|
+
/**
|
|
193
|
+
* Is this node answering again? Asked every
|
|
194
|
+
* {@link NODE_PROBE_INTERVAL_MS} while the node sits out an
|
|
195
|
+
* unreachable cool-off; `true` puts it back in rotation at once.
|
|
196
|
+
*/
|
|
197
|
+
probe?: (nodeId: string) => Promise<boolean>;
|
|
198
|
+
probeIntervalMs?: number;
|
|
199
|
+
}): AgentPlacementQueue;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the next delegated agent runs.
|
|
3
|
+
*
|
|
4
|
+
* A **node** is a complete agents provider configuration — its own endpoint,
|
|
5
|
+
* model, context window, sampler and budget — so a set of nodes is
|
|
6
|
+
* heterogeneous by design: one on Anthropic, one on opencoti, one on a LAN
|
|
7
|
+
* ollama, one on llama.cpp. What this module decides is only which of them
|
|
8
|
+
* takes the next agent.
|
|
9
|
+
*
|
|
10
|
+
* Two rules, and the second is the one that is easy to get wrong.
|
|
11
|
+
*
|
|
12
|
+
* **Priority is a rank, 1 highest**, and a lower tier is used only when no node
|
|
13
|
+
* in a higher one has room. Within a tier, round-robin.
|
|
14
|
+
*
|
|
15
|
+
* **A tier is full when its nodes have no free slot right now** — live
|
|
16
|
+
* occupancy, never a count of what has been spawned. The difference shows up
|
|
17
|
+
* the moment a higher-tier agent finishes: the next spawn must go back up to
|
|
18
|
+
* the slot it freed. A counter that remembered "we have moved on to tier 2"
|
|
19
|
+
* would leave that capacity idle for the rest of the run, which is the opposite
|
|
20
|
+
* of overflowing only when necessary.
|
|
21
|
+
*
|
|
22
|
+
* Priority `0` is reserved for the lead conversation's own PolyKV session,
|
|
23
|
+
* whose agents are sub-pools of the window it has already booked. It is a tier
|
|
24
|
+
* like any other here; that it comes first is just what its number means.
|
|
25
|
+
*/
|
|
26
|
+
export interface AgentNode {
|
|
27
|
+
/** Stable identity, used as the occupancy key. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** 1 is highest. `0` is the lead session's own sub-pools. */
|
|
30
|
+
priority: number;
|
|
31
|
+
/**
|
|
32
|
+
* How many agents may run on this node at once.
|
|
33
|
+
*
|
|
34
|
+
* The unit differs by provider and is resolved before it gets here: a
|
|
35
|
+
* parallel-sessions setting for ollama, llama.cpp and the cloud providers;
|
|
36
|
+
* for opencoti, the sub-pools available inside its ONE session, because
|
|
37
|
+
* agents there share the conversation's allocation rather than booking one
|
|
38
|
+
* each.
|
|
39
|
+
*
|
|
40
|
+
* `0` means the node is off and is never placed on. `Infinity` means the
|
|
41
|
+
* endpoint decides its own admission and this layer must not be the bound —
|
|
42
|
+
* which is what an elastic or PolyKV opencoti resolves to when the
|
|
43
|
+
* profile's parallel-sessions box is left empty. The two are opposite
|
|
44
|
+
* readings of "no number", so they are spelled differently on purpose.
|
|
45
|
+
*/
|
|
46
|
+
capacity: number;
|
|
47
|
+
/**
|
|
48
|
+
* An uncapped node whose engine admits each agent itself: opencoti with
|
|
49
|
+
* PolyKV pools. Only such a node is paced one agent at a time (see
|
|
50
|
+
* `agent-placement-queue`); an elastic node without pools, or any node the
|
|
51
|
+
* host did not mark, takes its agents together.
|
|
52
|
+
*/
|
|
53
|
+
pacedAdmission?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** The tier that is the lead conversation's own PolyKV session (§9g). */
|
|
56
|
+
export declare const LEAD_PRIORITY = 0;
|
|
57
|
+
/**
|
|
58
|
+
* Priority 0's capacity: 8 sub-pools of the lead's one session -- the engine's
|
|
59
|
+
* per-session limit, and the ruled cap (PLANS §9g, 2026-09-25).
|
|
60
|
+
*/
|
|
61
|
+
export declare const LEAD_SUBPOOL_CAPACITY = 8;
|
|
62
|
+
/**
|
|
63
|
+
* A node's capacity with priority 0's cap applied.
|
|
64
|
+
*
|
|
65
|
+
* Only the lead tier is capped. It is always a bounded thing -- sub-pools of
|
|
66
|
+
* one window -- so `Infinity` ("the endpoint decides") cannot apply to it: the
|
|
67
|
+
* endpoint deciding is what filled the lead's window and lost 49 of 51 agents
|
|
68
|
+
* (991ce2466). `0` stays off. Every other tier is left as configured, where
|
|
69
|
+
* `Infinity` keeps meaning the endpoint decides.
|
|
70
|
+
*/
|
|
71
|
+
export declare function capLeadTier<T extends AgentNode>(node: T): T;
|
|
72
|
+
export type Placement = {
|
|
73
|
+
kind: "node";
|
|
74
|
+
nodeId: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Nothing has room. The agent waits rather than failing: a swarm larger
|
|
78
|
+
* than total capacity should complete slowly, not partly fail.
|
|
79
|
+
*/
|
|
80
|
+
| {
|
|
81
|
+
kind: "queued";
|
|
82
|
+
};
|
|
83
|
+
export interface PlacementState {
|
|
84
|
+
/**
|
|
85
|
+
* Where the round-robin left off, per tier.
|
|
86
|
+
*
|
|
87
|
+
* Per tier rather than global: advancing through tier 2 must not skip a
|
|
88
|
+
* node in tier 1 the next time tier 1 has room.
|
|
89
|
+
*/
|
|
90
|
+
readonly cursors: Readonly<Record<number, number>>;
|
|
91
|
+
}
|
|
92
|
+
export declare function emptyPlacementState(): PlacementState;
|
|
93
|
+
/**
|
|
94
|
+
* Pick a node for one agent, given what is running right now.
|
|
95
|
+
*
|
|
96
|
+
* Pure: `occupancy` is the caller's live view and `state` carries only the
|
|
97
|
+
* round-robin cursors, so the same inputs always give the same answer and the
|
|
98
|
+
* decision can be tested without a server.
|
|
99
|
+
*/
|
|
100
|
+
export declare function placeAgent(input: {
|
|
101
|
+
nodes: readonly AgentNode[];
|
|
102
|
+
/** Node id to agents currently running on it. Missing means none. */
|
|
103
|
+
occupancy: ReadonlyMap<string, number>;
|
|
104
|
+
state: PlacementState;
|
|
105
|
+
/**
|
|
106
|
+
* Node id to the moment its cool-off ends, for nodes that could not be
|
|
107
|
+
* reached. Missing or past means the node is in play.
|
|
108
|
+
*
|
|
109
|
+
* §9i.2. One dead LAN box should not be retried on every spawn for the
|
|
110
|
+
* life of the session -- each retry costs a connect timeout, and with
|
|
111
|
+
* round-robin it costs one per lap.
|
|
112
|
+
*/
|
|
113
|
+
downUntil?: ReadonlyMap<string, number>;
|
|
114
|
+
now?: number;
|
|
115
|
+
}): {
|
|
116
|
+
placement: Placement;
|
|
117
|
+
state: PlacementState;
|
|
118
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a delegated agent reports, and how the lead reads it.
|
|
3
|
+
*
|
|
4
|
+
* A round's reports went to the lead whole, as one tool result, and the
|
|
5
|
+
* transcript sends at most 32,000 characters of any tool result, cut from the
|
|
6
|
+
* middle. On pandorum 2026-09-24 a round of 75 returned 209,219 characters,
|
|
7
|
+
* and the lead was shown the first 11 and the last 15 reports: "the harness
|
|
8
|
+
* truncated the middle of the 75-report output".
|
|
9
|
+
*
|
|
10
|
+
* So each agent now hands back a short summary it writes itself once it is
|
|
11
|
+
* done, and its full report is kept here. The lead gets the summaries -- every
|
|
12
|
+
* agent represented -- and reads a full report when it wants one, a page at a
|
|
13
|
+
* time, the way it reads a large file.
|
|
14
|
+
*/
|
|
15
|
+
import type { AgentResult, AgentTool } from "@cerebriline/shared";
|
|
16
|
+
/** The longest summary the lead is handed per agent. */
|
|
17
|
+
export declare const AGENT_SUMMARY_MAX_CHARS = 1000;
|
|
18
|
+
/** A page of a report, at most, as `read_files` pages a file. */
|
|
19
|
+
export declare const AGENT_REPORT_PAGE_LINES = 200;
|
|
20
|
+
export declare const AGENT_REPORT_PAGE_CHARS = 12000;
|
|
21
|
+
export declare const READ_AGENT_REPORT_TOOL_NAME = "read_agent_report";
|
|
22
|
+
export declare const AGENT_SUMMARY_PROMPT: string;
|
|
23
|
+
/**
|
|
24
|
+
* Keep an agent's full report under its name, for the lead's session.
|
|
25
|
+
*
|
|
26
|
+
* Returns the name it is filed under: a name already used in this session gets
|
|
27
|
+
* a suffix, so an agent of the next round does not replace one the lead may
|
|
28
|
+
* still want to read.
|
|
29
|
+
*/
|
|
30
|
+
export declare function recordAgentReport(sessionId: string | undefined, name: string, text: string): string;
|
|
31
|
+
/** Forget a session's reports, with the session. */
|
|
32
|
+
export declare function clearAgentReports(sessionId: string | undefined): void;
|
|
33
|
+
/** A page of a report, numbered, with where to read on from. */
|
|
34
|
+
export declare function readAgentReport(sessionId: string | undefined, name: string, startLine?: number): string;
|
|
35
|
+
/** The lead's way into a full report. */
|
|
36
|
+
export declare function createReadAgentReportTool(): AgentTool;
|
|
37
|
+
/**
|
|
38
|
+
* The agent's result as the lead is to receive it: a summary the agent wrote,
|
|
39
|
+
* and where its full report is filed. A report already under the limit is its
|
|
40
|
+
* own summary, and costs no extra turn.
|
|
41
|
+
*
|
|
42
|
+
* `summarize` asks the agent itself -- one more turn on the conversation that
|
|
43
|
+
* produced the report, which is the only party that knows what mattered in it.
|
|
44
|
+
* A failed or empty summary falls back to the report's opening.
|
|
45
|
+
*/
|
|
46
|
+
export declare function summarizeForLead(input: {
|
|
47
|
+
sessionId: string | undefined;
|
|
48
|
+
name: string;
|
|
49
|
+
result: AgentResult;
|
|
50
|
+
summarize: (prompt: string) => Promise<{
|
|
51
|
+
text: string;
|
|
52
|
+
}>;
|
|
53
|
+
}): Promise<AgentResult>;
|