@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,25 +1,3 @@
1
- /**
2
- * Bare `mesh init` — the guided setup of a machine and a repo for one tenant.
3
- *
4
- * Four questions and four steps, in order:
5
- *
6
- * 1. tenant — which tenant this repo belongs to
7
- * 2. mode — local only (`mesh start` / `mesh dev`) or a deployed platform
8
- * 3. registry — package-registry access, signing in if the machine has none
9
- * 4. platform — (deployed only) `mesh login <tenant>.<env>` in-process
10
- * 5. repo — bootstrap an empty apps repo, or check an existing one
11
- * 6. skills — the agent skills the repo's packages ship
12
- *
13
- * Two identities never mix: the registry step talks to the ONE global package
14
- * registry and never needs a context; the platform step is the only place a
15
- * `<tenant>.<env>` context appears, and the local branch never mentions it.
16
- *
17
- * Every step is data (`WizardStep` → `StepResult`) so the summary, the exit
18
- * code and the `--json` document are one reducer over one list, and a step
19
- * that fails without blocking (a registry 403 — the user needs the summary to
20
- * know whom to ask) lets the rest run. Every prompt has a flag, so a runner
21
- * with `--tenant … --local --yes` sees no prompt at all.
22
- */
23
1
  import * as fs from "fs";
24
2
  import * as path from "path";
25
3
  import { execFileSync } from "child_process";
@@ -34,13 +12,10 @@ import { discoverConfigForContext, isRemoteEnvironment, readCredentials, renderN
34
12
  import { bootstrapAppsRepo, isInsidePlatformMonorepo, shouldBootstrapAppsRepo } from "../create-app.js";
35
13
  import { resolveTargetRoot, syncSkills } from "../skills.js";
36
14
  import { detectLocalTenant } from "../local/dev-local.js";
37
- /** Printed when the registry step has no session and no way to sign in. */
38
15
  export const NO_SESSION_NO_TTY_MESSAGE = "No registry session and no terminal to sign in with.\n" +
39
16
  " On a headless box: mesh registry login --device (one-time, prints a code)\n" +
40
17
  " In CI with AWS creds: mesh registry login --ci";
41
- /** Printed when a non-TTY run has no `--tenant`. */
42
18
  export const TENANT_REQUIRED_MESSAGE = "--tenant is required (no TTY for interactive mode)";
43
- /** Exit code for a Ctrl-C at a prompt: nothing half-written, conventional SIGINT code. */
44
19
  export const INTERRUPTED_EXIT_CODE = 130;
45
20
  const STEP_LABELS = {
46
21
  registry: "Registry access",
@@ -48,50 +23,20 @@ const STEP_LABELS = {
48
23
  repo: "Repo",
49
24
  skills: "Agent skills",
50
25
  };
51
- // ── pure parts ──────────────────────────────────────────────────────────────
52
- /**
53
- * The exit code for a finished run: 1 when any step failed (blocking or not
54
- * — a registry 403 still means the machine is not set up), else 0.
55
- *
56
- * @example
57
- * wizardExitCode([{ name: "Registry access", status: "fail", detail: "…", blocking: false }]); // → 1
58
- */
59
26
  export function wizardExitCode(steps) {
60
27
  return steps.some((s) => s.status === "fail") ? 1 : 0;
61
28
  }
62
- /**
63
- * The commands to run next, by mode. When the repo step did not leave an apps
64
- * repo behind, its own fix comes first — `mesh create-app` has nowhere to
65
- * scaffold until the repo exists.
66
- *
67
- * @example
68
- * wizardNextCommands({ platform: "dev" }); // → ["mesh create-app", "mesh deploy up # from the app directory"]
69
- * wizardNextCommands("local", [{ name: "Repo", status: "skip", detail: "…", fix: "git init && mesh init" }]);
70
- * // → ["git init && mesh init"]
71
- */
72
29
  export function wizardNextCommands(mode, steps = []) {
73
30
  const repo = steps.find((s) => s.name === STEP_LABELS.repo);
74
31
  const first = repo && repo.status !== "pass" && repo.fix ? repo.fix : "mesh create-app";
75
32
  return mode === "local" ? [first] : [first, "mesh deploy up # from the app directory, once it exists"];
76
33
  }
77
- /**
78
- * Whether the wizard should stop after `result`: a failing step that did not
79
- * opt out of blocking.
80
- */
81
34
  export function stepBlocks(result) {
82
35
  return result.status === "fail" && result.blocking !== false;
83
36
  }
84
- /** The mode as a short phrase for the summary heading. */
85
37
  export function describeMode(mode) {
86
38
  return mode === "local" ? "local only" : `deployed platform (${mode.platform})`;
87
39
  }
88
- /**
89
- * Render the summary check-list — the same lines for a terminal and for the
90
- * stderr side of `--json`.
91
- *
92
- * @example
93
- * renderWizardSummary({ tenant: "acme", mode: "local", steps: [], next: ["mesh create-app"] });
94
- */
95
40
  export function renderWizardSummary(outcome, opts = {}) {
96
41
  const paint = opts.color === false ? { green: (s) => s, red: (s) => s, yellow: (s) => s, dim: (s) => s, cyan: (s) => s } : chalk;
97
42
  const icon = (status) => status === "pass" ? paint.green("✔") : status === "fail" ? paint.red("✘") : status === "warn" ? paint.yellow("▲") : paint.dim("–");
@@ -106,15 +51,6 @@ export function renderWizardSummary(outcome, opts = {}) {
106
51
  lines.push(` ${cmd}`);
107
52
  return lines.join("\n");
108
53
  }
109
- /**
110
- * Resolve the answers that need no prompt: flags first, then `--yes`
111
- * defaults, then what the repo already records. Returns the questions still
112
- * open so the caller prompts for exactly those.
113
- *
114
- * @example
115
- * resolveAnswers({ tenant: "acme", local: true }, null, false)
116
- * // → { tenant: "acme", mode: "local", open: [] }
117
- */
118
54
  export function resolveAnswers(opts, recorded, interactive) {
119
55
  const open = [];
120
56
  let tenant = opts.tenant;
@@ -144,8 +80,6 @@ export function resolveAnswers(opts, recorded, interactive) {
144
80
  }
145
81
  return { tenant, mode, open };
146
82
  }
147
- // ── steps ───────────────────────────────────────────────────────────────────
148
- /** The registry step, exported so a test can drive the real thing through its seams. */
149
83
  export const registryStep = {
150
84
  name: "registry",
151
85
  async run(ctx) {
@@ -178,9 +112,6 @@ export const registryStep = {
178
112
  catch (err) {
179
113
  const message = err instanceof Error ? err.message : String(err);
180
114
  if (err instanceof RegistryNotAuthorizedError) {
181
- // The account is fine; the grant is missing. Not blocking: the repo
182
- // steps still tell the user what else is set up, and the summary
183
- // carries the "whom to ask" line.
184
115
  return {
185
116
  name,
186
117
  status: "fail",
@@ -234,14 +165,6 @@ const platformStep = {
234
165
  };
235
166
  },
236
167
  };
237
- /**
238
- * Classify `cwd` for the repo step. Pure over the filesystem; exported for
239
- * tests.
240
- *
241
- * @example
242
- * classifyRepo("/tmp/empty-git-clone"); // → "empty-apps-repo"
243
- * classifyRepo("/tmp/new-empty-folder"); // → "empty-dir"
244
- */
245
168
  export function classifyRepo(cwd) {
246
169
  if (isInsidePlatformMonorepo(cwd))
247
170
  return { kind: "platform-monorepo", root: resolveTargetRoot(cwd) };
@@ -259,13 +182,10 @@ export function classifyRepo(cwd) {
259
182
  return { kind: "apps-repo", root };
260
183
  return { kind: "other-repo", root };
261
184
  }
262
- /** `git init` on a folder, quietly; git's own complaint is the thrown error's message. */
263
185
  function gitInit(dir) {
264
186
  execFileSync("git", ["init", "-q"], { cwd: dir, stdio: ["ignore", "ignore", "pipe"] });
265
187
  }
266
- /** The fix a folder that is not yet a repo needs before anything can be scaffolded in it. */
267
188
  export const INIT_REPO_FIX = "git init && mesh init";
268
- /** The repo step: classify the cwd, then bootstrap, warn or skip accordingly. */
269
189
  export const repoStep = {
270
190
  name: "repo",
271
191
  async run(ctx) {
@@ -350,10 +270,6 @@ const skillsStep = {
350
270
  return { name, status: "skip", detail: "no apps repo to install skills into" };
351
271
  }
352
272
  try {
353
- // In fix mode a `false` return is not a failure: the base skills are
354
- // written; the platform skills arrive with the packages, so the sync
355
- // asks to be re-run after the first install — the doctor reads it the
356
- // same way.
357
273
  const complete = syncSkills(root);
358
274
  return complete
359
275
  ? { name, status: "pass", detail: "base skills + Intent discovery in sync" }
@@ -364,15 +280,7 @@ const skillsStep = {
364
280
  }
365
281
  },
366
282
  };
367
- /** The steps in run order. Exported so tests can drive the reducer with fakes. */
368
283
  export const WIZARD_STEPS = [registryStep, platformStep, repoStep, skillsStep];
369
- /**
370
- * Run `steps` in order, stopping after the first blocking failure. Pure over
371
- * the steps' results — the reducer the CLI and the tests share.
372
- *
373
- * @example
374
- * const steps = await runWizardSteps(ctx, WIZARD_STEPS);
375
- */
376
284
  export async function runWizardSteps(ctx, steps) {
377
285
  const results = [];
378
286
  for (const step of steps) {
@@ -383,7 +291,6 @@ export async function runWizardSteps(ctx, steps) {
383
291
  }
384
292
  return results;
385
293
  }
386
- // ── the command ─────────────────────────────────────────────────────────────
387
294
  async function inquirerPrompts() {
388
295
  const [{ default: input }, { default: select }, { default: confirm }] = await Promise.all([
389
296
  import("@inquirer/input"),
@@ -399,17 +306,6 @@ async function inquirerPrompts() {
399
306
  function isInterrupt(err) {
400
307
  return err instanceof Error && err.name === "ExitPromptError";
401
308
  }
402
- /**
403
- * The wizard entry point behind bare `mesh init`.
404
- *
405
- * Returns the process exit code instead of exiting, so the caller decides
406
- * (and a test can assert on it). Ctrl-C at a prompt returns 130 with nothing
407
- * written. All human output goes to stderr under `--json`, leaving stdout for
408
- * the one document.
409
- *
410
- * @example
411
- * process.exitCode = await runInitWizard({ tenant: "acme", local: true, yes: true });
412
- */
413
309
  export async function runInitWizard(opts, deps = {}) {
414
310
  const cwd = deps.cwd ?? process.cwd();
415
311
  const interactive = deps.interactive ?? Boolean(process.stdin.isTTY && process.stdout.isTTY);
@@ -475,10 +371,6 @@ export async function runInitWizard(opts, deps = {}) {
475
371
  };
476
372
  logInfo(`Setting up tenant '${tenant}' (${describeMode(mode)})…`);
477
373
  const steps = await runWizardSteps(ctx, deps.steps ?? WIZARD_STEPS);
478
- // Persist what was answered so a re-run pre-fills — only where there is a
479
- // repo of ours to record it in.
480
- // Only a Mesh apps repo (or the empty clone that just became one) gets
481
- // the record — never an unrelated checkout the wizard happens to run in.
482
374
  const { kind, root } = classifyRepo(cwd);
483
375
  if (!opts.skipRepo && (kind === "apps-repo" || kind === "empty-apps-repo")) {
484
376
  const written = writeMeshJson(root, { tenant, platform: mode === "local" ? "local" : mode.platform });
@@ -509,4 +401,3 @@ export async function runInitWizard(opts, deps = {}) {
509
401
  console.log = origLog;
510
402
  }
511
403
  }
512
- //# sourceMappingURL=wizard.js.map
@@ -1,28 +1,3 @@
1
- /**
2
- * mesh init — bare: the guided setup wizard (`./init/wizard.ts`);
3
- * `init platform <tenant>`: scaffold a platform repo;
4
- * `init app-tenant`: the doctor for a tenant apps repo (design §3.1,
5
- * AC A1–A3), described below.
6
- *
7
- * Runs a read-only check pipeline; every failure names the exact `mesh`
8
- * command that fixes it (never a person — A2). Re-running IS the doctor
9
- * (A3): exit 0 iff everything passes. `--json` is the agent surface (A5);
10
- * `--fix` applies the developer-scope fixes directly (registry token
11
- * refresh, skills sync) and leaves operator actions as remediations.
12
- *
13
- * Checks (API-first; local platform = the same Hub API on localhost):
14
- * 1. CLI auth — cached `mesh login` credentials for the context
15
- * 2. Registry access — the CodeArtifact token in ~/.npmrc is accepted by the
16
- * registry (a live probe, not a substring match — an
17
- * expired token used to report `pass`); local: skipped
18
- * 2b. Public npm not hijacked — no unscoped `registry=<codeartifact>` in
19
- * ~/.npmrc making CodeArtifact the DEFAULT registry
20
- * 3. Platform tenant — Hub API /tenants (the platform registry)
21
- * 4. App tenant — tenant present in the Hub registry
22
- * 5. Deployer role — mesh:deployerRole config present (cloud contexts)
23
- * 6. Repo shape — pnpm workspace + apps layout create-app expects
24
- * 7. Skills wired — `mesh skills sync --check`
25
- */
26
1
  import { Command } from "commander";
27
2
  import { probeRegistryToken } from "../utils/auth-preflight.js";
28
3
  type CheckStatus = "pass" | "warn" | "fail";
@@ -30,44 +5,14 @@ interface CheckResult {
30
5
  name: string;
31
6
  status: CheckStatus;
32
7
  detail: string;
33
- /** The exact command that remediates (A2: commands, never people). */
34
8
  fix?: string;
35
9
  }
36
- /**
37
- * The remediation string the doctor prints for a registry fault. It must render
38
- * the command `--fix` actually executes: `runRegistryLogin` is called with the
39
- * doctor's own `--profile` (or none), so advertising a hardcoded
40
- * `--profile mesh-dev` would be a command the doctor never runs.
41
- *
42
- * The registry is global, so the command never carries a context — the bare
43
- * form is the one that works on a machine that has never signed in.
44
- *
45
- * @example
46
- * registryFixCommand(); // → "mesh registry login"
47
- * registryFixCommand("mesh-dev"); // → "mesh registry login --profile mesh-dev"
48
- */
49
10
  export declare function registryFixCommand(profile?: string): string;
50
- /**
51
- * The two registry checks, exported for tests.
52
- *
53
- * 1. **Registry access** — does the token in ~/.npmrc actually work? The old
54
- * check was `content.includes("codeartifact")`, which reports `pass` for a
55
- * token that expired two days ago. `probeRegistryToken` asks the registry.
56
- * 2. **Public npm not hijacked** — is there an *unscoped* `registry=` line
57
- * pointing at CodeArtifact? A bare `aws codeartifact login` (no
58
- * `--namespace @mesh-tech`) writes one, which routes every public package
59
- * through CodeArtifact and makes the whole of npm 401 at the 12h token
60
- * expiry. `mesh registry login` now removes it, so it is the fix for both.
61
- */
62
11
  export declare function registryChecks(args: {
63
12
  fix: boolean;
64
- /** AWS SSO profile to log in with — threaded from `mesh init app-tenant --profile`. */
65
13
  profile?: string;
66
- /** Test seam — defaults to the real network probe against ~/.npmrc. */
67
14
  probe?: typeof probeRegistryToken;
68
- /** Test seam — defaults to `runRegistryLogin` (context-free: the registry is global). */
69
15
  login?: () => Promise<void>;
70
16
  }): Promise<CheckResult[]>;
71
17
  export declare function registerInitCommands(program: Command): void;
72
18
  export {};
73
- //# sourceMappingURL=init.d.ts.map
@@ -1,28 +1,3 @@
1
- /**
2
- * mesh init — bare: the guided setup wizard (`./init/wizard.ts`);
3
- * `init platform <tenant>`: scaffold a platform repo;
4
- * `init app-tenant`: the doctor for a tenant apps repo (design §3.1,
5
- * AC A1–A3), described below.
6
- *
7
- * Runs a read-only check pipeline; every failure names the exact `mesh`
8
- * command that fixes it (never a person — A2). Re-running IS the doctor
9
- * (A3): exit 0 iff everything passes. `--json` is the agent surface (A5);
10
- * `--fix` applies the developer-scope fixes directly (registry token
11
- * refresh, skills sync) and leaves operator actions as remediations.
12
- *
13
- * Checks (API-first; local platform = the same Hub API on localhost):
14
- * 1. CLI auth — cached `mesh login` credentials for the context
15
- * 2. Registry access — the CodeArtifact token in ~/.npmrc is accepted by the
16
- * registry (a live probe, not a substring match — an
17
- * expired token used to report `pass`); local: skipped
18
- * 2b. Public npm not hijacked — no unscoped `registry=<codeartifact>` in
19
- * ~/.npmrc making CodeArtifact the DEFAULT registry
20
- * 3. Platform tenant — Hub API /tenants (the platform registry)
21
- * 4. App tenant — tenant present in the Hub registry
22
- * 5. Deployer role — mesh:deployerRole config present (cloud contexts)
23
- * 6. Repo shape — pnpm workspace + apps layout create-app expects
24
- * 7. Skills wired — `mesh skills sync --check`
25
- */
26
1
  import chalk from "chalk";
27
2
  import * as fs from "fs";
28
3
  import * as path from "path";
@@ -61,34 +36,9 @@ function readHomeNpmrc() {
61
36
  return "";
62
37
  }
63
38
  }
64
- /**
65
- * The remediation string the doctor prints for a registry fault. It must render
66
- * the command `--fix` actually executes: `runRegistryLogin` is called with the
67
- * doctor's own `--profile` (or none), so advertising a hardcoded
68
- * `--profile mesh-dev` would be a command the doctor never runs.
69
- *
70
- * The registry is global, so the command never carries a context — the bare
71
- * form is the one that works on a machine that has never signed in.
72
- *
73
- * @example
74
- * registryFixCommand(); // → "mesh registry login"
75
- * registryFixCommand("mesh-dev"); // → "mesh registry login --profile mesh-dev"
76
- */
77
39
  export function registryFixCommand(profile) {
78
40
  return profile ? `mesh registry login --profile ${profile}` : "mesh registry login";
79
41
  }
80
- /**
81
- * The two registry checks, exported for tests.
82
- *
83
- * 1. **Registry access** — does the token in ~/.npmrc actually work? The old
84
- * check was `content.includes("codeartifact")`, which reports `pass` for a
85
- * token that expired two days ago. `probeRegistryToken` asks the registry.
86
- * 2. **Public npm not hijacked** — is there an *unscoped* `registry=` line
87
- * pointing at CodeArtifact? A bare `aws codeartifact login` (no
88
- * `--namespace @mesh-tech`) writes one, which routes every public package
89
- * through CodeArtifact and makes the whole of npm 401 at the 12h token
90
- * expiry. `mesh registry login` now removes it, so it is the fix for both.
91
- */
92
42
  export async function registryChecks(args) {
93
43
  const { fix, profile } = args;
94
44
  const probe = args.probe ?? probeRegistryToken;
@@ -97,14 +47,11 @@ export async function registryChecks(args) {
97
47
  const { runRegistryLogin } = await import("./registry.js");
98
48
  await runRegistryLogin(undefined, profile ? { profile } : {});
99
49
  });
100
- // The command we ADVERTISE must be the command `--fix` RUNS — otherwise the
101
- // doctor tells you to pass a profile it then silently drops.
102
50
  const REGISTRY_FIX = registryFixCommand(profile);
103
51
  let tokenState = await probe({ npmrcPath: homeNpmrcPath() });
104
52
  let hijack = findUnscopedCodeArtifactRegistry(readHomeNpmrc());
105
53
  let repaired = false;
106
54
  let loginError = null;
107
- // One login repairs both: it refreshes the token AND strips the unscoped line.
108
55
  if (fix && (tokenState.state === "expired" || tokenState.state === "missing" || hijack)) {
109
56
  try {
110
57
  await login();
@@ -134,7 +81,6 @@ export async function registryChecks(args) {
134
81
  });
135
82
  }
136
83
  else if (tokenState.state === "unreachable") {
137
- // A network fault is not an auth fault — don't send someone to `aws sso login`.
138
84
  checks.push({
139
85
  name: "Registry access",
140
86
  status: "warn",
@@ -171,7 +117,6 @@ async function runChecks(args) {
171
117
  const { root, tenant, context, hubUrl, fix, profile } = args;
172
118
  const checks = [];
173
119
  const local = isLocalContext(context);
174
- // 1. CLI auth
175
120
  const creds = readCredentials(context);
176
121
  const expired = creds ? new Date(creds.expiresAt).getTime() < Date.now() : true;
177
122
  checks.push(creds && !expired
@@ -183,7 +128,6 @@ async function runChecks(args) {
183
128
  fix: `mesh login ${context}`,
184
129
  });
185
130
  const accessToken = creds && !expired ? creds.accessToken : null;
186
- // 2 + 2b. Registry access (CodeArtifact) — the local platform has no registry
187
131
  if (local) {
188
132
  checks.push({ name: "Registry access", status: "pass", detail: "local context — no registry required" });
189
133
  checks.push({ name: "Public npm not hijacked", status: "pass", detail: "local context — no registry required" });
@@ -191,7 +135,6 @@ async function runChecks(args) {
191
135
  else {
192
136
  checks.push(...(await registryChecks({ fix, profile })));
193
137
  }
194
- // 3 + 4. Platform tenant + app tenant via the Hub API (the registry)
195
138
  const hub = await probeHubTenants(hubUrl, accessToken);
196
139
  if (!hub.ok) {
197
140
  const fixCmd = local ? "mesh start" : `mesh login ${context}`;
@@ -221,7 +164,6 @@ async function runChecks(args) {
221
164
  fix: local ? "mesh dev" : `mesh tenant add ${tenant} # in the platform repo, then: mesh deploy up`,
222
165
  });
223
166
  }
224
- // 5. Deployer role (cloud contexts only — local has no IAM)
225
167
  if (local) {
226
168
  checks.push({ name: "Deployer role", status: "pass", detail: "local context — no deployer role required" });
227
169
  }
@@ -239,7 +181,6 @@ async function runChecks(args) {
239
181
  fix: "mesh create-app # scaffolds stack config with the deployer role",
240
182
  });
241
183
  }
242
- // 6. Repo shape (what create-app/mesh dev expect)
243
184
  const shapeProblems = [];
244
185
  if (!fs.existsSync(path.join(root, "package.json")))
245
186
  shapeProblems.push("package.json");
@@ -255,7 +196,6 @@ async function runChecks(args) {
255
196
  detail: `missing: ${shapeProblems.join(", ")}`,
256
197
  fix: "mesh create-app # scaffold an app (workspace files included)",
257
198
  });
258
- // 7. Skills wired
259
199
  const skillsOk = fix ? syncSkills(root) : syncSkills(root, { check: true });
260
200
  checks.push(skillsOk
261
201
  ? { name: "Agent skills", status: "pass", detail: "base skills + Intent discovery in sync" }
@@ -270,10 +210,6 @@ async function runChecks(args) {
270
210
  export function registerInitCommands(program) {
271
211
  const init = program
272
212
  .command("init")
273
- // The wizard's flags (--tenant, --profile, --json, …) overlap the
274
- // subcommands' own. Positional options keep them apart: options before a
275
- // subcommand name belong to the wizard, options after it to the subcommand,
276
- // so `mesh init app-tenant --json` still reaches the doctor unchanged.
277
213
  .enablePositionalOptions()
278
214
  .description("Set up this machine and repo for a tenant — a guided wizard with no subcommand (tenant, local or deployed, package-registry sign-in, repo, skills); `init platform` scaffolds a platform repo, `init app-tenant` is the apps-repo doctor")
279
215
  .option("--tenant <name>", "app tenant this repo belongs to (prompted when omitted on a TTY)")
@@ -349,9 +285,6 @@ export function registerInitCommands(program) {
349
285
  if (!opts.json) {
350
286
  logInfo(`Checking app-tenant repo ${root} (tenant '${tenant}', context '${opts.context}')…`);
351
287
  }
352
- // Under --json, stdout is the machine surface (A5): route the check
353
- // helpers' human chatter (syncSkills / registry login logInfo etc.) to
354
- // stderr so stdout stays pure parseable JSON.
355
288
  const origLog = console.log;
356
289
  if (opts.json)
357
290
  console.log = (...a) => console.error(...a);
@@ -369,8 +302,6 @@ export function registerInitCommands(program) {
369
302
  finally {
370
303
  console.log = origLog;
371
304
  }
372
- // Warns are advisory (expected on a fresh repo pre-`mesh dev`): only
373
- // hard failures gate the exit code (A3). `ok` mirrors that contract.
374
305
  const ok = !checks.some((c) => c.status === "fail");
375
306
  if (opts.json) {
376
307
  emitJsonPayload({ ok, root, tenant, context: opts.context, checks });
@@ -393,4 +324,3 @@ export function registerInitCommands(program) {
393
324
  }
394
325
  });
395
326
  }
396
- //# sourceMappingURL=init.js.map
@@ -1,28 +1,5 @@
1
1
  import { Command } from "commander";
2
- /**
3
- * `mesh install-shim` — make bare `mesh` work on the PATH without a build.
4
- *
5
- * People and agents reach for `mesh dev`, not `pnpm exec mesh dev`. Getting a
6
- * bare `mesh` onto the PATH inherently needs one PATH entry — but it can be a
7
- * build-free, cwd-aware resolver: a tiny shell script that, on each run, walks
8
- * up from the current directory to the nearest workspace `node_modules/.bin/mesh`
9
- * and execs it. That `.bin/mesh` is the `bin/mesh.mjs` launcher, which runs the
10
- * CLI from TypeScript source — so bare `mesh` always runs the LOCAL source of
11
- * whatever worktree/app you are in, with no build and nothing global to keep in
12
- * sync (MESH-2261). Run this once; it survives worktree switches and pulls.
13
- *
14
- * Outside any workspace it falls through to a globally installed CLI
15
- * (MESH-2869). The shim sits in `~/.local/bin`, which is typically ahead of the
16
- * npm global bin on PATH, so without that fall-through it *shadows*
17
- * `npm i -g @mesh-tech/mesh-cli`: the new developer's very first commands —
18
- * `mesh --version`, `mesh login mesh.dev`, run from `~` — die with "not inside a
19
- * Mesh workspace" even though the CLI is installed and working.
20
- */
21
- /** The cwd-aware resolver written to the PATH. Pure so it can be unit-tested. */
22
2
  export declare function shimScript(): string;
23
- /** Default install target: ~/.local/bin (conventional per-user PATH dir). */
24
3
  export declare function defaultShimDir(): string;
25
- /** True if `dir` is a component of the PATH env string. */
26
4
  export declare function dirOnPath(dir: string, pathEnv: string | undefined): boolean;
27
5
  export declare function registerInstallShimCommand(program: Command): void;
28
- //# sourceMappingURL=install-shim.d.ts.map
@@ -3,35 +3,15 @@ import * as fs from "fs";
3
3
  import * as os from "os";
4
4
  import * as path from "path";
5
5
  import { logError, logInfo, logSuccess, logWarn } from "../utils/log.js";
6
- /**
7
- * `mesh install-shim` — make bare `mesh` work on the PATH without a build.
8
- *
9
- * People and agents reach for `mesh dev`, not `pnpm exec mesh dev`. Getting a
10
- * bare `mesh` onto the PATH inherently needs one PATH entry — but it can be a
11
- * build-free, cwd-aware resolver: a tiny shell script that, on each run, walks
12
- * up from the current directory to the nearest workspace `node_modules/.bin/mesh`
13
- * and execs it. That `.bin/mesh` is the `bin/mesh.mjs` launcher, which runs the
14
- * CLI from TypeScript source — so bare `mesh` always runs the LOCAL source of
15
- * whatever worktree/app you are in, with no build and nothing global to keep in
16
- * sync (MESH-2261). Run this once; it survives worktree switches and pulls.
17
- *
18
- * Outside any workspace it falls through to a globally installed CLI
19
- * (MESH-2869). The shim sits in `~/.local/bin`, which is typically ahead of the
20
- * npm global bin on PATH, so without that fall-through it *shadows*
21
- * `npm i -g @mesh-tech/mesh-cli`: the new developer's very first commands —
22
- * `mesh --version`, `mesh login mesh.dev`, run from `~` — die with "not inside a
23
- * Mesh workspace" even though the CLI is installed and working.
24
- */
25
- /** The cwd-aware resolver written to the PATH. Pure so it can be unit-tested. */
26
6
  export function shimScript() {
27
7
  return `#!/bin/sh
28
- # mesh — canonical launcher shim (installed by \`mesh install-shim\`, MESH-2261).
8
+ # mesh — canonical launcher shim (installed by \`mesh install-shim\`).
29
9
  # Walks up from the current directory to the nearest workspace mesh CLI and runs
30
10
  # it. That resolves to bin/mesh.mjs, which runs the CLI from TypeScript source —
31
11
  # so this always runs the LOCAL source of whatever worktree/app you are in, with
32
12
  # no build step. Nothing here is version-pinned; do not edit by hand.
33
13
  #
34
- # Outside a workspace it hands off to a globally installed mesh CLI (MESH-2869).
14
+ # Outside a workspace it hands off to a globally installed mesh CLI.
35
15
  # Without that hand-off the shim shadows \`npm i -g @mesh-tech/mesh-cli\` on the
36
16
  # PATH and \`mesh login\` is unreachable from the home directory — which is the
37
17
  # very first thing a new developer runs.
@@ -94,11 +74,9 @@ echo " Or cd into your app/repo (after 'pnpm install') and use 'pnpm exec m
94
74
  exit 1
95
75
  `;
96
76
  }
97
- /** Default install target: ~/.local/bin (conventional per-user PATH dir). */
98
77
  export function defaultShimDir() {
99
78
  return path.join(os.homedir(), ".local", "bin");
100
79
  }
101
- /** True if `dir` is a component of the PATH env string. */
102
80
  export function dirOnPath(dir, pathEnv) {
103
81
  if (!pathEnv)
104
82
  return false;
@@ -136,9 +114,6 @@ export function registerInstallShimCommand(program) {
136
114
  else {
137
115
  logInfo("Bare `mesh <cmd>` now runs the local source of whatever workspace you're in.");
138
116
  }
139
- // Post-install self-test: run the freshly installed shim and record a full
140
- // diagnostic (env + stdout/stderr + exit) to a file, so a failure is
141
- // debuggable without copy-pasting terminal output.
142
117
  const diagPath = path.join(os.tmpdir(), "mesh-shim-selftest.log");
143
118
  let stdout = "";
144
119
  let stderr = "";
@@ -176,7 +151,6 @@ export function registerInstallShimCommand(program) {
176
151
  fs.writeFileSync(diagPath, diag);
177
152
  }
178
153
  catch {
179
- /* diagnostics are best-effort */
180
154
  }
181
155
  if (ok && /Commands:|Usage:/.test(stdout)) {
182
156
  logSuccess(`Self-test passed: \`mesh --help\` ran cleanly. Diagnostic: ${diagPath}`);
@@ -188,4 +162,3 @@ export function registerInstallShimCommand(program) {
188
162
  }
189
163
  });
190
164
  }
191
- //# sourceMappingURL=install-shim.js.map
@@ -1,109 +1,29 @@
1
- /**
2
- * App-tenant auth auto-provisioning for the local platform — the local analog
3
- * of what the Pulumi components do in the cloud, per the approved Zitadel
4
- * tenant-auth pattern (Org / Project / Application / Service User):
5
- *
6
- * Org = app tenant (ZitadelTenantIdentity parity)
7
- * Project = one per app, (ZitadelAppIdentity parity —
8
- * name = authz schema namespace the app IS the authz boundary)
9
- * Application = one per service inside it (API app, Basic creds)
10
- * Secret = mesh/{tenant}/{env}/apps/{app}/zitadel/{service}
11
- * (ministack Secrets Manager — same canonical path as cloud)
12
- *
13
- * `mesh dev --local` calls this on startup so scaffolding + running an app
14
- * auto-creates its auth config — no Pulumi deploy, no manual Zitadel steps.
15
- * Idempotent: search-before-create everywhere; the credential secret is only
16
- * written when the application is first created (Zitadel returns the secret
17
- * once).
18
- */
19
1
  export interface AppTenantAuthArgs {
20
- /** App tenant (org name), e.g. "acme" */
21
2
  tenant: string;
22
- /** App name = project name = authz schema namespace */
23
3
  app: string;
24
- /** Service names → one API application each (api, worker, …) */
25
4
  services: string[];
26
- /**
27
- * App-declared project roles (package.json → mesh.auth.roles). Created on
28
- * the app's Zitadel project and granted to the local `{app}-m2m` caller so
29
- * role-scoped services (roles claim → scopes) accept its tokens.
30
- */
31
5
  roles?: string[];
32
6
  }
33
7
  export interface ProvisionedAuth {
34
8
  orgId: string;
35
9
  projectId: string;
36
- /** Services whose application (and secret) was created this run */
37
10
  created: string[];
38
11
  }
39
12
  export declare function authSecretPath(tenant: string, app: string, service: string): string;
40
- /**
41
- * Register the running app in the local platform registry — the same
42
- * self-registration path deployed apps use (/mesh-platform/{tenant}/{env}/
43
- * apps/{app}/meta), so StackPort (and the local Hub once its images land)
44
- * can visualize local apps.
45
- */
46
13
  export declare function registerLocalApp(args: AppTenantAuthArgs & {
47
14
  ports?: Record<string, number>;
48
- /** ExternalService names the app's services consume (ExternalService.link()
49
- * parity) — the Hub derives Integrations consumers + uptime from these. */
50
15
  links?: string[];
51
- /** The app's own version (its package.json), stamped like a deploy. */
52
16
  version?: string;
53
- /** Service kind discriminators from the session's dev output. A
54
- * `"dagster"` entry makes this registration also write the Dagster
55
- * discovery record the Hub's Data section reads. */
56
17
  kinds?: Record<string, string>;
57
18
  }): Promise<string>;
58
- /**
59
- * Reconcile the platform registry from Zitadel — every app-tenant org (and
60
- * its projects = apps, applications = services) provisioned in Zitadel gets
61
- * a Hub-readable registration, even if the app hasn't been run since it was
62
- * provisioned. Zitadel is the auth source of truth; the registry mirrors it,
63
- * exactly like the cloud where ZitadelTenantIdentity/ZitadelAppIdentity and
64
- * the app's self-registration both flow from the same deploy. Idempotent:
65
- * existing per-stack registrations (which carry live ports/URLs from
66
- * `mesh dev --local`) are never overwritten.
67
- */
68
19
  export declare function reconcileRegistryFromZitadel(): Promise<{
69
20
  tenants: string[];
70
21
  apps: number;
71
22
  }>;
72
- /**
73
- * Ensure a service has a BROWSER sign-in, not just an API client.
74
- *
75
- * `ensureServiceApp` gives every service a Zitadel **API** application, which is
76
- * what a machine caller authenticates with. A person cannot sign in to one:
77
- * there is no authorization endpoint and no redirect URI, so the Hub's
78
- * Access → Sign-in tab reports the app has no browser login and refuses to
79
- * create a user — correctly, since the account would have nowhere to log in.
80
- *
81
- * An app declares which of its services carry a login in `package.json`:
82
- *
83
- * ```json
84
- * { "mesh": { "auth": { "signIn": ["ui"] } } }
85
- * ```
86
- *
87
- * which mirrors what the Pulumi program expresses as a `web` OIDC application
88
- * on `ZitadelAppIdentity`. Deployed, the redirect URI comes from the service's
89
- * public hostname; locally it is the port `mesh dev` allocated, so this runs
90
- * AFTER port allocation and re-asserts the URIs on every launch — a session
91
- * that lands on a different port must not leave the previous one registered as
92
- * the only valid callback.
93
- *
94
- * Idempotent, and best-effort at the call site: a missing sign-in app degrades
95
- * the Access tab, it does not stop the dev loop.
96
- */
97
23
  export declare function ensureSignInApp(args: {
98
24
  tenant: string;
99
25
  app: string;
100
26
  service: string;
101
- /** Origin the service is reachable at, e.g. `http://localhost:40881`. */
102
27
  baseUrl: string;
103
28
  }): Promise<void>;
104
- /**
105
- * Ensure the app tenant's full auth config exists (org → project →
106
- * application-per-service → credential secrets).
107
- */
108
29
  export declare function ensureAppTenantAuth(args: AppTenantAuthArgs): Promise<ProvisionedAuth>;
109
- //# sourceMappingURL=auth-provision.d.ts.map