@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,83 @@
|
|
|
1
|
+
import type { AgentResult, ITelemetryService } from "@cerebriline/shared";
|
|
2
|
+
import type { HookEventPayload } from "../../hooks";
|
|
3
|
+
import type { RuntimeCapabilities } from "../../runtime/capabilities";
|
|
4
|
+
import type { PendingPromptsServiceApi, RestoreSessionInput, RestoreSessionResult, RuntimeHost, RuntimeHostSubscribeOptions, SendSessionInput, SessionConnectionUpdate, SessionUsageSummary, StartSessionInput, StartSessionResult } from "../../runtime/host/runtime-host";
|
|
5
|
+
import { type SessionCompactionState } from "../../session/models/session-compaction";
|
|
6
|
+
import type { CoreSettingsListInput, CoreSettingsMutationResult, CoreSettingsSnapshot, CoreSettingsToggleInput } from "../../settings";
|
|
7
|
+
import type { CoreSessionEvent } from "../../types/events";
|
|
8
|
+
import type { SessionRecord } from "../../types/sessions";
|
|
9
|
+
export interface HubRuntimeHostOptions {
|
|
10
|
+
url: string;
|
|
11
|
+
authToken?: string;
|
|
12
|
+
clientType?: string;
|
|
13
|
+
displayName?: string;
|
|
14
|
+
capabilities?: RuntimeCapabilities;
|
|
15
|
+
telemetry?: ITelemetryService;
|
|
16
|
+
}
|
|
17
|
+
export declare class HubRuntimeHost implements RuntimeHost {
|
|
18
|
+
runtimeAddress: string;
|
|
19
|
+
readonly pendingPrompts: PendingPromptsServiceApi;
|
|
20
|
+
private client;
|
|
21
|
+
private readonly clientOptions;
|
|
22
|
+
private readonly clientContext?;
|
|
23
|
+
private readonly events;
|
|
24
|
+
private readonly sessionCapabilities;
|
|
25
|
+
private readonly sessionClientContributionHandlers;
|
|
26
|
+
private readonly sessionSubscriptions;
|
|
27
|
+
private readonly pendingApprovalToolCallIds;
|
|
28
|
+
private readonly agentDoneEmittedForCurrentRunBySession;
|
|
29
|
+
private readonly activeCapabilityAbortControllers;
|
|
30
|
+
private readonly defaultCapabilities;
|
|
31
|
+
private readonly telemetry?;
|
|
32
|
+
constructor(options: HubRuntimeHostOptions, clientContext?: {
|
|
33
|
+
workspaceRoot?: string;
|
|
34
|
+
cwd?: string;
|
|
35
|
+
});
|
|
36
|
+
private createClient;
|
|
37
|
+
private replaceClient;
|
|
38
|
+
private recoverLocalHubStartupDeadlock;
|
|
39
|
+
private registerPlannedSession;
|
|
40
|
+
private cleanupPlannedSession;
|
|
41
|
+
connect(): Promise<void>;
|
|
42
|
+
startSession(input: StartSessionInput): Promise<StartSessionResult>;
|
|
43
|
+
restoreSession(input: RestoreSessionInput): Promise<RestoreSessionResult>;
|
|
44
|
+
runTurn(input: SendSessionInput): Promise<AgentResult | undefined>;
|
|
45
|
+
private requestPendingPromptsList;
|
|
46
|
+
private requestPendingPromptUpdate;
|
|
47
|
+
private requestPendingPromptDelete;
|
|
48
|
+
getAccumulatedUsage(sessionId: string): Promise<SessionUsageSummary | undefined>;
|
|
49
|
+
abort(sessionId: string, reason?: unknown): Promise<void>;
|
|
50
|
+
proceedWhileRunning(sessionId: string, toolCallId?: string): Promise<number>;
|
|
51
|
+
stopSession(sessionId: string): Promise<void>;
|
|
52
|
+
dispose(): Promise<void>;
|
|
53
|
+
getSession(sessionId: string): Promise<SessionRecord | undefined>;
|
|
54
|
+
listSessions(limit?: number): Promise<SessionRecord[]>;
|
|
55
|
+
listSettings(input?: CoreSettingsListInput): Promise<CoreSettingsSnapshot>;
|
|
56
|
+
toggleSetting(input: CoreSettingsToggleInput): Promise<CoreSettingsMutationResult>;
|
|
57
|
+
deleteSession(sessionId: string): Promise<boolean>;
|
|
58
|
+
updateSession(sessionId: string, updates: {
|
|
59
|
+
prompt?: string | null;
|
|
60
|
+
metadata?: Record<string, unknown> | null;
|
|
61
|
+
title?: string | null;
|
|
62
|
+
}): Promise<{
|
|
63
|
+
updated: boolean;
|
|
64
|
+
}>;
|
|
65
|
+
updateSessionConnection(sessionId: string, updates: SessionConnectionUpdate): Promise<void>;
|
|
66
|
+
updateSessionCompactionState(sessionId: string, state: SessionCompactionState): Promise<{
|
|
67
|
+
updated: boolean;
|
|
68
|
+
}>;
|
|
69
|
+
readSessionCompactionState(sessionId: string): Promise<SessionCompactionState | undefined>;
|
|
70
|
+
readSessionMessages(sessionId: string): Promise<import("@cerebriline/llms").MessageWithMetadata[]>;
|
|
71
|
+
dispatchHookEvent(_payload: HookEventPayload): Promise<void>;
|
|
72
|
+
subscribe(listener: (event: CoreSessionEvent) => void, options?: RuntimeHostSubscribeOptions): () => void;
|
|
73
|
+
private ensureSessionSubscription;
|
|
74
|
+
private disposeSessionSubscription;
|
|
75
|
+
private resolveCapabilities;
|
|
76
|
+
private emitToolCallContentStart;
|
|
77
|
+
private emitAgentDoneIfNeeded;
|
|
78
|
+
private handleHubEvent;
|
|
79
|
+
private captureDetachedHubEventError;
|
|
80
|
+
private handleCapabilityRequest;
|
|
81
|
+
private handleCapabilityResolved;
|
|
82
|
+
private handleApprovalRequested;
|
|
83
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HubRuntimeHost, type HubRuntimeHostOptions } from "./hub-runtime-host";
|
|
2
|
+
export interface RemoteRuntimeHostOptions extends Omit<HubRuntimeHostOptions, "url"> {
|
|
3
|
+
endpoint: string;
|
|
4
|
+
workspaceRoot?: string;
|
|
5
|
+
cwd?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class RemoteRuntimeHost extends HubRuntimeHost {
|
|
8
|
+
constructor(options: RemoteRuntimeHostOptions);
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ITelemetryService } from "@cerebriline/shared";
|
|
2
|
+
import type { HubCommandTransport } from "./command-transport";
|
|
3
|
+
export interface BrowserHubSocketLike {
|
|
4
|
+
send(data: string): void;
|
|
5
|
+
addEventListener(type: "message", listener: (event: {
|
|
6
|
+
data: string;
|
|
7
|
+
}) => void): void;
|
|
8
|
+
addEventListener(type: "close", listener: () => void): void;
|
|
9
|
+
removeEventListener(type: "message", listener: (event: {
|
|
10
|
+
data: string;
|
|
11
|
+
}) => void): void;
|
|
12
|
+
removeEventListener(type: "close", listener: () => void): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class BrowserWebSocketHubAdapter {
|
|
15
|
+
private readonly transport;
|
|
16
|
+
private readonly telemetry?;
|
|
17
|
+
private readonly workspaceRoot?;
|
|
18
|
+
constructor(transport: HubCommandTransport, telemetry?: ITelemetryService | undefined, workspaceRoot?: string | undefined);
|
|
19
|
+
attach(socket: BrowserHubSocketLike, options?: {
|
|
20
|
+
allowRegisteredWorkspace?: boolean;
|
|
21
|
+
}): () => void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HubClientRegistration, HubCommandEnvelope, HubEventEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
/** Authority captured once by an authenticated transport connection. */
|
|
3
|
+
export interface HubConnectionAuthority {
|
|
4
|
+
clientId: string;
|
|
5
|
+
workspaceContext?: HubClientRegistration["workspaceContext"];
|
|
6
|
+
/**
|
|
7
|
+
* Token-authenticated connections may already bind any workspace at
|
|
8
|
+
* registration time, so they are also allowed to explicitly request
|
|
9
|
+
* cross-workspace schedule access (`allWorkspaces` command payloads).
|
|
10
|
+
*/
|
|
11
|
+
crossWorkspace?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface HubCommandTransport {
|
|
14
|
+
command(envelope: HubCommandEnvelope,
|
|
15
|
+
/** `null` means the remote connection has not registered yet. */
|
|
16
|
+
authority?: HubConnectionAuthority | null): Promise<HubReplyEnvelope>;
|
|
17
|
+
subscribe(clientId: string, listener: (event: HubEventEnvelope) => void, options?: {
|
|
18
|
+
sessionId?: string;
|
|
19
|
+
}): Promise<() => void> | (() => void);
|
|
20
|
+
/**
|
|
21
|
+
* Durable events with `sequence > sinceSequence` (scoped when a sessionId
|
|
22
|
+
* is given), oldest first, bounded by `limit`. Absent on transports
|
|
23
|
+
* without a durable event log; callers must treat replay as best-effort.
|
|
24
|
+
*/
|
|
25
|
+
replayEventsAfter?(sinceSequence: number, options: {
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
limit: number;
|
|
28
|
+
}): HubEventEnvelope[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubEventEnvelope, HubReplyEnvelope, ToolApprovalRequest } from "@cerebriline/shared";
|
|
2
|
+
import { type HubTransportContext } from "./context";
|
|
3
|
+
export declare function requestToolApproval(ctx: HubTransportContext, request: ToolApprovalRequest): Promise<{
|
|
4
|
+
approved: boolean;
|
|
5
|
+
reason?: string;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* Pending `approval.requested` events, optionally scoped to one session.
|
|
9
|
+
* Re-issued to a (re)subscribing client so an approval raised while nobody
|
|
10
|
+
* was connected — or while this client was disconnected — is neither lost
|
|
11
|
+
* nor implicitly answered.
|
|
12
|
+
*/
|
|
13
|
+
export declare function pendingApprovalEvents(ctx: HubTransportContext, sessionId?: string): HubEventEnvelope[];
|
|
14
|
+
export declare function resolvePendingApproval(ctx: HubTransportContext, approvalId: string, result: {
|
|
15
|
+
approved: boolean;
|
|
16
|
+
reason?: string;
|
|
17
|
+
}): {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
export declare function cancelPendingApprovals(ctx: HubTransportContext, filter: (approval: {
|
|
21
|
+
approvalId: string;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
}) => boolean, reason: string): number;
|
|
24
|
+
export declare function handleApprovalRespond(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
import { type HubTransportContext } from "./context";
|
|
3
|
+
export declare function requestCapability(ctx: HubTransportContext, sessionId: string, capabilityName: string, payload: Record<string, unknown>, targetClientId: string, onProgress?: (payload: Record<string, unknown>) => void): Promise<Record<string, unknown> | undefined>;
|
|
4
|
+
export declare function handleCapabilityProgress(ctx: HubTransportContext, envelope: HubCommandEnvelope): HubReplyEnvelope;
|
|
5
|
+
export declare function cancelPendingCapabilityRequests(ctx: HubTransportContext, filter: (request: {
|
|
6
|
+
requestId: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
targetClientId: string;
|
|
9
|
+
capabilityName: string;
|
|
10
|
+
}) => boolean, reason: string): number;
|
|
11
|
+
export declare function handleCapabilityRequest(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
12
|
+
export declare function handleCapabilityRespond(ctx: HubTransportContext, envelope: HubCommandEnvelope): HubReplyEnvelope;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
import { type HubTransportContext } from "./context";
|
|
3
|
+
export declare function handleClientRegister(ctx: HubTransportContext, envelope: HubCommandEnvelope): HubReplyEnvelope;
|
|
4
|
+
export declare function handleClientUpdate(ctx: HubTransportContext, envelope: HubCommandEnvelope): HubReplyEnvelope;
|
|
5
|
+
export declare function handleClientUnregister(ctx: HubTransportContext, envelope: HubCommandEnvelope, onClientRemoved: (clientId: string) => void): HubReplyEnvelope;
|
|
6
|
+
export declare function handleClientList(ctx: HubTransportContext, envelope: HubCommandEnvelope): HubReplyEnvelope;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConnectorChannelsResponse, HubCommandEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
import { type HubTransportContext } from "./context";
|
|
3
|
+
declare function connectorChannelsPayload(): ConnectorChannelsResponse;
|
|
4
|
+
declare function configureConnector(payload: unknown): ConnectorChannelsResponse;
|
|
5
|
+
declare function deleteConnectorConfig(payload: unknown): ConnectorChannelsResponse;
|
|
6
|
+
declare function startSupervisedConnector(payload: unknown): Promise<import("@cerebriline/shared").ConnectorStartResult>;
|
|
7
|
+
declare function stopSupervisedConnector(payload: unknown): Promise<{
|
|
8
|
+
stopped: boolean;
|
|
9
|
+
channel: string;
|
|
10
|
+
instanceId: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function handleConnectorCommand(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
13
|
+
export declare const __test__: {
|
|
14
|
+
configureConnector: typeof configureConnector;
|
|
15
|
+
connectorChannelsPayload: typeof connectorChannelsPayload;
|
|
16
|
+
deleteConnectorConfig: typeof deleteConnectorConfig;
|
|
17
|
+
startSupervisedConnector: typeof startSupervisedConnector;
|
|
18
|
+
stopSupervisedConnector: typeof stopSupervisedConnector;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { AgentExtension, AgentTool, HubClientRecord, HubCommandEnvelope, HubEventEnvelope, HubReplyEnvelope, SessionRecord as HubSessionRecord, ITelemetryService, JsonValue, SessionParticipant } from "@cerebriline/shared";
|
|
2
|
+
import type { CommandExecutionRuntimeService, PendingPromptsRuntimeService, RuntimeHost, SessionConnectionRuntimeService, SessionUsageRuntimeService } from "../../../runtime/host/runtime-host";
|
|
3
|
+
import type { SessionHistorySearchService } from "../../../session/search";
|
|
4
|
+
import { type CoreSessionSnapshot } from "../../../session/session-snapshot";
|
|
5
|
+
import { type HubSessionState } from "../hub-session-records";
|
|
6
|
+
export type PendingApproval = {
|
|
7
|
+
sessionId: string;
|
|
8
|
+
resolve: (result: {
|
|
9
|
+
approved: boolean;
|
|
10
|
+
reason?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
/**
|
|
13
|
+
* The `approval.requested` event as originally published. Pending
|
|
14
|
+
* approvals survive client disconnects, so a (re)subscribing client is
|
|
15
|
+
* re-issued this event instead of being left with a silently parked turn.
|
|
16
|
+
*/
|
|
17
|
+
requestedEvent?: HubEventEnvelope;
|
|
18
|
+
};
|
|
19
|
+
export type PendingCapabilityRequest = {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
targetClientId: string;
|
|
22
|
+
capabilityName: string;
|
|
23
|
+
onProgress?: (payload: Record<string, unknown>) => void;
|
|
24
|
+
resolve: (result: {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
payload?: Record<string, unknown>;
|
|
27
|
+
error?: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Shared mutable state and helpers passed to every command-handler module.
|
|
32
|
+
* The transport class owns the maps; handlers get a stable read/write surface.
|
|
33
|
+
*/
|
|
34
|
+
export interface HubTransportContext {
|
|
35
|
+
readonly sessionSearch: SessionHistorySearchService;
|
|
36
|
+
readonly clients: Map<string, HubClientRecord>;
|
|
37
|
+
readonly sessionState: Map<string, HubSessionState>;
|
|
38
|
+
readonly pendingApprovals: Map<string, PendingApproval>;
|
|
39
|
+
readonly pendingCapabilityRequests: Map<string, PendingCapabilityRequest>;
|
|
40
|
+
readonly suppressNextTerminalEventBySession: Map<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* Count of RPC-driven turns (`run.start` / session input commands)
|
|
43
|
+
* currently awaiting `sessionHost.runTurn` per session. While > 0 the
|
|
44
|
+
* awaiting handler publishes the authoritative terminal run event, so the
|
|
45
|
+
* session-event projector must not publish its own `run.failed` for
|
|
46
|
+
* agent-level error events emitted during that turn. Turns drained from
|
|
47
|
+
* the pending-prompt queue run with no awaiting RPC handler (count 0), so
|
|
48
|
+
* the projector is their only failure reporter.
|
|
49
|
+
*/
|
|
50
|
+
readonly activeRpcTurnCountBySession: Map<string, number>;
|
|
51
|
+
readonly telemetry?: ITelemetryService;
|
|
52
|
+
/** Hub-owned tools injected into every local session runtime. */
|
|
53
|
+
readonly sessionTools?: readonly AgentTool[];
|
|
54
|
+
/** Hub-owned extensions injected into every local session runtime. */
|
|
55
|
+
readonly sessionExtensions?: readonly AgentExtension[];
|
|
56
|
+
readonly sessionHost: RuntimeHost & Partial<CommandExecutionRuntimeService & PendingPromptsRuntimeService & SessionUsageRuntimeService & SessionConnectionRuntimeService>;
|
|
57
|
+
/**
|
|
58
|
+
* While draining, new mutating work (session.create, run.*) is refused
|
|
59
|
+
* with the retryable `hub_draining` error so the Hub can be replaced at a
|
|
60
|
+
* boundary an operator chose instead of being ambushed mid-turn.
|
|
61
|
+
* Optional: absent contexts (test fixtures) are never draining.
|
|
62
|
+
*/
|
|
63
|
+
isDraining?(): boolean;
|
|
64
|
+
publish(event: HubEventEnvelope): void;
|
|
65
|
+
buildEvent(event: HubEventEnvelope["event"], payload?: Record<string, unknown>, sessionId?: string): HubEventEnvelope;
|
|
66
|
+
requestCapability(sessionId: string, capabilityName: string, payload: Record<string, unknown>, targetClientId: string, onProgress?: (payload: Record<string, unknown>) => void): Promise<Record<string, unknown> | undefined>;
|
|
67
|
+
}
|
|
68
|
+
type EnvelopeRef = Pick<HubCommandEnvelope, "version" | "requestId">;
|
|
69
|
+
export declare function okReply(envelope: EnvelopeRef, payload?: HubReplyEnvelope["payload"]): HubReplyEnvelope;
|
|
70
|
+
export declare function errorReply(envelope: EnvelopeRef, code: string, message: string): HubReplyEnvelope;
|
|
71
|
+
/** Returns the value when it's a plain object, or undefined otherwise. */
|
|
72
|
+
export declare function asPlainRecord(value: unknown): Record<string, JsonValue | undefined> | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Pulls the session id from the envelope. Handlers accept either
|
|
75
|
+
* `payload.sessionId` (top-level command argument) or `envelope.sessionId`
|
|
76
|
+
* (envelope-level addressing). Returns "" when neither is present so handlers
|
|
77
|
+
* can branch on truthiness.
|
|
78
|
+
*/
|
|
79
|
+
export declare function extractSessionId(envelope: HubCommandEnvelope): string;
|
|
80
|
+
export declare function buildHubEvent(event: HubEventEnvelope["event"], payload?: Record<string, unknown>, sessionId?: string): HubEventEnvelope;
|
|
81
|
+
export declare function readHubSessionRecord(ctx: HubTransportContext, sessionId: string): Promise<HubSessionRecord | undefined>;
|
|
82
|
+
/**
|
|
83
|
+
* Builds the snapshot that rides on hub events and command replies. It is a
|
|
84
|
+
* state notification — status, usage, model, workspace, checkpoint — and
|
|
85
|
+
* deliberately does NOT read the transcript: `snapshot.messages` here would
|
|
86
|
+
* put the entire conversation on every status flip, for every subscriber,
|
|
87
|
+
* and into the durable event log (observed in the wild as a 25GB hub process
|
|
88
|
+
* feeding a slow reader). Anything that needs messages fetches them with the
|
|
89
|
+
* `session.messages` command.
|
|
90
|
+
*/
|
|
91
|
+
export declare function readCoreSessionSnapshot(ctx: HubTransportContext, sessionId: string): Promise<CoreSessionSnapshot | undefined>;
|
|
92
|
+
export declare function ensureSessionState(ctx: HubTransportContext, sessionId: string, clientId: string, role: SessionParticipant["role"], options?: {
|
|
93
|
+
interactive?: boolean;
|
|
94
|
+
}): HubSessionState;
|
|
95
|
+
export declare function ensureSessionParticipant(ctx: HubTransportContext, sessionId: string, clientId: string, role: SessionParticipant["role"], options?: {
|
|
96
|
+
interactive?: boolean;
|
|
97
|
+
}): HubSessionState;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
import { type HubTransportContext } from "./context";
|
|
3
|
+
export declare function handleSessionInput(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
4
|
+
export declare function handleRunAbort(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
5
|
+
export declare function handleRunProceedWhileRunning(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
6
|
+
export declare function handleSessionHook(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Queue-backed run admission (`run.enqueue`), queue introspection
|
|
3
|
+
* (`run.list`), and drain lifecycle (`hub.drain`, `hub.status`).
|
|
4
|
+
*
|
|
5
|
+
* `run.start` keeps its historical synchronous-reply contract untouched;
|
|
6
|
+
* `run.enqueue` is the additive path with app-server semantics: durable FIFO
|
|
7
|
+
* admission, an immediate `{runId, acceptedAt, queuePosition}` ack, and
|
|
8
|
+
* execution that never depends on the requesting socket staying alive.
|
|
9
|
+
*/
|
|
10
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
11
|
+
import { type HubRunQueue } from "../hub-run-queue";
|
|
12
|
+
import { type HubTransportContext } from "./context";
|
|
13
|
+
export declare const HUB_DRAINING_ERROR_CODE = "hub_draining";
|
|
14
|
+
export declare function isDrainRefusedCommand(command: string): boolean;
|
|
15
|
+
export declare function drainingReply(envelope: HubCommandEnvelope): HubReplyEnvelope;
|
|
16
|
+
/**
|
|
17
|
+
* Serial per-session executor over the durable queue. Admission and
|
|
18
|
+
* execution are decoupled: `enqueue` acks immediately, `pump` runs turns one
|
|
19
|
+
* at a time per session through the same `handleSessionInput` path (and thus
|
|
20
|
+
* the same event projection) as `run.start`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class HubRunExecutor {
|
|
23
|
+
private readonly ctx;
|
|
24
|
+
private readonly queue;
|
|
25
|
+
private readonly activeSessions;
|
|
26
|
+
constructor(ctx: HubTransportContext, queue: HubRunQueue);
|
|
27
|
+
/** Start (or continue) draining the session's queue in the background. */
|
|
28
|
+
pump(sessionId: string): void;
|
|
29
|
+
private drainSession;
|
|
30
|
+
private execute;
|
|
31
|
+
}
|
|
32
|
+
export declare function handleRunEnqueue(ctx: HubTransportContext, envelope: HubCommandEnvelope, queue: HubRunQueue, executor: HubRunExecutor): HubReplyEnvelope;
|
|
33
|
+
export declare function handleRunList(envelope: HubCommandEnvelope, queue: HubRunQueue): HubReplyEnvelope;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CoreSessionEvent } from "../../../types/events";
|
|
2
|
+
import { type HubTransportContext } from "./context";
|
|
3
|
+
/**
|
|
4
|
+
* Translates internal `CoreSessionEvent`s emitted by the session host into the
|
|
5
|
+
* outward-facing `HubEventEnvelope` stream.
|
|
6
|
+
*/
|
|
7
|
+
export declare function projectSessionEvent(ctx: HubTransportContext, event: CoreSessionEvent): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope, ToolApprovalRequest } from "@cerebriline/shared";
|
|
2
|
+
import type { SessionConnectionUpdate } from "../../../runtime/host/runtime-host";
|
|
3
|
+
import { type HubTransportContext } from "./context";
|
|
4
|
+
export declare function selectSessionTools<T extends {
|
|
5
|
+
name: string;
|
|
6
|
+
}>(tools: readonly T[], mode: string, source?: string): T[];
|
|
7
|
+
export declare function readSessionConnectionUpdate(value: unknown): SessionConnectionUpdate;
|
|
8
|
+
export declare function resolveSessionAutoApproveTools(toolPolicies: unknown, runtimeOptions: Record<string, unknown>): boolean;
|
|
9
|
+
export declare function handleSessionCreate(ctx: HubTransportContext, envelope: HubCommandEnvelope, requestToolApproval: (request: ToolApprovalRequest) => Promise<{
|
|
10
|
+
approved: boolean;
|
|
11
|
+
reason?: string;
|
|
12
|
+
}>): Promise<HubReplyEnvelope>;
|
|
13
|
+
export declare function handleSessionRestore(ctx: HubTransportContext, envelope: HubCommandEnvelope, requestToolApproval: (request: ToolApprovalRequest) => Promise<{
|
|
14
|
+
approved: boolean;
|
|
15
|
+
reason?: string;
|
|
16
|
+
}>): Promise<HubReplyEnvelope>;
|
|
17
|
+
export declare function handleSessionAttach(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
18
|
+
export declare function handleSessionDetach(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
19
|
+
export declare function handleSessionGet(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
20
|
+
export declare function handleSessionMessages(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
21
|
+
export declare function handleSessionCompactionGet(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
22
|
+
export declare function handleSessionList(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
23
|
+
export declare function handleSessionSearch(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
24
|
+
export declare function handleSessionUpdate(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
25
|
+
export declare function handleSessionUpdateConnection(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
26
|
+
export declare function handleSessionCompactionUpdate(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
27
|
+
export declare function handleSessionDelete(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
28
|
+
export declare function handleSessionPendingPrompts(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
29
|
+
export declare function handleSessionUpdatePendingPrompt(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
30
|
+
export declare function handleSessionRemovePendingPrompt(ctx: HubTransportContext, envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentHooks, HubClientContribution } from "@cerebriline/shared";
|
|
2
|
+
export { HUB_CHECKPOINT_CAPABILITY, HUB_COMPACTION_CAPABILITY, HUB_CUSTOM_TOOL_CAPABILITY_PREFIX, HUB_HOOK_CAPABILITY_PREFIX, HUB_MISTAKE_LIMIT_CAPABILITY, HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX, HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY, } from "@cerebriline/shared";
|
|
3
|
+
import type { ToolExecutors } from "../../extensions/tools";
|
|
4
|
+
import type { LocalRuntimeStartOptions, RuntimeSessionConfig } from "../../runtime/host/runtime-host";
|
|
5
|
+
type RequestCapability = (sessionId: string, capabilityName: string, payload: Record<string, unknown>, targetClientId: string, onProgress?: (payload: Record<string, unknown>) => void) => Promise<Record<string, unknown> | undefined>;
|
|
6
|
+
export declare function listHubAgentHookNames(hooks: AgentHooks | undefined): string[];
|
|
7
|
+
export declare function parseHubClientContributions(value: unknown): HubClientContribution[];
|
|
8
|
+
export declare function createHubClientContributionRuntime(input: {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
targetClientId: string;
|
|
11
|
+
contributions: readonly HubClientContribution[];
|
|
12
|
+
sessionConfig?: Partial<RuntimeSessionConfig>;
|
|
13
|
+
requestCapability: RequestCapability;
|
|
14
|
+
}): {
|
|
15
|
+
localRuntime: LocalRuntimeStartOptions;
|
|
16
|
+
toolExecutors?: Partial<ToolExecutors>;
|
|
17
|
+
hasClientContributions: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function defaultClientContributionCapabilityName(contribution: Pick<HubClientContribution, "kind"> & Record<string, unknown>): string | undefined;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable, cursor-addressed Hub event log.
|
|
3
|
+
*
|
|
4
|
+
* Every event the Hub publishes is appended here with a monotonically
|
|
5
|
+
* increasing global sequence before it is fanned out to live sockets. A
|
|
6
|
+
* client that reconnects can resume exactly where it left off by passing
|
|
7
|
+
* `sinceSequence` on `stream.subscribe`: the adapter replays pages from this
|
|
8
|
+
* log, then live-tails. Nothing about delivery depends on who was watching
|
|
9
|
+
* when the event happened — disconnect never implies data loss.
|
|
10
|
+
*
|
|
11
|
+
* The log is a projection aid, not the source of truth for conversation
|
|
12
|
+
* history (session messages remain canonical on disk); it is bounded by a
|
|
13
|
+
* retention sweep so it can run forever.
|
|
14
|
+
*/
|
|
15
|
+
import type { HubEventEnvelope } from "@cerebriline/shared";
|
|
16
|
+
export interface HubEventLogOptions {
|
|
17
|
+
/** Database file. Defaults to an owner-scoped `<data>/db/hub-events-*.db`; use ":memory:" in tests. */
|
|
18
|
+
dbPath?: string;
|
|
19
|
+
/** Scopes the default `dbPath`; ignored when `dbPath` is given. */
|
|
20
|
+
ownerId?: string;
|
|
21
|
+
/** Events older than this are pruned. Defaults to 7 days. */
|
|
22
|
+
retentionMs?: number;
|
|
23
|
+
/** Hard cap on rows kept, oldest pruned first. Defaults to 200k. */
|
|
24
|
+
maxRows?: number;
|
|
25
|
+
/** Cap on the database file size, oldest rows pruned first. Defaults to 64 MiB. */
|
|
26
|
+
maxTotalBytes?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface HubEventLogScope {
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Default log location, scoped per hub owner context so coexisting hubs
|
|
33
|
+
* (production and a dev shared hub) never interleave one log's sequences.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveHubEventLogPath(ownerId?: string): string;
|
|
36
|
+
export declare class HubEventLogStore {
|
|
37
|
+
private readonly db;
|
|
38
|
+
private readonly retentionMs;
|
|
39
|
+
private readonly maxRows;
|
|
40
|
+
private readonly maxTotalBytes;
|
|
41
|
+
private appendedBytesSincePrune;
|
|
42
|
+
private closed;
|
|
43
|
+
constructor(options?: HubEventLogOptions);
|
|
44
|
+
/**
|
|
45
|
+
* Append a durable event and return it stamped with its global sequence.
|
|
46
|
+
* The returned envelope (not the input) is what must be fanned out so
|
|
47
|
+
* live listeners and replaying clients observe identical frames.
|
|
48
|
+
*/
|
|
49
|
+
append(envelope: HubEventEnvelope): HubEventEnvelope;
|
|
50
|
+
/** Events after `sequence`, oldest first, optionally scoped to a session. */
|
|
51
|
+
listAfter(sequence: number, scope: HubEventLogScope, limit: number): HubEventEnvelope[];
|
|
52
|
+
lastSequence(): number;
|
|
53
|
+
/** Bound the log: drop rows past retention, the row cap, and the size budget. */
|
|
54
|
+
prune(now?: number): void;
|
|
55
|
+
private fileSizeBytes;
|
|
56
|
+
close(): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SessionRecord as HubSessionRecord } from "@cerebriline/shared";
|
|
2
|
+
export declare function truncateNotificationBody(value: string): string;
|
|
3
|
+
export declare function buildCompletionNotification(session: HubSessionRecord | undefined): Promise<{
|
|
4
|
+
title: string;
|
|
5
|
+
body: string;
|
|
6
|
+
severity: "info";
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable FIFO run queue with immediate acknowledgement.
|
|
3
|
+
*
|
|
4
|
+
* `run.enqueue` admits a prompt into this queue and acks immediately with
|
|
5
|
+
* `{runId, acceptedAt, queuePosition}` — acceptance is decoupled from
|
|
6
|
+
* execution, so the reply never blocks on the turn and never dies with the
|
|
7
|
+
* socket. One run executes at a time per session, in admission order.
|
|
8
|
+
*
|
|
9
|
+
* Runs are durable: a daemon crash leaves `queued` rows to re-admit in FIFO
|
|
10
|
+
* order at the next startup, and `running` rows are marked `interrupted` —
|
|
11
|
+
* never silently resumed, never left dangling as ghost "running" state.
|
|
12
|
+
*
|
|
13
|
+
* Admission applies backpressure: a full per-session queue rejects with a
|
|
14
|
+
* retryable `run_admission_rejected` instead of accepting unbounded work.
|
|
15
|
+
*/
|
|
16
|
+
export type HubRunState = "queued" | "running" | "completed" | "failed" | "aborted" | "interrupted";
|
|
17
|
+
export interface HubRunRecord {
|
|
18
|
+
runId: string;
|
|
19
|
+
sessionId: string;
|
|
20
|
+
state: HubRunState;
|
|
21
|
+
/** The `run.start`-shaped payload to execute (prompt, mode, attachments, ...). */
|
|
22
|
+
input: Record<string, unknown>;
|
|
23
|
+
clientId?: string;
|
|
24
|
+
acceptedAt: number;
|
|
25
|
+
startedAt?: number;
|
|
26
|
+
endedAt?: number;
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface HubRunAccepted {
|
|
30
|
+
runId: string;
|
|
31
|
+
acceptedAt: number;
|
|
32
|
+
queuePosition: number;
|
|
33
|
+
}
|
|
34
|
+
export declare class HubRunAdmissionRejectedError extends Error {
|
|
35
|
+
readonly retryable = true;
|
|
36
|
+
constructor(sessionId: string, pending: number, limit: number);
|
|
37
|
+
}
|
|
38
|
+
export interface HubRunQueueOptions {
|
|
39
|
+
/** Database file. Defaults to an owner-scoped `<data>/db/hub-runs-*.db`; use ":memory:" in tests. */
|
|
40
|
+
dbPath?: string;
|
|
41
|
+
/** Scopes the default `dbPath`; ignored when `dbPath` is given. */
|
|
42
|
+
ownerId?: string;
|
|
43
|
+
maxPendingPerSession?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Default queue location, scoped per hub owner context: startup recovery
|
|
47
|
+
* marks orphaned `running` rows interrupted, and a coexisting hub (dev
|
|
48
|
+
* shared next to production) must never reap another hub's live runs.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveHubRunQueuePath(ownerId?: string): string;
|
|
51
|
+
export declare class HubRunQueue {
|
|
52
|
+
private readonly db;
|
|
53
|
+
private readonly maxPendingPerSession;
|
|
54
|
+
private closed;
|
|
55
|
+
constructor(options?: HubRunQueueOptions);
|
|
56
|
+
/** Durable FIFO admission + immediate acknowledgement. */
|
|
57
|
+
admit(sessionId: string, input: Record<string, unknown>, clientId?: string): HubRunAccepted;
|
|
58
|
+
get(runId: string): HubRunRecord | undefined;
|
|
59
|
+
/** Oldest queued run for the session, if any. */
|
|
60
|
+
nextQueued(sessionId: string): HubRunRecord | undefined;
|
|
61
|
+
/** Whether a run is currently marked running for the session. */
|
|
62
|
+
hasRunning(sessionId: string): boolean;
|
|
63
|
+
countPendingBySession(sessionId: string): number;
|
|
64
|
+
countPending(): number;
|
|
65
|
+
markRunning(runId: string): void;
|
|
66
|
+
markTerminal(runId: string, state: Extract<HubRunState, "completed" | "failed" | "aborted" | "interrupted">, error?: string): void;
|
|
67
|
+
list(options?: {
|
|
68
|
+
sessionId?: string;
|
|
69
|
+
limit?: number;
|
|
70
|
+
}): HubRunRecord[];
|
|
71
|
+
/**
|
|
72
|
+
* Crash recovery, run once at daemon startup, before any new admission:
|
|
73
|
+
* runs left `running` by a dead daemon are marked `interrupted` (never
|
|
74
|
+
* auto-resumed — a resumed half-turn is worse than an honest interrupt),
|
|
75
|
+
* and committed `queued` runs are returned for FIFO re-admission.
|
|
76
|
+
*/
|
|
77
|
+
recoverOnStartup(): {
|
|
78
|
+
interrupted: HubRunRecord[];
|
|
79
|
+
requeued: HubRunRecord[];
|
|
80
|
+
};
|
|
81
|
+
close(): void;
|
|
82
|
+
}
|