vibe64 0.1.32 → 0.1.34

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 (294) hide show
  1. package/bin/run.js +1717 -1648
  2. package/bin/server.js +81 -68
  3. package/bin/upgrade-state.js +5438 -5189
  4. package/dist/assets/{GithubBrowserTabs-2bEGbRAs.js → GithubBrowserTabs-DO5PHon-.js} +1 -1
  5. package/dist/assets/GithubMarkdown-BQ6MfCDJ.js +3 -0
  6. package/dist/assets/GithubMarkdown-U7-j-qNI.css +1 -0
  7. package/dist/assets/StudioErrorNotice-sQfmeR-z.js +1 -0
  8. package/dist/assets/VAlert-P256xaE0.js +1 -0
  9. package/dist/assets/VAutocomplete-BDb95qJX.js +1 -0
  10. package/dist/assets/VAvatar-9ilDR2r2.css +1 -0
  11. package/dist/assets/VAvatar-DPzqDH4r.js +1 -0
  12. package/dist/assets/VBtn-B2MBK2DL.js +1 -0
  13. package/dist/assets/VCard-mXy0k4aS.js +1 -0
  14. package/dist/assets/VCheckbox-C7A1ZW4D.js +1 -0
  15. package/dist/assets/VChip-CcI-Oo2J.js +1 -0
  16. package/dist/assets/VDialog-Bu3EfKb1.js +1 -0
  17. package/dist/assets/VDivider-BMEqUoAB.js +1 -0
  18. package/dist/assets/VExpansionPanels-Dgjrop0V.js +1 -0
  19. package/dist/assets/VMenu-C_x18lwb.js +1 -0
  20. package/dist/assets/VOverlay-CeMZurIN.js +1 -0
  21. package/dist/assets/VRadioGroup-CUu2-KIP.js +1 -0
  22. package/dist/assets/VRow-Cpw7OHQV.js +1 -0
  23. package/dist/assets/{VSelect-DY-ZuBJJ.js → VSelect-DL3HaA5m.js} +1 -1
  24. package/dist/assets/VSheet-DZWsu0kL.js +1 -0
  25. package/dist/assets/VSkeletonLoader-CttxM1tw.js +1 -0
  26. package/dist/assets/VSpacer-Dhmsvk4t.js +1 -0
  27. package/dist/assets/{VSwitch-Bm1bwl2V.js → VSwitch-BRHeDJkH.js} +1 -1
  28. package/dist/assets/VTextField-BR2eZeFT.js +1 -0
  29. package/dist/assets/VTextarea-DbqamXJd.js +1 -0
  30. package/dist/assets/Vibe64AsyncModuleState-Dx7YKRPp.js +1 -0
  31. package/dist/assets/Vibe64DashboardBackButton-DD9UR77P.css +1 -0
  32. package/dist/assets/Vibe64DashboardBackButton-yE6cyYg2.js +1 -0
  33. package/dist/assets/Vibe64DashboardPageHeader-BXQR00HK.js +1 -0
  34. package/dist/assets/Vibe64DashboardPageHeader-Gm1IvlHx.css +1 -0
  35. package/dist/assets/Vibe64DashboardShell-CuCVMhOc.js +1 -0
  36. package/dist/assets/Vibe64DashboardShell-MBkUHjs-.css +1 -0
  37. package/dist/assets/Vibe64DatabaseWorkspace-BONJdxBS.js +18 -0
  38. package/dist/assets/{Vibe64DatabaseWorkspace-C39Jvver.css → Vibe64DatabaseWorkspace-CR4pzzcf.css} +1 -1
  39. package/dist/assets/Vibe64OutputControls-DAAmA09l.js +8 -0
  40. package/dist/assets/{Vibe64OutputControls-CsZFv12r.css → Vibe64OutputControls-DPBsyDZM.css} +1 -1
  41. package/dist/assets/{Vibe64RepositoryWorkspace-ebUaYOU4.js → Vibe64RepositoryWorkspace-ByQlZbyO.js} +2 -2
  42. package/dist/assets/{Vibe64RepositoryWorkspace-Cqm6TOFk.css → Vibe64RepositoryWorkspace-CVHcT93M.css} +1 -1
  43. package/dist/assets/Vibe64SessionFiles-B0u9HKdF.js +107 -0
  44. package/dist/assets/Vibe64SessionFiles-NjOMVwPR.css +1 -0
  45. package/dist/assets/Vibe64TemporaryAiFixAction-BGlcrq4d.js +1 -0
  46. package/dist/assets/Vibe64UiStoryboardView-3WXph5bz.css +1 -0
  47. package/dist/assets/Vibe64UiStoryboardView-Brlwdvqi.js +7 -0
  48. package/dist/assets/Vibe64UnavailableSessions-zwlWlcZD.js +1 -0
  49. package/dist/assets/_sessionId_-CvOkQbVy.js +1 -0
  50. package/dist/assets/{_sessionTool_-B39BIzzZ.js → _sessionTool_-Dwod5ns9.js} +1 -1
  51. package/dist/assets/_slug_-B31c15cc.css +1 -0
  52. package/dist/assets/_slug_-Dy35qLo1.js +1 -0
  53. package/dist/assets/access-BVu5XYm2.js +1 -0
  54. package/dist/assets/app-DRXCcv05.css +1 -0
  55. package/dist/assets/app-zt7HwQKT.js +1 -0
  56. package/dist/assets/assistantRouting-CwbwfkwB.js +3 -0
  57. package/dist/assets/{changes-ByjS7QGx.js → changes-olY8cnFK.js} +1 -1
  58. package/dist/assets/{client-C-tpoG6F.js → client-BrV4QPwG.js} +1 -1
  59. package/dist/assets/createSimpleFunctional-CZTGuNuR.js +1 -0
  60. package/dist/assets/dashboard-BnXD-H4R.js +1 -0
  61. package/dist/assets/definitions-DaOPIkyB.js +1 -0
  62. package/dist/assets/env-DJhnLOH7.css +1 -0
  63. package/dist/assets/env-DN0vW4EI.js +1 -0
  64. package/dist/assets/{error-DFKtZBJ8.js → error-DgrgRbJJ.js} +1 -1
  65. package/dist/assets/{error-DE4zo8Lk.js → error-Dug56can.js} +1 -1
  66. package/dist/assets/health-7oIQODer.css +1 -0
  67. package/dist/assets/health-Z6m96GDr.js +1 -0
  68. package/dist/assets/history-BOwbCRQP.css +1 -0
  69. package/dist/assets/history-BxlpB-YH.js +1 -0
  70. package/dist/assets/incoming-BOxRVlOM.js +2 -0
  71. package/dist/assets/incoming-DWDrmxyH.css +1 -0
  72. package/dist/assets/index-BUq-MczL.js +86 -0
  73. package/dist/assets/{index-D4MsP3dq.css → index-DtmBqE3h.css} +1 -1
  74. package/dist/assets/{integrations-B4txOZfY.js → integrations-BFltGDVI.js} +1 -1
  75. package/dist/assets/issues-1iS5zoed.js +1 -0
  76. package/dist/assets/issues-XnpGgdmn.css +1 -0
  77. package/dist/assets/layout-BkWVNT37.js +1 -0
  78. package/dist/assets/lazy-NHSwD9FS.js +1 -0
  79. package/dist/assets/mdi-C54lQ0i_.js +1 -0
  80. package/dist/assets/{pages-BW2l8fNe.js → pages-DuMgH61T.js} +1 -1
  81. package/dist/assets/{placement-JxzrmUR3.js → placement-CwTqWLQH.js} +1 -1
  82. package/dist/assets/placement-DLsU3pCW.js +1 -0
  83. package/dist/assets/pull-requests-BJOwNL4k.js +1 -0
  84. package/dist/assets/pull-requests-CdbhyFOv.css +1 -0
  85. package/dist/assets/{repository-BTC3lkrh.js → repository-JWLVST3D.js} +1 -1
  86. package/dist/assets/{VAvatar-CAFvgSUo.js → ripple-BVltMmyV.js} +2 -2
  87. package/dist/assets/ripple-DqhAt1Ze.css +1 -0
  88. package/dist/assets/runtime-core.esm-bundler-DGXg_mpN.js +3 -0
  89. package/dist/assets/{session-CG-TUCJt.css → session-5qADMzDP.css} +1 -1
  90. package/dist/assets/session-C5Nj8Dlq.js +1 -0
  91. package/dist/assets/settings-BopLnpB0.css +1 -0
  92. package/dist/assets/settings-c273Ikrm.js +1 -0
  93. package/dist/assets/ssrBoot-Rlh6kLbD.js +1 -0
  94. package/dist/assets/{studioGateApi-C0GvzVlt.js → studioGateApi-DhA9IJGZ.js} +1 -1
  95. package/dist/assets/{studioUrls-CIab-Axb.js → studioUrls-Dj8rXeXO.js} +1 -1
  96. package/dist/assets/{useApi-BPuI6ZR9-Dr8wK_Co.js → useApi-BPuI6ZR9-CFWU1m37.js} +1 -1
  97. package/dist/assets/useArchivedVibe64Sessions-CVZx2Rtm.js +1 -0
  98. package/dist/assets/useCommand-DWuxfAV0.js +1 -0
  99. package/dist/assets/useEndpointResource-MWVNfmMa.js +1 -0
  100. package/dist/assets/{usePaths-DVTieF_G.js → usePaths-Db88-HOm.js} +1 -1
  101. package/dist/assets/{useUiFeedback-Tzi-PRlX.js → useUiFeedback-0FqKuZRP.js} +1 -1
  102. package/dist/assets/useVibe64ConversationLog-8cKh1eDm.js +1 -0
  103. package/dist/assets/useVibe64DatabaseTools-BcRG1s3i.js +1 -0
  104. package/dist/assets/useVibe64LearningMode-Bl0dGdCh.js +28 -0
  105. package/dist/assets/useVibe64LearningMode-C3PcXdVg.css +1 -0
  106. package/dist/assets/useVibe64ProjectScope-DOEVkBqX.js +1 -0
  107. package/dist/assets/useVibe64SessionData-DFTyLzci.js +1 -0
  108. package/dist/assets/useVibe64SessionSelection-j9lsllx4.js +1 -0
  109. package/dist/assets/useVibe64SystemGraph-tNkIwSBQ.js +1 -0
  110. package/dist/assets/{useVibe64Terminal-C2XJ9Y1K.js → useVibe64Terminal-BPnN25WH.js} +1 -1
  111. package/dist/assets/vibe64AssistantHost-DdE_-lZF.js +1 -0
  112. package/dist/assets/vibe64LessonDashboard-DlKYjisq.js +1 -0
  113. package/dist/assets/vibe64ProjectScope.local-DqT6e5un.js +1 -0
  114. package/dist/assets/vibe64RepositoryRealtime-DXk0Jai3.js +1 -0
  115. package/dist/assets/vibe64SessionFocus-OJ2toBd9.css +1 -0
  116. package/dist/assets/vibe64SessionFocus-kqPOPaOH.js +1 -0
  117. package/dist/assets/{vibe64SessionInfo-D8l22MFm.js → vibe64SessionInfo-BHxtTrLX.js} +1 -1
  118. package/dist/assets/vibe64SessionToolDefinitions-NfLd1HZI.js +1 -0
  119. package/dist/assets/vue-flow-core-BlVEnES8.js +26 -0
  120. package/dist/index.html +51 -48
  121. package/docs/colleague-usage/account-profile-and-appearance.md +29 -0
  122. package/docs/colleague-usage/ai-accounts-and-routing.md +23 -4
  123. package/docs/colleague-usage/ai-balance-and-allowance.md +4 -0
  124. package/docs/colleague-usage/architecture-explanations.md +99 -0
  125. package/docs/colleague-usage/auto-workflow.md +49 -11
  126. package/docs/colleague-usage/coding-agent-failures.md +94 -0
  127. package/docs/colleague-usage/coding-agent-goal-pause.md +110 -0
  128. package/docs/colleague-usage/coding-agent-goals.md +140 -38
  129. package/docs/colleague-usage/coding-agent-history.md +20 -2
  130. package/docs/colleague-usage/coding-agent-recovery.md +136 -0
  131. package/docs/colleague-usage/coding-agents.md +138 -150
  132. package/docs/colleague-usage/colleague-recovery.md +28 -5
  133. package/docs/colleague-usage/colleague-upgrade-recovery.md +4 -0
  134. package/docs/colleague-usage/colleague-watches.md +84 -0
  135. package/docs/colleague-usage/colleague.md +18 -34
  136. package/docs/colleague-usage/connected-contributions.md +196 -0
  137. package/docs/colleague-usage/connected-projects.md +196 -0
  138. package/docs/colleague-usage/conversation-context.md +67 -1
  139. package/docs/colleague-usage/dashboard-navigation.md +79 -5
  140. package/docs/colleague-usage/database.md +11 -0
  141. package/docs/colleague-usage/developing-vibe64.md +137 -0
  142. package/docs/colleague-usage/development-copies.md +20 -0
  143. package/docs/colleague-usage/development-env.md +34 -0
  144. package/docs/colleague-usage/file-interfaces.md +156 -0
  145. package/docs/colleague-usage/github-work.md +88 -1
  146. package/docs/colleague-usage/health-checks.md +32 -0
  147. package/docs/colleague-usage/incoming-changes.md +94 -0
  148. package/docs/colleague-usage/learning-chat-retention.md +11 -2
  149. package/docs/colleague-usage/learning-code-questions.md +55 -0
  150. package/docs/colleague-usage/learning-course-catalogue.md +118 -0
  151. package/docs/colleague-usage/learning-diagrams-and-voice.md +97 -0
  152. package/docs/colleague-usage/learning-history.md +17 -9
  153. package/docs/colleague-usage/learning-lesson-watch.md +95 -0
  154. package/docs/colleague-usage/learning-mode-ui.md +187 -85
  155. package/docs/colleague-usage/learning-native-session.md +12 -10
  156. package/docs/colleague-usage/learning-practical-exercises.md +71 -0
  157. package/docs/colleague-usage/learning-practical-gestures.md +18 -1
  158. package/docs/colleague-usage/learning-practice-projects.md +55 -4
  159. package/docs/colleague-usage/learning-session-creation.md +7 -7
  160. package/docs/colleague-usage/learning-teacher-guide.md +52 -0
  161. package/docs/colleague-usage/learning-with-colleague.md +59 -80
  162. package/docs/colleague-usage/lesson-authoring.md +12 -4
  163. package/docs/colleague-usage/lesson-practical-assessment.md +3 -1
  164. package/docs/colleague-usage/managed-app-access.md +6 -0
  165. package/docs/colleague-usage/message-delivery-recovery.md +56 -0
  166. package/docs/colleague-usage/plans.md +14 -7
  167. package/docs/colleague-usage/preview-browser-checks.md +61 -0
  168. package/docs/colleague-usage/preview-lesson-presentation.md +56 -0
  169. package/docs/colleague-usage/preview-starting-application.md +92 -0
  170. package/docs/colleague-usage/preview.md +70 -96
  171. package/docs/colleague-usage/project-architecture.md +229 -0
  172. package/docs/colleague-usage/project-language-tools.md +31 -0
  173. package/docs/colleague-usage/project-messages.md +106 -0
  174. package/docs/colleague-usage/project-settings.md +22 -0
  175. package/docs/colleague-usage/project-setup.md +29 -2
  176. package/docs/colleague-usage/session-terminal.md +42 -0
  177. package/docs/colleague-usage/sessions.md +122 -52
  178. package/docs/colleague-usage/teaching-content.md +12 -6
  179. package/docs/colleague-usage/temporary-chat-context.md +29 -0
  180. package/docs/colleague-usage/temporary-chats.md +95 -2
  181. package/docs/colleague-usage/voice-chat.md +10 -43
  182. package/docs/colleague-usage/voice-face-and-speaking-voice.md +73 -0
  183. package/docs/colleague-usage/workspace-preparation.md +89 -0
  184. package/docs/training-content.md +208 -7
  185. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  186. package/node_modules/@jskit-ai/assistant-runtime/README.md +29 -0
  187. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  188. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  189. package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
  190. package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
  191. package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
  192. package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
  193. package/node_modules/@jskit-ai/kernel/package.json +1 -1
  194. package/node_modules/@jskit-ai/payments-core/package.json +1 -1
  195. package/node_modules/@jskit-ai/realtime/package.json +1 -1
  196. package/node_modules/@jskit-ai/resource-core/package.json +1 -1
  197. package/node_modules/@jskit-ai/resource-crud-core/package.json +1 -1
  198. package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
  199. package/node_modules/@local/vibe64-core/package.json +1 -0
  200. package/node_modules/@local/vibe64-execution/src/host/execHelper.js +280 -272
  201. package/node_modules/@local/vibe64-genesis/README.md +15 -0
  202. package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +879 -1225
  203. package/node_modules/@local/vibe64-genesis/package.json +2 -1
  204. package/node_modules/@local/vibe64-genesis/src/server/index.js +496 -418
  205. package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +165 -146
  206. package/node_modules/@local/vibe64-runtime/src/server/agentSessionCommandHook.js +8 -8
  207. package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +128 -129
  208. package/node_modules/@local/vibe64-system-graph/README.md +136 -6
  209. package/node_modules/@local/vibe64-terminals/package.json +3 -0
  210. package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1527 -1326
  211. package/node_modules/@local/vibe64-training/package.json +6 -1
  212. package/node_modules/@local/vibe64-voice/package.json +1 -0
  213. package/package.json +16 -16
  214. package/server.bundle.mjs +42853 -40268
  215. package/dist/assets/StudioErrorNotice-Ccjvcn9C.js +0 -1
  216. package/dist/assets/VAlert-B7ciJKQL.js +0 -1
  217. package/dist/assets/VAutocomplete-QjMk5d_j.js +0 -1
  218. package/dist/assets/VAvatar-nHaK192T.css +0 -1
  219. package/dist/assets/VBtn-Kl_qcBsy.js +0 -1
  220. package/dist/assets/VCard-nrJPeo91.js +0 -1
  221. package/dist/assets/VCheckbox-DTRAWOIf.js +0 -1
  222. package/dist/assets/VChip-Dfs5jX0f.js +0 -1
  223. package/dist/assets/VDialog-Dt1VjJg1.js +0 -1
  224. package/dist/assets/VDivider-DFsS0OTx.js +0 -1
  225. package/dist/assets/VExpansionPanels-CYKU0cAr.js +0 -1
  226. package/dist/assets/VMenu-BLxobsuU.js +0 -1
  227. package/dist/assets/VOverlay-BvFVZKNS.js +0 -1
  228. package/dist/assets/VRadioGroup-DzQzpCfg.js +0 -1
  229. package/dist/assets/VRow-BR2RMCM1.js +0 -1
  230. package/dist/assets/VSheet-BA95RNmA.js +0 -1
  231. package/dist/assets/VSkeletonLoader-hpJqr0HL.js +0 -1
  232. package/dist/assets/VSpacer-B1l1hVvU.js +0 -1
  233. package/dist/assets/VTextField-CA_p3N4d.js +0 -1
  234. package/dist/assets/VTextarea-NyCqY4h5.js +0 -1
  235. package/dist/assets/Vibe64AsyncModuleState-DEFlqJ97.js +0 -1
  236. package/dist/assets/Vibe64DashboardShell-BNv2I-P8.js +0 -1
  237. package/dist/assets/Vibe64DashboardShell-w20wNTGW.css +0 -1
  238. package/dist/assets/Vibe64DatabaseWorkspace-CuY5lN1o.js +0 -43
  239. package/dist/assets/Vibe64OutputControls-D2JuYlYU.js +0 -8
  240. package/dist/assets/Vibe64SessionFiles-C-rWehq_.js +0 -34
  241. package/dist/assets/Vibe64SessionFiles-Dsr6KQNP.css +0 -1
  242. package/dist/assets/Vibe64SubsystemsView-BvdU_o6H.css +0 -1
  243. package/dist/assets/Vibe64SubsystemsView-DJCjSzQM.js +0 -1
  244. package/dist/assets/Vibe64SystemWorldView-B91ioQaO.js +0 -4312
  245. package/dist/assets/Vibe64SystemWorldView-BXiQ7_Qb.css +0 -1
  246. package/dist/assets/Vibe64UnavailableSessions-OvnoD3ZB.js +0 -1
  247. package/dist/assets/_sessionId_-JTvMh54L.js +0 -1
  248. package/dist/assets/_slug_-DP_heCDa.js +0 -1
  249. package/dist/assets/_slug_-DmBZGb0q.css +0 -1
  250. package/dist/assets/access-C8GQIS19.js +0 -1
  251. package/dist/assets/app-B83lF61Y.js +0 -1
  252. package/dist/assets/app-ByLIQ3SB.css +0 -1
  253. package/dist/assets/assistantRouting-TDtryU6o.js +0 -1
  254. package/dist/assets/createSimpleFunctional-DPIT6zsT.js +0 -1
  255. package/dist/assets/dashboard-CWGFPojJ.js +0 -1
  256. package/dist/assets/definitions-BeLcvOW3.js +0 -1
  257. package/dist/assets/display-BLmcO-5p.js +0 -1
  258. package/dist/assets/env-7bqFyF_E.css +0 -1
  259. package/dist/assets/env-BVwxNL8M.js +0 -1
  260. package/dist/assets/health-BzNhp7r8.js +0 -1
  261. package/dist/assets/health-DoHTXTGx.css +0 -1
  262. package/dist/assets/history-BPeZGofK.js +0 -1
  263. package/dist/assets/history-iMQxp5AR.css +0 -1
  264. package/dist/assets/httpClient-BaaZuFvF.js +0 -1
  265. package/dist/assets/index-5sKwLHOH.js +0 -86
  266. package/dist/assets/issues-DCEhGlfn.css +0 -1
  267. package/dist/assets/issues-wby50y9b.js +0 -3
  268. package/dist/assets/layout-YCn17mK1.js +0 -1
  269. package/dist/assets/lazy-CvQfXeLg.js +0 -1
  270. package/dist/assets/mdi-C31_SZp-.js +0 -1
  271. package/dist/assets/placement-C4R2t6rl.js +0 -1
  272. package/dist/assets/pull-requests-BNK6mq2u.css +0 -1
  273. package/dist/assets/pull-requests-lNQAigaC.js +0 -1
  274. package/dist/assets/runtime-core.esm-bundler-DMrccYS5.js +0 -3
  275. package/dist/assets/session-D38nzG41.js +0 -1
  276. package/dist/assets/settings-CFyUJ_kR.js +0 -1
  277. package/dist/assets/settings-vWsAEoE9.css +0 -1
  278. package/dist/assets/useArchivedVibe64Sessions-C2DSq2Z4.js +0 -1
  279. package/dist/assets/useCommand-BzThFLYP.js +0 -1
  280. package/dist/assets/useEndpointResource-C2KD4Ub_.js +0 -1
  281. package/dist/assets/useVibe64ConversationLog-CMUlXJtU.js +0 -1
  282. package/dist/assets/useVibe64DatabaseTools-DBcKhm6B.js +0 -1
  283. package/dist/assets/useVibe64LearningMode-BPRWM5Rp.js +0 -28
  284. package/dist/assets/useVibe64LearningMode-PJUv0O25.css +0 -1
  285. package/dist/assets/useVibe64SessionData-CdtJbAIx.js +0 -1
  286. package/dist/assets/useVibe64SessionSelection-aR0f6xVT.js +0 -1
  287. package/dist/assets/useVibe64SystemGraph-DeTPBn0e.js +0 -1
  288. package/dist/assets/vibe64AssistantHost-Dgyz4TrT.js +0 -1
  289. package/dist/assets/vibe64ProjectScope.local-GOSMVDRi.js +0 -1
  290. package/dist/assets/vibe64RepositoryRealtime-t5Al8BlU.js +0 -1
  291. package/dist/assets/vibe64SessionFocus-CcN6Grgw.js +0 -1
  292. package/dist/assets/vibe64SessionFocus-ChabllPA.css +0 -1
  293. package/dist/assets/vibe64SessionToolDefinitions-BaO1DEup.js +0 -1
  294. /package/dist/assets/{vibe64RepositoryRealtime-D_mq1dFE.css → Vibe64TemporaryAiFixAction-D_mq1dFE.css} +0 -0
@@ -1,428 +1,506 @@
1
1
  import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
2
- import{existsSync as qe}from"node:fs";import{readFile as sn}from"node:fs/promises";import{createRequire as on}from"node:module";
3
- import D from"node:path";import*as de from"genesis-compiler";import{mkdir as ot,mkdtemp as at,readFile as ct,rename as ut,rm as pt,writeFile as lt}from"node:fs/promises";import dt from"node:os";
4
- import te from"node:path";var Qe=Object.freeze(["main","temporary"]),ge=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
5
- "managedPreview"]),Ze=64*1024,et=Object.freeze(["When user input is necessary, ask no more than three concise, high-impa\
2
+ import{createHash as ft}from"node:crypto";import ae from"node:path";var ee=class extends Error{constructor(t,n,s=void 0){
3
+ super(n),this.name="Vibe64StackOperationError",this.code=t,s!==void 0&&(this.details=s)}};function p(e,t,n,s,r={}){throw new ee(
4
+ e,n,{path:t,...s===void 0?{}:{line:s},...r})}function O(e,t,n,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(
5
+ e))&&p(t,n,`${s} must be one non-empty line.`,r),e.trim()}function ht(e){let t=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];
6
+ return t.length===0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function C(e,t,n,s,r,{count:i,maximum:o=64}={}){let c=ht(
7
+ e);if(!c||c.length>o||i!==void 0&&c.length!==i||c.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=i===void 0?"separat\
8
+ e non-empty":`exactly ${i}`;p(t,n,`${s} must contain ${u} backticked ${i===1?"value":"values"}.`,r)}return c}function gt(e=""){
9
+ return typeof e=="string"&&!!e&&!/[\s\0{}]/u.test(e)&&!ae.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function _(e,t,n,s,r){
10
+ let i=C(e,t,n,s,r);return gt(i[0])||p(t,n,`${s} must begin with a safe executable.`,r),i}function yt(e=""){return typeof e==
11
+ "string"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!ae.posix.isAbsolute(e)&&ae.posix.normalize(e)===e&&!e.split("/").some(t=>!t||t===
12
+ "..")}function g(e,t,n,s,r,{allowRoot:i=!0}={}){return(!yt(e)||!i&&e===".")&&p(t,n,`${s} must be a canonical project-rel\
13
+ ative path.`,r),e}function R(e,t,n,s,r){let i=C(e,t,n,s,r);return i.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&p(t,
14
+ n,`${s} must use lowercase technology ids separated into backticked values.`,r),new Set(i).size!==i.length&&p(t,n,`${s} \
15
+ contains a duplicate technology id.`,r),i}function ue(e,t,n,s,r){let i=O(e,t,n,s,r);return(!i.startsWith("/")||i.startsWith(
16
+ "//")||/[\\?#]/u.test(i))&&p(t,n,`${s} must begin with one slash and contain no query or fragment.`,r),i}function te(e,t,n,s,r){
17
+ let i=e.match(/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);i||p(t,n,`${s} must use \`- Ready when: \`GET\` \
18
+ \`/path\` returns \`200\`\`.`,r);let o=Number(i[2]);return(!Number.isInteger(o)||o<200||o>399)&&p(t,n,`${s} status must \
19
+ be from 200 through 399.`,r),{kind:"http",method:"GET",path:ue(i[1],t,n,`${s} path`,r),status:o}}function ce(e){return Array.
20
+ isArray(e)?e.map(ce):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,ce(e[t])])):e}function T(e){
21
+ let t=`${JSON.stringify(ce(e),null,2)}
22
+ `;return`sha256:${ft("sha256").update(t).digest("hex")}`}function G(e={},t={},n="operation"){if(e.stackHash!==t.stackHash)
23
+ throw new ee("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${n}. Retry the operation.`)}function B(e=[]){
24
+ return[...new Set(e)].sort()}function b(e=[]){let t=e.map(n=>n.trim()).filter(Boolean);return t.length===1&&t[0]==="- No\
25
+ thing."}import{access as bt}from"node:fs/promises";import Se from"node:path";var Te="vibe64.workspace-setup.v1",X="Workspace setup",K="VIBE64_WORKSPACE_SETUP_INVALID",wt=/^- Prepare `([^`\r\n]+)` with (.+?):[ \t]+(.+)$/u,
26
+ Et=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,vt=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,St=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
27
+ function pe(e,t,n,s={}){p(K,e,t,n,s)}function F(e,{path:t="genesis/stack.md#Workspace setup"}={}){if(Array.isArray(e)||pe(
28
+ t,"Workspace setup must be supplied as exact Stack section lines."),b(e))return[];let n=[];for(let s=0;s<e.length;s+=1){
29
+ let r=e[s].trim();if(!r)continue;let i=s+1,o=r.match(wt);o||pe(t,"Every Workspace setup entry must use: - Prepare `label\
30
+ ` with `runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",i,{observed:r});let c=o[2].match(Et),u=c?
31
+ null:o[2].match(vt),a=c?c[1]:u?u[1]:o[2],m=c?.[2]||u?.[2]||"",l=a.match(St),d=l?l[1]:a,h=l?l[2]:".";n.push({label:O(o[1],
32
+ K,t,"Workspace setup step label",i),argv:_(o[3],K,t,"Workspace setup command",i),runtimeRequirements:R(d,K,t,"Workspace \
33
+ setup runtimes",i),workdir:g(h,K,t,"Workspace setup workdir",i),...m?{condition:{pathExists:g(m,K,t,"Workspace setup con\
34
+ dition path",i,{allowRoot:!1}),onMissing:c?"wait":"skip"}}:{}})}return n.length===0&&pe(t,"## Workspace setup needs at l\
35
+ east one Prepare entry or exactly `- Nothing.`."),n}async function Tt(e,t){try{return await bt(Se.join(e,t)),!0}catch(n){
36
+ if(["ENOENT","ENOTDIR"].includes(n?.code))return!1;throw n}}async function Ie({projectRoot:e,section:t={}}={}){let n=[...t.
37
+ diagnostics||[]],s=[];t.status==="ready"&&(s=F(t.lines));let r=[],i=[],o=Se.resolve(e);if(n.length===0)for(let d of s){if(!d.
38
+ condition||await Tt(o,d.condition.pathExists)){r.push(d);continue}d.condition.onMissing==="wait"&&i.push(d.condition.pathExists)}
39
+ if(i.length>0){let d=B(i);n.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting for project ${d.
40
+ length===1?"path":"paths"}: ${d.join(", ")}.`,details:{paths:d}})}let c=n.some(({code:d})=>d==="VIBE64_WORKSPACE_SETUP_W\
41
+ AITING"),u=n.some(({code:d})=>d!=="VIBE64_WORKSPACE_SETUP_WAITING"),a="unconfigured";u?a="blocked":!c&&r.length>0&&(a="r\
42
+ eady");let m=r.map(({condition:d,...h})=>h),l={version:1,steps:m};return{contract:Te,status:a,stackHash:t.stackHash,recipeHash:a===
43
+ "ready"?T(l):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:B(m.flatMap(d=>d.runtimeRequirements)),
44
+ steps:m,diagnostics:n}}var It="custom",kt=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"\
45
+ Composer (PHP)"}),Object.freeze({value:"pip",label:"pip (Python)"}),Object.freeze({value:"bundler",label:"Bundler (Ruby)"}),
46
+ Object.freeze({value:"gomod",label:"Go modules"}),Object.freeze({value:"cargo",label:"Cargo (Rust)"}),Object.freeze({value:"\
47
+ maven",label:"Maven"}),Object.freeze({value:"gradle",label:"Gradle"}),Object.freeze({value:"nuget",label:"NuGet (.NET)"}),
48
+ Object.freeze({value:It,label:"custom"})]),ke=Object.freeze(kt.map(e=>e.value));function Oe(e){return typeof e=="string"&&
49
+ ke.includes(e)}function _e(e="or"){let t=ke;return`${t.slice(0,-1).join(", ")} ${e} ${t.at(-1)}`}var Re="Connected development",Ot="vibe64.connected-development.v1",D="VIBE64_CONNECTED_DEVELOPMENT_INVALID",N="genesis/\
50
+ stack.md#Connected development";function Ae(e={}){let t="",n="",s=null,r=[],i=[...e.diagnostics||[]],o=e.status==="ready";
51
+ if(o&&!b(e.lines)){let u=!1;for(let[m,l]of e.lines.entries()){let d=l.trim();if(!d)continue;let h=m+1,y=d.match(/^- Default package type: `([^`\r\n]*)`$/u);
52
+ if(y){n&&p(D,N,"Declare exactly one default package type.",h),Oe(y[1])||p(D,N,`Default package type must be ${_e()}.`,h),
53
+ n=y[1];continue}let q=d.match(/^- Sources file: `([^`\r\n]+)`$/u);if(q){t&&p(D,N,"Declare exactly one Sources file.",h),
54
+ t=g(q[1],D,N,"Connected sources file",h,{allowRoot:!1}),t.split("/").some($=>$.toLowerCase()===".git")&&p(D,N,"The Sourc\
55
+ es file must be outside Git metadata.",h);continue}let k=d.startsWith("- Custom runner "),J=d.match(/^- (Prepare|Verify) /u);
56
+ !k&&!J&&p(D,N,"Declare a Sources file and Prepare/Verify entries using the Workspace setup command grammar.",h);let z=J?.[1]===
57
+ "Verify"?"verify":"prepare";!k&&u&&z==="prepare"&&p(D,N,"All Prepare entries must precede Verify entries.",h),u||=!k&&z===
58
+ "verify";let Z;try{let $=k?d.replace("- Custom runner ","- Prepare `Custom connected source` "):d.replace(/^- Verify /u,
59
+ "- Prepare ");[Z]=F([$],{path:N})}catch($){if($.code!=="VIBE64_WORKSPACE_SETUP_INVALID")throw $;p(D,N,$.message,h)}Z.condition&&
60
+ p(D,N,"Connected development steps must run unconditionally; a skipped step cannot prove source consumption.",h),k?(s&&p(
61
+ D,N,"Declare exactly one Custom runner.",h),s=Z):r.push({...Z,phase:z})}!(n&&!t&&!r.length&&!s)&&(!t||!r.some(m=>m.phase===
62
+ "verify")&&!s)&&p(D,N,"Declare a default package type alone, or a Sources file with Verify entries or a Custom runner; u\
63
+ se `- Nothing.` for no declaration.")}let c=e.status==="blocked"||i.length?"blocked":r.length||s?"ready":"unconfigured";
64
+ return{contract:Ot,declared:o,status:c,stackHash:e.stackHash,recipeHash:c==="ready"?T({version:1,sourcesFile:t,defaultPackageType:n,
65
+ customRunner:s,steps:r}):"",components:[...e.components||[]],source:e.source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,
66
+ steps:r,runtimeRequirements:B([...r,...s?[s]:[]].flatMap(u=>u.runtimeRequirements)),diagnostics:i}}var Ce="Architecture inspection",E="VIBE64_ARCHITECTURE_INSPECTION_INVALID";function _t(e,{path:t="genesis/stack.md#Arch\
67
+ itecture inspection"}={}){if(Array.isArray(e)||p(E,t,"Architecture inspection requires exact Stack section lines."),b(e))
68
+ return[];let n=[],s=new Set,r;function i(){if(r){for(let o of["runtimeRequirements","workdir","argv","timeout","maxBuffe\
69
+ r"])r[o]===void 0&&p(E,t,`${r.id} is missing ${o}.`);n.push(r),r=null}}for(let[o,c]of e.entries()){let u=c.trim();if(!u)
70
+ continue;let a=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(a){i(),s.has(a[1])&&p(E,t,"Duplicate in\
71
+ spector id.",o+1),s.add(a[1]),r={id:a[1],title:a[2]};continue}r||p(E,t,"Expected an Inspector heading.",o+1);let m=u.match(
72
+ /^- (Runtime|Directory|Command|Timeout seconds|Max output bytes|Entry files|Required files): (.+)$/u);m||p(E,t,"Unknown \
73
+ architecture inspector field.",o+1);let l={Runtime:"runtimeRequirements",Directory:"workdir",Command:"argv","Timeout sec\
74
+ onds":"timeout","Max output bytes":"maxBuffer","Entry files":"entryFiles","Required files":"requiredFiles"}[m[1]];if(r[l]!==
75
+ void 0&&p(E,t,`Duplicate ${m[1]}.`,o+1),l==="runtimeRequirements")r[l]=R(m[2],E,t,"Inspector runtime",o+1);else if(l==="\
76
+ argv")r[l]=_(m[2],E,t,"Inspector command",o+1);else if(l==="entryFiles"||l==="requiredFiles")r[l]=C(m[2],E,t,m[1],o+1).map(
77
+ d=>g(d,E,t,m[1],o+1));else{let[d]=C(m[2],E,t,m[1],o+1,{count:1});if(l==="workdir")r[l]=g(d,E,t,"Inspector directory",o+1);else{
78
+ let h=Number(d),y=l==="timeout"?60:4*1024*1024;(!/^[1-9][0-9]*$/u.test(d)||!Number.isSafeInteger(h)||h>y)&&p(E,t,`${m[1]}\
79
+ must be from 1 to ${y}.`,o+1),r[l]=l==="timeout"?h*1e3:h}}}return i(),n.length||p(E,t,"Use an Inspector entry or - Noth\
80
+ ing."),n}function Ne(e){let t=e.status==="ready"?_t(e.lines):[];for(let n of t)n.runtimeRequirements.some(s=>!e.components.
81
+ includes(s))&&p(E,"genesis/stack.md#Architecture inspection","Inspector runtimes must be selected in Stack.");return{contract:"\
82
+ vibe64.architecture-inspection.v1",status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:T(t),diagnostics:e.diagnostics||
83
+ []}}var De="Architecture layout";function Rt(e,{path:t="genesis/stack.md#Architecture layout"}={}){let n="VIBE64_ARCHITECTUR\
84
+ E_LAYOUT_INVALID";if(Array.isArray(e)||p(n,t,"Expected exact Stack section lines."),b(e))return[];let s=[],r=new Set,i=new Set,
85
+ o;function c(){o&&((!o.kind||!o.purpose||!o.subsystems.length)&&p(n,t,`${o.id} needs Kind, Purpose and at least one Subs\
86
+ ystem.`),s.push(o))}for(let[u,a]of e.entries()){let m=a.trim();if(!m)continue;let l=m.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);
87
+ if(l){c(),r.has(l[1])&&p(n,t,"Duplicate group id.",u+1),r.add(l[1]),o={id:l[1],title:l[2],subsystems:[]};continue}let d=m.
88
+ match(/^- (Kind|Purpose|Subsystem): (.+)$/u);(!o||!d)&&p(n,t,"Expected a Group heading or Kind, Purpose, Subsystem field\
89
+ .",u+1);let h=C(d[2],n,t,d[1],u+1,{count:1});if(d[1]==="Subsystem"){let y=g(h[0],n,t,"Subsystem root",u+1);i.has(y)&&p(n,
90
+ t,"Each directory root may be placed only once.",u+1),i.add(y),o.subsystems.push({root:y})}else{let y=d[1].toLowerCase();
91
+ o[y]!==void 0&&p(n,t,`Duplicate ${d[1]}.`,u+1),y==="kind"&&!["layer","libraries","support"].includes(h[0])&&p(n,t,"Kind \
92
+ must be layer, libraries or support.",u+1),o[y]=h[0]}}return c(),s.length||p(n,t,"Use a Group entry or - Nothing."),s}function xe(e){
93
+ return{contract:"vibe64.architecture-layout.v1",status:e.status,stackHash:e.stackHash,groups:e.status==="ready"?Rt(e.lines):
94
+ [],diagnostics:e.diagnostics||[]}}import{existsSync as ct}from"node:fs";import{readFile as Rn}from"node:fs/promises";import{createRequire as An}from"node:module";
95
+ import j from"node:path";var Ve="STACK_PROJECT_CONTRACTS_INCOMPLETE",Pe="STACK_SECTION_AMBIGUOUS",At=Object.freeze([Ve,Pe]);function Ct(e){return At.
96
+ includes(String(e?.code||"").trim())}import*as we from"genesis-compiler";import{mkdir as $t,mkdtemp as Gt,readFile as Lt,rename as Ut,rm as Wt,writeFile as Ht}from"node:fs/promises";import qt from"node:os";
97
+ import de from"node:path";var Nt=Object.freeze(["main","temporary"]),je=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
98
+ "managedPreview"]),Dt=64*1024,xt=Object.freeze(["When user input is necessary, ask no more than three concise, high-impa\
6
99
  ct questions at once.","Put multiple questions on separate lines as `[1] Question`, `[2] Question`, and so on.","For a s\
7
- mall fixed set of useful choices, finish with `Possible answers:` and a short bullet list; the user may always type a di\
8
- fferent answer."]),tt=Object.freeze(["The Vibe64-managed preview is the canonical application server; do not start a dup\
9
- licate server on another port.","Use `vibe64-helper preview status`, `screenshot`, `logs`, and `browser eval` for render\
10
- ed inspection. Pass Playwright code to `vibe64-helper preview browser eval` on stdin.","For interactive navigation, use \
11
- the proxy URL from `vibe64-helper preview inspect-url` or status `currentPage.url` / `endpoints.browser.url`. Inside bro\
12
- wser eval, use `await page.goto(new URL('/your-path', preview.url).href)`. The direct application endpoint under diagnos\
13
- tics bypasses Preview identity and is not a browser-navigation URL.","Use the managed preview browser for interactive br\
14
- owsing. Use `vibe64-helper playwright` only for an existing configured project suite, and report a platform or project-t\
15
- est blocker rather than installing another browser or changing its dependencies.","For browser evidence, batch related a\
16
- ctions and assertions and return only the needed values. Inspect relevant locators or page regions; use screenshots at m\
17
- eaningful visual checkpoints or failures instead of after every click. Reuse the managed browser when test isolation per\
18
- mits. Preserve required viewport, identity and security checks; use existing automated cases for repeat verification.","\
19
- For browser tests that write or reset data, inspect `vibe64-helper preview targets --json` and the project's `genesis/st\
20
- ack.md` Outputs. Run `vibe64-helper playwright --target <declared-test-target> test <suite arguments>` or `vibe64-helper\
21
- playwright --target <declared-test-target> npm-run <script>`. Vibe64 starts that web target, waits for readiness, uses \
22
- its declared application identity, and restores the previous Preview when the command finishes or is cancelled; report r\
23
- estoration failures.","A target name is not proof of test isolation. Before running a destructive suite, the application\
24
- must verify the server's actual test database and suppress real email, invoices, payments, and other external effects. \
25
- Keep managed Env unchanged. The test launcher and its preview-identity command must use the same database. When the proj\
26
- ect declares BROWSER_TEST_DB_NAME, use it for reusable browser fixtures, separate from disposable TEST_DB_NAME. Never sp\
27
- oof safety checks by changing DB_NAME only in the test runner.","If no suitable test target exists, add one through the \
28
- project's existing Outputs contract and application-owned test scripts within the user's authorized scope. Keep normal P\
29
- review as the default. Validate the exact disposable database before resetting it, prepare fixtures before reporting rea\
30
- diness, and make Playwright use PLAYWRIGHT_BASE_URL without starting another server. If the required test resources or e\
31
- xternal-effect controls are missing, report that specific blocker. Use `vibe64-helper preview ensure --target <id> --wai\
32
- t --json` only for deliberate interactive target selection; it leaves that target selected until changed.","Keep routine\
33
- browser startup incremental: reuse the isolated test schema, apply only pending migrations, and reset fixture data dete\
34
- rministically. Do not drop and rebuild the database or run a production frontend build for every focused browser check. \
35
- Keep fresh-schema migration checks separate, and batch related cases into one suite invocation. If startup is slow, meas\
36
- ure migrations, fixtures, and server startup before retrying or extending deadlines.","Keep test output small: select th\
37
- e relevant file and cases, capture stdout and stderr to local artifacts, and preserve the command's exit status. Return \
38
- counts, duration, failed case names, a short actionable error, and artifact paths. Read only relevant failure excerpts; \
39
- do not dump passing assertions, full JSON/TAP reports, request logs, traces, or screenshots into context. Keep startup, \
40
- resource and Preview-restoration errors even when tests pass. If the wrapper appends diagnostics after JSON, parse the J\
41
- SON object and retain the trailing diagnostics separately. Wait on the existing run; do not rerun to recover output or r\
42
- epeatedly print unchanged logs. When a command returns an execution/session identifier, use its existing wait operation \
43
- with about a 30-second wait window where supported: for an empty command poll, set yield_time_ms: 30000. Reserve shorter\
44
- waits for interactive input or a specific immediate check. Do not alternate brief waits with commands that reread empty\
45
- or unchanged logs; inspect status or failure excerpts when there is new output, a changed state, or a specific blocker \
46
- to diagnose.","Run related browser tests in one managed suite command: Preview switches once for the entire batch and re\
47
- stores once afterward, not between tests or workers. Managed suites and live Preview browser actions are sequential: do \
48
- not run `vibe64-helper preview browser` actions, Preview ensure/restart, or target changes while a suite is active or re\
49
- storing. Wait on the original command, including cleanup and restoration; if it runs in the background, wait on that sam\
50
- e execution before starting a live browser check. Read-only status and logs remain available during the suite. After com\
51
- pletion, confirm `vibe64-helper playwright status` has no active run and `vibe64-helper preview status` reports the rest\
52
- ored Preview ready before live inspection. To stop a suite, read `vibe64-helper playwright status`, then run `vibe64-hel\
53
- per playwright cancel <run-id>`. Cancellation waits for managed process cleanup and Preview restoration. Retry that same\
54
- cancellation if cleanup needs attention. Do not kill individual test or Preview PIDs or change internal locks. Launcher\
55
- exit alone does not prove the managed test stopped. Recheck live status before reporting a blocker; do not repeat an ea\
56
- rlier busy response as current evidence.","If a managed command reports kernel task denials or a resource incident, reta\
57
- in its diagnostic and incident ID when reporting the blocker. Ask the platform operator to inspect that resource evidenc\
58
- e before retrying; do not increase test timeouts or weaken assertions to work around a process/thread limit. A generic b\
59
- rowser timeout without resource evidence does not establish a platform cause.","Describe only rendered browser evidence;\
60
- if managed preview is unavailable, report that blocker instead of starting a replacement."]),nt=Object.freeze(["Each ma\
61
- naged shell command receives current development Env from Vibe64, including existing declared resource bindings. Use tho\
62
- se variables in ordinary application commands; do not build environment injection or copy managed credentials into sourc\
63
- e. Resource provisioning and application migrations remain separate preparation steps.","Use `vibe64-helper env status [\
64
- development|production|all]` to inspect configured key names without revealing values.","Pipe an available value to `vib\
65
- e64-helper env set <development|production> <KEY> [--secret]`; never put values in arguments, logs, or repository files.\
66
- Use empty stdin only when the user requested an empty value.","Keep development and production values separate. Never i\
67
- nvent credentials, copy a value between scopes without explicit direction, or edit Vibe64 runtime/session storage.","Aft\
68
- er an Env mutation, report only the affected scope and key names, never their values, and claim success only when the co\
69
- mmand succeeded.","When declared, TEST_DB_NAME is the exact disposable integration database and BROWSER_TEST_DB_NAME is \
70
- a separate reusable browser-fixture database whose migration ledger survives routine runs. Follow the application\u2019s decl\
71
- ared test resources; never reset DB_NAME, share these test identities, or invent a database name."]);function we(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${t} must be an object.`);return e}function ee(e,t,n){
72
- let r=new Set(t),i=Object.keys(e).filter(s=>!r.has(s));if(i.length>0)throw new TypeError(`${n} contains unsupported fiel\
73
- ds: ${i.join(", ")}.`)}function ye(e){if(ee(e,["conversationKind","scope","session"],"Vibe64 session context"),!Qe.includes(
74
- e.conversationKind))throw new TypeError("Vibe64 session context has an unknown conversationKind.");let t=we(e.session,"V\
75
- ibe64 session capabilities");ee(t,ge,"Vibe64 session capabilities");let n=Object.fromEntries(ge.map(r=>{if(typeof t[r]!=
76
- "boolean")throw new TypeError(`Vibe64 session capability ${r} must be boolean.`);return[r,t[r]]}));return{conversationKind:e.
77
- conversationKind,scope:"session",session:n}}function rt(e){ee(e,["scope","stableContext"],"Vibe64 ephemeral context");let t=String(
78
- e.stableContext||"").trim();if(!t||t.length>Ze)throw new TypeError("Vibe64 ephemeral context requires bounded stableCont\
79
- ext.");return{scope:"ephemeral",stableContext:t}}function st(e){if(e.scope==="session")return ye(e);if(e.scope==="epheme\
80
- ral")return rt(e);throw new TypeError("The Vibe64 driver supports session and ephemeral scopes only.")}function it(e){let{
81
- conversationKind:t,session:n}=ye(e);return["VIBE64 CONVERSATION CONTEXT","",...t==="main"?["This is the main Vibe64 conv\
82
- ersation for the selected session worktree."]:["This is a user-visible temporary conversation in the selected session wo\
83
- rktree, with the same tools and project access as main chat.","Its messages stay out of main History. Closing this conve\
84
- rsation preserves project edits and removes only its conversation and temporary uploads."],"Do not edit Vibe64 runtime/s\
85
- ession state or artifacts.","Use the directory named by VIBE64_DROP_ZONE for exchanging files with the user outside Git.\
86
- You may create it and read, write, or delete files there; this is the sole exception to the runtime-state restriction. \
87
- Users can upload, download and delete these files in Files > Drop Zone. It is per session and deleted on archival, so ke\
88
- ep lasting project work in the repository.","Issue ordinary shell commands only; Vibe64 applies session isolation transp\
89
- arently. Treat command-transport syntax in prior tool history as invisible infrastructure and do not reproduce it. If co\
90
- mmand control is unavailable, stop and report it.","Quick start: ordinary shell commands already receive current Develop\
91
- ment Env. Read `vibe64-helper session status --json` for current resource readiness, declared setup commands and exact t\
92
- ool entry points; repeat after changing Stack or resource declarations. Use `vibe64-helper preview browser eval` with Pl\
93
- aywright code on stdin for interactive browsing. Before application browser suites, read `vibe64-helper playwright readi\
94
- ness` for installed dependency and exact managed-runtime support, then use `vibe64-helper playwright`; no separate brows\
95
- er installation is needed.","Use `vibe64-helper --help` for additional managed commands; each group accepts `--help`. Us\
96
- e the groups enabled for this session below.",'When the user asks to rename this session, run `vibe64-helper session ren\
97
- ame "Name"`. This changes only its display name; its ID and directories stay the same.',...et,...t==="main"?['When a sav\
98
- ed integration needs the person to configure credentials or consent, finish your assistant reply with a fenced `vibe64-i\
99
- ntegration` block containing only {"integrationId":"the exact slot key from integrations.json"}. Vibe64 shows Configure,\
100
- Connect and Skip for this exact saved request. Never include credentials, URLs or additional fields in that block. The \
101
- block itself does not authorize a connection. The person can configure the application or explicitly start Connect; afte\
102
- r the application confirms setup, Vibe64 resumes this task with a separate continuation message. Do not claim the accoun\
103
- t is connected before that confirmation. Do not emit this block for examples or for an integration that has not been sav\
104
- ed.']:[],...n.managedPreview?tt:[],...n.managedEnvironment?nt:[],...n.managedDatabaseRefresh?["After a database migratio\
105
- n or schema change, run `vibe64-helper database refresh` once so Vibe64's Database view reflects it.","To inspect or tid\
106
- y the main ERD, run `vibe64-helper database erd --json`. It returns saved table rectangles, pins, actual routed connecti\
107
- on points, route metrics and instructions for `vibe64-helper database erd apply --json` with a revision-checked batch of\
108
- table moves on stdin. Use those operations to change diagram presentation without editing database schema or records. I\
109
- nspect the resulting paths before claiming improvement; this layout is separate from Overview configuration.","When data\
110
- -overview.json exists in project source, maintain its main actors and explicit supporting-table groups as the schema cha\
111
- nges. Use `vibe64-helper database overview --json` for the current schema, grouping, coverage and exact format instructi\
112
- ons. Preserve authored groupings, classify new tables, fix renamed/removed references, and check coverage afterward. Whe\
113
- n asked to create a Data overview, use the same command and relevant application source; no one-hop membership rule appl\
114
- ies. Never invent foreign keys or cardinalities."]:[],...n.managedGit?["Use the managed `git` and `gh` commands on PATH.\
115
- Do not bypass them with host binaries, a stripped PATH, or alternate credentials.","For GitHub-hosted attachments and i\
116
- nline images in issues (tickets), pull requests or comments, always use authenticated managed `gh api` with the original\
117
- attachment URL. Save the response to a local file and inspect it before reporting what it contains. Do not use unauthen\
118
- ticated curl/wget, User-Agent experiments, or extract credentials for a separate HTTP client. An unauthenticated 404 doe\
119
- s not prove a private attachment is missing. This rule applies to GitHub-hosted attachments, not arbitrary external link\
120
- s.","After changing GitHub issues, comments, labels or pull requests, run `vibe64-helper github refresh` once so Vibe64'\
121
- s Issues/PR view reflects it.","When linking an issue in this project's repository, run `vibe64-helper github issue-link\
122
- <number>` and use its returned Vibe64 path exactly as the primary Markdown link destination, including the /app prefix.\
123
- Ordinary links to Vibe64 pages navigate in-app without reloading, whether root-relative or full URLs on the current ori\
124
- gin. You may include the GitHub URL as a secondary link. Do not guess the project slug or host; issues in other reposito\
125
- ries keep their GitHub links.","Report authentication or transport failures directly; do not inspect credentials or inve\
126
- nt another login path.","When a managed Git/GitHub command fails, tell the user which requested action failed, which ear\
127
- lier work is confirmed complete, what remains undone or unconfirmed, and the next safe action. Retain the reported failu\
128
- re stage, execution budget and execution reference when provided; do not expose credentials or dump raw output unnecessa\
129
- rily.","A timeout or transport failure does not establish invalid authentication, exhausted AI quota, a GitHub outage or\
130
- a suspension problem. Separate recorded facts from hypotheses; say the cause is unknown when it is unproven. Recommend \
131
- reconnection only when the reported error explicitly calls for it.","If the diagnostic says commandSubmitted=false, the \
132
- requested Git/GitHub action was not attempted. After an execution timeout, lost response or unreadable response, its eff\
133
- ects remain unconfirmed: use a read-only check of the affected Git/GitHub state before repeating any write. Never claim \
134
- that a comment was posted or not posted, or that a push succeeded or failed, solely from those errors. If verification i\
135
- s unavailable, report the outcome as unknown and stop; do not repeat the write or claim it was safely rolled back."]:[]].
136
- join(`
137
- `)}function W(e={}){let t=we(e,"Vibe64 driver input"),n=st(t);return n.scope==="session"?it(n):n.stableContext}async function be(e=""){let t=e||await at(te.join(dt.tmpdir(),"vibe64-genesis-context-"));await ot(t,{recursive:!0,mode:448});
138
- let n=te.join(t,"sessions.json"),r=new Map;try{let c=JSON.parse(await ct(n,"utf8"));for(let u of c.sessions)W(u.promptContext),
139
- r.set(u.upstreamSessionId,u)}catch(c){if(c.code!=="ENOENT")throw c}let i=Promise.resolve(),s=!1;async function a(c){let u=te.
140
- join(t,"sessions.tmp");await lt(u,JSON.stringify({sessions:[...c.values()]}),{mode:384}),await ut(u,n)}return await a(r),
141
- {registryPath:n,get(c){return structuredClone(r.get(c))},async register(c,u,o=""){if(s)throw new Error("The Genesis host\
100
+ mall fixed set of useful choices, put `Possible answers:` and a short bullet list directly beneath its own question, bef\
101
+ ore the next one; never collect several questions' answers into one trailing list.","Each bullet is one distinct, comple\
102
+ te answer: Yes and No are separate bullets; never join alternatives with a slash or `or`. Omit the list for free-text an\
103
+ swers. The user may always type a different answer.",`Example:
104
+ [1] Which density?
105
+ Possible answers:
106
+ - Compact
107
+ - Comfortable
108
+ [2] Tell the main agent before changes?
109
+ Possible answers:
110
+ - Yes, tell main first
111
+ - No, proceed independently`]),Vt=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
112
+ start a duplicate or replacement server. If it is unavailable, report that blocker. Describe only rendered browser evide\
113
+ nce.","When adopting an authenticated app, or when its login blocks Preview inspection, inspect identity support/names w\
114
+ ith `vibe64-helper preview status`; prefer `vibe64-helper preview browser identity <configured-name>` to requesting pass\
115
+ words. If unconfigured, ask which existing accounts (email/login/user ID) represent admin and other required roles, and \
116
+ the default. Reuse prior answers; wait for their choices before configuring access. Never infer admin rights from names \
117
+ or the Vibe64 viewer.","Offer the application-owned `vibe64.preview-identity.command.v1` adapter in Outputs Preview iden\
118
+ tity, and guide named selectors through Dashboard > App access > Managed app access. Use existing sessions/permissions, \
119
+ reject missing/disabled accounts, and disable the adapter without Vibe64\u2019s per-run enable flag and secret. Do not create\
120
+ users, change roles, reset passwords or weaken production auth for import. Verify the selected account\u2019s actual Preview\
121
+ access; a saved selector is insufficient. If deferred/declined, explain access remains unconfigured and continue indepe\
122
+ ndent setup work without repeated credential requests. Public/non-web apps need no adapter.","Use `vibe64-helper preview\
123
+ status`, `screenshot`, `logs`, and `browser eval` (Playwright code on stdin) for rendered inspection.","The top Preview\
124
+ toolbar Stop and `vibe64-helper preview stop` stop this session's application and managed browser, not chat or source. \
125
+ Status reports the saved stopped choice. A status read, screenshot, browser inspection, source edit or session reopening\
126
+ is not permission to restart it; use `vibe64-helper preview ensure --wait` only for a deliberate Start. Scoped browser \
127
+ tests restore the prior stopped choice.","For interactive navigation, use the proxy URL from `vibe64-helper preview insp\
128
+ ect-url` or status `currentPage.url` / `endpoints.browser.url`. Inside browser eval, use `await page.goto(new URL('/your\
129
+ -path', preview.url).href)`. The direct application endpoint under diagnostics bypasses Preview identity and is not a br\
130
+ owser-navigation URL.","Use the managed preview browser for interactive browsing and `vibe64-helper playwright` only for\
131
+ an existing configured project suite; report a platform or project-test blocker rather than installing another browser \
132
+ or changing its dependencies.","For browser evidence, batch related actions and assertions, return only needed values an\
133
+ d inspect relevant locators or regions; screenshot at meaningful visual checkpoints or failures, not after every click. \
134
+ Reuse the managed browser when test isolation permits. Preserve required viewport, identity and security checks; use exi\
135
+ sting automated cases for repeat verification.","For browser tests that write or reset data, inspect `vibe64-helper prev\
136
+ iew targets --json` and the project's `genesis/stack.md` Outputs. Run `vibe64-helper playwright --target <declared-test-\
137
+ target> test <suite arguments>` or `vibe64-helper playwright --target <declared-test-target> npm-run <script>`. Vibe64 s\
138
+ tarts that web target, waits for readiness, uses its declared application identity, and restores the previous Preview wh\
139
+ en the command finishes or is cancelled; report restoration failures.","A target name is not proof of test isolation. Be\
140
+ fore running a destructive suite, the application must verify the server's actual test database and suppress real email,\
141
+ invoices, payments, and other external effects. Keep managed Env unchanged. The test launcher and its preview-identity \
142
+ command must use the same database. Use a declared BROWSER_TEST_DB_NAME for reusable browser fixtures, separate from dis\
143
+ posable TEST_DB_NAME. Never spoof safety checks by changing DB_NAME only in the test runner.","If no suitable test targe\
144
+ t exists, add one through the project's existing Outputs contract and application-owned test scripts within authorized s\
145
+ cope, keeping normal Preview as default. Validate the exact disposable database before resetting it, prepare fixtures be\
146
+ fore reporting readiness, and make Playwright use PLAYWRIGHT_BASE_URL without starting another server. If the required t\
147
+ est resources or external-effect controls are missing, report that specific blocker. Use `vibe64-helper preview ensure -\
148
+ -target <id> --wait --json` only to deliberately select an interactive target; it stays selected until changed.","Keep r\
149
+ outine browser startup incremental: reuse the isolated test schema, apply only pending migrations, and reset fixture dat\
150
+ a deterministically. Do not drop and rebuild the database or run a production frontend build for every focused browser c\
151
+ heck. Keep fresh-schema migration checks separate. If startup is slow, measure migrations, fixtures, and server startup \
152
+ before retrying or extending deadlines.","Keep test output small: run relevant files/cases, save stdout/stderr to local \
153
+ artifacts and preserve exit status. Report counts, duration, failed cases, actionable errors and artifact paths. Read on\
154
+ ly needed failure excerpts, not full passing/JSON/TAP/request/trace/image output. Retain startup, resource and Preview-r\
155
+ estoration errors even if tests pass, and trailing wrapper diagnostics separately from JSON. Do not rerun for output or \
156
+ reread unchanged logs; inspect on new output, changed state or a concrete blocker.","Batch related browser tests in one \
157
+ managed suite (one Preview switch and restore). Suites and live Preview actions are sequential: no browser actions, ensu\
158
+ re/restart or target changes during a suite or restoration. Wait on the original execution, including background runs, t\
159
+ hrough cleanup/restoration (empty polls: yield_time_ms: 30000 where supported; shorter only for interactive input or an \
160
+ immediate check); read-only status/logs stay available. Before live inspection, confirm `vibe64-helper playwright status\
161
+ ` has no active run and `vibe64-helper preview status` is ready on the restored target. To stop, read suite status then \
162
+ run `vibe64-helper playwright cancel <run-id>`, which waits for cleanup/restoration; retry it if cleanup needs attention\
163
+ . Never kill individual test/Preview PIDs or change locks. Launcher exit alone does not prove tests stopped. Recheck cur\
164
+ rent status before reporting a busy blocker.","If a managed command reports kernel task denials or a resource incident, \
165
+ retain its diagnostic and incident ID when reporting the blocker. Ask the platform operator to inspect that resource evi\
166
+ dence before retrying; do not increase test timeouts or weaken assertions to work around a process/thread limit. A gener\
167
+ ic browser timeout without resource evidence does not establish a platform cause."]),Pt=Object.freeze(["Each managed she\
168
+ ll command receives current development Env from Vibe64, including declared resource bindings; use them in ordinary comm\
169
+ ands. Do not build environment injection or copy managed credentials into source. Resource provisioning and application \
170
+ migrations remain separate preparation steps.","Use `vibe64-helper env status [development|production|all]` to inspect c\
171
+ onfigured key names without revealing values.","Pipe an available value to `vibe64-helper env set <development|productio\
172
+ n> <KEY> [--secret]`; never put values in arguments, logs, or repository files. Use empty stdin only when the user reque\
173
+ sted an empty value.","Keep development and production values separate. Never invent credentials, copy a value between s\
174
+ copes without explicit direction, or edit Vibe64 runtime/session storage.","After an Env mutation, report only the affec\
175
+ ted scope and key names, never their values, and claim success only when the command succeeded.","When declared, TEST_DB\
176
+ _NAME is the exact disposable integration database and BROWSER_TEST_DB_NAME is a separate reusable browser-fixture datab\
177
+ ase whose migration ledger survives routine runs. Follow the application\u2019s declared test resources; never reset DB_NAME,\
178
+ share these test identities, or invent a database name."]);function Be(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${t} must be an object.`);return e}function le(e,t,n){
179
+ let s=new Set(t),r=Object.keys(e).filter(i=>!s.has(i));if(r.length>0)throw new TypeError(`${n} contains unsupported fiel\
180
+ ds: ${r.join(", ")}.`)}function Me(e){if(le(e,["conversationKind","scope","session","hostGuidance"],"Vibe64 session cont\
181
+ ext"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"utf8")>1024))throw new TypeError(
182
+ "Vibe64 host guidance must be bounded text supplied by the host.");if(!Nt.includes(e.conversationKind))throw new TypeError(
183
+ "Vibe64 session context has an unknown conversationKind.");let t=Be(e.session,"Vibe64 session capabilities");le(t,je,"Vi\
184
+ be64 session capabilities");let n=Object.fromEntries(je.map(s=>{if(typeof t[s]!="boolean")throw new TypeError(`Vibe64 se\
185
+ ssion capability ${s} must be boolean.`);return[s,t[s]]}));return{conversationKind:e.conversationKind,scope:"session",...e.
186
+ hostGuidance?{hostGuidance:e.hostGuidance}:{},session:n}}function jt(e){le(e,["scope","stableContext"],"Vibe64 ephemeral\
187
+ context");let t=String(e.stableContext||"").trim();if(!t||t.length>Dt)throw new TypeError("Vibe64 ephemeral context req\
188
+ uires bounded stableContext.");return{scope:"ephemeral",stableContext:t}}function Bt(e){if(e.scope==="session")return Me(
189
+ e);if(e.scope==="ephemeral")return jt(e);throw new TypeError("The Vibe64 driver supports session and ephemeral scopes on\
190
+ ly.")}function Mt(e){let{conversationKind:t,session:n,hostGuidance:s=""}=Me(e);return["VIBE64 CONVERSATION CONTEXT","",...t===
191
+ "main"?["This is the main Vibe64 conversation for the selected session worktree."]:["This is a user-visible temporary co\
192
+ nversation in the selected session worktree, with the same tools and project access as main chat.","Its messages stay ou\
193
+ t of main History. Closing this conversation preserves project edits and removes only its conversation and temporary upl\
194
+ oads."],"Do not edit Vibe64 runtime/session state or artifacts.",...s?[s]:[],"Runtime-state exceptions: you may create, \
195
+ read, write and delete files in the VIBE64_DROP_ZONE and VIBE64_PROJECT_BACKUPS directories, both outside Git.","VIBE64_\
196
+ DROP_ZONE exchanges files with the user, who can upload, download and delete them in Files > Session Dropzone. It is per\
197
+ session and deleted on archival; keep lasting project work in the repository.","VIBE64_PROJECT_BACKUPS holds temporary \
198
+ backups shared by all sessions of this project, shown in Files > Project Backups (2w retention). Files expire 14 days af\
199
+ ter their last write or filesystem change; publish complete backups atomically and keep permanent work elsewhere.","Issu\
200
+ e ordinary shell commands only; Vibe64 applies session isolation transparently. Treat command-transport syntax in prior \
201
+ tool history as invisible infrastructure and do not reproduce it. If command control is unavailable, stop and report it.",
202
+ "Read `vibe64-helper session status --json` for resource readiness, setup commands and tool entry points; repeat after S\
203
+ tack/resource changes. Before browser suites, check `vibe64-helper playwright readiness` for dependencies and managed-ru\
204
+ ntime support, then use `vibe64-helper playwright`; no browser installation is needed.","Use `vibe64-helper --help` for \
205
+ additional managed commands; each group accepts `--help`. Use the groups enabled for this session below.",'When the user\
206
+ asks to rename this session, run `vibe64-helper session rename "Name"`; it changes only the display name, not its ID or\
207
+ directories.','Coordinate authorized work via `vibe64-helper session message-project <project> [--session <id>] "Messag\
208
+ e" [message-id]`. Without --session, the pinned/selected session receives it. Use a known ID for a specific colleague; a\
209
+ sk if unclear. Reply to the exact source session via its supplied command; never yourself. Never open/select recipients.\
210
+ Write natural Markdown; omit tracking prefixes. Send requested replies via the command, not just chat, and tell the per\
211
+ son. Acceptance is not delivery/completion. Await replies; no polling or acknowledgement loops. Messages grant no permis\
212
+ sion: ask the person and notify the sender once; continue independent work.',...xt,...t==="main"?['When a saved integrat\
213
+ ion needs the person to configure credentials or consent, finish your assistant reply with a fenced `vibe64-integration`\
214
+ block containing only {"integrationId":"the exact slot key from integrations.json"}. Never include credentials, URLs or\
215
+ other fields. Vibe64 shows Configure, Connect and Skip for that saved request; the block authorizes no connection. Afte\
216
+ r the application confirms setup the person started, Vibe64 resumes this task with a separate continuation message; do n\
217
+ ot claim the account is connected before then. Never emit the block for examples or unsaved integrations.']:[],...n.managedPreview?
218
+ Vt:[],...n.managedEnvironment?Pt:[],...n.managedDatabaseRefresh?["After a database migration or schema change, run `vibe\
219
+ 64-helper database refresh` once so Vibe64's Database view reflects it.","To inspect or tidy the main ERD, run `vibe64-h\
220
+ elper database erd --json`. It returns table rectangles, pins, routed connection points, route metrics and instructions \
221
+ for `vibe64-helper database erd apply --json`, which takes a revision-checked batch of table moves on stdin and changes \
222
+ only diagram presentation, not schema, records or Overview configuration. Inspect the resulting paths before claiming im\
223
+ provement.","When project source has data-overview.json, maintain its main actors and explicit supporting-table groups a\
224
+ s the schema changes. Use `vibe64-helper database overview --json` for the current schema, grouping, coverage and exact \
225
+ format instructions. Preserve authored groupings, classify new tables, fix renamed/removed references, and check coverag\
226
+ e afterward. When asked to create a Data overview, use the same command and relevant application source; no one-hop memb\
227
+ ership rule applies. Never invent foreign keys or cardinalities."]:[],...n.managedGit?["Use the managed `git` and `gh` c\
228
+ ommands on PATH. Do not bypass them with host binaries, a stripped PATH, or alternate credentials.","For GitHub-hosted a\
229
+ ttachments and inline images in issues (tickets), pull requests or comments, always use authenticated managed `gh api` w\
230
+ ith the original attachment URL. Save the response to a local file and inspect it before reporting what it contains. Do \
231
+ not use unauthenticated curl/wget, User-Agent experiments, or extract credentials for a separate HTTP client. An unauthe\
232
+ nticated 404 does not prove a private attachment is missing.","After changing GitHub issues, comments, labels or pull re\
233
+ quests, run `vibe64-helper github refresh` once so Vibe64's Issues/PR view reflects it.","When linking an issue in this \
234
+ project's repository, run `vibe64-helper github issue-link <number>` and use its returned Vibe64 path exactly as the pri\
235
+ mary Markdown link destination, including the /app prefix. Root-relative or same-origin Vibe64 links navigate in-app wit\
236
+ hout reloading. You may include the GitHub URL as a secondary link. Do not guess the project slug or host; issues in oth\
237
+ er repositories keep their GitHub links.","Report authentication or transport failures directly; do not inspect credenti\
238
+ als or invent another login path.","When a managed Git/GitHub command fails, tell the user which requested action failed\
239
+ , which earlier work is confirmed complete, what remains undone or unconfirmed, and the next safe action. Retain the rep\
240
+ orted failure stage, execution budget and execution reference when provided; do not expose credentials or dump raw outpu\
241
+ t unnecessarily.","A timeout or transport failure does not establish invalid authentication, exhausted AI quota, a GitHu\
242
+ b outage or a suspension problem. Separate recorded facts from hypotheses; say the cause is unknown when it is unproven.\
243
+ Recommend reconnection only when the reported error explicitly calls for it.","If the diagnostic says commandSubmitted=\
244
+ false, the requested Git/GitHub action was not attempted. After an execution timeout, lost response or unreadable respon\
245
+ se, its effects remain unconfirmed: use a read-only check of the affected Git/GitHub state before repeating any write. N\
246
+ ever claim that a comment was posted or not posted, or that a push succeeded or failed, solely from those errors. If ver\
247
+ ification is unavailable, report the outcome as unknown and stop; do not repeat the write or claim it was safely rolled \
248
+ back."]:[]].join(`
249
+ `)}function Y(e={}){let t=Be(e,"Vibe64 driver input"),n=Bt(t);return n.scope==="session"?Mt(n):n.stableContext}async function $e(e=""){let t=e||await Gt(de.join(qt.tmpdir(),"vibe64-genesis-context-"));await $t(t,{recursive:!0,mode:448});
250
+ let n=de.join(t,"sessions.json"),s=new Map;try{let c=JSON.parse(await Lt(n,"utf8"));for(let u of c.sessions)Y(u.promptContext),
251
+ s.set(u.upstreamSessionId,u)}catch(c){if(c.code!=="ENOENT")throw c}let r=Promise.resolve(),i=!1;async function o(c){let u=de.
252
+ join(t,"sessions.tmp");await Ht(u,JSON.stringify({sessions:[...c.values()]}),{mode:384}),await Ut(u,n)}return await o(s),
253
+ {registryPath:n,get(c){return structuredClone(s.get(c))},async register(c,u,a=""){if(i)throw new Error("The Genesis host\
142
254
  context registry is closed.");if(typeof c!="string"||!c.trim())throw new TypeError("Genesis host context requires a nat\
143
- ive conversation ID.");let d=structuredClone(u);W(d);let m={upstreamSessionId:c,workdir:o,promptContext:d},l=i.catch(()=>{}).
144
- then(async()=>{if(JSON.stringify(r.get(c))===JSON.stringify(m))return;let f=new Map(r);f.set(c,m),await a(f),r=f});i=l,await l},
145
- async close(){s=!0,await i.catch(()=>{}),r.clear(),e||await pt(t,{recursive:!0,force:!0})}}}import{createHash as mt}from"node:crypto";import ne from"node:path";var H=class extends Error{constructor(t,n,r=void 0){
146
- super(n),this.name="Vibe64StackOperationError",this.code=t,r!==void 0&&(this.details=r)}};function h(e,t,n,r,i={}){throw new H(
147
- e,n,{path:t,...r===void 0?{}:{line:r},...i})}function b(e,t,n,r,i){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(
148
- e))&&h(t,n,`${r} must be one non-empty line.`,i),e.trim()}function ht(e){let t=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];
149
- return t.length===0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function V(e,t,n,r,i,{count:s,maximum:a=64}={}){let c=ht(
150
- e);if(!c||c.length>a||s!==void 0&&c.length!==s||c.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=s===void 0?"separat\
151
- e non-empty":`exactly ${s}`;h(t,n,`${r} must contain ${u} backticked ${s===1?"value":"values"}.`,i)}return c}function ft(e=""){
152
- return typeof e=="string"&&!!e&&!/[\s\0{}]/u.test(e)&&!ne.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function k(e,t,n,r,i){
153
- let s=V(e,t,n,r,i);return ft(s[0])||h(t,n,`${r} must begin with a safe executable.`,i),s}function gt(e=""){return typeof e==
154
- "string"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!ne.posix.isAbsolute(e)&&ne.posix.normalize(e)===e&&!e.split("/").some(t=>!t||t===
155
- "..")}function I(e,t,n,r,i,{allowRoot:s=!0}={}){return(!gt(e)||!s&&e===".")&&h(t,n,`${r} must be a canonical project-rel\
156
- ative path.`,i),e}function R(e,t,n,r,i){let s=V(e,t,n,r,i);return s.some(a=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(a))&&h(t,
157
- n,`${r} must use lowercase technology ids separated into backticked values.`,i),new Set(s).size!==s.length&&h(t,n,`${r} \
158
- contains a duplicate technology id.`,i),s}function se(e,t,n,r,i){let s=b(e,t,n,r,i);return(!s.startsWith("/")||s.startsWith(
159
- "//")||/[\\?#]/u.test(s))&&h(t,n,`${r} must begin with one slash and contain no query or fragment.`,i),s}function q(e,t,n,r,i){
160
- let s=e.match(/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);s||h(t,n,`${r} must use \`- Ready when: \`GET\` \
161
- \`/path\` returns \`200\`\`.`,i);let a=Number(s[2]);return(!Number.isInteger(a)||a<200||a>399)&&h(t,n,`${r} status must \
162
- be from 200 through 399.`,i),{kind:"http",method:"GET",path:se(s[1],t,n,`${r} path`,i),status:a}}function re(e){return Array.
163
- isArray(e)?e.map(re):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,re(e[t])])):e}function A(e){
164
- let t=`${JSON.stringify(re(e),null,2)}
165
- `;return`sha256:${mt("sha256").update(t).digest("hex")}`}function j(e={},t={},n="operation"){if(e.stackHash!==t.stackHash)
166
- throw new H("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${n}. Retry the operation.`)}function P(e=[]){
167
- return[...new Set(e)].sort()}function T(e=[]){let t=e.map(n=>n.trim()).filter(Boolean);return t.length===1&&t[0]==="- No\
168
- thing."}var Ee="vibe64.application-deployment.v1",Se="Deployment",x="VIBE64_DEPLOYMENT_INVALID",wt=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
169
- Ie="- Recreate on restore: ",ve=Object.freeze({prepare:0,build:1,migrate:2,serve:3});function v(e,t,n,r={}){h(x,e,t,n,r)}
170
- function yt(e,t,n){let r=V(e.slice(Ie.length),x,t,"Deployment Recreate on restore paths",n);return r.some(i=>i.startsWith(
171
- "/")||i.includes("\\")||i.includes("***")||/[?[\]{}!]/u.test(i)||i.split("/").some(s=>!s||[".",".."].includes(s)))&&v(t,
255
+ ive conversation ID.");let m=structuredClone(u);Y(m);let l={upstreamSessionId:c,workdir:a,promptContext:m},d=r.catch(()=>{}).
256
+ then(async()=>{if(JSON.stringify(s.get(c))===JSON.stringify(l))return;let h=new Map(s);h.set(c,l),await o(h),s=h});r=d,await d},
257
+ async close(){i=!0,await r.catch(()=>{}),s.clear(),e||await Wt(t,{recursive:!0,force:!0})}}}var Le="vibe64.application-deployment.v1",Ue="Deployment",M="VIBE64_DEPLOYMENT_INVALID",zt=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
258
+ We="- Recreate on restore: ",Ge=Object.freeze({prepare:0,build:1,migrate:2,serve:3});function A(e,t,n,s={}){p(M,e,t,n,s)}
259
+ function Kt(e,t,n){let s=C(e.slice(We.length),M,t,"Deployment Recreate on restore paths",n);return s.some(r=>r.startsWith(
260
+ "/")||r.includes("\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(i)))&&A(t,
172
261
  "Deployment Recreate on restore paths must be canonical project-relative globs using only * and ** wildcards.",n),new Set(
173
- r).size!==r.length&&v(t,"Deployment contains a duplicate Recreate on restore path.",n),r}function bt(e,t,n){return{label:b(
174
- e[2],x,t,"Deployment step label",n),argv:k(e[3],x,t,"Deployment command",n),role:e[1].toLowerCase()}}function ie(){return{
175
- version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],readiness:null,steps:[]}}function Te(e,{path:t="\
176
- genesis/stack.md#Deployment"}={}){if(Array.isArray(e)||v(t,"Deployment must be supplied as exact Stack section lines."),
177
- T(e))return ie();let n=ie(),r=new Set;for(let s=0;s<e.length;s+=1){let a=e[s].trim();if(!a)continue;let c=s+1;if(a.startsWith(
178
- "- Workdir: ")){r.has("workdir")&&v(t,"Duplicate Deployment Workdir.",c),r.add("workdir");let o=V(a.slice(11),x,t,"Deplo\
179
- yment Workdir",c,{count:1})[0];n.workdir=I(o,x,t,"Deployment workdir",c);continue}if(a.startsWith("- Runtimes: ")){r.has(
180
- "runtimes")&&v(t,"Duplicate Deployment Runtimes.",c),r.add("runtimes"),n.runtimeRequirements=R(a.slice(12),x,t,"Deployme\
181
- nt runtimes",c);continue}if(a.startsWith(Ie)){r.has("restore-paths")&&v(t,"Duplicate Deployment Recreate on restore entr\
182
- y.",c),r.add("restore-paths"),n.artifact.disposablePaths=yt(a,t,c);continue}if(a.startsWith("- Ready when: ")){r.has("re\
183
- adiness")&&v(t,"Duplicate Deployment Ready when.",c),r.add("readiness"),n.readiness=q(a,x,t,"Deployment readiness",c);continue}
184
- let u=a.match(wt);if(u){n.steps.push(bt(u,t,c));continue}v(t,`Unknown Deployment entry: ${a}.`,c)}n.steps.length===0&&v(
185
- t,"## Deployment needs at least one command or exactly `- Nothing.`."),(n.steps.filter(({role:s})=>s==="serve").length!==
186
- 1||n.steps.at(-1).role!=="serve")&&v(t,"Deployment needs exactly one final Serve step.");for(let s=1;s<n.steps.length;s+=
187
- 1)ve[n.steps[s].role]<ve[n.steps[s-1].role]&&v(t,"Deployment steps must be ordered Prepare, Build, Migrate, then Serve.");
188
- return n.readiness||v(t,"Deployment needs one Ready when entry."),n.artifact.disposablePaths.length>0&&!n.steps.some(({role:s})=>s===
189
- "prepare")&&v(t,"Deployment may recreate paths on restore only when it declares a Prepare step."),n}function ke({environment:e={},
190
- section:t={}}={}){j(t,e,"Deployment section");let n=[...t.diagnostics||[]],r=ie();t.status==="ready"&&(r=Te(t.lines));let i=n.
191
- length>0?"blocked":r.steps.length>0?"ready":"unconfigured",s={version:r.version,artifact:r.artifact,workdir:r.workdir,runtimeRequirements:r.
192
- runtimeRequirements,readiness:r.readiness,steps:r.steps};return{contract:Ee,status:i,stackHash:t.stackHash,recipeHash:i===
193
- "ready"?A(s):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:P(r.runtimeRequirements),resources:structuredClone(
194
- e.resources||[]),...s,diagnostics:n}}var _e="vibe64.outputs.v1",z="Outputs",oe="vibe64.preview-identity.command.v1",g="VIBE64_OUTPUTS_INVALID",vt=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,
195
- ae=/\{([a-z][a-z0-9:-]*)\}/gu,Et=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,St=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,
196
- It=/^#### Download `([^`\r\n]+)`$/u,Tt=/^[A-Z_][A-Z0-9_]*$/u,kt=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,Rt=new Set([
197
- "HOME","LOGNAME","NODE_OPTIONS","PATH","TMPDIR","USER"]),Ot=new Set(["email","login","user-id"]),_t=new Set(["finite","i\
198
- nteractive"]),At=new Set(["terminal","web"]),Nt=[["- Command: ","command","Command"],["- Protocol: ","protocol","Protoco\
262
+ s).size!==s.length&&A(t,"Deployment contains a duplicate Recreate on restore path.",n),s}function Ft(e,t,n){return{label:O(
263
+ e[2],M,t,"Deployment step label",n),argv:_(e[3],M,t,"Deployment command",n),role:e[1].toLowerCase()}}function me(){return{
264
+ version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],readiness:null,steps:[]}}function He(e,{path:t="\
265
+ genesis/stack.md#Deployment"}={}){if(Array.isArray(e)||A(t,"Deployment must be supplied as exact Stack section lines."),
266
+ b(e))return me();let n=me(),s=new Set;for(let i=0;i<e.length;i+=1){let o=e[i].trim();if(!o)continue;let c=i+1;if(o.startsWith(
267
+ "- Workdir: ")){s.has("workdir")&&A(t,"Duplicate Deployment Workdir.",c),s.add("workdir");let a=C(o.slice(11),M,t,"Deplo\
268
+ yment Workdir",c,{count:1})[0];n.workdir=g(a,M,t,"Deployment workdir",c);continue}if(o.startsWith("- Runtimes: ")){s.has(
269
+ "runtimes")&&A(t,"Duplicate Deployment Runtimes.",c),s.add("runtimes"),n.runtimeRequirements=R(o.slice(12),M,t,"Deployme\
270
+ nt runtimes",c);continue}if(o.startsWith(We)){s.has("restore-paths")&&A(t,"Duplicate Deployment Recreate on restore entr\
271
+ y.",c),s.add("restore-paths"),n.artifact.disposablePaths=Kt(o,t,c);continue}if(o.startsWith("- Ready when: ")){s.has("re\
272
+ adiness")&&A(t,"Duplicate Deployment Ready when.",c),s.add("readiness"),n.readiness=te(o,M,t,"Deployment readiness",c);continue}
273
+ let u=o.match(zt);if(u){n.steps.push(Ft(u,t,c));continue}A(t,`Unknown Deployment entry: ${o}.`,c)}n.steps.length===0&&A(
274
+ t,"## Deployment needs at least one command or exactly `- Nothing.`."),(n.steps.filter(({role:i})=>i==="serve").length!==
275
+ 1||n.steps.at(-1).role!=="serve")&&A(t,"Deployment needs exactly one final Serve step.");for(let i=1;i<n.steps.length;i+=
276
+ 1)Ge[n.steps[i].role]<Ge[n.steps[i-1].role]&&A(t,"Deployment steps must be ordered Prepare, Build, Migrate, then Serve.");
277
+ return n.readiness||A(t,"Deployment needs one Ready when entry."),n.artifact.disposablePaths.length>0&&!n.steps.some(({role:i})=>i===
278
+ "prepare")&&A(t,"Deployment may recreate paths on restore only when it declares a Prepare step."),n}function qe({environment:e={},
279
+ section:t={}}={}){G(t,e,"Deployment section");let n=[...t.diagnostics||[]],s=me();t.status==="ready"&&(s=He(t.lines));let r=n.
280
+ length>0?"blocked":s.steps.length>0?"ready":"unconfigured",i={version:s.version,artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.
281
+ runtimeRequirements,readiness:s.readiness,steps:s.steps};return{contract:Le,status:r,stackHash:t.stackHash,recipeHash:r===
282
+ "ready"?T(i):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:B(s.runtimeRequirements),resources:structuredClone(
283
+ e.resources||[]),...i,diagnostics:n}}var Fe="vibe64.outputs.v1",ne="Outputs",fe="vibe64.preview-identity.command.v1",w="VIBE64_OUTPUTS_INVALID",Yt=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,
284
+ he=/\{([a-z][a-z0-9:-]*)\}/gu,Jt=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,Xt=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,
285
+ Qt=/^#### Download `([^`\r\n]+)`$/u,Zt=/^[A-Z_][A-Z0-9_]*$/u,en=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,tn=new Set([
286
+ "HOME","LOGNAME","NODE_OPTIONS","PATH","TMPDIR","USER"]),nn=new Set(["email","login","user-id"]),sn=new Set(["finite","i\
287
+ nteractive"]),rn=new Set(["terminal","web"]),on=[["- Command: ","command","Command"],["- Protocol: ","protocol","Protoco\
199
288
  l"],["- Identity types: ","identityTypes","Identity types"],["- Enabled environment: ","enabledEnvironment","Enabled env\
200
289
  ironment"],["- Secret environment: ","secretEnvironment","Secret environment"],["- Runtimes: ","runtimes","Runtimes"],["\
201
- - Timeout ms: ","timeoutMs","Timeout ms"]];function p(e,t,n,r={}){h(g,e,t,n,r)}function ce(e,t,n,r){let i=b(e,g,t,n,r);return vt.
202
- test(i)||p(t,`${n} must use lowercase letters, digits, and single hyphens.`,r),i}function Ae(e,t,n,r,i,s){return V(e.slice(
203
- t.length),g,n,r,i,s)}function N(e,t,n,r,i){return Ae(e,t,n,r,i,{count:1})[0]}function Dt(e,t,n,r){let i=k(e,g,t,n,r);for(let s of i)
204
- s.replace(ae,"").includes("{parameter:")&&p(t,`${n} has an invalid {parameter:id} placeholder.`,r),[...s.matchAll(ae)].some(
205
- a=>!["host","port"].includes(a[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(a[1]))&&p(t,`${n} supports only {host}\
206
- , {port}, and {parameter:id} placeholders.`,r);return i}function w(e,t,n,r,i,s){e.seen.has(t)&&p(r,`Duplicate ${s}.`,i),
207
- e.seen.add(t),e[t]=n}function xt(e,t,n){return{id:ce(e[1],t,"Output target id",n),label:b(e[2],g,t,"Output target label",
290
+ - Timeout ms: ","timeoutMs","Timeout ms"]];function f(e,t,n,s={}){p(w,e,t,n,s)}function ge(e,t,n,s){let r=O(e,w,t,n,s);return Yt.
291
+ test(r)||f(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),r}function Ye(e,t,n,s,r,i){return C(e.slice(
292
+ t.length),w,n,s,r,i)}function P(e,t,n,s,r){return Ye(e,t,n,s,r,{count:1})[0]}function an(e,t,n,s){let r=_(e,w,t,n,s);for(let i of r)
293
+ i.replace(he,"").includes("{parameter:")&&f(t,`${n} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(he)].some(
294
+ o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&f(t,`${n} supports only {host}\
295
+ , {port}, and {parameter:id} placeholders.`,s);return r}function v(e,t,n,s,r,i){e.seen.has(t)&&f(s,`Duplicate ${i}.`,r),
296
+ e.seen.add(t),e[t]=n}function cn(e,t,n){return{id:ge(e[1],t,"Output target id",n),label:O(e[2],w,t,"Output target label",
208
297
  n),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,downloads:[],parameters:[],
209
- seen:new Set,line:n}}function Ct(e,t,n,r){if(t==="- Required."){w(e,"required",!0,n,r,"Parameter Required entry");return}
210
- for(let[i,s]of[["Default","default"],["Description","description"]]){let a=`- ${i}: `;if(t.startsWith(a)){let c=N(t,a,n,
211
- `Parameter ${i}`,r);w(e,s,c,n,r,`Parameter ${i} entry`);return}}p(n,`Unknown Outputs parameter entry: ${t}.`,r)}function Vt(e,t={}){
212
- let n=e.parameters||[],r=s=>h("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",s);(!t||typeof t!="object"||Array.isArray(t))&&
213
- r("Output parameters must be an object of text values.");let i=new Set(n.map(({id:s})=>s));for(let s of Object.keys(t))i.
214
- has(s)||r(`Unknown output parameter: ${s}.`);return Object.fromEntries(n.map(s=>{let a=Object.hasOwn(t,s.id)?t[s.id]:s.default;
215
- return(typeof a!="string"||a.length>4096||/[\0\r\n]/u.test(a))&&r(`${s.label} must be a single line of text, at most 409\
216
- 6 characters.`),s.required&&!a.trim()&&r(`${s.label} is required.`),[s.id,a]}))}function jt(e){return{kind:"",preferredPort:null,
217
- urlPath:"/",readiness:null,seen:new Set,line:e}}function Pt(e,t,n){return{id:ce(e[1],t,"Download id",n),path:"",name:"",
218
- mediaType:"",seen:new Set,line:n}}function $t(e,t,n){/^[0-9]+$/u.test(e)||p(t,"Web presentation preferred port must be a\
219
- n integer from 1024 through 65535.",n);let r=Number(e);return(!Number.isSafeInteger(r)||r<1024||r>65535)&&p(t,"Web prese\
220
- ntation preferred port must be an integer from 1024 through 65535.",n),r}function Mt(e,t,n,r){if(t.startsWith("- Data: ")){
221
- let s=N(t,"- Data: ",n,"Output target Data",r);["development","test"].includes(s)||p(n,"Output target Data must be `deve\
222
- lopment` or `test`.",r),w(e,"dataMode",s,n,r,"output target Data entry");return}if(t==="- Default."){w(e,"default",!0,n,
223
- r,"output target Default entry");return}if(t.startsWith("- Mode: ")){let s=N(t,"- Mode: ",n,"Output target Mode",r);_t.has(
224
- s)||p(n,"Output target Mode must be `interactive` or `finite`.",r),w(e,"mode",s,n,r,"output target Mode entry");return}if(t.
225
- startsWith("- Workdir: ")){w(e,"workdir",I(N(t,"- Workdir: ",n,"Output target Workdir",r),g,n,"Output target workdir",r),
226
- n,r,"output target Workdir entry");return}if(t.startsWith("- Runtimes: ")){w(e,"runtimeRequirements",R(t.slice(12),g,n,"\
227
- Output target runtimes",r),n,r,"output target Runtimes entry");return}let i=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);
228
- if(i){let s=i[1].toLowerCase(),a=Dt(i[3],n,"Output step command",r);s!=="run"&&a.some(c=>/\{(?:host|port)\}/u.test(c))&&
229
- p(n,"Only a web presentation's Run step may use {host} or {port} placeholders.",r),e.steps.push({label:b(i[2],g,n,"Outpu\
230
- t step label",r),argv:a,role:s});return}p(n,`Unknown Outputs target entry: ${t}.`,r)}function Bt(e,t,n,r){if(t.startsWith(
231
- "- Kind: ")){let i=N(t,"- Kind: ",n,"Presentation Kind",r);At.has(i)||p(n,"Presentation Kind must be `terminal` or `web`\
232
- .",r),w(e,"kind",i,n,r,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){w(e,"preferredPort",$t(N(
233
- t,"- Preferred port: ",n,"Web presentation Preferred port",r),n,r),n,r,"Presentation Preferred port entry");return}if(t.
234
- startsWith("- URL path: ")){w(e,"urlPath",se(N(t,"- URL path: ",n,"Web presentation URL path",r),g,n,"Web presentation U\
235
- RL path",r),n,r,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){w(e,"readiness",q(t,g,n,"Web pr\
236
- esentation readiness",r),n,r,"Presentation Ready when entry");return}p(n,`Unknown Presentation entry: ${t}.`,r)}function Wt(e,t,n){
237
- let r=b(e,g,t,"Download Name",n);return(r.length>255||[".",".."].includes(r)||/[\\/\0]/u.test(r)||r.trim()!==r)&&p(t,"Do\
238
- wnload Name must be a safe filename without path separators.",n),r}function Gt(e,t,n){let r=b(e,g,t,"Download Media type",
239
- n);return(r.length>127||!kt.test(r))&&p(t,"Download Media type must be a lowercase type/subtype value.",n),r}function Lt(e,t,n,r){
240
- if(t.startsWith("- Path: ")){w(e,"path",I(N(t,"- Path: ",n,"Download Path",r),g,n,"Download path",r,{allowRoot:!1}),n,r,
241
- "Download Path entry");return}if(t.startsWith("- Name: ")){w(e,"name",Wt(N(t,"- Name: ",n,"Download Name",r),n,r),n,r,"D\
242
- ownload Name entry");return}if(t.startsWith("- Media type: ")){w(e,"mediaType",Gt(N(t,"- Media type: ",n,"Download Media\
243
- type",r),n,r),n,r,"Download Media type entry");return}p(n,`Unknown Download entry: ${t}.`,r)}function Ut(e,t,n){for(let[
244
- r,i]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[r]||p(t,`Output target ${n} Download ${e.id} needs ${i}\
245
- .`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Re(e,t,n,r){if(e===void 0)return"";let i=b(
246
- e,g,t,`Preview identity ${n} environment name`,r);return(!Tt.test(i)||Rt.has(i)||i.startsWith("XDG_"))&&p(t,`Preview ide\
247
- ntity ${n} environment name is invalid.`,r),i}function Ht(e){return{seen:new Set,line:e}}function qt(e,t,n,r){let i=Nt.find(
248
- ([o])=>t.startsWith(o));i||p(n,`Unknown Preview identity entry: ${t}.`,r);let[s,a,c]=i,u=Ae(t,s,n,`Preview identity ${c}`,
249
- r);!["command","identityTypes","runtimes"].includes(a)&&u.length!==1&&p(n,`Preview identity ${c} accepts exactly one val\
250
- ue.`,r),w(e,a,u,n,r,`Preview identity ${c} entry`)}function zt(e,t,n){for(let[o,d]of[["command","Command"],["protocol","\
251
- Protocol"],["identityTypes","Identity types"]])e[o]||p(t,`Output target ${n} Preview identity needs ${d}.`,e.line);let r=e.
252
- command.map(o=>`\`${o}\``).join(" "),i=k(r,g,t,"Preview identity command",e.line);(!i[0].includes("/")||i[0].includes("\\")||
253
- i[0].split("/").some(o=>!o||[".",".."].includes(o))||i.some(o=>/\{(?:host|port)\}/u.test(o)))&&p(t,"Preview identity com\
254
- mand must use a literal app-owned project-relative executable.",e.line);let s=e.protocol[0];s!==oe&&p(t,`Preview identit\
255
- y protocol must be ${oe}.`,e.line);let a=[...new Set(e.identityTypes.map(o=>(Ot.has(o)||p(t,`Unsupported preview identit\
256
- y type: ${o}.`,e.line),o)))];a.length!==e.identityTypes.length&&p(t,"Preview identity types must not contain duplicates.",
257
- e.line);let c={enabled:Re(e.enabledEnvironment?.[0],t,"enabled",e.line),secret:Re(e.secretEnvironment?.[0],t,"secret",e.
258
- line)};c.enabled&&c.enabled===c.secret&&p(t,"Preview identity enabled and secret environment names must differ.",e.line);
259
- let u=1e4;if(e.timeoutMs){let o=e.timeoutMs[0];/^[0-9]+$/u.test(o)||p(t,"Preview identity Timeout ms must be from 1 thro\
260
- ugh 30000.",e.line),u=Number(o),(!Number.isSafeInteger(u)||u<1||u>3e4)&&p(t,"Preview identity Timeout ms must be from 1 \
261
- through 30000.",e.line)}return{command:i,environment:c,identityTypes:a,protocol:s,runtimes:e.runtimes?R(e.runtimes.map(o=>`\
262
- \`${o}\``).join(" "),g,t,"Preview identity runtimes",e.line):[],timeoutMs:u}}function Kt(e,t,n){return e.kind||p(t,`Outp\
298
+ seen:new Set,line:n}}function un(e,t,n,s){if(t==="- Required."){v(e,"required",!0,n,s,"Parameter Required entry");return}
299
+ for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(t.startsWith(o)){let c=P(t,o,n,
300
+ `Parameter ${r}`,s);v(e,i,c,n,s,`Parameter ${r} entry`);return}}f(n,`Unknown Outputs parameter entry: ${t}.`,s)}function pn(e,t={}){
301
+ let n=e.parameters||[],s=i=>p("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!t||typeof t!="object"||Array.isArray(t))&&
302
+ s("Output parameters must be an object of text values.");let r=new Set(n.map(({id:i})=>i));for(let i of Object.keys(t))r.
303
+ has(i)||s(`Unknown output parameter: ${i}.`);return Object.fromEntries(n.map(i=>{let o=Object.hasOwn(t,i.id)?t[i.id]:i.default;
304
+ return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${i.label} must be a single line of text, at most 409\
305
+ 6 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function ln(e){return{kind:"",preferredPort:null,
306
+ urlPath:"/",readiness:null,seen:new Set,line:e}}function dn(e,t,n){return{id:ge(e[1],t,"Download id",n),path:"",name:"",
307
+ mediaType:"",seen:new Set,line:n}}function mn(e,t,n){/^[0-9]+$/u.test(e)||f(t,"Web presentation preferred port must be a\
308
+ n integer from 1024 through 65535.",n);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&f(t,"Web prese\
309
+ ntation preferred port must be an integer from 1024 through 65535.",n),s}function fn(e,t,n,s){if(t.startsWith("- Data: ")){
310
+ let i=P(t,"- Data: ",n,"Output target Data",s);["development","test"].includes(i)||f(n,"Output target Data must be `deve\
311
+ lopment` or `test`.",s),v(e,"dataMode",i,n,s,"output target Data entry");return}if(t==="- Default."){v(e,"default",!0,n,
312
+ s,"output target Default entry");return}if(t.startsWith("- Mode: ")){let i=P(t,"- Mode: ",n,"Output target Mode",s);sn.has(
313
+ i)||f(n,"Output target Mode must be `interactive` or `finite`.",s),v(e,"mode",i,n,s,"output target Mode entry");return}if(t.
314
+ startsWith("- Workdir: ")){v(e,"workdir",g(P(t,"- Workdir: ",n,"Output target Workdir",s),w,n,"Output target workdir",s),
315
+ n,s,"output target Workdir entry");return}if(t.startsWith("- Runtimes: ")){v(e,"runtimeRequirements",R(t.slice(12),w,n,"\
316
+ Output target runtimes",s),n,s,"output target Runtimes entry");return}let r=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);
317
+ if(r){let i=r[1].toLowerCase(),o=an(r[3],n,"Output step command",s);i!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&
318
+ f(n,"Only a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:O(r[2],w,n,"Outpu\
319
+ t step label",s),argv:o,role:i});return}f(n,`Unknown Outputs target entry: ${t}.`,s)}function hn(e,t,n,s){if(t.startsWith(
320
+ "- Kind: ")){let r=P(t,"- Kind: ",n,"Presentation Kind",s);rn.has(r)||f(n,"Presentation Kind must be `terminal` or `web`\
321
+ .",s),v(e,"kind",r,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){v(e,"preferredPort",mn(P(
322
+ t,"- Preferred port: ",n,"Web presentation Preferred port",s),n,s),n,s,"Presentation Preferred port entry");return}if(t.
323
+ startsWith("- URL path: ")){v(e,"urlPath",ue(P(t,"- URL path: ",n,"Web presentation URL path",s),w,n,"Web presentation U\
324
+ RL path",s),n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){v(e,"readiness",te(t,w,n,"Web p\
325
+ resentation readiness",s),n,s,"Presentation Ready when entry");return}f(n,`Unknown Presentation entry: ${t}.`,s)}function gn(e,t,n){
326
+ let s=O(e,w,t,"Download Name",n);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||s.trim()!==s)&&f(t,"Do\
327
+ wnload Name must be a safe filename without path separators.",n),s}function yn(e,t,n){let s=O(e,w,t,"Download Media type",
328
+ n);return(s.length>127||!en.test(s))&&f(t,"Download Media type must be a lowercase type/subtype value.",n),s}function bn(e,t,n,s){
329
+ if(t.startsWith("- Path: ")){v(e,"path",g(P(t,"- Path: ",n,"Download Path",s),w,n,"Download path",s,{allowRoot:!1}),n,s,
330
+ "Download Path entry");return}if(t.startsWith("- Name: ")){v(e,"name",gn(P(t,"- Name: ",n,"Download Name",s),n,s),n,s,"D\
331
+ ownload Name entry");return}if(t.startsWith("- Media type: ")){v(e,"mediaType",yn(P(t,"- Media type: ",n,"Download Media\
332
+ type",s),n,s),n,s,"Download Media type entry");return}f(n,`Unknown Download entry: ${t}.`,s)}function wn(e,t,n){for(let[
333
+ s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||f(t,`Output target ${n} Download ${e.id} needs ${r}\
334
+ .`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function ze(e,t,n,s){if(e===void 0)return"";let r=O(
335
+ e,w,t,`Preview identity ${n} environment name`,s);return(!Zt.test(r)||tn.has(r)||r.startsWith("XDG_"))&&f(t,`Preview ide\
336
+ ntity ${n} environment name is invalid.`,s),r}function En(e){return{seen:new Set,line:e}}function vn(e,t,n,s){let r=on.find(
337
+ ([a])=>t.startsWith(a));r||f(n,`Unknown Preview identity entry: ${t}.`,s);let[i,o,c]=r,u=Ye(t,i,n,`Preview identity ${c}`,
338
+ s);!["command","identityTypes","runtimes"].includes(o)&&u.length!==1&&f(n,`Preview identity ${c} accepts exactly one val\
339
+ ue.`,s),v(e,o,u,n,s,`Preview identity ${c} entry`)}function Sn(e,t,n){for(let[a,m]of[["command","Command"],["protocol","\
340
+ Protocol"],["identityTypes","Identity types"]])e[a]||f(t,`Output target ${n} Preview identity needs ${m}.`,e.line);let s=e.
341
+ command.map(a=>`\`${a}\``).join(" "),r=_(s,w,t,"Preview identity command",e.line);(!r[0].includes("/")||r[0].includes("\\")||
342
+ r[0].split("/").some(a=>!a||[".",".."].includes(a))||r.some(a=>/\{(?:host|port)\}/u.test(a)))&&f(t,"Preview identity com\
343
+ mand must use a literal app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==fe&&f(t,`Preview identit\
344
+ y protocol must be ${fe}.`,e.line);let o=[...new Set(e.identityTypes.map(a=>(nn.has(a)||f(t,`Unsupported preview identit\
345
+ y type: ${a}.`,e.line),a)))];o.length!==e.identityTypes.length&&f(t,"Preview identity types must not contain duplicates.",
346
+ e.line);let c={enabled:ze(e.enabledEnvironment?.[0],t,"enabled",e.line),secret:ze(e.secretEnvironment?.[0],t,"secret",e.
347
+ line)};c.enabled&&c.enabled===c.secret&&f(t,"Preview identity enabled and secret environment names must differ.",e.line);
348
+ let u=1e4;if(e.timeoutMs){let a=e.timeoutMs[0];/^[0-9]+$/u.test(a)||f(t,"Preview identity Timeout ms must be from 1 thro\
349
+ ugh 30000.",e.line),u=Number(a),(!Number.isSafeInteger(u)||u<1||u>3e4)&&f(t,"Preview identity Timeout ms must be from 1 \
350
+ through 30000.",e.line)}return{command:r,environment:c,identityTypes:o,protocol:i,runtimes:e.runtimes?R(e.runtimes.map(a=>`\
351
+ \`${a}\``).join(" "),w,t,"Preview identity runtimes",e.line):[],timeoutMs:u}}function Tn(e,t,n){return e.kind||f(t,`Outp\
263
352
  ut target ${n} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.readiness||e.seen.has("\
264
- urlPath"))&&p(t,`Output target ${n} terminal Presentation accepts only Kind.`,e.line),{kind:"terminal"}):(e.readiness||p(
353
+ urlPath"))&&f(t,`Output target ${n} terminal Presentation accepts only Kind.`,e.line),{kind:"terminal"}):(e.readiness||f(
265
354
  t,`Output target ${n} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.preferredPort,urlPath:e.
266
- urlPath,readiness:e.readiness})}function Oe(e,t){e.mode||p(t,`Output target ${e.id} needs one Mode entry.`,e.line),e.steps.
267
- length===0&&p(t,`Output target ${e.id} needs at least one step.`,e.line);let n={prepare:0,build:1,run:2};for(let o=1;o<e.
268
- steps.length;o+=1)n[e.steps[o].role]<n[e.steps[o-1].role]&&p(t,`Output target ${e.id} steps must be ordered Prepare, Bui\
269
- ld, then Run.`,e.line);let r=e.steps.filter(({role:o})=>o==="run"),i=e.downloads.map(o=>Ut(o,t,e.id));new Set(i.map(({id:o})=>o)).
270
- size!==i.length&&p(t,`Output target ${e.id} contains a duplicate Download id.`,e.line),e.mode==="finite"?((r.length>0||e.
271
- presentation||e.previewIdentity)&&p(t,`Finite output target ${e.id} cannot have Run, Presentation, or Preview identity e\
272
- ntries.`,e.line),i.length===0&&p(t,`Finite output target ${e.id} needs at least one Download.`,e.line)):r.length!==1||e.
273
- steps.at(-1).role!=="run"?p(t,`Interactive output target ${e.id} needs exactly one final Run step.`,e.line):e.presentation||
274
- p(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let s=e.presentation?Kt(e.presentation,t,e.id):null,
275
- a=e.steps.flatMap(({argv:o})=>o.flatMap(d=>[...d.matchAll(ae)].map(m=>m[1])));a.some(o=>["host","port"].includes(o))&&s?.
276
- kind!=="web"&&p(t,"Only a web output target may use {host} or {port} placeholders.",e.line);let c=e.parameters.map(({seen:o,
277
- ...d})=>d),u=new Set(c.map(({id:o})=>o));(c.length>16||u.size!==c.length)&&p(t,`Output target ${e.id} may declare at mos\
278
- t 16 parameters with unique ids.`,e.line);for(let o of a.filter(d=>d.startsWith("parameter:"))){let d=o.slice(10);u.has(
279
- d)||p(t,`Undeclared output parameter: ${d}.`,e.line)}for(let o of c)a.includes(`parameter:${o.id}`)||p(t,`Output paramet\
280
- er ${o.id} must be used in a step command.`,e.line);return e.previewIdentity&&s?.kind!=="web"&&p(t,"Only a web output ta\
355
+ urlPath,readiness:e.readiness})}function Ke(e,t){e.mode||f(t,`Output target ${e.id} needs one Mode entry.`,e.line),e.steps.
356
+ length===0&&f(t,`Output target ${e.id} needs at least one step.`,e.line);let n={prepare:0,build:1,run:2};for(let a=1;a<e.
357
+ steps.length;a+=1)n[e.steps[a].role]<n[e.steps[a-1].role]&&f(t,`Output target ${e.id} steps must be ordered Prepare, Bui\
358
+ ld, then Run.`,e.line);let s=e.steps.filter(({role:a})=>a==="run"),r=e.downloads.map(a=>wn(a,t,e.id));new Set(r.map(({id:a})=>a)).
359
+ size!==r.length&&f(t,`Output target ${e.id} contains a duplicate Download id.`,e.line),e.mode==="finite"?((s.length>0||e.
360
+ presentation||e.previewIdentity)&&f(t,`Finite output target ${e.id} cannot have Run, Presentation, or Preview identity e\
361
+ ntries.`,e.line),r.length===0&&f(t,`Finite output target ${e.id} needs at least one Download.`,e.line)):s.length!==1||e.
362
+ steps.at(-1).role!=="run"?f(t,`Interactive output target ${e.id} needs exactly one final Run step.`,e.line):e.presentation||
363
+ f(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?Tn(e.presentation,t,e.id):null,
364
+ o=e.steps.flatMap(({argv:a})=>a.flatMap(m=>[...m.matchAll(he)].map(l=>l[1])));o.some(a=>["host","port"].includes(a))&&i?.
365
+ kind!=="web"&&f(t,"Only a web output target may use {host} or {port} placeholders.",e.line);let c=e.parameters.map(({seen:a,
366
+ ...m})=>m),u=new Set(c.map(({id:a})=>a));(c.length>16||u.size!==c.length)&&f(t,`Output target ${e.id} may declare at mos\
367
+ t 16 parameters with unique ids.`,e.line);for(let a of o.filter(m=>m.startsWith("parameter:"))){let m=a.slice(10);u.has(
368
+ m)||f(t,`Undeclared output parameter: ${m}.`,e.line)}for(let a of c)o.includes(`parameter:${a.id}`)||f(t,`Output paramet\
369
+ er ${a.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!=="web"&&f(t,"Only a web output ta\
281
370
  rget may declare Preview identity.",e.line),{id:e.id,label:e.label,default:e.default,mode:e.mode,workdir:e.workdir,runtimeRequirements:e.
282
- runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:s,downloads:i,...c.length?{parameters:c}:
283
- {},...e.previewIdentity?{previewIdentity:zt(e.previewIdentity,t,e.id)}:{}}}function K(e,{path:t="genesis/stack.md#Output\
284
- s"}={}){if(Array.isArray(e)||p(t,"Outputs must be supplied as exact Stack section lines."),T(e))return{version:1,targets:[]};
285
- let n=[],r=null,i="target",s=null;for(let c=0;c<e.length;c+=1){let u=e[c].trim();if(!u)continue;let o=c+1,d=u.match(Et);
286
- if(d){r&&n.push(Oe(r,t)),r=xt(d,t,o),i="target",s=null;continue}r||p(t,"## Outputs must begin with a Target heading.",o);
287
- let m=u.match(St);if(m){let f={id:ce(m[1],t,"Parameter id",o),label:b(m[2],g,t,"Parameter label",o),default:"",description:"",
288
- required:!1,seen:new Set};r.parameters.push(f),i="parameter",s=f;continue}if(u==="#### Presentation"){r.presentation&&p(
289
- t,"Presentation must appear at most once below an output target.",o),r.presentation=jt(o),i="presentation",s=r.presentation;
290
- continue}if(u==="#### Preview identity"){r.previewIdentity&&p(t,"Preview identity must appear at most once below an outp\
291
- ut target.",o),r.previewIdentity=Ht(o),i="previewIdentity",s=r.previewIdentity;continue}let l=u.match(It);if(l){let f=Pt(
292
- l,t,o);r.downloads.push(f),i="download",s=f;continue}i==="parameter"?Ct(s,u,t,o):i==="presentation"?Bt(s,u,t,o):i==="pre\
293
- viewIdentity"?qt(s,u,t,o):i==="download"?Lt(s,u,t,o):Mt(r,u,t,o)}r&&n.push(Oe(r,t)),n.length===0&&p(t,"## Outputs needs \
294
- at least one Target or exactly `- Nothing.`.");let a=n.map(({id:c})=>c);return new Set(a).size!==a.length&&p(t,"Outputs \
295
- contains a duplicate target id."),n.filter(({default:c})=>c).length>1&&p(t,"Outputs may declare at most one default targ\
296
- et."),{version:1,targets:n}}function Ne({environment:e={},section:t={}}={}){j(t,e,"Outputs section");let n=[...t.diagnostics||
297
- []],r=[...e.diagnostics||[]],i={version:1,targets:[]};t.status==="ready"&&(i=K(t.lines));let s=r.length===0?null:r.map(({
298
- message:o})=>o).join(" "),a=i.targets.map(o=>({...o,source:t.source||null,available:n.length===0&&r.length===0,disabledReason:s})),
299
- c=[...n,...r],u="ready";return c.length>0?u="blocked":a.length===0&&(u="unconfigured"),{contract:_e,status:u,stackHash:t.
300
- stackHash,components:[...t.components||[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:P(
301
- a.flatMap(o=>o.runtimeRequirements)),resources:structuredClone(e.resources||[]),targets:a,diagnostics:c}}var De="Project services",Ft="vibe64.project-services.v1",$="VIBE64_PROJECT_SERVICES_INVALID",M="genesis/stack.md#Projec\
302
- t services";function xe(e){if(Array.isArray(e)||h($,M,"Expected exact Project services section lines."),T(e))return[];let t=[];
303
- for(let[n,r]of e.entries()){let i=r.trim();if(!i)continue;let s=n+1,a=i.match(/^- Start `([a-z][a-z0-9-]{0,63})` with (.+?): (.+)$/u);
304
- a||h($,M,"Use: - Start `service-id` with `runtime` [in `workdir`]: `command` `argument`...",s),t.some(({id:u})=>u===a[1])&&
305
- h($,M,"Duplicate project service id.",s);let c=a[2].match(/^(.*?) in `([^`\r\n]+)`$/u);t.push({id:a[1],runtimeRequirements:R(
306
- c?c[1]:a[2],$,M,"Service runtimes",s),workdir:I(c?.[2]||".",$,M,"Service workdir",s),argv:k(a[3],$,M,"Service command",s)})}
307
- return t.length||h($,M,"Declare a service or exactly `- Nothing.`."),t}function Ce(e={}){let t=e.status==="ready"?xe(e.lines):
308
- [];return{contract:Ft,status:e.status==="blocked"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?
309
- A(t):"",diagnostics:e.diagnostics||[]}}import{access as Yt}from"node:fs/promises";import Ve from"node:path";var je="vibe64.workspace-setup.v1",L="Workspace setup",G="VIBE64_WORKSPACE_SETUP_INVALID",Jt=/^- Prepare `([^`\r\n]+)` with (.+?):[ \t]+(.+)$/u,
310
- Xt=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,Qt=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Zt=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
311
- function ue(e,t,n,r={}){h(G,e,t,n,r)}function F(e,{path:t="genesis/stack.md#Workspace setup"}={}){if(Array.isArray(e)||ue(
312
- t,"Workspace setup must be supplied as exact Stack section lines."),T(e))return[];let n=[];for(let r=0;r<e.length;r+=1){
313
- let i=e[r].trim();if(!i)continue;let s=r+1,a=i.match(Jt);a||ue(t,"Every Workspace setup entry must use: - Prepare `label\
314
- ` with `runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",s,{observed:i});let c=a[2].match(Xt),u=c?
315
- null:a[2].match(Qt),o=c?c[1]:u?u[1]:a[2],d=c?.[2]||u?.[2]||"",m=o.match(Zt),l=m?m[1]:o,f=m?m[2]:".";n.push({label:b(a[1],
316
- G,t,"Workspace setup step label",s),argv:k(a[3],G,t,"Workspace setup command",s),runtimeRequirements:R(l,G,t,"Workspace \
317
- setup runtimes",s),workdir:I(f,G,t,"Workspace setup workdir",s),...d?{condition:{pathExists:I(d,G,t,"Workspace setup con\
318
- dition path",s,{allowRoot:!1}),onMissing:c?"wait":"skip"}}:{}})}return n.length===0&&ue(t,"## Workspace setup needs at l\
319
- east one Prepare entry or exactly `- Nothing.`."),n}async function en(e,t){try{return await Yt(Ve.join(e,t)),!0}catch(n){
320
- if(["ENOENT","ENOTDIR"].includes(n?.code))return!1;throw n}}async function Pe({projectRoot:e,section:t={}}={}){let n=[...t.
321
- diagnostics||[]],r=[];t.status==="ready"&&(r=F(t.lines));let i=[],s=[],a=Ve.resolve(e);if(n.length===0)for(let l of r){if(!l.
322
- condition||await en(a,l.condition.pathExists)){i.push(l);continue}l.condition.onMissing==="wait"&&s.push(l.condition.pathExists)}
323
- if(s.length>0){let l=P(s);n.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting for project ${l.
324
- length===1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let c=n.some(({code:l})=>l==="VIBE64_WORKSPACE_SETUP_W\
325
- AITING"),u=n.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),o="unconfigured";u?o="blocked":!c&&i.length>0&&(o="r\
326
- eady");let d=i.map(({condition:l,...f})=>f),m={version:1,steps:d};return{contract:je,status:o,stackHash:t.stackHash,recipeHash:o===
327
- "ready"?A(m):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:P(d.flatMap(l=>l.runtimeRequirements)),
328
- steps:d,diagnostics:n}}var Me="vibe64.resource-estimates.v1",Y="Resource estimates",Be="VIBE64_RESOURCE_ESTIMATES_INVALID",tn=1024*1024,$e=1024*
329
- 1024,nn=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
330
- ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function O(e,t,n){h(Be,
331
- e,t,n)}function pe(e,t,n,r,i){let s=e.get(t),a=e.get(n);return(s===void 0||a===void 0||s>a)&&O(r,"Each resource phase re\
332
- quires typical and high estimates, with typical no greater than high.",i),{typicalBytes:s,highBytes:a}}function We(e,{path:t="\
333
- genesis/stack.md#Resource estimates",targets:n=[],hasWorkspaceSetup:r=!1}={}){(!Array.isArray(e)||e.length>2048||e.some(
334
- o=>typeof o!="string")||Buffer.byteLength(e.join(`
335
- `),"utf8")>64*1024)&&O(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let i={version:1,
336
- outputs:[],workspaceSetup:null};if(T(e))return i;let s=new Map(n.map(o=>[o.id,o])),a=new Set,c=null;function u(){if(!c)return;
337
- let{targetId:o,mode:d,fields:m,line:l}=c;if(d==="interactive"){(m.has("typical")||m.has("high"))&&O(t,"Interactive outpu\
338
- ts require separate Startup and Running estimates.",l),i.outputs.push({targetId:o,mode:d,startup:pe(m,"startupTypical","\
339
- startupHigh",t,l),running:pe(m,"runningTypical","runningHigh",t,l)});return}(m.size!==2||!m.has("typical")||!m.has("high"))&&
340
- O(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",l);let f=pe(m,"typical","high",t,l);o?i.
341
- outputs.push({targetId:o,mode:d,execution:f}):i.workspaceSetup=f}for(let o=0;o<e.length;o+=1){let d=e[o].trim(),m=o+1;if(!d)
342
- continue;let l=d.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(l||d==="### Workspace setup"){u();let C=l?.[1]||
343
- "",he=C?`output:${C}`:"workspace-setup";a.has(he)&&O(t,"Resource estimates contains a duplicate operation.",m),a.add(he);
344
- let fe=s.get(C);C&&!["interactive","finite"].includes(fe?.mode)&&O(t,`Resource estimate references an undeclared output:\
345
- ${C}.`,m),!C&&!r&&O(t,"Resource estimate references undeclared Workspace setup steps.",m),c={targetId:C,mode:fe?.mode||
346
- "setup",fields:new Map,line:m};continue}let f=d.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),Q=f&&nn.get(f[1]);(!c||!Q)&&
347
- O(t,"Expected an Output or Workspace setup heading followed by positive integer MiB estimates.",m),c.fields.has(Q)&&O(t,
348
- `Duplicate resource field: ${f[1]}.`,m);let Z=Number(f[2]);(!Number.isSafeInteger(Z)||Z>$e)&&O(t,`Resource estimates mus\
349
- t be between 1 and ${$e} MiB.`,m),c.fields.set(Q,Z*tn)}return u(),a.size===0&&O(t,"Resource estimates needs an operation\
350
- or exactly `- Nothing.`."),i}function J({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){j(e,t,"Resour\
351
- ce estimates and Outputs"),j(e,n,"Resource estimates and Workspace setup");let r=[...e.diagnostics||[]],i={version:1,outputs:[],
352
- workspaceSetup:null};if(e.status==="ready"&&r.length===0)try{i=We(e.lines,{targets:t.status==="ready"?K(t.lines).targets:
353
- [],hasWorkspaceSetup:n.status==="ready"&&F(n.lines).length>0})}catch(a){if(a?.name!=="Vibe64StackOperationError")throw a;
354
- r.push({code:Be,message:a.message,details:{...a.details,causeCode:a.code}})}let s=r.length>0?"invalid":i.outputs.length>
355
- 0||i.workspaceSetup?"ready":"unconfigured";return{contract:Me,status:s,stackHash:e.stackHash,sectionHash:e.sectionHash||
356
- "",estimatesHash:s==="ready"?A(i):"",source:e.source||null,outputs:i.outputs,workspaceSetup:i.workspaceSetup,fallbackReason:s===
357
- "invalid"?"invalid-estimates":s==="unconfigured"?"not-declared":null,diagnostics:r}}var Ge="vibe64.integration-setup.v1",Le="Integration setup",U="VIBE64_INTEGRATION_SETUP_INVALID";function Ue(e,{path:t="\
358
- genesis/stack.md#Integration setup"}={}){if(Array.isArray(e)||h(U,t,"Integration setup requires exact Stack section line\
359
- s."),T(e))return null;let n=e.map(i=>i.trim()).filter(Boolean),r=n.length===1&&n[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);
360
- return r||h(U,t,"Integration setup requires exactly one entry: - Command with `runtime` in `workdir`: `command` `argumen\
361
- t`...; or - Nothing."),{argv:k(r[3],U,t,"Integration setup command"),workdir:I(r[2],U,t,"Integration setup workdir"),runtimeRequirements:R(
362
- r[1],U,t,"Integration setup runtimes")}}function He({section:e={}}={}){let t=[...e.diagnostics||[]],n=e.status==="ready"&&
363
- t.length===0?Ue(e.lines):null;return{contract:Ge,status:t.length?"blocked":n?"ready":"unconfigured",stackHash:e.stackHash,
364
- recipeHash:n?A({version:1,command:n}):"",source:e.source||null,components:[...e.components||[]],command:n,diagnostics:t}}var rn=new URL("./index.js",import.meta.url).href,ze=on(rn),X=new Map;async function an(e){if(!D.isAbsolute(e||""))throw new TypeError(
365
- "Genesis host context requires an absolute runtime root.");let t=D.join(e,"genesis-context");if(!X.has(t)){let n=be(t).catch(
366
- r=>{throw X.delete(t),r});X.set(t,n)}return X.get(t)}async function Tr(e){let t=await an(e);return{[un]:jn(),[cn]:JSON.stringify(
367
- {registryPath:t.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var{GENESIS_CONTRACTS:S,HOST_CONTEXT_RESOLVER_DATA_ENV:cn,
368
- HOST_CONTEXT_RESOLVER_ENV:un,addStack:pn,applyTemplate:ln,generatePrompt:le,indexCodebase:dn,initialize:mn,inspectCollaboration:hn,
369
- inspectDerivedArtifacts:fn,inspectEngineering:gn,inspectEnvironment:me,inspectProject:Ke,inspectAgentIntegrations:wn,inspectSkills:yn,
370
- inspectStackSection:bn,inspectSubsystems:vn,listTemplates:En,parserEnvironment:Sn,setCollaboration:In,setEngineeringProfile:Tn,
371
- syncAgentIntegrations:kn,syncSkills:Rn,withTrustedGitRepository:On}=de,kr="genesis/blueprint.md",_n=!1,An=Object.freeze(
372
- ["vue",..._n?[]:["jskit-postgresql","postgresql"]]),Nn=Object.freeze(["genesis-stack"]),Dn=new Set(["adopt","blueprint",
373
- "describe","deslop","program","review","start","work"]);function B(e=""){return String(e||"").trim()}function Fe(e,{required:t=!1}={}){
374
- let n=B(e);if(!n&&!t)return"";if(!Dn.has(n))throw new TypeError(n?`Unknown Genesis prompt task: ${n}.`:"Genesis prompt a\
375
- ctions require an explicit task.");return n}function xn(e={}){return Fe(e.genesisTask)||"work"}function Cn(e={},t={}){return[
376
- e.conversationRequest,e.feedback,e.request,e.plan,e.description,t.label].map(B).find(Boolean)||"Continue the requested p\
377
- roject work."}function Rr(e={}){return Sn(e)}function Vn(){let e=(ze.resolve.paths("genesis-compiler")||[]).find(t=>qe(D.
378
- join(t,"genesis-compiler"))&&qe(D.join(t,".bin","genesis")));if(!e)throw new Error("The installed Genesis compiler execu\
379
- table could not be located.");return D.join(e,".bin")}function Ye(){let e=ze.resolve("@local/vibe64-genesis/server");return D.
380
- resolve(D.dirname(e),"../../bin")}function jn(){return D.resolve(Ye(),"vibe64-genesis-host-context")}function Or(e=[]){let t=Ye(),
381
- n=Vn();return[...(Array.isArray(e)?e:[]).filter(i=>![t,n].includes(B(i))),t]}function Pn(e={},{prompt:t=!1}={}){return{...e,
382
- ...t?{hiddenStackPieces:An}:{},stackPackages:Nn}}function _r(e={}){return y(pn,e)}function Ar(e={}){return y(mn,e)}function Nr(e={}){
383
- return y(yn,e)}function Dr(e={}){return y(Rn,e)}function xr(e={}){return y(kn,e)}function Cr(e={}){return y(wn,e)}function Vr(e={}){
384
- return y(vn,e)}function jr(e={}){return y(dn,e)}function $n(){let e=fn();if(e?.contract!==S.derivedArtifacts)throw new Error(
385
- `Genesis returned ${e?.contract||"no contract identity"}; expected ${S.derivedArtifacts}.`);let t=Array.isArray(e.artifacts)?
386
- e.artifacts:[];if(!t.length||t.some(n=>!B(n?.path)))throw new Error("Genesis returned an invalid derived-artifact contra\
387
- ct.");return{...e,artifacts:t.map(n=>({...n}))}}var Je=$n(),Pr=Object.freeze(Je.artifacts.map(e=>e.path)),Xe=new Map(Je.
388
- artifacts.map(e=>[e.id,e])),Mn=Xe.get("machine-city")?.path,Bn=Xe.get("program-city")?.path;if(!Mn||!Bn)throw new Error(
389
- "Genesis did not declare both City projection artifacts.");async function y(e,t={},n={}){let r=B(t.projectRoot);if(!r||!D.
390
- isAbsolute(r))throw new TypeError("Genesis operations require an explicit absolute projectRoot.");return On(r,()=>e(Pn(t,
391
- n)))}async function $r({workdir:e,promptContext:t}){let n=W(t);return t.scope==="ephemeral"?n:(await y(de.projectSessionContext,
392
- {projectRoot:e,hostDriver:W,hostDriverInput:t})).output}async function _(e,t,n={}){let r=await y(e,n);if(r?.contract!==t)
393
- throw new Error(`Genesis returned ${r?.contract||"no contract identity"}; expected ${t}.`);return r}function E(e,t={}){return _(
394
- n=>bn({...n,name:e}),S.stackSection,t)}async function Mr(e={}){if((await Wn(e)).status!=="current")throw Object.assign(new Error(
395
- "The project needs a current Genesis format before its Stack can be inspected."),{code:"vibe64_stack_format_required"});
396
- await sn(D.join(e.projectRoot,"genesis/stack.md"),"utf8");let n=await E(L,e);return{components:n.components,stackHash:n.
397
- stackHash}}async function Br(e={}){let[t,n]=await Promise.all([E(Se,e),_(me,S.environment,e)]);return ke({environment:n,
398
- section:t})}function Wr(e={}){return _(me,S.environment,e)}function Gr(e={}){return _(Ke,S.projectInspection,e)}function Lr(e={}){
399
- return _(En,S.templates,e)}function Ur(e={}){return _(ln,S.templateApplication,e)}function Hr(e={}){return _(gn,S.engineering,
400
- e)}function qr(e={}){return _(hn,S.collaboration,e)}async function Wn(e={}){let t=await y(Ke,e);if(!B(t?.projectFormat?.
401
- status))throw new Error("Genesis did not return a project-format status.");return{...t.projectFormat}}function zr(e={}){
402
- return _(Tn,S.engineering,e)}function Kr(e={}){return _(In,S.collaboration,e)}async function Fr(e={}){let[t,n,r,i]=await Promise.
403
- all([E(z,e),_(me,S.environment,e),E(Y,e),E(L,e)]);return{...Ne({environment:n,section:t}),resourceEstimates:J({section:r,
404
- outputsSection:t,workspaceSetupSection:i})}}async function Yr(e={}){let t=await E(Le,e);return He({section:t})}async function Jr(e={}){
405
- return Ce(await E(De,e))}async function Xr(e={}){let[t,n,r]=await Promise.all([E(L,e),E(Y,e),E(z,e)]);return{...await Pe(
406
- {projectRoot:e.projectRoot,section:t}),resourceEstimates:J({section:n,outputsSection:r,workspaceSetupSection:t})}}async function Qr(e={}){
407
- let[t,n,r]=await Promise.all([E(Y,e),E(z,e),E(L,e)]);return J({section:t,outputsSection:n,workspaceSetupSection:r})}async function Zr({
408
- action:e={},environment:t=process.env,input:n={},projectRoot:r}={}){let i=xn(e),s=Cn(n,e),a=i,c;try{c=await y(le,{environment:t,
409
- projectRoot:r,request:s,sessionContextInstalled:!0,task:a},{prompt:!0})}catch(o){if(o?.code==="BLUEPRINT_INVALID"&&i!=="\
410
- blueprint")a="blueprint",c=await y(le,{environment:t,projectRoot:r,request:s,sessionContextInstalled:!0,task:a},{prompt:!0});else if(o?.
411
- code==="BLUEPRINT_REQUIRED"&&i!=="start")a="start",c=await y(le,{environment:t,projectRoot:r,request:s,sessionContextInstalled:!0,
412
- task:a},{prompt:!0});else throw o}let u=Fe(c.task)||a;return{context:{genesis:!0,requestedTask:i,task:u,verificationCommands:c.
413
- verificationCommands,warnings:c.warnings},originalPrompt:s,prompt:c.prompt,promptId:B(e.promptId||e.id)||u}}export{kr as GENESIS_BLUEPRINT_PATH,Pr as GENESIS_DERIVED_ARTIFACT_PATHS,Mn as GENESIS_MACHINE_CITY_PATH,Bn as GENESIS_PROGRAM_CITY_PATH,
414
- cn as HOST_CONTEXT_RESOLVER_DATA_ENV,un as HOST_CONTEXT_RESOLVER_ENV,Ee as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,Se as VIBE64_APPLICATION_DEPLOYMENT_SECTION,
415
- Ge as VIBE64_INTEGRATION_SETUP_CONTRACT,Le as VIBE64_INTEGRATION_SETUP_SECTION,_e as VIBE64_OUTPUTS_CONTRACT,z as VIBE64_OUTPUTS_SECTION,
416
- oe as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,Me as VIBE64_RESOURCE_ESTIMATES_CONTRACT,Y as VIBE64_RESOURCE_ESTIMATES_SECTION,
417
- je as VIBE64_WORKSPACE_SETUP_CONTRACT,L as VIBE64_WORKSPACE_SETUP_SECTION,_r as addGenesisStack,Ur as applyGenesisTemplate,
418
- Fe as assertGenesisPromptTask,Ye as genesisCommandShimDirectory,Vn as genesisPackageBinDirectory,Rr as genesisParserEnvironment,
419
- Cn as genesisPromptRequest,xn as genesisPromptTask,Ar as initializeGenesisProject,Cr as inspectGenesisAgentIntegrations,
420
- qr as inspectGenesisCollaboration,$n as inspectGenesisDerivedArtifacts,Hr as inspectGenesisEngineering,Wr as inspectGenesisEnvironment,
421
- Gr as inspectGenesisProject,Wn as inspectGenesisProjectFormat,Nr as inspectGenesisSkills,Mr as inspectGenesisStackComponents,
422
- E as inspectGenesisStackSection,Vr as inspectGenesisSubsystems,Br as inspectVibe64Deployment,Yr as inspectVibe64IntegrationSetup,
423
- Fr as inspectVibe64Outputs,Jr as inspectVibe64ProjectServices,Qr as inspectVibe64ResourceEstimates,Xr as inspectVibe64WorkspaceSetup,
424
- Lr as listGenesisTemplates,Te as parseVibe64DeploymentLines,Ue as parseVibe64IntegrationSetupLines,K as parseVibe64OutputsLines,
425
- xe as parseVibe64ProjectServicesLines,We as parseVibe64ResourceEstimatesLines,F as parseVibe64WorkspaceSetupLines,jr as refreshGenesisCities,
426
- Zr as renderGenesisPrompt,Vt as resolveVibe64OutputParameters,Kr as setGenesisCollaboration,zr as setGenesisEngineeringProfile,
427
- xr as syncGenesisAgentIntegrations,Dr as syncGenesisSkills,$r as vibe64ConversationInstructions,W as vibe64Driver,Tr as vibe64HostContextEnvironment,
428
- an as vibe64HostContextRegistry,jn as vibe64HostContextResolverPath,Or as withGenesisCommandShim};
371
+ runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,downloads:r,...c.length?{parameters:c}:
372
+ {},...e.previewIdentity?{previewIdentity:Sn(e.previewIdentity,t,e.id)}:{}}}function se(e,{path:t="genesis/stack.md#Outpu\
373
+ ts"}={}){if(Array.isArray(e)||f(t,"Outputs must be supplied as exact Stack section lines."),b(e))return{version:1,targets:[]};
374
+ let n=[],s=null,r="target",i=null;for(let c=0;c<e.length;c+=1){let u=e[c].trim();if(!u)continue;let a=c+1,m=u.match(Jt);
375
+ if(m){s&&n.push(Ke(s,t)),s=cn(m,t,a),r="target",i=null;continue}s||f(t,"## Outputs must begin with a Target heading.",a);
376
+ let l=u.match(Xt);if(l){let h={id:ge(l[1],t,"Parameter id",a),label:O(l[2],w,t,"Parameter label",a),default:"",description:"",
377
+ required:!1,seen:new Set};s.parameters.push(h),r="parameter",i=h;continue}if(u==="#### Presentation"){s.presentation&&f(
378
+ t,"Presentation must appear at most once below an output target.",a),s.presentation=ln(a),r="presentation",i=s.presentation;
379
+ continue}if(u==="#### Preview identity"){s.previewIdentity&&f(t,"Preview identity must appear at most once below an outp\
380
+ ut target.",a),s.previewIdentity=En(a),r="previewIdentity",i=s.previewIdentity;continue}let d=u.match(Qt);if(d){let h=dn(
381
+ d,t,a);s.downloads.push(h),r="download",i=h;continue}r==="parameter"?un(i,u,t,a):r==="presentation"?hn(i,u,t,a):r==="pre\
382
+ viewIdentity"?vn(i,u,t,a):r==="download"?bn(i,u,t,a):fn(s,u,t,a)}s&&n.push(Ke(s,t)),n.length===0&&f(t,"## Outputs needs \
383
+ at least one Target or exactly `- Nothing.`.");let o=n.map(({id:c})=>c);return new Set(o).size!==o.length&&f(t,"Outputs \
384
+ contains a duplicate target id."),n.filter(({default:c})=>c).length>1&&f(t,"Outputs may declare at most one default targ\
385
+ et."),{version:1,targets:n}}function Je({environment:e={},section:t={}}={}){G(t,e,"Outputs section");let n=[...t.diagnostics||
386
+ []],s=[...e.diagnostics||[]],r={version:1,targets:[]};t.status==="ready"&&(r=se(t.lines));let i=s.length===0?null:s.map(
387
+ ({message:a})=>a).join(" "),o=r.targets.map(a=>({...a,source:t.source||null,available:n.length===0&&s.length===0,disabledReason:i})),
388
+ c=[...n,...s],u="ready";return c.length>0?u="blocked":o.length===0&&(u="unconfigured"),{contract:Fe,status:u,stackHash:t.
389
+ stackHash,components:[...t.components||[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:B(
390
+ o.flatMap(a=>a.runtimeRequirements)),resources:structuredClone(e.resources||[]),targets:o,diagnostics:c}}var Xe="Project services",In="vibe64.project-services.v1",L="VIBE64_PROJECT_SERVICES_INVALID",U="genesis/stack.md#Projec\
391
+ t services";function Qe(e){if(Array.isArray(e)||p(L,U,"Expected exact Project services section lines."),b(e))return[];let t=[];
392
+ for(let[n,s]of e.entries()){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);
393
+ o||p(L,U,"Use: - Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...",i),t.some(({id:u})=>u===
394
+ o[1])&&p(L,U,"Duplicate project service id.",i);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);t.push({id:o[1],...o[2]?{scope:"\
395
+ session"}:{},runtimeRequirements:R(c?c[1]:o[3],L,U,"Service runtimes",i),workdir:g(c?.[2]||".",L,U,"Service workdir",i),
396
+ argv:_(o[4],L,U,"Service command",i)})}return t.length||p(L,U,"Declare a service or exactly `- Nothing.`."),t}function Ze(e={}){
397
+ let t=e.status==="ready"?Qe(e.lines):[];return{contract:In,status:e.status==="blocked"?"blocked":t.length?"ready":"uncon\
398
+ figured",services:t,recipeHash:t.length?T(t):"",diagnostics:e.diagnostics||[]}}var tt="vibe64.resource-estimates.v1",re="Resource estimates",nt="VIBE64_RESOURCE_ESTIMATES_INVALID",kn=1024*1024,et=1024*
399
+ 1024,On=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
400
+ ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function x(e,t,n){p(nt,
401
+ e,t,n)}function ye(e,t,n,s,r){let i=e.get(t),o=e.get(n);return(i===void 0||o===void 0||i>o)&&x(s,"Each resource phase re\
402
+ quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function st(e,{path:t="\
403
+ genesis/stack.md#Resource estimates",targets:n=[],hasWorkspaceSetup:s=!1}={}){(!Array.isArray(e)||e.length>2048||e.some(
404
+ a=>typeof a!="string")||Buffer.byteLength(e.join(`
405
+ `),"utf8")>64*1024)&&x(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let r={version:1,
406
+ outputs:[],workspaceSetup:null};if(b(e))return r;let i=new Map(n.map(a=>[a.id,a])),o=new Set,c=null;function u(){if(!c)return;
407
+ let{targetId:a,mode:m,fields:l,line:d}=c;if(m==="interactive"){(l.has("typical")||l.has("high"))&&x(t,"Interactive outpu\
408
+ ts require separate Startup and Running estimates.",d),r.outputs.push({targetId:a,mode:m,startup:ye(l,"startupTypical","\
409
+ startupHigh",t,d),running:ye(l,"runningTypical","runningHigh",t,d)});return}(l.size!==2||!l.has("typical")||!l.has("high"))&&
410
+ x(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",d);let h=ye(l,"typical","high",t,d);a?r.
411
+ outputs.push({targetId:a,mode:m,execution:h}):r.workspaceSetup=h}for(let a=0;a<e.length;a+=1){let m=e[a].trim(),l=a+1;if(!m)
412
+ continue;let d=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(d||m==="### Workspace setup"){u();let k=d?.[1]||
413
+ "",J=k?`output:${k}`:"workspace-setup";o.has(J)&&x(t,"Resource estimates contains a duplicate operation.",l),o.add(J);let z=i.
414
+ get(k);k&&!["interactive","finite"].includes(z?.mode)&&x(t,`Resource estimate references an undeclared output: ${k}.`,l),
415
+ !k&&!s&&x(t,"Resource estimate references undeclared Workspace setup steps.",l),c={targetId:k,mode:z?.mode||"setup",fields:new Map,
416
+ line:l};continue}let h=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),y=h&&On.get(h[1]);(!c||!y)&&x(t,"Expected an Output\
417
+ or Workspace setup heading followed by positive integer MiB estimates.",l),c.fields.has(y)&&x(t,`Duplicate resource fie\
418
+ ld: ${h[1]}.`,l);let q=Number(h[2]);(!Number.isSafeInteger(q)||q>et)&&x(t,`Resource estimates must be between 1 and ${et}\
419
+ MiB.`,l),c.fields.set(y,q*kn)}return u(),o.size===0&&x(t,"Resource estimates needs an operation or exactly `- Nothing.`\
420
+ ."),r}function ie({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){G(e,t,"Resource estimates and Output\
421
+ s"),G(e,n,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={version:1,outputs:[],workspaceSetup:null};
422
+ if(e.status==="ready"&&s.length===0)try{r=st(e.lines,{targets:t.status==="ready"?se(t.lines).targets:[],hasWorkspaceSetup:n.
423
+ status==="ready"&&F(n.lines).length>0})}catch(o){if(o?.name!=="Vibe64StackOperationError")throw o;s.push({code:nt,message:o.
424
+ message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"invalid":r.outputs.length>0||r.workspaceSetup?"ready":
425
+ "unconfigured";return{contract:tt,status:i,stackHash:e.stackHash,sectionHash:e.sectionHash||"",estimatesHash:i==="ready"?
426
+ T(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,fallbackReason:i==="invalid"?"invalid-es\
427
+ timates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var rt="vibe64.integration-setup.v1",it="Integration setup",Q="VIBE64_INTEGRATION_SETUP_INVALID";function ot(e,{path:t="\
428
+ genesis/stack.md#Integration setup"}={}){if(Array.isArray(e)||p(Q,t,"Integration setup requires exact Stack section line\
429
+ s."),b(e))return null;let n=e.map(r=>r.trim()).filter(Boolean),s=n.length===1&&n[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);
430
+ return s||p(Q,t,"Integration setup requires exactly one entry: - Command with `runtime` in `workdir`: `command` `argumen\
431
+ t`...; or - Nothing."),{argv:_(s[3],Q,t,"Integration setup command"),workdir:g(s[2],Q,t,"Integration setup workdir"),runtimeRequirements:R(
432
+ s[1],Q,t,"Integration setup runtimes")}}function at({section:e={}}={}){let t=[...e.diagnostics||[]],n=e.status==="ready"&&
433
+ t.length===0?ot(e.lines):null;return{contract:rt,status:t.length?"blocked":n?"ready":"unconfigured",stackHash:e.stackHash,
434
+ recipeHash:n?T({version:1,command:n}):"",source:e.source||null,components:[...e.components||[]],command:n,diagnostics:t}}var _n=new URL("./index.js",import.meta.url).href,ut=An(_n),oe=new Map;async function Cn(e){if(!j.isAbsolute(e||""))throw new TypeError(
435
+ "Genesis host context requires an absolute runtime root.");let t=j.join(e,"genesis-context");if(!oe.has(t)){let n=$e(t).
436
+ catch(s=>{throw oe.delete(t),s});oe.set(t,n)}return oe.get(t)}async function pr(e){let t=await Cn(e);return{[Dn]:as(),[Nn]:JSON.
437
+ stringify({registryPath:t.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var{GENESIS_CONTRACTS:I,HOST_CONTEXT_RESOLVER_DATA_ENV:Nn,
438
+ HOST_CONTEXT_RESOLVER_ENV:Dn,addStack:xn,applyTemplate:Vn,generatePrompt:be,indexCodebase:Pn,initialize:jn,inspectCollaboration:Bn,
439
+ inspectDerivedArtifacts:Mn,inspectEngineering:$n,inspectEnvironment:Ee,inspectProject:Gn,inspectProjectFormat:Ln,inspectAgentIntegrations:Un,
440
+ inspectSkills:Wn,inspectStackSection:Hn,inspectStackSections:qn,inspectSubsystems:zn,listTemplates:Kn,parserEnvironment:Fn,
441
+ setCollaboration:Yn,setEngineeringProfile:Jn,syncAgentIntegrations:Xn,syncSkills:Qn,withTrustedGitRepository:Zn,SOURCE_EXPLANATION_PROMPT_VERSION:lr,
442
+ sourceExplanationGuidance:dr,sourceExplanationReviewGuidance:mr,validateArchitectureFacts:fr,validateArchitectureObservations:hr,
443
+ mergeArchitectureObservations:gr}=we,yr="genesis/blueprint.md",es=!1,ts=Object.freeze(["vue",...es?[]:["jskit-postgresql",
444
+ "postgresql"]]),ns=Object.freeze(["genesis-stack"]),ss=new Set(["adopt","blueprint","describe","deslop","program","revie\
445
+ w","start","work"]);function W(e=""){return String(e||"").trim()}function pt(e,{required:t=!1}={}){let n=W(e);if(!n&&!t)
446
+ return"";if(!ss.has(n))throw new TypeError(n?`Unknown Genesis prompt task: ${n}.`:"Genesis prompt actions require an exp\
447
+ licit task.");return n}function rs(e={}){return pt(e.genesisTask)||"work"}function is(e={},t={}){return[e.conversationRequest,
448
+ e.feedback,e.request,e.plan,e.description,t.label].map(W).find(Boolean)||"Continue the requested project work."}function br(e={}){
449
+ return Fn(e)}function os(){let e=(ut.resolve.paths("genesis-compiler")||[]).find(t=>ct(j.join(t,"genesis-compiler"))&&ct(
450
+ j.join(t,".bin","genesis")));if(!e)throw new Error("The installed Genesis compiler executable could not be located.");return j.
451
+ join(e,".bin")}function lt(){let e=ut.resolve("@local/vibe64-genesis/server");return j.resolve(j.dirname(e),"../../bin")}
452
+ function as(){return j.resolve(lt(),"vibe64-genesis-host-context")}function wr(e=[]){let t=lt(),n=os();return[...(Array.
453
+ isArray(e)?e:[]).filter(r=>![t,n].includes(W(r))),t]}function cs(e={},{prompt:t=!1}={}){return{...e,...t?{hiddenStackPieces:ts}:
454
+ {},stackPackages:ns}}function Er(e={}){return S(xn,e)}function vr(e={}){return S(jn,e)}function Sr(e={}){return S(Wn,e)}
455
+ function Tr(e={}){return S(Qn,e)}function Ir(e={}){return S(Xn,e)}function kr(e={}){return S(Un,e)}function Or(e={}){return S(
456
+ zn,e)}async function _r(e={}){return Ne(await H(Ce,e))}async function Rr(e={}){return xe(await H(De,e))}function Ar(e={}){
457
+ return S(Pn,e)}function us(){let e=Mn();if(e?.contract!==I.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||
458
+ "no contract identity"}; expected ${I.derivedArtifacts}.`);let t=Array.isArray(e.artifacts)?e.artifacts:[];if(!t.length||
459
+ t.some(n=>!W(n?.path)))throw new Error("Genesis returned an invalid derived-artifact contract.");return{...e,artifacts:t.
460
+ map(n=>({...n}))}}var dt=us(),Cr=Object.freeze(dt.artifacts.map(e=>e.path)),mt=new Map(dt.artifacts.map(e=>[e.id,e])),ps=mt.
461
+ get("machine-city")?.path,ls=mt.get("program-city")?.path;if(!ps||!ls)throw new Error("Genesis did not declare both City\
462
+ projection artifacts.");async function S(e,t={},n={}){let s=W(t.projectRoot);if(!s||!j.isAbsolute(s))throw new TypeError(
463
+ "Genesis operations require an explicit absolute projectRoot.");return Zn(s,()=>e(cs(t,n)))}async function Nr({workdir:e,
464
+ promptContext:t}){let n=Y(t);return t.scope==="ephemeral"?n:(await S(we.projectSessionContext,{projectRoot:e,hostDriver:Y,
465
+ hostDriverInput:t})).output}async function V(e,t,n={}){let s=await S(e,n);if(s?.contract!==t)throw new Error(`Genesis re\
466
+ turned ${s?.contract||"no contract identity"}; expected ${t}.`);return s}function H(e,t={}){return V(n=>Hn({...n,name:e}),
467
+ I.stackSection,t)}async function ve(e,t={}){let n=await S(s=>qn({...s,names:e}),t);if(!Array.isArray(n)||n.length!==e.length||
468
+ n.some((s,r)=>s?.contract!==I.stackSection||s.name!==e[r]))throw new Error("Genesis returned an invalid Stack section in\
469
+ spection batch.");return n}async function Dr(e={}){if((await ds(e)).status!=="current")throw Object.assign(new Error("Th\
470
+ e project needs a current Genesis format before its Stack can be inspected."),{code:"vibe64_stack_format_required"});await Rn(
471
+ j.join(e.projectRoot,"genesis/stack.md"),"utf8");let n=await H(X,e);return{components:n.components,stackHash:n.stackHash}}
472
+ async function xr(e={}){let[t,n]=await Promise.all([H(Ue,e),V(Ee,I.environment,e)]);return qe({environment:n,section:t})}
473
+ function Vr(e={}){return V(Ee,I.environment,e)}function Pr(e={}){return V(Gn,I.projectInspection,e)}function jr(e={}){return V(
474
+ Kn,I.templates,e)}function Br(e={}){return V(Vn,I.templateApplication,e)}function Mr(e={}){return V($n,I.engineering,e)}
475
+ function $r(e={}){return V(Bn,I.collaboration,e)}async function ds(e={}){let t=await S(Ln,e);if(!W(t?.status))throw new Error(
476
+ "Genesis did not return a project-format status.");return{...t}}function Gr(e={}){return V(Jn,I.engineering,e)}function Lr(e={}){
477
+ return V(Yn,I.collaboration,e)}async function Ur(e={}){let[[t,n,s],r]=await Promise.all([ve([ne,re,X],e),V(Ee,I.environment,
478
+ e)]);return{...Je({environment:r,section:t}),resourceEstimates:ie({section:n,outputsSection:t,workspaceSetupSection:s})}}
479
+ async function Wr(e={}){let t=await H(it,e);return at({section:t})}async function Hr(e={}){return Ae(await H(Re,e))}async function qr(e={}){
480
+ return Ze(await H(Xe,e))}async function zr(e={}){let[t,n,s]=await ve([X,re,ne],e);return{...await Ie({projectRoot:e.projectRoot,
481
+ section:t}),resourceEstimates:ie({section:n,outputsSection:s,workspaceSetupSection:t})}}async function Kr(e={}){let[t,n,
482
+ s]=await ve([re,ne,X],e);return ie({section:t,outputsSection:n,workspaceSetupSection:s})}async function Fr({action:e={},
483
+ environment:t=process.env,input:n={},projectRoot:s}={}){let r=rs(e),i=is(n,e),o=r,c;try{c=await S(be,{environment:t,projectRoot:s,
484
+ request:i,sessionContextInstalled:!0,task:o},{prompt:!0})}catch(a){if(a?.code==="BLUEPRINT_INVALID"&&r!=="blueprint")o="\
485
+ blueprint",c=await S(be,{environment:t,projectRoot:s,request:i,sessionContextInstalled:!0,task:o},{prompt:!0});else if(a?.
486
+ code==="BLUEPRINT_REQUIRED"&&r!=="start")o="start",c=await S(be,{environment:t,projectRoot:s,request:i,sessionContextInstalled:!0,
487
+ task:o},{prompt:!0});else throw a}let u=pt(c.task)||o;return{context:{genesis:!0,requestedTask:r,task:u,verificationCommands:c.
488
+ verificationCommands,warnings:c.warnings},originalPrompt:i,prompt:c.prompt,promptId:W(e.promptId||e.id)||u}}export{yr as GENESIS_BLUEPRINT_PATH,Cr as GENESIS_DERIVED_ARTIFACT_PATHS,ps as GENESIS_MACHINE_CITY_PATH,ls as GENESIS_PROGRAM_CITY_PATH,
489
+ Ve as GENESIS_STACK_CONTRACTS_INCOMPLETE,Pe as GENESIS_STACK_SECTION_AMBIGUOUS,Nn as HOST_CONTEXT_RESOLVER_DATA_ENV,Dn as HOST_CONTEXT_RESOLVER_ENV,
490
+ lr as SOURCE_EXPLANATION_PROMPT_VERSION,Le as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,Ue as VIBE64_APPLICATION_DEPLOYMENT_SECTION,
491
+ rt as VIBE64_INTEGRATION_SETUP_CONTRACT,it as VIBE64_INTEGRATION_SETUP_SECTION,Fe as VIBE64_OUTPUTS_CONTRACT,ne as VIBE64_OUTPUTS_SECTION,
492
+ fe as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,tt as VIBE64_RESOURCE_ESTIMATES_CONTRACT,re as VIBE64_RESOURCE_ESTIMATES_SECTION,
493
+ Te as VIBE64_WORKSPACE_SETUP_CONTRACT,X as VIBE64_WORKSPACE_SETUP_SECTION,Er as addGenesisStack,Br as applyGenesisTemplate,
494
+ pt as assertGenesisPromptTask,lt as genesisCommandShimDirectory,os as genesisPackageBinDirectory,br as genesisParserEnvironment,
495
+ Ct as genesisProjectContractNeedsAttention,is as genesisPromptRequest,rs as genesisPromptTask,vr as initializeGenesisProject,
496
+ kr as inspectGenesisAgentIntegrations,$r as inspectGenesisCollaboration,us as inspectGenesisDerivedArtifacts,Mr as inspectGenesisEngineering,
497
+ Vr as inspectGenesisEnvironment,Pr as inspectGenesisProject,ds as inspectGenesisProjectFormat,Sr as inspectGenesisSkills,
498
+ Dr as inspectGenesisStackComponents,H as inspectGenesisStackSection,Or as inspectGenesisSubsystems,_r as inspectVibe64ArchitectureInspection,
499
+ Rr as inspectVibe64ArchitectureLayout,Hr as inspectVibe64ConnectedDevelopment,xr as inspectVibe64Deployment,Wr as inspectVibe64IntegrationSetup,
500
+ Ur as inspectVibe64Outputs,qr as inspectVibe64ProjectServices,Kr as inspectVibe64ResourceEstimates,zr as inspectVibe64WorkspaceSetup,
501
+ jr as listGenesisTemplates,gr as mergeArchitectureObservations,He as parseVibe64DeploymentLines,ot as parseVibe64IntegrationSetupLines,
502
+ se as parseVibe64OutputsLines,Qe as parseVibe64ProjectServicesLines,st as parseVibe64ResourceEstimatesLines,F as parseVibe64WorkspaceSetupLines,
503
+ Ar as refreshGenesisCities,Fr as renderGenesisPrompt,pn as resolveVibe64OutputParameters,Lr as setGenesisCollaboration,Gr as setGenesisEngineeringProfile,
504
+ dr as sourceExplanationGuidance,mr as sourceExplanationReviewGuidance,Ir as syncGenesisAgentIntegrations,Tr as syncGenesisSkills,
505
+ fr as validateArchitectureFacts,hr as validateArchitectureObservations,Nr as vibe64ConversationInstructions,Y as vibe64Driver,
506
+ pr as vibe64HostContextEnvironment,Cn as vibe64HostContextRegistry,as as vibe64HostContextResolverPath,wr as withGenesisCommandShim};