@0xmaxma/claude-gateway 1.8.14 → 2.0.1
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 +28 -1613
- package/config.template.json +7 -1
- package/dist/agent/runner.d.ts +419 -0
- package/dist/agent/runner.d.ts.map +1 -1
- package/dist/agent/runner.js +736 -24
- package/dist/agent/runner.js.map +1 -1
- package/dist/agent/skill-learning/index.d.ts +6 -4
- package/dist/agent/skill-learning/index.d.ts.map +1 -1
- package/dist/agent/skill-learning/index.js +3 -3
- package/dist/agent/skill-learning/index.js.map +1 -1
- package/dist/agent/skill-learning/notifier.d.ts +3 -4
- package/dist/agent/skill-learning/notifier.d.ts.map +1 -1
- package/dist/agent/skill-learning/notifier.js +15 -13
- package/dist/agent/skill-learning/notifier.js.map +1 -1
- package/dist/agent/skill-learning/reviewer.d.ts.map +1 -1
- package/dist/agent/skill-learning/reviewer.js +3 -1
- package/dist/agent/skill-learning/reviewer.js.map +1 -1
- package/dist/api/connectors-router.d.ts.map +1 -1
- package/dist/api/connectors-router.js +110 -4
- package/dist/api/connectors-router.js.map +1 -1
- package/dist/api/gateway-router.d.ts +1 -0
- package/dist/api/gateway-router.d.ts.map +1 -1
- package/dist/api/gateway-router.js +13 -1
- package/dist/api/gateway-router.js.map +1 -1
- package/dist/api/line-webhook-router.d.ts +2 -2
- package/dist/api/line-webhook-router.d.ts.map +1 -1
- package/dist/api/line-webhook-router.js +264 -230
- package/dist/api/line-webhook-router.js.map +1 -1
- package/dist/api/router.d.ts.map +1 -1
- package/dist/api/router.js +162 -10
- package/dist/api/router.js.map +1 -1
- package/dist/api/share-router.d.ts.map +1 -1
- package/dist/api/share-router.js +29 -10
- package/dist/api/share-router.js.map +1 -1
- package/dist/api/slack-client.d.ts +2 -0
- package/dist/api/slack-client.d.ts.map +1 -1
- package/dist/api/slack-client.js +6 -2
- package/dist/api/slack-client.js.map +1 -1
- package/dist/api/slack-webhook-router.d.ts +3 -0
- package/dist/api/slack-webhook-router.d.ts.map +1 -1
- package/dist/api/slack-webhook-router.js +226 -131
- package/dist/api/slack-webhook-router.js.map +1 -1
- package/dist/api/voice-router.d.ts +21 -0
- package/dist/api/voice-router.d.ts.map +1 -0
- package/dist/api/voice-router.js +372 -0
- package/dist/api/voice-router.js.map +1 -0
- package/dist/api/voice-settings-router.d.ts +5 -0
- package/dist/api/voice-settings-router.d.ts.map +1 -0
- package/dist/api/voice-settings-router.js +318 -0
- package/dist/api/voice-settings-router.js.map +1 -0
- package/dist/apps/agent-container-migration.d.ts +11 -0
- package/dist/apps/agent-container-migration.d.ts.map +1 -0
- package/dist/apps/agent-container-migration.js +85 -0
- package/dist/apps/agent-container-migration.js.map +1 -0
- package/dist/apps/installer.d.ts +1 -1
- package/dist/apps/installer.d.ts.map +1 -1
- package/dist/apps/installer.js +2 -1
- package/dist/apps/installer.js.map +1 -1
- package/dist/cli/commands/tasks.d.ts +5 -0
- package/dist/cli/commands/tasks.d.ts.map +1 -0
- package/dist/cli/commands/tasks.js +92 -0
- package/dist/cli/commands/tasks.js.map +1 -0
- package/dist/cli/http-client.d.ts +2 -0
- package/dist/cli/http-client.d.ts.map +1 -1
- package/dist/cli/http-client.js +8 -3
- package/dist/cli/http-client.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +5 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/config-write-lock.d.ts +2 -0
- package/dist/config/config-write-lock.d.ts.map +1 -1
- package/dist/config/config-write-lock.js +5 -0
- package/dist/config/config-write-lock.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +87 -2
- package/dist/config/loader.js.map +1 -1
- package/dist/config/migrator.d.ts.map +1 -1
- package/dist/config/migrator.js +12 -1
- package/dist/config/migrator.js.map +1 -1
- package/dist/config/watcher.d.ts.map +1 -1
- package/dist/config/watcher.js +6 -0
- package/dist/config/watcher.js.map +1 -1
- package/dist/connectors/resolve.d.ts.map +1 -1
- package/dist/connectors/resolve.js +3 -1
- package/dist/connectors/resolve.js.map +1 -1
- package/dist/connectors/types.d.ts +8 -0
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/cron/manager.d.ts.map +1 -1
- package/dist/cron/manager.js +21 -2
- package/dist/cron/manager.js.map +1 -1
- package/dist/discord/receiver.d.ts +2 -1
- package/dist/discord/receiver.d.ts.map +1 -1
- package/dist/discord/receiver.js +5 -1
- package/dist/discord/receiver.js.map +1 -1
- package/dist/history/db.d.ts +3 -0
- package/dist/history/db.d.ts.map +1 -1
- package/dist/history/db.js +21 -1
- package/dist/history/db.js.map +1 -1
- package/dist/history/types.d.ts +2 -0
- package/dist/history/types.d.ts.map +1 -1
- package/dist/index.js +48 -9
- package/dist/index.js.map +1 -1
- package/dist/orchestration/bounded-queue.d.ts +15 -0
- package/dist/orchestration/bounded-queue.d.ts.map +1 -0
- package/dist/orchestration/bounded-queue.js +58 -0
- package/dist/orchestration/bounded-queue.js.map +1 -0
- package/dist/orchestration/bridge.d.ts +55 -0
- package/dist/orchestration/bridge.d.ts.map +1 -0
- package/dist/orchestration/bridge.js +234 -0
- package/dist/orchestration/bridge.js.map +1 -0
- package/dist/orchestration/browser-routing.d.ts +7 -0
- package/dist/orchestration/browser-routing.d.ts.map +1 -0
- package/dist/orchestration/browser-routing.js +22 -0
- package/dist/orchestration/browser-routing.js.map +1 -0
- package/dist/orchestration/capabilities.d.ts +49 -0
- package/dist/orchestration/capabilities.d.ts.map +1 -0
- package/dist/orchestration/capabilities.js +417 -0
- package/dist/orchestration/capabilities.js.map +1 -0
- package/dist/orchestration/capacity.d.ts +14 -0
- package/dist/orchestration/capacity.d.ts.map +1 -0
- package/dist/orchestration/capacity.js +52 -0
- package/dist/orchestration/capacity.js.map +1 -0
- package/dist/orchestration/channel-activity.d.ts +21 -0
- package/dist/orchestration/channel-activity.d.ts.map +1 -0
- package/dist/orchestration/channel-activity.js +72 -0
- package/dist/orchestration/channel-activity.js.map +1 -0
- package/dist/orchestration/channel-controls.d.ts +32 -0
- package/dist/orchestration/channel-controls.d.ts.map +1 -0
- package/dist/orchestration/channel-controls.js +105 -0
- package/dist/orchestration/channel-controls.js.map +1 -0
- package/dist/orchestration/channel-input-media.d.ts +11 -0
- package/dist/orchestration/channel-input-media.d.ts.map +1 -0
- package/dist/orchestration/channel-input-media.js +54 -0
- package/dist/orchestration/channel-input-media.js.map +1 -0
- package/dist/orchestration/channel-media.d.ts +4 -0
- package/dist/orchestration/channel-media.d.ts.map +1 -0
- package/dist/orchestration/channel-media.js +70 -0
- package/dist/orchestration/channel-media.js.map +1 -0
- package/dist/orchestration/channel-speech.d.ts +7 -0
- package/dist/orchestration/channel-speech.d.ts.map +1 -0
- package/dist/orchestration/channel-speech.js +65 -0
- package/dist/orchestration/channel-speech.js.map +1 -0
- package/dist/orchestration/cli-skills.d.ts +12 -0
- package/dist/orchestration/cli-skills.d.ts.map +1 -0
- package/dist/orchestration/cli-skills.js +132 -0
- package/dist/orchestration/cli-skills.js.map +1 -0
- package/dist/orchestration/config.d.ts +260 -0
- package/dist/orchestration/config.d.ts.map +1 -0
- package/dist/orchestration/config.js +110 -0
- package/dist/orchestration/config.js.map +1 -0
- package/dist/orchestration/container.d.ts +21 -0
- package/dist/orchestration/container.d.ts.map +1 -0
- package/dist/orchestration/container.js +195 -0
- package/dist/orchestration/container.js.map +1 -0
- package/dist/orchestration/control-delivery.d.ts +5 -0
- package/dist/orchestration/control-delivery.d.ts.map +1 -0
- package/dist/orchestration/control-delivery.js +50 -0
- package/dist/orchestration/control-delivery.js.map +1 -0
- package/dist/orchestration/conversation-intake.d.ts +32 -0
- package/dist/orchestration/conversation-intake.d.ts.map +1 -0
- package/dist/orchestration/conversation-intake.js +92 -0
- package/dist/orchestration/conversation-intake.js.map +1 -0
- package/dist/orchestration/decisions.d.ts +27 -0
- package/dist/orchestration/decisions.d.ts.map +1 -0
- package/dist/orchestration/decisions.js +151 -0
- package/dist/orchestration/decisions.js.map +1 -0
- package/dist/orchestration/delivery.d.ts +34 -0
- package/dist/orchestration/delivery.d.ts.map +1 -0
- package/dist/orchestration/delivery.js +235 -0
- package/dist/orchestration/delivery.js.map +1 -0
- package/dist/orchestration/display-stream.d.ts +4 -0
- package/dist/orchestration/display-stream.d.ts.map +1 -0
- package/dist/orchestration/display-stream.js +77 -0
- package/dist/orchestration/display-stream.js.map +1 -0
- package/dist/orchestration/events.d.ts +30 -0
- package/dist/orchestration/events.d.ts.map +1 -0
- package/dist/orchestration/events.js +65 -0
- package/dist/orchestration/events.js.map +1 -0
- package/dist/orchestration/execution-observation.d.ts +38 -0
- package/dist/orchestration/execution-observation.d.ts.map +1 -0
- package/dist/orchestration/execution-observation.js +25 -0
- package/dist/orchestration/execution-observation.js.map +1 -0
- package/dist/orchestration/file-delivery.d.ts +16 -0
- package/dist/orchestration/file-delivery.d.ts.map +1 -0
- package/dist/orchestration/file-delivery.js +139 -0
- package/dist/orchestration/file-delivery.js.map +1 -0
- package/dist/orchestration/gateway-config.d.ts +17 -0
- package/dist/orchestration/gateway-config.d.ts.map +1 -0
- package/dist/orchestration/gateway-config.js +128 -0
- package/dist/orchestration/gateway-config.js.map +1 -0
- package/dist/orchestration/history.d.ts +13 -0
- package/dist/orchestration/history.d.ts.map +1 -0
- package/dist/orchestration/history.js +48 -0
- package/dist/orchestration/history.js.map +1 -0
- package/dist/orchestration/identity.d.ts +6 -0
- package/dist/orchestration/identity.d.ts.map +1 -0
- package/dist/orchestration/identity.js +13 -0
- package/dist/orchestration/identity.js.map +1 -0
- package/dist/orchestration/inference-errors.d.ts +3 -0
- package/dist/orchestration/inference-errors.d.ts.map +1 -0
- package/dist/orchestration/inference-errors.js +16 -0
- package/dist/orchestration/inference-errors.js.map +1 -0
- package/dist/orchestration/input-images.d.ts +12 -0
- package/dist/orchestration/input-images.d.ts.map +1 -0
- package/dist/orchestration/input-images.js +66 -0
- package/dist/orchestration/input-images.js.map +1 -0
- package/dist/orchestration/instance-lock.d.ts +5 -0
- package/dist/orchestration/instance-lock.d.ts.map +1 -0
- package/dist/orchestration/instance-lock.js +33 -0
- package/dist/orchestration/instance-lock.js.map +1 -0
- package/dist/orchestration/line-loading.d.ts +21 -0
- package/dist/orchestration/line-loading.d.ts.map +1 -0
- package/dist/orchestration/line-loading.js +89 -0
- package/dist/orchestration/line-loading.js.map +1 -0
- package/dist/orchestration/media.d.ts +3 -0
- package/dist/orchestration/media.d.ts.map +1 -0
- package/dist/orchestration/media.js +46 -0
- package/dist/orchestration/media.js.map +1 -0
- package/dist/orchestration/migrations/schema.d.ts +3 -0
- package/dist/orchestration/migrations/schema.d.ts.map +1 -0
- package/dist/orchestration/migrations/schema.js +80 -0
- package/dist/orchestration/migrations/schema.js.map +1 -0
- package/dist/orchestration/notification-mailbox.d.ts +5 -0
- package/dist/orchestration/notification-mailbox.d.ts.map +1 -0
- package/dist/orchestration/notification-mailbox.js +29 -0
- package/dist/orchestration/notification-mailbox.js.map +1 -0
- package/dist/orchestration/process-activity.d.ts +23 -0
- package/dist/orchestration/process-activity.d.ts.map +1 -0
- package/dist/orchestration/process-activity.js +95 -0
- package/dist/orchestration/process-activity.js.map +1 -0
- package/dist/orchestration/process-supervisor.d.ts +15 -0
- package/dist/orchestration/process-supervisor.d.ts.map +1 -0
- package/dist/orchestration/process-supervisor.js +92 -0
- package/dist/orchestration/process-supervisor.js.map +1 -0
- package/dist/orchestration/process-turn.d.ts +35 -0
- package/dist/orchestration/process-turn.d.ts.map +1 -0
- package/dist/orchestration/process-turn.js +246 -0
- package/dist/orchestration/process-turn.js.map +1 -0
- package/dist/orchestration/progress-review.d.ts +28 -0
- package/dist/orchestration/progress-review.d.ts.map +1 -0
- package/dist/orchestration/progress-review.js +48 -0
- package/dist/orchestration/progress-review.js.map +1 -0
- package/dist/orchestration/recovery.d.ts +8 -0
- package/dist/orchestration/recovery.d.ts.map +1 -0
- package/dist/orchestration/recovery.js +35 -0
- package/dist/orchestration/recovery.js.map +1 -0
- package/dist/orchestration/reply-context.d.ts +7 -0
- package/dist/orchestration/reply-context.d.ts.map +1 -0
- package/dist/orchestration/reply-context.js +54 -0
- package/dist/orchestration/reply-context.js.map +1 -0
- package/dist/orchestration/runtime.d.ts +237 -0
- package/dist/orchestration/runtime.d.ts.map +1 -0
- package/dist/orchestration/runtime.js +1031 -0
- package/dist/orchestration/runtime.js.map +1 -0
- package/dist/orchestration/skills.d.ts +17 -0
- package/dist/orchestration/skills.d.ts.map +1 -0
- package/dist/orchestration/skills.js +32 -0
- package/dist/orchestration/skills.js.map +1 -0
- package/dist/orchestration/source-policy.d.ts +6 -0
- package/dist/orchestration/source-policy.d.ts.map +1 -0
- package/dist/orchestration/source-policy.js +16 -0
- package/dist/orchestration/source-policy.js.map +1 -0
- package/dist/orchestration/speech.d.ts +24 -0
- package/dist/orchestration/speech.d.ts.map +1 -0
- package/dist/orchestration/speech.js +61 -0
- package/dist/orchestration/speech.js.map +1 -0
- package/dist/orchestration/stop-controls.d.ts +30 -0
- package/dist/orchestration/stop-controls.d.ts.map +1 -0
- package/dist/orchestration/stop-controls.js +79 -0
- package/dist/orchestration/stop-controls.js.map +1 -0
- package/dist/orchestration/store.d.ts +92 -0
- package/dist/orchestration/store.d.ts.map +1 -0
- package/dist/orchestration/store.js +326 -0
- package/dist/orchestration/store.js.map +1 -0
- package/dist/orchestration/task-controls.d.ts +172 -0
- package/dist/orchestration/task-controls.d.ts.map +1 -0
- package/dist/orchestration/task-controls.js +59 -0
- package/dist/orchestration/task-controls.js.map +1 -0
- package/dist/orchestration/task-files.d.ts +29 -0
- package/dist/orchestration/task-files.d.ts.map +1 -0
- package/dist/orchestration/task-files.js +200 -0
- package/dist/orchestration/task-files.js.map +1 -0
- package/dist/orchestration/task-questions.d.ts +26 -0
- package/dist/orchestration/task-questions.d.ts.map +1 -0
- package/dist/orchestration/task-questions.js +160 -0
- package/dist/orchestration/task-questions.js.map +1 -0
- package/dist/orchestration/task-report.d.ts +7 -0
- package/dist/orchestration/task-report.d.ts.map +1 -0
- package/dist/orchestration/task-report.js +33 -0
- package/dist/orchestration/task-report.js.map +1 -0
- package/dist/orchestration/tasks/checkpoint-hook.d.ts +19 -0
- package/dist/orchestration/tasks/checkpoint-hook.d.ts.map +1 -0
- package/dist/orchestration/tasks/checkpoint-hook.js +49 -0
- package/dist/orchestration/tasks/checkpoint-hook.js.map +1 -0
- package/dist/orchestration/tasks/cleanup.d.ts +18 -0
- package/dist/orchestration/tasks/cleanup.d.ts.map +1 -0
- package/dist/orchestration/tasks/cleanup.js +113 -0
- package/dist/orchestration/tasks/cleanup.js.map +1 -0
- package/dist/orchestration/tasks/driver.d.ts +23 -0
- package/dist/orchestration/tasks/driver.d.ts.map +1 -0
- package/dist/orchestration/tasks/driver.js +209 -0
- package/dist/orchestration/tasks/driver.js.map +1 -0
- package/dist/orchestration/tasks/failure.d.ts +5 -0
- package/dist/orchestration/tasks/failure.d.ts.map +1 -0
- package/dist/orchestration/tasks/failure.js +17 -0
- package/dist/orchestration/tasks/failure.js.map +1 -0
- package/dist/orchestration/tasks/pool.d.ts +18 -0
- package/dist/orchestration/tasks/pool.d.ts.map +1 -0
- package/dist/orchestration/tasks/pool.js +73 -0
- package/dist/orchestration/tasks/pool.js.map +1 -0
- package/dist/orchestration/tasks/scheduler.d.ts +38 -0
- package/dist/orchestration/tasks/scheduler.d.ts.map +1 -0
- package/dist/orchestration/tasks/scheduler.js +160 -0
- package/dist/orchestration/tasks/scheduler.js.map +1 -0
- package/dist/orchestration/tasks/service.d.ts +114 -0
- package/dist/orchestration/tasks/service.d.ts.map +1 -0
- package/dist/orchestration/tasks/service.js +760 -0
- package/dist/orchestration/tasks/service.js.map +1 -0
- package/dist/orchestration/tasks/shared-workspace.d.ts +25 -0
- package/dist/orchestration/tasks/shared-workspace.d.ts.map +1 -0
- package/dist/orchestration/tasks/shared-workspace.js +162 -0
- package/dist/orchestration/tasks/shared-workspace.js.map +1 -0
- package/dist/orchestration/tasks/task-directive.d.ts +6 -0
- package/dist/orchestration/tasks/task-directive.d.ts.map +1 -0
- package/dist/orchestration/tasks/task-directive.js +41 -0
- package/dist/orchestration/tasks/task-directive.js.map +1 -0
- package/dist/orchestration/tasks/timing.d.ts +15 -0
- package/dist/orchestration/tasks/timing.d.ts.map +1 -0
- package/dist/orchestration/tasks/timing.js +48 -0
- package/dist/orchestration/tasks/timing.js.map +1 -0
- package/dist/orchestration/tasks/tool-repetition.d.ts +3 -0
- package/dist/orchestration/tasks/tool-repetition.d.ts.map +1 -0
- package/dist/orchestration/tasks/tool-repetition.js +30 -0
- package/dist/orchestration/tasks/tool-repetition.js.map +1 -0
- package/dist/orchestration/tasks/workspace.d.ts +24 -0
- package/dist/orchestration/tasks/workspace.d.ts.map +1 -0
- package/dist/orchestration/tasks/workspace.js +147 -0
- package/dist/orchestration/tasks/workspace.js.map +1 -0
- package/dist/orchestration/telegram-speech.d.ts +17 -0
- package/dist/orchestration/telegram-speech.d.ts.map +1 -0
- package/dist/orchestration/telegram-speech.js +55 -0
- package/dist/orchestration/telegram-speech.js.map +1 -0
- package/dist/orchestration/telegram-tool-status.d.ts +23 -0
- package/dist/orchestration/telegram-tool-status.d.ts.map +1 -0
- package/dist/orchestration/telegram-tool-status.js +207 -0
- package/dist/orchestration/telegram-tool-status.js.map +1 -0
- package/dist/orchestration/telegram-voices.d.ts +42 -0
- package/dist/orchestration/telegram-voices.d.ts.map +1 -0
- package/dist/orchestration/telegram-voices.js +70 -0
- package/dist/orchestration/telegram-voices.js.map +1 -0
- package/dist/orchestration/tool-activity.d.ts +10 -0
- package/dist/orchestration/tool-activity.d.ts.map +1 -0
- package/dist/orchestration/tool-activity.js +38 -0
- package/dist/orchestration/tool-activity.js.map +1 -0
- package/dist/orchestration/types.d.ts +177 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +13 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/orchestration/voice-reply-policy.d.ts +8 -0
- package/dist/orchestration/voice-reply-policy.d.ts.map +1 -0
- package/dist/orchestration/voice-reply-policy.js +46 -0
- package/dist/orchestration/voice-reply-policy.js.map +1 -0
- package/dist/orchestration/worker-shares.d.ts +8 -0
- package/dist/orchestration/worker-shares.d.ts.map +1 -0
- package/dist/orchestration/worker-shares.js +59 -0
- package/dist/orchestration/worker-shares.js.map +1 -0
- package/dist/orchestration/workflow.d.ts +121 -0
- package/dist/orchestration/workflow.d.ts.map +1 -0
- package/dist/orchestration/workflow.js +69 -0
- package/dist/orchestration/workflow.js.map +1 -0
- package/dist/session/input-image.d.ts +10 -0
- package/dist/session/input-image.d.ts.map +1 -0
- package/dist/session/input-image.js +3 -0
- package/dist/session/input-image.js.map +1 -0
- package/dist/session/process.d.ts +15 -3
- package/dist/session/process.d.ts.map +1 -1
- package/dist/session/process.js +143 -35
- package/dist/session/process.js.map +1 -1
- package/dist/session/runtime-profile.d.ts +36 -0
- package/dist/session/runtime-profile.d.ts.map +1 -0
- package/dist/session/runtime-profile.js +63 -0
- package/dist/session/runtime-profile.js.map +1 -0
- package/dist/session/store.d.ts.map +1 -1
- package/dist/session/store.js +23 -1
- package/dist/session/store.js.map +1 -1
- package/dist/share/share-store.d.ts +3 -1
- package/dist/share/share-store.d.ts.map +1 -1
- package/dist/share/share-store.js +13 -2
- package/dist/share/share-store.js.map +1 -1
- package/dist/shared/line-request-order.d.ts +2 -0
- package/dist/shared/line-request-order.d.ts.map +1 -0
- package/dist/shared/line-request-order.js +16 -0
- package/dist/shared/line-request-order.js.map +1 -0
- package/dist/shared/task-elapsed.d.ts +3 -0
- package/dist/shared/task-elapsed.d.ts.map +1 -0
- package/dist/shared/task-elapsed.js +12 -0
- package/dist/shared/task-elapsed.js.map +1 -0
- package/dist/shared/task-updated-time.d.ts +3 -0
- package/dist/shared/task-updated-time.d.ts.map +1 -0
- package/dist/shared/task-updated-time.js +15 -0
- package/dist/shared/task-updated-time.js.map +1 -0
- package/dist/skills/loader.d.ts +2 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js.map +1 -1
- package/dist/telegram/chunks.d.ts +19 -0
- package/dist/telegram/chunks.d.ts.map +1 -0
- package/dist/telegram/chunks.js +129 -0
- package/dist/telegram/chunks.js.map +1 -0
- package/dist/telegram/markdown.d.ts.map +1 -1
- package/dist/telegram/markdown.js +18 -3
- package/dist/telegram/markdown.js.map +1 -1
- package/dist/telegram/receiver.d.ts +2 -1
- package/dist/telegram/receiver.d.ts.map +1 -1
- package/dist/telegram/receiver.js +6 -1
- package/dist/telegram/receiver.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/web-ui.d.ts.map +1 -1
- package/dist/ui/web-ui.js +31 -5
- package/dist/ui/web-ui.js.map +1 -1
- package/dist/voice/diagnostics.d.ts +29 -0
- package/dist/voice/diagnostics.d.ts.map +1 -0
- package/dist/voice/diagnostics.js +37 -0
- package/dist/voice/diagnostics.js.map +1 -0
- package/dist/voice/errors.d.ts +19 -0
- package/dist/voice/errors.d.ts.map +1 -0
- package/dist/voice/errors.js +133 -0
- package/dist/voice/errors.js.map +1 -0
- package/dist/voice/line-audio.d.ts +4 -0
- package/dist/voice/line-audio.d.ts.map +1 -0
- package/dist/voice/line-audio.js +27 -0
- package/dist/voice/line-audio.js.map +1 -0
- package/dist/voice/managed-quota.d.ts +5 -0
- package/dist/voice/managed-quota.d.ts.map +1 -0
- package/dist/voice/managed-quota.js +35 -0
- package/dist/voice/managed-quota.js.map +1 -0
- package/dist/voice/mp3.d.ts +3 -0
- package/dist/voice/mp3.d.ts.map +1 -0
- package/dist/voice/mp3.js +30 -0
- package/dist/voice/mp3.js.map +1 -0
- package/dist/voice/notes.d.ts +9 -0
- package/dist/voice/notes.d.ts.map +1 -0
- package/dist/voice/notes.js +68 -0
- package/dist/voice/notes.js.map +1 -0
- package/dist/voice/playback.d.ts +22 -0
- package/dist/voice/playback.d.ts.map +1 -0
- package/dist/voice/playback.js +52 -0
- package/dist/voice/playback.js.map +1 -0
- package/dist/voice/preview.d.ts +6 -0
- package/dist/voice/preview.d.ts.map +1 -0
- package/dist/voice/preview.js +44 -0
- package/dist/voice/preview.js.map +1 -0
- package/dist/voice/protocol.d.ts +10 -0
- package/dist/voice/protocol.d.ts.map +1 -0
- package/dist/voice/protocol.js +30 -0
- package/dist/voice/protocol.js.map +1 -0
- package/dist/voice/providers/cartesia-tts.d.ts +26 -0
- package/dist/voice/providers/cartesia-tts.d.ts.map +1 -0
- package/dist/voice/providers/cartesia-tts.js +95 -0
- package/dist/voice/providers/cartesia-tts.js.map +1 -0
- package/dist/voice/providers/deepgram-stt.d.ts +20 -0
- package/dist/voice/providers/deepgram-stt.d.ts.map +1 -0
- package/dist/voice/providers/deepgram-stt.js +66 -0
- package/dist/voice/providers/deepgram-stt.js.map +1 -0
- package/dist/voice/providers/elevenlabs-stt.d.ts +20 -0
- package/dist/voice/providers/elevenlabs-stt.d.ts.map +1 -0
- package/dist/voice/providers/elevenlabs-stt.js +92 -0
- package/dist/voice/providers/elevenlabs-stt.js.map +1 -0
- package/dist/voice/providers/elevenlabs-tts.d.ts +26 -0
- package/dist/voice/providers/elevenlabs-tts.d.ts.map +1 -0
- package/dist/voice/providers/elevenlabs-tts.js +82 -0
- package/dist/voice/providers/elevenlabs-tts.js.map +1 -0
- package/dist/voice/providers/encoded-audio-tts.d.ts +21 -0
- package/dist/voice/providers/encoded-audio-tts.d.ts.map +1 -0
- package/dist/voice/providers/encoded-audio-tts.js +175 -0
- package/dist/voice/providers/encoded-audio-tts.js.map +1 -0
- package/dist/voice/providers/fake.d.ts +39 -0
- package/dist/voice/providers/fake.d.ts.map +1 -0
- package/dist/voice/providers/fake.js +41 -0
- package/dist/voice/providers/fake.js.map +1 -0
- package/dist/voice/providers/gemini-live-stt.d.ts +21 -0
- package/dist/voice/providers/gemini-live-stt.d.ts.map +1 -0
- package/dist/voice/providers/gemini-live-stt.js +158 -0
- package/dist/voice/providers/gemini-live-stt.js.map +1 -0
- package/dist/voice/providers/gemini.d.ts +60 -0
- package/dist/voice/providers/gemini.d.ts.map +1 -0
- package/dist/voice/providers/gemini.js +124 -0
- package/dist/voice/providers/gemini.js.map +1 -0
- package/dist/voice/providers/model-ref.d.ts +9 -0
- package/dist/voice/providers/model-ref.d.ts.map +1 -0
- package/dist/voice/providers/model-ref.js +31 -0
- package/dist/voice/providers/model-ref.js.map +1 -0
- package/dist/voice/providers/openrouter.d.ts +39 -0
- package/dist/voice/providers/openrouter.d.ts.map +1 -0
- package/dist/voice/providers/openrouter.js +154 -0
- package/dist/voice/providers/openrouter.js.map +1 -0
- package/dist/voice/providers/paxalabs-stt.d.ts +12 -0
- package/dist/voice/providers/paxalabs-stt.d.ts.map +1 -0
- package/dist/voice/providers/paxalabs-stt.js +41 -0
- package/dist/voice/providers/paxalabs-stt.js.map +1 -0
- package/dist/voice/providers/paxalabs-tts.d.ts +23 -0
- package/dist/voice/providers/paxalabs-tts.d.ts.map +1 -0
- package/dist/voice/providers/paxalabs-tts.js +80 -0
- package/dist/voice/providers/paxalabs-tts.js.map +1 -0
- package/dist/voice/providers/recorded-stt.d.ts +34 -0
- package/dist/voice/providers/recorded-stt.d.ts.map +1 -0
- package/dist/voice/providers/recorded-stt.js +59 -0
- package/dist/voice/providers/recorded-stt.js.map +1 -0
- package/dist/voice/providers/registry.d.ts +10 -0
- package/dist/voice/providers/registry.d.ts.map +1 -0
- package/dist/voice/providers/registry.js +77 -0
- package/dist/voice/providers/registry.js.map +1 -0
- package/dist/voice/providers/socket.d.ts +10 -0
- package/dist/voice/providers/socket.d.ts.map +1 -0
- package/dist/voice/providers/socket.js +91 -0
- package/dist/voice/providers/socket.js.map +1 -0
- package/dist/voice/providers/upstream.d.ts +9 -0
- package/dist/voice/providers/upstream.d.ts.map +1 -0
- package/dist/voice/providers/upstream.js +51 -0
- package/dist/voice/providers/upstream.js.map +1 -0
- package/dist/voice/providers/voice-catalog.d.ts +17 -0
- package/dist/voice/providers/voice-catalog.d.ts.map +1 -0
- package/dist/voice/providers/voice-catalog.js +167 -0
- package/dist/voice/providers/voice-catalog.js.map +1 -0
- package/dist/voice/queue.d.ts +2 -0
- package/dist/voice/queue.d.ts.map +1 -0
- package/dist/voice/queue.js +6 -0
- package/dist/voice/queue.js.map +1 -0
- package/dist/voice/session.d.ts +86 -0
- package/dist/voice/session.d.ts.map +1 -0
- package/dist/voice/session.js +464 -0
- package/dist/voice/session.js.map +1 -0
- package/dist/voice/turn-manager.d.ts +27 -0
- package/dist/voice/turn-manager.d.ts.map +1 -0
- package/dist/voice/turn-manager.js +75 -0
- package/dist/voice/turn-manager.js.map +1 -0
- package/dist/voice/types.d.ts +78 -0
- package/dist/voice/types.d.ts.map +1 -0
- package/dist/voice/types.js +18 -0
- package/dist/voice/types.js.map +1 -0
- package/dist/voice/wav.d.ts +2 -0
- package/dist/voice/wav.d.ts.map +1 -0
- package/dist/voice/wav.js +21 -0
- package/dist/voice/wav.js.map +1 -0
- package/dist/wechat/ilink-client.d.ts +13 -0
- package/dist/wechat/ilink-client.d.ts.map +1 -1
- package/dist/wechat/ilink-client.js +19 -0
- package/dist/wechat/ilink-client.js.map +1 -1
- package/dist/whatsapp/manager.d.ts.map +1 -1
- package/dist/whatsapp/manager.js +51 -1
- package/dist/whatsapp/manager.js.map +1 -1
- package/mcp/capability-catalog.ts +206 -0
- package/mcp/modules.ts +56 -0
- package/mcp/server.ts +18 -37
- package/mcp/tools/browser/module.ts +1 -1
- package/mcp/tools/browser/skills/open-browser/SKILL.md +5 -3
- package/mcp/tools/discord/commands.ts +17 -1
- package/mcp/tools/discord/inbound.ts +11 -0
- package/mcp/tools/discord/module.ts +42 -2
- package/mcp/tools/discord/receiver-server.ts +10 -0
- package/mcp/tools/discord/types.ts +4 -1
- package/mcp/tools/image/module.ts +3 -1
- package/mcp/tools/receiver-spool.test.ts +28 -0
- package/mcp/tools/receiver-spool.ts +56 -0
- package/mcp/tools/share-file/module.ts +9 -1
- package/mcp/tools/shared/share-client.ts +19 -0
- package/mcp/tools/tasks/module.ts +35 -0
- package/mcp/tools/telegram/media-group.ts +21 -0
- package/mcp/tools/telegram/receiver-server.ts +246 -11
- package/mcp/tools/telegram/selection-confirmation.ts +20 -0
- package/mcp/tools/telegram/task-browser.ts +117 -0
- package/mcp/tools/telegram/task-detail.ts +36 -0
- package/mcp/tools/telegram/task-elapsed.ts +1 -0
- package/mcp/tools/telegram/typing.ts +6 -116
- package/mcp/tools/video/module.ts +1 -1
- package/mcp/types.ts +5 -0
- package/package.json +2 -1
- package/resource/claude_gateway.jpeg +0 -0
- package/scripts/orchestration/bench-store.cjs +30 -0
- package/scripts/orchestration/inspect.cjs +16 -0
- package/scripts/orchestration/probe-profile.cjs +67 -0
- package/scripts/orchestration/reconcile.cjs +21 -0
- package/scripts/orchestration/smoke-elevenlabs.cjs +90 -0
- package/scripts/orchestration/smoke-media.cjs +70 -0
- package/scripts/orchestration/smoke-text.cjs +101 -0
- package/scripts/orchestration/smoke-vision.cjs +49 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Real Claude CLI with a local image-service fixture; no live image-provider claim.
|
|
3
|
+
const { mkdtempSync, mkdirSync, writeFileSync, readFileSync } = require('node:fs');
|
|
4
|
+
const { tmpdir } = require('node:os');
|
|
5
|
+
const { join } = require('node:path');
|
|
6
|
+
const { execFileSync } = require('node:child_process');
|
|
7
|
+
const { randomUUID } = require('node:crypto');
|
|
8
|
+
const { createServer } = require('node:http');
|
|
9
|
+
const { once } = require('node:events');
|
|
10
|
+
const { loadWorkspace } = require('../../dist/agent/workspace-loader');
|
|
11
|
+
const { SessionStore } = require('../../dist/session/store');
|
|
12
|
+
const { SessionProcess } = require('../../dist/session/process');
|
|
13
|
+
const { HistoryDB } = require('../../dist/history/db');
|
|
14
|
+
const { AgentOrchestrationRuntime } = require('../../dist/orchestration/runtime');
|
|
15
|
+
(async () => {
|
|
16
|
+
const root = mkdtempSync(join(tmpdir(), 'gateway-orchestration-media-'));
|
|
17
|
+
const agentDir = join(root, 'agents', 'probe'), workspace = join(agentDir, 'workspace'), project = join(root, 'fixture-project');
|
|
18
|
+
mkdirSync(workspace, { recursive: true }); mkdirSync(project);
|
|
19
|
+
for (const [file, value] of Object.entries({ 'AGENTS.md': 'You are an engineering assistant. Follow the agent role.',
|
|
20
|
+
'IDENTITY.md': 'Name: CitrineHeron', 'SOUL.md': 'Be concise.', 'MEMORY.md': 'Project codeword: cobalt-orchid.' })) writeFileSync(join(workspace, file), value);
|
|
21
|
+
const loaded = await loadWorkspace(workspace); writeFileSync(join(workspace, 'CLAUDE.md'), loaded.systemPrompt);
|
|
22
|
+
const png = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+j3xkAAAAASUVORK5CYII=';
|
|
23
|
+
let generated = 0;
|
|
24
|
+
const imageServer = createServer(async (req, res) => {
|
|
25
|
+
for await (const _chunk of req) { /* consume the fixture request */ }
|
|
26
|
+
res.setHeader('Content-Type', 'application/json');
|
|
27
|
+
if (req.method === 'POST') { generated++; res.statusCode = 202; res.end(JSON.stringify({ task_id: 'fixture-job', status: 'queued' })); }
|
|
28
|
+
else if (req.url.includes('/jobs/')) res.end(JSON.stringify({ task_id: 'fixture-job', status: 'done', provider: 'fixture', model: 'fixture-image', images: [png] }));
|
|
29
|
+
else res.end(JSON.stringify({ data: [{ id: 'fixture-image', type: 'image', supports_image_ref: false }] }));
|
|
30
|
+
});
|
|
31
|
+
imageServer.listen(0, '127.0.0.1'); await once(imageServer, 'listening');
|
|
32
|
+
process.env.IMAGE_BASE_URL = `http://127.0.0.1:${imageServer.address().port}`;
|
|
33
|
+
process.env.IMAGE_API_KEY = 'fixture-only';
|
|
34
|
+
const agent = { id: 'probe', description: 'real CLI with fixture image provider', workspace, env: '', claude: { model: process.env.ORCHESTRATION_SMOKE_MODEL || 'sonnet', extraFlags: [] },
|
|
35
|
+
orchestration: { enabled: true, conversation: { decisionTimeoutMs: 45000 }, tasks: { defaultTimeoutMs: 120000 } } };
|
|
36
|
+
const gateway = { gateway: { orchestration: true, headless: true, logDir: join(root, 'logs'), timezone: 'UTC' }, agents: [agent] };
|
|
37
|
+
const sessions = new SessionStore(join(root, 'agents')), history = HistoryDB.forDir(agentDir, 'probe');
|
|
38
|
+
let runtime;
|
|
39
|
+
const host = { createAgentSession: async (sessionId, profile) => new SessionProcess(sessionId, 'api', agent, gateway, sessions, undefined, profile), releaseAgentSession: async (_, p) => p.stop() };
|
|
40
|
+
const report = { root, cli: execFileSync('claude', ['--version'], { encoding: 'utf8' }).trim(), events: [] };
|
|
41
|
+
try {
|
|
42
|
+
runtime = await AgentOrchestrationRuntime.open(agent, gateway, agentDir, sessions, history, host);
|
|
43
|
+
const scope = { agentId: 'probe', agentSessionId: randomUUID(), source: 'api', accountId: 'fixture', chatId: 'fixture', threadKey: '', principalId: 'fixture' };
|
|
44
|
+
const send = async text => {
|
|
45
|
+
const start = Date.now();
|
|
46
|
+
const answer = await runtime.send({ scope, text, requestId: randomUUID() }, { execute: true, writeMemory: false }, { timeoutMs: 45000 });
|
|
47
|
+
report.events.push({ answer, durationMs: Date.now() - start });
|
|
48
|
+
};
|
|
49
|
+
await send('Create exactly one media-worker task: use generate_image with model fixture-image and prompt a tiny red square, then task_stage_file on the generated file. Also create a document named receipt.txt containing exactly DOCUMENT_FIXTURE_OK and stage it. Do not use a project repository. Queue now and end the response.');
|
|
50
|
+
report.afterDispatch = runtime.store.all('SELECT state,snapshot_json FROM tasks').map(r => JSON.parse(r.snapshot_json));
|
|
51
|
+
await send('What is your name and our project codeword? Also report the current task status from the saved snapshot.');
|
|
52
|
+
report.afterFollowup = runtime.store.all('SELECT state,snapshot_json FROM tasks').map(r => JSON.parse(r.snapshot_json));
|
|
53
|
+
const deadline = Date.now() + 140000;
|
|
54
|
+
while (Date.now() < deadline) {
|
|
55
|
+
const task = runtime.store.all('SELECT snapshot_json FROM tasks').map(r => JSON.parse(r.snapshot_json))[0];
|
|
56
|
+
if (!task || ['completed', 'failed', 'needs_reconciliation', 'cancelled'].includes(task.state)) { report.task = task; break; }
|
|
57
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
58
|
+
}
|
|
59
|
+
await send('Report the task result and actual test evidence.');
|
|
60
|
+
const paths = runtime.responseFiles(scope.agentSessionId);
|
|
61
|
+
report.attachments = paths;
|
|
62
|
+
report.generatedCalls = generated;
|
|
63
|
+
const buffers = paths.map(ref => readFileSync(join(agentDir, ref)));
|
|
64
|
+
report.imageBytesMatch = buffers.some(bytes => bytes.equals(Buffer.from(png, 'base64')));
|
|
65
|
+
report.documentBytesMatch = buffers.some(bytes => bytes.toString().trim() === 'DOCUMENT_FIXTURE_OK');
|
|
66
|
+
report.pass = report.task?.state === 'completed' && paths.length === 2 && report.imageBytesMatch && report.documentBytesMatch && generated === 1;
|
|
67
|
+
} catch (error) { report.error = { message: error.message, code: error.code }; }
|
|
68
|
+
finally { await runtime?.close(); await new Promise(resolve => imageServer.close(resolve)); writeFileSync(join(root, 'report.json'), JSON.stringify(report, null, 2)); console.log(JSON.stringify(report, null, 2)); }
|
|
69
|
+
process.exit(report.pass ? 0 : 1);
|
|
70
|
+
})().catch(error => { console.error(error.message); process.exit(1); });
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Live, disposable text orchestration smoke. Requires an authenticated Claude CLI.
|
|
3
|
+
const { mkdtempSync, mkdirSync, writeFileSync, readFileSync } = require('node:fs');
|
|
4
|
+
const { tmpdir } = require('node:os');
|
|
5
|
+
const { join } = require('node:path');
|
|
6
|
+
const { execFileSync } = require('node:child_process');
|
|
7
|
+
const { randomUUID } = require('node:crypto');
|
|
8
|
+
const { loadWorkspace } = require('../../dist/agent/workspace-loader');
|
|
9
|
+
const { SessionStore } = require('../../dist/session/store');
|
|
10
|
+
const { SessionProcess } = require('../../dist/session/process');
|
|
11
|
+
const { HistoryDB } = require('../../dist/history/db');
|
|
12
|
+
const { loadSkills } = require('../../dist/skills/loader');
|
|
13
|
+
const { AgentOrchestrationRuntime } = require('../../dist/orchestration/runtime');
|
|
14
|
+
(async () => {
|
|
15
|
+
const root = mkdtempSync(join(tmpdir(), 'gateway-orchestration-live-'));
|
|
16
|
+
const agentDir = join(root, 'agents', 'probe'), workspace = join(agentDir, 'workspace'), project = join(root, 'fixture-project');
|
|
17
|
+
mkdirSync(workspace, { recursive: true }); mkdirSync(project);
|
|
18
|
+
for (const [file, value] of Object.entries({ 'AGENTS.md': 'You are an engineering assistant. Follow the agent role.',
|
|
19
|
+
'IDENTITY.md': 'Name: CitrineHeron', 'SOUL.md': 'Be concise.', 'MEMORY.md': 'Project codeword: cobalt-orchid.' })) writeFileSync(join(workspace, file), value);
|
|
20
|
+
const skillDir = join(workspace, 'skills', 'orchestration-proof'); mkdirSync(skillDir, { recursive: true });
|
|
21
|
+
writeFileSync(join(skillDir, 'SKILL.md'), '---\nname: orchestration-proof\ndescription: Verify an isolated worker skill invocation\n---\nUse Bash to write SKILL_EXECUTED_$ARGUMENTS into skill-proof.txt in your working directory. Stage that file with task_stage_file and report its contents. The arguments are $ARGUMENTS.');
|
|
22
|
+
const registry = loadSkills({ workspaceDir: workspace });
|
|
23
|
+
const loaded = await loadWorkspace(workspace); writeFileSync(join(workspace, 'CLAUDE.md'), loaded.systemPrompt);
|
|
24
|
+
execFileSync('git', ['init', '-q', project]);
|
|
25
|
+
writeFileSync(join(project, 'sum.js'), 'module.exports = (a, b) => a - b;\n');
|
|
26
|
+
writeFileSync(join(project, 'test.cjs'), "const assert = require('node:assert/strict'); assert.equal(require('./sum')(2, 3), 5); console.log('sum test passed');\n");
|
|
27
|
+
execFileSync('git', ['-C', project, 'add', '.']);
|
|
28
|
+
execFileSync('git', ['-C', project, '-c', 'user.name=Orchestration fixture', '-c', 'user.email=fixture@example.invalid', 'commit', '-qm', 'fixture']);
|
|
29
|
+
const agent = { id: 'probe', description: 'live smoke', workspace, env: '', claude: { model: process.env.ORCHESTRATION_SMOKE_MODEL || 'sonnet', extraFlags: [] },
|
|
30
|
+
orchestration: { enabled: true, conversation: { decisionTimeoutMs: 45000 }, tasks: { projectRoot: project, defaultTimeoutMs: 90000 } } };
|
|
31
|
+
const gateway = { gateway: { orchestration: true, headless: true, logDir: join(root, 'logs'), timezone: 'UTC' }, agents: [agent] };
|
|
32
|
+
const sessions = new SessionStore(join(root, 'agents')), history = HistoryDB.forDir(agentDir, 'probe');
|
|
33
|
+
let runtime;
|
|
34
|
+
const host = { skills: () => registry, createAgentSession: async (sessionId, profile) => new SessionProcess(sessionId, 'api', agent, gateway, sessions, undefined, profile), releaseAgentSession: async (_, p) => p.stop() };
|
|
35
|
+
const report = { root, cli: execFileSync('claude', ['--version'], { encoding: 'utf8' }).trim(), events: [] };
|
|
36
|
+
try {
|
|
37
|
+
runtime = await AgentOrchestrationRuntime.open(agent, gateway, agentDir, sessions, history, host);
|
|
38
|
+
const scope = { agentId: 'probe', agentSessionId: randomUUID(), source: 'api', accountId: 'fixture', chatId: 'fixture', threadKey: '', principalId: 'fixture' };
|
|
39
|
+
const send = async text => {
|
|
40
|
+
const start = Date.now();
|
|
41
|
+
const answer = await runtime.send({ scope, text, requestId: randomUUID() }, { execute: true, writeMemory: false }, { timeoutMs: 45000 });
|
|
42
|
+
report.events.push({ answer, durationMs: Date.now() - start });
|
|
43
|
+
};
|
|
44
|
+
await send('Create one task using default-worker: fix sum.js to add correctly, run node test.cjs, and report the diff and test output. Tell the worker to wait 12 seconds before editing so I can ask a follow-up. Queue it now and finish your response without waiting.');
|
|
45
|
+
report.afterDispatch = runtime.store.all('SELECT state,snapshot_json FROM tasks').map(r => JSON.parse(r.snapshot_json));
|
|
46
|
+
await send('What is your name and our project codeword? Also report the current task status from the saved snapshot.');
|
|
47
|
+
report.afterFollowup = runtime.store.all('SELECT state,snapshot_json FROM tasks').map(r => JSON.parse(r.snapshot_json));
|
|
48
|
+
const deadline = Date.now() + 100000;
|
|
49
|
+
while (Date.now() < deadline) {
|
|
50
|
+
const task = runtime.store.all('SELECT snapshot_json FROM tasks').map(r => JSON.parse(r.snapshot_json))[0];
|
|
51
|
+
if (!task || ['completed', 'failed', 'needs_reconciliation', 'cancelled'].includes(task.state)) { report.task = task; break; }
|
|
52
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
53
|
+
}
|
|
54
|
+
await send('Report the task result and actual test evidence.');
|
|
55
|
+
report.sourceProjectUnchanged = readFileSync(join(project, 'sum.js'), 'utf8').includes('a - b');
|
|
56
|
+
const resource = report.task && runtime.store.get('SELECT worktree_path FROM task_resources WHERE task_id=?', report.task.taskId);
|
|
57
|
+
if (resource) {
|
|
58
|
+
report.independentTestOutput = execFileSync(process.execPath, [join(resource.worktree_path, 'test.cjs')], { encoding: 'utf8', timeout: 10000 }).trim();
|
|
59
|
+
report.diff = execFileSync('git', ['-C', resource.worktree_path, 'diff', '--', 'sum.js'], { encoding: 'utf8' });
|
|
60
|
+
}
|
|
61
|
+
const skillStart = Date.now();
|
|
62
|
+
await send('/orchestration-proof 465');
|
|
63
|
+
const skillRow = runtime.store.get("SELECT snapshot_json FROM tasks WHERE json_extract(snapshot_json,'$.skill.name')='orchestration-proof'");
|
|
64
|
+
const skillTask = skillRow && JSON.parse(skillRow.snapshot_json);
|
|
65
|
+
report.skillAdmissionMs = Date.now() - skillStart;
|
|
66
|
+
await new Promise(resolve => setTimeout(resolve, 250));
|
|
67
|
+
report.skillStateBeforeFollowup = runtime.store.task(skillTask.taskId).state;
|
|
68
|
+
await send('While the skill runs, briefly confirm that you can still chat. Do not wait or dispatch more work.');
|
|
69
|
+
const skillDeadline = Date.now() + 100000;
|
|
70
|
+
while (skillTask && Date.now() < skillDeadline) {
|
|
71
|
+
report.skillTask = runtime.store.task(skillTask.taskId);
|
|
72
|
+
if (['completed', 'failed', 'needs_reconciliation', 'cancelled'].includes(report.skillTask.state)) break;
|
|
73
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
74
|
+
}
|
|
75
|
+
const skillResource = skillTask && runtime.store.get('SELECT worktree_path FROM task_resources WHERE task_id=?', skillTask.taskId);
|
|
76
|
+
report.skillFile = skillResource && readFileSync(join(skillResource.worktree_path, 'skill-proof.txt'), 'utf8').trim();
|
|
77
|
+
report.skillInvoked = Boolean(runtime.store.get("SELECT event_id FROM conversation_events WHERE type='task.skill_invoked' AND json_extract(payload_json,'$.task_id')=?", skillTask.taskId));
|
|
78
|
+
await send('Report the skill task result.');
|
|
79
|
+
await send('Please verify the isolated worker skill invocation with argument 466 and return the proof file. Use the installed skill that matches this request.');
|
|
80
|
+
const implicitRow = runtime.store.get("SELECT snapshot_json FROM tasks WHERE json_extract(snapshot_json,'$.skill.args')='466'");
|
|
81
|
+
if (!implicitRow) throw new Error('Natural-language request did not dispatch an installed skill');
|
|
82
|
+
const implicitId = JSON.parse(implicitRow.snapshot_json).taskId;
|
|
83
|
+
const implicitDeadline = Date.now() + 100000;
|
|
84
|
+
while (Date.now() < implicitDeadline) {
|
|
85
|
+
report.implicitSkillTask = runtime.store.task(implicitId);
|
|
86
|
+
if (['completed', 'failed', 'needs_reconciliation', 'cancelled'].includes(report.implicitSkillTask.state)) break;
|
|
87
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
88
|
+
}
|
|
89
|
+
const implicitResource = runtime.store.get('SELECT worktree_path FROM task_resources WHERE task_id=?', implicitId);
|
|
90
|
+
report.implicitSkillFile = implicitResource && readFileSync(join(implicitResource.worktree_path, 'skill-proof.txt'), 'utf8').trim();
|
|
91
|
+
report.implicitSkillInvoked = Boolean(runtime.store.get("SELECT event_id FROM conversation_events WHERE type='task.skill_invoked' AND json_extract(payload_json,'$.task_id')=?", implicitId));
|
|
92
|
+
const spoken = [];
|
|
93
|
+
const voice = runtime.submitInput({ scope, text: 'Explain the completed sum fix and the skill test in detail on screen: include code before and after and test evidence. In speech, briefly summarize the outcome in Thai. Do not rerun tasks.', modality: 'live_voice', ingressKey: 'voice-proof' }, { execute: false, writeMemory: false });
|
|
94
|
+
const consume = (async () => { for await (const chunk of voice.stream) spoken.push(chunk.text); })();
|
|
95
|
+
const display = await voice.response; await consume;
|
|
96
|
+
report.voiceSurfaces = { display, spoken: spoken.join('') };
|
|
97
|
+
report.pass = report.implicitSkillTask?.state === 'completed' && report.implicitSkillFile === 'SKILL_EXECUTED_466' && report.implicitSkillInvoked && display.length > spoken.join('').length && spoken.join('').length > 0 && spoken.join('').length <= 600 && report.skillTask?.state === 'completed' && report.skillFile === 'SKILL_EXECUTED_465' && report.skillInvoked && report.task?.state === 'completed' && report.afterDispatch.length === 1 && report.afterDispatch[0].state !== 'completed' && report.sourceProjectUnchanged && report.independentTestOutput === 'sum test passed' && Boolean(report.diff);
|
|
98
|
+
} catch (error) { report.error = { message: error.message, code: error.code }; }
|
|
99
|
+
finally { await runtime?.close(); writeFileSync(join(root, 'report.json'), JSON.stringify(report, null, 2)); console.log(JSON.stringify(report, null, 2)); }
|
|
100
|
+
process.exit(report.pass ? 0 : 1);
|
|
101
|
+
})().catch(error => { console.error(error.message); process.exit(1); });
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Disposable real-CLI vision + worker handoff probe. Supply an image containing
|
|
3
|
+
// a unique readable code and that expected code; neither code nor filename is in the prompt.
|
|
4
|
+
const { mkdtempSync, mkdirSync, writeFileSync, readFileSync, copyFileSync } = require('node:fs');
|
|
5
|
+
const { tmpdir } = require('node:os');
|
|
6
|
+
const { join } = require('node:path');
|
|
7
|
+
const { randomUUID } = require('node:crypto');
|
|
8
|
+
const assert = require('node:assert/strict');
|
|
9
|
+
const { SessionStore } = require('../../dist/session/store');
|
|
10
|
+
const { SessionProcess } = require('../../dist/session/process');
|
|
11
|
+
const { HistoryDB } = require('../../dist/history/db');
|
|
12
|
+
const { AgentOrchestrationRuntime } = require('../../dist/orchestration/runtime');
|
|
13
|
+
(async () => {
|
|
14
|
+
const [imagePath, expected] = process.argv.slice(2);
|
|
15
|
+
if (!imagePath || !expected) throw Error('Usage: smoke-vision.cjs IMAGE EXPECTED_CODE');
|
|
16
|
+
const root = mkdtempSync(join(tmpdir(), 'gateway-vision-'));
|
|
17
|
+
const agentsRoot = join(root, 'agents'), agentDir = join(agentsRoot, 'probe'), workspace = join(agentDir, 'workspace');
|
|
18
|
+
mkdirSync(workspace, { recursive: true }); mkdirSync(join(agentDir, 'media/c'), { recursive: true });
|
|
19
|
+
copyFileSync(imagePath, join(agentDir, 'media/c/image.png'));
|
|
20
|
+
writeFileSync(join(workspace, 'CLAUDE.md'), 'Be concise. Follow the orchestration role.');
|
|
21
|
+
const agent = { id: 'probe', workspace, env: '', description: 'Disposable vision probe', claude: { model: process.env.ORCHESTRATION_SMOKE_MODEL || 'sonnet', extraFlags: [] }, orchestration: { conversation: { decisionTimeoutMs: 60000 }, tasks: { defaultTimeoutMs: 90000 } } };
|
|
22
|
+
const gateway = { gateway: { orchestration: true, headless: true, logDir: join(root, 'logs'), timezone: 'UTC' }, agents: [agent] };
|
|
23
|
+
const sessions = new SessionStore(agentsRoot), history = HistoryDB.forDir(agentDir, 'probe');
|
|
24
|
+
const host = { createAgentSession: async (id, profile) => new SessionProcess(id, 'api', agent, gateway, sessions, undefined, profile), releaseAgentSession: async (_, p) => p.stop() };
|
|
25
|
+
let runtime;
|
|
26
|
+
try {
|
|
27
|
+
runtime = await AgentOrchestrationRuntime.open(agent, gateway, agentDir, sessions, history, host);
|
|
28
|
+
const scope = { agentId: 'probe', agentSessionId: randomUUID(), source: 'api', accountId: 'fixture', chatId: 'c', threadKey: '', principalId: 'fixture' };
|
|
29
|
+
const send = text => runtime.send({ scope, text, attachmentIds: ['media/c/image.png'], requestId: randomUUID() }, { execute: true, writeMemory: false }, { timeoutMs: 60000 });
|
|
30
|
+
const answer = await send('Read the code and describe the colored shapes in this image.');
|
|
31
|
+
assert(answer.includes(expected), answer);
|
|
32
|
+
assert.equal(runtime.store.get('SELECT COUNT(*) AS n FROM tasks').n, 0);
|
|
33
|
+
console.log(JSON.stringify({ phase: 'agent_reads_image', answer, tasks: 0 }));
|
|
34
|
+
const ack = await send('First inspect this image yourself, then ask a media-worker to write a file named vision-proof.txt containing the exact code shown. Tell it to verify the original image and stage the file. Include your visual observations in the task instructions.');
|
|
35
|
+
console.log(JSON.stringify({ phase: 'dispatch', ack }));
|
|
36
|
+
const deadline = Date.now() + 100000;
|
|
37
|
+
let task;
|
|
38
|
+
while (Date.now() < deadline) {
|
|
39
|
+
const row = runtime.store.get('SELECT snapshot_json FROM tasks ORDER BY created_at DESC LIMIT 1');
|
|
40
|
+
task = row && JSON.parse(row.snapshot_json);
|
|
41
|
+
if (task && ['completed', 'failed', 'cancelled', 'needs_reconciliation'].includes(task.state)) break;
|
|
42
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
43
|
+
}
|
|
44
|
+
assert.equal(task?.state, 'completed', JSON.stringify(task));
|
|
45
|
+
const files = runtime.store.all('SELECT path FROM task_files WHERE task_id=?', task.taskId);
|
|
46
|
+
assert(files.some(f => readFileSync(join(agentDir, f.path), 'utf8').includes(expected)), JSON.stringify(files));
|
|
47
|
+
console.log(JSON.stringify({ phase: 'worker_verified_original_and_produced_file', taskId: task.taskId, state: task.state, files, root }));
|
|
48
|
+
} finally { await runtime?.close(); history.db.close(); HistoryDB.evict(agentsRoot, 'probe'); }
|
|
49
|
+
})().catch(error => { console.error(error); process.exitCode = 1; });
|