@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,20 +1,10 @@
1
1
  import { getContextConfig, getValidToken } from "../commands/login.js";
2
- /**
3
- * Resolve the broker URL, preferring the platform-published value from
4
- * discovery (ContextConfig.vpnJoinBroker) and falling back to DNS-convention
5
- * derivation for platforms not yet redeployed with the payload field.
6
- */
7
2
  export function resolveVpnJoinBroker(context, getCfg = getContextConfig) {
8
3
  const cfg = getCfg(context);
9
4
  if (cfg?.vpnJoinBroker)
10
5
  return cfg.vpnJoinBroker;
11
6
  return deriveVpnJoinBroker(context, getCfg);
12
7
  }
13
- /**
14
- * FALLBACK ONLY. Derive by convention — issuer host `identity.<env>.<domain>`
15
- * → `vpn-join.<env>.<domain>` — mirroring deriveLoginServer (dev.ts:1479).
16
- * Prefer resolveVpnJoinBroker, which reads the platform-published URL first.
17
- */
18
8
  export function deriveVpnJoinBroker(context, getCfg = getContextConfig) {
19
9
  const cfg = getCfg(context);
20
10
  if (!cfg?.issuer)
@@ -29,11 +19,6 @@ export function deriveVpnJoinBroker(context, getCfg = getContextConfig) {
29
19
  return null;
30
20
  }
31
21
  }
32
- /**
33
- * Fetch a single-use pre-auth key from the broker. Returns null on ANY failure
34
- * (no token, non-2xx, network error) so the caller falls back to the browser
35
- * relay join — the broker path is strictly additive.
36
- */
37
22
  export async function mintPreAuthKey(context, brokerUrl, deps) {
38
23
  const token = await deps.getValidToken(context);
39
24
  if (!token)
@@ -55,8 +40,6 @@ export async function mintPreAuthKey(context, brokerUrl, deps) {
55
40
  return null;
56
41
  }
57
42
  }
58
- // Convenience for production callers that use the real login.ts token source.
59
43
  export function realMintDeps() {
60
44
  return { getValidToken: (c) => getValidToken(c) };
61
45
  }
62
- //# sourceMappingURL=vpn-join.js.map
@@ -1,62 +1,20 @@
1
- /**
2
- * VPN detection utilities
3
- */
4
- /**
5
- * Detect whether a Tailscale VPN connection is active.
6
- *
7
- * Uses socket-aware `execTailscaleCmd` so it works in both kernel tun mode
8
- * (standard socket) and legacy userspace networking (/tmp/tailscale.sock).
9
- * Returns `true` only when BackendState is "Running" and Self.Online is true.
10
- * Returns `false` silently on any failure (binary missing, daemon stopped,
11
- * parse error, missing fields).
12
- */
13
1
  export declare function isVpnConnected(): Promise<boolean>;
14
- /** Connection details for the Headscale DNS writer sidecar. */
15
2
  export interface HeadscaleDnsConfig {
16
3
  namespace: string;
17
4
  pod: string;
18
5
  container: string;
19
6
  filePath: string;
20
7
  }
21
- /**
22
- * Build a HeadscaleDnsConfig from tenant/env, following the same naming
23
- * convention as `mesh vpn` (⁠{tenant}-{env}-headscale).
24
- *
25
- * Pod name, container, and file path are infrastructure conventions that
26
- * rarely change — override via the optional parameter if they do.
27
- */
28
8
  export declare function headscaleDnsConfig(tenant?: string, env?: string, overrides?: Partial<HeadscaleDnsConfig>): HeadscaleDnsConfig;
29
9
  export interface DnsRecord {
30
10
  name: string;
31
11
  type: "A";
32
12
  value: string;
33
13
  }
34
- /**
35
- * Retrieve the current Tailscale hostname and IP address.
36
- *
37
- * Returns `null` when Tailscale is not installed, not running, or not online.
38
- */
39
14
  export declare function getTailscaleInfo(): Promise<{
40
15
  hostname: string;
41
16
  ip: string;
42
17
  } | null>;
43
- /**
44
- * Read DNS records from the dns-writer sidecar in the Headscale pod.
45
- *
46
- * Throws with an actionable message if kubectl can't reach the pod.
47
- * Returns an empty array when the file is missing or contains invalid JSON.
48
- */
49
18
  export declare function readDnsRecords(cfg: HeadscaleDnsConfig): DnsRecord[];
50
- /**
51
- * Write DNS A records to the dns-writer sidecar in the Headscale pod.
52
- *
53
- * Pipes JSON via stdin to avoid shell-escaping issues.
54
- * Throws with an actionable message if kubectl can't reach the pod.
55
- */
56
19
  export declare function registerDnsRecords(cfg: HeadscaleDnsConfig, records: DnsRecord[]): void;
57
- /**
58
- * Remove DNS records whose `name` ends with `suffix` from the Headscale pod.
59
- * Best-effort: logs a warning on failure instead of throwing.
60
- */
61
20
  export declare function unregisterDnsRecords(cfg: HeadscaleDnsConfig, suffix: string): void;
62
- //# sourceMappingURL=vpn.d.ts.map
@@ -1,21 +1,9 @@
1
- /**
2
- * VPN detection utilities
3
- */
4
1
  import { execFile, execFileSync } from "node:child_process";
5
2
  import { existsSync } from "node:fs";
6
3
  const TAILSCALE_PATHS = [
7
4
  "tailscale",
8
5
  "/Applications/Tailscale.app/Contents/MacOS/Tailscale",
9
6
  ];
10
- /**
11
- * Detect whether a Tailscale VPN connection is active.
12
- *
13
- * Uses socket-aware `execTailscaleCmd` so it works in both kernel tun mode
14
- * (standard socket) and legacy userspace networking (/tmp/tailscale.sock).
15
- * Returns `true` only when BackendState is "Running" and Self.Online is true.
16
- * Returns `false` silently on any failure (binary missing, daemon stopped,
17
- * parse error, missing fields).
18
- */
19
7
  export async function isVpnConnected() {
20
8
  try {
21
9
  const stdout = await execTailscaleCmd(["status", "--json"]);
@@ -26,18 +14,7 @@ export async function isVpnConnected() {
26
14
  return false;
27
15
  }
28
16
  }
29
- // ---------------------------------------------------------------------------
30
- // DNS record management & Tailscale info
31
- // ---------------------------------------------------------------------------
32
- /** Standard socket (kernel tun mode), then legacy (userspace mode). */
33
17
  const TAILSCALE_SOCKET_PATHS = ["/var/run/tailscale/tailscaled.sock", "/tmp/tailscale.sock"];
34
- /**
35
- * Build a HeadscaleDnsConfig from tenant/env, following the same naming
36
- * convention as `mesh vpn` (⁠{tenant}-{env}-headscale).
37
- *
38
- * Pod name, container, and file path are infrastructure conventions that
39
- * rarely change — override via the optional parameter if they do.
40
- */
41
18
  export function headscaleDnsConfig(tenant = "mesh", env = "dev", overrides) {
42
19
  return {
43
20
  namespace: `${tenant}-${env}-headscale`,
@@ -47,10 +24,6 @@ export function headscaleDnsConfig(tenant = "mesh", env = "dev", overrides) {
47
24
  ...overrides,
48
25
  };
49
26
  }
50
- /**
51
- * Execute a tailscale CLI command, trying each known binary path.
52
- * Automatically appends `--socket <path>` when a tailscale socket is found.
53
- */
54
27
  function execTailscaleCmd(args) {
55
28
  const socketPath = TAILSCALE_SOCKET_PATHS.find(existsSync);
56
29
  const attempts = [];
@@ -80,11 +53,6 @@ function execTailscaleCmd(args) {
80
53
  tryNext();
81
54
  });
82
55
  }
83
- /**
84
- * Retrieve the current Tailscale hostname and IP address.
85
- *
86
- * Returns `null` when Tailscale is not installed, not running, or not online.
87
- */
88
56
  export async function getTailscaleInfo() {
89
57
  try {
90
58
  const stdout = await execTailscaleCmd(["status", "--json"]);
@@ -104,19 +72,12 @@ export async function getTailscaleInfo() {
104
72
  return null;
105
73
  }
106
74
  }
107
- /** Helper: build kubectl exec args for the dns-writer sidecar. */
108
75
  function dnsWriterExec(cfg, cmd, interactive = false) {
109
76
  return [
110
77
  "exec", ...(interactive ? ["-i"] : []),
111
78
  "-n", cfg.namespace, cfg.pod, "-c", cfg.container, "--", ...cmd,
112
79
  ];
113
80
  }
114
- /**
115
- * Read DNS records from the dns-writer sidecar in the Headscale pod.
116
- *
117
- * Throws with an actionable message if kubectl can't reach the pod.
118
- * Returns an empty array when the file is missing or contains invalid JSON.
119
- */
120
81
  export function readDnsRecords(cfg) {
121
82
  try {
122
83
  const raw = execFileSync("kubectl", dnsWriterExec(cfg, ["cat", cfg.filePath]), {
@@ -144,16 +105,9 @@ export function readDnsRecords(cfg) {
144
105
  if (msg.includes("No such file")) {
145
106
  return [];
146
107
  }
147
- // Unexpected error — rethrow
148
108
  throw err;
149
109
  }
150
110
  }
151
- /**
152
- * Write DNS A records to the dns-writer sidecar in the Headscale pod.
153
- *
154
- * Pipes JSON via stdin to avoid shell-escaping issues.
155
- * Throws with an actionable message if kubectl can't reach the pod.
156
- */
157
111
  export function registerDnsRecords(cfg, records) {
158
112
  const json = JSON.stringify(records);
159
113
  try {
@@ -166,10 +120,6 @@ export function registerDnsRecords(cfg, records) {
166
120
  `Verify kubectl context: kubectl get pods -n ${cfg.namespace}`);
167
121
  }
168
122
  }
169
- /**
170
- * Remove DNS records whose `name` ends with `suffix` from the Headscale pod.
171
- * Best-effort: logs a warning on failure instead of throwing.
172
- */
173
123
  export function unregisterDnsRecords(cfg, suffix) {
174
124
  try {
175
125
  const records = readDnsRecords(cfg);
@@ -177,7 +127,5 @@ export function unregisterDnsRecords(cfg, suffix) {
177
127
  registerDnsRecords(cfg, filtered);
178
128
  }
179
129
  catch {
180
- // Best-effort cleanup — silent on failure
181
130
  }
182
131
  }
183
- //# sourceMappingURL=vpn.js.map
@@ -1,49 +1,10 @@
1
- /**
2
- * Workspace packages whose src the agent/interpreter worker bundles as workflows.
3
- * MUST stay a subset of the CI replay-gate path filter (`checks.yaml` →
4
- * `replay-changes`); a drift-guard test asserts it (MESH-2093).
5
- */
6
1
  export declare const WORKFLOW_PACKAGE_DIRS: string[];
7
- /**
8
- * Walk up from `startDir` to the monorepo root (the dir with pnpm-workspace.yaml).
9
- * Falls back to `startDir` if none is found.
10
- */
11
2
  export declare function findRepoRoot(startDir: string): string;
12
- /**
13
- * The set of directories whose `.ts` the worker turns into Temporal workflows.
14
- *
15
- * Prefers the shared workflow **packages** (agent-sdk / interpreter / contracts)
16
- * when they exist — the precise, low-noise signal for the monorepo agent/interpreter
17
- * dev loop. When they're absent (a **tenant repo**), falls back to the app's own
18
- * worker source (`extraDirs`) so the guard isn't silently inert there (MESH-2093).
19
- * Only existing dirs are returned.
20
- */
21
3
  export declare function workflowSourceDirs(repoRoot: string, extraDirs?: string[]): string[];
22
- /**
23
- * Resolve the worker service(s)' source dirs from a dev-output `services` map, so a
24
- * tenant repo (no shared workflow packages) still fingerprints the code its worker
25
- * actually runs. A service is a worker when its name matches `/worker/i` (best
26
- * effort until dev-output carries a `type: "temporal-worker"` marker — MESH-2093).
27
- */
28
4
  export declare function resolveWorkerSourceDirs(repoRoot: string, services?: Record<string, {
29
5
  src?: string;
30
6
  }>): string[];
31
- /**
32
- * Content fingerprint of every non-test `.ts`/`.tsx` under `dirs`. Stable across
33
- * runs for identical content; changes iff a workflow source file's content
34
- * changes. Returns a short hex digest ('' if no files).
35
- *
36
- * Each file is labelled by its path relative to `relativeTo` (when given) so the
37
- * hash is stable across checkout location/renames; falls back to the absolute path
38
- * otherwise.
39
- */
40
7
  export declare function computeWorkflowFingerprint(dirs: string[], relativeTo?: string): string;
41
- /**
42
- * Convenience: fingerprint an app's workflow source. Pass the dev-output `services`
43
- * map so a tenant repo falls back to its worker source when the shared workflow
44
- * packages aren't present.
45
- */
46
8
  export declare function fingerprintWorkflowSource(appRoot: string, services?: Record<string, {
47
9
  src?: string;
48
10
  }>): string;
49
- //# sourceMappingURL=workflow-fingerprint.d.ts.map
@@ -1,43 +1,12 @@
1
- /**
2
- * Workflow-source fingerprint for relaunch safety (MESH-2017).
3
- *
4
- * A `mesh dev` relaunch (or `restart <worker>`) restarts the Temporal worker onto
5
- * whatever code is current. If the WORKFLOW code changed since the session
6
- * started, in-flight conversations replay against the new code and — if the change
7
- * is replay-incompatible — get stranded (observed: conversation 523a4103). The
8
- * replay-safety gate (MESH-2091) catches this at CI; this catches it at the *local*
9
- * dev loop, where uncommitted edits haven't been through CI.
10
- *
11
- * We fingerprint the source the agent/interpreter worker bundles into Temporal
12
- * workflows: the workflow packages agent-sdk, workflow-interpreter, agent-contracts
13
- * (the same set the CI replay-gate path filter covers). A content hash (not mtime)
14
- * so a `git checkout`/rebase that rewrites mtimes without changing content doesn't
15
- * produce a false "code changed" warning; paths are hashed repo-root-relative so
16
- * moving/renaming the checkout doesn't either.
17
- *
18
- * NOTE (MESH-2017 follow-up): this covers the shared workflow packages, not a
19
- * tenant repo's own worker source — `workflowSourceDirs` accepts extra dirs for
20
- * that, but no caller wires them yet, so in a repo without those packages the
21
- * fingerprint is empty and the guard is inert. Tracked separately.
22
- */
23
1
  import { createHash } from "node:crypto";
24
2
  import { existsSync, readFileSync, readdirSync } from "node:fs";
25
3
  import { dirname, isAbsolute, join, relative } from "node:path";
26
- /**
27
- * Workspace packages whose src the agent/interpreter worker bundles as workflows.
28
- * MUST stay a subset of the CI replay-gate path filter (`checks.yaml` →
29
- * `replay-changes`); a drift-guard test asserts it (MESH-2093).
30
- */
31
4
  export const WORKFLOW_PACKAGE_DIRS = [
32
5
  "packages/agent-sdk/src",
33
6
  "packages/workflow-interpreter/src",
34
7
  "packages/agent-contracts/src",
35
8
  ];
36
9
  const EXCLUDE = /(^|\/)(node_modules|dist|__tests__)(\/|$)|\.(test|spec)\.[cm]?tsx?$/;
37
- /**
38
- * Walk up from `startDir` to the monorepo root (the dir with pnpm-workspace.yaml).
39
- * Falls back to `startDir` if none is found.
40
- */
41
10
  export function findRepoRoot(startDir) {
42
11
  let dir = startDir;
43
12
  for (;;) {
@@ -49,27 +18,12 @@ export function findRepoRoot(startDir) {
49
18
  dir = parent;
50
19
  }
51
20
  }
52
- /**
53
- * The set of directories whose `.ts` the worker turns into Temporal workflows.
54
- *
55
- * Prefers the shared workflow **packages** (agent-sdk / interpreter / contracts)
56
- * when they exist — the precise, low-noise signal for the monorepo agent/interpreter
57
- * dev loop. When they're absent (a **tenant repo**), falls back to the app's own
58
- * worker source (`extraDirs`) so the guard isn't silently inert there (MESH-2093).
59
- * Only existing dirs are returned.
60
- */
61
21
  export function workflowSourceDirs(repoRoot, extraDirs = []) {
62
22
  const pkgDirs = WORKFLOW_PACKAGE_DIRS.map((d) => join(repoRoot, d)).filter((d) => existsSync(d));
63
23
  if (pkgDirs.length > 0)
64
24
  return pkgDirs;
65
25
  return extraDirs.filter((d) => existsSync(d));
66
26
  }
67
- /**
68
- * Resolve the worker service(s)' source dirs from a dev-output `services` map, so a
69
- * tenant repo (no shared workflow packages) still fingerprints the code its worker
70
- * actually runs. A service is a worker when its name matches `/worker/i` (best
71
- * effort until dev-output carries a `type: "temporal-worker"` marker — MESH-2093).
72
- */
73
27
  export function resolveWorkerSourceDirs(repoRoot, services = {}) {
74
28
  const dirs = [];
75
29
  for (const [name, svc] of Object.entries(services)) {
@@ -79,15 +33,6 @@ export function resolveWorkerSourceDirs(repoRoot, services = {}) {
79
33
  }
80
34
  return dirs;
81
35
  }
82
- /**
83
- * Content fingerprint of every non-test `.ts`/`.tsx` under `dirs`. Stable across
84
- * runs for identical content; changes iff a workflow source file's content
85
- * changes. Returns a short hex digest ('' if no files).
86
- *
87
- * Each file is labelled by its path relative to `relativeTo` (when given) so the
88
- * hash is stable across checkout location/renames; falls back to the absolute path
89
- * otherwise.
90
- */
91
36
  export function computeWorkflowFingerprint(dirs, relativeTo) {
92
37
  const files = [];
93
38
  for (const dir of dirs) {
@@ -96,7 +41,7 @@ export function computeWorkflowFingerprint(dirs, relativeTo) {
96
41
  rels = readdirSync(dir, { recursive: true });
97
42
  }
98
43
  catch {
99
- continue; // dir removed mid-scan
44
+ continue;
100
45
  }
101
46
  for (const rel of rels) {
102
47
  const p = String(rel);
@@ -117,19 +62,12 @@ export function computeWorkflowFingerprint(dirs, relativeTo) {
117
62
  h.update("\0");
118
63
  }
119
64
  catch {
120
- /* unreadable/removed mid-scan — skip */
121
65
  }
122
66
  }
123
67
  return h.digest("hex").slice(0, 16);
124
68
  }
125
- /**
126
- * Convenience: fingerprint an app's workflow source. Pass the dev-output `services`
127
- * map so a tenant repo falls back to its worker source when the shared workflow
128
- * packages aren't present.
129
- */
130
69
  export function fingerprintWorkflowSource(appRoot, services = {}) {
131
70
  const repoRoot = findRepoRoot(appRoot);
132
71
  const workerDirs = resolveWorkerSourceDirs(repoRoot, services);
133
72
  return computeWorkflowFingerprint(workflowSourceDirs(repoRoot, workerDirs), repoRoot);
134
73
  }
135
- //# sourceMappingURL=workflow-fingerprint.js.map
@@ -1,86 +1,24 @@
1
- /** Number of distinct port blocks (block 0 reserved for the primary checkout). */
2
1
  export declare const NUM_PORT_BLOCKS = 64;
3
- /** First port of block 1; block 0 uses the app's preferred ports, not this range. */
4
2
  export declare const PORT_BLOCK_BASE = 40000;
5
- /** Ports reserved per worktree block (split into service + tunnel sub-ranges). */
6
3
  export declare const PORT_BLOCK_SIZE = 40;
7
- /** Service ports occupy `[base, base+SERVICE_SUBRANGE)`; tunnels take the rest. */
8
4
  export declare const PORT_BLOCK_SERVICE_SUBRANGE = 24;
9
5
  export interface WorktreeIdentity {
10
- /** Absolute path to this worktree's root (git top-level). */
11
6
  worktreeRoot: string;
12
- /** True for the repo's primary checkout; false for a linked `git worktree`. */
13
7
  isPrimary: boolean;
14
- /** Human-readable sanitized basename of the worktree root (e.g. "design-registry"). */
15
8
  slug: string;
16
- /** 4 hex chars of sha256(worktreeRoot) — disambiguates same-named worktrees. */
17
9
  hash: string;
18
- /** "" for the primary checkout; else `${slug}-${hash}`. */
19
10
  token: string;
20
- /** 0 for primary (preferred ports); 1..NUM_PORT_BLOCKS-1 for linked worktrees. */
21
11
  portBlock: number;
22
- /** "" for primary; else `-${token}` — appended to Temporal/Nexus task queues (Tier 2). */
23
12
  taskQueueSuffix: string;
24
13
  }
25
- /** Lowercase, hyphenate, strip non-alphanumerics; never empty. */
26
14
  export declare function sanitizeSlug(name: string): string;
27
- /** Stable 4-hex-char fingerprint of a worktree's absolute path. */
28
15
  export declare function worktreeHash(worktreeRoot: string): string;
29
- /**
30
- * Map a worktree hash to a port block. Primary → 0 (preferred ports).
31
- * Linked → deterministic 1..NUM_PORT_BLOCKS-1 (stable across runs for the same
32
- * worktree path, so ports don't drift between launches).
33
- */
34
16
  export declare function portBlockFor(hash: string, isPrimary: boolean): number;
35
- /** First port of a block (block 0 has no dedicated range — callers use preferred ports). */
36
17
  export declare function blockBasePort(block: number): number;
37
- /**
38
- * Identity whose PORT BLOCK is derived from (worktree, app) — every non-port
39
- * field stays worktree-scoped. A repo can hold several apps whose `mesh dev`
40
- * sessions run CONCURRENTLY (e.g. scu-mesh-apps' plaid-token-manager +
41
- * plaid-reporting); with a per-worktree block they draw the same ports, and
42
- * the availability probe alone races services that are still booting and
43
- * haven't bound yet — both sessions allocated 41800 in the wild. Same
44
- * philosophy as the per-worktree blocks of MESH-2013.
45
- *
46
- * NOT disjoint by construction: `portBlockFor` buckets a hash into
47
- * NUM_PORT_BLOCKS-1 slots, so two (worktree, app) pairs CAN land on the same
48
- * block — and app-scoping raises the entity count from #worktrees to
49
- * #worktrees x #apps, which makes that likelier. Sibling apps in one worktree
50
- * (the case this fixes) are disjoint by default; the in-block probe and the
51
- * ephemeral fallback in `allocatePorts` remain the backstop for a collision.
52
- *
53
- * Primary checkouts keep preferred-port semantics (block 0) — sibling apps
54
- * there still share preferred ports and rely on that probe.
55
- */
56
18
  export declare function withAppScopedPortBlock(wt: WorktreeIdentity, appRoot: string): WorktreeIdentity;
57
- /**
58
- * Stack name for `mesh stack init --worktree` (MESH-2013 Slice 3): append the
59
- * worktree token so concurrent worktrees deploy to distinct stacks. The SSM
60
- * export paths (`apps/{app}/stacks/{stack}/...`), Temporal namespace
61
- * (`{tenant}-{stack}-{app}`), and Nexus endpoint name all derive from the stack
62
- * name, so one discriminator isolates all three. The primary checkout has an
63
- * empty token → the base name is returned unchanged (it IS the canonical stack).
64
- */
65
- /** Max chars of the worktree slug that reach a stack name. Deploy-time surfaces
66
- * (Temporal namespace `{tenant}-{stack}-{app}`, Nexus endpoint names) have
67
- * provider length limits, so we cap the human-readable slug here; the 4-hex hash
68
- * still guarantees uniqueness. (The local-only token — tmux/ports — is uncapped.) */
69
19
  export declare const STACK_SLUG_MAX = 16;
70
20
  export declare function worktreeStackName(baseName: string, wt: WorktreeIdentity): string;
71
- /**
72
- * True when `stackName` would collide across worktrees: we're in a LINKED
73
- * worktree (non-empty token) but the stack name doesn't carry that token — so a
74
- * concurrent `pulumi up` from another worktree on the same name hits identical
75
- * SSM export paths / Temporal namespace. Drives the `mesh deploy` warning.
76
- */
77
21
  export declare function stackNeedsWorktreeIsolation(stackName: string, wt: WorktreeIdentity): boolean;
78
22
  type GitRunner = (args: string[], cwd: string) => string;
79
- /**
80
- * Resolve the worktree identity for a given cwd. Returns a primary-checkout
81
- * identity (token "", block 0) when not inside a git repo, so non-repo/edge
82
- * cases degrade to today's behavior rather than throwing.
83
- */
84
23
  export declare function resolveWorktreeIdentity(cwd?: string, gitRunner?: GitRunner): WorktreeIdentity;
85
24
  export {};
86
- //# sourceMappingURL=worktree-identity.d.ts.map
@@ -1,42 +1,10 @@
1
- /**
2
- * Per-worktree identity for collision-free concurrent `mesh dev` (MESH-2013).
3
- *
4
- * Running `mesh dev` in several git worktrees at once collides on ports, tmux
5
- * session names, tmpdir session state, and env-file dirs — because every one of
6
- * those derives from the app's Pulumi project name, which is identical across
7
- * worktrees. This module derives ONE deterministic token per worktree (from its
8
- * path) that the dev launcher threads through all of those so worktrees can't
9
- * step on each other.
10
- *
11
- * TASK QUEUES are unique by construction — `taskQueueSuffix` is `-${token}` and
12
- * the token carries the 4-hex path hash. SESSION NAMES are not: the tmux name is
13
- * `${projectName}-${slug}` (slug only), and the state file + env dir derive from
14
- * it, so two linked worktrees whose basenames sanitize to the same slug (e.g.
15
- * `.worktrees/MESH-2375` and `~/scratch/mesh-2375`) share all three. PORTS are
16
- * not either: the block is a hash bucketed into NUM_PORT_BLOCKS-1 slots and is
17
- * additionally scoped by app — see `withAppScopedPortBlock` below for what that
18
- * does and does not guarantee.
19
- *
20
- * The PRIMARY checkout (the repo's main working tree) keeps its historical
21
- * behavior — empty token, port block 0 (preferred ports), no session suffix —
22
- * so existing muscle memory is preserved. Only LINKED worktrees get offsets.
23
- *
24
- * Pure helpers (`sanitizeSlug`, `worktreeHash`, `portBlockFor`, `blockBasePort`)
25
- * are git-free and unit-tested; `resolveWorktreeIdentity` shells to git via an
26
- * injectable runner so it can be tested without a real repo.
27
- */
28
1
  import { execFileSync } from "node:child_process";
29
2
  import * as crypto from "node:crypto";
30
3
  import * as path from "node:path";
31
- /** Number of distinct port blocks (block 0 reserved for the primary checkout). */
32
4
  export const NUM_PORT_BLOCKS = 64;
33
- /** First port of block 1; block 0 uses the app's preferred ports, not this range. */
34
5
  export const PORT_BLOCK_BASE = 40000;
35
- /** Ports reserved per worktree block (split into service + tunnel sub-ranges). */
36
6
  export const PORT_BLOCK_SIZE = 40;
37
- /** Service ports occupy `[base, base+SERVICE_SUBRANGE)`; tunnels take the rest. */
38
7
  export const PORT_BLOCK_SERVICE_SUBRANGE = 24;
39
- /** Lowercase, hyphenate, strip non-alphanumerics; never empty. */
40
8
  export function sanitizeSlug(name) {
41
9
  const s = name
42
10
  .toLowerCase()
@@ -44,62 +12,24 @@ export function sanitizeSlug(name) {
44
12
  .replace(/^-+|-+$/g, "");
45
13
  return s || "wt";
46
14
  }
47
- /** Stable 4-hex-char fingerprint of a worktree's absolute path. */
48
15
  export function worktreeHash(worktreeRoot) {
49
16
  return crypto.createHash("sha256").update(worktreeRoot).digest("hex").slice(0, 4);
50
17
  }
51
- /**
52
- * Map a worktree hash to a port block. Primary → 0 (preferred ports).
53
- * Linked → deterministic 1..NUM_PORT_BLOCKS-1 (stable across runs for the same
54
- * worktree path, so ports don't drift between launches).
55
- */
56
18
  export function portBlockFor(hash, isPrimary) {
57
19
  if (isPrimary)
58
20
  return 0;
59
21
  const n = parseInt(hash, 16);
60
22
  return 1 + (n % (NUM_PORT_BLOCKS - 1));
61
23
  }
62
- /** First port of a block (block 0 has no dedicated range — callers use preferred ports). */
63
24
  export function blockBasePort(block) {
64
25
  return PORT_BLOCK_BASE + block * PORT_BLOCK_SIZE;
65
26
  }
66
- /**
67
- * Identity whose PORT BLOCK is derived from (worktree, app) — every non-port
68
- * field stays worktree-scoped. A repo can hold several apps whose `mesh dev`
69
- * sessions run CONCURRENTLY (e.g. scu-mesh-apps' plaid-token-manager +
70
- * plaid-reporting); with a per-worktree block they draw the same ports, and
71
- * the availability probe alone races services that are still booting and
72
- * haven't bound yet — both sessions allocated 41800 in the wild. Same
73
- * philosophy as the per-worktree blocks of MESH-2013.
74
- *
75
- * NOT disjoint by construction: `portBlockFor` buckets a hash into
76
- * NUM_PORT_BLOCKS-1 slots, so two (worktree, app) pairs CAN land on the same
77
- * block — and app-scoping raises the entity count from #worktrees to
78
- * #worktrees x #apps, which makes that likelier. Sibling apps in one worktree
79
- * (the case this fixes) are disjoint by default; the in-block probe and the
80
- * ephemeral fallback in `allocatePorts` remain the backstop for a collision.
81
- *
82
- * Primary checkouts keep preferred-port semantics (block 0) — sibling apps
83
- * there still share preferred ports and rely on that probe.
84
- */
85
27
  export function withAppScopedPortBlock(wt, appRoot) {
86
28
  if (wt.isPrimary)
87
29
  return wt;
88
30
  const appHash = worktreeHash(`${wt.worktreeRoot}#${path.resolve(appRoot)}`);
89
31
  return { ...wt, portBlock: portBlockFor(appHash, false) };
90
32
  }
91
- /**
92
- * Stack name for `mesh stack init --worktree` (MESH-2013 Slice 3): append the
93
- * worktree token so concurrent worktrees deploy to distinct stacks. The SSM
94
- * export paths (`apps/{app}/stacks/{stack}/...`), Temporal namespace
95
- * (`{tenant}-{stack}-{app}`), and Nexus endpoint name all derive from the stack
96
- * name, so one discriminator isolates all three. The primary checkout has an
97
- * empty token → the base name is returned unchanged (it IS the canonical stack).
98
- */
99
- /** Max chars of the worktree slug that reach a stack name. Deploy-time surfaces
100
- * (Temporal namespace `{tenant}-{stack}-{app}`, Nexus endpoint names) have
101
- * provider length limits, so we cap the human-readable slug here; the 4-hex hash
102
- * still guarantees uniqueness. (The local-only token — tmux/ports — is uncapped.) */
103
33
  export const STACK_SLUG_MAX = 16;
104
34
  export function worktreeStackName(baseName, wt) {
105
35
  if (!wt.token)
@@ -107,37 +37,20 @@ export function worktreeStackName(baseName, wt) {
107
37
  const cappedSlug = wt.slug.slice(0, STACK_SLUG_MAX).replace(/-+$/, "");
108
38
  return `${baseName}-${cappedSlug}-${wt.hash}`;
109
39
  }
110
- /**
111
- * True when `stackName` would collide across worktrees: we're in a LINKED
112
- * worktree (non-empty token) but the stack name doesn't carry that token — so a
113
- * concurrent `pulumi up` from another worktree on the same name hits identical
114
- * SSM export paths / Temporal namespace. Drives the `mesh deploy` warning.
115
- */
116
40
  export function stackNeedsWorktreeIsolation(stackName, wt) {
117
- // The 4-hex hash is the stable discriminator present in every worktree stack
118
- // name (`worktreeStackName` ends with `-${hash}`), and survives the slug cap —
119
- // so match on it rather than the full (uncapped) token.
120
41
  return !!wt.token && !stackName.endsWith(`-${wt.hash}`);
121
42
  }
122
43
  const defaultGitRunner = (args, cwd) => execFileSync("git", args, { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
123
- /**
124
- * Resolve the worktree identity for a given cwd. Returns a primary-checkout
125
- * identity (token "", block 0) when not inside a git repo, so non-repo/edge
126
- * cases degrade to today's behavior rather than throwing.
127
- */
128
44
  export function resolveWorktreeIdentity(cwd = process.cwd(), gitRunner = defaultGitRunner) {
129
45
  let worktreeRoot;
130
46
  let isPrimary = true;
131
47
  try {
132
48
  worktreeRoot = path.resolve(gitRunner(["rev-parse", "--show-toplevel"], cwd));
133
- // The common git dir is `<primary-worktree>/.git`; its parent is the primary
134
- // checkout. A linked worktree's top-level differs from that parent.
135
49
  const commonDir = gitRunner(["rev-parse", "--git-common-dir"], cwd);
136
50
  const primaryRoot = path.resolve(path.dirname(path.resolve(cwd, commonDir)));
137
51
  isPrimary = worktreeRoot === primaryRoot;
138
52
  }
139
53
  catch {
140
- // Not a git repo (or git unavailable) — behave as the primary checkout.
141
54
  return {
142
55
  worktreeRoot: path.resolve(cwd),
143
56
  isPrimary: true,
@@ -161,4 +74,3 @@ export function resolveWorktreeIdentity(cwd = process.cwd(), gitRunner = default
161
74
  taskQueueSuffix: token ? `-${token}` : "",
162
75
  };
163
76
  }
164
- //# sourceMappingURL=worktree-identity.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesh-tech/mesh-cli",
3
- "version": "0.20.2",
3
+ "version": "0.20.3",
4
4
  "description": "CLI for Mesh platform development utilities",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",