@pleri/olam-cli 0.1.201 → 0.1.205

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 (833) hide show
  1. package/README.md +102 -169
  2. package/dist/agent-stream/agent-sdk-to-chunks.js +1 -1
  3. package/dist/agent-stream/driver-runner.js +73 -7
  4. package/dist/agent-stream/host-driver-launch.js +14 -1
  5. package/dist/agent-stream/prototype-gen-launch.js +113 -0
  6. package/dist/agent-stream/question-broker-bridge.js +335 -0
  7. package/dist/agent-stream/sdk-env-merge.demo.js +35 -0
  8. package/dist/agent-stream/sdk-env-merge.js +98 -0
  9. package/dist/image-digests.json +8 -8
  10. package/dist/index.js +9533 -6258
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp-server.js +24721 -12934
  13. package/hermes-bundle/version.json +1 -1
  14. package/hooks/__tests__/_loader.py +26 -0
  15. package/hooks/__tests__/prompts.py +63 -0
  16. package/hooks/__tests__/test_classify_bench.py +94 -0
  17. package/hooks/__tests__/test_classify_pins.py +78 -0
  18. package/hooks/model-router.py +17 -4
  19. package/host-cp/k8s/manifests/50-deployment.yaml +1 -1
  20. package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +1 -1
  21. package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +1 -1
  22. package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +1 -1
  23. package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +1 -1
  24. package/host-cp/src/op-side-longpoll.mjs +212 -0
  25. package/host-cp/src/plan-chat-proxy-headers.mjs +53 -0
  26. package/host-cp/src/plan-chat-service.mjs +100 -0
  27. package/host-cp/src/plan-orchestrator.mjs +100 -6
  28. package/host-cp/src/server.mjs +607 -45
  29. package/memory-hooks/agentmemory-classify-queue.mjs +363 -0
  30. package/memory-hooks/agentmemory-recall-trigger.mjs +233 -0
  31. package/memory-hooks/agentmemory-reflect-cite.mjs +332 -0
  32. package/memory-hooks/agentmemory-session-recall.js +332 -0
  33. package/memory-hooks/recall-log.mjs +185 -0
  34. package/package.json +9 -4
  35. package/dist/ask/checkout.d.ts +0 -19
  36. package/dist/ask/checkout.d.ts.map +0 -1
  37. package/dist/ask/checkout.js +0 -40
  38. package/dist/ask/checkout.js.map +0 -1
  39. package/dist/ask/knowledge-pack-builder.d.ts +0 -72
  40. package/dist/ask/knowledge-pack-builder.d.ts.map +0 -1
  41. package/dist/ask/knowledge-pack-builder.js +0 -96
  42. package/dist/ask/knowledge-pack-builder.js.map +0 -1
  43. package/dist/ask/knowledge-pack.generated.d.ts +0 -8
  44. package/dist/ask/knowledge-pack.generated.d.ts.map +0 -1
  45. package/dist/ask/knowledge-pack.generated.js +0 -2362
  46. package/dist/ask/knowledge-pack.generated.js.map +0 -1
  47. package/dist/ask/one-shot.d.ts +0 -21
  48. package/dist/ask/one-shot.d.ts.map +0 -1
  49. package/dist/ask/one-shot.js +0 -50
  50. package/dist/ask/one-shot.js.map +0 -1
  51. package/dist/ask/repl.d.ts +0 -30
  52. package/dist/ask/repl.d.ts.map +0 -1
  53. package/dist/ask/repl.js +0 -109
  54. package/dist/ask/repl.js.map +0 -1
  55. package/dist/ask/sdk-client.d.ts +0 -87
  56. package/dist/ask/sdk-client.d.ts.map +0 -1
  57. package/dist/ask/sdk-client.js +0 -118
  58. package/dist/ask/sdk-client.js.map +0 -1
  59. package/dist/ask/system-prompt.d.ts +0 -30
  60. package/dist/ask/system-prompt.d.ts.map +0 -1
  61. package/dist/ask/system-prompt.js +0 -31
  62. package/dist/ask/system-prompt.js.map +0 -1
  63. package/dist/cli-version.d.ts +0 -16
  64. package/dist/cli-version.d.ts.map +0 -1
  65. package/dist/cli-version.js +0 -39
  66. package/dist/cli-version.js.map +0 -1
  67. package/dist/commands/ask.d.ts +0 -27
  68. package/dist/commands/ask.d.ts.map +0 -1
  69. package/dist/commands/ask.js +0 -63
  70. package/dist/commands/ask.js.map +0 -1
  71. package/dist/commands/auth-list-json.d.ts +0 -87
  72. package/dist/commands/auth-list-json.d.ts.map +0 -1
  73. package/dist/commands/auth-list-json.js +0 -71
  74. package/dist/commands/auth-list-json.js.map +0 -1
  75. package/dist/commands/auth-migrate.d.ts +0 -212
  76. package/dist/commands/auth-migrate.d.ts.map +0 -1
  77. package/dist/commands/auth-migrate.js +0 -465
  78. package/dist/commands/auth-migrate.js.map +0 -1
  79. package/dist/commands/auth-status.d.ts +0 -51
  80. package/dist/commands/auth-status.d.ts.map +0 -1
  81. package/dist/commands/auth-status.js +0 -250
  82. package/dist/commands/auth-status.js.map +0 -1
  83. package/dist/commands/auth-upgrade.d.ts +0 -88
  84. package/dist/commands/auth-upgrade.d.ts.map +0 -1
  85. package/dist/commands/auth-upgrade.js +0 -431
  86. package/dist/commands/auth-upgrade.js.map +0 -1
  87. package/dist/commands/auth.d.ts +0 -31
  88. package/dist/commands/auth.d.ts.map +0 -1
  89. package/dist/commands/auth.js +0 -784
  90. package/dist/commands/auth.js.map +0 -1
  91. package/dist/commands/begin.d.ts +0 -27
  92. package/dist/commands/begin.d.ts.map +0 -1
  93. package/dist/commands/begin.js +0 -45
  94. package/dist/commands/begin.js.map +0 -1
  95. package/dist/commands/bootstrap.d.ts +0 -111
  96. package/dist/commands/bootstrap.d.ts.map +0 -1
  97. package/dist/commands/bootstrap.js +0 -485
  98. package/dist/commands/bootstrap.js.map +0 -1
  99. package/dist/commands/clean.d.ts +0 -41
  100. package/dist/commands/clean.d.ts.map +0 -1
  101. package/dist/commands/clean.js +0 -382
  102. package/dist/commands/clean.js.map +0 -1
  103. package/dist/commands/completion.d.ts +0 -30
  104. package/dist/commands/completion.d.ts.map +0 -1
  105. package/dist/commands/completion.js +0 -50
  106. package/dist/commands/completion.js.map +0 -1
  107. package/dist/commands/config.d.ts +0 -3
  108. package/dist/commands/config.d.ts.map +0 -1
  109. package/dist/commands/config.js +0 -146
  110. package/dist/commands/config.js.map +0 -1
  111. package/dist/commands/create.d.ts +0 -8
  112. package/dist/commands/create.d.ts.map +0 -1
  113. package/dist/commands/create.js +0 -775
  114. package/dist/commands/create.js.map +0 -1
  115. package/dist/commands/crystallize.d.ts +0 -18
  116. package/dist/commands/crystallize.d.ts.map +0 -1
  117. package/dist/commands/crystallize.js +0 -123
  118. package/dist/commands/crystallize.js.map +0 -1
  119. package/dist/commands/destroy.d.ts +0 -59
  120. package/dist/commands/destroy.d.ts.map +0 -1
  121. package/dist/commands/destroy.js +0 -148
  122. package/dist/commands/destroy.js.map +0 -1
  123. package/dist/commands/diagnose.d.ts +0 -36
  124. package/dist/commands/diagnose.d.ts.map +0 -1
  125. package/dist/commands/diagnose.js +0 -177
  126. package/dist/commands/diagnose.js.map +0 -1
  127. package/dist/commands/dispatch-resolve.d.ts +0 -54
  128. package/dist/commands/dispatch-resolve.d.ts.map +0 -1
  129. package/dist/commands/dispatch-resolve.js +0 -105
  130. package/dist/commands/dispatch-resolve.js.map +0 -1
  131. package/dist/commands/dispatch.d.ts +0 -18
  132. package/dist/commands/dispatch.d.ts.map +0 -1
  133. package/dist/commands/dispatch.js +0 -159
  134. package/dist/commands/dispatch.js.map +0 -1
  135. package/dist/commands/doctor.d.ts +0 -258
  136. package/dist/commands/doctor.d.ts.map +0 -1
  137. package/dist/commands/doctor.js +0 -1073
  138. package/dist/commands/doctor.js.map +0 -1
  139. package/dist/commands/enter.d.ts +0 -63
  140. package/dist/commands/enter.d.ts.map +0 -1
  141. package/dist/commands/enter.js +0 -230
  142. package/dist/commands/enter.js.map +0 -1
  143. package/dist/commands/flywheel/check-persona-skeleton.d.ts +0 -35
  144. package/dist/commands/flywheel/check-persona-skeleton.d.ts.map +0 -1
  145. package/dist/commands/flywheel/check-persona-skeleton.js +0 -151
  146. package/dist/commands/flywheel/check-persona-skeleton.js.map +0 -1
  147. package/dist/commands/flywheel/diversity-check.d.ts +0 -17
  148. package/dist/commands/flywheel/diversity-check.d.ts.map +0 -1
  149. package/dist/commands/flywheel/diversity-check.js +0 -64
  150. package/dist/commands/flywheel/diversity-check.js.map +0 -1
  151. package/dist/commands/flywheel/emit-breadcrumb.d.ts +0 -20
  152. package/dist/commands/flywheel/emit-breadcrumb.d.ts.map +0 -1
  153. package/dist/commands/flywheel/emit-breadcrumb.js +0 -137
  154. package/dist/commands/flywheel/emit-breadcrumb.js.map +0 -1
  155. package/dist/commands/flywheel/index.d.ts +0 -27
  156. package/dist/commands/flywheel/index.d.ts.map +0 -1
  157. package/dist/commands/flywheel/index.js +0 -54
  158. package/dist/commands/flywheel/index.js.map +0 -1
  159. package/dist/commands/flywheel/install-sessionstart-hook.d.ts +0 -64
  160. package/dist/commands/flywheel/install-sessionstart-hook.d.ts.map +0 -1
  161. package/dist/commands/flywheel/install-sessionstart-hook.js +0 -197
  162. package/dist/commands/flywheel/install-sessionstart-hook.js.map +0 -1
  163. package/dist/commands/flywheel/install-shims.d.ts +0 -41
  164. package/dist/commands/flywheel/install-shims.d.ts.map +0 -1
  165. package/dist/commands/flywheel/install-shims.js +0 -126
  166. package/dist/commands/flywheel/install-shims.js.map +0 -1
  167. package/dist/commands/flywheel/k10-measure.d.ts +0 -17
  168. package/dist/commands/flywheel/k10-measure.d.ts.map +0 -1
  169. package/dist/commands/flywheel/k10-measure.js +0 -63
  170. package/dist/commands/flywheel/k10-measure.js.map +0 -1
  171. package/dist/commands/flywheel/k5-score.d.ts +0 -14
  172. package/dist/commands/flywheel/k5-score.d.ts.map +0 -1
  173. package/dist/commands/flywheel/k5-score.js +0 -59
  174. package/dist/commands/flywheel/k5-score.js.map +0 -1
  175. package/dist/commands/flywheel/k5-validate.d.ts +0 -46
  176. package/dist/commands/flywheel/k5-validate.d.ts.map +0 -1
  177. package/dist/commands/flywheel/k5-validate.js +0 -246
  178. package/dist/commands/flywheel/k5-validate.js.map +0 -1
  179. package/dist/commands/flywheel/migrate-overlays.d.ts +0 -116
  180. package/dist/commands/flywheel/migrate-overlays.d.ts.map +0 -1
  181. package/dist/commands/flywheel/migrate-overlays.js +0 -792
  182. package/dist/commands/flywheel/migrate-overlays.js.map +0 -1
  183. package/dist/commands/flywheel/ping.d.ts +0 -21
  184. package/dist/commands/flywheel/ping.d.ts.map +0 -1
  185. package/dist/commands/flywheel/ping.js +0 -79
  186. package/dist/commands/flywheel/ping.js.map +0 -1
  187. package/dist/commands/flywheel/sanitize-persona-output.d.ts +0 -38
  188. package/dist/commands/flywheel/sanitize-persona-output.d.ts.map +0 -1
  189. package/dist/commands/flywheel/sanitize-persona-output.js +0 -102
  190. package/dist/commands/flywheel/sanitize-persona-output.js.map +0 -1
  191. package/dist/commands/flywheel/session-start.d.ts +0 -26
  192. package/dist/commands/flywheel/session-start.d.ts.map +0 -1
  193. package/dist/commands/flywheel/session-start.js +0 -119
  194. package/dist/commands/flywheel/session-start.js.map +0 -1
  195. package/dist/commands/hermes-kg-hook.d.ts +0 -36
  196. package/dist/commands/hermes-kg-hook.d.ts.map +0 -1
  197. package/dist/commands/hermes-kg-hook.js +0 -80
  198. package/dist/commands/hermes-kg-hook.js.map +0 -1
  199. package/dist/commands/hermes.d.ts +0 -46
  200. package/dist/commands/hermes.d.ts.map +0 -1
  201. package/dist/commands/hermes.js +0 -320
  202. package/dist/commands/hermes.js.map +0 -1
  203. package/dist/commands/host-cp.d.ts +0 -216
  204. package/dist/commands/host-cp.d.ts.map +0 -1
  205. package/dist/commands/host-cp.js +0 -913
  206. package/dist/commands/host-cp.js.map +0 -1
  207. package/dist/commands/implode.d.ts +0 -86
  208. package/dist/commands/implode.d.ts.map +0 -1
  209. package/dist/commands/implode.js +0 -468
  210. package/dist/commands/implode.js.map +0 -1
  211. package/dist/commands/init.d.ts +0 -86
  212. package/dist/commands/init.d.ts.map +0 -1
  213. package/dist/commands/init.js +0 -357
  214. package/dist/commands/init.js.map +0 -1
  215. package/dist/commands/install.d.ts +0 -22
  216. package/dist/commands/install.d.ts.map +0 -1
  217. package/dist/commands/install.js +0 -203
  218. package/dist/commands/install.js.map +0 -1
  219. package/dist/commands/keys-list-json.d.ts +0 -55
  220. package/dist/commands/keys-list-json.d.ts.map +0 -1
  221. package/dist/commands/keys-list-json.js +0 -54
  222. package/dist/commands/keys-list-json.js.map +0 -1
  223. package/dist/commands/keys.d.ts +0 -26
  224. package/dist/commands/keys.d.ts.map +0 -1
  225. package/dist/commands/keys.js +0 -157
  226. package/dist/commands/keys.js.map +0 -1
  227. package/dist/commands/kg-build.d.ts +0 -80
  228. package/dist/commands/kg-build.d.ts.map +0 -1
  229. package/dist/commands/kg-build.js +0 -282
  230. package/dist/commands/kg-build.js.map +0 -1
  231. package/dist/commands/kg-classify.d.ts +0 -30
  232. package/dist/commands/kg-classify.d.ts.map +0 -1
  233. package/dist/commands/kg-classify.js +0 -88
  234. package/dist/commands/kg-classify.js.map +0 -1
  235. package/dist/commands/kg-doctor.d.ts +0 -76
  236. package/dist/commands/kg-doctor.d.ts.map +0 -1
  237. package/dist/commands/kg-doctor.js +0 -262
  238. package/dist/commands/kg-doctor.js.map +0 -1
  239. package/dist/commands/kg-install-hook.d.ts +0 -20
  240. package/dist/commands/kg-install-hook.d.ts.map +0 -1
  241. package/dist/commands/kg-install-hook.js +0 -208
  242. package/dist/commands/kg-install-hook.js.map +0 -1
  243. package/dist/commands/kg-mirror.d.ts +0 -72
  244. package/dist/commands/kg-mirror.d.ts.map +0 -1
  245. package/dist/commands/kg-mirror.js +0 -397
  246. package/dist/commands/kg-mirror.js.map +0 -1
  247. package/dist/commands/kg-savings.d.ts +0 -20
  248. package/dist/commands/kg-savings.d.ts.map +0 -1
  249. package/dist/commands/kg-savings.js +0 -77
  250. package/dist/commands/kg-savings.js.map +0 -1
  251. package/dist/commands/kg-service-container.d.ts +0 -68
  252. package/dist/commands/kg-service-container.d.ts.map +0 -1
  253. package/dist/commands/kg-service-container.js +0 -191
  254. package/dist/commands/kg-service-container.js.map +0 -1
  255. package/dist/commands/kg-status.d.ts +0 -59
  256. package/dist/commands/kg-status.d.ts.map +0 -1
  257. package/dist/commands/kg-status.js +0 -344
  258. package/dist/commands/kg-status.js.map +0 -1
  259. package/dist/commands/kg-uninstall-hook.d.ts +0 -12
  260. package/dist/commands/kg-uninstall-hook.d.ts.map +0 -1
  261. package/dist/commands/kg-uninstall-hook.js +0 -121
  262. package/dist/commands/kg-uninstall-hook.js.map +0 -1
  263. package/dist/commands/kg-watch.d.ts +0 -49
  264. package/dist/commands/kg-watch.d.ts.map +0 -1
  265. package/dist/commands/kg-watch.js +0 -172
  266. package/dist/commands/kg-watch.js.map +0 -1
  267. package/dist/commands/lanes-list-json.d.ts +0 -69
  268. package/dist/commands/lanes-list-json.d.ts.map +0 -1
  269. package/dist/commands/lanes-list-json.js +0 -42
  270. package/dist/commands/lanes-list-json.js.map +0 -1
  271. package/dist/commands/lanes.d.ts +0 -18
  272. package/dist/commands/lanes.d.ts.map +0 -1
  273. package/dist/commands/lanes.js +0 -133
  274. package/dist/commands/lanes.js.map +0 -1
  275. package/dist/commands/list.d.ts +0 -33
  276. package/dist/commands/list.d.ts.map +0 -1
  277. package/dist/commands/list.js +0 -87
  278. package/dist/commands/list.js.map +0 -1
  279. package/dist/commands/logs.d.ts +0 -52
  280. package/dist/commands/logs.d.ts.map +0 -1
  281. package/dist/commands/logs.js +0 -180
  282. package/dist/commands/logs.js.map +0 -1
  283. package/dist/commands/mcp/add.d.ts +0 -9
  284. package/dist/commands/mcp/add.d.ts.map +0 -1
  285. package/dist/commands/mcp/add.js +0 -87
  286. package/dist/commands/mcp/add.js.map +0 -1
  287. package/dist/commands/mcp/client.d.ts +0 -60
  288. package/dist/commands/mcp/client.d.ts.map +0 -1
  289. package/dist/commands/mcp/client.js +0 -70
  290. package/dist/commands/mcp/client.js.map +0 -1
  291. package/dist/commands/mcp/complete.d.ts +0 -36
  292. package/dist/commands/mcp/complete.d.ts.map +0 -1
  293. package/dist/commands/mcp/complete.js +0 -66
  294. package/dist/commands/mcp/complete.js.map +0 -1
  295. package/dist/commands/mcp/import-discovery.d.ts +0 -25
  296. package/dist/commands/mcp/import-discovery.d.ts.map +0 -1
  297. package/dist/commands/mcp/import-discovery.js +0 -135
  298. package/dist/commands/mcp/import-discovery.js.map +0 -1
  299. package/dist/commands/mcp/import-validate.d.ts +0 -15
  300. package/dist/commands/mcp/import-validate.d.ts.map +0 -1
  301. package/dist/commands/mcp/import-validate.js +0 -55
  302. package/dist/commands/mcp/import-validate.js.map +0 -1
  303. package/dist/commands/mcp/import.d.ts +0 -12
  304. package/dist/commands/mcp/import.d.ts.map +0 -1
  305. package/dist/commands/mcp/import.js +0 -126
  306. package/dist/commands/mcp/import.js.map +0 -1
  307. package/dist/commands/mcp/index.d.ts +0 -14
  308. package/dist/commands/mcp/index.d.ts.map +0 -1
  309. package/dist/commands/mcp/index.js +0 -39
  310. package/dist/commands/mcp/index.js.map +0 -1
  311. package/dist/commands/mcp/install-shared.d.ts +0 -24
  312. package/dist/commands/mcp/install-shared.d.ts.map +0 -1
  313. package/dist/commands/mcp/install-shared.js +0 -42
  314. package/dist/commands/mcp/install-shared.js.map +0 -1
  315. package/dist/commands/mcp/install.d.ts +0 -20
  316. package/dist/commands/mcp/install.d.ts.map +0 -1
  317. package/dist/commands/mcp/install.js +0 -59
  318. package/dist/commands/mcp/install.js.map +0 -1
  319. package/dist/commands/mcp/list.d.ts +0 -6
  320. package/dist/commands/mcp/list.d.ts.map +0 -1
  321. package/dist/commands/mcp/list.js +0 -56
  322. package/dist/commands/mcp/list.js.map +0 -1
  323. package/dist/commands/mcp/login.d.ts +0 -6
  324. package/dist/commands/mcp/login.d.ts.map +0 -1
  325. package/dist/commands/mcp/login.js +0 -38
  326. package/dist/commands/mcp/login.js.map +0 -1
  327. package/dist/commands/mcp/remove.d.ts +0 -6
  328. package/dist/commands/mcp/remove.d.ts.map +0 -1
  329. package/dist/commands/mcp/remove.js +0 -21
  330. package/dist/commands/mcp/remove.js.map +0 -1
  331. package/dist/commands/mcp/revoke.d.ts +0 -11
  332. package/dist/commands/mcp/revoke.d.ts.map +0 -1
  333. package/dist/commands/mcp/revoke.js +0 -51
  334. package/dist/commands/mcp/revoke.js.map +0 -1
  335. package/dist/commands/mcp/serve.d.ts +0 -23
  336. package/dist/commands/mcp/serve.d.ts.map +0 -1
  337. package/dist/commands/mcp/serve.js +0 -55
  338. package/dist/commands/mcp/serve.js.map +0 -1
  339. package/dist/commands/mcp/status.d.ts +0 -6
  340. package/dist/commands/mcp/status.d.ts.map +0 -1
  341. package/dist/commands/mcp/status.js +0 -57
  342. package/dist/commands/mcp/status.js.map +0 -1
  343. package/dist/commands/mcp/uninstall.d.ts +0 -20
  344. package/dist/commands/mcp/uninstall.d.ts.map +0 -1
  345. package/dist/commands/mcp/uninstall.js +0 -60
  346. package/dist/commands/mcp/uninstall.js.map +0 -1
  347. package/dist/commands/memory/_paths.d.ts +0 -25
  348. package/dist/commands/memory/_paths.d.ts.map +0 -1
  349. package/dist/commands/memory/_paths.js +0 -57
  350. package/dist/commands/memory/_paths.js.map +0 -1
  351. package/dist/commands/memory/bridge.d.ts +0 -57
  352. package/dist/commands/memory/bridge.d.ts.map +0 -1
  353. package/dist/commands/memory/bridge.js +0 -152
  354. package/dist/commands/memory/bridge.js.map +0 -1
  355. package/dist/commands/memory/index.d.ts +0 -20
  356. package/dist/commands/memory/index.d.ts.map +0 -1
  357. package/dist/commands/memory/index.js +0 -47
  358. package/dist/commands/memory/index.js.map +0 -1
  359. package/dist/commands/memory/install-hooks.d.ts +0 -22
  360. package/dist/commands/memory/install-hooks.d.ts.map +0 -1
  361. package/dist/commands/memory/install-hooks.js +0 -156
  362. package/dist/commands/memory/install-hooks.js.map +0 -1
  363. package/dist/commands/memory/install.d.ts +0 -57
  364. package/dist/commands/memory/install.d.ts.map +0 -1
  365. package/dist/commands/memory/install.js +0 -114
  366. package/dist/commands/memory/install.js.map +0 -1
  367. package/dist/commands/memory/logs.d.ts +0 -19
  368. package/dist/commands/memory/logs.d.ts.map +0 -1
  369. package/dist/commands/memory/logs.js +0 -50
  370. package/dist/commands/memory/logs.js.map +0 -1
  371. package/dist/commands/memory/mode.d.ts +0 -47
  372. package/dist/commands/memory/mode.d.ts.map +0 -1
  373. package/dist/commands/memory/mode.js +0 -185
  374. package/dist/commands/memory/mode.js.map +0 -1
  375. package/dist/commands/memory/reclassify.d.ts +0 -56
  376. package/dist/commands/memory/reclassify.d.ts.map +0 -1
  377. package/dist/commands/memory/reclassify.js +0 -177
  378. package/dist/commands/memory/reclassify.js.map +0 -1
  379. package/dist/commands/memory/secret.d.ts +0 -16
  380. package/dist/commands/memory/secret.d.ts.map +0 -1
  381. package/dist/commands/memory/secret.js +0 -80
  382. package/dist/commands/memory/secret.js.map +0 -1
  383. package/dist/commands/memory/start.d.ts +0 -25
  384. package/dist/commands/memory/start.d.ts.map +0 -1
  385. package/dist/commands/memory/start.js +0 -83
  386. package/dist/commands/memory/start.js.map +0 -1
  387. package/dist/commands/memory/stats.d.ts +0 -69
  388. package/dist/commands/memory/stats.d.ts.map +0 -1
  389. package/dist/commands/memory/stats.js +0 -164
  390. package/dist/commands/memory/stats.js.map +0 -1
  391. package/dist/commands/memory/status.d.ts +0 -45
  392. package/dist/commands/memory/status.d.ts.map +0 -1
  393. package/dist/commands/memory/status.js +0 -134
  394. package/dist/commands/memory/status.js.map +0 -1
  395. package/dist/commands/memory/stop.d.ts +0 -13
  396. package/dist/commands/memory/stop.d.ts.map +0 -1
  397. package/dist/commands/memory/stop.js +0 -52
  398. package/dist/commands/memory/stop.js.map +0 -1
  399. package/dist/commands/memory/uninstall.d.ts +0 -19
  400. package/dist/commands/memory/uninstall.d.ts.map +0 -1
  401. package/dist/commands/memory/uninstall.js +0 -60
  402. package/dist/commands/memory/uninstall.js.map +0 -1
  403. package/dist/commands/memory-service-container.d.ts +0 -130
  404. package/dist/commands/memory-service-container.d.ts.map +0 -1
  405. package/dist/commands/memory-service-container.js +0 -251
  406. package/dist/commands/memory-service-container.js.map +0 -1
  407. package/dist/commands/observe.d.ts +0 -9
  408. package/dist/commands/observe.d.ts.map +0 -1
  409. package/dist/commands/observe.js +0 -42
  410. package/dist/commands/observe.js.map +0 -1
  411. package/dist/commands/plans-list-json.d.ts +0 -77
  412. package/dist/commands/plans-list-json.d.ts.map +0 -1
  413. package/dist/commands/plans-list-json.js +0 -61
  414. package/dist/commands/plans-list-json.js.map +0 -1
  415. package/dist/commands/plans.d.ts +0 -3
  416. package/dist/commands/plans.d.ts.map +0 -1
  417. package/dist/commands/plans.js +0 -221
  418. package/dist/commands/plans.js.map +0 -1
  419. package/dist/commands/policy-check.d.ts +0 -14
  420. package/dist/commands/policy-check.d.ts.map +0 -1
  421. package/dist/commands/policy-check.js +0 -76
  422. package/dist/commands/policy-check.js.map +0 -1
  423. package/dist/commands/pr.d.ts +0 -17
  424. package/dist/commands/pr.d.ts.map +0 -1
  425. package/dist/commands/pr.js +0 -148
  426. package/dist/commands/pr.js.map +0 -1
  427. package/dist/commands/ps.d.ts +0 -57
  428. package/dist/commands/ps.d.ts.map +0 -1
  429. package/dist/commands/ps.js +0 -202
  430. package/dist/commands/ps.js.map +0 -1
  431. package/dist/commands/refresh-helpers.d.ts +0 -25
  432. package/dist/commands/refresh-helpers.d.ts.map +0 -1
  433. package/dist/commands/refresh-helpers.js +0 -56
  434. package/dist/commands/refresh-helpers.js.map +0 -1
  435. package/dist/commands/refresh.d.ts +0 -23
  436. package/dist/commands/refresh.d.ts.map +0 -1
  437. package/dist/commands/refresh.js +0 -237
  438. package/dist/commands/refresh.js.map +0 -1
  439. package/dist/commands/rekey.d.ts +0 -84
  440. package/dist/commands/rekey.d.ts.map +0 -1
  441. package/dist/commands/rekey.js +0 -209
  442. package/dist/commands/rekey.js.map +0 -1
  443. package/dist/commands/repos-list-json.d.ts +0 -58
  444. package/dist/commands/repos-list-json.d.ts.map +0 -1
  445. package/dist/commands/repos-list-json.js +0 -45
  446. package/dist/commands/repos-list-json.js.map +0 -1
  447. package/dist/commands/repos.d.ts +0 -11
  448. package/dist/commands/repos.d.ts.map +0 -1
  449. package/dist/commands/repos.js +0 -102
  450. package/dist/commands/repos.js.map +0 -1
  451. package/dist/commands/restart.d.ts +0 -18
  452. package/dist/commands/restart.d.ts.map +0 -1
  453. package/dist/commands/restart.js +0 -113
  454. package/dist/commands/restart.js.map +0 -1
  455. package/dist/commands/resume.d.ts +0 -63
  456. package/dist/commands/resume.d.ts.map +0 -1
  457. package/dist/commands/resume.js +0 -174
  458. package/dist/commands/resume.js.map +0 -1
  459. package/dist/commands/runbooks.d.ts +0 -45
  460. package/dist/commands/runbooks.d.ts.map +0 -1
  461. package/dist/commands/runbooks.js +0 -313
  462. package/dist/commands/runbooks.js.map +0 -1
  463. package/dist/commands/seed.d.ts +0 -27
  464. package/dist/commands/seed.d.ts.map +0 -1
  465. package/dist/commands/seed.js +0 -303
  466. package/dist/commands/seed.js.map +0 -1
  467. package/dist/commands/services-tls.d.ts +0 -120
  468. package/dist/commands/services-tls.d.ts.map +0 -1
  469. package/dist/commands/services-tls.js +0 -489
  470. package/dist/commands/services-tls.js.map +0 -1
  471. package/dist/commands/services.d.ts +0 -218
  472. package/dist/commands/services.d.ts.map +0 -1
  473. package/dist/commands/services.js +0 -830
  474. package/dist/commands/services.js.map +0 -1
  475. package/dist/commands/setup-linux-gate.d.ts +0 -26
  476. package/dist/commands/setup-linux-gate.d.ts.map +0 -1
  477. package/dist/commands/setup-linux-gate.js +0 -40
  478. package/dist/commands/setup-linux-gate.js.map +0 -1
  479. package/dist/commands/setup-metrics.d.ts +0 -26
  480. package/dist/commands/setup-metrics.d.ts.map +0 -1
  481. package/dist/commands/setup-metrics.js +0 -56
  482. package/dist/commands/setup-metrics.js.map +0 -1
  483. package/dist/commands/setup-phase-5a-skill-source.d.ts +0 -84
  484. package/dist/commands/setup-phase-5a-skill-source.d.ts.map +0 -1
  485. package/dist/commands/setup-phase-5a-skill-source.js +0 -259
  486. package/dist/commands/setup-phase-5a-skill-source.js.map +0 -1
  487. package/dist/commands/setup-phase-5b-project-sweep.d.ts +0 -38
  488. package/dist/commands/setup-phase-5b-project-sweep.d.ts.map +0 -1
  489. package/dist/commands/setup-phase-5b-project-sweep.js +0 -175
  490. package/dist/commands/setup-phase-5b-project-sweep.js.map +0 -1
  491. package/dist/commands/setup-phase-8-kg-hook.d.ts +0 -48
  492. package/dist/commands/setup-phase-8-kg-hook.d.ts.map +0 -1
  493. package/dist/commands/setup-phase-8-kg-hook.js +0 -93
  494. package/dist/commands/setup-phase-8-kg-hook.js.map +0 -1
  495. package/dist/commands/setup-phase-9-memory-bridge.d.ts +0 -36
  496. package/dist/commands/setup-phase-9-memory-bridge.d.ts.map +0 -1
  497. package/dist/commands/setup-phase-9-memory-bridge.js +0 -59
  498. package/dist/commands/setup-phase-9-memory-bridge.js.map +0 -1
  499. package/dist/commands/setup.d.ts +0 -231
  500. package/dist/commands/setup.d.ts.map +0 -1
  501. package/dist/commands/setup.js +0 -1374
  502. package/dist/commands/setup.js.map +0 -1
  503. package/dist/commands/skills-100x.d.ts +0 -34
  504. package/dist/commands/skills-100x.d.ts.map +0 -1
  505. package/dist/commands/skills-100x.js +0 -405
  506. package/dist/commands/skills-100x.js.map +0 -1
  507. package/dist/commands/skills-doctor.d.ts +0 -14
  508. package/dist/commands/skills-doctor.d.ts.map +0 -1
  509. package/dist/commands/skills-doctor.js +0 -126
  510. package/dist/commands/skills-doctor.js.map +0 -1
  511. package/dist/commands/skills-hook.d.ts +0 -19
  512. package/dist/commands/skills-hook.d.ts.map +0 -1
  513. package/dist/commands/skills-hook.js +0 -99
  514. package/dist/commands/skills-hook.js.map +0 -1
  515. package/dist/commands/skills-install-model-router.d.ts +0 -20
  516. package/dist/commands/skills-install-model-router.d.ts.map +0 -1
  517. package/dist/commands/skills-install-model-router.js +0 -55
  518. package/dist/commands/skills-install-model-router.js.map +0 -1
  519. package/dist/commands/skills-migrate-back.d.ts +0 -21
  520. package/dist/commands/skills-migrate-back.d.ts.map +0 -1
  521. package/dist/commands/skills-migrate-back.js +0 -222
  522. package/dist/commands/skills-migrate-back.js.map +0 -1
  523. package/dist/commands/skills-migrate-hooks-back.d.ts +0 -19
  524. package/dist/commands/skills-migrate-hooks-back.d.ts.map +0 -1
  525. package/dist/commands/skills-migrate-hooks-back.js +0 -83
  526. package/dist/commands/skills-migrate-hooks-back.js.map +0 -1
  527. package/dist/commands/skills-migrate-hooks.d.ts +0 -40
  528. package/dist/commands/skills-migrate-hooks.d.ts.map +0 -1
  529. package/dist/commands/skills-migrate-hooks.js +0 -178
  530. package/dist/commands/skills-migrate-hooks.js.map +0 -1
  531. package/dist/commands/skills-migrate.d.ts +0 -33
  532. package/dist/commands/skills-migrate.d.ts.map +0 -1
  533. package/dist/commands/skills-migrate.js +0 -216
  534. package/dist/commands/skills-migrate.js.map +0 -1
  535. package/dist/commands/skills-onboard.d.ts +0 -26
  536. package/dist/commands/skills-onboard.d.ts.map +0 -1
  537. package/dist/commands/skills-onboard.js +0 -230
  538. package/dist/commands/skills-onboard.js.map +0 -1
  539. package/dist/commands/skills-shadow-backups.d.ts +0 -15
  540. package/dist/commands/skills-shadow-backups.d.ts.map +0 -1
  541. package/dist/commands/skills-shadow-backups.js +0 -132
  542. package/dist/commands/skills-shadow-backups.js.map +0 -1
  543. package/dist/commands/skills-source.d.ts +0 -61
  544. package/dist/commands/skills-source.d.ts.map +0 -1
  545. package/dist/commands/skills-source.js +0 -895
  546. package/dist/commands/skills-source.js.map +0 -1
  547. package/dist/commands/skills.d.ts +0 -59
  548. package/dist/commands/skills.d.ts.map +0 -1
  549. package/dist/commands/skills.js +0 -461
  550. package/dist/commands/skills.js.map +0 -1
  551. package/dist/commands/status.d.ts +0 -65
  552. package/dist/commands/status.d.ts.map +0 -1
  553. package/dist/commands/status.js +0 -249
  554. package/dist/commands/status.js.map +0 -1
  555. package/dist/commands/stop.d.ts +0 -10
  556. package/dist/commands/stop.d.ts.map +0 -1
  557. package/dist/commands/stop.js +0 -17
  558. package/dist/commands/stop.js.map +0 -1
  559. package/dist/commands/substrate-audit-log.d.ts +0 -51
  560. package/dist/commands/substrate-audit-log.d.ts.map +0 -1
  561. package/dist/commands/substrate-audit-log.js +0 -161
  562. package/dist/commands/substrate-audit-log.js.map +0 -1
  563. package/dist/commands/substrate.d.ts +0 -87
  564. package/dist/commands/substrate.d.ts.map +0 -1
  565. package/dist/commands/substrate.js +0 -194
  566. package/dist/commands/substrate.js.map +0 -1
  567. package/dist/commands/update.d.ts +0 -89
  568. package/dist/commands/update.d.ts.map +0 -1
  569. package/dist/commands/update.js +0 -331
  570. package/dist/commands/update.js.map +0 -1
  571. package/dist/commands/upgrade-history.d.ts +0 -15
  572. package/dist/commands/upgrade-history.d.ts.map +0 -1
  573. package/dist/commands/upgrade-history.js +0 -34
  574. package/dist/commands/upgrade-history.js.map +0 -1
  575. package/dist/commands/upgrade-lock.d.ts +0 -93
  576. package/dist/commands/upgrade-lock.d.ts.map +0 -1
  577. package/dist/commands/upgrade-lock.js +0 -225
  578. package/dist/commands/upgrade-lock.js.map +0 -1
  579. package/dist/commands/upgrade-log.d.ts +0 -86
  580. package/dist/commands/upgrade-log.d.ts.map +0 -1
  581. package/dist/commands/upgrade-log.js +0 -146
  582. package/dist/commands/upgrade-log.js.map +0 -1
  583. package/dist/commands/upgrade.d.ts +0 -445
  584. package/dist/commands/upgrade.d.ts.map +0 -1
  585. package/dist/commands/upgrade.js +0 -1718
  586. package/dist/commands/upgrade.js.map +0 -1
  587. package/dist/commands/workspace-list-json.d.ts +0 -73
  588. package/dist/commands/workspace-list-json.d.ts.map +0 -1
  589. package/dist/commands/workspace-list-json.js +0 -59
  590. package/dist/commands/workspace-list-json.js.map +0 -1
  591. package/dist/commands/workspace.d.ts +0 -23
  592. package/dist/commands/workspace.d.ts.map +0 -1
  593. package/dist/commands/workspace.js +0 -203
  594. package/dist/commands/workspace.js.map +0 -1
  595. package/dist/commands/world-snapshot.d.ts +0 -32
  596. package/dist/commands/world-snapshot.d.ts.map +0 -1
  597. package/dist/commands/world-snapshot.js +0 -531
  598. package/dist/commands/world-snapshot.js.map +0 -1
  599. package/dist/commands/world-upgrade.d.ts +0 -33
  600. package/dist/commands/world-upgrade.d.ts.map +0 -1
  601. package/dist/commands/world-upgrade.js +0 -82
  602. package/dist/commands/world-upgrade.js.map +0 -1
  603. package/dist/commands/world.d.ts +0 -12
  604. package/dist/commands/world.d.ts.map +0 -1
  605. package/dist/commands/world.js +0 -18
  606. package/dist/commands/world.js.map +0 -1
  607. package/dist/commands/worldspec/compile.d.ts +0 -20
  608. package/dist/commands/worldspec/compile.d.ts.map +0 -1
  609. package/dist/commands/worldspec/compile.js +0 -130
  610. package/dist/commands/worldspec/compile.js.map +0 -1
  611. package/dist/commands/worldspec/index.d.ts +0 -12
  612. package/dist/commands/worldspec/index.d.ts.map +0 -1
  613. package/dist/commands/worldspec/index.js +0 -23
  614. package/dist/commands/worldspec/index.js.map +0 -1
  615. package/dist/commands/worldspec/init.d.ts +0 -15
  616. package/dist/commands/worldspec/init.d.ts.map +0 -1
  617. package/dist/commands/worldspec/init.js +0 -166
  618. package/dist/commands/worldspec/init.js.map +0 -1
  619. package/dist/commands/worldspec/schema.d.ts +0 -11
  620. package/dist/commands/worldspec/schema.d.ts.map +0 -1
  621. package/dist/commands/worldspec/schema.js +0 -55
  622. package/dist/commands/worldspec/schema.js.map +0 -1
  623. package/dist/commands/worldspec/validate.d.ts +0 -15
  624. package/dist/commands/worldspec/validate.d.ts.map +0 -1
  625. package/dist/commands/worldspec/validate.js +0 -66
  626. package/dist/commands/worldspec/validate.js.map +0 -1
  627. package/dist/commands/yolo.d.ts +0 -95
  628. package/dist/commands/yolo.d.ts.map +0 -1
  629. package/dist/commands/yolo.js +0 -377
  630. package/dist/commands/yolo.js.map +0 -1
  631. package/dist/context.d.ts +0 -30
  632. package/dist/context.d.ts.map +0 -1
  633. package/dist/context.js +0 -56
  634. package/dist/context.js.map +0 -1
  635. package/dist/docker-host.d.ts +0 -18
  636. package/dist/docker-host.d.ts.map +0 -1
  637. package/dist/docker-host.js +0 -17
  638. package/dist/docker-host.js.map +0 -1
  639. package/dist/exit-codes.d.ts +0 -67
  640. package/dist/exit-codes.d.ts.map +0 -1
  641. package/dist/exit-codes.js +0 -67
  642. package/dist/exit-codes.js.map +0 -1
  643. package/dist/from-manifest.d.ts +0 -53
  644. package/dist/from-manifest.d.ts.map +0 -1
  645. package/dist/from-manifest.js +0 -95
  646. package/dist/from-manifest.js.map +0 -1
  647. package/dist/image-presence.d.ts +0 -40
  648. package/dist/image-presence.d.ts.map +0 -1
  649. package/dist/image-presence.js +0 -39
  650. package/dist/image-presence.js.map +0 -1
  651. package/dist/index.d.ts +0 -9
  652. package/dist/index.d.ts.map +0 -1
  653. package/dist/install-root.d.ts +0 -74
  654. package/dist/install-root.d.ts.map +0 -1
  655. package/dist/install-root.js +0 -98
  656. package/dist/install-root.js.map +0 -1
  657. package/dist/lib/anthropic-base-url-file.d.ts +0 -37
  658. package/dist/lib/anthropic-base-url-file.d.ts.map +0 -1
  659. package/dist/lib/anthropic-base-url-file.js +0 -46
  660. package/dist/lib/anthropic-base-url-file.js.map +0 -1
  661. package/dist/lib/auth-backend.d.ts +0 -168
  662. package/dist/lib/auth-backend.d.ts.map +0 -1
  663. package/dist/lib/auth-backend.js +0 -172
  664. package/dist/lib/auth-backend.js.map +0 -1
  665. package/dist/lib/auth-list-cache.d.ts +0 -67
  666. package/dist/lib/auth-list-cache.d.ts.map +0 -1
  667. package/dist/lib/auth-list-cache.js +0 -84
  668. package/dist/lib/auth-list-cache.js.map +0 -1
  669. package/dist/lib/auth-list.d.ts +0 -107
  670. package/dist/lib/auth-list.d.ts.map +0 -1
  671. package/dist/lib/auth-list.js +0 -123
  672. package/dist/lib/auth-list.js.map +0 -1
  673. package/dist/lib/auth-login.d.ts +0 -92
  674. package/dist/lib/auth-login.d.ts.map +0 -1
  675. package/dist/lib/auth-login.js +0 -124
  676. package/dist/lib/auth-login.js.map +0 -1
  677. package/dist/lib/auth-mutator-backend.d.ts +0 -54
  678. package/dist/lib/auth-mutator-backend.d.ts.map +0 -1
  679. package/dist/lib/auth-mutator-backend.js +0 -62
  680. package/dist/lib/auth-mutator-backend.js.map +0 -1
  681. package/dist/lib/auth-refresh-kubernetes.d.ts +0 -65
  682. package/dist/lib/auth-refresh-kubernetes.d.ts.map +0 -1
  683. package/dist/lib/auth-refresh-kubernetes.js +0 -125
  684. package/dist/lib/auth-refresh-kubernetes.js.map +0 -1
  685. package/dist/lib/auth-remote.d.ts +0 -172
  686. package/dist/lib/auth-remote.d.ts.map +0 -1
  687. package/dist/lib/auth-remote.js +0 -394
  688. package/dist/lib/auth-remote.js.map +0 -1
  689. package/dist/lib/bootstrap-kubernetes.d.ts +0 -164
  690. package/dist/lib/bootstrap-kubernetes.d.ts.map +0 -1
  691. package/dist/lib/bootstrap-kubernetes.js +0 -1002
  692. package/dist/lib/bootstrap-kubernetes.js.map +0 -1
  693. package/dist/lib/build-if-stale.d.ts +0 -33
  694. package/dist/lib/build-if-stale.d.ts.map +0 -1
  695. package/dist/lib/build-if-stale.js +0 -156
  696. package/dist/lib/build-if-stale.js.map +0 -1
  697. package/dist/lib/bundle-freshness.d.ts +0 -57
  698. package/dist/lib/bundle-freshness.d.ts.map +0 -1
  699. package/dist/lib/bundle-freshness.js +0 -223
  700. package/dist/lib/bundle-freshness.js.map +0 -1
  701. package/dist/lib/bundle-source.d.ts +0 -52
  702. package/dist/lib/bundle-source.d.ts.map +0 -1
  703. package/dist/lib/bundle-source.js +0 -83
  704. package/dist/lib/bundle-source.js.map +0 -1
  705. package/dist/lib/cf-access-token.d.ts +0 -32
  706. package/dist/lib/cf-access-token.d.ts.map +0 -1
  707. package/dist/lib/cf-access-token.js +0 -51
  708. package/dist/lib/cf-access-token.js.map +0 -1
  709. package/dist/lib/completion-generator.d.ts +0 -107
  710. package/dist/lib/completion-generator.d.ts.map +0 -1
  711. package/dist/lib/completion-generator.js +0 -226
  712. package/dist/lib/completion-generator.js.map +0 -1
  713. package/dist/lib/config.d.ts +0 -114
  714. package/dist/lib/config.d.ts.map +0 -1
  715. package/dist/lib/config.js +0 -246
  716. package/dist/lib/config.js.map +0 -1
  717. package/dist/lib/flywheel-probes.d.ts +0 -58
  718. package/dist/lib/flywheel-probes.d.ts.map +0 -1
  719. package/dist/lib/flywheel-probes.js +0 -163
  720. package/dist/lib/flywheel-probes.js.map +0 -1
  721. package/dist/lib/health-probes.d.ts +0 -267
  722. package/dist/lib/health-probes.d.ts.map +0 -1
  723. package/dist/lib/health-probes.js +0 -933
  724. package/dist/lib/health-probes.js.map +0 -1
  725. package/dist/lib/help-groups.d.ts +0 -36
  726. package/dist/lib/help-groups.d.ts.map +0 -1
  727. package/dist/lib/help-groups.js +0 -124
  728. package/dist/lib/help-groups.js.map +0 -1
  729. package/dist/lib/host-side-proxy.d.ts +0 -67
  730. package/dist/lib/host-side-proxy.d.ts.map +0 -1
  731. package/dist/lib/host-side-proxy.js +0 -177
  732. package/dist/lib/host-side-proxy.js.map +0 -1
  733. package/dist/lib/instrumentation.d.ts +0 -85
  734. package/dist/lib/instrumentation.d.ts.map +0 -1
  735. package/dist/lib/instrumentation.js +0 -104
  736. package/dist/lib/instrumentation.js.map +0 -1
  737. package/dist/lib/k8s-bootstrap.d.ts +0 -126
  738. package/dist/lib/k8s-bootstrap.d.ts.map +0 -1
  739. package/dist/lib/k8s-bootstrap.js +0 -218
  740. package/dist/lib/k8s-bootstrap.js.map +0 -1
  741. package/dist/lib/k8s-context-discovery.d.ts +0 -80
  742. package/dist/lib/k8s-context-discovery.d.ts.map +0 -1
  743. package/dist/lib/k8s-context-discovery.js +0 -102
  744. package/dist/lib/k8s-context-discovery.js.map +0 -1
  745. package/dist/lib/k8s-secret-render.d.ts +0 -141
  746. package/dist/lib/k8s-secret-render.d.ts.map +0 -1
  747. package/dist/lib/k8s-secret-render.js +0 -318
  748. package/dist/lib/k8s-secret-render.js.map +0 -1
  749. package/dist/lib/kg-caps.d.ts +0 -19
  750. package/dist/lib/kg-caps.d.ts.map +0 -1
  751. package/dist/lib/kg-caps.js +0 -19
  752. package/dist/lib/kg-caps.js.map +0 -1
  753. package/dist/lib/kubectl-context.d.ts +0 -87
  754. package/dist/lib/kubectl-context.d.ts.map +0 -1
  755. package/dist/lib/kubectl-context.js +0 -105
  756. package/dist/lib/kubectl-context.js.map +0 -1
  757. package/dist/lib/kubectl-wrap.d.ts +0 -65
  758. package/dist/lib/kubectl-wrap.d.ts.map +0 -1
  759. package/dist/lib/kubectl-wrap.js +0 -135
  760. package/dist/lib/kubectl-wrap.js.map +0 -1
  761. package/dist/lib/manifest-refresh.d.ts +0 -136
  762. package/dist/lib/manifest-refresh.d.ts.map +0 -1
  763. package/dist/lib/manifest-refresh.js +0 -298
  764. package/dist/lib/manifest-refresh.js.map +0 -1
  765. package/dist/lib/memory-host-process-migration.d.ts +0 -56
  766. package/dist/lib/memory-host-process-migration.d.ts.map +0 -1
  767. package/dist/lib/memory-host-process-migration.js +0 -156
  768. package/dist/lib/memory-host-process-migration.js.map +0 -1
  769. package/dist/lib/memory-secret.d.ts +0 -83
  770. package/dist/lib/memory-secret.d.ts.map +0 -1
  771. package/dist/lib/memory-secret.js +0 -147
  772. package/dist/lib/memory-secret.js.map +0 -1
  773. package/dist/lib/peripheral-registry.d.ts +0 -53
  774. package/dist/lib/peripheral-registry.d.ts.map +0 -1
  775. package/dist/lib/peripheral-registry.js +0 -73
  776. package/dist/lib/peripheral-registry.js.map +0 -1
  777. package/dist/lib/plans-client.d.ts +0 -69
  778. package/dist/lib/plans-client.d.ts.map +0 -1
  779. package/dist/lib/plans-client.js +0 -140
  780. package/dist/lib/plans-client.js.map +0 -1
  781. package/dist/lib/port-forward.d.ts +0 -168
  782. package/dist/lib/port-forward.d.ts.map +0 -1
  783. package/dist/lib/port-forward.js +0 -393
  784. package/dist/lib/port-forward.js.map +0 -1
  785. package/dist/lib/shell-rc.d.ts +0 -90
  786. package/dist/lib/shell-rc.d.ts.map +0 -1
  787. package/dist/lib/shell-rc.js +0 -91
  788. package/dist/lib/shell-rc.js.map +0 -1
  789. package/dist/lib/shim-generator.d.ts +0 -51
  790. package/dist/lib/shim-generator.d.ts.map +0 -1
  791. package/dist/lib/shim-generator.js +0 -88
  792. package/dist/lib/shim-generator.js.map +0 -1
  793. package/dist/lib/skills-apply-overlays.d.ts +0 -35
  794. package/dist/lib/skills-apply-overlays.d.ts.map +0 -1
  795. package/dist/lib/skills-apply-overlays.js +0 -243
  796. package/dist/lib/skills-apply-overlays.js.map +0 -1
  797. package/dist/lib/symlink-reconcile.d.ts +0 -32
  798. package/dist/lib/symlink-reconcile.d.ts.map +0 -1
  799. package/dist/lib/symlink-reconcile.js +0 -80
  800. package/dist/lib/symlink-reconcile.js.map +0 -1
  801. package/dist/lib/upgrade-check.d.ts +0 -60
  802. package/dist/lib/upgrade-check.d.ts.map +0 -1
  803. package/dist/lib/upgrade-check.js +0 -169
  804. package/dist/lib/upgrade-check.js.map +0 -1
  805. package/dist/lib/upgrade-kubernetes.d.ts +0 -193
  806. package/dist/lib/upgrade-kubernetes.d.ts.map +0 -1
  807. package/dist/lib/upgrade-kubernetes.js +0 -1014
  808. package/dist/lib/upgrade-kubernetes.js.map +0 -1
  809. package/dist/lib/world-mcp-register.d.ts +0 -98
  810. package/dist/lib/world-mcp-register.d.ts.map +0 -1
  811. package/dist/lib/world-mcp-register.js +0 -117
  812. package/dist/lib/world-mcp-register.js.map +0 -1
  813. package/dist/output.d.ts +0 -10
  814. package/dist/output.d.ts.map +0 -1
  815. package/dist/output.js +0 -31
  816. package/dist/output.js.map +0 -1
  817. package/dist/pleri-config.d.ts +0 -22
  818. package/dist/pleri-config.d.ts.map +0 -1
  819. package/dist/pleri-config.js +0 -42
  820. package/dist/pleri-config.js.map +0 -1
  821. package/dist/protocol-version.d.ts +0 -79
  822. package/dist/protocol-version.d.ts.map +0 -1
  823. package/dist/protocol-version.js +0 -133
  824. package/dist/protocol-version.js.map +0 -1
  825. package/dist/registry-allowlist.d.ts +0 -47
  826. package/dist/registry-allowlist.d.ts.map +0 -1
  827. package/dist/registry-allowlist.js +0 -67
  828. package/dist/registry-allowlist.js.map +0 -1
  829. package/dist/spawn/home-override.d.ts +0 -82
  830. package/dist/spawn/home-override.d.ts.map +0 -1
  831. package/dist/spawn/home-override.js +0 -107
  832. package/dist/spawn/home-override.js.map +0 -1
  833. package/host-cp/src/linear-sync.mjs +0 -43
@@ -1,913 +0,0 @@
1
- /**
2
- * Phase F-2-D (D1+D2+D3): `olam host-cp <subcommand>` — operator-facing
3
- * lifecycle for the host CP container.
4
- *
5
- * Subcommands:
6
- * start — generate token, audit port 19000, docker compose up, write PID
7
- * stop — docker compose down, remove PID + token
8
- * status — diagnostic probe (with optional --json flag)
9
- *
10
- * Wraps the compose stack at `packages/host-cp/compose.yaml`. Token
11
- * lives at `~/.olam/host-cp.token` (chmod 600). PID file at
12
- * `~/.olam/host-cp.pid`. Both are operator-state files, not repo state.
13
- */
14
- import * as crypto from 'node:crypto';
15
- import * as fs from 'node:fs';
16
- import * as os from 'node:os';
17
- import * as path from 'node:path';
18
- import { spawnSync } from 'node:child_process';
19
- import Dockerode from 'dockerode';
20
- import { auditPortsForZombies, PortHeldByZombieError } from '@olam/adapters';
21
- import { printError, printSuccess, printInfo, printHeader, printWarning } from '../output.js';
22
- import { resolveDockerHostOptions } from '../docker-host.js';
23
- import { probeComposePlugin } from '../lib/health-probes.js';
24
- import { readCliVersion } from '../cli-version.js';
25
- import { resolveSecretPath } from '@olam/core/src/secrets/paths.js';
26
- // ── Constants ─────────────────────────────────────────────────────
27
- /** Default host CP port. Matches packages/host-cp/compose.yaml. */
28
- export const HOST_CP_PORT = 19000;
29
- /** Path to the compose stack. Checked in order:
30
- * 1. Bundled-package path — used when installed via `npm install -g @pleri/olam-cli`.
31
- * 2. Monorepo cwd — used in source-mode dev (`pnpm dev:olam`).
32
- * 3. Monorepo parent cwd — fallback for nested cwd inside the repo.
33
- */
34
- export function findComposeFile() {
35
- const candidates = [
36
- // Bundled path: dist/index.js lives at <pkg>/dist/; host-cp/ is a sibling of dist/
37
- path.resolve(path.dirname(new URL(import.meta.url).pathname), '../host-cp/compose.yaml'),
38
- // Source-mode: cwd is monorepo root
39
- path.resolve(process.cwd(), 'packages/host-cp/compose.yaml'),
40
- // Source-mode: cwd is one level inside the monorepo
41
- path.resolve(process.cwd(), '../packages/host-cp/compose.yaml'),
42
- ];
43
- for (const c of candidates) {
44
- if (fs.existsSync(c))
45
- return c;
46
- }
47
- // Last resort: let docker compose surface the error.
48
- return path.resolve(process.cwd(), 'packages/host-cp/compose.yaml');
49
- }
50
- /** Operator-state directory: `~/.olam/`. Honors OLAM_HOME for tests. */
51
- function olamHome() {
52
- return process.env.OLAM_HOME ?? path.join(os.homedir(), '.olam');
53
- }
54
- function tokenPath() {
55
- return path.join(olamHome(), 'host-cp.token');
56
- }
57
- function pidPath() {
58
- return path.join(olamHome(), 'host-cp.pid');
59
- }
60
- /**
61
- * Path to the operator-state shared auth-service secret.
62
- *
63
- * Created by `olam auth up` when the auth-service container first
64
- * starts. Both the auth-service container and host-cp container must
65
- * use the same secret value as their `X-Olam-Secret` so host-cp's
66
- * `/credentials/*` calls authenticate correctly.
67
- *
68
- * Honors OLAM_HOME for tests (matches `olamHome()`).
69
- */
70
- export function authSecretPath() {
71
- return resolveSecretPath('auth-secret');
72
- }
73
- /**
74
- * Read the shared auth-service secret from `~/.olam/auth-secret`.
75
- *
76
- * Returns null when the file is missing (auth-service was never started
77
- * or the file was deleted). Returns null instead of throwing because
78
- * `host-cp start` should still bring host-cp up — but it then logs a
79
- * loud warning so the operator notices that credential surfaces will
80
- * 401 until they run `olam auth up` to regenerate the secret.
81
- *
82
- * Empty/whitespace files are treated as "not set" (null) — a 0-byte
83
- * file would otherwise round-trip to compose as an empty env var,
84
- * which is exactly the silent-failure mode this whole helper exists
85
- * to prevent.
86
- */
87
- export function readAuthSecret() {
88
- const filePath = authSecretPath();
89
- if (!fs.existsSync(filePath))
90
- return null;
91
- const raw = fs.readFileSync(filePath, 'utf-8').trim();
92
- return raw.length > 0 ? raw : null;
93
- }
94
- /** Path to `~/.olam/r2-credentials.json`. Honors OLAM_HOME for tests. */
95
- export function r2CredentialsPath() {
96
- return path.join(olamHome(), 'r2-credentials.json');
97
- }
98
- /**
99
- * Read R2 credentials from `~/.olam/r2-credentials.json`.
100
- *
101
- * Returns null when the file is missing — callers should print a clear
102
- * "operator must configure" error rather than throwing. Returns null for
103
- * malformed JSON so callers can surface a useful message instead of a
104
- * raw parse stack trace.
105
- */
106
- export function readR2Credentials() {
107
- const filePath = r2CredentialsPath();
108
- if (!fs.existsSync(filePath))
109
- return null;
110
- const raw = fs.readFileSync(filePath, 'utf-8').trim();
111
- if (raw.length === 0)
112
- return null;
113
- try {
114
- const parsed = JSON.parse(raw);
115
- if (typeof parsed !== 'object' || parsed === null)
116
- return null;
117
- const creds = parsed;
118
- if (typeof creds.account_id !== 'string' ||
119
- typeof creds.bucket !== 'string' ||
120
- typeof creds.access_key_id !== 'string' ||
121
- typeof creds.secret_access_key !== 'string' ||
122
- typeof creds.public_url_base !== 'string') {
123
- return null;
124
- }
125
- return {
126
- account_id: creds.account_id,
127
- bucket: creds.bucket,
128
- access_key_id: creds.access_key_id,
129
- secret_access_key: creds.secret_access_key,
130
- public_url_base: creds.public_url_base,
131
- };
132
- }
133
- catch {
134
- return null;
135
- }
136
- }
137
- // ── Token + PID file helpers (pure; no docker calls) ──────────────
138
- /**
139
- * Generate a fresh 32-byte hex token and write it to `tokenPath()` with
140
- * mode 0600. Creates the parent directory if missing. Idempotent: if a
141
- * token already exists, this overwrites it (each `start` regenerates).
142
- */
143
- export function writeToken() {
144
- const token = crypto.randomBytes(32).toString('hex');
145
- const filePath = tokenPath();
146
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
147
- fs.writeFileSync(filePath, token, { mode: 0o600 });
148
- return token;
149
- }
150
- export function readToken() {
151
- const filePath = tokenPath();
152
- if (!fs.existsSync(filePath))
153
- return null;
154
- return fs.readFileSync(filePath, 'utf-8').trim();
155
- }
156
- export function removeToken() {
157
- const filePath = tokenPath();
158
- if (!fs.existsSync(filePath))
159
- return false;
160
- fs.unlinkSync(filePath);
161
- return true;
162
- }
163
- export function writePid(pid) {
164
- const filePath = pidPath();
165
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
166
- fs.writeFileSync(filePath, String(pid), { mode: 0o644 });
167
- }
168
- export function readPid() {
169
- const filePath = pidPath();
170
- if (!fs.existsSync(filePath))
171
- return null;
172
- const raw = fs.readFileSync(filePath, 'utf-8').trim();
173
- const n = parseInt(raw, 10);
174
- return Number.isFinite(n) ? n : null;
175
- }
176
- export function removePid() {
177
- const filePath = pidPath();
178
- if (!fs.existsSync(filePath))
179
- return false;
180
- fs.unlinkSync(filePath);
181
- return true;
182
- }
183
- /**
184
- * Find the host-cp container by name. Returns null if absent OR if the
185
- * Docker daemon is unresponsive within `DOCKER_PROBE_TIMEOUT_MS`.
186
- *
187
- * The timeout is critical for issue #988: `olam status` calls this via
188
- * `probeHostCp()`; without a timeout, a wedged Docker daemon (Colima with
189
- * stale state, dockerd-rootless socket present but unresponsive, etc.)
190
- * makes the command hang indefinitely. Read-only commands must never hang
191
- * waiting on backing services.
192
- */
193
- const DOCKER_PROBE_TIMEOUT_MS = 2_000;
194
- export async function findHostCpContainer() {
195
- const docker = new Dockerode(resolveDockerHostOptions());
196
- let timer = null;
197
- const listing = docker.listContainers({ all: true }).then((cs) => cs);
198
- const timeout = new Promise((resolve) => {
199
- timer = setTimeout(() => resolve(null), DOCKER_PROBE_TIMEOUT_MS);
200
- });
201
- let containers;
202
- try {
203
- containers = (await Promise.race([listing, timeout]));
204
- }
205
- catch {
206
- containers = null;
207
- }
208
- finally {
209
- if (timer !== null)
210
- clearTimeout(timer);
211
- }
212
- if (containers === null)
213
- return null;
214
- for (const c of containers) {
215
- const names = (c.Names ?? []).map((n) => n.replace(/^\//, ''));
216
- if (names.includes('olam-host-cp')) {
217
- return {
218
- id: c.Id.slice(0, 12),
219
- name: 'olam-host-cp',
220
- state: c.State,
221
- status: c.Status,
222
- };
223
- }
224
- }
225
- return null;
226
- }
227
- /**
228
- * Phase host-cp-reliability: Probe for a running host CP, supporting
229
- * both bare-node (process on host) and container deployments.
230
- *
231
- * Strategy:
232
- * 1. HTTP probe: try http://127.0.0.1:19000/api/bootstrap. If the
233
- * token file exists and the endpoint returns 200, host-cp is running.
234
- * Mode is 'bare' if no docker container found, 'container' otherwise.
235
- * 2. Docker fallback: if HTTP probe fails, look for the docker container.
236
- * If found+running, probe its port.
237
- *
238
- * Returns null if both fail, along with probe diagnostics in the
239
- * returned ProbeFailure for fail-loud error messages.
240
- *
241
- * @returns {Promise<{ url: string; mode: 'bare' | 'container' } | null>}
242
- * Result on success, null on failure.
243
- */
244
- export async function probeHostCp() {
245
- const candidateUrl = `http://127.0.0.1:${HOST_CP_PORT}`;
246
- // Step 1: HTTP probe (works for both bare-node and container, since
247
- // compose.yaml binds 127.0.0.1:19000. The /api/bootstrap endpoint is
248
- // unauthed and always returns 200 if host-cp is up.)
249
- let httpOk = false;
250
- try {
251
- const res = await fetch(`${candidateUrl}/api/bootstrap`, {
252
- signal: AbortSignal.timeout(2000),
253
- });
254
- httpOk = res.ok;
255
- }
256
- catch {
257
- httpOk = false;
258
- }
259
- if (httpOk) {
260
- // Determine mode: if docker container exists, it's container mode.
261
- let mode = 'bare';
262
- try {
263
- const container = await findHostCpContainer();
264
- if (container && container.state === 'running') {
265
- mode = 'container';
266
- }
267
- }
268
- catch {
269
- // Docker not available — must be bare mode.
270
- }
271
- return { url: candidateUrl, mode };
272
- }
273
- // Step 2: Docker container fallback. Handles the case where host-cp is
274
- // a container on a non-default port.
275
- try {
276
- const container = await findHostCpContainer();
277
- if (container && container.state === 'running') {
278
- // Probe the same 127.0.0.1:19000 (compose always binds there).
279
- try {
280
- const res = await fetch(`${candidateUrl}/api/bootstrap`, {
281
- signal: AbortSignal.timeout(2000),
282
- });
283
- if (res.ok) {
284
- return { url: candidateUrl, mode: 'container' };
285
- }
286
- }
287
- catch {
288
- // Container found but not responding on 19000 — fall through to null.
289
- }
290
- }
291
- }
292
- catch {
293
- // Docker not available — can't check containers.
294
- }
295
- return null;
296
- }
297
- /**
298
- * Gather probe failure diagnostics for fail-loud error messages.
299
- * Returns structured info about what was tried and why it failed.
300
- */
301
- export async function gatherProbeFailureDiagnostics() {
302
- let bootstrapStatus = 'no response';
303
- try {
304
- const res = await fetch(`http://127.0.0.1:${HOST_CP_PORT}/api/bootstrap`, {
305
- signal: AbortSignal.timeout(2000),
306
- });
307
- bootstrapStatus = `HTTP ${res.status}`;
308
- }
309
- catch (err) {
310
- bootstrapStatus = err instanceof Error ? err.message : 'connection refused';
311
- }
312
- let containerStatus = 'not found';
313
- try {
314
- const container = await findHostCpContainer();
315
- if (!container) {
316
- containerStatus = 'not found';
317
- }
318
- else {
319
- containerStatus = `found (state: ${container.state})`;
320
- }
321
- }
322
- catch {
323
- containerStatus = 'docker not available';
324
- }
325
- return { bootstrapStatus, containerStatus };
326
- }
327
- /**
328
- * Probe `http://127.0.0.1:19000/health`. Returns the parsed JSON or
329
- * null on connection error / non-2xx.
330
- */
331
- async function probeHealth() {
332
- try {
333
- const res = await fetch(`http://127.0.0.1:${HOST_CP_PORT}/health`, {
334
- signal: AbortSignal.timeout(2000),
335
- });
336
- if (!res.ok)
337
- return null;
338
- return (await res.json());
339
- }
340
- catch {
341
- return null;
342
- }
343
- }
344
- // ── docker compose wrapper ────────────────────────────────────────
345
- /**
346
- * The compose service name that `olam host-cp start` pre-pulls before
347
- * `compose up`. Named as a constant so tests can assert this is NEVER
348
- * the host-cp service itself (which was already digest-pinned by
349
- * `olam bootstrap`; re-pulling it would bypass the digest-verification
350
- * step and potentially fetch a different image from the registry).
351
- *
352
- * Regression guard: if this is changed to a bare compose pull (no
353
- * service specified), `docker compose pull` would try to pull ALL
354
- * services — including `olam-host-cp`, which before PR #302 was a bare
355
- * image name that Docker resolved via Docker Hub → "pull access denied
356
- * for olam-host-cp, repository does not exist".
357
- */
358
- export const SIDECAR_PULL_SERVICE = 'docker-socket-proxy';
359
- export function runCompose(args, composeFile, extraEnv = {}) {
360
- // compose.yaml interpolates `${OLAM_AUTH_SECRET:-}` from the shell
361
- // env. When the operator's shell didn't export it, the container
362
- // came up with an empty secret and every host-cp → auth-service
363
- // call 401'd silently — the SPA showed "0 credentials" even though
364
- // the vault was intact. We now thread a merged env explicitly so
365
- // `olam host-cp start` is self-sufficient and doesn't depend on
366
- // shell state.
367
- const result = spawnSync('docker', ['compose', '-f', composeFile, ...args], {
368
- encoding: 'utf-8',
369
- stdio: ['ignore', 'pipe', 'pipe'],
370
- env: { ...process.env, ...extraEnv },
371
- });
372
- return {
373
- ok: result.status === 0,
374
- stdout: result.stdout ?? '',
375
- stderr: result.stderr ?? '',
376
- };
377
- }
378
- /**
379
- * Build the extra env vars to pass to `docker compose up`. Pure helper
380
- * extracted so the env-merge contract is unit-testable without spawning
381
- * docker. Returns an object with only the keys we set; absent values
382
- * are omitted so process.env defaults can win when the secret file is
383
- * missing (and the boot warning surfaces the gap).
384
- *
385
- * Exported for tests.
386
- */
387
- export function buildComposeEnv(authSecret, ghToken) {
388
- const env = {};
389
- if (authSecret !== null && authSecret.length > 0) {
390
- env.OLAM_AUTH_SECRET = authSecret;
391
- }
392
- if (ghToken != null && ghToken.length > 0) {
393
- env.GH_TOKEN = ghToken;
394
- }
395
- // Propagate the operator's CLI version into the host-cp container so
396
- // /api/version/status can surface it (the dashboard's TopNav reads
397
- // it). Best-effort: if `cli-version.js` isn't reachable (test
398
- // environment without a built bundle), we skip — the container
399
- // falls back to whatever's baked in its image.
400
- const cliVersion = readCliVersion();
401
- if (cliVersion && cliVersion !== '0.0.0-unknown') {
402
- env.OLAM_CLI_VERSION = cliVersion;
403
- }
404
- return env;
405
- }
406
- /**
407
- * Capture the operator's GitHub token by running `gh auth token` on the
408
- * host. Returns the token string on success, null when gh is not installed
409
- * or the operator is not authenticated.
410
- *
411
- * Never throws — callers that need a token should check for null and warn,
412
- * but must not block host-cp from starting.
413
- *
414
- * Exported for tests.
415
- */
416
- export function captureGhToken() {
417
- try {
418
- const result = spawnSync('gh', ['auth', 'token'], {
419
- encoding: 'utf-8',
420
- stdio: ['ignore', 'pipe', 'pipe'],
421
- });
422
- if (result.status === 0) {
423
- const token = (result.stdout ?? '').trim();
424
- return token.length > 0 ? token : null;
425
- }
426
- return null;
427
- }
428
- catch {
429
- return null;
430
- }
431
- }
432
- // ── start ─────────────────────────────────────────────────────────
433
- /** Exported for `olam begin` (D1) to delegate start logic without CLI re-parse. */
434
- export async function startHostCp(opts) {
435
- return handleStart(opts);
436
- }
437
- async function handleStart(opts) {
438
- // 0. B2 — surface the compose-plugin error EARLY (not buried in step 4a's
439
- // "docker compose pull docker-socket-proxy failed after 3 attempts" with
440
- // a cryptic "unknown shorthand flag" stderr). An npm-only operator who
441
- // installed `docker` via `brew install docker` does NOT get the compose
442
- // v2 plugin by default; the actual fix is `brew install docker-compose`.
443
- // Probing first means the operator sees that one-line remedy instead of
444
- // chasing a retry-loop error.
445
- {
446
- const composeProbe = await probeComposePlugin();
447
- if (!composeProbe.ok) {
448
- printError(composeProbe.message);
449
- printError(composeProbe.remedy);
450
- process.exitCode = 1;
451
- return;
452
- }
453
- }
454
- // 1. Idempotency check: if container already running, surface URL + exit.
455
- const existing = await findHostCpContainer();
456
- if (existing && existing.state === 'running') {
457
- const health = await probeHealth();
458
- if (health) {
459
- printSuccess(`Host CP already running at http://127.0.0.1:${HOST_CP_PORT}`);
460
- printInfo('Container', existing.id);
461
- printInfo('Uptime', String(health['uptime_seconds'] ?? 'unknown') + 's');
462
- return;
463
- }
464
- // Container exists but health endpoint isn't responding — possibly
465
- // mid-boot. Tell the operator + don't restart.
466
- printWarning('Host CP container running but /health not responding. Wait a few seconds and retry, or stop+start.');
467
- return;
468
- }
469
- // 2. Port-zombie audit. If a stopped container holds :19000, fail
470
- // fast with the clean error from PortHeldByZombieError.
471
- try {
472
- const docker = new Dockerode(resolveDockerHostOptions());
473
- await auditPortsForZombies(docker, [HOST_CP_PORT]);
474
- }
475
- catch (err) {
476
- if (err instanceof PortHeldByZombieError) {
477
- printError(`Port ${HOST_CP_PORT} held by zombie container "${err.containerName}" (state: ${err.state}).`);
478
- printError(`Run: docker rm ${err.containerName}`);
479
- process.exitCode = 1;
480
- return;
481
- }
482
- throw err;
483
- }
484
- // 3. Generate fresh token. Each `start` regenerates so rotated tokens
485
- // don't linger; old SPA sessions are invalidated.
486
- const token = writeToken();
487
- // 4. docker compose up -d.
488
- const composeFile = findComposeFile();
489
- if (!fs.existsSync(composeFile)) {
490
- printError(`compose.yaml not found at ${composeFile}. Run from the olam project root.`);
491
- removeToken();
492
- process.exitCode = 1;
493
- return;
494
- }
495
- // Auto-load the shared auth-service secret from ~/.olam/auth-secret
496
- // so the operator's shell doesn't need to export OLAM_AUTH_SECRET.
497
- // Missing/empty file → warn now (NOT fatal — host-cp still boots, the
498
- // SPA still serves; the operator just sees an empty credentials list
499
- // until they run `olam auth up` to regenerate the secret).
500
- const authSecret = readAuthSecret();
501
- if (authSecret === null) {
502
- printWarning(`${authSecretPath()} not found or empty. host-cp will boot, but ` +
503
- 'credential surfaces (auth fleet, hotswap) will fail with 401 until ' +
504
- 'you run `olam auth up` to (re)generate the shared secret.');
505
- }
506
- // Capture GH_TOKEN from the host's gh CLI so host-cp's pr-merge-poller
507
- // and /api/prs endpoint can authenticate against the GitHub API.
508
- // Missing token is non-fatal — host-cp boots fine, just without PR badges.
509
- const ghToken = captureGhToken();
510
- if (ghToken === null) {
511
- printWarning('GitHub CLI not authenticated; PR badges will not appear in the inbox. ' +
512
- 'Run `gh auth login` then `olam host-cp restart`.');
513
- }
514
- // 4a. Pre-pull the docker-socket-proxy sidecar with bounded retry.
515
- // compose.yaml's host-cp service is image-only (no `build:`) and
516
- // its `:latest` tag was already aliased from a digest-pinned ref
517
- // by `olam bootstrap` — no registry round-trip needed for that
518
- // image. The remaining service that DOES need a pull is the
519
- // third-party `tecnativa/docker-socket-proxy:0.3.0`. Pulling it
520
- // by name (rather than `compose pull` of all services) gives us
521
- // the retry/backoff loop without overwriting the digest-pinned
522
- // host-cp tag with whatever `:latest` happens to be on the
523
- // registry right now.
524
- const composeEnv = buildComposeEnv(authSecret, ghToken);
525
- const PULL_BACKOFF_MS = [0, 1000, 3000];
526
- let pullOk = false;
527
- let lastPullStderr = '';
528
- for (let attempt = 0; attempt < PULL_BACKOFF_MS.length; attempt += 1) {
529
- if (PULL_BACKOFF_MS[attempt] > 0) {
530
- await new Promise((r) => setTimeout(r, PULL_BACKOFF_MS[attempt]));
531
- }
532
- const pullResult = runCompose(['pull', '--quiet', SIDECAR_PULL_SERVICE], composeFile, composeEnv);
533
- if (pullResult.ok) {
534
- pullOk = true;
535
- break;
536
- }
537
- lastPullStderr = pullResult.stderr;
538
- }
539
- if (!pullOk) {
540
- printError('docker compose pull docker-socket-proxy failed after 3 attempts');
541
- process.stderr.write(lastPullStderr);
542
- removeToken();
543
- process.exitCode = 1;
544
- return;
545
- }
546
- // No --build: compose.yaml is image-only (no `build:` block) so the
547
- // operator's pre-pulled `ghcr.io/pleri/olam-host-cp:latest` (aliased
548
- // from the digest by bootstrap) is used directly. `--build` would
549
- // require the Dockerfile + build context, which fresh-install
550
- // operators don't ship. Local-dev contributors who ARE working on
551
- // host-cp source use `compose.dev.yaml` as an override; that path
552
- // does not run through this code.
553
- const result = runCompose(['up', '-d'], composeFile, composeEnv);
554
- if (!result.ok) {
555
- printError('docker compose up failed');
556
- process.stderr.write(result.stderr);
557
- removeToken();
558
- process.exitCode = 1;
559
- return;
560
- }
561
- // 5. Wait briefly for /health to come up (max 10s).
562
- const deadline = Date.now() + 10_000;
563
- let healthy = false;
564
- while (Date.now() < deadline) {
565
- const h = await probeHealth();
566
- if (h) {
567
- healthy = true;
568
- break;
569
- }
570
- await new Promise((r) => setTimeout(r, 500));
571
- }
572
- if (!healthy) {
573
- printWarning('Host CP started but /health did not respond within 10s. Check `docker compose logs host-cp`.');
574
- }
575
- // 6. Resolve container PID for the marker file.
576
- const container = await findHostCpContainer();
577
- if (container) {
578
- // We can't easily get the host-side PID without docker inspect; the
579
- // file primarily marks "started by olam host-cp start" presence, not
580
- // a true OS PID. Use 1 as a sentinel; D2 doesn't depend on the value.
581
- writePid(1);
582
- }
583
- // 7. Surface the URL + token.
584
- printSuccess(`Host CP running at http://127.0.0.1:${HOST_CP_PORT}`);
585
- if (opts.showToken) {
586
- printInfo('Token', token);
587
- }
588
- else {
589
- printInfo('Token', `(written to ${tokenPath()}; pass --show-token to print)`);
590
- }
591
- printInfo('Open', `http://127.0.0.1:${HOST_CP_PORT}`);
592
- }
593
- // ── stop ──────────────────────────────────────────────────────────
594
- /** Exported for `olam stop` (D2) to delegate stop logic without CLI re-parse. */
595
- export async function stopHostCp() {
596
- return handleStop();
597
- }
598
- async function handleStop() {
599
- const composeFile = findComposeFile();
600
- if (!fs.existsSync(composeFile)) {
601
- printWarning(`compose.yaml not found at ${composeFile}. Cleaning up token + PID anyway.`);
602
- removeToken();
603
- removePid();
604
- return;
605
- }
606
- const existing = await findHostCpContainer();
607
- if (!existing) {
608
- printInfo('Host CP', 'not running');
609
- removeToken();
610
- removePid();
611
- return;
612
- }
613
- const result = runCompose(['down'], composeFile);
614
- if (!result.ok) {
615
- printError('docker compose down failed');
616
- process.stderr.write(result.stderr);
617
- process.exitCode = 1;
618
- return;
619
- }
620
- removeToken();
621
- removePid();
622
- printSuccess('Host CP stopped');
623
- }
624
- async function buildStatusReport() {
625
- const container = await findHostCpContainer();
626
- const health = await probeHealth();
627
- const tokenFile = tokenPath();
628
- const tokenPresent = fs.existsSync(tokenFile);
629
- let tokenModeOk = false;
630
- if (tokenPresent) {
631
- const mode = fs.statSync(tokenFile).mode & 0o777;
632
- tokenModeOk = mode === 0o600;
633
- }
634
- const pidPresent = fs.existsSync(pidPath());
635
- let stack;
636
- if (!container) {
637
- stack = 'not_started';
638
- }
639
- else if (container.state === 'running' && health) {
640
- stack = 'running';
641
- }
642
- else if (container.state === 'running') {
643
- stack = 'partial';
644
- }
645
- else {
646
- stack = 'stopped';
647
- }
648
- return {
649
- stack,
650
- container,
651
- health,
652
- token_present: tokenPresent,
653
- token_mode_ok: tokenModeOk,
654
- pid_present: pidPresent,
655
- url: `http://127.0.0.1:${HOST_CP_PORT}`,
656
- };
657
- }
658
- async function handleStatus(opts) {
659
- const report = await buildStatusReport();
660
- if (opts.json) {
661
- process.stdout.write(JSON.stringify(report, null, 2) + '\n');
662
- process.exitCode = report.stack === 'running' ? 0 : 1;
663
- return;
664
- }
665
- printHeader('Host CP Status');
666
- printInfo('Stack', report.stack);
667
- printInfo('URL', report.url);
668
- if (report.container) {
669
- printInfo('Container', `${report.container.id} (${report.container.state})`);
670
- printInfo('Status line', report.container.status);
671
- }
672
- else {
673
- printInfo('Container', 'not found (run `olam host-cp start`)');
674
- }
675
- if (report.health) {
676
- printInfo('Health', 'ok');
677
- printInfo('Uptime', String(report.health['uptime_seconds'] ?? 'unknown') + 's');
678
- const cache = report.health['cache'];
679
- if (cache) {
680
- printInfo('Cached worlds', String(cache.worlds?.length ?? 0));
681
- printInfo('Cache TTL', `${cache.ttl_sec ?? 'unknown'}s`);
682
- }
683
- const sse = report.health['sse'];
684
- if (sse) {
685
- printInfo('SSE active', `${sse.active ?? 0} / ${sse.cap ?? 0}`);
686
- }
687
- }
688
- else {
689
- printInfo('Health', 'not responding');
690
- }
691
- printInfo('Token file', report.token_present ? (report.token_mode_ok ? 'present (mode 600)' : 'present (BAD MODE — should be 600)') : 'absent');
692
- printInfo('PID file', report.pid_present ? 'present' : 'absent');
693
- process.exitCode = report.stack === 'running' ? 0 : 1;
694
- }
695
- // ── Register ──────────────────────────────────────────────────────
696
- export function registerHostCp(program) {
697
- const hostCp = program
698
- .command('host-cp')
699
- .description('Manage the Olam host control plane container');
700
- hostCp
701
- .command('start')
702
- .description('Start the host CP container (token regenerated each call)')
703
- .option('--show-token', 'Print the generated token to stdout (default: hide)')
704
- .action(async (opts) => {
705
- await handleStart({ showToken: opts.showToken === true });
706
- });
707
- hostCp
708
- .command('stop')
709
- .description('Stop the host CP container + remove token + PID files')
710
- .action(async () => {
711
- await handleStop();
712
- });
713
- hostCp
714
- .command('status')
715
- .description('Show host CP container + health diagnostics')
716
- .option('--json', 'Output as JSON (machine-parseable; sets exit code)')
717
- .action(async (opts) => {
718
- await handleStatus({ json: opts.json === true });
719
- });
720
- hostCp
721
- .command('register')
722
- .description('Register a world with the running host CP so it appears in the unified UI')
723
- .requiredOption('--world <id>', 'World id (the docker container suffix, e.g. gold-arc-1454)')
724
- .option('--port <port>', 'Override per-world CP port; default: discovered from `olam list`')
725
- .action(async (opts) => {
726
- await handleRegister({ world: opts.world, port: opts.port });
727
- });
728
- hostCp
729
- .command('deregister')
730
- .description('Remove a world from the host CP registry (does NOT destroy the world)')
731
- .requiredOption('--world <id>', 'World id to remove')
732
- .action(async (opts) => {
733
- await handleDeregister({ world: opts.world });
734
- });
735
- }
736
- // ── Register / Deregister handlers ────────────────────────────────
737
- async function discoverWorldPort(worldId) {
738
- try {
739
- const { loadContext } = await import('../context.js');
740
- const { ctx } = await loadContext();
741
- if (!ctx)
742
- return null;
743
- const world = await ctx.worldManager.getWorld(worldId);
744
- if (!world)
745
- return null;
746
- // Per-world CP base port = 19080. Per-world host port = base + offset.
747
- // Matches the docker provider's port allocation in
748
- // packages/adapters/src/docker/container.ts (search for 19080).
749
- return 19080 + world.portOffset;
750
- }
751
- catch {
752
- return null;
753
- }
754
- }
755
- async function readHostCpToken() {
756
- const tp = tokenPath();
757
- if (!fs.existsSync(tp))
758
- return null;
759
- return fs.readFileSync(tp, 'utf-8').trim();
760
- }
761
- /**
762
- * Phase D6 (olam-dogfood-vision): open a Host CP URL in the operator's
763
- * default browser.
764
- *
765
- * D-phase audit follow-up (HIGH-1): the helper now lives in
766
- * `@olam/core/src/util/open-url.ts` so both this CLI and the MCP
767
- * server can import it statically. Earlier shape duplicated the
768
- * helper here and required @olam/mcp-server to dynamic-import the
769
- * compiled CLI dist — fragile under stale-build conditions. Static
770
- * import via @olam/core (already a declared dep on both packages)
771
- * removes the cross-package dynamic-import + as-never-cast pattern.
772
- *
773
- * Re-exported here so existing callers don't need to update their
774
- * imports.
775
- */
776
- export { openUrl as openHostCpUrl } from '@olam/core/src/util/open-url.js';
777
- /**
778
- * Phase C8 (olam-dogfood-vision): generic host-cp proxy caller for
779
- * `/api/world/<id>/*` routes. Used by `olam lanes` subcommands to
780
- * reach the per-world CP through host-cp's auth-injecting proxy
781
- * (host-cp injects X-Olam-Secret server-side; the operator only
782
- * sees the Bearer token).
783
- *
784
- * Returns the parsed JSON body on success, or {ok:false, error} on
785
- * any failure (token missing, network error, non-2xx response).
786
- *
787
- * @param method
788
- * @param worldId
789
- * @param path the per-world CP path including leading slash, e.g.
790
- * '/lanes', '/lanes/foo', '/lanes/foo/dispatch'
791
- * @param body optional JSON body for POST/DELETE
792
- */
793
- export async function callHostCpProxy(method, worldId, path, body) {
794
- const token = await readHostCpToken();
795
- if (!token)
796
- return { ok: false, status: 0, error: 'no token (host CP not started)' };
797
- const url = `http://127.0.0.1:${HOST_CP_PORT}/api/world/${encodeURIComponent(worldId)}${path}`;
798
- try {
799
- const headers = {
800
- Authorization: `Bearer ${token}`,
801
- };
802
- if (body !== undefined)
803
- headers['Content-Type'] = 'application/json';
804
- const res = await fetch(url, {
805
- method,
806
- headers,
807
- ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
808
- });
809
- if (!res.ok) {
810
- const text = await res.text().catch(() => '');
811
- // Try to parse the error body as JSON so callers can surface
812
- // structured errors (e.g., 409 conflict with currentTask).
813
- let errMsg = text || `HTTP ${res.status}`;
814
- try {
815
- const parsed = JSON.parse(text);
816
- if (parsed && typeof parsed === 'object' && 'error' in parsed) {
817
- errMsg = String(parsed.error);
818
- }
819
- }
820
- catch { /* keep raw text */ }
821
- return { ok: false, status: res.status, error: errMsg };
822
- }
823
- const data = await res.json().catch(() => null);
824
- return { ok: true, status: res.status, data };
825
- }
826
- catch (err) {
827
- return {
828
- ok: false,
829
- status: 0,
830
- error: err instanceof Error ? err.message : String(err),
831
- };
832
- }
833
- }
834
- /**
835
- * POST/DELETE the host-cp admin registry endpoint. Exported so other
836
- * commands (create, destroy) can auto-register without re-implementing
837
- * the fetch dance.
838
- */
839
- export async function callHostCpRegistry(method, body) {
840
- const token = await readHostCpToken();
841
- if (!token)
842
- return { ok: false, status: 0, error: 'no token (host CP not started)' };
843
- const url = method === 'DELETE'
844
- ? `http://127.0.0.1:${HOST_CP_PORT}/api/admin/registry/${encodeURIComponent(body.id)}`
845
- : `http://127.0.0.1:${HOST_CP_PORT}/api/admin/registry`;
846
- try {
847
- const res = await fetch(url, {
848
- method,
849
- headers: {
850
- Authorization: `Bearer ${token}`,
851
- ...(method === 'POST' ? { 'Content-Type': 'application/json' } : {}),
852
- },
853
- ...(method === 'POST' ? { body: JSON.stringify(body) } : {}),
854
- });
855
- if (!res.ok) {
856
- const text = await res.text().catch(() => '');
857
- return { ok: false, status: res.status, error: text || `HTTP ${res.status}` };
858
- }
859
- return { ok: true, status: res.status };
860
- }
861
- catch (err) {
862
- return {
863
- ok: false,
864
- status: 0,
865
- error: err instanceof Error ? err.message : String(err),
866
- };
867
- }
868
- }
869
- async function handleRegister(opts) {
870
- printHeader('Register world with host CP');
871
- let port = null;
872
- if (opts.port) {
873
- port = parseInt(opts.port, 10);
874
- if (!Number.isFinite(port) || port <= 0) {
875
- printError(`Invalid --port value: ${opts.port}`);
876
- process.exitCode = 1;
877
- return;
878
- }
879
- }
880
- else {
881
- port = await discoverWorldPort(opts.world);
882
- if (port === null) {
883
- printError(`Could not discover port for world ${opts.world}. Pass --port explicitly or check that the world exists in \`olam list\`.`);
884
- process.exitCode = 1;
885
- return;
886
- }
887
- }
888
- const result = await callHostCpRegistry('POST', { id: opts.world, port });
889
- if (!result.ok) {
890
- printError(`Register failed: ${result.error}`);
891
- if (result.status === 0) {
892
- printInfo('Hint', 'Is host CP running? `olam host-cp status`');
893
- }
894
- process.exitCode = 1;
895
- return;
896
- }
897
- printSuccess(`Registered ${opts.world} → :${port}`);
898
- printInfo('UI', `http://127.0.0.1:${HOST_CP_PORT}/world/${encodeURIComponent(opts.world)}`);
899
- }
900
- async function handleDeregister(opts) {
901
- printHeader('Deregister world from host CP');
902
- const result = await callHostCpRegistry('DELETE', { id: opts.world });
903
- if (!result.ok) {
904
- printError(`Deregister failed: ${result.error}`);
905
- if (result.status === 0) {
906
- printInfo('Hint', 'Is host CP running? `olam host-cp status`');
907
- }
908
- process.exitCode = 1;
909
- return;
910
- }
911
- printSuccess(`Deregistered ${opts.world}`);
912
- }
913
- //# sourceMappingURL=host-cp.js.map