@mesh-tech/mesh-cli 0.1.0 → 0.12.0

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 (504) hide show
  1. package/assets/intent/agents-fence.md +10 -0
  2. package/assets/intent/intent-claude-gate.mjs +255 -0
  3. package/assets/log-shipper.mjs +94 -0
  4. package/bin/mesh.mjs +80 -0
  5. package/dist/bin/mesh.d.ts +7 -9
  6. package/dist/bin/mesh.d.ts.map +1 -1
  7. package/dist/bin/mesh.js +20826 -37
  8. package/dist/bin/mesh.js.map +7 -1
  9. package/dist/build-info.json +4 -0
  10. package/dist/src/commands/agent-api-client.d.ts +79 -0
  11. package/dist/src/commands/agent-api-client.d.ts.map +1 -0
  12. package/dist/src/commands/agent-api-client.js +170 -0
  13. package/dist/src/commands/agent-api-client.js.map +1 -0
  14. package/dist/src/commands/artifacts.d.ts +13 -0
  15. package/dist/src/commands/artifacts.d.ts.map +1 -0
  16. package/dist/src/commands/artifacts.js +140 -0
  17. package/dist/src/commands/artifacts.js.map +1 -0
  18. package/dist/src/commands/cluster.d.ts +45 -0
  19. package/dist/src/commands/cluster.d.ts.map +1 -0
  20. package/dist/src/commands/cluster.js +259 -0
  21. package/dist/src/commands/cluster.js.map +1 -0
  22. package/dist/src/commands/conversations.d.ts +61 -0
  23. package/dist/src/commands/conversations.d.ts.map +1 -0
  24. package/dist/src/commands/conversations.js +239 -0
  25. package/dist/src/commands/conversations.js.map +1 -0
  26. package/dist/src/commands/create-app.d.ts +26 -3
  27. package/dist/src/commands/create-app.d.ts.map +1 -1
  28. package/dist/src/commands/create-app.js +465 -107
  29. package/dist/src/commands/create-app.js.map +1 -1
  30. package/dist/src/commands/deploy.d.ts +19 -0
  31. package/dist/src/commands/deploy.d.ts.map +1 -1
  32. package/dist/src/commands/deploy.js +83 -142
  33. package/dist/src/commands/deploy.js.map +1 -1
  34. package/dist/src/commands/dev-doctor.d.ts +137 -0
  35. package/dist/src/commands/dev-doctor.d.ts.map +1 -0
  36. package/dist/src/commands/dev-doctor.js +671 -0
  37. package/dist/src/commands/dev-doctor.js.map +1 -0
  38. package/dist/src/commands/dev-launch.d.ts +59 -0
  39. package/dist/src/commands/dev-launch.d.ts.map +1 -0
  40. package/dist/src/commands/dev-launch.js +118 -0
  41. package/dist/src/commands/dev-launch.js.map +1 -0
  42. package/dist/src/commands/dev-token-server.d.ts +32 -0
  43. package/dist/src/commands/dev-token-server.d.ts.map +1 -0
  44. package/dist/src/commands/dev-token-server.js +68 -0
  45. package/dist/src/commands/dev-token-server.js.map +1 -0
  46. package/dist/src/commands/dev.d.ts +289 -2
  47. package/dist/src/commands/dev.d.ts.map +1 -1
  48. package/dist/src/commands/dev.js +2501 -574
  49. package/dist/src/commands/dev.js.map +1 -1
  50. package/dist/src/commands/docs.d.ts +3 -0
  51. package/dist/src/commands/docs.d.ts.map +1 -0
  52. package/dist/src/commands/docs.js +262 -0
  53. package/dist/src/commands/docs.js.map +1 -0
  54. package/dist/src/commands/hub/index.d.ts +99 -0
  55. package/dist/src/commands/hub/index.d.ts.map +1 -0
  56. package/dist/src/commands/hub/index.js +452 -0
  57. package/dist/src/commands/hub/index.js.map +1 -0
  58. package/dist/src/commands/init.d.ts +65 -0
  59. package/dist/src/commands/init.d.ts.map +1 -0
  60. package/dist/src/commands/init.js +370 -0
  61. package/dist/src/commands/init.js.map +1 -0
  62. package/dist/src/commands/install-shim.d.ts +21 -0
  63. package/dist/src/commands/install-shim.d.ts.map +1 -0
  64. package/dist/src/commands/install-shim.js +132 -0
  65. package/dist/src/commands/install-shim.js.map +1 -0
  66. package/dist/src/commands/local/auth-provision.d.ts +71 -0
  67. package/dist/src/commands/local/auth-provision.d.ts.map +1 -0
  68. package/dist/src/commands/local/auth-provision.js +286 -0
  69. package/dist/src/commands/local/auth-provision.js.map +1 -0
  70. package/dist/src/commands/local/dev-local.d.ts +97 -0
  71. package/dist/src/commands/local/dev-local.d.ts.map +1 -0
  72. package/dist/src/commands/local/dev-local.js +306 -0
  73. package/dist/src/commands/local/dev-local.js.map +1 -0
  74. package/dist/src/commands/local/docker-runner.d.ts +37 -0
  75. package/dist/src/commands/local/docker-runner.d.ts.map +1 -0
  76. package/dist/src/commands/local/docker-runner.js +104 -0
  77. package/dist/src/commands/local/docker-runner.js.map +1 -0
  78. package/dist/src/commands/local/helpers.d.ts +22 -0
  79. package/dist/src/commands/local/helpers.d.ts.map +1 -0
  80. package/dist/src/commands/local/helpers.js +46 -0
  81. package/dist/src/commands/local/helpers.js.map +1 -0
  82. package/dist/src/commands/local/hub-local.d.ts +51 -0
  83. package/dist/src/commands/local/hub-local.d.ts.map +1 -0
  84. package/dist/src/commands/local/hub-local.js +197 -0
  85. package/dist/src/commands/local/hub-local.js.map +1 -0
  86. package/dist/src/commands/local/index.d.ts +23 -0
  87. package/dist/src/commands/local/index.d.ts.map +1 -0
  88. package/dist/src/commands/local/index.js +386 -0
  89. package/dist/src/commands/local/index.js.map +1 -0
  90. package/dist/src/commands/local/mocks.d.ts +361 -0
  91. package/dist/src/commands/local/mocks.d.ts.map +1 -0
  92. package/dist/src/commands/local/mocks.js +756 -0
  93. package/dist/src/commands/local/mocks.js.map +1 -0
  94. package/dist/src/commands/local/seed-zitadel.d.ts +151 -0
  95. package/dist/src/commands/local/seed-zitadel.d.ts.map +1 -0
  96. package/dist/src/commands/local/seed-zitadel.js +408 -0
  97. package/dist/src/commands/local/seed-zitadel.js.map +1 -0
  98. package/dist/src/commands/local/seed.d.ts +106 -0
  99. package/dist/src/commands/local/seed.d.ts.map +1 -0
  100. package/dist/src/commands/local/seed.js +252 -0
  101. package/dist/src/commands/local/seed.js.map +1 -0
  102. package/dist/src/commands/local/stack.d.ts +173 -0
  103. package/dist/src/commands/local/stack.d.ts.map +1 -0
  104. package/dist/src/commands/local/stack.js +499 -0
  105. package/dist/src/commands/local/stack.js.map +1 -0
  106. package/dist/src/commands/login.d.ts +256 -12
  107. package/dist/src/commands/login.d.ts.map +1 -1
  108. package/dist/src/commands/login.js +978 -50
  109. package/dist/src/commands/login.js.map +1 -1
  110. package/dist/src/commands/peer-addressing.d.ts +51 -0
  111. package/dist/src/commands/peer-addressing.d.ts.map +1 -0
  112. package/dist/src/commands/peer-addressing.js +64 -0
  113. package/dist/src/commands/peer-addressing.js.map +1 -0
  114. package/dist/src/commands/port-ownership.d.ts +69 -0
  115. package/dist/src/commands/port-ownership.d.ts.map +1 -0
  116. package/dist/src/commands/port-ownership.js +161 -0
  117. package/dist/src/commands/port-ownership.js.map +1 -0
  118. package/dist/src/commands/registry-publish.d.ts +3 -0
  119. package/dist/src/commands/registry-publish.d.ts.map +1 -0
  120. package/dist/src/commands/registry-publish.js +161 -0
  121. package/dist/src/commands/registry-publish.js.map +1 -0
  122. package/dist/src/commands/registry.d.ts +146 -2
  123. package/dist/src/commands/registry.d.ts.map +1 -1
  124. package/dist/src/commands/registry.js +541 -85
  125. package/dist/src/commands/registry.js.map +1 -1
  126. package/dist/src/commands/secrets/index.d.ts.map +1 -1
  127. package/dist/src/commands/secrets/index.js +15 -1
  128. package/dist/src/commands/secrets/index.js.map +1 -1
  129. package/dist/src/commands/secrets/migrate-config.d.ts +24 -0
  130. package/dist/src/commands/secrets/migrate-config.d.ts.map +1 -0
  131. package/dist/src/commands/secrets/migrate-config.js +277 -0
  132. package/dist/src/commands/secrets/migrate-config.js.map +1 -0
  133. package/dist/src/commands/secrets/set.d.ts +4 -0
  134. package/dist/src/commands/secrets/set.d.ts.map +1 -1
  135. package/dist/src/commands/secrets/set.js +243 -64
  136. package/dist/src/commands/secrets/set.js.map +1 -1
  137. package/dist/src/commands/skills.d.ts +34 -0
  138. package/dist/src/commands/skills.d.ts.map +1 -0
  139. package/dist/src/commands/skills.js +207 -0
  140. package/dist/src/commands/skills.js.map +1 -0
  141. package/dist/src/commands/stack.d.ts.map +1 -1
  142. package/dist/src/commands/stack.js +361 -23
  143. package/dist/src/commands/stack.js.map +1 -1
  144. package/dist/src/commands/temporal.d.ts +15 -0
  145. package/dist/src/commands/temporal.d.ts.map +1 -0
  146. package/dist/src/commands/temporal.js +781 -0
  147. package/dist/src/commands/temporal.js.map +1 -0
  148. package/dist/src/commands/tenant.d.ts +56 -0
  149. package/dist/src/commands/tenant.d.ts.map +1 -0
  150. package/dist/src/commands/tenant.js +233 -0
  151. package/dist/src/commands/tenant.js.map +1 -0
  152. package/dist/src/commands/tunnel/index.d.ts +49 -3
  153. package/dist/src/commands/tunnel/index.d.ts.map +1 -1
  154. package/dist/src/commands/tunnel/index.js +331 -8
  155. package/dist/src/commands/tunnel/index.js.map +1 -1
  156. package/dist/src/commands/vcs/clone.d.ts +3 -0
  157. package/dist/src/commands/vcs/clone.d.ts.map +1 -0
  158. package/dist/src/commands/vcs/clone.js +20 -0
  159. package/dist/src/commands/vcs/clone.js.map +1 -0
  160. package/dist/src/commands/vcs/common.d.ts +21 -0
  161. package/dist/src/commands/vcs/common.d.ts.map +1 -0
  162. package/dist/src/commands/vcs/common.js +62 -0
  163. package/dist/src/commands/vcs/common.js.map +1 -0
  164. package/dist/src/commands/vcs/drafts.d.ts +13 -0
  165. package/dist/src/commands/vcs/drafts.d.ts.map +1 -0
  166. package/dist/src/commands/vcs/drafts.js +45 -0
  167. package/dist/src/commands/vcs/drafts.js.map +1 -0
  168. package/dist/src/commands/vcs/get.d.ts +8 -0
  169. package/dist/src/commands/vcs/get.d.ts.map +1 -0
  170. package/dist/src/commands/vcs/get.js +61 -0
  171. package/dist/src/commands/vcs/get.js.map +1 -0
  172. package/dist/src/commands/vcs/index.d.ts +3 -0
  173. package/dist/src/commands/vcs/index.d.ts.map +1 -0
  174. package/dist/src/commands/vcs/index.js +58 -0
  175. package/dist/src/commands/vcs/index.js.map +1 -0
  176. package/dist/src/commands/vcs/propose.d.ts +23 -0
  177. package/dist/src/commands/vcs/propose.d.ts.map +1 -0
  178. package/dist/src/commands/vcs/propose.js +94 -0
  179. package/dist/src/commands/vcs/propose.js.map +1 -0
  180. package/dist/src/commands/vcs/review.d.ts +15 -0
  181. package/dist/src/commands/vcs/review.d.ts.map +1 -0
  182. package/dist/src/commands/vcs/review.js +35 -0
  183. package/dist/src/commands/vcs/review.js.map +1 -0
  184. package/dist/src/commands/vcs-enrich.d.ts +15 -0
  185. package/dist/src/commands/vcs-enrich.d.ts.map +1 -0
  186. package/dist/src/commands/vcs-enrich.js +28 -0
  187. package/dist/src/commands/vcs-enrich.js.map +1 -0
  188. package/dist/src/commands/vpn/index.d.ts +24 -0
  189. package/dist/src/commands/vpn/index.d.ts.map +1 -0
  190. package/dist/src/commands/vpn/index.js +543 -0
  191. package/dist/src/commands/vpn/index.js.map +1 -0
  192. package/dist/src/commands/vpn/tunnel.d.ts +11 -0
  193. package/dist/src/commands/vpn/tunnel.d.ts.map +1 -0
  194. package/dist/src/commands/vpn/tunnel.js +188 -0
  195. package/dist/src/commands/vpn/tunnel.js.map +1 -0
  196. package/dist/src/commands/workflow.d.ts +24 -0
  197. package/dist/src/commands/workflow.d.ts.map +1 -0
  198. package/dist/src/commands/workflow.js +577 -0
  199. package/dist/src/commands/workflow.js.map +1 -0
  200. package/dist/src/docs/assemble.d.ts +217 -0
  201. package/dist/src/docs/assemble.d.ts.map +1 -0
  202. package/dist/src/docs/assemble.js +739 -0
  203. package/dist/src/docs/assemble.js.map +1 -0
  204. package/dist/src/docs/cli-reference.d.ts +93 -0
  205. package/dist/src/docs/cli-reference.d.ts.map +1 -0
  206. package/dist/src/docs/cli-reference.js +256 -0
  207. package/dist/src/docs/cli-reference.js.map +1 -0
  208. package/dist/src/docs/discover.d.ts +60 -0
  209. package/dist/src/docs/discover.d.ts.map +1 -0
  210. package/dist/src/docs/discover.js +233 -0
  211. package/dist/src/docs/discover.js.map +1 -0
  212. package/dist/src/docs/portal.d.ts +79 -0
  213. package/dist/src/docs/portal.d.ts.map +1 -0
  214. package/dist/src/docs/portal.js +242 -0
  215. package/dist/src/docs/portal.js.map +1 -0
  216. package/dist/src/docs/registry-docs.d.ts +43 -0
  217. package/dist/src/docs/registry-docs.d.ts.map +1 -0
  218. package/dist/src/docs/registry-docs.js +138 -0
  219. package/dist/src/docs/registry-docs.js.map +1 -0
  220. package/dist/src/docs/schema.d.ts +48 -0
  221. package/dist/src/docs/schema.d.ts.map +1 -0
  222. package/dist/src/docs/schema.js +96 -0
  223. package/dist/src/docs/schema.js.map +1 -0
  224. package/dist/src/docs/serve.d.ts +27 -0
  225. package/dist/src/docs/serve.d.ts.map +1 -0
  226. package/dist/src/docs/serve.js +102 -0
  227. package/dist/src/docs/serve.js.map +1 -0
  228. package/dist/src/docs/start.d.ts +80 -0
  229. package/dist/src/docs/start.d.ts.map +1 -0
  230. package/dist/src/docs/start.js +313 -0
  231. package/dist/src/docs/start.js.map +1 -0
  232. package/dist/src/eval/agent-eval.d.mts +14 -0
  233. package/dist/src/eval/agent-eval.d.mts.map +1 -0
  234. package/dist/src/eval/agent-eval.mjs +273 -0
  235. package/dist/src/eval/agent-eval.mjs.map +1 -0
  236. package/dist/src/index.js +624 -7
  237. package/dist/src/index.js.map +7 -1
  238. package/dist/src/program.d.ts +26 -0
  239. package/dist/src/program.d.ts.map +1 -0
  240. package/dist/src/program.js +76 -0
  241. package/dist/src/program.js.map +1 -0
  242. package/dist/src/utils/auth-preflight.d.ts +159 -0
  243. package/dist/src/utils/auth-preflight.d.ts.map +1 -0
  244. package/dist/src/utils/auth-preflight.js +298 -0
  245. package/dist/src/utils/auth-preflight.js.map +1 -0
  246. package/dist/src/utils/aws-auth.d.ts +181 -0
  247. package/dist/src/utils/aws-auth.d.ts.map +1 -0
  248. package/dist/src/utils/aws-auth.js +527 -0
  249. package/dist/src/utils/aws-auth.js.map +1 -0
  250. package/dist/src/utils/bastion.d.ts +1 -1
  251. package/dist/src/utils/bastion.d.ts.map +1 -1
  252. package/dist/src/utils/bastion.js +29 -8
  253. package/dist/src/utils/bastion.js.map +1 -1
  254. package/dist/src/utils/build-info.d.ts +33 -0
  255. package/dist/src/utils/build-info.d.ts.map +1 -0
  256. package/dist/src/utils/build-info.js +102 -0
  257. package/dist/src/utils/build-info.js.map +1 -0
  258. package/dist/src/utils/capture-history.d.ts +62 -0
  259. package/dist/src/utils/capture-history.d.ts.map +1 -0
  260. package/dist/src/utils/capture-history.js +94 -0
  261. package/dist/src/utils/capture-history.js.map +1 -0
  262. package/dist/src/utils/deploy-preflight.d.ts +52 -0
  263. package/dist/src/utils/deploy-preflight.d.ts.map +1 -0
  264. package/dist/src/utils/deploy-preflight.js +183 -0
  265. package/dist/src/utils/deploy-preflight.js.map +1 -0
  266. package/dist/src/utils/errors.d.ts +75 -0
  267. package/dist/src/utils/errors.d.ts.map +1 -0
  268. package/dist/src/utils/errors.js +106 -0
  269. package/dist/src/utils/errors.js.map +1 -0
  270. package/dist/src/utils/first-party-contexts.d.ts +40 -0
  271. package/dist/src/utils/first-party-contexts.d.ts.map +1 -0
  272. package/dist/src/utils/first-party-contexts.js +53 -0
  273. package/dist/src/utils/first-party-contexts.js.map +1 -0
  274. package/dist/src/utils/index.d.ts +2 -0
  275. package/dist/src/utils/index.d.ts.map +1 -1
  276. package/dist/src/utils/index.js +2 -0
  277. package/dist/src/utils/index.js.map +1 -1
  278. package/dist/src/utils/kubeconfig.d.ts +62 -0
  279. package/dist/src/utils/kubeconfig.d.ts.map +1 -0
  280. package/dist/src/utils/kubeconfig.js +118 -0
  281. package/dist/src/utils/kubeconfig.js.map +1 -0
  282. package/dist/src/utils/log.d.ts +27 -1
  283. package/dist/src/utils/log.d.ts.map +1 -1
  284. package/dist/src/utils/log.js +59 -5
  285. package/dist/src/utils/log.js.map +1 -1
  286. package/dist/src/utils/pid.d.ts +47 -0
  287. package/dist/src/utils/pid.d.ts.map +1 -0
  288. package/dist/src/utils/pid.js +83 -0
  289. package/dist/src/utils/pid.js.map +1 -0
  290. package/dist/src/utils/pulumi-run.d.ts +23 -0
  291. package/dist/src/utils/pulumi-run.d.ts.map +1 -0
  292. package/dist/src/utils/pulumi-run.js +112 -0
  293. package/dist/src/utils/pulumi-run.js.map +1 -0
  294. package/dist/src/utils/pulumi.d.ts +15 -0
  295. package/dist/src/utils/pulumi.d.ts.map +1 -1
  296. package/dist/src/utils/pulumi.js +35 -0
  297. package/dist/src/utils/pulumi.js.map +1 -1
  298. package/dist/src/utils/reachability.d.ts +29 -0
  299. package/dist/src/utils/reachability.d.ts.map +1 -0
  300. package/dist/src/utils/reachability.js +81 -0
  301. package/dist/src/utils/reachability.js.map +1 -0
  302. package/dist/src/utils/recover-conversation.d.ts +154 -0
  303. package/dist/src/utils/recover-conversation.d.ts.map +1 -0
  304. package/dist/src/utils/recover-conversation.js +314 -0
  305. package/dist/src/utils/recover-conversation.js.map +1 -0
  306. package/dist/src/utils/registry-broker.d.ts +148 -0
  307. package/dist/src/utils/registry-broker.d.ts.map +1 -0
  308. package/dist/src/utils/registry-broker.js +180 -0
  309. package/dist/src/utils/registry-broker.js.map +1 -0
  310. package/dist/src/utils/socks-forward.d.ts +40 -0
  311. package/dist/src/utils/socks-forward.d.ts.map +1 -0
  312. package/dist/src/utils/socks-forward.js +97 -0
  313. package/dist/src/utils/socks-forward.js.map +1 -0
  314. package/dist/src/utils/stack-flag.d.ts +23 -0
  315. package/dist/src/utils/stack-flag.d.ts.map +1 -0
  316. package/dist/src/utils/stack-flag.js +41 -0
  317. package/dist/src/utils/stack-flag.js.map +1 -0
  318. package/dist/src/utils/tailscale-targets.d.ts +52 -0
  319. package/dist/src/utils/tailscale-targets.d.ts.map +1 -0
  320. package/dist/src/utils/tailscale-targets.js +93 -0
  321. package/dist/src/utils/tailscale-targets.js.map +1 -0
  322. package/dist/src/utils/tailscale.d.ts +277 -0
  323. package/dist/src/utils/tailscale.d.ts.map +1 -0
  324. package/dist/src/utils/tailscale.js +1007 -0
  325. package/dist/src/utils/tailscale.js.map +1 -0
  326. package/dist/src/utils/temporal-auth.d.ts +43 -0
  327. package/dist/src/utils/temporal-auth.d.ts.map +1 -0
  328. package/dist/src/utils/temporal-auth.js +176 -0
  329. package/dist/src/utils/temporal-auth.js.map +1 -0
  330. package/dist/src/utils/temporal-codec.d.ts +101 -0
  331. package/dist/src/utils/temporal-codec.d.ts.map +1 -0
  332. package/dist/src/utils/temporal-codec.js +319 -0
  333. package/dist/src/utils/temporal-codec.js.map +1 -0
  334. package/dist/src/utils/tunnel-ownership.d.ts +130 -0
  335. package/dist/src/utils/tunnel-ownership.d.ts.map +1 -0
  336. package/dist/src/utils/tunnel-ownership.js +274 -0
  337. package/dist/src/utils/tunnel-ownership.js.map +1 -0
  338. package/dist/src/utils/vpn-join.d.ts +32 -0
  339. package/dist/src/utils/vpn-join.d.ts.map +1 -0
  340. package/dist/src/utils/vpn-join.js +62 -0
  341. package/dist/src/utils/vpn-join.js.map +1 -0
  342. package/dist/src/utils/vpn.d.ts +62 -0
  343. package/dist/src/utils/vpn.d.ts.map +1 -0
  344. package/dist/src/utils/vpn.js +183 -0
  345. package/dist/src/utils/vpn.js.map +1 -0
  346. package/dist/src/utils/workflow-fingerprint.d.ts +49 -0
  347. package/dist/src/utils/workflow-fingerprint.d.ts.map +1 -0
  348. package/dist/src/utils/workflow-fingerprint.js +135 -0
  349. package/dist/src/utils/workflow-fingerprint.js.map +1 -0
  350. package/dist/src/utils/worktree-identity.d.ts +86 -0
  351. package/dist/src/utils/worktree-identity.d.ts.map +1 -0
  352. package/dist/src/utils/worktree-identity.js +164 -0
  353. package/dist/src/utils/worktree-identity.js.map +1 -0
  354. package/fragments/agents/AGENTS.md.hbs +92 -0
  355. package/fragments/agents/CLAUDE.md.hbs +8 -0
  356. package/fragments/base/Pulumi.dev.yaml.hbs +10 -0
  357. package/fragments/base/Pulumi.yaml.hbs +9 -0
  358. package/fragments/base/index.ts.hbs +107 -0
  359. package/fragments/base/package.json.hbs +22 -0
  360. package/{templates/api-web-db/api → fragments/base}/tsconfig.json +3 -4
  361. package/fragments/bucket/api/src/storage.ts.hbs +81 -0
  362. package/fragments/database/api/src/db.ts.hbs +23 -0
  363. package/fragments/database/prisma/schema.prisma.hbs +18 -0
  364. package/{templates/api-web-db → fragments/service}/api/.dockerignore +2 -0
  365. package/fragments/service/api/package.json.hbs +40 -0
  366. package/fragments/service/api/src/index.ts.hbs +58 -0
  367. package/{templates/api-web-db → fragments/service/api}/tsconfig.json +5 -3
  368. package/fragments/temporal/worker/.dockerignore +4 -0
  369. package/fragments/temporal/worker/Dockerfile +15 -0
  370. package/{templates/temporal-api-worker → fragments/temporal}/worker/package.json.hbs +3 -2
  371. package/fragments/temporal/worker/src/activities.ts.hbs +14 -0
  372. package/fragments/temporal/worker/src/worker.ts.hbs +27 -0
  373. package/fragments/temporal/worker/src/workflows.ts.hbs +24 -0
  374. package/fragments/temporal/worker/tsconfig.json +13 -0
  375. package/package.json +35 -21
  376. package/skills/core/SKILL.md +365 -0
  377. package/skills/pull-remote-agent-context/SKILL.md +194 -0
  378. package/stack/docker-compose.hub.yml +134 -0
  379. package/stack/docker-compose.yml +447 -0
  380. package/stack/hub/Dockerfile.api +18 -0
  381. package/stack/hub/Dockerfile.auth +10 -0
  382. package/stack/hub/Dockerfile.ui +10 -0
  383. package/stack/init/01-databases.sql +12 -0
  384. package/stack/observability/blackbox.yml +20 -0
  385. package/stack/observability/otel-collector.yaml +73 -0
  386. package/stack/observability/prometheus.yml +36 -0
  387. package/stack/observability/tempo.yaml +25 -0
  388. package/stack/temporal/local.yaml +44 -0
  389. package/templates/api-auth/AGENTS.md.hbs +16 -0
  390. package/templates/api-auth/Pulumi.dev.yaml.hbs +8 -0
  391. package/templates/api-auth/Pulumi.yaml.hbs +8 -0
  392. package/templates/api-auth/README.md.hbs +67 -0
  393. package/templates/api-auth/api/package.json.hbs +28 -0
  394. package/templates/api-auth/api/src/index.ts.hbs +96 -0
  395. package/templates/api-auth/api/src/schema.ts.hbs +35 -0
  396. package/templates/api-auth/api/src/seed-authz.ts.hbs +48 -0
  397. package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +89 -0
  398. package/templates/api-auth/index.ts.hbs +65 -0
  399. package/templates/api-auth/package.json.hbs +20 -0
  400. package/templates/api-auth/skills/develop/SKILL.md.hbs +32 -0
  401. package/templates/api-role-gating/AGENTS.md.hbs +20 -0
  402. package/templates/api-role-gating/Pulumi.dev.yaml.hbs +8 -0
  403. package/templates/api-role-gating/Pulumi.yaml.hbs +8 -0
  404. package/templates/api-role-gating/README.md.hbs +64 -0
  405. package/templates/api-role-gating/api/Dockerfile +17 -0
  406. package/templates/api-role-gating/api/package.json.hbs +28 -0
  407. package/templates/api-role-gating/api/src/authn.ts.hbs +29 -0
  408. package/templates/api-role-gating/api/src/authz.ts.hbs +12 -0
  409. package/templates/api-role-gating/api/src/main.ts.hbs +58 -0
  410. package/templates/api-role-gating/api/src/schema.ts.hbs +22 -0
  411. package/templates/api-role-gating/api/tsconfig.json +13 -0
  412. package/templates/api-role-gating/index.ts.hbs +107 -0
  413. package/templates/api-role-gating/package.json.hbs +21 -0
  414. package/templates/api-role-gating/skills/develop/SKILL.md.hbs +60 -0
  415. package/templates/api-role-gating/tsconfig.json +10 -0
  416. package/templates/apps-repo/README.md.hbs +24 -0
  417. package/templates/apps-repo/gitignore +41 -0
  418. package/templates/apps-repo/npmrc.hbs +7 -0
  419. package/templates/apps-repo/package.json.hbs +15 -0
  420. package/templates/apps-repo/pnpm-workspace.yaml +3 -0
  421. package/templates/apps-repo/tsconfig.json +18 -0
  422. package/templates/external-service/AGENTS.md.hbs +20 -0
  423. package/templates/external-service/Pulumi.dev.yaml.hbs +8 -0
  424. package/templates/external-service/Pulumi.yaml.hbs +8 -0
  425. package/templates/external-service/README.md.hbs +56 -0
  426. package/templates/external-service/api/Dockerfile +15 -0
  427. package/templates/external-service/api/package.json.hbs +25 -0
  428. package/templates/external-service/api/src/index.ts.hbs +81 -0
  429. package/templates/external-service/index.ts.hbs +82 -0
  430. package/templates/external-service/mocks/vendorpay/package.json.hbs +9 -0
  431. package/templates/external-service/mocks/vendorpay/server.mjs.hbs +61 -0
  432. package/templates/external-service/package.json.hbs +34 -0
  433. package/templates/external-service/skills/develop/SKILL.md.hbs +55 -0
  434. package/templates/external-service/tsconfig.json +10 -0
  435. package/templates/platform-repo/AGENTS.md.hbs +18 -0
  436. package/templates/platform-repo/README.md.hbs +38 -0
  437. package/templates/platform-repo/core/Pulumi.yaml.hbs +12 -0
  438. package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +57 -0
  439. package/templates/platform-repo/core/index.ts +62 -0
  440. package/templates/platform-repo/core/package.json.hbs +22 -0
  441. package/templates/platform-repo/core/tsconfig.json +8 -0
  442. package/templates/platform-repo/package.json.hbs +15 -0
  443. package/templates/platform-repo/platform/Pulumi.yaml.hbs +12 -0
  444. package/templates/platform-repo/platform/Pulumi.{{tenant}}-{{env}}.yaml.hbs +59 -0
  445. package/templates/platform-repo/platform/index.ts +95 -0
  446. package/templates/platform-repo/platform/package.json.hbs +26 -0
  447. package/templates/platform-repo/platform/tsconfig.json +8 -0
  448. package/templates/platform-repo/pnpm-workspace.yaml +3 -0
  449. package/templates/workflow/AGENTS.md.hbs +15 -0
  450. package/templates/workflow/Pulumi.dev.yaml.hbs +8 -0
  451. package/templates/workflow/Pulumi.yaml.hbs +8 -0
  452. package/templates/workflow/README.md.hbs +45 -0
  453. package/templates/workflow/api/.dockerignore +4 -0
  454. package/templates/workflow/api/Dockerfile +15 -0
  455. package/templates/{temporal-api-worker → workflow}/api/package.json.hbs +8 -6
  456. package/templates/workflow/api/src/index.ts.hbs +130 -0
  457. package/templates/workflow/api/tsconfig.json +14 -0
  458. package/templates/workflow/index.ts.hbs +67 -0
  459. package/templates/workflow/package.json.hbs +20 -0
  460. package/templates/workflow/skills/develop/SKILL.md.hbs +32 -0
  461. package/templates/workflow/tsconfig.json +10 -0
  462. package/templates/workflow/worker/.dockerignore +4 -0
  463. package/templates/workflow/worker/Dockerfile +13 -0
  464. package/templates/workflow/worker/package.json.hbs +25 -0
  465. package/templates/workflow/worker/src/worker.ts.hbs +24 -0
  466. package/templates/workflow/worker/tsconfig.json +14 -0
  467. package/dist/src/commands/devbox.d.ts +0 -22
  468. package/dist/src/commands/devbox.d.ts.map +0 -1
  469. package/dist/src/commands/devbox.js +0 -463
  470. package/dist/src/commands/devbox.js.map +0 -1
  471. package/templates/api-web-db/api/Dockerfile +0 -16
  472. package/templates/api-web-db/api/package.json.hbs +0 -21
  473. package/templates/api-web-db/api/src/index.ts.hbs +0 -123
  474. package/templates/api-web-db/package.json.hbs +0 -27
  475. package/templates/api-web-db/sst.config.ts.hbs +0 -151
  476. package/templates/api-web-db/web/.dockerignore +0 -3
  477. package/templates/api-web-db/web/Dockerfile +0 -17
  478. package/templates/api-web-db/web/app/lib/db.server.ts +0 -36
  479. package/templates/api-web-db/web/app/root.tsx +0 -29
  480. package/templates/api-web-db/web/app/routes/home.tsx.hbs +0 -114
  481. package/templates/api-web-db/web/app/routes.ts +0 -3
  482. package/templates/api-web-db/web/package.json.hbs +0 -30
  483. package/templates/api-web-db/web/prisma/schema.prisma +0 -25
  484. package/templates/api-web-db/web/prisma.config.ts +0 -18
  485. package/templates/api-web-db/web/react-router.config.ts +0 -5
  486. package/templates/api-web-db/web/tsconfig.json +0 -19
  487. package/templates/api-web-db/web/vite.config.ts +0 -9
  488. package/templates/temporal-api-worker/README.md.hbs +0 -133
  489. package/templates/temporal-api-worker/api/src/index.ts.hbs +0 -145
  490. package/templates/temporal-api-worker/package.json.hbs +0 -29
  491. package/templates/temporal-api-worker/sst.config.ts.hbs +0 -161
  492. package/templates/temporal-api-worker/worker/Dockerfile +0 -11
  493. package/templates/temporal-api-worker/worker/src/bundle-workflows.ts +0 -38
  494. package/templates/temporal-api-worker/worker/src/worker.ts.hbs +0 -93
  495. /package/templates/{temporal-api-worker → api-auth}/api/.dockerignore +0 -0
  496. /package/templates/{temporal-api-worker → api-auth}/api/Dockerfile +0 -0
  497. /package/templates/{temporal-api-worker → api-auth}/api/tsconfig.json +0 -0
  498. /package/templates/{temporal-api-worker → api-auth}/tsconfig.json +0 -0
  499. /package/templates/{temporal-api-worker/worker → api-role-gating/api}/.dockerignore +0 -0
  500. /package/templates/{temporal-api-worker/worker → external-service/api}/tsconfig.json +0 -0
  501. /package/templates/{temporal-api-worker → workflow}/api/src/encryption-codec.ts +0 -0
  502. /package/templates/{temporal-api-worker → workflow}/worker/src/activities.ts.hbs +0 -0
  503. /package/templates/{temporal-api-worker → workflow}/worker/src/encryption-codec.ts +0 -0
  504. /package/templates/{temporal-api-worker → workflow}/worker/src/workflows.ts.hbs +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-doctor.js","sourceRoot":"","sources":["../../../src/commands/dev-doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAkB,MAAM,YAAY,CAAC;AA6CnF,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,OAAsB;IACpD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC9D,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GA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AAC,CAAC,CAAC;IAC7D,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,aAAa,MAAM,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Helpers for launching `mesh dev` services via per-session env files.
3
+ *
4
+ * Background: `mesh dev` used to inline every env var into a single giant
5
+ * `env K1=V1 K2=V2 … <command>` string passed to `tmux send-keys`. With large
6
+ * values (system prompts, encoding keys, OAuth creds) tmux intermittently
7
+ * truncated the string — the service never started — and `mesh dev restart`
8
+ * re-derived the env from scratch, drifting from what the service was
9
+ * originally launched with (e.g. a different TEMPORAL_ENCODING_KEY).
10
+ *
11
+ * Instead, the full env is written once at launch to a 0600 file under the
12
+ * session state dir, and the send-keys command is just:
13
+ *
14
+ * cd '<dir>' && source '<envfile>' && <command>
15
+ *
16
+ * Restart sources the SAME file, guaranteeing a byte-identical environment.
17
+ */
18
+ /** Env files contain secrets — owner read/write only. */
19
+ export declare const ENV_FILE_MODE = 384;
20
+ /**
21
+ * Single-quote a value for POSIX shells (bash/zsh), escaping embedded
22
+ * single quotes via the standard `'\''` dance. Safe for newlines, spaces,
23
+ * `$`, backticks, etc.
24
+ */
25
+ export declare function quoteShellValue(value: string): string;
26
+ /**
27
+ * Render a sourceable env file: one `export K='V'` per line.
28
+ * Throws on env var names that aren't valid shell identifiers.
29
+ */
30
+ export declare function renderEnvFile(env: Record<string, string>): string;
31
+ /** Filesystem-safe env file name for a service. */
32
+ export declare function envFileName(serviceName: string): string;
33
+ /**
34
+ * Write the env file (creating parent dirs) with mode 0600.
35
+ * chmod is applied explicitly so a pre-existing file is tightened too.
36
+ */
37
+ export declare function writeEnvFile(filePath: string, env: Record<string, string>): void;
38
+ /**
39
+ * Build the short, untruncatable command sent to tmux:
40
+ * cd '<dir>' && source '<envfile>' && <command>
41
+ *
42
+ * `command` is the service's dev command (already shell syntax) and is
43
+ * passed through verbatim.
44
+ *
45
+ * With `logShipper` (mesh dev --local: the path of assets/log-shipper.mjs),
46
+ * the service's combined stdout/stderr is piped through the shipper: raw
47
+ * bytes go to the pane (its stderr), ANSI-stripped lines ship to the local
48
+ * platform's OTel collector via OTLP — the same ingestion path instrumented
49
+ * apps use, carrying the OTEL_* resource attributes from the env file. Logs
50
+ * never cross the macOS Docker file mount (whose stale attribute caching
51
+ * hides appends from in-container tailers).
52
+ */
53
+ export declare function buildLaunchCommand(envFilePath: string, dir: string, command: string, logShipper?: string): string;
54
+ /**
55
+ * Poll until a TCP port accepts connections, or the timeout elapses.
56
+ * Returns true when the port accepted, false on timeout.
57
+ */
58
+ export declare function waitForPort(host: string, port: number, timeoutMs: number, intervalMs?: number): Promise<boolean>;
59
+ //# sourceMappingURL=dev-launch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-launch.d.ts","sourceRoot":"","sources":["../../../src/commands/dev-launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,yDAAyD;AACzD,eAAO,MAAM,aAAa,MAAQ,CAAC;AAKnC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAajE;AAED,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAIhF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAMR;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,SAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAWlB"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Helpers for launching `mesh dev` services via per-session env files.
3
+ *
4
+ * Background: `mesh dev` used to inline every env var into a single giant
5
+ * `env K1=V1 K2=V2 … <command>` string passed to `tmux send-keys`. With large
6
+ * values (system prompts, encoding keys, OAuth creds) tmux intermittently
7
+ * truncated the string — the service never started — and `mesh dev restart`
8
+ * re-derived the env from scratch, drifting from what the service was
9
+ * originally launched with (e.g. a different TEMPORAL_ENCODING_KEY).
10
+ *
11
+ * Instead, the full env is written once at launch to a 0600 file under the
12
+ * session state dir, and the send-keys command is just:
13
+ *
14
+ * cd '<dir>' && source '<envfile>' && <command>
15
+ *
16
+ * Restart sources the SAME file, guaranteeing a byte-identical environment.
17
+ */
18
+ import * as fs from 'fs';
19
+ import * as net from 'net';
20
+ import * as path from 'path';
21
+ /** Env files contain secrets — owner read/write only. */
22
+ export const ENV_FILE_MODE = 0o600;
23
+ /** Valid POSIX env var name. Anything else is rejected to avoid shell injection. */
24
+ const ENV_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
25
+ /**
26
+ * Single-quote a value for POSIX shells (bash/zsh), escaping embedded
27
+ * single quotes via the standard `'\''` dance. Safe for newlines, spaces,
28
+ * `$`, backticks, etc.
29
+ */
30
+ export function quoteShellValue(value) {
31
+ return `'${value.replace(/'/g, "'\\''")}'`;
32
+ }
33
+ /**
34
+ * Render a sourceable env file: one `export K='V'` per line.
35
+ * Throws on env var names that aren't valid shell identifiers.
36
+ */
37
+ export function renderEnvFile(env) {
38
+ const lines = [
39
+ '# Auto-generated by mesh dev — do not edit.',
40
+ '# Sourced by service launch/restart commands; this file IS the',
41
+ "# session's env contract for the service (restart fidelity).",
42
+ ];
43
+ for (const [key, value] of Object.entries(env)) {
44
+ if (!ENV_KEY_RE.test(key)) {
45
+ throw new Error(`Invalid env var name for env file: ${JSON.stringify(key)}`);
46
+ }
47
+ lines.push(`export ${key}=${quoteShellValue(value)}`);
48
+ }
49
+ return lines.join('\n') + '\n';
50
+ }
51
+ /** Filesystem-safe env file name for a service. */
52
+ export function envFileName(serviceName) {
53
+ return `${serviceName.replace(/[^A-Za-z0-9._-]/g, '-')}.env.sh`;
54
+ }
55
+ /**
56
+ * Write the env file (creating parent dirs) with mode 0600.
57
+ * chmod is applied explicitly so a pre-existing file is tightened too.
58
+ */
59
+ export function writeEnvFile(filePath, env) {
60
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
61
+ fs.writeFileSync(filePath, renderEnvFile(env), { mode: ENV_FILE_MODE });
62
+ fs.chmodSync(filePath, ENV_FILE_MODE);
63
+ }
64
+ /**
65
+ * Build the short, untruncatable command sent to tmux:
66
+ * cd '<dir>' && source '<envfile>' && <command>
67
+ *
68
+ * `command` is the service's dev command (already shell syntax) and is
69
+ * passed through verbatim.
70
+ *
71
+ * With `logShipper` (mesh dev --local: the path of assets/log-shipper.mjs),
72
+ * the service's combined stdout/stderr is piped through the shipper: raw
73
+ * bytes go to the pane (its stderr), ANSI-stripped lines ship to the local
74
+ * platform's OTel collector via OTLP — the same ingestion path instrumented
75
+ * apps use, carrying the OTEL_* resource attributes from the env file. Logs
76
+ * never cross the macOS Docker file mount (whose stale attribute caching
77
+ * hides appends from in-container tailers).
78
+ */
79
+ export function buildLaunchCommand(envFilePath, dir, command, logShipper) {
80
+ const base = `cd ${quoteShellValue(dir)} && source ${quoteShellValue(envFilePath)} && `;
81
+ if (!logShipper)
82
+ return `${base}${command}`;
83
+ // NODE_OPTIONS= : the shipper must not inherit the service's OTel
84
+ // auto-instrumentation — its own OTLP POSTs would show up as traces.
85
+ return `${base}{ ${command}; } 2>&1 | NODE_OPTIONS= node ${quoteShellValue(logShipper)}`;
86
+ }
87
+ /**
88
+ * Poll until a TCP port accepts connections, or the timeout elapses.
89
+ * Returns true when the port accepted, false on timeout.
90
+ */
91
+ export async function waitForPort(host, port, timeoutMs, intervalMs = 500) {
92
+ const deadline = Date.now() + timeoutMs;
93
+ // Always attempt at least once, even with a zero/negative timeout.
94
+ for (;;) {
95
+ const remaining = deadline - Date.now();
96
+ const attemptTimeout = Math.max(250, Math.min(1000, remaining));
97
+ if (await tryConnect(host, port, attemptTimeout))
98
+ return true;
99
+ if (Date.now() + intervalMs >= deadline)
100
+ return false;
101
+ await new Promise((resolve) => setTimeout(resolve, intervalMs));
102
+ }
103
+ }
104
+ function tryConnect(host, port, timeoutMs) {
105
+ return new Promise((resolve) => {
106
+ const socket = net.connect({ host, port });
107
+ const done = (ok) => {
108
+ socket.removeAllListeners();
109
+ socket.destroy();
110
+ resolve(ok);
111
+ };
112
+ socket.setTimeout(timeoutMs);
113
+ socket.once('connect', () => done(true));
114
+ socket.once('timeout', () => done(false));
115
+ socket.once('error', () => done(false));
116
+ });
117
+ }
118
+ //# sourceMappingURL=dev-launch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-launch.js","sourceRoot":"","sources":["../../../src/commands/dev-launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,yDAAyD;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;AAEnC,oFAAoF;AACpF,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAE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M,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,CAAC,EAAW,EAAE,EAAE;YAC3B,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC5B,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,EAAE,CAAC,CAAC;QACd,CAAC,CAAC;QACF,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * `mesh dev __token-server <port> <context>` — the producer side of the
3
+ * self-refreshing dev-user token seam (MESH-2039).
4
+ *
5
+ * `mesh dev` launches this in its own tmux window. On each GET it mints a
6
+ * currently-valid dev-user token (via the existing `getValidToken` refresh
7
+ * path, which silently re-mints from the refresh token and rewrites the shared
8
+ * cache) and returns it on loopback. Consumers poll it (agent-app-kit's
9
+ * dev-user-token provider) so local apps survive past the ~1h Zitadel horizon
10
+ * without a `mesh dev` restart. Bound to 127.0.0.1 only; dev-only.
11
+ */
12
+ export interface TokenServerDeps {
13
+ getValidToken: (context: string) => Promise<string | null>;
14
+ readCredentials: (context: string) => {
15
+ accessToken: string;
16
+ expiresAt: string;
17
+ email?: string;
18
+ } | null;
19
+ decodeJwtPayload: (jwt: string) => Record<string, unknown>;
20
+ }
21
+ /**
22
+ * Pure request handler. 200 with the fresh token pair on success; 503 when the
23
+ * token can't be minted (refresh token lapsed — the MESH-2035 boundary), which
24
+ * consumers treat as "keep last good / fall back to the static env snapshot".
25
+ */
26
+ export declare function handleTokenRequest(context: string, deps: TokenServerDeps): Promise<{
27
+ status: number;
28
+ body: unknown;
29
+ }>;
30
+ /** Start the loopback token server. Never resolves (runs until the window dies). */
31
+ export declare function startTokenServer(port: number, context: string): Promise<void>;
32
+ //# sourceMappingURL=dev-token-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-token-server.d.ts","sourceRoot":"","sources":["../../../src/commands/dev-token-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3D,eAAe,EAAE,CACf,OAAO,EAAE,MAAM,KACZ;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACvE,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAe5C;AASD,oFAAoF;AACpF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBnF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * `mesh dev __token-server <port> <context>` — the producer side of the
3
+ * self-refreshing dev-user token seam (MESH-2039).
4
+ *
5
+ * `mesh dev` launches this in its own tmux window. On each GET it mints a
6
+ * currently-valid dev-user token (via the existing `getValidToken` refresh
7
+ * path, which silently re-mints from the refresh token and rewrites the shared
8
+ * cache) and returns it on loopback. Consumers poll it (agent-app-kit's
9
+ * dev-user-token provider) so local apps survive past the ~1h Zitadel horizon
10
+ * without a `mesh dev` restart. Bound to 127.0.0.1 only; dev-only.
11
+ */
12
+ import * as http from "node:http";
13
+ import { getValidToken, readCredentials, decodeJwtPayload } from "./login.js";
14
+ import { logInfo, logWarn } from "../utils/log.js";
15
+ /**
16
+ * Pure request handler. 200 with the fresh token pair on success; 503 when the
17
+ * token can't be minted (refresh token lapsed — the MESH-2035 boundary), which
18
+ * consumers treat as "keep last good / fall back to the static env snapshot".
19
+ */
20
+ export async function handleTokenRequest(context, deps) {
21
+ const idToken = await deps.getValidToken(context);
22
+ const creds = idToken ? deps.readCredentials(context) : null;
23
+ if (!idToken || !creds)
24
+ return { status: 503, body: { error: "token-unavailable" } };
25
+ const payload = deps.decodeJwtPayload(idToken);
26
+ return {
27
+ status: 200,
28
+ body: {
29
+ idToken,
30
+ accessToken: creds.accessToken,
31
+ sub: payload.sub ?? undefined,
32
+ email: creds.email ?? payload.email ?? undefined,
33
+ expiresAt: creds.expiresAt,
34
+ },
35
+ };
36
+ }
37
+ /**
38
+ * Refresh the served token this far before it actually expires, so a consumer
39
+ * polling on its own cadence (~60s) always fetches a token that outlives its
40
+ * next poll — closing the ~once-per-hour self-healing 401 window.
41
+ */
42
+ const REFRESH_MARGIN_MS = 120_000;
43
+ /** Start the loopback token server. Never resolves (runs until the window dies). */
44
+ export async function startTokenServer(port, context) {
45
+ const deps = {
46
+ getValidToken: (c) => getValidToken(c, { marginMs: REFRESH_MARGIN_MS }),
47
+ readCredentials,
48
+ decodeJwtPayload,
49
+ };
50
+ const server = http.createServer((_req, res) => {
51
+ void (async () => {
52
+ try {
53
+ const { status, body } = await handleTokenRequest(context, deps);
54
+ res.writeHead(status, { "content-type": "application/json" });
55
+ res.end(JSON.stringify(body));
56
+ }
57
+ catch (e) {
58
+ res.writeHead(500, { "content-type": "application/json" });
59
+ res.end(JSON.stringify({ error: e.message }));
60
+ }
61
+ })();
62
+ });
63
+ server.on("error", (e) => logWarn(`token-server error: ${e.message}`));
64
+ await new Promise((resolve) => server.listen(port, "127.0.0.1", resolve));
65
+ logInfo(`dev-user token-server on http://127.0.0.1:${port} (context ${context})`);
66
+ await new Promise(() => { }); // run forever
67
+ }
68
+ //# sourceMappingURL=dev-token-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-token-server.js","sourceRoot":"","sources":["../../../src/commands/dev-token-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAUnD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAe,EACf,IAAqB;IAErB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,CAAC;IACrF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO;QACL,MAAM,EAAE,GAAG;QACX,IAAI,EAAE;YACJ,OAAO;YACP,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,GAAG,EAAG,OAAO,CAAC,GAAc,IAAI,SAAS;YACzC,KAAK,EAAE,KAAK,CAAC,KAAK,IAAK,OAAO,CAAC,K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CAAC;IACvE,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAChF,OAAO,CAAC,6CAA6C,IAAI,aAAa,OAAO,GAAG,CAAC,CAAC;IAClF,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * mesh dev — Pulumi-output-driven local development orchestrator
3
3
  *
4
- * Reads `pulumi stack output dev --json` to discover services and tunnels,
4
+ * Reads `pulumi stack output dev --json` to discover services and VPC endpoints,
5
5
  * then launches each service's dev command in a tmux window.
6
+ * Requires VPN connection for direct access to VPC resources.
6
7
  *
7
8
  * Usage:
8
9
  * mesh dev Start all services, attach tmux
@@ -12,6 +13,292 @@
12
13
  * mesh dev logs <service> Tail a service's output
13
14
  * mesh dev restart <svc> Restart a single service
14
15
  */
15
- import { Command } from "commander";
16
+ import { Command } from 'commander';
17
+ import { type ResolvedAwsCreds } from '../utils/aws-auth.js';
18
+ import { type ComposeExternalRef } from './local/mocks.js';
19
+ interface DevEnvVar {
20
+ value: string;
21
+ /** If set, env var value uses the named tunnel's host:port */
22
+ tunnel?: string;
23
+ }
24
+ interface DevService {
25
+ src: string;
26
+ port: number;
27
+ command: string[];
28
+ env?: Record<string, DevEnvVar>;
29
+ }
30
+ /** VPC-accessible endpoint for VPN direct access */
31
+ interface DevTunnel {
32
+ /** VPC hostname (RDS endpoint, NLB hostname, etc.) */
33
+ host: string;
34
+ /** Port number */
35
+ port: number;
36
+ }
37
+ interface DevSecret {
38
+ /** Secrets Manager secret name */
39
+ secretName: string;
40
+ /** Maps secret JSON keys → env var names to inject into services */
41
+ envMapping: Record<string, string>;
42
+ }
43
+ export interface DevOutput {
44
+ /**
45
+ * Platform context. `tenant` is the APP tenant (Temporal namespace auth +
46
+ * encoding key). `name` is the HUB platform name (bastion + headscale DNS,
47
+ * which live in the hub for shared tenants); falls back to "mesh".
48
+ */
49
+ platform?: {
50
+ tenant: string;
51
+ name?: string;
52
+ env: string;
53
+ };
54
+ /** App name (e.g., "hub") */
55
+ app?: string;
56
+ /** Pulumi stack name (e.g., "dev", "feature-xyz") */
57
+ stack?: string;
58
+ services: Record<string, DevService>;
59
+ tunnels: Record<string, DevTunnel>;
60
+ /** Secrets to resolve from Secrets Manager at dev startup */
61
+ secrets?: Record<string, DevSecret>;
62
+ }
63
+ export interface SessionState {
64
+ appRoot: string;
65
+ stack: string;
66
+ devOutput: DevOutput;
67
+ startedAt: string;
68
+ /** 'tmux' (default) or 'docker' (mesh dev --runner docker, local mode) */
69
+ runner?: 'tmux' | 'docker';
70
+ /** Compose-mode external services (mesh dev --externals) this session brought
71
+ * up — torn down (volumes kept) on `mesh dev --kill`. */
72
+ composeExternals?: ComposeExternalRef[];
73
+ /** Prometheus file_sd probe targets this session's externals registered —
74
+ * removed on `mesh dev --kill` so the Hub stops showing uptime for a
75
+ * session that isn't running. Recorded as paths so `--kill --session`
76
+ * works without resolving an app root. */
77
+ externalProbeFiles?: string[];
78
+ /**
79
+ * Content fingerprint of the workflow source (agent-sdk / interpreter /
80
+ * agent-contracts) at launch. Compared on relaunch/restart to warn before the
81
+ * worker replays in-flight conversations against changed workflow code
82
+ * (MESH-2017). Absent for sessions launched before this field existed.
83
+ */
84
+ workflowFingerprint?: string;
85
+ }
86
+ /**
87
+ * Relaunch safety (MESH-2017): if the workflow source changed since this session
88
+ * launched, restarting the worker replays any in-flight conversations against the
89
+ * NEW code — a replay-incompatible change strands them. Warn and require `--force`.
90
+ *
91
+ * Silent no-op when there's no prior session, no stored fingerprint (pre-feature
92
+ * session), or nothing changed — so a restart of unchanged code never nags.
93
+ * Returns `true` if the caller should ABORT (changed && !force).
94
+ */
95
+ /** Pure: did the workflow source change since launch (→ risk of stranding)? */
96
+ export declare function workflowChanged(prior: string | undefined, current: string): boolean;
97
+ /**
98
+ * Check whether a TCP port is available — probing the way services actually bind.
99
+ *
100
+ * This used to bind `127.0.0.1` only, and that made it blind to exactly the
101
+ * processes it exists to find. Node's `listen(port)` (and `@hono/node-server`,
102
+ * which every agent-api uses) binds the WILDCARD address `::` in dual-stack mode,
103
+ * holding the port on every interface — yet a probe bound to `127.0.0.1` still
104
+ * succeeds against such a holder. So the check returned `true` for a port already
105
+ * held by a prior `mesh dev` service, `allocatePorts` kept the preferred port, and
106
+ * the service then died on `EADDRINUSE` at its real bind.
107
+ *
108
+ * Observed 2026-07-31: the `studio-api` pane died on `EADDRINUSE :::40161` while a
109
+ * stale agent-api from an earlier boot kept serving on the same port, so the Studio
110
+ * UI drove a process from a previous session's configuration and the conversation
111
+ * list came back empty. Reproduced in isolation — holder on `::`, loopback probe
112
+ * reports free, real bind fails (MESH-2590).
113
+ *
114
+ * Both addresses are probed: the wildcard catches all-interface holders, and the
115
+ * loopback probe still catches a loopback-only squatter. A false "busy" is cheap —
116
+ * `allocatePorts` simply picks another port — while a false "free" crashes the
117
+ * service, so this deliberately errs toward busy.
118
+ */
119
+ export declare function isPortFree(port: number): Promise<boolean>;
120
+ /**
121
+ * Rewrite a service's OWN listen-port env var(s) from `oldPort` to `newPort`
122
+ * when `allocatePorts` reassigns its port (e.g. a worktree block). Matches any
123
+ * port-ish var (`PORT` or `*_PORT`, e.g. `VCS_PORT`/`AGENT_API_PORT`) whose value
124
+ * is exactly the old port — so a service that reads its own env var still binds
125
+ * the reassigned port instead of its deploy-time default (which would collide
126
+ * with another worktree/session on that default). The name + exact-value match
127
+ * keeps this from touching cross-service references or unrelated vars.
128
+ * Mutates `service.env`. Pure otherwise — exported for unit testing. (MESH-2088)
129
+ */
130
+ export declare function rewriteOwnServicePort(service: DevService, oldPort: number, newPort: number): void;
131
+ /**
132
+ * Merge a session's PINNED ports/tunnels into a freshly-read DevOutput.
133
+ *
134
+ * `mesh dev restart <svc> --refresh-env` re-reads `pulumi stack output` to pick
135
+ * up config/deploy changes, but the running session already allocated local
136
+ * ports (`allocatePorts`) and opened SSM tunnels. Re-reading the raw stack
137
+ * output would carry the DEPLOYED (pre-allocation) ports, so writing those into
138
+ * the env file would point the service — and its peers — at the wrong ports and
139
+ * break the live tunnels.
140
+ *
141
+ * This returns `fresh` (so new/changed non-port env values win) but overrides:
142
+ * - EVERY service present in both `fresh` and `pinned` keeps its pinned/
143
+ * allocated PORT (both `service.port` and `service.env.PORT.value`) — not
144
+ * just the refreshed one, so a regenerated service's peer references land on
145
+ * the session-allocated ports, and
146
+ * - every tunnel present in `pinned` with the pinned host:port (the live SSM
147
+ * endpoints); tunnels that exist only in `fresh` survive untouched.
148
+ *
149
+ * It then re-applies BOTH of the peer-addressing rewrites `allocatePorts` does —
150
+ * there are two now, and naming only one here is how they drift apart:
151
+ * - PORT: for each service whose port differs between `fresh` (preferred) and
152
+ * `pinned` (allocated), `localhost:${freshPort}` → `localhost:${pinnedPort}`
153
+ * across EVERY service's env (e.g. a `ui`'s `API_URL` pointing at `api`).
154
+ * - HOST: an in-cluster address for a service running LOCALLY becomes its local
155
+ * one. `pulumi stack output` carries cluster hosts verbatim, so a refresh
156
+ * without this restores exactly the value MESH-2597 exists to remove.
157
+ *
158
+ * Pure: deep-clones and never mutates its arguments.
159
+ */
160
+ export declare function mergePinnedPorts(fresh: DevOutput, pinned: DevOutput): DevOutput;
161
+ /**
162
+ * Build the AWS env vars to hand to long-lived child services (ui, api,
163
+ * ai-assistant) and SSM tunnels.
164
+ *
165
+ * For the AWS SSO credential path, returns AWS_PROFILE + AWS_REGION only so
166
+ * the AWS SDK's default provider chain can auto-refresh credentials from the
167
+ * SSO cache (~8h session) as short-lived STS tokens expire. Without this,
168
+ * child processes inherit a frozen STS triple and start throwing
169
+ * ExpiredTokenException ~1h into a dev session.
170
+ *
171
+ * For the Zitadel web-identity path, when `opts` is supplied we write an AWS
172
+ * config file whose `credential_process` re-invokes `mesh login … --credential-process`,
173
+ * so the AWS SDK's default provider chain auto-refreshes the underlying STS
174
+ * triple (the `mesh login` process re-issues the Zitadel token as needed).
175
+ * This removes the ~1h forced `mesh dev` restart. When `opts` is absent we
176
+ * fall back to the frozen STS triple (used by CI/`environment` and any caller
177
+ * that doesn't thread the context/role through).
178
+ *
179
+ * For the remaining non-SSO paths (CI/CD env keys, or no deployer role),
180
+ * returns the explicit STS triple — there is no profile to refresh from. The
181
+ * user must restart `mesh dev` when those tokens expire.
182
+ */
183
+ export declare function buildChildAwsEnv(awsEnv: Record<string, string>, method: ResolvedAwsCreds['method'] | 'ambient', profile: string | undefined, opts?: {
184
+ context: string;
185
+ roleArn: string;
186
+ sessionScratchDir: string;
187
+ meshBin: string;
188
+ }): Record<string, string>;
189
+ /**
190
+ * Reduce a service `src` to its monorepo-relative form (pure; no filesystem).
191
+ * - relative (`./packages/x` or `packages/x`) → normalized `packages/x`
192
+ * - legacy absolute (`/…/mesh-platform[/.worktrees/<name>]/packages/x`) →
193
+ * `packages/x` (drops the repo root AND any deploying-worktree segment)
194
+ * Returns null when an absolute path has no recognizable monorepo marker.
195
+ */
196
+ export declare function monorepoRelativeSrc(src: string): string | null;
197
+ /**
198
+ * Build the client-facing `host:port` for an SSM tunnel.
199
+ *
200
+ * The `aws ssm start-session` port-forwarder binds IPv4 `127.0.0.1` only.
201
+ * Advertising `localhost` lets Node/grpc-js resolve to IPv6 `::1` first, which
202
+ * the tunnel isn't listening on — so e.g. the Temporal gRPC client fails with
203
+ * `ECONNREFUSED ::1:<port>` and the Hub's Automations/workflow lists never load.
204
+ * Maps the literal `localhost` (how tunnels are advertised today) to `127.0.0.1`
205
+ * so clients hit the bound listener. Any other host — VPN-direct VPC endpoints,
206
+ * or a different loopback literal like `::1`/`127.0.0.1` — passes through unchanged.
207
+ */
208
+ export declare function tunnelClientAddress(tunnel: {
209
+ host: string;
210
+ port: number;
211
+ }): string;
212
+ /** One tunnel's live health, resolved by a TCP dial of its client address. */
213
+ export interface TunnelHealth {
214
+ name: string;
215
+ /** Client-facing `host:port` (see {@link tunnelClientAddress}). */
216
+ address: string;
217
+ reachable: boolean;
218
+ }
219
+ /**
220
+ * Render the Connections section (live tunnel health) as status-window lines.
221
+ *
222
+ * The status window refreshes every ~2s, so this is where a mid-session tunnel
223
+ * death surfaces (MESH-2016): a dead tunnel shows `⚠ … DOWN` and a SINGLE
224
+ * remediation line explains the `ECONNREFUSED` retry spam the dependent service
225
+ * windows emit — instead of leaving the operator to decode that spam themselves.
226
+ * Returns `[]` when there are no tunnels (nothing to show).
227
+ */
228
+ export declare function formatTunnelHealth(health: TunnelHealth[]): string[];
229
+ /**
230
+ * Probe the routing-critical tunnel of a (Tailscale-rewritten) devOutput and
231
+ * return its name if the forwarder binds but does not ROUTE, else null.
232
+ *
233
+ * Only `temporal` is gated — it's the load-bearing VPC dependency (services die
234
+ * on a gRPC deadline when it's dead), and keying on it mirrors the vpn-direct
235
+ * reachability gate ({@link gateVpnDirectReachability}). A Tailscale forwarder
236
+ * accepts its local port even when its SOCKS upstream is dead or the joined
237
+ * tailnet doesn't route the VPC; such a forwarder tears the connection down
238
+ * within the grace window, so it fails the connection-HOLDS probe that a bare
239
+ * accept (the readiness gate's `waitForPort`) would pass (MESH-2169/MESH-2268).
240
+ */
241
+ export declare function firstUnroutableTunnel(tunnels: Record<string, {
242
+ host: string;
243
+ port: number;
244
+ }>): Promise<string | null>;
245
+ /** Compute the preferred local port for an SSM tunnel. */
246
+ /** Tunnel backing for a dev session. */
247
+ export type Transport = "ssm" | "tailscale" | "vpn-direct";
248
+ /** What `startServices` should do for VPC tunnels. */
249
+ export interface TunnelPlan {
250
+ transport: Transport;
251
+ tailscale?: {
252
+ tenant: string;
253
+ env: string;
254
+ region: string;
255
+ loginServer: string;
256
+ socksPort: number;
257
+ preAuthKey?: string;
258
+ };
259
+ /** True when the user EXPLICITLY asked for this transport (`--transport <x>`),
260
+ * vs an auto-resolved default. An explicit tailscale choice must NOT silently
261
+ * fall back to SSM — surface the failure so the user can act (MESH-2098). */
262
+ explicit?: boolean;
263
+ }
264
+ /**
265
+ * Resolve which tunnel backing `mesh dev` should use.
266
+ *
267
+ * An explicit `--transport` flag wins. Both `auto` and the default (unset)
268
+ * prefer Tailscale when it's available (brew `tailscaled` present), else fall
269
+ * back to the VPN-direct/SSM choice: VPN-direct when the VPN is connected, else
270
+ * SSM when the session-manager plugin is present. Where Tailscale isn't
271
+ * available the behavior is unchanged from before this feature.
272
+ */
273
+ export declare function resolveTransport(flag: string | undefined, ctx: {
274
+ vpnConnected: boolean;
275
+ hasSsmPlugin: boolean;
276
+ tailscaleAvailable: boolean;
277
+ }): Transport;
278
+ /** Outcome of the reachability gate — `transport` is what to use, `reason` drives the log. */
279
+ export type ReachabilityDecision = {
280
+ transport: Transport;
281
+ reason: "not-vpn-direct" | "reachable" | "fallback-ssm" | "unreachable-no-plugin";
282
+ };
283
+ /**
284
+ * Correct an auto-selected `vpn-direct` transport against ACTUAL reachability of
285
+ * the Temporal VPC endpoint (MESH-2016). `resolveTransport` uses a presence check
286
+ * (any Tailscale/VPN up) that's tailnet-blind — Tailscale-for-SSH looks connected
287
+ * but doesn't route the mesh VPC. Only `vpn-direct` is reachability-gated (it's
288
+ * never an explicit choice); every other transport passes through unchanged.
289
+ *
290
+ * Pure so the fallback logic is testable independently of the TCP probe.
291
+ */
292
+ export declare function reachabilityFallbackTransport(transport: Transport, temporalReachable: boolean, hasSsmPlugin: boolean): ReachabilityDecision;
293
+ export declare function preferredSsmLocalPort(remotePort: number): number;
294
+ /**
295
+ * Reserve a deterministic local-port candidate for an SSM tunnel.
296
+ *
297
+ * This prevents two tunnels with the same remote port (common for HTTPS
298
+ * endpoints) from being assigned the same localhost port before the AWS CLI
299
+ * has a chance to bind it.
300
+ */
301
+ export declare function reserveSsmLocalPortCandidate(remotePort: number, reservedPorts: Set<number>, startAt?: number): number;
16
302
  export declare function registerDevCommand(program: Command): void;
303
+ export {};
17
304
  //# sourceMappingURL=dev.d.ts.map