@clinebot/core 0.0.35 → 0.0.37
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 +1 -2
- package/dist/ClineCore.d.ts +362 -39
- package/dist/ClineCore.d.ts.map +1 -1
- package/dist/account/cline-account-service.d.ts.map +1 -1
- package/dist/account/index.d.ts +1 -1
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/rpc.d.ts +6 -6
- package/dist/account/rpc.d.ts.map +1 -1
- package/dist/cron/cron-event-ingress.d.ts +38 -0
- package/dist/cron/cron-event-ingress.d.ts.map +1 -0
- package/dist/cron/cron-materializer.d.ts +36 -0
- package/dist/cron/cron-materializer.d.ts.map +1 -0
- package/dist/cron/cron-reconciler.d.ts +62 -0
- package/dist/cron/cron-reconciler.d.ts.map +1 -0
- package/dist/cron/cron-report-writer.d.ts +41 -0
- package/dist/cron/cron-report-writer.d.ts.map +1 -0
- package/dist/cron/cron-runner.d.ts +43 -0
- package/dist/cron/cron-runner.d.ts.map +1 -0
- package/dist/cron/cron-schema.d.ts +3 -0
- package/dist/cron/cron-schema.d.ts.map +1 -0
- package/dist/cron/cron-service.d.ts +57 -0
- package/dist/cron/cron-service.d.ts.map +1 -0
- package/dist/cron/cron-spec-parser.d.ts +27 -0
- package/dist/cron/cron-spec-parser.d.ts.map +1 -0
- package/dist/cron/cron-watcher.d.ts +23 -0
- package/dist/cron/cron-watcher.d.ts.map +1 -0
- package/dist/cron/resource-limiter.d.ts +9 -0
- package/dist/cron/resource-limiter.d.ts.map +1 -0
- package/dist/cron/schedule-command-service.d.ts +10 -0
- package/dist/cron/schedule-command-service.d.ts.map +1 -0
- package/dist/cron/schedule-service.d.ts +100 -0
- package/dist/cron/schedule-service.d.ts.map +1 -0
- package/dist/cron/scheduler.d.ts +68 -0
- package/dist/cron/scheduler.d.ts.map +1 -0
- package/dist/cron/sqlite-cron-store.d.ts +230 -0
- package/dist/cron/sqlite-cron-store.d.ts.map +1 -0
- package/dist/cron/sqlite-schedule-store.d.ts +52 -0
- package/dist/cron/sqlite-schedule-store.d.ts.map +1 -0
- package/dist/extensions/config/agent-config-loader.d.ts +4 -3
- package/dist/extensions/config/agent-config-loader.d.ts.map +1 -1
- package/dist/extensions/config/runtime-commands.d.ts +1 -0
- package/dist/extensions/config/runtime-commands.d.ts.map +1 -1
- package/dist/extensions/config/user-instruction-config-loader.d.ts +1 -0
- package/dist/extensions/config/user-instruction-config-loader.d.ts.map +1 -1
- package/dist/extensions/context/agentic-compaction.d.ts +2 -2
- package/dist/extensions/context/agentic-compaction.d.ts.map +1 -1
- package/dist/extensions/context/compaction-shared.d.ts +5 -4
- package/dist/extensions/context/compaction-shared.d.ts.map +1 -1
- package/dist/extensions/context/compaction.d.ts.map +1 -1
- package/dist/extensions/plugin/plugin-config-loader.d.ts +15 -2
- package/dist/extensions/plugin/plugin-config-loader.d.ts.map +1 -1
- package/dist/extensions/plugin/plugin-loader.d.ts +13 -7
- package/dist/extensions/plugin/plugin-loader.d.ts.map +1 -1
- package/dist/extensions/plugin/plugin-module-import.d.ts.map +1 -1
- package/dist/extensions/plugin/plugin-sandbox.d.ts +21 -2
- package/dist/extensions/plugin/plugin-sandbox.d.ts.map +1 -1
- package/dist/extensions/plugin/plugin-targeting.d.ts +7 -0
- package/dist/extensions/plugin/plugin-targeting.d.ts.map +1 -0
- package/dist/extensions/plugin-sandbox-bootstrap.js +237 -276
- package/dist/extensions/tools/constants.d.ts +1 -0
- package/dist/extensions/tools/constants.d.ts.map +1 -1
- package/dist/extensions/tools/definitions.d.ts +3 -4
- package/dist/extensions/tools/definitions.d.ts.map +1 -1
- package/dist/extensions/tools/executors/apply-patch.d.ts +3 -1
- package/dist/extensions/tools/executors/apply-patch.d.ts.map +1 -1
- package/dist/extensions/tools/executors/editor.d.ts.map +1 -1
- package/dist/extensions/tools/executors/search.d.ts +1 -1
- package/dist/extensions/tools/executors/search.d.ts.map +1 -1
- package/dist/extensions/tools/helpers.d.ts +1 -0
- package/dist/extensions/tools/helpers.d.ts.map +1 -1
- package/dist/extensions/tools/index.d.ts +3 -2
- package/dist/extensions/tools/index.d.ts.map +1 -1
- package/dist/extensions/tools/presets.d.ts +27 -44
- package/dist/extensions/tools/presets.d.ts.map +1 -1
- package/dist/extensions/tools/runtime.d.ts +25 -0
- package/dist/extensions/tools/runtime.d.ts.map +1 -0
- package/dist/extensions/tools/schemas.d.ts +25 -3
- package/dist/extensions/tools/schemas.d.ts.map +1 -1
- package/dist/extensions/tools/team/delegated-agent.d.ts +2 -2
- package/dist/extensions/tools/team/delegated-agent.d.ts.map +1 -1
- package/dist/extensions/tools/team/multi-agent.d.ts +7 -3
- package/dist/extensions/tools/team/multi-agent.d.ts.map +1 -1
- package/dist/extensions/tools/team/team-tools.d.ts +1 -0
- package/dist/extensions/tools/team/team-tools.d.ts.map +1 -1
- package/dist/extensions/tools/types.d.ts +0 -5
- package/dist/extensions/tools/types.d.ts.map +1 -1
- package/dist/hooks/hook-bridge.d.ts +118 -0
- package/dist/hooks/hook-bridge.d.ts.map +1 -0
- package/dist/hooks/hook-file-hooks.d.ts +6 -2
- package/dist/hooks/hook-file-hooks.d.ts.map +1 -1
- package/dist/hooks/hook-registry.d.ts +16 -0
- package/dist/hooks/hook-registry.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/subprocess.d.ts +8 -1
- package/dist/hooks/subprocess.d.ts.map +1 -1
- package/dist/hub/browser-websocket.d.ts +18 -0
- package/dist/hub/browser-websocket.d.ts.map +1 -0
- package/dist/hub/client.d.ts +51 -0
- package/dist/hub/client.d.ts.map +1 -0
- package/dist/hub/connect.d.ts +15 -0
- package/dist/hub/connect.d.ts.map +1 -0
- package/dist/hub/daemon-entry.d.ts +2 -0
- package/dist/hub/daemon-entry.d.ts.map +1 -0
- package/dist/hub/daemon-entry.js +1305 -0
- package/dist/hub/daemon.d.ts +5 -0
- package/dist/hub/daemon.d.ts.map +1 -0
- package/dist/hub/defaults.d.ts +17 -0
- package/dist/hub/defaults.d.ts.map +1 -0
- package/dist/hub/discovery.d.ts +29 -0
- package/dist/hub/discovery.d.ts.map +1 -0
- package/dist/hub/index.d.ts +15 -0
- package/dist/hub/index.d.ts.map +1 -0
- package/dist/hub/index.js +1294 -0
- package/dist/hub/native-transport.d.ts +17 -0
- package/dist/hub/native-transport.d.ts.map +1 -0
- package/dist/hub/runtime-handlers.d.ts +11 -0
- package/dist/hub/runtime-handlers.d.ts.map +1 -0
- package/dist/hub/server.d.ts +104 -0
- package/dist/hub/server.d.ts.map +1 -0
- package/dist/hub/session-client.d.ts +90 -0
- package/dist/hub/session-client.d.ts.map +1 -0
- package/dist/hub/start-shared-server.d.ts +19 -0
- package/dist/hub/start-shared-server.d.ts.map +1 -0
- package/dist/hub/transport.d.ts +8 -0
- package/dist/hub/transport.d.ts.map +1 -0
- package/dist/hub/ui-client.d.ts +45 -0
- package/dist/hub/ui-client.d.ts.map +1 -0
- package/dist/hub/workspace.d.ts +4 -0
- package/dist/hub/workspace.d.ts.map +1 -0
- package/dist/index.d.ts +29 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +782 -471
- package/dist/llms/cline-recommended-models.d.ts +20 -0
- package/dist/llms/cline-recommended-models.d.ts.map +1 -0
- package/dist/llms/configured-provider-registry.d.ts +28 -0
- package/dist/llms/configured-provider-registry.d.ts.map +1 -0
- package/dist/llms/handler-factory.d.ts +16 -0
- package/dist/llms/handler-factory.d.ts.map +1 -0
- package/dist/llms/provider-defaults.d.ts +27 -0
- package/dist/llms/provider-defaults.d.ts.map +1 -0
- package/dist/llms/provider-settings.d.ts +245 -0
- package/dist/llms/provider-settings.d.ts.map +1 -0
- package/dist/llms/runtime-config.d.ts +4 -0
- package/dist/llms/runtime-config.d.ts.map +1 -0
- package/dist/llms/runtime-registry.d.ts +20 -0
- package/dist/llms/runtime-registry.d.ts.map +1 -0
- package/dist/llms/runtime-types.d.ts +85 -0
- package/dist/llms/runtime-types.d.ts.map +1 -0
- package/dist/runtime/agent-config-adapter.d.ts +148 -0
- package/dist/runtime/agent-config-adapter.d.ts.map +1 -0
- package/dist/runtime/agent-runtime-config-builder.d.ts +96 -0
- package/dist/runtime/agent-runtime-config-builder.d.ts.map +1 -0
- package/dist/runtime/history.d.ts +6 -0
- package/dist/runtime/history.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +1 -2
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/loop-detection.d.ts +59 -0
- package/dist/runtime/loop-detection.d.ts.map +1 -0
- package/dist/runtime/mistake-tracker.d.ts +69 -0
- package/dist/runtime/mistake-tracker.d.ts.map +1 -0
- package/dist/runtime/rules.d.ts +1 -0
- package/dist/runtime/rules.d.ts.map +1 -1
- package/dist/runtime/runtime-builder.d.ts.map +1 -1
- package/dist/runtime/runtime-event-adapter.d.ts +102 -0
- package/dist/runtime/runtime-event-adapter.d.ts.map +1 -0
- package/dist/runtime/runtime-host.d.ts +49 -26
- package/dist/runtime/runtime-host.d.ts.map +1 -1
- package/dist/runtime/runtime-oauth-token-manager.d.ts.map +1 -1
- package/dist/runtime/session-runtime-orchestrator.d.ts +261 -0
- package/dist/runtime/session-runtime-orchestrator.d.ts.map +1 -0
- package/dist/runtime/session-runtime.d.ts +16 -21
- package/dist/runtime/session-runtime.d.ts.map +1 -1
- package/dist/runtime/user-input-builder.d.ts +24 -0
- package/dist/runtime/user-input-builder.d.ts.map +1 -0
- package/dist/services/global-settings.d.ts +12 -0
- package/dist/services/global-settings.d.ts.map +1 -0
- package/dist/services/index.js +28 -0
- package/dist/services/local-runtime-bootstrap.d.ts +9 -3
- package/dist/services/local-runtime-bootstrap.d.ts.map +1 -1
- package/dist/services/plugin-tools.d.ts +16 -0
- package/dist/services/plugin-tools.d.ts.map +1 -0
- package/dist/services/providers/local-provider-registry.d.ts +199 -23
- package/dist/services/providers/local-provider-registry.d.ts.map +1 -1
- package/dist/services/providers/local-provider-service.d.ts +15 -13
- package/dist/services/providers/local-provider-service.d.ts.map +1 -1
- package/dist/services/session-data.d.ts +1 -1
- package/dist/services/session-data.d.ts.map +1 -1
- package/dist/services/session-telemetry.d.ts +7 -2
- package/dist/services/session-telemetry.d.ts.map +1 -1
- package/dist/services/storage/file-team-store.d.ts.map +1 -1
- package/dist/services/storage/provider-settings-legacy-migration.d.ts +1 -1
- package/dist/services/storage/provider-settings-legacy-migration.d.ts.map +1 -1
- package/dist/services/storage/provider-settings-manager.d.ts +1 -0
- package/dist/services/storage/provider-settings-manager.d.ts.map +1 -1
- package/dist/services/storage/sqlite-team-store.d.ts.map +1 -1
- package/dist/services/workspace-manifest.d.ts +11 -0
- package/dist/services/workspace-manifest.d.ts.map +1 -1
- package/dist/session/conversation-store.d.ts +30 -0
- package/dist/session/conversation-store.d.ts.map +1 -0
- package/dist/session/message-builder.d.ts +65 -0
- package/dist/session/message-builder.d.ts.map +1 -0
- package/dist/session/persistence-service.d.ts +11 -23
- package/dist/session/persistence-service.d.ts.map +1 -1
- package/dist/session/session-manifest-store.d.ts +22 -0
- package/dist/session/session-manifest-store.d.ts.map +1 -0
- package/dist/session/session-manifest.d.ts +1 -1
- package/dist/session/session-row.d.ts +93 -0
- package/dist/session/session-row.d.ts.map +1 -0
- package/dist/session/session-service.d.ts +2 -102
- package/dist/session/session-service.d.ts.map +1 -1
- package/dist/session/subagent-session-manager.d.ts +36 -0
- package/dist/session/subagent-session-manager.d.ts.map +1 -0
- package/dist/session/team-persistence-store.d.ts +24 -0
- package/dist/session/team-persistence-store.d.ts.map +1 -0
- package/dist/transports/hub.d.ts +58 -0
- package/dist/transports/hub.d.ts.map +1 -0
- package/dist/transports/local.d.ts +23 -9
- package/dist/transports/local.d.ts.map +1 -1
- package/dist/transports/remote.d.ts +10 -0
- package/dist/transports/remote.d.ts.map +1 -0
- package/dist/transports/runtime-host-support.d.ts +3 -2
- package/dist/transports/runtime-host-support.d.ts.map +1 -1
- package/dist/types/chat-schema.d.ts +15 -17
- package/dist/types/chat-schema.d.ts.map +1 -1
- package/dist/types/config.d.ts +17 -7
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/events.d.ts +7 -6
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/provider-settings.d.ts +4 -5
- package/dist/types/provider-settings.d.ts.map +1 -1
- package/dist/types/session.d.ts +7 -3
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types.d.ts +11 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +20 -6
- package/src/ClineCore.ts +757 -44
- package/src/account/cline-account-service.ts +44 -6
- package/src/account/index.ts +3 -3
- package/src/account/rpc.ts +12 -12
- package/src/cron/cron-event-ingress.ts +357 -0
- package/src/cron/cron-materializer.ts +97 -0
- package/src/cron/cron-reconciler.ts +241 -0
- package/src/cron/cron-report-writer.ts +153 -0
- package/src/cron/cron-runner.ts +495 -0
- package/src/cron/cron-schema.ts +127 -0
- package/src/cron/cron-service.ts +163 -0
- package/src/cron/cron-spec-parser.ts +489 -0
- package/src/cron/cron-watcher.ts +102 -0
- package/src/cron/index.ts +15 -0
- package/src/cron/resource-limiter.ts +46 -0
- package/src/cron/schedule-command-service.ts +193 -0
- package/src/cron/schedule-service.ts +703 -0
- package/src/cron/scheduler.ts +772 -0
- package/src/cron/sqlite-cron-store.ts +1286 -0
- package/src/cron/sqlite-schedule-store.ts +708 -0
- package/src/extensions/config/agent-config-loader.ts +17 -7
- package/src/extensions/config/runtime-commands.ts +6 -0
- package/src/extensions/config/user-instruction-config-loader.ts +1 -0
- package/src/extensions/context/agentic-compaction.ts +3 -3
- package/src/extensions/context/basic-compaction.ts +2 -2
- package/src/extensions/context/compaction-shared.ts +5 -4
- package/src/extensions/context/compaction.ts +3 -3
- package/src/extensions/plugin/plugin-config-loader.ts +37 -2
- package/src/extensions/plugin/plugin-loader.ts +69 -9
- package/src/extensions/plugin/plugin-module-import.ts +0 -2
- package/src/extensions/plugin/plugin-sandbox-bootstrap.ts +243 -39
- package/src/extensions/plugin/plugin-sandbox.ts +173 -29
- package/src/extensions/plugin/plugin-targeting.ts +32 -0
- package/src/extensions/tools/constants.ts +2 -0
- package/src/extensions/tools/definitions.ts +61 -71
- package/src/extensions/tools/executors/apply-patch.ts +69 -80
- package/src/extensions/tools/executors/editor.ts +4 -3
- package/src/extensions/tools/executors/search.ts +195 -3
- package/src/extensions/tools/helpers.ts +24 -0
- package/src/extensions/tools/index.ts +11 -2
- package/src/extensions/tools/presets.ts +32 -47
- package/src/extensions/tools/runtime.ts +261 -0
- package/src/extensions/tools/schemas.ts +17 -20
- package/src/extensions/tools/team/delegated-agent.ts +8 -3
- package/src/extensions/tools/team/multi-agent.ts +135 -19
- package/src/extensions/tools/team/team-tools.ts +172 -91
- package/src/extensions/tools/types.ts +0 -6
- package/src/hooks/hook-bridge.ts +489 -0
- package/src/hooks/hook-file-hooks.ts +66 -5
- package/src/hooks/hook-registry.ts +257 -0
- package/src/hooks/index.ts +0 -7
- package/src/hooks/subprocess-runner.ts +1 -1
- package/src/hooks/subprocess.ts +9 -0
- package/src/hub/browser-websocket.ts +159 -0
- package/src/hub/client.ts +633 -0
- package/src/hub/connect.ts +156 -0
- package/src/hub/daemon-entry.ts +122 -0
- package/src/hub/daemon.ts +284 -0
- package/src/hub/defaults.ts +70 -0
- package/src/hub/discovery.ts +247 -0
- package/src/hub/index.ts +14 -0
- package/src/hub/native-transport.ts +31 -0
- package/src/hub/runtime-handlers.ts +141 -0
- package/src/hub/server.ts +2317 -0
- package/src/hub/session-client.ts +502 -0
- package/src/hub/start-shared-server.ts +61 -0
- package/src/hub/transport.ts +14 -0
- package/src/hub/ui-client.ts +126 -0
- package/src/hub/workspace.ts +19 -0
- package/src/index.ts +169 -68
- package/src/llms/cline-recommended-models.ts +167 -0
- package/src/llms/configured-provider-registry.ts +193 -0
- package/src/llms/handler-factory.ts +56 -0
- package/src/llms/provider-defaults.ts +653 -0
- package/src/llms/provider-settings.ts +310 -0
- package/src/llms/runtime-config.ts +43 -0
- package/src/llms/runtime-registry.ts +172 -0
- package/src/llms/runtime-types.ts +121 -0
- package/src/runtime/agent-config-adapter.ts +636 -0
- package/src/runtime/agent-runtime-config-builder.ts +205 -0
- package/src/runtime/error-feedback.ts +142 -0
- package/src/runtime/history.ts +137 -0
- package/src/runtime/host.ts +127 -267
- package/src/runtime/index.ts +1 -0
- package/src/runtime/loop-detection.ts +162 -0
- package/src/runtime/mistake-tracker.ts +221 -0
- package/src/runtime/rules.ts +12 -0
- package/src/runtime/runtime-builder.ts +85 -13
- package/src/runtime/runtime-event-adapter.ts +412 -0
- package/src/runtime/runtime-host.ts +134 -62
- package/src/runtime/runtime-oauth-token-manager.ts +11 -15
- package/src/runtime/session-runtime-orchestrator.ts +1253 -0
- package/src/runtime/session-runtime.ts +16 -26
- package/src/runtime/user-input-builder.ts +167 -0
- package/src/services/global-settings.ts +122 -0
- package/src/services/local-runtime-bootstrap.ts +175 -31
- package/src/services/plugin-tools.ts +86 -0
- package/src/services/providers/local-provider-registry.ts +277 -61
- package/src/services/providers/local-provider-service.ts +109 -44
- package/src/services/session-data.ts +18 -10
- package/src/services/session-telemetry.ts +6 -15
- package/src/services/storage/file-team-store.ts +1 -5
- package/src/services/storage/provider-settings-legacy-migration.ts +14 -51
- package/src/services/storage/provider-settings-manager.ts +17 -2
- package/src/services/storage/sqlite-team-store.ts +1 -5
- package/src/services/workspace-manifest.ts +18 -0
- package/src/session/conversation-store.ts +77 -0
- package/src/session/file-session-service.ts +1 -1
- package/src/session/index.ts +6 -27
- package/src/session/message-builder.ts +941 -0
- package/src/session/persistence-service.ts +119 -504
- package/src/session/session-manifest-store.ts +158 -0
- package/src/session/session-row.ts +199 -0
- package/src/session/session-service.ts +17 -376
- package/src/session/session-team-coordination.ts +1 -1
- package/src/session/subagent-session-manager.ts +397 -0
- package/src/session/team-persistence-store.ts +176 -0
- package/src/transports/hub.ts +1081 -0
- package/src/transports/local.ts +419 -93
- package/src/transports/remote.ts +27 -0
- package/src/transports/runtime-host-support.ts +63 -9
- package/src/types/chat-schema.ts +4 -5
- package/src/types/config.ts +17 -7
- package/src/types/events.ts +8 -6
- package/src/types/index.ts +3 -0
- package/src/types/provider-settings.ts +18 -7
- package/src/types/session.ts +7 -6
- package/src/types.ts +42 -2
- package/dist/hooks/persistent.d.ts +0 -64
- package/dist/hooks/persistent.d.ts.map +0 -1
- package/dist/runtime/rpc-runtime-ensure.d.ts +0 -65
- package/dist/runtime/rpc-runtime-ensure.d.ts.map +0 -1
- package/dist/runtime/rpc-spawn-lease.d.ts +0 -8
- package/dist/runtime/rpc-spawn-lease.d.ts.map +0 -1
- package/dist/services/telemetry/index.js +0 -15
- package/dist/session/rpc-session-service.d.ts +0 -16
- package/dist/session/rpc-session-service.d.ts.map +0 -1
- package/dist/session/sqlite-rpc-session-backend.d.ts +0 -31
- package/dist/session/sqlite-rpc-session-backend.d.ts.map +0 -1
- package/dist/transports/rpc.d.ts +0 -51
- package/dist/transports/rpc.d.ts.map +0 -1
- package/src/ClineCore.test.ts +0 -226
- package/src/account/cline-account-service.test.ts +0 -185
- package/src/account/featurebase-token.test.ts +0 -175
- package/src/account/rpc.test.ts +0 -63
- package/src/auth/bounded-ttl-cache.test.ts +0 -38
- package/src/auth/client.test.ts +0 -69
- package/src/auth/cline.test.ts +0 -267
- package/src/auth/codex.test.ts +0 -170
- package/src/auth/oca.test.ts +0 -340
- package/src/auth/server.test.ts +0 -287
- package/src/auth/utils.test.ts +0 -128
- package/src/extensions/config/agent-config-loader.test.ts +0 -236
- package/src/extensions/config/hooks-config-loader.test.ts +0 -20
- package/src/extensions/config/runtime-commands.test.ts +0 -115
- package/src/extensions/config/unified-config-file-watcher.test.ts +0 -196
- package/src/extensions/config/user-instruction-config-loader.test.ts +0 -246
- package/src/extensions/context/compaction.test.ts +0 -483
- package/src/extensions/mcp/config-loader.test.ts +0 -238
- package/src/extensions/mcp/manager.test.ts +0 -105
- package/src/extensions/plugin/plugin-config-loader.test.ts +0 -184
- package/src/extensions/plugin/plugin-loader.test.ts +0 -292
- package/src/extensions/plugin/plugin-sandbox.test.ts +0 -423
- package/src/extensions/tools/definitions.test.ts +0 -780
- package/src/extensions/tools/executors/bash.test.ts +0 -87
- package/src/extensions/tools/executors/editor.test.ts +0 -35
- package/src/extensions/tools/executors/file-read.test.ts +0 -125
- package/src/extensions/tools/model-tool-routing.test.ts +0 -86
- package/src/extensions/tools/presets.test.ts +0 -70
- package/src/extensions/tools/team/multi-agent.lifecycle.test.ts +0 -455
- package/src/extensions/tools/team/spawn-agent-tool.test.ts +0 -381
- package/src/extensions/tools/team/team-tools.test.ts +0 -918
- package/src/hooks/checkpoint-hooks.test.ts +0 -168
- package/src/hooks/hook-file-hooks.test.ts +0 -311
- package/src/hooks/persistent.ts +0 -661
- package/src/runtime/history.test.ts +0 -114
- package/src/runtime/host.test.ts +0 -230
- package/src/runtime/rpc-runtime-ensure.test.ts +0 -123
- package/src/runtime/rpc-runtime-ensure.ts +0 -659
- package/src/runtime/rpc-spawn-lease.test.ts +0 -81
- package/src/runtime/rpc-spawn-lease.ts +0 -156
- package/src/runtime/runtime-builder.team-persistence.test.ts +0 -245
- package/src/runtime/runtime-builder.test.ts +0 -615
- package/src/runtime/runtime-oauth-token-manager.test.ts +0 -137
- package/src/runtime/runtime-parity.test.ts +0 -143
- package/src/services/providers/local-provider-service.test.ts +0 -1062
- package/src/services/session-data.test.ts +0 -160
- package/src/services/storage/provider-settings-legacy-migration.test.ts +0 -424
- package/src/services/storage/provider-settings-manager.test.ts +0 -191
- package/src/services/telemetry/OpenTelemetryAdapter.test.ts +0 -157
- package/src/services/telemetry/OpenTelemetryProvider.test.ts +0 -326
- package/src/services/telemetry/TelemetryLoggerSink.test.ts +0 -42
- package/src/services/telemetry/TelemetryService.test.ts +0 -134
- package/src/services/telemetry/distinct-id.test.ts +0 -57
- package/src/services/workspace/file-indexer.d.ts +0 -11
- package/src/services/workspace/file-indexer.test.ts +0 -156
- package/src/services/workspace/mention-enricher.test.ts +0 -106
- package/src/session/persistence-service.test.ts +0 -300
- package/src/session/rpc-session-service.ts +0 -114
- package/src/session/session-service.team-persistence.test.ts +0 -48
- package/src/session/sqlite-rpc-session-backend.ts +0 -301
- package/src/transports/local.e2e.test.ts +0 -380
- package/src/transports/local.test.ts +0 -2559
- package/src/transports/rpc.test.ts +0 -82
- package/src/transports/rpc.ts +0 -665
|
@@ -43,12 +43,14 @@ export function resolveAgentsConfigDirPath(): string {
|
|
|
43
43
|
return resolveAgentsConfigDirPathFromShared();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function resolveAgentConfigSearchPaths(
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
export function resolveAgentConfigSearchPaths(
|
|
47
|
+
workspacePath?: string,
|
|
48
|
+
): string[] {
|
|
49
|
+
return resolveAgentConfigSearchPathsFromShared(workspacePath);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export interface CreateAgentConfigWatcherOptions {
|
|
53
|
+
workspacePath?: string;
|
|
52
54
|
directoryPathOrPaths?: string | ReadonlyArray<string>;
|
|
53
55
|
debounceMs?: number;
|
|
54
56
|
emitParseErrors?: boolean;
|
|
@@ -56,6 +58,7 @@ export interface CreateAgentConfigWatcherOptions {
|
|
|
56
58
|
|
|
57
59
|
function toDirectoryPaths(
|
|
58
60
|
directoryPathOrPaths?: string | ReadonlyArray<string>,
|
|
61
|
+
workspacePath?: string,
|
|
59
62
|
): string[] {
|
|
60
63
|
if (Array.isArray(directoryPathOrPaths)) {
|
|
61
64
|
return [...directoryPathOrPaths];
|
|
@@ -63,15 +66,16 @@ function toDirectoryPaths(
|
|
|
63
66
|
if (typeof directoryPathOrPaths === "string") {
|
|
64
67
|
return [directoryPathOrPaths];
|
|
65
68
|
}
|
|
66
|
-
return resolveAgentConfigSearchPaths();
|
|
69
|
+
return resolveAgentConfigSearchPaths(workspacePath);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
export function createAgentConfigDefinition(
|
|
70
73
|
directoryPathOrPaths?: string | ReadonlyArray<string>,
|
|
74
|
+
workspacePath?: string,
|
|
71
75
|
): UnifiedConfigDefinition<"agent", AgentYamlConfig> {
|
|
72
76
|
return {
|
|
73
77
|
type: "agent",
|
|
74
|
-
directories: toDirectoryPaths(directoryPathOrPaths),
|
|
78
|
+
directories: toDirectoryPaths(directoryPathOrPaths, workspacePath),
|
|
75
79
|
includeFile: (fileName) => isAgentConfigYamlFile(fileName),
|
|
76
80
|
parseFile: (context) => parseAgentConfigFromYaml(context.content),
|
|
77
81
|
resolveId: (config) => normalizeAgentConfigName(config.name),
|
|
@@ -82,7 +86,12 @@ export function createAgentConfigWatcher(
|
|
|
82
86
|
options?: CreateAgentConfigWatcherOptions,
|
|
83
87
|
): AgentConfigWatcher {
|
|
84
88
|
return new UnifiedConfigFileWatcher(
|
|
85
|
-
[
|
|
89
|
+
[
|
|
90
|
+
createAgentConfigDefinition(
|
|
91
|
+
options?.directoryPathOrPaths,
|
|
92
|
+
options?.workspacePath,
|
|
93
|
+
),
|
|
94
|
+
],
|
|
86
95
|
{
|
|
87
96
|
debounceMs: options?.debounceMs,
|
|
88
97
|
emitParseErrors: options?.emitParseErrors,
|
|
@@ -92,9 +101,10 @@ export function createAgentConfigWatcher(
|
|
|
92
101
|
|
|
93
102
|
export async function readAgentConfigsFromDisk(
|
|
94
103
|
directoryPathOrPaths?: string | ReadonlyArray<string>,
|
|
104
|
+
workspacePath?: string,
|
|
95
105
|
): Promise<Map<string, AgentYamlConfig>> {
|
|
96
106
|
const watcher = new UnifiedConfigFileWatcher([
|
|
97
|
-
createAgentConfigDefinition(directoryPathOrPaths),
|
|
107
|
+
createAgentConfigDefinition(directoryPathOrPaths, workspacePath),
|
|
98
108
|
]);
|
|
99
109
|
await watcher.refreshAll();
|
|
100
110
|
const snapshot = watcher.getSnapshot("agent");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { truncateSplit } from "@clinebot/shared";
|
|
1
2
|
import type {
|
|
2
3
|
SkillConfig,
|
|
3
4
|
UserInstructionConfigWatcher,
|
|
@@ -10,6 +11,7 @@ export type AvailableRuntimeCommand = {
|
|
|
10
11
|
id: string;
|
|
11
12
|
name: string;
|
|
12
13
|
instructions: string;
|
|
14
|
+
description?: string;
|
|
13
15
|
kind: RuntimeCommandKind;
|
|
14
16
|
};
|
|
15
17
|
|
|
@@ -32,6 +34,10 @@ function listCommandsForKind(
|
|
|
32
34
|
id,
|
|
33
35
|
name: record.item.name,
|
|
34
36
|
instructions: record.item.instructions,
|
|
37
|
+
description: truncateSplit(
|
|
38
|
+
record.item.description ?? record.item.instructions,
|
|
39
|
+
".",
|
|
40
|
+
),
|
|
35
41
|
kind,
|
|
36
42
|
}))
|
|
37
43
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type * as LlmsProviders from "@clinebot/llms";
|
|
2
1
|
import { createHandler } from "@clinebot/llms";
|
|
3
2
|
import type { BasicLogger } from "@clinebot/shared";
|
|
4
3
|
import type {
|
|
@@ -6,6 +5,7 @@ import type {
|
|
|
6
5
|
CoreCompactionResult,
|
|
7
6
|
CoreCompactionSummarizerConfig,
|
|
8
7
|
} from "../../types/config";
|
|
8
|
+
import type { ProviderConfig } from "../../types/provider-settings";
|
|
9
9
|
import {
|
|
10
10
|
buildSummaryMessage,
|
|
11
11
|
buildSummaryRequest,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./compaction-shared";
|
|
21
21
|
|
|
22
22
|
async function generateSummary(options: {
|
|
23
|
-
providerConfig:
|
|
23
|
+
providerConfig: ProviderConfig;
|
|
24
24
|
request: string;
|
|
25
25
|
logger?: BasicLogger;
|
|
26
26
|
}): Promise<string> {
|
|
@@ -48,7 +48,7 @@ async function generateSummary(options: {
|
|
|
48
48
|
|
|
49
49
|
export async function runAgenticCompaction(options: {
|
|
50
50
|
context: CoreCompactionContext;
|
|
51
|
-
providerConfig:
|
|
51
|
+
providerConfig: ProviderConfig;
|
|
52
52
|
summarizer?: CoreCompactionSummarizerConfig;
|
|
53
53
|
preserveRecentTokens: number;
|
|
54
54
|
estimateMessageTokens: EstimateMessageTokens;
|
|
@@ -33,9 +33,9 @@ function sanitizeMessageForBasic(
|
|
|
33
33
|
return text ? { ...message, content: text } : undefined;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
// Preserve
|
|
36
|
+
// Preserve multimodal structure: trim text blocks, keep non-text blocks intact.
|
|
37
37
|
const kept = message.content.filter(
|
|
38
|
-
(block) => block.type
|
|
38
|
+
(block) => block.type !== "text" || block.text.trim(),
|
|
39
39
|
);
|
|
40
40
|
if (kept.length === 0) {
|
|
41
41
|
return undefined;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { ToolResultContent } from "@clinebot/llms";
|
|
2
2
|
import type { MessageWithMetadata } from "@clinebot/shared";
|
|
3
3
|
import type {
|
|
4
4
|
CoreCompactionContext,
|
|
5
5
|
CoreCompactionSummarizerConfig,
|
|
6
6
|
} from "../../types/config";
|
|
7
|
+
import type { ProviderConfig } from "../../types/provider-settings";
|
|
7
8
|
|
|
8
9
|
export const DEFAULT_CONTEXT_WINDOW_TOKENS = 200_000;
|
|
9
10
|
export const DEFAULT_THRESHOLD_RATIO = 0.95;
|
|
@@ -41,7 +42,7 @@ export function truncateText(text: string, limit: number): string {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export function flattenToolResultContent(
|
|
44
|
-
content:
|
|
45
|
+
content: ToolResultContent["content"],
|
|
45
46
|
): string {
|
|
46
47
|
if (typeof content === "string") {
|
|
47
48
|
return truncateText(content, TOOL_RESULT_CHAR_LIMIT);
|
|
@@ -404,9 +405,9 @@ Edited: ${options.fileOps.modifiedFiles.join(", ") || "none"}`,
|
|
|
404
405
|
}
|
|
405
406
|
|
|
406
407
|
export function resolveSummarizerConfig(options: {
|
|
407
|
-
activeProviderConfig:
|
|
408
|
+
activeProviderConfig: ProviderConfig;
|
|
408
409
|
summarizer?: CoreCompactionSummarizerConfig;
|
|
409
|
-
}):
|
|
410
|
+
}): ProviderConfig {
|
|
410
411
|
const summarizer = options.summarizer;
|
|
411
412
|
if (!summarizer) {
|
|
412
413
|
return {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type * as LlmsProviders from "@clinebot/llms";
|
|
2
1
|
import type {
|
|
3
2
|
CoreCompactionConfig,
|
|
4
3
|
CoreCompactionContext,
|
|
@@ -6,6 +5,7 @@ import type {
|
|
|
6
5
|
CoreCompactionStrategy,
|
|
7
6
|
CoreSessionConfig,
|
|
8
7
|
} from "../../types/config";
|
|
8
|
+
import type { ProviderConfig } from "../../types/provider-settings";
|
|
9
9
|
import { runAgenticCompaction } from "./agentic-compaction";
|
|
10
10
|
import { runBasicCompaction } from "./basic-compaction";
|
|
11
11
|
import {
|
|
@@ -41,7 +41,7 @@ type EstimateMessageTokens = ReturnType<typeof createTokenEstimator>;
|
|
|
41
41
|
|
|
42
42
|
type BuiltinCompactionStrategyOptions = {
|
|
43
43
|
context: CoreCompactionContext;
|
|
44
|
-
providerConfig:
|
|
44
|
+
providerConfig: ProviderConfig;
|
|
45
45
|
compaction: CoreCompactionConfig | undefined;
|
|
46
46
|
estimateMessageTokens: EstimateMessageTokens;
|
|
47
47
|
logger: Pick<CoreSessionConfig, "logger">["logger"];
|
|
@@ -129,7 +129,7 @@ export function createContextCompactionPrepareTurn(
|
|
|
129
129
|
({
|
|
130
130
|
providerId: config.providerId,
|
|
131
131
|
modelId: config.modelId,
|
|
132
|
-
} as
|
|
132
|
+
} as ProviderConfig);
|
|
133
133
|
const estimateMessageTokens = createTokenEstimator();
|
|
134
134
|
const strategy = userCompaction?.strategy ?? "basic";
|
|
135
135
|
const runBuiltinStrategy = BUILTIN_COMPACTION_STRATEGIES[strategy];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
AgentConfig,
|
|
4
|
+
PluginSetupContext,
|
|
5
|
+
WorkspaceInfo,
|
|
6
|
+
} from "@clinebot/shared";
|
|
3
7
|
import {
|
|
4
8
|
discoverPluginModulePaths as discoverPluginModulePathsFromShared,
|
|
5
9
|
resolveConfiguredPluginModulePaths,
|
|
@@ -8,6 +12,7 @@ import {
|
|
|
8
12
|
import type { PluginLoadDiagnostics } from "./plugin-load-report";
|
|
9
13
|
import { loadAgentPluginsFromPathsWithDiagnostics } from "./plugin-loader";
|
|
10
14
|
import { loadSandboxedPlugins } from "./plugin-sandbox";
|
|
15
|
+
import type { PluginTargeting } from "./plugin-targeting";
|
|
11
16
|
|
|
12
17
|
type AgentPlugin = NonNullable<AgentConfig["extensions"]>[number];
|
|
13
18
|
|
|
@@ -54,13 +59,26 @@ export function resolveAgentPluginPaths(
|
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
export interface ResolveAndLoadAgentPluginsOptions
|
|
57
|
-
extends ResolveAgentPluginPathsOptions
|
|
62
|
+
extends ResolveAgentPluginPathsOptions,
|
|
63
|
+
PluginTargeting {
|
|
58
64
|
mode?: "sandbox" | "in_process";
|
|
59
65
|
exportName?: string;
|
|
60
66
|
importTimeoutMs?: number;
|
|
61
67
|
hookTimeoutMs?: number;
|
|
62
68
|
contributionTimeoutMs?: number;
|
|
63
69
|
onEvent?: (event: { name: string; payload?: unknown }) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Structured workspace and git metadata. Forwarded to sandboxed plugins
|
|
72
|
+
* via PluginSetupCtx.workspaceInfo and made available to in-process plugins
|
|
73
|
+
* in the extension context.
|
|
74
|
+
*/
|
|
75
|
+
workspaceInfo?: WorkspaceInfo;
|
|
76
|
+
session?: PluginSetupContext["session"];
|
|
77
|
+
client?: PluginSetupContext["client"];
|
|
78
|
+
user?: PluginSetupContext["user"];
|
|
79
|
+
automation?: PluginSetupContext["automation"];
|
|
80
|
+
logger?: PluginSetupContext["logger"];
|
|
81
|
+
telemetry?: PluginSetupContext["telemetry"];
|
|
64
82
|
}
|
|
65
83
|
|
|
66
84
|
export async function resolveAndLoadAgentPlugins(
|
|
@@ -80,6 +98,15 @@ export async function resolveAndLoadAgentPlugins(
|
|
|
80
98
|
const report = await loadAgentPluginsFromPathsWithDiagnostics(paths, {
|
|
81
99
|
cwd: options.cwd,
|
|
82
100
|
exportName: options.exportName,
|
|
101
|
+
providerId: options.providerId,
|
|
102
|
+
modelId: options.modelId,
|
|
103
|
+
session: options.session,
|
|
104
|
+
client: options.client,
|
|
105
|
+
user: options.user,
|
|
106
|
+
workspaceInfo: options.workspaceInfo,
|
|
107
|
+
automation: options.automation,
|
|
108
|
+
logger: options.logger,
|
|
109
|
+
telemetry: options.telemetry,
|
|
83
110
|
});
|
|
84
111
|
return {
|
|
85
112
|
extensions: report.plugins,
|
|
@@ -95,6 +122,14 @@ export async function resolveAndLoadAgentPlugins(
|
|
|
95
122
|
hookTimeoutMs: options.hookTimeoutMs,
|
|
96
123
|
contributionTimeoutMs: options.contributionTimeoutMs,
|
|
97
124
|
onEvent: options.onEvent,
|
|
125
|
+
providerId: options.providerId,
|
|
126
|
+
modelId: options.modelId,
|
|
127
|
+
cwd: options.cwd,
|
|
128
|
+
session: options.session,
|
|
129
|
+
client: options.client,
|
|
130
|
+
user: options.user,
|
|
131
|
+
workspaceInfo: options.workspaceInfo,
|
|
132
|
+
logger: options.logger,
|
|
98
133
|
});
|
|
99
134
|
return {
|
|
100
135
|
extensions: sandboxed.extensions ?? [],
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AgentExtension, PluginSetupContext } from "@clinebot/shared";
|
|
3
|
+
import { normalizePluginManifest } from "@clinebot/shared";
|
|
3
4
|
import type {
|
|
4
5
|
PluginInitializationFailure,
|
|
5
6
|
PluginInitializationWarning,
|
|
6
7
|
} from "./plugin-load-report";
|
|
7
8
|
import { importPluginModule } from "./plugin-module-import";
|
|
9
|
+
import {
|
|
10
|
+
matchesPluginManifestTargeting,
|
|
11
|
+
type PluginTargeting,
|
|
12
|
+
} from "./plugin-targeting";
|
|
8
13
|
|
|
9
|
-
type AgentPlugin = NonNullable<AgentConfig["extensions"]>[number];
|
|
10
14
|
type PluginLike = {
|
|
11
15
|
name: string;
|
|
12
16
|
manifest: {
|
|
13
17
|
capabilities: string[];
|
|
14
18
|
hookStages?: string[];
|
|
19
|
+
providerIds?: string[];
|
|
20
|
+
modelIds?: string[];
|
|
15
21
|
};
|
|
16
22
|
};
|
|
17
23
|
|
|
@@ -19,6 +25,13 @@ export interface LoadAgentPluginFromPathOptions {
|
|
|
19
25
|
exportName?: string;
|
|
20
26
|
cwd?: string;
|
|
21
27
|
useCache?: boolean;
|
|
28
|
+
session?: PluginSetupContext["session"];
|
|
29
|
+
client?: PluginSetupContext["client"];
|
|
30
|
+
user?: PluginSetupContext["user"];
|
|
31
|
+
workspaceInfo?: PluginSetupContext["workspaceInfo"];
|
|
32
|
+
automation?: PluginSetupContext["automation"];
|
|
33
|
+
logger?: PluginSetupContext["logger"];
|
|
34
|
+
telemetry?: PluginSetupContext["telemetry"];
|
|
22
35
|
}
|
|
23
36
|
|
|
24
37
|
function isObject(value: unknown): value is Record<string, unknown> {
|
|
@@ -58,6 +71,22 @@ function validatePluginManifest(
|
|
|
58
71
|
`Invalid plugin module at ${absolutePath}: manifest.hookStages must be a string array when provided`,
|
|
59
72
|
);
|
|
60
73
|
}
|
|
74
|
+
if (
|
|
75
|
+
Object.hasOwn(plugin.manifest, "providerIds") &&
|
|
76
|
+
!hasValidStringArray(plugin.manifest.providerIds)
|
|
77
|
+
) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
`Invalid plugin module at ${absolutePath}: manifest.providerIds must be a string array when provided`,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if (
|
|
83
|
+
Object.hasOwn(plugin.manifest, "modelIds") &&
|
|
84
|
+
!hasValidStringArray(plugin.manifest.modelIds)
|
|
85
|
+
) {
|
|
86
|
+
throw new Error(
|
|
87
|
+
`Invalid plugin module at ${absolutePath}: manifest.modelIds must be a string array when provided`,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
61
90
|
}
|
|
62
91
|
|
|
63
92
|
function validatePluginExport(
|
|
@@ -85,7 +114,7 @@ function validatePluginExport(
|
|
|
85
114
|
export async function loadAgentPluginFromPath(
|
|
86
115
|
pluginPath: string,
|
|
87
116
|
options: LoadAgentPluginFromPathOptions = {},
|
|
88
|
-
): Promise<
|
|
117
|
+
): Promise<AgentExtension> {
|
|
89
118
|
const absolutePath = resolve(options.cwd ?? process.cwd(), pluginPath);
|
|
90
119
|
const moduleExports = await importPluginModule(absolutePath, {
|
|
91
120
|
useCache: options.useCache,
|
|
@@ -95,13 +124,41 @@ export async function loadAgentPluginFromPath(
|
|
|
95
124
|
moduleExports[exportName]) as unknown;
|
|
96
125
|
|
|
97
126
|
validatePluginExport(plugin, absolutePath);
|
|
98
|
-
|
|
127
|
+
const pluginTyped = plugin as AgentExtension;
|
|
128
|
+
const originalSetup = pluginTyped.setup;
|
|
129
|
+
|
|
130
|
+
// Wrap setup to inject workspace context
|
|
131
|
+
const setupWithContext: AgentExtension["setup"] = originalSetup
|
|
132
|
+
? (api, _ctx) => {
|
|
133
|
+
const session = {
|
|
134
|
+
...options.session,
|
|
135
|
+
..._ctx.session,
|
|
136
|
+
};
|
|
137
|
+
const ctx = {
|
|
138
|
+
..._ctx,
|
|
139
|
+
session: Object.keys(session).length > 0 ? session : undefined,
|
|
140
|
+
client: options.client ?? _ctx.client,
|
|
141
|
+
user: options.user ?? _ctx.user,
|
|
142
|
+
workspaceInfo: options.workspaceInfo ?? _ctx.workspaceInfo,
|
|
143
|
+
automation: options.automation ?? _ctx.automation,
|
|
144
|
+
logger: options.logger ?? _ctx.logger,
|
|
145
|
+
telemetry: options.telemetry ?? _ctx.telemetry,
|
|
146
|
+
};
|
|
147
|
+
return originalSetup(api, ctx);
|
|
148
|
+
}
|
|
149
|
+
: undefined;
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
...pluginTyped,
|
|
153
|
+
manifest: normalizePluginManifest(pluginTyped.manifest),
|
|
154
|
+
setup: setupWithContext,
|
|
155
|
+
};
|
|
99
156
|
}
|
|
100
157
|
|
|
101
158
|
export async function loadAgentPluginsFromPaths(
|
|
102
159
|
pluginPaths: string[],
|
|
103
|
-
options: LoadAgentPluginFromPathOptions = {},
|
|
104
|
-
): Promise<
|
|
160
|
+
options: LoadAgentPluginFromPathOptions & PluginTargeting = {},
|
|
161
|
+
): Promise<AgentExtension[]> {
|
|
105
162
|
const report = await loadAgentPluginsFromPathsWithDiagnostics(
|
|
106
163
|
pluginPaths,
|
|
107
164
|
options,
|
|
@@ -111,9 +168,9 @@ export async function loadAgentPluginsFromPaths(
|
|
|
111
168
|
|
|
112
169
|
export async function loadAgentPluginsFromPathsWithDiagnostics(
|
|
113
170
|
pluginPaths: string[],
|
|
114
|
-
options: LoadAgentPluginFromPathOptions = {},
|
|
171
|
+
options: LoadAgentPluginFromPathOptions & PluginTargeting = {},
|
|
115
172
|
): Promise<{
|
|
116
|
-
plugins:
|
|
173
|
+
plugins: AgentExtension[];
|
|
117
174
|
failures: PluginInitializationFailure[];
|
|
118
175
|
warnings: PluginInitializationWarning[];
|
|
119
176
|
}> {
|
|
@@ -121,13 +178,16 @@ export async function loadAgentPluginsFromPathsWithDiagnostics(
|
|
|
121
178
|
const warnings: PluginInitializationWarning[] = [];
|
|
122
179
|
const loadedByName = new Map<
|
|
123
180
|
string,
|
|
124
|
-
{ plugin:
|
|
181
|
+
{ plugin: AgentExtension; pluginPath: string; order: number }
|
|
125
182
|
>();
|
|
126
183
|
let order = 0;
|
|
127
184
|
|
|
128
185
|
for (const pluginPath of pluginPaths) {
|
|
129
186
|
try {
|
|
130
187
|
const plugin = await loadAgentPluginFromPath(pluginPath, options);
|
|
188
|
+
if (!matchesPluginManifestTargeting(plugin.manifest, options)) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
131
191
|
const existing = loadedByName.get(plugin.name);
|
|
132
192
|
if (existing) {
|
|
133
193
|
warnings.push({
|
|
@@ -26,8 +26,6 @@ function collectWorkspaceAliases(root: string): Record<string, string> {
|
|
|
26
26
|
"@clinebot/agents": resolve(root, "packages/agents/src/index.ts"),
|
|
27
27
|
"@clinebot/core": resolve(root, "packages/core/src/index.ts"),
|
|
28
28
|
"@clinebot/llms": resolve(root, "packages/llms/src/index.ts"),
|
|
29
|
-
"@clinebot/rpc": resolve(root, "packages/rpc/src/index.ts"),
|
|
30
|
-
"@clinebot/scheduler": resolve(root, "packages/scheduler/src/index.ts"),
|
|
31
29
|
"@clinebot/shared": resolve(root, "packages/shared/src/index.ts"),
|
|
32
30
|
"@clinebot/shared/storage": resolve(
|
|
33
31
|
root,
|