@mesh-tech/mesh-cli 0.1.1 → 0.12.1

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 +20878 -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 +28 -0
  63. package/dist/src/commands/install-shim.d.ts.map +1 -0
  64. package/dist/src/commands/install-shim.js +191 -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 +1 -0
  134. package/dist/src/commands/secrets/set.d.ts.map +1 -1
  135. package/dist/src/commands/secrets/set.js +96 -2
  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 +36 -22
  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,138 @@
1
+ /**
2
+ * The docs-as-registry-artifact client.
3
+ *
4
+ * The release job publishes the built portal as `@mesh-tech/docs` in the
5
+ * fixed lockstep group, so the docs version IS the @mesh-tech/* baseline
6
+ * version it describes. The audience is exactly "people who can install the
7
+ * packages": the CodeArtifact registry is Zitadel-role-gated (see
8
+ * `mesh registry login`), so no public hosting is required for the docs to
9
+ * reach precisely the authorized set.
10
+ *
11
+ * This module reads the user's existing `~/.npmrc` CodeArtifact token (the
12
+ * one `mesh registry login` writes), lists published docs versions, and
13
+ * fetches + caches a version's tarball. It never talks to AWS directly.
14
+ */
15
+ import { execFileSync } from "node:child_process";
16
+ import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
17
+ import { tmpdir } from "node:os";
18
+ import path from "node:path";
19
+ import { homeNpmrcPath, parseNpmrcRegistryAuth } from "../utils/auth-preflight.js";
20
+ export const DOCS_PACKAGE = "@mesh-tech/docs";
21
+ /** The CodeArtifact token + endpoint from `mesh registry login`'s ~/.npmrc line. */
22
+ export function readDocsRegistryAuth(npmrcPath = homeNpmrcPath()) {
23
+ if (!existsSync(npmrcPath))
24
+ return null;
25
+ return parseNpmrcRegistryAuth(readFileSync(npmrcPath, "utf-8"));
26
+ }
27
+ /** The packument URL for a package (`@scope/name` → `@scope%2fname` path encoding). */
28
+ function packumentUrl(endpoint, pkg) {
29
+ return `${endpoint.replace(/\/+$/, "")}/${pkg.replace(/\//g, "%2f")}`;
30
+ }
31
+ async function registryFetch(auth, url, fetchImpl) {
32
+ return fetchImpl(url, {
33
+ headers: {
34
+ authorization: `Bearer ${auth.token}`,
35
+ accept: "application/json",
36
+ },
37
+ });
38
+ }
39
+ /** x.y.z numeric compare (release versions carry no prerelease suffixes). */
40
+ export function compareVersions(a, b) {
41
+ const parse = (v) => {
42
+ const parts = v.split(".").map((n) => Number.parseInt(n, 10) || 0);
43
+ while (parts.length < 3)
44
+ parts.push(0);
45
+ return parts;
46
+ };
47
+ const pa = parse(a);
48
+ const pb = parse(b);
49
+ for (let i = 0; i < 3; i++) {
50
+ if (pa[i] !== pb[i])
51
+ return pa[i] - pb[i];
52
+ }
53
+ return 0;
54
+ }
55
+ /**
56
+ * Every published docs version, oldest → newest, plus the registry's
57
+ * `latest` dist-tag. Throws with the login remediation when the registry
58
+ * rejects the token — an expired token is the common case (12h TTL).
59
+ */
60
+ export async function listDocsVersions(auth, fetchImpl = fetch) {
61
+ const response = await registryFetch(auth, packumentUrl(auth.endpoint, DOCS_PACKAGE), fetchImpl).catch((error) => {
62
+ throw new Error(`could not reach the package registry: ${error instanceof Error ? error.message : String(error)}`);
63
+ });
64
+ if (response.status === 401 || response.status === 403) {
65
+ throw new Error(`registry auth rejected the token (${response.status}). Refresh it: mesh registry login`);
66
+ }
67
+ if (response.status === 404) {
68
+ throw new Error(`${DOCS_PACKAGE} is not published yet — no release has shipped the docs artifact. In a mesh-platform checkout, use \`mesh docs start\` against the working tree instead.`);
69
+ }
70
+ if (!response.ok) {
71
+ throw new Error(`registry returned ${response.status} for ${DOCS_PACKAGE}`);
72
+ }
73
+ const packument = (await response.json());
74
+ const versions = Object.keys(packument.versions ?? {}).sort(compareVersions);
75
+ return { versions, latest: packument["dist-tags"]?.latest };
76
+ }
77
+ /** Where fetched docs versions live: `~/.cache/mesh/docs/<version>/`. */
78
+ export function docsCacheRoot() {
79
+ const base = process.env.XDG_CACHE_HOME ?? path.join(homeDir(), ".cache");
80
+ return path.join(base, "mesh", "docs");
81
+ }
82
+ function homeDir() {
83
+ return process.env.HOME ?? tmpdir();
84
+ }
85
+ /**
86
+ * Fetch and extract a docs version into the cache; returns the directory
87
+ * containing the site's `dist/`. Cache hit = the directory already has a
88
+ * `dist/index.html`. Partial downloads extract to a temp sibling and rename,
89
+ * so an interrupted fetch never leaves a half-written "good" cache entry.
90
+ */
91
+ export async function fetchDocsArtifact(auth, version, cacheRoot = docsCacheRoot(), fetchImpl = fetch) {
92
+ const targetDir = path.join(cacheRoot, version);
93
+ if (existsSync(path.join(targetDir, "dist", "index.html")))
94
+ return targetDir;
95
+ const listResponse = await registryFetch(auth, packumentUrl(auth.endpoint, DOCS_PACKAGE), fetchImpl);
96
+ if (!listResponse.ok) {
97
+ throw new Error(`registry returned ${listResponse.status} for ${DOCS_PACKAGE}`);
98
+ }
99
+ const packument = (await listResponse.json());
100
+ const tarball = packument.versions?.[version]?.dist?.tarball;
101
+ if (!tarball) {
102
+ throw new Error(`${DOCS_PACKAGE}@${version} is not in the registry. Run \`mesh docs list\` to see published versions.`);
103
+ }
104
+ // Only ever send the registry credential to the registry's own origin: the
105
+ // tarball URL comes out of a response BODY, and a bearer token must not
106
+ // follow it to an arbitrary host. Real CodeArtifact tarball URLs are
107
+ // same-origin; anything else is a malformed (or hostile) packument.
108
+ if (new URL(tarball).origin !== new URL(auth.endpoint).origin) {
109
+ throw new Error(`${DOCS_PACKAGE}@${version} points its tarball at ${new URL(tarball).origin}, not the registry (${new URL(auth.endpoint).origin}) — refusing to send the registry token off-origin`);
110
+ }
111
+ const tgzResponse = await registryFetch(auth, tarball, fetchImpl);
112
+ if (!tgzResponse.ok) {
113
+ throw new Error(`downloading ${DOCS_PACKAGE}@${version} failed: ${tgzResponse.status}`);
114
+ }
115
+ mkdirSync(cacheRoot, { recursive: true });
116
+ const tgzPath = path.join(cacheRoot, `.${version}.tgz`);
117
+ writeFileSync(tgzPath, Buffer.from(await tgzResponse.arrayBuffer()));
118
+ const staging = path.join(cacheRoot, `.staging-${version}`);
119
+ rmSync(staging, { recursive: true, force: true });
120
+ mkdirSync(staging, { recursive: true });
121
+ try {
122
+ // npm tarballs wrap everything in `package/` — strip one component.
123
+ execFileSync("tar", ["-xzf", tgzPath, "-C", staging, "--strip-components", "1"], {
124
+ stdio: ["pipe", "pipe", "pipe"],
125
+ });
126
+ }
127
+ finally {
128
+ rmSync(tgzPath, { force: true });
129
+ }
130
+ if (!existsSync(path.join(staging, "dist", "index.html"))) {
131
+ rmSync(staging, { recursive: true, force: true });
132
+ throw new Error(`${DOCS_PACKAGE}@${version} unpacked without a dist/index.html — the artifact is malformed`);
133
+ }
134
+ rmSync(targetDir, { recursive: true, force: true });
135
+ renameSync(staging, targetDir);
136
+ return targetDir;
137
+ }
138
+ //# sourceMappingURL=registry-docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-docs.js","sourceRoot":"","sources":["../../../src/docs/registry-docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAO9C,oFAAoF;AACpF,MAAM,UAAU,oBAAoB,CAAC,YAAoB,aAAa,EAAE;IACtE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,sBAAsB,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,uFAAuF;AACvF,SAAS,YAAY,CAAC,QAAgB,EAAE,GAAW;IACjD,OAAO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EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC;QAC1D,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,GAAG,YAAY,IAAI,OAAO,iEAAiE,CAAC,CAAC;IAC/G,CAAC;IAED,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC/B,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The `docs.json` contract — the one file that turns a directory into portal
3
+ * content, and the reserved-name list that keeps internal material
4
+ * unpublishable even inside an opted-in directory.
5
+ *
6
+ * The reserved list is the safety property of the whole design: it is frozen,
7
+ * deliberately coarse, and matched case-insensitively against every path
8
+ * segment at any depth. Publishing internal material takes TWO mistakes —
9
+ * adding a `docs.json` to a directory that holds it AND moving the material
10
+ * out of a reserved directory. Keep the list coarse; when a document should be
11
+ * public, move the document to a publishable directory rather than narrowing
12
+ * the list.
13
+ */
14
+ import { z } from "zod";
15
+ /**
16
+ * Directory/file names that never publish, at any depth beneath a doc root.
17
+ * Matched case-insensitively against each individual path segment.
18
+ *
19
+ * Evidence-derived from the repo's own `docs/` tree (plans/, superpowers/,
20
+ * incidents/, handoffs/, HRAN/, reviews/, runbooks/, proposals/, designs/,
21
+ * templates/ hold the internal corpus) plus the tooling directories that must
22
+ * never leak (node_modules, __tests__, .claude, .pi) and the generic internal
23
+ * markers (archive, internal, drafts).
24
+ */
25
+ export declare const RESERVED_SEGMENTS: readonly string[];
26
+ /**
27
+ * A doc root's declaration. Everything else about the site is derived from the
28
+ * tree, never declared — this schema is deliberately tiny, and STRICT: an
29
+ * unknown key is a typo the author meant something by, so it fails validation
30
+ * rather than being silently ignored.
31
+ */
32
+ export declare const docsJsonSchema: z.ZodObject<{
33
+ title: z.ZodString;
34
+ order: z.ZodDefault<z.ZodNumber>;
35
+ slug: z.ZodOptional<z.ZodString>;
36
+ include: z.ZodDefault<z.ZodArray<z.ZodString>>;
37
+ }, z.core.$strict>;
38
+ export type DocsJson = z.infer<typeof docsJsonSchema>;
39
+ /** True when one path segment is a reserved name (case-insensitive). */
40
+ export declare function isReservedSegment(segment: string): boolean;
41
+ /**
42
+ * True when ANY segment of a repo-relative path is reserved. This is the
43
+ * fail-closed check the CI gate runs over every assembled output path.
44
+ */
45
+ export declare function hasReservedSegment(relPath: string): boolean;
46
+ /** Lower-kebab-case form of a title or filename stem, for routes. */
47
+ export declare function slugify(value: string): string;
48
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/docs/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAkB9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;kBA6BhB,CAAC;AAEZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,qEAAqE;AACrE,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO7C"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The `docs.json` contract — the one file that turns a directory into portal
3
+ * content, and the reserved-name list that keeps internal material
4
+ * unpublishable even inside an opted-in directory.
5
+ *
6
+ * The reserved list is the safety property of the whole design: it is frozen,
7
+ * deliberately coarse, and matched case-insensitively against every path
8
+ * segment at any depth. Publishing internal material takes TWO mistakes —
9
+ * adding a `docs.json` to a directory that holds it AND moving the material
10
+ * out of a reserved directory. Keep the list coarse; when a document should be
11
+ * public, move the document to a publishable directory rather than narrowing
12
+ * the list.
13
+ */
14
+ import { z } from "zod";
15
+ /**
16
+ * Directory/file names that never publish, at any depth beneath a doc root.
17
+ * Matched case-insensitively against each individual path segment.
18
+ *
19
+ * Evidence-derived from the repo's own `docs/` tree (plans/, superpowers/,
20
+ * incidents/, handoffs/, HRAN/, reviews/, runbooks/, proposals/, designs/,
21
+ * templates/ hold the internal corpus) plus the tooling directories that must
22
+ * never leak (node_modules, __tests__, .claude, .pi) and the generic internal
23
+ * markers (archive, internal, drafts).
24
+ */
25
+ export const RESERVED_SEGMENTS = [
26
+ "plans",
27
+ "designs",
28
+ "proposals",
29
+ "incidents",
30
+ "handoffs",
31
+ "reviews",
32
+ "runbooks",
33
+ "hran",
34
+ "superpowers",
35
+ "templates",
36
+ "archive",
37
+ "internal",
38
+ "drafts",
39
+ "node_modules",
40
+ "__tests__",
41
+ ".claude",
42
+ ".pi",
43
+ ];
44
+ /**
45
+ * A doc root's declaration. Everything else about the site is derived from the
46
+ * tree, never declared — this schema is deliberately tiny, and STRICT: an
47
+ * unknown key is a typo the author meant something by, so it fails validation
48
+ * rather than being silently ignored.
49
+ */
50
+ export const docsJsonSchema = z
51
+ .object({
52
+ /** Section label in the nav, e.g. "Building apps". */
53
+ title: z.string().min(1),
54
+ /**
55
+ * Section position in the nav. Ties break alphabetically by title, so two
56
+ * sections can never fight over a slot nondeterministically.
57
+ */
58
+ order: z.number().int().default(50),
59
+ /**
60
+ * Route prefix for the section. Defaults to the slugified title. The
61
+ * empty string is legal and means "this section lives at the site root" —
62
+ * exactly one root should do that (the front door, `docs/portal`).
63
+ */
64
+ slug: z
65
+ .string()
66
+ .regex(/^$|^[a-z0-9]+(?:-[a-z0-9]+)*$/, 'slug must be lower-kebab-case or ""')
67
+ .optional(),
68
+ /**
69
+ * Escape hatch: explicit repo-relative paths to publish that live outside
70
+ * any natural doc root (a package README, a repo-root policy file). Expected
71
+ * to hold a handful of entries across the whole repo — adding one is a
72
+ * deliberate, reviewable act. Paths under a reserved segment are refused.
73
+ */
74
+ include: z.array(z.string().min(1)).default([]),
75
+ })
76
+ .strict();
77
+ /** True when one path segment is a reserved name (case-insensitive). */
78
+ export function isReservedSegment(segment) {
79
+ const lowered = segment.toLowerCase();
80
+ return RESERVED_SEGMENTS.some((reserved) => reserved === lowered);
81
+ }
82
+ /**
83
+ * True when ANY segment of a repo-relative path is reserved. This is the
84
+ * fail-closed check the CI gate runs over every assembled output path.
85
+ */
86
+ export function hasReservedSegment(relPath) {
87
+ return relPath.split("/").some(isReservedSegment);
88
+ }
89
+ /** Lower-kebab-case form of a title or filename stem, for routes. */
90
+ export function slugify(value) {
91
+ return (value
92
+ .toLowerCase()
93
+ .replace(/[^a-z0-9]+/g, "-")
94
+ .replace(/^-+|-+$/g, "") || "index");
95
+ }
96
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/docs/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,OAAO;IACP,SAAS;IACT,WAAW;IACX,WAAW;IACX,UAAU;IACV,SAAS;IACT,UAAU;IACV,MAAM;IACN,aAAa;IACb,WAAW;IACX,SAAS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@ -0,0 +1,27 @@
1
+ /**
2
+ * Serve a BUILT docs site (the Zudoku `dist/`) over loopback HTTP.
3
+ *
4
+ * This is deliberately not the deleted portal-serve.ts: that one served a
5
+ * bespoke renderer's output with a custom search-index API. This one serves
6
+ * a prerendered static tree and nothing else — try the exact path, then
7
+ * `<path>.html` (Zudoku's prerendered routes), then `<path>/index.html`,
8
+ * then the SPA fallback. No search endpoint: Pagefind runs client-side
9
+ * against the shipped index files.
10
+ */
11
+ export interface DocsServer {
12
+ url: string;
13
+ port: number;
14
+ close: () => Promise<void>;
15
+ }
16
+ /**
17
+ * Start the server. `port: 0` picks a free one (what tests use).
18
+ *
19
+ * Path safety: the URL path is normalized and rejected outright if it escapes
20
+ * the root — this serves a local preview to the machine's own user, but a
21
+ * `..` escape is a hole with no excuse to exist.
22
+ */
23
+ export declare function serveDocsSite(args: {
24
+ root: string;
25
+ port: number;
26
+ }): Promise<DocsServer>;
27
+ //# sourceMappingURL=serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/docs/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA0BH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAmE7F"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Serve a BUILT docs site (the Zudoku `dist/`) over loopback HTTP.
3
+ *
4
+ * This is deliberately not the deleted portal-serve.ts: that one served a
5
+ * bespoke renderer's output with a custom search-index API. This one serves
6
+ * a prerendered static tree and nothing else — try the exact path, then
7
+ * `<path>.html` (Zudoku's prerendered routes), then `<path>/index.html`,
8
+ * then the SPA fallback. No search endpoint: Pagefind runs client-side
9
+ * against the shipped index files.
10
+ */
11
+ import { createServer } from "node:http";
12
+ import { readFile } from "node:fs/promises";
13
+ import { extname, join, normalize, sep } from "node:path";
14
+ const CONTENT_TYPES = {
15
+ ".html": "text/html; charset=utf-8",
16
+ ".js": "text/javascript; charset=utf-8",
17
+ ".mjs": "text/javascript; charset=utf-8",
18
+ ".css": "text/css; charset=utf-8",
19
+ ".json": "application/json; charset=utf-8",
20
+ ".map": "application/json; charset=utf-8",
21
+ ".svg": "image/svg+xml",
22
+ ".png": "image/png",
23
+ ".jpg": "image/jpeg",
24
+ ".jpeg": "image/jpeg",
25
+ ".gif": "image/gif",
26
+ ".ico": "image/x-icon",
27
+ ".woff": "font/woff",
28
+ ".woff2": "font/woff2",
29
+ ".txt": "text/plain; charset=utf-8",
30
+ ".md": "text/markdown; charset=utf-8",
31
+ ".webmanifest": "application/manifest+json",
32
+ };
33
+ /**
34
+ * Start the server. `port: 0` picks a free one (what tests use).
35
+ *
36
+ * Path safety: the URL path is normalized and rejected outright if it escapes
37
+ * the root — this serves a local preview to the machine's own user, but a
38
+ * `..` escape is a hole with no excuse to exist.
39
+ */
40
+ export async function serveDocsSite(args) {
41
+ const root = normalize(args.root);
42
+ // Containment, not prefix-match: the prefix test alone admits SIBLINGS
43
+ // whose names extend the root's basename (`<parent>/dist-secret/x` starts
44
+ // with `<parent>/dist`). The vector that reaches it is an encoded slash —
45
+ // WHATWG URL parsing strips dot-segments, then decodeURIComponent turns
46
+ // `..%2f` back into `../`. (Review on #3612.)
47
+ const rootPrefix = root.endsWith(sep) ? root : root + sep;
48
+ const server = createServer((req, res) => {
49
+ void (async () => {
50
+ const url = new URL(req.url ?? "/", "http://localhost");
51
+ const pathname = decodeURIComponent(url.pathname);
52
+ if (pathname === "/healthz") {
53
+ res.writeHead(200, { "content-type": "text/plain" }).end("ok");
54
+ return;
55
+ }
56
+ const candidates = [
57
+ pathname,
58
+ `${pathname}.html`,
59
+ `${pathname.replace(/\/$/, "")}/index.html`,
60
+ ];
61
+ if (pathname !== "/")
62
+ candidates.push("/index.html"); // SPA fallback
63
+ for (const candidate of candidates) {
64
+ const filePath = normalize(join(root, candidate));
65
+ // `continue`, not `break`: one malformed candidate must not change
66
+ // the response for the rest (the SPA fallback lives inside the root).
67
+ if (filePath !== root && !filePath.startsWith(rootPrefix))
68
+ continue; // outside the root — never serve
69
+ try {
70
+ const body = await readFile(filePath);
71
+ const type = CONTENT_TYPES[extname(filePath)] ?? "application/octet-stream";
72
+ // Prerendered HTML can be stale the moment a newer build exists;
73
+ // hashed assets are immutable.
74
+ const cache = candidate.includes("/assets/") ? "public, max-age=31536000, immutable" : "no-cache";
75
+ res.writeHead(200, { "content-type": type, "cache-control": cache });
76
+ res.end(body);
77
+ return;
78
+ }
79
+ catch {
80
+ // try the next candidate
81
+ }
82
+ }
83
+ res.writeHead(404, { "content-type": "text/plain" }).end("not found");
84
+ })().catch(() => {
85
+ res.writeHead(500).end("internal error");
86
+ });
87
+ });
88
+ await new Promise((resolve, reject) => {
89
+ server.once("error", reject);
90
+ server.listen(args.port, "127.0.0.1", () => resolve());
91
+ });
92
+ const address = server.address();
93
+ const port = typeof address === "object" && address ? address.port : args.port;
94
+ return {
95
+ url: `http://127.0.0.1:${port}`,
96
+ port,
97
+ close: () => new Promise((resolve, reject) => {
98
+ server.close((error) => (error ? reject(error) : resolve()));
99
+ }),
100
+ };
101
+ }
102
+ //# sourceMappingURL=serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/docs/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,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AAC;QACxE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;YACd,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAE/E,OAAO;QACL,GAAG,EAAE,oBAAoB,IAAI,EAAE;QAC/B,IAAI;QACJ,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC;KACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * `mesh docs start` / `mesh docs list` / `mesh docs stop` — the docs as a
3
+ * local, role-gated server (MESH-1803 follow-up).
4
+ *
5
+ * Two content modes, chosen automatically:
6
+ *
7
+ * - **Repo mode** — inside a checkout that has doc roots (mesh-platform):
8
+ * assemble the working tree, build, and serve the static output. This is
9
+ * the contributor path; the docs are exactly what is on disk.
10
+ * - **Registry mode** — anywhere else (a tenant repo, a global install):
11
+ * fetch the published `@mesh-tech/docs` artifact — versioned with the
12
+ * @mesh-tech/* baseline — from the role-gated registry and serve it.
13
+ * `-v <version>` pins; default is the registry's `latest` dist-tag.
14
+ *
15
+ * Two run modes: by default the server runs DETACHED in a tmux session with
16
+ * the constant name `mesh-docs` — the handle that keeps a backgrounded server
17
+ * from getting lost — and the command prints the URL once it answers.
18
+ * `--foreground` (or a non-TTY, i.e. an agent/CI) serves in the foreground.
19
+ * `--dev` (repo mode) runs the Zudoku dev server and is foreground-only: it
20
+ * is an authoring tool — you are supposed to watch it.
21
+ *
22
+ * The registry mode is the distribution point: the people who can read the
23
+ * docs are exactly the people who can install the packages, and no public
24
+ * hosting is required.
25
+ */
26
+ /** The one tmux session name — the constant handle for the detached server. */
27
+ export declare const DOCS_TMUX_SESSION = "mesh-docs";
28
+ /** `mesh docs list` — published docs versions, newest first. */
29
+ export declare function runDocsList(): Promise<void>;
30
+ /** The install command to show when tmux is missing, per platform. */
31
+ export declare function tmuxInstallHint(platform?: string): string;
32
+ /** True when tmux is runnable. */
33
+ export declare function tmuxAvailable(): boolean;
34
+ /** The detached/foreground decision, as one pure predicate. */
35
+ export declare function shouldDetach(args: {
36
+ foreground: boolean;
37
+ dev: boolean;
38
+ isTTY: boolean;
39
+ }): boolean;
40
+ /** True when the detached session currently exists. */
41
+ export declare function docsSessionExists(): boolean;
42
+ /**
43
+ * The argv the tmux session runs: a hidden foreground serve of the prepared
44
+ * directory. Source checkouts re-enter through `pnpm exec mesh` at the repo
45
+ * root (the shim-free canonical form); a published install re-enters through
46
+ * the `mesh` bin on PATH.
47
+ */
48
+ export declare function tmuxServeArgs(args: {
49
+ mode: "source" | "dist";
50
+ repoRoot: string;
51
+ serveRoot: string;
52
+ port: number;
53
+ }): {
54
+ command: string[];
55
+ cwd: string;
56
+ };
57
+ /** (Re)start the detached docs session and wait for it to answer. */
58
+ export declare function startDetached(args: {
59
+ mode: "source" | "dist";
60
+ repoRoot: string;
61
+ serveRoot: string;
62
+ port: number;
63
+ label: string;
64
+ }): Promise<void>;
65
+ /** `mesh docs stop` — kill the detached session if it exists. */
66
+ export declare function runDocsStop(): void;
67
+ /** The hidden `mesh docs serve-static` the tmux session re-enters through. */
68
+ export declare function runDocsServeStatic(args: {
69
+ root: string;
70
+ port: string;
71
+ }): Promise<void>;
72
+ /** `mesh docs start` — serve the docs locally, detached by default. */
73
+ export declare function runDocsStart(args: {
74
+ repoRoot: string;
75
+ version?: string | undefined;
76
+ port: string;
77
+ dev: boolean;
78
+ foreground: boolean;
79
+ }): Promise<void>;
80
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/docs/start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAkBH,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAa7C,gEAAgE;AAChE,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAcjD;AAMD,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,QAAQ,GAAE,MAAyB,GAAG,MAAM,CAI3E;AAED,kCAAkC;AAClC,wBAAgB,aAAa,IAAI,OAAO,CAOvC;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEjG;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,IAAI,OAAO,CAO3C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;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