@mesh-tech/mesh-cli 0.20.1 → 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 (436) hide show
  1. package/README.md +6 -5
  2. package/dist/bin/mesh.d.ts +0 -12
  3. package/dist/bin/mesh.js +99 -50
  4. package/dist/bin/mesh.js.map +2 -3
  5. package/dist/build-info.json +2 -2
  6. package/dist/src/commands/agent-api-client.d.ts +0 -70
  7. package/dist/src/commands/agent-api-client.js +0 -80
  8. package/dist/src/commands/app-check.d.ts +0 -56
  9. package/dist/src/commands/app-check.js +0 -72
  10. package/dist/src/commands/artifacts.d.ts +0 -11
  11. package/dist/src/commands/artifacts.js +0 -33
  12. package/dist/src/commands/cluster.d.ts +0 -39
  13. package/dist/src/commands/cluster.js +0 -73
  14. package/dist/src/commands/conversations.d.ts +0 -36
  15. package/dist/src/commands/conversations.js +0 -59
  16. package/dist/src/commands/create-app.d.ts +4 -88
  17. package/dist/src/commands/create-app.js +16 -155
  18. package/dist/src/commands/db/connect.d.ts +0 -7
  19. package/dist/src/commands/db/connect.js +0 -9
  20. package/dist/src/commands/db/credentials.d.ts +0 -7
  21. package/dist/src/commands/db/credentials.js +0 -10
  22. package/dist/src/commands/db/env.d.ts +0 -6
  23. package/dist/src/commands/db/env.js +0 -14
  24. package/dist/src/commands/db/exec.d.ts +0 -43
  25. package/dist/src/commands/db/exec.js +0 -69
  26. package/dist/src/commands/db/index.d.ts +0 -10
  27. package/dist/src/commands/db/index.js +0 -10
  28. package/dist/src/commands/db/psql.d.ts +0 -7
  29. package/dist/src/commands/db/psql.js +0 -18
  30. package/dist/src/commands/deploy.d.ts +0 -38
  31. package/dist/src/commands/deploy.js +1 -76
  32. package/dist/src/commands/dev-doctor.d.ts +0 -82
  33. package/dist/src/commands/dev-doctor.js +3 -132
  34. package/dist/src/commands/dev-launch.d.ts +0 -52
  35. package/dist/src/commands/dev-launch.js +0 -56
  36. package/dist/src/commands/dev-token-server.d.ts +0 -18
  37. package/dist/src/commands/dev-token-server.js +1 -24
  38. package/dist/src/commands/dev.d.ts +0 -246
  39. package/dist/src/commands/dev.js +5 -963
  40. package/dist/src/commands/docs.d.ts +0 -1
  41. package/dist/src/commands/docs.js +0 -12
  42. package/dist/src/commands/hub/index.d.ts +0 -60
  43. package/dist/src/commands/hub/index.js +2 -139
  44. package/dist/src/commands/init/wizard.d.ts +5 -116
  45. package/dist/src/commands/init/wizard.js +42 -110
  46. package/dist/src/commands/init.d.ts +0 -55
  47. package/dist/src/commands/init.js +0 -70
  48. package/dist/src/commands/install-shim.d.ts +0 -23
  49. package/dist/src/commands/install-shim.js +2 -29
  50. package/dist/src/commands/local/auth-provision.d.ts +0 -80
  51. package/dist/src/commands/local/auth-provision.js +0 -109
  52. package/dist/src/commands/local/dev-local.d.ts +0 -91
  53. package/dist/src/commands/local/dev-local.js +0 -147
  54. package/dist/src/commands/local/docker-runner.d.ts +0 -22
  55. package/dist/src/commands/local/docker-runner.js +2 -35
  56. package/dist/src/commands/local/helpers.d.ts +0 -14
  57. package/dist/src/commands/local/helpers.js +0 -13
  58. package/dist/src/commands/local/hub-local.d.ts +0 -96
  59. package/dist/src/commands/local/hub-local.js +0 -111
  60. package/dist/src/commands/local/index.d.ts +0 -14
  61. package/dist/src/commands/local/index.js +0 -86
  62. package/dist/src/commands/local/mocks.d.ts +0 -269
  63. package/dist/src/commands/local/mocks.js +1 -274
  64. package/dist/src/commands/local/seed-hub-catalog.d.ts +0 -25
  65. package/dist/src/commands/local/seed-hub-catalog.js +0 -41
  66. package/dist/src/commands/local/seed-zitadel.d.ts +0 -82
  67. package/dist/src/commands/local/seed-zitadel.js +0 -158
  68. package/dist/src/commands/local/seed.d.ts +0 -64
  69. package/dist/src/commands/local/seed.js +0 -78
  70. package/dist/src/commands/local/stack.d.ts +0 -141
  71. package/dist/src/commands/local/stack.js +0 -153
  72. package/dist/src/commands/login.d.ts +0 -265
  73. package/dist/src/commands/login.js +4 -418
  74. package/dist/src/commands/peer-addressing.d.ts +0 -39
  75. package/dist/src/commands/peer-addressing.js +0 -37
  76. package/dist/src/commands/port-ownership.d.ts +0 -44
  77. package/dist/src/commands/port-ownership.js +0 -47
  78. package/dist/src/commands/registry-publish.d.ts +0 -1
  79. package/dist/src/commands/registry-publish.js +0 -46
  80. package/dist/src/commands/registry.d.ts +4 -237
  81. package/dist/src/commands/registry.js +2 -316
  82. package/dist/src/commands/secrets/exec.d.ts +0 -16
  83. package/dist/src/commands/secrets/exec.js +0 -24
  84. package/dist/src/commands/secrets/index.d.ts +0 -9
  85. package/dist/src/commands/secrets/index.js +0 -10
  86. package/dist/src/commands/secrets/migrate-config.d.ts +0 -17
  87. package/dist/src/commands/secrets/migrate-config.js +0 -40
  88. package/dist/src/commands/secrets/reindex.d.ts +0 -38
  89. package/dist/src/commands/secrets/reindex.js +0 -39
  90. package/dist/src/commands/secrets/set.d.ts +0 -47
  91. package/dist/src/commands/secrets/set.js +0 -107
  92. package/dist/src/commands/site.d.ts +0 -1
  93. package/dist/src/commands/site.js +0 -61
  94. package/dist/src/commands/skills.d.ts +0 -61
  95. package/dist/src/commands/skills.js +0 -83
  96. package/dist/src/commands/stack.d.ts +0 -15
  97. package/dist/src/commands/stack.js +1 -128
  98. package/dist/src/commands/temporal.d.ts +0 -30
  99. package/dist/src/commands/temporal.js.map +0 -1
  100. package/dist/src/commands/tenant.d.ts +0 -31
  101. package/dist/src/commands/tenant.js +0 -55
  102. package/dist/src/commands/tunnel/index.d.ts +0 -40
  103. package/dist/src/commands/tunnel/index.js +0 -141
  104. package/dist/src/commands/vcs/clone.d.ts +0 -1
  105. package/dist/src/commands/vcs/clone.js +0 -4
  106. package/dist/src/commands/vcs/common.d.ts +0 -32
  107. package/dist/src/commands/vcs/common.js +0 -41
  108. package/dist/src/commands/vcs/drafts.d.ts +0 -1
  109. package/dist/src/commands/vcs/drafts.js +0 -1
  110. package/dist/src/commands/vcs/get.d.ts +0 -1
  111. package/dist/src/commands/vcs/get.js +0 -11
  112. package/dist/src/commands/vcs/index.d.ts +0 -1
  113. package/dist/src/commands/vcs/index.js +0 -1
  114. package/dist/src/commands/vcs/propose.d.ts +0 -26
  115. package/dist/src/commands/vcs/propose.js +3 -34
  116. package/dist/src/commands/vcs/review.d.ts +0 -1
  117. package/dist/src/commands/vcs/review.js +0 -1
  118. package/dist/src/commands/vcs/rm.d.ts +0 -11
  119. package/dist/src/commands/vcs/rm.js +0 -14
  120. package/dist/src/commands/vcs-enrich.d.ts +0 -12
  121. package/dist/src/commands/vcs-enrich.js +0 -12
  122. package/dist/src/commands/vpn/index.d.ts +0 -17
  123. package/dist/src/commands/vpn/index.js +0 -102
  124. package/dist/src/commands/vpn/tunnel.d.ts +0 -9
  125. package/dist/src/commands/vpn/tunnel.js +0 -37
  126. package/dist/src/commands/workflow.d.ts +0 -22
  127. package/dist/src/commands/workflow.js +0 -80
  128. package/dist/src/docs/assemble.d.ts +0 -117
  129. package/dist/src/docs/assemble.js +0 -142
  130. package/dist/src/docs/cli-reference.d.ts +0 -58
  131. package/dist/src/docs/cli-reference.js +0 -77
  132. package/dist/src/docs/discover.d.ts +0 -40
  133. package/dist/src/docs/discover.js +2 -60
  134. package/dist/src/docs/portal.d.ts +0 -44
  135. package/dist/src/docs/portal.js +0 -49
  136. package/dist/src/docs/registry-docs.d.ts +0 -29
  137. package/dist/src/docs/registry-docs.js +0 -40
  138. package/dist/src/docs/schema.d.ts +0 -36
  139. package/dist/src/docs/schema.js +0 -52
  140. package/dist/src/docs/serve.d.ts +0 -18
  141. package/dist/src/docs/serve.js +2 -30
  142. package/dist/src/docs/start.d.ts +0 -42
  143. package/dist/src/docs/start.js +0 -70
  144. package/dist/src/eval/agent-eval.d.mts +0 -12
  145. package/dist/src/eval/agent-eval.mjs +0 -22
  146. package/dist/src/index.d.ts +0 -6
  147. package/dist/src/index.js.map +0 -1
  148. package/dist/src/program.d.ts +0 -20
  149. package/dist/src/program.js +0 -24
  150. package/dist/src/utils/auth-preflight.d.ts +0 -137
  151. package/dist/src/utils/auth-preflight.js +0 -149
  152. package/dist/src/utils/aws-auth.d.ts +0 -163
  153. package/dist/src/utils/aws-auth.js +3 -232
  154. package/dist/src/utils/bastion.d.ts +0 -27
  155. package/dist/src/utils/bastion.js +0 -28
  156. package/dist/src/utils/build-info.d.ts +0 -22
  157. package/dist/src/utils/build-info.js +0 -27
  158. package/dist/src/utils/cache-home.d.ts +0 -23
  159. package/dist/src/utils/cache-home.js +0 -25
  160. package/dist/src/utils/capture-history.d.ts +0 -54
  161. package/dist/src/utils/capture-history.js +1 -55
  162. package/dist/src/utils/context.d.ts +0 -23
  163. package/dist/src/utils/context.js +0 -43
  164. package/dist/src/utils/credentials.d.ts +0 -38
  165. package/dist/src/utils/credentials.js +0 -39
  166. package/dist/src/utils/deploy-preflight.d.ts +0 -38
  167. package/dist/src/utils/deploy-preflight.js +1 -71
  168. package/dist/src/utils/errors.d.ts +0 -53
  169. package/dist/src/utils/errors.js +0 -49
  170. package/dist/src/utils/first-party-contexts.d.ts +0 -38
  171. package/dist/src/utils/first-party-contexts.js +0 -44
  172. package/dist/src/utils/index.d.ts +0 -4
  173. package/dist/src/utils/index.js +0 -4
  174. package/dist/src/utils/kubeconfig.d.ts +0 -40
  175. package/dist/src/utils/kubeconfig.js +0 -44
  176. package/dist/src/utils/log.d.ts +0 -20
  177. package/dist/src/utils/log.js +0 -20
  178. package/dist/src/utils/mesh-json.d.ts +0 -46
  179. package/dist/src/utils/mesh-json.js +0 -39
  180. package/dist/src/utils/pid.d.ts +0 -42
  181. package/dist/src/utils/pid.js +0 -48
  182. package/dist/src/utils/pulumi-run.d.ts +0 -14
  183. package/dist/src/utils/pulumi-run.js +0 -42
  184. package/dist/src/utils/pulumi.d.ts +0 -34
  185. package/dist/src/utils/pulumi.js +0 -38
  186. package/dist/src/utils/reachability.d.ts +0 -27
  187. package/dist/src/utils/reachability.js +0 -40
  188. package/dist/src/utils/recover-conversation.d.ts +0 -110
  189. package/dist/src/utils/recover-conversation.js +0 -108
  190. package/dist/src/utils/registry-broker.d.ts +5 -84
  191. package/dist/src/utils/registry-broker.js +0 -62
  192. package/dist/src/utils/registry-identity.d.ts +0 -149
  193. package/dist/src/utils/registry-identity.js +0 -143
  194. package/dist/src/utils/scaffold-versions.d.ts +0 -41
  195. package/dist/src/utils/scaffold-versions.js +0 -42
  196. package/dist/src/utils/socks-forward.d.ts +0 -24
  197. package/dist/src/utils/socks-forward.js +2 -25
  198. package/dist/src/utils/stack-flag.d.ts +0 -13
  199. package/dist/src/utils/stack-flag.js +0 -21
  200. package/dist/src/utils/tailscale-targets.d.ts +0 -37
  201. package/dist/src/utils/tailscale-targets.js +0 -33
  202. package/dist/src/utils/tailscale.d.ts +0 -177
  203. package/dist/src/utils/tailscale.js +6 -337
  204. package/dist/src/utils/temporal-auth.d.ts +0 -41
  205. package/dist/src/utils/temporal-auth.js +0 -52
  206. package/dist/src/utils/temporal-codec.d.ts +0 -89
  207. package/dist/src/utils/temporal-codec.js.map +0 -1
  208. package/dist/src/utils/tunnel-ownership.d.ts +0 -79
  209. package/dist/src/utils/tunnel-ownership.js +0 -74
  210. package/dist/src/utils/vpn-join.d.ts +0 -16
  211. package/dist/src/utils/vpn-join.js +0 -17
  212. package/dist/src/utils/vpn.d.ts +0 -42
  213. package/dist/src/utils/vpn.js +0 -52
  214. package/dist/src/utils/workflow-fingerprint.d.ts +0 -39
  215. package/dist/src/utils/workflow-fingerprint.js +1 -63
  216. package/dist/src/utils/worktree-identity.d.ts +0 -62
  217. package/dist/src/utils/worktree-identity.js +0 -88
  218. package/package.json +1 -1
  219. package/skills/core/SKILL.md +10 -11
  220. package/templates/api-auth/api/src/index.ts.hbs +1 -1
  221. package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +2 -2
  222. package/templates/api-role-gating/api/src/authn.ts.hbs +2 -2
  223. package/templates/api-role-gating/index.ts.hbs +1 -1
  224. package/templates/api-role-gating/skills/develop/SKILL.md.hbs +1 -1
  225. package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +2 -2
  226. package/templates/platform-repo/platform/index.ts +1 -1
  227. package/dist/bin/mesh.d.ts.map +0 -1
  228. package/dist/src/commands/agent-api-client.d.ts.map +0 -1
  229. package/dist/src/commands/agent-api-client.js.map +0 -1
  230. package/dist/src/commands/app-check.d.ts.map +0 -1
  231. package/dist/src/commands/app-check.js.map +0 -1
  232. package/dist/src/commands/artifacts.d.ts.map +0 -1
  233. package/dist/src/commands/artifacts.js.map +0 -1
  234. package/dist/src/commands/cluster.d.ts.map +0 -1
  235. package/dist/src/commands/cluster.js.map +0 -1
  236. package/dist/src/commands/conversations.d.ts.map +0 -1
  237. package/dist/src/commands/conversations.js.map +0 -1
  238. package/dist/src/commands/create-app.d.ts.map +0 -1
  239. package/dist/src/commands/create-app.js.map +0 -1
  240. package/dist/src/commands/db/connect.d.ts.map +0 -1
  241. package/dist/src/commands/db/connect.js.map +0 -1
  242. package/dist/src/commands/db/credentials.d.ts.map +0 -1
  243. package/dist/src/commands/db/credentials.js.map +0 -1
  244. package/dist/src/commands/db/env.d.ts.map +0 -1
  245. package/dist/src/commands/db/env.js.map +0 -1
  246. package/dist/src/commands/db/exec.d.ts.map +0 -1
  247. package/dist/src/commands/db/exec.js.map +0 -1
  248. package/dist/src/commands/db/index.d.ts.map +0 -1
  249. package/dist/src/commands/db/index.js.map +0 -1
  250. package/dist/src/commands/db/psql.d.ts.map +0 -1
  251. package/dist/src/commands/db/psql.js.map +0 -1
  252. package/dist/src/commands/deploy.d.ts.map +0 -1
  253. package/dist/src/commands/deploy.js.map +0 -1
  254. package/dist/src/commands/dev-doctor.d.ts.map +0 -1
  255. package/dist/src/commands/dev-doctor.js.map +0 -1
  256. package/dist/src/commands/dev-launch.d.ts.map +0 -1
  257. package/dist/src/commands/dev-launch.js.map +0 -1
  258. package/dist/src/commands/dev-token-server.d.ts.map +0 -1
  259. package/dist/src/commands/dev-token-server.js.map +0 -1
  260. package/dist/src/commands/dev.d.ts.map +0 -1
  261. package/dist/src/commands/dev.js.map +0 -1
  262. package/dist/src/commands/docs.d.ts.map +0 -1
  263. package/dist/src/commands/docs.js.map +0 -1
  264. package/dist/src/commands/hub/index.d.ts.map +0 -1
  265. package/dist/src/commands/hub/index.js.map +0 -1
  266. package/dist/src/commands/init/wizard.d.ts.map +0 -1
  267. package/dist/src/commands/init/wizard.js.map +0 -1
  268. package/dist/src/commands/init.d.ts.map +0 -1
  269. package/dist/src/commands/init.js.map +0 -1
  270. package/dist/src/commands/install-shim.d.ts.map +0 -1
  271. package/dist/src/commands/install-shim.js.map +0 -1
  272. package/dist/src/commands/local/auth-provision.d.ts.map +0 -1
  273. package/dist/src/commands/local/auth-provision.js.map +0 -1
  274. package/dist/src/commands/local/dev-local.d.ts.map +0 -1
  275. package/dist/src/commands/local/dev-local.js.map +0 -1
  276. package/dist/src/commands/local/docker-runner.d.ts.map +0 -1
  277. package/dist/src/commands/local/docker-runner.js.map +0 -1
  278. package/dist/src/commands/local/helpers.d.ts.map +0 -1
  279. package/dist/src/commands/local/helpers.js.map +0 -1
  280. package/dist/src/commands/local/hub-local.d.ts.map +0 -1
  281. package/dist/src/commands/local/hub-local.js.map +0 -1
  282. package/dist/src/commands/local/index.d.ts.map +0 -1
  283. package/dist/src/commands/local/index.js.map +0 -1
  284. package/dist/src/commands/local/mocks.d.ts.map +0 -1
  285. package/dist/src/commands/local/mocks.js.map +0 -1
  286. package/dist/src/commands/local/seed-hub-catalog.d.ts.map +0 -1
  287. package/dist/src/commands/local/seed-hub-catalog.js.map +0 -1
  288. package/dist/src/commands/local/seed-zitadel.d.ts.map +0 -1
  289. package/dist/src/commands/local/seed-zitadel.js.map +0 -1
  290. package/dist/src/commands/local/seed.d.ts.map +0 -1
  291. package/dist/src/commands/local/seed.js.map +0 -1
  292. package/dist/src/commands/local/stack.d.ts.map +0 -1
  293. package/dist/src/commands/local/stack.js.map +0 -1
  294. package/dist/src/commands/login.d.ts.map +0 -1
  295. package/dist/src/commands/login.js.map +0 -1
  296. package/dist/src/commands/peer-addressing.d.ts.map +0 -1
  297. package/dist/src/commands/peer-addressing.js.map +0 -1
  298. package/dist/src/commands/port-ownership.d.ts.map +0 -1
  299. package/dist/src/commands/port-ownership.js.map +0 -1
  300. package/dist/src/commands/registry-publish.d.ts.map +0 -1
  301. package/dist/src/commands/registry-publish.js.map +0 -1
  302. package/dist/src/commands/registry.d.ts.map +0 -1
  303. package/dist/src/commands/registry.js.map +0 -1
  304. package/dist/src/commands/secrets/exec.d.ts.map +0 -1
  305. package/dist/src/commands/secrets/exec.js.map +0 -1
  306. package/dist/src/commands/secrets/index.d.ts.map +0 -1
  307. package/dist/src/commands/secrets/index.js.map +0 -1
  308. package/dist/src/commands/secrets/migrate-config.d.ts.map +0 -1
  309. package/dist/src/commands/secrets/migrate-config.js.map +0 -1
  310. package/dist/src/commands/secrets/reindex.d.ts.map +0 -1
  311. package/dist/src/commands/secrets/reindex.js.map +0 -1
  312. package/dist/src/commands/secrets/set.d.ts.map +0 -1
  313. package/dist/src/commands/secrets/set.js.map +0 -1
  314. package/dist/src/commands/site.d.ts.map +0 -1
  315. package/dist/src/commands/site.js.map +0 -1
  316. package/dist/src/commands/skills.d.ts.map +0 -1
  317. package/dist/src/commands/skills.js.map +0 -1
  318. package/dist/src/commands/stack.d.ts.map +0 -1
  319. package/dist/src/commands/stack.js.map +0 -1
  320. package/dist/src/commands/temporal.d.ts.map +0 -1
  321. package/dist/src/commands/tenant.d.ts.map +0 -1
  322. package/dist/src/commands/tenant.js.map +0 -1
  323. package/dist/src/commands/tunnel/index.d.ts.map +0 -1
  324. package/dist/src/commands/tunnel/index.js.map +0 -1
  325. package/dist/src/commands/vcs/clone.d.ts.map +0 -1
  326. package/dist/src/commands/vcs/clone.js.map +0 -1
  327. package/dist/src/commands/vcs/common.d.ts.map +0 -1
  328. package/dist/src/commands/vcs/common.js.map +0 -1
  329. package/dist/src/commands/vcs/drafts.d.ts.map +0 -1
  330. package/dist/src/commands/vcs/drafts.js.map +0 -1
  331. package/dist/src/commands/vcs/get.d.ts.map +0 -1
  332. package/dist/src/commands/vcs/get.js.map +0 -1
  333. package/dist/src/commands/vcs/index.d.ts.map +0 -1
  334. package/dist/src/commands/vcs/index.js.map +0 -1
  335. package/dist/src/commands/vcs/propose.d.ts.map +0 -1
  336. package/dist/src/commands/vcs/propose.js.map +0 -1
  337. package/dist/src/commands/vcs/review.d.ts.map +0 -1
  338. package/dist/src/commands/vcs/review.js.map +0 -1
  339. package/dist/src/commands/vcs/rm.d.ts.map +0 -1
  340. package/dist/src/commands/vcs/rm.js.map +0 -1
  341. package/dist/src/commands/vcs-enrich.d.ts.map +0 -1
  342. package/dist/src/commands/vcs-enrich.js.map +0 -1
  343. package/dist/src/commands/vpn/index.d.ts.map +0 -1
  344. package/dist/src/commands/vpn/index.js.map +0 -1
  345. package/dist/src/commands/vpn/tunnel.d.ts.map +0 -1
  346. package/dist/src/commands/vpn/tunnel.js.map +0 -1
  347. package/dist/src/commands/workflow.d.ts.map +0 -1
  348. package/dist/src/commands/workflow.js.map +0 -1
  349. package/dist/src/docs/assemble.d.ts.map +0 -1
  350. package/dist/src/docs/assemble.js.map +0 -1
  351. package/dist/src/docs/cli-reference.d.ts.map +0 -1
  352. package/dist/src/docs/cli-reference.js.map +0 -1
  353. package/dist/src/docs/discover.d.ts.map +0 -1
  354. package/dist/src/docs/discover.js.map +0 -1
  355. package/dist/src/docs/portal.d.ts.map +0 -1
  356. package/dist/src/docs/portal.js.map +0 -1
  357. package/dist/src/docs/registry-docs.d.ts.map +0 -1
  358. package/dist/src/docs/registry-docs.js.map +0 -1
  359. package/dist/src/docs/schema.d.ts.map +0 -1
  360. package/dist/src/docs/schema.js.map +0 -1
  361. package/dist/src/docs/serve.d.ts.map +0 -1
  362. package/dist/src/docs/serve.js.map +0 -1
  363. package/dist/src/docs/start.d.ts.map +0 -1
  364. package/dist/src/docs/start.js.map +0 -1
  365. package/dist/src/eval/agent-eval.d.mts.map +0 -1
  366. package/dist/src/eval/agent-eval.mjs.map +0 -1
  367. package/dist/src/index.d.ts.map +0 -1
  368. package/dist/src/program.d.ts.map +0 -1
  369. package/dist/src/program.js.map +0 -1
  370. package/dist/src/utils/auth-preflight.d.ts.map +0 -1
  371. package/dist/src/utils/auth-preflight.js.map +0 -1
  372. package/dist/src/utils/aws-auth.d.ts.map +0 -1
  373. package/dist/src/utils/aws-auth.js.map +0 -1
  374. package/dist/src/utils/bastion.d.ts.map +0 -1
  375. package/dist/src/utils/bastion.js.map +0 -1
  376. package/dist/src/utils/build-info.d.ts.map +0 -1
  377. package/dist/src/utils/build-info.js.map +0 -1
  378. package/dist/src/utils/cache-home.d.ts.map +0 -1
  379. package/dist/src/utils/cache-home.js.map +0 -1
  380. package/dist/src/utils/capture-history.d.ts.map +0 -1
  381. package/dist/src/utils/capture-history.js.map +0 -1
  382. package/dist/src/utils/context.d.ts.map +0 -1
  383. package/dist/src/utils/context.js.map +0 -1
  384. package/dist/src/utils/credentials.d.ts.map +0 -1
  385. package/dist/src/utils/credentials.js.map +0 -1
  386. package/dist/src/utils/deploy-preflight.d.ts.map +0 -1
  387. package/dist/src/utils/deploy-preflight.js.map +0 -1
  388. package/dist/src/utils/errors.d.ts.map +0 -1
  389. package/dist/src/utils/errors.js.map +0 -1
  390. package/dist/src/utils/first-party-contexts.d.ts.map +0 -1
  391. package/dist/src/utils/first-party-contexts.js.map +0 -1
  392. package/dist/src/utils/index.d.ts.map +0 -1
  393. package/dist/src/utils/index.js.map +0 -1
  394. package/dist/src/utils/kubeconfig.d.ts.map +0 -1
  395. package/dist/src/utils/kubeconfig.js.map +0 -1
  396. package/dist/src/utils/log.d.ts.map +0 -1
  397. package/dist/src/utils/log.js.map +0 -1
  398. package/dist/src/utils/mesh-json.d.ts.map +0 -1
  399. package/dist/src/utils/mesh-json.js.map +0 -1
  400. package/dist/src/utils/pid.d.ts.map +0 -1
  401. package/dist/src/utils/pid.js.map +0 -1
  402. package/dist/src/utils/pulumi-run.d.ts.map +0 -1
  403. package/dist/src/utils/pulumi-run.js.map +0 -1
  404. package/dist/src/utils/pulumi.d.ts.map +0 -1
  405. package/dist/src/utils/pulumi.js.map +0 -1
  406. package/dist/src/utils/reachability.d.ts.map +0 -1
  407. package/dist/src/utils/reachability.js.map +0 -1
  408. package/dist/src/utils/recover-conversation.d.ts.map +0 -1
  409. package/dist/src/utils/recover-conversation.js.map +0 -1
  410. package/dist/src/utils/registry-broker.d.ts.map +0 -1
  411. package/dist/src/utils/registry-broker.js.map +0 -1
  412. package/dist/src/utils/registry-identity.d.ts.map +0 -1
  413. package/dist/src/utils/registry-identity.js.map +0 -1
  414. package/dist/src/utils/scaffold-versions.d.ts.map +0 -1
  415. package/dist/src/utils/scaffold-versions.js.map +0 -1
  416. package/dist/src/utils/socks-forward.d.ts.map +0 -1
  417. package/dist/src/utils/socks-forward.js.map +0 -1
  418. package/dist/src/utils/stack-flag.d.ts.map +0 -1
  419. package/dist/src/utils/stack-flag.js.map +0 -1
  420. package/dist/src/utils/tailscale-targets.d.ts.map +0 -1
  421. package/dist/src/utils/tailscale-targets.js.map +0 -1
  422. package/dist/src/utils/tailscale.d.ts.map +0 -1
  423. package/dist/src/utils/tailscale.js.map +0 -1
  424. package/dist/src/utils/temporal-auth.d.ts.map +0 -1
  425. package/dist/src/utils/temporal-auth.js.map +0 -1
  426. package/dist/src/utils/temporal-codec.d.ts.map +0 -1
  427. package/dist/src/utils/tunnel-ownership.d.ts.map +0 -1
  428. package/dist/src/utils/tunnel-ownership.js.map +0 -1
  429. package/dist/src/utils/vpn-join.d.ts.map +0 -1
  430. package/dist/src/utils/vpn-join.js.map +0 -1
  431. package/dist/src/utils/vpn.d.ts.map +0 -1
  432. package/dist/src/utils/vpn.js.map +0 -1
  433. package/dist/src/utils/workflow-fingerprint.d.ts.map +0 -1
  434. package/dist/src/utils/workflow-fingerprint.js.map +0 -1
  435. package/dist/src/utils/worktree-identity.d.ts.map +0 -1
  436. package/dist/src/utils/worktree-identity.js.map +0 -1
@@ -1,37 +1,3 @@
1
- /**
2
- * mesh db exec - Run any command with database connection
3
- *
4
- * Three modes of operation:
5
- *
6
- * 1. Explicit mode (recommended for ad-hoc use):
7
- * mesh db exec --tenant=<tenant> --env=<env> [--ssl=require] -- <command>
8
- * - Uses explicit tenant/env to find platform bastion
9
- * - Starts tunnel if needed
10
- * - Similar to: mesh tunnel --tenant mesh --env dev
11
- *
12
- * 2. Direct mode (for sst dev integration):
13
- * mesh db exec --secret=<arn> [--ssl=require] -- <command>
14
- * - Uses secret ARN directly, expects tunnel already running
15
- * - Ideal for sst.config.ts devCommand
16
- *
17
- * 3. Discovery mode (legacy, auto-detection):
18
- * mesh db exec [--stage=<stage>] -- <command>
19
- * - Auto-discovers tenant/env from filesystem and config files
20
- * - Can be fragile if project structure doesn't match expected patterns
21
- * - Starts tunnel if needed
22
- *
23
- * Examples:
24
- * # Explicit mode (recommended)
25
- * mesh db exec --tenant mesh --env dev --ssl=require -- npx prisma db push
26
- * mesh db exec -t mesh -e dev -- npx prisma migrate dev
27
- *
28
- * # Direct mode (in sst.config.ts)
29
- * mesh db exec --secret=arn:aws:secretsmanager:... --ssl=require -- pnpm dev
30
- *
31
- * # Discovery mode (legacy)
32
- * mesh db exec -- npx prisma db push
33
- * mesh db exec --stage=dev -- npx prisma migrate dev
34
- */
35
1
  import { spawn } from "child_process";
36
2
  import * as net from "net";
37
3
  import * as fs from "fs";
@@ -41,9 +7,6 @@ import { detectContext, getPlatformBastionInfo, getDatabaseUrl, rewriteDatabaseU
41
7
  const DEFAULT_LOCAL_PORT = 5432;
42
8
  const MAX_RETRIES = 12;
43
9
  const RETRY_DELAY_MS = 5000;
44
- /**
45
- * Find SST outputs by looking in current and parent directories.
46
- */
47
10
  function findSstOutputs() {
48
11
  let dir = process.cwd();
49
12
  const root = path.parse(dir).root;
@@ -67,7 +30,6 @@ function findSstOutputs() {
67
30
  }
68
31
  }
69
32
  catch {
70
- // Ignore parse errors, continue searching
71
33
  }
72
34
  }
73
35
  dir = path.dirname(dir);
@@ -117,9 +79,6 @@ async function startTunnelBackground(instanceId, rdsEndpoint, rdsPort, localPort
117
79
  tunnel.kill();
118
80
  throw new Error(`Tunnel failed to start after ${maxAttempts} seconds`);
119
81
  }
120
- /**
121
- * Fetch secret from Secrets Manager with retry logic for provisioning delays.
122
- */
123
82
  async function fetchSecretWithRetry(client, secretId) {
124
83
  let lastError;
125
84
  for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
@@ -169,12 +128,8 @@ export async function execCommand(commandArgs, options) {
169
128
  const secretsManager = new SecretsManagerClient({});
170
129
  let tunnel = null;
171
130
  let databaseUrl;
172
- // ==========================================================================
173
- // Direct mode: --secret provided, use it directly
174
- // ==========================================================================
175
131
  if (options.secret) {
176
132
  logInfo(`Direct mode: using secret ${options.secret}`);
177
- // Check if tunnel is running
178
133
  const tunnelExists = await checkPort(localPort);
179
134
  if (!tunnelExists) {
180
135
  logError(`No tunnel found on port ${localPort}`);
@@ -183,16 +138,13 @@ export async function execCommand(commandArgs, options) {
183
138
  process.exit(1);
184
139
  }
185
140
  logSuccess(`Using existing tunnel on port ${localPort}`);
186
- // Fetch secret
187
141
  logInfo(`Fetching credentials from secret...`);
188
142
  const secret = await fetchSecretWithRetry(secretsManager, options.secret);
189
- // Secret should contain DATABASE_URL directly (new format)
190
143
  if (secret.DATABASE_URL) {
191
144
  databaseUrl = secret.DATABASE_URL;
192
145
  logSuccess("Got DATABASE_URL from secret");
193
146
  }
194
147
  else if (secret.username && secret.password) {
195
- // Legacy format with individual fields
196
148
  const dbName = secret.dbname ?? secret.database ?? "postgres";
197
149
  databaseUrl = `postgresql://${secret.username}:${encodeURIComponent(secret.password)}@localhost:${localPort}/${dbName}`;
198
150
  logSuccess(`Got credentials for user: ${secret.username}`);
@@ -201,12 +153,10 @@ export async function execCommand(commandArgs, options) {
201
153
  logError("Secret must contain DATABASE_URL or username/password fields");
202
154
  process.exit(1);
203
155
  }
204
- // Rewrite DATABASE_URL for local tunnel
205
156
  try {
206
157
  const parsed = new URL(databaseUrl);
207
158
  parsed.hostname = "localhost";
208
159
  parsed.port = String(localPort);
209
- // Apply SSL mode if specified
210
160
  if (options.ssl) {
211
161
  parsed.searchParams.set("sslmode", options.ssl);
212
162
  if (options.ssl === "require" || options.ssl === "no-verify") {
@@ -219,34 +169,26 @@ export async function execCommand(commandArgs, options) {
219
169
  logWarn("Could not parse DATABASE_URL for rewriting");
220
170
  }
221
171
  }
222
- // ==========================================================================
223
- // Discovery mode: find credentials via SSM lookups
224
- // ==========================================================================
225
172
  else {
226
- // Use explicit --tenant/--env if provided, otherwise fall back to detectContext
227
173
  let platformTenant;
228
174
  let platformEnv;
229
175
  if (options.tenant && options.env) {
230
- // Explicit mode: use provided tenant/env directly (like tunnel command)
231
176
  platformTenant = options.tenant;
232
177
  platformEnv = options.env;
233
178
  logInfo(`Explicit mode: Platform Tenant=${platformTenant}, Platform Env=${platformEnv}`);
234
179
  }
235
180
  else if (options.tenant || options.env) {
236
- // Partial explicit mode - warn and require both
237
181
  logError("Both --tenant and --env are required when using explicit mode");
238
182
  logInfo("Usage: mesh db exec --tenant mesh --env dev-temporal --app rdc --app-tenant encore --app-stage dev -- <command>");
239
183
  logInfo("Or omit both to use auto-detection");
240
184
  process.exit(1);
241
185
  }
242
186
  else {
243
- // Auto-detection mode (legacy behavior)
244
187
  const ctx = detectContext();
245
188
  platformTenant = ctx.tenant;
246
189
  platformEnv = ctx.platformEnv;
247
190
  logInfo(`Discovery mode: Platform=${platformEnv}, Tenant=${platformTenant}`);
248
191
  }
249
- // For credentials, use app-specific options if provided, else fall back to platform values
250
192
  const appTenant = options.appTenant ?? platformTenant;
251
193
  const appStage = options.appStage ?? platformEnv;
252
194
  const appName = options.app;
@@ -254,7 +196,6 @@ export async function execCommand(commandArgs, options) {
254
196
  logInfo(`App credentials: tenant=${appTenant}, stage=${appStage}, app=${appName}`);
255
197
  }
256
198
  const tunnelExists = await checkPort(localPort);
257
- // Try SST outputs first (fast path when sst dev is running)
258
199
  const sstOutputs = findSstOutputs();
259
200
  if (sstOutputs?.secretArn && tunnelExists) {
260
201
  logInfo(`Found SST outputs in: ${sstOutputs.rootDir}`);
@@ -272,9 +213,7 @@ export async function execCommand(commandArgs, options) {
272
213
  logWarn("Could not fetch from SST outputs, falling back to credential lookup");
273
214
  }
274
215
  }
275
- // Lookup credentials from Secrets Manager if not found in SST outputs
276
216
  if (!databaseUrl) {
277
- // Start tunnel if needed
278
217
  if (!tunnelExists) {
279
218
  const bastion = await getPlatformBastionInfo(platformTenant, platformEnv);
280
219
  const rdsService = bastion.services.rds;
@@ -286,7 +225,6 @@ export async function execCommand(commandArgs, options) {
286
225
  else {
287
226
  logSuccess(`Using existing tunnel on port ${localPort}`);
288
227
  }
289
- // Get DATABASE_URL and rewrite for tunnel
290
228
  const rawUrl = await getDatabaseUrl(appTenant, appStage, { app: appName });
291
229
  databaseUrl = rewriteDatabaseUrl(rawUrl, {
292
230
  endpoint: `localhost:${localPort}`,
@@ -294,17 +232,11 @@ export async function execCommand(commandArgs, options) {
294
232
  });
295
233
  }
296
234
  }
297
- // ==========================================================================
298
- // Set NODE_TLS_REJECT_UNAUTHORIZED for SSL through tunnels
299
- // ==========================================================================
300
235
  const env = { ...process.env, DATABASE_URL: databaseUrl };
301
236
  if (options.ssl === "require" || options.ssl === "no-verify") {
302
237
  env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
303
238
  logInfo("Set NODE_TLS_REJECT_UNAUTHORIZED=0 for SSL through tunnel");
304
239
  }
305
- // ==========================================================================
306
- // Cleanup and run command
307
- // ==========================================================================
308
240
  const cleanup = () => {
309
241
  if (tunnel) {
310
242
  logInfo("Stopping tunnel...");
@@ -328,4 +260,3 @@ export async function execCommand(commandArgs, options) {
328
260
  process.exit(1);
329
261
  });
330
262
  }
331
- //# sourceMappingURL=exec.js.map
@@ -1,12 +1,2 @@
1
- /**
2
- * Database commands
3
- *
4
- * mesh db connect - Start tunnel for manual psql access
5
- * mesh db credentials - Print database credentials
6
- * mesh db env - Export DATABASE_URL for shell
7
- * mesh db psql - Connect to database via psql
8
- * mesh db exec - Run any command with database connection
9
- */
10
1
  import { Command } from "commander";
11
2
  export declare function registerDbCommands(program: Command): void;
12
- //# sourceMappingURL=index.d.ts.map
@@ -1,12 +1,3 @@
1
- /**
2
- * Database commands
3
- *
4
- * mesh db connect - Start tunnel for manual psql access
5
- * mesh db credentials - Print database credentials
6
- * mesh db env - Export DATABASE_URL for shell
7
- * mesh db psql - Connect to database via psql
8
- * mesh db exec - Run any command with database connection
9
- */
10
1
  import { connectCommand } from "./connect.js";
11
2
  import { credentialsCommand } from "./credentials.js";
12
3
  import { envCommand } from "./env.js";
@@ -59,4 +50,3 @@ export function registerDbCommands(program) {
59
50
  .argument("<command...>", "Command and arguments to run")
60
51
  .action(execCommand);
61
52
  }
62
- //# sourceMappingURL=index.js.map
@@ -1,9 +1,3 @@
1
- /**
2
- * mesh db psql - Connect to database with psql
3
- *
4
- * Usage:
5
- * mesh db psql --tenant mesh --env dev-temporal --app rdc --app-tenant encore --app-stage dev
6
- */
7
1
  interface PsqlOptions {
8
2
  tenant?: string;
9
3
  env?: string;
@@ -13,4 +7,3 @@ interface PsqlOptions {
13
7
  }
14
8
  export declare function psqlCommand(options: PsqlOptions): Promise<void>;
15
9
  export {};
16
- //# sourceMappingURL=psql.d.ts.map
@@ -1,15 +1,6 @@
1
- /**
2
- * mesh db psql - Connect to database with psql
3
- *
4
- * Usage:
5
- * mesh db psql --tenant mesh --env dev-temporal --app rdc --app-tenant encore --app-stage dev
6
- */
7
1
  import { spawn } from "child_process";
8
2
  import * as net from "net";
9
3
  import { detectContext, getPlatformBastionInfo, getDatabaseUrl, logInfo, logSuccess, logError, } from "../../utils/index.js";
10
- /**
11
- * Start SSM tunnel in background and wait for it to be ready.
12
- */
13
4
  async function startTunnelBackground(instanceId, rdsHost, rdsPort, localPort) {
14
5
  logInfo("Starting tunnel in background...");
15
6
  const tunnel = spawn("aws", [
@@ -26,7 +17,6 @@ async function startTunnelBackground(instanceId, rdsHost, rdsPort, localPort) {
26
17
  localPortNumber: [String(localPort)],
27
18
  }),
28
19
  ], { stdio: ["ignore", "ignore", "ignore"] });
29
- // Wait for tunnel to be ready (port listening)
30
20
  const maxAttempts = 15;
31
21
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
32
22
  if (tunnel.exitCode !== null) {
@@ -56,7 +46,6 @@ function sleep(ms) {
56
46
  return new Promise((resolve) => setTimeout(resolve, ms));
57
47
  }
58
48
  export async function psqlCommand(options) {
59
- // Resolve platform tenant/env
60
49
  let platformTenant;
61
50
  let platformEnv;
62
51
  if (options.tenant && options.env) {
@@ -75,14 +64,12 @@ export async function psqlCommand(options) {
75
64
  platformEnv = ctx.platformEnv;
76
65
  logInfo(`Auto-detected: Tenant=${platformTenant}, Env=${platformEnv}`);
77
66
  }
78
- // Resolve app credentials
79
67
  const appTenant = options.appTenant ?? platformTenant;
80
68
  const appStage = options.appStage ?? platformEnv;
81
69
  const appName = options.app;
82
70
  if (appName) {
83
71
  logInfo(`App credentials: tenant=${appTenant}, stage=${appStage}, app=${appName}`);
84
72
  }
85
- // Check for psql
86
73
  const psqlCheck = spawn("which", ["psql"]);
87
74
  await new Promise((resolve, reject) => {
88
75
  psqlCheck.on("exit", (code) => {
@@ -95,7 +82,6 @@ export async function psqlCommand(options) {
95
82
  }
96
83
  });
97
84
  });
98
- // Get bastion and start tunnel
99
85
  const bastion = await getPlatformBastionInfo(platformTenant, platformEnv);
100
86
  const rdsService = bastion.services.rds;
101
87
  if (!rdsService) {
@@ -103,7 +89,6 @@ export async function psqlCommand(options) {
103
89
  process.exit(1);
104
90
  }
105
91
  const tunnel = await startTunnelBackground(bastion.instanceId, rdsService.host, rdsService.port, 5432);
106
- // Cleanup on exit
107
92
  const cleanup = () => {
108
93
  logInfo("Stopping tunnel...");
109
94
  tunnel.kill();
@@ -111,7 +96,6 @@ export async function psqlCommand(options) {
111
96
  process.on("exit", cleanup);
112
97
  process.on("SIGINT", cleanup);
113
98
  process.on("SIGTERM", cleanup);
114
- // Get DATABASE_URL and parse credentials
115
99
  const databaseUrl = await getDatabaseUrl(appTenant, appStage, { app: appName });
116
100
  const parsed = new URL(databaseUrl);
117
101
  const username = parsed.username;
@@ -120,7 +104,6 @@ export async function psqlCommand(options) {
120
104
  console.log("");
121
105
  logInfo(`Connecting to ${database} as ${username}...`);
122
106
  console.log("");
123
- // Run psql
124
107
  const psql = spawn("psql", ["-h", "localhost", "-p", "5432", "-U", username, "-d", database], {
125
108
  stdio: "inherit",
126
109
  env: { ...process.env, PGPASSWORD: password },
@@ -130,4 +113,3 @@ export async function psqlCommand(options) {
130
113
  process.exit(code ?? 0);
131
114
  });
132
115
  }
133
- //# sourceMappingURL=psql.js.map
@@ -1,43 +1,5 @@
1
- /**
2
- * mesh deploy — Pulumi passthrough with automatic deployer role assumption.
3
- *
4
- * Credential resolution order:
5
- * 1. If AWS credentials already in environment (CI/CD) → use directly
6
- * 2. If ~/.config/mesh/credentials.json has a valid token for the
7
- * platform context → AssumeRoleWithWebIdentity (Zitadel JWT)
8
- * 3. Fallback → AssumeRole via current AWS session (SSO)
9
- *
10
- * The platform context (e.g., "mesh.dev") is derived from `mesh:platform`
11
- * in the Pulumi stack config file (read directly from YAML, no AWS needed).
12
- *
13
- * Setup:
14
- * pulumi config set mesh:deployerRole arn:aws:iam::123456789012:role/acme-dev-apps-deployer
15
- *
16
- * Examples:
17
- * mesh deploy preview
18
- * mesh deploy up --yes
19
- * mesh deploy stack output dev --json
20
- * mesh deploy destroy
21
- */
22
1
  import { Command } from "commander";
23
- /**
24
- * Build the pulumi arg list from the user's (stack-stripped) `mesh deploy` args.
25
- * Defaults to `up` when no subcommand is given, then appends the resolved
26
- * `-s <stack>` ONLY for ops that accept it — never for no-stack ops (`whoami`,
27
- * `version`, `plugin`) or positional-stack lifecycle ops (`stack rm <name>`),
28
- * which a forced `-s` used to break. Pure — unit-tested.
29
- */
30
2
  export declare function buildPulumiArgs(pulumiArgs: string[], stack: string): string[];
31
- /**
32
- * Parse --stack or -s from the args array.
33
- */
34
3
  export declare function parseStackFromArgs(args: string[]): string | null;
35
- /**
36
- * Remove `--stack`/`-s` (and its value) from the args — it is mesh's stack
37
- * SELECTOR (picks the target + which deployer role to assume), not a pulumi flag
38
- * to forward verbatim. `buildPulumiArgs` re-adds a `-s` only for ops that accept
39
- * one, so ops like `whoami` don't receive a rejected `--stack`.
40
- */
41
4
  export declare function stripStackFromArgs(args: string[]): void;
42
5
  export declare function registerDeployCommand(program: Command): void;
43
- //# sourceMappingURL=deploy.d.ts.map
@@ -1,52 +1,15 @@
1
- /**
2
- * mesh deploy — Pulumi passthrough with automatic deployer role assumption.
3
- *
4
- * Credential resolution order:
5
- * 1. If AWS credentials already in environment (CI/CD) → use directly
6
- * 2. If ~/.config/mesh/credentials.json has a valid token for the
7
- * platform context → AssumeRoleWithWebIdentity (Zitadel JWT)
8
- * 3. Fallback → AssumeRole via current AWS session (SSO)
9
- *
10
- * The platform context (e.g., "mesh.dev") is derived from `mesh:platform`
11
- * in the Pulumi stack config file (read directly from YAML, no AWS needed).
12
- *
13
- * Setup:
14
- * pulumi config set mesh:deployerRole arn:aws:iam::123456789012:role/acme-dev-apps-deployer
15
- *
16
- * Examples:
17
- * mesh deploy preview
18
- * mesh deploy up --yes
19
- * mesh deploy stack output dev --json
20
- * mesh deploy destroy
21
- */
22
1
  import { execFileSync } from "child_process";
23
2
  import { logError, logWarn } from "../utils/log.js";
24
3
  import { findAppRoot, getCurrentStack, readStackConfig } from "../utils/pulumi.js";
25
4
  import { resolvePulumiEnv } from "../utils/pulumi-run.js";
26
5
  import { assertDeployDepsFresh } from "../utils/deploy-preflight.js";
27
6
  import { resolveWorktreeIdentity, stackNeedsWorktreeIsolation } from "../utils/worktree-identity.js";
28
- // =============================================================================
29
- // Helpers
30
- // =============================================================================
31
- // Pulumi ops that take no `-s/--stack` at all — appending one makes pulumi
32
- // reject the command ("unknown flag: --stack").
33
7
  const OPS_WITHOUT_STACK_FLAG = new Set([
34
8
  "whoami", "version", "plugin", "login", "logout", "about", "org", "env", "help",
35
9
  ]);
36
- // `pulumi stack <sub>` subcommands whose stack is a POSITIONAL arg (or none),
37
- // so `-s` either conflicts ("only one of --stack or argument stack name") or is
38
- // rejected. `stack output`/`export`/`import`/`history` DO take `-s`, so they are
39
- // deliberately absent here and get the flag.
40
10
  const STACK_SUBCOMMANDS_WITHOUT_FLAG = new Set([
41
11
  "rm", "select", "init", "rename", "unselect", "ls",
42
12
  ]);
43
- /**
44
- * Build the pulumi arg list from the user's (stack-stripped) `mesh deploy` args.
45
- * Defaults to `up` when no subcommand is given, then appends the resolved
46
- * `-s <stack>` ONLY for ops that accept it — never for no-stack ops (`whoami`,
47
- * `version`, `plugin`) or positional-stack lifecycle ops (`stack rm <name>`),
48
- * which a forced `-s` used to break. Pure — unit-tested.
49
- */
50
13
  export function buildPulumiArgs(pulumiArgs, stack) {
51
14
  const base = pulumiArgs.length === 0 || pulumiArgs[0]?.startsWith("-")
52
15
  ? ["up", ...pulumiArgs]
@@ -57,9 +20,6 @@ export function buildPulumiArgs(pulumiArgs, stack) {
57
20
  !(op === "stack" && STACK_SUBCOMMANDS_WITHOUT_FLAG.has(base[1] ?? ""));
58
21
  return takesStackFlag ? [...base, "-s", stack] : base;
59
22
  }
60
- /**
61
- * Parse --stack or -s from the args array.
62
- */
63
23
  export function parseStackFromArgs(args) {
64
24
  for (let i = 0; i < args.length; i++) {
65
25
  if (args[i] === "--stack" || args[i] === "-s") {
@@ -71,12 +31,6 @@ export function parseStackFromArgs(args) {
71
31
  }
72
32
  return null;
73
33
  }
74
- /**
75
- * Remove `--stack`/`-s` (and its value) from the args — it is mesh's stack
76
- * SELECTOR (picks the target + which deployer role to assume), not a pulumi flag
77
- * to forward verbatim. `buildPulumiArgs` re-adds a `-s` only for ops that accept
78
- * one, so ops like `whoami` don't receive a rejected `--stack`.
79
- */
80
34
  export function stripStackFromArgs(args) {
81
35
  for (let i = args.length - 1; i >= 0; i--) {
82
36
  if (args[i] === "--stack" || args[i] === "-s") {
@@ -87,29 +41,20 @@ export function stripStackFromArgs(args) {
87
41
  }
88
42
  }
89
43
  }
90
- // =============================================================================
91
- // Command
92
- // =============================================================================
93
44
  export function registerDeployCommand(program) {
94
45
  program
95
46
  .command("deploy")
96
47
  .description("Run pulumi with the app's deployer role (passthrough)")
97
48
  .allowUnknownOption(true)
98
49
  .allowExcessArguments(true)
99
- .helpOption(false) // Don't consume --help, pass it to pulumi
50
+ .helpOption(false)
100
51
  .action(async (_opts, cmd) => {
101
52
  const pulumiArgs = cmd.args;
102
- // Find app root
103
53
  const appRoot = findAppRoot(process.cwd());
104
54
  if (!appRoot) {
105
55
  logError("No Pulumi.yaml found. Run from within a Pulumi app directory.");
106
56
  process.exit(1);
107
57
  }
108
- // Determine the stack to credential against — from --stack/-s (mesh's
109
- // selector), else the currently-selected stack — then STRIP it from the
110
- // args. `buildPulumiArgs` re-adds `-s <stack>` only for ops that accept it,
111
- // so ops with a positional stack (`stack rm <name>`) or none (`whoami`)
112
- // aren't broken by a forced/rejected `-s`.
113
58
  const stack = parseStackFromArgs(pulumiArgs) ?? getCurrentStack(appRoot);
114
59
  stripStackFromArgs(pulumiArgs);
115
60
  if (!stack) {
@@ -118,17 +63,7 @@ export function registerDeployCommand(program) {
118
63
  " - Create a personal dev stack first: mesh stack init (it prints the exact --stack command)");
119
64
  process.exit(1);
120
65
  }
121
- // Worktree-collision guard (MESH-2013 Slice 3): a personal deploy:false
122
- // stack whose name carries no worktree token collides with the same stack
123
- // deployed from another worktree — identical SSM export paths
124
- // (ParameterAlreadyExists) and Temporal namespace. Warn on mutating ops
125
- // from a LINKED worktree so the failure names itself before pulumi hits it.
126
66
  const op = pulumiArgs.length === 0 || pulumiArgs[0]?.startsWith("-") ? "up" : pulumiArgs[0];
127
- // Stale-node_modules guard (MESH-2266): before evaluating the pulumi program,
128
- // verify the installed @mesh-tech/* deps match the lockfile. A stale install
129
- // makes pulumi evaluate OLD component code and can plan to DELETE resources
130
- // the current code keeps. Hard-stops with `pnpm install` on mismatch; a no-op
131
- // for read-only ops, a fresh install, a non-pnpm repo, or the skip env.
132
67
  assertDeployDepsFresh(appRoot, op ?? "up");
133
68
  if (op === "up" || op === "destroy") {
134
69
  const wt = resolveWorktreeIdentity(appRoot);
@@ -141,17 +76,10 @@ export function registerDeployCommand(program) {
141
76
  ` Continuing with "${stack}" — pass --stack to target a different one.`);
142
77
  }
143
78
  }
144
- // Login preflight + deployer-role assumption (shared chokepoint,
145
- // MESH-2085): resolves creds with a clear "run mesh login --device"
146
- // message on an expired/absent session, instead of failing deep in pulumi.
147
79
  const credEnv = await resolvePulumiEnv({ appRoot, stack });
148
- // Build environment — inherit current env, override AWS creds,
149
- // remove AWS_PROFILE so the assumed creds are used
150
80
  const env = { ...process.env, ...credEnv };
151
81
  delete env.AWS_PROFILE;
152
- // Default to "up" when no Pulumi subcommand is provided
153
82
  const finalArgs = buildPulumiArgs(pulumiArgs, stack);
154
- // Exec pulumi with the assumed role, targeting the resolved stack
155
83
  try {
156
84
  execFileSync("pulumi", finalArgs, {
157
85
  cwd: appRoot,
@@ -160,10 +88,7 @@ export function registerDeployCommand(program) {
160
88
  });
161
89
  }
162
90
  catch (err) {
163
- // execFileSync throws on non-zero exit. The output was already
164
- // printed via stdio: "inherit", so just exit with the same code.
165
91
  process.exit(err.status ?? 1);
166
92
  }
167
93
  });
168
94
  }
169
- //# sourceMappingURL=deploy.js.map
@@ -1,16 +1,3 @@
1
- /**
2
- * `mesh dev doctor` — preflight + on-demand diagnosis for `mesh dev`.
3
- *
4
- * Three layers kept deliberately separate so the bug-prone logic stays pure and
5
- * unit-testable without network/AWS:
6
- * 1. Engine + renderers (this section): `aggregateStatus`, `runChecks`,
7
- * `renderHuman`, `renderJson`.
8
- * 2. `DoctorContext` builder (resolves role/context/session once).
9
- * 3. The individual `Check`s (creds, tunnels, ports, …), each returning data.
10
- *
11
- * Both `mesh dev doctor` and the `mesh dev` launch preflight call `runChecks`;
12
- * see MESH-2015 (docs/superpowers/specs/2026-07-08-mesh-dev-doctor-design.md).
13
- */
14
1
  import type { SessionState } from "./dev.js";
15
2
  import type { ResolvedAwsCreds } from "../utils/aws-auth.js";
16
3
  import { type CredProbe } from "./login.js";
@@ -18,30 +5,16 @@ export type CheckStatus = "ok" | "warn" | "error";
18
5
  export type CheckPhase = "preflight" | "ondemand";
19
6
  export interface CheckResult {
20
7
  status: CheckStatus;
21
- /** One line, present tense. */
22
8
  summary: string;
23
- /** Exact command that fixes it (rendered indented under the summary). */
24
9
  remediation?: string;
25
- /** Optional extra context (PID, TTL, path, …). */
26
10
  detail?: string;
27
11
  }
28
- /**
29
- * One diagnostic. `C` is the context the check reads: `DoctorContext` for
30
- * `mesh dev doctor` (the default), `AppCheckContext` for `mesh app check` —
31
- * the engine below is shared, only the context differs.
32
- */
33
12
  export interface Check<C = DoctorContext> {
34
- /** Stable slug, e.g. `creds`, `tunnels`. */
35
13
  id: string;
36
- /** Human label. */
37
14
  title: string;
38
- /** Which contexts this check runs in. */
39
15
  phases: CheckPhase[];
40
- /** `phase` is the context of THIS run — checks may bound work tighter in
41
- * `preflight` (launch path) than in on-demand `mesh dev doctor`. */
42
16
  run(ctx: C, phase?: CheckPhase): Promise<CheckResult>;
43
17
  }
44
- /** What the renderers need from a check: its identity, not its `run`. */
45
18
  export type CheckOutcome = {
46
19
  check: Pick<Check<unknown>, "id" | "title">;
47
20
  result: CheckResult;
@@ -50,30 +23,18 @@ export interface DoctorContext {
50
23
  appRoot: string;
51
24
  stack: string;
52
25
  sessionName: string;
53
- /** Resolved deployer role ARN (incl. admin selection), or null if none. */
54
26
  deployerRole: string | null;
55
- /** `derivePlatformContext()` result (the Zitadel context), or null. */
56
27
  platformContext: string | null;
57
- /** How creds were obtained at launch; null when the probe determines it. */
58
28
  credMethod: ResolvedAwsCreds["method"] | "ambient" | null;
59
- /** Live session state (allocated ports, tunnels); null pre-launch. */
60
29
  sessionState: SessionState | null;
61
30
  }
62
- /** `error` if any error, else `warn` if any warn, else `ok` (empty → `ok`). */
63
31
  export declare function aggregateStatus(results: CheckResult[]): CheckStatus;
64
- /**
65
- * Run every check whose `phases` includes `phase`, concurrently. A check that
66
- * throws is captured as an `error` result rather than aborting the run — the
67
- * whole point of doctor is to report, never to crash.
68
- */
69
32
  export declare function runChecks<C = DoctorContext>(ctx: C, phase: CheckPhase, checks: Check<C>[]): Promise<Array<{
70
33
  check: Check<C>;
71
34
  result: CheckResult;
72
35
  }>>;
73
36
  export declare const ICONS: Record<CheckStatus, string>;
74
- /** Human-readable: one line per check + indented remediation when present. */
75
37
  export declare function renderHuman(results: CheckOutcome[]): string;
76
- /** The JSON report as data — `renderJson` serialises it; `mesh app check` nests one per app. */
77
38
  export declare function jsonReport(results: CheckOutcome[]): {
78
39
  status: CheckStatus;
79
40
  checks: Array<{
@@ -84,70 +45,27 @@ export declare function jsonReport(results: CheckOutcome[]): {
84
45
  detail: string | null;
85
46
  }>;
86
47
  };
87
- /** Machine-readable: stable key shape for tooling / future CI. */
88
48
  export declare function renderJson(results: CheckOutcome[]): string;
89
- /**
90
- * Pure mapper: a `CredProbe` → a `CheckResult` with the exact remediation.
91
- * `headless` selects the device-flow `mesh login` variant (browser flow times
92
- * out over SSH/tailscale — see the credential runbook).
93
- */
94
49
  export declare function credProbeToResult(probe: CredProbe, context: string, headless: boolean): CheckResult;
95
50
  export declare const credsCheck: Check;
96
- /**
97
- * Verify the @mesh-tech CodeArtifact token actually works BEFORE long work —
98
- * an expired token otherwise surfaces minutes later as npm's generic E401
99
- * ("try npm login", which cannot fix a CodeArtifact registry). Warn-level:
100
- * `mesh dev` itself runs installed code, so a stale token shouldn't block
101
- * launch — it should name the fix.
102
- */
103
51
  export declare const registryCheck: Check;
104
- /**
105
- * Parse `lsof -ti :PORT` + `ps -o comm= -p PID` output into the squatting
106
- * process. `lsof` may list several PIDs (one per line); we name the first.
107
- */
108
52
  export declare function parsePortSquatter(lsofOut: string, psOut: string): {
109
53
  pid: number;
110
54
  command: string;
111
55
  } | null;
112
- /** True when `serviceSrc` lives under (or equals) `repoRoot`. */
113
56
  export declare function sharesWorktreeRoot(serviceSrc: string, repoRoot: string): boolean;
114
- /** How a service port relates to the live session that should own it. */
115
57
  export type PortOwnership = "owned" | "foreign" | "dead";
116
- /**
117
- * Pure classification for the on-demand ports check. Given the PID currently
118
- * listening on a service port (`null` when nothing is) and the set of PIDs in
119
- * the live session's tmux process tree:
120
- * - `null` listener → `dead` (the service isn't running)
121
- * - listener in the session → `owned` (healthy — the session's own svc)
122
- * - listener outside it → `foreign` (a real squatter)
123
- * Mid-session the session's services are *supposed* to hold their ports, so a
124
- * naive "occupied ⇒ squatted" test misreports a healthy session (MESH-2015).
125
- */
126
58
  export declare function classifyPortListener(listenerPid: number | null, sessionPids: ReadonlySet<number>): PortOwnership;
127
- /**
128
- * Pure: expand tmux pane PIDs to the full set of PIDs in their process
129
- * subtrees, using the output of `ps -eo pid=,ppid=` (each line "PID PPID").
130
- * The roots themselves are included; unparseable lines are skipped.
131
- */
132
59
  export declare function collectSessionPids(panePids: number[], psOut: string): Set<number>;
133
60
  export declare const tmuxCheck: Check;
134
61
  export declare const portsCheck: Check;
135
- /** True when the stack config file changed after the session was launched. */
136
62
  export declare function isConfigStale(configMtimeMs: number, startedAtIso: string): boolean;
137
63
  export declare const configStalenessCheck: Check;
138
64
  export declare const worktreeCheck: Check;
139
- /** Resolve `true` iff a TCP connection to host:port succeeds within `timeoutMs`. */
140
65
  export declare function canConnect(host: string, port: number, timeoutMs?: number): Promise<boolean>;
141
66
  export declare const tunnelsCheck: Check;
142
67
  export declare const temporalCheck: Check;
143
- /** All checks, in display order. */
144
68
  export declare const ALL_CHECKS: Check[];
145
- /**
146
- * Run the full on-demand doctor against a prebuilt context, print the report,
147
- * and return the aggregate status. The caller (the `mesh dev doctor`
148
- * subcommand) owns process exit.
149
- */
150
69
  export declare function runDoctor(ctx: DoctorContext, opts: {
151
70
  json: boolean;
152
71
  }): Promise<CheckStatus>;
153
- //# sourceMappingURL=dev-doctor.d.ts.map