@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,27 +1,6 @@
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";
3
+ import { execFileSync } from "child_process";
25
4
  import chalk from "chalk";
26
5
  import { logInfo, logWarn } from "../../utils/log.js";
27
6
  import { MeshCliError, emitJsonPayload } from "../../utils/errors.js";
@@ -33,13 +12,10 @@ import { discoverConfigForContext, isRemoteEnvironment, readCredentials, renderN
33
12
  import { bootstrapAppsRepo, isInsidePlatformMonorepo, shouldBootstrapAppsRepo } from "../create-app.js";
34
13
  import { resolveTargetRoot, syncSkills } from "../skills.js";
35
14
  import { detectLocalTenant } from "../local/dev-local.js";
36
- /** Printed when the registry step has no session and no way to sign in. */
37
15
  export const NO_SESSION_NO_TTY_MESSAGE = "No registry session and no terminal to sign in with.\n" +
38
16
  " On a headless box: mesh registry login --device (one-time, prints a code)\n" +
39
17
  " In CI with AWS creds: mesh registry login --ci";
40
- /** Printed when a non-TTY run has no `--tenant`. */
41
18
  export const TENANT_REQUIRED_MESSAGE = "--tenant is required (no TTY for interactive mode)";
42
- /** Exit code for a Ctrl-C at a prompt: nothing half-written, conventional SIGINT code. */
43
19
  export const INTERRUPTED_EXIT_CODE = 130;
44
20
  const STEP_LABELS = {
45
21
  registry: "Registry access",
@@ -47,46 +23,20 @@ const STEP_LABELS = {
47
23
  repo: "Repo",
48
24
  skills: "Agent skills",
49
25
  };
50
- // ── pure parts ──────────────────────────────────────────────────────────────
51
- /**
52
- * The exit code for a finished run: 1 when any step failed (blocking or not
53
- * — a registry 403 still means the machine is not set up), else 0.
54
- *
55
- * @example
56
- * wizardExitCode([{ name: "Registry access", status: "fail", detail: "…", blocking: false }]); // → 1
57
- */
58
26
  export function wizardExitCode(steps) {
59
27
  return steps.some((s) => s.status === "fail") ? 1 : 0;
60
28
  }
61
- /**
62
- * The commands to run next, by mode.
63
- *
64
- * @example
65
- * wizardNextCommands({ platform: "dev" }); // → ["mesh create-app", "mesh deploy up # from the app directory"]
66
- */
67
- export function wizardNextCommands(mode) {
68
- return mode === "local"
69
- ? ["mesh create-app"]
70
- : ["mesh create-app", "mesh deploy up # from the app directory, once it exists"];
29
+ export function wizardNextCommands(mode, steps = []) {
30
+ const repo = steps.find((s) => s.name === STEP_LABELS.repo);
31
+ const first = repo && repo.status !== "pass" && repo.fix ? repo.fix : "mesh create-app";
32
+ return mode === "local" ? [first] : [first, "mesh deploy up # from the app directory, once it exists"];
71
33
  }
72
- /**
73
- * Whether the wizard should stop after `result`: a failing step that did not
74
- * opt out of blocking.
75
- */
76
34
  export function stepBlocks(result) {
77
35
  return result.status === "fail" && result.blocking !== false;
78
36
  }
79
- /** The mode as a short phrase for the summary heading. */
80
37
  export function describeMode(mode) {
81
38
  return mode === "local" ? "local only" : `deployed platform (${mode.platform})`;
82
39
  }
83
- /**
84
- * Render the summary check-list — the same lines for a terminal and for the
85
- * stderr side of `--json`.
86
- *
87
- * @example
88
- * renderWizardSummary({ tenant: "acme", mode: "local", steps: [], next: ["mesh create-app"] });
89
- */
90
40
  export function renderWizardSummary(outcome, opts = {}) {
91
41
  const paint = opts.color === false ? { green: (s) => s, red: (s) => s, yellow: (s) => s, dim: (s) => s, cyan: (s) => s } : chalk;
92
42
  const icon = (status) => status === "pass" ? paint.green("✔") : status === "fail" ? paint.red("✘") : status === "warn" ? paint.yellow("▲") : paint.dim("–");
@@ -101,15 +51,6 @@ export function renderWizardSummary(outcome, opts = {}) {
101
51
  lines.push(` ${cmd}`);
102
52
  return lines.join("\n");
103
53
  }
104
- /**
105
- * Resolve the answers that need no prompt: flags first, then `--yes`
106
- * defaults, then what the repo already records. Returns the questions still
107
- * open so the caller prompts for exactly those.
108
- *
109
- * @example
110
- * resolveAnswers({ tenant: "acme", local: true }, null, false)
111
- * // → { tenant: "acme", mode: "local", open: [] }
112
- */
113
54
  export function resolveAnswers(opts, recorded, interactive) {
114
55
  const open = [];
115
56
  let tenant = opts.tenant;
@@ -139,8 +80,6 @@ export function resolveAnswers(opts, recorded, interactive) {
139
80
  }
140
81
  return { tenant, mode, open };
141
82
  }
142
- // ── steps ───────────────────────────────────────────────────────────────────
143
- /** The registry step, exported so a test can drive the real thing through its seams. */
144
83
  export const registryStep = {
145
84
  name: "registry",
146
85
  async run(ctx) {
@@ -173,9 +112,6 @@ export const registryStep = {
173
112
  catch (err) {
174
113
  const message = err instanceof Error ? err.message : String(err);
175
114
  if (err instanceof RegistryNotAuthorizedError) {
176
- // The account is fine; the grant is missing. Not blocking: the repo
177
- // steps still tell the user what else is set up, and the summary
178
- // carries the "whom to ask" line.
179
115
  return {
180
116
  name,
181
117
  status: "fail",
@@ -229,13 +165,6 @@ const platformStep = {
229
165
  };
230
166
  },
231
167
  };
232
- /**
233
- * Classify `cwd` for the repo step. Pure over the filesystem; exported for
234
- * tests.
235
- *
236
- * @example
237
- * classifyRepo("/tmp/empty-git-clone"); // → "empty-apps-repo"
238
- */
239
168
  export function classifyRepo(cwd) {
240
169
  if (isInsidePlatformMonorepo(cwd))
241
170
  return { kind: "platform-monorepo", root: resolveTargetRoot(cwd) };
@@ -243,15 +172,21 @@ export function classifyRepo(cwd) {
243
172
  return { kind: "empty-apps-repo", root: cwd };
244
173
  const root = resolveTargetRoot(cwd);
245
174
  const inRepo = fs.existsSync(path.join(root, ".git"));
246
- if (!inRepo)
247
- return { kind: "no-repo", root };
175
+ if (!inRepo) {
176
+ const hasContent = fs.readdirSync(cwd).some((entry) => !entry.startsWith("."));
177
+ return { kind: hasContent ? "no-repo" : "empty-dir", root: cwd };
178
+ }
248
179
  const hasWorkspace = fs.existsSync(path.join(root, "pnpm-workspace.yaml")) || fs.existsSync(path.join(root, "pnpm-lock.yaml"));
249
180
  const hasApps = fs.existsSync(path.join(root, "apps")) || fs.existsSync(path.join(root, "tenants"));
250
181
  if (hasWorkspace || hasApps)
251
182
  return { kind: "apps-repo", root };
252
183
  return { kind: "other-repo", root };
253
184
  }
254
- const repoStep = {
185
+ function gitInit(dir) {
186
+ execFileSync("git", ["init", "-q"], { cwd: dir, stdio: ["ignore", "ignore", "pipe"] });
187
+ }
188
+ export const INIT_REPO_FIX = "git init && mesh init";
189
+ export const repoStep = {
255
190
  name: "repo",
256
191
  async run(ctx) {
257
192
  const name = STEP_LABELS.repo;
@@ -261,11 +196,37 @@ const repoStep = {
261
196
  switch (kind) {
262
197
  case "platform-monorepo":
263
198
  return { name, status: "skip", detail: "inside mesh-platform — apps here link workspace packages; nothing to set up" };
199
+ case "empty-dir": {
200
+ const go = ctx.yes || !ctx.interactive
201
+ ? true
202
+ : await ctx.prompts.confirm({
203
+ message: `This folder is not a git repo — initialize ${root} as your ${ctx.tenant}-mesh-apps repo here?`,
204
+ default: true,
205
+ });
206
+ if (!go) {
207
+ return { name, status: "skip", detail: "folder left as is", fix: `cd <your ${ctx.tenant}-mesh-apps clone> && mesh init` };
208
+ }
209
+ try {
210
+ (ctx.seams?.gitInit ?? gitInit)(root);
211
+ }
212
+ catch (err) {
213
+ const why = err instanceof Error && "stderr" in err && err.stderr ? String(err.stderr).trim() : "";
214
+ return {
215
+ name,
216
+ status: "fail",
217
+ detail: `git init failed — is git installed and ${root} writable?${why ? ` (${why})` : ""}`,
218
+ fix: INIT_REPO_FIX,
219
+ };
220
+ }
221
+ const created = bootstrapAppsRepo(root, ctx.tenant);
222
+ return { name, status: "pass", detail: `initialized a git repo and bootstrapped the apps repo: ${created.join(", ")}` };
223
+ }
264
224
  case "no-repo":
265
225
  return {
266
226
  name,
267
227
  status: "skip",
268
- detail: `not in a git repo — clone (or git init) your ${ctx.tenant}-mesh-apps repo and re-run mesh init there`,
228
+ detail: `not in a git repo, and this folder already holds files — clone (or git init) your ${ctx.tenant}-mesh-apps repo and re-run mesh init there`,
229
+ fix: INIT_REPO_FIX,
269
230
  };
270
231
  case "other-repo":
271
232
  return {
@@ -309,10 +270,6 @@ const skillsStep = {
309
270
  return { name, status: "skip", detail: "no apps repo to install skills into" };
310
271
  }
311
272
  try {
312
- // In fix mode a `false` return is not a failure: the base skills are
313
- // written; the platform skills arrive with the packages, so the sync
314
- // asks to be re-run after the first install — the doctor reads it the
315
- // same way.
316
273
  const complete = syncSkills(root);
317
274
  return complete
318
275
  ? { name, status: "pass", detail: "base skills + Intent discovery in sync" }
@@ -323,15 +280,7 @@ const skillsStep = {
323
280
  }
324
281
  },
325
282
  };
326
- /** The steps in run order. Exported so tests can drive the reducer with fakes. */
327
283
  export const WIZARD_STEPS = [registryStep, platformStep, repoStep, skillsStep];
328
- /**
329
- * Run `steps` in order, stopping after the first blocking failure. Pure over
330
- * the steps' results — the reducer the CLI and the tests share.
331
- *
332
- * @example
333
- * const steps = await runWizardSteps(ctx, WIZARD_STEPS);
334
- */
335
284
  export async function runWizardSteps(ctx, steps) {
336
285
  const results = [];
337
286
  for (const step of steps) {
@@ -342,7 +291,6 @@ export async function runWizardSteps(ctx, steps) {
342
291
  }
343
292
  return results;
344
293
  }
345
- // ── the command ─────────────────────────────────────────────────────────────
346
294
  async function inquirerPrompts() {
347
295
  const [{ default: input }, { default: select }, { default: confirm }] = await Promise.all([
348
296
  import("@inquirer/input"),
@@ -358,17 +306,6 @@ async function inquirerPrompts() {
358
306
  function isInterrupt(err) {
359
307
  return err instanceof Error && err.name === "ExitPromptError";
360
308
  }
361
- /**
362
- * The wizard entry point behind bare `mesh init`.
363
- *
364
- * Returns the process exit code instead of exiting, so the caller decides
365
- * (and a test can assert on it). Ctrl-C at a prompt returns 130 with nothing
366
- * written. All human output goes to stderr under `--json`, leaving stdout for
367
- * the one document.
368
- *
369
- * @example
370
- * process.exitCode = await runInitWizard({ tenant: "acme", local: true, yes: true });
371
- */
372
309
  export async function runInitWizard(opts, deps = {}) {
373
310
  const cwd = deps.cwd ?? process.cwd();
374
311
  const interactive = deps.interactive ?? Boolean(process.stdin.isTTY && process.stdout.isTTY);
@@ -434,16 +371,12 @@ export async function runInitWizard(opts, deps = {}) {
434
371
  };
435
372
  logInfo(`Setting up tenant '${tenant}' (${describeMode(mode)})…`);
436
373
  const steps = await runWizardSteps(ctx, deps.steps ?? WIZARD_STEPS);
437
- // Persist what was answered so a re-run pre-fills — only where there is a
438
- // repo of ours to record it in.
439
- // Only a Mesh apps repo (or the empty clone that just became one) gets
440
- // the record — never an unrelated checkout the wizard happens to run in.
441
374
  const { kind, root } = classifyRepo(cwd);
442
375
  if (!opts.skipRepo && (kind === "apps-repo" || kind === "empty-apps-repo")) {
443
376
  const written = writeMeshJson(root, { tenant, platform: mode === "local" ? "local" : mode.platform });
444
377
  logInfo(`Recorded tenant + mode in ${written}`);
445
378
  }
446
- const outcome = { tenant, mode, steps, next: wizardNextCommands(mode) };
379
+ const outcome = { tenant, mode, steps, next: wizardNextCommands(mode, steps) };
447
380
  const code = wizardExitCode(steps);
448
381
  if (opts.json) {
449
382
  console.log = origLog;
@@ -468,4 +401,3 @@ export async function runInitWizard(opts, deps = {}) {
468
401
  console.log = origLog;
469
402
  }
470
403
  }
471
- //# 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