@withbuddi/buddi 0.1.0-pre.23 → 0.1.0-pre.25
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 +66 -50
- 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 +83 -3
- 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 +53 -9
- package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.d.ts +1 -8
- package/node_modules/@buddi/cli/dist/doctor.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/doctor.js +1 -15
- 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 +12 -2
- 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/plugins-toggle.d.ts +9 -0
- package/node_modules/@buddi/cli/dist/plugins-toggle.d.ts.map +1 -0
- package/node_modules/@buddi/cli/dist/plugins-toggle.js +20 -0
- package/node_modules/@buddi/cli/dist/plugins-toggle.js.map +1 -0
- 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/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/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/host/build.d.ts +7 -0
- package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.js +14 -1
- package/node_modules/@buddi/core/dist/host/build.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/registry.d.ts +9 -0
- package/node_modules/@buddi/core/dist/registry.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/registry.js +32 -2
- package/node_modules/@buddi/core/dist/registry.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/destinations.d.ts +2 -0
- package/node_modules/@buddi/core/dist/secrets/destinations.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/destinations.js +6 -0
- package/node_modules/@buddi/core/dist/secrets/destinations.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 -2
- 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/package.json +4 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.d.ts +3 -2
- package/node_modules/@buddi/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.js +3 -2
- package/node_modules/@buddi/gateway/dist/agents/catalog.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 +13 -8
- 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/index.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.js.map +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 +21 -1
- package/node_modules/@buddi/gateway/dist/owner-secrets.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-secrets.js +96 -2
- package/node_modules/@buddi/gateway/dist/owner-secrets.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/live.d.ts +42 -0
- package/node_modules/@buddi/gateway/dist/plugins/live.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/plugins/live.js +81 -0
- package/node_modules/@buddi/gateway/dist/plugins/live.js.map +1 -0
- 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/toggle.d.ts +18 -2
- package/node_modules/@buddi/gateway/dist/plugins/toggle.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/toggle.js +36 -12
- package/node_modules/@buddi/gateway/dist/plugins/toggle.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/plugins-cli.d.ts +44 -5
- package/node_modules/@buddi/gateway/dist/plugins-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins-cli.js +177 -20
- package/node_modules/@buddi/gateway/dist/plugins-cli.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 +2 -0
- 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/tips/rules.d.ts +2 -0
- 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/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 +15 -5
- package/node_modules/@buddi/gateway/dist/web/connections.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/connections.js +70 -2
- 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/folders.d.ts +23 -0
- package/node_modules/@buddi/gateway/dist/web/folders.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/folders.js +100 -0
- package/node_modules/@buddi/gateway/dist/web/folders.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/market.d.ts +129 -0
- package/node_modules/@buddi/gateway/dist/web/market.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/market.js +353 -0
- package/node_modules/@buddi/gateway/dist/web/market.js.map +1 -0
- 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 +59 -9
- package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.d.ts +42 -7
- package/node_modules/@buddi/gateway/dist/web/plugins.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.js +54 -14
- package/node_modules/@buddi/gateway/dist/web/plugins.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/recovery.js +1 -1
- 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 +100 -3
- package/node_modules/@buddi/gateway/dist/web/server.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/svg.d.ts +23 -0
- package/node_modules/@buddi/gateway/dist/web/svg.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/svg.js +125 -0
- package/node_modules/@buddi/gateway/dist/web/svg.js.map +1 -0
- 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/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/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-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/@hono/node-server/README.md +21 -10
- package/node_modules/@hono/node-server/dist/early-hints.cjs +1 -1
- package/node_modules/@hono/node-server/dist/early-hints.mjs +1 -1
- package/node_modules/@hono/node-server/dist/index.cjs +41 -19
- package/node_modules/@hono/node-server/dist/index.mjs +42 -20
- package/node_modules/@hono/node-server/dist/serve-static.cjs +1 -0
- package/node_modules/@hono/node-server/dist/serve-static.d.cts +2 -1
- package/node_modules/@hono/node-server/dist/serve-static.d.mts +2 -1
- package/node_modules/@hono/node-server/dist/serve-static.mjs +1 -0
- package/node_modules/@hono/node-server/package.json +3 -2
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/language/language.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +1 -0
- package/node_modules/hono/dist/middleware/language/language.js +1 -1
- package/node_modules/hono/dist/middleware/serve-static/index.js +1 -0
- package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +2 -0
- package/node_modules/hono/package.json +1 -1
- 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 +83 -3
- 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 +53 -9
- package/packages/cli/dist/doctor-probes.js.map +1 -1
- package/packages/cli/dist/doctor.d.ts +1 -8
- package/packages/cli/dist/doctor.d.ts.map +1 -1
- package/packages/cli/dist/doctor.js +1 -15
- 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 +12 -2
- 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/plugins-toggle.d.ts +9 -0
- package/packages/cli/dist/plugins-toggle.d.ts.map +1 -0
- package/packages/cli/dist/plugins-toggle.js +20 -0
- package/packages/cli/dist/plugins-toggle.js.map +1 -0
- 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/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/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/host/build.d.ts +7 -0
- package/packages/core/dist/host/build.d.ts.map +1 -1
- package/packages/core/dist/host/build.js +14 -1
- package/packages/core/dist/host/build.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/registry.d.ts +9 -0
- package/packages/core/dist/registry.d.ts.map +1 -1
- package/packages/core/dist/registry.js +32 -2
- package/packages/core/dist/registry.js.map +1 -1
- package/packages/core/dist/secrets/destinations.d.ts +2 -0
- package/packages/core/dist/secrets/destinations.d.ts.map +1 -1
- package/packages/core/dist/secrets/destinations.js +6 -0
- package/packages/core/dist/secrets/destinations.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 -2
- 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/package.json +4 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents/catalog.d.ts +3 -2
- package/packages/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalog.js +3 -2
- package/packages/gateway/dist/agents/catalog.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 +13 -8
- package/packages/gateway/dist/bootstrap.js.map +1 -1
- package/packages/gateway/dist/cli.js +1 -1
- package/packages/gateway/dist/index.d.ts +1 -1
- package/packages/gateway/dist/index.d.ts.map +1 -1
- package/packages/gateway/dist/index.js.map +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 +21 -1
- package/packages/gateway/dist/owner-secrets.d.ts.map +1 -1
- package/packages/gateway/dist/owner-secrets.js +96 -2
- package/packages/gateway/dist/owner-secrets.js.map +1 -1
- package/packages/gateway/dist/plugins/live.d.ts +42 -0
- package/packages/gateway/dist/plugins/live.d.ts.map +1 -0
- package/packages/gateway/dist/plugins/live.js +81 -0
- package/packages/gateway/dist/plugins/live.js.map +1 -0
- 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/toggle.d.ts +18 -2
- package/packages/gateway/dist/plugins/toggle.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/toggle.js +36 -12
- package/packages/gateway/dist/plugins/toggle.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/plugins-cli.d.ts +44 -5
- package/packages/gateway/dist/plugins-cli.d.ts.map +1 -1
- package/packages/gateway/dist/plugins-cli.js +177 -20
- package/packages/gateway/dist/plugins-cli.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 +2 -0
- 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/tips/rules.d.ts +2 -0
- 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/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 +15 -5
- package/packages/gateway/dist/web/connections.d.ts.map +1 -1
- package/packages/gateway/dist/web/connections.js +70 -2
- 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/folders.d.ts +23 -0
- package/packages/gateway/dist/web/folders.d.ts.map +1 -0
- package/packages/gateway/dist/web/folders.js +100 -0
- package/packages/gateway/dist/web/folders.js.map +1 -0
- package/packages/gateway/dist/web/market.d.ts +129 -0
- package/packages/gateway/dist/web/market.d.ts.map +1 -0
- package/packages/gateway/dist/web/market.js +353 -0
- package/packages/gateway/dist/web/market.js.map +1 -0
- 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 +59 -9
- package/packages/gateway/dist/web/onboarding.js.map +1 -1
- package/packages/gateway/dist/web/plugins.d.ts +42 -7
- package/packages/gateway/dist/web/plugins.d.ts.map +1 -1
- package/packages/gateway/dist/web/plugins.js +54 -14
- package/packages/gateway/dist/web/plugins.js.map +1 -1
- package/packages/gateway/dist/web/recovery.js +1 -1
- 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 +100 -3
- package/packages/gateway/dist/web/server.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/svg.d.ts +23 -0
- package/packages/gateway/dist/web/svg.d.ts.map +1 -0
- package/packages/gateway/dist/web/svg.js +125 -0
- package/packages/gateway/dist/web/svg.js.map +1 -0
- 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/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/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/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/web/dist/assets/index-DIXokQ4n.css +1 -0
- package/packages/web/dist/assets/index-uqQyuYjR.js +128 -0
- package/packages/web/dist/assets/{lottie_light-e1djomjW.js → lottie_light-j3HICV9o.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/assets/index-4hpqlMjL.css +0 -1
- package/packages/web/dist/assets/index-B8crjABB.js +0 -125
|
@@ -3,16 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The record says `enabled: false`; nothing else about the installation moves.
|
|
5
5
|
* The package stays where it is, its schema and data stay, and agents granted
|
|
6
|
-
* its family keep their files.
|
|
7
|
-
* plugin
|
|
8
|
-
*
|
|
6
|
+
* its family keep their files. In the running gateway it takes effect at once
|
|
7
|
+
* (`live.ts`): the plugin leaves the registry, so its tools leave the agents,
|
|
8
|
+
* its pages leave the rail and Settings, and its sources and sentinels stop;
|
|
9
|
+
* enabling loads it back the way boot does. A process with no registry (the
|
|
10
|
+
* CLI when buddi is not running) only writes the record, which the next start
|
|
11
|
+
* reads, so there is nothing to restart there either.
|
|
9
12
|
*
|
|
10
|
-
* The
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
+
* The missions it suggested are paused with a reason ("paused: finance is
|
|
14
|
+
* disabled"), and enabling resumes exactly those — a mission the owner
|
|
15
|
+
* switched off stays off.
|
|
13
16
|
*/
|
|
14
17
|
import { pausePluginMissions, pluginPausedReason, readPluginsFile, resumePluginMissions, setInstalledPluginEnabled, writePluginsFile, } from '@buddi/core';
|
|
15
18
|
import { adoptedPlugins, loadManifest, recordFile } from './load.js';
|
|
19
|
+
import { loadPluginLive, unloadPluginLive } from './live.js';
|
|
16
20
|
import { InstallRefusal } from './refusals.js';
|
|
17
21
|
/** The mission ids a plugin suggests: from this process's load, or its entry point. */
|
|
18
22
|
async function suggestedMissionIds(name, entry, env) {
|
|
@@ -51,29 +55,49 @@ export async function setPluginEnabled(name, enabled, opts = {}) {
|
|
|
51
55
|
missionsProblem = `its missions were not ${enabled ? 'resumed' : 'paused'}: ${err instanceof Error ? err.message : String(err)}`;
|
|
52
56
|
}
|
|
53
57
|
}
|
|
58
|
+
// The running gateway, now: whenever a registry is here, even when the
|
|
59
|
+
// record already said so, so a second click finishes what a first one left.
|
|
60
|
+
let restartFor;
|
|
61
|
+
let loadProblem;
|
|
62
|
+
if (opts.registry !== undefined) {
|
|
63
|
+
const liveDeps = { registry: opts.registry, env, pool: opts.pool, ...(opts.log ? { log: opts.log } : {}) };
|
|
64
|
+
const live = enabled ? await loadPluginLive(record, liveDeps) : unloadPluginLive(record, liveDeps);
|
|
65
|
+
restartFor = live.restartFor;
|
|
66
|
+
loadProblem = live.problem;
|
|
67
|
+
}
|
|
68
|
+
else if (changed && opts.gatewayRunning !== false) {
|
|
69
|
+
restartFor = enabled
|
|
70
|
+
? 'the running buddi loads its tools, pages and watchers when it restarts'
|
|
71
|
+
: 'its tools, pages and watchers stay on in the running buddi until it restarts';
|
|
72
|
+
}
|
|
54
73
|
return {
|
|
55
74
|
name,
|
|
56
75
|
enabled,
|
|
57
76
|
changed,
|
|
58
77
|
missions,
|
|
59
78
|
...(missionsProblem === undefined ? {} : { missionsProblem }),
|
|
60
|
-
restartNeeded:
|
|
79
|
+
restartNeeded: restartFor !== undefined,
|
|
80
|
+
...(restartFor === undefined ? {} : { restartFor }),
|
|
81
|
+
...(loadProblem === undefined ? {} : { loadProblem }),
|
|
61
82
|
};
|
|
62
83
|
}
|
|
63
|
-
/** What happened, one finished sentence each, for the CLI. */
|
|
84
|
+
/** What happened, one finished sentence each, for the CLI and the card. */
|
|
64
85
|
export function toggleNotes(outcome) {
|
|
65
86
|
const { name, enabled } = outcome;
|
|
66
87
|
const notes = [];
|
|
67
|
-
if (!outcome.changed) {
|
|
88
|
+
if (!outcome.changed && outcome.loadProblem === undefined && !outcome.restartNeeded) {
|
|
68
89
|
notes.push(`${name} is already ${enabled ? 'enabled' : 'disabled'}.`);
|
|
69
90
|
}
|
|
70
91
|
else if (enabled) {
|
|
71
|
-
notes.push(
|
|
92
|
+
notes.push(outcome.loadProblem === undefined ? 'Enabled.' : `Enabled, but it did not load: ${outcome.loadProblem}.`);
|
|
72
93
|
}
|
|
73
94
|
else {
|
|
74
|
-
notes.push(
|
|
75
|
-
'
|
|
95
|
+
notes.push(outcome.restartNeeded
|
|
96
|
+
? 'Disabled. Its data is kept.'
|
|
97
|
+
: 'Disabled. Its tools, pages and watchers are off now; its data is kept.');
|
|
76
98
|
}
|
|
99
|
+
if (outcome.restartFor !== undefined)
|
|
100
|
+
notes.push(`Restart buddi to finish: ${outcome.restartFor}.`);
|
|
77
101
|
if (outcome.missions.length > 0) {
|
|
78
102
|
notes.push(enabled
|
|
79
103
|
? `Resumed ${outcome.missions.length === 1 ? 'the mission' : 'the missions'} ${outcome.missions.join(', ')}.`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../src/plugins/toggle.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../src/plugins/toggle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,GAEjB,MAAM,aAAa,CAAC;AAErB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AAC,KAAK,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAC7I,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC;IAC3F,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -14,6 +14,14 @@ export interface UpdateOptions extends StageOptions {
|
|
|
14
14
|
version?: string;
|
|
15
15
|
/** Stage an older version anyway. The CLI never passes it; nothing else does. */
|
|
16
16
|
allowDowngrade?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Take the new version from this npm package instead of from where the
|
|
19
|
+
* installed one came. Browse passes it: a plugin installed from a directory
|
|
20
|
+
* or a file, once it is listed on withbuddi.com, updates to the published
|
|
21
|
+
* package, and the record follows (its source becomes the registry). A
|
|
22
|
+
* path is refused here; only a package name may replace a source.
|
|
23
|
+
*/
|
|
24
|
+
from?: string;
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
19
27
|
* Stage the next version of an installed plugin. Approving it is the caller's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/plugins/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/plugins/update.ts"],"names":[],"mappings":"AAmBA,OAAO,EAA6B,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAK7F,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAEtE;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAY1E;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAqDhG"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* version of that limitation.
|
|
15
15
|
*/
|
|
16
16
|
import { compareSemver, parseSemver, readPluginsFile } from '@buddi/core';
|
|
17
|
+
import { parsePluginSpec } from './spec.js';
|
|
17
18
|
import { InstallRefusal } from './refusals.js';
|
|
18
19
|
import { packageUses, recordFile } from './load.js';
|
|
19
20
|
import { rejectStaged, stagePlugin } from './stage.js';
|
|
@@ -56,11 +57,16 @@ export async function updatePlugin(name, opts = {}) {
|
|
|
56
57
|
// What the installed version declared it reaches, so the card can say what
|
|
57
58
|
// the new one adds. Unreadable is nothing: the card then lists every area.
|
|
58
59
|
const installedUses = packageUses(record.entry);
|
|
59
|
-
const
|
|
60
|
-
|
|
60
|
+
const { from, ...stageOpts } = opts;
|
|
61
|
+
if (from !== undefined && parsePluginSpec(from).kind !== 'registry') {
|
|
62
|
+
throw new InstallRefusal('bad-from', `"${from}" is not an npm package; an update from elsewhere names a package.`);
|
|
63
|
+
}
|
|
64
|
+
const staged = await stagePlugin(from ?? specFor(record, opts.version), {
|
|
65
|
+
...stageOpts,
|
|
61
66
|
env,
|
|
62
67
|
previous,
|
|
63
68
|
previousUses: installedUses.ok ? installedUses.uses : [],
|
|
69
|
+
previousSource: record.source,
|
|
64
70
|
});
|
|
65
71
|
let newer = true;
|
|
66
72
|
if (opts.allowDowngrade !== true) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/plugins/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAwB,MAAM,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C7B,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,MAAM,IAAI,cAAc,CACtB,WAAW,EACX,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,qBAAqB,MAAM,CAAC,OAAO,iCAAiC;YAClG,gGAAgG;YAChG,mGAAmG,CACtG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gFAAgF;AAChF,SAAS,OAAO,CAAC,MAAuB,EAAE,OAAgB;IACxD,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;IACxD,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAChE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;AAC5B,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { type PluginManifest } from '@buddi/core';
|
|
2
3
|
import { type StagedPlugin } from './plugins/stage.js';
|
|
3
|
-
export declare const USAGE = "buddi plugins \u2014 what this installation has installed\n\n buddi plugins init <name> [--dir <path>] [--license <spdx>] [--author <name>]\n write a new plugin: manifest, one auto tool, one gated\n tool, a migration, a buddi.md and a test. Refuses a\n directory that already exists. License: Apache-2.0\n unless --license names another. Author: asked, with\n git config user.name as the default.\n buddi plugins dev <dir> watch <dir>/dist and, when it changes, restart the\n service (or say to restart buddi): plugins load at start\n buddi plugins list [--json] what is installed, its version, and whether it is healthy\n buddi plugins info <name> what it is, what it brought, and what it proposes\n buddi plugins install <spec> STAGE it and read what it claims (imports nothing)\n buddi plugins install <spec> --yes --integrity <hash>\n approve it: import it, plan it, install it.\n The hash is the one the staged card printed; a\n package that came from a registry or a .tgz is\n never approved without it, not even with --yes.\n Without it the command stages, prints the card and\n exits 3: staged, not installed.\n buddi plugins update <name> [--version] stage the next version; --yes --integrity approves it\n buddi plugins staged what is staged and waiting for you\n buddi plugins approve <id> [--integrity <hash>] [--acknowledge-drift]\n buddi plugins reject <id> delete a stage and everything it fetched\n buddi plugins disable <name>
|
|
4
|
+
export declare const USAGE = "buddi plugins \u2014 what this installation has installed\n\n buddi plugins init <name> [--dir <path>] [--license <spdx>] [--author <name>]\n write a new plugin: manifest, one auto tool, one gated\n tool, a migration, a buddi.md and a test. Refuses a\n directory that already exists. License: Apache-2.0\n unless --license names another. Author: asked, with\n git config user.name as the default.\n buddi plugins dev <dir> watch <dir>/dist and, when it changes, restart the\n service (or say to restart buddi): plugins load at start\n buddi plugins list [--json] what is installed, its version, and whether it is healthy\n buddi plugins info <name> what it is, what it brought, and what it proposes\n buddi plugins describe <spec> [--json] stage it, read its manifest, print what it brings, delete\n the stage. Installs nothing: no record, no schema, no\n tools. --json is what a market listing's claims are.\n buddi plugins install <spec> STAGE it and read what it claims (imports nothing)\n buddi plugins install <spec> --yes --integrity <hash>\n approve it: import it, plan it, install it.\n The hash is the one the staged card printed; a\n package that came from a registry or a .tgz is\n never approved without it, not even with --yes.\n Without it the command stages, prints the card and\n exits 3: staged, not installed.\n buddi plugins update <name> [--version] stage the next version; --yes --integrity approves it\n buddi plugins staged what is staged and waiting for you\n buddi plugins approve <id> [--integrity <hash>] [--acknowledge-drift]\n buddi plugins reject <id> delete a stage and everything it fetched\n buddi plugins disable <name> turn it off now: its tools, pages and watchers stop, its\n data stays, its missions pause\n buddi plugins enable <name> turn it back on now and resume its missions\n buddi plugins uninstall <name> what removing it would do (removes nothing)\n buddi plugins uninstall <name> --yes remove it; its database schema is KEPT\n --detach-agents also take its tools out of agents that were granted them\n --purge --confirm <name> ALSO DROP its schema and everything in it. Irreversible,\n and the plugin's own name has to be typed back.\n\nA <spec> is a directory that exists, a .tgz on disk, or an npm package:\n`finance`, `@you/buddi-plugin-finance@1.2.3`. Installing one runs its code inside buddi.";
|
|
4
5
|
export interface ParsedPluginsArgs {
|
|
5
|
-
command: 'help' | 'list' | 'info' | 'init' | 'dev' | 'install' | 'update' | 'staged' | 'approve' | 'reject' | 'disable' | 'enable' | 'uninstall';
|
|
6
|
+
command: 'help' | 'list' | 'info' | 'describe' | 'init' | 'dev' | 'install' | 'update' | 'staged' | 'approve' | 'reject' | 'disable' | 'enable' | 'uninstall';
|
|
6
7
|
target?: string;
|
|
7
8
|
yes: boolean;
|
|
8
9
|
detachAgents: boolean;
|
|
9
10
|
purge: boolean;
|
|
10
11
|
acknowledgeDrift: boolean;
|
|
11
|
-
/** `list --json`. */
|
|
12
|
+
/** `list --json`, `describe --json`. */
|
|
12
13
|
json?: boolean;
|
|
13
14
|
/** Passed back at approval. Absent means "the hash this run just showed me". */
|
|
14
15
|
integrity?: string;
|
|
@@ -67,8 +68,46 @@ export declare function needsIntegrityFirst(staged: StagedPlugin, args: ParsedPl
|
|
|
67
68
|
* wrong) so a script can tell the two apart and go on to `plugins approve`.
|
|
68
69
|
*/
|
|
69
70
|
export declare const STAGED_NOT_INSTALLED = 3;
|
|
71
|
+
/**
|
|
72
|
+
* The shape `describe --json` prints: what the market's check job writes into
|
|
73
|
+
* an entry's `claims`, so the listing can never claim less than the code does.
|
|
74
|
+
* Pure over the stage and the imported manifest.
|
|
75
|
+
*/
|
|
76
|
+
export declare function describeJson(staged: StagedPlugin, manifest: PluginManifest): Record<string, unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* Stage, import the manifest, print, delete the stage.
|
|
79
|
+
*
|
|
80
|
+
* The manifest is imported, so the plugin's top-level code runs in this
|
|
81
|
+
* process, and the command says so. What never happens: the record is not
|
|
82
|
+
* written, no migration runs, no tool is registered and nothing is moved out
|
|
83
|
+
* of staging.
|
|
84
|
+
*/
|
|
85
|
+
export declare function describeSpec(spec: string, opts?: {
|
|
86
|
+
env?: NodeJS.ProcessEnv;
|
|
87
|
+
registry?: string;
|
|
88
|
+
json?: boolean;
|
|
89
|
+
log?: (line: string) => void;
|
|
90
|
+
}): Promise<number>;
|
|
70
91
|
/** The version of `@buddi/core` this process is running, for the peer range. */
|
|
71
92
|
export declare function runningCoreVersion(): string;
|
|
93
|
+
/**
|
|
94
|
+
* How `disable` / `enable` reach the running gateway: its own route, so the
|
|
95
|
+
* change applies there at once. `notRunning` when nothing answered (the next
|
|
96
|
+
* start reads the record), `unreachable` when one may be running but could
|
|
97
|
+
* not be asked, `refused` with the gateway's own sentence.
|
|
98
|
+
*/
|
|
99
|
+
export type ToggleInGateway = (name: string, enabled: boolean) => Promise<{
|
|
100
|
+
notes: string[];
|
|
101
|
+
} | {
|
|
102
|
+
notRunning: true;
|
|
103
|
+
} | {
|
|
104
|
+
unreachable: string;
|
|
105
|
+
} | {
|
|
106
|
+
refused: string;
|
|
107
|
+
}>;
|
|
108
|
+
export interface PluginsCliHooks {
|
|
109
|
+
toggleInGateway?: ToggleInGateway;
|
|
110
|
+
}
|
|
72
111
|
/**
|
|
73
112
|
* `init` — the first ten minutes.
|
|
74
113
|
*
|
|
@@ -78,6 +117,6 @@ export declare function runningCoreVersion(): string;
|
|
|
78
117
|
*/
|
|
79
118
|
/** `git config user.name`, or nothing when git has none (or is not there). */
|
|
80
119
|
export declare function gitUserName(): string | undefined;
|
|
81
|
-
export declare function main(argv?: string[]): Promise<number>;
|
|
82
|
-
export declare function runPluginsCli(argv: string[]): Promise<number>;
|
|
120
|
+
export declare function main(argv?: string[], hooks?: PluginsCliHooks): Promise<number>;
|
|
121
|
+
export declare function runPluginsCli(argv: string[], hooks?: PluginsCliHooks): Promise<number>;
|
|
83
122
|
//# sourceMappingURL=plugins-cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-cli.d.ts","sourceRoot":"","sources":["../src/plugins-cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"plugins-cli.d.ts","sourceRoot":"","sources":["../src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AAO,CAAC,MAAM,CAAC,CA8CjB;AAMD,gFAAgF;AAChF,wBAAgB,kBAAkB,IAAI,MAAM,CAc3C;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,KACb,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEzG,MAAM,WAAW,eAAe;IAC9B,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AA0BD;;;;;;GAMG;AACH,8EAA8E;AAC9E,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAOhD;AA8FD,wBAAsB,IAAI,CAAC,IAAI,GAAE,MAAM,EAA0B,EAAE,KAAK,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsE/G;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEhG"}
|
|
@@ -31,8 +31,9 @@ import { fileURLToPath } from 'node:url';
|
|
|
31
31
|
import { contributionHeadline, contributionOf, createPool, describeSource, renderContribution, renderUses, pluginUsesChange, } from '@buddi/core';
|
|
32
32
|
import { loadEnvironment } from './bootstrap.js';
|
|
33
33
|
import { installedManifests } from './agents/catalog.js';
|
|
34
|
-
import { isBuiltInPlugin, loadInstalledPlugins, recordFile, } from './plugins/load.js';
|
|
35
|
-
import { acceptAgentSteps, InstallRefusal, renderAgentDrift } from './plugins/install.js';
|
|
34
|
+
import { isBuiltInPlugin, loadInstalledPlugins, loadManifest, manifestProblem, recordFile, } from './plugins/load.js';
|
|
35
|
+
import { acceptAgentSteps, entryPointOf, InstallRefusal, renderAgentDrift } from './plugins/install.js';
|
|
36
|
+
import { driftBetween } from './plugins/claims.js';
|
|
36
37
|
import { applyUninstall, planUninstall, UninstallRefusal } from './plugins/uninstall.js';
|
|
37
38
|
import { approveStaged } from './plugins/approve.js';
|
|
38
39
|
import { listStaged, readStaged, rejectStaged, resolveCoreDir, stagePlugin, StageRefusal, TRUST_SENTENCE, } from './plugins/stage.js';
|
|
@@ -53,6 +54,9 @@ export const USAGE = `buddi plugins — what this installation has installed
|
|
|
53
54
|
service (or say to restart buddi): plugins load at start
|
|
54
55
|
buddi plugins list [--json] what is installed, its version, and whether it is healthy
|
|
55
56
|
buddi plugins info <name> what it is, what it brought, and what it proposes
|
|
57
|
+
buddi plugins describe <spec> [--json] stage it, read its manifest, print what it brings, delete
|
|
58
|
+
the stage. Installs nothing: no record, no schema, no
|
|
59
|
+
tools. --json is what a market listing's claims are.
|
|
56
60
|
buddi plugins install <spec> STAGE it and read what it claims (imports nothing)
|
|
57
61
|
buddi plugins install <spec> --yes --integrity <hash>
|
|
58
62
|
approve it: import it, plan it, install it.
|
|
@@ -65,9 +69,9 @@ export const USAGE = `buddi plugins — what this installation has installed
|
|
|
65
69
|
buddi plugins staged what is staged and waiting for you
|
|
66
70
|
buddi plugins approve <id> [--integrity <hash>] [--acknowledge-drift]
|
|
67
71
|
buddi plugins reject <id> delete a stage and everything it fetched
|
|
68
|
-
buddi plugins disable <name>
|
|
69
|
-
|
|
70
|
-
buddi plugins enable <name>
|
|
72
|
+
buddi plugins disable <name> turn it off now: its tools, pages and watchers stop, its
|
|
73
|
+
data stays, its missions pause
|
|
74
|
+
buddi plugins enable <name> turn it back on now and resume its missions
|
|
71
75
|
buddi plugins uninstall <name> what removing it would do (removes nothing)
|
|
72
76
|
buddi plugins uninstall <name> --yes remove it; its database schema is KEPT
|
|
73
77
|
--detach-agents also take its tools out of agents that were granted them
|
|
@@ -118,20 +122,22 @@ export function parsePluginsArgs(argv) {
|
|
|
118
122
|
};
|
|
119
123
|
if (head === undefined || head === 'help' || head === '--help')
|
|
120
124
|
return { command: 'help', ...base };
|
|
121
|
-
if (flags.has('--json') && head !== 'list')
|
|
122
|
-
throw new Error('buddi plugins: --json only applies to list');
|
|
125
|
+
if (flags.has('--json') && head !== 'list' && head !== 'describe') {
|
|
126
|
+
throw new Error('buddi plugins: --json only applies to list and describe');
|
|
127
|
+
}
|
|
123
128
|
if (head === 'list')
|
|
124
129
|
return { command: 'list', ...base };
|
|
125
130
|
if (head === 'staged')
|
|
126
131
|
return { command: 'staged', ...base };
|
|
127
|
-
if (['info', 'init', 'dev', 'install', 'update', 'approve', 'reject', 'disable', 'enable', 'uninstall'].includes(head)) {
|
|
132
|
+
if (['info', 'describe', 'init', 'dev', 'install', 'update', 'approve', 'reject', 'disable', 'enable', 'uninstall'].includes(head)) {
|
|
128
133
|
const target = positional[0];
|
|
129
134
|
if (target === undefined) {
|
|
130
135
|
const what = head === 'install' ? 'plugin to install (a directory, a .tgz, or an npm package)'
|
|
131
|
-
: head === '
|
|
132
|
-
: head === '
|
|
133
|
-
: head === '
|
|
134
|
-
: 'plugin
|
|
136
|
+
: head === 'describe' ? 'plugin to describe (a directory, a .tgz, or an npm package)'
|
|
137
|
+
: head === 'approve' || head === 'reject' ? 'staging id'
|
|
138
|
+
: head === 'init' ? 'name for the new plugin'
|
|
139
|
+
: head === 'dev' ? "plugin directory to watch (the one whose dist/ you are building)"
|
|
140
|
+
: 'plugin name';
|
|
135
141
|
throw new Error(`buddi plugins ${head} needs a ${what}`);
|
|
136
142
|
}
|
|
137
143
|
return { command: head, target, ...base };
|
|
@@ -629,6 +635,138 @@ async function commandUninstall(name, args, pool, env) {
|
|
|
629
635
|
console.log('Restart any running buddi process so it stops registering the tools: `buddi service restart`.');
|
|
630
636
|
return 0;
|
|
631
637
|
}
|
|
638
|
+
/* ------------------------------------------------------------------ *
|
|
639
|
+
* Describing one: what a market listing says it brings
|
|
640
|
+
* ------------------------------------------------------------------ */
|
|
641
|
+
/**
|
|
642
|
+
* The shape `describe --json` prints: what the market's check job writes into
|
|
643
|
+
* an entry's `claims`, so the listing can never claim less than the code does.
|
|
644
|
+
* Pure over the stage and the imported manifest.
|
|
645
|
+
*/
|
|
646
|
+
export function describeJson(staged, manifest) {
|
|
647
|
+
const contribution = contributionOf(manifest);
|
|
648
|
+
return {
|
|
649
|
+
package: {
|
|
650
|
+
name: staged.source.kind === 'registry' ? staged.source.name : packageNameOf(staged),
|
|
651
|
+
version: staged.version,
|
|
652
|
+
integrity: staged.integrity,
|
|
653
|
+
...(staged.publisher === undefined ? {} : { publisher: staged.publisher }),
|
|
654
|
+
...(packageLicenseOf(staged) === undefined ? {} : { license: packageLicenseOf(staged) }),
|
|
655
|
+
...(staged.author === undefined ? {} : { author: staged.author }),
|
|
656
|
+
buddiName: staged.declaredName,
|
|
657
|
+
...(staged.buddi?.hostApi === undefined ? {} : { hostApi: staged.buddi.hostApi }),
|
|
658
|
+
uses: staged.uses ?? [],
|
|
659
|
+
dependencies: staged.dependencies,
|
|
660
|
+
scripts: staged.scripts,
|
|
661
|
+
},
|
|
662
|
+
claims: {
|
|
663
|
+
...(staged.claims.schema === undefined ? {} : { schema: staged.claims.schema }),
|
|
664
|
+
hosts: staged.claims.hosts,
|
|
665
|
+
missing: staged.claims.missing,
|
|
666
|
+
},
|
|
667
|
+
manifest: {
|
|
668
|
+
name: manifest.name,
|
|
669
|
+
version: manifest.version,
|
|
670
|
+
schema: manifest.schema,
|
|
671
|
+
...(manifest.description === undefined ? {} : { description: manifest.description }),
|
|
672
|
+
...(manifest.author === undefined ? {} : { author: manifest.author }),
|
|
673
|
+
uses: contribution.uses,
|
|
674
|
+
network: contribution.network,
|
|
675
|
+
tools: contribution.tools.map((tool) => ({
|
|
676
|
+
name: tool.name,
|
|
677
|
+
tier: tool.tier,
|
|
678
|
+
ownerOnly: tool.ownerOnly === true,
|
|
679
|
+
description: tool.description,
|
|
680
|
+
})),
|
|
681
|
+
sentinels: contribution.sentinels.map((s) => ({ name: s.id, every: s.every })),
|
|
682
|
+
sources: contribution.sources.map((s) => ({ name: s.id, every: s.every })),
|
|
683
|
+
missions: contribution.missions.map((m) => ({ id: m.id, name: m.name, cron: m.cron, agent: m.agent })),
|
|
684
|
+
agents: contribution.agents.map((a) => ({ id: a.id, handle: a.handle, name: a.name, tools: a.tools })),
|
|
685
|
+
skills: contribution.skills,
|
|
686
|
+
pages: (manifest.pages ?? []).map((p) => ({ id: p.id, title: p.title, place: p.place })),
|
|
687
|
+
views: contribution.views,
|
|
688
|
+
home: (manifest.home ?? []).length,
|
|
689
|
+
},
|
|
690
|
+
drift: driftBetween(staged.claims, manifest),
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
function packageJsonOf(staged) {
|
|
694
|
+
try {
|
|
695
|
+
return JSON.parse(readFileSync(path.join(staged.packageDir, 'package.json'), 'utf8'));
|
|
696
|
+
}
|
|
697
|
+
catch {
|
|
698
|
+
return {};
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
function packageNameOf(staged) {
|
|
702
|
+
const name = packageJsonOf(staged).name;
|
|
703
|
+
return typeof name === 'string' ? name : staged.name;
|
|
704
|
+
}
|
|
705
|
+
function packageLicenseOf(staged) {
|
|
706
|
+
const license = packageJsonOf(staged).license;
|
|
707
|
+
return typeof license === 'string' ? license : undefined;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Stage, import the manifest, print, delete the stage.
|
|
711
|
+
*
|
|
712
|
+
* The manifest is imported, so the plugin's top-level code runs in this
|
|
713
|
+
* process, and the command says so. What never happens: the record is not
|
|
714
|
+
* written, no migration runs, no tool is registered and nothing is moved out
|
|
715
|
+
* of staging.
|
|
716
|
+
*/
|
|
717
|
+
export async function describeSpec(spec, opts = {}) {
|
|
718
|
+
const env = opts.env ?? process.env;
|
|
719
|
+
const log = opts.log ?? ((line) => console.log(line));
|
|
720
|
+
const staged = await stagePlugin(spec, {
|
|
721
|
+
env,
|
|
722
|
+
...(opts.registry === undefined ? {} : { registry: opts.registry }),
|
|
723
|
+
...(opts.json === true
|
|
724
|
+
? {}
|
|
725
|
+
: {
|
|
726
|
+
onPhase: (phase) => {
|
|
727
|
+
if (phase === 'fetching')
|
|
728
|
+
log('fetching…');
|
|
729
|
+
if (phase === 'installing-dependencies')
|
|
730
|
+
log('installing its dependencies (--ignore-scripts)…');
|
|
731
|
+
},
|
|
732
|
+
}),
|
|
733
|
+
});
|
|
734
|
+
try {
|
|
735
|
+
const entry = entryPointOf(staged.packageDir);
|
|
736
|
+
const loaded = await loadManifest(entry, undefined, env);
|
|
737
|
+
if (!loaded.ok)
|
|
738
|
+
throw new InstallRefusal('not-a-plugin', `${spec} is not a usable plugin: ${loaded.message}`);
|
|
739
|
+
const problem = manifestProblem(loaded.manifest, undefined, env);
|
|
740
|
+
if (problem !== undefined)
|
|
741
|
+
throw new InstallRefusal('not-a-plugin', problem);
|
|
742
|
+
const manifest = loaded.manifest;
|
|
743
|
+
if (opts.json === true) {
|
|
744
|
+
log(JSON.stringify(describeJson(staged, manifest), null, 2));
|
|
745
|
+
return 0;
|
|
746
|
+
}
|
|
747
|
+
// The card is drawn from package.json; a package naming no author there
|
|
748
|
+
// still names one in its manifest, and here the manifest has been read.
|
|
749
|
+
const author = staged.author ?? manifest.author;
|
|
750
|
+
log(renderStaged({ ...staged, ...(author === undefined ? {} : { author }) }).join('\n'));
|
|
751
|
+
log('');
|
|
752
|
+
log(renderContribution(contributionOf(manifest)).join('\n'));
|
|
753
|
+
const drift = driftBetween(staged.claims, manifest);
|
|
754
|
+
if (drift.length > 0) {
|
|
755
|
+
log('');
|
|
756
|
+
log('ITS PROSE AND ITS CODE DO NOT AGREE');
|
|
757
|
+
for (const difference of drift)
|
|
758
|
+
log(` ${difference}`);
|
|
759
|
+
}
|
|
760
|
+
log('');
|
|
761
|
+
log('Its manifest was imported to read it, so its top-level code ran in this process. Nothing');
|
|
762
|
+
log('was installed: no record was written, no schema touched, no tool registered. The stage');
|
|
763
|
+
log('was deleted.');
|
|
764
|
+
return 0;
|
|
765
|
+
}
|
|
766
|
+
finally {
|
|
767
|
+
rejectStaged(staged.id, env);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
632
770
|
/* ------------------------------------------------------------------ *
|
|
633
771
|
* Starting one, and working on one
|
|
634
772
|
* ------------------------------------------------------------------ */
|
|
@@ -648,13 +786,24 @@ export function runningCoreVersion() {
|
|
|
648
786
|
}
|
|
649
787
|
return '0.1.0';
|
|
650
788
|
}
|
|
651
|
-
/** `disable` / `enable`: the
|
|
652
|
-
async function commandToggle(name, enabled, pool, env) {
|
|
653
|
-
const
|
|
789
|
+
/** `disable` / `enable`: through the running gateway when there is one, else the record. */
|
|
790
|
+
async function commandToggle(name, enabled, pool, env, hooks) {
|
|
791
|
+
const via = hooks.toggleInGateway === undefined ? undefined : await hooks.toggleInGateway(name, enabled);
|
|
792
|
+
if (via !== undefined && 'notes' in via) {
|
|
793
|
+
for (const note of via.notes)
|
|
794
|
+
console.log(note);
|
|
795
|
+
return 0;
|
|
796
|
+
}
|
|
797
|
+
if (via !== undefined && 'refused' in via) {
|
|
798
|
+
console.error(via.refused);
|
|
799
|
+
return 1;
|
|
800
|
+
}
|
|
801
|
+
const gatewayRunning = via === undefined || !('notRunning' in via);
|
|
802
|
+
const outcome = await setPluginEnabled(name, enabled, { env, gatewayRunning, ...(pool === undefined ? {} : { pool }) });
|
|
654
803
|
for (const note of toggleNotes(outcome))
|
|
655
804
|
console.log(note);
|
|
656
805
|
if (outcome.restartNeeded)
|
|
657
|
-
console.log('
|
|
806
|
+
console.log('`buddi service restart` restarts it.');
|
|
658
807
|
return 0;
|
|
659
808
|
}
|
|
660
809
|
/**
|
|
@@ -759,7 +908,7 @@ async function commandDev(dir) {
|
|
|
759
908
|
});
|
|
760
909
|
return 0;
|
|
761
910
|
}
|
|
762
|
-
export async function main(argv = process.argv.slice(2)) {
|
|
911
|
+
export async function main(argv = process.argv.slice(2), hooks = {}) {
|
|
763
912
|
let args;
|
|
764
913
|
try {
|
|
765
914
|
args = parsePluginsArgs(argv);
|
|
@@ -783,6 +932,14 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
783
932
|
return await commandInit(args.target, args, process.env);
|
|
784
933
|
if (args.command === 'dev')
|
|
785
934
|
return await commandDev(args.target);
|
|
935
|
+
// Describing reads a package and deletes the stage; it needs no database.
|
|
936
|
+
if (args.command === 'describe') {
|
|
937
|
+
return await describeSpec(args.target, {
|
|
938
|
+
env: process.env,
|
|
939
|
+
json: args.json === true,
|
|
940
|
+
...(args.registry === undefined ? {} : { registry: args.registry }),
|
|
941
|
+
});
|
|
942
|
+
}
|
|
786
943
|
}
|
|
787
944
|
catch (err) {
|
|
788
945
|
console.error(err instanceof Error ? err.message : String(err));
|
|
@@ -819,7 +976,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
819
976
|
if (args.command === 'reject')
|
|
820
977
|
return commandReject(args.target, process.env);
|
|
821
978
|
if (args.command === 'disable' || args.command === 'enable') {
|
|
822
|
-
return await commandToggle(args.target, args.command === 'enable', pool, process.env);
|
|
979
|
+
return await commandToggle(args.target, args.command === 'enable', pool, process.env, hooks);
|
|
823
980
|
}
|
|
824
981
|
return await commandUninstall(args.target, args, pool, process.env);
|
|
825
982
|
}
|
|
@@ -835,8 +992,8 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
835
992
|
await pool?.end().catch(() => { });
|
|
836
993
|
}
|
|
837
994
|
}
|
|
838
|
-
export async function runPluginsCli(argv) {
|
|
839
|
-
return main(argv);
|
|
995
|
+
export async function runPluginsCli(argv, hooks = {}) {
|
|
996
|
+
return main(argv, hooks);
|
|
840
997
|
}
|
|
841
998
|
function invokedDirectly() {
|
|
842
999
|
const entry = process.argv[1];
|