vibe64 0.1.80 → 0.1.81
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.
- package/bin/run.js +1552 -1533
- package/bin/server.js +98 -98
- package/bin/upgrade-state.js +2125 -2120
- package/dist/assets/{GithubBrowserTabs-d5SRhPw-.js → GithubBrowserTabs-UgVzUvA8.js} +1 -1
- package/dist/assets/GithubBrowserTabs-UgVzUvA8.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-UgVzUvA8.js.gz +0 -0
- package/dist/assets/{LocalDatabaseServer-CIAX_Xx8.js → LocalDatabaseServer-B0mgR6xe.js} +1 -1
- package/dist/assets/LocalDatabaseServer-B0mgR6xe.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-B0mgR6xe.js.gz +0 -0
- package/dist/assets/{Vibe64DashboardPageHeader-CyYFBVSw.js → Vibe64DashboardPageHeader-CMQYBgWL.js} +1 -1
- package/dist/assets/Vibe64DashboardPageHeader-CMQYBgWL.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-CMQYBgWL.js.gz +0 -0
- package/dist/assets/{Vibe64DatabaseWorkspace-Dep64whC.js → Vibe64DatabaseWorkspace-CUnOSo5z.js} +1 -1
- package/dist/assets/Vibe64DatabaseWorkspace-CUnOSo5z.js.br +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-CUnOSo5z.js.gz +0 -0
- package/dist/assets/{Vibe64FileArea-r9PP5pT7.js → Vibe64FileArea-Cd_HSisZ.js} +1 -1
- package/dist/assets/Vibe64FileArea-Cd_HSisZ.js.br +0 -0
- package/dist/assets/Vibe64FileArea-Cd_HSisZ.js.gz +0 -0
- package/dist/assets/{Vibe64OutputControls-gSUdkqME.css → Vibe64OutputControls-DDPPJHqW.css} +1 -1
- package/dist/assets/Vibe64OutputControls-DDPPJHqW.css.br +0 -0
- package/dist/assets/{Vibe64OutputControls-gSUdkqME.css.gz → Vibe64OutputControls-DDPPJHqW.css.gz} +0 -0
- package/dist/assets/Vibe64OutputControls-wE84JA-i.js +8 -0
- package/dist/assets/Vibe64OutputControls-wE84JA-i.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-wE84JA-i.js.gz +0 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-C_ez14Jz.js → Vibe64RepositoryWorkspace-r1nyOCPI.js} +1 -1
- package/dist/assets/Vibe64RepositoryWorkspace-r1nyOCPI.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-r1nyOCPI.js.gz +0 -0
- package/dist/assets/{Vibe64SessionFiles-CJPrBsND.js → Vibe64SessionFiles-BPaUtcqb.js} +1 -1
- package/dist/assets/Vibe64SessionFiles-BPaUtcqb.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-BPaUtcqb.js.gz +0 -0
- package/dist/assets/{Vibe64SessionSourceEditor-CwE0Y-ka.js → Vibe64SessionSourceEditor-ViIcO8eW.js} +1 -1
- package/dist/assets/Vibe64SessionSourceEditor-ViIcO8eW.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-ViIcO8eW.js.gz +0 -0
- package/dist/assets/{Vibe64UiStoryboardView-COViVA_8.js → Vibe64UiStoryboardView-NGQWuMMm.js} +1 -1
- package/dist/assets/Vibe64UiStoryboardView-NGQWuMMm.js.br +0 -0
- package/dist/assets/{Vibe64UiStoryboardView-COViVA_8.js.gz → Vibe64UiStoryboardView-NGQWuMMm.js.gz} +0 -0
- package/dist/assets/{_pageId_-DuE37c72.js → _pageId_-B85-uWHm.js} +1 -1
- package/dist/assets/{_sessionId_-T6qoKZhb.js → _sessionId_-Czv-ZpF_.js} +1 -1
- package/dist/assets/_sessionId_-Czv-ZpF_.js.br +0 -0
- package/dist/assets/_sessionId_-Czv-ZpF_.js.gz +0 -0
- package/dist/assets/{_sessionTool_-B-b_DFay.js → _sessionTool_-5MB1BVLc.js} +1 -1
- package/dist/assets/access-CxWgaYa4.css +1 -0
- package/dist/assets/access-CxWgaYa4.css.br +0 -0
- package/dist/assets/access-CxWgaYa4.css.gz +0 -0
- package/dist/assets/access-_lYZqkmu.js +1 -0
- package/dist/assets/access-_lYZqkmu.js.br +0 -0
- package/dist/assets/access-_lYZqkmu.js.gz +0 -0
- package/dist/assets/{app-BM5ppUKY.js → app-CHReDfqx.js} +1 -1
- package/dist/assets/app-CHReDfqx.js.br +0 -0
- package/dist/assets/app-CHReDfqx.js.gz +0 -0
- package/dist/assets/{changes-CI15aJ2s.js → changes-CQ7yrQma.js} +1 -1
- package/dist/assets/{client-CtgiCplj.js → client-C4xYnFd4.js} +2 -2
- package/dist/assets/client-C4xYnFd4.js.br +0 -0
- package/dist/assets/client-C4xYnFd4.js.gz +0 -0
- package/dist/assets/{client-wU-vn9Gt.js → client-CtjmztrY.js} +2 -2
- package/dist/assets/client-CtjmztrY.js.br +0 -0
- package/dist/assets/client-CtjmztrY.js.gz +0 -0
- package/dist/assets/{dashboard-DD-Kz8sQ.js → dashboard-ByA_kmTW.js} +1 -1
- package/dist/assets/{english-definitions-B-puV4oO.js → english-definitions-CitxWNut.js} +1 -1
- package/dist/assets/english-definitions-CitxWNut.js.br +0 -0
- package/dist/assets/english-definitions-CitxWNut.js.gz +0 -0
- package/dist/assets/{env-CsRMp84w.js → env-eTUgWLQC.js} +1 -1
- package/dist/assets/env-eTUgWLQC.js.br +0 -0
- package/dist/assets/env-eTUgWLQC.js.gz +0 -0
- package/dist/assets/{error-CL5AgVRX.js → error-C0UrtZmi.js} +1 -1
- package/dist/assets/error-C0UrtZmi.js.br +0 -0
- package/dist/assets/error-C0UrtZmi.js.gz +0 -0
- package/dist/assets/{fileTypes-CFECKFVN.js → fileTypes-CXnnyMwR.js} +1 -1
- package/dist/assets/fileTypes-CXnnyMwR.js.br +0 -0
- package/dist/assets/fileTypes-CXnnyMwR.js.gz +0 -0
- package/dist/assets/{health-4aQl5EcU.js → health-jzzrSqjr.js} +1 -1
- package/dist/assets/health-jzzrSqjr.js.br +0 -0
- package/dist/assets/health-jzzrSqjr.js.gz +0 -0
- package/dist/assets/{history-B5Sor4EE.js → history-BQwMjBJd.js} +1 -1
- package/dist/assets/history-BQwMjBJd.js.br +0 -0
- package/dist/assets/history-BQwMjBJd.js.gz +0 -0
- package/dist/assets/{index-BAvE8_Ib.js → index-CAK2HDYR.js} +4 -4
- package/dist/assets/index-CAK2HDYR.js.br +0 -0
- package/dist/assets/index-CAK2HDYR.js.gz +0 -0
- package/dist/assets/{integrations-DksSxQbj.js → integrations-C2CaRjiP.js} +1 -1
- package/dist/assets/integrations-C2CaRjiP.js.br +0 -0
- package/dist/assets/integrations-C2CaRjiP.js.gz +0 -0
- package/dist/assets/{issues-DK2L8AHT.js → issues-CeASf5Q3.js} +1 -1
- package/dist/assets/issues-CeASf5Q3.js.br +0 -0
- package/dist/assets/issues-CeASf5Q3.js.gz +0 -0
- package/dist/assets/{learning-DeuGeINY.js → learning-BnxM8KFn.js} +1 -1
- package/dist/assets/{packages-Du3QFyu-.js → packages-DsbP-335.js} +1 -1
- package/dist/assets/packages-DsbP-335.js.br +0 -0
- package/dist/assets/packages-DsbP-335.js.gz +0 -0
- package/dist/assets/{pages-CBvnECLI.js → pages-Bh75jP9l.js} +1 -1
- package/dist/assets/{pages-D3MpRYy4.js → pages-Cm2Ik25R.js} +1 -1
- package/dist/assets/pages-Cm2Ik25R.js.br +3 -0
- package/dist/assets/pages-Cm2Ik25R.js.gz +0 -0
- package/dist/assets/previewIdentity-DCkBfZa_.js +1 -0
- package/dist/assets/previewIdentity-DCkBfZa_.js.br +0 -0
- package/dist/assets/previewIdentity-DCkBfZa_.js.gz +0 -0
- package/dist/assets/{project-BFylqlOt.js → project-DDVHJCsT.js} +6 -6
- package/dist/assets/project-DDVHJCsT.js.br +0 -0
- package/dist/assets/project-DDVHJCsT.js.gz +0 -0
- package/dist/assets/{project-files-CHgBwX2E.js → project-files-ElZse6_M.js} +1 -1
- package/dist/assets/project-files-ElZse6_M.js.br +0 -0
- package/dist/assets/project-files-ElZse6_M.js.gz +0 -0
- package/dist/assets/{project-shared-ShellOutlet-CIoqgO35.js → project-shared-ShellOutlet-hYi9JzYx.js} +1 -1
- package/dist/assets/project-shared-ShellOutlet-hYi9JzYx.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-hYi9JzYx.js.gz +0 -0
- package/dist/assets/{project-shared-VBottomSheet-Bezz1r7A.js → project-shared-VBottomSheet-P9-5OUQO.js} +1 -1
- package/dist/assets/project-shared-VBottomSheet-P9-5OUQO.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-P9-5OUQO.js.gz +0 -0
- package/dist/assets/{project-shared-VToolbar-DmXu_VIt.js → project-shared-VToolbar-D1kx7b3m.js} +1 -1
- package/dist/assets/project-shared-VToolbar-D1kx7b3m.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-D1kx7b3m.js.gz +0 -0
- package/dist/assets/{project-shared-pageNames-BiomB55Q.js → project-shared-pageNames-CyQXGE8t.js} +1 -1
- package/dist/assets/project-shared-pageNames-CyQXGE8t.js.br +0 -0
- package/dist/assets/project-shared-pageNames-CyQXGE8t.js.gz +0 -0
- package/dist/assets/{pull-requests-CPBGulVu.js → pull-requests-DTCEgq84.js} +1 -1
- package/dist/assets/pull-requests-DTCEgq84.js.br +0 -0
- package/dist/assets/pull-requests-DTCEgq84.js.gz +0 -0
- package/dist/assets/{repository-CWDpx49H.js → repository-D4wlLFlp.js} +1 -1
- package/dist/assets/{session-D2z1O4Y4.js → session-Dd03C8Qv.js} +1 -1
- package/dist/assets/session-Dd03C8Qv.js.br +0 -0
- package/dist/assets/session-Dd03C8Qv.js.gz +0 -0
- package/dist/assets/{settings-BKZcbISO.css → settings-BHwAy_Xu.css} +1 -1
- package/dist/assets/settings-BHwAy_Xu.css.br +0 -0
- package/dist/assets/settings-BHwAy_Xu.css.gz +0 -0
- package/dist/assets/settings-BcwYELAX.js +1 -0
- package/dist/assets/settings-BcwYELAX.js.br +0 -0
- package/dist/assets/settings-BcwYELAX.js.gz +0 -0
- package/dist/assets/{useArchivedVibe64Sessions-C3jJk531.js → useArchivedVibe64Sessions-wVsjRSIG.js} +1 -1
- package/dist/assets/useArchivedVibe64Sessions-wVsjRSIG.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-wVsjRSIG.js.gz +0 -0
- package/dist/assets/{vibe64AttachmentDownload-DcLsJc9X.js → vibe64AttachmentDownload-DrOvrZHW.js} +1 -1
- package/dist/assets/{vibe64SavedEnvValues-hAfcxHhJ.js → vibe64SavedEnvValues-BbR2B3zH.js} +1 -1
- package/dist/assets/{vue-flow-core-BwhpINSc.js → vue-flow-core-C2tePE4m.js} +1 -1
- package/dist/assets/vue-flow-core-C2tePE4m.js.br +0 -0
- package/dist/assets/vue-flow-core-C2tePE4m.js.gz +0 -0
- package/dist/index.html +2 -2
- package/docs/colleague-usage/connected-projects.md +61 -8
- package/docs/colleague-usage/connected-repositories.md +12 -6
- package/docs/colleague-usage/github-work.md +34 -0
- package/docs/colleague-usage/learning-course-catalogue.md +11 -0
- package/docs/colleague-usage/managed-app-access.md +34 -2
- package/docs/colleague-usage/passes.md +2 -1
- package/docs/colleague-usage/preview.md +3 -0
- package/docs/colleague-usage/project-language-tools.md +2 -1
- package/docs/colleague-usage/project-settings.md +3 -0
- package/docs/colleague-usage/session-archive.md +2 -1
- package/docs/colleague-usage/sessions.md +37 -5
- package/docs/training-content.md +11 -0
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +345 -342
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +22 -21
- package/node_modules/@local/vibe64-genesis/src/server/index.js +234 -220
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +123 -108
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1698 -1145
- package/package.json +1 -1
- package/server.bundle.mjs +35045 -34769
- package/dist/assets/GithubBrowserTabs-d5SRhPw-.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-d5SRhPw-.js.gz +0 -0
- package/dist/assets/LocalDatabaseServer-CIAX_Xx8.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-CIAX_Xx8.js.gz +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-CyYFBVSw.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-CyYFBVSw.js.gz +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-Dep64whC.js.br +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-Dep64whC.js.gz +0 -0
- package/dist/assets/Vibe64FileArea-r9PP5pT7.js.br +0 -0
- package/dist/assets/Vibe64FileArea-r9PP5pT7.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-B6wjUtLL.js +0 -8
- package/dist/assets/Vibe64OutputControls-B6wjUtLL.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-B6wjUtLL.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-gSUdkqME.css.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-C_ez14Jz.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-C_ez14Jz.js.gz +0 -0
- package/dist/assets/Vibe64SessionFiles-CJPrBsND.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-CJPrBsND.js.gz +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-CwE0Y-ka.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-CwE0Y-ka.js.gz +0 -0
- package/dist/assets/Vibe64UiStoryboardView-COViVA_8.js.br +0 -0
- package/dist/assets/_sessionId_-T6qoKZhb.js.br +0 -0
- package/dist/assets/_sessionId_-T6qoKZhb.js.gz +0 -0
- package/dist/assets/access-BH1OsqPS.css +0 -1
- package/dist/assets/access-BH1OsqPS.css.br +0 -3
- package/dist/assets/access-BH1OsqPS.css.gz +0 -0
- package/dist/assets/access-Dx-76I4I.js +0 -1
- package/dist/assets/access-Dx-76I4I.js.br +0 -0
- package/dist/assets/access-Dx-76I4I.js.gz +0 -0
- package/dist/assets/app-BM5ppUKY.js.br +0 -0
- package/dist/assets/app-BM5ppUKY.js.gz +0 -0
- package/dist/assets/client-CtgiCplj.js.br +0 -0
- package/dist/assets/client-CtgiCplj.js.gz +0 -0
- package/dist/assets/client-wU-vn9Gt.js.br +0 -0
- package/dist/assets/client-wU-vn9Gt.js.gz +0 -0
- package/dist/assets/english-definitions-B-puV4oO.js.br +0 -0
- package/dist/assets/english-definitions-B-puV4oO.js.gz +0 -0
- package/dist/assets/env-CsRMp84w.js.br +0 -0
- package/dist/assets/env-CsRMp84w.js.gz +0 -0
- package/dist/assets/error-CL5AgVRX.js.br +0 -0
- package/dist/assets/error-CL5AgVRX.js.gz +0 -0
- package/dist/assets/fileTypes-CFECKFVN.js.br +0 -0
- package/dist/assets/fileTypes-CFECKFVN.js.gz +0 -0
- package/dist/assets/health-4aQl5EcU.js.br +0 -0
- package/dist/assets/health-4aQl5EcU.js.gz +0 -0
- package/dist/assets/history-B5Sor4EE.js.br +0 -0
- package/dist/assets/history-B5Sor4EE.js.gz +0 -0
- package/dist/assets/index-BAvE8_Ib.js.br +0 -0
- package/dist/assets/index-BAvE8_Ib.js.gz +0 -0
- package/dist/assets/integrations-DksSxQbj.js.br +0 -0
- package/dist/assets/integrations-DksSxQbj.js.gz +0 -0
- package/dist/assets/issues-DK2L8AHT.js.br +0 -0
- package/dist/assets/issues-DK2L8AHT.js.gz +0 -0
- package/dist/assets/packages-Du3QFyu-.js.br +0 -0
- package/dist/assets/packages-Du3QFyu-.js.gz +0 -0
- package/dist/assets/pages-D3MpRYy4.js.br +0 -0
- package/dist/assets/pages-D3MpRYy4.js.gz +0 -0
- package/dist/assets/project-BFylqlOt.js.br +0 -0
- package/dist/assets/project-BFylqlOt.js.gz +0 -0
- package/dist/assets/project-files-CHgBwX2E.js.br +0 -0
- package/dist/assets/project-files-CHgBwX2E.js.gz +0 -0
- package/dist/assets/project-shared-ShellOutlet-CIoqgO35.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-CIoqgO35.js.gz +0 -0
- package/dist/assets/project-shared-VBottomSheet-Bezz1r7A.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-Bezz1r7A.js.gz +0 -0
- package/dist/assets/project-shared-VToolbar-DmXu_VIt.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-DmXu_VIt.js.gz +0 -0
- package/dist/assets/project-shared-pageNames-BiomB55Q.js.br +0 -0
- package/dist/assets/project-shared-pageNames-BiomB55Q.js.gz +0 -0
- package/dist/assets/pull-requests-CPBGulVu.js.br +0 -0
- package/dist/assets/pull-requests-CPBGulVu.js.gz +0 -0
- package/dist/assets/session-D2z1O4Y4.js.br +0 -0
- package/dist/assets/session-D2z1O4Y4.js.gz +0 -0
- package/dist/assets/settings-BKZcbISO.css.br +0 -0
- package/dist/assets/settings-BKZcbISO.css.gz +0 -0
- package/dist/assets/settings-BZRdBSb9.js +0 -1
- package/dist/assets/settings-BZRdBSb9.js.br +0 -0
- package/dist/assets/settings-BZRdBSb9.js.gz +0 -0
- package/dist/assets/useArchivedVibe64Sessions-C3jJk531.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-C3jJk531.js.gz +0 -0
- package/dist/assets/vue-flow-core-BwhpINSc.js.br +0 -0
- package/dist/assets/vue-flow-core-BwhpINSc.js.gz +0 -0
|
@@ -6,7 +6,7 @@ ging",VIBE64_RESOURCE_ESTIMATES_INVALID:"resource-estimates",VIBE64_CONNECTED_DE
|
|
|
6
6
|
VIBE64_PROJECT_SERVICES_INVALID:"project-services",VIBE64_INTEGRATION_SETUP_INVALID:"integration-setup",VIBE64_ARCHITECTURE_INSPECTION_INVALID:"\
|
|
7
7
|
architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout",VIBE64_STAGING_DATA_INVALID:"staging-d\
|
|
8
8
|
ata"}),Bs=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;function Ws(e,t){let n=Gt[e],s=String(t).replace(Bs,"");return n?
|
|
9
|
-
`${s} Exact grammar: vibe64-helper spec ${n}.`:s}function
|
|
9
|
+
`${s} Exact grammar: vibe64-helper spec ${n}.`:s}function y(e,t,n){return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}\
|
|
10
10
|
.`}function d(e,t,n,s,i={}){throw new _e(e,Ws(e,n),{path:t,...s===void 0?{}:{line:s},...i})}function w(e,t,n,s,i){return(typeof e!=
|
|
11
11
|
"string"||!e.trim()||/[\0\r\n]/u.test(e))&&d(t,n,`${s} must be one non-empty line.`,i),e.trim()}function zs(e){let t=[...String(
|
|
12
12
|
e||"").matchAll(/`([^`\r\n]+)`/gu)];return t.length===0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function v(e,t,n,s,i,r={}){
|
|
@@ -15,7 +15,7 @@ u))){let u=o===void 0?"separate non-empty":`exactly ${o}`;d(t,n,`${s} must conta
|
|
|
15
15
|
es"}.`,i)}return a}function Hs(e=""){return typeof e=="string"&&!!e&&!/[\s\0{}]/u.test(e)&&!et.isAbsolute(e)&&!e.split(/[\\/]/u).
|
|
16
16
|
includes("..")}function N(e,t,n,s,i){let r=v(e,t,n,s,i);return Hs(r[0])||d(t,n,`${s} must begin with a safe executable.`,
|
|
17
17
|
i),r}function Fs(e=""){return typeof e=="string"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!et.posix.isAbsolute(e)&&et.posix.normalize(
|
|
18
|
-
e)===e&&!e.split("/").some(t=>!t||t==="..")}function
|
|
18
|
+
e)===e&&!e.split("/").some(t=>!t||t==="..")}function S(e,t,n,s,i,r={}){let{allowRoot:o=!0}=r;return(!Fs(e)||!o&&e===".")&&
|
|
19
19
|
d(t,n,`${s} must be a canonical project-relative path.`,i),e}function Ie(e,t,n,s,i){let r=v(e,t,n,s,i);return r.some(o=>o.
|
|
20
20
|
startsWith("/")||o.includes("\\")||o.includes("***")||/[?[\]{}!]/u.test(o)||o.split("/").some(c=>!c||[".",".."].includes(
|
|
21
21
|
c)))&&d(t,n,`${s} must be canonical project-relative globs using only * and ** wildcards.`,i),new Set(r).size!==r.length&&
|
|
@@ -29,13 +29,13 @@ be from 200 through 399.`,i),{kind:"http",method:"GET",path:nt(r[1],t,n,`${s} pa
|
|
|
29
29
|
Ks=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,Ys=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Xs=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
|
|
30
30
|
function Te(e,t,n,s,i,{form:r,observed:o=e}){let c=String(e||"").match(qs);c||d(t,n,`Every ${s} entry must use: ${r}`,i,
|
|
31
31
|
{observed:o});let a=c[1].match(Ks),u=a?null:c[1].match(Ys),l=a?a[1]:u?u[1]:c[1],m=a?.[2]||u?.[2]||"",p=l.match(Xs);return{
|
|
32
|
-
argv:N(c[2],t,n,`${s} command`,i),runtimeRequirements:C(p?p[1]:l,t,n,`${s} runtimes`,i),workdir:
|
|
33
|
-
orkdir`,i),...m?{condition:{pathExists:
|
|
32
|
+
argv:N(c[2],t,n,`${s} command`,i),runtimeRequirements:C(p?p[1]:l,t,n,`${s} runtimes`,i),workdir:S(p?p[2]:".",t,n,`${s} w\
|
|
33
|
+
orkdir`,i),...m?{condition:{pathExists:S(m,t,n,`${s} condition path`,i,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function tt(e){
|
|
34
34
|
return Array.isArray(e)?e.map(tt):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,tt(e[t])])):e}
|
|
35
|
-
function
|
|
35
|
+
function O(e){let t=`${JSON.stringify(tt(e),null,2)}
|
|
36
36
|
`;return`sha256:${Us("sha256").update(t).digest("hex")}`}function M(e={},t={},n="operation"){if(e.stackHash!==t.stackHash)
|
|
37
|
-
throw new _e("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${n}. Retry the operation.`)}var
|
|
38
|
-
function
|
|
37
|
+
throw new _e("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${n}. Retry the operation.`)}var ke=/^[A-Za-z][A-Za-z0-9_-]{0,39}$/u;
|
|
38
|
+
function Oe(e){return new Map((Array.isArray(e)?e:[]).map(t=>t?.resource).filter(t=>t&&typeof t.id=="string").map(t=>[t.
|
|
39
39
|
id,t]))}function H(e=[]){return[...new Set(e)].sort()}function _(e=[]){let t=e.map(n=>n.trim()).filter(Boolean);return t.
|
|
40
40
|
length===1&&t[0]==="- Nothing."}var _a=Object.freeze({SPEC_BY_ERROR_CODE:Gt});var Zs="custom";var Js=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
|
|
41
41
|
(PHP)"}),Object.freeze({value:"pip",label:"pip (Python)"}),Object.freeze({value:"bundler",label:"Bundler (Ruby)"}),Object.
|
|
@@ -50,8 +50,8 @@ ce";function Ft(e={}){let t="",n="",s=null,i=[],r=[],o=[...e.diagnostics||[]],c=
|
|
|
50
50
|
l=!1;for(let[m,p]of e.lines.entries()){let E=p.trim();if(!E)continue;let f=m+1,T=E.match(/^- Default package type: `([^`\r\n]*)`$/u);
|
|
51
51
|
if(T){n&&d($,L,"Declare exactly one default package type.",f),Bt(T[1])||d($,L,`Default package type must be ${Wt()}.`,f),
|
|
52
52
|
n=T[1];continue}let U=E.match(/^- Sources file: `([^`\r\n]+)`$/u);if(U){t&&d($,L,"Declare exactly one Sources file.",f),
|
|
53
|
-
t=
|
|
54
|
-
rces file must be outside Git metadata.",f);continue}let I=E.match(si),X=I?null:E.match(ti);!I&&!X&&d($,L,
|
|
53
|
+
t=S(U[1],$,L,"Connected sources file",f,{allowRoot:!1}),t.split("/").some(Gs=>Gs.toLowerCase()===".git")&&d($,L,"The Sou\
|
|
54
|
+
rces file must be outside Git metadata.",f);continue}let I=E.match(si),X=I?null:E.match(ti);!I&&!X&&d($,L,y("Connected d\
|
|
55
55
|
evelopment entry",E,ei),f);let Z=I?"Custom runner":X[1],ce=I?"prepare":ni[Z];!I&&u&&ce==="prepare"&&d($,L,"All Prepare e\
|
|
56
56
|
ntries must precede Verify entries.",f),!I&&l&&ce!=="save"&&d($,L,"All Save entries must follow the Prepare and Verify e\
|
|
57
57
|
ntries.",f),u||=!I&&ce==="verify",l||=ce==="save";let we={label:I?ii:w(X[2],$,L,`Connected development ${Z} label`,f),...Te(
|
|
@@ -60,7 +60,7 @@ s must run unconditionally; a skipped step cannot prove source consumption.",f),
|
|
|
60
60
|
runner.",f),s=we):ce==="save"?r.push(we):i.push({...we,phase:ce})}(i.length||r.length||s)&&!t&&d($,L,"Prepare, Verify an\
|
|
61
61
|
d Save entries and a Custom runner read the Sources file: declare it too."),!n&&!t&&d($,L,"Declare a default package typ\
|
|
62
62
|
e, a Sources file, or both; use `- Nothing.` for no declaration.")}let a=e.status==="blocked"||o.length?"blocked":c&&(n||
|
|
63
|
-
t)?"ready":"unconfigured";return{contract:Qs,declared:c,status:a,stackHash:e.stackHash,recipeHash:a==="ready"?
|
|
63
|
+
t)?"ready":"unconfigured";return{contract:Qs,declared:c,status:a,stackHash:e.stackHash,recipeHash:a==="ready"?O({version:1,
|
|
64
64
|
sourcesFile:t,defaultPackageType:n,customRunner:s,steps:i,...r.length?{saveSteps:r}:{}}):"",components:[...e.components||
|
|
65
65
|
[]],source:e.source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:i,saveSteps:r,runtimeRequirements:H([...i,
|
|
66
66
|
...r,...s?[s]:[]].flatMap(u=>u.runtimeRequirements)),diagnostics:o}}import{lstat as ri,open as oi,realpath as st,stat as ai}from"node:fs/promises";import{constants as qt}from"node:fs";import Kt from"node:path";var ci="vibe64.architecture-inspection.v1",Xt="Architecture inspection",A="VIBE64_ARCHITECTURE_INSPECTION_INVALID",Re="g\
|
|
@@ -77,10 +77,10 @@ d.",c+1),i.add(l[1]),r={id:l[1],title:l[2]};continue}r||d(A,n,"Expected an Inspe
|
|
|
77
77
|
let E=Object.entries(it).map(([f,[,T]])=>`- ${f}: ${T}`).join("; ");d(A,n,`Unknown architecture inspector field. Use one\
|
|
78
78
|
of: ${E}.`,c+1)}let[p]=it[m[1]];if(r[p]!==void 0&&d(A,n,`Duplicate ${m[1]}.`,c+1),p==="runtimeRequirements")r[p]=C(m[2],
|
|
79
79
|
A,n,"Inspector runtime",c+1);else if(p==="argv")r[p]=N(m[2],A,n,"Inspector command",c+1);else if(p==="entryFiles"||p==="\
|
|
80
|
-
requiredFiles")r[p]=v(m[2],A,n,m[1],c+1).map(E=>
|
|
81
|
-
rkdir")r[p]=
|
|
80
|
+
requiredFiles")r[p]=v(m[2],A,n,m[1],c+1).map(E=>S(E,A,n,m[1],c+1));else{let[E]=v(m[2],A,n,m[1],c+1,{count:1});if(p==="wo\
|
|
81
|
+
rkdir")r[p]=S(E,A,n,"Inspector directory",c+1);else if(p==="previewLocator")r[p]=en(E,n,c+1);else{let f=Number(E),T=p===
|
|
82
82
|
"timeout"?Zt:Jt;(!/^[1-9][0-9]*$/u.test(E)||!Number.isSafeInteger(f)||f>T)&&d(A,n,`${m[1]} must be from 1 to ${T}.`,c+1),
|
|
83
|
-
r[p]=p==="timeout"?f*1e3:f}}}return o(),s.length||d(A,n,"Use an Inspector entry or - Nothing."),s}function en(e,t,n){return
|
|
83
|
+
r[p]=p==="timeout"?f*1e3:f}}}return o(),s.length||d(A,n,"Use an Inspector entry or - Nothing."),s}function en(e,t,n){return S(
|
|
84
84
|
e,A,t,"Preview locator",n,{allowRoot:!1}),e.endsWith(".js")||d(A,t,"Preview locator must name a .js file.",n),e}function pi(e,t){
|
|
85
85
|
return e[t-1]==="node_modules"&&!e[t].startsWith("@")||e[t-2]==="node_modules"&&e[t-1].startsWith("@")}async function di(e,t){
|
|
86
86
|
en(t,Re);let n=r=>d(A,Re,`Preview locator \`${t}\` ${r}.`),s=t.split("/"),i;try{let r=await st(e),o=r,c=!1;for(let[u,l]of s.
|
|
@@ -91,7 +91,7 @@ stat();return a.isFile()||n("must be a regular file"),a.size>Yt&&n(`must be at m
|
|
|
91
91
|
readFile("utf8")}}catch(r){throw(r?.code==="ENOENT"||r?.code==="ENOTDIR")&&n("is not a file in this project"),r?.code===
|
|
92
92
|
"ELOOP"&&n("must not be or pass through a symlink"),r}finally{await i?.close()}}function tn(e){let t=e.status==="ready"?
|
|
93
93
|
Qt(e.lines):[];for(let n of t)n.runtimeRequirements.some(s=>!e.components.includes(s))&&d(A,Re,"Inspector runtimes must \
|
|
94
|
-
be selected in Stack.");return{contract:ci,status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:
|
|
94
|
+
be selected in Stack.");return{contract:ci,status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:O(t),diagnostics:e.
|
|
95
95
|
diagnostics||[]}}var Pa=Object.freeze({parseVibe64ArchitectureInspectionLines:Qt});var mi="vibe64.architecture-layout.v1",nn="Architecture layout",B="VIBE64_ARCHITECTURE_LAYOUT_INVALID",rt=Object.freeze(
|
|
96
96
|
["layer","libraries","support"]);function sn(e,t={}){let{path:n="genesis/stack.md#Architecture layout"}=t;if(Array.isArray(
|
|
97
97
|
e)||d(B,n,"Expected exact Stack section lines."),_(e))return[];let s=[],i=new Set,r=new Set,o;function c(){o&&((!o.kind||
|
|
@@ -99,7 +99,7 @@ e)||d(B,n,"Expected exact Stack section lines."),_(e))return[];let s=[],i=new Se
|
|
|
99
99
|
u]of e.entries()){let l=u.trim();if(!l)continue;let m=l.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(m){c(),
|
|
100
100
|
i.has(m[1])&&d(B,n,"Duplicate group id.",a+1),i.add(m[1]),o={id:m[1],title:m[2],subsystems:[]};continue}let p=l.match(/^- (Kind|Purpose|Subsystem): (.+)$/u);
|
|
101
101
|
(!o||!p)&&d(B,n,"Expected a Group heading or Kind, Purpose, Subsystem field.",a+1);let E=v(p[2],B,n,p[1],a+1,{count:1});
|
|
102
|
-
if(p[1]==="Subsystem"){let f=
|
|
102
|
+
if(p[1]==="Subsystem"){let f=S(E[0],B,n,"Subsystem root",a+1);r.has(f)&&d(B,n,"Each directory root may be placed only on\
|
|
103
103
|
ce.",a+1),r.add(f),o.subsystems.push({root:f})}else{let f=p[1].toLowerCase();o[f]!==void 0&&d(B,n,`Duplicate ${p[1]}.`,a+
|
|
104
104
|
1),f==="kind"&&!rt.includes(E[0])&&d(B,n,`Kind must be ${rt.slice(0,-1).join(", ")} or ${rt.at(-1)}.`,a+1),o[f]=E[0]}}return c(),
|
|
105
105
|
s.length||d(B,n,"Use a Group entry or - Nothing."),s}function rn(e){return{contract:mi,status:e.status,stackHash:e.stackHash,
|
|
@@ -108,9 +108,9 @@ import W from"node:path";var hi="STACK_PROJECT_CONTRACTS_INCOMPLETE",on="STACK_S
|
|
|
108
108
|
includes(String(e?.code||"").trim())}var ot="genesis/stack.md",Ei=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function bi(e){
|
|
109
109
|
return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!Ei.some(t=>String(e.code).startsWith(t))}function vi(e){
|
|
110
110
|
let{path:t="",line:n,observed:s}=e.details||{},i=Number.isSafeInteger(n)?` (line ${n}${t===ot?" of its section":""})`:"",
|
|
111
|
-
r=t&&(i||!e.message.includes(t))?`${t}${i}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${r}${e.message}${o}`}import*as
|
|
112
|
-
import Li from"node:os";import ct from"node:path";function x(e){return String(e||"").trim()}var
|
|
113
|
-
"managedPreview"]),cn=Object.freeze(["managedPages"]),
|
|
111
|
+
r=t&&(i||!e.message.includes(t))?`${t}${i}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${r}${e.message}${o}`}import*as Se from"genesis-compiler";import{randomUUID as Ri}from"node:crypto";import{mkdir as Ni,mkdtemp as Ci,readFile as Di,rename as Pi,rm as pn,writeFile as $i}from"node:fs/promises";
|
|
112
|
+
import Li from"node:os";import ct from"node:path";function x(e){return String(e||"").trim()}var yi=Object.freeze(["main","temporary"]),an=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
|
|
113
|
+
"managedPreview"]),cn=Object.freeze(["managedPages"]),Si=64*1024,wi=Object.freeze(["When user input is necessary, ask no\
|
|
114
114
|
more than three concise, high-impact questions at once.","Put multiple questions on separate lines as `[1] Question`, `\
|
|
115
115
|
[2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answers:` and a short bullet list dir\
|
|
116
116
|
ectly beneath its own question, before the next one; never collect several questions' answers into one trailing list.","\
|
|
@@ -224,114 +224,128 @@ nv."]);function un(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Ty
|
|
|
224
224
|
function at(e,t,n){let s=new Set(t),i=Object.keys(e).filter(r=>!s.has(r));if(i.length>0)throw new TypeError(`${n} contai\
|
|
225
225
|
ns unsupported fields: ${i.join(", ")}.`)}function ln(e){if(at(e,["conversationKind","scope","session","hostGuidance"],"\
|
|
226
226
|
Vibe64 session context"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"ut\
|
|
227
|
-
f8")>1024))throw new TypeError("Vibe64 host guidance must be bounded text supplied by the host.");if(!
|
|
227
|
+
f8")>1024))throw new TypeError("Vibe64 host guidance must be bounded text supplied by the host.");if(!yi.includes(e.conversationKind))
|
|
228
228
|
throw new TypeError("Vibe64 session context has an unknown conversationKind.");let t=un(e.session,"Vibe64 session capabi\
|
|
229
229
|
lities");at(t,[...an,...cn],"Vibe64 session capabilities");let n=Object.fromEntries(an.map(s=>{if(typeof t[s]!="boolean")
|
|
230
230
|
throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);return[s,t[s]]}));for(let s of cn){if(t[s]!==void 0&&
|
|
231
231
|
typeof t[s]!="boolean")throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);t[s]===!0&&(n[s]=!0)}return{
|
|
232
|
-
conversationKind:e.conversationKind,scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:n}}function
|
|
233
|
-
at(e,["scope","stableContext"],"Vibe64 ephemeral context");let t=String(e.stableContext||"").trim();if(!t||t.length>
|
|
234
|
-
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:t}}function
|
|
235
|
-
scope==="session")return ln(e);if(e.scope==="ephemeral")return
|
|
232
|
+
conversationKind:e.conversationKind,scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:n}}function ki(e){
|
|
233
|
+
at(e,["scope","stableContext"],"Vibe64 ephemeral context");let t=String(e.stableContext||"").trim();if(!t||t.length>Si)throw new TypeError(
|
|
234
|
+
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:t}}function Oi(e){if(e.
|
|
235
|
+
scope==="session")return ln(e);if(e.scope==="ephemeral")return ki(e);throw new TypeError("The Vibe64 driver supports ses\
|
|
236
236
|
sion and ephemeral scopes only.")}function Ai(e){let{conversationKind:t,session:n,hostGuidance:s=""}=ln(e);return["VIBE6\
|
|
237
237
|
4 CONVERSATION CONTEXT","",...t==="main"?["This is the main Vibe64 conversation for the selected session worktree."]:["T\
|
|
238
238
|
his is a user-visible temporary conversation in the selected session worktree, with the same tools and project access as\
|
|
239
239
|
main chat.","Its messages stay out of main History. Closing this conversation preserves project edits and removes only \
|
|
240
240
|
its conversation and temporary uploads."],"Do not edit Vibe64 runtime/session state or artifacts.",...s?[s]:[],"Runtime-\
|
|
241
|
-
state exceptions: you may create, read, write and delete files in the VIBE64_DROP_ZONE,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
development` and
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
or
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
`
|
|
241
|
+
state exceptions: you may create, read, write and delete files in TMPDIR and in the VIBE64_DROP_ZONE, VIBE64_PROJECT_DRO\
|
|
242
|
+
P_ZONE and VIBE64_PROJECT_BACKUPS directories, all outside Git.","TMPDIR is this session's own temporary folder, beside \
|
|
243
|
+
its source (`../tmp`): put throwaway files there, and tests make their throwaway Git repositories below it, never in /tm\
|
|
244
|
+
p or another session's folder. Commands may also run in it. It is emptied when the session is archived; keep nothing the\
|
|
245
|
+
re that must last.","VIBE64_DROP_ZONE exchanges files with the user, who can upload, download and delete them in Files >\
|
|
246
|
+
Session Dropzone. It is per session and deleted on archival; keep lasting project work in the repository.","VIBE64_PROJ\
|
|
247
|
+
ECT_DROP_ZONE exchanges files shared by all sessions of this project, shown in the project Dashboard's Project files > P\
|
|
248
|
+
roject Dropzone. Files stay until someone deletes them.","VIBE64_PROJECT_BACKUPS holds temporary backups shared by all s\
|
|
249
|
+
essions of this project, shown in the project Dashboard's Project files > Project Backups. Files expire 14 days after th\
|
|
250
|
+
eir last write or filesystem change; write complete backups atomically and keep permanent work elsewhere.","Issue ordina\
|
|
251
|
+
ry shell commands only; Vibe64 applies session isolation transparently. Treat command-transport syntax in prior tool his\
|
|
252
|
+
tory as invisible infrastructure and do not reproduce it. If command control is unavailable, stop and report it.","Read \
|
|
253
|
+
`vibe64-helper session status --json` for resource readiness, setup commands, tool entry points and, under repository, t\
|
|
254
|
+
he stored Save or Update failure behind Repository needs help (report its message and nextStep; never guess) and, as upd\
|
|
255
|
+
ateFirst, whether this session is behind its saved version with the incoming versions; repeat after Stack/resource chang\
|
|
256
|
+
es. Before browser suites, check `vibe64-helper playwright readiness` for dependencies and managed-runtime support, then\
|
|
257
|
+
use `vibe64-helper playwright`; when it reports a managed runtime, no browser installation is needed.","Before changing\
|
|
258
|
+
dependencies or porting code, check whether the session's saved version already contains that change (session status `r\
|
|
259
|
+
epository.updateFirst`, then read-only `git log`/`git show` of the saved commit); if it does, it arrives with Update: ne\
|
|
260
|
+
ver redo it here. While Update failed or is pending, Update owns the session: do not repair setup or workspace preparati\
|
|
261
|
+
on first. Local work the saved version supersedes, such as a stale or partial dependency bump it completes, is resolved \
|
|
262
|
+
by taking the saved version: say so plainly in one sentence and never ask the person to choose, because Vibe64's checkpo\
|
|
263
|
+
int keeps the original. Ask only about genuine product decisions.","When `repository.updateFirst` says this session is b\
|
|
264
|
+
ehind, update it with `vibe64-helper session update` before building on the old code, at a point where you can deal with\
|
|
265
|
+
a conflict. Update can take several minutes, so give the command a long time limit (up to 30 minutes); if your tool sto\
|
|
266
|
+
ps it early, Update carries on: read `vibe64-helper session status --json` until `repository.updateFirst.reason` is no l\
|
|
267
|
+
onger `running`. Update may stop at files that clash with the saved version. If it does, stop your other work and resolv\
|
|
268
|
+
e them first, as it explains, or, if you can't now, leave them (Update leaves a repository with clashing files unchanged\
|
|
269
|
+
) and tell the person. Then re-read the files it lists, and run `vibe64-helper preview restart --wait` when it says Prev\
|
|
270
|
+
iew still runs the old code. Update never saves.",t==="main"?"Save publishes this session's work, and its connected repo\
|
|
271
|
+
sitories', to the project's main, where the project's other sessions update onto it. While your turn's instructions say \
|
|
272
|
+
Vibe64 saves the work automatically, save each finished and checked stage of a plan, or a finished piece of work, with `\
|
|
273
|
+
vibe64-helper session save` (never mid-edit; a long time limit, as for Update), after `vibe64-helper session update` whe\
|
|
274
|
+
n `repository.updateFirst` says this session is behind. It is the Save button's own Save and runs no pass; it answers wi\
|
|
275
|
+
th the commit and files saved, or why not and what to do next. Once it saves, tell the sessions you are working with (`v\
|
|
276
|
+
ibe64-helper session message-project`) to run `vibe64-helper session update`. With automatic save off it refuses: leave \
|
|
277
|
+
Save to the person.":"Save publishes this session's work to the project's main. A temporary chat never saves: `vibe64-he\
|
|
278
|
+
lper session save` refuses here, so leave Save to the person.","Connected repositories are this session's own copies at \
|
|
279
|
+
`../connected/<name>`, listed in the Stack's Sources file and in `vibe64-helper session status --json` under `repository\
|
|
280
|
+
.connected`: edit them like this session's source; Save and Update cover them, so never commit, push, fetch or rebase th\
|
|
281
|
+
em yourself.","Vibe64-owned contracts (Stack sections such as Workspace setup and Outputs, the Preview identity protocol\
|
|
282
|
+
and integration setup) have exact specs: list them with `vibe64-helper spec` and read `vibe64-helper spec <name>` befor\
|
|
283
|
+
e writing or changing one; never reconstruct them from Vibe64 source or bundles.","Build every email, SMS, push notifica\
|
|
284
|
+
tion, webhook, connector write and payment the application makes to follow `APP_ENV` (`vibe64-helper spec deployment`): \
|
|
285
|
+
logged in `development` and `test`; in `staging`, email and SMS only to `STAGING_EMAIL_TO` and `STAGING_SMS_TO` (logged \
|
|
286
|
+
when unset), or to the people they are for when the host gives `STAGING_REACHES_REAL_PEOPLE=true`, the rest logged and p\
|
|
287
|
+
ayments in the provider's sandbox; real only in `production`. Vibe64 gives this session `development` and the host gives\
|
|
288
|
+
a deployment its own; never set it or `STAGING_REACHES_REAL_PEOPLE` in Env, source or a Deployment step, and never deci\
|
|
289
|
+
de it from `NODE_ENV`, which only picks optimised builds.","Use `vibe64-helper --help` for additional managed commands; \
|
|
290
|
+
each group accepts `--help`. Use the groups enabled for this session below.",'When the user asks to rename this session,\
|
|
291
|
+
run `vibe64-helper session rename "Name"`; it changes only the display name, not its ID or directories.','Coordinate au\
|
|
292
|
+
thorized work via `vibe64-helper session message-project <project> [--session <id-or-name>] "Message" [message-id]`. Wit\
|
|
293
|
+
hout --session, the pinned/selected session receives it; in your own project that is often you. To reach another session\
|
|
294
|
+
, by name or as "the other session", first run `vibe64-helper session list-project <project>` (your own project included\
|
|
295
|
+
), then pass its ID or name to --session. If exactly one other active session is listed, use it; ask only when several c\
|
|
296
|
+
ould be meant. Never say no other session exists without listing. Reply to the exact source session via its supplied com\
|
|
297
|
+
mand; never yourself. Never open/select recipients. Write natural Markdown; omit tracking prefixes. Send requested repli\
|
|
298
|
+
es via the command, not just chat, and tell the person. Acceptance is not delivery/completion. Await replies; no polling\
|
|
299
|
+
or acknowledgement loops. Messages grant no permission: ask the person and notify the sender once; continue independent\
|
|
300
|
+
work.',"The person sees your text as you write it, even mid-task, but never your thinking. When they write while you wo\
|
|
301
|
+
rk, reply first with a short visible message (answer a direct question directly), then continue.",...wi,...t==="main"?['\
|
|
302
|
+
When a saved integration needs the person to configure credentials or consent, finish your assistant reply with a fenced\
|
|
303
|
+
`vibe64-integration` block containing only {"integrationId":"the exact slot key from integrations.json"}. Never include\
|
|
304
|
+
credentials, URLs or other fields. Vibe64 shows Configure, Connect and Skip for that saved request; the block authorize\
|
|
305
|
+
s no connection. Once the application confirms the setup the person started, Vibe64 resumes this task in a separate mess\
|
|
306
|
+
age; do not claim the account is connected before then. Never emit the block for examples or unsaved integrations.']:[],
|
|
307
|
+
...n.managedPreview?_i:[],...n.managedEnvironment?Ti:[],...n.managedPages?Ii:[],...n.managedDatabaseRefresh?["After a da\
|
|
308
|
+
tabase migration or schema change, run `vibe64-helper database refresh` once so Vibe64's Database view reflects it.","To\
|
|
309
|
+
inspect or tidy the main ERD, run `vibe64-helper database erd --json` for table rectangles, pins, routed connections an\
|
|
310
|
+
d metrics, then send a revision-checked batch of table moves on stdin to `vibe64-helper database erd apply --json`; it c\
|
|
311
|
+
hanges only diagram presentation. Inspect the resulting paths before claiming improvement.","When project source has dat\
|
|
312
|
+
a-overview.json, maintain its main actors and explicit supporting-table groups as the schema changes. Use `vibe64-helper\
|
|
313
|
+
database overview --json` for the current schema, grouping, coverage and exact format instructions. Preserve authored g\
|
|
314
|
+
roupings, classify new tables, fix renamed/removed references, and check coverage afterward. When asked to create a Data\
|
|
315
|
+
overview, use the same command and relevant application source; no one-hop membership rule applies. Never invent foreig\
|
|
316
|
+
n keys or cardinalities."]:[],...n.managedGit?["Use the managed `git` and `gh` commands on PATH. Do not bypass them with\
|
|
317
|
+
host binaries, a stripped PATH, or alternate credentials.","The managed `git` decides by the repository a command acts \
|
|
318
|
+
on (its folder with `-C`, `--git-dir`, `--work-tree`, GIT_DIR and GIT_WORK_TREE), not by the folder it is run from. A re\
|
|
319
|
+
pository in TMPDIR gets plain local Git, with none of this session's GitHub credentials or Git identity: name one for it\
|
|
320
|
+
s commits with GIT_AUTHOR_*/GIT_COMMITTER_* or `-c user.name=... -c user.email=...`. From TMPDIR it may read this sessio\
|
|
321
|
+
n's source and connected repositories, but changes them only by their own rules, so run those commands in them (`git -C \
|
|
322
|
+
<path> ...`). Git on anything else (another session, another project, a temporary folder all sessions share) is refused.",
|
|
323
|
+
"In the source, `git fetch`, `pull`, `push`, `ls-remote`, `clone` and `remote`, and every `gh` command, carry this sessi\
|
|
324
|
+
on's GitHub token, so they run no hooks, reach GitHub over HTTPS only and refuse what names a program: `-c` settings suc\
|
|
325
|
+
h as credential helpers, `--config-env`, `--exec-path`, `--upload-pack`, signing, submodule recursion, shell variables s\
|
|
326
|
+
uch as GIT_SSH_COMMAND, repository config such as filters or merge drivers for a pull, and `gh auth`, `alias`, `extensio\
|
|
327
|
+
n`, `config` or a command that is not gh's own. Follow the refusal's advice, and ask the person before removing a reposi\
|
|
328
|
+
tory setting you did not add; Save and Update refuse the same repository config. Every other Git command runs without th\
|
|
329
|
+
e token.","For attachments and inline images that GitHub stores for issues (tickets), pull requests or comments, use aut\
|
|
330
|
+
henticated managed `gh api` with the original attachment URL, save the response to a local file and inspect it before re\
|
|
331
|
+
porting its contents. Never use unauthenticated curl/wget, User-Agent experiments or extracted credentials; an unauthent\
|
|
332
|
+
icated 404 does not prove a private attachment is missing.","After changing GitHub issues, comments, labels or pull requ\
|
|
333
|
+
ests, run `vibe64-helper github refresh` once so Vibe64's Issues/PR view reflects it.","When linking an issue in this pr\
|
|
334
|
+
oject's repository, run `vibe64-helper github issue-link <number>` and use its returned Vibe64 path exactly, including t\
|
|
335
|
+
he /app prefix, as the primary Markdown link destination; it navigates in-app. You may include the GitHub URL as a secon\
|
|
336
|
+
dary link. Never guess the project slug or host; issues in other repositories keep their GitHub links.","Report authenti\
|
|
337
|
+
cation or transport failures directly; do not inspect credentials or invent another login path.","When a managed Git/Git\
|
|
338
|
+
Hub command fails, tell the user which requested action failed, which earlier work is confirmed complete, what remains u\
|
|
339
|
+
ndone or unconfirmed, and the next safe action. Retain the reported failure stage, execution budget and execution refere\
|
|
340
|
+
nce when provided; do not expose credentials or dump raw output unnecessarily.","A timeout or transport failure does not\
|
|
341
|
+
establish invalid authentication, exhausted AI quota, a GitHub outage or a suspension problem. Separate recorded facts \
|
|
342
|
+
from hypotheses; say the cause is unknown when it is unproven. Recommend reconnection only when the reported error expli\
|
|
343
|
+
citly calls for it.","If the diagnostic says commandSubmitted=false, the requested Git/GitHub action was not attempted. \
|
|
344
|
+
After an execution timeout, lost response or unreadable response, its effects are unconfirmed: use a read-only check of \
|
|
345
|
+
the affected Git/GitHub state before repeating any write. Never claim that a comment was posted or not posted, or that a\
|
|
346
|
+
push succeeded or failed, from those errors alone. If verification is unavailable, report the outcome as unknown and st\
|
|
347
|
+
op; do not repeat the write or claim a safe rollback."]:[]].join(`
|
|
348
|
+
`)}function le(e={}){let t=un(e,"Vibe64 driver input"),n=Oi(t);return n.scope==="session"?Ai(n):n.stableContext}async function dn(e=""){let t=e||await Ci(ct.join(Li.tmpdir(),"vibe64-genesis-context-"));await Ni(t,{recursive:!0,mode:448});
|
|
335
349
|
let n=ct.join(t,"sessions.json"),s=new Map;try{let l=JSON.parse(await Di(n,"utf8"));for(let m of l.sessions)le(m.promptContext),
|
|
336
350
|
s.set(m.upstreamSessionId,m)}catch(l){if(l.code!=="ENOENT")throw l}let i=Promise.resolve(),r=!1;async function o(l){let m=ct.
|
|
337
351
|
join(t,`.sessions.${process.pid}.${Ri()}.tmp`);try{await $i(m,JSON.stringify({sessions:[...l.values()]}),{flag:"wx",mode:384}),
|
|
@@ -366,12 +380,12 @@ te.length),R,t,"Deployment Instances",n,{count:1});return(!/^[1-9][0-9]{0,2}$/u.
|
|
|
366
380
|
nstances is a whole number from 1 to ${J}, such as \`4\`.`,n),Number(s)}function Me(e,t,n){let s=N(e[3],R,t,"Deployment \
|
|
367
381
|
command",n);s.some(r=>/\{(?:host|port)\}/u.test(r))&&g(t,"Deployment commands take no {host} or {port} placeholders; Ser\
|
|
368
382
|
ve reads HOST and PORT from its environment.",n);let i=Object.keys(Q).find(r=>s.some(o=>o.startsWith(`${r}=`)));return i&&
|
|
369
|
-
g(t,Q[i],n),{label:w(e[2],R,t,"Deployment step label",n),argv:s,role:e[1].toLowerCase()}}var bn=/^[a-z][a-z0-9-]{0,15}$/u;var
|
|
383
|
+
g(t,Q[i],n),{label:w(e[2],R,t,"Deployment step label",n),argv:s,role:e[1].toLowerCase()}}var bn=/^[a-z][a-z0-9-]{0,15}$/u;var Sn=/^### Service `([^`\r\n]*)`:[ \t]+(.+)$/u,wn=/^### Resource `([^`\r\n]*)`$/u,Mi=bn,vn=8,ji=Object.freeze(["public",
|
|
370
384
|
"internal"]),Gi=Object.freeze({"any instance":"any","each instance":"each"}),Ui=/^- Production: `([^`\r\n]*)` instances?$/u,
|
|
371
385
|
Bi=/^- Instances: `([^`\r\n]*)` to `([^`\r\n]*)`$/u,Wi=/^- Needs at least: `([^`\r\n]*)` vCPU, `([^`\r\n]*)` GiB memory$/u,
|
|
372
386
|
zi=/^- Reaches: `([^`\r\n]*)` as `([^`\r\n]*)`$/u,Hi=/^- Setting `([^`\r\n]*)`:[ \t]+(.+)$/u,ut=e=>new RegExp(`^- ${e}: \
|
|
373
387
|
\`([^\`\\r\\n]*)\`$`,"u"),Fi=ut("Exposure"),qi=ut("Reached"),Ki=ut("Development"),_n=Object.freeze(["local folder","own \
|
|
374
|
-
bucket"]),Yi=Object.freeze(["APP_ENV","HOST","PORT","APP_PUBLIC_URL","TRUSTED_PROXIES"]),
|
|
388
|
+
bucket"]),Yi=Object.freeze(["APP_ENV","HOST","PORT","APP_PUBLIC_URL","TRUSTED_PROXIES"]),yn="V64_",Xi="STAGING_REACHES_R\
|
|
375
389
|
EAL_PEOPLE",In=Object.freeze(["### Service `id`: summary","### Resource `id`"]),lt=Object.freeze(["- Exposure: `public` \
|
|
376
390
|
or `internal`","- Serve `label`: `command` `argument`...","- Ready when: `GET` `/path` returns `200`","- Instances: `min\
|
|
377
391
|
` to `max`","- Needs at least: `N` vCPU, `N` GiB memory","- Production: `N` instances","- Reached: `any instance` or `ea\
|
|
@@ -379,13 +393,13 @@ ch instance`","- Reaches: `service` as `SETTING`","- Setting `NAME`: `value`",`$
|
|
|
379
393
|
\``).join(" ")}`]),Tn=Object.freeze([`- Development: ${_n.map(e=>`\`${e}\``).join(" or ")}`]),Zi=Object.freeze(Le.filter(
|
|
380
394
|
e=>![F,te,"- Ready when: "].some(t=>e.startsWith(t))).map(e=>e.replace(`|${ne.at(-1)} `," ")));function Ji(e){return Yi.
|
|
381
395
|
includes(e)?`${e} is a setting the host gives every service itself`:e===Xi?`${e} is the host's, given to a Staging only \
|
|
382
|
-
while the project's owner marks that real people use it`:e.startsWith(
|
|
383
|
-
the host gives each instance`:""}function
|
|
396
|
+
while the project's owner marks that real people use it`:e.startsWith(yn)?`${e} starts with ${yn}, which names the facts\
|
|
397
|
+
the host gives each instance`:""}function kn(e,t,n,s){let i=e[1];return Mi.test(i)||g(t,`A service's id is a lowercase \
|
|
384
398
|
letter, then up to 15 lowercase letters, digits and hyphens, such as \`web\`; ${JSON.stringify(i)} isn't one.`,n),s.some(
|
|
385
399
|
r=>r.id===i)&&g(t,`Deployment declares service \`${i}\` twice.`,n),s.length===vn&&g(t,`A Deployment declares at most ${vn}\
|
|
386
400
|
services.`,n),{id:i,summary:w(e[2],R,t,"Service summary",n),line:n,lines:{},settingLines:{},exposure:"",reached:"",serve:null,
|
|
387
401
|
readyWhen:null,instances:null,production:null,atLeast:null,reaches:[],settings:{},packages:[],sandboxAllowances:[]}}function he(e,{
|
|
388
|
-
min:t=1,max:n=100}={}){return/^[1-9][0-9]{0,3}$/u.test(e)&&Number(e)>=t&&Number(e)<=n?Number(e):null}function
|
|
402
|
+
min:t=1,max:n=100}={}){return/^[1-9][0-9]{0,3}$/u.test(e)&&Number(e)>=t&&Number(e)<=n?Number(e):null}function On(e,t,n,s){
|
|
389
403
|
let i=c=>g(n,`Service \`${e.id}\`: ${c}`,s),r=c=>{Object.hasOwn(e.lines,c)&&i(`it has a second ${c} line.`),e.lines[c]=s},
|
|
390
404
|
o=t.match(Ne);if(o){o[1]!=="Serve"&&i(`${o[1]} is the whole Deployment's, since one build serves every service: put it a\
|
|
391
405
|
bove the first ### heading.`),r("Serve");let c=Me(o,n,s);e.serve={label:c.label,argv:c.argv};return}if(t.startsWith("- E\
|
|
@@ -405,15 +419,15 @@ setting:c[2],line:s});return}if(t.startsWith("- Setting ")){let c=t.match(Hi);c|
|
|
|
405
419
|
ue``.");let[a]=v(c[2],R,n,`Service \`${e.id}\` Setting ${c[1]}`,s,{count:1});An(e,c[1],n,s),e.settings[c[1]]=a,e.settingLines[c[1]]=
|
|
406
420
|
s;return}if(t.startsWith(ee)){r("Packages"),e.packages=Ve(t,n,s);return}if(t.startsWith(F)){r("Sandbox allows"),e.sandboxAllowances=
|
|
407
421
|
xe(t,n,s);return}Zi.some(c=>t.startsWith(c.slice(0,c.indexOf(":")+1)))&&i(`${t.slice(2,t.indexOf(":"))} is the whole Dep\
|
|
408
|
-
loyment's: put it above the first ### heading.`),g(n,
|
|
422
|
+
loyment's: put it above the first ### heading.`),g(n,y(`Service \`${e.id}\` entry`,t,lt),s)}function An(e,t,n,s){let i=o=>g(
|
|
409
423
|
n,`Service \`${e.id}\`: ${o}`,s);$e.test(t)||i(`${JSON.stringify(t)} isn't a setting's name: use capitals, digits and _,\
|
|
410
424
|
such as \`API_URL\`.`),t==="SIDE_EFFECTS"&&i(Q.SIDE_EFFECTS);let r=Ji(t);r&&i(`${r}; give the setting another name.`),(Object.
|
|
411
425
|
hasOwn(e.settings,t)||e.reaches.some(o=>o.setting===t&&o.line!==s))&&i(`it names the setting ${t} twice.`)}function Rn(e,t,n,s){
|
|
412
|
-
let i=e[1];return
|
|
426
|
+
let i=e[1];return ke.test(i)||g(t,`### Resource names a resource of ## Resources by its id, such as \`files\`; ${JSON.stringify(
|
|
413
427
|
i)} isn't one.`,n),s.has(i)&&g(t,`Deployment has a second ### Resource \`${i}\`.`,n),{id:i,line:n,development:"",developmentLine:0}}
|
|
414
428
|
function Nn(e,t,n,s){if(t.startsWith("- Development: ")){e.developmentLine&&g(n,`Resource \`${e.id}\` has a second Develo\
|
|
415
429
|
pment line.`,s),e.development=t.match(Ki)?.[1]??"",e.developmentLine=s,_n.includes(e.development)||g(n,`Resource \`${e.id}\
|
|
416
|
-
\`: Development is \`local folder\` or \`own bucket\`.`,s);return}g(n,`${
|
|
430
|
+
\`: Development is \`local folder\` or \`own bucket\`.`,s);return}g(n,`${y(`Resource \`${e.id}\` entry`,t,Tn)} The Deplo\
|
|
417
431
|
yment's own entries come before the first ### heading.`,s)}function Cn(e,t,n){let s=e.map(r=>r.id);for(let r of e){let o=(a,u=r.
|
|
418
432
|
line)=>g(n,`Service \`${r.id}\`: ${a}`,u);for(let[a,u]of[["Exposure",r.exposure],["Serve",r.serve],["Ready when",r.readyWhen],
|
|
419
433
|
["Instances",r.instances]])u||o(`it needs a${a==="Exposure"||a==="Instances"?"n":""} ${a} line: ${lt.find(l=>l.startsWith(
|
|
@@ -431,7 +445,7 @@ ce: give one of them `- Exposure: `public``.":`A Deployment with services has ex
|
|
|
431
445
|
\`${r}\``).join(" and ")} are both public.`,i[1]?.line??e[0].line),e.map(r=>({id:r.id,summary:r.summary,exposure:r.exposure,
|
|
432
446
|
reached:r.reached||"any",serve:r.serve,readyWhen:r.readyWhen,instances:{min:r.instances.min,max:r.instances.max,production:r.
|
|
433
447
|
production??r.instances.min},atLeast:r.atLeast,reaches:r.reaches.map(({service:o,setting:c})=>({service:o,setting:c})),settings:r.
|
|
434
|
-
settings,packages:r.packages,sandboxAllowances:r.sandboxAllowances}))}function Dn(e,t,n){let s=
|
|
448
|
+
settings,packages:r.packages,sandboxAllowances:r.sandboxAllowances}))}function Dn(e,t,n){let s=Oe(t);for(let r of e.resources.
|
|
435
449
|
values()){let o=s.get(r.id);o||g(n,`### Resource \`${r.id}\`: genesis/stack.md's ## Resources declares no resource \`${r.
|
|
436
450
|
id}\`${s.size?`; its resources are ${[...s.keys()].map(c=>`\`${c}\``).join(", ")}`:""}.`,r.line),r.development&&o.kind!==
|
|
437
451
|
"bucket"&&g(n,`Resource \`${r.id}\`: Development says how development provides a bucket, and \`${r.id}\` is a ${o.kind} \
|
|
@@ -443,13 +457,13 @@ artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecret
|
|
|
443
457
|
instances:{max:1},readiness:null,steps:[],services:[],deploymentResources:{}}}function xn(e,t){Array.isArray(e)||g(t,"De\
|
|
444
458
|
ployment must be supplied as exact Stack section lines.");let n={services:[],resources:new Map};if(_(e))return{result:pt(),
|
|
445
459
|
located:n};let s=pt(),i=new Set,r=e.some(c=>c.trim().startsWith("### Service ")),o=null;for(let c=0;c<e.length;c+=1){let a=e[c].
|
|
446
|
-
trim();if(!a)continue;let u=c+1;if(a.startsWith("#")){let m=a.match(
|
|
447
|
-
n.services.push(o.service)):p?(o={resource:Rn(p,t,u,n.resources)},n.resources.set(o.resource.id,o.resource)):g(t,
|
|
448
|
-
oyment heading",a,In),u);continue}if(o?.service){
|
|
460
|
+
trim();if(!a)continue;let u=c+1;if(a.startsWith("#")){let m=a.match(Sn),p=m?null:a.match(wn);m?(o={service:kn(m,t,u,n.services)},
|
|
461
|
+
n.services.push(o.service)):p?(o={resource:Rn(p,t,u,n.resources)},n.resources.set(o.resource.id,o.resource)):g(t,y("Depl\
|
|
462
|
+
oyment heading",a,In),u);continue}if(o?.service){On(o.service,a,t,u);continue}if(o?.resource){Nn(o.resource,a,t,u);continue}
|
|
449
463
|
let l=a.match(Ne);if(r&&(l?.[1]==="Serve"||[F,te,"- Ready when: ","- Instances: "].some(m=>a.startsWith(m)))&&g(t,`In a \
|
|
450
464
|
Deployment with services, each service says its own Serve, Ready when, Instances and Sandbox allows: move \`${a}\` under \
|
|
451
465
|
its \`### Service\` heading.`,u),a.startsWith("- Workdir: ")){i.has("workdir")&&g(t,"Duplicate Deployment Workdir.",u),i.
|
|
452
|
-
add("workdir");let m=v(a.slice(11),R,t,"Deployment Workdir",u,{count:1})[0];s.workdir=
|
|
466
|
+
add("workdir");let m=v(a.slice(11),R,t,"Deployment Workdir",u,{count:1})[0];s.workdir=S(m,R,t,"Deployment workdir",u);continue}
|
|
453
467
|
if(a.startsWith("- Runtimes: ")){i.has("runtimes")&&g(t,"Duplicate Deployment Runtimes.",u),i.add("runtimes"),s.runtimeRequirements=
|
|
454
468
|
C(a.slice(12),R,t,"Deployment runtimes",u);continue}if(a.startsWith(Ce)){i.has("restore-paths")&&g(t,"Duplicate Deployme\
|
|
455
469
|
nt Recreate on restore entry.",u),i.add("restore-paths"),s.artifact.disposablePaths=hn(a,t,u);continue}if(a.startsWith(De)){
|
|
@@ -460,7 +474,7 @@ i.add("sandbox-allows"),s.sandboxAllowances=xe(a,t,u);continue}if(a.startsWith(e
|
|
|
460
474
|
ployment Packages.",u),i.add("packages"),s.packages=Ve(a,t,u);continue}if(a.startsWith(te)){i.has("instances")&&g(t,"Dup\
|
|
461
475
|
licate Deployment Instances.",u),i.add("instances"),s.instances={max:En(a,t,u)};continue}if(a.startsWith("- Ready when: ")){
|
|
462
476
|
i.has("readiness")&&g(t,"Duplicate Deployment Ready when.",u),i.add("readiness"),s.readiness=ue(a,R,t,"Deployment readin\
|
|
463
|
-
ess",u);continue}if(l){s.steps.push(Me(l,t,u));continue}g(t,
|
|
477
|
+
ess",u);continue}if(l){s.steps.push(Me(l,t,u));continue}g(t,y("Deployment entry",a,Le),u)}if(r){for(let a=1;a<s.steps.length;a+=
|
|
464
478
|
1)de[s.steps[a].role]<de[s.steps[a-1].role]&&g(t,`Deployment steps must be ordered ${ne.slice(0,-1).join(", ")}.`);Pn(s,
|
|
465
479
|
t),s.services=Cn(n.services,s,t);let c=s.services.find(a=>a.exposure==="public");s.steps.push({label:c.serve.label,argv:[
|
|
466
480
|
...c.serve.argv],role:"serve"}),s.readiness={kind:"http",...c.readyWhen},s.instances={max:c.instances.max},s.sandboxAllowances=
|
|
@@ -483,7 +497,7 @@ dy":"unconfigured",o={version:s.version,artifact:s.artifact,workdir:s.workdir,ru
|
|
|
483
497
|
generatedSecrets:s.generatedSecrets,setupCode:s.setupCode,sandboxAllowances:s.sandboxAllowances,packages:s.packages,instances:s.
|
|
484
498
|
instances,readiness:s.readiness,steps:s.steps},c={...o,...i?{services:s.services}:{},...Object.keys(s.deploymentResources).
|
|
485
499
|
length>0?{deploymentResources:s.deploymentResources}:{}};return{contract:$n,status:r,stackHash:t.stackHash,recipeHash:r===
|
|
486
|
-
"ready"?
|
|
500
|
+
"ready"?O(c):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:H(s.runtimeRequirements),resources:structuredClone(
|
|
487
501
|
e.resources||[]),...o,services:s.services,deploymentResources:s.deploymentResources,diagnostics:n}}var Ge="vibe64.packaging.v1",Wn="Packaging",oc=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
|
|
488
502
|
de"]),V="VIBE64_PACKAGING_INVALID",tr=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,nr=/^[A-Z_][A-Z0-9_]*$/u,sr=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
|
|
489
503
|
ir=/^[a-z][a-z0-9+.-]*$/u,rr=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,or=/\{[^{}\s]*\}/u,
|
|
@@ -516,8 +530,8 @@ b(s,`Package ${e.id} has a duplicate ${fe[t]} entry.`,i),e.seen.add(t),e.fields[
|
|
|
516
530
|
let r=`Packaging ${fe[e]}`;if(e==="runtimes")return C(t.slice(n.length),V,s,r,i);if(e==="platforms"){let c=v(t.slice(n.length),
|
|
517
531
|
V,s,r,i);return c.some(a=>!dt.includes(a))&&b(s,`${r} must be ${Y(dt)}.`,i),new Set(c).size!==c.length&&b(s,`${r} contai\
|
|
518
532
|
ns a duplicate platform.`,i),c}let o=ft([hr(t,n,s,r,i)],s,r,i)[0];if(e==="packer")return je.includes(o)||b(s,`Unknown pa\
|
|
519
|
-
cker \`${o}\`. ${Ge} packers are ${Y(je)}.`,i),o;if(["workdir","output"].includes(e))return
|
|
520
|
-
workdir"});if(e==="icon"){let c=
|
|
533
|
+
cker \`${o}\`. ${Ge} packers are ${Y(je)}.`,i),o;if(["workdir","output"].includes(e))return S(o,V,s,r,i,{allowRoot:e==="\
|
|
534
|
+
workdir"});if(e==="icon"){let c=S(o,V,s,r,i,{allowRoot:!1});return c.toLowerCase().endsWith(".png")||b(s,`${r} must be a\
|
|
521
535
|
1024x1024 PNG file.`,i),c}return e==="versionFrom"?(mt.includes(o)||b(s,`${r} must be ${Y(mt)}.`,i),o):e==="application\
|
|
522
536
|
Id"?((!sr.test(o)||o.length>150)&&b(s,`${r} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and un\
|
|
523
537
|
derscores; each part starts with a letter).`,i),o):e==="name"?((o.trim()!==o||o.length>Mn)&&b(s,`${r} must be at most ${Mn}\
|
|
@@ -534,7 +548,7 @@ n,"Packaging Environment value",s)[0];e.environment.push({name:a,value:u}),e.lin
|
|
|
534
548
|
lr);if(c){let a=ht(c[1],n,"Packaging Permission id",s),u=w(c[2],V,n,"Packaging Permission reason",s);(u.includes("`")||u.
|
|
535
549
|
length>jn)&&b(n,`Packaging Permission reason is plain user-facing text of at most ${jn} characters.`,s),e.permissions.some(
|
|
536
550
|
l=>l.id===a)&&b(n,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:u}),e.lines.permission??=
|
|
537
|
-
s;return}b(n,
|
|
551
|
+
s;return}b(n,y("Packaging entry",t,mr),s)}function br(e,t){let n=e.fields.packer;n||b(t,`Package ${e.id} needs a Packer \
|
|
538
552
|
entry: ${Y(je)}.`,e.line);let s=zn[n],i=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build",
|
|
539
553
|
"environment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of i)s.entries.includes(o)||
|
|
540
554
|
b(t,`The ${n} packer takes no ${fe[o]} entry.`,e.lines[o]);for(let o of s.required)i.has(o)||b(t,`Package ${e.id} (${n})\
|
|
@@ -563,8 +577,8 @@ k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!rr.test(c))&&b(s,`$
|
|
|
563
577
|
se domain names separated by commas or spaces.`),r.appLinkDomains=[...new Set(o)]}return r})}}function Kn({environment:e={},
|
|
564
578
|
section:t={}}={}){M(t,e,"Packaging section");let n=[...t.diagnostics||[]],s={version:1,packages:[]};t.status==="ready"&&
|
|
565
579
|
(s=qn(Fn(t.lines),e.environmentDefaults));let i=n.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:Ge,
|
|
566
|
-
status:i,stackHash:t.stackHash,packagingHash:i==="ready"?
|
|
567
|
-
diagnostics:n}}var
|
|
580
|
+
status:i,stackHash:t.stackHash,packagingHash:i==="ready"?O(s):"",source:t.source||null,version:s.version,packages:s.packages,
|
|
581
|
+
diagnostics:n}}var k="VIBE64_OUTPUTS_INVALID";function h(e,t,n,s={}){d(k,e,t,n,s)}function gt(e,t,n,s,i,r){return v(e.slice(t.length),k,
|
|
568
582
|
n,s,i,r)}function j(e,t,n,s,i){return gt(e,t,n,s,i,{count:1})[0]}function D(e,t,n,s,i,r){e.seen.has(t)&&h(s,`Duplicate ${r}\
|
|
569
583
|
.`,i),e.seen.add(t),e[t]=n}var ge="vibe64.preview-identity.command.v1",vr=/^[A-Z_][A-Z0-9_]*$/u,Xn=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
|
|
570
584
|
"TMPDIR","USER"]),Zn=new Set(["email","login","user-id"]),Jn=1e4,Ue=3e4,Qn=[["- Command: ","command","Command","`tools/p\
|
|
@@ -572,14 +586,14 @@ review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${ge}\
|
|
|
572
586
|
"Identity types",`one or more of ${[...Zn].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
|
|
573
587
|
t","Enabled environment","`ENV_NAME`"],["- Secret environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],
|
|
574
588
|
["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${Ue}\`\
|
|
575
|
-
(default ${Jn})`]],Et=Qn.map(([e,,,t])=>`${e}${t}`);function Yn(e,t,n,s){if(e===void 0)return"";let i=w(e,
|
|
589
|
+
(default ${Jn})`]],Et=Qn.map(([e,,,t])=>`${e}${t}`);function Yn(e,t,n,s){if(e===void 0)return"";let i=w(e,k,t,`Preview \
|
|
576
590
|
identity ${n} environment name`,s);return(!vr.test(i)||Xn.has(i)||i.startsWith("XDG_"))&&h(t,`Preview identity ${n} envi\
|
|
577
591
|
ronment name is invalid.`,s),i}function es(e){return{seen:new Set,line:e}}function ts(e,t,n,s){let i=Qn.find(([u])=>t.startsWith(
|
|
578
|
-
u));i||h(n,
|
|
592
|
+
u));i||h(n,y("Preview identity entry",t,Et),s);let[r,o,c]=i,a=gt(t,r,n,`Preview identity ${c}`,s);!["command","identityT\
|
|
579
593
|
ypes","runtimes"].includes(o)&&a.length!==1&&h(n,`Preview identity ${c} accepts exactly one value.`,s),D(e,o,a,n,s,`Prev\
|
|
580
594
|
iew identity ${c} entry`)}function ns(e,t,n){for(let[u,l]of[["command","Command"],["protocol","Protocol"],["identityType\
|
|
581
595
|
s","Identity types"]])e[u]||h(t,`Output target ${n} Preview identity needs ${l}.`,e.line);let s=e.command.map(u=>`\`${u}\
|
|
582
|
-
\``).join(" "),i=N(s,
|
|
596
|
+
\``).join(" "),i=N(s,k,t,"Preview identity command",e.line);(!i[0].includes("/")||i[0].includes("\\")||i[0].split("/").some(
|
|
583
597
|
u=>!u||[".",".."].includes(u))||i.some(u=>/\{(?:host|port)\}/u.test(u)))&&h(t,"Preview identity command must use a liter\
|
|
584
598
|
al app-owned project-relative executable.",e.line);let r=e.protocol[0];r!==ge&&h(t,`Preview identity protocol must be ${ge}\
|
|
585
599
|
.`,e.line);let o=[...new Set(e.identityTypes.map(u=>(Zn.has(u)||h(t,`Unsupported preview identity type: ${u}.`,e.line),u)))];
|
|
@@ -588,30 +602,30 @@ enabledEnvironment?.[0],t,"enabled",e.line),secret:Yn(e.secretEnvironment?.[0],t
|
|
|
588
602
|
c.secret&&h(t,"Preview identity enabled and secret environment names must differ.",e.line);let a=Jn;if(e.timeoutMs){let u=e.
|
|
589
603
|
timeoutMs[0];/^[0-9]+$/u.test(u)||h(t,`Preview identity Timeout ms must be from 1 through ${Ue}.`,e.line),a=Number(u),(!Number.
|
|
590
604
|
isSafeInteger(a)||a<1||a>Ue)&&h(t,`Preview identity Timeout ms must be from 1 through ${Ue}.`,e.line)}return{command:i,environment:c,
|
|
591
|
-
identityTypes:o,protocol:r,runtimes:e.runtimes?C(e.runtimes.map(u=>`\`${u}\``).join(" "),
|
|
592
|
-
e.line):[],timeoutMs:a}}var
|
|
593
|
-
Tr=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
605
|
+
identityTypes:o,protocol:r,runtimes:e.runtimes?C(e.runtimes.map(u=>`\`${u}\``).join(" "),k,t,"Preview identity runtimes",
|
|
606
|
+
e.line):[],timeoutMs:a}}var yr="bucket";function Sr(e=""){return e===yr}function ss(e={}){return!Sr(e.kind)}var wr="vibe64.outputs.v1",We="Outputs",_r=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,bt=/\{([a-z][a-z0-9:-]*)\}/gu,Ir=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
607
|
+
Tr=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,kr=/^#### Download `([^`\r\n]+)`$/u,Or=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
|
|
594
608
|
os=new Set(["finite","interactive"]),vt=new Set(["development","test"]),as=new Set(["terminal","web"]),is=16,Be=e=>[...e].
|
|
595
609
|
map(t=>`\`${t}\``).join(" or "),Ar=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
|
|
596
610
|
on","#### Preview identity","#### Download `id`"]),ze=Object.freeze({target:["- Default.",`- Mode: ${Be(os)}`,`- Data: ${Be(
|
|
597
611
|
vt)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
|
|
598
612
|
"- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${Be(as)}`,"- Preferred port: `1024` t\
|
|
599
613
|
hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:Et,download:["- Path:\
|
|
600
|
-
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function
|
|
601
|
-
i)||h(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),i}function Rr(e,t,n,s){let i=N(e,
|
|
614
|
+
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function yt(e,t,n,s){let i=w(e,k,t,n,s);return _r.test(
|
|
615
|
+
i)||h(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),i}function Rr(e,t,n,s){let i=N(e,k,t,n,s);for(let r of i)
|
|
602
616
|
r.replace(bt,"").includes("{parameter:")&&h(t,`${n} has an invalid {parameter:id} placeholder.`,s),[...r.matchAll(bt)].some(
|
|
603
617
|
o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&h(t,`${n} supports only {host}\
|
|
604
|
-
, {port}, and {parameter:id} placeholders.`,s);return i}function Nr(e,t,n){return{id:
|
|
605
|
-
e[2],
|
|
618
|
+
, {port}, and {parameter:id} placeholders.`,s);return i}function Nr(e,t,n){return{id:yt(e[1],t,"Output target id",n),label:w(
|
|
619
|
+
e[2],k,t,"Output target label",n),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,
|
|
606
620
|
downloads:[],parameters:[],seen:new Set,line:n}}function Cr(e,t,n,s){if(t==="- Required."){D(e,"required",!0,n,s,"Parame\
|
|
607
621
|
ter Required entry");return}for(let[i,r]of[["Default","default"],["Description","description"]]){let o=`- ${i}: `;if(t.startsWith(
|
|
608
|
-
o)){let c=j(t,o,n,`Parameter ${i}`,s);D(e,r,c,n,s,`Parameter ${i} entry`);return}}h(n,
|
|
622
|
+
o)){let c=j(t,o,n,`Parameter ${i}`,s);D(e,r,c,n,s,`Parameter ${i} entry`);return}}h(n,y("Outputs parameter entry",t,ze.parameter),
|
|
609
623
|
s)}function Dr(e,t={}){let n=e.parameters||[],s=r=>d("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",r);(!t||typeof t!="obj\
|
|
610
624
|
ect"||Array.isArray(t))&&s("Output parameters must be an object of text values.");let i=new Set(n.map(({id:r})=>r));for(let r of Object.
|
|
611
625
|
keys(t))i.has(r)||s(`Unknown output parameter: ${r}.`);return Object.fromEntries(n.map(r=>{let o=Object.hasOwn(t,r.id)?t[r.
|
|
612
626
|
id]:r.default;return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${r.label} must be a single line of tex\
|
|
613
627
|
t, at most 4096 characters.`),r.required&&!o.trim()&&s(`${r.label} is required.`),[r.id,o]}))}function Pr(e){return{kind:"",
|
|
614
|
-
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function $r(e,t,n){return{id:
|
|
628
|
+
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function $r(e,t,n){return{id:yt(e[1],t,"Download id",
|
|
615
629
|
n),path:"",name:"",mediaType:"",seen:new Set,line:n}}function Lr(e,t,n){/^[0-9]+$/u.test(e)||h(t,"Web presentation prefe\
|
|
616
630
|
rred port must be an integer from 1024 through 65535.",n);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&
|
|
617
631
|
h(t,"Web presentation preferred port must be an integer from 1024 through 65535.",n),s}function xr(e,t,n,s){if(t.startsWith(
|
|
@@ -619,25 +633,25 @@ h(t,"Web presentation preferred port must be an integer from 1024 through 65535.
|
|
|
619
633
|
e,"dataMode",r,n,s,"output target Data entry");return}if(t==="- Default."){D(e,"default",!0,n,s,"output target Default e\
|
|
620
634
|
ntry");return}if(t.startsWith("- Mode: ")){let r=j(t,"- Mode: ",n,"Output target Mode",s);os.has(r)||h(n,"Output target \
|
|
621
635
|
Mode must be `interactive` or `finite`.",s),D(e,"mode",r,n,s,"output target Mode entry");return}if(t.startsWith("- Workd\
|
|
622
|
-
ir: ")){D(e,"workdir",
|
|
623
|
-
Workdir entry");return}if(t.startsWith("- Runtimes: ")){D(e,"runtimeRequirements",C(t.slice(12),
|
|
636
|
+
ir: ")){D(e,"workdir",S(j(t,"- Workdir: ",n,"Output target Workdir",s),k,n,"Output target workdir",s),n,s,"output target\
|
|
637
|
+
Workdir entry");return}if(t.startsWith("- Runtimes: ")){D(e,"runtimeRequirements",C(t.slice(12),k,n,"Output target runt\
|
|
624
638
|
imes",s),n,s,"output target Runtimes entry");return}let i=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(i){
|
|
625
639
|
let r=i[1].toLowerCase(),o=Rr(i[3],n,"Output step command",s);r!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&h(n,"O\
|
|
626
|
-
nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:w(i[2],
|
|
627
|
-
label",s),argv:o,role:r});return}h(n,
|
|
640
|
+
nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:w(i[2],k,n,"Output step\
|
|
641
|
+
label",s),argv:o,role:r});return}h(n,y("Outputs target entry",t,[...ze.target,...Ar.slice(1)]),s)}function Vr(e,t,n,s){
|
|
628
642
|
if(t.startsWith("- Kind: ")){let i=j(t,"- Kind: ",n,"Presentation Kind",s);as.has(i)||h(n,"Presentation Kind must be `te\
|
|
629
643
|
rminal` or `web`.",s),D(e,"kind",i,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){D(e,"pre\
|
|
630
644
|
ferredPort",Lr(j(t,"- Preferred port: ",n,"Web presentation Preferred port",s),n,s),n,s,"Presentation Preferred port ent\
|
|
631
|
-
ry");return}if(t.startsWith("- URL path: ")){D(e,"urlPath",nt(j(t,"- URL path: ",n,"Web presentation URL path",s),
|
|
645
|
+
ry");return}if(t.startsWith("- URL path: ")){D(e,"urlPath",nt(j(t,"- URL path: ",n,"Web presentation URL path",s),k,n,"W\
|
|
632
646
|
eb presentation URL path",s),n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){D(e,"readiness",
|
|
633
|
-
ue(t,
|
|
634
|
-
s)}function Mr(e,t,n){let s=w(e,
|
|
635
|
-
s.trim()!==s)&&h(t,"Download Name must be a safe filename without path separators.",n),s}function jr(e,t,n){let s=w(e,
|
|
636
|
-
t,"Download Media type",n);return(s.length>127||!
|
|
637
|
-
value.",n),s}function Gr(e,t,n,s){if(t.startsWith("- Path: ")){D(e,"path",
|
|
647
|
+
ue(t,k,n,"Web presentation readiness",s),n,s,"Presentation Ready when entry");return}h(n,y("Presentation entry",t,ze.presentation),
|
|
648
|
+
s)}function Mr(e,t,n){let s=w(e,k,t,"Download Name",n);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
|
|
649
|
+
s.trim()!==s)&&h(t,"Download Name must be a safe filename without path separators.",n),s}function jr(e,t,n){let s=w(e,k,
|
|
650
|
+
t,"Download Media type",n);return(s.length>127||!Or.test(s))&&h(t,"Download Media type must be a lowercase type/subtype \
|
|
651
|
+
value.",n),s}function Gr(e,t,n,s){if(t.startsWith("- Path: ")){D(e,"path",S(j(t,"- Path: ",n,"Download Path",s),k,n,"Dow\
|
|
638
652
|
nload path",s,{allowRoot:!1}),n,s,"Download Path entry");return}if(t.startsWith("- Name: ")){D(e,"name",Mr(j(t,"- Name: ",
|
|
639
653
|
n,"Download Name",s),n,s),n,s,"Download Name entry");return}if(t.startsWith("- Media type: ")){D(e,"mediaType",jr(j(t,"-\
|
|
640
|
-
Media type: ",n,"Download Media type",s),n,s),n,s,"Download Media type entry");return}h(n,
|
|
654
|
+
Media type: ",n,"Download Media type",s),n,s),n,s,"Download Media type entry");return}h(n,y("Download entry",t,ze.download),
|
|
641
655
|
s)}function Ur(e,t,n){for(let[s,i]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(t,`Output targe\
|
|
642
656
|
t ${n} Download ${e.id} needs ${i}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Br(e,t,n){
|
|
643
657
|
return e.kind||h(t,`Output target ${n} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
|
|
@@ -664,12 +678,12 @@ downloads:i,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:
|
|
|
664
678
|
let{path:n="genesis/stack.md#Outputs"}=t;if(Array.isArray(e)||h(n,"Outputs must be supplied as exact Stack section lines\
|
|
665
679
|
."),_(e))return{version:1,targets:[]};let s=[],i=null,r="target",o=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)
|
|
666
680
|
continue;let l=a+1,m=u.match(Ir);if(m){i&&s.push(rs(i,n)),i=Nr(m,n,l),r="target",o=null;continue}i||h(n,"## Outputs must\
|
|
667
|
-
begin with a Target heading.",l);let p=u.match(Tr);if(p){let f={id:
|
|
681
|
+
begin with a Target heading.",l);let p=u.match(Tr);if(p){let f={id:yt(p[1],n,"Parameter id",l),label:w(p[2],k,n,"Parame\
|
|
668
682
|
ter label",l),default:"",description:"",required:!1,seen:new Set};i.parameters.push(f),r="parameter",o=f;continue}if(u===
|
|
669
683
|
"#### Presentation"){i.presentation&&h(n,"Presentation must appear at most once below an output target.",l),i.presentation=
|
|
670
684
|
Pr(l),r="presentation",o=i.presentation;continue}if(u==="#### Preview identity"){i.previewIdentity&&h(n,"Preview identit\
|
|
671
685
|
y must appear at most once below an output target.",l),i.previewIdentity=es(l),r="previewIdentity",o=i.previewIdentity;continue}
|
|
672
|
-
let E=u.match(
|
|
686
|
+
let E=u.match(kr);if(E){let f=$r(E,n,l);i.downloads.push(f),r="download",o=f;continue}r==="parameter"?Cr(o,u,n,l):r==="p\
|
|
673
687
|
resentation"?Vr(o,u,n,l):r==="previewIdentity"?ts(o,u,n,l):r==="download"?Gr(o,u,n,l):xr(i,u,n,l)}i&&s.push(rs(i,n)),s.length===
|
|
674
688
|
0&&h(n,"## Outputs needs at least one Target or exactly `- Nothing.`.");let c=s.map(({id:a})=>a);return new Set(c).size!==
|
|
675
689
|
c.length&&h(n,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(n,"Outputs may declare a\
|
|
@@ -691,10 +705,10 @@ ect services",Fr="- Start `service-id` [per session] with `runtime` [in `workdir
|
|
|
691
705
|
if(Array.isArray(e)||d(ie,re,"Expected exact Project services section lines."),_(e))return[];let t=[];for(let[n,s]of e.entries()){
|
|
692
706
|
let i=s.trim();if(!i)continue;let r=n+1,o=i.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
|
|
693
707
|
o||d(ie,re,`Use: ${Fr}`,r),t.some(({id:a})=>a===o[1])&&d(ie,re,"Duplicate project service id.",r);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
|
|
694
|
-
t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:C(c?c[1]:o[3],ie,re,"Service runtimes",r),workdir:
|
|
708
|
+
t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:C(c?c[1]:o[3],ie,re,"Service runtimes",r),workdir:S(c?.[2]||
|
|
695
709
|
".",ie,re,"Service workdir",r),argv:N(o[4],ie,re,"Service command",r)})}return t.length||d(ie,re,"Declare a service or e\
|
|
696
710
|
xactly `- Nothing.`."),t}function ps(e={}){let t=e.status==="ready"?ls(e.lines):[];return{contract:Hr,status:e.status===
|
|
697
|
-
"blocked"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?
|
|
711
|
+
"blocked"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?O(t):"",diagnostics:e.diagnostics||[]}}var hs="vibe64.staging-data.v1",Tt="Staging data",Ee="VIBE64_STAGING_DATA_INVALID",fs="genesis/stack.md#Staging data",me=Object.
|
|
698
712
|
freeze({"own copy, empty":"empty","own copy, full":"full","own copy, sampled":"sampled","shared with production":"shared",
|
|
699
713
|
"shared with production, structure frozen":"frozen"}),qr=Object.freeze(Object.fromEntries(Object.entries(me).map(([e,t])=>[
|
|
700
714
|
t,e]))),Kr=Object.freeze({empty:Object.freeze({source:!1,unlisted:!1,sampling:!1,contacts:!1}),full:Object.freeze({source:!0,
|
|
@@ -702,38 +716,38 @@ unlisted:!1,sampling:!1,contacts:!0}),sampled:Object.freeze({source:!0,unlisted:
|
|
|
702
716
|
freeze({source:!1,unlisted:!1,sampling:!1,contacts:!1}),frozen:Object.freeze({source:!1,unlisted:!1,sampling:!1,contacts:!1})}),
|
|
703
717
|
Yr=Object.freeze({empty:"Staging's own database starts empty",full:"a whole copy keeps every row",shared:"Staging uses p\
|
|
704
718
|
roduction's database itself",frozen:"Staging uses production's database itself"}),ds=Object.freeze(["mysql","postgresql"]),
|
|
705
|
-
Fe="{dump}",ms=/\{[A-Za-z][A-Za-z0-9_:-]*\}/u,gs=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/u,
|
|
719
|
+
Fe="{dump}",ms=/\{[A-Za-z][A-Za-z0-9_:-]*\}/u,gs=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/u,St=Object.freeze({unlistedRows:Object.
|
|
706
720
|
freeze([1,1e7]),days:Object.freeze([1,36500]),rows:Object.freeze([1,1e8])}),Xr=/^dump written by command with (.+?) in `([^`\r\n]+)`: (.+)$/u,
|
|
707
|
-
Zr=/^all up to `([^`\r\n]*)` rows$/u,
|
|
721
|
+
Zr=/^all up to `([^`\r\n]*)` rows$/u,kt=/^- `([^`\r\n]*)`: (.+)$/u,Jr=/^recent by `([^`\r\n]*)`(?:, last `([^`\r\n]*)` days)?(?:, newest `([^`\r\n]*)` rows)?$/u,
|
|
708
722
|
Es=/^- `([^`\r\n]*)` to `([^`\r\n]*)`$/u,bs=/^- `([^`\r\n]*)` keeps every `([^`\r\n]*)` row by `([^`\r\n]*)`$/u,Qr=Object.
|
|
709
|
-
freeze(["email","phone"]),
|
|
723
|
+
freeze(["email","phone"]),Ot="- Nothing.",vs=Object.freeze(Object.keys(me).map(e=>`- Mode: ${e}`)),qe="- Source: dump wr\
|
|
710
724
|
itten by command with `runtime` in `workdir`: `command` `argument`... `{dump}`",At="- Unlisted tables: all up to `n` row\
|
|
711
725
|
s",q=Object.freeze({section:Object.freeze(["- Database: `resource`",...vs,qe,At]),tables:Object.freeze(["- `table`: all",
|
|
712
726
|
"- `table`: none","- `table`: recent by `column`, last `n` days","- `table`: recent by `column`, newest `n` rows","- `ta\
|
|
713
727
|
ble`: recent by `column`, last `n` days, newest `n` rows"]),links:Object.freeze(["- `table.column` to `table.column`"]),
|
|
714
728
|
keepTogether:Object.freeze(["- `parent` keeps every `child` row by `column`"]),contacts:Object.freeze(["- `table.column`\
|
|
715
|
-
: email","- `table.column`: phone",
|
|
729
|
+
: email","- `table.column`: phone",Ot])}),Rt=new Map([["### Tables","tables"],["### Links","links"],["### Keep together",
|
|
716
730
|
"keepTogether"],["### Contacts","contacts"]]),eo=Object.freeze([...Rt.keys()]),wt=Object.freeze(Object.fromEntries([...Rt].
|
|
717
731
|
map(([e,t])=>[t,e]))),to=Object.freeze({tables:"table rule",links:"link",keepTogether:"Keep together entry",contacts:"co\
|
|
718
|
-
ntact"});function no(e,t,n){let[s]=v(t,Ee,e.location,"Staging data Database",n,{count:1});
|
|
732
|
+
ntact"});function no(e,t,n){let[s]=v(t,Ee,e.location,"Staging data Database",n,{count:1});ke.test(s)||e.fail(`Database n\
|
|
719
733
|
ames a database resource of genesis/stack.md's ## Resources by its id, such as \`database\`; ${JSON.stringify(s)} isn't \
|
|
720
|
-
one.`,n),e.model.database=s}function so(e,t,n){Object.hasOwn(me,t)||e.fail(
|
|
734
|
+
one.`,n),e.model.database=s}function so(e,t,n){Object.hasOwn(me,t)||e.fail(y("Staging data Mode",t,Object.keys(me)),n),e.
|
|
721
735
|
model.mode=me[t]}function io(e,t,n){let s=t.find(o=>o!==Fe&&o.includes(Fe));s&&e.fail(`Source passes \`{dump}\` inside \`${s}\
|
|
722
736
|
\`: give it as an argument of its own, such as \`--output\` \`{dump}\`.`,n);let i=t.find(o=>o!==Fe&&ms.test(o));i&&e.fail(
|
|
723
737
|
`Source has the placeholder \`${i.match(ms)[0]}\`; \`{dump}\` is its only one.`,n);let r=t.filter(o=>o===Fe).length;r!==
|
|
724
738
|
1&&e.fail(r?`Source passes \`{dump}\` ${r} times; its command writes one dump, so pass it once.`:`Source's command must \
|
|
725
739
|
pass \`{dump}\`, the file it writes production's dump to, as an argument of its own. Use: ${qe}`,n)}function ro(e,t,n){let s=t.
|
|
726
740
|
match(Xr);s||e.fail(`Staging data Source must use: ${qe}`,n);let i=N(s[3],Ee,e.location,"Staging data Source command",n);
|
|
727
|
-
io(e,i,n),e.model.dumpSource={argv:i,workdir:
|
|
741
|
+
io(e,i,n),e.model.dumpSource={argv:i,workdir:S(s[2],Ee,e.location,"Staging data Source workdir",n),runtimeRequirements:C(
|
|
728
742
|
s[1],Ee,e.location,"Staging data Source runtimes",n)}}function _t(e,t,[n,s],i,r){let o=/^[1-9][0-9]*$/u.test(t)?Number(t):
|
|
729
743
|
Number.NaN;return o>=n&&o<=s||e.fail(`${i} must be a whole number from ${n} to ${s}; \`${t}\` isn't one.`,r),o}function oo(e,t,n){
|
|
730
744
|
let s=t.match(Zr);s||e.fail(`Staging data Unlisted tables must use: ${At}`,n),e.model.unlistedTables={maxRows:_t(e,s[1],
|
|
731
|
-
|
|
745
|
+
St.unlistedRows,"Unlisted tables' rows",n)}}var ao=Object.freeze([{prefix:"- Database: ",key:"database",label:"Database",
|
|
732
746
|
read:no},{prefix:"- Mode: ",key:"mode",label:"Mode",read:so},{prefix:"- Source: ",key:"source",label:"Source",read:ro},{
|
|
733
|
-
prefix:"- Unlisted tables: ",key:"unlisted",label:"Unlisted tables",read:oo}]);function co(e){if(e===
|
|
734
|
-
e))return"keepTogether";if(Es.test(e))return"links";let t=e.match(
|
|
747
|
+
prefix:"- Unlisted tables: ",key:"unlisted",label:"Unlisted tables",read:oo}]);function co(e){if(e===Ot)return"";if(bs.test(
|
|
748
|
+
e))return"keepTogether";if(Es.test(e))return"links";let t=e.match(kt);return t?t[1].includes(".")?"contacts":"tables":""}
|
|
735
749
|
function uo(e,t,n){let s=ao.find(({prefix:i})=>t.startsWith(i));if(!s){let i=co(t);e.fail(i?`\`${t}\` is a ${to[i]}: put\
|
|
736
|
-
it under \`${wt[i]}\`, after the section's own entries.`:
|
|
750
|
+
it under \`${wt[i]}\`, after the section's own entries.`:y("Staging data entry",t,q.section),n)}e.at[s.key]&&e.fail(`St\
|
|
737
751
|
aging data has a second ${s.label} entry; the first is on line ${e.at[s.key]}.`,n),e.at[s.key]=n,s.read(e,t.slice(s.prefix.
|
|
738
752
|
length),n)}function be(e,t,n,s){return gs.test(t)||e.fail(`\`${t}\` isn't a ${n} name: use up to 64 letters, digits and \
|
|
739
753
|
_, starting with a letter or _.`,s),t}function It(e,t,n){let s=t.split(".");return(s.length!==2||!s.every(i=>gs.test(i)))&&
|
|
@@ -742,23 +756,23 @@ e.fail(`\`${t}\` isn't a column: name it \`table.column\`, each up to 64 letters
|
|
|
742
756
|
if(t==="all"||t==="none")return{rule:t};let s=t.match(Jr);return s||e.fail(`Unknown table rule: ${t}. Use one of: ${q.tables.
|
|
743
757
|
join("; ")}.`,n),s[2]===void 0&&s[3]===void 0&&e.fail("A recent rule keeps its table's rows of the last `n` days, its ne\
|
|
744
758
|
west `n` rows, or both: add `, last `n` days`, `, newest `n` rows` or both, in that order.",n),{rule:"recent",by:be(e,s[1],
|
|
745
|
-
"column",n),days:s[2]===void 0?null:_t(e,s[2],
|
|
746
|
-
"A recent rule's rows",n)}}function po(e,t,n){let s=t.match(
|
|
759
|
+
"column",n),days:s[2]===void 0?null:_t(e,s[2],St.days,"A recent rule's days",n),rows:s[3]===void 0?null:_t(e,s[3],St.rows,
|
|
760
|
+
"A recent rule's rows",n)}}function po(e,t,n){let s=t.match(kt);s||e.fail(y("Staging data table rule",t,q.tables),n);let i=be(
|
|
747
761
|
e,s[1],"table",n);Ke(e,"tables",i,`### Tables names \`${i}\` twice; give each table one rule.`,n),e.model.tables.push({table:i,
|
|
748
|
-
...lo(e,s[2],n)})}function mo(e,t,n){let s=t.match(Es);s||e.fail(
|
|
762
|
+
...lo(e,s[2],n)})}function mo(e,t,n){let s=t.match(Es);s||e.fail(y("Staging data link",t,q.links),n);let i=It(e,s[1],n),
|
|
749
763
|
r=It(e,s[2],n);s[1]===s[2]&&e.fail(`\`${s[1]}\` links to itself; a link names the column another column refers to.`,n),Ke(
|
|
750
764
|
e,"links",s[1],`### Links links \`${s[1]}\` twice; a column refers to one column.`,n),e.model.links.push({from:i,to:r})}
|
|
751
|
-
function ho(e,t,n){let s=t.match(bs);s||e.fail(
|
|
765
|
+
function ho(e,t,n){let s=t.match(bs);s||e.fail(y("Staging data Keep together entry",t,q.keepTogether),n);let i=be(e,s[1],
|
|
752
766
|
"table",n),r=be(e,s[2],"table",n),o=be(e,s[3],"column",n);i===r&&e.fail(`\`${i}\` keeps its own rows; Keep together names\
|
|
753
767
|
a parent table and another table whose rows refer to it.`,n),Ke(e,"keepTogether",`${r}.${o}`,`### Keep together keeps \`${r}\
|
|
754
768
|
\` rows by \`${o}\` twice; name each once.`,n),e.model.keepTogether.push({parent:i,child:r,column:o})}function fo(e,t,n){
|
|
755
|
-
if(t===
|
|
769
|
+
if(t===Ot){e.entries.contacts>0&&e.fail("`- Nothing.` under ### Contacts says no column holds one, so it is the heading'\
|
|
756
770
|
s only entry.",n),e.contactsNothing=n;return}e.contactsNothing&&e.fail(`### Contacts says \`- Nothing.\` on line ${e.contactsNothing}\
|
|
757
|
-
: remove it, or this contact.`,n);let s=t.match(
|
|
771
|
+
: remove it, or this contact.`,n);let s=t.match(kt);s||e.fail(y("Staging data contact",t,q.contacts),n);let{table:i,column:r}=It(
|
|
758
772
|
e,s[1],n);Qr.includes(s[2])||e.fail(`Contact \`${s[1]}\` is an \`email\` or a \`phone\` column, written without backticks: ${q.
|
|
759
773
|
contacts.slice(0,2).join(" or ")}.`,n),Ke(e,"contacts",s[1],`### Contacts names \`${s[1]}\` twice; name each column once.`,
|
|
760
774
|
n),e.model.contacts.push({table:i,column:r,kind:s[2]})}var go=Object.freeze({tables:po,links:mo,keepTogether:ho,contacts:fo});
|
|
761
|
-
function Eo(e,t,n){let s=Rt.get(t);return s||e.fail(
|
|
775
|
+
function Eo(e,t,n){let s=Rt.get(t);return s||e.fail(y("Staging data heading",t,eo),n),e.at[s]&&e.fail(`Staging data has \
|
|
762
776
|
a second \`${t}\` heading; the first is on line ${e.at[s]}.`,n),e.at[s]=n,s}function bo(e,t,n,s){let{at:i,fail:r}=e;n.source&&
|
|
763
777
|
!i.source&&r(`Mode ${t} builds Staging's own database from a dump of production's: add ${qe}`,i.mode),!n.source&&i.source&&
|
|
764
778
|
r(`Mode ${t} has no Source: ${s}.`,i.source),n.unlisted&&!i.unlisted&&r(`Mode ${t} says how many rows a table it doesn't\
|
|
@@ -771,48 +785,48 @@ o(`Mode ${t} copies production's data, which holds people's email addresses and
|
|
|
771
785
|
each column that holds one, or \`- Nothing.\` under it when none does.`,i.mode),!n.contacts&&i.contacts&&o(`Mode ${t} h\
|
|
772
786
|
as no \`### Contacts\`: ${s}, so there is nothing to replace.`,i.contacts),i.contacts&&r.contacts===0&&!e.contactsNothing&&
|
|
773
787
|
o("`### Contacts` has no entries: name each column that holds an email address or phone number, or write `- Nothing.` wh\
|
|
774
|
-
en none does.",i.contacts)}function
|
|
788
|
+
en none does.",i.contacts)}function yo(e,t){e.at.database||e.fail("Staging data needs `- Database: `resource``, naming t\
|
|
775
789
|
he database resource of genesis/stack.md's ## Resources whose Staging data it declares.",t),e.at.mode||e.fail(`Staging d\
|
|
776
790
|
ata needs a Mode. Use one of: ${vs.join("; ")}.`,t);let n=qr[e.model.mode],s=Kr[e.model.mode],i=Yr[e.model.mode]||"";bo(
|
|
777
|
-
e,n,s,i),vo(e,n,s,i)}function
|
|
791
|
+
e,n,s,i),vo(e,n,s,i)}function ys(e,t){let n=(o,c)=>d(Ee,t,o,c||void 0);Array.isArray(e)||n("Staging data requires exact \
|
|
778
792
|
Stack section lines.");let s=e.findIndex(o=>typeof o=="string"&&o.trim())+1;_(e)&&n("`- Nothing.` declares no Staging da\
|
|
779
793
|
ta: declare a mode (`- Database: `database`` and `- Mode: own copy, empty` at least), or remove the section, which gives\
|
|
780
794
|
Staging its own empty database.",s);let i={location:t,fail:n,model:{database:"",mode:"",dumpSource:null,unlistedTables:null,
|
|
781
795
|
tables:[],links:[],keepTogether:[],contacts:[]},at:{},entries:{tables:0,links:0,keepTogether:0,contacts:0},named:{tables:new Set,
|
|
782
796
|
links:new Set,keepTogether:new Set,contacts:new Set},contactsNothing:0},r="";for(let[o,c]of e.entries()){let a=String(c).
|
|
783
|
-
trim();if(!a)continue;let u=o+1;a.startsWith("#")?r=Eo(i,a,u):r?(go[r](i,a,u),i.entries[r]+=1):uo(i,a,u)}return
|
|
784
|
-
i}function
|
|
797
|
+
trim();if(!a)continue;let u=o+1;a.startsWith("#")?r=Eo(i,a,u):r?(go[r](i,a,u),i.entries[r]+=1):uo(i,a,u)}return yo(i,s),
|
|
798
|
+
i}function So(e,t={}){let{path:n=fs}=t;return ys(e,n).model}function wo(e,t){let n=Oe(t),{database:s}=e.model,i=[...n.values()].
|
|
785
799
|
filter(c=>ds.includes(c.kind)).map(({id:c})=>`\`${c}\``),r=i.length?`name one of its databases: ${i.join(", ")}`:"it dec\
|
|
786
800
|
lares no `mysql` or `postgresql` database; add one to the Stack, or remove the section",o=n.get(s);return o||e.fail(`Dat\
|
|
787
801
|
abase \`${s}\`: genesis/stack.md's ## Resources declares no resource \`${s}\`; ${r}.`,e.at.database),ds.includes(o.kind)||
|
|
788
802
|
e.fail(`Database \`${s}\` is a ${o.kind} resource, and Staging data is for a \`mysql\` or \`postgresql\` database; ${r}.`,
|
|
789
803
|
e.at.database),o.kind}function Nt({environment:e={},section:t={}}={}){M(t,e,"Staging data section");let n=[...t.diagnostics||
|
|
790
|
-
[]],s=t.status==="ready"&&n.length===0?
|
|
804
|
+
[]],s=t.status==="ready"&&n.length===0?ys(t.lines,fs):null,i=s?.model,r={database:i?.database||"",engine:s?wo(s,e.resources):
|
|
791
805
|
"",mode:i?.mode||"empty",dumpSource:i?.dumpSource||null,unlistedTables:i?.unlistedTables||null,tables:i?.tables||[],links:i?.
|
|
792
806
|
links||[],keepTogether:i?.keepTogether||[],contacts:i?.contacts||[]};return{contract:hs,status:n.length>0?"blocked":s?"r\
|
|
793
|
-
eady":"unconfigured",stackHash:t.stackHash,recipeHash:s?
|
|
794
|
-
[]],diagnostics:n,...r}}import{access as _o}from"node:fs/promises";import ws from"node:path";var Io="vibe64.workspace-setup.v1",ve="Workspace setup",Ye="VIBE64_WORKSPACE_SETUP_INVALID",
|
|
807
|
+
eady":"unconfigured",stackHash:t.stackHash,recipeHash:s?O({version:1,...r}):"",source:t.source||null,components:[...t.components||
|
|
808
|
+
[]],diagnostics:n,...r}}import{access as _o}from"node:fs/promises";import ws from"node:path";var Io="vibe64.workspace-setup.v1",ve="Workspace setup",Ye="VIBE64_WORKSPACE_SETUP_INVALID",Ss="- Prepare `label` [from \
|
|
795
809
|
`path`...] with `runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",To=/^- Prepare `([^`\r\n]+)` (.+)$/u,
|
|
796
|
-
|
|
810
|
+
ko=/^from ((?:`[^`\r\n]+`[ \t]+)+)(with .+)$/u;function Ct(e,t,n,s={}){d(Ye,e,t,n,s)}function Xe(e,t={}){let{path:n="gen\
|
|
797
811
|
esis/stack.md#Workspace setup"}=t;if(Array.isArray(e)||Ct(n,"Workspace setup must be supplied as exact Stack section lin\
|
|
798
812
|
es."),_(e))return[];let s=[];for(let i=0;i<e.length;i+=1){let r=e[i].trim();if(!r)continue;let o=i+1,c=r.match(To),a=c?.[2].
|
|
799
|
-
match(
|
|
813
|
+
match(ko);(!c||c[2].startsWith("from ")&&!a)&&Ct(n,`Every Workspace setup entry must use: ${Ss}`,o,{observed:r}),s.push(
|
|
800
814
|
{label:w(c[1],Ye,n,"Workspace setup step label",o),...a?{inputs:Ie(a[1].trimEnd(),Ye,n,"Workspace setup inputs",o)}:{},...Te(
|
|
801
|
-
a?a[2]:c[2],Ye,n,"Workspace setup",o,{form:
|
|
802
|
-
t one Prepare entry or exactly `- Nothing.`."),s}async function
|
|
815
|
+
a?a[2]:c[2],Ye,n,"Workspace setup",o,{form:Ss,observed:r})})}return s.length===0&&Ct(n,"## Workspace setup needs at leas\
|
|
816
|
+
t one Prepare entry or exactly `- Nothing.`."),s}async function Oo(e,t){try{return await _o(ws.join(e,t)),!0}catch(n){if([
|
|
803
817
|
"ENOENT","ENOTDIR"].includes(n?.code))return!1;throw n}}async function _s({projectRoot:e,section:t={}}={}){let n=[...t.diagnostics||
|
|
804
818
|
[]],s=[];t.status==="ready"&&(s=Xe(t.lines));let i=[],r=[],o=ws.resolve(e);if(n.length===0)for(let p of s){if(!p.condition||
|
|
805
|
-
await
|
|
819
|
+
await Oo(o,p.condition.pathExists)){i.push(p);continue}p.condition.onMissing==="wait"&&r.push(p.condition.pathExists)}if(r.
|
|
806
820
|
length>0){let p=H(r);n.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting for project ${p.length===
|
|
807
821
|
1?"path":"paths"}: ${p.join(", ")}.`,details:{paths:p}})}let c=n.some(({code:p})=>p==="VIBE64_WORKSPACE_SETUP_WAITING"),
|
|
808
822
|
a=n.some(({code:p})=>p!=="VIBE64_WORKSPACE_SETUP_WAITING"),u="unconfigured";a?u="blocked":!c&&i.length>0&&(u="ready");let l=i.
|
|
809
823
|
map(({condition:p,...E})=>E),m={version:1,steps:l};return{contract:Io,status:u,stackHash:t.stackHash,recipeHash:u==="rea\
|
|
810
|
-
dy"?
|
|
811
|
-
steps:l,diagnostics:n}}var Ao="vibe64.resource-estimates.v1",Ze="Resource estimates",
|
|
824
|
+
dy"?O(m):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:H(l.flatMap(p=>p.runtimeRequirements)),
|
|
825
|
+
steps:l,diagnostics:n}}var Ao="vibe64.resource-estimates.v1",Ze="Resource estimates",ks="VIBE64_RESOURCE_ESTIMATES_INVALID",Ro=1024*1024,Is=1024*
|
|
812
826
|
1024,Ts=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
|
|
813
|
-
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,t,n){d(
|
|
827
|
+
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,t,n){d(ks,
|
|
814
828
|
e,t,n)}function Dt(e,t,n,s,i){let r=e.get(t),o=e.get(n);return(r===void 0||o===void 0||r>o)&&G(s,"Each resource phase re\
|
|
815
|
-
quires typical and high estimates, with typical no greater than high.",i),{typicalBytes:r,highBytes:o}}function
|
|
829
|
+
quires typical and high estimates, with typical no greater than high.",i),{typicalBytes:r,highBytes:o}}function Os(e,t={}){
|
|
816
830
|
let{path:n="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:i=!1}=t;(!Array.isArray(e)||e.length>2048||
|
|
817
831
|
e.some(l=>typeof l!="string")||Buffer.byteLength(e.join(`
|
|
818
832
|
`),"utf8")>64*1024)&&G(n,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let r={version:1,
|
|
@@ -832,19 +846,19 @@ line:p};continue}let f=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),T=f&&Ts.get
|
|
|
832
846
|
Is)&&G(n,`Resource estimates must be between 1 and ${Is} MiB.`,p),a.fields.set(T,U*Ro)}return u(),c.size===0&&G(n,"Resou\
|
|
833
847
|
rce estimates needs an operation or exactly `- Nothing.`."),r}function Je({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){
|
|
834
848
|
M(e,t,"Resource estimates and Outputs"),M(e,n,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],i={
|
|
835
|
-
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{i=
|
|
849
|
+
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{i=Os(e.lines,{targets:t.status==="read\
|
|
836
850
|
y"?He(t.lines).targets:[],hasWorkspaceSetup:n.status==="ready"&&Xe(n.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
|
|
837
|
-
kOperationError")throw o;s.push({code:
|
|
851
|
+
kOperationError")throw o;s.push({code:ks,message:o.message,details:{...o.details,causeCode:o.code}})}let r=s.length>0?"i\
|
|
838
852
|
nvalid":i.outputs.length>0||i.workspaceSetup?"ready":"unconfigured";return{contract:Ao,status:r,stackHash:e.stackHash,sectionHash:e.
|
|
839
|
-
sectionHash||"",estimatesHash:r==="ready"?
|
|
840
|
-
fallbackReason:r==="invalid"?"invalid-estimates":r==="unconfigured"?"not-declared":null,diagnostics:s}}var No="vibe64.integration-setup.v1",As="Integration setup",
|
|
853
|
+
sectionHash||"",estimatesHash:r==="ready"?O(i):"",source:e.source||null,outputs:i.outputs,workspaceSetup:i.workspaceSetup,
|
|
854
|
+
fallbackReason:r==="invalid"?"invalid-estimates":r==="unconfigured"?"not-declared":null,diagnostics:s}}var No="vibe64.integration-setup.v1",As="Integration setup",ye="VIBE64_INTEGRATION_SETUP_INVALID",Co="- Command with `ru\
|
|
841
855
|
ntime` in `workdir`: `command` `argument`...";function Rs(e,t={}){let{path:n="genesis/stack.md#Integration setup"}=t;if(Array.
|
|
842
|
-
isArray(e)||d(
|
|
843
|
-
Boolean),i=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return i||d(
|
|
844
|
-
p requires exactly one entry: ${Co}; or - Nothing.`),{argv:N(i[3],
|
|
845
|
-
"Integration setup workdir"),runtimeRequirements:C(i[1],
|
|
856
|
+
isArray(e)||d(ye,n,"Integration setup requires exact Stack section lines."),_(e))return null;let s=e.map(r=>r.trim()).filter(
|
|
857
|
+
Boolean),i=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return i||d(ye,n,`Integration setu\
|
|
858
|
+
p requires exactly one entry: ${Co}; or - Nothing.`),{argv:N(i[3],ye,n,"Integration setup command"),workdir:S(i[2],ye,n,
|
|
859
|
+
"Integration setup workdir"),runtimeRequirements:C(i[1],ye,n,"Integration setup runtimes")}}function Ns({section:e={}}={}){
|
|
846
860
|
let t=[...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?Rs(e.lines):null;return{contract:No,status:t.length?"blo\
|
|
847
|
-
cked":n?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?
|
|
861
|
+
cked":n?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?O({version:1,command:n}):"",source:e.source||null,components:[
|
|
848
862
|
...e.components||[]],command:n,diagnostics:t}}var Do=new URL("./index.js",import.meta.url).href,Ps=$o(Do),Qe=new Map;async function Lo(e){if(!W.isAbsolute(e||""))throw new TypeError(
|
|
849
863
|
"Genesis host context requires an absolute runtime root.");let t=W.join(e,"genesis-context");if(!Qe.has(t)){let n=dn(t).
|
|
850
864
|
catch(s=>{throw Qe.delete(t),s});Qe.set(t,n)}return Qe.get(t)}var{GENESIS_CONTRACTS:P,HOST_CONTEXT_RESOLVER_DATA_ENV:xo,
|
|
@@ -854,7 +868,7 @@ inspectProjectFormat:Ko,inspectAgentIntegrations:Yo,inspectSkills:Xo,inspectStac
|
|
|
854
868
|
listStackPieces:ea,listTemplates:ta,parserEnvironment:Jc,setCollaboration:na,setEngineeringProfile:sa,syncAgentIntegrations:ia,
|
|
855
869
|
syncSkills:ra,withTrustedGitRepository:oa,SOURCE_EXPLANATION_PROMPT_VERSION:Qc,sourceExplanationGuidance:eu,validateArchitectureFacts:tu,
|
|
856
870
|
mergeArchitectureObservations:nu,validateCityDocument:su,validateCallWeb:iu,CALL_WEB_SCHEMA:ru,MACHINE_CITY_SCHEMA:ou,PROGRAM_CITY_SCHEMA:au,
|
|
857
|
-
CITY_SCHEMA_VERSION:cu}=
|
|
871
|
+
CITY_SCHEMA_VERSION:cu}=Se;async function uu(e){let t=await Lo(e);return{[Vo]:ma(),[xo]:JSON.stringify({registryPath:t.registryPath}),
|
|
858
872
|
GENESIS_TURN_CONTEXT_ENABLED:"0"}}var lu="genesis/blueprint.md",pu="genesis/subsystems.md",aa=Object.freeze(["vue","djan\
|
|
859
873
|
go-postgresql","jskit-postgresql","postgresql","rails-postgresql","spring-boot-postgresql"]),ca=Object.freeze(["genesis-\
|
|
860
874
|
stack"]),Ds=Object.freeze({BLUEPRINT_INVALID:"blueprint",BLUEPRINT_REQUIRED:"start"});if(!Array.isArray($s))throw new Error(
|
|
@@ -872,8 +886,8 @@ e),"../../bin")}function ma(){return W.resolve(xs(),"vibe64-genesis-host-context
|
|
|
872
886
|
{hiddenStackPieces:aa}:{},stackPackages:ca}}function mu(e={}){return z(Mo,e)}async function hu(e={}){let t=await oe(ea,e);
|
|
873
887
|
if(t.every(n=>Array.isArray(n?.resourceDeclarations)))return t;throw new Error("This genesis-compiler lists no Stack res\
|
|
874
888
|
ource declarations. Update it to the release Vibe64 declares.")}function fu(e={}){return z(Bo,e)}function gu(e={}){return oe(
|
|
875
|
-
Xo,e)}function Eu(e={}){return z(ra,e)}function bu(e={}){return z(ia,e)}function vu(e={}){return oe(Yo,e)}function
|
|
876
|
-
return oe(Qo,e)}async function
|
|
889
|
+
Xo,e)}function Eu(e={}){return z(ra,e)}function bu(e={}){return z(ia,e)}function vu(e={}){return oe(Yo,e)}function yu(e={}){
|
|
890
|
+
return oe(Qo,e)}async function Su(e={}){return tn(await ae(Xt,e))}async function wu(e={}){return rn(await ae(nn,e))}function _u(e={}){
|
|
877
891
|
return z(Uo,e)}function fa(){let e=zo();if(e?.contract!==P.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||
|
|
878
892
|
"no contract identity"}; expected ${P.derivedArtifacts}.`);let t=Array.isArray(e.artifacts)?e.artifacts:[];if(!t.length||
|
|
879
893
|
t.some(n=>!x(n?.path)))throw new Error("Genesis returned an invalid derived-artifact contract.");return{...e,artifacts:t.
|
|
@@ -886,22 +900,22 @@ sis project guidance is unavailable for this conversation (${x(e?.message||e).re
|
|
|
886
900
|
son given"}). Work from the repository itself, where the genesis/ files still describe the project when present, and tel\
|
|
887
901
|
l the user that Genesis guidance did not load if it matters to the request.`}async function Tu({workdir:e,promptContext:t},{
|
|
888
902
|
onGenesisUnavailable:n=Ms,timeoutMs:s=$t}={}){let i=le(t);if(t.scope==="ephemeral")return i;let r;try{let o=await Lt(()=>z(
|
|
889
|
-
|
|
903
|
+
Se.projectSessionContext,{projectRoot:e,hostDriver:le,hostDriverInput:t}),s);if(typeof o?.output=="string"&&o.output.trim())
|
|
890
904
|
return o.output;r=new Error("Genesis returned no session guidance.")}catch(o){r=o}return n(r),`${va(r)}
|
|
891
905
|
|
|
892
906
|
${i}`}function oe(e,t={}){return Lt(()=>z(e,t))}function js(e,t){if(e?.contract!==t)throw new Error(`Genesis returned ${e?.
|
|
893
907
|
contract||"no contract identity"}; expected ${t}.`);return e}async function K(e,t,n={}){return js(await oe(e,n),t)}async function Vt(e,t,n={}){
|
|
894
908
|
return js(await z(e,n),t)}function ae(e,t={}){return K(n=>Zo({...n,name:e}),P.stackSection,t)}async function Mt(e,t={}){
|
|
895
909
|
let n=await oe(s=>Jo({...s,names:e}),t);if(!Array.isArray(n)||n.length!==e.length||n.some((s,i)=>s?.contract!==P.stackSection||
|
|
896
|
-
s.name!==e[i]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return n}async function
|
|
897
|
-
if((await
|
|
910
|
+
s.name!==e[i]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return n}async function ku(e={}){
|
|
911
|
+
if((await ya(e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its\
|
|
898
912
|
Stack can be inspected."),{code:"vibe64_stack_format_required"});await Po(W.join(e.projectRoot,ot),"utf8");let n=await ae(
|
|
899
913
|
ve,e);return{components:n.components,stackHash:n.stackHash}}function jt(e,t){return async(n={})=>{let[s,i]=await Promise.
|
|
900
|
-
all([ae(e,n),K(Pt,P.environment,n)]);return t({environment:i,section:s})}}var
|
|
901
|
-
return z(
|
|
914
|
+
all([ae(e,n),K(Pt,P.environment,n)]);return t({environment:i,section:s})}}var Ou=jt(Ln,Vn),Au=jt(Wn,Kn),Ru=jt(Tt,Nt);function Nu(e={}){
|
|
915
|
+
return z(Se.verify,e)}function Cu(e={}){return K(Pt,P.environment,e)}function Du(e={}){return K(qo,P.projectInspection,e)}
|
|
902
916
|
function Pu(e={}){return K(ta,P.templates,e)}function $u(e={}){return Vt(jo,P.templateApplication,e)}function Lu(e={}){return K(
|
|
903
917
|
Ho,P.engineering,e)}function xu(e={}){return K(Wo,P.collaboration,e)}async function Vu(e){let{unavailable:t,passes:n,master:s}=await K(
|
|
904
|
-
Fo,P.passes,e);return{unavailable:t,passes:n,master:s}}async function
|
|
918
|
+
Fo,P.passes,e);return{unavailable:t,passes:n,master:s}}async function ya(e={}){let t=await oe(Ko,e);if(!x(t?.status))throw new Error(
|
|
905
919
|
"Genesis did not return a project-format status.");return{...t}}function Mu(e={}){return Vt(sa,P.engineering,e)}function ju(e={}){
|
|
906
920
|
return Vt(na,P.collaboration,e)}async function Gu({resourcesPreparing:e=!1,...t}={}){let[[n,s,i],r]=await Promise.all([Mt(
|
|
907
921
|
[We,Ze,ve],t),K(Pt,P.environment,t)]);return{...cs({environment:r,section:n,resourcesPreparing:e===!0}),resourceEstimates:Je(
|
|
@@ -924,13 +938,13 @@ mu as addGenesisStack,$u as applyGenesisTemplate,ua as assertGenesisPromptTask,x
|
|
|
924
938
|
Jc as genesisParserEnvironment,gi as genesisProjectContractNeedsAttention,vi as genesisProjectFileDiagnostic,bi as genesisProjectFileUnreadable,
|
|
925
939
|
pa as genesisPromptRequest,la as genesisPromptTask,fu as initializeGenesisProject,vu as inspectGenesisAgentIntegrations,
|
|
926
940
|
xu as inspectGenesisCollaboration,fa as inspectGenesisDerivedArtifacts,Lu as inspectGenesisEngineering,Cu as inspectGenesisEnvironment,
|
|
927
|
-
Du as inspectGenesisProject,
|
|
928
|
-
|
|
929
|
-
|
|
941
|
+
Du as inspectGenesisProject,ya as inspectGenesisProjectFormat,gu as inspectGenesisSkills,ku as inspectGenesisStackComponents,
|
|
942
|
+
yu as inspectGenesisSubsystems,Su as inspectVibe64ArchitectureInspection,wu as inspectVibe64ArchitectureLayout,Bu as inspectVibe64ConnectedDevelopment,
|
|
943
|
+
Ou as inspectVibe64Deployment,Uu as inspectVibe64IntegrationSetup,Gu as inspectVibe64Outputs,Au as inspectVibe64Packaging,
|
|
930
944
|
Wu as inspectVibe64ProjectServices,Hu as inspectVibe64ResourceEstimates,Ru as inspectVibe64StagingData,zu as inspectVibe64WorkspaceSetup,
|
|
931
945
|
Vu as listGenesisPasses,hu as listGenesisStackPieces,Pu as listGenesisTemplates,nu as mergeArchitectureObservations,er as parseVibe64DeploymentLines,
|
|
932
946
|
Rs as parseVibe64IntegrationSetupLines,He as parseVibe64OutputsLines,Fn as parseVibe64PackagingLines,ls as parseVibe64ProjectServicesLines,
|
|
933
|
-
|
|
947
|
+
Os as parseVibe64ResourceEstimatesLines,So as parseVibe64StagingDataLines,Xe as parseVibe64WorkspaceSetupLines,di as readArchitecturePreviewLocator,
|
|
934
948
|
_u as refreshGenesisCities,Fu as renderGenesisPrompt,Dr as resolveVibe64OutputParameters,qn as resolveVibe64PackagingEnvironment,
|
|
935
949
|
ju as setGenesisCollaboration,Mu as setGenesisEngineeringProfile,eu as sourceExplanationGuidance,bu as syncGenesisAgentIntegrations,
|
|
936
950
|
Eu as syncGenesisSkills,tu as validateArchitectureFacts,iu as validateCallWeb,su as validateCityDocument,Nu as verifyGenesisProject,
|