vibe64 0.1.64 → 0.1.66
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 +823 -820
- package/bin/server.js +200 -197
- package/bin/upgrade-state.js +4192 -4064
- package/dist/assets/{GithubBrowserTabs-Cf6ce1lO.js → GithubBrowserTabs-Bf5z_PiF.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-0VGIcy5Q.js → LocalDatabaseServer-CcfGbn7H.js} +1 -1
- package/dist/assets/{SelectField-RGWl_ms9.js → SelectField-Df50ZFLj.js} +1 -1
- package/dist/assets/{ShellOutlet-CdjsJfg9.js → ShellOutlet-DPyl05um.js} +1 -1
- package/dist/assets/{StudioErrorNotice-CCT_T6mT.js → StudioErrorNotice-vDR4qneB.js} +1 -1
- package/dist/assets/{VAutocomplete-BnpXAJGa.js → VAutocomplete-NpBcbYkR.js} +1 -1
- package/dist/assets/VBtn-Com1gNEe.js +1 -0
- package/dist/assets/{VCard-BFqQSnAE.js → VCard-DY_DdI8Z.js} +1 -1
- package/dist/assets/{VCheckbox-BK0ss4F4.js → VCheckbox-CkezAf4Z.js} +1 -1
- package/dist/assets/{VCheckboxBtn-DDlYJnth.js → VCheckboxBtn-8g4R-c2w.js} +1 -1
- package/dist/assets/{VChip-D2IukBZw.js → VChip-tORFnf7z.js} +1 -1
- package/dist/assets/{VDialog-BCIrX462.js → VDialog-CapFiCqp.js} +1 -1
- package/dist/assets/{VExpansionPanels-BHw1Id_o.js → VExpansionPanels-B6U2XdWH.js} +1 -1
- package/dist/assets/{VMenu-Bql3E6DV.js → VMenu-CO6B6LWk.js} +1 -1
- package/dist/assets/{VOverlay-EPzW7eVB.js → VOverlay-CrfaXCOL.js} +1 -1
- package/dist/assets/{VRadioGroup-CL3HTmyT.js → VRadioGroup-BrPW6foD.js} +1 -1
- package/dist/assets/{VRow-Dz87sIhY.js → VRow-DHETsEMn.js} +1 -1
- package/dist/assets/{VSelect-Ch00dyiM.js → VSelect-gYJ6qrBP.js} +1 -1
- package/dist/assets/{VSheet-D5wAuyc2.js → VSheet-_Grtwpfz.js} +1 -1
- package/dist/assets/{VSkeletonLoader-Bl9P5wdh.js → VSkeletonLoader-CQXCEJsR.js} +1 -1
- package/dist/assets/VSpacer-VLYDmg7o.js +1 -0
- package/dist/assets/{VSwitch-DftK1EyR.js → VSwitch-ffi-Y2TU.js} +1 -1
- package/dist/assets/{VTable-DHazU0Xx.js → VTable-Cver5Vl3.js} +1 -1
- package/dist/assets/{VTextField-B9R7EIjg.js → VTextField-DP6b7Qaf.js} +1 -1
- package/dist/assets/{VTextarea-CMgyRNk-.js → VTextarea-7mdIF4I0.js} +1 -1
- package/dist/assets/{VToolbar-C8ydxLzq.js → VToolbar-CYz3lneF.js} +1 -1
- package/dist/assets/{Vibe64AsyncModuleState-9bN0_H45.js → Vibe64AsyncModuleState-CO1rMrtD.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-BGtVvQq0.js → Vibe64AuthSettingsButton-CxJoeOhz.js} +1 -1
- package/dist/assets/{Vibe64ConversationLog-Cv_BE9yH.js → Vibe64ConversationLog-jDb_ZvIF.js} +1 -1
- package/dist/assets/{Vibe64DashboardPageHeader-xfRLZ94G.js → Vibe64DashboardPageHeader-CobvMlFm.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-B3TN3NBS.js → Vibe64DashboardShell-Ce1PNB37.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-CU0jCfP_.js → Vibe64DatabaseWorkspace-DiZDKEpx.js} +1 -1
- package/dist/assets/{Vibe64DestinationButton-CdyyK9tj.js → Vibe64DestinationButton-B4Zz4a7J.js} +1 -1
- package/dist/assets/{Vibe64FileArea-BWl-q11N.js → Vibe64FileArea-uRnIJ0Vp.js} +1 -1
- package/dist/assets/{Vibe64OutputControls-DnfGKZHs.js → Vibe64OutputControls-BF5kh2_h.js} +1 -1
- package/dist/assets/{Vibe64RepositoryWorkspace-3UKN_pPs.js → Vibe64RepositoryWorkspace-D6uJCype.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-B1U6XSWQ.js → Vibe64SessionFiles-CxgPB8RR.js} +1 -1
- package/dist/assets/{Vibe64SessionSourceEditor-De1QyTOd.js → Vibe64SessionSourceEditor-yaVu279S.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView-JRGcklim.js → Vibe64UiStoryboardView-DhbHkz8K.js} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-Bd_-gPuL.js → Vibe64UnavailableSessions-MmPF-Db1.js} +1 -1
- package/dist/assets/{_pageId_-DIPouI7Z.js → _pageId_-Zif-veil.js} +1 -1
- package/dist/assets/{_sessionId_-qH7uIGNl.js → _sessionId_-DOge-7SB.js} +1 -1
- package/dist/assets/_slug_-C71iAiR0.js +14 -0
- package/dist/assets/_slug_-CF1TPDUv.css +1 -0
- package/dist/assets/{access-O4hOM9ov.js → access-DQcblrWN.js} +1 -1
- package/dist/assets/{app-CXljwZ0u.js → app-CzApKPmq.js} +1 -1
- package/dist/assets/assistantRouting-CqIiQy21.js +3 -0
- package/dist/assets/{changes-C5gleyWS.js → changes-cmlEyHug.js} +1 -1
- package/dist/assets/{client-DMEf6RSZ.js → client-13v_yX07.js} +1 -1
- package/dist/assets/{client-CI-o7ITq.js → client-5JUUGxRd.js} +2 -2
- package/dist/assets/{client-4uCr4dYG.js → client-BJBzomgt.js} +1 -1
- package/dist/assets/{client-Do8szX_w.js → client-C8ZjqGdQ.js} +2 -2
- package/dist/assets/{client-fF-hq8nJ.js → client-Dl6I6IVb.js} +1 -1
- package/dist/assets/{client-BRcncaFt.js → client-Dv4scw6i.js} +1 -1
- package/dist/assets/{conversation-DiL2PEct.js → conversation-CFJRkeTj.js} +3 -3
- package/dist/assets/{conversation-RscSzQxq.css → conversation-COcuIkcD.css} +1 -1
- package/dist/assets/conversation-CexAK3Qk.js +1 -0
- package/dist/assets/{dashboard-BWlG0Nli.js → dashboard-Dm_xwwqU.js} +1 -1
- package/dist/assets/{english-definitions-DcuZfQ4p.js → english-definitions-DwTf_alg.js} +1 -1
- package/dist/assets/{env-D3DVC-Gd.js → env-B7wB5nBn.js} +1 -1
- package/dist/assets/{error-BQ7r64JO.js → error-CtOws2EC.js} +1 -1
- package/dist/assets/{error-BqMxhgpB.js → error-HfzrYwkQ.js} +1 -1
- package/dist/assets/errorMessageHelpers-G32Hjqfm.js +1 -0
- package/dist/assets/{fileTypes-2k5HCkMT.js → fileTypes-iPZyrJA1.js} +1 -1
- package/dist/assets/{health-B9ZoQC78.js → health-DIkOkzPe.js} +1 -1
- package/dist/assets/{history-BrWT8DRp.js → history-Ch597NiY.js} +1 -1
- package/dist/assets/{httpClient-Bwitq9Xf.js → httpClient-C71X5grL.js} +1 -1
- package/dist/assets/{i18n-BuXRXGaO.js → i18n-5EHeMSvt.js} +1 -1
- package/dist/assets/{i18n-BkxO7BMl.js → i18n-BSfPKqM3.js} +1 -1
- package/dist/assets/{i18n-Dm74yE_M.js → i18n-DcNQE3tT.js} +1 -1
- package/dist/assets/index-C-6c5Af1.css +1 -0
- package/dist/assets/index-DcKFCaBZ.js +134 -0
- package/dist/assets/{integrations-C4p_QTuv.js → integrations-CoNhnGvq.js} +1 -1
- package/dist/assets/{issues-KxOOLtSM.js → issues-Cem4Yt47.js} +1 -1
- package/dist/assets/{layout-B_cpKP4k.js → layout-DMZV-nbg.js} +1 -1
- package/dist/assets/{lazy-vXRXMwYF.js → lazy-mtFmsnct.js} +1 -1
- package/dist/assets/{learning-BWqH7wag.js → learning-CU2QyHrj.js} +1 -1
- package/dist/assets/{pages-DcNh-g_z.js → pages-BzA58NoR.js} +1 -1
- package/dist/assets/{project-files-C3a_vnA4.js → project-files-BBKjl3wZ.js} +1 -1
- package/dist/assets/{publish-B1f2baHh.js → publish-UFjblZA3.js} +1 -1
- package/dist/assets/{pull-requests-BHq5Yafl.js → pull-requests-DibGk1GB.js} +1 -1
- package/dist/assets/{repository-DMBew8kp.js → repository-0EKOcyTL.js} +1 -1
- package/dist/assets/{session-B5MoHBVk.js → session-FRkCCzYt.js} +1 -1
- package/dist/assets/{settings-DDpgGhWO.js → settings-BjOnPYwD.js} +1 -1
- package/dist/assets/{studioGateApi-UqmdV50W.js → studioGateApi-B9EUTtMx.js} +1 -1
- package/dist/assets/{studioUrls-k_pQIuPs.js → studioUrls-BR4ZL-TN.js} +1 -1
- package/dist/assets/{useArchivedVibe64Sessions-C5Qguyob.js → useArchivedVibe64Sessions-CXKRFR2f.js} +1 -1
- package/dist/assets/useAssistantAttachments-C9kAnWqw.js +2 -0
- package/dist/assets/useCommand-yOr3U8KF.js +1 -0
- package/dist/assets/useEndpointResource-BwGXpV2u.js +1 -0
- package/dist/assets/useUiFeedback--0dLsslR.js +1 -0
- package/dist/assets/{useVibe64ConversationLog-BZ5g9Jp7.js → useVibe64ConversationLog-BB5tVtkt.js} +2 -2
- package/dist/assets/{useVibe64Learning-DiLAIKbI.js → useVibe64Learning-iAAH83uG.js} +1 -1
- package/dist/assets/{useVibe64SessionData-D9d4NfDo.js → useVibe64SessionData-BSYF_TgH.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-DT1rJVvx.js → useVibe64SessionSelection-CxZ3uEAf.js} +1 -1
- package/dist/assets/{vibe64FileUpload-BDkcaUyk.js → vibe64FileUpload-D_rOa1R8.js} +1 -1
- package/dist/assets/vibe64RepositoryRealtime-CRAyGyRD.css +1 -0
- package/dist/assets/vibe64RepositoryRealtime-CVGNqwxz.js +1 -0
- package/dist/assets/{vibe64SessionFocus-CLtCTOxq.js → vibe64SessionFocus-DGSVXipO.js} +1 -1
- package/dist/index.html +45 -45
- package/docs/colleague-usage/ai-tasks.md +9 -1
- package/docs/colleague-usage/auto-workflow.md +6 -3
- package/docs/colleague-usage/coding-agent-goal-pause.md +34 -12
- package/docs/colleague-usage/coding-agent-goals.md +46 -23
- package/docs/colleague-usage/coding-agent-questions.md +7 -0
- package/docs/colleague-usage/coding-agents.md +22 -8
- package/docs/colleague-usage/connected-repositories.md +4 -1
- package/docs/colleague-usage/github-work.md +36 -3
- package/docs/colleague-usage/passes.md +86 -0
- package/docs/colleague-usage/project-messages.md +4 -1
- package/docs/colleague-usage/ui-pass.md +4 -0
- package/docs/colleague-usage/workspace-preparation.md +51 -0
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +13 -0
- package/node_modules/@jskit-ai/assistant-core/locales/en.json +7 -4
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +2 -0
- 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-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +6 -0
- package/node_modules/@jskit-ai/kernel/package.json +1 -1
- package/node_modules/@jskit-ai/payments-core/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/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-core/package.json +1 -0
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +914 -773
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +69 -63
- package/node_modules/@local/vibe64-genesis/src/server/index.js +450 -440
- package/node_modules/@local/vibe64-genesis/src/server/packaging.js +27 -28
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +63 -55
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +1044 -901
- package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +560 -420
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +453 -450
- package/package.json +15 -15
- package/server.bundle.mjs +43357 -43007
- package/dist/assets/VBtn-2vbH580C.js +0 -1
- package/dist/assets/VSpacer-GgPR_AzN.js +0 -1
- package/dist/assets/_slug_-CZmGS16g.css +0 -1
- package/dist/assets/_slug_-CaHlSQ8I.js +0 -14
- package/dist/assets/assistantRouting-BS0ZW5Ki.js +0 -3
- package/dist/assets/conversation-D7T_us2O.js +0 -1
- package/dist/assets/errorMessageHelpers-BjIt31kK.js +0 -1
- package/dist/assets/index-Ctygjyf8.css +0 -1
- package/dist/assets/index-HrVsvggI.js +0 -134
- package/dist/assets/useAssistantAttachments-DvEl7gX6.js +0 -2
- package/dist/assets/useCommand-CNDe8gM-.js +0 -1
- package/dist/assets/useEndpointResource-CmMwteuX.js +0 -1
- package/dist/assets/useUiFeedback-CWb6o71Z.js +0 -1
- package/dist/assets/vibe64RepositoryRealtime-kSshUn2K.js +0 -1
- package/dist/assets/vibe64RepositoryRealtime-rnWlv9jw.css +0 -1
|
@@ -1,93 +1,96 @@
|
|
|
1
1
|
import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
|
|
2
|
-
import{createHash as
|
|
3
|
-
super(t),this.name="Vibe64StackOperationError",this.code=n,s!==void 0&&(this.details=s)}},
|
|
2
|
+
import{createHash as Pn}from"node:crypto";import _e from"node:path";var ae=class extends Error{constructor(n,t,s=void 0){
|
|
3
|
+
super(t),this.name="Vibe64StackOperationError",this.code=n,s!==void 0&&(this.details=s)}},ot=Object.freeze({VIBE64_WORKSPACE_SETUP_INVALID:"\
|
|
4
4
|
workspace-setup",VIBE64_OUTPUTS_INVALID:"outputs",VIBE64_DEPLOYMENT_INVALID:"deployment",VIBE64_PACKAGING_INVALID:"packa\
|
|
5
5
|
ging",VIBE64_RESOURCE_ESTIMATES_INVALID:"resource-estimates",VIBE64_CONNECTED_DEVELOPMENT_INVALID:"connected-development",
|
|
6
6
|
VIBE64_PROJECT_SERVICES_INVALID:"project-services",VIBE64_INTEGRATION_SETUP_INVALID:"integration-setup",VIBE64_ARCHITECTURE_INSPECTION_INVALID:"\
|
|
7
|
-
architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),
|
|
8
|
-
function
|
|
9
|
-
return`Unknown ${e}: ${n}. Use one of: ${t.join("; ")}.`}function d(e,n,t,s,r={}){throw new ae(e
|
|
7
|
+
architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),Dn=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
|
|
8
|
+
function $n(e,n){let t=ot[e],s=String(n).replace(Dn,"");return t?`${s} Exact grammar: vibe64-helper spec ${t}.`:s}function D(e,n,t){
|
|
9
|
+
return`Unknown ${e}: ${n}. Use one of: ${t.join("; ")}.`}function d(e,n,t,s,r={}){throw new ae(e,$n(e,t),{path:n,...s===
|
|
10
10
|
void 0?{}:{line:s},...r})}function v(e,n,t,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&d(n,t,`${s} \
|
|
11
|
-
must be one non-empty line.`,r),e.trim()}function
|
|
12
|
-
0||n.map(t=>t[0]).join(" ")!==e?null:n.map(t=>t[1])}function I(e,n,t,s,r,i={}){let{count:o,maximum:c=64}=i,a
|
|
11
|
+
must be one non-empty line.`,r),e.trim()}function Vn(e){let n=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return n.length===
|
|
12
|
+
0||n.map(t=>t[0]).join(" ")!==e?null:n.map(t=>t[1])}function I(e,n,t,s,r,i={}){let{count:o,maximum:c=64}=i,a=Vn(e);if(!a||
|
|
13
13
|
a.length>c||o!==void 0&&a.length!==o||a.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=o===void 0?"separate non-empt\
|
|
14
|
-
y":`exactly ${o}`;d(n,t,`${s} must contain ${u} backticked ${o===1?"value":"values"}.`,r)}return a}function
|
|
15
|
-
"string"&&!!e&&!/[\s\0{}]/u.test(e)&&!
|
|
16
|
-
e,n,t,s,r);return
|
|
17
|
-
ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!
|
|
18
|
-
function b(e,n,t,s,r,i={}){let{allowRoot:o=!0}=i;return(!
|
|
19
|
-
lative path.`,r),e}function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
y":`exactly ${o}`;d(n,t,`${s} must contain ${u} backticked ${o===1?"value":"values"}.`,r)}return a}function xn(e=""){return typeof e==
|
|
15
|
+
"string"&&!!e&&!/[\s\0{}]/u.test(e)&&!_e.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function N(e,n,t,s,r){let i=I(
|
|
16
|
+
e,n,t,s,r);return xn(i[0])||d(n,t,`${s} must begin with a safe executable.`,r),i}function jn(e=""){return typeof e=="str\
|
|
17
|
+
ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!_e.posix.isAbsolute(e)&&_e.posix.normalize(e)===e&&!e.split("/").some(n=>!n||n==="..")}
|
|
18
|
+
function b(e,n,t,s,r,i={}){let{allowRoot:o=!0}=i;return(!jn(e)||!o&&e===".")&&d(n,t,`${s} must be a canonical project-re\
|
|
19
|
+
lative path.`,r),e}function ce(e,n,t,s,r){let i=I(e,n,t,s,r);return i.some(o=>o.startsWith("/")||o.includes("\\")||o.includes(
|
|
20
|
+
"***")||/[?[\]{}!]/u.test(o)||o.split("/").some(c=>!c||[".",".."].includes(c)))&&d(n,t,`${s} must be canonical project-r\
|
|
21
|
+
elative globs using only * and ** wildcards.`,r),new Set(i).size!==i.length&&d(n,t,`${s} must name each path once.`,r),i}
|
|
22
|
+
function C(e,n,t,s,r){let i=I(e,n,t,s,r);return i.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&d(n,t,`${s} must use \
|
|
23
|
+
lowercase technology ids separated into backticked values.`,r),new Set(i).size!==i.length&&d(n,t,`${s} contains a duplic\
|
|
24
|
+
ate technology id.`,r),i}function Re(e,n,t,s,r){let i=v(e,n,t,s,r);return(!i.startsWith("/")||i.startsWith("//")||/[\\?#]/u.
|
|
25
|
+
test(i))&&d(n,t,`${s} must begin with one slash and contain no query or fragment.`,r),i}function ue(e,n,t,s,r){let i=e.match(
|
|
26
|
+
/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);i||d(n,t,`${s} must use \`- Ready when: \`GET\` \`/path\` return\
|
|
27
|
+
s \`200\`\`.`,r);let o=Number(i[2]);return(!Number.isInteger(o)||o<200||o>399)&&d(n,t,`${s} status must be from 200 thro\
|
|
28
|
+
ugh 399.`,r),{kind:"http",method:"GET",path:Re(i[1],n,t,`${s} path`,r),status:o}}var Ln=/^with (.+?):[ \t]+(.+)$/u,Mn=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,
|
|
29
|
+
Gn=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Un=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;function pe(e,n,t,s,r,{form:i,observed:o=e}){
|
|
30
|
+
let c=String(e||"").match(Ln);c||d(n,t,`Every ${s} entry must use: ${i}`,r,{observed:o});let a=c[1].match(Mn),u=a?null:c[1].
|
|
31
|
+
match(Gn),p=a?a[1]:u?u[1]:c[1],m=a?.[2]||u?.[2]||"",l=p.match(Un);return{argv:N(c[2],n,t,`${s} command`,r),runtimeRequirements:C(
|
|
32
|
+
l?l[1]:p,n,t,`${s} runtimes`,r),workdir:b(l?l[2]:".",n,t,`${s} workdir`,r),...m?{condition:{pathExists:b(m,n,t,`${s} con\
|
|
33
|
+
dition path`,r,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function Oe(e){return Array.isArray(e)?e.map(Oe):e&&typeof e==
|
|
34
|
+
"object"?Object.fromEntries(Object.keys(e).sort().map(n=>[n,Oe(e[n])])):e}function R(e){let n=`${JSON.stringify(Oe(e),null,
|
|
35
|
+
2)}
|
|
36
|
+
`;return`sha256:${Pn("sha256").update(n).digest("hex")}`}function z(e={},n={},t="operation"){if(e.stackHash!==n.stackHash)
|
|
37
|
+
throw new ae("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${t}. Retry the operation.`)}function F(e=[]){
|
|
35
38
|
return[...new Set(e)].sort()}function w(e=[]){let n=e.map(t=>t.trim()).filter(Boolean);return n.length===1&&n[0]==="- No\
|
|
36
|
-
thing."}var
|
|
39
|
+
thing."}var wi=Object.freeze({SPEC_BY_ERROR_CODE:ot});var Bn="custom";var Wn=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
|
|
37
40
|
(PHP)"}),Object.freeze({value:"pip",label:"pip (Python)"}),Object.freeze({value:"bundler",label:"Bundler (Ruby)"}),Object.
|
|
38
41
|
freeze({value:"gomod",label:"Go modules"}),Object.freeze({value:"cargo",label:"Cargo (Rust)"}),Object.freeze({value:"mav\
|
|
39
42
|
en",label:"Maven"}),Object.freeze({value:"gradle",label:"Gradle"}),Object.freeze({value:"nuget",label:"NuGet (.NET)"}),Object.
|
|
40
|
-
freeze({value:
|
|
41
|
-
stack.md#Connected development",
|
|
42
|
-
Prepare \`label\` ${
|
|
43
|
-
"- Default package type: `type`","- Sources file: `path`",...Object.values(
|
|
44
|
-
|
|
43
|
+
freeze({value:Bn,label:"custom"})]);var at=Object.freeze(Wn.map(e=>e.value));function ct(e){return typeof e=="string"&&at.includes(e)}function ut(e="or"){let n=at;return`${n.slice(0,-1).join(", ")} ${e} ${n.at(-1)}`}var pt="Connected development",Hn="vibe64.connected-development.v1",$="VIBE64_CONNECTED_DEVELOPMENT_INVALID",V="genesis/\
|
|
44
|
+
stack.md#Connected development",Ae="with `runtime` [in `workdir`]: `command` `argument`...",lt=Object.freeze({Prepare:`-\
|
|
45
|
+
Prepare \`label\` ${Ae}`,Verify:`- Verify \`label\` ${Ae}`,"Custom runner":`- Custom runner ${Ae}`}),zn=Object.freeze([
|
|
46
|
+
"- Default package type: `type`","- Sources file: `path`",...Object.values(lt)]),Fn=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
|
|
47
|
+
qn=/^- Custom runner (.+)$/u,Kn="Custom connected source";function dt(e={}){let n="",t="",s=null,r=[],i=[...e.diagnostics||
|
|
45
48
|
[]],o=e.status==="ready";if(o&&!w(e.lines)){let a=!1;for(let[p,m]of e.lines.entries()){let l=m.trim();if(!l)continue;let f=p+
|
|
46
|
-
1,g=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(g){t&&d($,V,"Declare exactly one default package type.",f),
|
|
47
|
-
g[1])||d($,V,`Default package type must be ${
|
|
49
|
+
1,g=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(g){t&&d($,V,"Declare exactly one default package type.",f),ct(
|
|
50
|
+
g[1])||d($,V,`Default package type must be ${ut()}.`,f),t=g[1];continue}let S=l.match(/^- Sources file: `([^`\r\n]+)`$/u);
|
|
48
51
|
if(S){n&&d($,V,"Declare exactly one Sources file.",f),n=b(S[1],$,V,"Connected sources file",f,{allowRoot:!1}),n.split("/").
|
|
49
|
-
some(
|
|
50
|
-
P=_?null:l.match(
|
|
52
|
+
some(Cn=>Cn.toLowerCase()===".git")&&d($,V,"The Sources file must be outside Git metadata.",f);continue}let _=l.match(qn),
|
|
53
|
+
P=_?null:l.match(Fn);!_&&!P&&d($,V,D("Connected development entry",l,zn),f);let Y=_?"Custom runner":P[1],Q=Y==="Verify"?
|
|
51
54
|
"verify":"prepare";!_&&a&&Q==="prepare"&&d($,V,"All Prepare entries must precede Verify entries.",f),a||=!_&&Q==="verify";
|
|
52
|
-
let
|
|
53
|
-
{form:
|
|
54
|
-
ot prove source consumption.",f),_?(s&&d($,V,"Declare exactly one Custom runner.",f),s=
|
|
55
|
+
let ke={label:_?Kn:v(P[2],$,V,`Connected development ${Y} label`,f),...pe(_?_[1]:P[3],$,V,`Connected development ${Y}`,f,
|
|
56
|
+
{form:lt[Y],observed:l})};ke.condition&&d($,V,"Connected development steps must run unconditionally; a skipped step cann\
|
|
57
|
+
ot prove source consumption.",f),_?(s&&d($,V,"Declare exactly one Custom runner.",f),s=ke):r.push({...ke,phase:Q})}!(t&&
|
|
55
58
|
!n&&!r.length&&!s)&&(!n||!r.some(p=>p.phase==="verify")&&!s)&&d($,V,"Declare a default package type alone, or a Sources \
|
|
56
59
|
file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let c=e.status==="blocked"||i.length?
|
|
57
|
-
"blocked":r.length||s?"ready":"unconfigured";return{contract:
|
|
60
|
+
"blocked":r.length||s?"ready":"unconfigured";return{contract:Hn,declared:o,status:c,stackHash:e.stackHash,recipeHash:c===
|
|
58
61
|
"ready"?R({version:1,sourcesFile:n,defaultPackageType:t,customRunner:s,steps:r}):"",components:[...e.components||[]],source:e.
|
|
59
|
-
source||null,sourcesFile:n,defaultPackageType:t,customRunner:s,steps:r,runtimeRequirements:
|
|
60
|
-
a=>a.runtimeRequirements)),diagnostics:i}}import{lstat as
|
|
61
|
-
enesis/stack.md#Architecture inspection",
|
|
62
|
-
dir","argv","timeout","maxBuffer"]),
|
|
63
|
-
"`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${
|
|
64
|
-
bytes":["maxBuffer",`\`1\` through \`${
|
|
65
|
-
equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),
|
|
66
|
-
`^- (${Object.keys(
|
|
67
|
-
cture inspection requires exact Stack section lines."),w(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let c of
|
|
62
|
+
source||null,sourcesFile:n,defaultPackageType:t,customRunner:s,steps:r,runtimeRequirements:F([...r,...s?[s]:[]].flatMap(
|
|
63
|
+
a=>a.runtimeRequirements)),diagnostics:i}}import{lstat as Yn,open as Xn,realpath as Ne,stat as Jn}from"node:fs/promises";import{constants as mt}from"node:fs";import ht from"node:path";var Zn="vibe64.architecture-inspection.v1",gt="Architecture inspection",k="VIBE64_ARCHITECTURE_INSPECTION_INVALID",le="g\
|
|
64
|
+
enesis/stack.md#Architecture inspection",Et=120,yt=64*1024*1024,ft=64*1024,Qn=Object.freeze(["runtimeRequirements","work\
|
|
65
|
+
dir","argv","timeout","maxBuffer"]),Ce=Object.freeze({Runtime:["runtimeRequirements","`runtime`..."],Directory:["workdir",
|
|
66
|
+
"`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${Et}\``],"Max output\
|
|
67
|
+
bytes":["maxBuffer",`\`1\` through \`${yt}\``],"Entry files":["entryFiles","`path`... (optional)"],"Required files":["r\
|
|
68
|
+
equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),es=new RegExp(
|
|
69
|
+
`^- (${Object.keys(Ce).join("|")}): (.+)$`,"u");function bt(e,n={}){let{path:t=le}=n;if(Array.isArray(e)||d(k,t,"Archite\
|
|
70
|
+
cture inspection requires exact Stack section lines."),w(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let c of Qn)
|
|
68
71
|
i[c]===void 0&&d(k,t,`${i.id} is missing ${c}.`);s.push(i),i=null}}for(let[c,a]of e.entries()){let u=a.trim();if(!u)continue;
|
|
69
72
|
let p=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(p){o(),r.has(p[1])&&d(k,t,"Duplicate inspector i\
|
|
70
|
-
d.",c+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||d(k,t,"Expected an Inspector heading.",c+1);let m=u.match(
|
|
71
|
-
let f=Object.entries(
|
|
72
|
-
of: ${f}.`,c+1)}let[l]=
|
|
73
|
-
k,t,"Inspector runtime",c+1);else if(l==="argv")i[l]=
|
|
73
|
+
d.",c+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||d(k,t,"Expected an Inspector heading.",c+1);let m=u.match(es);if(!m){
|
|
74
|
+
let f=Object.entries(Ce).map(([g,[,S]])=>`- ${g}: ${S}`).join("; ");d(k,t,`Unknown architecture inspector field. Use one\
|
|
75
|
+
of: ${f}.`,c+1)}let[l]=Ce[m[1]];if(i[l]!==void 0&&d(k,t,`Duplicate ${m[1]}.`,c+1),l==="runtimeRequirements")i[l]=C(m[2],
|
|
76
|
+
k,t,"Inspector runtime",c+1);else if(l==="argv")i[l]=N(m[2],k,t,"Inspector command",c+1);else if(l==="entryFiles"||l==="\
|
|
74
77
|
requiredFiles")i[l]=I(m[2],k,t,m[1],c+1).map(f=>b(f,k,t,m[1],c+1));else{let[f]=I(m[2],k,t,m[1],c+1,{count:1});if(l==="wo\
|
|
75
|
-
rkdir")i[l]=b(f,k,t,"Inspector directory",c+1);else if(l==="previewLocator")i[l]=
|
|
76
|
-
"timeout"?
|
|
77
|
-
i[l]=l==="timeout"?g*1e3:g}}}return o(),s.length||d(k,t,"Use an Inspector entry or - Nothing."),s}function
|
|
78
|
-
e,k,n,"Preview locator",t,{allowRoot:!1}),e.endsWith(".js")||d(k,n,"Preview locator must name a .js file.",t),e}function
|
|
79
|
-
return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function
|
|
80
|
-
|
|
81
|
-
entries())o=
|
|
82
|
-
a symlink"),o=i=await
|
|
83
|
-
o||!o.startsWith(`${i}${
|
|
84
|
-
stat();return a.isFile()||t("must be a regular file"),a.size>
|
|
78
|
+
rkdir")i[l]=b(f,k,t,"Inspector directory",c+1);else if(l==="previewLocator")i[l]=vt(f,t,c+1);else{let g=Number(f),S=l===
|
|
79
|
+
"timeout"?Et:yt;(!/^[1-9][0-9]*$/u.test(f)||!Number.isSafeInteger(g)||g>S)&&d(k,t,`${m[1]} must be from 1 to ${S}.`,c+1),
|
|
80
|
+
i[l]=l==="timeout"?g*1e3:g}}}return o(),s.length||d(k,t,"Use an Inspector entry or - Nothing."),s}function vt(e,n,t){return b(
|
|
81
|
+
e,k,n,"Preview locator",t,{allowRoot:!1}),e.endsWith(".js")||d(k,n,"Preview locator must name a .js file.",t),e}function ts(e,n){
|
|
82
|
+
return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function ns(e,n){
|
|
83
|
+
vt(n,le);let t=i=>d(k,le,`Preview locator \`${n}\` ${i}.`),s=n.split("/"),r;try{let i=await Ne(e),o=i,c=!1;for(let[u,p]of s.
|
|
84
|
+
entries())o=ht.join(o,p),(await Yn(o)).isSymbolicLink()&&((c||u===s.length-1||!ts(s,u))&&t("must not be or pass through \
|
|
85
|
+
a symlink"),o=i=await Ne(o),(await Jn(i)).isDirectory()||t("links a package that is not a folder"),c=!0);(await Ne(o)!==
|
|
86
|
+
o||!o.startsWith(`${i}${ht.sep}`))&&t("must not be or pass through a symlink"),r=await Xn(o,mt.O_RDONLY|mt.O_NOFOLLOW);let a=await r.
|
|
87
|
+
stat();return a.isFile()||t("must be a regular file"),a.size>ft&&t(`must be at most ${ft} bytes`),{path:n,source:await r.
|
|
85
88
|
readFile("utf8")}}catch(i){throw(i?.code==="ENOENT"||i?.code==="ENOTDIR")&&t("is not a file in this project"),i?.code===
|
|
86
|
-
"ELOOP"&&t("must not be or pass through a symlink"),i}finally{await r?.close()}}function
|
|
87
|
-
|
|
88
|
-
be selected in Stack.");return{contract:
|
|
89
|
-
diagnostics||[]}}var
|
|
90
|
-
["layer","libraries","support"]);function
|
|
89
|
+
"ELOOP"&&t("must not be or pass through a symlink"),i}finally{await r?.close()}}function wt(e){let n=e.status==="ready"?
|
|
90
|
+
bt(e.lines):[];for(let t of n)t.runtimeRequirements.some(s=>!e.components.includes(s))&&d(k,le,"Inspector runtimes must \
|
|
91
|
+
be selected in Stack.");return{contract:Zn,status:e.status,stackHash:e.stackHash,inspectors:n,recipeHash:R(n),diagnostics:e.
|
|
92
|
+
diagnostics||[]}}var Ci=Object.freeze({parseVibe64ArchitectureInspectionLines:bt});var ss="vibe64.architecture-layout.v1",St="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Pe=Object.freeze(
|
|
93
|
+
["layer","libraries","support"]);function It(e,n={}){let{path:t="genesis/stack.md#Architecture layout"}=n;if(Array.isArray(
|
|
91
94
|
e)||d(U,t,"Expected exact Stack section lines."),w(e))return[];let s=[],r=new Set,i=new Set,o;function c(){o&&((!o.kind||
|
|
92
95
|
!o.purpose||!o.subsystems.length)&&d(U,t,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[a,
|
|
93
96
|
u]of e.entries()){let p=u.trim();if(!p)continue;let m=p.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(m){c(),
|
|
@@ -95,16 +98,16 @@ r.has(m[1])&&d(U,t,"Duplicate group id.",a+1),r.add(m[1]),o={id:m[1],title:m[2],
|
|
|
95
98
|
(!o||!l)&&d(U,t,"Expected a Group heading or Kind, Purpose, Subsystem field.",a+1);let f=I(l[2],U,t,l[1],a+1,{count:1});
|
|
96
99
|
if(l[1]==="Subsystem"){let g=b(f[0],U,t,"Subsystem root",a+1);i.has(g)&&d(U,t,"Each directory root may be placed only on\
|
|
97
100
|
ce.",a+1),i.add(g),o.subsystems.push({root:g})}else{let g=l[1].toLowerCase();o[g]!==void 0&&d(U,t,`Duplicate ${l[1]}.`,a+
|
|
98
|
-
1),g==="kind"&&!
|
|
99
|
-
s.length||d(U,t,"Use a Group entry or - Nothing."),s}function
|
|
100
|
-
groups:e.status==="ready"?
|
|
101
|
-
import B from"node:path";var
|
|
102
|
-
includes(String(e?.code||"").trim())}var
|
|
103
|
-
return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!
|
|
104
|
-
let{path:n="",line:t,observed:s}=e.details||{},r=Number.isSafeInteger(t)?` (line ${t}${n===
|
|
105
|
-
i=n&&(r||!e.message.includes(n))?`${n}${r}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${i}${e.message}${o}`}import*as oe from"genesis-compiler";import{randomUUID as
|
|
106
|
-
import
|
|
107
|
-
"managedPreview"]),
|
|
101
|
+
1),g==="kind"&&!Pe.includes(f[0])&&d(U,t,`Kind must be ${Pe.slice(0,-1).join(", ")} or ${Pe.at(-1)}.`,a+1),o[g]=f[0]}}return c(),
|
|
102
|
+
s.length||d(U,t,"Use a Group entry or - Nothing."),s}function Tt(e){return{contract:ss,status:e.status,stackHash:e.stackHash,
|
|
103
|
+
groups:e.status==="ready"?It(e.lines):[],diagnostics:e.diagnostics||[]}}var $i=Object.freeze({parseVibe64ArchitectureLayoutLines:It});import{existsSync as In}from"node:fs";import{readFile as Pr}from"node:fs/promises";import{createRequire as Dr}from"node:module";
|
|
104
|
+
import B from"node:path";var rs="STACK_PROJECT_CONTRACTS_INCOMPLETE",kt="STACK_SECTION_AMBIGUOUS",is=Object.freeze([rs,kt]);function os(e){return is.
|
|
105
|
+
includes(String(e?.code||"").trim())}var De="genesis/stack.md",as=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function cs(e){
|
|
106
|
+
return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!as.some(n=>String(e.code).startsWith(n))}function us(e){
|
|
107
|
+
let{path:n="",line:t,observed:s}=e.details||{},r=Number.isSafeInteger(t)?` (line ${t}${n===De?" of its section":""})`:"",
|
|
108
|
+
i=n&&(r||!e.message.includes(n))?`${n}${r}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${i}${e.message}${o}`}import*as oe from"genesis-compiler";import{randomUUID as bs}from"node:crypto";import{mkdir as vs,mkdtemp as ws,readFile as Ss,rename as Is,rm as Nt,writeFile as Ts}from"node:fs/promises";
|
|
109
|
+
import ks from"node:os";import Ve from"node:path";function x(e){return String(e||"").trim()}var ps=Object.freeze(["main","temporary"]),_t=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
|
|
110
|
+
"managedPreview"]),Ot=Object.freeze(["managedPages"]),ls=64*1024,ds=Object.freeze(["When user input is necessary, ask no\
|
|
108
111
|
more than three concise, high-impact questions at once.","Put multiple questions on separate lines as `[1] Question`, `\
|
|
109
112
|
[2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answers:` and a short bullet list dir\
|
|
110
113
|
ectly beneath its own question, before the next one; never collect several questions' answers into one trailing list.","\
|
|
@@ -117,7 +120,7 @@ Possible answers:
|
|
|
117
120
|
[2] Tell the main agent before changes?
|
|
118
121
|
Possible answers:
|
|
119
122
|
- Yes, tell main first
|
|
120
|
-
- No, proceed independently`]),
|
|
123
|
+
- No, proceed independently`]),ms=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
|
|
121
124
|
start a duplicate or replacement server. If it is unavailable, report that blocker. Describe only rendered browser evide\
|
|
122
125
|
nce.","When adopting an authenticated app, or when its login blocks Preview inspection, inspect identity support/names w\
|
|
123
126
|
ith `vibe64-helper preview status`; prefer `vibe64-helper preview browser identity <configured-name>` to requesting pass\
|
|
@@ -177,7 +180,7 @@ waits for cleanup/restoration; retry if cleanup needs attention. Never kill test
|
|
|
177
180
|
exit alone does not prove tests stopped. Recheck status before reporting a busy blocker.","If a managed command reports \
|
|
178
181
|
kernel task denials or a resource incident, report the blocker with its diagnostic and incident ID and ask the platform \
|
|
179
182
|
operator to inspect that evidence before retrying; never raise test timeouts or weaken assertions to work around a proce\
|
|
180
|
-
ss/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),
|
|
183
|
+
ss/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),hs=Object.freeze(
|
|
181
184
|
['Pages: `vibe64-helper pages publish <file.html|folder> [--title "Title"]` publishes an HTML page (one file, or a folde\
|
|
182
185
|
r with index.html and its own scripts, styles, data and images) that everyone with access to this project can open from \
|
|
183
186
|
Vibe64\'s Pages list; `vibe64-helper pages update <page-id> <file.html|folder>` gives a page a new version under the same\
|
|
@@ -199,7 +202,7 @@ e data; use --prompt only when gathering it needs judgement.","Before making a p
|
|
|
199
202
|
hen a page about the same subject already exists, update it instead of making a new one.","Do not offer pages for quick \
|
|
200
203
|
answers, code changes, or documents that belong in the repository. Offer at most once per topic; do not nag.","Everyone \
|
|
201
204
|
with access to the project can open a page: never put secrets in one, or anything not every project member should see."]),
|
|
202
|
-
|
|
205
|
+
fs=Object.freeze(["Each managed shell command receives current development Env from Vibe64, including declared resource \
|
|
203
206
|
bindings; use them in ordinary commands. Do not build environment injection or copy managed credentials into source. Res\
|
|
204
207
|
ource provisioning and application migrations remain separate preparation steps.","Use `vibe64-helper env status [develo\
|
|
205
208
|
pment|production|all]` to inspect configured key names without revealing values.","Pipe an available value to `vibe64-he\
|
|
@@ -214,20 +217,20 @@ xplicit direction, or edit Vibe64 runtime/session storage.","After an Env mutati
|
|
|
214
217
|
ey names, never their values, and claim success only when the command succeeded.","Store a secret the application needs \
|
|
215
218
|
generated (such as an application key) by generating it with the framework's own generator and piping it to `vibe64-help\
|
|
216
219
|
er env set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that file from Env."]);
|
|
217
|
-
function
|
|
220
|
+
function Rt(e,n){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${n} must be an object.`);return e}function $e(e,n,t){
|
|
218
221
|
let s=new Set(n),r=Object.keys(e).filter(i=>!s.has(i));if(r.length>0)throw new TypeError(`${t} contains unsupported fiel\
|
|
219
|
-
ds: ${r.join(", ")}.`)}function
|
|
222
|
+
ds: ${r.join(", ")}.`)}function At(e){if($e(e,["conversationKind","scope","session","hostGuidance"],"Vibe64 session cont\
|
|
220
223
|
ext"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"utf8")>1024))throw new TypeError(
|
|
221
|
-
"Vibe64 host guidance must be bounded text supplied by the host.");if(!
|
|
222
|
-
"Vibe64 session context has an unknown conversationKind.");let n=
|
|
223
|
-
...
|
|
224
|
-
`Vibe64 session capability ${s} must be boolean.`);return[s,n[s]]}));for(let s of
|
|
224
|
+
"Vibe64 host guidance must be bounded text supplied by the host.");if(!ps.includes(e.conversationKind))throw new TypeError(
|
|
225
|
+
"Vibe64 session context has an unknown conversationKind.");let n=Rt(e.session,"Vibe64 session capabilities");$e(n,[..._t,
|
|
226
|
+
...Ot],"Vibe64 session capabilities");let t=Object.fromEntries(_t.map(s=>{if(typeof n[s]!="boolean")throw new TypeError(
|
|
227
|
+
`Vibe64 session capability ${s} must be boolean.`);return[s,n[s]]}));for(let s of Ot){if(n[s]!==void 0&&typeof n[s]!="bo\
|
|
225
228
|
olean")throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);n[s]===!0&&(t[s]=!0)}return{conversationKind:e.
|
|
226
|
-
conversationKind,scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:t}}function
|
|
227
|
-
pe","stableContext"],"Vibe64 ephemeral context");let n=String(e.stableContext||"").trim();if(!n||n.length>
|
|
228
|
-
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:n}}function
|
|
229
|
-
scope==="session")return
|
|
230
|
-
sion and ephemeral scopes only.")}function
|
|
229
|
+
conversationKind,scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:t}}function gs(e){$e(e,["sco\
|
|
230
|
+
pe","stableContext"],"Vibe64 ephemeral context");let n=String(e.stableContext||"").trim();if(!n||n.length>ls)throw new TypeError(
|
|
231
|
+
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:n}}function Es(e){if(e.
|
|
232
|
+
scope==="session")return At(e);if(e.scope==="ephemeral")return gs(e);throw new TypeError("The Vibe64 driver supports ses\
|
|
233
|
+
sion and ephemeral scopes only.")}function ys(e){let{conversationKind:n,session:t,hostGuidance:s=""}=At(e);return["VIBE6\
|
|
231
234
|
4 CONVERSATION CONTEXT","",...n==="main"?["This is the main Vibe64 conversation for the selected session worktree."]:["T\
|
|
232
235
|
his is a user-visible temporary conversation in the selected session worktree, with the same tools and project access as\
|
|
233
236
|
main chat.","Its messages stay out of main History. Closing this conversation preserves project edits and removes only \
|
|
@@ -251,169 +254,173 @@ on is needed.","Before changing dependencies or porting code, check whether the
|
|
|
251
254
|
oes, it arrives with Update: never redo it here. While Update failed or is pending, Update owns the session: do not repa\
|
|
252
255
|
ir setup or workspace preparation first. Local work the saved version supersedes, such as a stale or partial dependency \
|
|
253
256
|
bump it completes, is resolved by taking the saved version: say so plainly in one sentence and never ask the person to c\
|
|
254
|
-
hoose, because Vibe64's checkpoint keeps the original. Ask only about genuine product decisions.","
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
257
|
+
hoose, because Vibe64's checkpoint keeps the original. Ask only about genuine product decisions.","When `repository.upda\
|
|
258
|
+
teFirst` says this session is behind, update it with `vibe64-helper session update` before building on the old code, at \
|
|
259
|
+
a point where you can deal with a conflict. Update can take several minutes, so give the command a long time limit (up t\
|
|
260
|
+
o 30 minutes); if your tool stops it early, Update carries on: read `vibe64-helper session status --json` until `reposit\
|
|
261
|
+
ory.updateFirst.reason` is no longer `running`. Update may stop at files that clash with the saved version. If it does, \
|
|
262
|
+
stop your other work and resolve them first, as it explains, or, if you can't now, leave them (Update leaves a repositor\
|
|
263
|
+
y with clashing files unchanged) and tell the person. Then re-read the files it lists, and run `vibe64-helper preview re\
|
|
264
|
+
start --wait` when it says Preview still runs the old code. Update never saves: Save still needs the person, because it \
|
|
265
|
+
publishes the work.","Connected repositories are this session's own copies at `../connected/<name>`, listed in the Stack\
|
|
266
|
+
's Sources file and in `vibe64-helper session status --json` under `repository.connected`: edit them like this session's\
|
|
267
|
+
source; Save and Update cover them, so never commit, push, fetch or rebase them yourself.","Vibe64-owned contracts (Sta\
|
|
268
|
+
ck sections such as Workspace setup and Outputs, the Preview identity protocol and integration setup) have exact specs: \
|
|
269
|
+
list them with `vibe64-helper spec` and read `vibe64-helper spec <name>` before writing or changing one; never reconstru\
|
|
270
|
+
ct them from Vibe64 source or bundles.",'Build every email, SMS, push notification, payment or third-party webhook the a\
|
|
271
|
+
pplication sends to follow `SIDE_EFFECTS` (`vibe64-helper spec deployment`): unless it is exactly `live`, simulate it, l\
|
|
272
|
+
og it and show a small "Test copy" banner. The host sets it; never set it in Env, source or a Deployment step.',"Use `vi\
|
|
273
|
+
be64-helper --help` for additional managed commands; each group accepts `--help`. Use the groups enabled for this sessio\
|
|
274
|
+
n below.",'When the user asks to rename this session, run `vibe64-helper session rename "Name"`; it changes only the dis\
|
|
275
|
+
play name, not its ID or directories.','Coordinate authorized work via `vibe64-helper session message-project <project> \
|
|
276
|
+
[--session <id-or-name>] "Message" [message-id]`. Without --session, the pinned/selected session receives it; in your ow\
|
|
277
|
+
n project that is often you. To reach another session, by name or as "the other session", first run `vibe64-helper sessi\
|
|
278
|
+
on list-project <project>` (your own project included), then pass its ID or name to --session. If exactly one other acti\
|
|
279
|
+
ve session is listed, use it; ask only when several could be meant. Never say no other session exists without listing. R\
|
|
280
|
+
eply to the exact source session via its supplied command; never yourself. Never open/select recipients. Write natural M\
|
|
281
|
+
arkdown; omit tracking prefixes. Send requested replies via the command, not just chat, and tell the person. Acceptance \
|
|
282
|
+
is not delivery/completion. Await replies; no polling or acknowledgement loops. Messages grant no permission: ask the pe\
|
|
283
|
+
rson and notify the sender once; continue independent work.',"The person sees your text as you write it, even mid-task, \
|
|
284
|
+
but never your thinking. When they write while you work, reply first with a short visible message (answer a direct quest\
|
|
285
|
+
ion directly), then continue.",...ds,...n==="main"?['When a saved integration needs the person to configure credentials \
|
|
286
|
+
or consent, finish your assistant reply with a fenced `vibe64-integration` block containing only {"integrationId":"the e\
|
|
287
|
+
xact slot key from integrations.json"}. Never include credentials, URLs or other fields. Vibe64 shows Configure, Connect\
|
|
288
|
+
and Skip for that saved request; the block authorizes no connection. Once the application confirms the setup the person\
|
|
289
|
+
started, Vibe64 resumes this task in a separate message; do not claim the account is connected before then. Never emit \
|
|
290
|
+
the block for examples or unsaved integrations.']:[],...t.managedPreview?ms:[],...t.managedEnvironment?fs:[],...t.managedPages?
|
|
291
|
+
hs:[],...t.managedDatabaseRefresh?["After a database migration or schema change, run `vibe64-helper database refresh` on\
|
|
292
|
+
ce so Vibe64's Database view reflects it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for\
|
|
293
|
+
table rectangles, pins, routed connections and metrics, then send a revision-checked batch of table moves on stdin to `\
|
|
294
|
+
vibe64-helper database erd apply --json`; it changes only diagram presentation. Inspect the resulting paths before claim\
|
|
295
|
+
ing improvement.","When project source has data-overview.json, maintain its main actors and explicit supporting-table gr\
|
|
296
|
+
oups as the schema changes. Use `vibe64-helper database overview --json` for the current schema, grouping, coverage and \
|
|
297
|
+
exact format instructions. Preserve authored groupings, classify new tables, fix renamed/removed references, and check c\
|
|
298
|
+
overage afterward. When asked to create a Data overview, use the same command and relevant application source; no one-ho\
|
|
299
|
+
p membership rule applies. Never invent foreign keys or cardinalities."]:[],...t.managedGit?["Use the managed `git` and \
|
|
300
|
+
`gh` commands on PATH. Do not bypass them with host binaries, a stripped PATH, or alternate credentials.","For attachmen\
|
|
301
|
+
ts and inline images that GitHub stores for issues (tickets), pull requests or comments, use authenticated managed `gh a\
|
|
302
|
+
pi` with the original attachment URL, save the response to a local file and inspect it before reporting its contents. Ne\
|
|
303
|
+
ver use unauthenticated curl/wget, User-Agent experiments or extracted credentials; an unauthenticated 404 does not prov\
|
|
304
|
+
e a private attachment is missing.","After changing GitHub issues, comments, labels or pull requests, run `vibe64-helper\
|
|
305
|
+
github refresh` once so Vibe64's Issues/PR view reflects it.","When linking an issue in this project's repository, run \
|
|
306
|
+
`vibe64-helper github issue-link <number>` and use its returned Vibe64 path exactly, including the /app prefix, as the p\
|
|
307
|
+
rimary Markdown link destination; it navigates in-app. You may include the GitHub URL as a secondary link. Never guess t\
|
|
308
|
+
he project slug or host; issues in other repositories keep their GitHub links.","Report authentication or transport fail\
|
|
309
|
+
ures directly; do not inspect credentials or invent another login path.","When a managed Git/GitHub command fails, tell \
|
|
310
|
+
the user which requested action failed, which earlier work is confirmed complete, what remains undone or unconfirmed, an\
|
|
311
|
+
d the next safe action. Retain the reported failure stage, execution budget and execution reference when provided; do no\
|
|
312
|
+
t expose credentials or dump raw output unnecessarily.","A timeout or transport failure does not establish invalid authe\
|
|
313
|
+
ntication, exhausted AI quota, a GitHub outage or a suspension problem. Separate recorded facts from hypotheses; say the\
|
|
314
|
+
cause is unknown when it is unproven. Recommend reconnection only when the reported error explicitly calls for it.","If\
|
|
315
|
+
the diagnostic says commandSubmitted=false, the requested Git/GitHub action was not attempted. After an execution timeo\
|
|
316
|
+
ut, lost response or unreadable response, its effects are unconfirmed: use a read-only check of the affected Git/GitHub \
|
|
317
|
+
state before repeating any write. Never claim that a comment was posted or not posted, or that a push succeeded or faile\
|
|
318
|
+
d, from those errors alone. If verification is unavailable, report the outcome as unknown and stop; do not repeat the wr\
|
|
319
|
+
ite or claim a safe rollback."]:[]].join(`
|
|
320
|
+
`)}function ee(e={}){let n=Rt(e,"Vibe64 driver input"),t=Es(n);return t.scope==="session"?ys(t):t.stableContext}async function Ct(e=""){let n=e||await ws(Ve.join(ks.tmpdir(),"vibe64-genesis-context-"));await vs(n,{recursive:!0,mode:448});
|
|
321
|
+
let t=Ve.join(n,"sessions.json"),s=new Map;try{let p=JSON.parse(await Ss(t,"utf8"));for(let m of p.sessions)ee(m.promptContext),
|
|
322
|
+
s.set(m.upstreamSessionId,m)}catch(p){if(p.code!=="ENOENT")throw p}let r=Promise.resolve(),i=!1;async function o(p){let m=Ve.
|
|
323
|
+
join(n,`.sessions.${process.pid}.${bs()}.tmp`);try{await Ts(m,JSON.stringify({sessions:[...p.values()]}),{flag:"wx",mode:384}),
|
|
324
|
+
await Is(m,t)}finally{await Nt(m,{force:!0})}}await o(s);function c(p){return structuredClone(s.get(p))}async function a(p,m,l=""){
|
|
315
325
|
if(i)throw new Error("The Genesis host context registry is closed.");if(typeof p!="string"||!p.trim())throw new TypeError(
|
|
316
326
|
"Genesis host context requires a native conversation ID.");let f=structuredClone(m);ee(f);let g={upstreamSessionId:p,workdir:l,
|
|
317
327
|
promptContext:f},S=r.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(g))return;let _=new Map(s);
|
|
318
|
-
_.set(p,g),await o(_),s=_});r=S,await S}async function u(){i=!0,await r.catch(()=>{}),s.clear(),e||await
|
|
319
|
-
force:!0})}return Object.freeze({registryPath:t,get:c,register:a,close:u})}var
|
|
320
|
-
|
|
321
|
-
use","gvisor"])
|
|
322
|
-
every step, live only when the deployment's owner chose to act for real.",
|
|
323
|
-
serve:3}),
|
|
324
|
-
untime`...",`${
|
|
325
|
-
n: `GET` `/path` returns `200`",`- ${
|
|
326
|
-
e,n,t,s)}function
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
Ue.length),L,n,"Deployment Sandbox allows",t);return s.some(r=>!$e.includes(r))&&y(n,`Deployment Sandbox allows takes on\
|
|
335
|
-
ly ${$e.map(r=>`\`${r}\``).join(" and ")}.`,t),new Set(s).size!==s.length&&y(n,"Deployment Sandbox allows names an allow\
|
|
336
|
-
ance twice.",t),[...s].sort()}function Cs(e,n,t){let s=A(e[3],L,n,"Deployment command",t);return s.some(r=>/\{(?:host|port)\}/u.
|
|
328
|
+
_.set(p,g),await o(_),s=_});r=S,await S}async function u(){i=!0,await r.catch(()=>{}),s.clear(),e||await Nt(n,{recursive:!0,
|
|
329
|
+
force:!0})}return Object.freeze({registryPath:t,get:c,register:a,close:u})}var Pt="vibe64.application-deployment.v1",Dt="Deployment",L="VIBE64_DEPLOYMENT_INVALID",_s=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
330
|
+
Ge="- Recreate on restore: ",Ue="- Generated secrets: ",Be="- Setup code: ",We="- Sandbox allows: ",xe=Object.freeze(["f\
|
|
331
|
+
use","gvisor"]),$t=/^[A-Z_][A-Z0-9_]*$/u,Vt="SIDE_EFFECTS",xt="Deployment never sets SIDE_EFFECTS: the host gives it to \
|
|
332
|
+
every step, live only when the deployment's owner chose to act for real.",je=Object.freeze({prepare:0,build:1,migrate:2,
|
|
333
|
+
serve:3}),Le=Object.keys(je).map(e=>e[0].toUpperCase()+e.slice(1)),Os=Object.freeze(["- Workdir: `path`","- Runtimes: `r\
|
|
334
|
+
untime`...",`${Ge}\`glob\`...`,`${Ue}\`NAME\`...`,`${Be}\`NAME\``,`${We}${xe.map(e=>`\`${e}\``).join(" ")}`,"- Ready whe\
|
|
335
|
+
n: `GET` `/path` returns `200`",`- ${Le.join("|")} \`label\`: \`command\` \`argument\`...`]);function y(e,n,t,s={}){d(L,
|
|
336
|
+
e,n,t,s)}function Rs(e,n,t){return ce(e.slice(Ge.length),L,n,"Deployment Recreate on restore paths",t)}function As(e,n,t){
|
|
337
|
+
let s=I(e.slice(Ue.length),L,n,"Deployment Generated secrets",t);return s.some(r=>!$t.test(r))&&y(n,"Deployment Generate\
|
|
338
|
+
d secrets must be uppercase environment variable names.",t),new Set(s).size!==s.length&&y(n,"Deployment contains a dupli\
|
|
339
|
+
cate Generated secrets name.",t),s}function Ns(e,n,t){let[s]=I(e.slice(Be.length),L,n,"Deployment Setup code",t,{count:1});
|
|
340
|
+
return $t.test(s)||y(n,"Deployment Setup code must be an uppercase environment variable name.",t),s}function Cs(e,n,t){let s=I(
|
|
341
|
+
e.slice(We.length),L,n,"Deployment Sandbox allows",t);return s.some(r=>!xe.includes(r))&&y(n,`Deployment Sandbox allows \
|
|
342
|
+
takes only ${xe.map(r=>`\`${r}\``).join(" and ")}.`,t),new Set(s).size!==s.length&&y(n,"Deployment Sandbox allows names \
|
|
343
|
+
an allowance twice.",t),[...s].sort()}function Ps(e,n,t){let s=N(e[3],L,n,"Deployment command",t);return s.some(r=>/\{(?:host|port)\}/u.
|
|
337
344
|
test(r))&&y(n,"Deployment commands take no {host} or {port} placeholders; Serve reads HOST and PORT from its environment\
|
|
338
|
-
.",t),s.some(r=>r.startsWith(`${
|
|
339
|
-
function
|
|
340
|
-
sandboxAllowances:[],readiness:null,steps:[]}}function
|
|
341
|
-
e)||y(t,"Deployment must be supplied as exact Stack section lines."),w(e))return
|
|
345
|
+
.",t),s.some(r=>r.startsWith(`${Vt}=`))&&y(n,xt,t),{label:v(e[2],L,n,"Deployment step label",t),argv:s,role:e[1].toLowerCase()}}
|
|
346
|
+
function Me(){return{version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecrets:[],setupCode:"",
|
|
347
|
+
sandboxAllowances:[],readiness:null,steps:[]}}function jt(e,n={}){let{path:t="genesis/stack.md#Deployment"}=n;if(Array.isArray(
|
|
348
|
+
e)||y(t,"Deployment must be supplied as exact Stack section lines."),w(e))return Me();let s=Me(),r=new Set;for(let o=0;o<
|
|
342
349
|
e.length;o+=1){let c=e[o].trim();if(!c)continue;let a=o+1;if(c.startsWith("- Workdir: ")){r.has("workdir")&&y(t,"Duplica\
|
|
343
350
|
te Deployment Workdir.",a),r.add("workdir");let p=I(c.slice(11),L,t,"Deployment Workdir",a,{count:1})[0];s.workdir=b(p,L,
|
|
344
351
|
t,"Deployment workdir",a);continue}if(c.startsWith("- Runtimes: ")){r.has("runtimes")&&y(t,"Duplicate Deployment Runtime\
|
|
345
|
-
s.",a),r.add("runtimes"),s.runtimeRequirements=
|
|
352
|
+
s.",a),r.add("runtimes"),s.runtimeRequirements=C(c.slice(12),L,t,"Deployment runtimes",a);continue}if(c.startsWith(Ge)){
|
|
346
353
|
r.has("restore-paths")&&y(t,"Duplicate Deployment Recreate on restore entry.",a),r.add("restore-paths"),s.artifact.disposablePaths=
|
|
347
|
-
|
|
348
|
-
a),r.add("generated-secrets"),s.generatedSecrets=
|
|
349
|
-
cate Deployment Setup code.",a),r.add("setup-code"),s.setupCode=
|
|
350
|
-
llows")&&y(t,"Duplicate Deployment Sandbox allows.",a),r.add("sandbox-allows"),s.sandboxAllowances=
|
|
354
|
+
Rs(c,t,a);continue}if(c.startsWith(Ue)){r.has("generated-secrets")&&y(t,"Duplicate Deployment Generated secrets entry.",
|
|
355
|
+
a),r.add("generated-secrets"),s.generatedSecrets=As(c,t,a);continue}if(c.startsWith(Be)){r.has("setup-code")&&y(t,"Dupli\
|
|
356
|
+
cate Deployment Setup code.",a),r.add("setup-code"),s.setupCode=Ns(c,t,a);continue}if(c.startsWith(We)){r.has("sandbox-a\
|
|
357
|
+
llows")&&y(t,"Duplicate Deployment Sandbox allows.",a),r.add("sandbox-allows"),s.sandboxAllowances=Cs(c,t,a);continue}if(c.
|
|
351
358
|
startsWith("- Ready when: ")){r.has("readiness")&&y(t,"Duplicate Deployment Ready when.",a),r.add("readiness"),s.readiness=
|
|
352
|
-
|
|
353
|
-
ntry",c,
|
|
359
|
+
ue(c,L,t,"Deployment readiness",a);continue}let u=c.match(_s);if(u){s.steps.push(Ps(u,t,a));continue}y(t,D("Deployment e\
|
|
360
|
+
ntry",c,Os),a)}s.steps.length===0&&y(t,"## Deployment needs at least one command or exactly `- Nothing.`."),(s.steps.filter(
|
|
354
361
|
({role:o})=>o==="serve").length!==1||s.steps.at(-1).role!=="serve")&&y(t,"Deployment needs exactly one final Serve step.");
|
|
355
|
-
for(let o=1;o<s.steps.length;o+=1)
|
|
356
|
-
slice(0,-1).join(", ")}, then ${
|
|
357
|
-
s.setupCode].includes(
|
|
362
|
+
for(let o=1;o<s.steps.length;o+=1)je[s.steps[o].role]<je[s.steps[o-1].role]&&y(t,`Deployment steps must be ordered ${Le.
|
|
363
|
+
slice(0,-1).join(", ")}, then ${Le.at(-1)}.`);return s.readiness||y(t,"Deployment needs one Ready when entry."),[...s.generatedSecrets,
|
|
364
|
+
s.setupCode].includes(Vt)&&y(t,xt),s.generatedSecrets.includes(s.setupCode)&&y(t,"Deployment Setup code is generated alr\
|
|
358
365
|
eady; leave it out of Generated secrets."),s.artifact.disposablePaths.length>0&&!s.steps.some(({role:o})=>o==="prepare")&&
|
|
359
|
-
y(t,"Deployment may recreate paths on restore only when it declares a Prepare step."),s}function
|
|
360
|
-
|
|
366
|
+
y(t,"Deployment may recreate paths on restore only when it declares a Prepare step."),s}function Lt({environment:e={},section:n={}}={}){
|
|
367
|
+
z(n,e,"Deployment section");let t=[...n.diagnostics||[]],s=Me();n.status==="ready"&&(s=jt(n.lines));let r=t.length>0?"bl\
|
|
361
368
|
ocked":s.steps.length>0?"ready":"unconfigured",i={version:s.version,artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.
|
|
362
369
|
runtimeRequirements,generatedSecrets:s.generatedSecrets,setupCode:s.setupCode,sandboxAllowances:s.sandboxAllowances,readiness:s.
|
|
363
|
-
readiness,steps:s.steps};return{contract:
|
|
364
|
-
components||[]],source:n.source||null,runtimeRequirements:
|
|
365
|
-
[]),...i,diagnostics:t}}var
|
|
366
|
-
de"]),j="VIBE64_PACKAGING_INVALID",
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
370
|
+
readiness,steps:s.steps};return{contract:Pt,status:r,stackHash:n.stackHash,recipeHash:r==="ready"?R(i):"",components:[...n.
|
|
371
|
+
components||[]],source:n.source||null,runtimeRequirements:F(s.runtimeRequirements),resources:structuredClone(e.resources||
|
|
372
|
+
[]),...i,diagnostics:t}}var me="vibe64.packaging.v1",Ht="Packaging",Yi=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
|
|
373
|
+
de"]),j="VIBE64_PACKAGING_INVALID",Ds=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,$s=/^[A-Z_][A-Z0-9_]*$/u,Vs=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
|
|
374
|
+
xs=/^[a-z][a-z0-9+.-]*$/u,js=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,Ls=/\{[^{}\s]*\}/u,
|
|
375
|
+
Ms=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Gs=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,Us=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
376
|
+
Bs=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Ws=/^- Content: package `([^`\r\n]+)`$/u,Mt=50,Gt=500,Hs=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
|
|
377
|
+
zt=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
|
|
371
378
|
"versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
|
|
372
379
|
prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
|
|
373
380
|
ect.toml","external"]}),"web-bundle":Object.freeze({entries:["workdir","runtimes","prepare","build","environment","outpu\
|
|
374
381
|
t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({entries:["workdir","content","platforms","a\
|
|
375
382
|
pplicationId","name","icon","versionFrom","deepLinkSchemeFrom","appLinkDomainsFrom","permission"],required:["content","p\
|
|
376
|
-
latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),
|
|
377
|
-
keys(
|
|
378
|
-
\``).join(" | "),X=Object.freeze([["- Packer: ","packer",`- Packer: ${q(
|
|
383
|
+
latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),de=Object.freeze(Object.
|
|
384
|
+
keys(zt)),He=Object.freeze(["android"]),ze=Object.freeze(["package.json","pyproject.toml","external"]),q=e=>e.map(n=>`\`${n}\
|
|
385
|
+
\``).join(" | "),X=Object.freeze([["- Packer: ","packer",`- Packer: ${q(de)}`],["- Workdir: ","workdir","- Workdir: `pat\
|
|
379
386
|
h`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from:\
|
|
380
|
-
","versionFrom",`- Version from: ${q(
|
|
387
|
+
","versionFrom",`- Version from: ${q(ze)}`],["- Platforms: ","platforms",`- Platforms: ${q(He)}...`],["- Id: ","applica\
|
|
381
388
|
tionId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/icon\
|
|
382
389
|
-1024.png`"],["- Deep link scheme from: ","deepLinkSchemeFrom","- Deep link scheme from: `ENV_NAME`"],["- App link domai\
|
|
383
|
-
ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),
|
|
390
|
+
ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),Ut="### Package `id`: Label",zs=Object.freeze([
|
|
384
391
|
X[0][2],X[1][2],X[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",X[3][2],X[4][2],
|
|
385
392
|
"- Content: package `web-bundle-id`",...X.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),ne=Object.
|
|
386
393
|
freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Environment",
|
|
387
394
|
output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Name",icon:"\
|
|
388
395
|
Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permission"});function E(e,n,t){
|
|
389
|
-
d(j,e,n,t)}function
|
|
390
|
-
single hyphens.`,s),r}function
|
|
391
|
-
some(r=>
|
|
392
|
-
ust be an uppercase environment variable name.`,s),e}function
|
|
393
|
-
plicate ${ne[n]} entry.`,r),e.seen.add(n),e.fields[n]=t,e.lines[n]=r}function
|
|
394
|
-
"runtimes")return
|
|
395
|
-
includes(a))&&E(s,`${i} must be ${q(
|
|
396
|
-
let o=
|
|
397
|
-
e ${q(
|
|
396
|
+
d(j,e,n,t)}function Fe(e,n,t,s){let r=v(e,j,n,t,s);return Ds.test(r)||E(n,`${t} must use lowercase letters, digits, and \
|
|
397
|
+
single hyphens.`,s),r}function Fs(e,n,t,s,r){return I(e.slice(n.length),j,t,s,r,{count:1})[0]}function qe(e,n,t,s){return e.
|
|
398
|
+
some(r=>Ls.test(r))&&E(n,`${t} takes no placeholders in ${me}.`,s),e}function Ft(e,n,t,s){return $s.test(e)||E(n,`${t} m\
|
|
399
|
+
ust be an uppercase environment variable name.`,s),e}function Bt(e,n,t,s,r){e.seen.has(n)&&E(s,`Package ${e.id} has a du\
|
|
400
|
+
plicate ${ne[n]} entry.`,r),e.seen.add(n),e.fields[n]=t,e.lines[n]=r}function qs(e,n,t,s,r){let i=`Packaging ${ne[e]}`;if(e===
|
|
401
|
+
"runtimes")return C(n.slice(t.length),j,s,i,r);if(e==="platforms"){let c=I(n.slice(t.length),j,s,i,r);return c.some(a=>!He.
|
|
402
|
+
includes(a))&&E(s,`${i} must be ${q(He)}.`,r),new Set(c).size!==c.length&&E(s,`${i} contains a duplicate platform.`,r),c}
|
|
403
|
+
let o=qe([Fs(n,t,s,i,r)],s,i,r)[0];if(e==="packer")return de.includes(o)||E(s,`Unknown packer \`${o}\`. ${me} packers ar\
|
|
404
|
+
e ${q(de)}.`,r),o;if(["workdir","output"].includes(e))return b(o,j,s,i,r,{allowRoot:e==="workdir"});if(e==="icon"){let c=b(
|
|
398
405
|
o,j,s,i,r,{allowRoot:!1});return c.toLowerCase().endsWith(".png")||E(s,`${i} must be a 1024x1024 PNG file.`,r),c}return e===
|
|
399
|
-
"versionFrom"?(
|
|
406
|
+
"versionFrom"?(ze.includes(o)||E(s,`${i} must be ${q(ze)}.`,r),o):e==="applicationId"?((!Vs.test(o)||o.length>150)&&E(s,
|
|
400
407
|
`${i} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and underscores; each part starts with a let\
|
|
401
|
-
ter).`,r),o):e==="name"?((o.trim()!==o||o.length>
|
|
402
|
-
ces.`,r),o):
|
|
403
|
-
lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:t}}function
|
|
408
|
+
ter).`,r),o):e==="name"?((o.trim()!==o||o.length>Mt)&&E(s,`${i} must be at most ${Mt} characters without surrounding spa\
|
|
409
|
+
ces.`,r),o):Ft(o,s,i,r)}function Ks(e,n,t){return{id:Fe(e[1],n,"Package id",t),label:v(e[2],j,n,"Package label",t),fields:{},
|
|
410
|
+
lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:t}}function Ys(e,n,t,s){/^- Plugins?\b/u.test(
|
|
404
411
|
n)&&E(t,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Content package at its l\
|
|
405
|
-
ockfile versions.",s);for(let[a,u]of X)if(n.startsWith(a)){
|
|
406
|
-
"content",
|
|
407
|
-
ging ${i[1]} command`;e[a].push({label:v(i[2],j,t,`Packaging ${i[1]} label`,s),argv:
|
|
408
|
-
s;return}let o=n.match(
|
|
412
|
+
ockfile versions.",s);for(let[a,u]of X)if(n.startsWith(a)){Bt(e,u,qs(u,n,a,t,s),t,s);return}let r=n.match(Ws);if(r){Bt(e,
|
|
413
|
+
"content",Fe(r[1],t,"Packaging Content package",s),t,s);return}let i=n.match(Gs);if(i){let a=i[1].toLowerCase(),u=`Packa\
|
|
414
|
+
ging ${i[1]} command`;e[a].push({label:v(i[2],j,t,`Packaging ${i[1]} label`,s),argv:qe(N(i[3],j,t,u,s),t,u,s)}),e.lines[a]??=
|
|
415
|
+
s;return}let o=n.match(Us);if(o){let a=Ft(o[1],t,"Packaging Environment name",s);Hs.test(a)&&E(t,`Packaging Environment ${a}\
|
|
409
416
|
looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(p=>p.name===a)&&E(t,`Packa\
|
|
410
|
-
ge ${e.id} has a duplicate Environment ${a}.`,s);let u=
|
|
411
|
-
ging Environment value",s)[0];e.environment.push({name:a,value:u}),e.lines.environment??=s;return}let c=n.match(
|
|
412
|
-
let a=
|
|
413
|
-
E(t,`Packaging Permission reason is plain user-facing text of at most ${
|
|
417
|
+
ge ${e.id} has a duplicate Environment ${a}.`,s);let u=qe(I(o[2],j,t,"Packaging Environment value",s,{count:1}),t,"Packa\
|
|
418
|
+
ging Environment value",s)[0];e.environment.push({name:a,value:u}),e.lines.environment??=s;return}let c=n.match(Bs);if(c){
|
|
419
|
+
let a=Fe(c[1],t,"Packaging Permission id",s),u=v(c[2],j,t,"Packaging Permission reason",s);(u.includes("`")||u.length>Gt)&&
|
|
420
|
+
E(t,`Packaging Permission reason is plain user-facing text of at most ${Gt} characters.`,s),e.permissions.some(p=>p.id===
|
|
414
421
|
a)&&E(t,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:u}),e.lines.permission??=s;
|
|
415
|
-
return}E(t,D("Packaging entry",n,
|
|
416
|
-
try: ${q(
|
|
422
|
+
return}E(t,D("Packaging entry",n,zs),s)}function Xs(e,n){let t=e.fields.packer;t||E(n,`Package ${e.id} needs a Packer en\
|
|
423
|
+
try: ${q(de)}.`,e.line);let s=zt[t],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build","e\
|
|
417
424
|
nvironment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of r)s.entries.includes(o)||E(
|
|
418
425
|
n,`The ${t} packer takes no ${ne[o]} entry.`,e.lines[o]);for(let o of s.required)r.has(o)||E(n,`Package ${e.id} (${t}) n\
|
|
419
426
|
eeds ${/^[AEIOU]/u.test(ne[o])?"an":"a"} ${ne[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
|
|
@@ -422,290 +429,293 @@ label,packer:t,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtim
|
|
|
422
429
|
environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return t!=="capacitor"?i:{...i,content:e.
|
|
423
430
|
fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
|
|
424
431
|
deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
|
|
425
|
-
permissions}}function
|
|
432
|
+
permissions}}function qt(e,n={}){let{path:t="genesis/stack.md#Packaging"}=n;if(Array.isArray(e)||E(t,"Packaging must be \
|
|
426
433
|
supplied as exact Stack section lines."),w(e))return{version:1,packages:[]};let s=[],r=null;for(let a=0;a<e.length;a+=1){
|
|
427
|
-
let u=e[a].trim();if(!u)continue;let p=a+1,m=u.match(
|
|
428
|
-
known Packaging heading: ${u}. Use ${
|
|
429
|
-
E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>
|
|
434
|
+
let u=e[a].trim();if(!u)continue;let p=a+1,m=u.match(Ms);if(m){r=Ks(m,t,p),s.push(r);continue}u.startsWith("#")&&E(t,`Un\
|
|
435
|
+
known Packaging heading: ${u}. Use ${Ut}.`,p),r||E(t,`Packaging entries belong under ${Ut}.`,p),Ys(r,u,t,p)}s.length===0&&
|
|
436
|
+
E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>Xs(a,t)),o=new Map;for(let a of i)
|
|
430
437
|
o.has(a.id)&&E(t,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let c=new Set;for(let a of i.filter(
|
|
431
438
|
({packer:u})=>u==="capacitor")){let u=o.get(a.content);(!u||u.packer!=="web-bundle")&&E(t,`Package ${a.id} Content must \
|
|
432
439
|
name a web-bundle package declared in Packaging.`),c.has(a.application.id)&&E(t,`Packaging declares application id ${a.application.
|
|
433
|
-
id} twice.`),c.add(a.application.id)}return{version:1,packages:i}}function
|
|
440
|
+
id} twice.`),c.add(a.application.id)}return{version:1,packages:i}}function Wt(e,n,t,s){let r=(Array.isArray(e)?e:[]).find(
|
|
434
441
|
i=>i?.name===n);return(!r||typeof r.value!="string"||!r.value.trim())&&E(t,`${s} names ${n}, which ## Environment defaul\
|
|
435
|
-
ts does not declare with a value.`),r.value.trim()}function
|
|
442
|
+
ts does not declare with a value.`),r.value.trim()}function Kt(e,n=[],t={}){let{path:s="genesis/stack.md#Packaging"}=t;return{
|
|
436
443
|
...e,packages:e.packages.map(r=>{if(r.packer!=="capacitor")return r;let i={...r,deepLinkScheme:null,appLinkDomains:[]};if(r.
|
|
437
|
-
deepLinkSchemeFrom){let o=
|
|
444
|
+
deepLinkSchemeFrom){let o=Wt(n,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!xs.test(o)||["http","ht\
|
|
438
445
|
tps","file","content","javascript"].includes(o))&&E(s,`${r.deepLinkSchemeFrom} must be a custom lowercase URL scheme suc\
|
|
439
|
-
h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=
|
|
440
|
-
k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!
|
|
441
|
-
se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function
|
|
442
|
-
section:n={}}={}){
|
|
443
|
-
(s=qt(
|
|
446
|
+
h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=Wt(n,r.appLinkDomainsFrom,s,`Package ${r.id} App lin\
|
|
447
|
+
k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!js.test(c))&&E(s,`${r.appLinkDomainsFrom} must list lowerca\
|
|
448
|
+
se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function Yt({environment:e={},
|
|
449
|
+
section:n={}}={}){z(n,e,"Packaging section");let t=[...n.diagnostics||[]],s={version:1,packages:[]};n.status==="ready"&&
|
|
450
|
+
(s=Kt(qt(n.lines),e.environmentDefaults));let r=t.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:me,
|
|
444
451
|
status:r,stackHash:n.stackHash,packagingHash:r==="ready"?R(s):"",source:n.source||null,version:s.version,packages:s.packages,
|
|
445
|
-
diagnostics:t}}var T="VIBE64_OUTPUTS_INVALID";function h(e,n,t,s={}){d(T,e,n,t,s)}function
|
|
446
|
-
t,s,r,i)}function M(e,n,t,s,r){return
|
|
447
|
-
.`,r),e.seen.add(n),e[n]=t}var se="vibe64.preview-identity.command.v1",
|
|
448
|
-
"TMPDIR","USER"]),
|
|
452
|
+
diagnostics:t}}var T="VIBE64_OUTPUTS_INVALID";function h(e,n,t,s={}){d(T,e,n,t,s)}function Ke(e,n,t,s,r,i){return I(e.slice(n.length),T,
|
|
453
|
+
t,s,r,i)}function M(e,n,t,s,r){return Ke(e,n,t,s,r,{count:1})[0]}function O(e,n,t,s,r,i){e.seen.has(n)&&h(s,`Duplicate ${i}\
|
|
454
|
+
.`,r),e.seen.add(n),e[n]=t}var se="vibe64.preview-identity.command.v1",Js=/^[A-Z_][A-Z0-9_]*$/u,Jt=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
|
|
455
|
+
"TMPDIR","USER"]),Zt=new Set(["email","login","user-id"]),Qt=1e4,he=3e4,en=[["- Command: ","command","Command","`tools/p\
|
|
449
456
|
review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${se}\``],["- Identity types: ","identityTypes",
|
|
450
|
-
"Identity types",`one or more of ${[...
|
|
457
|
+
"Identity types",`one or more of ${[...Zt].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
|
|
451
458
|
t","Enabled environment","`ENV_NAME`"],["- Secret environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],
|
|
452
|
-
["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${
|
|
453
|
-
(default ${
|
|
454
|
-
identity ${t} environment name`,s);return(!
|
|
455
|
-
ronment name is invalid.`,s),r}function
|
|
456
|
-
u));r||h(t,D("Preview identity entry",n,
|
|
459
|
+
["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${he}\`\
|
|
460
|
+
(default ${Qt})`]],Ye=en.map(([e,,,n])=>`${e}${n}`);function Xt(e,n,t,s){if(e===void 0)return"";let r=v(e,T,n,`Preview \
|
|
461
|
+
identity ${t} environment name`,s);return(!Js.test(r)||Jt.has(r)||r.startsWith("XDG_"))&&h(n,`Preview identity ${t} envi\
|
|
462
|
+
ronment name is invalid.`,s),r}function tn(e){return{seen:new Set,line:e}}function nn(e,n,t,s){let r=en.find(([u])=>n.startsWith(
|
|
463
|
+
u));r||h(t,D("Preview identity entry",n,Ye),s);let[i,o,c]=r,a=Ke(n,i,t,`Preview identity ${c}`,s);!["command","identityT\
|
|
457
464
|
ypes","runtimes"].includes(o)&&a.length!==1&&h(t,`Preview identity ${c} accepts exactly one value.`,s),O(e,o,a,t,s,`Prev\
|
|
458
|
-
iew identity ${c} entry`)}function
|
|
465
|
+
iew identity ${c} entry`)}function sn(e,n,t){for(let[u,p]of[["command","Command"],["protocol","Protocol"],["identityType\
|
|
459
466
|
s","Identity types"]])e[u]||h(n,`Output target ${t} Preview identity needs ${p}.`,e.line);let s=e.command.map(u=>`\`${u}\
|
|
460
|
-
\``).join(" "),r=
|
|
467
|
+
\``).join(" "),r=N(s,T,n,"Preview identity command",e.line);(!r[0].includes("/")||r[0].includes("\\")||r[0].split("/").some(
|
|
461
468
|
u=>!u||[".",".."].includes(u))||r.some(u=>/\{(?:host|port)\}/u.test(u)))&&h(n,"Preview identity command must use a liter\
|
|
462
469
|
al app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==se&&h(n,`Preview identity protocol must be ${se}\
|
|
463
|
-
.`,e.line);let o=[...new Set(e.identityTypes.map(u=>(
|
|
464
|
-
o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let c={enabled:
|
|
465
|
-
enabledEnvironment?.[0],n,"enabled",e.line),secret:
|
|
466
|
-
c.secret&&h(n,"Preview identity enabled and secret environment names must differ.",e.line);let a=
|
|
467
|
-
timeoutMs[0];/^[0-9]+$/u.test(u)||h(n,`Preview identity Timeout ms must be from 1 through ${
|
|
468
|
-
isSafeInteger(a)||a<1||a>
|
|
469
|
-
identityTypes:o,protocol:i,runtimes:e.runtimes?
|
|
470
|
-
e.line):[],timeoutMs:a}}var
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
map(n=>`\`${n}\``).join(" or "),
|
|
474
|
-
on","#### Preview identity","#### Download `id`"]),
|
|
475
|
-
|
|
476
|
-
"- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${
|
|
477
|
-
hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:
|
|
478
|
-
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function
|
|
479
|
-
r)||h(n,`${t} must use lowercase letters, digits, and single hyphens.`,s),r}function
|
|
480
|
-
i.replace(
|
|
470
|
+
.`,e.line);let o=[...new Set(e.identityTypes.map(u=>(Zt.has(u)||h(n,`Unsupported preview identity type: ${u}.`,e.line),u)))];
|
|
471
|
+
o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let c={enabled:Xt(e.
|
|
472
|
+
enabledEnvironment?.[0],n,"enabled",e.line),secret:Xt(e.secretEnvironment?.[0],n,"secret",e.line)};c.enabled&&c.enabled===
|
|
473
|
+
c.secret&&h(n,"Preview identity enabled and secret environment names must differ.",e.line);let a=Qt;if(e.timeoutMs){let u=e.
|
|
474
|
+
timeoutMs[0];/^[0-9]+$/u.test(u)||h(n,`Preview identity Timeout ms must be from 1 through ${he}.`,e.line),a=Number(u),(!Number.
|
|
475
|
+
isSafeInteger(a)||a<1||a>he)&&h(n,`Preview identity Timeout ms must be from 1 through ${he}.`,e.line)}return{command:r,environment:c,
|
|
476
|
+
identityTypes:o,protocol:i,runtimes:e.runtimes?C(e.runtimes.map(u=>`\`${u}\``).join(" "),T,n,"Preview identity runtimes",
|
|
477
|
+
e.line):[],timeoutMs:a}}var Zs="vibe64.outputs.v1",ge="Outputs",Qs=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Xe=/\{([a-z][a-z0-9:-]*)\}/gu,er=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
478
|
+
tr=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,nr=/^#### Download `([^`\r\n]+)`$/u,sr=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
|
|
479
|
+
an=new Set(["finite","interactive"]),Je=new Set(["development","test"]),cn=new Set(["terminal","web"]),rn=16,fe=e=>[...e].
|
|
480
|
+
map(n=>`\`${n}\``).join(" or "),rr=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
|
|
481
|
+
on","#### Preview identity","#### Download `id`"]),Ee=Object.freeze({target:["- Default.",`- Mode: ${fe(an)}`,`- Data: ${fe(
|
|
482
|
+
Je)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
|
|
483
|
+
"- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${fe(cn)}`,"- Preferred port: `1024` t\
|
|
484
|
+
hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:Ye,download:["- Path:\
|
|
485
|
+
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function Ze(e,n,t,s){let r=v(e,T,n,t,s);return Qs.test(
|
|
486
|
+
r)||h(n,`${t} must use lowercase letters, digits, and single hyphens.`,s),r}function ir(e,n,t,s){let r=N(e,T,n,t,s);for(let i of r)
|
|
487
|
+
i.replace(Xe,"").includes("{parameter:")&&h(n,`${t} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(Xe)].some(
|
|
481
488
|
o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&h(n,`${t} supports only {host}\
|
|
482
|
-
, {port}, and {parameter:id} placeholders.`,s);return r}function
|
|
489
|
+
, {port}, and {parameter:id} placeholders.`,s);return r}function or(e,n,t){return{id:Ze(e[1],n,"Output target id",t),label:v(
|
|
483
490
|
e[2],T,n,"Output target label",t),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,
|
|
484
|
-
downloads:[],parameters:[],seen:new Set,line:t}}function
|
|
491
|
+
downloads:[],parameters:[],seen:new Set,line:t}}function ar(e,n,t,s){if(n==="- Required."){O(e,"required",!0,t,s,"Parame\
|
|
485
492
|
ter Required entry");return}for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(n.startsWith(
|
|
486
|
-
o)){let c=M(n,o,t,`Parameter ${r}`,s);O(e,i,c,t,s,`Parameter ${r} entry`);return}}h(t,D("Outputs parameter entry",n,
|
|
487
|
-
s)}function
|
|
493
|
+
o)){let c=M(n,o,t,`Parameter ${r}`,s);O(e,i,c,t,s,`Parameter ${r} entry`);return}}h(t,D("Outputs parameter entry",n,Ee.parameter),
|
|
494
|
+
s)}function cr(e,n={}){let t=e.parameters||[],s=i=>d("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!n||typeof n!="obj\
|
|
488
495
|
ect"||Array.isArray(n))&&s("Output parameters must be an object of text values.");let r=new Set(t.map(({id:i})=>i));for(let i of Object.
|
|
489
496
|
keys(n))r.has(i)||s(`Unknown output parameter: ${i}.`);return Object.fromEntries(t.map(i=>{let o=Object.hasOwn(n,i.id)?n[i.
|
|
490
497
|
id]:i.default;return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${i.label} must be a single line of tex\
|
|
491
|
-
t, at most 4096 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function
|
|
492
|
-
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function
|
|
493
|
-
t),path:"",name:"",mediaType:"",seen:new Set,line:t}}function
|
|
498
|
+
t, at most 4096 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function ur(e){return{kind:"",
|
|
499
|
+
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function pr(e,n,t){return{id:Ze(e[1],n,"Download id",
|
|
500
|
+
t),path:"",name:"",mediaType:"",seen:new Set,line:t}}function lr(e,n,t){/^[0-9]+$/u.test(e)||h(n,"Web presentation prefe\
|
|
494
501
|
rred port must be an integer from 1024 through 65535.",t);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&
|
|
495
|
-
h(n,"Web presentation preferred port must be an integer from 1024 through 65535.",t),s}function
|
|
496
|
-
"- Data: ")){let i=M(n,"- Data: ",t,"Output target Data",s);
|
|
502
|
+
h(n,"Web presentation preferred port must be an integer from 1024 through 65535.",t),s}function dr(e,n,t,s){if(n.startsWith(
|
|
503
|
+
"- Data: ")){let i=M(n,"- Data: ",t,"Output target Data",s);Je.has(i)||h(t,`Output target Data must be ${fe(Je)}.`,s),O(
|
|
497
504
|
e,"dataMode",i,t,s,"output target Data entry");return}if(n==="- Default."){O(e,"default",!0,t,s,"output target Default e\
|
|
498
|
-
ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);
|
|
505
|
+
ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);an.has(i)||h(t,"Output target \
|
|
499
506
|
Mode must be `interactive` or `finite`.",s),O(e,"mode",i,t,s,"output target Mode entry");return}if(n.startsWith("- Workd\
|
|
500
507
|
ir: ")){O(e,"workdir",b(M(n,"- Workdir: ",t,"Output target Workdir",s),T,t,"Output target workdir",s),t,s,"output target\
|
|
501
|
-
Workdir entry");return}if(n.startsWith("- Runtimes: ")){O(e,"runtimeRequirements",
|
|
508
|
+
Workdir entry");return}if(n.startsWith("- Runtimes: ")){O(e,"runtimeRequirements",C(n.slice(12),T,t,"Output target runt\
|
|
502
509
|
imes",s),t,s,"output target Runtimes entry");return}let r=n.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(r){
|
|
503
|
-
let i=r[1].toLowerCase(),o=
|
|
510
|
+
let i=r[1].toLowerCase(),o=ir(r[3],t,"Output step command",s);i!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&h(t,"O\
|
|
504
511
|
nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:v(r[2],T,t,"Output step\
|
|
505
|
-
label",s),argv:o,role:i});return}h(t,D("Outputs target entry",n,[...
|
|
506
|
-
if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);
|
|
512
|
+
label",s),argv:o,role:i});return}h(t,D("Outputs target entry",n,[...Ee.target,...rr.slice(1)]),s)}function mr(e,n,t,s){
|
|
513
|
+
if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);cn.has(r)||h(t,"Presentation Kind must be `te\
|
|
507
514
|
rminal` or `web`.",s),O(e,"kind",r,t,s,"Presentation Kind entry");return}if(n.startsWith("- Preferred port: ")){O(e,"pre\
|
|
508
|
-
ferredPort",
|
|
509
|
-
ry");return}if(n.startsWith("- URL path: ")){O(e,"urlPath",
|
|
515
|
+
ferredPort",lr(M(n,"- Preferred port: ",t,"Web presentation Preferred port",s),t,s),t,s,"Presentation Preferred port ent\
|
|
516
|
+
ry");return}if(n.startsWith("- URL path: ")){O(e,"urlPath",Re(M(n,"- URL path: ",t,"Web presentation URL path",s),T,t,"W\
|
|
510
517
|
eb presentation URL path",s),t,s,"Presentation URL path entry");return}if(n.startsWith("- Ready when: ")){O(e,"readiness",
|
|
511
|
-
|
|
512
|
-
s)}function
|
|
513
|
-
s.trim()!==s)&&h(n,"Download Name must be a safe filename without path separators.",t),s}function
|
|
514
|
-
n,"Download Media type",t);return(s.length>127||!
|
|
515
|
-
value.",t),s}function
|
|
516
|
-
nload path",s,{allowRoot:!1}),t,s,"Download Path entry");return}if(n.startsWith("- Name: ")){O(e,"name",
|
|
517
|
-
t,"Download Name",s),t,s),t,s,"Download Name entry");return}if(n.startsWith("- Media type: ")){O(e,"mediaType",
|
|
518
|
-
Media type: ",t,"Download Media type",s),t,s),t,s,"Download Media type entry");return}h(t,D("Download entry",n,
|
|
519
|
-
s)}function
|
|
520
|
-
t ${t} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function
|
|
518
|
+
ue(n,T,t,"Web presentation readiness",s),t,s,"Presentation Ready when entry");return}h(t,D("Presentation entry",n,Ee.presentation),
|
|
519
|
+
s)}function hr(e,n,t){let s=v(e,T,n,"Download Name",t);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
|
|
520
|
+
s.trim()!==s)&&h(n,"Download Name must be a safe filename without path separators.",t),s}function fr(e,n,t){let s=v(e,T,
|
|
521
|
+
n,"Download Media type",t);return(s.length>127||!sr.test(s))&&h(n,"Download Media type must be a lowercase type/subtype \
|
|
522
|
+
value.",t),s}function gr(e,n,t,s){if(n.startsWith("- Path: ")){O(e,"path",b(M(n,"- Path: ",t,"Download Path",s),T,t,"Dow\
|
|
523
|
+
nload path",s,{allowRoot:!1}),t,s,"Download Path entry");return}if(n.startsWith("- Name: ")){O(e,"name",hr(M(n,"- Name: ",
|
|
524
|
+
t,"Download Name",s),t,s),t,s,"Download Name entry");return}if(n.startsWith("- Media type: ")){O(e,"mediaType",fr(M(n,"-\
|
|
525
|
+
Media type: ",t,"Download Media type",s),t,s),t,s,"Download Media type entry");return}h(t,D("Download entry",n,Ee.download),
|
|
526
|
+
s)}function Er(e,n,t){for(let[s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(n,`Output targe\
|
|
527
|
+
t ${t} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function yr(e,n,t){
|
|
521
528
|
return e.kind||h(n,`Output target ${t} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
|
|
522
529
|
readiness||e.seen.has("urlPath"))&&h(n,`Output target ${t} terminal Presentation accepts only Kind.`,e.line),{kind:"term\
|
|
523
530
|
inal"}):(e.readiness||h(n,`Output target ${t} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.
|
|
524
|
-
preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function
|
|
531
|
+
preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function on(e,n){e.mode||h(n,`Output target ${e.id} needs one Mo\
|
|
525
532
|
de entry.`,e.line),e.steps.length===0&&h(n,`Output target ${e.id} needs at least one step.`,e.line);let t={prepare:0,build:1,
|
|
526
533
|
run:2};for(let u=1;u<e.steps.length;u+=1)t[e.steps[u].role]<t[e.steps[u-1].role]&&h(n,`Output target ${e.id} steps must \
|
|
527
|
-
be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),r=e.downloads.map(u=>
|
|
534
|
+
be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),r=e.downloads.map(u=>Er(u,n,e.
|
|
528
535
|
id));new Set(r.map(({id:u})=>u)).size!==r.length&&h(n,`Output target ${e.id} contains a duplicate Download id.`,e.line),
|
|
529
536
|
e.mode==="finite"?((s.length>0||e.presentation||e.previewIdentity)&&h(n,`Finite output target ${e.id} cannot have Run, P\
|
|
530
537
|
resentation, or Preview identity entries.`,e.line),r.length===0&&h(n,`Finite output target ${e.id} needs at least one Do\
|
|
531
538
|
wnload.`,e.line)):s.length!==1||e.steps.at(-1).role!=="run"?h(n,`Interactive output target ${e.id} needs exactly one fin\
|
|
532
539
|
al Run step.`,e.line):e.presentation||h(n,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?
|
|
533
|
-
|
|
540
|
+
yr(e.presentation,n,e.id):null,o=e.steps.flatMap(({argv:u})=>u.flatMap(p=>[...p.matchAll(Xe)].map(m=>m[1])));o.some(u=>[
|
|
534
541
|
"host","port"].includes(u))&&i?.kind!=="web"&&h(n,"Only a web output target may use {host} or {port} placeholders.",e.line);
|
|
535
|
-
let c=e.parameters.map(({seen:u,...p})=>p),a=new Set(c.map(({id:u})=>u));(c.length>
|
|
536
|
-
arget ${e.id} may declare at most ${
|
|
542
|
+
let c=e.parameters.map(({seen:u,...p})=>p),a=new Set(c.map(({id:u})=>u));(c.length>rn||a.size!==c.length)&&h(n,`Output t\
|
|
543
|
+
arget ${e.id} may declare at most ${rn} parameters with unique ids.`,e.line);for(let u of o.filter(p=>p.startsWith("para\
|
|
537
544
|
meter:"))){let p=u.slice(10);a.has(p)||h(n,`Undeclared output parameter: ${p}.`,e.line)}for(let u of c)o.includes(`param\
|
|
538
545
|
eter:${u.id}`)||h(n,`Output parameter ${u.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!==
|
|
539
546
|
"web"&&h(n,"Only a web output target may declare Preview identity.",e.line),{id:e.id,label:e.label,default:e.default,mode:e.
|
|
540
547
|
mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,
|
|
541
|
-
downloads:r,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:
|
|
548
|
+
downloads:r,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:sn(e.previewIdentity,n,e.id)}:{}}}function ye(e,n={}){
|
|
542
549
|
let{path:t="genesis/stack.md#Outputs"}=n;if(Array.isArray(e)||h(t,"Outputs must be supplied as exact Stack section lines\
|
|
543
550
|
."),w(e))return{version:1,targets:[]};let s=[],r=null,i="target",o=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)
|
|
544
|
-
continue;let p=a+1,m=u.match(
|
|
545
|
-
begin with a Target heading.",p);let l=u.match(
|
|
551
|
+
continue;let p=a+1,m=u.match(er);if(m){r&&s.push(on(r,t)),r=or(m,t,p),i="target",o=null;continue}r||h(t,"## Outputs must\
|
|
552
|
+
begin with a Target heading.",p);let l=u.match(tr);if(l){let g={id:Ze(l[1],t,"Parameter id",p),label:v(l[2],T,t,"Parame\
|
|
546
553
|
ter label",p),default:"",description:"",required:!1,seen:new Set};r.parameters.push(g),i="parameter",o=g;continue}if(u===
|
|
547
554
|
"#### Presentation"){r.presentation&&h(t,"Presentation must appear at most once below an output target.",p),r.presentation=
|
|
548
|
-
|
|
549
|
-
y must appear at most once below an output target.",p),r.previewIdentity=
|
|
550
|
-
let f=u.match(
|
|
551
|
-
resentation"?
|
|
555
|
+
ur(p),i="presentation",o=r.presentation;continue}if(u==="#### Preview identity"){r.previewIdentity&&h(t,"Preview identit\
|
|
556
|
+
y must appear at most once below an output target.",p),r.previewIdentity=tn(p),i="previewIdentity",o=r.previewIdentity;continue}
|
|
557
|
+
let f=u.match(nr);if(f){let g=pr(f,t,p);r.downloads.push(g),i="download",o=g;continue}i==="parameter"?ar(o,u,t,p):i==="p\
|
|
558
|
+
resentation"?mr(o,u,t,p):i==="previewIdentity"?nn(o,u,t,p):i==="download"?gr(o,u,t,p):dr(r,u,t,p)}r&&s.push(on(r,t)),s.length===
|
|
552
559
|
0&&h(t,"## Outputs needs at least one Target or exactly `- Nothing.`.");let c=s.map(({id:a})=>a);return new Set(c).size!==
|
|
553
560
|
c.length&&h(t,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(t,"Outputs may declare a\
|
|
554
|
-
t most one default target."),{version:1,targets:s}}function
|
|
561
|
+
t most one default target."),{version:1,targets:s}}function br(e,n={}){let{resourcesPreparing:t=!1}=n,s=e.details||{},r=Array.
|
|
555
562
|
isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:[]).map((c,a)=>Array.isArray(r[a])&&r[a].
|
|
556
563
|
length?r[a].join(" and "):String(c)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!i.length)return e.message;let o=String(
|
|
557
564
|
s.resource||"").trim()||"resources";return t?`Vibe64 is still setting up this app's ${o}. Preview can start when workspa\
|
|
558
565
|
ce setup finishes; then press Check again.`:`This app needs its ${o} before Preview can start: set ${i.join(", or ")} in\
|
|
559
|
-
Env (in Dash, under Development), then press Check again.`}function
|
|
560
|
-
|
|
561
|
-
y"&&(i=
|
|
566
|
+
Env (in Dash, under Development), then press Check again.`}function un({environment:e={},section:n={},resourcesPreparing:t=!1}={}){
|
|
567
|
+
z(n,e,"Outputs section");let s=[...n.diagnostics||[]],r=[...e.diagnostics||[]],i={version:1,targets:[]};n.status==="read\
|
|
568
|
+
y"&&(i=ye(n.lines));let o=r.length===0?null:[...new Set(r.map(p=>br(p,{resourcesPreparing:t})))].join(" "),c=i.targets.map(
|
|
562
569
|
p=>({...p,source:n.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],u="ready";return a.
|
|
563
|
-
length>0?u="blocked":c.length===0&&(u="unconfigured"),{contract:
|
|
564
|
-
[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:
|
|
565
|
-
resources:structuredClone(e.resources||[]),targets:c,diagnostics:a}}var
|
|
566
|
-
t services",
|
|
570
|
+
length>0?u="blocked":c.length===0&&(u="unconfigured"),{contract:Zs,status:u,stackHash:n.stackHash,components:[...n.components||
|
|
571
|
+
[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:F(c.flatMap(p=>p.runtimeRequirements)),
|
|
572
|
+
resources:structuredClone(e.resources||[]),targets:c,diagnostics:a}}var pn="Project services",vr="vibe64.project-services.v1",J="VIBE64_PROJECT_SERVICES_INVALID",Z="genesis/stack.md#Projec\
|
|
573
|
+
t services",wr="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function ln(e){
|
|
567
574
|
if(Array.isArray(e)||d(J,Z,"Expected exact Project services section lines."),w(e))return[];let n=[];for(let[t,s]of e.entries()){
|
|
568
575
|
let r=s.trim();if(!r)continue;let i=t+1,o=r.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
|
|
569
|
-
o||d(J,Z,`Use: ${
|
|
570
|
-
n.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:
|
|
571
|
-
".",J,Z,"Service workdir",i),argv:
|
|
572
|
-
`- Nothing.`."),n}function
|
|
573
|
-
ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?R(n):"",diagnostics:e.diagnostics||[]}}import{access as
|
|
574
|
-
runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",
|
|
575
|
-
d(
|
|
576
|
-
setup must be supplied as exact Stack section
|
|
577
|
-
if(!i)continue;let o=r+1,c=i.match(
|
|
578
|
-
c[
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
576
|
+
o||d(J,Z,`Use: ${wr}`,i),n.some(({id:a})=>a===o[1])&&d(J,Z,"Duplicate project service id.",i);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
|
|
577
|
+
n.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:C(c?c[1]:o[3],J,Z,"Service runtimes",i),workdir:b(c?.[2]||
|
|
578
|
+
".",J,Z,"Service workdir",i),argv:N(o[4],J,Z,"Service command",i)})}return n.length||d(J,Z,"Declare a service or exactly\
|
|
579
|
+
`- Nothing.`."),n}function dn(e={}){let n=e.status==="ready"?ln(e.lines):[];return{contract:vr,status:e.status==="block\
|
|
580
|
+
ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?R(n):"",diagnostics:e.diagnostics||[]}}import{access as Sr}from"node:fs/promises";import hn from"node:path";var Ir="vibe64.workspace-setup.v1",re="Workspace setup",be="VIBE64_WORKSPACE_SETUP_INVALID",mn="- Prepare `label` [from \
|
|
581
|
+
`path`...] with `runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",Tr=/^- Prepare `([^`\r\n]+)` (.+)$/u,
|
|
582
|
+
kr=/^from ((?:`[^`\r\n]+`[ \t]+)+)(with .+)$/u;function Qe(e,n,t,s={}){d(be,e,n,t,s)}function ve(e,n={}){let{path:t="gen\
|
|
583
|
+
esis/stack.md#Workspace setup"}=n;if(Array.isArray(e)||Qe(t,"Workspace setup must be supplied as exact Stack section lin\
|
|
584
|
+
es."),w(e))return[];let s=[];for(let r=0;r<e.length;r+=1){let i=e[r].trim();if(!i)continue;let o=r+1,c=i.match(Tr),a=c?.[2].
|
|
585
|
+
match(kr);(!c||c[2].startsWith("from ")&&!a)&&Qe(t,`Every Workspace setup entry must use: ${mn}`,o,{observed:i}),s.push(
|
|
586
|
+
{label:v(c[1],be,t,"Workspace setup step label",o),...a?{inputs:ce(a[1].trimEnd(),be,t,"Workspace setup inputs",o)}:{},...pe(
|
|
587
|
+
a?a[2]:c[2],be,t,"Workspace setup",o,{form:mn,observed:i})})}return s.length===0&&Qe(t,"## Workspace setup needs at leas\
|
|
588
|
+
t one Prepare entry or exactly `- Nothing.`."),s}async function _r(e,n){try{return await Sr(hn.join(e,n)),!0}catch(t){if([
|
|
589
|
+
"ENOENT","ENOTDIR"].includes(t?.code))return!1;throw t}}async function fn({projectRoot:e,section:n={}}={}){let t=[...n.diagnostics||
|
|
590
|
+
[]],s=[];n.status==="ready"&&(s=ve(n.lines));let r=[],i=[],o=hn.resolve(e);if(t.length===0)for(let l of s){if(!l.condition||
|
|
591
|
+
await _r(o,l.condition.pathExists)){r.push(l);continue}l.condition.onMissing==="wait"&&i.push(l.condition.pathExists)}if(i.
|
|
592
|
+
length>0){let l=F(i);t.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting for project ${l.length===
|
|
593
|
+
1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let c=t.some(({code:l})=>l==="VIBE64_WORKSPACE_SETUP_WAITING"),
|
|
594
|
+
a=t.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),u="unconfigured";a?u="blocked":!c&&r.length>0&&(u="ready");let p=r.
|
|
595
|
+
map(({condition:l,...f})=>f),m={version:1,steps:p};return{contract:Ir,status:u,stackHash:n.stackHash,recipeHash:u==="rea\
|
|
596
|
+
dy"?R(m):"",components:[...n.components||[]],source:n.source||null,runtimeRequirements:F(p.flatMap(l=>l.runtimeRequirements)),
|
|
597
|
+
steps:p,diagnostics:t}}var Or="vibe64.resource-estimates.v1",we="Resource estimates",yn="VIBE64_RESOURCE_ESTIMATES_INVALID",Rr=1024*1024,gn=1024*
|
|
598
|
+
1024,En=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
|
|
599
|
+
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,n,t){d(yn,
|
|
600
|
+
e,n,t)}function et(e,n,t,s,r){let i=e.get(n),o=e.get(t);return(i===void 0||o===void 0||i>o)&&G(s,"Each resource phase re\
|
|
601
|
+
quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function bn(e,n={}){
|
|
593
602
|
let{path:t="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:r=!1}=n;(!Array.isArray(e)||e.length>2048||
|
|
594
603
|
e.some(p=>typeof p!="string")||Buffer.byteLength(e.join(`
|
|
595
604
|
`),"utf8")>64*1024)&&G(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let i={version:1,
|
|
596
605
|
outputs:[],workspaceSetup:null};if(w(e))return i;let o=new Map(s.map(p=>[p.id,p])),c=new Set,a=null;function u(){if(!a)return;
|
|
597
606
|
let{targetId:p,mode:m,fields:l,line:f}=a;if(m==="interactive"){(l.has("typical")||l.has("high"))&&G(t,"Interactive outpu\
|
|
598
|
-
ts require separate Startup and Running estimates.",f),i.outputs.push({targetId:p,mode:m,startup:
|
|
599
|
-
startupHigh",t,f),running:
|
|
600
|
-
G(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",f);let g=
|
|
607
|
+
ts require separate Startup and Running estimates.",f),i.outputs.push({targetId:p,mode:m,startup:et(l,"startupTypical","\
|
|
608
|
+
startupHigh",t,f),running:et(l,"runningTypical","runningHigh",t,f)});return}(l.size!==2||!l.has("typical")||!l.has("high"))&&
|
|
609
|
+
G(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",f);let g=et(l,"typical","high",t,f);p?i.
|
|
601
610
|
outputs.push({targetId:p,mode:m,execution:g}):i.workspaceSetup=g}for(let p=0;p<e.length;p+=1){let m=e[p].trim(),l=p+1;if(!m)
|
|
602
611
|
continue;let f=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(f||m==="### Workspace setup"){u();let P=f?.[1]||
|
|
603
612
|
"",Y=P?`output:${P}`:"workspace-setup";c.has(Y)&&G(t,"Resource estimates contains a duplicate operation.",l),c.add(Y);let Q=o.
|
|
604
613
|
get(P);P&&!["interactive","finite"].includes(Q?.mode)&&G(t,`Resource estimate references an undeclared output: ${P}.`,l),
|
|
605
614
|
!P&&!r&&G(t,"Resource estimate references undeclared Workspace setup steps.",l),a={targetId:P,mode:Q?.mode||"setup",fields:new Map,
|
|
606
|
-
line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),S=g&&
|
|
607
|
-
or Workspace setup heading followed by positive integer MiB estimates: ${[...
|
|
615
|
+
line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),S=g&&En.get(g[1]);(!a||!S)&&G(t,`Expected an Output\
|
|
616
|
+
or Workspace setup heading followed by positive integer MiB estimates: ${[...En.keys()].map(P=>`- ${P}: \`number\``).join(
|
|
608
617
|
"; ")}.`,l),a.fields.has(S)&&G(t,`Duplicate resource field: ${g[1]}.`,l);let _=Number(g[2]);(!Number.isSafeInteger(_)||_>
|
|
609
|
-
|
|
610
|
-
rce estimates needs an operation or exactly `- Nothing.`."),i}function
|
|
611
|
-
|
|
612
|
-
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=
|
|
613
|
-
y"?
|
|
614
|
-
kOperationError")throw o;s.push({code:
|
|
615
|
-
nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:
|
|
618
|
+
gn)&&G(t,`Resource estimates must be between 1 and ${gn} MiB.`,l),a.fields.set(S,_*Rr)}return u(),c.size===0&&G(t,"Resou\
|
|
619
|
+
rce estimates needs an operation or exactly `- Nothing.`."),i}function Se({section:e={},outputsSection:n={},workspaceSetupSection:t={}}={}){
|
|
620
|
+
z(e,n,"Resource estimates and Outputs"),z(e,t,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={
|
|
621
|
+
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=bn(e.lines,{targets:n.status==="read\
|
|
622
|
+
y"?ye(n.lines).targets:[],hasWorkspaceSetup:t.status==="ready"&&ve(t.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
|
|
623
|
+
kOperationError")throw o;s.push({code:yn,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"i\
|
|
624
|
+
nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:Or,status:i,stackHash:e.stackHash,sectionHash:e.
|
|
616
625
|
sectionHash||"",estimatesHash:i==="ready"?R(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
|
|
617
|
-
fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var
|
|
618
|
-
ntime` in `workdir`: `command` `argument`...";function
|
|
626
|
+
fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var Ar="vibe64.integration-setup.v1",vn="Integration setup",ie="VIBE64_INTEGRATION_SETUP_INVALID",Nr="- Command with `ru\
|
|
627
|
+
ntime` in `workdir`: `command` `argument`...";function wn(e,n={}){let{path:t="genesis/stack.md#Integration setup"}=n;if(Array.
|
|
619
628
|
isArray(e)||d(ie,t,"Integration setup requires exact Stack section lines."),w(e))return null;let s=e.map(i=>i.trim()).filter(
|
|
620
629
|
Boolean),r=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return r||d(ie,t,`Integration setu\
|
|
621
|
-
p requires exactly one entry: ${
|
|
622
|
-
"Integration setup workdir"),runtimeRequirements:
|
|
623
|
-
let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?
|
|
630
|
+
p requires exactly one entry: ${Nr}; or - Nothing.`),{argv:N(r[3],ie,t,"Integration setup command"),workdir:b(r[2],ie,t,
|
|
631
|
+
"Integration setup workdir"),runtimeRequirements:C(r[1],ie,t,"Integration setup runtimes")}}function Sn({section:e={}}={}){
|
|
632
|
+
let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?wn(e.lines):null;return{contract:Ar,status:n.length?"blo\
|
|
624
633
|
cked":t?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:t?R({version:1,command:t}):"",source:e.source||null,components:[
|
|
625
|
-
...e.components||[]],command:t,diagnostics:n}}var
|
|
626
|
-
"Genesis host context requires an absolute runtime root.");let n=B.join(e,"genesis-context");if(!
|
|
627
|
-
catch(s=>{throw
|
|
628
|
-
HOST_CONTEXT_RESOLVER_ENV
|
|
629
|
-
inspectDerivedArtifacts:
|
|
630
|
-
inspectSkills:
|
|
631
|
-
setCollaboration:
|
|
632
|
-
sourceExplanationGuidance:
|
|
633
|
-
CALL_WEB_SCHEMA:
|
|
634
|
-
e);return{[
|
|
635
|
-
/blueprint.md",
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
pass","work"]),
|
|
639
|
-
|
|
640
|
-
s]).finally(()=>clearTimeout(t))}function
|
|
641
|
-
s?`Unknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an
|
|
642
|
-
e.genesisTask)||"work"}function
|
|
643
|
-
map(x).find(Boolean)||"Continue the requested project work."}function
|
|
644
|
-
[]).find(n=>
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
let{prompt:t=!1}=n;return{...e,...t?{hiddenStackPieces:
|
|
649
|
-
|
|
650
|
-
return
|
|
651
|
-
return
|
|
652
|
-
`Genesis returned ${e?.contract||"no contract identity"}
|
|
653
|
-
e.artifacts:[];if(!n.length||n.some(t=>!x(t?.path)))
|
|
654
|
-
|
|
655
|
-
artifacts.map(e=>[e.id,e])),
|
|
656
|
-
"Genesis did not declare both City projection artifacts.");var
|
|
657
|
-
|
|
658
|
-
throw new TypeError("Genesis operations require an explicit absolute
|
|
659
|
-
function
|
|
660
|
-
" ").slice(0,300)||"no reason given"}). Work from the repository
|
|
661
|
-
|
|
662
|
-
workdir:e,promptContext:n},{onGenesisUnavailable:t=
|
|
663
|
-
let i;try{let o=await
|
|
664
|
-
output=="string"&&o.output.trim())return o.output;i=new Error("Genesis returned no
|
|
665
|
-
i),`${
|
|
634
|
+
...e.components||[]],command:t,diagnostics:n}}var Cr=new URL("./index.js",import.meta.url).href,kn=Dr(Cr),Ie=new Map;async function $r(e){if(!B.isAbsolute(e||""))throw new TypeError(
|
|
635
|
+
"Genesis host context requires an absolute runtime root.");let n=B.join(e,"genesis-context");if(!Ie.has(n)){let t=Ct(n).
|
|
636
|
+
catch(s=>{throw Ie.delete(n),s});Ie.set(n,t)}return Ie.get(n)}var{GENESIS_CONTRACTS:A,HOST_CONTEXT_RESOLVER_DATA_ENV:Vr,
|
|
637
|
+
HOST_CONTEXT_RESOLVER_ENV:xr,addStack:jr,applyTemplate:Lr,generatePrompt:Mr,indexCodebase:Gr,initialize:Ur,inspectCollaboration:Br,
|
|
638
|
+
inspectDerivedArtifacts:Wr,inspectEngineering:Hr,inspectEnvironment:Te,inspectPasses:zr,inspectProject:Fr,inspectProjectFormat:qr,
|
|
639
|
+
inspectAgentIntegrations:Kr,inspectSkills:Yr,inspectStackSection:Xr,inspectStackSections:Jr,inspectSubsystems:Zr,listTemplates:Qr,
|
|
640
|
+
parserEnvironment:jo,setCollaboration:ei,setEngineeringProfile:ti,syncAgentIntegrations:ni,syncSkills:si,withTrustedGitRepository:ri,
|
|
641
|
+
SOURCE_EXPLANATION_PROMPT_VERSION:Lo,sourceExplanationGuidance:Mo,validateArchitectureFacts:Go,mergeArchitectureObservations:Uo,
|
|
642
|
+
validateCityDocument:Bo,validateCallWeb:Wo,CALL_WEB_SCHEMA:Ho,MACHINE_CITY_SCHEMA:zo,PROGRAM_CITY_SCHEMA:Fo,CITY_SCHEMA_VERSION:qo}=oe;
|
|
643
|
+
async function Ko(e){let n=await $r(e);return{[xr]:li(),[Vr]:JSON.stringify({registryPath:n.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"\
|
|
644
|
+
0"}}var Yo="genesis/blueprint.md",Xo="genesis/subsystems.md",ii=Object.freeze(["vue","django-postgresql","jskit-postgres\
|
|
645
|
+
ql","postgresql","rails-postgresql","spring-boot-postgresql"]),oi=Object.freeze(["genesis-stack"]),Tn=Object.freeze({BLUEPRINT_INVALID:"\
|
|
646
|
+
blueprint",BLUEPRINT_REQUIRED:"start"}),_n=new Set(["adopt","blueprint","data-pass","describe","deslop","identity-pass",
|
|
647
|
+
"program","quality-pass","review","start","ui-pass","work"]),tt=15e3;function nt(e,n=tt){let t,s=new Promise((r,i)=>{t=setTimeout(
|
|
648
|
+
()=>i(Object.assign(new Error(`Genesis did not answer within ${n} ms.`),{code:"vibe64_genesis_timeout"})),n)});return Promise.
|
|
649
|
+
race([Promise.resolve().then(e),s]).finally(()=>clearTimeout(t))}function ai(e,n={}){let{required:t=!1}=n,s=x(e);if(!s&&
|
|
650
|
+
!t)return"";if(!_n.has(s))throw new TypeError(s?`Unknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an \
|
|
651
|
+
explicit task.");return s}function ci(e={}){return ai(e.genesisTask)||"work"}function ui(e={},n={}){return[e.conversationRequest,
|
|
652
|
+
e.feedback,e.request,e.plan,e.description,n.label].map(x).find(Boolean)||"Continue the requested project work."}function pi(){
|
|
653
|
+
let e=(kn.resolve.paths("genesis-compiler")||[]).find(n=>In(B.join(n,"genesis-compiler"))&&In(B.join(n,".bin","genesis")));
|
|
654
|
+
if(!e)throw new Error("The installed Genesis compiler executable could not be located.");return B.join(e,".bin")}function On(){
|
|
655
|
+
let e=kn.resolve("@local/vibe64-genesis/server");return B.resolve(B.dirname(e),"../../bin")}function li(){return B.resolve(
|
|
656
|
+
On(),"vibe64-genesis-host-context")}function Jo(e=[]){let n=On(),t=pi();return[...(Array.isArray(e)?e:[]).filter(r=>![n,
|
|
657
|
+
t].includes(x(r))),n]}function di(e={},n={}){let{prompt:t=!1}=n;return{...e,...t?{hiddenStackPieces:ii}:{},stackPackages:oi}}
|
|
658
|
+
function Zo(e={}){return W(jr,e)}function Qo(e={}){return W(Ur,e)}function ea(e={}){return te(Yr,e)}function ta(e={}){return W(
|
|
659
|
+
si,e)}function na(e={}){return W(ni,e)}function sa(e={}){return te(Kr,e)}function ra(e={}){return te(Zr,e)}async function ia(e={}){
|
|
660
|
+
return wt(await K(gt,e))}async function oa(e={}){return Tt(await K(St,e))}function aa(e={}){return W(Gr,e)}function mi(){
|
|
661
|
+
let e=Wr();if(e?.contract!==A.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||"no contract identity"};\
|
|
662
|
+
expected ${A.derivedArtifacts}.`);let n=Array.isArray(e.artifacts)?e.artifacts:[];if(!n.length||n.some(t=>!x(t?.path)))
|
|
663
|
+
throw new Error("Genesis returned an invalid derived-artifact contract.");return{...e,artifacts:n.map(t=>({...t}))}}var Rn=mi(),
|
|
664
|
+
ca=Object.freeze(Rn.artifacts.map(e=>e.path)),st=new Map(Rn.artifacts.map(e=>[e.id,e])),hi=st.get("machine-city")?.path,
|
|
665
|
+
fi=st.get("program-city")?.path;if(!hi||!fi)throw new Error("Genesis did not declare both City projection artifacts.");var gi=st.
|
|
666
|
+
get("call-web")?.path;if(!gi)throw new Error("Genesis did not declare its call-web artifact.");async function W(e,n={},t={}){
|
|
667
|
+
let s=x(n.projectRoot);if(!s||!B.isAbsolute(s))throw new TypeError("Genesis operations require an explicit absolute proj\
|
|
668
|
+
ectRoot.");return ri(s,()=>e(di(n,t)))}function An(){}function Ei(e){return`Genesis project guidance is unavailable for \
|
|
669
|
+
this conversation (${x(e?.message||e).replace(/\s+/gu," ").slice(0,300)||"no reason given"}). Work from the repository i\
|
|
670
|
+
tself, where the genesis/ files still describe the project when present, and tell the user that Genesis guidance did not\
|
|
671
|
+
load if it matters to the request.`}async function ua({workdir:e,promptContext:n},{onGenesisUnavailable:t=An,timeoutMs:s=tt}={}){
|
|
672
|
+
let r=ee(n);if(n.scope==="ephemeral")return r;let i;try{let o=await nt(()=>W(oe.projectSessionContext,{projectRoot:e,hostDriver:ee,
|
|
673
|
+
hostDriverInput:n}),s);if(typeof o?.output=="string"&&o.output.trim())return o.output;i=new Error("Genesis returned no s\
|
|
674
|
+
ession guidance.")}catch(o){i=o}return t(i),`${Ei(i)}
|
|
666
675
|
|
|
667
|
-
${r}`}function te(e,n={}){return
|
|
668
|
-
contract||"no contract identity"}; expected ${n}.`);return e}async function
|
|
669
|
-
return
|
|
670
|
-
s=>
|
|
671
|
-
e[r]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return t}async function
|
|
676
|
+
${r}`}function te(e,n={}){return nt(()=>W(e,n))}function Nn(e,n){if(e?.contract!==n)throw new Error(`Genesis returned ${e?.
|
|
677
|
+
contract||"no contract identity"}; expected ${n}.`);return e}async function H(e,n,t={}){return Nn(await te(e,t),n)}async function rt(e,n,t={}){
|
|
678
|
+
return Nn(await W(e,t),n)}function K(e,n={}){return H(t=>Xr({...t,name:e}),A.stackSection,n)}async function it(e,n={}){let t=await te(
|
|
679
|
+
s=>Jr({...s,names:e}),n);if(!Array.isArray(t)||t.length!==e.length||t.some((s,r)=>s?.contract!==A.stackSection||s.name!==
|
|
680
|
+
e[r]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return t}async function pa(e={}){if((await yi(
|
|
672
681
|
e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its Stack can be\
|
|
673
|
-
inspected."),{code:"vibe64_stack_format_required"});await
|
|
674
|
-
components:t.components,stackHash:t.stackHash}}async function
|
|
675
|
-
e)]);return
|
|
676
|
-
e)]);return
|
|
677
|
-
e)}function
|
|
678
|
-
|
|
679
|
-
e)}async function
|
|
680
|
-
|
|
681
|
-
e)}async function
|
|
682
|
-
n)]);return{...
|
|
683
|
-
workspaceSetupSection:r})}}async function
|
|
684
|
-
await K(
|
|
685
|
-
return{...await
|
|
686
|
-
async function
|
|
687
|
-
async function
|
|
688
|
-
e),c=
|
|
689
|
-
try{return{result:await a(o),task:o}}catch(g){let S=Object.hasOwn(
|
|
690
|
-
!0)throw g;return{result:await a(S),task:S}}},p;try{if(p=await
|
|
691
|
-
trim())throw new Error("Genesis returned no prompt.")}catch(g){return s(g),{prompt:c}}
|
|
692
|
-
m.task))?x(m.task):l;return{context:{genesis:!0,requestedTask:o,task:f,verificationCommands:m.
|
|
693
|
-
warnings},originalPrompt:c,prompt:m.prompt,promptId:x(e.promptId||e.id)||f}}export{
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
682
|
+
inspected."),{code:"vibe64_stack_format_required"});await Pr(B.join(e.projectRoot,De),"utf8");let t=await K(re,e);return{
|
|
683
|
+
components:t.components,stackHash:t.stackHash}}async function la(e={}){let[n,t]=await Promise.all([K(Dt,e),H(Te,A.environment,
|
|
684
|
+
e)]);return Lt({environment:t,section:n})}async function da(e={}){let[n,t]=await Promise.all([K(Ht,e),H(Te,A.environment,
|
|
685
|
+
e)]);return Yt({environment:t,section:n})}function ma(e={}){return W(oe.verify,e)}function ha(e={}){return H(Te,A.environment,
|
|
686
|
+
e)}function fa(e={}){return H(Fr,A.projectInspection,e)}function ga(e={}){return H(Qr,A.templates,e)}function Ea(e={}){return rt(
|
|
687
|
+
Lr,A.templateApplication,e)}function ya(e={}){return H(Hr,A.engineering,e)}function ba(e={}){return H(Br,A.collaboration,
|
|
688
|
+
e)}async function va(e){return(await H(zr,A.passes,e)).passes}async function yi(e={}){let n=await te(qr,e);if(!x(n?.status))
|
|
689
|
+
throw new Error("Genesis did not return a project-format status.");return{...n}}function wa(e={}){return rt(ti,A.engineering,
|
|
690
|
+
e)}function Sa(e={}){return rt(ei,A.collaboration,e)}async function Ia({resourcesPreparing:e=!1,...n}={}){let[[t,s,r],i]=await Promise.
|
|
691
|
+
all([it([ge,we,re],n),H(Te,A.environment,n)]);return{...un({environment:i,section:t,resourcesPreparing:e===!0}),resourceEstimates:Se(
|
|
692
|
+
{section:s,outputsSection:t,workspaceSetupSection:r})}}async function Ta(e={}){let n=await K(vn,e);return Sn({section:n})}
|
|
693
|
+
async function ka(e={}){return dt(await K(pt,e))}async function _a(e={}){return dn(await K(pn,e))}async function Oa(e={}){
|
|
694
|
+
let[n,t,s]=await it([re,we,ge],e);return{...await fn({projectRoot:e.projectRoot,section:n}),resourceEstimates:Se({section:t,
|
|
695
|
+
outputsSection:s,workspaceSetupSection:n})}}async function Ra(e={}){let[n,t,s]=await it([we,ge,re],e);return Se({section:n,
|
|
696
|
+
outputsSection:t,workspaceSetupSection:s})}async function Aa({action:e={},environment:n,input:t={},onGenesisUnavailable:s=An,
|
|
697
|
+
projectRoot:r,timeoutMs:i=tt}){let o=ci(e),c=ui(t,e),a=g=>W(Mr,{environment:n,projectRoot:r,request:c,sessionContextInstalled:!0,
|
|
698
|
+
task:g},{prompt:!0}),u=async()=>{try{return{result:await a(o),task:o}}catch(g){let S=Object.hasOwn(Tn,String(g?.code))?Tn[g.
|
|
699
|
+
code]:"";if(!S||S===o||t.automaticGenesisTask===!0)throw g;return{result:await a(S),task:S}}},p;try{if(p=await nt(u,i),typeof p.
|
|
700
|
+
result?.prompt!="string"||!p.result.prompt.trim())throw new Error("Genesis returned no prompt.")}catch(g){return s(g),{prompt:c}}
|
|
701
|
+
let{result:m,task:l}=p,f=_n.has(x(m.task))?x(m.task):l;return{context:{genesis:!0,requestedTask:o,task:f,verificationCommands:m.
|
|
702
|
+
verificationCommands,warnings:m.warnings},originalPrompt:c,prompt:m.prompt,promptId:x(e.promptId||e.id)||f}}export{Ho as CALL_WEB_SCHEMA,qo as CITY_SCHEMA_VERSION,Yo as GENESIS_BLUEPRINT_PATH,gi as GENESIS_CALL_WEB_PATH,ca as GENESIS_DERIVED_ARTIFACT_PATHS,
|
|
703
|
+
hi as GENESIS_MACHINE_CITY_PATH,fi as GENESIS_PROGRAM_CITY_PATH,De as GENESIS_STACK_PATH,kt as GENESIS_STACK_SECTION_AMBIGUOUS,
|
|
704
|
+
Xo as GENESIS_SUBSYSTEMS_PATH,tt as GENESIS_USER_PATH_TIMEOUT_MS,zo as MACHINE_CITY_SCHEMA,Fo as PROGRAM_CITY_SCHEMA,Lo as SOURCE_EXPLANATION_PROMPT_VERSION,
|
|
705
|
+
Pt as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,me as VIBE64_PACKAGING_CONTRACT,se as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,
|
|
706
|
+
Zo as addGenesisStack,Ea as applyGenesisTemplate,ai as assertGenesisPromptTask,On as genesisCommandShimDirectory,pi as genesisPackageBinDirectory,
|
|
707
|
+
jo as genesisParserEnvironment,os as genesisProjectContractNeedsAttention,us as genesisProjectFileDiagnostic,cs as genesisProjectFileUnreadable,
|
|
708
|
+
ui as genesisPromptRequest,ci as genesisPromptTask,Qo as initializeGenesisProject,sa as inspectGenesisAgentIntegrations,
|
|
709
|
+
ba as inspectGenesisCollaboration,mi as inspectGenesisDerivedArtifacts,ya as inspectGenesisEngineering,ha as inspectGenesisEnvironment,
|
|
710
|
+
fa as inspectGenesisProject,yi as inspectGenesisProjectFormat,ea as inspectGenesisSkills,pa as inspectGenesisStackComponents,
|
|
711
|
+
ra as inspectGenesisSubsystems,ia as inspectVibe64ArchitectureInspection,oa as inspectVibe64ArchitectureLayout,ka as inspectVibe64ConnectedDevelopment,
|
|
712
|
+
la as inspectVibe64Deployment,Ta as inspectVibe64IntegrationSetup,Ia as inspectVibe64Outputs,da as inspectVibe64Packaging,
|
|
713
|
+
_a as inspectVibe64ProjectServices,Ra as inspectVibe64ResourceEstimates,Oa as inspectVibe64WorkspaceSetup,va as listGenesisPasses,
|
|
714
|
+
ga as listGenesisTemplates,Uo as mergeArchitectureObservations,jt as parseVibe64DeploymentLines,wn as parseVibe64IntegrationSetupLines,
|
|
715
|
+
ye as parseVibe64OutputsLines,qt as parseVibe64PackagingLines,ln as parseVibe64ProjectServicesLines,bn as parseVibe64ResourceEstimatesLines,
|
|
716
|
+
ve as parseVibe64WorkspaceSetupLines,ns as readArchitecturePreviewLocator,aa as refreshGenesisCities,Aa as renderGenesisPrompt,
|
|
717
|
+
cr as resolveVibe64OutputParameters,Kt as resolveVibe64PackagingEnvironment,Sa as setGenesisCollaboration,wa as setGenesisEngineeringProfile,
|
|
718
|
+
Mo as sourceExplanationGuidance,na as syncGenesisAgentIntegrations,ta as syncGenesisSkills,Go as validateArchitectureFacts,
|
|
719
|
+
Wo as validateCallWeb,Bo as validateCityDocument,ma as verifyGenesisProject,ua as vibe64ConversationInstructions,ee as vibe64Driver,
|
|
720
|
+
Ko as vibe64HostContextEnvironment,$r as vibe64HostContextRegistry,li as vibe64HostContextResolverPath,Jo as withGenesisCommandShim,
|
|
721
|
+
nt as withinGenesisDeadline};
|