@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,109 +1,29 @@
1
- /**
2
- * The ONE identity behind `@mesh-tech` package access.
3
- *
4
- * Every reader of the registry — `pnpm install`, `mesh create-app`,
5
- * `mesh docs start`, the Hub image build under `mesh start` — talks to the same
6
- * CodeArtifact domain, and that domain is owned by exactly one Mesh platform:
7
- * `dev.platform.meshtech.io`. So the registry has a single, global identity
8
- * (issuer + CLI client id + broker URL) that never depends on which tenant
9
- * platform, if any, the developer deploys to.
10
- *
11
- * This module keeps that identity separate from platform contexts:
12
- *
13
- * - The domain comes from the compiled-in first-party alias table and nowhere
14
- * else — not an argument, not an environment variable, not an unpinned
15
- * config value. That is the same trust anchor `mesh login` relies on, so the
16
- * ≥2-dot anti-phishing guard stays intact.
17
- * - The Zitadel session for the registry is cached under a **reserved**
18
- * credential key (`registry`) that no `<tenant>.<env>` context can collide
19
- * with, and `mesh login` / `mesh logout` refuse it.
20
- * - A developer who already signed in to the registry's own platform
21
- * (`mesh login mesh.dev`) is reused rather than sent through the browser a
22
- * second time: any cached session whose issuer matches the registry's counts.
23
- *
24
- * Nothing here touches `~/.npmrc` or the broker — that is `mesh registry
25
- * login`'s job. This module only answers "who is the registry?" and "do I hold
26
- * a session for it?".
27
- */
28
1
  import { MeshCliError } from "./errors.js";
29
- /**
30
- * The first-party alias of the platform that owns the `@mesh-tech` registry.
31
- * The alias is the key in `FIRST_PARTY_CONTEXTS`; the domain is looked up
32
- * from that reviewed table, never typed here twice.
33
- */
34
2
  export declare const REGISTRY_ALIAS = "mesh.dev";
35
- /** The pinned domain anonymous discovery runs against, e.g. `dev.platform.meshtech.io`. */
36
3
  export declare const REGISTRY_DOMAIN: string;
37
- /**
38
- * The reserved context name the registry session and identity are cached under
39
- * in `credentials.json` / `config.json`. Deliberately has no dot, so it can
40
- * never parse as a `<tenant>.<env>` platform context.
41
- */
42
4
  export declare const REGISTRY_CREDENTIAL_KEY: string;
43
- /** True when a context name is the reserved registry key. */
44
5
  export declare function isReservedRegistryContext(context: string): boolean;
45
- /** What the registry's platform publishes about itself, plus when we fetched it. */
46
6
  export interface RegistryIdentity {
47
- /** Zitadel issuer URL for the registry's platform. */
48
7
  issuer: string;
49
- /** The CLI's OIDC client id on that issuer. */
50
8
  clientId: string;
51
- /** The `registry-auth` broker that exchanges an id token for a CodeArtifact grant. */
52
9
  registryBroker: string;
53
- /** ISO timestamp of the discovery that produced this record. */
54
10
  discoveredAt: string;
55
11
  }
56
- /** Raised when the registry's identity cannot be resolved (offline, endpoint down). */
57
12
  export declare class RegistryIdentityError extends MeshCliError {
58
13
  constructor(detail: string);
59
14
  }
60
- /**
61
- * Resolve the registry's identity: the cached record under the reserved key,
62
- * or a fresh anonymous HTTPS discovery on the pinned domain which is then
63
- * cached there. `refresh: true` skips the cache.
64
- *
65
- * Never consults SSM and never takes the domain from anything but the alias
66
- * table. Throws `RegistryIdentityError` when discovery is impossible and
67
- * nothing is cached.
68
- *
69
- * @example
70
- * const { registryBroker } = await resolveRegistryIdentity();
71
- * // → "https://registry-auth.dev.platform.meshtech.io"
72
- */
73
15
  export declare function resolveRegistryIdentity(opts?: {
74
16
  refresh?: boolean;
75
17
  }): Promise<RegistryIdentity>;
76
- /**
77
- * The cached contexts whose session can stand in for the registry's: the
78
- * reserved key first, then the registry's own alias and domain — but only
79
- * when the cached config for that name points at the SAME issuer, so a
80
- * pre-repoint `mesh.dev` entry (a different platform) is never mistaken for
81
- * the registry. With no known issuer (nothing discovered yet) only the
82
- * reserved key counts: a guess about which platform session "is" the
83
- * registry is the mistake this function exists to prevent.
84
- *
85
- * Pure over the two files' contents; exported for tests.
86
- */
87
18
  export declare function registrySessionCandidates(issuer: string | null, configs?: Record<string, {
88
19
  issuer?: string;
89
20
  } | undefined>, credentials?: Record<string, unknown>): string[];
90
- /** A live registry session and the context key it is cached under. */
91
21
  export interface RegistrySession {
92
- /** Which `credentials.json` entry holds the session (reserved key, alias, or domain). */
93
22
  context: string;
94
23
  email: string;
95
24
  expiresAt: string;
96
25
  }
97
- /**
98
- * The registry session as cached right now — no refresh, no network. Null when
99
- * no candidate context holds an unexpired token.
100
- *
101
- * @example
102
- * const s = readRegistrySession();
103
- * if (s) console.log(`signed in as ${s.email}`);
104
- */
105
26
  export declare function readRegistrySession(): RegistrySession | null;
106
- /** Why `ensureRegistrySession` could not produce a session. */
107
27
  export type RegistrySessionFailure = {
108
28
  ok: false;
109
29
  reason: "no-identity";
@@ -120,86 +40,17 @@ export type RegistrySessionFailure = {
120
40
  export type RegistrySessionResult = ({
121
41
  ok: true;
122
42
  } & RegistrySession) | RegistrySessionFailure;
123
- /**
124
- * Get a valid Zitadel session for the registry's issuer, signing in when
125
- * there is none.
126
- *
127
- * Reuses ANY cached session whose issuer matches — a developer already signed
128
- * in to `mesh.dev` gets no second browser trip — refreshing an expired one
129
- * through its refresh token first. Only when no candidate can be refreshed
130
- * does it run the sign-in (browser PKCE, or device code with `device: true`
131
- * or in a remote/non-TTY environment) and store the result under the
132
- * reserved key.
133
- *
134
- * `interactive: false` means "cached or nothing": callers that cannot open a
135
- * browser or print a device code get `no-tty` back instead of a hung prompt.
136
- *
137
- * @example
138
- * const session = await ensureRegistrySession({ interactive: true });
139
- * if (session.ok) console.log(session.email);
140
- */
141
43
  export declare function ensureRegistrySession(opts: {
142
44
  device?: boolean;
143
45
  interactive: boolean;
144
46
  }): Promise<RegistrySessionResult>;
145
- /**
146
- * The Zitadel project-role names a session token carries, sorted.
147
- *
148
- * Empty for a token with no roles claim and for anything that does not parse
149
- * as a JWT — a caller comparing two of these treats "unreadable" as "no roles
150
- * to compare", which is the safe reading for a token the broker will refuse
151
- * anyway.
152
- *
153
- * @example
154
- * registryTokenRoles(idToken); // → ["registry:read"]
155
- */
156
47
  export declare function registryTokenRoles(idToken: string | null | undefined): string[];
157
- /** What a re-mint of the registry session produced. */
158
48
  export interface RegistryRemint {
159
- /** A new token was minted through the refresh token and cached. */
160
49
  reminted: boolean;
161
- /** The new token carries a different role set than the one it replaced. */
162
50
  rolesChanged: boolean;
163
51
  }
164
- /**
165
- * Re-mint the registry session's token so a role granted after the sign-in
166
- * reaches the broker. Roles ride in a Zitadel token from the moment it is
167
- * issued: a still-valid session keeps presenting the roles it had at sign-in
168
- * until it is re-minted.
169
- *
170
- * `rolesChanged` is the field a retry turns on. A re-mint that comes back with
171
- * the same roles presents the broker with the same authorization facts, so
172
- * asking again can only buy a second round trip to the same answer.
173
- *
174
- * @returns `{ reminted: false, rolesChanged: false }` when there is no
175
- * session, no refresh token, or the issuer refuses the exchange.
176
- * @example
177
- * if ((await refreshRegistrySession("registry")).rolesChanged) retryTheBroker();
178
- */
179
52
  export declare function refreshRegistrySession(context: string): Promise<RegistryRemint>;
180
- /**
181
- * Forget the registry: the session AND the pinned identity record, so the
182
- * next `mesh registry login` re-discovers the registry from the pinned
183
- * domain. Clears the reserved key only — a platform session under `mesh.dev`
184
- * that happened to double as the registry's is a platform login and stays.
185
- *
186
- * @example
187
- * clearRegistrySession(); // `mesh registry logout`
188
- */
189
53
  export declare function clearRegistrySession(): void;
190
- /**
191
- * True when two identity records disagree on anything that matters for a
192
- * broker call — the signal that a re-discovery is worth a retry.
193
- *
194
- * @example
195
- * identityChanged(a, { ...a, registryBroker: "https://moved" }); // → true
196
- */
197
54
  export declare function identityChanged(before: RegistryIdentity, after: RegistryIdentity): boolean;
198
- /**
199
- * Human-readable time left on a session, e.g. `11h 42m`; `expired` when the
200
- * expiry has passed. Pure; exported for the status line's test.
201
- */
202
55
  export declare function describeSessionExpiry(expiresAt: string, now?: number): string;
203
- /** Log the one-line identity banner `mesh registry login` opens with. */
204
56
  export declare function logRegistryIdentity(identity: RegistryIdentity): void;
205
- //# sourceMappingURL=registry-identity.d.ts.map
@@ -1,43 +1,10 @@
1
- /**
2
- * The ONE identity behind `@mesh-tech` package access.
3
- *
4
- * Every reader of the registry — `pnpm install`, `mesh create-app`,
5
- * `mesh docs start`, the Hub image build under `mesh start` — talks to the same
6
- * CodeArtifact domain, and that domain is owned by exactly one Mesh platform:
7
- * `dev.platform.meshtech.io`. So the registry has a single, global identity
8
- * (issuer + CLI client id + broker URL) that never depends on which tenant
9
- * platform, if any, the developer deploys to.
10
- *
11
- * This module keeps that identity separate from platform contexts:
12
- *
13
- * - The domain comes from the compiled-in first-party alias table and nowhere
14
- * else — not an argument, not an environment variable, not an unpinned
15
- * config value. That is the same trust anchor `mesh login` relies on, so the
16
- * ≥2-dot anti-phishing guard stays intact.
17
- * - The Zitadel session for the registry is cached under a **reserved**
18
- * credential key (`registry`) that no `<tenant>.<env>` context can collide
19
- * with, and `mesh login` / `mesh logout` refuse it.
20
- * - A developer who already signed in to the registry's own platform
21
- * (`mesh login mesh.dev`) is reused rather than sent through the browser a
22
- * second time: any cached session whose issuer matches the registry's counts.
23
- *
24
- * Nothing here touches `~/.npmrc` or the broker — that is `mesh registry
25
- * login`'s job. This module only answers "who is the registry?" and "do I hold
26
- * a session for it?".
27
- */
28
1
  import { clearContextConfig, clearCredentials, decodeJwtPayload, discoverConfigFromWellKnown, forceRefreshToken, getContextConfig, getValidToken, readAllContextConfigs, readAllCredentials, readCredentials, runLoginFlow, tokenStillValid, writeContextConfig, RESERVED_REGISTRY_CONTEXT, } from "../commands/login.js";
29
2
  import { projectRoleKeys } from "./aws-auth.js";
30
3
  import { firstPartyDomainFor } from "./first-party-contexts.js";
31
4
  import { deriveRegistryBroker } from "./registry-broker.js";
32
5
  import { MeshCliError } from "./errors.js";
33
6
  import { logInfo } from "./log.js";
34
- /**
35
- * The first-party alias of the platform that owns the `@mesh-tech` registry.
36
- * The alias is the key in `FIRST_PARTY_CONTEXTS`; the domain is looked up
37
- * from that reviewed table, never typed here twice.
38
- */
39
7
  export const REGISTRY_ALIAS = "mesh.dev";
40
- /** The pinned domain anonymous discovery runs against, e.g. `dev.platform.meshtech.io`. */
41
8
  export const REGISTRY_DOMAIN = (() => {
42
9
  const domain = firstPartyDomainFor(REGISTRY_ALIAS);
43
10
  if (!domain) {
@@ -45,17 +12,10 @@ export const REGISTRY_DOMAIN = (() => {
45
12
  }
46
13
  return domain;
47
14
  })();
48
- /**
49
- * The reserved context name the registry session and identity are cached under
50
- * in `credentials.json` / `config.json`. Deliberately has no dot, so it can
51
- * never parse as a `<tenant>.<env>` platform context.
52
- */
53
15
  export const REGISTRY_CREDENTIAL_KEY = RESERVED_REGISTRY_CONTEXT;
54
- /** True when a context name is the reserved registry key. */
55
16
  export function isReservedRegistryContext(context) {
56
17
  return context === REGISTRY_CREDENTIAL_KEY;
57
18
  }
58
- /** Raised when the registry's identity cannot be resolved (offline, endpoint down). */
59
19
  export class RegistryIdentityError extends MeshCliError {
60
20
  constructor(detail) {
61
21
  super(`Could not resolve the Mesh package registry (${detail}).\n` +
@@ -76,19 +36,6 @@ function toIdentity(cfg) {
76
36
  discoveredAt: cfg.discoveredAt ?? new Date(0).toISOString(),
77
37
  };
78
38
  }
79
- /**
80
- * Resolve the registry's identity: the cached record under the reserved key,
81
- * or a fresh anonymous HTTPS discovery on the pinned domain which is then
82
- * cached there. `refresh: true` skips the cache.
83
- *
84
- * Never consults SSM and never takes the domain from anything but the alias
85
- * table. Throws `RegistryIdentityError` when discovery is impossible and
86
- * nothing is cached.
87
- *
88
- * @example
89
- * const { registryBroker } = await resolveRegistryIdentity();
90
- * // → "https://registry-auth.dev.platform.meshtech.io"
91
- */
92
39
  export async function resolveRegistryIdentity(opts = {}) {
93
40
  if (!opts.refresh) {
94
41
  const cached = toIdentity(getContextConfig(REGISTRY_CREDENTIAL_KEY));
@@ -109,17 +56,6 @@ export async function resolveRegistryIdentity(opts = {}) {
109
56
  writeContextConfig(REGISTRY_CREDENTIAL_KEY, stored);
110
57
  return identity;
111
58
  }
112
- /**
113
- * The cached contexts whose session can stand in for the registry's: the
114
- * reserved key first, then the registry's own alias and domain — but only
115
- * when the cached config for that name points at the SAME issuer, so a
116
- * pre-repoint `mesh.dev` entry (a different platform) is never mistaken for
117
- * the registry. With no known issuer (nothing discovered yet) only the
118
- * reserved key counts: a guess about which platform session "is" the
119
- * registry is the mistake this function exists to prevent.
120
- *
121
- * Pure over the two files' contents; exported for tests.
122
- */
123
59
  export function registrySessionCandidates(issuer, configs = readAllContextConfigs(), credentials = readAllCredentials()) {
124
60
  const names = issuer ? [REGISTRY_CREDENTIAL_KEY, REGISTRY_ALIAS, REGISTRY_DOMAIN] : [REGISTRY_CREDENTIAL_KEY];
125
61
  return names.filter((name) => {
@@ -131,14 +67,6 @@ export function registrySessionCandidates(issuer, configs = readAllContextConfig
131
67
  return issuer ? cfg.issuer === issuer : true;
132
68
  });
133
69
  }
134
- /**
135
- * The registry session as cached right now — no refresh, no network. Null when
136
- * no candidate context holds an unexpired token.
137
- *
138
- * @example
139
- * const s = readRegistrySession();
140
- * if (s) console.log(`signed in as ${s.email}`);
141
- */
142
70
  export function readRegistrySession() {
143
71
  const identity = toIdentity(getContextConfig(REGISTRY_CREDENTIAL_KEY));
144
72
  for (const context of registrySessionCandidates(identity?.issuer ?? null)) {
@@ -149,24 +77,6 @@ export function readRegistrySession() {
149
77
  }
150
78
  return null;
151
79
  }
152
- /**
153
- * Get a valid Zitadel session for the registry's issuer, signing in when
154
- * there is none.
155
- *
156
- * Reuses ANY cached session whose issuer matches — a developer already signed
157
- * in to `mesh.dev` gets no second browser trip — refreshing an expired one
158
- * through its refresh token first. Only when no candidate can be refreshed
159
- * does it run the sign-in (browser PKCE, or device code with `device: true`
160
- * or in a remote/non-TTY environment) and store the result under the
161
- * reserved key.
162
- *
163
- * `interactive: false` means "cached or nothing": callers that cannot open a
164
- * browser or print a device code get `no-tty` back instead of a hung prompt.
165
- *
166
- * @example
167
- * const session = await ensureRegistrySession({ interactive: true });
168
- * if (session.ok) console.log(session.email);
169
- */
170
80
  export async function ensureRegistrySession(opts) {
171
81
  let identity;
172
82
  try {
@@ -190,8 +100,6 @@ export async function ensureRegistrySession(opts) {
190
100
  detail: "no registry session is cached and this run cannot open a sign-in",
191
101
  };
192
102
  }
193
- // The reserved key gets the registry's identity as its config so the
194
- // ordinary token machinery (refresh included) works for it unchanged.
195
103
  const stored = getContextConfig(REGISTRY_CREDENTIAL_KEY);
196
104
  if (!stored) {
197
105
  writeContextConfig(REGISTRY_CREDENTIAL_KEY, {
@@ -200,8 +108,6 @@ export async function ensureRegistrySession(opts) {
200
108
  registryBroker: identity.registryBroker,
201
109
  });
202
110
  }
203
- // Said here, not by the caller: only now is it known that no cached session
204
- // could be refreshed, so this line never precedes a silent refresh.
205
111
  logInfo(opts.device
206
112
  ? "No registry session — sign in with the device code below…"
207
113
  : "No registry session — opening your browser to sign in… (headless? use --device)");
@@ -222,17 +128,6 @@ export async function ensureRegistrySession(opts) {
222
128
  expiresAt: creds.expiresAt,
223
129
  };
224
130
  }
225
- /**
226
- * The Zitadel project-role names a session token carries, sorted.
227
- *
228
- * Empty for a token with no roles claim and for anything that does not parse
229
- * as a JWT — a caller comparing two of these treats "unreadable" as "no roles
230
- * to compare", which is the safe reading for a token the broker will refuse
231
- * anyway.
232
- *
233
- * @example
234
- * registryTokenRoles(idToken); // → ["registry:read"]
235
- */
236
131
  export function registryTokenRoles(idToken) {
237
132
  if (!idToken)
238
133
  return [];
@@ -243,21 +138,6 @@ export function registryTokenRoles(idToken) {
243
138
  return [];
244
139
  }
245
140
  }
246
- /**
247
- * Re-mint the registry session's token so a role granted after the sign-in
248
- * reaches the broker. Roles ride in a Zitadel token from the moment it is
249
- * issued: a still-valid session keeps presenting the roles it had at sign-in
250
- * until it is re-minted.
251
- *
252
- * `rolesChanged` is the field a retry turns on. A re-mint that comes back with
253
- * the same roles presents the broker with the same authorization facts, so
254
- * asking again can only buy a second round trip to the same answer.
255
- *
256
- * @returns `{ reminted: false, rolesChanged: false }` when there is no
257
- * session, no refresh token, or the issuer refuses the exchange.
258
- * @example
259
- * if ((await refreshRegistrySession("registry")).rolesChanged) retryTheBroker();
260
- */
261
141
  export async function refreshRegistrySession(context) {
262
142
  const before = registryTokenRoles(readCredentials(context)?.idToken);
263
143
  const idToken = await forceRefreshToken(context);
@@ -267,35 +147,15 @@ export async function refreshRegistrySession(context) {
267
147
  const same = after.length === before.length && after.every((role, i) => role === before[i]);
268
148
  return { reminted: true, rolesChanged: !same };
269
149
  }
270
- /**
271
- * Forget the registry: the session AND the pinned identity record, so the
272
- * next `mesh registry login` re-discovers the registry from the pinned
273
- * domain. Clears the reserved key only — a platform session under `mesh.dev`
274
- * that happened to double as the registry's is a platform login and stays.
275
- *
276
- * @example
277
- * clearRegistrySession(); // `mesh registry logout`
278
- */
279
150
  export function clearRegistrySession() {
280
151
  clearCredentials(REGISTRY_CREDENTIAL_KEY);
281
152
  clearContextConfig(REGISTRY_CREDENTIAL_KEY);
282
153
  }
283
- /**
284
- * True when two identity records disagree on anything that matters for a
285
- * broker call — the signal that a re-discovery is worth a retry.
286
- *
287
- * @example
288
- * identityChanged(a, { ...a, registryBroker: "https://moved" }); // → true
289
- */
290
154
  export function identityChanged(before, after) {
291
155
  return (before.issuer !== after.issuer ||
292
156
  before.clientId !== after.clientId ||
293
157
  before.registryBroker !== after.registryBroker);
294
158
  }
295
- /**
296
- * Human-readable time left on a session, e.g. `11h 42m`; `expired` when the
297
- * expiry has passed. Pure; exported for the status line's test.
298
- */
299
159
  export function describeSessionExpiry(expiresAt, now = Date.now()) {
300
160
  const ms = new Date(expiresAt).getTime() - now;
301
161
  if (!(ms > 0))
@@ -305,15 +165,12 @@ export function describeSessionExpiry(expiresAt, now = Date.now()) {
305
165
  const m = totalMinutes % 60;
306
166
  return h > 0 ? `${h}h ${m}m` : `${m}m`;
307
167
  }
308
- /** Log the one-line identity banner `mesh registry login` opens with. */
309
168
  export function logRegistryIdentity(identity) {
310
169
  let host = identity.registryBroker;
311
170
  try {
312
171
  host = new URL(identity.registryBroker).host;
313
172
  }
314
173
  catch {
315
- // keep the raw value when it is not a URL
316
174
  }
317
175
  logInfo(`Mesh package registry: mesh-platform (broker ${host})`);
318
176
  }
319
- //# sourceMappingURL=registry-identity.js.map
@@ -1,57 +1,16 @@
1
- /**
2
- * Dependency versions written into a scaffolded app.
3
- *
4
- * Why this exists
5
- * ───────────────
6
- * `mesh create-app --primitives` renders the fragment templates, and those
7
- * package.json files have to install in TWO very different places:
8
- *
9
- * - inside this monorepo → `workspace:*` + `catalog:` (link local source)
10
- * - inside a standalone tenant-apps repo → concrete, published ranges
11
- *
12
- * The standalone branch takes a caret range on the CURRENT published line,
13
- * resolved from the registry at scaffold time. The baked value below is a
14
- * floor, used only when that lookup can't run (offline, no registry auth
15
- * yet, CI) — not the answer.
16
- */
17
- /**
18
- * The `@mesh-tech/*` package whose published version defines the lockstep
19
- * group's current line. The publishable packages move together, so one lookup
20
- * answers for all of them. `@mesh-tech/esm-bundle` versions independently, so
21
- * it gets its own entry.
22
- */
23
1
  export declare const SCAFFOLD_PACKAGE_LINES: {
24
2
  readonly "@mesh-tech/app-kit": "^1.45.0";
25
3
  readonly "@mesh-tech/esm-bundle": "^0.1.1";
26
4
  };
27
5
  export type ScaffoldPackage = keyof typeof SCAFFOLD_PACKAGE_LINES;
28
- /**
29
- * Toolchain devDependencies for the standalone branch. These mirror the
30
- * workspace catalog in `pnpm-workspace.yaml` (which the published CLI cannot
31
- * read); `test/scaffold-versions.test.ts` fails if the two drift apart.
32
- */
33
6
  export declare const SCAFFOLD_TOOLCHAIN: {
34
7
  readonly "@types/node": "^24.2.1";
35
8
  readonly tsx: "^4.20.4";
36
9
  readonly typescript: "^5.9.2";
37
10
  };
38
- /** True for a caret range on a prerelease/build-metadata version (`^0.0.0-dev.1`). */
39
11
  export declare function isPrerelease(range: string): boolean;
40
- /** Pure: `1.45.1` → `^1.45.1`. Returns null for anything that isn't x.y.z. */
41
12
  export declare function toCaretRange(version: string): string | null;
42
- /**
43
- * Ask the registry for a package's current published line, as a caret range.
44
- * `cwd` matters: the target repo's `.npmrc` is what maps `@mesh-tech` to
45
- * CodeArtifact. Any failure (offline, 401, npm missing) falls back silently —
46
- * a scaffold must never hard-fail on a version lookup.
47
- *
48
- * A prerelease answer is refused here rather than in `toCaretRange`, which
49
- * stays a pure format check. Most published `@mesh-tech/*` versions are
50
- * `0.0.0-dev.<timestamp>.<sha>` snapshots; a `latest` that ever lands on one
51
- * would otherwise pin every future scaffold to a single dev build.
52
- */
53
13
  export declare function resolvePublishedRange(pkg: ScaffoldPackage, cwd: string): {
54
14
  range: string;
55
15
  resolved: boolean;
56
16
  };
57
- //# sourceMappingURL=scaffold-versions.d.ts.map
@@ -1,60 +1,20 @@
1
- /**
2
- * Dependency versions written into a scaffolded app.
3
- *
4
- * Why this exists
5
- * ───────────────
6
- * `mesh create-app --primitives` renders the fragment templates, and those
7
- * package.json files have to install in TWO very different places:
8
- *
9
- * - inside this monorepo → `workspace:*` + `catalog:` (link local source)
10
- * - inside a standalone tenant-apps repo → concrete, published ranges
11
- *
12
- * The standalone branch takes a caret range on the CURRENT published line,
13
- * resolved from the registry at scaffold time. The baked value below is a
14
- * floor, used only when that lookup can't run (offline, no registry auth
15
- * yet, CI) — not the answer.
16
- */
17
1
  import { execFileSync } from "child_process";
18
- /**
19
- * The `@mesh-tech/*` package whose published version defines the lockstep
20
- * group's current line. The publishable packages move together, so one lookup
21
- * answers for all of them. `@mesh-tech/esm-bundle` versions independently, so
22
- * it gets its own entry.
23
- */
24
2
  export const SCAFFOLD_PACKAGE_LINES = {
25
3
  "@mesh-tech/app-kit": "^1.45.0",
26
4
  "@mesh-tech/esm-bundle": "^0.1.1",
27
5
  };
28
- /**
29
- * Toolchain devDependencies for the standalone branch. These mirror the
30
- * workspace catalog in `pnpm-workspace.yaml` (which the published CLI cannot
31
- * read); `test/scaffold-versions.test.ts` fails if the two drift apart.
32
- */
33
6
  export const SCAFFOLD_TOOLCHAIN = {
34
7
  "@types/node": "^24.2.1",
35
8
  tsx: "^4.20.4",
36
9
  typescript: "^5.9.2",
37
10
  };
38
- /** True for a caret range on a prerelease/build-metadata version (`^0.0.0-dev.1`). */
39
11
  export function isPrerelease(range) {
40
12
  return /[-+]/.test(range.replace(/^\^/, ""));
41
13
  }
42
- /** Pure: `1.45.1` → `^1.45.1`. Returns null for anything that isn't x.y.z. */
43
14
  export function toCaretRange(version) {
44
15
  const trimmed = version.trim();
45
16
  return /^\d+\.\d+\.\d+(?:[-+].*)?$/.test(trimmed) ? `^${trimmed}` : null;
46
17
  }
47
- /**
48
- * Ask the registry for a package's current published line, as a caret range.
49
- * `cwd` matters: the target repo's `.npmrc` is what maps `@mesh-tech` to
50
- * CodeArtifact. Any failure (offline, 401, npm missing) falls back silently —
51
- * a scaffold must never hard-fail on a version lookup.
52
- *
53
- * A prerelease answer is refused here rather than in `toCaretRange`, which
54
- * stays a pure format check. Most published `@mesh-tech/*` versions are
55
- * `0.0.0-dev.<timestamp>.<sha>` snapshots; a `latest` that ever lands on one
56
- * would otherwise pin every future scaffold to a single dev build.
57
- */
58
18
  export function resolvePublishedRange(pkg, cwd) {
59
19
  try {
60
20
  const out = execFileSync("npm", ["view", pkg, "version"], {
@@ -68,8 +28,6 @@ export function resolvePublishedRange(pkg, cwd) {
68
28
  return { range, resolved: true };
69
29
  }
70
30
  catch {
71
- // fall through to the baked floor
72
31
  }
73
32
  return { range: SCAFFOLD_PACKAGE_LINES[pkg], resolved: false };
74
33
  }
75
- //# sourceMappingURL=scaffold-versions.js.map
@@ -1,40 +1,16 @@
1
- /**
2
- * A minimal SOCKS5 CONNECT forwarder: listens on a local TCP port and pipes
3
- * each client connection through a SOCKS5 proxy (no-auth) to a fixed target.
4
- *
5
- * Presents the same plain `localhost:PORT` contract the SSM tunnels give today,
6
- * so an app (e.g. a Temporal gRPC client) connects with no proxy awareness —
7
- * the SOCKS5 proxy is the userspace-Tailscale daemon (MESH-2040 / MESH-2036).
8
- */
9
1
  import * as net from "node:net";
10
- /** `"10.0.137.203"` → `[10,0,137,203]`; throws on anything that isn't IPv4. */
11
2
  export declare function ipv4ToBytes(ip: string): number[];
12
- /** SOCKS5 CONNECT request for an IPv4 target (VER, CMD=CONNECT, RSV, ATYP=IPv4, addr, port). */
13
3
  export declare function socks5ConnectRequest(ip: string, port: number): Buffer;
14
- /** Interpret the SOCKS5 reply code (byte 1 of the CONNECT reply). */
15
4
  export declare function interpretSocksReply(code: number): {
16
5
  ok: boolean;
17
6
  message: string;
18
7
  };
19
8
  export interface ForwarderOptions {
20
- /** Local TCP port to listen on (0 = ephemeral, useful in tests). */
21
9
  listenPort: number;
22
10
  socksHost?: string;
23
11
  socksPort: number;
24
12
  targetIp: string;
25
13
  targetPort: number;
26
- /**
27
- * Observes server errors — above all a bind failure (`EADDRINUSE`). The
28
- * forwarder still never crashes the process, but the error must not be
29
- * INVISIBLE: an unbound forwarder whose port is held by a foreign process is
30
- * the silent-dead-tunnel class (MESH-2407), so callers record it and the
31
- * ownership handshake reports the port as not-listening.
32
- */
33
14
  onError?: (err: NodeJS.ErrnoException) => void;
34
15
  }
35
- /**
36
- * Create (and start) a forwarder server. Each inbound client is spliced to
37
- * `targetIp:targetPort` via a SOCKS5 CONNECT through `socksHost:socksPort`.
38
- */
39
16
  export declare function createForwarder(opts: ForwarderOptions): net.Server;
40
- //# sourceMappingURL=socks-forward.d.ts.map
@@ -1,13 +1,4 @@
1
- /**
2
- * A minimal SOCKS5 CONNECT forwarder: listens on a local TCP port and pipes
3
- * each client connection through a SOCKS5 proxy (no-auth) to a fixed target.
4
- *
5
- * Presents the same plain `localhost:PORT` contract the SSM tunnels give today,
6
- * so an app (e.g. a Temporal gRPC client) connects with no proxy awareness —
7
- * the SOCKS5 proxy is the userspace-Tailscale daemon (MESH-2040 / MESH-2036).
8
- */
9
1
  import * as net from "node:net";
10
- /** `"10.0.137.203"` → `[10,0,137,203]`; throws on anything that isn't IPv4. */
11
2
  export function ipv4ToBytes(ip) {
12
3
  const parts = ip.split(".");
13
4
  if (parts.length !== 4)
@@ -20,7 +11,6 @@ export function ipv4ToBytes(ip) {
20
11
  return n;
21
12
  });
22
13
  }
23
- /** SOCKS5 CONNECT request for an IPv4 target (VER, CMD=CONNECT, RSV, ATYP=IPv4, addr, port). */
24
14
  export function socks5ConnectRequest(ip, port) {
25
15
  return Buffer.from([0x05, 0x01, 0x00, 0x01, ...ipv4ToBytes(ip), (port >> 8) & 0xff, port & 0xff]);
26
16
  }
@@ -35,21 +25,16 @@ const SOCKS_REPLY_MESSAGES = {
35
25
  7: "command not supported",
36
26
  8: "address type not supported",
37
27
  };
38
- /** Interpret the SOCKS5 reply code (byte 1 of the CONNECT reply). */
39
28
  export function interpretSocksReply(code) {
40
29
  return { ok: code === 0, message: SOCKS_REPLY_MESSAGES[code] ?? `unknown SOCKS reply ${code}` };
41
30
  }
42
- /**
43
- * Create (and start) a forwarder server. Each inbound client is spliced to
44
- * `targetIp:targetPort` via a SOCKS5 CONNECT through `socksHost:socksPort`.
45
- */
46
31
  export function createForwarder(opts) {
47
32
  const socksHost = opts.socksHost ?? "127.0.0.1";
48
33
  const server = net.createServer((client) => {
49
34
  const up = net.connect(opts.socksPort, socksHost);
50
35
  let buf = Buffer.alloc(0);
51
- let phase = 0; // 0=await method-select, 1=await connect reply, 2=streaming
52
- up.on("connect", () => up.write(Buffer.from([0x05, 0x01, 0x00]))); // greet, no-auth
36
+ let phase = 0;
37
+ up.on("connect", () => up.write(Buffer.from([0x05, 0x01, 0x00])));
53
38
  up.on("data", (d) => {
54
39
  if (phase === 2)
55
40
  return;
@@ -80,18 +65,10 @@ export function createForwarder(opts) {
80
65
  });
81
66
  client.on("error", () => up.destroy());
82
67
  up.on("error", () => client.destroy());
83
- // A cleanly-closed client (clean FIN, no "error") must still tear down the
84
- // upstream SOCKS→target leg — otherwise a probe that connects then closes
85
- // strands a real VPC-target connection until the target times out.
86
68
  client.on("close", () => up.destroy());
87
69
  up.on("close", () => client.destroy());
88
70
  });
89
- // A bind failure (e.g. the port is already held by an SSM tunnel) must not
90
- // crash the process running this forwarder — but it must be OBSERVED, not
91
- // swallowed: the runner records it and ownership checks fail the port.
92
- // Attach before listen() so the error is caught.
93
71
  server.on("error", (err) => opts.onError?.(err));
94
72
  server.listen(opts.listenPort, "127.0.0.1");
95
73
  return server;
96
74
  }
97
- //# sourceMappingURL=socks-forward.js.map