@0xmaxma/claude-gateway 1.8.13 → 2.0.0
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 -1605
- package/config.template.json +7 -1
- package/dist/agent/runner.d.ts +394 -0
- package/dist/agent/runner.d.ts.map +1 -1
- package/dist/agent/runner.js +867 -38
- 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 +372 -11
- 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/api/wechat-access.d.ts +45 -0
- package/dist/api/wechat-access.d.ts.map +1 -0
- package/dist/api/wechat-access.js +48 -0
- package/dist/api/wechat-access.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 +12 -1
- package/dist/history/types.d.ts.map +1 -1
- package/dist/history/types.js +10 -1
- package/dist/history/types.js.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 +256 -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 +148 -0
- package/dist/orchestration/decisions.js.map +1 -0
- package/dist/orchestration/delivery.d.ts +30 -0
- package/dist/orchestration/delivery.d.ts.map +1 -0
- package/dist/orchestration/delivery.js +219 -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 +232 -0
- package/dist/orchestration/runtime.d.ts.map +1 -0
- package/dist/orchestration/runtime.js +962 -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 +86 -0
- package/dist/orchestration/store.d.ts.map +1 -0
- package/dist/orchestration/store.js +275 -0
- package/dist/orchestration/store.js.map +1 -0
- package/dist/orchestration/task-controls.d.ts +130 -0
- package/dist/orchestration/task-controls.d.ts.map +1 -0
- package/dist/orchestration/task-controls.js +55 -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-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 +109 -0
- package/dist/orchestration/tasks/service.d.ts.map +1 -0
- package/dist/orchestration/tasks/service.js +697 -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 +144 -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 +54 -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 +207 -0
- package/dist/wechat/ilink-client.d.ts.map +1 -0
- package/dist/wechat/ilink-client.js +660 -0
- package/dist/wechat/ilink-client.js.map +1 -0
- package/dist/wechat/manager.d.ts +93 -0
- package/dist/wechat/manager.d.ts.map +1 -0
- package/dist/wechat/manager.js +409 -0
- package/dist/wechat/manager.js.map +1 -0
- 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 -35
- 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 +232 -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/tools/wechat/client.ts +49 -0
- package/mcp/tools/wechat/module.ts +88 -0
- 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,78 @@
|
|
|
1
|
+
export interface AudioFormat {
|
|
2
|
+
encoding: 'pcm_s16le';
|
|
3
|
+
sampleRate: number;
|
|
4
|
+
channels: 1;
|
|
5
|
+
}
|
|
6
|
+
export type SttEvent = {
|
|
7
|
+
type: 'partial' | 'segment_final';
|
|
8
|
+
segmentId: string;
|
|
9
|
+
text: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'speech_start' | 'speech_end';
|
|
12
|
+
atMs: number;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'commit_done';
|
|
15
|
+
commitId: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'error';
|
|
18
|
+
code: string;
|
|
19
|
+
retryable: boolean;
|
|
20
|
+
};
|
|
21
|
+
export interface SttSession {
|
|
22
|
+
pushAudio(frame: Uint8Array): Promise<void>;
|
|
23
|
+
commitSegment(commitId: string): Promise<void>;
|
|
24
|
+
events: AsyncIterable<SttEvent>;
|
|
25
|
+
close(): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export interface SttProvider {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly capabilities: {
|
|
30
|
+
partials: boolean;
|
|
31
|
+
manualCommit: boolean;
|
|
32
|
+
speechActivityEvents: boolean;
|
|
33
|
+
mode?: 'realtime' | 'batch';
|
|
34
|
+
finalizationTimeoutMs?: number;
|
|
35
|
+
};
|
|
36
|
+
open(options: {
|
|
37
|
+
format: AudioFormat;
|
|
38
|
+
language?: string;
|
|
39
|
+
signal: AbortSignal;
|
|
40
|
+
}): Promise<SttSession>;
|
|
41
|
+
}
|
|
42
|
+
export interface TtsAudioChunk {
|
|
43
|
+
bytes: Uint8Array;
|
|
44
|
+
format: AudioFormat;
|
|
45
|
+
chunkSeq: number;
|
|
46
|
+
textEndOffset?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface TtsProvider {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly capabilities: {
|
|
51
|
+
textStreaming: boolean;
|
|
52
|
+
wordAlignment: boolean;
|
|
53
|
+
outputFormats: AudioFormat[];
|
|
54
|
+
};
|
|
55
|
+
synthesizeFile?(options: {
|
|
56
|
+
text: string;
|
|
57
|
+
voiceId: string;
|
|
58
|
+
signal: AbortSignal;
|
|
59
|
+
}): Promise<{
|
|
60
|
+
bytes: Uint8Array;
|
|
61
|
+
mime: 'audio/mpeg';
|
|
62
|
+
name: string;
|
|
63
|
+
}>;
|
|
64
|
+
synthesize(options: {
|
|
65
|
+
text: AsyncIterable<string>;
|
|
66
|
+
voiceId: string;
|
|
67
|
+
language?: string;
|
|
68
|
+
outputFormat: AudioFormat;
|
|
69
|
+
signal: AbortSignal;
|
|
70
|
+
}): AsyncIterable<TtsAudioChunk>;
|
|
71
|
+
}
|
|
72
|
+
export declare class VoiceError extends Error {
|
|
73
|
+
readonly code: string;
|
|
74
|
+
constructor(code: string);
|
|
75
|
+
}
|
|
76
|
+
export declare const PCM16: AudioFormat;
|
|
77
|
+
export declare function validateAudioFormat(format: AudioFormat): void;
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/voice/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAAG,QAAQ,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,CAAC,CAAC;CAAE;AACxF,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,SAAS,GAAG,eAAe,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,cAAc,GAAG,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AACxD,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AACD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE;QAAE,QAAQ,EAAE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,qBAAa,UAAW,SAAQ,KAAK;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAClC;AACD,eAAO,MAAM,KAAK,EAAE,WAAuE,CAAC;AAC5F,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAE7D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PCM16 = exports.VoiceError = void 0;
|
|
4
|
+
exports.validateAudioFormat = validateAudioFormat;
|
|
5
|
+
class VoiceError extends Error {
|
|
6
|
+
constructor(code) {
|
|
7
|
+
super(code);
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.name = 'VoiceError';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.VoiceError = VoiceError;
|
|
13
|
+
exports.PCM16 = { encoding: 'pcm_s16le', sampleRate: 16000, channels: 1 };
|
|
14
|
+
function validateAudioFormat(format) {
|
|
15
|
+
if (format.encoding !== 'pcm_s16le' || format.channels !== 1 || ![8000, 16000, 22050, 24000, 44100, 48000].includes(format.sampleRate))
|
|
16
|
+
throw new VoiceError('UNSUPPORTED_AUDIO_FORMAT');
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/voice/types.ts"],"names":[],"mappings":";;;AA4BA,kDAEC;AAND,MAAa,UAAW,SAAQ,KAAK;IACnC,YAAqB,IAAY;QAAI,KAAK,CAAC,IAAI,CAAC,CAAC;QAA5B,SAAI,GAAJ,IAAI,CAAQ;QAAiB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAAC,CAAC;CAC9E;AAFD,gCAEC;AACY,QAAA,KAAK,GAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AAC5F,SAAgB,mBAAmB,CAAC,MAAmB;IACrD,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,0BAA0B,CAAC,CAAC;AAC3L,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wav.d.ts","sourceRoot":"","sources":["../../src/voice/wav.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO5C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pcmToWav = pcmToWav;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
function pcmToWav(pcm) {
|
|
6
|
+
const header = Buffer.alloc(44);
|
|
7
|
+
header.write('RIFF');
|
|
8
|
+
header.writeUInt32LE(36 + pcm.length, 4);
|
|
9
|
+
header.write('WAVEfmt ', 8);
|
|
10
|
+
header.writeUInt32LE(16, 16);
|
|
11
|
+
header.writeUInt16LE(1, 20);
|
|
12
|
+
header.writeUInt16LE(1, 22);
|
|
13
|
+
header.writeUInt32LE(types_1.PCM16.sampleRate, 24);
|
|
14
|
+
header.writeUInt32LE(types_1.PCM16.sampleRate * 2, 28);
|
|
15
|
+
header.writeUInt16LE(2, 32);
|
|
16
|
+
header.writeUInt16LE(16, 34);
|
|
17
|
+
header.write('data', 36);
|
|
18
|
+
header.writeUInt32LE(pcm.length, 40);
|
|
19
|
+
return Buffer.concat([header, pcm]);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=wav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wav.js","sourceRoot":"","sources":["../../src/voice/wav.ts"],"names":[],"mappings":";;AACA,4BAOC;AARD,mCAAgC;AAChC,SAAgB,QAAQ,CAAC,GAAW;IAClC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAAC,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC5F,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvF,MAAM,CAAC,aAAa,CAAC,aAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,aAAa,CAAC,aAAK,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3F,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1H,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
export interface ILinkCredentials {
|
|
2
|
+
accountId: string;
|
|
3
|
+
token: string;
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ILinkQrSession {
|
|
7
|
+
/** Data URI (or remote image URL) to render as the login QR. */
|
|
8
|
+
qrDataUri: string;
|
|
9
|
+
/** Opaque handle to poll for this specific login attempt's completion. */
|
|
10
|
+
loginSessionId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ILinkLinkResult {
|
|
13
|
+
linked: boolean;
|
|
14
|
+
credentials?: ILinkCredentials;
|
|
15
|
+
/**
|
|
16
|
+
* The raw status string Tencent returned (`wait`/`scaned`/`confirmed`/
|
|
17
|
+
* `expired`/`need_verifycode`/`verify_code_blocked`/`scaned_but_redirect`/
|
|
18
|
+
* `binded_redirect`), surfaced purely for operational logging — nothing
|
|
19
|
+
* downstream branches on it besides `linked` above. Added after a live
|
|
20
|
+
* link attempt where the confirm button was tapped but nothing here ever
|
|
21
|
+
* saw `confirmed`, with zero visibility into which of these statuses it
|
|
22
|
+
* actually got stuck on.
|
|
23
|
+
*/
|
|
24
|
+
status?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ILinkUpdate {
|
|
27
|
+
/** iLink message id — used for at-least-once delivery de-duplication. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Sender's iLink user id. */
|
|
30
|
+
fromId: string;
|
|
31
|
+
/** Plain text body, when present. */
|
|
32
|
+
text?: string;
|
|
33
|
+
/** Best-effort display name, when iLink provides one. */
|
|
34
|
+
displayName?: string;
|
|
35
|
+
/** Server timestamp (ms since epoch), when provided. */
|
|
36
|
+
timestamp?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Conversation context token this specific message carries (Tencent's
|
|
39
|
+
* `WeixinMessage.context_token`) — established by an INBOUND message, not
|
|
40
|
+
* minted by sending one. Must be echoed on the next `sendText` call to
|
|
41
|
+
* this same sender. See this module's doc comment for why `sendText`
|
|
42
|
+
* itself no longer returns one.
|
|
43
|
+
*/
|
|
44
|
+
contextToken?: string;
|
|
45
|
+
/** Present when this message carries an inbound image (item type 2). Download+decrypt via `downloadWeixinImage()`. */
|
|
46
|
+
image?: ILinkImageRef;
|
|
47
|
+
/** Present when this message carries an inbound file (item type 4, e.g. a PDF). Download+decrypt via `downloadWeixinImage()`, same as an image. */
|
|
48
|
+
file?: ILinkFileRef;
|
|
49
|
+
reply?: {
|
|
50
|
+
messageId?: string;
|
|
51
|
+
text?: string;
|
|
52
|
+
image?: ILinkImageRef;
|
|
53
|
+
file?: ILinkFileRef;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Resolved download target for an inbound image, from `resolveWeixinImageRef()`. */
|
|
57
|
+
export interface ILinkImageRef {
|
|
58
|
+
url: string;
|
|
59
|
+
/** Absent means the bytes at `url` are already plaintext. */
|
|
60
|
+
aesKey?: Buffer;
|
|
61
|
+
/**
|
|
62
|
+
* Sender-declared plaintext byte count (`file_item.len` — files only, per
|
|
63
|
+
* protocol.md). When set and the decrypted buffer is longer than this,
|
|
64
|
+
* `downloadWeixinImage` keeps the trailing `expectedLength` bytes and
|
|
65
|
+
* drops the rest as a leading prefix — confirmed live 2026-09-11: a real
|
|
66
|
+
* decrypted PDF carried 3 extra bytes before its `%PDF-` header despite a
|
|
67
|
+
* byte-perfect key/cipher (images never show this, only files), so
|
|
68
|
+
* WeChat's file upload path evidently prepends a few bytes ahead of the
|
|
69
|
+
* real content that protocol.md doesn't document.
|
|
70
|
+
*/
|
|
71
|
+
expectedLength?: number;
|
|
72
|
+
}
|
|
73
|
+
export interface ILinkClient {
|
|
74
|
+
/** Start a fresh QR login flow. */
|
|
75
|
+
requestLinkQr(): Promise<ILinkQrSession>;
|
|
76
|
+
/** Poll whether a QR login attempt has been completed (scanned + confirmed). */
|
|
77
|
+
pollLinkStatus(loginSessionId: string): Promise<ILinkLinkResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Long-poll for new messages. Resolves with zero or more updates once
|
|
80
|
+
* either a message arrives or `timeoutSeconds` elapses (iLink's documented
|
|
81
|
+
* `getupdates` contract) — never rejects on a plain timeout, only on a real
|
|
82
|
+
* transport/auth failure.
|
|
83
|
+
*/
|
|
84
|
+
getUpdates(creds: ILinkCredentials, timeoutSeconds: number): Promise<ILinkUpdate[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Send a single already-chunked text message. `contextToken` is whatever
|
|
87
|
+
* the most recent INBOUND message from this recipient carried (undefined
|
|
88
|
+
* if they've never messaged first) — sending does not return a new one,
|
|
89
|
+
* per Tencent's documented `sendmessage` response (`{ret, errmsg}` only).
|
|
90
|
+
*/
|
|
91
|
+
sendText(creds: ILinkCredentials, toId: string, text: string, contextToken?: string): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Tell iLink's backend this channel client has started, before the first
|
|
94
|
+
* `getUpdates` call — confirmed via Tencent's own official client
|
|
95
|
+
* (`Tencent/openclaw-weixin`'s `src/channel.ts`, checked 2026-09-10): it
|
|
96
|
+
* calls this unconditionally before starting its poll loop, and
|
|
97
|
+
* protocol.md documents it as "notify the backend that the client
|
|
98
|
+
* started." This codebase never called it at all, which is the likely
|
|
99
|
+
* cause of `getUpdates` failing (Cloudflare 522/524) on the large
|
|
100
|
+
* majority of polls during live testing — never confirmed as THE fix
|
|
101
|
+
* (Tencent's own docs don't spell out what not calling it does), but it's
|
|
102
|
+
* a real gap versus the reference implementation, not a stretch. Failure
|
|
103
|
+
* here must never block startup — Tencent's own client only logs a
|
|
104
|
+
* warning and continues (see `notifyStart`'s call site in manager.ts).
|
|
105
|
+
*/
|
|
106
|
+
notifyStart(creds: ILinkCredentials): Promise<void>;
|
|
107
|
+
/** Counterpart to notifyStart, sent on channel stop. Same non-blocking contract. */
|
|
108
|
+
notifyStop(creds: ILinkCredentials): Promise<void>;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Plugin version as `0x00MMNNPP` (major/minor/patch, one byte each) rendered
|
|
112
|
+
* as a decimal string, per protocol.md's `iLink-App-ClientVersion` spec.
|
|
113
|
+
*/
|
|
114
|
+
export declare function encodeClientVersion(version: string): string;
|
|
115
|
+
/**
|
|
116
|
+
* Turn whatever `qrcode_img_content` actually is into a ready-to-`<img src>`
|
|
117
|
+
* PNG data URI. Confirmed shape (see module doc comment): a
|
|
118
|
+
* `liteapp.weixin.qq.com` URL that must itself be QR-encoded — it is data to
|
|
119
|
+
* scan, not a picture to show as-is.
|
|
120
|
+
*/
|
|
121
|
+
export declare function normalizeQrImage(content: string): Promise<string>;
|
|
122
|
+
interface WeixinMessageItem {
|
|
123
|
+
ref_msg?: {
|
|
124
|
+
svr_id?: string;
|
|
125
|
+
title?: string;
|
|
126
|
+
message_item?: WeixinMessageItem;
|
|
127
|
+
};
|
|
128
|
+
type: number;
|
|
129
|
+
text_item?: {
|
|
130
|
+
text: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Present on a type=2 (image) item. `aeskey` (raw 32 hex chars) takes
|
|
134
|
+
* precedence over `media.aes_key` (base64 of either 16 raw bytes or a
|
|
135
|
+
* 32-char hex string) per protocol.md — see `resolveWeixinImageRef`.
|
|
136
|
+
*/
|
|
137
|
+
image_item?: {
|
|
138
|
+
aeskey?: string;
|
|
139
|
+
media?: {
|
|
140
|
+
encrypt_query_param?: string;
|
|
141
|
+
aes_key?: string;
|
|
142
|
+
full_url?: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Present on a type=4 (file) item. Unlike `image_item`, protocol.md
|
|
147
|
+
* documents no top-level `aeskey` for files — the key comes from
|
|
148
|
+
* `media.aes_key` only. `file_name` is the attachment's real name
|
|
149
|
+
* (including extension), needed to stage it usefully.
|
|
150
|
+
*/
|
|
151
|
+
file_item?: {
|
|
152
|
+
file_name?: string;
|
|
153
|
+
/** Plaintext byte count, as a decimal string, per protocol.md. */
|
|
154
|
+
len?: string;
|
|
155
|
+
media?: {
|
|
156
|
+
encrypt_query_param?: string;
|
|
157
|
+
aes_key?: string;
|
|
158
|
+
full_url?: string;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/** Preserve the immediate quote only; nested quotes are not fresh user instructions. */
|
|
163
|
+
export declare function resolveWeixinReply(items: WeixinMessageItem[] | undefined): ILinkUpdate['reply'];
|
|
164
|
+
export declare function resolveWeixinImageRef(items: WeixinMessageItem[] | undefined): ILinkImageRef | undefined;
|
|
165
|
+
export interface ILinkFileRef extends ILinkImageRef {
|
|
166
|
+
/** Attachment's real filename (including extension), e.g. "report.pdf". */
|
|
167
|
+
fileName: string;
|
|
168
|
+
}
|
|
169
|
+
/** Resolve an inbound file item (type=4) — protocol.md has no top-level aeskey for files, only media.aes_key. */
|
|
170
|
+
export declare function resolveWeixinFileRef(items: WeixinMessageItem[] | undefined): ILinkFileRef | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* AES-128-ECB decrypt with PERMISSIVE PKCS#7 unpadding: if the trailing
|
|
173
|
+
* padding doesn't validate, return the padded bytes as-is instead of
|
|
174
|
+
* throwing. Mirrors `NousResearch/hermes-agent`'s `_aes128_ecb_decrypt`
|
|
175
|
+
* exactly (confirmed live 2026-09-11) — Node's built-in auto-unpad
|
|
176
|
+
* (`setAutoPadding(true)`) throws "bad decrypt" on the same real-world edge
|
|
177
|
+
* cases Hermes-agent's own implementation was written to tolerate.
|
|
178
|
+
*/
|
|
179
|
+
export declare function aes128EcbDecryptPermissive(ciphertext: Buffer, key: Buffer): Buffer;
|
|
180
|
+
export declare function downloadWeixinImage(ref: ILinkImageRef, opts?: {
|
|
181
|
+
timeoutMs?: number;
|
|
182
|
+
maxBytes?: number;
|
|
183
|
+
}): Promise<Buffer>;
|
|
184
|
+
/**
|
|
185
|
+
* Real implementation — talks to Tencent's iLink Bot API. See this module's
|
|
186
|
+
* doc comment for the two documented ambiguities (`qrcode_img_content`'s
|
|
187
|
+
* encoding, and the unhandled verification-code statuses) still to confirm
|
|
188
|
+
* against a real account.
|
|
189
|
+
*/
|
|
190
|
+
export declare function createILinkClient(baseUrl?: string, botAgent?: string): ILinkClient;
|
|
191
|
+
/**
|
|
192
|
+
* Local-testing-only fake client — no network calls, no real iLink account
|
|
193
|
+
* needed. Simulates a QR scan completing after a few polls, then occasionally
|
|
194
|
+
* delivers one fake inbound message (carrying its own fake `contextToken`,
|
|
195
|
+
* exactly like the real protocol) so the pending-sender/access-control UI
|
|
196
|
+
* has something to show. Never wired up by default — see
|
|
197
|
+
* `isWeChatILinkFakeEnabled()` and its call site in AgentRunner.
|
|
198
|
+
*
|
|
199
|
+
* NOT a substitute for the real API contract — exists purely so the apps/web
|
|
200
|
+
* card's UI/UX (QR render, link→linked transition, DM allowlist, disconnect)
|
|
201
|
+
* can be manually verified end-to-end without a real WeChat account.
|
|
202
|
+
*/
|
|
203
|
+
export declare function createFakeILinkClient(): ILinkClient;
|
|
204
|
+
/** Opt-in only, local dev/manual-testing use — see createFakeILinkClient's doc comment. */
|
|
205
|
+
export declare function isWeChatILinkFakeEnabled(): boolean;
|
|
206
|
+
export {};
|
|
207
|
+
//# sourceMappingURL=ilink-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ilink-client.d.ts","sourceRoot":"","sources":["../../src/wechat/ilink-client.ts"],"names":[],"mappings":"AAkDA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,EAAE,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,IAAI,CAAC,EAAE,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