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