@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,662 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bootstrap script for the plugin sandbox subprocess.
|
|
3
|
-
*
|
|
4
|
-
* This file runs inside an isolated Node.js child process spawned by
|
|
5
|
-
* {@link SubprocessSandbox}. It receives RPC calls over IPC and dynamically
|
|
6
|
-
* imports plugin modules, wiring up their contributions (tools, commands,
|
|
7
|
-
* message builders, providers) and lifecycle hooks.
|
|
8
|
-
*
|
|
9
|
-
* Because it executes in a separate process it must stay bundle-safe and only
|
|
10
|
-
* depend on local helpers that can be inlined into the sandbox build.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
type AutomationEventEnvelope,
|
|
15
|
-
normalizePluginManifest,
|
|
16
|
-
type PluginManifest,
|
|
17
|
-
} from "@clinebot/shared";
|
|
18
|
-
import { importPluginModule } from "./plugin-module-import";
|
|
19
|
-
import {
|
|
20
|
-
matchesPluginManifestTargeting,
|
|
21
|
-
type PluginTargeting,
|
|
22
|
-
} from "./plugin-targeting";
|
|
23
|
-
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
// Types (intentionally minimal – mirrors only what the RPC protocol needs)
|
|
26
|
-
// ---------------------------------------------------------------------------
|
|
27
|
-
|
|
28
|
-
interface PluginTool {
|
|
29
|
-
name: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
inputSchema?: unknown;
|
|
32
|
-
timeoutMs?: number;
|
|
33
|
-
retryable?: boolean;
|
|
34
|
-
execute: (input: unknown, context: unknown) => Promise<unknown>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface PluginCommand {
|
|
38
|
-
name: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
handler?: (input: string) => Promise<string>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface PluginMessageBuilder {
|
|
44
|
-
name: string;
|
|
45
|
-
build: (message: unknown[]) => unknown[]; // Message[]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface PluginProvider {
|
|
49
|
-
name: string;
|
|
50
|
-
description?: string;
|
|
51
|
-
metadata?: Record<string, unknown>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface PluginAutomationEventType {
|
|
55
|
-
eventType: string;
|
|
56
|
-
source: string;
|
|
57
|
-
description?: string;
|
|
58
|
-
attributesSchema?: Record<string, unknown>;
|
|
59
|
-
payloadSchema?: Record<string, unknown>;
|
|
60
|
-
examples?: AutomationEventEnvelope[];
|
|
61
|
-
metadata?: Record<string, unknown>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
interface PluginApi {
|
|
65
|
-
registerTool(tool: PluginTool): void;
|
|
66
|
-
registerCommand(command: PluginCommand): void;
|
|
67
|
-
registerMessageBuilder(builder: PluginMessageBuilder): void;
|
|
68
|
-
registerProvider(provider: PluginProvider): void;
|
|
69
|
-
registerAutomationEventType(eventType: PluginAutomationEventType): void;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
interface PluginSetupCtx {
|
|
73
|
-
session?: unknown;
|
|
74
|
-
client?: unknown;
|
|
75
|
-
user?: unknown;
|
|
76
|
-
workspaceInfo?: unknown;
|
|
77
|
-
automation?: {
|
|
78
|
-
ingestEvent(event: AutomationEventEnvelope): void | Promise<void>;
|
|
79
|
-
};
|
|
80
|
-
logger?: {
|
|
81
|
-
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
82
|
-
log(message: string, metadata?: Record<string, unknown>): void;
|
|
83
|
-
error(message: string, metadata?: Record<string, unknown>): void;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interface PluginModule {
|
|
88
|
-
name: string;
|
|
89
|
-
manifest: PluginManifest;
|
|
90
|
-
setup?: (api: PluginApi, ctx: PluginSetupCtx) => void | Promise<void>;
|
|
91
|
-
[hookName: string]: unknown;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
interface ContributionDescriptor {
|
|
95
|
-
id: string;
|
|
96
|
-
name: string;
|
|
97
|
-
description?: string;
|
|
98
|
-
inputSchema?: unknown;
|
|
99
|
-
timeoutMs?: number;
|
|
100
|
-
retryable?: boolean;
|
|
101
|
-
value?: string;
|
|
102
|
-
defaultValue?: boolean | string | number;
|
|
103
|
-
metadata?: Record<string, unknown>;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
interface AutomationEventTypeDescriptor {
|
|
107
|
-
id: string;
|
|
108
|
-
eventType: string;
|
|
109
|
-
source: string;
|
|
110
|
-
description?: string;
|
|
111
|
-
attributesSchema?: Record<string, unknown>;
|
|
112
|
-
payloadSchema?: Record<string, unknown>;
|
|
113
|
-
examples?: AutomationEventEnvelope[];
|
|
114
|
-
metadata?: Record<string, unknown>;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
interface PluginDescriptor {
|
|
118
|
-
pluginId: string;
|
|
119
|
-
pluginPath: string;
|
|
120
|
-
name: string;
|
|
121
|
-
manifest: PluginManifest;
|
|
122
|
-
contributions: {
|
|
123
|
-
tools: ContributionDescriptor[];
|
|
124
|
-
commands: ContributionDescriptor[];
|
|
125
|
-
messageBuilders: ContributionDescriptor[];
|
|
126
|
-
providers: ContributionDescriptor[];
|
|
127
|
-
automationEventTypes: AutomationEventTypeDescriptor[];
|
|
128
|
-
shortcuts?: ContributionDescriptor[];
|
|
129
|
-
flags?: ContributionDescriptor[];
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
interface PluginInitializationFailure {
|
|
134
|
-
pluginPath: string;
|
|
135
|
-
pluginName?: string;
|
|
136
|
-
phase: "load" | "setup";
|
|
137
|
-
message: string;
|
|
138
|
-
stack?: string;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
interface PluginInitializationWarning {
|
|
142
|
-
type: "duplicate_plugin_override";
|
|
143
|
-
pluginPath: string;
|
|
144
|
-
pluginName: string;
|
|
145
|
-
overriddenPluginPath: string;
|
|
146
|
-
message: string;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
interface InitializeResult {
|
|
150
|
-
plugins: PluginDescriptor[];
|
|
151
|
-
failures: PluginInitializationFailure[];
|
|
152
|
-
warnings: PluginInitializationWarning[];
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
interface PluginState {
|
|
156
|
-
plugin: PluginModule;
|
|
157
|
-
handlers: {
|
|
158
|
-
tools: Map<string, PluginTool["execute"]>;
|
|
159
|
-
commands: Map<string, NonNullable<PluginCommand["handler"]>>;
|
|
160
|
-
messageBuilders: Map<string, PluginMessageBuilder["build"]>;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function isObject(value: unknown): value is Record<string, unknown> {
|
|
165
|
-
return typeof value === "object" && value !== null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function hasValidStringArray(value: unknown): value is string[] {
|
|
169
|
-
return (
|
|
170
|
-
Array.isArray(value) && value.every((entry) => typeof entry === "string")
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function assertValidPluginModule(
|
|
175
|
-
plugin: unknown,
|
|
176
|
-
pluginPath: string,
|
|
177
|
-
): asserts plugin is PluginModule {
|
|
178
|
-
if (!isObject(plugin)) {
|
|
179
|
-
throw new Error(`Invalid plugin module: ${pluginPath}`);
|
|
180
|
-
}
|
|
181
|
-
if (typeof plugin.name !== "string" || !plugin.name) {
|
|
182
|
-
throw new Error(`Invalid plugin name: ${pluginPath}`);
|
|
183
|
-
}
|
|
184
|
-
if (!isObject(plugin.manifest)) {
|
|
185
|
-
throw new Error(`Invalid plugin manifest: ${pluginPath}`);
|
|
186
|
-
}
|
|
187
|
-
if (
|
|
188
|
-
Object.hasOwn(plugin.manifest, "providerIds") &&
|
|
189
|
-
!hasValidStringArray(plugin.manifest.providerIds)
|
|
190
|
-
) {
|
|
191
|
-
throw new Error(`Invalid plugin manifest.providerIds: ${pluginPath}`);
|
|
192
|
-
}
|
|
193
|
-
if (
|
|
194
|
-
Object.hasOwn(plugin.manifest, "modelIds") &&
|
|
195
|
-
!hasValidStringArray(plugin.manifest.modelIds)
|
|
196
|
-
) {
|
|
197
|
-
throw new Error(`Invalid plugin manifest.modelIds: ${pluginPath}`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function assertValidPluginSetupCtx(
|
|
202
|
-
ctx: unknown,
|
|
203
|
-
): asserts ctx is PluginSetupCtx {
|
|
204
|
-
if (!isObject(ctx)) {
|
|
205
|
-
throw new Error("Plugin setup context must be an object");
|
|
206
|
-
}
|
|
207
|
-
if (ctx.session !== undefined && !isObject(ctx.session)) {
|
|
208
|
-
throw new Error("Plugin setup context session must be an object");
|
|
209
|
-
}
|
|
210
|
-
if (ctx.client !== undefined && !isObject(ctx.client)) {
|
|
211
|
-
throw new Error("Plugin setup context client must be an object");
|
|
212
|
-
}
|
|
213
|
-
if (ctx.user !== undefined && !isObject(ctx.user)) {
|
|
214
|
-
throw new Error("Plugin setup context user must be an object");
|
|
215
|
-
}
|
|
216
|
-
if (ctx.workspaceInfo !== undefined && !isObject(ctx.workspaceInfo)) {
|
|
217
|
-
throw new Error("Plugin setup context workspaceInfo must be an object");
|
|
218
|
-
}
|
|
219
|
-
if (ctx.automation !== undefined && !isObject(ctx.automation)) {
|
|
220
|
-
throw new Error("Plugin setup context automation must be an object");
|
|
221
|
-
}
|
|
222
|
-
if (
|
|
223
|
-
ctx.automation !== undefined &&
|
|
224
|
-
typeof ctx.automation.ingestEvent !== "function"
|
|
225
|
-
) {
|
|
226
|
-
throw new Error(
|
|
227
|
-
"Plugin setup context automation.ingestEvent must be a function",
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
if (ctx.logger !== undefined && !isObject(ctx.logger)) {
|
|
231
|
-
throw new Error("Plugin setup context logger must be an object");
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// ---------------------------------------------------------------------------
|
|
236
|
-
// State
|
|
237
|
-
// ---------------------------------------------------------------------------
|
|
238
|
-
|
|
239
|
-
let pluginCounter = 0;
|
|
240
|
-
const pluginState = new Map<string, PluginState>();
|
|
241
|
-
const contributionCounters = new Map<string, number>();
|
|
242
|
-
|
|
243
|
-
// ---------------------------------------------------------------------------
|
|
244
|
-
// IPC helpers
|
|
245
|
-
// ---------------------------------------------------------------------------
|
|
246
|
-
|
|
247
|
-
function toErrorPayload(error: unknown): { message: string; stack?: string } {
|
|
248
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
249
|
-
const stack = error instanceof Error ? error.stack : undefined;
|
|
250
|
-
return { message, stack };
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function sendResponse(
|
|
254
|
-
id: string,
|
|
255
|
-
ok: boolean,
|
|
256
|
-
result: unknown,
|
|
257
|
-
error?: { message: string; stack?: string },
|
|
258
|
-
): void {
|
|
259
|
-
if (!process.send) return;
|
|
260
|
-
process.send({ type: "response", id, ok, result, error });
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function emitEvent(name: string, payload?: unknown): void {
|
|
264
|
-
if (!process.send) return;
|
|
265
|
-
process.send({ type: "event", name, payload });
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Expose event emitter to plugins.
|
|
269
|
-
(globalThis as Record<string, unknown>).__clinePluginHost = { emitEvent };
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Session workspace env — populated by `initialize()` and available to any
|
|
273
|
-
* plugin code that executes before the setup hook, or cannot use hook context.
|
|
274
|
-
* Prefer using PluginSetupCtx from the setup function when possible.
|
|
275
|
-
*/
|
|
276
|
-
(globalThis as Record<string, unknown>).__clineSessionEnv = {
|
|
277
|
-
cwd: undefined as string | undefined,
|
|
278
|
-
workspaceInfo: undefined as unknown,
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
// ---------------------------------------------------------------------------
|
|
282
|
-
// Helpers
|
|
283
|
-
// ---------------------------------------------------------------------------
|
|
284
|
-
|
|
285
|
-
function sanitizeObject(value: unknown): Record<string, unknown> {
|
|
286
|
-
if (!value || typeof value !== "object") return {};
|
|
287
|
-
return value as Record<string, unknown>;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function sanitizeLogMetadata(
|
|
291
|
-
value: unknown,
|
|
292
|
-
): Record<string, unknown> | undefined {
|
|
293
|
-
if (!value || typeof value !== "object") {
|
|
294
|
-
return undefined;
|
|
295
|
-
}
|
|
296
|
-
const metadata = { ...(value as Record<string, unknown>) };
|
|
297
|
-
if (metadata.error instanceof Error) {
|
|
298
|
-
metadata.error = {
|
|
299
|
-
name: metadata.error.name,
|
|
300
|
-
message: metadata.error.message,
|
|
301
|
-
stack: metadata.error.stack,
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
return metadata;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
function createPluginLogger(
|
|
308
|
-
pluginName: string,
|
|
309
|
-
): NonNullable<PluginSetupCtx["logger"]> {
|
|
310
|
-
const emitLog = (
|
|
311
|
-
level: "debug" | "log" | "error",
|
|
312
|
-
message: string,
|
|
313
|
-
metadata?: Record<string, unknown>,
|
|
314
|
-
) => {
|
|
315
|
-
emitEvent("plugin_log", {
|
|
316
|
-
level,
|
|
317
|
-
pluginName,
|
|
318
|
-
message,
|
|
319
|
-
metadata: sanitizeLogMetadata(metadata),
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
return {
|
|
323
|
-
debug: (message, metadata) => emitLog("debug", message, metadata),
|
|
324
|
-
log: (message, metadata) => emitLog("log", message, metadata),
|
|
325
|
-
error: (message, metadata) => emitLog("error", message, metadata),
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
function makeId(pluginId: string, prefix: string): string {
|
|
330
|
-
const key = `${pluginId}:${prefix}`;
|
|
331
|
-
const next = (contributionCounters.get(key) ?? 0) + 1;
|
|
332
|
-
contributionCounters.set(key, next);
|
|
333
|
-
return `${pluginId}_${prefix}_${next}`;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function normalizeAutomationEventType(
|
|
337
|
-
eventType: PluginAutomationEventType,
|
|
338
|
-
): PluginAutomationEventType {
|
|
339
|
-
const normalizedEventType =
|
|
340
|
-
typeof eventType.eventType === "string" ? eventType.eventType.trim() : "";
|
|
341
|
-
const source =
|
|
342
|
-
typeof eventType.source === "string" ? eventType.source.trim() : "";
|
|
343
|
-
if (!normalizedEventType) {
|
|
344
|
-
throw new Error("Automation event type contribution requires eventType");
|
|
345
|
-
}
|
|
346
|
-
if (!source) {
|
|
347
|
-
throw new Error("Automation event type contribution requires source");
|
|
348
|
-
}
|
|
349
|
-
return {
|
|
350
|
-
...eventType,
|
|
351
|
-
eventType: normalizedEventType,
|
|
352
|
-
source,
|
|
353
|
-
examples: eventType.examples ? [...eventType.examples] : undefined,
|
|
354
|
-
metadata: eventType.metadata
|
|
355
|
-
? sanitizeObject(eventType.metadata)
|
|
356
|
-
: undefined,
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
function getPlugin(pluginId: string): PluginState {
|
|
361
|
-
const state = pluginState.get(pluginId);
|
|
362
|
-
if (!state) {
|
|
363
|
-
throw new Error(`Unknown sandbox plugin id: ${pluginId}`);
|
|
364
|
-
}
|
|
365
|
-
return state;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// ---------------------------------------------------------------------------
|
|
369
|
-
// RPC methods
|
|
370
|
-
// ---------------------------------------------------------------------------
|
|
371
|
-
|
|
372
|
-
async function initialize(args: {
|
|
373
|
-
pluginPaths?: string[];
|
|
374
|
-
exportName?: string;
|
|
375
|
-
providerId?: string;
|
|
376
|
-
modelId?: string;
|
|
377
|
-
cwd?: string;
|
|
378
|
-
session?: unknown;
|
|
379
|
-
client?: unknown;
|
|
380
|
-
user?: unknown;
|
|
381
|
-
workspaceInfo?: unknown;
|
|
382
|
-
loggerEnabled?: boolean;
|
|
383
|
-
}): Promise<InitializeResult> {
|
|
384
|
-
pluginState.clear();
|
|
385
|
-
pluginCounter = 0;
|
|
386
|
-
contributionCounters.clear();
|
|
387
|
-
|
|
388
|
-
// Apply the session's working directory so that process.cwd() and relative
|
|
389
|
-
// path resolution inside plugins reflect the correct workspace, not the
|
|
390
|
-
// host process's cwd (which may differ when --cwd was used without calling
|
|
391
|
-
// process.chdir() on the host side).
|
|
392
|
-
if (args.cwd) {
|
|
393
|
-
try {
|
|
394
|
-
process.chdir(args.cwd);
|
|
395
|
-
} catch {
|
|
396
|
-
// Ignore — best-effort; path may not exist in unusual environments.
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// Keep the global escape-hatch in sync with the active session.
|
|
401
|
-
const sessionEnv = (globalThis as Record<string, unknown>)
|
|
402
|
-
.__clineSessionEnv as Record<string, unknown>;
|
|
403
|
-
if (sessionEnv) {
|
|
404
|
-
sessionEnv.cwd = args.cwd;
|
|
405
|
-
sessionEnv.workspaceInfo = args.workspaceInfo;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
const descriptors: PluginDescriptor[] = [];
|
|
409
|
-
const failures: PluginInitializationFailure[] = [];
|
|
410
|
-
const warnings: PluginInitializationWarning[] = [];
|
|
411
|
-
const exportName = args.exportName || "plugin";
|
|
412
|
-
const pluginIndexByName = new Map<string, number>();
|
|
413
|
-
const targeting: PluginTargeting = {
|
|
414
|
-
providerId: args.providerId,
|
|
415
|
-
modelId: args.modelId,
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
for (const pluginPath of args.pluginPaths || []) {
|
|
419
|
-
let plugin: PluginModule | undefined;
|
|
420
|
-
try {
|
|
421
|
-
const moduleExports = await importPluginModule(pluginPath);
|
|
422
|
-
plugin = (moduleExports.default ??
|
|
423
|
-
moduleExports[exportName]) as unknown as PluginModule;
|
|
424
|
-
assertValidPluginModule(plugin, pluginPath);
|
|
425
|
-
plugin.manifest = normalizePluginManifest(plugin.manifest);
|
|
426
|
-
if (!matchesPluginManifestTargeting(plugin.manifest, targeting)) {
|
|
427
|
-
continue;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
const pluginId = `plugin_${++pluginCounter}`;
|
|
431
|
-
const contributions: PluginDescriptor["contributions"] = {
|
|
432
|
-
tools: [],
|
|
433
|
-
commands: [],
|
|
434
|
-
messageBuilders: [],
|
|
435
|
-
providers: [],
|
|
436
|
-
automationEventTypes: [],
|
|
437
|
-
shortcuts: [],
|
|
438
|
-
flags: [],
|
|
439
|
-
};
|
|
440
|
-
const handlers: PluginState["handlers"] = {
|
|
441
|
-
tools: new Map(),
|
|
442
|
-
commands: new Map(),
|
|
443
|
-
messageBuilders: new Map(),
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
const api: PluginApi = {
|
|
447
|
-
registerTool: (tool) => {
|
|
448
|
-
const id = makeId(pluginId, "tool");
|
|
449
|
-
handlers.tools.set(id, tool.execute);
|
|
450
|
-
contributions.tools.push({
|
|
451
|
-
id,
|
|
452
|
-
name: tool.name,
|
|
453
|
-
description: tool.description,
|
|
454
|
-
inputSchema: tool.inputSchema,
|
|
455
|
-
timeoutMs: tool.timeoutMs,
|
|
456
|
-
retryable: tool.retryable,
|
|
457
|
-
});
|
|
458
|
-
},
|
|
459
|
-
registerCommand: (command) => {
|
|
460
|
-
const id = makeId(pluginId, "command");
|
|
461
|
-
if (typeof command.handler === "function") {
|
|
462
|
-
handlers.commands.set(id, command.handler);
|
|
463
|
-
}
|
|
464
|
-
contributions.commands.push({
|
|
465
|
-
id,
|
|
466
|
-
name: command.name,
|
|
467
|
-
description: command.description,
|
|
468
|
-
});
|
|
469
|
-
},
|
|
470
|
-
registerMessageBuilder: (builder) => {
|
|
471
|
-
const id = makeId(pluginId, "builder");
|
|
472
|
-
handlers.messageBuilders.set(id, builder.build);
|
|
473
|
-
contributions.messageBuilders.push({ id, name: builder.name });
|
|
474
|
-
},
|
|
475
|
-
registerProvider: (provider) => {
|
|
476
|
-
contributions.providers.push({
|
|
477
|
-
id: makeId(pluginId, "provider"),
|
|
478
|
-
name: provider.name,
|
|
479
|
-
description: provider.description,
|
|
480
|
-
metadata: sanitizeObject(provider.metadata),
|
|
481
|
-
});
|
|
482
|
-
},
|
|
483
|
-
registerAutomationEventType: (eventType) => {
|
|
484
|
-
contributions.automationEventTypes.push({
|
|
485
|
-
id: makeId(pluginId, "automation_event"),
|
|
486
|
-
...normalizeAutomationEventType(eventType),
|
|
487
|
-
});
|
|
488
|
-
},
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
if (typeof plugin.setup === "function") {
|
|
492
|
-
try {
|
|
493
|
-
const setupCtx = {
|
|
494
|
-
session: args.session,
|
|
495
|
-
client: args.client,
|
|
496
|
-
user: args.user,
|
|
497
|
-
workspaceInfo: args.workspaceInfo,
|
|
498
|
-
...(args.loggerEnabled
|
|
499
|
-
? { logger: createPluginLogger(plugin.name) }
|
|
500
|
-
: {}),
|
|
501
|
-
...(plugin.manifest.capabilities.includes("automationEvents")
|
|
502
|
-
? {
|
|
503
|
-
automation: {
|
|
504
|
-
ingestEvent: (event: AutomationEventEnvelope) => {
|
|
505
|
-
emitEvent("automation_event", event);
|
|
506
|
-
},
|
|
507
|
-
},
|
|
508
|
-
}
|
|
509
|
-
: {}),
|
|
510
|
-
};
|
|
511
|
-
assertValidPluginSetupCtx(setupCtx);
|
|
512
|
-
await plugin.setup(api, setupCtx);
|
|
513
|
-
} catch (error) {
|
|
514
|
-
failures.push({
|
|
515
|
-
pluginPath,
|
|
516
|
-
pluginName: plugin.name,
|
|
517
|
-
phase: "setup",
|
|
518
|
-
message: error instanceof Error ? error.message : String(error),
|
|
519
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
520
|
-
});
|
|
521
|
-
continue;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
const previousIndex = pluginIndexByName.get(plugin.name);
|
|
526
|
-
if (previousIndex !== undefined) {
|
|
527
|
-
const previous = descriptors[previousIndex];
|
|
528
|
-
if (!previous) {
|
|
529
|
-
pluginIndexByName.delete(plugin.name);
|
|
530
|
-
} else {
|
|
531
|
-
warnings.push({
|
|
532
|
-
type: "duplicate_plugin_override",
|
|
533
|
-
pluginName: plugin.name,
|
|
534
|
-
pluginPath,
|
|
535
|
-
overriddenPluginPath: previous.pluginPath,
|
|
536
|
-
message: `Plugin "${plugin.name}" from ${pluginPath} overrides ${previous.pluginPath}`,
|
|
537
|
-
});
|
|
538
|
-
pluginState.delete(previous.pluginId);
|
|
539
|
-
descriptors.splice(previousIndex, 1);
|
|
540
|
-
pluginIndexByName.clear();
|
|
541
|
-
for (const [index, descriptor] of descriptors.entries()) {
|
|
542
|
-
pluginIndexByName.set(descriptor.name, index);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
pluginState.set(pluginId, { plugin, handlers });
|
|
548
|
-
pluginIndexByName.set(plugin.name, descriptors.length);
|
|
549
|
-
descriptors.push({
|
|
550
|
-
pluginId,
|
|
551
|
-
pluginPath,
|
|
552
|
-
name: plugin.name,
|
|
553
|
-
manifest: plugin.manifest,
|
|
554
|
-
contributions,
|
|
555
|
-
});
|
|
556
|
-
} catch (error) {
|
|
557
|
-
failures.push({
|
|
558
|
-
pluginPath,
|
|
559
|
-
pluginName: plugin?.name,
|
|
560
|
-
phase: "load",
|
|
561
|
-
message: error instanceof Error ? error.message : String(error),
|
|
562
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
return { plugins: descriptors, failures, warnings };
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
async function invokeHook(args: {
|
|
571
|
-
pluginId: string;
|
|
572
|
-
hookName: string;
|
|
573
|
-
payload: unknown;
|
|
574
|
-
}): Promise<unknown> {
|
|
575
|
-
const state = getPlugin(args.pluginId);
|
|
576
|
-
const handler = state.plugin[args.hookName];
|
|
577
|
-
if (typeof handler !== "function") {
|
|
578
|
-
return undefined;
|
|
579
|
-
}
|
|
580
|
-
return await (handler as (payload: unknown) => Promise<unknown>)(
|
|
581
|
-
args.payload,
|
|
582
|
-
);
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
async function executeTool(args: {
|
|
586
|
-
pluginId: string;
|
|
587
|
-
contributionId: string;
|
|
588
|
-
input: unknown;
|
|
589
|
-
context: unknown;
|
|
590
|
-
}): Promise<unknown> {
|
|
591
|
-
const state = getPlugin(args.pluginId);
|
|
592
|
-
const handler = state.handlers.tools.get(args.contributionId);
|
|
593
|
-
if (typeof handler !== "function") {
|
|
594
|
-
throw new Error("Unknown sandbox tool contribution");
|
|
595
|
-
}
|
|
596
|
-
return await handler(args.input, args.context);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
async function executeCommand(args: {
|
|
600
|
-
pluginId: string;
|
|
601
|
-
contributionId: string;
|
|
602
|
-
input: string;
|
|
603
|
-
}): Promise<string> {
|
|
604
|
-
const state = getPlugin(args.pluginId);
|
|
605
|
-
const handler = state.handlers.commands.get(args.contributionId);
|
|
606
|
-
if (typeof handler !== "function") {
|
|
607
|
-
return "";
|
|
608
|
-
}
|
|
609
|
-
return await handler(args.input);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
async function buildMessages(args: {
|
|
613
|
-
pluginId: string;
|
|
614
|
-
contributionId: string;
|
|
615
|
-
messages: unknown[];
|
|
616
|
-
}): Promise<unknown[]> {
|
|
617
|
-
const state = getPlugin(args.pluginId);
|
|
618
|
-
const handler = state.handlers.messageBuilders.get(args.contributionId);
|
|
619
|
-
if (typeof handler !== "function") {
|
|
620
|
-
return [];
|
|
621
|
-
}
|
|
622
|
-
return await handler(args.messages);
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
// ---------------------------------------------------------------------------
|
|
626
|
-
// Message dispatch
|
|
627
|
-
// ---------------------------------------------------------------------------
|
|
628
|
-
|
|
629
|
-
const methods: Record<string, (args: never) => Promise<unknown>> = {
|
|
630
|
-
initialize,
|
|
631
|
-
invokeHook,
|
|
632
|
-
executeTool,
|
|
633
|
-
executeCommand,
|
|
634
|
-
buildMessages,
|
|
635
|
-
};
|
|
636
|
-
|
|
637
|
-
process.on(
|
|
638
|
-
"message",
|
|
639
|
-
async (message: {
|
|
640
|
-
type: string;
|
|
641
|
-
id: string;
|
|
642
|
-
method: string;
|
|
643
|
-
args?: unknown;
|
|
644
|
-
}) => {
|
|
645
|
-
if (!message || message.type !== "call") {
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
const method = methods[message.method];
|
|
649
|
-
if (!method) {
|
|
650
|
-
sendResponse(message.id, false, undefined, {
|
|
651
|
-
message: `Unknown method: ${String(message.method)}`,
|
|
652
|
-
});
|
|
653
|
-
return;
|
|
654
|
-
}
|
|
655
|
-
try {
|
|
656
|
-
const result = await method((message.args || {}) as never);
|
|
657
|
-
sendResponse(message.id, true, result);
|
|
658
|
-
} catch (error) {
|
|
659
|
-
sendResponse(message.id, false, undefined, toErrorPayload(error));
|
|
660
|
-
}
|
|
661
|
-
},
|
|
662
|
-
);
|