@nextclaw/service 0.2.13 → 0.2.14
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/dist/app/nextclaw-service-runtime.d.ts +41 -0
- package/dist/app/nextclaw-service-runtime.d.ts.map +1 -0
- package/dist/app/nextclaw-service-runtime.js +136 -0
- package/dist/app/nextclaw-service-runtime.js.map +1 -0
- package/dist/controllers/commands/agent-command.controller.d.ts +3 -0
- package/dist/controllers/commands/agent-command.controller.js +3 -0
- package/dist/controllers/commands/channel-command.controller.d.ts +21 -0
- package/dist/controllers/commands/channel-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/channel-command.controller.js +115 -0
- package/dist/controllers/commands/channel-command.controller.js.map +1 -0
- package/dist/controllers/commands/config-command.controller.d.ts +2 -0
- package/dist/controllers/commands/config-command.controller.js +2 -0
- package/dist/controllers/commands/cron-command.controller.d.ts +2 -0
- package/dist/controllers/commands/cron-command.controller.js +2 -0
- package/dist/controllers/commands/diagnostics-command.controller.d.ts +2 -0
- package/dist/controllers/commands/diagnostics-command.controller.js +2 -0
- package/dist/controllers/commands/gateway-command.controller.d.ts +15 -0
- package/dist/controllers/commands/gateway-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/gateway-command.controller.js +17 -0
- package/dist/controllers/commands/gateway-command.controller.js.map +1 -0
- package/dist/controllers/commands/logs-command.controller.d.ts +13 -0
- package/dist/controllers/commands/logs-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/logs-command.controller.js +31 -0
- package/dist/controllers/commands/logs-command.controller.js.map +1 -0
- package/dist/controllers/commands/marketplace-skill-command.controller.d.ts +28 -0
- package/dist/controllers/commands/marketplace-skill-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/marketplace-skill-command.controller.js +170 -0
- package/dist/controllers/commands/marketplace-skill-command.controller.js.map +1 -0
- package/dist/controllers/commands/mcp-command.controller.d.ts +15 -0
- package/dist/controllers/commands/mcp-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/mcp-command.controller.js +195 -0
- package/dist/controllers/commands/mcp-command.controller.js.map +1 -0
- package/dist/controllers/commands/platform-auth-command.controller.d.ts +2 -0
- package/dist/controllers/commands/platform-auth-command.controller.js +2 -0
- package/dist/controllers/commands/remote-command.controller.d.ts +48 -0
- package/dist/controllers/commands/remote-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/remote-command.controller.js +176 -0
- package/dist/controllers/commands/remote-command.controller.js.map +1 -0
- package/dist/controllers/commands/restart-command.controller.d.ts +21 -0
- package/dist/controllers/commands/restart-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/restart-command.controller.js +90 -0
- package/dist/controllers/commands/restart-command.controller.js.map +1 -0
- package/dist/controllers/commands/secrets-command.controller.d.ts +23 -0
- package/dist/controllers/commands/secrets-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/secrets-command.controller.js +282 -0
- package/dist/controllers/commands/secrets-command.controller.js.map +1 -0
- package/dist/controllers/commands/serve-command.controller.d.ts +15 -0
- package/dist/controllers/commands/serve-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/serve-command.controller.js +21 -0
- package/dist/controllers/commands/serve-command.controller.js.map +1 -0
- package/dist/controllers/commands/service-command.controller.d.ts +17 -0
- package/dist/controllers/commands/service-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/service-command.controller.js +33 -0
- package/dist/controllers/commands/service-command.controller.js.map +1 -0
- package/dist/controllers/commands/start-command.controller.d.ts +19 -0
- package/dist/controllers/commands/start-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/start-command.controller.js +27 -0
- package/dist/controllers/commands/start-command.controller.js.map +1 -0
- package/dist/controllers/commands/stop-command.controller.d.ts +13 -0
- package/dist/controllers/commands/stop-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/stop-command.controller.js +13 -0
- package/dist/controllers/commands/stop-command.controller.js.map +1 -0
- package/dist/controllers/commands/ui-command.controller.d.ts +15 -0
- package/dist/controllers/commands/ui-command.controller.d.ts.map +1 -0
- package/dist/controllers/commands/ui-command.controller.js +19 -0
- package/dist/controllers/commands/ui-command.controller.js.map +1 -0
- package/dist/controllers/commands/usage-command.controller.d.ts +2 -0
- package/dist/controllers/commands/usage-command.controller.js +2 -0
- package/dist/controllers/gateway.controller.d.ts +54 -0
- package/dist/controllers/gateway.controller.d.ts.map +1 -0
- package/dist/controllers/gateway.controller.js +162 -0
- package/dist/controllers/gateway.controller.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/launcher/npm-runtime-launcher.service.d.ts +1 -1
- package/dist/launcher/npm-runtime-launcher.service.js +6 -6
- package/dist/launcher/npm-runtime-launcher.service.js.map +1 -1
- package/dist/managers/gateway-extension.manager.d.ts +29 -0
- package/dist/managers/gateway-extension.manager.d.ts.map +1 -0
- package/dist/managers/gateway-extension.manager.js +78 -0
- package/dist/managers/gateway-extension.manager.js.map +1 -0
- package/dist/managers/gateway-remote.manager.d.ts +23 -0
- package/dist/managers/gateway-remote.manager.d.ts.map +1 -0
- package/dist/managers/gateway-remote.manager.js +28 -0
- package/dist/managers/gateway-remote.manager.js.map +1 -0
- package/dist/managers/managed-service.manager.d.ts +42 -0
- package/dist/managers/managed-service.manager.d.ts.map +1 -0
- package/dist/managers/managed-service.manager.js +195 -0
- package/dist/managers/managed-service.manager.js.map +1 -0
- package/dist/managers/runtime-update.manager.d.ts +43 -0
- package/dist/managers/runtime-update.manager.d.ts.map +1 -0
- package/dist/managers/runtime-update.manager.js +185 -0
- package/dist/managers/runtime-update.manager.js.map +1 -0
- package/dist/managers/service-command.manager.d.ts +67 -0
- package/dist/managers/service-command.manager.d.ts.map +1 -0
- package/dist/managers/service-command.manager.js +94 -0
- package/dist/managers/service-command.manager.js.map +1 -0
- package/dist/managers/service-gateway.manager.d.ts +85 -0
- package/dist/managers/service-gateway.manager.d.ts.map +1 -0
- package/dist/managers/service-gateway.manager.js +278 -0
- package/dist/managers/service-gateway.manager.js.map +1 -0
- package/dist/managers/service-restart.manager.d.ts +22 -0
- package/dist/managers/service-restart.manager.d.ts.map +1 -0
- package/dist/managers/service-restart.manager.js +183 -0
- package/dist/managers/service-restart.manager.js.map +1 -0
- package/dist/managers/service-workspace.manager.d.ts +14 -0
- package/dist/managers/service-workspace.manager.d.ts.map +1 -0
- package/dist/managers/service-workspace.manager.js +86 -0
- package/dist/managers/service-workspace.manager.js.map +1 -0
- package/dist/services/agent/agent-commands.service.d.ts +17 -0
- package/dist/services/agent/agent-commands.service.d.ts.map +1 -0
- package/dist/services/agent/agent-commands.service.js +111 -0
- package/dist/services/agent/agent-commands.service.js.map +1 -0
- package/dist/services/autostart/host-autostart-command.service.d.ts +30 -0
- package/dist/services/autostart/host-autostart-command.service.d.ts.map +1 -0
- package/dist/services/autostart/host-autostart-command.service.js +160 -0
- package/dist/services/autostart/host-autostart-command.service.js.map +1 -0
- package/dist/services/autostart/host-autostart-runtime.service.d.ts +24 -0
- package/dist/services/autostart/host-autostart-runtime.service.d.ts.map +1 -0
- package/dist/services/autostart/host-autostart-runtime.service.js +55 -0
- package/dist/services/autostart/host-autostart-runtime.service.js.map +1 -0
- package/dist/services/autostart/host-autostart.service.d.ts +42 -0
- package/dist/services/autostart/host-autostart.service.d.ts.map +1 -0
- package/dist/services/autostart/host-autostart.service.js +50 -0
- package/dist/services/autostart/host-autostart.service.js.map +1 -0
- package/dist/services/autostart/linux-systemd-autostart.service.d.ts +49 -0
- package/dist/services/autostart/linux-systemd-autostart.service.d.ts.map +1 -0
- package/dist/services/autostart/linux-systemd-autostart.service.js +435 -0
- package/dist/services/autostart/linux-systemd-autostart.service.js.map +1 -0
- package/dist/services/autostart/macos-launch-agent-autostart.service.d.ts +55 -0
- package/dist/services/autostart/macos-launch-agent-autostart.service.d.ts.map +1 -0
- package/dist/services/autostart/macos-launch-agent-autostart.service.js +407 -0
- package/dist/services/autostart/macos-launch-agent-autostart.service.js.map +1 -0
- package/dist/services/autostart/windows-task-autostart.service.d.ts +55 -0
- package/dist/services/autostart/windows-task-autostart.service.d.ts.map +1 -0
- package/dist/services/autostart/windows-task-autostart.service.js +406 -0
- package/dist/services/autostart/windows-task-autostart.service.js.map +1 -0
- package/dist/services/channel/channel-list-view.service.d.ts +29 -0
- package/dist/services/channel/channel-list-view.service.d.ts.map +1 -0
- package/dist/services/channel/channel-list-view.service.js +53 -0
- package/dist/services/channel/channel-list-view.service.js.map +1 -0
- package/dist/services/config/config-commands.service.d.ts +17 -0
- package/dist/services/config/config-commands.service.d.ts.map +1 -0
- package/dist/services/config/config-commands.service.js +117 -0
- package/dist/services/config/config-commands.service.js.map +1 -0
- package/dist/services/cron/cron-commands.service.d.ts +23 -0
- package/dist/services/cron/cron-commands.service.d.ts.map +1 -0
- package/dist/services/cron/cron-commands.service.js +109 -0
- package/dist/services/cron/cron-commands.service.js.map +1 -0
- package/dist/services/cron/cron-local.service.d.ts +26 -0
- package/dist/services/cron/cron-local.service.d.ts.map +1 -0
- package/dist/services/cron/cron-local.service.js +89 -0
- package/dist/services/cron/cron-local.service.js.map +1 -0
- package/dist/services/diagnostics/diagnostics-commands.service.d.ts +25 -0
- package/dist/services/diagnostics/diagnostics-commands.service.d.ts.map +1 -0
- package/dist/services/diagnostics/diagnostics-commands.service.js +345 -0
- package/dist/services/diagnostics/diagnostics-commands.service.js.map +1 -0
- package/dist/services/gateway/gateway-restart-wake.service.d.ts +13 -0
- package/dist/services/gateway/gateway-restart-wake.service.d.ts.map +1 -0
- package/dist/services/gateway/gateway-restart-wake.service.js +99 -0
- package/dist/services/gateway/gateway-restart-wake.service.js.map +1 -0
- package/dist/services/gateway/nextclaw-app.service.d.ts +18 -0
- package/dist/services/gateway/nextclaw-app.service.d.ts.map +1 -0
- package/dist/services/gateway/nextclaw-app.service.js +44 -0
- package/dist/services/gateway/nextclaw-app.service.js.map +1 -0
- package/dist/services/gateway/service-bootstrap-status.service.d.ts +33 -0
- package/dist/services/gateway/service-bootstrap-status.service.d.ts.map +1 -0
- package/dist/services/gateway/service-bootstrap-status.service.js +144 -0
- package/dist/services/gateway/service-bootstrap-status.service.js.map +1 -0
- package/dist/services/gateway/service-startup-support.service.d.ts +35 -0
- package/dist/services/gateway/service-startup-support.service.d.ts.map +1 -0
- package/dist/services/gateway/service-startup-support.service.js +83 -0
- package/dist/services/gateway/service-startup-support.service.js.map +1 -0
- package/dist/services/marketplace/service-marketplace-installer.service.d.ts +29 -0
- package/dist/services/marketplace/service-marketplace-installer.service.d.ts.map +1 -0
- package/dist/services/marketplace/service-marketplace-installer.service.js +87 -0
- package/dist/services/marketplace/service-marketplace-installer.service.js.map +1 -0
- package/dist/services/marketplace/service-mcp-marketplace-ops.service.d.ts +40 -0
- package/dist/services/marketplace/service-mcp-marketplace-ops.service.d.ts.map +1 -0
- package/dist/services/marketplace/service-mcp-marketplace-ops.service.js +69 -0
- package/dist/services/marketplace/service-mcp-marketplace-ops.service.js.map +1 -0
- package/dist/services/marketplace/skills-query.service.d.ts +110 -0
- package/dist/services/marketplace/skills-query.service.d.ts.map +1 -0
- package/dist/services/marketplace/skills-query.service.js +132 -0
- package/dist/services/marketplace/skills-query.service.js.map +1 -0
- package/dist/services/platform-auth/account-status.service.d.ts +20 -0
- package/dist/services/platform-auth/account-status.service.d.ts.map +1 -0
- package/dist/services/platform-auth/account-status.service.js +36 -0
- package/dist/services/platform-auth/account-status.service.js.map +1 -0
- package/dist/services/platform-auth/platform-auth-commands.service.d.ts +78 -0
- package/dist/services/platform-auth/platform-auth-commands.service.d.ts.map +1 -0
- package/dist/services/platform-auth/platform-auth-commands.service.js +297 -0
- package/dist/services/platform-auth/platform-auth-commands.service.js.map +1 -0
- package/dist/services/remote/remote-access-host.service.d.ts +42 -0
- package/dist/services/remote/remote-access-host.service.d.ts.map +1 -0
- package/dist/services/remote/remote-access-host.service.js +128 -0
- package/dist/services/remote/remote-access-host.service.js.map +1 -0
- package/dist/services/remote/remote-service-control.service.d.ts +34 -0
- package/dist/services/remote/remote-service-control.service.d.ts.map +1 -0
- package/dist/services/remote/remote-service-control.service.js +247 -0
- package/dist/services/remote/remote-service-control.service.js.map +1 -0
- package/dist/services/restart/restart-coordinator.service.d.ts +31 -0
- package/dist/services/restart/restart-coordinator.service.d.ts.map +1 -0
- package/dist/services/restart/restart-coordinator.service.js +53 -0
- package/dist/services/restart/restart-coordinator.service.js.map +1 -0
- package/dist/services/runtime/managed-service-supervisor.service.d.ts +85 -0
- package/dist/services/runtime/managed-service-supervisor.service.d.ts.map +1 -0
- package/dist/services/runtime/managed-service-supervisor.service.js +271 -0
- package/dist/services/runtime/managed-service-supervisor.service.js.map +1 -0
- package/dist/services/runtime/nextclaw-distribution.service.d.ts +11 -0
- package/dist/services/runtime/nextclaw-distribution.service.d.ts.map +1 -0
- package/dist/services/runtime/nextclaw-distribution.service.js +15 -0
- package/dist/services/runtime/nextclaw-distribution.service.js.map +1 -0
- package/dist/services/runtime/npm-runtime-bundle-manifest.service.d.ts +10 -0
- package/dist/services/runtime/npm-runtime-bundle-manifest.service.d.ts.map +1 -0
- package/dist/services/runtime/npm-runtime-bundle-manifest.service.js +41 -0
- package/dist/services/runtime/npm-runtime-bundle-manifest.service.js.map +1 -0
- package/dist/services/runtime/npm-runtime-bundle.service.d.ts +48 -0
- package/dist/services/runtime/npm-runtime-bundle.service.d.ts.map +1 -0
- package/dist/services/runtime/npm-runtime-bundle.service.js +152 -0
- package/dist/services/runtime/npm-runtime-bundle.service.js.map +1 -0
- package/dist/services/runtime/npm-runtime-update-command.service.d.ts +16 -0
- package/dist/services/runtime/npm-runtime-update-command.service.d.ts.map +1 -0
- package/dist/services/runtime/npm-runtime-update-command.service.js +120 -0
- package/dist/services/runtime/npm-runtime-update-command.service.js.map +1 -0
- package/dist/services/runtime/npm-runtime-update-host.service.d.ts +41 -0
- package/dist/services/runtime/npm-runtime-update-host.service.d.ts.map +1 -0
- package/dist/services/runtime/npm-runtime-update-host.service.js +189 -0
- package/dist/services/runtime/npm-runtime-update-host.service.js.map +1 -0
- package/dist/services/runtime/npm-runtime-update-source.service.d.ts +22 -0
- package/dist/services/runtime/npm-runtime-update-source.service.d.ts.map +1 -0
- package/dist/services/runtime/npm-runtime-update-source.service.js +61 -0
- package/dist/services/runtime/npm-runtime-update-source.service.js.map +1 -0
- package/dist/services/runtime/npm-runtime-update.service.d.ts +55 -0
- package/dist/services/runtime/npm-runtime-update.service.d.ts.map +1 -0
- package/dist/services/runtime/npm-runtime-update.service.js +185 -0
- package/dist/services/runtime/npm-runtime-update.service.js.map +1 -0
- package/dist/services/runtime/runtime-config-init.service.d.ts +5 -0
- package/dist/services/runtime/runtime-config-init.service.d.ts.map +1 -0
- package/dist/services/runtime/runtime-config-init.service.js +12 -0
- package/dist/services/runtime/runtime-config-init.service.js.map +1 -0
- package/dist/services/runtime/service-managed-startup.service.d.ts +95 -0
- package/dist/services/runtime/service-managed-startup.service.d.ts.map +1 -0
- package/dist/services/runtime/service-managed-startup.service.js +341 -0
- package/dist/services/runtime/service-managed-startup.service.js.map +1 -0
- package/dist/services/ui/companion-runtime.service.d.ts +36 -0
- package/dist/services/ui/companion-runtime.service.d.ts.map +1 -0
- package/dist/services/ui/companion-runtime.service.js +180 -0
- package/dist/services/ui/companion-runtime.service.js.map +1 -0
- package/dist/services/ui/local-ui-discovery.service.d.ts +20 -0
- package/dist/services/ui/local-ui-discovery.service.d.ts.map +1 -0
- package/dist/services/ui/local-ui-discovery.service.js +43 -0
- package/dist/services/ui/local-ui-discovery.service.js.map +1 -0
- package/dist/services/ui/runtime-control-host.service.d.ts +29 -0
- package/dist/services/ui/runtime-control-host.service.d.ts.map +1 -0
- package/dist/services/ui/runtime-control-host.service.js +91 -0
- package/dist/services/ui/runtime-control-host.service.js.map +1 -0
- package/dist/services/ui/service-remote-access.service.d.ts +26 -0
- package/dist/services/ui/service-remote-access.service.d.ts.map +1 -0
- package/dist/services/ui/service-remote-access.service.js +40 -0
- package/dist/services/ui/service-remote-access.service.js.map +1 -0
- package/dist/services/ui/ui-bridge-api.service.d.ts +17 -0
- package/dist/services/ui/ui-bridge-api.service.d.ts.map +1 -0
- package/dist/services/ui/ui-bridge-api.service.js +45 -0
- package/dist/services/ui/ui-bridge-api.service.js.map +1 -0
- package/dist/services/usage/llm-usage-command.service.d.ts +21 -0
- package/dist/services/usage/llm-usage-command.service.d.ts.map +1 -0
- package/dist/services/usage/llm-usage-command.service.js +152 -0
- package/dist/services/usage/llm-usage-command.service.js.map +1 -0
- package/dist/stores/companion-runtime.store.d.ts +16 -0
- package/dist/stores/companion-runtime.store.d.ts.map +1 -0
- package/dist/stores/companion-runtime.store.js +29 -0
- package/dist/stores/companion-runtime.store.js.map +1 -0
- package/dist/stores/local-ui-runtime.store.d.ts +26 -0
- package/dist/stores/local-ui-runtime.store.d.ts.map +1 -0
- package/dist/stores/local-ui-runtime.store.js +56 -0
- package/dist/stores/local-ui-runtime.store.js.map +1 -0
- package/dist/stores/managed-service-state.store.d.ts +46 -0
- package/dist/stores/managed-service-state.store.d.ts.map +1 -0
- package/dist/stores/managed-service-state.store.js +40 -0
- package/dist/stores/managed-service-state.store.js.map +1 -0
- package/dist/stores/marketplace-install-state.store.d.ts +39 -0
- package/dist/stores/marketplace-install-state.store.d.ts.map +1 -0
- package/dist/stores/marketplace-install-state.store.js +58 -0
- package/dist/stores/marketplace-install-state.store.js.map +1 -0
- package/dist/stores/npm-runtime-bundle-layout.store.d.ts +24 -0
- package/dist/stores/npm-runtime-bundle-layout.store.d.ts.map +1 -0
- package/dist/stores/npm-runtime-bundle-layout.store.js +39 -0
- package/dist/stores/npm-runtime-bundle-layout.store.js.map +1 -0
- package/dist/stores/npm-runtime-update-state.store.d.ts +18 -0
- package/dist/stores/npm-runtime-update-state.store.d.ts.map +1 -0
- package/dist/stores/npm-runtime-update-state.store.js +94 -0
- package/dist/stores/npm-runtime-update-state.store.js.map +1 -0
- package/dist/stores/pending-restart.store.d.ts +22 -0
- package/dist/stores/pending-restart.store.d.ts.map +1 -0
- package/dist/stores/pending-restart.store.js +37 -0
- package/dist/stores/pending-restart.store.js.map +1 -0
- package/dist/types/cli.types.d.ts +304 -0
- package/dist/types/cli.types.d.ts.map +1 -0
- package/dist/types/distribution.types.d.ts +11 -0
- package/dist/types/distribution.types.d.ts.map +1 -0
- package/dist/types/host-autostart.types.d.ts +65 -0
- package/dist/types/host-autostart.types.d.ts.map +1 -0
- package/dist/types/npm-runtime-bundle.types.d.ts +50 -0
- package/dist/types/npm-runtime-bundle.types.d.ts.map +1 -0
- package/dist/utils/agent-runtime.utils.d.ts +15 -0
- package/dist/utils/agent-runtime.utils.d.ts.map +1 -0
- package/dist/utils/agent-runtime.utils.js +40 -0
- package/dist/utils/agent-runtime.utils.js.map +1 -0
- package/dist/utils/channel-config-view.utils.d.ts +7 -0
- package/dist/utils/channel-config-view.utils.d.ts.map +1 -0
- package/dist/utils/channel-config-view.utils.js +9 -0
- package/dist/utils/channel-config-view.utils.js.map +1 -0
- package/dist/utils/cli-agent-runner.utils.d.ts +14 -0
- package/dist/utils/cli-agent-runner.utils.d.ts.map +1 -0
- package/dist/utils/cli-agent-runner.utils.js +94 -0
- package/dist/utils/cli-agent-runner.utils.js.map +1 -0
- package/dist/utils/cli.utils.d.ts +32 -0
- package/dist/utils/cli.utils.d.ts.map +1 -0
- package/dist/utils/cli.utils.js +254 -0
- package/dist/utils/cli.utils.js.map +1 -0
- package/dist/utils/config-path.utils.d.ts +16 -0
- package/dist/utils/config-path.utils.d.ts.map +1 -0
- package/dist/utils/config-path.utils.js +169 -0
- package/dist/utils/config-path.utils.js.map +1 -0
- package/dist/utils/cron/cron-job.utils.d.ts +28 -0
- package/dist/utils/cron/cron-job.utils.d.ts.map +1 -0
- package/dist/utils/cron/cron-job.utils.js +17 -0
- package/dist/utils/cron/cron-job.utils.js.map +1 -0
- package/dist/utils/diagnostics/diagnostics-render.utils.d.ts +24 -0
- package/dist/utils/diagnostics/diagnostics-render.utils.d.ts.map +1 -0
- package/dist/utils/diagnostics/diagnostics-render.utils.js +74 -0
- package/dist/utils/diagnostics/diagnostics-render.utils.js.map +1 -0
- package/dist/utils/gateway-cron-job-handler.utils.d.ts +18 -0
- package/dist/utils/gateway-cron-job-handler.utils.d.ts.map +1 -0
- package/dist/utils/gateway-cron-job-handler.utils.js +56 -0
- package/dist/utils/gateway-cron-job-handler.utils.js.map +1 -0
- package/dist/utils/gateway-runtime-lifecycle.utils.d.ts +10 -0
- package/dist/utils/gateway-runtime-lifecycle.utils.d.ts.map +1 -0
- package/dist/utils/gateway-runtime-lifecycle.utils.js +12 -0
- package/dist/utils/gateway-runtime-lifecycle.utils.js.map +1 -0
- package/dist/utils/marketplace/cli-subcommand-launch.utils.d.ts +17 -0
- package/dist/utils/marketplace/cli-subcommand-launch.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/cli-subcommand-launch.utils.js +48 -0
- package/dist/utils/marketplace/cli-subcommand-launch.utils.js.map +1 -0
- package/dist/utils/marketplace/marketplace-client.utils.d.ts +46 -0
- package/dist/utils/marketplace/marketplace-client.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/marketplace-client.utils.js +137 -0
- package/dist/utils/marketplace/marketplace-client.utils.js.map +1 -0
- package/dist/utils/marketplace/marketplace-command-options.utils.d.ts +26 -0
- package/dist/utils/marketplace/marketplace-command-options.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/marketplace-command-options.utils.js +33 -0
- package/dist/utils/marketplace/marketplace-command-options.utils.js.map +1 -0
- package/dist/utils/marketplace/marketplace-identity.utils.d.ts +15 -0
- package/dist/utils/marketplace/marketplace-identity.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/marketplace-identity.utils.js +79 -0
- package/dist/utils/marketplace/marketplace-identity.utils.js.map +1 -0
- package/dist/utils/marketplace/marketplace-metadata.utils.d.ts +21 -0
- package/dist/utils/marketplace/marketplace-metadata.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/marketplace-metadata.utils.js +74 -0
- package/dist/utils/marketplace/marketplace-metadata.utils.js.map +1 -0
- package/dist/utils/marketplace/marketplace-network-retry.utils.d.ts +5 -0
- package/dist/utils/marketplace/marketplace-network-retry.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/marketplace-network-retry.utils.js +34 -0
- package/dist/utils/marketplace/marketplace-network-retry.utils.js.map +1 -0
- package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.d.ts +27 -0
- package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.js +206 -0
- package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.js.map +1 -0
- package/dist/utils/marketplace/marketplace.utils.d.ts +34 -0
- package/dist/utils/marketplace/marketplace.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/marketplace.utils.js +77 -0
- package/dist/utils/marketplace/marketplace.utils.js.map +1 -0
- package/dist/utils/marketplace/service-marketplace-helpers.utils.d.ts +15 -0
- package/dist/utils/marketplace/service-marketplace-helpers.utils.d.ts.map +1 -0
- package/dist/utils/marketplace/service-marketplace-helpers.utils.js +47 -0
- package/dist/utils/marketplace/service-marketplace-helpers.utils.js.map +1 -0
- package/dist/utils/package/package-manifest.utils.d.ts +5 -0
- package/dist/utils/package/package-manifest.utils.d.ts.map +1 -0
- package/dist/utils/package/package-manifest.utils.js +40 -0
- package/dist/utils/package/package-manifest.utils.js.map +1 -0
- package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts +5 -0
- package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts.map +1 -0
- package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js +37 -0
- package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js.map +1 -0
- package/dist/utils/platform-auth/payload.utils.d.ts +30 -0
- package/dist/utils/platform-auth/payload.utils.d.ts.map +1 -0
- package/dist/utils/platform-auth/payload.utils.js +89 -0
- package/dist/utils/platform-auth/payload.utils.js.map +1 -0
- package/dist/utils/remote/platform-api-base.utils.d.ts +15 -0
- package/dist/utils/remote/platform-api-base.utils.d.ts.map +1 -0
- package/dist/utils/remote/platform-api-base.utils.js +41 -0
- package/dist/utils/remote/platform-api-base.utils.js.map +1 -0
- package/dist/utils/remote/remote-runtime-support.utils.d.ts +16 -0
- package/dist/utils/remote/remote-runtime-support.utils.d.ts.map +1 -0
- package/dist/utils/remote/remote-runtime-support.utils.js +82 -0
- package/dist/utils/remote/remote-runtime-support.utils.js.map +1 -0
- package/dist/utils/restart-sentinel.utils.d.ts +37 -0
- package/dist/utils/restart-sentinel.utils.d.ts.map +1 -0
- package/dist/utils/restart-sentinel.utils.js +76 -0
- package/dist/utils/restart-sentinel.utils.js.map +1 -0
- package/dist/utils/runtime/managed-service-routing.utils.d.ts +31 -0
- package/dist/utils/runtime/managed-service-routing.utils.d.ts.map +1 -0
- package/dist/utils/runtime/managed-service-routing.utils.js +64 -0
- package/dist/utils/runtime/managed-service-routing.utils.js.map +1 -0
- package/dist/utils/runtime/service-remote-runtime.utils.d.ts +58 -0
- package/dist/utils/runtime/service-remote-runtime.utils.d.ts.map +1 -0
- package/dist/utils/runtime/service-remote-runtime.utils.js +184 -0
- package/dist/utils/runtime/service-remote-runtime.utils.js.map +1 -0
- package/dist/utils/runtime-helpers.utils.d.ts +15 -0
- package/dist/utils/runtime-helpers.utils.d.ts.map +1 -0
- package/dist/utils/runtime-helpers.utils.js +28 -0
- package/dist/utils/runtime-helpers.utils.js.map +1 -0
- package/dist/utils/service-port-probe.utils.d.ts +42 -0
- package/dist/utils/service-port-probe.utils.d.ts.map +1 -0
- package/dist/utils/service-port-probe.utils.js +166 -0
- package/dist/utils/service-port-probe.utils.js.map +1 -0
- package/dist/utils/startup-trace.utils.d.ts +8 -0
- package/dist/utils/startup-trace.utils.d.ts.map +1 -0
- package/dist/utils/startup-trace.utils.js +39 -0
- package/dist/utils/startup-trace.utils.js.map +1 -0
- package/dist/utils/top-level-nextclaw-command-env.utils.d.ts +5 -0
- package/dist/utils/top-level-nextclaw-command-env.utils.d.ts.map +1 -0
- package/dist/utils/top-level-nextclaw-command-env.utils.js +12 -0
- package/dist/utils/top-level-nextclaw-command-env.utils.js.map +1 -0
- package/package.json +26 -26
- package/dist/cli/commands/agent/agent-runtime.utils.d.ts +0 -15
- package/dist/cli/commands/agent/agent-runtime.utils.d.ts.map +0 -1
- package/dist/cli/commands/agent/agent-runtime.utils.js +0 -43
- package/dist/cli/commands/agent/agent-runtime.utils.js.map +0 -1
- package/dist/cli/commands/agent/cli-agent-runner.utils.d.ts +0 -14
- package/dist/cli/commands/agent/cli-agent-runner.utils.d.ts.map +0 -1
- package/dist/cli/commands/agent/cli-agent-runner.utils.js +0 -94
- package/dist/cli/commands/agent/cli-agent-runner.utils.js.map +0 -1
- package/dist/cli/commands/agent/index.d.ts +0 -3
- package/dist/cli/commands/agent/index.js +0 -3
- package/dist/cli/commands/agent/services/agent-commands.service.d.ts +0 -18
- package/dist/cli/commands/agent/services/agent-commands.service.d.ts.map +0 -1
- package/dist/cli/commands/agent/services/agent-commands.service.js +0 -113
- package/dist/cli/commands/agent/services/agent-commands.service.js.map +0 -1
- package/dist/cli/commands/config/index.d.ts +0 -2
- package/dist/cli/commands/config/index.js +0 -2
- package/dist/cli/commands/config/services/config-commands.service.d.ts +0 -17
- package/dist/cli/commands/config/services/config-commands.service.d.ts.map +0 -1
- package/dist/cli/commands/config/services/config-commands.service.js +0 -117
- package/dist/cli/commands/config/services/config-commands.service.js.map +0 -1
- package/dist/cli/commands/cron/index.d.ts +0 -2
- package/dist/cli/commands/cron/index.js +0 -2
- package/dist/cli/commands/cron/services/cron-commands.service.d.ts +0 -23
- package/dist/cli/commands/cron/services/cron-commands.service.d.ts.map +0 -1
- package/dist/cli/commands/cron/services/cron-commands.service.js +0 -109
- package/dist/cli/commands/cron/services/cron-commands.service.js.map +0 -1
- package/dist/cli/commands/cron/services/cron-local.service.d.ts +0 -26
- package/dist/cli/commands/cron/services/cron-local.service.d.ts.map +0 -1
- package/dist/cli/commands/cron/services/cron-local.service.js +0 -89
- package/dist/cli/commands/cron/services/cron-local.service.js.map +0 -1
- package/dist/cli/commands/cron/utils/cron-job.utils.d.ts +0 -28
- package/dist/cli/commands/cron/utils/cron-job.utils.d.ts.map +0 -1
- package/dist/cli/commands/cron/utils/cron-job.utils.js +0 -17
- package/dist/cli/commands/cron/utils/cron-job.utils.js.map +0 -1
- package/dist/cli/commands/diagnostics/index.d.ts +0 -2
- package/dist/cli/commands/diagnostics/index.js +0 -2
- package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.d.ts +0 -25
- package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.d.ts.map +0 -1
- package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.js +0 -345
- package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.js.map +0 -1
- package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.d.ts +0 -24
- package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.d.ts.map +0 -1
- package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.js +0 -74
- package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.js.map +0 -1
- package/dist/cli/commands/gateway/index.d.ts +0 -15
- package/dist/cli/commands/gateway/index.d.ts.map +0 -1
- package/dist/cli/commands/gateway/index.js +0 -17
- package/dist/cli/commands/gateway/index.js.map +0 -1
- package/dist/cli/commands/logs/index.d.ts +0 -13
- package/dist/cli/commands/logs/index.d.ts.map +0 -1
- package/dist/cli/commands/logs/index.js +0 -31
- package/dist/cli/commands/logs/index.js.map +0 -1
- package/dist/cli/commands/mcp/index.d.ts +0 -15
- package/dist/cli/commands/mcp/index.d.ts.map +0 -1
- package/dist/cli/commands/mcp/index.js +0 -195
- package/dist/cli/commands/mcp/index.js.map +0 -1
- package/dist/cli/commands/restart/index.d.ts +0 -21
- package/dist/cli/commands/restart/index.d.ts.map +0 -1
- package/dist/cli/commands/restart/index.js +0 -90
- package/dist/cli/commands/restart/index.js.map +0 -1
- package/dist/cli/commands/secrets/index.d.ts +0 -23
- package/dist/cli/commands/secrets/index.d.ts.map +0 -1
- package/dist/cli/commands/secrets/index.js +0 -282
- package/dist/cli/commands/secrets/index.js.map +0 -1
- package/dist/cli/commands/serve/index.d.ts +0 -15
- package/dist/cli/commands/serve/index.d.ts.map +0 -1
- package/dist/cli/commands/serve/index.js +0 -21
- package/dist/cli/commands/serve/index.js.map +0 -1
- package/dist/cli/commands/skills/index.d.ts +0 -28
- package/dist/cli/commands/skills/index.d.ts.map +0 -1
- package/dist/cli/commands/skills/index.js +0 -170
- package/dist/cli/commands/skills/index.js.map +0 -1
- package/dist/cli/commands/skills/marketplace-client.d.ts +0 -46
- package/dist/cli/commands/skills/marketplace-client.d.ts.map +0 -1
- package/dist/cli/commands/skills/marketplace-client.js +0 -137
- package/dist/cli/commands/skills/marketplace-client.js.map +0 -1
- package/dist/cli/commands/skills/marketplace-command-options.utils.d.ts +0 -26
- package/dist/cli/commands/skills/marketplace-command-options.utils.d.ts.map +0 -1
- package/dist/cli/commands/skills/marketplace-command-options.utils.js +0 -33
- package/dist/cli/commands/skills/marketplace-command-options.utils.js.map +0 -1
- package/dist/cli/commands/skills/marketplace-identity.utils.d.ts +0 -15
- package/dist/cli/commands/skills/marketplace-identity.utils.d.ts.map +0 -1
- package/dist/cli/commands/skills/marketplace-identity.utils.js +0 -79
- package/dist/cli/commands/skills/marketplace-identity.utils.js.map +0 -1
- package/dist/cli/commands/skills/marketplace-network-retry.d.ts +0 -5
- package/dist/cli/commands/skills/marketplace-network-retry.d.ts.map +0 -1
- package/dist/cli/commands/skills/marketplace-network-retry.js +0 -34
- package/dist/cli/commands/skills/marketplace-network-retry.js.map +0 -1
- package/dist/cli/commands/skills/marketplace.metadata.d.ts +0 -21
- package/dist/cli/commands/skills/marketplace.metadata.d.ts.map +0 -1
- package/dist/cli/commands/skills/marketplace.metadata.js +0 -74
- package/dist/cli/commands/skills/marketplace.metadata.js.map +0 -1
- package/dist/cli/commands/skills/marketplace.utils.d.ts +0 -34
- package/dist/cli/commands/skills/marketplace.utils.d.ts.map +0 -1
- package/dist/cli/commands/skills/marketplace.utils.js +0 -77
- package/dist/cli/commands/skills/marketplace.utils.js.map +0 -1
- package/dist/cli/commands/skills/skills-query.service.d.ts +0 -110
- package/dist/cli/commands/skills/skills-query.service.d.ts.map +0 -1
- package/dist/cli/commands/skills/skills-query.service.js +0 -132
- package/dist/cli/commands/skills/skills-query.service.js.map +0 -1
- package/dist/cli/commands/skills/stores/marketplace-install-state.store.d.ts +0 -39
- package/dist/cli/commands/skills/stores/marketplace-install-state.store.d.ts.map +0 -1
- package/dist/cli/commands/skills/stores/marketplace-install-state.store.js +0 -58
- package/dist/cli/commands/skills/stores/marketplace-install-state.store.js.map +0 -1
- package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.d.ts +0 -27
- package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.d.ts.map +0 -1
- package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.js +0 -206
- package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.js.map +0 -1
- package/dist/cli/commands/start/index.d.ts +0 -19
- package/dist/cli/commands/start/index.d.ts.map +0 -1
- package/dist/cli/commands/start/index.js +0 -27
- package/dist/cli/commands/start/index.js.map +0 -1
- package/dist/cli/commands/stop/index.d.ts +0 -13
- package/dist/cli/commands/stop/index.d.ts.map +0 -1
- package/dist/cli/commands/stop/index.js +0 -13
- package/dist/cli/commands/stop/index.js.map +0 -1
- package/dist/cli/commands/ui/index.d.ts +0 -15
- package/dist/cli/commands/ui/index.d.ts.map +0 -1
- package/dist/cli/commands/ui/index.js +0 -19
- package/dist/cli/commands/ui/index.js.map +0 -1
- package/dist/cli/commands/usage/index.d.ts +0 -2
- package/dist/cli/commands/usage/index.js +0 -2
- package/dist/cli/commands/usage/services/llm-usage-command.service.d.ts +0 -21
- package/dist/cli/commands/usage/services/llm-usage-command.service.d.ts.map +0 -1
- package/dist/cli/commands/usage/services/llm-usage-command.service.js +0 -152
- package/dist/cli/commands/usage/services/llm-usage-command.service.js.map +0 -1
- package/dist/commands/channel/channel-config-view.utils.d.ts +0 -7
- package/dist/commands/channel/channel-config-view.utils.d.ts.map +0 -1
- package/dist/commands/channel/channel-config-view.utils.js +0 -9
- package/dist/commands/channel/channel-config-view.utils.js.map +0 -1
- package/dist/commands/channel/channel-list-view.service.d.ts +0 -29
- package/dist/commands/channel/channel-list-view.service.d.ts.map +0 -1
- package/dist/commands/channel/channel-list-view.service.js +0 -53
- package/dist/commands/channel/channel-list-view.service.js.map +0 -1
- package/dist/commands/channel/index.d.ts +0 -21
- package/dist/commands/channel/index.d.ts.map +0 -1
- package/dist/commands/channel/index.js +0 -115
- package/dist/commands/channel/index.js.map +0 -1
- package/dist/commands/platform-auth/index.d.ts +0 -2
- package/dist/commands/platform-auth/index.js +0 -2
- package/dist/commands/platform-auth/services/account-status.service.d.ts +0 -19
- package/dist/commands/platform-auth/services/account-status.service.d.ts.map +0 -1
- package/dist/commands/platform-auth/services/account-status.service.js +0 -36
- package/dist/commands/platform-auth/services/account-status.service.js.map +0 -1
- package/dist/commands/platform-auth/services/platform-auth-commands.service.d.ts +0 -78
- package/dist/commands/platform-auth/services/platform-auth-commands.service.d.ts.map +0 -1
- package/dist/commands/platform-auth/services/platform-auth-commands.service.js +0 -297
- package/dist/commands/platform-auth/services/platform-auth-commands.service.js.map +0 -1
- package/dist/commands/platform-auth/utils/payload.utils.d.ts +0 -29
- package/dist/commands/platform-auth/utils/payload.utils.d.ts.map +0 -1
- package/dist/commands/platform-auth/utils/payload.utils.js +0 -89
- package/dist/commands/platform-auth/utils/payload.utils.js.map +0 -1
- package/dist/commands/remote/index.d.ts +0 -48
- package/dist/commands/remote/index.d.ts.map +0 -1
- package/dist/commands/remote/index.js +0 -176
- package/dist/commands/remote/index.js.map +0 -1
- package/dist/commands/remote/services/remote-access-host.service.d.ts +0 -42
- package/dist/commands/remote/services/remote-access-host.service.d.ts.map +0 -1
- package/dist/commands/remote/services/remote-access-host.service.js +0 -128
- package/dist/commands/remote/services/remote-access-host.service.js.map +0 -1
- package/dist/commands/remote/services/remote-service-control.service.d.ts +0 -34
- package/dist/commands/remote/services/remote-service-control.service.d.ts.map +0 -1
- package/dist/commands/remote/services/remote-service-control.service.js +0 -247
- package/dist/commands/remote/services/remote-service-control.service.js.map +0 -1
- package/dist/commands/remote/utils/platform-api-base.utils.d.ts +0 -15
- package/dist/commands/remote/utils/platform-api-base.utils.d.ts.map +0 -1
- package/dist/commands/remote/utils/platform-api-base.utils.js +0 -41
- package/dist/commands/remote/utils/platform-api-base.utils.js.map +0 -1
- package/dist/commands/remote/utils/remote-runtime-support.utils.d.ts +0 -16
- package/dist/commands/remote/utils/remote-runtime-support.utils.d.ts.map +0 -1
- package/dist/commands/remote/utils/remote-runtime-support.utils.js +0 -82
- package/dist/commands/remote/utils/remote-runtime-support.utils.js.map +0 -1
- package/dist/commands/service/index.d.ts +0 -17
- package/dist/commands/service/index.d.ts.map +0 -1
- package/dist/commands/service/index.js +0 -33
- package/dist/commands/service/index.js.map +0 -1
- package/dist/commands/service/services/autostart/host-autostart-command.service.d.ts +0 -30
- package/dist/commands/service/services/autostart/host-autostart-command.service.d.ts.map +0 -1
- package/dist/commands/service/services/autostart/host-autostart-command.service.js +0 -160
- package/dist/commands/service/services/autostart/host-autostart-command.service.js.map +0 -1
- package/dist/commands/service/services/autostart/host-autostart-runtime.service.d.ts +0 -24
- package/dist/commands/service/services/autostart/host-autostart-runtime.service.d.ts.map +0 -1
- package/dist/commands/service/services/autostart/host-autostart-runtime.service.js +0 -55
- package/dist/commands/service/services/autostart/host-autostart-runtime.service.js.map +0 -1
- package/dist/commands/service/services/autostart/host-autostart.service.d.ts +0 -42
- package/dist/commands/service/services/autostart/host-autostart.service.d.ts.map +0 -1
- package/dist/commands/service/services/autostart/host-autostart.service.js +0 -50
- package/dist/commands/service/services/autostart/host-autostart.service.js.map +0 -1
- package/dist/commands/service/services/autostart/linux-systemd-autostart.service.d.ts +0 -49
- package/dist/commands/service/services/autostart/linux-systemd-autostart.service.d.ts.map +0 -1
- package/dist/commands/service/services/autostart/linux-systemd-autostart.service.js +0 -435
- package/dist/commands/service/services/autostart/linux-systemd-autostart.service.js.map +0 -1
- package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.d.ts +0 -55
- package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.d.ts.map +0 -1
- package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.js +0 -407
- package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.js.map +0 -1
- package/dist/commands/service/services/autostart/windows-task-autostart.service.d.ts +0 -55
- package/dist/commands/service/services/autostart/windows-task-autostart.service.d.ts.map +0 -1
- package/dist/commands/service/services/autostart/windows-task-autostart.service.js +0 -406
- package/dist/commands/service/services/autostart/windows-task-autostart.service.js.map +0 -1
- package/dist/commands/service/types/autostart/host-autostart.types.d.ts +0 -65
- package/dist/commands/service/types/autostart/host-autostart.types.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-bundle-layout.store.d.ts +0 -24
- package/dist/launcher/npm-runtime-bundle-layout.store.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-bundle-layout.store.js +0 -39
- package/dist/launcher/npm-runtime-bundle-layout.store.js.map +0 -1
- package/dist/launcher/npm-runtime-bundle-manifest.service.d.ts +0 -10
- package/dist/launcher/npm-runtime-bundle-manifest.service.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-bundle-manifest.service.js +0 -41
- package/dist/launcher/npm-runtime-bundle-manifest.service.js.map +0 -1
- package/dist/launcher/npm-runtime-bundle.service.d.ts +0 -48
- package/dist/launcher/npm-runtime-bundle.service.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-bundle.service.js +0 -152
- package/dist/launcher/npm-runtime-bundle.service.js.map +0 -1
- package/dist/launcher/npm-runtime-bundle.types.d.ts +0 -50
- package/dist/launcher/npm-runtime-bundle.types.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-update-command.service.d.ts +0 -16
- package/dist/launcher/npm-runtime-update-command.service.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-update-command.service.js +0 -120
- package/dist/launcher/npm-runtime-update-command.service.js.map +0 -1
- package/dist/launcher/npm-runtime-update-source.service.d.ts +0 -22
- package/dist/launcher/npm-runtime-update-source.service.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-update-source.service.js +0 -61
- package/dist/launcher/npm-runtime-update-source.service.js.map +0 -1
- package/dist/launcher/npm-runtime-update-state.store.d.ts +0 -18
- package/dist/launcher/npm-runtime-update-state.store.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-update-state.store.js +0 -94
- package/dist/launcher/npm-runtime-update-state.store.js.map +0 -1
- package/dist/launcher/npm-runtime-update.manager.d.ts +0 -43
- package/dist/launcher/npm-runtime-update.manager.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-update.manager.js +0 -185
- package/dist/launcher/npm-runtime-update.manager.js.map +0 -1
- package/dist/launcher/npm-runtime-update.service.d.ts +0 -55
- package/dist/launcher/npm-runtime-update.service.d.ts.map +0 -1
- package/dist/launcher/npm-runtime-update.service.js +0 -185
- package/dist/launcher/npm-runtime-update.service.js.map +0 -1
- package/dist/service-runtime.service.d.ts +0 -88
- package/dist/service-runtime.service.d.ts.map +0 -1
- package/dist/service-runtime.service.js +0 -366
- package/dist/service-runtime.service.js.map +0 -1
- package/dist/shared/controllers/gateway.controller.d.ts +0 -54
- package/dist/shared/controllers/gateway.controller.d.ts.map +0 -1
- package/dist/shared/controllers/gateway.controller.js +0 -162
- package/dist/shared/controllers/gateway.controller.js.map +0 -1
- package/dist/shared/services/gateway/gateway-restart-wake.service.d.ts +0 -13
- package/dist/shared/services/gateway/gateway-restart-wake.service.d.ts.map +0 -1
- package/dist/shared/services/gateway/gateway-restart-wake.service.js +0 -99
- package/dist/shared/services/gateway/gateway-restart-wake.service.js.map +0 -1
- package/dist/shared/services/gateway/managers/gateway-extension.manager.d.ts +0 -29
- package/dist/shared/services/gateway/managers/gateway-extension.manager.d.ts.map +0 -1
- package/dist/shared/services/gateway/managers/gateway-extension.manager.js +0 -78
- package/dist/shared/services/gateway/managers/gateway-extension.manager.js.map +0 -1
- package/dist/shared/services/gateway/managers/gateway-remote.manager.d.ts +0 -23
- package/dist/shared/services/gateway/managers/gateway-remote.manager.d.ts.map +0 -1
- package/dist/shared/services/gateway/managers/gateway-remote.manager.js +0 -28
- package/dist/shared/services/gateway/managers/gateway-remote.manager.js.map +0 -1
- package/dist/shared/services/gateway/nextclaw-app.service.d.ts +0 -18
- package/dist/shared/services/gateway/nextclaw-app.service.d.ts.map +0 -1
- package/dist/shared/services/gateway/nextclaw-app.service.js +0 -44
- package/dist/shared/services/gateway/nextclaw-app.service.js.map +0 -1
- package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.d.ts +0 -85
- package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.d.ts.map +0 -1
- package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.js +0 -278
- package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.js.map +0 -1
- package/dist/shared/services/gateway/service-bootstrap-status.service.d.ts +0 -33
- package/dist/shared/services/gateway/service-bootstrap-status.service.d.ts.map +0 -1
- package/dist/shared/services/gateway/service-bootstrap-status.service.js +0 -144
- package/dist/shared/services/gateway/service-bootstrap-status.service.js.map +0 -1
- package/dist/shared/services/gateway/service-startup-support.service.d.ts +0 -35
- package/dist/shared/services/gateway/service-startup-support.service.d.ts.map +0 -1
- package/dist/shared/services/gateway/service-startup-support.service.js +0 -85
- package/dist/shared/services/gateway/service-startup-support.service.js.map +0 -1
- package/dist/shared/services/gateway/utils/cron-job-handler.utils.d.ts +0 -18
- package/dist/shared/services/gateway/utils/cron-job-handler.utils.d.ts.map +0 -1
- package/dist/shared/services/gateway/utils/cron-job-handler.utils.js +0 -56
- package/dist/shared/services/gateway/utils/cron-job-handler.utils.js.map +0 -1
- package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.d.ts +0 -10
- package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.d.ts.map +0 -1
- package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.js +0 -12
- package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.js.map +0 -1
- package/dist/shared/services/marketplace/service-marketplace-installer.service.d.ts +0 -29
- package/dist/shared/services/marketplace/service-marketplace-installer.service.d.ts.map +0 -1
- package/dist/shared/services/marketplace/service-marketplace-installer.service.js +0 -87
- package/dist/shared/services/marketplace/service-marketplace-installer.service.js.map +0 -1
- package/dist/shared/services/marketplace/service-mcp-marketplace-ops.d.ts +0 -40
- package/dist/shared/services/marketplace/service-mcp-marketplace-ops.d.ts.map +0 -1
- package/dist/shared/services/marketplace/service-mcp-marketplace-ops.js +0 -69
- package/dist/shared/services/marketplace/service-mcp-marketplace-ops.js.map +0 -1
- package/dist/shared/services/restart/restart-coordinator.service.d.ts +0 -31
- package/dist/shared/services/restart/restart-coordinator.service.d.ts.map +0 -1
- package/dist/shared/services/restart/restart-coordinator.service.js +0 -53
- package/dist/shared/services/restart/restart-coordinator.service.js.map +0 -1
- package/dist/shared/services/restart/runtime-restart-request.service.d.ts +0 -25
- package/dist/shared/services/restart/runtime-restart-request.service.d.ts.map +0 -1
- package/dist/shared/services/restart/runtime-restart-request.service.js +0 -44
- package/dist/shared/services/restart/runtime-restart-request.service.js.map +0 -1
- package/dist/shared/services/runtime/managed-service-supervisor.service.d.ts +0 -85
- package/dist/shared/services/runtime/managed-service-supervisor.service.d.ts.map +0 -1
- package/dist/shared/services/runtime/managed-service-supervisor.service.js +0 -271
- package/dist/shared/services/runtime/managed-service-supervisor.service.js.map +0 -1
- package/dist/shared/services/runtime/nextclaw-distribution.service.d.ts +0 -11
- package/dist/shared/services/runtime/nextclaw-distribution.service.d.ts.map +0 -1
- package/dist/shared/services/runtime/nextclaw-distribution.service.js +0 -15
- package/dist/shared/services/runtime/nextclaw-distribution.service.js.map +0 -1
- package/dist/shared/services/runtime/runtime-command.service.d.ts +0 -42
- package/dist/shared/services/runtime/runtime-command.service.d.ts.map +0 -1
- package/dist/shared/services/runtime/runtime-command.service.js +0 -195
- package/dist/shared/services/runtime/runtime-command.service.js.map +0 -1
- package/dist/shared/services/runtime/runtime-config-init.service.d.ts +0 -5
- package/dist/shared/services/runtime/runtime-config-init.service.d.ts.map +0 -1
- package/dist/shared/services/runtime/runtime-config-init.service.js +0 -12
- package/dist/shared/services/runtime/runtime-config-init.service.js.map +0 -1
- package/dist/shared/services/runtime/service-managed-startup.service.d.ts +0 -95
- package/dist/shared/services/runtime/service-managed-startup.service.d.ts.map +0 -1
- package/dist/shared/services/runtime/service-managed-startup.service.js +0 -341
- package/dist/shared/services/runtime/service-managed-startup.service.js.map +0 -1
- package/dist/shared/services/runtime/utils/managed-service-routing.utils.d.ts +0 -31
- package/dist/shared/services/runtime/utils/managed-service-routing.utils.d.ts.map +0 -1
- package/dist/shared/services/runtime/utils/managed-service-routing.utils.js +0 -64
- package/dist/shared/services/runtime/utils/managed-service-routing.utils.js.map +0 -1
- package/dist/shared/services/runtime/utils/service-remote-runtime.utils.d.ts +0 -58
- package/dist/shared/services/runtime/utils/service-remote-runtime.utils.d.ts.map +0 -1
- package/dist/shared/services/runtime/utils/service-remote-runtime.utils.js +0 -184
- package/dist/shared/services/runtime/utils/service-remote-runtime.utils.js.map +0 -1
- package/dist/shared/services/ui/companion-runtime.service.d.ts +0 -36
- package/dist/shared/services/ui/companion-runtime.service.d.ts.map +0 -1
- package/dist/shared/services/ui/companion-runtime.service.js +0 -180
- package/dist/shared/services/ui/companion-runtime.service.js.map +0 -1
- package/dist/shared/services/ui/local-ui-discovery.service.d.ts +0 -20
- package/dist/shared/services/ui/local-ui-discovery.service.d.ts.map +0 -1
- package/dist/shared/services/ui/local-ui-discovery.service.js +0 -43
- package/dist/shared/services/ui/local-ui-discovery.service.js.map +0 -1
- package/dist/shared/services/ui/npm-runtime-update-host.service.d.ts +0 -41
- package/dist/shared/services/ui/npm-runtime-update-host.service.d.ts.map +0 -1
- package/dist/shared/services/ui/npm-runtime-update-host.service.js +0 -189
- package/dist/shared/services/ui/npm-runtime-update-host.service.js.map +0 -1
- package/dist/shared/services/ui/runtime-control-host.service.d.ts +0 -29
- package/dist/shared/services/ui/runtime-control-host.service.d.ts.map +0 -1
- package/dist/shared/services/ui/runtime-control-host.service.js +0 -91
- package/dist/shared/services/ui/runtime-control-host.service.js.map +0 -1
- package/dist/shared/services/ui/service-remote-access.service.d.ts +0 -26
- package/dist/shared/services/ui/service-remote-access.service.d.ts.map +0 -1
- package/dist/shared/services/ui/service-remote-access.service.js +0 -40
- package/dist/shared/services/ui/service-remote-access.service.js.map +0 -1
- package/dist/shared/services/ui/ui-bridge-api.service.d.ts +0 -17
- package/dist/shared/services/ui/ui-bridge-api.service.d.ts.map +0 -1
- package/dist/shared/services/ui/ui-bridge-api.service.js +0 -45
- package/dist/shared/services/ui/ui-bridge-api.service.js.map +0 -1
- package/dist/shared/services/workspace/workspace-manager.service.d.ts +0 -14
- package/dist/shared/services/workspace/workspace-manager.service.d.ts.map +0 -1
- package/dist/shared/services/workspace/workspace-manager.service.js +0 -86
- package/dist/shared/services/workspace/workspace-manager.service.js.map +0 -1
- package/dist/shared/stores/companion-runtime.store.d.ts +0 -16
- package/dist/shared/stores/companion-runtime.store.d.ts.map +0 -1
- package/dist/shared/stores/companion-runtime.store.js +0 -29
- package/dist/shared/stores/companion-runtime.store.js.map +0 -1
- package/dist/shared/stores/local-ui-runtime.store.d.ts +0 -26
- package/dist/shared/stores/local-ui-runtime.store.d.ts.map +0 -1
- package/dist/shared/stores/local-ui-runtime.store.js +0 -56
- package/dist/shared/stores/local-ui-runtime.store.js.map +0 -1
- package/dist/shared/stores/managed-service-state.store.d.ts +0 -46
- package/dist/shared/stores/managed-service-state.store.d.ts.map +0 -1
- package/dist/shared/stores/managed-service-state.store.js +0 -40
- package/dist/shared/stores/managed-service-state.store.js.map +0 -1
- package/dist/shared/stores/pending-restart.store.d.ts +0 -22
- package/dist/shared/stores/pending-restart.store.d.ts.map +0 -1
- package/dist/shared/stores/pending-restart.store.js +0 -37
- package/dist/shared/stores/pending-restart.store.js.map +0 -1
- package/dist/shared/types/cli.types.d.ts +0 -304
- package/dist/shared/types/cli.types.d.ts.map +0 -1
- package/dist/shared/types/distribution.types.d.ts +0 -11
- package/dist/shared/types/distribution.types.d.ts.map +0 -1
- package/dist/shared/utils/cli.utils.d.ts +0 -32
- package/dist/shared/utils/cli.utils.d.ts.map +0 -1
- package/dist/shared/utils/cli.utils.js +0 -254
- package/dist/shared/utils/cli.utils.js.map +0 -1
- package/dist/shared/utils/config-path.d.ts +0 -16
- package/dist/shared/utils/config-path.d.ts.map +0 -1
- package/dist/shared/utils/config-path.js +0 -169
- package/dist/shared/utils/config-path.js.map +0 -1
- package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.d.ts +0 -17
- package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.d.ts.map +0 -1
- package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.js +0 -48
- package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.js.map +0 -1
- package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.d.ts +0 -15
- package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.d.ts.map +0 -1
- package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.js +0 -47
- package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.js.map +0 -1
- package/dist/shared/utils/package/package-manifest.utils.d.ts +0 -5
- package/dist/shared/utils/package/package-manifest.utils.d.ts.map +0 -1
- package/dist/shared/utils/package/package-manifest.utils.js +0 -40
- package/dist/shared/utils/package/package-manifest.utils.js.map +0 -1
- package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts +0 -5
- package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts.map +0 -1
- package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js +0 -37
- package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js.map +0 -1
- package/dist/shared/utils/restart/restart-sentinel.utils.d.ts +0 -37
- package/dist/shared/utils/restart/restart-sentinel.utils.d.ts.map +0 -1
- package/dist/shared/utils/restart/restart-sentinel.utils.js +0 -76
- package/dist/shared/utils/restart/restart-sentinel.utils.js.map +0 -1
- package/dist/shared/utils/runtime-helpers.d.ts +0 -15
- package/dist/shared/utils/runtime-helpers.d.ts.map +0 -1
- package/dist/shared/utils/runtime-helpers.js +0 -28
- package/dist/shared/utils/runtime-helpers.js.map +0 -1
- package/dist/shared/utils/service-port-probe.utils.d.ts +0 -42
- package/dist/shared/utils/service-port-probe.utils.d.ts.map +0 -1
- package/dist/shared/utils/service-port-probe.utils.js +0 -166
- package/dist/shared/utils/service-port-probe.utils.js.map +0 -1
- package/dist/shared/utils/startup-trace.d.ts +0 -8
- package/dist/shared/utils/startup-trace.d.ts.map +0 -1
- package/dist/shared/utils/startup-trace.js +0 -39
- package/dist/shared/utils/startup-trace.js.map +0 -1
- package/dist/shared/utils/top-level-nextclaw-command-env.utils.d.ts +0 -5
- package/dist/shared/utils/top-level-nextclaw-command-env.utils.d.ts.map +0 -1
- package/dist/shared/utils/top-level-nextclaw-command-env.utils.js +0 -12
- package/dist/shared/utils/top-level-nextclaw-command-env.utils.js.map +0 -1
- /package/dist/{shared/types → types}/cli.types.js +0 -0
- /package/dist/{shared/types → types}/distribution.types.js +0 -0
- /package/dist/{commands/service/types/autostart → types}/host-autostart.types.js +0 -0
- /package/dist/{launcher → types}/npm-runtime-bundle.types.js +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname } from "node:path";
|
|
3
|
-
//#region src/launcher/npm-runtime-update-state.store.ts
|
|
4
|
-
function createDefaultState(channel) {
|
|
5
|
-
return {
|
|
6
|
-
channel,
|
|
7
|
-
currentVersion: null,
|
|
8
|
-
previousVersion: null,
|
|
9
|
-
candidateVersion: null,
|
|
10
|
-
candidateLaunchCount: 0,
|
|
11
|
-
lastKnownGoodVersion: null,
|
|
12
|
-
badVersions: [],
|
|
13
|
-
lastUpdateCheckAt: null,
|
|
14
|
-
downloadedVersion: null,
|
|
15
|
-
downloadedReleaseNotesUrl: null,
|
|
16
|
-
updatePreferences: {
|
|
17
|
-
automaticChecks: true,
|
|
18
|
-
autoDownload: true
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function normalizeOptionalString(value) {
|
|
23
|
-
if (typeof value !== "string") return null;
|
|
24
|
-
const trimmed = value.trim();
|
|
25
|
-
return trimmed ? trimmed : null;
|
|
26
|
-
}
|
|
27
|
-
function normalizeChannel(value, fallback) {
|
|
28
|
-
if (typeof value !== "string") return fallback;
|
|
29
|
-
const trimmed = value.trim().toLowerCase();
|
|
30
|
-
if (trimmed === "beta") return "beta";
|
|
31
|
-
if (trimmed === "stable") return "stable";
|
|
32
|
-
return fallback;
|
|
33
|
-
}
|
|
34
|
-
function normalizeStringArray(value) {
|
|
35
|
-
if (!Array.isArray(value)) return [];
|
|
36
|
-
return [...new Set(value.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean))];
|
|
37
|
-
}
|
|
38
|
-
function normalizeUpdatePreferences(value) {
|
|
39
|
-
const defaultState = createDefaultState("stable");
|
|
40
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return { ...defaultState.updatePreferences };
|
|
41
|
-
const record = value;
|
|
42
|
-
return {
|
|
43
|
-
automaticChecks: typeof record.automaticChecks === "boolean" ? record.automaticChecks : defaultState.updatePreferences.automaticChecks,
|
|
44
|
-
autoDownload: typeof record.autoDownload === "boolean" ? record.autoDownload : defaultState.updatePreferences.autoDownload
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function normalizeState(input, defaultChannel) {
|
|
48
|
-
if (!input || typeof input !== "object" || Array.isArray(input)) throw new Error("npm runtime update state must be an object");
|
|
49
|
-
const record = input;
|
|
50
|
-
const candidateLaunchCount = Number(record.candidateLaunchCount);
|
|
51
|
-
return {
|
|
52
|
-
channel: normalizeChannel(record.channel, defaultChannel),
|
|
53
|
-
currentVersion: normalizeOptionalString(record.currentVersion),
|
|
54
|
-
previousVersion: normalizeOptionalString(record.previousVersion),
|
|
55
|
-
candidateVersion: normalizeOptionalString(record.candidateVersion),
|
|
56
|
-
candidateLaunchCount: Number.isInteger(candidateLaunchCount) && candidateLaunchCount >= 0 ? candidateLaunchCount : 0,
|
|
57
|
-
lastKnownGoodVersion: normalizeOptionalString(record.lastKnownGoodVersion),
|
|
58
|
-
badVersions: normalizeStringArray(record.badVersions),
|
|
59
|
-
lastUpdateCheckAt: normalizeOptionalString(record.lastUpdateCheckAt),
|
|
60
|
-
downloadedVersion: normalizeOptionalString(record.downloadedVersion),
|
|
61
|
-
downloadedReleaseNotesUrl: normalizeOptionalString(record.downloadedReleaseNotesUrl),
|
|
62
|
-
updatePreferences: normalizeUpdatePreferences(record.updatePreferences)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
var NpmRuntimeUpdateStateStore = class {
|
|
66
|
-
defaultChannel;
|
|
67
|
-
constructor(statePath, options = {}) {
|
|
68
|
-
this.statePath = statePath;
|
|
69
|
-
this.defaultChannel = options.defaultChannel ?? "stable";
|
|
70
|
-
}
|
|
71
|
-
read = () => {
|
|
72
|
-
if (!existsSync(this.statePath)) {
|
|
73
|
-
const defaultState = createDefaultState(this.defaultChannel);
|
|
74
|
-
return {
|
|
75
|
-
...defaultState,
|
|
76
|
-
updatePreferences: { ...defaultState.updatePreferences }
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
return normalizeState(JSON.parse(readFileSync(this.statePath, "utf8")), this.defaultChannel);
|
|
80
|
-
};
|
|
81
|
-
write = (state) => {
|
|
82
|
-
mkdirSync(dirname(this.statePath), { recursive: true });
|
|
83
|
-
writeFileSync(this.statePath, `${JSON.stringify(state, null, 2)}\n`, "utf8");
|
|
84
|
-
};
|
|
85
|
-
update = (updater) => {
|
|
86
|
-
const nextState = updater(this.read());
|
|
87
|
-
this.write(nextState);
|
|
88
|
-
return nextState;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
//#endregion
|
|
92
|
-
export { NpmRuntimeUpdateStateStore };
|
|
93
|
-
|
|
94
|
-
//# sourceMappingURL=npm-runtime-update-state.store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"npm-runtime-update-state.store.js","names":[],"sources":["../../src/launcher/npm-runtime-update-state.store.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname } from \"node:path\";\nimport type { NpmRuntimeUpdateState } from \"./npm-runtime-bundle.types.js\";\nimport type { NpmRuntimeReleaseChannel } from \"./npm-runtime-update-source.service.js\";\n\nfunction createDefaultState(channel: NpmRuntimeReleaseChannel): NpmRuntimeUpdateState {\n return {\n channel,\n currentVersion: null,\n previousVersion: null,\n candidateVersion: null,\n candidateLaunchCount: 0,\n lastKnownGoodVersion: null,\n badVersions: [],\n lastUpdateCheckAt: null,\n downloadedVersion: null,\n downloadedReleaseNotesUrl: null,\n updatePreferences: {\n automaticChecks: true,\n autoDownload: true\n }\n };\n}\n\nfunction normalizeOptionalString(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const trimmed = value.trim();\n return trimmed ? trimmed : null;\n}\n\nfunction normalizeChannel(value: unknown, fallback: NpmRuntimeReleaseChannel): NpmRuntimeReleaseChannel {\n if (typeof value !== \"string\") {\n return fallback;\n }\n const trimmed = value.trim().toLowerCase();\n if (trimmed === \"beta\") {\n return \"beta\";\n }\n if (trimmed === \"stable\") {\n return \"stable\";\n }\n return fallback;\n}\n\nfunction normalizeStringArray(value: unknown): string[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return [...new Set(value.filter((entry): entry is string => typeof entry === \"string\").map((entry) => entry.trim()).filter(Boolean))];\n}\n\nfunction normalizeUpdatePreferences(value: unknown): NpmRuntimeUpdateState[\"updatePreferences\"] {\n const defaultState = createDefaultState(\"stable\");\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return { ...defaultState.updatePreferences };\n }\n const record = value as Record<string, unknown>;\n return {\n automaticChecks:\n typeof record.automaticChecks === \"boolean\"\n ? record.automaticChecks\n : defaultState.updatePreferences.automaticChecks,\n autoDownload:\n typeof record.autoDownload === \"boolean\"\n ? record.autoDownload\n : defaultState.updatePreferences.autoDownload\n };\n}\n\nfunction normalizeState(input: unknown, defaultChannel: NpmRuntimeReleaseChannel): NpmRuntimeUpdateState {\n if (!input || typeof input !== \"object\" || Array.isArray(input)) {\n throw new Error(\"npm runtime update state must be an object\");\n }\n const record = input as Record<string, unknown>;\n const candidateLaunchCount = Number(record.candidateLaunchCount);\n return {\n channel: normalizeChannel(record.channel, defaultChannel),\n currentVersion: normalizeOptionalString(record.currentVersion),\n previousVersion: normalizeOptionalString(record.previousVersion),\n candidateVersion: normalizeOptionalString(record.candidateVersion),\n candidateLaunchCount: Number.isInteger(candidateLaunchCount) && candidateLaunchCount >= 0 ? candidateLaunchCount : 0,\n lastKnownGoodVersion: normalizeOptionalString(record.lastKnownGoodVersion),\n badVersions: normalizeStringArray(record.badVersions),\n lastUpdateCheckAt: normalizeOptionalString(record.lastUpdateCheckAt),\n downloadedVersion: normalizeOptionalString(record.downloadedVersion),\n downloadedReleaseNotesUrl: normalizeOptionalString(record.downloadedReleaseNotesUrl),\n updatePreferences: normalizeUpdatePreferences(record.updatePreferences)\n };\n}\n\ntype NpmRuntimeUpdateStateStoreOptions = {\n defaultChannel?: NpmRuntimeReleaseChannel;\n};\n\nexport class NpmRuntimeUpdateStateStore {\n private readonly defaultChannel: NpmRuntimeReleaseChannel;\n\n constructor(\n private readonly statePath: string,\n options: NpmRuntimeUpdateStateStoreOptions = {}\n ) {\n this.defaultChannel = options.defaultChannel ?? \"stable\";\n }\n\n read = (): NpmRuntimeUpdateState => {\n if (!existsSync(this.statePath)) {\n const defaultState = createDefaultState(this.defaultChannel);\n return { ...defaultState, updatePreferences: { ...defaultState.updatePreferences } };\n }\n return normalizeState(JSON.parse(readFileSync(this.statePath, \"utf8\")), this.defaultChannel);\n };\n\n write = (state: NpmRuntimeUpdateState): void => {\n mkdirSync(dirname(this.statePath), { recursive: true });\n writeFileSync(this.statePath, `${JSON.stringify(state, null, 2)}\\n`, \"utf8\");\n };\n\n update = (updater: (state: NpmRuntimeUpdateState) => NpmRuntimeUpdateState): NpmRuntimeUpdateState => {\n const nextState = updater(this.read());\n this.write(nextState);\n return nextState;\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { NpmRuntimeBundleLayoutStore } from "./npm-runtime-bundle-layout.store.js";
|
|
2
|
-
import { NpmRuntimeReleaseChannel } from "./npm-runtime-update-source.service.js";
|
|
3
|
-
import { NpmRuntimeUpdateStateStore } from "./npm-runtime-update-state.store.js";
|
|
4
|
-
import { NpmRuntimeBundleService } from "./npm-runtime-bundle.service.js";
|
|
5
|
-
import { NpmRuntimeUpdateService } from "./npm-runtime-update.service.js";
|
|
6
|
-
import { UpdateProgress, UpdateSnapshot } from "@nextclaw/kernel";
|
|
7
|
-
|
|
8
|
-
//#region src/launcher/npm-runtime-update.manager.d.ts
|
|
9
|
-
type NpmRuntimeUpdateManagerOptions = {
|
|
10
|
-
layout: NpmRuntimeBundleLayoutStore;
|
|
11
|
-
stateStore: NpmRuntimeUpdateStateStore;
|
|
12
|
-
bundleService: NpmRuntimeBundleService;
|
|
13
|
-
updateService: NpmRuntimeUpdateService;
|
|
14
|
-
resolveManifestUrl: (channel: NpmRuntimeReleaseChannel) => string | null;
|
|
15
|
-
launcherVersion?: string;
|
|
16
|
-
channel: NpmRuntimeReleaseChannel;
|
|
17
|
-
now?: () => Date;
|
|
18
|
-
};
|
|
19
|
-
type NpmRuntimeUpdateActionOptions = {
|
|
20
|
-
apply?: boolean;
|
|
21
|
-
applyAfterDownload?: boolean;
|
|
22
|
-
checkOnly?: boolean;
|
|
23
|
-
onProgress?: (progress: UpdateProgress) => void;
|
|
24
|
-
};
|
|
25
|
-
declare class NpmRuntimeUpdateManager {
|
|
26
|
-
private readonly options;
|
|
27
|
-
private readonly launcherVersion;
|
|
28
|
-
private readonly now;
|
|
29
|
-
private availableManifest;
|
|
30
|
-
constructor(options: NpmRuntimeUpdateManagerOptions);
|
|
31
|
-
getSnapshot: () => UpdateSnapshot;
|
|
32
|
-
run: (options?: NpmRuntimeUpdateActionOptions) => Promise<UpdateSnapshot>;
|
|
33
|
-
checkForUpdate: () => Promise<UpdateSnapshot>;
|
|
34
|
-
downloadUpdate: (onProgress?: (progress: UpdateProgress) => void) => Promise<UpdateSnapshot>;
|
|
35
|
-
applyDownloadedUpdate: () => UpdateSnapshot;
|
|
36
|
-
private ensureAvailableManifest;
|
|
37
|
-
private toSnapshotAfterCheck;
|
|
38
|
-
private syncStateFromCurrentPointer;
|
|
39
|
-
private toSnapshotFromState;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { NpmRuntimeUpdateManager };
|
|
43
|
-
//# sourceMappingURL=npm-runtime-update.manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"npm-runtime-update.manager.d.ts","names":[],"sources":["../../src/launcher/npm-runtime-update.manager.ts"],"mappings":";;;;;;;;KAUK,8BAAA;EACH,MAAA,EAAQ,2BAAA;EACR,UAAA,EAAY,0BAAA;EACZ,aAAA,EAAe,uBAAA;EACf,aAAA,EAAe,uBAAA;EACf,kBAAA,GAAqB,OAAA,EAAS,wBAAA;EAC9B,eAAA;EACA,OAAA,EAAS,wBAAA;EACT,GAAA,SAAY,IAAA;AAAA;AAAA,KAGT,6BAAA;EACH,KAAA;EACA,kBAAA;EACA,SAAA;EACA,UAAA,IAAc,QAAA,EAAU,cAAA;AAAA;AAAA,cAGb,uBAAA;EAAA,iBAKkB,OAAA;EAAA,iBAJZ,eAAA;EAAA,iBACA,GAAA;EAAA,QACT,iBAAA;cAEqB,OAAA,EAAS,8BAAA;EAOtC,WAAA,QAAkB,cAAA;EAIlB,GAAA,GAAa,OAAA,GAAS,6BAAA,KAAqC,OAAA,CAAQ,cAAA;EAuBnE,cAAA,QAA2B,OAAA,CAAQ,cAAA;EA+BnC,cAAA,GAAwB,UAAA,IAAc,QAAA,EAAU,cAAA,cAA0B,OAAA,CAAQ,cAAA;EAoBlF,qBAAA,QAA4B,cAAA;EAAA,QAiBpB,uBAAA;EAAA,QAWA,oBAAA;EAAA,QAsDA,2BAAA;EAAA,QAeA,mBAAA;AAAA"}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { getPackageVersion } from "../shared/utils/package/package-manifest.utils.js";
|
|
2
|
-
import "../shared/utils/cli.utils.js";
|
|
3
|
-
import { resolveEffectiveNpmRuntimeVersion } from "./npm-runtime-bundle.service.js";
|
|
4
|
-
//#region src/launcher/npm-runtime-update.manager.ts
|
|
5
|
-
var NpmRuntimeUpdateManager = class {
|
|
6
|
-
launcherVersion;
|
|
7
|
-
now;
|
|
8
|
-
availableManifest = null;
|
|
9
|
-
constructor(options) {
|
|
10
|
-
this.options = options;
|
|
11
|
-
this.launcherVersion = options.launcherVersion ?? getPackageVersion();
|
|
12
|
-
this.now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
13
|
-
this.options.layout.ensureLauncherDirs();
|
|
14
|
-
this.syncStateFromCurrentPointer();
|
|
15
|
-
}
|
|
16
|
-
getSnapshot = () => this.toSnapshotFromState(this.options.stateStore.read(), { status: this.options.stateStore.read().downloadedVersion ? "downloaded" : "idle" });
|
|
17
|
-
run = async (options = {}) => {
|
|
18
|
-
if (options.apply) return this.applyDownloadedUpdate();
|
|
19
|
-
const applyAfterDownload = options.applyAfterDownload ?? true;
|
|
20
|
-
const checkedSnapshot = await this.checkForUpdate();
|
|
21
|
-
if (options.checkOnly) return checkedSnapshot;
|
|
22
|
-
if (applyAfterDownload && checkedSnapshot.status === "downloaded") return this.applyDownloadedUpdate();
|
|
23
|
-
if (checkedSnapshot.status !== "update-available") return checkedSnapshot;
|
|
24
|
-
const downloadedSnapshot = await this.downloadUpdate(options.onProgress);
|
|
25
|
-
if (!applyAfterDownload || downloadedSnapshot.status !== "downloaded") return downloadedSnapshot;
|
|
26
|
-
return this.applyDownloadedUpdate();
|
|
27
|
-
};
|
|
28
|
-
checkForUpdate = async () => {
|
|
29
|
-
const manifestUrl = this.options.resolveManifestUrl(this.options.channel);
|
|
30
|
-
if (!this.options.updateService.hasSignatureVerifier()) return this.toSnapshotFromState(this.options.stateStore.read(), {
|
|
31
|
-
status: "blocked",
|
|
32
|
-
installationKind: "npm-runtime-bundle",
|
|
33
|
-
blockReason: "signature-verification-unavailable",
|
|
34
|
-
recoveryCommand: "Set NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY or NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY_PATH",
|
|
35
|
-
errorMessage: "Runtime bundle updates require a configured update public key."
|
|
36
|
-
});
|
|
37
|
-
if (!manifestUrl) return this.toSnapshotFromState(this.options.stateStore.read(), {
|
|
38
|
-
status: "blocked",
|
|
39
|
-
installationKind: "npm-runtime-bundle",
|
|
40
|
-
blockReason: "unsupported-installation",
|
|
41
|
-
recoveryCommand: "Set NEXTCLAW_UPDATE_MANIFEST_URL or NEXTCLAW_UPDATE_MANIFEST_BASE_URL",
|
|
42
|
-
errorMessage: "Runtime bundle update manifest URL is not configured."
|
|
43
|
-
});
|
|
44
|
-
const checkedAt = this.now().toISOString();
|
|
45
|
-
const state = this.options.stateStore.update((current) => ({
|
|
46
|
-
...current,
|
|
47
|
-
channel: this.options.channel,
|
|
48
|
-
lastUpdateCheckAt: checkedAt
|
|
49
|
-
}));
|
|
50
|
-
const availableUpdate = await this.options.updateService.checkForUpdate(manifestUrl, state.currentVersion, state.badVersions);
|
|
51
|
-
return this.toSnapshotAfterCheck(availableUpdate, this.options.stateStore.read());
|
|
52
|
-
};
|
|
53
|
-
downloadUpdate = async (onProgress) => {
|
|
54
|
-
const manifest = this.availableManifest ?? await this.ensureAvailableManifest();
|
|
55
|
-
const downloaded = await this.options.updateService.downloadAndInstallUpdate(manifest, onProgress);
|
|
56
|
-
const state = this.options.stateStore.update((current) => ({
|
|
57
|
-
...current,
|
|
58
|
-
downloadedVersion: downloaded.downloadedVersion,
|
|
59
|
-
downloadedReleaseNotesUrl: downloaded.manifest.releaseNotesUrl
|
|
60
|
-
}));
|
|
61
|
-
await this.options.bundleService.pruneRetainedArtifacts();
|
|
62
|
-
return this.toSnapshotFromState(state, {
|
|
63
|
-
status: "downloaded",
|
|
64
|
-
availableVersion: downloaded.downloadedVersion,
|
|
65
|
-
downloadedVersion: downloaded.downloadedVersion,
|
|
66
|
-
minimumHostVersion: downloaded.manifest.minimumLauncherVersion,
|
|
67
|
-
releaseNotesUrl: downloaded.manifest.releaseNotesUrl,
|
|
68
|
-
canApplyInApp: true,
|
|
69
|
-
requiresRestart: false
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
applyDownloadedUpdate = () => {
|
|
73
|
-
const downloadedVersion = this.options.stateStore.read().downloadedVersion?.trim();
|
|
74
|
-
if (!downloadedVersion) throw new Error("No downloaded npm runtime update is ready to apply.");
|
|
75
|
-
this.options.bundleService.activateVersion(downloadedVersion);
|
|
76
|
-
this.availableManifest = null;
|
|
77
|
-
return this.toSnapshotFromState(this.options.stateStore.read(), {
|
|
78
|
-
status: "restart-required",
|
|
79
|
-
availableVersion: null,
|
|
80
|
-
downloadedVersion: null,
|
|
81
|
-
releaseNotesUrl: null,
|
|
82
|
-
canApplyInApp: false,
|
|
83
|
-
requiresRestart: true
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
ensureAvailableManifest = async () => {
|
|
87
|
-
const snapshot = await this.checkForUpdate();
|
|
88
|
-
if (!this.availableManifest) {
|
|
89
|
-
if (snapshot.downloadedVersion) throw new Error(`Version ${snapshot.downloadedVersion} has already been downloaded and is ready to apply.`);
|
|
90
|
-
throw new Error("No npm runtime update is currently available.");
|
|
91
|
-
}
|
|
92
|
-
return this.availableManifest;
|
|
93
|
-
};
|
|
94
|
-
toSnapshotAfterCheck = (availableUpdate, state) => {
|
|
95
|
-
if (state.downloadedVersion) {
|
|
96
|
-
this.availableManifest = availableUpdate?.kind === "runtime-bundle-update" ? availableUpdate.manifest : this.availableManifest;
|
|
97
|
-
return this.toSnapshotFromState(state, {
|
|
98
|
-
status: "downloaded",
|
|
99
|
-
availableVersion: availableUpdate?.kind === "runtime-bundle-update" ? availableUpdate.manifest.latestVersion : state.downloadedVersion,
|
|
100
|
-
minimumHostVersion: availableUpdate?.kind === "runtime-bundle-update" ? availableUpdate.manifest.minimumLauncherVersion : null,
|
|
101
|
-
canApplyInApp: true,
|
|
102
|
-
requiresRestart: false
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
if (!availableUpdate) {
|
|
106
|
-
this.availableManifest = null;
|
|
107
|
-
return this.toSnapshotFromState(state, {
|
|
108
|
-
status: "up-to-date",
|
|
109
|
-
availableVersion: null,
|
|
110
|
-
downloadedVersion: null,
|
|
111
|
-
releaseNotesUrl: null
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
if (availableUpdate.kind === "host-update-required") {
|
|
115
|
-
this.availableManifest = null;
|
|
116
|
-
return this.toSnapshotFromState(state, {
|
|
117
|
-
status: "blocked",
|
|
118
|
-
availableVersion: availableUpdate.manifest.latestVersion,
|
|
119
|
-
minimumHostVersion: availableUpdate.manifest.minimumLauncherVersion,
|
|
120
|
-
releaseNotesUrl: availableUpdate.manifest.releaseNotesUrl,
|
|
121
|
-
blockReason: "host-too-old",
|
|
122
|
-
recoveryCommand: "npm install -g nextclaw@latest",
|
|
123
|
-
errorMessage: `NextClaw npm launcher ${this.launcherVersion} is too old for runtime bundle ${availableUpdate.manifest.latestVersion}.`
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
if (availableUpdate.kind === "quarantined-bad-version") {
|
|
127
|
-
this.availableManifest = null;
|
|
128
|
-
return this.toSnapshotFromState(state, {
|
|
129
|
-
status: "failed",
|
|
130
|
-
availableVersion: availableUpdate.manifest.latestVersion,
|
|
131
|
-
minimumHostVersion: availableUpdate.manifest.minimumLauncherVersion,
|
|
132
|
-
releaseNotesUrl: availableUpdate.manifest.releaseNotesUrl,
|
|
133
|
-
errorMessage: `Version ${availableUpdate.manifest.latestVersion} was quarantined after a failed launch.`
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
this.availableManifest = availableUpdate.manifest;
|
|
137
|
-
return this.toSnapshotFromState(state, {
|
|
138
|
-
status: "update-available",
|
|
139
|
-
availableVersion: availableUpdate.manifest.latestVersion,
|
|
140
|
-
minimumHostVersion: availableUpdate.manifest.minimumLauncherVersion,
|
|
141
|
-
releaseNotesUrl: availableUpdate.manifest.releaseNotesUrl
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
syncStateFromCurrentPointer = () => {
|
|
145
|
-
const currentPointer = this.options.layout.readCurrentPointer();
|
|
146
|
-
const effectiveCurrentVersion = resolveEffectiveNpmRuntimeVersion({
|
|
147
|
-
launcherVersion: this.launcherVersion,
|
|
148
|
-
currentBundleVersion: currentPointer?.version ?? null
|
|
149
|
-
});
|
|
150
|
-
if (!effectiveCurrentVersion) return;
|
|
151
|
-
this.options.stateStore.update((state) => ({
|
|
152
|
-
...state,
|
|
153
|
-
currentVersion: effectiveCurrentVersion
|
|
154
|
-
}));
|
|
155
|
-
};
|
|
156
|
-
toSnapshotFromState = (state, patch) => {
|
|
157
|
-
const hasDownloadedVersion = Boolean(state.downloadedVersion);
|
|
158
|
-
const { status } = patch;
|
|
159
|
-
return {
|
|
160
|
-
installationKind: "npm-runtime-bundle",
|
|
161
|
-
channel: state.channel,
|
|
162
|
-
hostVersion: this.launcherVersion,
|
|
163
|
-
currentVersion: state.currentVersion,
|
|
164
|
-
availableVersion: null,
|
|
165
|
-
downloadedVersion: state.downloadedVersion,
|
|
166
|
-
minimumHostVersion: null,
|
|
167
|
-
releaseNotesUrl: state.downloadedReleaseNotesUrl,
|
|
168
|
-
lastCheckedAt: state.lastUpdateCheckAt,
|
|
169
|
-
progress: null,
|
|
170
|
-
canAutoDownload: state.updatePreferences.autoDownload,
|
|
171
|
-
canApplyInApp: hasDownloadedVersion,
|
|
172
|
-
requiresRestart: false,
|
|
173
|
-
blockReason: null,
|
|
174
|
-
recoveryCommand: null,
|
|
175
|
-
errorMessage: null,
|
|
176
|
-
preferences: { ...state.updatePreferences },
|
|
177
|
-
...patch,
|
|
178
|
-
status
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
//#endregion
|
|
183
|
-
export { NpmRuntimeUpdateManager };
|
|
184
|
-
|
|
185
|
-
//# sourceMappingURL=npm-runtime-update.manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"npm-runtime-update.manager.js","names":[],"sources":["../../src/launcher/npm-runtime-update.manager.ts"],"sourcesContent":["import type { UpdateManifest, UpdateProgress, UpdateSnapshot } from \"@nextclaw/kernel\";\nimport { getPackageVersion } from \"@nextclaw-service/shared/utils/cli.utils.js\";\nimport { resolveEffectiveNpmRuntimeVersion } from \"./npm-runtime-bundle.service.js\";\nimport type { NpmRuntimeBundleService } from \"./npm-runtime-bundle.service.js\";\nimport type { NpmRuntimeBundleLayoutStore } from \"./npm-runtime-bundle-layout.store.js\";\nimport type { NpmRuntimeUpdateService, NpmRuntimeAvailableUpdate } from \"./npm-runtime-update.service.js\";\nimport type { NpmRuntimeUpdateStateStore } from \"./npm-runtime-update-state.store.js\";\nimport type { NpmRuntimeReleaseChannel } from \"./npm-runtime-update-source.service.js\";\nimport type { NpmRuntimeUpdateState } from \"./npm-runtime-bundle.types.js\";\n\ntype NpmRuntimeUpdateManagerOptions = {\n layout: NpmRuntimeBundleLayoutStore;\n stateStore: NpmRuntimeUpdateStateStore;\n bundleService: NpmRuntimeBundleService;\n updateService: NpmRuntimeUpdateService;\n resolveManifestUrl: (channel: NpmRuntimeReleaseChannel) => string | null;\n launcherVersion?: string;\n channel: NpmRuntimeReleaseChannel;\n now?: () => Date;\n};\n\ntype NpmRuntimeUpdateActionOptions = {\n apply?: boolean;\n applyAfterDownload?: boolean;\n checkOnly?: boolean;\n onProgress?: (progress: UpdateProgress) => void;\n};\n\nexport class NpmRuntimeUpdateManager {\n private readonly launcherVersion: string;\n private readonly now: () => Date;\n private availableManifest: UpdateManifest | null = null;\n\n constructor(private readonly options: NpmRuntimeUpdateManagerOptions) {\n this.launcherVersion = options.launcherVersion ?? getPackageVersion();\n this.now = options.now ?? (() => new Date());\n this.options.layout.ensureLauncherDirs();\n this.syncStateFromCurrentPointer();\n }\n\n getSnapshot = (): UpdateSnapshot => this.toSnapshotFromState(this.options.stateStore.read(), {\n status: this.options.stateStore.read().downloadedVersion ? \"downloaded\" : \"idle\"\n });\n\n run = async (options: NpmRuntimeUpdateActionOptions = {}): Promise<UpdateSnapshot> => {\n if (options.apply) {\n return this.applyDownloadedUpdate();\n }\n\n const applyAfterDownload = options.applyAfterDownload ?? true;\n const checkedSnapshot = await this.checkForUpdate();\n if (options.checkOnly) {\n return checkedSnapshot;\n }\n if (applyAfterDownload && checkedSnapshot.status === \"downloaded\") {\n return this.applyDownloadedUpdate();\n }\n if (checkedSnapshot.status !== \"update-available\") {\n return checkedSnapshot;\n }\n const downloadedSnapshot = await this.downloadUpdate(options.onProgress);\n if (!applyAfterDownload || downloadedSnapshot.status !== \"downloaded\") {\n return downloadedSnapshot;\n }\n return this.applyDownloadedUpdate();\n };\n\n checkForUpdate = async (): Promise<UpdateSnapshot> => {\n const manifestUrl = this.options.resolveManifestUrl(this.options.channel);\n if (!this.options.updateService.hasSignatureVerifier()) {\n return this.toSnapshotFromState(this.options.stateStore.read(), {\n status: \"blocked\",\n installationKind: \"npm-runtime-bundle\",\n blockReason: \"signature-verification-unavailable\",\n recoveryCommand: \"Set NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY or NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY_PATH\",\n errorMessage: \"Runtime bundle updates require a configured update public key.\"\n });\n }\n if (!manifestUrl) {\n return this.toSnapshotFromState(this.options.stateStore.read(), {\n status: \"blocked\",\n installationKind: \"npm-runtime-bundle\",\n blockReason: \"unsupported-installation\",\n recoveryCommand: \"Set NEXTCLAW_UPDATE_MANIFEST_URL or NEXTCLAW_UPDATE_MANIFEST_BASE_URL\",\n errorMessage: \"Runtime bundle update manifest URL is not configured.\"\n });\n }\n\n const checkedAt = this.now().toISOString();\n const state = this.options.stateStore.update((current) => ({\n ...current,\n channel: this.options.channel,\n lastUpdateCheckAt: checkedAt\n }));\n const availableUpdate = await this.options.updateService.checkForUpdate(manifestUrl, state.currentVersion, state.badVersions);\n return this.toSnapshotAfterCheck(availableUpdate, this.options.stateStore.read());\n };\n\n downloadUpdate = async (onProgress?: (progress: UpdateProgress) => void): Promise<UpdateSnapshot> => {\n const manifest = this.availableManifest ?? await this.ensureAvailableManifest();\n const downloaded = await this.options.updateService.downloadAndInstallUpdate(manifest, onProgress);\n const state = this.options.stateStore.update((current) => ({\n ...current,\n downloadedVersion: downloaded.downloadedVersion,\n downloadedReleaseNotesUrl: downloaded.manifest.releaseNotesUrl\n }));\n await this.options.bundleService.pruneRetainedArtifacts();\n return this.toSnapshotFromState(state, {\n status: \"downloaded\",\n availableVersion: downloaded.downloadedVersion,\n downloadedVersion: downloaded.downloadedVersion,\n minimumHostVersion: downloaded.manifest.minimumLauncherVersion,\n releaseNotesUrl: downloaded.manifest.releaseNotesUrl,\n canApplyInApp: true,\n requiresRestart: false\n });\n };\n\n applyDownloadedUpdate = (): UpdateSnapshot => {\n const downloadedVersion = this.options.stateStore.read().downloadedVersion?.trim();\n if (!downloadedVersion) {\n throw new Error(\"No downloaded npm runtime update is ready to apply.\");\n }\n this.options.bundleService.activateVersion(downloadedVersion);\n this.availableManifest = null;\n return this.toSnapshotFromState(this.options.stateStore.read(), {\n status: \"restart-required\",\n availableVersion: null,\n downloadedVersion: null,\n releaseNotesUrl: null,\n canApplyInApp: false,\n requiresRestart: true\n });\n };\n\n private ensureAvailableManifest = async (): Promise<UpdateManifest> => {\n const snapshot = await this.checkForUpdate();\n if (!this.availableManifest) {\n if (snapshot.downloadedVersion) {\n throw new Error(`Version ${snapshot.downloadedVersion} has already been downloaded and is ready to apply.`);\n }\n throw new Error(\"No npm runtime update is currently available.\");\n }\n return this.availableManifest;\n };\n\n private toSnapshotAfterCheck = (\n availableUpdate: NpmRuntimeAvailableUpdate | null,\n state: NpmRuntimeUpdateState\n ): UpdateSnapshot => {\n if (state.downloadedVersion) {\n this.availableManifest = availableUpdate?.kind === \"runtime-bundle-update\" ? availableUpdate.manifest : this.availableManifest;\n return this.toSnapshotFromState(state, {\n status: \"downloaded\",\n availableVersion: availableUpdate?.kind === \"runtime-bundle-update\" ? availableUpdate.manifest.latestVersion : state.downloadedVersion,\n minimumHostVersion: availableUpdate?.kind === \"runtime-bundle-update\" ? availableUpdate.manifest.minimumLauncherVersion : null,\n canApplyInApp: true,\n requiresRestart: false\n });\n }\n if (!availableUpdate) {\n this.availableManifest = null;\n return this.toSnapshotFromState(state, {\n status: \"up-to-date\",\n availableVersion: null,\n downloadedVersion: null,\n releaseNotesUrl: null\n });\n }\n if (availableUpdate.kind === \"host-update-required\") {\n this.availableManifest = null;\n return this.toSnapshotFromState(state, {\n status: \"blocked\",\n availableVersion: availableUpdate.manifest.latestVersion,\n minimumHostVersion: availableUpdate.manifest.minimumLauncherVersion,\n releaseNotesUrl: availableUpdate.manifest.releaseNotesUrl,\n blockReason: \"host-too-old\",\n recoveryCommand: \"npm install -g nextclaw@latest\",\n errorMessage: `NextClaw npm launcher ${this.launcherVersion} is too old for runtime bundle ${availableUpdate.manifest.latestVersion}.`\n });\n }\n if (availableUpdate.kind === \"quarantined-bad-version\") {\n this.availableManifest = null;\n return this.toSnapshotFromState(state, {\n status: \"failed\",\n availableVersion: availableUpdate.manifest.latestVersion,\n minimumHostVersion: availableUpdate.manifest.minimumLauncherVersion,\n releaseNotesUrl: availableUpdate.manifest.releaseNotesUrl,\n errorMessage: `Version ${availableUpdate.manifest.latestVersion} was quarantined after a failed launch.`\n });\n }\n this.availableManifest = availableUpdate.manifest;\n return this.toSnapshotFromState(state, {\n status: \"update-available\",\n availableVersion: availableUpdate.manifest.latestVersion,\n minimumHostVersion: availableUpdate.manifest.minimumLauncherVersion,\n releaseNotesUrl: availableUpdate.manifest.releaseNotesUrl\n });\n };\n\n private syncStateFromCurrentPointer = (): void => {\n const currentPointer = this.options.layout.readCurrentPointer();\n const effectiveCurrentVersion = resolveEffectiveNpmRuntimeVersion({\n launcherVersion: this.launcherVersion,\n currentBundleVersion: currentPointer?.version ?? null\n });\n if (!effectiveCurrentVersion) {\n return;\n }\n this.options.stateStore.update((state) => ({\n ...state,\n currentVersion: effectiveCurrentVersion\n }));\n };\n\n private toSnapshotFromState = (\n state: NpmRuntimeUpdateState,\n patch: Partial<UpdateSnapshot> & Pick<UpdateSnapshot, \"status\">\n ): UpdateSnapshot => {\n const hasDownloadedVersion = Boolean(state.downloadedVersion);\n const { status } = patch;\n return {\n installationKind: \"npm-runtime-bundle\",\n channel: state.channel,\n hostVersion: this.launcherVersion,\n currentVersion: state.currentVersion,\n availableVersion: null,\n downloadedVersion: state.downloadedVersion,\n minimumHostVersion: null,\n releaseNotesUrl: state.downloadedReleaseNotesUrl,\n lastCheckedAt: state.lastUpdateCheckAt,\n progress: null,\n canAutoDownload: state.updatePreferences.autoDownload,\n canApplyInApp: hasDownloadedVersion,\n requiresRestart: false,\n blockReason: null,\n recoveryCommand: null,\n errorMessage: null,\n preferences: { ...state.updatePreferences },\n ...patch,\n status\n };\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { NpmRuntimeDownloadedUpdate, NpmRuntimeUpdateProgressReporter } from "./npm-runtime-bundle.types.js";
|
|
2
|
-
import { NpmRuntimeBundleLayoutStore } from "./npm-runtime-bundle-layout.store.js";
|
|
3
|
-
import { NpmRuntimeBundleService } from "./npm-runtime-bundle.service.js";
|
|
4
|
-
import { UpdateManifest, UpdateManifestReader } from "@nextclaw/kernel";
|
|
5
|
-
|
|
6
|
-
//#region src/launcher/npm-runtime-update.service.d.ts
|
|
7
|
-
type FetchLike = typeof fetch;
|
|
8
|
-
type NpmRuntimeUpdateServiceOptions = {
|
|
9
|
-
layout: NpmRuntimeBundleLayoutStore;
|
|
10
|
-
bundleService: NpmRuntimeBundleService;
|
|
11
|
-
launcherVersion: string;
|
|
12
|
-
bundlePublicKey?: string;
|
|
13
|
-
fetchImpl?: FetchLike;
|
|
14
|
-
platform?: NodeJS.Platform;
|
|
15
|
-
arch?: string;
|
|
16
|
-
manifestReader?: UpdateManifestReader;
|
|
17
|
-
now?: () => number;
|
|
18
|
-
};
|
|
19
|
-
type NpmRuntimeAvailableUpdate = {
|
|
20
|
-
kind: "runtime-bundle-update";
|
|
21
|
-
manifest: UpdateManifest;
|
|
22
|
-
} | {
|
|
23
|
-
kind: "host-update-required";
|
|
24
|
-
manifest: UpdateManifest;
|
|
25
|
-
} | {
|
|
26
|
-
kind: "quarantined-bad-version";
|
|
27
|
-
manifest: UpdateManifest;
|
|
28
|
-
};
|
|
29
|
-
declare class NpmRuntimeUpdateService {
|
|
30
|
-
private readonly options;
|
|
31
|
-
private readonly platform;
|
|
32
|
-
private readonly arch;
|
|
33
|
-
private readonly fetchImpl;
|
|
34
|
-
private readonly manifestReader;
|
|
35
|
-
private readonly bundlePublicKey;
|
|
36
|
-
private readonly now;
|
|
37
|
-
constructor(options: NpmRuntimeUpdateServiceOptions);
|
|
38
|
-
hasSignatureVerifier: () => boolean;
|
|
39
|
-
checkForUpdate: (manifestUrl: string, currentVersion: string | null, badVersions?: string[]) => Promise<NpmRuntimeAvailableUpdate | null>;
|
|
40
|
-
downloadAndInstallUpdate: (manifest: UpdateManifest, reportProgress?: NpmRuntimeUpdateProgressReporter) => Promise<NpmRuntimeDownloadedUpdate>;
|
|
41
|
-
private downloadBundleBytes;
|
|
42
|
-
private fetchManifest;
|
|
43
|
-
private verifyManifest;
|
|
44
|
-
private fetchBundle;
|
|
45
|
-
private readResponseBytes;
|
|
46
|
-
private readContentLength;
|
|
47
|
-
private reportDownloadProgress;
|
|
48
|
-
private findBundleRoot;
|
|
49
|
-
private parseBundlePublicKey;
|
|
50
|
-
private assertManifestSignature;
|
|
51
|
-
private assertBundleSignature;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
export { NpmRuntimeAvailableUpdate, NpmRuntimeUpdateService };
|
|
55
|
-
//# sourceMappingURL=npm-runtime-update.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"npm-runtime-update.service.d.ts","names":[],"sources":["../../src/launcher/npm-runtime-update.service.ts"],"mappings":";;;;;;KAkBK,SAAA,UAAmB,KAAA;AAAA,KAEnB,8BAAA;EACH,MAAA,EAAQ,2BAAA;EACR,aAAA,EAAe,uBAAA;EACf,eAAA;EACA,eAAA;EACA,SAAA,GAAY,SAAA;EACZ,QAAA,GAAW,MAAA,CAAO,QAAA;EAClB,IAAA;EACA,cAAA,GAAiB,oBAAA;EACjB,GAAA;AAAA;AAAA,KAGU,yBAAA;EACN,IAAA;EAA+B,QAAA,EAAU,cAAA;AAAA;EACzC,IAAA;EAA8B,QAAA,EAAU,cAAA;AAAA;EACxC,IAAA;EAAiC,QAAA,EAAU,cAAA;AAAA;AAAA,cAEpC,uBAAA;EAAA,iBAQkB,OAAA;EAAA,iBAPZ,QAAA;EAAA,iBACA,IAAA;EAAA,iBACA,SAAA;EAAA,iBACA,cAAA;EAAA,iBACA,eAAA;EAAA,iBACA,GAAA;cAEY,OAAA,EAAS,8BAAA;EAStC,oBAAA;EAEA,cAAA,GAAwB,WAAA,UAAqB,cAAA,iBAA+B,WAAA,gBAA6B,OAAA,CAAQ,yBAAA;EAcjH,wBAAA,GACE,QAAA,EAAU,cAAA,EACV,cAAA,GAAiB,gCAAA,KAChB,OAAA,CAAQ,0BAAA;EAAA,QAmCH,mBAAA;EAAA,QAcA,aAAA;EAAA,QAaA,cAAA;EAAA,QAiBA,WAAA;EAAA,QAiBA,iBAAA;EAAA,QA0BA,iBAAA;EAAA,QASA,sBAAA;EAAA,QAYA,cAAA;EAAA,QAYA,oBAAA;EAAA,QAgBA,uBAAA;EAAA,QAWA,qBAAA;AAAA"}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { compareNpmRuntimeVersions } from "./npm-runtime-bundle.service.js";
|
|
2
|
-
import { UpdateManifestReader, serializeUnsignedUpdateManifest } from "@nextclaw/kernel";
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { dirname, join, resolve, sep } from "node:path";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { rm } from "node:fs/promises";
|
|
7
|
-
import { createHash, createPublicKey, verify } from "node:crypto";
|
|
8
|
-
import JSZip from "jszip";
|
|
9
|
-
//#region src/launcher/npm-runtime-update.service.ts
|
|
10
|
-
var NpmRuntimeUpdateService = class {
|
|
11
|
-
platform;
|
|
12
|
-
arch;
|
|
13
|
-
fetchImpl;
|
|
14
|
-
manifestReader;
|
|
15
|
-
bundlePublicKey;
|
|
16
|
-
now;
|
|
17
|
-
constructor(options) {
|
|
18
|
-
this.options = options;
|
|
19
|
-
this.platform = options.platform ?? process.platform;
|
|
20
|
-
this.arch = options.arch ?? process.arch;
|
|
21
|
-
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
22
|
-
this.manifestReader = options.manifestReader ?? new UpdateManifestReader();
|
|
23
|
-
this.bundlePublicKey = this.parseBundlePublicKey(options.bundlePublicKey);
|
|
24
|
-
this.now = options.now ?? Date.now;
|
|
25
|
-
}
|
|
26
|
-
hasSignatureVerifier = () => Boolean(this.bundlePublicKey);
|
|
27
|
-
checkForUpdate = async (manifestUrl, currentVersion, badVersions = []) => {
|
|
28
|
-
const manifest = await this.fetchManifest(manifestUrl);
|
|
29
|
-
if (currentVersion && compareNpmRuntimeVersions(manifest.latestVersion, currentVersion) <= 0) return null;
|
|
30
|
-
if (compareNpmRuntimeVersions(this.options.launcherVersion, manifest.minimumLauncherVersion) < 0) return {
|
|
31
|
-
kind: "host-update-required",
|
|
32
|
-
manifest
|
|
33
|
-
};
|
|
34
|
-
if (badVersions.includes(manifest.latestVersion)) return {
|
|
35
|
-
kind: "quarantined-bad-version",
|
|
36
|
-
manifest
|
|
37
|
-
};
|
|
38
|
-
return {
|
|
39
|
-
kind: "runtime-bundle-update",
|
|
40
|
-
manifest
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
downloadAndInstallUpdate = async (manifest, reportProgress) => {
|
|
44
|
-
const bytes = await this.downloadBundleBytes(manifest, reportProgress);
|
|
45
|
-
const stagingRoot = join(this.options.layout.getStagingDir(), `download-${manifest.latestVersion}-${this.now()}`);
|
|
46
|
-
await rm(stagingRoot, {
|
|
47
|
-
recursive: true,
|
|
48
|
-
force: true
|
|
49
|
-
});
|
|
50
|
-
mkdirSync(stagingRoot, { recursive: true });
|
|
51
|
-
try {
|
|
52
|
-
const zip = await JSZip.loadAsync(bytes);
|
|
53
|
-
const entries = Object.values(zip.files);
|
|
54
|
-
await Promise.all(entries.map(async (entry) => {
|
|
55
|
-
const targetPath = resolve(stagingRoot, entry.name);
|
|
56
|
-
const resolvedStagingRoot = resolve(stagingRoot);
|
|
57
|
-
if (targetPath !== resolvedStagingRoot && !targetPath.startsWith(`${resolvedStagingRoot}${sep}`)) throw new Error(`runtime bundle archive contains invalid path: ${entry.name}`);
|
|
58
|
-
if (entry.dir) {
|
|
59
|
-
mkdirSync(targetPath, { recursive: true });
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
mkdirSync(dirname(targetPath), { recursive: true });
|
|
63
|
-
writeFileSync(targetPath, Buffer.from(await entry.async("uint8array")));
|
|
64
|
-
}));
|
|
65
|
-
const bundleRoot = this.findBundleRoot(stagingRoot);
|
|
66
|
-
const installedBundle = await this.options.bundleService.installFromDirectory(bundleRoot);
|
|
67
|
-
return {
|
|
68
|
-
manifest,
|
|
69
|
-
downloadedVersion: installedBundle.manifest.bundleVersion,
|
|
70
|
-
bundleDirectory: installedBundle.bundleDirectory
|
|
71
|
-
};
|
|
72
|
-
} catch (error) {
|
|
73
|
-
await rm(stagingRoot, {
|
|
74
|
-
recursive: true,
|
|
75
|
-
force: true
|
|
76
|
-
});
|
|
77
|
-
throw error;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
downloadBundleBytes = async (manifest, reportProgress) => {
|
|
81
|
-
const response = await this.fetchBundle(manifest.bundleUrl);
|
|
82
|
-
const bytes = await this.readResponseBytes(response, reportProgress);
|
|
83
|
-
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
84
|
-
if (sha256 !== manifest.bundleSha256) throw new Error(`runtime bundle sha256 mismatch: expected ${manifest.bundleSha256} but got ${sha256}`);
|
|
85
|
-
this.assertBundleSignature(manifest, bytes);
|
|
86
|
-
return bytes;
|
|
87
|
-
};
|
|
88
|
-
fetchManifest = async (manifestUrl) => {
|
|
89
|
-
if (manifestUrl.startsWith("file://")) {
|
|
90
|
-
const manifest = this.manifestReader.parse(JSON.parse(readFileSync(fileURLToPath(manifestUrl), "utf8")), manifestUrl);
|
|
91
|
-
return this.verifyManifest(manifest, manifestUrl);
|
|
92
|
-
}
|
|
93
|
-
const response = await this.fetchImpl(manifestUrl);
|
|
94
|
-
if (!response.ok) throw new Error(`runtime update manifest request failed with status ${response.status}`);
|
|
95
|
-
const manifest = this.manifestReader.parse(await response.json(), manifestUrl);
|
|
96
|
-
return this.verifyManifest(manifest, manifestUrl);
|
|
97
|
-
};
|
|
98
|
-
verifyManifest = (manifest, _manifestUrl) => {
|
|
99
|
-
if (manifest.hostKind && manifest.hostKind !== "npm-runtime-bundle") throw new Error(`runtime update manifest hostKind mismatch: expected npm-runtime-bundle but got ${manifest.hostKind}`);
|
|
100
|
-
if (manifest.channel !== "stable" && manifest.channel !== "beta") throw new Error(`runtime update manifest channel is unsupported: ${manifest.channel}`);
|
|
101
|
-
if (manifest.platform !== this.platform) throw new Error(`runtime update manifest platform mismatch: expected ${this.platform} but got ${manifest.platform}`);
|
|
102
|
-
if (manifest.arch !== this.arch) throw new Error(`runtime update manifest arch mismatch: expected ${this.arch} but got ${manifest.arch}`);
|
|
103
|
-
this.assertManifestSignature(manifest);
|
|
104
|
-
return manifest;
|
|
105
|
-
};
|
|
106
|
-
fetchBundle = async (bundleUrl) => {
|
|
107
|
-
if (bundleUrl.startsWith("file://")) {
|
|
108
|
-
const bytes = readFileSync(fileURLToPath(bundleUrl));
|
|
109
|
-
return new Response(bytes, {
|
|
110
|
-
status: 200,
|
|
111
|
-
headers: { "content-length": String(bytes.byteLength) }
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
const response = await this.fetchImpl(bundleUrl);
|
|
115
|
-
if (!response.ok) throw new Error(`runtime bundle download failed with status ${response.status}`);
|
|
116
|
-
return response;
|
|
117
|
-
};
|
|
118
|
-
readResponseBytes = async (response, reportProgress) => {
|
|
119
|
-
const totalBytes = this.readContentLength(response);
|
|
120
|
-
if (!response.body) {
|
|
121
|
-
const bytes = Buffer.from(await response.arrayBuffer());
|
|
122
|
-
this.reportDownloadProgress(reportProgress, bytes.byteLength, totalBytes ?? bytes.byteLength);
|
|
123
|
-
return bytes;
|
|
124
|
-
}
|
|
125
|
-
const reader = response.body.getReader();
|
|
126
|
-
const chunks = [];
|
|
127
|
-
let downloadedBytes = 0;
|
|
128
|
-
this.reportDownloadProgress(reportProgress, downloadedBytes, totalBytes);
|
|
129
|
-
while (true) {
|
|
130
|
-
const next = await reader.read();
|
|
131
|
-
if (next.done) break;
|
|
132
|
-
chunks.push(next.value);
|
|
133
|
-
downloadedBytes += next.value.byteLength;
|
|
134
|
-
this.reportDownloadProgress(reportProgress, downloadedBytes, totalBytes);
|
|
135
|
-
}
|
|
136
|
-
return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)));
|
|
137
|
-
};
|
|
138
|
-
readContentLength = (response) => {
|
|
139
|
-
const raw = response.headers.get("content-length");
|
|
140
|
-
if (!raw) return null;
|
|
141
|
-
const parsed = Number(raw);
|
|
142
|
-
return Number.isFinite(parsed) && parsed >= 0 ? parsed : null;
|
|
143
|
-
};
|
|
144
|
-
reportDownloadProgress = (reportProgress, downloadedBytes, totalBytes) => {
|
|
145
|
-
reportProgress?.({
|
|
146
|
-
downloadedBytes,
|
|
147
|
-
totalBytes,
|
|
148
|
-
percent: totalBytes && totalBytes > 0 ? Math.min(100, Math.round(downloadedBytes / totalBytes * 100)) : null
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
findBundleRoot = (stagingRoot) => {
|
|
152
|
-
if (existsSync(join(stagingRoot, "manifest.json"))) return stagingRoot;
|
|
153
|
-
const entries = readDirectoryNames(stagingRoot).filter((entry) => existsSync(join(stagingRoot, entry, "manifest.json")));
|
|
154
|
-
if (entries.length === 1) return join(stagingRoot, entries[0]);
|
|
155
|
-
throw new Error(`runtime bundle archive does not contain exactly one manifest root under ${stagingRoot}`);
|
|
156
|
-
};
|
|
157
|
-
parseBundlePublicKey = (publicKey) => {
|
|
158
|
-
const normalizedKey = publicKey?.trim();
|
|
159
|
-
if (!normalizedKey) return null;
|
|
160
|
-
const pemOrEscapedPem = normalizedKey.replaceAll("\\n", "\n");
|
|
161
|
-
if (pemOrEscapedPem.includes("BEGIN PUBLIC KEY")) return createPublicKey(pemOrEscapedPem);
|
|
162
|
-
return createPublicKey({
|
|
163
|
-
key: Buffer.from(normalizedKey, "base64"),
|
|
164
|
-
format: "der",
|
|
165
|
-
type: "spki"
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
assertManifestSignature = (manifest) => {
|
|
169
|
-
if (!this.bundlePublicKey) throw new Error("runtime update manifest signature verification requires bundlePublicKey");
|
|
170
|
-
const signature = Buffer.from(manifest.manifestSignature, "base64");
|
|
171
|
-
if (!verify(null, Buffer.from(serializeUnsignedUpdateManifest(manifest)), this.bundlePublicKey, signature)) throw new Error(`runtime update manifest signature verification failed for ${manifest.latestVersion}`);
|
|
172
|
-
};
|
|
173
|
-
assertBundleSignature = (manifest, bytes) => {
|
|
174
|
-
if (!this.bundlePublicKey) throw new Error("runtime bundle signature verification requires bundlePublicKey");
|
|
175
|
-
const signature = Buffer.from(manifest.bundleSignature, "base64");
|
|
176
|
-
if (!verify(null, bytes, this.bundlePublicKey, signature)) throw new Error(`runtime bundle signature verification failed for ${manifest.latestVersion}`);
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
function readDirectoryNames(directory) {
|
|
180
|
-
return readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
181
|
-
}
|
|
182
|
-
//#endregion
|
|
183
|
-
export { NpmRuntimeUpdateService };
|
|
184
|
-
|
|
185
|
-
//# sourceMappingURL=npm-runtime-update.service.js.map
|