vibe64 0.1.59 → 0.1.61

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 (204) hide show
  1. package/bin/run.js +1228 -1210
  2. package/bin/server.js +392 -376
  3. package/bin/upgrade-state.js +4457 -4430
  4. package/dist/assets/{GithubBrowserTabs-D_nMB5Y1.js → GithubBrowserTabs-DAgQxPXI.js} +1 -1
  5. package/dist/assets/{LocalDatabaseServer-BgO_aeUg.js → LocalDatabaseServer-m1G8ZS5i.js} +1 -1
  6. package/dist/assets/SelectField-DwWoHC2p.js +1 -0
  7. package/dist/assets/{ShellOutlet-Cr8SJs7s.js → ShellOutlet-CdjsJfg9.js} +1 -1
  8. package/dist/assets/Vibe64AuthSettingsButton-D3sB4BfM.js +5 -0
  9. package/dist/assets/{Vibe64AuthSettingsButton-DRTKdimW.css → Vibe64AuthSettingsButton-DFfFPrd7.css} +1 -1
  10. package/dist/assets/{Vibe64ConversationLog-DtOgxPNR.js → Vibe64ConversationLog-B-L5QsVr.js} +4 -4
  11. package/dist/assets/{Vibe64ConversationLog-NH61odld.css → Vibe64ConversationLog-ksf1U6PP.css} +1 -1
  12. package/dist/assets/{Vibe64DashboardShell-DhPE6H3P.js → Vibe64DashboardShell-CMzX3wRM.js} +1 -1
  13. package/dist/assets/{Vibe64DashboardShell-Bpnbjs4l.css → Vibe64DashboardShell-D0GNI4V8.css} +1 -1
  14. package/dist/assets/{Vibe64DatabaseWorkspace-cfn8TTxQ.css → Vibe64DatabaseWorkspace-De4sbXAN.css} +1 -1
  15. package/dist/assets/{Vibe64DatabaseWorkspace-CHV0cd3l.js → Vibe64DatabaseWorkspace-Dewhs6_T.js} +2 -2
  16. package/dist/assets/Vibe64DestinationButton-CdyyK9tj.js +1 -0
  17. package/dist/assets/Vibe64DestinationButton-ZxY1Lwie.css +1 -0
  18. package/dist/assets/Vibe64FileArea-DluZTu-c.js +1 -0
  19. package/dist/assets/{Vibe64FileArea-mydNQQl8.css → Vibe64FileArea-ZEzsvLt2.css} +1 -1
  20. package/dist/assets/Vibe64OutputControls-BfbdD25Y.js +8 -0
  21. package/dist/assets/{Vibe64RepositoryWorkspace-DUSMn4pR.js → Vibe64RepositoryWorkspace-CBsySPXN.js} +1 -1
  22. package/dist/assets/{Vibe64SessionFiles-BXt__PJL.js → Vibe64SessionFiles--wtVe_KC.js} +1 -1
  23. package/dist/assets/{Vibe64SessionSourceEditor-NyG6niQM.js → Vibe64SessionSourceEditor-BouH4fXC.js} +1 -1
  24. package/dist/assets/Vibe64UiStoryboardView--E04EEF8.js +8 -0
  25. package/dist/assets/{Vibe64UiStoryboardView-CtlJWiCY.css → Vibe64UiStoryboardView-DqLN6ofL.css} +1 -1
  26. package/dist/assets/{Vibe64UnavailableSessions-CCPWJo8e.js → Vibe64UnavailableSessions-94bFpxMK.js} +1 -1
  27. package/dist/assets/_pageId_-Ch4OpUkd.js +1 -0
  28. package/dist/assets/_sessionId_-7PyIUeUr.css +1 -0
  29. package/dist/assets/_sessionId_-DGT4d2La.js +1 -0
  30. package/dist/assets/{_sessionTool_-CKPNp5fF.js → _sessionTool_-CBf51mfK.js} +1 -1
  31. package/dist/assets/_sessionTool_-DiYoi-BF.css +1 -0
  32. package/dist/assets/_slug_-C8VNMRVH.js +14 -0
  33. package/dist/assets/_slug_-CZmGS16g.css +1 -0
  34. package/dist/assets/access-BAOx4iCS.js +1 -0
  35. package/dist/assets/access-BH1OsqPS.css +1 -0
  36. package/dist/assets/{app-D9FegZf0.js → app-Bs6-Hv23.js} +1 -1
  37. package/dist/assets/{assistantRouting-D4SnnxJn.js → assistantRouting-BS0ZW5Ki.js} +1 -1
  38. package/dist/assets/{changes-DtfJc780.js → changes-C6eMQ9YE.js} +1 -1
  39. package/dist/assets/{client-CUQfIUus.css → client-BBJzQIWS.css} +1 -1
  40. package/dist/assets/{client-BBqNv4HL.js → client-CIF5Y1Aj.js} +1 -1
  41. package/dist/assets/{client-B8u2_Svv.css → client-CM6TGZc9.css} +1 -1
  42. package/dist/assets/{client-DnjkdG6K.js → client-CVgL_ShV.js} +1 -1
  43. package/dist/assets/{client-DuDOzb5A.js → client-HWj_BNVZ.js} +2 -2
  44. package/dist/assets/{client-Dra4Vp3A.js → client-qAKnahkF.js} +2 -2
  45. package/dist/assets/{client-mU-LObHG.js → client-qpL_kR4u.js} +2 -2
  46. package/dist/assets/{conversation-QpMeXw70.js → conversation-DbF0OrZB.js} +3 -3
  47. package/dist/assets/{conversation-La-pkh5h.css → conversation-ZN3-8jbz.css} +1 -1
  48. package/dist/assets/{dashboard-B26QwE6y.js → dashboard-CzLsa0w0.js} +1 -1
  49. package/dist/assets/{english-definitions-I9tIXY2u.js → english-definitions-BA8v5wP1.js} +1 -1
  50. package/dist/assets/{env-BXsvM592.js → env-BqJ_GWbz.js} +1 -1
  51. package/dist/assets/{error-kdRkyK9x.js → error-BQ7r64JO.js} +1 -1
  52. package/dist/assets/{error-CX8_snYL.js → error-BqMxhgpB.js} +1 -1
  53. package/dist/assets/errorMessageHelpers-BjIt31kK.js +1 -0
  54. package/dist/assets/{errors-DErd0NON.js → errors-D17nJYne.js} +1 -1
  55. package/dist/assets/{health-C4WtefLm.js → health-CIqrHpVK.js} +1 -1
  56. package/dist/assets/history-BCjhpyP8.js +1 -0
  57. package/dist/assets/history-BSIuLgnI.css +1 -0
  58. package/dist/assets/{httpClient-BRO3GqjU.js → httpClient-Bwitq9Xf.js} +1 -1
  59. package/dist/assets/i18n-BkxO7BMl.js +1 -0
  60. package/dist/assets/{i18n-B5lc019_.js → i18n-Dm74yE_M.js} +1 -1
  61. package/dist/assets/index-Ctygjyf8.css +1 -0
  62. package/dist/assets/index-fXKdz8oR.js +134 -0
  63. package/dist/assets/{integrations-CrI893NK.css → integrations-CwgrZgmM.css} +1 -1
  64. package/dist/assets/{integrations-CQNJxkMu.js → integrations-cgbpgNNd.js} +12 -5
  65. package/dist/assets/issues-AhouA6nE.js +1 -0
  66. package/dist/assets/issues-D46llNv-.css +1 -0
  67. package/dist/assets/{learning-0cINHUSN.js → learning-DZXWgVEW.js} +1 -1
  68. package/dist/assets/{pages-DbF-yXqO.js → pages-5jaEclQo.js} +1 -1
  69. package/dist/assets/{pages-CIKw99GN.js → pages-BUUwIXBf.js} +1 -1
  70. package/dist/assets/{pathname-DOqQPPVa.js → pathname-JHQIKk21.js} +1 -1
  71. package/dist/assets/{placement-BAaZQhAh.js → placement-1lT0lW3-.js} +1 -1
  72. package/dist/assets/{placement-Lk1Lpy6s.js → placement-B2V88UDJ.js} +1 -1
  73. package/dist/assets/{project-files-CklWobqZ.js → project-files-BS2gdDSz.js} +1 -1
  74. package/dist/assets/publish-Bq_LPmX2.js +3 -0
  75. package/dist/assets/{publish-DOybV3Qz.css → publish-C9O0tDPB.css} +1 -1
  76. package/dist/assets/pull-requests-BvChbjCD.js +1 -0
  77. package/dist/assets/pull-requests-DtqrTix0.css +1 -0
  78. package/dist/assets/{repository-wJZei_NJ.js → repository-Dkow-18G.js} +1 -1
  79. package/dist/assets/settings-BKZcbISO.css +1 -0
  80. package/dist/assets/settings-r5RWQVzw.js +1 -0
  81. package/dist/assets/{shared-X5MxTHwl.js → shared-B6plZPQ_.js} +1 -1
  82. package/dist/assets/{studioGateApi-CHIdcQvD.js → studioGateApi-UqmdV50W.js} +1 -1
  83. package/dist/assets/{studioUrls-oIU1Eq_t.js → studioUrls-k_pQIuPs.js} +1 -1
  84. package/dist/assets/useArchivedVibe64Sessions-C0MVJuyX.js +1 -0
  85. package/dist/assets/useAssistantAttachments-BkYZckgz.js +2 -0
  86. package/dist/assets/useCommand-CNDe8gM-.js +1 -0
  87. package/dist/assets/{useEndpointResource-61E93qP-.js → useEndpointResource-CmMwteuX.js} +1 -1
  88. package/dist/assets/{usePaths-B-QGqa_I.js → usePaths-CvUbx5-V.js} +1 -1
  89. package/dist/assets/{useUiFeedback-CycH_fvY.js → useUiFeedback-CWb6o71Z.js} +1 -1
  90. package/dist/assets/useVibe64ConversationLog-CUWEZhnf.js +2 -0
  91. package/dist/assets/{useVibe64Learning-DZCyrfpy.js → useVibe64Learning-RE4HXHqo.js} +1 -1
  92. package/dist/assets/{useVibe64SessionData-rBvWMqyc.js → useVibe64SessionData-kGr7R7lG.js} +1 -1
  93. package/dist/assets/{useVibe64SessionSelection-C546mBu8.js → useVibe64SessionSelection-BZ7WnRv0.js} +1 -1
  94. package/dist/assets/validators-HqYRjxEO.js +1 -0
  95. package/dist/assets/{vibe64FileUpload-D0Lv2mMJ.js → vibe64FileUpload-BDkcaUyk.js} +1 -1
  96. package/dist/assets/vibe64GithubProject-CJneIo5O.js +1 -0
  97. package/dist/assets/vibe64RepositoryRealtime-R5QhcJ4H.js +1 -0
  98. package/dist/assets/vibe64SessionFocus-BCojr4E-.css +1 -0
  99. package/dist/assets/vibe64SessionFocus-CHKCMxcJ.js +1 -0
  100. package/dist/index.html +29 -27
  101. package/docs/colleague-usage/ai-tasks.md +15 -4
  102. package/docs/colleague-usage/back-navigation.md +16 -13
  103. package/docs/colleague-usage/coding-agent-goal-pause.md +15 -1
  104. package/docs/colleague-usage/coding-agent-goals.md +23 -3
  105. package/docs/colleague-usage/coding-agent-recovery.md +3 -1
  106. package/docs/colleague-usage/coding-agents.md +19 -1
  107. package/docs/colleague-usage/colleague-watches.md +1 -1
  108. package/docs/colleague-usage/connected-projects.md +1 -1
  109. package/docs/colleague-usage/connected-repositories.md +16 -4
  110. package/docs/colleague-usage/dashboard-navigation.md +14 -11
  111. package/docs/colleague-usage/database.md +1 -1
  112. package/docs/colleague-usage/development-env.md +21 -12
  113. package/docs/colleague-usage/files.md +2 -1
  114. package/docs/colleague-usage/github-work.md +51 -12
  115. package/docs/colleague-usage/health-checks.md +1 -1
  116. package/docs/colleague-usage/integrations.md +2 -2
  117. package/docs/colleague-usage/learning-teacher-guide.md +3 -2
  118. package/docs/colleague-usage/pages.md +1 -2
  119. package/docs/colleague-usage/preview-browser-checks.md +3 -0
  120. package/docs/colleague-usage/preview.md +29 -0
  121. package/docs/colleague-usage/project-messages.md +4 -3
  122. package/docs/colleague-usage/project-settings.md +3 -0
  123. package/docs/colleague-usage/session-archive.md +11 -0
  124. package/docs/colleague-usage/sessions.md +8 -7
  125. package/docs/colleague-usage/temporary-chats.md +4 -3
  126. package/docs/colleague-usage/ui-pass.md +1 -1
  127. package/docs/colleague-usage/usage-map.md +3 -2
  128. package/docs/colleague-usage/workspace-preparation.md +12 -0
  129. package/node_modules/@jskit-ai/agent/CHANGELOG.md +5 -0
  130. package/node_modules/@jskit-ai/agent/package.json +1 -1
  131. package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +8 -0
  132. package/node_modules/@jskit-ai/assistant-core/locales/en.json +4 -1
  133. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  134. package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +4 -0
  135. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  136. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  137. package/node_modules/@jskit-ai/connector-google-calendar/CHANGELOG.md +4 -0
  138. package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
  139. package/node_modules/@jskit-ai/connectors-catalog/CHANGELOG.md +1 -0
  140. package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
  141. package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +2 -0
  142. package/node_modules/@jskit-ai/connectors-core/README.md +4 -0
  143. package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
  144. package/node_modules/@jskit-ai/http-runtime/CHANGELOG.md +1 -0
  145. package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
  146. package/node_modules/@jskit-ai/kernel/CHANGELOG.md +8 -0
  147. package/node_modules/@jskit-ai/kernel/package.json +3 -1
  148. package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +1 -0
  149. package/node_modules/@jskit-ai/payments-core/locales/en.json +2 -1
  150. package/node_modules/@jskit-ai/payments-core/package.json +1 -1
  151. package/node_modules/@jskit-ai/realtime/CHANGELOG.md +1 -0
  152. package/node_modules/@jskit-ai/realtime/package.json +1 -1
  153. package/node_modules/@jskit-ai/resource-core/CHANGELOG.md +1 -0
  154. package/node_modules/@jskit-ai/resource-core/package.json +1 -1
  155. package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
  156. package/node_modules/@local/vibe64-ai-tasks/package.json +2 -1
  157. package/node_modules/@local/vibe64-execution/src/host/execHelper.js +463 -442
  158. package/node_modules/@local/vibe64-genesis/bin/genesis +17 -11
  159. package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +827 -813
  160. package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +93 -67
  161. package/node_modules/@local/vibe64-genesis/src/server/index.js +608 -584
  162. package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +180 -175
  163. package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +490 -479
  164. package/node_modules/@local/vibe64-source-editor/src/server/searchIndexWorker.js +12 -11
  165. package/node_modules/@local/vibe64-system-graph/README.md +9 -5
  166. package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +262 -252
  167. package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1026 -981
  168. package/node_modules/json-rest-schema/README.md +3 -1
  169. package/node_modules/json-rest-schema/package.json +1 -1
  170. package/package.json +17 -17
  171. package/server.bundle.mjs +43244 -42953
  172. package/dist/assets/Vibe64AuthSettingsButton-Bx9patil.js +0 -5
  173. package/dist/assets/Vibe64FileArea-DIDyAUvD.js +0 -1
  174. package/dist/assets/Vibe64OutputControls-mNWUWLSm.js +0 -8
  175. package/dist/assets/Vibe64UiStoryboardView-BXH2MSWn.js +0 -8
  176. package/dist/assets/_pageId_-D54CqzqG.js +0 -1
  177. package/dist/assets/_sessionId_-B5V2Fs2n.css +0 -1
  178. package/dist/assets/_sessionId_-CW044RVi.js +0 -1
  179. package/dist/assets/_sessionTool_-Be88HWbv.css +0 -1
  180. package/dist/assets/_slug_-CRtFhc0A.js +0 -14
  181. package/dist/assets/_slug_-WWvJTLoc.css +0 -1
  182. package/dist/assets/access-ChMLRErk.js +0 -1
  183. package/dist/assets/access-Cm2lrMF6.css +0 -1
  184. package/dist/assets/errorMessageHelpers-L2GsOwCP.js +0 -1
  185. package/dist/assets/history-BhqQz5jH.css +0 -1
  186. package/dist/assets/history-HHPFoNi3.js +0 -1
  187. package/dist/assets/index-BBfSvf2i.css +0 -1
  188. package/dist/assets/index-Bvd00puv.js +0 -134
  189. package/dist/assets/issues-BHr_nI-9.js +0 -1
  190. package/dist/assets/issues-CpBRQTQ_.css +0 -1
  191. package/dist/assets/publish-Cot797YN.js +0 -3
  192. package/dist/assets/pull-requests-DnEm9m_1.css +0 -1
  193. package/dist/assets/pull-requests-ybnixBv0.js +0 -1
  194. package/dist/assets/settings-DJByC5Wb.js +0 -1
  195. package/dist/assets/settings-bEkDjn0Y.css +0 -1
  196. package/dist/assets/useArchivedVibe64Sessions-B-DtXrk-.js +0 -1
  197. package/dist/assets/useAssistantAttachments-CkseokGM.js +0 -2
  198. package/dist/assets/useCommand-D96utlVe.js +0 -1
  199. package/dist/assets/useVibe64ConversationLog-BVANhCHq.js +0 -2
  200. package/dist/assets/validators-B3YzM6px.js +0 -1
  201. package/dist/assets/vibe64GithubProject-DNl0aDcC.js +0 -1
  202. package/dist/assets/vibe64RepositoryRealtime-BPsE5l5E.js +0 -1
  203. package/dist/assets/vibe64SessionFocus-CxX2nK6F.js +0 -1
  204. package/dist/assets/vibe64SessionFocus-DW73PN_o.css +0 -1
@@ -1,110 +1,110 @@
1
1
  import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
2
- import{createHash as wn}from"node:crypto";import Ie from"node:path";var oe=class extends Error{constructor(n,t,s=void 0){
3
- super(t),this.name="Vibe64StackOperationError",this.code=n,s!==void 0&&(this.details=s)}},Qe=Object.freeze({VIBE64_WORKSPACE_SETUP_INVALID:"\
2
+ import{createHash as Cn}from"node:crypto";import Te from"node:path";var ae=class extends Error{constructor(n,t,s=void 0){
3
+ super(t),this.name="Vibe64StackOperationError",this.code=n,s!==void 0&&(this.details=s)}},it=Object.freeze({VIBE64_WORKSPACE_SETUP_INVALID:"\
4
4
  workspace-setup",VIBE64_OUTPUTS_INVALID:"outputs",VIBE64_DEPLOYMENT_INVALID:"deployment",VIBE64_PACKAGING_INVALID:"packa\
5
5
  ging",VIBE64_RESOURCE_ESTIMATES_INVALID:"resource-estimates",VIBE64_CONNECTED_DEVELOPMENT_INVALID:"connected-development",
6
6
  VIBE64_PROJECT_SERVICES_INVALID:"project-services",VIBE64_INTEGRATION_SETUP_INVALID:"integration-setup",VIBE64_ARCHITECTURE_INSPECTION_INVALID:"\
7
- architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),Sn=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
8
- function In(e,n){let t=Qe[e],s=String(n).replace(Sn,"");return t?`${s} Exact grammar: vibe64-helper spec ${t}.`:s}function $(e,n,t){
9
- return`Unknown ${e}: ${n}. Use one of: ${t.join("; ")}.`}function d(e,n,t,s,r={}){throw new oe(e,In(e,t),{path:n,...s===
10
- void 0?{}:{line:s},...r})}function b(e,n,t,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&d(n,t,`${s} \
11
- must be one non-empty line.`,r),e.trim()}function Tn(e){let n=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return n.length===
12
- 0||n.map(t=>t[0]).join(" ")!==e?null:n.map(t=>t[1])}function I(e,n,t,s,r,i={}){let{count:o,maximum:u=64}=i,a=Tn(e);if(!a||
13
- a.length>u||o!==void 0&&a.length!==o||a.some(c=>c.length>4096||/[\0\r\n]/u.test(c))){let c=o===void 0?"separate non-empt\
14
- y":`exactly ${o}`;d(n,t,`${s} must contain ${c} backticked ${o===1?"value":"values"}.`,r)}return a}function kn(e=""){return typeof e==
15
- "string"&&!!e&&!/[\s\0{}]/u.test(e)&&!Ie.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function R(e,n,t,s,r){let i=I(
16
- e,n,t,s,r);return kn(i[0])||d(n,t,`${s} must begin with a safe executable.`,r),i}function _n(e=""){return typeof e=="str\
17
- ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!Ie.posix.isAbsolute(e)&&Ie.posix.normalize(e)===e&&!e.split("/").some(n=>!n||n==="..")}
18
- function y(e,n,t,s,r,i={}){let{allowRoot:o=!0}=i;return(!_n(e)||!o&&e===".")&&d(n,t,`${s} must be a canonical project-re\
19
- lative path.`,r),e}function A(e,n,t,s,r){let i=I(e,n,t,s,r);return i.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&d(
7
+ architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),Pn=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
8
+ function Dn(e,n){let t=it[e],s=String(n).replace(Pn,"");return t?`${s} Exact grammar: vibe64-helper spec ${t}.`:s}function D(e,n,t){
9
+ return`Unknown ${e}: ${n}. Use one of: ${t.join("; ")}.`}function d(e,n,t,s,r={}){throw new ae(e,Dn(e,t),{path:n,...s===
10
+ void 0?{}:{line:s},...r})}function v(e,n,t,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&d(n,t,`${s} \
11
+ must be one non-empty line.`,r),e.trim()}function $n(e){let n=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return n.length===
12
+ 0||n.map(t=>t[0]).join(" ")!==e?null:n.map(t=>t[1])}function I(e,n,t,s,r,i={}){let{count:o,maximum:c=64}=i,a=$n(e);if(!a||
13
+ a.length>c||o!==void 0&&a.length!==o||a.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=o===void 0?"separate non-empt\
14
+ y":`exactly ${o}`;d(n,t,`${s} must contain ${u} backticked ${o===1?"value":"values"}.`,r)}return a}function Vn(e=""){return typeof e==
15
+ "string"&&!!e&&!/[\s\0{}]/u.test(e)&&!Te.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function A(e,n,t,s,r){let i=I(
16
+ e,n,t,s,r);return Vn(i[0])||d(n,t,`${s} must begin with a safe executable.`,r),i}function xn(e=""){return typeof e=="str\
17
+ ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!Te.posix.isAbsolute(e)&&Te.posix.normalize(e)===e&&!e.split("/").some(n=>!n||n==="..")}
18
+ function b(e,n,t,s,r,i={}){let{allowRoot:o=!0}=i;return(!xn(e)||!o&&e===".")&&d(n,t,`${s} must be a canonical project-re\
19
+ lative path.`,r),e}function N(e,n,t,s,r){let i=I(e,n,t,s,r);return i.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&d(
20
20
  n,t,`${s} must use lowercase technology ids separated into backticked values.`,r),new Set(i).size!==i.length&&d(n,t,`${s}\
21
- contains a duplicate technology id.`,r),i}function ke(e,n,t,s,r){let i=b(e,n,t,s,r);return(!i.startsWith("/")||i.startsWith(
22
- "//")||/[\\?#]/u.test(i))&&d(n,t,`${s} must begin with one slash and contain no query or fragment.`,r),i}function ae(e,n,t,s,r){
21
+ contains a duplicate technology id.`,r),i}function _e(e,n,t,s,r){let i=v(e,n,t,s,r);return(!i.startsWith("/")||i.startsWith(
22
+ "//")||/[\\?#]/u.test(i))&&d(n,t,`${s} must begin with one slash and contain no query or fragment.`,r),i}function ce(e,n,t,s,r){
23
23
  let i=e.match(/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);i||d(n,t,`${s} must use \`- Ready when: \`GET\` \
24
24
  \`/path\` returns \`200\`\`.`,r);let o=Number(i[2]);return(!Number.isInteger(o)||o<200||o>399)&&d(n,t,`${s} status must \
25
- be from 200 through 399.`,r),{kind:"http",method:"GET",path:ke(i[1],n,t,`${s} path`,r),status:o}}var On=/^with (.+?):[ \t]+(.+)$/u,
26
- Rn=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,An=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Nn=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
27
- function ce(e,n,t,s,r,{form:i,observed:o=e}){let u=String(e||"").match(On);u||d(n,t,`Every ${s} entry must use: ${i}`,r,
28
- {observed:o});let a=u[1].match(Rn),c=a?null:u[1].match(An),p=a?a[1]:c?c[1]:u[1],m=a?.[2]||c?.[2]||"",l=p.match(Nn);return{
29
- argv:R(u[2],n,t,`${s} command`,r),runtimeRequirements:A(l?l[1]:p,n,t,`${s} runtimes`,r),workdir:y(l?l[2]:".",n,t,`${s} w\
30
- orkdir`,r),...m?{condition:{pathExists:y(m,n,t,`${s} condition path`,r,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function Te(e){
31
- return Array.isArray(e)?e.map(Te):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(n=>[n,Te(e[n])])):e}
32
- function O(e){let n=`${JSON.stringify(Te(e),null,2)}
33
- `;return`sha256:${wn("sha256").update(n).digest("hex")}`}function H(e={},n={},t="operation"){if(e.stackHash!==n.stackHash)
34
- throw new oe("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${t}. Retry the operation.`)}function z(e=[]){
35
- return[...new Set(e)].sort()}function v(e=[]){let n=e.map(t=>t.trim()).filter(Boolean);return n.length===1&&n[0]==="- No\
36
- thing."}var oi=Object.freeze({SPEC_BY_ERROR_CODE:Qe});var Cn="custom";var Pn=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
25
+ be from 200 through 399.`,r),{kind:"http",method:"GET",path:_e(i[1],n,t,`${s} path`,r),status:o}}var jn=/^with (.+?):[ \t]+(.+)$/u,
26
+ Ln=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,Mn=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Gn=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
27
+ function ue(e,n,t,s,r,{form:i,observed:o=e}){let c=String(e||"").match(jn);c||d(n,t,`Every ${s} entry must use: ${i}`,r,
28
+ {observed:o});let a=c[1].match(Ln),u=a?null:c[1].match(Mn),p=a?a[1]:u?u[1]:c[1],m=a?.[2]||u?.[2]||"",l=p.match(Gn);return{
29
+ argv:A(c[2],n,t,`${s} command`,r),runtimeRequirements:N(l?l[1]:p,n,t,`${s} runtimes`,r),workdir:b(l?l[2]:".",n,t,`${s} w\
30
+ orkdir`,r),...m?{condition:{pathExists:b(m,n,t,`${s} condition path`,r,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function ke(e){
31
+ return Array.isArray(e)?e.map(ke):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(n=>[n,ke(e[n])])):e}
32
+ function R(e){let n=`${JSON.stringify(ke(e),null,2)}
33
+ `;return`sha256:${Cn("sha256").update(n).digest("hex")}`}function H(e={},n={},t="operation"){if(e.stackHash!==n.stackHash)
34
+ throw new ae("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${t}. Retry the operation.`)}function z(e=[]){
35
+ return[...new Set(e)].sort()}function w(e=[]){let n=e.map(t=>t.trim()).filter(Boolean);return n.length===1&&n[0]==="- No\
36
+ thing."}var yi=Object.freeze({SPEC_BY_ERROR_CODE:it});var Un="custom";var Bn=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
37
37
  (PHP)"}),Object.freeze({value:"pip",label:"pip (Python)"}),Object.freeze({value:"bundler",label:"Bundler (Ruby)"}),Object.
38
38
  freeze({value:"gomod",label:"Go modules"}),Object.freeze({value:"cargo",label:"Cargo (Rust)"}),Object.freeze({value:"mav\
39
39
  en",label:"Maven"}),Object.freeze({value:"gradle",label:"Gradle"}),Object.freeze({value:"nuget",label:"NuGet (.NET)"}),Object.
40
- freeze({value:Cn,label:"custom"})]);var et=Object.freeze(Pn.map(e=>e.value));function tt(e){return typeof e=="string"&&et.includes(e)}function nt(e="or"){let n=et;return`${n.slice(0,-1).join(", ")} ${e} ${n.at(-1)}`}var st="Connected development",Dn="vibe64.connected-development.v1",V="VIBE64_CONNECTED_DEVELOPMENT_INVALID",x="genesis/\
41
- stack.md#Connected development",_e="with `runtime` [in `workdir`]: `command` `argument`...",rt=Object.freeze({Prepare:`-\
42
- Prepare \`label\` ${_e}`,Verify:`- Verify \`label\` ${_e}`,"Custom runner":`- Custom runner ${_e}`}),$n=Object.freeze([
43
- "- Default package type: `type`","- Sources file: `path`",...Object.values(rt)]),Vn=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
44
- xn=/^- Custom runner (.+)$/u,jn="Custom connected source";function it(e={}){let n="",t="",s=null,r=[],i=[...e.diagnostics||
45
- []],o=e.status==="ready";if(o&&!v(e.lines)){let a=!1;for(let[p,m]of e.lines.entries()){let l=m.trim();if(!l)continue;let f=p+
46
- 1,g=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(g){t&&d(V,x,"Declare exactly one default package type.",f),tt(
47
- g[1])||d(V,x,`Default package type must be ${nt()}.`,f),t=g[1];continue}let C=l.match(/^- Sources file: `([^`\r\n]+)`$/u);
48
- if(C){n&&d(V,x,"Declare exactly one Sources file.",f),n=y(C[1],V,x,"Connected sources file",f,{allowRoot:!1}),n.split("/").
49
- some(vn=>vn.toLowerCase()===".git")&&d(V,x,"The Sources file must be outside Git metadata.",f);continue}let k=l.match(xn),
50
- P=k?null:l.match(Vn);!k&&!P&&d(V,x,$("Connected development entry",l,$n),f);let Y=k?"Custom runner":P[1],Q=Y==="Verify"?
51
- "verify":"prepare";!k&&a&&Q==="prepare"&&d(V,x,"All Prepare entries must precede Verify entries.",f),a||=!k&&Q==="verify";
52
- let Se={label:k?jn:b(P[2],V,x,`Connected development ${Y} label`,f),...ce(k?k[1]:P[3],V,x,`Connected development ${Y}`,f,
53
- {form:rt[Y],observed:l})};Se.condition&&d(V,x,"Connected development steps must run unconditionally; a skipped step cann\
54
- ot prove source consumption.",f),k?(s&&d(V,x,"Declare exactly one Custom runner.",f),s=Se):r.push({...Se,phase:Q})}!(t&&
55
- !n&&!r.length&&!s)&&(!n||!r.some(p=>p.phase==="verify")&&!s)&&d(V,x,"Declare a default package type alone, or a Sources \
56
- file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let u=e.status==="blocked"||i.length?
57
- "blocked":r.length||s?"ready":"unconfigured";return{contract:Dn,declared:o,status:u,stackHash:e.stackHash,recipeHash:u===
58
- "ready"?O({version:1,sourcesFile:n,defaultPackageType:t,customRunner:s,steps:r}):"",components:[...e.components||[]],source:e.
40
+ freeze({value:Un,label:"custom"})]);var ot=Object.freeze(Bn.map(e=>e.value));function at(e){return typeof e=="string"&&ot.includes(e)}function ct(e="or"){let n=ot;return`${n.slice(0,-1).join(", ")} ${e} ${n.at(-1)}`}var ut="Connected development",Wn="vibe64.connected-development.v1",$="VIBE64_CONNECTED_DEVELOPMENT_INVALID",V="genesis/\
41
+ stack.md#Connected development",Oe="with `runtime` [in `workdir`]: `command` `argument`...",pt=Object.freeze({Prepare:`-\
42
+ Prepare \`label\` ${Oe}`,Verify:`- Verify \`label\` ${Oe}`,"Custom runner":`- Custom runner ${Oe}`}),Hn=Object.freeze([
43
+ "- Default package type: `type`","- Sources file: `path`",...Object.values(pt)]),zn=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
44
+ Fn=/^- Custom runner (.+)$/u,qn="Custom connected source";function lt(e={}){let n="",t="",s=null,r=[],i=[...e.diagnostics||
45
+ []],o=e.status==="ready";if(o&&!w(e.lines)){let a=!1;for(let[p,m]of e.lines.entries()){let l=m.trim();if(!l)continue;let f=p+
46
+ 1,g=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(g){t&&d($,V,"Declare exactly one default package type.",f),at(
47
+ g[1])||d($,V,`Default package type must be ${ct()}.`,f),t=g[1];continue}let S=l.match(/^- Sources file: `([^`\r\n]+)`$/u);
48
+ if(S){n&&d($,V,"Declare exactly one Sources file.",f),n=b(S[1],$,V,"Connected sources file",f,{allowRoot:!1}),n.split("/").
49
+ some(Nn=>Nn.toLowerCase()===".git")&&d($,V,"The Sources file must be outside Git metadata.",f);continue}let _=l.match(Fn),
50
+ P=_?null:l.match(zn);!_&&!P&&d($,V,D("Connected development entry",l,Hn),f);let Y=_?"Custom runner":P[1],Q=Y==="Verify"?
51
+ "verify":"prepare";!_&&a&&Q==="prepare"&&d($,V,"All Prepare entries must precede Verify entries.",f),a||=!_&&Q==="verify";
52
+ let Ie={label:_?qn:v(P[2],$,V,`Connected development ${Y} label`,f),...ue(_?_[1]:P[3],$,V,`Connected development ${Y}`,f,
53
+ {form:pt[Y],observed:l})};Ie.condition&&d($,V,"Connected development steps must run unconditionally; a skipped step cann\
54
+ ot prove source consumption.",f),_?(s&&d($,V,"Declare exactly one Custom runner.",f),s=Ie):r.push({...Ie,phase:Q})}!(t&&
55
+ !n&&!r.length&&!s)&&(!n||!r.some(p=>p.phase==="verify")&&!s)&&d($,V,"Declare a default package type alone, or a Sources \
56
+ file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let c=e.status==="blocked"||i.length?
57
+ "blocked":r.length||s?"ready":"unconfigured";return{contract:Wn,declared:o,status:c,stackHash:e.stackHash,recipeHash:c===
58
+ "ready"?R({version:1,sourcesFile:n,defaultPackageType:t,customRunner:s,steps:r}):"",components:[...e.components||[]],source:e.
59
59
  source||null,sourcesFile:n,defaultPackageType:t,customRunner:s,steps:r,runtimeRequirements:z([...r,...s?[s]:[]].flatMap(
60
- a=>a.runtimeRequirements)),diagnostics:i}}import{lstat as Ln,open as Mn,realpath as Oe,stat as Gn}from"node:fs/promises";import{constants as ot}from"node:fs";import at from"node:path";var Un="vibe64.architecture-inspection.v1",ut="Architecture inspection",T="VIBE64_ARCHITECTURE_INSPECTION_INVALID",ue="g\
61
- enesis/stack.md#Architecture inspection",pt=120,lt=64*1024*1024,ct=64*1024,Bn=Object.freeze(["runtimeRequirements","work\
62
- dir","argv","timeout","maxBuffer"]),Re=Object.freeze({Runtime:["runtimeRequirements","`runtime`..."],Directory:["workdir",
63
- "`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${pt}\``],"Max output\
64
- bytes":["maxBuffer",`\`1\` through \`${lt}\``],"Entry files":["entryFiles","`path`... (optional)"],"Required files":["r\
65
- equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),Wn=new RegExp(
66
- `^- (${Object.keys(Re).join("|")}): (.+)$`,"u");function dt(e,n={}){let{path:t=ue}=n;if(Array.isArray(e)||d(T,t,"Archite\
67
- cture inspection requires exact Stack section lines."),v(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let u of Bn)
68
- i[u]===void 0&&d(T,t,`${i.id} is missing ${u}.`);s.push(i),i=null}}for(let[u,a]of e.entries()){let c=a.trim();if(!c)continue;
69
- let p=c.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(p){o(),r.has(p[1])&&d(T,t,"Duplicate inspector i\
70
- d.",u+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||d(T,t,"Expected an Inspector heading.",u+1);let m=c.match(Wn);if(!m){
71
- let f=Object.entries(Re).map(([g,[,C]])=>`- ${g}: ${C}`).join("; ");d(T,t,`Unknown architecture inspector field. Use one\
72
- of: ${f}.`,u+1)}let[l]=Re[m[1]];if(i[l]!==void 0&&d(T,t,`Duplicate ${m[1]}.`,u+1),l==="runtimeRequirements")i[l]=A(m[2],
73
- T,t,"Inspector runtime",u+1);else if(l==="argv")i[l]=R(m[2],T,t,"Inspector command",u+1);else if(l==="entryFiles"||l==="\
74
- requiredFiles")i[l]=I(m[2],T,t,m[1],u+1).map(f=>y(f,T,t,m[1],u+1));else{let[f]=I(m[2],T,t,m[1],u+1,{count:1});if(l==="wo\
75
- rkdir")i[l]=y(f,T,t,"Inspector directory",u+1);else if(l==="previewLocator")i[l]=mt(f,t,u+1);else{let g=Number(f),C=l===
76
- "timeout"?pt:lt;(!/^[1-9][0-9]*$/u.test(f)||!Number.isSafeInteger(g)||g>C)&&d(T,t,`${m[1]} must be from 1 to ${C}.`,u+1),
77
- i[l]=l==="timeout"?g*1e3:g}}}return o(),s.length||d(T,t,"Use an Inspector entry or - Nothing."),s}function mt(e,n,t){return y(
78
- e,T,n,"Preview locator",t,{allowRoot:!1}),e.endsWith(".js")||d(T,n,"Preview locator must name a .js file.",t),e}function Hn(e,n){
79
- return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function zn(e,n){
80
- mt(n,ue);let t=i=>d(T,ue,`Preview locator \`${n}\` ${i}.`),s=n.split("/"),r;try{let i=await Oe(e),o=i,u=!1;for(let[c,p]of s.
81
- entries())o=at.join(o,p),(await Ln(o)).isSymbolicLink()&&((u||c===s.length-1||!Hn(s,c))&&t("must not be or pass through \
82
- a symlink"),o=i=await Oe(o),(await Gn(i)).isDirectory()||t("links a package that is not a folder"),u=!0);(await Oe(o)!==
83
- o||!o.startsWith(`${i}${at.sep}`))&&t("must not be or pass through a symlink"),r=await Mn(o,ot.O_RDONLY|ot.O_NOFOLLOW);let a=await r.
84
- stat();return a.isFile()||t("must be a regular file"),a.size>ct&&t(`must be at most ${ct} bytes`),{path:n,source:await r.
60
+ a=>a.runtimeRequirements)),diagnostics:i}}import{lstat as Kn,open as Yn,realpath as Re,stat as Xn}from"node:fs/promises";import{constants as dt}from"node:fs";import mt from"node:path";var Jn="vibe64.architecture-inspection.v1",ft="Architecture inspection",k="VIBE64_ARCHITECTURE_INSPECTION_INVALID",pe="g\
61
+ enesis/stack.md#Architecture inspection",gt=120,Et=64*1024*1024,ht=64*1024,Zn=Object.freeze(["runtimeRequirements","work\
62
+ dir","argv","timeout","maxBuffer"]),Ae=Object.freeze({Runtime:["runtimeRequirements","`runtime`..."],Directory:["workdir",
63
+ "`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${gt}\``],"Max output\
64
+ bytes":["maxBuffer",`\`1\` through \`${Et}\``],"Entry files":["entryFiles","`path`... (optional)"],"Required files":["r\
65
+ equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),Qn=new RegExp(
66
+ `^- (${Object.keys(Ae).join("|")}): (.+)$`,"u");function yt(e,n={}){let{path:t=pe}=n;if(Array.isArray(e)||d(k,t,"Archite\
67
+ cture inspection requires exact Stack section lines."),w(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let c of Zn)
68
+ i[c]===void 0&&d(k,t,`${i.id} is missing ${c}.`);s.push(i),i=null}}for(let[c,a]of e.entries()){let u=a.trim();if(!u)continue;
69
+ let p=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(p){o(),r.has(p[1])&&d(k,t,"Duplicate inspector i\
70
+ d.",c+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||d(k,t,"Expected an Inspector heading.",c+1);let m=u.match(Qn);if(!m){
71
+ let f=Object.entries(Ae).map(([g,[,S]])=>`- ${g}: ${S}`).join("; ");d(k,t,`Unknown architecture inspector field. Use one\
72
+ of: ${f}.`,c+1)}let[l]=Ae[m[1]];if(i[l]!==void 0&&d(k,t,`Duplicate ${m[1]}.`,c+1),l==="runtimeRequirements")i[l]=N(m[2],
73
+ k,t,"Inspector runtime",c+1);else if(l==="argv")i[l]=A(m[2],k,t,"Inspector command",c+1);else if(l==="entryFiles"||l==="\
74
+ requiredFiles")i[l]=I(m[2],k,t,m[1],c+1).map(f=>b(f,k,t,m[1],c+1));else{let[f]=I(m[2],k,t,m[1],c+1,{count:1});if(l==="wo\
75
+ rkdir")i[l]=b(f,k,t,"Inspector directory",c+1);else if(l==="previewLocator")i[l]=bt(f,t,c+1);else{let g=Number(f),S=l===
76
+ "timeout"?gt:Et;(!/^[1-9][0-9]*$/u.test(f)||!Number.isSafeInteger(g)||g>S)&&d(k,t,`${m[1]} must be from 1 to ${S}.`,c+1),
77
+ i[l]=l==="timeout"?g*1e3:g}}}return o(),s.length||d(k,t,"Use an Inspector entry or - Nothing."),s}function bt(e,n,t){return b(
78
+ e,k,n,"Preview locator",t,{allowRoot:!1}),e.endsWith(".js")||d(k,n,"Preview locator must name a .js file.",t),e}function es(e,n){
79
+ return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function ts(e,n){
80
+ bt(n,pe);let t=i=>d(k,pe,`Preview locator \`${n}\` ${i}.`),s=n.split("/"),r;try{let i=await Re(e),o=i,c=!1;for(let[u,p]of s.
81
+ entries())o=mt.join(o,p),(await Kn(o)).isSymbolicLink()&&((c||u===s.length-1||!es(s,u))&&t("must not be or pass through \
82
+ a symlink"),o=i=await Re(o),(await Xn(i)).isDirectory()||t("links a package that is not a folder"),c=!0);(await Re(o)!==
83
+ o||!o.startsWith(`${i}${mt.sep}`))&&t("must not be or pass through a symlink"),r=await Yn(o,dt.O_RDONLY|dt.O_NOFOLLOW);let a=await r.
84
+ stat();return a.isFile()||t("must be a regular file"),a.size>ht&&t(`must be at most ${ht} bytes`),{path:n,source:await r.
85
85
  readFile("utf8")}}catch(i){throw(i?.code==="ENOENT"||i?.code==="ENOTDIR")&&t("is not a file in this project"),i?.code===
86
- "ELOOP"&&t("must not be or pass through a symlink"),i}finally{await r?.close()}}function ht(e){let n=e.status==="ready"?
87
- dt(e.lines):[];for(let t of n)t.runtimeRequirements.some(s=>!e.components.includes(s))&&d(T,ue,"Inspector runtimes must \
88
- be selected in Stack.");return{contract:Un,status:e.status,stackHash:e.stackHash,inspectors:n,recipeHash:O(n),diagnostics:e.
89
- diagnostics||[]}}var gi=Object.freeze({parseVibe64ArchitectureInspectionLines:dt});var Fn="vibe64.architecture-layout.v1",ft="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Ae=Object.freeze(
90
- ["layer","libraries","support"]);function gt(e,n={}){let{path:t="genesis/stack.md#Architecture layout"}=n;if(Array.isArray(
91
- e)||d(U,t,"Expected exact Stack section lines."),v(e))return[];let s=[],r=new Set,i=new Set,o;function u(){o&&((!o.kind||
86
+ "ELOOP"&&t("must not be or pass through a symlink"),i}finally{await r?.close()}}function vt(e){let n=e.status==="ready"?
87
+ yt(e.lines):[];for(let t of n)t.runtimeRequirements.some(s=>!e.components.includes(s))&&d(k,pe,"Inspector runtimes must \
88
+ be selected in Stack.");return{contract:Jn,status:e.status,stackHash:e.stackHash,inspectors:n,recipeHash:R(n),diagnostics:e.
89
+ diagnostics||[]}}var Ri=Object.freeze({parseVibe64ArchitectureInspectionLines:yt});var ns="vibe64.architecture-layout.v1",wt="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Ne=Object.freeze(
90
+ ["layer","libraries","support"]);function St(e,n={}){let{path:t="genesis/stack.md#Architecture layout"}=n;if(Array.isArray(
91
+ e)||d(U,t,"Expected exact Stack section lines."),w(e))return[];let s=[],r=new Set,i=new Set,o;function c(){o&&((!o.kind||
92
92
  !o.purpose||!o.subsystems.length)&&d(U,t,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[a,
93
- c]of e.entries()){let p=c.trim();if(!p)continue;let m=p.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(m){u(),
93
+ u]of e.entries()){let p=u.trim();if(!p)continue;let m=p.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(m){c(),
94
94
  r.has(m[1])&&d(U,t,"Duplicate group id.",a+1),r.add(m[1]),o={id:m[1],title:m[2],subsystems:[]};continue}let l=p.match(/^- (Kind|Purpose|Subsystem): (.+)$/u);
95
95
  (!o||!l)&&d(U,t,"Expected a Group heading or Kind, Purpose, Subsystem field.",a+1);let f=I(l[2],U,t,l[1],a+1,{count:1});
96
- if(l[1]==="Subsystem"){let g=y(f[0],U,t,"Subsystem root",a+1);i.has(g)&&d(U,t,"Each directory root may be placed only on\
96
+ if(l[1]==="Subsystem"){let g=b(f[0],U,t,"Subsystem root",a+1);i.has(g)&&d(U,t,"Each directory root may be placed only on\
97
97
  ce.",a+1),i.add(g),o.subsystems.push({root:g})}else{let g=l[1].toLowerCase();o[g]!==void 0&&d(U,t,`Duplicate ${l[1]}.`,a+
98
- 1),g==="kind"&&!Ae.includes(f[0])&&d(U,t,`Kind must be ${Ae.slice(0,-1).join(", ")} or ${Ae.at(-1)}.`,a+1),o[g]=f[0]}}return u(),
99
- s.length||d(U,t,"Use a Group entry or - Nothing."),s}function Et(e){return{contract:Fn,status:e.status,stackHash:e.stackHash,
100
- groups:e.status==="ready"?gt(e.lines):[],diagnostics:e.diagnostics||[]}}var bi=Object.freeze({parseVibe64ArchitectureLayoutLines:gt});import{existsSync as hn}from"node:fs";import{readFile as br}from"node:fs/promises";import{createRequire as vr}from"node:module";
101
- import W from"node:path";var qn="STACK_PROJECT_CONTRACTS_INCOMPLETE",yt="STACK_SECTION_AMBIGUOUS",Kn=Object.freeze([qn,yt]);function Yn(e){return Kn.
102
- includes(String(e?.code||"").trim())}var Ne="genesis/stack.md",Xn=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function Jn(e){
103
- return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!Xn.some(n=>String(e.code).startsWith(n))}function Zn(e){
104
- let{path:n="",line:t,observed:s}=e.details||{},r=Number.isSafeInteger(t)?` (line ${t}${n===Ne?" of its section":""})`:"",
105
- i=n&&(r||!e.message.includes(n))?`${n}${r}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${i}${e.message}${o}`}import*as ie from"genesis-compiler";import{randomUUID as cs}from"node:crypto";import{mkdir as us,mkdtemp as ps,readFile as ls,rename as ds,rm as It,writeFile as ms}from"node:fs/promises";
106
- import hs from"node:os";import Pe from"node:path";function F(e){return String(e||"").trim()}var Qn=Object.freeze(["main","temporary"]),bt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
107
- "managedPreview"]),vt=Object.freeze(["managedPages"]),es=64*1024,ts=Object.freeze(["When user input is necessary, ask no\
98
+ 1),g==="kind"&&!Ne.includes(f[0])&&d(U,t,`Kind must be ${Ne.slice(0,-1).join(", ")} or ${Ne.at(-1)}.`,a+1),o[g]=f[0]}}return c(),
99
+ s.length||d(U,t,"Use a Group entry or - Nothing."),s}function It(e){return{contract:ns,status:e.status,stackHash:e.stackHash,
100
+ groups:e.status==="ready"?St(e.lines):[],diagnostics:e.diagnostics||[]}}var Ci=Object.freeze({parseVibe64ArchitectureLayoutLines:St});import{existsSync as Sn}from"node:fs";import{readFile as Nr}from"node:fs/promises";import{createRequire as Cr}from"node:module";
101
+ import B from"node:path";var ss="STACK_PROJECT_CONTRACTS_INCOMPLETE",Tt="STACK_SECTION_AMBIGUOUS",rs=Object.freeze([ss,Tt]);function is(e){return rs.
102
+ includes(String(e?.code||"").trim())}var Ce="genesis/stack.md",os=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function as(e){
103
+ return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!os.some(n=>String(e.code).startsWith(n))}function cs(e){
104
+ let{path:n="",line:t,observed:s}=e.details||{},r=Number.isSafeInteger(t)?` (line ${t}${n===Ce?" of its section":""})`:"",
105
+ i=n&&(r||!e.message.includes(n))?`${n}${r}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${i}${e.message}${o}`}import*as oe from"genesis-compiler";import{randomUUID as ys}from"node:crypto";import{mkdir as bs,mkdtemp as vs,readFile as ws,rename as Ss,rm as At,writeFile as Is}from"node:fs/promises";
106
+ import Ts from"node:os";import De from"node:path";function x(e){return String(e||"").trim()}var us=Object.freeze(["main","temporary"]),kt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
107
+ "managedPreview"]),_t=Object.freeze(["managedPages"]),ps=64*1024,ls=Object.freeze(["When user input is necessary, ask no\
108
108
  more than three concise, high-impact questions at once.","Put multiple questions on separate lines as `[1] Question`, `\
109
109
  [2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answers:` and a short bullet list dir\
110
110
  ectly beneath its own question, before the next one; never collect several questions' answers into one trailing list.","\
@@ -117,7 +117,7 @@ Possible answers:
117
117
  [2] Tell the main agent before changes?
118
118
  Possible answers:
119
119
  - Yes, tell main first
120
- - No, proceed independently`]),ns=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
120
+ - No, proceed independently`]),ds=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
121
121
  start a duplicate or replacement server. If it is unavailable, report that blocker. Describe only rendered browser evide\
122
122
  nce.","When adopting an authenticated app, or when its login blocks Preview inspection, inspect identity support/names w\
123
123
  ith `vibe64-helper preview status`; prefer `vibe64-helper preview browser identity <configured-name>` to requesting pass\
@@ -132,555 +132,579 @@ eview-identities`), then verify each with `vibe64-helper preview browser identit
132
132
  s per-run enable flag and secret. Do not create users, change roles, reset passwords or weaken production auth for impor\
133
133
  t. If choices are deferred/declined, say access stays unconfigured and continue independent setup work without repeated \
134
134
  credential requests. Public/non-web apps need no adapter.","Use `vibe64-helper preview status`, `screenshot`, `logs`, an\
135
- d `browser eval` (Playwright code on stdin) for rendered inspection.","The top Preview toolbar Stop and `vibe64-helper p\
136
- review stop` stop this session's application and managed browser, not chat or source. Status reports the saved stopped c\
137
- hoice. A status read, screenshot, browser inspection, source edit or session reopening is not permission to restart it; \
138
- use `vibe64-helper preview ensure --wait` only for a deliberate Start. Scoped browser tests restore the prior stopped ch\
139
- oice.","For interactive navigation, use the proxy URL from `vibe64-helper preview inspect-url` or status `currentPage.ur\
140
- l` / `endpoints.browser.url`. Inside browser eval, use `await page.goto(new URL('/your-path', preview.url).href)`. The d\
141
- irect application endpoint under diagnostics bypasses Preview identity and is not a browser-navigation URL.","Use the ma\
142
- naged preview browser for interactive browsing and `vibe64-helper playwright` only for an existing configured project su\
143
- ite; never install another browser. Pin `@playwright/test` exactly to the `platformVersion` that `vibe64-helper playwrig\
144
- ht readiness` reports. The login state belongs to the host: pass `process.env.PLAYWRIGHT_STORAGE_STATE` unchanged to `us\
145
- e.storageState`, and never read, parse or edit that file or its cookies in the Playwright config (`vibe64-helper playwri\
146
- ght` refuses such a config). If tests run signed out with it, that is a host defect: report it with the evidence; do not\
147
- work around it.","For browser evidence, batch related actions and assertions, return only needed values and inspect rel\
148
- evant locators or regions; screenshot at meaningful checkpoints or failures, not after every click. Reuse the managed br\
149
- owser when isolation permits, keep required viewport, identity and security checks, and use existing automated cases for\
150
- repeat verification.","For browser tests that write or reset data, inspect `vibe64-helper preview targets --json` and t\
151
- he project's `genesis/stack.md` Outputs. Run `vibe64-helper playwright --target <declared-test-target> test <suite argum\
152
- ents>` (or `npm-run <script>` in place of `test`). Vibe64 starts that web target, waits for readiness, uses its declared\
153
- application identity, and restores the previous Preview when the command finishes or is cancelled; report restoration f\
154
- ailures.","A target name is not proof of test isolation. Before running a destructive suite, the application must verify\
155
- the server's actual test database and suppress real email, invoices, payments, and other external effects. Keep managed\
156
- Env unchanged. The test launcher and its preview-identity command must use the same database. Follow the application's \
157
- declared test resources and never invent a database name. Never spoof safety checks by changing only the test runner's e\
158
- nvironment.","If no suitable test target exists, add one through the project's existing Outputs contract and application\
159
- -owned test scripts within authorized scope; normal Preview stays the default. Validate the exact disposable database be\
160
- fore resetting it, prepare fixtures before reporting readiness, and make Playwright use PLAYWRIGHT_BASE_URL (the started\
161
- target's URL) without starting another server. If test resources or external-effect controls are missing, report that b\
162
- locker. `vibe64-helper preview ensure --target <id> --wait --json` deliberately selects an interactive target until chan\
163
- ged. If browser startup is slow, measure migrations, fixtures and server startup before retrying or extending deadlines.",
164
- "Keep test output small: run relevant files/cases, save stdout/stderr to local artifacts and keep exit status. Report co\
165
- unts, duration, failed cases, actionable errors and artifact paths, reading only needed failure excerpts. Retain startup\
166
- , resource and Preview-restoration errors even if tests pass, and trailing wrapper diagnostics separately from JSON. Do \
167
- not rerun for output or reread unchanged logs.","Batch related browser tests in one managed suite (one Preview switch an\
168
- d restore). Suites and live Preview actions are sequential: no browser actions, ensure/restart or target changes during \
169
- a suite or restoration. Wait on the original execution, including background runs, through cleanup/restoration (empty po\
170
- lls: yield_time_ms: 30000 where supported; shorter only for interactive input); read-only status/logs stay available. Be\
171
- fore live inspection, confirm `vibe64-helper playwright status` shows no active run and `vibe64-helper preview status` i\
172
- s ready on the restored target. To stop, run `vibe64-helper playwright cancel <run-id>`, which waits for cleanup/restora\
173
- tion; retry if cleanup needs attention. Never kill test/Preview PIDs or change locks; launcher exit alone does not prove\
174
- tests stopped. Recheck status before reporting a busy blocker.","If a managed command reports kernel task denials or a \
175
- resource incident, report the blocker with its diagnostic and incident ID and ask the platform operator to inspect that \
176
- evidence before retrying; never raise test timeouts or weaken assertions to work around a process/thread limit. A generi\
177
- c browser timeout without resource evidence does not establish a platform cause."]),ss=Object.freeze(['Pages: `vibe64-he\
178
- lper pages publish <file.html|folder> [--title "Title"]` publishes an HTML page (one file, or a folder with index.html a\
179
- nd its own scripts, styles, data and images) that everyone with access to this project can open from Vibe64\'s Pages list\
180
- ; `vibe64-helper pages update <page-id> <file.html|folder>` gives a page a new version under the same link (it keeps ten\
181
- ; `vibe64-helper pages revert <page-id> <version>` brings one back); `vibe64-helper pages list` lists them. A page runs \
182
- sandboxed and loads only its own files, never other addresses, CDNs or Vibe64 itself, so ship every script, style and da\
183
- ta file inside it. Write page files outside the repository (for example in VIBE64_DROP_ZONE) unless they belong there. G\
184
- ive the printed link in the chat as a Markdown link; Vibe64 shows it as a card.',"Before writing a page, read `vibe64-he\
185
- lper pages guide` in full and follow it: link `_vibe64/page.css` and build from its components (a header, summary tiles \
186
- first, sections of cards, status pills, tables for comparisons, inline SVG charts), never a wall of text.",'After answer\
187
- ing with a report, comparison, status or progress overview, dashboard, diagram, plan or review, end the reply with a one\
188
- -line offer, such as "Want this as a page everyone on the project can open?" (or, when a related page exists, offer to a\
189
- dd it there). Make or change a page only once they say yes.',"When the person says the result is for other people (a col\
190
- league, the team, a client, a manager, a meeting) or that they will come back to it, make the page without asking and gi\
191
- ve its link.","When a page's content will change over time (test results, progress, metrics), say the page can be kept u\
192
- p to date. When the person wants that, build it as the guide's \"A page that keeps itself up to date\" says: index.html fo\
193
- r the layout, data.json for the numbers, then `vibe64-helper pages refresh <page-id>` with --every or --daily. Choose --\
194
- command with a small script that writes data.json, which needs no AI, whenever a script can gather the data; use --promp\
195
- t only when gathering it needs judgement.","Before making a page, check `vibe64-helper pages list`: when a page about th\
196
- e same subject already exists, update it instead of making a new one.","Do not offer pages for quick answers, code chang\
197
- es, or documents that belong in the repository. Offer at most once per topic; do not nag.","Everyone with access to the \
198
- project can open a page: never put secrets in one, or anything not every project member should see."]),rs=Object.freeze(
199
- ["Each managed shell command receives current development Env from Vibe64, including declared resource bindings; use the\
200
- m in ordinary commands. Do not build environment injection or copy managed credentials into source. Resource provisionin\
201
- g and application migrations remain separate preparation steps.","Use `vibe64-helper env status [development|production|\
202
- all]` to inspect configured key names without revealing values.","Pipe an available value to `vibe64-helper env set <dev\
203
- elopment|production> <KEY> [--secret]`; never put values in arguments, logs, or repository files. Use empty stdin only w\
204
- hen the user requested an empty value. The host decides whose session may change production values; when it refuses, rep\
205
- ort its message instead of retrying.","When the person refers to a saved key, account or accounts hub, run `vibe64-helpe\
206
- r env saved` (names, descriptions and fields, never values) and link the matching field to the variable the application \
207
- reads with `vibe64-helper env link <development|production> <KEY> <saved-id> <field-id>` instead of asking for the value\
208
- .","Keep development and production values separate. Never invent credentials, copy a value between scopes without expli\
209
- cit direction, or edit Vibe64 runtime/session storage.","After an Env mutation, report only the affected scope and key n\
210
- ames, never their values, and claim success only when the command succeeded.","Store a secret the application needs gene\
211
- rated (such as an application key) by generating it with the framework's own generator and piping it to `vibe64-helper e\
212
- nv set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that file from Env."]);function wt(e,n){
213
- if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${n} must be an object.`);return e}function Ce(e,n,t){let s=new Set(
214
- n),r=Object.keys(e).filter(i=>!s.has(i));if(r.length>0)throw new TypeError(`${t} contains unsupported fields: ${r.join("\
215
- , ")}.`)}function St(e){if(Ce(e,["conversationKind","scope","session","hostGuidance"],"Vibe64 session context"),e.hostGuidance!==
216
- void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"utf8")>1024))throw new TypeError("Vibe64 hos\
217
- t guidance must be bounded text supplied by the host.");if(!Qn.includes(e.conversationKind))throw new TypeError("Vibe64 \
218
- session context has an unknown conversationKind.");let n=wt(e.session,"Vibe64 session capabilities");Ce(n,[...bt,...vt],
219
- "Vibe64 session capabilities");let t=Object.fromEntries(bt.map(s=>{if(typeof n[s]!="boolean")throw new TypeError(`Vibe64\
220
- session capability ${s} must be boolean.`);return[s,n[s]]}));for(let s of vt){if(n[s]!==void 0&&typeof n[s]!="boolean")
221
- throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);n[s]===!0&&(t[s]=!0)}return{conversationKind:e.conversationKind,
222
- scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:t}}function is(e){Ce(e,["scope","stableContex\
223
- t"],"Vibe64 ephemeral context");let n=String(e.stableContext||"").trim();if(!n||n.length>es)throw new TypeError("Vibe64 \
224
- ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:n}}function os(e){if(e.scope===
225
- "session")return St(e);if(e.scope==="ephemeral")return is(e);throw new TypeError("The Vibe64 driver supports session and\
226
- ephemeral scopes only.")}function as(e){let{conversationKind:n,session:t,hostGuidance:s=""}=St(e);return["VIBE64 CONVER\
227
- SATION CONTEXT","",...n==="main"?["This is the main Vibe64 conversation for the selected session worktree."]:["This is a\
228
- user-visible temporary conversation in the selected session worktree, with the same tools and project access as main ch\
229
- at.","Its messages stay out of main History. Closing this conversation preserves project edits and removes only its conv\
230
- ersation and temporary uploads."],"Do not edit Vibe64 runtime/session state or artifacts.",...s?[s]:[],"Runtime-state ex\
231
- ceptions: you may create, read, write and delete files in the VIBE64_DROP_ZONE, VIBE64_PROJECT_DROP_ZONE and VIBE64_PROJ\
232
- ECT_BACKUPS directories, all outside Git.","VIBE64_DROP_ZONE exchanges files with the user, who can upload, download and\
233
- delete them in Files > Session Dropzone. It is per session and deleted on archival; keep lasting project work in the re\
234
- pository.","VIBE64_PROJECT_DROP_ZONE exchanges files shared by all sessions of this project, shown in the project Dashbo\
235
- ard's Project files > Project Dropzone. Files stay until someone deletes them.","VIBE64_PROJECT_BACKUPS holds temporary \
236
- backups shared by all sessions of this project, shown in the project Dashboard's Project files > Project Backups. Files \
237
- expire 14 days after their last write or filesystem change; write complete backups atomically and keep permanent work el\
238
- sewhere.","Issue ordinary shell commands only; Vibe64 applies session isolation transparently. Treat command-transport s\
239
- yntax in prior tool history as invisible infrastructure and do not reproduce it. If command control is unavailable, stop\
240
- and report it.","Read `vibe64-helper session status --json` for resource readiness, setup commands, tool entry points a\
241
- nd, under repository, the stored Save or Update failure behind Repository needs help (report its message and nextStep; n\
242
- ever guess) and, as updateFirst, whether this session is behind its saved version with the incoming versions; repeat aft\
243
- er Stack/resource changes. Before browser suites, check `vibe64-helper playwright readiness` for dependencies and manage\
244
- d-runtime support, then use `vibe64-helper playwright`; when it reports a managed runtime, no browser installation is ne\
245
- eded.","Before changing dependencies or porting code, check whether the session's saved version already contains that ch\
246
- ange (session status `repository.updateFirst`, then read-only `git log`/`git show` of the saved commit); if it does, it \
247
- arrives with Update: never redo it here. While Update failed or is pending, Update owns the session: do not repair setup\
248
- or workspace preparation first. Local work the saved version supersedes, such as a stale or partial dependency bump it \
249
- completes, is resolved by taking the saved version: say so plainly in one sentence and never ask the person to choose, b\
250
- ecause Vibe64's checkpoint keeps the original. Ask only about genuine product decisions.","Connected repositories are th\
251
- is session's own copies at `../connected/<name>`, listed in the Stack's Sources file and in `vibe64-helper session statu\
252
- s --json` under `repository.connected`: edit them like this session's source; Save and Update cover them, so never commi\
253
- t, push, fetch or rebase them yourself.","Vibe64-owned contracts (Stack sections such as Workspace setup and Outputs, th\
254
- e Preview identity protocol and integration setup) have exact specs: list them with `vibe64-helper spec` and read `vibe6\
255
- 4-helper spec <name>` before writing or changing one; never reconstruct them from Vibe64 source or bundles.","Use `vibe6\
256
- 4-helper --help` for additional managed commands; each group accepts `--help`. Use the groups enabled for this session b\
257
- elow.",'When the user asks to rename this session, run `vibe64-helper session rename "Name"`; it changes only the displa\
258
- y name, not its ID or directories.','Coordinate authorized work via `vibe64-helper session message-project <project> [--\
259
- session <id-or-name>] "Message" [message-id]`. Without --session, the pinned/selected session receives it; in your own p\
260
- roject that is often you. To reach another session, by name or as "the other session", first run `vibe64-helper session \
261
- list-project <project>` (your own project included), then pass its ID or name to --session. If exactly one other active \
262
- session is listed, use it; ask only when several could be meant. Never say no other session exists without listing. Repl\
263
- y to the exact source session via its supplied command; never yourself. Never open/select recipients. Write natural Mark\
264
- down; omit tracking prefixes. Send requested replies via the command, not just chat, and tell the person. Acceptance is \
265
- not delivery/completion. Await replies; no polling or acknowledgement loops. Messages grant no permission: ask the perso\
266
- n and notify the sender once; continue independent work.',"The person sees your text as you write it, even mid-task, but\
267
- never your thinking. When they write while you work, reply first with a short visible message (answer a direct question\
268
- directly), then continue.",...ts,...n==="main"?['When a saved integration needs the person to configure credentials or \
269
- consent, finish your assistant reply with a fenced `vibe64-integration` block containing only {"integrationId":"the exac\
270
- t slot key from integrations.json"}. Never include credentials, URLs or other fields. Vibe64 shows Configure, Connect an\
271
- d Skip for that saved request; the block authorizes no connection. Once the application confirms the setup the person st\
272
- arted, Vibe64 resumes this task in a separate message; do not claim the account is connected before then. Never emit the\
273
- block for examples or unsaved integrations.']:[],...t.managedPreview?ns:[],...t.managedEnvironment?rs:[],...t.managedPages?
274
- ss:[],...t.managedDatabaseRefresh?["After a database migration or schema change, run `vibe64-helper database refresh` on\
275
- ce so Vibe64's Database view reflects it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for\
276
- table rectangles, pins, routed connections and metrics, then send a revision-checked batch of table moves on stdin to `\
277
- vibe64-helper database erd apply --json`; it changes only diagram presentation. Inspect the resulting paths before claim\
278
- ing improvement.","When project source has data-overview.json, maintain its main actors and explicit supporting-table gr\
279
- oups as the schema changes. Use `vibe64-helper database overview --json` for the current schema, grouping, coverage and \
280
- exact format instructions. Preserve authored groupings, classify new tables, fix renamed/removed references, and check c\
281
- overage afterward. When asked to create a Data overview, use the same command and relevant application source; no one-ho\
282
- p membership rule applies. Never invent foreign keys or cardinalities."]:[],...t.managedGit?["Use the managed `git` and \
283
- `gh` commands on PATH. Do not bypass them with host binaries, a stripped PATH, or alternate credentials.","For attachmen\
284
- ts and inline images that GitHub stores for issues (tickets), pull requests or comments, use authenticated managed `gh a\
285
- pi` with the original attachment URL, save the response to a local file and inspect it before reporting its contents. Ne\
286
- ver use unauthenticated curl/wget, User-Agent experiments or extracted credentials; an unauthenticated 404 does not prov\
287
- e a private attachment is missing.","After changing GitHub issues, comments, labels or pull requests, run `vibe64-helper\
288
- github refresh` once so Vibe64's Issues/PR view reflects it.","When linking an issue in this project's repository, run \
289
- `vibe64-helper github issue-link <number>` and use its returned Vibe64 path exactly, including the /app prefix, as the p\
290
- rimary Markdown link destination; it navigates in-app. You may include the GitHub URL as a secondary link. Never guess t\
291
- he project slug or host; issues in other repositories keep their GitHub links.","Report authentication or transport fail\
292
- ures directly; do not inspect credentials or invent another login path.","When a managed Git/GitHub command fails, tell \
293
- the user which requested action failed, which earlier work is confirmed complete, what remains undone or unconfirmed, an\
294
- d the next safe action. Retain the reported failure stage, execution budget and execution reference when provided; do no\
295
- t expose credentials or dump raw output unnecessarily.","A timeout or transport failure does not establish invalid authe\
296
- ntication, exhausted AI quota, a GitHub outage or a suspension problem. Separate recorded facts from hypotheses; say the\
297
- cause is unknown when it is unproven. Recommend reconnection only when the reported error explicitly calls for it.","If\
298
- the diagnostic says commandSubmitted=false, the requested Git/GitHub action was not attempted. After an execution timeo\
299
- ut, lost response or unreadable response, its effects are unconfirmed: use a read-only check of the affected Git/GitHub \
300
- state before repeating any write. Never claim that a comment was posted or not posted, or that a push succeeded or faile\
301
- d, from those errors alone. If verification is unavailable, report the outcome as unknown and stop; do not repeat the wr\
302
- ite or claim a safe rollback."]:[]].join(`
303
- `)}function ee(e={}){let n=wt(e,"Vibe64 driver input"),t=os(n);return t.scope==="session"?as(t):t.stableContext}async function Tt(e=""){let n=e||await ps(Pe.join(hs.tmpdir(),"vibe64-genesis-context-"));await us(n,{recursive:!0,mode:448});
304
- let t=Pe.join(n,"sessions.json"),s=new Map;try{let p=JSON.parse(await ls(t,"utf8"));for(let m of p.sessions)ee(m.promptContext),
305
- s.set(m.upstreamSessionId,m)}catch(p){if(p.code!=="ENOENT")throw p}let r=Promise.resolve(),i=!1;async function o(p){let m=Pe.
306
- join(n,`.sessions.${process.pid}.${cs()}.tmp`);try{await ms(m,JSON.stringify({sessions:[...p.values()]}),{flag:"wx",mode:384}),
307
- await ds(m,t)}finally{await It(m,{force:!0})}}await o(s);function u(p){return structuredClone(s.get(p))}async function a(p,m,l=""){
135
+ d `browser eval` (Playwright code on stdin) for rendered inspection.","When the person asks to see a page of the app, ru\
136
+ n `vibe64-helper preview open <path>` with its path inside the app (for example `/orders/42?tab=notes`): it moves the Pr\
137
+ eview they have open to that page and says the AI opened it. Your managed browser is a separate copy and never moves the\
138
+ ir pane. If it reports `moved: 0`, give them the path to type into the Preview address box.","The top Preview toolbar St\
139
+ op and `vibe64-helper preview stop` stop this session's application and managed browser, not chat or source. Status repo\
140
+ rts the saved stopped choice. A status read, screenshot, browser inspection, source edit or session reopening is not per\
141
+ mission to restart it; use `vibe64-helper preview ensure --wait` only for a deliberate Start. Scoped browser tests resto\
142
+ re the prior stopped choice.","For interactive navigation, use the proxy URL from `vibe64-helper preview inspect-url` or\
143
+ status `currentPage.url` / `endpoints.browser.url`. Inside browser eval, use `await page.goto(new URL('/your-path', pre\
144
+ view.url).href)`. The direct application endpoint under diagnostics bypasses Preview identity and is not a browser-navig\
145
+ ation URL.","Use the managed preview browser for interactive browsing and `vibe64-helper playwright` only for an existin\
146
+ g configured project suite; never install another browser. Pin `@playwright/test` exactly to the `platformVersion` that \
147
+ `vibe64-helper playwright readiness` reports. The login state belongs to the host: pass `process.env.PLAYWRIGHT_STORAGE_\
148
+ STATE` unchanged to `use.storageState`, and never read, parse or edit that file or its cookies in the Playwright config \
149
+ (`vibe64-helper playwright` refuses such a config). If tests run signed out with it, that is a host defect: report it wi\
150
+ th the evidence; do not work around it.","For browser evidence, batch related actions and assertions, return only needed\
151
+ values and inspect relevant locators or regions; screenshot at meaningful checkpoints or failures, not after every clic\
152
+ k. Reuse the managed browser when isolation permits, keep required viewport, identity and security checks, and use exist\
153
+ ing automated cases for repeat verification.","For browser tests that write or reset data, inspect `vibe64-helper previe\
154
+ w targets --json` and the project's `genesis/stack.md` Outputs. Run `vibe64-helper playwright --target <declared-test-ta\
155
+ rget> test <suite arguments>` (or `npm-run <script>` in place of `test`). Vibe64 starts that web target, waits for readi\
156
+ ness, uses its declared application identity, and restores the previous Preview when the command finishes or is cancelle\
157
+ d; report restoration failures.","A target name is not proof of test isolation. Before running a destructive suite, the \
158
+ application must verify the server's actual test database and suppress real email, invoices, payments, and other externa\
159
+ l effects. Keep managed Env unchanged. The test launcher and its preview-identity command must use the same database. Fo\
160
+ llow the application's declared test resources and never invent a database name. Never spoof safety checks by changing o\
161
+ nly the test runner's environment.","If no suitable test target exists, add one through the project's existing Outputs c\
162
+ ontract and application-owned test scripts within authorized scope; normal Preview stays the default. Validate the exact\
163
+ disposable database before resetting it, prepare fixtures before reporting readiness, and make Playwright use PLAYWRIGH\
164
+ T_BASE_URL (the started target's URL) without starting another server. If test resources or external-effect controls are\
165
+ missing, report that blocker. `vibe64-helper preview ensure --target <id> --wait --json` deliberately selects an intera\
166
+ ctive target until changed. If browser startup is slow, measure migrations, fixtures and server startup before retrying \
167
+ or extending deadlines.","Keep test output small: run relevant files/cases, save stdout/stderr to local artifacts and ke\
168
+ ep exit status. Report counts, duration, failed cases, actionable errors and artifact paths, reading only needed failure\
169
+ excerpts. Retain startup, resource and Preview-restoration errors even if tests pass, and trailing wrapper diagnostics \
170
+ separately from JSON. Do not rerun for output or reread unchanged logs.","Batch related browser tests in one managed sui\
171
+ te (one Preview switch and restore). Suites and live Preview actions are sequential: no browser actions, ensure/restart \
172
+ or target changes during a suite or restoration. Wait on the original execution, including background runs, through clea\
173
+ nup/restoration (empty polls: yield_time_ms: 30000 where supported; shorter only for interactive input); read-only statu\
174
+ s/logs stay available. Before live inspection, confirm `vibe64-helper playwright status` shows no active run and `vibe64\
175
+ -helper preview status` is ready on the restored target. To stop, run `vibe64-helper playwright cancel <run-id>`, which \
176
+ waits for cleanup/restoration; retry if cleanup needs attention. Never kill test/Preview PIDs or change locks; launcher \
177
+ exit alone does not prove tests stopped. Recheck status before reporting a busy blocker.","If a managed command reports \
178
+ kernel task denials or a resource incident, report the blocker with its diagnostic and incident ID and ask the platform \
179
+ operator to inspect that evidence before retrying; never raise test timeouts or weaken assertions to work around a proce\
180
+ ss/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),ms=Object.freeze(
181
+ ['Pages: `vibe64-helper pages publish <file.html|folder> [--title "Title"]` publishes an HTML page (one file, or a folde\
182
+ r with index.html and its own scripts, styles, data and images) that everyone with access to this project can open from \
183
+ Vibe64\'s Pages list; `vibe64-helper pages update <page-id> <file.html|folder>` gives a page a new version under the same\
184
+ link (it keeps ten; `vibe64-helper pages revert <page-id> <version>` brings one back); `vibe64-helper pages list` lists\
185
+ them. A page runs sandboxed and loads only its own files, never other addresses, CDNs or Vibe64 itself, so ship every s\
186
+ cript, style and data file inside it. Write page files outside the repository (for example in VIBE64_DROP_ZONE) unless t\
187
+ hey belong there. Give the printed link in the chat as a Markdown link; Vibe64 shows it as a card.',"Before writing a pa\
188
+ ge, read `vibe64-helper pages guide` in full and follow it: link `_vibe64/page.css` and build from its components (a hea\
189
+ der, summary tiles first, sections of cards, status pills, tables for comparisons, inline SVG charts), never a wall of t\
190
+ ext.",'After answering with a report, comparison, status or progress overview, dashboard, diagram, plan or review, end t\
191
+ he reply with a one-line offer, such as "Want this as a page everyone on the project can open?" (or, when a related page\
192
+ exists, offer to add it there). Make or change a page only once they say yes.',"When the person says the result is for \
193
+ other people (a colleague, the team, a client, a manager, a meeting) or that they will come back to it, make the page wi\
194
+ thout asking and give its link.","When a page's content will change over time (test results, progress, metrics), say the\
195
+ page can be kept up to date. When the person wants that, build it as the guide's \"A page that keeps itself up to date\" \
196
+ says: index.html for the layout, data.json for the numbers, then `vibe64-helper pages refresh <page-id>` with --every or\
197
+ --daily. Choose --command with a small script that writes data.json, which needs no AI, whenever a script can gather th\
198
+ e data; use --prompt only when gathering it needs judgement.","Before making a page, check `vibe64-helper pages list`: w\
199
+ hen a page about the same subject already exists, update it instead of making a new one.","Do not offer pages for quick \
200
+ answers, code changes, or documents that belong in the repository. Offer at most once per topic; do not nag.","Everyone \
201
+ with access to the project can open a page: never put secrets in one, or anything not every project member should see."]),
202
+ hs=Object.freeze(["Each managed shell command receives current development Env from Vibe64, including declared resource \
203
+ bindings; use them in ordinary commands. Do not build environment injection or copy managed credentials into source. Res\
204
+ ource provisioning and application migrations remain separate preparation steps.","Use `vibe64-helper env status [develo\
205
+ pment|production|all]` to inspect configured key names without revealing values.","Pipe an available value to `vibe64-he\
206
+ lper env set <development|production> <KEY> [--secret]`; never put values in arguments, logs, or repository files. Use e\
207
+ mpty stdin only when the user requested an empty value. The host decides whose session may change production values; whe\
208
+ n it refuses, report its message instead of retrying.","When the person refers to a saved key, account or accounts hub, \
209
+ run `vibe64-helper env saved` (names, descriptions and fields, never values) and link the matching field to the variable\
210
+ the application reads with `vibe64-helper env link <development|production> <KEY> <saved-id> <field-id>` instead of ask\
211
+ ing for the value.","Keep development and production values separate. Never invent credentials, copy a value between sco\
212
+ pes without explicit direction, or edit Vibe64 runtime/session storage.","After an Env mutation, report only the affecte\
213
+ d scope and key names, never their values, and claim success only when the command succeeded.","Store a secret the appli\
214
+ cation needs generated (such as an application key) by generating it with the framework's own generator and piping it to\
215
+ `vibe64-helper env set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that fi\
216
+ le from Env."]);function Ot(e,n){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${n} must be an object\
217
+ .`);return e}function Pe(e,n,t){let s=new Set(n),r=Object.keys(e).filter(i=>!s.has(i));if(r.length>0)throw new TypeError(
218
+ `${t} contains unsupported fields: ${r.join(", ")}.`)}function Rt(e){if(Pe(e,["conversationKind","scope","session","host\
219
+ Guidance"],"Vibe64 session context"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,
220
+ "utf8")>1024))throw new TypeError("Vibe64 host guidance must be bounded text supplied by the host.");if(!us.includes(e.conversationKind))
221
+ throw new TypeError("Vibe64 session context has an unknown conversationKind.");let n=Ot(e.session,"Vibe64 session capabi\
222
+ lities");Pe(n,[...kt,..._t],"Vibe64 session capabilities");let t=Object.fromEntries(kt.map(s=>{if(typeof n[s]!="boolean")
223
+ throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);return[s,n[s]]}));for(let s of _t){if(n[s]!==void 0&&
224
+ typeof n[s]!="boolean")throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);n[s]===!0&&(t[s]=!0)}return{
225
+ conversationKind:e.conversationKind,scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:t}}function fs(e){
226
+ Pe(e,["scope","stableContext"],"Vibe64 ephemeral context");let n=String(e.stableContext||"").trim();if(!n||n.length>ps)throw new TypeError(
227
+ "Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:n}}function gs(e){if(e.
228
+ scope==="session")return Rt(e);if(e.scope==="ephemeral")return fs(e);throw new TypeError("The Vibe64 driver supports ses\
229
+ sion and ephemeral scopes only.")}function Es(e){let{conversationKind:n,session:t,hostGuidance:s=""}=Rt(e);return["VIBE6\
230
+ 4 CONVERSATION CONTEXT","",...n==="main"?["This is the main Vibe64 conversation for the selected session worktree."]:["T\
231
+ his is a user-visible temporary conversation in the selected session worktree, with the same tools and project access as\
232
+ main chat.","Its messages stay out of main History. Closing this conversation preserves project edits and removes only \
233
+ its conversation and temporary uploads."],"Do not edit Vibe64 runtime/session state or artifacts.",...s?[s]:[],"Runtime-\
234
+ state exceptions: you may create, read, write and delete files in the VIBE64_DROP_ZONE, VIBE64_PROJECT_DROP_ZONE and VIB\
235
+ E64_PROJECT_BACKUPS directories, all outside Git.","VIBE64_DROP_ZONE exchanges files with the user, who can upload, down\
236
+ load and delete them in Files > Session Dropzone. It is per session and deleted on archival; keep lasting project work i\
237
+ n the repository.","VIBE64_PROJECT_DROP_ZONE exchanges files shared by all sessions of this project, shown in the projec\
238
+ t Dashboard's Project files > Project Dropzone. Files stay until someone deletes them.","VIBE64_PROJECT_BACKUPS holds te\
239
+ mporary backups shared by all sessions of this project, shown in the project Dashboard's Project files > Project Backups\
240
+ . Files expire 14 days after their last write or filesystem change; write complete backups atomically and keep permanent\
241
+ work elsewhere.","Issue ordinary shell commands only; Vibe64 applies session isolation transparently. Treat command-tra\
242
+ nsport syntax in prior tool history as invisible infrastructure and do not reproduce it. If command control is unavailab\
243
+ le, stop and report it.","Read `vibe64-helper session status --json` for resource readiness, setup commands, tool entry \
244
+ points and, under repository, the stored Save or Update failure behind Repository needs help (report its message and nex\
245
+ tStep; never guess) and, as updateFirst, whether this session is behind its saved version with the incoming versions; re\
246
+ peat after Stack/resource changes. Before browser suites, check `vibe64-helper playwright readiness` for dependencies an\
247
+ d managed-runtime support, then use `vibe64-helper playwright`; when it reports a managed runtime, no browser installati\
248
+ on is needed.","Before changing dependencies or porting code, check whether the session's saved version already contains\
249
+ that change (session status `repository.updateFirst`, then read-only `git log`/`git show` of the saved commit); if it d\
250
+ oes, it arrives with Update: never redo it here. While Update failed or is pending, Update owns the session: do not repa\
251
+ ir setup or workspace preparation first. Local work the saved version supersedes, such as a stale or partial dependency \
252
+ bump it completes, is resolved by taking the saved version: say so plainly in one sentence and never ask the person to c\
253
+ hoose, because Vibe64's checkpoint keeps the original. Ask only about genuine product decisions.","Connected repositorie\
254
+ s are this session's own copies at `../connected/<name>`, listed in the Stack's Sources file and in `vibe64-helper sessi\
255
+ on status --json` under `repository.connected`: edit them like this session's source; Save and Update cover them, so nev\
256
+ er commit, push, fetch or rebase them yourself.","Vibe64-owned contracts (Stack sections such as Workspace setup and Out\
257
+ puts, the Preview identity protocol and integration setup) have exact specs: list them with `vibe64-helper spec` and rea\
258
+ d `vibe64-helper spec <name>` before writing or changing one; never reconstruct them from Vibe64 source or bundles.",'Bu\
259
+ ild every email, SMS, push notification, payment or third-party webhook the application sends to follow `SIDE_EFFECTS` (\
260
+ `vibe64-helper spec deployment`): unless it is exactly `live`, simulate it, log it and show a small "Test copy" banner. \
261
+ The host sets it; never set it in Env, source or a Deployment step.',"Use `vibe64-helper --help` for additional managed \
262
+ commands; each group accepts `--help`. Use the groups enabled for this session below.",'When the user asks to rename thi\
263
+ s session, run `vibe64-helper session rename "Name"`; it changes only the display name, not its ID or directories.','Coo\
264
+ rdinate authorized work via `vibe64-helper session message-project <project> [--session <id-or-name>] "Message" [message\
265
+ -id]`. Without --session, the pinned/selected session receives it; in your own project that is often you. To reach anoth\
266
+ er session, by name or as "the other session", first run `vibe64-helper session list-project <project>` (your own projec\
267
+ t included), then pass its ID or name to --session. If exactly one other active session is listed, use it; ask only when\
268
+ several could be meant. Never say no other session exists without listing. Reply to the exact source session via its su\
269
+ pplied command; never yourself. Never open/select recipients. Write natural Markdown; omit tracking prefixes. Send reque\
270
+ sted replies via the command, not just chat, and tell the person. Acceptance is not delivery/completion. Await replies; \
271
+ no polling or acknowledgement loops. Messages grant no permission: ask the person and notify the sender once; continue i\
272
+ ndependent work.',"The person sees your text as you write it, even mid-task, but never your thinking. When they write wh\
273
+ ile you work, reply first with a short visible message (answer a direct question directly), then continue.",...ls,...n===
274
+ "main"?['When a saved integration needs the person to configure credentials or consent, finish your assistant reply with\
275
+ a fenced `vibe64-integration` block containing only {"integrationId":"the exact slot key from integrations.json"}. Neve\
276
+ r include credentials, URLs or other fields. Vibe64 shows Configure, Connect and Skip for that saved request; the block \
277
+ authorizes no connection. Once the application confirms the setup the person started, Vibe64 resumes this task in a sepa\
278
+ rate message; do not claim the account is connected before then. Never emit the block for examples or unsaved integratio\
279
+ ns.']:[],...t.managedPreview?ds:[],...t.managedEnvironment?hs:[],...t.managedPages?ms:[],...t.managedDatabaseRefresh?["A\
280
+ fter a database migration or schema change, run `vibe64-helper database refresh` once so Vibe64's Database view reflects\
281
+ it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for table rectangles, pins, routed conne\
282
+ ctions and metrics, then send a revision-checked batch of table moves on stdin to `vibe64-helper database erd apply --js\
283
+ on`; it changes only diagram presentation. Inspect the resulting paths before claiming improvement.","When project sourc\
284
+ e has data-overview.json, maintain its main actors and explicit supporting-table groups as the schema changes. Use `vibe\
285
+ 64-helper database overview --json` for the current schema, grouping, coverage and exact format instructions. Preserve a\
286
+ uthored groupings, classify new tables, fix renamed/removed references, and check coverage afterward. When asked to crea\
287
+ te a Data overview, use the same command and relevant application source; no one-hop membership rule applies. Never inve\
288
+ nt foreign keys or cardinalities."]:[],...t.managedGit?["Use the managed `git` and `gh` commands on PATH. Do not bypass \
289
+ them with host binaries, a stripped PATH, or alternate credentials.","For attachments and inline images that GitHub stor\
290
+ es for issues (tickets), pull requests or comments, use authenticated managed `gh api` with the original attachment URL,\
291
+ save the response to a local file and inspect it before reporting its contents. Never use unauthenticated curl/wget, Us\
292
+ er-Agent experiments or extracted credentials; an unauthenticated 404 does not prove a private attachment is missing.","\
293
+ After changing GitHub issues, comments, labels or pull requests, run `vibe64-helper github refresh` once so Vibe64's Iss\
294
+ ues/PR view reflects it.","When linking an issue in this project's repository, run `vibe64-helper github issue-link <num\
295
+ ber>` and use its returned Vibe64 path exactly, including the /app prefix, as the primary Markdown link destination; it \
296
+ navigates in-app. You may include the GitHub URL as a secondary link. Never guess the project slug or host; issues in ot\
297
+ her repositories keep their GitHub links.","Report authentication or transport failures directly; do not inspect credent\
298
+ ials or invent another login path.","When a managed Git/GitHub command fails, tell the user which requested action faile\
299
+ d, which earlier work is confirmed complete, what remains undone or unconfirmed, and the next safe action. Retain the re\
300
+ ported failure stage, execution budget and execution reference when provided; do not expose credentials or dump raw outp\
301
+ ut unnecessarily.","A timeout or transport failure does not establish invalid authentication, exhausted AI quota, a GitH\
302
+ ub outage or a suspension problem. Separate recorded facts from hypotheses; say the cause is unknown when it is unproven\
303
+ . Recommend reconnection only when the reported error explicitly calls for it.","If the diagnostic says commandSubmitted\
304
+ =false, the requested Git/GitHub action was not attempted. After an execution timeout, lost response or unreadable respo\
305
+ nse, its effects are unconfirmed: use a read-only check of the affected Git/GitHub state before repeating any write. Nev\
306
+ er claim that a comment was posted or not posted, or that a push succeeded or failed, from those errors alone. If verifi\
307
+ cation is unavailable, report the outcome as unknown and stop; do not repeat the write or claim a safe rollback."]:[]].join(
308
+ `
309
+ `)}function ee(e={}){let n=Ot(e,"Vibe64 driver input"),t=gs(n);return t.scope==="session"?Es(t):t.stableContext}async function Nt(e=""){let n=e||await vs(De.join(Ts.tmpdir(),"vibe64-genesis-context-"));await bs(n,{recursive:!0,mode:448});
310
+ let t=De.join(n,"sessions.json"),s=new Map;try{let p=JSON.parse(await ws(t,"utf8"));for(let m of p.sessions)ee(m.promptContext),
311
+ s.set(m.upstreamSessionId,m)}catch(p){if(p.code!=="ENOENT")throw p}let r=Promise.resolve(),i=!1;async function o(p){let m=De.
312
+ join(n,`.sessions.${process.pid}.${ys()}.tmp`);try{await Is(m,JSON.stringify({sessions:[...p.values()]}),{flag:"wx",mode:384}),
313
+ await Ss(m,t)}finally{await At(m,{force:!0})}}await o(s);function c(p){return structuredClone(s.get(p))}async function a(p,m,l=""){
308
314
  if(i)throw new Error("The Genesis host context registry is closed.");if(typeof p!="string"||!p.trim())throw new TypeError(
309
315
  "Genesis host context requires a native conversation ID.");let f=structuredClone(m);ee(f);let g={upstreamSessionId:p,workdir:l,
310
- promptContext:f},C=r.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(g))return;let k=new Map(s);
311
- k.set(p,g),await o(k),s=k});r=C,await C}async function c(){i=!0,await r.catch(()=>{}),s.clear(),e||await It(n,{recursive:!0,
312
- force:!0})}return Object.freeze({registryPath:t,get:u,register:a,close:c})}var kt="vibe64.application-deployment.v1",_t="Deployment",B="VIBE64_DEPLOYMENT_INVALID",fs=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
313
- xe="- Recreate on restore: ",je="- Generated secrets: ",Le="- Setup code: ",Ot=/^[A-Z_][A-Z0-9_]*$/u,De=Object.freeze({prepare:0,
314
- build:1,migrate:2,serve:3}),$e=Object.keys(De).map(e=>e[0].toUpperCase()+e.slice(1)),gs=Object.freeze(["- Workdir: `path\
315
- `","- Runtimes: `runtime`...",`${xe}\`glob\`...`,`${je}\`NAME\`...`,`${Le}\`NAME\``,"- Ready when: `GET` `/path` returns\
316
- `200`",`- ${$e.join("|")} \`label\`: \`command\` \`argument\`...`]);function w(e,n,t,s={}){d(B,e,n,t,s)}function Es(e,n,t){
317
- let s=I(e.slice(xe.length),B,n,"Deployment Recreate on restore paths",t);return s.some(r=>r.startsWith("/")||r.includes(
318
- "\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(i)))&&w(n,"Deployment Recre\
319
- ate on restore paths must be canonical project-relative globs using only * and ** wildcards.",t),new Set(s).size!==s.length&&
320
- w(n,"Deployment contains a duplicate Recreate on restore path.",t),s}function ys(e,n,t){let s=I(e.slice(je.length),B,n,"\
321
- Deployment Generated secrets",t);return s.some(r=>!Ot.test(r))&&w(n,"Deployment Generated secrets must be uppercase envi\
322
- ronment variable names.",t),new Set(s).size!==s.length&&w(n,"Deployment contains a duplicate Generated secrets name.",t),
323
- s}function bs(e,n,t){let[s]=I(e.slice(Le.length),B,n,"Deployment Setup code",t,{count:1});return Ot.test(s)||w(n,"Deploy\
324
- ment Setup code must be an uppercase environment variable name.",t),s}function vs(e,n,t){let s=R(e[3],B,n,"Deployment co\
325
- mmand",t);return s.some(r=>/\{(?:host|port)\}/u.test(r))&&w(n,"Deployment commands take no {host} or {port} placeholders\
326
- ; Serve reads HOST and PORT from its environment.",t),{label:b(e[2],B,n,"Deployment step label",t),argv:s,role:e[1].toLowerCase()}}
327
- function Ve(){return{version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecrets:[],setupCode:"",
328
- readiness:null,steps:[]}}function Rt(e,n={}){let{path:t="genesis/stack.md#Deployment"}=n;if(Array.isArray(e)||w(t,"Deplo\
329
- yment must be supplied as exact Stack section lines."),v(e))return Ve();let s=Ve(),r=new Set;for(let o=0;o<e.length;o+=1){
330
- let u=e[o].trim();if(!u)continue;let a=o+1;if(u.startsWith("- Workdir: ")){r.has("workdir")&&w(t,"Duplicate Deployment W\
331
- orkdir.",a),r.add("workdir");let p=I(u.slice(11),B,t,"Deployment Workdir",a,{count:1})[0];s.workdir=y(p,B,t,"Deployment \
332
- workdir",a);continue}if(u.startsWith("- Runtimes: ")){r.has("runtimes")&&w(t,"Duplicate Deployment Runtimes.",a),r.add("\
333
- runtimes"),s.runtimeRequirements=A(u.slice(12),B,t,"Deployment runtimes",a);continue}if(u.startsWith(xe)){r.has("restore\
334
- -paths")&&w(t,"Duplicate Deployment Recreate on restore entry.",a),r.add("restore-paths"),s.artifact.disposablePaths=Es(
335
- u,t,a);continue}if(u.startsWith(je)){r.has("generated-secrets")&&w(t,"Duplicate Deployment Generated secrets entry.",a),
336
- r.add("generated-secrets"),s.generatedSecrets=ys(u,t,a);continue}if(u.startsWith(Le)){r.has("setup-code")&&w(t,"Duplicat\
337
- e Deployment Setup code.",a),r.add("setup-code"),s.setupCode=bs(u,t,a);continue}if(u.startsWith("- Ready when: ")){r.has(
338
- "readiness")&&w(t,"Duplicate Deployment Ready when.",a),r.add("readiness"),s.readiness=ae(u,B,t,"Deployment readiness",a);
339
- continue}let c=u.match(fs);if(c){s.steps.push(vs(c,t,a));continue}w(t,$("Deployment entry",u,gs),a)}s.steps.length===0&&
340
- w(t,"## Deployment needs at least one command or exactly `- Nothing.`."),(s.steps.filter(({role:o})=>o==="serve").length!==
341
- 1||s.steps.at(-1).role!=="serve")&&w(t,"Deployment needs exactly one final Serve step.");for(let o=1;o<s.steps.length;o+=
342
- 1)De[s.steps[o].role]<De[s.steps[o-1].role]&&w(t,`Deployment steps must be ordered ${$e.slice(0,-1).join(", ")}, then ${$e.
343
- at(-1)}.`);return s.readiness||w(t,"Deployment needs one Ready when entry."),s.generatedSecrets.includes(s.setupCode)&&w(
344
- t,"Deployment Setup code is generated already; leave it out of Generated secrets."),s.artifact.disposablePaths.length>0&&
345
- !s.steps.some(({role:o})=>o==="prepare")&&w(t,"Deployment may recreate paths on restore only when it declares a Prepare \
346
- step."),s}function At({environment:e={},section:n={}}={}){H(n,e,"Deployment section");let t=[...n.diagnostics||[]],s=Ve();
347
- n.status==="ready"&&(s=Rt(n.lines));let r=t.length>0?"blocked":s.steps.length>0?"ready":"unconfigured",i={version:s.version,
348
- artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.runtimeRequirements,generatedSecrets:s.generatedSecrets,setupCode:s.
349
- setupCode,readiness:s.readiness,steps:s.steps};return{contract:kt,status:r,stackHash:n.stackHash,recipeHash:r==="ready"?
350
- O(i):"",components:[...n.components||[]],source:n.source||null,runtimeRequirements:z(s.runtimeRequirements),resources:structuredClone(
351
- e.resources||[]),...i,diagnostics:t}}var le="vibe64.packaging.v1",Vt="Packaging",$i=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
352
- de"]),j="VIBE64_PACKAGING_INVALID",ws=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ss=/^[A-Z_][A-Z0-9_]*$/u,Is=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
353
- Ts=/^[a-z][a-z0-9+.-]*$/u,ks=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,_s=/\{[^{}\s]*\}/u,
354
- Os=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Rs=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,As=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
355
- Ns=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Cs=/^- Content: package `([^`\r\n]+)`$/u,Nt=50,Ct=500,Ps=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
356
- xt=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
316
+ promptContext:f},S=r.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(g))return;let _=new Map(s);
317
+ _.set(p,g),await o(_),s=_});r=S,await S}async function u(){i=!0,await r.catch(()=>{}),s.clear(),e||await At(n,{recursive:!0,
318
+ force:!0})}return Object.freeze({registryPath:t,get:c,register:a,close:u})}var Ct="vibe64.application-deployment.v1",Pt="Deployment",L="VIBE64_DEPLOYMENT_INVALID",ks=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
319
+ Le="- Recreate on restore: ",Me="- Generated secrets: ",Ge="- Setup code: ",Ue="- Sandbox allows: ",$e=Object.freeze(["f\
320
+ use","gvisor"]),Dt=/^[A-Z_][A-Z0-9_]*$/u,$t="SIDE_EFFECTS",Vt="Deployment never sets SIDE_EFFECTS: the host gives it to \
321
+ every step, live only when the deployment's owner chose to act for real.",Ve=Object.freeze({prepare:0,build:1,migrate:2,
322
+ serve:3}),xe=Object.keys(Ve).map(e=>e[0].toUpperCase()+e.slice(1)),_s=Object.freeze(["- Workdir: `path`","- Runtimes: `r\
323
+ untime`...",`${Le}\`glob\`...`,`${Me}\`NAME\`...`,`${Ge}\`NAME\``,`${Ue}${$e.map(e=>`\`${e}\``).join(" ")}`,"- Ready whe\
324
+ n: `GET` `/path` returns `200`",`- ${xe.join("|")} \`label\`: \`command\` \`argument\`...`]);function y(e,n,t,s={}){d(L,
325
+ e,n,t,s)}function Os(e,n,t){let s=I(e.slice(Le.length),L,n,"Deployment Recreate on restore paths",t);return s.some(r=>r.
326
+ startsWith("/")||r.includes("\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(
327
+ i)))&&y(n,"Deployment Recreate on restore paths must be canonical project-relative globs using only * and ** wildcards.",
328
+ t),new Set(s).size!==s.length&&y(n,"Deployment contains a duplicate Recreate on restore path.",t),s}function Rs(e,n,t){let s=I(
329
+ e.slice(Me.length),L,n,"Deployment Generated secrets",t);return s.some(r=>!Dt.test(r))&&y(n,"Deployment Generated secret\
330
+ s must be uppercase environment variable names.",t),new Set(s).size!==s.length&&y(n,"Deployment contains a duplicate Gen\
331
+ erated secrets name.",t),s}function As(e,n,t){let[s]=I(e.slice(Ge.length),L,n,"Deployment Setup code",t,{count:1});return Dt.
332
+ test(s)||y(n,"Deployment Setup code must be an uppercase environment variable name.",t),s}function Ns(e,n,t){let s=I(e.slice(
333
+ Ue.length),L,n,"Deployment Sandbox allows",t);return s.some(r=>!$e.includes(r))&&y(n,`Deployment Sandbox allows takes on\
334
+ ly ${$e.map(r=>`\`${r}\``).join(" and ")}.`,t),new Set(s).size!==s.length&&y(n,"Deployment Sandbox allows names an allow\
335
+ ance twice.",t),[...s].sort()}function Cs(e,n,t){let s=A(e[3],L,n,"Deployment command",t);return s.some(r=>/\{(?:host|port)\}/u.
336
+ test(r))&&y(n,"Deployment commands take no {host} or {port} placeholders; Serve reads HOST and PORT from its environment\
337
+ .",t),s.some(r=>r.startsWith(`${$t}=`))&&y(n,Vt,t),{label:v(e[2],L,n,"Deployment step label",t),argv:s,role:e[1].toLowerCase()}}
338
+ function je(){return{version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecrets:[],setupCode:"",
339
+ sandboxAllowances:[],readiness:null,steps:[]}}function xt(e,n={}){let{path:t="genesis/stack.md#Deployment"}=n;if(Array.isArray(
340
+ e)||y(t,"Deployment must be supplied as exact Stack section lines."),w(e))return je();let s=je(),r=new Set;for(let o=0;o<
341
+ e.length;o+=1){let c=e[o].trim();if(!c)continue;let a=o+1;if(c.startsWith("- Workdir: ")){r.has("workdir")&&y(t,"Duplica\
342
+ te Deployment Workdir.",a),r.add("workdir");let p=I(c.slice(11),L,t,"Deployment Workdir",a,{count:1})[0];s.workdir=b(p,L,
343
+ t,"Deployment workdir",a);continue}if(c.startsWith("- Runtimes: ")){r.has("runtimes")&&y(t,"Duplicate Deployment Runtime\
344
+ s.",a),r.add("runtimes"),s.runtimeRequirements=N(c.slice(12),L,t,"Deployment runtimes",a);continue}if(c.startsWith(Le)){
345
+ r.has("restore-paths")&&y(t,"Duplicate Deployment Recreate on restore entry.",a),r.add("restore-paths"),s.artifact.disposablePaths=
346
+ Os(c,t,a);continue}if(c.startsWith(Me)){r.has("generated-secrets")&&y(t,"Duplicate Deployment Generated secrets entry.",
347
+ a),r.add("generated-secrets"),s.generatedSecrets=Rs(c,t,a);continue}if(c.startsWith(Ge)){r.has("setup-code")&&y(t,"Dupli\
348
+ cate Deployment Setup code.",a),r.add("setup-code"),s.setupCode=As(c,t,a);continue}if(c.startsWith(Ue)){r.has("sandbox-a\
349
+ llows")&&y(t,"Duplicate Deployment Sandbox allows.",a),r.add("sandbox-allows"),s.sandboxAllowances=Ns(c,t,a);continue}if(c.
350
+ startsWith("- Ready when: ")){r.has("readiness")&&y(t,"Duplicate Deployment Ready when.",a),r.add("readiness"),s.readiness=
351
+ ce(c,L,t,"Deployment readiness",a);continue}let u=c.match(ks);if(u){s.steps.push(Cs(u,t,a));continue}y(t,D("Deployment e\
352
+ ntry",c,_s),a)}s.steps.length===0&&y(t,"## Deployment needs at least one command or exactly `- Nothing.`."),(s.steps.filter(
353
+ ({role:o})=>o==="serve").length!==1||s.steps.at(-1).role!=="serve")&&y(t,"Deployment needs exactly one final Serve step.");
354
+ for(let o=1;o<s.steps.length;o+=1)Ve[s.steps[o].role]<Ve[s.steps[o-1].role]&&y(t,`Deployment steps must be ordered ${xe.
355
+ slice(0,-1).join(", ")}, then ${xe.at(-1)}.`);return s.readiness||y(t,"Deployment needs one Ready when entry."),[...s.generatedSecrets,
356
+ s.setupCode].includes($t)&&y(t,Vt),s.generatedSecrets.includes(s.setupCode)&&y(t,"Deployment Setup code is generated alr\
357
+ eady; leave it out of Generated secrets."),s.artifact.disposablePaths.length>0&&!s.steps.some(({role:o})=>o==="prepare")&&
358
+ y(t,"Deployment may recreate paths on restore only when it declares a Prepare step."),s}function jt({environment:e={},section:n={}}={}){
359
+ H(n,e,"Deployment section");let t=[...n.diagnostics||[]],s=je();n.status==="ready"&&(s=xt(n.lines));let r=t.length>0?"bl\
360
+ ocked":s.steps.length>0?"ready":"unconfigured",i={version:s.version,artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.
361
+ runtimeRequirements,generatedSecrets:s.generatedSecrets,setupCode:s.setupCode,sandboxAllowances:s.sandboxAllowances,readiness:s.
362
+ readiness,steps:s.steps};return{contract:Ct,status:r,stackHash:n.stackHash,recipeHash:r==="ready"?R(i):"",components:[...n.
363
+ components||[]],source:n.source||null,runtimeRequirements:z(s.runtimeRequirements),resources:structuredClone(e.resources||
364
+ []),...i,diagnostics:t}}var de="vibe64.packaging.v1",Wt="Packaging",Fi=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
365
+ de"]),j="VIBE64_PACKAGING_INVALID",Ps=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ds=/^[A-Z_][A-Z0-9_]*$/u,$s=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
366
+ Vs=/^[a-z][a-z0-9+.-]*$/u,xs=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,js=/\{[^{}\s]*\}/u,
367
+ Ls=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Ms=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,Gs=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
368
+ Us=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Bs=/^- Content: package `([^`\r\n]+)`$/u,Lt=50,Mt=500,Ws=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
369
+ Ht=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
357
370
  "versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
358
371
  prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
359
372
  ect.toml","external"]}),"web-bundle":Object.freeze({entries:["workdir","runtimes","prepare","build","environment","outpu\
360
373
  t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({entries:["workdir","content","platforms","a\
361
374
  pplicationId","name","icon","versionFrom","deepLinkSchemeFrom","appLinkDomainsFrom","permission"],required:["content","p\
362
- latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),pe=Object.freeze(Object.
363
- keys(xt)),Me=Object.freeze(["android"]),Ge=Object.freeze(["package.json","pyproject.toml","external"]),q=e=>e.map(n=>`\`${n}\
364
- \``).join(" | "),X=Object.freeze([["- Packer: ","packer",`- Packer: ${q(pe)}`],["- Workdir: ","workdir","- Workdir: `pat\
375
+ latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),le=Object.freeze(Object.
376
+ keys(Ht)),Be=Object.freeze(["android"]),We=Object.freeze(["package.json","pyproject.toml","external"]),q=e=>e.map(n=>`\`${n}\
377
+ \``).join(" | "),X=Object.freeze([["- Packer: ","packer",`- Packer: ${q(le)}`],["- Workdir: ","workdir","- Workdir: `pat\
365
378
  h`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from:\
366
- ","versionFrom",`- Version from: ${q(Ge)}`],["- Platforms: ","platforms",`- Platforms: ${q(Me)}...`],["- Id: ","applica\
379
+ ","versionFrom",`- Version from: ${q(We)}`],["- Platforms: ","platforms",`- Platforms: ${q(Be)}...`],["- Id: ","applica\
367
380
  tionId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/icon\
368
381
  -1024.png`"],["- Deep link scheme from: ","deepLinkSchemeFrom","- Deep link scheme from: `ENV_NAME`"],["- App link domai\
369
- ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),Pt="### Package `id`: Label",Ds=Object.freeze([
382
+ ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),Gt="### Package `id`: Label",Hs=Object.freeze([
370
383
  X[0][2],X[1][2],X[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",X[3][2],X[4][2],
371
- "- Content: package `web-bundle-id`",...X.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),te=Object.
384
+ "- Content: package `web-bundle-id`",...X.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),ne=Object.
372
385
  freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Environment",
373
386
  output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Name",icon:"\
374
387
  Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permission"});function E(e,n,t){
375
- d(j,e,n,t)}function Ue(e,n,t,s){let r=b(e,j,n,t,s);return ws.test(r)||E(n,`${t} must use lowercase letters, digits, and \
376
- single hyphens.`,s),r}function $s(e,n,t,s,r){return I(e.slice(n.length),j,t,s,r,{count:1})[0]}function Be(e,n,t,s){return e.
377
- some(r=>_s.test(r))&&E(n,`${t} takes no placeholders in ${le}.`,s),e}function jt(e,n,t,s){return Ss.test(e)||E(n,`${t} m\
378
- ust be an uppercase environment variable name.`,s),e}function Dt(e,n,t,s,r){e.seen.has(n)&&E(s,`Package ${e.id} has a du\
379
- plicate ${te[n]} entry.`,r),e.seen.add(n),e.fields[n]=t,e.lines[n]=r}function Vs(e,n,t,s,r){let i=`Packaging ${te[e]}`;if(e===
380
- "runtimes")return A(n.slice(t.length),j,s,i,r);if(e==="platforms"){let u=I(n.slice(t.length),j,s,i,r);return u.some(a=>!Me.
381
- includes(a))&&E(s,`${i} must be ${q(Me)}.`,r),new Set(u).size!==u.length&&E(s,`${i} contains a duplicate platform.`,r),u}
382
- let o=Be([$s(n,t,s,i,r)],s,i,r)[0];if(e==="packer")return pe.includes(o)||E(s,`Unknown packer \`${o}\`. ${le} packers ar\
383
- e ${q(pe)}.`,r),o;if(["workdir","output"].includes(e))return y(o,j,s,i,r,{allowRoot:e==="workdir"});if(e==="icon"){let u=y(
384
- o,j,s,i,r,{allowRoot:!1});return u.toLowerCase().endsWith(".png")||E(s,`${i} must be a 1024x1024 PNG file.`,r),u}return e===
385
- "versionFrom"?(Ge.includes(o)||E(s,`${i} must be ${q(Ge)}.`,r),o):e==="applicationId"?((!Is.test(o)||o.length>150)&&E(s,
388
+ d(j,e,n,t)}function He(e,n,t,s){let r=v(e,j,n,t,s);return Ps.test(r)||E(n,`${t} must use lowercase letters, digits, and \
389
+ single hyphens.`,s),r}function zs(e,n,t,s,r){return I(e.slice(n.length),j,t,s,r,{count:1})[0]}function ze(e,n,t,s){return e.
390
+ some(r=>js.test(r))&&E(n,`${t} takes no placeholders in ${de}.`,s),e}function zt(e,n,t,s){return Ds.test(e)||E(n,`${t} m\
391
+ ust be an uppercase environment variable name.`,s),e}function Ut(e,n,t,s,r){e.seen.has(n)&&E(s,`Package ${e.id} has a du\
392
+ plicate ${ne[n]} entry.`,r),e.seen.add(n),e.fields[n]=t,e.lines[n]=r}function Fs(e,n,t,s,r){let i=`Packaging ${ne[e]}`;if(e===
393
+ "runtimes")return N(n.slice(t.length),j,s,i,r);if(e==="platforms"){let c=I(n.slice(t.length),j,s,i,r);return c.some(a=>!Be.
394
+ includes(a))&&E(s,`${i} must be ${q(Be)}.`,r),new Set(c).size!==c.length&&E(s,`${i} contains a duplicate platform.`,r),c}
395
+ let o=ze([zs(n,t,s,i,r)],s,i,r)[0];if(e==="packer")return le.includes(o)||E(s,`Unknown packer \`${o}\`. ${de} packers ar\
396
+ e ${q(le)}.`,r),o;if(["workdir","output"].includes(e))return b(o,j,s,i,r,{allowRoot:e==="workdir"});if(e==="icon"){let c=b(
397
+ o,j,s,i,r,{allowRoot:!1});return c.toLowerCase().endsWith(".png")||E(s,`${i} must be a 1024x1024 PNG file.`,r),c}return e===
398
+ "versionFrom"?(We.includes(o)||E(s,`${i} must be ${q(We)}.`,r),o):e==="applicationId"?((!$s.test(o)||o.length>150)&&E(s,
386
399
  `${i} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and underscores; each part starts with a let\
387
- ter).`,r),o):e==="name"?((o.trim()!==o||o.length>Nt)&&E(s,`${i} must be at most ${Nt} characters without surrounding spa\
388
- ces.`,r),o):jt(o,s,i,r)}function xs(e,n,t){return{id:Ue(e[1],n,"Package id",t),label:b(e[2],j,n,"Package label",t),fields:{},
389
- lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:t}}function js(e,n,t,s){/^- Plugins?\b/u.test(
400
+ ter).`,r),o):e==="name"?((o.trim()!==o||o.length>Lt)&&E(s,`${i} must be at most ${Lt} characters without surrounding spa\
401
+ ces.`,r),o):zt(o,s,i,r)}function qs(e,n,t){return{id:He(e[1],n,"Package id",t),label:v(e[2],j,n,"Package label",t),fields:{},
402
+ lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:t}}function Ks(e,n,t,s){/^- Plugins?\b/u.test(
390
403
  n)&&E(t,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Content package at its l\
391
- ockfile versions.",s);for(let[a,c]of X)if(n.startsWith(a)){Dt(e,c,Vs(c,n,a,t,s),t,s);return}let r=n.match(Cs);if(r){Dt(e,
392
- "content",Ue(r[1],t,"Packaging Content package",s),t,s);return}let i=n.match(Rs);if(i){let a=i[1].toLowerCase(),c=`Packa\
393
- ging ${i[1]} command`;e[a].push({label:b(i[2],j,t,`Packaging ${i[1]} label`,s),argv:Be(R(i[3],j,t,c,s),t,c,s)}),e.lines[a]??=
394
- s;return}let o=n.match(As);if(o){let a=jt(o[1],t,"Packaging Environment name",s);Ps.test(a)&&E(t,`Packaging Environment ${a}\
404
+ ockfile versions.",s);for(let[a,u]of X)if(n.startsWith(a)){Ut(e,u,Fs(u,n,a,t,s),t,s);return}let r=n.match(Bs);if(r){Ut(e,
405
+ "content",He(r[1],t,"Packaging Content package",s),t,s);return}let i=n.match(Ms);if(i){let a=i[1].toLowerCase(),u=`Packa\
406
+ ging ${i[1]} command`;e[a].push({label:v(i[2],j,t,`Packaging ${i[1]} label`,s),argv:ze(A(i[3],j,t,u,s),t,u,s)}),e.lines[a]??=
407
+ s;return}let o=n.match(Gs);if(o){let a=zt(o[1],t,"Packaging Environment name",s);Ws.test(a)&&E(t,`Packaging Environment ${a}\
395
408
  looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(p=>p.name===a)&&E(t,`Packa\
396
- ge ${e.id} has a duplicate Environment ${a}.`,s);let c=Be(I(o[2],j,t,"Packaging Environment value",s,{count:1}),t,"Packa\
397
- ging Environment value",s)[0];e.environment.push({name:a,value:c}),e.lines.environment??=s;return}let u=n.match(Ns);if(u){
398
- let a=Ue(u[1],t,"Packaging Permission id",s),c=b(u[2],j,t,"Packaging Permission reason",s);(c.includes("`")||c.length>Ct)&&
399
- E(t,`Packaging Permission reason is plain user-facing text of at most ${Ct} characters.`,s),e.permissions.some(p=>p.id===
400
- a)&&E(t,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:c}),e.lines.permission??=s;
401
- return}E(t,$("Packaging entry",n,Ds),s)}function Ls(e,n){let t=e.fields.packer;t||E(n,`Package ${e.id} needs a Packer en\
402
- try: ${q(pe)}.`,e.line);let s=xt[t],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build","e\
409
+ ge ${e.id} has a duplicate Environment ${a}.`,s);let u=ze(I(o[2],j,t,"Packaging Environment value",s,{count:1}),t,"Packa\
410
+ ging Environment value",s)[0];e.environment.push({name:a,value:u}),e.lines.environment??=s;return}let c=n.match(Us);if(c){
411
+ let a=He(c[1],t,"Packaging Permission id",s),u=v(c[2],j,t,"Packaging Permission reason",s);(u.includes("`")||u.length>Mt)&&
412
+ E(t,`Packaging Permission reason is plain user-facing text of at most ${Mt} characters.`,s),e.permissions.some(p=>p.id===
413
+ a)&&E(t,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:u}),e.lines.permission??=s;
414
+ return}E(t,D("Packaging entry",n,Hs),s)}function Ys(e,n){let t=e.fields.packer;t||E(n,`Package ${e.id} needs a Packer en\
415
+ try: ${q(le)}.`,e.line);let s=Ht[t],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build","e\
403
416
  nvironment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of r)s.entries.includes(o)||E(
404
- n,`The ${t} packer takes no ${te[o]} entry.`,e.lines[o]);for(let o of s.required)r.has(o)||E(n,`Package ${e.id} (${t}) n\
405
- eeds ${/^[AEIOU]/u.test(te[o])?"an":"a"} ${te[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
417
+ n,`The ${t} packer takes no ${ne[o]} entry.`,e.lines[o]);for(let o of s.required)r.has(o)||E(n,`Package ${e.id} (${t}) n\
418
+ eeds ${/^[AEIOU]/u.test(ne[o])?"an":"a"} ${ne[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
406
419
  versionFrom)&&E(n,`The ${t} packer reads its version from ${q(s.versionSources)}.`,e.lines.versionFrom);let i={id:e.id,label:e.
407
420
  label,packer:t,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtimes||[],prepare:e.prepare,build:e.build,environment:e.
408
421
  environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return t!=="capacitor"?i:{...i,content:e.
409
422
  fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
410
423
  deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
411
- permissions}}function Lt(e,n={}){let{path:t="genesis/stack.md#Packaging"}=n;if(Array.isArray(e)||E(t,"Packaging must be \
412
- supplied as exact Stack section lines."),v(e))return{version:1,packages:[]};let s=[],r=null;for(let a=0;a<e.length;a+=1){
413
- let c=e[a].trim();if(!c)continue;let p=a+1,m=c.match(Os);if(m){r=xs(m,t,p),s.push(r);continue}c.startsWith("#")&&E(t,`Un\
414
- known Packaging heading: ${c}. Use ${Pt}.`,p),r||E(t,`Packaging entries belong under ${Pt}.`,p),js(r,c,t,p)}s.length===0&&
415
- E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>Ls(a,t)),o=new Map;for(let a of i)
416
- o.has(a.id)&&E(t,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let u=new Set;for(let a of i.filter(
417
- ({packer:c})=>c==="capacitor")){let c=o.get(a.content);(!c||c.packer!=="web-bundle")&&E(t,`Package ${a.id} Content must \
418
- name a web-bundle package declared in Packaging.`),u.has(a.application.id)&&E(t,`Packaging declares application id ${a.application.
419
- id} twice.`),u.add(a.application.id)}return{version:1,packages:i}}function $t(e,n,t,s){let r=(Array.isArray(e)?e:[]).find(
424
+ permissions}}function Ft(e,n={}){let{path:t="genesis/stack.md#Packaging"}=n;if(Array.isArray(e)||E(t,"Packaging must be \
425
+ supplied as exact Stack section lines."),w(e))return{version:1,packages:[]};let s=[],r=null;for(let a=0;a<e.length;a+=1){
426
+ let u=e[a].trim();if(!u)continue;let p=a+1,m=u.match(Ls);if(m){r=qs(m,t,p),s.push(r);continue}u.startsWith("#")&&E(t,`Un\
427
+ known Packaging heading: ${u}. Use ${Gt}.`,p),r||E(t,`Packaging entries belong under ${Gt}.`,p),Ks(r,u,t,p)}s.length===0&&
428
+ E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>Ys(a,t)),o=new Map;for(let a of i)
429
+ o.has(a.id)&&E(t,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let c=new Set;for(let a of i.filter(
430
+ ({packer:u})=>u==="capacitor")){let u=o.get(a.content);(!u||u.packer!=="web-bundle")&&E(t,`Package ${a.id} Content must \
431
+ name a web-bundle package declared in Packaging.`),c.has(a.application.id)&&E(t,`Packaging declares application id ${a.application.
432
+ id} twice.`),c.add(a.application.id)}return{version:1,packages:i}}function Bt(e,n,t,s){let r=(Array.isArray(e)?e:[]).find(
420
433
  i=>i?.name===n);return(!r||typeof r.value!="string"||!r.value.trim())&&E(t,`${s} names ${n}, which ## Environment defaul\
421
- ts does not declare with a value.`),r.value.trim()}function Mt(e,n=[],t={}){let{path:s="genesis/stack.md#Packaging"}=t;return{
434
+ ts does not declare with a value.`),r.value.trim()}function qt(e,n=[],t={}){let{path:s="genesis/stack.md#Packaging"}=t;return{
422
435
  ...e,packages:e.packages.map(r=>{if(r.packer!=="capacitor")return r;let i={...r,deepLinkScheme:null,appLinkDomains:[]};if(r.
423
- deepLinkSchemeFrom){let o=$t(n,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!Ts.test(o)||["http","ht\
436
+ deepLinkSchemeFrom){let o=Bt(n,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!Vs.test(o)||["http","ht\
424
437
  tps","file","content","javascript"].includes(o))&&E(s,`${r.deepLinkSchemeFrom} must be a custom lowercase URL scheme suc\
425
- h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=$t(n,r.appLinkDomainsFrom,s,`Package ${r.id} App lin\
426
- k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(u=>!ks.test(u))&&E(s,`${r.appLinkDomainsFrom} must list lowerca\
427
- se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function Gt({environment:e={},
438
+ h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=Bt(n,r.appLinkDomainsFrom,s,`Package ${r.id} App lin\
439
+ k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!xs.test(c))&&E(s,`${r.appLinkDomainsFrom} must list lowerca\
440
+ se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function Kt({environment:e={},
428
441
  section:n={}}={}){H(n,e,"Packaging section");let t=[...n.diagnostics||[]],s={version:1,packages:[]};n.status==="ready"&&
429
- (s=Mt(Lt(n.lines),e.environmentDefaults));let r=t.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:le,
430
- status:r,stackHash:n.stackHash,packagingHash:r==="ready"?O(s):"",source:n.source||null,version:s.version,packages:s.packages,
431
- diagnostics:t}}var S="VIBE64_OUTPUTS_INVALID";function h(e,n,t,s={}){d(S,e,n,t,s)}function We(e,n,t,s,r,i){return I(e.slice(n.length),S,
432
- t,s,r,i)}function M(e,n,t,s,r){return We(e,n,t,s,r,{count:1})[0]}function _(e,n,t,s,r,i){e.seen.has(n)&&h(s,`Duplicate ${i}\
433
- .`,r),e.seen.add(n),e[n]=t}var ne="vibe64.preview-identity.command.v1",Ms=/^[A-Z_][A-Z0-9_]*$/u,Bt=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
434
- "TMPDIR","USER"]),Wt=new Set(["email","login","user-id"]),Ht=1e4,de=3e4,zt=[["- Command: ","command","Command","`tools/p\
435
- review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${ne}\``],["- Identity types: ","identityTypes",
436
- "Identity types",`one or more of ${[...Wt].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
442
+ (s=qt(Ft(n.lines),e.environmentDefaults));let r=t.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:de,
443
+ status:r,stackHash:n.stackHash,packagingHash:r==="ready"?R(s):"",source:n.source||null,version:s.version,packages:s.packages,
444
+ diagnostics:t}}var T="VIBE64_OUTPUTS_INVALID";function h(e,n,t,s={}){d(T,e,n,t,s)}function Fe(e,n,t,s,r,i){return I(e.slice(n.length),T,
445
+ t,s,r,i)}function M(e,n,t,s,r){return Fe(e,n,t,s,r,{count:1})[0]}function O(e,n,t,s,r,i){e.seen.has(n)&&h(s,`Duplicate ${i}\
446
+ .`,r),e.seen.add(n),e[n]=t}var se="vibe64.preview-identity.command.v1",Xs=/^[A-Z_][A-Z0-9_]*$/u,Xt=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
447
+ "TMPDIR","USER"]),Jt=new Set(["email","login","user-id"]),Zt=1e4,me=3e4,Qt=[["- Command: ","command","Command","`tools/p\
448
+ review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${se}\``],["- Identity types: ","identityTypes",
449
+ "Identity types",`one or more of ${[...Jt].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
437
450
  t","Enabled environment","`ENV_NAME`"],["- Secret environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],
438
- ["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${de}\`\
439
- (default ${Ht})`]],He=zt.map(([e,,,n])=>`${e}${n}`);function Ut(e,n,t,s){if(e===void 0)return"";let r=b(e,S,n,`Preview \
440
- identity ${t} environment name`,s);return(!Ms.test(r)||Bt.has(r)||r.startsWith("XDG_"))&&h(n,`Preview identity ${t} envi\
441
- ronment name is invalid.`,s),r}function Ft(e){return{seen:new Set,line:e}}function qt(e,n,t,s){let r=zt.find(([c])=>n.startsWith(
442
- c));r||h(t,$("Preview identity entry",n,He),s);let[i,o,u]=r,a=We(n,i,t,`Preview identity ${u}`,s);!["command","identityT\
443
- ypes","runtimes"].includes(o)&&a.length!==1&&h(t,`Preview identity ${u} accepts exactly one value.`,s),_(e,o,a,t,s,`Prev\
444
- iew identity ${u} entry`)}function Kt(e,n,t){for(let[c,p]of[["command","Command"],["protocol","Protocol"],["identityType\
445
- s","Identity types"]])e[c]||h(n,`Output target ${t} Preview identity needs ${p}.`,e.line);let s=e.command.map(c=>`\`${c}\
446
- \``).join(" "),r=R(s,S,n,"Preview identity command",e.line);(!r[0].includes("/")||r[0].includes("\\")||r[0].split("/").some(
447
- c=>!c||[".",".."].includes(c))||r.some(c=>/\{(?:host|port)\}/u.test(c)))&&h(n,"Preview identity command must use a liter\
448
- al app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==ne&&h(n,`Preview identity protocol must be ${ne}\
449
- .`,e.line);let o=[...new Set(e.identityTypes.map(c=>(Wt.has(c)||h(n,`Unsupported preview identity type: ${c}.`,e.line),c)))];
450
- o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let u={enabled:Ut(e.
451
- enabledEnvironment?.[0],n,"enabled",e.line),secret:Ut(e.secretEnvironment?.[0],n,"secret",e.line)};u.enabled&&u.enabled===
452
- u.secret&&h(n,"Preview identity enabled and secret environment names must differ.",e.line);let a=Ht;if(e.timeoutMs){let c=e.
453
- timeoutMs[0];/^[0-9]+$/u.test(c)||h(n,`Preview identity Timeout ms must be from 1 through ${de}.`,e.line),a=Number(c),(!Number.
454
- isSafeInteger(a)||a<1||a>de)&&h(n,`Preview identity Timeout ms must be from 1 through ${de}.`,e.line)}return{command:r,environment:u,
455
- identityTypes:o,protocol:i,runtimes:e.runtimes?A(e.runtimes.map(c=>`\`${c}\``).join(" "),S,n,"Preview identity runtimes",
456
- e.line):[],timeoutMs:a}}var Gs="vibe64.outputs.v1",he="Outputs",Us=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,ze=/\{([a-z][a-z0-9:-]*)\}/gu,Bs=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
457
- Ws=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,Hs=/^#### Download `([^`\r\n]+)`$/u,zs=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
458
- Jt=new Set(["finite","interactive"]),Fe=new Set(["development","test"]),Zt=new Set(["terminal","web"]),Yt=16,me=e=>[...e].
459
- map(n=>`\`${n}\``).join(" or "),Fs=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
460
- on","#### Preview identity","#### Download `id`"]),fe=Object.freeze({target:["- Default.",`- Mode: ${me(Jt)}`,`- Data: ${me(
461
- Fe)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
462
- "- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${me(Zt)}`,"- Preferred port: `1024` t\
463
- hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:He,download:["- Path:\
464
- `path`","- Name: `file-name`","- Media type: `type/subtype`"]});function qe(e,n,t,s){let r=b(e,S,n,t,s);return Us.test(
465
- r)||h(n,`${t} must use lowercase letters, digits, and single hyphens.`,s),r}function qs(e,n,t,s){let r=R(e,S,n,t,s);for(let i of r)
466
- i.replace(ze,"").includes("{parameter:")&&h(n,`${t} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(ze)].some(
451
+ ["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${me}\`\
452
+ (default ${Zt})`]],qe=Qt.map(([e,,,n])=>`${e}${n}`);function Yt(e,n,t,s){if(e===void 0)return"";let r=v(e,T,n,`Preview \
453
+ identity ${t} environment name`,s);return(!Xs.test(r)||Xt.has(r)||r.startsWith("XDG_"))&&h(n,`Preview identity ${t} envi\
454
+ ronment name is invalid.`,s),r}function en(e){return{seen:new Set,line:e}}function tn(e,n,t,s){let r=Qt.find(([u])=>n.startsWith(
455
+ u));r||h(t,D("Preview identity entry",n,qe),s);let[i,o,c]=r,a=Fe(n,i,t,`Preview identity ${c}`,s);!["command","identityT\
456
+ ypes","runtimes"].includes(o)&&a.length!==1&&h(t,`Preview identity ${c} accepts exactly one value.`,s),O(e,o,a,t,s,`Prev\
457
+ iew identity ${c} entry`)}function nn(e,n,t){for(let[u,p]of[["command","Command"],["protocol","Protocol"],["identityType\
458
+ s","Identity types"]])e[u]||h(n,`Output target ${t} Preview identity needs ${p}.`,e.line);let s=e.command.map(u=>`\`${u}\
459
+ \``).join(" "),r=A(s,T,n,"Preview identity command",e.line);(!r[0].includes("/")||r[0].includes("\\")||r[0].split("/").some(
460
+ u=>!u||[".",".."].includes(u))||r.some(u=>/\{(?:host|port)\}/u.test(u)))&&h(n,"Preview identity command must use a liter\
461
+ al app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==se&&h(n,`Preview identity protocol must be ${se}\
462
+ .`,e.line);let o=[...new Set(e.identityTypes.map(u=>(Jt.has(u)||h(n,`Unsupported preview identity type: ${u}.`,e.line),u)))];
463
+ o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let c={enabled:Yt(e.
464
+ enabledEnvironment?.[0],n,"enabled",e.line),secret:Yt(e.secretEnvironment?.[0],n,"secret",e.line)};c.enabled&&c.enabled===
465
+ c.secret&&h(n,"Preview identity enabled and secret environment names must differ.",e.line);let a=Zt;if(e.timeoutMs){let u=e.
466
+ timeoutMs[0];/^[0-9]+$/u.test(u)||h(n,`Preview identity Timeout ms must be from 1 through ${me}.`,e.line),a=Number(u),(!Number.
467
+ isSafeInteger(a)||a<1||a>me)&&h(n,`Preview identity Timeout ms must be from 1 through ${me}.`,e.line)}return{command:r,environment:c,
468
+ identityTypes:o,protocol:i,runtimes:e.runtimes?N(e.runtimes.map(u=>`\`${u}\``).join(" "),T,n,"Preview identity runtimes",
469
+ e.line):[],timeoutMs:a}}var Js="vibe64.outputs.v1",fe="Outputs",Zs=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ke=/\{([a-z][a-z0-9:-]*)\}/gu,Qs=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
470
+ er=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,tr=/^#### Download `([^`\r\n]+)`$/u,nr=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
471
+ on=new Set(["finite","interactive"]),Ye=new Set(["development","test"]),an=new Set(["terminal","web"]),sn=16,he=e=>[...e].
472
+ map(n=>`\`${n}\``).join(" or "),sr=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
473
+ on","#### Preview identity","#### Download `id`"]),ge=Object.freeze({target:["- Default.",`- Mode: ${he(on)}`,`- Data: ${he(
474
+ Ye)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
475
+ "- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${he(an)}`,"- Preferred port: `1024` t\
476
+ hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:qe,download:["- Path:\
477
+ `path`","- Name: `file-name`","- Media type: `type/subtype`"]});function Xe(e,n,t,s){let r=v(e,T,n,t,s);return Zs.test(
478
+ r)||h(n,`${t} must use lowercase letters, digits, and single hyphens.`,s),r}function rr(e,n,t,s){let r=A(e,T,n,t,s);for(let i of r)
479
+ i.replace(Ke,"").includes("{parameter:")&&h(n,`${t} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(Ke)].some(
467
480
  o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&h(n,`${t} supports only {host}\
468
- , {port}, and {parameter:id} placeholders.`,s);return r}function Ks(e,n,t){return{id:qe(e[1],n,"Output target id",t),label:b(
469
- e[2],S,n,"Output target label",t),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,
470
- downloads:[],parameters:[],seen:new Set,line:t}}function Ys(e,n,t,s){if(n==="- Required."){_(e,"required",!0,t,s,"Parame\
481
+ , {port}, and {parameter:id} placeholders.`,s);return r}function ir(e,n,t){return{id:Xe(e[1],n,"Output target id",t),label:v(
482
+ e[2],T,n,"Output target label",t),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,
483
+ downloads:[],parameters:[],seen:new Set,line:t}}function or(e,n,t,s){if(n==="- Required."){O(e,"required",!0,t,s,"Parame\
471
484
  ter Required entry");return}for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(n.startsWith(
472
- o)){let u=M(n,o,t,`Parameter ${r}`,s);_(e,i,u,t,s,`Parameter ${r} entry`);return}}h(t,$("Outputs parameter entry",n,fe.parameter),
473
- s)}function Xs(e,n={}){let t=e.parameters||[],s=i=>d("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!n||typeof n!="obj\
485
+ o)){let c=M(n,o,t,`Parameter ${r}`,s);O(e,i,c,t,s,`Parameter ${r} entry`);return}}h(t,D("Outputs parameter entry",n,ge.parameter),
486
+ s)}function ar(e,n={}){let t=e.parameters||[],s=i=>d("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!n||typeof n!="obj\
474
487
  ect"||Array.isArray(n))&&s("Output parameters must be an object of text values.");let r=new Set(t.map(({id:i})=>i));for(let i of Object.
475
488
  keys(n))r.has(i)||s(`Unknown output parameter: ${i}.`);return Object.fromEntries(t.map(i=>{let o=Object.hasOwn(n,i.id)?n[i.
476
489
  id]:i.default;return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${i.label} must be a single line of tex\
477
- t, at most 4096 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function Js(e){return{kind:"",
478
- preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function Zs(e,n,t){return{id:qe(e[1],n,"Download id",
479
- t),path:"",name:"",mediaType:"",seen:new Set,line:t}}function Qs(e,n,t){/^[0-9]+$/u.test(e)||h(n,"Web presentation prefe\
490
+ t, at most 4096 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function cr(e){return{kind:"",
491
+ preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function ur(e,n,t){return{id:Xe(e[1],n,"Download id",
492
+ t),path:"",name:"",mediaType:"",seen:new Set,line:t}}function pr(e,n,t){/^[0-9]+$/u.test(e)||h(n,"Web presentation prefe\
480
493
  rred port must be an integer from 1024 through 65535.",t);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&
481
- h(n,"Web presentation preferred port must be an integer from 1024 through 65535.",t),s}function er(e,n,t,s){if(n.startsWith(
482
- "- Data: ")){let i=M(n,"- Data: ",t,"Output target Data",s);Fe.has(i)||h(t,`Output target Data must be ${me(Fe)}.`,s),_(
483
- e,"dataMode",i,t,s,"output target Data entry");return}if(n==="- Default."){_(e,"default",!0,t,s,"output target Default e\
484
- ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);Jt.has(i)||h(t,"Output target \
485
- Mode must be `interactive` or `finite`.",s),_(e,"mode",i,t,s,"output target Mode entry");return}if(n.startsWith("- Workd\
486
- ir: ")){_(e,"workdir",y(M(n,"- Workdir: ",t,"Output target Workdir",s),S,t,"Output target workdir",s),t,s,"output target\
487
- Workdir entry");return}if(n.startsWith("- Runtimes: ")){_(e,"runtimeRequirements",A(n.slice(12),S,t,"Output target runt\
494
+ h(n,"Web presentation preferred port must be an integer from 1024 through 65535.",t),s}function lr(e,n,t,s){if(n.startsWith(
495
+ "- Data: ")){let i=M(n,"- Data: ",t,"Output target Data",s);Ye.has(i)||h(t,`Output target Data must be ${he(Ye)}.`,s),O(
496
+ e,"dataMode",i,t,s,"output target Data entry");return}if(n==="- Default."){O(e,"default",!0,t,s,"output target Default e\
497
+ ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);on.has(i)||h(t,"Output target \
498
+ Mode must be `interactive` or `finite`.",s),O(e,"mode",i,t,s,"output target Mode entry");return}if(n.startsWith("- Workd\
499
+ ir: ")){O(e,"workdir",b(M(n,"- Workdir: ",t,"Output target Workdir",s),T,t,"Output target workdir",s),t,s,"output target\
500
+ Workdir entry");return}if(n.startsWith("- Runtimes: ")){O(e,"runtimeRequirements",N(n.slice(12),T,t,"Output target runt\
488
501
  imes",s),t,s,"output target Runtimes entry");return}let r=n.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(r){
489
- let i=r[1].toLowerCase(),o=qs(r[3],t,"Output step command",s);i!=="run"&&o.some(u=>/\{(?:host|port)\}/u.test(u))&&h(t,"O\
490
- nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:b(r[2],S,t,"Output step\
491
- label",s),argv:o,role:i});return}h(t,$("Outputs target entry",n,[...fe.target,...Fs.slice(1)]),s)}function tr(e,n,t,s){
492
- if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);Zt.has(r)||h(t,"Presentation Kind must be `te\
493
- rminal` or `web`.",s),_(e,"kind",r,t,s,"Presentation Kind entry");return}if(n.startsWith("- Preferred port: ")){_(e,"pre\
494
- ferredPort",Qs(M(n,"- Preferred port: ",t,"Web presentation Preferred port",s),t,s),t,s,"Presentation Preferred port ent\
495
- ry");return}if(n.startsWith("- URL path: ")){_(e,"urlPath",ke(M(n,"- URL path: ",t,"Web presentation URL path",s),S,t,"W\
496
- eb presentation URL path",s),t,s,"Presentation URL path entry");return}if(n.startsWith("- Ready when: ")){_(e,"readiness",
497
- ae(n,S,t,"Web presentation readiness",s),t,s,"Presentation Ready when entry");return}h(t,$("Presentation entry",n,fe.presentation),
498
- s)}function nr(e,n,t){let s=b(e,S,n,"Download Name",t);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
499
- s.trim()!==s)&&h(n,"Download Name must be a safe filename without path separators.",t),s}function sr(e,n,t){let s=b(e,S,
500
- n,"Download Media type",t);return(s.length>127||!zs.test(s))&&h(n,"Download Media type must be a lowercase type/subtype \
501
- value.",t),s}function rr(e,n,t,s){if(n.startsWith("- Path: ")){_(e,"path",y(M(n,"- Path: ",t,"Download Path",s),S,t,"Dow\
502
- nload path",s,{allowRoot:!1}),t,s,"Download Path entry");return}if(n.startsWith("- Name: ")){_(e,"name",nr(M(n,"- Name: ",
503
- t,"Download Name",s),t,s),t,s,"Download Name entry");return}if(n.startsWith("- Media type: ")){_(e,"mediaType",sr(M(n,"-\
504
- Media type: ",t,"Download Media type",s),t,s),t,s,"Download Media type entry");return}h(t,$("Download entry",n,fe.download),
505
- s)}function ir(e,n,t){for(let[s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(n,`Output targe\
506
- t ${t} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function or(e,n,t){
502
+ let i=r[1].toLowerCase(),o=rr(r[3],t,"Output step command",s);i!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&h(t,"O\
503
+ nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:v(r[2],T,t,"Output step\
504
+ label",s),argv:o,role:i});return}h(t,D("Outputs target entry",n,[...ge.target,...sr.slice(1)]),s)}function dr(e,n,t,s){
505
+ if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);an.has(r)||h(t,"Presentation Kind must be `te\
506
+ rminal` or `web`.",s),O(e,"kind",r,t,s,"Presentation Kind entry");return}if(n.startsWith("- Preferred port: ")){O(e,"pre\
507
+ ferredPort",pr(M(n,"- Preferred port: ",t,"Web presentation Preferred port",s),t,s),t,s,"Presentation Preferred port ent\
508
+ ry");return}if(n.startsWith("- URL path: ")){O(e,"urlPath",_e(M(n,"- URL path: ",t,"Web presentation URL path",s),T,t,"W\
509
+ eb presentation URL path",s),t,s,"Presentation URL path entry");return}if(n.startsWith("- Ready when: ")){O(e,"readiness",
510
+ ce(n,T,t,"Web presentation readiness",s),t,s,"Presentation Ready when entry");return}h(t,D("Presentation entry",n,ge.presentation),
511
+ s)}function mr(e,n,t){let s=v(e,T,n,"Download Name",t);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
512
+ s.trim()!==s)&&h(n,"Download Name must be a safe filename without path separators.",t),s}function hr(e,n,t){let s=v(e,T,
513
+ n,"Download Media type",t);return(s.length>127||!nr.test(s))&&h(n,"Download Media type must be a lowercase type/subtype \
514
+ value.",t),s}function fr(e,n,t,s){if(n.startsWith("- Path: ")){O(e,"path",b(M(n,"- Path: ",t,"Download Path",s),T,t,"Dow\
515
+ nload path",s,{allowRoot:!1}),t,s,"Download Path entry");return}if(n.startsWith("- Name: ")){O(e,"name",mr(M(n,"- Name: ",
516
+ t,"Download Name",s),t,s),t,s,"Download Name entry");return}if(n.startsWith("- Media type: ")){O(e,"mediaType",hr(M(n,"-\
517
+ Media type: ",t,"Download Media type",s),t,s),t,s,"Download Media type entry");return}h(t,D("Download entry",n,ge.download),
518
+ s)}function gr(e,n,t){for(let[s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(n,`Output targe\
519
+ t ${t} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Er(e,n,t){
507
520
  return e.kind||h(n,`Output target ${t} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
508
521
  readiness||e.seen.has("urlPath"))&&h(n,`Output target ${t} terminal Presentation accepts only Kind.`,e.line),{kind:"term\
509
522
  inal"}):(e.readiness||h(n,`Output target ${t} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.
510
- preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function Xt(e,n){e.mode||h(n,`Output target ${e.id} needs one Mo\
523
+ preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function rn(e,n){e.mode||h(n,`Output target ${e.id} needs one Mo\
511
524
  de entry.`,e.line),e.steps.length===0&&h(n,`Output target ${e.id} needs at least one step.`,e.line);let t={prepare:0,build:1,
512
- run:2};for(let c=1;c<e.steps.length;c+=1)t[e.steps[c].role]<t[e.steps[c-1].role]&&h(n,`Output target ${e.id} steps must \
513
- be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:c})=>c==="run"),r=e.downloads.map(c=>ir(c,n,e.
514
- id));new Set(r.map(({id:c})=>c)).size!==r.length&&h(n,`Output target ${e.id} contains a duplicate Download id.`,e.line),
525
+ run:2};for(let u=1;u<e.steps.length;u+=1)t[e.steps[u].role]<t[e.steps[u-1].role]&&h(n,`Output target ${e.id} steps must \
526
+ be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),r=e.downloads.map(u=>gr(u,n,e.
527
+ id));new Set(r.map(({id:u})=>u)).size!==r.length&&h(n,`Output target ${e.id} contains a duplicate Download id.`,e.line),
515
528
  e.mode==="finite"?((s.length>0||e.presentation||e.previewIdentity)&&h(n,`Finite output target ${e.id} cannot have Run, P\
516
529
  resentation, or Preview identity entries.`,e.line),r.length===0&&h(n,`Finite output target ${e.id} needs at least one Do\
517
530
  wnload.`,e.line)):s.length!==1||e.steps.at(-1).role!=="run"?h(n,`Interactive output target ${e.id} needs exactly one fin\
518
531
  al Run step.`,e.line):e.presentation||h(n,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?
519
- or(e.presentation,n,e.id):null,o=e.steps.flatMap(({argv:c})=>c.flatMap(p=>[...p.matchAll(ze)].map(m=>m[1])));o.some(c=>[
520
- "host","port"].includes(c))&&i?.kind!=="web"&&h(n,"Only a web output target may use {host} or {port} placeholders.",e.line);
521
- let u=e.parameters.map(({seen:c,...p})=>p),a=new Set(u.map(({id:c})=>c));(u.length>Yt||a.size!==u.length)&&h(n,`Output t\
522
- arget ${e.id} may declare at most ${Yt} parameters with unique ids.`,e.line);for(let c of o.filter(p=>p.startsWith("para\
523
- meter:"))){let p=c.slice(10);a.has(p)||h(n,`Undeclared output parameter: ${p}.`,e.line)}for(let c of u)o.includes(`param\
524
- eter:${c.id}`)||h(n,`Output parameter ${c.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!==
532
+ Er(e.presentation,n,e.id):null,o=e.steps.flatMap(({argv:u})=>u.flatMap(p=>[...p.matchAll(Ke)].map(m=>m[1])));o.some(u=>[
533
+ "host","port"].includes(u))&&i?.kind!=="web"&&h(n,"Only a web output target may use {host} or {port} placeholders.",e.line);
534
+ let c=e.parameters.map(({seen:u,...p})=>p),a=new Set(c.map(({id:u})=>u));(c.length>sn||a.size!==c.length)&&h(n,`Output t\
535
+ arget ${e.id} may declare at most ${sn} parameters with unique ids.`,e.line);for(let u of o.filter(p=>p.startsWith("para\
536
+ meter:"))){let p=u.slice(10);a.has(p)||h(n,`Undeclared output parameter: ${p}.`,e.line)}for(let u of c)o.includes(`param\
537
+ eter:${u.id}`)||h(n,`Output parameter ${u.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!==
525
538
  "web"&&h(n,"Only a web output target may declare Preview identity.",e.line),{id:e.id,label:e.label,default:e.default,mode:e.
526
539
  mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,
527
- downloads:r,...u.length?{parameters:u}:{},...e.previewIdentity?{previewIdentity:Kt(e.previewIdentity,n,e.id)}:{}}}function ge(e,n={}){
540
+ downloads:r,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:nn(e.previewIdentity,n,e.id)}:{}}}function Ee(e,n={}){
528
541
  let{path:t="genesis/stack.md#Outputs"}=n;if(Array.isArray(e)||h(t,"Outputs must be supplied as exact Stack section lines\
529
- ."),v(e))return{version:1,targets:[]};let s=[],r=null,i="target",o=null;for(let a=0;a<e.length;a+=1){let c=e[a].trim();if(!c)
530
- continue;let p=a+1,m=c.match(Bs);if(m){r&&s.push(Xt(r,t)),r=Ks(m,t,p),i="target",o=null;continue}r||h(t,"## Outputs must\
531
- begin with a Target heading.",p);let l=c.match(Ws);if(l){let g={id:qe(l[1],t,"Parameter id",p),label:b(l[2],S,t,"Parame\
532
- ter label",p),default:"",description:"",required:!1,seen:new Set};r.parameters.push(g),i="parameter",o=g;continue}if(c===
542
+ ."),w(e))return{version:1,targets:[]};let s=[],r=null,i="target",o=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)
543
+ continue;let p=a+1,m=u.match(Qs);if(m){r&&s.push(rn(r,t)),r=ir(m,t,p),i="target",o=null;continue}r||h(t,"## Outputs must\
544
+ begin with a Target heading.",p);let l=u.match(er);if(l){let g={id:Xe(l[1],t,"Parameter id",p),label:v(l[2],T,t,"Parame\
545
+ ter label",p),default:"",description:"",required:!1,seen:new Set};r.parameters.push(g),i="parameter",o=g;continue}if(u===
533
546
  "#### Presentation"){r.presentation&&h(t,"Presentation must appear at most once below an output target.",p),r.presentation=
534
- Js(p),i="presentation",o=r.presentation;continue}if(c==="#### Preview identity"){r.previewIdentity&&h(t,"Preview identit\
535
- y must appear at most once below an output target.",p),r.previewIdentity=Ft(p),i="previewIdentity",o=r.previewIdentity;continue}
536
- let f=c.match(Hs);if(f){let g=Zs(f,t,p);r.downloads.push(g),i="download",o=g;continue}i==="parameter"?Ys(o,c,t,p):i==="p\
537
- resentation"?tr(o,c,t,p):i==="previewIdentity"?qt(o,c,t,p):i==="download"?rr(o,c,t,p):er(r,c,t,p)}r&&s.push(Xt(r,t)),s.length===
538
- 0&&h(t,"## Outputs needs at least one Target or exactly `- Nothing.`.");let u=s.map(({id:a})=>a);return new Set(u).size!==
539
- u.length&&h(t,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(t,"Outputs may declare a\
540
- t most one default target."),{version:1,targets:s}}function ar(e,n={}){let{resourcesPreparing:t=!1}=n,s=e.details||{},r=Array.
541
- isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:[]).map((u,a)=>Array.isArray(r[a])&&r[a].
542
- length?r[a].join(" and "):String(u)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!i.length)return e.message;let o=String(
547
+ cr(p),i="presentation",o=r.presentation;continue}if(u==="#### Preview identity"){r.previewIdentity&&h(t,"Preview identit\
548
+ y must appear at most once below an output target.",p),r.previewIdentity=en(p),i="previewIdentity",o=r.previewIdentity;continue}
549
+ let f=u.match(tr);if(f){let g=ur(f,t,p);r.downloads.push(g),i="download",o=g;continue}i==="parameter"?or(o,u,t,p):i==="p\
550
+ resentation"?dr(o,u,t,p):i==="previewIdentity"?tn(o,u,t,p):i==="download"?fr(o,u,t,p):lr(r,u,t,p)}r&&s.push(rn(r,t)),s.length===
551
+ 0&&h(t,"## Outputs needs at least one Target or exactly `- Nothing.`.");let c=s.map(({id:a})=>a);return new Set(c).size!==
552
+ c.length&&h(t,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(t,"Outputs may declare a\
553
+ t most one default target."),{version:1,targets:s}}function yr(e,n={}){let{resourcesPreparing:t=!1}=n,s=e.details||{},r=Array.
554
+ isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:[]).map((c,a)=>Array.isArray(r[a])&&r[a].
555
+ length?r[a].join(" and "):String(c)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!i.length)return e.message;let o=String(
543
556
  s.resource||"").trim()||"resources";return t?`Vibe64 is still setting up this app's ${o}. Preview can start when workspa\
544
557
  ce setup finishes; then press Check again.`:`This app needs its ${o} before Preview can start: set ${i.join(", or ")} in\
545
- Env (in Dash, under Development), then press Check again.`}function Qt({environment:e={},section:n={},resourcesPreparing:t=!1}={}){
558
+ Env (in Dash, under Development), then press Check again.`}function cn({environment:e={},section:n={},resourcesPreparing:t=!1}={}){
546
559
  H(n,e,"Outputs section");let s=[...n.diagnostics||[]],r=[...e.diagnostics||[]],i={version:1,targets:[]};n.status==="read\
547
- y"&&(i=ge(n.lines));let o=r.length===0?null:[...new Set(r.map(p=>ar(p,{resourcesPreparing:t})))].join(" "),u=i.targets.map(
548
- p=>({...p,source:n.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],c="ready";return a.
549
- length>0?c="blocked":u.length===0&&(c="unconfigured"),{contract:Gs,status:c,stackHash:n.stackHash,components:[...n.components||
550
- []],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:z(u.flatMap(p=>p.runtimeRequirements)),
551
- resources:structuredClone(e.resources||[]),targets:u,diagnostics:a}}var en="Project services",cr="vibe64.project-services.v1",J="VIBE64_PROJECT_SERVICES_INVALID",Z="genesis/stack.md#Projec\
552
- t services",ur="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function tn(e){
553
- if(Array.isArray(e)||d(J,Z,"Expected exact Project services section lines."),v(e))return[];let n=[];for(let[t,s]of e.entries()){
560
+ y"&&(i=Ee(n.lines));let o=r.length===0?null:[...new Set(r.map(p=>yr(p,{resourcesPreparing:t})))].join(" "),c=i.targets.map(
561
+ p=>({...p,source:n.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],u="ready";return a.
562
+ length>0?u="blocked":c.length===0&&(u="unconfigured"),{contract:Js,status:u,stackHash:n.stackHash,components:[...n.components||
563
+ []],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:z(c.flatMap(p=>p.runtimeRequirements)),
564
+ resources:structuredClone(e.resources||[]),targets:c,diagnostics:a}}var un="Project services",br="vibe64.project-services.v1",J="VIBE64_PROJECT_SERVICES_INVALID",Z="genesis/stack.md#Projec\
565
+ t services",vr="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function pn(e){
566
+ if(Array.isArray(e)||d(J,Z,"Expected exact Project services section lines."),w(e))return[];let n=[];for(let[t,s]of e.entries()){
554
567
  let r=s.trim();if(!r)continue;let i=t+1,o=r.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
555
- o||d(J,Z,`Use: ${ur}`,i),n.some(({id:a})=>a===o[1])&&d(J,Z,"Duplicate project service id.",i);let u=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
556
- n.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:A(u?u[1]:o[3],J,Z,"Service runtimes",i),workdir:y(u?.[2]||
557
- ".",J,Z,"Service workdir",i),argv:R(o[4],J,Z,"Service command",i)})}return n.length||d(J,Z,"Declare a service or exactly\
558
- `- Nothing.`."),n}function nn(e={}){let n=e.status==="ready"?tn(e.lines):[];return{contract:cr,status:e.status==="block\
559
- ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?O(n):"",diagnostics:e.diagnostics||[]}}import{access as pr}from"node:fs/promises";import rn from"node:path";var lr="vibe64.workspace-setup.v1",se="Workspace setup",Ye="VIBE64_WORKSPACE_SETUP_INVALID",sn="- Prepare `label` with `\
560
- runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",dr=/^- Prepare `([^`\r\n]+)` (.+)$/u;function Ke(e,n,t,s={}){
561
- d(Ye,e,n,t,s)}function Ee(e,n={}){let{path:t="genesis/stack.md#Workspace setup"}=n;if(Array.isArray(e)||Ke(t,"Workspace \
562
- setup must be supplied as exact Stack section lines."),v(e))return[];let s=[];for(let r=0;r<e.length;r+=1){let i=e[r].trim();
563
- if(!i)continue;let o=r+1,u=i.match(dr);u||Ke(t,`Every Workspace setup entry must use: ${sn}`,o,{observed:i}),s.push({label:b(
564
- u[1],Ye,t,"Workspace setup step label",o),...ce(u[2],Ye,t,"Workspace setup",o,{form:sn,observed:i})})}return s.length===
565
- 0&&Ke(t,"## Workspace setup needs at least one Prepare entry or exactly `- Nothing.`."),s}async function mr(e,n){try{return await pr(
566
- rn.join(e,n)),!0}catch(t){if(["ENOENT","ENOTDIR"].includes(t?.code))return!1;throw t}}async function on({projectRoot:e,section:n={}}={}){
567
- let t=[...n.diagnostics||[]],s=[];n.status==="ready"&&(s=Ee(n.lines));let r=[],i=[],o=rn.resolve(e);if(t.length===0)for(let l of s){
568
- if(!l.condition||await mr(o,l.condition.pathExists)){r.push(l);continue}l.condition.onMissing==="wait"&&i.push(l.condition.
568
+ o||d(J,Z,`Use: ${vr}`,i),n.some(({id:a})=>a===o[1])&&d(J,Z,"Duplicate project service id.",i);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
569
+ n.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:N(c?c[1]:o[3],J,Z,"Service runtimes",i),workdir:b(c?.[2]||
570
+ ".",J,Z,"Service workdir",i),argv:A(o[4],J,Z,"Service command",i)})}return n.length||d(J,Z,"Declare a service or exactly\
571
+ `- Nothing.`."),n}function ln(e={}){let n=e.status==="ready"?pn(e.lines):[];return{contract:br,status:e.status==="block\
572
+ ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?R(n):"",diagnostics:e.diagnostics||[]}}import{access as wr}from"node:fs/promises";import mn from"node:path";var Sr="vibe64.workspace-setup.v1",re="Workspace setup",Ze="VIBE64_WORKSPACE_SETUP_INVALID",dn="- Prepare `label` with `\
573
+ runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",Ir=/^- Prepare `([^`\r\n]+)` (.+)$/u;function Je(e,n,t,s={}){
574
+ d(Ze,e,n,t,s)}function ye(e,n={}){let{path:t="genesis/stack.md#Workspace setup"}=n;if(Array.isArray(e)||Je(t,"Workspace \
575
+ setup must be supplied as exact Stack section lines."),w(e))return[];let s=[];for(let r=0;r<e.length;r+=1){let i=e[r].trim();
576
+ if(!i)continue;let o=r+1,c=i.match(Ir);c||Je(t,`Every Workspace setup entry must use: ${dn}`,o,{observed:i}),s.push({label:v(
577
+ c[1],Ze,t,"Workspace setup step label",o),...ue(c[2],Ze,t,"Workspace setup",o,{form:dn,observed:i})})}return s.length===
578
+ 0&&Je(t,"## Workspace setup needs at least one Prepare entry or exactly `- Nothing.`."),s}async function Tr(e,n){try{return await wr(
579
+ mn.join(e,n)),!0}catch(t){if(["ENOENT","ENOTDIR"].includes(t?.code))return!1;throw t}}async function hn({projectRoot:e,section:n={}}={}){
580
+ let t=[...n.diagnostics||[]],s=[];n.status==="ready"&&(s=ye(n.lines));let r=[],i=[],o=mn.resolve(e);if(t.length===0)for(let l of s){
581
+ if(!l.condition||await Tr(o,l.condition.pathExists)){r.push(l);continue}l.condition.onMissing==="wait"&&i.push(l.condition.
569
582
  pathExists)}if(i.length>0){let l=z(i);t.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting \
570
- for project ${l.length===1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let u=t.some(({code:l})=>l==="VIBE64_W\
571
- ORKSPACE_SETUP_WAITING"),a=t.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),c="unconfigured";a?c="blocked":!u&&r.
572
- length>0&&(c="ready");let p=r.map(({condition:l,...f})=>f),m={version:1,steps:p};return{contract:lr,status:c,stackHash:n.
573
- stackHash,recipeHash:c==="ready"?O(m):"",components:[...n.components||[]],source:n.source||null,runtimeRequirements:z(p.
574
- flatMap(l=>l.runtimeRequirements)),steps:p,diagnostics:t}}var hr="vibe64.resource-estimates.v1",ye="Resource estimates",un="VIBE64_RESOURCE_ESTIMATES_INVALID",fr=1024*1024,an=1024*
575
- 1024,cn=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
576
- ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,n,t){d(un,
577
- e,n,t)}function Xe(e,n,t,s,r){let i=e.get(n),o=e.get(t);return(i===void 0||o===void 0||i>o)&&G(s,"Each resource phase re\
578
- quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function pn(e,n={}){
583
+ for project ${l.length===1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let c=t.some(({code:l})=>l==="VIBE64_W\
584
+ ORKSPACE_SETUP_WAITING"),a=t.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),u="unconfigured";a?u="blocked":!c&&r.
585
+ length>0&&(u="ready");let p=r.map(({condition:l,...f})=>f),m={version:1,steps:p};return{contract:Sr,status:u,stackHash:n.
586
+ stackHash,recipeHash:u==="ready"?R(m):"",components:[...n.components||[]],source:n.source||null,runtimeRequirements:z(p.
587
+ flatMap(l=>l.runtimeRequirements)),steps:p,diagnostics:t}}var kr="vibe64.resource-estimates.v1",be="Resource estimates",En="VIBE64_RESOURCE_ESTIMATES_INVALID",_r=1024*1024,fn=1024*
588
+ 1024,gn=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
589
+ ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,n,t){d(En,
590
+ e,n,t)}function Qe(e,n,t,s,r){let i=e.get(n),o=e.get(t);return(i===void 0||o===void 0||i>o)&&G(s,"Each resource phase re\
591
+ quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function yn(e,n={}){
579
592
  let{path:t="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:r=!1}=n;(!Array.isArray(e)||e.length>2048||
580
593
  e.some(p=>typeof p!="string")||Buffer.byteLength(e.join(`
581
594
  `),"utf8")>64*1024)&&G(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let i={version:1,
582
- outputs:[],workspaceSetup:null};if(v(e))return i;let o=new Map(s.map(p=>[p.id,p])),u=new Set,a=null;function c(){if(!a)return;
595
+ outputs:[],workspaceSetup:null};if(w(e))return i;let o=new Map(s.map(p=>[p.id,p])),c=new Set,a=null;function u(){if(!a)return;
583
596
  let{targetId:p,mode:m,fields:l,line:f}=a;if(m==="interactive"){(l.has("typical")||l.has("high"))&&G(t,"Interactive outpu\
584
- ts require separate Startup and Running estimates.",f),i.outputs.push({targetId:p,mode:m,startup:Xe(l,"startupTypical","\
585
- startupHigh",t,f),running:Xe(l,"runningTypical","runningHigh",t,f)});return}(l.size!==2||!l.has("typical")||!l.has("high"))&&
586
- G(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",f);let g=Xe(l,"typical","high",t,f);p?i.
597
+ ts require separate Startup and Running estimates.",f),i.outputs.push({targetId:p,mode:m,startup:Qe(l,"startupTypical","\
598
+ startupHigh",t,f),running:Qe(l,"runningTypical","runningHigh",t,f)});return}(l.size!==2||!l.has("typical")||!l.has("high"))&&
599
+ G(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",f);let g=Qe(l,"typical","high",t,f);p?i.
587
600
  outputs.push({targetId:p,mode:m,execution:g}):i.workspaceSetup=g}for(let p=0;p<e.length;p+=1){let m=e[p].trim(),l=p+1;if(!m)
588
- continue;let f=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(f||m==="### Workspace setup"){c();let P=f?.[1]||
589
- "",Y=P?`output:${P}`:"workspace-setup";u.has(Y)&&G(t,"Resource estimates contains a duplicate operation.",l),u.add(Y);let Q=o.
601
+ continue;let f=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(f||m==="### Workspace setup"){u();let P=f?.[1]||
602
+ "",Y=P?`output:${P}`:"workspace-setup";c.has(Y)&&G(t,"Resource estimates contains a duplicate operation.",l),c.add(Y);let Q=o.
590
603
  get(P);P&&!["interactive","finite"].includes(Q?.mode)&&G(t,`Resource estimate references an undeclared output: ${P}.`,l),
591
604
  !P&&!r&&G(t,"Resource estimate references undeclared Workspace setup steps.",l),a={targetId:P,mode:Q?.mode||"setup",fields:new Map,
592
- line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),C=g&&cn.get(g[1]);(!a||!C)&&G(t,`Expected an Output\
593
- or Workspace setup heading followed by positive integer MiB estimates: ${[...cn.keys()].map(P=>`- ${P}: \`number\``).join(
594
- "; ")}.`,l),a.fields.has(C)&&G(t,`Duplicate resource field: ${g[1]}.`,l);let k=Number(g[2]);(!Number.isSafeInteger(k)||k>
595
- an)&&G(t,`Resource estimates must be between 1 and ${an} MiB.`,l),a.fields.set(C,k*fr)}return c(),u.size===0&&G(t,"Resou\
596
- rce estimates needs an operation or exactly `- Nothing.`."),i}function be({section:e={},outputsSection:n={},workspaceSetupSection:t={}}={}){
605
+ line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),S=g&&gn.get(g[1]);(!a||!S)&&G(t,`Expected an Output\
606
+ or Workspace setup heading followed by positive integer MiB estimates: ${[...gn.keys()].map(P=>`- ${P}: \`number\``).join(
607
+ "; ")}.`,l),a.fields.has(S)&&G(t,`Duplicate resource field: ${g[1]}.`,l);let _=Number(g[2]);(!Number.isSafeInteger(_)||_>
608
+ fn)&&G(t,`Resource estimates must be between 1 and ${fn} MiB.`,l),a.fields.set(S,_*_r)}return u(),c.size===0&&G(t,"Resou\
609
+ rce estimates needs an operation or exactly `- Nothing.`."),i}function ve({section:e={},outputsSection:n={},workspaceSetupSection:t={}}={}){
597
610
  H(e,n,"Resource estimates and Outputs"),H(e,t,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={
598
- version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=pn(e.lines,{targets:n.status==="read\
599
- y"?ge(n.lines).targets:[],hasWorkspaceSetup:t.status==="ready"&&Ee(t.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
600
- kOperationError")throw o;s.push({code:un,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"i\
601
- nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:hr,status:i,stackHash:e.stackHash,sectionHash:e.
602
- sectionHash||"",estimatesHash:i==="ready"?O(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
603
- fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var gr="vibe64.integration-setup.v1",ln="Integration setup",re="VIBE64_INTEGRATION_SETUP_INVALID",Er="- Command with `ru\
604
- ntime` in `workdir`: `command` `argument`...";function dn(e,n={}){let{path:t="genesis/stack.md#Integration setup"}=n;if(Array.
605
- isArray(e)||d(re,t,"Integration setup requires exact Stack section lines."),v(e))return null;let s=e.map(i=>i.trim()).filter(
606
- Boolean),r=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return r||d(re,t,`Integration setu\
607
- p requires exactly one entry: ${Er}; or - Nothing.`),{argv:R(r[3],re,t,"Integration setup command"),workdir:y(r[2],re,t,
608
- "Integration setup workdir"),runtimeRequirements:A(r[1],re,t,"Integration setup runtimes")}}function mn({section:e={}}={}){
609
- let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?dn(e.lines):null;return{contract:gr,status:n.length?"blo\
610
- cked":t?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:t?O({version:1,command:t}):"",source:e.source||null,components:[
611
- ...e.components||[]],command:t,diagnostics:n}}var yr=new URL("./index.js",import.meta.url).href,gn=vr(yr),ve=new Map;async function wr(e){if(!W.isAbsolute(e||""))throw new TypeError(
612
- "Genesis host context requires an absolute runtime root.");let n=W.join(e,"genesis-context");if(!ve.has(n)){let t=Tt(n).
613
- catch(s=>{throw ve.delete(n),s});ve.set(n,t)}return ve.get(n)}var{GENESIS_CONTRACTS:N,HOST_CONTEXT_RESOLVER_DATA_ENV:Sr,
614
- HOST_CONTEXT_RESOLVER_ENV:Ir,addStack:Tr,applyTemplate:kr,generatePrompt:_r,indexCodebase:Or,initialize:Rr,inspectCollaboration:Ar,
615
- inspectDerivedArtifacts:Nr,inspectEngineering:Cr,inspectEnvironment:we,inspectProject:Pr,inspectProjectFormat:Dr,inspectAgentIntegrations:$r,
616
- inspectSkills:Vr,inspectStackSection:xr,inspectStackSections:jr,inspectSubsystems:Lr,listTemplates:Mr,parserEnvironment:So,
617
- setCollaboration:Gr,setEngineeringProfile:Ur,syncAgentIntegrations:Br,syncSkills:Wr,withTrustedGitRepository:Hr,SOURCE_EXPLANATION_PROMPT_VERSION:Io,
618
- sourceExplanationGuidance:To,validateArchitectureFacts:ko,mergeArchitectureObservations:_o,validateCityDocument:Oo,validateCallWeb:Ro,
619
- CALL_WEB_SCHEMA:Ao,MACHINE_CITY_SCHEMA:No,PROGRAM_CITY_SCHEMA:Co,CITY_SCHEMA_VERSION:Po}=ie;async function Do(e){let n=await wr(
620
- e);return{[Ir]:Jr(),[Sr]:JSON.stringify({registryPath:n.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var $o="genesis\
621
- /blueprint.md",Vo="genesis/subsystems.md",zr=Object.freeze(["vue","django-postgresql","jskit-postgresql","postgresql","r\
622
- ails-postgresql","spring-boot-postgresql"]),Fr=Object.freeze(["genesis-stack"]),fn=Object.freeze({BLUEPRINT_INVALID:"blu\
623
- eprint",BLUEPRINT_REQUIRED:"start"}),qr=new Set(["adopt","blueprint","describe","deslop","program","review","start","ui-\
624
- pass","work"]);function En(e,n={}){let{required:t=!1}=n,s=F(e);if(!s&&!t)return"";if(!qr.has(s))throw new TypeError(s?`U\
625
- nknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an explicit task.");return s}function Kr(e={}){return En(
626
- e.genesisTask)||"work"}function Yr(e={},n={}){return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,n.label].
627
- map(F).find(Boolean)||"Continue the requested project work."}function Xr(){let e=(gn.resolve.paths("genesis-compiler")||
628
- []).find(n=>hn(W.join(n,"genesis-compiler"))&&hn(W.join(n,".bin","genesis")));if(!e)throw new Error("The installed Genes\
629
- is compiler executable could not be located.");return W.join(e,".bin")}function yn(){let e=gn.resolve("@local/vibe64-gen\
630
- esis/server");return W.resolve(W.dirname(e),"../../bin")}function Jr(){return W.resolve(yn(),"vibe64-genesis-host-contex\
631
- t")}function xo(e=[]){let n=yn(),t=Xr();return[...(Array.isArray(e)?e:[]).filter(r=>![n,t].includes(F(r))),n]}function Zr(e={},n={}){
632
- let{prompt:t=!1}=n;return{...e,...t?{hiddenStackPieces:zr}:{},stackPackages:Fr}}function jo(e={}){return D(Tr,e)}function Lo(e={}){
633
- return D(Rr,e)}function Mo(e={}){return D(Vr,e)}function Go(e={}){return D(Wr,e)}function Uo(e={}){return D(Br,e)}function Bo(e={}){
634
- return D($r,e)}function Wo(e={}){return D(Lr,e)}async function Ho(e={}){return ht(await K(ut,e))}async function zo(e={}){
635
- return Et(await K(ft,e))}function Fo(e={}){return D(Or,e)}function Qr(){let e=Nr();if(e?.contract!==N.derivedArtifacts)throw new Error(
636
- `Genesis returned ${e?.contract||"no contract identity"}; expected ${N.derivedArtifacts}.`);let n=Array.isArray(e.artifacts)?
637
- e.artifacts:[];if(!n.length||n.some(t=>!F(t?.path)))throw new Error("Genesis returned an invalid derived-artifact contra\
638
- ct.");return{...e,artifacts:n.map(t=>({...t}))}}var bn=Qr(),qo=Object.freeze(bn.artifacts.map(e=>e.path)),Je=new Map(bn.
639
- artifacts.map(e=>[e.id,e])),ei=Je.get("machine-city")?.path,ti=Je.get("program-city")?.path;if(!ei||!ti)throw new Error(
640
- "Genesis did not declare both City projection artifacts.");var ni=Je.get("call-web")?.path;if(!ni)throw new Error("Genes\
641
- is did not declare its call-web artifact.");async function D(e,n={},t={}){let s=F(n.projectRoot);if(!s||!W.isAbsolute(s))
642
- throw new TypeError("Genesis operations require an explicit absolute projectRoot.");return Hr(s,()=>e(Zr(n,t)))}async function Ko({
643
- workdir:e,promptContext:n}){let t=ee(n);return n.scope==="ephemeral"?t:(await D(ie.projectSessionContext,{projectRoot:e,
644
- hostDriver:ee,hostDriverInput:n})).output}async function L(e,n,t={}){let s=await D(e,t);if(s?.contract!==n)throw new Error(
645
- `Genesis returned ${s?.contract||"no contract identity"}; expected ${n}.`);return s}function K(e,n={}){return L(t=>xr({...t,
646
- name:e}),N.stackSection,n)}async function Ze(e,n={}){let t=await D(s=>jr({...s,names:e}),n);if(!Array.isArray(t)||t.length!==
647
- e.length||t.some((s,r)=>s?.contract!==N.stackSection||s.name!==e[r]))throw new Error("Genesis returned an invalid Stack \
648
- section inspection batch.");return t}async function Yo(e={}){if((await si(e)).status!=="current")throw Object.assign(new Error(
649
- "The project needs a current Genesis format before its Stack can be inspected."),{code:"vibe64_stack_format_required"});
650
- await br(W.join(e.projectRoot,Ne),"utf8");let t=await K(se,e);return{components:t.components,stackHash:t.stackHash}}async function Xo(e={}){
651
- let[n,t]=await Promise.all([K(_t,e),L(we,N.environment,e)]);return At({environment:t,section:n})}async function Jo(e={}){
652
- let[n,t]=await Promise.all([K(Vt,e),L(we,N.environment,e)]);return Gt({environment:t,section:n})}function Zo(e={}){return D(
653
- ie.verify,e)}function Qo(e={}){return L(we,N.environment,e)}function ea(e={}){return L(Pr,N.projectInspection,e)}function ta(e={}){
654
- return L(Mr,N.templates,e)}function na(e={}){return L(kr,N.templateApplication,e)}function sa(e={}){return L(Cr,N.engineering,
655
- e)}function ra(e={}){return L(Ar,N.collaboration,e)}async function si(e={}){let n=await D(Dr,e);if(!F(n?.status))throw new Error(
656
- "Genesis did not return a project-format status.");return{...n}}function ia(e={}){return L(Ur,N.engineering,e)}function oa(e={}){
657
- return L(Gr,N.collaboration,e)}async function aa({resourcesPreparing:e=!1,...n}={}){let[[t,s,r],i]=await Promise.all([Ze(
658
- [he,ye,se],n),L(we,N.environment,n)]);return{...Qt({environment:i,section:t,resourcesPreparing:e===!0}),resourceEstimates:be(
659
- {section:s,outputsSection:t,workspaceSetupSection:r})}}async function ca(e={}){let n=await K(ln,e);return mn({section:n})}
660
- async function ua(e={}){return it(await K(st,e))}async function pa(e={}){return nn(await K(en,e))}async function la(e={}){
661
- let[n,t,s]=await Ze([se,ye,he],e);return{...await on({projectRoot:e.projectRoot,section:n}),resourceEstimates:be({section:t,
662
- outputsSection:s,workspaceSetupSection:n})}}async function da(e={}){let[n,t,s]=await Ze([ye,he,se],e);return be({section:n,
663
- outputsSection:t,workspaceSetupSection:s})}async function ma({action:e={},environment:n,input:t={},projectRoot:s}){let r=Kr(
664
- e),i=Yr(t,e),o=m=>D(_r,{environment:n,projectRoot:s,request:i,sessionContextInstalled:!0,task:m},{prompt:!0}),u=()=>({prompt:i}),
665
- a=r,c;try{c=await o(a)}catch(m){let l=Object.hasOwn(fn,String(m?.code))?fn[m.code]:"";if(!l||l===r||t.automaticGenesisTask===
666
- !0)return u();a=l;try{c=await o(a)}catch{return u()}}let p=En(c.task)||a;return{context:{genesis:!0,requestedTask:r,task:p,
667
- verificationCommands:c.verificationCommands,warnings:c.warnings},originalPrompt:i,prompt:c.prompt,promptId:F(e.promptId||
668
- e.id)||p}}export{Ao as CALL_WEB_SCHEMA,Po as CITY_SCHEMA_VERSION,$o as GENESIS_BLUEPRINT_PATH,ni as GENESIS_CALL_WEB_PATH,qo as GENESIS_DERIVED_ARTIFACT_PATHS,
669
- ei as GENESIS_MACHINE_CITY_PATH,ti as GENESIS_PROGRAM_CITY_PATH,Ne as GENESIS_STACK_PATH,yt as GENESIS_STACK_SECTION_AMBIGUOUS,
670
- Vo as GENESIS_SUBSYSTEMS_PATH,No as MACHINE_CITY_SCHEMA,Co as PROGRAM_CITY_SCHEMA,Io as SOURCE_EXPLANATION_PROMPT_VERSION,
671
- kt as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,le as VIBE64_PACKAGING_CONTRACT,ne as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,
672
- jo as addGenesisStack,na as applyGenesisTemplate,En as assertGenesisPromptTask,yn as genesisCommandShimDirectory,Xr as genesisPackageBinDirectory,
673
- So as genesisParserEnvironment,Yn as genesisProjectContractNeedsAttention,Zn as genesisProjectFileDiagnostic,Jn as genesisProjectFileUnreadable,
674
- Yr as genesisPromptRequest,Kr as genesisPromptTask,Lo as initializeGenesisProject,Bo as inspectGenesisAgentIntegrations,
675
- ra as inspectGenesisCollaboration,Qr as inspectGenesisDerivedArtifacts,sa as inspectGenesisEngineering,Qo as inspectGenesisEnvironment,
676
- ea as inspectGenesisProject,si as inspectGenesisProjectFormat,Mo as inspectGenesisSkills,Yo as inspectGenesisStackComponents,
677
- Wo as inspectGenesisSubsystems,Ho as inspectVibe64ArchitectureInspection,zo as inspectVibe64ArchitectureLayout,ua as inspectVibe64ConnectedDevelopment,
678
- Xo as inspectVibe64Deployment,ca as inspectVibe64IntegrationSetup,aa as inspectVibe64Outputs,Jo as inspectVibe64Packaging,
679
- pa as inspectVibe64ProjectServices,da as inspectVibe64ResourceEstimates,la as inspectVibe64WorkspaceSetup,ta as listGenesisTemplates,
680
- _o as mergeArchitectureObservations,Rt as parseVibe64DeploymentLines,dn as parseVibe64IntegrationSetupLines,ge as parseVibe64OutputsLines,
681
- Lt as parseVibe64PackagingLines,tn as parseVibe64ProjectServicesLines,pn as parseVibe64ResourceEstimatesLines,Ee as parseVibe64WorkspaceSetupLines,
682
- zn as readArchitecturePreviewLocator,Fo as refreshGenesisCities,ma as renderGenesisPrompt,Xs as resolveVibe64OutputParameters,
683
- Mt as resolveVibe64PackagingEnvironment,oa as setGenesisCollaboration,ia as setGenesisEngineeringProfile,To as sourceExplanationGuidance,
684
- Uo as syncGenesisAgentIntegrations,Go as syncGenesisSkills,ko as validateArchitectureFacts,Ro as validateCallWeb,Oo as validateCityDocument,
685
- Zo as verifyGenesisProject,Ko as vibe64ConversationInstructions,ee as vibe64Driver,Do as vibe64HostContextEnvironment,wr as vibe64HostContextRegistry,
686
- Jr as vibe64HostContextResolverPath,xo as withGenesisCommandShim};
611
+ version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=yn(e.lines,{targets:n.status==="read\
612
+ y"?Ee(n.lines).targets:[],hasWorkspaceSetup:t.status==="ready"&&ye(t.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
613
+ kOperationError")throw o;s.push({code:En,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"i\
614
+ nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:kr,status:i,stackHash:e.stackHash,sectionHash:e.
615
+ sectionHash||"",estimatesHash:i==="ready"?R(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
616
+ fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var Or="vibe64.integration-setup.v1",bn="Integration setup",ie="VIBE64_INTEGRATION_SETUP_INVALID",Rr="- Command with `ru\
617
+ ntime` in `workdir`: `command` `argument`...";function vn(e,n={}){let{path:t="genesis/stack.md#Integration setup"}=n;if(Array.
618
+ isArray(e)||d(ie,t,"Integration setup requires exact Stack section lines."),w(e))return null;let s=e.map(i=>i.trim()).filter(
619
+ Boolean),r=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return r||d(ie,t,`Integration setu\
620
+ p requires exactly one entry: ${Rr}; or - Nothing.`),{argv:A(r[3],ie,t,"Integration setup command"),workdir:b(r[2],ie,t,
621
+ "Integration setup workdir"),runtimeRequirements:N(r[1],ie,t,"Integration setup runtimes")}}function wn({section:e={}}={}){
622
+ let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?vn(e.lines):null;return{contract:Or,status:n.length?"blo\
623
+ cked":t?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:t?R({version:1,command:t}):"",source:e.source||null,components:[
624
+ ...e.components||[]],command:t,diagnostics:n}}var Ar=new URL("./index.js",import.meta.url).href,Tn=Cr(Ar),we=new Map;async function Pr(e){if(!B.isAbsolute(e||""))throw new TypeError(
625
+ "Genesis host context requires an absolute runtime root.");let n=B.join(e,"genesis-context");if(!we.has(n)){let t=Nt(n).
626
+ catch(s=>{throw we.delete(n),s});we.set(n,t)}return we.get(n)}var{GENESIS_CONTRACTS:C,HOST_CONTEXT_RESOLVER_DATA_ENV:Dr,
627
+ HOST_CONTEXT_RESOLVER_ENV:$r,addStack:Vr,applyTemplate:xr,generatePrompt:jr,indexCodebase:Lr,initialize:Mr,inspectCollaboration:Gr,
628
+ inspectDerivedArtifacts:Ur,inspectEngineering:Br,inspectEnvironment:Se,inspectProject:Wr,inspectProjectFormat:Hr,inspectAgentIntegrations:zr,
629
+ inspectSkills:Fr,inspectStackSection:qr,inspectStackSections:Kr,inspectSubsystems:Yr,listTemplates:Xr,parserEnvironment:$o,
630
+ setCollaboration:Jr,setEngineeringProfile:Zr,syncAgentIntegrations:Qr,syncSkills:ei,withTrustedGitRepository:ti,SOURCE_EXPLANATION_PROMPT_VERSION:Vo,
631
+ sourceExplanationGuidance:xo,validateArchitectureFacts:jo,mergeArchitectureObservations:Lo,validateCityDocument:Mo,validateCallWeb:Go,
632
+ CALL_WEB_SCHEMA:Uo,MACHINE_CITY_SCHEMA:Bo,PROGRAM_CITY_SCHEMA:Wo,CITY_SCHEMA_VERSION:Ho}=oe;async function zo(e){let n=await Pr(
633
+ e);return{[$r]:ci(),[Dr]:JSON.stringify({registryPath:n.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var Fo="genesis\
634
+ /blueprint.md",qo="genesis/subsystems.md",ni=Object.freeze(["vue","django-postgresql","jskit-postgresql","postgresql","r\
635
+ ails-postgresql","spring-boot-postgresql"]),si=Object.freeze(["genesis-stack"]),In=Object.freeze({BLUEPRINT_INVALID:"blu\
636
+ eprint",BLUEPRINT_REQUIRED:"start"}),kn=new Set(["adopt","blueprint","describe","deslop","program","review","start","ui-\
637
+ pass","work"]),et=15e3;function tt(e,n=et){let t,s=new Promise((r,i)=>{t=setTimeout(()=>i(Object.assign(new Error(`Genes\
638
+ is did not answer within ${n} ms.`),{code:"vibe64_genesis_timeout"})),n)});return Promise.race([Promise.resolve().then(e),
639
+ s]).finally(()=>clearTimeout(t))}function ri(e,n={}){let{required:t=!1}=n,s=x(e);if(!s&&!t)return"";if(!kn.has(s))throw new TypeError(
640
+ s?`Unknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an explicit task.");return s}function ii(e={}){return ri(
641
+ e.genesisTask)||"work"}function oi(e={},n={}){return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,n.label].
642
+ map(x).find(Boolean)||"Continue the requested project work."}function ai(){let e=(Tn.resolve.paths("genesis-compiler")||
643
+ []).find(n=>Sn(B.join(n,"genesis-compiler"))&&Sn(B.join(n,".bin","genesis")));if(!e)throw new Error("The installed Genes\
644
+ is compiler executable could not be located.");return B.join(e,".bin")}function _n(){let e=Tn.resolve("@local/vibe64-gen\
645
+ esis/server");return B.resolve(B.dirname(e),"../../bin")}function ci(){return B.resolve(_n(),"vibe64-genesis-host-contex\
646
+ t")}function Ko(e=[]){let n=_n(),t=ai();return[...(Array.isArray(e)?e:[]).filter(r=>![n,t].includes(x(r))),n]}function ui(e={},n={}){
647
+ let{prompt:t=!1}=n;return{...e,...t?{hiddenStackPieces:ni}:{},stackPackages:si}}function Yo(e={}){return W(Vr,e)}function Xo(e={}){
648
+ return W(Mr,e)}function Jo(e={}){return te(Fr,e)}function Zo(e={}){return W(ei,e)}function Qo(e={}){return W(Qr,e)}function ea(e={}){
649
+ return te(zr,e)}function ta(e={}){return te(Yr,e)}async function na(e={}){return vt(await K(ft,e))}async function sa(e={}){
650
+ return It(await K(wt,e))}function ra(e={}){return W(Lr,e)}function pi(){let e=Ur();if(e?.contract!==C.derivedArtifacts)throw new Error(
651
+ `Genesis returned ${e?.contract||"no contract identity"}; expected ${C.derivedArtifacts}.`);let n=Array.isArray(e.artifacts)?
652
+ e.artifacts:[];if(!n.length||n.some(t=>!x(t?.path)))throw new Error("Genesis returned an invalid derived-artifact contra\
653
+ ct.");return{...e,artifacts:n.map(t=>({...t}))}}var On=pi(),ia=Object.freeze(On.artifacts.map(e=>e.path)),nt=new Map(On.
654
+ artifacts.map(e=>[e.id,e])),li=nt.get("machine-city")?.path,di=nt.get("program-city")?.path;if(!li||!di)throw new Error(
655
+ "Genesis did not declare both City projection artifacts.");var mi=nt.get("call-web")?.path;if(!mi)throw new Error("Genes\
656
+ is did not declare its call-web artifact.");async function W(e,n={},t={}){let s=x(n.projectRoot);if(!s||!B.isAbsolute(s))
657
+ throw new TypeError("Genesis operations require an explicit absolute projectRoot.");return ti(s,()=>e(ui(n,t)))}function Rn(){}
658
+ function hi(e){return`Genesis project guidance is unavailable for this conversation (${x(e?.message||e).replace(/\s+/gu,
659
+ " ").slice(0,300)||"no reason given"}). Work from the repository itself, where the genesis/ files still describe the pro\
660
+ ject when present, and tell the user that Genesis guidance did not load if it matters to the request.`}async function oa({
661
+ workdir:e,promptContext:n},{onGenesisUnavailable:t=Rn,timeoutMs:s=et}={}){let r=ee(n);if(n.scope==="ephemeral")return r;
662
+ let i;try{let o=await tt(()=>W(oe.projectSessionContext,{projectRoot:e,hostDriver:ee,hostDriverInput:n}),s);if(typeof o?.
663
+ output=="string"&&o.output.trim())return o.output;i=new Error("Genesis returned no session guidance.")}catch(o){i=o}return t(
664
+ i),`${hi(i)}
665
+
666
+ ${r}`}function te(e,n={}){return tt(()=>W(e,n))}function An(e,n){if(e?.contract!==n)throw new Error(`Genesis returned ${e?.
667
+ contract||"no contract identity"}; expected ${n}.`);return e}async function F(e,n,t={}){return An(await te(e,t),n)}async function st(e,n,t={}){
668
+ return An(await W(e,t),n)}function K(e,n={}){return F(t=>qr({...t,name:e}),C.stackSection,n)}async function rt(e,n={}){let t=await te(
669
+ s=>Kr({...s,names:e}),n);if(!Array.isArray(t)||t.length!==e.length||t.some((s,r)=>s?.contract!==C.stackSection||s.name!==
670
+ e[r]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return t}async function aa(e={}){if((await fi(
671
+ e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its Stack can be\
672
+ inspected."),{code:"vibe64_stack_format_required"});await Nr(B.join(e.projectRoot,Ce),"utf8");let t=await K(re,e);return{
673
+ components:t.components,stackHash:t.stackHash}}async function ca(e={}){let[n,t]=await Promise.all([K(Pt,e),F(Se,C.environment,
674
+ e)]);return jt({environment:t,section:n})}async function ua(e={}){let[n,t]=await Promise.all([K(Wt,e),F(Se,C.environment,
675
+ e)]);return Kt({environment:t,section:n})}function pa(e={}){return W(oe.verify,e)}function la(e={}){return F(Se,C.environment,
676
+ e)}function da(e={}){return F(Wr,C.projectInspection,e)}function ma(e={}){return F(Xr,C.templates,e)}function ha(e={}){return st(
677
+ xr,C.templateApplication,e)}function fa(e={}){return F(Br,C.engineering,e)}function ga(e={}){return F(Gr,C.collaboration,
678
+ e)}async function fi(e={}){let n=await te(Hr,e);if(!x(n?.status))throw new Error("Genesis did not return a project-forma\
679
+ t status.");return{...n}}function Ea(e={}){return st(Zr,C.engineering,e)}function ya(e={}){return st(Jr,C.collaboration,
680
+ e)}async function ba({resourcesPreparing:e=!1,...n}={}){let[[t,s,r],i]=await Promise.all([rt([fe,be,re],n),F(Se,C.environment,
681
+ n)]);return{...cn({environment:i,section:t,resourcesPreparing:e===!0}),resourceEstimates:ve({section:s,outputsSection:t,
682
+ workspaceSetupSection:r})}}async function va(e={}){let n=await K(bn,e);return wn({section:n})}async function wa(e={}){return lt(
683
+ await K(ut,e))}async function Sa(e={}){return ln(await K(un,e))}async function Ia(e={}){let[n,t,s]=await rt([re,be,fe],e);
684
+ return{...await hn({projectRoot:e.projectRoot,section:n}),resourceEstimates:ve({section:t,outputsSection:s,workspaceSetupSection:n})}}
685
+ async function Ta(e={}){let[n,t,s]=await rt([be,fe,re],e);return ve({section:n,outputsSection:t,workspaceSetupSection:s})}
686
+ async function ka({action:e={},environment:n,input:t={},onGenesisUnavailable:s=Rn,projectRoot:r,timeoutMs:i=et}){let o=ii(
687
+ e),c=oi(t,e),a=g=>W(jr,{environment:n,projectRoot:r,request:c,sessionContextInstalled:!0,task:g},{prompt:!0}),u=async()=>{
688
+ try{return{result:await a(o),task:o}}catch(g){let S=Object.hasOwn(In,String(g?.code))?In[g.code]:"";if(!S||S===o||t.automaticGenesisTask===
689
+ !0)throw g;return{result:await a(S),task:S}}},p;try{if(p=await tt(u,i),typeof p.result?.prompt!="string"||!p.result.prompt.
690
+ trim())throw new Error("Genesis returned no prompt.")}catch(g){return s(g),{prompt:c}}let{result:m,task:l}=p,f=kn.has(x(
691
+ m.task))?x(m.task):l;return{context:{genesis:!0,requestedTask:o,task:f,verificationCommands:m.verificationCommands,warnings:m.
692
+ warnings},originalPrompt:c,prompt:m.prompt,promptId:x(e.promptId||e.id)||f}}export{Uo as CALL_WEB_SCHEMA,Ho as CITY_SCHEMA_VERSION,Fo as GENESIS_BLUEPRINT_PATH,mi as GENESIS_CALL_WEB_PATH,ia as GENESIS_DERIVED_ARTIFACT_PATHS,
693
+ li as GENESIS_MACHINE_CITY_PATH,di as GENESIS_PROGRAM_CITY_PATH,Ce as GENESIS_STACK_PATH,Tt as GENESIS_STACK_SECTION_AMBIGUOUS,
694
+ qo as GENESIS_SUBSYSTEMS_PATH,et as GENESIS_USER_PATH_TIMEOUT_MS,Bo as MACHINE_CITY_SCHEMA,Wo as PROGRAM_CITY_SCHEMA,Vo as SOURCE_EXPLANATION_PROMPT_VERSION,
695
+ Ct as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,de as VIBE64_PACKAGING_CONTRACT,se as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,
696
+ Yo as addGenesisStack,ha as applyGenesisTemplate,ri as assertGenesisPromptTask,_n as genesisCommandShimDirectory,ai as genesisPackageBinDirectory,
697
+ $o as genesisParserEnvironment,is as genesisProjectContractNeedsAttention,cs as genesisProjectFileDiagnostic,as as genesisProjectFileUnreadable,
698
+ oi as genesisPromptRequest,ii as genesisPromptTask,Xo as initializeGenesisProject,ea as inspectGenesisAgentIntegrations,
699
+ ga as inspectGenesisCollaboration,pi as inspectGenesisDerivedArtifacts,fa as inspectGenesisEngineering,la as inspectGenesisEnvironment,
700
+ da as inspectGenesisProject,fi as inspectGenesisProjectFormat,Jo as inspectGenesisSkills,aa as inspectGenesisStackComponents,
701
+ ta as inspectGenesisSubsystems,na as inspectVibe64ArchitectureInspection,sa as inspectVibe64ArchitectureLayout,wa as inspectVibe64ConnectedDevelopment,
702
+ ca as inspectVibe64Deployment,va as inspectVibe64IntegrationSetup,ba as inspectVibe64Outputs,ua as inspectVibe64Packaging,
703
+ Sa as inspectVibe64ProjectServices,Ta as inspectVibe64ResourceEstimates,Ia as inspectVibe64WorkspaceSetup,ma as listGenesisTemplates,
704
+ Lo as mergeArchitectureObservations,xt as parseVibe64DeploymentLines,vn as parseVibe64IntegrationSetupLines,Ee as parseVibe64OutputsLines,
705
+ Ft as parseVibe64PackagingLines,pn as parseVibe64ProjectServicesLines,yn as parseVibe64ResourceEstimatesLines,ye as parseVibe64WorkspaceSetupLines,
706
+ ts as readArchitecturePreviewLocator,ra as refreshGenesisCities,ka as renderGenesisPrompt,ar as resolveVibe64OutputParameters,
707
+ qt as resolveVibe64PackagingEnvironment,ya as setGenesisCollaboration,Ea as setGenesisEngineeringProfile,xo as sourceExplanationGuidance,
708
+ Qo as syncGenesisAgentIntegrations,Zo as syncGenesisSkills,jo as validateArchitectureFacts,Go as validateCallWeb,Mo as validateCityDocument,
709
+ pa as verifyGenesisProject,oa as vibe64ConversationInstructions,ee as vibe64Driver,zo as vibe64HostContextEnvironment,Pr as vibe64HostContextRegistry,
710
+ ci as vibe64HostContextResolverPath,Ko as withGenesisCommandShim,tt as withinGenesisDeadline};