@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
@@ -1 +0,0 @@
1
- {"version":3,"file":"npm-runtime-update.service.js","names":[],"sources":["../../src/launcher/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 \"./npm-runtime-bundle-layout.store.js\";\nimport { compareNpmRuntimeVersions, type NpmRuntimeBundleService } from \"./npm-runtime-bundle.service.js\";\nimport type {\n NpmRuntimeDownloadedUpdate,\n NpmRuntimeUpdateProgressReporter\n} from \"./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,CAC9C,QAAO;GAAE,MAAM;GAA2B;GAAU;AAEtD,SAAO;GAAE,MAAM;GAAyB;GAAU;;CAGpD,2BAA2B,OACzB,UACA,mBACwC;EACxC,MAAM,QAAQ,MAAM,KAAK,oBAAoB,UAAU,eAAe;EACtE,MAAM,cAAc,KAAK,KAAK,QAAQ,OAAO,eAAe,EAAE,YAAY,SAAS,cAAc,GAAG,KAAK,KAAK,GAAG;A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AM;AACvC,MAAI,CAAC,cACH,QAAO;EAET,MAAM,kBAAkB,cAAc,WAAW,OAAO,KAAK;AAC7D,MAAI,gBAAgB,SAAS,mBAAmB,CAC9C,QAAO,gBAAgB,gBAAgB;AAEzC,SAAO,gBAAgB;GACrB,KAAK,OAAO,KAAK,eAAe,SAAS;GACzC,QAAQ;GACR,MAAM;GACP,CAAC;;CAGJ,2BAAmC,aAAmC;AACpE,MAAI,CAAC,KAAK,gBACR,OAAM,IAAI,MAAM,0EAA0E;EAE5F,MAAM,YAAY,OAAO,KAAK,SAAS,mBAAmB,SAAS;AAEnE,MAAI,CADU,OAAO,MAAM,OAAO,KAAK,gCAAgC,SAAS,CAAC,EAAE,KAAK,iBAAiB,UAAU,CAEjH,OAAM,IAAI,MAAM,6DAA6D,SAAS,gBAAgB;;CAI1G,yBAAiC,UAA0B,UAAwB;AACjF,MAAI,CAAC,KAAK,gBACR,OAAM,IAAI,MAAM,iEAAiE;EAEnF,MAAM,YAAY,OAAO,KAAK,SAAS,iBAAiB,SAAS;AAEjE,MAAI,CADU,OAAO,MAAM,OAAO,KAAK,iBAAiB,UAAU,CAEhE,OAAM,IAAI,MAAM,oDAAoD,SAAS,gBAAgB;;;AAKnG,SAAS,mBAAmB,WAA6B;AACvD,QAAO,YAAY,WAAW,EAAE,eAAe,MAAM,CAAC,CACnD,QAAQ,UAAU,MAAM,aAAa,CAAC,CACtC,KAAK,UAAU,MAAM,KAAK"}
@@ -1,88 +0,0 @@
1
- import { AgentCommandOptions, LoginCommandOptions, UpdateCommandOptions } from "./shared/types/cli.types.js";
2
- import { AgentCommands } from "./cli/commands/agent/services/agent-commands.service.js";
3
- import { ConfigCommands } from "./cli/commands/config/services/config-commands.service.js";
4
- import { CronCommands } from "./cli/commands/cron/services/cron-commands.service.js";
5
- import { DiagnosticsCommands } from "./cli/commands/diagnostics/services/diagnostics-commands.service.js";
6
- import { GatewayCommands } from "./cli/commands/gateway/index.js";
7
- import { LogsCommands } from "./cli/commands/logs/index.js";
8
- import { McpCommands } from "./cli/commands/mcp/index.js";
9
- import { StartCommands } from "./cli/commands/start/index.js";
10
- import { RestartCommands } from "./cli/commands/restart/index.js";
11
- import { SecretsCommands } from "./cli/commands/secrets/index.js";
12
- import { ServeCommands } from "./cli/commands/serve/index.js";
13
- import { SkillsCommands } from "./cli/commands/skills/index.js";
14
- import { StopCommands } from "./cli/commands/stop/index.js";
15
- import { UiCommands } from "./cli/commands/ui/index.js";
16
- import { LlmUsageCommandService } from "./cli/commands/usage/services/llm-usage-command.service.js";
17
- import { ChannelCommands } from "./commands/channel/index.js";
18
- import { ServiceCommands } from "./commands/service/index.js";
19
- import { RemoteRuntimeActions } from "@nextclaw/remote";
20
-
21
- //#region src/service-runtime.service.d.ts
22
- type NextclawServiceRuntimeOptions = {
23
- logo?: string;
24
- };
25
- type NextclawServiceRuntimeAccount = {
26
- status: (opts?: {
27
- apiBase?: string;
28
- json?: boolean;
29
- }) => Promise<void>;
30
- setUsername: (username: string, opts?: {
31
- apiBase?: string;
32
- json?: boolean;
33
- }) => Promise<void>;
34
- };
35
- type NextclawServiceCommands = {
36
- remote: RemoteRuntimeActions;
37
- skills: SkillsCommands;
38
- service: ServiceCommands;
39
- config: ConfigCommands;
40
- mcp: McpCommands;
41
- secrets: SecretsCommands;
42
- agents: AgentCommands;
43
- channels: ChannelCommands;
44
- cron: CronCommands;
45
- diagnostics: DiagnosticsCommands;
46
- logs: LogsCommands;
47
- gateway: GatewayCommands;
48
- ui: UiCommands;
49
- start: StartCommands;
50
- restart: RestartCommands;
51
- serve: ServeCommands;
52
- stop: StopCommands;
53
- usage: LlmUsageCommandService;
54
- };
55
- declare class NextclawServiceRuntime {
56
- private logo;
57
- private restartCoordinator;
58
- private serviceRestartTask;
59
- private selfRelaunchArmed;
60
- private restartRequestService;
61
- private workspaceManager;
62
- private runtimeCommandService;
63
- private platformAuthCommands;
64
- private remoteCommands;
65
- account: NextclawServiceRuntimeAccount;
66
- commands: NextclawServiceCommands;
67
- constructor(options: NextclawServiceRuntimeOptions);
68
- private createCommands;
69
- get version(): string;
70
- private scheduleProcessExit;
71
- private restartBackgroundService;
72
- private armManagedServiceRelaunch;
73
- private requestRestart;
74
- private writeRestartSentinelFromExecContext;
75
- onboard: () => Promise<void>;
76
- init: (options?: {
77
- source?: string;
78
- auto?: boolean;
79
- force?: boolean;
80
- }) => Promise<void>;
81
- login: (opts?: LoginCommandOptions) => Promise<void>;
82
- agent: (opts: AgentCommandOptions) => Promise<void>;
83
- update: (opts: UpdateCommandOptions) => Promise<void>;
84
- }
85
- declare const runNextclawNpmRuntimeLauncher: (argv?: string[]) => void;
86
- //#endregion
87
- export { NextclawServiceCommands, NextclawServiceRuntime, NextclawServiceRuntimeAccount, NextclawServiceRuntimeOptions, runNextclawNpmRuntimeLauncher };
88
- //# sourceMappingURL=service-runtime.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-runtime.service.d.ts","names":[],"sources":["../src/service-runtime.service.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;KA0CY,6BAAA;EACV,IAAA;AAAA;AAAA,KAGU,6BAAA;EACV,MAAA,GAAS,IAAA;IAAS,OAAA;IAAkB,IAAA;EAAA,MAAqB,OAAA;EACzD,WAAA,GACE,QAAA,UACA,IAAA;IAAS,OAAA;IAAkB,IAAA;EAAA,MACxB,OAAA;AAAA;AAAA,KAGK,uBAAA;EACV,MAAA,EAAQ,oBAAA;EACR,MAAA,EAAQ,cAAA;EACR,OAAA,EAAS,eAAA;EACT,MAAA,EAAQ,cAAA;EACR,GAAA,EAAK,WAAA;EACL,OAAA,EAAS,eAAA;EACT,MAAA,EAAQ,aAAA;EACR,QAAA,EAAU,eAAA;EACV,IAAA,EAAM,YAAA;EACN,WAAA,EAAa,mBAAA;EACb,IAAA,EAAM,YAAA;EACN,OAAA,EAAS,eAAA;EACT,EAAA,EAAI,UAAA;EACJ,KAAA,EAAO,aAAA;EACP,OAAA,EAAS,eAAA;EACT,KAAA,EAAO,aAAA;EACP,IAAA,EAAM,YAAA;EACN,KAAA,EAAO,sBAAA;AAAA;AAAA,cAGI,sBAAA;EAAA,QACH,IAAA;EAAA,QACA,kBAAA;EAAA,QACA,kBAAA;EAAA,QACA,iBAAA;EAAA,QACA,qBAAA;EAAA,QACA,gBAAA;EAAA,QACA,qBAAA;EAAA,QACA,oBAAA;EAAA,QACA,cAAA;EACR,OAAA,EAAS,6BAAA;EACT,QAAA,EAAU,uBAAA;cACE,OAAA,EAAS,6BAAA;EAAA,QAyCb,cAAA;EAAA,IA4DJ,OAAA,CAAA;EAAA,QAII,mBAAA;EAAA,QAOA,wBAAA;EAAA,QAuCA,yBAAA;EAAA,QA0GA,cAAA;EAAA,QAIA,mCAAA;EA0BR,OAAA,QAAoB,OAAA;EAOpB,IAAA,GAAc,OAAA;IAAW,MAAA;IAAiB,IAAA;IAAgB,KAAA;EAAA,MAAyB,OAAA;EA8CnF,KAAA,GAAe,IAAA,GAAM,mBAAA,KAA2B,OAAA;EAKhD,KAAA,GAAe,IAAA,EAAM,mBAAA,KAAsB,OAAA;EAgB3C,MAAA,GAAgB,IAAA,EAAM,oBAAA,KAAuB,OAAA;AAAA;AAAA,cAkBlC,6BAAA,GACX,IAAA"}
@@ -1,366 +0,0 @@
1
- import { RestartCoordinator } from "./shared/services/restart/restart-coordinator.service.js";
2
- import { initializeConfigIfMissing } from "./shared/services/runtime/runtime-config-init.service.js";
3
- import { writeRestartSentinel } from "./shared/utils/restart/restart-sentinel.utils.js";
4
- import { createTopLevelNextclawCommandEnv } from "./shared/utils/top-level-nextclaw-command-env.utils.js";
5
- import { resolveCliSubcommandLaunch } from "./shared/utils/marketplace/cli-subcommand-launch.utils.js";
6
- import { logStartupTrace, measureStartupSync } from "./shared/utils/startup-trace.js";
7
- import { isProcessRunning } from "./shared/utils/cli.utils.js";
8
- import { NextclawDistributionService } from "./shared/services/runtime/nextclaw-distribution.service.js";
9
- import { NpmRuntimeUpdateCommandService } from "./launcher/npm-runtime-update-command.service.js";
10
- import { NpmRuntimeLauncher } from "./launcher/npm-runtime-launcher.service.js";
11
- import { managedServiceStateStore } from "./shared/stores/managed-service-state.store.js";
12
- import { ChannelCommands } from "./commands/channel/index.js";
13
- import { ConfigCommands } from "./cli/commands/config/services/config-commands.service.js";
14
- import "./cli/commands/config/index.js";
15
- import { McpCommands } from "./cli/commands/mcp/index.js";
16
- import { SecretsCommands } from "./cli/commands/secrets/index.js";
17
- import { CronCommands } from "./cli/commands/cron/services/cron-commands.service.js";
18
- import "./cli/commands/cron/index.js";
19
- import { AgentCommands } from "./cli/commands/agent/services/agent-commands.service.js";
20
- import { runCliAgentCommand } from "./cli/commands/agent/cli-agent-runner.utils.js";
21
- import "./cli/commands/agent/index.js";
22
- import { hasRunningNextclawManagedService } from "./commands/remote/utils/remote-runtime-support.utils.js";
23
- import { RemoteCommands } from "./commands/remote/index.js";
24
- import { PlatformAuthCommands } from "./commands/platform-auth/services/platform-auth-commands.service.js";
25
- import "./commands/platform-auth/index.js";
26
- import { DiagnosticsCommands } from "./cli/commands/diagnostics/services/diagnostics-commands.service.js";
27
- import "./cli/commands/diagnostics/index.js";
28
- import { LogsCommands } from "./cli/commands/logs/index.js";
29
- import { RuntimeCommandService } from "./shared/services/runtime/runtime-command.service.js";
30
- import { ServiceCommands } from "./commands/service/index.js";
31
- import { WorkspaceManager } from "./shared/services/workspace/workspace-manager.service.js";
32
- import { RuntimeRestartRequestService } from "./shared/services/restart/runtime-restart-request.service.js";
33
- import { SkillsCommands } from "./cli/commands/skills/index.js";
34
- import { GatewayCommands } from "./cli/commands/gateway/index.js";
35
- import { UiCommands } from "./cli/commands/ui/index.js";
36
- import { StartCommands } from "./cli/commands/start/index.js";
37
- import { RestartCommands } from "./cli/commands/restart/index.js";
38
- import { ServeCommands } from "./cli/commands/serve/index.js";
39
- import { StopCommands } from "./cli/commands/stop/index.js";
40
- import { LlmUsageCommandService } from "./cli/commands/usage/services/llm-usage-command.service.js";
41
- import "./cli/commands/usage/index.js";
42
- import { APP_NAME, getConfigPath, getDataDir, loadConfig, resolveWorkspacePath } from "@nextclaw/core";
43
- import { NextclawKernel } from "@nextclaw/kernel";
44
- import { RemoteRuntimeActions } from "@nextclaw/remote";
45
- import { existsSync, mkdirSync } from "node:fs";
46
- import { spawn } from "node:child_process";
47
- //#region src/service-runtime.service.ts
48
- const FORCED_PUBLIC_UI_HOST = "0.0.0.0";
49
- var NextclawServiceRuntime = class {
50
- logo;
51
- restartCoordinator;
52
- serviceRestartTask = null;
53
- selfRelaunchArmed = false;
54
- restartRequestService;
55
- workspaceManager;
56
- runtimeCommandService;
57
- platformAuthCommands;
58
- remoteCommands;
59
- account;
60
- commands;
61
- constructor(options) {
62
- logStartupTrace("cli.runtime.constructor.begin");
63
- this.logo = options.logo ?? "🤖";
64
- this.workspaceManager = measureStartupSync("cli.runtime.workspace_manager", () => new WorkspaceManager());
65
- this.runtimeCommandService = measureStartupSync("cli.runtime.runtime_command_service", () => new RuntimeCommandService({
66
- requestRestart: (params) => this.requestRestart(params),
67
- initializeAgentHomeDirectory: (homeDirectory) => this.workspaceManager.createWorkspaceTemplates(homeDirectory)
68
- }));
69
- this.commands = this.createCommands();
70
- this.restartCoordinator = measureStartupSync("cli.runtime.restart_coordinator", () => new RestartCoordinator({
71
- readServiceState: managedServiceStateStore.read,
72
- isProcessRunning,
73
- currentPid: () => process.pid,
74
- restartBackgroundService: async (reason) => this.restartBackgroundService(reason),
75
- scheduleProcessExit: (delayMs, reason) => this.scheduleProcessExit(delayMs, reason)
76
- }));
77
- this.restartRequestService = new RuntimeRestartRequestService({
78
- armManagedServiceRelaunch: (params) => this.armManagedServiceRelaunch(params),
79
- requestRestartFromCoordinator: async (params) => await this.restartCoordinator.requestRestart(params)
80
- });
81
- this.account = {
82
- status: async (opts = {}) => {
83
- await this.init({
84
- source: "account status",
85
- auto: true
86
- });
87
- await this.platformAuthCommands.accountStatus(opts);
88
- },
89
- setUsername: async (username, opts = {}) => {
90
- await this.init({
91
- source: "account set-username",
92
- auto: true
93
- });
94
- await this.platformAuthCommands.accountSetUsername({
95
- apiBase: opts.apiBase,
96
- json: opts.json,
97
- username
98
- });
99
- }
100
- };
101
- logStartupTrace("cli.runtime.constructor.end");
102
- }
103
- createCommands = () => {
104
- const start = measureStartupSync("cli.runtime.start_commands", () => new StartCommands({
105
- runtimeCommandService: this.runtimeCommandService,
106
- forcedPublicHost: FORCED_PUBLIC_UI_HOST,
107
- init: (params) => this.init(params)
108
- }));
109
- this.platformAuthCommands = measureStartupSync("cli.runtime.platform_auth_commands", () => new PlatformAuthCommands());
110
- this.remoteCommands = measureStartupSync("cli.runtime.remote_commands", () => new RemoteCommands());
111
- return {
112
- remote: measureStartupSync("cli.runtime.remote_runtime_actions", () => new RemoteRuntimeActions({
113
- appName: APP_NAME,
114
- initAuto: (source) => this.init({
115
- source,
116
- auto: true
117
- }),
118
- remoteCommands: this.remoteCommands,
119
- restartBackgroundService: (reason) => this.restartBackgroundService(reason),
120
- hasRunningManagedService: hasRunningNextclawManagedService
121
- })),
122
- skills: measureStartupSync("cli.runtime.skills_commands", () => new SkillsCommands()),
123
- service: measureStartupSync("cli.runtime.service_commands", () => new ServiceCommands()),
124
- config: measureStartupSync("cli.runtime.config_commands", () => new ConfigCommands({ requestRestart: (params) => this.requestRestart(params) })),
125
- mcp: measureStartupSync("cli.runtime.mcp_commands", () => new McpCommands()),
126
- secrets: measureStartupSync("cli.runtime.secrets_commands", () => new SecretsCommands({ requestRestart: (params) => this.requestRestart(params) })),
127
- agents: measureStartupSync("cli.runtime.agent_commands", () => new AgentCommands({ initializeAgentHomeDirectory: (homeDirectory) => this.workspaceManager.createWorkspaceTemplates(homeDirectory) })),
128
- channels: measureStartupSync("cli.runtime.channel_commands", () => new ChannelCommands({ requestRestart: (params) => this.requestRestart(params) })),
129
- cron: measureStartupSync("cli.runtime.cron_commands", () => new CronCommands()),
130
- diagnostics: measureStartupSync("cli.runtime.diagnostics_commands", () => new DiagnosticsCommands({ logo: this.logo })),
131
- logs: measureStartupSync("cli.runtime.logs_commands", () => new LogsCommands()),
132
- gateway: measureStartupSync("cli.runtime.gateway_commands", () => new GatewayCommands({
133
- runtimeCommandService: this.runtimeCommandService,
134
- forcedPublicHost: FORCED_PUBLIC_UI_HOST
135
- })),
136
- ui: measureStartupSync("cli.runtime.ui_commands", () => new UiCommands({
137
- runtimeCommandService: this.runtimeCommandService,
138
- forcedPublicHost: FORCED_PUBLIC_UI_HOST
139
- })),
140
- start,
141
- restart: measureStartupSync("cli.runtime.restart_commands", () => new RestartCommands({
142
- runtimeCommandService: this.runtimeCommandService,
143
- startCommands: start,
144
- forcedPublicHost: FORCED_PUBLIC_UI_HOST,
145
- writeRestartSentinelFromExecContext: (reason) => this.writeRestartSentinelFromExecContext(reason)
146
- })),
147
- serve: measureStartupSync("cli.runtime.serve_commands", () => new ServeCommands({
148
- runtimeCommandService: this.runtimeCommandService,
149
- forcedPublicHost: FORCED_PUBLIC_UI_HOST
150
- })),
151
- stop: measureStartupSync("cli.runtime.stop_commands", () => new StopCommands({ runtimeCommandService: this.runtimeCommandService })),
152
- usage: measureStartupSync("cli.runtime.usage_commands", () => new LlmUsageCommandService())
153
- };
154
- };
155
- get version() {
156
- return NextclawDistributionService.get().version;
157
- }
158
- scheduleProcessExit = (delayMs, reason) => {
159
- console.warn(`Gateway restart requested (${reason}).`);
160
- setTimeout(() => {
161
- process.exit(0);
162
- }, delayMs);
163
- };
164
- restartBackgroundService = async (reason) => {
165
- if (this.serviceRestartTask) return this.serviceRestartTask;
166
- this.serviceRestartTask = (async () => {
167
- const state = managedServiceStateStore.read();
168
- if (!state || !isProcessRunning(state.pid) || state.pid === process.pid) return false;
169
- const uiHost = FORCED_PUBLIC_UI_HOST;
170
- const uiPort = typeof state.uiPort === "number" && Number.isFinite(state.uiPort) ? state.uiPort : 55667;
171
- console.log(`Applying changes (${reason}): restarting ${APP_NAME} background service...`);
172
- await this.runtimeCommandService.stopService();
173
- await this.runtimeCommandService.startService({
174
- uiOverrides: {
175
- enabled: true,
176
- host: uiHost,
177
- port: uiPort
178
- },
179
- open: false
180
- });
181
- return true;
182
- })();
183
- try {
184
- return await this.serviceRestartTask;
185
- } finally {
186
- this.serviceRestartTask = null;
187
- }
188
- };
189
- armManagedServiceRelaunch = (params) => {
190
- const { delayMs: requestedDelayMs, reason, strategy: requestedStrategy } = params;
191
- const strategy = requestedStrategy ?? "background-service-or-manual";
192
- if (strategy !== "background-service-or-exit" && strategy !== "exit-process") return;
193
- if (this.selfRelaunchArmed) return;
194
- const state = managedServiceStateStore.read();
195
- if (!state || state.pid !== process.pid) return;
196
- const uiPort = typeof state.uiPort === "number" && Number.isFinite(state.uiPort) ? state.uiPort : 55667;
197
- const delayMs = typeof requestedDelayMs === "number" && Number.isFinite(requestedDelayMs) ? Math.max(0, Math.floor(requestedDelayMs)) : 100;
198
- const launch = resolveCliSubcommandLaunch({
199
- argvEntry: process.argv[1],
200
- importMetaUrl: import.meta.url,
201
- cliArgs: [
202
- "start",
203
- "--ui-port",
204
- String(uiPort)
205
- ],
206
- nodePath: process.execPath
207
- });
208
- const serviceStatePath = managedServiceStateStore.path;
209
- const helperScript = [
210
- "const { spawnSync } = require(\"node:child_process\");",
211
- "const { readFileSync } = require(\"node:fs\");",
212
- `const parentPid = ${process.pid};`,
213
- `const delayMs = ${delayMs};`,
214
- "const maxWaitMs = 120000;",
215
- "const retryIntervalMs = 1000;",
216
- `const command = ${JSON.stringify(launch.command)};`,
217
- `const args = ${JSON.stringify(launch.args)};`,
218
- `const serviceStatePath = ${JSON.stringify(serviceStatePath)};`,
219
- "function isRunning(pid) {",
220
- " try {",
221
- " process.kill(pid, 0);",
222
- " return true;",
223
- " } catch {",
224
- " return false;",
225
- " }",
226
- "}",
227
- "function hasReplacementService() {",
228
- " try {",
229
- " const raw = readFileSync(serviceStatePath, \"utf-8\");",
230
- " const state = JSON.parse(raw);",
231
- " const pid = Number(state?.pid);",
232
- " return Number.isFinite(pid) && pid > 0 && pid !== parentPid && isRunning(pid);",
233
- " } catch {",
234
- " return false;",
235
- " }",
236
- "}",
237
- "function tryStart() {",
238
- " spawnSync(command, args, {",
239
- " stdio: \"ignore\",",
240
- " env: process.env,",
241
- " timeout: 60000,",
242
- " windowsHide: true",
243
- " });",
244
- "}",
245
- "setTimeout(() => {",
246
- " const startedAt = Date.now();",
247
- " const tick = () => {",
248
- " if (hasReplacementService() || Date.now() - startedAt >= maxWaitMs) {",
249
- " process.exit(0);",
250
- " return;",
251
- " }",
252
- " tryStart();",
253
- " if (hasReplacementService()) {",
254
- " process.exit(0);",
255
- " return;",
256
- " }",
257
- " setTimeout(tick, retryIntervalMs);",
258
- " };",
259
- " tick();",
260
- "}, delayMs);"
261
- ].join("\n");
262
- try {
263
- spawn(process.execPath, ["-e", helperScript], {
264
- detached: true,
265
- stdio: "ignore",
266
- env: createTopLevelNextclawCommandEnv(process.env),
267
- windowsHide: true
268
- }).unref();
269
- this.selfRelaunchArmed = true;
270
- console.warn(`Gateway self-restart armed (${reason}).`);
271
- } catch (error) {
272
- console.error(`Failed to arm gateway self-restart: ${String(error)}`);
273
- }
274
- };
275
- requestRestart = async (params) => {
276
- await this.restartRequestService.run(params);
277
- };
278
- writeRestartSentinelFromExecContext = async (reason) => {
279
- const sessionKeyRaw = process.env.NEXTCLAW_RUNTIME_SESSION_KEY;
280
- const sessionKey = typeof sessionKeyRaw === "string" ? sessionKeyRaw.trim() : "";
281
- if (!sessionKey) return;
282
- try {
283
- await writeRestartSentinel({
284
- kind: "restart",
285
- status: "ok",
286
- ts: Date.now(),
287
- sessionKey,
288
- stats: {
289
- reason: reason || "cli.restart",
290
- strategy: "exec-tool"
291
- }
292
- });
293
- } catch (error) {
294
- console.warn(`Warning: failed to write restart sentinel from exec context: ${String(error)}`);
295
- }
296
- };
297
- onboard = async () => {
298
- console.warn(`Warning: ${APP_NAME} onboard is deprecated. Use "${APP_NAME} init" instead.`);
299
- await this.init({ source: "onboard" });
300
- };
301
- init = async (options = {}) => {
302
- const source = options.source ?? "init";
303
- const prefix = options.auto ? "Auto init" : "Init";
304
- const force = Boolean(options.force);
305
- const configPath = getConfigPath();
306
- const createdConfig = initializeConfigIfMissing(configPath);
307
- const workspacePath = resolveWorkspacePath(loadConfig().agents.defaults.workspace);
308
- const workspaceExisted = existsSync(workspacePath);
309
- mkdirSync(workspacePath, { recursive: true });
310
- const templateResult = this.workspaceManager.createWorkspaceTemplates(workspacePath, { force });
311
- if (createdConfig) console.log(`✓ ${prefix}: created config at ${configPath}`);
312
- if (!workspaceExisted) console.log(`✓ ${prefix}: created workspace at ${workspacePath}`);
313
- for (const file of templateResult.created) console.log(`✓ ${prefix}: created ${file}`);
314
- if (!createdConfig && workspaceExisted && templateResult.created.length === 0) console.log(`${prefix}: already initialized.`);
315
- if (!options.auto) {
316
- console.log(`\n${this.logo} ${APP_NAME} is ready! (${source})`);
317
- console.log("\nNext steps:");
318
- console.log(` 1. Add your API key to ${configPath}`);
319
- console.log(` 2. Chat: ${APP_NAME} agent -m "Hello!"`);
320
- } else console.log(`Tip: Run "${APP_NAME} init${force ? " --force" : ""}" to re-run initialization if needed.`);
321
- };
322
- login = async (opts = {}) => {
323
- await this.init({
324
- source: "login",
325
- auto: true
326
- });
327
- await this.platformAuthCommands.login(opts);
328
- };
329
- agent = async (opts) => {
330
- const configPath = getConfigPath();
331
- const kernel = new NextclawKernel({
332
- homeDir: getDataDir(),
333
- configPath
334
- });
335
- const config = kernel.configManager.config;
336
- await runCliAgentCommand({
337
- logo: this.logo,
338
- opts,
339
- config,
340
- kernel
341
- });
342
- };
343
- update = async (opts) => {
344
- const versionBefore = this.version;
345
- if (!opts.json) {
346
- const installationLabel = process.env.NEXTCLAW_DESKTOP_COMMAND_SURFACE === "1" ? "desktop runtime" : "npm launcher";
347
- console.log(`Current ${installationLabel} version: ${versionBefore}`);
348
- }
349
- const snapshot = await new NpmRuntimeUpdateCommandService().run(opts);
350
- if (snapshot.status === "blocked" || snapshot.status === "failed") process.exit(1);
351
- const state = managedServiceStateStore.read();
352
- if (snapshot.requiresRestart && state && isProcessRunning(state.pid)) console.log(`Tip: restart ${APP_NAME} to apply the update.`);
353
- };
354
- };
355
- const runNextclawNpmRuntimeLauncher = (argv = process.argv) => {
356
- const distribution = NextclawDistributionService.get();
357
- new NpmRuntimeLauncher({
358
- argv,
359
- launcherVersion: distribution.version,
360
- packagedAppEntrypoint: distribution.appEntrypoint
361
- }).run();
362
- };
363
- //#endregion
364
- export { NextclawServiceRuntime, runNextclawNpmRuntimeLauncher };
365
-
366
- //# sourceMappingURL=service-runtime.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-runtime.service.js","names":[],"sources":["../src/service-runtime.service.ts"],"sourcesContent":["import { loadConfig, getConfigPath, getDataDir, resolveWorkspacePath, APP_NAME } from \"@nextclaw/core\";\nimport { NextclawKernel } from \"@nextclaw/kernel\";\nimport { RemoteRuntimeActions } from \"@nextclaw/remote\";\nimport { existsSync, mkdirSync } from \"node:fs\";\nimport { spawn } from \"node:child_process\";\nimport { RestartCoordinator } from \"@nextclaw-service/shared/services/restart/restart-coordinator.service.js\";\nimport type { RestartStrategy } from \"@nextclaw-service/shared/services/restart/restart-coordinator.service.js\";\nimport { initializeConfigIfMissing } from \"@nextclaw-service/shared/services/runtime/runtime-config-init.service.js\";\nimport { writeRestartSentinel } from \"@nextclaw-service/shared/utils/restart/restart-sentinel.utils.js\";\nimport { createTopLevelNextclawCommandEnv } from \"@nextclaw-service/shared/utils/top-level-nextclaw-command-env.utils.js\";\nimport { resolveCliSubcommandLaunch } from \"@nextclaw-service/shared/utils/marketplace/cli-subcommand-launch.utils.js\";\nimport { logStartupTrace, measureStartupSync } from \"@nextclaw-service/shared/utils/startup-trace.js\";\nimport { isProcessRunning } from \"@nextclaw-service/shared/utils/cli.utils.js\";\nimport { NpmRuntimeUpdateCommandService } from \"@nextclaw-service/launcher/npm-runtime-update-command.service.js\";\nimport { NpmRuntimeLauncher } from \"@nextclaw-service/launcher/npm-runtime-launcher.service.js\";\nimport { managedServiceStateStore } from \"@nextclaw-service/shared/stores/managed-service-state.store.js\";\nimport { ConfigCommands } from \"@nextclaw-service/cli/commands/config/index.js\";\nimport { McpCommands } from \"@nextclaw-service/cli/commands/mcp/index.js\";\nimport { SecretsCommands } from \"@nextclaw-service/cli/commands/secrets/index.js\";\nimport { ChannelCommands } from \"@nextclaw-service/commands/channel/index.js\";\nimport { CronCommands } from \"@nextclaw-service/cli/commands/cron/index.js\";\nimport { AgentCommands, runCliAgentCommand } from \"@nextclaw-service/cli/commands/agent/index.js\";\nimport { PlatformAuthCommands } from \"@nextclaw-service/commands/platform-auth/index.js\";\nimport { RemoteCommands, hasRunningNextclawManagedService } from \"@nextclaw-service/commands/remote/index.js\";\nimport { DiagnosticsCommands } from \"@nextclaw-service/cli/commands/diagnostics/index.js\";\nimport { LogsCommands } from \"@nextclaw-service/cli/commands/logs/index.js\";\nimport { RuntimeCommandService } from \"@nextclaw-service/shared/services/runtime/runtime-command.service.js\";\nimport { NextclawDistributionService } from \"@nextclaw-service/shared/services/runtime/nextclaw-distribution.service.js\";\nimport { ServiceCommands } from \"@nextclaw-service/commands/service/index.js\";\nimport { WorkspaceManager } from \"@nextclaw-service/shared/services/workspace/workspace-manager.service.js\";\nimport { RuntimeRestartRequestService } from \"@nextclaw-service/shared/services/restart/runtime-restart-request.service.js\";\nimport { SkillsCommands } from \"@nextclaw-service/cli/commands/skills/index.js\";\nimport { GatewayCommands } from \"@nextclaw-service/cli/commands/gateway/index.js\";\nimport { UiCommands } from \"@nextclaw-service/cli/commands/ui/index.js\";\nimport { StartCommands } from \"@nextclaw-service/cli/commands/start/index.js\";\nimport { RestartCommands } from \"@nextclaw-service/cli/commands/restart/index.js\";\nimport { ServeCommands } from \"@nextclaw-service/cli/commands/serve/index.js\";\nimport { StopCommands } from \"@nextclaw-service/cli/commands/stop/index.js\";\nimport { LlmUsageCommandService } from \"@nextclaw-service/cli/commands/usage/index.js\";\nimport type { AgentCommandOptions, LoginCommandOptions, RequestRestartParams, UpdateCommandOptions } from \"@nextclaw-service/shared/types/cli.types.js\";\nconst FORCED_PUBLIC_UI_HOST = \"0.0.0.0\";\n\nexport type NextclawServiceRuntimeOptions = {\n logo?: string;\n};\n\nexport type NextclawServiceRuntimeAccount = {\n status: (opts?: { apiBase?: string; json?: boolean }) => Promise<void>;\n setUsername: (\n username: string,\n opts?: { apiBase?: string; json?: boolean },\n ) => Promise<void>;\n};\n\nexport type NextclawServiceCommands = {\n remote: RemoteRuntimeActions;\n skills: SkillsCommands;\n service: ServiceCommands;\n config: ConfigCommands;\n mcp: McpCommands;\n secrets: SecretsCommands;\n agents: AgentCommands;\n channels: ChannelCommands;\n cron: CronCommands;\n diagnostics: DiagnosticsCommands;\n logs: LogsCommands;\n gateway: GatewayCommands;\n ui: UiCommands;\n start: StartCommands;\n restart: RestartCommands;\n serve: ServeCommands;\n stop: StopCommands;\n usage: LlmUsageCommandService;\n};\n\nexport class NextclawServiceRuntime {\n private logo: string;\n private restartCoordinator: RestartCoordinator;\n private serviceRestartTask: Promise<boolean> | null = null;\n private selfRelaunchArmed = false;\n private restartRequestService: RuntimeRestartRequestService;\n private workspaceManager: WorkspaceManager;\n private runtimeCommandService: RuntimeCommandService;\n private platformAuthCommands!: PlatformAuthCommands;\n private remoteCommands!: RemoteCommands;\n account: NextclawServiceRuntimeAccount;\n commands: NextclawServiceCommands;\n constructor(options: NextclawServiceRuntimeOptions) {\n logStartupTrace(\"cli.runtime.constructor.begin\");\n this.logo = options.logo ?? \"🤖\";\n this.workspaceManager = measureStartupSync(\"cli.runtime.workspace_manager\", () => new WorkspaceManager());\n this.runtimeCommandService = measureStartupSync(\"cli.runtime.runtime_command_service\", () => new RuntimeCommandService({\n requestRestart: (params) => this.requestRestart(params),\n initializeAgentHomeDirectory: (homeDirectory) => this.workspaceManager.createWorkspaceTemplates(homeDirectory)\n }));\n this.commands = this.createCommands();\n\n this.restartCoordinator = measureStartupSync(\"cli.runtime.restart_coordinator\", () => new RestartCoordinator({\n readServiceState: managedServiceStateStore.read,\n isProcessRunning,\n currentPid: () => process.pid,\n restartBackgroundService: async (reason) =>\n this.restartBackgroundService(reason),\n scheduleProcessExit: (delayMs, reason) =>\n this.scheduleProcessExit(delayMs, reason),\n }));\n this.restartRequestService = new RuntimeRestartRequestService({\n armManagedServiceRelaunch: (params) => this.armManagedServiceRelaunch(params),\n requestRestartFromCoordinator: async (params) =>\n await this.restartCoordinator.requestRestart(params)\n });\n this.account = {\n status: async (opts = {}) => {\n await this.init({ source: \"account status\", auto: true });\n await this.platformAuthCommands.accountStatus(opts);\n },\n setUsername: async (username, opts = {}) => {\n await this.init({ source: \"account set-username\", auto: true });\n await this.platformAuthCommands.accountSetUsername({\n apiBase: opts.apiBase,\n json: opts.json,\n username\n });\n },\n };\n logStartupTrace(\"cli.runtime.constructor.end\");\n }\n\n private createCommands = (): NextclawServiceCommands => {\n const start = measureStartupSync(\"cli.runtime.start_commands\", () => new StartCommands({\n runtimeCommandService: this.runtimeCommandService,\n forcedPublicHost: FORCED_PUBLIC_UI_HOST,\n init: (params) => this.init(params)\n }));\n this.platformAuthCommands = measureStartupSync(\"cli.runtime.platform_auth_commands\", () => new PlatformAuthCommands());\n this.remoteCommands = measureStartupSync(\"cli.runtime.remote_commands\", () => new RemoteCommands());\n return {\n remote: measureStartupSync(\"cli.runtime.remote_runtime_actions\", () => new RemoteRuntimeActions({\n appName: APP_NAME,\n initAuto: (source) => this.init({ source, auto: true }),\n remoteCommands: this.remoteCommands,\n restartBackgroundService: (reason) => this.restartBackgroundService(reason),\n hasRunningManagedService: hasRunningNextclawManagedService\n })),\n skills: measureStartupSync(\"cli.runtime.skills_commands\", () => new SkillsCommands()),\n service: measureStartupSync(\"cli.runtime.service_commands\", () => new ServiceCommands()),\n config: measureStartupSync(\"cli.runtime.config_commands\", () => new ConfigCommands({\n requestRestart: (params) => this.requestRestart(params),\n })),\n mcp: measureStartupSync(\"cli.runtime.mcp_commands\", () => new McpCommands()),\n secrets: measureStartupSync(\"cli.runtime.secrets_commands\", () => new SecretsCommands({\n requestRestart: (params) => this.requestRestart(params),\n })),\n agents: measureStartupSync(\"cli.runtime.agent_commands\", () => new AgentCommands({\n initializeAgentHomeDirectory: (homeDirectory) => this.workspaceManager.createWorkspaceTemplates(homeDirectory)\n })),\n channels: measureStartupSync(\"cli.runtime.channel_commands\", () => new ChannelCommands({\n requestRestart: (params) => this.requestRestart(params),\n })),\n cron: measureStartupSync(\"cli.runtime.cron_commands\", () => new CronCommands()),\n diagnostics: measureStartupSync(\"cli.runtime.diagnostics_commands\", () => new DiagnosticsCommands({ logo: this.logo })),\n logs: measureStartupSync(\"cli.runtime.logs_commands\", () => new LogsCommands()),\n gateway: measureStartupSync(\"cli.runtime.gateway_commands\", () => new GatewayCommands({\n runtimeCommandService: this.runtimeCommandService,\n forcedPublicHost: FORCED_PUBLIC_UI_HOST\n })),\n ui: measureStartupSync(\"cli.runtime.ui_commands\", () => new UiCommands({\n runtimeCommandService: this.runtimeCommandService,\n forcedPublicHost: FORCED_PUBLIC_UI_HOST\n })),\n start,\n restart: measureStartupSync(\"cli.runtime.restart_commands\", () => new RestartCommands({\n runtimeCommandService: this.runtimeCommandService,\n startCommands: start,\n forcedPublicHost: FORCED_PUBLIC_UI_HOST,\n writeRestartSentinelFromExecContext: (reason) => this.writeRestartSentinelFromExecContext(reason)\n })),\n serve: measureStartupSync(\"cli.runtime.serve_commands\", () => new ServeCommands({\n runtimeCommandService: this.runtimeCommandService,\n forcedPublicHost: FORCED_PUBLIC_UI_HOST\n })),\n stop: measureStartupSync(\"cli.runtime.stop_commands\", () => new StopCommands({\n runtimeCommandService: this.runtimeCommandService\n })),\n usage: measureStartupSync(\"cli.runtime.usage_commands\", () => new LlmUsageCommandService()),\n };\n };\n\n get version(): string {\n return NextclawDistributionService.get().version;\n }\n\n private scheduleProcessExit = (delayMs: number, reason: string): void => {\n console.warn(`Gateway restart requested (${reason}).`);\n setTimeout(() => {\n process.exit(0);\n }, delayMs);\n };\n\n private restartBackgroundService = async (reason: string): Promise<boolean> => {\n if (this.serviceRestartTask) {\n return this.serviceRestartTask;\n }\n\n this.serviceRestartTask = (async () => {\n const state = managedServiceStateStore.read();\n if (!state || !isProcessRunning(state.pid) || state.pid === process.pid) {\n return false;\n }\n\n const uiHost = FORCED_PUBLIC_UI_HOST;\n const uiPort =\n typeof state.uiPort === \"number\" && Number.isFinite(state.uiPort)\n ? state.uiPort\n : 55667;\n\n console.log(\n `Applying changes (${reason}): restarting ${APP_NAME} background service...`,\n );\n await this.runtimeCommandService.stopService();\n await this.runtimeCommandService.startService({\n uiOverrides: {\n enabled: true,\n host: uiHost,\n port: uiPort,\n },\n open: false,\n });\n return true;\n })();\n\n try {\n return await this.serviceRestartTask;\n } finally {\n this.serviceRestartTask = null;\n }\n };\n\n private armManagedServiceRelaunch = (params: {\n reason: string;\n strategy?: RestartStrategy;\n delayMs?: number;\n }): void => {\n const { delayMs: requestedDelayMs, reason, strategy: requestedStrategy } = params;\n const strategy = requestedStrategy ?? \"background-service-or-manual\";\n if (\n strategy !== \"background-service-or-exit\" &&\n strategy !== \"exit-process\"\n ) {\n return;\n }\n if (this.selfRelaunchArmed) {\n return;\n }\n\n const state = managedServiceStateStore.read();\n if (!state || state.pid !== process.pid) {\n return;\n }\n\n const uiPort =\n typeof state.uiPort === \"number\" && Number.isFinite(state.uiPort)\n ? state.uiPort\n : 55667;\n const delayMs =\n typeof requestedDelayMs === \"number\" && Number.isFinite(requestedDelayMs)\n ? Math.max(0, Math.floor(requestedDelayMs))\n : 100;\n const launch = resolveCliSubcommandLaunch({\n argvEntry: process.argv[1],\n importMetaUrl: import.meta.url,\n cliArgs: [\"start\", \"--ui-port\", String(uiPort)],\n nodePath: process.execPath\n });\n const serviceStatePath = managedServiceStateStore.path;\n const helperScript = [\n 'const { spawnSync } = require(\"node:child_process\");',\n 'const { readFileSync } = require(\"node:fs\");',\n `const parentPid = ${process.pid};`,\n `const delayMs = ${delayMs};`,\n \"const maxWaitMs = 120000;\",\n \"const retryIntervalMs = 1000;\",\n `const command = ${JSON.stringify(launch.command)};`,\n `const args = ${JSON.stringify(launch.args)};`,\n `const serviceStatePath = ${JSON.stringify(serviceStatePath)};`,\n \"function isRunning(pid) {\",\n \" try {\",\n \" process.kill(pid, 0);\",\n \" return true;\",\n \" } catch {\",\n \" return false;\",\n \" }\",\n \"}\",\n \"function hasReplacementService() {\",\n \" try {\",\n ' const raw = readFileSync(serviceStatePath, \"utf-8\");',\n \" const state = JSON.parse(raw);\",\n \" const pid = Number(state?.pid);\",\n \" return Number.isFinite(pid) && pid > 0 && pid !== parentPid && isRunning(pid);\",\n \" } catch {\",\n \" return false;\",\n \" }\",\n \"}\",\n \"function tryStart() {\",\n \" spawnSync(command, args, {\",\n ' stdio: \"ignore\",',\n \" env: process.env,\",\n \" timeout: 60000,\",\n \" windowsHide: true\",\n \" });\",\n \"}\",\n \"setTimeout(() => {\",\n \" const startedAt = Date.now();\",\n \" const tick = () => {\",\n \" if (hasReplacementService() || Date.now() - startedAt >= maxWaitMs) {\",\n \" process.exit(0);\",\n \" return;\",\n \" }\",\n \" tryStart();\",\n \" if (hasReplacementService()) {\",\n \" process.exit(0);\",\n \" return;\",\n \" }\",\n \" setTimeout(tick, retryIntervalMs);\",\n \" };\",\n \" tick();\",\n \"}, delayMs);\",\n ].join(\"\\n\");\n\n try {\n const helper = spawn(process.execPath, [\"-e\", helperScript], {\n detached: true,\n stdio: \"ignore\",\n env: createTopLevelNextclawCommandEnv(process.env),\n windowsHide: true\n });\n helper.unref();\n this.selfRelaunchArmed = true;\n console.warn(`Gateway self-restart armed (${reason}).`);\n } catch (error) {\n console.error(`Failed to arm gateway self-restart: ${String(error)}`);\n }\n };\n\n private requestRestart = async (params: RequestRestartParams): Promise<void> => {\n await this.restartRequestService.run(params);\n };\n\n private writeRestartSentinelFromExecContext = async (reason: string): Promise<void> => {\n const sessionKeyRaw = process.env.NEXTCLAW_RUNTIME_SESSION_KEY;\n const sessionKey =\n typeof sessionKeyRaw === \"string\" ? sessionKeyRaw.trim() : \"\";\n if (!sessionKey) {\n return;\n }\n\n try {\n await writeRestartSentinel({\n kind: \"restart\",\n status: \"ok\",\n ts: Date.now(),\n sessionKey,\n stats: {\n reason: reason || \"cli.restart\",\n strategy: \"exec-tool\",\n },\n });\n } catch (error) {\n console.warn(\n `Warning: failed to write restart sentinel from exec context: ${String(error)}`,\n );\n }\n };\n\n onboard = async (): Promise<void> => {\n console.warn(\n `Warning: ${APP_NAME} onboard is deprecated. Use \"${APP_NAME} init\" instead.`,\n );\n await this.init({ source: \"onboard\" });\n };\n\n init = async (options: { source?: string; auto?: boolean; force?: boolean } = {}): Promise<void> => {\n const source = options.source ?? \"init\";\n const prefix = options.auto ? \"Auto init\" : \"Init\";\n const force = Boolean(options.force);\n\n const configPath = getConfigPath();\n const createdConfig = initializeConfigIfMissing(configPath);\n\n const config = loadConfig();\n const workspacePath = resolveWorkspacePath(config.agents.defaults.workspace);\n const workspaceExisted = existsSync(workspacePath);\n mkdirSync(workspacePath, { recursive: true });\n const templateResult = this.workspaceManager.createWorkspaceTemplates(\n workspacePath,\n { force },\n );\n\n if (createdConfig) {\n console.log(`✓ ${prefix}: created config at ${configPath}`);\n }\n if (!workspaceExisted) {\n console.log(`✓ ${prefix}: created workspace at ${workspacePath}`);\n }\n for (const file of templateResult.created) {\n console.log(`✓ ${prefix}: created ${file}`);\n }\n if (\n !createdConfig &&\n workspaceExisted &&\n templateResult.created.length === 0\n ) {\n console.log(`${prefix}: already initialized.`);\n }\n\n if (!options.auto) {\n console.log(`\\n${this.logo} ${APP_NAME} is ready! (${source})`);\n console.log(\"\\nNext steps:\");\n console.log(` 1. Add your API key to ${configPath}`);\n console.log(` 2. Chat: ${APP_NAME} agent -m \"Hello!\"`);\n } else {\n console.log(\n `Tip: Run \"${APP_NAME} init${force ? \" --force\" : \"\"}\" to re-run initialization if needed.`,\n );\n }\n };\n\n login = async (opts: LoginCommandOptions = {}): Promise<void> => {\n await this.init({ source: \"login\", auto: true });\n await this.platformAuthCommands.login(opts);\n };\n\n agent = async (opts: AgentCommandOptions): Promise<void> => {\n const configPath = getConfigPath();\n const kernel = new NextclawKernel({\n homeDir: getDataDir(),\n configPath,\n });\n const config = kernel.configManager.config;\n\n await runCliAgentCommand({\n logo: this.logo,\n opts,\n config,\n kernel,\n });\n };\n\n update = async (opts: UpdateCommandOptions): Promise<void> => {\n const versionBefore = this.version;\n if (!opts.json) {\n const installationLabel = process.env.NEXTCLAW_DESKTOP_COMMAND_SURFACE === \"1\" ? \"desktop runtime\" : \"npm launcher\";\n console.log(`Current ${installationLabel} version: ${versionBefore}`);\n }\n const snapshot = await new NpmRuntimeUpdateCommandService().run(opts);\n if (snapshot.status === \"blocked\" || snapshot.status === \"failed\") {\n process.exit(1);\n }\n\n const state = managedServiceStateStore.read();\n if (snapshot.requiresRestart && state && isProcessRunning(state.pid)) {\n console.log(`Tip: restart ${APP_NAME} to apply the update.`);\n }\n };\n}\n\nexport const runNextclawNpmRuntimeLauncher = (\n argv: string[] = process.argv,\n): void => {\n const distribution = NextclawDistributionService.get();\n new NpmRuntimeLauncher({\n argv,\n launcherVersion: distribution.version,\n packagedAppEntrypoint: distribution.appEntrypoint,\n }).run();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAM,wBAAwB;AAmC9B,IAAa,yBAAb,MAAoC;CAClC;CACA;CACA,qBAAsD;CACtD,oBAA4B;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,SAAwC;AAClD,kBAAgB,gCAAgC;AAChD,OAAK,OAAO,QAAQ,QAAQ;AAC5B,OAAK,mBAAmB,mBAAmB,uCAAuC,IAAI,kBAAkB,CAAC;AACzG,OAAK,wBAAwB,mBAAmB,6CAA6C,IAAI,sBAAsB;GACrH,iBAAiB,WAAW,KAAK,eAAe,OAAO;GACvD,+BAA+B,kBAAkB,KAAK,iBAAiB,yBAAyB,cAAc;GAC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aAAa,SAAS,OAAO,QAAQ,aAAa,GAAG,uCACtD;;CAIL,QAAQ,OAAO,OAA4B,EAAE,KAAoB;AAC/D,QAAM,KAAK,KAAK;GAAE,QAAQ;GAAS,MAAM;GAAM,CAAC;AAChD,QAAM,KAAK,qBAAqB,MAAM,KAAK;;CAG7C,QAAQ,OAAO,SAA6C;EAC1D,MAAM,aAAa,eAAe;EAClC,MAAM,SAAS,IAAI,eAAe;GAChC,SAAS,YAAY;GACrB;GACD,CAAC;EACF,MAAM,SAAS,OAAO,cAAc;AAEpC,QAAM,mBAAmB;GACvB,MAAM,KAAK;GACX;GACA;GACA;GACD,CAAC;;CAGJ,SAAS,OAAO,SAA8C;EAC5D,MAAM,gBAAgB,KAAK;AAC3B,MAAI,CAAC,KAAK,MAAM;GACd,MAAM,oBAAoB,QAAQ,IAAI,qCAAqC,MAAM,oBAAoB;AACrG,WAAQ,IAAI,WAAW,kBAAkB,YAAY,gBAAgB;;EAEvE,MAAM,WAAW,MAAM,IAAI,gCAAgC,CAAC,IAAI,KAAK;AACrE,MAAI,SAAS,WAAW,aAAa,SAAS,WAAW,SACvD,SAAQ,KAAK,EAAE;EAGjB,MAAM,QAAQ,yBAAyB,MAAM;AAC7C,MAAI,SAAS,mBAAmB,SAAS,iBAAiB,MAAM,IAAI,CAClE,SAAQ,IAAI,gBAAgB,SAAS,uBAAuB;;;AAKlE,MAAa,iCACX,OAAiB,QAAQ,SAChB;CACT,MAAM,eAAe,4BAA4B,KAAK;AACtD,KAAI,mBAAmB;EACrB;EACA,iBAAiB,aAAa;EAC9B,uBAAuB,aAAa;EACrC,CAAC,CAAC,KAAK"}
@@ -1,54 +0,0 @@
1
- import { CronService, GatewayController } from "@nextclaw/core";
2
- import { ChannelManager, ConfigManager, SessionManager } from "@nextclaw/kernel";
3
-
4
- //#region src/shared/controllers/gateway.controller.d.ts
5
- type ControllerDeps = {
6
- configManager: ConfigManager;
7
- channels: ChannelManager;
8
- cron: CronService;
9
- sessionManager?: SessionManager;
10
- requestRestart?: (options?: {
11
- delayMs?: number;
12
- reason?: string;
13
- }) => Promise<void> | void;
14
- };
15
- declare class GatewayControllerImpl implements GatewayController {
16
- private deps;
17
- constructor(deps: ControllerDeps);
18
- private normalizeOptionalString;
19
- private resolveDeliveryContext;
20
- private writeRestartSentinelPayload;
21
- private requestRestart;
22
- status: () => Record<string, unknown>;
23
- reloadConfig: (reason?: string) => Promise<string>;
24
- restart: (options?: {
25
- delayMs?: number;
26
- reason?: string;
27
- sessionKey?: string;
28
- }) => Promise<string>;
29
- getConfig: () => Promise<Record<string, unknown>>;
30
- getConfigSchema: () => Promise<Record<string, unknown>>;
31
- applyConfig: (params: {
32
- raw: string;
33
- baseHash?: string;
34
- note?: string;
35
- restartDelayMs?: number;
36
- sessionKey?: string;
37
- }) => Promise<Record<string, unknown>>;
38
- patchConfig: (params: {
39
- raw: string;
40
- baseHash?: string;
41
- note?: string;
42
- restartDelayMs?: number;
43
- sessionKey?: string;
44
- }) => Promise<Record<string, unknown>>;
45
- updateRun: (params: {
46
- note?: string;
47
- restartDelayMs?: number;
48
- timeoutMs?: number;
49
- sessionKey?: string;
50
- }) => Promise<Record<string, unknown>>;
51
- }
52
- //#endregion
53
- export { GatewayControllerImpl };
54
- //# sourceMappingURL=gateway.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gateway.controller.d.ts","names":[],"sources":["../../../src/shared/controllers/gateway.controller.ts"],"mappings":";;;;KAaK,cAAA;EACH,aAAA,EAAe,aAAA;EACf,QAAA,EAAU,cAAA;EACV,IAAA,EAAM,WAAA;EACN,cAAA,GAAiB,cAAA;EACjB,cAAA,IAAkB,OAAA;IAAY,OAAA;IAAkB,MAAA;EAAA,MAAsB,OAAA;AAAA;AAAA,cAG3D,qBAAA,YAAiC,iBAAA;EAAA,QACxB,IAAA;cAAA,IAAA,EAAM,cAAA;EAAA,QAElB,uBAAA;EAAA,QAQA,sBAAA;EAAA,QAgDA,2BAAA;EAAA,QA6BA,cAAA;EAcR,MAAA,QAAa,MAAA;EAQb,YAAA,GAAsB,MAAA,cAAkB,OAAA;EAIxC,OAAA,GAAiB,OAAA;IAAY,OAAA;IAAkB,MAAA;IAAiB,UAAA;EAAA,MAAwB,OAAA;EAWxF,SAAA,QAAsB,OAAA,CAAQ,MAAA;EAI9B,eAAA,QAA4B,OAAA,CAAQ,MAAA;EAIpC,WAAA,GAAqB,MAAA;IACnB,GAAA;IACA,QAAA;IACA,IAAA;IACA,cAAA;IACA,UAAA;EAAA,MACE,OAAA,CAAQ,MAAA;EASZ,WAAA,GAAqB,MAAA;IACnB,GAAA;IACA,QAAA;IACA,IAAA;IACA,cAAA;IACA,UAAA;EAAA,MACE,OAAA,CAAQ,MAAA;EASZ,SAAA,GAAmB,MAAA;IACjB,IAAA;IACA,cAAA;IACA,SAAA;IACA,UAAA;EAAA,MACE,OAAA,CAAQ,MAAA;AAAA"}