@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,125 @@
|
|
|
1
|
+
import { type HubServerProbeRecord } from "../discovery";
|
|
2
|
+
import { type HubEndpointOverrides } from "../discovery/defaults";
|
|
3
|
+
export declare const __test__: {
|
|
4
|
+
/** Retire attempts are module state keyed by URL; clear between cases. */
|
|
5
|
+
resetRetireAttempts(): void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Reads the discovery record the npm postinstall set aside (see
|
|
9
|
+
* apps/cli/script/postinstall.mjs). Deliberately bypasses readHubDiscovery —
|
|
10
|
+
* the file is best-effort recovery metadata, not a live record — and stays
|
|
11
|
+
* synchronous so it adds no async boundary to the ensure flow.
|
|
12
|
+
*
|
|
13
|
+
* Exported for `cline doctor`, which must not mistake a shielded live hub for
|
|
14
|
+
* a stale daemon just because its record is set aside.
|
|
15
|
+
*/
|
|
16
|
+
export declare function readSupersededHubDiscovery(discoveryPath: string): {
|
|
17
|
+
url?: string;
|
|
18
|
+
authToken?: string;
|
|
19
|
+
pid?: number;
|
|
20
|
+
} | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Gracefully retire a discovered hub. Shared by every replacement path
|
|
23
|
+
* (detached ensure, in-process ensure) so retirement always means the same
|
|
24
|
+
* thing: drain first, then an authenticated shutdown, SIGTERM only as a
|
|
25
|
+
* last resort, and discovery cleared only once the hub is actually gone.
|
|
26
|
+
*/
|
|
27
|
+
export declare function retireDiscoveredHub(record: {
|
|
28
|
+
url: string;
|
|
29
|
+
authToken?: string;
|
|
30
|
+
pid?: number;
|
|
31
|
+
}, discoveryPath: string): Promise<boolean>;
|
|
32
|
+
export type HubRetirementOutcome = "reusable" | "retired" | "deferred_busy" | "failed";
|
|
33
|
+
/**
|
|
34
|
+
* Whether the Hub is currently serving sessions, and so must not be shut down
|
|
35
|
+
* under them.
|
|
36
|
+
*
|
|
37
|
+
* Failing open (treating an unanswerable Hub as idle) preserves the existing
|
|
38
|
+
* replacement path for a Hub that is wedged or too old to answer the query;
|
|
39
|
+
* only a Hub that positively reports live sessions is spared.
|
|
40
|
+
*/
|
|
41
|
+
export declare function hubHasLiveSessions(record: Pick<HubServerProbeRecord, "url" | "authToken">): Promise<boolean>;
|
|
42
|
+
export declare function spawnDetachedHubServer(workspaceRoot: string, endpoint?: HubEndpointOverrides): void;
|
|
43
|
+
export declare function spawnDetachedHubServerWithRetry(workspaceRoot: string, endpoint?: HubEndpointOverrides): Promise<void>;
|
|
44
|
+
export declare function prewarmDetachedHubServer(workspaceRoot: string, endpoint?: HubEndpointOverrides & {
|
|
45
|
+
allowPortFallback?: boolean;
|
|
46
|
+
}): void;
|
|
47
|
+
export interface DetachedHubResolution {
|
|
48
|
+
url: string;
|
|
49
|
+
authToken: string;
|
|
50
|
+
}
|
|
51
|
+
export declare function ensureDetachedHubServer(workspaceRoot: string, endpointOverrides?: HubEndpointOverrides & {
|
|
52
|
+
allowPortFallback?: boolean;
|
|
53
|
+
}): Promise<DetachedHubResolution>;
|
|
54
|
+
export interface UpgradeManagedHubOptions {
|
|
55
|
+
workspaceRoot?: string;
|
|
56
|
+
/**
|
|
57
|
+
* How long to wait, after draining, for the hub's live sessions to finish
|
|
58
|
+
* before replacing it (`force`) or giving up (`still_busy`).
|
|
59
|
+
*/
|
|
60
|
+
waitForIdleMs?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Replace the hub even if sessions are still live once the wait expires.
|
|
63
|
+
* Only set this on a user-consented path: those sessions die mid-turn.
|
|
64
|
+
* Honored only once the hub has accepted the drain - a busy hub that
|
|
65
|
+
* refused the drain is never replaced, because the drain is what protects
|
|
66
|
+
* work started during the wait window.
|
|
67
|
+
*/
|
|
68
|
+
force?: boolean;
|
|
69
|
+
/** Recorded as the hub's drain reason, visible in `hub.status`. */
|
|
70
|
+
reason?: string;
|
|
71
|
+
}
|
|
72
|
+
export type UpgradeManagedHubOutcome =
|
|
73
|
+
/** The running older hub was retired and a current-build hub is up. */
|
|
74
|
+
"replaced"
|
|
75
|
+
/** No live hub was found; a current-build hub was started. */
|
|
76
|
+
| "started"
|
|
77
|
+
/** The running hub already matches this build; nothing to do. */
|
|
78
|
+
| "already_current"
|
|
79
|
+
/**
|
|
80
|
+
* The running hub is newer than (or unorderable against) this build.
|
|
81
|
+
* Replacing it would downgrade another install's hub and reopen the
|
|
82
|
+
* mutual-retire loop (#13145), so it is refused; updating this client is
|
|
83
|
+
* the fix.
|
|
84
|
+
*/
|
|
85
|
+
| "hub_not_older"
|
|
86
|
+
/** `force` was not set and sessions never finished - or the hub's
|
|
87
|
+
* activity could never be confirmed, which counts as busy here; the hub
|
|
88
|
+
* was un-drained and left running. */
|
|
89
|
+
| "still_busy";
|
|
90
|
+
export interface UpgradeManagedHubResult {
|
|
91
|
+
outcome: UpgradeManagedHubOutcome;
|
|
92
|
+
url?: string;
|
|
93
|
+
authToken?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Live sessions observed on the old hub at decision time: the sessions
|
|
96
|
+
* that were interrupted (`replaced`) or that kept it running
|
|
97
|
+
* (`still_busy`). Omitted when the hub never answered the activity query.
|
|
98
|
+
*/
|
|
99
|
+
activeSessionCount?: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Replace the managed local hub with one running this build, on the user's
|
|
103
|
+
* explicit say-so. This is the deliberate counterpart to the automatic
|
|
104
|
+
* replacement in `ensureDetachedHubServer`, which defers while the older hub
|
|
105
|
+
* is serving sessions: drain first (the hub refuses new work while in-flight
|
|
106
|
+
* turns get `waitForIdleMs` to finish), then the shared graceful retire
|
|
107
|
+
* ladder, then a fresh daemon. Drain-first is a guarantee, not a courtesy:
|
|
108
|
+
* this function retires a hub only under an accepted drain, because the
|
|
109
|
+
* drain is the admission barrier that keeps any busy or idle reading true
|
|
110
|
+
* through the retire. A hub that refuses the drain fails the upgrade
|
|
111
|
+
* outright - `force` does not override that, and neither does an idle
|
|
112
|
+
* reading, which without the drain is only a snapshot that a newly admitted
|
|
113
|
+
* session could invalidate before the retire lands. (Such a hub is still
|
|
114
|
+
* replaced by the automatic ensure path once idle at the next client
|
|
115
|
+
* startup, the pre-existing recovery route for hubs too old to serve
|
|
116
|
+
* /drain.) Activity readings that fail are treated as unknown, not idle:
|
|
117
|
+
* they never shorten the wait window, and without `force` an unconfirmed
|
|
118
|
+
* hub is handed back un-drained rather than retired.
|
|
119
|
+
*
|
|
120
|
+
* Never replaces a hub this build is not strictly newer than - the build
|
|
121
|
+
* total order guarantees at most one side of any install pair can reach the
|
|
122
|
+
* retire step, which is what keeps two mixed installs from taking turns
|
|
123
|
+
* "upgrading" the hub to their own build.
|
|
124
|
+
*/
|
|
125
|
+
export declare function upgradeManagedHub(options?: UpgradeManagedHubOptions): Promise<UpgradeManagedHubResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ITelemetryService } from "@cerebriline/shared";
|
|
2
|
+
import type { HubScheduleRuntimeHandlers, HubScheduleServiceOptions } from "../../cron/service/schedule-service";
|
|
3
|
+
export interface CreateLocalHubScheduleRuntimeHandlersOptions extends Pick<HubScheduleServiceOptions, "logger"> {
|
|
4
|
+
/**
|
|
5
|
+
* Custom `fetch` implementation forwarded to the scheduler's internal
|
|
6
|
+
* `LocalRuntimeHost`. Used by the AI gateway providers for every
|
|
7
|
+
* scheduled session executed inside this hub process.
|
|
8
|
+
*/
|
|
9
|
+
fetch?: typeof fetch;
|
|
10
|
+
telemetry?: ITelemetryService;
|
|
11
|
+
}
|
|
12
|
+
export declare function createLocalHubScheduleRuntimeHandlers(options?: CreateLocalHubScheduleRuntimeHandlersOptions): HubScheduleRuntimeHandlers;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kept below the caller-side retirement wait so a current daemon exits through
|
|
3
|
+
* its own cleanup deadline before an older caller considers force retirement.
|
|
4
|
+
*/
|
|
5
|
+
export declare const HUB_DAEMON_SHUTDOWN_DEADLINE_MS = 2000;
|
|
6
|
+
export interface HubDaemonShutdownRequest {
|
|
7
|
+
reason: string;
|
|
8
|
+
exitCode: number;
|
|
9
|
+
}
|
|
10
|
+
export type HubDaemonShutdownState = "idle" | "shutting_down" | "forced" | "finished";
|
|
11
|
+
export interface HubDaemonShutdownCoordinatorOptions {
|
|
12
|
+
deadlineMs: number;
|
|
13
|
+
cleanup(): Promise<void>;
|
|
14
|
+
exit(code: number): void;
|
|
15
|
+
onCleanupError?(error: unknown): void;
|
|
16
|
+
onForcedExit?(request: HubDaemonShutdownRequest): void;
|
|
17
|
+
}
|
|
18
|
+
export interface HubDaemonShutdownCoordinator {
|
|
19
|
+
request(request: HubDaemonShutdownRequest): Promise<void>;
|
|
20
|
+
force(request: HubDaemonShutdownRequest): void;
|
|
21
|
+
getState(): HubDaemonShutdownState;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Owns the daemon's monotonic shutdown lifecycle.
|
|
25
|
+
*
|
|
26
|
+
* Every graceful trigger shares one cleanup promise. A later fatal trigger can
|
|
27
|
+
* raise the eventual exit code, but it cannot run cleanup twice. The deadline
|
|
28
|
+
* and an explicit second-signal path both use `force`, whose exit is also
|
|
29
|
+
* guarded so an injected test exit that returns cannot be called repeatedly.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createHubDaemonShutdownCoordinator(options: HubDaemonShutdownCoordinatorOptions): HubDaemonShutdownCoordinator;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type EnsuredHubWebSocketServerResult, type EnsureHubWebSocketServerOptions, type HubWebSocketServer, type HubWebSocketServerOptions } from "../server";
|
|
2
|
+
export type HubServer = HubWebSocketServer;
|
|
3
|
+
export type EnsureHubServerResult = EnsuredHubWebSocketServerResult;
|
|
4
|
+
export interface StartHubServerOptions extends Omit<HubWebSocketServerOptions, "owner"> {
|
|
5
|
+
}
|
|
6
|
+
export interface EnsureHubServerOptions extends Omit<EnsureHubWebSocketServerOptions, "owner"> {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Start a hub WebSocket server bound to the default owner context for the
|
|
10
|
+
* current build environment. Callers that need a custom owner should invoke
|
|
11
|
+
* {@link startHubWebSocketServer} directly.
|
|
12
|
+
*/
|
|
13
|
+
export declare function startHubServer(options: StartHubServerOptions): Promise<HubServer>;
|
|
14
|
+
/**
|
|
15
|
+
* Ensure a hub WebSocket server is running in the default owner context for the
|
|
16
|
+
* current build environment, reusing a compatible in-process instance when available.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ensureHubServer(options: EnsureHubServerOptions): Promise<EnsureHubServerResult>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ITelemetryService } from "@cerebriline/shared";
|
|
2
|
+
export interface HubDaemonTelemetry {
|
|
3
|
+
readonly telemetry: ITelemetryService;
|
|
4
|
+
/** Flushes pending batches and disposes the underlying provider. */
|
|
5
|
+
dispose(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Telemetry for the detached hub daemon process.
|
|
9
|
+
*
|
|
10
|
+
* The daemon hosts the `LocalRuntimeHost` that emits `task.conversation_turn`
|
|
11
|
+
* and `task.tokens` for every hub-backed session, so without its own handle
|
|
12
|
+
* those events are dropped entirely - sessions bill on the backend while
|
|
13
|
+
* reporting nothing to OTel.
|
|
14
|
+
*
|
|
15
|
+
* The daemon is long-lived and frequently starts before the user logs in (or
|
|
16
|
+
* outlives an account switch), so the cached Cline account id is re-resolved
|
|
17
|
+
* periodically rather than only once at startup.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createHubDaemonTelemetry(): HubDaemonTelemetry;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DEFAULT_HUB_HOST = "127.0.0.1";
|
|
2
|
+
export declare const DEFAULT_HUB_PORT = 25463;
|
|
3
|
+
export declare const DEFAULT_HUB_PATHNAME = "/hub";
|
|
4
|
+
export interface HubEndpointOverrides {
|
|
5
|
+
host?: string;
|
|
6
|
+
port?: number;
|
|
7
|
+
pathname?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ResolveHubDefaultsOptions {
|
|
10
|
+
env?: NodeJS.ProcessEnv;
|
|
11
|
+
execArgv?: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveDefaultHubHost(options?: ResolveHubDefaultsOptions): string;
|
|
14
|
+
export declare function resolveDefaultHubPort(options?: ResolveHubDefaultsOptions): number;
|
|
15
|
+
export declare function resolveDefaultHubPathname(options?: ResolveHubDefaultsOptions): string;
|
|
16
|
+
export declare function resolveHubEndpointOptions(overrides?: HubEndpointOverrides, options?: ResolveHubDefaultsOptions): Required<HubEndpointOverrides>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type HubCompatibilityResult, type HubProtocolMetadata } from "@cerebriline/shared";
|
|
2
|
+
import { resolveClineDataDir, resolveClineDir } from "@cerebriline/shared/storage";
|
|
3
|
+
export interface HubServerDiscoveryRecord {
|
|
4
|
+
hubId: string;
|
|
5
|
+
protocolVersion: string;
|
|
6
|
+
minClientProtocolVersion?: string;
|
|
7
|
+
maxClientProtocolVersion?: string;
|
|
8
|
+
capabilities?: readonly string[];
|
|
9
|
+
coreVersion?: string;
|
|
10
|
+
buildId?: string;
|
|
11
|
+
buildEpochMs?: number;
|
|
12
|
+
authToken: string;
|
|
13
|
+
host: string;
|
|
14
|
+
port: number;
|
|
15
|
+
url: string;
|
|
16
|
+
pid?: number;
|
|
17
|
+
startedAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
export type HubServerProbeRecord = {
|
|
21
|
+
protocolVersion: string;
|
|
22
|
+
minClientProtocolVersion?: string;
|
|
23
|
+
maxClientProtocolVersion?: string;
|
|
24
|
+
capabilities?: readonly string[];
|
|
25
|
+
coreVersion?: string;
|
|
26
|
+
buildId?: string;
|
|
27
|
+
buildEpochMs?: number;
|
|
28
|
+
host: string;
|
|
29
|
+
port: number;
|
|
30
|
+
url: string;
|
|
31
|
+
hubId?: string;
|
|
32
|
+
authToken?: string;
|
|
33
|
+
pid?: number;
|
|
34
|
+
startedAt?: string;
|
|
35
|
+
updatedAt?: string;
|
|
36
|
+
};
|
|
37
|
+
export interface HubOwnerContext {
|
|
38
|
+
ownerId: string;
|
|
39
|
+
discoveryPath: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function createHubAuthToken(): string;
|
|
42
|
+
export declare function resolveHubBuildId(): string;
|
|
43
|
+
/**
|
|
44
|
+
* When this SDK build was produced, embedded at bundle time. Orders builds so
|
|
45
|
+
* managed-Hub handling can distinguish a newer daemon (attach and prompt the
|
|
46
|
+
* user to update) from a stale one (retire and replace). Undefined when
|
|
47
|
+
* running from unbundled sources, where no meaningful ordering exists.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveHubBuildEpochMs(): number | undefined;
|
|
50
|
+
export type ManagedHubCompatibilityResult = {
|
|
51
|
+
compatible: true;
|
|
52
|
+
} | {
|
|
53
|
+
compatible: false;
|
|
54
|
+
reason: Exclude<HubCompatibilityResult, {
|
|
55
|
+
compatible: true;
|
|
56
|
+
}>["reason"] | "missing_build" | "build_mismatch";
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Compatibility for a managed local Hub discovered through Cline's owner
|
|
60
|
+
* record. Unlike explicit endpoints, a managed Hub is code that this client
|
|
61
|
+
* is responsible for keeping current, so wire compatibility alone is not
|
|
62
|
+
* enough: reusing a daemon from another build would keep executing stale
|
|
63
|
+
* runtime, scheduler, connector, and command-handler code after an upgrade.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getManagedHubCompatibility(record: HubProtocolMetadata & {
|
|
66
|
+
buildId?: string;
|
|
67
|
+
}, expectedBuildId?: string): ManagedHubCompatibilityResult;
|
|
68
|
+
export interface HubBuildIdentity {
|
|
69
|
+
buildId?: string;
|
|
70
|
+
buildEpochMs?: number;
|
|
71
|
+
coreVersion?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Total order over Hub builds: negative when `a` is older than `b`, positive
|
|
75
|
+
* when newer, zero when the two are indistinguishable.
|
|
76
|
+
*
|
|
77
|
+
* The ordering is what keeps concurrent installations from replacing each
|
|
78
|
+
* other's daemons. A one-sided "may I reuse this?" predicate lets both sides
|
|
79
|
+
* answer no, and two clients then retire each other's Hub forever; a total
|
|
80
|
+
* order is antisymmetric by construction, so at most one side can ever decide
|
|
81
|
+
* to retire. Every tier below preserves that: a field decides only when both
|
|
82
|
+
* records carry it, and the final fallback is "equal", which means reuse.
|
|
83
|
+
*
|
|
84
|
+
* Tiers, in order: identical build, embedded build epoch, core release
|
|
85
|
+
* version, then build id as a deterministic tiebreak.
|
|
86
|
+
*/
|
|
87
|
+
export declare function compareHubBuilds(a: HubBuildIdentity, b: HubBuildIdentity): number;
|
|
88
|
+
/**
|
|
89
|
+
* This build's own identity, in the same shape a daemon publishes into its
|
|
90
|
+
* discovery record.
|
|
91
|
+
*
|
|
92
|
+
* Self and peer identities must be built from the same fields. Enriching only
|
|
93
|
+
* the local side - filling in a `coreVersion` the wire record can omit, say -
|
|
94
|
+
* makes a build's identity depend on which role it is playing, and two
|
|
95
|
+
* installations then decide the comparison on different tiers and each
|
|
96
|
+
* conclude that it is the newer one. Callers that need a synthetic identity
|
|
97
|
+
* pass it verbatim rather than layering overrides onto this.
|
|
98
|
+
*/
|
|
99
|
+
export declare function resolveHubBuildIdentity(): HubBuildIdentity;
|
|
100
|
+
/**
|
|
101
|
+
* Whether a client may keep using a managed local Hub instead of retiring it.
|
|
102
|
+
*
|
|
103
|
+
* A Hub is retired only when this client's build is *strictly newer* by
|
|
104
|
+
* {@link compareHubBuilds}. Same build, newer Hub, and indistinguishable
|
|
105
|
+
* builds all attach over the compatible wire protocol and let the
|
|
106
|
+
* build-mismatch watcher prompt the user to update. Because the decision is
|
|
107
|
+
* derived from a total order, two installations can never retire each other.
|
|
108
|
+
*
|
|
109
|
+
* Genuine protocol incompatibility is unaffected: those Hubs cannot be spoken
|
|
110
|
+
* to at all and are still replaced.
|
|
111
|
+
*/
|
|
112
|
+
export declare function isManagedHubReusable(record: HubProtocolMetadata & HubBuildIdentity, options?: {
|
|
113
|
+
self?: HubBuildIdentity;
|
|
114
|
+
}): boolean;
|
|
115
|
+
export declare function resolveHubOwnerContext(ownerBasis?: string): HubOwnerContext;
|
|
116
|
+
export declare function createInMemoryHubOwnerContext(label?: string): HubOwnerContext;
|
|
117
|
+
export declare function readHubDiscovery(discoveryPath: string): Promise<HubServerDiscoveryRecord | undefined>;
|
|
118
|
+
export interface WriteHubDiscoveryOptions {
|
|
119
|
+
/**
|
|
120
|
+
* Runs synchronously immediately before the record becomes visible to
|
|
121
|
+
* readers (the atomic rename). A server marks itself ready here so that a
|
|
122
|
+
* reader who finds the record can never reach a hub that still answers
|
|
123
|
+
* "Starting": the directory fsync and mutation-lock teardown that follow
|
|
124
|
+
* the rename are not part of the readiness window.
|
|
125
|
+
*/
|
|
126
|
+
beforePublish?: () => void;
|
|
127
|
+
}
|
|
128
|
+
export declare function writeHubDiscovery(discoveryPath: string, record: HubServerDiscoveryRecord, options?: WriteHubDiscoveryOptions): Promise<void>;
|
|
129
|
+
export declare function clearHubDiscovery(discoveryPath: string): Promise<void>;
|
|
130
|
+
export declare function clearHubDiscoveryIfOwned(discoveryPath: string, hubId: string): Promise<boolean>;
|
|
131
|
+
export declare function withHubStartupLock<T>(discoveryPath: string, callback: () => Promise<T>): Promise<T>;
|
|
132
|
+
export declare function probeHubServer(url: string, options?: {
|
|
133
|
+
authToken?: string;
|
|
134
|
+
}): Promise<HubServerProbeRecord | undefined>;
|
|
135
|
+
export declare function createHubServerUrl(host: string, port: number, pathname?: string): string;
|
|
136
|
+
export declare function toHubHealthUrl(wsUrl: string): string;
|
|
137
|
+
export declare function toHubStatusUrl(wsUrl: string): string;
|
|
138
|
+
export declare function isDiscoveryFilePresent(pathname: string): boolean;
|
|
139
|
+
export { resolveClineDataDir, resolveClineDir };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OS-backed exclusive Hub instance lock.
|
|
3
|
+
*
|
|
4
|
+
* Authority over a Hub owner context (the discovery path) is an
|
|
5
|
+
* operating-system exclusive lock, not a PID file, not a heartbeat, and not
|
|
6
|
+
* build arbitration: the lock is a SQLite database held inside a
|
|
7
|
+
* never-committed `BEGIN EXCLUSIVE` transaction, which SQLite maps onto OS
|
|
8
|
+
* file locks. The kernel releases the lock the instant the holding process
|
|
9
|
+
* dies — crashed holders cannot leak ownership, and a live holder cannot be
|
|
10
|
+
* displaced by deleting a file.
|
|
11
|
+
*
|
|
12
|
+
* A process that fails to acquire the lock must connect to the running Hub
|
|
13
|
+
* or diagnose — never kill it and never bind another endpoint on its own.
|
|
14
|
+
* This makes the historical mutual-retire loop (two installs SIGTERMing each
|
|
15
|
+
* other's daemon, #13145/#13230) structurally impossible: at most one live
|
|
16
|
+
* Hub can exist per owner context, enforced by the OS before either process
|
|
17
|
+
* gets a chance to disagree.
|
|
18
|
+
*
|
|
19
|
+
* The startup-lock directory (`<discoveryPath>.lock`, see `withHubLock`)
|
|
20
|
+
* remains a short-lived mutex around discovery reads/writes; this lock is a
|
|
21
|
+
* different thing — it is held for the entire lifetime of the serving Hub.
|
|
22
|
+
*/
|
|
23
|
+
/** Exit code for a daemon that lost the singleton race: diagnose, never replace. */
|
|
24
|
+
export declare const HUB_LOCK_HELD_EXIT_CODE = 3;
|
|
25
|
+
/** The lock is held by another live Hub process (or connection). */
|
|
26
|
+
export declare class HubLockHeldError extends Error {
|
|
27
|
+
readonly lockFile: string;
|
|
28
|
+
constructor(lockFile: string);
|
|
29
|
+
}
|
|
30
|
+
export declare function isHubLockHeldError(error: unknown): error is HubLockHeldError;
|
|
31
|
+
/** The lock file that guards one owner context (derived from its discovery path). */
|
|
32
|
+
export declare function resolveHubInstanceLockPath(discoveryPath: string): string;
|
|
33
|
+
export declare class HubInstanceLock {
|
|
34
|
+
private db;
|
|
35
|
+
readonly lockFile: string;
|
|
36
|
+
private constructor();
|
|
37
|
+
get held(): boolean;
|
|
38
|
+
/** Release the lock (process exit releases it too, via the OS). */
|
|
39
|
+
release(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Attempt to take exclusive ownership of a Hub owner context. Throws
|
|
42
|
+
* `HubLockHeldError` when another live process holds it.
|
|
43
|
+
*
|
|
44
|
+
* Only a positively held lock (SQLITE_BUSY/LOCKED) refuses startup. Any
|
|
45
|
+
* other failure — SQLite unavailable in this runtime, an unwritable lock
|
|
46
|
+
* directory — degrades to an unheld lock (`held === false`) and the Hub
|
|
47
|
+
* starts without singleton enforcement, matching how the event log and
|
|
48
|
+
* run queue already degrade rather than making SQLite a hard requirement.
|
|
49
|
+
*/
|
|
50
|
+
static acquire(lockFile: string): HubInstanceLock;
|
|
51
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HubOwnerContext } from ".";
|
|
2
|
+
export declare function resolveWorkspaceHubOwnerContext(workspaceRoot: string): HubOwnerContext;
|
|
3
|
+
/**
|
|
4
|
+
* Development builds change on every compile, so a single shared owner record
|
|
5
|
+
* puts every checkout and every rebuild in contention for one daemon - and the
|
|
6
|
+
* loser of that contention gets shut down mid-session. Scoping the owner by
|
|
7
|
+
* build id lets differing dev builds run their own Hub side by side instead of
|
|
8
|
+
* arbitrating over one. Production keeps a single owner (see
|
|
9
|
+
* {@link resolveProductionHubOwnerContext}), where the singleton matters and
|
|
10
|
+
* builds are ordered.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveSharedHubOwnerContext(label?: string): HubOwnerContext;
|
|
13
|
+
export declare function resolveProductionHubOwnerContext(): HubOwnerContext;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type { ITelemetryService } from "@cerebriline/shared";
|
|
2
|
+
export { HubScheduleCommandService } from "../cron/service/schedule-command-service";
|
|
3
|
+
export { HubScheduleService } from "../cron/service/schedule-service";
|
|
4
|
+
export { type AgentScheduleServiceApi, executeScheduleOperation, type ScheduledTaskInput, ScheduledTaskInputSchema, type ScheduledTaskResult, type ScheduleTaskOperationOptions, } from "../cron/service/schedule-tool";
|
|
5
|
+
/**
|
|
6
|
+
* Re-exported so detached hub daemon entry points (e.g. the VS Code
|
|
7
|
+
* `hub-daemon.ts` companion process) can construct a telemetry service
|
|
8
|
+
* from a single `@cerebriline/core/hub` import. The hub daemon is the
|
|
9
|
+
* canonical owner of telemetry forwarding for sessions executed inside
|
|
10
|
+
* the detached process, so the factory belongs on the hub surface even
|
|
11
|
+
* though its implementation lives under `services/telemetry`.
|
|
12
|
+
*
|
|
13
|
+
* `createConfiguredTelemetryHandle` is the preferred entry point for
|
|
14
|
+
* hosts: it bundles the telemetry service together with the canonical
|
|
15
|
+
* `flush`/`dispose` closures so detached daemons, the VS Code extension,
|
|
16
|
+
* and the CLI can share one implementation instead of each
|
|
17
|
+
* re-deriving the same lifecycle plumbing.
|
|
18
|
+
*/
|
|
19
|
+
export { type ConfiguredTelemetryHandle, type CreateOpenTelemetryTelemetryServiceOptions, createConfiguredTelemetryHandle, createConfiguredTelemetryService, } from "../services/telemetry/OpenTelemetryProvider";
|
|
20
|
+
export { type CreateTasksToolOptions, createTasksPromptExtension, createTasksTool, TASKS_SYSTEM_PROMPT_RULE, TASKS_TOOL_NAME, type TasksToolInput, TasksToolInputSchema, type TasksToolResult, } from "../tasks/task-tool";
|
|
21
|
+
export * from "./client";
|
|
22
|
+
export * from "./client/connect";
|
|
23
|
+
export * from "./client/managed-hub-build-watcher";
|
|
24
|
+
export * from "./client/session-client";
|
|
25
|
+
export * from "./client/ui-client";
|
|
26
|
+
export * from "./daemon";
|
|
27
|
+
export * from "./daemon/runtime-handlers";
|
|
28
|
+
export * from "./daemon/start-shared-server";
|
|
29
|
+
export * from "./discovery";
|
|
30
|
+
export * from "./discovery/defaults";
|
|
31
|
+
export * from "./discovery/instance-lock";
|
|
32
|
+
export * from "./discovery/workspace";
|
|
33
|
+
export * from "./server";
|
|
34
|
+
export * from "./server/browser-websocket";
|
|
35
|
+
export * from "./server/command-transport";
|
|
36
|
+
export * from "./server/hub-event-log";
|
|
37
|
+
export * from "./server/hub-run-queue";
|
|
38
|
+
export * from "./server/native-transport";
|