@mesh-tech/mesh-cli 0.20.2 → 0.20.3

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 (435) hide show
  1. package/dist/bin/mesh.d.ts +0 -12
  2. package/dist/bin/mesh.js +12 -12
  3. package/dist/bin/mesh.js.map +0 -1
  4. package/dist/build-info.json +2 -2
  5. package/dist/src/commands/agent-api-client.d.ts +0 -70
  6. package/dist/src/commands/agent-api-client.js +0 -80
  7. package/dist/src/commands/app-check.d.ts +0 -56
  8. package/dist/src/commands/app-check.js +0 -72
  9. package/dist/src/commands/artifacts.d.ts +0 -11
  10. package/dist/src/commands/artifacts.js +0 -33
  11. package/dist/src/commands/cluster.d.ts +0 -39
  12. package/dist/src/commands/cluster.js +0 -73
  13. package/dist/src/commands/conversations.d.ts +0 -36
  14. package/dist/src/commands/conversations.js +0 -59
  15. package/dist/src/commands/create-app.d.ts +0 -98
  16. package/dist/src/commands/create-app.js +1 -163
  17. package/dist/src/commands/db/connect.d.ts +0 -7
  18. package/dist/src/commands/db/connect.js +0 -9
  19. package/dist/src/commands/db/credentials.d.ts +0 -7
  20. package/dist/src/commands/db/credentials.js +0 -10
  21. package/dist/src/commands/db/env.d.ts +0 -6
  22. package/dist/src/commands/db/env.js +0 -14
  23. package/dist/src/commands/db/exec.d.ts +0 -43
  24. package/dist/src/commands/db/exec.js +0 -69
  25. package/dist/src/commands/db/index.d.ts +0 -10
  26. package/dist/src/commands/db/index.js +0 -10
  27. package/dist/src/commands/db/psql.d.ts +0 -7
  28. package/dist/src/commands/db/psql.js +0 -18
  29. package/dist/src/commands/deploy.d.ts +0 -38
  30. package/dist/src/commands/deploy.js +1 -76
  31. package/dist/src/commands/dev-doctor.d.ts +0 -82
  32. package/dist/src/commands/dev-doctor.js +3 -132
  33. package/dist/src/commands/dev-launch.d.ts +0 -52
  34. package/dist/src/commands/dev-launch.js +0 -56
  35. package/dist/src/commands/dev-token-server.d.ts +0 -18
  36. package/dist/src/commands/dev-token-server.js +1 -24
  37. package/dist/src/commands/dev.d.ts +0 -246
  38. package/dist/src/commands/dev.js +5 -963
  39. package/dist/src/commands/docs.d.ts +0 -1
  40. package/dist/src/commands/docs.js +0 -12
  41. package/dist/src/commands/hub/index.d.ts +0 -60
  42. package/dist/src/commands/hub/index.js +2 -139
  43. package/dist/src/commands/init/wizard.d.ts +0 -128
  44. package/dist/src/commands/init/wizard.js +0 -109
  45. package/dist/src/commands/init.d.ts +0 -55
  46. package/dist/src/commands/init.js +0 -70
  47. package/dist/src/commands/install-shim.d.ts +0 -23
  48. package/dist/src/commands/install-shim.js +2 -29
  49. package/dist/src/commands/local/auth-provision.d.ts +0 -80
  50. package/dist/src/commands/local/auth-provision.js +0 -109
  51. package/dist/src/commands/local/dev-local.d.ts +0 -91
  52. package/dist/src/commands/local/dev-local.js +0 -147
  53. package/dist/src/commands/local/docker-runner.d.ts +0 -22
  54. package/dist/src/commands/local/docker-runner.js +2 -35
  55. package/dist/src/commands/local/helpers.d.ts +0 -14
  56. package/dist/src/commands/local/helpers.js +0 -13
  57. package/dist/src/commands/local/hub-local.d.ts +0 -96
  58. package/dist/src/commands/local/hub-local.js +0 -111
  59. package/dist/src/commands/local/index.d.ts +0 -14
  60. package/dist/src/commands/local/index.js +0 -86
  61. package/dist/src/commands/local/mocks.d.ts +0 -269
  62. package/dist/src/commands/local/mocks.js +1 -274
  63. package/dist/src/commands/local/seed-hub-catalog.d.ts +0 -25
  64. package/dist/src/commands/local/seed-hub-catalog.js +0 -41
  65. package/dist/src/commands/local/seed-zitadel.d.ts +0 -82
  66. package/dist/src/commands/local/seed-zitadel.js +0 -158
  67. package/dist/src/commands/local/seed.d.ts +0 -64
  68. package/dist/src/commands/local/seed.js +0 -78
  69. package/dist/src/commands/local/stack.d.ts +0 -141
  70. package/dist/src/commands/local/stack.js +0 -153
  71. package/dist/src/commands/login.d.ts +0 -265
  72. package/dist/src/commands/login.js +4 -418
  73. package/dist/src/commands/peer-addressing.d.ts +0 -39
  74. package/dist/src/commands/peer-addressing.js +0 -37
  75. package/dist/src/commands/port-ownership.d.ts +0 -44
  76. package/dist/src/commands/port-ownership.js +0 -47
  77. package/dist/src/commands/registry-publish.d.ts +0 -1
  78. package/dist/src/commands/registry-publish.js +0 -46
  79. package/dist/src/commands/registry.d.ts +4 -237
  80. package/dist/src/commands/registry.js +2 -316
  81. package/dist/src/commands/secrets/exec.d.ts +0 -16
  82. package/dist/src/commands/secrets/exec.js +0 -24
  83. package/dist/src/commands/secrets/index.d.ts +0 -9
  84. package/dist/src/commands/secrets/index.js +0 -10
  85. package/dist/src/commands/secrets/migrate-config.d.ts +0 -17
  86. package/dist/src/commands/secrets/migrate-config.js +0 -40
  87. package/dist/src/commands/secrets/reindex.d.ts +0 -38
  88. package/dist/src/commands/secrets/reindex.js +0 -39
  89. package/dist/src/commands/secrets/set.d.ts +0 -47
  90. package/dist/src/commands/secrets/set.js +0 -107
  91. package/dist/src/commands/site.d.ts +0 -1
  92. package/dist/src/commands/site.js +0 -61
  93. package/dist/src/commands/skills.d.ts +0 -61
  94. package/dist/src/commands/skills.js +0 -83
  95. package/dist/src/commands/stack.d.ts +0 -15
  96. package/dist/src/commands/stack.js +1 -128
  97. package/dist/src/commands/temporal.d.ts +0 -30
  98. package/dist/src/commands/temporal.js.map +0 -1
  99. package/dist/src/commands/tenant.d.ts +0 -31
  100. package/dist/src/commands/tenant.js +0 -55
  101. package/dist/src/commands/tunnel/index.d.ts +0 -40
  102. package/dist/src/commands/tunnel/index.js +0 -141
  103. package/dist/src/commands/vcs/clone.d.ts +0 -1
  104. package/dist/src/commands/vcs/clone.js +0 -4
  105. package/dist/src/commands/vcs/common.d.ts +0 -32
  106. package/dist/src/commands/vcs/common.js +0 -41
  107. package/dist/src/commands/vcs/drafts.d.ts +0 -1
  108. package/dist/src/commands/vcs/drafts.js +0 -1
  109. package/dist/src/commands/vcs/get.d.ts +0 -1
  110. package/dist/src/commands/vcs/get.js +0 -11
  111. package/dist/src/commands/vcs/index.d.ts +0 -1
  112. package/dist/src/commands/vcs/index.js +0 -1
  113. package/dist/src/commands/vcs/propose.d.ts +0 -26
  114. package/dist/src/commands/vcs/propose.js +3 -34
  115. package/dist/src/commands/vcs/review.d.ts +0 -1
  116. package/dist/src/commands/vcs/review.js +0 -1
  117. package/dist/src/commands/vcs/rm.d.ts +0 -11
  118. package/dist/src/commands/vcs/rm.js +0 -14
  119. package/dist/src/commands/vcs-enrich.d.ts +0 -12
  120. package/dist/src/commands/vcs-enrich.js +0 -12
  121. package/dist/src/commands/vpn/index.d.ts +0 -17
  122. package/dist/src/commands/vpn/index.js +0 -102
  123. package/dist/src/commands/vpn/tunnel.d.ts +0 -9
  124. package/dist/src/commands/vpn/tunnel.js +0 -37
  125. package/dist/src/commands/workflow.d.ts +0 -22
  126. package/dist/src/commands/workflow.js +0 -80
  127. package/dist/src/docs/assemble.d.ts +0 -117
  128. package/dist/src/docs/assemble.js +0 -142
  129. package/dist/src/docs/cli-reference.d.ts +0 -58
  130. package/dist/src/docs/cli-reference.js +0 -77
  131. package/dist/src/docs/discover.d.ts +0 -40
  132. package/dist/src/docs/discover.js +2 -60
  133. package/dist/src/docs/portal.d.ts +0 -44
  134. package/dist/src/docs/portal.js +0 -49
  135. package/dist/src/docs/registry-docs.d.ts +0 -29
  136. package/dist/src/docs/registry-docs.js +0 -40
  137. package/dist/src/docs/schema.d.ts +0 -36
  138. package/dist/src/docs/schema.js +0 -52
  139. package/dist/src/docs/serve.d.ts +0 -18
  140. package/dist/src/docs/serve.js +2 -30
  141. package/dist/src/docs/start.d.ts +0 -42
  142. package/dist/src/docs/start.js +0 -70
  143. package/dist/src/eval/agent-eval.d.mts +0 -12
  144. package/dist/src/eval/agent-eval.mjs +0 -22
  145. package/dist/src/index.d.ts +0 -6
  146. package/dist/src/index.js.map +0 -1
  147. package/dist/src/program.d.ts +0 -20
  148. package/dist/src/program.js +0 -24
  149. package/dist/src/utils/auth-preflight.d.ts +0 -137
  150. package/dist/src/utils/auth-preflight.js +0 -149
  151. package/dist/src/utils/aws-auth.d.ts +0 -163
  152. package/dist/src/utils/aws-auth.js +3 -232
  153. package/dist/src/utils/bastion.d.ts +0 -27
  154. package/dist/src/utils/bastion.js +0 -28
  155. package/dist/src/utils/build-info.d.ts +0 -22
  156. package/dist/src/utils/build-info.js +0 -27
  157. package/dist/src/utils/cache-home.d.ts +0 -23
  158. package/dist/src/utils/cache-home.js +0 -25
  159. package/dist/src/utils/capture-history.d.ts +0 -54
  160. package/dist/src/utils/capture-history.js +1 -55
  161. package/dist/src/utils/context.d.ts +0 -23
  162. package/dist/src/utils/context.js +0 -43
  163. package/dist/src/utils/credentials.d.ts +0 -38
  164. package/dist/src/utils/credentials.js +0 -39
  165. package/dist/src/utils/deploy-preflight.d.ts +0 -38
  166. package/dist/src/utils/deploy-preflight.js +1 -71
  167. package/dist/src/utils/errors.d.ts +0 -53
  168. package/dist/src/utils/errors.js +0 -49
  169. package/dist/src/utils/first-party-contexts.d.ts +0 -38
  170. package/dist/src/utils/first-party-contexts.js +0 -44
  171. package/dist/src/utils/index.d.ts +0 -4
  172. package/dist/src/utils/index.js +0 -4
  173. package/dist/src/utils/kubeconfig.d.ts +0 -40
  174. package/dist/src/utils/kubeconfig.js +0 -44
  175. package/dist/src/utils/log.d.ts +0 -20
  176. package/dist/src/utils/log.js +0 -20
  177. package/dist/src/utils/mesh-json.d.ts +0 -46
  178. package/dist/src/utils/mesh-json.js +0 -39
  179. package/dist/src/utils/pid.d.ts +0 -42
  180. package/dist/src/utils/pid.js +0 -48
  181. package/dist/src/utils/pulumi-run.d.ts +0 -14
  182. package/dist/src/utils/pulumi-run.js +0 -42
  183. package/dist/src/utils/pulumi.d.ts +0 -34
  184. package/dist/src/utils/pulumi.js +0 -38
  185. package/dist/src/utils/reachability.d.ts +0 -27
  186. package/dist/src/utils/reachability.js +0 -40
  187. package/dist/src/utils/recover-conversation.d.ts +0 -110
  188. package/dist/src/utils/recover-conversation.js +0 -108
  189. package/dist/src/utils/registry-broker.d.ts +5 -84
  190. package/dist/src/utils/registry-broker.js +0 -62
  191. package/dist/src/utils/registry-identity.d.ts +0 -149
  192. package/dist/src/utils/registry-identity.js +0 -143
  193. package/dist/src/utils/scaffold-versions.d.ts +0 -41
  194. package/dist/src/utils/scaffold-versions.js +0 -42
  195. package/dist/src/utils/socks-forward.d.ts +0 -24
  196. package/dist/src/utils/socks-forward.js +2 -25
  197. package/dist/src/utils/stack-flag.d.ts +0 -13
  198. package/dist/src/utils/stack-flag.js +0 -21
  199. package/dist/src/utils/tailscale-targets.d.ts +0 -37
  200. package/dist/src/utils/tailscale-targets.js +0 -33
  201. package/dist/src/utils/tailscale.d.ts +0 -177
  202. package/dist/src/utils/tailscale.js +6 -337
  203. package/dist/src/utils/temporal-auth.d.ts +0 -41
  204. package/dist/src/utils/temporal-auth.js +0 -52
  205. package/dist/src/utils/temporal-codec.d.ts +0 -89
  206. package/dist/src/utils/temporal-codec.js.map +0 -1
  207. package/dist/src/utils/tunnel-ownership.d.ts +0 -79
  208. package/dist/src/utils/tunnel-ownership.js +0 -74
  209. package/dist/src/utils/vpn-join.d.ts +0 -16
  210. package/dist/src/utils/vpn-join.js +0 -17
  211. package/dist/src/utils/vpn.d.ts +0 -42
  212. package/dist/src/utils/vpn.js +0 -52
  213. package/dist/src/utils/workflow-fingerprint.d.ts +0 -39
  214. package/dist/src/utils/workflow-fingerprint.js +1 -63
  215. package/dist/src/utils/worktree-identity.d.ts +0 -62
  216. package/dist/src/utils/worktree-identity.js +0 -88
  217. package/package.json +1 -1
  218. package/skills/core/SKILL.md +9 -10
  219. package/templates/api-auth/api/src/index.ts.hbs +1 -1
  220. package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +2 -2
  221. package/templates/api-role-gating/api/src/authn.ts.hbs +2 -2
  222. package/templates/api-role-gating/index.ts.hbs +1 -1
  223. package/templates/api-role-gating/skills/develop/SKILL.md.hbs +1 -1
  224. package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +2 -2
  225. package/templates/platform-repo/platform/index.ts +1 -1
  226. package/dist/bin/mesh.d.ts.map +0 -1
  227. package/dist/src/commands/agent-api-client.d.ts.map +0 -1
  228. package/dist/src/commands/agent-api-client.js.map +0 -1
  229. package/dist/src/commands/app-check.d.ts.map +0 -1
  230. package/dist/src/commands/app-check.js.map +0 -1
  231. package/dist/src/commands/artifacts.d.ts.map +0 -1
  232. package/dist/src/commands/artifacts.js.map +0 -1
  233. package/dist/src/commands/cluster.d.ts.map +0 -1
  234. package/dist/src/commands/cluster.js.map +0 -1
  235. package/dist/src/commands/conversations.d.ts.map +0 -1
  236. package/dist/src/commands/conversations.js.map +0 -1
  237. package/dist/src/commands/create-app.d.ts.map +0 -1
  238. package/dist/src/commands/create-app.js.map +0 -1
  239. package/dist/src/commands/db/connect.d.ts.map +0 -1
  240. package/dist/src/commands/db/connect.js.map +0 -1
  241. package/dist/src/commands/db/credentials.d.ts.map +0 -1
  242. package/dist/src/commands/db/credentials.js.map +0 -1
  243. package/dist/src/commands/db/env.d.ts.map +0 -1
  244. package/dist/src/commands/db/env.js.map +0 -1
  245. package/dist/src/commands/db/exec.d.ts.map +0 -1
  246. package/dist/src/commands/db/exec.js.map +0 -1
  247. package/dist/src/commands/db/index.d.ts.map +0 -1
  248. package/dist/src/commands/db/index.js.map +0 -1
  249. package/dist/src/commands/db/psql.d.ts.map +0 -1
  250. package/dist/src/commands/db/psql.js.map +0 -1
  251. package/dist/src/commands/deploy.d.ts.map +0 -1
  252. package/dist/src/commands/deploy.js.map +0 -1
  253. package/dist/src/commands/dev-doctor.d.ts.map +0 -1
  254. package/dist/src/commands/dev-doctor.js.map +0 -1
  255. package/dist/src/commands/dev-launch.d.ts.map +0 -1
  256. package/dist/src/commands/dev-launch.js.map +0 -1
  257. package/dist/src/commands/dev-token-server.d.ts.map +0 -1
  258. package/dist/src/commands/dev-token-server.js.map +0 -1
  259. package/dist/src/commands/dev.d.ts.map +0 -1
  260. package/dist/src/commands/dev.js.map +0 -1
  261. package/dist/src/commands/docs.d.ts.map +0 -1
  262. package/dist/src/commands/docs.js.map +0 -1
  263. package/dist/src/commands/hub/index.d.ts.map +0 -1
  264. package/dist/src/commands/hub/index.js.map +0 -1
  265. package/dist/src/commands/init/wizard.d.ts.map +0 -1
  266. package/dist/src/commands/init/wizard.js.map +0 -1
  267. package/dist/src/commands/init.d.ts.map +0 -1
  268. package/dist/src/commands/init.js.map +0 -1
  269. package/dist/src/commands/install-shim.d.ts.map +0 -1
  270. package/dist/src/commands/install-shim.js.map +0 -1
  271. package/dist/src/commands/local/auth-provision.d.ts.map +0 -1
  272. package/dist/src/commands/local/auth-provision.js.map +0 -1
  273. package/dist/src/commands/local/dev-local.d.ts.map +0 -1
  274. package/dist/src/commands/local/dev-local.js.map +0 -1
  275. package/dist/src/commands/local/docker-runner.d.ts.map +0 -1
  276. package/dist/src/commands/local/docker-runner.js.map +0 -1
  277. package/dist/src/commands/local/helpers.d.ts.map +0 -1
  278. package/dist/src/commands/local/helpers.js.map +0 -1
  279. package/dist/src/commands/local/hub-local.d.ts.map +0 -1
  280. package/dist/src/commands/local/hub-local.js.map +0 -1
  281. package/dist/src/commands/local/index.d.ts.map +0 -1
  282. package/dist/src/commands/local/index.js.map +0 -1
  283. package/dist/src/commands/local/mocks.d.ts.map +0 -1
  284. package/dist/src/commands/local/mocks.js.map +0 -1
  285. package/dist/src/commands/local/seed-hub-catalog.d.ts.map +0 -1
  286. package/dist/src/commands/local/seed-hub-catalog.js.map +0 -1
  287. package/dist/src/commands/local/seed-zitadel.d.ts.map +0 -1
  288. package/dist/src/commands/local/seed-zitadel.js.map +0 -1
  289. package/dist/src/commands/local/seed.d.ts.map +0 -1
  290. package/dist/src/commands/local/seed.js.map +0 -1
  291. package/dist/src/commands/local/stack.d.ts.map +0 -1
  292. package/dist/src/commands/local/stack.js.map +0 -1
  293. package/dist/src/commands/login.d.ts.map +0 -1
  294. package/dist/src/commands/login.js.map +0 -1
  295. package/dist/src/commands/peer-addressing.d.ts.map +0 -1
  296. package/dist/src/commands/peer-addressing.js.map +0 -1
  297. package/dist/src/commands/port-ownership.d.ts.map +0 -1
  298. package/dist/src/commands/port-ownership.js.map +0 -1
  299. package/dist/src/commands/registry-publish.d.ts.map +0 -1
  300. package/dist/src/commands/registry-publish.js.map +0 -1
  301. package/dist/src/commands/registry.d.ts.map +0 -1
  302. package/dist/src/commands/registry.js.map +0 -1
  303. package/dist/src/commands/secrets/exec.d.ts.map +0 -1
  304. package/dist/src/commands/secrets/exec.js.map +0 -1
  305. package/dist/src/commands/secrets/index.d.ts.map +0 -1
  306. package/dist/src/commands/secrets/index.js.map +0 -1
  307. package/dist/src/commands/secrets/migrate-config.d.ts.map +0 -1
  308. package/dist/src/commands/secrets/migrate-config.js.map +0 -1
  309. package/dist/src/commands/secrets/reindex.d.ts.map +0 -1
  310. package/dist/src/commands/secrets/reindex.js.map +0 -1
  311. package/dist/src/commands/secrets/set.d.ts.map +0 -1
  312. package/dist/src/commands/secrets/set.js.map +0 -1
  313. package/dist/src/commands/site.d.ts.map +0 -1
  314. package/dist/src/commands/site.js.map +0 -1
  315. package/dist/src/commands/skills.d.ts.map +0 -1
  316. package/dist/src/commands/skills.js.map +0 -1
  317. package/dist/src/commands/stack.d.ts.map +0 -1
  318. package/dist/src/commands/stack.js.map +0 -1
  319. package/dist/src/commands/temporal.d.ts.map +0 -1
  320. package/dist/src/commands/tenant.d.ts.map +0 -1
  321. package/dist/src/commands/tenant.js.map +0 -1
  322. package/dist/src/commands/tunnel/index.d.ts.map +0 -1
  323. package/dist/src/commands/tunnel/index.js.map +0 -1
  324. package/dist/src/commands/vcs/clone.d.ts.map +0 -1
  325. package/dist/src/commands/vcs/clone.js.map +0 -1
  326. package/dist/src/commands/vcs/common.d.ts.map +0 -1
  327. package/dist/src/commands/vcs/common.js.map +0 -1
  328. package/dist/src/commands/vcs/drafts.d.ts.map +0 -1
  329. package/dist/src/commands/vcs/drafts.js.map +0 -1
  330. package/dist/src/commands/vcs/get.d.ts.map +0 -1
  331. package/dist/src/commands/vcs/get.js.map +0 -1
  332. package/dist/src/commands/vcs/index.d.ts.map +0 -1
  333. package/dist/src/commands/vcs/index.js.map +0 -1
  334. package/dist/src/commands/vcs/propose.d.ts.map +0 -1
  335. package/dist/src/commands/vcs/propose.js.map +0 -1
  336. package/dist/src/commands/vcs/review.d.ts.map +0 -1
  337. package/dist/src/commands/vcs/review.js.map +0 -1
  338. package/dist/src/commands/vcs/rm.d.ts.map +0 -1
  339. package/dist/src/commands/vcs/rm.js.map +0 -1
  340. package/dist/src/commands/vcs-enrich.d.ts.map +0 -1
  341. package/dist/src/commands/vcs-enrich.js.map +0 -1
  342. package/dist/src/commands/vpn/index.d.ts.map +0 -1
  343. package/dist/src/commands/vpn/index.js.map +0 -1
  344. package/dist/src/commands/vpn/tunnel.d.ts.map +0 -1
  345. package/dist/src/commands/vpn/tunnel.js.map +0 -1
  346. package/dist/src/commands/workflow.d.ts.map +0 -1
  347. package/dist/src/commands/workflow.js.map +0 -1
  348. package/dist/src/docs/assemble.d.ts.map +0 -1
  349. package/dist/src/docs/assemble.js.map +0 -1
  350. package/dist/src/docs/cli-reference.d.ts.map +0 -1
  351. package/dist/src/docs/cli-reference.js.map +0 -1
  352. package/dist/src/docs/discover.d.ts.map +0 -1
  353. package/dist/src/docs/discover.js.map +0 -1
  354. package/dist/src/docs/portal.d.ts.map +0 -1
  355. package/dist/src/docs/portal.js.map +0 -1
  356. package/dist/src/docs/registry-docs.d.ts.map +0 -1
  357. package/dist/src/docs/registry-docs.js.map +0 -1
  358. package/dist/src/docs/schema.d.ts.map +0 -1
  359. package/dist/src/docs/schema.js.map +0 -1
  360. package/dist/src/docs/serve.d.ts.map +0 -1
  361. package/dist/src/docs/serve.js.map +0 -1
  362. package/dist/src/docs/start.d.ts.map +0 -1
  363. package/dist/src/docs/start.js.map +0 -1
  364. package/dist/src/eval/agent-eval.d.mts.map +0 -1
  365. package/dist/src/eval/agent-eval.mjs.map +0 -1
  366. package/dist/src/index.d.ts.map +0 -1
  367. package/dist/src/program.d.ts.map +0 -1
  368. package/dist/src/program.js.map +0 -1
  369. package/dist/src/utils/auth-preflight.d.ts.map +0 -1
  370. package/dist/src/utils/auth-preflight.js.map +0 -1
  371. package/dist/src/utils/aws-auth.d.ts.map +0 -1
  372. package/dist/src/utils/aws-auth.js.map +0 -1
  373. package/dist/src/utils/bastion.d.ts.map +0 -1
  374. package/dist/src/utils/bastion.js.map +0 -1
  375. package/dist/src/utils/build-info.d.ts.map +0 -1
  376. package/dist/src/utils/build-info.js.map +0 -1
  377. package/dist/src/utils/cache-home.d.ts.map +0 -1
  378. package/dist/src/utils/cache-home.js.map +0 -1
  379. package/dist/src/utils/capture-history.d.ts.map +0 -1
  380. package/dist/src/utils/capture-history.js.map +0 -1
  381. package/dist/src/utils/context.d.ts.map +0 -1
  382. package/dist/src/utils/context.js.map +0 -1
  383. package/dist/src/utils/credentials.d.ts.map +0 -1
  384. package/dist/src/utils/credentials.js.map +0 -1
  385. package/dist/src/utils/deploy-preflight.d.ts.map +0 -1
  386. package/dist/src/utils/deploy-preflight.js.map +0 -1
  387. package/dist/src/utils/errors.d.ts.map +0 -1
  388. package/dist/src/utils/errors.js.map +0 -1
  389. package/dist/src/utils/first-party-contexts.d.ts.map +0 -1
  390. package/dist/src/utils/first-party-contexts.js.map +0 -1
  391. package/dist/src/utils/index.d.ts.map +0 -1
  392. package/dist/src/utils/index.js.map +0 -1
  393. package/dist/src/utils/kubeconfig.d.ts.map +0 -1
  394. package/dist/src/utils/kubeconfig.js.map +0 -1
  395. package/dist/src/utils/log.d.ts.map +0 -1
  396. package/dist/src/utils/log.js.map +0 -1
  397. package/dist/src/utils/mesh-json.d.ts.map +0 -1
  398. package/dist/src/utils/mesh-json.js.map +0 -1
  399. package/dist/src/utils/pid.d.ts.map +0 -1
  400. package/dist/src/utils/pid.js.map +0 -1
  401. package/dist/src/utils/pulumi-run.d.ts.map +0 -1
  402. package/dist/src/utils/pulumi-run.js.map +0 -1
  403. package/dist/src/utils/pulumi.d.ts.map +0 -1
  404. package/dist/src/utils/pulumi.js.map +0 -1
  405. package/dist/src/utils/reachability.d.ts.map +0 -1
  406. package/dist/src/utils/reachability.js.map +0 -1
  407. package/dist/src/utils/recover-conversation.d.ts.map +0 -1
  408. package/dist/src/utils/recover-conversation.js.map +0 -1
  409. package/dist/src/utils/registry-broker.d.ts.map +0 -1
  410. package/dist/src/utils/registry-broker.js.map +0 -1
  411. package/dist/src/utils/registry-identity.d.ts.map +0 -1
  412. package/dist/src/utils/registry-identity.js.map +0 -1
  413. package/dist/src/utils/scaffold-versions.d.ts.map +0 -1
  414. package/dist/src/utils/scaffold-versions.js.map +0 -1
  415. package/dist/src/utils/socks-forward.d.ts.map +0 -1
  416. package/dist/src/utils/socks-forward.js.map +0 -1
  417. package/dist/src/utils/stack-flag.d.ts.map +0 -1
  418. package/dist/src/utils/stack-flag.js.map +0 -1
  419. package/dist/src/utils/tailscale-targets.d.ts.map +0 -1
  420. package/dist/src/utils/tailscale-targets.js.map +0 -1
  421. package/dist/src/utils/tailscale.d.ts.map +0 -1
  422. package/dist/src/utils/tailscale.js.map +0 -1
  423. package/dist/src/utils/temporal-auth.d.ts.map +0 -1
  424. package/dist/src/utils/temporal-auth.js.map +0 -1
  425. package/dist/src/utils/temporal-codec.d.ts.map +0 -1
  426. package/dist/src/utils/tunnel-ownership.d.ts.map +0 -1
  427. package/dist/src/utils/tunnel-ownership.js.map +0 -1
  428. package/dist/src/utils/vpn-join.d.ts.map +0 -1
  429. package/dist/src/utils/vpn-join.js.map +0 -1
  430. package/dist/src/utils/vpn.d.ts.map +0 -1
  431. package/dist/src/utils/vpn.js.map +0 -1
  432. package/dist/src/utils/workflow-fingerprint.d.ts.map +0 -1
  433. package/dist/src/utils/workflow-fingerprint.js.map +0 -1
  434. package/dist/src/utils/worktree-identity.d.ts.map +0 -1
  435. package/dist/src/utils/worktree-identity.js.map +0 -1
@@ -1,15 +1,3 @@
1
- /**
2
- * First-boot seeding for the `mesh start` local platform.
3
- *
4
- * Registers tenant `local` / env `dev` in the local AWS fabric's (ministack)
5
- * SSM registry with the same shape TenantEnvironments writes in the cloud
6
- * (/mesh-platform/{tenant}/{env}/app-tenants → TenantEnvironmentsExports), and
7
- * creates the tenant artifacts bucket. Idempotent — parameters are overwritten,
8
- * the bucket create tolerates "already owned by you".
9
- *
10
- * Zitadel org/project/CLI-app + test-user seeding (the `mesh login local`
11
- * path) is tracked as a follow-up on the mesh start epic.
12
- */
13
1
  import { logInfo, logSuccess } from "../../utils/log.js";
14
2
  import { MeshCliError } from "../../utils/errors.js";
15
3
  export const LOCAL_TENANT = "local";
@@ -17,21 +5,8 @@ export const LOCAL_ENV = "dev";
17
5
  export const LOCAL_AWS_ENDPOINT = "http://localhost:4566";
18
6
  export const LOCAL_AWS_REGION = "us-east-2";
19
7
  export const ARTIFACTS_BUCKET = "mesh-local-artifacts";
20
- /**
21
- * General-purpose local data bucket for pipeline development. A `mesh dev
22
- * --local` session inherits `AWS_ENDPOINT_URL`, so a pipeline's S3 resource
23
- * (a Dagster pipes-message reader, a sample-input loader) pointed at this
24
- * bucket round-trips against ministack with no AWS account. Seeded with a
25
- * sample pipes fragment under `samples/` so a fresh stack has something to
26
- * materialize from.
27
- */
28
8
  export const DATA_BUCKET = "mesh-local-data";
29
9
  export const APP_TENANTS_PARAM = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/app-tenants`;
30
- /**
31
- * Objects written into `DATA_BUCKET` on first boot. Deliberately tiny and
32
- * schema-neutral: enough for a sample pipeline to read, assemble, and write —
33
- * app repos ship their own realistic fixtures.
34
- */
35
10
  const DATA_BUCKET_SEEDS = [
36
11
  {
37
12
  key: "samples/pipes/fragment-0001.json",
@@ -50,14 +25,6 @@ export const LOCAL_AWS_CONFIG = {
50
25
  credentials: { accessKeyId: "test", secretAccessKey: "test" },
51
26
  };
52
27
  const AWS_CONFIG = LOCAL_AWS_CONFIG;
53
- /**
54
- * Env vars that point any AWS SDK process on the host at the local fabric —
55
- * the SDK-native endpoint override (AWS_ENDPOINT_URL, supported since SDK JS
56
- * v3 ~3.428), so no client-code changes are needed. `mesh dev` local mode
57
- * injects these into app processes; humans can `eval` them from the
58
- * `mesh start` output. In-network services get the same wiring with
59
- * http://ministack:4566 (see the compose file's x-local-aws-env anchor).
60
- */
61
28
  export function localAwsEnv() {
62
29
  return {
63
30
  AWS_ENDPOINT_URL: LOCAL_AWS_ENDPOINT,
@@ -66,12 +33,6 @@ export function localAwsEnv() {
66
33
  AWS_SECRET_ACCESS_KEY: "test",
67
34
  };
68
35
  }
69
- /**
70
- * The local tenant registration, shaped like TenantEnvironmentsExports
71
- * (libs/infra-components …/platform/TenantEnvironments.ts) so consumers of the
72
- * registry (Hub API, init checks) read local and cloud identically. AWS-only
73
- * fields carry inert local placeholders.
74
- */
75
36
  export function buildAppTenantsSeed() {
76
37
  const tenantExport = {
77
38
  albGroupName: LOCAL_TENANT,
@@ -96,24 +57,11 @@ export function buildAppTenantsSeed() {
96
57
  };
97
58
  }
98
59
  export const FABRIC_CHECK_PATH = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/.fabric-check`;
99
- /** The tenant's Temporal namespace, matching the cloud convention
100
- * TemporalNamespaceProvisioner uses ({tenant}-{env}, e.g. "acme-dev"). */
101
60
  export const TEMPORAL_NAMESPACE = `${LOCAL_TENANT}-${LOCAL_ENV}`;
102
61
  export const TEMPORAL_ADDRESS = "localhost:7233";
103
- /**
104
- * Register the local tenant's Temporal namespace ({tenant}-{env} — the same
105
- * name TemporalNamespaceProvisioner would create in the cloud). Idempotent:
106
- * "already exists" is success. Dynamic import — @temporalio/client is an
107
- * optionalDependency (same pattern as commands/temporal.ts).
108
- */
109
62
  export async function seedTemporalNamespace() {
110
63
  await ensureTemporalNamespace(TEMPORAL_NAMESPACE, `Mesh local tenant '${LOCAL_TENANT}' env '${LOCAL_ENV}' (seeded by mesh start)`);
111
64
  }
112
- /**
113
- * Idempotently register a Temporal namespace. `mesh dev --local` uses this
114
- * for the per-app namespaces ({tenant}-{env}-{app}) the cloud provisioner
115
- * creates — the Hub's per-app workflow views resolve exactly that name.
116
- */
117
65
  export async function ensureTemporalNamespace(namespace, description) {
118
66
  const { Connection } = await import("@temporalio/client");
119
67
  const connection = await Connection.connect({ address: TEMPORAL_ADDRESS });
@@ -121,13 +69,8 @@ export async function ensureTemporalNamespace(namespace, description) {
121
69
  await connection.workflowService.registerNamespace({
122
70
  namespace,
123
71
  description: description ?? `Mesh local namespace '${namespace}'`,
124
- // protobufjs accepts plain numbers for int64 at runtime; the generated
125
- // typing insists on Long (whose package isn't a direct dep), hence any.
126
72
  workflowExecutionRetentionPeriod: { seconds: (3 * 24 * 60 * 60) },
127
73
  });
128
- // A freshly registered namespace isn't usable until the frontend's
129
- // namespace cache refreshes (~10s) — a worker connecting immediately
130
- // would die on "Namespace not found". Wait it out once, here.
131
74
  logInfo(`Registered Temporal namespace '${namespace}' — waiting for it to become active…`);
132
75
  const deadline = Date.now() + 20_000;
133
76
  while (Date.now() < deadline) {
@@ -157,24 +100,11 @@ export async function ensureTemporalNamespace(namespace, description) {
157
100
  await connection.close();
158
101
  }
159
102
  }
160
- /**
161
- * A deterministic >4 KB payload for the Advanced-tier round-trip. Standard
162
- * SSM params cap at 4 KB; mesh.exports.Export writes tier "Advanced" values
163
- * up to 8 KB (Export.ts), and the emulator's fidelity there is the one open
164
- * question the design (§2.5) requires this check to answer on every boot.
165
- */
166
103
  export function buildFabricCheckPayload(targetBytes = 8_000) {
167
104
  const base = { probe: "advanced-tier-round-trip", tenant: LOCAL_TENANT, env: LOCAL_ENV, pad: "" };
168
105
  const overhead = JSON.stringify(base).length;
169
106
  return JSON.stringify({ ...base, pad: "x".repeat(Math.max(0, targetBytes - overhead)) });
170
107
  }
171
- /**
172
- * Verify the local AWS fabric behaves like real SSM where the platform
173
- * depends on it: an 8 KB Advanced-tier parameter round-trips intact, and
174
- * child parameters under a path come back via GetParametersByPath (the
175
- * shape mesh.exports.Export's splitKeys mode reads). Check params are
176
- * removed afterwards.
177
- */
178
108
  export async function verifyFabric() {
179
109
  const { SSMClient, PutParameterCommand, GetParameterCommand, GetParametersByPathCommand, DeleteParametersCommand } = await import("@aws-sdk/client-ssm");
180
110
  const ssm = new SSMClient(AWS_CONFIG);
@@ -218,9 +148,6 @@ export async function verifyFabric() {
218
148
  .catch(() => { });
219
149
  }
220
150
  }
221
- /** Write the Hub-readable tenant + environment registrations (the shapes
222
- * hub-api's SSM assembler requires: RawTenant at /{tenant}, RawEnvironment
223
- * at /{tenant}/{env}). Exported for reuse by app-tenant provisioning. */
224
151
  export async function registerTenantEnv(tenant, opts = {}) {
225
152
  const { SSMClient, PutParameterCommand } = await import("@aws-sdk/client-ssm");
226
153
  const ssm = new SSMClient(AWS_CONFIG);
@@ -239,8 +166,6 @@ export async function registerTenantEnv(tenant, opts = {}) {
239
166
  env: LOCAL_ENV,
240
167
  region: LOCAL_AWS_REGION,
241
168
  baseDomain: "localhost",
242
- // monitoring is true: the local stack runs the same Loki/Tempo/
243
- // Prometheus backends the hosted platform provides.
244
169
  services: { temporal: true, zitadel: true, monitoring: true },
245
170
  }),
246
171
  Description: `Environment registration (seeded by mesh CLI, local platform)`,
@@ -274,8 +199,6 @@ export async function seedLocalPlatform() {
274
199
  }
275
200
  }
276
201
  }
277
- // Sample fixtures — PutObject overwrites, so reseeding a live stack is a
278
- // no-op in effect and a fresh stack always has readable sample data.
279
202
  for (const seed of DATA_BUCKET_SEEDS) {
280
203
  await s3.send(new PutObjectCommand({
281
204
  Bucket: DATA_BUCKET,
@@ -288,4 +211,3 @@ export async function seedLocalPlatform() {
288
211
  await seedTemporalNamespace();
289
212
  return { parameter: APP_TENANTS_PARAM, bucket: ARTIFACTS_BUCKET };
290
213
  }
291
- //# sourceMappingURL=seed.js.map
@@ -1,60 +1,17 @@
1
- /**
2
- * Helpers for the `mesh start/stop/status` full-local platform stack.
3
- *
4
- * The docker compose project (name `mesh-local`) ships inside the CLI package
5
- * at `<package root>/stack/`, so the stack works in any repo with only Docker
6
- * installed and is version-locked to the CLI.
7
- */
8
1
  export declare const COMPOSE_PROJECT = "mesh-local";
9
- /**
10
- * Host directory `mesh dev --local` writes service logs into
11
- * ({namespace}/{service}.log). The stack's OTel collector tails it (filelog
12
- * receiver) and ships to Loki with the hosted k8s_* label scheme, so the
13
- * Hub's logs view works on local runs unchanged.
14
- */
15
2
  export declare function localLogsDir(): string;
16
- /**
17
- * Host directory holding blackbox probe targets (Prometheus file_sd JSON) —
18
- * written by `mesh dev --externals` for external services, mounted into the
19
- * stack's Prometheus. The local analog of the hosted Probe CRs.
20
- */
21
3
  export declare function localProbesDir(): string;
22
- /**
23
- * Register the app's OWN services as blackbox probe targets.
24
- *
25
- * Uptime in the Hub has three sources: blackbox probes, Kubernetes pod
26
- * readiness, and external-service probes. Locally the middle one cannot exist —
27
- * `mesh dev --local` runs services as host processes, not Deployments, so
28
- * kube-state-metrics has nothing to report — and nothing used to register the
29
- * host processes with blackbox either. The result was an app that is plainly
30
- * running and shows no uptime at all, which reads as a broken panel rather than
31
- * an unmonitored one.
32
- *
33
- * The labels match what `ExternalService` already emits (`tenant`/`env`/`app`),
34
- * because that is what the Hub's scoped discovery query selects on. `target` is
35
- * the service name, which is how the Hub names the row.
36
- *
37
- * Targets use `host.docker.internal` — Prometheus and blackbox run inside the
38
- * stack's network and reach host processes only through that name.
39
- *
40
- * Returns the file written, for the session to remove on `--kill`; a stale probe
41
- * would otherwise report a service down long after its session ended.
42
- */
43
4
  export declare function writeAppServiceProbes(args: {
44
5
  tenant: string;
45
6
  env: string;
46
7
  app: string;
47
- /** Service name → host port. Mock stand-ins are the caller's to exclude. */
48
8
  services: Record<string, number>;
49
- /** Health path every service exposes. */
50
9
  healthPath?: string;
51
10
  }): string | undefined;
52
- /** Endpoints the local stack exposes on the host. */
53
11
  export interface StackEndpoint {
54
12
  service: string;
55
13
  label: string;
56
14
  url: string;
57
- /** How `mesh status` probes it from the host */
58
15
  probe: {
59
16
  kind: "http";
60
17
  url: string;
@@ -64,94 +21,26 @@ export interface StackEndpoint {
64
21
  } | {
65
22
  kind: "none";
66
23
  };
67
- /** Extra hint printed under the endpoint (credentials, tokens, …) */
68
24
  hint?: string;
69
25
  }
70
26
  export declare const STACK_ENDPOINTS: StackEndpoint[];
71
- /** Default host port for the containerized local Hub. `mesh hub dev` derives
72
- * its dev-server default from this too (hub/index.ts), so the two Hubs share
73
- * one source for "9000" while keeping separate override variables
74
- * (MESH_HUB_PORT here, MESH_HUB_DEV_PORT there). */
75
27
  export declare const DEFAULT_HUB_PORT = "9000";
76
- /**
77
- * Host port the Hub is published on (docker-compose.hub.yml binds
78
- * `${MESH_HUB_PORT:-9000}:4180`). Override with MESH_HUB_PORT to run the
79
- * local Hub beside another process that owns 9000 — e.g. a hub-ui dev
80
- * server running from a different checkout. Export it for BOTH `mesh start`
81
- * and later `mesh status` calls: the compose file and these probes read the
82
- * same variable (MESH-2256 tracks deriving it from the running stack so
83
- * `mesh status` stops depending on shell hygiene). `mesh start` reconciles
84
- * the seeded Zitadel Hub app's redirect URIs to include the chosen port —
85
- * Zitadel requires every redirect URI to be registered even in devMode
86
- * (devMode only allows http).
87
- *
88
- * Empty string falls back like compose's `${MESH_HUB_PORT:-9000}` does —
89
- * `??` alone would diverge (probe `:`, publish 9000).
90
- */
91
28
  export declare function hubPort(): string;
92
- /** Hub overlay endpoints — probed only when the hub containers exist.
93
- * A function (not a module constant) so hubPort() is read at call time:
94
- * the CLI's env is fixed before node starts, but tests and programmatic
95
- * callers set MESH_HUB_PORT after import. */
96
29
  export declare function hubEndpoints(): StackEndpoint[];
97
- /**
98
- * Locate the CLI package root (the directory whose package.json is
99
- * @mesh-tech/mesh-cli). Works from both the compiled layout (dist/src/…)
100
- * and the source layout (src/… under tsx).
101
- */
102
30
  export declare function findPackageRoot(startDir?: string): string;
103
31
  export declare function stackDir(): string;
104
- /** The compose overlay that declares the Hub services. */
105
32
  export declare const HUB_OVERLAY_FILE = "docker-compose.hub.yml";
106
- /** Top-level service names a compose file declares. Pure — takes the file text. */
107
33
  export declare function parseComposeServiceNames(yamlText: string): string[];
108
- /**
109
- * The services the Hub overlay — and only the overlay — declares.
110
- *
111
- * Read from `docker-compose.hub.yml` rather than hard-coded beside
112
- * ONE_SHOT_SERVICES on purpose: a second name list rots the moment the
113
- * overlay gains or renames a service. (It already declares three — hub-api,
114
- * hub-ui, hub-auth — not the two the Hub is usually described by.)
115
- */
116
34
  export declare function hubOverlayServices(): ReadonlySet<string>;
117
- /**
118
- * The compose project is a MACHINE-WIDE singleton (`mesh-local`), but any
119
- * checkout of the CLI can drive it — and `docker compose up` from a checkout
120
- * whose stack config differs will recreate shared containers out from under
121
- * whatever else is running against the stack (a second project's `mesh dev`
122
- * session, a Hub built from another worktree, …).
123
- *
124
- * Returns the working dir of the checkout that last (re)created the running
125
- * stack when it is NOT this one; undefined when the stack isn't running or
126
- * is already owned here. Callers gate lifecycle commands on it.
127
- */
128
35
  export declare function stackOwnedElsewhere(): string | undefined;
129
- /** Throw a remediated error if the docker daemon isn't reachable. */
130
36
  export declare function ensureDockerAvailable(): void;
131
- /** Run `docker compose` against the packaged stack. `hub` adds the Hub
132
- * overlay file (safe for ps/logs/down: services simply may not exist);
133
- * `env` adds process-env overrides (e.g. MESH_HUB_VERSION). */
134
37
  export declare function compose(args: string[], opts?: {
135
38
  inherit?: boolean;
136
39
  hub?: boolean;
137
40
  env?: Record<string, string>;
138
41
  }): string;
139
- /**
140
- * Pick the one line worth reading out of a failed compose run's output:
141
- * the last error-looking line, else the last non-empty line (MESH-2479).
142
- * Pure so the selection heuristic is unit-testable.
143
- */
144
42
  export declare function summarizeComposeFailure(output: string): string;
145
- /** Where a lifecycle command's full compose output is written (per operation). */
146
43
  export declare function composeLogPath(op: string): string;
147
- /**
148
- * `docker compose` for lifecycle commands (`up -d`): stream output like
149
- * `compose({inherit: true})` does, but never bury the failure — on a non-zero
150
- * exit throw a one-line summary instead of leaving ~200 lines of pull/create
151
- * noise as the only signal (MESH-2479). In non-TTY runs the output is also
152
- * teed to a log file (named in the error) and a heartbeat fills long quiet
153
- * stretches; interactive terminals keep docker's own progress rendering.
154
- */
155
44
  export declare function composeStreamed(args: string[], opts?: {
156
45
  hub?: boolean;
157
46
  env?: Record<string, string>;
@@ -161,43 +50,13 @@ export interface ServiceStatus {
161
50
  state: string;
162
51
  health?: string;
163
52
  }
164
- /** Parse `docker compose ps --format json` (NDJSON, one object per line). */
165
53
  export declare function parseComposePs(output: string): ServiceStatus[];
166
54
  export declare function stackServices(): ServiceStatus[];
167
- /** Services expected to exit (one-shot jobs) — an `exited` state is fine. */
168
55
  export declare const ONE_SHOT_SERVICES: Set<string>;
169
- /**
170
- * The services whose `exited` state is a real failure *right now*.
171
- *
172
- * `stackServices()` scans the whole `mesh-local` compose project, overlay
173
- * included — but `mesh start` brings the base stack up first and the Hub
174
- * overlay only afterwards. Before that point an `exited` hub container is a
175
- * leftover from a previous run (a Docker restart, a laptop sleep), not a
176
- * crash: the base `up -d` deliberately never started it. Counting it made
177
- * `mesh start` abort before it ever tried to start the Hub, pointing at the
178
- * wrong thing.
179
- *
180
- * Once the overlay HAS been started, an exited overlay service is a crash
181
- * like any other — pass `overlayStarted: true` and the signal is preserved.
182
- */
183
56
  export declare function crashedServices(services: ServiceStatus[], opts: {
184
57
  overlayServices: ReadonlySet<string>;
185
58
  overlayStarted: boolean;
186
59
  }): ServiceStatus[];
187
- /**
188
- * Whether the Hub overlay is up in this run — i.e. at least one overlay
189
- * container is actually `running`. `mesh status` has no other way to know
190
- * (it never started anything), and "a container exists" is not it: a
191
- * leftover `exited` one exists too.
192
- */
193
60
  export declare function hubOverlayRunning(services: ServiceStatus[], overlayServices: ReadonlySet<string>): boolean;
194
- /**
195
- * Whether the Hub API is serving. `some(s => s.name === "hub-api")` is not
196
- * the same question — that is true of a leftover exited container, and
197
- * probing Hub endpoints that were never meant to be up this run reports the
198
- * stack unhealthy for a Hub nobody started.
199
- */
200
61
  export declare function hubApiRunning(services: ServiceStatus[]): boolean;
201
- /** Probe a host endpoint (http 2xx-4xx counts as up; tcp connect counts as up). */
202
62
  export declare function probeEndpoint(endpoint: StackEndpoint): Promise<boolean>;
203
- //# sourceMappingURL=stack.d.ts.map
@@ -1,10 +1,3 @@
1
- /**
2
- * Helpers for the `mesh start/stop/status` full-local platform stack.
3
- *
4
- * The docker compose project (name `mesh-local`) ships inside the CLI package
5
- * at `<package root>/stack/`, so the stack works in any repo with only Docker
6
- * installed and is version-locked to the CLI.
7
- */
8
1
  import { execFileSync, spawn, spawnSync } from "child_process";
9
2
  import * as fs from "fs";
10
3
  import { probeTcp } from "./helpers.js";
@@ -15,44 +8,12 @@ import { meshCacheDir } from "../../utils/cache-home.js";
15
8
  import { MeshCliError } from "../../utils/errors.js";
16
9
  import { startHeartbeat } from "../../utils/log.js";
17
10
  export const COMPOSE_PROJECT = "mesh-local";
18
- /**
19
- * Host directory `mesh dev --local` writes service logs into
20
- * ({namespace}/{service}.log). The stack's OTel collector tails it (filelog
21
- * receiver) and ships to Loki with the hosted k8s_* label scheme, so the
22
- * Hub's logs view works on local runs unchanged.
23
- */
24
11
  export function localLogsDir() {
25
12
  return meshCacheDir("mesh-local", "logs");
26
13
  }
27
- /**
28
- * Host directory holding blackbox probe targets (Prometheus file_sd JSON) —
29
- * written by `mesh dev --externals` for external services, mounted into the
30
- * stack's Prometheus. The local analog of the hosted Probe CRs.
31
- */
32
14
  export function localProbesDir() {
33
15
  return meshCacheDir("mesh-local", "probes");
34
16
  }
35
- /**
36
- * Register the app's OWN services as blackbox probe targets.
37
- *
38
- * Uptime in the Hub has three sources: blackbox probes, Kubernetes pod
39
- * readiness, and external-service probes. Locally the middle one cannot exist —
40
- * `mesh dev --local` runs services as host processes, not Deployments, so
41
- * kube-state-metrics has nothing to report — and nothing used to register the
42
- * host processes with blackbox either. The result was an app that is plainly
43
- * running and shows no uptime at all, which reads as a broken panel rather than
44
- * an unmonitored one.
45
- *
46
- * The labels match what `ExternalService` already emits (`tenant`/`env`/`app`),
47
- * because that is what the Hub's scoped discovery query selects on. `target` is
48
- * the service name, which is how the Hub names the row.
49
- *
50
- * Targets use `host.docker.internal` — Prometheus and blackbox run inside the
51
- * stack's network and reach host processes only through that name.
52
- *
53
- * Returns the file written, for the session to remove on `--kill`; a stale probe
54
- * would otherwise report a service down long after its session ended.
55
- */
56
17
  export function writeAppServiceProbes(args) {
57
18
  const entries = Object.entries(args.services);
58
19
  if (entries.length === 0)
@@ -168,26 +129,7 @@ export const STACK_ENDPOINTS = [
168
129
  probe: { kind: "http", url: "http://localhost:9200" },
169
130
  },
170
131
  ];
171
- /** Default host port for the containerized local Hub. `mesh hub dev` derives
172
- * its dev-server default from this too (hub/index.ts), so the two Hubs share
173
- * one source for "9000" while keeping separate override variables
174
- * (MESH_HUB_PORT here, MESH_HUB_DEV_PORT there). */
175
132
  export const DEFAULT_HUB_PORT = "9000";
176
- /**
177
- * Host port the Hub is published on (docker-compose.hub.yml binds
178
- * `${MESH_HUB_PORT:-9000}:4180`). Override with MESH_HUB_PORT to run the
179
- * local Hub beside another process that owns 9000 — e.g. a hub-ui dev
180
- * server running from a different checkout. Export it for BOTH `mesh start`
181
- * and later `mesh status` calls: the compose file and these probes read the
182
- * same variable (MESH-2256 tracks deriving it from the running stack so
183
- * `mesh status` stops depending on shell hygiene). `mesh start` reconciles
184
- * the seeded Zitadel Hub app's redirect URIs to include the chosen port —
185
- * Zitadel requires every redirect URI to be registered even in devMode
186
- * (devMode only allows http).
187
- *
188
- * Empty string falls back like compose's `${MESH_HUB_PORT:-9000}` does —
189
- * `??` alone would diverge (probe `:`, publish 9000).
190
- */
191
133
  export function hubPort() {
192
134
  const raw = process.env.MESH_HUB_PORT?.trim();
193
135
  if (!raw)
@@ -199,10 +141,6 @@ export function hubPort() {
199
141
  }
200
142
  return raw;
201
143
  }
202
- /** Hub overlay endpoints — probed only when the hub containers exist.
203
- * A function (not a module constant) so hubPort() is read at call time:
204
- * the CLI's env is fixed before node starts, but tests and programmatic
205
- * callers set MESH_HUB_PORT after import. */
206
144
  export function hubEndpoints() {
207
145
  return [
208
146
  {
@@ -220,11 +158,6 @@ export function hubEndpoints() {
220
158
  },
221
159
  ];
222
160
  }
223
- /**
224
- * Locate the CLI package root (the directory whose package.json is
225
- * @mesh-tech/mesh-cli). Works from both the compiled layout (dist/src/…)
226
- * and the source layout (src/… under tsx).
227
- */
228
161
  export function findPackageRoot(startDir) {
229
162
  let dir = startDir ?? path.dirname(fileURLToPath(import.meta.url));
230
163
  for (let i = 0; i < 8; i++) {
@@ -236,7 +169,6 @@ export function findPackageRoot(startDir) {
236
169
  return dir;
237
170
  }
238
171
  catch {
239
- // unreadable package.json — keep walking
240
172
  }
241
173
  }
242
174
  const parent = path.dirname(dir);
@@ -257,22 +189,12 @@ export function stackDir() {
257
189
  }
258
190
  return dir;
259
191
  }
260
- /** The compose overlay that declares the Hub services. */
261
192
  export const HUB_OVERLAY_FILE = "docker-compose.hub.yml";
262
- /** Top-level service names a compose file declares. Pure — takes the file text. */
263
193
  export function parseComposeServiceNames(yamlText) {
264
194
  const doc = parseYaml(yamlText);
265
195
  return Object.keys(doc?.services ?? {});
266
196
  }
267
197
  let hubOverlayServicesCache;
268
- /**
269
- * The services the Hub overlay — and only the overlay — declares.
270
- *
271
- * Read from `docker-compose.hub.yml` rather than hard-coded beside
272
- * ONE_SHOT_SERVICES on purpose: a second name list rots the moment the
273
- * overlay gains or renames a service. (It already declares three — hub-api,
274
- * hub-ui, hub-auth — not the two the Hub is usually described by.)
275
- */
276
198
  export function hubOverlayServices() {
277
199
  if (!hubOverlayServicesCache) {
278
200
  const file = path.join(stackDir(), HUB_OVERLAY_FILE);
@@ -285,22 +207,7 @@ export function hubOverlayServices() {
285
207
  }
286
208
  return hubOverlayServicesCache;
287
209
  }
288
- /**
289
- * The compose project is a MACHINE-WIDE singleton (`mesh-local`), but any
290
- * checkout of the CLI can drive it — and `docker compose up` from a checkout
291
- * whose stack config differs will recreate shared containers out from under
292
- * whatever else is running against the stack (a second project's `mesh dev`
293
- * session, a Hub built from another worktree, …).
294
- *
295
- * Returns the working dir of the checkout that last (re)created the running
296
- * stack when it is NOT this one; undefined when the stack isn't running or
297
- * is already owned here. Callers gate lifecycle commands on it.
298
- */
299
210
  export function stackOwnedElsewhere() {
300
- // Fail-open by design: a stack that exists but is NOT running (`ps -q`
301
- // without -a) has nothing to disrupt, so `start` silently re-owns it; and
302
- // any docker/inspect hiccup disables the guard rather than blocking
303
- // legitimate lifecycle commands.
304
211
  try {
305
212
  const first = compose(["ps", "-q"]).trim().split("\n").filter(Boolean)[0];
306
213
  if (!first)
@@ -308,9 +215,6 @@ export function stackOwnedElsewhere() {
308
215
  const label = execFileSync("docker", ["inspect", first, "--format", '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}'], { encoding: "utf-8" }).trim();
309
216
  if (!label)
310
217
  return undefined;
311
- // realpath both sides: symlinked layouts (macOS /tmp → /private/tmp,
312
- // linked worktree parents) must not make the same physical dir compare
313
- // as foreign. Fall back to the raw path when realpath fails (dir gone).
314
218
  const real = (p) => {
315
219
  try {
316
220
  return fs.realpathSync(p);
@@ -325,7 +229,6 @@ export function stackOwnedElsewhere() {
325
229
  return undefined;
326
230
  }
327
231
  }
328
- /** Throw a remediated error if the docker daemon isn't reachable. */
329
232
  export function ensureDockerAvailable() {
330
233
  const probe = spawnSync("docker", ["info", "--format", "{{.ServerVersion}}"], {
331
234
  stdio: ["ignore", "pipe", "pipe"],
@@ -336,9 +239,6 @@ export function ensureDockerAvailable() {
336
239
  });
337
240
  }
338
241
  }
339
- /** Run `docker compose` against the packaged stack. `hub` adds the Hub
340
- * overlay file (safe for ps/logs/down: services simply may not exist);
341
- * `env` adds process-env overrides (e.g. MESH_HUB_VERSION). */
342
242
  export function compose(args, opts = {}) {
343
243
  const dir = stackDir();
344
244
  const files = ["-f", path.join(dir, "docker-compose.yml")];
@@ -348,11 +248,6 @@ export function compose(args, opts = {}) {
348
248
  return execFileSync("docker", fullArgs, {
349
249
  cwd: dir,
350
250
  encoding: "utf-8",
351
- // MESH_LOCAL_LOGS on every call: the compose file mounts it into the
352
- // OTel collector, and an unset variable would both warn and resolve to
353
- // a different mount (recreate churn between CLI and raw compose runs).
354
- // IGNORE_ORPHANS: base-only `up` calls would otherwise flag the hub
355
- // overlay's running containers as orphans.
356
251
  env: {
357
252
  ...process.env,
358
253
  MESH_LOCAL_LOGS: localLogsDir(),
@@ -363,11 +258,6 @@ export function compose(args, opts = {}) {
363
258
  stdio: opts.inherit ? ["ignore", "inherit", "inherit"] : ["ignore", "pipe", "pipe"],
364
259
  });
365
260
  }
366
- /**
367
- * Pick the one line worth reading out of a failed compose run's output:
368
- * the last error-looking line, else the last non-empty line (MESH-2479).
369
- * Pure so the selection heuristic is unit-testable.
370
- */
371
261
  export function summarizeComposeFailure(output) {
372
262
  const lines = output
373
263
  .split("\n")
@@ -377,19 +267,10 @@ export function summarizeComposeFailure(output) {
377
267
  const line = errorish.at(-1) ?? lines.at(-1) ?? "no output captured";
378
268
  return line.length > 300 ? `${line.slice(0, 297)}…` : line;
379
269
  }
380
- /** Where a lifecycle command's full compose output is written (per operation). */
381
270
  export function composeLogPath(op) {
382
271
  const dir = meshCacheDir("mesh-local");
383
272
  return path.join(dir, `compose-${op.replace(/[^a-z0-9-]/gi, "_")}.log`);
384
273
  }
385
- /**
386
- * `docker compose` for lifecycle commands (`up -d`): stream output like
387
- * `compose({inherit: true})` does, but never bury the failure — on a non-zero
388
- * exit throw a one-line summary instead of leaving ~200 lines of pull/create
389
- * noise as the only signal (MESH-2479). In non-TTY runs the output is also
390
- * teed to a log file (named in the error) and a heartbeat fills long quiet
391
- * stretches; interactive terminals keep docker's own progress rendering.
392
- */
393
274
  export async function composeStreamed(args, opts = {}) {
394
275
  const dir = stackDir();
395
276
  const files = ["-f", path.join(dir, "docker-compose.yml")];
@@ -446,8 +327,6 @@ export async function composeStreamed(args, opts = {}) {
446
327
  }
447
328
  finally {
448
329
  heartbeat.stop();
449
- // Flush the log file before any throw can reach handleCliError's
450
- // process.exit(), which doesn't wait for pending writes.
451
330
  await new Promise((resolve) => logStream.end(resolve));
452
331
  }
453
332
  if (exitCode !== 0) {
@@ -459,7 +338,6 @@ export async function composeStreamed(args, opts = {}) {
459
338
  });
460
339
  }
461
340
  }
462
- /** Parse `docker compose ps --format json` (NDJSON, one object per line). */
463
341
  export function parseComposePs(output) {
464
342
  const services = [];
465
343
  for (const line of output.split("\n")) {
@@ -475,55 +353,25 @@ export function parseComposePs(output) {
475
353
  });
476
354
  }
477
355
  catch {
478
- // non-JSON noise from docker — skip
479
356
  }
480
357
  }
481
358
  return services;
482
359
  }
483
360
  export function stackServices() {
484
- // Include the hub overlay so its containers show up when running.
485
361
  return parseComposePs(compose(["ps", "-a", "--format", "json"], { hub: true }));
486
362
  }
487
- /** Services expected to exit (one-shot jobs) — an `exited` state is fine. */
488
363
  export const ONE_SHOT_SERVICES = new Set(["spicedb-migrate", "zitadel-machinekey-init"]);
489
- /**
490
- * The services whose `exited` state is a real failure *right now*.
491
- *
492
- * `stackServices()` scans the whole `mesh-local` compose project, overlay
493
- * included — but `mesh start` brings the base stack up first and the Hub
494
- * overlay only afterwards. Before that point an `exited` hub container is a
495
- * leftover from a previous run (a Docker restart, a laptop sleep), not a
496
- * crash: the base `up -d` deliberately never started it. Counting it made
497
- * `mesh start` abort before it ever tried to start the Hub, pointing at the
498
- * wrong thing.
499
- *
500
- * Once the overlay HAS been started, an exited overlay service is a crash
501
- * like any other — pass `overlayStarted: true` and the signal is preserved.
502
- */
503
364
  export function crashedServices(services, opts) {
504
365
  return services.filter((s) => s.state === "exited" &&
505
366
  !ONE_SHOT_SERVICES.has(s.name) &&
506
367
  (opts.overlayStarted || !opts.overlayServices.has(s.name)));
507
368
  }
508
- /**
509
- * Whether the Hub overlay is up in this run — i.e. at least one overlay
510
- * container is actually `running`. `mesh status` has no other way to know
511
- * (it never started anything), and "a container exists" is not it: a
512
- * leftover `exited` one exists too.
513
- */
514
369
  export function hubOverlayRunning(services, overlayServices) {
515
370
  return services.some((s) => overlayServices.has(s.name) && s.state === "running");
516
371
  }
517
- /**
518
- * Whether the Hub API is serving. `some(s => s.name === "hub-api")` is not
519
- * the same question — that is true of a leftover exited container, and
520
- * probing Hub endpoints that were never meant to be up this run reports the
521
- * stack unhealthy for a Hub nobody started.
522
- */
523
372
  export function hubApiRunning(services) {
524
373
  return services.some((s) => s.name === "hub-api" && s.state === "running");
525
374
  }
526
- /** Probe a host endpoint (http 2xx-4xx counts as up; tcp connect counts as up). */
527
375
  export async function probeEndpoint(endpoint) {
528
376
  if (endpoint.probe.kind === "http") {
529
377
  try {
@@ -539,4 +387,3 @@ export async function probeEndpoint(endpoint) {
539
387
  }
540
388
  return true;
541
389
  }
542
- //# sourceMappingURL=stack.js.map