@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,33 @@
|
|
|
1
|
+
import { type ConnectorConnectionRecord } from "@cerebriline/shared/db";
|
|
2
|
+
/**
|
|
3
|
+
* Record a successful connector start so the connector can be reconnected
|
|
4
|
+
* automatically after a hub or host restart.
|
|
5
|
+
*/
|
|
6
|
+
export declare function persistConnectorConnection(channel: string, instanceId: string, rawArgs: string[], cwd?: string): void;
|
|
7
|
+
/** Stop auto-reconnecting one instance, one channel, or every connector. */
|
|
8
|
+
export declare function disableConnectorAutostart(channel?: string, instanceId?: string): void;
|
|
9
|
+
export declare function getPersistedConnectorConnection(channel: string, instanceId: string): ConnectorConnectionRecord | undefined;
|
|
10
|
+
export declare function removePersistedConnectorConnection(channel: string, instanceId: string): void;
|
|
11
|
+
export interface ReconnectTarget {
|
|
12
|
+
channel: string;
|
|
13
|
+
instanceId: string;
|
|
14
|
+
args: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface ReconnectAttempt {
|
|
17
|
+
channel: string;
|
|
18
|
+
instanceId: string;
|
|
19
|
+
ok: boolean;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ReconnectPersistedConnectorsOptions {
|
|
23
|
+
/** Starts one connector instance with its stored, non-interactive arguments. */
|
|
24
|
+
start: (target: ReconnectTarget) => Promise<boolean>;
|
|
25
|
+
/** Reports whether this exact connector instance is healthy in the host. */
|
|
26
|
+
isHealthy?: (target: ReconnectTarget) => boolean;
|
|
27
|
+
log?: (message: string) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Reconnect every connector that has stored connection arguments, is enabled,
|
|
31
|
+
* and is not already active in the calling host.
|
|
32
|
+
*/
|
|
33
|
+
export declare function reconnectPersistedConnectors(options: ReconnectPersistedConnectorsOptions): Promise<ReconnectAttempt[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment for a CLI process the hub daemon launches.
|
|
3
|
+
*
|
|
4
|
+
* The daemon inherits the environment of whichever connector spawned it, and
|
|
5
|
+
* those inherited markers are actively harmful downstream: the daemon sentinel
|
|
6
|
+
* would make the child try to become a hub, and a child marker tells a connector
|
|
7
|
+
* "you are already the detached child", which makes it skip its own
|
|
8
|
+
* already-running check and start alongside a live instance holding the same
|
|
9
|
+
* credentials.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildConnectorChildEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
12
|
+
export declare const __test__: {
|
|
13
|
+
CONNECTOR_CHILD_MARKER_PATTERN: RegExp;
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { type ConnectorCliLaunchSpec } from "@cerebriline/shared";
|
|
3
|
+
export interface CleanupConnectorInstanceOptions {
|
|
4
|
+
launchSpec?: ConnectorCliLaunchSpec | undefined;
|
|
5
|
+
spawnProcess?: typeof spawn;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Reap one dead connector instance through the CLI.
|
|
10
|
+
*
|
|
11
|
+
* What has to be cleaned up — the process state file, thread→session bindings,
|
|
12
|
+
* and the hub sessions the connector owned — is all connector-specific knowledge
|
|
13
|
+
* that lives in the CLI's adapters. Rather than duplicate those conventions in
|
|
14
|
+
* the hub, the supervisor shells back into the CLI's own stop path, which
|
|
15
|
+
* already does exactly this for a process that is no longer running.
|
|
16
|
+
*
|
|
17
|
+
* `--cleanup-instance` deliberately preserves the autostart record: the instance
|
|
18
|
+
* died, it was not retired, so the supervisor still intends to restart it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function cleanupConnectorInstanceViaCli(channel: string, instanceId: string, options?: CleanupConnectorInstanceOptions): Promise<void>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { type ConnectorCliLaunchSpec, type ConnectorStartRequest, type ConnectorStartResult, type SupervisedConnectorRecord } from "@cerebriline/shared";
|
|
3
|
+
import { listActiveConnectors } from "./active-connectors";
|
|
4
|
+
export declare const RESTART_BASE_DELAY_MS = 1000;
|
|
5
|
+
export declare const RESTART_MAX_DELAY_MS = 60000;
|
|
6
|
+
/** Consecutive failed restarts before the hub stops trying. */
|
|
7
|
+
export declare const RESTART_GIVE_UP_AFTER = 5;
|
|
8
|
+
/**
|
|
9
|
+
* A run that lasts this long is treated as healthy, clearing the restart
|
|
10
|
+
* counter. Without it a connector that stays up for hours and then dies would
|
|
11
|
+
* inherit stale failures and be given up on immediately.
|
|
12
|
+
*/
|
|
13
|
+
export declare const RESTART_COUNTER_RESET_MS = 60000;
|
|
14
|
+
/** How often adopted connectors (no child handle) are checked for liveness. */
|
|
15
|
+
export declare const ADOPTED_POLL_INTERVAL_MS = 5000;
|
|
16
|
+
/** How long a stop waits for SIGTERM to land before escalating to SIGKILL. */
|
|
17
|
+
export declare const STOP_SIGTERM_TIMEOUT_MS = 5000;
|
|
18
|
+
/** How long a stop waits for SIGKILL to land before giving up on the wait. */
|
|
19
|
+
export declare const STOP_SIGKILL_TIMEOUT_MS = 2000;
|
|
20
|
+
export interface ConnectorSupervisorDeps {
|
|
21
|
+
launchSpec?: () => ConnectorCliLaunchSpec | undefined;
|
|
22
|
+
spawnProcess?: typeof spawn;
|
|
23
|
+
isProcessRunning?: (pid: number) => boolean;
|
|
24
|
+
killProcess?: (pid: number, signal: NodeJS.Signals) => void;
|
|
25
|
+
listActive?: typeof listActiveConnectors;
|
|
26
|
+
/**
|
|
27
|
+
* Reap a dead instance's leftovers: state file, thread bindings and hub
|
|
28
|
+
* sessions. Delegated because all of that is connector-specific and owned by
|
|
29
|
+
* the CLI; the supervisor only knows a process died.
|
|
30
|
+
*/
|
|
31
|
+
cleanupInstance?: (channel: string, instanceId: string) => Promise<void>;
|
|
32
|
+
isAutostartEnabled?: (channel: string, instanceId: string) => boolean;
|
|
33
|
+
log?: (message: string) => void;
|
|
34
|
+
now?: () => number;
|
|
35
|
+
setTimer?: (callback: () => void, delayMs: number) => unknown;
|
|
36
|
+
clearTimer?: (handle: unknown) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Owns the lifecycle of connector processes on behalf of the hub.
|
|
40
|
+
*
|
|
41
|
+
* Three responsibilities, in order of why this exists:
|
|
42
|
+
*
|
|
43
|
+
* 1. **Single instance per (channel, instanceId).** The in-memory map is the
|
|
44
|
+
* authority, so two connectors can never hold the same bot token because two
|
|
45
|
+
* processes raced on a state file.
|
|
46
|
+
* 2. **Reaping.** When a connector dies its state file, thread bindings and hub
|
|
47
|
+
* sessions would otherwise linger until the next manual start, leaving
|
|
48
|
+
* Slack threads bound to sessions that no longer exist.
|
|
49
|
+
* 3. **Restart with backoff.** Replaces external watchdogs, and refuses to
|
|
50
|
+
* spin forever on a connector that cannot start (a revoked token).
|
|
51
|
+
*
|
|
52
|
+
* Connectors are spawned detached so a hub restart does not take them down; a
|
|
53
|
+
* later hub adopts the survivors by pid from their state files. That is why exit
|
|
54
|
+
* detection has two paths: child events for processes this hub spawned, pid
|
|
55
|
+
* polling for adopted ones.
|
|
56
|
+
*/
|
|
57
|
+
export declare class ConnectorSupervisor {
|
|
58
|
+
private readonly entries;
|
|
59
|
+
/**
|
|
60
|
+
* Tail of the in-flight start/stop chain per instance key. `start` suspends
|
|
61
|
+
* on `stop` (which shells into the CLI for cleanup, taking seconds), and two
|
|
62
|
+
* unserialised starts interleaving across that suspension each spawn their
|
|
63
|
+
* own process — the map ends up tracking one while the other survives as an
|
|
64
|
+
* untracked ghost holding the connector's credentials and ports.
|
|
65
|
+
*/
|
|
66
|
+
private readonly instanceLocks;
|
|
67
|
+
private pollTimer;
|
|
68
|
+
private disposed;
|
|
69
|
+
private readonly launchSpec;
|
|
70
|
+
private readonly spawnProcess;
|
|
71
|
+
private readonly isProcessRunning;
|
|
72
|
+
private readonly killProcess;
|
|
73
|
+
private readonly listActive;
|
|
74
|
+
private readonly cleanupInstance?;
|
|
75
|
+
private readonly isAutostartEnabled;
|
|
76
|
+
private readonly log;
|
|
77
|
+
private readonly now;
|
|
78
|
+
private readonly setTimer;
|
|
79
|
+
private readonly clearTimer;
|
|
80
|
+
constructor(deps?: ConnectorSupervisorDeps);
|
|
81
|
+
/**
|
|
82
|
+
* Take over connectors that are already running, so a replacement hub reaps
|
|
83
|
+
* and restarts the processes it inherited instead of ignoring them.
|
|
84
|
+
*/
|
|
85
|
+
adoptRunningConnectors(): SupervisedConnectorRecord[];
|
|
86
|
+
/**
|
|
87
|
+
* Serialise start/stop work per instance key. Both operations suspend
|
|
88
|
+
* mid-flight — a stop waits for the process to die and for the CLI cleanup,
|
|
89
|
+
* a start may embed a stop — and interleaving two of them across those
|
|
90
|
+
* suspensions is how the map ends up tracking one process while another
|
|
91
|
+
* lives on untracked. One instance, one queue.
|
|
92
|
+
*/
|
|
93
|
+
private withInstanceLock;
|
|
94
|
+
start(request: ConnectorStartRequest): Promise<ConnectorStartResult>;
|
|
95
|
+
private startLocked;
|
|
96
|
+
stop(request: {
|
|
97
|
+
channel: string;
|
|
98
|
+
instanceId: string;
|
|
99
|
+
disableAutostart?: boolean;
|
|
100
|
+
}): Promise<boolean>;
|
|
101
|
+
private stopLocked;
|
|
102
|
+
private signal;
|
|
103
|
+
private waitForProcessExit;
|
|
104
|
+
list(): SupervisedConnectorRecord[];
|
|
105
|
+
/**
|
|
106
|
+
* Stop supervising without touching the processes: they are detached and
|
|
107
|
+
* outlive this hub on purpose, and the next hub adopts them.
|
|
108
|
+
*/
|
|
109
|
+
dispose(): void;
|
|
110
|
+
private spawnEntry;
|
|
111
|
+
private handleExit;
|
|
112
|
+
private scheduleRestart;
|
|
113
|
+
/**
|
|
114
|
+
* An adopted connector has no argv of its own here, so its restart arguments
|
|
115
|
+
* come from the persisted autostart record.
|
|
116
|
+
*/
|
|
117
|
+
private resolveRestartArgs;
|
|
118
|
+
private cancelRestart;
|
|
119
|
+
private runCleanup;
|
|
120
|
+
private isEntryAlive;
|
|
121
|
+
/**
|
|
122
|
+
* Adopted connectors have no child handle, so their death is only visible by
|
|
123
|
+
* polling. Processes this hub spawned report their own exit and are skipped.
|
|
124
|
+
*/
|
|
125
|
+
private ensurePolling;
|
|
126
|
+
private hasAdoptedRunning;
|
|
127
|
+
private toRecord;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The hub daemon's supervisor. Hub command handlers reach it through here
|
|
131
|
+
* because they are invoked per-request and have no other shared state.
|
|
132
|
+
*/
|
|
133
|
+
export declare function setActiveConnectorSupervisor(supervisor: ConnectorSupervisor | undefined): void;
|
|
134
|
+
export declare function getActiveConnectorSupervisor(): ConnectorSupervisor | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReconnectAttempt } from "./connector-autostart";
|
|
2
|
+
import type { ConnectorSupervisor } from "./connector-supervisor";
|
|
3
|
+
/**
|
|
4
|
+
* Bring persisted connectors back under the new hub's supervision.
|
|
5
|
+
*
|
|
6
|
+
* Called once per daemon boot, after the supervisor has adopted whatever
|
|
7
|
+
* survived the previous hub. Survivors still have to be *restarted* rather than
|
|
8
|
+
* left running: their hub client authenticated against the old hub's token and
|
|
9
|
+
* cannot re-authenticate against this one, so the process has to come back to
|
|
10
|
+
* attach to the new session.
|
|
11
|
+
*
|
|
12
|
+
* Spawning itself belongs to the supervisor, which is the single authority on
|
|
13
|
+
* how many processes may hold one connector's credentials.
|
|
14
|
+
*/
|
|
15
|
+
export declare function reconnectDaemonConnectors(log?: (message: string) => void, supervisor?: ConnectorSupervisor | undefined): Promise<ReconnectAttempt[]>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { BasicLogger, FeatureFlagPayload, FeatureFlagsAndPayloads, FeatureFlagsContext, IFeatureFlagsProvider, ITelemetryService } from "@cerebriline/shared";
|
|
2
|
+
import { type FeatureFlag } from "@cerebriline/shared";
|
|
3
|
+
type CacheInfo = {
|
|
4
|
+
updateTime: number;
|
|
5
|
+
userId: string | null;
|
|
6
|
+
flagsPayload?: FeatureFlagsAndPayloads;
|
|
7
|
+
};
|
|
8
|
+
export type FeatureFlagsCacheSnapshot = CacheInfo;
|
|
9
|
+
export interface FeatureFlagsServiceOptions {
|
|
10
|
+
provider: IFeatureFlagsProvider;
|
|
11
|
+
telemetry?: ITelemetryService;
|
|
12
|
+
logger?: BasicLogger;
|
|
13
|
+
cacheTtlMs?: number;
|
|
14
|
+
cacheFilePath?: string;
|
|
15
|
+
persistentCacheMaxAgeMs?: number;
|
|
16
|
+
context?: FeatureFlagsContext;
|
|
17
|
+
}
|
|
18
|
+
export declare class FeatureFlagsService {
|
|
19
|
+
private readonly provider;
|
|
20
|
+
private readonly telemetry?;
|
|
21
|
+
private readonly logger?;
|
|
22
|
+
private readonly cacheTtlMs;
|
|
23
|
+
private readonly cacheFilePath?;
|
|
24
|
+
private readonly persistentCacheMaxAgeMs;
|
|
25
|
+
private context;
|
|
26
|
+
private cache;
|
|
27
|
+
private cacheInfo;
|
|
28
|
+
constructor(options: FeatureFlagsServiceOptions);
|
|
29
|
+
setContext(context: FeatureFlagsContext): void;
|
|
30
|
+
hydrateCache(snapshot: FeatureFlagsCacheSnapshot): void;
|
|
31
|
+
getCacheSnapshot(): FeatureFlagsCacheSnapshot;
|
|
32
|
+
poll(userId?: string | null): Promise<void>;
|
|
33
|
+
private hydrateFromPersistentCache;
|
|
34
|
+
private isFeatureFlagPayload;
|
|
35
|
+
private readPayloadRecord;
|
|
36
|
+
private readPersistentCache;
|
|
37
|
+
private writePersistentCache;
|
|
38
|
+
private getReturnedFlagKeys;
|
|
39
|
+
private rebuildCacheFromSnapshot;
|
|
40
|
+
private getFeatureFlag;
|
|
41
|
+
getBooleanFlagEnabled(flagName: FeatureFlag): boolean;
|
|
42
|
+
getFlagPayload(flagName: FeatureFlag): FeatureFlagPayload | undefined;
|
|
43
|
+
getProvider(): IFeatureFlagsProvider;
|
|
44
|
+
get enabled(): boolean;
|
|
45
|
+
getSettings(): import("@cerebriline/shared").FeatureFlagsSettings;
|
|
46
|
+
test(flagName: FeatureFlag, value: boolean): void;
|
|
47
|
+
dispose(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BasicLogger, FeatureFlagsAndPayloads, FeatureFlagsContext, FeatureFlagsSettings, IFeatureFlagsProvider } from "@cerebriline/shared";
|
|
2
|
+
import { PostHog, type PostHogOptions } from "posthog-node";
|
|
3
|
+
export interface PostHogFeatureFlagsProviderConfig {
|
|
4
|
+
logger?: BasicLogger;
|
|
5
|
+
}
|
|
6
|
+
export interface PostHogFeatureFlagsProviderOptions {
|
|
7
|
+
config: PostHogFeatureFlagsProviderConfig;
|
|
8
|
+
client: PostHog;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildClinePostHogClient(apiKey: string, options?: PostHogOptions | undefined): PostHog;
|
|
11
|
+
export declare class PostHogFeatureFlagsProvider implements IFeatureFlagsProvider {
|
|
12
|
+
private readonly client;
|
|
13
|
+
private readonly settings;
|
|
14
|
+
private readonly logger?;
|
|
15
|
+
constructor(options: PostHogFeatureFlagsProviderOptions);
|
|
16
|
+
getAllFlagsAndPayloads(options: {
|
|
17
|
+
flagKeys?: readonly string[];
|
|
18
|
+
context: FeatureFlagsContext;
|
|
19
|
+
}): Promise<FeatureFlagsAndPayloads | undefined>;
|
|
20
|
+
get enabled(): boolean;
|
|
21
|
+
getSettings(): FeatureFlagsSettings;
|
|
22
|
+
dispose(): Promise<void>;
|
|
23
|
+
private resolveDistinctId;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PostHog as s}from"posthog-node";function a(e,t){return new s(e,{host:"https://data.cline.bot",...t})}class o{client;settings;logger;constructor(e){if(!e.client)throw Error("PostHog client is required for feature flags");this.logger=e.config.logger,this.settings={enabled:!0},this.client=e.client}async getAllFlagsAndPayloads(e){if(!this.enabled)return;let t=this.resolveDistinctId(e.context);if(!t)return this.logger?.log?.("PostHog feature flags requested without a distinct ID"),{};try{return await this.client.getAllFlagsAndPayloads(t,{flagKeys:e.flagKeys?[...e.flagKeys]:void 0})}catch(r){return this.logger?.error?.("Error getting PostHog feature flags",{error:r}),{}}}get enabled(){return this.settings.enabled}getSettings(){return{...this.settings}}async dispose(){try{await this.client.shutdown()}catch(e){this.logger?.error?.("Error shutting down PostHog feature flags client",{error:e})}}resolveDistinctId(e){return e?.distinctId?.trim()||e?.userId?.trim()||void 0}}export{a as buildClinePostHogClient,o as PostHogFeatureFlagsProvider};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FeatureFlagsAndPayloads, FeatureFlagsSettings, IFeatureFlagsProvider } from "@cerebriline/shared";
|
|
2
|
+
export declare class NoOpFeatureFlagsProvider implements IFeatureFlagsProvider {
|
|
3
|
+
getAllFlagsAndPayloads(): Promise<FeatureFlagsAndPayloads>;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
getSettings(): FeatureFlagsSettings;
|
|
6
|
+
dispose(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type AgentConfig, type AgentTool, type ConfigurableModelToolName, type ITelemetryService, type ModelToolSettings } from "@cerebriline/shared";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
declare const GlobalCompactionStrategySchema: z.ZodCatch<z.ZodEnum<{
|
|
4
|
+
basic: "basic";
|
|
5
|
+
agentic: "agentic";
|
|
6
|
+
}>>;
|
|
7
|
+
export type GlobalCompactionStrategy = z.infer<typeof GlobalCompactionStrategySchema>;
|
|
8
|
+
/** Compaction strategy plus the "off" state surfaced by the CLI settings UI. */
|
|
9
|
+
export type GlobalCompactionMode = GlobalCompactionStrategy | "off";
|
|
10
|
+
declare const GlobalPlanActModeSchema: z.ZodEnum<{
|
|
11
|
+
plan: "plan";
|
|
12
|
+
act: "act";
|
|
13
|
+
}>;
|
|
14
|
+
export type GlobalPlanActMode = z.infer<typeof GlobalPlanActModeSchema>;
|
|
15
|
+
export declare const GlobalSettingsSchema: z.ZodPipe<z.ZodObject<{
|
|
16
|
+
telemetryOptOut: z.ZodCatch<z.ZodDefault<z.ZodBoolean>>;
|
|
17
|
+
autoUpdateEnabled: z.ZodCatch<z.ZodDefault<z.ZodBoolean>>;
|
|
18
|
+
compactionStrategy: z.ZodOptional<z.ZodCatch<z.ZodEnum<{
|
|
19
|
+
basic: "basic";
|
|
20
|
+
agentic: "agentic";
|
|
21
|
+
}>>>;
|
|
22
|
+
compactionEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
23
|
+
planActMode: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
plan: "plan";
|
|
25
|
+
act: "act";
|
|
26
|
+
}>>>;
|
|
27
|
+
toolAutoApprove: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
28
|
+
tuiTheme: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
disabledTools: z.ZodOptional<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | undefined, string[] | undefined>>>;
|
|
30
|
+
tools: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
31
|
+
web_search: "web_search";
|
|
32
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
33
|
+
enabled: z.ZodBoolean;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
disabledPlugins: z.ZodOptional<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | undefined, string[] | undefined>>>;
|
|
36
|
+
disabledAgentPlugins: z.ZodOptional<z.ZodPipe<z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | undefined, string[] | undefined>>>;
|
|
37
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
38
|
+
telemetryOptOut: boolean;
|
|
39
|
+
autoUpdateEnabled: boolean;
|
|
40
|
+
compactionStrategy?: GlobalCompactionStrategy;
|
|
41
|
+
compactionEnabled?: boolean;
|
|
42
|
+
planActMode?: GlobalPlanActMode;
|
|
43
|
+
toolAutoApprove?: boolean;
|
|
44
|
+
tuiTheme?: string;
|
|
45
|
+
disabledTools?: string[];
|
|
46
|
+
tools?: ModelToolSettings;
|
|
47
|
+
disabledPlugins?: string[];
|
|
48
|
+
disabledAgentPlugins?: string[];
|
|
49
|
+
}, {
|
|
50
|
+
telemetryOptOut: boolean;
|
|
51
|
+
autoUpdateEnabled: boolean;
|
|
52
|
+
compactionStrategy?: "basic" | "agentic" | undefined;
|
|
53
|
+
compactionEnabled?: boolean | undefined;
|
|
54
|
+
planActMode?: "plan" | "act" | undefined;
|
|
55
|
+
toolAutoApprove?: boolean | undefined;
|
|
56
|
+
tuiTheme?: string | undefined;
|
|
57
|
+
disabledTools?: string[] | undefined;
|
|
58
|
+
tools?: Partial<Record<"web_search", {
|
|
59
|
+
enabled: boolean;
|
|
60
|
+
}>> | undefined;
|
|
61
|
+
disabledPlugins?: string[] | undefined;
|
|
62
|
+
disabledAgentPlugins?: string[] | undefined;
|
|
63
|
+
}>>;
|
|
64
|
+
export type GlobalSettings = z.infer<typeof GlobalSettingsSchema>;
|
|
65
|
+
export interface WriteGlobalSettingsOptions {
|
|
66
|
+
telemetry?: ITelemetryService;
|
|
67
|
+
}
|
|
68
|
+
export declare function readGlobalSettings(): GlobalSettings;
|
|
69
|
+
export declare function writeGlobalSettings(settings: z.input<typeof GlobalSettingsSchema>, options?: WriteGlobalSettingsOptions): void;
|
|
70
|
+
export declare function isTelemetryOptedOutGlobally(): boolean;
|
|
71
|
+
export declare function setTelemetryOptOutGlobally(telemetryOptOut: boolean, options?: WriteGlobalSettingsOptions): void;
|
|
72
|
+
export declare function isAutoUpdateEnabledGlobally(): boolean;
|
|
73
|
+
export declare function setAutoUpdateEnabledGlobally(autoUpdateEnabled: boolean, options?: WriteGlobalSettingsOptions): void;
|
|
74
|
+
export declare function readCompactionStrategyGlobally(): GlobalCompactionStrategy;
|
|
75
|
+
export declare function setCompactionStrategyGlobally(compactionStrategy: GlobalCompactionStrategy): void;
|
|
76
|
+
/**
|
|
77
|
+
* Returns the persisted compaction mode including the disabled state, or
|
|
78
|
+
* undefined when the user never chose one (callers apply their own default).
|
|
79
|
+
*/
|
|
80
|
+
export declare function readCompactionModeGlobally(): GlobalCompactionMode | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Persists the full compaction mode. Selecting "off" keeps the previously
|
|
83
|
+
* chosen strategy so re-enabling compaction restores it.
|
|
84
|
+
*/
|
|
85
|
+
export declare function setCompactionModeGlobally(mode: GlobalCompactionMode): void;
|
|
86
|
+
export declare function readPlanActModeGlobally(): GlobalPlanActMode | undefined;
|
|
87
|
+
export declare function setPlanActModeGlobally(planActMode: GlobalPlanActMode): void;
|
|
88
|
+
export declare function readToolAutoApproveGlobally(): boolean | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the persisted TUI theme id, or undefined when the user never chose
|
|
91
|
+
* one (callers apply their own default, typically terminal auto-detection).
|
|
92
|
+
*/
|
|
93
|
+
export declare function readTuiThemeGlobally(): string | undefined;
|
|
94
|
+
export declare function setTuiThemeGlobally(tuiTheme: string): void;
|
|
95
|
+
export declare function setToolAutoApproveGlobally(toolAutoApprove: boolean): void;
|
|
96
|
+
export declare function resolveDisabledToolNames(disabledToolNames?: ReadonlyArray<string>): Set<string>;
|
|
97
|
+
export declare function resolveDisabledPluginPaths(disabledPluginPaths?: ReadonlyArray<string>): Set<string>;
|
|
98
|
+
export declare function resolveDisabledAgentPluginNames(disabledPluginNames?: ReadonlyArray<string>): Set<string>;
|
|
99
|
+
export declare function isToolDisabledGlobally(toolName: string): boolean;
|
|
100
|
+
export declare function resolveModelToolSettings(): ModelToolSettings;
|
|
101
|
+
export declare function isModelToolEnabledGlobally(name: ConfigurableModelToolName): boolean;
|
|
102
|
+
export declare function setModelToolEnabledGlobally(name: ConfigurableModelToolName, enabled: boolean): void;
|
|
103
|
+
export declare function toggleDisabledTool(toolName: string): boolean;
|
|
104
|
+
export declare function setDisabledTools(toolNames: ReadonlyArray<string>, disabledValue: boolean): void;
|
|
105
|
+
export declare function setToolDisabledGlobally(toolName: string, disabled: boolean): boolean;
|
|
106
|
+
export declare function isPluginDisabledGlobally(pluginPath: string): boolean;
|
|
107
|
+
export declare function setDisabledPlugin(pluginPath: string, disabledValue: boolean): void;
|
|
108
|
+
export declare function isAgentPluginDisabledGlobally(pluginName: string): boolean;
|
|
109
|
+
export declare function setDisabledAgentPlugin(pluginName: string, disabledValue: boolean): void;
|
|
110
|
+
export declare function filterDisabledPluginPaths(pluginPaths: ReadonlyArray<string>, disabledPluginPaths?: ReadonlyArray<string>): string[];
|
|
111
|
+
export declare function filterDisabledTools<T extends Pick<AgentTool, "name">>(tools: ReadonlyArray<T>, disabledToolNames?: ReadonlyArray<string>): T[];
|
|
112
|
+
export declare function filterExtensionToolRegistrations(extensions: AgentConfig["extensions"], disabledToolNames?: ReadonlyArray<string>): AgentConfig["extensions"];
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter: wrap a custom `ApiHandler` (from the `@cerebriline/llms` handler registry)
|
|
3
|
+
* as an `AgentModel` for the agent runtime.
|
|
4
|
+
*
|
|
5
|
+
* The agent runtime builds models via `createAgentModelFromConfig`, which goes
|
|
6
|
+
* straight to the gateway. Hosts can register provider handlers that need
|
|
7
|
+
* host-only dependencies (e.g. the VS Code `vscode.lm` API) via
|
|
8
|
+
* `registerHandler(providerId, factory)`. Those produce an `ApiHandler`
|
|
9
|
+
* (`createMessage` -> `ApiStreamChunk`), which this adapter converts into the
|
|
10
|
+
* `AgentModel` contract (`stream` -> `AgentModelEvent`).
|
|
11
|
+
*
|
|
12
|
+
* This is the inverse of the gateway's `toApiStreamChunk` in
|
|
13
|
+
* `@cerebriline/llms` `compat.ts`.
|
|
14
|
+
*/
|
|
15
|
+
import { type ApiHandler } from "@cerebriline/llms";
|
|
16
|
+
import type { AgentModel } from "@cerebriline/shared";
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the `ApiHandler` to delegate to. A function is supported (and may be
|
|
19
|
+
* async) so handler construction can be deferred to the first `stream` call —
|
|
20
|
+
* which is required for providers registered via `registerAsyncHandler`.
|
|
21
|
+
*/
|
|
22
|
+
export type ApiHandlerSource = ApiHandler | (() => ApiHandler | Promise<ApiHandler>);
|
|
23
|
+
/**
|
|
24
|
+
* Build an `AgentModel` that delegates to a registered `ApiHandler`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createAgentModelFromApiHandler(source: ApiHandlerSource): AgentModel;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ProviderModel } from "@cerebriline/shared";
|
|
2
|
+
import { ProviderSettingsManager } from "../storage/provider-settings-manager";
|
|
3
|
+
import type { ModelInfo } from "./provider-settings";
|
|
4
|
+
export interface ClineRecommendedModel {
|
|
5
|
+
id: string;
|
|
6
|
+
/** Display-ready model name, resolved against the model catalog. */
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
tags: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ClineRecommendedModelsData {
|
|
12
|
+
recommended: ClineRecommendedModel[];
|
|
13
|
+
free: ClineRecommendedModel[];
|
|
14
|
+
clinePass: ClineRecommendedModel[];
|
|
15
|
+
}
|
|
16
|
+
type ModelsCatalog = Record<string, Record<string, ModelInfo>>;
|
|
17
|
+
export interface FetchClineRecommendedModelsOptions {
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
fetchImpl?: typeof fetch;
|
|
20
|
+
providerSettingsManager?: Pick<ProviderSettingsManager, "getProviderSettings">;
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Loader for the live models catalog used to resolve display names.
|
|
24
|
+
* Defaults to the shared live-catalog cache; injectable for tests.
|
|
25
|
+
*/
|
|
26
|
+
catalogLoader?: () => Promise<ModelsCatalog>;
|
|
27
|
+
}
|
|
28
|
+
export declare const FALLBACK_CLINE_RECOMMENDED_MODELS: ClineRecommendedModelsData;
|
|
29
|
+
export declare function fetchClineRecommendedModels(options?: FetchClineRecommendedModelsOptions): Promise<ClineRecommendedModelsData>;
|
|
30
|
+
/**
|
|
31
|
+
* `fetchClineRecommendedModels` with a shared in-memory cache, for callers on
|
|
32
|
+
* the model-list path (every picker open) where a per-call network round-trip
|
|
33
|
+
* — or its 5s offline timeout — is unacceptable. The bundled offline fallback
|
|
34
|
+
* is cached too: paying the timeout once per TTL beats paying it on every
|
|
35
|
+
* model list while offline, and a recovered network is picked up within the
|
|
36
|
+
* TTL.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getCachedClineRecommendedModels(options?: FetchClineRecommendedModelsOptions): Promise<ClineRecommendedModelsData>;
|
|
39
|
+
/**
|
|
40
|
+
* Synchronous, never-blocking view of the feed: the cached live data when
|
|
41
|
+
* fresh, otherwise the bundled fallback. For callers that build model lists
|
|
42
|
+
* eagerly and must not wait on the network (the provider catalog at startup),
|
|
43
|
+
* so even a cold boot renders tiered sections instead of a flat list. The
|
|
44
|
+
* async `getCachedClineRecommendedModels` path refreshes the cache, after
|
|
45
|
+
* which peeks serve live data for the TTL.
|
|
46
|
+
*/
|
|
47
|
+
export declare function peekClineRecommendedModels(): ClineRecommendedModelsData;
|
|
48
|
+
export declare function resetClineRecommendedModelsCacheForTests(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Stamps recommended-feed tiers onto a provider's model list so clients can
|
|
51
|
+
* render Recommended/Free/Subscribed sections straight off `ProviderModel`
|
|
52
|
+
* instead of fetching and joining the feed themselves. Feed ids are matched
|
|
53
|
+
* through the Vercel/OpenRouter alias rules (the feed can spell a model
|
|
54
|
+
* differently from the catalog), with a fallback on the id's slug after "/"
|
|
55
|
+
* when that slug is unambiguous — the feed and the catalog can carry
|
|
56
|
+
* different vendor prefixes for the same model (`kwaipilot/kat-coder-pro`
|
|
57
|
+
* vs `cline-free/kat-coder-pro`), most visibly when the bundled fallback
|
|
58
|
+
* feed is stamped against a live-fetched catalog. Models the feed does not
|
|
59
|
+
* mention are returned unchanged; unknown providers pass through untouched.
|
|
60
|
+
*/
|
|
61
|
+
export declare function applyClineFeaturedModels(providerId: string, models: ProviderModel[], data: ClineRecommendedModelsData): ProviderModel[];
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ProviderConfig } from "./provider-settings";
|
|
2
|
+
import type { BuiltInProviderSummary, CreateHandlerInput, ProviderConfigDefaults, ProviderSelectionConfig, RegisteredProviderSummary } from "./runtime-types";
|
|
3
|
+
interface RegisterConfiguredProviderInput {
|
|
4
|
+
id: string;
|
|
5
|
+
models: readonly string[];
|
|
6
|
+
defaultModel?: string;
|
|
7
|
+
defaults?: ProviderConfigDefaults;
|
|
8
|
+
}
|
|
9
|
+
export declare function toBuiltInProviderSummary(input: {
|
|
10
|
+
collection: BuiltInProviderSummary["id"] extends string ? {
|
|
11
|
+
provider: Pick<import("@cerebriline/llms").ProviderInfo, "id" | "name" | "description" | "protocol" | "baseUrl" | "capabilities" | "env" | "defaultModelId">;
|
|
12
|
+
models: Record<string, unknown>;
|
|
13
|
+
} : never;
|
|
14
|
+
}): BuiltInProviderSummary;
|
|
15
|
+
export declare class ConfiguredProviderRegistry {
|
|
16
|
+
private readonly providers;
|
|
17
|
+
register(input: RegisterConfiguredProviderInput): void;
|
|
18
|
+
registerSelectionConfig(provider: ProviderSelectionConfig): void;
|
|
19
|
+
registerModel(providerId: string, modelId: string): void;
|
|
20
|
+
createHandlerConfig(input: CreateHandlerInput): ProviderConfig;
|
|
21
|
+
list(): RegisteredProviderSummary[];
|
|
22
|
+
getModels(providerId: string): string[];
|
|
23
|
+
hasProvider(providerId: string): boolean;
|
|
24
|
+
hasModel(providerId: string, modelId: string): boolean;
|
|
25
|
+
private require;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AgentConfig, AgentModel, BasicLogger, ITelemetryService, ModelInfo } from "@cerebriline/shared";
|
|
2
|
+
export declare function resolveKnownModelsFromConfig(config: AgentConfig): Record<string, ModelInfo> | undefined;
|
|
3
|
+
export interface CreateAgentModelOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Set by the caller that is running the conversation itself.
|
|
6
|
+
*
|
|
7
|
+
* The request path keeps process-wide records of what the last request cost
|
|
8
|
+
* and what capped it, and compaction reads them back; only the conversation
|
|
9
|
+
* may write them. This factory serves the agent loop *and* the machinery
|
|
10
|
+
* around it -- the CLI builds its image describer from the same call -- so
|
|
11
|
+
* the loop has to say so rather than the describer having to say it is not.
|
|
12
|
+
*/
|
|
13
|
+
conversation?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Force the auxiliary scheduling this config did not carry.
|
|
16
|
+
*
|
|
17
|
+
* A caller that builds its model from a session's config inherits that
|
|
18
|
+
* config's `providerConfig`, which is the conversation's; there is no place
|
|
19
|
+
* on it to say "but this call is not". This is that place.
|
|
20
|
+
*/
|
|
21
|
+
auxiliary?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function createAgentModelFromConfig(config: AgentConfig, logger: BasicLogger | undefined, telemetry?: ITelemetryService, options?: CreateAgentModelOptions): AgentModel;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** biome-ignore-all lint/style/noNonNullAssertion: static */
|
|
2
|
+
import * as Llms from "@cerebriline/llms";
|
|
3
|
+
import type { ModelCatalogConfig, ModelInfo, ProviderCapability, ProviderConfig } from "./provider-settings";
|
|
4
|
+
export interface BuiltInProviderManifest {
|
|
5
|
+
id: string;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
modelsSourceUrl?: string;
|
|
8
|
+
modelId: string;
|
|
9
|
+
knownModels?: Record<string, ModelInfo>;
|
|
10
|
+
capabilities?: Llms.CatalogProviderCapability[];
|
|
11
|
+
env?: readonly string[];
|
|
12
|
+
client: Llms.ProviderClient;
|
|
13
|
+
protocol?: Llms.ProviderProtocol;
|
|
14
|
+
}
|
|
15
|
+
export interface ProviderDefaults {
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
modelId: string;
|
|
18
|
+
knownModels?: Record<string, ModelInfo>;
|
|
19
|
+
capabilities?: ProviderCapability[];
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_MODELS_CATALOG_URL = "https://models.dev/api.json";
|
|
22
|
+
/**
|
|
23
|
+
* Whether a provider's model catalog comes from the customer's configured
|
|
24
|
+
* endpoint rather than a shared public catalog.
|
|
25
|
+
*
|
|
26
|
+
* Keep this derived from the fetcher registry so host consumers cannot drift
|
|
27
|
+
* from the providers whose live metadata is endpoint-specific.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isPrivateModelCatalogProvider(providerId: string): boolean;
|
|
30
|
+
export declare function clearPublicModelsCatalogCache(): void;
|
|
31
|
+
export declare function getLiveModelsCatalog(options?: Pick<ModelCatalogConfig, "url" | "cacheTtlMs">): Promise<Record<string, Record<string, ModelInfo>>>;
|
|
32
|
+
export declare function clearLiveModelsCatalogCache(url?: string): void;
|
|
33
|
+
export declare function clearPrivateModelsCatalogCache(): void;
|
|
34
|
+
export declare const OPENAI_COMPATIBLE_PROVIDERS: Record<string, ProviderDefaults>;
|
|
35
|
+
export declare function getProviderConfig(providerId: string): ProviderDefaults | undefined;
|
|
36
|
+
export declare function resolveProviderConfig(providerId: string, modelCatalog?: ModelCatalogConfig, config?: ProviderConfig): Promise<ProviderDefaults | undefined>;
|