@withbuddi/buddi 0.1.0-pre.20 → 0.1.0-pre.21
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/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/args.d.ts +6 -0
- package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/args.js +15 -0
- package/node_modules/@buddi/cli/dist/args.js.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.js +17 -0
- package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
- package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/main.js +7 -0
- package/node_modules/@buddi/cli/dist/main.js.map +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.js +33 -16
- package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/types.d.ts +17 -0
- package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.js +1 -0
- package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.js.map +1 -1
- package/node_modules/@buddi/core/dist/pages.d.ts +74 -0
- package/node_modules/@buddi/core/dist/pages.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages.js +27 -1
- package/node_modules/@buddi/core/dist/pages.js.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.d.ts +2 -2
- package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/version.d.ts +1 -1
- package/node_modules/@buddi/core/dist/plugin/version.js +1 -1
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts +8 -0
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/provider-accounts.js +8 -0
- package/node_modules/@buddi/core/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.d.ts +11 -0
- package/node_modules/@buddi/core/dist/surfaces.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.js +4 -0
- package/node_modules/@buddi/core/dist/surfaces.js.map +1 -1
- package/node_modules/@buddi/core/migrations/048_surface_chat_voice.sql +13 -0
- package/node_modules/@buddi/core/migrations/049_surface_chat_voice_form.sql +8 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/agents-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.js +5 -3
- package/node_modules/@buddi/gateway/dist/agents-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/session.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/session.js +2 -2
- package/node_modules/@buddi/gateway/dist/chat/session.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/usage.d.ts +16 -0
- package/node_modules/@buddi/gateway/dist/chat/usage.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/usage.js +53 -11
- package/node_modules/@buddi/gateway/dist/chat/usage.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.d.ts +1 -0
- package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.js +1 -0
- package/node_modules/@buddi/gateway/dist/index.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts +4 -0
- package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.js +3 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/speech-cli.d.ts +43 -0
- package/node_modules/@buddi/gateway/dist/speech-cli.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/speech-cli.js +105 -0
- package/node_modules/@buddi/gateway/dist/speech-cli.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/api.d.ts +10 -0
- package/node_modules/@buddi/gateway/dist/telegram/api.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/api.js +12 -0
- package/node_modules/@buddi/gateway/dist/telegram/api.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.d.ts +2 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js +4 -2
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/main.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/main.js +10 -2
- package/node_modules/@buddi/gateway/dist/telegram/main.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts +25 -0
- package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.js +212 -10
- package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/voice.d.ts +112 -0
- package/node_modules/@buddi/gateway/dist/telegram/voice.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/voice.js +220 -0
- package/node_modules/@buddi/gateway/dist/telegram/voice.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/chat.d.ts +31 -8
- package/node_modules/@buddi/gateway/dist/web/chat.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/chat.js +3 -2
- package/node_modules/@buddi/gateway/dist/web/chat.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts +13 -2
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js +24 -3
- package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.d.ts +15 -12
- package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.js +9 -10
- package/node_modules/@buddi/gateway/dist/web/read.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +13 -0
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/speech.d.ts +47 -0
- package/node_modules/@buddi/gateway/dist/web/speech.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/speech.js +83 -0
- package/node_modules/@buddi/gateway/dist/web/speech.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/stream.d.ts +0 -24
- package/node_modules/@buddi/gateway/dist/web/stream.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/stream.js +26 -2
- package/node_modules/@buddi/gateway/dist/web/stream.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/usage-view.d.ts +15 -0
- package/node_modules/@buddi/gateway/dist/web/usage-view.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/usage-view.js +20 -0
- package/node_modules/@buddi/gateway/dist/web/usage-view.js.map +1 -0
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts +18 -0
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.js +65 -13
- package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/codex-direct.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/codex-direct.js +11 -3
- package/node_modules/@buddi/runtime/dist/codex-direct.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/context-window.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/context-window.js +13 -4
- package/node_modules/@buddi/runtime/dist/context-window.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/loop.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/loop.js +6 -0
- package/node_modules/@buddi/runtime/dist/loop.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.d.ts +16 -4
- package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.js +23 -4
- package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/provider-models.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/provider-models.js +5 -1
- package/node_modules/@buddi/runtime/dist/provider-models.js.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/computer.d.ts +53 -1
- package/node_modules/@buddi/tool-browser/dist/computer.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/computer.js +154 -5
- package/node_modules/@buddi/tool-browser/dist/computer.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +20 -3
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +170 -5
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +9 -1
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +14 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js +28 -5
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.d.ts +11 -0
- package/node_modules/@buddi/tool-browser/dist/types.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js +16 -3
- package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
- package/node_modules/@buddi/tool-browser/package.json +1 -1
- package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
- package/node_modules/imapflow/CHANGELOG.md +29 -0
- package/node_modules/imapflow/dist/cjs/commands/append.js +12 -12
- package/node_modules/imapflow/dist/cjs/commands/authenticate.d.ts +3 -8
- package/node_modules/imapflow/dist/cjs/commands/close.js +2 -1
- package/node_modules/imapflow/dist/cjs/commands/copy.js +4 -4
- package/node_modules/imapflow/dist/cjs/commands/create.js +2 -3
- package/node_modules/imapflow/dist/cjs/commands/delete.js +4 -4
- package/node_modules/imapflow/dist/cjs/commands/expunge.js +8 -5
- package/node_modules/imapflow/dist/cjs/commands/fetch.js +12 -10
- package/node_modules/imapflow/dist/cjs/commands/idle.js +6 -2
- package/node_modules/imapflow/dist/cjs/commands/list.js +22 -18
- package/node_modules/imapflow/dist/cjs/commands/move.js +11 -6
- package/node_modules/imapflow/dist/cjs/commands/namespace.js +1 -1
- package/node_modules/imapflow/dist/cjs/commands/quota.js +10 -9
- package/node_modules/imapflow/dist/cjs/commands/rename.js +4 -4
- package/node_modules/imapflow/dist/cjs/commands/search.js +7 -8
- package/node_modules/imapflow/dist/cjs/commands/select.js +12 -9
- package/node_modules/imapflow/dist/cjs/commands/status.js +11 -11
- package/node_modules/imapflow/dist/cjs/commands/store.js +5 -5
- package/node_modules/imapflow/dist/cjs/commands/subscribe.js +2 -17
- package/node_modules/imapflow/dist/cjs/commands/subscription.d.ts +10 -0
- package/node_modules/imapflow/dist/cjs/commands/subscription.js +29 -0
- package/node_modules/imapflow/dist/cjs/commands/unsubscribe.js +2 -17
- package/node_modules/imapflow/dist/cjs/download.d.ts +22 -0
- package/node_modules/imapflow/dist/cjs/download.js +588 -0
- package/node_modules/imapflow/dist/cjs/errors.d.ts +50 -1
- package/node_modules/imapflow/dist/cjs/errors.js +53 -1
- package/node_modules/imapflow/dist/cjs/handler/imap-compiler.js +1 -1
- package/node_modules/imapflow/dist/cjs/handler/imap-stream.d.ts +13 -2
- package/node_modules/imapflow/dist/cjs/handler/imap-stream.js +51 -30
- package/node_modules/imapflow/dist/cjs/handler/parser-instance.js +2 -2
- package/node_modules/imapflow/dist/cjs/handler/token-parser.js +15 -9
- package/node_modules/imapflow/dist/cjs/imap-flow.d.ts +30 -84
- package/node_modules/imapflow/dist/cjs/imap-flow.js +282 -734
- package/node_modules/imapflow/dist/cjs/jp-decoder.js +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.js +3 -3
- package/node_modules/imapflow/dist/cjs/search-compiler.js +5 -12
- package/node_modules/imapflow/dist/cjs/tools.d.ts +52 -11
- package/node_modules/imapflow/dist/cjs/tools.js +86 -23
- package/node_modules/imapflow/dist/cjs/types.d.ts +30 -16
- package/node_modules/imapflow/dist/esm/commands/append.js +13 -13
- package/node_modules/imapflow/dist/esm/commands/authenticate.d.ts +3 -8
- package/node_modules/imapflow/dist/esm/commands/close.js +2 -1
- package/node_modules/imapflow/dist/esm/commands/copy.js +5 -5
- package/node_modules/imapflow/dist/esm/commands/create.js +3 -4
- package/node_modules/imapflow/dist/esm/commands/delete.js +5 -5
- package/node_modules/imapflow/dist/esm/commands/expunge.js +9 -6
- package/node_modules/imapflow/dist/esm/commands/fetch.js +13 -11
- package/node_modules/imapflow/dist/esm/commands/idle.js +7 -3
- package/node_modules/imapflow/dist/esm/commands/list.js +22 -18
- package/node_modules/imapflow/dist/esm/commands/move.js +12 -7
- package/node_modules/imapflow/dist/esm/commands/namespace.js +2 -2
- package/node_modules/imapflow/dist/esm/commands/quota.js +11 -10
- package/node_modules/imapflow/dist/esm/commands/rename.js +5 -5
- package/node_modules/imapflow/dist/esm/commands/search.js +8 -9
- package/node_modules/imapflow/dist/esm/commands/select.js +13 -10
- package/node_modules/imapflow/dist/esm/commands/status.js +12 -12
- package/node_modules/imapflow/dist/esm/commands/store.js +6 -6
- package/node_modules/imapflow/dist/esm/commands/subscribe.js +2 -17
- package/node_modules/imapflow/dist/esm/commands/subscription.d.ts +10 -0
- package/node_modules/imapflow/dist/esm/commands/subscription.js +26 -0
- package/node_modules/imapflow/dist/esm/commands/unsubscribe.js +2 -17
- package/node_modules/imapflow/dist/esm/download.d.ts +22 -0
- package/node_modules/imapflow/dist/esm/download.js +581 -0
- package/node_modules/imapflow/dist/esm/errors.d.ts +50 -1
- package/node_modules/imapflow/dist/esm/errors.js +52 -0
- package/node_modules/imapflow/dist/esm/handler/imap-compiler.js +1 -1
- package/node_modules/imapflow/dist/esm/handler/imap-stream.d.ts +13 -2
- package/node_modules/imapflow/dist/esm/handler/imap-stream.js +51 -30
- package/node_modules/imapflow/dist/esm/handler/parser-instance.js +2 -2
- package/node_modules/imapflow/dist/esm/handler/token-parser.js +15 -9
- package/node_modules/imapflow/dist/esm/imap-flow.d.ts +30 -84
- package/node_modules/imapflow/dist/esm/imap-flow.js +282 -735
- package/node_modules/imapflow/dist/esm/jp-decoder.js +1 -1
- package/node_modules/imapflow/dist/esm/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/package-info.js +3 -3
- package/node_modules/imapflow/dist/esm/search-compiler.js +5 -12
- package/node_modules/imapflow/dist/esm/tools.d.ts +52 -11
- package/node_modules/imapflow/dist/esm/tools.js +79 -21
- package/node_modules/imapflow/dist/esm/types.d.ts +30 -16
- package/node_modules/imapflow/package.json +4 -4
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/args.d.ts +6 -0
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +15 -0
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands.d.ts.map +1 -1
- package/packages/cli/dist/commands.js +17 -0
- package/packages/cli/dist/commands.js.map +1 -1
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +7 -0
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/host/build.d.ts.map +1 -1
- package/packages/core/dist/host/build.js +33 -16
- package/packages/core/dist/host/build.js.map +1 -1
- package/packages/core/dist/host/types.d.ts +17 -0
- package/packages/core/dist/host/types.d.ts.map +1 -1
- package/packages/core/dist/pages/__fixtures__/demo.d.ts.map +1 -1
- package/packages/core/dist/pages/__fixtures__/demo.js +1 -0
- package/packages/core/dist/pages/__fixtures__/demo.js.map +1 -1
- package/packages/core/dist/pages.d.ts +74 -0
- package/packages/core/dist/pages.d.ts.map +1 -1
- package/packages/core/dist/pages.js +27 -1
- package/packages/core/dist/pages.js.map +1 -1
- package/packages/core/dist/plugin/index.d.ts +2 -2
- package/packages/core/dist/plugin/index.d.ts.map +1 -1
- package/packages/core/dist/plugin/version.d.ts +1 -1
- package/packages/core/dist/plugin/version.js +1 -1
- package/packages/core/dist/provider-accounts.d.ts +8 -0
- package/packages/core/dist/provider-accounts.d.ts.map +1 -1
- package/packages/core/dist/provider-accounts.js +8 -0
- package/packages/core/dist/provider-accounts.js.map +1 -1
- package/packages/core/dist/surfaces.d.ts +11 -0
- package/packages/core/dist/surfaces.d.ts.map +1 -1
- package/packages/core/dist/surfaces.js +4 -0
- package/packages/core/dist/surfaces.js.map +1 -1
- package/packages/core/migrations/048_surface_chat_voice.sql +13 -0
- package/packages/core/migrations/049_surface_chat_voice_form.sql +8 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents-cli.d.ts +2 -0
- package/packages/gateway/dist/agents-cli.d.ts.map +1 -1
- package/packages/gateway/dist/agents-cli.js +5 -3
- package/packages/gateway/dist/agents-cli.js.map +1 -1
- package/packages/gateway/dist/chat/session.d.ts.map +1 -1
- package/packages/gateway/dist/chat/session.js +2 -2
- package/packages/gateway/dist/chat/session.js.map +1 -1
- package/packages/gateway/dist/chat/usage.d.ts +16 -0
- package/packages/gateway/dist/chat/usage.d.ts.map +1 -1
- package/packages/gateway/dist/chat/usage.js +53 -11
- package/packages/gateway/dist/chat/usage.js.map +1 -1
- package/packages/gateway/dist/index.d.ts +1 -0
- package/packages/gateway/dist/index.d.ts.map +1 -1
- package/packages/gateway/dist/index.js +1 -0
- package/packages/gateway/dist/index.js.map +1 -1
- package/packages/gateway/dist/provider-accounts.d.ts +4 -0
- package/packages/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/packages/gateway/dist/provider-accounts.js +3 -1
- package/packages/gateway/dist/provider-accounts.js.map +1 -1
- package/packages/gateway/dist/speech-cli.d.ts +43 -0
- package/packages/gateway/dist/speech-cli.d.ts.map +1 -0
- package/packages/gateway/dist/speech-cli.js +105 -0
- package/packages/gateway/dist/speech-cli.js.map +1 -0
- package/packages/gateway/dist/telegram/api.d.ts +10 -0
- package/packages/gateway/dist/telegram/api.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/api.js +12 -0
- package/packages/gateway/dist/telegram/api.js.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.d.ts +2 -1
- package/packages/gateway/dist/telegram/browser-view.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.js +4 -2
- package/packages/gateway/dist/telegram/browser-view.js.map +1 -1
- package/packages/gateway/dist/telegram/main.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/main.js +10 -2
- package/packages/gateway/dist/telegram/main.js.map +1 -1
- package/packages/gateway/dist/telegram/surface.d.ts +25 -0
- package/packages/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/surface.js +212 -10
- package/packages/gateway/dist/telegram/surface.js.map +1 -1
- package/packages/gateway/dist/telegram/voice.d.ts +112 -0
- package/packages/gateway/dist/telegram/voice.d.ts.map +1 -0
- package/packages/gateway/dist/telegram/voice.js +220 -0
- package/packages/gateway/dist/telegram/voice.js.map +1 -0
- package/packages/gateway/dist/web/chat.d.ts +31 -8
- package/packages/gateway/dist/web/chat.d.ts.map +1 -1
- package/packages/gateway/dist/web/chat.js +3 -2
- package/packages/gateway/dist/web/chat.js.map +1 -1
- package/packages/gateway/dist/web/onboarding.d.ts +13 -2
- package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/packages/gateway/dist/web/onboarding.js +24 -3
- package/packages/gateway/dist/web/onboarding.js.map +1 -1
- package/packages/gateway/dist/web/read.d.ts +15 -12
- package/packages/gateway/dist/web/read.d.ts.map +1 -1
- package/packages/gateway/dist/web/read.js +9 -10
- package/packages/gateway/dist/web/read.js.map +1 -1
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +13 -0
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/speech.d.ts +47 -0
- package/packages/gateway/dist/web/speech.d.ts.map +1 -0
- package/packages/gateway/dist/web/speech.js +83 -0
- package/packages/gateway/dist/web/speech.js.map +1 -0
- package/packages/gateway/dist/web/stream.d.ts +0 -24
- package/packages/gateway/dist/web/stream.d.ts.map +1 -1
- package/packages/gateway/dist/web/stream.js +26 -2
- package/packages/gateway/dist/web/stream.js.map +1 -1
- package/packages/gateway/dist/web/usage-view.d.ts +15 -0
- package/packages/gateway/dist/web/usage-view.d.ts.map +1 -0
- package/packages/gateway/dist/web/usage-view.js +20 -0
- package/packages/gateway/dist/web/usage-view.js.map +1 -0
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/anthropic.d.ts +18 -0
- package/packages/runtime/dist/anthropic.d.ts.map +1 -1
- package/packages/runtime/dist/anthropic.js +65 -13
- package/packages/runtime/dist/anthropic.js.map +1 -1
- package/packages/runtime/dist/codex-direct.d.ts.map +1 -1
- package/packages/runtime/dist/codex-direct.js +11 -3
- package/packages/runtime/dist/codex-direct.js.map +1 -1
- package/packages/runtime/dist/context-window.d.ts.map +1 -1
- package/packages/runtime/dist/context-window.js +13 -4
- package/packages/runtime/dist/context-window.js.map +1 -1
- package/packages/runtime/dist/loop.d.ts.map +1 -1
- package/packages/runtime/dist/loop.js +6 -0
- package/packages/runtime/dist/loop.js.map +1 -1
- package/packages/runtime/dist/openai.d.ts +16 -4
- package/packages/runtime/dist/openai.d.ts.map +1 -1
- package/packages/runtime/dist/openai.js +23 -4
- package/packages/runtime/dist/openai.js.map +1 -1
- package/packages/runtime/dist/provider-models.d.ts.map +1 -1
- package/packages/runtime/dist/provider-models.js +5 -1
- package/packages/runtime/dist/provider-models.js.map +1 -1
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/computer.d.ts +53 -1
- package/packages/tools/browser/dist/computer.d.ts.map +1 -1
- package/packages/tools/browser/dist/computer.js +154 -5
- package/packages/tools/browser/dist/computer.js.map +1 -1
- package/packages/tools/browser/dist/controller.d.ts +20 -3
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +170 -5
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +9 -1
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/service.d.ts +14 -1
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js +28 -5
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/browser/dist/types.d.ts +11 -0
- package/packages/tools/browser/dist/types.d.ts.map +1 -1
- package/packages/tools/browser/dist/types.js +16 -3
- package/packages/tools/browser/dist/types.js.map +1 -1
- package/packages/tools/browser/package.json +1 -1
- package/packages/tools/email/dist/.tsbuildinfo +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/memory/dist/.tsbuildinfo +1 -1
- package/packages/tools/web/dist/.tsbuildinfo +1 -1
- package/packages/web/dist/assets/index-D5cRFcgm.css +1 -0
- package/packages/web/dist/assets/index-GCFB1vBV.js +125 -0
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/assets/index-BRc5auXm.js +0 -123
- package/packages/web/dist/assets/index-DwUpotTR.css +0 -1
|
@@ -24,6 +24,7 @@ import { isUnknownAgentError } from './types.js';
|
|
|
24
24
|
import { whereText } from './commands.js';
|
|
25
25
|
import { BURST_GAP_MS, StreamedAnswer, sendBurst, sendRunExtras, toPlainText, } from './outbound.js';
|
|
26
26
|
import { FIRST_RUN_SUFFIX, shouldStartFirstRun } from '../agents/first-run.js';
|
|
27
|
+
import { answerSpoken, applyVoiceArg, claimTextInsteadNote, getChatVoice, languageName, INSTALL_SPEECH_TEXT, MAX_SPOKEN_CHARS, MAX_VOICE_CAPTION_CHARS, NO_WORDS_TEXT, notHeardText, SET_UP_LISTENING_TEXT, setChatVoice, textInsteadText, VOICE_USAGE_TEXT, voiceSetText, voiceStatusText, voiceTurnText, } from './voice.js';
|
|
27
28
|
export const SURFACE = 'telegram';
|
|
28
29
|
/** Proposal cards' callback prefix (`proposals.ts`); here so routing needs no import cycle. */
|
|
29
30
|
export const PROPOSAL_CALLBACK_PREFIX = 'prp';
|
|
@@ -96,6 +97,7 @@ export const HELP = [
|
|
|
96
97
|
'buddi on Telegram.',
|
|
97
98
|
'',
|
|
98
99
|
'Send a statement, a receipt photo or a CSV and tell me what to do with it.',
|
|
100
|
+
'Send a voice note and I hear it, and answer with one, when the speech plugin is set up.',
|
|
99
101
|
'',
|
|
100
102
|
'Answers here are kept short, because you read them on a phone. Ask for more and you get more.',
|
|
101
103
|
'',
|
|
@@ -113,6 +115,8 @@ export const HELP = [
|
|
|
113
115
|
'/missions — the next five scheduled missions',
|
|
114
116
|
'/goals — each goal with its number and where it stands',
|
|
115
117
|
'/where — the dashboard address, when your phone can reach it',
|
|
118
|
+
'/voice [spoken|always|off] — answer with a voice when you send one (spoken), every time (always), or never (off)',
|
|
119
|
+
'/voice [voice|both|text] — send the voice note alone, with the text, or text only',
|
|
116
120
|
'/browser — where the screen stands; /browser stop, /browser resume, /browser release',
|
|
117
121
|
'/host — host execution permissions and running commands',
|
|
118
122
|
'/hoststop — interrupt all host commands',
|
|
@@ -705,6 +709,10 @@ export class TelegramSurface {
|
|
|
705
709
|
* restart drops it back to ordinary routing, never to a wrong agent.
|
|
706
710
|
*/
|
|
707
711
|
#pending = new PendingQuestions();
|
|
712
|
+
/** The chats whose message in hand is a voice note the owner spoke; read by `#runFor`. */
|
|
713
|
+
#ownerSpoke = new Set();
|
|
714
|
+
/** The language of the voice note being run now, per chat, by name. */
|
|
715
|
+
#ownerLanguage = new Map();
|
|
708
716
|
#offset;
|
|
709
717
|
#running = false;
|
|
710
718
|
#abort;
|
|
@@ -880,8 +888,11 @@ export class TelegramSurface {
|
|
|
880
888
|
const incoming = extractAttachment(message);
|
|
881
889
|
if (incoming) {
|
|
882
890
|
// A file arrives with its own intent, caption or not. It is never the
|
|
883
|
-
// answer to "what time tonight?", so it ends any pending question.
|
|
884
|
-
|
|
891
|
+
// answer to "what time tonight?", so it ends any pending question. A
|
|
892
|
+
// voice note can be exactly that answer: it is heard, then routed as
|
|
893
|
+
// the words it carries.
|
|
894
|
+
if (incoming.slot !== 'voice' && incoming.slot !== 'audio')
|
|
895
|
+
this.#pending.clear(chatId);
|
|
885
896
|
const messageId = String(message.message_id);
|
|
886
897
|
this.enqueue(chatId, () => this.handleAttachment(chatId, resolution.ownerId, messageId, incoming));
|
|
887
898
|
return;
|
|
@@ -1176,6 +1187,10 @@ export class TelegramSurface {
|
|
|
1176
1187
|
await this.#opts.api.sendMessage(chatId, whereText(this.#opts.publicOrigin));
|
|
1177
1188
|
return;
|
|
1178
1189
|
}
|
|
1190
|
+
if (command === '/voice') {
|
|
1191
|
+
await this.handleVoice(chatId, text.slice(command.length));
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1179
1194
|
// `/quiet 1w` — the argument is everything after the command word, so
|
|
1180
1195
|
// `/quiet` alone parses as the default. The surface never reads a duration.
|
|
1181
1196
|
if (command === '/quiet') {
|
|
@@ -1382,6 +1397,10 @@ export class TelegramSurface {
|
|
|
1382
1397
|
// Whether this turn ended by asking the owner something. Read out of the
|
|
1383
1398
|
// run, not out of what the owner is shown: the note is prepended after.
|
|
1384
1399
|
let askedOwner = false;
|
|
1400
|
+
// Read aloud? When the owner spoke and the chat says `spoken`, or always.
|
|
1401
|
+
// Only with a speaker to read it; otherwise the agent is not told so.
|
|
1402
|
+
const spoken = await this.#willSpeak(chatId);
|
|
1403
|
+
const spokenLanguage = this.#ownerLanguage.get(chatId);
|
|
1385
1404
|
// Where a message typed while this run works arrives. It is registered
|
|
1386
1405
|
// before the first model call and closed after the last, so the window in
|
|
1387
1406
|
// which the owner can get a word in is exactly the window in which the
|
|
@@ -1397,8 +1416,12 @@ export class TelegramSurface {
|
|
|
1397
1416
|
text: prompt,
|
|
1398
1417
|
interjections,
|
|
1399
1418
|
...(carried?.attachments.length ? { attachments: carried.attachments } : {}),
|
|
1419
|
+
...(spoken ? { spoken: true } : {}),
|
|
1420
|
+
...(spokenLanguage ? { spokenLanguage } : {}),
|
|
1400
1421
|
onToolCall: (name) => progress.noteToolCall(name),
|
|
1401
|
-
|
|
1422
|
+
// A spoken answer is not streamed: it arrives as a voice note with
|
|
1423
|
+
// its text underneath, and the progress line holds until then.
|
|
1424
|
+
...(spoken ? {} : { onTextDelta: (delta) => stream.push(delta) }),
|
|
1402
1425
|
});
|
|
1403
1426
|
const reply = replyText(produced);
|
|
1404
1427
|
askedOwner = turnAskedOwner(typeof produced === 'string' ? undefined : produced.askedOwner, reply);
|
|
@@ -1416,7 +1439,7 @@ export class TelegramSurface {
|
|
|
1416
1439
|
...(typeof produced !== 'string' && produced.question ? { question: produced.question } : {}),
|
|
1417
1440
|
...extrasOf(produced),
|
|
1418
1441
|
};
|
|
1419
|
-
}, label, carried ? readingText(label) : undefined, { agentId: agent.id, conversationId, prompt });
|
|
1442
|
+
}, label, carried ? readingText(label) : undefined, { agentId: agent.id, conversationId, prompt }, spoken);
|
|
1420
1443
|
}
|
|
1421
1444
|
finally {
|
|
1422
1445
|
/*
|
|
@@ -1552,10 +1575,11 @@ export class TelegramSurface {
|
|
|
1552
1575
|
mime: row.mime,
|
|
1553
1576
|
sizeBytes: row.sizeBytes,
|
|
1554
1577
|
});
|
|
1555
|
-
//
|
|
1556
|
-
//
|
|
1578
|
+
// A voice note is heard by the speech plugin and run as the owner's
|
|
1579
|
+
// words. Without the plugin, or with listening not set
|
|
1580
|
+
// up, it is kept and the reply says where to fix that.
|
|
1557
1581
|
if (row.kind === 'audio') {
|
|
1558
|
-
await
|
|
1582
|
+
await this.#heard(chatId, row, filename, incoming.caption);
|
|
1559
1583
|
return;
|
|
1560
1584
|
}
|
|
1561
1585
|
const caption = incoming.caption;
|
|
@@ -1955,7 +1979,9 @@ export class TelegramSurface {
|
|
|
1955
1979
|
* single message behind it — a `/recap` is the mission's, not the owner's,
|
|
1956
1980
|
* and "try again" there would re-run something they never typed.
|
|
1957
1981
|
*/
|
|
1958
|
-
retry
|
|
1982
|
+
retry,
|
|
1983
|
+
/** Send the answer as a voice note, with its text as the caption. */
|
|
1984
|
+
speak = false) {
|
|
1959
1985
|
const stopTyping = this.#startTyping(chatId);
|
|
1960
1986
|
const placeholder = placeholderOverride ?? placeholderText(agentName);
|
|
1961
1987
|
// An explicit bubble, posted before the provider is called: the owner sees
|
|
@@ -1988,9 +2014,16 @@ export class TelegramSurface {
|
|
|
1988
2014
|
const drawn = typeof produced === 'string' ? { text: produced, controls: [] } : produced;
|
|
1989
2015
|
const reply = toPlainText(drawn.text);
|
|
1990
2016
|
await progress.settle();
|
|
1991
|
-
|
|
2017
|
+
const keyboard = drawn.question && drawn.question.options.length > 0
|
|
1992
2018
|
? questionKeyboard(drawn.question)
|
|
1993
|
-
: drawn.controls.length === 0 ? undefined : offersKeyboard(drawn.controls)
|
|
2019
|
+
: drawn.controls.length === 0 ? undefined : offersKeyboard(drawn.controls);
|
|
2020
|
+
// Buttons need a text message to sit under: an answer that carries any
|
|
2021
|
+
// stays text, as cards and questions do.
|
|
2022
|
+
const voice = speak && keyboard === undefined ? await this.#speakAnswer(chatId, placeholderId, reply, progress) : { sent: false };
|
|
2023
|
+
if (!voice.sent)
|
|
2024
|
+
await stream.finish(reply, keyboard);
|
|
2025
|
+
if (voice.note)
|
|
2026
|
+
await this.#opts.api.sendMessage(chatId, voice.note).catch(() => { });
|
|
1994
2027
|
// Then what else the turn made: the view it drew, the files it saved.
|
|
1995
2028
|
if (drawn.artifacts || drawn.canvas) {
|
|
1996
2029
|
await sendRunExtras({
|
|
@@ -2032,6 +2065,175 @@ export class TelegramSurface {
|
|
|
2032
2065
|
stopTyping();
|
|
2033
2066
|
}
|
|
2034
2067
|
}
|
|
2068
|
+
/* ---------------------------------------------------------------- *
|
|
2069
|
+
* Voice
|
|
2070
|
+
* ---------------------------------------------------------------- */
|
|
2071
|
+
/**
|
|
2072
|
+
* `/voice` alone shows the chat's choice; `/voice spoken|always|off` sets
|
|
2073
|
+
* when, `/voice voice|both|text` what. Written to the chat's row and to the
|
|
2074
|
+
* speech plugin's copy, so Settings → Speech shows the same.
|
|
2075
|
+
*/
|
|
2076
|
+
async handleVoice(chatId, arg) {
|
|
2077
|
+
const api = this.#opts.api;
|
|
2078
|
+
const current = await this.#chatVoice(chatId);
|
|
2079
|
+
if (arg.trim() === '') {
|
|
2080
|
+
await api.sendMessage(chatId, voiceStatusText(current));
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
const next = applyVoiceArg(current, arg);
|
|
2084
|
+
if (!next) {
|
|
2085
|
+
await api.sendMessage(chatId, VOICE_USAGE_TEXT);
|
|
2086
|
+
return;
|
|
2087
|
+
}
|
|
2088
|
+
await setChatVoice(this.#opts.pool, SURFACE, chatId, next);
|
|
2089
|
+
await this.#opts.speech?.saveVoicePrefs?.(next).catch(() => false);
|
|
2090
|
+
await api.sendMessage(chatId, voiceSetText(next));
|
|
2091
|
+
}
|
|
2092
|
+
/** The chat's two choices: the speech plugin's copy where it has one, else the chat's row. */
|
|
2093
|
+
async #chatVoice(chatId) {
|
|
2094
|
+
const row = await getChatVoice(this.#opts.pool, SURFACE, chatId);
|
|
2095
|
+
const prefs = (await this.#opts.speech?.voicePrefs?.().catch(() => ({}))) ?? {};
|
|
2096
|
+
return { when: prefs.when ?? row.when, form: prefs.form ?? row.form };
|
|
2097
|
+
}
|
|
2098
|
+
/** Will this chat's next answer be read aloud? */
|
|
2099
|
+
async #willSpeak(chatId) {
|
|
2100
|
+
const speech = this.#opts.speech;
|
|
2101
|
+
if (!speech || !this.#opts.artifacts || !speech.canSpeak())
|
|
2102
|
+
return false;
|
|
2103
|
+
try {
|
|
2104
|
+
return answerSpoken((await this.#chatVoice(chatId)).when, this.#ownerSpoke.has(chatId));
|
|
2105
|
+
}
|
|
2106
|
+
catch (err) {
|
|
2107
|
+
this.#log(`telegram: chat ${chatId} — the voice setting could not be read: ${message(err)}`);
|
|
2108
|
+
return false;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
/**
|
|
2112
|
+
* A voice note, saved: transcribe it and run it as the owner's words (a
|
|
2113
|
+
* caption follows the transcript). Nothing is echoed back: the transcript is
|
|
2114
|
+
* the owner's message in the conversation, where the dashboard shows it.
|
|
2115
|
+
* Refused or failed: one sentence, and the file stays saved.
|
|
2116
|
+
*/
|
|
2117
|
+
async #heard(chatId, row, filename, caption) {
|
|
2118
|
+
const api = this.#opts.api;
|
|
2119
|
+
const speech = this.#opts.speech;
|
|
2120
|
+
if (!speech) {
|
|
2121
|
+
await api.sendMessage(chatId, `${gotAudioText(filename, row.sizeBytes)} ${INSTALL_SPEECH_TEXT}`);
|
|
2122
|
+
return;
|
|
2123
|
+
}
|
|
2124
|
+
const stopTyping = this.#startTyping(chatId);
|
|
2125
|
+
let heard;
|
|
2126
|
+
try {
|
|
2127
|
+
heard = await speech.transcribe(row.id);
|
|
2128
|
+
}
|
|
2129
|
+
catch (err) {
|
|
2130
|
+
heard = { ok: false, reason: 'failed', message: message(err) };
|
|
2131
|
+
}
|
|
2132
|
+
finally {
|
|
2133
|
+
stopTyping();
|
|
2134
|
+
}
|
|
2135
|
+
if (!heard.ok) {
|
|
2136
|
+
if (heard.reason === 'failed')
|
|
2137
|
+
this.#log(`telegram: chat ${chatId} — transcription failed: ${heard.message}`);
|
|
2138
|
+
const text = heard.reason === 'missing'
|
|
2139
|
+
? `${gotAudioText(filename, row.sizeBytes)} ${INSTALL_SPEECH_TEXT}`
|
|
2140
|
+
: heard.reason === 'unconfigured'
|
|
2141
|
+
? `${gotAudioText(filename, row.sizeBytes)} ${SET_UP_LISTENING_TEXT}`
|
|
2142
|
+
: notHeardText(heard.message);
|
|
2143
|
+
await api.sendMessage(chatId, text);
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2146
|
+
if (heard.text === '') {
|
|
2147
|
+
await api.sendMessage(chatId, NO_WORDS_TEXT);
|
|
2148
|
+
return;
|
|
2149
|
+
}
|
|
2150
|
+
this.#ownerSpoke.add(chatId);
|
|
2151
|
+
const language = languageName(heard.language);
|
|
2152
|
+
if (language)
|
|
2153
|
+
this.#ownerLanguage.set(chatId, language);
|
|
2154
|
+
try {
|
|
2155
|
+
await this.handleText(chatId, '', voiceTurnText(heard.text, caption));
|
|
2156
|
+
}
|
|
2157
|
+
finally {
|
|
2158
|
+
this.#ownerSpoke.delete(chatId);
|
|
2159
|
+
this.#ownerLanguage.delete(chatId);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* The answer as a voice note, in place of the placeholder: alone (`/voice
|
|
2164
|
+
* voice`), or with its text as the caption, or right after it past
|
|
2165
|
+
* Telegram's 1,024 characters (`/voice both`). Not
|
|
2166
|
+
* sent: the caller lands the text as usual, and `note` is the once-a-day
|
|
2167
|
+
* line saying why, when there is one to say.
|
|
2168
|
+
*/
|
|
2169
|
+
async #speakAnswer(chatId, placeholderId, reply, progress) {
|
|
2170
|
+
const api = this.#opts.api;
|
|
2171
|
+
const speech = this.#opts.speech;
|
|
2172
|
+
const store = this.#opts.artifacts;
|
|
2173
|
+
// A long answer is not read aloud, and nothing is said about it.
|
|
2174
|
+
if (!speech || !store || reply.trim() === '' || reply.length > MAX_SPOKEN_CHARS)
|
|
2175
|
+
return { sent: false };
|
|
2176
|
+
const fallback = async (reason, detail) => {
|
|
2177
|
+
this.#log(`telegram: chat ${chatId} — the answer went as text (${reason}): ${detail}`);
|
|
2178
|
+
const note = await this.#textInsteadNote(chatId, reason);
|
|
2179
|
+
return note ? { sent: false, note } : { sent: false };
|
|
2180
|
+
};
|
|
2181
|
+
api.sendChatAction(chatId, 'record_voice').catch(() => { });
|
|
2182
|
+
const form = (await this.#chatVoice(chatId).catch(() => undefined))?.form ?? 'voice';
|
|
2183
|
+
let said;
|
|
2184
|
+
try {
|
|
2185
|
+
said = await speech.say(reply, this.#handleNames());
|
|
2186
|
+
}
|
|
2187
|
+
catch (err) {
|
|
2188
|
+
said = { ok: false, reason: 'failed', message: message(err) };
|
|
2189
|
+
}
|
|
2190
|
+
if (!said.ok)
|
|
2191
|
+
return fallback(said.reason, said.message);
|
|
2192
|
+
const loaded = await store.load(said.artifactId).catch(() => null);
|
|
2193
|
+
if (!loaded)
|
|
2194
|
+
return fallback('failed', `the voice ${said.artifactId} could not be read back`);
|
|
2195
|
+
const withText = form === 'both';
|
|
2196
|
+
const long = reply.length > MAX_VOICE_CAPTION_CHARS;
|
|
2197
|
+
progress.silence();
|
|
2198
|
+
try {
|
|
2199
|
+
await api.sendVoice(chatId, Buffer.from(loaded.data, 'base64'), {
|
|
2200
|
+
contentType: loaded.mime,
|
|
2201
|
+
filename: loaded.mime === 'audio/mpeg' ? 'voice.mp3' : 'voice.ogg',
|
|
2202
|
+
...(withText && !long ? { caption: reply } : {}),
|
|
2203
|
+
});
|
|
2204
|
+
}
|
|
2205
|
+
catch (err) {
|
|
2206
|
+
return fallback('failed', message(err));
|
|
2207
|
+
}
|
|
2208
|
+
if (withText && long)
|
|
2209
|
+
await api.sendMessage(chatId, reply);
|
|
2210
|
+
if (placeholderId !== undefined)
|
|
2211
|
+
await api.deleteMessage(chatId, placeholderId).catch(() => { });
|
|
2212
|
+
return { sent: true };
|
|
2213
|
+
}
|
|
2214
|
+
/** Every agent's handle and name, so a spoken `@ledger` is read as its name. */
|
|
2215
|
+
#handleNames() {
|
|
2216
|
+
const names = {};
|
|
2217
|
+
try {
|
|
2218
|
+
for (const agent of this.#opts.catalog.list())
|
|
2219
|
+
if (agent.handle && agent.name)
|
|
2220
|
+
names[agent.handle] = agent.name;
|
|
2221
|
+
}
|
|
2222
|
+
catch {
|
|
2223
|
+
// No names: handles are read as bare words.
|
|
2224
|
+
}
|
|
2225
|
+
return names;
|
|
2226
|
+
}
|
|
2227
|
+
/** Today's "why this came as text" line for this chat, or nothing when it was said today. */
|
|
2228
|
+
async #textInsteadNote(chatId, reason) {
|
|
2229
|
+
try {
|
|
2230
|
+
const claimed = await claimTextInsteadNote(this.#opts.pool, SURFACE, chatId, new Date(this.#now()), this.#opts.timezone ?? DEFAULT_TIMEZONE);
|
|
2231
|
+
return claimed ? textInsteadText(reason) : undefined;
|
|
2232
|
+
}
|
|
2233
|
+
catch {
|
|
2234
|
+
return undefined;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2035
2237
|
/**
|
|
2036
2238
|
* One turn's reply, with whatever it offered already drawn into the shape
|
|
2037
2239
|
* this surface sends: the text, and the controls if there are any.
|