@clinebot/core 0.0.37 → 0.0.38
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/README.md +11 -1
- package/dist/ClineCore.d.ts +18 -214
- package/dist/account/cline-account-service.d.ts +0 -1
- package/dist/account/index.d.ts +0 -1
- package/dist/account/rpc.d.ts +0 -1
- package/dist/account/types.d.ts +0 -1
- package/dist/auth/bounded-ttl-cache.d.ts +0 -1
- package/dist/auth/client.d.ts +0 -1
- package/dist/auth/cline.d.ts +0 -5
- package/dist/auth/codex.d.ts +0 -1
- package/dist/auth/oca.d.ts +0 -1
- package/dist/auth/server.d.ts +0 -1
- package/dist/auth/types.d.ts +0 -1
- package/dist/auth/utils.d.ts +0 -1
- 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 +221 -0
- package/dist/cron/{cron-event-ingress.d.ts → events/cron-event-ingress.d.ts} +1 -2
- package/dist/cron/{cron-report-writer.d.ts → reports/cron-report-writer.d.ts} +1 -2
- package/dist/cron/{cron-materializer.d.ts → runner/cron-materializer.d.ts} +1 -2
- package/dist/cron/{cron-runner.d.ts → runner/cron-runner.d.ts} +6 -4
- package/dist/cron/{resource-limiter.d.ts → runner/resource-limiter.d.ts} +0 -1
- package/dist/cron/schedule/scheduler.d.ts +12 -0
- package/dist/cron/{cron-service.d.ts → service/cron-service.d.ts} +4 -5
- package/dist/cron/{schedule-command-service.d.ts → service/schedule-command-service.d.ts} +0 -1
- package/dist/cron/{schedule-service.d.ts → service/schedule-service.d.ts} +20 -22
- package/dist/cron/{cron-reconciler.d.ts → specs/cron-reconciler.d.ts} +1 -2
- package/dist/cron/{cron-spec-parser.d.ts → specs/cron-spec-parser.d.ts} +0 -1
- package/dist/cron/{cron-watcher.d.ts → specs/cron-watcher.d.ts} +0 -1
- package/dist/cron/{cron-schema.d.ts → store/cron-schema.d.ts} +0 -1
- package/dist/cron/{sqlite-cron-store.d.ts → store/sqlite-cron-store.d.ts} +12 -2
- package/dist/extensions/config/index.d.ts +4 -7
- package/dist/extensions/config/runtime-commands.d.ts +0 -1
- package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
- package/dist/extensions/config/unified-config-file-watcher.d.ts +0 -1
- package/dist/extensions/config/user-instruction-config-loader.d.ts +0 -1
- package/dist/extensions/config/user-instruction-plugin.d.ts +25 -0
- package/dist/extensions/config/user-instruction-service.d.ts +23 -0
- package/dist/extensions/context/agentic-compaction.d.ts +0 -1
- package/dist/extensions/context/basic-compaction.d.ts +0 -1
- package/dist/extensions/context/compaction-shared.d.ts +0 -1
- package/dist/extensions/context/compaction.d.ts +0 -1
- package/dist/extensions/index.d.ts +0 -1
- package/dist/extensions/mcp/client.d.ts +0 -1
- package/dist/extensions/mcp/config-loader.d.ts +0 -1
- package/dist/extensions/mcp/index.d.ts +0 -1
- package/dist/extensions/mcp/manager.d.ts +0 -1
- package/dist/extensions/mcp/name-transform.d.ts +0 -1
- package/dist/extensions/mcp/policies.d.ts +0 -1
- package/dist/extensions/mcp/tools.d.ts +2 -3
- package/dist/extensions/mcp/types.d.ts +3 -4
- package/dist/extensions/plugin/plugin-config-loader.d.ts +0 -1
- package/dist/extensions/plugin/plugin-load-report.d.ts +0 -1
- package/dist/extensions/plugin/plugin-loader.d.ts +0 -1
- package/dist/extensions/plugin/plugin-module-import.d.ts +0 -1
- package/dist/extensions/plugin/plugin-sandbox.d.ts +0 -1
- package/dist/extensions/plugin/plugin-targeting.d.ts +0 -1
- package/dist/extensions/plugin-sandbox-bootstrap.js +1 -446
- package/dist/extensions/tools/constants.d.ts +0 -1
- package/dist/extensions/tools/definitions.d.ts +13 -14
- package/dist/extensions/tools/executors/apply-patch-parser.d.ts +0 -1
- package/dist/extensions/tools/executors/apply-patch.d.ts +0 -1
- package/dist/extensions/tools/executors/bash.d.ts +0 -1
- package/dist/extensions/tools/executors/editor.d.ts +0 -1
- package/dist/extensions/tools/executors/file-read.d.ts +0 -1
- package/dist/extensions/tools/executors/index.d.ts +0 -1
- package/dist/extensions/tools/executors/search.d.ts +0 -1
- package/dist/extensions/tools/executors/web-fetch.d.ts +0 -1
- package/dist/extensions/tools/helpers.d.ts +0 -1
- package/dist/extensions/tools/index.d.ts +2 -3
- package/dist/extensions/tools/model-tool-routing.d.ts +0 -1
- package/dist/extensions/tools/presets.d.ts +4 -5
- package/dist/extensions/tools/runtime.d.ts +0 -1
- package/dist/extensions/tools/schemas.d.ts +0 -1
- package/dist/extensions/tools/team/delegated-agent.d.ts +3 -4
- package/dist/extensions/tools/team/index.d.ts +0 -1
- package/dist/extensions/tools/team/multi-agent.d.ts +1 -2
- package/dist/extensions/tools/team/projections.d.ts +0 -1
- package/dist/extensions/tools/team/runtime.d.ts +0 -1
- package/dist/extensions/tools/team/spawn-agent-tool.d.ts +4 -5
- package/dist/extensions/tools/team/subagent-prompts.d.ts +0 -1
- package/dist/extensions/tools/team/team-tools.d.ts +7 -8
- package/dist/extensions/tools/types.d.ts +11 -12
- package/dist/hooks/checkpoint-hooks.d.ts +9 -2
- package/dist/hooks/hook-extension.d.ts +2 -0
- package/dist/{extensions/config/hooks-config-loader.d.ts → hooks/hook-file-config.d.ts} +1 -2
- package/dist/hooks/hook-file-hooks.d.ts +2 -2
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/subprocess-runner.d.ts +0 -1
- package/dist/hooks/subprocess.d.ts +0 -1
- package/dist/hub/{connect.d.ts → client/connect.d.ts} +1 -2
- package/dist/hub/{client.d.ts → client/index.d.ts} +41 -4
- package/dist/hub/{session-client.d.ts → client/session-client.d.ts} +41 -13
- package/dist/hub/{ui-client.d.ts → client/ui-client.d.ts} +1 -1
- package/dist/hub/daemon/entry.d.ts +1 -0
- package/dist/hub/daemon/entry.js +720 -0
- package/dist/hub/{daemon.d.ts → daemon/index.d.ts} +6 -3
- package/dist/hub/{runtime-handlers.d.ts → daemon/runtime-handlers.d.ts} +3 -2
- package/dist/hub/{start-shared-server.d.ts → daemon/start-shared-server.d.ts} +1 -2
- package/dist/hub/{defaults.d.ts → discovery/defaults.d.ts} +0 -1
- package/dist/hub/{discovery.d.ts → discovery/index.d.ts} +2 -1
- package/dist/hub/{workspace.d.ts → discovery/workspace.d.ts} +1 -2
- package/dist/hub/index.d.ts +28 -11
- package/dist/hub/index.js +484 -1061
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +73 -0
- package/dist/{transports/remote.d.ts → hub/runtime-host/remote-runtime-host.d.ts} +1 -2
- package/dist/hub/{browser-websocket.d.ts → server/browser-websocket.d.ts} +1 -2
- package/dist/hub/{transport.d.ts → server/command-transport.d.ts} +0 -1
- package/dist/hub/server/handlers/approval-handlers.d.ts +17 -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/context.d.ts +56 -0
- package/dist/hub/server/handlers/run-handlers.d.ts +5 -0
- package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +20 -0
- package/dist/hub/server/hub-client-contributions.d.ts +19 -0
- package/dist/hub/server/hub-notifications.d.ts +7 -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 +55 -0
- package/dist/hub/server/hub-server-transport.d.ts +34 -0
- package/dist/hub/server/hub-session-records.d.ts +8 -0
- package/dist/hub/server/hub-websocket-server.d.ts +6 -0
- package/dist/hub/server/index.d.ts +4 -0
- package/dist/hub/{native-transport.d.ts → server/native-transport.d.ts} +1 -2
- package/dist/index.d.ts +51 -41
- package/dist/index.js +214 -872
- 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 +6 -0
- package/dist/runtime/config/agent-message-codec.d.ts +6 -0
- package/dist/runtime/{agent-runtime-config-builder.d.ts → config/agent-runtime-config-builder.d.ts} +12 -21
- package/dist/runtime/host/history.d.ts +18 -0
- package/dist/runtime/{host.d.ts → host/host.d.ts} +3 -4
- package/dist/runtime/host/local/agent-event-bridge.d.ts +29 -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 +15 -0
- package/dist/runtime/host/local/user-files.d.ts +1 -0
- package/dist/runtime/host/local-runtime-host.d.ts +118 -0
- package/dist/{transports → runtime/host}/runtime-host-support.d.ts +3 -5
- package/dist/runtime/{runtime-host.d.ts → host/runtime-host.d.ts} +66 -31
- package/dist/runtime/{runtime-builder.d.ts → orchestration/runtime-builder.d.ts} +0 -1
- package/dist/runtime/{runtime-event-adapter.d.ts → orchestration/runtime-event-adapter.d.ts} +0 -1
- package/dist/runtime/{runtime-oauth-token-manager.d.ts → orchestration/runtime-oauth-token-manager.d.ts} +1 -2
- package/dist/runtime/{session-runtime-orchestrator.d.ts → orchestration/session-runtime-orchestrator.d.ts} +20 -63
- package/dist/runtime/{session-runtime.d.ts → orchestration/session-runtime.d.ts} +14 -12
- package/dist/runtime/{user-input-builder.d.ts → orchestration/user-input-builder.d.ts} +2 -11
- package/dist/runtime/{loop-detection.d.ts → safety/loop-detection.d.ts} +0 -1
- package/dist/runtime/{mistake-tracker.d.ts → safety/mistake-tracker.d.ts} +0 -1
- package/dist/runtime/{rules.d.ts → safety/rules.d.ts} +1 -2
- package/dist/runtime/{subprocess-sandbox.d.ts → tools/subprocess-sandbox.d.ts} +15 -1
- package/dist/runtime/{tool-approval.d.ts → tools/tool-approval.d.ts} +0 -1
- package/dist/runtime/turn-queue/pending-prompt-service.d.ts +64 -0
- package/dist/services/agent-events.d.ts +1 -2
- package/dist/services/config.d.ts +0 -1
- package/dist/services/global-settings.d.ts +27 -5
- package/dist/{llms → services/llms}/cline-recommended-models.d.ts +1 -2
- package/dist/{llms → services/llms}/configured-provider-registry.d.ts +0 -1
- package/dist/services/llms/handler-factory.d.ts +3 -0
- package/dist/{llms → services/llms}/provider-defaults.d.ts +2 -1
- package/dist/{llms → services/llms}/provider-settings.d.ts +5 -3
- package/dist/{llms → services/llms}/runtime-config.d.ts +0 -1
- package/dist/{llms → services/llms}/runtime-registry.d.ts +0 -1
- package/dist/{llms → services/llms}/runtime-types.d.ts +0 -1
- package/dist/services/local-runtime-bootstrap.d.ts +7 -9
- package/dist/services/plugin-tools.d.ts +0 -1
- package/dist/services/providers/local-provider-registry.d.ts +9 -10
- package/dist/services/providers/local-provider-service.d.ts +36 -3
- package/dist/services/providers/model-source.d.ts +3 -0
- package/dist/services/session-artifacts.d.ts +0 -1
- package/dist/services/session-data.d.ts +2 -3
- package/dist/services/session-telemetry.d.ts +0 -1
- package/dist/services/storage/file-team-store.d.ts +0 -1
- package/dist/services/storage/provider-settings-legacy-migration.d.ts +0 -1
- package/dist/services/storage/provider-settings-manager.d.ts +3 -4
- package/dist/services/storage/sqlite-session-store.d.ts +0 -1
- package/dist/services/storage/sqlite-team-store.d.ts +0 -1
- package/dist/services/storage/team-store.d.ts +0 -1
- package/dist/services/telemetry/ITelemetryAdapter.d.ts +0 -1
- package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +0 -1
- package/dist/services/telemetry/OpenTelemetryProvider.d.ts +32 -1
- package/dist/services/telemetry/TelemetryLoggerSink.d.ts +0 -1
- package/dist/services/telemetry/TelemetryService.d.ts +0 -1
- package/dist/services/telemetry/core-events.d.ts +46 -3
- package/dist/services/telemetry/distinct-id.d.ts +0 -1
- package/dist/services/telemetry/index.d.ts +1 -2
- package/dist/services/telemetry/index.js +1 -0
- package/dist/services/usage.d.ts +10 -2
- package/dist/services/workspace/file-indexer.d.ts +0 -1
- package/dist/services/workspace/index.d.ts +0 -1
- package/dist/services/workspace/mention-enricher.d.ts +0 -1
- package/dist/{session → services/workspace}/workspace-manager.d.ts +0 -1
- package/dist/services/{workspace-manifest.d.ts → workspace/workspace-manifest.d.ts} +20 -5
- package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
- package/dist/session/checkpoint-restore.d.ts +20 -0
- package/dist/session/{session-graph.d.ts → models/session-graph.d.ts} +2 -3
- package/dist/session/{session-manifest.d.ts → models/session-manifest.d.ts} +0 -1
- package/dist/session/{session-row.d.ts → models/session-row.d.ts} +2 -3
- package/dist/session/{file-session-service.d.ts → services/file-session-service.d.ts} +1 -2
- package/dist/session/{message-builder.d.ts → services/message-builder.d.ts} +7 -16
- package/dist/session/{persistence-service.d.ts → services/persistence-service.d.ts} +10 -11
- package/dist/session/{session-service.d.ts → services/session-service.d.ts} +4 -5
- package/dist/session/session-snapshot.d.ts +57 -0
- package/dist/session/session-versioning-service.d.ts +48 -0
- package/dist/session/{conversation-store.d.ts → stores/conversation-store.d.ts} +0 -1
- package/dist/session/{session-manifest-store.d.ts → stores/session-manifest-store.d.ts} +3 -4
- package/dist/session/{team-persistence-store.d.ts → stores/team-persistence-store.d.ts} +2 -3
- package/dist/session/team/index.d.ts +2 -0
- package/dist/session/{subagent-session-manager.d.ts → team/team-child-session-manager.d.ts} +7 -8
- package/dist/session/{session-team-coordination.d.ts → team/team-session-coordinator.d.ts} +3 -4
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/settings-service.d.ts +6 -0
- package/dist/settings/types.d.ts +42 -0
- package/dist/types/chat-schema.d.ts +24 -7
- package/dist/types/common.d.ts +0 -1
- package/dist/types/config.d.ts +2 -3
- package/dist/types/events.d.ts +8 -1
- package/dist/types/provider-settings.d.ts +2 -3
- package/dist/types/session.d.ts +22 -6
- package/dist/types/sessions.d.ts +0 -1
- package/dist/types/storage.d.ts +0 -1
- package/dist/types.d.ts +17 -14
- package/dist/version.d.ts +0 -1
- package/package.json +16 -12
- package/dist/ClineCore.d.ts.map +0 -1
- package/dist/account/cline-account-service.d.ts.map +0 -1
- package/dist/account/index.d.ts.map +0 -1
- package/dist/account/rpc.d.ts.map +0 -1
- package/dist/account/types.d.ts.map +0 -1
- package/dist/auth/bounded-ttl-cache.d.ts.map +0 -1
- package/dist/auth/client.d.ts.map +0 -1
- package/dist/auth/cline.d.ts.map +0 -1
- package/dist/auth/codex.d.ts.map +0 -1
- package/dist/auth/oca.d.ts.map +0 -1
- package/dist/auth/server.d.ts.map +0 -1
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/utils.d.ts.map +0 -1
- package/dist/cron/cron-event-ingress.d.ts.map +0 -1
- package/dist/cron/cron-materializer.d.ts.map +0 -1
- package/dist/cron/cron-reconciler.d.ts.map +0 -1
- package/dist/cron/cron-report-writer.d.ts.map +0 -1
- package/dist/cron/cron-runner.d.ts.map +0 -1
- package/dist/cron/cron-schema.d.ts.map +0 -1
- package/dist/cron/cron-service.d.ts.map +0 -1
- package/dist/cron/cron-spec-parser.d.ts.map +0 -1
- package/dist/cron/cron-watcher.d.ts.map +0 -1
- package/dist/cron/resource-limiter.d.ts.map +0 -1
- package/dist/cron/schedule-command-service.d.ts.map +0 -1
- package/dist/cron/schedule-service.d.ts.map +0 -1
- package/dist/cron/scheduler.d.ts +0 -68
- package/dist/cron/scheduler.d.ts.map +0 -1
- package/dist/cron/sqlite-cron-store.d.ts.map +0 -1
- package/dist/cron/sqlite-schedule-store.d.ts +0 -52
- package/dist/cron/sqlite-schedule-store.d.ts.map +0 -1
- package/dist/extensions/config/agent-config-loader.d.ts +0 -20
- package/dist/extensions/config/agent-config-loader.d.ts.map +0 -1
- package/dist/extensions/config/agent-config-parser.d.ts +0 -29
- package/dist/extensions/config/agent-config-parser.d.ts.map +0 -1
- package/dist/extensions/config/hooks-config-loader.d.ts.map +0 -1
- package/dist/extensions/config/index.d.ts.map +0 -1
- package/dist/extensions/config/runtime-commands.d.ts.map +0 -1
- package/dist/extensions/config/unified-config-file-watcher.d.ts.map +0 -1
- package/dist/extensions/config/user-instruction-config-loader.d.ts.map +0 -1
- package/dist/extensions/context/agentic-compaction.d.ts.map +0 -1
- package/dist/extensions/context/basic-compaction.d.ts.map +0 -1
- package/dist/extensions/context/compaction-shared.d.ts.map +0 -1
- package/dist/extensions/context/compaction.d.ts.map +0 -1
- package/dist/extensions/index.d.ts.map +0 -1
- package/dist/extensions/mcp/client.d.ts.map +0 -1
- package/dist/extensions/mcp/config-loader.d.ts.map +0 -1
- package/dist/extensions/mcp/index.d.ts.map +0 -1
- package/dist/extensions/mcp/manager.d.ts.map +0 -1
- package/dist/extensions/mcp/name-transform.d.ts.map +0 -1
- package/dist/extensions/mcp/policies.d.ts.map +0 -1
- package/dist/extensions/mcp/tools.d.ts.map +0 -1
- package/dist/extensions/mcp/types.d.ts.map +0 -1
- package/dist/extensions/plugin/plugin-config-loader.d.ts.map +0 -1
- package/dist/extensions/plugin/plugin-load-report.d.ts.map +0 -1
- package/dist/extensions/plugin/plugin-loader.d.ts.map +0 -1
- package/dist/extensions/plugin/plugin-module-import.d.ts.map +0 -1
- package/dist/extensions/plugin/plugin-sandbox.d.ts.map +0 -1
- package/dist/extensions/plugin/plugin-targeting.d.ts.map +0 -1
- package/dist/extensions/tools/constants.d.ts.map +0 -1
- package/dist/extensions/tools/definitions.d.ts.map +0 -1
- package/dist/extensions/tools/executors/apply-patch-parser.d.ts.map +0 -1
- package/dist/extensions/tools/executors/apply-patch.d.ts.map +0 -1
- package/dist/extensions/tools/executors/bash.d.ts.map +0 -1
- package/dist/extensions/tools/executors/editor.d.ts.map +0 -1
- package/dist/extensions/tools/executors/file-read.d.ts.map +0 -1
- package/dist/extensions/tools/executors/index.d.ts.map +0 -1
- package/dist/extensions/tools/executors/search.d.ts.map +0 -1
- package/dist/extensions/tools/executors/web-fetch.d.ts.map +0 -1
- package/dist/extensions/tools/helpers.d.ts.map +0 -1
- package/dist/extensions/tools/index.d.ts.map +0 -1
- package/dist/extensions/tools/model-tool-routing.d.ts.map +0 -1
- package/dist/extensions/tools/presets.d.ts.map +0 -1
- package/dist/extensions/tools/runtime.d.ts.map +0 -1
- package/dist/extensions/tools/schemas.d.ts.map +0 -1
- package/dist/extensions/tools/team/delegated-agent.d.ts.map +0 -1
- package/dist/extensions/tools/team/index.d.ts.map +0 -1
- package/dist/extensions/tools/team/multi-agent.d.ts.map +0 -1
- package/dist/extensions/tools/team/projections.d.ts.map +0 -1
- package/dist/extensions/tools/team/runtime.d.ts.map +0 -1
- package/dist/extensions/tools/team/spawn-agent-tool.d.ts.map +0 -1
- package/dist/extensions/tools/team/subagent-prompts.d.ts.map +0 -1
- package/dist/extensions/tools/team/team-tools.d.ts.map +0 -1
- package/dist/extensions/tools/types.d.ts.map +0 -1
- package/dist/hooks/checkpoint-hooks.d.ts.map +0 -1
- package/dist/hooks/hook-bridge.d.ts +0 -118
- package/dist/hooks/hook-bridge.d.ts.map +0 -1
- package/dist/hooks/hook-file-hooks.d.ts.map +0 -1
- package/dist/hooks/hook-registry.d.ts +0 -16
- package/dist/hooks/hook-registry.d.ts.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/subprocess-runner.d.ts.map +0 -1
- package/dist/hooks/subprocess.d.ts.map +0 -1
- package/dist/hub/browser-websocket.d.ts.map +0 -1
- package/dist/hub/client.d.ts.map +0 -1
- package/dist/hub/connect.d.ts.map +0 -1
- package/dist/hub/daemon-entry.d.ts +0 -2
- package/dist/hub/daemon-entry.d.ts.map +0 -1
- package/dist/hub/daemon-entry.js +0 -1305
- package/dist/hub/daemon.d.ts.map +0 -1
- package/dist/hub/defaults.d.ts.map +0 -1
- package/dist/hub/discovery.d.ts.map +0 -1
- package/dist/hub/index.d.ts.map +0 -1
- package/dist/hub/native-transport.d.ts.map +0 -1
- package/dist/hub/runtime-handlers.d.ts.map +0 -1
- package/dist/hub/server.d.ts +0 -104
- package/dist/hub/server.d.ts.map +0 -1
- package/dist/hub/session-client.d.ts.map +0 -1
- package/dist/hub/start-shared-server.d.ts.map +0 -1
- package/dist/hub/transport.d.ts.map +0 -1
- package/dist/hub/ui-client.d.ts.map +0 -1
- package/dist/hub/workspace.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/llms/cline-recommended-models.d.ts.map +0 -1
- package/dist/llms/configured-provider-registry.d.ts.map +0 -1
- package/dist/llms/handler-factory.d.ts +0 -16
- package/dist/llms/handler-factory.d.ts.map +0 -1
- package/dist/llms/provider-defaults.d.ts.map +0 -1
- package/dist/llms/provider-settings.d.ts.map +0 -1
- package/dist/llms/runtime-config.d.ts.map +0 -1
- package/dist/llms/runtime-registry.d.ts.map +0 -1
- package/dist/llms/runtime-types.d.ts.map +0 -1
- package/dist/runtime/agent-config-adapter.d.ts +0 -148
- package/dist/runtime/agent-config-adapter.d.ts.map +0 -1
- package/dist/runtime/agent-runtime-config-builder.d.ts.map +0 -1
- package/dist/runtime/history.d.ts +0 -10
- package/dist/runtime/history.d.ts.map +0 -1
- package/dist/runtime/host.d.ts.map +0 -1
- package/dist/runtime/loop-detection.d.ts.map +0 -1
- package/dist/runtime/mistake-tracker.d.ts.map +0 -1
- package/dist/runtime/rules.d.ts.map +0 -1
- package/dist/runtime/runtime-builder.d.ts.map +0 -1
- package/dist/runtime/runtime-event-adapter.d.ts.map +0 -1
- package/dist/runtime/runtime-host.d.ts.map +0 -1
- package/dist/runtime/runtime-oauth-token-manager.d.ts.map +0 -1
- package/dist/runtime/session-runtime-orchestrator.d.ts.map +0 -1
- package/dist/runtime/session-runtime.d.ts.map +0 -1
- package/dist/runtime/subprocess-sandbox.d.ts.map +0 -1
- package/dist/runtime/tool-approval.d.ts.map +0 -1
- package/dist/runtime/user-input-builder.d.ts.map +0 -1
- package/dist/services/agent-events.d.ts.map +0 -1
- package/dist/services/config.d.ts.map +0 -1
- package/dist/services/global-settings.d.ts.map +0 -1
- package/dist/services/index.js +0 -28
- package/dist/services/local-runtime-bootstrap.d.ts.map +0 -1
- package/dist/services/plugin-tools.d.ts.map +0 -1
- package/dist/services/providers/local-provider-registry.d.ts.map +0 -1
- package/dist/services/providers/local-provider-service.d.ts.map +0 -1
- package/dist/services/session-artifacts.d.ts.map +0 -1
- package/dist/services/session-data.d.ts.map +0 -1
- package/dist/services/session-telemetry.d.ts.map +0 -1
- package/dist/services/storage/file-team-store.d.ts.map +0 -1
- package/dist/services/storage/provider-settings-legacy-migration.d.ts.map +0 -1
- package/dist/services/storage/provider-settings-manager.d.ts.map +0 -1
- package/dist/services/storage/sqlite-session-store.d.ts.map +0 -1
- package/dist/services/storage/sqlite-team-store.d.ts.map +0 -1
- package/dist/services/storage/team-store.d.ts.map +0 -1
- package/dist/services/telemetry/ITelemetryAdapter.d.ts.map +0 -1
- package/dist/services/telemetry/OpenTelemetryAdapter.d.ts.map +0 -1
- package/dist/services/telemetry/OpenTelemetryProvider.d.ts.map +0 -1
- package/dist/services/telemetry/TelemetryLoggerSink.d.ts.map +0 -1
- package/dist/services/telemetry/TelemetryService.d.ts.map +0 -1
- package/dist/services/telemetry/core-events.d.ts.map +0 -1
- package/dist/services/telemetry/distinct-id.d.ts.map +0 -1
- package/dist/services/telemetry/index.d.ts.map +0 -1
- package/dist/services/usage.d.ts.map +0 -1
- package/dist/services/workspace/file-indexer.d.ts.map +0 -1
- package/dist/services/workspace/index.d.ts.map +0 -1
- package/dist/services/workspace/mention-enricher.d.ts.map +0 -1
- package/dist/services/workspace-manifest.d.ts.map +0 -1
- package/dist/session/conversation-store.d.ts.map +0 -1
- package/dist/session/file-session-service.d.ts.map +0 -1
- package/dist/session/message-builder.d.ts.map +0 -1
- package/dist/session/persistence-service.d.ts.map +0 -1
- package/dist/session/session-graph.d.ts.map +0 -1
- package/dist/session/session-manifest-store.d.ts.map +0 -1
- package/dist/session/session-manifest.d.ts.map +0 -1
- package/dist/session/session-row.d.ts.map +0 -1
- package/dist/session/session-service.d.ts.map +0 -1
- package/dist/session/session-team-coordination.d.ts.map +0 -1
- package/dist/session/subagent-session-manager.d.ts.map +0 -1
- package/dist/session/team-persistence-store.d.ts.map +0 -1
- package/dist/session/workspace-manager.d.ts.map +0 -1
- package/dist/transports/hub.d.ts +0 -58
- package/dist/transports/hub.d.ts.map +0 -1
- package/dist/transports/local.d.ts +0 -119
- package/dist/transports/local.d.ts.map +0 -1
- package/dist/transports/remote.d.ts.map +0 -1
- package/dist/transports/runtime-host-support.d.ts.map +0 -1
- package/dist/types/chat-schema.d.ts.map +0 -1
- package/dist/types/common.d.ts.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/provider-settings.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- package/dist/types/sessions.d.ts.map +0 -1
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/src/ClineCore.ts +0 -1026
- package/src/account/cline-account-service.ts +0 -338
- package/src/account/index.ts +0 -24
- package/src/account/rpc.ts +0 -185
- package/src/account/types.ts +0 -108
- package/src/auth/bounded-ttl-cache.ts +0 -53
- package/src/auth/client.ts +0 -46
- package/src/auth/cline.ts +0 -724
- package/src/auth/codex.ts +0 -491
- package/src/auth/oca.ts +0 -588
- package/src/auth/server.ts +0 -265
- package/src/auth/types.ts +0 -110
- package/src/auth/utils.ts +0 -247
- package/src/cron/cron-event-ingress.ts +0 -357
- package/src/cron/cron-materializer.ts +0 -97
- package/src/cron/cron-reconciler.ts +0 -241
- package/src/cron/cron-report-writer.ts +0 -153
- package/src/cron/cron-runner.ts +0 -495
- package/src/cron/cron-schema.ts +0 -127
- package/src/cron/cron-service.ts +0 -163
- package/src/cron/cron-spec-parser.ts +0 -489
- package/src/cron/cron-watcher.ts +0 -102
- package/src/cron/index.ts +0 -15
- package/src/cron/resource-limiter.ts +0 -46
- package/src/cron/schedule-command-service.ts +0 -193
- package/src/cron/schedule-service.ts +0 -703
- package/src/cron/scheduler.ts +0 -772
- package/src/cron/sqlite-cron-store.ts +0 -1286
- package/src/cron/sqlite-schedule-store.ts +0 -708
- package/src/extensions/config/agent-config-loader.ts +0 -114
- package/src/extensions/config/agent-config-parser.ts +0 -198
- package/src/extensions/config/hooks-config-loader.ts +0 -117
- package/src/extensions/config/index.ts +0 -77
- package/src/extensions/config/runtime-commands.ts +0 -82
- package/src/extensions/config/unified-config-file-watcher.ts +0 -496
- package/src/extensions/config/user-instruction-config-loader.ts +0 -549
- package/src/extensions/context/agentic-compaction.ts +0 -131
- package/src/extensions/context/basic-compaction.ts +0 -300
- package/src/extensions/context/compaction-shared.ts +0 -459
- package/src/extensions/context/compaction.ts +0 -226
- package/src/extensions/index.ts +0 -18
- package/src/extensions/mcp/client.ts +0 -420
- package/src/extensions/mcp/config-loader.ts +0 -219
- package/src/extensions/mcp/index.ts +0 -42
- package/src/extensions/mcp/manager.ts +0 -260
- package/src/extensions/mcp/name-transform.ts +0 -33
- package/src/extensions/mcp/policies.ts +0 -47
- package/src/extensions/mcp/tools.ts +0 -47
- package/src/extensions/mcp/types.ts +0 -116
- package/src/extensions/plugin/plugin-config-loader.ts +0 -140
- package/src/extensions/plugin/plugin-load-report.ts +0 -20
- package/src/extensions/plugin/plugin-loader.ts +0 -220
- package/src/extensions/plugin/plugin-module-import.ts +0 -276
- package/src/extensions/plugin/plugin-sandbox-bootstrap.ts +0 -662
- package/src/extensions/plugin/plugin-sandbox.ts +0 -586
- package/src/extensions/plugin/plugin-targeting.ts +0 -32
- package/src/extensions/tools/constants.ts +0 -37
- package/src/extensions/tools/definitions.ts +0 -738
- package/src/extensions/tools/executors/apply-patch-parser.ts +0 -520
- package/src/extensions/tools/executors/apply-patch.ts +0 -348
- package/src/extensions/tools/executors/bash.ts +0 -207
- package/src/extensions/tools/executors/editor.ts +0 -220
- package/src/extensions/tools/executors/file-read.ts +0 -135
- package/src/extensions/tools/executors/index.ts +0 -87
- package/src/extensions/tools/executors/search.ts +0 -470
- package/src/extensions/tools/executors/web-fetch.ts +0 -259
- package/src/extensions/tools/helpers.ts +0 -154
- package/src/extensions/tools/index.ts +0 -183
- package/src/extensions/tools/model-tool-routing.ts +0 -134
- package/src/extensions/tools/presets.ts +0 -190
- package/src/extensions/tools/runtime.ts +0 -261
- package/src/extensions/tools/schemas.ts +0 -343
- package/src/extensions/tools/team/delegated-agent.ts +0 -136
- package/src/extensions/tools/team/index.ts +0 -5
- package/src/extensions/tools/team/multi-agent.ts +0 -1845
- package/src/extensions/tools/team/projections.ts +0 -283
- package/src/extensions/tools/team/runtime.ts +0 -54
- package/src/extensions/tools/team/spawn-agent-tool.ts +0 -201
- package/src/extensions/tools/team/subagent-prompts.ts +0 -41
- package/src/extensions/tools/team/team-tools.ts +0 -902
- package/src/extensions/tools/types.ts +0 -354
- package/src/hooks/checkpoint-hooks.ts +0 -238
- package/src/hooks/hook-bridge.ts +0 -489
- package/src/hooks/hook-file-hooks.ts +0 -934
- package/src/hooks/hook-registry.ts +0 -257
- package/src/hooks/index.ts +0 -18
- package/src/hooks/subprocess-runner.ts +0 -196
- package/src/hooks/subprocess.ts +0 -469
- package/src/hub/browser-websocket.ts +0 -159
- package/src/hub/client.ts +0 -633
- package/src/hub/connect.ts +0 -156
- package/src/hub/daemon-entry.ts +0 -122
- package/src/hub/daemon.ts +0 -284
- package/src/hub/defaults.ts +0 -70
- package/src/hub/discovery.ts +0 -247
- package/src/hub/index.ts +0 -14
- package/src/hub/native-transport.ts +0 -31
- package/src/hub/runtime-handlers.ts +0 -141
- package/src/hub/server.ts +0 -2317
- package/src/hub/session-client.ts +0 -502
- package/src/hub/start-shared-server.ts +0 -61
- package/src/hub/transport.ts +0 -14
- package/src/hub/ui-client.ts +0 -126
- package/src/hub/workspace.ts +0 -19
- package/src/index.ts +0 -688
- package/src/llms/cline-recommended-models.ts +0 -167
- package/src/llms/configured-provider-registry.ts +0 -193
- package/src/llms/handler-factory.ts +0 -56
- package/src/llms/provider-defaults.ts +0 -653
- package/src/llms/provider-settings.ts +0 -310
- package/src/llms/runtime-config.ts +0 -43
- package/src/llms/runtime-registry.ts +0 -172
- package/src/llms/runtime-types.ts +0 -121
- package/src/runtime/agent-config-adapter.ts +0 -636
- package/src/runtime/agent-runtime-config-builder.ts +0 -205
- package/src/runtime/error-feedback.ts +0 -142
- package/src/runtime/history.ts +0 -374
- package/src/runtime/host.ts +0 -222
- package/src/runtime/index.ts +0 -23
- package/src/runtime/loop-detection.ts +0 -162
- package/src/runtime/mistake-tracker.ts +0 -221
- package/src/runtime/rules.ts +0 -49
- package/src/runtime/runtime-builder.ts +0 -814
- package/src/runtime/runtime-event-adapter.ts +0 -412
- package/src/runtime/runtime-host.ts +0 -250
- package/src/runtime/runtime-oauth-token-manager.ts +0 -268
- package/src/runtime/session-runtime-orchestrator.ts +0 -1253
- package/src/runtime/session-runtime.ts +0 -69
- package/src/runtime/subprocess-sandbox.ts +0 -255
- package/src/runtime/tool-approval.ts +0 -102
- package/src/runtime/user-input-builder.ts +0 -167
- package/src/services/agent-events.ts +0 -256
- package/src/services/config.ts +0 -5
- package/src/services/global-settings.ts +0 -122
- package/src/services/local-runtime-bootstrap.ts +0 -424
- package/src/services/plugin-tools.ts +0 -86
- package/src/services/providers/local-provider-registry.ts +0 -456
- package/src/services/providers/local-provider-service.ts +0 -772
- package/src/services/session-artifacts.ts +0 -138
- package/src/services/session-data.ts +0 -398
- package/src/services/session-telemetry.ts +0 -89
- package/src/services/storage/artifact-store.ts +0 -1
- package/src/services/storage/file-team-store.ts +0 -250
- package/src/services/storage/index.ts +0 -11
- package/src/services/storage/provider-settings-legacy-migration.ts +0 -789
- package/src/services/storage/provider-settings-manager.ts +0 -167
- package/src/services/storage/session-store.ts +0 -1
- package/src/services/storage/sqlite-session-store.ts +0 -270
- package/src/services/storage/sqlite-team-store.ts +0 -537
- package/src/services/storage/team-store.ts +0 -36
- package/src/services/telemetry/ITelemetryAdapter.ts +0 -94
- package/src/services/telemetry/OpenTelemetryAdapter.ts +0 -348
- package/src/services/telemetry/OpenTelemetryProvider.ts +0 -415
- package/src/services/telemetry/TelemetryLoggerSink.ts +0 -121
- package/src/services/telemetry/TelemetryService.ts +0 -139
- package/src/services/telemetry/core-events.ts +0 -400
- package/src/services/telemetry/distinct-id.ts +0 -58
- package/src/services/telemetry/index.ts +0 -20
- package/src/services/usage.ts +0 -32
- package/src/services/workspace/file-indexer.ts +0 -351
- package/src/services/workspace/index.ts +0 -7
- package/src/services/workspace/mention-enricher.ts +0 -122
- package/src/services/workspace-manifest.ts +0 -72
- package/src/session/conversation-store.ts +0 -77
- package/src/session/file-session-service.ts +0 -282
- package/src/session/index.ts +0 -32
- package/src/session/message-builder.ts +0 -941
- package/src/session/persistence-service.ts +0 -559
- package/src/session/session-graph.ts +0 -92
- package/src/session/session-manifest-store.ts +0 -158
- package/src/session/session-manifest.ts +0 -29
- package/src/session/session-row.ts +0 -199
- package/src/session/session-service.ts +0 -324
- package/src/session/session-team-coordination.ts +0 -240
- package/src/session/subagent-session-manager.ts +0 -397
- package/src/session/team-persistence-store.ts +0 -176
- package/src/session/workspace-manager.ts +0 -100
- package/src/transports/hub.ts +0 -1081
- package/src/transports/local.ts +0 -1826
- package/src/transports/remote.ts +0 -27
- package/src/transports/runtime-host-support.ts +0 -140
- package/src/types/chat-schema.ts +0 -81
- package/src/types/common.ts +0 -26
- package/src/types/config.ts +0 -220
- package/src/types/events.ts +0 -80
- package/src/types/index.ts +0 -26
- package/src/types/provider-settings.ts +0 -54
- package/src/types/session.ts +0 -111
- package/src/types/sessions.ts +0 -37
- package/src/types/storage.ts +0 -56
- package/src/types.ts +0 -167
- package/src/version.ts +0 -3
|
@@ -1,537 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
safeJsonParse,
|
|
5
|
-
type TeamRuntimeState,
|
|
6
|
-
type TeamTeammateSpec,
|
|
7
|
-
} from "@clinebot/shared";
|
|
8
|
-
import { loadSqliteDb, nowIso, type SqliteDb } from "@clinebot/shared/db";
|
|
9
|
-
import { resolveDbDataDir } from "@clinebot/shared/storage";
|
|
10
|
-
import type { TeamEvent } from "../../extensions/tools/team";
|
|
11
|
-
import type { TeamStore } from "../../types/storage";
|
|
12
|
-
|
|
13
|
-
function defaultTeamDir(): string {
|
|
14
|
-
return resolveDbDataDir();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function sanitizeTeamName(name: string): string {
|
|
18
|
-
return name
|
|
19
|
-
.toLowerCase()
|
|
20
|
-
.replace(/[^a-z0-9._-]+/g, "-")
|
|
21
|
-
.replace(/^-+|-+$/g, "");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface SqliteTeamStoreOptions {
|
|
25
|
-
teamDir?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface TeamRuntimeLoadResult {
|
|
29
|
-
state?: TeamRuntimeState;
|
|
30
|
-
teammates: TeamTeammateSpec[];
|
|
31
|
-
interruptedRunIds: string[];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface TeamSnapshotRow {
|
|
35
|
-
team_name: string;
|
|
36
|
-
state_json: string;
|
|
37
|
-
teammates_json: string;
|
|
38
|
-
updated_at: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface TeamRunRow {
|
|
42
|
-
run_id: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function parseTeammatesJson(raw: string): TeamTeammateSpec[] {
|
|
46
|
-
const parsed = safeJsonParse<unknown>(raw);
|
|
47
|
-
if (!Array.isArray(parsed)) {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
const out: TeamTeammateSpec[] = [];
|
|
51
|
-
for (const entry of parsed) {
|
|
52
|
-
if (!entry || typeof entry !== "object") {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const rec = entry as Record<string, unknown>;
|
|
56
|
-
const agentId = rec.agentId;
|
|
57
|
-
const rolePrompt = rec.rolePrompt;
|
|
58
|
-
if (typeof agentId !== "string" || !agentId.trim()) {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
if (typeof rolePrompt !== "string" || !rolePrompt.trim()) {
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
const spec: TeamTeammateSpec = {
|
|
65
|
-
agentId: agentId.trim(),
|
|
66
|
-
rolePrompt,
|
|
67
|
-
};
|
|
68
|
-
if (typeof rec.modelId === "string" && rec.modelId.trim()) {
|
|
69
|
-
spec.modelId = rec.modelId.trim();
|
|
70
|
-
}
|
|
71
|
-
if (
|
|
72
|
-
typeof rec.maxIterations === "number" &&
|
|
73
|
-
Number.isFinite(rec.maxIterations)
|
|
74
|
-
) {
|
|
75
|
-
spec.maxIterations = Math.max(1, Math.floor(rec.maxIterations));
|
|
76
|
-
}
|
|
77
|
-
out.push(spec);
|
|
78
|
-
}
|
|
79
|
-
return out;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function reviveTeamRuntimeStateDates(
|
|
83
|
-
state: TeamRuntimeState,
|
|
84
|
-
): TeamRuntimeState {
|
|
85
|
-
return {
|
|
86
|
-
...state,
|
|
87
|
-
tasks: state.tasks.map((task) => ({
|
|
88
|
-
...task,
|
|
89
|
-
createdAt: new Date(task.createdAt),
|
|
90
|
-
updatedAt: new Date(task.updatedAt),
|
|
91
|
-
})),
|
|
92
|
-
mailbox: state.mailbox.map((message) => ({
|
|
93
|
-
...message,
|
|
94
|
-
sentAt: new Date(message.sentAt),
|
|
95
|
-
readAt: message.readAt ? new Date(message.readAt) : undefined,
|
|
96
|
-
})),
|
|
97
|
-
missionLog: state.missionLog.map((entry) => ({
|
|
98
|
-
...entry,
|
|
99
|
-
ts: new Date(entry.ts),
|
|
100
|
-
})),
|
|
101
|
-
runs: (state.runs ?? []).map((run) => ({
|
|
102
|
-
...run,
|
|
103
|
-
startedAt: new Date(run.startedAt),
|
|
104
|
-
endedAt: run.endedAt ? new Date(run.endedAt) : undefined,
|
|
105
|
-
nextAttemptAt: run.nextAttemptAt
|
|
106
|
-
? new Date(run.nextAttemptAt)
|
|
107
|
-
: undefined,
|
|
108
|
-
heartbeatAt: run.heartbeatAt ? new Date(run.heartbeatAt) : undefined,
|
|
109
|
-
})),
|
|
110
|
-
outcomes: (state.outcomes ?? []).map((outcome) => ({
|
|
111
|
-
...outcome,
|
|
112
|
-
createdAt: new Date(outcome.createdAt),
|
|
113
|
-
finalizedAt: outcome.finalizedAt
|
|
114
|
-
? new Date(outcome.finalizedAt)
|
|
115
|
-
: undefined,
|
|
116
|
-
})),
|
|
117
|
-
outcomeFragments: (state.outcomeFragments ?? []).map((fragment) => ({
|
|
118
|
-
...fragment,
|
|
119
|
-
createdAt: new Date(fragment.createdAt),
|
|
120
|
-
reviewedAt: fragment.reviewedAt
|
|
121
|
-
? new Date(fragment.reviewedAt)
|
|
122
|
-
: undefined,
|
|
123
|
-
})),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export class SqliteTeamStore implements TeamStore {
|
|
128
|
-
private readonly teamDirPath: string;
|
|
129
|
-
private db: SqliteDb | undefined;
|
|
130
|
-
|
|
131
|
-
constructor(options: SqliteTeamStoreOptions = {}) {
|
|
132
|
-
this.teamDirPath = options.teamDir ?? defaultTeamDir();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
init(): void {
|
|
136
|
-
this.getRawDb();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
private ensureTeamDir(): string {
|
|
140
|
-
if (!existsSync(this.teamDirPath)) {
|
|
141
|
-
mkdirSync(this.teamDirPath, { recursive: true });
|
|
142
|
-
}
|
|
143
|
-
return this.teamDirPath;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
private dbPath(): string {
|
|
147
|
-
return join(this.ensureTeamDir(), "teams.db");
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
private getRawDb(): SqliteDb {
|
|
151
|
-
if (this.db) {
|
|
152
|
-
return this.db;
|
|
153
|
-
}
|
|
154
|
-
const db = loadSqliteDb(this.dbPath());
|
|
155
|
-
this.ensureSchema(db);
|
|
156
|
-
this.db = db;
|
|
157
|
-
return db;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
private ensureSchema(db: SqliteDb): void {
|
|
161
|
-
db.exec("PRAGMA journal_mode = WAL;");
|
|
162
|
-
db.exec("PRAGMA busy_timeout = 5000;");
|
|
163
|
-
// Single-row table so ALTER-based upgrades can run in order (baseline = 1).
|
|
164
|
-
// Session/schedule schemas use separate migration paths in @clinebot/shared.
|
|
165
|
-
db.exec(`
|
|
166
|
-
CREATE TABLE IF NOT EXISTS team_store_schema_version (
|
|
167
|
-
lock INTEGER PRIMARY KEY CHECK (lock = 1),
|
|
168
|
-
version INTEGER NOT NULL
|
|
169
|
-
);
|
|
170
|
-
`);
|
|
171
|
-
const versionRow = db
|
|
172
|
-
.prepare("SELECT version FROM team_store_schema_version WHERE lock = 1")
|
|
173
|
-
.get() as { version: number } | null;
|
|
174
|
-
if (!versionRow) {
|
|
175
|
-
db.prepare(
|
|
176
|
-
"INSERT INTO team_store_schema_version (lock, version) VALUES (1, 1)",
|
|
177
|
-
).run();
|
|
178
|
-
}
|
|
179
|
-
db.exec(`
|
|
180
|
-
CREATE TABLE IF NOT EXISTS team_events (
|
|
181
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
182
|
-
team_name TEXT NOT NULL,
|
|
183
|
-
ts TEXT NOT NULL,
|
|
184
|
-
event_type TEXT NOT NULL,
|
|
185
|
-
payload_json TEXT NOT NULL,
|
|
186
|
-
causation_id TEXT,
|
|
187
|
-
correlation_id TEXT
|
|
188
|
-
);
|
|
189
|
-
`);
|
|
190
|
-
db.exec(`
|
|
191
|
-
CREATE INDEX IF NOT EXISTS idx_team_events_name_ts
|
|
192
|
-
ON team_events(team_name, ts DESC);
|
|
193
|
-
`);
|
|
194
|
-
db.exec(`
|
|
195
|
-
CREATE TABLE IF NOT EXISTS team_runtime_snapshot (
|
|
196
|
-
team_name TEXT PRIMARY KEY,
|
|
197
|
-
state_json TEXT NOT NULL,
|
|
198
|
-
teammates_json TEXT NOT NULL,
|
|
199
|
-
updated_at TEXT NOT NULL
|
|
200
|
-
);
|
|
201
|
-
`);
|
|
202
|
-
db.exec(`
|
|
203
|
-
CREATE TABLE IF NOT EXISTS team_tasks (
|
|
204
|
-
team_name TEXT NOT NULL,
|
|
205
|
-
task_id TEXT NOT NULL,
|
|
206
|
-
title TEXT NOT NULL,
|
|
207
|
-
description TEXT NOT NULL,
|
|
208
|
-
status TEXT NOT NULL,
|
|
209
|
-
assignee TEXT,
|
|
210
|
-
depends_on_json TEXT NOT NULL,
|
|
211
|
-
summary TEXT,
|
|
212
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
213
|
-
updated_at TEXT NOT NULL,
|
|
214
|
-
PRIMARY KEY(team_name, task_id)
|
|
215
|
-
);
|
|
216
|
-
`);
|
|
217
|
-
db.exec(`
|
|
218
|
-
CREATE TABLE IF NOT EXISTS team_runs (
|
|
219
|
-
team_name TEXT NOT NULL,
|
|
220
|
-
run_id TEXT NOT NULL,
|
|
221
|
-
agent_id TEXT NOT NULL,
|
|
222
|
-
task_id TEXT,
|
|
223
|
-
status TEXT NOT NULL,
|
|
224
|
-
message TEXT NOT NULL,
|
|
225
|
-
started_at TEXT,
|
|
226
|
-
ended_at TEXT,
|
|
227
|
-
error TEXT,
|
|
228
|
-
lease_owner TEXT,
|
|
229
|
-
heartbeat_at TEXT,
|
|
230
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
231
|
-
PRIMARY KEY(team_name, run_id)
|
|
232
|
-
);
|
|
233
|
-
`);
|
|
234
|
-
db.exec(`
|
|
235
|
-
CREATE INDEX IF NOT EXISTS idx_team_runs_status
|
|
236
|
-
ON team_runs(team_name, status);
|
|
237
|
-
`);
|
|
238
|
-
db.exec(`
|
|
239
|
-
CREATE TABLE IF NOT EXISTS team_outcomes (
|
|
240
|
-
team_name TEXT NOT NULL,
|
|
241
|
-
outcome_id TEXT NOT NULL,
|
|
242
|
-
title TEXT NOT NULL,
|
|
243
|
-
status TEXT NOT NULL,
|
|
244
|
-
schema_json TEXT NOT NULL,
|
|
245
|
-
finalized_at TEXT,
|
|
246
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
247
|
-
PRIMARY KEY(team_name, outcome_id)
|
|
248
|
-
);
|
|
249
|
-
`);
|
|
250
|
-
db.exec(`
|
|
251
|
-
CREATE TABLE IF NOT EXISTS team_outcome_fragments (
|
|
252
|
-
team_name TEXT NOT NULL,
|
|
253
|
-
outcome_id TEXT NOT NULL,
|
|
254
|
-
fragment_id TEXT NOT NULL,
|
|
255
|
-
section TEXT NOT NULL,
|
|
256
|
-
source_agent_id TEXT NOT NULL,
|
|
257
|
-
source_run_id TEXT,
|
|
258
|
-
content TEXT NOT NULL,
|
|
259
|
-
status TEXT NOT NULL,
|
|
260
|
-
reviewed_by TEXT,
|
|
261
|
-
reviewed_at TEXT,
|
|
262
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
263
|
-
PRIMARY KEY(team_name, fragment_id)
|
|
264
|
-
);
|
|
265
|
-
`);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
private run(sql: string, params: unknown[] = []): { changes?: number } {
|
|
269
|
-
return this.getRawDb()
|
|
270
|
-
.prepare(sql)
|
|
271
|
-
.run(...params);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
private queryOne<T>(sql: string, params: unknown[] = []): T | undefined {
|
|
275
|
-
const row = this.getRawDb()
|
|
276
|
-
.prepare(sql)
|
|
277
|
-
.get(...params);
|
|
278
|
-
return (row as T | null) ?? undefined;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
private queryAll<T>(sql: string, params: unknown[] = []): T[] {
|
|
282
|
-
return this.getRawDb()
|
|
283
|
-
.prepare(sql)
|
|
284
|
-
.all(...params) as T[];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/** Runs `work` in a single SQLite transaction (rollback on any error). */
|
|
288
|
-
private withTransaction(work: () => void): void {
|
|
289
|
-
const db = this.getRawDb();
|
|
290
|
-
db.exec("BEGIN IMMEDIATE;");
|
|
291
|
-
try {
|
|
292
|
-
work();
|
|
293
|
-
db.exec("COMMIT;");
|
|
294
|
-
} catch (error) {
|
|
295
|
-
try {
|
|
296
|
-
db.exec("ROLLBACK;");
|
|
297
|
-
} catch {
|
|
298
|
-
// ignore secondary failure
|
|
299
|
-
}
|
|
300
|
-
throw error;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
listTeamNames(): string[] {
|
|
305
|
-
return this.queryAll<{ team_name: string }>(
|
|
306
|
-
`SELECT team_name FROM team_runtime_snapshot ORDER BY team_name ASC`,
|
|
307
|
-
).map((row) => row.team_name);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
readState(teamName: string): TeamRuntimeState | undefined {
|
|
311
|
-
const row = this.queryOne<TeamSnapshotRow>(
|
|
312
|
-
`SELECT team_name, state_json, teammates_json, updated_at FROM team_runtime_snapshot WHERE team_name = ?`,
|
|
313
|
-
[sanitizeTeamName(teamName)],
|
|
314
|
-
);
|
|
315
|
-
if (!row) {
|
|
316
|
-
return undefined;
|
|
317
|
-
}
|
|
318
|
-
const parsed = safeJsonParse<TeamRuntimeState>(row.state_json);
|
|
319
|
-
if (!parsed) {
|
|
320
|
-
return undefined;
|
|
321
|
-
}
|
|
322
|
-
try {
|
|
323
|
-
return reviveTeamRuntimeStateDates(parsed);
|
|
324
|
-
} catch {
|
|
325
|
-
return undefined;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
readHistory(teamName: string, limit = 200): unknown[] {
|
|
330
|
-
return this.queryAll<{
|
|
331
|
-
event_type: string;
|
|
332
|
-
payload_json: string;
|
|
333
|
-
ts: string;
|
|
334
|
-
}>(
|
|
335
|
-
`SELECT event_type, payload_json, ts FROM team_events WHERE team_name = ? ORDER BY id DESC LIMIT ?`,
|
|
336
|
-
[sanitizeTeamName(teamName), limit],
|
|
337
|
-
).flatMap((row) => {
|
|
338
|
-
try {
|
|
339
|
-
return [
|
|
340
|
-
{
|
|
341
|
-
eventType: row.event_type,
|
|
342
|
-
payload: JSON.parse(row.payload_json),
|
|
343
|
-
ts: row.ts,
|
|
344
|
-
},
|
|
345
|
-
];
|
|
346
|
-
} catch {
|
|
347
|
-
return [];
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
loadRuntime(teamName: string): TeamRuntimeLoadResult {
|
|
353
|
-
const safeTeamName = sanitizeTeamName(teamName);
|
|
354
|
-
const state = this.readState(safeTeamName);
|
|
355
|
-
const snapshotRow = this.queryOne<TeamSnapshotRow>(
|
|
356
|
-
`SELECT team_name, state_json, teammates_json, updated_at FROM team_runtime_snapshot WHERE team_name = ?`,
|
|
357
|
-
[safeTeamName],
|
|
358
|
-
);
|
|
359
|
-
const teammates = snapshotRow
|
|
360
|
-
? parseTeammatesJson(snapshotRow.teammates_json)
|
|
361
|
-
: [];
|
|
362
|
-
return {
|
|
363
|
-
state,
|
|
364
|
-
teammates,
|
|
365
|
-
interruptedRunIds: [],
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
appendTeamEvent(
|
|
370
|
-
teamName: string,
|
|
371
|
-
eventType: string,
|
|
372
|
-
payload: unknown,
|
|
373
|
-
correlationId?: string,
|
|
374
|
-
): void {
|
|
375
|
-
this.run(
|
|
376
|
-
`INSERT INTO team_events (team_name, ts, event_type, payload_json, causation_id, correlation_id)
|
|
377
|
-
VALUES (?, ?, ?, ?, NULL, ?)`,
|
|
378
|
-
[
|
|
379
|
-
sanitizeTeamName(teamName),
|
|
380
|
-
nowIso(),
|
|
381
|
-
eventType,
|
|
382
|
-
JSON.stringify(payload),
|
|
383
|
-
correlationId ?? null,
|
|
384
|
-
],
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
persistRuntime(
|
|
389
|
-
teamName: string,
|
|
390
|
-
state: TeamRuntimeState,
|
|
391
|
-
teammates: TeamTeammateSpec[],
|
|
392
|
-
): void {
|
|
393
|
-
const safeTeamName = sanitizeTeamName(teamName);
|
|
394
|
-
const now = nowIso();
|
|
395
|
-
this.withTransaction(() => {
|
|
396
|
-
this.run(
|
|
397
|
-
`INSERT INTO team_runtime_snapshot (team_name, state_json, teammates_json, updated_at)
|
|
398
|
-
VALUES (?, ?, ?, ?)
|
|
399
|
-
ON CONFLICT(team_name) DO UPDATE SET
|
|
400
|
-
state_json = excluded.state_json,
|
|
401
|
-
teammates_json = excluded.teammates_json,
|
|
402
|
-
updated_at = excluded.updated_at`,
|
|
403
|
-
[safeTeamName, JSON.stringify(state), JSON.stringify(teammates), now],
|
|
404
|
-
);
|
|
405
|
-
|
|
406
|
-
for (const task of state.tasks) {
|
|
407
|
-
this.run(
|
|
408
|
-
`INSERT INTO team_tasks (team_name, task_id, title, description, status, assignee, depends_on_json, summary, version, updated_at)
|
|
409
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, 1, ?)
|
|
410
|
-
ON CONFLICT(team_name, task_id) DO UPDATE SET
|
|
411
|
-
title = excluded.title,
|
|
412
|
-
description = excluded.description,
|
|
413
|
-
status = excluded.status,
|
|
414
|
-
assignee = excluded.assignee,
|
|
415
|
-
depends_on_json = excluded.depends_on_json,
|
|
416
|
-
summary = excluded.summary,
|
|
417
|
-
version = team_tasks.version + 1,
|
|
418
|
-
updated_at = excluded.updated_at`,
|
|
419
|
-
[
|
|
420
|
-
safeTeamName,
|
|
421
|
-
task.id,
|
|
422
|
-
task.title,
|
|
423
|
-
task.description,
|
|
424
|
-
task.status,
|
|
425
|
-
task.assignee ?? null,
|
|
426
|
-
JSON.stringify(task.dependsOn ?? []),
|
|
427
|
-
task.summary ?? null,
|
|
428
|
-
task.updatedAt.toISOString(),
|
|
429
|
-
],
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
for (const run of state.runs ?? []) {
|
|
434
|
-
this.run(
|
|
435
|
-
`INSERT INTO team_runs (team_name, run_id, agent_id, task_id, status, message, started_at, ended_at, error, lease_owner, heartbeat_at, version)
|
|
436
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)
|
|
437
|
-
ON CONFLICT(team_name, run_id) DO UPDATE SET
|
|
438
|
-
agent_id = excluded.agent_id,
|
|
439
|
-
task_id = excluded.task_id,
|
|
440
|
-
status = excluded.status,
|
|
441
|
-
message = excluded.message,
|
|
442
|
-
started_at = excluded.started_at,
|
|
443
|
-
ended_at = excluded.ended_at,
|
|
444
|
-
error = excluded.error,
|
|
445
|
-
lease_owner = excluded.lease_owner,
|
|
446
|
-
heartbeat_at = excluded.heartbeat_at,
|
|
447
|
-
version = team_runs.version + 1`,
|
|
448
|
-
[
|
|
449
|
-
safeTeamName,
|
|
450
|
-
run.id,
|
|
451
|
-
run.agentId,
|
|
452
|
-
run.taskId ?? null,
|
|
453
|
-
run.status,
|
|
454
|
-
run.message,
|
|
455
|
-
run.startedAt ? run.startedAt.toISOString() : null,
|
|
456
|
-
run.endedAt ? run.endedAt.toISOString() : null,
|
|
457
|
-
run.error ?? null,
|
|
458
|
-
run.leaseOwner ?? null,
|
|
459
|
-
run.heartbeatAt ? run.heartbeatAt.toISOString() : null,
|
|
460
|
-
],
|
|
461
|
-
);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
for (const outcome of state.outcomes ?? []) {
|
|
465
|
-
this.run(
|
|
466
|
-
`INSERT INTO team_outcomes (team_name, outcome_id, title, status, schema_json, finalized_at, version)
|
|
467
|
-
VALUES (?, ?, ?, ?, ?, ?, 1)
|
|
468
|
-
ON CONFLICT(team_name, outcome_id) DO UPDATE SET
|
|
469
|
-
title = excluded.title,
|
|
470
|
-
status = excluded.status,
|
|
471
|
-
schema_json = excluded.schema_json,
|
|
472
|
-
finalized_at = excluded.finalized_at,
|
|
473
|
-
version = team_outcomes.version + 1`,
|
|
474
|
-
[
|
|
475
|
-
safeTeamName,
|
|
476
|
-
outcome.id,
|
|
477
|
-
outcome.title,
|
|
478
|
-
outcome.status,
|
|
479
|
-
JSON.stringify({ requiredSections: outcome.requiredSections }),
|
|
480
|
-
outcome.finalizedAt ? outcome.finalizedAt.toISOString() : null,
|
|
481
|
-
],
|
|
482
|
-
);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
for (const fragment of state.outcomeFragments ?? []) {
|
|
486
|
-
this.run(
|
|
487
|
-
`INSERT INTO team_outcome_fragments (team_name, outcome_id, fragment_id, section, source_agent_id, source_run_id, content, status, reviewed_by, reviewed_at, version)
|
|
488
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)
|
|
489
|
-
ON CONFLICT(team_name, fragment_id) DO UPDATE SET
|
|
490
|
-
outcome_id = excluded.outcome_id,
|
|
491
|
-
section = excluded.section,
|
|
492
|
-
source_agent_id = excluded.source_agent_id,
|
|
493
|
-
source_run_id = excluded.source_run_id,
|
|
494
|
-
content = excluded.content,
|
|
495
|
-
status = excluded.status,
|
|
496
|
-
reviewed_by = excluded.reviewed_by,
|
|
497
|
-
reviewed_at = excluded.reviewed_at,
|
|
498
|
-
version = team_outcome_fragments.version + 1`,
|
|
499
|
-
[
|
|
500
|
-
safeTeamName,
|
|
501
|
-
fragment.outcomeId,
|
|
502
|
-
fragment.id,
|
|
503
|
-
fragment.section,
|
|
504
|
-
fragment.sourceAgentId,
|
|
505
|
-
fragment.sourceRunId ?? null,
|
|
506
|
-
fragment.content,
|
|
507
|
-
fragment.status,
|
|
508
|
-
fragment.reviewedBy ?? null,
|
|
509
|
-
fragment.reviewedAt ? fragment.reviewedAt.toISOString() : null,
|
|
510
|
-
],
|
|
511
|
-
);
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
markInProgressRunsInterrupted(teamName: string, reason: string): string[] {
|
|
517
|
-
const safeTeamName = sanitizeTeamName(teamName);
|
|
518
|
-
const rows = this.queryAll<TeamRunRow>(
|
|
519
|
-
`SELECT run_id FROM team_runs WHERE team_name = ? AND status IN ('queued', 'running')`,
|
|
520
|
-
[safeTeamName],
|
|
521
|
-
);
|
|
522
|
-
if (rows.length === 0) {
|
|
523
|
-
return [];
|
|
524
|
-
}
|
|
525
|
-
const now = nowIso();
|
|
526
|
-
this.run(
|
|
527
|
-
`UPDATE team_runs SET status = 'interrupted', error = ?, ended_at = ?, version = version + 1
|
|
528
|
-
WHERE team_name = ? AND status IN ('queued', 'running')`,
|
|
529
|
-
[reason, now, safeTeamName],
|
|
530
|
-
);
|
|
531
|
-
return rows.map((row) => row.run_id);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
handleTeamEvent(teamName: string, event: TeamEvent): void {
|
|
535
|
-
this.appendTeamEvent(teamName, event.type, event);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type { TeamStore } from "../../types/storage";
|
|
2
|
-
export {
|
|
3
|
-
FileTeamStore,
|
|
4
|
-
type FileTeamStoreOptions,
|
|
5
|
-
} from "./file-team-store";
|
|
6
|
-
export {
|
|
7
|
-
SqliteTeamStore,
|
|
8
|
-
type SqliteTeamStoreOptions,
|
|
9
|
-
} from "./sqlite-team-store";
|
|
10
|
-
|
|
11
|
-
import { FileTeamStore } from "./file-team-store";
|
|
12
|
-
import {
|
|
13
|
-
SqliteTeamStore,
|
|
14
|
-
type SqliteTeamStoreOptions,
|
|
15
|
-
} from "./sqlite-team-store";
|
|
16
|
-
|
|
17
|
-
export function createLocalTeamStore(options: SqliteTeamStoreOptions = {}): {
|
|
18
|
-
init(): void;
|
|
19
|
-
listTeamNames(): string[];
|
|
20
|
-
readState(teamName: string): ReturnType<FileTeamStore["readState"]>;
|
|
21
|
-
readHistory(teamName: string, limit?: number): unknown[];
|
|
22
|
-
loadRuntime(teamName: string): ReturnType<FileTeamStore["loadRuntime"]>;
|
|
23
|
-
handleTeamEvent: FileTeamStore["handleTeamEvent"];
|
|
24
|
-
persistRuntime: FileTeamStore["persistRuntime"];
|
|
25
|
-
markInProgressRunsInterrupted: FileTeamStore["markInProgressRunsInterrupted"];
|
|
26
|
-
} {
|
|
27
|
-
try {
|
|
28
|
-
const store = new SqliteTeamStore(options);
|
|
29
|
-
store.init();
|
|
30
|
-
return store;
|
|
31
|
-
} catch {
|
|
32
|
-
const store = new FileTeamStore({ teamDir: options.teamDir });
|
|
33
|
-
store.init();
|
|
34
|
-
return store;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Telemetry adapter interface for the @clinebot/core SDK.
|
|
3
|
-
*
|
|
4
|
-
* This is the SDK-side counterpart to the extension's ITelemetryProvider.
|
|
5
|
-
* It is intentionally free of VS Code / host-provider dependencies so that
|
|
6
|
-
* any consumer (CLI, tests, third-party integrations) can plug in their own
|
|
7
|
-
* backend without pulling in the full extension runtime.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { TelemetryProperties } from "@clinebot/shared";
|
|
11
|
-
|
|
12
|
-
export type {
|
|
13
|
-
TelemetryArray,
|
|
14
|
-
TelemetryMetadata,
|
|
15
|
-
TelemetryObject,
|
|
16
|
-
TelemetryPrimitive,
|
|
17
|
-
TelemetryProperties,
|
|
18
|
-
TelemetryValue,
|
|
19
|
-
} from "@clinebot/shared";
|
|
20
|
-
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
|
-
// Adapter interface
|
|
23
|
-
// ---------------------------------------------------------------------------
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Telemetry adapter that an SDK consumer implements (or uses via the
|
|
27
|
-
* provided {@link OpenTelemetryAdapter}) to receive Cline telemetry events.
|
|
28
|
-
*
|
|
29
|
-
* The interface intentionally mirrors ITelemetryProvider from the extension
|
|
30
|
-
* so that shared logic can be re-used or compared easily.
|
|
31
|
-
*/
|
|
32
|
-
export interface ITelemetryAdapter {
|
|
33
|
-
/** Human-readable adapter name used for logging / diagnostics. */
|
|
34
|
-
readonly name: string;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Emit a standard telemetry event.
|
|
38
|
-
* Implementations may silently drop events when telemetry is disabled.
|
|
39
|
-
*/
|
|
40
|
-
emit(event: string, properties?: TelemetryProperties): void;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Emit a *required* telemetry event that must not be suppressed by
|
|
44
|
-
* user opt-out settings (e.g. final opt-out confirmation events).
|
|
45
|
-
*/
|
|
46
|
-
emitRequired(event: string, properties?: TelemetryProperties): void;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Record a monotonically-increasing counter metric.
|
|
50
|
-
* Implementations that do not support metrics may treat this as a no-op.
|
|
51
|
-
*/
|
|
52
|
-
recordCounter(
|
|
53
|
-
name: string,
|
|
54
|
-
value: number,
|
|
55
|
-
attributes?: TelemetryProperties,
|
|
56
|
-
description?: string,
|
|
57
|
-
required?: boolean,
|
|
58
|
-
): void;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Record a histogram (distribution) metric.
|
|
62
|
-
* Implementations that do not support metrics may treat this as a no-op.
|
|
63
|
-
*/
|
|
64
|
-
recordHistogram(
|
|
65
|
-
name: string,
|
|
66
|
-
value: number,
|
|
67
|
-
attributes?: TelemetryProperties,
|
|
68
|
-
description?: string,
|
|
69
|
-
required?: boolean,
|
|
70
|
-
): void;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Record a gauge (point-in-time) metric.
|
|
74
|
-
* Pass `null` as `value` to retire the series identified by
|
|
75
|
-
* `name + attributes` and prevent stale gauge entries.
|
|
76
|
-
* Implementations that do not support metrics may treat this as a no-op.
|
|
77
|
-
*/
|
|
78
|
-
recordGauge(
|
|
79
|
-
name: string,
|
|
80
|
-
value: number | null,
|
|
81
|
-
attributes?: TelemetryProperties,
|
|
82
|
-
description?: string,
|
|
83
|
-
required?: boolean,
|
|
84
|
-
): void;
|
|
85
|
-
|
|
86
|
-
/** Returns whether the adapter is currently accepting events. */
|
|
87
|
-
isEnabled(): boolean;
|
|
88
|
-
|
|
89
|
-
/** Flush any buffered events/metrics to the backend. */
|
|
90
|
-
flush(): Promise<void>;
|
|
91
|
-
|
|
92
|
-
/** Release all resources held by the adapter. */
|
|
93
|
-
dispose(): Promise<void>;
|
|
94
|
-
}
|