vibe64 0.1.77 → 0.1.79
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 +1327 -1322
- package/bin/server.js +106 -104
- package/bin/upgrade-state.js +2736 -2754
- package/dist/assets/{GithubBrowserTabs-B2r19V0U.js → GithubBrowserTabs-CXjft59b.js} +1 -1
- package/dist/assets/GithubBrowserTabs-CXjft59b.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-CXjft59b.js.gz +0 -0
- package/dist/assets/{LocalDatabaseServer-Ck9nZrGW.js → LocalDatabaseServer-BFzbm_N5.js} +1 -1
- package/dist/assets/LocalDatabaseServer-BFzbm_N5.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-BFzbm_N5.js.gz +0 -0
- package/dist/assets/{Vibe64DashboardPageHeader-C4iTKeE0.js → Vibe64DashboardPageHeader-PKaMTKQo.js} +1 -1
- package/dist/assets/Vibe64DashboardPageHeader-PKaMTKQo.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-PKaMTKQo.js.gz +0 -0
- package/dist/assets/{Vibe64DatabaseWorkspace-ChA-2QPU.js → Vibe64DatabaseWorkspace-6d4O_5R5.js} +1 -1
- package/dist/assets/Vibe64DatabaseWorkspace-6d4O_5R5.js.br +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-6d4O_5R5.js.gz +0 -0
- package/dist/assets/{Vibe64FileArea-DBEJsJSq.js → Vibe64FileArea-C18bdRqO.js} +1 -1
- package/dist/assets/Vibe64FileArea-C18bdRqO.js.br +0 -0
- package/dist/assets/Vibe64FileArea-C18bdRqO.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-OgqYYbq7.js +8 -0
- package/dist/assets/Vibe64OutputControls-OgqYYbq7.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-OgqYYbq7.js.gz +0 -0
- package/dist/assets/{Vibe64OutputControls-aQCEvUL2.css → Vibe64OutputControls-gSUdkqME.css} +1 -1
- package/dist/assets/Vibe64OutputControls-gSUdkqME.css.br +0 -0
- package/dist/assets/Vibe64OutputControls-gSUdkqME.css.gz +0 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-sT07hHPs.js → Vibe64RepositoryWorkspace-Cpb9aDYs.js} +1 -1
- package/dist/assets/Vibe64RepositoryWorkspace-Cpb9aDYs.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-Cpb9aDYs.js.gz +0 -0
- package/dist/assets/{Vibe64SessionFiles-Djef01EV.js → Vibe64SessionFiles-DJadIknz.js} +1 -1
- package/dist/assets/Vibe64SessionFiles-DJadIknz.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-DJadIknz.js.gz +0 -0
- package/dist/assets/{Vibe64SessionSourceEditor-CIGBLYYN.js → Vibe64SessionSourceEditor-C8XuUkUH.js} +1 -1
- package/dist/assets/Vibe64SessionSourceEditor-C8XuUkUH.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-C8XuUkUH.js.gz +0 -0
- package/dist/assets/{Vibe64UiStoryboardView-CjkWoB8b.js → Vibe64UiStoryboardView-KzCGAvty.js} +1 -1
- package/dist/assets/Vibe64UiStoryboardView-KzCGAvty.js.br +0 -0
- package/dist/assets/Vibe64UiStoryboardView-KzCGAvty.js.gz +0 -0
- package/dist/assets/{_pageId_-BTjeqgTN.js → _pageId_-Dz7wuvcV.js} +1 -1
- package/dist/assets/{_sessionId_-C7Jh2bL4.js → _sessionId_-UOSJikRr.js} +1 -1
- package/dist/assets/_sessionId_-UOSJikRr.js.br +0 -0
- package/dist/assets/_sessionId_-UOSJikRr.js.gz +0 -0
- package/dist/assets/{_sessionTool_-DITdXCS4.js → _sessionTool_-SN6SNAQM.js} +1 -1
- package/dist/assets/{access-DIaPNdxr.js → access-Ba7aprTh.js} +1 -1
- package/dist/assets/access-Ba7aprTh.js.br +0 -0
- package/dist/assets/access-Ba7aprTh.js.gz +0 -0
- package/dist/assets/{app-mELSmS67.js → app-nvpa3ah6.js} +1 -1
- package/dist/assets/app-nvpa3ah6.js.br +0 -0
- package/dist/assets/app-nvpa3ah6.js.gz +0 -0
- package/dist/assets/{changes-DlxKdjdP.js → changes-WQZLBU3x.js} +1 -1
- package/dist/assets/{client-CLpGzGwX.js → client-B5r45NvF.js} +2 -2
- package/dist/assets/client-B5r45NvF.js.br +0 -0
- package/dist/assets/client-B5r45NvF.js.gz +0 -0
- package/dist/assets/{client-CL02nP02.js → client-EaJLXb4V.js} +2 -2
- package/dist/assets/client-EaJLXb4V.js.br +0 -0
- package/dist/assets/client-EaJLXb4V.js.gz +0 -0
- package/dist/assets/{dashboard-km-kuDid.js → dashboard-S0qg7Ai6.js} +1 -1
- package/dist/assets/{english-definitions-CMICWgdF.js → english-definitions-B9nc8s8Y.js} +1 -1
- package/dist/assets/english-definitions-B9nc8s8Y.js.br +0 -0
- package/dist/assets/english-definitions-B9nc8s8Y.js.gz +0 -0
- package/dist/assets/{env-DjkxkxdX.js → env-Dqyw_NCv.js} +1 -1
- package/dist/assets/env-Dqyw_NCv.js.br +0 -0
- package/dist/assets/env-Dqyw_NCv.js.gz +0 -0
- package/dist/assets/{error-C7q1-2bC.js → error-DkUVRs7I.js} +1 -1
- package/dist/assets/error-DkUVRs7I.js.br +0 -0
- package/dist/assets/error-DkUVRs7I.js.gz +0 -0
- package/dist/assets/{fileTypes-Dbn0qwKS.js → fileTypes-Dp5WZ-_A.js} +1 -1
- package/dist/assets/fileTypes-Dp5WZ-_A.js.br +0 -0
- package/dist/assets/fileTypes-Dp5WZ-_A.js.gz +0 -0
- package/dist/assets/{health-BwJ6Z251.js → health-BkO5CcRR.js} +1 -1
- package/dist/assets/health-BkO5CcRR.js.br +0 -0
- package/dist/assets/health-BkO5CcRR.js.gz +0 -0
- package/dist/assets/{history-D2TywQVv.js → history-DanS1uI3.js} +1 -1
- package/dist/assets/history-DanS1uI3.js.br +0 -0
- package/dist/assets/history-DanS1uI3.js.gz +0 -0
- package/dist/assets/{index-D14nUmm7.js → index-CeCIadYg.js} +4 -4
- package/dist/assets/index-CeCIadYg.js.br +0 -0
- package/dist/assets/index-CeCIadYg.js.gz +0 -0
- package/dist/assets/{integrations-BZFXW2Cp.js → integrations-Dh4ViP8t.js} +96 -10
- package/dist/assets/integrations-Dh4ViP8t.js.br +0 -0
- package/dist/assets/integrations-Dh4ViP8t.js.gz +0 -0
- package/dist/assets/{issues-CLvbBTek.js → issues-D3ZjHBeZ.js} +1 -1
- package/dist/assets/issues-D3ZjHBeZ.js.br +0 -0
- package/dist/assets/issues-D3ZjHBeZ.js.gz +0 -0
- package/dist/assets/{learning-DwytxEXC.js → learning-C_3lMmYJ.js} +1 -1
- package/dist/assets/{packages-BeiF8W7l.js → packages-CPSq4jBh.js} +1 -1
- package/dist/assets/packages-CPSq4jBh.js.br +0 -0
- package/dist/assets/packages-CPSq4jBh.js.gz +0 -0
- package/dist/assets/{pages-BIRQk4b8.js → pages-C-c5itHs.js} +1 -1
- package/dist/assets/{pages-BnAyUdL4.js → pages-D91yb6IJ.js} +1 -1
- package/dist/assets/pages-D91yb6IJ.js.br +0 -0
- package/dist/assets/pages-D91yb6IJ.js.gz +0 -0
- package/dist/assets/{project-GnljGud1.js → project-DTIrUrUg.js} +11 -11
- package/dist/assets/project-DTIrUrUg.js.br +0 -0
- package/dist/assets/project-DTIrUrUg.js.gz +0 -0
- package/dist/assets/{project-files-e4-Q65vT.js → project-files-Djr-58SN.js} +1 -1
- package/dist/assets/project-files-Djr-58SN.js.br +0 -0
- package/dist/assets/project-files-Djr-58SN.js.gz +0 -0
- package/dist/assets/{project-W_VltXAt.css → project-fwVeri07.css} +1 -1
- package/dist/assets/project-fwVeri07.css.br +0 -0
- package/dist/assets/project-fwVeri07.css.gz +0 -0
- package/dist/assets/{project-shared-ShellOutlet-DKYDipmC.js → project-shared-ShellOutlet-Pj_fRyAX.js} +1 -1
- package/dist/assets/project-shared-ShellOutlet-Pj_fRyAX.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-Pj_fRyAX.js.gz +0 -0
- package/dist/assets/{project-shared-VBottomSheet-BSE28ENQ.js → project-shared-VBottomSheet-BSLhkh3o.js} +1 -1
- package/dist/assets/project-shared-VBottomSheet-BSLhkh3o.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-BSLhkh3o.js.gz +0 -0
- package/dist/assets/{project-shared-VToolbar-CrezJP9z.js → project-shared-VToolbar-BYx2aRBU.js} +1 -1
- package/dist/assets/project-shared-VToolbar-BYx2aRBU.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-BYx2aRBU.js.gz +0 -0
- package/dist/assets/{project-shared-pageNames-6Jz0BfbS.js → project-shared-pageNames-D7IBGzQh.js} +1 -1
- package/dist/assets/project-shared-pageNames-D7IBGzQh.js.br +0 -0
- package/dist/assets/project-shared-pageNames-D7IBGzQh.js.gz +0 -0
- package/dist/assets/{pull-requests-DH9gWw10.js → pull-requests-DWmXOwB8.js} +1 -1
- package/dist/assets/pull-requests-DWmXOwB8.js.br +0 -0
- package/dist/assets/pull-requests-DWmXOwB8.js.gz +0 -0
- package/dist/assets/{repository-BNltUuvb.js → repository-CNSRmrFd.js} +1 -1
- package/dist/assets/{session-Ck9aH4Yl.js → session-BITnnyzW.js} +1 -1
- package/dist/assets/session-BITnnyzW.js.br +0 -0
- package/dist/assets/session-BITnnyzW.js.gz +0 -0
- package/dist/assets/{settings-D8Ofbk56.js → settings-CkoP7vBl.js} +1 -1
- package/dist/assets/settings-CkoP7vBl.js.br +0 -0
- package/dist/assets/settings-CkoP7vBl.js.gz +0 -0
- package/dist/assets/{useArchivedVibe64Sessions-LIZjeLbd.js → useArchivedVibe64Sessions-CDKBzS4q.js} +1 -1
- package/dist/assets/useArchivedVibe64Sessions-CDKBzS4q.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-CDKBzS4q.js.gz +0 -0
- package/dist/assets/{vibe64AttachmentDownload-1_XfvfYp.js → vibe64AttachmentDownload-BPNgZodV.js} +1 -1
- package/dist/assets/{vibe64SavedEnvValues-Bs7r4xWE.js → vibe64SavedEnvValues-BDBfgAh7.js} +1 -1
- package/dist/assets/{vue-flow-core-iwGljzru.js → vue-flow-core-S4cIQeQZ.js} +1 -1
- package/dist/assets/vue-flow-core-S4cIQeQZ.js.br +0 -0
- package/dist/assets/vue-flow-core-S4cIQeQZ.js.gz +0 -0
- package/dist/index.html +2 -2
- package/docs/colleague-usage/auto-workflow.md +3 -2
- package/docs/colleague-usage/development-env.md +2 -2
- package/docs/colleague-usage/plans.md +35 -13
- package/docs/colleague-usage/preview-starting-application.md +6 -0
- package/docs/colleague-usage/preview-stop-and-restart.md +51 -0
- package/docs/colleague-usage/preview.md +10 -37
- package/docs/colleague-usage/project-language-tools.md +8 -2
- package/docs/colleague-usage/staging-data-section.md +242 -0
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +2 -0
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +5 -0
- package/node_modules/@jskit-ai/payments-core/README.md +72 -8
- package/node_modules/@jskit-ai/payments-core/contracts/configuration.schema.json +56 -1
- package/node_modules/@jskit-ai/payments-core/contracts/conformance.json +484 -0
- package/node_modules/@jskit-ai/payments-core/locales/en.json +17 -5
- package/node_modules/@jskit-ai/payments-core/package.json +2 -1
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +545 -542
- package/node_modules/@local/vibe64-execution/src/server/gitTurnCheckpointCommand.js +135 -127
- package/node_modules/@local/vibe64-execution/src/server/hostProfile.js +18 -11
- package/node_modules/@local/vibe64-genesis/README.md +25 -0
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +39 -39
- package/node_modules/@local/vibe64-genesis/package.json +2 -1
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +261 -140
- package/node_modules/@local/vibe64-genesis/src/server/index.js +619 -520
- package/node_modules/@local/vibe64-genesis/src/server/packaging.js +49 -48
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +82 -82
- package/node_modules/@local/vibe64-source-editor/src/server/searchIndexWorker.js +36 -36
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +580 -570
- package/package.json +7 -7
- package/server.bundle.mjs +32680 -32667
- package/dist/assets/GithubBrowserTabs-B2r19V0U.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-B2r19V0U.js.gz +0 -0
- package/dist/assets/LocalDatabaseServer-Ck9nZrGW.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-Ck9nZrGW.js.gz +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-C4iTKeE0.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-C4iTKeE0.js.gz +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-ChA-2QPU.js.br +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-ChA-2QPU.js.gz +0 -0
- package/dist/assets/Vibe64FileArea-DBEJsJSq.js.br +0 -0
- package/dist/assets/Vibe64FileArea-DBEJsJSq.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-DpFdKIO2.js +0 -8
- package/dist/assets/Vibe64OutputControls-DpFdKIO2.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-DpFdKIO2.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-aQCEvUL2.css.br +0 -0
- package/dist/assets/Vibe64OutputControls-aQCEvUL2.css.gz +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-sT07hHPs.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-sT07hHPs.js.gz +0 -0
- package/dist/assets/Vibe64SessionFiles-Djef01EV.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-Djef01EV.js.gz +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-CIGBLYYN.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-CIGBLYYN.js.gz +0 -0
- package/dist/assets/Vibe64UiStoryboardView-CjkWoB8b.js.br +0 -0
- package/dist/assets/Vibe64UiStoryboardView-CjkWoB8b.js.gz +0 -0
- package/dist/assets/_sessionId_-C7Jh2bL4.js.br +0 -0
- package/dist/assets/_sessionId_-C7Jh2bL4.js.gz +0 -0
- package/dist/assets/access-DIaPNdxr.js.br +0 -0
- package/dist/assets/access-DIaPNdxr.js.gz +0 -0
- package/dist/assets/app-mELSmS67.js.br +0 -0
- package/dist/assets/app-mELSmS67.js.gz +0 -0
- package/dist/assets/client-CL02nP02.js.br +0 -0
- package/dist/assets/client-CL02nP02.js.gz +0 -0
- package/dist/assets/client-CLpGzGwX.js.br +0 -0
- package/dist/assets/client-CLpGzGwX.js.gz +0 -0
- package/dist/assets/english-definitions-CMICWgdF.js.br +0 -0
- package/dist/assets/english-definitions-CMICWgdF.js.gz +0 -0
- package/dist/assets/env-DjkxkxdX.js.br +0 -0
- package/dist/assets/env-DjkxkxdX.js.gz +0 -0
- package/dist/assets/error-C7q1-2bC.js.br +0 -0
- package/dist/assets/error-C7q1-2bC.js.gz +0 -0
- package/dist/assets/fileTypes-Dbn0qwKS.js.br +0 -0
- package/dist/assets/fileTypes-Dbn0qwKS.js.gz +0 -0
- package/dist/assets/health-BwJ6Z251.js.br +0 -0
- package/dist/assets/health-BwJ6Z251.js.gz +0 -0
- package/dist/assets/history-D2TywQVv.js.br +0 -0
- package/dist/assets/history-D2TywQVv.js.gz +0 -0
- package/dist/assets/index-D14nUmm7.js.br +0 -0
- package/dist/assets/index-D14nUmm7.js.gz +0 -0
- package/dist/assets/integrations-BZFXW2Cp.js.br +0 -0
- package/dist/assets/integrations-BZFXW2Cp.js.gz +0 -0
- package/dist/assets/issues-CLvbBTek.js.br +0 -0
- package/dist/assets/issues-CLvbBTek.js.gz +0 -0
- package/dist/assets/packages-BeiF8W7l.js.br +0 -0
- package/dist/assets/packages-BeiF8W7l.js.gz +0 -0
- package/dist/assets/pages-BnAyUdL4.js.br +0 -3
- package/dist/assets/pages-BnAyUdL4.js.gz +0 -0
- package/dist/assets/project-GnljGud1.js.br +0 -0
- package/dist/assets/project-GnljGud1.js.gz +0 -0
- package/dist/assets/project-W_VltXAt.css.br +0 -0
- package/dist/assets/project-W_VltXAt.css.gz +0 -0
- package/dist/assets/project-files-e4-Q65vT.js.br +0 -0
- package/dist/assets/project-files-e4-Q65vT.js.gz +0 -0
- package/dist/assets/project-shared-ShellOutlet-DKYDipmC.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-DKYDipmC.js.gz +0 -0
- package/dist/assets/project-shared-VBottomSheet-BSE28ENQ.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-BSE28ENQ.js.gz +0 -0
- package/dist/assets/project-shared-VToolbar-CrezJP9z.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-CrezJP9z.js.gz +0 -0
- package/dist/assets/project-shared-pageNames-6Jz0BfbS.js.br +0 -0
- package/dist/assets/project-shared-pageNames-6Jz0BfbS.js.gz +0 -0
- package/dist/assets/pull-requests-DH9gWw10.js.br +0 -0
- package/dist/assets/pull-requests-DH9gWw10.js.gz +0 -0
- package/dist/assets/session-Ck9aH4Yl.js.br +0 -0
- package/dist/assets/session-Ck9aH4Yl.js.gz +0 -0
- package/dist/assets/settings-D8Ofbk56.js.br +0 -0
- package/dist/assets/settings-D8Ofbk56.js.gz +0 -0
- package/dist/assets/useArchivedVibe64Sessions-LIZjeLbd.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-LIZjeLbd.js.gz +0 -0
- package/dist/assets/vue-flow-core-iwGljzru.js.br +0 -0
- package/dist/assets/vue-flow-core-iwGljzru.js.gz +0 -0
|
@@ -1,113 +1,114 @@
|
|
|
1
1
|
import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
|
|
2
|
-
import{createHash as
|
|
3
|
-
super(n),this.name="Vibe64StackOperationError",this.code=t,s!==void 0&&(this.details=s)}},
|
|
2
|
+
import{createHash as Gs}from"node:crypto";import Je from"node:path";var Se=class extends Error{constructor(t,n,s=void 0){
|
|
3
|
+
super(n),this.name="Vibe64StackOperationError",this.code=t,s!==void 0&&(this.details=s)}},jt=Object.freeze({VIBE64_WORKSPACE_SETUP_INVALID:"\
|
|
4
4
|
workspace-setup",VIBE64_OUTPUTS_INVALID:"outputs",VIBE64_DEPLOYMENT_INVALID:"deployment",VIBE64_PACKAGING_INVALID:"packa\
|
|
5
5
|
ging",VIBE64_RESOURCE_ESTIMATES_INVALID:"resource-estimates",VIBE64_CONNECTED_DEVELOPMENT_INVALID:"connected-development",
|
|
6
6
|
VIBE64_PROJECT_SERVICES_INVALID:"project-services",VIBE64_INTEGRATION_SETUP_INVALID:"integration-setup",VIBE64_ARCHITECTURE_INSPECTION_INVALID:"\
|
|
7
|
-
architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"
|
|
8
|
-
function
|
|
9
|
-
return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}
|
|
10
|
-
void 0?{}:{line:s},...i})}function
|
|
11
|
-
must be one non-empty line.`,i),e.trim()}function
|
|
12
|
-
0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function
|
|
13
|
-
a.length>c||o!==void 0&&a.length!==o||a.some(u=>u.length>4096||/[\0\r\n]/u.test(
|
|
14
|
-
|
|
15
|
-
"string"&&!!e&&!/[\s\0{}]/u.test(e)&&!
|
|
16
|
-
e,t,n,s,i);return
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
"***")||/[?[\]{}!]/u.test(o)||o.split("/").some(c=>!c||[".",".."].includes(
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
lowercase technology ids separated into backticked values.`,i),new Set(r).size!==r.length&&
|
|
24
|
-
|
|
25
|
-
test(r))&&m(t,n,`${s} must begin with one slash and contain no query or fragment.`,i),r}function
|
|
26
|
-
/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);r||m(t,n,`${s} must use \`- Ready when: \`GET\`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
let c=String(e||"").match(
|
|
31
|
-
match(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,
|
|
35
|
-
2)}
|
|
36
|
-
`;return`sha256:${
|
|
37
|
-
throw new
|
|
38
|
-
return
|
|
39
|
-
|
|
7
|
+
architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout",VIBE64_STAGING_DATA_INVALID:"staging-d\
|
|
8
|
+
ata"}),Us=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;function Bs(e,t){let n=jt[e],s=String(t).replace(Us,"");return n?
|
|
9
|
+
`${s} Exact grammar: vibe64-helper spec ${n}.`:s}function v(e,t,n){return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}\
|
|
10
|
+
.`}function m(e,t,n,s,i={}){throw new Se(e,Bs(e,n),{path:t,...s===void 0?{}:{line:s},...i})}function w(e,t,n,s,i){return(typeof e!=
|
|
11
|
+
"string"||!e.trim()||/[\0\r\n]/u.test(e))&&m(t,n,`${s} must be one non-empty line.`,i),e.trim()}function Ws(e){let t=[...String(
|
|
12
|
+
e||"").matchAll(/`([^`\r\n]+)`/gu)];return t.length===0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function y(e,t,n,s,i,r={}){
|
|
13
|
+
let{count:o,maximum:c=64}=r,a=Ws(e);if(!a||a.length>c||o!==void 0&&a.length!==o||a.some(u=>u.length>4096||/[\0\r\n]/u.test(
|
|
14
|
+
u))){let u=o===void 0?"separate non-empty":`exactly ${o}`;m(t,n,`${s} must contain ${u} backticked ${o===1?"value":"valu\
|
|
15
|
+
es"}.`,i)}return a}function zs(e=""){return typeof e=="string"&&!!e&&!/[\s\0{}]/u.test(e)&&!Je.isAbsolute(e)&&!e.split(/[\\/]/u).
|
|
16
|
+
includes("..")}function N(e,t,n,s,i){let r=y(e,t,n,s,i);return zs(r[0])||m(t,n,`${s} must begin with a safe executable.`,
|
|
17
|
+
i),r}function Hs(e=""){return typeof e=="string"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!Je.posix.isAbsolute(e)&&Je.posix.normalize(
|
|
18
|
+
e)===e&&!e.split("/").some(t=>!t||t==="..")}function S(e,t,n,s,i,r={}){let{allowRoot:o=!0}=r;return(!Hs(e)||!o&&e===".")&&
|
|
19
|
+
m(t,n,`${s} must be a canonical project-relative path.`,i),e}function we(e,t,n,s,i){let r=y(e,t,n,s,i);return r.some(o=>o.
|
|
20
|
+
startsWith("/")||o.includes("\\")||o.includes("***")||/[?[\]{}!]/u.test(o)||o.split("/").some(c=>!c||[".",".."].includes(
|
|
21
|
+
c)))&&m(t,n,`${s} must be canonical project-relative globs using only * and ** wildcards.`,i),new Set(r).size!==r.length&&
|
|
22
|
+
m(t,n,`${s} must name each path once.`,i),r}function C(e,t,n,s,i){let r=y(e,t,n,s,i);return r.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.
|
|
23
|
+
test(o))&&m(t,n,`${s} must use lowercase technology ids separated into backticked values.`,i),new Set(r).size!==r.length&&
|
|
24
|
+
m(t,n,`${s} contains a duplicate technology id.`,i),r}function et(e,t,n,s,i){let r=w(e,t,n,s,i);return(!r.startsWith("/")||
|
|
25
|
+
r.startsWith("//")||/[\\?#]/u.test(r))&&m(t,n,`${s} must begin with one slash and contain no query or fragment.`,i),r}function ce(e,t,n,s,i){
|
|
26
|
+
let r=e.match(/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);r||m(t,n,`${s} must use \`- Ready when: \`GET\` \
|
|
27
|
+
\`/path\` returns \`200\`\`.`,i);let o=Number(r[2]);return(!Number.isInteger(o)||o<200||o>399)&&m(t,n,`${s} status must \
|
|
28
|
+
be from 200 through 399.`,i),{kind:"http",method:"GET",path:et(r[1],t,n,`${s} path`,i),status:o}}var Fs=/^with (.+?):[ \t]+(.+)$/u,
|
|
29
|
+
qs=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,Ks=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Ys=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
|
|
30
|
+
function _e(e,t,n,s,i,{form:r,observed:o=e}){let c=String(e||"").match(Fs);c||m(t,n,`Every ${s} entry must use: ${r}`,i,
|
|
31
|
+
{observed:o});let a=c[1].match(qs),u=a?null:c[1].match(Ks),l=a?a[1]:u?u[1]:c[1],d=a?.[2]||u?.[2]||"",p=l.match(Ys);return{
|
|
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),...d?{condition:{pathExists:S(d,t,n,`${s} condition path`,i,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function Qe(e){
|
|
34
|
+
return Array.isArray(e)?e.map(Qe):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,Qe(e[t])])):e}
|
|
35
|
+
function k(e){let t=`${JSON.stringify(Qe(e),null,2)}
|
|
36
|
+
`;return`sha256:${Gs("sha256").update(t).digest("hex")}`}function j(e={},t={},n="operation"){if(e.stackHash!==t.stackHash)
|
|
37
|
+
throw new Se("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${n}. Retry the operation.`)}var Ie=/^[A-Za-z][A-Za-z0-9_-]{0,39}$/u;
|
|
38
|
+
function Te(e){return new Map((Array.isArray(e)?e:[]).map(t=>t?.resource).filter(t=>t&&typeof t.id=="string").map(t=>[t.
|
|
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
|
+
length===1&&t[0]==="- Nothing."}var Sa=Object.freeze({SPEC_BY_ERROR_CODE:jt});var Xs="custom";var Zs=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
|
|
40
41
|
(PHP)"}),Object.freeze({value:"pip",label:"pip (Python)"}),Object.freeze({value:"bundler",label:"Bundler (Ruby)"}),Object.
|
|
41
42
|
freeze({value:"gomod",label:"Go modules"}),Object.freeze({value:"cargo",label:"Cargo (Rust)"}),Object.freeze({value:"mav\
|
|
42
43
|
en",label:"Maven"}),Object.freeze({value:"gradle",label:"Gradle"}),Object.freeze({value:"nuget",label:"NuGet (.NET)"}),Object.
|
|
43
|
-
freeze({value:
|
|
44
|
-
stack.md#Connected development",
|
|
45
|
-
Prepare \`label\` ${
|
|
46
|
-
"- Default package type: `type`","- Sources file: `path`",...Object.values(
|
|
47
|
-
|
|
48
|
-
[]],o=e.status==="ready";if(o&&!
|
|
49
|
-
1,E=
|
|
50
|
-
E[1])||m(x
|
|
51
|
-
if(
|
|
52
|
-
some(
|
|
53
|
-
$=R?null:
|
|
54
|
-
"verify":"prepare";!R&&a&&
|
|
55
|
-
fy";let
|
|
56
|
-
g,{form:
|
|
57
|
-
nnot prove source consumption.",g),R?(s&&m(x,
|
|
58
|
-
!t&&!i.length&&!s)&&(!t||!i.some(
|
|
44
|
+
freeze({value:Xs,label:"custom"})]);var Gt=Object.freeze(Zs.map(e=>e.value));function Ut(e){return typeof e=="string"&&Gt.includes(e)}function Bt(e="or"){let t=Gt;return`${t.slice(0,-1).join(", ")} ${e} ${t.at(-1)}`}var Wt="Connected development",Js="vibe64.connected-development.v1",L="VIBE64_CONNECTED_DEVELOPMENT_INVALID",x="genesis/\
|
|
45
|
+
stack.md#Connected development",tt="with `runtime` [in `workdir`]: `command` `argument`...",zt=Object.freeze({Prepare:`-\
|
|
46
|
+
Prepare \`label\` ${tt}`,Verify:`- Verify \`label\` ${tt}`,"Custom runner":`- Custom runner ${tt}`}),Qs=Object.freeze([
|
|
47
|
+
"- Default package type: `type`","- Sources file: `path`",...Object.values(zt)]),ei=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
|
|
48
|
+
ti=/^- Custom runner (.+)$/u,ni="Custom connected source";function Ht(e={}){let t="",n="",s=null,i=[],r=[...e.diagnostics||
|
|
49
|
+
[]],o=e.status==="ready";if(o&&!_(e.lines)){let a=!1;for(let[l,d]of e.lines.entries()){let p=d.trim();if(!p)continue;let g=l+
|
|
50
|
+
1,E=p.match(/^- Default package type: `([^`\r\n]*)`$/u);if(E){n&&m(L,x,"Declare exactly one default package type.",g),Ut(
|
|
51
|
+
E[1])||m(L,x,`Default package type must be ${Bt()}.`,g),n=E[1];continue}let I=p.match(/^- Sources file: `([^`\r\n]+)`$/u);
|
|
52
|
+
if(I){t&&m(L,x,"Declare exactly one Sources file.",g),t=S(I[1],L,x,"Connected sources file",g,{allowRoot:!1}),t.split("/").
|
|
53
|
+
some(js=>js.toLowerCase()===".git")&&m(L,x,"The Sources file must be outside Git metadata.",g);continue}let R=p.match(ti),
|
|
54
|
+
$=R?null:p.match(ei);!R&&!$&&m(L,x,v("Connected development entry",p,Qs),g);let X=R?"Custom runner":$[1],ae=X==="Verify"?
|
|
55
|
+
"verify":"prepare";!R&&a&&ae==="prepare"&&m(L,x,"All Prepare entries must precede Verify entries.",g),a||=!R&&ae==="veri\
|
|
56
|
+
fy";let Ze={label:R?ni:w($[2],L,x,`Connected development ${X} label`,g),..._e(R?R[1]:$[3],L,x,`Connected development ${X}`,
|
|
57
|
+
g,{form:zt[X],observed:p})};Ze.condition&&m(L,x,"Connected development steps must run unconditionally; a skipped step ca\
|
|
58
|
+
nnot prove source consumption.",g),R?(s&&m(L,x,"Declare exactly one Custom runner.",g),s=Ze):i.push({...Ze,phase:ae})}!(n&&
|
|
59
|
+
!t&&!i.length&&!s)&&(!t||!i.some(l=>l.phase==="verify")&&!s)&&m(L,x,"Declare a default package type alone, or a Sources \
|
|
59
60
|
file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let c=e.status==="blocked"||r.length?
|
|
60
|
-
"blocked":i.length||s?"ready":"unconfigured";return{contract:
|
|
61
|
-
"ready"?
|
|
62
|
-
source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:i,runtimeRequirements:
|
|
63
|
-
a=>a.runtimeRequirements)),diagnostics:r}}import{lstat as
|
|
64
|
-
enesis/stack.md#Architecture inspection",
|
|
65
|
-
dir","argv","timeout","maxBuffer"]),
|
|
66
|
-
"`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${
|
|
67
|
-
bytes":["maxBuffer",`\`1\` through \`${
|
|
68
|
-
equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),
|
|
69
|
-
`^- (${Object.keys(
|
|
70
|
-
cture inspection requires exact Stack section lines."),
|
|
71
|
-
r[c]===void 0&&m(
|
|
72
|
-
let
|
|
73
|
-
d.",c+1),i.add(
|
|
74
|
-
let g=Object.entries(
|
|
75
|
-
of: ${g}.`,c+1)}let[
|
|
76
|
-
|
|
77
|
-
requiredFiles")r[
|
|
78
|
-
rkdir")r[
|
|
79
|
-
"timeout"?
|
|
80
|
-
r[
|
|
81
|
-
e,
|
|
82
|
-
return e[t-1]==="node_modules"&&!e[t].startsWith("@")||e[t-2]==="node_modules"&&e[t-1].startsWith("@")}async function
|
|
83
|
-
|
|
84
|
-
entries())o=
|
|
85
|
-
a symlink"),o=r=await
|
|
86
|
-
o||!o.startsWith(`${r}${
|
|
87
|
-
stat();return a.isFile()||n("must be a regular file"),a.size>
|
|
61
|
+
"blocked":i.length||s?"ready":"unconfigured";return{contract:Js,declared:o,status:c,stackHash:e.stackHash,recipeHash:c===
|
|
62
|
+
"ready"?k({version:1,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:i}):"",components:[...e.components||[]],source:e.
|
|
63
|
+
source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:i,runtimeRequirements:H([...i,...s?[s]:[]].flatMap(
|
|
64
|
+
a=>a.runtimeRequirements)),diagnostics:r}}import{lstat as si,open as ii,realpath as nt,stat as ri}from"node:fs/promises";import{constants as Ft}from"node:fs";import qt from"node:path";var oi="vibe64.architecture-inspection.v1",Yt="Architecture inspection",O="VIBE64_ARCHITECTURE_INSPECTION_INVALID",ke="g\
|
|
65
|
+
enesis/stack.md#Architecture inspection",Xt=120,Zt=64*1024*1024,Kt=64*1024,ai=Object.freeze(["runtimeRequirements","work\
|
|
66
|
+
dir","argv","timeout","maxBuffer"]),st=Object.freeze({Runtime:["runtimeRequirements","`runtime`..."],Directory:["workdir",
|
|
67
|
+
"`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${Xt}\``],"Max output\
|
|
68
|
+
bytes":["maxBuffer",`\`1\` through \`${Zt}\``],"Entry files":["entryFiles","`path`... (optional)"],"Required files":["r\
|
|
69
|
+
equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),ci=new RegExp(
|
|
70
|
+
`^- (${Object.keys(st).join("|")}): (.+)$`,"u");function Jt(e,t={}){let{path:n=ke}=t;if(Array.isArray(e)||m(O,n,"Archite\
|
|
71
|
+
cture inspection requires exact Stack section lines."),_(e))return[];let s=[],i=new Set,r;function o(){if(r){for(let c of ai)
|
|
72
|
+
r[c]===void 0&&m(O,n,`${r.id} is missing ${c}.`);s.push(r),r=null}}for(let[c,a]of e.entries()){let u=a.trim();if(!u)continue;
|
|
73
|
+
let l=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(l){o(),i.has(l[1])&&m(O,n,"Duplicate inspector i\
|
|
74
|
+
d.",c+1),i.add(l[1]),r={id:l[1],title:l[2]};continue}r||m(O,n,"Expected an Inspector heading.",c+1);let d=u.match(ci);if(!d){
|
|
75
|
+
let g=Object.entries(st).map(([E,[,I]])=>`- ${E}: ${I}`).join("; ");m(O,n,`Unknown architecture inspector field. Use one\
|
|
76
|
+
of: ${g}.`,c+1)}let[p]=st[d[1]];if(r[p]!==void 0&&m(O,n,`Duplicate ${d[1]}.`,c+1),p==="runtimeRequirements")r[p]=C(d[2],
|
|
77
|
+
O,n,"Inspector runtime",c+1);else if(p==="argv")r[p]=N(d[2],O,n,"Inspector command",c+1);else if(p==="entryFiles"||p==="\
|
|
78
|
+
requiredFiles")r[p]=y(d[2],O,n,d[1],c+1).map(g=>S(g,O,n,d[1],c+1));else{let[g]=y(d[2],O,n,d[1],c+1,{count:1});if(p==="wo\
|
|
79
|
+
rkdir")r[p]=S(g,O,n,"Inspector directory",c+1);else if(p==="previewLocator")r[p]=Qt(g,n,c+1);else{let E=Number(g),I=p===
|
|
80
|
+
"timeout"?Xt:Zt;(!/^[1-9][0-9]*$/u.test(g)||!Number.isSafeInteger(E)||E>I)&&m(O,n,`${d[1]} must be from 1 to ${I}.`,c+1),
|
|
81
|
+
r[p]=p==="timeout"?E*1e3:E}}}return o(),s.length||m(O,n,"Use an Inspector entry or - Nothing."),s}function Qt(e,t,n){return S(
|
|
82
|
+
e,O,t,"Preview locator",n,{allowRoot:!1}),e.endsWith(".js")||m(O,t,"Preview locator must name a .js file.",n),e}function ui(e,t){
|
|
83
|
+
return e[t-1]==="node_modules"&&!e[t].startsWith("@")||e[t-2]==="node_modules"&&e[t-1].startsWith("@")}async function li(e,t){
|
|
84
|
+
Qt(t,ke);let n=r=>m(O,ke,`Preview locator \`${t}\` ${r}.`),s=t.split("/"),i;try{let r=await nt(e),o=r,c=!1;for(let[u,l]of s.
|
|
85
|
+
entries())o=qt.join(o,l),(await si(o)).isSymbolicLink()&&((c||u===s.length-1||!ui(s,u))&&n("must not be or pass through \
|
|
86
|
+
a symlink"),o=r=await nt(o),(await ri(r)).isDirectory()||n("links a package that is not a folder"),c=!0);(await nt(o)!==
|
|
87
|
+
o||!o.startsWith(`${r}${qt.sep}`))&&n("must not be or pass through a symlink"),i=await ii(o,Ft.O_RDONLY|Ft.O_NOFOLLOW);let a=await i.
|
|
88
|
+
stat();return a.isFile()||n("must be a regular file"),a.size>Kt&&n(`must be at most ${Kt} bytes`),{path:t,source:await i.
|
|
88
89
|
readFile("utf8")}}catch(r){throw(r?.code==="ENOENT"||r?.code==="ENOTDIR")&&n("is not a file in this project"),r?.code===
|
|
89
|
-
"ELOOP"&&n("must not be or pass through a symlink"),r}finally{await i?.close()}}function
|
|
90
|
-
|
|
91
|
-
be selected in Stack.");return{contract:
|
|
92
|
-
diagnostics||[]}}var
|
|
93
|
-
["layer","libraries","support"]);function
|
|
94
|
-
e)||m(
|
|
95
|
-
!o.purpose||!o.subsystems.length)&&m(
|
|
96
|
-
u]of e.entries()){let
|
|
97
|
-
i.has(d[1])&&m(
|
|
98
|
-
(!o||!
|
|
99
|
-
if(
|
|
100
|
-
ce.",a+1),r.add(E),o.subsystems.push({root:E})}else{let E=
|
|
101
|
-
1),E==="kind"&&!
|
|
102
|
-
s.length||m(
|
|
103
|
-
groups:e.status==="ready"?
|
|
104
|
-
import W from"node:path";var
|
|
105
|
-
includes(String(e?.code||"").trim())}var
|
|
106
|
-
return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!
|
|
107
|
-
let{path:t="",line:n,observed:s}=e.details||{},i=Number.isSafeInteger(n)?` (line ${n}${t===
|
|
108
|
-
r=t&&(i||!e.message.includes(t))?`${t}${i}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${r}${e.message}${o}`}import*as
|
|
109
|
-
import
|
|
110
|
-
"managedPreview"]),
|
|
90
|
+
"ELOOP"&&n("must not be or pass through a symlink"),r}finally{await i?.close()}}function en(e){let t=e.status==="ready"?
|
|
91
|
+
Jt(e.lines):[];for(let n of t)n.runtimeRequirements.some(s=>!e.components.includes(s))&&m(O,ke,"Inspector runtimes must \
|
|
92
|
+
be selected in Stack.");return{contract:oi,status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:k(t),diagnostics:e.
|
|
93
|
+
diagnostics||[]}}var Ca=Object.freeze({parseVibe64ArchitectureInspectionLines:Jt});var pi="vibe64.architecture-layout.v1",tn="Architecture layout",B="VIBE64_ARCHITECTURE_LAYOUT_INVALID",it=Object.freeze(
|
|
94
|
+
["layer","libraries","support"]);function nn(e,t={}){let{path:n="genesis/stack.md#Architecture layout"}=t;if(Array.isArray(
|
|
95
|
+
e)||m(B,n,"Expected exact Stack section lines."),_(e))return[];let s=[],i=new Set,r=new Set,o;function c(){o&&((!o.kind||
|
|
96
|
+
!o.purpose||!o.subsystems.length)&&m(B,n,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[a,
|
|
97
|
+
u]of e.entries()){let l=u.trim();if(!l)continue;let d=l.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(d){c(),
|
|
98
|
+
i.has(d[1])&&m(B,n,"Duplicate group id.",a+1),i.add(d[1]),o={id:d[1],title:d[2],subsystems:[]};continue}let p=l.match(/^- (Kind|Purpose|Subsystem): (.+)$/u);
|
|
99
|
+
(!o||!p)&&m(B,n,"Expected a Group heading or Kind, Purpose, Subsystem field.",a+1);let g=y(p[2],B,n,p[1],a+1,{count:1});
|
|
100
|
+
if(p[1]==="Subsystem"){let E=S(g[0],B,n,"Subsystem root",a+1);r.has(E)&&m(B,n,"Each directory root may be placed only on\
|
|
101
|
+
ce.",a+1),r.add(E),o.subsystems.push({root:E})}else{let E=p[1].toLowerCase();o[E]!==void 0&&m(B,n,`Duplicate ${p[1]}.`,a+
|
|
102
|
+
1),E==="kind"&&!it.includes(g[0])&&m(B,n,`Kind must be ${it.slice(0,-1).join(", ")} or ${it.at(-1)}.`,a+1),o[E]=g[0]}}return c(),
|
|
103
|
+
s.length||m(B,n,"Use a Group entry or - Nothing."),s}function sn(e){return{contract:pi,status:e.status,stackHash:e.stackHash,
|
|
104
|
+
groups:e.status==="ready"?nn(e.lines):[],diagnostics:e.diagnostics||[]}}var $a=Object.freeze({parseVibe64ArchitectureLayoutLines:nn});import{existsSync as Ns}from"node:fs";import{readFile as Co}from"node:fs/promises";import{createRequire as Do}from"node:module";
|
|
105
|
+
import W from"node:path";var di="STACK_PROJECT_CONTRACTS_INCOMPLETE",rn="STACK_SECTION_AMBIGUOUS",mi=Object.freeze([di,rn]);function hi(e){return mi.
|
|
106
|
+
includes(String(e?.code||"").trim())}var rt="genesis/stack.md",fi=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function gi(e){
|
|
107
|
+
return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!fi.some(t=>String(e.code).startsWith(t))}function Ei(e){
|
|
108
|
+
let{path:t="",line:n,observed:s}=e.details||{},i=Number.isSafeInteger(n)?` (line ${n}${t===rt?" of its section":""})`:"",
|
|
109
|
+
r=t&&(i||!e.message.includes(t))?`${t}${i}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${r}${e.message}${o}`}import*as ve from"genesis-compiler";import{randomUUID as Oi}from"node:crypto";import{mkdir as Ai,mkdtemp as Ri,readFile as Ni,rename as Ci,rm as ln,writeFile as Di}from"node:fs/promises";
|
|
110
|
+
import Pi from"node:os";import at from"node:path";function V(e){return String(e||"").trim()}var bi=Object.freeze(["main","temporary"]),on=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
|
|
111
|
+
"managedPreview"]),an=Object.freeze(["managedPages"]),yi=64*1024,vi=Object.freeze(["When user input is necessary, ask no\
|
|
111
112
|
more than three concise, high-impact questions at once.","Put multiple questions on separate lines as `[1] Question`, `\
|
|
112
113
|
[2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answers:` and a short bullet list dir\
|
|
113
114
|
ectly beneath its own question, before the next one; never collect several questions' answers into one trailing list.","\
|
|
@@ -120,7 +121,7 @@ Possible answers:
|
|
|
120
121
|
[2] Tell the main agent before changes?
|
|
121
122
|
Possible answers:
|
|
122
123
|
- Yes, tell main first
|
|
123
|
-
- No, proceed independently`]),
|
|
124
|
+
- No, proceed independently`]),Si=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
|
|
124
125
|
start a duplicate or replacement server. If it is unavailable, report that blocker. Describe only rendered browser evide\
|
|
125
126
|
nce.","When adopting an authenticated app, or when its login blocks Preview inspection, inspect identity support/names w\
|
|
126
127
|
ith `vibe64-helper preview status`; prefer `vibe64-helper preview browser identity <configured-name>` to requesting pass\
|
|
@@ -181,7 +182,7 @@ d>`, which waits for cleanup/restoration; retry if cleanup needs attention. Neve
|
|
|
181
182
|
nd reports kernel task denials or a resource incident, report the blocker with its diagnostic and incident ID and ask th\
|
|
182
183
|
e platform operator to inspect that evidence before retrying; never raise test timeouts or weaken assertions to work aro\
|
|
183
184
|
und a process/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),
|
|
184
|
-
|
|
185
|
+
wi=Object.freeze(['Pages: `vibe64-helper pages publish <file.html|folder> [--title "Title"]` publishes an HTML page (one\
|
|
185
186
|
file, or a folder with index.html and its own scripts, styles, data and images) that everyone with access to this proje\
|
|
186
187
|
ct can open from Vibe64\'s Pages list; `vibe64-helper pages update <page-id> <file.html|folder>` gives a page a new versi\
|
|
187
188
|
on under the same link (it keeps ten; `vibe64-helper pages revert <page-id> <version>` brings one back); `vibe64-helper \
|
|
@@ -202,7 +203,7 @@ ipt can gather the data; use --prompt only when gathering it needs judgement.","
|
|
|
202
203
|
er pages list`: when a page about the same subject already exists, update it instead of making a new one.","Do not offer\
|
|
203
204
|
pages for quick answers, code changes, or documents that belong in the repository. Offer at most once per topic; do not\
|
|
204
205
|
nag.","Everyone with access to the project can open a page: never put secrets in one, or anything not every project mem\
|
|
205
|
-
ber should see."]),
|
|
206
|
+
ber should see."]),_i=Object.freeze(["Each managed shell command receives current development Env from Vibe64, including\
|
|
206
207
|
declared resource bindings; use them in ordinary commands. Do not build environment injection or copy managed credentia\
|
|
207
208
|
ls into source. Resource provisioning and application migrations remain separate preparation steps.","Use `vibe64-helper\
|
|
208
209
|
env status [development|staging|all]` to inspect configured key names without revealing values.","Pipe an available val\
|
|
@@ -217,20 +218,20 @@ ut explicit direction, or edit Vibe64 runtime/session storage.","After an Env mu
|
|
|
217
218
|
nd key names, never their values, and claim success only when the command succeeded.","Store a secret the application ne\
|
|
218
219
|
eds generated (such as an application key) by generating it with the framework's own generator and piping it to `vibe64-\
|
|
219
220
|
helper env set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that file from E\
|
|
220
|
-
nv."]);function
|
|
221
|
-
function
|
|
222
|
-
ns unsupported fields: ${i.join(", ")}.`)}function
|
|
221
|
+
nv."]);function cn(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${t} must be an object.`);return e}
|
|
222
|
+
function ot(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\
|
|
223
|
+
ns unsupported fields: ${i.join(", ")}.`)}function un(e){if(ot(e,["conversationKind","scope","session","hostGuidance"],"\
|
|
223
224
|
Vibe64 session context"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"ut\
|
|
224
|
-
f8")>1024))throw new TypeError("Vibe64 host guidance must be bounded text supplied by the host.");if(!
|
|
225
|
-
throw new TypeError("Vibe64 session context has an unknown conversationKind.");let t=
|
|
226
|
-
lities");
|
|
227
|
-
throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);return[s,t[s]]}));for(let s of
|
|
225
|
+
f8")>1024))throw new TypeError("Vibe64 host guidance must be bounded text supplied by the host.");if(!bi.includes(e.conversationKind))
|
|
226
|
+
throw new TypeError("Vibe64 session context has an unknown conversationKind.");let t=cn(e.session,"Vibe64 session capabi\
|
|
227
|
+
lities");ot(t,[...on,...an],"Vibe64 session capabilities");let n=Object.fromEntries(on.map(s=>{if(typeof t[s]!="boolean")
|
|
228
|
+
throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);return[s,t[s]]}));for(let s of an){if(t[s]!==void 0&&
|
|
228
229
|
typeof t[s]!="boolean")throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);t[s]===!0&&(n[s]=!0)}return{
|
|
229
|
-
conversationKind:e.conversationKind,scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:n}}function
|
|
230
|
-
|
|
231
|
-
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:t}}function
|
|
232
|
-
scope==="session")return
|
|
233
|
-
sion and ephemeral scopes only.")}function
|
|
230
|
+
conversationKind:e.conversationKind,scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:n}}function Ii(e){
|
|
231
|
+
ot(e,["scope","stableContext"],"Vibe64 ephemeral context");let t=String(e.stableContext||"").trim();if(!t||t.length>yi)throw new TypeError(
|
|
232
|
+
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:t}}function Ti(e){if(e.
|
|
233
|
+
scope==="session")return un(e);if(e.scope==="ephemeral")return Ii(e);throw new TypeError("The Vibe64 driver supports ses\
|
|
234
|
+
sion and ephemeral scopes only.")}function ki(e){let{conversationKind:t,session:n,hostGuidance:s=""}=un(e);return["VIBE6\
|
|
234
235
|
4 CONVERSATION CONTEXT","",...t==="main"?["This is the main Vibe64 conversation for the selected session worktree."]:["T\
|
|
235
236
|
his is a user-visible temporary conversation in the selected session worktree, with the same tools and project access as\
|
|
236
237
|
main chat.","Its messages stay out of main History. Closing this conversation preserves project edits and removes only \
|
|
@@ -293,12 +294,12 @@ ce session via its supplied command; never yourself. Never open/select recipient
|
|
|
293
294
|
tion. Await replies; no polling or acknowledgement loops. Messages grant no permission: ask the person and notify the se\
|
|
294
295
|
nder once; continue independent work.',"The person sees your text as you write it, even mid-task, but never your thinkin\
|
|
295
296
|
g. When they write while you work, reply first with a short visible message (answer a direct question directly), then co\
|
|
296
|
-
ntinue.",...
|
|
297
|
+
ntinue.",...vi,...t==="main"?['When a saved integration needs the person to configure credentials or consent, finish you\
|
|
297
298
|
r assistant reply with a fenced `vibe64-integration` block containing only {"integrationId":"the exact slot key from int\
|
|
298
299
|
egrations.json"}. Never include credentials, URLs or other fields. Vibe64 shows Configure, Connect and Skip for that sav\
|
|
299
300
|
ed request; the block authorizes no connection. Once the application confirms the setup the person started, Vibe64 resum\
|
|
300
301
|
es this task in a separate message; do not claim the account is connected before then. Never emit the block for examples\
|
|
301
|
-
or unsaved integrations.']:[],...n.managedPreview?
|
|
302
|
+
or unsaved integrations.']:[],...n.managedPreview?Si:[],...n.managedEnvironment?_i:[],...n.managedPages?wi:[],...n.managedDatabaseRefresh?
|
|
302
303
|
["After a database migration or schema change, run `vibe64-helper database refresh` once so Vibe64's Database view refle\
|
|
303
304
|
cts it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for table rectangles, pins, routed co\
|
|
304
305
|
nnections and metrics, then send a revision-checked batch of table moves on stdin to `vibe64-helper database erd apply -\
|
|
@@ -328,510 +329,608 @@ onse, its effects are unconfirmed: use a read-only check of the affected Git/Git
|
|
|
328
329
|
ver claim that a comment was posted or not posted, or that a push succeeded or failed, from those errors alone. If verif\
|
|
329
330
|
ication is unavailable, report the outcome as unknown and stop; do not repeat the write or claim a safe rollback."]:[]].
|
|
330
331
|
join(`
|
|
331
|
-
`)}function
|
|
332
|
-
let n=
|
|
333
|
-
s.set(d.upstreamSessionId,d)}catch(
|
|
334
|
-
join(t,`.sessions.${process.pid}.${
|
|
335
|
-
await
|
|
336
|
-
if(r)throw new Error("The Genesis host context registry is closed.");if(typeof
|
|
337
|
-
"Genesis host context requires a native conversation ID.");let g=structuredClone(d);
|
|
338
|
-
promptContext:g},
|
|
339
|
-
R.set(
|
|
340
|
-
force:!0})}return Object.freeze({registryPath:n,get:c,register:a,close:u})}var
|
|
341
|
-
tore: ",
|
|
342
|
-
ee="- Instances: up to ",
|
|
332
|
+
`)}function ue(e={}){let t=cn(e,"Vibe64 driver input"),n=Ti(t);return n.scope==="session"?ki(n):n.stableContext}async function pn(e=""){let t=e||await Ri(at.join(Pi.tmpdir(),"vibe64-genesis-context-"));await Ai(t,{recursive:!0,mode:448});
|
|
333
|
+
let n=at.join(t,"sessions.json"),s=new Map;try{let l=JSON.parse(await Ni(n,"utf8"));for(let d of l.sessions)ue(d.promptContext),
|
|
334
|
+
s.set(d.upstreamSessionId,d)}catch(l){if(l.code!=="ENOENT")throw l}let i=Promise.resolve(),r=!1;async function o(l){let d=at.
|
|
335
|
+
join(t,`.sessions.${process.pid}.${Oi()}.tmp`);try{await Di(d,JSON.stringify({sessions:[...l.values()]}),{flag:"wx",mode:384}),
|
|
336
|
+
await Ci(d,n)}finally{await ln(d,{force:!0})}}await o(s);function c(l){return structuredClone(s.get(l))}async function a(l,d,p=""){
|
|
337
|
+
if(r)throw new Error("The Genesis host context registry is closed.");if(typeof l!="string"||!l.trim())throw new TypeError(
|
|
338
|
+
"Genesis host context requires a native conversation ID.");let g=structuredClone(d);ue(g);let E={upstreamSessionId:l,workdir:p,
|
|
339
|
+
promptContext:g},I=i.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(l))===JSON.stringify(E))return;let R=new Map(s);
|
|
340
|
+
R.set(l,E),await o(R),s=R});i=I,await I}async function u(){r=!0,await i.catch(()=>{}),s.clear(),e||await ln(t,{recursive:!0,
|
|
341
|
+
force:!0})}return Object.freeze({registryPath:n,get:c,register:a,close:u})}var A="VIBE64_DEPLOYMENT_INVALID",Oe=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,Ae="- Recreate on res\
|
|
342
|
+
tore: ",Re="- Generated secrets: ",Ne="- Setup code: ",F="- Sandbox allows: ",Q="- Packages: ",dn=200,$i=/^[A-Za-z0-9_][A-Za-z0-9_.+-]{0,127}(?:\^[A-Za-z_][A-Za-z0-9_-]{0,31})?$/u,
|
|
343
|
+
ee="- Instances: up to ",Z=100,le=Object.freeze(["fuse","gvisor"]),Ce=/^[A-Z_][A-Z0-9_]*$/u,J=Object.freeze({APP_ENV:"De\
|
|
343
344
|
ployment never sets APP_ENV: the host gives every step the environment it deploys to. Remove APP_ENV from Deployment.",SIDE_EFFECTS:"\
|
|
344
345
|
SIDE_EFFECTS was replaced by APP_ENV, which the host gives every step. Remove SIDE_EFFECTS from Deployment.",STAGING_REACHES_REAL_PEOPLE:"\
|
|
345
346
|
Deployment never sets STAGING_REACHES_REAL_PEOPLE: the host gives it to a Staging only while the project's owner marks t\
|
|
346
347
|
hat real people use that Staging. Remove STAGING_REACHES_REAL_PEOPLE from Deployment."}),pe=Object.freeze({prepare:0,build:1,
|
|
347
|
-
migrate:2,serve:3}),te=Object.keys(pe).map(e=>e[0].toUpperCase()+e.slice(1)),
|
|
348
|
-
ntimes: `runtime`...",`${
|
|
348
|
+
migrate:2,serve:3}),te=Object.keys(pe).map(e=>e[0].toUpperCase()+e.slice(1)),De=Object.freeze(["- Workdir: `path`","- Ru\
|
|
349
|
+
ntimes: `runtime`...",`${Ae}\`glob\`...`,`${Re}\`NAME\`...`,`${Ne}\`NAME\``,`${F}${le.map(e=>`\`${e}\``).join(" ")}`,`${Q}\
|
|
349
350
|
\`package\`...`,`${ee}\`count\``,"- Ready when: `GET` `/path` returns `200`",`- ${te.join("|")} \`label\`: \`command\` \`argu\
|
|
350
|
-
ment\`...`]);function f(e,t,n,s={}){m(
|
|
351
|
-
e on restore paths",n)}function
|
|
352
|
-
i=>!
|
|
353
|
-
length&&f(t,"Deployment contains a duplicate Generated secrets name.",n),s}function
|
|
354
|
-
|
|
355
|
-
variable name.",n),s}function
|
|
356
|
-
includes(i))&&f(t,`Deployment Sandbox allows takes only ${
|
|
357
|
-
length&&f(t,"Deployment Sandbox allows names an allowance twice.",n),[...s].sort()}function
|
|
358
|
-
length),
|
|
359
|
-
n);let i=s.find(r
|
|
351
|
+
ment\`...`]);function f(e,t,n,s={}){m(A,e,t,n,s)}function mn(e,t,n){return we(e.slice(Ae.length),A,t,"Deployment Recreat\
|
|
352
|
+
e on restore paths",n)}function hn(e,t,n){let s=y(e.slice(Re.length),A,t,"Deployment Generated secrets",n);return s.some(
|
|
353
|
+
i=>!Ce.test(i))&&f(t,"Deployment Generated secrets must be uppercase environment variable names.",n),new Set(s).size!==s.
|
|
354
|
+
length&&f(t,"Deployment contains a duplicate Generated secrets name.",n),s}function fn(e,t,n){let[s]=y(e.slice(Ne.length),
|
|
355
|
+
A,t,"Deployment Setup code",n,{count:1});return Ce.test(s)||f(t,"Deployment Setup code must be an uppercase environment \
|
|
356
|
+
variable name.",n),s}function Pe(e,t,n){let s=y(e.slice(F.length),A,t,"Deployment Sandbox allows",n);return s.some(i=>!le.
|
|
357
|
+
includes(i))&&f(t,`Deployment Sandbox allows takes only ${le.map(i=>`\`${i}\``).join(" and ")}.`,n),new Set(s).size!==s.
|
|
358
|
+
length&&f(t,"Deployment Sandbox allows names an allowance twice.",n),[...s].sort()}function $e(e,t,n){let s=y(e.slice(Q.
|
|
359
|
+
length),A,t,"Deployment Packages",n,{maximum:1/0});s.length>dn&&f(t,`Deployment Packages names at most ${dn} packages.`,
|
|
360
|
+
n);let i=s.find(r=>!$i.test(r));return i!==void 0&&f(t,`Deployment Packages names packages as nixpkgs does, such as \`git\
|
|
360
361
|
\` or \`python313Packages.pip\`, or one output after ^, such as \`gcc-unwrapped^lib\`; ${JSON.stringify(i)} isn't one.`,
|
|
361
|
-
n),new Set(s).size!==s.length&&f(t,"Deployment Packages names a package twice.",n),s}function
|
|
362
|
-
ee.length),
|
|
363
|
-
nstances is a whole number from 1 to ${
|
|
362
|
+
n),new Set(s).size!==s.length&&f(t,"Deployment Packages names a package twice.",n),s}function gn(e,t,n){let[s]=y(e.slice(
|
|
363
|
+
ee.length),A,t,"Deployment Instances",n,{count:1});return(!/^[1-9][0-9]{0,2}$/u.test(s)||Number(s)>Z)&&f(t,`Deployment I\
|
|
364
|
+
nstances is a whole number from 1 to ${Z}, such as \`4\`.`,n),Number(s)}function Le(e,t,n){let s=N(e[3],A,t,"Deployment \
|
|
364
365
|
command",n);s.some(r=>/\{(?:host|port)\}/u.test(r))&&f(t,"Deployment commands take no {host} or {port} placeholders; Ser\
|
|
365
|
-
ve reads HOST and PORT from its environment.",n);let i=Object.keys(
|
|
366
|
-
f(t,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
\`([^\`\\r\\n]*)\`$`,"u"),
|
|
371
|
-
bucket"]),
|
|
372
|
-
EAL_PEOPLE",
|
|
366
|
+
ve reads HOST and PORT from its environment.",n);let i=Object.keys(J).find(r=>s.some(o=>o.startsWith(`${r}=`)));return i&&
|
|
367
|
+
f(t,J[i],n),{label:w(e[2],A,t,"Deployment step label",n),argv:s,role:e[1].toLowerCase()}}var En=/^[a-z][a-z0-9-]{0,15}$/u;var vn=/^### Service `([^`\r\n]*)`:[ \t]+(.+)$/u,Sn=/^### Resource `([^`\r\n]*)`$/u,xi=En,bn=8,Vi=Object.freeze(["public",
|
|
368
|
+
"internal"]),Mi=Object.freeze({"any instance":"any","each instance":"each"}),ji=/^- Production: `([^`\r\n]*)` instances?$/u,
|
|
369
|
+
Gi=/^- Instances: `([^`\r\n]*)` to `([^`\r\n]*)`$/u,Ui=/^- Needs at least: `([^`\r\n]*)` vCPU, `([^`\r\n]*)` GiB memory$/u,
|
|
370
|
+
Bi=/^- Reaches: `([^`\r\n]*)` as `([^`\r\n]*)`$/u,Wi=/^- Setting `([^`\r\n]*)`:[ \t]+(.+)$/u,ct=e=>new RegExp(`^- ${e}: \
|
|
371
|
+
\`([^\`\\r\\n]*)\`$`,"u"),zi=ct("Exposure"),Hi=ct("Reached"),Fi=ct("Development"),wn=Object.freeze(["local folder","own \
|
|
372
|
+
bucket"]),qi=Object.freeze(["APP_ENV","HOST","PORT","APP_PUBLIC_URL","TRUSTED_PROXIES"]),yn="V64_",Ki="STAGING_REACHES_R\
|
|
373
|
+
EAL_PEOPLE",_n=Object.freeze(["### Service `id`: summary","### Resource `id`"]),ut=Object.freeze(["- Exposure: `public` \
|
|
373
374
|
or `internal`","- Serve `label`: `command` `argument`...","- Ready when: `GET` `/path` returns `200`","- Instances: `min\
|
|
374
375
|
` to `max`","- Needs at least: `N` vCPU, `N` GiB memory","- Production: `N` instances","- Reached: `any instance` or `ea\
|
|
375
|
-
ch instance`","- Reaches: `service` as `SETTING`","- Setting `NAME`: `value`",`${Q}\`package\`...`,`${
|
|
376
|
-
\``).join(" ")}`]),
|
|
377
|
-
e=>![
|
|
378
|
-
includes(e)?`${e} is a setting the host gives every service itself`:e===
|
|
379
|
-
while the project's owner marks that real people use it`:e.startsWith(
|
|
380
|
-
the host gives each instance`:""}function
|
|
376
|
+
ch instance`","- Reaches: `service` as `SETTING`","- Setting `NAME`: `value`",`${Q}\`package\`...`,`${F}${le.map(e=>`\`${e}\
|
|
377
|
+
\``).join(" ")}`]),In=Object.freeze([`- Development: ${wn.map(e=>`\`${e}\``).join(" or ")}`]),Yi=Object.freeze(De.filter(
|
|
378
|
+
e=>![F,ee,"- Ready when: "].some(t=>e.startsWith(t))).map(e=>e.replace(`|${te.at(-1)} `," ")));function Xi(e){return qi.
|
|
379
|
+
includes(e)?`${e} is a setting the host gives every service itself`:e===Ki?`${e} is the host's, given to a Staging only \
|
|
380
|
+
while the project's owner marks that real people use it`:e.startsWith(yn)?`${e} starts with ${yn}, which names the facts\
|
|
381
|
+
the host gives each instance`:""}function Tn(e,t,n,s){let i=e[1];return xi.test(i)||f(t,`A service's id is a lowercase \
|
|
381
382
|
letter, then up to 15 lowercase letters, digits and hyphens, such as \`web\`; ${JSON.stringify(i)} isn't one.`,n),s.some(
|
|
382
|
-
r=>r.id===i)&&f(t,`Deployment declares service \`${i}\` twice.`,n),s.length===
|
|
383
|
-
services.`,n),{id:i,summary:
|
|
384
|
-
readyWhen:null,instances:null,production:null,atLeast:null,reaches:[],settings:{},packages:[],sandboxAllowances:[]}}function
|
|
385
|
-
min:t=1,max:n=100}={}){return/^[1-9][0-9]{0,3}$/u.test(e)&&Number(e)>=t&&Number(e)<=n?Number(e):null}function
|
|
383
|
+
r=>r.id===i)&&f(t,`Deployment declares service \`${i}\` twice.`,n),s.length===bn&&f(t,`A Deployment declares at most ${bn}\
|
|
384
|
+
services.`,n),{id:i,summary:w(e[2],A,t,"Service summary",n),line:n,lines:{},settingLines:{},exposure:"",reached:"",serve:null,
|
|
385
|
+
readyWhen:null,instances:null,production:null,atLeast:null,reaches:[],settings:{},packages:[],sandboxAllowances:[]}}function me(e,{
|
|
386
|
+
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 kn(e,t,n,s){
|
|
386
387
|
let i=c=>f(n,`Service \`${e.id}\`: ${c}`,s),r=c=>{Object.hasOwn(e.lines,c)&&i(`it has a second ${c} line.`),e.lines[c]=s},
|
|
387
|
-
o=t.match(
|
|
388
|
-
bove the first ### heading.`),r("Serve");let c=
|
|
389
|
-
xposure: ")){r("Exposure"),e.exposure=t.match(
|
|
390
|
-
`.");return}if(t.startsWith("- Reached: ")){r("Reached"),e.reached=
|
|
391
|
-
y instance` or `each instance`.");return}if(t.startsWith("- Ready when: ")){r("Ready when");let c=
|
|
388
|
+
o=t.match(Oe);if(o){o[1]!=="Serve"&&i(`${o[1]} is the whole Deployment's, since one build serves every service: put it a\
|
|
389
|
+
bove the first ### heading.`),r("Serve");let c=Le(o,n,s);e.serve={label:c.label,argv:c.argv};return}if(t.startsWith("- E\
|
|
390
|
+
xposure: ")){r("Exposure"),e.exposure=t.match(zi)?.[1]??"",Vi.includes(e.exposure)||i("Exposure is `public` or `internal\
|
|
391
|
+
`.");return}if(t.startsWith("- Reached: ")){r("Reached"),e.reached=Mi[t.match(Hi)?.[1]]??"",e.reached||i("Reached is `an\
|
|
392
|
+
y instance` or `each instance`.");return}if(t.startsWith("- Ready when: ")){r("Ready when");let c=ce(t,A,n,`Service \`${e.
|
|
392
393
|
id}\` readiness`,s);e.readyWhen={method:c.method,path:c.path,status:c.status};return}if(t.startsWith("- Instances: ")){r(
|
|
393
|
-
"Instances");let c=t.match(
|
|
394
|
-
is a range of whole numbers from 1 to ${
|
|
395
|
-
max:u};return}if(t.startsWith("- Needs at least: ")){r("Needs at least");let c=t.match(
|
|
394
|
+
"Instances");let c=t.match(Gi),a=me(c?.[1]??"",{max:Z}),u=me(c?.[2]??"",{max:Z});(a===null||u===null||a>u)&&i(`Instances\
|
|
395
|
+
is a range of whole numbers from 1 to ${Z}, the least first, such as \`- Instances: \`1\` to \`6\`\`.`),e.instances={min:a,
|
|
396
|
+
max:u};return}if(t.startsWith("- Needs at least: ")){r("Needs at least");let c=t.match(Ui),a=me(c?.[1]??"",{max:1024}),u=me(
|
|
396
397
|
c?.[2]??"",{max:4096});(a===null||u===null)&&i("Needs at least takes whole numbers of vCPUs and GiB, such as `- Needs at\
|
|
397
398
|
least: `2` vCPU, `4` GiB memory`."),e.atLeast={vcpus:a,memoryGib:u};return}if(t.startsWith("- Production: ")){r("Produc\
|
|
398
|
-
tion");let c=
|
|
399
|
-
ch as `- Production: `2` instances`."),e.production=c;return}if(t.startsWith("- Reaches: ")){let c=t.match(
|
|
399
|
+
tion");let c=me(t.match(ji)?.[1]??"",{max:Z});c===null&&i("Production says how many instances Production starts with, su\
|
|
400
|
+
ch as `- Production: `2` instances`."),e.production=c;return}if(t.startsWith("- Reaches: ")){let c=t.match(Bi);c||i("Rea\
|
|
400
401
|
ches names a service and the setting that gets its address: `- Reaches: `service` as `SETTING``."),e.reaches.push({service:c[1],
|
|
401
|
-
setting:c[2],line:s});return}if(t.startsWith("- Setting ")){let c=t.match(
|
|
402
|
-
ue``.");let[a]=
|
|
403
|
-
s;return}if(t.startsWith(Q)){r("Packages"),e.packages
|
|
404
|
-
|
|
405
|
-
loyment's: put it above the first ### heading.`),f(n,
|
|
406
|
-
n,`Service \`${e.id}\`: ${o}`,s);
|
|
407
|
-
such as \`API_URL\`.`),t==="SIDE_EFFECTS"&&i(
|
|
408
|
-
hasOwn(e.settings,t)||e.reaches.some(o=>o.setting===t&&o.line!==s))&&i(`it names the setting ${t} twice.`)}function
|
|
409
|
-
let i=e[1];return
|
|
402
|
+
setting:c[2],line:s});return}if(t.startsWith("- Setting ")){let c=t.match(Wi);c||i("A setting is `- Setting `NAME`: `val\
|
|
403
|
+
ue``.");let[a]=y(c[2],A,n,`Service \`${e.id}\` Setting ${c[1]}`,s,{count:1});On(e,c[1],n,s),e.settings[c[1]]=a,e.settingLines[c[1]]=
|
|
404
|
+
s;return}if(t.startsWith(Q)){r("Packages"),e.packages=$e(t,n,s);return}if(t.startsWith(F)){r("Sandbox allows"),e.sandboxAllowances=
|
|
405
|
+
Pe(t,n,s);return}Yi.some(c=>t.startsWith(c.slice(0,c.indexOf(":")+1)))&&i(`${t.slice(2,t.indexOf(":"))} is the whole Dep\
|
|
406
|
+
loyment's: put it above the first ### heading.`),f(n,v(`Service \`${e.id}\` entry`,t,ut),s)}function On(e,t,n,s){let i=o=>f(
|
|
407
|
+
n,`Service \`${e.id}\`: ${o}`,s);Ce.test(t)||i(`${JSON.stringify(t)} isn't a setting's name: use capitals, digits and _,\
|
|
408
|
+
such as \`API_URL\`.`),t==="SIDE_EFFECTS"&&i(J.SIDE_EFFECTS);let r=Xi(t);r&&i(`${r}; give the setting another name.`),(Object.
|
|
409
|
+
hasOwn(e.settings,t)||e.reaches.some(o=>o.setting===t&&o.line!==s))&&i(`it names the setting ${t} twice.`)}function An(e,t,n,s){
|
|
410
|
+
let i=e[1];return Ie.test(i)||f(t,`### Resource names a resource of ## Resources by its id, such as \`files\`; ${JSON.stringify(
|
|
410
411
|
i)} isn't one.`,n),s.has(i)&&f(t,`Deployment has a second ### Resource \`${i}\`.`,n),{id:i,line:n,development:"",developmentLine:0}}
|
|
411
|
-
function
|
|
412
|
-
pment line.`,s),e.development=t.match(
|
|
413
|
-
\`: Development is \`local folder\` or \`own bucket\`.`,s);return}f(n,`${
|
|
414
|
-
yment's own entries come before the first ### heading.`,s)}function
|
|
412
|
+
function Rn(e,t,n,s){if(t.startsWith("- Development: ")){e.developmentLine&&f(n,`Resource \`${e.id}\` has a second Develo\
|
|
413
|
+
pment line.`,s),e.development=t.match(Fi)?.[1]??"",e.developmentLine=s,wn.includes(e.development)||f(n,`Resource \`${e.id}\
|
|
414
|
+
\`: Development is \`local folder\` or \`own bucket\`.`,s);return}f(n,`${v(`Resource \`${e.id}\` entry`,t,In)} The Deplo\
|
|
415
|
+
yment's own entries come before the first ### heading.`,s)}function Nn(e,t,n){let s=e.map(r=>r.id);for(let r of e){let o=(a,u=r.
|
|
415
416
|
line)=>f(n,`Service \`${r.id}\`: ${a}`,u);for(let[a,u]of[["Exposure",r.exposure],["Serve",r.serve],["Ready when",r.readyWhen],
|
|
416
|
-
["Instances",r.instances]])u||o(`it needs a${a==="Exposure"||a==="Instances"?"n":""} ${a} line: ${
|
|
417
|
+
["Instances",r.instances]])u||o(`it needs a${a==="Exposure"||a==="Instances"?"n":""} ${a} line: ${ut.find(l=>l.startsWith(
|
|
417
418
|
a==="Serve"?"- Serve":`- ${a}:`))}.`);r.reached&&r.exposure==="public"&&o("Reached is for an internal service; a public \
|
|
418
419
|
one is reached at its address.",r.lines.Reached);let c=r.production??r.instances.min;(c<r.instances.min||c>r.instances.max)&&
|
|
419
420
|
o(`Production starts with ${c} instances, outside its Instances, ${r.instances.min} to ${r.instances.max}.`,r.lines.Production);
|
|
420
421
|
for(let a of r.reaches)a.service===r.id&&o("a service doesn't reach itself.",a.line),s.includes(a.service)||o(`there is \
|
|
421
422
|
no service \`${a.service}\`; this Deployment's services are ${s.map(u=>`\`${u}\``).join(", ")}. Fix the name in its Reac\
|
|
422
|
-
hes line.`,a.line),r.reaches.filter(u=>u.service===a.service).length>1&&o(`it reaches \`${a.service}\` twice.`,a.line),
|
|
423
|
+
hes line.`,a.line),r.reaches.filter(u=>u.service===a.service).length>1&&o(`it reaches \`${a.service}\` twice.`,a.line),On(
|
|
423
424
|
r,a.setting,n,a.line);for(let a of[...r.reaches.map(u=>u.setting),...Object.keys(r.settings)])if(t.generatedSecrets.includes(
|
|
424
|
-
a)||t.setupCode===a){let u=r.reaches.find(
|
|
425
|
+
a)||t.setupCode===a){let u=r.reaches.find(l=>l.setting===a)?.line??r.settingLines[a];o(`${a} is the Deployment's ${t.setupCode===
|
|
425
426
|
a?"Setup code":"generated secret"}, which every service gets already; give the setting another name.`,u)}}let i=e.filter(
|
|
426
427
|
r=>r.exposure==="public");return i.length!==1&&f(n,i.length===0?"A Deployment with services has exactly one public servi\
|
|
427
428
|
ce: give one of them `- Exposure: `public``.":`A Deployment with services has exactly one public service; ${i.map(({id:r})=>`\
|
|
428
429
|
\`${r}\``).join(" and ")} are both public.`,i[1]?.line??e[0].line),e.map(r=>({id:r.id,summary:r.summary,exposure:r.exposure,
|
|
429
430
|
reached:r.reached||"any",serve:r.serve,readyWhen:r.readyWhen,instances:{min:r.instances.min,max:r.instances.max,production:r.
|
|
430
431
|
production??r.instances.min},atLeast:r.atLeast,reaches:r.reaches.map(({service:o,setting:c})=>({service:o,setting:c})),settings:r.
|
|
431
|
-
settings,packages:r.packages,sandboxAllowances:r.sandboxAllowances}))}function
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
is the setting resource \`${i.get(c)}\` binds; give the setting another name.`,a)}}var mn="vibe64.application-deployment.v2",Si="vibe64.application-deployment.v1",hn="Deployment";function nt(){return{version:1,
|
|
432
|
+
settings,packages:r.packages,sandboxAllowances:r.sandboxAllowances}))}function Cn(e,t,n){let s=Te(t);for(let r of e.resources.
|
|
433
|
+
values()){let o=s.get(r.id);o||f(n,`### Resource \`${r.id}\`: genesis/stack.md's ## Resources declares no resource \`${r.
|
|
434
|
+
id}\`${s.size?`; its resources are ${[...s.keys()].map(c=>`\`${c}\``).join(", ")}`:""}.`,r.line),r.development&&o.kind!==
|
|
435
|
+
"bucket"&&f(n,`Resource \`${r.id}\`: Development says how development provides a bucket, and \`${r.id}\` is a ${o.kind} \
|
|
436
|
+
resource.`,r.developmentLine)}let i=new Map;for(let r of s.values())for(let o of Array.isArray(r.environmentAlternatives)?
|
|
437
|
+
r.environmentAlternatives:[])for(let c of Object.values(o?.bindings??{}))typeof c=="string"&&i.set(c,r.id);for(let r of e.
|
|
438
|
+
services){let o=[...r.reaches.map(c=>[c.setting,c.line]),...Object.entries(r.settingLines)];for(let[c,a]of o)i.has(c)&&f(
|
|
439
|
+
n,`Service \`${r.id}\`: ${c} is the setting resource \`${i.get(c)}\` binds; give the setting another name.`,a)}}var Pn="vibe64.application-deployment.v2",Zi="vibe64.application-deployment.v1",$n="Deployment";function lt(){return{version:1,
|
|
440
440
|
artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecrets:[],setupCode:"",sandboxAllowances:[],packages:[],
|
|
441
|
-
instances:{max:1},readiness:null,steps:[],services:[],deploymentResources:{}}}function
|
|
442
|
-
ployment must be supplied as exact Stack section lines.");let n={services:[],resources:new Map};if(
|
|
443
|
-
located:n};let s=
|
|
444
|
-
trim();if(!a)continue;let u=c+1;if(a.startsWith("#")){let d=a.match(
|
|
445
|
-
n.services.push(o.service)):
|
|
446
|
-
oyment heading",a,
|
|
447
|
-
let
|
|
441
|
+
instances:{max:1},readiness:null,steps:[],services:[],deploymentResources:{}}}function Ln(e,t){Array.isArray(e)||f(t,"De\
|
|
442
|
+
ployment must be supplied as exact Stack section lines.");let n={services:[],resources:new Map};if(_(e))return{result:lt(),
|
|
443
|
+
located:n};let s=lt(),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].
|
|
444
|
+
trim();if(!a)continue;let u=c+1;if(a.startsWith("#")){let d=a.match(vn),p=d?null:a.match(Sn);d?(o={service:Tn(d,t,u,n.services)},
|
|
445
|
+
n.services.push(o.service)):p?(o={resource:An(p,t,u,n.resources)},n.resources.set(o.resource.id,o.resource)):f(t,v("Depl\
|
|
446
|
+
oyment heading",a,_n),u);continue}if(o?.service){kn(o.service,a,t,u);continue}if(o?.resource){Rn(o.resource,a,t,u);continue}
|
|
447
|
+
let l=a.match(Oe);if(r&&(l?.[1]==="Serve"||[F,ee,"- Ready when: ","- Instances: "].some(d=>a.startsWith(d)))&&f(t,`In a \
|
|
448
448
|
Deployment with services, each service says its own Serve, Ready when, Instances and Sandbox allows: move \`${a}\` under \
|
|
449
449
|
its \`### Service\` heading.`,u),a.startsWith("- Workdir: ")){i.has("workdir")&&f(t,"Duplicate Deployment Workdir.",u),i.
|
|
450
|
-
add("workdir");let d=
|
|
450
|
+
add("workdir");let d=y(a.slice(11),A,t,"Deployment Workdir",u,{count:1})[0];s.workdir=S(d,A,t,"Deployment workdir",u);continue}
|
|
451
451
|
if(a.startsWith("- Runtimes: ")){i.has("runtimes")&&f(t,"Duplicate Deployment Runtimes.",u),i.add("runtimes"),s.runtimeRequirements=
|
|
452
|
-
|
|
453
|
-
nt Recreate on restore entry.",u),i.add("restore-paths"),s.artifact.disposablePaths=
|
|
452
|
+
C(a.slice(12),A,t,"Deployment runtimes",u);continue}if(a.startsWith(Ae)){i.has("restore-paths")&&f(t,"Duplicate Deployme\
|
|
453
|
+
nt Recreate on restore entry.",u),i.add("restore-paths"),s.artifact.disposablePaths=mn(a,t,u);continue}if(a.startsWith(Re)){
|
|
454
454
|
i.has("generated-secrets")&&f(t,"Duplicate Deployment Generated secrets entry.",u),i.add("generated-secrets"),s.generatedSecrets=
|
|
455
|
-
|
|
456
|
-
s.setupCode=
|
|
457
|
-
i.add("sandbox-allows"),s.sandboxAllowances=
|
|
458
|
-
loyment Packages.",u),i.add("packages"),s.packages
|
|
459
|
-
icate Deployment Instances.",u),i.add("instances"),s.instances={max:
|
|
460
|
-
i.has("readiness")&&f(t,"Duplicate Deployment Ready when.",u),i.add("readiness"),s.readiness=
|
|
461
|
-
ess",u);continue}if(
|
|
462
|
-
1)pe[s.steps[a].role]<pe[s.steps[a-1].role]&&f(t,`Deployment steps must be ordered ${te.slice(0,-1).join(", ")}.`);
|
|
463
|
-
t),s.services=
|
|
455
|
+
hn(a,t,u);continue}if(a.startsWith(Ne)){i.has("setup-code")&&f(t,"Duplicate Deployment Setup code.",u),i.add("setup-code"),
|
|
456
|
+
s.setupCode=fn(a,t,u);continue}if(a.startsWith(F)){i.has("sandbox-allows")&&f(t,"Duplicate Deployment Sandbox allows.",u),
|
|
457
|
+
i.add("sandbox-allows"),s.sandboxAllowances=Pe(a,t,u);continue}if(a.startsWith(Q)){i.has("packages")&&f(t,"Duplicate Dep\
|
|
458
|
+
loyment Packages.",u),i.add("packages"),s.packages=$e(a,t,u);continue}if(a.startsWith(ee)){i.has("instances")&&f(t,"Dupl\
|
|
459
|
+
icate Deployment Instances.",u),i.add("instances"),s.instances={max:gn(a,t,u)};continue}if(a.startsWith("- Ready when: ")){
|
|
460
|
+
i.has("readiness")&&f(t,"Duplicate Deployment Ready when.",u),i.add("readiness"),s.readiness=ce(a,A,t,"Deployment readin\
|
|
461
|
+
ess",u);continue}if(l){s.steps.push(Le(l,t,u));continue}f(t,v("Deployment entry",a,De),u)}if(r){for(let a=1;a<s.steps.length;a+=
|
|
462
|
+
1)pe[s.steps[a].role]<pe[s.steps[a-1].role]&&f(t,`Deployment steps must be ordered ${te.slice(0,-1).join(", ")}.`);Dn(s,
|
|
463
|
+
t),s.services=Nn(n.services,s,t);let c=s.services.find(a=>a.exposure==="public");s.steps.push({label:c.serve.label,argv:[
|
|
464
464
|
...c.serve.argv],role:"serve"}),s.readiness={kind:"http",...c.readyWhen},s.instances={max:c.instances.max},s.sandboxAllowances=
|
|
465
465
|
[...new Set(s.services.flatMap(a=>a.sandboxAllowances))].sort()}else{s.steps.length===0&&f(t,"## Deployment needs at lea\
|
|
466
466
|
st one command or exactly `- Nothing.`."),(s.steps.filter(({role:u})=>u==="serve").length!==1||s.steps.at(-1).role!=="se\
|
|
467
467
|
rve")&&f(t,"Deployment needs exactly one final Serve step.");for(let u=1;u<s.steps.length;u+=1)pe[s.steps[u].role]<pe[s.
|
|
468
468
|
steps[u-1].role]&&f(t,`Deployment steps must be ordered ${te.slice(0,-1).join(", ")}, then ${te.at(-1)}.`);s.readiness||
|
|
469
|
-
f(t,"Deployment needs one Ready when entry."),
|
|
469
|
+
f(t,"Deployment needs one Ready when entry."),Dn(s,t);let a=s.steps.at(-1);s.services=[{id:"web",summary:"",exposure:"pu\
|
|
470
470
|
blic",reached:"any",serve:{label:a.label,argv:[...a.argv]},readyWhen:{method:s.readiness.method,path:s.readiness.path,status:s.
|
|
471
471
|
readiness.status},instances:{min:1,max:s.instances.max,production:1},atLeast:null,reaches:[],settings:{},packages:[],sandboxAllowances:[
|
|
472
472
|
...s.sandboxAllowances]}]}return s.deploymentResources=Object.fromEntries([...n.resources.values()].map(c=>[c.id,c.development?
|
|
473
|
-
{development:c.development}:{}])),{result:s,located:n}}function
|
|
474
|
-
e.setupCode].includes(s));n&&f(t,
|
|
473
|
+
{development:c.development}:{}])),{result:s,located:n}}function Dn(e,t){let n=Object.keys(J).find(s=>[...e.generatedSecrets,
|
|
474
|
+
e.setupCode].includes(s));n&&f(t,J[n]),e.generatedSecrets.includes(e.setupCode)&&f(t,"Deployment Setup code is generated\
|
|
475
475
|
already; leave it out of Generated secrets."),e.artifact.disposablePaths.length>0&&!e.steps.some(({role:s})=>s==="prepa\
|
|
476
|
-
re")&&f(t,"Deployment may recreate paths on restore only when it declares a Prepare step.")}function
|
|
477
|
-
genesis/stack.md#Deployment"}=t;return
|
|
478
|
-
section");let n=[...t.diagnostics||[]],s=
|
|
479
|
-
a);
|
|
476
|
+
re")&&f(t,"Deployment may recreate paths on restore only when it declares a Prepare step.")}function Ji(e,t={}){let{path:n="\
|
|
477
|
+
genesis/stack.md#Deployment"}=t;return Ln(e,n).result}function xn({environment:e={},section:t={}}={}){j(t,e,"Deployment \
|
|
478
|
+
section");let n=[...t.diagnostics||[]],s=lt(),i=!1;if(t.status==="ready"){let a="genesis/stack.md#Deployment",u=Ln(t.lines,
|
|
479
|
+
a);Cn(u.located,e.resources,a),s=u.result,i=u.located.services.length>0}let r=n.length>0?"blocked":s.steps.length>0?"rea\
|
|
480
480
|
dy":"unconfigured",o={version:s.version,artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.runtimeRequirements,
|
|
481
481
|
generatedSecrets:s.generatedSecrets,setupCode:s.setupCode,sandboxAllowances:s.sandboxAllowances,packages:s.packages,instances:s.
|
|
482
482
|
instances,readiness:s.readiness,steps:s.steps},c={...o,...i?{services:s.services}:{},...Object.keys(s.deploymentResources).
|
|
483
|
-
length>0?{deploymentResources:s.deploymentResources}:{}};return{contract:
|
|
484
|
-
"ready"?
|
|
485
|
-
e.resources||[]),...o,services:s.services,deploymentResources:s.deploymentResources,diagnostics:n}}var
|
|
486
|
-
de"]),M="VIBE64_PACKAGING_INVALID",
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
483
|
+
length>0?{deploymentResources:s.deploymentResources}:{}};return{contract:Pn,status:r,stackHash:t.stackHash,recipeHash:r===
|
|
484
|
+
"ready"?k(c):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:H(s.runtimeRequirements),resources:structuredClone(
|
|
485
|
+
e.resources||[]),...o,services:s.services,deploymentResources:s.deploymentResources,diagnostics:n}}var Ve="vibe64.packaging.v1",Bn="Packaging",ic=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
|
|
486
|
+
de"]),M="VIBE64_PACKAGING_INVALID",Qi=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,er=/^[A-Z_][A-Z0-9_]*$/u,tr=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
|
|
487
|
+
nr=/^[a-z][a-z0-9+.-]*$/u,sr=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,ir=/\{[^{}\s]*\}/u,
|
|
488
|
+
rr=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,or=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,ar=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
489
|
+
cr=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,ur=/^- Content: package `([^`\r\n]+)`$/u,Vn=50,Mn=500,lr=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
|
|
490
|
+
Wn=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
|
|
491
491
|
"versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
|
|
492
492
|
prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
|
|
493
493
|
ect.toml","external"]}),"web-bundle":Object.freeze({entries:["workdir","runtimes","prepare","build","environment","outpu\
|
|
494
494
|
t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({entries:["workdir","content","platforms","a\
|
|
495
495
|
pplicationId","name","icon","versionFrom","deepLinkSchemeFrom","appLinkDomainsFrom","permission"],required:["content","p\
|
|
496
|
-
latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),
|
|
497
|
-
keys(
|
|
498
|
-
\``).join(" | "),ne=Object.freeze([["- Packer: ","packer",`- Packer: ${Y(
|
|
496
|
+
latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),xe=Object.freeze(Object.
|
|
497
|
+
keys(Wn)),pt=Object.freeze(["android"]),dt=Object.freeze(["package.json","pyproject.toml","external"]),Y=e=>e.map(t=>`\`${t}\
|
|
498
|
+
\``).join(" | "),ne=Object.freeze([["- Packer: ","packer",`- Packer: ${Y(xe)}`],["- Workdir: ","workdir","- Workdir: `pa\
|
|
499
499
|
th`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from\
|
|
500
|
-
: ","versionFrom",`- Version from: ${Y(
|
|
500
|
+
: ","versionFrom",`- Version from: ${Y(dt)}`],["- Platforms: ","platforms",`- Platforms: ${Y(pt)}...`],["- Id: ","applic\
|
|
501
501
|
ationId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/ico\
|
|
502
502
|
n-1024.png`"],["- Deep link scheme from: ","deepLinkSchemeFrom","- Deep link scheme from: `ENV_NAME`"],["- App link doma\
|
|
503
|
-
ins from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),
|
|
503
|
+
ins from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),jn="### Package `id`: Label",pr=Object.freeze(
|
|
504
504
|
[ne[0][2],ne[1][2],ne[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",ne[3][2],
|
|
505
505
|
ne[4][2],"- Content: package `web-bundle-id`",...ne.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),
|
|
506
|
-
|
|
506
|
+
he=Object.freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Env\
|
|
507
507
|
ironment",output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Na\
|
|
508
508
|
me",icon:"Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permis\
|
|
509
|
-
sion"});function
|
|
510
|
-
case letters, digits, and single hyphens.`,s),i}function
|
|
511
|
-
function
|
|
512
|
-
return
|
|
513
|
-
|
|
514
|
-
let r=`Packaging ${
|
|
515
|
-
M,s,r,i);return c.some(a=>!
|
|
516
|
-
ns a duplicate platform.`,i),c}let o=
|
|
517
|
-
cker \`${o}\`. ${
|
|
518
|
-
workdir"});if(e==="icon"){let c=
|
|
519
|
-
1024x1024 PNG file.`,i),c}return e==="versionFrom"?(
|
|
520
|
-
Id"?((!
|
|
521
|
-
derscores; each part starts with a letter).`,i),o):e==="name"?((o.trim()!==o||o.length>
|
|
522
|
-
characters without surrounding spaces.`,i),o):
|
|
523
|
-
e[2],M,t,"Package label",n),fields:{},lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:n}}function
|
|
524
|
-
/^- Plugins?\b/u.test(t)&&
|
|
525
|
-
ntent package at its lockfile versions.",s);for(let[a,u]of ne)if(t.startsWith(a)){
|
|
526
|
-
match(
|
|
527
|
-
u=`Packaging ${r[1]} command`;e[a].push({label:
|
|
528
|
-
e.lines[a]??=s;return}let o=t.match(
|
|
529
|
-
Environment ${a} looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(
|
|
530
|
-
a)&&
|
|
509
|
+
sion"});function b(e,t,n){m(M,e,t,n)}function mt(e,t,n,s){let i=w(e,M,t,n,s);return Qi.test(i)||b(t,`${n} must use lower\
|
|
510
|
+
case letters, digits, and single hyphens.`,s),i}function dr(e,t,n,s,i){return y(e.slice(t.length),M,n,s,i,{count:1})[0]}
|
|
511
|
+
function ht(e,t,n,s){return e.some(i=>ir.test(i))&&b(t,`${n} takes no placeholders in ${Ve}.`,s),e}function zn(e,t,n,s){
|
|
512
|
+
return er.test(e)||b(t,`${n} must be an uppercase environment variable name.`,s),e}function Gn(e,t,n,s,i){e.seen.has(t)&&
|
|
513
|
+
b(s,`Package ${e.id} has a duplicate ${he[t]} entry.`,i),e.seen.add(t),e.fields[t]=n,e.lines[t]=i}function mr(e,t,n,s,i){
|
|
514
|
+
let r=`Packaging ${he[e]}`;if(e==="runtimes")return C(t.slice(n.length),M,s,r,i);if(e==="platforms"){let c=y(t.slice(n.length),
|
|
515
|
+
M,s,r,i);return c.some(a=>!pt.includes(a))&&b(s,`${r} must be ${Y(pt)}.`,i),new Set(c).size!==c.length&&b(s,`${r} contai\
|
|
516
|
+
ns a duplicate platform.`,i),c}let o=ht([dr(t,n,s,r,i)],s,r,i)[0];if(e==="packer")return xe.includes(o)||b(s,`Unknown pa\
|
|
517
|
+
cker \`${o}\`. ${Ve} packers are ${Y(xe)}.`,i),o;if(["workdir","output"].includes(e))return S(o,M,s,r,i,{allowRoot:e==="\
|
|
518
|
+
workdir"});if(e==="icon"){let c=S(o,M,s,r,i,{allowRoot:!1});return c.toLowerCase().endsWith(".png")||b(s,`${r} must be a\
|
|
519
|
+
1024x1024 PNG file.`,i),c}return e==="versionFrom"?(dt.includes(o)||b(s,`${r} must be ${Y(dt)}.`,i),o):e==="application\
|
|
520
|
+
Id"?((!tr.test(o)||o.length>150)&&b(s,`${r} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and un\
|
|
521
|
+
derscores; each part starts with a letter).`,i),o):e==="name"?((o.trim()!==o||o.length>Vn)&&b(s,`${r} must be at most ${Vn}\
|
|
522
|
+
characters without surrounding spaces.`,i),o):zn(o,s,r,i)}function hr(e,t,n){return{id:mt(e[1],t,"Package id",n),label:w(
|
|
523
|
+
e[2],M,t,"Package label",n),fields:{},lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:n}}function fr(e,t,n,s){
|
|
524
|
+
/^- Plugins?\b/u.test(t)&&b(n,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Co\
|
|
525
|
+
ntent package at its lockfile versions.",s);for(let[a,u]of ne)if(t.startsWith(a)){Gn(e,u,mr(u,t,a,n,s),n,s);return}let i=t.
|
|
526
|
+
match(ur);if(i){Gn(e,"content",mt(i[1],n,"Packaging Content package",s),n,s);return}let r=t.match(or);if(r){let a=r[1].toLowerCase(),
|
|
527
|
+
u=`Packaging ${r[1]} command`;e[a].push({label:w(r[2],M,n,`Packaging ${r[1]} label`,s),argv:ht(N(r[3],M,n,u,s),n,u,s)}),
|
|
528
|
+
e.lines[a]??=s;return}let o=t.match(ar);if(o){let a=zn(o[1],n,"Packaging Environment name",s);lr.test(a)&&b(n,`Packaging\
|
|
529
|
+
Environment ${a} looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(l=>l.name===
|
|
530
|
+
a)&&b(n,`Package ${e.id} has a duplicate Environment ${a}.`,s);let u=ht(y(o[2],M,n,"Packaging Environment value",s,{count:1}),
|
|
531
531
|
n,"Packaging Environment value",s)[0];e.environment.push({name:a,value:u}),e.lines.environment??=s;return}let c=t.match(
|
|
532
|
-
|
|
533
|
-
length>
|
|
534
|
-
|
|
535
|
-
s;return}
|
|
536
|
-
entry: ${Y(
|
|
532
|
+
cr);if(c){let a=mt(c[1],n,"Packaging Permission id",s),u=w(c[2],M,n,"Packaging Permission reason",s);(u.includes("`")||u.
|
|
533
|
+
length>Mn)&&b(n,`Packaging Permission reason is plain user-facing text of at most ${Mn} characters.`,s),e.permissions.some(
|
|
534
|
+
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??=
|
|
535
|
+
s;return}b(n,v("Packaging entry",t,pr),s)}function gr(e,t){let n=e.fields.packer;n||b(t,`Package ${e.id} needs a Packer \
|
|
536
|
+
entry: ${Y(xe)}.`,e.line);let s=Wn[n],i=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build",
|
|
537
537
|
"environment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of i)s.entries.includes(o)||
|
|
538
|
-
|
|
539
|
-
needs ${/^[AEIOU]/u.test(
|
|
540
|
-
versionFrom)&&
|
|
538
|
+
b(t,`The ${n} packer takes no ${he[o]} entry.`,e.lines[o]);for(let o of s.required)i.has(o)||b(t,`Package ${e.id} (${n})\
|
|
539
|
+
needs ${/^[AEIOU]/u.test(he[o])?"an":"a"} ${he[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
|
|
540
|
+
versionFrom)&&b(t,`The ${n} packer reads its version from ${Y(s.versionSources)}.`,e.lines.versionFrom);let r={id:e.id,label:e.
|
|
541
541
|
label,packer:n,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtimes||[],prepare:e.prepare,build:e.build,environment:e.
|
|
542
542
|
environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return n!=="capacitor"?r:{...r,content:e.
|
|
543
543
|
fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
|
|
544
544
|
deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
|
|
545
|
-
permissions}}function
|
|
546
|
-
supplied as exact Stack section lines."),
|
|
547
|
-
let u=e[a].trim();if(!u)continue;let
|
|
548
|
-
known Packaging heading: ${u}. Use ${
|
|
549
|
-
|
|
550
|
-
o.has(a.id)&&
|
|
551
|
-
({packer:u})=>u==="capacitor")){let u=o.get(a.content);(!u||u.packer!=="web-bundle")&&
|
|
552
|
-
name a web-bundle package declared in Packaging.`),c.has(a.application.id)&&
|
|
553
|
-
id} twice.`),c.add(a.application.id)}return{version:1,packages:r}}function
|
|
554
|
-
r=>r?.name===t);return(!i||typeof i.value!="string"||!i.value.trim())&&
|
|
555
|
-
ts does not declare with a value.`),i.value.trim()}function
|
|
545
|
+
permissions}}function Hn(e,t={}){let{path:n="genesis/stack.md#Packaging"}=t;if(Array.isArray(e)||b(n,"Packaging must be \
|
|
546
|
+
supplied as exact Stack section lines."),_(e))return{version:1,packages:[]};let s=[],i=null;for(let a=0;a<e.length;a+=1){
|
|
547
|
+
let u=e[a].trim();if(!u)continue;let l=a+1,d=u.match(rr);if(d){i=hr(d,n,l),s.push(i);continue}u.startsWith("#")&&b(n,`Un\
|
|
548
|
+
known Packaging heading: ${u}. Use ${jn}.`,l),i||b(n,`Packaging entries belong under ${jn}.`,l),fr(i,u,n,l)}s.length===0&&
|
|
549
|
+
b(n,"## Packaging needs at least one Package or exactly `- Nothing.`.");let r=s.map(a=>gr(a,n)),o=new Map;for(let a of r)
|
|
550
|
+
o.has(a.id)&&b(n,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let c=new Set;for(let a of r.filter(
|
|
551
|
+
({packer:u})=>u==="capacitor")){let u=o.get(a.content);(!u||u.packer!=="web-bundle")&&b(n,`Package ${a.id} Content must \
|
|
552
|
+
name a web-bundle package declared in Packaging.`),c.has(a.application.id)&&b(n,`Packaging declares application id ${a.application.
|
|
553
|
+
id} twice.`),c.add(a.application.id)}return{version:1,packages:r}}function Un(e,t,n,s){let i=(Array.isArray(e)?e:[]).find(
|
|
554
|
+
r=>r?.name===t);return(!i||typeof i.value!="string"||!i.value.trim())&&b(n,`${s} names ${t}, which ## Environment defaul\
|
|
555
|
+
ts does not declare with a value.`),i.value.trim()}function Fn(e,t=[],n={}){let{path:s="genesis/stack.md#Packaging"}=n;return{
|
|
556
556
|
...e,packages:e.packages.map(i=>{if(i.packer!=="capacitor")return i;let r={...i,deepLinkScheme:null,appLinkDomains:[]};if(i.
|
|
557
|
-
deepLinkSchemeFrom){let o=
|
|
558
|
-
tps","file","content","javascript"].includes(o))&&
|
|
559
|
-
h as \`notes\`.`),r.deepLinkScheme=o}if(i.appLinkDomainsFrom){let o=
|
|
560
|
-
k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!
|
|
561
|
-
se domain names separated by commas or spaces.`),r.appLinkDomains=[...new Set(o)]}return r})}}function
|
|
562
|
-
section:t={}}={}){
|
|
563
|
-
(s=
|
|
564
|
-
status:i,stackHash:t.stackHash,packagingHash:i==="ready"?
|
|
565
|
-
diagnostics:n}}var
|
|
566
|
-
n,s,i,r)}function
|
|
567
|
-
.`,i),e.seen.add(t),e[t]=n}var
|
|
568
|
-
"TMPDIR","USER"]),
|
|
569
|
-
review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${
|
|
570
|
-
"Identity types",`one or more of ${[...
|
|
557
|
+
deepLinkSchemeFrom){let o=Un(t,i.deepLinkSchemeFrom,s,`Package ${i.id} Deep link scheme from`);(!nr.test(o)||["http","ht\
|
|
558
|
+
tps","file","content","javascript"].includes(o))&&b(s,`${i.deepLinkSchemeFrom} must be a custom lowercase URL scheme suc\
|
|
559
|
+
h as \`notes\`.`),r.deepLinkScheme=o}if(i.appLinkDomainsFrom){let o=Un(t,i.appLinkDomainsFrom,s,`Package ${i.id} App lin\
|
|
560
|
+
k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!sr.test(c))&&b(s,`${i.appLinkDomainsFrom} must list lowerca\
|
|
561
|
+
se domain names separated by commas or spaces.`),r.appLinkDomains=[...new Set(o)]}return r})}}function qn({environment:e={},
|
|
562
|
+
section:t={}}={}){j(t,e,"Packaging section");let n=[...t.diagnostics||[]],s={version:1,packages:[]};t.status==="ready"&&
|
|
563
|
+
(s=Fn(Hn(t.lines),e.environmentDefaults));let i=n.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:Ve,
|
|
564
|
+
status:i,stackHash:t.stackHash,packagingHash:i==="ready"?k(s):"",source:t.source||null,version:s.version,packages:s.packages,
|
|
565
|
+
diagnostics:n}}var T="VIBE64_OUTPUTS_INVALID";function h(e,t,n,s={}){m(T,e,t,n,s)}function ft(e,t,n,s,i,r){return y(e.slice(t.length),T,
|
|
566
|
+
n,s,i,r)}function G(e,t,n,s,i){return ft(e,t,n,s,i,{count:1})[0]}function D(e,t,n,s,i,r){e.seen.has(t)&&h(s,`Duplicate ${r}\
|
|
567
|
+
.`,i),e.seen.add(t),e[t]=n}var fe="vibe64.preview-identity.command.v1",Er=/^[A-Z_][A-Z0-9_]*$/u,Yn=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
|
|
568
|
+
"TMPDIR","USER"]),Xn=new Set(["email","login","user-id"]),Zn=1e4,Me=3e4,Jn=[["- Command: ","command","Command","`tools/p\
|
|
569
|
+
review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${fe}\``],["- Identity types: ","identityTypes",
|
|
570
|
+
"Identity types",`one or more of ${[...Xn].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
|
|
571
571
|
t","Enabled environment","`ENV_NAME`"],["- Secret environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],
|
|
572
|
-
["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${
|
|
573
|
-
(default ${
|
|
574
|
-
identity ${n} environment name`,s);return(!
|
|
575
|
-
ronment name is invalid.`,s),i}function
|
|
576
|
-
u));i||h(n,
|
|
577
|
-
ypes","runtimes"].includes(o)&&a.length!==1&&h(n,`Preview identity ${c} accepts exactly one value.`,s),
|
|
578
|
-
iew identity ${c} entry`)}function
|
|
579
|
-
s","Identity types"]])e[u]||h(t,`Output target ${n} Preview identity needs ${
|
|
580
|
-
\``).join(" "),i=
|
|
572
|
+
["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${Me}\`\
|
|
573
|
+
(default ${Zn})`]],gt=Jn.map(([e,,,t])=>`${e}${t}`);function Kn(e,t,n,s){if(e===void 0)return"";let i=w(e,T,t,`Preview \
|
|
574
|
+
identity ${n} environment name`,s);return(!Er.test(i)||Yn.has(i)||i.startsWith("XDG_"))&&h(t,`Preview identity ${n} envi\
|
|
575
|
+
ronment name is invalid.`,s),i}function Qn(e){return{seen:new Set,line:e}}function es(e,t,n,s){let i=Jn.find(([u])=>t.startsWith(
|
|
576
|
+
u));i||h(n,v("Preview identity entry",t,gt),s);let[r,o,c]=i,a=ft(t,r,n,`Preview identity ${c}`,s);!["command","identityT\
|
|
577
|
+
ypes","runtimes"].includes(o)&&a.length!==1&&h(n,`Preview identity ${c} accepts exactly one value.`,s),D(e,o,a,n,s,`Prev\
|
|
578
|
+
iew identity ${c} entry`)}function ts(e,t,n){for(let[u,l]of[["command","Command"],["protocol","Protocol"],["identityType\
|
|
579
|
+
s","Identity types"]])e[u]||h(t,`Output target ${n} Preview identity needs ${l}.`,e.line);let s=e.command.map(u=>`\`${u}\
|
|
580
|
+
\``).join(" "),i=N(s,T,t,"Preview identity command",e.line);(!i[0].includes("/")||i[0].includes("\\")||i[0].split("/").some(
|
|
581
581
|
u=>!u||[".",".."].includes(u))||i.some(u=>/\{(?:host|port)\}/u.test(u)))&&h(t,"Preview identity command must use a liter\
|
|
582
|
-
al app-owned project-relative executable.",e.line);let r=e.protocol[0];r!==
|
|
583
|
-
.`,e.line);let o=[...new Set(e.identityTypes.map(u=>(
|
|
584
|
-
o.length!==e.identityTypes.length&&h(t,"Preview identity types must not contain duplicates.",e.line);let c={enabled:
|
|
585
|
-
enabledEnvironment?.[0],t,"enabled",e.line),secret:
|
|
586
|
-
c.secret&&h(t,"Preview identity enabled and secret environment names must differ.",e.line);let a=
|
|
587
|
-
timeoutMs[0];/^[0-9]+$/u.test(u)||h(t,`Preview identity Timeout ms must be from 1 through ${
|
|
588
|
-
isSafeInteger(a)||a<1||a>
|
|
589
|
-
identityTypes:o,protocol:r,runtimes:e.runtimes?
|
|
590
|
-
e.line):[],timeoutMs:a}}var
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
map(t=>`\`${t}\``).join(" or "),
|
|
594
|
-
on","#### Preview identity","#### Download `id`"]),
|
|
595
|
-
|
|
596
|
-
"- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${
|
|
597
|
-
hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:
|
|
598
|
-
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function
|
|
599
|
-
i)||h(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),i}function
|
|
600
|
-
r.replace(
|
|
582
|
+
al app-owned project-relative executable.",e.line);let r=e.protocol[0];r!==fe&&h(t,`Preview identity protocol must be ${fe}\
|
|
583
|
+
.`,e.line);let o=[...new Set(e.identityTypes.map(u=>(Xn.has(u)||h(t,`Unsupported preview identity type: ${u}.`,e.line),u)))];
|
|
584
|
+
o.length!==e.identityTypes.length&&h(t,"Preview identity types must not contain duplicates.",e.line);let c={enabled:Kn(e.
|
|
585
|
+
enabledEnvironment?.[0],t,"enabled",e.line),secret:Kn(e.secretEnvironment?.[0],t,"secret",e.line)};c.enabled&&c.enabled===
|
|
586
|
+
c.secret&&h(t,"Preview identity enabled and secret environment names must differ.",e.line);let a=Zn;if(e.timeoutMs){let u=e.
|
|
587
|
+
timeoutMs[0];/^[0-9]+$/u.test(u)||h(t,`Preview identity Timeout ms must be from 1 through ${Me}.`,e.line),a=Number(u),(!Number.
|
|
588
|
+
isSafeInteger(a)||a<1||a>Me)&&h(t,`Preview identity Timeout ms must be from 1 through ${Me}.`,e.line)}return{command:i,environment:c,
|
|
589
|
+
identityTypes:o,protocol:r,runtimes:e.runtimes?C(e.runtimes.map(u=>`\`${u}\``).join(" "),T,t,"Preview identity runtimes",
|
|
590
|
+
e.line):[],timeoutMs:a}}var br="bucket";function yr(e=""){return e===br}function ns(e={}){return!yr(e.kind)}var vr="vibe64.outputs.v1",Ge="Outputs",Sr=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Et=/\{([a-z][a-z0-9:-]*)\}/gu,wr=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
591
|
+
_r=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,Ir=/^#### Download `([^`\r\n]+)`$/u,Tr=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
|
|
592
|
+
rs=new Set(["finite","interactive"]),bt=new Set(["development","test"]),os=new Set(["terminal","web"]),ss=16,je=e=>[...e].
|
|
593
|
+
map(t=>`\`${t}\``).join(" or "),kr=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
|
|
594
|
+
on","#### Preview identity","#### Download `id`"]),Ue=Object.freeze({target:["- Default.",`- Mode: ${je(rs)}`,`- Data: ${je(
|
|
595
|
+
bt)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
|
|
596
|
+
"- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${je(os)}`,"- Preferred port: `1024` t\
|
|
597
|
+
hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:gt,download:["- Path:\
|
|
598
|
+
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function yt(e,t,n,s){let i=w(e,T,t,n,s);return Sr.test(
|
|
599
|
+
i)||h(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),i}function Or(e,t,n,s){let i=N(e,T,t,n,s);for(let r of i)
|
|
600
|
+
r.replace(Et,"").includes("{parameter:")&&h(t,`${n} has an invalid {parameter:id} placeholder.`,s),[...r.matchAll(Et)].some(
|
|
601
601
|
o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&h(t,`${n} supports only {host}\
|
|
602
|
-
, {port}, and {parameter:id} placeholders.`,s);return i}function
|
|
603
|
-
e[2],
|
|
604
|
-
downloads:[],parameters:[],seen:new Set,line:n}}function
|
|
602
|
+
, {port}, and {parameter:id} placeholders.`,s);return i}function Ar(e,t,n){return{id:yt(e[1],t,"Output target id",n),label:w(
|
|
603
|
+
e[2],T,t,"Output target label",n),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,
|
|
604
|
+
downloads:[],parameters:[],seen:new Set,line:n}}function Rr(e,t,n,s){if(t==="- Required."){D(e,"required",!0,n,s,"Parame\
|
|
605
605
|
ter Required entry");return}for(let[i,r]of[["Default","default"],["Description","description"]]){let o=`- ${i}: `;if(t.startsWith(
|
|
606
|
-
o)){let c=
|
|
607
|
-
s)}function
|
|
606
|
+
o)){let c=G(t,o,n,`Parameter ${i}`,s);D(e,r,c,n,s,`Parameter ${i} entry`);return}}h(n,v("Outputs parameter entry",t,Ue.parameter),
|
|
607
|
+
s)}function Nr(e,t={}){let n=e.parameters||[],s=r=>m("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",r);(!t||typeof t!="obj\
|
|
608
608
|
ect"||Array.isArray(t))&&s("Output parameters must be an object of text values.");let i=new Set(n.map(({id:r})=>r));for(let r of Object.
|
|
609
609
|
keys(t))i.has(r)||s(`Unknown output parameter: ${r}.`);return Object.fromEntries(n.map(r=>{let o=Object.hasOwn(t,r.id)?t[r.
|
|
610
610
|
id]:r.default;return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${r.label} must be a single line of tex\
|
|
611
|
-
t, at most 4096 characters.`),r.required&&!o.trim()&&s(`${r.label} is required.`),[r.id,o]}))}function
|
|
612
|
-
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function
|
|
613
|
-
n),path:"",name:"",mediaType:"",seen:new Set,line:n}}function
|
|
611
|
+
t, at most 4096 characters.`),r.required&&!o.trim()&&s(`${r.label} is required.`),[r.id,o]}))}function Cr(e){return{kind:"",
|
|
612
|
+
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function Dr(e,t,n){return{id:yt(e[1],t,"Download id",
|
|
613
|
+
n),path:"",name:"",mediaType:"",seen:new Set,line:n}}function Pr(e,t,n){/^[0-9]+$/u.test(e)||h(t,"Web presentation prefe\
|
|
614
614
|
rred port must be an integer from 1024 through 65535.",n);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&
|
|
615
|
-
h(t,"Web presentation preferred port must be an integer from 1024 through 65535.",n),s}function
|
|
616
|
-
"- Data: ")){let r=
|
|
617
|
-
e,"dataMode",r,n,s,"output target Data entry");return}if(t==="- Default."){
|
|
618
|
-
ntry");return}if(t.startsWith("- Mode: ")){let r=
|
|
619
|
-
Mode must be `interactive` or `finite`.",s),
|
|
620
|
-
ir: ")){
|
|
621
|
-
Workdir entry");return}if(t.startsWith("- Runtimes: ")){
|
|
615
|
+
h(t,"Web presentation preferred port must be an integer from 1024 through 65535.",n),s}function $r(e,t,n,s){if(t.startsWith(
|
|
616
|
+
"- Data: ")){let r=G(t,"- Data: ",n,"Output target Data",s);bt.has(r)||h(n,`Output target Data must be ${je(bt)}.`,s),D(
|
|
617
|
+
e,"dataMode",r,n,s,"output target Data entry");return}if(t==="- Default."){D(e,"default",!0,n,s,"output target Default e\
|
|
618
|
+
ntry");return}if(t.startsWith("- Mode: ")){let r=G(t,"- Mode: ",n,"Output target Mode",s);rs.has(r)||h(n,"Output target \
|
|
619
|
+
Mode must be `interactive` or `finite`.",s),D(e,"mode",r,n,s,"output target Mode entry");return}if(t.startsWith("- Workd\
|
|
620
|
+
ir: ")){D(e,"workdir",S(G(t,"- Workdir: ",n,"Output target Workdir",s),T,n,"Output target workdir",s),n,s,"output target\
|
|
621
|
+
Workdir entry");return}if(t.startsWith("- Runtimes: ")){D(e,"runtimeRequirements",C(t.slice(12),T,n,"Output target runt\
|
|
622
622
|
imes",s),n,s,"output target Runtimes entry");return}let i=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(i){
|
|
623
|
-
let r=i[1].toLowerCase(),o=
|
|
624
|
-
nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:
|
|
625
|
-
label",s),argv:o,role:r});return}h(n,
|
|
626
|
-
if(t.startsWith("- Kind: ")){let i=
|
|
627
|
-
rminal` or `web`.",s),
|
|
628
|
-
ferredPort",
|
|
629
|
-
ry");return}if(t.startsWith("- URL path: ")){
|
|
630
|
-
eb presentation URL path",s),n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){
|
|
631
|
-
|
|
632
|
-
s)}function
|
|
633
|
-
s.trim()!==s)&&h(t,"Download Name must be a safe filename without path separators.",n),s}function
|
|
634
|
-
t,"Download Media type",n);return(s.length>127||!
|
|
635
|
-
value.",n),s}function
|
|
636
|
-
nload path",s,{allowRoot:!1}),n,s,"Download Path entry");return}if(t.startsWith("- Name: ")){
|
|
637
|
-
n,"Download Name",s),n,s),n,s,"Download Name entry");return}if(t.startsWith("- Media type: ")){
|
|
638
|
-
Media type: ",n,"Download Media type",s),n,s),n,s,"Download Media type entry");return}h(n,
|
|
639
|
-
s)}function
|
|
640
|
-
t ${n} Download ${e.id} needs ${i}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function
|
|
623
|
+
let r=i[1].toLowerCase(),o=Or(i[3],n,"Output step command",s);r!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&h(n,"O\
|
|
624
|
+
nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:w(i[2],T,n,"Output step\
|
|
625
|
+
label",s),argv:o,role:r});return}h(n,v("Outputs target entry",t,[...Ue.target,...kr.slice(1)]),s)}function Lr(e,t,n,s){
|
|
626
|
+
if(t.startsWith("- Kind: ")){let i=G(t,"- Kind: ",n,"Presentation Kind",s);os.has(i)||h(n,"Presentation Kind must be `te\
|
|
627
|
+
rminal` or `web`.",s),D(e,"kind",i,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){D(e,"pre\
|
|
628
|
+
ferredPort",Pr(G(t,"- Preferred port: ",n,"Web presentation Preferred port",s),n,s),n,s,"Presentation Preferred port ent\
|
|
629
|
+
ry");return}if(t.startsWith("- URL path: ")){D(e,"urlPath",et(G(t,"- URL path: ",n,"Web presentation URL path",s),T,n,"W\
|
|
630
|
+
eb presentation URL path",s),n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){D(e,"readiness",
|
|
631
|
+
ce(t,T,n,"Web presentation readiness",s),n,s,"Presentation Ready when entry");return}h(n,v("Presentation entry",t,Ue.presentation),
|
|
632
|
+
s)}function xr(e,t,n){let s=w(e,T,t,"Download Name",n);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
|
|
633
|
+
s.trim()!==s)&&h(t,"Download Name must be a safe filename without path separators.",n),s}function Vr(e,t,n){let s=w(e,T,
|
|
634
|
+
t,"Download Media type",n);return(s.length>127||!Tr.test(s))&&h(t,"Download Media type must be a lowercase type/subtype \
|
|
635
|
+
value.",n),s}function Mr(e,t,n,s){if(t.startsWith("- Path: ")){D(e,"path",S(G(t,"- Path: ",n,"Download Path",s),T,n,"Dow\
|
|
636
|
+
nload path",s,{allowRoot:!1}),n,s,"Download Path entry");return}if(t.startsWith("- Name: ")){D(e,"name",xr(G(t,"- Name: ",
|
|
637
|
+
n,"Download Name",s),n,s),n,s,"Download Name entry");return}if(t.startsWith("- Media type: ")){D(e,"mediaType",Vr(G(t,"-\
|
|
638
|
+
Media type: ",n,"Download Media type",s),n,s),n,s,"Download Media type entry");return}h(n,v("Download entry",t,Ue.download),
|
|
639
|
+
s)}function jr(e,t,n){for(let[s,i]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(t,`Output targe\
|
|
640
|
+
t ${n} Download ${e.id} needs ${i}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Gr(e,t,n){
|
|
641
641
|
return e.kind||h(t,`Output target ${n} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
|
|
642
642
|
readiness||e.seen.has("urlPath"))&&h(t,`Output target ${n} terminal Presentation accepts only Kind.`,e.line),{kind:"term\
|
|
643
643
|
inal"}):(e.readiness||h(t,`Output target ${n} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.
|
|
644
|
-
preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function
|
|
644
|
+
preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function is(e,t){e.mode||h(t,`Output target ${e.id} needs one Mo\
|
|
645
645
|
de entry.`,e.line),e.steps.length===0&&h(t,`Output target ${e.id} needs at least one step.`,e.line);let n={prepare:0,build:1,
|
|
646
646
|
run:2};for(let u=1;u<e.steps.length;u+=1)n[e.steps[u].role]<n[e.steps[u-1].role]&&h(t,`Output target ${e.id} steps must \
|
|
647
|
-
be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),i=e.downloads.map(u=>
|
|
647
|
+
be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),i=e.downloads.map(u=>jr(u,t,e.
|
|
648
648
|
id));new Set(i.map(({id:u})=>u)).size!==i.length&&h(t,`Output target ${e.id} contains a duplicate Download id.`,e.line),
|
|
649
649
|
e.mode==="finite"?((s.length>0||e.presentation||e.previewIdentity)&&h(t,`Finite output target ${e.id} cannot have Run, P\
|
|
650
650
|
resentation, or Preview identity entries.`,e.line),i.length===0&&h(t,`Finite output target ${e.id} needs at least one Do\
|
|
651
651
|
wnload.`,e.line)):s.length!==1||e.steps.at(-1).role!=="run"?h(t,`Interactive output target ${e.id} needs exactly one fin\
|
|
652
652
|
al Run step.`,e.line):e.presentation||h(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let r=e.presentation?
|
|
653
|
-
|
|
653
|
+
Gr(e.presentation,t,e.id):null,o=e.steps.flatMap(({argv:u})=>u.flatMap(l=>[...l.matchAll(Et)].map(d=>d[1])));o.some(u=>[
|
|
654
654
|
"host","port"].includes(u))&&r?.kind!=="web"&&h(t,"Only a web output target may use {host} or {port} placeholders.",e.line);
|
|
655
|
-
let c=e.parameters.map(({seen:u,...
|
|
656
|
-
arget ${e.id} may declare at most ${
|
|
657
|
-
meter:"))){let
|
|
655
|
+
let c=e.parameters.map(({seen:u,...l})=>l),a=new Set(c.map(({id:u})=>u));(c.length>ss||a.size!==c.length)&&h(t,`Output t\
|
|
656
|
+
arget ${e.id} may declare at most ${ss} parameters with unique ids.`,e.line);for(let u of o.filter(l=>l.startsWith("para\
|
|
657
|
+
meter:"))){let l=u.slice(10);a.has(l)||h(t,`Undeclared output parameter: ${l}.`,e.line)}for(let u of c)o.includes(`param\
|
|
658
658
|
eter:${u.id}`)||h(t,`Output parameter ${u.id} must be used in a step command.`,e.line);return e.previewIdentity&&r?.kind!==
|
|
659
659
|
"web"&&h(t,"Only a web output target may declare Preview identity.",e.line),{id:e.id,label:e.label,default:e.default,mode:e.
|
|
660
660
|
mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:r,
|
|
661
|
-
downloads:i,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:
|
|
661
|
+
downloads:i,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:ts(e.previewIdentity,t,e.id)}:{}}}function Be(e,t={}){
|
|
662
662
|
let{path:n="genesis/stack.md#Outputs"}=t;if(Array.isArray(e)||h(n,"Outputs must be supplied as exact Stack section lines\
|
|
663
|
-
."),
|
|
664
|
-
continue;let
|
|
665
|
-
begin with a Target heading.",
|
|
666
|
-
ter label",
|
|
667
|
-
"#### Presentation"){i.presentation&&h(n,"Presentation must appear at most once below an output target.",
|
|
668
|
-
|
|
669
|
-
y must appear at most once below an output target.",
|
|
670
|
-
let g=u.match(
|
|
671
|
-
resentation"?
|
|
663
|
+
."),_(e))return{version:1,targets:[]};let s=[],i=null,r="target",o=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)
|
|
664
|
+
continue;let l=a+1,d=u.match(wr);if(d){i&&s.push(is(i,n)),i=Ar(d,n,l),r="target",o=null;continue}i||h(n,"## Outputs must\
|
|
665
|
+
begin with a Target heading.",l);let p=u.match(_r);if(p){let E={id:yt(p[1],n,"Parameter id",l),label:w(p[2],T,n,"Parame\
|
|
666
|
+
ter label",l),default:"",description:"",required:!1,seen:new Set};i.parameters.push(E),r="parameter",o=E;continue}if(u===
|
|
667
|
+
"#### Presentation"){i.presentation&&h(n,"Presentation must appear at most once below an output target.",l),i.presentation=
|
|
668
|
+
Cr(l),r="presentation",o=i.presentation;continue}if(u==="#### Preview identity"){i.previewIdentity&&h(n,"Preview identit\
|
|
669
|
+
y must appear at most once below an output target.",l),i.previewIdentity=Qn(l),r="previewIdentity",o=i.previewIdentity;continue}
|
|
670
|
+
let g=u.match(Ir);if(g){let E=Dr(g,n,l);i.downloads.push(E),r="download",o=E;continue}r==="parameter"?Rr(o,u,n,l):r==="p\
|
|
671
|
+
resentation"?Lr(o,u,n,l):r==="previewIdentity"?es(o,u,n,l):r==="download"?Mr(o,u,n,l):$r(i,u,n,l)}i&&s.push(is(i,n)),s.length===
|
|
672
672
|
0&&h(n,"## Outputs needs at least one Target or exactly `- Nothing.`.");let c=s.map(({id:a})=>a);return new Set(c).size!==
|
|
673
673
|
c.length&&h(n,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(n,"Outputs may declare a\
|
|
674
|
-
t most one default target."),{version:1,targets:s}}function
|
|
674
|
+
t most one default target."),{version:1,targets:s}}function Ur(e,t={}){let{resourcesPreparing:n=!1}=t,s=e.details||{},i=Array.
|
|
675
675
|
isArray(s.missing)?s.missing:[],r=(Array.isArray(s.alternatives)?s.alternatives:[]).map((c,a)=>Array.isArray(i[a])&&i[a].
|
|
676
676
|
length?i[a].join(" and "):String(c)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!r.length)return e.message;let o=String(
|
|
677
677
|
s.resource||"").trim()||"resources";return n?`Vibe64 is still setting up this app's ${o}. Preview can start when workspa\
|
|
678
678
|
ce setup finishes; then press Check again.`:`This app needs its ${o} before Preview can start: set ${r.join(", or ")} in\
|
|
679
|
-
Env (in Dash, under Development), then press Check again.`}function
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
679
|
+
Env (in Dash, under Development), then press Check again.`}function Br(e={}){let t=new Set((e.resources||[]).filter(n=>n?.
|
|
680
|
+
resource&&!ns(n.resource)).map(n=>n.resource.id));return(e.diagnostics||[]).filter(n=>!(n?.code==="STACK_RESOURCE_MISSIN\
|
|
681
|
+
G"&&t.has(n.details?.resource)))}function as({environment:e={},section:t={},resourcesPreparing:n=!1}={}){j(t,e,"Outputs \
|
|
682
|
+
section");let s=[...t.diagnostics||[]],i=Br(e),r={version:1,targets:[]};t.status==="ready"&&(r=Be(t.lines));let o=i.length===
|
|
683
|
+
0?null:[...new Set(i.map(l=>Ur(l,{resourcesPreparing:n})))].join(" "),c=r.targets.map(l=>({...l,source:t.source||null,available:s.
|
|
684
|
+
length===0&&i.length===0,disabledReason:o})),a=[...s,...i],u="ready";return a.length>0?u="blocked":c.length===0&&(u="unc\
|
|
685
|
+
onfigured"),{contract:vr,status:u,stackHash:t.stackHash,components:[...t.components||[]],environmentDefaults:structuredClone(
|
|
686
|
+
e.environmentDefaults||[]),runtimeRequirements:H(c.flatMap(l=>l.runtimeRequirements)),resources:structuredClone(e.resources||
|
|
687
|
+
[]),targets:c,diagnostics:a}}var cs="Project services",Wr="vibe64.project-services.v1",se="VIBE64_PROJECT_SERVICES_INVALID",ie="genesis/stack.md#Proj\
|
|
688
|
+
ect services",zr="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function us(e){
|
|
689
|
+
if(Array.isArray(e)||m(se,ie,"Expected exact Project services section lines."),_(e))return[];let t=[];for(let[n,s]of e.entries()){
|
|
688
690
|
let i=s.trim();if(!i)continue;let r=n+1,o=i.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
|
|
689
|
-
o||m(se,ie,`Use: ${
|
|
690
|
-
t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:
|
|
691
|
-
".",se,ie,"Service workdir",r),argv:
|
|
692
|
-
xactly `- Nothing.`."),t}function
|
|
693
|
-
"blocked"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
{
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
[]
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
e,t
|
|
714
|
-
|
|
691
|
+
o||m(se,ie,`Use: ${zr}`,r),t.some(({id:a})=>a===o[1])&&m(se,ie,"Duplicate project service id.",r);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
|
|
692
|
+
t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:C(c?c[1]:o[3],se,ie,"Service runtimes",r),workdir:S(c?.[2]||
|
|
693
|
+
".",se,ie,"Service workdir",r),argv:N(o[4],se,ie,"Service command",r)})}return t.length||m(se,ie,"Declare a service or e\
|
|
694
|
+
xactly `- Nothing.`."),t}function ls(e={}){let t=e.status==="ready"?us(e.lines):[];return{contract:Wr,status:e.status===
|
|
695
|
+
"blocked"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?k(t):"",diagnostics:e.diagnostics||[]}}var ms="vibe64.staging-data.v1",It="Staging data",ge="VIBE64_STAGING_DATA_INVALID",hs="genesis/stack.md#Staging data",de=Object.
|
|
696
|
+
freeze({"own copy, empty":"empty","own copy, full":"full","own copy, sampled":"sampled","shared with production":"shared",
|
|
697
|
+
"shared with production, structure frozen":"frozen"}),Hr=Object.freeze(Object.fromEntries(Object.entries(de).map(([e,t])=>[
|
|
698
|
+
t,e]))),Fr=Object.freeze({empty:Object.freeze({source:!1,unlisted:!1,sampling:!1,contacts:!1}),full:Object.freeze({source:!0,
|
|
699
|
+
unlisted:!1,sampling:!1,contacts:!0}),sampled:Object.freeze({source:!0,unlisted:!0,sampling:!0,contacts:!0}),shared:Object.
|
|
700
|
+
freeze({source:!1,unlisted:!1,sampling:!1,contacts:!1}),frozen:Object.freeze({source:!1,unlisted:!1,sampling:!1,contacts:!1})}),
|
|
701
|
+
qr=Object.freeze({empty:"Staging's own database starts empty",full:"a whole copy keeps every row",shared:"Staging uses p\
|
|
702
|
+
roduction's database itself",frozen:"Staging uses production's database itself"}),ps=Object.freeze(["mysql","postgresql"]),
|
|
703
|
+
We="{dump}",ds=/\{[A-Za-z][A-Za-z0-9_:-]*\}/u,fs=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/u,vt=Object.freeze({unlistedRows:Object.
|
|
704
|
+
freeze([1,1e7]),days:Object.freeze([1,36500]),rows:Object.freeze([1,1e8])}),Kr=/^dump written by command with (.+?) in `([^`\r\n]+)`: (.+)$/u,
|
|
705
|
+
Yr=/^all up to `([^`\r\n]*)` rows$/u,Tt=/^- `([^`\r\n]*)`: (.+)$/u,Xr=/^recent by `([^`\r\n]*)`(?:, last `([^`\r\n]*)` days)?(?:, newest `([^`\r\n]*)` rows)?$/u,
|
|
706
|
+
gs=/^- `([^`\r\n]*)` to `([^`\r\n]*)`$/u,Es=/^- `([^`\r\n]*)` keeps every `([^`\r\n]*)` row by `([^`\r\n]*)`$/u,Zr=Object.
|
|
707
|
+
freeze(["email","phone"]),kt="- Nothing.",bs=Object.freeze(Object.keys(de).map(e=>`- Mode: ${e}`)),ze="- Source: dump wr\
|
|
708
|
+
itten by command with `runtime` in `workdir`: `command` `argument`... `{dump}`",Ot="- Unlisted tables: all up to `n` row\
|
|
709
|
+
s",q=Object.freeze({section:Object.freeze(["- Database: `resource`",...bs,ze,Ot]),tables:Object.freeze(["- `table`: all",
|
|
710
|
+
"- `table`: none","- `table`: recent by `column`, last `n` days","- `table`: recent by `column`, newest `n` rows","- `ta\
|
|
711
|
+
ble`: recent by `column`, last `n` days, newest `n` rows"]),links:Object.freeze(["- `table.column` to `table.column`"]),
|
|
712
|
+
keepTogether:Object.freeze(["- `parent` keeps every `child` row by `column`"]),contacts:Object.freeze(["- `table.column`\
|
|
713
|
+
: email","- `table.column`: phone",kt])}),At=new Map([["### Tables","tables"],["### Links","links"],["### Keep together",
|
|
714
|
+
"keepTogether"],["### Contacts","contacts"]]),Jr=Object.freeze([...At.keys()]),St=Object.freeze(Object.fromEntries([...At].
|
|
715
|
+
map(([e,t])=>[t,e]))),Qr=Object.freeze({tables:"table rule",links:"link",keepTogether:"Keep together entry",contacts:"co\
|
|
716
|
+
ntact"});function eo(e,t,n){let[s]=y(t,ge,e.location,"Staging data Database",n,{count:1});Ie.test(s)||e.fail(`Database n\
|
|
717
|
+
ames a database resource of genesis/stack.md's ## Resources by its id, such as \`database\`; ${JSON.stringify(s)} isn't \
|
|
718
|
+
one.`,n),e.model.database=s}function to(e,t,n){Object.hasOwn(de,t)||e.fail(v("Staging data Mode",t,Object.keys(de)),n),e.
|
|
719
|
+
model.mode=de[t]}function no(e,t,n){let s=t.find(o=>o!==We&&o.includes(We));s&&e.fail(`Source passes \`{dump}\` inside \`${s}\
|
|
720
|
+
\`: give it as an argument of its own, such as \`--output\` \`{dump}\`.`,n);let i=t.find(o=>o!==We&&ds.test(o));i&&e.fail(
|
|
721
|
+
`Source has the placeholder \`${i.match(ds)[0]}\`; \`{dump}\` is its only one.`,n);let r=t.filter(o=>o===We).length;r!==
|
|
722
|
+
1&&e.fail(r?`Source passes \`{dump}\` ${r} times; its command writes one dump, so pass it once.`:`Source's command must \
|
|
723
|
+
pass \`{dump}\`, the file it writes production's dump to, as an argument of its own. Use: ${ze}`,n)}function so(e,t,n){let s=t.
|
|
724
|
+
match(Kr);s||e.fail(`Staging data Source must use: ${ze}`,n);let i=N(s[3],ge,e.location,"Staging data Source command",n);
|
|
725
|
+
no(e,i,n),e.model.dumpSource={argv:i,workdir:S(s[2],ge,e.location,"Staging data Source workdir",n),runtimeRequirements:C(
|
|
726
|
+
s[1],ge,e.location,"Staging data Source runtimes",n)}}function wt(e,t,[n,s],i,r){let o=/^[1-9][0-9]*$/u.test(t)?Number(t):
|
|
727
|
+
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 io(e,t,n){
|
|
728
|
+
let s=t.match(Yr);s||e.fail(`Staging data Unlisted tables must use: ${Ot}`,n),e.model.unlistedTables={maxRows:wt(e,s[1],
|
|
729
|
+
vt.unlistedRows,"Unlisted tables' rows",n)}}var ro=Object.freeze([{prefix:"- Database: ",key:"database",label:"Database",
|
|
730
|
+
read:eo},{prefix:"- Mode: ",key:"mode",label:"Mode",read:to},{prefix:"- Source: ",key:"source",label:"Source",read:so},{
|
|
731
|
+
prefix:"- Unlisted tables: ",key:"unlisted",label:"Unlisted tables",read:io}]);function oo(e){if(e===kt)return"";if(Es.test(
|
|
732
|
+
e))return"keepTogether";if(gs.test(e))return"links";let t=e.match(Tt);return t?t[1].includes(".")?"contacts":"tables":""}
|
|
733
|
+
function ao(e,t,n){let s=ro.find(({prefix:i})=>t.startsWith(i));if(!s){let i=oo(t);e.fail(i?`\`${t}\` is a ${Qr[i]}: put\
|
|
734
|
+
it under \`${St[i]}\`, after the section's own entries.`:v("Staging data entry",t,q.section),n)}e.at[s.key]&&e.fail(`St\
|
|
735
|
+
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.
|
|
736
|
+
length),n)}function Ee(e,t,n,s){return fs.test(t)||e.fail(`\`${t}\` isn't a ${n} name: use up to 64 letters, digits and \
|
|
737
|
+
_, starting with a letter or _.`,s),t}function _t(e,t,n){let s=t.split(".");return(s.length!==2||!s.every(i=>fs.test(i)))&&
|
|
738
|
+
e.fail(`\`${t}\` isn't a column: name it \`table.column\`, each up to 64 letters, digits and _, starting with a letter or _\
|
|
739
|
+
.`,n),{table:s[0],column:s[1]}}function He(e,t,n,s,i){e.named[t].has(n)&&e.fail(s,i),e.named[t].add(n)}function co(e,t,n){
|
|
740
|
+
if(t==="all"||t==="none")return{rule:t};let s=t.match(Xr);return s||e.fail(`Unknown table rule: ${t}. Use one of: ${q.tables.
|
|
741
|
+
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\
|
|
742
|
+
west `n` rows, or both: add `, last `n` days`, `, newest `n` rows` or both, in that order.",n),{rule:"recent",by:Ee(e,s[1],
|
|
743
|
+
"column",n),days:s[2]===void 0?null:wt(e,s[2],vt.days,"A recent rule's days",n),rows:s[3]===void 0?null:wt(e,s[3],vt.rows,
|
|
744
|
+
"A recent rule's rows",n)}}function uo(e,t,n){let s=t.match(Tt);s||e.fail(v("Staging data table rule",t,q.tables),n);let i=Ee(
|
|
745
|
+
e,s[1],"table",n);He(e,"tables",i,`### Tables names \`${i}\` twice; give each table one rule.`,n),e.model.tables.push({table:i,
|
|
746
|
+
...co(e,s[2],n)})}function lo(e,t,n){let s=t.match(gs);s||e.fail(v("Staging data link",t,q.links),n);let i=_t(e,s[1],n),
|
|
747
|
+
r=_t(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),He(
|
|
748
|
+
e,"links",s[1],`### Links links \`${s[1]}\` twice; a column refers to one column.`,n),e.model.links.push({from:i,to:r})}
|
|
749
|
+
function po(e,t,n){let s=t.match(Es);s||e.fail(v("Staging data Keep together entry",t,q.keepTogether),n);let i=Ee(e,s[1],
|
|
750
|
+
"table",n),r=Ee(e,s[2],"table",n),o=Ee(e,s[3],"column",n);i===r&&e.fail(`\`${i}\` keeps its own rows; Keep together names\
|
|
751
|
+
a parent table and another table whose rows refer to it.`,n),He(e,"keepTogether",`${r}.${o}`,`### Keep together keeps \`${r}\
|
|
752
|
+
\` rows by \`${o}\` twice; name each once.`,n),e.model.keepTogether.push({parent:i,child:r,column:o})}function mo(e,t,n){
|
|
753
|
+
if(t===kt){e.entries.contacts>0&&e.fail("`- Nothing.` under ### Contacts says no column holds one, so it is the heading'\
|
|
754
|
+
s only entry.",n),e.contactsNothing=n;return}e.contactsNothing&&e.fail(`### Contacts says \`- Nothing.\` on line ${e.contactsNothing}\
|
|
755
|
+
: remove it, or this contact.`,n);let s=t.match(Tt);s||e.fail(v("Staging data contact",t,q.contacts),n);let{table:i,column:r}=_t(
|
|
756
|
+
e,s[1],n);Zr.includes(s[2])||e.fail(`Contact \`${s[1]}\` is an \`email\` or a \`phone\` column, written without backticks: ${q.
|
|
757
|
+
contacts.slice(0,2).join(" or ")}.`,n),He(e,"contacts",s[1],`### Contacts names \`${s[1]}\` twice; name each column once.`,
|
|
758
|
+
n),e.model.contacts.push({table:i,column:r,kind:s[2]})}var ho=Object.freeze({tables:uo,links:lo,keepTogether:po,contacts:mo});
|
|
759
|
+
function fo(e,t,n){let s=At.get(t);return s||e.fail(v("Staging data heading",t,Jr),n),e.at[s]&&e.fail(`Staging data has \
|
|
760
|
+
a second \`${t}\` heading; the first is on line ${e.at[s]}.`,n),e.at[s]=n,s}function go(e,t,n,s){let{at:i,fail:r}=e;n.source&&
|
|
761
|
+
!i.source&&r(`Mode ${t} builds Staging's own database from a dump of production's: add ${ze}`,i.mode),!n.source&&i.source&&
|
|
762
|
+
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\
|
|
763
|
+
list may have: add ${Ot}`,i.mode),!n.unlisted&&i.unlisted&&r(`Mode ${t} has no Unlisted tables: ${s}; only a sampled co\
|
|
764
|
+
py lists its tables.`,i.unlisted)}function Eo(e,t,n,s){let{at:i,entries:r,fail:o}=e;for(let c of["tables","links","keepT\
|
|
765
|
+
ogether"])!n.sampling&&i[c]&&o(`Mode ${t} has no \`${St[c]}\`: ${s}; only own copy, sampled samples its tables.`,i[c]),i[c]&&
|
|
766
|
+
r[c]===0&&o(`\`${St[c]}\` has no entries: add one (${q[c][0]}) or remove the heading.`,i[c]);n.sampling&&!i.tables&&o(`M\
|
|
767
|
+
ode ${t} samples production's tables: add \`### Tables\` with a rule for at least one table.`,i.mode),n.contacts&&!i.contacts&&
|
|
768
|
+
o(`Mode ${t} copies production's data, which holds people's email addresses and phone numbers: add \`### Contacts\` naming\
|
|
769
|
+
each column that holds one, or \`- Nothing.\` under it when none does.`,i.mode),!n.contacts&&i.contacts&&o(`Mode ${t} h\
|
|
770
|
+
as no \`### Contacts\`: ${s}, so there is nothing to replace.`,i.contacts),i.contacts&&r.contacts===0&&!e.contactsNothing&&
|
|
771
|
+
o("`### Contacts` has no entries: name each column that holds an email address or phone number, or write `- Nothing.` wh\
|
|
772
|
+
en none does.",i.contacts)}function bo(e,t){e.at.database||e.fail("Staging data needs `- Database: `resource``, naming t\
|
|
773
|
+
he database resource of genesis/stack.md's ## Resources whose Staging data it declares.",t),e.at.mode||e.fail(`Staging d\
|
|
774
|
+
ata needs a Mode. Use one of: ${bs.join("; ")}.`,t);let n=Hr[e.model.mode],s=Fr[e.model.mode],i=qr[e.model.mode]||"";go(
|
|
775
|
+
e,n,s,i),Eo(e,n,s,i)}function ys(e,t){let n=(o,c)=>m(ge,t,o,c||void 0);Array.isArray(e)||n("Staging data requires exact \
|
|
776
|
+
Stack section lines.");let s=e.findIndex(o=>typeof o=="string"&&o.trim())+1;_(e)&&n("`- Nothing.` declares no Staging da\
|
|
777
|
+
ta: declare a mode (`- Database: `database`` and `- Mode: own copy, empty` at least), or remove the section, which gives\
|
|
778
|
+
Staging its own empty database.",s);let i={location:t,fail:n,model:{database:"",mode:"",dumpSource:null,unlistedTables:null,
|
|
779
|
+
tables:[],links:[],keepTogether:[],contacts:[]},at:{},entries:{tables:0,links:0,keepTogether:0,contacts:0},named:{tables:new Set,
|
|
780
|
+
links:new Set,keepTogether:new Set,contacts:new Set},contactsNothing:0},r="";for(let[o,c]of e.entries()){let a=String(c).
|
|
781
|
+
trim();if(!a)continue;let u=o+1;a.startsWith("#")?r=fo(i,a,u):r?(ho[r](i,a,u),i.entries[r]+=1):ao(i,a,u)}return bo(i,s),
|
|
782
|
+
i}function yo(e,t={}){let{path:n=hs}=t;return ys(e,n).model}function vo(e,t){let n=Te(t),{database:s}=e.model,i=[...n.values()].
|
|
783
|
+
filter(c=>ps.includes(c.kind)).map(({id:c})=>`\`${c}\``),r=i.length?`name one of its databases: ${i.join(", ")}`:"it dec\
|
|
784
|
+
lares no `mysql` or `postgresql` database; add one to the Stack, or remove the section",o=n.get(s);return o||e.fail(`Dat\
|
|
785
|
+
abase \`${s}\`: genesis/stack.md's ## Resources declares no resource \`${s}\`; ${r}.`,e.at.database),ps.includes(o.kind)||
|
|
786
|
+
e.fail(`Database \`${s}\` is a ${o.kind} resource, and Staging data is for a \`mysql\` or \`postgresql\` database; ${r}.`,
|
|
787
|
+
e.at.database),o.kind}function Rt({environment:e={},section:t={}}={}){j(t,e,"Staging data section");let n=[...t.diagnostics||
|
|
788
|
+
[]],s=t.status==="ready"&&n.length===0?ys(t.lines,hs):null,i=s?.model,r={database:i?.database||"",engine:s?vo(s,e.resources):
|
|
789
|
+
"",mode:i?.mode||"empty",dumpSource:i?.dumpSource||null,unlistedTables:i?.unlistedTables||null,tables:i?.tables||[],links:i?.
|
|
790
|
+
links||[],keepTogether:i?.keepTogether||[],contacts:i?.contacts||[]};return{contract:ms,status:n.length>0?"blocked":s?"r\
|
|
791
|
+
eady":"unconfigured",stackHash:t.stackHash,recipeHash:s?k({version:1,...r}):"",source:t.source||null,components:[...t.components||
|
|
792
|
+
[]],diagnostics:n,...r}}import{access as So}from"node:fs/promises";import Ss from"node:path";var wo="vibe64.workspace-setup.v1",be="Workspace setup",Fe="VIBE64_WORKSPACE_SETUP_INVALID",vs="- Prepare `label` [from \
|
|
793
|
+
`path`...] with `runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",_o=/^- Prepare `([^`\r\n]+)` (.+)$/u,
|
|
794
|
+
Io=/^from ((?:`[^`\r\n]+`[ \t]+)+)(with .+)$/u;function Nt(e,t,n,s={}){m(Fe,e,t,n,s)}function qe(e,t={}){let{path:n="gen\
|
|
795
|
+
esis/stack.md#Workspace setup"}=t;if(Array.isArray(e)||Nt(n,"Workspace setup must be supplied as exact Stack section lin\
|
|
796
|
+
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(_o),a=c?.[2].
|
|
797
|
+
match(Io);(!c||c[2].startsWith("from ")&&!a)&&Nt(n,`Every Workspace setup entry must use: ${vs}`,o,{observed:r}),s.push(
|
|
798
|
+
{label:w(c[1],Fe,n,"Workspace setup step label",o),...a?{inputs:we(a[1].trimEnd(),Fe,n,"Workspace setup inputs",o)}:{},..._e(
|
|
799
|
+
a?a[2]:c[2],Fe,n,"Workspace setup",o,{form:vs,observed:r})})}return s.length===0&&Nt(n,"## Workspace setup needs at leas\
|
|
800
|
+
t one Prepare entry or exactly `- Nothing.`."),s}async function To(e,t){try{return await So(Ss.join(e,t)),!0}catch(n){if([
|
|
801
|
+
"ENOENT","ENOTDIR"].includes(n?.code))return!1;throw n}}async function ws({projectRoot:e,section:t={}}={}){let n=[...t.diagnostics||
|
|
802
|
+
[]],s=[];t.status==="ready"&&(s=qe(t.lines));let i=[],r=[],o=Ss.resolve(e);if(n.length===0)for(let p of s){if(!p.condition||
|
|
803
|
+
await To(o,p.condition.pathExists)){i.push(p);continue}p.condition.onMissing==="wait"&&r.push(p.condition.pathExists)}if(r.
|
|
804
|
+
length>0){let p=H(r);n.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting for project ${p.length===
|
|
805
|
+
1?"path":"paths"}: ${p.join(", ")}.`,details:{paths:p}})}let c=n.some(({code:p})=>p==="VIBE64_WORKSPACE_SETUP_WAITING"),
|
|
806
|
+
a=n.some(({code:p})=>p!=="VIBE64_WORKSPACE_SETUP_WAITING"),u="unconfigured";a?u="blocked":!c&&i.length>0&&(u="ready");let l=i.
|
|
807
|
+
map(({condition:p,...g})=>g),d={version:1,steps:l};return{contract:wo,status:u,stackHash:t.stackHash,recipeHash:u==="rea\
|
|
808
|
+
dy"?k(d):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:H(l.flatMap(p=>p.runtimeRequirements)),
|
|
809
|
+
steps:l,diagnostics:n}}var ko="vibe64.resource-estimates.v1",Ke="Resource estimates",Ts="VIBE64_RESOURCE_ESTIMATES_INVALID",Oo=1024*1024,_s=1024*
|
|
810
|
+
1024,Is=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
|
|
811
|
+
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function U(e,t,n){m(Ts,
|
|
812
|
+
e,t,n)}function Ct(e,t,n,s,i){let r=e.get(t),o=e.get(n);return(r===void 0||o===void 0||r>o)&&U(s,"Each resource phase re\
|
|
813
|
+
quires typical and high estimates, with typical no greater than high.",i),{typicalBytes:r,highBytes:o}}function ks(e,t={}){
|
|
715
814
|
let{path:n="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:i=!1}=t;(!Array.isArray(e)||e.length>2048||
|
|
716
|
-
e.some(
|
|
717
|
-
`),"utf8")>64*1024)&&
|
|
718
|
-
outputs:[],workspaceSetup:null};if(
|
|
719
|
-
let{targetId:
|
|
720
|
-
ts require separate Startup and Running estimates.",g),r.outputs.push({targetId:
|
|
721
|
-
startupHigh",n,g),running:
|
|
722
|
-
|
|
723
|
-
outputs.push({targetId:
|
|
815
|
+
e.some(l=>typeof l!="string")||Buffer.byteLength(e.join(`
|
|
816
|
+
`),"utf8")>64*1024)&&U(n,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let r={version:1,
|
|
817
|
+
outputs:[],workspaceSetup:null};if(_(e))return r;let o=new Map(s.map(l=>[l.id,l])),c=new Set,a=null;function u(){if(!a)return;
|
|
818
|
+
let{targetId:l,mode:d,fields:p,line:g}=a;if(d==="interactive"){(p.has("typical")||p.has("high"))&&U(n,"Interactive outpu\
|
|
819
|
+
ts require separate Startup and Running estimates.",g),r.outputs.push({targetId:l,mode:d,startup:Ct(p,"startupTypical","\
|
|
820
|
+
startupHigh",n,g),running:Ct(p,"runningTypical","runningHigh",n,g)});return}(p.size!==2||!p.has("typical")||!p.has("high"))&&
|
|
821
|
+
U(n,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",g);let E=Ct(p,"typical","high",n,g);l?r.
|
|
822
|
+
outputs.push({targetId:l,mode:d,execution:E}):r.workspaceSetup=E}for(let l=0;l<e.length;l+=1){let d=e[l].trim(),p=l+1;if(!d)
|
|
724
823
|
continue;let g=d.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(g||d==="### Workspace setup"){u();let $=g?.[1]||
|
|
725
|
-
"",X=$?`output:${$}`:"workspace-setup";c.has(X)&&
|
|
726
|
-
get($);$&&!["interactive","finite"].includes(
|
|
727
|
-
!$&&!i&&
|
|
728
|
-
line:
|
|
729
|
-
or Workspace setup heading followed by positive integer MiB estimates: ${[...
|
|
730
|
-
"; ")}.`,
|
|
731
|
-
|
|
732
|
-
rce estimates needs an operation or exactly `- Nothing.`."),r}function
|
|
733
|
-
|
|
734
|
-
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{i=
|
|
735
|
-
y"?
|
|
736
|
-
kOperationError")throw o;s.push({code:
|
|
737
|
-
nvalid":i.outputs.length>0||i.workspaceSetup?"ready":"unconfigured";return{contract:
|
|
738
|
-
sectionHash||"",estimatesHash:r==="ready"?
|
|
739
|
-
fallbackReason:r==="invalid"?"invalid-estimates":r==="unconfigured"?"not-declared":null,diagnostics:s}}var
|
|
740
|
-
ntime` in `workdir`: `command` `argument`...";function
|
|
741
|
-
isArray(e)||m(
|
|
742
|
-
Boolean),i=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return i||m(
|
|
743
|
-
p requires exactly one entry: ${
|
|
744
|
-
"Integration setup workdir"),runtimeRequirements:
|
|
745
|
-
let t=[...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?
|
|
746
|
-
cked":n?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?
|
|
747
|
-
...e.components||[]],command:n,diagnostics:t}}var
|
|
748
|
-
"Genesis host context requires an absolute runtime root.");let t=W.join(e,"genesis-context");if(!
|
|
749
|
-
catch(s=>{throw
|
|
750
|
-
HOST_CONTEXT_RESOLVER_ENV:
|
|
751
|
-
inspectCollaboration:
|
|
752
|
-
inspectProjectFormat:
|
|
753
|
-
listStackPieces:
|
|
754
|
-
syncSkills:
|
|
755
|
-
mergeArchitectureObservations:
|
|
756
|
-
CITY_SCHEMA_VERSION:
|
|
757
|
-
GENESIS_TURN_CONTEXT_ENABLED:"0"}}var
|
|
758
|
-
go-postgresql","jskit-postgresql","postgresql","rails-postgresql","spring-boot-postgresql"]),
|
|
759
|
-
stack"]),
|
|
760
|
-
"This genesis-compiler lists no prompt tasks. Update it to the release Vibe64 declares.");var
|
|
824
|
+
"",X=$?`output:${$}`:"workspace-setup";c.has(X)&&U(n,"Resource estimates contains a duplicate operation.",p),c.add(X);let ae=o.
|
|
825
|
+
get($);$&&!["interactive","finite"].includes(ae?.mode)&&U(n,`Resource estimate references an undeclared output: ${$}.`,p),
|
|
826
|
+
!$&&!i&&U(n,"Resource estimate references undeclared Workspace setup steps.",p),a={targetId:$,mode:ae?.mode||"setup",fields:new Map,
|
|
827
|
+
line:p};continue}let E=d.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),I=E&&Is.get(E[1]);(!a||!I)&&U(n,`Expected an Output\
|
|
828
|
+
or Workspace setup heading followed by positive integer MiB estimates: ${[...Is.keys()].map($=>`- ${$}: \`number\``).join(
|
|
829
|
+
"; ")}.`,p),a.fields.has(I)&&U(n,`Duplicate resource field: ${E[1]}.`,p);let R=Number(E[2]);(!Number.isSafeInteger(R)||R>
|
|
830
|
+
_s)&&U(n,`Resource estimates must be between 1 and ${_s} MiB.`,p),a.fields.set(I,R*Oo)}return u(),c.size===0&&U(n,"Resou\
|
|
831
|
+
rce estimates needs an operation or exactly `- Nothing.`."),r}function Ye({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){
|
|
832
|
+
j(e,t,"Resource estimates and Outputs"),j(e,n,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],i={
|
|
833
|
+
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{i=ks(e.lines,{targets:t.status==="read\
|
|
834
|
+
y"?Be(t.lines).targets:[],hasWorkspaceSetup:n.status==="ready"&&qe(n.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
|
|
835
|
+
kOperationError")throw o;s.push({code:Ts,message:o.message,details:{...o.details,causeCode:o.code}})}let r=s.length>0?"i\
|
|
836
|
+
nvalid":i.outputs.length>0||i.workspaceSetup?"ready":"unconfigured";return{contract:ko,status:r,stackHash:e.stackHash,sectionHash:e.
|
|
837
|
+
sectionHash||"",estimatesHash:r==="ready"?k(i):"",source:e.source||null,outputs:i.outputs,workspaceSetup:i.workspaceSetup,
|
|
838
|
+
fallbackReason:r==="invalid"?"invalid-estimates":r==="unconfigured"?"not-declared":null,diagnostics:s}}var Ao="vibe64.integration-setup.v1",Os="Integration setup",ye="VIBE64_INTEGRATION_SETUP_INVALID",Ro="- Command with `ru\
|
|
839
|
+
ntime` in `workdir`: `command` `argument`...";function As(e,t={}){let{path:n="genesis/stack.md#Integration setup"}=t;if(Array.
|
|
840
|
+
isArray(e)||m(ye,n,"Integration setup requires exact Stack section lines."),_(e))return null;let s=e.map(r=>r.trim()).filter(
|
|
841
|
+
Boolean),i=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return i||m(ye,n,`Integration setu\
|
|
842
|
+
p requires exactly one entry: ${Ro}; or - Nothing.`),{argv:N(i[3],ye,n,"Integration setup command"),workdir:S(i[2],ye,n,
|
|
843
|
+
"Integration setup workdir"),runtimeRequirements:C(i[1],ye,n,"Integration setup runtimes")}}function Rs({section:e={}}={}){
|
|
844
|
+
let t=[...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?As(e.lines):null;return{contract:Ao,status:t.length?"blo\
|
|
845
|
+
cked":n?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?k({version:1,command:n}):"",source:e.source||null,components:[
|
|
846
|
+
...e.components||[]],command:n,diagnostics:t}}var No=new URL("./index.js",import.meta.url).href,Ds=Do(No),Xe=new Map;async function Po(e){if(!W.isAbsolute(e||""))throw new TypeError(
|
|
847
|
+
"Genesis host context requires an absolute runtime root.");let t=W.join(e,"genesis-context");if(!Xe.has(t)){let n=pn(t).
|
|
848
|
+
catch(s=>{throw Xe.delete(t),s});Xe.set(t,n)}return Xe.get(t)}var{GENESIS_CONTRACTS:P,HOST_CONTEXT_RESOLVER_DATA_ENV:$o,
|
|
849
|
+
HOST_CONTEXT_RESOLVER_ENV:Lo,PROMPT_TASKS:Ps,addStack:xo,applyTemplate:Vo,generatePrompt:Mo,indexCodebase:jo,initialize:Go,
|
|
850
|
+
inspectCollaboration:Uo,inspectDerivedArtifacts:Bo,inspectEngineering:Wo,inspectEnvironment:Dt,inspectPasses:zo,inspectProject:Ho,
|
|
851
|
+
inspectProjectFormat:Fo,inspectAgentIntegrations:qo,inspectSkills:Ko,inspectStackSection:Yo,inspectStackSections:Xo,inspectSubsystems:Zo,
|
|
852
|
+
listStackPieces:Jo,listTemplates:Qo,parserEnvironment:Xc,setCollaboration:ea,setEngineeringProfile:ta,syncAgentIntegrations:na,
|
|
853
|
+
syncSkills:sa,withTrustedGitRepository:ia,SOURCE_EXPLANATION_PROMPT_VERSION:Zc,sourceExplanationGuidance:Jc,validateArchitectureFacts:Qc,
|
|
854
|
+
mergeArchitectureObservations:eu,validateCityDocument:tu,validateCallWeb:nu,CALL_WEB_SCHEMA:su,MACHINE_CITY_SCHEMA:iu,PROGRAM_CITY_SCHEMA:ru,
|
|
855
|
+
CITY_SCHEMA_VERSION:ou}=ve;async function au(e){let t=await Po(e);return{[Lo]:pa(),[$o]:JSON.stringify({registryPath:t.registryPath}),
|
|
856
|
+
GENESIS_TURN_CONTEXT_ENABLED:"0"}}var cu="genesis/blueprint.md",uu="genesis/subsystems.md",ra=Object.freeze(["vue","djan\
|
|
857
|
+
go-postgresql","jskit-postgresql","postgresql","rails-postgresql","spring-boot-postgresql"]),oa=Object.freeze(["genesis-\
|
|
858
|
+
stack"]),Cs=Object.freeze({BLUEPRINT_INVALID:"blueprint",BLUEPRINT_REQUIRED:"start"});if(!Array.isArray(Ps))throw new Error(
|
|
859
|
+
"This genesis-compiler lists no prompt tasks. Update it to the release Vibe64 declares.");var $s=new Set(Ps),Pt=15e3;function $t(e,t=Pt){
|
|
761
860
|
let n,s=new Promise((i,r)=>{n=setTimeout(()=>r(Object.assign(new Error(`Genesis did not answer within ${t} ms.`),{code:"\
|
|
762
|
-
vibe64_genesis_timeout"})),t)});return Promise.race([Promise.resolve().then(e),s]).finally(()=>clearTimeout(n))}function
|
|
763
|
-
let{required:n=!1}=t,s=V(e);if(!s&&!n)return"";if(
|
|
764
|
-
"Genesis prompt actions require an explicit task.");return s}function
|
|
861
|
+
vibe64_genesis_timeout"})),t)});return Promise.race([Promise.resolve().then(e),s]).finally(()=>clearTimeout(n))}function aa(e,t={}){
|
|
862
|
+
let{required:n=!1}=t,s=V(e);if(!s&&!n)return"";if(!$s.has(s))throw new TypeError(s?`Unknown Genesis prompt task: ${s}.`:
|
|
863
|
+
"Genesis prompt actions require an explicit task.");return s}function ca(e={}){return aa(e.genesisTask)||"work"}function ua(e={},t={}){
|
|
765
864
|
return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,t.label].map(V).find(Boolean)||"Continue the requ\
|
|
766
|
-
ested project work."}function
|
|
767
|
-
r"))&&
|
|
768
|
-
ted.");return W.join(e,".bin")}function
|
|
769
|
-
e),"../../bin")}function
|
|
770
|
-
...(Array.isArray(e)?e:[]).filter(i=>![t,n].includes(V(i))),t]}function
|
|
771
|
-
{hiddenStackPieces:
|
|
865
|
+
ested project work."}function la(){let e=(Ds.resolve.paths("genesis-compiler")||[]).find(t=>Ns(W.join(t,"genesis-compile\
|
|
866
|
+
r"))&&Ns(W.join(t,".bin","genesis")));if(!e)throw new Error("The installed Genesis compiler executable could not be loca\
|
|
867
|
+
ted.");return W.join(e,".bin")}function Ls(){let e=Ds.resolve("@local/vibe64-genesis/server");return W.resolve(W.dirname(
|
|
868
|
+
e),"../../bin")}function pa(){return W.resolve(Ls(),"vibe64-genesis-host-context")}function lu(e=[]){let t=Ls(),n=la();return[
|
|
869
|
+
...(Array.isArray(e)?e:[]).filter(i=>![t,n].includes(V(i))),t]}function da(e={},t={}){let{prompt:n=!1}=t;return{...e,...n?
|
|
870
|
+
{hiddenStackPieces:ra}:{},stackPackages:oa}}function pu(e={}){return z(xo,e)}async function du(e={}){let t=await re(Jo,e);
|
|
772
871
|
if(t.every(n=>Array.isArray(n?.resourceDeclarations)))return t;throw new Error("This genesis-compiler lists no Stack res\
|
|
773
|
-
ource declarations. Update it to the release Vibe64 declares.")}function
|
|
774
|
-
|
|
775
|
-
return re(
|
|
776
|
-
return
|
|
777
|
-
"no contract identity"}; expected ${
|
|
872
|
+
ource declarations. Update it to the release Vibe64 declares.")}function mu(e={}){return z(Go,e)}function hu(e={}){return re(
|
|
873
|
+
Ko,e)}function fu(e={}){return z(sa,e)}function gu(e={}){return z(na,e)}function Eu(e={}){return re(qo,e)}function bu(e={}){
|
|
874
|
+
return re(Zo,e)}async function yu(e={}){return en(await oe(Yt,e))}async function vu(e={}){return sn(await oe(tn,e))}function Su(e={}){
|
|
875
|
+
return z(jo,e)}function ma(){let e=Bo();if(e?.contract!==P.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||
|
|
876
|
+
"no contract identity"}; expected ${P.derivedArtifacts}.`);let t=Array.isArray(e.artifacts)?e.artifacts:[];if(!t.length||
|
|
778
877
|
t.some(n=>!V(n?.path)))throw new Error("Genesis returned an invalid derived-artifact contract.");return{...e,artifacts:t.
|
|
779
|
-
map(n=>({...n}))}}var
|
|
780
|
-
get("machine-city")?.path,
|
|
781
|
-
projection artifacts.");var
|
|
782
|
-
tifact.");async function
|
|
783
|
-
ations require an explicit absolute projectRoot.");return
|
|
878
|
+
map(n=>({...n}))}}var xs=ma(),wu=Object.freeze(xs.artifacts.map(e=>e.path)),Lt=new Map(xs.artifacts.map(e=>[e.id,e])),ha=Lt.
|
|
879
|
+
get("machine-city")?.path,fa=Lt.get("program-city")?.path;if(!ha||!fa)throw new Error("Genesis did not declare both City\
|
|
880
|
+
projection artifacts.");var ga=Lt.get("call-web")?.path;if(!ga)throw new Error("Genesis did not declare its call-web ar\
|
|
881
|
+
tifact.");async function z(e,t={},n={}){let s=V(t.projectRoot);if(!s||!W.isAbsolute(s))throw new TypeError("Genesis oper\
|
|
882
|
+
ations require an explicit absolute projectRoot.");return ia(s,()=>e(da(t,n)))}function Vs(){}function Ea(e){return`Gene\
|
|
784
883
|
sis project guidance is unavailable for this conversation (${V(e?.message||e).replace(/\s+/gu," ").slice(0,300)||"no rea\
|
|
785
884
|
son given"}). Work from the repository itself, where the genesis/ files still describe the project when present, and tel\
|
|
786
|
-
l the user that Genesis guidance did not load if it matters to the request.`}async function
|
|
787
|
-
onGenesisUnavailable:n=
|
|
788
|
-
|
|
789
|
-
return o.output;r=new Error("Genesis returned no session guidance.")}catch(o){r=o}return n(r),`${
|
|
885
|
+
l the user that Genesis guidance did not load if it matters to the request.`}async function _u({workdir:e,promptContext:t},{
|
|
886
|
+
onGenesisUnavailable:n=Vs,timeoutMs:s=Pt}={}){let i=ue(t);if(t.scope==="ephemeral")return i;let r;try{let o=await $t(()=>z(
|
|
887
|
+
ve.projectSessionContext,{projectRoot:e,hostDriver:ue,hostDriverInput:t}),s);if(typeof o?.output=="string"&&o.output.trim())
|
|
888
|
+
return o.output;r=new Error("Genesis returned no session guidance.")}catch(o){r=o}return n(r),`${Ea(r)}
|
|
790
889
|
|
|
791
|
-
${i}`}function re(e,t={}){return
|
|
792
|
-
contract||"no contract identity"}; expected ${t}.`);return e}async function
|
|
793
|
-
return
|
|
794
|
-
s=>
|
|
795
|
-
e[i]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return n}async function
|
|
796
|
-
e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its
|
|
797
|
-
inspected."),{code:"vibe64_stack_format_required"});await
|
|
798
|
-
components:n.components,stackHash:n.stackHash}}
|
|
799
|
-
e)]);return
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
e)
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
async function
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
d.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
890
|
+
${i}`}function re(e,t={}){return $t(()=>z(e,t))}function Ms(e,t){if(e?.contract!==t)throw new Error(`Genesis returned ${e?.
|
|
891
|
+
contract||"no contract identity"}; expected ${t}.`);return e}async function K(e,t,n={}){return Ms(await re(e,n),t)}async function xt(e,t,n={}){
|
|
892
|
+
return Ms(await z(e,n),t)}function oe(e,t={}){return K(n=>Yo({...n,name:e}),P.stackSection,t)}async function Vt(e,t={}){
|
|
893
|
+
let n=await re(s=>Xo({...s,names:e}),t);if(!Array.isArray(n)||n.length!==e.length||n.some((s,i)=>s?.contract!==P.stackSection||
|
|
894
|
+
s.name!==e[i]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return n}async function Iu(e={}){
|
|
895
|
+
if((await ba(e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its\
|
|
896
|
+
Stack can be inspected."),{code:"vibe64_stack_format_required"});await Co(W.join(e.projectRoot,rt),"utf8");let n=await oe(
|
|
897
|
+
be,e);return{components:n.components,stackHash:n.stackHash}}function Mt(e,t){return async(n={})=>{let[s,i]=await Promise.
|
|
898
|
+
all([oe(e,n),K(Dt,P.environment,n)]);return t({environment:i,section:s})}}var Tu=Mt($n,xn),ku=Mt(Bn,qn),Ou=Mt(It,Rt);function Au(e={}){
|
|
899
|
+
return z(ve.verify,e)}function Ru(e={}){return K(Dt,P.environment,e)}function Nu(e={}){return K(Ho,P.projectInspection,e)}
|
|
900
|
+
function Cu(e={}){return K(Qo,P.templates,e)}function Du(e={}){return xt(Vo,P.templateApplication,e)}function Pu(e={}){return K(
|
|
901
|
+
Wo,P.engineering,e)}function $u(e={}){return K(Uo,P.collaboration,e)}async function Lu(e){let{unavailable:t,passes:n,master:s}=await K(
|
|
902
|
+
zo,P.passes,e);return{unavailable:t,passes:n,master:s}}async function ba(e={}){let t=await re(Fo,e);if(!V(t?.status))throw new Error(
|
|
903
|
+
"Genesis did not return a project-format status.");return{...t}}function xu(e={}){return xt(ta,P.engineering,e)}function Vu(e={}){
|
|
904
|
+
return xt(ea,P.collaboration,e)}async function Mu({resourcesPreparing:e=!1,...t}={}){let[[n,s,i],r]=await Promise.all([Vt(
|
|
905
|
+
[Ge,Ke,be],t),K(Dt,P.environment,t)]);return{...as({environment:r,section:n,resourcesPreparing:e===!0}),resourceEstimates:Ye(
|
|
906
|
+
{section:s,outputsSection:n,workspaceSetupSection:i})}}async function ju(e={}){let t=await oe(Os,e);return Rs({section:t})}
|
|
907
|
+
async function Gu(e={}){return Ht(await oe(Wt,e))}async function Uu(e={}){return ls(await oe(cs,e))}async function Bu(e={}){
|
|
908
|
+
let[t,n,s]=await Vt([be,Ke,Ge],e);return{...await ws({projectRoot:e.projectRoot,section:t}),resourceEstimates:Ye({section:n,
|
|
909
|
+
outputsSection:s,workspaceSetupSection:t})}}async function Wu(e={}){let[t,n,s]=await Vt([Ke,Ge,be],e);return Ye({section:t,
|
|
910
|
+
outputsSection:n,workspaceSetupSection:s})}async function zu({action:e={},environment:t,input:n={},onGenesisUnavailable:s=Vs,
|
|
911
|
+
projectRoot:i,timeoutMs:r=Pt}){let o=ca(e),c=ua(n,e),a=E=>z(Mo,{environment:t,projectRoot:i,request:c,sessionContextInstalled:!0,
|
|
912
|
+
task:E},{prompt:!0}),u=async()=>{try{return{result:await a(o),task:o}}catch(E){let I=Object.hasOwn(Cs,String(E?.code))?Cs[E.
|
|
913
|
+
code]:"";if(!I||I===o||n.automaticGenesisTask===!0)throw E;return{result:await a(I),task:I}}},l;try{if(l=await $t(u,r),typeof l.
|
|
914
|
+
result?.prompt!="string"||!l.result.prompt.trim())throw new Error("Genesis returned no prompt.")}catch(E){return s(E),{prompt:c}}
|
|
915
|
+
let{result:d,task:p}=l,g=$s.has(V(d.task))?V(d.task):p;return{context:{genesis:!0,requestedTask:o,task:g,verificationCommands:d.
|
|
916
|
+
verificationCommands,warnings:d.warnings},originalPrompt:c,prompt:d.prompt,promptId:V(e.promptId||e.id)||g}}export{su as CALL_WEB_SCHEMA,ou as CITY_SCHEMA_VERSION,cu as GENESIS_BLUEPRINT_PATH,ga as GENESIS_CALL_WEB_PATH,wu as GENESIS_DERIVED_ARTIFACT_PATHS,
|
|
917
|
+
ha as GENESIS_MACHINE_CITY_PATH,fa as GENESIS_PROGRAM_CITY_PATH,rt as GENESIS_STACK_PATH,rn as GENESIS_STACK_SECTION_AMBIGUOUS,
|
|
918
|
+
uu as GENESIS_SUBSYSTEMS_PATH,Pt as GENESIS_USER_PATH_TIMEOUT_MS,iu as MACHINE_CITY_SCHEMA,ru as PROGRAM_CITY_SCHEMA,Zc as SOURCE_EXPLANATION_PROMPT_VERSION,
|
|
919
|
+
q as STAGING_DATA_ENTRY_FORMS,de as STAGING_DATA_MODES,Pn as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,Zi as VIBE64_APPLICATION_DEPLOYMENT_V1_CONTRACT,
|
|
920
|
+
Ve as VIBE64_PACKAGING_CONTRACT,fe as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,ms as VIBE64_STAGING_DATA_CONTRACT,It as VIBE64_STAGING_DATA_SECTION,
|
|
921
|
+
pu as addGenesisStack,Du as applyGenesisTemplate,aa as assertGenesisPromptTask,Ls as genesisCommandShimDirectory,la as genesisPackageBinDirectory,
|
|
922
|
+
Xc as genesisParserEnvironment,hi as genesisProjectContractNeedsAttention,Ei as genesisProjectFileDiagnostic,gi as genesisProjectFileUnreadable,
|
|
923
|
+
ua as genesisPromptRequest,ca as genesisPromptTask,mu as initializeGenesisProject,Eu as inspectGenesisAgentIntegrations,
|
|
924
|
+
$u as inspectGenesisCollaboration,ma as inspectGenesisDerivedArtifacts,Pu as inspectGenesisEngineering,Ru as inspectGenesisEnvironment,
|
|
925
|
+
Nu as inspectGenesisProject,ba as inspectGenesisProjectFormat,hu as inspectGenesisSkills,Iu as inspectGenesisStackComponents,
|
|
926
|
+
bu as inspectGenesisSubsystems,yu as inspectVibe64ArchitectureInspection,vu as inspectVibe64ArchitectureLayout,Gu as inspectVibe64ConnectedDevelopment,
|
|
927
|
+
Tu as inspectVibe64Deployment,ju as inspectVibe64IntegrationSetup,Mu as inspectVibe64Outputs,ku as inspectVibe64Packaging,
|
|
928
|
+
Uu as inspectVibe64ProjectServices,Wu as inspectVibe64ResourceEstimates,Ou as inspectVibe64StagingData,Bu as inspectVibe64WorkspaceSetup,
|
|
929
|
+
Lu as listGenesisPasses,du as listGenesisStackPieces,Cu as listGenesisTemplates,eu as mergeArchitectureObservations,Ji as parseVibe64DeploymentLines,
|
|
930
|
+
As as parseVibe64IntegrationSetupLines,Be as parseVibe64OutputsLines,Hn as parseVibe64PackagingLines,us as parseVibe64ProjectServicesLines,
|
|
931
|
+
ks as parseVibe64ResourceEstimatesLines,yo as parseVibe64StagingDataLines,qe as parseVibe64WorkspaceSetupLines,li as readArchitecturePreviewLocator,
|
|
932
|
+
Su as refreshGenesisCities,zu as renderGenesisPrompt,Nr as resolveVibe64OutputParameters,Fn as resolveVibe64PackagingEnvironment,
|
|
933
|
+
Vu as setGenesisCollaboration,xu as setGenesisEngineeringProfile,Jc as sourceExplanationGuidance,gu as syncGenesisAgentIntegrations,
|
|
934
|
+
fu as syncGenesisSkills,Qc as validateArchitectureFacts,nu as validateCallWeb,tu as validateCityDocument,Au as verifyGenesisProject,
|
|
935
|
+
_u as vibe64ConversationInstructions,ue as vibe64Driver,au as vibe64HostContextEnvironment,Po as vibe64HostContextRegistry,
|
|
936
|
+
pa as vibe64HostContextResolverPath,Rt as vibe64StagingDataInspection,lu as withGenesisCommandShim,$t as withinGenesisDeadline};
|