@withbuddi/buddi 0.1.0-pre.53 → 0.1.0-pre.54
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/extension/background.js +38 -7
- package/extension/manifest.json +2 -2
- package/extension/popup.html +2 -2
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/dashboard-cmd.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/dashboard-cmd.js +6 -3
- package/node_modules/@buddi/cli/dist/dashboard-cmd.js.map +1 -1
- package/node_modules/@buddi/cli/dist/main.js +2 -2
- package/node_modules/@buddi/cli/dist/main.js.map +1 -1
- package/node_modules/@buddi/cli/dist/status.d.ts +16 -2
- package/node_modules/@buddi/cli/dist/status.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/status.js +42 -2
- package/node_modules/@buddi/cli/dist/status.js.map +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.d.ts +6 -0
- package/node_modules/@buddi/core/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/core/dist/backup/archive.d.ts +6 -0
- package/node_modules/@buddi/core/dist/backup/archive.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/backup/archive.js +19 -6
- package/node_modules/@buddi/core/dist/backup/archive.js.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/binaries.d.ts +21 -1
- package/node_modules/@buddi/core/dist/postgres/binaries.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/binaries.js +72 -10
- package/node_modules/@buddi/core/dist/postgres/binaries.js.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/cluster.d.ts +8 -0
- package/node_modules/@buddi/core/dist/postgres/cluster.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/cluster.js +119 -17
- package/node_modules/@buddi/core/dist/postgres/cluster.js.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/windows-guard.d.ts +20 -0
- package/node_modules/@buddi/core/dist/postgres/windows-guard.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/postgres/windows-guard.js +140 -0
- package/node_modules/@buddi/core/dist/postgres/windows-guard.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.js +3 -2
- package/node_modules/@buddi/gateway/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts +2 -2
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts +6 -6
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js +5 -5
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/browser-host.js +1 -1
- package/node_modules/@buddi/gateway/dist/browser-host.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.d.ts +10 -10
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.js +20 -20
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +2 -2
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +11 -11
- package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/reminders.d.ts +2 -2
- package/node_modules/@buddi/gateway/dist/missions/reminders.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/reminders.js +5 -5
- package/node_modules/@buddi/gateway/dist/missions/reminders.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/npm.d.ts +9 -2
- package/node_modules/@buddi/gateway/dist/plugins/npm.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/npm.js +29 -6
- package/node_modules/@buddi/gateway/dist/plugins/npm.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.js +2 -2
- package/node_modules/@buddi/gateway/dist/plugins/stage.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.js +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.d.ts +11 -0
- package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.js +42 -1
- package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.js +6 -6
- package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/approval-ask.js +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 +22 -11
- package/node_modules/@buddi/gateway/dist/web/extension.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +4 -4
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/service.d.ts +6 -1
- package/node_modules/@buddi/gateway/dist/web/service.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/service.js +10 -1
- package/node_modules/@buddi/gateway/dist/web/service.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/skills.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/skills.js +2 -1
- package/node_modules/@buddi/gateway/dist/web/skills.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/write.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/web/write.js +1 -1
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/install/dist/app-layout.d.ts +30 -1
- package/node_modules/@buddi/install/dist/app-layout.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/app-layout.js +61 -10
- package/node_modules/@buddi/install/dist/app-layout.js.map +1 -1
- package/node_modules/@buddi/install/dist/cloudflared.js +2 -2
- package/node_modules/@buddi/install/dist/cloudflared.js.map +1 -1
- package/node_modules/@buddi/install/dist/environment.d.ts +40 -1
- package/node_modules/@buddi/install/dist/environment.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/environment.js +158 -12
- package/node_modules/@buddi/install/dist/environment.js.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.js +257 -50
- package/node_modules/@buddi/install/dist/launcher.js.map +1 -1
- package/node_modules/@buddi/install/dist/postgres-check.js +1 -1
- package/node_modules/@buddi/install/dist/postgres-check.js.map +1 -1
- package/node_modules/@buddi/install/dist/product-uninstall.d.ts +14 -0
- package/node_modules/@buddi/install/dist/product-uninstall.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/product-uninstall.js +10 -0
- package/node_modules/@buddi/install/dist/product-uninstall.js.map +1 -1
- package/node_modules/@buddi/install/dist/runtime-info.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/runtime-info.js +4 -1
- package/node_modules/@buddi/install/dist/runtime-info.js.map +1 -1
- package/node_modules/@buddi/install/dist/supervisor.d.ts +60 -3
- package/node_modules/@buddi/install/dist/supervisor.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/supervisor.js +173 -17
- package/node_modules/@buddi/install/dist/supervisor.js.map +1 -1
- package/node_modules/@buddi/install/dist/uninstall.d.ts +29 -3
- package/node_modules/@buddi/install/dist/uninstall.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/uninstall.js +135 -27
- package/node_modules/@buddi/install/dist/uninstall.js.map +1 -1
- package/node_modules/@buddi/install/dist/upgrade.d.ts +16 -4
- package/node_modules/@buddi/install/dist/upgrade.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/upgrade.js +50 -13
- package/node_modules/@buddi/install/dist/upgrade.js.map +1 -1
- package/node_modules/@buddi/install/dist/windows-install.d.ts +102 -0
- package/node_modules/@buddi/install/dist/windows-install.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/windows-install.js +223 -0
- package/node_modules/@buddi/install/dist/windows-install.js.map +1 -0
- package/node_modules/@buddi/install/dist/windows-setup.d.ts +107 -0
- package/node_modules/@buddi/install/dist/windows-setup.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/windows-setup.js +700 -0
- package/node_modules/@buddi/install/dist/windows-setup.js.map +1 -0
- package/node_modules/@buddi/install/dist/windows-task.d.ts +49 -0
- package/node_modules/@buddi/install/dist/windows-task.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/windows-task.js +167 -0
- package/node_modules/@buddi/install/dist/windows-task.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/codex-direct.d.ts +1 -1
- package/node_modules/@buddi/runtime/dist/codex-direct.js +1 -1
- package/node_modules/@buddi/runtime/dist/openai.d.ts +11 -0
- package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.js +36 -3
- package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/tools/write.js +3 -3
- package/node_modules/@buddi/tool-artifacts/dist/tools/write.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/availability.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/availability.js +1 -0
- package/node_modules/@buddi/tool-browser/dist/availability.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/brand.d.ts +19 -0
- package/node_modules/@buddi/tool-browser/dist/brand.d.ts.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/brand.js +31 -0
- package/node_modules/@buddi/tool-browser/dist/brand.js.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +2 -2
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +16 -7
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/downloads.js +1 -1
- package/node_modules/@buddi/tool-browser/dist/downloads.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts +3 -1
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.js +4 -4
- package/node_modules/@buddi/tool-browser/dist/extension.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts +3 -2
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +7 -6
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts +12 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.js +31 -14
- package/node_modules/@buddi/tool-browser/dist/routes.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +2 -0
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js +6 -6
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/telemetry.d.ts +2 -2
- package/node_modules/@buddi/tool-browser/dist/telemetry.js +2 -2
- package/node_modules/@buddi/tool-browser/dist/telemetry.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-host/dist/index.d.ts +2 -1
- package/node_modules/@buddi/tool-host/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/index.js +11 -2
- package/node_modules/@buddi/tool-host/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/process.d.ts +58 -1
- package/node_modules/@buddi/tool-host/dist/process.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/process.js +229 -15
- package/node_modules/@buddi/tool-host/dist/process.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/service.d.ts +2 -0
- package/node_modules/@buddi/tool-host/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/service.js +8 -6
- package/node_modules/@buddi/tool-host/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/skill-run.d.ts +10 -0
- package/node_modules/@buddi/tool-host/dist/skill-run.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/skill-run.js +14 -0
- package/node_modules/@buddi/tool-host/dist/skill-run.js.map +1 -1
- package/node_modules/ip-address/README.md +70 -70
- package/node_modules/ip-address/dist/ipv6.js +7 -4
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
- package/node_modules/ip-address/dist/v6/constants.js +3 -0
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +2 -1
- package/node_modules/marked/bin/main.js +1 -1
- package/node_modules/marked/lib/marked.d.ts +6 -3
- package/node_modules/marked/lib/marked.esm.js +48 -50
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +45 -47
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +1 -1
- package/node_modules/marked/package.json +1 -1
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/dashboard-cmd.d.ts.map +1 -1
- package/packages/cli/dist/dashboard-cmd.js +6 -3
- package/packages/cli/dist/dashboard-cmd.js.map +1 -1
- package/packages/cli/dist/main.js +2 -2
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/status.d.ts +16 -2
- package/packages/cli/dist/status.d.ts.map +1 -1
- package/packages/cli/dist/status.js +42 -2
- package/packages/cli/dist/status.js.map +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/agents/catalog.d.ts +6 -0
- package/packages/core/dist/agents/catalog.d.ts.map +1 -1
- package/packages/core/dist/agents/catalog.js +1 -1
- package/packages/core/dist/agents/catalog.js.map +1 -1
- package/packages/core/dist/backup/archive.d.ts +6 -0
- package/packages/core/dist/backup/archive.d.ts.map +1 -1
- package/packages/core/dist/backup/archive.js +19 -6
- package/packages/core/dist/backup/archive.js.map +1 -1
- package/packages/core/dist/postgres/binaries.d.ts +21 -1
- package/packages/core/dist/postgres/binaries.d.ts.map +1 -1
- package/packages/core/dist/postgres/binaries.js +72 -10
- package/packages/core/dist/postgres/binaries.js.map +1 -1
- package/packages/core/dist/postgres/cluster.d.ts +8 -0
- package/packages/core/dist/postgres/cluster.d.ts.map +1 -1
- package/packages/core/dist/postgres/cluster.js +119 -17
- package/packages/core/dist/postgres/cluster.js.map +1 -1
- package/packages/core/dist/postgres/windows-guard.d.ts +20 -0
- package/packages/core/dist/postgres/windows-guard.d.ts.map +1 -0
- package/packages/core/dist/postgres/windows-guard.js +140 -0
- package/packages/core/dist/postgres/windows-guard.js.map +1 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalog.js +3 -2
- package/packages/gateway/dist/agents/catalog.js.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.d.ts +2 -2
- package/packages/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.js +1 -1
- package/packages/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.d.ts +6 -6
- package/packages/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.js +5 -5
- package/packages/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/packages/gateway/dist/browser-host.js +1 -1
- package/packages/gateway/dist/browser-host.js.map +1 -1
- package/packages/gateway/dist/missions/chrome-scope.d.ts +10 -10
- package/packages/gateway/dist/missions/chrome-scope.d.ts.map +1 -1
- package/packages/gateway/dist/missions/chrome-scope.js +20 -20
- package/packages/gateway/dist/missions/chrome-scope.js.map +1 -1
- package/packages/gateway/dist/missions/execute.d.ts +2 -2
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +11 -11
- package/packages/gateway/dist/missions/execute.js.map +1 -1
- package/packages/gateway/dist/missions/reminders.d.ts +2 -2
- package/packages/gateway/dist/missions/reminders.d.ts.map +1 -1
- package/packages/gateway/dist/missions/reminders.js +5 -5
- package/packages/gateway/dist/missions/reminders.js.map +1 -1
- package/packages/gateway/dist/owner-notify.js +1 -1
- package/packages/gateway/dist/owner-notify.js.map +1 -1
- package/packages/gateway/dist/plugins/npm.d.ts +9 -2
- package/packages/gateway/dist/plugins/npm.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/npm.js +29 -6
- package/packages/gateway/dist/plugins/npm.js.map +1 -1
- package/packages/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/stage.js +2 -2
- package/packages/gateway/dist/plugins/stage.js.map +1 -1
- package/packages/gateway/dist/serve.js +1 -1
- package/packages/gateway/dist/serve.js.map +1 -1
- package/packages/gateway/dist/surfaces/browser-cards.d.ts +1 -1
- package/packages/gateway/dist/surfaces/browser-cards.js +1 -1
- package/packages/gateway/dist/system-context.d.ts +11 -0
- package/packages/gateway/dist/system-context.d.ts.map +1 -1
- package/packages/gateway/dist/system-context.js +42 -1
- package/packages/gateway/dist/system-context.js.map +1 -1
- package/packages/gateway/dist/telegram/approvals.js +1 -1
- package/packages/gateway/dist/telegram/approvals.js.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.js +1 -1
- package/packages/gateway/dist/telegram/browser-view.js.map +1 -1
- package/packages/gateway/dist/web/api-routes.js +6 -6
- package/packages/gateway/dist/web/api-routes.js.map +1 -1
- package/packages/gateway/dist/web/approval-ask.js +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 +22 -11
- package/packages/gateway/dist/web/extension.js.map +1 -1
- package/packages/gateway/dist/web/read.d.ts +1 -1
- package/packages/gateway/dist/web/read.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +4 -4
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/service.d.ts +6 -1
- package/packages/gateway/dist/web/service.d.ts.map +1 -1
- package/packages/gateway/dist/web/service.js +10 -1
- package/packages/gateway/dist/web/service.js.map +1 -1
- package/packages/gateway/dist/web/skills.d.ts.map +1 -1
- package/packages/gateway/dist/web/skills.js +2 -1
- package/packages/gateway/dist/web/skills.js.map +1 -1
- package/packages/gateway/dist/web/write.d.ts +1 -1
- package/packages/gateway/dist/web/write.js +1 -1
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/install/dist/app-layout.d.ts +30 -1
- package/packages/install/dist/app-layout.d.ts.map +1 -1
- package/packages/install/dist/app-layout.js +61 -10
- package/packages/install/dist/app-layout.js.map +1 -1
- package/packages/install/dist/cloudflared.js +2 -2
- package/packages/install/dist/cloudflared.js.map +1 -1
- package/packages/install/dist/environment.d.ts +40 -1
- package/packages/install/dist/environment.d.ts.map +1 -1
- package/packages/install/dist/environment.js +158 -12
- package/packages/install/dist/environment.js.map +1 -1
- package/packages/install/dist/launcher.d.ts.map +1 -1
- package/packages/install/dist/launcher.js +257 -50
- package/packages/install/dist/launcher.js.map +1 -1
- package/packages/install/dist/postgres-check.js +1 -1
- package/packages/install/dist/postgres-check.js.map +1 -1
- package/packages/install/dist/product-uninstall.d.ts +14 -0
- package/packages/install/dist/product-uninstall.d.ts.map +1 -1
- package/packages/install/dist/product-uninstall.js +10 -0
- package/packages/install/dist/product-uninstall.js.map +1 -1
- package/packages/install/dist/runtime-info.d.ts.map +1 -1
- package/packages/install/dist/runtime-info.js +4 -1
- package/packages/install/dist/runtime-info.js.map +1 -1
- package/packages/install/dist/supervisor.d.ts +60 -3
- package/packages/install/dist/supervisor.d.ts.map +1 -1
- package/packages/install/dist/supervisor.js +173 -17
- package/packages/install/dist/supervisor.js.map +1 -1
- package/packages/install/dist/uninstall.d.ts +29 -3
- package/packages/install/dist/uninstall.d.ts.map +1 -1
- package/packages/install/dist/uninstall.js +135 -27
- package/packages/install/dist/uninstall.js.map +1 -1
- package/packages/install/dist/upgrade.d.ts +16 -4
- package/packages/install/dist/upgrade.d.ts.map +1 -1
- package/packages/install/dist/upgrade.js +50 -13
- package/packages/install/dist/upgrade.js.map +1 -1
- package/packages/install/dist/windows-install.d.ts +102 -0
- package/packages/install/dist/windows-install.d.ts.map +1 -0
- package/packages/install/dist/windows-install.js +223 -0
- package/packages/install/dist/windows-install.js.map +1 -0
- package/packages/install/dist/windows-setup.d.ts +107 -0
- package/packages/install/dist/windows-setup.d.ts.map +1 -0
- package/packages/install/dist/windows-setup.js +700 -0
- package/packages/install/dist/windows-setup.js.map +1 -0
- package/packages/install/dist/windows-task.d.ts +49 -0
- package/packages/install/dist/windows-task.d.ts.map +1 -0
- package/packages/install/dist/windows-task.js +167 -0
- package/packages/install/dist/windows-task.js.map +1 -0
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/codex-direct.d.ts +1 -1
- package/packages/runtime/dist/codex-direct.js +1 -1
- package/packages/runtime/dist/openai.d.ts +11 -0
- package/packages/runtime/dist/openai.d.ts.map +1 -1
- package/packages/runtime/dist/openai.js +36 -3
- package/packages/runtime/dist/openai.js.map +1 -1
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/artifacts/dist/tools/write.js +3 -3
- package/packages/tools/artifacts/dist/tools/write.js.map +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/availability.d.ts.map +1 -1
- package/packages/tools/browser/dist/availability.js +1 -0
- package/packages/tools/browser/dist/availability.js.map +1 -1
- package/packages/tools/browser/dist/brand.d.ts +19 -0
- package/packages/tools/browser/dist/brand.d.ts.map +1 -0
- package/packages/tools/browser/dist/brand.js +31 -0
- package/packages/tools/browser/dist/brand.js.map +1 -0
- package/packages/tools/browser/dist/controller.d.ts +2 -2
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +16 -7
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/downloads.js +1 -1
- package/packages/tools/browser/dist/downloads.js.map +1 -1
- package/packages/tools/browser/dist/extension.d.ts +3 -1
- package/packages/tools/browser/dist/extension.d.ts.map +1 -1
- package/packages/tools/browser/dist/extension.js +4 -4
- package/packages/tools/browser/dist/extension.js.map +1 -1
- package/packages/tools/browser/dist/index.d.ts +3 -2
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +7 -6
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/routes.d.ts +12 -1
- package/packages/tools/browser/dist/routes.d.ts.map +1 -1
- package/packages/tools/browser/dist/routes.js +31 -14
- package/packages/tools/browser/dist/routes.js.map +1 -1
- package/packages/tools/browser/dist/service.d.ts +2 -0
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js +6 -6
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/browser/dist/telemetry.d.ts +2 -2
- package/packages/tools/browser/dist/telemetry.js +2 -2
- package/packages/tools/browser/dist/telemetry.js.map +1 -1
- package/packages/tools/browser/dist/types.js +1 -1
- package/packages/tools/browser/dist/types.js.map +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/host/dist/index.d.ts +2 -1
- package/packages/tools/host/dist/index.d.ts.map +1 -1
- package/packages/tools/host/dist/index.js +11 -2
- package/packages/tools/host/dist/index.js.map +1 -1
- package/packages/tools/host/dist/process.d.ts +58 -1
- package/packages/tools/host/dist/process.d.ts.map +1 -1
- package/packages/tools/host/dist/process.js +229 -15
- package/packages/tools/host/dist/process.js.map +1 -1
- package/packages/tools/host/dist/service.d.ts +2 -0
- package/packages/tools/host/dist/service.d.ts.map +1 -1
- package/packages/tools/host/dist/service.js +8 -6
- package/packages/tools/host/dist/service.js.map +1 -1
- package/packages/tools/host/dist/skill-run.d.ts +10 -0
- package/packages/tools/host/dist/skill-run.d.ts.map +1 -1
- package/packages/tools/host/dist/skill-run.js +14 -0
- package/packages/tools/host/dist/skill-run.js.map +1 -1
- package/packages/web/dist/assets/index-DnZhfnM7.js +155 -0
- package/packages/web/dist/assets/{lottie_light-twPed1FM.js → lottie_light-CGUtDt_b.js} +1 -1
- package/packages/web/dist/build.json +1 -1
- package/packages/web/dist/index.html +1 -1
- package/packages/web/dist/precache.json +3 -3
- package/packages/web/dist/assets/index-DgpPl0TR.js +0 -155
|
@@ -9,21 +9,23 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
import { fileURLToPath } from 'node:url';
|
|
12
|
-
import { spawn, execFile } from 'node:child_process';
|
|
12
|
+
import { spawn, execFile, execFileSync } from 'node:child_process';
|
|
13
13
|
import { request } from 'node:http';
|
|
14
14
|
import { open, mkdir, writeFile, rm, rename, copyFile, chmod } from 'node:fs/promises';
|
|
15
15
|
import os from 'node:os';
|
|
16
16
|
import { promisify } from 'node:util';
|
|
17
|
-
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
18
|
-
import { environment, identityMismatch, portMovedLines, dashboardReady, launchAgentLabel, launchAgentPlist, reloadLaunchAgent, nativeEnvironment, reloadSystemdUnit, systemdUnitPath, atomicJson, browsersDir, SERVICE_UNIT_VAR } from './environment.js';
|
|
19
|
-
import { briefSupervisorEnv, supervise, supervisorSocket } from './supervisor.js';
|
|
17
|
+
import { existsSync, openSync, readFileSync, realpathSync, writeFileSync, writeSync } from 'node:fs';
|
|
18
|
+
import { environment, lockHolder, identityMismatch, portMovedLines, dashboardReady, launchAgentLabel, launchAgentPlist, reloadLaunchAgent, nativeEnvironment, reloadSystemdUnit, systemdUnitPath, atomicJson, browsersDir, SERVICE_UNIT_VAR } from './environment.js';
|
|
19
|
+
import { NotOurSupervisor, answeredBySupervisor, briefSupervisorEnv, runningOrStarting, supervise, supervisorSocket } from './supervisor.js';
|
|
20
20
|
import { keptPluginDataLine, readKeptPluginData } from './kept-data.js';
|
|
21
21
|
import { readProfileZone, timezoneLine } from './doctor-timezone.js';
|
|
22
22
|
import { installedVersion, readUpgradeState, upgradeDoctorLines, versionView } from './upgrade.js';
|
|
23
|
-
import { APP_RUNNING_LINE, appLayout, insideAppBundle, linuxInstall, runsAppCopy } from './app-layout.js';
|
|
23
|
+
import { APP_RUNNING_LINE, appLayout, insideAppBundle, linuxInstall, runsAppCopy, windowsInstall } from './app-layout.js';
|
|
24
24
|
import { runtimeFacts, runtimeLines } from './runtime-info.js';
|
|
25
25
|
import { commandOwnedBy, desktopEntryPaths, linuxUnitSpec, ownDesktopEntries } from './linux-install.js';
|
|
26
26
|
import { APP_BUNDLE_ID, SHIM_REFUSAL, SHIM_VAR, shimAction, shimDoctorLines, shimRefusesSupervise, shimsFor } from './cli-shim.js';
|
|
27
|
+
import { buildSuperviseScript, buildTaskXml, followLogsCommand, registerWindowsTask, taskXmlBytes, windowsTaskName, windowsTaskScript, windowsTaskXmlFile } from './windows-task.js';
|
|
28
|
+
import { SETUP_DATA_KEY, SETUP_UNINSTALL_VAR, cleanupNodeCopyCommand, regQueryValue, uninstallerIsOurs, insideFolder, readWindowsInstallerRecord, windowsCommandOwnedBy, windowsTaskSpec } from './windows-install.js';
|
|
27
29
|
const entry = fileURLToPath(import.meta.url);
|
|
28
30
|
// <root>/packages/install/dist/launcher.js — the installation root is three up.
|
|
29
31
|
const root = path.resolve(path.dirname(entry), '../../..');
|
|
@@ -59,6 +61,11 @@ async function ask(ctx, method, route, body) {
|
|
|
59
61
|
headers: { host: 'localhost', ...(payload === undefined ? {} : { 'content-type': 'application/json', 'content-length': Buffer.byteLength(payload) }) },
|
|
60
62
|
timeout: 25_000,
|
|
61
63
|
}, res => {
|
|
64
|
+
// Windows: a pipe's name can be listed by anyone; the secret beside it in the data directory cannot.
|
|
65
|
+
if (!answeredBySupervisor(ctx.data, res.headers)) {
|
|
66
|
+
res.resume();
|
|
67
|
+
return reject(new NotOurSupervisor());
|
|
68
|
+
}
|
|
62
69
|
let text = '';
|
|
63
70
|
res.setEncoding('utf8');
|
|
64
71
|
res.on('data', chunk => { text += chunk; });
|
|
@@ -110,12 +117,66 @@ function runsFromApp(status, ctx) {
|
|
|
110
117
|
function isLinuxInstall(ctx) {
|
|
111
118
|
return linuxInstall(process.env) || (process.platform === 'linux' && isAppInstall(ctx));
|
|
112
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Is this the Windows install (the setup, apps/windows)? Its `buddi.cmd` and
|
|
122
|
+
* its task say so; as on Linux, there is no buddi.app on Windows, so a
|
|
123
|
+
* release under `<data>\releases` is the setup's.
|
|
124
|
+
*/
|
|
125
|
+
function isWindowsInstall(ctx) {
|
|
126
|
+
return windowsInstall(process.env) || (process.platform === 'win32' && isAppInstall(ctx));
|
|
127
|
+
}
|
|
113
128
|
function withApp(view, ctx) {
|
|
114
|
-
return isAppInstall(ctx) && !isLinuxInstall(ctx) ? { ...view, app: true } : view;
|
|
129
|
+
return isAppInstall(ctx) && !isLinuxInstall(ctx) && !isWindowsInstall(ctx) ? { ...view, app: true } : view;
|
|
115
130
|
}
|
|
116
131
|
async function control(ctx, action = 'status') {
|
|
117
132
|
return await ask(ctx, action === 'status' ? 'GET' : 'POST', `/${action}`);
|
|
118
133
|
}
|
|
134
|
+
/** The pid `supervisor.lock` names, while that process lives and the lock is of this boot (environment.ts `lockHolder`). */
|
|
135
|
+
function supervisorLockPid(data) {
|
|
136
|
+
return lockHolder(data);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Windows: a postmaster still running on this installation's cluster, its
|
|
140
|
+
* `postmaster.pid` naming a live process. There it can outlive its
|
|
141
|
+
* supervisor for a moment (it is stopped with pg_ctl), and a folder it holds cannot be removed.
|
|
142
|
+
* Elsewhere the supervisor's own exit is the answer, as before.
|
|
143
|
+
*/
|
|
144
|
+
function postmasterLeft(data) {
|
|
145
|
+
if (process.platform !== 'win32')
|
|
146
|
+
return false;
|
|
147
|
+
let pid;
|
|
148
|
+
try {
|
|
149
|
+
pid = Number(readFileSync(path.join(data, 'postgres', 'postmaster.pid'), 'utf8').split('\n')[0].trim());
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
155
|
+
return false;
|
|
156
|
+
try {
|
|
157
|
+
process.kill(pid, 0);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Windows: stop the supervisor the way a signal does elsewhere. A kill there
|
|
166
|
+
* is TerminateProcess, which skips the database's shutdown, so it is asked on
|
|
167
|
+
* its socket and followed until its lock is gone. A refusal (a restore or an
|
|
168
|
+
* upgrade under way) is thrown, never overridden with a kill.
|
|
169
|
+
*/
|
|
170
|
+
async function exitSupervisor(ctx, timeoutMs = 90_000) {
|
|
171
|
+
if (supervisorLockPid(ctx.data) === undefined)
|
|
172
|
+
return;
|
|
173
|
+
await ask(ctx, 'POST', '/exit');
|
|
174
|
+
for (let waited = 0; supervisorLockPid(ctx.data) !== undefined; waited += 250) {
|
|
175
|
+
if (waited >= timeoutMs)
|
|
176
|
+
throw new Error(`the supervisor (pid ${supervisorLockPid(ctx.data)}) did not stop within ${Math.round(timeoutMs / 1000)} seconds`);
|
|
177
|
+
await new Promise(resolve => setTimeout(resolve, 250));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
119
180
|
/** The supervisor's status as the sentence `buddi service status` prints. */
|
|
120
181
|
export function serviceLine(status) {
|
|
121
182
|
const gateway = status.gateway === 'running'
|
|
@@ -183,7 +244,7 @@ async function startSupervisorBriefly(ctx, lockPid) {
|
|
|
183
244
|
const log = await open(path.join(ctx.data, 'logs/supervisor.log'), 'a', 0o600);
|
|
184
245
|
let child;
|
|
185
246
|
try {
|
|
186
|
-
child = spawn(process.execPath, [entry, 'supervise'], { detached: true, stdio: ['ignore', log.fd, log.fd], env: briefSupervisorEnv(ctx.env, process.pid, SHIM_VAR) });
|
|
247
|
+
child = spawn(process.execPath, [entry, 'supervise'], { detached: true, stdio: ['ignore', log.fd, log.fd], env: briefSupervisorEnv(ctx.env, process.pid, SHIM_VAR), windowsHide: true });
|
|
187
248
|
await new Promise((resolve, reject) => { child.once('spawn', resolve); child.once('error', reject); });
|
|
188
249
|
}
|
|
189
250
|
finally {
|
|
@@ -210,10 +271,15 @@ async function startSupervisorBriefly(ctx, lockPid) {
|
|
|
210
271
|
process.removeListener('SIGINT', onInterrupt);
|
|
211
272
|
process.removeListener('SIGTERM', onInterrupt);
|
|
212
273
|
if (!exited && child.pid !== undefined) {
|
|
213
|
-
|
|
214
|
-
|
|
274
|
+
// Windows: SIGTERM is TerminateProcess, which would skip the database's shutdown.
|
|
275
|
+
if (process.platform === 'win32')
|
|
276
|
+
await ask(ctx, 'POST', '/exit').catch(() => { });
|
|
277
|
+
else {
|
|
278
|
+
try {
|
|
279
|
+
process.kill(child.pid, 'SIGTERM');
|
|
280
|
+
}
|
|
281
|
+
catch { /* gone */ }
|
|
215
282
|
}
|
|
216
|
-
catch { /* gone */ }
|
|
217
283
|
}
|
|
218
284
|
const alive = () => { if (exited || child.pid === undefined)
|
|
219
285
|
return false; try {
|
|
@@ -223,7 +289,7 @@ async function startSupervisorBriefly(ctx, lockPid) {
|
|
|
223
289
|
catch {
|
|
224
290
|
return false;
|
|
225
291
|
} };
|
|
226
|
-
for (let waited = 0; lockPid() !== undefined || alive(); waited += 250) {
|
|
292
|
+
for (let waited = 0; lockPid() !== undefined || alive() || postmasterLeft(ctx.data); waited += 250) {
|
|
227
293
|
if (waited >= 60_000)
|
|
228
294
|
throw new Error(`the database started for the last backup did not stop within a minute (supervisor pid ${child.pid})`);
|
|
229
295
|
await new Promise(resolve => setTimeout(resolve, 250));
|
|
@@ -276,6 +342,41 @@ function linuxInstallParts(ctx, home) {
|
|
|
276
342
|
} }),
|
|
277
343
|
};
|
|
278
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* What the Windows setup put where: `installer.json` (written by its
|
|
347
|
+
* windows-setup.ts) names `buddi.cmd` and the setup's uninstaller; the command
|
|
348
|
+
* is removed only while it still runs this data folder.
|
|
349
|
+
*/
|
|
350
|
+
function windowsInstallParts(ctx) {
|
|
351
|
+
const recorded = readWindowsInstallerRecord((() => { try {
|
|
352
|
+
return readFileSync(path.join(ctx.data, 'installer.json'), 'utf8');
|
|
353
|
+
}
|
|
354
|
+
catch {
|
|
355
|
+
return undefined;
|
|
356
|
+
} })());
|
|
357
|
+
const command = recorded.command;
|
|
358
|
+
const owned = () => command !== undefined && windowsCommandOwnedBy((() => { try {
|
|
359
|
+
return readFileSync(command, 'utf8');
|
|
360
|
+
}
|
|
361
|
+
catch {
|
|
362
|
+
return undefined;
|
|
363
|
+
} })(), ctx.data, realpathSync);
|
|
364
|
+
// The setup's one registration serves one data folder: started for another, it would remove that one.
|
|
365
|
+
const registered = (() => { try {
|
|
366
|
+
return regQueryValue(execFileSync('reg.exe', ['query', SETUP_DATA_KEY, '/v', 'DataDir'], { encoding: 'utf8', windowsHide: true }), 'DataDir');
|
|
367
|
+
}
|
|
368
|
+
catch {
|
|
369
|
+
return undefined;
|
|
370
|
+
} })();
|
|
371
|
+
const uninstaller = recorded.uninstaller !== undefined && existsSync(recorded.uninstaller) && uninstallerIsOurs(registered, ctx.data) ? recorded.uninstaller : undefined;
|
|
372
|
+
return {
|
|
373
|
+
runtime: path.join(ctx.data, 'node'),
|
|
374
|
+
releases: appLayout(process.env) ?? path.join(ctx.data, 'releases'),
|
|
375
|
+
...(command !== undefined && owned() ? { command, commandOwned: owned } : {}),
|
|
376
|
+
// Run from the setup's own uninstaller, which removes its entry itself afterwards.
|
|
377
|
+
...(uninstaller !== undefined && (process.env[SETUP_UNINSTALL_VAR] ?? '').trim() !== '1' ? { uninstaller } : {}),
|
|
378
|
+
};
|
|
379
|
+
}
|
|
279
380
|
/**
|
|
280
381
|
* `buddi uninstall`, in a packaged installation. The order and the refusals
|
|
281
382
|
* are in `uninstall.ts`; this wires them to the real machine: the supervisor's
|
|
@@ -295,24 +396,7 @@ async function uninstall(ctx, rest) {
|
|
|
295
396
|
const { purgeKeychain, clearTelegramMenu } = await import('@buddi/core/uninstall');
|
|
296
397
|
const { dashboardAppOwnedBy } = await import('@buddi/cli');
|
|
297
398
|
const home = os.homedir();
|
|
298
|
-
const lockPid = () =>
|
|
299
|
-
let pid;
|
|
300
|
-
try {
|
|
301
|
-
pid = Number(readFileSync(path.join(ctx.data, 'supervisor.lock'), 'utf8').trim());
|
|
302
|
-
}
|
|
303
|
-
catch {
|
|
304
|
-
return undefined;
|
|
305
|
-
}
|
|
306
|
-
if (!Number.isInteger(pid) || pid <= 0)
|
|
307
|
-
return undefined;
|
|
308
|
-
try {
|
|
309
|
-
process.kill(pid, 0);
|
|
310
|
-
return pid;
|
|
311
|
-
}
|
|
312
|
-
catch {
|
|
313
|
-
return undefined;
|
|
314
|
-
}
|
|
315
|
-
};
|
|
399
|
+
const lockPid = () => supervisorLockPid(ctx.data);
|
|
316
400
|
const service = ctx.env.BUDDI_VAULT_SERVICE ?? 'buddi';
|
|
317
401
|
const vault = (() => { try {
|
|
318
402
|
return core.createVault({ env: ctx.env });
|
|
@@ -324,11 +408,36 @@ async function uninstall(ctx, rest) {
|
|
|
324
408
|
const token = stored ?? (ctx.env.TELEGRAM_BOT_TOKEN?.startsWith('<') ? undefined : ctx.env.TELEGRAM_BOT_TOKEN?.trim() || undefined);
|
|
325
409
|
const app = dashboardAppOwnedBy(path.join(root, 'packages/cli/dist/main.js'), home);
|
|
326
410
|
const linuxParts = isLinuxInstall(ctx) ? linuxInstallParts(ctx, home) : undefined;
|
|
411
|
+
const windowsParts = isWindowsInstall(ctx) ? windowsInstallParts(ctx) : undefined;
|
|
412
|
+
if (windowsParts !== undefined && insideFolder(process.execPath, ctx.data)) {
|
|
413
|
+
// buddi.cmd, the dashboard and the setup's uninstaller run a copy of node from TEMP for this.
|
|
414
|
+
console.error(`buddi: this node runs from inside ${ctx.data}, which Windows will not remove while it runs. Run buddi uninstall from a new Command Prompt (buddi.cmd runs it from a copy), or remove buddi in Settings → Apps. Nothing was removed.`);
|
|
415
|
+
return 1;
|
|
416
|
+
}
|
|
417
|
+
// The copy of node this runs from (see above) goes once it has exited.
|
|
418
|
+
if (process.platform === 'win32') {
|
|
419
|
+
const cleanup = cleanupNodeCopyCommand(process.execPath, ctx.env.SystemRoot ?? ctx.env.SYSTEMROOT ?? 'C:\\Windows');
|
|
420
|
+
if (cleanup !== undefined)
|
|
421
|
+
process.once('exit', () => { try {
|
|
422
|
+
writeFileSync(cleanup.script.file, cleanup.script.text);
|
|
423
|
+
spawn(cleanup.command, cleanup.args, { detached: true, stdio: 'ignore', windowsHide: true, env: { ...process.env, ...cleanup.env }, cwd: os.homedir() }).unref();
|
|
424
|
+
}
|
|
425
|
+
catch { /* TEMP is cleaned by Windows too */ } });
|
|
426
|
+
}
|
|
327
427
|
return await uninstallPackaged(options, {
|
|
328
428
|
...(linuxParts === undefined ? {} : { linuxInstall: linuxParts }),
|
|
429
|
+
...(windowsParts === undefined ? {} : { windowsInstall: windowsParts }),
|
|
329
430
|
data: ctx.data, home, platform: process.platform, env: ctx.env, uid: process.getuid?.() ?? 501,
|
|
330
431
|
exists: existsSync,
|
|
331
|
-
|
|
432
|
+
launch: async (command, argv) => {
|
|
433
|
+
await new Promise((resolve, reject) => {
|
|
434
|
+
const child = spawn(command, argv, { detached: true, stdio: 'ignore', windowsHide: true, cwd: home });
|
|
435
|
+
child.once('error', reject);
|
|
436
|
+
child.once('spawn', () => { child.unref(); resolve(); });
|
|
437
|
+
});
|
|
438
|
+
},
|
|
439
|
+
// Retried: on Windows a process that just exited can hold a folder for a moment (EBUSY).
|
|
440
|
+
remove: file => rm(file, { recursive: true, force: true, maxRetries: 10, retryDelay: 250 }),
|
|
332
441
|
move: async (from, to) => {
|
|
333
442
|
await mkdir(path.dirname(to), { recursive: true, mode: 0o700 });
|
|
334
443
|
try {
|
|
@@ -340,7 +449,7 @@ async function uninstall(ctx, rest) {
|
|
|
340
449
|
}
|
|
341
450
|
},
|
|
342
451
|
exec: (command, argv) => new Promise(resolve => {
|
|
343
|
-
execFile(command, argv, { env: { ...nativeEnvironment(ctx.env), ...systemdSession(ctx.env) } }, (error, stdout, stderr) => {
|
|
452
|
+
execFile(command, argv, { env: { ...nativeEnvironment(ctx.env), ...systemdSession(ctx.env) }, windowsHide: true }, (error, stdout, stderr) => {
|
|
344
453
|
const code = error?.code;
|
|
345
454
|
resolve({ code: error ? (typeof code === 'number' ? code : 1) : 0, stdout: String(stdout), stderr: error && typeof code !== 'number' ? error.message : String(stderr) });
|
|
346
455
|
});
|
|
@@ -353,7 +462,7 @@ async function uninstall(ctx, rest) {
|
|
|
353
462
|
},
|
|
354
463
|
// Run by buddi.app itself (its uninstall route), the app is already on its way out: nothing to say about it.
|
|
355
464
|
buddiApp: async () => {
|
|
356
|
-
if (appLayout(process.env) !== undefined || isLinuxInstall(ctx))
|
|
465
|
+
if (appLayout(process.env) !== undefined || isLinuxInstall(ctx) || isWindowsInstall(ctx))
|
|
357
466
|
return undefined;
|
|
358
467
|
const status = await control(ctx).catch(() => undefined);
|
|
359
468
|
if (status !== undefined && runsFromApp(status, ctx))
|
|
@@ -376,10 +485,20 @@ async function uninstall(ctx, rest) {
|
|
|
376
485
|
return existsSync(file) ? JSON.parse(readFileSync(file, 'utf8')) : undefined;
|
|
377
486
|
},
|
|
378
487
|
supervisorPid: lockPid,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
488
|
+
// Windows: a kill is TerminateProcess, which would skip the database's
|
|
489
|
+
// shutdown; the supervisor is asked on its socket instead, and a refusal
|
|
490
|
+
// (a restore or an upgrade under way) stops the uninstall, not the supervisor.
|
|
491
|
+
signal: async (pid, signal) => {
|
|
492
|
+
if (process.platform === 'win32' && pid === lockPid()) {
|
|
493
|
+
await exitSupervisor(ctx);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
try {
|
|
497
|
+
process.kill(pid, signal);
|
|
498
|
+
}
|
|
499
|
+
catch { /* gone already */ }
|
|
500
|
+
},
|
|
501
|
+
postmasterLeft: () => postmasterLeft(ctx.data),
|
|
383
502
|
...(core.vaultSelection({ env: ctx.env }) === 'keychain' ? {
|
|
384
503
|
keychain: {
|
|
385
504
|
service,
|
|
@@ -698,11 +817,52 @@ async function launchService(ctx, temporary) {
|
|
|
698
817
|
console.log(`Background service: systemd user unit ${label}${lingering ? '' : ` (survives logout only after: loginctl enable-linger ${ctx.env.USER ?? '$USER'})`}`);
|
|
699
818
|
return;
|
|
700
819
|
}
|
|
820
|
+
if (!temporary && process.platform === 'win32') {
|
|
821
|
+
/*
|
|
822
|
+
* A Task Scheduler task of the owner's (windows-task.ts): started now, and
|
|
823
|
+
* at every logon from then on. Its script carries what the plist's
|
|
824
|
+
* environment carries on a Mac.
|
|
825
|
+
*/
|
|
826
|
+
const label = launchAgentLabel(ctx.data);
|
|
827
|
+
const script = windowsTaskScript(ctx.data);
|
|
828
|
+
await mkdir(path.dirname(script), { recursive: true, mode: 0o700 });
|
|
829
|
+
/*
|
|
830
|
+
* The Windows install runs `<data>\releases\current` with its bundled
|
|
831
|
+
* node, named through the junction: an upgrade switches it, and the task
|
|
832
|
+
* runs the new release at the next sign-in without being written again.
|
|
833
|
+
*/
|
|
834
|
+
const logs = { [SUPERVISOR_LOG_VAR]: path.join(ctx.data, 'logs', 'supervisor.log') };
|
|
835
|
+
const spec = isWindowsInstall(ctx)
|
|
836
|
+
? windowsTaskSpec({ data: ctx.data, label, exists: existsSync, extra: { ...logs, ...serviceEnvironment() } })
|
|
837
|
+
: { nodePath: process.execPath, entry, environment: { BUDDI_DATA_DIR: ctx.data, ...logs, ...serviceEnvironment() } };
|
|
838
|
+
await writeFile(script, buildSuperviseScript({
|
|
839
|
+
...spec,
|
|
840
|
+
// What the supervisor says before it opens its log (a node that will not start).
|
|
841
|
+
logFile: path.join(ctx.data, 'logs', 'service.log'),
|
|
842
|
+
}), { mode: 0o600 });
|
|
843
|
+
const user = [ctx.env.USERDOMAIN, ctx.env.USERNAME ?? os.userInfo().username].filter(Boolean).join('\\');
|
|
844
|
+
await writeFile(windowsTaskXmlFile(ctx.data), taskXmlBytes(buildTaskXml({
|
|
845
|
+
// Not the data directory: Windows will not remove a folder a process runs in, and uninstall removes it.
|
|
846
|
+
user, script, workingDirectory: os.homedir(), systemRoot: ctx.env.SystemRoot ?? ctx.env.SYSTEMROOT ?? 'C:\\Windows',
|
|
847
|
+
})), { mode: 0o600 });
|
|
848
|
+
// A running supervisor stops on its socket first (its database cleanly);
|
|
849
|
+
// the task's /End below would be TerminateProcess.
|
|
850
|
+
await exitSupervisor(ctx).catch((error) => { throw new Error(`The running service could not be stopped to restart it: ${error.message}.`); });
|
|
851
|
+
try {
|
|
852
|
+
await registerWindowsTask((cmd, argv) => exec(cmd, argv, { env: nativeEnvironment(ctx.env), windowsHide: true }), windowsTaskName(label), windowsTaskXmlFile(ctx.data));
|
|
853
|
+
}
|
|
854
|
+
catch (error) {
|
|
855
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
856
|
+
throw new Error(`Task Scheduler could not start the service (${detail.trim()}). Run buddi --no-service to start it in this window instead.`);
|
|
857
|
+
}
|
|
858
|
+
console.log(`Background service: Task Scheduler task ${windowsTaskName(label)} (starts at sign-in)`);
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
701
861
|
if (!temporary && process.platform !== 'darwin')
|
|
702
|
-
throw new Error('Background installation runs under launchd (macOS)
|
|
862
|
+
throw new Error('Background installation runs under launchd (macOS), systemd (Linux) or Task Scheduler (Windows). Use buddi --no-service or buddi supervise on this platform.');
|
|
703
863
|
const log = await open(path.join(ctx.data, 'logs/supervisor.log'), 'a', 0o600);
|
|
704
864
|
try {
|
|
705
|
-
const child = spawn(process.execPath, [entry, 'supervise'], { detached: true, stdio: ['ignore', log.fd, log.fd], env: ctx.env });
|
|
865
|
+
const child = spawn(process.execPath, [entry, 'supervise'], { detached: true, stdio: ['ignore', log.fd, log.fd], env: ctx.env, windowsHide: true });
|
|
706
866
|
await new Promise((resolve, reject) => { child.once('spawn', resolve); child.once('error', reject); });
|
|
707
867
|
child.unref();
|
|
708
868
|
}
|
|
@@ -710,6 +870,27 @@ async function launchService(ctx, temporary) {
|
|
|
710
870
|
await log.close();
|
|
711
871
|
}
|
|
712
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* Where a supervisor started by the Windows task writes its output
|
|
875
|
+
* (windows-task.ts). The task's own redirection would hold the log open
|
|
876
|
+
* without letting another process append, and an upgrade's successor appends
|
|
877
|
+
* to the same file; so the supervisor opens it itself, as node opens files,
|
|
878
|
+
* shared.
|
|
879
|
+
*/
|
|
880
|
+
const SUPERVISOR_LOG_VAR = 'BUDDI_SUPERVISOR_LOG';
|
|
881
|
+
function appendOutputTo(file) {
|
|
882
|
+
const fd = openSync(file, 'a', 0o600);
|
|
883
|
+
for (const stream of [process.stdout, process.stderr]) {
|
|
884
|
+
stream.write = ((chunk, encoding, done) => {
|
|
885
|
+
try {
|
|
886
|
+
writeSync(fd, typeof chunk === 'string' ? Buffer.from(chunk, typeof encoding === 'string' ? encoding : 'utf8') : chunk);
|
|
887
|
+
}
|
|
888
|
+
catch { /* a log that cannot be written is not a reason to stop */ }
|
|
889
|
+
(typeof encoding === 'function' ? encoding : done)?.();
|
|
890
|
+
return true;
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
}
|
|
713
894
|
async function run() {
|
|
714
895
|
let ctx = await environment(root);
|
|
715
896
|
// A supervisor started through buddi.app's command line tool would compete with the app's own (cli-shim.ts).
|
|
@@ -718,13 +899,22 @@ async function run() {
|
|
|
718
899
|
process.exitCode = 2;
|
|
719
900
|
return;
|
|
720
901
|
}
|
|
721
|
-
if (args[0] === 'supervise')
|
|
902
|
+
if (args[0] === 'supervise') {
|
|
903
|
+
const logFile = (process.env[SUPERVISOR_LOG_VAR] ?? '').trim();
|
|
904
|
+
if (logFile !== '')
|
|
905
|
+
appendOutputTo(logFile);
|
|
722
906
|
return supervise(ctx);
|
|
907
|
+
}
|
|
723
908
|
if (args[0] === '__gateway') {
|
|
724
909
|
// Parent death must not leave two gateways claiming jobs on the next boot.
|
|
725
910
|
if (!process.send)
|
|
726
911
|
throw new Error('The gateway child must be started by buddi supervise.');
|
|
727
|
-
|
|
912
|
+
// On Windows a kill is TerminateProcess, so the gateway's SIGTERM handler
|
|
913
|
+
// is run directly: it is also how the supervisor stops it there (stopChild).
|
|
914
|
+
const parentGone = () => { if (process.platform === 'win32')
|
|
915
|
+
process.emit('SIGTERM', 'SIGTERM');
|
|
916
|
+
else
|
|
917
|
+
process.kill(process.pid, 'SIGTERM'); };
|
|
728
918
|
process.once('disconnect', parentGone);
|
|
729
919
|
const gateway = await import('@buddi/gateway');
|
|
730
920
|
try {
|
|
@@ -811,9 +1001,14 @@ async function run() {
|
|
|
811
1001
|
process.exitCode = 1;
|
|
812
1002
|
return;
|
|
813
1003
|
}
|
|
814
|
-
|
|
1004
|
+
const windows = process.platform === 'win32';
|
|
1005
|
+
console.log(`${windows ? 'Following' : 'tail -F'} ${logs.join(' ')} (Ctrl-C to stop)`);
|
|
815
1006
|
await new Promise(resolve => {
|
|
816
|
-
|
|
1007
|
+
// Windows has no tail: a PowerShell loop follows the same files (windows-task.ts).
|
|
1008
|
+
const follow = windows ? followLogsCommand(logs) : undefined;
|
|
1009
|
+
const child = follow !== undefined
|
|
1010
|
+
? spawn('powershell.exe', follow.args, { stdio: 'inherit', env: { ...process.env, ...follow.env } })
|
|
1011
|
+
: spawn('tail', ['-n', '80', '-F', ...logs], { stdio: 'inherit' });
|
|
817
1012
|
child.once('exit', () => resolve());
|
|
818
1013
|
child.once('error', err => { console.error(`buddi: could not follow the log: ${err.message}`); resolve(); });
|
|
819
1014
|
});
|
|
@@ -829,9 +1024,10 @@ async function run() {
|
|
|
829
1024
|
} })();
|
|
830
1025
|
console.log(`This buddi: ${invoked} (Node ${process.execPath})`);
|
|
831
1026
|
const linux = isLinuxInstall(ctx);
|
|
832
|
-
|
|
1027
|
+
const windows = isWindowsInstall(ctx);
|
|
1028
|
+
console.log(`From: ${insideAppBundle(root) ? `buddi.app (${root.slice(0, root.indexOf('.app/') + 4)})` : linux ? `the Linux install (${root})` : windows ? `the Windows install (${root})` : root.startsWith(path.join(ctx.data, 'releases') + path.sep) ? `an update buddi.app installed (${root})` : `npm (${root})`}`);
|
|
833
1029
|
// Which Node and which npm: the bundled runtime, or the machine's (roadmap: no dependence on a host Node).
|
|
834
|
-
for (const line of runtimeLines(await runtimeFacts(), insideAppBundle(process.execPath) ? 'buddi.app' : linux ? 'the Linux install' : 'this installation'))
|
|
1030
|
+
for (const line of runtimeLines(await runtimeFacts(), insideAppBundle(process.execPath) ? 'buddi.app' : linux ? 'the Linux install' : windows ? 'the Windows install' : 'this installation'))
|
|
835
1031
|
console.log(line);
|
|
836
1032
|
for (const line of shimDoctorLines({ home: os.homedir(), exists: existsSync, read: file => { try {
|
|
837
1033
|
return readFileSync(file, 'utf8');
|
|
@@ -862,7 +1058,7 @@ async function run() {
|
|
|
862
1058
|
* looking at a supervisor that is barely up. The file is the record.
|
|
863
1059
|
*/
|
|
864
1060
|
const state = await readUpgradeState(ctx.data, await installedVersion(root));
|
|
865
|
-
for (const line of upgradeDoctorLines(withApp(versionView(state), ctx), ctx.state?.phase, { linux }))
|
|
1061
|
+
for (const line of upgradeDoctorLines(withApp(versionView(state), ctx), ctx.state?.phase, { linux, windows }))
|
|
866
1062
|
console.log(line);
|
|
867
1063
|
console.log(`Logs: ${path.join(ctx.data, 'logs')}`);
|
|
868
1064
|
return;
|
|
@@ -934,7 +1130,7 @@ async function run() {
|
|
|
934
1130
|
* (a foreground `buddi supervise`) the owner is told to restart it.
|
|
935
1131
|
*/
|
|
936
1132
|
if (ctx.state !== undefined && askedWebPort !== undefined && askedWebPort !== ctx.state.webPort) {
|
|
937
|
-
const serviced = process.platform === 'darwin' ? existsSync(launchAgentPlist(ctx.data)) : process.platform === 'linux' ? existsSync(systemdUnitPath(ctx.data, ctx.env)) : false;
|
|
1133
|
+
const serviced = process.platform === 'darwin' ? existsSync(launchAgentPlist(ctx.data)) : process.platform === 'linux' ? existsSync(systemdUnitPath(ctx.data, ctx.env)) : process.platform === 'win32' ? existsSync(windowsTaskScript(ctx.data)) : false;
|
|
938
1134
|
if (!serviced)
|
|
939
1135
|
throw new Error(`The dashboard port is ${ctx.state.webPort}. To move it to ${askedWebPort}, stop the running supervisor, change "webPort" in ${path.join(ctx.data, 'installation.json')}, and start it again.`);
|
|
940
1136
|
const from = ctx.state.webPort;
|
|
@@ -945,11 +1141,13 @@ async function run() {
|
|
|
945
1141
|
relaunched = true;
|
|
946
1142
|
}
|
|
947
1143
|
else {
|
|
948
|
-
|
|
949
|
-
|
|
1144
|
+
// A missing supervisor is normal on first run; one that holds the lock is
|
|
1145
|
+
// waited for, and if it never answers that is said, not restarted over.
|
|
1146
|
+
const status = await runningOrStarting(() => control(ctx), () => supervisorLockPid(ctx.data));
|
|
1147
|
+
if (status !== undefined) {
|
|
950
1148
|
if (status.installRoot === root && status.nodePath === process.execPath) {
|
|
951
1149
|
if (status.gateway === 'stopped')
|
|
952
|
-
await control(ctx, 'start');
|
|
1150
|
+
await control(ctx, 'start').catch(() => undefined);
|
|
953
1151
|
running = true;
|
|
954
1152
|
}
|
|
955
1153
|
else if (runsFromApp(status, ctx) && (!isAppInstall(ctx) || viaShim)) {
|
|
@@ -958,7 +1156,6 @@ async function run() {
|
|
|
958
1156
|
running = true;
|
|
959
1157
|
}
|
|
960
1158
|
}
|
|
961
|
-
catch { /* A missing supervisor is normal on first run. */ }
|
|
962
1159
|
}
|
|
963
1160
|
// The shim never installs a service beside buddi.app (it opened the app above).
|
|
964
1161
|
if (!running && viaShim)
|
|
@@ -1020,6 +1217,16 @@ async function run() {
|
|
|
1020
1217
|
console.log(gateway.browserLine(found));
|
|
1021
1218
|
if (!args.includes('--no-open') && process.platform === 'darwin')
|
|
1022
1219
|
await exec('open', [url], { env: nativeEnvironment(ctx.env) });
|
|
1220
|
+
// Windows: the default browser, through the URL handler (no shell, so the link's `&` stays the link's).
|
|
1221
|
+
if (!args.includes('--no-open') && process.platform === 'win32') {
|
|
1222
|
+
const opened = await new Promise(resolve => {
|
|
1223
|
+
const child = spawn('rundll32.exe', ['url.dll,FileProtocolHandler', url], { detached: true, stdio: 'ignore', env: nativeEnvironment(process.env), windowsHide: true });
|
|
1224
|
+
child.once('error', () => resolve(false));
|
|
1225
|
+
child.once('spawn', () => { child.unref(); resolve(true); });
|
|
1226
|
+
});
|
|
1227
|
+
if (opened)
|
|
1228
|
+
console.log('Opened it in your browser.');
|
|
1229
|
+
}
|
|
1023
1230
|
/*
|
|
1024
1231
|
* On a Linux desktop the link opens in the owner's browser, as `open` does
|
|
1025
1232
|
* on a Mac: only from a graphical session (a terminal on the desktop has
|