@nextclaw/service 0.2.12 → 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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region src/services/runtime/npm-runtime-update-source.service.ts
|
|
5
|
+
const DEFAULT_NPM_RUNTIME_UPDATE_BASE_URL = "https://Peiiii.github.io/nextclaw/npm-runtime-updates";
|
|
6
|
+
function normalizeOptionalString(value) {
|
|
7
|
+
if (typeof value !== "string") return null;
|
|
8
|
+
const trimmed = value.trim();
|
|
9
|
+
return trimmed ? trimmed : null;
|
|
10
|
+
}
|
|
11
|
+
function normalizeChannel(value) {
|
|
12
|
+
return typeof value === "string" && value.trim().toLowerCase() === "beta" ? "beta" : "stable";
|
|
13
|
+
}
|
|
14
|
+
function inferDefaultNpmRuntimeReleaseChannel(launcherVersion) {
|
|
15
|
+
return typeof launcherVersion === "string" && launcherVersion.toLowerCase().includes("-beta") ? "beta" : "stable";
|
|
16
|
+
}
|
|
17
|
+
function resolvePackagedPublicKeyPath() {
|
|
18
|
+
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
const candidates = [
|
|
20
|
+
resolve(moduleDir, "..", "resources", "update-bundle-public.pem"),
|
|
21
|
+
resolve(moduleDir, "../../..", "resources", "update-bundle-public.pem"),
|
|
22
|
+
resolve(moduleDir, "../../../..", "resources", "update-bundle-public.pem")
|
|
23
|
+
];
|
|
24
|
+
return candidates.find((candidate) => existsSync(candidate)) ?? candidates[0];
|
|
25
|
+
}
|
|
26
|
+
var NpmRuntimeUpdateSourceService = class {
|
|
27
|
+
env;
|
|
28
|
+
platform;
|
|
29
|
+
arch;
|
|
30
|
+
packagedPublicKeyPath;
|
|
31
|
+
constructor(options = {}) {
|
|
32
|
+
this.env = options.env ?? process.env;
|
|
33
|
+
this.platform = options.platform ?? process.platform;
|
|
34
|
+
this.arch = options.arch ?? process.arch;
|
|
35
|
+
this.packagedPublicKeyPath = options.packagedPublicKeyPath;
|
|
36
|
+
}
|
|
37
|
+
resolveChannel = (explicitChannel, launcherVersion) => {
|
|
38
|
+
if (explicitChannel !== void 0 || this.env.NEXTCLAW_UPDATE_CHANNEL !== void 0) return normalizeChannel(explicitChannel ?? this.env.NEXTCLAW_UPDATE_CHANNEL);
|
|
39
|
+
return inferDefaultNpmRuntimeReleaseChannel(launcherVersion);
|
|
40
|
+
};
|
|
41
|
+
resolveManifestUrl = (channel, explicitManifestUrl) => {
|
|
42
|
+
const manifestUrl = normalizeOptionalString(explicitManifestUrl) ?? normalizeOptionalString(this.env.NEXTCLAW_UPDATE_MANIFEST_URL);
|
|
43
|
+
if (manifestUrl) return manifestUrl;
|
|
44
|
+
const baseUrl = normalizeOptionalString(this.env.NEXTCLAW_UPDATE_MANIFEST_BASE_URL) ?? DEFAULT_NPM_RUNTIME_UPDATE_BASE_URL;
|
|
45
|
+
return new URL(`${channel}/manifest-${channel}-${this.platform}-${this.arch}.json`, `${baseUrl.replace(/\/+$/, "")}/`).toString();
|
|
46
|
+
};
|
|
47
|
+
resolveBundlePublicKey = () => {
|
|
48
|
+
const explicitPublicKey = normalizeOptionalString(this.env.NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY);
|
|
49
|
+
if (explicitPublicKey) return explicitPublicKey;
|
|
50
|
+
const publicKeyPath = normalizeOptionalString(this.env.NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY_PATH);
|
|
51
|
+
if (!publicKeyPath || !existsSync(publicKeyPath)) {
|
|
52
|
+
const packagedPublicKeyPath = this.packagedPublicKeyPath ?? resolvePackagedPublicKeyPath();
|
|
53
|
+
return existsSync(packagedPublicKeyPath) ? readFileSync(packagedPublicKeyPath, "utf8").trim() : null;
|
|
54
|
+
}
|
|
55
|
+
return readFileSync(publicKeyPath, "utf8").trim();
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { NpmRuntimeUpdateSourceService, inferDefaultNpmRuntimeReleaseChannel };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=npm-runtime-update-source.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-runtime-update-source.service.js","names":[],"sources":["../../../src/services/runtime/npm-runtime-update-source.service.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nexport type NpmRuntimeReleaseChannel = \"stable\" | \"beta\";\n\nconst DEFAULT_NPM_RUNTIME_UPDATE_BASE_URL = \"https://Peiiii.github.io/nextclaw/npm-runtime-updates\";\n\ntype NpmRuntimeUpdateSourceServiceOptions = {\n env?: NodeJS.ProcessEnv;\n platform?: NodeJS.Platform;\n arch?: string;\n packagedPublicKeyPath?: string;\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): NpmRuntimeReleaseChannel {\n return typeof value === \"string\" && value.trim().toLowerCase() === \"beta\" ? \"beta\" : \"stable\";\n}\n\nexport function inferDefaultNpmRuntimeReleaseChannel(launcherVersion?: string | null): NpmRuntimeReleaseChannel {\n return typeof launcherVersion === \"string\" && launcherVersion.toLowerCase().includes(\"-beta\") ? \"beta\" : \"stable\";\n}\n\nfunction resolvePackagedPublicKeyPath(): string {\n const moduleDir = dirname(fileURLToPath(import.meta.url));\n const candidates = [\n resolve(moduleDir, \"..\", \"resources\", \"update-bundle-public.pem\"),\n resolve(moduleDir, \"../../..\", \"resources\", \"update-bundle-public.pem\"),\n resolve(moduleDir, \"../../../..\", \"resources\", \"update-bundle-public.pem\")\n ];\n return candidates.find((candidate) => existsSync(candidate)) ?? candidates[0];\n}\n\nexport class NpmRuntimeUpdateSourceService {\n private readonly env: NodeJS.ProcessEnv;\n private readonly platform: NodeJS.Platform;\n private readonly arch: string;\n private readonly packagedPublicKeyPath?: string;\n\n constructor(options: NpmRuntimeUpdateSourceServiceOptions = {}) {\n this.env = options.env ?? process.env;\n this.platform = options.platform ?? process.platform;\n this.arch = options.arch ?? process.arch;\n this.packagedPublicKeyPath = options.packagedPublicKeyPath;\n }\n\n resolveChannel = (explicitChannel?: unknown, launcherVersion?: string | null): NpmRuntimeReleaseChannel => {\n if (explicitChannel !== undefined || this.env.NEXTCLAW_UPDATE_CHANNEL !== undefined) {\n return normalizeChannel(explicitChannel ?? this.env.NEXTCLAW_UPDATE_CHANNEL);\n }\n return inferDefaultNpmRuntimeReleaseChannel(launcherVersion);\n };\n\n resolveManifestUrl = (channel: NpmRuntimeReleaseChannel, explicitManifestUrl?: unknown): string | null => {\n const manifestUrl = normalizeOptionalString(explicitManifestUrl) ?? normalizeOptionalString(this.env.NEXTCLAW_UPDATE_MANIFEST_URL);\n if (manifestUrl) {\n return manifestUrl;\n }\n const baseUrl = normalizeOptionalString(this.env.NEXTCLAW_UPDATE_MANIFEST_BASE_URL) ?? DEFAULT_NPM_RUNTIME_UPDATE_BASE_URL;\n return new URL(`${channel}/manifest-${channel}-${this.platform}-${this.arch}.json`, `${baseUrl.replace(/\\/+$/, \"\")}/`).toString();\n };\n\n resolveBundlePublicKey = (): string | null => {\n const explicitPublicKey = normalizeOptionalString(this.env.NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY);\n if (explicitPublicKey) {\n return explicitPublicKey;\n }\n const publicKeyPath = normalizeOptionalString(this.env.NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY_PATH);\n if (!publicKeyPath || !existsSync(publicKeyPath)) {\n const packagedPublicKeyPath = this.packagedPublicKeyPath ?? resolvePackagedPublicKeyPath();\n return existsSync(packagedPublicKeyPath) ? readFileSync(packagedPublicKeyPath, \"utf8\").trim() : null;\n }\n return readFileSync(publicKeyPath, \"utf8\").trim();\n };\n}\n"],"mappings":";;;;AAMA,MAAM,sCAAsC;AAS5C,SAAS,wBAAwB,OAA+B;AAC9D,KAAI,OAAO,UAAU,SACnB,QAAO;CAET,MAAM,UAAU,MAAM,MAAM;AAC5B,QAAO,UAAU,UAAU;;AAG7B,SAAS,iBAAiB,OAA0C;AAClE,QAAO,OAAO,UAAU,YAAY,MAAM,MAAM,CAAC,aAAa,KAAK,SAAS,SAAS;;AAGvF,SAAgB,qCAAqC,iBAA2D;AAC9G,QAAO,OAAO,oBAAoB,YAAY,gBAAgB,aAAa,CAAC,SAAS,QAAQ,GAAG,SAAS;;AAG3G,SAAS,+BAAuC;CAC9C,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;CACzD,MAAM,aAAa;EACjB,QAAQ,WAAW,MAAM,aAAa,2BAA2B;EACjE,QAAQ,WAAW,YAAY,aAAa,2BAA2B;EACvE,QAAQ,WAAW,eAAe,aAAa,2BAA2B;EAC3E;AACD,QAAO,WAAW,MAAM,cAAc,WAAW,UAAU,CAAC,IAAI,WAAW;;AAG7E,IAAa,gCAAb,MAA2C;CACzC;CACA;CACA;CACA;CAEA,YAAY,UAAgD,EAAE,EAAE;AAC9D,OAAK,MAAM,QAAQ,OAAO,QAAQ;AAClC,OAAK,WAAW,QAAQ,YAAY,QAAQ;AAC5C,OAAK,OAAO,QAAQ,QAAQ,QAAQ;AACpC,OAAK,wBAAwB,QAAQ;;CAGvC,kBAAkB,iBAA2B,oBAA8D;AACzG,MAAI,oBAAoB,KAAA,KAAa,KAAK,IAAI,4BAA4B,KAAA,EACxE,QAAO,iBAAiB,mBAAmB,KAAK,IAAI,wBAAwB;AAE9E,SAAO,qCAAqC,gBAAgB;;CAG9D,sBAAsB,SAAmC,wBAAiD;EACxG,MAAM,cAAc,wBAAwB,oBAAoB,IAAI,wBAAwB,KAAK,IAAI,6BAA6B;AAClI,MAAI,YACF,QAAO;EAET,MAAM,UAAU,wBAAwB,KAAK,IAAI,kCAAkC,IAAI;AACvF,SAAO,IAAI,IAAI,GAAG,QAAQ,YAAY,QAAQ,GAAG,KAAK,SAAS,GAAG,KAAK,KAAK,QAAQ,GAAG,QAAQ,QAAQ,QAAQ,GAAG,CAAC,GAAG,CAAC,UAAU;;CAGnI,+BAA8C;EAC5C,MAAM,oBAAoB,wBAAwB,KAAK,IAAI,kCAAkC;AAC7F,MAAI,kBACF,QAAO;EAET,MAAM,gBAAgB,wBAAwB,KAAK,IAAI,uCAAuC;AAC9F,MAAI,CAAC,iBAAiB,CAAC,WAAW,cAAc,EAAE;GAChD,MAAM,wBAAwB,KAAK,yBAAyB,8BAA8B;AAC1F,UAAO,WAAW,sBAAsB,GAAG,aAAa,uBAAuB,OAAO,CAAC,MAAM,GAAG;;AAElG,SAAO,aAAa,eAAe,OAAO,CAAC,MAAM"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { NpmRuntimeDownloadedUpdate, NpmRuntimeUpdateProgressReporter } from "../../types/npm-runtime-bundle.types.js";
|
|
2
|
+
import { NpmRuntimeBundleLayoutStore } from "../../stores/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/services/runtime/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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-runtime-update.service.d.ts","names":[],"sources":["../../../src/services/runtime/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"}
|
|
@@ -0,0 +1,185 @@
|
|
|
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/services/runtime/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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-runtime-update.service.js","names":[],"sources":["../../../src/services/runtime/npm-runtime-update.service.ts"],"sourcesContent":["import { createHash, createPublicKey, verify, type KeyObject } from \"node:crypto\";\nimport { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { rm } from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport { dirname, join, resolve, sep } from \"node:path\";\nimport JSZip from \"jszip\";\nimport {\n serializeUnsignedUpdateManifest,\n UpdateManifestReader,\n type UpdateManifest\n} from \"@nextclaw/kernel\";\nimport type { NpmRuntimeBundleLayoutStore } from \"@nextclaw-service/stores/npm-runtime-bundle-layout.store.js\";\nimport { compareNpmRuntimeVersions, type NpmRuntimeBundleService } from \"@nextclaw-service/services/runtime/npm-runtime-bundle.service.js\";\nimport type {\n NpmRuntimeDownloadedUpdate,\n NpmRuntimeUpdateProgressReporter\n} from \"@nextclaw-service/types/npm-runtime-bundle.types.js\";\n\ntype FetchLike = typeof fetch;\n\ntype NpmRuntimeUpdateServiceOptions = {\n layout: NpmRuntimeBundleLayoutStore;\n bundleService: NpmRuntimeBundleService;\n launcherVersion: string;\n bundlePublicKey?: string;\n fetchImpl?: FetchLike;\n platform?: NodeJS.Platform;\n arch?: string;\n manifestReader?: UpdateManifestReader;\n now?: () => number;\n};\n\nexport type NpmRuntimeAvailableUpdate =\n | { kind: \"runtime-bundle-update\"; manifest: UpdateManifest }\n | { kind: \"host-update-required\"; manifest: UpdateManifest }\n | { kind: \"quarantined-bad-version\"; manifest: UpdateManifest };\n\nexport class NpmRuntimeUpdateService {\n private readonly platform: NodeJS.Platform;\n private readonly arch: string;\n private readonly fetchImpl: FetchLike;\n private readonly manifestReader: UpdateManifestReader;\n private readonly bundlePublicKey: KeyObject | null;\n private readonly now: () => number;\n\n constructor(private readonly options: NpmRuntimeUpdateServiceOptions) {\n this.platform = options.platform ?? process.platform;\n this.arch = options.arch ?? process.arch;\n this.fetchImpl = options.fetchImpl ?? fetch;\n this.manifestReader = options.manifestReader ?? new UpdateManifestReader();\n this.bundlePublicKey = this.parseBundlePublicKey(options.bundlePublicKey);\n this.now = options.now ?? Date.now;\n }\n\n hasSignatureVerifier = (): boolean => Boolean(this.bundlePublicKey);\n\n checkForUpdate = async (manifestUrl: string, currentVersion: string | null, badVersions: string[] = []): Promise<NpmRuntimeAvailableUpdate | null> => {\n const manifest = await this.fetchManifest(manifestUrl);\n if (currentVersion && compareNpmRuntimeVersions(manifest.latestVersion, currentVersion) <= 0) {\n return null;\n }\n if (compareNpmRuntimeVersions(this.options.launcherVersion, manifest.minimumLauncherVersion) < 0) {\n return { kind: \"host-update-required\", manifest };\n }\n if (badVersions.includes(manifest.latestVersion)) {\n return { kind: \"quarantined-bad-version\", manifest };\n }\n return { kind: \"runtime-bundle-update\", manifest };\n };\n\n downloadAndInstallUpdate = async (\n manifest: UpdateManifest,\n reportProgress?: NpmRuntimeUpdateProgressReporter\n ): Promise<NpmRuntimeDownloadedUpdate> => {\n const bytes = await this.downloadBundleBytes(manifest, reportProgress);\n const stagingRoot = join(this.options.layout.getStagingDir(), `download-${manifest.latestVersion}-${this.now()}`);\n await rm(stagingRoot, { recursive: true, force: true });\n mkdirSync(stagingRoot, { recursive: true });\n\n try {\n const zip = await JSZip.loadAsync(bytes);\n const entries = Object.values(zip.files) as JSZip.JSZipObject[];\n await Promise.all(entries.map(async (entry) => {\n const targetPath = resolve(stagingRoot, entry.name);\n const resolvedStagingRoot = resolve(stagingRoot);\n if (targetPath !== resolvedStagingRoot && !targetPath.startsWith(`${resolvedStagingRoot}${sep}`)) {\n throw new Error(`runtime bundle archive contains invalid path: ${entry.name}`);\n }\n if (entry.dir) {\n mkdirSync(targetPath, { recursive: true });\n return;\n }\n mkdirSync(dirname(targetPath), { recursive: true });\n writeFileSync(targetPath, Buffer.from(await entry.async(\"uint8array\")));\n }));\n const bundleRoot = this.findBundleRoot(stagingRoot);\n const installedBundle = await this.options.bundleService.installFromDirectory(bundleRoot);\n return {\n manifest,\n downloadedVersion: installedBundle.manifest.bundleVersion,\n bundleDirectory: installedBundle.bundleDirectory\n };\n } catch (error) {\n await rm(stagingRoot, { recursive: true, force: true });\n throw error;\n }\n };\n\n private downloadBundleBytes = async (\n manifest: UpdateManifest,\n reportProgress?: NpmRuntimeUpdateProgressReporter\n ): Promise<Buffer> => {\n const response = await this.fetchBundle(manifest.bundleUrl);\n const bytes = await this.readResponseBytes(response, reportProgress);\n const sha256 = createHash(\"sha256\").update(bytes).digest(\"hex\");\n if (sha256 !== manifest.bundleSha256) {\n throw new Error(`runtime bundle sha256 mismatch: expected ${manifest.bundleSha256} but got ${sha256}`);\n }\n this.assertBundleSignature(manifest, bytes);\n return bytes;\n };\n\n private fetchManifest = async (manifestUrl: string): Promise<UpdateManifest> => {\n if (manifestUrl.startsWith(\"file://\")) {\n const manifest = this.manifestReader.parse(JSON.parse(readFileSync(fileURLToPath(manifestUrl), \"utf8\")), manifestUrl);\n return this.verifyManifest(manifest, manifestUrl);\n }\n const response = await this.fetchImpl(manifestUrl);\n if (!response.ok) {\n throw new Error(`runtime update manifest request failed with status ${response.status}`);\n }\n const manifest = this.manifestReader.parse(await response.json(), manifestUrl);\n return this.verifyManifest(manifest, manifestUrl);\n };\n\n private verifyManifest = (manifest: UpdateManifest, _manifestUrl: string): UpdateManifest => {\n if (manifest.hostKind && manifest.hostKind !== \"npm-runtime-bundle\") {\n throw new Error(`runtime update manifest hostKind mismatch: expected npm-runtime-bundle but got ${manifest.hostKind}`);\n }\n if (manifest.channel !== \"stable\" && manifest.channel !== \"beta\") {\n throw new Error(`runtime update manifest channel is unsupported: ${manifest.channel}`);\n }\n if (manifest.platform !== this.platform) {\n throw new Error(`runtime update manifest platform mismatch: expected ${this.platform} but got ${manifest.platform}`);\n }\n if (manifest.arch !== this.arch) {\n throw new Error(`runtime update manifest arch mismatch: expected ${this.arch} but got ${manifest.arch}`);\n }\n this.assertManifestSignature(manifest);\n return manifest;\n };\n\n private fetchBundle = async (bundleUrl: string): Promise<Response> => {\n if (bundleUrl.startsWith(\"file://\")) {\n const bytes = readFileSync(fileURLToPath(bundleUrl));\n return new Response(bytes, {\n status: 200,\n headers: {\n \"content-length\": String(bytes.byteLength)\n }\n });\n }\n const response = await this.fetchImpl(bundleUrl);\n if (!response.ok) {\n throw new Error(`runtime bundle download failed with status ${response.status}`);\n }\n return response;\n };\n\n private readResponseBytes = async (\n response: Response,\n reportProgress?: NpmRuntimeUpdateProgressReporter\n ): Promise<Buffer> => {\n const totalBytes = this.readContentLength(response);\n if (!response.body) {\n const bytes = Buffer.from(await response.arrayBuffer());\n this.reportDownloadProgress(reportProgress, bytes.byteLength, totalBytes ?? bytes.byteLength);\n return bytes;\n }\n const reader = response.body.getReader();\n const chunks: Uint8Array[] = [];\n let downloadedBytes = 0;\n this.reportDownloadProgress(reportProgress, downloadedBytes, totalBytes);\n while (true) {\n const next = await reader.read();\n if (next.done) {\n break;\n }\n chunks.push(next.value);\n downloadedBytes += next.value.byteLength;\n this.reportDownloadProgress(reportProgress, downloadedBytes, totalBytes);\n }\n return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)));\n };\n\n private readContentLength = (response: Response): number | null => {\n const raw = response.headers.get(\"content-length\");\n if (!raw) {\n return null;\n }\n const parsed = Number(raw);\n return Number.isFinite(parsed) && parsed >= 0 ? parsed : null;\n };\n\n private reportDownloadProgress = (\n reportProgress: NpmRuntimeUpdateProgressReporter | undefined,\n downloadedBytes: number,\n totalBytes: number | null\n ): void => {\n reportProgress?.({\n downloadedBytes,\n totalBytes,\n percent: totalBytes && totalBytes > 0 ? Math.min(100, Math.round((downloadedBytes / totalBytes) * 100)) : null\n });\n };\n\n private findBundleRoot = (stagingRoot: string): string => {\n const directManifestPath = join(stagingRoot, \"manifest.json\");\n if (existsSync(directManifestPath)) {\n return stagingRoot;\n }\n const entries = readDirectoryNames(stagingRoot).filter((entry) => existsSync(join(stagingRoot, entry, \"manifest.json\")));\n if (entries.length === 1) {\n return join(stagingRoot, entries[0]);\n }\n throw new Error(`runtime bundle archive does not contain exactly one manifest root under ${stagingRoot}`);\n };\n\n private parseBundlePublicKey = (publicKey: string | undefined): KeyObject | null => {\n const normalizedKey = publicKey?.trim();\n if (!normalizedKey) {\n return null;\n }\n const pemOrEscapedPem = normalizedKey.replaceAll(\"\\\\n\", \"\\n\");\n if (pemOrEscapedPem.includes(\"BEGIN PUBLIC KEY\")) {\n return createPublicKey(pemOrEscapedPem);\n }\n return createPublicKey({\n key: Buffer.from(normalizedKey, \"base64\"),\n format: \"der\",\n type: \"spki\"\n });\n };\n\n private assertManifestSignature = (manifest: UpdateManifest): void => {\n if (!this.bundlePublicKey) {\n throw new Error(\"runtime update manifest signature verification requires bundlePublicKey\");\n }\n const signature = Buffer.from(manifest.manifestSignature, \"base64\");\n const valid = verify(null, Buffer.from(serializeUnsignedUpdateManifest(manifest)), this.bundlePublicKey, signature);\n if (!valid) {\n throw new Error(`runtime update manifest signature verification failed for ${manifest.latestVersion}`);\n }\n };\n\n private assertBundleSignature = (manifest: UpdateManifest, bytes: Buffer): void => {\n if (!this.bundlePublicKey) {\n throw new Error(\"runtime bundle signature verification requires bundlePublicKey\");\n }\n const signature = Buffer.from(manifest.bundleSignature, \"base64\");\n const valid = verify(null, bytes, this.bundlePublicKey, signature);\n if (!valid) {\n throw new Error(`runtime bundle signature verification failed for ${manifest.latestVersion}`);\n }\n };\n}\n\nfunction readDirectoryNames(directory: string): string[] {\n return readdirSync(directory, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-config-init.service.d.ts","names":[],"sources":["../../../src/services/runtime/runtime-config-init.service.ts"],"mappings":";iBAGgB,yBAAA,CAA0B,UAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getConfigPath, loadConfig } from "@nextclaw/core";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
//#region src/services/runtime/runtime-config-init.service.ts
|
|
4
|
+
function initializeConfigIfMissing(configPath = getConfigPath()) {
|
|
5
|
+
if (existsSync(configPath)) return false;
|
|
6
|
+
loadConfig(configPath);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { initializeConfigIfMissing };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=runtime-config-init.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-config-init.service.js","names":[],"sources":["../../../src/services/runtime/runtime-config-init.service.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { getConfigPath, loadConfig } from \"@nextclaw/core\";\n\nexport function initializeConfigIfMissing(configPath = getConfigPath()): boolean {\n if (existsSync(configPath)) {\n return false;\n }\n loadConfig(configPath);\n return true;\n}\n"],"mappings":";;;AAGA,SAAgB,0BAA0B,aAAa,eAAe,EAAW;AAC/E,KAAI,WAAW,WAAW,CACxB,QAAO;AAET,YAAW,WAAW;AACtB,QAAO"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { resolveManagedServiceReadySnapshot, resolveManagedServiceUiBinding, resolveSessionRouteCandidate } from "../../utils/runtime/managed-service-routing.utils.js";
|
|
2
|
+
import * as NextclawCore from "@nextclaw/core";
|
|
3
|
+
|
|
4
|
+
//#region src/services/runtime/service-managed-startup.service.d.ts
|
|
5
|
+
type Config$1 = NextclawCore.Config;
|
|
6
|
+
type StartServiceOptions = {
|
|
7
|
+
uiOverrides: Partial<Config$1["ui"]>;
|
|
8
|
+
open: boolean;
|
|
9
|
+
startupTimeoutMs?: number;
|
|
10
|
+
};
|
|
11
|
+
declare function waitForManagedServiceReadiness(params: {
|
|
12
|
+
appName: string;
|
|
13
|
+
childPid: number;
|
|
14
|
+
healthUrl: string;
|
|
15
|
+
logPath: string;
|
|
16
|
+
readinessTimeoutMs: number;
|
|
17
|
+
quickPhaseTimeoutMs: number;
|
|
18
|
+
extendedPhaseTimeoutMs: number;
|
|
19
|
+
appendStartupStage: (logPath: string, message: string) => void;
|
|
20
|
+
waitForBackgroundServiceReady: (params: {
|
|
21
|
+
pid: number;
|
|
22
|
+
healthUrl: string;
|
|
23
|
+
timeoutMs: number;
|
|
24
|
+
}) => Promise<{
|
|
25
|
+
ready: boolean;
|
|
26
|
+
lastProbeError: string | null;
|
|
27
|
+
}>;
|
|
28
|
+
isProcessRunning: (pid: number) => boolean;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
ready: boolean;
|
|
31
|
+
lastProbeError: string | null;
|
|
32
|
+
}>;
|
|
33
|
+
declare function reportManagedServiceStart(params: {
|
|
34
|
+
appName: string;
|
|
35
|
+
state: {
|
|
36
|
+
pid: number;
|
|
37
|
+
logPath: string;
|
|
38
|
+
};
|
|
39
|
+
uiConfig: {
|
|
40
|
+
host: string;
|
|
41
|
+
port: number;
|
|
42
|
+
};
|
|
43
|
+
uiUrl: string;
|
|
44
|
+
apiUrl: string;
|
|
45
|
+
readinessTimeoutMs: number;
|
|
46
|
+
readiness: {
|
|
47
|
+
ready: boolean;
|
|
48
|
+
lastProbeError: string | null;
|
|
49
|
+
};
|
|
50
|
+
printPublicUiUrls: (host: string, port: number) => Promise<void>;
|
|
51
|
+
printServiceControlHints: () => void;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
declare class ManagedServiceCommandService {
|
|
54
|
+
private readonly deps;
|
|
55
|
+
private readonly loggingRuntime;
|
|
56
|
+
private readonly serviceLogger;
|
|
57
|
+
private readonly startupLogger;
|
|
58
|
+
private readonly supervisor;
|
|
59
|
+
constructor(deps: {
|
|
60
|
+
startGateway: (options: {
|
|
61
|
+
uiOverrides: Partial<Config$1["ui"]>;
|
|
62
|
+
uiStaticDir?: string | null;
|
|
63
|
+
}) => Promise<void>;
|
|
64
|
+
printPublicUiUrls: (host: string, port: number) => Promise<void>;
|
|
65
|
+
printServiceControlHints: () => void;
|
|
66
|
+
checkUiPortPreflight: (params: {
|
|
67
|
+
host: string;
|
|
68
|
+
port: number;
|
|
69
|
+
healthUrl: string;
|
|
70
|
+
}) => Promise<{
|
|
71
|
+
ok: true;
|
|
72
|
+
reusedExistingHealthyTarget: boolean;
|
|
73
|
+
} | {
|
|
74
|
+
ok: false;
|
|
75
|
+
message: string;
|
|
76
|
+
}>;
|
|
77
|
+
resolveUiStaticDir: () => string | null;
|
|
78
|
+
});
|
|
79
|
+
runForeground: (options: {
|
|
80
|
+
uiOverrides: Partial<Config$1["ui"]>;
|
|
81
|
+
open: boolean;
|
|
82
|
+
}) => Promise<void>;
|
|
83
|
+
startService: (options: StartServiceOptions) => Promise<void>;
|
|
84
|
+
stopService: () => Promise<void>;
|
|
85
|
+
private handleExistingManagedService;
|
|
86
|
+
private reuseExistingHealthyStartTarget;
|
|
87
|
+
private startNewManagedServiceTarget;
|
|
88
|
+
private waitForBackgroundServiceReady;
|
|
89
|
+
private resolveStartupTimeoutMs;
|
|
90
|
+
private appendStartupStage;
|
|
91
|
+
private printStartupFailureDiagnostics;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { ManagedServiceCommandService, StartServiceOptions, reportManagedServiceStart, resolveManagedServiceReadySnapshot, resolveManagedServiceUiBinding, resolveSessionRouteCandidate, waitForManagedServiceReadiness };
|
|
95
|
+
//# sourceMappingURL=service-managed-startup.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-managed-startup.service.d.ts","names":[],"sources":["../../../src/services/runtime/service-managed-startup.service.ts"],"mappings":";;;;KAqBK,QAAA,GAAS,YAAA,CAAa,MAAA;AAAA,KAEf,mBAAA;EACV,WAAA,EAAa,OAAA,CAAQ,QAAA;EACrB,IAAA;EACA,gBAAA;AAAA;AAAA,iBAKoB,8BAAA,CAA+B,MAAA;EACnD,OAAA;EACA,QAAA;EACA,SAAA;EACA,OAAA;EACA,kBAAA;EACA,mBAAA;EACA,sBAAA;EACA,kBAAA,GAAqB,OAAA,UAAiB,OAAA;EACtC,6BAAA,GAAgC,MAAA;IAC9B,GAAA;IACA,SAAA;IACA,SAAA;EAAA,MACI,OAAA;IAAU,KAAA;IAAgB,cAAA;EAAA;EAChC,gBAAA,GAAmB,GAAA;AAAA,IACjB,OAAA;EAAU,KAAA;EAAgB,cAAA;AAAA;AAAA,iBA8BR,yBAAA,CAA0B,MAAA;EAC9C,OAAA;EACA,KAAA;IAAS,GAAA;IAAa,OAAA;EAAA;EACtB,QAAA;IAAY,IAAA;IAAc,IAAA;EAAA;EAC1B,KAAA;EACA,MAAA;EACA,kBAAA;EACA,SAAA;IAAa,KAAA;IAAgB,cAAA;EAAA;EAC7B,iBAAA,GAAoB,IAAA,UAAc,IAAA,aAAiB,OAAA;EACnD,wBAAA;AAAA,IACE,OAAA;AAAA,cAiBS,4BAAA;EAAA,iBAMkB,IAAA;EAAA,iBALZ,cAAA;EAAA,iBACA,aAAA;EAAA,iBACA,aAAA;EAAA,iBACA,UAAA;cAEY,IAAA;IAC3B,YAAA,GAAe,OAAA;MAAW,WAAA,EAAa,OAAA,CAAQ,QAAA;MAAe,WAAA;IAAA,MAAkC,OAAA;IAChG,iBAAA,GAAoB,IAAA,UAAc,IAAA,aAAiB,OAAA;IACnD,wBAAA;IACA,oBAAA,GAAuB,MAAA;MAAU,IAAA;MAAc,IAAA;MAAc,SAAA;IAAA,MAAwB,OAAA;MAAU,EAAA;MAAU,2BAAA;IAAA;MAA2C,EAAA;MAAW,OAAA;IAAA;IAC/J,kBAAA;EAAA;EAGF,aAAA,GAAuB,OAAA;IACrB,WAAA,EAAa,OAAA,CAAQ,QAAA;IACrB,IAAA;EAAA,MACE,OAAA;EAeJ,YAAA,GAAsB,OAAA,EAAS,mBAAA,KAAsB,OAAA;EAsDrD,WAAA,QAAwB,OAAA;EAAA,QA0DhB,4BAAA;EAAA,QAgCA,+BAAA;EAAA,QAuBA,4BAAA;EAAA,QA+FA,6BAAA;EAAA,QAuBA,uBAAA;EAAA,QAYA,kBAAA;EAAA,QASA,8BAAA;AAAA"}
|