@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,236 @@
|
|
|
1
|
+
import type { MessageWithMetadata } from "@cerebriline/llms";
|
|
2
|
+
import type { AgentConfig, AutomationEventEnvelope, BasicLogger, ITelemetryService } from "@cerebriline/shared";
|
|
3
|
+
import type { CronEventSuppression } from "../cron/events/cron-event-ingress";
|
|
4
|
+
import type { CronEventLogRecord, CronRunRecord, CronSpecRecord } from "../cron/store/sqlite-cron-store";
|
|
5
|
+
import type { CheckpointEntry } from "../hooks/checkpoint-hooks";
|
|
6
|
+
import type { RuntimeCapabilities } from "../runtime/capabilities";
|
|
7
|
+
import type { SessionHistoryListOptions } from "../runtime/host/history";
|
|
8
|
+
import type { SessionBackend } from "../runtime/host/host";
|
|
9
|
+
import type { LocalRuntimeStartOptions, RuntimeHostMode, StartSessionInput, StartSessionResult } from "../runtime/host/runtime-host";
|
|
10
|
+
import type { FeatureFlagsService } from "../services/feature-flags";
|
|
11
|
+
import type { CheckpointWorkspaceCompareResult } from "../session/checkpoint-diff";
|
|
12
|
+
import type { ClineCoreStartConfig } from "../types/config";
|
|
13
|
+
import type { SessionMessagesArtifactUploader } from "../types/session";
|
|
14
|
+
export type { RuntimeHostMode } from "../runtime/host/runtime-host";
|
|
15
|
+
export type { ClineCoreSettingsApi } from "../settings";
|
|
16
|
+
export interface HubOptions {
|
|
17
|
+
endpoint?: string;
|
|
18
|
+
authToken?: string;
|
|
19
|
+
strategy?: "prefer-hub" | "require-hub";
|
|
20
|
+
clientType?: string;
|
|
21
|
+
displayName?: string;
|
|
22
|
+
workspaceRoot?: string;
|
|
23
|
+
cwd?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RemoteOptions {
|
|
26
|
+
endpoint: string;
|
|
27
|
+
authToken?: string;
|
|
28
|
+
clientType?: string;
|
|
29
|
+
displayName?: string;
|
|
30
|
+
workspaceRoot?: string;
|
|
31
|
+
cwd?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ClineCoreAutomationOptions {
|
|
34
|
+
/** @deprecated Use `cronSpecsDir`. */
|
|
35
|
+
cronDir?: string;
|
|
36
|
+
cronSpecsDir?: string;
|
|
37
|
+
/** @deprecated Reports are written under the resolved cron specs directory. */
|
|
38
|
+
reportsDir?: string;
|
|
39
|
+
cronScope?: "global" | "user" | "workspace";
|
|
40
|
+
workspaceRoot?: string;
|
|
41
|
+
dbPath?: string;
|
|
42
|
+
pollIntervalMs?: number;
|
|
43
|
+
claimLeaseSeconds?: number;
|
|
44
|
+
globalMaxConcurrency?: number;
|
|
45
|
+
watcherDebounceMs?: number;
|
|
46
|
+
autoStart?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export type ClineAutomationSpec = CronSpecRecord;
|
|
49
|
+
export type ClineAutomationRun = CronRunRecord;
|
|
50
|
+
export type ClineAutomationEventLog = CronEventLogRecord;
|
|
51
|
+
export type ClineAutomationEventSuppression = CronEventSuppression;
|
|
52
|
+
export type ClineAutomationRunStatus = "queued" | "running" | "done" | "failed" | "cancelled";
|
|
53
|
+
export interface ClineAutomationListSpecsOptions {
|
|
54
|
+
triggerKind?: "one_off" | "schedule" | "event";
|
|
55
|
+
enabled?: boolean;
|
|
56
|
+
parseStatus?: "valid" | "invalid";
|
|
57
|
+
includeRemoved?: boolean;
|
|
58
|
+
limit?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface ClineAutomationListRunsOptions {
|
|
61
|
+
specId?: string;
|
|
62
|
+
status?: ClineAutomationRunStatus | ClineAutomationRunStatus[];
|
|
63
|
+
limit?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface ClineAutomationListEventsOptions {
|
|
66
|
+
eventType?: string;
|
|
67
|
+
source?: string;
|
|
68
|
+
processingStatus?: "received" | "unmatched" | "queued" | "suppressed" | "failed";
|
|
69
|
+
limit?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface ClineAutomationEventIngressResult {
|
|
72
|
+
event: ClineAutomationEventLog;
|
|
73
|
+
duplicate: boolean;
|
|
74
|
+
matchedSpecIds: string[];
|
|
75
|
+
queuedRuns: ClineAutomationRun[];
|
|
76
|
+
suppressions: ClineAutomationEventSuppression[];
|
|
77
|
+
}
|
|
78
|
+
export interface ClineCoreAutomationApi {
|
|
79
|
+
start(): Promise<void>;
|
|
80
|
+
stop(): Promise<void>;
|
|
81
|
+
reconcileNow(): Promise<void>;
|
|
82
|
+
ingestEvent(event: AutomationEventEnvelope): ClineAutomationEventIngressResult;
|
|
83
|
+
listEvents(options?: ClineAutomationListEventsOptions): ClineAutomationEventLog[];
|
|
84
|
+
getEvent(eventId: string): ClineAutomationEventLog | undefined;
|
|
85
|
+
listSpecs(options?: ClineAutomationListSpecsOptions): ClineAutomationSpec[];
|
|
86
|
+
listRuns(options?: ClineAutomationListRunsOptions): ClineAutomationRun[];
|
|
87
|
+
}
|
|
88
|
+
export type ClineCoreListHistoryOptions = SessionHistoryListOptions;
|
|
89
|
+
export interface ClineCoreStartInput extends Omit<StartSessionInput, "config" | "localRuntime"> {
|
|
90
|
+
config: ClineCoreStartConfig;
|
|
91
|
+
localRuntime?: LocalRuntimeStartOptions;
|
|
92
|
+
}
|
|
93
|
+
export interface RestoreOptions {
|
|
94
|
+
/**
|
|
95
|
+
* Restore the message history by starting a new session fork trimmed to
|
|
96
|
+
* `checkpointRunCount`. Defaults to true.
|
|
97
|
+
*/
|
|
98
|
+
messages?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Restore the workspace files from the checkpoint's git snapshot.
|
|
101
|
+
* Defaults to true.
|
|
102
|
+
*/
|
|
103
|
+
workspace?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Start the forked session with messages before the checkpoint user message
|
|
106
|
+
* while still returning messages through that user message. This is for
|
|
107
|
+
* clients that put the checkpoint message back into a compose box so it can
|
|
108
|
+
* be edited and submitted again without duplicating it in session history.
|
|
109
|
+
*/
|
|
110
|
+
omitCheckpointMessageFromSession?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface RestoreInput {
|
|
113
|
+
sessionId: string;
|
|
114
|
+
checkpointRunCount: number;
|
|
115
|
+
start?: ClineCoreStartInput;
|
|
116
|
+
cwd?: string;
|
|
117
|
+
restore?: RestoreOptions;
|
|
118
|
+
}
|
|
119
|
+
export interface RestoreResult {
|
|
120
|
+
sessionId?: string;
|
|
121
|
+
startResult?: StartSessionResult;
|
|
122
|
+
messages?: MessageWithMetadata[];
|
|
123
|
+
checkpoint: CheckpointEntry;
|
|
124
|
+
}
|
|
125
|
+
export interface CompareCheckpointInput {
|
|
126
|
+
sessionId: string;
|
|
127
|
+
checkpointRunCount: number;
|
|
128
|
+
cwd?: string;
|
|
129
|
+
}
|
|
130
|
+
export type CompareCheckpointResult = CheckpointWorkspaceCompareResult;
|
|
131
|
+
export interface ClineCoreOptions {
|
|
132
|
+
/**
|
|
133
|
+
* A human-readable name for this SDK client (e.g. `"my-app"`, `"acme-bot"`).
|
|
134
|
+
* Used to identify the consumer in telemetry and logs.
|
|
135
|
+
*/
|
|
136
|
+
clientName?: string;
|
|
137
|
+
/**
|
|
138
|
+
* A stable identifier for this machine or user, used for telemetry attribution.
|
|
139
|
+
* Defaults to the system machine ID, falling back to a generated `cl-<nanoid>` persisted
|
|
140
|
+
* at `~/.cline/data/machine-id`.
|
|
141
|
+
*/
|
|
142
|
+
distinctId?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Controls how the runtime host is selected:
|
|
145
|
+
* - `"auto"` (default) — prefers a compatible local hub when one is available and falls
|
|
146
|
+
* back to local in-process execution when not.
|
|
147
|
+
* - `"hub"` — requires a compatible websocket hub runtime; throws if one is not reachable.
|
|
148
|
+
* - `"remote"` — requires an explicit remote websocket hub endpoint.
|
|
149
|
+
* - `"local"` — always uses local in-process execution and local SQLite/file storage.
|
|
150
|
+
*/
|
|
151
|
+
backendMode?: RuntimeHostMode;
|
|
152
|
+
/**
|
|
153
|
+
* Hub runtime connection options. Used when `backendMode` is `"hub"` or when `"auto"`
|
|
154
|
+
* should prefer a shared local hub if available.
|
|
155
|
+
*/
|
|
156
|
+
hub?: HubOptions;
|
|
157
|
+
/**
|
|
158
|
+
* Remote hub connection options. Only relevant when `backendMode` is `"remote"`.
|
|
159
|
+
*/
|
|
160
|
+
remote?: RemoteOptions;
|
|
161
|
+
/**
|
|
162
|
+
* Client-owned runtime capabilities. Core adapts these handlers to the
|
|
163
|
+
* selected runtime backend so apps implement interactive behavior once.
|
|
164
|
+
*/
|
|
165
|
+
capabilities?: RuntimeCapabilities;
|
|
166
|
+
/**
|
|
167
|
+
* Telemetry service instance to use for capturing events and usage.
|
|
168
|
+
* If omitted, telemetry is a no-op.
|
|
169
|
+
*/
|
|
170
|
+
telemetry?: ITelemetryService;
|
|
171
|
+
/**
|
|
172
|
+
* Feature flags service for this ClineCore instance.
|
|
173
|
+
* If omitted, Core uses a no-op provider with default flag values.
|
|
174
|
+
*/
|
|
175
|
+
featureFlags?: FeatureFlagsService;
|
|
176
|
+
/**
|
|
177
|
+
* Optional structured logger for core-side operational diagnostics such as
|
|
178
|
+
* runtime-host selection and fallback decisions.
|
|
179
|
+
*/
|
|
180
|
+
logger?: BasicLogger;
|
|
181
|
+
/**
|
|
182
|
+
* Per-tool approval policies that control whether a tool runs automatically,
|
|
183
|
+
* requires user confirmation, or is blocked entirely.
|
|
184
|
+
*/
|
|
185
|
+
toolPolicies?: AgentConfig["toolPolicies"];
|
|
186
|
+
/**
|
|
187
|
+
* Optional hook invoked after `messages.json` is persisted to disk.
|
|
188
|
+
* Consumers can use this to mirror session transcripts into remote storage.
|
|
189
|
+
*/
|
|
190
|
+
messagesArtifactUploader?: SessionMessagesArtifactUploader;
|
|
191
|
+
/**
|
|
192
|
+
* Enables file-based and event-driven automation through this ClineCore
|
|
193
|
+
* instance. When configured, callers use `cline.automation.*` instead of
|
|
194
|
+
* constructing cron services directly.
|
|
195
|
+
*/
|
|
196
|
+
automation?: boolean | ClineCoreAutomationOptions;
|
|
197
|
+
/**
|
|
198
|
+
* Custom `fetch` implementation forwarded to the AI gateway providers used
|
|
199
|
+
* by local sessions. When supplied, it is threaded into each
|
|
200
|
+
* `ProviderConfig.fetch` built during session bootstrap, which in turn
|
|
201
|
+
* populates `GatewayProviderSettings.fetch` (and the top-level
|
|
202
|
+
* `GatewayConfig.fetch` fallback) so hosts can inject custom HTTP behavior
|
|
203
|
+
* such as proxies, retries, tracing, or test doubles.
|
|
204
|
+
*
|
|
205
|
+
* Per-session or per-provider overrides still win: an explicit
|
|
206
|
+
* `config.fetch` on `CoreSessionConfig` or a stored provider-level `fetch`
|
|
207
|
+
* takes precedence over this default.
|
|
208
|
+
*
|
|
209
|
+
* Applies only to sessions executed in this process (local and fallback-
|
|
210
|
+
* to-local auto mode). For hub and remote runtimes the HTTP call happens
|
|
211
|
+
* inside the process that owns the gateway, so configure `fetch` there:
|
|
212
|
+
* - `startHubServer({ fetch })` / `ensureHubServer({ fetch })` from
|
|
213
|
+
* `@cline/hub`
|
|
214
|
+
* - `createLocalHubScheduleRuntimeHandlers({ fetch })` from
|
|
215
|
+
* `@cerebriline/core/hub` for the scheduler
|
|
216
|
+
*/
|
|
217
|
+
fetch?: typeof fetch;
|
|
218
|
+
/**
|
|
219
|
+
* An already-constructed session backend to use instead of resolving one automatically.
|
|
220
|
+
* Intended for testing or embedding a custom persistence layer.
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
sessionService?: SessionBackend;
|
|
224
|
+
/**
|
|
225
|
+
* Optional hook invoked before each session starts.
|
|
226
|
+
* Use this to prepare workspace-scoped runtime state and then return an
|
|
227
|
+
* adapter that mutates the shared session input before core starts the run.
|
|
228
|
+
* This runs before the execution host resolves an omitted workspace, so
|
|
229
|
+
* pathless starts expose neither `cwd` nor `workspaceRoot` to this hook.
|
|
230
|
+
*/
|
|
231
|
+
prepare?: (input: ClineCoreStartInput) => Promise<StartSessionBootstrap | undefined> | StartSessionBootstrap | undefined;
|
|
232
|
+
}
|
|
233
|
+
export interface StartSessionBootstrap {
|
|
234
|
+
applyToStartSessionInput(input: ClineCoreStartInput): Promise<ClineCoreStartInput> | ClineCoreStartInput;
|
|
235
|
+
dispose?(): Promise<void> | void;
|
|
236
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AutomationEventEnvelope, BasicLogger } from "@cerebriline/shared";
|
|
2
|
+
import type { CronEventLogRecord, CronRunRecord, CronSpecRecord, SqliteCronStore } from "../store/sqlite-cron-store";
|
|
3
|
+
/**
|
|
4
|
+
* Durable ingress for normalized automation events.
|
|
5
|
+
*
|
|
6
|
+
* This layer persists the incoming event before matching, then materializes
|
|
7
|
+
* queued `cron_runs` for matching event specs. It deliberately does not
|
|
8
|
+
* execute agents; the normal runner claim loop owns execution.
|
|
9
|
+
*/
|
|
10
|
+
export interface CronEventIngressOptions {
|
|
11
|
+
store: SqliteCronStore;
|
|
12
|
+
now?: () => number;
|
|
13
|
+
logger?: BasicLogger;
|
|
14
|
+
}
|
|
15
|
+
export type CronEventSuppressionReason = "duplicate_event" | "filter_mismatch" | "dedupe_window" | "cooldown";
|
|
16
|
+
export interface CronEventSuppression {
|
|
17
|
+
specId?: string;
|
|
18
|
+
externalId?: string;
|
|
19
|
+
reason: CronEventSuppressionReason;
|
|
20
|
+
dedupeKey?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CronEventIngressResult {
|
|
23
|
+
event: CronEventLogRecord;
|
|
24
|
+
duplicate: boolean;
|
|
25
|
+
matchedSpecs: CronSpecRecord[];
|
|
26
|
+
queuedRuns: CronRunRecord[];
|
|
27
|
+
suppressions: CronEventSuppression[];
|
|
28
|
+
}
|
|
29
|
+
export declare function automationEventMatchesFilters(event: AutomationEventEnvelope, filters: Record<string, unknown> | undefined): boolean;
|
|
30
|
+
export declare class CronEventIngress {
|
|
31
|
+
private readonly store;
|
|
32
|
+
private readonly nowFn;
|
|
33
|
+
private readonly logger?;
|
|
34
|
+
constructor(options: CronEventIngressOptions);
|
|
35
|
+
ingestEvent(event: AutomationEventEnvelope): CronEventIngressResult;
|
|
36
|
+
private materializeForSpec;
|
|
37
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ResolveCronSpecsDirOptions } from "@cerebriline/shared/storage";
|
|
2
|
+
import type { CronEventLogRecord, CronRunRecord, CronSpecRecord } from "../store/sqlite-cron-store";
|
|
3
|
+
/**
|
|
4
|
+
* Writes a markdown report for a completed or failed cron run.
|
|
5
|
+
* Reports live under `<cron-specs-dir>/reports/<run-id>.md`.
|
|
6
|
+
* By default that is `~/.cline/cron/reports/<run-id>.md`.
|
|
7
|
+
* and are derived artifacts — the database is still the operational source
|
|
8
|
+
* of truth.
|
|
9
|
+
*/
|
|
10
|
+
export interface CronRunReportData {
|
|
11
|
+
finalText?: string;
|
|
12
|
+
usage?: {
|
|
13
|
+
inputTokens?: number;
|
|
14
|
+
outputTokens?: number;
|
|
15
|
+
cacheReadTokens?: number;
|
|
16
|
+
cacheWriteTokens?: number;
|
|
17
|
+
totalCost?: number;
|
|
18
|
+
};
|
|
19
|
+
toolCalls?: Array<{
|
|
20
|
+
name: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
durationMs?: number;
|
|
23
|
+
}>;
|
|
24
|
+
durationMs?: number;
|
|
25
|
+
error?: string;
|
|
26
|
+
/** Optional context for where in the run lifecycle the error occurred. */
|
|
27
|
+
errorContext?: string;
|
|
28
|
+
triggerEvent?: CronEventLogRecord;
|
|
29
|
+
}
|
|
30
|
+
export interface WriteReportOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Cron spec source/report location. Defaults to global `~/.cline/cron`.
|
|
33
|
+
* Pass `{ scope: "workspace", workspaceRoot }` to write reports beside a
|
|
34
|
+
* future workspace-scoped cron specs directory.
|
|
35
|
+
*/
|
|
36
|
+
specs?: ResolveCronSpecsDirOptions;
|
|
37
|
+
workspaceRoot: string;
|
|
38
|
+
run: CronRunRecord;
|
|
39
|
+
spec: CronSpecRecord;
|
|
40
|
+
data: CronRunReportData;
|
|
41
|
+
}
|
|
42
|
+
export declare function writeCronRunReport(options: WriteReportOptions): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CronSpecRecord, SqliteCronStore } from "../store/sqlite-cron-store";
|
|
2
|
+
/**
|
|
3
|
+
* Queue materialization rules shared between the reconciler, watcher, and
|
|
4
|
+
* periodic runner tick. Execution stays trigger-agnostic once a row is
|
|
5
|
+
* queued; this module is the only place that decides when to create a row.
|
|
6
|
+
*/
|
|
7
|
+
export interface CronMaterializerOptions {
|
|
8
|
+
store: SqliteCronStore;
|
|
9
|
+
now?: () => number;
|
|
10
|
+
}
|
|
11
|
+
export interface MaterializeSummary {
|
|
12
|
+
oneOffQueued: number;
|
|
13
|
+
scheduleQueued: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class CronMaterializer {
|
|
16
|
+
private readonly store;
|
|
17
|
+
private readonly nowFn;
|
|
18
|
+
constructor(options: CronMaterializerOptions);
|
|
19
|
+
/**
|
|
20
|
+
* Run materialization for every valid/enabled spec. Typically called at
|
|
21
|
+
* startup (after reconciliation) and on each runner tick.
|
|
22
|
+
*/
|
|
23
|
+
materializeAll(): MaterializeSummary;
|
|
24
|
+
/**
|
|
25
|
+
* Ensure a single one-off spec has exactly one run record for its current
|
|
26
|
+
* revision unless an explicit rerun path creates a different trigger kind.
|
|
27
|
+
* Returns true if a new queued run was created.
|
|
28
|
+
*/
|
|
29
|
+
materializeOneOff(spec: CronSpecRecord): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Materialize schedule runs. Implements the "one overdue catch-up on
|
|
32
|
+
* startup, then advance" policy described in PLAN.md.
|
|
33
|
+
*/
|
|
34
|
+
materializeSchedule(spec: CronSpecRecord): boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { BasicLogger } from "@cerebriline/shared";
|
|
2
|
+
import type { ResolveCronSpecsDirOptions } from "@cerebriline/shared/storage";
|
|
3
|
+
import type { HubScheduleRuntimeHandlers } from "../service/schedule-service";
|
|
4
|
+
import type { CronRunRecord, CronSpecRecord, SqliteCronStore } from "../store/sqlite-cron-store";
|
|
5
|
+
import type { CronMaterializer } from "./cron-materializer";
|
|
6
|
+
/**
|
|
7
|
+
* Session metadata keys that identify the automation run a session belongs
|
|
8
|
+
* to. Clients (e.g. the desktop sidebar) read these to group a schedule's
|
|
9
|
+
* runs together and label each one, so they are part of the session
|
|
10
|
+
* metadata contract; keep them in sync with the readers.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RUN_SESSION_METADATA_KEYS: {
|
|
13
|
+
readonly scheduleId: "scheduleId";
|
|
14
|
+
readonly scheduleName: "scheduleName";
|
|
15
|
+
readonly scheduleExecutionId: "scheduleExecutionId";
|
|
16
|
+
readonly scheduleRunNumber: "scheduleRunNumber";
|
|
17
|
+
};
|
|
18
|
+
export declare function buildRunSessionMetadata(spec: Pick<CronSpecRecord, "externalId" | "title">, run: Pick<CronRunRecord, "runId">, runNumber: number | undefined): Record<string, unknown>;
|
|
19
|
+
export interface CronRunnerOptions {
|
|
20
|
+
store: SqliteCronStore;
|
|
21
|
+
materializer: CronMaterializer;
|
|
22
|
+
runtimeHandlers: HubScheduleRuntimeHandlers;
|
|
23
|
+
eventPublisher?: (eventType: string, payload: Record<string, unknown>) => void;
|
|
24
|
+
/** Default runtime workspace for the hub/daemon process. */
|
|
25
|
+
workspaceRoot: string;
|
|
26
|
+
/** Cron spec source/report location. Defaults to global `~/.cline/cron`. */
|
|
27
|
+
specs?: ResolveCronSpecsDirOptions;
|
|
28
|
+
logger?: BasicLogger;
|
|
29
|
+
pollIntervalMs?: number;
|
|
30
|
+
claimLeaseSeconds?: number;
|
|
31
|
+
globalMaxConcurrency?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare class CronRunner {
|
|
34
|
+
private readonly store;
|
|
35
|
+
private readonly materializer;
|
|
36
|
+
private readonly options;
|
|
37
|
+
private readonly limiter;
|
|
38
|
+
private readonly claimLeaseMs;
|
|
39
|
+
private timer;
|
|
40
|
+
private started;
|
|
41
|
+
private ticking;
|
|
42
|
+
private disposed;
|
|
43
|
+
private stopping;
|
|
44
|
+
private readonly activeRuns;
|
|
45
|
+
constructor(options: CronRunnerOptions);
|
|
46
|
+
start(): Promise<void>;
|
|
47
|
+
stop(): Promise<void>;
|
|
48
|
+
dispose(): Promise<void>;
|
|
49
|
+
tick(): Promise<void>;
|
|
50
|
+
getActiveRuns(): Array<CronRunRecord & {
|
|
51
|
+
claimToken: string;
|
|
52
|
+
sessionId?: string;
|
|
53
|
+
}>;
|
|
54
|
+
private executeClaim;
|
|
55
|
+
private publishScheduleExecutionEvent;
|
|
56
|
+
private buildPrompt;
|
|
57
|
+
private startClaimLeaseHeartbeat;
|
|
58
|
+
private buildSystemPrompt;
|
|
59
|
+
private buildStartRequest;
|
|
60
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class ResourceLimiter {
|
|
2
|
+
private readonly globalMaxConcurrency;
|
|
3
|
+
private readonly activeExecutions;
|
|
4
|
+
constructor(globalMaxConcurrency: number);
|
|
5
|
+
acquire(scheduleId: string, executionId: string, maxParallel: number): boolean;
|
|
6
|
+
release(scheduleId: string, executionId: string): void;
|
|
7
|
+
getGlobalActiveCount(): number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ParsedCron {
|
|
2
|
+
minutes: number[];
|
|
3
|
+
hours: number[];
|
|
4
|
+
daysOfMonth: number[];
|
|
5
|
+
months: number[];
|
|
6
|
+
daysOfWeek: number[];
|
|
7
|
+
}
|
|
8
|
+
export declare function parseCron(pattern: string): ParsedCron;
|
|
9
|
+
export declare function validateCronPattern(pattern: string): void;
|
|
10
|
+
export declare function validateCronSchedule(pattern: string, timezone?: string, after?: number): void;
|
|
11
|
+
export declare function validateTimezone(timezone: string | undefined): void;
|
|
12
|
+
export declare function getNextCronTime(pattern: string, after: number, timezone?: string): number;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AutomationEventEnvelope, BasicLogger } from "@cerebriline/shared";
|
|
2
|
+
import type { ResolveCronSpecsDirOptions } from "@cerebriline/shared/storage";
|
|
3
|
+
import { type CronEventIngressResult } from "../events/cron-event-ingress";
|
|
4
|
+
import type { CronRunRecord, CronSpecRecord, ListEventLogsOptions, ListRunsOptions, ListSpecsOptions } from "../store/sqlite-cron-store";
|
|
5
|
+
import type { HubScheduleRuntimeHandlers } from "./schedule-service";
|
|
6
|
+
/**
|
|
7
|
+
* Top-level orchestrator for file-based cron automation.
|
|
8
|
+
*
|
|
9
|
+
* Wires together:
|
|
10
|
+
* - `SqliteCronStore` (cron.db)
|
|
11
|
+
* - `CronReconciler` (disk -> DB)
|
|
12
|
+
* - `CronWatcher` (cron specs directory filesystem events)
|
|
13
|
+
* - `CronMaterializer` (queue materialization)
|
|
14
|
+
* - `CronRunner` (claim + execute + report)
|
|
15
|
+
*
|
|
16
|
+
* This service is the forward path: the legacy `HubScheduleService`
|
|
17
|
+
* continues to serve programmatic schedules, while `CronService` handles
|
|
18
|
+
* everything sourced from the configured file-based cron directory.
|
|
19
|
+
*/
|
|
20
|
+
export interface CronServiceOptions {
|
|
21
|
+
/** Default runtime workspace for the hub/daemon process. */
|
|
22
|
+
workspaceRoot: string;
|
|
23
|
+
/** Cron spec source/report location. Defaults to global `~/.cline/cron`. */
|
|
24
|
+
specs?: ResolveCronSpecsDirOptions;
|
|
25
|
+
runtimeHandlers: HubScheduleRuntimeHandlers;
|
|
26
|
+
dbPath?: string;
|
|
27
|
+
logger?: BasicLogger;
|
|
28
|
+
pollIntervalMs?: number;
|
|
29
|
+
claimLeaseSeconds?: number;
|
|
30
|
+
globalMaxConcurrency?: number;
|
|
31
|
+
watcherDebounceMs?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare class CronService {
|
|
34
|
+
private readonly store;
|
|
35
|
+
private readonly reconciler;
|
|
36
|
+
private readonly watcher;
|
|
37
|
+
private readonly eventIngress;
|
|
38
|
+
private readonly materializer;
|
|
39
|
+
private readonly runner;
|
|
40
|
+
private started;
|
|
41
|
+
private disposed;
|
|
42
|
+
constructor(options: CronServiceOptions);
|
|
43
|
+
start(): Promise<void>;
|
|
44
|
+
stop(): Promise<void>;
|
|
45
|
+
dispose(): Promise<void>;
|
|
46
|
+
listSpecs(options?: ListSpecsOptions): CronSpecRecord[];
|
|
47
|
+
getSpec(specId: string): CronSpecRecord | undefined;
|
|
48
|
+
listRuns(options?: ListRunsOptions): CronRunRecord[];
|
|
49
|
+
getRun(runId: string): CronRunRecord | undefined;
|
|
50
|
+
listActiveRuns(): CronRunRecord[];
|
|
51
|
+
listUpcomingRuns(limit?: number): CronRunRecord[];
|
|
52
|
+
reconcileNow(): Promise<void>;
|
|
53
|
+
ingestEvent(event: AutomationEventEnvelope): CronEventIngressResult;
|
|
54
|
+
listEventLogs(options?: ListEventLogsOptions): import("../store/sqlite-cron-store").CronEventLogRecord[];
|
|
55
|
+
getEventLog(eventId: string): import("../store/sqlite-cron-store").CronEventLogRecord | undefined;
|
|
56
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cerebriline/shared";
|
|
2
|
+
import type { HubConnectionAuthority } from "../../hub/server/command-transport";
|
|
3
|
+
import type { HubScheduleService } from "./schedule-service";
|
|
4
|
+
export declare class HubScheduleCommandService {
|
|
5
|
+
private readonly schedules;
|
|
6
|
+
constructor(schedules: HubScheduleService);
|
|
7
|
+
handleCommand(envelope: HubCommandEnvelope, authority?: HubConnectionAuthority): Promise<HubReplyEnvelope>;
|
|
8
|
+
private resolveScope;
|
|
9
|
+
private requireScopedSchedule;
|
|
10
|
+
private scopedScheduleIds;
|
|
11
|
+
private listScopedExecutions;
|
|
12
|
+
private toCreateInput;
|
|
13
|
+
private toUpdateInput;
|
|
14
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type BasicLogger, type ChatRunTurnRequest, type ChatStartSessionArtifacts, type ChatStartSessionRequest, type HubScheduleCreateInput, type HubScheduleUpdateInput, type ScheduleExecutionRecord, type ScheduleExecutionStatus, type ScheduleRecord } from "@cerebriline/shared";
|
|
2
|
+
import type { ResolveCronSpecsDirOptions } from "@cerebriline/shared/storage";
|
|
3
|
+
type HubScheduleTurnResult = {
|
|
4
|
+
text: string;
|
|
5
|
+
usage?: {
|
|
6
|
+
inputTokens?: number;
|
|
7
|
+
outputTokens?: number;
|
|
8
|
+
cacheReadTokens?: number;
|
|
9
|
+
cacheWriteTokens?: number;
|
|
10
|
+
totalCost?: number;
|
|
11
|
+
};
|
|
12
|
+
inputTokens?: number;
|
|
13
|
+
outputTokens?: number;
|
|
14
|
+
iterations?: number;
|
|
15
|
+
finishReason?: string;
|
|
16
|
+
messages?: unknown[];
|
|
17
|
+
toolCalls?: Array<{
|
|
18
|
+
name: string;
|
|
19
|
+
input?: unknown;
|
|
20
|
+
output?: unknown;
|
|
21
|
+
error?: string;
|
|
22
|
+
durationMs?: number;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
export interface HubScheduleStartSessionOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Provenance the runner knows about the automation run that is starting
|
|
28
|
+
* this session (schedule id/name, run id, run number). Handlers merge it
|
|
29
|
+
* into the session metadata so clients can group runs by schedule.
|
|
30
|
+
*/
|
|
31
|
+
sessionMetadata?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export interface HubScheduleRuntimeHandlers {
|
|
34
|
+
startSession(request: ChatStartSessionRequest, options?: HubScheduleStartSessionOptions): Promise<{
|
|
35
|
+
sessionId: string;
|
|
36
|
+
startResult?: ChatStartSessionArtifacts;
|
|
37
|
+
}>;
|
|
38
|
+
sendSession(sessionId: string, request: ChatRunTurnRequest): Promise<{
|
|
39
|
+
result: HubScheduleTurnResult;
|
|
40
|
+
}>;
|
|
41
|
+
abortSession(sessionId: string): Promise<{
|
|
42
|
+
applied: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
stopSession(sessionId: string): Promise<{
|
|
45
|
+
applied: boolean;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
export interface ActiveScheduledExecution {
|
|
49
|
+
executionId: string;
|
|
50
|
+
scheduleId: string;
|
|
51
|
+
sessionId: string;
|
|
52
|
+
startedAt: string;
|
|
53
|
+
timeoutAt?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface HubScheduleServiceOptions {
|
|
56
|
+
runtimeHandlers: HubScheduleRuntimeHandlers;
|
|
57
|
+
eventPublisher?: (eventType: string, payload: Record<string, unknown>) => void;
|
|
58
|
+
logger?: BasicLogger;
|
|
59
|
+
dbPath?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Cron spec source/report location forwarded to the runner. Defaults to
|
|
62
|
+
* the global `~/.cline/cron` directory — tests must override this so run
|
|
63
|
+
* reports land in a temp directory instead of the user's real one.
|
|
64
|
+
*/
|
|
65
|
+
specs?: ResolveCronSpecsDirOptions;
|
|
66
|
+
pollIntervalMs?: number;
|
|
67
|
+
globalMaxConcurrency?: number;
|
|
68
|
+
claimLeaseSeconds?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface ListSchedulesOptions {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
limit?: number;
|
|
73
|
+
tags?: string[];
|
|
74
|
+
workspaceRoot?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ListScheduleExecutionsOptions {
|
|
77
|
+
scheduleId?: string;
|
|
78
|
+
status?: ScheduleExecutionStatus;
|
|
79
|
+
limit?: number;
|
|
80
|
+
}
|
|
81
|
+
export interface ScheduleExecutionStats {
|
|
82
|
+
totalRuns: number;
|
|
83
|
+
successRate: number;
|
|
84
|
+
avgDurationSeconds: number;
|
|
85
|
+
lastFailure?: ScheduleExecutionRecord;
|
|
86
|
+
}
|
|
87
|
+
export declare class HubScheduleService {
|
|
88
|
+
private readonly store;
|
|
89
|
+
private readonly materializer;
|
|
90
|
+
private readonly runner;
|
|
91
|
+
private started;
|
|
92
|
+
private disposed;
|
|
93
|
+
constructor(options: HubScheduleServiceOptions);
|
|
94
|
+
start(): Promise<void>;
|
|
95
|
+
stop(): Promise<void>;
|
|
96
|
+
dispose(): Promise<void>;
|
|
97
|
+
createSchedule(input: HubScheduleCreateInput): ScheduleRecord;
|
|
98
|
+
getSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
99
|
+
listSchedules(options?: ListSchedulesOptions): ScheduleRecord[];
|
|
100
|
+
updateSchedule(scheduleId: string, updates: HubScheduleUpdateInput): ScheduleRecord | undefined;
|
|
101
|
+
private validateScheduleTiming;
|
|
102
|
+
deleteSchedule(scheduleId: string): boolean;
|
|
103
|
+
pauseSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
104
|
+
resumeSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
105
|
+
triggerScheduleNow(scheduleId: string): Promise<ScheduleExecutionRecord | undefined>;
|
|
106
|
+
triggerScheduleNowDetached(scheduleId: string): ScheduleExecutionRecord | undefined;
|
|
107
|
+
listScheduleExecutions(options: ListScheduleExecutionsOptions): ScheduleExecutionRecord[];
|
|
108
|
+
getScheduleStats(scheduleId: string): ScheduleExecutionStats;
|
|
109
|
+
getActiveExecutions(): ActiveScheduledExecution[];
|
|
110
|
+
getUpcomingRuns(limit?: number): Array<{
|
|
111
|
+
scheduleId: string;
|
|
112
|
+
name: string;
|
|
113
|
+
nextRunAt: string;
|
|
114
|
+
}>;
|
|
115
|
+
}
|
|
116
|
+
export {};
|