@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,74 @@
|
|
|
1
|
+
import { type AgentAbortHookPayload, type AgentEndHookPayload, type AgentErrorHookPayload, type AgentHooks, type AgentResumeHookPayload, type AgentStartHookPayload, type HookEventName, HookEventNameSchema, type HookEventPayload, type HookEventPayloadBase, HookEventPayloadSchema, type HookSessionContextProvider, type PostToolUseData, type PreCompactData, type PreCompactHookPayload, type PreToolUseData, type PromptSubmitHookPayload, parseHookEventPayload, type SessionShutdownHookPayload, type TaskCancelData, type TaskCompleteData, type TaskResumeData, type TaskStartData, type ToolCallHookPayload, type ToolResultHookPayload, type UserPromptSubmitData, type WorkspaceInfo } from "@cerebriline/shared";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type RunSubprocessEventResult } from "./subprocess-runner";
|
|
4
|
+
/**
|
|
5
|
+
* Maximum size for a hook's injected context (`contextModification`), matching
|
|
6
|
+
* the legacy extension's cap. Prevents a hook from overflowing the prompt.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAX_HOOK_CONTEXT_SIZE = 50000;
|
|
9
|
+
export declare function truncateHookContext(context: string | undefined): string | undefined;
|
|
10
|
+
export interface HookOutput {
|
|
11
|
+
contextModification: string;
|
|
12
|
+
cancel: boolean;
|
|
13
|
+
review?: boolean;
|
|
14
|
+
errorMessage: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const HookOutputSchema: z.ZodObject<{
|
|
17
|
+
contextModification: z.ZodOptional<z.ZodString>;
|
|
18
|
+
cancel: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
review: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
21
|
+
context: z.ZodOptional<z.ZodString>;
|
|
22
|
+
overrideInput: z.ZodOptional<z.ZodUnknown>;
|
|
23
|
+
}, z.core.$loose>;
|
|
24
|
+
export { HookEventNameSchema, HookEventPayloadSchema, parseHookEventPayload };
|
|
25
|
+
export type { AgentAbortHookPayload, AgentEndHookPayload, AgentErrorHookPayload, AgentResumeHookPayload, AgentStartHookPayload, HookEventName, HookEventPayload, HookEventPayloadBase, PostToolUseData, PreCompactData, PreCompactHookPayload, PreToolUseData, PromptSubmitHookPayload, SessionShutdownHookPayload, TaskCancelData, TaskCompleteData, TaskResumeData, TaskStartData, ToolCallHookPayload, ToolResultHookPayload, UserPromptSubmitData, };
|
|
26
|
+
export interface RunHookOptions {
|
|
27
|
+
command?: string[];
|
|
28
|
+
cwd?: string;
|
|
29
|
+
env?: NodeJS.ProcessEnv;
|
|
30
|
+
detached?: boolean;
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
onSpawn?: (event: {
|
|
33
|
+
command: string[];
|
|
34
|
+
pid?: number;
|
|
35
|
+
detached: boolean;
|
|
36
|
+
}) => void;
|
|
37
|
+
}
|
|
38
|
+
export type RunHookResult = RunSubprocessEventResult;
|
|
39
|
+
export declare function runHook(payload: HookEventPayload, options?: RunHookOptions): Promise<RunHookResult | undefined>;
|
|
40
|
+
export interface SubprocessHooksOptions {
|
|
41
|
+
command?: string[];
|
|
42
|
+
cwd?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Structured workspace and git metadata forwarded into every hook payload
|
|
45
|
+
* as `workspaceInfo`. Obtained from `generateWorkspaceInfo` at session
|
|
46
|
+
* startup and passed here so hook scripts can inspect branch, commit, and
|
|
47
|
+
* remote without running their own `git` commands.
|
|
48
|
+
*/
|
|
49
|
+
workspaceInfo?: WorkspaceInfo;
|
|
50
|
+
env?: NodeJS.ProcessEnv;
|
|
51
|
+
timeoutMs?: number;
|
|
52
|
+
onDispatchError?: (error: Error, payload: HookEventPayload) => void;
|
|
53
|
+
onDispatch?: (event: {
|
|
54
|
+
payload: HookEventPayload;
|
|
55
|
+
result?: RunHookResult;
|
|
56
|
+
detached: boolean;
|
|
57
|
+
}) => void;
|
|
58
|
+
onSpawn?: (event: {
|
|
59
|
+
command: string[];
|
|
60
|
+
pid?: number;
|
|
61
|
+
detached: boolean;
|
|
62
|
+
}) => void;
|
|
63
|
+
sessionContext?: HookSessionContextProvider;
|
|
64
|
+
}
|
|
65
|
+
export interface SubprocessHookControl {
|
|
66
|
+
hooks: AgentHooks;
|
|
67
|
+
shutdown: (ctx: {
|
|
68
|
+
agentId: string;
|
|
69
|
+
conversationId: string;
|
|
70
|
+
parentAgentId: string | null;
|
|
71
|
+
reason?: string;
|
|
72
|
+
}) => Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
export declare function createSubprocessHooks(options?: SubprocessHooksOptions): SubprocessHookControl;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
import { type HubEndpointOverrides } from "../discovery/defaults";
|
|
3
|
+
export interface HubConnection {
|
|
4
|
+
send(envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
5
|
+
close(): void;
|
|
6
|
+
}
|
|
7
|
+
export interface HubCommandRequest extends Omit<HubCommandEnvelope, "version" | "clientId"> {
|
|
8
|
+
version?: HubCommandEnvelope["version"];
|
|
9
|
+
clientId?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveHubUrl(overrides?: HubEndpointOverrides): Promise<string>;
|
|
12
|
+
export declare function connectToHub(url: string): Promise<HubConnection>;
|
|
13
|
+
export declare function probeHubConnection(url: string): Promise<boolean>;
|
|
14
|
+
export declare function sendHubCommand(overrides: HubEndpointOverrides, envelope: HubCommandRequest): Promise<HubReplyEnvelope>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type HubClientRegistration, type HubCommandEnvelope, type HubEventEnvelope, type HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
import { type HubOwnerContext } from "../discovery";
|
|
3
|
+
export interface HubClientOptions {
|
|
4
|
+
url: string;
|
|
5
|
+
clientId?: string;
|
|
6
|
+
clientType?: string;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
workspaceRoot?: string;
|
|
9
|
+
cwd?: string;
|
|
10
|
+
authToken?: string;
|
|
11
|
+
capabilities?: HubClientRegistration["capabilities"];
|
|
12
|
+
}
|
|
13
|
+
export interface LocalHubResolutionOptions {
|
|
14
|
+
endpoint?: string;
|
|
15
|
+
strategy?: "prefer-hub" | "require-hub";
|
|
16
|
+
workspaceRoot?: string;
|
|
17
|
+
cwd?: string;
|
|
18
|
+
}
|
|
19
|
+
export type HubTransportErrorCode = "hub_connect_timeout" | "hub_connect_failed" | "hub_connection_closed" | "hub_connection_not_open";
|
|
20
|
+
export declare class HubTransportError extends Error {
|
|
21
|
+
readonly code: HubTransportErrorCode;
|
|
22
|
+
readonly details?: {
|
|
23
|
+
closeCode?: number;
|
|
24
|
+
closeReason?: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
constructor(code: HubTransportErrorCode, message: string, details?: {
|
|
27
|
+
closeCode?: number;
|
|
28
|
+
closeReason?: string;
|
|
29
|
+
} | undefined);
|
|
30
|
+
}
|
|
31
|
+
export declare function isHubReconnectableTransportError(error: unknown): error is HubTransportError;
|
|
32
|
+
export declare class HubCommandError extends Error {
|
|
33
|
+
readonly command: HubCommandEnvelope["command"];
|
|
34
|
+
readonly code: string | undefined;
|
|
35
|
+
constructor(command: HubCommandEnvelope["command"], code: string | undefined, message: string);
|
|
36
|
+
}
|
|
37
|
+
export declare function isHubCommandTimeoutError(error: unknown, command?: HubCommandEnvelope["command"]): boolean;
|
|
38
|
+
export declare function rememberRecoverableLocalHubUrl(url: string, authToken?: string): string;
|
|
39
|
+
export declare class NodeHubClient {
|
|
40
|
+
private readonly options;
|
|
41
|
+
private socket;
|
|
42
|
+
private connectPromise;
|
|
43
|
+
private readonly clientId;
|
|
44
|
+
private currentUrl;
|
|
45
|
+
private recoveryPromise;
|
|
46
|
+
private readonly pendingReplies;
|
|
47
|
+
private readonly listeners;
|
|
48
|
+
private readonly subscriptionCounts;
|
|
49
|
+
/**
|
|
50
|
+
* Highest durable event sequence observed per subscription key. Sent as
|
|
51
|
+
* `sinceSequence` when a subscription frame is (re)issued, so a hub with a
|
|
52
|
+
* durable event log replays exactly what this client missed while
|
|
53
|
+
* disconnected. Hubs without a log ignore the cursor (live-only, the
|
|
54
|
+
* legacy behavior).
|
|
55
|
+
*/
|
|
56
|
+
private readonly lastEventSequenceByKey;
|
|
57
|
+
private reconnectTimer;
|
|
58
|
+
private reconnectAttempt;
|
|
59
|
+
private closedByClient;
|
|
60
|
+
private lastCloseError;
|
|
61
|
+
private sawSocketClose;
|
|
62
|
+
private registered;
|
|
63
|
+
private capabilities;
|
|
64
|
+
constructor(options: HubClientOptions);
|
|
65
|
+
getClientId(): string;
|
|
66
|
+
getUrl(): string;
|
|
67
|
+
isConnected(): boolean;
|
|
68
|
+
getConnectionError(): HubTransportError | null;
|
|
69
|
+
updateCapabilities(capabilities: NonNullable<HubClientRegistration["capabilities"]>): Promise<void>;
|
|
70
|
+
connect(): Promise<void>;
|
|
71
|
+
subscribe(listener: (event: HubEventEnvelope) => void, options?: {
|
|
72
|
+
sessionId?: string;
|
|
73
|
+
}): () => void;
|
|
74
|
+
command(command: HubCommandEnvelope["command"], payload?: Record<string, unknown>, sessionId?: string, options?: {
|
|
75
|
+
timeoutMs?: number | null;
|
|
76
|
+
}): Promise<HubReplyEnvelope>;
|
|
77
|
+
private commandOnce;
|
|
78
|
+
private recoverLocalHubTransport;
|
|
79
|
+
private hasActiveSubscriptions;
|
|
80
|
+
private clearReconnectTimer;
|
|
81
|
+
private scheduleReconnect;
|
|
82
|
+
private reconnectSubscribedTransport;
|
|
83
|
+
close(): void;
|
|
84
|
+
dispose(): Promise<void>;
|
|
85
|
+
private sendFrame;
|
|
86
|
+
private sendSubscriptionFrame;
|
|
87
|
+
private adjustSubscriptionCount;
|
|
88
|
+
private subscriptionKeyForSessionId;
|
|
89
|
+
private subscriptionSessionIdFromKey;
|
|
90
|
+
private handleFrame;
|
|
91
|
+
}
|
|
92
|
+
export declare function normalizeHubWebSocketUrl(url: string): string;
|
|
93
|
+
export declare function verifyHubConnection(url: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd" | "authToken">): Promise<boolean>;
|
|
94
|
+
export interface HubSessionActivity {
|
|
95
|
+
/** Sessions with at least one live participant attached. */
|
|
96
|
+
activeSessionCount: number;
|
|
97
|
+
/** Distinct client ids attached to those sessions. */
|
|
98
|
+
participantClientCount: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Summarize live activity from a `session.list` payload. A session counts as
|
|
102
|
+
* active only while a client is attached to it - the one signal that cannot
|
|
103
|
+
* go stale, because participants are live socket subscriptions the hub drops
|
|
104
|
+
* the moment a client's connection closes.
|
|
105
|
+
*
|
|
106
|
+
* Deliberately NOT based on session status: a client that dies without
|
|
107
|
+
* stopping its session leaves the hub-side runtime behind in a non-terminal
|
|
108
|
+
* status forever, and counting those "ghost" sessions as busy pins an
|
|
109
|
+
* outdated hub as "serving sessions" until the machine reboots. The cost of
|
|
110
|
+
* ignoring status is that a participant-less background run executing at the
|
|
111
|
+
* exact moment of a hub swap dies with the old hub - rare, and its next
|
|
112
|
+
* scheduled tick runs normally on the replacement.
|
|
113
|
+
*/
|
|
114
|
+
export declare function summarizeHubSessionActivity(payload: unknown): HubSessionActivity;
|
|
115
|
+
export declare function hasActiveHubSessions(payload: unknown): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Ask a hub how much live work it is serving. Throws when the hub cannot
|
|
118
|
+
* answer (unreachable, auth rejected, or too old to serve `session.list`),
|
|
119
|
+
* because the safe default points in opposite directions per caller: a
|
|
120
|
+
* replacement path treats an unanswerable hub as idle and retires it, while
|
|
121
|
+
* a recovery path treats it as busy and leaves it alone. Callers pick their
|
|
122
|
+
* own fallback instead of inheriting a hidden one.
|
|
123
|
+
*/
|
|
124
|
+
export declare function queryHubSessionActivity(url: string, authToken?: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd">): Promise<HubSessionActivity>;
|
|
125
|
+
export declare function localHubHasNoActiveSessions(url: string, authToken?: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd">): Promise<boolean>;
|
|
126
|
+
export declare function resolveCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
127
|
+
export declare function ensureCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
128
|
+
/**
|
|
129
|
+
* Ask a hub to stop admitting new mutating work (sessions, runs) while its
|
|
130
|
+
* accepted work finishes. Best-effort: pre-drain hubs answer 404 and the
|
|
131
|
+
* caller proceeds without it.
|
|
132
|
+
*
|
|
133
|
+
* Pass `{ off: true }` to lift a drain (`POST /drain?off`): an aborted
|
|
134
|
+
* upgrade must be able to hand the hub back instead of leaving it refusing
|
|
135
|
+
* work until a restart.
|
|
136
|
+
*/
|
|
137
|
+
export declare function requestHubDrain(url: string, authToken?: string, reason?: string, options?: {
|
|
138
|
+
off?: boolean;
|
|
139
|
+
}): Promise<boolean>;
|
|
140
|
+
export declare function requestHubShutdown(url: string, authToken?: string): Promise<boolean>;
|
|
141
|
+
export declare function stopLocalHubServerGracefully(owner?: HubOwnerContext): Promise<boolean>;
|
|
142
|
+
export declare function restartLocalHubIfIdleAfterStartupTimeout(options: {
|
|
143
|
+
url: string;
|
|
144
|
+
workspaceRoot?: string;
|
|
145
|
+
cwd?: string;
|
|
146
|
+
}): Promise<string | undefined>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export interface ManagedHubBuildMismatchEvent {
|
|
2
|
+
/** WebSocket URL of the live managed Hub that does not match this build. */
|
|
3
|
+
url: string;
|
|
4
|
+
/**
|
|
5
|
+
* Why client and Hub disagree:
|
|
6
|
+
* - `build_mismatch`: the running Hub is a newer build this client stays
|
|
7
|
+
* attached to, and updating this client resolves it.
|
|
8
|
+
* - `unsupported_protocol`: this client cannot speak the Hub's protocol.
|
|
9
|
+
* - `outdated_hub`: this client is the newer build, but the running Hub was
|
|
10
|
+
* left in place because it is still serving sessions. Nothing to install;
|
|
11
|
+
* the Hub is replaced once those sessions end.
|
|
12
|
+
*/
|
|
13
|
+
reason: "unsupported_protocol" | "build_mismatch" | "outdated_hub";
|
|
14
|
+
/** Build identity reported by the running Hub, when it reports one. */
|
|
15
|
+
hubBuildId?: string;
|
|
16
|
+
/** Core package version reported by the running Hub. */
|
|
17
|
+
hubCoreVersion?: string;
|
|
18
|
+
/** Build identity this client expects a managed Hub to match. */
|
|
19
|
+
expectedBuildId: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sessions with live participants on the Hub (best-effort, `outdated_hub`
|
|
22
|
+
* only): the work that replacing the Hub would interrupt. Unset when the
|
|
23
|
+
* Hub cannot answer the query.
|
|
24
|
+
*/
|
|
25
|
+
activeSessionCount?: number;
|
|
26
|
+
/** Distinct clients attached to those sessions (best-effort, `outdated_hub` only). */
|
|
27
|
+
participantClientCount?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Probe the managed local Hub once and report whether a live Hub is running
|
|
31
|
+
* a build this client cannot manage. Returns `undefined` when there is no
|
|
32
|
+
* discovery record, the recorded Hub is unreachable, a Hub startup
|
|
33
|
+
* transaction is in flight (another client may be mid-replacement), or the
|
|
34
|
+
* running Hub matches this build.
|
|
35
|
+
*
|
|
36
|
+
* A mismatch means another Cline installation replaced the shared Hub with a
|
|
37
|
+
* different build (for example, the CLI was updated while the desktop app
|
|
38
|
+
* kept running). This client can keep talking to it over the compatible wire
|
|
39
|
+
* protocol, but it should prompt the user to update and restart so client
|
|
40
|
+
* and Hub run the same code again.
|
|
41
|
+
*/
|
|
42
|
+
export declare function checkManagedHubBuildMismatch(): Promise<ManagedHubBuildMismatchEvent | undefined>;
|
|
43
|
+
export interface WatchManagedHubBuildOptions {
|
|
44
|
+
onMismatch: (event: ManagedHubBuildMismatchEvent) => void;
|
|
45
|
+
intervalMs?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Periodically watch the managed local Hub for a build-identity mismatch and
|
|
49
|
+
* invoke `onMismatch` when another Cline installation has replaced the Hub
|
|
50
|
+
* with a different build. Fires once per observed Hub build (it will fire
|
|
51
|
+
* again only if the Hub changes to yet another mismatched build after a
|
|
52
|
+
* compatible one was seen, or a different mismatch reason appears).
|
|
53
|
+
*
|
|
54
|
+
* Start this only for managed Hub usage. Hosts configured with an explicit
|
|
55
|
+
* Hub endpoint keep protocol-only compatibility and must not show update
|
|
56
|
+
* prompts, so the watcher refuses to start when `CLINE_HUB_PORT` is set.
|
|
57
|
+
* The first check runs after one interval so app startup (which may itself
|
|
58
|
+
* be replacing a stale Hub) has settled.
|
|
59
|
+
*
|
|
60
|
+
* Returns a stop function.
|
|
61
|
+
*/
|
|
62
|
+
export declare function watchManagedHubBuildMismatch(options: WatchManagedHubBuildOptions): () => void;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type * as LlmsProviders from "@cerebriline/llms";
|
|
2
|
+
import type { AgendaAutomationPolicy, AgendaTaskListInput, AgendaTaskRecord, AgendaTaskRunRecord, ChatRunTurnRequest, ChatStartSessionRequest, ChatStartSessionResponse, ChatTurnResult, HubSessionSearchHit, HubTaskCreateInput, HubTaskUpdateInput, TeamProgressProjectionEvent } from "@cerebriline/shared";
|
|
3
|
+
import type { CheckpointEntry } from "../../hooks/checkpoint-hooks";
|
|
4
|
+
type ScheduleClientRecord = Record<string, unknown> & {
|
|
5
|
+
metadata?: Record<string, unknown>;
|
|
6
|
+
};
|
|
7
|
+
export interface HubSessionClientOptions {
|
|
8
|
+
address: string;
|
|
9
|
+
authToken?: string;
|
|
10
|
+
clientId?: string;
|
|
11
|
+
clientType?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
workspaceRoot?: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface HubSessionRow {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
parentSessionId?: string;
|
|
20
|
+
/** Hub runtime status when the server provided one. */
|
|
21
|
+
status?: string;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
messagesPath?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface HubStreamEvent {
|
|
26
|
+
sessionId: string;
|
|
27
|
+
eventType: string;
|
|
28
|
+
payload: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export interface HubRestoreRequest {
|
|
31
|
+
sessionId: string;
|
|
32
|
+
checkpointRunCount: number;
|
|
33
|
+
config?: ChatStartSessionRequest;
|
|
34
|
+
restore?: {
|
|
35
|
+
messages?: boolean;
|
|
36
|
+
workspace?: boolean;
|
|
37
|
+
omitCheckpointMessageFromSession?: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface HubRestoreResponse {
|
|
41
|
+
sessionId?: string;
|
|
42
|
+
startResult?: {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
manifestPath: string;
|
|
45
|
+
messagesPath: string;
|
|
46
|
+
};
|
|
47
|
+
messages?: LlmsProviders.MessageWithMetadata[];
|
|
48
|
+
checkpoint: CheckpointEntry;
|
|
49
|
+
}
|
|
50
|
+
export interface HubEventStreamHandlers {
|
|
51
|
+
onEvent?: (event: HubStreamEvent) => void;
|
|
52
|
+
onError?: (error: Error) => void;
|
|
53
|
+
}
|
|
54
|
+
export interface HubTeamProgressHandlers {
|
|
55
|
+
onProjection?: (event: TeamProgressProjectionEvent) => void;
|
|
56
|
+
onError?: (error: Error) => void;
|
|
57
|
+
}
|
|
58
|
+
export declare class HubSessionClient {
|
|
59
|
+
private readonly options;
|
|
60
|
+
private readonly client;
|
|
61
|
+
private metadataApplied;
|
|
62
|
+
constructor(options: HubSessionClientOptions);
|
|
63
|
+
private ensureMetadataApplied;
|
|
64
|
+
connect(): Promise<void>;
|
|
65
|
+
private taskCommand;
|
|
66
|
+
close(): void;
|
|
67
|
+
dispose(): Promise<void>;
|
|
68
|
+
startRuntimeSession(request: ChatStartSessionRequest): Promise<ChatStartSessionResponse>;
|
|
69
|
+
sendRuntimeSession(sessionId: string, request: ChatRunTurnRequest, options?: {
|
|
70
|
+
timeoutMs?: number | null;
|
|
71
|
+
}): Promise<{
|
|
72
|
+
result?: ChatTurnResult;
|
|
73
|
+
}>;
|
|
74
|
+
stopRuntimeSession(sessionId: string): Promise<{
|
|
75
|
+
applied: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
abortRuntimeSession(sessionId: string): Promise<{
|
|
78
|
+
applied: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
updateSession(input: {
|
|
81
|
+
sessionId: string;
|
|
82
|
+
metadata?: Record<string, unknown>;
|
|
83
|
+
}): Promise<{
|
|
84
|
+
updated: boolean;
|
|
85
|
+
}>;
|
|
86
|
+
getSession(sessionId: string): Promise<HubSessionRow | undefined>;
|
|
87
|
+
readMessages(sessionId: string): Promise<LlmsProviders.MessageWithMetadata[]>;
|
|
88
|
+
restore(input: HubRestoreRequest): Promise<HubRestoreResponse>;
|
|
89
|
+
listSessions(input?: {
|
|
90
|
+
limit?: number;
|
|
91
|
+
}): Promise<HubSessionRow[]>;
|
|
92
|
+
searchSessions(input: {
|
|
93
|
+
query: string;
|
|
94
|
+
limit?: number;
|
|
95
|
+
workspaceRoot?: string;
|
|
96
|
+
}): Promise<HubSessionSearchHit[]>;
|
|
97
|
+
deleteSession(sessionId: string, deleteCheckpointRefs?: boolean): Promise<boolean>;
|
|
98
|
+
respondToolApproval(input: {
|
|
99
|
+
approvalId: string;
|
|
100
|
+
approved: boolean;
|
|
101
|
+
reason?: string;
|
|
102
|
+
responderClientId?: string;
|
|
103
|
+
}): Promise<void>;
|
|
104
|
+
streamEvents(input: {
|
|
105
|
+
clientId?: string;
|
|
106
|
+
sessionIds?: string[];
|
|
107
|
+
}, handlers: HubEventStreamHandlers): () => void;
|
|
108
|
+
streamTeamProgress(_input: {
|
|
109
|
+
clientId?: string;
|
|
110
|
+
}, handlers: HubTeamProgressHandlers): () => void;
|
|
111
|
+
createSchedule(input: Record<string, unknown>): Promise<ScheduleClientRecord | undefined>;
|
|
112
|
+
listSchedules(_input?: {
|
|
113
|
+
limit?: number;
|
|
114
|
+
}): Promise<ScheduleClientRecord[]>;
|
|
115
|
+
getSchedule(scheduleId: string): Promise<ScheduleClientRecord | undefined>;
|
|
116
|
+
updateSchedule(scheduleId: string, input: Record<string, unknown>): Promise<ScheduleClientRecord | undefined>;
|
|
117
|
+
pauseSchedule(scheduleId: string): Promise<ScheduleClientRecord | undefined>;
|
|
118
|
+
resumeSchedule(scheduleId: string): Promise<ScheduleClientRecord | undefined>;
|
|
119
|
+
deleteSchedule(scheduleId: string): Promise<boolean>;
|
|
120
|
+
triggerScheduleNow(scheduleId: string): Promise<Record<string, unknown> | undefined>;
|
|
121
|
+
listScheduleExecutions(scheduleId: string, limit?: number): Promise<Array<Record<string, unknown>>>;
|
|
122
|
+
getScheduleStats(): Promise<Record<string, unknown> | undefined>;
|
|
123
|
+
getActiveScheduledExecutions(): Promise<Array<Record<string, unknown>>>;
|
|
124
|
+
getUpcomingScheduledRuns(limit?: number): Promise<Array<Record<string, unknown>>>;
|
|
125
|
+
createTask(input: HubTaskCreateInput): Promise<AgendaTaskRecord>;
|
|
126
|
+
listTasks(input?: AgendaTaskListInput): Promise<AgendaTaskRecord[]>;
|
|
127
|
+
getTask(taskId: string): Promise<AgendaTaskRecord | undefined>;
|
|
128
|
+
updateTask(input: HubTaskUpdateInput): Promise<AgendaTaskRecord>;
|
|
129
|
+
approveTask(taskId: string, expectedRevision: number): Promise<AgendaTaskRecord>;
|
|
130
|
+
cancelTask(taskId: string, expectedRevision: number, reason?: string): Promise<AgendaTaskRecord>;
|
|
131
|
+
runTask(taskId: string, expectedRevision: number): Promise<{
|
|
132
|
+
task: AgendaTaskRecord;
|
|
133
|
+
run?: AgendaTaskRunRecord;
|
|
134
|
+
}>;
|
|
135
|
+
getTaskAutomation(): Promise<AgendaAutomationPolicy>;
|
|
136
|
+
setTaskAutomation(policy: Omit<AgendaAutomationPolicy, "updatedAt">): Promise<AgendaAutomationPolicy>;
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { HubClientRecord, HubSessionSearchHit, HubUINotifyPayload, HubUIShowWindowPayload, SessionRecord } from "@cerebriline/shared";
|
|
2
|
+
import type { CoreSettingsMutationResult, CoreSettingsToggleInput } from "../../settings";
|
|
3
|
+
export interface HubUIClientOptions {
|
|
4
|
+
address: string;
|
|
5
|
+
authToken?: string;
|
|
6
|
+
clientId?: string;
|
|
7
|
+
clientType?: string;
|
|
8
|
+
displayName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A lightweight hub client for UI/notification concerns.
|
|
12
|
+
* Used by the menu bar app and other UI clients to send/receive
|
|
13
|
+
* UI events (notifications, show window, client tracking).
|
|
14
|
+
*/
|
|
15
|
+
export declare class HubUIClient {
|
|
16
|
+
private readonly client;
|
|
17
|
+
constructor(options: HubUIClientOptions);
|
|
18
|
+
connect(): Promise<void>;
|
|
19
|
+
close(): void;
|
|
20
|
+
dispose(): Promise<void>;
|
|
21
|
+
getClientId(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Send a notification request to the hub.
|
|
24
|
+
* The hub will broadcast a "ui.notify" event to all subscribers (e.g. the menu bar app).
|
|
25
|
+
*/
|
|
26
|
+
sendNotify(payload: HubUINotifyPayload): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Request the hub to broadcast a "ui.show_window" event to all subscribers.
|
|
29
|
+
*/
|
|
30
|
+
sendShowWindow(payload?: HubUIShowWindowPayload): Promise<void>;
|
|
31
|
+
listClients(): Promise<HubClientRecord[]>;
|
|
32
|
+
listSessions(limit?: number): Promise<SessionRecord[]>;
|
|
33
|
+
searchSessions(input: {
|
|
34
|
+
query: string;
|
|
35
|
+
limit?: number;
|
|
36
|
+
workspaceRoot?: string;
|
|
37
|
+
}): Promise<HubSessionSearchHit[]>;
|
|
38
|
+
toggleSetting(input: CoreSettingsToggleInput): Promise<CoreSettingsMutationResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Subscribe to UI-relevant hub events.
|
|
41
|
+
* Returns an unsubscribe function.
|
|
42
|
+
*/
|
|
43
|
+
subscribeUI(handlers: {
|
|
44
|
+
onNotify?: (payload: HubUINotifyPayload) => void;
|
|
45
|
+
onShowWindow?: (payload: HubUIShowWindowPayload) => void;
|
|
46
|
+
onClientRegistered?: (payload: Record<string, unknown>) => void;
|
|
47
|
+
onClientDisconnected?: (payload: Record<string, unknown>) => void;
|
|
48
|
+
onSessionCreated?: (payload: Record<string, unknown>) => void;
|
|
49
|
+
onSessionUpdated?: (payload: Record<string, unknown>) => void;
|
|
50
|
+
onSessionDetached?: (payload: Record<string, unknown>) => void;
|
|
51
|
+
}): () => void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves only after the daemon WebSocket server is listening and its process
|
|
3
|
+
* lifecycle handlers are installed.
|
|
4
|
+
*/
|
|
5
|
+
export declare const hubDaemonReady: Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Abort-family rejections are expected daemon noise, not fatal faults: when a
|
|
8
|
+
* user cancels a turn, in-flight provider streams and fetches can reject on a
|
|
9
|
+
* floating promise after the run has already settled (DOMException
|
|
10
|
+
* "AbortError" from fetch/undici, Node ABORT_ERR, or the runtime's own
|
|
11
|
+
* AgentRuntimeAbortError). Exiting on those kills every resident session in
|
|
12
|
+
* the daemon — the next message from any connected client then lands on
|
|
13
|
+
* `session_not_found` and forces a rebuild from disk.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isAbortRejection(reason: unknown): boolean;
|