@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,81 +1,3 @@
1
- /**
2
- * `mesh dev --externals` (alias `--mock`) — external-service realizations
3
- * for a local dev session (MESH-1885, design C4).
4
- *
5
- * Apps DECLARE how each external dependency is realized locally in the root
6
- * package.json under `mesh.externals` (legacy key `mesh.mocks` still read).
7
- * Every declaration runs in exactly one of three MODES:
8
- *
9
- * mock — the service is MIMICKED: no real instance exists locally or
10
- * remotely. Realized from an OpenAPI spec (`openapi` → Prism
11
- * mock server) or a hand-written mock process (`src`).
12
- * local — a LOCAL VERSION of the real service runs on this machine,
13
- * e.g. a vendor-shaped database replica. Realized from a docker
14
- * compose file (`compose` + published `port`).
15
- * remote — the session connects to the ACTUAL external service: either
16
- * the vendor's real endpoint with inline `credentials` (e.g. a
17
- * sandbox), or the external service as configured in the app's
18
- * tenant environment (`remote.env`, e.g. dev — credentials are
19
- * pulled from that environment's secret).
20
- *
21
- * "mesh": {
22
- * "externals": {
23
- * "plaid-db": { // ── local (default) ──
24
- * "mode": "local",
25
- * "compose": "libs/plaid-db/docker/docker-compose.yml",
26
- * "port": 1433, // REQUIRED: the published port
27
- * "probe": "tcp", // non-HTTP uptime probe
28
- * "external": "plaid-db",
29
- * "credentials": { // {{host}}/{{port}} → localhost:1433
30
- * "host": "{{host}}", "port": "{{port}}",
31
- * "name": "Plaid_Clean", "username": "sa",
32
- * "password": "{{env:PLAID_DB_PASSWORD}}"
33
- * },
34
- * "remote": { "env": "dev" } // `--externals plaid-db=remote`
35
- * }, // pulls the dev-configured secret
36
- * "plaid": { // ── remote ──
37
- * "mode": "remote",
38
- * "external": "plaid", // the vendor's REAL sandbox
39
- * "displayName": "Plaid", // the Hub shows the real name…
40
- * "type": "api", // …and the integration type
41
- * "docs": "https://plaid.com/docs/api/", // vendor reference docs
42
- * "credentials": {
43
- * "endpoint": "https://sandbox.plaid.com",
44
- * "client_id": "{{env:PLAID_CLIENT_ID}}",
45
- * "secret": "{{env:PLAID_SECRET}}"
46
- * }
47
- * },
48
- * "vendorpay": { // ── mock ──
49
- * "mode": "mock",
50
- * "openapi": "api/docs/spec/openapi.json", // spec → Prism emulation
51
- * "external": "vendorpay",
52
- * "credentials": { "baseUrl": "{{url}}", "apiKey": "mock" }
53
- * }
54
- * }
55
- * }
56
- *
57
- * `mode` picks the DEFAULT; a declaration may carry more than one
58
- * realization (e.g. compose + remote.env) and the CLI overrides per
59
- * external at run time: `mesh dev --externals plaid-db=remote,plaid`.
60
- * Declarations without `mode` infer it from their fields (compose → local,
61
- * openapi/src → mock, sandbox/credentials-only → remote), so pre-mode
62
- * declarations keep working (`sandbox: true` is a deprecated alias for
63
- * mode remote).
64
- *
65
- * All credential values support `{{env:VAR}}` interpolation from the
66
- * developer's environment, so real secrets (sandbox keys, DB passwords)
67
- * never land in package.json.
68
- *
69
- * Realization: mock externals join the SAME orchestration as services named
70
- * mock-{name} (ports, env files, tmux windows, Loki log pipeline); local
71
- * externals come up via `docker compose up -d --wait` before the app's
72
- * services and are torn down on `mesh dev --kill`; remote externals spawn
73
- * nothing. In every mode the ExternalService credential secret is seeded at
74
- * mesh/{tenant}/{env}/external/{name} so the app's resolveCredentials()
75
- * path runs UNCHANGED, the vendor is registered in the local Hub's
76
- * external-services view, and a blackbox uptime probe watches the
77
- * realization — remote endpoints included.
78
- */
79
1
  import { execFileSync } from "child_process";
80
2
  import * as fs from "fs";
81
3
  import * as path from "path";
@@ -86,12 +8,6 @@ import { probeTcp, upsertLocalSecret } from "./helpers.js";
86
8
  import { localProbesDir } from "./stack.js";
87
9
  const EXTERNAL_MODES = ["mock", "local", "remote"];
88
10
  const DECL_DOCS = { docs: 'package.json → "mesh": { "externals": { … } }' };
89
- /**
90
- * Resolve + validate an external's mode: explicit `mode` (or the one
91
- * inferred from the realization fields), checked against the fields that
92
- * mode needs. Pre-mode declarations infer: compose → local, openapi/src →
93
- * mock, sandbox/credentials-only → remote.
94
- */
95
11
  export function externalMode(name, decl) {
96
12
  const mode = decl.mode ??
97
13
  (decl.compose
@@ -120,14 +36,6 @@ export function externalMode(name, decl) {
120
36
  }
121
37
  return mode;
122
38
  }
123
- /**
124
- * Parse a `--externals` value — a comma-separated list of `name` or
125
- * `name=mode` entries. An explicit mode overrides that declaration's
126
- * default FOR THIS RUN; a bare name keeps the declared default.
127
- *
128
- * Names are returned in the order typed, de-duplicated (the last mode
129
- * given for a name wins, so `--externals plaid,plaid=remote` is remote).
130
- */
131
39
  export function parseExternalsSelection(input) {
132
40
  const names = [];
133
41
  const overrides = new Map();
@@ -148,13 +56,6 @@ export function parseExternalsSelection(input) {
148
56
  }
149
57
  return { names, overrides };
150
58
  }
151
- /**
152
- * The inline credential template a remote-mode run should use, if any:
153
- * `remote.credentials` always wins; top-level `credentials` count only when
154
- * the declaration has no local/mock realization (otherwise they are that
155
- * realization's template, full of {{host}}/{{port}} tokens that only mean
156
- * something against a local endpoint).
157
- */
158
59
  export function remoteInlineCredentials(decl) {
159
60
  if (decl.remote?.credentials)
160
61
  return decl.remote.credentials;
@@ -162,16 +63,9 @@ export function remoteInlineCredentials(decl) {
162
63
  return decl.credentials;
163
64
  return undefined;
164
65
  }
165
- /** Whether this declaration runs as a mock-{name} service in the dev
166
- * orchestration (mock mode) vs outside it (local compose / remote). */
167
66
  export function isServiceMode(name, decl) {
168
67
  return externalMode(name, decl) === "mock";
169
68
  }
170
- /**
171
- * Interpolate one credential value: {{url}}/{{host}}/{{port}} from the
172
- * stand-in's endpoint, {{env:VAR}} from the developer's environment
173
- * (missing env vars are a hard error — a half-seeded secret is worse).
174
- */
175
69
  export function interpolateCredentialValue(raw, endpoint, env = process.env) {
176
70
  let value = raw.replace(/\{\{env:([A-Za-z_][A-Za-z0-9_]*)\}\}/g, (_, name) => {
177
71
  const resolved = env[name];
@@ -188,9 +82,6 @@ export function interpolateCredentialValue(raw, endpoint, env = process.env) {
188
82
  }
189
83
  return value;
190
84
  }
191
- /** The Prism mock command for an openapi-mode declaration. `$PORT` expands
192
- * in the service's launch shell (tmux and docker runners both source the
193
- * env file), so port reallocation keeps working. */
194
85
  export function openapiMockCommand(decl) {
195
86
  return (decl.command ?? [
196
87
  "npx",
@@ -204,12 +95,9 @@ export function openapiMockCommand(decl) {
204
95
  decl.openapi,
205
96
  ]);
206
97
  }
207
- /** Compose-mode project name — pinned so `--kill` can tear down exactly
208
- * what `up` created, regardless of the compose file's own `name:`. */
209
98
  export function composeProjectName(sessionName, mockName) {
210
99
  return `mesh-ext-${sessionName}-${mockName}`.toLowerCase().replace(/[^a-z0-9_-]/g, "-");
211
100
  }
212
- /** Wait until the external's published port accepts TCP (bounded). */
213
101
  async function waitForPort(port, timeoutMs) {
214
102
  const deadline = Date.now() + timeoutMs;
215
103
  while (Date.now() < deadline) {
@@ -219,21 +107,6 @@ async function waitForPort(port, timeoutMs) {
219
107
  }
220
108
  return false;
221
109
  }
222
- /**
223
- * Decide how to realize a compose external, given what already exists.
224
- *
225
- * OWNERSHIP FIRST: a port probe can't tell WHO serves the port, and the
226
- * ordinary flow re-runs `mesh dev` against a session whose compose externals
227
- * are deliberately left running. Adopting there would drop the ref from
228
- * session state and permanently orphan the checkout's own container, so our
229
- * own realization takes the normal `up` path (idempotent, ref re-recorded)
230
- * and only a foreign one is adopted.
231
- *
232
- * IDENTITY SECOND: a foreign publisher is only adopted when it is a service
233
- * THIS compose file defines. Well-known ports (1433/5432/22) are exactly
234
- * where a native install or an unrelated container turns up, and adopting one
235
- * silently seeds the app's credentials against the wrong database.
236
- */
237
110
  export async function planComposeExternal(composeFile, project, port, probes) {
238
111
  if (probes.ownsRunning(composeFile, project))
239
112
  return { action: "up" };
@@ -244,38 +117,17 @@ export async function planComposeExternal(composeFile, project, port, probes) {
244
117
  }
245
118
  return { action: "adopt-served", container: publisher.container };
246
119
  }
247
- // Pinned container_name held by a STOPPED container from another checkout/
248
- // project would make `up` fail with a name conflict — start that container
249
- // instead. (A RUNNING one is caught by the port probe above.)
250
120
  const foreign = probes.foreignPinned(composeFile, project);
251
121
  if (foreign)
252
122
  return { action: "adopt-stopped", container: foreign };
253
123
  return { action: "up" };
254
124
  }
255
- /** Real docker/network probes — replaced in tests. */
256
125
  const dockerProbes = {
257
126
  ownsRunning: ownsRunningRealization,
258
127
  portServed: (port) => probeTcp(port, { timeoutMs: 2000 }),
259
128
  foreignPinned: foreignPinnedContainer,
260
129
  portPublisher: composeFilePortPublisher,
261
130
  };
262
- /**
263
- * Bring a compose-mode external up (idempotent; waits for healthchecks —
264
- * vendor DBs restoring seed data can take a while, hence the timeout).
265
- *
266
- * ADOPTION: the same external is often realized by more than one checkout —
267
- * e.g. a vendor-DB compose ported from a legacy repo pins `container_name`
268
- * and a host port, so whichever checkout created it first blocks every other
269
- * `docker compose up` (name + port conflicts). An external service is by
270
- * definition outside the app, so if ANOTHER checkout already serves its
271
- * published port — or left a stopped container holding the pinned name —
272
- * this ADOPTS that realization instead of failing: skip/`docker start`, wait
273
- * for the port, and return undefined so `--kill` never tears down what
274
- * another checkout owns. Our OWN realization is never adopted (see
275
- * `planComposeExternal`) — it stays recorded so `--kill` still cleans it up,
276
- * and a publisher this compose file doesn't define is never adopted either
277
- * (it would seed the app's credentials against the wrong service).
278
- */
279
131
  export async function composeExternalUp(appRoot, sessionName, name, decl, probes = dockerProbes) {
280
132
  const composeFile = path.resolve(appRoot, decl.compose);
281
133
  if (!fs.existsSync(composeFile)) {
@@ -308,24 +160,15 @@ export async function composeExternalUp(appRoot, sessionName, name, decl, probes
308
160
  execFileSync("docker", ["compose", "-p", project, "-f", composeFile, "up", "-d", "--wait", "--wait-timeout", "300"], { stdio: ["ignore", "inherit", "inherit"] });
309
161
  return { name, composeFile, project };
310
162
  }
311
- /** Whether OUR compose project already has a container running for this file.
312
- * `docker compose ps` (running only) covers services WITHOUT a pinned
313
- * `container_name` too, which the label-inspect path below structurally
314
- * cannot — an unpinned service of ours is just `<project>-<svc>-1`. */
315
163
  function ownsRunningRealization(composeFile, project) {
316
164
  try {
317
165
  const out = execFileSync("docker", ["compose", "-p", project, "-f", composeFile, "ps", "--format", "json"], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
318
- // Compose emits either a JSON array or NDJSON depending on version;
319
- // "has any row" is all we need from it.
320
166
  return out.length > 0 && out !== "[]";
321
167
  }
322
168
  catch {
323
- // ps hiccup — treat as "not ours" and let the normal paths decide.
324
169
  return false;
325
170
  }
326
171
  }
327
- /** The compose file's rendered service map, or undefined when it can't be
328
- * rendered (docker missing / bad file — callers decide what that means). */
329
172
  function composeServices(composeFile) {
330
173
  try {
331
174
  const config = JSON.parse(execFileSync("docker", ["compose", "-f", composeFile, "config", "--format", "json"], {
@@ -368,17 +211,12 @@ function portPublisher(port) {
368
211
  return undefined;
369
212
  }
370
213
  }
371
- /** Whether the container publishing the declared port is a service THIS
372
- * compose file defines — the evidence adoption requires. Matches on the
373
- * pinned `container_name`, or on the compose service name (cross-checked
374
- * against the image when both sides declare one, so an unrelated project's
375
- * service that happens to be called `db` isn't mistaken for ours). */
376
214
  function composeFileOwns(composeFile, publisher) {
377
215
  if (!publisher)
378
216
  return false;
379
217
  const services = composeServices(composeFile);
380
218
  if (!services)
381
- return false; // no identity evidence — don't adopt
219
+ return false;
382
220
  for (const [key, svc] of Object.entries(services)) {
383
221
  if (svc?.container_name && svc.container_name === publisher.container)
384
222
  return true;
@@ -389,22 +227,13 @@ function composeFileOwns(composeFile, publisher) {
389
227
  }
390
228
  return false;
391
229
  }
392
- /** `ComposeExternalProbes.portPublisher` — who serves the declared port, and
393
- * whether this compose file defines it. Undefined when docker publishes
394
- * nothing there (a native process on the port, or no docker at all), which
395
- * `planComposeExternal` treats as a conflict rather than an adoption. */
396
230
  function composeFilePortPublisher(composeFile, port) {
397
231
  const publisher = portPublisher(port);
398
232
  if (!publisher)
399
233
  return undefined;
400
234
  return { container: publisher.container, definedByFile: composeFileOwns(composeFile, publisher) };
401
235
  }
402
- /** Find a container holding a `container_name` this compose file pins, when
403
- * it belongs to a different compose project (another checkout's realization
404
- * of the same external). Returns the container name, or undefined. */
405
236
  function foreignPinnedContainer(composeFile, project) {
406
- // config render hiccup — fall through to the normal `up`, which reports
407
- // real errors itself.
408
237
  for (const svc of Object.values(composeServices(composeFile) ?? {})) {
409
238
  const pinned = svc?.container_name;
410
239
  if (!pinned)
@@ -415,14 +244,10 @@ function foreignPinnedContainer(composeFile, project) {
415
244
  return pinned;
416
245
  }
417
246
  catch {
418
- // no container by that name — nothing to adopt for this service
419
247
  }
420
248
  }
421
249
  return undefined;
422
250
  }
423
- /** Tear down compose-mode externals recorded in session state. Volumes are
424
- * kept (vendor DB data survives sessions, like the cloud external it
425
- * stands in for); best-effort per project. */
426
251
  export function composeExternalsDown(refs) {
427
252
  for (const ref of refs ?? []) {
428
253
  try {
@@ -431,14 +256,10 @@ export function composeExternalsDown(refs) {
431
256
  });
432
257
  }
433
258
  catch {
434
- /* best effort — the file may be gone or docker down */
435
259
  }
436
260
  }
437
261
  }
438
- /** Same heuristic the schema seed uses: which credential keys are secret. */
439
262
  const SECRET_KEY_RE = /key|secret|password|token/i;
440
- /** Read the app's declared externals (root package.json → mesh.externals;
441
- * legacy key mesh.mocks still read, externals wins on name collision). */
442
263
  export function readLocalMocks(appRoot) {
443
264
  try {
444
265
  const pkg = JSON.parse(fs.readFileSync(path.join(appRoot, "package.json"), "utf-8"));
@@ -456,15 +277,6 @@ export function readLocalMocks(appRoot) {
456
277
  export function externalSecretPath(tenant, external) {
457
278
  return `mesh/${tenant}/${LOCAL_ENV}/external/${external}`;
458
279
  }
459
- /**
460
- * Pull an external service's credentials as configured in the app's tenant
461
- * environment (the CLOUD platform, not the local fabric) — secret
462
- * mesh/{tenant}/{env}/external/{name}, read with the developer's ambient
463
- * AWS credentials (AWS_PROFILE / SSO session for that tenant's account).
464
- * When the shell carries no AWS identity at all, `profile` (from the
465
- * declaration; MESH_AWS_PROFILE overrides) names the profile to use — the
466
- * same convention repo pull scripts follow.
467
- */
468
280
  export async function fetchRemoteExternalCredentials(tenant, env, external, profile) {
469
281
  const secretId = `mesh/${tenant}/${env}/external/${external}`;
470
282
  const region = process.env.MESH_PLATFORM_REGION ?? process.env.AWS_REGION ?? "us-east-2";
@@ -473,8 +285,6 @@ export async function fetchRemoteExternalCredentials(tenant, env, external, prof
473
285
  : undefined;
474
286
  try {
475
287
  const { SecretsManagerClient, GetSecretValueCommand } = await import("@aws-sdk/client-secrets-manager");
476
- // The SDK's default chain reads AWS_PROFILE at first resolution — scope
477
- // the fallback to this client's call (no ambient identity to clobber).
478
288
  if (fallbackProfile)
479
289
  process.env.AWS_PROFILE = fallbackProfile;
480
290
  const sm = new SecretsManagerClient({ region });
@@ -500,20 +310,9 @@ export async function fetchRemoteExternalCredentials(tenant, env, external, prof
500
310
  });
501
311
  }
502
312
  }
503
- /** The prober runs inside the stack: anything addressed at the developer
504
- * host must go through host.docker.internal. */
505
313
  function hostForProber(target) {
506
314
  return target.replace(/\b(?:localhost|127\.0\.0\.1)\b/, "host.docker.internal");
507
315
  }
508
- /**
509
- * A credential's endpoint value as an HTTP probe target, or undefined when
510
- * it isn't one. Credentials pulled from a tenant secret carry whatever the
511
- * vendor configured — a JDBC/ODBC connection string, an `sftp://` URL, or
512
- * an http URL with embedded userinfo. Anything non-http(s) falls through to
513
- * the tcp branch, and userinfo is stripped: the target is written to a
514
- * plaintext probe file and relabeled into Prometheus' `instance` label, so
515
- * a password in it would leak into every `probe_*` series.
516
- */
517
316
  function httpProbeUrl(raw) {
518
317
  if (!raw)
519
318
  return undefined;
@@ -530,10 +329,6 @@ function httpProbeUrl(raw) {
530
329
  parsed.password = "";
531
330
  return hostForProber(parsed.toString());
532
331
  }
533
- /** Reachability target for a non-HTTP integration, derived from its
534
- * credentials: a host/port pair (databases, SFTP) or an S3 bucket endpoint
535
- * (probed via TCP — no SDK or credentials needed, the technique CSP's
536
- * network lib used). */
537
332
  function derivedTcpTarget(creds) {
538
333
  if (creds.host && creds.port)
539
334
  return `${hostForProber(creds.host)}:${creds.port}`;
@@ -541,30 +336,9 @@ function derivedTcpTarget(creds) {
541
336
  return `${creds.bucket}.s3.${creds.region || "us-east-1"}.amazonaws.com:443`;
542
337
  return undefined;
543
338
  }
544
- /** The blackbox probe target for a realization, by mode: local/mock
545
- * stand-ins are probed on the host (the prober runs inside the stack →
546
- * host.docker.internal); remote externals are probed at their REAL
547
- * endpoint, so the Hub shows actual vendor reachability. Every integration
548
- * gets AT LEAST a reachability check when its credentials expose a target:
549
- * an HTTP endpoint, a host(:port), or an S3 bucket (probed via TCP to the
550
- * bucket endpoint — no SDK/credentials needed, the same technique CSP's
551
- * network lib used). Undefined = nothing probeable in the credentials.
552
- *
553
- * Target and module come from ONE decision here so they can't drift: a
554
- * misrouted probe just reports probe_success 0, indistinguishable from a
555
- * genuinely down service. `tcp` yields host:port with no scheme/path and
556
- * routes the scrape to blackbox's tcp_connect (the scrape config's default
557
- * stays http_2xx); `http` GETs the target and expects 2xx. */
558
339
  export function resolveProbeTarget(mode, decl, endpoint, creds) {
559
340
  if (mode === "remote") {
560
- // The endpoint comes from a TENANT SECRET, so it may be anything a
561
- // vendor credential carries — a JDBC/ODBC connection string, or a URL
562
- // with userinfo. Only a real http(s) URL is probeable, and its
563
- // credentials must never reach the probe file (world-readable) or the
564
- // Prometheus `instance` label.
565
341
  const url = httpProbeUrl(creds.endpoint ?? creds.url ?? creds.baseUrl);
566
- // Reachability fallbacks for non-HTTP integrations: host:port
567
- // (databases, SFTP) or the S3 bucket endpoint (object storage).
568
342
  const tcpTarget = derivedTcpTarget(creds);
569
343
  if (decl.probe === "tcp" || (!url && tcpTarget)) {
570
344
  if (!tcpTarget && decl.probe === "tcp") {
@@ -572,8 +346,6 @@ export function resolveProbeTarget(mode, decl, endpoint, creds) {
572
346
  }
573
347
  return tcpTarget ? { target: tcpTarget, module: "tcp_connect" } : undefined;
574
348
  }
575
- // Remote endpoints rarely expose /health — default to the endpoint
576
- // root (Plaid's sandbox, for one, answers 200 there).
577
349
  return url ? { target: url.replace(/\/+$/, "") + (decl.healthPath ?? "") } : undefined;
578
350
  }
579
351
  if (!endpoint)
@@ -585,8 +357,6 @@ export function resolveProbeTarget(mode, decl, endpoint, creds) {
585
357
  target: hostForProber(endpoint.url).replace(/\/+$/, "") + (decl.healthPath ?? "/health"),
586
358
  };
587
359
  }
588
- /** Hub display name: explicit `displayName`, else the external name
589
- * title-cased on word boundaries ("plaid-db" → "Plaid Db"). */
590
360
  export function externalDisplayName(name, decl) {
591
361
  return (decl.displayName ??
592
362
  name
@@ -595,49 +365,28 @@ export function externalDisplayName(name, decl) {
595
365
  .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
596
366
  .join(" "));
597
367
  }
598
- /** Normalize the decl's `docs` (string URL or {url, provider}) for the meta. */
599
368
  export function externalDocs(decl) {
600
369
  if (!decl.docs)
601
370
  return undefined;
602
371
  return typeof decl.docs === "string" ? { url: decl.docs } : decl.docs;
603
372
  }
604
- /** Prometheus file_sd target file for one external's uptime probe. One
605
- * file per (tenant, app, external) so a session's probes can be removed on
606
- * `--kill` without touching another app's. */
607
373
  export function localProbeFile(tenant, app, external) {
608
374
  return path.join(localProbesDir(), `${tenant}-${app}-${external}.json`);
609
375
  }
610
- /** Drop probe target files (best effort). Called on `mesh dev --kill` so
611
- * Prometheus stops scraping stand-ins that no longer exist — otherwise the
612
- * Hub shows an integration down for a session that isn't running. */
613
376
  export function localProbesRemove(files) {
614
377
  for (const file of files ?? []) {
615
378
  try {
616
379
  fs.rmSync(file, { force: true });
617
380
  }
618
381
  catch {
619
- /* best effort — the cache dir may be gone */
620
382
  }
621
383
  }
622
384
  }
623
- /**
624
- * Wire a realization into the platform: seed the external-service
625
- * credential secret and register the vendor in the local Hub's
626
- * external-services view — the same shapes ExternalService exports in the
627
- * cloud. `endpoint` is the local stand-in's address (absent in remote
628
- * mode — the credentials carry the real endpoint).
629
- *
630
- * Returns the probe target file this realization registered, if any, so the
631
- * caller can record it in session state and remove it on `--kill`.
632
- */
633
385
  export async function seedLocalMock(args) {
634
386
  const { tenant, app, name, decl, endpoint } = args;
635
387
  if (!decl.external)
636
388
  return undefined;
637
389
  const mode = externalMode(name, decl);
638
- // Credential values by mode: local/mock interpolate the declared template
639
- // against the stand-in's endpoint; remote uses inline credentials or
640
- // pulls the tenant environment's configured secret.
641
390
  let value;
642
391
  if (mode === "remote") {
643
392
  const inline = remoteInlineCredentials(decl);
@@ -658,12 +407,7 @@ export async function seedLocalMock(args) {
658
407
  }
659
408
  const secretName = externalSecretPath(tenant, decl.external);
660
409
  await upsertLocalSecret(secretName, value);
661
- // The .config mirror — non-secret fields only. This is what the Hub's
662
- // credential views READ (the main secret is runtime-only by design), so
663
- // baseUrl etc. display in the Integrations detail page.
664
410
  await upsertLocalSecret(`${secretName}/.config`, Object.fromEntries(Object.entries(value).filter(([key]) => !SECRET_KEY_RE.test(key))));
665
- // Hub discovery — the same per-stack shapes ExternalService exports in the
666
- // cloud (/apps/{app}/stacks/{stack}/external-services/{name}/…).
667
411
  const { SSMClient, PutParameterCommand } = await import("@aws-sdk/client-ssm");
668
412
  const ssm = new SSMClient(LOCAL_AWS_CONFIG);
669
413
  const base = `/mesh-platform/${tenant}/${LOCAL_ENV}/apps/${app}/stacks/local/external-services/${decl.external}`;
@@ -673,9 +417,6 @@ export async function seedLocalMock(args) {
673
417
  Overwrite: true,
674
418
  Value: JSON.stringify({
675
419
  name: decl.external,
676
- // The integration keeps its REAL name in the Hub ("Plaid", not a
677
- // generated phrase); the description leads with it too, so display
678
- // heuristics that promote description heads still land on the name.
679
420
  displayName: externalDisplayName(name, decl),
680
421
  type: decl.type ?? "other",
681
422
  description: mode === "local"
@@ -703,14 +444,6 @@ export async function seedLocalMock(args) {
703
444
  }),
704
445
  Description: `External service credential schema (local mock ${name})`,
705
446
  }));
706
- // Blackbox probe target (Prometheus file_sd) — the local analog of the
707
- // Probe CR ExternalService creates in the cloud, with the SAME label set,
708
- // so probe_success drives the Hub's health/uptime views unchanged.
709
- // Local/mock stand-ins are probed on the host; remote externals at their
710
- // real endpoint (host:port via the tcp_connect module for non-HTTP
711
- // externals — the __probe_module label routes the module through the
712
- // scrape config's relabeling, and "__"-prefixed labels drop after
713
- // relabeling so it never pollutes the stored series).
714
447
  const probe = resolveProbeTarget(mode, decl, endpoint, value);
715
448
  await ssm.send(new PutParameterCommand({
716
449
  Name: `${base}/healthCheck`,
@@ -719,9 +452,6 @@ export async function seedLocalMock(args) {
719
452
  Value: JSON.stringify({ intervalSeconds: 30, timeoutSeconds: 10, hasCustomCheck: false, hasProbe: !!probe }),
720
453
  Description: `External service health check config (local mock ${name})`,
721
454
  }));
722
- // The file and `hasProbe` must never disagree: a realization that no
723
- // longer resolves a probe target drops the file it wrote on a previous
724
- // run, or Prometheus keeps scraping the old target forever.
725
455
  const probeFile = localProbeFile(tenant, app, decl.external);
726
456
  if (probe) {
727
457
  fs.writeFileSync(probeFile, JSON.stringify([
@@ -734,8 +464,6 @@ export async function seedLocalMock(args) {
734
464
  app,
735
465
  external_service: decl.external,
736
466
  target: decl.external,
737
- // "__"-prefixed labels drop after relabeling, so the module
738
- // selector never pollutes the stored series.
739
467
  ...(probe.module ? { __probe_module: probe.module } : {}),
740
468
  },
741
469
  },
@@ -753,4 +481,3 @@ export async function seedLocalMock(args) {
753
481
  ` (Hub registration${probe ? " + uptime probe" : ""})`);
754
482
  return probe ? probeFile : undefined;
755
483
  }
756
- //# sourceMappingURL=mocks.js.map
@@ -1,33 +1,8 @@
1
1
  import type { HubCompiledAuthz } from "./hub-local.js";
2
- /** The Hub's authz pointer, as `seed-zitadel` publishes it. */
3
2
  export declare const HUB_AUTHZ_POINTER_PARAM = "/mesh-platform/local/dev/apps/hub/stacks/local/authz";
4
- /** The ops-hub-metadata blob the Roles/Permissions screens read (`opsHubMetadataPath` shape). */
5
3
  export declare const HUB_OPS_HUB_METADATA_PARAM = "/mesh-platform/local/dev/apps/hub/stacks/local/authz/ops-hub-metadata";
6
- /**
7
- * The pointer with its catalog references filled in — what `AppAuthzPointer`
8
- * publishes for a policy-engine app whose schema component exported metadata.
9
- * Everything else on the pointer (zitadel coordinates, instanceRefs) survives.
10
- *
11
- * @example
12
- * ```typescript
13
- * withHubCatalogRefs({ zitadel: { projectId: "p" } }, "/…/authz/ops-hub-metadata");
14
- * // => { zitadel: { projectId: "p" }, opsHubMetadataRef: "/…/authz/ops-hub-metadata", mode: "policy-engine" }
15
- * ```
16
- */
17
4
  export declare function withHubCatalogRefs(pointer: Record<string, unknown>, metadataRef: string): Record<string, unknown>;
18
- /** Publish the catalog blob and reference it from the Hub's pointer. */
19
5
  export declare function publishHubAuthzCatalog(compiled: HubCompiledAuthz, awsConfig: object): Promise<{
20
6
  bundles: string[];
21
7
  }>;
22
- /**
23
- * The role names a compiled catalog carries. `compileOpsHubMetadata` emits
24
- * `bundles` as a list of `{ name, … }` entries; a keyed map is tolerated too.
25
- *
26
- * @example
27
- * ```typescript
28
- * catalogBundleNames({ bundles: [{ name: "platform_ops" }, { name: "tenant_admin" }] });
29
- * // => ["platform_ops", "tenant_admin"]
30
- * ```
31
- */
32
8
  export declare function catalogBundleNames(metadata: Record<string, unknown>): string[];
33
- //# sourceMappingURL=seed-hub-catalog.d.ts.map
@@ -1,32 +1,6 @@
1
- /**
2
- * Seed the Hub's own role catalog into the local platform.
3
- *
4
- * On a hosted platform `MeshHub` publishes the Hub's compiled authz catalog
5
- * (the ops-hub-metadata blob) beside the Hub's authz pointer, and the Users →
6
- * Roles / Permissions screens render from it. The local platform publishes the
7
- * same two parameters the platform program does, from the catalog the running
8
- * Hub images were built with, so a local Hub's role list matches a hosted one's.
9
- *
10
- * SpiceDB is deliberately NOT touched here: the catalog and role authoring live
11
- * in the ops-hub metadata + ops database; bundle assignments (Hub RBAC Phase 2)
12
- * are what need the `hub` schema on an instance, and that is that phase's job.
13
- */
14
1
  import { LOCAL_ENV, LOCAL_TENANT } from "./seed.js";
15
- /** The Hub's authz pointer, as `seed-zitadel` publishes it. */
16
2
  export const HUB_AUTHZ_POINTER_PARAM = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/apps/hub/stacks/local/authz`;
17
- /** The ops-hub-metadata blob the Roles/Permissions screens read (`opsHubMetadataPath` shape). */
18
3
  export const HUB_OPS_HUB_METADATA_PARAM = `${HUB_AUTHZ_POINTER_PARAM}/ops-hub-metadata`;
19
- /**
20
- * The pointer with its catalog references filled in — what `AppAuthzPointer`
21
- * publishes for a policy-engine app whose schema component exported metadata.
22
- * Everything else on the pointer (zitadel coordinates, instanceRefs) survives.
23
- *
24
- * @example
25
- * ```typescript
26
- * withHubCatalogRefs({ zitadel: { projectId: "p" } }, "/…/authz/ops-hub-metadata");
27
- * // => { zitadel: { projectId: "p" }, opsHubMetadataRef: "/…/authz/ops-hub-metadata", mode: "policy-engine" }
28
- * ```
29
- */
30
4
  export function withHubCatalogRefs(pointer, metadataRef) {
31
5
  return {
32
6
  spicedb: { instanceRefs: [] },
@@ -35,15 +9,12 @@ export function withHubCatalogRefs(pointer, metadataRef) {
35
9
  mode: typeof pointer.mode === "string" ? pointer.mode : "policy-engine",
36
10
  };
37
11
  }
38
- /** Publish the catalog blob and reference it from the Hub's pointer. */
39
12
  export async function publishHubAuthzCatalog(compiled, awsConfig) {
40
13
  const { SSMClient, GetParameterCommand, PutParameterCommand } = await import("@aws-sdk/client-ssm");
41
14
  const ssm = new SSMClient(awsConfig);
42
15
  await ssm.send(new PutParameterCommand({
43
16
  Name: HUB_OPS_HUB_METADATA_PARAM,
44
17
  Type: "String",
45
- // The blob is ~7.5 KB — past the 4 KB standard tier, within Advanced (8 KB),
46
- // the tier the platform's Export uses for the same param.
47
18
  Tier: "Advanced",
48
19
  Overwrite: true,
49
20
  Value: JSON.stringify(compiled.metadata),
@@ -55,7 +26,6 @@ export async function publishHubAuthzCatalog(compiled, awsConfig) {
55
26
  current = JSON.parse(existing.Parameter?.Value ?? "{}");
56
27
  }
57
28
  catch {
58
- // Pointer not published yet — seed-zitadel runs first, so this is a first-boot race at most.
59
29
  }
60
30
  await ssm.send(new PutParameterCommand({
61
31
  Name: HUB_AUTHZ_POINTER_PARAM,
@@ -66,16 +36,6 @@ export async function publishHubAuthzCatalog(compiled, awsConfig) {
66
36
  }));
67
37
  return { bundles: catalogBundleNames(compiled.metadata) };
68
38
  }
69
- /**
70
- * The role names a compiled catalog carries. `compileOpsHubMetadata` emits
71
- * `bundles` as a list of `{ name, … }` entries; a keyed map is tolerated too.
72
- *
73
- * @example
74
- * ```typescript
75
- * catalogBundleNames({ bundles: [{ name: "platform_ops" }, { name: "tenant_admin" }] });
76
- * // => ["platform_ops", "tenant_admin"]
77
- * ```
78
- */
79
39
  export function catalogBundleNames(metadata) {
80
40
  const bundles = metadata.bundles;
81
41
  if (Array.isArray(bundles)) {
@@ -87,4 +47,3 @@ export function catalogBundleNames(metadata) {
87
47
  return Object.keys(bundles);
88
48
  return [];
89
49
  }
90
- //# sourceMappingURL=seed-hub-catalog.js.map