@withbuddi/buddi 0.1.0-pre.18 → 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 +10 -4
- package/extension/background.js +38 -7
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/args.d.ts +7 -0
- package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/args.js +14 -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 +36 -1
- package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
- 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 +1 -0
- package/node_modules/@buddi/cli/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/index.js +1 -0
- package/node_modules/@buddi/cli/dist/index.js.map +1 -1
- package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/main.js +10 -0
- package/node_modules/@buddi/cli/dist/main.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/core/dist/.tsbuildinfo +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/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/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/notify.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/notify.js +1 -0
- package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/store.d.ts +2 -0
- package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/store.js +9 -0
- package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/types.d.ts +6 -0
- package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages.d.ts +2 -2
- 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 +20 -0
- 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/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/views.d.ts +66 -66
- 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/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/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/missions/agent-run.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/agent-run.js +1 -0
- package/node_modules/@buddi/gateway/dist/missions/agent-run.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +7 -0
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +3 -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/owner-notify.d.ts +2 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js +6 -2
- package/node_modules/@buddi/gateway/dist/owner-notify.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/serve.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +1 -0
- 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/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 +7 -1
- package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/channel.js +24 -2
- package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -1
- 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 +99 -290
- package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js +4 -0
- package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
- 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 +20 -1
- 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/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.js +135 -10
- 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/runtime/dist/.tsbuildinfo +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/openai.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.js +17 -2
- 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-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +12 -4
- 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 +10 -0
- 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/tools/read.js +1 -1
- package/node_modules/@buddi/tool-email/dist/tools/read.js.map +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/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/args.d.ts +7 -0
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +14 -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 +36 -1
- package/packages/cli/dist/commands.js.map +1 -1
- 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 +1 -0
- package/packages/cli/dist/index.d.ts.map +1 -1
- package/packages/cli/dist/index.js +1 -0
- package/packages/cli/dist/index.js.map +1 -1
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +10 -0
- package/packages/cli/dist/main.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/core/dist/.tsbuildinfo +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/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/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/notify.d.ts.map +1 -1
- package/packages/core/dist/notifications/notify.js +1 -0
- package/packages/core/dist/notifications/notify.js.map +1 -1
- package/packages/core/dist/notifications/store.d.ts +2 -0
- package/packages/core/dist/notifications/store.d.ts.map +1 -1
- package/packages/core/dist/notifications/store.js +9 -0
- package/packages/core/dist/notifications/store.js.map +1 -1
- package/packages/core/dist/notifications/types.d.ts +6 -0
- package/packages/core/dist/notifications/types.d.ts.map +1 -1
- package/packages/core/dist/pages.d.ts +2 -2
- 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 +20 -0
- 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/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/views.d.ts +66 -66
- 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/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/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/missions/agent-run.d.ts.map +1 -1
- package/packages/gateway/dist/missions/agent-run.js +1 -0
- package/packages/gateway/dist/missions/agent-run.js.map +1 -1
- package/packages/gateway/dist/missions/execute.d.ts +7 -0
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +3 -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/owner-notify.d.ts +2 -1
- package/packages/gateway/dist/owner-notify.d.ts.map +1 -1
- package/packages/gateway/dist/owner-notify.js +6 -2
- package/packages/gateway/dist/owner-notify.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/serve.d.ts.map +1 -1
- package/packages/gateway/dist/serve.js +1 -0
- 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/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 +7 -1
- package/packages/gateway/dist/telegram/channel.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/channel.js +24 -2
- package/packages/gateway/dist/telegram/channel.js.map +1 -1
- 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 +99 -290
- package/packages/gateway/dist/telegram/surface.js.map +1 -1
- package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/packages/gateway/dist/web/onboarding.js +4 -0
- package/packages/gateway/dist/web/onboarding.js.map +1 -1
- 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 +20 -1
- 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/install/dist/.tsbuildinfo +1 -1
- package/packages/install/dist/launcher.d.ts.map +1 -1
- package/packages/install/dist/launcher.js +135 -10
- 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/runtime/dist/.tsbuildinfo +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/openai.d.ts.map +1 -1
- package/packages/runtime/dist/openai.js +17 -2
- package/packages/runtime/dist/openai.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/index.d.ts +1 -1
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +12 -4
- 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 +10 -0
- 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/tools/read.js +1 -1
- package/packages/tools/email/dist/tools/read.js.map +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-DCn0vN58.css → index-B727JQsO.css} +1 -1
- package/packages/web/dist/assets/index-OA0xgibo.js +123 -0
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/assets/index-BRkIoT-q.js +0 -123
|
@@ -17,12 +17,21 @@
|
|
|
17
17
|
*/
|
|
18
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)');
|
|
@@ -1348,6 +1160,22 @@ export class TelegramSurface {
|
|
|
1348
1160
|
await this.handleReminders(chatId);
|
|
1349
1161
|
return;
|
|
1350
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
|
+
}
|
|
1351
1179
|
// `/quiet 1w` — the argument is everything after the command word, so
|
|
1352
1180
|
// `/quiet` alone parses as the default. The surface never reads a duration.
|
|
1353
1181
|
if (command === '/quiet') {
|
|
@@ -1483,27 +1311,8 @@ export class TelegramSurface {
|
|
|
1483
1311
|
stopTyping();
|
|
1484
1312
|
}
|
|
1485
1313
|
}
|
|
1486
|
-
/**
|
|
1487
|
-
* Send one answer as up to three messages, typing between them.
|
|
1488
|
-
*
|
|
1489
|
-
* The pause is the whole point: three bubbles posted in the same millisecond
|
|
1490
|
-
* are one block with extra steps. `splitIntoMessages` decides how many there
|
|
1491
|
-
* are; this only paces them.
|
|
1492
|
-
*/
|
|
1493
1314
|
async #sendBurst(chatId, reply) {
|
|
1494
|
-
|
|
1495
|
-
if (parts.length === 0) {
|
|
1496
|
-
await this.#opts.api.sendMessage(chatId, '(no reply)');
|
|
1497
|
-
return;
|
|
1498
|
-
}
|
|
1499
|
-
const gap = this.#opts.burstGapMs ?? BURST_GAP_MS;
|
|
1500
|
-
for (const [index, part] of parts.entries()) {
|
|
1501
|
-
if (index > 0) {
|
|
1502
|
-
await this.#opts.api.sendChatAction(chatId).catch(() => { });
|
|
1503
|
-
await sleep(gap);
|
|
1504
|
-
}
|
|
1505
|
-
await this.#opts.api.sendMessage(chatId, part);
|
|
1506
|
-
}
|
|
1315
|
+
await sendBurst(this.#opts.api, chatId, reply, this.#opts.burstGapMs ?? BURST_GAP_MS);
|
|
1507
1316
|
}
|
|
1508
1317
|
/**
|
|
1509
1318
|
* The owner's answer to a question a one-shot agent asked.
|
|
@@ -1580,7 +1389,7 @@ export class TelegramSurface {
|
|
|
1580
1389
|
const interjections = new InterjectionQueue();
|
|
1581
1390
|
this.#interjections.set(chatId, interjections);
|
|
1582
1391
|
try {
|
|
1583
|
-
await this.#withBubble(chatId, async (progress) => {
|
|
1392
|
+
await this.#withBubble(chatId, async (progress, stream) => {
|
|
1584
1393
|
const produced = await this.#opts.run({
|
|
1585
1394
|
conversationId,
|
|
1586
1395
|
chatId,
|
|
@@ -1589,6 +1398,7 @@ export class TelegramSurface {
|
|
|
1589
1398
|
interjections,
|
|
1590
1399
|
...(carried?.attachments.length ? { attachments: carried.attachments } : {}),
|
|
1591
1400
|
onToolCall: (name) => progress.noteToolCall(name),
|
|
1401
|
+
onTextDelta: (delta) => stream.push(delta),
|
|
1592
1402
|
});
|
|
1593
1403
|
const reply = replyText(produced);
|
|
1594
1404
|
askedOwner = turnAskedOwner(typeof produced === 'string' ? undefined : produced.askedOwner, reply);
|
|
@@ -1604,6 +1414,7 @@ export class TelegramSurface {
|
|
|
1604
1414
|
return {
|
|
1605
1415
|
...renderOffers(TELEGRAM_SURFACE, note ? `${note}\n\n${reply}` : reply, typeof produced === 'string' ? [] : (produced.offers ?? [])),
|
|
1606
1416
|
...(typeof produced !== 'string' && produced.question ? { question: produced.question } : {}),
|
|
1417
|
+
...extrasOf(produced),
|
|
1607
1418
|
};
|
|
1608
1419
|
}, label, carried ? readingText(label) : undefined, { agentId: agent.id, conversationId, prompt });
|
|
1609
1420
|
}
|
|
@@ -1761,13 +1572,14 @@ export class TelegramSurface {
|
|
|
1761
1572
|
filename,
|
|
1762
1573
|
sizeBytes: row.sizeBytes,
|
|
1763
1574
|
});
|
|
1764
|
-
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({
|
|
1765
1576
|
conversationId,
|
|
1766
1577
|
chatId,
|
|
1767
1578
|
agent,
|
|
1768
1579
|
text: caption,
|
|
1769
1580
|
...(turn.attachments.length ? { attachments: turn.attachments } : {}),
|
|
1770
1581
|
onToolCall: (name) => progress.noteToolCall(name),
|
|
1582
|
+
onTextDelta: (delta) => stream.push(delta),
|
|
1771
1583
|
})), handleLabel(agent.handle), readingText(handleLabel(agent.handle)));
|
|
1772
1584
|
}
|
|
1773
1585
|
/** `/use <handle|id>` — switch this chat to another agent, or explain why not. */
|
|
@@ -2155,17 +1967,41 @@ export class TelegramSurface {
|
|
|
2155
1967
|
return undefined;
|
|
2156
1968
|
});
|
|
2157
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
|
+
});
|
|
2158
1983
|
try {
|
|
2159
1984
|
// Safety net, not the mechanism: TELEGRAM_SURFACE already told the model
|
|
2160
1985
|
// markdown does not render here, and we never send `parse_mode`. This
|
|
2161
1986
|
// catches the answer of a model that ignored the profile.
|
|
2162
|
-
const produced = await produce(progress);
|
|
1987
|
+
const produced = await produce(progress, stream);
|
|
2163
1988
|
const drawn = typeof produced === 'string' ? { text: produced, controls: [] } : produced;
|
|
2164
1989
|
const reply = toPlainText(drawn.text);
|
|
2165
1990
|
await progress.settle();
|
|
2166
|
-
await
|
|
1991
|
+
await stream.finish(reply, drawn.question && drawn.question.options.length > 0
|
|
2167
1992
|
? questionKeyboard(drawn.question)
|
|
2168
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
|
+
}
|
|
2169
2005
|
}
|
|
2170
2006
|
catch (err) {
|
|
2171
2007
|
// The raw error goes to the log with its whole cause chain; what reaches
|
|
@@ -2188,7 +2024,7 @@ export class TelegramSurface {
|
|
|
2188
2024
|
message: outcome.detail,
|
|
2189
2025
|
});
|
|
2190
2026
|
await progress.settle();
|
|
2191
|
-
await
|
|
2027
|
+
await stream.finish(toPlainText(outcome.rendered.text), outcome.rendered.controls.length === 0
|
|
2192
2028
|
? undefined
|
|
2193
2029
|
: offersKeyboard(outcome.rendered.controls)).catch(() => { });
|
|
2194
2030
|
}
|
|
@@ -2196,34 +2032,6 @@ export class TelegramSurface {
|
|
|
2196
2032
|
stopTyping();
|
|
2197
2033
|
}
|
|
2198
2034
|
}
|
|
2199
|
-
/**
|
|
2200
|
-
* Land the answer in the placeholder when it fits — one bubble, no flicker —
|
|
2201
|
-
* and otherwise drop the placeholder and send the chunks.
|
|
2202
|
-
*/
|
|
2203
|
-
async #finish(chatId, placeholderId, reply, keyboard) {
|
|
2204
|
-
const text = reply.trim() === '' ? '(no reply)' : reply;
|
|
2205
|
-
if (placeholderId !== undefined && text.length > MAX_MESSAGE_CHARS) {
|
|
2206
|
-
await this.#opts.api.deleteMessage(chatId, placeholderId).catch((err) => {
|
|
2207
|
-
this.#log(`telegram: placeholder delete failed: ${message(err)}`);
|
|
2208
|
-
});
|
|
2209
|
-
await this.#opts.api.sendMessage(chatId, text, keyboard ? { replyMarkup: keyboard } : {});
|
|
2210
|
-
return;
|
|
2211
|
-
}
|
|
2212
|
-
await this.#replace(chatId, placeholderId, text, keyboard);
|
|
2213
|
-
}
|
|
2214
|
-
/** Edit the placeholder, falling back to a new message on any edit failure. */
|
|
2215
|
-
async #replace(chatId, placeholderId, text, keyboard) {
|
|
2216
|
-
if (placeholderId !== undefined) {
|
|
2217
|
-
try {
|
|
2218
|
-
await this.#opts.api.editMessageText(chatId, placeholderId, text, keyboard ? { replyMarkup: keyboard } : {});
|
|
2219
|
-
return;
|
|
2220
|
-
}
|
|
2221
|
-
catch (err) {
|
|
2222
|
-
this.#log(`telegram: final edit failed, sending instead: ${message(err)}`);
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
await this.#opts.api.sendMessage(chatId, text, keyboard ? { replyMarkup: keyboard } : {});
|
|
2226
|
-
}
|
|
2227
2035
|
/**
|
|
2228
2036
|
* One turn's reply, with whatever it offered already drawn into the shape
|
|
2229
2037
|
* this surface sends: the text, and the controls if there are any.
|
|
@@ -2235,6 +2043,7 @@ export class TelegramSurface {
|
|
|
2235
2043
|
return {
|
|
2236
2044
|
...renderOffers(TELEGRAM_SURFACE, replyText(produced), typeof produced === 'string' ? [] : (produced.offers ?? [])),
|
|
2237
2045
|
...(typeof produced !== 'string' && produced.question ? { question: produced.question } : {}),
|
|
2046
|
+
...extrasOf(produced),
|
|
2238
2047
|
};
|
|
2239
2048
|
}
|
|
2240
2049
|
#startTyping(chatId) {
|