vibe64 0.1.74 → 0.1.76

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 (252) hide show
  1. package/bin/run.js +747 -746
  2. package/bin/server.js +4 -4
  3. package/bin/upgrade-state.js +3548 -3538
  4. package/config/server.js +13 -1
  5. package/dist/assets/{GithubBrowserTabs-__1ieC1c.js → GithubBrowserTabs-B2r19V0U.js} +1 -1
  6. package/dist/assets/GithubBrowserTabs-B2r19V0U.js.br +0 -0
  7. package/dist/assets/GithubBrowserTabs-B2r19V0U.js.gz +0 -0
  8. package/dist/assets/{LocalDatabaseServer-dK29B76L.js → LocalDatabaseServer-Ck9nZrGW.js} +1 -1
  9. package/dist/assets/LocalDatabaseServer-Ck9nZrGW.js.br +0 -0
  10. package/dist/assets/LocalDatabaseServer-Ck9nZrGW.js.gz +0 -0
  11. package/dist/assets/{Vibe64DashboardPageHeader-DH1YCSF1.js → Vibe64DashboardPageHeader-C4iTKeE0.js} +1 -1
  12. package/dist/assets/Vibe64DashboardPageHeader-C4iTKeE0.js.br +0 -0
  13. package/dist/assets/Vibe64DashboardPageHeader-C4iTKeE0.js.gz +0 -0
  14. package/dist/assets/{Vibe64DatabaseWorkspace-csnEOYGD.js → Vibe64DatabaseWorkspace-ChA-2QPU.js} +1 -1
  15. package/dist/assets/Vibe64DatabaseWorkspace-ChA-2QPU.js.br +0 -0
  16. package/dist/assets/Vibe64DatabaseWorkspace-ChA-2QPU.js.gz +0 -0
  17. package/dist/assets/{Vibe64FileArea-CeiAmwiT.js → Vibe64FileArea-DBEJsJSq.js} +1 -1
  18. package/dist/assets/Vibe64FileArea-DBEJsJSq.js.br +0 -0
  19. package/dist/assets/Vibe64FileArea-DBEJsJSq.js.gz +0 -0
  20. package/dist/assets/{Vibe64OutputControls-nFkMTVFI.js → Vibe64OutputControls-DpFdKIO2.js} +1 -1
  21. package/dist/assets/Vibe64OutputControls-DpFdKIO2.js.br +0 -0
  22. package/dist/assets/Vibe64OutputControls-DpFdKIO2.js.gz +0 -0
  23. package/dist/assets/{Vibe64RepositoryWorkspace-BcGZsRIF.js → Vibe64RepositoryWorkspace-sT07hHPs.js} +1 -1
  24. package/dist/assets/Vibe64RepositoryWorkspace-sT07hHPs.js.br +0 -0
  25. package/dist/assets/Vibe64RepositoryWorkspace-sT07hHPs.js.gz +0 -0
  26. package/dist/assets/{Vibe64SessionFiles-BrNoYV6c.js → Vibe64SessionFiles-Djef01EV.js} +1 -1
  27. package/dist/assets/Vibe64SessionFiles-Djef01EV.js.br +0 -0
  28. package/dist/assets/Vibe64SessionFiles-Djef01EV.js.gz +0 -0
  29. package/dist/assets/{Vibe64SessionSourceEditor-Pz9DR_lm.js → Vibe64SessionSourceEditor-CIGBLYYN.js} +1 -1
  30. package/dist/assets/Vibe64SessionSourceEditor-CIGBLYYN.js.br +0 -0
  31. package/dist/assets/Vibe64SessionSourceEditor-CIGBLYYN.js.gz +0 -0
  32. package/dist/assets/{Vibe64UiStoryboardView-D8Z-WkVp.js → Vibe64UiStoryboardView-CjkWoB8b.js} +1 -1
  33. package/dist/assets/Vibe64UiStoryboardView-CjkWoB8b.js.br +0 -0
  34. package/dist/assets/Vibe64UiStoryboardView-CjkWoB8b.js.gz +0 -0
  35. package/dist/assets/{_pageId_-DsnrOQFl.js → _pageId_-BTjeqgTN.js} +1 -1
  36. package/dist/assets/{_sessionId_-DI83WzOB.js → _sessionId_-C7Jh2bL4.js} +1 -1
  37. package/dist/assets/_sessionId_-C7Jh2bL4.js.br +0 -0
  38. package/dist/assets/_sessionId_-C7Jh2bL4.js.gz +0 -0
  39. package/dist/assets/{_sessionTool_-BkRFpBKI.js → _sessionTool_-DITdXCS4.js} +1 -1
  40. package/dist/assets/{access-CD1NLU2z.js → access-DIaPNdxr.js} +1 -1
  41. package/dist/assets/access-DIaPNdxr.js.br +0 -0
  42. package/dist/assets/access-DIaPNdxr.js.gz +0 -0
  43. package/dist/assets/{app-NJHCyI2M.js → app-mELSmS67.js} +1 -1
  44. package/dist/assets/app-mELSmS67.js.br +0 -0
  45. package/dist/assets/app-mELSmS67.js.gz +0 -0
  46. package/dist/assets/{changes-Bg5fn535.js → changes-DlxKdjdP.js} +1 -1
  47. package/dist/assets/{client-B5-KiJ_k.js → client-CL02nP02.js} +2 -2
  48. package/dist/assets/client-CL02nP02.js.br +0 -0
  49. package/dist/assets/client-CL02nP02.js.gz +0 -0
  50. package/dist/assets/{client-DHAysNQ_.js → client-CLpGzGwX.js} +2 -2
  51. package/dist/assets/client-CLpGzGwX.js.br +0 -0
  52. package/dist/assets/client-CLpGzGwX.js.gz +0 -0
  53. package/dist/assets/{dashboard-Bzs2mNSD.js → dashboard-km-kuDid.js} +1 -1
  54. package/dist/assets/{english-definitions-jEDFqPtl.js → english-definitions-CMICWgdF.js} +1 -1
  55. package/dist/assets/english-definitions-CMICWgdF.js.br +0 -0
  56. package/dist/assets/{english-definitions-jEDFqPtl.js.gz → english-definitions-CMICWgdF.js.gz} +0 -0
  57. package/dist/assets/{env-CuVAcxrg.js → env-DjkxkxdX.js} +1 -1
  58. package/dist/assets/env-DjkxkxdX.js.br +0 -0
  59. package/dist/assets/env-DjkxkxdX.js.gz +0 -0
  60. package/dist/assets/{error-vtsBf2sc.js → error-C7q1-2bC.js} +1 -1
  61. package/dist/assets/error-C7q1-2bC.js.br +0 -0
  62. package/dist/assets/error-C7q1-2bC.js.gz +0 -0
  63. package/dist/assets/{fileTypes-BtIfp_s4.js → fileTypes-Dbn0qwKS.js} +1 -1
  64. package/dist/assets/fileTypes-Dbn0qwKS.js.br +0 -0
  65. package/dist/assets/fileTypes-Dbn0qwKS.js.gz +0 -0
  66. package/dist/assets/{health-hZ8hCq4g.js → health-BwJ6Z251.js} +1 -1
  67. package/dist/assets/health-BwJ6Z251.js.br +0 -0
  68. package/dist/assets/health-BwJ6Z251.js.gz +0 -0
  69. package/dist/assets/{history-BUD8OO2u.js → history-D2TywQVv.js} +1 -1
  70. package/dist/assets/history-D2TywQVv.js.br +0 -0
  71. package/dist/assets/history-D2TywQVv.js.gz +0 -0
  72. package/dist/assets/{index-DW2-Y5r1.js → index-D14nUmm7.js} +7 -7
  73. package/dist/assets/index-D14nUmm7.js.br +0 -0
  74. package/dist/assets/index-D14nUmm7.js.gz +0 -0
  75. package/dist/assets/{integrations-mJUuC1tA.js → integrations-BZFXW2Cp.js} +13 -13
  76. package/dist/assets/integrations-BZFXW2Cp.js.br +0 -0
  77. package/dist/assets/integrations-BZFXW2Cp.js.gz +0 -0
  78. package/dist/assets/integrations-SNUfmpyR.css +1 -0
  79. package/dist/assets/integrations-SNUfmpyR.css.br +0 -0
  80. package/dist/assets/integrations-SNUfmpyR.css.gz +0 -0
  81. package/dist/assets/{issues-D6TrPRr_.js → issues-CLvbBTek.js} +1 -1
  82. package/dist/assets/issues-CLvbBTek.js.br +0 -0
  83. package/dist/assets/issues-CLvbBTek.js.gz +0 -0
  84. package/dist/assets/{learning-DSNeeTtU.js → learning-DwytxEXC.js} +1 -1
  85. package/dist/assets/{publish-BKAvPixQ.js → packages-BeiF8W7l.js} +1 -1
  86. package/dist/assets/packages-BeiF8W7l.js.br +0 -0
  87. package/dist/assets/packages-BeiF8W7l.js.gz +0 -0
  88. package/dist/assets/{pages-DpJxIaJ-.js → pages-BIRQk4b8.js} +1 -1
  89. package/dist/assets/{pages-cUFHVIQj.js → pages-BnAyUdL4.js} +1 -1
  90. package/dist/assets/pages-BnAyUdL4.js.br +3 -0
  91. package/dist/assets/pages-BnAyUdL4.js.gz +0 -0
  92. package/dist/assets/{project-D45_Rd6Y.js → project-GnljGud1.js} +8 -8
  93. package/dist/assets/project-GnljGud1.js.br +0 -0
  94. package/dist/assets/project-GnljGud1.js.gz +0 -0
  95. package/dist/assets/{project-DTGwAgqm.css → project-W_VltXAt.css} +1 -1
  96. package/dist/assets/project-W_VltXAt.css.br +0 -0
  97. package/dist/assets/project-W_VltXAt.css.gz +0 -0
  98. package/dist/assets/{project-files-DgvpUk1M.js → project-files-e4-Q65vT.js} +1 -1
  99. package/dist/assets/project-files-e4-Q65vT.js.br +0 -0
  100. package/dist/assets/project-files-e4-Q65vT.js.gz +0 -0
  101. package/dist/assets/{project-shared-ShellOutlet-eIh5yfRJ.js → project-shared-ShellOutlet-DKYDipmC.js} +1 -1
  102. package/dist/assets/project-shared-ShellOutlet-DKYDipmC.js.br +0 -0
  103. package/dist/assets/project-shared-ShellOutlet-DKYDipmC.js.gz +0 -0
  104. package/dist/assets/{project-shared-VBottomSheet-XWVEiPmQ.js → project-shared-VBottomSheet-BSE28ENQ.js} +1 -1
  105. package/dist/assets/project-shared-VBottomSheet-BSE28ENQ.js.br +0 -0
  106. package/dist/assets/project-shared-VBottomSheet-BSE28ENQ.js.gz +0 -0
  107. package/dist/assets/{project-shared-VToolbar-DKJZQDcP.js → project-shared-VToolbar-CrezJP9z.js} +1 -1
  108. package/dist/assets/project-shared-VToolbar-CrezJP9z.js.br +0 -0
  109. package/dist/assets/project-shared-VToolbar-CrezJP9z.js.gz +0 -0
  110. package/dist/assets/{project-shared-pageNames-CWXyQBuT.js → project-shared-pageNames-6Jz0BfbS.js} +1 -1
  111. package/dist/assets/project-shared-pageNames-6Jz0BfbS.js.br +0 -0
  112. package/dist/assets/project-shared-pageNames-6Jz0BfbS.js.gz +0 -0
  113. package/dist/assets/{pull-requests-DycdPcXY.js → pull-requests-DH9gWw10.js} +1 -1
  114. package/dist/assets/pull-requests-DH9gWw10.js.br +0 -0
  115. package/dist/assets/pull-requests-DH9gWw10.js.gz +0 -0
  116. package/dist/assets/{repository-BugUartC.js → repository-BNltUuvb.js} +1 -1
  117. package/dist/assets/{session-B4iZufWI.js → session-Ck9aH4Yl.js} +1 -1
  118. package/dist/assets/session-Ck9aH4Yl.js.br +0 -0
  119. package/dist/assets/session-Ck9aH4Yl.js.gz +0 -0
  120. package/dist/assets/{settings-BrO7TeLW.js → settings-D8Ofbk56.js} +1 -1
  121. package/dist/assets/settings-D8Ofbk56.js.br +0 -0
  122. package/dist/assets/settings-D8Ofbk56.js.gz +0 -0
  123. package/dist/assets/{useArchivedVibe64Sessions-DdavJ9tr.js → useArchivedVibe64Sessions-LIZjeLbd.js} +1 -1
  124. package/dist/assets/useArchivedVibe64Sessions-LIZjeLbd.js.br +0 -0
  125. package/dist/assets/useArchivedVibe64Sessions-LIZjeLbd.js.gz +0 -0
  126. package/dist/assets/{vibe64AttachmentDownload-DjRt5OfX.js → vibe64AttachmentDownload-1_XfvfYp.js} +1 -1
  127. package/dist/assets/vibe64SavedEnvValues-Bs7r4xWE.js +1 -0
  128. package/dist/assets/{vue-flow-core-DzmtR5x-.js → vue-flow-core-iwGljzru.js} +1 -1
  129. package/dist/assets/vue-flow-core-iwGljzru.js.br +0 -0
  130. package/dist/assets/vue-flow-core-iwGljzru.js.gz +0 -0
  131. package/dist/index.html +2 -2
  132. package/docs/colleague-usage/add-a-service.md +3 -3
  133. package/docs/colleague-usage/coding-agents.md +4 -2
  134. package/docs/colleague-usage/colleague-watches.md +2 -2
  135. package/docs/colleague-usage/dashboard-navigation.md +1 -1
  136. package/docs/colleague-usage/development-env.md +16 -7
  137. package/docs/colleague-usage/files.md +1 -1
  138. package/docs/colleague-usage/integrations.md +3 -3
  139. package/docs/colleague-usage/{publishing.md → packages.md} +3 -3
  140. package/docs/colleague-usage/passes.md +18 -23
  141. package/docs/colleague-usage/preview.md +47 -3
  142. package/docs/colleague-usage/project-messages.md +6 -6
  143. package/docs/colleague-usage/workspace-preparation.md +2 -2
  144. package/docs/training-content.md +2 -2
  145. package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +1 -0
  146. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  147. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  148. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  149. package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
  150. package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
  151. package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
  152. package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
  153. package/node_modules/@jskit-ai/kernel/CHANGELOG.md +3 -0
  154. package/node_modules/@jskit-ai/kernel/package.json +1 -1
  155. package/node_modules/@jskit-ai/payments-core/package.json +1 -1
  156. package/node_modules/@jskit-ai/realtime/CHANGELOG.md +2 -0
  157. package/node_modules/@jskit-ai/realtime/package.json +1 -1
  158. package/node_modules/@jskit-ai/realtime/patterns/realtime-application/PATTERN.md +2 -0
  159. package/node_modules/@jskit-ai/resource-core/package.json +1 -1
  160. package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
  161. package/node_modules/@local/vibe64-core/package.json +2 -0
  162. package/node_modules/@local/vibe64-execution/src/host/execHelper.js +693 -705
  163. package/node_modules/@local/vibe64-genesis/README.md +4 -2
  164. package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +122 -116
  165. package/node_modules/@local/vibe64-genesis/src/server/index.js +482 -478
  166. package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +39 -38
  167. package/node_modules/@local/vibe64-terminals/src/server/launchPreviewBridgeScript.txt +63 -0
  168. package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +264 -265
  169. package/package.json +14 -14
  170. package/server.bundle.mjs +33866 -33770
  171. package/dist/assets/GithubBrowserTabs-__1ieC1c.js.br +0 -0
  172. package/dist/assets/GithubBrowserTabs-__1ieC1c.js.gz +0 -0
  173. package/dist/assets/LocalDatabaseServer-dK29B76L.js.br +0 -0
  174. package/dist/assets/LocalDatabaseServer-dK29B76L.js.gz +0 -0
  175. package/dist/assets/Vibe64DashboardPageHeader-DH1YCSF1.js.br +0 -0
  176. package/dist/assets/Vibe64DashboardPageHeader-DH1YCSF1.js.gz +0 -0
  177. package/dist/assets/Vibe64DatabaseWorkspace-csnEOYGD.js.br +0 -0
  178. package/dist/assets/Vibe64DatabaseWorkspace-csnEOYGD.js.gz +0 -0
  179. package/dist/assets/Vibe64FileArea-CeiAmwiT.js.br +0 -0
  180. package/dist/assets/Vibe64FileArea-CeiAmwiT.js.gz +0 -0
  181. package/dist/assets/Vibe64OutputControls-nFkMTVFI.js.br +0 -0
  182. package/dist/assets/Vibe64OutputControls-nFkMTVFI.js.gz +0 -0
  183. package/dist/assets/Vibe64RepositoryWorkspace-BcGZsRIF.js.br +0 -0
  184. package/dist/assets/Vibe64RepositoryWorkspace-BcGZsRIF.js.gz +0 -0
  185. package/dist/assets/Vibe64SessionFiles-BrNoYV6c.js.br +0 -0
  186. package/dist/assets/Vibe64SessionFiles-BrNoYV6c.js.gz +0 -0
  187. package/dist/assets/Vibe64SessionSourceEditor-Pz9DR_lm.js.br +0 -0
  188. package/dist/assets/Vibe64SessionSourceEditor-Pz9DR_lm.js.gz +0 -0
  189. package/dist/assets/Vibe64UiStoryboardView-D8Z-WkVp.js.br +0 -0
  190. package/dist/assets/Vibe64UiStoryboardView-D8Z-WkVp.js.gz +0 -0
  191. package/dist/assets/_sessionId_-DI83WzOB.js.br +0 -0
  192. package/dist/assets/_sessionId_-DI83WzOB.js.gz +0 -0
  193. package/dist/assets/access-CD1NLU2z.js.br +0 -0
  194. package/dist/assets/access-CD1NLU2z.js.gz +0 -0
  195. package/dist/assets/app-NJHCyI2M.js.br +0 -0
  196. package/dist/assets/app-NJHCyI2M.js.gz +0 -0
  197. package/dist/assets/client-B5-KiJ_k.js.br +0 -0
  198. package/dist/assets/client-B5-KiJ_k.js.gz +0 -0
  199. package/dist/assets/client-DHAysNQ_.js.br +0 -0
  200. package/dist/assets/client-DHAysNQ_.js.gz +0 -0
  201. package/dist/assets/english-definitions-jEDFqPtl.js.br +0 -0
  202. package/dist/assets/env-CuVAcxrg.js.br +0 -0
  203. package/dist/assets/env-CuVAcxrg.js.gz +0 -0
  204. package/dist/assets/error-vtsBf2sc.js.br +0 -0
  205. package/dist/assets/error-vtsBf2sc.js.gz +0 -0
  206. package/dist/assets/fileTypes-BtIfp_s4.js.br +0 -0
  207. package/dist/assets/fileTypes-BtIfp_s4.js.gz +0 -0
  208. package/dist/assets/health-hZ8hCq4g.js.br +0 -0
  209. package/dist/assets/health-hZ8hCq4g.js.gz +0 -0
  210. package/dist/assets/history-BUD8OO2u.js.br +0 -0
  211. package/dist/assets/history-BUD8OO2u.js.gz +0 -0
  212. package/dist/assets/index-DW2-Y5r1.js.br +0 -0
  213. package/dist/assets/index-DW2-Y5r1.js.gz +0 -0
  214. package/dist/assets/integrations-mJUuC1tA.js.br +0 -0
  215. package/dist/assets/integrations-mJUuC1tA.js.gz +0 -0
  216. package/dist/assets/integrations-sQuGZtOl.css +0 -1
  217. package/dist/assets/integrations-sQuGZtOl.css.br +0 -0
  218. package/dist/assets/integrations-sQuGZtOl.css.gz +0 -0
  219. package/dist/assets/issues-D6TrPRr_.js.br +0 -0
  220. package/dist/assets/issues-D6TrPRr_.js.gz +0 -0
  221. package/dist/assets/pages-cUFHVIQj.js.br +0 -1
  222. package/dist/assets/pages-cUFHVIQj.js.gz +0 -0
  223. package/dist/assets/project-D45_Rd6Y.js.br +0 -0
  224. package/dist/assets/project-D45_Rd6Y.js.gz +0 -0
  225. package/dist/assets/project-DTGwAgqm.css.br +0 -0
  226. package/dist/assets/project-DTGwAgqm.css.gz +0 -0
  227. package/dist/assets/project-files-DgvpUk1M.js.br +0 -0
  228. package/dist/assets/project-files-DgvpUk1M.js.gz +0 -0
  229. package/dist/assets/project-shared-ShellOutlet-eIh5yfRJ.js.br +0 -0
  230. package/dist/assets/project-shared-ShellOutlet-eIh5yfRJ.js.gz +0 -0
  231. package/dist/assets/project-shared-VBottomSheet-XWVEiPmQ.js.br +0 -0
  232. package/dist/assets/project-shared-VBottomSheet-XWVEiPmQ.js.gz +0 -0
  233. package/dist/assets/project-shared-VToolbar-DKJZQDcP.js.br +0 -0
  234. package/dist/assets/project-shared-VToolbar-DKJZQDcP.js.gz +0 -0
  235. package/dist/assets/project-shared-pageNames-CWXyQBuT.js.br +0 -0
  236. package/dist/assets/project-shared-pageNames-CWXyQBuT.js.gz +0 -0
  237. package/dist/assets/publish-BKAvPixQ.js.br +0 -0
  238. package/dist/assets/publish-BKAvPixQ.js.gz +0 -0
  239. package/dist/assets/pull-requests-DycdPcXY.js.br +0 -0
  240. package/dist/assets/pull-requests-DycdPcXY.js.gz +0 -0
  241. package/dist/assets/session-B4iZufWI.js.br +0 -0
  242. package/dist/assets/session-B4iZufWI.js.gz +0 -0
  243. package/dist/assets/settings-BrO7TeLW.js.br +0 -0
  244. package/dist/assets/settings-BrO7TeLW.js.gz +0 -0
  245. package/dist/assets/useArchivedVibe64Sessions-DdavJ9tr.js.br +0 -0
  246. package/dist/assets/useArchivedVibe64Sessions-DdavJ9tr.js.gz +0 -0
  247. package/dist/assets/vibe64SavedEnvValues-YEXrs2xe.js +0 -1
  248. package/dist/assets/vue-flow-core-DzmtR5x-.js.br +0 -0
  249. package/dist/assets/vue-flow-core-DzmtR5x-.js.gz +0 -0
  250. /package/dist/assets/{publish-BIY5aZgD.css → packages-BIY5aZgD.css} +0 -0
  251. /package/dist/assets/{publish-BIY5aZgD.css.br → packages-BIY5aZgD.css.br} +0 -0
  252. /package/dist/assets/{publish-BIY5aZgD.css.gz → packages-BIY5aZgD.css.gz} +0 -0
@@ -5,108 +5,108 @@ workspace-setup",VIBE64_OUTPUTS_INVALID:"outputs",VIBE64_DEPLOYMENT_INVALID:"dep
5
5
  ging",VIBE64_RESOURCE_ESTIMATES_INVALID:"resource-estimates",VIBE64_CONNECTED_DEVELOPMENT_INVALID:"connected-development",
6
6
  VIBE64_PROJECT_SERVICES_INVALID:"project-services",VIBE64_INTEGRATION_SETUP_INVALID:"integration-setup",VIBE64_ARCHITECTURE_INSPECTION_INVALID:"\
7
7
  architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),ls=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
8
- function ds(e,t){let n=bt[e],s=String(t).replace(ls,"");return n?`${s} Exact grammar: vibe64-helper spec ${n}.`:s}function R(e,t,n){
9
- return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}.`}function m(e,t,n,s,r={}){throw new Ee(e,ds(e,n),{path:t,...s===
10
- void 0?{}:{line:s},...r})}function y(e,t,n,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&m(t,n,`${s} \
11
- must be one non-empty line.`,r),e.trim()}function ms(e){let t=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return t.length===
12
- 0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function b(e,t,n,s,r,i={}){let{count:o,maximum:c=64}=i,a=ms(e);if(!a||
8
+ function ds(e,t){let n=bt[e],s=String(t).replace(ls,"");return n?`${s} Exact grammar: vibe64-helper spec ${n}.`:s}function k(e,t,n){
9
+ return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}.`}function m(e,t,n,s,i={}){throw new Ee(e,ds(e,n),{path:t,...s===
10
+ void 0?{}:{line:s},...i})}function y(e,t,n,s,i){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&m(t,n,`${s} \
11
+ must be one non-empty line.`,i),e.trim()}function ms(e){let t=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return t.length===
12
+ 0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function b(e,t,n,s,i,r={}){let{count:o,maximum:c=64}=r,a=ms(e);if(!a||
13
13
  a.length>c||o!==void 0&&a.length!==o||a.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=o===void 0?"separate non-empt\
14
- y":`exactly ${o}`;m(t,n,`${s} must contain ${u} backticked ${o===1?"value":"values"}.`,r)}return a}function hs(e=""){return typeof e==
15
- "string"&&!!e&&!/[\s\0{}]/u.test(e)&&!He.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function D(e,t,n,s,r){let i=b(
16
- e,t,n,s,r);return hs(i[0])||m(t,n,`${s} must begin with a safe executable.`,r),i}function fs(e=""){return typeof e=="str\
14
+ y":`exactly ${o}`;m(t,n,`${s} must contain ${u} backticked ${o===1?"value":"values"}.`,i)}return a}function hs(e=""){return typeof e==
15
+ "string"&&!!e&&!/[\s\0{}]/u.test(e)&&!He.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function D(e,t,n,s,i){let r=b(
16
+ e,t,n,s,i);return hs(r[0])||m(t,n,`${s} must begin with a safe executable.`,i),r}function fs(e=""){return typeof e=="str\
17
17
  ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!He.posix.isAbsolute(e)&&He.posix.normalize(e)===e&&!e.split("/").some(t=>!t||t==="..")}
18
- function w(e,t,n,s,r,i={}){let{allowRoot:o=!0}=i;return(!fs(e)||!o&&e===".")&&m(t,n,`${s} must be a canonical project-re\
19
- lative path.`,r),e}function ve(e,t,n,s,r){let i=b(e,t,n,s,r);return i.some(o=>o.startsWith("/")||o.includes("\\")||o.includes(
18
+ function w(e,t,n,s,i,r={}){let{allowRoot:o=!0}=r;return(!fs(e)||!o&&e===".")&&m(t,n,`${s} must be a canonical project-re\
19
+ lative path.`,i),e}function ve(e,t,n,s,i){let r=b(e,t,n,s,i);return r.some(o=>o.startsWith("/")||o.includes("\\")||o.includes(
20
20
  "***")||/[?[\]{}!]/u.test(o)||o.split("/").some(c=>!c||[".",".."].includes(c)))&&m(t,n,`${s} must be canonical project-r\
21
- elative globs using only * and ** wildcards.`,r),new Set(i).size!==i.length&&m(t,n,`${s} must name each path once.`,r),i}
22
- function P(e,t,n,s,r){let i=b(e,t,n,s,r);return i.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&m(t,n,`${s} must use \
23
- lowercase technology ids separated into backticked values.`,r),new Set(i).size!==i.length&&m(t,n,`${s} contains a duplic\
24
- ate technology id.`,r),i}function Fe(e,t,n,s,r){let i=y(e,t,n,s,r);return(!i.startsWith("/")||i.startsWith("//")||/[\\?#]/u.
25
- test(i))&&m(t,n,`${s} must begin with one slash and contain no query or fragment.`,r),i}function oe(e,t,n,s,r){let i=e.match(
26
- /^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);i||m(t,n,`${s} must use \`- Ready when: \`GET\` \`/path\` return\
27
- s \`200\`\`.`,r);let o=Number(i[2]);return(!Number.isInteger(o)||o<200||o>399)&&m(t,n,`${s} status must be from 200 thro\
28
- ugh 399.`,r),{kind:"http",method:"GET",path:Fe(i[1],t,n,`${s} path`,r),status:o}}var gs=/^with (.+?):[ \t]+(.+)$/u,Es=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,
29
- vs=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,bs=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;function be(e,t,n,s,r,{form:i,observed:o=e}){
30
- let c=String(e||"").match(gs);c||m(t,n,`Every ${s} entry must use: ${i}`,r,{observed:o});let a=c[1].match(Es),u=a?null:c[1].
31
- match(vs),p=a?a[1]:u?u[1]:c[1],d=a?.[2]||u?.[2]||"",l=p.match(bs);return{argv:D(c[2],t,n,`${s} command`,r),runtimeRequirements:P(
32
- l?l[1]:p,t,n,`${s} runtimes`,r),workdir:w(l?l[2]:".",t,n,`${s} workdir`,r),...d?{condition:{pathExists:w(d,t,n,`${s} con\
33
- dition path`,r,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function ze(e){return Array.isArray(e)?e.map(ze):e&&typeof e==
21
+ elative globs using only * and ** wildcards.`,i),new Set(r).size!==r.length&&m(t,n,`${s} must name each path once.`,i),r}
22
+ function P(e,t,n,s,i){let r=b(e,t,n,s,i);return r.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&m(t,n,`${s} must use \
23
+ lowercase technology ids separated into backticked values.`,i),new Set(r).size!==r.length&&m(t,n,`${s} contains a duplic\
24
+ ate technology id.`,i),r}function Fe(e,t,n,s,i){let r=y(e,t,n,s,i);return(!r.startsWith("/")||r.startsWith("//")||/[\\?#]/u.
25
+ test(r))&&m(t,n,`${s} must begin with one slash and contain no query or fragment.`,i),r}function ae(e,t,n,s,i){let r=e.match(
26
+ /^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);r||m(t,n,`${s} must use \`- Ready when: \`GET\` \`/path\` return\
27
+ s \`200\`\`.`,i);let o=Number(r[2]);return(!Number.isInteger(o)||o<200||o>399)&&m(t,n,`${s} status must be from 200 thro\
28
+ ugh 399.`,i),{kind:"http",method:"GET",path:Fe(r[1],t,n,`${s} path`,i),status:o}}var gs=/^with (.+?):[ \t]+(.+)$/u,Es=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,
29
+ vs=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,bs=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;function be(e,t,n,s,i,{form:r,observed:o=e}){
30
+ let c=String(e||"").match(gs);c||m(t,n,`Every ${s} entry must use: ${r}`,i,{observed:o});let a=c[1].match(Es),u=a?null:c[1].
31
+ match(vs),p=a?a[1]:u?u[1]:c[1],d=a?.[2]||u?.[2]||"",l=p.match(bs);return{argv:D(c[2],t,n,`${s} command`,i),runtimeRequirements:P(
32
+ l?l[1]:p,t,n,`${s} runtimes`,i),workdir:w(l?l[2]:".",t,n,`${s} workdir`,i),...d?{condition:{pathExists:w(d,t,n,`${s} con\
33
+ dition path`,i,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function ze(e){return Array.isArray(e)?e.map(ze):e&&typeof e==
34
34
  "object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,ze(e[t])])):e}function N(e){let t=`${JSON.stringify(ze(e),null,
35
35
  2)}
36
36
  `;return`sha256:${ps("sha256").update(t).digest("hex")}`}function z(e={},t={},n="operation"){if(e.stackHash!==t.stackHash)
37
37
  throw new Ee("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${n}. Retry the operation.`)}function F(e=[]){
38
38
  return[...new Set(e)].sort()}function S(e=[]){let t=e.map(n=>n.trim()).filter(Boolean);return t.length===1&&t[0]==="- No\
39
- thing."}var mo=Object.freeze({SPEC_BY_ERROR_CODE:bt});var ys="custom";var ws=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
39
+ thing."}var ho=Object.freeze({SPEC_BY_ERROR_CODE:bt});var ys="custom";var ws=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
40
40
  (PHP)"}),Object.freeze({value:"pip",label:"pip (Python)"}),Object.freeze({value:"bundler",label:"Bundler (Ruby)"}),Object.
41
41
  freeze({value:"gomod",label:"Go modules"}),Object.freeze({value:"cargo",label:"Cargo (Rust)"}),Object.freeze({value:"mav\
42
42
  en",label:"Maven"}),Object.freeze({value:"gradle",label:"Gradle"}),Object.freeze({value:"nuget",label:"NuGet (.NET)"}),Object.
43
- freeze({value:ys,label:"custom"})]);var yt=Object.freeze(ws.map(e=>e.value));function wt(e){return typeof e=="string"&&yt.includes(e)}function St(e="or"){let t=yt;return`${t.slice(0,-1).join(", ")} ${e} ${t.at(-1)}`}var _t="Connected development",Ss="vibe64.connected-development.v1",x="VIBE64_CONNECTED_DEVELOPMENT_INVALID",V="genesis/\
43
+ freeze({value:ys,label:"custom"})]);var yt=Object.freeze(ws.map(e=>e.value));function wt(e){return typeof e=="string"&&yt.includes(e)}function St(e="or"){let t=yt;return`${t.slice(0,-1).join(", ")} ${e} ${t.at(-1)}`}var _t="Connected development",Ss="vibe64.connected-development.v1",x="VIBE64_CONNECTED_DEVELOPMENT_INVALID",L="genesis/\
44
44
  stack.md#Connected development",qe="with `runtime` [in `workdir`]: `command` `argument`...",It=Object.freeze({Prepare:`-\
45
45
  Prepare \`label\` ${qe}`,Verify:`- Verify \`label\` ${qe}`,"Custom runner":`- Custom runner ${qe}`}),_s=Object.freeze([
46
46
  "- Default package type: `type`","- Sources file: `path`",...Object.values(It)]),Is=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
47
- Ts=/^- Custom runner (.+)$/u,Os="Custom connected source";function Tt(e={}){let t="",n="",s=null,r=[],i=[...e.diagnostics||
47
+ Ts=/^- Custom runner (.+)$/u,Os="Custom connected source";function Tt(e={}){let t="",n="",s=null,i=[],r=[...e.diagnostics||
48
48
  []],o=e.status==="ready";if(o&&!S(e.lines)){let a=!1;for(let[p,d]of e.lines.entries()){let l=d.trim();if(!l)continue;let g=p+
49
- 1,E=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(E){n&&m(x,V,"Declare exactly one default package type.",g),wt(
50
- E[1])||m(x,V,`Default package type must be ${St()}.`,g),n=E[1];continue}let _=l.match(/^- Sources file: `([^`\r\n]+)`$/u);
51
- if(_){t&&m(x,V,"Declare exactly one Sources file.",g),t=w(_[1],x,V,"Connected sources file",g,{allowRoot:!1}),t.split("/").
52
- some(us=>us.toLowerCase()===".git")&&m(x,V,"The Sources file must be outside Git metadata.",g);continue}let k=l.match(Ts),
53
- $=k?null:l.match(Is);!k&&!$&&m(x,V,R("Connected development entry",l,_s),g);let X=k?"Custom runner":$[1],re=X==="Verify"?
54
- "verify":"prepare";!k&&a&&re==="prepare"&&m(x,V,"All Prepare entries must precede Verify entries.",g),a||=!k&&re==="veri\
55
- fy";let Be={label:k?Os:y($[2],x,V,`Connected development ${X} label`,g),...be(k?k[1]:$[3],x,V,`Connected development ${X}`,
56
- g,{form:It[X],observed:l})};Be.condition&&m(x,V,"Connected development steps must run unconditionally; a skipped step ca\
57
- nnot prove source consumption.",g),k?(s&&m(x,V,"Declare exactly one Custom runner.",g),s=Be):r.push({...Be,phase:re})}!(n&&
58
- !t&&!r.length&&!s)&&(!t||!r.some(p=>p.phase==="verify")&&!s)&&m(x,V,"Declare a default package type alone, or a Sources \
59
- file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let c=e.status==="blocked"||i.length?
60
- "blocked":r.length||s?"ready":"unconfigured";return{contract:Ss,declared:o,status:c,stackHash:e.stackHash,recipeHash:c===
61
- "ready"?N({version:1,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:r}):"",components:[...e.components||[]],source:e.
62
- source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:r,runtimeRequirements:F([...r,...s?[s]:[]].flatMap(
63
- a=>a.runtimeRequirements)),diagnostics:i}}import{lstat as ks,open as Rs,realpath as Ye,stat as As}from"node:fs/promises";import{constants as Ot}from"node:fs";import kt from"node:path";var Ns="vibe64.architecture-inspection.v1",At="Architecture inspection",T="VIBE64_ARCHITECTURE_INSPECTION_INVALID",ye="g\
64
- enesis/stack.md#Architecture inspection",Nt=120,Ct=64*1024*1024,Rt=64*1024,Cs=Object.freeze(["runtimeRequirements","work\
49
+ 1,E=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(E){n&&m(x,L,"Declare exactly one default package type.",g),wt(
50
+ E[1])||m(x,L,`Default package type must be ${St()}.`,g),n=E[1];continue}let _=l.match(/^- Sources file: `([^`\r\n]+)`$/u);
51
+ if(_){t&&m(x,L,"Declare exactly one Sources file.",g),t=w(_[1],x,L,"Connected sources file",g,{allowRoot:!1}),t.split("/").
52
+ some(us=>us.toLowerCase()===".git")&&m(x,L,"The Sources file must be outside Git metadata.",g);continue}let R=l.match(Ts),
53
+ $=R?null:l.match(Is);!R&&!$&&m(x,L,k("Connected development entry",l,_s),g);let X=R?"Custom runner":$[1],oe=X==="Verify"?
54
+ "verify":"prepare";!R&&a&&oe==="prepare"&&m(x,L,"All Prepare entries must precede Verify entries.",g),a||=!R&&oe==="veri\
55
+ fy";let Be={label:R?Os:y($[2],x,L,`Connected development ${X} label`,g),...be(R?R[1]:$[3],x,L,`Connected development ${X}`,
56
+ g,{form:It[X],observed:l})};Be.condition&&m(x,L,"Connected development steps must run unconditionally; a skipped step ca\
57
+ nnot prove source consumption.",g),R?(s&&m(x,L,"Declare exactly one Custom runner.",g),s=Be):i.push({...Be,phase:oe})}!(n&&
58
+ !t&&!i.length&&!s)&&(!t||!i.some(p=>p.phase==="verify")&&!s)&&m(x,L,"Declare a default package type alone, or a Sources \
59
+ file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let c=e.status==="blocked"||r.length?
60
+ "blocked":i.length||s?"ready":"unconfigured";return{contract:Ss,declared:o,status:c,stackHash:e.stackHash,recipeHash:c===
61
+ "ready"?N({version:1,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:i}):"",components:[...e.components||[]],source:e.
62
+ source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:i,runtimeRequirements:F([...i,...s?[s]:[]].flatMap(
63
+ a=>a.runtimeRequirements)),diagnostics:r}}import{lstat as Rs,open as ks,realpath as Ye,stat as As}from"node:fs/promises";import{constants as Ot}from"node:fs";import Rt from"node:path";var Ns="vibe64.architecture-inspection.v1",At="Architecture inspection",T="VIBE64_ARCHITECTURE_INSPECTION_INVALID",ye="g\
64
+ enesis/stack.md#Architecture inspection",Nt=120,Ct=64*1024*1024,kt=64*1024,Cs=Object.freeze(["runtimeRequirements","work\
65
65
  dir","argv","timeout","maxBuffer"]),Ke=Object.freeze({Runtime:["runtimeRequirements","`runtime`..."],Directory:["workdir",
66
66
  "`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${Nt}\``],"Max output\
67
67
  bytes":["maxBuffer",`\`1\` through \`${Ct}\``],"Entry files":["entryFiles","`path`... (optional)"],"Required files":["r\
68
68
  equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),Ds=new RegExp(
69
69
  `^- (${Object.keys(Ke).join("|")}): (.+)$`,"u");function Dt(e,t={}){let{path:n=ye}=t;if(Array.isArray(e)||m(T,n,"Archite\
70
- cture inspection requires exact Stack section lines."),S(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let c of Cs)
71
- i[c]===void 0&&m(T,n,`${i.id} is missing ${c}.`);s.push(i),i=null}}for(let[c,a]of e.entries()){let u=a.trim();if(!u)continue;
72
- let p=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(p){o(),r.has(p[1])&&m(T,n,"Duplicate inspector i\
73
- d.",c+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||m(T,n,"Expected an Inspector heading.",c+1);let d=u.match(Ds);if(!d){
70
+ cture inspection requires exact Stack section lines."),S(e))return[];let s=[],i=new Set,r;function o(){if(r){for(let c of Cs)
71
+ r[c]===void 0&&m(T,n,`${r.id} is missing ${c}.`);s.push(r),r=null}}for(let[c,a]of e.entries()){let u=a.trim();if(!u)continue;
72
+ let p=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(p){o(),i.has(p[1])&&m(T,n,"Duplicate inspector i\
73
+ d.",c+1),i.add(p[1]),r={id:p[1],title:p[2]};continue}r||m(T,n,"Expected an Inspector heading.",c+1);let d=u.match(Ds);if(!d){
74
74
  let g=Object.entries(Ke).map(([E,[,_]])=>`- ${E}: ${_}`).join("; ");m(T,n,`Unknown architecture inspector field. Use one\
75
- of: ${g}.`,c+1)}let[l]=Ke[d[1]];if(i[l]!==void 0&&m(T,n,`Duplicate ${d[1]}.`,c+1),l==="runtimeRequirements")i[l]=P(d[2],
76
- T,n,"Inspector runtime",c+1);else if(l==="argv")i[l]=D(d[2],T,n,"Inspector command",c+1);else if(l==="entryFiles"||l==="\
77
- requiredFiles")i[l]=b(d[2],T,n,d[1],c+1).map(g=>w(g,T,n,d[1],c+1));else{let[g]=b(d[2],T,n,d[1],c+1,{count:1});if(l==="wo\
78
- rkdir")i[l]=w(g,T,n,"Inspector directory",c+1);else if(l==="previewLocator")i[l]=Pt(g,n,c+1);else{let E=Number(g),_=l===
75
+ of: ${g}.`,c+1)}let[l]=Ke[d[1]];if(r[l]!==void 0&&m(T,n,`Duplicate ${d[1]}.`,c+1),l==="runtimeRequirements")r[l]=P(d[2],
76
+ T,n,"Inspector runtime",c+1);else if(l==="argv")r[l]=D(d[2],T,n,"Inspector command",c+1);else if(l==="entryFiles"||l==="\
77
+ requiredFiles")r[l]=b(d[2],T,n,d[1],c+1).map(g=>w(g,T,n,d[1],c+1));else{let[g]=b(d[2],T,n,d[1],c+1,{count:1});if(l==="wo\
78
+ rkdir")r[l]=w(g,T,n,"Inspector directory",c+1);else if(l==="previewLocator")r[l]=Pt(g,n,c+1);else{let E=Number(g),_=l===
79
79
  "timeout"?Nt:Ct;(!/^[1-9][0-9]*$/u.test(g)||!Number.isSafeInteger(E)||E>_)&&m(T,n,`${d[1]} must be from 1 to ${_}.`,c+1),
80
- i[l]=l==="timeout"?E*1e3:E}}}return o(),s.length||m(T,n,"Use an Inspector entry or - Nothing."),s}function Pt(e,t,n){return w(
80
+ r[l]=l==="timeout"?E*1e3:E}}}return o(),s.length||m(T,n,"Use an Inspector entry or - Nothing."),s}function Pt(e,t,n){return w(
81
81
  e,T,t,"Preview locator",n,{allowRoot:!1}),e.endsWith(".js")||m(T,t,"Preview locator must name a .js file.",n),e}function Ps(e,t){
82
82
  return e[t-1]==="node_modules"&&!e[t].startsWith("@")||e[t-2]==="node_modules"&&e[t-1].startsWith("@")}async function $s(e,t){
83
- Pt(t,ye);let n=i=>m(T,ye,`Preview locator \`${t}\` ${i}.`),s=t.split("/"),r;try{let i=await Ye(e),o=i,c=!1;for(let[u,p]of s.
84
- entries())o=kt.join(o,p),(await ks(o)).isSymbolicLink()&&((c||u===s.length-1||!Ps(s,u))&&n("must not be or pass through \
85
- a symlink"),o=i=await Ye(o),(await As(i)).isDirectory()||n("links a package that is not a folder"),c=!0);(await Ye(o)!==
86
- o||!o.startsWith(`${i}${kt.sep}`))&&n("must not be or pass through a symlink"),r=await Rs(o,Ot.O_RDONLY|Ot.O_NOFOLLOW);let a=await r.
87
- stat();return a.isFile()||n("must be a regular file"),a.size>Rt&&n(`must be at most ${Rt} bytes`),{path:t,source:await r.
88
- readFile("utf8")}}catch(i){throw(i?.code==="ENOENT"||i?.code==="ENOTDIR")&&n("is not a file in this project"),i?.code===
89
- "ELOOP"&&n("must not be or pass through a symlink"),i}finally{await r?.close()}}function $t(e){let t=e.status==="ready"?
83
+ Pt(t,ye);let n=r=>m(T,ye,`Preview locator \`${t}\` ${r}.`),s=t.split("/"),i;try{let r=await Ye(e),o=r,c=!1;for(let[u,p]of s.
84
+ entries())o=Rt.join(o,p),(await Rs(o)).isSymbolicLink()&&((c||u===s.length-1||!Ps(s,u))&&n("must not be or pass through \
85
+ a symlink"),o=r=await Ye(o),(await As(r)).isDirectory()||n("links a package that is not a folder"),c=!0);(await Ye(o)!==
86
+ o||!o.startsWith(`${r}${Rt.sep}`))&&n("must not be or pass through a symlink"),i=await ks(o,Ot.O_RDONLY|Ot.O_NOFOLLOW);let a=await i.
87
+ stat();return a.isFile()||n("must be a regular file"),a.size>kt&&n(`must be at most ${kt} bytes`),{path:t,source:await i.
88
+ readFile("utf8")}}catch(r){throw(r?.code==="ENOENT"||r?.code==="ENOTDIR")&&n("is not a file in this project"),r?.code===
89
+ "ELOOP"&&n("must not be or pass through a symlink"),r}finally{await i?.close()}}function $t(e){let t=e.status==="ready"?
90
90
  Dt(e.lines):[];for(let n of t)n.runtimeRequirements.some(s=>!e.components.includes(s))&&m(T,ye,"Inspector runtimes must \
91
91
  be selected in Stack.");return{contract:Ns,status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:N(t),diagnostics:e.
92
- diagnostics||[]}}var _o=Object.freeze({parseVibe64ArchitectureInspectionLines:Dt});var xs="vibe64.architecture-layout.v1",xt="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Xe=Object.freeze(
93
- ["layer","libraries","support"]);function Vt(e,t={}){let{path:n="genesis/stack.md#Architecture layout"}=t;if(Array.isArray(
94
- e)||m(U,n,"Expected exact Stack section lines."),S(e))return[];let s=[],r=new Set,i=new Set,o;function c(){o&&((!o.kind||
92
+ diagnostics||[]}}var Io=Object.freeze({parseVibe64ArchitectureInspectionLines:Dt});var xs="vibe64.architecture-layout.v1",xt="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Xe=Object.freeze(
93
+ ["layer","libraries","support"]);function Lt(e,t={}){let{path:n="genesis/stack.md#Architecture layout"}=t;if(Array.isArray(
94
+ e)||m(U,n,"Expected exact Stack section lines."),S(e))return[];let s=[],i=new Set,r=new Set,o;function c(){o&&((!o.kind||
95
95
  !o.purpose||!o.subsystems.length)&&m(U,n,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[a,
96
96
  u]of e.entries()){let p=u.trim();if(!p)continue;let d=p.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(d){c(),
97
- r.has(d[1])&&m(U,n,"Duplicate group id.",a+1),r.add(d[1]),o={id:d[1],title:d[2],subsystems:[]};continue}let l=p.match(/^- (Kind|Purpose|Subsystem): (.+)$/u);
97
+ i.has(d[1])&&m(U,n,"Duplicate group id.",a+1),i.add(d[1]),o={id:d[1],title:d[2],subsystems:[]};continue}let l=p.match(/^- (Kind|Purpose|Subsystem): (.+)$/u);
98
98
  (!o||!l)&&m(U,n,"Expected a Group heading or Kind, Purpose, Subsystem field.",a+1);let g=b(l[2],U,n,l[1],a+1,{count:1});
99
- if(l[1]==="Subsystem"){let E=w(g[0],U,n,"Subsystem root",a+1);i.has(E)&&m(U,n,"Each directory root may be placed only on\
100
- ce.",a+1),i.add(E),o.subsystems.push({root:E})}else{let E=l[1].toLowerCase();o[E]!==void 0&&m(U,n,`Duplicate ${l[1]}.`,a+
99
+ if(l[1]==="Subsystem"){let E=w(g[0],U,n,"Subsystem root",a+1);r.has(E)&&m(U,n,"Each directory root may be placed only on\
100
+ ce.",a+1),r.add(E),o.subsystems.push({root:E})}else{let E=l[1].toLowerCase();o[E]!==void 0&&m(U,n,`Duplicate ${l[1]}.`,a+
101
101
  1),E==="kind"&&!Xe.includes(g[0])&&m(U,n,`Kind must be ${Xe.slice(0,-1).join(", ")} or ${Xe.at(-1)}.`,a+1),o[E]=g[0]}}return c(),
102
- s.length||m(U,n,"Use a Group entry or - Nothing."),s}function Lt(e){return{contract:xs,status:e.status,stackHash:e.stackHash,
103
- groups:e.status==="ready"?Vt(e.lines):[],diagnostics:e.diagnostics||[]}}var Oo=Object.freeze({parseVibe64ArchitectureLayoutLines:Vt});import{existsSync as es}from"node:fs";import{readFile as Sr}from"node:fs/promises";import{createRequire as _r}from"node:module";
104
- import W from"node:path";var Vs="STACK_PROJECT_CONTRACTS_INCOMPLETE",Mt="STACK_SECTION_AMBIGUOUS",Ls=Object.freeze([Vs,Mt]);function Ms(e){return Ls.
102
+ s.length||m(U,n,"Use a Group entry or - Nothing."),s}function Vt(e){return{contract:xs,status:e.status,stackHash:e.stackHash,
103
+ groups:e.status==="ready"?Lt(e.lines):[],diagnostics:e.diagnostics||[]}}var Ro=Object.freeze({parseVibe64ArchitectureLayoutLines:Lt});import{existsSync as es}from"node:fs";import{readFile as _r}from"node:fs/promises";import{createRequire as Ir}from"node:module";
104
+ import W from"node:path";var Ls="STACK_PROJECT_CONTRACTS_INCOMPLETE",Mt="STACK_SECTION_AMBIGUOUS",Vs=Object.freeze([Ls,Mt]);function Ms(e){return Vs.
105
105
  includes(String(e?.code||"").trim())}var Je="genesis/stack.md",js=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function Gs(e){
106
106
  return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!js.some(t=>String(e.code).startsWith(t))}function Us(e){
107
- let{path:t="",line:n,observed:s}=e.details||{},r=Number.isSafeInteger(n)?` (line ${n}${t===Je?" of its section":""})`:"",
108
- i=t&&(r||!e.message.includes(t))?`${t}${r}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${i}${e.message}${o}`}import*as ge from"genesis-compiler";import{randomUUID as Js}from"node:crypto";import{mkdir as Zs,mkdtemp as Qs,readFile as ei,rename as ti,rm as Bt,writeFile as ni}from"node:fs/promises";
109
- import si from"node:os";import Qe from"node:path";function L(e){return String(e||"").trim()}var Ws=Object.freeze(["main","temporary"]),jt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
107
+ let{path:t="",line:n,observed:s}=e.details||{},i=Number.isSafeInteger(n)?` (line ${n}${t===Je?" of its section":""})`:"",
108
+ r=t&&(i||!e.message.includes(t))?`${t}${i}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${r}${e.message}${o}`}import*as ge from"genesis-compiler";import{randomUUID as Js}from"node:crypto";import{mkdir as Zs,mkdtemp as Qs,readFile as ei,rename as ti,rm as Bt,writeFile as ni}from"node:fs/promises";
109
+ import si from"node:os";import Qe from"node:path";function V(e){return String(e||"").trim()}var Ws=Object.freeze(["main","temporary"]),jt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
110
110
  "managedPreview"]),Gt=Object.freeze(["managedPages"]),Bs=64*1024,Hs=Object.freeze(["When user input is necessary, ask no\
111
111
  more than three concise, high-impact questions at once.","Put multiple questions on separate lines as `[1] Question`, `\
112
112
  [2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answers:` and a short bullet list dir\
@@ -218,8 +218,8 @@ nd key names, never their values, and claim success only when the command succee
218
218
  eds generated (such as an application key) by generating it with the framework's own generator and piping it to `vibe64-\
219
219
  helper env set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that file from E\
220
220
  nv."]);function Ut(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${t} must be an object.`);return e}
221
- function Ze(e,t,n){let s=new Set(t),r=Object.keys(e).filter(i=>!s.has(i));if(r.length>0)throw new TypeError(`${n} contai\
222
- ns unsupported fields: ${r.join(", ")}.`)}function Wt(e){if(Ze(e,["conversationKind","scope","session","hostGuidance"],"\
221
+ function Ze(e,t,n){let s=new Set(t),i=Object.keys(e).filter(r=>!s.has(r));if(i.length>0)throw new TypeError(`${n} contai\
222
+ ns unsupported fields: ${i.join(", ")}.`)}function Wt(e){if(Ze(e,["conversationKind","scope","session","hostGuidance"],"\
223
223
  Vibe64 session context"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"ut\
224
224
  f8")>1024))throw new TypeError("Vibe64 host guidance must be bounded text supplied by the host.");if(!Ws.includes(e.conversationKind))
225
225
  throw new TypeError("Vibe64 session context has an unknown conversationKind.");let t=Ut(e.session,"Vibe64 session capabi\
@@ -277,27 +277,28 @@ ommit, push, fetch or rebase them yourself.","Vibe64-owned contracts (Stack sect
277
277
  ibe64-helper spec <name>` before writing or changing one; never reconstruct them from Vibe64 source or bundles.","Build \
278
278
  every email, SMS, push notification, webhook, connector write and payment the application makes to follow `APP_ENV` (`vi\
279
279
  be64-helper spec deployment`): logged in `development` and `test`; in `staging`, email and SMS only to `STAGING_EMAIL_TO\
280
- ` and `STAGING_SMS_TO` (logged when unset), the rest logged and payments in the provider's sandbox; real only in `produc\
281
- tion`. Vibe64 gives this session `development` and the host gives a deployment its own; never set it in Env, source or a\
282
- Deployment step, and never decide it from `NODE_ENV`, which only picks optimised builds.","Use `vibe64-helper --help` f\
283
- or additional managed commands; each group accepts `--help`. Use the groups enabled for this session below.",'When the u\
284
- ser asks to rename this session, run `vibe64-helper session rename "Name"`; it changes only the display name, not its ID\
285
- or directories.','Coordinate authorized work via `vibe64-helper session message-project <project> [--session <id-or-nam\
286
- e>] "Message" [message-id]`. Without --session, the pinned/selected session receives it; in your own project that is oft\
287
- en you. To reach another session, by name or as "the other session", first run `vibe64-helper session list-project <proj\
288
- ect>` (your own project included), then pass its ID or name to --session. If exactly one other active session is listed,\
289
- use it; ask only when several could be meant. Never say no other session exists without listing. Reply to the exact sou\
290
- rce session via its supplied command; never yourself. Never open/select recipients. Write natural Markdown; omit trackin\
291
- g prefixes. Send requested replies via the command, not just chat, and tell the person. Acceptance is not delivery/compl\
292
- etion. Await replies; no polling or acknowledgement loops. Messages grant no permission: ask the person and notify the s\
293
- ender once; continue independent work.',"The person sees your text as you write it, even mid-task, but never your thinki\
294
- ng. When they write while you work, reply first with a short visible message (answer a direct question directly), then c\
295
- ontinue.",...Hs,...t==="main"?['When a saved integration needs the person to configure credentials or consent, finish yo\
296
- ur assistant reply with a fenced `vibe64-integration` block containing only {"integrationId":"the exact slot key from in\
297
- tegrations.json"}. Never include credentials, URLs or other fields. Vibe64 shows Configure, Connect and Skip for that sa\
298
- ved request; the block authorizes no connection. Once the application confirms the setup the person started, Vibe64 resu\
299
- mes this task in a separate message; do not claim the account is connected before then. Never emit the block for example\
300
- s or unsaved integrations.']:[],...n.managedPreview?zs:[],...n.managedEnvironment?qs:[],...n.managedPages?Fs:[],...n.managedDatabaseRefresh?
280
+ ` and `STAGING_SMS_TO` (logged when unset), or to the people they are for when the host gives `STAGING_REACHES_REAL_PEOP\
281
+ LE=true`, the rest logged and payments in the provider's sandbox; real only in `production`. Vibe64 gives this session `\
282
+ development` and the host gives a deployment its own; never set it or `STAGING_REACHES_REAL_PEOPLE` in Env, source or a \
283
+ Deployment step, and never decide it from `NODE_ENV`, which only picks optimised builds.","Use `vibe64-helper --help` fo\
284
+ r additional managed commands; each group accepts `--help`. Use the groups enabled for this session below.",'When the us\
285
+ er asks to rename this session, run `vibe64-helper session rename "Name"`; it changes only the display name, not its ID \
286
+ or directories.','Coordinate authorized work via `vibe64-helper session message-project <project> [--session <id-or-name\
287
+ >] "Message" [message-id]`. Without --session, the pinned/selected session receives it; in your own project that is ofte\
288
+ n you. To reach another session, by name or as "the other session", first run `vibe64-helper session list-project <proje\
289
+ ct>` (your own project included), then pass its ID or name to --session. If exactly one other active session is listed, \
290
+ use it; ask only when several could be meant. Never say no other session exists without listing. Reply to the exact sour\
291
+ ce session via its supplied command; never yourself. Never open/select recipients. Write natural Markdown; omit tracking\
292
+ prefixes. Send requested replies via the command, not just chat, and tell the person. Acceptance is not delivery/comple\
293
+ tion. Await replies; no polling or acknowledgement loops. Messages grant no permission: ask the person and notify the se\
294
+ nder once; continue independent work.',"The person sees your text as you write it, even mid-task, but never your thinkin\
295
+ g. When they write while you work, reply first with a short visible message (answer a direct question directly), then co\
296
+ ntinue.",...Hs,...t==="main"?['When a saved integration needs the person to configure credentials or consent, finish you\
297
+ r assistant reply with a fenced `vibe64-integration` block containing only {"integrationId":"the exact slot key from int\
298
+ egrations.json"}. Never include credentials, URLs or other fields. Vibe64 shows Configure, Connect and Skip for that sav\
299
+ ed request; the block authorizes no connection. Once the application confirms the setup the person started, Vibe64 resum\
300
+ es this task in a separate message; do not claim the account is connected before then. Never emit the block for examples\
301
+ or unsaved integrations.']:[],...n.managedPreview?zs:[],...n.managedEnvironment?qs:[],...n.managedPages?Fs:[],...n.managedDatabaseRefresh?
301
302
  ["After a database migration or schema change, run `vibe64-helper database refresh` once so Vibe64's Database view refle\
302
303
  cts it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for table rectangles, pins, routed co\
303
304
  nnections and metrics, then send a revision-checked batch of table moves on stdin to `vibe64-helper database erd apply -\
@@ -327,162 +328,165 @@ onse, its effects are unconfirmed: use a read-only check of the affected Git/Git
327
328
  ver claim that a comment was posted or not posted, or that a push succeeded or failed, from those errors alone. If verif\
328
329
  ication is unavailable, report the outcome as unknown and stop; do not repeat the write or claim a safe rollback."]:[]].
329
330
  join(`
330
- `)}function ae(e={}){let t=Ut(e,"Vibe64 driver input"),n=Ks(t);return n.scope==="session"?Xs(n):n.stableContext}async function Ht(e=""){let t=e||await Qs(Qe.join(si.tmpdir(),"vibe64-genesis-context-"));await Zs(t,{recursive:!0,mode:448});
331
- let n=Qe.join(t,"sessions.json"),s=new Map;try{let p=JSON.parse(await ei(n,"utf8"));for(let d of p.sessions)ae(d.promptContext),
332
- s.set(d.upstreamSessionId,d)}catch(p){if(p.code!=="ENOENT")throw p}let r=Promise.resolve(),i=!1;async function o(p){let d=Qe.
331
+ `)}function ce(e={}){let t=Ut(e,"Vibe64 driver input"),n=Ks(t);return n.scope==="session"?Xs(n):n.stableContext}async function Ht(e=""){let t=e||await Qs(Qe.join(si.tmpdir(),"vibe64-genesis-context-"));await Zs(t,{recursive:!0,mode:448});
332
+ let n=Qe.join(t,"sessions.json"),s=new Map;try{let p=JSON.parse(await ei(n,"utf8"));for(let d of p.sessions)ce(d.promptContext),
333
+ s.set(d.upstreamSessionId,d)}catch(p){if(p.code!=="ENOENT")throw p}let i=Promise.resolve(),r=!1;async function o(p){let d=Qe.
333
334
  join(t,`.sessions.${process.pid}.${Js()}.tmp`);try{await ni(d,JSON.stringify({sessions:[...p.values()]}),{flag:"wx",mode:384}),
334
335
  await ti(d,n)}finally{await Bt(d,{force:!0})}}await o(s);function c(p){return structuredClone(s.get(p))}async function a(p,d,l=""){
335
- if(i)throw new Error("The Genesis host context registry is closed.");if(typeof p!="string"||!p.trim())throw new TypeError(
336
- "Genesis host context requires a native conversation ID.");let g=structuredClone(d);ae(g);let E={upstreamSessionId:p,workdir:l,
337
- promptContext:g},_=r.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(E))return;let k=new Map(s);
338
- k.set(p,E),await o(k),s=k});r=_,await _}async function u(){i=!0,await r.catch(()=>{}),s.clear(),e||await Bt(t,{recursive:!0,
336
+ if(r)throw new Error("The Genesis host context registry is closed.");if(typeof p!="string"||!p.trim())throw new TypeError(
337
+ "Genesis host context requires a native conversation ID.");let g=structuredClone(d);ce(g);let E={upstreamSessionId:p,workdir:l,
338
+ promptContext:g},_=i.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(E))return;let R=new Map(s);
339
+ R.set(p,E),await o(R),s=R});i=_,await _}async function u(){r=!0,await i.catch(()=>{}),s.clear(),e||await Bt(t,{recursive:!0,
339
340
  force:!0})}return Object.freeze({registryPath:n,get:c,register:a,close:u})}var O="VIBE64_DEPLOYMENT_INVALID",we=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,Se="- Recreate on res\
340
- tore: ",_e="- Generated secrets: ",Ie="- Setup code: ",q="- Sandbox allows: ",Z="- Packages: ",zt=200,ii=/^[A-Za-z0-9_][A-Za-z0-9_.+-]{0,127}(?:\^[A-Za-z_][A-Za-z0-9_-]{0,31})?$/u,
341
- Q="- Instances: up to ",J=100,ce=Object.freeze(["fuse","gvisor"]),Te=/^[A-Z_][A-Z0-9_]*$/u,pe=Object.freeze({APP_ENV:"De\
341
+ tore: ",_e="- Generated secrets: ",Ie="- Setup code: ",q="- Sandbox allows: ",Q="- Packages: ",zt=200,ii=/^[A-Za-z0-9_][A-Za-z0-9_.+-]{0,127}(?:\^[A-Za-z_][A-Za-z0-9_-]{0,31})?$/u,
342
+ ee="- Instances: up to ",J=100,ue=Object.freeze(["fuse","gvisor"]),Te=/^[A-Z_][A-Z0-9_]*$/u,Z=Object.freeze({APP_ENV:"De\
342
343
  ployment never sets APP_ENV: the host gives every step the environment it deploys to. Remove APP_ENV from Deployment.",SIDE_EFFECTS:"\
343
- SIDE_EFFECTS was replaced by APP_ENV, which the host gives every step. Remove SIDE_EFFECTS from Deployment."}),ue=Object.
344
- freeze({prepare:0,build:1,migrate:2,serve:3}),ee=Object.keys(ue).map(e=>e[0].toUpperCase()+e.slice(1)),Oe=Object.freeze(
345
- ["- Workdir: `path`","- Runtimes: `runtime`...",`${Se}\`glob\`...`,`${_e}\`NAME\`...`,`${Ie}\`NAME\``,`${q}${ce.map(e=>`\
346
- \`${e}\``).join(" ")}`,`${Z}\`package\`...`,`${Q}\`count\``,"- Ready when: `GET` `/path` returns `200`",`- ${ee.join("|")}\
347
- \`label\`: \`command\` \`argument\`...`]);function f(e,t,n,s={}){m(O,e,t,n,s)}function Ft(e,t,n){return ve(e.slice(Se.length),
348
- O,t,"Deployment Recreate on restore paths",n)}function qt(e,t,n){let s=b(e.slice(_e.length),O,t,"Deployment Generated se\
349
- crets",n);return s.some(r=>!Te.test(r))&&f(t,"Deployment Generated secrets must be uppercase environment variable names.",
350
- n),new Set(s).size!==s.length&&f(t,"Deployment contains a duplicate Generated secrets name.",n),s}function Yt(e,t,n){let[
351
- s]=b(e.slice(Ie.length),O,t,"Deployment Setup code",n,{count:1});return Te.test(s)||f(t,"Deployment Setup code must be a\
352
- n uppercase environment variable name.",n),s}function ke(e,t,n){let s=b(e.slice(q.length),O,t,"Deployment Sandbox allows",
353
- n);return s.some(r=>!ce.includes(r))&&f(t,`Deployment Sandbox allows takes only ${ce.map(r=>`\`${r}\``).join(" and ")}.`,
354
- n),new Set(s).size!==s.length&&f(t,"Deployment Sandbox allows names an allowance twice.",n),[...s].sort()}function Re(e,t,n){
355
- let s=b(e.slice(Z.length),O,t,"Deployment Packages",n,{maximum:1/0});s.length>zt&&f(t,`Deployment Packages names at most\
356
- ${zt} packages.`,n);let r=s.find(i=>!ii.test(i));return r!==void 0&&f(t,`Deployment Packages names packages as nixpkgs \
357
- does, such as \`git\` or \`python313Packages.pip\`, or one output after ^, such as \`gcc-unwrapped^lib\`; ${JSON.stringify(
358
- r)} isn't one.`,n),new Set(s).size!==s.length&&f(t,"Deployment Packages names a package twice.",n),s}function Kt(e,t,n){
359
- let[s]=b(e.slice(Q.length),O,t,"Deployment Instances",n,{count:1});return(!/^[1-9][0-9]{0,2}$/u.test(s)||Number(s)>J)&&f(
360
- t,`Deployment Instances is a whole number from 1 to ${J}, such as \`4\`.`,n),Number(s)}function Ae(e,t,n){let s=D(e[3],O,
361
- t,"Deployment command",n);s.some(i=>/\{(?:host|port)\}/u.test(i))&&f(t,"Deployment commands take no {host} or {port} pla\
362
- ceholders; Serve reads HOST and PORT from its environment.",n);let r=Object.keys(pe).find(i=>s.some(o=>o.startsWith(`${i}\
363
- =`)));return r&&f(t,pe[r],n),{label:y(e[2],O,t,"Deployment step label",n),argv:s,role:e[1].toLowerCase()}}var Xt=/^[a-z][a-z0-9-]{0,15}$/u;var Qt=/^### Service `([^`\r\n]*)`:[ \t]+(.+)$/u,en=/^### Resource `([^`\r\n]*)`$/u,oi=Xt,ai=/^[A-Za-z][A-Za-z0-9_-]{0,39}$/u,
344
+ SIDE_EFFECTS was replaced by APP_ENV, which the host gives every step. Remove SIDE_EFFECTS from Deployment.",STAGING_REACHES_REAL_PEOPLE:"\
345
+ Deployment never sets STAGING_REACHES_REAL_PEOPLE: the host gives it to a Staging only while the project's owner marks t\
346
+ hat real people use that Staging. Remove STAGING_REACHES_REAL_PEOPLE from Deployment."}),pe=Object.freeze({prepare:0,build:1,
347
+ migrate:2,serve:3}),te=Object.keys(pe).map(e=>e[0].toUpperCase()+e.slice(1)),Oe=Object.freeze(["- Workdir: `path`","- Ru\
348
+ ntimes: `runtime`...",`${Se}\`glob\`...`,`${_e}\`NAME\`...`,`${Ie}\`NAME\``,`${q}${ue.map(e=>`\`${e}\``).join(" ")}`,`${Q}\
349
+ \`package\`...`,`${ee}\`count\``,"- Ready when: `GET` `/path` returns `200`",`- ${te.join("|")} \`label\`: \`command\` \`argu\
350
+ ment\`...`]);function f(e,t,n,s={}){m(O,e,t,n,s)}function Ft(e,t,n){return ve(e.slice(Se.length),O,t,"Deployment Recreat\
351
+ e on restore paths",n)}function qt(e,t,n){let s=b(e.slice(_e.length),O,t,"Deployment Generated secrets",n);return s.some(
352
+ i=>!Te.test(i))&&f(t,"Deployment Generated secrets must be uppercase environment variable names.",n),new Set(s).size!==s.
353
+ length&&f(t,"Deployment contains a duplicate Generated secrets name.",n),s}function Yt(e,t,n){let[s]=b(e.slice(Ie.length),
354
+ O,t,"Deployment Setup code",n,{count:1});return Te.test(s)||f(t,"Deployment Setup code must be an uppercase environment \
355
+ variable name.",n),s}function Re(e,t,n){let s=b(e.slice(q.length),O,t,"Deployment Sandbox allows",n);return s.some(i=>!ue.
356
+ includes(i))&&f(t,`Deployment Sandbox allows takes only ${ue.map(i=>`\`${i}\``).join(" and ")}.`,n),new Set(s).size!==s.
357
+ length&&f(t,"Deployment Sandbox allows names an allowance twice.",n),[...s].sort()}function ke(e,t,n){let s=b(e.slice(Q.
358
+ length),O,t,"Deployment Packages",n,{maximum:1/0});s.length>zt&&f(t,`Deployment Packages names at most ${zt} packages.`,
359
+ n);let i=s.find(r=>!ii.test(r));return i!==void 0&&f(t,`Deployment Packages names packages as nixpkgs does, such as \`git\
360
+ \` or \`python313Packages.pip\`, or one output after ^, such as \`gcc-unwrapped^lib\`; ${JSON.stringify(i)} isn't one.`,
361
+ n),new Set(s).size!==s.length&&f(t,"Deployment Packages names a package twice.",n),s}function Kt(e,t,n){let[s]=b(e.slice(
362
+ ee.length),O,t,"Deployment Instances",n,{count:1});return(!/^[1-9][0-9]{0,2}$/u.test(s)||Number(s)>J)&&f(t,`Deployment I\
363
+ nstances is a whole number from 1 to ${J}, such as \`4\`.`,n),Number(s)}function Ae(e,t,n){let s=D(e[3],O,t,"Deployment \
364
+ command",n);s.some(r=>/\{(?:host|port)\}/u.test(r))&&f(t,"Deployment commands take no {host} or {port} placeholders; Ser\
365
+ ve reads HOST and PORT from its environment.",n);let i=Object.keys(Z).find(r=>s.some(o=>o.startsWith(`${r}=`)));return i&&
366
+ f(t,Z[i],n),{label:y(e[2],O,t,"Deployment step label",n),argv:s,role:e[1].toLowerCase()}}var Xt=/^[a-z][a-z0-9-]{0,15}$/u;var Qt=/^### Service `([^`\r\n]*)`:[ \t]+(.+)$/u,en=/^### Resource `([^`\r\n]*)`$/u,oi=Xt,ai=/^[A-Za-z][A-Za-z0-9_-]{0,39}$/u,
364
367
  Jt=8,ci=Object.freeze(["public","internal"]),ui=Object.freeze({"any instance":"any","each instance":"each"}),pi=/^- Production: `([^`\r\n]*)` instances?$/u,
365
368
  li=/^- Instances: `([^`\r\n]*)` to `([^`\r\n]*)`$/u,di=/^- Needs at least: `([^`\r\n]*)` vCPU, `([^`\r\n]*)` GiB memory$/u,
366
369
  mi=/^- Reaches: `([^`\r\n]*)` as `([^`\r\n]*)`$/u,hi=/^- Setting `([^`\r\n]*)`:[ \t]+(.+)$/u,et=e=>new RegExp(`^- ${e}: \
367
370
  \`([^\`\\r\\n]*)\`$`,"u"),fi=et("Exposure"),gi=et("Reached"),Ei=et("Development"),tn=Object.freeze(["local folder","own \
368
- bucket"]),vi=Object.freeze(["APP_ENV","SIDE_EFFECTS","HOST","PORT","APP_PUBLIC_URL","TRUSTED_PROXIES"]),Zt="V64_",nn=Object.
369
- freeze(["### Service `id`: summary","### Resource `id`"]),tt=Object.freeze(["- Exposure: `public` or `internal`","- Serv\
370
- e `label`: `command` `argument`...","- Ready when: `GET` `/path` returns `200`","- Instances: `min` to `max`","- Needs a\
371
- t least: `N` vCPU, `N` GiB memory","- Production: `N` instances","- Reached: `any instance` or `each instance`","- Reach\
372
- es: `service` as `SETTING`","- Setting `NAME`: `value`",`${Z}\`package\`...`,`${q}${ce.map(e=>`\`${e}\``).join(" ")}`]),
373
- sn=Object.freeze([`- Development: ${tn.map(e=>`\`${e}\``).join(" or ")}`]),bi=Object.freeze(Oe.filter(e=>![q,Q,"- Ready \
374
- when: "].some(t=>e.startsWith(t))).map(e=>e.replace(`|${ee.at(-1)} `," ")));function yi(e){return vi.includes(e)?`${e} i\
375
- s a setting the host gives every service itself`:e.startsWith(Zt)?`${e} starts with ${Zt}, which names the facts the hos\
376
- t gives each instance`:""}function rn(e,t,n,s){let r=e[1];return oi.test(r)||f(t,`A service's id is a lowercase letter, \
377
- then up to 15 lowercase letters, digits and hyphens, such as \`web\`; ${JSON.stringify(r)} isn't one.`,n),s.some(i=>i.id===
378
- r)&&f(t,`Deployment declares service \`${r}\` twice.`,n),s.length===Jt&&f(t,`A Deployment declares at most ${Jt} service\
379
- s.`,n),{id:r,summary:y(e[2],O,t,"Service summary",n),line:n,lines:{},settingLines:{},exposure:"",reached:"",serve:null,readyWhen:null,
380
- instances:null,production:null,atLeast:null,reaches:[],settings:{},packages:[],sandboxAllowances:[]}}function le(e,{min:t=1,
381
- max:n=100}={}){return/^[1-9][0-9]{0,3}$/u.test(e)&&Number(e)>=t&&Number(e)<=n?Number(e):null}function on(e,t,n,s){let r=c=>f(
382
- n,`Service \`${e.id}\`: ${c}`,s),i=c=>{Object.hasOwn(e.lines,c)&&r(`it has a second ${c} line.`),e.lines[c]=s},o=t.match(
383
- we);if(o){o[1]!=="Serve"&&r(`${o[1]} is the whole Deployment's, since one build serves every service: put it above the f\
384
- irst ### heading.`),i("Serve");let c=Ae(o,n,s);e.serve={label:c.label,argv:c.argv};return}if(t.startsWith("- Exposure: ")){
385
- i("Exposure"),e.exposure=t.match(fi)?.[1]??"",ci.includes(e.exposure)||r("Exposure is `public` or `internal`.");return}if(t.
386
- startsWith("- Reached: ")){i("Reached"),e.reached=ui[t.match(gi)?.[1]]??"",e.reached||r("Reached is `any instance` or `e\
387
- ach instance`.");return}if(t.startsWith("- Ready when: ")){i("Ready when");let c=oe(t,O,n,`Service \`${e.id}\` readiness`,
388
- s);e.readyWhen={method:c.method,path:c.path,status:c.status};return}if(t.startsWith("- Instances: ")){i("Instances");let c=t.
389
- match(li),a=le(c?.[1]??"",{max:J}),u=le(c?.[2]??"",{max:J});(a===null||u===null||a>u)&&r(`Instances is a range of whole \
390
- numbers from 1 to ${J}, the least first, such as \`- Instances: \`1\` to \`6\`\`.`),e.instances={min:a,max:u};return}if(t.
391
- startsWith("- Needs at least: ")){i("Needs at least");let c=t.match(di),a=le(c?.[1]??"",{max:1024}),u=le(c?.[2]??"",{max:4096});
392
- (a===null||u===null)&&r("Needs at least takes whole numbers of vCPUs and GiB, such as `- Needs at least: `2` vCPU, `4` G\
393
- iB memory`."),e.atLeast={vcpus:a,memoryGib:u};return}if(t.startsWith("- Production: ")){i("Production");let c=le(t.match(
394
- pi)?.[1]??"",{max:J});c===null&&r("Production says how many instances Production starts with, such as `- Production: `2`\
395
- instances`."),e.production=c;return}if(t.startsWith("- Reaches: ")){let c=t.match(mi);c||r("Reaches names a service and\
396
- the setting that gets its address: `- Reaches: `service` as `SETTING``."),e.reaches.push({service:c[1],setting:c[2],line:s});
397
- return}if(t.startsWith("- Setting ")){let c=t.match(hi);c||r("A setting is `- Setting `NAME`: `value``.");let[a]=b(c[2],
398
- O,n,`Service \`${e.id}\` Setting ${c[1]}`,s,{count:1});an(e,c[1],n,s),e.settings[c[1]]=a,e.settingLines[c[1]]=s;return}if(t.
399
- startsWith(Z)){i("Packages"),e.packages=Re(t,n,s);return}if(t.startsWith(q)){i("Sandbox allows"),e.sandboxAllowances=ke(
400
- t,n,s);return}bi.some(c=>t.startsWith(c.slice(0,c.indexOf(":")+1)))&&r(`${t.slice(2,t.indexOf(":"))} is the whole Deploy\
401
- ment's: put it above the first ### heading.`),f(n,R(`Service \`${e.id}\` entry`,t,tt),s)}function an(e,t,n,s){let r=o=>f(
402
- n,`Service \`${e.id}\`: ${o}`,s);Te.test(t)||r(`${JSON.stringify(t)} isn't a setting's name: use capitals, digits and _,\
403
- such as \`API_URL\`.`);let i=yi(t);i&&r(`${i}; give the setting another name.`),(Object.hasOwn(e.settings,t)||e.reaches.
404
- some(o=>o.setting===t&&o.line!==s))&&r(`it names the setting ${t} twice.`)}function cn(e,t,n,s){let r=e[1];return ai.test(
405
- r)||f(t,`### Resource names a resource of ## Resources by its id, such as \`files\`; ${JSON.stringify(r)} isn't one.`,n),
406
- s.has(r)&&f(t,`Deployment has a second ### Resource \`${r}\`.`,n),{id:r,line:n,development:"",developmentLine:0}}function un(e,t,n,s){
407
- if(t.startsWith("- Development: ")){e.developmentLine&&f(n,`Resource \`${e.id}\` has a second Development line.`,s),e.development=
408
- t.match(Ei)?.[1]??"",e.developmentLine=s,tn.includes(e.development)||f(n,`Resource \`${e.id}\`: Development is \`local fol\
409
- der\` or \`own bucket\`.`,s);return}f(n,`${R(`Resource \`${e.id}\` entry`,t,sn)} The Deployment's own entries come befor\
410
- e the first ### heading.`,s)}function pn(e,t,n){let s=e.map(i=>i.id);for(let i of e){let o=(a,u=i.line)=>f(n,`Service \`${i.
411
- id}\`: ${a}`,u);for(let[a,u]of[["Exposure",i.exposure],["Serve",i.serve],["Ready when",i.readyWhen],["Instances",i.instances]])
412
- u||o(`it needs a${a==="Exposure"||a==="Instances"?"n":""} ${a} line: ${tt.find(p=>p.startsWith(a==="Serve"?"- Serve":`- ${a}\
413
- :`))}.`);i.reached&&i.exposure==="public"&&o("Reached is for an internal service; a public one is reached at its address\
414
- .",i.lines.Reached);let c=i.production??i.instances.min;(c<i.instances.min||c>i.instances.max)&&o(`Production starts wit\
415
- h ${c} instances, outside its Instances, ${i.instances.min} to ${i.instances.max}.`,i.lines.Production);for(let a of i.reaches)
416
- a.service===i.id&&o("a service doesn't reach itself.",a.line),s.includes(a.service)||o(`there is no service \`${a.service}\
417
- \`; this Deployment's services are ${s.map(u=>`\`${u}\``).join(", ")}. Fix the name in its Reaches line.`,a.line),i.reaches.
418
- filter(u=>u.service===a.service).length>1&&o(`it reaches \`${a.service}\` twice.`,a.line),an(i,a.setting,n,a.line);for(let a of[
419
- ...i.reaches.map(u=>u.setting),...Object.keys(i.settings)])if(t.generatedSecrets.includes(a)||t.setupCode===a){let u=i.reaches.
420
- find(p=>p.setting===a)?.line??i.settingLines[a];o(`${a} is the Deployment's ${t.setupCode===a?"Setup code":"generated se\
421
- cret"}, which every service gets already; give the setting another name.`,u)}}let r=e.filter(i=>i.exposure==="public");return r.
422
- length!==1&&f(n,r.length===0?"A Deployment with services has exactly one public service: give one of them `- Exposure: `\
423
- public``.":`A Deployment with services has exactly one public service; ${r.map(({id:i})=>`\`${i}\``).join(" and ")} are \
424
- both public.`,r[1]?.line??e[0].line),e.map(i=>({id:i.id,summary:i.summary,exposure:i.exposure,reached:i.reached||"any",serve:i.
425
- serve,readyWhen:i.readyWhen,instances:{min:i.instances.min,max:i.instances.max,production:i.production??i.instances.min},
426
- atLeast:i.atLeast,reaches:i.reaches.map(({service:o,setting:c})=>({service:o,setting:c})),settings:i.settings,packages:i.
427
- packages,sandboxAllowances:i.sandboxAllowances}))}function ln(e,t,n){let s=new Map((Array.isArray(t)?t:[]).map(i=>i?.resource).
428
- filter(i=>i&&typeof i.id=="string").map(i=>[i.id,i]));for(let i of e.resources.values()){let o=s.get(i.id);o||f(n,`### R\
429
- esource \`${i.id}\`: genesis/stack.md's ## Resources declares no resource \`${i.id}\`${s.size?`; its resources are ${[...s.
430
- keys()].map(c=>`\`${c}\``).join(", ")}`:""}.`,i.line),i.development&&o.kind!=="bucket"&&f(n,`Resource \`${i.id}\`: Develo\
431
- pment says how development provides a bucket, and \`${i.id}\` is a ${o.kind} resource.`,i.developmentLine)}let r=new Map;
432
- for(let i of s.values())for(let o of Array.isArray(i.environmentAlternatives)?i.environmentAlternatives:[])for(let c of Object.
433
- values(o?.bindings??{}))typeof c=="string"&&r.set(c,i.id);for(let i of e.services){let o=[...i.reaches.map(c=>[c.setting,
434
- c.line]),...Object.entries(i.settingLines)];for(let[c,a]of o)r.has(c)&&f(n,`Service \`${i.id}\`: ${c} is the setting res\
435
- ource \`${r.get(c)}\` binds; give the setting another name.`,a)}}var mn="vibe64.application-deployment.v2",wi="vibe64.application-deployment.v1",hn="Deployment";function nt(){return{version:1,
371
+ bucket"]),vi=Object.freeze(["APP_ENV","HOST","PORT","APP_PUBLIC_URL","TRUSTED_PROXIES"]),Zt="V64_",bi="STAGING_REACHES_R\
372
+ EAL_PEOPLE",nn=Object.freeze(["### Service `id`: summary","### Resource `id`"]),tt=Object.freeze(["- Exposure: `public` \
373
+ or `internal`","- Serve `label`: `command` `argument`...","- Ready when: `GET` `/path` returns `200`","- Instances: `min\
374
+ ` to `max`","- Needs at least: `N` vCPU, `N` GiB memory","- Production: `N` instances","- Reached: `any instance` or `ea\
375
+ ch instance`","- Reaches: `service` as `SETTING`","- Setting `NAME`: `value`",`${Q}\`package\`...`,`${q}${ue.map(e=>`\`${e}\
376
+ \``).join(" ")}`]),sn=Object.freeze([`- Development: ${tn.map(e=>`\`${e}\``).join(" or ")}`]),yi=Object.freeze(Oe.filter(
377
+ e=>![q,ee,"- Ready when: "].some(t=>e.startsWith(t))).map(e=>e.replace(`|${te.at(-1)} `," ")));function wi(e){return vi.
378
+ includes(e)?`${e} is a setting the host gives every service itself`:e===bi?`${e} is the host's, given to a Staging only \
379
+ while the project's owner marks that real people use it`:e.startsWith(Zt)?`${e} starts with ${Zt}, which names the facts\
380
+ the host gives each instance`:""}function rn(e,t,n,s){let i=e[1];return oi.test(i)||f(t,`A service's id is a lowercase \
381
+ letter, then up to 15 lowercase letters, digits and hyphens, such as \`web\`; ${JSON.stringify(i)} isn't one.`,n),s.some(
382
+ r=>r.id===i)&&f(t,`Deployment declares service \`${i}\` twice.`,n),s.length===Jt&&f(t,`A Deployment declares at most ${Jt}\
383
+ services.`,n),{id:i,summary:y(e[2],O,t,"Service summary",n),line:n,lines:{},settingLines:{},exposure:"",reached:"",serve:null,
384
+ readyWhen:null,instances:null,production:null,atLeast:null,reaches:[],settings:{},packages:[],sandboxAllowances:[]}}function le(e,{
385
+ min:t=1,max:n=100}={}){return/^[1-9][0-9]{0,3}$/u.test(e)&&Number(e)>=t&&Number(e)<=n?Number(e):null}function on(e,t,n,s){
386
+ let i=c=>f(n,`Service \`${e.id}\`: ${c}`,s),r=c=>{Object.hasOwn(e.lines,c)&&i(`it has a second ${c} line.`),e.lines[c]=s},
387
+ o=t.match(we);if(o){o[1]!=="Serve"&&i(`${o[1]} is the whole Deployment's, since one build serves every service: put it a\
388
+ bove the first ### heading.`),r("Serve");let c=Ae(o,n,s);e.serve={label:c.label,argv:c.argv};return}if(t.startsWith("- E\
389
+ xposure: ")){r("Exposure"),e.exposure=t.match(fi)?.[1]??"",ci.includes(e.exposure)||i("Exposure is `public` or `internal\
390
+ `.");return}if(t.startsWith("- Reached: ")){r("Reached"),e.reached=ui[t.match(gi)?.[1]]??"",e.reached||i("Reached is `an\
391
+ y instance` or `each instance`.");return}if(t.startsWith("- Ready when: ")){r("Ready when");let c=ae(t,O,n,`Service \`${e.
392
+ id}\` readiness`,s);e.readyWhen={method:c.method,path:c.path,status:c.status};return}if(t.startsWith("- Instances: ")){r(
393
+ "Instances");let c=t.match(li),a=le(c?.[1]??"",{max:J}),u=le(c?.[2]??"",{max:J});(a===null||u===null||a>u)&&i(`Instances\
394
+ is a range of whole numbers from 1 to ${J}, the least first, such as \`- Instances: \`1\` to \`6\`\`.`),e.instances={min:a,
395
+ max:u};return}if(t.startsWith("- Needs at least: ")){r("Needs at least");let c=t.match(di),a=le(c?.[1]??"",{max:1024}),u=le(
396
+ c?.[2]??"",{max:4096});(a===null||u===null)&&i("Needs at least takes whole numbers of vCPUs and GiB, such as `- Needs at\
397
+ least: `2` vCPU, `4` GiB memory`."),e.atLeast={vcpus:a,memoryGib:u};return}if(t.startsWith("- Production: ")){r("Produc\
398
+ tion");let c=le(t.match(pi)?.[1]??"",{max:J});c===null&&i("Production says how many instances Production starts with, su\
399
+ ch as `- Production: `2` instances`."),e.production=c;return}if(t.startsWith("- Reaches: ")){let c=t.match(mi);c||i("Rea\
400
+ ches names a service and the setting that gets its address: `- Reaches: `service` as `SETTING``."),e.reaches.push({service:c[1],
401
+ setting:c[2],line:s});return}if(t.startsWith("- Setting ")){let c=t.match(hi);c||i("A setting is `- Setting `NAME`: `val\
402
+ ue``.");let[a]=b(c[2],O,n,`Service \`${e.id}\` Setting ${c[1]}`,s,{count:1});an(e,c[1],n,s),e.settings[c[1]]=a,e.settingLines[c[1]]=
403
+ s;return}if(t.startsWith(Q)){r("Packages"),e.packages=ke(t,n,s);return}if(t.startsWith(q)){r("Sandbox allows"),e.sandboxAllowances=
404
+ Re(t,n,s);return}yi.some(c=>t.startsWith(c.slice(0,c.indexOf(":")+1)))&&i(`${t.slice(2,t.indexOf(":"))} is the whole Dep\
405
+ loyment's: put it above the first ### heading.`),f(n,k(`Service \`${e.id}\` entry`,t,tt),s)}function an(e,t,n,s){let i=o=>f(
406
+ n,`Service \`${e.id}\`: ${o}`,s);Te.test(t)||i(`${JSON.stringify(t)} isn't a setting's name: use capitals, digits and _,\
407
+ such as \`API_URL\`.`),t==="SIDE_EFFECTS"&&i(Z.SIDE_EFFECTS);let r=wi(t);r&&i(`${r}; give the setting another name.`),(Object.
408
+ hasOwn(e.settings,t)||e.reaches.some(o=>o.setting===t&&o.line!==s))&&i(`it names the setting ${t} twice.`)}function cn(e,t,n,s){
409
+ let i=e[1];return ai.test(i)||f(t,`### Resource names a resource of ## Resources by its id, such as \`files\`; ${JSON.stringify(
410
+ i)} isn't one.`,n),s.has(i)&&f(t,`Deployment has a second ### Resource \`${i}\`.`,n),{id:i,line:n,development:"",developmentLine:0}}
411
+ function un(e,t,n,s){if(t.startsWith("- Development: ")){e.developmentLine&&f(n,`Resource \`${e.id}\` has a second Develo\
412
+ pment line.`,s),e.development=t.match(Ei)?.[1]??"",e.developmentLine=s,tn.includes(e.development)||f(n,`Resource \`${e.id}\
413
+ \`: Development is \`local folder\` or \`own bucket\`.`,s);return}f(n,`${k(`Resource \`${e.id}\` entry`,t,sn)} The Deplo\
414
+ yment's own entries come before the first ### heading.`,s)}function pn(e,t,n){let s=e.map(r=>r.id);for(let r of e){let o=(a,u=r.
415
+ line)=>f(n,`Service \`${r.id}\`: ${a}`,u);for(let[a,u]of[["Exposure",r.exposure],["Serve",r.serve],["Ready when",r.readyWhen],
416
+ ["Instances",r.instances]])u||o(`it needs a${a==="Exposure"||a==="Instances"?"n":""} ${a} line: ${tt.find(p=>p.startsWith(
417
+ a==="Serve"?"- Serve":`- ${a}:`))}.`);r.reached&&r.exposure==="public"&&o("Reached is for an internal service; a public \
418
+ one is reached at its address.",r.lines.Reached);let c=r.production??r.instances.min;(c<r.instances.min||c>r.instances.max)&&
419
+ o(`Production starts with ${c} instances, outside its Instances, ${r.instances.min} to ${r.instances.max}.`,r.lines.Production);
420
+ for(let a of r.reaches)a.service===r.id&&o("a service doesn't reach itself.",a.line),s.includes(a.service)||o(`there is \
421
+ no service \`${a.service}\`; this Deployment's services are ${s.map(u=>`\`${u}\``).join(", ")}. Fix the name in its Reac\
422
+ hes line.`,a.line),r.reaches.filter(u=>u.service===a.service).length>1&&o(`it reaches \`${a.service}\` twice.`,a.line),an(
423
+ r,a.setting,n,a.line);for(let a of[...r.reaches.map(u=>u.setting),...Object.keys(r.settings)])if(t.generatedSecrets.includes(
424
+ a)||t.setupCode===a){let u=r.reaches.find(p=>p.setting===a)?.line??r.settingLines[a];o(`${a} is the Deployment's ${t.setupCode===
425
+ a?"Setup code":"generated secret"}, which every service gets already; give the setting another name.`,u)}}let i=e.filter(
426
+ r=>r.exposure==="public");return i.length!==1&&f(n,i.length===0?"A Deployment with services has exactly one public servi\
427
+ ce: give one of them `- Exposure: `public``.":`A Deployment with services has exactly one public service; ${i.map(({id:r})=>`\
428
+ \`${r}\``).join(" and ")} are both public.`,i[1]?.line??e[0].line),e.map(r=>({id:r.id,summary:r.summary,exposure:r.exposure,
429
+ reached:r.reached||"any",serve:r.serve,readyWhen:r.readyWhen,instances:{min:r.instances.min,max:r.instances.max,production:r.
430
+ production??r.instances.min},atLeast:r.atLeast,reaches:r.reaches.map(({service:o,setting:c})=>({service:o,setting:c})),settings:r.
431
+ settings,packages:r.packages,sandboxAllowances:r.sandboxAllowances}))}function ln(e,t,n){let s=new Map((Array.isArray(t)?
432
+ t:[]).map(r=>r?.resource).filter(r=>r&&typeof r.id=="string").map(r=>[r.id,r]));for(let r of e.resources.values()){let o=s.
433
+ get(r.id);o||f(n,`### Resource \`${r.id}\`: genesis/stack.md's ## Resources declares no resource \`${r.id}\`${s.size?`; \
434
+ its resources are ${[...s.keys()].map(c=>`\`${c}\``).join(", ")}`:""}.`,r.line),r.development&&o.kind!=="bucket"&&f(n,`R\
435
+ esource \`${r.id}\`: Development says how development provides a bucket, and \`${r.id}\` is a ${o.kind} resource.`,r.developmentLine)}
436
+ let i=new Map;for(let r of s.values())for(let o of Array.isArray(r.environmentAlternatives)?r.environmentAlternatives:[])
437
+ for(let c of Object.values(o?.bindings??{}))typeof c=="string"&&i.set(c,r.id);for(let r of e.services){let o=[...r.reaches.
438
+ map(c=>[c.setting,c.line]),...Object.entries(r.settingLines)];for(let[c,a]of o)i.has(c)&&f(n,`Service \`${r.id}\`: ${c} \
439
+ is the setting resource \`${i.get(c)}\` binds; give the setting another name.`,a)}}var mn="vibe64.application-deployment.v2",Si="vibe64.application-deployment.v1",hn="Deployment";function nt(){return{version:1,
436
440
  artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecrets:[],setupCode:"",sandboxAllowances:[],packages:[],
437
441
  instances:{max:1},readiness:null,steps:[],services:[],deploymentResources:{}}}function fn(e,t){Array.isArray(e)||f(t,"De\
438
442
  ployment must be supplied as exact Stack section lines.");let n={services:[],resources:new Map};if(S(e))return{result:nt(),
439
- located:n};let s=nt(),r=new Set,i=e.some(c=>c.trim().startsWith("### Service ")),o=null;for(let c=0;c<e.length;c+=1){let a=e[c].
443
+ located:n};let s=nt(),i=new Set,r=e.some(c=>c.trim().startsWith("### Service ")),o=null;for(let c=0;c<e.length;c+=1){let a=e[c].
440
444
  trim();if(!a)continue;let u=c+1;if(a.startsWith("#")){let d=a.match(Qt),l=d?null:a.match(en);d?(o={service:rn(d,t,u,n.services)},
441
- n.services.push(o.service)):l?(o={resource:cn(l,t,u,n.resources)},n.resources.set(o.resource.id,o.resource)):f(t,R("Depl\
445
+ n.services.push(o.service)):l?(o={resource:cn(l,t,u,n.resources)},n.resources.set(o.resource.id,o.resource)):f(t,k("Depl\
442
446
  oyment heading",a,nn),u);continue}if(o?.service){on(o.service,a,t,u);continue}if(o?.resource){un(o.resource,a,t,u);continue}
443
- let p=a.match(we);if(i&&(p?.[1]==="Serve"||[q,Q,"- Ready when: ","- Instances: "].some(d=>a.startsWith(d)))&&f(t,`In a D\
444
- eployment with services, each service says its own Serve, Ready when, Instances and Sandbox allows: move \`${a}\` under i\
445
- ts \`### Service\` heading.`,u),a.startsWith("- Workdir: ")){r.has("workdir")&&f(t,"Duplicate Deployment Workdir.",u),r.
447
+ let p=a.match(we);if(r&&(p?.[1]==="Serve"||[q,ee,"- Ready when: ","- Instances: "].some(d=>a.startsWith(d)))&&f(t,`In a \
448
+ Deployment with services, each service says its own Serve, Ready when, Instances and Sandbox allows: move \`${a}\` under \
449
+ its \`### Service\` heading.`,u),a.startsWith("- Workdir: ")){i.has("workdir")&&f(t,"Duplicate Deployment Workdir.",u),i.
446
450
  add("workdir");let d=b(a.slice(11),O,t,"Deployment Workdir",u,{count:1})[0];s.workdir=w(d,O,t,"Deployment workdir",u);continue}
447
- if(a.startsWith("- Runtimes: ")){r.has("runtimes")&&f(t,"Duplicate Deployment Runtimes.",u),r.add("runtimes"),s.runtimeRequirements=
448
- P(a.slice(12),O,t,"Deployment runtimes",u);continue}if(a.startsWith(Se)){r.has("restore-paths")&&f(t,"Duplicate Deployme\
449
- nt Recreate on restore entry.",u),r.add("restore-paths"),s.artifact.disposablePaths=Ft(a,t,u);continue}if(a.startsWith(_e)){
450
- r.has("generated-secrets")&&f(t,"Duplicate Deployment Generated secrets entry.",u),r.add("generated-secrets"),s.generatedSecrets=
451
- qt(a,t,u);continue}if(a.startsWith(Ie)){r.has("setup-code")&&f(t,"Duplicate Deployment Setup code.",u),r.add("setup-code"),
452
- s.setupCode=Yt(a,t,u);continue}if(a.startsWith(q)){r.has("sandbox-allows")&&f(t,"Duplicate Deployment Sandbox allows.",u),
453
- r.add("sandbox-allows"),s.sandboxAllowances=ke(a,t,u);continue}if(a.startsWith(Z)){r.has("packages")&&f(t,"Duplicate Dep\
454
- loyment Packages.",u),r.add("packages"),s.packages=Re(a,t,u);continue}if(a.startsWith(Q)){r.has("instances")&&f(t,"Dupli\
455
- cate Deployment Instances.",u),r.add("instances"),s.instances={max:Kt(a,t,u)};continue}if(a.startsWith("- Ready when: ")){
456
- r.has("readiness")&&f(t,"Duplicate Deployment Ready when.",u),r.add("readiness"),s.readiness=oe(a,O,t,"Deployment readin\
457
- ess",u);continue}if(p){s.steps.push(Ae(p,t,u));continue}f(t,R("Deployment entry",a,Oe),u)}if(i){for(let a=1;a<s.steps.length;a+=
458
- 1)ue[s.steps[a].role]<ue[s.steps[a-1].role]&&f(t,`Deployment steps must be ordered ${ee.slice(0,-1).join(", ")}.`);dn(s,
451
+ if(a.startsWith("- Runtimes: ")){i.has("runtimes")&&f(t,"Duplicate Deployment Runtimes.",u),i.add("runtimes"),s.runtimeRequirements=
452
+ P(a.slice(12),O,t,"Deployment runtimes",u);continue}if(a.startsWith(Se)){i.has("restore-paths")&&f(t,"Duplicate Deployme\
453
+ nt Recreate on restore entry.",u),i.add("restore-paths"),s.artifact.disposablePaths=Ft(a,t,u);continue}if(a.startsWith(_e)){
454
+ i.has("generated-secrets")&&f(t,"Duplicate Deployment Generated secrets entry.",u),i.add("generated-secrets"),s.generatedSecrets=
455
+ qt(a,t,u);continue}if(a.startsWith(Ie)){i.has("setup-code")&&f(t,"Duplicate Deployment Setup code.",u),i.add("setup-code"),
456
+ s.setupCode=Yt(a,t,u);continue}if(a.startsWith(q)){i.has("sandbox-allows")&&f(t,"Duplicate Deployment Sandbox allows.",u),
457
+ i.add("sandbox-allows"),s.sandboxAllowances=Re(a,t,u);continue}if(a.startsWith(Q)){i.has("packages")&&f(t,"Duplicate Dep\
458
+ loyment Packages.",u),i.add("packages"),s.packages=ke(a,t,u);continue}if(a.startsWith(ee)){i.has("instances")&&f(t,"Dupl\
459
+ icate Deployment Instances.",u),i.add("instances"),s.instances={max:Kt(a,t,u)};continue}if(a.startsWith("- Ready when: ")){
460
+ i.has("readiness")&&f(t,"Duplicate Deployment Ready when.",u),i.add("readiness"),s.readiness=ae(a,O,t,"Deployment readin\
461
+ ess",u);continue}if(p){s.steps.push(Ae(p,t,u));continue}f(t,k("Deployment entry",a,Oe),u)}if(r){for(let a=1;a<s.steps.length;a+=
462
+ 1)pe[s.steps[a].role]<pe[s.steps[a-1].role]&&f(t,`Deployment steps must be ordered ${te.slice(0,-1).join(", ")}.`);dn(s,
459
463
  t),s.services=pn(n.services,s,t);let c=s.services.find(a=>a.exposure==="public");s.steps.push({label:c.serve.label,argv:[
460
464
  ...c.serve.argv],role:"serve"}),s.readiness={kind:"http",...c.readyWhen},s.instances={max:c.instances.max},s.sandboxAllowances=
461
465
  [...new Set(s.services.flatMap(a=>a.sandboxAllowances))].sort()}else{s.steps.length===0&&f(t,"## Deployment needs at lea\
462
466
  st one command or exactly `- Nothing.`."),(s.steps.filter(({role:u})=>u==="serve").length!==1||s.steps.at(-1).role!=="se\
463
- rve")&&f(t,"Deployment needs exactly one final Serve step.");for(let u=1;u<s.steps.length;u+=1)ue[s.steps[u].role]<ue[s.
464
- steps[u-1].role]&&f(t,`Deployment steps must be ordered ${ee.slice(0,-1).join(", ")}, then ${ee.at(-1)}.`);s.readiness||
467
+ rve")&&f(t,"Deployment needs exactly one final Serve step.");for(let u=1;u<s.steps.length;u+=1)pe[s.steps[u].role]<pe[s.
468
+ steps[u-1].role]&&f(t,`Deployment steps must be ordered ${te.slice(0,-1).join(", ")}, then ${te.at(-1)}.`);s.readiness||
465
469
  f(t,"Deployment needs one Ready when entry."),dn(s,t);let a=s.steps.at(-1);s.services=[{id:"web",summary:"",exposure:"pu\
466
470
  blic",reached:"any",serve:{label:a.label,argv:[...a.argv]},readyWhen:{method:s.readiness.method,path:s.readiness.path,status:s.
467
471
  readiness.status},instances:{min:1,max:s.instances.max,production:1},atLeast:null,reaches:[],settings:{},packages:[],sandboxAllowances:[
468
472
  ...s.sandboxAllowances]}]}return s.deploymentResources=Object.fromEntries([...n.resources.values()].map(c=>[c.id,c.development?
469
- {development:c.development}:{}])),{result:s,located:n}}function dn(e,t){let n=Object.keys(pe).find(s=>[...e.generatedSecrets,
470
- e.setupCode].includes(s));n&&f(t,pe[n]),e.generatedSecrets.includes(e.setupCode)&&f(t,"Deployment Setup code is generate\
471
- d already; leave it out of Generated secrets."),e.artifact.disposablePaths.length>0&&!e.steps.some(({role:s})=>s==="prep\
472
- are")&&f(t,"Deployment may recreate paths on restore only when it declares a Prepare step.")}function Si(e,t={}){let{path:n="\
473
+ {development:c.development}:{}])),{result:s,located:n}}function dn(e,t){let n=Object.keys(Z).find(s=>[...e.generatedSecrets,
474
+ e.setupCode].includes(s));n&&f(t,Z[n]),e.generatedSecrets.includes(e.setupCode)&&f(t,"Deployment Setup code is generated\
475
+ already; leave it out of Generated secrets."),e.artifact.disposablePaths.length>0&&!e.steps.some(({role:s})=>s==="prepa\
476
+ re")&&f(t,"Deployment may recreate paths on restore only when it declares a Prepare step.")}function _i(e,t={}){let{path:n="\
473
477
  genesis/stack.md#Deployment"}=t;return fn(e,n).result}function gn({environment:e={},section:t={}}={}){z(t,e,"Deployment \
474
- section");let n=[...t.diagnostics||[]],s=nt(),r=!1;if(t.status==="ready"){let a="genesis/stack.md#Deployment",u=fn(t.lines,
475
- a);ln(u.located,e.resources,a),s=u.result,r=u.located.services.length>0}let i=n.length>0?"blocked":s.steps.length>0?"rea\
478
+ section");let n=[...t.diagnostics||[]],s=nt(),i=!1;if(t.status==="ready"){let a="genesis/stack.md#Deployment",u=fn(t.lines,
479
+ a);ln(u.located,e.resources,a),s=u.result,i=u.located.services.length>0}let r=n.length>0?"blocked":s.steps.length>0?"rea\
476
480
  dy":"unconfigured",o={version:s.version,artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.runtimeRequirements,
477
481
  generatedSecrets:s.generatedSecrets,setupCode:s.setupCode,sandboxAllowances:s.sandboxAllowances,packages:s.packages,instances:s.
478
- instances,readiness:s.readiness,steps:s.steps},c={...o,...r?{services:s.services}:{},...Object.keys(s.deploymentResources).
479
- length>0?{deploymentResources:s.deploymentResources}:{}};return{contract:mn,status:i,stackHash:t.stackHash,recipeHash:i===
482
+ instances,readiness:s.readiness,steps:s.steps},c={...o,...i?{services:s.services}:{},...Object.keys(s.deploymentResources).
483
+ length>0?{deploymentResources:s.deploymentResources}:{}};return{contract:mn,status:r,stackHash:t.stackHash,recipeHash:r===
480
484
  "ready"?N(c):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:F(s.runtimeRequirements),resources:structuredClone(
481
- e.resources||[]),...o,services:s.services,deploymentResources:s.deploymentResources,diagnostics:n}}var Ce="vibe64.packaging.v1",Sn="Packaging",Xo=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
482
- de"]),M="VIBE64_PACKAGING_INVALID",_i=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ii=/^[A-Z_][A-Z0-9_]*$/u,Ti=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
483
- Oi=/^[a-z][a-z0-9+.-]*$/u,ki=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,Ri=/\{[^{}\s]*\}/u,
484
- Ai=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Ni=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,Ci=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
485
- Di=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Pi=/^- Content: package `([^`\r\n]+)`$/u,En=50,vn=500,$i=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
485
+ e.resources||[]),...o,services:s.services,deploymentResources:s.deploymentResources,diagnostics:n}}var Ce="vibe64.packaging.v1",Sn="Packaging",Jo=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
486
+ de"]),M="VIBE64_PACKAGING_INVALID",Ii=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ti=/^[A-Z_][A-Z0-9_]*$/u,Oi=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
487
+ Ri=/^[a-z][a-z0-9+.-]*$/u,ki=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,Ai=/\{[^{}\s]*\}/u,
488
+ Ni=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Ci=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,Di=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
489
+ Pi=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,$i=/^- Content: package `([^`\r\n]+)`$/u,En=50,vn=500,xi=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
486
490
  _n=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
487
491
  "versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
488
492
  prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
@@ -491,343 +495,343 @@ t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({ent
491
495
  pplicationId","name","icon","versionFrom","deepLinkSchemeFrom","appLinkDomainsFrom","permission"],required:["content","p\
492
496
  latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),Ne=Object.freeze(Object.
493
497
  keys(_n)),st=Object.freeze(["android"]),it=Object.freeze(["package.json","pyproject.toml","external"]),Y=e=>e.map(t=>`\`${t}\
494
- \``).join(" | "),te=Object.freeze([["- Packer: ","packer",`- Packer: ${Y(Ne)}`],["- Workdir: ","workdir","- Workdir: `pa\
498
+ \``).join(" | "),ne=Object.freeze([["- Packer: ","packer",`- Packer: ${Y(Ne)}`],["- Workdir: ","workdir","- Workdir: `pa\
495
499
  th`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from\
496
500
  : ","versionFrom",`- Version from: ${Y(it)}`],["- Platforms: ","platforms",`- Platforms: ${Y(st)}...`],["- Id: ","applic\
497
501
  ationId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/ico\
498
502
  n-1024.png`"],["- Deep link scheme from: ","deepLinkSchemeFrom","- Deep link scheme from: `ENV_NAME`"],["- App link doma\
499
- ins from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),bn="### Package `id`: Label",xi=Object.freeze(
500
- [te[0][2],te[1][2],te[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",te[3][2],
501
- te[4][2],"- Content: package `web-bundle-id`",...te.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),
503
+ ins from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),bn="### Package `id`: Label",Li=Object.freeze(
504
+ [ne[0][2],ne[1][2],ne[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",ne[3][2],
505
+ ne[4][2],"- Content: package `web-bundle-id`",...ne.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),
502
506
  de=Object.freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Env\
503
507
  ironment",output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Na\
504
508
  me",icon:"Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permis\
505
- sion"});function v(e,t,n){m(M,e,t,n)}function rt(e,t,n,s){let r=y(e,M,t,n,s);return _i.test(r)||v(t,`${n} must use lower\
506
- case letters, digits, and single hyphens.`,s),r}function Vi(e,t,n,s,r){return b(e.slice(t.length),M,n,s,r,{count:1})[0]}
507
- function ot(e,t,n,s){return e.some(r=>Ri.test(r))&&v(t,`${n} takes no placeholders in ${Ce}.`,s),e}function In(e,t,n,s){
508
- return Ii.test(e)||v(t,`${n} must be an uppercase environment variable name.`,s),e}function yn(e,t,n,s,r){e.seen.has(t)&&
509
- v(s,`Package ${e.id} has a duplicate ${de[t]} entry.`,r),e.seen.add(t),e.fields[t]=n,e.lines[t]=r}function Li(e,t,n,s,r){
510
- let i=`Packaging ${de[e]}`;if(e==="runtimes")return P(t.slice(n.length),M,s,i,r);if(e==="platforms"){let c=b(t.slice(n.length),
511
- M,s,i,r);return c.some(a=>!st.includes(a))&&v(s,`${i} must be ${Y(st)}.`,r),new Set(c).size!==c.length&&v(s,`${i} contai\
512
- ns a duplicate platform.`,r),c}let o=ot([Vi(t,n,s,i,r)],s,i,r)[0];if(e==="packer")return Ne.includes(o)||v(s,`Unknown pa\
513
- cker \`${o}\`. ${Ce} packers are ${Y(Ne)}.`,r),o;if(["workdir","output"].includes(e))return w(o,M,s,i,r,{allowRoot:e==="\
514
- workdir"});if(e==="icon"){let c=w(o,M,s,i,r,{allowRoot:!1});return c.toLowerCase().endsWith(".png")||v(s,`${i} must be a\
515
- 1024x1024 PNG file.`,r),c}return e==="versionFrom"?(it.includes(o)||v(s,`${i} must be ${Y(it)}.`,r),o):e==="application\
516
- Id"?((!Ti.test(o)||o.length>150)&&v(s,`${i} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and un\
517
- derscores; each part starts with a letter).`,r),o):e==="name"?((o.trim()!==o||o.length>En)&&v(s,`${i} must be at most ${En}\
518
- characters without surrounding spaces.`,r),o):In(o,s,i,r)}function Mi(e,t,n){return{id:rt(e[1],t,"Package id",n),label:y(
519
- e[2],M,t,"Package label",n),fields:{},lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:n}}function ji(e,t,n,s){
509
+ sion"});function v(e,t,n){m(M,e,t,n)}function rt(e,t,n,s){let i=y(e,M,t,n,s);return Ii.test(i)||v(t,`${n} must use lower\
510
+ case letters, digits, and single hyphens.`,s),i}function Vi(e,t,n,s,i){return b(e.slice(t.length),M,n,s,i,{count:1})[0]}
511
+ function ot(e,t,n,s){return e.some(i=>Ai.test(i))&&v(t,`${n} takes no placeholders in ${Ce}.`,s),e}function In(e,t,n,s){
512
+ return Ti.test(e)||v(t,`${n} must be an uppercase environment variable name.`,s),e}function yn(e,t,n,s,i){e.seen.has(t)&&
513
+ v(s,`Package ${e.id} has a duplicate ${de[t]} entry.`,i),e.seen.add(t),e.fields[t]=n,e.lines[t]=i}function Mi(e,t,n,s,i){
514
+ let r=`Packaging ${de[e]}`;if(e==="runtimes")return P(t.slice(n.length),M,s,r,i);if(e==="platforms"){let c=b(t.slice(n.length),
515
+ M,s,r,i);return c.some(a=>!st.includes(a))&&v(s,`${r} must be ${Y(st)}.`,i),new Set(c).size!==c.length&&v(s,`${r} contai\
516
+ ns a duplicate platform.`,i),c}let o=ot([Vi(t,n,s,r,i)],s,r,i)[0];if(e==="packer")return Ne.includes(o)||v(s,`Unknown pa\
517
+ cker \`${o}\`. ${Ce} packers are ${Y(Ne)}.`,i),o;if(["workdir","output"].includes(e))return w(o,M,s,r,i,{allowRoot:e==="\
518
+ workdir"});if(e==="icon"){let c=w(o,M,s,r,i,{allowRoot:!1});return c.toLowerCase().endsWith(".png")||v(s,`${r} must be a\
519
+ 1024x1024 PNG file.`,i),c}return e==="versionFrom"?(it.includes(o)||v(s,`${r} must be ${Y(it)}.`,i),o):e==="application\
520
+ Id"?((!Oi.test(o)||o.length>150)&&v(s,`${r} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and un\
521
+ derscores; each part starts with a letter).`,i),o):e==="name"?((o.trim()!==o||o.length>En)&&v(s,`${r} must be at most ${En}\
522
+ characters without surrounding spaces.`,i),o):In(o,s,r,i)}function ji(e,t,n){return{id:rt(e[1],t,"Package id",n),label:y(
523
+ e[2],M,t,"Package label",n),fields:{},lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:n}}function Gi(e,t,n,s){
520
524
  /^- Plugins?\b/u.test(t)&&v(n,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Co\
521
- ntent package at its lockfile versions.",s);for(let[a,u]of te)if(t.startsWith(a)){yn(e,u,Li(u,t,a,n,s),n,s);return}let r=t.
522
- match(Pi);if(r){yn(e,"content",rt(r[1],n,"Packaging Content package",s),n,s);return}let i=t.match(Ni);if(i){let a=i[1].toLowerCase(),
523
- u=`Packaging ${i[1]} command`;e[a].push({label:y(i[2],M,n,`Packaging ${i[1]} label`,s),argv:ot(D(i[3],M,n,u,s),n,u,s)}),
524
- e.lines[a]??=s;return}let o=t.match(Ci);if(o){let a=In(o[1],n,"Packaging Environment name",s);$i.test(a)&&v(n,`Packaging\
525
+ ntent package at its lockfile versions.",s);for(let[a,u]of ne)if(t.startsWith(a)){yn(e,u,Mi(u,t,a,n,s),n,s);return}let i=t.
526
+ match($i);if(i){yn(e,"content",rt(i[1],n,"Packaging Content package",s),n,s);return}let r=t.match(Ci);if(r){let a=r[1].toLowerCase(),
527
+ u=`Packaging ${r[1]} command`;e[a].push({label:y(r[2],M,n,`Packaging ${r[1]} label`,s),argv:ot(D(r[3],M,n,u,s),n,u,s)}),
528
+ e.lines[a]??=s;return}let o=t.match(Di);if(o){let a=In(o[1],n,"Packaging Environment name",s);xi.test(a)&&v(n,`Packaging\
525
529
  Environment ${a} looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(p=>p.name===
526
530
  a)&&v(n,`Package ${e.id} has a duplicate Environment ${a}.`,s);let u=ot(b(o[2],M,n,"Packaging Environment value",s,{count:1}),
527
531
  n,"Packaging Environment value",s)[0];e.environment.push({name:a,value:u}),e.lines.environment??=s;return}let c=t.match(
528
- Di);if(c){let a=rt(c[1],n,"Packaging Permission id",s),u=y(c[2],M,n,"Packaging Permission reason",s);(u.includes("`")||u.
532
+ Pi);if(c){let a=rt(c[1],n,"Packaging Permission id",s),u=y(c[2],M,n,"Packaging Permission reason",s);(u.includes("`")||u.
529
533
  length>vn)&&v(n,`Packaging Permission reason is plain user-facing text of at most ${vn} characters.`,s),e.permissions.some(
530
534
  p=>p.id===a)&&v(n,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:u}),e.lines.permission??=
531
- s;return}v(n,R("Packaging entry",t,xi),s)}function Gi(e,t){let n=e.fields.packer;n||v(t,`Package ${e.id} needs a Packer \
532
- entry: ${Y(Ne)}.`,e.line);let s=_n[n],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build",
533
- "environment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of r)s.entries.includes(o)||
534
- v(t,`The ${n} packer takes no ${de[o]} entry.`,e.lines[o]);for(let o of s.required)r.has(o)||v(t,`Package ${e.id} (${n})\
535
+ s;return}v(n,k("Packaging entry",t,Li),s)}function Ui(e,t){let n=e.fields.packer;n||v(t,`Package ${e.id} needs a Packer \
536
+ entry: ${Y(Ne)}.`,e.line);let s=_n[n],i=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build",
537
+ "environment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of i)s.entries.includes(o)||
538
+ v(t,`The ${n} packer takes no ${de[o]} entry.`,e.lines[o]);for(let o of s.required)i.has(o)||v(t,`Package ${e.id} (${n})\
535
539
  needs ${/^[AEIOU]/u.test(de[o])?"an":"a"} ${de[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
536
- versionFrom)&&v(t,`The ${n} packer reads its version from ${Y(s.versionSources)}.`,e.lines.versionFrom);let i={id:e.id,label:e.
540
+ versionFrom)&&v(t,`The ${n} packer reads its version from ${Y(s.versionSources)}.`,e.lines.versionFrom);let r={id:e.id,label:e.
537
541
  label,packer:n,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtimes||[],prepare:e.prepare,build:e.build,environment:e.
538
- environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return n!=="capacitor"?i:{...i,content:e.
542
+ environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return n!=="capacitor"?r:{...r,content:e.
539
543
  fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
540
544
  deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
541
545
  permissions}}function Tn(e,t={}){let{path:n="genesis/stack.md#Packaging"}=t;if(Array.isArray(e)||v(n,"Packaging must be \
542
- supplied as exact Stack section lines."),S(e))return{version:1,packages:[]};let s=[],r=null;for(let a=0;a<e.length;a+=1){
543
- let u=e[a].trim();if(!u)continue;let p=a+1,d=u.match(Ai);if(d){r=Mi(d,n,p),s.push(r);continue}u.startsWith("#")&&v(n,`Un\
544
- known Packaging heading: ${u}. Use ${bn}.`,p),r||v(n,`Packaging entries belong under ${bn}.`,p),ji(r,u,n,p)}s.length===0&&
545
- v(n,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>Gi(a,n)),o=new Map;for(let a of i)
546
- o.has(a.id)&&v(n,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let c=new Set;for(let a of i.filter(
546
+ supplied as exact Stack section lines."),S(e))return{version:1,packages:[]};let s=[],i=null;for(let a=0;a<e.length;a+=1){
547
+ let u=e[a].trim();if(!u)continue;let p=a+1,d=u.match(Ni);if(d){i=ji(d,n,p),s.push(i);continue}u.startsWith("#")&&v(n,`Un\
548
+ known Packaging heading: ${u}. Use ${bn}.`,p),i||v(n,`Packaging entries belong under ${bn}.`,p),Gi(i,u,n,p)}s.length===0&&
549
+ v(n,"## Packaging needs at least one Package or exactly `- Nothing.`.");let r=s.map(a=>Ui(a,n)),o=new Map;for(let a of r)
550
+ o.has(a.id)&&v(n,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let c=new Set;for(let a of r.filter(
547
551
  ({packer:u})=>u==="capacitor")){let u=o.get(a.content);(!u||u.packer!=="web-bundle")&&v(n,`Package ${a.id} Content must \
548
552
  name a web-bundle package declared in Packaging.`),c.has(a.application.id)&&v(n,`Packaging declares application id ${a.application.
549
- id} twice.`),c.add(a.application.id)}return{version:1,packages:i}}function wn(e,t,n,s){let r=(Array.isArray(e)?e:[]).find(
550
- i=>i?.name===t);return(!r||typeof r.value!="string"||!r.value.trim())&&v(n,`${s} names ${t}, which ## Environment defaul\
551
- ts does not declare with a value.`),r.value.trim()}function On(e,t=[],n={}){let{path:s="genesis/stack.md#Packaging"}=n;return{
552
- ...e,packages:e.packages.map(r=>{if(r.packer!=="capacitor")return r;let i={...r,deepLinkScheme:null,appLinkDomains:[]};if(r.
553
- deepLinkSchemeFrom){let o=wn(t,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!Oi.test(o)||["http","ht\
554
- tps","file","content","javascript"].includes(o))&&v(s,`${r.deepLinkSchemeFrom} must be a custom lowercase URL scheme suc\
555
- h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=wn(t,r.appLinkDomainsFrom,s,`Package ${r.id} App lin\
556
- k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!ki.test(c))&&v(s,`${r.appLinkDomainsFrom} must list lowerca\
557
- se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function kn({environment:e={},
553
+ id} twice.`),c.add(a.application.id)}return{version:1,packages:r}}function wn(e,t,n,s){let i=(Array.isArray(e)?e:[]).find(
554
+ r=>r?.name===t);return(!i||typeof i.value!="string"||!i.value.trim())&&v(n,`${s} names ${t}, which ## Environment defaul\
555
+ ts does not declare with a value.`),i.value.trim()}function On(e,t=[],n={}){let{path:s="genesis/stack.md#Packaging"}=n;return{
556
+ ...e,packages:e.packages.map(i=>{if(i.packer!=="capacitor")return i;let r={...i,deepLinkScheme:null,appLinkDomains:[]};if(i.
557
+ deepLinkSchemeFrom){let o=wn(t,i.deepLinkSchemeFrom,s,`Package ${i.id} Deep link scheme from`);(!Ri.test(o)||["http","ht\
558
+ tps","file","content","javascript"].includes(o))&&v(s,`${i.deepLinkSchemeFrom} must be a custom lowercase URL scheme suc\
559
+ h as \`notes\`.`),r.deepLinkScheme=o}if(i.appLinkDomainsFrom){let o=wn(t,i.appLinkDomainsFrom,s,`Package ${i.id} App lin\
560
+ k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!ki.test(c))&&v(s,`${i.appLinkDomainsFrom} must list lowerca\
561
+ se domain names separated by commas or spaces.`),r.appLinkDomains=[...new Set(o)]}return r})}}function Rn({environment:e={},
558
562
  section:t={}}={}){z(t,e,"Packaging section");let n=[...t.diagnostics||[]],s={version:1,packages:[]};t.status==="ready"&&
559
- (s=On(Tn(t.lines),e.environmentDefaults));let r=n.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:Ce,
560
- status:r,stackHash:t.stackHash,packagingHash:r==="ready"?N(s):"",source:t.source||null,version:s.version,packages:s.packages,
561
- diagnostics:n}}var I="VIBE64_OUTPUTS_INVALID";function h(e,t,n,s={}){m(I,e,t,n,s)}function at(e,t,n,s,r,i){return b(e.slice(t.length),I,
562
- n,s,r,i)}function j(e,t,n,s,r){return at(e,t,n,s,r,{count:1})[0]}function A(e,t,n,s,r,i){e.seen.has(t)&&h(s,`Duplicate ${i}\
563
- .`,r),e.seen.add(t),e[t]=n}var me="vibe64.preview-identity.command.v1",Ui=/^[A-Z_][A-Z0-9_]*$/u,An=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
563
+ (s=On(Tn(t.lines),e.environmentDefaults));let i=n.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:Ce,
564
+ status:i,stackHash:t.stackHash,packagingHash:i==="ready"?N(s):"",source:t.source||null,version:s.version,packages:s.packages,
565
+ diagnostics:n}}var I="VIBE64_OUTPUTS_INVALID";function h(e,t,n,s={}){m(I,e,t,n,s)}function at(e,t,n,s,i,r){return b(e.slice(t.length),I,
566
+ n,s,i,r)}function j(e,t,n,s,i){return at(e,t,n,s,i,{count:1})[0]}function A(e,t,n,s,i,r){e.seen.has(t)&&h(s,`Duplicate ${r}\
567
+ .`,i),e.seen.add(t),e[t]=n}var me="vibe64.preview-identity.command.v1",Wi=/^[A-Z_][A-Z0-9_]*$/u,An=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
564
568
  "TMPDIR","USER"]),Nn=new Set(["email","login","user-id"]),Cn=1e4,De=3e4,Dn=[["- Command: ","command","Command","`tools/p\
565
569
  review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${me}\``],["- Identity types: ","identityTypes",
566
570
  "Identity types",`one or more of ${[...Nn].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
567
571
  t","Enabled environment","`ENV_NAME`"],["- Secret environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],
568
572
  ["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${De}\`\
569
- (default ${Cn})`]],ct=Dn.map(([e,,,t])=>`${e}${t}`);function Rn(e,t,n,s){if(e===void 0)return"";let r=y(e,I,t,`Preview \
570
- identity ${n} environment name`,s);return(!Ui.test(r)||An.has(r)||r.startsWith("XDG_"))&&h(t,`Preview identity ${n} envi\
571
- ronment name is invalid.`,s),r}function Pn(e){return{seen:new Set,line:e}}function $n(e,t,n,s){let r=Dn.find(([u])=>t.startsWith(
572
- u));r||h(n,R("Preview identity entry",t,ct),s);let[i,o,c]=r,a=at(t,i,n,`Preview identity ${c}`,s);!["command","identityT\
573
+ (default ${Cn})`]],ct=Dn.map(([e,,,t])=>`${e}${t}`);function kn(e,t,n,s){if(e===void 0)return"";let i=y(e,I,t,`Preview \
574
+ identity ${n} environment name`,s);return(!Wi.test(i)||An.has(i)||i.startsWith("XDG_"))&&h(t,`Preview identity ${n} envi\
575
+ ronment name is invalid.`,s),i}function Pn(e){return{seen:new Set,line:e}}function $n(e,t,n,s){let i=Dn.find(([u])=>t.startsWith(
576
+ u));i||h(n,k("Preview identity entry",t,ct),s);let[r,o,c]=i,a=at(t,r,n,`Preview identity ${c}`,s);!["command","identityT\
573
577
  ypes","runtimes"].includes(o)&&a.length!==1&&h(n,`Preview identity ${c} accepts exactly one value.`,s),A(e,o,a,n,s,`Prev\
574
578
  iew identity ${c} entry`)}function xn(e,t,n){for(let[u,p]of[["command","Command"],["protocol","Protocol"],["identityType\
575
579
  s","Identity types"]])e[u]||h(t,`Output target ${n} Preview identity needs ${p}.`,e.line);let s=e.command.map(u=>`\`${u}\
576
- \``).join(" "),r=D(s,I,t,"Preview identity command",e.line);(!r[0].includes("/")||r[0].includes("\\")||r[0].split("/").some(
577
- u=>!u||[".",".."].includes(u))||r.some(u=>/\{(?:host|port)\}/u.test(u)))&&h(t,"Preview identity command must use a liter\
578
- al app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==me&&h(t,`Preview identity protocol must be ${me}\
580
+ \``).join(" "),i=D(s,I,t,"Preview identity command",e.line);(!i[0].includes("/")||i[0].includes("\\")||i[0].split("/").some(
581
+ u=>!u||[".",".."].includes(u))||i.some(u=>/\{(?:host|port)\}/u.test(u)))&&h(t,"Preview identity command must use a liter\
582
+ al app-owned project-relative executable.",e.line);let r=e.protocol[0];r!==me&&h(t,`Preview identity protocol must be ${me}\
579
583
  .`,e.line);let o=[...new Set(e.identityTypes.map(u=>(Nn.has(u)||h(t,`Unsupported preview identity type: ${u}.`,e.line),u)))];
580
- o.length!==e.identityTypes.length&&h(t,"Preview identity types must not contain duplicates.",e.line);let c={enabled:Rn(e.
581
- enabledEnvironment?.[0],t,"enabled",e.line),secret:Rn(e.secretEnvironment?.[0],t,"secret",e.line)};c.enabled&&c.enabled===
584
+ o.length!==e.identityTypes.length&&h(t,"Preview identity types must not contain duplicates.",e.line);let c={enabled:kn(e.
585
+ enabledEnvironment?.[0],t,"enabled",e.line),secret:kn(e.secretEnvironment?.[0],t,"secret",e.line)};c.enabled&&c.enabled===
582
586
  c.secret&&h(t,"Preview identity enabled and secret environment names must differ.",e.line);let a=Cn;if(e.timeoutMs){let u=e.
583
587
  timeoutMs[0];/^[0-9]+$/u.test(u)||h(t,`Preview identity Timeout ms must be from 1 through ${De}.`,e.line),a=Number(u),(!Number.
584
- isSafeInteger(a)||a<1||a>De)&&h(t,`Preview identity Timeout ms must be from 1 through ${De}.`,e.line)}return{command:r,environment:c,
585
- identityTypes:o,protocol:i,runtimes:e.runtimes?P(e.runtimes.map(u=>`\`${u}\``).join(" "),I,t,"Preview identity runtimes",
586
- e.line):[],timeoutMs:a}}var Wi="vibe64.outputs.v1",$e="Outputs",Bi=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,ut=/\{([a-z][a-z0-9:-]*)\}/gu,Hi=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
587
- zi=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,Fi=/^#### Download `([^`\r\n]+)`$/u,qi=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
588
- Mn=new Set(["finite","interactive"]),pt=new Set(["development","test"]),jn=new Set(["terminal","web"]),Vn=16,Pe=e=>[...e].
589
- map(t=>`\`${t}\``).join(" or "),Yi=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
588
+ isSafeInteger(a)||a<1||a>De)&&h(t,`Preview identity Timeout ms must be from 1 through ${De}.`,e.line)}return{command:i,environment:c,
589
+ identityTypes:o,protocol:r,runtimes:e.runtimes?P(e.runtimes.map(u=>`\`${u}\``).join(" "),I,t,"Preview identity runtimes",
590
+ e.line):[],timeoutMs:a}}var Bi="vibe64.outputs.v1",$e="Outputs",Hi=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,ut=/\{([a-z][a-z0-9:-]*)\}/gu,zi=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
591
+ Fi=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,qi=/^#### Download `([^`\r\n]+)`$/u,Yi=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
592
+ Mn=new Set(["finite","interactive"]),pt=new Set(["development","test"]),jn=new Set(["terminal","web"]),Ln=16,Pe=e=>[...e].
593
+ map(t=>`\`${t}\``).join(" or "),Ki=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
590
594
  on","#### Preview identity","#### Download `id`"]),xe=Object.freeze({target:["- Default.",`- Mode: ${Pe(Mn)}`,`- Data: ${Pe(
591
595
  pt)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
592
596
  "- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${Pe(jn)}`,"- Preferred port: `1024` t\
593
597
  hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:ct,download:["- Path:\
594
- `path`","- Name: `file-name`","- Media type: `type/subtype`"]});function lt(e,t,n,s){let r=y(e,I,t,n,s);return Bi.test(
595
- r)||h(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),r}function Ki(e,t,n,s){let r=D(e,I,t,n,s);for(let i of r)
596
- i.replace(ut,"").includes("{parameter:")&&h(t,`${n} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(ut)].some(
598
+ `path`","- Name: `file-name`","- Media type: `type/subtype`"]});function lt(e,t,n,s){let i=y(e,I,t,n,s);return Hi.test(
599
+ i)||h(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),i}function Xi(e,t,n,s){let i=D(e,I,t,n,s);for(let r of i)
600
+ r.replace(ut,"").includes("{parameter:")&&h(t,`${n} has an invalid {parameter:id} placeholder.`,s),[...r.matchAll(ut)].some(
597
601
  o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&h(t,`${n} supports only {host}\
598
- , {port}, and {parameter:id} placeholders.`,s);return r}function Xi(e,t,n){return{id:lt(e[1],t,"Output target id",n),label:y(
602
+ , {port}, and {parameter:id} placeholders.`,s);return i}function Ji(e,t,n){return{id:lt(e[1],t,"Output target id",n),label:y(
599
603
  e[2],I,t,"Output target label",n),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,
600
- downloads:[],parameters:[],seen:new Set,line:n}}function Ji(e,t,n,s){if(t==="- Required."){A(e,"required",!0,n,s,"Parame\
601
- ter Required entry");return}for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(t.startsWith(
602
- o)){let c=j(t,o,n,`Parameter ${r}`,s);A(e,i,c,n,s,`Parameter ${r} entry`);return}}h(n,R("Outputs parameter entry",t,xe.parameter),
603
- s)}function Zi(e,t={}){let n=e.parameters||[],s=i=>m("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!t||typeof t!="obj\
604
- ect"||Array.isArray(t))&&s("Output parameters must be an object of text values.");let r=new Set(n.map(({id:i})=>i));for(let i of Object.
605
- keys(t))r.has(i)||s(`Unknown output parameter: ${i}.`);return Object.fromEntries(n.map(i=>{let o=Object.hasOwn(t,i.id)?t[i.
606
- id]:i.default;return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${i.label} must be a single line of tex\
607
- t, at most 4096 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function Qi(e){return{kind:"",
608
- preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function er(e,t,n){return{id:lt(e[1],t,"Download id",
609
- n),path:"",name:"",mediaType:"",seen:new Set,line:n}}function tr(e,t,n){/^[0-9]+$/u.test(e)||h(t,"Web presentation prefe\
604
+ downloads:[],parameters:[],seen:new Set,line:n}}function Zi(e,t,n,s){if(t==="- Required."){A(e,"required",!0,n,s,"Parame\
605
+ ter Required entry");return}for(let[i,r]of[["Default","default"],["Description","description"]]){let o=`- ${i}: `;if(t.startsWith(
606
+ o)){let c=j(t,o,n,`Parameter ${i}`,s);A(e,r,c,n,s,`Parameter ${i} entry`);return}}h(n,k("Outputs parameter entry",t,xe.parameter),
607
+ s)}function Qi(e,t={}){let n=e.parameters||[],s=r=>m("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",r);(!t||typeof t!="obj\
608
+ ect"||Array.isArray(t))&&s("Output parameters must be an object of text values.");let i=new Set(n.map(({id:r})=>r));for(let r of Object.
609
+ keys(t))i.has(r)||s(`Unknown output parameter: ${r}.`);return Object.fromEntries(n.map(r=>{let o=Object.hasOwn(t,r.id)?t[r.
610
+ id]:r.default;return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${r.label} must be a single line of tex\
611
+ t, at most 4096 characters.`),r.required&&!o.trim()&&s(`${r.label} is required.`),[r.id,o]}))}function er(e){return{kind:"",
612
+ preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function tr(e,t,n){return{id:lt(e[1],t,"Download id",
613
+ n),path:"",name:"",mediaType:"",seen:new Set,line:n}}function nr(e,t,n){/^[0-9]+$/u.test(e)||h(t,"Web presentation prefe\
610
614
  rred port must be an integer from 1024 through 65535.",n);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&
611
- h(t,"Web presentation preferred port must be an integer from 1024 through 65535.",n),s}function nr(e,t,n,s){if(t.startsWith(
612
- "- Data: ")){let i=j(t,"- Data: ",n,"Output target Data",s);pt.has(i)||h(n,`Output target Data must be ${Pe(pt)}.`,s),A(
613
- e,"dataMode",i,n,s,"output target Data entry");return}if(t==="- Default."){A(e,"default",!0,n,s,"output target Default e\
614
- ntry");return}if(t.startsWith("- Mode: ")){let i=j(t,"- Mode: ",n,"Output target Mode",s);Mn.has(i)||h(n,"Output target \
615
- Mode must be `interactive` or `finite`.",s),A(e,"mode",i,n,s,"output target Mode entry");return}if(t.startsWith("- Workd\
615
+ h(t,"Web presentation preferred port must be an integer from 1024 through 65535.",n),s}function sr(e,t,n,s){if(t.startsWith(
616
+ "- Data: ")){let r=j(t,"- Data: ",n,"Output target Data",s);pt.has(r)||h(n,`Output target Data must be ${Pe(pt)}.`,s),A(
617
+ e,"dataMode",r,n,s,"output target Data entry");return}if(t==="- Default."){A(e,"default",!0,n,s,"output target Default e\
618
+ ntry");return}if(t.startsWith("- Mode: ")){let r=j(t,"- Mode: ",n,"Output target Mode",s);Mn.has(r)||h(n,"Output target \
619
+ Mode must be `interactive` or `finite`.",s),A(e,"mode",r,n,s,"output target Mode entry");return}if(t.startsWith("- Workd\
616
620
  ir: ")){A(e,"workdir",w(j(t,"- Workdir: ",n,"Output target Workdir",s),I,n,"Output target workdir",s),n,s,"output target\
617
621
  Workdir entry");return}if(t.startsWith("- Runtimes: ")){A(e,"runtimeRequirements",P(t.slice(12),I,n,"Output target runt\
618
- imes",s),n,s,"output target Runtimes entry");return}let r=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(r){
619
- let i=r[1].toLowerCase(),o=Ki(r[3],n,"Output step command",s);i!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&h(n,"O\
620
- nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:y(r[2],I,n,"Output step\
621
- label",s),argv:o,role:i});return}h(n,R("Outputs target entry",t,[...xe.target,...Yi.slice(1)]),s)}function sr(e,t,n,s){
622
- if(t.startsWith("- Kind: ")){let r=j(t,"- Kind: ",n,"Presentation Kind",s);jn.has(r)||h(n,"Presentation Kind must be `te\
623
- rminal` or `web`.",s),A(e,"kind",r,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){A(e,"pre\
624
- ferredPort",tr(j(t,"- Preferred port: ",n,"Web presentation Preferred port",s),n,s),n,s,"Presentation Preferred port ent\
622
+ imes",s),n,s,"output target Runtimes entry");return}let i=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(i){
623
+ let r=i[1].toLowerCase(),o=Xi(i[3],n,"Output step command",s);r!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&h(n,"O\
624
+ nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:y(i[2],I,n,"Output step\
625
+ label",s),argv:o,role:r});return}h(n,k("Outputs target entry",t,[...xe.target,...Ki.slice(1)]),s)}function ir(e,t,n,s){
626
+ if(t.startsWith("- Kind: ")){let i=j(t,"- Kind: ",n,"Presentation Kind",s);jn.has(i)||h(n,"Presentation Kind must be `te\
627
+ rminal` or `web`.",s),A(e,"kind",i,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){A(e,"pre\
628
+ ferredPort",nr(j(t,"- Preferred port: ",n,"Web presentation Preferred port",s),n,s),n,s,"Presentation Preferred port ent\
625
629
  ry");return}if(t.startsWith("- URL path: ")){A(e,"urlPath",Fe(j(t,"- URL path: ",n,"Web presentation URL path",s),I,n,"W\
626
630
  eb presentation URL path",s),n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){A(e,"readiness",
627
- oe(t,I,n,"Web presentation readiness",s),n,s,"Presentation Ready when entry");return}h(n,R("Presentation entry",t,xe.presentation),
628
- s)}function ir(e,t,n){let s=y(e,I,t,"Download Name",n);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
629
- s.trim()!==s)&&h(t,"Download Name must be a safe filename without path separators.",n),s}function rr(e,t,n){let s=y(e,I,
630
- t,"Download Media type",n);return(s.length>127||!qi.test(s))&&h(t,"Download Media type must be a lowercase type/subtype \
631
- value.",n),s}function or(e,t,n,s){if(t.startsWith("- Path: ")){A(e,"path",w(j(t,"- Path: ",n,"Download Path",s),I,n,"Dow\
632
- nload path",s,{allowRoot:!1}),n,s,"Download Path entry");return}if(t.startsWith("- Name: ")){A(e,"name",ir(j(t,"- Name: ",
633
- n,"Download Name",s),n,s),n,s,"Download Name entry");return}if(t.startsWith("- Media type: ")){A(e,"mediaType",rr(j(t,"-\
634
- Media type: ",n,"Download Media type",s),n,s),n,s,"Download Media type entry");return}h(n,R("Download entry",t,xe.download),
635
- s)}function ar(e,t,n){for(let[s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(t,`Output targe\
636
- t ${n} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function cr(e,t,n){
631
+ ae(t,I,n,"Web presentation readiness",s),n,s,"Presentation Ready when entry");return}h(n,k("Presentation entry",t,xe.presentation),
632
+ s)}function rr(e,t,n){let s=y(e,I,t,"Download Name",n);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
633
+ s.trim()!==s)&&h(t,"Download Name must be a safe filename without path separators.",n),s}function or(e,t,n){let s=y(e,I,
634
+ t,"Download Media type",n);return(s.length>127||!Yi.test(s))&&h(t,"Download Media type must be a lowercase type/subtype \
635
+ value.",n),s}function ar(e,t,n,s){if(t.startsWith("- Path: ")){A(e,"path",w(j(t,"- Path: ",n,"Download Path",s),I,n,"Dow\
636
+ nload path",s,{allowRoot:!1}),n,s,"Download Path entry");return}if(t.startsWith("- Name: ")){A(e,"name",rr(j(t,"- Name: ",
637
+ n,"Download Name",s),n,s),n,s,"Download Name entry");return}if(t.startsWith("- Media type: ")){A(e,"mediaType",or(j(t,"-\
638
+ Media type: ",n,"Download Media type",s),n,s),n,s,"Download Media type entry");return}h(n,k("Download entry",t,xe.download),
639
+ s)}function cr(e,t,n){for(let[s,i]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(t,`Output targe\
640
+ t ${n} Download ${e.id} needs ${i}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function ur(e,t,n){
637
641
  return e.kind||h(t,`Output target ${n} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
638
642
  readiness||e.seen.has("urlPath"))&&h(t,`Output target ${n} terminal Presentation accepts only Kind.`,e.line),{kind:"term\
639
643
  inal"}):(e.readiness||h(t,`Output target ${n} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.
640
- preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function Ln(e,t){e.mode||h(t,`Output target ${e.id} needs one Mo\
644
+ preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function Vn(e,t){e.mode||h(t,`Output target ${e.id} needs one Mo\
641
645
  de entry.`,e.line),e.steps.length===0&&h(t,`Output target ${e.id} needs at least one step.`,e.line);let n={prepare:0,build:1,
642
646
  run:2};for(let u=1;u<e.steps.length;u+=1)n[e.steps[u].role]<n[e.steps[u-1].role]&&h(t,`Output target ${e.id} steps must \
643
- be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),r=e.downloads.map(u=>ar(u,t,e.
644
- id));new Set(r.map(({id:u})=>u)).size!==r.length&&h(t,`Output target ${e.id} contains a duplicate Download id.`,e.line),
647
+ be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),i=e.downloads.map(u=>cr(u,t,e.
648
+ id));new Set(i.map(({id:u})=>u)).size!==i.length&&h(t,`Output target ${e.id} contains a duplicate Download id.`,e.line),
645
649
  e.mode==="finite"?((s.length>0||e.presentation||e.previewIdentity)&&h(t,`Finite output target ${e.id} cannot have Run, P\
646
- resentation, or Preview identity entries.`,e.line),r.length===0&&h(t,`Finite output target ${e.id} needs at least one Do\
650
+ resentation, or Preview identity entries.`,e.line),i.length===0&&h(t,`Finite output target ${e.id} needs at least one Do\
647
651
  wnload.`,e.line)):s.length!==1||e.steps.at(-1).role!=="run"?h(t,`Interactive output target ${e.id} needs exactly one fin\
648
- al Run step.`,e.line):e.presentation||h(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?
649
- cr(e.presentation,t,e.id):null,o=e.steps.flatMap(({argv:u})=>u.flatMap(p=>[...p.matchAll(ut)].map(d=>d[1])));o.some(u=>[
650
- "host","port"].includes(u))&&i?.kind!=="web"&&h(t,"Only a web output target may use {host} or {port} placeholders.",e.line);
651
- let c=e.parameters.map(({seen:u,...p})=>p),a=new Set(c.map(({id:u})=>u));(c.length>Vn||a.size!==c.length)&&h(t,`Output t\
652
- arget ${e.id} may declare at most ${Vn} parameters with unique ids.`,e.line);for(let u of o.filter(p=>p.startsWith("para\
652
+ al Run step.`,e.line):e.presentation||h(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let r=e.presentation?
653
+ ur(e.presentation,t,e.id):null,o=e.steps.flatMap(({argv:u})=>u.flatMap(p=>[...p.matchAll(ut)].map(d=>d[1])));o.some(u=>[
654
+ "host","port"].includes(u))&&r?.kind!=="web"&&h(t,"Only a web output target may use {host} or {port} placeholders.",e.line);
655
+ let c=e.parameters.map(({seen:u,...p})=>p),a=new Set(c.map(({id:u})=>u));(c.length>Ln||a.size!==c.length)&&h(t,`Output t\
656
+ arget ${e.id} may declare at most ${Ln} parameters with unique ids.`,e.line);for(let u of o.filter(p=>p.startsWith("para\
653
657
  meter:"))){let p=u.slice(10);a.has(p)||h(t,`Undeclared output parameter: ${p}.`,e.line)}for(let u of c)o.includes(`param\
654
- eter:${u.id}`)||h(t,`Output parameter ${u.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!==
658
+ eter:${u.id}`)||h(t,`Output parameter ${u.id} must be used in a step command.`,e.line);return e.previewIdentity&&r?.kind!==
655
659
  "web"&&h(t,"Only a web output target may declare Preview identity.",e.line),{id:e.id,label:e.label,default:e.default,mode:e.
656
- mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,
657
- downloads:r,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:xn(e.previewIdentity,t,e.id)}:{}}}function Ve(e,t={}){
660
+ mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:r,
661
+ downloads:i,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:xn(e.previewIdentity,t,e.id)}:{}}}function Le(e,t={}){
658
662
  let{path:n="genesis/stack.md#Outputs"}=t;if(Array.isArray(e)||h(n,"Outputs must be supplied as exact Stack section lines\
659
- ."),S(e))return{version:1,targets:[]};let s=[],r=null,i="target",o=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)
660
- continue;let p=a+1,d=u.match(Hi);if(d){r&&s.push(Ln(r,n)),r=Xi(d,n,p),i="target",o=null;continue}r||h(n,"## Outputs must\
661
- begin with a Target heading.",p);let l=u.match(zi);if(l){let E={id:lt(l[1],n,"Parameter id",p),label:y(l[2],I,n,"Parame\
662
- ter label",p),default:"",description:"",required:!1,seen:new Set};r.parameters.push(E),i="parameter",o=E;continue}if(u===
663
- "#### Presentation"){r.presentation&&h(n,"Presentation must appear at most once below an output target.",p),r.presentation=
664
- Qi(p),i="presentation",o=r.presentation;continue}if(u==="#### Preview identity"){r.previewIdentity&&h(n,"Preview identit\
665
- y must appear at most once below an output target.",p),r.previewIdentity=Pn(p),i="previewIdentity",o=r.previewIdentity;continue}
666
- let g=u.match(Fi);if(g){let E=er(g,n,p);r.downloads.push(E),i="download",o=E;continue}i==="parameter"?Ji(o,u,n,p):i==="p\
667
- resentation"?sr(o,u,n,p):i==="previewIdentity"?$n(o,u,n,p):i==="download"?or(o,u,n,p):nr(r,u,n,p)}r&&s.push(Ln(r,n)),s.length===
663
+ ."),S(e))return{version:1,targets:[]};let s=[],i=null,r="target",o=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)
664
+ continue;let p=a+1,d=u.match(zi);if(d){i&&s.push(Vn(i,n)),i=Ji(d,n,p),r="target",o=null;continue}i||h(n,"## Outputs must\
665
+ begin with a Target heading.",p);let l=u.match(Fi);if(l){let E={id:lt(l[1],n,"Parameter id",p),label:y(l[2],I,n,"Parame\
666
+ ter label",p),default:"",description:"",required:!1,seen:new Set};i.parameters.push(E),r="parameter",o=E;continue}if(u===
667
+ "#### Presentation"){i.presentation&&h(n,"Presentation must appear at most once below an output target.",p),i.presentation=
668
+ er(p),r="presentation",o=i.presentation;continue}if(u==="#### Preview identity"){i.previewIdentity&&h(n,"Preview identit\
669
+ y must appear at most once below an output target.",p),i.previewIdentity=Pn(p),r="previewIdentity",o=i.previewIdentity;continue}
670
+ let g=u.match(qi);if(g){let E=tr(g,n,p);i.downloads.push(E),r="download",o=E;continue}r==="parameter"?Zi(o,u,n,p):r==="p\
671
+ resentation"?ir(o,u,n,p):r==="previewIdentity"?$n(o,u,n,p):r==="download"?ar(o,u,n,p):sr(i,u,n,p)}i&&s.push(Vn(i,n)),s.length===
668
672
  0&&h(n,"## Outputs needs at least one Target or exactly `- Nothing.`.");let c=s.map(({id:a})=>a);return new Set(c).size!==
669
673
  c.length&&h(n,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(n,"Outputs may declare a\
670
- t most one default target."),{version:1,targets:s}}function ur(e,t={}){let{resourcesPreparing:n=!1}=t,s=e.details||{},r=Array.
671
- isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:[]).map((c,a)=>Array.isArray(r[a])&&r[a].
672
- length?r[a].join(" and "):String(c)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!i.length)return e.message;let o=String(
674
+ t most one default target."),{version:1,targets:s}}function pr(e,t={}){let{resourcesPreparing:n=!1}=t,s=e.details||{},i=Array.
675
+ isArray(s.missing)?s.missing:[],r=(Array.isArray(s.alternatives)?s.alternatives:[]).map((c,a)=>Array.isArray(i[a])&&i[a].
676
+ length?i[a].join(" and "):String(c)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!r.length)return e.message;let o=String(
673
677
  s.resource||"").trim()||"resources";return n?`Vibe64 is still setting up this app's ${o}. Preview can start when workspa\
674
- ce setup finishes; then press Check again.`:`This app needs its ${o} before Preview can start: set ${i.join(", or ")} in\
678
+ ce setup finishes; then press Check again.`:`This app needs its ${o} before Preview can start: set ${r.join(", or ")} in\
675
679
  Env (in Dash, under Development), then press Check again.`}function Gn({environment:e={},section:t={},resourcesPreparing:n=!1}={}){
676
- z(t,e,"Outputs section");let s=[...t.diagnostics||[]],r=[...e.diagnostics||[]],i={version:1,targets:[]};t.status==="read\
677
- y"&&(i=Ve(t.lines));let o=r.length===0?null:[...new Set(r.map(p=>ur(p,{resourcesPreparing:n})))].join(" "),c=i.targets.map(
678
- p=>({...p,source:t.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],u="ready";return a.
679
- length>0?u="blocked":c.length===0&&(u="unconfigured"),{contract:Wi,status:u,stackHash:t.stackHash,components:[...t.components||
680
+ z(t,e,"Outputs section");let s=[...t.diagnostics||[]],i=[...e.diagnostics||[]],r={version:1,targets:[]};t.status==="read\
681
+ y"&&(r=Le(t.lines));let o=i.length===0?null:[...new Set(i.map(p=>pr(p,{resourcesPreparing:n})))].join(" "),c=r.targets.map(
682
+ p=>({...p,source:t.source||null,available:s.length===0&&i.length===0,disabledReason:o})),a=[...s,...i],u="ready";return a.
683
+ length>0?u="blocked":c.length===0&&(u="unconfigured"),{contract:Bi,status:u,stackHash:t.stackHash,components:[...t.components||
680
684
  []],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:F(c.flatMap(p=>p.runtimeRequirements)),
681
- resources:structuredClone(e.resources||[]),targets:c,diagnostics:a}}var Un="Project services",pr="vibe64.project-services.v1",ne="VIBE64_PROJECT_SERVICES_INVALID",se="genesis/stack.md#Proj\
682
- ect services",lr="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function Wn(e){
683
- if(Array.isArray(e)||m(ne,se,"Expected exact Project services section lines."),S(e))return[];let t=[];for(let[n,s]of e.entries()){
684
- let r=s.trim();if(!r)continue;let i=n+1,o=r.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
685
- o||m(ne,se,`Use: ${lr}`,i),t.some(({id:a})=>a===o[1])&&m(ne,se,"Duplicate project service id.",i);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
686
- t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:P(c?c[1]:o[3],ne,se,"Service runtimes",i),workdir:w(c?.[2]||
687
- ".",ne,se,"Service workdir",i),argv:D(o[4],ne,se,"Service command",i)})}return t.length||m(ne,se,"Declare a service or e\
688
- xactly `- Nothing.`."),t}function Bn(e={}){let t=e.status==="ready"?Wn(e.lines):[];return{contract:pr,status:e.status===
689
- "blocked"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?N(t):"",diagnostics:e.diagnostics||[]}}import{access as dr}from"node:fs/promises";import zn from"node:path";var mr="vibe64.workspace-setup.v1",he="Workspace setup",Le="VIBE64_WORKSPACE_SETUP_INVALID",Hn="- Prepare `label` [from \
690
- `path`...] with `runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",hr=/^- Prepare `([^`\r\n]+)` (.+)$/u,
691
- fr=/^from ((?:`[^`\r\n]+`[ \t]+)+)(with .+)$/u;function dt(e,t,n,s={}){m(Le,e,t,n,s)}function Me(e,t={}){let{path:n="gen\
685
+ resources:structuredClone(e.resources||[]),targets:c,diagnostics:a}}var Un="Project services",lr="vibe64.project-services.v1",se="VIBE64_PROJECT_SERVICES_INVALID",ie="genesis/stack.md#Proj\
686
+ ect services",dr="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function Wn(e){
687
+ if(Array.isArray(e)||m(se,ie,"Expected exact Project services section lines."),S(e))return[];let t=[];for(let[n,s]of e.entries()){
688
+ let i=s.trim();if(!i)continue;let r=n+1,o=i.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
689
+ o||m(se,ie,`Use: ${dr}`,r),t.some(({id:a})=>a===o[1])&&m(se,ie,"Duplicate project service id.",r);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
690
+ t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:P(c?c[1]:o[3],se,ie,"Service runtimes",r),workdir:w(c?.[2]||
691
+ ".",se,ie,"Service workdir",r),argv:D(o[4],se,ie,"Service command",r)})}return t.length||m(se,ie,"Declare a service or e\
692
+ xactly `- Nothing.`."),t}function Bn(e={}){let t=e.status==="ready"?Wn(e.lines):[];return{contract:lr,status:e.status===
693
+ "blocked"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?N(t):"",diagnostics:e.diagnostics||[]}}import{access as mr}from"node:fs/promises";import zn from"node:path";var hr="vibe64.workspace-setup.v1",he="Workspace setup",Ve="VIBE64_WORKSPACE_SETUP_INVALID",Hn="- Prepare `label` [from \
694
+ `path`...] with `runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",fr=/^- Prepare `([^`\r\n]+)` (.+)$/u,
695
+ gr=/^from ((?:`[^`\r\n]+`[ \t]+)+)(with .+)$/u;function dt(e,t,n,s={}){m(Ve,e,t,n,s)}function Me(e,t={}){let{path:n="gen\
692
696
  esis/stack.md#Workspace setup"}=t;if(Array.isArray(e)||dt(n,"Workspace setup must be supplied as exact Stack section lin\
693
- es."),S(e))return[];let s=[];for(let r=0;r<e.length;r+=1){let i=e[r].trim();if(!i)continue;let o=r+1,c=i.match(hr),a=c?.[2].
694
- match(fr);(!c||c[2].startsWith("from ")&&!a)&&dt(n,`Every Workspace setup entry must use: ${Hn}`,o,{observed:i}),s.push(
695
- {label:y(c[1],Le,n,"Workspace setup step label",o),...a?{inputs:ve(a[1].trimEnd(),Le,n,"Workspace setup inputs",o)}:{},...be(
696
- a?a[2]:c[2],Le,n,"Workspace setup",o,{form:Hn,observed:i})})}return s.length===0&&dt(n,"## Workspace setup needs at leas\
697
- t one Prepare entry or exactly `- Nothing.`."),s}async function gr(e,t){try{return await dr(zn.join(e,t)),!0}catch(n){if([
697
+ es."),S(e))return[];let s=[];for(let i=0;i<e.length;i+=1){let r=e[i].trim();if(!r)continue;let o=i+1,c=r.match(fr),a=c?.[2].
698
+ match(gr);(!c||c[2].startsWith("from ")&&!a)&&dt(n,`Every Workspace setup entry must use: ${Hn}`,o,{observed:r}),s.push(
699
+ {label:y(c[1],Ve,n,"Workspace setup step label",o),...a?{inputs:ve(a[1].trimEnd(),Ve,n,"Workspace setup inputs",o)}:{},...be(
700
+ a?a[2]:c[2],Ve,n,"Workspace setup",o,{form:Hn,observed:r})})}return s.length===0&&dt(n,"## Workspace setup needs at leas\
701
+ t one Prepare entry or exactly `- Nothing.`."),s}async function Er(e,t){try{return await mr(zn.join(e,t)),!0}catch(n){if([
698
702
  "ENOENT","ENOTDIR"].includes(n?.code))return!1;throw n}}async function Fn({projectRoot:e,section:t={}}={}){let n=[...t.diagnostics||
699
- []],s=[];t.status==="ready"&&(s=Me(t.lines));let r=[],i=[],o=zn.resolve(e);if(n.length===0)for(let l of s){if(!l.condition||
700
- await gr(o,l.condition.pathExists)){r.push(l);continue}l.condition.onMissing==="wait"&&i.push(l.condition.pathExists)}if(i.
701
- length>0){let l=F(i);n.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting for project ${l.length===
703
+ []],s=[];t.status==="ready"&&(s=Me(t.lines));let i=[],r=[],o=zn.resolve(e);if(n.length===0)for(let l of s){if(!l.condition||
704
+ await Er(o,l.condition.pathExists)){i.push(l);continue}l.condition.onMissing==="wait"&&r.push(l.condition.pathExists)}if(r.
705
+ length>0){let l=F(r);n.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting for project ${l.length===
702
706
  1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let c=n.some(({code:l})=>l==="VIBE64_WORKSPACE_SETUP_WAITING"),
703
- a=n.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),u="unconfigured";a?u="blocked":!c&&r.length>0&&(u="ready");let p=r.
704
- map(({condition:l,...g})=>g),d={version:1,steps:p};return{contract:mr,status:u,stackHash:t.stackHash,recipeHash:u==="rea\
707
+ a=n.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),u="unconfigured";a?u="blocked":!c&&i.length>0&&(u="ready");let p=i.
708
+ map(({condition:l,...g})=>g),d={version:1,steps:p};return{contract:hr,status:u,stackHash:t.stackHash,recipeHash:u==="rea\
705
709
  dy"?N(d):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:F(p.flatMap(l=>l.runtimeRequirements)),
706
- steps:p,diagnostics:n}}var Er="vibe64.resource-estimates.v1",je="Resource estimates",Kn="VIBE64_RESOURCE_ESTIMATES_INVALID",vr=1024*1024,qn=1024*
710
+ steps:p,diagnostics:n}}var vr="vibe64.resource-estimates.v1",je="Resource estimates",Kn="VIBE64_RESOURCE_ESTIMATES_INVALID",br=1024*1024,qn=1024*
707
711
  1024,Yn=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
708
712
  ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,t,n){m(Kn,
709
- e,t,n)}function mt(e,t,n,s,r){let i=e.get(t),o=e.get(n);return(i===void 0||o===void 0||i>o)&&G(s,"Each resource phase re\
710
- quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function Xn(e,t={}){
711
- let{path:n="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:r=!1}=t;(!Array.isArray(e)||e.length>2048||
713
+ e,t,n)}function mt(e,t,n,s,i){let r=e.get(t),o=e.get(n);return(r===void 0||o===void 0||r>o)&&G(s,"Each resource phase re\
714
+ quires typical and high estimates, with typical no greater than high.",i),{typicalBytes:r,highBytes:o}}function Xn(e,t={}){
715
+ let{path:n="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:i=!1}=t;(!Array.isArray(e)||e.length>2048||
712
716
  e.some(p=>typeof p!="string")||Buffer.byteLength(e.join(`
713
- `),"utf8")>64*1024)&&G(n,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let i={version:1,
714
- outputs:[],workspaceSetup:null};if(S(e))return i;let o=new Map(s.map(p=>[p.id,p])),c=new Set,a=null;function u(){if(!a)return;
717
+ `),"utf8")>64*1024)&&G(n,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let r={version:1,
718
+ outputs:[],workspaceSetup:null};if(S(e))return r;let o=new Map(s.map(p=>[p.id,p])),c=new Set,a=null;function u(){if(!a)return;
715
719
  let{targetId:p,mode:d,fields:l,line:g}=a;if(d==="interactive"){(l.has("typical")||l.has("high"))&&G(n,"Interactive outpu\
716
- ts require separate Startup and Running estimates.",g),i.outputs.push({targetId:p,mode:d,startup:mt(l,"startupTypical","\
720
+ ts require separate Startup and Running estimates.",g),r.outputs.push({targetId:p,mode:d,startup:mt(l,"startupTypical","\
717
721
  startupHigh",n,g),running:mt(l,"runningTypical","runningHigh",n,g)});return}(l.size!==2||!l.has("typical")||!l.has("high"))&&
718
- G(n,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",g);let E=mt(l,"typical","high",n,g);p?i.
719
- outputs.push({targetId:p,mode:d,execution:E}):i.workspaceSetup=E}for(let p=0;p<e.length;p+=1){let d=e[p].trim(),l=p+1;if(!d)
722
+ G(n,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",g);let E=mt(l,"typical","high",n,g);p?r.
723
+ outputs.push({targetId:p,mode:d,execution:E}):r.workspaceSetup=E}for(let p=0;p<e.length;p+=1){let d=e[p].trim(),l=p+1;if(!d)
720
724
  continue;let g=d.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(g||d==="### Workspace setup"){u();let $=g?.[1]||
721
- "",X=$?`output:${$}`:"workspace-setup";c.has(X)&&G(n,"Resource estimates contains a duplicate operation.",l),c.add(X);let re=o.
722
- get($);$&&!["interactive","finite"].includes(re?.mode)&&G(n,`Resource estimate references an undeclared output: ${$}.`,l),
723
- !$&&!r&&G(n,"Resource estimate references undeclared Workspace setup steps.",l),a={targetId:$,mode:re?.mode||"setup",fields:new Map,
725
+ "",X=$?`output:${$}`:"workspace-setup";c.has(X)&&G(n,"Resource estimates contains a duplicate operation.",l),c.add(X);let oe=o.
726
+ get($);$&&!["interactive","finite"].includes(oe?.mode)&&G(n,`Resource estimate references an undeclared output: ${$}.`,l),
727
+ !$&&!i&&G(n,"Resource estimate references undeclared Workspace setup steps.",l),a={targetId:$,mode:oe?.mode||"setup",fields:new Map,
724
728
  line:l};continue}let E=d.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),_=E&&Yn.get(E[1]);(!a||!_)&&G(n,`Expected an Output\
725
729
  or Workspace setup heading followed by positive integer MiB estimates: ${[...Yn.keys()].map($=>`- ${$}: \`number\``).join(
726
- "; ")}.`,l),a.fields.has(_)&&G(n,`Duplicate resource field: ${E[1]}.`,l);let k=Number(E[2]);(!Number.isSafeInteger(k)||k>
727
- qn)&&G(n,`Resource estimates must be between 1 and ${qn} MiB.`,l),a.fields.set(_,k*vr)}return u(),c.size===0&&G(n,"Resou\
728
- rce estimates needs an operation or exactly `- Nothing.`."),i}function Ge({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){
729
- z(e,t,"Resource estimates and Outputs"),z(e,n,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={
730
- version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=Xn(e.lines,{targets:t.status==="read\
731
- y"?Ve(t.lines).targets:[],hasWorkspaceSetup:n.status==="ready"&&Me(n.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
732
- kOperationError")throw o;s.push({code:Kn,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"i\
733
- nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:Er,status:i,stackHash:e.stackHash,sectionHash:e.
734
- sectionHash||"",estimatesHash:i==="ready"?N(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
735
- fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var br="vibe64.integration-setup.v1",Jn="Integration setup",fe="VIBE64_INTEGRATION_SETUP_INVALID",yr="- Command with `ru\
730
+ "; ")}.`,l),a.fields.has(_)&&G(n,`Duplicate resource field: ${E[1]}.`,l);let R=Number(E[2]);(!Number.isSafeInteger(R)||R>
731
+ qn)&&G(n,`Resource estimates must be between 1 and ${qn} MiB.`,l),a.fields.set(_,R*br)}return u(),c.size===0&&G(n,"Resou\
732
+ rce estimates needs an operation or exactly `- Nothing.`."),r}function Ge({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){
733
+ z(e,t,"Resource estimates and Outputs"),z(e,n,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],i={
734
+ version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{i=Xn(e.lines,{targets:t.status==="read\
735
+ y"?Le(t.lines).targets:[],hasWorkspaceSetup:n.status==="ready"&&Me(n.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
736
+ kOperationError")throw o;s.push({code:Kn,message:o.message,details:{...o.details,causeCode:o.code}})}let r=s.length>0?"i\
737
+ nvalid":i.outputs.length>0||i.workspaceSetup?"ready":"unconfigured";return{contract:vr,status:r,stackHash:e.stackHash,sectionHash:e.
738
+ sectionHash||"",estimatesHash:r==="ready"?N(i):"",source:e.source||null,outputs:i.outputs,workspaceSetup:i.workspaceSetup,
739
+ fallbackReason:r==="invalid"?"invalid-estimates":r==="unconfigured"?"not-declared":null,diagnostics:s}}var yr="vibe64.integration-setup.v1",Jn="Integration setup",fe="VIBE64_INTEGRATION_SETUP_INVALID",wr="- Command with `ru\
736
740
  ntime` in `workdir`: `command` `argument`...";function Zn(e,t={}){let{path:n="genesis/stack.md#Integration setup"}=t;if(Array.
737
- isArray(e)||m(fe,n,"Integration setup requires exact Stack section lines."),S(e))return null;let s=e.map(i=>i.trim()).filter(
738
- Boolean),r=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return r||m(fe,n,`Integration setu\
739
- p requires exactly one entry: ${yr}; or - Nothing.`),{argv:D(r[3],fe,n,"Integration setup command"),workdir:w(r[2],fe,n,
740
- "Integration setup workdir"),runtimeRequirements:P(r[1],fe,n,"Integration setup runtimes")}}function Qn({section:e={}}={}){
741
- let t=[...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?Zn(e.lines):null;return{contract:br,status:t.length?"blo\
741
+ isArray(e)||m(fe,n,"Integration setup requires exact Stack section lines."),S(e))return null;let s=e.map(r=>r.trim()).filter(
742
+ Boolean),i=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return i||m(fe,n,`Integration setu\
743
+ p requires exactly one entry: ${wr}; or - Nothing.`),{argv:D(i[3],fe,n,"Integration setup command"),workdir:w(i[2],fe,n,
744
+ "Integration setup workdir"),runtimeRequirements:P(i[1],fe,n,"Integration setup runtimes")}}function Qn({section:e={}}={}){
745
+ let t=[...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?Zn(e.lines):null;return{contract:yr,status:t.length?"blo\
742
746
  cked":n?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?N({version:1,command:n}):"",source:e.source||null,components:[
743
- ...e.components||[]],command:n,diagnostics:t}}var wr=new URL("./index.js",import.meta.url).href,ns=_r(wr),Ue=new Map;async function Ir(e){if(!W.isAbsolute(e||""))throw new TypeError(
747
+ ...e.components||[]],command:n,diagnostics:t}}var Sr=new URL("./index.js",import.meta.url).href,ns=Ir(Sr),Ue=new Map;async function Tr(e){if(!W.isAbsolute(e||""))throw new TypeError(
744
748
  "Genesis host context requires an absolute runtime root.");let t=W.join(e,"genesis-context");if(!Ue.has(t)){let n=Ht(t).
745
- catch(s=>{throw Ue.delete(t),s});Ue.set(t,n)}return Ue.get(t)}var{GENESIS_CONTRACTS:C,HOST_CONTEXT_RESOLVER_DATA_ENV:Tr,
746
- HOST_CONTEXT_RESOLVER_ENV:Or,PROMPT_TASKS:ss,addStack:kr,applyTemplate:Rr,generatePrompt:Ar,indexCodebase:Nr,initialize:Cr,
747
- inspectCollaboration:Dr,inspectDerivedArtifacts:Pr,inspectEngineering:$r,inspectEnvironment:We,inspectPasses:xr,inspectProject:Vr,
748
- inspectProjectFormat:Lr,inspectAgentIntegrations:Mr,inspectSkills:jr,inspectStackSection:Gr,inspectStackSections:Ur,inspectSubsystems:Wr,
749
- listStackPieces:Br,listTemplates:Hr,parserEnvironment:La,setCollaboration:zr,setEngineeringProfile:Fr,syncAgentIntegrations:qr,
750
- syncSkills:Yr,withTrustedGitRepository:Kr,SOURCE_EXPLANATION_PROMPT_VERSION:Ma,sourceExplanationGuidance:ja,validateArchitectureFacts:Ga,
751
- mergeArchitectureObservations:Ua,validateCityDocument:Wa,validateCallWeb:Ba,CALL_WEB_SCHEMA:Ha,MACHINE_CITY_SCHEMA:za,PROGRAM_CITY_SCHEMA:Fa,
752
- CITY_SCHEMA_VERSION:qa}=ge;async function Ya(e){let t=await Ir(e);return{[Or]:no(),[Tr]:JSON.stringify({registryPath:t.registryPath}),
753
- GENESIS_TURN_CONTEXT_ENABLED:"0"}}var Ka="genesis/blueprint.md",Xa="genesis/subsystems.md",Xr=Object.freeze(["vue","djan\
754
- go-postgresql","jskit-postgresql","postgresql","rails-postgresql","spring-boot-postgresql"]),Jr=Object.freeze(["genesis-\
749
+ catch(s=>{throw Ue.delete(t),s});Ue.set(t,n)}return Ue.get(t)}var{GENESIS_CONTRACTS:C,HOST_CONTEXT_RESOLVER_DATA_ENV:Or,
750
+ HOST_CONTEXT_RESOLVER_ENV:Rr,PROMPT_TASKS:ss,addStack:kr,applyTemplate:Ar,generatePrompt:Nr,indexCodebase:Cr,initialize:Dr,
751
+ inspectCollaboration:Pr,inspectDerivedArtifacts:$r,inspectEngineering:xr,inspectEnvironment:We,inspectPasses:Lr,inspectProject:Vr,
752
+ inspectProjectFormat:Mr,inspectAgentIntegrations:jr,inspectSkills:Gr,inspectStackSection:Ur,inspectStackSections:Wr,inspectSubsystems:Br,
753
+ listStackPieces:Hr,listTemplates:zr,parserEnvironment:Ma,setCollaboration:Fr,setEngineeringProfile:qr,syncAgentIntegrations:Yr,
754
+ syncSkills:Kr,withTrustedGitRepository:Xr,SOURCE_EXPLANATION_PROMPT_VERSION:ja,sourceExplanationGuidance:Ga,validateArchitectureFacts:Ua,
755
+ mergeArchitectureObservations:Wa,validateCityDocument:Ba,validateCallWeb:Ha,CALL_WEB_SCHEMA:za,MACHINE_CITY_SCHEMA:Fa,PROGRAM_CITY_SCHEMA:qa,
756
+ CITY_SCHEMA_VERSION:Ya}=ge;async function Ka(e){let t=await Tr(e);return{[Rr]:so(),[Or]:JSON.stringify({registryPath:t.registryPath}),
757
+ GENESIS_TURN_CONTEXT_ENABLED:"0"}}var Xa="genesis/blueprint.md",Ja="genesis/subsystems.md",Jr=Object.freeze(["vue","djan\
758
+ go-postgresql","jskit-postgresql","postgresql","rails-postgresql","spring-boot-postgresql"]),Zr=Object.freeze(["genesis-\
755
759
  stack"]),ts=Object.freeze({BLUEPRINT_INVALID:"blueprint",BLUEPRINT_REQUIRED:"start"});if(!Array.isArray(ss))throw new Error(
756
760
  "This genesis-compiler lists no prompt tasks. Update it to the release Vibe64 declares.");var is=new Set(ss),ht=15e3;function ft(e,t=ht){
757
- let n,s=new Promise((r,i)=>{n=setTimeout(()=>i(Object.assign(new Error(`Genesis did not answer within ${t} ms.`),{code:"\
758
- vibe64_genesis_timeout"})),t)});return Promise.race([Promise.resolve().then(e),s]).finally(()=>clearTimeout(n))}function Zr(e,t={}){
759
- let{required:n=!1}=t,s=L(e);if(!s&&!n)return"";if(!is.has(s))throw new TypeError(s?`Unknown Genesis prompt task: ${s}.`:
760
- "Genesis prompt actions require an explicit task.");return s}function Qr(e={}){return Zr(e.genesisTask)||"work"}function eo(e={},t={}){
761
- return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,t.label].map(L).find(Boolean)||"Continue the requ\
762
- ested project work."}function to(){let e=(ns.resolve.paths("genesis-compiler")||[]).find(t=>es(W.join(t,"genesis-compile\
761
+ let n,s=new Promise((i,r)=>{n=setTimeout(()=>r(Object.assign(new Error(`Genesis did not answer within ${t} ms.`),{code:"\
762
+ vibe64_genesis_timeout"})),t)});return Promise.race([Promise.resolve().then(e),s]).finally(()=>clearTimeout(n))}function Qr(e,t={}){
763
+ let{required:n=!1}=t,s=V(e);if(!s&&!n)return"";if(!is.has(s))throw new TypeError(s?`Unknown Genesis prompt task: ${s}.`:
764
+ "Genesis prompt actions require an explicit task.");return s}function eo(e={}){return Qr(e.genesisTask)||"work"}function to(e={},t={}){
765
+ return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,t.label].map(V).find(Boolean)||"Continue the requ\
766
+ ested project work."}function no(){let e=(ns.resolve.paths("genesis-compiler")||[]).find(t=>es(W.join(t,"genesis-compile\
763
767
  r"))&&es(W.join(t,".bin","genesis")));if(!e)throw new Error("The installed Genesis compiler executable could not be loca\
764
768
  ted.");return W.join(e,".bin")}function rs(){let e=ns.resolve("@local/vibe64-genesis/server");return W.resolve(W.dirname(
765
- e),"../../bin")}function no(){return W.resolve(rs(),"vibe64-genesis-host-context")}function Ja(e=[]){let t=rs(),n=to();return[
766
- ...(Array.isArray(e)?e:[]).filter(r=>![t,n].includes(L(r))),t]}function so(e={},t={}){let{prompt:n=!1}=t;return{...e,...n?
767
- {hiddenStackPieces:Xr}:{},stackPackages:Jr}}function Za(e={}){return B(kr,e)}async function Qa(e={}){let t=await ie(Br,e);
769
+ e),"../../bin")}function so(){return W.resolve(rs(),"vibe64-genesis-host-context")}function Za(e=[]){let t=rs(),n=no();return[
770
+ ...(Array.isArray(e)?e:[]).filter(i=>![t,n].includes(V(i))),t]}function io(e={},t={}){let{prompt:n=!1}=t;return{...e,...n?
771
+ {hiddenStackPieces:Jr}:{},stackPackages:Zr}}function Qa(e={}){return B(kr,e)}async function ec(e={}){let t=await re(Hr,e);
768
772
  if(t.every(n=>Array.isArray(n?.resourceDeclarations)))return t;throw new Error("This genesis-compiler lists no Stack res\
769
- ource declarations. Update it to the release Vibe64 declares.")}function ec(e={}){return B(Cr,e)}function tc(e={}){return ie(
770
- jr,e)}function nc(e={}){return B(Yr,e)}function sc(e={}){return B(qr,e)}function ic(e={}){return ie(Mr,e)}function rc(e={}){
771
- return ie(Wr,e)}async function oc(e={}){return $t(await K(At,e))}async function ac(e={}){return Lt(await K(xt,e))}function cc(e={}){
772
- return B(Nr,e)}function io(){let e=Pr();if(e?.contract!==C.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||
773
+ ource declarations. Update it to the release Vibe64 declares.")}function tc(e={}){return B(Dr,e)}function nc(e={}){return re(
774
+ Gr,e)}function sc(e={}){return B(Kr,e)}function ic(e={}){return B(Yr,e)}function rc(e={}){return re(jr,e)}function oc(e={}){
775
+ return re(Br,e)}async function ac(e={}){return $t(await K(At,e))}async function cc(e={}){return Vt(await K(xt,e))}function uc(e={}){
776
+ return B(Cr,e)}function ro(){let e=$r();if(e?.contract!==C.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||
773
777
  "no contract identity"}; expected ${C.derivedArtifacts}.`);let t=Array.isArray(e.artifacts)?e.artifacts:[];if(!t.length||
774
- t.some(n=>!L(n?.path)))throw new Error("Genesis returned an invalid derived-artifact contract.");return{...e,artifacts:t.
775
- map(n=>({...n}))}}var os=io(),uc=Object.freeze(os.artifacts.map(e=>e.path)),gt=new Map(os.artifacts.map(e=>[e.id,e])),ro=gt.
776
- get("machine-city")?.path,oo=gt.get("program-city")?.path;if(!ro||!oo)throw new Error("Genesis did not declare both City\
777
- projection artifacts.");var ao=gt.get("call-web")?.path;if(!ao)throw new Error("Genesis did not declare its call-web ar\
778
- tifact.");async function B(e,t={},n={}){let s=L(t.projectRoot);if(!s||!W.isAbsolute(s))throw new TypeError("Genesis oper\
779
- ations require an explicit absolute projectRoot.");return Kr(s,()=>e(so(t,n)))}function as(){}function co(e){return`Gene\
780
- sis project guidance is unavailable for this conversation (${L(e?.message||e).replace(/\s+/gu," ").slice(0,300)||"no rea\
778
+ t.some(n=>!V(n?.path)))throw new Error("Genesis returned an invalid derived-artifact contract.");return{...e,artifacts:t.
779
+ map(n=>({...n}))}}var os=ro(),pc=Object.freeze(os.artifacts.map(e=>e.path)),gt=new Map(os.artifacts.map(e=>[e.id,e])),oo=gt.
780
+ get("machine-city")?.path,ao=gt.get("program-city")?.path;if(!oo||!ao)throw new Error("Genesis did not declare both City\
781
+ projection artifacts.");var co=gt.get("call-web")?.path;if(!co)throw new Error("Genesis did not declare its call-web ar\
782
+ tifact.");async function B(e,t={},n={}){let s=V(t.projectRoot);if(!s||!W.isAbsolute(s))throw new TypeError("Genesis oper\
783
+ ations require an explicit absolute projectRoot.");return Xr(s,()=>e(io(t,n)))}function as(){}function uo(e){return`Gene\
784
+ sis project guidance is unavailable for this conversation (${V(e?.message||e).replace(/\s+/gu," ").slice(0,300)||"no rea\
781
785
  son given"}). Work from the repository itself, where the genesis/ files still describe the project when present, and tel\
782
- l the user that Genesis guidance did not load if it matters to the request.`}async function pc({workdir:e,promptContext:t},{
783
- onGenesisUnavailable:n=as,timeoutMs:s=ht}={}){let r=ae(t);if(t.scope==="ephemeral")return r;let i;try{let o=await ft(()=>B(
784
- ge.projectSessionContext,{projectRoot:e,hostDriver:ae,hostDriverInput:t}),s);if(typeof o?.output=="string"&&o.output.trim())
785
- return o.output;i=new Error("Genesis returned no session guidance.")}catch(o){i=o}return n(i),`${co(i)}
786
+ l the user that Genesis guidance did not load if it matters to the request.`}async function lc({workdir:e,promptContext:t},{
787
+ onGenesisUnavailable:n=as,timeoutMs:s=ht}={}){let i=ce(t);if(t.scope==="ephemeral")return i;let r;try{let o=await ft(()=>B(
788
+ ge.projectSessionContext,{projectRoot:e,hostDriver:ce,hostDriverInput:t}),s);if(typeof o?.output=="string"&&o.output.trim())
789
+ return o.output;r=new Error("Genesis returned no session guidance.")}catch(o){r=o}return n(r),`${uo(r)}
786
790
 
787
- ${r}`}function ie(e,t={}){return ft(()=>B(e,t))}function cs(e,t){if(e?.contract!==t)throw new Error(`Genesis returned ${e?.
788
- contract||"no contract identity"}; expected ${t}.`);return e}async function H(e,t,n={}){return cs(await ie(e,n),t)}async function Et(e,t,n={}){
789
- return cs(await B(e,n),t)}function K(e,t={}){return H(n=>Gr({...n,name:e}),C.stackSection,t)}async function vt(e,t={}){let n=await ie(
790
- s=>Ur({...s,names:e}),t);if(!Array.isArray(n)||n.length!==e.length||n.some((s,r)=>s?.contract!==C.stackSection||s.name!==
791
- e[r]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return n}async function lc(e={}){if((await uo(
791
+ ${i}`}function re(e,t={}){return ft(()=>B(e,t))}function cs(e,t){if(e?.contract!==t)throw new Error(`Genesis returned ${e?.
792
+ contract||"no contract identity"}; expected ${t}.`);return e}async function H(e,t,n={}){return cs(await re(e,n),t)}async function Et(e,t,n={}){
793
+ return cs(await B(e,n),t)}function K(e,t={}){return H(n=>Ur({...n,name:e}),C.stackSection,t)}async function vt(e,t={}){let n=await re(
794
+ s=>Wr({...s,names:e}),t);if(!Array.isArray(n)||n.length!==e.length||n.some((s,i)=>s?.contract!==C.stackSection||s.name!==
795
+ e[i]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return n}async function dc(e={}){if((await po(
792
796
  e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its Stack can be\
793
- inspected."),{code:"vibe64_stack_format_required"});await Sr(W.join(e.projectRoot,Je),"utf8");let n=await K(he,e);return{
794
- components:n.components,stackHash:n.stackHash}}async function dc(e={}){let[t,n]=await Promise.all([K(hn,e),H(We,C.environment,
795
- e)]);return gn({environment:n,section:t})}async function mc(e={}){let[t,n]=await Promise.all([K(Sn,e),H(We,C.environment,
796
- e)]);return kn({environment:n,section:t})}function hc(e={}){return B(ge.verify,e)}function fc(e={}){return H(We,C.environment,
797
- e)}function gc(e={}){return H(Vr,C.projectInspection,e)}function Ec(e={}){return H(Hr,C.templates,e)}function vc(e={}){return Et(
798
- Rr,C.templateApplication,e)}function bc(e={}){return H($r,C.engineering,e)}function yc(e={}){return H(Dr,C.collaboration,
799
- e)}async function wc(e){let{unavailable:t,passes:n,master:s}=await H(xr,C.passes,e);return{unavailable:t,passes:n,master:s}}
800
- async function uo(e={}){let t=await ie(Lr,e);if(!L(t?.status))throw new Error("Genesis did not return a project-format s\
801
- tatus.");return{...t}}function Sc(e={}){return Et(Fr,C.engineering,e)}function _c(e={}){return Et(zr,C.collaboration,e)}
802
- async function Ic({resourcesPreparing:e=!1,...t}={}){let[[n,s,r],i]=await Promise.all([vt([$e,je,he],t),H(We,C.environment,
803
- t)]);return{...Gn({environment:i,section:n,resourcesPreparing:e===!0}),resourceEstimates:Ge({section:s,outputsSection:n,
804
- workspaceSetupSection:r})}}async function Tc(e={}){let t=await K(Jn,e);return Qn({section:t})}async function Oc(e={}){return Tt(
805
- await K(_t,e))}async function kc(e={}){return Bn(await K(Un,e))}async function Rc(e={}){let[t,n,s]=await vt([he,je,$e],e);
797
+ inspected."),{code:"vibe64_stack_format_required"});await _r(W.join(e.projectRoot,Je),"utf8");let n=await K(he,e);return{
798
+ components:n.components,stackHash:n.stackHash}}async function mc(e={}){let[t,n]=await Promise.all([K(hn,e),H(We,C.environment,
799
+ e)]);return gn({environment:n,section:t})}async function hc(e={}){let[t,n]=await Promise.all([K(Sn,e),H(We,C.environment,
800
+ e)]);return Rn({environment:n,section:t})}function fc(e={}){return B(ge.verify,e)}function gc(e={}){return H(We,C.environment,
801
+ e)}function Ec(e={}){return H(Vr,C.projectInspection,e)}function vc(e={}){return H(zr,C.templates,e)}function bc(e={}){return Et(
802
+ Ar,C.templateApplication,e)}function yc(e={}){return H(xr,C.engineering,e)}function wc(e={}){return H(Pr,C.collaboration,
803
+ e)}async function Sc(e){let{unavailable:t,passes:n,master:s}=await H(Lr,C.passes,e);return{unavailable:t,passes:n,master:s}}
804
+ async function po(e={}){let t=await re(Mr,e);if(!V(t?.status))throw new Error("Genesis did not return a project-format s\
805
+ tatus.");return{...t}}function _c(e={}){return Et(qr,C.engineering,e)}function Ic(e={}){return Et(Fr,C.collaboration,e)}
806
+ async function Tc({resourcesPreparing:e=!1,...t}={}){let[[n,s,i],r]=await Promise.all([vt([$e,je,he],t),H(We,C.environment,
807
+ t)]);return{...Gn({environment:r,section:n,resourcesPreparing:e===!0}),resourceEstimates:Ge({section:s,outputsSection:n,
808
+ workspaceSetupSection:i})}}async function Oc(e={}){let t=await K(Jn,e);return Qn({section:t})}async function Rc(e={}){return Tt(
809
+ await K(_t,e))}async function kc(e={}){return Bn(await K(Un,e))}async function Ac(e={}){let[t,n,s]=await vt([he,je,$e],e);
806
810
  return{...await Fn({projectRoot:e.projectRoot,section:t}),resourceEstimates:Ge({section:n,outputsSection:s,workspaceSetupSection:t})}}
807
- async function Ac(e={}){let[t,n,s]=await vt([je,$e,he],e);return Ge({section:t,outputsSection:n,workspaceSetupSection:s})}
808
- async function Nc({action:e={},environment:t,input:n={},onGenesisUnavailable:s=as,projectRoot:r,timeoutMs:i=ht}){let o=Qr(
809
- e),c=eo(n,e),a=E=>B(Ar,{environment:t,projectRoot:r,request:c,sessionContextInstalled:!0,task:E},{prompt:!0}),u=async()=>{
811
+ async function Nc(e={}){let[t,n,s]=await vt([je,$e,he],e);return Ge({section:t,outputsSection:n,workspaceSetupSection:s})}
812
+ async function Cc({action:e={},environment:t,input:n={},onGenesisUnavailable:s=as,projectRoot:i,timeoutMs:r=ht}){let o=eo(
813
+ e),c=to(n,e),a=E=>B(Nr,{environment:t,projectRoot:i,request:c,sessionContextInstalled:!0,task:E},{prompt:!0}),u=async()=>{
810
814
  try{return{result:await a(o),task:o}}catch(E){let _=Object.hasOwn(ts,String(E?.code))?ts[E.code]:"";if(!_||_===o||n.automaticGenesisTask===
811
- !0)throw E;return{result:await a(_),task:_}}},p;try{if(p=await ft(u,i),typeof p.result?.prompt!="string"||!p.result.prompt.
812
- trim())throw new Error("Genesis returned no prompt.")}catch(E){return s(E),{prompt:c}}let{result:d,task:l}=p,g=is.has(L(
813
- d.task))?L(d.task):l;return{context:{genesis:!0,requestedTask:o,task:g,verificationCommands:d.verificationCommands,warnings:d.
814
- warnings},originalPrompt:c,prompt:d.prompt,promptId:L(e.promptId||e.id)||g}}export{Ha as CALL_WEB_SCHEMA,qa as CITY_SCHEMA_VERSION,Ka as GENESIS_BLUEPRINT_PATH,ao as GENESIS_CALL_WEB_PATH,uc as GENESIS_DERIVED_ARTIFACT_PATHS,
815
- ro as GENESIS_MACHINE_CITY_PATH,oo as GENESIS_PROGRAM_CITY_PATH,Je as GENESIS_STACK_PATH,Mt as GENESIS_STACK_SECTION_AMBIGUOUS,
816
- Xa as GENESIS_SUBSYSTEMS_PATH,ht as GENESIS_USER_PATH_TIMEOUT_MS,za as MACHINE_CITY_SCHEMA,Fa as PROGRAM_CITY_SCHEMA,Ma as SOURCE_EXPLANATION_PROMPT_VERSION,
817
- mn as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,wi as VIBE64_APPLICATION_DEPLOYMENT_V1_CONTRACT,Ce as VIBE64_PACKAGING_CONTRACT,
818
- me as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,Za as addGenesisStack,vc as applyGenesisTemplate,Zr as assertGenesisPromptTask,
819
- rs as genesisCommandShimDirectory,to as genesisPackageBinDirectory,La as genesisParserEnvironment,Ms as genesisProjectContractNeedsAttention,
820
- Us as genesisProjectFileDiagnostic,Gs as genesisProjectFileUnreadable,eo as genesisPromptRequest,Qr as genesisPromptTask,
821
- ec as initializeGenesisProject,ic as inspectGenesisAgentIntegrations,yc as inspectGenesisCollaboration,io as inspectGenesisDerivedArtifacts,
822
- bc as inspectGenesisEngineering,fc as inspectGenesisEnvironment,gc as inspectGenesisProject,uo as inspectGenesisProjectFormat,
823
- tc as inspectGenesisSkills,lc as inspectGenesisStackComponents,rc as inspectGenesisSubsystems,oc as inspectVibe64ArchitectureInspection,
824
- ac as inspectVibe64ArchitectureLayout,Oc as inspectVibe64ConnectedDevelopment,dc as inspectVibe64Deployment,Tc as inspectVibe64IntegrationSetup,
825
- Ic as inspectVibe64Outputs,mc as inspectVibe64Packaging,kc as inspectVibe64ProjectServices,Ac as inspectVibe64ResourceEstimates,
826
- Rc as inspectVibe64WorkspaceSetup,wc as listGenesisPasses,Qa as listGenesisStackPieces,Ec as listGenesisTemplates,Ua as mergeArchitectureObservations,
827
- Si as parseVibe64DeploymentLines,Zn as parseVibe64IntegrationSetupLines,Ve as parseVibe64OutputsLines,Tn as parseVibe64PackagingLines,
815
+ !0)throw E;return{result:await a(_),task:_}}},p;try{if(p=await ft(u,r),typeof p.result?.prompt!="string"||!p.result.prompt.
816
+ trim())throw new Error("Genesis returned no prompt.")}catch(E){return s(E),{prompt:c}}let{result:d,task:l}=p,g=is.has(V(
817
+ d.task))?V(d.task):l;return{context:{genesis:!0,requestedTask:o,task:g,verificationCommands:d.verificationCommands,warnings:d.
818
+ warnings},originalPrompt:c,prompt:d.prompt,promptId:V(e.promptId||e.id)||g}}export{za as CALL_WEB_SCHEMA,Ya as CITY_SCHEMA_VERSION,Xa as GENESIS_BLUEPRINT_PATH,co as GENESIS_CALL_WEB_PATH,pc as GENESIS_DERIVED_ARTIFACT_PATHS,
819
+ oo as GENESIS_MACHINE_CITY_PATH,ao as GENESIS_PROGRAM_CITY_PATH,Je as GENESIS_STACK_PATH,Mt as GENESIS_STACK_SECTION_AMBIGUOUS,
820
+ Ja as GENESIS_SUBSYSTEMS_PATH,ht as GENESIS_USER_PATH_TIMEOUT_MS,Fa as MACHINE_CITY_SCHEMA,qa as PROGRAM_CITY_SCHEMA,ja as SOURCE_EXPLANATION_PROMPT_VERSION,
821
+ mn as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,Si as VIBE64_APPLICATION_DEPLOYMENT_V1_CONTRACT,Ce as VIBE64_PACKAGING_CONTRACT,
822
+ me as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,Qa as addGenesisStack,bc as applyGenesisTemplate,Qr as assertGenesisPromptTask,
823
+ rs as genesisCommandShimDirectory,no as genesisPackageBinDirectory,Ma as genesisParserEnvironment,Ms as genesisProjectContractNeedsAttention,
824
+ Us as genesisProjectFileDiagnostic,Gs as genesisProjectFileUnreadable,to as genesisPromptRequest,eo as genesisPromptTask,
825
+ tc as initializeGenesisProject,rc as inspectGenesisAgentIntegrations,wc as inspectGenesisCollaboration,ro as inspectGenesisDerivedArtifacts,
826
+ yc as inspectGenesisEngineering,gc as inspectGenesisEnvironment,Ec as inspectGenesisProject,po as inspectGenesisProjectFormat,
827
+ nc as inspectGenesisSkills,dc as inspectGenesisStackComponents,oc as inspectGenesisSubsystems,ac as inspectVibe64ArchitectureInspection,
828
+ cc as inspectVibe64ArchitectureLayout,Rc as inspectVibe64ConnectedDevelopment,mc as inspectVibe64Deployment,Oc as inspectVibe64IntegrationSetup,
829
+ Tc as inspectVibe64Outputs,hc as inspectVibe64Packaging,kc as inspectVibe64ProjectServices,Nc as inspectVibe64ResourceEstimates,
830
+ Ac as inspectVibe64WorkspaceSetup,Sc as listGenesisPasses,ec as listGenesisStackPieces,vc as listGenesisTemplates,Wa as mergeArchitectureObservations,
831
+ _i as parseVibe64DeploymentLines,Zn as parseVibe64IntegrationSetupLines,Le as parseVibe64OutputsLines,Tn as parseVibe64PackagingLines,
828
832
  Wn as parseVibe64ProjectServicesLines,Xn as parseVibe64ResourceEstimatesLines,Me as parseVibe64WorkspaceSetupLines,$s as readArchitecturePreviewLocator,
829
- cc as refreshGenesisCities,Nc as renderGenesisPrompt,Zi as resolveVibe64OutputParameters,On as resolveVibe64PackagingEnvironment,
830
- _c as setGenesisCollaboration,Sc as setGenesisEngineeringProfile,ja as sourceExplanationGuidance,sc as syncGenesisAgentIntegrations,
831
- nc as syncGenesisSkills,Ga as validateArchitectureFacts,Ba as validateCallWeb,Wa as validateCityDocument,hc as verifyGenesisProject,
832
- pc as vibe64ConversationInstructions,ae as vibe64Driver,Ya as vibe64HostContextEnvironment,Ir as vibe64HostContextRegistry,
833
- no as vibe64HostContextResolverPath,Ja as withGenesisCommandShim,ft as withinGenesisDeadline};
833
+ uc as refreshGenesisCities,Cc as renderGenesisPrompt,Qi as resolveVibe64OutputParameters,On as resolveVibe64PackagingEnvironment,
834
+ Ic as setGenesisCollaboration,_c as setGenesisEngineeringProfile,Ga as sourceExplanationGuidance,ic as syncGenesisAgentIntegrations,
835
+ sc as syncGenesisSkills,Ua as validateArchitectureFacts,Ha as validateCallWeb,Ba as validateCityDocument,fc as verifyGenesisProject,
836
+ lc as vibe64ConversationInstructions,ce as vibe64Driver,Ka as vibe64HostContextEnvironment,Tr as vibe64HostContextRegistry,
837
+ so as vibe64HostContextResolverPath,Za as withGenesisCommandShim,ft as withinGenesisDeadline};