@withbuddi/buddi 0.1.0-pre.17 → 0.1.0-pre.19
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 +29 -21
- package/extension/background.js +38 -7
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/args.d.ts +16 -3
- package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/args.js +39 -89
- package/node_modules/@buddi/cli/dist/args.js.map +1 -1
- package/node_modules/@buddi/cli/dist/backup/index.d.ts +2 -0
- package/node_modules/@buddi/cli/dist/backup/index.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/backup/index.js +13 -4
- package/node_modules/@buddi/cli/dist/backup/index.js.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.d.ts +94 -0
- package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -0
- package/node_modules/@buddi/cli/dist/commands.js +1028 -0
- package/node_modules/@buddi/cli/dist/commands.js.map +1 -0
- package/node_modules/@buddi/cli/dist/dashboard-app.d.ts +6 -0
- package/node_modules/@buddi/cli/dist/dashboard-app.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/dashboard-app.js +16 -1
- package/node_modules/@buddi/cli/dist/dashboard-app.js.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor-probes.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor-probes.js +5 -2
- package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.d.ts +16 -0
- package/node_modules/@buddi/cli/dist/doctor.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.js +18 -0
- package/node_modules/@buddi/cli/dist/doctor.js.map +1 -1
- package/node_modules/@buddi/cli/dist/index.d.ts +4 -1
- package/node_modules/@buddi/cli/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/index.js +4 -1
- package/node_modules/@buddi/cli/dist/index.js.map +1 -1
- package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts +4 -0
- package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/jobs-cmd.js +26 -7
- package/node_modules/@buddi/cli/dist/jobs-cmd.js.map +1 -1
- package/node_modules/@buddi/cli/dist/main.d.ts +9 -2
- package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/main.js +256 -30
- package/node_modules/@buddi/cli/dist/main.js.map +1 -1
- package/node_modules/@buddi/cli/dist/paths.d.ts +7 -4
- package/node_modules/@buddi/cli/dist/paths.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/paths.js +17 -6
- package/node_modules/@buddi/cli/dist/paths.js.map +1 -1
- package/node_modules/@buddi/cli/dist/status.d.ts +70 -0
- package/node_modules/@buddi/cli/dist/status.d.ts.map +1 -0
- package/node_modules/@buddi/cli/dist/status.js +122 -0
- package/node_modules/@buddi/cli/dist/status.js.map +1 -0
- package/node_modules/@buddi/cli/dist/style.d.ts +13 -0
- package/node_modules/@buddi/cli/dist/style.d.ts.map +1 -0
- package/node_modules/@buddi/cli/dist/style.js +10 -0
- package/node_modules/@buddi/cli/dist/style.js.map +1 -0
- package/node_modules/@buddi/cli/dist/telegram-cmd.d.ts +1 -1
- package/node_modules/@buddi/cli/dist/telegram-cmd.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/telegram-cmd.js +23 -6
- package/node_modules/@buddi/cli/dist/telegram-cmd.js.map +1 -1
- package/node_modules/@buddi/cli/dist/uninstall-cmd.d.ts +42 -0
- package/node_modules/@buddi/cli/dist/uninstall-cmd.d.ts.map +1 -0
- package/node_modules/@buddi/cli/dist/uninstall-cmd.js +208 -0
- package/node_modules/@buddi/cli/dist/uninstall-cmd.js.map +1 -0
- package/node_modules/@buddi/cli/dist/vault-cmd.js +3 -3
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/actions/approvals.d.ts +0 -17
- package/node_modules/@buddi/core/dist/actions/approvals.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/actions/approvals.js +21 -0
- package/node_modules/@buddi/core/dist/actions/approvals.js.map +1 -1
- package/node_modules/@buddi/core/dist/actions/execute.d.ts +1 -1
- package/node_modules/@buddi/core/dist/actions/jobs.d.ts +1 -1
- package/node_modules/@buddi/core/dist/actions/types.js +1 -1
- package/node_modules/@buddi/core/dist/agents/models.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/models.js +4 -3
- package/node_modules/@buddi/core/dist/agents/models.js.map +1 -1
- package/node_modules/@buddi/core/dist/agents/provider-from-env.d.ts +1 -1
- package/node_modules/@buddi/core/dist/agents/provider-from-env.js +1 -1
- package/node_modules/@buddi/core/dist/agents/skills.d.ts +2 -2
- package/node_modules/@buddi/core/dist/goals/frequency.d.ts +51 -0
- package/node_modules/@buddi/core/dist/goals/frequency.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/goals/frequency.js +113 -0
- package/node_modules/@buddi/core/dist/goals/frequency.js.map +1 -0
- package/node_modules/@buddi/core/dist/goals/index.d.ts +2 -0
- package/node_modules/@buddi/core/dist/goals/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/goals/index.js +2 -0
- package/node_modules/@buddi/core/dist/goals/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/goals/math.d.ts +8 -2
- package/node_modules/@buddi/core/dist/goals/math.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/goals/math.js +17 -4
- package/node_modules/@buddi/core/dist/goals/math.js.map +1 -1
- package/node_modules/@buddi/core/dist/goals/owner.d.ts +129 -0
- package/node_modules/@buddi/core/dist/goals/owner.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/goals/owner.js +239 -0
- package/node_modules/@buddi/core/dist/goals/owner.js.map +1 -0
- package/node_modules/@buddi/core/dist/goals/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/goals/store.js +11 -4
- package/node_modules/@buddi/core/dist/goals/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/goals/types.d.ts +17 -3
- package/node_modules/@buddi/core/dist/goals/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/goals/types.js +8 -2
- package/node_modules/@buddi/core/dist/goals/types.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.d.ts +15 -1
- package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.js +99 -1
- package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/types.d.ts +88 -1
- package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/index.d.ts +1 -0
- package/node_modules/@buddi/core/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/index.js +1 -0
- package/node_modules/@buddi/core/dist/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/learning/announce.d.ts +29 -0
- package/node_modules/@buddi/core/dist/learning/announce.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/learning/announce.js +49 -0
- package/node_modules/@buddi/core/dist/learning/announce.js.map +1 -0
- package/node_modules/@buddi/core/dist/learning/index.d.ts +1 -0
- package/node_modules/@buddi/core/dist/learning/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/learning/index.js +1 -0
- package/node_modules/@buddi/core/dist/learning/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/learning/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/learning/store.js +15 -4
- package/node_modules/@buddi/core/dist/learning/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/channels.d.ts +37 -0
- package/node_modules/@buddi/core/dist/notifications/channels.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/channels.js +87 -0
- package/node_modules/@buddi/core/dist/notifications/channels.js.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/index.d.ts +5 -0
- package/node_modules/@buddi/core/dist/notifications/index.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/index.js +5 -0
- package/node_modules/@buddi/core/dist/notifications/index.js.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/notify.d.ts +35 -0
- package/node_modules/@buddi/core/dist/notifications/notify.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/notify.js +263 -0
- package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/store.d.ts +50 -0
- package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/store.js +216 -0
- package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/types.d.ts +142 -0
- package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/types.js +5 -0
- package/node_modules/@buddi/core/dist/notifications/types.js.map +1 -0
- package/node_modules/@buddi/core/dist/owner.js +1 -1
- package/node_modules/@buddi/core/dist/pages.d.ts +2 -2
- package/node_modules/@buddi/core/dist/plugin/index.d.ts +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/uses.d.ts +1 -1
- package/node_modules/@buddi/core/dist/plugin/uses.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/uses.js +4 -0
- package/node_modules/@buddi/core/dist/plugin/uses.js.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.d.ts +1 -1
- package/node_modules/@buddi/core/dist/provider.js +1 -1
- package/node_modules/@buddi/core/dist/queue/retry-policy.d.ts +1 -1
- package/node_modules/@buddi/core/dist/queue/retry-policy.js +1 -1
- package/node_modules/@buddi/core/dist/registry.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/registry.js +3 -4
- package/node_modules/@buddi/core/dist/registry.js.map +1 -1
- package/node_modules/@buddi/core/dist/reminders/store.d.ts +1 -1
- package/node_modules/@buddi/core/dist/reminders/store.js +1 -1
- package/node_modules/@buddi/core/dist/reminders/types.d.ts +1 -1
- package/node_modules/@buddi/core/dist/reminders/types.js +1 -1
- package/node_modules/@buddi/core/dist/sentinels/run.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/sentinels/run.js +4 -1
- package/node_modules/@buddi/core/dist/sentinels/run.js.map +1 -1
- package/node_modules/@buddi/core/dist/sentinels/types.d.ts +21 -1
- package/node_modules/@buddi/core/dist/sentinels/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/sentinels/types.js.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.d.ts +2 -0
- package/node_modules/@buddi/core/dist/surfaces.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.js +7 -0
- package/node_modules/@buddi/core/dist/surfaces.js.map +1 -1
- package/node_modules/@buddi/core/dist/time.d.ts +12 -0
- package/node_modules/@buddi/core/dist/time.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/time.js +46 -0
- package/node_modules/@buddi/core/dist/time.js.map +1 -1
- package/node_modules/@buddi/core/dist/tools.d.ts +5 -5
- package/node_modules/@buddi/core/dist/uninstall.d.ts +79 -0
- package/node_modules/@buddi/core/dist/uninstall.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/uninstall.js +109 -0
- package/node_modules/@buddi/core/dist/uninstall.js.map +1 -0
- package/node_modules/@buddi/core/dist/vault/file.js +2 -2
- package/node_modules/@buddi/core/dist/vault/keychain.js +1 -1
- package/node_modules/@buddi/core/dist/vault/keychain.js.map +1 -1
- package/node_modules/@buddi/core/dist/vault/resolve.d.ts +3 -3
- package/node_modules/@buddi/core/dist/vault/resolve.js +3 -3
- package/node_modules/@buddi/core/dist/vault/types.d.ts +1 -1
- package/node_modules/@buddi/core/dist/vault/types.js +1 -1
- package/node_modules/@buddi/core/dist/views.d.ts +66 -66
- package/node_modules/@buddi/core/migrations/003_owner_surfaces.sql +1 -1
- package/node_modules/@buddi/core/migrations/005_artifacts.sql +1 -1
- package/node_modules/@buddi/core/migrations/009_queue.sql +1 -2
- package/node_modules/@buddi/core/migrations/010_actions.sql +1 -1
- package/node_modules/@buddi/core/migrations/043_owner_notifications.sql +77 -0
- package/node_modules/@buddi/core/migrations/044_owner_metrics.sql +45 -0
- package/node_modules/@buddi/core/migrations/045_frequency_goals.sql +19 -0
- package/node_modules/@buddi/core/package.json +4 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.js +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.d.ts +25 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.js +91 -27
- package/node_modules/@buddi/gateway/dist/agents-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/bootstrap.js +8 -0
- package/node_modules/@buddi/gateway/dist/bootstrap.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/channels/local-notification.d.ts +39 -0
- package/node_modules/@buddi/gateway/dist/channels/local-notification.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/channels/local-notification.js +154 -0
- package/node_modules/@buddi/gateway/dist/channels/local-notification.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/chat/approvals.d.ts +3 -3
- package/node_modules/@buddi/gateway/dist/chat/approvals.js +3 -3
- package/node_modules/@buddi/gateway/dist/chat/usage.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/usage.js +1 -0
- package/node_modules/@buddi/gateway/dist/chat/usage.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/cli.d.ts +14 -0
- package/node_modules/@buddi/gateway/dist/cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/cli.js +208 -37
- package/node_modules/@buddi/gateway/dist/cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/db-ready.d.ts +2 -1
- package/node_modules/@buddi/gateway/dist/db-ready.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/db-ready.js +3 -2
- package/node_modules/@buddi/gateway/dist/db-ready.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.d.ts +5 -1
- package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.js +6 -1
- package/node_modules/@buddi/gateway/dist/index.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/agent-run.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/agent-run.js +11 -1
- package/node_modules/@buddi/gateway/dist/missions/agent-run.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +22 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +8 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/goals-format.d.ts +32 -5
- package/node_modules/@buddi/gateway/dist/missions/goals-format.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/goals-format.js +59 -2
- package/node_modules/@buddi/gateway/dist/missions/goals-format.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/goals-page.d.ts +60 -5
- package/node_modules/@buddi/gateway/dist/missions/goals-page.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/goals-page.js +355 -8
- package/node_modules/@buddi/gateway/dist/missions/goals-page.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/goals.d.ts +64 -5
- package/node_modules/@buddi/gateway/dist/missions/goals.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/goals.js +834 -116
- package/node_modules/@buddi/gateway/dist/missions/goals.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.d.ts +5 -0
- package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.js +12 -0
- package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions-cli.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/missions-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions-cli.js +53 -8
- package/node_modules/@buddi/gateway/dist/missions-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.d.ts +44 -0
- package/node_modules/@buddi/gateway/dist/owner-notify.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/owner-notify.js +91 -0
- package/node_modules/@buddi/gateway/dist/owner-notify.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/plugins-cli.d.ts +3 -1
- package/node_modules/@buddi/gateway/dist/plugins-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins-cli.js +11 -4
- package/node_modules/@buddi/gateway/dist/plugins-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.js +22 -13
- package/node_modules/@buddi/gateway/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/reminders-cli.d.ts +3 -1
- package/node_modules/@buddi/gateway/dist/reminders-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/reminders-cli.js +21 -2
- package/node_modules/@buddi/gateway/dist/reminders-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +61 -13
- package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/subscription-signins.d.ts +28 -0
- package/node_modules/@buddi/gateway/dist/subscription-signins.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/subscription-signins.js +30 -0
- package/node_modules/@buddi/gateway/dist/subscription-signins.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/api.d.ts +43 -9
- package/node_modules/@buddi/gateway/dist/telegram/api.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/api.js +80 -21
- package/node_modules/@buddi/gateway/dist/telegram/api.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.d.ts +3 -3
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js +3 -3
- package/node_modules/@buddi/gateway/dist/telegram/attachments.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/telegram/attachments.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/attachments.js +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/attachments.js.map +1 -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 +2 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts +36 -0
- package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/channel.js +71 -0
- package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/commands.d.ts +28 -0
- package/node_modules/@buddi/gateway/dist/telegram/commands.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/commands.js +74 -0
- package/node_modules/@buddi/gateway/dist/telegram/commands.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/main.d.ts +3 -0
- package/node_modules/@buddi/gateway/dist/telegram/main.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/main.js +71 -2
- package/node_modules/@buddi/gateway/dist/telegram/main.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/outbound.d.ts +191 -0
- package/node_modules/@buddi/gateway/dist/telegram/outbound.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/outbound.js +671 -0
- package/node_modules/@buddi/gateway/dist/telegram/outbound.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/proposals.d.ts +65 -0
- package/node_modules/@buddi/gateway/dist/telegram/proposals.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/proposals.js +183 -0
- package/node_modules/@buddi/gateway/dist/telegram/proposals.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts +47 -47
- package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.js +103 -291
- package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/config.js +3 -3
- package/node_modules/@buddi/gateway/dist/web/http.d.ts +16 -3
- package/node_modules/@buddi/gateway/dist/web/http.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/http.js +39 -3
- package/node_modules/@buddi/gateway/dist/web/http.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/notifications.d.ts +36 -0
- package/node_modules/@buddi/gateway/dist/web/notifications.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/notifications.js +63 -0
- package/node_modules/@buddi/gateway/dist/web/notifications.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js +5 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.js +3 -3
- package/node_modules/@buddi/gateway/dist/web/secrets.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/secrets.js +3 -2
- package/node_modules/@buddi/gateway/dist/web/secrets.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 +54 -23
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/telegram.d.ts +39 -0
- package/node_modules/@buddi/gateway/dist/web/telegram.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/telegram.js +53 -1
- package/node_modules/@buddi/gateway/dist/web/telegram.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/version.d.ts +1 -0
- package/node_modules/@buddi/gateway/dist/web/version.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/version.js +2 -1
- package/node_modules/@buddi/gateway/dist/web/version.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/write.js +1 -1
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/install/dist/environment.d.ts +29 -0
- package/node_modules/@buddi/install/dist/environment.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/environment.js +50 -1
- package/node_modules/@buddi/install/dist/environment.js.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.d.ts +3 -1
- package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.js +220 -14
- package/node_modules/@buddi/install/dist/launcher.js.map +1 -1
- package/node_modules/@buddi/install/dist/uninstall.d.ts +59 -0
- package/node_modules/@buddi/install/dist/uninstall.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/uninstall.js +260 -0
- package/node_modules/@buddi/install/dist/uninstall.js.map +1 -0
- package/node_modules/@buddi/install/dist/upgrade.d.ts +16 -3
- package/node_modules/@buddi/install/dist/upgrade.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/upgrade.js +21 -7
- package/node_modules/@buddi/install/dist/upgrade.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts +35 -2
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.js +36 -12
- package/node_modules/@buddi/runtime/dist/anthropic.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 +5 -2
- package/node_modules/@buddi/runtime/dist/context-window.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/delegate.js +1 -1
- package/node_modules/@buddi/runtime/dist/loop.d.ts +13 -1
- package/node_modules/@buddi/runtime/dist/loop.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/loop.js +70 -3
- package/node_modules/@buddi/runtime/dist/loop.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.js +26 -8
- package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/index.d.ts +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/availability.d.ts +34 -8
- package/node_modules/@buddi/tool-browser/dist/availability.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/availability.js +44 -5
- package/node_modules/@buddi/tool-browser/dist/availability.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +2 -2
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +7 -6
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/host.d.ts +3 -1
- package/node_modules/@buddi/tool-browser/dist/host.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/host.js +5 -1
- package/node_modules/@buddi/tool-browser/dist/host.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts +2 -2
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +13 -5
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/origin-pattern.d.ts +31 -0
- package/node_modules/@buddi/tool-browser/dist/origin-pattern.d.ts.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/origin-pattern.js +61 -0
- package/node_modules/@buddi/tool-browser/dist/origin-pattern.js.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/public-suffixes.d.ts +24 -0
- package/node_modules/@buddi/tool-browser/dist/public-suffixes.d.ts.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/public-suffixes.js +153 -0
- package/node_modules/@buddi/tool-browser/dist/public-suffixes.js.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/secrets.d.ts +45 -9
- package/node_modules/@buddi/tool-browser/dist/secrets.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/secrets.js +77 -20
- package/node_modules/@buddi/tool-browser/dist/secrets.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +12 -2
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js +84 -20
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.d.ts +7 -1
- package/node_modules/@buddi/tool-browser/dist/types.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js +7 -1
- package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-email/dist/channel.d.ts +43 -0
- package/node_modules/@buddi/tool-email/dist/channel.d.ts.map +1 -0
- package/node_modules/@buddi/tool-email/dist/channel.js +99 -0
- package/node_modules/@buddi/tool-email/dist/channel.js.map +1 -0
- package/node_modules/@buddi/tool-email/dist/index.d.ts +1 -0
- package/node_modules/@buddi/tool-email/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-email/dist/index.js +8 -1
- package/node_modules/@buddi/tool-email/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/ports.d.ts +3 -3
- package/node_modules/@buddi/tool-email/dist/ports.js +1 -1
- package/node_modules/@buddi/tool-email/dist/tools/drafts.d.ts +1 -1
- package/node_modules/@buddi/tool-email/dist/tools/read.js +1 -1
- package/node_modules/@buddi/tool-email/dist/tools/read.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/tools/send.js +1 -1
- package/node_modules/@buddi/tool-email/migrations/001_email.sql +3 -2
- package/node_modules/@buddi/tool-email/package.json +2 -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-memory/dist/index.js +1 -1
- package/node_modules/@buddi/tool-memory/migrations/001_memory.sql +1 -1
- package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/package.json +5 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/args.d.ts +16 -3
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +39 -89
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/backup/index.d.ts +2 -0
- package/packages/cli/dist/backup/index.d.ts.map +1 -1
- package/packages/cli/dist/backup/index.js +13 -4
- package/packages/cli/dist/backup/index.js.map +1 -1
- package/packages/cli/dist/commands.d.ts +94 -0
- package/packages/cli/dist/commands.d.ts.map +1 -0
- package/packages/cli/dist/commands.js +1028 -0
- package/packages/cli/dist/commands.js.map +1 -0
- package/packages/cli/dist/dashboard-app.d.ts +6 -0
- package/packages/cli/dist/dashboard-app.d.ts.map +1 -1
- package/packages/cli/dist/dashboard-app.js +16 -1
- package/packages/cli/dist/dashboard-app.js.map +1 -1
- package/packages/cli/dist/doctor-probes.d.ts.map +1 -1
- package/packages/cli/dist/doctor-probes.js +5 -2
- package/packages/cli/dist/doctor-probes.js.map +1 -1
- package/packages/cli/dist/doctor.d.ts +16 -0
- package/packages/cli/dist/doctor.d.ts.map +1 -1
- package/packages/cli/dist/doctor.js +18 -0
- package/packages/cli/dist/doctor.js.map +1 -1
- package/packages/cli/dist/index.d.ts +4 -1
- package/packages/cli/dist/index.d.ts.map +1 -1
- package/packages/cli/dist/index.js +4 -1
- package/packages/cli/dist/index.js.map +1 -1
- package/packages/cli/dist/jobs-cmd.d.ts +4 -0
- package/packages/cli/dist/jobs-cmd.d.ts.map +1 -1
- package/packages/cli/dist/jobs-cmd.js +26 -7
- package/packages/cli/dist/jobs-cmd.js.map +1 -1
- package/packages/cli/dist/main.d.ts +9 -2
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +256 -30
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/paths.d.ts +7 -4
- package/packages/cli/dist/paths.d.ts.map +1 -1
- package/packages/cli/dist/paths.js +17 -6
- package/packages/cli/dist/paths.js.map +1 -1
- package/packages/cli/dist/status.d.ts +70 -0
- package/packages/cli/dist/status.d.ts.map +1 -0
- package/packages/cli/dist/status.js +122 -0
- package/packages/cli/dist/status.js.map +1 -0
- package/packages/cli/dist/style.d.ts +13 -0
- package/packages/cli/dist/style.d.ts.map +1 -0
- package/packages/cli/dist/style.js +10 -0
- package/packages/cli/dist/style.js.map +1 -0
- package/packages/cli/dist/telegram-cmd.d.ts +1 -1
- package/packages/cli/dist/telegram-cmd.d.ts.map +1 -1
- package/packages/cli/dist/telegram-cmd.js +23 -6
- package/packages/cli/dist/telegram-cmd.js.map +1 -1
- package/packages/cli/dist/uninstall-cmd.d.ts +42 -0
- package/packages/cli/dist/uninstall-cmd.d.ts.map +1 -0
- package/packages/cli/dist/uninstall-cmd.js +208 -0
- package/packages/cli/dist/uninstall-cmd.js.map +1 -0
- package/packages/cli/dist/vault-cmd.js +3 -3
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/actions/approvals.d.ts +0 -17
- package/packages/core/dist/actions/approvals.d.ts.map +1 -1
- package/packages/core/dist/actions/approvals.js +21 -0
- package/packages/core/dist/actions/approvals.js.map +1 -1
- package/packages/core/dist/actions/execute.d.ts +1 -1
- package/packages/core/dist/actions/jobs.d.ts +1 -1
- package/packages/core/dist/actions/types.js +1 -1
- package/packages/core/dist/agents/models.d.ts.map +1 -1
- package/packages/core/dist/agents/models.js +4 -3
- package/packages/core/dist/agents/models.js.map +1 -1
- package/packages/core/dist/agents/provider-from-env.d.ts +1 -1
- package/packages/core/dist/agents/provider-from-env.js +1 -1
- package/packages/core/dist/agents/skills.d.ts +2 -2
- package/packages/core/dist/goals/frequency.d.ts +51 -0
- package/packages/core/dist/goals/frequency.d.ts.map +1 -0
- package/packages/core/dist/goals/frequency.js +113 -0
- package/packages/core/dist/goals/frequency.js.map +1 -0
- package/packages/core/dist/goals/index.d.ts +2 -0
- package/packages/core/dist/goals/index.d.ts.map +1 -1
- package/packages/core/dist/goals/index.js +2 -0
- package/packages/core/dist/goals/index.js.map +1 -1
- package/packages/core/dist/goals/math.d.ts +8 -2
- package/packages/core/dist/goals/math.d.ts.map +1 -1
- package/packages/core/dist/goals/math.js +17 -4
- package/packages/core/dist/goals/math.js.map +1 -1
- package/packages/core/dist/goals/owner.d.ts +129 -0
- package/packages/core/dist/goals/owner.d.ts.map +1 -0
- package/packages/core/dist/goals/owner.js +239 -0
- package/packages/core/dist/goals/owner.js.map +1 -0
- package/packages/core/dist/goals/store.d.ts.map +1 -1
- package/packages/core/dist/goals/store.js +11 -4
- package/packages/core/dist/goals/store.js.map +1 -1
- package/packages/core/dist/goals/types.d.ts +17 -3
- package/packages/core/dist/goals/types.d.ts.map +1 -1
- package/packages/core/dist/goals/types.js +8 -2
- package/packages/core/dist/goals/types.js.map +1 -1
- package/packages/core/dist/host/build.d.ts +15 -1
- package/packages/core/dist/host/build.d.ts.map +1 -1
- package/packages/core/dist/host/build.js +99 -1
- package/packages/core/dist/host/build.js.map +1 -1
- package/packages/core/dist/host/types.d.ts +88 -1
- package/packages/core/dist/host/types.d.ts.map +1 -1
- package/packages/core/dist/index.d.ts +1 -0
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/index.js +1 -0
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/learning/announce.d.ts +29 -0
- package/packages/core/dist/learning/announce.d.ts.map +1 -0
- package/packages/core/dist/learning/announce.js +49 -0
- package/packages/core/dist/learning/announce.js.map +1 -0
- package/packages/core/dist/learning/index.d.ts +1 -0
- package/packages/core/dist/learning/index.d.ts.map +1 -1
- package/packages/core/dist/learning/index.js +1 -0
- package/packages/core/dist/learning/index.js.map +1 -1
- package/packages/core/dist/learning/store.d.ts.map +1 -1
- package/packages/core/dist/learning/store.js +15 -4
- package/packages/core/dist/learning/store.js.map +1 -1
- package/packages/core/dist/notifications/channels.d.ts +37 -0
- package/packages/core/dist/notifications/channels.d.ts.map +1 -0
- package/packages/core/dist/notifications/channels.js +87 -0
- package/packages/core/dist/notifications/channels.js.map +1 -0
- package/packages/core/dist/notifications/index.d.ts +5 -0
- package/packages/core/dist/notifications/index.d.ts.map +1 -0
- package/packages/core/dist/notifications/index.js +5 -0
- package/packages/core/dist/notifications/index.js.map +1 -0
- package/packages/core/dist/notifications/notify.d.ts +35 -0
- package/packages/core/dist/notifications/notify.d.ts.map +1 -0
- package/packages/core/dist/notifications/notify.js +263 -0
- package/packages/core/dist/notifications/notify.js.map +1 -0
- package/packages/core/dist/notifications/store.d.ts +50 -0
- package/packages/core/dist/notifications/store.d.ts.map +1 -0
- package/packages/core/dist/notifications/store.js +216 -0
- package/packages/core/dist/notifications/store.js.map +1 -0
- package/packages/core/dist/notifications/types.d.ts +142 -0
- package/packages/core/dist/notifications/types.d.ts.map +1 -0
- package/packages/core/dist/notifications/types.js +5 -0
- package/packages/core/dist/notifications/types.js.map +1 -0
- package/packages/core/dist/owner.js +1 -1
- package/packages/core/dist/pages.d.ts +2 -2
- package/packages/core/dist/plugin/index.d.ts +1 -1
- package/packages/core/dist/plugin/index.d.ts.map +1 -1
- package/packages/core/dist/plugin/uses.d.ts +1 -1
- package/packages/core/dist/plugin/uses.d.ts.map +1 -1
- package/packages/core/dist/plugin/uses.js +4 -0
- package/packages/core/dist/plugin/uses.js.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.d.ts +1 -1
- package/packages/core/dist/provider.js +1 -1
- package/packages/core/dist/queue/retry-policy.d.ts +1 -1
- package/packages/core/dist/queue/retry-policy.js +1 -1
- package/packages/core/dist/registry.d.ts.map +1 -1
- package/packages/core/dist/registry.js +3 -4
- package/packages/core/dist/registry.js.map +1 -1
- package/packages/core/dist/reminders/store.d.ts +1 -1
- package/packages/core/dist/reminders/store.js +1 -1
- package/packages/core/dist/reminders/types.d.ts +1 -1
- package/packages/core/dist/reminders/types.js +1 -1
- package/packages/core/dist/sentinels/run.d.ts.map +1 -1
- package/packages/core/dist/sentinels/run.js +4 -1
- package/packages/core/dist/sentinels/run.js.map +1 -1
- package/packages/core/dist/sentinels/types.d.ts +21 -1
- package/packages/core/dist/sentinels/types.d.ts.map +1 -1
- package/packages/core/dist/sentinels/types.js.map +1 -1
- package/packages/core/dist/surfaces.d.ts +2 -0
- package/packages/core/dist/surfaces.d.ts.map +1 -1
- package/packages/core/dist/surfaces.js +7 -0
- package/packages/core/dist/surfaces.js.map +1 -1
- package/packages/core/dist/time.d.ts +12 -0
- package/packages/core/dist/time.d.ts.map +1 -1
- package/packages/core/dist/time.js +46 -0
- package/packages/core/dist/time.js.map +1 -1
- package/packages/core/dist/tools.d.ts +5 -5
- package/packages/core/dist/uninstall.d.ts +79 -0
- package/packages/core/dist/uninstall.d.ts.map +1 -0
- package/packages/core/dist/uninstall.js +109 -0
- package/packages/core/dist/uninstall.js.map +1 -0
- package/packages/core/dist/vault/file.js +2 -2
- package/packages/core/dist/vault/keychain.js +1 -1
- package/packages/core/dist/vault/keychain.js.map +1 -1
- package/packages/core/dist/vault/resolve.d.ts +3 -3
- package/packages/core/dist/vault/resolve.js +3 -3
- package/packages/core/dist/vault/types.d.ts +1 -1
- package/packages/core/dist/vault/types.js +1 -1
- package/packages/core/dist/views.d.ts +66 -66
- package/packages/core/migrations/003_owner_surfaces.sql +1 -1
- package/packages/core/migrations/005_artifacts.sql +1 -1
- package/packages/core/migrations/009_queue.sql +1 -2
- package/packages/core/migrations/010_actions.sql +1 -1
- package/packages/core/migrations/043_owner_notifications.sql +77 -0
- package/packages/core/migrations/044_owner_metrics.sql +45 -0
- package/packages/core/migrations/045_frequency_goals.sql +19 -0
- package/packages/core/package.json +4 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents/catalog.js +1 -1
- package/packages/gateway/dist/agents-cli.d.ts +25 -1
- package/packages/gateway/dist/agents-cli.d.ts.map +1 -1
- package/packages/gateway/dist/agents-cli.js +91 -27
- package/packages/gateway/dist/agents-cli.js.map +1 -1
- package/packages/gateway/dist/bootstrap.d.ts.map +1 -1
- package/packages/gateway/dist/bootstrap.js +8 -0
- package/packages/gateway/dist/bootstrap.js.map +1 -1
- package/packages/gateway/dist/channels/local-notification.d.ts +39 -0
- package/packages/gateway/dist/channels/local-notification.d.ts.map +1 -0
- package/packages/gateway/dist/channels/local-notification.js +154 -0
- package/packages/gateway/dist/channels/local-notification.js.map +1 -0
- package/packages/gateway/dist/chat/approvals.d.ts +3 -3
- package/packages/gateway/dist/chat/approvals.js +3 -3
- package/packages/gateway/dist/chat/usage.d.ts.map +1 -1
- package/packages/gateway/dist/chat/usage.js +1 -0
- package/packages/gateway/dist/chat/usage.js.map +1 -1
- package/packages/gateway/dist/cli.d.ts +14 -0
- package/packages/gateway/dist/cli.d.ts.map +1 -1
- package/packages/gateway/dist/cli.js +208 -37
- package/packages/gateway/dist/cli.js.map +1 -1
- package/packages/gateway/dist/db-ready.d.ts +2 -1
- package/packages/gateway/dist/db-ready.d.ts.map +1 -1
- package/packages/gateway/dist/db-ready.js +3 -2
- package/packages/gateway/dist/db-ready.js.map +1 -1
- package/packages/gateway/dist/index.d.ts +5 -1
- package/packages/gateway/dist/index.d.ts.map +1 -1
- package/packages/gateway/dist/index.js +6 -1
- package/packages/gateway/dist/index.js.map +1 -1
- package/packages/gateway/dist/missions/agent-run.d.ts.map +1 -1
- package/packages/gateway/dist/missions/agent-run.js +11 -1
- package/packages/gateway/dist/missions/agent-run.js.map +1 -1
- package/packages/gateway/dist/missions/execute.d.ts +22 -1
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +8 -1
- package/packages/gateway/dist/missions/execute.js.map +1 -1
- package/packages/gateway/dist/missions/goals-format.d.ts +32 -5
- package/packages/gateway/dist/missions/goals-format.d.ts.map +1 -1
- package/packages/gateway/dist/missions/goals-format.js +59 -2
- package/packages/gateway/dist/missions/goals-format.js.map +1 -1
- package/packages/gateway/dist/missions/goals-page.d.ts +60 -5
- package/packages/gateway/dist/missions/goals-page.d.ts.map +1 -1
- package/packages/gateway/dist/missions/goals-page.js +355 -8
- package/packages/gateway/dist/missions/goals-page.js.map +1 -1
- package/packages/gateway/dist/missions/goals.d.ts +64 -5
- package/packages/gateway/dist/missions/goals.d.ts.map +1 -1
- package/packages/gateway/dist/missions/goals.js +834 -116
- package/packages/gateway/dist/missions/goals.js.map +1 -1
- package/packages/gateway/dist/missions/sentinel-wake.d.ts +5 -0
- package/packages/gateway/dist/missions/sentinel-wake.d.ts.map +1 -1
- package/packages/gateway/dist/missions/sentinel-wake.js +12 -0
- package/packages/gateway/dist/missions/sentinel-wake.js.map +1 -1
- package/packages/gateway/dist/missions-cli.d.ts +2 -0
- package/packages/gateway/dist/missions-cli.d.ts.map +1 -1
- package/packages/gateway/dist/missions-cli.js +53 -8
- package/packages/gateway/dist/missions-cli.js.map +1 -1
- package/packages/gateway/dist/owner-notify.d.ts +44 -0
- package/packages/gateway/dist/owner-notify.d.ts.map +1 -0
- package/packages/gateway/dist/owner-notify.js +91 -0
- package/packages/gateway/dist/owner-notify.js.map +1 -0
- package/packages/gateway/dist/plugins-cli.d.ts +3 -1
- package/packages/gateway/dist/plugins-cli.d.ts.map +1 -1
- package/packages/gateway/dist/plugins-cli.js +11 -4
- package/packages/gateway/dist/plugins-cli.js.map +1 -1
- package/packages/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/packages/gateway/dist/provider-accounts.js +22 -13
- package/packages/gateway/dist/provider-accounts.js.map +1 -1
- package/packages/gateway/dist/reminders-cli.d.ts +3 -1
- package/packages/gateway/dist/reminders-cli.d.ts.map +1 -1
- package/packages/gateway/dist/reminders-cli.js +21 -2
- package/packages/gateway/dist/reminders-cli.js.map +1 -1
- package/packages/gateway/dist/serve.d.ts +2 -0
- package/packages/gateway/dist/serve.d.ts.map +1 -1
- package/packages/gateway/dist/serve.js +61 -13
- package/packages/gateway/dist/serve.js.map +1 -1
- package/packages/gateway/dist/subscription-signins.d.ts +28 -0
- package/packages/gateway/dist/subscription-signins.d.ts.map +1 -0
- package/packages/gateway/dist/subscription-signins.js +30 -0
- package/packages/gateway/dist/subscription-signins.js.map +1 -0
- package/packages/gateway/dist/telegram/api.d.ts +43 -9
- package/packages/gateway/dist/telegram/api.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/api.js +80 -21
- package/packages/gateway/dist/telegram/api.js.map +1 -1
- package/packages/gateway/dist/telegram/approvals.d.ts +3 -3
- package/packages/gateway/dist/telegram/approvals.js +3 -3
- package/packages/gateway/dist/telegram/attachments.d.ts +6 -0
- package/packages/gateway/dist/telegram/attachments.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/attachments.js +1 -0
- package/packages/gateway/dist/telegram/attachments.js.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.js +2 -1
- package/packages/gateway/dist/telegram/browser-view.js.map +1 -1
- package/packages/gateway/dist/telegram/channel.d.ts +36 -0
- package/packages/gateway/dist/telegram/channel.d.ts.map +1 -0
- package/packages/gateway/dist/telegram/channel.js +71 -0
- package/packages/gateway/dist/telegram/channel.js.map +1 -0
- package/packages/gateway/dist/telegram/commands.d.ts +28 -0
- package/packages/gateway/dist/telegram/commands.d.ts.map +1 -0
- package/packages/gateway/dist/telegram/commands.js +74 -0
- package/packages/gateway/dist/telegram/commands.js.map +1 -0
- package/packages/gateway/dist/telegram/main.d.ts +3 -0
- package/packages/gateway/dist/telegram/main.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/main.js +71 -2
- package/packages/gateway/dist/telegram/main.js.map +1 -1
- package/packages/gateway/dist/telegram/outbound.d.ts +191 -0
- package/packages/gateway/dist/telegram/outbound.d.ts.map +1 -0
- package/packages/gateway/dist/telegram/outbound.js +671 -0
- package/packages/gateway/dist/telegram/outbound.js.map +1 -0
- package/packages/gateway/dist/telegram/proposals.d.ts +65 -0
- package/packages/gateway/dist/telegram/proposals.d.ts.map +1 -0
- package/packages/gateway/dist/telegram/proposals.js +183 -0
- package/packages/gateway/dist/telegram/proposals.js.map +1 -0
- package/packages/gateway/dist/telegram/surface.d.ts +47 -47
- package/packages/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/surface.js +103 -291
- package/packages/gateway/dist/telegram/surface.js.map +1 -1
- package/packages/gateway/dist/web/config.js +3 -3
- package/packages/gateway/dist/web/http.d.ts +16 -3
- package/packages/gateway/dist/web/http.d.ts.map +1 -1
- package/packages/gateway/dist/web/http.js +39 -3
- package/packages/gateway/dist/web/http.js.map +1 -1
- package/packages/gateway/dist/web/notifications.d.ts +36 -0
- package/packages/gateway/dist/web/notifications.d.ts.map +1 -0
- package/packages/gateway/dist/web/notifications.js +63 -0
- package/packages/gateway/dist/web/notifications.js.map +1 -0
- package/packages/gateway/dist/web/onboarding.d.ts +1 -1
- package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/packages/gateway/dist/web/onboarding.js +5 -1
- package/packages/gateway/dist/web/onboarding.js.map +1 -1
- package/packages/gateway/dist/web/read.js +3 -3
- package/packages/gateway/dist/web/secrets.d.ts.map +1 -1
- package/packages/gateway/dist/web/secrets.js +3 -2
- package/packages/gateway/dist/web/secrets.js.map +1 -1
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +54 -23
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/telegram.d.ts +39 -0
- package/packages/gateway/dist/web/telegram.d.ts.map +1 -1
- package/packages/gateway/dist/web/telegram.js +53 -1
- package/packages/gateway/dist/web/telegram.js.map +1 -1
- package/packages/gateway/dist/web/version.d.ts +1 -0
- package/packages/gateway/dist/web/version.d.ts.map +1 -1
- package/packages/gateway/dist/web/version.js +2 -1
- package/packages/gateway/dist/web/version.js.map +1 -1
- package/packages/gateway/dist/web/write.js +1 -1
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/install/dist/environment.d.ts +29 -0
- package/packages/install/dist/environment.d.ts.map +1 -1
- package/packages/install/dist/environment.js +50 -1
- package/packages/install/dist/environment.js.map +1 -1
- package/packages/install/dist/launcher.d.ts +3 -1
- package/packages/install/dist/launcher.d.ts.map +1 -1
- package/packages/install/dist/launcher.js +220 -14
- package/packages/install/dist/launcher.js.map +1 -1
- package/packages/install/dist/uninstall.d.ts +59 -0
- package/packages/install/dist/uninstall.d.ts.map +1 -0
- package/packages/install/dist/uninstall.js +260 -0
- package/packages/install/dist/uninstall.js.map +1 -0
- package/packages/install/dist/upgrade.d.ts +16 -3
- package/packages/install/dist/upgrade.d.ts.map +1 -1
- package/packages/install/dist/upgrade.js +21 -7
- package/packages/install/dist/upgrade.js.map +1 -1
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/anthropic.d.ts +35 -2
- package/packages/runtime/dist/anthropic.d.ts.map +1 -1
- package/packages/runtime/dist/anthropic.js +36 -12
- package/packages/runtime/dist/anthropic.js.map +1 -1
- package/packages/runtime/dist/context-window.d.ts.map +1 -1
- package/packages/runtime/dist/context-window.js +5 -2
- package/packages/runtime/dist/context-window.js.map +1 -1
- package/packages/runtime/dist/delegate.js +1 -1
- package/packages/runtime/dist/loop.d.ts +13 -1
- package/packages/runtime/dist/loop.d.ts.map +1 -1
- package/packages/runtime/dist/loop.js +70 -3
- package/packages/runtime/dist/loop.js.map +1 -1
- package/packages/runtime/dist/openai.d.ts.map +1 -1
- package/packages/runtime/dist/openai.js +26 -8
- package/packages/runtime/dist/openai.js.map +1 -1
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/artifacts/dist/index.d.ts +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/availability.d.ts +34 -8
- package/packages/tools/browser/dist/availability.d.ts.map +1 -1
- package/packages/tools/browser/dist/availability.js +44 -5
- package/packages/tools/browser/dist/availability.js.map +1 -1
- package/packages/tools/browser/dist/controller.d.ts +2 -2
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +7 -6
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/host.d.ts +3 -1
- package/packages/tools/browser/dist/host.d.ts.map +1 -1
- package/packages/tools/browser/dist/host.js +5 -1
- package/packages/tools/browser/dist/host.js.map +1 -1
- package/packages/tools/browser/dist/index.d.ts +2 -2
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +13 -5
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/origin-pattern.d.ts +31 -0
- package/packages/tools/browser/dist/origin-pattern.d.ts.map +1 -0
- package/packages/tools/browser/dist/origin-pattern.js +61 -0
- package/packages/tools/browser/dist/origin-pattern.js.map +1 -0
- package/packages/tools/browser/dist/public-suffixes.d.ts +24 -0
- package/packages/tools/browser/dist/public-suffixes.d.ts.map +1 -0
- package/packages/tools/browser/dist/public-suffixes.js +153 -0
- package/packages/tools/browser/dist/public-suffixes.js.map +1 -0
- package/packages/tools/browser/dist/secrets.d.ts +45 -9
- package/packages/tools/browser/dist/secrets.d.ts.map +1 -1
- package/packages/tools/browser/dist/secrets.js +77 -20
- package/packages/tools/browser/dist/secrets.js.map +1 -1
- package/packages/tools/browser/dist/service.d.ts +12 -2
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js +84 -20
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/browser/dist/types.d.ts +7 -1
- package/packages/tools/browser/dist/types.d.ts.map +1 -1
- package/packages/tools/browser/dist/types.js +7 -1
- package/packages/tools/browser/dist/types.js.map +1 -1
- package/packages/tools/email/dist/.tsbuildinfo +1 -1
- package/packages/tools/email/dist/channel.d.ts +43 -0
- package/packages/tools/email/dist/channel.d.ts.map +1 -0
- package/packages/tools/email/dist/channel.js +99 -0
- package/packages/tools/email/dist/channel.js.map +1 -0
- package/packages/tools/email/dist/index.d.ts +1 -0
- package/packages/tools/email/dist/index.d.ts.map +1 -1
- package/packages/tools/email/dist/index.js +8 -1
- package/packages/tools/email/dist/index.js.map +1 -1
- package/packages/tools/email/dist/ports.d.ts +3 -3
- package/packages/tools/email/dist/ports.js +1 -1
- package/packages/tools/email/dist/tools/drafts.d.ts +1 -1
- package/packages/tools/email/dist/tools/read.js +1 -1
- package/packages/tools/email/dist/tools/read.js.map +1 -1
- package/packages/tools/email/dist/tools/send.js +1 -1
- package/packages/tools/email/migrations/001_email.sql +3 -2
- package/packages/tools/email/package.json +2 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/memory/dist/.tsbuildinfo +1 -1
- package/packages/tools/memory/dist/index.js +1 -1
- package/packages/tools/memory/migrations/001_memory.sql +1 -1
- package/packages/tools/web/dist/.tsbuildinfo +1 -1
- package/packages/web/dist/assets/dm-mono-latin-400-normal--0xN8mdc.woff +0 -0
- package/packages/web/dist/assets/dm-mono-latin-400-normal-4GdczIuU.woff2 +0 -0
- package/packages/web/dist/assets/dm-mono-latin-500-normal-CN8Miw6E.woff +0 -0
- package/packages/web/dist/assets/dm-mono-latin-500-normal-DRMDZjhP.woff2 +0 -0
- package/packages/web/dist/assets/dm-mono-latin-ext-400-normal-1aZr6b2b.woff +0 -0
- package/packages/web/dist/assets/dm-mono-latin-ext-400-normal-C2zvOubV.woff2 +0 -0
- package/packages/web/dist/assets/dm-mono-latin-ext-500-normal-BtRyHRi6.woff2 +0 -0
- package/packages/web/dist/assets/dm-mono-latin-ext-500-normal-Dw3M13d8.woff +0 -0
- package/packages/web/dist/assets/dm-sans-latin-ext-standard-italic-DNX9AbKj.woff2 +0 -0
- package/packages/web/dist/assets/dm-sans-latin-ext-standard-normal-oos9povj.woff2 +0 -0
- package/packages/web/dist/assets/dm-sans-latin-standard-italic-C8i6y2Ft.woff2 +0 -0
- package/packages/web/dist/assets/dm-sans-latin-standard-normal-Bf69Tn_J.woff2 +0 -0
- package/packages/web/dist/assets/index-B727JQsO.css +1 -0
- package/packages/web/dist/assets/index-OA0xgibo.js +123 -0
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/assets/index-CxaF2koC.js +0 -122
- package/packages/web/dist/assets/index-DEho_xyR.css +0 -1
|
@@ -15,14 +15,23 @@
|
|
|
15
15
|
* - Runs are serialized per chat, so two quick messages cannot interleave in
|
|
16
16
|
* one conversation.
|
|
17
17
|
*/
|
|
18
|
-
import { DEFAULT_TIMEZONE, cancelReminder, getOnboarding, consumePairingCode, getActiveAgent, getOwnerDisplayName, listReminders, listSurfaceIdentitiesDetailed, localDateString, recordOfferJob, renderOffers, localDateTimeString, recordSurfaceUpdate, resolveOwnerForSurface, roleProblemMessage, setActiveAgent, setSurfaceCursor, takeOffer, answerQuestion, getQuestion, TELEGRAM_SURFACE, touchSurfaceIdentity, } from '@buddi/core';
|
|
18
|
+
import { DEFAULT_TIMEZONE, cancelReminder, getOnboarding, consumePairingCode, getActiveAgent, getOwnerDisplayName, listReminders, listSurfaceIdentitiesDetailed, localDateString, recordOfferJob, renderOffers, localDateTimeString, recordSurfaceUpdate, resolveOwnerForSurface, roleProblemMessage, setActiveAgent, setSurfaceCursor, takeOffer, answerQuestion, getQuestion, TELEGRAM_SURFACE, touchSurfaceIdentity, presenceTouch, } from '@buddi/core';
|
|
19
19
|
import { InterjectionQueue, createConversation } from '@buddi/runtime';
|
|
20
|
-
import { MAX_CALLBACK_DATA_BYTES,
|
|
20
|
+
import { MAX_CALLBACK_DATA_BYTES, } from './api.js';
|
|
21
21
|
import { extractAttachment, filesText, formatBytes, getLastAttachment, gotAudioText, gotFileText, listChatAttachments, MAX_ATTACHMENT_BYTES, ATTACHMENT_RECENCY_MS, oversizeText, recordChatAttachment, referencesAttachment, } from './attachments.js';
|
|
22
22
|
import { BROWSER_COMMAND_HELP, parseBrowserCommand, } from './browser-view.js';
|
|
23
23
|
import { isUnknownAgentError } from './types.js';
|
|
24
|
+
import { whereText } from './commands.js';
|
|
25
|
+
import { BURST_GAP_MS, StreamedAnswer, sendBurst, sendRunExtras, toPlainText, } from './outbound.js';
|
|
24
26
|
import { FIRST_RUN_SUFFIX, shouldStartFirstRun } from '../agents/first-run.js';
|
|
25
27
|
export const SURFACE = 'telegram';
|
|
28
|
+
/** Proposal cards' callback prefix (`proposals.ts`); here so routing needs no import cycle. */
|
|
29
|
+
export const PROPOSAL_CALLBACK_PREFIX = 'prp';
|
|
30
|
+
/** `/missions` or `/goals` in a build that cannot read them. */
|
|
31
|
+
export const SCHEDULE_UNAVAILABLE_TEXT = 'I cannot read the schedule from here; it is on the dashboard.';
|
|
32
|
+
export const GOALS_UNAVAILABLE_TEXT = 'I cannot read the goals from here; they are on the dashboard.';
|
|
33
|
+
// Moved to `outbound.ts`, where every send lives; still importable from here.
|
|
34
|
+
export { BURST_GAP_MS, MAX_BURST_MESSAGES, TOOL_NAMESPACES, splitIntoMessages, stripToolNames, toPlainText, } from './outbound.js';
|
|
26
35
|
/** The bubble posted when the agent that is working is not known by name. */
|
|
27
36
|
export const PLACEHOLDER_TEXT = '⏳ Working on it…';
|
|
28
37
|
/**
|
|
@@ -88,6 +97,8 @@ export const HELP = [
|
|
|
88
97
|
'',
|
|
89
98
|
'Send a statement, a receipt photo or a CSV and tell me what to do with it.',
|
|
90
99
|
'',
|
|
100
|
+
'Answers here are kept short, because you read them on a phone. Ask for more and you get more.',
|
|
101
|
+
'',
|
|
91
102
|
'Just write your question. Commands:',
|
|
92
103
|
'/agents — list the agents you can talk to, and tap one to switch',
|
|
93
104
|
'/use <handle> — switch to an agent, e.g. /use @ledger',
|
|
@@ -99,6 +110,9 @@ export const HELP = [
|
|
|
99
110
|
'/reminders — what the agents have put on the clock, with a button to cancel one',
|
|
100
111
|
'/quiet [1d|1w|off] — stop proactive messages for a while (7 days by default)',
|
|
101
112
|
'/approvals — anything waiting for your approval',
|
|
113
|
+
'/missions — the next five scheduled missions',
|
|
114
|
+
'/goals — each goal with its number and where it stands',
|
|
115
|
+
'/where — the dashboard address, when your phone can reach it',
|
|
102
116
|
'/browser — where the screen stands; /browser stop, /browser resume, /browser release',
|
|
103
117
|
'/host — host execution permissions and running commands',
|
|
104
118
|
'/hoststop — interrupt all host commands',
|
|
@@ -119,37 +133,9 @@ export const HELP = [
|
|
|
119
133
|
* onboarding is `pending`, the default agent is run with `FIRST_RUN_SUFFIX` and
|
|
120
134
|
* conducts the interview in its own words, using the `owner.*` tools.
|
|
121
135
|
*
|
|
122
|
-
* What is left in code is only the *shape* of the delivery,
|
|
123
|
-
|
|
124
|
-
/** How many messages one first-run answer may be broken into. */
|
|
125
|
-
export const MAX_BURST_MESSAGES = 3;
|
|
126
|
-
/** The pause between them: long enough to read as typing, short enough to wait. */
|
|
127
|
-
export const BURST_GAP_MS = 600;
|
|
128
|
-
/**
|
|
129
|
-
* Break an answer into the messages it should arrive as.
|
|
130
|
-
*
|
|
131
|
-
* A paragraph break is the agent saying "and then this" — in a chat that is a
|
|
132
|
-
* second message, not a blank line inside one bubble. So up to
|
|
133
|
-
* `MAX_BURST_MESSAGES` paragraphs become that many sends, with a typing
|
|
134
|
-
* indicator in between.
|
|
135
|
-
*
|
|
136
|
-
* The cap is a cap, not a truncation: an answer with *more* paragraphs than
|
|
137
|
-
* that is sent whole. Breaking a six-paragraph explanation into three bubbles
|
|
138
|
-
* and a blob would read worse than either, and a first run should never be
|
|
139
|
-
* six paragraphs anyway — the skill says two short messages, maximum.
|
|
136
|
+
* What is left in code is only the *shape* of the delivery, which lives in
|
|
137
|
+
* `outbound.ts` with every other send.
|
|
140
138
|
*/
|
|
141
|
-
export function splitIntoMessages(text, max = MAX_BURST_MESSAGES) {
|
|
142
|
-
const body = text.trim();
|
|
143
|
-
if (body === '')
|
|
144
|
-
return [];
|
|
145
|
-
const paragraphs = body
|
|
146
|
-
.split(/\n\s*\n/)
|
|
147
|
-
.map((part) => part.trim())
|
|
148
|
-
.filter((part) => part !== '');
|
|
149
|
-
if (paragraphs.length <= 1 || paragraphs.length > max)
|
|
150
|
-
return [body];
|
|
151
|
-
return paragraphs;
|
|
152
|
-
}
|
|
153
139
|
/**
|
|
154
140
|
* A file arrived in a build with no artifact store wired up. Not an error the
|
|
155
141
|
* owner caused, and said as a fact about the installation rather than a stack.
|
|
@@ -325,215 +311,19 @@ export function newAgentOpening(arg) {
|
|
|
325
311
|
const said = arg.trim();
|
|
326
312
|
return said === '' ? NEW_AGENT_OPENING : said;
|
|
327
313
|
}
|
|
314
|
+
/** The extras a reply carries past its text, copied onto the drawn turn. */
|
|
315
|
+
function extrasOf(produced) {
|
|
316
|
+
if (typeof produced === 'string')
|
|
317
|
+
return {};
|
|
318
|
+
return {
|
|
319
|
+
...(produced.artifacts && produced.artifacts.length > 0 ? { artifacts: produced.artifacts } : {}),
|
|
320
|
+
...(produced.canvas ? { canvas: produced.canvas } : {}),
|
|
321
|
+
};
|
|
322
|
+
}
|
|
328
323
|
/** The text of a reply, whichever shape the runner returned. */
|
|
329
324
|
export function replyText(reply) {
|
|
330
325
|
return typeof reply === 'string' ? reply : reply.text;
|
|
331
326
|
}
|
|
332
|
-
/* ------------------------------------------------------------------ *
|
|
333
|
-
* Plain text safety net
|
|
334
|
-
* ------------------------------------------------------------------ */
|
|
335
|
-
/*
|
|
336
|
-
* We never send `parse_mode`, so any markdown a model emits is shown to the
|
|
337
|
-
* owner literally: `**Status — 2026-09-13**`, backticks, pipe tables. The
|
|
338
|
-
* prompt asks for plain text; this is the deterministic net under that ask.
|
|
339
|
-
*
|
|
340
|
-
* It is pure and conservative: markers are only removed when they actually
|
|
341
|
-
* wrap a span, so arithmetic (`2 * 3`) and identifiers (`snake_case`) survive
|
|
342
|
-
* untouched, and no digit, currency symbol or word is ever rewritten.
|
|
343
|
-
*/
|
|
344
|
-
/** A ``` fence line, with or without a language tag. */
|
|
345
|
-
const FENCE_RE = /^\s*```[A-Za-z0-9_+-]*\s*$/;
|
|
346
|
-
/** `# Heading` → `Heading`. Only at the start of a line, marker plus space. */
|
|
347
|
-
const HEADING_RE = /^(\s*)#{1,6}[ \t]+(?=\S)/;
|
|
348
|
-
/** `[label](url)` → `label (url)`. */
|
|
349
|
-
const LINK_RE = /\[([^\]\n]*)\]\(([^()\s]*)\)/g;
|
|
350
|
-
/** `` `code` `` → `code`. Single backticks only; the span may not be empty. */
|
|
351
|
-
const INLINE_CODE_RE = /`([^`\n]+)`/g;
|
|
352
|
-
/** `**bold**` — both markers must hug non-space, so `a ** b` is left alone. */
|
|
353
|
-
const BOLD_STAR_RE = /\*\*(?=\S)([^*\n]+?)(?<=\S)\*\*/g;
|
|
354
|
-
/** `__bold__` — word characters on either side mean it is an identifier. */
|
|
355
|
-
const BOLD_UNDER_RE = /(^|[^\w])__(?=\S)([^_\n]+?)(?<=\S)__(?!\w)/g;
|
|
356
|
-
/** `*italic*` — a lone `*` (as in `2 * 3`) never matches: it wraps nothing. */
|
|
357
|
-
const ITALIC_STAR_RE = /\*(?=\S)([^*\n]+?)(?<=\S)\*/g;
|
|
358
|
-
/** `_italic_` — `snake_case` keeps its underscores: they sit inside a word. */
|
|
359
|
-
const ITALIC_UNDER_RE = /(^|[^\w])_(?=\S)([^_\n]+?)(?<=\S)_(?!\w)/g;
|
|
360
|
-
/** `|---|:--:|` and friends: a table rule carries no content. */
|
|
361
|
-
function isTableSeparatorRow(cells) {
|
|
362
|
-
return cells.length > 0 && cells.every((cell) => /^:?-{2,}:?$/.test(cell));
|
|
363
|
-
}
|
|
364
|
-
/** `| a | b |` → `a — b`; the separator row is dropped by the caller. */
|
|
365
|
-
function tableCells(line) {
|
|
366
|
-
const trimmed = line.trim();
|
|
367
|
-
if (!trimmed.startsWith('|') || trimmed.length < 2)
|
|
368
|
-
return undefined;
|
|
369
|
-
const inner = trimmed.replace(/^\|/, '').replace(/\|$/, '');
|
|
370
|
-
if (!inner.includes('|') && inner.trim() === '')
|
|
371
|
-
return undefined;
|
|
372
|
-
return inner.split('|').map((cell) => cell.trim());
|
|
373
|
-
}
|
|
374
|
-
/** Marker removal inside one line of prose. Never applied to fenced code. */
|
|
375
|
-
function stripInline(line) {
|
|
376
|
-
return line
|
|
377
|
-
.replace(LINK_RE, (whole, label, url) => {
|
|
378
|
-
const text = label.trim();
|
|
379
|
-
if (url === '')
|
|
380
|
-
return text;
|
|
381
|
-
return text === '' ? url : `${text} (${url})`;
|
|
382
|
-
})
|
|
383
|
-
.replace(INLINE_CODE_RE, '$1')
|
|
384
|
-
.replace(BOLD_STAR_RE, '$1')
|
|
385
|
-
.replace(BOLD_UNDER_RE, '$1$2')
|
|
386
|
-
.replace(ITALIC_STAR_RE, '$1')
|
|
387
|
-
.replace(ITALIC_UNDER_RE, '$1$2');
|
|
388
|
-
}
|
|
389
|
-
/* ------------------------------------------------------------------ *
|
|
390
|
-
* Tool names never reach the owner
|
|
391
|
-
* ------------------------------------------------------------------ */
|
|
392
|
-
/**
|
|
393
|
-
* The namespaces the runtime registers tools under. Tool names are internal
|
|
394
|
-
* plumbing: the owner is told what happened, never which function did it.
|
|
395
|
-
* The personas say so, and this pass is the deterministic net under that ask
|
|
396
|
-
* for the turns where the model slips anyway.
|
|
397
|
-
*
|
|
398
|
-
* The surface is constructed without a registry to read, so this is the one
|
|
399
|
-
* place the namespaces live. A new namespace belongs here the day its tools
|
|
400
|
-
* are registered.
|
|
401
|
-
*/
|
|
402
|
-
export const TOOL_NAMESPACES = [
|
|
403
|
-
'finance',
|
|
404
|
-
'memory',
|
|
405
|
-
'artifacts',
|
|
406
|
-
'email',
|
|
407
|
-
'agent',
|
|
408
|
-
'mission',
|
|
409
|
-
'reminder',
|
|
410
|
-
'schedule',
|
|
411
|
-
];
|
|
412
|
-
/**
|
|
413
|
-
* Tool names that carry no underscore. A dotted pair counts as a tool only
|
|
414
|
-
* when the namespace is known *and* the second half is snake_case or one of
|
|
415
|
-
* these — "has a dot" is never the rule, so `gmail.com`, `shotcrisp.app`,
|
|
416
|
-
* `Statement.pdf`, `v1.2.3` and an email address are all left alone.
|
|
417
|
-
*/
|
|
418
|
-
const TOOL_WORDS = [
|
|
419
|
-
'summary',
|
|
420
|
-
'balance',
|
|
421
|
-
'delegate',
|
|
422
|
-
'report',
|
|
423
|
-
'silent',
|
|
424
|
-
'status',
|
|
425
|
-
'search',
|
|
426
|
-
'send',
|
|
427
|
-
'list',
|
|
428
|
-
'add',
|
|
429
|
-
'set',
|
|
430
|
-
'get',
|
|
431
|
-
'cancel',
|
|
432
|
-
'snooze',
|
|
433
|
-
'purge',
|
|
434
|
-
'remember',
|
|
435
|
-
'recall',
|
|
436
|
-
'forget',
|
|
437
|
-
'note',
|
|
438
|
-
'read',
|
|
439
|
-
'text',
|
|
440
|
-
'describe',
|
|
441
|
-
'reconcile',
|
|
442
|
-
];
|
|
443
|
-
const NAMESPACE_ALT = TOOL_NAMESPACES.join('|');
|
|
444
|
-
/**
|
|
445
|
-
* `finance.set_liability`, `agent.delegate`. The guards on either side keep
|
|
446
|
-
* the match off anything that merely contains a dot: a longer hostname
|
|
447
|
-
* (`mail.finance.summary.io`), a path segment, an address local part. A dot
|
|
448
|
-
* that ends a sentence is not a continuation, so a mention may close one.
|
|
449
|
-
*/
|
|
450
|
-
const TOOL_REF_SRC = `(?<![\\w./@-])(?:${NAMESPACE_ALT})\\.` +
|
|
451
|
-
`(?:[a-z][a-z0-9]*(?:_[a-z0-9]+)+|${TOOL_WORDS.join('|')})(?![\\w@/-])(?!\\.[A-Za-z0-9])`;
|
|
452
|
-
/** `(finance.set_liability)`, `(via agent.delegate)` — the whole aside goes. */
|
|
453
|
-
const TOOL_PAREN_RE = new RegExp(`[ \\t]*\\((?:\\s*(?:via|see|using|through|with|by)\\s+)?${TOOL_REF_SRC}` +
|
|
454
|
-
`(?:[ \\t]*(?:,|and|\\+|&)[ \\t]*${TOOL_REF_SRC})*[ \\t]*\\)`, 'gi');
|
|
455
|
-
/** `` `finance.x` ``, `'finance.x'`, `"finance.x"` — the quotes leave with it. */
|
|
456
|
-
const TOOL_QUOTED_RE = new RegExp(`[\`'"“‘]${TOOL_REF_SRC}[\`'"”’]`, 'gi');
|
|
457
|
-
/** A bare mention, with the connector that introduced it when there is one. */
|
|
458
|
-
const TOOL_BARE_RE = new RegExp(`(?:[ \\t]+(?:via|using|through|by calling)[ \\t]+)?${TOOL_REF_SRC}`, 'gi');
|
|
459
|
-
/**
|
|
460
|
-
* Spacing and punctuation left dangling by a removal: `stored , and` or
|
|
461
|
-
* `on the calendar .`. Applied only to a line something was actually removed
|
|
462
|
-
* from, so prose that mentions no tool is returned byte for byte.
|
|
463
|
-
*/
|
|
464
|
-
function tidyAfterRemoval(cleaned, indent) {
|
|
465
|
-
const body = cleaned
|
|
466
|
-
.replace(/\(\s*\)/g, '')
|
|
467
|
-
.replace(/\[\s*\]/g, '')
|
|
468
|
-
.replace(/[ \t]{2,}/g, ' ')
|
|
469
|
-
.replace(/\([ \t]+/g, '(')
|
|
470
|
-
.replace(/[ \t]+([,.;:!?)])/g, '$1')
|
|
471
|
-
.replace(/,(?:[ \t]*,)+/g, ',')
|
|
472
|
-
.replace(/,[ \t]*([.;:!?])/g, '$1')
|
|
473
|
-
.replace(/([.;:!?])[ \t]*,/g, '$1')
|
|
474
|
-
.trim();
|
|
475
|
-
if (body === '')
|
|
476
|
-
return '';
|
|
477
|
-
// All that survived is punctuation: the mention *was* the sentence. Drop
|
|
478
|
-
// the remains and leave every other line of the answer untouched.
|
|
479
|
-
return /^[,.;:!?—-]+$/.test(body) ? '' : `${indent}${body}`;
|
|
480
|
-
}
|
|
481
|
-
/** One line of prose, minus any tool reference and the mess it leaves. */
|
|
482
|
-
function stripToolNamesFromLine(line) {
|
|
483
|
-
const cleaned = line
|
|
484
|
-
.replace(TOOL_PAREN_RE, '')
|
|
485
|
-
.replace(TOOL_QUOTED_RE, '')
|
|
486
|
-
.replace(TOOL_BARE_RE, '');
|
|
487
|
-
if (cleaned === line)
|
|
488
|
-
return line;
|
|
489
|
-
return tidyAfterRemoval(cleaned, /^[ \t]*/.exec(line)?.[0] ?? '');
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Remove internal tool names from an agent answer. Pure, idempotent, and
|
|
493
|
-
* conservative: a line with no tool reference in it is returned unchanged.
|
|
494
|
-
*
|
|
495
|
-
* Exported on its own so every surface that renders an answer — Telegram
|
|
496
|
-
* through `toPlainText`, the CLI directly — applies the same rule.
|
|
497
|
-
*/
|
|
498
|
-
export function stripToolNames(text) {
|
|
499
|
-
if (text === '')
|
|
500
|
-
return '';
|
|
501
|
-
return text.split('\n').map(stripToolNamesFromLine).join('\n');
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* Render agent-authored markdown as the plain text Telegram will display
|
|
505
|
-
* verbatim. Pure: same input, same output, no clock and no I/O.
|
|
506
|
-
*
|
|
507
|
-
* Applied to final agent and mission answers only. Progress lines and the
|
|
508
|
-
* surface's own copy (`/help`, `/agents`) are already plain by construction.
|
|
509
|
-
*/
|
|
510
|
-
export function toPlainText(text) {
|
|
511
|
-
if (text === '')
|
|
512
|
-
return '';
|
|
513
|
-
const lines = text.split('\n');
|
|
514
|
-
const out = [];
|
|
515
|
-
let inFence = false;
|
|
516
|
-
for (const line of lines) {
|
|
517
|
-
if (FENCE_RE.test(line)) {
|
|
518
|
-
// Drop the fence, keep whatever it wrapped.
|
|
519
|
-
inFence = !inFence;
|
|
520
|
-
continue;
|
|
521
|
-
}
|
|
522
|
-
if (inFence) {
|
|
523
|
-
out.push(line);
|
|
524
|
-
continue;
|
|
525
|
-
}
|
|
526
|
-
const cells = tableCells(line);
|
|
527
|
-
if (cells) {
|
|
528
|
-
if (isTableSeparatorRow(cells))
|
|
529
|
-
continue;
|
|
530
|
-
out.push(stripToolNamesFromLine(stripInline(cells.join(' — '))));
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
out.push(stripToolNamesFromLine(stripInline(line.replace(HEADING_RE, '$1'))));
|
|
534
|
-
}
|
|
535
|
-
return out.join('\n').replace(/\n{3,}/g, '\n\n');
|
|
536
|
-
}
|
|
537
327
|
/* ------------------------------------------------------------------ *
|
|
538
328
|
* The progress bubble
|
|
539
329
|
* ------------------------------------------------------------------ */
|
|
@@ -553,6 +343,7 @@ export class ProgressBubble {
|
|
|
553
343
|
intervalMs;
|
|
554
344
|
now;
|
|
555
345
|
#labels = [];
|
|
346
|
+
#silent = false;
|
|
556
347
|
#calls = 0;
|
|
557
348
|
#chain = Promise.resolve();
|
|
558
349
|
#lastEditAt = 0;
|
|
@@ -572,7 +363,7 @@ export class ProgressBubble {
|
|
|
572
363
|
const label = toolLabel(name);
|
|
573
364
|
if (!this.#labels.includes(label))
|
|
574
365
|
this.#labels.push(label);
|
|
575
|
-
if (this.messageId === undefined)
|
|
366
|
+
if (this.messageId === undefined || this.#silent)
|
|
576
367
|
return;
|
|
577
368
|
const at = this.now();
|
|
578
369
|
if (this.#lastEditAt !== 0 && at - this.#lastEditAt < this.intervalMs)
|
|
@@ -597,6 +388,13 @@ export class ProgressBubble {
|
|
|
597
388
|
get toolCalls() {
|
|
598
389
|
return this.#calls;
|
|
599
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* Stop editing: the answer is streaming into this message now, and a
|
|
393
|
+
* progress line written over it would take the owner's text away.
|
|
394
|
+
*/
|
|
395
|
+
silence() {
|
|
396
|
+
this.#silent = true;
|
|
397
|
+
}
|
|
600
398
|
/** Wait for in-flight edits, so the final answer is the last write. */
|
|
601
399
|
settle() {
|
|
602
400
|
return this.#chain;
|
|
@@ -843,6 +641,8 @@ export function callbackKind(data) {
|
|
|
843
641
|
return 'offer';
|
|
844
642
|
if (raw.startsWith(`${QUESTION_CALLBACK_PREFIX}:`))
|
|
845
643
|
return 'question';
|
|
644
|
+
if (raw.startsWith(`${PROPOSAL_CALLBACK_PREFIX}:`))
|
|
645
|
+
return 'proposal';
|
|
846
646
|
return 'approval';
|
|
847
647
|
}
|
|
848
648
|
/**
|
|
@@ -997,6 +797,18 @@ export class TelegramSurface {
|
|
|
997
797
|
this.enqueue(chain, () => this.handleQuestionCallback(callback));
|
|
998
798
|
return;
|
|
999
799
|
}
|
|
800
|
+
if (kind === 'proposal') {
|
|
801
|
+
const proposals = this.#opts.proposals;
|
|
802
|
+
if (!proposals) {
|
|
803
|
+
this.#log('telegram: proposal callback ignored (no proposal cards wired)');
|
|
804
|
+
await this.#opts.api.answerCallbackQuery(callback.id).catch(() => { });
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
// Authorization is the proposal handler's, which re-establishes the
|
|
808
|
+
// owner identity from core, as the approval handler does.
|
|
809
|
+
this.enqueue(chain, () => proposals.handleCallback(callback));
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
1000
812
|
const approvals = this.#opts.approvals;
|
|
1001
813
|
if (!approvals) {
|
|
1002
814
|
this.#log('telegram: callback_query ignored (no approval machinery wired)');
|
|
@@ -1177,6 +989,9 @@ export class TelegramSurface {
|
|
|
1177
989
|
/** `last_seen_at`, at most once per identity per `TOUCH_INTERVAL_MS`. */
|
|
1178
990
|
async #touch(userId, label) {
|
|
1179
991
|
const at = this.#now();
|
|
992
|
+
// Presence, unthrottled: the owner is here now, and "now" is what decides
|
|
993
|
+
// whether a notification is shown or sent (docs/notifications.md).
|
|
994
|
+
await presenceTouch(this.#opts.pool, SURFACE, new Date(at)).catch((err) => this.#log(`telegram: presence failed: ${message(err)}`));
|
|
1180
995
|
const last = this.#lastTouch.get(userId);
|
|
1181
996
|
if (last !== undefined && at - last < TOUCH_INTERVAL_MS)
|
|
1182
997
|
return;
|
|
@@ -1345,6 +1160,22 @@ export class TelegramSurface {
|
|
|
1345
1160
|
await this.handleReminders(chatId);
|
|
1346
1161
|
return;
|
|
1347
1162
|
}
|
|
1163
|
+
// Read-only, all three: the phone says where things stand; changing them
|
|
1164
|
+
// is the dashboard's.
|
|
1165
|
+
if (command === '/missions') {
|
|
1166
|
+
const missions = this.#opts.missions;
|
|
1167
|
+
await this.#opts.api.sendMessage(chatId, missions ? await missions() : SCHEDULE_UNAVAILABLE_TEXT);
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
if (command === '/goals') {
|
|
1171
|
+
const goals = this.#opts.goals;
|
|
1172
|
+
await this.#opts.api.sendMessage(chatId, goals ? await goals() : GOALS_UNAVAILABLE_TEXT);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
if (command === '/where') {
|
|
1176
|
+
await this.#opts.api.sendMessage(chatId, whereText(this.#opts.publicOrigin));
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1348
1179
|
// `/quiet 1w` — the argument is everything after the command word, so
|
|
1349
1180
|
// `/quiet` alone parses as the default. The surface never reads a duration.
|
|
1350
1181
|
if (command === '/quiet') {
|
|
@@ -1480,27 +1311,8 @@ export class TelegramSurface {
|
|
|
1480
1311
|
stopTyping();
|
|
1481
1312
|
}
|
|
1482
1313
|
}
|
|
1483
|
-
/**
|
|
1484
|
-
* Send one answer as up to three messages, typing between them.
|
|
1485
|
-
*
|
|
1486
|
-
* The pause is the whole point: three bubbles posted in the same millisecond
|
|
1487
|
-
* are one block with extra steps. `splitIntoMessages` decides how many there
|
|
1488
|
-
* are; this only paces them.
|
|
1489
|
-
*/
|
|
1490
1314
|
async #sendBurst(chatId, reply) {
|
|
1491
|
-
|
|
1492
|
-
if (parts.length === 0) {
|
|
1493
|
-
await this.#opts.api.sendMessage(chatId, '(no reply)');
|
|
1494
|
-
return;
|
|
1495
|
-
}
|
|
1496
|
-
const gap = this.#opts.burstGapMs ?? BURST_GAP_MS;
|
|
1497
|
-
for (const [index, part] of parts.entries()) {
|
|
1498
|
-
if (index > 0) {
|
|
1499
|
-
await this.#opts.api.sendChatAction(chatId).catch(() => { });
|
|
1500
|
-
await sleep(gap);
|
|
1501
|
-
}
|
|
1502
|
-
await this.#opts.api.sendMessage(chatId, part);
|
|
1503
|
-
}
|
|
1315
|
+
await sendBurst(this.#opts.api, chatId, reply, this.#opts.burstGapMs ?? BURST_GAP_MS);
|
|
1504
1316
|
}
|
|
1505
1317
|
/**
|
|
1506
1318
|
* The owner's answer to a question a one-shot agent asked.
|
|
@@ -1577,7 +1389,7 @@ export class TelegramSurface {
|
|
|
1577
1389
|
const interjections = new InterjectionQueue();
|
|
1578
1390
|
this.#interjections.set(chatId, interjections);
|
|
1579
1391
|
try {
|
|
1580
|
-
await this.#withBubble(chatId, async (progress) => {
|
|
1392
|
+
await this.#withBubble(chatId, async (progress, stream) => {
|
|
1581
1393
|
const produced = await this.#opts.run({
|
|
1582
1394
|
conversationId,
|
|
1583
1395
|
chatId,
|
|
@@ -1586,6 +1398,7 @@ export class TelegramSurface {
|
|
|
1586
1398
|
interjections,
|
|
1587
1399
|
...(carried?.attachments.length ? { attachments: carried.attachments } : {}),
|
|
1588
1400
|
onToolCall: (name) => progress.noteToolCall(name),
|
|
1401
|
+
onTextDelta: (delta) => stream.push(delta),
|
|
1589
1402
|
});
|
|
1590
1403
|
const reply = replyText(produced);
|
|
1591
1404
|
askedOwner = turnAskedOwner(typeof produced === 'string' ? undefined : produced.askedOwner, reply);
|
|
@@ -1601,6 +1414,7 @@ export class TelegramSurface {
|
|
|
1601
1414
|
return {
|
|
1602
1415
|
...renderOffers(TELEGRAM_SURFACE, note ? `${note}\n\n${reply}` : reply, typeof produced === 'string' ? [] : (produced.offers ?? [])),
|
|
1603
1416
|
...(typeof produced !== 'string' && produced.question ? { question: produced.question } : {}),
|
|
1417
|
+
...extrasOf(produced),
|
|
1604
1418
|
};
|
|
1605
1419
|
}, label, carried ? readingText(label) : undefined, { agentId: agent.id, conversationId, prompt });
|
|
1606
1420
|
}
|
|
@@ -1758,13 +1572,14 @@ export class TelegramSurface {
|
|
|
1758
1572
|
filename,
|
|
1759
1573
|
sizeBytes: row.sizeBytes,
|
|
1760
1574
|
});
|
|
1761
|
-
await this.#withBubble(chatId, async (progress) => this.#rendered(await this.#opts.run({
|
|
1575
|
+
await this.#withBubble(chatId, async (progress, stream) => this.#rendered(await this.#opts.run({
|
|
1762
1576
|
conversationId,
|
|
1763
1577
|
chatId,
|
|
1764
1578
|
agent,
|
|
1765
1579
|
text: caption,
|
|
1766
1580
|
...(turn.attachments.length ? { attachments: turn.attachments } : {}),
|
|
1767
1581
|
onToolCall: (name) => progress.noteToolCall(name),
|
|
1582
|
+
onTextDelta: (delta) => stream.push(delta),
|
|
1768
1583
|
})), handleLabel(agent.handle), readingText(handleLabel(agent.handle)));
|
|
1769
1584
|
}
|
|
1770
1585
|
/** `/use <handle|id>` — switch this chat to another agent, or explain why not. */
|
|
@@ -2152,17 +1967,41 @@ export class TelegramSurface {
|
|
|
2152
1967
|
return undefined;
|
|
2153
1968
|
});
|
|
2154
1969
|
const progress = new ProgressBubble(this.#opts.api, chatId, placeholderId, this.#log, this.#opts.progressIntervalMs ?? PROGRESS_EDIT_INTERVAL_MS, this.#opts.now ?? (() => Date.now()), placeholder);
|
|
1970
|
+
// The answer, streamed into the same bubble while the model speaks. The
|
|
1971
|
+
// first chunk silences the progress line; the final write is the answer.
|
|
1972
|
+
const outbound = { api: this.#opts.api, log: this.#log };
|
|
1973
|
+
const stream = new StreamedAnswer(outbound, chatId, placeholderId, {
|
|
1974
|
+
now: this.#opts.now ?? (() => Date.now()),
|
|
1975
|
+
...(this.#opts.streamIntervalMs === undefined ? {} : { intervalMs: this.#opts.streamIntervalMs }),
|
|
1976
|
+
// Typing is already on, from `#startTyping`.
|
|
1977
|
+
typing: false,
|
|
1978
|
+
takeOver: async () => {
|
|
1979
|
+
progress.silence();
|
|
1980
|
+
await progress.settle();
|
|
1981
|
+
},
|
|
1982
|
+
});
|
|
2155
1983
|
try {
|
|
2156
1984
|
// Safety net, not the mechanism: TELEGRAM_SURFACE already told the model
|
|
2157
1985
|
// markdown does not render here, and we never send `parse_mode`. This
|
|
2158
1986
|
// catches the answer of a model that ignored the profile.
|
|
2159
|
-
const produced = await produce(progress);
|
|
1987
|
+
const produced = await produce(progress, stream);
|
|
2160
1988
|
const drawn = typeof produced === 'string' ? { text: produced, controls: [] } : produced;
|
|
2161
1989
|
const reply = toPlainText(drawn.text);
|
|
2162
1990
|
await progress.settle();
|
|
2163
|
-
await
|
|
1991
|
+
await stream.finish(reply, drawn.question && drawn.question.options.length > 0
|
|
2164
1992
|
? questionKeyboard(drawn.question)
|
|
2165
1993
|
: drawn.controls.length === 0 ? undefined : offersKeyboard(drawn.controls));
|
|
1994
|
+
// Then what else the turn made: the view it drew, the files it saved.
|
|
1995
|
+
if (drawn.artifacts || drawn.canvas) {
|
|
1996
|
+
await sendRunExtras({
|
|
1997
|
+
...outbound,
|
|
1998
|
+
...(this.#opts.artifacts ? { artifacts: this.#opts.artifacts } : {}),
|
|
1999
|
+
...(this.#opts.publicOrigin ? { publicOrigin: this.#opts.publicOrigin } : {}),
|
|
2000
|
+
}, chatId, {
|
|
2001
|
+
...(drawn.artifacts ? { artifacts: drawn.artifacts } : {}),
|
|
2002
|
+
...(drawn.canvas ? { canvas: drawn.canvas } : {}),
|
|
2003
|
+
});
|
|
2004
|
+
}
|
|
2166
2005
|
}
|
|
2167
2006
|
catch (err) {
|
|
2168
2007
|
// The raw error goes to the log with its whole cause chain; what reaches
|
|
@@ -2185,7 +2024,7 @@ export class TelegramSurface {
|
|
|
2185
2024
|
message: outcome.detail,
|
|
2186
2025
|
});
|
|
2187
2026
|
await progress.settle();
|
|
2188
|
-
await
|
|
2027
|
+
await stream.finish(toPlainText(outcome.rendered.text), outcome.rendered.controls.length === 0
|
|
2189
2028
|
? undefined
|
|
2190
2029
|
: offersKeyboard(outcome.rendered.controls)).catch(() => { });
|
|
2191
2030
|
}
|
|
@@ -2193,34 +2032,6 @@ export class TelegramSurface {
|
|
|
2193
2032
|
stopTyping();
|
|
2194
2033
|
}
|
|
2195
2034
|
}
|
|
2196
|
-
/**
|
|
2197
|
-
* Land the answer in the placeholder when it fits — one bubble, no flicker —
|
|
2198
|
-
* and otherwise drop the placeholder and send the chunks.
|
|
2199
|
-
*/
|
|
2200
|
-
async #finish(chatId, placeholderId, reply, keyboard) {
|
|
2201
|
-
const text = reply.trim() === '' ? '(no reply)' : reply;
|
|
2202
|
-
if (placeholderId !== undefined && text.length > MAX_MESSAGE_CHARS) {
|
|
2203
|
-
await this.#opts.api.deleteMessage(chatId, placeholderId).catch((err) => {
|
|
2204
|
-
this.#log(`telegram: placeholder delete failed: ${message(err)}`);
|
|
2205
|
-
});
|
|
2206
|
-
await this.#opts.api.sendMessage(chatId, text, keyboard ? { replyMarkup: keyboard } : {});
|
|
2207
|
-
return;
|
|
2208
|
-
}
|
|
2209
|
-
await this.#replace(chatId, placeholderId, text, keyboard);
|
|
2210
|
-
}
|
|
2211
|
-
/** Edit the placeholder, falling back to a new message on any edit failure. */
|
|
2212
|
-
async #replace(chatId, placeholderId, text, keyboard) {
|
|
2213
|
-
if (placeholderId !== undefined) {
|
|
2214
|
-
try {
|
|
2215
|
-
await this.#opts.api.editMessageText(chatId, placeholderId, text, keyboard ? { replyMarkup: keyboard } : {});
|
|
2216
|
-
return;
|
|
2217
|
-
}
|
|
2218
|
-
catch (err) {
|
|
2219
|
-
this.#log(`telegram: final edit failed, sending instead: ${message(err)}`);
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
await this.#opts.api.sendMessage(chatId, text, keyboard ? { replyMarkup: keyboard } : {});
|
|
2223
|
-
}
|
|
2224
2035
|
/**
|
|
2225
2036
|
* One turn's reply, with whatever it offered already drawn into the shape
|
|
2226
2037
|
* this surface sends: the text, and the controls if there are any.
|
|
@@ -2232,6 +2043,7 @@ export class TelegramSurface {
|
|
|
2232
2043
|
return {
|
|
2233
2044
|
...renderOffers(TELEGRAM_SURFACE, replyText(produced), typeof produced === 'string' ? [] : (produced.offers ?? [])),
|
|
2234
2045
|
...(typeof produced !== 'string' && produced.question ? { question: produced.question } : {}),
|
|
2046
|
+
...extrasOf(produced),
|
|
2235
2047
|
};
|
|
2236
2048
|
}
|
|
2237
2049
|
#startTyping(chatId) {
|