@withbuddi/buddi 0.1.0-pre.35 → 0.1.0-pre.37
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/examples/agents/concierge/agent.md +5 -0
- package/examples/skills/letterhead/SKILL.md +21 -0
- package/examples/skills/letterhead/assets/letterhead.md +16 -0
- package/examples/skills/letterhead/assets/logo.svg +6 -0
- package/extension/manifest.json +2 -2
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/doctor-probes.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor-probes.js +44 -3
- package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.d.ts +37 -0
- package/node_modules/@buddi/cli/dist/doctor.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.js +37 -0
- package/node_modules/@buddi/cli/dist/doctor.js.map +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/actions/approvals.d.ts +7 -0
- package/node_modules/@buddi/core/dist/actions/approvals.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/actions/approvals.js +11 -1
- package/node_modules/@buddi/core/dist/actions/approvals.js.map +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js +2 -2
- package/node_modules/@buddi/core/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/core/dist/agents/skills.d.ts +60 -1
- package/node_modules/@buddi/core/dist/agents/skills.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/skills.js +157 -17
- package/node_modules/@buddi/core/dist/agents/skills.js.map +1 -1
- package/node_modules/@buddi/core/dist/day-month.d.ts +52 -0
- package/node_modules/@buddi/core/dist/day-month.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/day-month.js +101 -0
- package/node_modules/@buddi/core/dist/day-month.js.map +1 -0
- package/node_modules/@buddi/core/dist/host/build.d.ts +25 -2
- package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.js +169 -8
- package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/http.d.ts +97 -0
- package/node_modules/@buddi/core/dist/host/http.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/host/http.js +321 -26
- package/node_modules/@buddi/core/dist/host/http.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/types.d.ts +114 -4
- package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/index.d.ts +3 -0
- package/node_modules/@buddi/core/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/index.js +3 -0
- package/node_modules/@buddi/core/dist/index.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 +10 -6
- package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/store.js +2 -1
- package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/types.d.ts +8 -0
- package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/types.js.map +1 -1
- package/node_modules/@buddi/core/dist/onboarding/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/onboarding/store.js +28 -5
- package/node_modules/@buddi/core/dist/onboarding/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/onboarding/types.d.ts +10 -0
- package/node_modules/@buddi/core/dist/onboarding/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/onboarding/types.js.map +1 -1
- package/node_modules/@buddi/core/dist/pages.d.ts +449 -20
- package/node_modules/@buddi/core/dist/pages.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages.js +223 -8
- package/node_modules/@buddi/core/dist/pages.js.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/assets.d.ts +52 -0
- package/node_modules/@buddi/core/dist/plugin/assets.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/plugin/assets.js +59 -0
- package/node_modules/@buddi/core/dist/plugin/assets.js.map +1 -0
- package/node_modules/@buddi/core/dist/plugin/index.d.ts +10 -4
- package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.js +4 -1
- package/node_modules/@buddi/core/dist/plugin/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/requires.d.ts +3 -1
- package/node_modules/@buddi/core/dist/plugin/requires.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/requires.js +5 -3
- package/node_modules/@buddi/core/dist/plugin/requires.js.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/sign-in.d.ts +78 -0
- package/node_modules/@buddi/core/dist/plugin/sign-in.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/plugin/sign-in.js +54 -0
- package/node_modules/@buddi/core/dist/plugin/sign-in.js.map +1 -0
- 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 +2 -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/plugin-assets.d.ts +21 -0
- package/node_modules/@buddi/core/dist/plugin-assets.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/plugin-assets.js +140 -0
- package/node_modules/@buddi/core/dist/plugin-assets.js.map +1 -0
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts +7 -0
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/provider-accounts.js +15 -0
- package/node_modules/@buddi/core/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/core/dist/questions/types.d.ts +1 -1
- package/node_modules/@buddi/core/dist/questions/types.js +1 -1
- package/node_modules/@buddi/core/dist/queue/jobs.d.ts +57 -2
- package/node_modules/@buddi/core/dist/queue/jobs.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/queue/jobs.js +114 -0
- package/node_modules/@buddi/core/dist/queue/jobs.js.map +1 -1
- package/node_modules/@buddi/core/dist/queue/worker.d.ts +24 -2
- package/node_modules/@buddi/core/dist/queue/worker.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/queue/worker.js +66 -11
- package/node_modules/@buddi/core/dist/queue/worker.js.map +1 -1
- package/node_modules/@buddi/core/dist/registry.d.ts +17 -0
- package/node_modules/@buddi/core/dist/registry.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/registry.js +48 -4
- package/node_modules/@buddi/core/dist/registry.js.map +1 -1
- package/node_modules/@buddi/core/dist/scheduler/missions.d.ts +14 -0
- package/node_modules/@buddi/core/dist/scheduler/missions.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/scheduler/missions.js +17 -4
- package/node_modules/@buddi/core/dist/scheduler/missions.js.map +1 -1
- package/node_modules/@buddi/core/dist/scheduler/types.d.ts +13 -0
- package/node_modules/@buddi/core/dist/scheduler/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/scheduler/types.js +14 -0
- package/node_modules/@buddi/core/dist/scheduler/types.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/scrub.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/scrub.js +15 -0
- package/node_modules/@buddi/core/dist/secrets/scrub.js.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.d.ts +10 -0
- package/node_modules/@buddi/core/dist/surfaces.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.js +11 -0
- package/node_modules/@buddi/core/dist/surfaces.js.map +1 -1
- package/node_modules/@buddi/core/dist/tools.d.ts +72 -1
- package/node_modules/@buddi/core/dist/tools.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/tools.js +38 -0
- package/node_modules/@buddi/core/dist/tools.js.map +1 -1
- package/node_modules/@buddi/core/dist/views.d.ts +29 -12
- package/node_modules/@buddi/core/dist/views.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/views.js +1 -0
- package/node_modules/@buddi/core/dist/views.js.map +1 -1
- package/node_modules/@buddi/core/dist/widget-settings.d.ts +2 -1
- package/node_modules/@buddi/core/dist/widget-settings.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/widget-settings.js +8 -2
- package/node_modules/@buddi/core/dist/widget-settings.js.map +1 -1
- package/node_modules/@buddi/core/dist/widgets.d.ts +46 -3
- package/node_modules/@buddi/core/dist/widgets.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/widgets.js +68 -5
- package/node_modules/@buddi/core/dist/widgets.js.map +1 -1
- package/node_modules/@buddi/core/migrations/073_mission_report.sql +15 -0
- package/node_modules/@buddi/core/migrations/074_owner_identity.sql +14 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.js +3 -3
- package/node_modules/@buddi/gateway/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts +76 -0
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js +29 -5
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/owner-text.d.ts +19 -0
- package/node_modules/@buddi/gateway/dist/agents/owner-text.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/agents/owner-text.js +44 -0
- package/node_modules/@buddi/gateway/dist/agents/owner-text.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/owner-tools.js +36 -2
- package/node_modules/@buddi/gateway/dist/agents/owner-tools.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts +68 -3
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js +264 -32
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform.d.ts +11 -4
- package/node_modules/@buddi/gateway/dist/agents/platform.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform.js +15 -0
- package/node_modules/@buddi/gateway/dist/agents/platform.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/bootstrap.js +7 -1
- package/node_modules/@buddi/gateway/dist/bootstrap.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/evals/golden.d.ts +33 -1
- package/node_modules/@buddi/gateway/dist/evals/golden.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/evals/golden.js +168 -3
- package/node_modules/@buddi/gateway/dist/evals/golden.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.d.ts +2 -1
- package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.js +2 -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 +2 -0
- package/node_modules/@buddi/gateway/dist/missions/agent-run.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/dates.d.ts +98 -0
- package/node_modules/@buddi/gateway/dist/missions/dates.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/missions/dates.js +252 -0
- package/node_modules/@buddi/gateway/dist/missions/dates.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/missions/defaults.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/defaults.js +2 -0
- package/node_modules/@buddi/gateway/dist/missions/defaults.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +25 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +80 -8
- package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/report.d.ts +25 -2
- package/node_modules/@buddi/gateway/dist/missions/report.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/report.js +71 -11
- package/node_modules/@buddi/gateway/dist/missions/report.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/ollama-local.d.ts +90 -0
- package/node_modules/@buddi/gateway/dist/ollama-local.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/ollama-local.js +201 -0
- package/node_modules/@buddi/gateway/dist/ollama-local.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/owner-notify.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js +7 -3
- package/node_modules/@buddi/gateway/dist/owner-notify.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/asset-image-worker.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/plugins/asset-image-worker.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/plugins/asset-image-worker.js +18 -0
- package/node_modules/@buddi/gateway/dist/plugins/asset-image-worker.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/plugins/asset-image.d.ts +31 -0
- package/node_modules/@buddi/gateway/dist/plugins/asset-image.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/plugins/asset-image.js +332 -0
- package/node_modules/@buddi/gateway/dist/plugins/asset-image.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/plugins/load.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/load.js +14 -1
- package/node_modules/@buddi/gateway/dist/plugins/load.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.js +5 -0
- package/node_modules/@buddi/gateway/dist/plugins/stage.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/uninstall.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/uninstall.js +8 -0
- package/node_modules/@buddi/gateway/dist/plugins/uninstall.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins-cli.d.ts +8 -0
- package/node_modules/@buddi/gateway/dist/plugins-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins-cli.js +22 -1
- package/node_modules/@buddi/gateway/dist/plugins-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +50 -5
- package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/pending-question.js +2 -2
- package/node_modules/@buddi/gateway/dist/system-context.d.ts +21 -1
- package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.js +76 -2
- package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js +4 -2
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts +12 -0
- package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/channel.js +49 -2
- package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/html.d.ts +34 -0
- package/node_modules/@buddi/gateway/dist/telegram/html.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/html.js +263 -0
- package/node_modules/@buddi/gateway/dist/telegram/html.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/notify.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/telegram/notify.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/notify.js +25 -3
- package/node_modules/@buddi/gateway/dist/telegram/notify.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/tips/facts.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/tips/facts.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/tips/facts.js +4 -1
- package/node_modules/@buddi/gateway/dist/tips/facts.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/tips/rules.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/tips/rules.js +10 -0
- package/node_modules/@buddi/gateway/dist/tips/rules.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.js +80 -11
- package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-scan.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-scan.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-scan.js +1 -0
- package/node_modules/@buddi/gateway/dist/web/api-scan.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/catalogue.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/catalogue.js +7 -4
- package/node_modules/@buddi/gateway/dist/web/catalogue.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/chat.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/chat.js +9 -0
- package/node_modules/@buddi/gateway/dist/web/chat.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/composer.d.ts +45 -0
- package/node_modules/@buddi/gateway/dist/web/composer.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/composer.js +85 -0
- package/node_modules/@buddi/gateway/dist/web/composer.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts +12 -0
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.js +11 -1
- package/node_modules/@buddi/gateway/dist/web/extension.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/lock.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/web/lock.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/lock.js +33 -2
- package/node_modules/@buddi/gateway/dist/web/lock.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/market.d.ts +20 -1
- package/node_modules/@buddi/gateway/dist/web/market.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/market.js +41 -1
- package/node_modules/@buddi/gateway/dist/web/market.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/people.d.ts +44 -0
- package/node_modules/@buddi/gateway/dist/web/people.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/people.js +114 -0
- package/node_modules/@buddi/gateway/dist/web/people.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/server.d.ts +4 -0
- package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +171 -13
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/skill-bundles.d.ts +101 -0
- package/node_modules/@buddi/gateway/dist/web/skill-bundles.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/skill-bundles.js +439 -0
- package/node_modules/@buddi/gateway/dist/web/skill-bundles.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/skills.d.ts +57 -1
- package/node_modules/@buddi/gateway/dist/web/skills.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/skills.js +171 -9
- package/node_modules/@buddi/gateway/dist/web/skills.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/widgets.js +2 -2
- package/node_modules/@buddi/gateway/dist/web/widgets.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/zip-read.d.ts +31 -0
- package/node_modules/@buddi/gateway/dist/web/zip-read.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/zip-read.js +125 -0
- package/node_modules/@buddi/gateway/dist/web/zip-read.js.map +1 -0
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/index.d.ts +1 -0
- package/node_modules/@buddi/runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/index.js +1 -0
- package/node_modules/@buddi/runtime/dist/index.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/loop.js +11 -1
- package/node_modules/@buddi/runtime/dist/loop.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/plugin-sign-in.d.ts +12 -0
- package/node_modules/@buddi/runtime/dist/plugin-sign-in.d.ts.map +1 -0
- package/node_modules/@buddi/runtime/dist/plugin-sign-in.js +397 -0
- package/node_modules/@buddi/runtime/dist/plugin-sign-in.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/transport.d.ts +1 -1
- package/node_modules/@buddi/runtime/dist/transport.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/transport.js +6 -0
- package/node_modules/@buddi/runtime/dist/transport.js.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/tools/write.d.ts.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/tools/write.js +1 -0
- package/node_modules/@buddi/tool-artifacts/dist/tools/write.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/computer.d.ts +13 -0
- package/node_modules/@buddi/tool-browser/dist/computer.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/computer.js +22 -2
- package/node_modules/@buddi/tool-browser/dist/computer.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +4 -0
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +8 -3
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +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 +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/native/buddi-computer +0 -0
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +5 -0
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-email/dist/widgets.d.ts.map +1 -1
- package/node_modules/@buddi/tool-email/dist/widgets.js +2 -1
- package/node_modules/@buddi/tool-email/dist/widgets.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-host/dist/index.d.ts +2 -1
- package/node_modules/@buddi/tool-host/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/index.js +3 -2
- package/node_modules/@buddi/tool-host/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/process.d.ts +4 -0
- package/node_modules/@buddi/tool-host/dist/process.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/process.js +4 -2
- package/node_modules/@buddi/tool-host/dist/process.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/service.d.ts +66 -17
- package/node_modules/@buddi/tool-host/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/service.js +172 -9
- package/node_modules/@buddi/tool-host/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/skill-run.d.ts +55 -0
- package/node_modules/@buddi/tool-host/dist/skill-run.d.ts.map +1 -0
- package/node_modules/@buddi/tool-host/dist/skill-run.js +132 -0
- package/node_modules/@buddi/tool-host/dist/skill-run.js.map +1 -0
- package/node_modules/@buddi/tool-mcp/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-memory/dist/index.d.ts +1 -0
- package/node_modules/@buddi/tool-memory/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-memory/dist/index.js +7 -2
- package/node_modules/@buddi/tool-memory/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-memory/dist/people.d.ts +218 -0
- package/node_modules/@buddi/tool-memory/dist/people.d.ts.map +1 -0
- package/node_modules/@buddi/tool-memory/dist/people.js +582 -0
- package/node_modules/@buddi/tool-memory/dist/people.js.map +1 -0
- package/node_modules/@buddi/tool-memory/dist/preamble.d.ts +4 -1
- package/node_modules/@buddi/tool-memory/dist/preamble.d.ts.map +1 -1
- package/node_modules/@buddi/tool-memory/dist/preamble.js +25 -7
- package/node_modules/@buddi/tool-memory/dist/preamble.js.map +1 -1
- package/node_modules/@buddi/tool-memory/migrations/002_people.sql +40 -0
- package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
- package/node_modules/imapflow/CHANGELOG.md +8 -0
- package/node_modules/imapflow/dist/cjs/commands/append.js +27 -3
- package/node_modules/imapflow/dist/cjs/commands/store.js +31 -6
- package/node_modules/imapflow/dist/cjs/imap-flow.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/imap-flow.js +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.js +1 -1
- package/node_modules/imapflow/dist/esm/commands/append.js +27 -3
- package/node_modules/imapflow/dist/esm/commands/store.js +31 -6
- package/node_modules/imapflow/dist/esm/imap-flow.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/imap-flow.js +1 -1
- package/node_modules/imapflow/dist/esm/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/package-info.js +1 -1
- package/node_modules/imapflow/package.json +4 -4
- package/node_modules/pino/CONTRIBUTING.md +5 -1
- package/node_modules/pino/LICENSE +1 -1
- package/node_modules/pino/README.md +1 -1
- package/node_modules/pino/SECURITY.md +18 -2
- package/node_modules/pino/browser.js +68 -8
- package/node_modules/pino/docs/api.md +75 -4
- package/node_modules/pino/docs/asynchronous.md +18 -3
- package/node_modules/pino/docs/browser.md +63 -0
- package/node_modules/pino/docs/child-loggers.md +22 -1
- package/node_modules/pino/docs/ecosystem.md +1 -0
- package/node_modules/pino/docs/help.md +11 -3
- package/node_modules/pino/docs/lts.md +29 -0
- package/node_modules/pino/docs/pretty.md +3 -0
- package/node_modules/pino/docs/redaction.md +3 -8
- package/node_modules/pino/docs/transports.md +71 -0
- package/node_modules/pino/docs/web.md +11 -14
- package/node_modules/pino/eslint.config.js +15 -7
- package/node_modules/pino/lib/caller.js +10 -0
- package/node_modules/pino/lib/meta.js +1 -1
- package/node_modules/pino/lib/multistream.js +15 -7
- package/node_modules/pino/lib/redaction.js +8 -3
- package/node_modules/pino/lib/symbols.js +3 -1
- package/node_modules/pino/lib/tools.js +2 -2
- package/node_modules/pino/lib/transport.js +14 -1
- package/node_modules/pino/lib/worker.js +4 -1
- package/node_modules/pino/package.json +14 -22
- package/node_modules/pino/pino.d.ts +709 -736
- package/node_modules/pino/pino.js +27 -2
- package/node_modules/pino/test/basic.test.js +66 -0
- package/node_modules/pino/test/browser-bindings.test.js +114 -0
- package/node_modules/pino/test/browser-redaction.test.js +264 -0
- package/node_modules/pino/test/browser-set-bindings.test.js +99 -0
- package/node_modules/pino/test/caller.test.js +20 -0
- package/node_modules/pino/test/escaping.test.js +17 -0
- package/node_modules/pino/test/fixtures/caller-loop.js +6 -0
- package/node_modules/pino/test/fixtures/ts/transpile.cjs +3 -3
- package/node_modules/pino/test/helper.js +6 -2
- package/node_modules/pino/test/multistream.test.js +64 -0
- package/node_modules/pino/test/redact.test.js +30 -0
- package/node_modules/pino/test/smoke.js +59 -0
- package/node_modules/pino/test/transport/core.test.js +85 -0
- package/node_modules/pino/test/transport/sync-false.test.js +12 -0
- package/node_modules/pino/test/transport/uses-pino-config.test.js +4 -4
- package/node_modules/pino/test/types/pino-import.tst.cts +30 -0
- package/node_modules/pino/test/types/pino-import.tst.js +73 -0
- package/node_modules/pino/test/types/pino-multistream.tst.ts +49 -0
- package/node_modules/pino/test/types/pino-top-export.tst.ts +32 -0
- package/node_modules/pino/test/types/{pino-transport.test-d.ts → pino-transport.tst.ts} +85 -70
- package/node_modules/pino/test/types/pino-type-only.tst.ts +77 -0
- package/node_modules/pino/test/types/pino.ts +14 -7
- package/node_modules/pino/test/types/{pino.test-d.ts → pino.tst.ts} +135 -137
- package/node_modules/pino/test/types/tsconfig.json +10 -0
- package/node_modules/pino/tsconfig.json +6 -6
- package/node_modules/real-require/README.md +6 -6
- package/node_modules/real-require/package.json +10 -21
- package/node_modules/real-require/src/index.js +2 -2
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/doctor-probes.d.ts.map +1 -1
- package/packages/cli/dist/doctor-probes.js +44 -3
- package/packages/cli/dist/doctor-probes.js.map +1 -1
- package/packages/cli/dist/doctor.d.ts +37 -0
- package/packages/cli/dist/doctor.d.ts.map +1 -1
- package/packages/cli/dist/doctor.js +37 -0
- package/packages/cli/dist/doctor.js.map +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/actions/approvals.d.ts +7 -0
- package/packages/core/dist/actions/approvals.d.ts.map +1 -1
- package/packages/core/dist/actions/approvals.js +11 -1
- package/packages/core/dist/actions/approvals.js.map +1 -1
- package/packages/core/dist/agents/catalog.d.ts.map +1 -1
- package/packages/core/dist/agents/catalog.js +2 -2
- package/packages/core/dist/agents/catalog.js.map +1 -1
- package/packages/core/dist/agents/skills.d.ts +60 -1
- package/packages/core/dist/agents/skills.d.ts.map +1 -1
- package/packages/core/dist/agents/skills.js +157 -17
- package/packages/core/dist/agents/skills.js.map +1 -1
- package/packages/core/dist/day-month.d.ts +52 -0
- package/packages/core/dist/day-month.d.ts.map +1 -0
- package/packages/core/dist/day-month.js +101 -0
- package/packages/core/dist/day-month.js.map +1 -0
- package/packages/core/dist/host/build.d.ts +25 -2
- package/packages/core/dist/host/build.d.ts.map +1 -1
- package/packages/core/dist/host/build.js +169 -8
- package/packages/core/dist/host/build.js.map +1 -1
- package/packages/core/dist/host/http.d.ts +97 -0
- package/packages/core/dist/host/http.d.ts.map +1 -1
- package/packages/core/dist/host/http.js +321 -26
- package/packages/core/dist/host/http.js.map +1 -1
- package/packages/core/dist/host/types.d.ts +114 -4
- package/packages/core/dist/host/types.d.ts.map +1 -1
- package/packages/core/dist/index.d.ts +3 -0
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/index.js +3 -0
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/notifications/notify.d.ts.map +1 -1
- package/packages/core/dist/notifications/notify.js +10 -6
- package/packages/core/dist/notifications/notify.js.map +1 -1
- package/packages/core/dist/notifications/store.d.ts.map +1 -1
- package/packages/core/dist/notifications/store.js +2 -1
- package/packages/core/dist/notifications/store.js.map +1 -1
- package/packages/core/dist/notifications/types.d.ts +8 -0
- package/packages/core/dist/notifications/types.d.ts.map +1 -1
- package/packages/core/dist/notifications/types.js.map +1 -1
- package/packages/core/dist/onboarding/store.d.ts.map +1 -1
- package/packages/core/dist/onboarding/store.js +28 -5
- package/packages/core/dist/onboarding/store.js.map +1 -1
- package/packages/core/dist/onboarding/types.d.ts +10 -0
- package/packages/core/dist/onboarding/types.d.ts.map +1 -1
- package/packages/core/dist/onboarding/types.js.map +1 -1
- package/packages/core/dist/pages.d.ts +449 -20
- package/packages/core/dist/pages.d.ts.map +1 -1
- package/packages/core/dist/pages.js +223 -8
- package/packages/core/dist/pages.js.map +1 -1
- package/packages/core/dist/plugin/assets.d.ts +52 -0
- package/packages/core/dist/plugin/assets.d.ts.map +1 -0
- package/packages/core/dist/plugin/assets.js +59 -0
- package/packages/core/dist/plugin/assets.js.map +1 -0
- package/packages/core/dist/plugin/index.d.ts +10 -4
- package/packages/core/dist/plugin/index.d.ts.map +1 -1
- package/packages/core/dist/plugin/index.js +4 -1
- package/packages/core/dist/plugin/index.js.map +1 -1
- package/packages/core/dist/plugin/requires.d.ts +3 -1
- package/packages/core/dist/plugin/requires.d.ts.map +1 -1
- package/packages/core/dist/plugin/requires.js +5 -3
- package/packages/core/dist/plugin/requires.js.map +1 -1
- package/packages/core/dist/plugin/sign-in.d.ts +78 -0
- package/packages/core/dist/plugin/sign-in.d.ts.map +1 -0
- package/packages/core/dist/plugin/sign-in.js +54 -0
- package/packages/core/dist/plugin/sign-in.js.map +1 -0
- 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 +2 -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/plugin-assets.d.ts +21 -0
- package/packages/core/dist/plugin-assets.d.ts.map +1 -0
- package/packages/core/dist/plugin-assets.js +140 -0
- package/packages/core/dist/plugin-assets.js.map +1 -0
- package/packages/core/dist/provider-accounts.d.ts +7 -0
- package/packages/core/dist/provider-accounts.d.ts.map +1 -1
- package/packages/core/dist/provider-accounts.js +15 -0
- package/packages/core/dist/provider-accounts.js.map +1 -1
- package/packages/core/dist/questions/types.d.ts +1 -1
- package/packages/core/dist/questions/types.js +1 -1
- package/packages/core/dist/queue/jobs.d.ts +57 -2
- package/packages/core/dist/queue/jobs.d.ts.map +1 -1
- package/packages/core/dist/queue/jobs.js +114 -0
- package/packages/core/dist/queue/jobs.js.map +1 -1
- package/packages/core/dist/queue/worker.d.ts +24 -2
- package/packages/core/dist/queue/worker.d.ts.map +1 -1
- package/packages/core/dist/queue/worker.js +66 -11
- package/packages/core/dist/queue/worker.js.map +1 -1
- package/packages/core/dist/registry.d.ts +17 -0
- package/packages/core/dist/registry.d.ts.map +1 -1
- package/packages/core/dist/registry.js +48 -4
- package/packages/core/dist/registry.js.map +1 -1
- package/packages/core/dist/scheduler/missions.d.ts +14 -0
- package/packages/core/dist/scheduler/missions.d.ts.map +1 -1
- package/packages/core/dist/scheduler/missions.js +17 -4
- package/packages/core/dist/scheduler/missions.js.map +1 -1
- package/packages/core/dist/scheduler/types.d.ts +13 -0
- package/packages/core/dist/scheduler/types.d.ts.map +1 -1
- package/packages/core/dist/scheduler/types.js +14 -0
- package/packages/core/dist/scheduler/types.js.map +1 -1
- package/packages/core/dist/secrets/scrub.d.ts.map +1 -1
- package/packages/core/dist/secrets/scrub.js +15 -0
- package/packages/core/dist/secrets/scrub.js.map +1 -1
- package/packages/core/dist/surfaces.d.ts +10 -0
- package/packages/core/dist/surfaces.d.ts.map +1 -1
- package/packages/core/dist/surfaces.js +11 -0
- package/packages/core/dist/surfaces.js.map +1 -1
- package/packages/core/dist/tools.d.ts +72 -1
- package/packages/core/dist/tools.d.ts.map +1 -1
- package/packages/core/dist/tools.js +38 -0
- package/packages/core/dist/tools.js.map +1 -1
- package/packages/core/dist/views.d.ts +29 -12
- package/packages/core/dist/views.d.ts.map +1 -1
- package/packages/core/dist/views.js +1 -0
- package/packages/core/dist/views.js.map +1 -1
- package/packages/core/dist/widget-settings.d.ts +2 -1
- package/packages/core/dist/widget-settings.d.ts.map +1 -1
- package/packages/core/dist/widget-settings.js +8 -2
- package/packages/core/dist/widget-settings.js.map +1 -1
- package/packages/core/dist/widgets.d.ts +46 -3
- package/packages/core/dist/widgets.d.ts.map +1 -1
- package/packages/core/dist/widgets.js +68 -5
- package/packages/core/dist/widgets.js.map +1 -1
- package/packages/core/migrations/073_mission_report.sql +15 -0
- package/packages/core/migrations/074_owner_identity.sql +14 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalog.js +3 -3
- package/packages/gateway/dist/agents/catalog.js.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.d.ts +76 -0
- package/packages/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.js +29 -5
- package/packages/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/packages/gateway/dist/agents/owner-text.d.ts +19 -0
- package/packages/gateway/dist/agents/owner-text.d.ts.map +1 -0
- package/packages/gateway/dist/agents/owner-text.js +44 -0
- package/packages/gateway/dist/agents/owner-text.js.map +1 -0
- package/packages/gateway/dist/agents/owner-tools.d.ts.map +1 -1
- package/packages/gateway/dist/agents/owner-tools.js +36 -2
- package/packages/gateway/dist/agents/owner-tools.js.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.d.ts +68 -3
- package/packages/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.js +264 -32
- package/packages/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/packages/gateway/dist/agents/platform.d.ts +11 -4
- package/packages/gateway/dist/agents/platform.d.ts.map +1 -1
- package/packages/gateway/dist/agents/platform.js +15 -0
- package/packages/gateway/dist/agents/platform.js.map +1 -1
- package/packages/gateway/dist/bootstrap.d.ts.map +1 -1
- package/packages/gateway/dist/bootstrap.js +7 -1
- package/packages/gateway/dist/bootstrap.js.map +1 -1
- package/packages/gateway/dist/evals/golden.d.ts +33 -1
- package/packages/gateway/dist/evals/golden.d.ts.map +1 -1
- package/packages/gateway/dist/evals/golden.js +168 -3
- package/packages/gateway/dist/evals/golden.js.map +1 -1
- package/packages/gateway/dist/index.d.ts +2 -1
- package/packages/gateway/dist/index.d.ts.map +1 -1
- package/packages/gateway/dist/index.js +2 -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 +2 -0
- package/packages/gateway/dist/missions/agent-run.js.map +1 -1
- package/packages/gateway/dist/missions/dates.d.ts +98 -0
- package/packages/gateway/dist/missions/dates.d.ts.map +1 -0
- package/packages/gateway/dist/missions/dates.js +252 -0
- package/packages/gateway/dist/missions/dates.js.map +1 -0
- package/packages/gateway/dist/missions/defaults.d.ts.map +1 -1
- package/packages/gateway/dist/missions/defaults.js +2 -0
- package/packages/gateway/dist/missions/defaults.js.map +1 -1
- package/packages/gateway/dist/missions/execute.d.ts +25 -1
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +80 -8
- package/packages/gateway/dist/missions/execute.js.map +1 -1
- package/packages/gateway/dist/missions/report.d.ts +25 -2
- package/packages/gateway/dist/missions/report.d.ts.map +1 -1
- package/packages/gateway/dist/missions/report.js +71 -11
- package/packages/gateway/dist/missions/report.js.map +1 -1
- package/packages/gateway/dist/ollama-local.d.ts +90 -0
- package/packages/gateway/dist/ollama-local.d.ts.map +1 -0
- package/packages/gateway/dist/ollama-local.js +201 -0
- package/packages/gateway/dist/ollama-local.js.map +1 -0
- package/packages/gateway/dist/owner-notify.d.ts.map +1 -1
- package/packages/gateway/dist/owner-notify.js +7 -3
- package/packages/gateway/dist/owner-notify.js.map +1 -1
- package/packages/gateway/dist/plugins/asset-image-worker.d.ts +2 -0
- package/packages/gateway/dist/plugins/asset-image-worker.d.ts.map +1 -0
- package/packages/gateway/dist/plugins/asset-image-worker.js +18 -0
- package/packages/gateway/dist/plugins/asset-image-worker.js.map +1 -0
- package/packages/gateway/dist/plugins/asset-image.d.ts +31 -0
- package/packages/gateway/dist/plugins/asset-image.d.ts.map +1 -0
- package/packages/gateway/dist/plugins/asset-image.js +332 -0
- package/packages/gateway/dist/plugins/asset-image.js.map +1 -0
- package/packages/gateway/dist/plugins/load.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/load.js +14 -1
- package/packages/gateway/dist/plugins/load.js.map +1 -1
- package/packages/gateway/dist/plugins/stage.d.ts +6 -0
- package/packages/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/stage.js +5 -0
- package/packages/gateway/dist/plugins/stage.js.map +1 -1
- package/packages/gateway/dist/plugins/uninstall.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/uninstall.js +8 -0
- package/packages/gateway/dist/plugins/uninstall.js.map +1 -1
- package/packages/gateway/dist/plugins-cli.d.ts +8 -0
- package/packages/gateway/dist/plugins-cli.d.ts.map +1 -1
- package/packages/gateway/dist/plugins-cli.js +22 -1
- package/packages/gateway/dist/plugins-cli.js.map +1 -1
- package/packages/gateway/dist/serve.d.ts.map +1 -1
- package/packages/gateway/dist/serve.js +50 -5
- package/packages/gateway/dist/serve.js.map +1 -1
- package/packages/gateway/dist/surfaces/pending-question.js +2 -2
- package/packages/gateway/dist/system-context.d.ts +21 -1
- package/packages/gateway/dist/system-context.d.ts.map +1 -1
- package/packages/gateway/dist/system-context.js +76 -2
- package/packages/gateway/dist/system-context.js.map +1 -1
- package/packages/gateway/dist/telegram/approvals.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/approvals.js +4 -2
- package/packages/gateway/dist/telegram/approvals.js.map +1 -1
- package/packages/gateway/dist/telegram/channel.d.ts +12 -0
- package/packages/gateway/dist/telegram/channel.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/channel.js +49 -2
- package/packages/gateway/dist/telegram/channel.js.map +1 -1
- package/packages/gateway/dist/telegram/html.d.ts +34 -0
- package/packages/gateway/dist/telegram/html.d.ts.map +1 -0
- package/packages/gateway/dist/telegram/html.js +263 -0
- package/packages/gateway/dist/telegram/html.js.map +1 -0
- package/packages/gateway/dist/telegram/notify.d.ts +6 -0
- package/packages/gateway/dist/telegram/notify.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/notify.js +25 -3
- package/packages/gateway/dist/telegram/notify.js.map +1 -1
- package/packages/gateway/dist/tips/facts.d.ts +2 -0
- package/packages/gateway/dist/tips/facts.d.ts.map +1 -1
- package/packages/gateway/dist/tips/facts.js +4 -1
- package/packages/gateway/dist/tips/facts.js.map +1 -1
- package/packages/gateway/dist/tips/rules.d.ts.map +1 -1
- package/packages/gateway/dist/tips/rules.js +10 -0
- package/packages/gateway/dist/tips/rules.js.map +1 -1
- package/packages/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/packages/gateway/dist/web/api-routes.js +80 -11
- package/packages/gateway/dist/web/api-routes.js.map +1 -1
- package/packages/gateway/dist/web/api-scan.d.ts +1 -1
- package/packages/gateway/dist/web/api-scan.d.ts.map +1 -1
- package/packages/gateway/dist/web/api-scan.js +1 -0
- package/packages/gateway/dist/web/api-scan.js.map +1 -1
- package/packages/gateway/dist/web/catalogue.d.ts.map +1 -1
- package/packages/gateway/dist/web/catalogue.js +7 -4
- package/packages/gateway/dist/web/catalogue.js.map +1 -1
- package/packages/gateway/dist/web/chat.d.ts.map +1 -1
- package/packages/gateway/dist/web/chat.js +9 -0
- package/packages/gateway/dist/web/chat.js.map +1 -1
- package/packages/gateway/dist/web/composer.d.ts +45 -0
- package/packages/gateway/dist/web/composer.d.ts.map +1 -0
- package/packages/gateway/dist/web/composer.js +85 -0
- package/packages/gateway/dist/web/composer.js.map +1 -0
- package/packages/gateway/dist/web/extension.d.ts +12 -0
- package/packages/gateway/dist/web/extension.d.ts.map +1 -1
- package/packages/gateway/dist/web/extension.js +11 -1
- package/packages/gateway/dist/web/extension.js.map +1 -1
- package/packages/gateway/dist/web/lock.d.ts +6 -0
- package/packages/gateway/dist/web/lock.d.ts.map +1 -1
- package/packages/gateway/dist/web/lock.js +33 -2
- package/packages/gateway/dist/web/lock.js.map +1 -1
- package/packages/gateway/dist/web/market.d.ts +20 -1
- package/packages/gateway/dist/web/market.d.ts.map +1 -1
- package/packages/gateway/dist/web/market.js +41 -1
- package/packages/gateway/dist/web/market.js.map +1 -1
- package/packages/gateway/dist/web/people.d.ts +44 -0
- package/packages/gateway/dist/web/people.d.ts.map +1 -0
- package/packages/gateway/dist/web/people.js +114 -0
- package/packages/gateway/dist/web/people.js.map +1 -0
- package/packages/gateway/dist/web/server.d.ts +4 -0
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +171 -13
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/skill-bundles.d.ts +101 -0
- package/packages/gateway/dist/web/skill-bundles.d.ts.map +1 -0
- package/packages/gateway/dist/web/skill-bundles.js +439 -0
- package/packages/gateway/dist/web/skill-bundles.js.map +1 -0
- package/packages/gateway/dist/web/skills.d.ts +57 -1
- package/packages/gateway/dist/web/skills.d.ts.map +1 -1
- package/packages/gateway/dist/web/skills.js +171 -9
- package/packages/gateway/dist/web/skills.js.map +1 -1
- package/packages/gateway/dist/web/widgets.js +2 -2
- package/packages/gateway/dist/web/widgets.js.map +1 -1
- package/packages/gateway/dist/web/zip-read.d.ts +31 -0
- package/packages/gateway/dist/web/zip-read.d.ts.map +1 -0
- package/packages/gateway/dist/web/zip-read.js +125 -0
- package/packages/gateway/dist/web/zip-read.js.map +1 -0
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/index.d.ts +1 -0
- package/packages/runtime/dist/index.d.ts.map +1 -1
- package/packages/runtime/dist/index.js +1 -0
- package/packages/runtime/dist/index.js.map +1 -1
- package/packages/runtime/dist/loop.js +11 -1
- package/packages/runtime/dist/loop.js.map +1 -1
- package/packages/runtime/dist/plugin-sign-in.d.ts +12 -0
- package/packages/runtime/dist/plugin-sign-in.d.ts.map +1 -0
- package/packages/runtime/dist/plugin-sign-in.js +397 -0
- package/packages/runtime/dist/plugin-sign-in.js.map +1 -0
- package/packages/runtime/dist/transport.d.ts +1 -1
- package/packages/runtime/dist/transport.d.ts.map +1 -1
- package/packages/runtime/dist/transport.js +6 -0
- package/packages/runtime/dist/transport.js.map +1 -1
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/artifacts/dist/tools/write.d.ts.map +1 -1
- package/packages/tools/artifacts/dist/tools/write.js +1 -0
- package/packages/tools/artifacts/dist/tools/write.js.map +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/computer.d.ts +13 -0
- package/packages/tools/browser/dist/computer.d.ts.map +1 -1
- package/packages/tools/browser/dist/computer.js +22 -2
- package/packages/tools/browser/dist/computer.js.map +1 -1
- package/packages/tools/browser/dist/controller.d.ts +4 -0
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +8 -3
- package/packages/tools/browser/dist/controller.js.map +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 +1 -1
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/native/buddi-computer +0 -0
- package/packages/tools/browser/dist/service.d.ts +5 -0
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/email/dist/.tsbuildinfo +1 -1
- package/packages/tools/email/dist/widgets.d.ts.map +1 -1
- package/packages/tools/email/dist/widgets.js +2 -1
- package/packages/tools/email/dist/widgets.js.map +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/host/dist/index.d.ts +2 -1
- package/packages/tools/host/dist/index.d.ts.map +1 -1
- package/packages/tools/host/dist/index.js +3 -2
- package/packages/tools/host/dist/index.js.map +1 -1
- package/packages/tools/host/dist/process.d.ts +4 -0
- package/packages/tools/host/dist/process.d.ts.map +1 -1
- package/packages/tools/host/dist/process.js +4 -2
- package/packages/tools/host/dist/process.js.map +1 -1
- package/packages/tools/host/dist/service.d.ts +66 -17
- package/packages/tools/host/dist/service.d.ts.map +1 -1
- package/packages/tools/host/dist/service.js +172 -9
- package/packages/tools/host/dist/service.js.map +1 -1
- package/packages/tools/host/dist/skill-run.d.ts +55 -0
- package/packages/tools/host/dist/skill-run.d.ts.map +1 -0
- package/packages/tools/host/dist/skill-run.js +132 -0
- package/packages/tools/host/dist/skill-run.js.map +1 -0
- package/packages/tools/mcp/dist/.tsbuildinfo +1 -1
- package/packages/tools/memory/dist/.tsbuildinfo +1 -1
- package/packages/tools/memory/dist/index.d.ts +1 -0
- package/packages/tools/memory/dist/index.d.ts.map +1 -1
- package/packages/tools/memory/dist/index.js +7 -2
- package/packages/tools/memory/dist/index.js.map +1 -1
- package/packages/tools/memory/dist/people.d.ts +218 -0
- package/packages/tools/memory/dist/people.d.ts.map +1 -0
- package/packages/tools/memory/dist/people.js +582 -0
- package/packages/tools/memory/dist/people.js.map +1 -0
- package/packages/tools/memory/dist/preamble.d.ts +4 -1
- package/packages/tools/memory/dist/preamble.d.ts.map +1 -1
- package/packages/tools/memory/dist/preamble.js +25 -7
- package/packages/tools/memory/dist/preamble.js.map +1 -1
- package/packages/tools/memory/migrations/002_people.sql +40 -0
- package/packages/tools/web/dist/.tsbuildinfo +1 -1
- package/packages/web/dist/assets/index-CN1AXMI1.css +1 -0
- package/packages/web/dist/assets/index-CQRE9LJX.js +145 -0
- package/packages/web/dist/assets/{lottie_light-DYHnHRWL.js → lottie_light-CKJ88Yuk.js} +1 -1
- package/packages/web/dist/build.json +1 -1
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/precache.json +4 -4
- package/node_modules/pino/test/types/pino-import.test-d.cts +0 -30
- package/node_modules/pino/test/types/pino-multistream.test-d.ts +0 -28
- package/node_modules/pino/test/types/pino-top-export.test-d.ts +0 -34
- package/node_modules/pino/test/types/pino-type-only.test-d.ts +0 -75
- package/node_modules/thread-stream/node_modules/real-require/LICENSE.md +0 -21
- package/node_modules/thread-stream/node_modules/real-require/README.md +0 -51
- package/node_modules/thread-stream/node_modules/real-require/package.json +0 -38
- package/node_modules/thread-stream/node_modules/real-require/src/index.js +0 -14
- package/packages/web/dist/assets/index-ZauRFo4G.js +0 -134
- package/packages/web/dist/assets/index-viBWQfeT.css +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin's OAuth sign-in (host API 1.28, docs/plugin-host-api.md §4.2
|
|
3
|
+
* secrets, docs/owner-secrets.md §3 `http.bearer`).
|
|
4
|
+
*
|
|
5
|
+
* The providers a plugin may sign the owner in to, as data: where consent is
|
|
6
|
+
* asked, where tokens are exchanged and refreshed, and the hosts the tokens
|
|
7
|
+
* may be sent to. A plugin names a provider by id and never an endpoint, so a
|
|
8
|
+
* refresh token only ever goes back to the provider that issued it, and an
|
|
9
|
+
* access token only ever to that provider's API hosts.
|
|
10
|
+
*
|
|
11
|
+
* Pure: names, data and one error class a plugin can recognise.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Google: a Desktop-app client (PKCE, a loopback redirect), offline access so
|
|
15
|
+
* a refresh token comes back, and consent asked every time so a second
|
|
16
|
+
* sign-in gets a refresh token too (Google gives one only on consent).
|
|
17
|
+
*/
|
|
18
|
+
export const OAUTH_PROVIDERS = {
|
|
19
|
+
google: {
|
|
20
|
+
label: 'Google',
|
|
21
|
+
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/v2/auth',
|
|
22
|
+
tokenEndpoint: 'https://oauth2.googleapis.com/token',
|
|
23
|
+
authorizeExtra: { access_type: 'offline', prompt: 'consent', include_granted_scopes: 'false' },
|
|
24
|
+
apiHosts: ['www.googleapis.com'],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A request with `auth: { as: 'bearer' }` found the sign-in no longer works:
|
|
29
|
+
* the provider refused the refresh (revoked, expired — Google's testing-mode
|
|
30
|
+
* tokens last seven days — or the password changed). The owner signs in again;
|
|
31
|
+
* nothing a plugin retries will help. Recognise it by `code`, not `instanceof`:
|
|
32
|
+
* a plugin may load its own copy of this module.
|
|
33
|
+
*/
|
|
34
|
+
export class SignInExpiredError extends Error {
|
|
35
|
+
secret;
|
|
36
|
+
name = 'SignInExpiredError';
|
|
37
|
+
code = 'sign-in-expired';
|
|
38
|
+
constructor(secret, message = `the sign-in kept as "${secret}" no longer works; the owner signs in again`) {
|
|
39
|
+
super(message);
|
|
40
|
+
this.secret = secret;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function isSignInExpired(err) {
|
|
44
|
+
return typeof err === 'object' && err !== null && err.code === 'sign-in-expired';
|
|
45
|
+
}
|
|
46
|
+
/** Whether a host is one a pattern names: the same, or under its `*.` domain. */
|
|
47
|
+
export function oauthHostCovered(pattern, host) {
|
|
48
|
+
const p = pattern.toLowerCase();
|
|
49
|
+
const h = host.toLowerCase();
|
|
50
|
+
if (p.startsWith('*.'))
|
|
51
|
+
return h.endsWith(p.slice(1)) && h.length > p.length - 1;
|
|
52
|
+
return p === h;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=sign-in.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in.js","sourceRoot":"","sources":["../../src/plugin/sign-in.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAA4C;IACtE,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,qBAAqB,EAAE,8CAA8C;QACrE,aAAa,EAAE,qCAAqC;QACpD,cAAc,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,sBAAsB,EAAE,OAAO,EAAE;QAC9F,QAAQ,EAAE,CAAC,oBAAoB,CAAC;KACjC;CACF,CAAC;AAuCF;;;;;;GAMG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAIhC;IAHO,IAAI,GAAG,oBAAoB,CAAC;IACrC,IAAI,GAAG,iBAAiB,CAAC;IAClC,YACW,MAAc,EACvB,OAAO,GAAG,wBAAwB,MAAM,6CAA6C;QAErF,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,WAAM,GAAN,MAAM,CAAQ;IAIzB,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAK,GAA0B,CAAC,IAAI,KAAK,iBAAiB,CAAC;AAC3G,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,IAAY;IAC5D,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7B,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACjF,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Pure: names, the owner's words for each, and the comparisons.
|
|
12
12
|
*/
|
|
13
13
|
/** Every area a plugin may declare. `files:library` is `files`, over the whole library. */
|
|
14
|
-
export declare const PLUGIN_USES: readonly ["http", "accounts", "files", "files:library", "memory", "proposals", "schedule", "secrets", "owner:notify", "owner:channel", "owner:places"];
|
|
14
|
+
export declare const PLUGIN_USES: readonly ["http", "accounts", "files", "files:library", "memory", "proposals", "schedule", "secrets", "owner:notify", "owner:channel", "owner:places", "assets"];
|
|
15
15
|
export type PluginUse = (typeof PLUGIN_USES)[number];
|
|
16
16
|
/**
|
|
17
17
|
* The line the owner reads on the install card for each area, in the spec's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uses.d.ts","sourceRoot":"","sources":["../../src/plugin/uses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2FAA2F;AAC3F,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"uses.d.ts","sourceRoot":"","sources":["../../src/plugin/uses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2FAA2F;AAC3F,eAAO,MAAM,WAAW,kKAad,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAahE,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GACZ;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAiBlE;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,KAAK,EAAE,SAAS,SAAS,EAAE,GAC1B;IAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAAC,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,CAK9C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,GAAG,EAAE,SAAS,SAAS,EAAE,GACxB,MAAM,GAAG,SAAS,CAQpB"}
|
|
@@ -23,6 +23,7 @@ export const PLUGIN_USES = [
|
|
|
23
23
|
'owner:notify',
|
|
24
24
|
'owner:channel',
|
|
25
25
|
'owner:places',
|
|
26
|
+
'assets',
|
|
26
27
|
];
|
|
27
28
|
/**
|
|
28
29
|
* The line the owner reads on the install card for each area, in the spec's
|
|
@@ -41,6 +42,7 @@ export const PLUGIN_USE_WORDS = {
|
|
|
41
42
|
'owner:notify': 'can send you messages when you are away',
|
|
42
43
|
'owner:channel': 'adds a way for buddi to reach you',
|
|
43
44
|
'owner:places': 'reads your places (Home, Work…) and their addresses',
|
|
45
|
+
assets: 'keeps small images it fetched, like logos',
|
|
44
46
|
};
|
|
45
47
|
export function isPluginUse(value) {
|
|
46
48
|
return typeof value === 'string' && PLUGIN_USES.includes(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uses.js","sourceRoot":"","sources":["../../src/plugin/uses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,UAAU;IACV,OAAO;IACP,eAAe;IACf,QAAQ;IACR,WAAW;IACX,UAAU;IACV,SAAS;IACT,cAAc;IACd,eAAe;IACf,cAAc;
|
|
1
|
+
{"version":3,"file":"uses.js","sourceRoot":"","sources":["../../src/plugin/uses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,UAAU;IACV,OAAO;IACP,eAAe;IACf,QAAQ;IACR,WAAW;IACX,UAAU;IACV,SAAS;IACT,cAAc;IACd,eAAe;IACf,cAAc;IACd,QAAQ;CACA,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAwC;IACnE,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,+BAA+B;IACzC,KAAK,EAAE,mCAAmC;IAC1C,eAAe,EAAE,wCAAwC;IACzD,MAAM,EAAE,oDAAoD;IAC5D,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE,6BAA6B;IACvC,OAAO,EAAE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 -8,7 +8,7 @@
|
|
|
8
8
|
* than this buddi has is refused when it is staged, before anything of it runs.
|
|
9
9
|
*/
|
|
10
10
|
/** What this build's `ctx.buddi.version` says. */
|
|
11
|
-
export declare const HOST_API_VERSION = "1.
|
|
11
|
+
export declare const HOST_API_VERSION = "1.28";
|
|
12
12
|
/**
|
|
13
13
|
* Why a plugin asking for `range` cannot run on a host at `have`, or undefined
|
|
14
14
|
* when it can.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* than this buddi has is refused when it is staged, before anything of it runs.
|
|
9
9
|
*/
|
|
10
10
|
/** What this build's `ctx.buddi.version` says. */
|
|
11
|
-
export const HOST_API_VERSION = '1.
|
|
11
|
+
export const HOST_API_VERSION = '1.28';
|
|
12
12
|
function parseVersion(text) {
|
|
13
13
|
const match = /^(\d+)(?:\.(\d+))?(?:\.\d+)?$/.exec(text.trim());
|
|
14
14
|
if (match === null)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type EnvLike } from './artifacts/store.js';
|
|
2
|
+
import { type AssetImageCodec, type AssetSize, type PluginAsset } from './plugin/assets.js';
|
|
3
|
+
export * from './plugin/assets.js';
|
|
4
|
+
/** `<data>/plugin-assets`. */
|
|
5
|
+
export declare function assetsRoot(env?: EnvLike): string;
|
|
6
|
+
/** Every asset a plugin keeps, by key. */
|
|
7
|
+
export declare function listPluginAssets(plugin: string, env?: EnvLike): Promise<PluginAsset[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Decode, re-encode and keep one asset under `key`, replacing what was
|
|
10
|
+
* there. Refused, as an `AssetRefusal` with the sentence why, for a bad key,
|
|
11
|
+
* an SVG, a type buddi does not read, more than 256 KB in, an image the codec
|
|
12
|
+
* cannot read, or a plugin over its 20 MB.
|
|
13
|
+
*/
|
|
14
|
+
export declare function putPluginAsset(plugin: string, key: string, bytes: Buffer, mime: string, codec: AssetImageCodec | undefined, env?: EnvLike): Promise<PluginAsset>;
|
|
15
|
+
/** Delete one asset. False when there was none. */
|
|
16
|
+
export declare function deletePluginAsset(plugin: string, key: string, env?: EnvLike): Promise<boolean>;
|
|
17
|
+
/** The stored PNG for one size, or null when there is none. */
|
|
18
|
+
export declare function readPluginAsset(plugin: string, key: string, size: AssetSize, env?: EnvLike): Promise<Buffer | null>;
|
|
19
|
+
/** Remove every asset a plugin kept: when the plugin is removed. Never throws for a missing directory. */
|
|
20
|
+
export declare function removePluginAssets(plugin: string, env?: EnvLike): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=plugin-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-assets.d.ts","sourceRoot":"","sources":["../src/plugin-assets.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,oBAAoB,CAAC;AAEnC,8BAA8B;AAC9B,wBAAgB,UAAU,CAAC,GAAG,GAAE,OAAqB,GAAG,MAAM,CAE7D;AAoBD,0CAA0C;AAC1C,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,OAAqB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAyBzG;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,GAAG,SAAS,EAClC,GAAG,GAAE,OAAqB,GACzB,OAAO,CAAC,WAAW,CAAC,CAwBtB;AAED,mDAAmD;AACnD,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,OAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,CAajH;AAED,+DAA+D;AAC/D,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,SAAS,EACf,GAAG,GAAE,OAAqB,GACzB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED,0GAA0G;AAC1G,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,OAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAElG"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin assets (host API 1.27, docs/plugin-host-api.md §4.2 `assets`): small
|
|
3
|
+
* images a plugin fetched — an outlet's logo — kept by core and served by
|
|
4
|
+
* buddi, so the dashboard draws them without ever reaching the host they
|
|
5
|
+
* came from.
|
|
6
|
+
*
|
|
7
|
+
* A plugin hands over bytes; core decodes them and writes PNGs it encoded
|
|
8
|
+
* itself, at 64 and 128 pixels, under `<data>/plugin-assets/<plugin>/`. Only
|
|
9
|
+
* those files are ever served (`/api/plugin-assets/<plugin>/<key>`), with
|
|
10
|
+
* `image/png`, `nosniff` and the sandboxing CSP: nothing a plugin wrote
|
|
11
|
+
* byte-for-byte reaches a page. The directory is core's, not the plugin's own
|
|
12
|
+
* (`dir`), and it is removed with the plugin.
|
|
13
|
+
*
|
|
14
|
+
* Decoding is not done here: core carries no image library. The composition
|
|
15
|
+
* root hands one in (`configurePluginHost({ images })`), as it hands in the
|
|
16
|
+
* HTTP transport; a process without one refuses `put` in a sentence.
|
|
17
|
+
*/
|
|
18
|
+
import { mkdir, readdir, readFile, rename, rm, stat, writeFile } from 'node:fs/promises';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
import { resolveDataDir } from './artifacts/store.js';
|
|
21
|
+
import { ASSET_QUOTA_BYTES, ASSET_SIZES, AssetRefusal, assetInputProblem, isAssetKey, } from './plugin/assets.js';
|
|
22
|
+
export * from './plugin/assets.js';
|
|
23
|
+
/** `<data>/plugin-assets`. */
|
|
24
|
+
export function assetsRoot(env = process.env) {
|
|
25
|
+
return path.join(resolveDataDir(env), 'plugin-assets');
|
|
26
|
+
}
|
|
27
|
+
function pluginDir(plugin, env) {
|
|
28
|
+
if (!/^[a-z][a-z0-9_-]{0,63}$/.test(plugin))
|
|
29
|
+
throw new AssetRefusal(`"${plugin}" is not a plugin name`);
|
|
30
|
+
return path.join(assetsRoot(env), plugin);
|
|
31
|
+
}
|
|
32
|
+
function fileOf(dir, key, size) {
|
|
33
|
+
return path.join(dir, `${key}.${size}.png`);
|
|
34
|
+
}
|
|
35
|
+
function checkKey(key) {
|
|
36
|
+
if (!isAssetKey(key)) {
|
|
37
|
+
throw new AssetRefusal(`"${String(key)}" is not an asset key (lower-case letters, digits, ".", "_" and "-", at most 96 characters)`);
|
|
38
|
+
}
|
|
39
|
+
return key;
|
|
40
|
+
}
|
|
41
|
+
/** Every asset a plugin keeps, by key. */
|
|
42
|
+
export async function listPluginAssets(plugin, env = process.env) {
|
|
43
|
+
const dir = pluginDir(plugin, env);
|
|
44
|
+
let names;
|
|
45
|
+
try {
|
|
46
|
+
names = await readdir(dir);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
if (err.code === 'ENOENT')
|
|
50
|
+
return [];
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
const byKey = new Map();
|
|
54
|
+
for (const name of names.sort()) {
|
|
55
|
+
const match = /^(.+)\.(64|128)\.png$/.exec(name);
|
|
56
|
+
if (!match || !isAssetKey(match[1]))
|
|
57
|
+
continue;
|
|
58
|
+
const info = await stat(path.join(dir, name)).catch(() => null);
|
|
59
|
+
if (!info)
|
|
60
|
+
continue;
|
|
61
|
+
const key = match[1];
|
|
62
|
+
const seen = byKey.get(key);
|
|
63
|
+
const at = info.mtime.toISOString();
|
|
64
|
+
byKey.set(key, {
|
|
65
|
+
key,
|
|
66
|
+
bytes: (seen?.bytes ?? 0) + info.size,
|
|
67
|
+
updatedAt: seen && seen.updatedAt > at ? seen.updatedAt : at,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return [...byKey.values()];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Decode, re-encode and keep one asset under `key`, replacing what was
|
|
74
|
+
* there. Refused, as an `AssetRefusal` with the sentence why, for a bad key,
|
|
75
|
+
* an SVG, a type buddi does not read, more than 256 KB in, an image the codec
|
|
76
|
+
* cannot read, or a plugin over its 20 MB.
|
|
77
|
+
*/
|
|
78
|
+
export async function putPluginAsset(plugin, key, bytes, mime, codec, env = process.env) {
|
|
79
|
+
checkKey(key);
|
|
80
|
+
const problem = assetInputProblem(bytes, mime);
|
|
81
|
+
if (problem)
|
|
82
|
+
throw new AssetRefusal(`${plugin}: ${problem}`);
|
|
83
|
+
if (!codec)
|
|
84
|
+
throw new AssetRefusal('This process cannot keep plugin assets (no image codec was configured).');
|
|
85
|
+
const encoded = await codec.normalise(bytes, mime);
|
|
86
|
+
const dir = pluginDir(plugin, env);
|
|
87
|
+
const size = ASSET_SIZES.reduce((sum, s) => sum + (encoded[s]?.length ?? 0), 0);
|
|
88
|
+
const kept = await listPluginAssets(plugin, env);
|
|
89
|
+
const others = kept.filter((a) => a.key !== key).reduce((sum, a) => sum + a.bytes, 0);
|
|
90
|
+
if (others + size > ASSET_QUOTA_BYTES) {
|
|
91
|
+
throw new AssetRefusal(`${plugin} keeps ${others} bytes of assets; this one would pass its ${ASSET_QUOTA_BYTES / 1024 / 1024} MB (delete some first)`);
|
|
92
|
+
}
|
|
93
|
+
await mkdir(dir, { recursive: true });
|
|
94
|
+
for (const s of ASSET_SIZES) {
|
|
95
|
+
const png = encoded[s];
|
|
96
|
+
if (!png)
|
|
97
|
+
throw new AssetRefusal(`${plugin}: the image could not be drawn at ${s} px`);
|
|
98
|
+
// Written beside and renamed over: a page never reads half a file.
|
|
99
|
+
const target = fileOf(dir, key, s);
|
|
100
|
+
const temp = `${target}.${process.pid}.tmp`;
|
|
101
|
+
await writeFile(temp, png);
|
|
102
|
+
await rename(temp, target);
|
|
103
|
+
}
|
|
104
|
+
return { key, bytes: size, updatedAt: new Date().toISOString() };
|
|
105
|
+
}
|
|
106
|
+
/** Delete one asset. False when there was none. */
|
|
107
|
+
export async function deletePluginAsset(plugin, key, env = process.env) {
|
|
108
|
+
checkKey(key);
|
|
109
|
+
const dir = pluginDir(plugin, env);
|
|
110
|
+
let removed = false;
|
|
111
|
+
for (const s of ASSET_SIZES) {
|
|
112
|
+
try {
|
|
113
|
+
await rm(fileOf(dir, key, s));
|
|
114
|
+
removed = true;
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
if (err.code !== 'ENOENT')
|
|
118
|
+
throw err;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return removed;
|
|
122
|
+
}
|
|
123
|
+
/** The stored PNG for one size, or null when there is none. */
|
|
124
|
+
export async function readPluginAsset(plugin, key, size, env = process.env) {
|
|
125
|
+
if (!isAssetKey(key) || !ASSET_SIZES.includes(size))
|
|
126
|
+
return null;
|
|
127
|
+
try {
|
|
128
|
+
return await readFile(fileOf(pluginDir(plugin, env), key, size));
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
if (err.code === 'ENOENT' || err instanceof AssetRefusal)
|
|
132
|
+
return null;
|
|
133
|
+
throw err;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/** Remove every asset a plugin kept: when the plugin is removed. Never throws for a missing directory. */
|
|
137
|
+
export async function removePluginAssets(plugin, env = process.env) {
|
|
138
|
+
await rm(pluginDir(plugin, env), { recursive: true, force: true });
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=plugin-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-assets.js","sourceRoot":"","sources":["../src/plugin-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,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AAM,GAAG,CAAC;QAClE,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,GAAW,EACX,IAAe,EACf,MAAe,OAAO,CAAC,GAAG;IAE1B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAE,WAAiC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACxF,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,YAAY,YAAY;YAAE,OAAO,IAAI,CAAC;QACjG,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,0GAA0G;AAC1G,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAc,EAAE,MAAe,OAAO,CAAC,GAAG;IACjF,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -36,6 +36,13 @@ export declare function isMlxhAccount(row: {
|
|
|
36
36
|
kind: string;
|
|
37
37
|
baseUrl: string;
|
|
38
38
|
}, mlxhBaseUrl?: string): boolean;
|
|
39
|
+
/** Where Ollama answers on this machine, by default. */
|
|
40
|
+
export declare const OLLAMA_LOCAL_PORT = "11434";
|
|
41
|
+
/**
|
|
42
|
+
* Whether an address is the Ollama on this machine: any loopback address on
|
|
43
|
+
* Ollama's port. Ollama Cloud and an Ollama elsewhere on the network are not.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isLocalOllamaUrl(baseUrl: string): boolean;
|
|
39
46
|
export interface ProviderAccount {
|
|
40
47
|
id: string;
|
|
41
48
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-accounts.d.ts","sourceRoot":"","sources":["../src/provider-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEvF,kFAAkF;AAClF,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,QAAQ,GAAG,mBAAmB,GAAG,OAAO,CAAC;AACzF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,YAAY,CAAC;AAEpG;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,0BAA0B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,6DAA6D,CAAC;AAC1F,eAAO,MAAM,cAAc,uCAAuC,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,aAAa,6BAA6B,CAAC;AACxD;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,WAAW,GAAE,MAAsB,GAAG,OAAO,CAQlH;AACD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,wBAAgB,e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AS,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACxF"}
|
|
@@ -43,6 +43,21 @@ export function isMlxhAccount(row, mlxhBaseUrl = MLXH_BASE_URL) {
|
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
/** Where Ollama answers on this machine, by default. */
|
|
47
|
+
export const OLLAMA_LOCAL_PORT = '11434';
|
|
48
|
+
/**
|
|
49
|
+
* Whether an address is the Ollama on this machine: any loopback address on
|
|
50
|
+
* Ollama's port. Ollama Cloud and an Ollama elsewhere on the network are not.
|
|
51
|
+
*/
|
|
52
|
+
export function isLocalOllamaUrl(baseUrl) {
|
|
53
|
+
try {
|
|
54
|
+
const url = new URL(baseUrl);
|
|
55
|
+
return ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname) && url.port === OLLAMA_LOCAL_PORT;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
46
61
|
export function accountProtocol(kind) {
|
|
47
62
|
return kind === 'anthropic' ? 'anthropic' : 'openai';
|
|
48
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-accounts.js","sourceRoot":"","sources":["../src/provider-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA4C,MAAM,eAAe,CAAC;AAMvF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,0DAA0D,CAAC;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;AACxD;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAEnD;;;GAGG;AACH,MAAM,UA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,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,wBAAwB;YAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACvL,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAC3E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAClJ,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IAClI,OAAO;QACL,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC;QACnC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC;QACtD,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS;QAC/D,MAAM,EAAE,MAAM,IAAI,EAAE,EAAE,KAAK;QAC3B,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtE,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const QUESTION_TTL_MS = 30 * 60_000;
|
|
2
|
-
export const MAX_QUESTION_OPTIONS =
|
|
2
|
+
export const MAX_QUESTION_OPTIONS = 6;
|
|
3
3
|
export const MAX_QUESTION_LABEL = 48;
|
|
4
4
|
export const QUESTION_COLUMNS = 'id, agent_id, conversation_id, question, options, allow_other, created_at, expires_at, answered_at, answered_via, answer';
|
|
5
5
|
const iso = (value) => value == null ? null : value instanceof Date ? value.toISOString() : String(value);
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
* `lease_owner = $worker and state = 'leased'`. That is the fence: a worker
|
|
10
10
|
* whose lease expired and was reclaimed elsewhere updates nothing and is
|
|
11
11
|
* told so (`false` / `null`), instead of writing over the new owner's run.
|
|
12
|
-
* - `
|
|
13
|
-
*
|
|
12
|
+
* - `interruptLeases` is startup recovery, the running sweep and the
|
|
13
|
+
* shutdown release — a lease that outlived its run is settled: requeued
|
|
14
|
+
* once when the run had done nothing yet, failed with the reason otherwise.
|
|
15
|
+
* (`releaseStaleLeases` is the older, unconditional put-back.)
|
|
14
16
|
*/
|
|
15
17
|
import type { Pool } from 'pg';
|
|
16
18
|
import { type FailureClass } from './retry-policy.js';
|
|
@@ -114,6 +116,59 @@ export declare function resumeJob(pool: Pool, jobId: string, input?: ResumeInput
|
|
|
114
116
|
* process that dies mid-job cannot loop forever on the installation's behalf.
|
|
115
117
|
*/
|
|
116
118
|
export declare function releaseStaleLeases(pool: Pool, now: Date): Promise<number>;
|
|
119
|
+
/** Why a lease is being taken back from a run that never finished. */
|
|
120
|
+
export declare const INTERRUPTED_REASON = "interrupted by a restart";
|
|
121
|
+
export type InterruptScope =
|
|
122
|
+
/** Every lease whose expiry passed: the holder stopped heartbeating. */
|
|
123
|
+
{
|
|
124
|
+
expiredBy: Date;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Start-up recovery: every lease that expired, and every lease held by a
|
|
128
|
+
* previous boot of this worker family (`holderPrefix`), whatever its expiry —
|
|
129
|
+
* a restart takes seconds, the lease lasts minutes, and the process that
|
|
130
|
+
* held it is gone either way.
|
|
131
|
+
*/
|
|
132
|
+
| {
|
|
133
|
+
expiredBy: Date;
|
|
134
|
+
self: string;
|
|
135
|
+
holderPrefix: string;
|
|
136
|
+
}
|
|
137
|
+
/** Graceful shutdown: the leases this worker holds. */
|
|
138
|
+
| {
|
|
139
|
+
heldBy: string;
|
|
140
|
+
};
|
|
141
|
+
export type InterruptedJob = Job & {
|
|
142
|
+
/** True when the job went back on the queue; false when it failed for the owner. */
|
|
143
|
+
requeued: boolean;
|
|
144
|
+
/** Non-auto tools this attempt had already called (its side effects). */
|
|
145
|
+
acted: string[];
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Take back the leases of runs that will never report, and settle each one.
|
|
149
|
+
*
|
|
150
|
+
* The retry policy is the run's own record: an attempt that had not yet
|
|
151
|
+
* called a tool with an effect (any tier but `auto`, or an `auto` tool marked
|
|
152
|
+
* `sideEffect`, read from the `tool.called` events carrying this job's id
|
|
153
|
+
* since its latest claim) and whose report was not delivered (a
|
|
154
|
+
* `mission.delivered` event for its occurrence or conversation) goes
|
|
155
|
+
* back on the queue — once. One that had acted, or that was already requeued
|
|
156
|
+
* after an interruption, or that has no attempts left, fails with the reason in
|
|
157
|
+
* `last_error`, where Activity → Jobs shows it; a mission occurrence it was
|
|
158
|
+
* running is closed as failed with the same reason. Nothing is re-run that
|
|
159
|
+
* might send, buy or write a second time without the owner deciding.
|
|
160
|
+
*
|
|
161
|
+
* Every write is fenced on the holder the candidate query saw, so a lease
|
|
162
|
+
* reclaimed in between is left alone. The attempt stays spent.
|
|
163
|
+
*/
|
|
164
|
+
export declare function interruptLeases(pool: Pool, scope: InterruptScope, detail?: string, opts?: {
|
|
165
|
+
/**
|
|
166
|
+
* False when the attempt may still be running in this process (its
|
|
167
|
+
* handler ignored the stop): putting it back would let the next start run
|
|
168
|
+
* it beside the one still going, so it fails instead.
|
|
169
|
+
*/
|
|
170
|
+
requeue?: boolean;
|
|
171
|
+
}): Promise<InterruptedJob[]>;
|
|
117
172
|
/**
|
|
118
173
|
* Stop a job for good. Anything not already finished can be cancelled, and so
|
|
119
174
|
* can a failed one: "failed" is the queue waiting for a human, and giving up
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/queue/jobs.ts"],"names":[],"mappings":"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wE;IACxE,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAC1B,GACL,OAAO,CAAC,GAAG,EAAE,CAAC,CA6ChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,CAiBrE;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE;IAAE,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,OAAO,CAAC,GAAG,EAAE,CAAC,CAehB;AAED,sEAAsE;AACtE,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAYtF"}
|
|
@@ -193,6 +193,120 @@ export async function releaseStaleLeases(pool, now) {
|
|
|
193
193
|
}
|
|
194
194
|
return rows.length;
|
|
195
195
|
}
|
|
196
|
+
/** Why a lease is being taken back from a run that never finished. */
|
|
197
|
+
export const INTERRUPTED_REASON = 'interrupted by a restart';
|
|
198
|
+
/**
|
|
199
|
+
* Take back the leases of runs that will never report, and settle each one.
|
|
200
|
+
*
|
|
201
|
+
* The retry policy is the run's own record: an attempt that had not yet
|
|
202
|
+
* called a tool with an effect (any tier but `auto`, or an `auto` tool marked
|
|
203
|
+
* `sideEffect`, read from the `tool.called` events carrying this job's id
|
|
204
|
+
* since its latest claim) and whose report was not delivered (a
|
|
205
|
+
* `mission.delivered` event for its occurrence or conversation) goes
|
|
206
|
+
* back on the queue — once. One that had acted, or that was already requeued
|
|
207
|
+
* after an interruption, or that has no attempts left, fails with the reason in
|
|
208
|
+
* `last_error`, where Activity → Jobs shows it; a mission occurrence it was
|
|
209
|
+
* running is closed as failed with the same reason. Nothing is re-run that
|
|
210
|
+
* might send, buy or write a second time without the owner deciding.
|
|
211
|
+
*
|
|
212
|
+
* Every write is fenced on the holder the candidate query saw, so a lease
|
|
213
|
+
* reclaimed in between is left alone. The attempt stays spent.
|
|
214
|
+
*/
|
|
215
|
+
export async function interruptLeases(pool, scope, detail, opts = {}) {
|
|
216
|
+
const params = [];
|
|
217
|
+
let where;
|
|
218
|
+
if ('heldBy' in scope) {
|
|
219
|
+
params.push(scope.heldBy);
|
|
220
|
+
where = 'j.lease_owner = $1';
|
|
221
|
+
}
|
|
222
|
+
else if ('self' in scope) {
|
|
223
|
+
params.push(scope.expiredBy.toISOString(), scope.self, `${scope.holderPrefix}%`);
|
|
224
|
+
where = `j.lease_owner is distinct from $2 and (j.lease_until < $1::timestamptz or j.lease_owner like $3)`;
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
params.push(scope.expiredBy.toISOString());
|
|
228
|
+
where = 'j.lease_until < $1::timestamptz';
|
|
229
|
+
}
|
|
230
|
+
const { rows: candidates } = await pool.query(`select j.id, j.lease_owner, j.attempts, j.max_attempts,
|
|
231
|
+
coalesce((select array_agg(distinct a.name order by a.name) from (
|
|
232
|
+
select e.payload->>'name' as name
|
|
233
|
+
from core.events e
|
|
234
|
+
where e.kind = 'tool.called'
|
|
235
|
+
and e.payload->>'jobId' = j.id::text
|
|
236
|
+
and (coalesce(e.payload->>'tier', 'gated') <> 'auto' or e.payload->>'sideEffect' = 'true')
|
|
237
|
+
and e.created_at >= coalesce((select max(c.created_at) from core.events c
|
|
238
|
+
where c.kind = 'job.claimed' and c.payload->>'jobId' = j.id::text), j.created_at)
|
|
239
|
+
union all
|
|
240
|
+
-- An earlier version recorded calls without the job or the tier, so
|
|
241
|
+
-- one of those since this claim may be this run's: count it as acted.
|
|
242
|
+
select 'a tool call recorded by an earlier version'
|
|
243
|
+
from core.events e
|
|
244
|
+
where e.kind = 'tool.called'
|
|
245
|
+
and not (e.payload ? 'tier')
|
|
246
|
+
and (j.conversation_id is null or e.conversation_id is null or e.conversation_id = j.conversation_id)
|
|
247
|
+
and e.created_at >= coalesce((select max(c.created_at) from core.events c
|
|
248
|
+
where c.kind = 'job.claimed' and c.payload->>'jobId' = j.id::text), j.created_at)
|
|
249
|
+
union all
|
|
250
|
+
select 'its report was delivered'
|
|
251
|
+
from core.events e
|
|
252
|
+
where e.kind = 'mission.delivered'
|
|
253
|
+
and ((j.payload->>'occurrenceId' is not null and e.payload->>'occurrenceId' = j.payload->>'occurrenceId')
|
|
254
|
+
or (j.conversation_id is not null and e.conversation_id = j.conversation_id))
|
|
255
|
+
and e.created_at >= coalesce((select max(c.created_at) from core.events c
|
|
256
|
+
where c.kind = 'job.claimed' and c.payload->>'jobId' = j.id::text), j.created_at)
|
|
257
|
+
) a), '{}'::text[]) as acted,
|
|
258
|
+
(select count(*)::int from core.events e
|
|
259
|
+
where e.kind = 'job.interrupted' and e.payload->>'jobId' = j.id::text
|
|
260
|
+
and e.payload->>'requeued' = 'true') as requeues
|
|
261
|
+
from core.jobs j
|
|
262
|
+
where j.state = 'leased' and ${where}`, params);
|
|
263
|
+
const settled = [];
|
|
264
|
+
const why = detail ? `${INTERRUPTED_REASON} (${detail})` : INTERRUPTED_REASON;
|
|
265
|
+
for (const c of candidates) {
|
|
266
|
+
const acted = c.acted.filter((name) => typeof name === 'string' && name !== '');
|
|
267
|
+
const requeue = opts.requeue !== false && acted.length === 0 && c.requeues === 0 && c.attempts < c.max_attempts;
|
|
268
|
+
const message = requeue
|
|
269
|
+
? `${why}; queued again`
|
|
270
|
+
: opts.requeue === false && acted.length === 0
|
|
271
|
+
? `${why} while it was still running; not run again on its own, so it never runs twice at once. Retry it if it should run.`
|
|
272
|
+
: acted.length > 0
|
|
273
|
+
? `${why} after it had acted (${acted.join(', ')}); not run again on its own, so nothing happens twice. Retry it if it should run.`
|
|
274
|
+
: c.requeues > 0
|
|
275
|
+
? `${why} a second time; not run again on its own. Retry it if it should run.`
|
|
276
|
+
: `${why} on its last attempt.`;
|
|
277
|
+
const { rows } = await pool.query(`update core.jobs
|
|
278
|
+
set state = case when $3 then 'pending' else 'failed' end,
|
|
279
|
+
run_after = case when $3 then now() else run_after end,
|
|
280
|
+
last_error = $4,
|
|
281
|
+
lease_owner = null,
|
|
282
|
+
lease_until = null,
|
|
283
|
+
acknowledged_at = null,
|
|
284
|
+
acknowledged_by = null,
|
|
285
|
+
updated_at = now()
|
|
286
|
+
where id = $1::uuid and state = 'leased' and lease_owner is not distinct from $2
|
|
287
|
+
returning ${JOB_COLUMNS}`, [c.id, c.lease_owner, requeue, message]);
|
|
288
|
+
if (rows.length === 0)
|
|
289
|
+
continue;
|
|
290
|
+
const job = toJob(rows[0]);
|
|
291
|
+
await appendEvent(pool, 'job.interrupted', { jobId: job.id, kind: job.kind, holder: c.lease_owner, attempts: job.attempts, requeued: requeue, acted, reason: why }, job.conversationId ?? undefined);
|
|
292
|
+
if (!requeue) {
|
|
293
|
+
// A mission's occurrence is the run the owner sees on Missions; it closes
|
|
294
|
+
// with the job rather than staying claimed for a run that will not come.
|
|
295
|
+
const occurrenceId = job.payload?.occurrenceId;
|
|
296
|
+
if (typeof occurrenceId === 'string') {
|
|
297
|
+
await pool.query(`update core.occurrences set state = 'failed', finished_at = now(), error = $2
|
|
298
|
+
where id::text = $1 and state = 'claimed'`, [occurrenceId, message]);
|
|
299
|
+
}
|
|
300
|
+
await appendEvent(pool, 'job.failed', {
|
|
301
|
+
jobId: job.id, kind: job.kind, worker: c.lease_owner, attempts: job.attempts,
|
|
302
|
+
maxAttempts: job.maxAttempts, error: message, retrying: false,
|
|
303
|
+
failureClass: 'interrupted', failureReason: why,
|
|
304
|
+
}, job.conversationId ?? undefined);
|
|
305
|
+
}
|
|
306
|
+
settled.push({ ...job, requeued: requeue, acted });
|
|
307
|
+
}
|
|
308
|
+
return settled;
|
|
309
|
+
}
|
|
196
310
|
/**
|
|
197
311
|
* Stop a job for good. Anything not already finished can be cancelled, and so
|
|
198
312
|
* can a failed one: "failed" is the queue waiting for a human, and giving up
|