vibe64 0.1.39 → 0.1.40
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 +1942 -1846
- package/bin/server.js +136 -112
- package/bin/upgrade-state.js +5023 -4860
- package/dist/assets/GithubBrowserTabs-BoDkGFtY.js +1 -0
- package/dist/assets/LocalDatabaseServer-BWAvRlUl.css +1 -0
- package/dist/assets/LocalDatabaseServer-CVsGChHh.js +2 -0
- package/dist/assets/StudioErrorNotice-C_jbvp9V.js +1 -0
- package/dist/assets/VAlert-gwuhYlYb.js +1 -0
- package/dist/assets/VAutocomplete-D7Vk5wq_.js +1 -0
- package/dist/assets/VAvatar-DvRBcmqv.js +1 -0
- package/dist/assets/VBtn-BhVEwXLX.js +1 -0
- package/dist/assets/VCard-C3Hx769y.js +1 -0
- package/dist/assets/VCheckbox-DyCGSN0H.js +1 -0
- package/dist/assets/VCheckboxBtn-DCyuVH7W.css +1 -0
- package/dist/assets/VCheckboxBtn-DYcQU2Pn.js +1 -0
- package/dist/assets/VChip-VVdtjfq-.js +1 -0
- package/dist/assets/VDialog-CQDhjRiV.js +1 -0
- package/dist/assets/VDivider-Dq25WsKu.js +1 -0
- package/dist/assets/VExpansionPanels-C1y-myl5.js +1 -0
- package/dist/assets/VMenu-CDcBLYWR.js +1 -0
- package/dist/assets/VOverlay-Cp4rFk6g.js +1 -0
- package/dist/assets/VRadioGroup-CAjNZwF7.js +1 -0
- package/dist/assets/VRow-BskP28jR.js +1 -0
- package/dist/assets/VSelect-D3oLvCcB.js +2 -0
- package/dist/assets/VSheet-DxYEFfnM.js +1 -0
- package/dist/assets/VSkeletonLoader-Cync3lZZ.js +1 -0
- package/dist/assets/VSpacer-CgWOWvBh.js +1 -0
- package/dist/assets/VSwitch-BxGuGypi.js +1 -0
- package/dist/assets/VTextField-C0b_0cSa.js +1 -0
- package/dist/assets/VTextField-F6unyhrS.css +1 -0
- package/dist/assets/VTextarea-B7sZd1JY.js +1 -0
- package/dist/assets/{Vibe64AsyncModuleState-Do9EqX3S.js → Vibe64AsyncModuleState-syuPcpGx.js} +1 -1
- package/dist/assets/Vibe64AuthSettingsButton-CmiidAs5.js +5 -0
- package/dist/assets/{Vibe64AuthSettingsButton-M44SSmZ9.css → Vibe64AuthSettingsButton-D2lltUhi.css} +1 -1
- package/dist/assets/Vibe64CopyCommand-CYiZcy0d.js +1 -0
- package/dist/assets/Vibe64CopyCommand-ClbQLYZi.css +1 -0
- package/dist/assets/{Vibe64DashboardBackButton-BH_8j_VR.js → Vibe64DashboardBackButton-Go_MJuIK.js} +1 -1
- package/dist/assets/{Vibe64DashboardPageHeader-BXQR00HK.js → Vibe64DashboardPageHeader-BMrdRph6.js} +1 -1
- package/dist/assets/Vibe64DashboardPageHeader-CdlzsyKQ.css +1 -0
- package/dist/assets/Vibe64DashboardShell-MCzEQCWu.js +1 -0
- package/dist/assets/{Vibe64DatabaseWorkspace-CEml9BWn.js → Vibe64DatabaseWorkspace-DM9V017v.js} +3 -3
- package/dist/assets/{Vibe64DatabaseWorkspace-DPDMxhAW.css → Vibe64DatabaseWorkspace-DePBDUMy.css} +1 -1
- package/dist/assets/Vibe64OutputControls-CU9H0Dur.js +8 -0
- package/dist/assets/{Vibe64OutputControls-Co5YzwcK.css → Vibe64OutputControls-CeBzZPUT.css} +1 -1
- package/dist/assets/{Vibe64RepositoryWorkspace-Agyt4O-V.css → Vibe64RepositoryWorkspace-Bw9W691N.css} +1 -1
- package/dist/assets/{Vibe64RepositoryWorkspace-obZFXkoG.js → Vibe64RepositoryWorkspace-DaAChLA8.js} +2 -2
- package/dist/assets/{Vibe64SessionFiles-CQzs6fee.js → Vibe64SessionFiles-CM2EzXBf.js} +4 -4
- package/dist/assets/Vibe64SessionFiles-DsPb8hOe.css +1 -0
- package/dist/assets/{Vibe64TemporaryAiFixAction-BiuIE9mC.js → Vibe64TemporaryAiFixAction-CIePbdW8.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView-BhKRpL0N.js → Vibe64UiStoryboardView-Bp9STItF.js} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-Ca5nC7KH.js → Vibe64UnavailableSessions-JBgHzM-j.js} +1 -1
- package/dist/assets/{_sessionId_-CKkGH3Rx.js → _sessionId_-DVHd6D5V.js} +1 -1
- package/dist/assets/{_sessionTool_-1V-z6Pbp.js → _sessionTool_-BV1AwpUx.js} +1 -1
- package/dist/assets/_slug_-DsfaE8Vh.js +25 -0
- package/dist/assets/_slug_-_qfQqdHb.css +1 -0
- package/dist/assets/{access-WlhPvPgy.js → access-BbzSuMt5.js} +1 -1
- package/dist/assets/app-BNh2oZg-.js +1 -0
- package/dist/assets/assistantRouting-DeE8jvtE.js +3 -0
- package/dist/assets/{changes-CHJjrZAc.js → changes-D8Koqrqg.js} +1 -1
- package/dist/assets/client-CybfBKCn.js +2 -0
- package/dist/assets/client-D6UGamrv.css +1 -0
- package/dist/assets/{conversation-B90ERX9h.js → conversation-DZW4-Wck.js} +2 -2
- package/dist/assets/{conversation-vxJGwmtW.css → conversation-TK6EmDk4.css} +1 -1
- package/dist/assets/{createSimpleFunctional-CZTGuNuR.js → createSimpleFunctional-zlXZooQW.js} +1 -1
- package/dist/assets/{dashboard-CuutW8iv.js → dashboard-DLrmf5ed.js} +1 -1
- package/dist/assets/definitions-DgyQJgn-.js +1 -0
- package/dist/assets/dialog-transition-D2vqGksQ.js +1 -0
- package/dist/assets/env-B5V1EC4M.css +1 -0
- package/dist/assets/env-rVQwLtYr.js +1 -0
- package/dist/assets/health-92hh8xXh.css +1 -0
- package/dist/assets/health-B6r9LLrd.js +1 -0
- package/dist/assets/{history-1_NU8azF.js → history-C6xLWUxL.js} +1 -1
- package/dist/assets/incoming-Bdqo8z25.css +1 -0
- package/dist/assets/incoming-CNwZa_yD.js +2 -0
- package/dist/assets/index-B9P6KjvH.js +138 -0
- package/dist/assets/{index-irlMYzLh.css → index-BC29JK2e.css} +1 -1
- package/dist/assets/{integrations-BMzWQQpa.js → integrations-CcrqPXxj.js} +10 -10
- package/dist/assets/integrations-Co8WvCiD.css +1 -0
- package/dist/assets/issues-DEjIlMdl.js +1 -0
- package/dist/assets/layout-B2Ap07aa.js +1 -0
- package/dist/assets/{lazy-NHSwD9FS.js → lazy-BjyT2XvW.js} +1 -1
- package/dist/assets/{learning-Bdi3XRS7.js → learning-BP1xvd8w.js} +1 -1
- package/dist/assets/mdi-Bt90Ns76.js +1 -0
- package/dist/assets/placement-CQy46H3H.js +1 -0
- package/dist/assets/publish-CPWnztCc.css +1 -0
- package/dist/assets/publish-CVXolnAG.js +3 -0
- package/dist/assets/pull-requests-BjwokcU0.css +1 -0
- package/dist/assets/pull-requests-DdgzLzY_.js +1 -0
- package/dist/assets/{repository-BL_2bgzC.js → repository-5S0LzRq3.js} +1 -1
- package/dist/assets/ripple-EFNA8EBu.js +11 -0
- package/dist/assets/rolldown-runtime-DBalRfVu.js +1 -0
- package/dist/assets/{session-BdhKrcX4.js → session-BGpiZThC.js} +1 -1
- package/dist/assets/{settings-1rpuL7eR.js → settings-BKP_eQ3F.js} +1 -1
- package/dist/assets/settings-D8x4KUqV.css +1 -0
- package/dist/assets/shared-DZETtWRH.js +2 -0
- package/dist/assets/studioGateApi-BXHVBVEc.js +1 -0
- package/dist/assets/studioUrls-DpSS-0z1.js +1 -0
- package/dist/assets/useArchivedVibe64Sessions-D8DWpcSy.js +1 -0
- package/dist/assets/useCommand-nWFczmJy.js +1 -0
- package/dist/assets/useEndpointResource-Ds8EDBZ2.js +1 -0
- package/dist/assets/useRealtimeEvent-DrOiU8lJ.js +1 -0
- package/dist/assets/{useUiFeedback-BPBF_0bp.js → useUiFeedback-CMwE4MLs.js} +1 -1
- package/dist/assets/useVibe64ConversationLog-D-Vkq0sK.js +1 -0
- package/dist/assets/{useVibe64DatabaseTools-4o6S8eXq.js → useVibe64DatabaseTools-Dpm53ruL.js} +1 -1
- package/dist/assets/useVibe64ProjectScope-B5ogg6jd.js +1 -0
- package/dist/assets/useVibe64SessionData-CGJXj3r7.js +1 -0
- package/dist/assets/{useVibe64SessionSelection-BzL1y_Vq.js → useVibe64SessionSelection-BEqKR412.js} +1 -1
- package/dist/assets/{useVibe64SystemGraph-B4RmsC9Y.js → useVibe64SystemGraph-DbSfrYF8.js} +1 -1
- package/dist/assets/{useVibe64Terminal-Cg3idMcy.js → useVibe64Terminal-I7Sf6xMW.js} +1 -1
- package/dist/assets/vibe64ProjectScope.local-B06ABkhI.js +1 -0
- package/dist/assets/vibe64SavedEnvValues-B_QE9aAj.js +1 -0
- package/dist/assets/vibe64SessionFocus-CA-sk8Ri.css +1 -0
- package/dist/assets/vibe64SessionFocus-tv2wz7_H.js +1 -0
- package/dist/assets/{vibe64SessionInfo-BuBUdL-e.js → vibe64SessionInfo-B0uItVOK.js} +1 -1
- package/dist/assets/{vibe64SessionToolDefinitions-BJaJH5LR.js → vibe64SessionToolDefinitions-Dsn8WYmO.js} +1 -1
- package/dist/index.html +56 -46
- package/docs/colleague-usage/account-profile-and-appearance.md +1 -1
- package/docs/colleague-usage/{ai-accounts-and-routing.md → ai-accounts.md} +41 -114
- package/docs/colleague-usage/ai-model-setups.md +159 -0
- package/docs/colleague-usage/ai-onboarding.md +94 -21
- package/docs/colleague-usage/ai-personal-use.md +41 -0
- package/docs/colleague-usage/auto-workflow.md +8 -3
- package/docs/colleague-usage/codex-context-recovery.md +2 -1
- package/docs/colleague-usage/coding-agent-goals.md +7 -4
- package/docs/colleague-usage/coding-agents.md +8 -5
- package/docs/colleague-usage/colleague-watches.md +15 -4
- package/docs/colleague-usage/colleague.md +21 -5
- package/docs/colleague-usage/connected-contributions.md +13 -13
- package/docs/colleague-usage/connected-projects.md +2 -2
- package/docs/colleague-usage/conversation-context.md +1 -1
- package/docs/colleague-usage/dashboard-navigation.md +5 -3
- package/docs/colleague-usage/development-env.md +21 -4
- package/docs/colleague-usage/file-interfaces.md +1 -1
- package/docs/colleague-usage/github-work.md +8 -8
- package/docs/colleague-usage/health-checks.md +52 -18
- package/docs/colleague-usage/incoming-changes.md +3 -3
- package/docs/colleague-usage/integrations.md +5 -3
- package/docs/colleague-usage/learning-course-catalogue.md +3 -3
- package/docs/colleague-usage/learning-environment.md +55 -47
- package/docs/colleague-usage/learning-mode-ui.md +13 -10
- package/docs/colleague-usage/learning-practice-projects.md +13 -2
- package/docs/colleague-usage/learning-teacher-guide.md +9 -4
- package/docs/colleague-usage/learning-with-colleague.md +9 -5
- package/docs/colleague-usage/lesson-authoring.md +12 -12
- package/docs/colleague-usage/lesson-step-bar.md +22 -22
- package/docs/colleague-usage/main-chat-approvals.md +150 -0
- package/docs/colleague-usage/preview-browser-checks.md +5 -1
- package/docs/colleague-usage/project-language-tools.md +16 -2
- package/docs/colleague-usage/project-settings.md +1 -1
- package/docs/colleague-usage/project-setup.md +17 -7
- package/docs/colleague-usage/publishing.md +185 -0
- package/docs/colleague-usage/running-vibe64-on-your-computer.md +54 -6
- package/docs/colleague-usage/sessions.md +18 -10
- package/docs/colleague-usage/set-up-linux.md +254 -0
- package/docs/colleague-usage/set-up-macos.md +199 -0
- package/docs/colleague-usage/set-up-windows.md +76 -0
- package/docs/colleague-usage/starter-apps.md +21 -4
- package/docs/colleague-usage/teaching-content.md +2 -2
- package/docs/colleague-usage/team-ai-access.md +108 -0
- package/docs/colleague-usage/temporary-chats.md +9 -7
- package/docs/colleague-usage/workspace-preparation.md +50 -1
- package/docs/templates/learn-topic/README.md +3 -3
- package/docs/templates/learn-topic/training/lessons/TOPIC-01/lesson.json +2 -1
- package/docs/training-content.md +37 -15
- 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/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/patterns/oauth-connection/PATTERN.md +25 -0
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/package.json +1 -1
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/resource-crud-core/package.json +1 -1
- package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-accounts/package.json +2 -1
- package/node_modules/@local/vibe64-core/package.json +4 -1
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +82 -81
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +73 -69
- package/node_modules/@local/vibe64-genesis/package.json +1 -0
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +118 -68
- package/node_modules/@local/vibe64-genesis/src/server/index.js +501 -415
- package/node_modules/@local/vibe64-genesis/src/server/packaging.js +105 -0
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +143 -139
- package/node_modules/@local/vibe64-packaging/package.json +26 -0
- package/node_modules/@local/vibe64-packaging/src/server/packers/capacitor/ShellIcons.java +112 -0
- package/node_modules/@local/vibe64-project/package.json +3 -1
- package/node_modules/@local/vibe64-publishing/package.json +12 -0
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +7 -7
- package/node_modules/@local/vibe64-runtime/src/shared/assistantRoutingScores.json +25 -22
- package/node_modules/@local/vibe64-terminals/package.json +2 -1
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1340 -1300
- package/node_modules/@local/vibe64-training/package.json +2 -1
- package/package.json +19 -15
- package/server.bundle.mjs +42890 -40887
- package/dist/assets/GithubBrowserTabs-C2NO5l8g.js +0 -1
- package/dist/assets/StudioErrorNotice-CSrUw1QV.js +0 -1
- package/dist/assets/VAlert-P256xaE0.js +0 -1
- package/dist/assets/VAutocomplete-BDb95qJX.js +0 -1
- package/dist/assets/VAvatar-DPzqDH4r.js +0 -1
- package/dist/assets/VBtn-B2MBK2DL.js +0 -1
- package/dist/assets/VCard-mXy0k4aS.js +0 -1
- package/dist/assets/VCheckbox-C7A1ZW4D.js +0 -1
- package/dist/assets/VChip-CcI-Oo2J.js +0 -1
- package/dist/assets/VDialog-Bu3EfKb1.js +0 -1
- package/dist/assets/VDivider-BMEqUoAB.js +0 -1
- package/dist/assets/VExpansionPanels-Dgjrop0V.js +0 -1
- package/dist/assets/VMenu-C_x18lwb.js +0 -1
- package/dist/assets/VOverlay-CeMZurIN.js +0 -1
- package/dist/assets/VRadioGroup-CUu2-KIP.js +0 -1
- package/dist/assets/VRow-Cpw7OHQV.js +0 -1
- package/dist/assets/VSelect-DL3HaA5m.js +0 -2
- package/dist/assets/VSheet-DZWsu0kL.js +0 -1
- package/dist/assets/VSkeletonLoader-CttxM1tw.js +0 -1
- package/dist/assets/VSpacer-Dhmsvk4t.js +0 -1
- package/dist/assets/VSwitch-BRHeDJkH.js +0 -1
- package/dist/assets/VTextField-BR2eZeFT.js +0 -1
- package/dist/assets/VTextField-BiatYyd3.css +0 -1
- package/dist/assets/VTextarea-DbqamXJd.js +0 -1
- package/dist/assets/Vibe64AuthSettingsButton-fY4ZiIFF.js +0 -5
- package/dist/assets/Vibe64DashboardPageHeader-Gm1IvlHx.css +0 -1
- package/dist/assets/Vibe64DashboardShell-BSq7uXEW.js +0 -1
- package/dist/assets/Vibe64OutputControls-_zhGX9ne.js +0 -8
- package/dist/assets/Vibe64SessionFiles-Bl8wJ5Sk.css +0 -1
- package/dist/assets/_slug_-BclonbST.js +0 -24
- package/dist/assets/_slug_-CZ1bxO9C.css +0 -1
- package/dist/assets/app-BNP_n_Tt.js +0 -1
- package/dist/assets/assistantRouting-D4XpXcEf.js +0 -3
- package/dist/assets/client-BWV84wi2.js +0 -2
- package/dist/assets/client-DGrP-2AJ.css +0 -1
- package/dist/assets/definitions-BrMvu6yV.js +0 -1
- package/dist/assets/env-BzRtyO0w.css +0 -1
- package/dist/assets/env-D3KQGvRe.js +0 -1
- package/dist/assets/health-BJvooRnJ.css +0 -1
- package/dist/assets/health-BhoO1d4h.js +0 -1
- package/dist/assets/incoming-DWDrmxyH.css +0 -1
- package/dist/assets/incoming-DzADFGqp.js +0 -2
- package/dist/assets/index-dNxr4Lg9.js +0 -138
- package/dist/assets/integrations-Cq1x-Di9.css +0 -1
- package/dist/assets/issues-Bywux4s7.js +0 -1
- package/dist/assets/mdi-CG9pWOSj.js +0 -1
- package/dist/assets/placement-BF-zIEhA.js +0 -1
- package/dist/assets/pull-requests-CdbhyFOv.css +0 -1
- package/dist/assets/pull-requests-ncmKT3sS.js +0 -1
- package/dist/assets/ripple-BVltMmyV.js +0 -11
- package/dist/assets/settings-BopLnpB0.css +0 -1
- package/dist/assets/shared-DpMvYJO3.js +0 -2
- package/dist/assets/studioGateApi-DcCqiD9V.js +0 -1
- package/dist/assets/studioUrls-DmMMIScP.js +0 -1
- package/dist/assets/useArchivedVibe64Sessions-_LB2XxEa.js +0 -1
- package/dist/assets/useCommand-Bqxb-naz.js +0 -1
- package/dist/assets/useEndpointResource-DWoQ2keu.js +0 -1
- package/dist/assets/useRealtimeEvent-Bwapstla.js +0 -1
- package/dist/assets/useVibe64ConversationLog-BqUI0S5n.js +0 -1
- package/dist/assets/useVibe64Learning-DyqXkpLw.js +0 -1
- package/dist/assets/useVibe64ProjectScope-Bp1ImZlz.js +0 -1
- package/dist/assets/useVibe64SessionData-B686lToN.js +0 -1
- package/dist/assets/vibe64SessionFocus-CqZNTvYF.js +0 -1
- package/dist/assets/vibe64SessionFocus-OJ2toBd9.css +0 -1
|
@@ -1,109 +1,109 @@
|
|
|
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)}},
|
|
4
|
-
workspace-setup",VIBE64_OUTPUTS_INVALID:"outputs",VIBE64_DEPLOYMENT_INVALID:"deployment",
|
|
5
|
-
resource-estimates",VIBE64_CONNECTED_DEVELOPMENT_INVALID:"connected-development",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}.`}function l(e,t,n,s,r={}){throw new
|
|
10
|
-
void 0?{}:{line:s},...r})}function
|
|
11
|
-
must be one non-empty line.`,r),e.trim()}function
|
|
12
|
-
0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function
|
|
13
|
-
length>o||i!==void 0&&
|
|
14
|
-
`exactly ${i}`;l(t,n,`${s} must contain ${u} backticked ${i===1?"value":"values"}.`,r)}return
|
|
15
|
-
"string"&&!!e&&!/[\s\0{}]/u.test(e)&&!
|
|
16
|
-
e,t,n,s,r);return
|
|
17
|
-
ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!
|
|
18
|
-
function
|
|
19
|
-
path.`,r),e}function
|
|
2
|
+
import{createHash as Zt}from"node:crypto";import we from"node:path";var ce=class extends Error{constructor(t,n,s=void 0){
|
|
3
|
+
super(n),this.name="Vibe64StackOperationError",this.code=t,s!==void 0&&(this.details=s)}},Qt=Object.freeze({VIBE64_WORKSPACE_SETUP_INVALID:"\
|
|
4
|
+
workspace-setup",VIBE64_OUTPUTS_INVALID:"outputs",VIBE64_DEPLOYMENT_INVALID:"deployment",VIBE64_PACKAGING_INVALID:"packa\
|
|
5
|
+
ging",VIBE64_RESOURCE_ESTIMATES_INVALID:"resource-estimates",VIBE64_CONNECTED_DEVELOPMENT_INVALID:"connected-development",
|
|
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"}),en=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
|
|
8
|
+
function tn(e,t){let n=Qt[e],s=String(t).replace(en,"");return n?`${s} Exact grammar: vibe64-helper spec ${n}.`:s}function D(e,t,n){
|
|
9
|
+
return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}.`}function l(e,t,n,s,r={}){throw new ce(e,tn(e,n),{path:t,...s===
|
|
10
|
+
void 0?{}:{line:s},...r})}function v(e,t,n,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&l(t,n,`${s} \
|
|
11
|
+
must be one non-empty line.`,r),e.trim()}function nn(e){let t=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return t.length===
|
|
12
|
+
0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function I(e,t,n,s,r,{count:i,maximum:o=64}={}){let a=nn(e);if(!a||a.
|
|
13
|
+
length>o||i!==void 0&&a.length!==i||a.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=i===void 0?"separate non-empty":
|
|
14
|
+
`exactly ${i}`;l(t,n,`${s} must contain ${u} backticked ${i===1?"value":"values"}.`,r)}return a}function sn(e=""){return typeof e==
|
|
15
|
+
"string"&&!!e&&!/[\s\0{}]/u.test(e)&&!we.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function _(e,t,n,s,r){let i=I(
|
|
16
|
+
e,t,n,s,r);return sn(i[0])||l(t,n,`${s} must begin with a safe executable.`,r),i}function rn(e=""){return typeof e=="str\
|
|
17
|
+
ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!we.posix.isAbsolute(e)&&we.posix.normalize(e)===e&&!e.split("/").some(t=>!t||t==="..")}
|
|
18
|
+
function E(e,t,n,s,r,{allowRoot:i=!0}={}){return(!rn(e)||!i&&e===".")&&l(t,n,`${s} must be a canonical project-relative \
|
|
19
|
+
path.`,r),e}function O(e,t,n,s,r){let i=I(e,t,n,s,r);return i.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&l(t,n,`${s}\
|
|
20
20
|
must use lowercase technology ids separated into backticked values.`,r),new Set(i).size!==i.length&&l(t,n,`${s} contain\
|
|
21
|
-
s a duplicate technology id.`,r),i}function
|
|
22
|
-
/[\\?#]/u.test(i))&&l(t,n,`${s} must begin with one slash and contain no query or fragment.`,r),i}function
|
|
21
|
+
s a duplicate technology id.`,r),i}function Se(e,t,n,s,r){let i=v(e,t,n,s,r);return(!i.startsWith("/")||i.startsWith("//")||
|
|
22
|
+
/[\\?#]/u.test(i))&&l(t,n,`${s} must begin with one slash and contain no query or fragment.`,r),i}function ue(e,t,n,s,r){
|
|
23
23
|
let i=e.match(/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);i||l(t,n,`${s} must use \`- Ready when: \`GET\` \
|
|
24
24
|
\`/path\` returns \`200\`\`.`,r);let o=Number(i[2]);return(!Number.isInteger(o)||o<200||o>399)&&l(t,n,`${s} status must \
|
|
25
|
-
be from 200 through 399.`,r),{kind:"http",method:"GET",path:
|
|
26
|
-
isArray(e)?e.map(
|
|
27
|
-
let t=`${JSON.stringify(
|
|
28
|
-
`;return`sha256:${
|
|
29
|
-
throw new
|
|
30
|
-
return[...new Set(e)].sort()}function
|
|
31
|
-
thing."}import{access as
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
t,"Workspace setup must be supplied as exact Stack section lines."),
|
|
36
|
-
let r=e[s].trim();if(!r)continue;let i=s+1,o=r.match(
|
|
37
|
-
let
|
|
38
|
-
".";n.push({label:
|
|
39
|
-
|
|
40
|
-
rkspace setup condition path",i,{allowRoot:!1}),onMissing:
|
|
41
|
-
setup needs at least one Prepare entry or exactly `- Nothing.`."),n}async function
|
|
42
|
-
e,t)),!0}catch(n){if(["ENOENT","ENOTDIR"].includes(n?.code))return!1;throw n}}async function
|
|
43
|
-
let n=[...t.diagnostics||[]],s=[];t.status==="ready"&&(s=
|
|
44
|
-
if(!
|
|
45
|
-
pathExists)}if(i.length>0){let
|
|
46
|
-
for project ${
|
|
47
|
-
ORKSPACE_SETUP_WAITING"),u=n.some(({code:
|
|
48
|
-
length>0&&(
|
|
49
|
-
stackHash,recipeHash:
|
|
50
|
-
flatMap(
|
|
25
|
+
be from 200 through 399.`,r),{kind:"http",method:"GET",path:Se(i[1],t,n,`${s} path`,r),status:o}}function Ie(e){return Array.
|
|
26
|
+
isArray(e)?e.map(Ie):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,Ie(e[t])])):e}function S(e){
|
|
27
|
+
let t=`${JSON.stringify(Ie(e),null,2)}
|
|
28
|
+
`;return`sha256:${Zt("sha256").update(t).digest("hex")}`}function G(e={},t={},n="operation"){if(e.stackHash!==t.stackHash)
|
|
29
|
+
throw new ce("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${n}. Retry the operation.`)}function B(e=[]){
|
|
30
|
+
return[...new Set(e)].sort()}function b(e=[]){let t=e.map(n=>n.trim()).filter(Boolean);return t.length===1&&t[0]==="- No\
|
|
31
|
+
thing."}import{access as on}from"node:fs/promises";import He from"node:path";var ze="vibe64.workspace-setup.v1",ne="Workspace setup",Z="VIBE64_WORKSPACE_SETUP_INVALID",an="- Prepare `label` with `r\
|
|
32
|
+
untime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",cn=/^- Prepare `([^`\r\n]+)` with (.+?):[ \t]+(.+)$/u,
|
|
33
|
+
un=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,pn=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,ln=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
|
|
34
|
+
function Te(e,t,n,s={}){l(Z,e,t,n,s)}function Q(e,{path:t="genesis/stack.md#Workspace setup"}={}){if(Array.isArray(e)||Te(
|
|
35
|
+
t,"Workspace setup must be supplied as exact Stack section lines."),b(e))return[];let n=[];for(let s=0;s<e.length;s+=1){
|
|
36
|
+
let r=e[s].trim();if(!r)continue;let i=s+1,o=r.match(cn);o||Te(t,`Every Workspace setup entry must use: ${an}`,i,{observed:r});
|
|
37
|
+
let a=o[2].match(un),u=a?null:o[2].match(pn),c=a?a[1]:u?u[1]:o[2],p=a?.[2]||u?.[2]||"",m=c.match(ln),d=m?m[1]:c,h=m?m[2]:
|
|
38
|
+
".";n.push({label:v(o[1],Z,t,"Workspace setup step label",i),argv:_(o[3],Z,t,"Workspace setup command",i),runtimeRequirements:O(
|
|
39
|
+
d,Z,t,"Workspace setup runtimes",i),workdir:E(h,Z,t,"Workspace setup workdir",i),...p?{condition:{pathExists:E(p,Z,t,"Wo\
|
|
40
|
+
rkspace setup condition path",i,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}})}return n.length===0&&Te(t,"## Workspace\
|
|
41
|
+
setup needs at least one Prepare entry or exactly `- Nothing.`."),n}async function dn(e,t){try{return await on(He.join(
|
|
42
|
+
e,t)),!0}catch(n){if(["ENOENT","ENOTDIR"].includes(n?.code))return!1;throw n}}async function qe({projectRoot:e,section:t={}}={}){
|
|
43
|
+
let n=[...t.diagnostics||[]],s=[];t.status==="ready"&&(s=Q(t.lines));let r=[],i=[],o=He.resolve(e);if(n.length===0)for(let d of s){
|
|
44
|
+
if(!d.condition||await dn(o,d.condition.pathExists)){r.push(d);continue}d.condition.onMissing==="wait"&&i.push(d.condition.
|
|
45
|
+
pathExists)}if(i.length>0){let d=B(i);n.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting \
|
|
46
|
+
for project ${d.length===1?"path":"paths"}: ${d.join(", ")}.`,details:{paths:d}})}let a=n.some(({code:d})=>d==="VIBE64_W\
|
|
47
|
+
ORKSPACE_SETUP_WAITING"),u=n.some(({code:d})=>d!=="VIBE64_WORKSPACE_SETUP_WAITING"),c="unconfigured";u?c="blocked":!a&&r.
|
|
48
|
+
length>0&&(c="ready");let p=r.map(({condition:d,...h})=>h),m={version:1,steps:p};return{contract:ze,status:c,stackHash:t.
|
|
49
|
+
stackHash,recipeHash:c==="ready"?S(m):"",components:[...t.components||[]],source:t.source||null,runtimeRequirements:B(p.
|
|
50
|
+
flatMap(d=>d.runtimeRequirements)),steps:p,diagnostics:n}}var mn="custom";var fn=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
|
|
51
51
|
(PHP)"}),Object.freeze({value:"pip",label:"pip (Python)"}),Object.freeze({value:"bundler",label:"Bundler (Ruby)"}),Object.
|
|
52
52
|
freeze({value:"gomod",label:"Go modules"}),Object.freeze({value:"cargo",label:"Cargo (Rust)"}),Object.freeze({value:"mav\
|
|
53
53
|
en",label:"Maven"}),Object.freeze({value:"gradle",label:"Gradle"}),Object.freeze({value:"nuget",label:"NuGet (.NET)"}),Object.
|
|
54
|
-
freeze({value:
|
|
55
|
-
stack.md#Connected development",
|
|
56
|
-
package type: `type`","- Sources file: `path`",`- Prepare \`label\` ${
|
|
57
|
-
function
|
|
58
|
-
m
|
|
59
|
-
if(
|
|
60
|
-
n=
|
|
61
|
-
t=
|
|
62
|
-
es file must be outside Git metadata.",h);continue}let
|
|
63
|
-
!
|
|
64
|
-
l(
|
|
65
|
-
runner ","- Prepare `Custom connected source` "):
|
|
66
|
-
code!=="VIBE64_WORKSPACE_SETUP_INVALID")throw
|
|
67
|
-
run unconditionally; a skipped step cannot prove source consumption.",h),
|
|
68
|
-
.",h),s=
|
|
54
|
+
freeze({value:mn,label:"custom"})]);var Fe=Object.freeze(fn.map(e=>e.value));function Ke(e){return typeof e=="string"&&Fe.includes(e)}function Ye(e="or"){let t=Fe;return`${t.slice(0,-1).join(", ")} ${e} ${t.at(-1)}`}var Je="Connected development",hn="vibe64.connected-development.v1",x="VIBE64_CONNECTED_DEVELOPMENT_INVALID",P="genesis/\
|
|
55
|
+
stack.md#Connected development",ke="with `runtime` [in `workdir`]: `command` `argument`...",gn=Object.freeze(["- Default\
|
|
56
|
+
package type: `type`","- Sources file: `path`",`- Prepare \`label\` ${ke}`,`- Verify \`label\` ${ke}`,`- Custom runner ${ke}`]);
|
|
57
|
+
function Xe(e={}){let t="",n="",s=null,r=[],i=[...e.diagnostics||[]],o=e.status==="ready";if(o&&!b(e.lines)){let u=!1;for(let[
|
|
58
|
+
p,m]of e.lines.entries()){let d=m.trim();if(!d)continue;let h=p+1,y=d.match(/^- Default package type: `([^`\r\n]*)`$/u);
|
|
59
|
+
if(y){n&&l(x,P,"Declare exactly one default package type.",h),Ke(y[1])||l(x,P,`Default package type must be ${Ye()}.`,h),
|
|
60
|
+
n=y[1];continue}let J=d.match(/^- Sources file: `([^`\r\n]+)`$/u);if(J){t&&l(x,P,"Declare exactly one Sources file.",h),
|
|
61
|
+
t=E(J[1],x,P,"Connected sources file",h,{allowRoot:!1}),t.split("/").some(z=>z.toLowerCase()===".git")&&l(x,P,"The Sourc\
|
|
62
|
+
es file must be outside Git metadata.",h);continue}let k=d.startsWith("- Custom runner "),te=d.match(/^- (Prepare|Verify) /u);
|
|
63
|
+
!k&&!te&&l(x,P,D("Connected development entry",d,gn),h);let X=te?.[1]==="Verify"?"verify":"prepare";!k&&u&&X==="prepare"&&
|
|
64
|
+
l(x,P,"All Prepare entries must precede Verify entries.",h),u||=!k&&X==="verify";let ae;try{let z=k?d.replace("- Custom \
|
|
65
|
+
runner ","- Prepare `Custom connected source` "):d.replace(/^- Verify /u,"- Prepare ");[ae]=Q([z],{path:P})}catch(z){if(z.
|
|
66
|
+
code!=="VIBE64_WORKSPACE_SETUP_INVALID")throw z;l(x,P,z.message,h)}ae.condition&&l(x,P,"Connected development steps must\
|
|
67
|
+
run unconditionally; a skipped step cannot prove source consumption.",h),k?(s&&l(x,P,"Declare exactly one Custom runner\
|
|
68
|
+
.",h),s=ae):r.push({...ae,phase:X})}!(n&&!t&&!r.length&&!s)&&(!t||!r.some(p=>p.phase==="verify")&&!s)&&l(x,P,"Declare a \
|
|
69
69
|
default package type alone, or a Sources file with Verify entries or a Custom runner; use `- Nothing.` for no declaratio\
|
|
70
|
-
n.")}let
|
|
71
|
-
stackHash:e.stackHash,recipeHash:
|
|
72
|
-
components:[...e.components||[]],source:e.source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:r,runtimeRequirements:
|
|
73
|
-
[...r,...s?[s]:[]].flatMap(u=>u.runtimeRequirements)),diagnostics:i}}var
|
|
70
|
+
n.")}let a=e.status==="blocked"||i.length?"blocked":r.length||s?"ready":"unconfigured";return{contract:hn,declared:o,status:a,
|
|
71
|
+
stackHash:e.stackHash,recipeHash:a==="ready"?S({version:1,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:r}):"",
|
|
72
|
+
components:[...e.components||[]],source:e.source||null,sourcesFile:t,defaultPackageType:n,customRunner:s,steps:r,runtimeRequirements:B(
|
|
73
|
+
[...r,...s?[s]:[]].flatMap(u=>u.runtimeRequirements)),diagnostics:i}}var Ze="Architecture inspection",R="VIBE64_ARCHITECTURE_INSPECTION_INVALID",_e=Object.freeze({Runtime:["runtimeRequireme\
|
|
74
74
|
nts","`runtime`..."],Directory:["workdir","`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeo\
|
|
75
75
|
ut","`1` through `60`"],"Max output bytes":["maxBuffer",`\`1\` through \`${4*1024*1024}\``],"Entry files":["entryFiles",
|
|
76
|
-
"`path`... (optional)"],"Required files":["requiredFiles","`path`... (optional)"]}),
|
|
77
|
-
join("|")}): (.+)$`,"u");function
|
|
78
|
-
t,"Architecture inspection requires exact Stack section lines."),
|
|
79
|
-
"runtimeRequirements","workdir","argv","timeout","maxBuffer"])r[o]===void 0&&l(
|
|
80
|
-
r=null}}for(let[o,
|
|
81
|
-
if(
|
|
82
|
-
ed an Inspector heading.",o+1);let
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
o+1);else if(
|
|
86
|
-
|
|
87
|
-
4*1024*1024;(!/^[1-9][0-9]*$/u.test(
|
|
88
|
-
|
|
89
|
-
"ready"?
|
|
76
|
+
"`path`... (optional)"],"Required files":["requiredFiles","`path`... (optional)"]}),En=new RegExp(`^- (${Object.keys(_e).
|
|
77
|
+
join("|")}): (.+)$`,"u");function bn(e,{path:t="genesis/stack.md#Architecture inspection"}={}){if(Array.isArray(e)||l(R,
|
|
78
|
+
t,"Architecture inspection requires exact Stack section lines."),b(e))return[];let n=[],s=new Set,r;function i(){if(r){for(let o of[
|
|
79
|
+
"runtimeRequirements","workdir","argv","timeout","maxBuffer"])r[o]===void 0&&l(R,t,`${r.id} is missing ${o}.`);n.push(r),
|
|
80
|
+
r=null}}for(let[o,a]of e.entries()){let u=a.trim();if(!u)continue;let c=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);
|
|
81
|
+
if(c){i(),s.has(c[1])&&l(R,t,"Duplicate inspector id.",o+1),s.add(c[1]),r={id:c[1],title:c[2]};continue}r||l(R,t,"Expect\
|
|
82
|
+
ed an Inspector heading.",o+1);let p=u.match(En);p||l(R,t,`Unknown architecture inspector field. Use one of: ${Object.entries(
|
|
83
|
+
_e).map(([d,[,h]])=>`- ${d}: ${h}`).join("; ")}.`,o+1);let[m]=_e[p[1]];if(r[m]!==void 0&&l(R,t,`Duplicate ${p[1]}.`,o+1),
|
|
84
|
+
m==="runtimeRequirements")r[m]=O(p[2],R,t,"Inspector runtime",o+1);else if(m==="argv")r[m]=_(p[2],R,t,"Inspector command",
|
|
85
|
+
o+1);else if(m==="entryFiles"||m==="requiredFiles")r[m]=I(p[2],R,t,p[1],o+1).map(d=>E(d,R,t,p[1],o+1));else{let[d]=I(p[2],
|
|
86
|
+
R,t,p[1],o+1,{count:1});if(m==="workdir")r[m]=E(d,R,t,"Inspector directory",o+1);else{let h=Number(d),y=m==="timeout"?60:
|
|
87
|
+
4*1024*1024;(!/^[1-9][0-9]*$/u.test(d)||!Number.isSafeInteger(h)||h>y)&&l(R,t,`${p[1]} must be from 1 to ${y}.`,o+1),r[m]=
|
|
88
|
+
m==="timeout"?h*1e3:h}}}return i(),n.length||l(R,t,"Use an Inspector entry or - Nothing."),n}function Qe(e){let t=e.status===
|
|
89
|
+
"ready"?bn(e.lines):[];for(let n of t)n.runtimeRequirements.some(s=>!e.components.includes(s))&&l(R,"genesis/stack.md#Ar\
|
|
90
90
|
chitecture inspection","Inspector runtimes must be selected in Stack.");return{contract:"vibe64.architecture-inspection.\
|
|
91
|
-
v1",status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:
|
|
91
|
+
v1",status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:S(t),diagnostics:e.diagnostics||[]}}var et="Architecture layout",Oe=Object.freeze(["layer","libraries","support"]);function yn(e,{path:t="genesis/stack.md#A\
|
|
92
92
|
rchitecture layout"}={}){let n="VIBE64_ARCHITECTURE_LAYOUT_INVALID";if(Array.isArray(e)||l(n,t,"Expected exact Stack sec\
|
|
93
|
-
tion lines."),
|
|
94
|
-
l(n,t,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[u,
|
|
95
|
-
continue;let
|
|
96
|
-
id.",u+1),r.add(
|
|
97
|
-
(!o||!
|
|
98
|
-
if(
|
|
99
|
-
ce.",u+1),i.add(
|
|
100
|
-
1),
|
|
101
|
-
s.length||l(n,t,"Use a Group entry or - Nothing."),s}function
|
|
102
|
-
status,stackHash:e.stackHash,groups:e.status==="ready"?
|
|
103
|
-
import
|
|
104
|
-
includes(String(e?.code||"").trim())}import*as
|
|
105
|
-
import
|
|
106
|
-
"managedPreview"]),
|
|
93
|
+
tion lines."),b(e))return[];let s=[],r=new Set,i=new Set,o;function a(){o&&((!o.kind||!o.purpose||!o.subsystems.length)&&
|
|
94
|
+
l(n,t,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[u,c]of e.entries()){let p=c.trim();if(!p)
|
|
95
|
+
continue;let m=p.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(m){a(),r.has(m[1])&&l(n,t,"Duplicate group \
|
|
96
|
+
id.",u+1),r.add(m[1]),o={id:m[1],title:m[2],subsystems:[]};continue}let d=p.match(/^- (Kind|Purpose|Subsystem): (.+)$/u);
|
|
97
|
+
(!o||!d)&&l(n,t,"Expected a Group heading or Kind, Purpose, Subsystem field.",u+1);let h=I(d[2],n,t,d[1],u+1,{count:1});
|
|
98
|
+
if(d[1]==="Subsystem"){let y=E(h[0],n,t,"Subsystem root",u+1);i.has(y)&&l(n,t,"Each directory root may be placed only on\
|
|
99
|
+
ce.",u+1),i.add(y),o.subsystems.push({root:y})}else{let y=d[1].toLowerCase();o[y]!==void 0&&l(n,t,`Duplicate ${d[1]}.`,u+
|
|
100
|
+
1),y==="kind"&&!Oe.includes(h[0])&&l(n,t,`Kind must be ${Oe.slice(0,-1).join(", ")} or ${Oe.at(-1)}.`,u+1),o[y]=h[0]}}return a(),
|
|
101
|
+
s.length||l(n,t,"Use a Group entry or - Nothing."),s}function tt(e){return{contract:"vibe64.architecture-layout.v1",status:e.
|
|
102
|
+
status,stackHash:e.stackHash,groups:e.status==="ready"?yn(e.lines):[],diagnostics:e.diagnostics||[]}}import{existsSync as qt}from"node:fs";import{readFile as $s}from"node:fs/promises";import{createRequire as xs}from"node:module";
|
|
103
|
+
import j from"node:path";var nt="STACK_PROJECT_CONTRACTS_INCOMPLETE",st="STACK_SECTION_AMBIGUOUS",vn=Object.freeze([nt,st]);function wn(e){return vn.
|
|
104
|
+
includes(String(e?.code||"").trim())}import*as oe from"genesis-compiler";import{mkdir as Nn,mkdtemp as Cn,readFile as Dn,rename as Pn,rm as Vn,writeFile as $n}from"node:fs/promises";import xn from"node:os";
|
|
105
|
+
import Ae from"node:path";var In=Object.freeze(["main","temporary"]),rt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
|
|
106
|
+
"managedPreview"]),Sn=64*1024,Tn=Object.freeze(["When user input is necessary, ask no more than three concise, high-impa\
|
|
107
107
|
ct questions at once.","Put multiple questions on separate lines as `[1] Question`, `[2] Question`, and so on.","For a s\
|
|
108
108
|
mall fixed set of useful choices, put `Possible answers:` and a short bullet list directly beneath its own question, bef\
|
|
109
109
|
ore the next one; never collect several questions' answers into one trailing list.","Each bullet is one distinct, comple\
|
|
@@ -116,86 +116,90 @@ Possible answers:
|
|
|
116
116
|
[2] Tell the main agent before changes?
|
|
117
117
|
Possible answers:
|
|
118
118
|
- Yes, tell main first
|
|
119
|
-
- No, proceed independently`]),
|
|
119
|
+
- No, proceed independently`]),kn=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
|
|
120
120
|
start a duplicate or replacement server. If it is unavailable, report that blocker. Describe only rendered browser evide\
|
|
121
121
|
nce.","When adopting an authenticated app, or when its login blocks Preview inspection, inspect identity support/names w\
|
|
122
122
|
ith `vibe64-helper preview status`; prefer `vibe64-helper preview browser identity <configured-name>` to requesting pass\
|
|
123
123
|
words. If unconfigured, ask which existing accounts (email/login/user ID) represent admin and other required roles, and \
|
|
124
124
|
the default. Reuse prior answers; wait for their choices before configuring access. Never infer admin rights from names \
|
|
125
|
-
or the Vibe64 viewer.","
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
`vibe64-helper playwright
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
125
|
+
or the Vibe64 viewer.","A web app with login accounts has an application-owned adapter declared in the Outputs `#### Pre\
|
|
126
|
+
view identity` block (`vibe64-helper spec outputs` and `vibe64-helper spec preview-identity-command`); when it is missin\
|
|
127
|
+
g, set it up from the app framework's own pattern as part of the work instead of merely offering it. Save the named sele\
|
|
128
|
+
ctors the person gives or confirms with `vibe64-helper preview identities save` (`vibe64-helper spec preview-identities`\
|
|
129
|
+
); you may propose them from existing app accounts, then verify each with `vibe64-helper preview browser identity <name>\
|
|
130
|
+
`. Use existing sessions/permissions, reject missing/disabled accounts, and disable the adapter without Vibe64\u2019s per-run\
|
|
131
|
+
enable flag and secret. Do not create users, change roles, reset passwords or weaken production auth for import. Verify\
|
|
132
|
+
the selected account\u2019s actual Preview access; a saved selector is insufficient. If account choices are deferred/decline\
|
|
133
|
+
d, explain access remains unconfigured and continue independent setup work without repeated credential requests. Public/\
|
|
134
|
+
non-web apps need no adapter.","Use `vibe64-helper preview status`, `screenshot`, `logs`, and `browser eval` (Playwright\
|
|
135
|
+
code on stdin) for rendered inspection.","The top Preview toolbar Stop and `vibe64-helper preview stop` stop this sessi\
|
|
136
|
+
on's application and managed browser, not chat or source. Status reports the saved stopped choice. A status read, screen\
|
|
137
|
+
shot, browser inspection, source edit or session reopening is not permission to restart it; use `vibe64-helper preview e\
|
|
138
|
+
nsure --wait` only for a deliberate Start. Scoped browser tests restore the prior stopped choice.","For interactive navi\
|
|
139
|
+
gation, use the proxy URL from `vibe64-helper preview inspect-url` or status `currentPage.url` / `endpoints.browser.url`\
|
|
140
|
+
. Inside browser eval, use `await page.goto(new URL('/your-path', preview.url).href)`. The direct application endpoint u\
|
|
141
|
+
nder diagnostics bypasses Preview identity and is not a browser-navigation URL.","Use the managed preview browser for in\
|
|
142
|
+
teractive browsing and `vibe64-helper playwright` only for an existing configured project suite; report a platform or pr\
|
|
143
|
+
oject-test blocker rather than installing another browser or changing its dependencies.","For browser evidence, batch re\
|
|
144
|
+
lated actions and assertions, return only needed values and inspect relevant locators or regions; screenshot at meaningf\
|
|
145
|
+
ul visual checkpoints or failures, not after every click. Reuse the managed browser when test isolation permits. Preserv\
|
|
146
|
+
e required viewport, identity and security checks; use existing automated cases for repeat verification.","For browser t\
|
|
147
|
+
ests that write or reset data, inspect `vibe64-helper preview targets --json` and the project's `genesis/stack.md` Outpu\
|
|
148
|
+
ts. Run `vibe64-helper playwright --target <declared-test-target> test <suite arguments>` or `vibe64-helper playwright -\
|
|
149
|
+
-target <declared-test-target> npm-run <script>`. Vibe64 starts that web target, waits for readiness, uses its declared \
|
|
150
|
+
application identity, and restores the previous Preview when the command finishes or is cancelled; report restoration fa\
|
|
151
|
+
ilures.","A target name is not proof of test isolation. Before running a destructive suite, the application must verify \
|
|
152
|
+
the server's actual test database and suppress real email, invoices, payments, and other external effects. Keep managed \
|
|
153
|
+
Env unchanged. The test launcher and its preview-identity command must use the same database. Follow the application's d\
|
|
154
|
+
eclared test resources and never invent a database name. Never spoof safety checks by changing only the test runner's en\
|
|
155
|
+
vironment.","If no suitable test target exists, add one through the project's existing Outputs contract and application-\
|
|
156
|
+
owned test scripts within authorized scope, keeping normal Preview as default. Validate the exact disposable database be\
|
|
157
|
+
fore resetting it, prepare fixtures before reporting readiness, and make Playwright use the started target's URL, which \
|
|
158
|
+
Vibe64 supplies as PLAYWRIGHT_BASE_URL, without starting another server. If the required test resources or external-effe\
|
|
159
|
+
ct controls are missing, report that specific blocker. Use `vibe64-helper preview ensure --target <id> --wait --json` on\
|
|
160
|
+
ly to deliberately select an interactive target; it stays selected until changed. If browser startup is slow, measure mi\
|
|
161
|
+
grations, fixtures and server startup before retrying or extending deadlines.","Keep test output small: run relevant fil\
|
|
162
|
+
es/cases, save stdout/stderr to local artifacts and preserve exit status. Report counts, duration, failed cases, actiona\
|
|
163
|
+
ble errors and artifact paths. Read only needed failure excerpts, not full passing/JSON/TAP/request/trace/image output. \
|
|
164
|
+
Retain startup, resource and Preview-restoration errors even if tests pass, and trailing wrapper diagnostics separately \
|
|
165
|
+
from JSON. Do not rerun for output or reread unchanged logs; inspect on new output, changed state or a concrete blocker.",
|
|
166
|
+
"Batch related browser tests in one managed suite (one Preview switch and restore). Suites and live Preview actions are \
|
|
167
|
+
sequential: no browser actions, ensure/restart or target changes during a suite or restoration. Wait on the original exe\
|
|
168
|
+
cution, including background runs, through cleanup/restoration (empty polls: yield_time_ms: 30000 where supported; short\
|
|
169
|
+
er only for interactive input or an immediate check); read-only status/logs stay available. Before live inspection, conf\
|
|
170
|
+
irm `vibe64-helper playwright status` has no active run and `vibe64-helper preview status` is ready on the restored targ\
|
|
171
|
+
et. To stop, read suite status then run `vibe64-helper playwright cancel <run-id>`, which waits for cleanup/restoration;\
|
|
172
|
+
retry it if cleanup needs attention. Never kill individual test/Preview PIDs or change locks. Launcher exit alone does \
|
|
173
|
+
not prove tests stopped. Recheck current status before reporting a busy blocker.","If a managed command reports kernel t\
|
|
174
|
+
ask denials or a resource incident, retain its diagnostic and incident ID when reporting the blocker. Ask the platform o\
|
|
175
|
+
perator to inspect that resource evidence before retrying; do not increase test timeouts or weaken assertions to work ar\
|
|
176
|
+
ound a process/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),
|
|
177
|
+
_n=Object.freeze(["Each managed shell command receives current development Env from Vibe64, including declared resource \
|
|
178
|
+
bindings; use them in ordinary commands. Do not build environment injection or copy managed credentials into source. Res\
|
|
179
|
+
ource provisioning and application migrations remain separate preparation steps.","Use `vibe64-helper env status [develo\
|
|
180
|
+
pment|production|all]` to inspect configured key names without revealing values.","Pipe an available value to `vibe64-he\
|
|
181
|
+
lper env set <development|production> <KEY> [--secret]`; never put values in arguments, logs, or repository files. Use e\
|
|
182
|
+
mpty stdin only when the user requested an empty value.","When the person refers to a saved key, account or accounts hub\
|
|
183
|
+
, run `vibe64-helper env saved` (names, descriptions and fields, never values) and link the matching field to the variab\
|
|
184
|
+
le the application reads with `vibe64-helper env link <development|production> <KEY> <saved-id> <field-id>` instead of a\
|
|
185
|
+
sking for the value.","Keep development and production values separate. Never invent credentials, copy a value between s\
|
|
186
|
+
copes without explicit direction, or edit Vibe64 runtime/session storage.","After an Env mutation, report only the affec\
|
|
187
|
+
ted scope and key names, never their values, and claim success only when the command succeeded.","Store a secret the app\
|
|
188
|
+
lication needs generated (such as an application key) by generating it with the framework's own generator and piping it \
|
|
189
|
+
to `vibe64-helper env set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that \
|
|
190
|
+
file from Env."]);function it(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${t} must be an object.`);return e}function Re(e,t,n){
|
|
187
191
|
let s=new Set(t),r=Object.keys(e).filter(i=>!s.has(i));if(r.length>0)throw new TypeError(`${n} contains unsupported fiel\
|
|
188
|
-
ds: ${r.join(", ")}.`)}function
|
|
192
|
+
ds: ${r.join(", ")}.`)}function ot(e){if(Re(e,["conversationKind","scope","session","hostGuidance"],"Vibe64 session cont\
|
|
189
193
|
ext"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"utf8")>1024))throw new TypeError(
|
|
190
|
-
"Vibe64 host guidance must be bounded text supplied by the host.");if(!
|
|
191
|
-
"Vibe64 session context has an unknown conversationKind.");let t=
|
|
192
|
-
be64 session capabilities");let n=Object.fromEntries(
|
|
194
|
+
"Vibe64 host guidance must be bounded text supplied by the host.");if(!In.includes(e.conversationKind))throw new TypeError(
|
|
195
|
+
"Vibe64 session context has an unknown conversationKind.");let t=it(e.session,"Vibe64 session capabilities");Re(t,rt,"Vi\
|
|
196
|
+
be64 session capabilities");let n=Object.fromEntries(rt.map(s=>{if(typeof t[s]!="boolean")throw new TypeError(`Vibe64 se\
|
|
193
197
|
ssion capability ${s} must be boolean.`);return[s,t[s]]}));return{conversationKind:e.conversationKind,scope:"session",...e.
|
|
194
|
-
hostGuidance?{hostGuidance:e.hostGuidance}:{},session:n}}function
|
|
195
|
-
context");let t=String(e.stableContext||"").trim();if(!t||t.length>
|
|
196
|
-
uires bounded stableContext.");return{scope:"ephemeral",stableContext:t}}function
|
|
197
|
-
e);if(e.scope==="ephemeral")return
|
|
198
|
-
ly.")}function
|
|
198
|
+
hostGuidance?{hostGuidance:e.hostGuidance}:{},session:n}}function On(e){Re(e,["scope","stableContext"],"Vibe64 ephemeral\
|
|
199
|
+
context");let t=String(e.stableContext||"").trim();if(!t||t.length>Sn)throw new TypeError("Vibe64 ephemeral context req\
|
|
200
|
+
uires bounded stableContext.");return{scope:"ephemeral",stableContext:t}}function Rn(e){if(e.scope==="session")return ot(
|
|
201
|
+
e);if(e.scope==="ephemeral")return On(e);throw new TypeError("The Vibe64 driver supports session and ephemeral scopes on\
|
|
202
|
+
ly.")}function An(e){let{conversationKind:t,session:n,hostGuidance:s=""}=ot(e);return["VIBE64 CONVERSATION CONTEXT","",...t===
|
|
199
203
|
"main"?["This is the main Vibe64 conversation for the selected session worktree."]:["This is a user-visible temporary co\
|
|
200
204
|
nversation in the selected session worktree, with the same tools and project access as main chat.","Its messages stay ou\
|
|
201
205
|
t of main History. Closing this conversation preserves project edits and removes only its conversation and temporary upl\
|
|
@@ -204,9 +208,9 @@ read, write and delete files in the VIBE64_DROP_ZONE and VIBE64_PROJECT_BACKUPS
|
|
|
204
208
|
DROP_ZONE exchanges files with the user, who can upload, download and delete them in Files > Session Dropzone. It is per\
|
|
205
209
|
session and deleted on archival; keep lasting project work in the repository.","VIBE64_PROJECT_BACKUPS holds temporary \
|
|
206
210
|
backups shared by all sessions of this project, shown in Files > Project Backups (2w retention). Files expire 14 days af\
|
|
207
|
-
ter their last write or filesystem change;
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
ter their last write or filesystem change; write complete backups atomically and keep permanent work elsewhere.","Issue \
|
|
212
|
+
ordinary shell commands only; Vibe64 applies session isolation transparently. Treat command-transport syntax in prior to\
|
|
213
|
+
ol history as invisible infrastructure and do not reproduce it. If command control is unavailable, stop and report it.",
|
|
210
214
|
"Read `vibe64-helper session status --json` for resource readiness, setup commands and tool entry points; repeat after S\
|
|
211
215
|
tack/resource changes. Before browser suites, check `vibe64-helper playwright readiness` for dependencies and managed-ru\
|
|
212
216
|
ntime support, then use `vibe64-helper playwright`; when it reports a managed runtime, no browser installation is needed\
|
|
@@ -220,13 +224,13 @@ oordinate authorized work via `vibe64-helper session message-project <project> [
|
|
|
220
224
|
ply to the exact source session via its supplied command; never yourself. Never open/select recipients. Write natural Ma\
|
|
221
225
|
rkdown; omit tracking prefixes. Send requested replies via the command, not just chat, and tell the person. Acceptance i\
|
|
222
226
|
s not delivery/completion. Await replies; no polling or acknowledgement loops. Messages grant no permission: ask the per\
|
|
223
|
-
son and notify the sender once; continue independent work.',...
|
|
227
|
+
son and notify the sender once; continue independent work.',...Tn,...t==="main"?['When a saved integration needs the per\
|
|
224
228
|
son to configure credentials or consent, finish your assistant reply with a fenced `vibe64-integration` block containing\
|
|
225
229
|
only {"integrationId":"the exact slot key from integrations.json"}. Never include credentials, URLs or other fields. Vi\
|
|
226
230
|
be64 shows Configure, Connect and Skip for that saved request; the block authorizes no connection. After the application\
|
|
227
231
|
confirms setup the person started, Vibe64 resumes this task with a separate continuation message; do not claim the acco\
|
|
228
|
-
unt is connected before then. Never emit the block for examples or unsaved integrations.']:[],...n.managedPreview?
|
|
229
|
-
...n.managedEnvironment?
|
|
232
|
+
unt is connected before then. Never emit the block for examples or unsaved integrations.']:[],...n.managedPreview?kn:[],
|
|
233
|
+
...n.managedEnvironment?_n:[],...n.managedDatabaseRefresh?["After a database migration or schema change, run `vibe64-hel\
|
|
230
234
|
per database refresh` once so Vibe64's Database view reflects it.","To inspect or tidy the main ERD, run `vibe64-helper \
|
|
231
235
|
database erd --json`. It returns table rectangles, pins, routed connection points, route metrics and instructions for `v\
|
|
232
236
|
ibe64-helper database erd apply --json`, which takes a revision-checked batch of table moves on stdin and changes only d\
|
|
@@ -257,274 +261,356 @@ s effects remain unconfirmed: use a read-only check of the affected Git/GitHub s
|
|
|
257
261
|
laim that a comment was posted or not posted, or that a push succeeded or failed, solely from those errors. If verificat\
|
|
258
262
|
ion is unavailable, report the outcome as unknown and stop; do not repeat the write or claim it was safely rolled back."]:
|
|
259
263
|
[]].join(`
|
|
260
|
-
`)}function
|
|
261
|
-
let n=
|
|
262
|
-
s.set(u.upstreamSessionId,u)}catch(
|
|
263
|
-
join(t,"sessions.tmp");await
|
|
264
|
-
{registryPath:n,get(
|
|
265
|
-
context registry is closed.");if(typeof
|
|
266
|
-
ive conversation ID.");let
|
|
267
|
-
then(async()=>{if(JSON.stringify(s.get(
|
|
268
|
-
async close(){i=!0,await r.catch(()=>{}),s.clear(),e||await
|
|
269
|
-
|
|
270
|
-
e.slice(1)),
|
|
271
|
-
ath` returns `200`",`- ${
|
|
272
|
-
let s=
|
|
273
|
-
"\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(i)))&&
|
|
264
|
+
`)}function ee(e={}){let t=it(e,"Vibe64 driver input"),n=Rn(t);return n.scope==="session"?An(n):n.stableContext}async function at(e=""){let t=e||await Cn(Ae.join(xn.tmpdir(),"vibe64-genesis-context-"));await Nn(t,{recursive:!0,mode:448});
|
|
265
|
+
let n=Ae.join(t,"sessions.json"),s=new Map;try{let a=JSON.parse(await Dn(n,"utf8"));for(let u of a.sessions)ee(u.promptContext),
|
|
266
|
+
s.set(u.upstreamSessionId,u)}catch(a){if(a.code!=="ENOENT")throw a}let r=Promise.resolve(),i=!1;async function o(a){let u=Ae.
|
|
267
|
+
join(t,"sessions.tmp");await $n(u,JSON.stringify({sessions:[...a.values()]}),{mode:384}),await Pn(u,n)}return await o(s),
|
|
268
|
+
{registryPath:n,get(a){return structuredClone(s.get(a))},async register(a,u,c=""){if(i)throw new Error("The Genesis host\
|
|
269
|
+
context registry is closed.");if(typeof a!="string"||!a.trim())throw new TypeError("Genesis host context requires a nat\
|
|
270
|
+
ive conversation ID.");let p=structuredClone(u);ee(p);let m={upstreamSessionId:a,workdir:c,promptContext:p},d=r.catch(()=>{}).
|
|
271
|
+
then(async()=>{if(JSON.stringify(s.get(a))===JSON.stringify(m))return;let h=new Map(s);h.set(a,m),await o(h),s=h});r=d,await d},
|
|
272
|
+
async close(){i=!0,await r.catch(()=>{}),s.clear(),e||await Vn(t,{recursive:!0,force:!0})}}}var ct="vibe64.application-deployment.v1",ut="Deployment",U="VIBE64_DEPLOYMENT_INVALID",Ln=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
273
|
+
Pe="- Recreate on restore: ",Ne=Object.freeze({prepare:0,build:1,migrate:2,serve:3}),Ce=Object.keys(Ne).map(e=>e[0].toUpperCase()+
|
|
274
|
+
e.slice(1)),Mn=Object.freeze(["- Workdir: `path`","- Runtimes: `runtime`...",`${Pe}\`glob\`...`,"- Ready when: `GET` `/p\
|
|
275
|
+
ath` returns `200`",`- ${Ce.join("|")} \`label\`: \`command\` \`argument\`...`]);function C(e,t,n,s={}){l(U,e,t,n,s)}function jn(e,t,n){
|
|
276
|
+
let s=I(e.slice(Pe.length),U,t,"Deployment Recreate on restore paths",n);return s.some(r=>r.startsWith("/")||r.includes(
|
|
277
|
+
"\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(i)))&&C(t,"Deployment Recre\
|
|
274
278
|
ate on restore paths must be canonical project-relative globs using only * and ** wildcards.",n),new Set(s).size!==s.length&&
|
|
275
|
-
|
|
276
|
-
mand",n);return s.some(r=>/\{(?:host|port)\}/u.test(r))&&
|
|
277
|
-
Serve reads HOST and PORT from its environment.",n),{label:
|
|
278
|
-
function
|
|
279
|
-
function
|
|
280
|
-
Stack section lines."),
|
|
281
|
-
let
|
|
282
|
-
o.slice(11),
|
|
283
|
-
"- Runtimes: ")){s.has("runtimes")&&
|
|
284
|
-
slice(12),
|
|
285
|
-
ecreate on restore entry.",
|
|
286
|
-
ady when: ")){s.has("readiness")&&
|
|
287
|
-
loyment readiness",
|
|
288
|
-
n.steps.length===0&&
|
|
289
|
-
"serve").length!==1||n.steps.at(-1).role!=="serve")&&
|
|
290
|
-
n.steps.length;i+=1)
|
|
291
|
-
", ")}, then ${
|
|
292
|
-
length>0&&!n.steps.some(({role:i})=>i==="prepare")&&
|
|
293
|
-
a Prepare step."),n}function
|
|
294
|
-
[]],s=
|
|
279
|
+
C(t,"Deployment contains a duplicate Recreate on restore path.",n),s}function Gn(e,t,n){let s=_(e[3],U,t,"Deployment com\
|
|
280
|
+
mand",n);return s.some(r=>/\{(?:host|port)\}/u.test(r))&&C(t,"Deployment commands take no {host} or {port} placeholders;\
|
|
281
|
+
Serve reads HOST and PORT from its environment.",n),{label:v(e[2],U,t,"Deployment step label",n),argv:s,role:e[1].toLowerCase()}}
|
|
282
|
+
function De(){return{version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],readiness:null,steps:[]}}
|
|
283
|
+
function pt(e,{path:t="genesis/stack.md#Deployment"}={}){if(Array.isArray(e)||C(t,"Deployment must be supplied as exact \
|
|
284
|
+
Stack section lines."),b(e))return De();let n=De(),s=new Set;for(let i=0;i<e.length;i+=1){let o=e[i].trim();if(!o)continue;
|
|
285
|
+
let a=i+1;if(o.startsWith("- Workdir: ")){s.has("workdir")&&C(t,"Duplicate Deployment Workdir.",a),s.add("workdir");let c=I(
|
|
286
|
+
o.slice(11),U,t,"Deployment Workdir",a,{count:1})[0];n.workdir=E(c,U,t,"Deployment workdir",a);continue}if(o.startsWith(
|
|
287
|
+
"- Runtimes: ")){s.has("runtimes")&&C(t,"Duplicate Deployment Runtimes.",a),s.add("runtimes"),n.runtimeRequirements=O(o.
|
|
288
|
+
slice(12),U,t,"Deployment runtimes",a);continue}if(o.startsWith(Pe)){s.has("restore-paths")&&C(t,"Duplicate Deployment R\
|
|
289
|
+
ecreate on restore entry.",a),s.add("restore-paths"),n.artifact.disposablePaths=jn(o,t,a);continue}if(o.startsWith("- Re\
|
|
290
|
+
ady when: ")){s.has("readiness")&&C(t,"Duplicate Deployment Ready when.",a),s.add("readiness"),n.readiness=ue(o,U,t,"Dep\
|
|
291
|
+
loyment readiness",a);continue}let u=o.match(Ln);if(u){n.steps.push(Gn(u,t,a));continue}C(t,D("Deployment entry",o,Mn),a)}
|
|
292
|
+
n.steps.length===0&&C(t,"## Deployment needs at least one command or exactly `- Nothing.`."),(n.steps.filter(({role:i})=>i===
|
|
293
|
+
"serve").length!==1||n.steps.at(-1).role!=="serve")&&C(t,"Deployment needs exactly one final Serve step.");for(let i=1;i<
|
|
294
|
+
n.steps.length;i+=1)Ne[n.steps[i].role]<Ne[n.steps[i-1].role]&&C(t,`Deployment steps must be ordered ${Ce.slice(0,-1).join(
|
|
295
|
+
", ")}, then ${Ce.at(-1)}.`);return n.readiness||C(t,"Deployment needs one Ready when entry."),n.artifact.disposablePaths.
|
|
296
|
+
length>0&&!n.steps.some(({role:i})=>i==="prepare")&&C(t,"Deployment may recreate paths on restore only when it declares \
|
|
297
|
+
a Prepare step."),n}function lt({environment:e={},section:t={}}={}){G(t,e,"Deployment section");let n=[...t.diagnostics||
|
|
298
|
+
[]],s=De();t.status==="ready"&&(s=pt(t.lines));let r=n.length>0?"blocked":s.steps.length>0?"ready":"unconfigured",i={version:s.
|
|
295
299
|
version,artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.runtimeRequirements,readiness:s.readiness,steps:s.steps};
|
|
296
|
-
return{contract:
|
|
297
|
-
source||null,runtimeRequirements:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"
|
|
300
|
+
return{contract:ct,status:r,stackHash:t.stackHash,recipeHash:r==="ready"?S(i):"",components:[...t.components||[]],source:t.
|
|
301
|
+
source||null,runtimeRequirements:B(s.runtimeRequirements),resources:structuredClone(e.resources||[]),...i,diagnostics:n}}var le="vibe64.packaging.v1",Et="Packaging",qr=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
|
|
302
|
+
de"]),V="VIBE64_PACKAGING_INVALID",Bn=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Un=/^[A-Z_][A-Z0-9_]*$/u,Wn=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
|
|
303
|
+
Hn=/^[a-z][a-z0-9+.-]*$/u,zn=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,qn=/\{[^{}\s]*\}/u,
|
|
304
|
+
Fn=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Kn=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,Yn=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
305
|
+
Jn=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Xn=/^- Content: package `([^`\r\n]+)`$/u,dt=50,mt=500,Zn=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
|
|
306
|
+
bt=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
|
|
307
|
+
"versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
|
|
308
|
+
prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
|
|
309
|
+
ect.toml","external"]}),"web-bundle":Object.freeze({entries:["workdir","runtimes","prepare","build","environment","outpu\
|
|
310
|
+
t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({entries:["workdir","content","platforms","a\
|
|
311
|
+
pplicationId","name","icon","versionFrom","deepLinkSchemeFrom","appLinkDomainsFrom","permission"],required:["content","p\
|
|
312
|
+
latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),pe=Object.freeze(Object.
|
|
313
|
+
keys(bt)),Ve=Object.freeze(["android"]),$e=Object.freeze(["package.json","pyproject.toml","external"]),W=e=>e.map(t=>`\`${t}\
|
|
314
|
+
\``).join(" | "),q=Object.freeze([["- Packer: ","packer",`- Packer: ${W(pe)}`],["- Workdir: ","workdir","- Workdir: `pat\
|
|
315
|
+
h`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from:\
|
|
316
|
+
","versionFrom",`- Version from: ${W($e)}`],["- Platforms: ","platforms",`- Platforms: ${W(Ve)}...`],["- Id: ","applica\
|
|
317
|
+
tionId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/icon\
|
|
318
|
+
-1024.png`"],["- Deep link scheme from: ","deepLinkSchemeFrom","- Deep link scheme from: `ENV_NAME`"],["- App link domai\
|
|
319
|
+
ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),ft="### Package `id`: Label",Qn=Object.freeze([
|
|
320
|
+
q[0][2],q[1][2],q[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",q[3][2],q[4][2],
|
|
321
|
+
"- Content: package `web-bundle-id`",...q.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),se=Object.
|
|
322
|
+
freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Environment",
|
|
323
|
+
output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Name",icon:"\
|
|
324
|
+
Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permission"});function g(e,t,n){
|
|
325
|
+
l(V,e,t,n)}function xe(e,t,n,s){let r=v(e,V,t,n,s);return Bn.test(r)||g(t,`${n} must use lowercase letters, digits, and \
|
|
326
|
+
single hyphens.`,s),r}function es(e,t,n,s,r){return I(e.slice(t.length),V,n,s,r,{count:1})[0]}function Le(e,t,n,s){return e.
|
|
327
|
+
some(r=>qn.test(r))&&g(t,`${n} takes no placeholders in ${le}.`,s),e}function yt(e,t,n,s){return Un.test(e)||g(t,`${n} m\
|
|
328
|
+
ust be an uppercase environment variable name.`,s),e}function ht(e,t,n,s,r){e.seen.has(t)&&g(s,`Package ${e.id} has a du\
|
|
329
|
+
plicate ${se[t]} entry.`,r),e.seen.add(t),e.fields[t]=n,e.lines[t]=r}function ts(e,t,n,s,r){let i=`Packaging ${se[e]}`;if(e===
|
|
330
|
+
"runtimes")return O(t.slice(n.length),V,s,i,r);if(e==="platforms"){let a=I(t.slice(n.length),V,s,i,r);return a.some(u=>!Ve.
|
|
331
|
+
includes(u))&&g(s,`${i} must be ${W(Ve)}.`,r),new Set(a).size!==a.length&&g(s,`${i} contains a duplicate platform.`,r),a}
|
|
332
|
+
let o=Le([es(t,n,s,i,r)],s,i,r)[0];if(e==="packer")return pe.includes(o)||g(s,`Unknown packer \`${o}\`. ${le} packers ar\
|
|
333
|
+
e ${W(pe)}.`,r),o;if(["workdir","output"].includes(e))return E(o,V,s,i,r,{allowRoot:e==="workdir"});if(e==="icon"){let a=E(
|
|
334
|
+
o,V,s,i,r,{allowRoot:!1});return a.toLowerCase().endsWith(".png")||g(s,`${i} must be a 1024x1024 PNG file.`,r),a}return e===
|
|
335
|
+
"versionFrom"?($e.includes(o)||g(s,`${i} must be ${W($e)}.`,r),o):e==="applicationId"?((!Wn.test(o)||o.length>150)&&g(s,
|
|
336
|
+
`${i} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and underscores; each part starts with a let\
|
|
337
|
+
ter).`,r),o):e==="name"?((o.trim()!==o||o.length>dt)&&g(s,`${i} must be at most ${dt} characters without surrounding spa\
|
|
338
|
+
ces.`,r),o):yt(o,s,i,r)}function ns(e,t,n){return{id:xe(e[1],t,"Package id",n),label:v(e[2],V,t,"Package label",n),fields:{},
|
|
339
|
+
lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:n}}function ss(e,t,n,s){/^- Plugins?\b/u.test(
|
|
340
|
+
t)&&g(n,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Content package at its l\
|
|
341
|
+
ockfile versions.",s);for(let[u,c]of q)if(t.startsWith(u)){ht(e,c,ts(c,t,u,n,s),n,s);return}let r=t.match(Xn);if(r){ht(e,
|
|
342
|
+
"content",xe(r[1],n,"Packaging Content package",s),n,s);return}let i=t.match(Kn);if(i){let u=i[1].toLowerCase(),c=`Packa\
|
|
343
|
+
ging ${i[1]} command`;e[u].push({label:v(i[2],V,n,`Packaging ${i[1]} label`,s),argv:Le(_(i[3],V,n,c,s),n,c,s)}),e.lines[u]??=
|
|
344
|
+
s;return}let o=t.match(Yn);if(o){let u=yt(o[1],n,"Packaging Environment name",s);Zn.test(u)&&g(n,`Packaging Environment ${u}\
|
|
345
|
+
looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(p=>p.name===u)&&g(n,`Packa\
|
|
346
|
+
ge ${e.id} has a duplicate Environment ${u}.`,s);let c=Le(I(o[2],V,n,"Packaging Environment value",s,{count:1}),n,"Packa\
|
|
347
|
+
ging Environment value",s)[0];e.environment.push({name:u,value:c}),e.lines.environment??=s;return}let a=t.match(Jn);if(a){
|
|
348
|
+
let u=xe(a[1],n,"Packaging Permission id",s),c=v(a[2],V,n,"Packaging Permission reason",s);(c.includes("`")||c.length>mt)&&
|
|
349
|
+
g(n,`Packaging Permission reason is plain user-facing text of at most ${mt} characters.`,s),e.permissions.some(p=>p.id===
|
|
350
|
+
u)&&g(n,`Package ${e.id} has a duplicate Permission ${u}.`,s),e.permissions.push({id:u,reason:c}),e.lines.permission??=s;
|
|
351
|
+
return}g(n,D("Packaging entry",t,Qn),s)}function rs(e,t){let n=e.fields.packer;n||g(t,`Package ${e.id} needs a Packer en\
|
|
352
|
+
try: ${W(pe)}.`,e.line);let s=bt[n],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build","e\
|
|
353
|
+
nvironment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of r)s.entries.includes(o)||g(
|
|
354
|
+
t,`The ${n} packer takes no ${se[o]} entry.`,e.lines[o]);for(let o of s.required)r.has(o)||g(t,`Package ${e.id} (${n}) n\
|
|
355
|
+
eeds ${/^[AEIOU]/u.test(se[o])?"an":"a"} ${se[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
|
|
356
|
+
versionFrom)&&g(t,`The ${n} packer reads its version from ${W(s.versionSources)}.`,e.lines.versionFrom);let i={id:e.id,label:e.
|
|
357
|
+
label,packer:n,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtimes||[],prepare:e.prepare,build:e.build,environment:e.
|
|
358
|
+
environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return n!=="capacitor"?i:{...i,content:e.
|
|
359
|
+
fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
|
|
360
|
+
deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
|
|
361
|
+
permissions}}function vt(e,{path:t="genesis/stack.md#Packaging"}={}){if(Array.isArray(e)||g(t,"Packaging must be supplie\
|
|
362
|
+
d as exact Stack section lines."),b(e))return{version:1,packages:[]};let n=[],s=null;for(let a=0;a<e.length;a+=1){let u=e[a].
|
|
363
|
+
trim();if(!u)continue;let c=a+1,p=u.match(Fn);if(p){s=ns(p,t,c),n.push(s);continue}u.startsWith("#")&&g(t,`Unknown Packa\
|
|
364
|
+
ging heading: ${u}. Use ${ft}.`,c),s||g(t,`Packaging entries belong under ${ft}.`,c),ss(s,u,t,c)}n.length===0&&g(t,"## P\
|
|
365
|
+
ackaging needs at least one Package or exactly `- Nothing.`.");let r=n.map(a=>rs(a,t)),i=new Map;for(let a of r)i.has(a.
|
|
366
|
+
id)&&g(t,`Packaging contains a duplicate package id ${a.id}.`),i.set(a.id,a);let o=new Set;for(let a of r.filter(({packer:u})=>u===
|
|
367
|
+
"capacitor")){let u=i.get(a.content);(!u||u.packer!=="web-bundle")&&g(t,`Package ${a.id} Content must name a web-bundle \
|
|
368
|
+
package declared in Packaging.`),o.has(a.application.id)&&g(t,`Packaging declares application id ${a.application.id} twi\
|
|
369
|
+
ce.`),o.add(a.application.id)}return{version:1,packages:r}}function gt(e,t,n,s){let r=(Array.isArray(e)?e:[]).find(i=>i?.
|
|
370
|
+
name===t);return(!r||typeof r.value!="string"||!r.value.trim())&&g(n,`${s} names ${t}, which ## Environment defaults doe\
|
|
371
|
+
s not declare with a value.`),r.value.trim()}function wt(e,t=[],{path:n="genesis/stack.md#Packaging"}={}){return{...e,packages:e.
|
|
372
|
+
packages.map(s=>{if(s.packer!=="capacitor")return s;let r={...s,deepLinkScheme:null,appLinkDomains:[]};if(s.deepLinkSchemeFrom){
|
|
373
|
+
let i=gt(t,s.deepLinkSchemeFrom,n,`Package ${s.id} Deep link scheme from`);(!Hn.test(i)||["http","https","file","content",
|
|
374
|
+
"javascript"].includes(i))&&g(n,`${s.deepLinkSchemeFrom} must be a custom lowercase URL scheme such as \`notes\`.`),r.deepLinkScheme=
|
|
375
|
+
i}if(s.appLinkDomainsFrom){let i=gt(t,s.appLinkDomainsFrom,n,`Package ${s.id} App link domains from`).split(/[\s,]+/u).filter(
|
|
376
|
+
Boolean);i.some(o=>!zn.test(o))&&g(n,`${s.appLinkDomainsFrom} must list lowercase domain names separated by commas or sp\
|
|
377
|
+
aces.`),r.appLinkDomains=[...new Set(i)]}return r})}}function It({environment:e={},section:t={}}={}){G(t,e,"Packaging se\
|
|
378
|
+
ction");let n=[...t.diagnostics||[]],s={version:1,packages:[]};t.status==="ready"&&(s=wt(vt(t.lines),e.environmentDefaults));
|
|
379
|
+
let r=n.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:le,status:r,stackHash:t.stackHash,
|
|
380
|
+
packagingHash:r==="ready"?S(s):"",source:t.source||null,version:s.version,packages:s.packages,diagnostics:n}}var _t="vibe64.outputs.v1",he="Outputs",fe="vibe64.preview-identity.command.v1",w="VIBE64_OUTPUTS_INVALID",is=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,
|
|
381
|
+
Me=/\{([a-z][a-z0-9:-]*)\}/gu,os=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,as=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
382
|
+
cs=/^#### Download `([^`\r\n]+)`$/u,us=/^[A-Z_][A-Z0-9_]*$/u,ps=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,ls=new Set([
|
|
383
|
+
"HOME","LOGNAME","NODE_OPTIONS","PATH","TMPDIR","USER"]),Ot=new Set(["email","login","user-id"]),Rt=new Set(["finite","i\
|
|
384
|
+
nteractive"]),je=new Set(["development","test"]),At=new Set(["terminal","web"]),St=16,Nt=1e4,de=3e4,me=e=>[...e].map(t=>`\
|
|
385
|
+
\`${t}\``).join(" or "),Ct=[["- Command: ","command","Command","`tools/preview-identity` `argument`..."],["- Protocol: ",
|
|
386
|
+
"protocol","Protocol",`\`${fe}\``],["- Identity types: ","identityTypes","Identity types",`one or more of ${[...Ot].map(
|
|
304
387
|
e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironment","Enabled environment","`ENV_NAME`"],["- Secr\
|
|
305
388
|
et environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],["- Runtimes: ","runtimes","Runtimes","`runtime\
|
|
306
|
-
`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${
|
|
307
|
-
get `id`: Label","#### Parameter `id`: Label","#### Presentation","#### Preview identity","#### Download `id`"]),
|
|
308
|
-
freeze({target:["- Default.",`- Mode: ${
|
|
389
|
+
`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${de}\` (default ${Nt})`]],ds=Object.freeze(["### Tar\
|
|
390
|
+
get `id`: Label","#### Parameter `id`: Label","#### Presentation","#### Preview identity","#### Download `id`"]),re=Object.
|
|
391
|
+
freeze({target:["- Default.",`- Mode: ${me(Rt)}`,`- Data: ${me(je)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- P\
|
|
309
392
|
repare|Build|Run `label`: `command` `argument`..."],parameter:["- Default: `text`","- Description: `text`","- Required."],
|
|
310
|
-
presentation:[`- Kind: ${
|
|
311
|
-
`/path` returns `200`"],previewIdentity:
|
|
312
|
-
- Media type: `type/subtype`"]});function f(e,t,n,s={}){l(
|
|
313
|
-
r)||f(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),r}function
|
|
314
|
-
length),
|
|
315
|
-
i.replace(
|
|
393
|
+
presentation:[`- Kind: ${me(At)}`,"- Preferred port: `1024` through `65535`","- URL path: `/path`","- Ready when: `GET` \
|
|
394
|
+
`/path` returns `200`"],previewIdentity:Ct.map(([e,,,t])=>`${e}${t}`),download:["- Path: `path`","- Name: `file-name`","\
|
|
395
|
+
- Media type: `type/subtype`"]});function f(e,t,n,s={}){l(w,e,t,n,s)}function Ge(e,t,n,s){let r=v(e,w,t,n,s);return is.test(
|
|
396
|
+
r)||f(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),r}function Dt(e,t,n,s,r,i){return I(e.slice(t.
|
|
397
|
+
length),w,n,s,r,i)}function M(e,t,n,s,r){return Dt(e,t,n,s,r,{count:1})[0]}function ms(e,t,n,s){let r=_(e,w,t,n,s);for(let i of r)
|
|
398
|
+
i.replace(Me,"").includes("{parameter:")&&f(t,`${n} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(Me)].some(
|
|
316
399
|
o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&f(t,`${n} supports only {host}\
|
|
317
|
-
, {port}, and {parameter:id} placeholders.`,s);return r}function
|
|
318
|
-
e.seen.add(t),e[t]=n}function
|
|
400
|
+
, {port}, and {parameter:id} placeholders.`,s);return r}function A(e,t,n,s,r,i){e.seen.has(t)&&f(s,`Duplicate ${i}.`,r),
|
|
401
|
+
e.seen.add(t),e[t]=n}function fs(e,t,n){return{id:Ge(e[1],t,"Output target id",n),label:v(e[2],w,t,"Output target label",
|
|
319
402
|
n),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,downloads:[],parameters:[],
|
|
320
|
-
seen:new Set,line:n}}function
|
|
321
|
-
for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(t.startsWith(o)){let
|
|
322
|
-
`Parameter ${r}`,s);
|
|
403
|
+
seen:new Set,line:n}}function hs(e,t,n,s){if(t==="- Required."){A(e,"required",!0,n,s,"Parameter Required entry");return}
|
|
404
|
+
for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(t.startsWith(o)){let a=M(t,o,n,
|
|
405
|
+
`Parameter ${r}`,s);A(e,i,a,n,s,`Parameter ${r} entry`);return}}f(n,D("Outputs parameter entry",t,re.parameter),s)}function gs(e,t={}){
|
|
323
406
|
let n=e.parameters||[],s=i=>l("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!t||typeof t!="object"||Array.isArray(t))&&
|
|
324
407
|
s("Output parameters must be an object of text values.");let r=new Set(n.map(({id:i})=>i));for(let i of Object.keys(t))r.
|
|
325
408
|
has(i)||s(`Unknown output parameter: ${i}.`);return Object.fromEntries(n.map(i=>{let o=Object.hasOwn(t,i.id)?t[i.id]:i.default;
|
|
326
409
|
return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${i.label} must be a single line of text, at most 409\
|
|
327
|
-
6 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function
|
|
328
|
-
urlPath:"/",readiness:null,seen:new Set,line:e}}function
|
|
329
|
-
mediaType:"",seen:new Set,line:n}}function
|
|
410
|
+
6 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function Es(e){return{kind:"",preferredPort:null,
|
|
411
|
+
urlPath:"/",readiness:null,seen:new Set,line:e}}function bs(e,t,n){return{id:Ge(e[1],t,"Download id",n),path:"",name:"",
|
|
412
|
+
mediaType:"",seen:new Set,line:n}}function ys(e,t,n){/^[0-9]+$/u.test(e)||f(t,"Web presentation preferred port must be a\
|
|
330
413
|
n integer from 1024 through 65535.",n);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&f(t,"Web prese\
|
|
331
|
-
ntation preferred port must be an integer from 1024 through 65535.",n),s}function
|
|
332
|
-
let i
|
|
333
|
-
i,n,s,"output target Data entry");return}if(t==="- Default."){
|
|
334
|
-
if(t.startsWith("- Mode: ")){let i
|
|
335
|
-
interactive` or `finite`.",s),
|
|
336
|
-
orkdir",
|
|
337
|
-
return}if(t.startsWith("- Runtimes: ")){
|
|
414
|
+
ntation preferred port must be an integer from 1024 through 65535.",n),s}function vs(e,t,n,s){if(t.startsWith("- Data: ")){
|
|
415
|
+
let i=M(t,"- Data: ",n,"Output target Data",s);je.has(i)||f(n,`Output target Data must be ${me(je)}.`,s),A(e,"dataMode",
|
|
416
|
+
i,n,s,"output target Data entry");return}if(t==="- Default."){A(e,"default",!0,n,s,"output target Default entry");return}
|
|
417
|
+
if(t.startsWith("- Mode: ")){let i=M(t,"- Mode: ",n,"Output target Mode",s);Rt.has(i)||f(n,"Output target Mode must be `\
|
|
418
|
+
interactive` or `finite`.",s),A(e,"mode",i,n,s,"output target Mode entry");return}if(t.startsWith("- Workdir: ")){A(e,"w\
|
|
419
|
+
orkdir",E(M(t,"- Workdir: ",n,"Output target Workdir",s),w,n,"Output target workdir",s),n,s,"output target Workdir entry");
|
|
420
|
+
return}if(t.startsWith("- Runtimes: ")){A(e,"runtimeRequirements",O(t.slice(12),w,n,"Output target runtimes",s),n,s,"out\
|
|
338
421
|
put target Runtimes entry");return}let r=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(r){let i=r[1].toLowerCase(),
|
|
339
|
-
o=
|
|
340
|
-
Run step may use {host} or {port} placeholders.",s),e.steps.push({label:
|
|
341
|
-
return}f(n,
|
|
342
|
-
let r
|
|
343
|
-
nd",r,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){
|
|
422
|
+
o=ms(r[3],n,"Output step command",s);i!=="run"&&o.some(a=>/\{(?:host|port)\}/u.test(a))&&f(n,"Only a web presentation's \
|
|
423
|
+
Run step may use {host} or {port} placeholders.",s),e.steps.push({label:v(r[2],w,n,"Output step label",s),argv:o,role:i});
|
|
424
|
+
return}f(n,D("Outputs target entry",t,[...re.target,...ds.slice(1)]),s)}function ws(e,t,n,s){if(t.startsWith("- Kind: ")){
|
|
425
|
+
let r=M(t,"- Kind: ",n,"Presentation Kind",s);At.has(r)||f(n,"Presentation Kind must be `terminal` or `web`.",s),A(e,"ki\
|
|
426
|
+
nd",r,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){A(e,"preferredPort",ys(M(t,"- Preferr\
|
|
344
427
|
ed port: ",n,"Web presentation Preferred port",s),n,s),n,s,"Presentation Preferred port entry");return}if(t.startsWith("\
|
|
345
|
-
- URL path: ")){
|
|
346
|
-
n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){
|
|
347
|
-
readiness",s),n,s,"Presentation Ready when entry");return}f(n,
|
|
348
|
-
let s=
|
|
349
|
-
wnload Name must be a safe filename without path separators.",n),s}function
|
|
350
|
-
n);return(s.length>127||!
|
|
351
|
-
if(t.startsWith("- Path: ")){
|
|
352
|
-
"Download Path entry");return}if(t.startsWith("- Name: ")){
|
|
353
|
-
ownload Name entry");return}if(t.startsWith("- Media type: ")){
|
|
354
|
-
type",s),n,s),n,s,"Download Media type entry");return}f(n,
|
|
428
|
+
- URL path: ")){A(e,"urlPath",Se(M(t,"- URL path: ",n,"Web presentation URL path",s),w,n,"Web presentation URL path",s),
|
|
429
|
+
n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){A(e,"readiness",ue(t,w,n,"Web presentation \
|
|
430
|
+
readiness",s),n,s,"Presentation Ready when entry");return}f(n,D("Presentation entry",t,re.presentation),s)}function Is(e,t,n){
|
|
431
|
+
let s=v(e,w,t,"Download Name",n);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||s.trim()!==s)&&f(t,"Do\
|
|
432
|
+
wnload Name must be a safe filename without path separators.",n),s}function Ss(e,t,n){let s=v(e,w,t,"Download Media type",
|
|
433
|
+
n);return(s.length>127||!ps.test(s))&&f(t,"Download Media type must be a lowercase type/subtype value.",n),s}function Ts(e,t,n,s){
|
|
434
|
+
if(t.startsWith("- Path: ")){A(e,"path",E(M(t,"- Path: ",n,"Download Path",s),w,n,"Download path",s,{allowRoot:!1}),n,s,
|
|
435
|
+
"Download Path entry");return}if(t.startsWith("- Name: ")){A(e,"name",Is(M(t,"- Name: ",n,"Download Name",s),n,s),n,s,"D\
|
|
436
|
+
ownload Name entry");return}if(t.startsWith("- Media type: ")){A(e,"mediaType",Ss(M(t,"- Media type: ",n,"Download Media\
|
|
437
|
+
type",s),n,s),n,s,"Download Media type entry");return}f(n,D("Download entry",t,re.download),s)}function ks(e,t,n){for(let[
|
|
355
438
|
s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||f(t,`Output target ${n} Download ${e.id} needs ${r}\
|
|
356
|
-
.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function
|
|
357
|
-
e,
|
|
358
|
-
ntity ${n} environment name is invalid.`,s),r}function
|
|
359
|
-
([
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
let s=e.command.map(
|
|
364
|
-
"\\")||r[0].split("/").some(
|
|
365
|
-
|
|
366
|
-
identity protocol must be ${
|
|
367
|
-
identity type: ${
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
e.line);let u=
|
|
371
|
-
1 through ${
|
|
372
|
-
|
|
373
|
-
map(
|
|
439
|
+
.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Tt(e,t,n,s){if(e===void 0)return"";let r=v(
|
|
440
|
+
e,w,t,`Preview identity ${n} environment name`,s);return(!us.test(r)||ls.has(r)||r.startsWith("XDG_"))&&f(t,`Preview ide\
|
|
441
|
+
ntity ${n} environment name is invalid.`,s),r}function _s(e){return{seen:new Set,line:e}}function Os(e,t,n,s){let r=Ct.find(
|
|
442
|
+
([c])=>t.startsWith(c));r||f(n,D("Preview identity entry",t,re.previewIdentity),s);let[i,o,a]=r,u=Dt(t,i,n,`Preview iden\
|
|
443
|
+
tity ${a}`,s);!["command","identityTypes","runtimes"].includes(o)&&u.length!==1&&f(n,`Preview identity ${a} accepts exac\
|
|
444
|
+
tly one value.`,s),A(e,o,u,n,s,`Preview identity ${a} entry`)}function Rs(e,t,n){for(let[c,p]of[["command","Command"],["\
|
|
445
|
+
protocol","Protocol"],["identityTypes","Identity types"]])e[c]||f(t,`Output target ${n} Preview identity needs ${p}.`,e.
|
|
446
|
+
line);let s=e.command.map(c=>`\`${c}\``).join(" "),r=_(s,w,t,"Preview identity command",e.line);(!r[0].includes("/")||r[0].
|
|
447
|
+
includes("\\")||r[0].split("/").some(c=>!c||[".",".."].includes(c))||r.some(c=>/\{(?:host|port)\}/u.test(c)))&&f(t,"Prev\
|
|
448
|
+
iew identity command must use a literal app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==fe&&f(t,
|
|
449
|
+
`Preview identity protocol must be ${fe}.`,e.line);let o=[...new Set(e.identityTypes.map(c=>(Ot.has(c)||f(t,`Unsupported\
|
|
450
|
+
preview identity type: ${c}.`,e.line),c)))];o.length!==e.identityTypes.length&&f(t,"Preview identity types must not con\
|
|
451
|
+
tain duplicates.",e.line);let a={enabled:Tt(e.enabledEnvironment?.[0],t,"enabled",e.line),secret:Tt(e.secretEnvironment?.[0],
|
|
452
|
+
t,"secret",e.line)};a.enabled&&a.enabled===a.secret&&f(t,"Preview identity enabled and secret environment names must dif\
|
|
453
|
+
fer.",e.line);let u=Nt;if(e.timeoutMs){let c=e.timeoutMs[0];/^[0-9]+$/u.test(c)||f(t,`Preview identity Timeout ms must b\
|
|
454
|
+
e from 1 through ${de}.`,e.line),u=Number(c),(!Number.isSafeInteger(u)||u<1||u>de)&&f(t,`Preview identity Timeout ms mus\
|
|
455
|
+
t be from 1 through ${de}.`,e.line)}return{command:r,environment:a,identityTypes:o,protocol:i,runtimes:e.runtimes?O(e.runtimes.
|
|
456
|
+
map(c=>`\`${c}\``).join(" "),w,t,"Preview identity runtimes",e.line):[],timeoutMs:u}}function As(e,t,n){return e.kind||f(
|
|
374
457
|
t,`Output target ${n} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.readiness||e.seen.
|
|
375
458
|
has("urlPath"))&&f(t,`Output target ${n} terminal Presentation accepts only Kind.`,e.line),{kind:"terminal"}):(e.readiness||
|
|
376
459
|
f(t,`Output target ${n} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.preferredPort,
|
|
377
|
-
urlPath:e.urlPath,readiness:e.readiness})}function
|
|
378
|
-
e.steps.length===0&&f(t,`Output target ${e.id} needs at least one step.`,e.line);let n={prepare:0,build:1,run:2};for(let
|
|
379
|
-
e.steps.length;
|
|
380
|
-
uild, then Run.`,e.line);let s=e.steps.filter(({role:
|
|
381
|
-
id:
|
|
460
|
+
urlPath:e.urlPath,readiness:e.readiness})}function kt(e,t){e.mode||f(t,`Output target ${e.id} needs one Mode entry.`,e.line),
|
|
461
|
+
e.steps.length===0&&f(t,`Output target ${e.id} needs at least one step.`,e.line);let n={prepare:0,build:1,run:2};for(let c=1;c<
|
|
462
|
+
e.steps.length;c+=1)n[e.steps[c].role]<n[e.steps[c-1].role]&&f(t,`Output target ${e.id} steps must be ordered Prepare, B\
|
|
463
|
+
uild, then Run.`,e.line);let s=e.steps.filter(({role:c})=>c==="run"),r=e.downloads.map(c=>ks(c,t,e.id));new Set(r.map(({
|
|
464
|
+
id:c})=>c)).size!==r.length&&f(t,`Output target ${e.id} contains a duplicate Download id.`,e.line),e.mode==="finite"?((s.
|
|
382
465
|
length>0||e.presentation||e.previewIdentity)&&f(t,`Finite output target ${e.id} cannot have Run, Presentation, or Previe\
|
|
383
466
|
w identity entries.`,e.line),r.length===0&&f(t,`Finite output target ${e.id} needs at least one Download.`,e.line)):s.length!==
|
|
384
467
|
1||e.steps.at(-1).role!=="run"?f(t,`Interactive output target ${e.id} needs exactly one final Run step.`,e.line):e.presentation||
|
|
385
|
-
f(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?
|
|
386
|
-
o=e.steps.flatMap(({argv:
|
|
387
|
-
kind!=="web"&&f(t,"Only a web output target may use {host} or {port} placeholders.",e.line);let
|
|
388
|
-
...
|
|
389
|
-
t ${
|
|
390
|
-
|
|
391
|
-
er ${
|
|
468
|
+
f(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?As(e.presentation,t,e.id):null,
|
|
469
|
+
o=e.steps.flatMap(({argv:c})=>c.flatMap(p=>[...p.matchAll(Me)].map(m=>m[1])));o.some(c=>["host","port"].includes(c))&&i?.
|
|
470
|
+
kind!=="web"&&f(t,"Only a web output target may use {host} or {port} placeholders.",e.line);let a=e.parameters.map(({seen:c,
|
|
471
|
+
...p})=>p),u=new Set(a.map(({id:c})=>c));(a.length>St||u.size!==a.length)&&f(t,`Output target ${e.id} may declare at mos\
|
|
472
|
+
t ${St} parameters with unique ids.`,e.line);for(let c of o.filter(p=>p.startsWith("parameter:"))){let p=c.slice(10);u.has(
|
|
473
|
+
p)||f(t,`Undeclared output parameter: ${p}.`,e.line)}for(let c of a)o.includes(`parameter:${c.id}`)||f(t,`Output paramet\
|
|
474
|
+
er ${c.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!=="web"&&f(t,"Only a web output ta\
|
|
392
475
|
rget may declare Preview identity.",e.line),{id:e.id,label:e.label,default:e.default,mode:e.mode,workdir:e.workdir,runtimeRequirements:e.
|
|
393
|
-
runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,downloads:r,...
|
|
394
|
-
{},...e.previewIdentity?{previewIdentity:
|
|
395
|
-
ts"}={}){if(Array.isArray(e)||f(t,"Outputs must be supplied as exact Stack section lines."),
|
|
396
|
-
let n=[],s=null,r="target",i=null;for(let
|
|
397
|
-
if(
|
|
398
|
-
let
|
|
476
|
+
runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,downloads:r,...a.length?{parameters:a}:
|
|
477
|
+
{},...e.previewIdentity?{previewIdentity:Rs(e.previewIdentity,t,e.id)}:{}}}function ge(e,{path:t="genesis/stack.md#Outpu\
|
|
478
|
+
ts"}={}){if(Array.isArray(e)||f(t,"Outputs must be supplied as exact Stack section lines."),b(e))return{version:1,targets:[]};
|
|
479
|
+
let n=[],s=null,r="target",i=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)continue;let c=a+1,p=u.match(os);
|
|
480
|
+
if(p){s&&n.push(kt(s,t)),s=fs(p,t,c),r="target",i=null;continue}s||f(t,"## Outputs must begin with a Target heading.",c);
|
|
481
|
+
let m=u.match(as);if(m){let h={id:Ge(m[1],t,"Parameter id",c),label:v(m[2],w,t,"Parameter label",c),default:"",description:"",
|
|
399
482
|
required:!1,seen:new Set};s.parameters.push(h),r="parameter",i=h;continue}if(u==="#### Presentation"){s.presentation&&f(
|
|
400
|
-
t,"Presentation must appear at most once below an output target.",
|
|
483
|
+
t,"Presentation must appear at most once below an output target.",c),s.presentation=Es(c),r="presentation",i=s.presentation;
|
|
401
484
|
continue}if(u==="#### Preview identity"){s.previewIdentity&&f(t,"Preview identity must appear at most once below an outp\
|
|
402
|
-
ut target.",
|
|
403
|
-
|
|
404
|
-
viewIdentity"?
|
|
405
|
-
at least one Target or exactly `- Nothing.`.");let o=n.map(({id:
|
|
406
|
-
contains a duplicate target id."),n.filter(({default:
|
|
407
|
-
et."),{version:1,targets:n}}function
|
|
408
|
-
[]],s=[...e.diagnostics||[]],r={version:1,targets:[]};t.status==="ready"&&(r=
|
|
409
|
-
({message:
|
|
410
|
-
|
|
411
|
-
stackHash,components:[...t.components||[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:
|
|
412
|
-
o.flatMap(
|
|
413
|
-
t services",
|
|
414
|
-
if(Array.isArray(e)||l(
|
|
485
|
+
ut target.",c),s.previewIdentity=_s(c),r="previewIdentity",i=s.previewIdentity;continue}let d=u.match(cs);if(d){let h=bs(
|
|
486
|
+
d,t,c);s.downloads.push(h),r="download",i=h;continue}r==="parameter"?hs(i,u,t,c):r==="presentation"?ws(i,u,t,c):r==="pre\
|
|
487
|
+
viewIdentity"?Os(i,u,t,c):r==="download"?Ts(i,u,t,c):vs(s,u,t,c)}s&&n.push(kt(s,t)),n.length===0&&f(t,"## Outputs needs \
|
|
488
|
+
at least one Target or exactly `- Nothing.`.");let o=n.map(({id:a})=>a);return new Set(o).size!==o.length&&f(t,"Outputs \
|
|
489
|
+
contains a duplicate target id."),n.filter(({default:a})=>a).length>1&&f(t,"Outputs may declare at most one default targ\
|
|
490
|
+
et."),{version:1,targets:n}}function Pt({environment:e={},section:t={}}={}){G(t,e,"Outputs section");let n=[...t.diagnostics||
|
|
491
|
+
[]],s=[...e.diagnostics||[]],r={version:1,targets:[]};t.status==="ready"&&(r=ge(t.lines));let i=s.length===0?null:s.map(
|
|
492
|
+
({message:c})=>c).join(" "),o=r.targets.map(c=>({...c,source:t.source||null,available:n.length===0&&s.length===0,disabledReason:i})),
|
|
493
|
+
a=[...n,...s],u="ready";return a.length>0?u="blocked":o.length===0&&(u="unconfigured"),{contract:_t,status:u,stackHash:t.
|
|
494
|
+
stackHash,components:[...t.components||[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:B(
|
|
495
|
+
o.flatMap(c=>c.runtimeRequirements)),resources:structuredClone(e.resources||[]),targets:o,diagnostics:a}}var Vt="Project services",Ns="vibe64.project-services.v1",F="VIBE64_PROJECT_SERVICES_INVALID",K="genesis/stack.md#Projec\
|
|
496
|
+
t services",Cs="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function $t(e){
|
|
497
|
+
if(Array.isArray(e)||l(F,K,"Expected exact Project services section lines."),b(e))return[];let t=[];for(let[n,s]of e.entries()){
|
|
415
498
|
let r=s.trim();if(!r)continue;let i=n+1,o=r.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
|
|
416
|
-
o||l(
|
|
417
|
-
t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:
|
|
418
|
-
".",
|
|
419
|
-
`- Nothing.`."),t}function
|
|
420
|
-
ed"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?
|
|
421
|
-
1024,
|
|
422
|
-
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function
|
|
423
|
-
e,t,n)}function
|
|
424
|
-
quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function
|
|
499
|
+
o||l(F,K,`Use: ${Cs}`,i),t.some(({id:u})=>u===o[1])&&l(F,K,"Duplicate project service id.",i);let a=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
|
|
500
|
+
t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:O(a?a[1]:o[3],F,K,"Service runtimes",i),workdir:E(a?.[2]||
|
|
501
|
+
".",F,K,"Service workdir",i),argv:_(o[4],F,K,"Service command",i)})}return t.length||l(F,K,"Declare a service or exactly\
|
|
502
|
+
`- Nothing.`."),t}function xt(e={}){let t=e.status==="ready"?$t(e.lines):[];return{contract:Ns,status:e.status==="block\
|
|
503
|
+
ed"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?S(t):"",diagnostics:e.diagnostics||[]}}var jt="vibe64.resource-estimates.v1",Ee="Resource estimates",Gt="VIBE64_RESOURCE_ESTIMATES_INVALID",Ds=1024*1024,Lt=1024*
|
|
504
|
+
1024,Mt=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
|
|
505
|
+
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function L(e,t,n){l(Gt,
|
|
506
|
+
e,t,n)}function Be(e,t,n,s,r){let i=e.get(t),o=e.get(n);return(i===void 0||o===void 0||i>o)&&L(s,"Each resource phase re\
|
|
507
|
+
quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function Bt(e,{path:t="\
|
|
425
508
|
genesis/stack.md#Resource estimates",targets:n=[],hasWorkspaceSetup:s=!1}={}){(!Array.isArray(e)||e.length>2048||e.some(
|
|
426
|
-
|
|
427
|
-
`),"utf8")>64*1024)&&
|
|
428
|
-
outputs:[],workspaceSetup:null};if(
|
|
429
|
-
let{targetId:
|
|
430
|
-
ts require separate Startup and Running estimates.",
|
|
431
|
-
startupHigh",t,
|
|
432
|
-
|
|
433
|
-
outputs.push({targetId:
|
|
434
|
-
continue;let p
|
|
435
|
-
"",
|
|
436
|
-
get(
|
|
437
|
-
|
|
438
|
-
line:
|
|
439
|
-
or Workspace setup heading followed by positive integer MiB estimates: ${[...
|
|
440
|
-
"; ")}.`,
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=
|
|
445
|
-
y"?
|
|
446
|
-
OperationError")throw o;s.push({code:
|
|
447
|
-
valid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:
|
|
448
|
-
sectionHash||"",estimatesHash:i==="ready"?
|
|
449
|
-
fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var
|
|
450
|
-
ntime` in `workdir`: `command` `argument`...";function
|
|
451
|
-
e)||l(
|
|
452
|
-
s=n.length===1&&n[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return s||l(
|
|
453
|
-
s exactly one entry: ${
|
|
454
|
-
ion setup workdir"),runtimeRequirements:
|
|
455
|
-
...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?
|
|
456
|
-
"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?
|
|
457
|
-
...e.components||[]],command:n,diagnostics:t}}var
|
|
458
|
-
"Genesis host context requires an absolute runtime root.");let t=
|
|
459
|
-
catch(s=>{throw
|
|
460
|
-
stringify({registryPath:t.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var{GENESIS_CONTRACTS:
|
|
461
|
-
HOST_CONTEXT_RESOLVER_ENV:
|
|
462
|
-
inspectDerivedArtifacts:
|
|
463
|
-
inspectSkills:
|
|
464
|
-
setCollaboration:
|
|
465
|
-
sourceExplanationGuidance:
|
|
466
|
-
mergeArchitectureObservations:
|
|
467
|
-
|
|
468
|
-
["adopt","blueprint","describe","deslop","program","review","start","work"]);function
|
|
469
|
-
function
|
|
470
|
-
|
|
471
|
-
"work"}function
|
|
472
|
-
Boolean)||"Continue the requested project work."}function
|
|
473
|
-
|
|
474
|
-
The installed Genesis compiler executable could not be located.");return
|
|
475
|
-
"@local/vibe64-genesis/server");return
|
|
476
|
-
enesis-host-context")}function
|
|
477
|
-
r))),t]}function
|
|
478
|
-
return
|
|
479
|
-
return
|
|
480
|
-
|
|
481
|
-
contract!==
|
|
482
|
-
.`);let t=Array.isArray(e.artifacts)?e.artifacts:[];if(!t.length||t.some(n=>!
|
|
483
|
-
ed an invalid derived-artifact contract.");return{...e,artifacts:t.map(n=>({...n}))}}var
|
|
484
|
-
map(e=>e.path)),
|
|
485
|
-
if(!
|
|
486
|
-
t.projectRoot);if(!s||!
|
|
487
|
-
return
|
|
488
|
-
|
|
509
|
+
c=>typeof c!="string")||Buffer.byteLength(e.join(`
|
|
510
|
+
`),"utf8")>64*1024)&&L(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let r={version:1,
|
|
511
|
+
outputs:[],workspaceSetup:null};if(b(e))return r;let i=new Map(n.map(c=>[c.id,c])),o=new Set,a=null;function u(){if(!a)return;
|
|
512
|
+
let{targetId:c,mode:p,fields:m,line:d}=a;if(p==="interactive"){(m.has("typical")||m.has("high"))&&L(t,"Interactive outpu\
|
|
513
|
+
ts require separate Startup and Running estimates.",d),r.outputs.push({targetId:c,mode:p,startup:Be(m,"startupTypical","\
|
|
514
|
+
startupHigh",t,d),running:Be(m,"runningTypical","runningHigh",t,d)});return}(m.size!==2||!m.has("typical")||!m.has("high"))&&
|
|
515
|
+
L(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",d);let h=Be(m,"typical","high",t,d);c?r.
|
|
516
|
+
outputs.push({targetId:c,mode:p,execution:h}):r.workspaceSetup=h}for(let c=0;c<e.length;c+=1){let p=e[c].trim(),m=c+1;if(!p)
|
|
517
|
+
continue;let d=p.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(d||p==="### Workspace setup"){u();let k=d?.[1]||
|
|
518
|
+
"",te=k?`output:${k}`:"workspace-setup";o.has(te)&&L(t,"Resource estimates contains a duplicate operation.",m),o.add(te);
|
|
519
|
+
let X=i.get(k);k&&!["interactive","finite"].includes(X?.mode)&&L(t,`Resource estimate references an undeclared output: ${k}\
|
|
520
|
+
.`,m),!k&&!s&&L(t,"Resource estimate references undeclared Workspace setup steps.",m),a={targetId:k,mode:X?.mode||"setup",
|
|
521
|
+
fields:new Map,line:m};continue}let h=p.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),y=h&&Mt.get(h[1]);(!a||!y)&&L(t,`Exp\
|
|
522
|
+
ected an Output or Workspace setup heading followed by positive integer MiB estimates: ${[...Mt.keys()].map(k=>`- ${k}: \
|
|
523
|
+
\`number\``).join("; ")}.`,m),a.fields.has(y)&&L(t,`Duplicate resource field: ${h[1]}.`,m);let J=Number(h[2]);(!Number.isSafeInteger(
|
|
524
|
+
J)||J>Lt)&&L(t,`Resource estimates must be between 1 and ${Lt} MiB.`,m),a.fields.set(y,J*Ds)}return u(),o.size===0&&L(t,
|
|
525
|
+
"Resource estimates needs an operation or exactly `- Nothing.`."),r}function be({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){
|
|
526
|
+
G(e,t,"Resource estimates and Outputs"),G(e,n,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={
|
|
527
|
+
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=Bt(e.lines,{targets:t.status==="read\
|
|
528
|
+
y"?ge(t.lines).targets:[],hasWorkspaceSetup:n.status==="ready"&&Q(n.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stack\
|
|
529
|
+
OperationError")throw o;s.push({code:Gt,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"in\
|
|
530
|
+
valid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:jt,status:i,stackHash:e.stackHash,sectionHash:e.
|
|
531
|
+
sectionHash||"",estimatesHash:i==="ready"?S(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
|
|
532
|
+
fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var Ut="vibe64.integration-setup.v1",Wt="Integration setup",ie="VIBE64_INTEGRATION_SETUP_INVALID",Ps="- Command with `ru\
|
|
533
|
+
ntime` in `workdir`: `command` `argument`...";function Ht(e,{path:t="genesis/stack.md#Integration setup"}={}){if(Array.isArray(
|
|
534
|
+
e)||l(ie,t,"Integration setup requires exact Stack section lines."),b(e))return null;let n=e.map(r=>r.trim()).filter(Boolean),
|
|
535
|
+
s=n.length===1&&n[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return s||l(ie,t,`Integration setup require\
|
|
536
|
+
s exactly one entry: ${Ps}; or - Nothing.`),{argv:_(s[3],ie,t,"Integration setup command"),workdir:E(s[2],ie,t,"Integrat\
|
|
537
|
+
ion setup workdir"),runtimeRequirements:O(s[1],ie,t,"Integration setup runtimes")}}function zt({section:e={}}={}){let t=[
|
|
538
|
+
...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?Ht(e.lines):null;return{contract:Ut,status:t.length?"blocked":n?
|
|
539
|
+
"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?S({version:1,command:n}):"",source:e.source||null,components:[
|
|
540
|
+
...e.components||[]],command:n,diagnostics:t}}var Vs=new URL("./index.js",import.meta.url).href,Ft=xs(Vs),ye=new Map;async function Ls(e){if(!j.isAbsolute(e||""))throw new TypeError(
|
|
541
|
+
"Genesis host context requires an absolute runtime root.");let t=j.join(e,"genesis-context");if(!ye.has(t)){let n=at(t).
|
|
542
|
+
catch(s=>{throw ye.delete(t),s});ye.set(t,n)}return ye.get(t)}async function wi(e){let t=await Ls(e);return{[js]:fr(),[Ms]:JSON.
|
|
543
|
+
stringify({registryPath:t.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var{GENESIS_CONTRACTS:N,HOST_CONTEXT_RESOLVER_DATA_ENV:Ms,
|
|
544
|
+
HOST_CONTEXT_RESOLVER_ENV:js,addStack:Gs,applyTemplate:Bs,generatePrompt:Ue,indexCodebase:Us,initialize:Ws,inspectCollaboration:Hs,
|
|
545
|
+
inspectDerivedArtifacts:zs,inspectEngineering:qs,inspectEnvironment:ve,inspectProject:Fs,inspectProjectFormat:Ks,inspectAgentIntegrations:Ys,
|
|
546
|
+
inspectSkills:Js,inspectStackSection:Xs,inspectStackSections:Zs,inspectSubsystems:Qs,listTemplates:er,parserEnvironment:tr,
|
|
547
|
+
setCollaboration:nr,setEngineeringProfile:sr,syncAgentIntegrations:rr,syncSkills:ir,withTrustedGitRepository:or,SOURCE_EXPLANATION_PROMPT_VERSION:Ii,
|
|
548
|
+
sourceExplanationGuidance:Si,sourceExplanationReviewGuidance:Ti,validateArchitectureFacts:ki,validateArchitectureObservations:_i,
|
|
549
|
+
mergeArchitectureObservations:Oi}=oe,Ri="genesis/blueprint.md",Ai="genesis/subsystems.md",ar=!1,cr=Object.freeze(["vue",
|
|
550
|
+
...ar?[]:["django-postgresql","jskit-postgresql","postgresql","rails-postgresql","spring-boot-postgresql"]]),ur=Object.freeze(
|
|
551
|
+
["genesis-stack"]),pr=new Set(["adopt","blueprint","describe","deslop","program","review","start","work"]);function Y(e=""){
|
|
552
|
+
return String(e||"").trim()}function Kt(e,{required:t=!1}={}){let n=Y(e);if(!n&&!t)return"";if(!pr.has(n))throw new TypeError(
|
|
553
|
+
n?`Unknown Genesis prompt task: ${n}.`:"Genesis prompt actions require an explicit task.");return n}function lr(e={}){return Kt(
|
|
554
|
+
e.genesisTask)||"work"}function dr(e={},t={}){return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,t.label].
|
|
555
|
+
map(Y).find(Boolean)||"Continue the requested project work."}function Ni(e={}){return tr(e)}function mr(){let e=(Ft.resolve.
|
|
556
|
+
paths("genesis-compiler")||[]).find(t=>qt(j.join(t,"genesis-compiler"))&&qt(j.join(t,".bin","genesis")));if(!e)throw new Error(
|
|
557
|
+
"The installed Genesis compiler executable could not be located.");return j.join(e,".bin")}function Yt(){let e=Ft.resolve(
|
|
558
|
+
"@local/vibe64-genesis/server");return j.resolve(j.dirname(e),"../../bin")}function fr(){return j.resolve(Yt(),"vibe64-g\
|
|
559
|
+
enesis-host-context")}function Ci(e=[]){let t=Yt(),n=mr();return[...(Array.isArray(e)?e:[]).filter(r=>![t,n].includes(Y(
|
|
560
|
+
r))),t]}function hr(e={},{prompt:t=!1}={}){return{...e,...t?{hiddenStackPieces:cr}:{},stackPackages:ur}}function Di(e={}){
|
|
561
|
+
return T(Gs,e)}function Pi(e={}){return T(Ws,e)}function Vi(e={}){return T(Js,e)}function $i(e={}){return T(ir,e)}function xi(e={}){
|
|
562
|
+
return T(rr,e)}function Li(e={}){return T(Ys,e)}function Mi(e={}){return T(Qs,e)}async function ji(e={}){return Qe(await H(
|
|
563
|
+
Ze,e))}async function Gi(e={}){return tt(await H(et,e))}function Bi(e={}){return T(Us,e)}function gr(){let e=zs();if(e?.
|
|
564
|
+
contract!==N.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||"no contract identity"}; expected ${N.derivedArtifacts}\
|
|
565
|
+
.`);let t=Array.isArray(e.artifacts)?e.artifacts:[];if(!t.length||t.some(n=>!Y(n?.path)))throw new Error("Genesis return\
|
|
566
|
+
ed an invalid derived-artifact contract.");return{...e,artifacts:t.map(n=>({...n}))}}var Jt=gr(),Ui=Object.freeze(Jt.artifacts.
|
|
567
|
+
map(e=>e.path)),Xt=new Map(Jt.artifacts.map(e=>[e.id,e])),Er=Xt.get("machine-city")?.path,br=Xt.get("program-city")?.path;
|
|
568
|
+
if(!Er||!br)throw new Error("Genesis did not declare both City projection artifacts.");async function T(e,t={},n={}){let s=Y(
|
|
569
|
+
t.projectRoot);if(!s||!j.isAbsolute(s))throw new TypeError("Genesis operations require an explicit absolute projectRoot.");
|
|
570
|
+
return or(s,()=>e(hr(t,n)))}async function Wi({workdir:e,promptContext:t}){let n=ee(t);return t.scope==="ephemeral"?n:(await T(
|
|
571
|
+
oe.projectSessionContext,{projectRoot:e,hostDriver:ee,hostDriverInput:t})).output}async function $(e,t,n={}){let s=await T(
|
|
489
572
|
e,n);if(s?.contract!==t)throw new Error(`Genesis returned ${s?.contract||"no contract identity"}; expected ${t}.`);return s}
|
|
490
|
-
function
|
|
491
|
-
t);if(!Array.isArray(n)||n.length!==e.length||n.some((s,r)=>s?.contract!==
|
|
492
|
-
"Genesis returned an invalid Stack section inspection batch.");return n}async function
|
|
573
|
+
function H(e,t={}){return $(n=>Xs({...n,name:e}),N.stackSection,t)}async function We(e,t={}){let n=await T(s=>Zs({...s,names:e}),
|
|
574
|
+
t);if(!Array.isArray(n)||n.length!==e.length||n.some((s,r)=>s?.contract!==N.stackSection||s.name!==e[r]))throw new Error(
|
|
575
|
+
"Genesis returned an invalid Stack section inspection batch.");return n}async function Hi(e={}){if((await yr(e)).status!==
|
|
493
576
|
"current")throw Object.assign(new Error("The project needs a current Genesis format before its Stack can be inspected."),
|
|
494
|
-
{code:"vibe64_stack_format_required"});await
|
|
495
|
-
components:n.components,stackHash:n.stackHash}}async function
|
|
496
|
-
e)]);return
|
|
497
|
-
|
|
498
|
-
function
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return
|
|
505
|
-
async function
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
task:o},{prompt:!0})
|
|
510
|
-
request:i,sessionContextInstalled:!0,task:o},{prompt:!0});else
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
577
|
+
{code:"vibe64_stack_format_required"});await $s(j.join(e.projectRoot,"genesis/stack.md"),"utf8");let n=await H(ne,e);return{
|
|
578
|
+
components:n.components,stackHash:n.stackHash}}async function zi(e={}){let[t,n]=await Promise.all([H(ut,e),$(ve,N.environment,
|
|
579
|
+
e)]);return lt({environment:n,section:t})}async function qi(e={}){let[t,n]=await Promise.all([H(Et,e),$(ve,N.environment,
|
|
580
|
+
e)]);return It({environment:n,section:t})}function Fi(e={}){return T(oe.verify,e)}function Ki(e={}){return $(ve,N.environment,
|
|
581
|
+
e)}function Yi(e={}){return $(Fs,N.projectInspection,e)}function Ji(e={}){return $(er,N.templates,e)}function Xi(e={}){return $(
|
|
582
|
+
Bs,N.templateApplication,e)}function Zi(e={}){return $(qs,N.engineering,e)}function Qi(e={}){return $(Hs,N.collaboration,
|
|
583
|
+
e)}async function yr(e={}){let t=await T(Ks,e);if(!Y(t?.status))throw new Error("Genesis did not return a project-format\
|
|
584
|
+
status.");return{...t}}function eo(e={}){return $(sr,N.engineering,e)}function to(e={}){return $(nr,N.collaboration,e)}
|
|
585
|
+
async function no(e={}){let[[t,n,s],r]=await Promise.all([We([he,Ee,ne],e),$(ve,N.environment,e)]);return{...Pt({environment:r,
|
|
586
|
+
section:t}),resourceEstimates:be({section:n,outputsSection:t,workspaceSetupSection:s})}}async function so(e={}){let t=await H(
|
|
587
|
+
Wt,e);return zt({section:t})}async function ro(e={}){return Xe(await H(Je,e))}async function io(e={}){return xt(await H(
|
|
588
|
+
Vt,e))}async function oo(e={}){let[t,n,s]=await We([ne,Ee,he],e);return{...await qe({projectRoot:e.projectRoot,section:t}),
|
|
589
|
+
resourceEstimates:be({section:n,outputsSection:s,workspaceSetupSection:t})}}async function ao(e={}){let[t,n,s]=await We(
|
|
590
|
+
[Ee,he,ne],e);return be({section:t,outputsSection:n,workspaceSetupSection:s})}async function co({action:e={},environment:t=process.
|
|
591
|
+
env,input:n={},projectRoot:s}={}){let r=lr(e),i=dr(n,e),o=r,a;try{a=await T(Ue,{environment:t,projectRoot:s,request:i,sessionContextInstalled:!0,
|
|
592
|
+
task:o},{prompt:!0})}catch(c){if(c?.code==="BLUEPRINT_INVALID"&&r!=="blueprint")o="blueprint",a=await T(Ue,{environment:t,
|
|
593
|
+
projectRoot:s,request:i,sessionContextInstalled:!0,task:o},{prompt:!0});else if(c?.code==="BLUEPRINT_REQUIRED"&&r!=="sta\
|
|
594
|
+
rt")o="start",a=await T(Ue,{environment:t,projectRoot:s,request:i,sessionContextInstalled:!0,task:o},{prompt:!0});else throw c}
|
|
595
|
+
let u=Kt(a.task)||o;return{context:{genesis:!0,requestedTask:r,task:u,verificationCommands:a.verificationCommands,warnings:a.
|
|
596
|
+
warnings},originalPrompt:i,prompt:a.prompt,promptId:Y(e.promptId||e.id)||u}}export{Ri as GENESIS_BLUEPRINT_PATH,Ui as GENESIS_DERIVED_ARTIFACT_PATHS,Er as GENESIS_MACHINE_CITY_PATH,br as GENESIS_PROGRAM_CITY_PATH,
|
|
597
|
+
nt as GENESIS_STACK_CONTRACTS_INCOMPLETE,st as GENESIS_STACK_SECTION_AMBIGUOUS,Ai as GENESIS_SUBSYSTEMS_PATH,Ms as HOST_CONTEXT_RESOLVER_DATA_ENV,
|
|
598
|
+
js as HOST_CONTEXT_RESOLVER_ENV,Ii as SOURCE_EXPLANATION_PROMPT_VERSION,ct as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,ut as VIBE64_APPLICATION_DEPLOYMENT_SECTION,
|
|
599
|
+
Ut as VIBE64_INTEGRATION_SETUP_CONTRACT,Wt as VIBE64_INTEGRATION_SETUP_SECTION,_t as VIBE64_OUTPUTS_CONTRACT,he as VIBE64_OUTPUTS_SECTION,
|
|
600
|
+
le as VIBE64_PACKAGING_CONTRACT,Et as VIBE64_PACKAGING_SECTION,fe as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,jt as VIBE64_RESOURCE_ESTIMATES_CONTRACT,
|
|
601
|
+
Ee as VIBE64_RESOURCE_ESTIMATES_SECTION,ze as VIBE64_WORKSPACE_SETUP_CONTRACT,ne as VIBE64_WORKSPACE_SETUP_SECTION,Di as addGenesisStack,
|
|
602
|
+
Xi as applyGenesisTemplate,Kt as assertGenesisPromptTask,Yt as genesisCommandShimDirectory,mr as genesisPackageBinDirectory,
|
|
603
|
+
Ni as genesisParserEnvironment,wn as genesisProjectContractNeedsAttention,dr as genesisPromptRequest,lr as genesisPromptTask,
|
|
604
|
+
Pi as initializeGenesisProject,Li as inspectGenesisAgentIntegrations,Qi as inspectGenesisCollaboration,gr as inspectGenesisDerivedArtifacts,
|
|
605
|
+
Zi as inspectGenesisEngineering,Ki as inspectGenesisEnvironment,Yi as inspectGenesisProject,yr as inspectGenesisProjectFormat,
|
|
606
|
+
Vi as inspectGenesisSkills,Hi as inspectGenesisStackComponents,H as inspectGenesisStackSection,Mi as inspectGenesisSubsystems,
|
|
607
|
+
ji as inspectVibe64ArchitectureInspection,Gi as inspectVibe64ArchitectureLayout,ro as inspectVibe64ConnectedDevelopment,
|
|
608
|
+
zi as inspectVibe64Deployment,so as inspectVibe64IntegrationSetup,no as inspectVibe64Outputs,qi as inspectVibe64Packaging,
|
|
609
|
+
io as inspectVibe64ProjectServices,ao as inspectVibe64ResourceEstimates,oo as inspectVibe64WorkspaceSetup,Ji as listGenesisTemplates,
|
|
610
|
+
Oi as mergeArchitectureObservations,pt as parseVibe64DeploymentLines,Ht as parseVibe64IntegrationSetupLines,ge as parseVibe64OutputsLines,
|
|
611
|
+
vt as parseVibe64PackagingLines,$t as parseVibe64ProjectServicesLines,Bt as parseVibe64ResourceEstimatesLines,Q as parseVibe64WorkspaceSetupLines,
|
|
612
|
+
Bi as refreshGenesisCities,co as renderGenesisPrompt,gs as resolveVibe64OutputParameters,wt as resolveVibe64PackagingEnvironment,
|
|
613
|
+
to as setGenesisCollaboration,eo as setGenesisEngineeringProfile,Si as sourceExplanationGuidance,Ti as sourceExplanationReviewGuidance,
|
|
614
|
+
xi as syncGenesisAgentIntegrations,$i as syncGenesisSkills,ki as validateArchitectureFacts,_i as validateArchitectureObservations,
|
|
615
|
+
Fi as verifyGenesisProject,Wi as vibe64ConversationInstructions,ee as vibe64Driver,wi as vibe64HostContextEnvironment,Ls as vibe64HostContextRegistry,
|
|
616
|
+
fr as vibe64HostContextResolverPath,Ci as withGenesisCommandShim};
|