@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,365 @@
|
|
|
1
|
+
import type { ClineCoreAutomationApi, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, CompareCheckpointInput, CompareCheckpointResult, RestoreInput, RestoreResult } from "./cline-core/types";
|
|
2
|
+
import type { PendingPromptsServiceApi, RuntimeHost, RuntimeHostSubscribeOptions, SessionConnectionRuntimeService, SessionModelRuntimeService, SessionUsageRuntimeService, StartSessionInput, StartSessionResult } from "./runtime/host/runtime-host";
|
|
3
|
+
import { FeatureFlagsService } from "./services/feature-flags";
|
|
4
|
+
import { type SessionDisplayMessage } from "./session/display-messages";
|
|
5
|
+
import type { CoreSessionEvent } from "./types/events";
|
|
6
|
+
import type { SessionHistoryRecord } from "./types/sessions";
|
|
7
|
+
export type { ClineAutomationEventIngressResult, ClineAutomationEventLog, ClineAutomationEventSuppression, ClineAutomationListEventsOptions, ClineAutomationListRunsOptions, ClineAutomationListSpecsOptions, ClineAutomationRun, ClineAutomationRunStatus, ClineAutomationSpec, ClineCoreAutomationApi, ClineCoreAutomationOptions, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, CompareCheckpointInput, CompareCheckpointResult, HubOptions, RemoteOptions, RestoreInput, RestoreOptions, RestoreResult, RuntimeHostMode, StartSessionBootstrap, } from "./cline-core/types";
|
|
8
|
+
import type { BackgroundDelegationView } from "./extensions/tools/team/background-delegations";
|
|
9
|
+
import type { ConfiguredAgentDelegationResult, ConfiguredAgentSummary } from "./extensions/tools/team/delegate-to-agent";
|
|
10
|
+
/**
|
|
11
|
+
* The primary entry point for the Cline Core SDK.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { ClineCore } from "@cerebriline/core";
|
|
16
|
+
*
|
|
17
|
+
* const cline = await ClineCore.create({ clientName: "my-app" });
|
|
18
|
+
* const session = await cline.start({ ... });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class ClineCore {
|
|
22
|
+
readonly clientName: string | undefined;
|
|
23
|
+
readonly runtimeAddress: string | undefined;
|
|
24
|
+
readonly automation: ClineCoreAutomationApi;
|
|
25
|
+
readonly settings: ClineCoreSettingsApi;
|
|
26
|
+
readonly featureFlags: FeatureFlagsService;
|
|
27
|
+
readonly pendingPrompts: PendingPromptsServiceApi;
|
|
28
|
+
private readonly host;
|
|
29
|
+
private readonly prepare;
|
|
30
|
+
private readonly capabilities;
|
|
31
|
+
private readonly logger;
|
|
32
|
+
private readonly telemetry;
|
|
33
|
+
private readonly distinctId;
|
|
34
|
+
private readonly automationService;
|
|
35
|
+
private readonly activeSessionBootstraps;
|
|
36
|
+
private readonly unsubscribeBootstrapCleanup;
|
|
37
|
+
private constructor();
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new ClineCore instance.
|
|
40
|
+
*
|
|
41
|
+
* This is the primary factory method for initializing the SDK. It sets up the runtime
|
|
42
|
+
* host (local, hub, or remote) based on the provided options and prepares the SDK for
|
|
43
|
+
* starting sessions.
|
|
44
|
+
*
|
|
45
|
+
* @param options Configuration options for the SDK instance
|
|
46
|
+
* @returns A promise that resolves to a new ClineCore instance
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const cline = await ClineCore.create({
|
|
51
|
+
* clientName: "my-app",
|
|
52
|
+
* backendMode: "local",
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
static create(options?: ClineCoreOptions): Promise<ClineCore>;
|
|
57
|
+
private disposeSessionBootstrap;
|
|
58
|
+
/**
|
|
59
|
+
* Starts a new Cline session with the provided configuration.
|
|
60
|
+
*
|
|
61
|
+
* This method initializes and begins a new agent session. It handles session setup,
|
|
62
|
+
* runs any preparation hooks, and returns session metadata along with event streams.
|
|
63
|
+
* The session continues to run until explicitly stopped or aborted.
|
|
64
|
+
*
|
|
65
|
+
* @param input The session configuration and startup parameters
|
|
66
|
+
* @returns A promise that resolves to session metadata and event stream
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const result = await cline.start({
|
|
71
|
+
* config: {
|
|
72
|
+
* providerId: "anthropic",
|
|
73
|
+
* modelId: "claude-opus-4-1",
|
|
74
|
+
* },
|
|
75
|
+
* });
|
|
76
|
+
*
|
|
77
|
+
* // Subscribe to session events
|
|
78
|
+
* result.subscribe((event) => {
|
|
79
|
+
* console.log("Session event:", event);
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
start(input: StartSessionInput): Promise<StartSessionResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Starts a new Cline session with extended core-specific configuration.
|
|
86
|
+
* This overload allows specifying local runtime options and config overrides.
|
|
87
|
+
*/
|
|
88
|
+
start(input: ClineCoreStartInput): Promise<StartSessionResult>;
|
|
89
|
+
/**
|
|
90
|
+
* Sends a message or command to an active session.
|
|
91
|
+
*
|
|
92
|
+
* This method communicates with a running session, allowing you to send user messages,
|
|
93
|
+
* tool responses, or other session input while the session is in progress.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* await cline.send(sessionId, {
|
|
98
|
+
* type: "user_message",
|
|
99
|
+
* text: "Please implement the login feature",
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
send: RuntimeHost["runTurn"];
|
|
104
|
+
/**
|
|
105
|
+
* Retrieves accumulated token and cost usage for a session.
|
|
106
|
+
*
|
|
107
|
+
* Returns metrics about the session's resource consumption, including tokens used
|
|
108
|
+
* across different API providers and associated costs. The `usage` field is
|
|
109
|
+
* root/lead-agent usage; `aggregateUsage` includes teammates and subagents.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* const usageSummary = await cline.getAccumulatedUsage(sessionId);
|
|
114
|
+
* console.log(`Total cost: $${usageSummary?.aggregateUsage?.totalCost}`);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
getAccumulatedUsage: SessionUsageRuntimeService["getAccumulatedUsage"];
|
|
118
|
+
/**
|
|
119
|
+
* Aborts an in-flight tool execution without stopping the session.
|
|
120
|
+
*
|
|
121
|
+
* Interrupts the current tool operation (e.g., file read, shell command) while keeping
|
|
122
|
+
* the session alive. The session can continue processing after the abort. Use this for
|
|
123
|
+
* cancelling long-running operations.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* // Stop the current operation but keep the session running
|
|
128
|
+
* await cline.abort(sessionId);
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
abort: RuntimeHost["abort"];
|
|
132
|
+
/**
|
|
133
|
+
* Stops an active session gracefully.
|
|
134
|
+
*
|
|
135
|
+
* Terminates the session and cleans up associated resources. Unlike abort, this
|
|
136
|
+
* completely ends the session. The session cannot be resumed after stopping.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* // Cleanly shutdown the session
|
|
141
|
+
* await cline.stop(sessionId);
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
stop: RuntimeHost["stopSession"];
|
|
145
|
+
/**
|
|
146
|
+
* Disposes the ClineCore instance and all associated resources.
|
|
147
|
+
*
|
|
148
|
+
* Shuts down the runtime host, closes connections, and cleans up all active sessions
|
|
149
|
+
* and bootstraps. Call this when you're done using the SDK instance, typically at
|
|
150
|
+
* application shutdown. After calling dispose, the instance cannot be reused.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* // Clean up when done
|
|
155
|
+
* await cline.dispose();
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
dispose: RuntimeHost["dispose"];
|
|
159
|
+
/**
|
|
160
|
+
* Retrieves information about a specific session by ID.
|
|
161
|
+
*
|
|
162
|
+
* Fetches the current metadata and state of a session, including configuration,
|
|
163
|
+
* status, and other session details.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* const session = await cline.get(sessionId);
|
|
168
|
+
* console.log("Session status:", session?.status);
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
get: RuntimeHost["getSession"];
|
|
172
|
+
/**
|
|
173
|
+
* Lists recent sessions through the shared history-listing path.
|
|
174
|
+
*/
|
|
175
|
+
listHistory: (options?: ClineCoreListHistoryOptions) => Promise<SessionHistoryRecord[]>;
|
|
176
|
+
/**
|
|
177
|
+
* Lists recent sessions with inferred history display metadata.
|
|
178
|
+
*
|
|
179
|
+
* Retrieves a paginated list of recent sessions, optionally limited by the
|
|
180
|
+
* provided count.
|
|
181
|
+
*
|
|
182
|
+
* @param limit Maximum number of sessions to return (defaults to 200)
|
|
183
|
+
* @returns A promise resolving to an array of session history records
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* const sessions = await cline.list(50);
|
|
188
|
+
* sessions.forEach((session) => {
|
|
189
|
+
* console.log(`Session ${session.sessionId}: ${session.metadata?.title}`);
|
|
190
|
+
* });
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
list: (limit?: number, options?: Omit<ClineCoreListHistoryOptions, "limit">) => Promise<SessionHistoryRecord[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Permanently deletes a session and all its associated data.
|
|
196
|
+
*
|
|
197
|
+
* Removes the session from storage and cleans up any related resources. This is
|
|
198
|
+
* a destructive operation that cannot be undone.
|
|
199
|
+
*
|
|
200
|
+
* @param sessionId The ID of the session to delete
|
|
201
|
+
* @returns A promise that resolves to true if the session was deleted, false if not found
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* const deleted = await cline.delete(sessionId);
|
|
206
|
+
* if (deleted) {
|
|
207
|
+
* console.log("Session deleted successfully");
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
delete: RuntimeHost["deleteSession"];
|
|
212
|
+
/**
|
|
213
|
+
* Updates an existing session's metadata.
|
|
214
|
+
*
|
|
215
|
+
* Modifies session properties like title or other mutable metadata while preserving
|
|
216
|
+
* message history and other session data.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts
|
|
220
|
+
* await cline.update(sessionId, {
|
|
221
|
+
* title: "Updated session title",
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
update: RuntimeHost["updateSession"];
|
|
226
|
+
/**
|
|
227
|
+
* The configured agents this session loaded, for a host offering a picker.
|
|
228
|
+
*/
|
|
229
|
+
listConfiguredAgents: (sessionId: string) => Promise<ConfiguredAgentSummary[]>;
|
|
230
|
+
/**
|
|
231
|
+
* Runs one configured agent on a task, on the user's say-so rather than the
|
|
232
|
+
* model's. The agent's report is appended to the conversation.
|
|
233
|
+
*/
|
|
234
|
+
delegateToConfiguredAgent: (input: {
|
|
235
|
+
sessionId: string;
|
|
236
|
+
agentName: string;
|
|
237
|
+
prompt: string;
|
|
238
|
+
signal?: AbortSignal;
|
|
239
|
+
}) => Promise<ConfiguredAgentDelegationResult>;
|
|
240
|
+
/**
|
|
241
|
+
* Stand the change protocol down for a session, because the user said so.
|
|
242
|
+
*
|
|
243
|
+
* Resolving does not mean it has happened: the runtime picks the moment,
|
|
244
|
+
* because judging the open transaction can put files back and that write
|
|
245
|
+
* must not land while a tool call is still open.
|
|
246
|
+
*
|
|
247
|
+
* @returns whether there was a protocol running to stand down.
|
|
248
|
+
*/
|
|
249
|
+
disengageAtomicProtocol: (sessionId: string) => Promise<boolean>;
|
|
250
|
+
/**
|
|
251
|
+
* Starts a configured agent beside the current turn rather than in place of
|
|
252
|
+
* it. Returns as soon as the run exists; the report arrives in the
|
|
253
|
+
* conversation whenever the agent is done.
|
|
254
|
+
*/
|
|
255
|
+
startBackgroundDelegation: (input: {
|
|
256
|
+
sessionId: string;
|
|
257
|
+
agentName: string;
|
|
258
|
+
prompt: string;
|
|
259
|
+
}) => Promise<BackgroundDelegationView>;
|
|
260
|
+
/** The background delegations of one session, for a host drawing them. */
|
|
261
|
+
listBackgroundDelegations: (sessionId: string) => Promise<BackgroundDelegationView[]>;
|
|
262
|
+
/** Pause, resume or stop one. False when no run was in a state to take it. */
|
|
263
|
+
controlBackgroundDelegation: (input: {
|
|
264
|
+
sessionId: string;
|
|
265
|
+
id: string;
|
|
266
|
+
action: "pause" | "resume" | "stop";
|
|
267
|
+
}) => Promise<boolean>;
|
|
268
|
+
/**
|
|
269
|
+
* Stores the compacted working-context state for an existing session.
|
|
270
|
+
*/
|
|
271
|
+
updateSessionCompactionState: RuntimeHost["updateSessionCompactionState"];
|
|
272
|
+
/**
|
|
273
|
+
* Reads the compacted working-context sidecar for a session, if one exists.
|
|
274
|
+
*/
|
|
275
|
+
readSessionCompactionState: RuntimeHost["readSessionCompactionState"];
|
|
276
|
+
/**
|
|
277
|
+
* Reads the canonical message history for a session.
|
|
278
|
+
*
|
|
279
|
+
* This is the model/replay representation used by resume, fork, and
|
|
280
|
+
* compaction. Provider-owned model-tool activity remains observational
|
|
281
|
+
* metadata here. Use {@link readDisplayMessages} for a UI transcript with
|
|
282
|
+
* that activity projected into ordinary tool blocks.
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```ts
|
|
286
|
+
* const messages = await cline.readMessages(sessionId);
|
|
287
|
+
* messages.forEach((msg) => {
|
|
288
|
+
* console.log(`${msg.role}: ${msg.content}`);
|
|
289
|
+
* });
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
readMessages: RuntimeHost["readSessionMessages"];
|
|
293
|
+
/**
|
|
294
|
+
* Reads a transcript projected for presentation. Observational model-tool
|
|
295
|
+
* activity is represented with the same tool blocks as ordinary local tools.
|
|
296
|
+
*
|
|
297
|
+
* Use {@link readMessages} for resume, fork, compaction, or model replay.
|
|
298
|
+
*/
|
|
299
|
+
readDisplayMessages(sessionId: string): Promise<SessionDisplayMessage[]>;
|
|
300
|
+
/**
|
|
301
|
+
* Reads message history for a session, preferring the live in-memory
|
|
302
|
+
* conversation when the session is still resident in this host.
|
|
303
|
+
*
|
|
304
|
+
* The persisted transcript only catches up at assistant-message/turn
|
|
305
|
+
* boundaries, so `readMessages` can miss an in-flight (or just-aborted)
|
|
306
|
+
* turn. Use this when the current conversation matters — e.g. seeding a
|
|
307
|
+
* replacement session during a plan/act mode switch. Falls back to the
|
|
308
|
+
* persisted transcript when the session is not resident or the host does
|
|
309
|
+
* not track live sessions.
|
|
310
|
+
*/
|
|
311
|
+
readLiveMessages: RuntimeHost["readSessionMessages"];
|
|
312
|
+
restore(input: RestoreInput): Promise<RestoreResult>;
|
|
313
|
+
compareCheckpoint(input: CompareCheckpointInput): Promise<CompareCheckpointResult>;
|
|
314
|
+
/**
|
|
315
|
+
* Handles hook events from the runtime environment.
|
|
316
|
+
*
|
|
317
|
+
* Processes system or environment events (e.g., workspace changes, external signals)
|
|
318
|
+
* that may affect the current session. This is typically called by the host environment
|
|
319
|
+
* rather than directly by consumer code.
|
|
320
|
+
*
|
|
321
|
+
* @internal
|
|
322
|
+
*/
|
|
323
|
+
ingestHookEvent: RuntimeHost["dispatchHookEvent"];
|
|
324
|
+
/**
|
|
325
|
+
* Subscribes to session events.
|
|
326
|
+
*
|
|
327
|
+
* Registers a listener for all session events (messages, state changes, errors, etc.).
|
|
328
|
+
* Returns an unsubscribe function to stop listening.
|
|
329
|
+
*
|
|
330
|
+
* @param listener Callback function invoked for each event
|
|
331
|
+
* @param options Optional configuration for the subscription
|
|
332
|
+
* @returns An unsubscribe function
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```ts
|
|
336
|
+
* const unsubscribe = cline.subscribe((event) => {
|
|
337
|
+
* if (event.type === "message") {
|
|
338
|
+
* console.log("New message:", event.payload.message);
|
|
339
|
+
* }
|
|
340
|
+
* });
|
|
341
|
+
*
|
|
342
|
+
* // Later, stop listening
|
|
343
|
+
* unsubscribe();
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
subscribe(listener: (event: CoreSessionEvent) => void, options?: RuntimeHostSubscribeOptions): () => void;
|
|
347
|
+
/**
|
|
348
|
+
* Updates the AI model used by an active session.
|
|
349
|
+
*
|
|
350
|
+
* Switches the session to use a different AI model while maintaining the session state
|
|
351
|
+
* and message history. This allows you to continue a conversation with a different model.
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```ts
|
|
355
|
+
* // Switch to a different model mid-session
|
|
356
|
+
* await cline.updateSessionModel(sessionId, "claude-opus-4-1");
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
updateSessionModel: SessionModelRuntimeService["updateSessionModel"];
|
|
360
|
+
/**
|
|
361
|
+
* Updates provider/model/reasoning connection options for subsequent turns in
|
|
362
|
+
* an active session.
|
|
363
|
+
*/
|
|
364
|
+
updateSessionConnection: SessionConnectionRuntimeService["updateSessionConnection"];
|
|
365
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ClineAccountBalance, ClineAccountOrganization, ClineAccountOrganizationBalance, ClineAccountOrganizationUsageTransaction, ClineAccountPaymentTransaction, ClineAccountUsageTransaction, ClineAccountUser, ClineOrganization, ClineSubscriptionPlan, FeaturebaseTokenResponse, UserCurrentPlan, UserRemoteConfigResponse } from "./types";
|
|
2
|
+
export interface ClineAccountServiceOptions {
|
|
3
|
+
apiBaseUrl: string;
|
|
4
|
+
getAuthToken: () => Promise<string | undefined | null>;
|
|
5
|
+
getCurrentUserId?: () => Promise<string | undefined | null> | string | undefined | null;
|
|
6
|
+
getOrganizationMemberId?: (organizationId: string) => Promise<string | undefined | null> | string | undefined | null;
|
|
7
|
+
getHeaders?: () => Promise<Record<string, string> | undefined> | Record<string, string> | undefined;
|
|
8
|
+
requestTimeoutMs?: number;
|
|
9
|
+
fetchImpl?: typeof fetch;
|
|
10
|
+
}
|
|
11
|
+
export declare class ClineAccountService {
|
|
12
|
+
private readonly apiBaseUrl;
|
|
13
|
+
private readonly getAuthTokenFn;
|
|
14
|
+
private readonly getCurrentUserIdFn;
|
|
15
|
+
private readonly getOrganizationMemberIdFn;
|
|
16
|
+
private readonly getHeadersFn;
|
|
17
|
+
private readonly requestTimeoutMs;
|
|
18
|
+
private readonly fetchImpl;
|
|
19
|
+
constructor(options: ClineAccountServiceOptions);
|
|
20
|
+
fetchMe(): Promise<ClineAccountUser>;
|
|
21
|
+
fetchRemoteConfig(): Promise<UserRemoteConfigResponse | null>;
|
|
22
|
+
fetchFeaturebaseToken(): Promise<FeaturebaseTokenResponse | undefined>;
|
|
23
|
+
fetchBalance(userId?: string): Promise<ClineAccountBalance>;
|
|
24
|
+
fetchUsageTransactions(userId?: string): Promise<ClineAccountUsageTransaction[]>;
|
|
25
|
+
fetchPaymentTransactions(userId?: string): Promise<ClineAccountPaymentTransaction[]>;
|
|
26
|
+
fetchUserOrganizations(): Promise<ClineAccountOrganization[]>;
|
|
27
|
+
fetchAvailableSubscriptionPlans(input?: {
|
|
28
|
+
type?: "individual" | "teams";
|
|
29
|
+
}): Promise<ClineSubscriptionPlan[]>;
|
|
30
|
+
fetchCurrentUserPlan(): Promise<UserCurrentPlan | undefined>;
|
|
31
|
+
fetchOrganization(organizationId: string): Promise<ClineOrganization>;
|
|
32
|
+
fetchOrganizationBalance(organizationId: string): Promise<ClineAccountOrganizationBalance>;
|
|
33
|
+
fetchOrganizationUsageTransactions(input: {
|
|
34
|
+
organizationId: string;
|
|
35
|
+
memberId?: string;
|
|
36
|
+
}): Promise<ClineAccountOrganizationUsageTransaction[]>;
|
|
37
|
+
switchAccount(organizationId?: string | null): Promise<void>;
|
|
38
|
+
private resolveUserId;
|
|
39
|
+
private resolveOrganizationMemberId;
|
|
40
|
+
private request;
|
|
41
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ClineAccountService, type ClineAccountServiceOptions, } from "./cline-account-service";
|
|
2
|
+
export { type ClineAccountOperations, executeClineAccountAction, isClineAccountActionRequest, type ProviderActionExecutor, RpcClineAccountService, } from "./rpc";
|
|
3
|
+
export type { ClineAccountBalance, ClineAccountOrganization, ClineAccountOrganizationBalance, ClineAccountOrganizationUsageTransaction, ClineAccountPaymentTransaction, ClineAccountUsageTransaction, ClineAccountUser, ClineOrganization, ClineSubscriptionPlan, FeaturebaseTokenResponse, UserCurrentPlan, UserRemoteConfigOrganization, UserRemoteConfigResponse, } from "./types";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ClineAccountActionRequest, ProviderActionRequest } from "@cerebriline/shared";
|
|
2
|
+
import type { ClineAccountBalance, ClineAccountOrganization, ClineAccountOrganizationBalance, ClineAccountOrganizationUsageTransaction, ClineAccountPaymentTransaction, ClineAccountUsageTransaction, ClineAccountUser, FeaturebaseTokenResponse } from "./types";
|
|
3
|
+
export interface ClineAccountOperations {
|
|
4
|
+
fetchMe(): Promise<ClineAccountUser>;
|
|
5
|
+
fetchBalance(userId?: string): Promise<ClineAccountBalance>;
|
|
6
|
+
fetchUsageTransactions(userId?: string): Promise<ClineAccountUsageTransaction[]>;
|
|
7
|
+
fetchPaymentTransactions(userId?: string): Promise<ClineAccountPaymentTransaction[]>;
|
|
8
|
+
fetchUserOrganizations(): Promise<ClineAccountOrganization[]>;
|
|
9
|
+
fetchOrganizationBalance(organizationId: string): Promise<ClineAccountOrganizationBalance>;
|
|
10
|
+
fetchOrganizationUsageTransactions(input: {
|
|
11
|
+
organizationId: string;
|
|
12
|
+
memberId?: string;
|
|
13
|
+
}): Promise<ClineAccountOrganizationUsageTransaction[]>;
|
|
14
|
+
switchAccount(organizationId?: string | null): Promise<void>;
|
|
15
|
+
fetchFeaturebaseToken?(): Promise<FeaturebaseTokenResponse | undefined>;
|
|
16
|
+
}
|
|
17
|
+
export declare function isClineAccountActionRequest(request: ProviderActionRequest): request is ClineAccountActionRequest;
|
|
18
|
+
export declare function executeClineAccountAction(request: ClineAccountActionRequest, service: ClineAccountOperations): Promise<unknown>;
|
|
19
|
+
export interface ProviderActionExecutor {
|
|
20
|
+
runProviderAction(request: ProviderActionRequest): Promise<{
|
|
21
|
+
result: unknown;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export declare class RpcClineAccountService implements ClineAccountOperations {
|
|
25
|
+
private readonly executor;
|
|
26
|
+
constructor(executor: ProviderActionExecutor);
|
|
27
|
+
fetchMe(): Promise<ClineAccountUser>;
|
|
28
|
+
fetchBalance(userId?: string): Promise<ClineAccountBalance>;
|
|
29
|
+
fetchUsageTransactions(userId?: string): Promise<ClineAccountUsageTransaction[]>;
|
|
30
|
+
fetchPaymentTransactions(userId?: string): Promise<ClineAccountPaymentTransaction[]>;
|
|
31
|
+
fetchUserOrganizations(): Promise<ClineAccountOrganization[]>;
|
|
32
|
+
fetchOrganizationBalance(organizationId: string): Promise<ClineAccountOrganizationBalance>;
|
|
33
|
+
fetchOrganizationUsageTransactions(input: {
|
|
34
|
+
organizationId: string;
|
|
35
|
+
memberId?: string;
|
|
36
|
+
}): Promise<ClineAccountOrganizationUsageTransaction[]>;
|
|
37
|
+
switchAccount(organizationId?: string | null): Promise<void>;
|
|
38
|
+
fetchFeaturebaseToken(): Promise<FeaturebaseTokenResponse | undefined>;
|
|
39
|
+
private request;
|
|
40
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export interface ClineAccountOrganization {
|
|
2
|
+
active: boolean;
|
|
3
|
+
memberId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
organizationId: string;
|
|
6
|
+
roles: Array<"admin" | "member" | "owner">;
|
|
7
|
+
}
|
|
8
|
+
export interface ClineAccountUser {
|
|
9
|
+
id: string;
|
|
10
|
+
email: string;
|
|
11
|
+
displayName: string;
|
|
12
|
+
photoUrl: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
organizations: ClineAccountOrganization[];
|
|
16
|
+
}
|
|
17
|
+
export interface UserRemoteConfigOrganization {
|
|
18
|
+
organizationId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
export interface UserRemoteConfigResponse {
|
|
22
|
+
organizationId: string;
|
|
23
|
+
value: string;
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
organizations?: UserRemoteConfigOrganization[];
|
|
26
|
+
}
|
|
27
|
+
export interface ClineAccountBalance {
|
|
28
|
+
balance: number;
|
|
29
|
+
userId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ClineAccountUsageTransaction {
|
|
32
|
+
aiInferenceProviderName: string;
|
|
33
|
+
aiModelName: string;
|
|
34
|
+
aiModelTypeName: string;
|
|
35
|
+
completionTokens: number;
|
|
36
|
+
costUsd: number;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
creditsUsed: number;
|
|
39
|
+
generationId: string;
|
|
40
|
+
id: string;
|
|
41
|
+
metadata: {
|
|
42
|
+
additionalProp1: string;
|
|
43
|
+
additionalProp2: string;
|
|
44
|
+
additionalProp3: string;
|
|
45
|
+
};
|
|
46
|
+
operation?: string;
|
|
47
|
+
organizationId: string;
|
|
48
|
+
promptTokens: number;
|
|
49
|
+
totalTokens: number;
|
|
50
|
+
userId: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ClineAccountPaymentTransaction {
|
|
53
|
+
paidAt: string;
|
|
54
|
+
creatorId: string;
|
|
55
|
+
amountCents: number;
|
|
56
|
+
credits: number;
|
|
57
|
+
}
|
|
58
|
+
export interface ClineOrganization {
|
|
59
|
+
createdAt: string;
|
|
60
|
+
defaultRemoteConfig?: string;
|
|
61
|
+
deletedAt?: string;
|
|
62
|
+
externalOrganizationId?: string;
|
|
63
|
+
id: string;
|
|
64
|
+
memberCount?: number;
|
|
65
|
+
name: string;
|
|
66
|
+
remoteConfigEnabled: boolean;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ClineAccountOrganizationBalance {
|
|
70
|
+
balance: number;
|
|
71
|
+
organizationId: string;
|
|
72
|
+
}
|
|
73
|
+
export interface FeaturebaseTokenResponse {
|
|
74
|
+
featurebaseJwt: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ClineSubscriptionPlan {
|
|
77
|
+
displayName?: string;
|
|
78
|
+
features?: {
|
|
79
|
+
included?: string[];
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
id?: string;
|
|
83
|
+
interval?: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
pricePerSeatCents?: number;
|
|
86
|
+
type?: string;
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
89
|
+
export interface UserCurrentPlan {
|
|
90
|
+
cancelAt?: string;
|
|
91
|
+
canceledAt?: string;
|
|
92
|
+
currentPeriodEnd?: string;
|
|
93
|
+
currentPeriodStart?: string;
|
|
94
|
+
plan?: ClineSubscriptionPlan | null;
|
|
95
|
+
planHistoryId?: string;
|
|
96
|
+
subscriptionId?: string;
|
|
97
|
+
userId?: string;
|
|
98
|
+
[key: string]: unknown;
|
|
99
|
+
}
|
|
100
|
+
export interface ClineAccountOrganizationUsageTransaction {
|
|
101
|
+
aiInferenceProviderName: string;
|
|
102
|
+
aiModelName: string;
|
|
103
|
+
aiModelTypeName: string;
|
|
104
|
+
completionTokens: number;
|
|
105
|
+
costUsd: number;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
creditsUsed: number;
|
|
108
|
+
generationId: string;
|
|
109
|
+
id: string;
|
|
110
|
+
memberDisplayName: string;
|
|
111
|
+
memberEmail: string;
|
|
112
|
+
metadata: {
|
|
113
|
+
additionalProp1: string;
|
|
114
|
+
additionalProp2: string;
|
|
115
|
+
additionalProp3: string;
|
|
116
|
+
};
|
|
117
|
+
operation?: string;
|
|
118
|
+
organizationId: string;
|
|
119
|
+
promptTokens: number;
|
|
120
|
+
totalTokens: number;
|
|
121
|
+
userId: string;
|
|
122
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small process-local string cache with TTL expiry and a hard entry cap.
|
|
3
|
+
* Used where unbounded Maps would grow without bound in long-running processes.
|
|
4
|
+
*/
|
|
5
|
+
export declare class BoundedTtlCache {
|
|
6
|
+
private readonly ttlMs;
|
|
7
|
+
private readonly maxEntries;
|
|
8
|
+
private readonly entries;
|
|
9
|
+
constructor(ttlMs: number, maxEntries: number);
|
|
10
|
+
get(key: string, now?: number): string | undefined;
|
|
11
|
+
set(key: string, value: string, now?: number, ttlMsOverride?: number): void;
|
|
12
|
+
private pruneExpired;
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { OAuthServerCloseInfo, OAuthServerListeningInfo } from "./server";
|
|
2
|
+
import type { OAuthLoginCallbacks, OAuthPrompt } from "./types";
|
|
3
|
+
export interface OAuthClientCallbacksOptions {
|
|
4
|
+
onPrompt: (prompt: OAuthPrompt) => Promise<string>;
|
|
5
|
+
onOutput?: (message: string) => void;
|
|
6
|
+
openUrl?: (url: string) => void | Promise<void>;
|
|
7
|
+
onOpenUrlError?: (context: {
|
|
8
|
+
url: string;
|
|
9
|
+
error: unknown;
|
|
10
|
+
}) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Called when the local OAuth redirect server successfully binds to a port
|
|
13
|
+
* and is ready to receive the browser callback.
|
|
14
|
+
*
|
|
15
|
+
* Forwarded directly from `OAuthLoginCallbacks.onServerListening`.
|
|
16
|
+
* Use this to show a "waiting for OAuth callback on :::1 port N" status
|
|
17
|
+
* message or, in remote-development environments (e.g. JetBrains Gateway),
|
|
18
|
+
* to set up a port-forward from the remote machine to the local one.
|
|
19
|
+
*/
|
|
20
|
+
onServerListening?: (info: OAuthServerListeningInfo) => void | Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Called when the local OAuth redirect server closes.
|
|
23
|
+
*
|
|
24
|
+
* Forwarded directly from `OAuthLoginCallbacks.onServerClose`.
|
|
25
|
+
* Use this to tear down port-forwards and clear any status UI set up in
|
|
26
|
+
* `onServerListening`.
|
|
27
|
+
*/
|
|
28
|
+
onServerClose?: (info: OAuthServerCloseInfo) => void | Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export declare function createOAuthClientCallbacks(options: OAuthClientCallbacksOptions): OAuthLoginCallbacks;
|