@withbuddi/buddi 0.1.0-pre.24 → 0.1.0-pre.26
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 +62 -47
- package/examples/agents/agent-father/agent.md +1 -0
- package/extension/background.js +24 -1
- package/extension/blob.png +0 -0
- package/extension/fonts/dm-mono-latin-400-normal.woff2 +0 -0
- package/extension/fonts/dm-mono-latin-500-normal.woff2 +0 -0
- package/extension/fonts/dm-sans-latin-ext-standard-normal.woff2 +0 -0
- package/extension/fonts/dm-sans-latin-standard-normal.woff2 +0 -0
- package/extension/icons/128.png +0 -0
- package/extension/icons/16.png +0 -0
- package/extension/icons/32.png +0 -0
- package/extension/icons/48.png +0 -0
- package/extension/manifest.json +4 -3
- package/extension/popup.css +199 -81
- package/extension/popup.html +39 -17
- package/extension/popup.js +133 -37
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/args.d.ts +59 -0
- package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/args.js +141 -0
- package/node_modules/@buddi/cli/dist/args.js.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.d.ts +2 -0
- package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.js +71 -1
- package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
- package/node_modules/@buddi/cli/dist/connections-cmd.d.ts +93 -0
- package/node_modules/@buddi/cli/dist/connections-cmd.d.ts.map +1 -0
- package/node_modules/@buddi/cli/dist/connections-cmd.js +657 -0
- package/node_modules/@buddi/cli/dist/connections-cmd.js.map +1 -0
- package/node_modules/@buddi/cli/dist/doctor-probes.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor-probes.js +82 -17
- package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.d.ts +9 -9
- package/node_modules/@buddi/cli/dist/doctor.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.js +20 -17
- package/node_modules/@buddi/cli/dist/doctor.js.map +1 -1
- package/node_modules/@buddi/cli/dist/init-plan.d.ts +1 -2
- package/node_modules/@buddi/cli/dist/init-plan.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/init-plan.js +2 -6
- package/node_modules/@buddi/cli/dist/init-plan.js.map +1 -1
- package/node_modules/@buddi/cli/dist/init.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/init.js +5 -29
- package/node_modules/@buddi/cli/dist/init.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 -1
- package/node_modules/@buddi/cli/dist/main.js.map +1 -1
- package/node_modules/@buddi/cli/dist/mcp/gateway-client.d.ts +5 -0
- package/node_modules/@buddi/cli/dist/mcp/gateway-client.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/mcp/gateway-client.js +15 -4
- package/node_modules/@buddi/cli/dist/mcp/gateway-client.js.map +1 -1
- package/node_modules/@buddi/cli/dist/service/index.d.ts +4 -2
- package/node_modules/@buddi/cli/dist/service/index.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/service/index.js +5 -7
- package/node_modules/@buddi/cli/dist/service/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js +11 -2
- package/node_modules/@buddi/core/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/core/dist/agents/provider-from-env.d.ts +7 -6
- package/node_modules/@buddi/core/dist/agents/provider-from-env.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/provider-from-env.js +9 -12
- package/node_modules/@buddi/core/dist/agents/provider-from-env.js.map +1 -1
- package/node_modules/@buddi/core/dist/agents/skills.d.ts +4 -4
- package/node_modules/@buddi/core/dist/backup/load.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/backup/load.js +37 -0
- package/node_modules/@buddi/core/dist/backup/load.js.map +1 -1
- package/node_modules/@buddi/core/dist/backup/restore.js +2 -2
- package/node_modules/@buddi/core/dist/backup/restore.js.map +1 -1
- package/node_modules/@buddi/core/dist/connection-config.d.ts +96 -0
- package/node_modules/@buddi/core/dist/connection-config.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/connection-config.js +308 -0
- package/node_modules/@buddi/core/dist/connection-config.js.map +1 -0
- package/node_modules/@buddi/core/dist/failures/owner-message.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/failures/owner-message.js +37 -10
- package/node_modules/@buddi/core/dist/failures/owner-message.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/agent.d.ts +54 -0
- package/node_modules/@buddi/core/dist/notifications/agent.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/agent.js +134 -0
- package/node_modules/@buddi/core/dist/notifications/agent.js.map +1 -0
- package/node_modules/@buddi/core/dist/notifications/index.d.ts +1 -0
- package/node_modules/@buddi/core/dist/notifications/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/index.js +1 -0
- package/node_modules/@buddi/core/dist/notifications/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/notify.d.ts +4 -0
- package/node_modules/@buddi/core/dist/notifications/notify.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/notify.js +19 -7
- package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/store.d.ts +8 -1
- package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/store.js +55 -6
- package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/types.d.ts +26 -2
- package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/notifications/types.js +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 +17 -1
- package/node_modules/@buddi/core/dist/onboarding/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/onboarding/types.d.ts +14 -0
- package/node_modules/@buddi/core/dist/onboarding/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts +21 -1
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/provider-accounts.js +31 -1
- package/node_modules/@buddi/core/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/core/dist/provider.d.ts +4 -3
- package/node_modules/@buddi/core/dist/provider.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/provider.js +7 -4
- package/node_modules/@buddi/core/dist/provider.js.map +1 -1
- package/node_modules/@buddi/core/dist/testing/accounts.d.ts +12 -0
- package/node_modules/@buddi/core/dist/testing/accounts.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/testing/accounts.js +7 -0
- package/node_modules/@buddi/core/dist/testing/accounts.js.map +1 -0
- package/node_modules/@buddi/core/dist/testing/index.d.ts +1 -0
- package/node_modules/@buddi/core/dist/testing/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/testing/index.js +1 -0
- package/node_modules/@buddi/core/dist/testing/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/vault/resolve.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/vault/resolve.js +0 -3
- package/node_modules/@buddi/core/dist/vault/resolve.js.map +1 -1
- package/node_modules/@buddi/core/migrations/053_drop_legacy_anthropic_env.sql +31 -0
- package/node_modules/@buddi/core/migrations/054_agent_messages.sql +15 -0
- package/node_modules/@buddi/core/package.json +4 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts +34 -1
- package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/owner-tools.js +87 -4
- package/node_modules/@buddi/gateway/dist/agents/owner-tools.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.js +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/bootstrap.d.ts +1 -3
- package/node_modules/@buddi/gateway/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/bootstrap.js +16 -11
- package/node_modules/@buddi/gateway/dist/bootstrap.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/cli.js +1 -1
- package/node_modules/@buddi/gateway/dist/mlxh.d.ts +44 -0
- package/node_modules/@buddi/gateway/dist/mlxh.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/mlxh.js +98 -0
- package/node_modules/@buddi/gateway/dist/mlxh.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts +98 -9
- package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-secrets.js +237 -15
- package/node_modules/@buddi/gateway/dist/owner-secrets.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.d.ts +4 -0
- package/node_modules/@buddi/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.js +3 -0
- package/node_modules/@buddi/gateway/dist/plugins/stage.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/update.d.ts +8 -0
- package/node_modules/@buddi/gateway/dist/plugins/update.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/update.js +8 -2
- package/node_modules/@buddi/gateway/dist/plugins/update.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts +6 -13
- package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.js +76 -16
- package/node_modules/@buddi/gateway/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/providers.d.ts +3 -3
- package/node_modules/@buddi/gateway/dist/providers.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/providers.js +7 -7
- package/node_modules/@buddi/gateway/dist/providers.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +26 -8
- package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/context-budget.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/context-budget.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/context-budget.js +46 -3
- package/node_modules/@buddi/gateway/dist/surfaces/context-budget.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/pending-question.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/pending-question.js +2 -1
- package/node_modules/@buddi/gateway/dist/surfaces/pending-question.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.js +5 -1
- package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts +7 -0
- package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/channel.js +14 -2
- package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/agents.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/agents.js +5 -1
- package/node_modules/@buddi/gateway/dist/web/agents.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/connections.d.ts +18 -5
- package/node_modules/@buddi/gateway/dist/web/connections.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/connections.js +118 -8
- package/node_modules/@buddi/gateway/dist/web/connections.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.js +5 -1
- package/node_modules/@buddi/gateway/dist/web/extension.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/market.d.ts +18 -0
- package/node_modules/@buddi/gateway/dist/web/market.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/market.js +20 -14
- package/node_modules/@buddi/gateway/dist/web/market.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/notifications.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/web/notifications.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/notifications.js +14 -1
- package/node_modules/@buddi/gateway/dist/web/notifications.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts +21 -7
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js +64 -11
- package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.d.ts +5 -0
- package/node_modules/@buddi/gateway/dist/web/plugins.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.js +11 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/recovery.d.ts +10 -0
- package/node_modules/@buddi/gateway/dist/web/recovery.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/recovery.js +114 -34
- package/node_modules/@buddi/gateway/dist/web/recovery.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 +84 -8
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/sessions.d.ts +8 -0
- package/node_modules/@buddi/gateway/dist/web/sessions.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/sessions.js +24 -1
- package/node_modules/@buddi/gateway/dist/web/sessions.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/static.d.ts +8 -0
- package/node_modules/@buddi/gateway/dist/web/static.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/static.js +21 -1
- package/node_modules/@buddi/gateway/dist/web/static.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/take-on.d.ts +91 -0
- package/node_modules/@buddi/gateway/dist/web/take-on.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/take-on.js +287 -0
- package/node_modules/@buddi/gateway/dist/web/take-on.js.map +1 -0
- package/node_modules/@buddi/gateway/src/agents/starter/keeper/agent.md +2 -2
- package/node_modules/@buddi/gateway/src/agents/starter/planner/agent.md +1 -1
- package/node_modules/@buddi/gateway/src/agents/starter/scout/agent.md +1 -1
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts +7 -0
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.js +29 -3
- package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/delegate.js +1 -1
- package/node_modules/@buddi/runtime/dist/delegate.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/provider-models.d.ts +2 -0
- package/node_modules/@buddi/runtime/dist/provider-models.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/provider-models.js +22 -0
- package/node_modules/@buddi/runtime/dist/provider-models.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/search.js +2 -2
- 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-email/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-email/dist/config.d.ts +13 -9
- package/node_modules/@buddi/tool-email/dist/config.d.ts.map +1 -1
- package/node_modules/@buddi/tool-email/dist/config.js +33 -40
- package/node_modules/@buddi/tool-email/dist/config.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/index.d.ts +1 -1
- package/node_modules/@buddi/tool-email/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-email/dist/index.js +1 -1
- package/node_modules/@buddi/tool-email/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/pages/accounts.d.ts +1 -2
- package/node_modules/@buddi/tool-email/dist/pages/accounts.d.ts.map +1 -1
- package/node_modules/@buddi/tool-email/dist/pages/accounts.js +42 -18
- package/node_modules/@buddi/tool-email/dist/pages/accounts.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts.map +1 -1
- package/node_modules/@buddi/tool-email/dist/pages/queries.js +7 -5
- package/node_modules/@buddi/tool-email/dist/pages/queries.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/ports.d.ts +5 -1
- package/node_modules/@buddi/tool-email/dist/ports.d.ts.map +1 -1
- package/node_modules/@buddi/tool-email/dist/tools/shared.js +1 -1
- package/node_modules/@buddi/tool-email/dist/tools/shared.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-mcp/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-mcp/dist/catalog.d.ts +32 -2
- package/node_modules/@buddi/tool-mcp/dist/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/catalog.js +41 -7
- package/node_modules/@buddi/tool-mcp/dist/catalog.js.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/device.d.ts +53 -0
- package/node_modules/@buddi/tool-mcp/dist/device.d.ts.map +1 -0
- package/node_modules/@buddi/tool-mcp/dist/device.js +100 -0
- package/node_modules/@buddi/tool-mcp/dist/device.js.map +1 -0
- package/node_modules/@buddi/tool-mcp/dist/fetch.d.ts +10 -1
- package/node_modules/@buddi/tool-mcp/dist/fetch.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/fetch.js +7 -1
- package/node_modules/@buddi/tool-mcp/dist/fetch.js.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/index.d.ts +5 -3
- package/node_modules/@buddi/tool-mcp/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/index.js +7 -4
- package/node_modules/@buddi/tool-mcp/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/ports.d.ts +31 -0
- package/node_modules/@buddi/tool-mcp/dist/ports.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/preview.d.ts +16 -0
- package/node_modules/@buddi/tool-mcp/dist/preview.d.ts.map +1 -0
- package/node_modules/@buddi/tool-mcp/dist/preview.js +52 -0
- package/node_modules/@buddi/tool-mcp/dist/preview.js.map +1 -0
- package/node_modules/@buddi/tool-mcp/dist/program.d.ts +73 -0
- package/node_modules/@buddi/tool-mcp/dist/program.d.ts.map +1 -0
- package/node_modules/@buddi/tool-mcp/dist/program.js +306 -0
- package/node_modules/@buddi/tool-mcp/dist/program.js.map +1 -0
- package/node_modules/@buddi/tool-mcp/dist/service.d.ts +131 -22
- package/node_modules/@buddi/tool-mcp/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/service.js +717 -29
- package/node_modules/@buddi/tool-mcp/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/session.d.ts +13 -1
- package/node_modules/@buddi/tool-mcp/dist/session.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/session.js +27 -4
- package/node_modules/@buddi/tool-mcp/dist/session.js.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/store.d.ts +39 -1
- package/node_modules/@buddi/tool-mcp/dist/store.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/store.js +24 -0
- package/node_modules/@buddi/tool-mcp/dist/store.js.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/testing/fake.d.ts +6 -0
- package/node_modules/@buddi/tool-mcp/dist/testing/fake.d.ts.map +1 -1
- package/node_modules/@buddi/tool-mcp/dist/testing/fake.js +26 -0
- package/node_modules/@buddi/tool-mcp/dist/testing/fake.js.map +1 -1
- package/node_modules/@buddi/tool-mcp/migrations/003_token_auth.sql +14 -0
- package/node_modules/@buddi/tool-mcp/migrations/004_programs.sql +26 -0
- package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-web/dist/providers/index.d.ts +1 -2
- package/node_modules/@buddi/tool-web/dist/providers/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-web/dist/providers/index.js +1 -2
- package/node_modules/@buddi/tool-web/dist/providers/index.js.map +1 -1
- package/node_modules/hono/dist/cjs/jsx/utils.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/combine/index.js +3 -1
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -2
- package/node_modules/hono/dist/jsx/utils.js +1 -1
- package/node_modules/hono/dist/middleware/combine/index.js +3 -1
- package/node_modules/hono/dist/middleware/etag/index.js +2 -2
- package/node_modules/hono/dist/middleware/language/language.js +1 -1
- package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +2 -1
- package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +2 -1
- package/node_modules/hono/dist/types/client/types.d.ts +2 -1
- package/node_modules/hono/dist/types/context.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/cookie/index.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/css/common.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/css/index.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/dev/index.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/factory/index.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/proxy/index.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +2 -1
- package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
- package/node_modules/hono/dist/types/hono-base.d.ts +2 -1
- package/node_modules/hono/dist/types/http-exception.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/base.d.ts +4 -3
- package/node_modules/hono/dist/types/jsx/context.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/dom/client.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/dom/index.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/dom/render.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/dom/server.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/index.d.ts +2 -1
- package/node_modules/hono/dist/types/jsx/types.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/combine/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/compress/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/etag/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/language/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/logger/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/timing/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +2 -1
- package/node_modules/hono/dist/types/request.d.ts +2 -1
- package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +2 -1
- package/node_modules/hono/dist/types/types.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/body.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/buffer.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/cookie.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/crypto.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/filepath.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/html.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/mime.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/types.d.ts +2 -1
- package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
- package/node_modules/hono/dist/types/validator/utils.d.ts +2 -1
- package/node_modules/hono/dist/types/validator/validator.d.ts +2 -1
- package/node_modules/hono/package.json +2 -2
- package/node_modules/pg/lib/client.js +18 -0
- package/node_modules/pg/lib/connection.js +8 -1
- package/node_modules/pg/lib/crypto/cert-signatures.js +1 -1
- package/node_modules/pg/lib/native/client.js +11 -3
- package/node_modules/pg/lib/native/query.js +3 -1
- package/node_modules/pg/lib/query.js +5 -1
- package/node_modules/pg/lib/utils.js +19 -1
- package/node_modules/pg/package.json +5 -5
- package/node_modules/pg-connection-string/index.js +1 -1
- package/node_modules/pg-connection-string/package.json +2 -3
- package/node_modules/pg-protocol/dist/buffer-writer.d.ts +5 -1
- package/node_modules/pg-protocol/dist/buffer-writer.js +10 -1
- package/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -1
- package/node_modules/pg-protocol/dist/serializer.js +20 -18
- package/node_modules/pg-protocol/dist/serializer.js.map +1 -1
- package/node_modules/pg-protocol/package.json +2 -2
- package/node_modules/pg-protocol/src/buffer-writer.ts +12 -2
- package/node_modules/pg-protocol/src/serializer.ts +26 -20
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/args.d.ts +59 -0
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +141 -0
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands.d.ts +2 -0
- package/packages/cli/dist/commands.d.ts.map +1 -1
- package/packages/cli/dist/commands.js +71 -1
- package/packages/cli/dist/commands.js.map +1 -1
- package/packages/cli/dist/connections-cmd.d.ts +93 -0
- package/packages/cli/dist/connections-cmd.d.ts.map +1 -0
- package/packages/cli/dist/connections-cmd.js +657 -0
- package/packages/cli/dist/connections-cmd.js.map +1 -0
- package/packages/cli/dist/doctor-probes.d.ts.map +1 -1
- package/packages/cli/dist/doctor-probes.js +82 -17
- package/packages/cli/dist/doctor-probes.js.map +1 -1
- package/packages/cli/dist/doctor.d.ts +9 -9
- package/packages/cli/dist/doctor.d.ts.map +1 -1
- package/packages/cli/dist/doctor.js +20 -17
- package/packages/cli/dist/doctor.js.map +1 -1
- package/packages/cli/dist/init-plan.d.ts +1 -2
- package/packages/cli/dist/init-plan.d.ts.map +1 -1
- package/packages/cli/dist/init-plan.js +2 -6
- package/packages/cli/dist/init-plan.js.map +1 -1
- package/packages/cli/dist/init.d.ts.map +1 -1
- package/packages/cli/dist/init.js +5 -29
- package/packages/cli/dist/init.js.map +1 -1
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +10 -1
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/mcp/gateway-client.d.ts +5 -0
- package/packages/cli/dist/mcp/gateway-client.d.ts.map +1 -1
- package/packages/cli/dist/mcp/gateway-client.js +15 -4
- package/packages/cli/dist/mcp/gateway-client.js.map +1 -1
- package/packages/cli/dist/service/index.d.ts +4 -2
- package/packages/cli/dist/service/index.d.ts.map +1 -1
- package/packages/cli/dist/service/index.js +5 -7
- package/packages/cli/dist/service/index.js.map +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/agents/catalog.d.ts.map +1 -1
- package/packages/core/dist/agents/catalog.js +11 -2
- package/packages/core/dist/agents/catalog.js.map +1 -1
- package/packages/core/dist/agents/provider-from-env.d.ts +7 -6
- package/packages/core/dist/agents/provider-from-env.d.ts.map +1 -1
- package/packages/core/dist/agents/provider-from-env.js +9 -12
- package/packages/core/dist/agents/provider-from-env.js.map +1 -1
- package/packages/core/dist/agents/skills.d.ts +4 -4
- package/packages/core/dist/backup/load.d.ts.map +1 -1
- package/packages/core/dist/backup/load.js +37 -0
- package/packages/core/dist/backup/load.js.map +1 -1
- package/packages/core/dist/backup/restore.js +2 -2
- package/packages/core/dist/backup/restore.js.map +1 -1
- package/packages/core/dist/connection-config.d.ts +96 -0
- package/packages/core/dist/connection-config.d.ts.map +1 -0
- package/packages/core/dist/connection-config.js +308 -0
- package/packages/core/dist/connection-config.js.map +1 -0
- package/packages/core/dist/failures/owner-message.d.ts.map +1 -1
- package/packages/core/dist/failures/owner-message.js +37 -10
- package/packages/core/dist/failures/owner-message.js.map +1 -1
- package/packages/core/dist/notifications/agent.d.ts +54 -0
- package/packages/core/dist/notifications/agent.d.ts.map +1 -0
- package/packages/core/dist/notifications/agent.js +134 -0
- package/packages/core/dist/notifications/agent.js.map +1 -0
- package/packages/core/dist/notifications/index.d.ts +1 -0
- package/packages/core/dist/notifications/index.d.ts.map +1 -1
- package/packages/core/dist/notifications/index.js +1 -0
- package/packages/core/dist/notifications/index.js.map +1 -1
- package/packages/core/dist/notifications/notify.d.ts +4 -0
- package/packages/core/dist/notifications/notify.d.ts.map +1 -1
- package/packages/core/dist/notifications/notify.js +19 -7
- package/packages/core/dist/notifications/notify.js.map +1 -1
- package/packages/core/dist/notifications/store.d.ts +8 -1
- package/packages/core/dist/notifications/store.d.ts.map +1 -1
- package/packages/core/dist/notifications/store.js +55 -6
- package/packages/core/dist/notifications/store.js.map +1 -1
- package/packages/core/dist/notifications/types.d.ts +26 -2
- package/packages/core/dist/notifications/types.d.ts.map +1 -1
- package/packages/core/dist/notifications/types.js +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 +17 -1
- package/packages/core/dist/onboarding/store.js.map +1 -1
- package/packages/core/dist/onboarding/types.d.ts +14 -0
- package/packages/core/dist/onboarding/types.d.ts.map +1 -1
- package/packages/core/dist/provider-accounts.d.ts +21 -1
- package/packages/core/dist/provider-accounts.d.ts.map +1 -1
- package/packages/core/dist/provider-accounts.js +31 -1
- package/packages/core/dist/provider-accounts.js.map +1 -1
- package/packages/core/dist/provider.d.ts +4 -3
- package/packages/core/dist/provider.d.ts.map +1 -1
- package/packages/core/dist/provider.js +7 -4
- package/packages/core/dist/provider.js.map +1 -1
- package/packages/core/dist/testing/accounts.d.ts +12 -0
- package/packages/core/dist/testing/accounts.d.ts.map +1 -0
- package/packages/core/dist/testing/accounts.js +7 -0
- package/packages/core/dist/testing/accounts.js.map +1 -0
- package/packages/core/dist/testing/index.d.ts +1 -0
- package/packages/core/dist/testing/index.d.ts.map +1 -1
- package/packages/core/dist/testing/index.js +1 -0
- package/packages/core/dist/testing/index.js.map +1 -1
- package/packages/core/dist/vault/resolve.d.ts.map +1 -1
- package/packages/core/dist/vault/resolve.js +0 -3
- package/packages/core/dist/vault/resolve.js.map +1 -1
- package/packages/core/migrations/053_drop_legacy_anthropic_env.sql +31 -0
- package/packages/core/migrations/054_agent_messages.sql +15 -0
- package/packages/core/package.json +4 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents/owner-tools.d.ts +34 -1
- package/packages/gateway/dist/agents/owner-tools.d.ts.map +1 -1
- package/packages/gateway/dist/agents/owner-tools.js +87 -4
- package/packages/gateway/dist/agents/owner-tools.js.map +1 -1
- package/packages/gateway/dist/agents-cli.js +1 -1
- package/packages/gateway/dist/agents-cli.js.map +1 -1
- package/packages/gateway/dist/bootstrap.d.ts +1 -3
- package/packages/gateway/dist/bootstrap.d.ts.map +1 -1
- package/packages/gateway/dist/bootstrap.js +16 -11
- package/packages/gateway/dist/bootstrap.js.map +1 -1
- package/packages/gateway/dist/cli.js +1 -1
- package/packages/gateway/dist/mlxh.d.ts +44 -0
- package/packages/gateway/dist/mlxh.d.ts.map +1 -0
- package/packages/gateway/dist/mlxh.js +98 -0
- package/packages/gateway/dist/mlxh.js.map +1 -0
- package/packages/gateway/dist/owner-secrets.d.ts +98 -9
- package/packages/gateway/dist/owner-secrets.d.ts.map +1 -1
- package/packages/gateway/dist/owner-secrets.js +237 -15
- package/packages/gateway/dist/owner-secrets.js.map +1 -1
- package/packages/gateway/dist/plugins/stage.d.ts +4 -0
- package/packages/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/stage.js +3 -0
- package/packages/gateway/dist/plugins/stage.js.map +1 -1
- package/packages/gateway/dist/plugins/update.d.ts +8 -0
- package/packages/gateway/dist/plugins/update.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/update.js +8 -2
- package/packages/gateway/dist/plugins/update.js.map +1 -1
- package/packages/gateway/dist/provider-accounts.d.ts +6 -13
- package/packages/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/packages/gateway/dist/provider-accounts.js +76 -16
- package/packages/gateway/dist/provider-accounts.js.map +1 -1
- package/packages/gateway/dist/providers.d.ts +3 -3
- package/packages/gateway/dist/providers.d.ts.map +1 -1
- package/packages/gateway/dist/providers.js +7 -7
- package/packages/gateway/dist/providers.js.map +1 -1
- package/packages/gateway/dist/serve.d.ts.map +1 -1
- package/packages/gateway/dist/serve.js +26 -8
- package/packages/gateway/dist/serve.js.map +1 -1
- package/packages/gateway/dist/surfaces/context-budget.d.ts +1 -1
- package/packages/gateway/dist/surfaces/context-budget.d.ts.map +1 -1
- package/packages/gateway/dist/surfaces/context-budget.js +46 -3
- package/packages/gateway/dist/surfaces/context-budget.js.map +1 -1
- package/packages/gateway/dist/surfaces/pending-question.d.ts.map +1 -1
- package/packages/gateway/dist/surfaces/pending-question.js +2 -1
- package/packages/gateway/dist/surfaces/pending-question.js.map +1 -1
- package/packages/gateway/dist/system-context.d.ts +2 -0
- package/packages/gateway/dist/system-context.d.ts.map +1 -1
- package/packages/gateway/dist/system-context.js +5 -1
- package/packages/gateway/dist/system-context.js.map +1 -1
- package/packages/gateway/dist/telegram/channel.d.ts +7 -0
- package/packages/gateway/dist/telegram/channel.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/channel.js +14 -2
- package/packages/gateway/dist/telegram/channel.js.map +1 -1
- package/packages/gateway/dist/web/agents.d.ts.map +1 -1
- package/packages/gateway/dist/web/agents.js +5 -1
- package/packages/gateway/dist/web/agents.js.map +1 -1
- package/packages/gateway/dist/web/connections.d.ts +18 -5
- package/packages/gateway/dist/web/connections.d.ts.map +1 -1
- package/packages/gateway/dist/web/connections.js +118 -8
- package/packages/gateway/dist/web/connections.js.map +1 -1
- package/packages/gateway/dist/web/extension.d.ts +6 -0
- package/packages/gateway/dist/web/extension.d.ts.map +1 -1
- package/packages/gateway/dist/web/extension.js +5 -1
- package/packages/gateway/dist/web/extension.js.map +1 -1
- package/packages/gateway/dist/web/market.d.ts +18 -0
- package/packages/gateway/dist/web/market.d.ts.map +1 -1
- package/packages/gateway/dist/web/market.js +20 -14
- package/packages/gateway/dist/web/market.js.map +1 -1
- package/packages/gateway/dist/web/notifications.d.ts +6 -0
- package/packages/gateway/dist/web/notifications.d.ts.map +1 -1
- package/packages/gateway/dist/web/notifications.js +14 -1
- package/packages/gateway/dist/web/notifications.js.map +1 -1
- package/packages/gateway/dist/web/onboarding.d.ts +21 -7
- package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/packages/gateway/dist/web/onboarding.js +64 -11
- package/packages/gateway/dist/web/onboarding.js.map +1 -1
- package/packages/gateway/dist/web/plugins.d.ts +5 -0
- package/packages/gateway/dist/web/plugins.d.ts.map +1 -1
- package/packages/gateway/dist/web/plugins.js +11 -1
- package/packages/gateway/dist/web/plugins.js.map +1 -1
- package/packages/gateway/dist/web/recovery.d.ts +10 -0
- package/packages/gateway/dist/web/recovery.d.ts.map +1 -1
- package/packages/gateway/dist/web/recovery.js +114 -34
- package/packages/gateway/dist/web/recovery.js.map +1 -1
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +84 -8
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/sessions.d.ts +8 -0
- package/packages/gateway/dist/web/sessions.d.ts.map +1 -1
- package/packages/gateway/dist/web/sessions.js +24 -1
- package/packages/gateway/dist/web/sessions.js.map +1 -1
- package/packages/gateway/dist/web/static.d.ts +8 -0
- package/packages/gateway/dist/web/static.d.ts.map +1 -1
- package/packages/gateway/dist/web/static.js +21 -1
- package/packages/gateway/dist/web/static.js.map +1 -1
- package/packages/gateway/dist/web/take-on.d.ts +91 -0
- package/packages/gateway/dist/web/take-on.d.ts.map +1 -0
- package/packages/gateway/dist/web/take-on.js +287 -0
- package/packages/gateway/dist/web/take-on.js.map +1 -0
- package/packages/gateway/src/agents/starter/keeper/agent.md +2 -2
- package/packages/gateway/src/agents/starter/planner/agent.md +1 -1
- package/packages/gateway/src/agents/starter/scout/agent.md +1 -1
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/anthropic.d.ts +7 -0
- package/packages/runtime/dist/anthropic.d.ts.map +1 -1
- package/packages/runtime/dist/anthropic.js +29 -3
- package/packages/runtime/dist/anthropic.js.map +1 -1
- package/packages/runtime/dist/delegate.js +1 -1
- package/packages/runtime/dist/delegate.js.map +1 -1
- package/packages/runtime/dist/provider-models.d.ts +2 -0
- package/packages/runtime/dist/provider-models.d.ts.map +1 -1
- package/packages/runtime/dist/provider-models.js +22 -0
- package/packages/runtime/dist/provider-models.js.map +1 -1
- package/packages/runtime/dist/search.js +2 -2
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/email/dist/.tsbuildinfo +1 -1
- package/packages/tools/email/dist/config.d.ts +13 -9
- package/packages/tools/email/dist/config.d.ts.map +1 -1
- package/packages/tools/email/dist/config.js +33 -40
- package/packages/tools/email/dist/config.js.map +1 -1
- package/packages/tools/email/dist/index.d.ts +1 -1
- package/packages/tools/email/dist/index.d.ts.map +1 -1
- package/packages/tools/email/dist/index.js +1 -1
- package/packages/tools/email/dist/index.js.map +1 -1
- package/packages/tools/email/dist/pages/accounts.d.ts +1 -2
- package/packages/tools/email/dist/pages/accounts.d.ts.map +1 -1
- package/packages/tools/email/dist/pages/accounts.js +42 -18
- package/packages/tools/email/dist/pages/accounts.js.map +1 -1
- package/packages/tools/email/dist/pages/queries.d.ts.map +1 -1
- package/packages/tools/email/dist/pages/queries.js +7 -5
- package/packages/tools/email/dist/pages/queries.js.map +1 -1
- package/packages/tools/email/dist/ports.d.ts +5 -1
- package/packages/tools/email/dist/ports.d.ts.map +1 -1
- package/packages/tools/email/dist/tools/shared.js +1 -1
- package/packages/tools/email/dist/tools/shared.js.map +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/mcp/dist/.tsbuildinfo +1 -1
- package/packages/tools/mcp/dist/catalog.d.ts +32 -2
- package/packages/tools/mcp/dist/catalog.d.ts.map +1 -1
- package/packages/tools/mcp/dist/catalog.js +41 -7
- package/packages/tools/mcp/dist/catalog.js.map +1 -1
- package/packages/tools/mcp/dist/device.d.ts +53 -0
- package/packages/tools/mcp/dist/device.d.ts.map +1 -0
- package/packages/tools/mcp/dist/device.js +100 -0
- package/packages/tools/mcp/dist/device.js.map +1 -0
- package/packages/tools/mcp/dist/fetch.d.ts +10 -1
- package/packages/tools/mcp/dist/fetch.d.ts.map +1 -1
- package/packages/tools/mcp/dist/fetch.js +7 -1
- package/packages/tools/mcp/dist/fetch.js.map +1 -1
- package/packages/tools/mcp/dist/index.d.ts +5 -3
- package/packages/tools/mcp/dist/index.d.ts.map +1 -1
- package/packages/tools/mcp/dist/index.js +7 -4
- package/packages/tools/mcp/dist/index.js.map +1 -1
- package/packages/tools/mcp/dist/ports.d.ts +31 -0
- package/packages/tools/mcp/dist/ports.d.ts.map +1 -1
- package/packages/tools/mcp/dist/preview.d.ts +16 -0
- package/packages/tools/mcp/dist/preview.d.ts.map +1 -0
- package/packages/tools/mcp/dist/preview.js +52 -0
- package/packages/tools/mcp/dist/preview.js.map +1 -0
- package/packages/tools/mcp/dist/program.d.ts +73 -0
- package/packages/tools/mcp/dist/program.d.ts.map +1 -0
- package/packages/tools/mcp/dist/program.js +306 -0
- package/packages/tools/mcp/dist/program.js.map +1 -0
- package/packages/tools/mcp/dist/service.d.ts +131 -22
- package/packages/tools/mcp/dist/service.d.ts.map +1 -1
- package/packages/tools/mcp/dist/service.js +717 -29
- package/packages/tools/mcp/dist/service.js.map +1 -1
- package/packages/tools/mcp/dist/session.d.ts +13 -1
- package/packages/tools/mcp/dist/session.d.ts.map +1 -1
- package/packages/tools/mcp/dist/session.js +27 -4
- package/packages/tools/mcp/dist/session.js.map +1 -1
- package/packages/tools/mcp/dist/store.d.ts +39 -1
- package/packages/tools/mcp/dist/store.d.ts.map +1 -1
- package/packages/tools/mcp/dist/store.js +24 -0
- package/packages/tools/mcp/dist/store.js.map +1 -1
- package/packages/tools/mcp/dist/testing/fake.d.ts +6 -0
- package/packages/tools/mcp/dist/testing/fake.d.ts.map +1 -1
- package/packages/tools/mcp/dist/testing/fake.js +26 -0
- package/packages/tools/mcp/dist/testing/fake.js.map +1 -1
- package/packages/tools/mcp/migrations/003_token_auth.sql +14 -0
- package/packages/tools/mcp/migrations/004_programs.sql +26 -0
- package/packages/tools/memory/dist/.tsbuildinfo +1 -1
- package/packages/tools/web/dist/.tsbuildinfo +1 -1
- package/packages/tools/web/dist/providers/index.d.ts +1 -2
- package/packages/tools/web/dist/providers/index.d.ts.map +1 -1
- package/packages/tools/web/dist/providers/index.js +1 -2
- package/packages/tools/web/dist/providers/index.js.map +1 -1
- package/packages/web/dist/assets/index-BxbiKNMS.css +1 -0
- package/packages/web/dist/assets/index-Rrze3bGo.js +130 -0
- package/packages/web/dist/assets/{lottie_light-D7STH9tF.js → lottie_light-7wQnGwdw.js} +1 -1
- package/packages/web/dist/build.json +1 -1
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/manifest.webmanifest +24 -5
- package/packages/web/dist/precache.json +4 -4
- package/packages/web/dist/sw.js +5 -3
- package/packages/web/dist/assets/index-C-NAQ_MT.css +0 -1
- package/packages/web/dist/assets/index-DzFS39N3.js +0 -125
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `buddi connections`: Settings → Connections from the terminal
|
|
3
|
+
* (docs/connections.md, "From the terminal").
|
|
4
|
+
*
|
|
5
|
+
* The connections service and the tools it registers live in the running
|
|
6
|
+
* gateway, so every subcommand goes through it: the dashboard's own routes
|
|
7
|
+
* (`/api/connections…`), reached as the owner the way `buddi mcp` reaches them
|
|
8
|
+
* (`mcp/gateway-client.ts`: a loopback session, or a five-minute ticket off
|
|
9
|
+
* loopback), with the same CSRF pair and origin the page sends. Nothing here
|
|
10
|
+
* writes a store of its own, and nothing here prints or logs a token.
|
|
11
|
+
*
|
|
12
|
+
* `add` walks the dashboard's four screens in order: address, sign-in,
|
|
13
|
+
* review, give. A sign-in on the service's own page is a consent the gateway
|
|
14
|
+
* mints for the CLI (`cli: true`): the owner opens the link in any browser,
|
|
15
|
+
* the service sends them to the dashboard's `/connections/callback`, and this
|
|
16
|
+
* command polls the connection until it is signed in, ten minutes at most.
|
|
17
|
+
* A card that recommends the device way (GitHub) prints a code and the
|
|
18
|
+
* address to type it at; the gateway waits for the approval and this command
|
|
19
|
+
* polls the connection until its `device` says done or why not.
|
|
20
|
+
*
|
|
21
|
+
* `add <name> -- <command> <args…>` is a program on this computer: the line
|
|
22
|
+
* is printed in full, each `--secret` is asked for with the echo off (or read
|
|
23
|
+
* from stdin, one line each, when there is no terminal), and the review is
|
|
24
|
+
* the first time it runs, only to list its tools.
|
|
25
|
+
*/
|
|
26
|
+
import { spawn } from 'node:child_process';
|
|
27
|
+
import { createInterface } from 'node:readline';
|
|
28
|
+
import { looksSecret, parsePastedServer } from '@buddi/core/connection-config';
|
|
29
|
+
import { GatewayError, GatewayUnavailable, NOT_RUNNING } from './mcp/gateway-client.js';
|
|
30
|
+
import { confirmTty, promptHidden } from './vault-cmd.js';
|
|
31
|
+
/** A sign-in on the service's own page waits this long, like the dashboard. */
|
|
32
|
+
export const CONSENT_WAIT_MS = 10 * 60_000;
|
|
33
|
+
export const OPEN_IN_BROWSER = 'Open it in your browser; the page sends you back to your dashboard and this command carries on.';
|
|
34
|
+
function defaultIo() {
|
|
35
|
+
return {
|
|
36
|
+
out: (line) => console.log(line),
|
|
37
|
+
err: (line) => console.error(line),
|
|
38
|
+
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
39
|
+
confirm: confirmTty,
|
|
40
|
+
ask: async (question) => {
|
|
41
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
42
|
+
try {
|
|
43
|
+
return await new Promise((resolve) => rl.question(question, resolve));
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
rl.close();
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
secret: promptHidden,
|
|
50
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
51
|
+
now: () => Date.now(),
|
|
52
|
+
enter: (question) => {
|
|
53
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
54
|
+
let settle = () => { };
|
|
55
|
+
const pressed = new Promise((resolve) => { settle = resolve; });
|
|
56
|
+
rl.question(question, () => { settle(true); rl.close(); });
|
|
57
|
+
rl.on('close', () => settle(false));
|
|
58
|
+
return { pressed, cancel: () => rl.close() };
|
|
59
|
+
},
|
|
60
|
+
openUrl: openInBrowser,
|
|
61
|
+
readStdin: async () => {
|
|
62
|
+
const chunks = [];
|
|
63
|
+
for await (const chunk of process.stdin)
|
|
64
|
+
chunks.push(Buffer.from(chunk));
|
|
65
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** `open` on macOS, `xdg-open` on Linux; elsewhere nothing, and the printed address is the answer. */
|
|
70
|
+
export function openInBrowser(url, platform = process.platform) {
|
|
71
|
+
const opener = platform === 'darwin' ? 'open' : platform === 'linux' ? 'xdg-open' : undefined;
|
|
72
|
+
if (!opener)
|
|
73
|
+
return;
|
|
74
|
+
try {
|
|
75
|
+
const child = spawn(opener, [url], { stdio: 'ignore', detached: true });
|
|
76
|
+
child.on('error', () => { });
|
|
77
|
+
child.unref();
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// The owner opens it.
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** A stop with a sentence and an exit code; the sentence is already said. */
|
|
84
|
+
class Stop extends Error {
|
|
85
|
+
code;
|
|
86
|
+
constructor(code) {
|
|
87
|
+
super('stop');
|
|
88
|
+
this.code = code;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export async function runConnections(command, deps) {
|
|
92
|
+
const io = { ...defaultIo(), ...deps.io };
|
|
93
|
+
if ('off' in deps.gateway) {
|
|
94
|
+
io.err(deps.gateway.off);
|
|
95
|
+
return 3;
|
|
96
|
+
}
|
|
97
|
+
const run = new Run(deps.gateway, io, deps.json, deps.pollMs ?? 2_000);
|
|
98
|
+
try {
|
|
99
|
+
switch (command.action) {
|
|
100
|
+
case 'list': return await run.list();
|
|
101
|
+
case 'add': return await run.add(command);
|
|
102
|
+
case 'review': return await run.review(command.name, { keep: command.keep, ...(command.slug ? { slug: command.slug } : {}) });
|
|
103
|
+
case 'give': return await run.give(command.name, command.to);
|
|
104
|
+
case 'remove': return await run.remove(command.name, command.yes);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
if (err instanceof Stop)
|
|
109
|
+
return err.code;
|
|
110
|
+
if (err instanceof GatewayUnavailable) {
|
|
111
|
+
io.err(NOT_RUNNING);
|
|
112
|
+
return 3;
|
|
113
|
+
}
|
|
114
|
+
if (err instanceof GatewayError) {
|
|
115
|
+
io.err(err.message);
|
|
116
|
+
return err.status === 503 ? 3 : 1;
|
|
117
|
+
}
|
|
118
|
+
throw err;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** The tier as the review screen says it. */
|
|
122
|
+
export function tierWords(tool) {
|
|
123
|
+
if (tool.tier === 'auto')
|
|
124
|
+
return 'runs on its own';
|
|
125
|
+
return tool.destructive ? 'asks every time' : 'asks you first';
|
|
126
|
+
}
|
|
127
|
+
const STATE_WORDS = {
|
|
128
|
+
connected: 'connected',
|
|
129
|
+
'pending-review': 'waiting for your review',
|
|
130
|
+
'needs-review': 'changed its tools; review them',
|
|
131
|
+
'needs-reconnect': 'needs you to sign in again',
|
|
132
|
+
unreachable: 'unreachable, retrying',
|
|
133
|
+
};
|
|
134
|
+
const plural = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
|
|
135
|
+
/** One word as a shell needs it written. */
|
|
136
|
+
function quoteWord(word) {
|
|
137
|
+
if (word !== '' && /^[A-Za-z0-9_@%+=:,./-]+$/.test(word))
|
|
138
|
+
return word;
|
|
139
|
+
return `'${word.replace(/'/g, `'\\''`)}'`;
|
|
140
|
+
}
|
|
141
|
+
class Run {
|
|
142
|
+
gateway;
|
|
143
|
+
io;
|
|
144
|
+
json;
|
|
145
|
+
pollMs;
|
|
146
|
+
constructor(gateway, io, json, pollMs) {
|
|
147
|
+
this.gateway = gateway;
|
|
148
|
+
this.io = io;
|
|
149
|
+
this.json = json;
|
|
150
|
+
this.pollMs = pollMs;
|
|
151
|
+
}
|
|
152
|
+
#listing() {
|
|
153
|
+
return this.gateway.get('/api/connections');
|
|
154
|
+
}
|
|
155
|
+
/** A connection by its name in buddi (slug), its display name, or its id. */
|
|
156
|
+
async #find(name) {
|
|
157
|
+
const listing = await this.#listing();
|
|
158
|
+
const wanted = name.trim().toLowerCase();
|
|
159
|
+
const bySlug = listing.connections.find((c) => c.slug === wanted);
|
|
160
|
+
if (bySlug)
|
|
161
|
+
return { view: bySlug, listing };
|
|
162
|
+
const byId = listing.connections.find((c) => c.id === wanted);
|
|
163
|
+
if (byId)
|
|
164
|
+
return { view: byId, listing };
|
|
165
|
+
const byName = listing.connections.filter((c) => c.name.toLowerCase() === wanted);
|
|
166
|
+
if (byName.length === 1)
|
|
167
|
+
return { view: byName[0], listing };
|
|
168
|
+
if (byName.length > 1) {
|
|
169
|
+
this.io.err(`${byName.length} connections are called ${name}. Name one by its id: ${byName.map((c) => c.id).join(', ')}.`);
|
|
170
|
+
throw new Stop(1);
|
|
171
|
+
}
|
|
172
|
+
const known = listing.connections.map((c) => c.slug ?? c.name);
|
|
173
|
+
this.io.err(`There is no connection called ${name}.${known.length ? ` There is ${known.join(', ')}.` : ' Add one with buddi connections add.'}`);
|
|
174
|
+
throw new Stop(1);
|
|
175
|
+
}
|
|
176
|
+
#agentNames(listing, ids) {
|
|
177
|
+
return ids.map((id) => listing.agents.find((a) => a.id === id)?.name ?? id).join(', ');
|
|
178
|
+
}
|
|
179
|
+
/* ---------------------------------------------------------------- list */
|
|
180
|
+
async list() {
|
|
181
|
+
const listing = await this.#listing();
|
|
182
|
+
if (this.json) {
|
|
183
|
+
this.io.out(JSON.stringify(listing.connections.map((c) => ({
|
|
184
|
+
id: c.id, name: c.name, slug: c.slug, state: c.state, host: c.host, url: c.url,
|
|
185
|
+
signedIn: c.signedIn, tools: c.toolCount, heldTools: c.heldTools, agents: c.agents,
|
|
186
|
+
})), null, 2));
|
|
187
|
+
return 0;
|
|
188
|
+
}
|
|
189
|
+
if (listing.connections.length === 0) {
|
|
190
|
+
this.io.out('No connections yet.');
|
|
191
|
+
this.io.out(`Add one with buddi connections add <card|https://…>. The cards: ${listing.catalog.map((c) => c.id).join(', ')}.`);
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
for (const c of listing.connections) {
|
|
195
|
+
const who = c.slug ?? c.name;
|
|
196
|
+
const tools = c.slug ? plural(c.toolCount, 'tool') : 'not reviewed';
|
|
197
|
+
const agents = c.agents.length > 0 ? `given to ${this.#agentNames(listing, c.agents)}` : 'given to nobody';
|
|
198
|
+
const held = c.heldTools > 0 ? `, ${c.heldTools} waiting for review` : '';
|
|
199
|
+
const state = c.state === 'unreachable' && c.unreachableSince ? `unreachable since ${c.unreachableSince}, retrying`
|
|
200
|
+
: c.state === 'pending-review' && !c.signedIn ? 'waiting for a sign-in' : STATE_WORDS[c.state];
|
|
201
|
+
this.io.out(`${who} ${c.name} (${c.host}) ${state} ${tools}${held} ${agents}`);
|
|
202
|
+
}
|
|
203
|
+
return 0;
|
|
204
|
+
}
|
|
205
|
+
/* ----------------------------------------------------------------- add */
|
|
206
|
+
async add(cmd) {
|
|
207
|
+
if (cmd.program) {
|
|
208
|
+
const vars = cmd.program.env.map((e) => ({ name: e.name, value: e.value, secret: false }));
|
|
209
|
+
const asked = await this.#askSecrets(cmd.program.secrets);
|
|
210
|
+
if (asked === null)
|
|
211
|
+
return 1;
|
|
212
|
+
vars.push(...asked);
|
|
213
|
+
return this.#addProgram(cmd, cmd.address, cmd.program.command, cmd.program.args, vars);
|
|
214
|
+
}
|
|
215
|
+
// 1. Address. A pasted block is read before anything is asked of buddi.
|
|
216
|
+
let config;
|
|
217
|
+
if (cmd.config !== undefined) {
|
|
218
|
+
let read;
|
|
219
|
+
try {
|
|
220
|
+
read = parsePastedServer(cmd.config);
|
|
221
|
+
}
|
|
222
|
+
catch (err) {
|
|
223
|
+
this.io.err(err instanceof Error ? err.message : String(err));
|
|
224
|
+
return 2;
|
|
225
|
+
}
|
|
226
|
+
if (read.kind === 'program') {
|
|
227
|
+
const p = read.program;
|
|
228
|
+
// A value on the line is taken as given; a placeholder is asked for.
|
|
229
|
+
const blanks = p.env.filter((e) => e.value === '').map((e) => e.name);
|
|
230
|
+
const asked = await this.#askSecrets(blanks);
|
|
231
|
+
if (asked === null)
|
|
232
|
+
return 1;
|
|
233
|
+
const vars = [
|
|
234
|
+
...p.env.filter((e) => e.value !== '').map((e) => ({ name: e.name, value: e.value, secret: e.secret })),
|
|
235
|
+
...asked,
|
|
236
|
+
];
|
|
237
|
+
const name = cmd.name ?? p.name;
|
|
238
|
+
if (!name) {
|
|
239
|
+
this.io.err('Give the program a name with --name.');
|
|
240
|
+
return 2;
|
|
241
|
+
}
|
|
242
|
+
return this.#addProgram(cmd, name, p.command, p.args, vars);
|
|
243
|
+
}
|
|
244
|
+
config = read.config;
|
|
245
|
+
for (const dropped of config.dropped)
|
|
246
|
+
this.io.out(`buddi sends one header; ${dropped} is left out.`);
|
|
247
|
+
}
|
|
248
|
+
const listing = await this.#listing();
|
|
249
|
+
let card;
|
|
250
|
+
let url;
|
|
251
|
+
if (config)
|
|
252
|
+
url = config.url;
|
|
253
|
+
else {
|
|
254
|
+
const address = cmd.address.trim();
|
|
255
|
+
if (/^https?:\/\//i.test(address))
|
|
256
|
+
url = address;
|
|
257
|
+
else {
|
|
258
|
+
card = listing.catalog.find((c) => c.id === address.toLowerCase());
|
|
259
|
+
if (!card) {
|
|
260
|
+
this.io.err(`There is no card called ${address}. The cards: ${listing.catalog.map((c) => c.id).join(', ')}; or give an https:// address.`);
|
|
261
|
+
return 2;
|
|
262
|
+
}
|
|
263
|
+
url = card.url;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
card ??= listing.catalog.find((c) => c.url === url);
|
|
267
|
+
const name = cmd.name ?? config?.name ?? card?.name;
|
|
268
|
+
const added = (await this.gateway.post('/api/connections', { url, ...(name ? { name } : {}) })).body;
|
|
269
|
+
let view = added.connection;
|
|
270
|
+
this.io.out(`Opened ${view.host}: ${view.name}.`);
|
|
271
|
+
const waits = () => this.io.out(`${view.name} waits under Settings → Connections; buddi connections remove "${view.name}" takes it away.`);
|
|
272
|
+
// 2. Sign in.
|
|
273
|
+
try {
|
|
274
|
+
if (added.signIn === 'none')
|
|
275
|
+
this.io.out(`${view.name} wants no sign-in.`);
|
|
276
|
+
else
|
|
277
|
+
view = await this.#signIn(view, added.signIn, cmd, card, config);
|
|
278
|
+
}
|
|
279
|
+
catch (err) {
|
|
280
|
+
if (err instanceof Stop || err instanceof GatewayError) {
|
|
281
|
+
if (err instanceof GatewayError)
|
|
282
|
+
this.io.err(err.message);
|
|
283
|
+
waits();
|
|
284
|
+
throw new Stop(1);
|
|
285
|
+
}
|
|
286
|
+
throw err;
|
|
287
|
+
}
|
|
288
|
+
// 3. Review.
|
|
289
|
+
const reviewed = await this.#review(view, { keep: cmd.keep, ...(cmd.slug ? { slug: cmd.slug } : {}) });
|
|
290
|
+
if (!reviewed)
|
|
291
|
+
return 0;
|
|
292
|
+
// 4. Give.
|
|
293
|
+
return this.#give(reviewed, cmd.to, listing);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Each named secret with the echo off, or from stdin one line each when
|
|
297
|
+
* there is no terminal. Null, said, when one is missing.
|
|
298
|
+
*/
|
|
299
|
+
async #askSecrets(names) {
|
|
300
|
+
if (names.length === 0)
|
|
301
|
+
return [];
|
|
302
|
+
let values;
|
|
303
|
+
if (this.io.interactive) {
|
|
304
|
+
values = [];
|
|
305
|
+
for (const name of names)
|
|
306
|
+
values.push((await this.io.secret(`${name} (not shown): `)).trim());
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
values = (await this.io.readStdin()).split(/\r?\n/).map((line) => line.trim());
|
|
310
|
+
}
|
|
311
|
+
const out = [];
|
|
312
|
+
for (const [i, name] of names.entries()) {
|
|
313
|
+
const value = values[i] ?? '';
|
|
314
|
+
if (value === '') {
|
|
315
|
+
this.io.err(this.io.interactive
|
|
316
|
+
? `No value was given for ${name}, so nothing was added.`
|
|
317
|
+
: `No value for ${name} on stdin (one line per --secret, in order), so nothing was added.`);
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
out.push({ name, value, secret: true });
|
|
321
|
+
}
|
|
322
|
+
return out;
|
|
323
|
+
}
|
|
324
|
+
/** A program on this computer: recorded, reviewed (its first run), given. */
|
|
325
|
+
async #addProgram(cmd, name, command, args, vars) {
|
|
326
|
+
const line = [command, ...args].map(quoteWord).join(' ');
|
|
327
|
+
this.io.out(`${cmd.name ?? name} runs on this computer as you:`);
|
|
328
|
+
this.io.out(` ${line}`);
|
|
329
|
+
for (const v of vars)
|
|
330
|
+
this.io.out(` ${v.name}=${v.secret ? '(secret, kept in the vault)' : v.value}`);
|
|
331
|
+
const plainSecrets = vars.filter((v) => !v.secret && looksSecret(v.name)).map((v) => v.name);
|
|
332
|
+
if (plainSecrets.length > 0)
|
|
333
|
+
this.io.out(`${plainSecrets.join(', ')} ${plainSecrets.length === 1 ? 'looks' : 'look'} like a secret; --secret keeps one in the vault instead.`);
|
|
334
|
+
const added = (await this.gateway.post('/api/connections', {
|
|
335
|
+
transport: 'stdio', name: cmd.name ?? name, command, args, env: vars,
|
|
336
|
+
})).body;
|
|
337
|
+
const view = added.connection;
|
|
338
|
+
this.io.out(`Starting ${view.name} to read its tools. The first start can take a minute or two while it downloads.`);
|
|
339
|
+
let reviewed;
|
|
340
|
+
try {
|
|
341
|
+
reviewed = await this.#review(view, { keep: cmd.keep, ...(cmd.slug ? { slug: cmd.slug } : {}) });
|
|
342
|
+
}
|
|
343
|
+
catch (err) {
|
|
344
|
+
if (err instanceof GatewayError) {
|
|
345
|
+
this.io.err(err.message);
|
|
346
|
+
const fresh = await this.gateway.get(`/api/connections/${view.id}`).catch(() => undefined);
|
|
347
|
+
if (fresh?.stderr?.length) {
|
|
348
|
+
this.io.err('Its last lines:');
|
|
349
|
+
for (const l of fresh.stderr)
|
|
350
|
+
this.io.err(` ${l}`);
|
|
351
|
+
}
|
|
352
|
+
this.io.out(`${view.name} waits under Settings → Connections; buddi connections remove "${view.name}" takes it away.`);
|
|
353
|
+
return 1;
|
|
354
|
+
}
|
|
355
|
+
throw err;
|
|
356
|
+
}
|
|
357
|
+
if (!reviewed)
|
|
358
|
+
return 0;
|
|
359
|
+
const listing = await this.#listing();
|
|
360
|
+
return this.#give(reviewed, cmd.to, listing);
|
|
361
|
+
}
|
|
362
|
+
async #signIn(view, signIn, cmd, card, config) {
|
|
363
|
+
const header = config?.header;
|
|
364
|
+
const forced = cmd.token || cmd.tokenStdin || header !== undefined;
|
|
365
|
+
if (!forced && !cmd.clientId && card?.auth?.recommended === 'device' && card.auth.device) {
|
|
366
|
+
return this.#device(view, card);
|
|
367
|
+
}
|
|
368
|
+
const wantsToken = forced || (!cmd.clientId && card?.auth?.recommended === 'token');
|
|
369
|
+
if (wantsToken)
|
|
370
|
+
return this.#token(view, cmd, card, header);
|
|
371
|
+
if (signIn === 'manual' && !cmd.clientId) {
|
|
372
|
+
this.io.err(`${view.name} does not let buddi register itself. Run again with --client-id <id> (an app you create in its developer settings, with the redirect address ${this.gateway.baseUrl}/connections/callback), or with --token.`);
|
|
373
|
+
throw new Stop(1);
|
|
374
|
+
}
|
|
375
|
+
return this.#consent(view, cmd.clientId);
|
|
376
|
+
}
|
|
377
|
+
async #token(view, cmd, card, header) {
|
|
378
|
+
let token = header?.value ?? '';
|
|
379
|
+
if (token === '') {
|
|
380
|
+
if (card?.auth?.recommended === 'token' && !cmd.token && !cmd.tokenStdin) {
|
|
381
|
+
this.io.out(`${card.name} recommends a token.${card.auth.tokenPage ? ` Make one at ${card.auth.tokenPage}` : ''}`);
|
|
382
|
+
if (card.auth.tokenHint)
|
|
383
|
+
this.io.out(card.auth.tokenHint);
|
|
384
|
+
}
|
|
385
|
+
if (!cmd.tokenStdin && !this.io.interactive) {
|
|
386
|
+
this.io.err('There is no terminal to type the token in. Pipe it with --token-stdin.');
|
|
387
|
+
throw new Stop(1);
|
|
388
|
+
}
|
|
389
|
+
token = (await this.io.secret(`Token for ${view.name} (not shown): `)).trim();
|
|
390
|
+
if (token === '') {
|
|
391
|
+
this.io.err('No token was given, so nothing was signed in.');
|
|
392
|
+
throw new Stop(1);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
const done = await this.gateway.post(`/api/connections/${view.id}/token`, {
|
|
396
|
+
token,
|
|
397
|
+
...(header ? { header: header.name, prefix: header.prefix } : {}),
|
|
398
|
+
});
|
|
399
|
+
this.io.out(`${view.name} accepted the token; buddi keeps it as one of your secrets.`);
|
|
400
|
+
return done.body.connection;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* A code typed on the service's site: the gateway asks for it and waits for
|
|
404
|
+
* the approval; this prints it with the address, opens the address on
|
|
405
|
+
* Enter, and polls the connection until its `device` says done or why not.
|
|
406
|
+
*/
|
|
407
|
+
async #device(view, card) {
|
|
408
|
+
let started;
|
|
409
|
+
try {
|
|
410
|
+
started = (await this.gateway.post(`/api/connections/${view.id}/device`, {})).body;
|
|
411
|
+
}
|
|
412
|
+
catch (err) {
|
|
413
|
+
if (err instanceof GatewayError) {
|
|
414
|
+
this.io.err(`${err.message} Run again with --token to sign in with a token instead.`);
|
|
415
|
+
throw new Stop(1);
|
|
416
|
+
}
|
|
417
|
+
throw err;
|
|
418
|
+
}
|
|
419
|
+
this.io.out(`Sign in to ${card.name} with this code:`);
|
|
420
|
+
this.io.out('');
|
|
421
|
+
this.io.out(` ${started.userCode}`);
|
|
422
|
+
this.io.out('');
|
|
423
|
+
this.io.out(`Type it at ${started.verificationUri} and say yes there.`);
|
|
424
|
+
const enter = this.io.interactive ? this.io.enter('Press Enter to open it in your browser, or open it yourself. ') : undefined;
|
|
425
|
+
void enter?.pressed.then((pressed) => { if (pressed)
|
|
426
|
+
this.io.openUrl(started.verificationUri); });
|
|
427
|
+
try {
|
|
428
|
+
const until = Math.max(Date.parse(started.expiresAt) || 0, this.io.now()) + 30_000;
|
|
429
|
+
while (this.io.now() < until) {
|
|
430
|
+
await this.io.sleep(this.pollMs);
|
|
431
|
+
const fresh = await this.gateway.get(`/api/connections/${view.id}`).catch((err) => {
|
|
432
|
+
if (err instanceof GatewayUnavailable)
|
|
433
|
+
throw err;
|
|
434
|
+
return undefined;
|
|
435
|
+
});
|
|
436
|
+
if (fresh?.device?.state === 'done') {
|
|
437
|
+
if (enter)
|
|
438
|
+
this.io.out('');
|
|
439
|
+
this.io.out(`Signed in to ${fresh.name}.`);
|
|
440
|
+
return fresh;
|
|
441
|
+
}
|
|
442
|
+
if (fresh?.device?.state === 'failed') {
|
|
443
|
+
if (enter)
|
|
444
|
+
this.io.out('');
|
|
445
|
+
this.io.err(fresh.device.reason ?? 'The sign-in did not finish. Start it again.');
|
|
446
|
+
throw new Stop(1);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
this.io.err('The code expired before it was approved. Start it again.');
|
|
450
|
+
throw new Stop(1);
|
|
451
|
+
}
|
|
452
|
+
finally {
|
|
453
|
+
enter?.cancel();
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
async #consent(view, clientId) {
|
|
457
|
+
let started;
|
|
458
|
+
try {
|
|
459
|
+
started = (await this.gateway.post(`/api/connections/${view.id}/consent`, { cli: true, ...(clientId ? { clientId } : {}) })).body;
|
|
460
|
+
}
|
|
461
|
+
catch (err) {
|
|
462
|
+
if (err instanceof GatewayError && err.body?.code === 'client-id') {
|
|
463
|
+
this.io.err(`${err.message} Run again with --client-id <id> or --token. The redirect address is ${this.gateway.baseUrl}/connections/callback.`);
|
|
464
|
+
throw new Stop(1);
|
|
465
|
+
}
|
|
466
|
+
throw err;
|
|
467
|
+
}
|
|
468
|
+
if (clientId)
|
|
469
|
+
this.io.out(`The app's redirect address must be ${started.redirectUri}.`);
|
|
470
|
+
this.io.out(`Sign in to ${view.name} here:`);
|
|
471
|
+
this.io.out(` ${started.authorizeUrl}`);
|
|
472
|
+
this.io.out(OPEN_IN_BROWSER);
|
|
473
|
+
const until = this.io.now() + CONSENT_WAIT_MS;
|
|
474
|
+
while (this.io.now() < until) {
|
|
475
|
+
await this.io.sleep(this.pollMs);
|
|
476
|
+
const fresh = await this.gateway.get(`/api/connections/${view.id}`).catch((err) => {
|
|
477
|
+
if (err instanceof GatewayUnavailable)
|
|
478
|
+
throw err;
|
|
479
|
+
return undefined;
|
|
480
|
+
});
|
|
481
|
+
if (fresh?.signedIn && fresh.authKind === 'oauth') {
|
|
482
|
+
this.io.out(`Signed in to ${fresh.name}.`);
|
|
483
|
+
return fresh;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
this.io.err('The sign-in did not come back within ten minutes. Start it again.');
|
|
487
|
+
throw new Stop(1);
|
|
488
|
+
}
|
|
489
|
+
/* -------------------------------------------------------------- review */
|
|
490
|
+
#printReview(review, slug) {
|
|
491
|
+
const name = review.connection.name;
|
|
492
|
+
if (review.program) {
|
|
493
|
+
this.io.out(`${name} runs on this computer as you: ${review.program.line}`);
|
|
494
|
+
this.io.out(`It brings ${plural(review.tools.length, 'tool')}. buddi starts it when an agent needs one and stops it after ten quiet minutes.`);
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
this.io.out(`${name} brings ${plural(review.tools.length, 'tool')}. buddi talks to ${review.host} for them, and nowhere else.`);
|
|
498
|
+
}
|
|
499
|
+
if (review.annotatedNothing)
|
|
500
|
+
this.io.out(`${name} says nothing about what its tools do, so every one of them asks you first.`);
|
|
501
|
+
const changes = review.changes;
|
|
502
|
+
if (changes && changes.added.length + changes.changed.length + changes.removed.length > 0) {
|
|
503
|
+
this.io.out(`${name} changed its tools since your last review. Until you keep this list, the new and changed ones wait.`);
|
|
504
|
+
if (changes.removed.length > 0)
|
|
505
|
+
this.io.out(` Gone: ${changes.removed.join(', ')}`);
|
|
506
|
+
}
|
|
507
|
+
const width = Math.max(0, ...review.tools.map((t) => t.fullName.length));
|
|
508
|
+
for (const tool of review.tools) {
|
|
509
|
+
const fullName = review.slugEditable ? tool.fullName.replace(/^mcp\.[^.]+\./, `mcp.${slug}.`) : tool.fullName;
|
|
510
|
+
const mark = tool.change === 'added' ? ' (new)' : tool.change === 'changed' ? ' (changed)' : '';
|
|
511
|
+
const extra = Math.max(0, fullName.length - tool.fullName.length);
|
|
512
|
+
this.io.out(` ${fullName.padEnd(width + extra)} ${tierWords(tool)}${mark}`);
|
|
513
|
+
const description = tool.description.replace(/\s+/g, ' ').trim();
|
|
514
|
+
if (description)
|
|
515
|
+
this.io.out(` ${description.length > 160 ? `${description.slice(0, 157)}…` : description}`);
|
|
516
|
+
if (tool.problem)
|
|
517
|
+
this.io.out(` Not usable: ${tool.problem}`);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
/** Read the review, print it, and keep it when the owner says so. The kept view, or null. */
|
|
521
|
+
async #review(view, opts) {
|
|
522
|
+
const review = await this.gateway.get(`/api/connections/${view.id}/review`);
|
|
523
|
+
const slug = review.slugEditable ? (opts.slug?.trim().toLowerCase() || review.slug) : review.slug;
|
|
524
|
+
if (opts.slug && !review.slugEditable && opts.slug.trim().toLowerCase() !== review.slug) {
|
|
525
|
+
this.io.out(`${view.name} is already called ${review.slug}; only the first review names it.`);
|
|
526
|
+
}
|
|
527
|
+
if (this.json)
|
|
528
|
+
this.io.out(JSON.stringify({ ...review, slug }, null, 2));
|
|
529
|
+
else
|
|
530
|
+
this.#printReview(review, slug);
|
|
531
|
+
let keep = opts.keep;
|
|
532
|
+
if (!keep && !this.json && this.io.interactive)
|
|
533
|
+
keep = await this.io.confirm(`Keep these tools as mcp.${slug}.*?`);
|
|
534
|
+
if (!keep) {
|
|
535
|
+
if (!this.json)
|
|
536
|
+
this.io.out(`Nothing was kept. Run buddi connections review ${review.slugEditable ? `"${view.name}"` : slug} --keep when you have read them.`);
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
try {
|
|
540
|
+
const kept = (await this.gateway.post(`/api/connections/${view.id}/review`, {
|
|
541
|
+
hash: review.hash, ...(review.slugEditable ? { slug } : {}),
|
|
542
|
+
})).body;
|
|
543
|
+
if (!this.json)
|
|
544
|
+
this.io.out(`Kept. ${kept.name}'s tools are called mcp.${kept.slug}.<tool>.`);
|
|
545
|
+
return kept;
|
|
546
|
+
}
|
|
547
|
+
catch (err) {
|
|
548
|
+
if (err instanceof GatewayError) {
|
|
549
|
+
this.io.err(err.message);
|
|
550
|
+
throw new Stop(1);
|
|
551
|
+
}
|
|
552
|
+
throw err;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
async review(name, opts) {
|
|
556
|
+
const { view } = await this.#find(name);
|
|
557
|
+
await this.#review(view, opts);
|
|
558
|
+
return 0;
|
|
559
|
+
}
|
|
560
|
+
/* ---------------------------------------------------------------- give */
|
|
561
|
+
/** Agent ids, handles or names to ids; a sentence and a stop for one it does not know. */
|
|
562
|
+
#agentIds(listing, words) {
|
|
563
|
+
const ids = [];
|
|
564
|
+
const unknown = [];
|
|
565
|
+
for (const word of words) {
|
|
566
|
+
const w = word.toLowerCase().replace(/^@/, '');
|
|
567
|
+
const hit = listing.agents.find((a) => a.id === w || a.handle.toLowerCase().replace(/^@/, '') === w || a.name.toLowerCase() === w);
|
|
568
|
+
if (hit) {
|
|
569
|
+
if (!ids.includes(hit.id))
|
|
570
|
+
ids.push(hit.id);
|
|
571
|
+
}
|
|
572
|
+
else
|
|
573
|
+
unknown.push(word);
|
|
574
|
+
}
|
|
575
|
+
if (unknown.length > 0) {
|
|
576
|
+
this.io.err(`No such agent: ${unknown.join(', ')}. The agents: ${listing.agents.map((a) => a.handle || a.id).join(', ')}.`);
|
|
577
|
+
throw new Stop(2);
|
|
578
|
+
}
|
|
579
|
+
return ids;
|
|
580
|
+
}
|
|
581
|
+
async #give(view, to, listing) {
|
|
582
|
+
const grant = `mcp.${view.slug}.*`;
|
|
583
|
+
let ids;
|
|
584
|
+
if (to !== undefined)
|
|
585
|
+
ids = this.#agentIds(listing, to);
|
|
586
|
+
else if (!this.io.interactive) {
|
|
587
|
+
this.io.out(`It waits for an agent: buddi connections give ${view.slug} --to <agent>.`);
|
|
588
|
+
return 0;
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
if (listing.agents.length === 0) {
|
|
592
|
+
this.io.out('There is no agent to give it to yet.');
|
|
593
|
+
return 0;
|
|
594
|
+
}
|
|
595
|
+
this.io.out(`Give ${grant} to which agents?`);
|
|
596
|
+
listing.agents.forEach((a, i) => this.io.out(` ${i + 1}. ${a.name}${a.handle ? ` (${a.handle})` : ''}${a.frontDesk ? ', your front desk' : ''}`));
|
|
597
|
+
const front = listing.agents.findIndex((a) => a.frontDesk);
|
|
598
|
+
const fallback = front >= 0 ? String(front + 1) : '';
|
|
599
|
+
const answer = (await this.io.ask(`Numbers or handles, comma-separated; nobody to keep it waiting${fallback ? ` [${fallback}]` : ''}: `)).trim() || fallback;
|
|
600
|
+
if (answer === '' || answer.toLowerCase() === 'nobody')
|
|
601
|
+
ids = [];
|
|
602
|
+
else {
|
|
603
|
+
const words = answer.split(',').map((w) => w.trim()).filter(Boolean).map((w) => {
|
|
604
|
+
const n = Number(w);
|
|
605
|
+
return Number.isInteger(n) && n >= 1 && n <= listing.agents.length ? listing.agents[n - 1].id : w;
|
|
606
|
+
});
|
|
607
|
+
ids = this.#agentIds(listing, words);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
if (ids.length === 0) {
|
|
611
|
+
this.io.out(`Given to nobody: ${view.name} waits under Settings → Connections.`);
|
|
612
|
+
return 0;
|
|
613
|
+
}
|
|
614
|
+
return this.#grant(view, ids, listing);
|
|
615
|
+
}
|
|
616
|
+
async #grant(view, ids, listing) {
|
|
617
|
+
const { body } = await this.gateway.post(`/api/connections/${view.id}/grant`, { agents: ids });
|
|
618
|
+
if (body.granted.length > 0)
|
|
619
|
+
this.io.out(`Gave mcp.${view.slug}.* to ${this.#agentNames(listing, body.granted)}.`);
|
|
620
|
+
for (const f of body.failed)
|
|
621
|
+
this.io.err(`${this.#agentNames(listing, [f.agent])}: ${f.message}`);
|
|
622
|
+
return body.failed.length > 0 ? 1 : 0;
|
|
623
|
+
}
|
|
624
|
+
async give(name, to) {
|
|
625
|
+
const { view, listing } = await this.#find(name);
|
|
626
|
+
if (!view.slug || view.state === 'pending-review') {
|
|
627
|
+
this.io.err(`Review ${view.name}'s tools before giving them to an agent: buddi connections review "${view.name}".`);
|
|
628
|
+
return 1;
|
|
629
|
+
}
|
|
630
|
+
const ids = this.#agentIds(listing, to);
|
|
631
|
+
if (ids.length === 0) {
|
|
632
|
+
this.io.out('Given to nobody; nothing changed.');
|
|
633
|
+
return 0;
|
|
634
|
+
}
|
|
635
|
+
return this.#grant(view, ids, listing);
|
|
636
|
+
}
|
|
637
|
+
/* -------------------------------------------------------------- remove */
|
|
638
|
+
async remove(name, yes) {
|
|
639
|
+
const { view, listing } = await this.#find(name);
|
|
640
|
+
const who = view.agents.length > 0 ? ` ${this.#agentNames(listing, view.agents)} lose its tools.` : '';
|
|
641
|
+
if (!yes) {
|
|
642
|
+
if (!this.io.interactive) {
|
|
643
|
+
this.io.err(`Run it again with --yes to disconnect ${view.name}.`);
|
|
644
|
+
return 1;
|
|
645
|
+
}
|
|
646
|
+
if (!(await this.io.confirm(`Disconnect ${view.name}? Its sign-in is deleted.${who}`))) {
|
|
647
|
+
this.io.out('Nothing was disconnected.');
|
|
648
|
+
return 0;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const { body } = await this.gateway.delete(`/api/connections/${view.id}`);
|
|
652
|
+
const touched = body.touched.length > 0 ? ` Its tools were taken from ${this.#agentNames(listing, body.touched)}.` : '';
|
|
653
|
+
this.io.out(`Disconnected ${body.name ?? view.name}; its sign-in is deleted.${touched}`);
|
|
654
|
+
return 0;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
//# sourceMappingURL=connections-cmd.js.map
|