@nextclaw/service 0.2.13 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (846) hide show
  1. package/dist/app/nextclaw-service-runtime.d.ts +41 -0
  2. package/dist/app/nextclaw-service-runtime.d.ts.map +1 -0
  3. package/dist/app/nextclaw-service-runtime.js +136 -0
  4. package/dist/app/nextclaw-service-runtime.js.map +1 -0
  5. package/dist/controllers/commands/agent-command.controller.d.ts +3 -0
  6. package/dist/controllers/commands/agent-command.controller.js +3 -0
  7. package/dist/controllers/commands/channel-command.controller.d.ts +21 -0
  8. package/dist/controllers/commands/channel-command.controller.d.ts.map +1 -0
  9. package/dist/controllers/commands/channel-command.controller.js +115 -0
  10. package/dist/controllers/commands/channel-command.controller.js.map +1 -0
  11. package/dist/controllers/commands/config-command.controller.d.ts +2 -0
  12. package/dist/controllers/commands/config-command.controller.js +2 -0
  13. package/dist/controllers/commands/cron-command.controller.d.ts +2 -0
  14. package/dist/controllers/commands/cron-command.controller.js +2 -0
  15. package/dist/controllers/commands/diagnostics-command.controller.d.ts +2 -0
  16. package/dist/controllers/commands/diagnostics-command.controller.js +2 -0
  17. package/dist/controllers/commands/gateway-command.controller.d.ts +15 -0
  18. package/dist/controllers/commands/gateway-command.controller.d.ts.map +1 -0
  19. package/dist/controllers/commands/gateway-command.controller.js +17 -0
  20. package/dist/controllers/commands/gateway-command.controller.js.map +1 -0
  21. package/dist/controllers/commands/logs-command.controller.d.ts +13 -0
  22. package/dist/controllers/commands/logs-command.controller.d.ts.map +1 -0
  23. package/dist/controllers/commands/logs-command.controller.js +31 -0
  24. package/dist/controllers/commands/logs-command.controller.js.map +1 -0
  25. package/dist/controllers/commands/marketplace-skill-command.controller.d.ts +28 -0
  26. package/dist/controllers/commands/marketplace-skill-command.controller.d.ts.map +1 -0
  27. package/dist/controllers/commands/marketplace-skill-command.controller.js +170 -0
  28. package/dist/controllers/commands/marketplace-skill-command.controller.js.map +1 -0
  29. package/dist/controllers/commands/mcp-command.controller.d.ts +15 -0
  30. package/dist/controllers/commands/mcp-command.controller.d.ts.map +1 -0
  31. package/dist/controllers/commands/mcp-command.controller.js +195 -0
  32. package/dist/controllers/commands/mcp-command.controller.js.map +1 -0
  33. package/dist/controllers/commands/platform-auth-command.controller.d.ts +2 -0
  34. package/dist/controllers/commands/platform-auth-command.controller.js +2 -0
  35. package/dist/controllers/commands/remote-command.controller.d.ts +48 -0
  36. package/dist/controllers/commands/remote-command.controller.d.ts.map +1 -0
  37. package/dist/controllers/commands/remote-command.controller.js +176 -0
  38. package/dist/controllers/commands/remote-command.controller.js.map +1 -0
  39. package/dist/controllers/commands/restart-command.controller.d.ts +21 -0
  40. package/dist/controllers/commands/restart-command.controller.d.ts.map +1 -0
  41. package/dist/controllers/commands/restart-command.controller.js +90 -0
  42. package/dist/controllers/commands/restart-command.controller.js.map +1 -0
  43. package/dist/controllers/commands/secrets-command.controller.d.ts +23 -0
  44. package/dist/controllers/commands/secrets-command.controller.d.ts.map +1 -0
  45. package/dist/controllers/commands/secrets-command.controller.js +282 -0
  46. package/dist/controllers/commands/secrets-command.controller.js.map +1 -0
  47. package/dist/controllers/commands/serve-command.controller.d.ts +15 -0
  48. package/dist/controllers/commands/serve-command.controller.d.ts.map +1 -0
  49. package/dist/controllers/commands/serve-command.controller.js +21 -0
  50. package/dist/controllers/commands/serve-command.controller.js.map +1 -0
  51. package/dist/controllers/commands/service-command.controller.d.ts +17 -0
  52. package/dist/controllers/commands/service-command.controller.d.ts.map +1 -0
  53. package/dist/controllers/commands/service-command.controller.js +33 -0
  54. package/dist/controllers/commands/service-command.controller.js.map +1 -0
  55. package/dist/controllers/commands/start-command.controller.d.ts +19 -0
  56. package/dist/controllers/commands/start-command.controller.d.ts.map +1 -0
  57. package/dist/controllers/commands/start-command.controller.js +27 -0
  58. package/dist/controllers/commands/start-command.controller.js.map +1 -0
  59. package/dist/controllers/commands/stop-command.controller.d.ts +13 -0
  60. package/dist/controllers/commands/stop-command.controller.d.ts.map +1 -0
  61. package/dist/controllers/commands/stop-command.controller.js +13 -0
  62. package/dist/controllers/commands/stop-command.controller.js.map +1 -0
  63. package/dist/controllers/commands/ui-command.controller.d.ts +15 -0
  64. package/dist/controllers/commands/ui-command.controller.d.ts.map +1 -0
  65. package/dist/controllers/commands/ui-command.controller.js +19 -0
  66. package/dist/controllers/commands/ui-command.controller.js.map +1 -0
  67. package/dist/controllers/commands/usage-command.controller.d.ts +2 -0
  68. package/dist/controllers/commands/usage-command.controller.js +2 -0
  69. package/dist/controllers/gateway.controller.d.ts +54 -0
  70. package/dist/controllers/gateway.controller.d.ts.map +1 -0
  71. package/dist/controllers/gateway.controller.js +162 -0
  72. package/dist/controllers/gateway.controller.js.map +1 -0
  73. package/dist/index.d.ts +4 -4
  74. package/dist/index.js +2 -2
  75. package/dist/launcher/npm-runtime-launcher.service.d.ts +1 -1
  76. package/dist/launcher/npm-runtime-launcher.service.js +6 -6
  77. package/dist/launcher/npm-runtime-launcher.service.js.map +1 -1
  78. package/dist/managers/gateway-extension.manager.d.ts +29 -0
  79. package/dist/managers/gateway-extension.manager.d.ts.map +1 -0
  80. package/dist/managers/gateway-extension.manager.js +78 -0
  81. package/dist/managers/gateway-extension.manager.js.map +1 -0
  82. package/dist/managers/gateway-remote.manager.d.ts +23 -0
  83. package/dist/managers/gateway-remote.manager.d.ts.map +1 -0
  84. package/dist/managers/gateway-remote.manager.js +28 -0
  85. package/dist/managers/gateway-remote.manager.js.map +1 -0
  86. package/dist/managers/managed-service.manager.d.ts +42 -0
  87. package/dist/managers/managed-service.manager.d.ts.map +1 -0
  88. package/dist/managers/managed-service.manager.js +195 -0
  89. package/dist/managers/managed-service.manager.js.map +1 -0
  90. package/dist/managers/runtime-update.manager.d.ts +43 -0
  91. package/dist/managers/runtime-update.manager.d.ts.map +1 -0
  92. package/dist/managers/runtime-update.manager.js +185 -0
  93. package/dist/managers/runtime-update.manager.js.map +1 -0
  94. package/dist/managers/service-command.manager.d.ts +67 -0
  95. package/dist/managers/service-command.manager.d.ts.map +1 -0
  96. package/dist/managers/service-command.manager.js +94 -0
  97. package/dist/managers/service-command.manager.js.map +1 -0
  98. package/dist/managers/service-gateway.manager.d.ts +85 -0
  99. package/dist/managers/service-gateway.manager.d.ts.map +1 -0
  100. package/dist/managers/service-gateway.manager.js +278 -0
  101. package/dist/managers/service-gateway.manager.js.map +1 -0
  102. package/dist/managers/service-restart.manager.d.ts +22 -0
  103. package/dist/managers/service-restart.manager.d.ts.map +1 -0
  104. package/dist/managers/service-restart.manager.js +183 -0
  105. package/dist/managers/service-restart.manager.js.map +1 -0
  106. package/dist/managers/service-workspace.manager.d.ts +14 -0
  107. package/dist/managers/service-workspace.manager.d.ts.map +1 -0
  108. package/dist/managers/service-workspace.manager.js +86 -0
  109. package/dist/managers/service-workspace.manager.js.map +1 -0
  110. package/dist/services/agent/agent-commands.service.d.ts +17 -0
  111. package/dist/services/agent/agent-commands.service.d.ts.map +1 -0
  112. package/dist/services/agent/agent-commands.service.js +111 -0
  113. package/dist/services/agent/agent-commands.service.js.map +1 -0
  114. package/dist/services/autostart/host-autostart-command.service.d.ts +30 -0
  115. package/dist/services/autostart/host-autostart-command.service.d.ts.map +1 -0
  116. package/dist/services/autostart/host-autostart-command.service.js +160 -0
  117. package/dist/services/autostart/host-autostart-command.service.js.map +1 -0
  118. package/dist/services/autostart/host-autostart-runtime.service.d.ts +24 -0
  119. package/dist/services/autostart/host-autostart-runtime.service.d.ts.map +1 -0
  120. package/dist/services/autostart/host-autostart-runtime.service.js +55 -0
  121. package/dist/services/autostart/host-autostart-runtime.service.js.map +1 -0
  122. package/dist/services/autostart/host-autostart.service.d.ts +42 -0
  123. package/dist/services/autostart/host-autostart.service.d.ts.map +1 -0
  124. package/dist/services/autostart/host-autostart.service.js +50 -0
  125. package/dist/services/autostart/host-autostart.service.js.map +1 -0
  126. package/dist/services/autostart/linux-systemd-autostart.service.d.ts +49 -0
  127. package/dist/services/autostart/linux-systemd-autostart.service.d.ts.map +1 -0
  128. package/dist/services/autostart/linux-systemd-autostart.service.js +435 -0
  129. package/dist/services/autostart/linux-systemd-autostart.service.js.map +1 -0
  130. package/dist/services/autostart/macos-launch-agent-autostart.service.d.ts +55 -0
  131. package/dist/services/autostart/macos-launch-agent-autostart.service.d.ts.map +1 -0
  132. package/dist/services/autostart/macos-launch-agent-autostart.service.js +407 -0
  133. package/dist/services/autostart/macos-launch-agent-autostart.service.js.map +1 -0
  134. package/dist/services/autostart/windows-task-autostart.service.d.ts +55 -0
  135. package/dist/services/autostart/windows-task-autostart.service.d.ts.map +1 -0
  136. package/dist/services/autostart/windows-task-autostart.service.js +406 -0
  137. package/dist/services/autostart/windows-task-autostart.service.js.map +1 -0
  138. package/dist/services/channel/channel-list-view.service.d.ts +29 -0
  139. package/dist/services/channel/channel-list-view.service.d.ts.map +1 -0
  140. package/dist/services/channel/channel-list-view.service.js +53 -0
  141. package/dist/services/channel/channel-list-view.service.js.map +1 -0
  142. package/dist/services/config/config-commands.service.d.ts +17 -0
  143. package/dist/services/config/config-commands.service.d.ts.map +1 -0
  144. package/dist/services/config/config-commands.service.js +117 -0
  145. package/dist/services/config/config-commands.service.js.map +1 -0
  146. package/dist/services/cron/cron-commands.service.d.ts +23 -0
  147. package/dist/services/cron/cron-commands.service.d.ts.map +1 -0
  148. package/dist/services/cron/cron-commands.service.js +109 -0
  149. package/dist/services/cron/cron-commands.service.js.map +1 -0
  150. package/dist/services/cron/cron-local.service.d.ts +26 -0
  151. package/dist/services/cron/cron-local.service.d.ts.map +1 -0
  152. package/dist/services/cron/cron-local.service.js +89 -0
  153. package/dist/services/cron/cron-local.service.js.map +1 -0
  154. package/dist/services/diagnostics/diagnostics-commands.service.d.ts +25 -0
  155. package/dist/services/diagnostics/diagnostics-commands.service.d.ts.map +1 -0
  156. package/dist/services/diagnostics/diagnostics-commands.service.js +345 -0
  157. package/dist/services/diagnostics/diagnostics-commands.service.js.map +1 -0
  158. package/dist/services/gateway/gateway-restart-wake.service.d.ts +13 -0
  159. package/dist/services/gateway/gateway-restart-wake.service.d.ts.map +1 -0
  160. package/dist/services/gateway/gateway-restart-wake.service.js +99 -0
  161. package/dist/services/gateway/gateway-restart-wake.service.js.map +1 -0
  162. package/dist/services/gateway/nextclaw-app.service.d.ts +18 -0
  163. package/dist/services/gateway/nextclaw-app.service.d.ts.map +1 -0
  164. package/dist/services/gateway/nextclaw-app.service.js +44 -0
  165. package/dist/services/gateway/nextclaw-app.service.js.map +1 -0
  166. package/dist/services/gateway/service-bootstrap-status.service.d.ts +33 -0
  167. package/dist/services/gateway/service-bootstrap-status.service.d.ts.map +1 -0
  168. package/dist/services/gateway/service-bootstrap-status.service.js +144 -0
  169. package/dist/services/gateway/service-bootstrap-status.service.js.map +1 -0
  170. package/dist/services/gateway/service-startup-support.service.d.ts +35 -0
  171. package/dist/services/gateway/service-startup-support.service.d.ts.map +1 -0
  172. package/dist/services/gateway/service-startup-support.service.js +83 -0
  173. package/dist/services/gateway/service-startup-support.service.js.map +1 -0
  174. package/dist/services/marketplace/service-marketplace-installer.service.d.ts +29 -0
  175. package/dist/services/marketplace/service-marketplace-installer.service.d.ts.map +1 -0
  176. package/dist/services/marketplace/service-marketplace-installer.service.js +87 -0
  177. package/dist/services/marketplace/service-marketplace-installer.service.js.map +1 -0
  178. package/dist/services/marketplace/service-mcp-marketplace-ops.service.d.ts +40 -0
  179. package/dist/services/marketplace/service-mcp-marketplace-ops.service.d.ts.map +1 -0
  180. package/dist/services/marketplace/service-mcp-marketplace-ops.service.js +69 -0
  181. package/dist/services/marketplace/service-mcp-marketplace-ops.service.js.map +1 -0
  182. package/dist/services/marketplace/skills-query.service.d.ts +110 -0
  183. package/dist/services/marketplace/skills-query.service.d.ts.map +1 -0
  184. package/dist/services/marketplace/skills-query.service.js +132 -0
  185. package/dist/services/marketplace/skills-query.service.js.map +1 -0
  186. package/dist/services/platform-auth/account-status.service.d.ts +20 -0
  187. package/dist/services/platform-auth/account-status.service.d.ts.map +1 -0
  188. package/dist/services/platform-auth/account-status.service.js +36 -0
  189. package/dist/services/platform-auth/account-status.service.js.map +1 -0
  190. package/dist/services/platform-auth/platform-auth-commands.service.d.ts +78 -0
  191. package/dist/services/platform-auth/platform-auth-commands.service.d.ts.map +1 -0
  192. package/dist/services/platform-auth/platform-auth-commands.service.js +297 -0
  193. package/dist/services/platform-auth/platform-auth-commands.service.js.map +1 -0
  194. package/dist/services/remote/remote-access-host.service.d.ts +42 -0
  195. package/dist/services/remote/remote-access-host.service.d.ts.map +1 -0
  196. package/dist/services/remote/remote-access-host.service.js +128 -0
  197. package/dist/services/remote/remote-access-host.service.js.map +1 -0
  198. package/dist/services/remote/remote-service-control.service.d.ts +34 -0
  199. package/dist/services/remote/remote-service-control.service.d.ts.map +1 -0
  200. package/dist/services/remote/remote-service-control.service.js +247 -0
  201. package/dist/services/remote/remote-service-control.service.js.map +1 -0
  202. package/dist/services/restart/restart-coordinator.service.d.ts +31 -0
  203. package/dist/services/restart/restart-coordinator.service.d.ts.map +1 -0
  204. package/dist/services/restart/restart-coordinator.service.js +53 -0
  205. package/dist/services/restart/restart-coordinator.service.js.map +1 -0
  206. package/dist/services/runtime/managed-service-supervisor.service.d.ts +85 -0
  207. package/dist/services/runtime/managed-service-supervisor.service.d.ts.map +1 -0
  208. package/dist/services/runtime/managed-service-supervisor.service.js +271 -0
  209. package/dist/services/runtime/managed-service-supervisor.service.js.map +1 -0
  210. package/dist/services/runtime/nextclaw-distribution.service.d.ts +11 -0
  211. package/dist/services/runtime/nextclaw-distribution.service.d.ts.map +1 -0
  212. package/dist/services/runtime/nextclaw-distribution.service.js +15 -0
  213. package/dist/services/runtime/nextclaw-distribution.service.js.map +1 -0
  214. package/dist/services/runtime/npm-runtime-bundle-manifest.service.d.ts +10 -0
  215. package/dist/services/runtime/npm-runtime-bundle-manifest.service.d.ts.map +1 -0
  216. package/dist/services/runtime/npm-runtime-bundle-manifest.service.js +41 -0
  217. package/dist/services/runtime/npm-runtime-bundle-manifest.service.js.map +1 -0
  218. package/dist/services/runtime/npm-runtime-bundle.service.d.ts +48 -0
  219. package/dist/services/runtime/npm-runtime-bundle.service.d.ts.map +1 -0
  220. package/dist/services/runtime/npm-runtime-bundle.service.js +152 -0
  221. package/dist/services/runtime/npm-runtime-bundle.service.js.map +1 -0
  222. package/dist/services/runtime/npm-runtime-update-command.service.d.ts +16 -0
  223. package/dist/services/runtime/npm-runtime-update-command.service.d.ts.map +1 -0
  224. package/dist/services/runtime/npm-runtime-update-command.service.js +120 -0
  225. package/dist/services/runtime/npm-runtime-update-command.service.js.map +1 -0
  226. package/dist/services/runtime/npm-runtime-update-host.service.d.ts +41 -0
  227. package/dist/services/runtime/npm-runtime-update-host.service.d.ts.map +1 -0
  228. package/dist/services/runtime/npm-runtime-update-host.service.js +189 -0
  229. package/dist/services/runtime/npm-runtime-update-host.service.js.map +1 -0
  230. package/dist/services/runtime/npm-runtime-update-source.service.d.ts +22 -0
  231. package/dist/services/runtime/npm-runtime-update-source.service.d.ts.map +1 -0
  232. package/dist/services/runtime/npm-runtime-update-source.service.js +61 -0
  233. package/dist/services/runtime/npm-runtime-update-source.service.js.map +1 -0
  234. package/dist/services/runtime/npm-runtime-update.service.d.ts +55 -0
  235. package/dist/services/runtime/npm-runtime-update.service.d.ts.map +1 -0
  236. package/dist/services/runtime/npm-runtime-update.service.js +185 -0
  237. package/dist/services/runtime/npm-runtime-update.service.js.map +1 -0
  238. package/dist/services/runtime/runtime-config-init.service.d.ts +5 -0
  239. package/dist/services/runtime/runtime-config-init.service.d.ts.map +1 -0
  240. package/dist/services/runtime/runtime-config-init.service.js +12 -0
  241. package/dist/services/runtime/runtime-config-init.service.js.map +1 -0
  242. package/dist/services/runtime/service-managed-startup.service.d.ts +95 -0
  243. package/dist/services/runtime/service-managed-startup.service.d.ts.map +1 -0
  244. package/dist/services/runtime/service-managed-startup.service.js +341 -0
  245. package/dist/services/runtime/service-managed-startup.service.js.map +1 -0
  246. package/dist/services/ui/companion-runtime.service.d.ts +36 -0
  247. package/dist/services/ui/companion-runtime.service.d.ts.map +1 -0
  248. package/dist/services/ui/companion-runtime.service.js +180 -0
  249. package/dist/services/ui/companion-runtime.service.js.map +1 -0
  250. package/dist/services/ui/local-ui-discovery.service.d.ts +20 -0
  251. package/dist/services/ui/local-ui-discovery.service.d.ts.map +1 -0
  252. package/dist/services/ui/local-ui-discovery.service.js +43 -0
  253. package/dist/services/ui/local-ui-discovery.service.js.map +1 -0
  254. package/dist/services/ui/runtime-control-host.service.d.ts +29 -0
  255. package/dist/services/ui/runtime-control-host.service.d.ts.map +1 -0
  256. package/dist/services/ui/runtime-control-host.service.js +91 -0
  257. package/dist/services/ui/runtime-control-host.service.js.map +1 -0
  258. package/dist/services/ui/service-remote-access.service.d.ts +26 -0
  259. package/dist/services/ui/service-remote-access.service.d.ts.map +1 -0
  260. package/dist/services/ui/service-remote-access.service.js +40 -0
  261. package/dist/services/ui/service-remote-access.service.js.map +1 -0
  262. package/dist/services/ui/ui-bridge-api.service.d.ts +17 -0
  263. package/dist/services/ui/ui-bridge-api.service.d.ts.map +1 -0
  264. package/dist/services/ui/ui-bridge-api.service.js +45 -0
  265. package/dist/services/ui/ui-bridge-api.service.js.map +1 -0
  266. package/dist/services/usage/llm-usage-command.service.d.ts +21 -0
  267. package/dist/services/usage/llm-usage-command.service.d.ts.map +1 -0
  268. package/dist/services/usage/llm-usage-command.service.js +152 -0
  269. package/dist/services/usage/llm-usage-command.service.js.map +1 -0
  270. package/dist/stores/companion-runtime.store.d.ts +16 -0
  271. package/dist/stores/companion-runtime.store.d.ts.map +1 -0
  272. package/dist/stores/companion-runtime.store.js +29 -0
  273. package/dist/stores/companion-runtime.store.js.map +1 -0
  274. package/dist/stores/local-ui-runtime.store.d.ts +26 -0
  275. package/dist/stores/local-ui-runtime.store.d.ts.map +1 -0
  276. package/dist/stores/local-ui-runtime.store.js +56 -0
  277. package/dist/stores/local-ui-runtime.store.js.map +1 -0
  278. package/dist/stores/managed-service-state.store.d.ts +46 -0
  279. package/dist/stores/managed-service-state.store.d.ts.map +1 -0
  280. package/dist/stores/managed-service-state.store.js +40 -0
  281. package/dist/stores/managed-service-state.store.js.map +1 -0
  282. package/dist/stores/marketplace-install-state.store.d.ts +39 -0
  283. package/dist/stores/marketplace-install-state.store.d.ts.map +1 -0
  284. package/dist/stores/marketplace-install-state.store.js +58 -0
  285. package/dist/stores/marketplace-install-state.store.js.map +1 -0
  286. package/dist/stores/npm-runtime-bundle-layout.store.d.ts +24 -0
  287. package/dist/stores/npm-runtime-bundle-layout.store.d.ts.map +1 -0
  288. package/dist/stores/npm-runtime-bundle-layout.store.js +39 -0
  289. package/dist/stores/npm-runtime-bundle-layout.store.js.map +1 -0
  290. package/dist/stores/npm-runtime-update-state.store.d.ts +18 -0
  291. package/dist/stores/npm-runtime-update-state.store.d.ts.map +1 -0
  292. package/dist/stores/npm-runtime-update-state.store.js +94 -0
  293. package/dist/stores/npm-runtime-update-state.store.js.map +1 -0
  294. package/dist/stores/pending-restart.store.d.ts +22 -0
  295. package/dist/stores/pending-restart.store.d.ts.map +1 -0
  296. package/dist/stores/pending-restart.store.js +37 -0
  297. package/dist/stores/pending-restart.store.js.map +1 -0
  298. package/dist/types/cli.types.d.ts +304 -0
  299. package/dist/types/cli.types.d.ts.map +1 -0
  300. package/dist/types/distribution.types.d.ts +11 -0
  301. package/dist/types/distribution.types.d.ts.map +1 -0
  302. package/dist/types/host-autostart.types.d.ts +65 -0
  303. package/dist/types/host-autostart.types.d.ts.map +1 -0
  304. package/dist/types/npm-runtime-bundle.types.d.ts +50 -0
  305. package/dist/types/npm-runtime-bundle.types.d.ts.map +1 -0
  306. package/dist/utils/agent-runtime.utils.d.ts +15 -0
  307. package/dist/utils/agent-runtime.utils.d.ts.map +1 -0
  308. package/dist/utils/agent-runtime.utils.js +40 -0
  309. package/dist/utils/agent-runtime.utils.js.map +1 -0
  310. package/dist/utils/channel-config-view.utils.d.ts +7 -0
  311. package/dist/utils/channel-config-view.utils.d.ts.map +1 -0
  312. package/dist/utils/channel-config-view.utils.js +9 -0
  313. package/dist/utils/channel-config-view.utils.js.map +1 -0
  314. package/dist/utils/cli-agent-runner.utils.d.ts +14 -0
  315. package/dist/utils/cli-agent-runner.utils.d.ts.map +1 -0
  316. package/dist/utils/cli-agent-runner.utils.js +94 -0
  317. package/dist/utils/cli-agent-runner.utils.js.map +1 -0
  318. package/dist/utils/cli.utils.d.ts +32 -0
  319. package/dist/utils/cli.utils.d.ts.map +1 -0
  320. package/dist/utils/cli.utils.js +254 -0
  321. package/dist/utils/cli.utils.js.map +1 -0
  322. package/dist/utils/config-path.utils.d.ts +16 -0
  323. package/dist/utils/config-path.utils.d.ts.map +1 -0
  324. package/dist/utils/config-path.utils.js +169 -0
  325. package/dist/utils/config-path.utils.js.map +1 -0
  326. package/dist/utils/cron/cron-job.utils.d.ts +28 -0
  327. package/dist/utils/cron/cron-job.utils.d.ts.map +1 -0
  328. package/dist/utils/cron/cron-job.utils.js +17 -0
  329. package/dist/utils/cron/cron-job.utils.js.map +1 -0
  330. package/dist/utils/diagnostics/diagnostics-render.utils.d.ts +24 -0
  331. package/dist/utils/diagnostics/diagnostics-render.utils.d.ts.map +1 -0
  332. package/dist/utils/diagnostics/diagnostics-render.utils.js +74 -0
  333. package/dist/utils/diagnostics/diagnostics-render.utils.js.map +1 -0
  334. package/dist/utils/gateway-cron-job-handler.utils.d.ts +18 -0
  335. package/dist/utils/gateway-cron-job-handler.utils.d.ts.map +1 -0
  336. package/dist/utils/gateway-cron-job-handler.utils.js +56 -0
  337. package/dist/utils/gateway-cron-job-handler.utils.js.map +1 -0
  338. package/dist/utils/gateway-runtime-lifecycle.utils.d.ts +10 -0
  339. package/dist/utils/gateway-runtime-lifecycle.utils.d.ts.map +1 -0
  340. package/dist/utils/gateway-runtime-lifecycle.utils.js +12 -0
  341. package/dist/utils/gateway-runtime-lifecycle.utils.js.map +1 -0
  342. package/dist/utils/marketplace/cli-subcommand-launch.utils.d.ts +17 -0
  343. package/dist/utils/marketplace/cli-subcommand-launch.utils.d.ts.map +1 -0
  344. package/dist/utils/marketplace/cli-subcommand-launch.utils.js +48 -0
  345. package/dist/utils/marketplace/cli-subcommand-launch.utils.js.map +1 -0
  346. package/dist/utils/marketplace/marketplace-client.utils.d.ts +46 -0
  347. package/dist/utils/marketplace/marketplace-client.utils.d.ts.map +1 -0
  348. package/dist/utils/marketplace/marketplace-client.utils.js +137 -0
  349. package/dist/utils/marketplace/marketplace-client.utils.js.map +1 -0
  350. package/dist/utils/marketplace/marketplace-command-options.utils.d.ts +26 -0
  351. package/dist/utils/marketplace/marketplace-command-options.utils.d.ts.map +1 -0
  352. package/dist/utils/marketplace/marketplace-command-options.utils.js +33 -0
  353. package/dist/utils/marketplace/marketplace-command-options.utils.js.map +1 -0
  354. package/dist/utils/marketplace/marketplace-identity.utils.d.ts +15 -0
  355. package/dist/utils/marketplace/marketplace-identity.utils.d.ts.map +1 -0
  356. package/dist/utils/marketplace/marketplace-identity.utils.js +79 -0
  357. package/dist/utils/marketplace/marketplace-identity.utils.js.map +1 -0
  358. package/dist/utils/marketplace/marketplace-metadata.utils.d.ts +21 -0
  359. package/dist/utils/marketplace/marketplace-metadata.utils.d.ts.map +1 -0
  360. package/dist/utils/marketplace/marketplace-metadata.utils.js +74 -0
  361. package/dist/utils/marketplace/marketplace-metadata.utils.js.map +1 -0
  362. package/dist/utils/marketplace/marketplace-network-retry.utils.d.ts +5 -0
  363. package/dist/utils/marketplace/marketplace-network-retry.utils.d.ts.map +1 -0
  364. package/dist/utils/marketplace/marketplace-network-retry.utils.js +34 -0
  365. package/dist/utils/marketplace/marketplace-network-retry.utils.js.map +1 -0
  366. package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.d.ts +27 -0
  367. package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.d.ts.map +1 -0
  368. package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.js +206 -0
  369. package/dist/utils/marketplace/marketplace-skill-lifecycle.utils.js.map +1 -0
  370. package/dist/utils/marketplace/marketplace.utils.d.ts +34 -0
  371. package/dist/utils/marketplace/marketplace.utils.d.ts.map +1 -0
  372. package/dist/utils/marketplace/marketplace.utils.js +77 -0
  373. package/dist/utils/marketplace/marketplace.utils.js.map +1 -0
  374. package/dist/utils/marketplace/service-marketplace-helpers.utils.d.ts +15 -0
  375. package/dist/utils/marketplace/service-marketplace-helpers.utils.d.ts.map +1 -0
  376. package/dist/utils/marketplace/service-marketplace-helpers.utils.js +47 -0
  377. package/dist/utils/marketplace/service-marketplace-helpers.utils.js.map +1 -0
  378. package/dist/utils/package/package-manifest.utils.d.ts +5 -0
  379. package/dist/utils/package/package-manifest.utils.d.ts.map +1 -0
  380. package/dist/utils/package/package-manifest.utils.js +40 -0
  381. package/dist/utils/package/package-manifest.utils.js.map +1 -0
  382. package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts +5 -0
  383. package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts.map +1 -0
  384. package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js +37 -0
  385. package/dist/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js.map +1 -0
  386. package/dist/utils/platform-auth/payload.utils.d.ts +30 -0
  387. package/dist/utils/platform-auth/payload.utils.d.ts.map +1 -0
  388. package/dist/utils/platform-auth/payload.utils.js +89 -0
  389. package/dist/utils/platform-auth/payload.utils.js.map +1 -0
  390. package/dist/utils/remote/platform-api-base.utils.d.ts +15 -0
  391. package/dist/utils/remote/platform-api-base.utils.d.ts.map +1 -0
  392. package/dist/utils/remote/platform-api-base.utils.js +41 -0
  393. package/dist/utils/remote/platform-api-base.utils.js.map +1 -0
  394. package/dist/utils/remote/remote-runtime-support.utils.d.ts +16 -0
  395. package/dist/utils/remote/remote-runtime-support.utils.d.ts.map +1 -0
  396. package/dist/utils/remote/remote-runtime-support.utils.js +82 -0
  397. package/dist/utils/remote/remote-runtime-support.utils.js.map +1 -0
  398. package/dist/utils/restart-sentinel.utils.d.ts +37 -0
  399. package/dist/utils/restart-sentinel.utils.d.ts.map +1 -0
  400. package/dist/utils/restart-sentinel.utils.js +76 -0
  401. package/dist/utils/restart-sentinel.utils.js.map +1 -0
  402. package/dist/utils/runtime/managed-service-routing.utils.d.ts +31 -0
  403. package/dist/utils/runtime/managed-service-routing.utils.d.ts.map +1 -0
  404. package/dist/utils/runtime/managed-service-routing.utils.js +64 -0
  405. package/dist/utils/runtime/managed-service-routing.utils.js.map +1 -0
  406. package/dist/utils/runtime/service-remote-runtime.utils.d.ts +58 -0
  407. package/dist/utils/runtime/service-remote-runtime.utils.d.ts.map +1 -0
  408. package/dist/utils/runtime/service-remote-runtime.utils.js +184 -0
  409. package/dist/utils/runtime/service-remote-runtime.utils.js.map +1 -0
  410. package/dist/utils/runtime-helpers.utils.d.ts +15 -0
  411. package/dist/utils/runtime-helpers.utils.d.ts.map +1 -0
  412. package/dist/utils/runtime-helpers.utils.js +28 -0
  413. package/dist/utils/runtime-helpers.utils.js.map +1 -0
  414. package/dist/utils/service-port-probe.utils.d.ts +42 -0
  415. package/dist/utils/service-port-probe.utils.d.ts.map +1 -0
  416. package/dist/utils/service-port-probe.utils.js +166 -0
  417. package/dist/utils/service-port-probe.utils.js.map +1 -0
  418. package/dist/utils/startup-trace.utils.d.ts +8 -0
  419. package/dist/utils/startup-trace.utils.d.ts.map +1 -0
  420. package/dist/utils/startup-trace.utils.js +39 -0
  421. package/dist/utils/startup-trace.utils.js.map +1 -0
  422. package/dist/utils/top-level-nextclaw-command-env.utils.d.ts +5 -0
  423. package/dist/utils/top-level-nextclaw-command-env.utils.d.ts.map +1 -0
  424. package/dist/utils/top-level-nextclaw-command-env.utils.js +12 -0
  425. package/dist/utils/top-level-nextclaw-command-env.utils.js.map +1 -0
  426. package/package.json +26 -26
  427. package/dist/cli/commands/agent/agent-runtime.utils.d.ts +0 -15
  428. package/dist/cli/commands/agent/agent-runtime.utils.d.ts.map +0 -1
  429. package/dist/cli/commands/agent/agent-runtime.utils.js +0 -43
  430. package/dist/cli/commands/agent/agent-runtime.utils.js.map +0 -1
  431. package/dist/cli/commands/agent/cli-agent-runner.utils.d.ts +0 -14
  432. package/dist/cli/commands/agent/cli-agent-runner.utils.d.ts.map +0 -1
  433. package/dist/cli/commands/agent/cli-agent-runner.utils.js +0 -94
  434. package/dist/cli/commands/agent/cli-agent-runner.utils.js.map +0 -1
  435. package/dist/cli/commands/agent/index.d.ts +0 -3
  436. package/dist/cli/commands/agent/index.js +0 -3
  437. package/dist/cli/commands/agent/services/agent-commands.service.d.ts +0 -18
  438. package/dist/cli/commands/agent/services/agent-commands.service.d.ts.map +0 -1
  439. package/dist/cli/commands/agent/services/agent-commands.service.js +0 -113
  440. package/dist/cli/commands/agent/services/agent-commands.service.js.map +0 -1
  441. package/dist/cli/commands/config/index.d.ts +0 -2
  442. package/dist/cli/commands/config/index.js +0 -2
  443. package/dist/cli/commands/config/services/config-commands.service.d.ts +0 -17
  444. package/dist/cli/commands/config/services/config-commands.service.d.ts.map +0 -1
  445. package/dist/cli/commands/config/services/config-commands.service.js +0 -117
  446. package/dist/cli/commands/config/services/config-commands.service.js.map +0 -1
  447. package/dist/cli/commands/cron/index.d.ts +0 -2
  448. package/dist/cli/commands/cron/index.js +0 -2
  449. package/dist/cli/commands/cron/services/cron-commands.service.d.ts +0 -23
  450. package/dist/cli/commands/cron/services/cron-commands.service.d.ts.map +0 -1
  451. package/dist/cli/commands/cron/services/cron-commands.service.js +0 -109
  452. package/dist/cli/commands/cron/services/cron-commands.service.js.map +0 -1
  453. package/dist/cli/commands/cron/services/cron-local.service.d.ts +0 -26
  454. package/dist/cli/commands/cron/services/cron-local.service.d.ts.map +0 -1
  455. package/dist/cli/commands/cron/services/cron-local.service.js +0 -89
  456. package/dist/cli/commands/cron/services/cron-local.service.js.map +0 -1
  457. package/dist/cli/commands/cron/utils/cron-job.utils.d.ts +0 -28
  458. package/dist/cli/commands/cron/utils/cron-job.utils.d.ts.map +0 -1
  459. package/dist/cli/commands/cron/utils/cron-job.utils.js +0 -17
  460. package/dist/cli/commands/cron/utils/cron-job.utils.js.map +0 -1
  461. package/dist/cli/commands/diagnostics/index.d.ts +0 -2
  462. package/dist/cli/commands/diagnostics/index.js +0 -2
  463. package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.d.ts +0 -25
  464. package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.d.ts.map +0 -1
  465. package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.js +0 -345
  466. package/dist/cli/commands/diagnostics/services/diagnostics-commands.service.js.map +0 -1
  467. package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.d.ts +0 -24
  468. package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.d.ts.map +0 -1
  469. package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.js +0 -74
  470. package/dist/cli/commands/diagnostics/utils/diagnostics-render.utils.js.map +0 -1
  471. package/dist/cli/commands/gateway/index.d.ts +0 -15
  472. package/dist/cli/commands/gateway/index.d.ts.map +0 -1
  473. package/dist/cli/commands/gateway/index.js +0 -17
  474. package/dist/cli/commands/gateway/index.js.map +0 -1
  475. package/dist/cli/commands/logs/index.d.ts +0 -13
  476. package/dist/cli/commands/logs/index.d.ts.map +0 -1
  477. package/dist/cli/commands/logs/index.js +0 -31
  478. package/dist/cli/commands/logs/index.js.map +0 -1
  479. package/dist/cli/commands/mcp/index.d.ts +0 -15
  480. package/dist/cli/commands/mcp/index.d.ts.map +0 -1
  481. package/dist/cli/commands/mcp/index.js +0 -195
  482. package/dist/cli/commands/mcp/index.js.map +0 -1
  483. package/dist/cli/commands/restart/index.d.ts +0 -21
  484. package/dist/cli/commands/restart/index.d.ts.map +0 -1
  485. package/dist/cli/commands/restart/index.js +0 -90
  486. package/dist/cli/commands/restart/index.js.map +0 -1
  487. package/dist/cli/commands/secrets/index.d.ts +0 -23
  488. package/dist/cli/commands/secrets/index.d.ts.map +0 -1
  489. package/dist/cli/commands/secrets/index.js +0 -282
  490. package/dist/cli/commands/secrets/index.js.map +0 -1
  491. package/dist/cli/commands/serve/index.d.ts +0 -15
  492. package/dist/cli/commands/serve/index.d.ts.map +0 -1
  493. package/dist/cli/commands/serve/index.js +0 -21
  494. package/dist/cli/commands/serve/index.js.map +0 -1
  495. package/dist/cli/commands/skills/index.d.ts +0 -28
  496. package/dist/cli/commands/skills/index.d.ts.map +0 -1
  497. package/dist/cli/commands/skills/index.js +0 -170
  498. package/dist/cli/commands/skills/index.js.map +0 -1
  499. package/dist/cli/commands/skills/marketplace-client.d.ts +0 -46
  500. package/dist/cli/commands/skills/marketplace-client.d.ts.map +0 -1
  501. package/dist/cli/commands/skills/marketplace-client.js +0 -137
  502. package/dist/cli/commands/skills/marketplace-client.js.map +0 -1
  503. package/dist/cli/commands/skills/marketplace-command-options.utils.d.ts +0 -26
  504. package/dist/cli/commands/skills/marketplace-command-options.utils.d.ts.map +0 -1
  505. package/dist/cli/commands/skills/marketplace-command-options.utils.js +0 -33
  506. package/dist/cli/commands/skills/marketplace-command-options.utils.js.map +0 -1
  507. package/dist/cli/commands/skills/marketplace-identity.utils.d.ts +0 -15
  508. package/dist/cli/commands/skills/marketplace-identity.utils.d.ts.map +0 -1
  509. package/dist/cli/commands/skills/marketplace-identity.utils.js +0 -79
  510. package/dist/cli/commands/skills/marketplace-identity.utils.js.map +0 -1
  511. package/dist/cli/commands/skills/marketplace-network-retry.d.ts +0 -5
  512. package/dist/cli/commands/skills/marketplace-network-retry.d.ts.map +0 -1
  513. package/dist/cli/commands/skills/marketplace-network-retry.js +0 -34
  514. package/dist/cli/commands/skills/marketplace-network-retry.js.map +0 -1
  515. package/dist/cli/commands/skills/marketplace.metadata.d.ts +0 -21
  516. package/dist/cli/commands/skills/marketplace.metadata.d.ts.map +0 -1
  517. package/dist/cli/commands/skills/marketplace.metadata.js +0 -74
  518. package/dist/cli/commands/skills/marketplace.metadata.js.map +0 -1
  519. package/dist/cli/commands/skills/marketplace.utils.d.ts +0 -34
  520. package/dist/cli/commands/skills/marketplace.utils.d.ts.map +0 -1
  521. package/dist/cli/commands/skills/marketplace.utils.js +0 -77
  522. package/dist/cli/commands/skills/marketplace.utils.js.map +0 -1
  523. package/dist/cli/commands/skills/skills-query.service.d.ts +0 -110
  524. package/dist/cli/commands/skills/skills-query.service.d.ts.map +0 -1
  525. package/dist/cli/commands/skills/skills-query.service.js +0 -132
  526. package/dist/cli/commands/skills/skills-query.service.js.map +0 -1
  527. package/dist/cli/commands/skills/stores/marketplace-install-state.store.d.ts +0 -39
  528. package/dist/cli/commands/skills/stores/marketplace-install-state.store.d.ts.map +0 -1
  529. package/dist/cli/commands/skills/stores/marketplace-install-state.store.js +0 -58
  530. package/dist/cli/commands/skills/stores/marketplace-install-state.store.js.map +0 -1
  531. package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.d.ts +0 -27
  532. package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.d.ts.map +0 -1
  533. package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.js +0 -206
  534. package/dist/cli/commands/skills/utils/marketplace-skill-lifecycle.utils.js.map +0 -1
  535. package/dist/cli/commands/start/index.d.ts +0 -19
  536. package/dist/cli/commands/start/index.d.ts.map +0 -1
  537. package/dist/cli/commands/start/index.js +0 -27
  538. package/dist/cli/commands/start/index.js.map +0 -1
  539. package/dist/cli/commands/stop/index.d.ts +0 -13
  540. package/dist/cli/commands/stop/index.d.ts.map +0 -1
  541. package/dist/cli/commands/stop/index.js +0 -13
  542. package/dist/cli/commands/stop/index.js.map +0 -1
  543. package/dist/cli/commands/ui/index.d.ts +0 -15
  544. package/dist/cli/commands/ui/index.d.ts.map +0 -1
  545. package/dist/cli/commands/ui/index.js +0 -19
  546. package/dist/cli/commands/ui/index.js.map +0 -1
  547. package/dist/cli/commands/usage/index.d.ts +0 -2
  548. package/dist/cli/commands/usage/index.js +0 -2
  549. package/dist/cli/commands/usage/services/llm-usage-command.service.d.ts +0 -21
  550. package/dist/cli/commands/usage/services/llm-usage-command.service.d.ts.map +0 -1
  551. package/dist/cli/commands/usage/services/llm-usage-command.service.js +0 -152
  552. package/dist/cli/commands/usage/services/llm-usage-command.service.js.map +0 -1
  553. package/dist/commands/channel/channel-config-view.utils.d.ts +0 -7
  554. package/dist/commands/channel/channel-config-view.utils.d.ts.map +0 -1
  555. package/dist/commands/channel/channel-config-view.utils.js +0 -9
  556. package/dist/commands/channel/channel-config-view.utils.js.map +0 -1
  557. package/dist/commands/channel/channel-list-view.service.d.ts +0 -29
  558. package/dist/commands/channel/channel-list-view.service.d.ts.map +0 -1
  559. package/dist/commands/channel/channel-list-view.service.js +0 -53
  560. package/dist/commands/channel/channel-list-view.service.js.map +0 -1
  561. package/dist/commands/channel/index.d.ts +0 -21
  562. package/dist/commands/channel/index.d.ts.map +0 -1
  563. package/dist/commands/channel/index.js +0 -115
  564. package/dist/commands/channel/index.js.map +0 -1
  565. package/dist/commands/platform-auth/index.d.ts +0 -2
  566. package/dist/commands/platform-auth/index.js +0 -2
  567. package/dist/commands/platform-auth/services/account-status.service.d.ts +0 -19
  568. package/dist/commands/platform-auth/services/account-status.service.d.ts.map +0 -1
  569. package/dist/commands/platform-auth/services/account-status.service.js +0 -36
  570. package/dist/commands/platform-auth/services/account-status.service.js.map +0 -1
  571. package/dist/commands/platform-auth/services/platform-auth-commands.service.d.ts +0 -78
  572. package/dist/commands/platform-auth/services/platform-auth-commands.service.d.ts.map +0 -1
  573. package/dist/commands/platform-auth/services/platform-auth-commands.service.js +0 -297
  574. package/dist/commands/platform-auth/services/platform-auth-commands.service.js.map +0 -1
  575. package/dist/commands/platform-auth/utils/payload.utils.d.ts +0 -29
  576. package/dist/commands/platform-auth/utils/payload.utils.d.ts.map +0 -1
  577. package/dist/commands/platform-auth/utils/payload.utils.js +0 -89
  578. package/dist/commands/platform-auth/utils/payload.utils.js.map +0 -1
  579. package/dist/commands/remote/index.d.ts +0 -48
  580. package/dist/commands/remote/index.d.ts.map +0 -1
  581. package/dist/commands/remote/index.js +0 -176
  582. package/dist/commands/remote/index.js.map +0 -1
  583. package/dist/commands/remote/services/remote-access-host.service.d.ts +0 -42
  584. package/dist/commands/remote/services/remote-access-host.service.d.ts.map +0 -1
  585. package/dist/commands/remote/services/remote-access-host.service.js +0 -128
  586. package/dist/commands/remote/services/remote-access-host.service.js.map +0 -1
  587. package/dist/commands/remote/services/remote-service-control.service.d.ts +0 -34
  588. package/dist/commands/remote/services/remote-service-control.service.d.ts.map +0 -1
  589. package/dist/commands/remote/services/remote-service-control.service.js +0 -247
  590. package/dist/commands/remote/services/remote-service-control.service.js.map +0 -1
  591. package/dist/commands/remote/utils/platform-api-base.utils.d.ts +0 -15
  592. package/dist/commands/remote/utils/platform-api-base.utils.d.ts.map +0 -1
  593. package/dist/commands/remote/utils/platform-api-base.utils.js +0 -41
  594. package/dist/commands/remote/utils/platform-api-base.utils.js.map +0 -1
  595. package/dist/commands/remote/utils/remote-runtime-support.utils.d.ts +0 -16
  596. package/dist/commands/remote/utils/remote-runtime-support.utils.d.ts.map +0 -1
  597. package/dist/commands/remote/utils/remote-runtime-support.utils.js +0 -82
  598. package/dist/commands/remote/utils/remote-runtime-support.utils.js.map +0 -1
  599. package/dist/commands/service/index.d.ts +0 -17
  600. package/dist/commands/service/index.d.ts.map +0 -1
  601. package/dist/commands/service/index.js +0 -33
  602. package/dist/commands/service/index.js.map +0 -1
  603. package/dist/commands/service/services/autostart/host-autostart-command.service.d.ts +0 -30
  604. package/dist/commands/service/services/autostart/host-autostart-command.service.d.ts.map +0 -1
  605. package/dist/commands/service/services/autostart/host-autostart-command.service.js +0 -160
  606. package/dist/commands/service/services/autostart/host-autostart-command.service.js.map +0 -1
  607. package/dist/commands/service/services/autostart/host-autostart-runtime.service.d.ts +0 -24
  608. package/dist/commands/service/services/autostart/host-autostart-runtime.service.d.ts.map +0 -1
  609. package/dist/commands/service/services/autostart/host-autostart-runtime.service.js +0 -55
  610. package/dist/commands/service/services/autostart/host-autostart-runtime.service.js.map +0 -1
  611. package/dist/commands/service/services/autostart/host-autostart.service.d.ts +0 -42
  612. package/dist/commands/service/services/autostart/host-autostart.service.d.ts.map +0 -1
  613. package/dist/commands/service/services/autostart/host-autostart.service.js +0 -50
  614. package/dist/commands/service/services/autostart/host-autostart.service.js.map +0 -1
  615. package/dist/commands/service/services/autostart/linux-systemd-autostart.service.d.ts +0 -49
  616. package/dist/commands/service/services/autostart/linux-systemd-autostart.service.d.ts.map +0 -1
  617. package/dist/commands/service/services/autostart/linux-systemd-autostart.service.js +0 -435
  618. package/dist/commands/service/services/autostart/linux-systemd-autostart.service.js.map +0 -1
  619. package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.d.ts +0 -55
  620. package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.d.ts.map +0 -1
  621. package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.js +0 -407
  622. package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.js.map +0 -1
  623. package/dist/commands/service/services/autostart/windows-task-autostart.service.d.ts +0 -55
  624. package/dist/commands/service/services/autostart/windows-task-autostart.service.d.ts.map +0 -1
  625. package/dist/commands/service/services/autostart/windows-task-autostart.service.js +0 -406
  626. package/dist/commands/service/services/autostart/windows-task-autostart.service.js.map +0 -1
  627. package/dist/commands/service/types/autostart/host-autostart.types.d.ts +0 -65
  628. package/dist/commands/service/types/autostart/host-autostart.types.d.ts.map +0 -1
  629. package/dist/launcher/npm-runtime-bundle-layout.store.d.ts +0 -24
  630. package/dist/launcher/npm-runtime-bundle-layout.store.d.ts.map +0 -1
  631. package/dist/launcher/npm-runtime-bundle-layout.store.js +0 -39
  632. package/dist/launcher/npm-runtime-bundle-layout.store.js.map +0 -1
  633. package/dist/launcher/npm-runtime-bundle-manifest.service.d.ts +0 -10
  634. package/dist/launcher/npm-runtime-bundle-manifest.service.d.ts.map +0 -1
  635. package/dist/launcher/npm-runtime-bundle-manifest.service.js +0 -41
  636. package/dist/launcher/npm-runtime-bundle-manifest.service.js.map +0 -1
  637. package/dist/launcher/npm-runtime-bundle.service.d.ts +0 -48
  638. package/dist/launcher/npm-runtime-bundle.service.d.ts.map +0 -1
  639. package/dist/launcher/npm-runtime-bundle.service.js +0 -152
  640. package/dist/launcher/npm-runtime-bundle.service.js.map +0 -1
  641. package/dist/launcher/npm-runtime-bundle.types.d.ts +0 -50
  642. package/dist/launcher/npm-runtime-bundle.types.d.ts.map +0 -1
  643. package/dist/launcher/npm-runtime-update-command.service.d.ts +0 -16
  644. package/dist/launcher/npm-runtime-update-command.service.d.ts.map +0 -1
  645. package/dist/launcher/npm-runtime-update-command.service.js +0 -120
  646. package/dist/launcher/npm-runtime-update-command.service.js.map +0 -1
  647. package/dist/launcher/npm-runtime-update-source.service.d.ts +0 -22
  648. package/dist/launcher/npm-runtime-update-source.service.d.ts.map +0 -1
  649. package/dist/launcher/npm-runtime-update-source.service.js +0 -61
  650. package/dist/launcher/npm-runtime-update-source.service.js.map +0 -1
  651. package/dist/launcher/npm-runtime-update-state.store.d.ts +0 -18
  652. package/dist/launcher/npm-runtime-update-state.store.d.ts.map +0 -1
  653. package/dist/launcher/npm-runtime-update-state.store.js +0 -94
  654. package/dist/launcher/npm-runtime-update-state.store.js.map +0 -1
  655. package/dist/launcher/npm-runtime-update.manager.d.ts +0 -43
  656. package/dist/launcher/npm-runtime-update.manager.d.ts.map +0 -1
  657. package/dist/launcher/npm-runtime-update.manager.js +0 -185
  658. package/dist/launcher/npm-runtime-update.manager.js.map +0 -1
  659. package/dist/launcher/npm-runtime-update.service.d.ts +0 -55
  660. package/dist/launcher/npm-runtime-update.service.d.ts.map +0 -1
  661. package/dist/launcher/npm-runtime-update.service.js +0 -185
  662. package/dist/launcher/npm-runtime-update.service.js.map +0 -1
  663. package/dist/service-runtime.service.d.ts +0 -88
  664. package/dist/service-runtime.service.d.ts.map +0 -1
  665. package/dist/service-runtime.service.js +0 -366
  666. package/dist/service-runtime.service.js.map +0 -1
  667. package/dist/shared/controllers/gateway.controller.d.ts +0 -54
  668. package/dist/shared/controllers/gateway.controller.d.ts.map +0 -1
  669. package/dist/shared/controllers/gateway.controller.js +0 -162
  670. package/dist/shared/controllers/gateway.controller.js.map +0 -1
  671. package/dist/shared/services/gateway/gateway-restart-wake.service.d.ts +0 -13
  672. package/dist/shared/services/gateway/gateway-restart-wake.service.d.ts.map +0 -1
  673. package/dist/shared/services/gateway/gateway-restart-wake.service.js +0 -99
  674. package/dist/shared/services/gateway/gateway-restart-wake.service.js.map +0 -1
  675. package/dist/shared/services/gateway/managers/gateway-extension.manager.d.ts +0 -29
  676. package/dist/shared/services/gateway/managers/gateway-extension.manager.d.ts.map +0 -1
  677. package/dist/shared/services/gateway/managers/gateway-extension.manager.js +0 -78
  678. package/dist/shared/services/gateway/managers/gateway-extension.manager.js.map +0 -1
  679. package/dist/shared/services/gateway/managers/gateway-remote.manager.d.ts +0 -23
  680. package/dist/shared/services/gateway/managers/gateway-remote.manager.d.ts.map +0 -1
  681. package/dist/shared/services/gateway/managers/gateway-remote.manager.js +0 -28
  682. package/dist/shared/services/gateway/managers/gateway-remote.manager.js.map +0 -1
  683. package/dist/shared/services/gateway/nextclaw-app.service.d.ts +0 -18
  684. package/dist/shared/services/gateway/nextclaw-app.service.d.ts.map +0 -1
  685. package/dist/shared/services/gateway/nextclaw-app.service.js +0 -44
  686. package/dist/shared/services/gateway/nextclaw-app.service.js.map +0 -1
  687. package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.d.ts +0 -85
  688. package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.d.ts.map +0 -1
  689. package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.js +0 -278
  690. package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.js.map +0 -1
  691. package/dist/shared/services/gateway/service-bootstrap-status.service.d.ts +0 -33
  692. package/dist/shared/services/gateway/service-bootstrap-status.service.d.ts.map +0 -1
  693. package/dist/shared/services/gateway/service-bootstrap-status.service.js +0 -144
  694. package/dist/shared/services/gateway/service-bootstrap-status.service.js.map +0 -1
  695. package/dist/shared/services/gateway/service-startup-support.service.d.ts +0 -35
  696. package/dist/shared/services/gateway/service-startup-support.service.d.ts.map +0 -1
  697. package/dist/shared/services/gateway/service-startup-support.service.js +0 -85
  698. package/dist/shared/services/gateway/service-startup-support.service.js.map +0 -1
  699. package/dist/shared/services/gateway/utils/cron-job-handler.utils.d.ts +0 -18
  700. package/dist/shared/services/gateway/utils/cron-job-handler.utils.d.ts.map +0 -1
  701. package/dist/shared/services/gateway/utils/cron-job-handler.utils.js +0 -56
  702. package/dist/shared/services/gateway/utils/cron-job-handler.utils.js.map +0 -1
  703. package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.d.ts +0 -10
  704. package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.d.ts.map +0 -1
  705. package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.js +0 -12
  706. package/dist/shared/services/gateway/utils/gateway-runtime-lifecycle.utils.js.map +0 -1
  707. package/dist/shared/services/marketplace/service-marketplace-installer.service.d.ts +0 -29
  708. package/dist/shared/services/marketplace/service-marketplace-installer.service.d.ts.map +0 -1
  709. package/dist/shared/services/marketplace/service-marketplace-installer.service.js +0 -87
  710. package/dist/shared/services/marketplace/service-marketplace-installer.service.js.map +0 -1
  711. package/dist/shared/services/marketplace/service-mcp-marketplace-ops.d.ts +0 -40
  712. package/dist/shared/services/marketplace/service-mcp-marketplace-ops.d.ts.map +0 -1
  713. package/dist/shared/services/marketplace/service-mcp-marketplace-ops.js +0 -69
  714. package/dist/shared/services/marketplace/service-mcp-marketplace-ops.js.map +0 -1
  715. package/dist/shared/services/restart/restart-coordinator.service.d.ts +0 -31
  716. package/dist/shared/services/restart/restart-coordinator.service.d.ts.map +0 -1
  717. package/dist/shared/services/restart/restart-coordinator.service.js +0 -53
  718. package/dist/shared/services/restart/restart-coordinator.service.js.map +0 -1
  719. package/dist/shared/services/restart/runtime-restart-request.service.d.ts +0 -25
  720. package/dist/shared/services/restart/runtime-restart-request.service.d.ts.map +0 -1
  721. package/dist/shared/services/restart/runtime-restart-request.service.js +0 -44
  722. package/dist/shared/services/restart/runtime-restart-request.service.js.map +0 -1
  723. package/dist/shared/services/runtime/managed-service-supervisor.service.d.ts +0 -85
  724. package/dist/shared/services/runtime/managed-service-supervisor.service.d.ts.map +0 -1
  725. package/dist/shared/services/runtime/managed-service-supervisor.service.js +0 -271
  726. package/dist/shared/services/runtime/managed-service-supervisor.service.js.map +0 -1
  727. package/dist/shared/services/runtime/nextclaw-distribution.service.d.ts +0 -11
  728. package/dist/shared/services/runtime/nextclaw-distribution.service.d.ts.map +0 -1
  729. package/dist/shared/services/runtime/nextclaw-distribution.service.js +0 -15
  730. package/dist/shared/services/runtime/nextclaw-distribution.service.js.map +0 -1
  731. package/dist/shared/services/runtime/runtime-command.service.d.ts +0 -42
  732. package/dist/shared/services/runtime/runtime-command.service.d.ts.map +0 -1
  733. package/dist/shared/services/runtime/runtime-command.service.js +0 -195
  734. package/dist/shared/services/runtime/runtime-command.service.js.map +0 -1
  735. package/dist/shared/services/runtime/runtime-config-init.service.d.ts +0 -5
  736. package/dist/shared/services/runtime/runtime-config-init.service.d.ts.map +0 -1
  737. package/dist/shared/services/runtime/runtime-config-init.service.js +0 -12
  738. package/dist/shared/services/runtime/runtime-config-init.service.js.map +0 -1
  739. package/dist/shared/services/runtime/service-managed-startup.service.d.ts +0 -95
  740. package/dist/shared/services/runtime/service-managed-startup.service.d.ts.map +0 -1
  741. package/dist/shared/services/runtime/service-managed-startup.service.js +0 -341
  742. package/dist/shared/services/runtime/service-managed-startup.service.js.map +0 -1
  743. package/dist/shared/services/runtime/utils/managed-service-routing.utils.d.ts +0 -31
  744. package/dist/shared/services/runtime/utils/managed-service-routing.utils.d.ts.map +0 -1
  745. package/dist/shared/services/runtime/utils/managed-service-routing.utils.js +0 -64
  746. package/dist/shared/services/runtime/utils/managed-service-routing.utils.js.map +0 -1
  747. package/dist/shared/services/runtime/utils/service-remote-runtime.utils.d.ts +0 -58
  748. package/dist/shared/services/runtime/utils/service-remote-runtime.utils.d.ts.map +0 -1
  749. package/dist/shared/services/runtime/utils/service-remote-runtime.utils.js +0 -184
  750. package/dist/shared/services/runtime/utils/service-remote-runtime.utils.js.map +0 -1
  751. package/dist/shared/services/ui/companion-runtime.service.d.ts +0 -36
  752. package/dist/shared/services/ui/companion-runtime.service.d.ts.map +0 -1
  753. package/dist/shared/services/ui/companion-runtime.service.js +0 -180
  754. package/dist/shared/services/ui/companion-runtime.service.js.map +0 -1
  755. package/dist/shared/services/ui/local-ui-discovery.service.d.ts +0 -20
  756. package/dist/shared/services/ui/local-ui-discovery.service.d.ts.map +0 -1
  757. package/dist/shared/services/ui/local-ui-discovery.service.js +0 -43
  758. package/dist/shared/services/ui/local-ui-discovery.service.js.map +0 -1
  759. package/dist/shared/services/ui/npm-runtime-update-host.service.d.ts +0 -41
  760. package/dist/shared/services/ui/npm-runtime-update-host.service.d.ts.map +0 -1
  761. package/dist/shared/services/ui/npm-runtime-update-host.service.js +0 -189
  762. package/dist/shared/services/ui/npm-runtime-update-host.service.js.map +0 -1
  763. package/dist/shared/services/ui/runtime-control-host.service.d.ts +0 -29
  764. package/dist/shared/services/ui/runtime-control-host.service.d.ts.map +0 -1
  765. package/dist/shared/services/ui/runtime-control-host.service.js +0 -91
  766. package/dist/shared/services/ui/runtime-control-host.service.js.map +0 -1
  767. package/dist/shared/services/ui/service-remote-access.service.d.ts +0 -26
  768. package/dist/shared/services/ui/service-remote-access.service.d.ts.map +0 -1
  769. package/dist/shared/services/ui/service-remote-access.service.js +0 -40
  770. package/dist/shared/services/ui/service-remote-access.service.js.map +0 -1
  771. package/dist/shared/services/ui/ui-bridge-api.service.d.ts +0 -17
  772. package/dist/shared/services/ui/ui-bridge-api.service.d.ts.map +0 -1
  773. package/dist/shared/services/ui/ui-bridge-api.service.js +0 -45
  774. package/dist/shared/services/ui/ui-bridge-api.service.js.map +0 -1
  775. package/dist/shared/services/workspace/workspace-manager.service.d.ts +0 -14
  776. package/dist/shared/services/workspace/workspace-manager.service.d.ts.map +0 -1
  777. package/dist/shared/services/workspace/workspace-manager.service.js +0 -86
  778. package/dist/shared/services/workspace/workspace-manager.service.js.map +0 -1
  779. package/dist/shared/stores/companion-runtime.store.d.ts +0 -16
  780. package/dist/shared/stores/companion-runtime.store.d.ts.map +0 -1
  781. package/dist/shared/stores/companion-runtime.store.js +0 -29
  782. package/dist/shared/stores/companion-runtime.store.js.map +0 -1
  783. package/dist/shared/stores/local-ui-runtime.store.d.ts +0 -26
  784. package/dist/shared/stores/local-ui-runtime.store.d.ts.map +0 -1
  785. package/dist/shared/stores/local-ui-runtime.store.js +0 -56
  786. package/dist/shared/stores/local-ui-runtime.store.js.map +0 -1
  787. package/dist/shared/stores/managed-service-state.store.d.ts +0 -46
  788. package/dist/shared/stores/managed-service-state.store.d.ts.map +0 -1
  789. package/dist/shared/stores/managed-service-state.store.js +0 -40
  790. package/dist/shared/stores/managed-service-state.store.js.map +0 -1
  791. package/dist/shared/stores/pending-restart.store.d.ts +0 -22
  792. package/dist/shared/stores/pending-restart.store.d.ts.map +0 -1
  793. package/dist/shared/stores/pending-restart.store.js +0 -37
  794. package/dist/shared/stores/pending-restart.store.js.map +0 -1
  795. package/dist/shared/types/cli.types.d.ts +0 -304
  796. package/dist/shared/types/cli.types.d.ts.map +0 -1
  797. package/dist/shared/types/distribution.types.d.ts +0 -11
  798. package/dist/shared/types/distribution.types.d.ts.map +0 -1
  799. package/dist/shared/utils/cli.utils.d.ts +0 -32
  800. package/dist/shared/utils/cli.utils.d.ts.map +0 -1
  801. package/dist/shared/utils/cli.utils.js +0 -254
  802. package/dist/shared/utils/cli.utils.js.map +0 -1
  803. package/dist/shared/utils/config-path.d.ts +0 -16
  804. package/dist/shared/utils/config-path.d.ts.map +0 -1
  805. package/dist/shared/utils/config-path.js +0 -169
  806. package/dist/shared/utils/config-path.js.map +0 -1
  807. package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.d.ts +0 -17
  808. package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.d.ts.map +0 -1
  809. package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.js +0 -48
  810. package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.js.map +0 -1
  811. package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.d.ts +0 -15
  812. package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.d.ts.map +0 -1
  813. package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.js +0 -47
  814. package/dist/shared/utils/marketplace/service-marketplace-helpers.utils.js.map +0 -1
  815. package/dist/shared/utils/package/package-manifest.utils.d.ts +0 -5
  816. package/dist/shared/utils/package/package-manifest.utils.d.ts.map +0 -1
  817. package/dist/shared/utils/package/package-manifest.utils.js +0 -40
  818. package/dist/shared/utils/package/package-manifest.utils.js.map +0 -1
  819. package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts +0 -5
  820. package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.d.ts.map +0 -1
  821. package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js +0 -37
  822. package/dist/shared/utils/panel-app-client-sdk/panel-app-client-sdk-script.utils.js.map +0 -1
  823. package/dist/shared/utils/restart/restart-sentinel.utils.d.ts +0 -37
  824. package/dist/shared/utils/restart/restart-sentinel.utils.d.ts.map +0 -1
  825. package/dist/shared/utils/restart/restart-sentinel.utils.js +0 -76
  826. package/dist/shared/utils/restart/restart-sentinel.utils.js.map +0 -1
  827. package/dist/shared/utils/runtime-helpers.d.ts +0 -15
  828. package/dist/shared/utils/runtime-helpers.d.ts.map +0 -1
  829. package/dist/shared/utils/runtime-helpers.js +0 -28
  830. package/dist/shared/utils/runtime-helpers.js.map +0 -1
  831. package/dist/shared/utils/service-port-probe.utils.d.ts +0 -42
  832. package/dist/shared/utils/service-port-probe.utils.d.ts.map +0 -1
  833. package/dist/shared/utils/service-port-probe.utils.js +0 -166
  834. package/dist/shared/utils/service-port-probe.utils.js.map +0 -1
  835. package/dist/shared/utils/startup-trace.d.ts +0 -8
  836. package/dist/shared/utils/startup-trace.d.ts.map +0 -1
  837. package/dist/shared/utils/startup-trace.js +0 -39
  838. package/dist/shared/utils/startup-trace.js.map +0 -1
  839. package/dist/shared/utils/top-level-nextclaw-command-env.utils.d.ts +0 -5
  840. package/dist/shared/utils/top-level-nextclaw-command-env.utils.d.ts.map +0 -1
  841. package/dist/shared/utils/top-level-nextclaw-command-env.utils.js +0 -12
  842. package/dist/shared/utils/top-level-nextclaw-command-env.utils.js.map +0 -1
  843. /package/dist/{shared/types → types}/cli.types.js +0 -0
  844. /package/dist/{shared/types → types}/distribution.types.js +0 -0
  845. /package/dist/{commands/service/types/autostart → types}/host-autostart.types.js +0 -0
  846. /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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I;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":";;;;;;;;;AAqCA,IAAa,0BAAb,MAAqC;CACnC;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAA0D;AAAzC,OAAA,UAAA;AAC3B,OAAK,WAAW,QAAQ,YAAY,QAAQ;AAC5C,OAAK,OAAO,QAAQ,QAAQ,QAAQ;AACpC,OAAK,YAAY,QAAQ,aAAa;AACtC,OAAK,iBAAiB,QAAQ,kBAAkB,IAAI,sBAAsB;AAC1E,OAAK,kBAAkB,KAAK,qBAAqB,QAAQ,gBAAgB;AACzE,OAAK,MAAM,QAAQ,OAAO,KAAK;;CAGjC,6BAAsC,QAAQ,KAAK,gBAAgB;CAEnE,iBAAiB,OAAO,aAAqB,gBAA+B,cAAwB,EAAE,KAAgD;EACpJ,MAAM,WAAW,MAAM,KAAK,cAAc,YAAY;AACtD,MAAI,kBAAkB,0BAA0B,SAAS,eAAe,eAAe,IAAI,EACzF,QAAO;AAET,MAAI,0BAA0B,KAAK,QAAQ,iBAAiB,SAAS,uBAAuB,GAAG,EAC7F,QAAO;GAAE,MAAM;GAAwB;GAAU;AAEnD,MAAI,YAAY,SAAS,SAAS,cAAc,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fMissing(configPath?: string): boolean;
3
+ //#endregion
4
+ export { initializeConfigIfMissing };
5
+ //# sourceMappingURL=runtime-config-init.service.d.ts.map
@@ -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,OAA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