@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentResult } from "@clinebot/
|
|
1
|
+
import type { AgentResult } from "@clinebot/shared";
|
|
2
2
|
import {
|
|
3
3
|
createTool,
|
|
4
4
|
TEAM_AWAIT_TIMEOUT_MS,
|
|
@@ -11,20 +11,32 @@ import {
|
|
|
11
11
|
TeamAwaitRunsInputSchema,
|
|
12
12
|
type TeamBroadcastInput,
|
|
13
13
|
TeamBroadcastInputSchema,
|
|
14
|
+
TeamBroadcastToolResultSchema,
|
|
14
15
|
type TeamCancelRunInput,
|
|
15
16
|
TeamCancelRunInputSchema,
|
|
17
|
+
TeamCancelRunToolResultSchema,
|
|
16
18
|
type TeamCleanupInput,
|
|
17
19
|
TeamCleanupInputSchema,
|
|
20
|
+
TeamCleanupToolResultSchema,
|
|
18
21
|
type TeamCreateOutcomeInput,
|
|
19
22
|
TeamCreateOutcomeInputSchema,
|
|
23
|
+
type TeamCreateOutcomeToolResult,
|
|
24
|
+
TeamCreateOutcomeToolResultSchema,
|
|
20
25
|
type TeamFinalizeOutcomeInput,
|
|
21
26
|
TeamFinalizeOutcomeInputSchema,
|
|
27
|
+
TeamFinalizeOutcomeToolResultSchema,
|
|
22
28
|
type TeamListOutcomesInput,
|
|
23
29
|
TeamListOutcomesInputSchema,
|
|
24
30
|
type TeamListRunsInput,
|
|
25
31
|
TeamListRunsInputSchema,
|
|
32
|
+
type TeamMailboxMessageToolResult,
|
|
33
|
+
TeamMailboxMessageToolResultSchema,
|
|
26
34
|
type TeamMissionLogInput,
|
|
27
35
|
TeamMissionLogInputSchema,
|
|
36
|
+
TeamMissionLogToolResultSchema,
|
|
37
|
+
TeamOutcomeFragmentToolResultSchema,
|
|
38
|
+
type TeamOutcomeToolResult,
|
|
39
|
+
TeamOutcomeToolResultSchema,
|
|
28
40
|
type TeamReadMailboxInput,
|
|
29
41
|
TeamReadMailboxInputSchema,
|
|
30
42
|
type TeamReviewOutcomeFragmentInput,
|
|
@@ -33,19 +45,27 @@ import {
|
|
|
33
45
|
type TeamRunResultSummary,
|
|
34
46
|
type TeamRunTaskInput,
|
|
35
47
|
TeamRunTaskInputSchema,
|
|
48
|
+
type TeamRunTaskToolResult,
|
|
49
|
+
TeamRunTaskToolResultSchema,
|
|
36
50
|
type TeamRunToolSummary,
|
|
51
|
+
TeamRunToolSummarySchema,
|
|
37
52
|
type TeamRuntimeState,
|
|
38
53
|
type TeamSendMessageInput,
|
|
39
54
|
TeamSendMessageInputSchema,
|
|
55
|
+
TeamSendMessageToolResultSchema,
|
|
40
56
|
type TeamShutdownTeammateInput,
|
|
41
57
|
TeamShutdownTeammateInputSchema,
|
|
58
|
+
TeamSimpleAgentStatusToolResultSchema,
|
|
42
59
|
type TeamSpawnTeammateInput,
|
|
43
60
|
TeamSpawnTeammateInputSchema,
|
|
44
61
|
type TeamStatusInput,
|
|
45
62
|
TeamStatusInputSchema,
|
|
63
|
+
type TeamStatusToolResult,
|
|
64
|
+
TeamStatusToolResultSchema,
|
|
46
65
|
type TeamTaskInput,
|
|
47
66
|
TeamTaskInputSchema,
|
|
48
67
|
type TeamTaskToolResult,
|
|
68
|
+
TeamTaskToolResultSchema,
|
|
49
69
|
type TeamTeammateSpec,
|
|
50
70
|
type Tool,
|
|
51
71
|
validateWithZod,
|
|
@@ -88,6 +108,10 @@ function summarizeRunResult(
|
|
|
88
108
|
};
|
|
89
109
|
}
|
|
90
110
|
|
|
111
|
+
function dateToIso(value: Date | undefined): string | undefined {
|
|
112
|
+
return value?.toISOString();
|
|
113
|
+
}
|
|
114
|
+
|
|
91
115
|
function summarizeRun(run: TeamRunRecord): TeamRunToolSummary {
|
|
92
116
|
return {
|
|
93
117
|
id: run.id,
|
|
@@ -98,13 +122,13 @@ function summarizeRun(run: TeamRunRecord): TeamRunToolSummary {
|
|
|
98
122
|
priority: run.priority,
|
|
99
123
|
retryCount: run.retryCount,
|
|
100
124
|
maxRetries: run.maxRetries,
|
|
101
|
-
nextAttemptAt: run.nextAttemptAt,
|
|
125
|
+
nextAttemptAt: dateToIso(run.nextAttemptAt),
|
|
102
126
|
continueConversation: run.continueConversation,
|
|
103
|
-
startedAt: run.startedAt,
|
|
104
|
-
endedAt: run.endedAt,
|
|
127
|
+
startedAt: run.startedAt.toISOString(),
|
|
128
|
+
endedAt: dateToIso(run.endedAt),
|
|
105
129
|
leaseOwner: run.leaseOwner,
|
|
106
|
-
heartbeatAt: run.heartbeatAt,
|
|
107
|
-
lastProgressAt: run.lastProgressAt,
|
|
130
|
+
heartbeatAt: dateToIso(run.heartbeatAt),
|
|
131
|
+
lastProgressAt: dateToIso(run.lastProgressAt),
|
|
108
132
|
lastProgressMessage: run.lastProgressMessage,
|
|
109
133
|
currentActivity: run.currentActivity,
|
|
110
134
|
error: run.error,
|
|
@@ -161,6 +185,27 @@ export interface BootstrapAgentTeamsResult {
|
|
|
161
185
|
restoredTeammates: string[];
|
|
162
186
|
}
|
|
163
187
|
|
|
188
|
+
export const TEAM_TOOL_NAMES = [
|
|
189
|
+
"team_spawn_teammate",
|
|
190
|
+
"team_shutdown_teammate",
|
|
191
|
+
"team_status",
|
|
192
|
+
"team_task",
|
|
193
|
+
"team_run_task",
|
|
194
|
+
"team_cancel_run",
|
|
195
|
+
"team_list_runs",
|
|
196
|
+
"team_await_runs",
|
|
197
|
+
"team_send_message",
|
|
198
|
+
"team_broadcast",
|
|
199
|
+
"team_read_mailbox",
|
|
200
|
+
"team_mission_log",
|
|
201
|
+
"team_cleanup",
|
|
202
|
+
"team_create_outcome",
|
|
203
|
+
"team_attach_outcome_fragment",
|
|
204
|
+
"team_review_outcome_fragment",
|
|
205
|
+
"team_finalize_outcome",
|
|
206
|
+
"team_list_outcomes",
|
|
207
|
+
] as const;
|
|
208
|
+
|
|
164
209
|
function spawnTeamTeammate(
|
|
165
210
|
options: Omit<CreateAgentTeamsToolsOptions, "requesterId" | "allowSpawn"> & {
|
|
166
211
|
requesterId: string;
|
|
@@ -279,7 +324,10 @@ export function createAgentTeamsTools(
|
|
|
279
324
|
}),
|
|
280
325
|
);
|
|
281
326
|
}
|
|
282
|
-
return
|
|
327
|
+
return validateWithZod(TeamSimpleAgentStatusToolResultSchema, {
|
|
328
|
+
agentId: validatedInput.agentId,
|
|
329
|
+
status: "spawned",
|
|
330
|
+
});
|
|
283
331
|
},
|
|
284
332
|
}) as Tool,
|
|
285
333
|
);
|
|
@@ -306,20 +354,26 @@ export function createAgentTeamsTools(
|
|
|
306
354
|
validatedInput.agentId,
|
|
307
355
|
validatedInput.reason,
|
|
308
356
|
);
|
|
309
|
-
return
|
|
357
|
+
return validateWithZod(TeamSimpleAgentStatusToolResultSchema, {
|
|
358
|
+
agentId: validatedInput.agentId,
|
|
359
|
+
status: "stopped",
|
|
360
|
+
});
|
|
310
361
|
},
|
|
311
362
|
}) as Tool,
|
|
312
363
|
);
|
|
313
364
|
|
|
314
365
|
tools.push(
|
|
315
|
-
createTool<TeamStatusInput,
|
|
366
|
+
createTool<TeamStatusInput, TeamStatusToolResult>({
|
|
316
367
|
name: "team_status",
|
|
317
368
|
description:
|
|
318
369
|
"Return a snapshot of team members, task counts, mailbox, and mission log stats.",
|
|
319
370
|
inputSchema: zodToJsonSchema(TeamStatusInputSchema),
|
|
320
371
|
execute: async (input) => {
|
|
321
372
|
validateWithZod(TeamStatusInputSchema, input);
|
|
322
|
-
return
|
|
373
|
+
return validateWithZod(
|
|
374
|
+
TeamStatusToolResultSchema,
|
|
375
|
+
options.runtime.getSnapshot(),
|
|
376
|
+
);
|
|
323
377
|
},
|
|
324
378
|
}) as Tool,
|
|
325
379
|
);
|
|
@@ -355,7 +409,7 @@ export function createAgentTeamsTools(
|
|
|
355
409
|
assignee: validatedInput.assignee,
|
|
356
410
|
createdBy: options.requesterId,
|
|
357
411
|
});
|
|
358
|
-
return {
|
|
412
|
+
return validateWithZod(TeamTaskToolResultSchema, {
|
|
359
413
|
action: "create",
|
|
360
414
|
taskId: task.id,
|
|
361
415
|
status: task.status,
|
|
@@ -365,28 +419,28 @@ export function createAgentTeamsTools(
|
|
|
365
419
|
note: `Ignored fields for action=create: ${ignoredFields.join(", ")}`,
|
|
366
420
|
}
|
|
367
421
|
: {}),
|
|
368
|
-
};
|
|
422
|
+
});
|
|
369
423
|
}
|
|
370
424
|
case "list":
|
|
371
|
-
return {
|
|
425
|
+
return validateWithZod(TeamTaskToolResultSchema, {
|
|
372
426
|
action: "list",
|
|
373
427
|
tasks: options.runtime.listTaskItems({
|
|
374
428
|
status: validatedInput.status,
|
|
375
429
|
assignee: validatedInput.assignee,
|
|
376
430
|
}),
|
|
377
|
-
};
|
|
431
|
+
});
|
|
378
432
|
case "claim": {
|
|
379
433
|
const task = options.runtime.claimTask(
|
|
380
434
|
validatedInput.taskId!,
|
|
381
435
|
options.requesterId,
|
|
382
436
|
);
|
|
383
|
-
return {
|
|
437
|
+
return validateWithZod(TeamTaskToolResultSchema, {
|
|
384
438
|
action: "claim",
|
|
385
439
|
taskId: task.id,
|
|
386
440
|
status: task.status,
|
|
387
441
|
nextStep:
|
|
388
442
|
"Task is now in_progress. Execute the work using team_run_task or your own tools, then call team_task with action=complete when done.",
|
|
389
|
-
};
|
|
443
|
+
});
|
|
390
444
|
}
|
|
391
445
|
case "complete": {
|
|
392
446
|
const task = options.runtime.completeTask(
|
|
@@ -394,11 +448,11 @@ export function createAgentTeamsTools(
|
|
|
394
448
|
options.requesterId,
|
|
395
449
|
validatedInput.summary!,
|
|
396
450
|
);
|
|
397
|
-
return {
|
|
451
|
+
return validateWithZod(TeamTaskToolResultSchema, {
|
|
398
452
|
action: "complete",
|
|
399
453
|
taskId: task.id,
|
|
400
454
|
status: task.status,
|
|
401
|
-
};
|
|
455
|
+
});
|
|
402
456
|
}
|
|
403
457
|
case "block": {
|
|
404
458
|
const task = options.runtime.blockTask(
|
|
@@ -406,11 +460,11 @@ export function createAgentTeamsTools(
|
|
|
406
460
|
options.requesterId,
|
|
407
461
|
validatedInput.reason!,
|
|
408
462
|
);
|
|
409
|
-
return {
|
|
463
|
+
return validateWithZod(TeamTaskToolResultSchema, {
|
|
410
464
|
action: "block",
|
|
411
465
|
taskId: task.id,
|
|
412
466
|
status: task.status,
|
|
413
|
-
};
|
|
467
|
+
});
|
|
414
468
|
}
|
|
415
469
|
}
|
|
416
470
|
},
|
|
@@ -419,20 +473,11 @@ export function createAgentTeamsTools(
|
|
|
419
473
|
|
|
420
474
|
// Track in-flight sync runs per agent for dedup
|
|
421
475
|
// (Claude sometimes emits duplicate tool_use blocks in a single response;
|
|
422
|
-
//
|
|
423
|
-
const pendingSyncRuns = new
|
|
476
|
+
// duplicate sync calls should await the first dispatched run)
|
|
477
|
+
const pendingSyncRuns = new Map<string, Promise<TeamRunTaskToolResult>>();
|
|
424
478
|
|
|
425
479
|
tools.push(
|
|
426
|
-
createTool<
|
|
427
|
-
TeamRunTaskInput,
|
|
428
|
-
{
|
|
429
|
-
agentId: string;
|
|
430
|
-
mode: "sync" | "async";
|
|
431
|
-
runId?: string;
|
|
432
|
-
text?: string;
|
|
433
|
-
iterations?: number;
|
|
434
|
-
}
|
|
435
|
-
>({
|
|
480
|
+
createTool<TeamRunTaskInput, TeamRunTaskToolResult>({
|
|
436
481
|
name: "team_run_task",
|
|
437
482
|
description:
|
|
438
483
|
"Route a delegated task to a teammate. Choose sync (wait) or async (run in background).",
|
|
@@ -450,42 +495,51 @@ export function createAgentTeamsTools(
|
|
|
450
495
|
validatedInput.continueConversation || undefined,
|
|
451
496
|
},
|
|
452
497
|
);
|
|
453
|
-
return {
|
|
498
|
+
return validateWithZod(TeamRunTaskToolResultSchema, {
|
|
454
499
|
agentId: validatedInput.agentId,
|
|
455
500
|
mode: "async",
|
|
501
|
+
status: "queued",
|
|
502
|
+
dispatched: true,
|
|
503
|
+
message: `Task dispatched to ${validatedInput.agentId} and queued as ${run.id}.`,
|
|
456
504
|
runId: run.id,
|
|
457
|
-
};
|
|
505
|
+
});
|
|
458
506
|
}
|
|
459
507
|
|
|
460
|
-
|
|
461
|
-
//
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
validatedInput.agentId,
|
|
472
|
-
validatedInput.task,
|
|
473
|
-
{
|
|
474
|
-
taskId: validatedInput.taskId || undefined,
|
|
475
|
-
fromAgentId: options.requesterId,
|
|
476
|
-
continueConversation:
|
|
477
|
-
validatedInput.continueConversation || undefined,
|
|
478
|
-
},
|
|
479
|
-
);
|
|
480
|
-
return {
|
|
481
|
-
agentId: validatedInput.agentId,
|
|
482
|
-
mode: "sync",
|
|
483
|
-
text: result.text,
|
|
484
|
-
iterations: result.iterations,
|
|
485
|
-
};
|
|
486
|
-
} finally {
|
|
487
|
-
pendingSyncRuns.delete(validatedInput.agentId);
|
|
508
|
+
// Deduplication guard: collapse a duplicate sync call for the same
|
|
509
|
+
// agent onto the first in-flight dispatch in this parallel tool-call batch.
|
|
510
|
+
const pendingRun = pendingSyncRuns.get(validatedInput.agentId);
|
|
511
|
+
if (pendingRun) {
|
|
512
|
+
const result = await pendingRun;
|
|
513
|
+
return validateWithZod(TeamRunTaskToolResultSchema, {
|
|
514
|
+
...result,
|
|
515
|
+
status: "joined",
|
|
516
|
+
deduped: true,
|
|
517
|
+
message: `Task for ${validatedInput.agentId} was already dispatched in this tool batch; joined the existing in-flight run.`,
|
|
518
|
+
});
|
|
488
519
|
}
|
|
520
|
+
const runPromise = options.runtime
|
|
521
|
+
.routeToTeammate(validatedInput.agentId, validatedInput.task, {
|
|
522
|
+
taskId: validatedInput.taskId || undefined,
|
|
523
|
+
fromAgentId: options.requesterId,
|
|
524
|
+
continueConversation:
|
|
525
|
+
validatedInput.continueConversation || undefined,
|
|
526
|
+
})
|
|
527
|
+
.then((result) =>
|
|
528
|
+
validateWithZod(TeamRunTaskToolResultSchema, {
|
|
529
|
+
agentId: validatedInput.agentId,
|
|
530
|
+
mode: "sync" as const,
|
|
531
|
+
status: "running" as const,
|
|
532
|
+
dispatched: true,
|
|
533
|
+
message: `Task dispatched to ${validatedInput.agentId} and completed in sync mode.`,
|
|
534
|
+
text: result.text,
|
|
535
|
+
iterations: result.iterations,
|
|
536
|
+
}),
|
|
537
|
+
)
|
|
538
|
+
.finally(() => {
|
|
539
|
+
pendingSyncRuns.delete(validatedInput.agentId);
|
|
540
|
+
});
|
|
541
|
+
pendingSyncRuns.set(validatedInput.agentId, runPromise);
|
|
542
|
+
return await runPromise;
|
|
489
543
|
},
|
|
490
544
|
}) as Tool,
|
|
491
545
|
);
|
|
@@ -501,7 +555,10 @@ export function createAgentTeamsTools(
|
|
|
501
555
|
validatedInput.runId,
|
|
502
556
|
validatedInput.reason,
|
|
503
557
|
);
|
|
504
|
-
return
|
|
558
|
+
return validateWithZod(TeamCancelRunToolResultSchema, {
|
|
559
|
+
runId: run.id,
|
|
560
|
+
status: run.status,
|
|
561
|
+
});
|
|
505
562
|
},
|
|
506
563
|
}) as Tool,
|
|
507
564
|
);
|
|
@@ -513,9 +570,12 @@ export function createAgentTeamsTools(
|
|
|
513
570
|
"List teammate runs started with team_run_task in async mode, including live activity/progress fields when available.",
|
|
514
571
|
inputSchema: zodToJsonSchema(TeamListRunsInputSchema),
|
|
515
572
|
execute: async (input) =>
|
|
516
|
-
|
|
517
|
-
.
|
|
518
|
-
.
|
|
573
|
+
validateWithZod(
|
|
574
|
+
TeamRunToolSummarySchema.array(),
|
|
575
|
+
options.runtime
|
|
576
|
+
.listRuns(validateWithZod(TeamListRunsInputSchema, input))
|
|
577
|
+
.map(summarizeRun),
|
|
578
|
+
),
|
|
519
579
|
}) as Tool,
|
|
520
580
|
);
|
|
521
581
|
|
|
@@ -531,7 +591,7 @@ export function createAgentTeamsTools(
|
|
|
531
591
|
if (validatedInput.runId) {
|
|
532
592
|
const run = await options.runtime.awaitRun(validatedInput.runId);
|
|
533
593
|
assertAwaitedRunSucceeded(run);
|
|
534
|
-
return summarizeRun(run);
|
|
594
|
+
return validateWithZod(TeamRunToolSummarySchema, summarizeRun(run));
|
|
535
595
|
}
|
|
536
596
|
const runs = await options.runtime.awaitAllRuns();
|
|
537
597
|
const failedRuns = runs.filter((run) =>
|
|
@@ -548,7 +608,10 @@ export function createAgentTeamsTools(
|
|
|
548
608
|
`One or more runs did not complete successfully: ${details}`,
|
|
549
609
|
);
|
|
550
610
|
}
|
|
551
|
-
return
|
|
611
|
+
return validateWithZod(
|
|
612
|
+
TeamRunToolSummarySchema.array(),
|
|
613
|
+
runs.map(summarizeRun),
|
|
614
|
+
);
|
|
552
615
|
},
|
|
553
616
|
}) as Tool,
|
|
554
617
|
);
|
|
@@ -570,7 +633,10 @@ export function createAgentTeamsTools(
|
|
|
570
633
|
validatedInput.body,
|
|
571
634
|
validatedInput.taskId ?? undefined,
|
|
572
635
|
);
|
|
573
|
-
return
|
|
636
|
+
return validateWithZod(TeamSendMessageToolResultSchema, {
|
|
637
|
+
id: message.id,
|
|
638
|
+
toAgentId: message.toAgentId,
|
|
639
|
+
});
|
|
574
640
|
},
|
|
575
641
|
}) as Tool,
|
|
576
642
|
);
|
|
@@ -590,16 +656,15 @@ export function createAgentTeamsTools(
|
|
|
590
656
|
taskId: validatedInput.taskId ?? undefined,
|
|
591
657
|
},
|
|
592
658
|
);
|
|
593
|
-
return {
|
|
659
|
+
return validateWithZod(TeamBroadcastToolResultSchema, {
|
|
660
|
+
delivered: messages.length,
|
|
661
|
+
});
|
|
594
662
|
},
|
|
595
663
|
}) as Tool,
|
|
596
664
|
);
|
|
597
665
|
|
|
598
666
|
tools.push(
|
|
599
|
-
createTool<
|
|
600
|
-
TeamReadMailboxInput,
|
|
601
|
-
ReturnType<AgentTeamsRuntime["listMailbox"]>
|
|
602
|
-
>({
|
|
667
|
+
createTool<TeamReadMailboxInput, TeamMailboxMessageToolResult[]>({
|
|
603
668
|
name: "team_read_mailbox",
|
|
604
669
|
description: "Read the current agent mailbox.",
|
|
605
670
|
inputSchema: zodToJsonSchema(TeamReadMailboxInputSchema),
|
|
@@ -608,10 +673,13 @@ export function createAgentTeamsTools(
|
|
|
608
673
|
TeamReadMailboxInputSchema,
|
|
609
674
|
input,
|
|
610
675
|
);
|
|
611
|
-
return
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
676
|
+
return validateWithZod(
|
|
677
|
+
TeamMailboxMessageToolResultSchema.array(),
|
|
678
|
+
options.runtime.listMailbox(options.requesterId, {
|
|
679
|
+
unreadOnly: validatedInput.unreadOnly,
|
|
680
|
+
markRead: true,
|
|
681
|
+
}),
|
|
682
|
+
);
|
|
615
683
|
},
|
|
616
684
|
}) as Tool,
|
|
617
685
|
);
|
|
@@ -636,7 +704,9 @@ export function createAgentTeamsTools(
|
|
|
636
704
|
: undefined,
|
|
637
705
|
nextAction: validatedInput.nextAction || undefined,
|
|
638
706
|
});
|
|
639
|
-
return {
|
|
707
|
+
return validateWithZod(TeamMissionLogToolResultSchema, {
|
|
708
|
+
id: entry.id,
|
|
709
|
+
});
|
|
640
710
|
},
|
|
641
711
|
}) as Tool,
|
|
642
712
|
);
|
|
@@ -653,13 +723,15 @@ export function createAgentTeamsTools(
|
|
|
653
723
|
throw new Error("Only the lead agent can run cleanup.");
|
|
654
724
|
}
|
|
655
725
|
options.runtime.cleanup();
|
|
656
|
-
return {
|
|
726
|
+
return validateWithZod(TeamCleanupToolResultSchema, {
|
|
727
|
+
status: "cleaned",
|
|
728
|
+
});
|
|
657
729
|
},
|
|
658
730
|
}) as Tool,
|
|
659
731
|
);
|
|
660
732
|
|
|
661
733
|
tools.push(
|
|
662
|
-
createTool<TeamCreateOutcomeInput,
|
|
734
|
+
createTool<TeamCreateOutcomeInput, TeamCreateOutcomeToolResult>({
|
|
663
735
|
name: "team_create_outcome",
|
|
664
736
|
description: "Create a converged team outcome.",
|
|
665
737
|
inputSchema: zodToJsonSchema(TeamCreateOutcomeInputSchema),
|
|
@@ -673,11 +745,11 @@ export function createAgentTeamsTools(
|
|
|
673
745
|
requiredSections: validatedInput.requiredSections,
|
|
674
746
|
createdBy: options.requesterId,
|
|
675
747
|
});
|
|
676
|
-
return {
|
|
748
|
+
return validateWithZod(TeamCreateOutcomeToolResultSchema, {
|
|
677
749
|
outcomeId: outcome.id,
|
|
678
750
|
status: outcome.status,
|
|
679
751
|
requiredSections: outcome.requiredSections,
|
|
680
|
-
};
|
|
752
|
+
});
|
|
681
753
|
},
|
|
682
754
|
}) as Tool,
|
|
683
755
|
);
|
|
@@ -702,7 +774,10 @@ export function createAgentTeamsTools(
|
|
|
702
774
|
sourceRunId: validatedInput.sourceRunId || undefined,
|
|
703
775
|
content: validatedInput.content,
|
|
704
776
|
});
|
|
705
|
-
return
|
|
777
|
+
return validateWithZod(TeamOutcomeFragmentToolResultSchema, {
|
|
778
|
+
fragmentId: fragment.id,
|
|
779
|
+
status: fragment.status,
|
|
780
|
+
});
|
|
706
781
|
},
|
|
707
782
|
}) as Tool,
|
|
708
783
|
);
|
|
@@ -725,7 +800,10 @@ export function createAgentTeamsTools(
|
|
|
725
800
|
reviewedBy: options.requesterId,
|
|
726
801
|
approved: validatedInput.approved,
|
|
727
802
|
});
|
|
728
|
-
return
|
|
803
|
+
return validateWithZod(TeamOutcomeFragmentToolResultSchema, {
|
|
804
|
+
fragmentId: fragment.id,
|
|
805
|
+
status: fragment.status,
|
|
806
|
+
});
|
|
729
807
|
},
|
|
730
808
|
}) as Tool,
|
|
731
809
|
);
|
|
@@ -744,23 +822,26 @@ export function createAgentTeamsTools(
|
|
|
744
822
|
const outcome = options.runtime.finalizeOutcome(
|
|
745
823
|
validatedInput.outcomeId,
|
|
746
824
|
);
|
|
747
|
-
return
|
|
825
|
+
return validateWithZod(TeamFinalizeOutcomeToolResultSchema, {
|
|
826
|
+
outcomeId: outcome.id,
|
|
827
|
+
status: outcome.status,
|
|
828
|
+
});
|
|
748
829
|
},
|
|
749
830
|
},
|
|
750
831
|
) as Tool,
|
|
751
832
|
);
|
|
752
833
|
|
|
753
834
|
tools.push(
|
|
754
|
-
createTool<
|
|
755
|
-
TeamListOutcomesInput,
|
|
756
|
-
ReturnType<AgentTeamsRuntime["listOutcomes"]>
|
|
757
|
-
>({
|
|
835
|
+
createTool<TeamListOutcomesInput, TeamOutcomeToolResult[]>({
|
|
758
836
|
name: "team_list_outcomes",
|
|
759
837
|
description: "List team outcomes.",
|
|
760
838
|
inputSchema: zodToJsonSchema(TeamListOutcomesInputSchema),
|
|
761
839
|
execute: async (input) => {
|
|
762
840
|
validateWithZod(TeamListOutcomesInputSchema, input);
|
|
763
|
-
return
|
|
841
|
+
return validateWithZod(
|
|
842
|
+
TeamOutcomeToolResultSchema.array(),
|
|
843
|
+
options.runtime.listOutcomes(),
|
|
844
|
+
);
|
|
764
845
|
},
|
|
765
846
|
}) as Tool,
|
|
766
847
|
);
|
|
@@ -335,12 +335,6 @@ export interface DefaultToolsConfig {
|
|
|
335
335
|
*/
|
|
336
336
|
skillsTimeoutMs?: number;
|
|
337
337
|
|
|
338
|
-
/**
|
|
339
|
-
* Timeout for ask_followup_question operations in milliseconds
|
|
340
|
-
* @default 15000
|
|
341
|
-
*/
|
|
342
|
-
askQuestionTimeoutMs?: number;
|
|
343
|
-
|
|
344
338
|
/**
|
|
345
339
|
* Timeout for submit_and_exit operations in milliseconds
|
|
346
340
|
* @default 15000
|