@clinebot/core 0.0.34 → 0.0.36
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 +13 -10
- package/dist/ClineCore.d.ts +96 -63
- package/dist/ClineCore.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/index.d.ts +6 -0
- package/dist/cron/index.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 +66 -0
- package/dist/cron/scheduler.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 +6 -5
- package/dist/extensions/config/agent-config-loader.d.ts.map +1 -1
- package/dist/extensions/config/agent-config-parser.d.ts +1 -1
- package/dist/extensions/config/agent-config-parser.d.ts.map +1 -1
- package/dist/extensions/config/hooks-config-loader.d.ts +2 -2
- package/dist/extensions/config/hooks-config-loader.d.ts.map +1 -1
- package/dist/extensions/config/index.d.ts +3 -3
- package/dist/extensions/config/index.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 +3 -2
- 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 +9 -2
- package/dist/extensions/plugin/plugin-config-loader.d.ts.map +1 -1
- package/dist/extensions/plugin/plugin-loader.d.ts +5 -3
- 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 +15 -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 +253 -253
- package/dist/extensions/tools/constants.d.ts.map +1 -0
- package/dist/{tools → extensions/tools}/definitions.d.ts +1 -1
- package/dist/extensions/tools/definitions.d.ts.map +1 -0
- package/dist/extensions/tools/executors/apply-patch-parser.d.ts.map +1 -0
- package/dist/{tools → extensions/tools}/executors/apply-patch.d.ts +3 -1
- package/dist/extensions/tools/executors/apply-patch.d.ts.map +1 -0
- package/dist/extensions/tools/executors/bash.d.ts.map +1 -0
- package/dist/extensions/tools/executors/editor.d.ts.map +1 -0
- package/dist/extensions/tools/executors/file-read.d.ts.map +1 -0
- package/dist/extensions/tools/executors/index.d.ts.map +1 -0
- package/dist/{tools → extensions/tools}/executors/search.d.ts +1 -1
- package/dist/extensions/tools/executors/search.d.ts.map +1 -0
- package/dist/extensions/tools/executors/web-fetch.d.ts.map +1 -0
- package/dist/extensions/tools/helpers.d.ts.map +1 -0
- package/dist/{tools → extensions/tools}/index.d.ts +2 -0
- package/dist/extensions/tools/index.d.ts.map +1 -0
- package/dist/{tools → extensions/tools}/model-tool-routing.d.ts +1 -1
- package/dist/extensions/tools/model-tool-routing.d.ts.map +1 -0
- package/dist/{tools → extensions/tools}/presets.d.ts +26 -44
- package/dist/extensions/tools/presets.d.ts.map +1 -0
- 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.map +1 -0
- package/dist/extensions/tools/team/delegated-agent.d.ts.map +1 -0
- package/dist/extensions/tools/team/index.d.ts.map +1 -0
- package/dist/{team → extensions/tools/team}/multi-agent.d.ts +1 -3
- package/dist/extensions/tools/team/multi-agent.d.ts.map +1 -0
- package/dist/extensions/tools/team/projections.d.ts.map +1 -0
- package/dist/extensions/tools/team/runtime.d.ts.map +1 -0
- package/dist/{team → extensions/tools/team}/spawn-agent-tool.d.ts +0 -1
- package/dist/extensions/tools/team/spawn-agent-tool.d.ts.map +1 -0
- package/dist/extensions/tools/team/subagent-prompts.d.ts.map +1 -0
- package/dist/{team → extensions/tools/team}/team-tools.d.ts +1 -0
- package/dist/extensions/tools/team/team-tools.d.ts.map +1 -0
- package/dist/{tools → extensions/tools}/types.d.ts +4 -3
- package/dist/extensions/tools/types.d.ts.map +1 -0
- package/dist/{runtime → hooks}/checkpoint-hooks.d.ts +7 -0
- package/dist/hooks/checkpoint-hooks.d.ts.map +1 -0
- package/dist/{runtime → hooks}/hook-file-hooks.d.ts +4 -3
- package/dist/hooks/hook-file-hooks.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 +10 -130
- 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 +45 -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 +1045 -0
- package/dist/hub/daemon.d.ts +5 -0
- package/dist/hub/daemon.d.ts.map +1 -0
- package/dist/hub/defaults.d.ts +13 -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 +1044 -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 +86 -0
- package/dist/hub/server.d.ts.map +1 -0
- package/dist/hub/session-client.d.ts +87 -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 +44 -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 +52 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +557 -533
- package/dist/llms/configured-provider-registry.d.ts +28 -0
- package/dist/llms/configured-provider-registry.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 +202 -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/history.d.ts +4 -0
- package/dist/runtime/history.d.ts.map +1 -0
- package/dist/runtime/host.d.ts +8 -0
- package/dist/runtime/host.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-host.d.ts +103 -0
- package/dist/runtime/runtime-host.d.ts.map +1 -0
- package/dist/{session → runtime}/runtime-oauth-token-manager.d.ts +1 -1
- package/dist/{session → runtime}/runtime-oauth-token-manager.d.ts.map +1 -1
- package/dist/runtime/session-runtime.d.ts +3 -21
- package/dist/runtime/session-runtime.d.ts.map +1 -1
- package/dist/{session/session-agent-events.d.ts → services/agent-events.d.ts} +4 -4
- package/dist/services/agent-events.d.ts.map +1 -0
- package/dist/services/config.d.ts +3 -0
- package/dist/services/config.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/local-runtime-bootstrap.d.ts +47 -0
- package/dist/services/local-runtime-bootstrap.d.ts.map +1 -0
- package/dist/services/plugin-tools.d.ts +16 -0
- package/dist/services/plugin-tools.d.ts.map +1 -0
- package/dist/{providers → services/providers}/local-provider-registry.d.ts +4 -4
- package/dist/services/providers/local-provider-registry.d.ts.map +1 -0
- package/dist/{providers → services/providers}/local-provider-service.d.ts +13 -13
- package/dist/services/providers/local-provider-service.d.ts.map +1 -0
- package/dist/{session → services}/session-artifacts.d.ts +0 -4
- package/dist/services/session-artifacts.d.ts.map +1 -0
- package/dist/{session/utils/helpers.d.ts → services/session-data.d.ts} +19 -27
- package/dist/services/session-data.d.ts.map +1 -0
- package/dist/{session → services}/session-telemetry.d.ts +2 -2
- package/dist/services/session-telemetry.d.ts.map +1 -0
- package/dist/{storage → services/storage}/file-team-store.d.ts +2 -2
- package/dist/services/storage/file-team-store.d.ts.map +1 -0
- package/dist/{storage → services/storage}/provider-settings-legacy-migration.d.ts +1 -1
- package/dist/services/storage/provider-settings-legacy-migration.d.ts.map +1 -0
- package/dist/{storage → services/storage}/provider-settings-manager.d.ts +1 -1
- package/dist/services/storage/provider-settings-manager.d.ts.map +1 -0
- package/dist/{storage → services/storage}/sqlite-session-store.d.ts +3 -3
- package/dist/services/storage/sqlite-session-store.d.ts.map +1 -0
- package/dist/{storage → services/storage}/sqlite-team-store.d.ts +2 -2
- package/dist/services/storage/sqlite-team-store.d.ts.map +1 -0
- package/dist/{storage → services/storage}/team-store.d.ts +1 -1
- package/dist/services/storage/team-store.d.ts.map +1 -0
- package/dist/services/telemetry/ITelemetryAdapter.d.ts.map +1 -0
- package/dist/services/telemetry/OpenTelemetryAdapter.d.ts.map +1 -0
- package/dist/services/telemetry/OpenTelemetryProvider.d.ts.map +1 -0
- package/dist/services/telemetry/TelemetryLoggerSink.d.ts.map +1 -0
- package/dist/services/telemetry/TelemetryService.d.ts.map +1 -0
- package/dist/services/telemetry/core-events.d.ts.map +1 -0
- package/dist/services/telemetry/distinct-id.d.ts.map +1 -0
- package/dist/services/telemetry/index.d.ts.map +1 -0
- package/dist/services/telemetry/index.js +28 -0
- package/dist/{session/utils → services}/usage.d.ts +1 -1
- package/dist/services/usage.d.ts.map +1 -0
- package/dist/services/workspace/file-indexer.d.ts.map +1 -0
- package/dist/services/workspace/index.d.ts.map +1 -0
- package/dist/services/workspace/mention-enricher.d.ts.map +1 -0
- package/dist/services/workspace-manifest.d.ts +16 -0
- package/dist/services/workspace-manifest.d.ts.map +1 -0
- package/dist/session/file-session-service.d.ts +4 -1
- package/dist/session/file-session-service.d.ts.map +1 -1
- package/dist/session/persistence-service.d.ts +15 -25
- 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-row.d.ts +93 -0
- package/dist/session/session-row.d.ts.map +1 -0
- package/dist/session/session-service.d.ts +8 -109
- package/dist/session/session-service.d.ts.map +1 -1
- package/dist/session/session-team-coordination.d.ts +4 -4
- package/dist/session/session-team-coordination.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 +47 -0
- package/dist/transports/hub.d.ts.map +1 -0
- package/dist/{session/default-session-manager.d.ts → transports/local.d.ts} +30 -16
- package/dist/transports/local.d.ts.map +1 -0
- 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 +22 -0
- package/dist/transports/runtime-host-support.d.ts.map +1 -0
- package/dist/{chat → types}/chat-schema.d.ts +10 -12
- package/dist/types/chat-schema.d.ts.map +1 -0
- package/dist/types/config.d.ts +10 -9
- package/dist/types/config.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/{session/utils/types.d.ts → types/session.d.ts} +16 -6
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/sessions.d.ts +19 -0
- package/dist/types/sessions.d.ts.map +1 -1
- package/dist/types/storage.d.ts +1 -3
- package/dist/types/storage.d.ts.map +1 -1
- package/dist/types.d.ts +14 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -13
- package/src/ClineCore.ts +183 -85
- package/src/account/index.ts +3 -3
- package/src/account/rpc.ts +12 -12
- package/src/auth/cline.ts +1 -1
- package/src/auth/codex.ts +1 -1
- package/src/auth/oca.ts +1 -1
- package/src/cron/index.ts +5 -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 +637 -0
- package/src/cron/sqlite-schedule-store.ts +708 -0
- package/src/extensions/config/agent-config-loader.ts +18 -12
- package/src/extensions/config/agent-config-parser.ts +1 -1
- package/src/extensions/config/hooks-config-loader.ts +1 -2
- package/src/extensions/config/index.ts +0 -4
- package/src/extensions/config/runtime-commands.ts +6 -0
- package/src/extensions/config/user-instruction-config-loader.ts +1 -4
- 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 +17 -2
- package/src/extensions/plugin/plugin-loader.ts +48 -4
- package/src/extensions/plugin/plugin-module-import.ts +0 -2
- package/src/extensions/plugin/plugin-sandbox-bootstrap.ts +93 -39
- package/src/extensions/plugin/plugin-sandbox.ts +47 -27
- package/src/extensions/plugin/plugin-targeting.ts +32 -0
- package/src/{tools → extensions/tools}/definitions.ts +31 -50
- package/src/{tools → extensions/tools}/executors/apply-patch.ts +69 -80
- package/src/{tools → extensions/tools}/executors/file-read.ts +29 -4
- package/src/{tools → extensions/tools}/executors/search.ts +196 -4
- package/src/{tools → extensions/tools}/index.ts +10 -0
- package/src/{tools → extensions/tools}/model-tool-routing.ts +1 -1
- package/src/{tools → extensions/tools}/presets.ts +31 -47
- package/src/extensions/tools/runtime.ts +261 -0
- package/src/{tools → extensions/tools}/schemas.ts +4 -2
- package/src/{team → extensions/tools/team}/multi-agent.ts +80 -17
- package/src/{team → extensions/tools/team}/spawn-agent-tool.ts +1 -7
- package/src/{team → extensions/tools/team}/subagent-prompts.ts +2 -2
- package/src/{team → extensions/tools/team}/team-tools.ts +84 -53
- package/src/{tools → extensions/tools}/types.ts +5 -3
- package/src/{runtime → hooks}/checkpoint-hooks.ts +27 -0
- package/src/{runtime → hooks}/hook-file-hooks.ts +14 -13
- package/src/hooks/index.ts +0 -7
- package/src/hooks/subprocess-runner.ts +1 -1
- package/src/hooks/subprocess.ts +57 -257
- package/src/hub/browser-websocket.ts +137 -0
- package/src/hub/client.ts +574 -0
- package/src/hub/connect.ts +156 -0
- package/src/hub/daemon-entry.ts +87 -0
- package/src/hub/daemon.ts +181 -0
- package/src/hub/defaults.ts +43 -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 +140 -0
- package/src/hub/server.ts +1888 -0
- package/src/hub/session-client.ts +460 -0
- package/src/hub/start-shared-server.ts +58 -0
- package/src/hub/transport.ts +14 -0
- package/src/hub/ui-client.ts +122 -0
- package/src/hub/workspace.ts +19 -0
- package/src/index.ts +264 -199
- package/src/llms/configured-provider-registry.ts +193 -0
- package/src/llms/provider-defaults.ts +637 -0
- package/src/llms/provider-settings.ts +263 -0
- package/src/llms/runtime-config.ts +43 -0
- package/src/llms/runtime-registry.ts +171 -0
- package/src/llms/runtime-types.ts +121 -0
- package/src/runtime/history.ts +237 -0
- package/src/runtime/host.ts +200 -0
- package/src/runtime/index.ts +1 -0
- package/src/runtime/rules.ts +12 -0
- package/src/runtime/runtime-builder.ts +37 -29
- package/src/runtime/runtime-host.ts +206 -0
- package/src/{session → runtime}/runtime-oauth-token-manager.ts +12 -16
- package/src/runtime/session-runtime.ts +2 -26
- package/src/{session/session-agent-events.ts → services/agent-events.ts} +7 -7
- package/src/services/config.ts +5 -0
- package/src/services/global-settings.ts +122 -0
- package/src/services/local-runtime-bootstrap.ts +318 -0
- package/src/services/plugin-tools.ts +85 -0
- package/src/{providers → services/providers}/local-provider-registry.ts +6 -6
- package/src/{providers → services/providers}/local-provider-service.ts +46 -41
- package/src/{session → services}/session-artifacts.ts +7 -19
- package/src/{session/utils/helpers.ts → services/session-data.ts} +90 -80
- package/src/{session → services}/session-telemetry.ts +7 -9
- package/src/services/storage/artifact-store.ts +1 -0
- package/src/{storage → services/storage}/file-team-store.ts +2 -2
- package/src/{storage → services/storage}/provider-settings-legacy-migration.ts +6 -4
- package/src/{storage → services/storage}/provider-settings-manager.ts +3 -3
- package/src/services/storage/session-store.ts +1 -0
- package/src/{storage → services/storage}/sqlite-session-store.ts +7 -12
- package/src/{storage → services/storage}/sqlite-team-store.ts +4 -4
- package/src/{storage → services/storage}/team-store.ts +1 -1
- package/src/{session/utils → services}/usage.ts +1 -1
- package/src/{input → services/workspace}/file-indexer.ts +26 -2
- package/src/{input → services/workspace}/mention-enricher.ts +1 -1
- package/src/{session → services}/workspace-manifest.ts +18 -0
- package/src/session/file-session-service.ts +10 -8
- package/src/session/index.ts +10 -23
- package/src/session/persistence-service.ts +144 -528
- package/src/session/session-manifest-store.ts +158 -0
- package/src/session/session-row.ts +199 -0
- package/src/session/session-service.ts +43 -389
- package/src/session/session-team-coordination.ts +14 -7
- package/src/session/subagent-session-manager.ts +397 -0
- package/src/session/team-persistence-store.ts +176 -0
- package/src/session/workspace-manager.ts +1 -1
- package/src/transports/hub.ts +656 -0
- package/src/{session/default-session-manager.ts → transports/local.ts} +263 -200
- package/src/transports/remote.ts +26 -0
- package/src/transports/runtime-host-support.ts +140 -0
- package/src/{chat → types}/chat-schema.ts +4 -5
- package/src/types/config.ts +10 -9
- package/src/types/provider-settings.ts +11 -7
- package/src/{session/utils/types.ts → types/session.ts} +16 -5
- package/src/types/sessions.ts +21 -0
- package/src/types/storage.ts +1 -6
- package/src/types.ts +52 -19
- package/dist/chat/chat-schema.d.ts.map +0 -1
- package/dist/hooks/persistent.d.ts +0 -64
- package/dist/hooks/persistent.d.ts.map +0 -1
- package/dist/input/file-indexer.d.ts.map +0 -1
- package/dist/input/index.d.ts.map +0 -1
- package/dist/input/mention-enricher.d.ts.map +0 -1
- package/dist/prompt/default-system.d.ts +0 -2
- package/dist/prompt/default-system.d.ts.map +0 -1
- package/dist/providers/local-provider-registry.d.ts.map +0 -1
- package/dist/providers/local-provider-service.d.ts.map +0 -1
- package/dist/runtime/checkpoint-hooks.d.ts.map +0 -1
- package/dist/runtime/hook-file-hooks.d.ts.map +0 -1
- package/dist/session/default-session-manager.d.ts.map +0 -1
- package/dist/session/rpc-runtime-ensure.d.ts +0 -53
- package/dist/session/rpc-runtime-ensure.d.ts.map +0 -1
- package/dist/session/rpc-session-service.d.ts +0 -13
- package/dist/session/rpc-session-service.d.ts.map +0 -1
- package/dist/session/rpc-spawn-lease.d.ts +0 -8
- package/dist/session/rpc-spawn-lease.d.ts.map +0 -1
- package/dist/session/session-agent-events.d.ts.map +0 -1
- package/dist/session/session-artifacts.d.ts.map +0 -1
- package/dist/session/session-config-builder.d.ts +0 -16
- package/dist/session/session-config-builder.d.ts.map +0 -1
- package/dist/session/session-host.d.ts +0 -15
- package/dist/session/session-host.d.ts.map +0 -1
- package/dist/session/session-manager.d.ts +0 -62
- package/dist/session/session-manager.d.ts.map +0 -1
- package/dist/session/session-telemetry.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/session/utils/helpers.d.ts.map +0 -1
- package/dist/session/utils/types.d.ts.map +0 -1
- package/dist/session/utils/usage.d.ts.map +0 -1
- package/dist/session/workspace-manifest.d.ts +0 -5
- package/dist/session/workspace-manifest.d.ts.map +0 -1
- package/dist/storage/file-team-store.d.ts.map +0 -1
- package/dist/storage/provider-settings-legacy-migration.d.ts.map +0 -1
- package/dist/storage/provider-settings-manager.d.ts.map +0 -1
- package/dist/storage/sqlite-session-store.d.ts.map +0 -1
- package/dist/storage/sqlite-team-store.d.ts.map +0 -1
- package/dist/storage/team-store.d.ts.map +0 -1
- package/dist/team/delegated-agent.d.ts.map +0 -1
- package/dist/team/index.d.ts.map +0 -1
- package/dist/team/multi-agent.d.ts.map +0 -1
- package/dist/team/projections.d.ts.map +0 -1
- package/dist/team/runtime.d.ts.map +0 -1
- package/dist/team/spawn-agent-tool.d.ts.map +0 -1
- package/dist/team/subagent-prompts.d.ts.map +0 -1
- package/dist/team/team-tools.d.ts.map +0 -1
- package/dist/telemetry/ITelemetryAdapter.d.ts.map +0 -1
- package/dist/telemetry/OpenTelemetryAdapter.d.ts.map +0 -1
- package/dist/telemetry/OpenTelemetryProvider.d.ts.map +0 -1
- package/dist/telemetry/TelemetryLoggerSink.d.ts.map +0 -1
- package/dist/telemetry/TelemetryService.d.ts.map +0 -1
- package/dist/telemetry/core-events.d.ts.map +0 -1
- package/dist/telemetry/distinct-id.d.ts.map +0 -1
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -15
- package/dist/tools/constants.d.ts.map +0 -1
- package/dist/tools/definitions.d.ts.map +0 -1
- package/dist/tools/executors/apply-patch-parser.d.ts.map +0 -1
- package/dist/tools/executors/apply-patch.d.ts.map +0 -1
- package/dist/tools/executors/bash.d.ts.map +0 -1
- package/dist/tools/executors/editor.d.ts.map +0 -1
- package/dist/tools/executors/file-read.d.ts.map +0 -1
- package/dist/tools/executors/index.d.ts.map +0 -1
- package/dist/tools/executors/search.d.ts.map +0 -1
- package/dist/tools/executors/web-fetch.d.ts.map +0 -1
- package/dist/tools/helpers.d.ts.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/model-tool-routing.d.ts.map +0 -1
- package/dist/tools/presets.d.ts.map +0 -1
- package/dist/tools/schemas.d.ts.map +0 -1
- package/dist/tools/types.d.ts.map +0 -1
- package/src/ClineCore.test.ts +0 -150
- 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 -182
- package/src/extensions/plugin/plugin-loader.test.ts +0 -292
- package/src/extensions/plugin/plugin-sandbox.test.ts +0 -423
- package/src/hooks/persistent.ts +0 -661
- package/src/input/file-indexer.d.ts +0 -11
- package/src/input/file-indexer.test.ts +0 -127
- package/src/input/mention-enricher.test.ts +0 -85
- package/src/prompt/default-system.ts +0 -21
- package/src/providers/local-provider-service.test.ts +0 -1062
- package/src/runtime/checkpoint-hooks.test.ts +0 -168
- package/src/runtime/hook-file-hooks.test.ts +0 -311
- package/src/runtime/runtime-builder.team-persistence.test.ts +0 -242
- package/src/runtime/runtime-builder.test.ts +0 -616
- package/src/runtime/runtime-parity.test.ts +0 -143
- package/src/session/default-session-manager.e2e.test.ts +0 -384
- package/src/session/default-session-manager.test.ts +0 -2473
- package/src/session/persistence-service.test.ts +0 -241
- package/src/session/rpc-runtime-ensure.ts +0 -521
- package/src/session/rpc-session-service.ts +0 -107
- package/src/session/rpc-spawn-lease.test.ts +0 -49
- package/src/session/rpc-spawn-lease.ts +0 -122
- package/src/session/runtime-oauth-token-manager.test.ts +0 -137
- package/src/session/session-config-builder.ts +0 -172
- package/src/session/session-host.test.ts +0 -89
- package/src/session/session-host.ts +0 -213
- package/src/session/session-manager.ts +0 -74
- package/src/session/session-service.team-persistence.test.ts +0 -48
- package/src/session/sqlite-rpc-session-backend.ts +0 -303
- package/src/session/utils/helpers.test.ts +0 -160
- package/src/storage/artifact-store.ts +0 -1
- package/src/storage/provider-settings-legacy-migration.test.ts +0 -424
- package/src/storage/provider-settings-manager.test.ts +0 -191
- package/src/storage/session-store.ts +0 -1
- package/src/team/multi-agent.lifecycle.test.ts +0 -201
- package/src/team/spawn-agent-tool.test.ts +0 -387
- package/src/team/team-tools.test.ts +0 -906
- package/src/telemetry/OpenTelemetryAdapter.test.ts +0 -157
- package/src/telemetry/OpenTelemetryProvider.test.ts +0 -326
- package/src/telemetry/TelemetryLoggerSink.test.ts +0 -42
- package/src/telemetry/TelemetryService.test.ts +0 -134
- package/src/telemetry/distinct-id.test.ts +0 -57
- package/src/tools/definitions.test.ts +0 -780
- package/src/tools/executors/bash.test.ts +0 -87
- package/src/tools/executors/editor.test.ts +0 -35
- package/src/tools/executors/file-read.test.ts +0 -49
- package/src/tools/model-tool-routing.test.ts +0 -86
- package/src/tools/presets.test.ts +0 -70
- /package/dist/{tools → extensions/tools}/constants.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/executors/apply-patch-parser.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/executors/bash.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/executors/editor.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/executors/file-read.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/executors/index.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/executors/web-fetch.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/helpers.d.ts +0 -0
- /package/dist/{tools → extensions/tools}/schemas.d.ts +0 -0
- /package/dist/{team → extensions/tools/team}/delegated-agent.d.ts +0 -0
- /package/dist/{team → extensions/tools/team}/index.d.ts +0 -0
- /package/dist/{team → extensions/tools/team}/projections.d.ts +0 -0
- /package/dist/{team → extensions/tools/team}/runtime.d.ts +0 -0
- /package/dist/{team → extensions/tools/team}/subagent-prompts.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/ITelemetryAdapter.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/OpenTelemetryAdapter.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/OpenTelemetryProvider.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/TelemetryLoggerSink.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/TelemetryService.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/core-events.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/distinct-id.d.ts +0 -0
- /package/dist/{telemetry → services/telemetry}/index.d.ts +0 -0
- /package/dist/{input → services/workspace}/file-indexer.d.ts +0 -0
- /package/dist/{input → services/workspace}/index.d.ts +0 -0
- /package/dist/{input → services/workspace}/mention-enricher.d.ts +0 -0
- /package/src/{tools → extensions/tools}/constants.ts +0 -0
- /package/src/{tools → extensions/tools}/executors/apply-patch-parser.ts +0 -0
- /package/src/{tools → extensions/tools}/executors/bash.ts +0 -0
- /package/src/{tools → extensions/tools}/executors/editor.ts +0 -0
- /package/src/{tools → extensions/tools}/executors/index.ts +0 -0
- /package/src/{tools → extensions/tools}/executors/web-fetch.ts +0 -0
- /package/src/{tools → extensions/tools}/helpers.ts +0 -0
- /package/src/{team → extensions/tools/team}/delegated-agent.ts +0 -0
- /package/src/{team → extensions/tools/team}/index.ts +0 -0
- /package/src/{team → extensions/tools/team}/projections.ts +0 -0
- /package/src/{team → extensions/tools/team}/runtime.ts +0 -0
- /package/src/{storage → services/storage}/index.ts +0 -0
- /package/src/{telemetry → services/telemetry}/ITelemetryAdapter.ts +0 -0
- /package/src/{telemetry → services/telemetry}/OpenTelemetryAdapter.ts +0 -0
- /package/src/{telemetry → services/telemetry}/OpenTelemetryProvider.ts +0 -0
- /package/src/{telemetry → services/telemetry}/TelemetryLoggerSink.ts +0 -0
- /package/src/{telemetry → services/telemetry}/TelemetryService.ts +0 -0
- /package/src/{telemetry → services/telemetry}/core-events.ts +0 -0
- /package/src/{telemetry → services/telemetry}/distinct-id.ts +0 -0
- /package/src/{telemetry → services/telemetry}/index.ts +0 -0
- /package/src/{input → services/workspace}/index.ts +0 -0
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
AGENT_CONFIG_DIRECTORY_NAME,
|
|
3
3
|
resolveAgentConfigSearchPaths as resolveAgentConfigSearchPathsFromShared,
|
|
4
4
|
resolveAgentsConfigDirPath as resolveAgentsConfigDirPathFromShared,
|
|
5
|
-
resolveDocumentsAgentConfigDirectoryPath,
|
|
6
5
|
} from "@clinebot/shared/storage";
|
|
7
6
|
import {
|
|
8
7
|
type AgentYamlConfig,
|
|
@@ -38,21 +37,20 @@ export type AgentConfigWatcherEvent = UnifiedConfigWatcherEvent<
|
|
|
38
37
|
AgentYamlConfig
|
|
39
38
|
>;
|
|
40
39
|
|
|
41
|
-
export {
|
|
42
|
-
AGENT_CONFIG_DIRECTORY_NAME,
|
|
43
|
-
resolveDocumentsAgentConfigDirectoryPath,
|
|
44
|
-
};
|
|
40
|
+
export { AGENT_CONFIG_DIRECTORY_NAME };
|
|
45
41
|
|
|
46
42
|
export function resolveAgentsConfigDirPath(): string {
|
|
47
43
|
return resolveAgentsConfigDirPathFromShared();
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
export function resolveAgentConfigSearchPaths(
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
export function resolveAgentConfigSearchPaths(
|
|
47
|
+
workspacePath?: string,
|
|
48
|
+
): string[] {
|
|
49
|
+
return resolveAgentConfigSearchPathsFromShared(workspacePath);
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
export interface CreateAgentConfigWatcherOptions {
|
|
53
|
+
workspacePath?: string;
|
|
56
54
|
directoryPathOrPaths?: string | ReadonlyArray<string>;
|
|
57
55
|
debounceMs?: number;
|
|
58
56
|
emitParseErrors?: boolean;
|
|
@@ -60,6 +58,7 @@ export interface CreateAgentConfigWatcherOptions {
|
|
|
60
58
|
|
|
61
59
|
function toDirectoryPaths(
|
|
62
60
|
directoryPathOrPaths?: string | ReadonlyArray<string>,
|
|
61
|
+
workspacePath?: string,
|
|
63
62
|
): string[] {
|
|
64
63
|
if (Array.isArray(directoryPathOrPaths)) {
|
|
65
64
|
return [...directoryPathOrPaths];
|
|
@@ -67,15 +66,16 @@ function toDirectoryPaths(
|
|
|
67
66
|
if (typeof directoryPathOrPaths === "string") {
|
|
68
67
|
return [directoryPathOrPaths];
|
|
69
68
|
}
|
|
70
|
-
return resolveAgentConfigSearchPaths();
|
|
69
|
+
return resolveAgentConfigSearchPaths(workspacePath);
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
export function createAgentConfigDefinition(
|
|
74
73
|
directoryPathOrPaths?: string | ReadonlyArray<string>,
|
|
74
|
+
workspacePath?: string,
|
|
75
75
|
): UnifiedConfigDefinition<"agent", AgentYamlConfig> {
|
|
76
76
|
return {
|
|
77
77
|
type: "agent",
|
|
78
|
-
directories: toDirectoryPaths(directoryPathOrPaths),
|
|
78
|
+
directories: toDirectoryPaths(directoryPathOrPaths, workspacePath),
|
|
79
79
|
includeFile: (fileName) => isAgentConfigYamlFile(fileName),
|
|
80
80
|
parseFile: (context) => parseAgentConfigFromYaml(context.content),
|
|
81
81
|
resolveId: (config) => normalizeAgentConfigName(config.name),
|
|
@@ -86,7 +86,12 @@ export function createAgentConfigWatcher(
|
|
|
86
86
|
options?: CreateAgentConfigWatcherOptions,
|
|
87
87
|
): AgentConfigWatcher {
|
|
88
88
|
return new UnifiedConfigFileWatcher(
|
|
89
|
-
[
|
|
89
|
+
[
|
|
90
|
+
createAgentConfigDefinition(
|
|
91
|
+
options?.directoryPathOrPaths,
|
|
92
|
+
options?.workspacePath,
|
|
93
|
+
),
|
|
94
|
+
],
|
|
90
95
|
{
|
|
91
96
|
debounceMs: options?.debounceMs,
|
|
92
97
|
emitParseErrors: options?.emitParseErrors,
|
|
@@ -96,9 +101,10 @@ export function createAgentConfigWatcher(
|
|
|
96
101
|
|
|
97
102
|
export async function readAgentConfigsFromDisk(
|
|
98
103
|
directoryPathOrPaths?: string | ReadonlyArray<string>,
|
|
104
|
+
workspacePath?: string,
|
|
99
105
|
): Promise<Map<string, AgentYamlConfig>> {
|
|
100
106
|
const watcher = new UnifiedConfigFileWatcher([
|
|
101
|
-
createAgentConfigDefinition(directoryPathOrPaths),
|
|
107
|
+
createAgentConfigDefinition(directoryPathOrPaths, workspacePath),
|
|
102
108
|
]);
|
|
103
109
|
await watcher.refreshAll();
|
|
104
110
|
const snapshot = watcher.getSnapshot("agent");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AgentConfig, Tool } from "@clinebot/shared";
|
|
2
2
|
import YAML from "yaml";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { ALL_DEFAULT_TOOL_NAMES, type DefaultToolName } from "
|
|
4
|
+
import { ALL_DEFAULT_TOOL_NAMES, type DefaultToolName } from "../tools/";
|
|
5
5
|
|
|
6
6
|
const AgentConfigFrontmatterSchema = z.object({
|
|
7
7
|
name: z.string().trim().min(1),
|
|
@@ -2,12 +2,11 @@ import { existsSync, readdirSync } from "node:fs";
|
|
|
2
2
|
import { basename, extname, join } from "node:path";
|
|
3
3
|
import {
|
|
4
4
|
HOOKS_CONFIG_DIRECTORY_NAME,
|
|
5
|
-
resolveDocumentsHooksDirectoryPath,
|
|
6
5
|
resolveHooksConfigSearchPaths as resolveHooksConfigSearchPathsFromShared,
|
|
7
6
|
} from "@clinebot/shared/storage";
|
|
8
7
|
import type { HookEventName } from "../../hooks";
|
|
9
8
|
|
|
10
|
-
export { HOOKS_CONFIG_DIRECTORY_NAME
|
|
9
|
+
export { HOOKS_CONFIG_DIRECTORY_NAME };
|
|
11
10
|
|
|
12
11
|
export function resolveHooksConfigSearchPaths(
|
|
13
12
|
workspacePath?: string,
|
|
@@ -17,7 +17,6 @@ export {
|
|
|
17
17
|
resolveAgentConfigSearchPaths,
|
|
18
18
|
resolveAgentsConfigDirPath,
|
|
19
19
|
resolveAgentTools,
|
|
20
|
-
resolveDocumentsAgentConfigDirectoryPath,
|
|
21
20
|
toPartialAgentConfig,
|
|
22
21
|
} from "./agent-config-loader";
|
|
23
22
|
export {
|
|
@@ -26,7 +25,6 @@ export {
|
|
|
26
25
|
type HookConfigFileEntry,
|
|
27
26
|
HookConfigFileName,
|
|
28
27
|
listHookConfigFiles,
|
|
29
|
-
resolveDocumentsHooksDirectoryPath,
|
|
30
28
|
resolveHooksConfigSearchPaths,
|
|
31
29
|
toHookConfigFileName,
|
|
32
30
|
} from "./hooks-config-loader";
|
|
@@ -71,8 +69,6 @@ export {
|
|
|
71
69
|
parseSkillConfigFromMarkdown,
|
|
72
70
|
parseWorkflowConfigFromMarkdown,
|
|
73
71
|
RULES_CONFIG_DIRECTORY_NAME,
|
|
74
|
-
resolveDocumentsRulesDirectoryPath,
|
|
75
|
-
resolveDocumentsWorkflowsDirectoryPath,
|
|
76
72
|
resolveRulesConfigSearchPaths,
|
|
77
73
|
resolveSkillsConfigSearchPaths,
|
|
78
74
|
resolveWorkflowsConfigSearchPaths,
|
|
@@ -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));
|
|
@@ -2,8 +2,6 @@ import { readdir, readFile, stat } from "node:fs/promises";
|
|
|
2
2
|
import { basename, dirname, extname, join } from "node:path";
|
|
3
3
|
import {
|
|
4
4
|
RULES_CONFIG_DIRECTORY_NAME,
|
|
5
|
-
resolveDocumentsRulesDirectoryPath,
|
|
6
|
-
resolveDocumentsWorkflowsDirectoryPath,
|
|
7
5
|
resolveRulesConfigSearchPaths as resolveRulesConfigSearchPathsFromShared,
|
|
8
6
|
resolveSkillsConfigSearchPaths as resolveSkillsConfigSearchPathsFromShared,
|
|
9
7
|
resolveWorkflowsConfigSearchPaths as resolveWorkflowsConfigSearchPathsFromShared,
|
|
@@ -25,8 +23,6 @@ const MARKDOWN_EXTENSIONS = new Set([".md", ".markdown", ".txt"]);
|
|
|
25
23
|
|
|
26
24
|
export {
|
|
27
25
|
RULES_CONFIG_DIRECTORY_NAME,
|
|
28
|
-
resolveDocumentsRulesDirectoryPath,
|
|
29
|
-
resolveDocumentsWorkflowsDirectoryPath,
|
|
30
26
|
SKILLS_CONFIG_DIRECTORY_NAME,
|
|
31
27
|
WORKFLOWS_CONFIG_DIRECTORY_NAME,
|
|
32
28
|
};
|
|
@@ -56,6 +52,7 @@ export interface RuleConfig {
|
|
|
56
52
|
export interface WorkflowConfig {
|
|
57
53
|
name: string;
|
|
58
54
|
disabled?: boolean;
|
|
55
|
+
description?: string;
|
|
59
56
|
instructions: string;
|
|
60
57
|
frontmatter: Record<string, unknown>;
|
|
61
58
|
}
|
|
@@ -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,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import type { AgentConfig } from "@clinebot/shared";
|
|
2
|
+
import type { AgentConfig, WorkspaceInfo } from "@clinebot/shared";
|
|
3
3
|
import {
|
|
4
4
|
discoverPluginModulePaths as discoverPluginModulePathsFromShared,
|
|
5
5
|
resolveConfiguredPluginModulePaths,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import type { PluginLoadDiagnostics } from "./plugin-load-report";
|
|
9
9
|
import { loadAgentPluginsFromPathsWithDiagnostics } from "./plugin-loader";
|
|
10
10
|
import { loadSandboxedPlugins } from "./plugin-sandbox";
|
|
11
|
+
import type { PluginTargeting } from "./plugin-targeting";
|
|
11
12
|
|
|
12
13
|
type AgentPlugin = NonNullable<AgentConfig["extensions"]>[number];
|
|
13
14
|
|
|
@@ -54,13 +55,20 @@ export function resolveAgentPluginPaths(
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
export interface ResolveAndLoadAgentPluginsOptions
|
|
57
|
-
extends ResolveAgentPluginPathsOptions
|
|
58
|
+
extends ResolveAgentPluginPathsOptions,
|
|
59
|
+
PluginTargeting {
|
|
58
60
|
mode?: "sandbox" | "in_process";
|
|
59
61
|
exportName?: string;
|
|
60
62
|
importTimeoutMs?: number;
|
|
61
63
|
hookTimeoutMs?: number;
|
|
62
64
|
contributionTimeoutMs?: number;
|
|
63
65
|
onEvent?: (event: { name: string; payload?: unknown }) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Structured workspace and git metadata. Forwarded to sandboxed plugins
|
|
68
|
+
* via PluginSetupCtx.workspaceInfo and made available to in-process plugins
|
|
69
|
+
* in the extension context.
|
|
70
|
+
*/
|
|
71
|
+
workspaceInfo?: WorkspaceInfo;
|
|
64
72
|
}
|
|
65
73
|
|
|
66
74
|
export async function resolveAndLoadAgentPlugins(
|
|
@@ -80,6 +88,9 @@ export async function resolveAndLoadAgentPlugins(
|
|
|
80
88
|
const report = await loadAgentPluginsFromPathsWithDiagnostics(paths, {
|
|
81
89
|
cwd: options.cwd,
|
|
82
90
|
exportName: options.exportName,
|
|
91
|
+
providerId: options.providerId,
|
|
92
|
+
modelId: options.modelId,
|
|
93
|
+
workspaceInfo: options.workspaceInfo,
|
|
83
94
|
});
|
|
84
95
|
return {
|
|
85
96
|
extensions: report.plugins,
|
|
@@ -95,6 +106,10 @@ export async function resolveAndLoadAgentPlugins(
|
|
|
95
106
|
hookTimeoutMs: options.hookTimeoutMs,
|
|
96
107
|
contributionTimeoutMs: options.contributionTimeoutMs,
|
|
97
108
|
onEvent: options.onEvent,
|
|
109
|
+
providerId: options.providerId,
|
|
110
|
+
modelId: options.modelId,
|
|
111
|
+
cwd: options.cwd,
|
|
112
|
+
workspaceInfo: options.workspaceInfo,
|
|
98
113
|
});
|
|
99
114
|
return {
|
|
100
115
|
extensions: sandboxed.extensions ?? [],
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
|
-
import type { AgentConfig } from "@clinebot/shared";
|
|
2
|
+
import type { AgentConfig, 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
14
|
type AgentPlugin = NonNullable<AgentConfig["extensions"]>[number];
|
|
10
15
|
type PluginLike = {
|
|
@@ -12,6 +17,8 @@ type PluginLike = {
|
|
|
12
17
|
manifest: {
|
|
13
18
|
capabilities: string[];
|
|
14
19
|
hookStages?: string[];
|
|
20
|
+
providerIds?: string[];
|
|
21
|
+
modelIds?: string[];
|
|
15
22
|
};
|
|
16
23
|
};
|
|
17
24
|
|
|
@@ -19,6 +26,7 @@ export interface LoadAgentPluginFromPathOptions {
|
|
|
19
26
|
exportName?: string;
|
|
20
27
|
cwd?: string;
|
|
21
28
|
useCache?: boolean;
|
|
29
|
+
workspaceInfo?: PluginSetupContext["workspaceInfo"];
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
function isObject(value: unknown): value is Record<string, unknown> {
|
|
@@ -58,6 +66,22 @@ function validatePluginManifest(
|
|
|
58
66
|
`Invalid plugin module at ${absolutePath}: manifest.hookStages must be a string array when provided`,
|
|
59
67
|
);
|
|
60
68
|
}
|
|
69
|
+
if (
|
|
70
|
+
Object.hasOwn(plugin.manifest, "providerIds") &&
|
|
71
|
+
!hasValidStringArray(plugin.manifest.providerIds)
|
|
72
|
+
) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
`Invalid plugin module at ${absolutePath}: manifest.providerIds must be a string array when provided`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
if (
|
|
78
|
+
Object.hasOwn(plugin.manifest, "modelIds") &&
|
|
79
|
+
!hasValidStringArray(plugin.manifest.modelIds)
|
|
80
|
+
) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`Invalid plugin module at ${absolutePath}: manifest.modelIds must be a string array when provided`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
61
85
|
}
|
|
62
86
|
|
|
63
87
|
function validatePluginExport(
|
|
@@ -95,12 +119,29 @@ export async function loadAgentPluginFromPath(
|
|
|
95
119
|
moduleExports[exportName]) as unknown;
|
|
96
120
|
|
|
97
121
|
validatePluginExport(plugin, absolutePath);
|
|
98
|
-
|
|
122
|
+
const pluginTyped = plugin as AgentPlugin;
|
|
123
|
+
const originalSetup = pluginTyped.setup;
|
|
124
|
+
|
|
125
|
+
// Wrap setup to inject workspace context
|
|
126
|
+
const setupWithContext: AgentPlugin["setup"] = originalSetup
|
|
127
|
+
? (api, _ctx) => {
|
|
128
|
+
const ctx = {
|
|
129
|
+
workspaceInfo: options.workspaceInfo,
|
|
130
|
+
};
|
|
131
|
+
return originalSetup(api, ctx);
|
|
132
|
+
}
|
|
133
|
+
: undefined;
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
...pluginTyped,
|
|
137
|
+
manifest: normalizePluginManifest(pluginTyped.manifest),
|
|
138
|
+
setup: setupWithContext,
|
|
139
|
+
};
|
|
99
140
|
}
|
|
100
141
|
|
|
101
142
|
export async function loadAgentPluginsFromPaths(
|
|
102
143
|
pluginPaths: string[],
|
|
103
|
-
options: LoadAgentPluginFromPathOptions = {},
|
|
144
|
+
options: LoadAgentPluginFromPathOptions & PluginTargeting = {},
|
|
104
145
|
): Promise<AgentPlugin[]> {
|
|
105
146
|
const report = await loadAgentPluginsFromPathsWithDiagnostics(
|
|
106
147
|
pluginPaths,
|
|
@@ -111,7 +152,7 @@ export async function loadAgentPluginsFromPaths(
|
|
|
111
152
|
|
|
112
153
|
export async function loadAgentPluginsFromPathsWithDiagnostics(
|
|
113
154
|
pluginPaths: string[],
|
|
114
|
-
options: LoadAgentPluginFromPathOptions = {},
|
|
155
|
+
options: LoadAgentPluginFromPathOptions & PluginTargeting = {},
|
|
115
156
|
): Promise<{
|
|
116
157
|
plugins: AgentPlugin[];
|
|
117
158
|
failures: PluginInitializationFailure[];
|
|
@@ -128,6 +169,9 @@ export async function loadAgentPluginsFromPathsWithDiagnostics(
|
|
|
128
169
|
for (const pluginPath of pluginPaths) {
|
|
129
170
|
try {
|
|
130
171
|
const plugin = await loadAgentPluginFromPath(pluginPath, options);
|
|
172
|
+
if (!matchesPluginManifestTargeting(plugin.manifest, options)) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
131
175
|
const existing = loadedByName.get(plugin.name);
|
|
132
176
|
if (existing) {
|
|
133
177
|
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,
|