vibe64 0.1.59 → 0.1.61
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 +1228 -1210
- package/bin/server.js +392 -376
- package/bin/upgrade-state.js +4457 -4430
- package/dist/assets/{GithubBrowserTabs-D_nMB5Y1.js → GithubBrowserTabs-DAgQxPXI.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-BgO_aeUg.js → LocalDatabaseServer-m1G8ZS5i.js} +1 -1
- package/dist/assets/SelectField-DwWoHC2p.js +1 -0
- package/dist/assets/{ShellOutlet-Cr8SJs7s.js → ShellOutlet-CdjsJfg9.js} +1 -1
- package/dist/assets/Vibe64AuthSettingsButton-D3sB4BfM.js +5 -0
- package/dist/assets/{Vibe64AuthSettingsButton-DRTKdimW.css → Vibe64AuthSettingsButton-DFfFPrd7.css} +1 -1
- package/dist/assets/{Vibe64ConversationLog-DtOgxPNR.js → Vibe64ConversationLog-B-L5QsVr.js} +4 -4
- package/dist/assets/{Vibe64ConversationLog-NH61odld.css → Vibe64ConversationLog-ksf1U6PP.css} +1 -1
- package/dist/assets/{Vibe64DashboardShell-DhPE6H3P.js → Vibe64DashboardShell-CMzX3wRM.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-Dewhs6_T.js} +2 -2
- package/dist/assets/Vibe64DestinationButton-CdyyK9tj.js +1 -0
- package/dist/assets/Vibe64DestinationButton-ZxY1Lwie.css +1 -0
- package/dist/assets/Vibe64FileArea-DluZTu-c.js +1 -0
- package/dist/assets/{Vibe64FileArea-mydNQQl8.css → Vibe64FileArea-ZEzsvLt2.css} +1 -1
- package/dist/assets/Vibe64OutputControls-BfbdD25Y.js +8 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-DUSMn4pR.js → Vibe64RepositoryWorkspace-CBsySPXN.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-BXt__PJL.js → Vibe64SessionFiles--wtVe_KC.js} +1 -1
- package/dist/assets/{Vibe64SessionSourceEditor-NyG6niQM.js → Vibe64SessionSourceEditor-BouH4fXC.js} +1 -1
- package/dist/assets/Vibe64UiStoryboardView--E04EEF8.js +8 -0
- package/dist/assets/{Vibe64UiStoryboardView-CtlJWiCY.css → Vibe64UiStoryboardView-DqLN6ofL.css} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-CCPWJo8e.js → Vibe64UnavailableSessions-94bFpxMK.js} +1 -1
- package/dist/assets/_pageId_-Ch4OpUkd.js +1 -0
- package/dist/assets/_sessionId_-7PyIUeUr.css +1 -0
- package/dist/assets/_sessionId_-DGT4d2La.js +1 -0
- package/dist/assets/{_sessionTool_-CKPNp5fF.js → _sessionTool_-CBf51mfK.js} +1 -1
- package/dist/assets/_sessionTool_-DiYoi-BF.css +1 -0
- package/dist/assets/_slug_-C8VNMRVH.js +14 -0
- package/dist/assets/_slug_-CZmGS16g.css +1 -0
- package/dist/assets/access-BAOx4iCS.js +1 -0
- package/dist/assets/access-BH1OsqPS.css +1 -0
- package/dist/assets/{app-D9FegZf0.js → app-Bs6-Hv23.js} +1 -1
- package/dist/assets/{assistantRouting-D4SnnxJn.js → assistantRouting-BS0ZW5Ki.js} +1 -1
- package/dist/assets/{changes-DtfJc780.js → changes-C6eMQ9YE.js} +1 -1
- package/dist/assets/{client-CUQfIUus.css → client-BBJzQIWS.css} +1 -1
- package/dist/assets/{client-BBqNv4HL.js → client-CIF5Y1Aj.js} +1 -1
- package/dist/assets/{client-B8u2_Svv.css → client-CM6TGZc9.css} +1 -1
- package/dist/assets/{client-DnjkdG6K.js → client-CVgL_ShV.js} +1 -1
- package/dist/assets/{client-DuDOzb5A.js → client-HWj_BNVZ.js} +2 -2
- package/dist/assets/{client-Dra4Vp3A.js → client-qAKnahkF.js} +2 -2
- package/dist/assets/{client-mU-LObHG.js → client-qpL_kR4u.js} +2 -2
- package/dist/assets/{conversation-QpMeXw70.js → conversation-DbF0OrZB.js} +3 -3
- package/dist/assets/{conversation-La-pkh5h.css → conversation-ZN3-8jbz.css} +1 -1
- package/dist/assets/{dashboard-B26QwE6y.js → dashboard-CzLsa0w0.js} +1 -1
- package/dist/assets/{english-definitions-I9tIXY2u.js → english-definitions-BA8v5wP1.js} +1 -1
- package/dist/assets/{env-BXsvM592.js → env-BqJ_GWbz.js} +1 -1
- package/dist/assets/{error-kdRkyK9x.js → error-BQ7r64JO.js} +1 -1
- package/dist/assets/{error-CX8_snYL.js → error-BqMxhgpB.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-CIqrHpVK.js} +1 -1
- package/dist/assets/history-BCjhpyP8.js +1 -0
- package/dist/assets/history-BSIuLgnI.css +1 -0
- package/dist/assets/{httpClient-BRO3GqjU.js → httpClient-Bwitq9Xf.js} +1 -1
- package/dist/assets/i18n-BkxO7BMl.js +1 -0
- package/dist/assets/{i18n-B5lc019_.js → i18n-Dm74yE_M.js} +1 -1
- package/dist/assets/index-Ctygjyf8.css +1 -0
- package/dist/assets/index-fXKdz8oR.js +134 -0
- package/dist/assets/{integrations-CrI893NK.css → integrations-CwgrZgmM.css} +1 -1
- package/dist/assets/{integrations-CQNJxkMu.js → integrations-cgbpgNNd.js} +12 -5
- package/dist/assets/issues-AhouA6nE.js +1 -0
- package/dist/assets/issues-D46llNv-.css +1 -0
- package/dist/assets/{learning-0cINHUSN.js → learning-DZXWgVEW.js} +1 -1
- package/dist/assets/{pages-DbF-yXqO.js → pages-5jaEclQo.js} +1 -1
- package/dist/assets/{pages-CIKw99GN.js → pages-BUUwIXBf.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-BS2gdDSz.js} +1 -1
- package/dist/assets/publish-Bq_LPmX2.js +3 -0
- package/dist/assets/{publish-DOybV3Qz.css → publish-C9O0tDPB.css} +1 -1
- package/dist/assets/pull-requests-BvChbjCD.js +1 -0
- package/dist/assets/pull-requests-DtqrTix0.css +1 -0
- package/dist/assets/{repository-wJZei_NJ.js → repository-Dkow-18G.js} +1 -1
- package/dist/assets/settings-BKZcbISO.css +1 -0
- package/dist/assets/settings-r5RWQVzw.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-C0MVJuyX.js +1 -0
- package/dist/assets/useAssistantAttachments-BkYZckgz.js +2 -0
- package/dist/assets/useCommand-CNDe8gM-.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-CWb6o71Z.js} +1 -1
- package/dist/assets/useVibe64ConversationLog-CUWEZhnf.js +2 -0
- package/dist/assets/{useVibe64Learning-DZCyrfpy.js → useVibe64Learning-RE4HXHqo.js} +1 -1
- package/dist/assets/{useVibe64SessionData-rBvWMqyc.js → useVibe64SessionData-kGr7R7lG.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-C546mBu8.js → useVibe64SessionSelection-BZ7WnRv0.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-R5QhcJ4H.js +1 -0
- package/dist/assets/vibe64SessionFocus-BCojr4E-.css +1 -0
- package/dist/assets/vibe64SessionFocus-CHKCMxcJ.js +1 -0
- package/dist/index.html +29 -27
- package/docs/colleague-usage/ai-tasks.md +15 -4
- package/docs/colleague-usage/back-navigation.md +16 -13
- package/docs/colleague-usage/coding-agent-goal-pause.md +15 -1
- package/docs/colleague-usage/coding-agent-goals.md +23 -3
- package/docs/colleague-usage/coding-agent-recovery.md +3 -1
- package/docs/colleague-usage/coding-agents.md +19 -1
- package/docs/colleague-usage/colleague-watches.md +1 -1
- package/docs/colleague-usage/connected-projects.md +1 -1
- package/docs/colleague-usage/connected-repositories.md +16 -4
- package/docs/colleague-usage/dashboard-navigation.md +14 -11
- package/docs/colleague-usage/database.md +1 -1
- package/docs/colleague-usage/development-env.md +21 -12
- package/docs/colleague-usage/files.md +2 -1
- package/docs/colleague-usage/github-work.md +51 -12
- package/docs/colleague-usage/health-checks.md +1 -1
- package/docs/colleague-usage/integrations.md +2 -2
- package/docs/colleague-usage/learning-teacher-guide.md +3 -2
- package/docs/colleague-usage/pages.md +1 -2
- 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 +4 -3
- package/docs/colleague-usage/project-settings.md +3 -0
- package/docs/colleague-usage/session-archive.md +11 -0
- package/docs/colleague-usage/sessions.md +8 -7
- package/docs/colleague-usage/temporary-chats.md +4 -3
- package/docs/colleague-usage/ui-pass.md +1 -1
- 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/locales/en.json +4 -1
- 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/CHANGELOG.md +4 -0
- package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +2 -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 +8 -0
- package/node_modules/@jskit-ai/kernel/package.json +3 -1
- package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/payments-core/locales/en.json +2 -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-ai-tasks/package.json +2 -1
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +463 -442
- package/node_modules/@local/vibe64-genesis/bin/genesis +17 -11
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +827 -813
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +93 -67
- package/node_modules/@local/vibe64-genesis/src/server/index.js +608 -584
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +180 -175
- 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 +1026 -981
- 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 +43244 -42953
- 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/_pageId_-D54CqzqG.js +0 -1
- package/dist/assets/_sessionId_-B5V2Fs2n.css +0 -1
- package/dist/assets/_sessionId_-CW044RVi.js +0 -1
- package/dist/assets/_sessionTool_-Be88HWbv.css +0 -1
- package/dist/assets/_slug_-CRtFhc0A.js +0 -14
- package/dist/assets/_slug_-WWvJTLoc.css +0 -1
- 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/pull-requests-DnEm9m_1.css +0 -1
- package/dist/assets/pull-requests-ybnixBv0.js +0 -1
- 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/useAssistantAttachments-CkseokGM.js +0 -2
- 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 Cn}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)}},it=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
|
|
10
|
-
void 0?{}:{line:s},...r})}function
|
|
11
|
-
must be one non-empty line.`,r),e.trim()}function
|
|
12
|
-
0||n.map(t=>t[0]).join(" ")!==e?null:n.map(t=>t[1])}function I(e,n,t,s,r,i={}){let{count:o,maximum:
|
|
13
|
-
a.length>
|
|
14
|
-
y":`exactly ${o}`;d(n,t,`${s} must contain ${
|
|
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
|
|
19
|
-
lative path.`,r),e}function
|
|
7
|
+
architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),Pn=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
|
|
8
|
+
function Dn(e,n){let t=it[e],s=String(n).replace(Pn,"");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,Dn(e,t),{path:n,...s===
|
|
10
|
+
void 0?{}:{line:s},...r})}function v(e,n,t,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&d(n,t,`${s} \
|
|
11
|
+
must be one non-empty line.`,r),e.trim()}function $n(e){let n=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return n.length===
|
|
12
|
+
0||n.map(t=>t[0]).join(" ")!==e?null:n.map(t=>t[1])}function I(e,n,t,s,r,i={}){let{count:o,maximum:c=64}=i,a=$n(e);if(!a||
|
|
13
|
+
a.length>c||o!==void 0&&a.length!==o||a.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=o===void 0?"separate non-empt\
|
|
14
|
+
y":`exactly ${o}`;d(n,t,`${s} must contain ${u} backticked ${o===1?"value":"values"}.`,r)}return a}function Vn(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=I(
|
|
16
|
+
e,n,t,s,r);return Vn(i[0])||d(n,t,`${s} must begin with a safe executable.`,r),i}function xn(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 b(e,n,t,s,r,i={}){let{allowRoot:o=!0}=i;return(!xn(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=I(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=v(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=
|
|
29
|
-
argv:
|
|
30
|
-
orkdir`,r),...m?{condition:{pathExists:
|
|
31
|
-
return Array.isArray(e)?e.map(
|
|
32
|
-
function
|
|
33
|
-
`;return`sha256:${
|
|
34
|
-
throw new
|
|
35
|
-
return[...new Set(e)].sort()}function
|
|
36
|
-
thing."}var
|
|
25
|
+
be from 200 through 399.`,r),{kind:"http",method:"GET",path:_e(i[1],n,t,`${s} path`,r),status:o}}var jn=/^with (.+?):[ \t]+(.+)$/u,
|
|
26
|
+
Ln=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,Mn=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Gn=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
|
|
27
|
+
function ue(e,n,t,s,r,{form:i,observed:o=e}){let c=String(e||"").match(jn);c||d(n,t,`Every ${s} entry must use: ${i}`,r,
|
|
28
|
+
{observed:o});let a=c[1].match(Ln),u=a?null:c[1].match(Mn),p=a?a[1]:u?u[1]:c[1],m=a?.[2]||u?.[2]||"",l=p.match(Gn);return{
|
|
29
|
+
argv:A(c[2],n,t,`${s} command`,r),runtimeRequirements:N(l?l[1]:p,n,t,`${s} runtimes`,r),workdir:b(l?l[2]:".",n,t,`${s} w\
|
|
30
|
+
orkdir`,r),...m?{condition:{pathExists:b(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:${Cn("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
|
+
return[...new Set(e)].sort()}function w(e=[]){let n=e.map(t=>t.trim()).filter(Boolean);return n.length===1&&n[0]==="- No\
|
|
36
|
+
thing."}var yi=Object.freeze({SPEC_BY_ERROR_CODE:it});var Un="custom";var Bn=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
|
-
|
|
45
|
-
[]],o=e.status==="ready";if(o&&!
|
|
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,
|
|
56
|
-
file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let
|
|
57
|
-
"blocked":r.length||s?"ready":"unconfigured";return{contract:
|
|
58
|
-
"ready"?
|
|
40
|
+
freeze({value:Un,label:"custom"})]);var ot=Object.freeze(Bn.map(e=>e.value));function at(e){return typeof e=="string"&&ot.includes(e)}function ct(e="or"){let n=ot;return`${n.slice(0,-1).join(", ")} ${e} ${n.at(-1)}`}var ut="Connected development",Wn="vibe64.connected-development.v1",$="VIBE64_CONNECTED_DEVELOPMENT_INVALID",V="genesis/\
|
|
41
|
+
stack.md#Connected development",Oe="with `runtime` [in `workdir`]: `command` `argument`...",pt=Object.freeze({Prepare:`-\
|
|
42
|
+
Prepare \`label\` ${Oe}`,Verify:`- Verify \`label\` ${Oe}`,"Custom runner":`- Custom runner ${Oe}`}),Hn=Object.freeze([
|
|
43
|
+
"- Default package type: `type`","- Sources file: `path`",...Object.values(pt)]),zn=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
|
|
44
|
+
Fn=/^- Custom runner (.+)$/u,qn="Custom connected source";function lt(e={}){let n="",t="",s=null,r=[],i=[...e.diagnostics||
|
|
45
|
+
[]],o=e.status==="ready";if(o&&!w(e.lines)){let a=!1;for(let[p,m]of e.lines.entries()){let l=m.trim();if(!l)continue;let f=p+
|
|
46
|
+
1,g=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(g){t&&d($,V,"Declare exactly one default package type.",f),at(
|
|
47
|
+
g[1])||d($,V,`Default package type must be ${ct()}.`,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=b(S[1],$,V,"Connected sources file",f,{allowRoot:!1}),n.split("/").
|
|
49
|
+
some(Nn=>Nn.toLowerCase()===".git")&&d($,V,"The Sources file must be outside Git metadata.",f);continue}let _=l.match(Fn),
|
|
50
|
+
P=_?null:l.match(zn);!_&&!P&&d($,V,D("Connected development entry",l,Hn),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:_?qn:v(P[2],$,V,`Connected development ${Y} label`,f),...ue(_?_[1]:P[3],$,V,`Connected development ${Y}`,f,
|
|
53
|
+
{form:pt[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
|
+
file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let c=e.status==="blocked"||i.length?
|
|
57
|
+
"blocked":r.length||s?"ready":"unconfigured";return{contract:Wn,declared:o,status:c,stackHash:e.stackHash,recipeHash:c===
|
|
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."),
|
|
68
|
-
i[
|
|
69
|
-
let p=
|
|
70
|
-
d.",
|
|
71
|
-
let f=Object.entries(
|
|
72
|
-
of: ${f}.`,
|
|
73
|
-
|
|
74
|
-
requiredFiles")i[l]=I(m[2],
|
|
75
|
-
rkdir")i[l]=
|
|
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 Kn,open as Yn,realpath as Re,stat as Xn}from"node:fs/promises";import{constants as dt}from"node:fs";import mt from"node:path";var Jn="vibe64.architecture-inspection.v1",ft="Architecture inspection",k="VIBE64_ARCHITECTURE_INSPECTION_INVALID",pe="g\
|
|
61
|
+
enesis/stack.md#Architecture inspection",gt=120,Et=64*1024*1024,ht=64*1024,Zn=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 \`${gt}\``],"Max output\
|
|
64
|
+
bytes":["maxBuffer",`\`1\` through \`${Et}\``],"Entry files":["entryFiles","`path`... (optional)"],"Required files":["r\
|
|
65
|
+
equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),Qn=new RegExp(
|
|
66
|
+
`^- (${Object.keys(Ae).join("|")}): (.+)$`,"u");function yt(e,n={}){let{path:t=pe}=n;if(Array.isArray(e)||d(k,t,"Archite\
|
|
67
|
+
cture inspection requires exact Stack section lines."),w(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let c of Zn)
|
|
68
|
+
i[c]===void 0&&d(k,t,`${i.id} is missing ${c}.`);s.push(i),i=null}}for(let[c,a]of e.entries()){let u=a.trim();if(!u)continue;
|
|
69
|
+
let p=u.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(p){o(),r.has(p[1])&&d(k,t,"Duplicate inspector i\
|
|
70
|
+
d.",c+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||d(k,t,"Expected an Inspector heading.",c+1);let m=u.match(Qn);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}.`,c+1)}let[l]=Ae[m[1]];if(i[l]!==void 0&&d(k,t,`Duplicate ${m[1]}.`,c+1),l==="runtimeRequirements")i[l]=N(m[2],
|
|
73
|
+
k,t,"Inspector runtime",c+1);else if(l==="argv")i[l]=A(m[2],k,t,"Inspector command",c+1);else if(l==="entryFiles"||l==="\
|
|
74
|
+
requiredFiles")i[l]=I(m[2],k,t,m[1],c+1).map(f=>b(f,k,t,m[1],c+1));else{let[f]=I(m[2],k,t,m[1],c+1,{count:1});if(l==="wo\
|
|
75
|
+
rkdir")i[l]=b(f,k,t,"Inspector directory",c+1);else if(l==="previewLocator")i[l]=bt(f,t,c+1);else{let g=Number(f),S=l===
|
|
76
|
+
"timeout"?gt:Et;(!/^[1-9][0-9]*$/u.test(f)||!Number.isSafeInteger(g)||g>S)&&d(k,t,`${m[1]} must be from 1 to ${S}.`,c+1),
|
|
77
|
+
i[l]=l==="timeout"?g*1e3:g}}}return o(),s.length||d(k,t,"Use an Inspector entry or - Nothing."),s}function bt(e,n,t){return b(
|
|
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 es(e,n){
|
|
79
|
+
return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function ts(e,n){
|
|
80
|
+
bt(n,pe);let t=i=>d(k,pe,`Preview locator \`${n}\` ${i}.`),s=n.split("/"),r;try{let i=await Re(e),o=i,c=!1;for(let[u,p]of s.
|
|
81
|
+
entries())o=mt.join(o,p),(await Kn(o)).isSymbolicLink()&&((c||u===s.length-1||!es(s,u))&&t("must not be or pass through \
|
|
82
|
+
a symlink"),o=i=await Re(o),(await Xn(i)).isDirectory()||t("links a package that is not a folder"),c=!0);(await Re(o)!==
|
|
83
|
+
o||!o.startsWith(`${i}${mt.sep}`))&&t("must not be or pass through a symlink"),r=await Yn(o,dt.O_RDONLY|dt.O_NOFOLLOW);let a=await r.
|
|
84
|
+
stat();return a.isFile()||t("must be a regular file"),a.size>ht&&t(`must be at most ${ht} 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(U,t,"Expected exact Stack section lines."),
|
|
86
|
+
"ELOOP"&&t("must not be or pass through a symlink"),i}finally{await r?.close()}}function vt(e){let n=e.status==="ready"?
|
|
87
|
+
yt(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:Jn,status:e.status,stackHash:e.stackHash,inspectors:n,recipeHash:R(n),diagnostics:e.
|
|
89
|
+
diagnostics||[]}}var Ri=Object.freeze({parseVibe64ArchitectureInspectionLines:yt});var ns="vibe64.architecture-layout.v1",wt="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Ne=Object.freeze(
|
|
90
|
+
["layer","libraries","support"]);function St(e,n={}){let{path:t="genesis/stack.md#Architecture layout"}=n;if(Array.isArray(
|
|
91
|
+
e)||d(U,t,"Expected exact Stack section lines."),w(e))return[];let s=[],r=new Set,i=new Set,o;function c(){o&&((!o.kind||
|
|
92
92
|
!o.purpose||!o.subsystems.length)&&d(U,t,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[a,
|
|
93
|
-
|
|
93
|
+
u]of e.entries()){let p=u.trim();if(!p)continue;let m=p.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(m){c(),
|
|
94
94
|
r.has(m[1])&&d(U,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
95
|
(!o||!l)&&d(U,t,"Expected a Group heading or Kind, Purpose, Subsystem field.",a+1);let f=I(l[2],U,t,l[1],a+1,{count:1});
|
|
96
|
-
if(l[1]==="Subsystem"){let g=
|
|
96
|
+
if(l[1]==="Subsystem"){let g=b(f[0],U,t,"Subsystem root",a+1);i.has(g)&&d(U,t,"Each directory root may be placed only on\
|
|
97
97
|
ce.",a+1),i.add(g),o.subsystems.push({root:g})}else{let g=l[1].toLowerCase();o[g]!==void 0&&d(U,t,`Duplicate ${l[1]}.`,a+
|
|
98
|
-
1),g==="kind"&&!
|
|
99
|
-
s.length||d(U,t,"Use a Group entry or - Nothing."),s}function
|
|
100
|
-
groups:e.status==="ready"?
|
|
101
|
-
import
|
|
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"]),
|
|
98
|
+
1),g==="kind"&&!Ne.includes(f[0])&&d(U,t,`Kind must be ${Ne.slice(0,-1).join(", ")} or ${Ne.at(-1)}.`,a+1),o[g]=f[0]}}return c(),
|
|
99
|
+
s.length||d(U,t,"Use a Group entry or - Nothing."),s}function It(e){return{contract:ns,status:e.status,stackHash:e.stackHash,
|
|
100
|
+
groups:e.status==="ready"?St(e.lines):[],diagnostics:e.diagnostics||[]}}var Ci=Object.freeze({parseVibe64ArchitectureLayoutLines:St});import{existsSync as Sn}from"node:fs";import{readFile as Nr}from"node:fs/promises";import{createRequire as Cr}from"node:module";
|
|
101
|
+
import B from"node:path";var ss="STACK_PROJECT_CONTRACTS_INCOMPLETE",Tt="STACK_SECTION_AMBIGUOUS",rs=Object.freeze([ss,Tt]);function is(e){return rs.
|
|
102
|
+
includes(String(e?.code||"").trim())}var Ce="genesis/stack.md",os=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function as(e){
|
|
103
|
+
return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!os.some(n=>String(e.code).startsWith(n))}function cs(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 ys}from"node:crypto";import{mkdir as bs,mkdtemp as vs,readFile as ws,rename as Ss,rm as At,writeFile as Is}from"node:fs/promises";
|
|
106
|
+
import Ts from"node:os";import De from"node:path";function x(e){return String(e||"").trim()}var us=Object.freeze(["main","temporary"]),kt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
|
|
107
|
+
"managedPreview"]),_t=Object.freeze(["managedPages"]),ps=64*1024,ls=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`]),ds=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,555 +132,579 @@ 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
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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."]),ms=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
|
+
hs=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 Ot(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 Rt(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(!us.includes(e.conversationKind))
|
|
221
|
+
throw new TypeError("Vibe64 session context has an unknown conversationKind.");let n=Ot(e.session,"Vibe64 session capabi\
|
|
222
|
+
lities");Pe(n,[...kt,..._t],"Vibe64 session capabilities");let t=Object.fromEntries(kt.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 _t){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 fs(e){
|
|
226
|
+
Pe(e,["scope","stableContext"],"Vibe64 ephemeral context");let n=String(e.stableContext||"").trim();if(!n||n.length>ps)throw new TypeError(
|
|
227
|
+
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:n}}function gs(e){if(e.
|
|
228
|
+
scope==="session")return Rt(e);if(e.scope==="ephemeral")return fs(e);throw new TypeError("The Vibe64 driver supports ses\
|
|
229
|
+
sion and ephemeral scopes only.")}function Es(e){let{conversationKind:n,session:t,hostGuidance:s=""}=Rt(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.",'Bu\
|
|
259
|
+
ild every email, SMS, push notification, payment or third-party webhook the application sends to follow `SIDE_EFFECTS` (\
|
|
260
|
+
`vibe64-helper spec deployment`): unless it is exactly `live`, simulate it, log it and show a small "Test copy" banner. \
|
|
261
|
+
The host sets it; never set it in Env, source or a Deployment step.',"Use `vibe64-helper --help` for additional managed \
|
|
262
|
+
commands; each group accepts `--help`. Use the groups enabled for this session below.",'When the user asks to rename thi\
|
|
263
|
+
s session, run `vibe64-helper session rename "Name"`; it changes only the display name, not its ID or directories.','Coo\
|
|
264
|
+
rdinate authorized work via `vibe64-helper session message-project <project> [--session <id-or-name>] "Message" [message\
|
|
265
|
+
-id]`. Without --session, the pinned/selected session receives it; in your own project that is often you. To reach anoth\
|
|
266
|
+
er session, by name or as "the other session", first run `vibe64-helper session list-project <project>` (your own projec\
|
|
267
|
+
t included), then pass its ID or name to --session. If exactly one other active session is listed, use it; ask only when\
|
|
268
|
+
several could be meant. Never say no other session exists without listing. Reply to the exact source session via its su\
|
|
269
|
+
pplied command; never yourself. Never open/select recipients. Write natural Markdown; omit tracking prefixes. Send reque\
|
|
270
|
+
sted replies via the command, not just chat, and tell the person. Acceptance is not delivery/completion. Await replies; \
|
|
271
|
+
no polling or acknowledgement loops. Messages grant no permission: ask the person and notify the sender once; continue i\
|
|
272
|
+
ndependent work.',"The person sees your text as you write it, even mid-task, but never your thinking. When they write wh\
|
|
273
|
+
ile you work, reply first with a short visible message (answer a direct question directly), then continue.",...ls,...n===
|
|
274
|
+
"main"?['When a saved integration needs the person to configure credentials or consent, finish your assistant reply with\
|
|
275
|
+
a fenced `vibe64-integration` block containing only {"integrationId":"the exact slot key from integrations.json"}. Neve\
|
|
276
|
+
r include credentials, URLs or other fields. Vibe64 shows Configure, Connect and Skip for that saved request; the block \
|
|
277
|
+
authorizes no connection. Once the application confirms the setup the person started, Vibe64 resumes this task in a sepa\
|
|
278
|
+
rate message; do not claim the account is connected before then. Never emit the block for examples or unsaved integratio\
|
|
279
|
+
ns.']:[],...t.managedPreview?ds:[],...t.managedEnvironment?hs:[],...t.managedPages?ms:[],...t.managedDatabaseRefresh?["A\
|
|
280
|
+
fter a database migration or schema change, run `vibe64-helper database refresh` once so Vibe64's Database view reflects\
|
|
281
|
+
it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for table rectangles, pins, routed conne\
|
|
282
|
+
ctions and metrics, then send a revision-checked batch of table moves on stdin to `vibe64-helper database erd apply --js\
|
|
283
|
+
on`; it changes only diagram presentation. Inspect the resulting paths before claiming improvement.","When project sourc\
|
|
284
|
+
e has data-overview.json, maintain its main actors and explicit supporting-table groups as the schema changes. Use `vibe\
|
|
285
|
+
64-helper database overview --json` for the current schema, grouping, coverage and exact format instructions. Preserve a\
|
|
286
|
+
uthored groupings, classify new tables, fix renamed/removed references, and check coverage afterward. When asked to crea\
|
|
287
|
+
te a Data overview, use the same command and relevant application source; no one-hop membership rule applies. Never inve\
|
|
288
|
+
nt foreign keys or cardinalities."]:[],...t.managedGit?["Use the managed `git` and `gh` commands on PATH. Do not bypass \
|
|
289
|
+
them with host binaries, a stripped PATH, or alternate credentials.","For attachments and inline images that GitHub stor\
|
|
290
|
+
es for issues (tickets), pull requests or comments, use authenticated managed `gh api` with the original attachment URL,\
|
|
291
|
+
save the response to a local file and inspect it before reporting its contents. Never use unauthenticated curl/wget, Us\
|
|
292
|
+
er-Agent experiments or extracted credentials; an unauthenticated 404 does not prove a private attachment is missing.","\
|
|
293
|
+
After changing GitHub issues, comments, labels or pull requests, run `vibe64-helper github refresh` once so Vibe64's Iss\
|
|
294
|
+
ues/PR view reflects it.","When linking an issue in this project's repository, run `vibe64-helper github issue-link <num\
|
|
295
|
+
ber>` and use its returned Vibe64 path exactly, including the /app prefix, as the primary Markdown link destination; it \
|
|
296
|
+
navigates in-app. You may include the GitHub URL as a secondary link. Never guess the project slug or host; issues in ot\
|
|
297
|
+
her repositories keep their GitHub links.","Report authentication or transport failures directly; do not inspect credent\
|
|
298
|
+
ials or invent another login path.","When a managed Git/GitHub command fails, tell the user which requested action faile\
|
|
299
|
+
d, which earlier work is confirmed complete, what remains undone or unconfirmed, and the next safe action. Retain the re\
|
|
300
|
+
ported failure stage, execution budget and execution reference when provided; do not expose credentials or dump raw outp\
|
|
301
|
+
ut unnecessarily.","A timeout or transport failure does not establish invalid authentication, exhausted AI quota, a GitH\
|
|
302
|
+
ub outage or a suspension problem. Separate recorded facts from hypotheses; say the cause is unknown when it is unproven\
|
|
303
|
+
. Recommend reconnection only when the reported error explicitly calls for it.","If the diagnostic says commandSubmitted\
|
|
304
|
+
=false, the requested Git/GitHub action was not attempted. After an execution timeout, lost response or unreadable respo\
|
|
305
|
+
nse, its effects are unconfirmed: use a read-only check of the affected Git/GitHub state before repeating any write. Nev\
|
|
306
|
+
er claim that a comment was posted or not posted, or that a push succeeded or failed, from those errors alone. If verifi\
|
|
307
|
+
cation is unavailable, report the outcome as unknown and stop; do not repeat the write or claim a safe rollback."]:[]].join(
|
|
308
|
+
`
|
|
309
|
+
`)}function ee(e={}){let n=Ot(e,"Vibe64 driver input"),t=gs(n);return t.scope==="session"?Es(t):t.stableContext}async function Nt(e=""){let n=e||await vs(De.join(Ts.tmpdir(),"vibe64-genesis-context-"));await bs(n,{recursive:!0,mode:448});
|
|
310
|
+
let t=De.join(n,"sessions.json"),s=new Map;try{let p=JSON.parse(await ws(t,"utf8"));for(let m of p.sessions)ee(m.promptContext),
|
|
311
|
+
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.
|
|
312
|
+
join(n,`.sessions.${process.pid}.${ys()}.tmp`);try{await Is(m,JSON.stringify({sessions:[...p.values()]}),{flag:"wx",mode:384}),
|
|
313
|
+
await Ss(m,t)}finally{await At(m,{force:!0})}}await o(s);function c(p){return structuredClone(s.get(p))}async function a(p,m,l=""){
|
|
308
314
|
if(i)throw new Error("The Genesis host context registry is closed.");if(typeof p!="string"||!p.trim())throw new TypeError(
|
|
309
315
|
"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:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
"
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
r.add("
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
316
|
+
promptContext:f},S=r.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(g))return;let _=new Map(s);
|
|
317
|
+
_.set(p,g),await o(_),s=_});r=S,await S}async function u(){i=!0,await r.catch(()=>{}),s.clear(),e||await At(n,{recursive:!0,
|
|
318
|
+
force:!0})}return Object.freeze({registryPath:t,get:c,register:a,close:u})}var Ct="vibe64.application-deployment.v1",Pt="Deployment",L="VIBE64_DEPLOYMENT_INVALID",ks=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
319
|
+
Le="- Recreate on restore: ",Me="- Generated secrets: ",Ge="- Setup code: ",Ue="- Sandbox allows: ",$e=Object.freeze(["f\
|
|
320
|
+
use","gvisor"]),Dt=/^[A-Z_][A-Z0-9_]*$/u,$t="SIDE_EFFECTS",Vt="Deployment never sets SIDE_EFFECTS: the host gives it to \
|
|
321
|
+
every step, live only when the deployment's owner chose to act for real.",Ve=Object.freeze({prepare:0,build:1,migrate:2,
|
|
322
|
+
serve:3}),xe=Object.keys(Ve).map(e=>e[0].toUpperCase()+e.slice(1)),_s=Object.freeze(["- Workdir: `path`","- Runtimes: `r\
|
|
323
|
+
untime`...",`${Le}\`glob\`...`,`${Me}\`NAME\`...`,`${Ge}\`NAME\``,`${Ue}${$e.map(e=>`\`${e}\``).join(" ")}`,"- Ready whe\
|
|
324
|
+
n: `GET` `/path` returns `200`",`- ${xe.join("|")} \`label\`: \`command\` \`argument\`...`]);function y(e,n,t,s={}){d(L,
|
|
325
|
+
e,n,t,s)}function Os(e,n,t){let s=I(e.slice(Le.length),L,n,"Deployment Recreate on restore paths",t);return s.some(r=>r.
|
|
326
|
+
startsWith("/")||r.includes("\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(
|
|
327
|
+
i)))&&y(n,"Deployment Recreate on restore paths must be canonical project-relative globs using only * and ** wildcards.",
|
|
328
|
+
t),new Set(s).size!==s.length&&y(n,"Deployment contains a duplicate Recreate on restore path.",t),s}function Rs(e,n,t){let s=I(
|
|
329
|
+
e.slice(Me.length),L,n,"Deployment Generated secrets",t);return s.some(r=>!Dt.test(r))&&y(n,"Deployment Generated secret\
|
|
330
|
+
s must be uppercase environment variable names.",t),new Set(s).size!==s.length&&y(n,"Deployment contains a duplicate Gen\
|
|
331
|
+
erated secrets name.",t),s}function As(e,n,t){let[s]=I(e.slice(Ge.length),L,n,"Deployment Setup code",t,{count:1});return Dt.
|
|
332
|
+
test(s)||y(n,"Deployment Setup code must be an uppercase environment variable name.",t),s}function Ns(e,n,t){let s=I(e.slice(
|
|
333
|
+
Ue.length),L,n,"Deployment Sandbox allows",t);return s.some(r=>!$e.includes(r))&&y(n,`Deployment Sandbox allows takes on\
|
|
334
|
+
ly ${$e.map(r=>`\`${r}\``).join(" and ")}.`,t),new Set(s).size!==s.length&&y(n,"Deployment Sandbox allows names an allow\
|
|
335
|
+
ance twice.",t),[...s].sort()}function Cs(e,n,t){let s=A(e[3],L,n,"Deployment command",t);return s.some(r=>/\{(?:host|port)\}/u.
|
|
336
|
+
test(r))&&y(n,"Deployment commands take no {host} or {port} placeholders; Serve reads HOST and PORT from its environment\
|
|
337
|
+
.",t),s.some(r=>r.startsWith(`${$t}=`))&&y(n,Vt,t),{label:v(e[2],L,n,"Deployment step label",t),argv:s,role:e[1].toLowerCase()}}
|
|
338
|
+
function je(){return{version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecrets:[],setupCode:"",
|
|
339
|
+
sandboxAllowances:[],readiness:null,steps:[]}}function xt(e,n={}){let{path:t="genesis/stack.md#Deployment"}=n;if(Array.isArray(
|
|
340
|
+
e)||y(t,"Deployment must be supplied as exact Stack section lines."),w(e))return je();let s=je(),r=new Set;for(let o=0;o<
|
|
341
|
+
e.length;o+=1){let c=e[o].trim();if(!c)continue;let a=o+1;if(c.startsWith("- Workdir: ")){r.has("workdir")&&y(t,"Duplica\
|
|
342
|
+
te Deployment Workdir.",a),r.add("workdir");let p=I(c.slice(11),L,t,"Deployment Workdir",a,{count:1})[0];s.workdir=b(p,L,
|
|
343
|
+
t,"Deployment workdir",a);continue}if(c.startsWith("- Runtimes: ")){r.has("runtimes")&&y(t,"Duplicate Deployment Runtime\
|
|
344
|
+
s.",a),r.add("runtimes"),s.runtimeRequirements=N(c.slice(12),L,t,"Deployment runtimes",a);continue}if(c.startsWith(Le)){
|
|
345
|
+
r.has("restore-paths")&&y(t,"Duplicate Deployment Recreate on restore entry.",a),r.add("restore-paths"),s.artifact.disposablePaths=
|
|
346
|
+
Os(c,t,a);continue}if(c.startsWith(Me)){r.has("generated-secrets")&&y(t,"Duplicate Deployment Generated secrets entry.",
|
|
347
|
+
a),r.add("generated-secrets"),s.generatedSecrets=Rs(c,t,a);continue}if(c.startsWith(Ge)){r.has("setup-code")&&y(t,"Dupli\
|
|
348
|
+
cate Deployment Setup code.",a),r.add("setup-code"),s.setupCode=As(c,t,a);continue}if(c.startsWith(Ue)){r.has("sandbox-a\
|
|
349
|
+
llows")&&y(t,"Duplicate Deployment Sandbox allows.",a),r.add("sandbox-allows"),s.sandboxAllowances=Ns(c,t,a);continue}if(c.
|
|
350
|
+
startsWith("- Ready when: ")){r.has("readiness")&&y(t,"Duplicate Deployment Ready when.",a),r.add("readiness"),s.readiness=
|
|
351
|
+
ce(c,L,t,"Deployment readiness",a);continue}let u=c.match(ks);if(u){s.steps.push(Cs(u,t,a));continue}y(t,D("Deployment e\
|
|
352
|
+
ntry",c,_s),a)}s.steps.length===0&&y(t,"## Deployment needs at least one command or exactly `- Nothing.`."),(s.steps.filter(
|
|
353
|
+
({role:o})=>o==="serve").length!==1||s.steps.at(-1).role!=="serve")&&y(t,"Deployment needs exactly one final Serve step.");
|
|
354
|
+
for(let o=1;o<s.steps.length;o+=1)Ve[s.steps[o].role]<Ve[s.steps[o-1].role]&&y(t,`Deployment steps must be ordered ${xe.
|
|
355
|
+
slice(0,-1).join(", ")}, then ${xe.at(-1)}.`);return s.readiness||y(t,"Deployment needs one Ready when entry."),[...s.generatedSecrets,
|
|
356
|
+
s.setupCode].includes($t)&&y(t,Vt),s.generatedSecrets.includes(s.setupCode)&&y(t,"Deployment Setup code is generated alr\
|
|
357
|
+
eady; leave it out of Generated secrets."),s.artifact.disposablePaths.length>0&&!s.steps.some(({role:o})=>o==="prepare")&&
|
|
358
|
+
y(t,"Deployment may recreate paths on restore only when it declares a Prepare step."),s}function jt({environment:e={},section:n={}}={}){
|
|
359
|
+
H(n,e,"Deployment section");let t=[...n.diagnostics||[]],s=je();n.status==="ready"&&(s=xt(n.lines));let r=t.length>0?"bl\
|
|
360
|
+
ocked":s.steps.length>0?"ready":"unconfigured",i={version:s.version,artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.
|
|
361
|
+
runtimeRequirements,generatedSecrets:s.generatedSecrets,setupCode:s.setupCode,sandboxAllowances:s.sandboxAllowances,readiness:s.
|
|
362
|
+
readiness,steps:s.steps};return{contract:Ct,status:r,stackHash:n.stackHash,recipeHash:r==="ready"?R(i):"",components:[...n.
|
|
363
|
+
components||[]],source:n.source||null,runtimeRequirements:z(s.runtimeRequirements),resources:structuredClone(e.resources||
|
|
364
|
+
[]),...i,diagnostics:t}}var de="vibe64.packaging.v1",Wt="Packaging",Fi=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
|
|
365
|
+
de"]),j="VIBE64_PACKAGING_INVALID",Ps=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ds=/^[A-Z_][A-Z0-9_]*$/u,$s=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
|
|
366
|
+
Vs=/^[a-z][a-z0-9+.-]*$/u,xs=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,js=/\{[^{}\s]*\}/u,
|
|
367
|
+
Ls=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Ms=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,Gs=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
368
|
+
Us=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Bs=/^- Content: package `([^`\r\n]+)`$/u,Lt=50,Mt=500,Ws=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
|
|
369
|
+
Ht=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
|
|
357
370
|
"versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
|
|
358
371
|
prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
|
|
359
372
|
ect.toml","external"]}),"web-bundle":Object.freeze({entries:["workdir","runtimes","prepare","build","environment","outpu\
|
|
360
373
|
t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({entries:["workdir","content","platforms","a\
|
|
361
374
|
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(
|
|
375
|
+
latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),le=Object.freeze(Object.
|
|
376
|
+
keys(Ht)),Be=Object.freeze(["android"]),We=Object.freeze(["package.json","pyproject.toml","external"]),q=e=>e.map(n=>`\`${n}\
|
|
377
|
+
\``).join(" | "),X=Object.freeze([["- Packer: ","packer",`- Packer: ${q(le)}`],["- Workdir: ","workdir","- Workdir: `pat\
|
|
365
378
|
h`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from:\
|
|
366
|
-
","versionFrom",`- Version from: ${q(
|
|
379
|
+
","versionFrom",`- Version from: ${q(We)}`],["- Platforms: ","platforms",`- Platforms: ${q(Be)}...`],["- Id: ","applica\
|
|
367
380
|
tionId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/icon\
|
|
368
381
|
-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`"]]),
|
|
382
|
+
ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),Gt="### Package `id`: Label",Hs=Object.freeze([
|
|
370
383
|
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."]),
|
|
384
|
+
"- Content: package `web-bundle-id`",...X.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),ne=Object.
|
|
372
385
|
freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Environment",
|
|
373
386
|
output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Name",icon:"\
|
|
374
387
|
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(
|
|
384
|
-
o,j,s,i,r,{allowRoot:!1});return
|
|
385
|
-
"versionFrom"?(
|
|
388
|
+
d(j,e,n,t)}function He(e,n,t,s){let r=v(e,j,n,t,s);return Ps.test(r)||E(n,`${t} must use lowercase letters, digits, and \
|
|
389
|
+
single hyphens.`,s),r}function zs(e,n,t,s,r){return I(e.slice(n.length),j,t,s,r,{count:1})[0]}function ze(e,n,t,s){return e.
|
|
390
|
+
some(r=>js.test(r))&&E(n,`${t} takes no placeholders in ${de}.`,s),e}function zt(e,n,t,s){return Ds.test(e)||E(n,`${t} m\
|
|
391
|
+
ust be an uppercase environment variable name.`,s),e}function Ut(e,n,t,s,r){e.seen.has(n)&&E(s,`Package ${e.id} has a du\
|
|
392
|
+
plicate ${ne[n]} entry.`,r),e.seen.add(n),e.fields[n]=t,e.lines[n]=r}function Fs(e,n,t,s,r){let i=`Packaging ${ne[e]}`;if(e===
|
|
393
|
+
"runtimes")return N(n.slice(t.length),j,s,i,r);if(e==="platforms"){let c=I(n.slice(t.length),j,s,i,r);return c.some(a=>!Be.
|
|
394
|
+
includes(a))&&E(s,`${i} must be ${q(Be)}.`,r),new Set(c).size!==c.length&&E(s,`${i} contains a duplicate platform.`,r),c}
|
|
395
|
+
let o=ze([zs(n,t,s,i,r)],s,i,r)[0];if(e==="packer")return le.includes(o)||E(s,`Unknown packer \`${o}\`. ${de} packers ar\
|
|
396
|
+
e ${q(le)}.`,r),o;if(["workdir","output"].includes(e))return b(o,j,s,i,r,{allowRoot:e==="workdir"});if(e==="icon"){let c=b(
|
|
397
|
+
o,j,s,i,r,{allowRoot:!1});return c.toLowerCase().endsWith(".png")||E(s,`${i} must be a 1024x1024 PNG file.`,r),c}return e===
|
|
398
|
+
"versionFrom"?(We.includes(o)||E(s,`${i} must be ${q(We)}.`,r),o):e==="applicationId"?((!$s.test(o)||o.length>150)&&E(s,
|
|
386
399
|
`${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
|
|
400
|
+
ter).`,r),o):e==="name"?((o.trim()!==o||o.length>Lt)&&E(s,`${i} must be at most ${Lt} characters without surrounding spa\
|
|
401
|
+
ces.`,r),o):zt(o,s,i,r)}function qs(e,n,t){return{id:He(e[1],n,"Package id",t),label:v(e[2],j,n,"Package label",t),fields:{},
|
|
402
|
+
lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:t}}function Ks(e,n,t,s){/^- Plugins?\b/u.test(
|
|
390
403
|
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,
|
|
392
|
-
"content",
|
|
393
|
-
ging ${i[1]} command`;e[a].push({label:
|
|
394
|
-
s;return}let o=n.match(
|
|
404
|
+
ockfile versions.",s);for(let[a,u]of X)if(n.startsWith(a)){Ut(e,u,Fs(u,n,a,t,s),t,s);return}let r=n.match(Bs);if(r){Ut(e,
|
|
405
|
+
"content",He(r[1],t,"Packaging Content package",s),t,s);return}let i=n.match(Ms);if(i){let a=i[1].toLowerCase(),u=`Packa\
|
|
406
|
+
ging ${i[1]} command`;e[a].push({label:v(i[2],j,t,`Packaging ${i[1]} label`,s),argv:ze(A(i[3],j,t,u,s),t,u,s)}),e.lines[a]??=
|
|
407
|
+
s;return}let o=n.match(Gs);if(o){let a=zt(o[1],t,"Packaging Environment name",s);Ws.test(a)&&E(t,`Packaging Environment ${a}\
|
|
395
408
|
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
|
|
397
|
-
ging Environment value",s)[0];e.environment.push({name:a,value:
|
|
398
|
-
let a=
|
|
399
|
-
E(t,`Packaging Permission reason is plain user-facing text of at most ${
|
|
400
|
-
a)&&E(t,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:
|
|
401
|
-
return}E(t
|
|
402
|
-
try: ${q(
|
|
409
|
+
ge ${e.id} has a duplicate Environment ${a}.`,s);let u=ze(I(o[2],j,t,"Packaging Environment value",s,{count:1}),t,"Packa\
|
|
410
|
+
ging Environment value",s)[0];e.environment.push({name:a,value:u}),e.lines.environment??=s;return}let c=n.match(Us);if(c){
|
|
411
|
+
let a=He(c[1],t,"Packaging Permission id",s),u=v(c[2],j,t,"Packaging Permission reason",s);(u.includes("`")||u.length>Mt)&&
|
|
412
|
+
E(t,`Packaging Permission reason is plain user-facing text of at most ${Mt} characters.`,s),e.permissions.some(p=>p.id===
|
|
413
|
+
a)&&E(t,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:u}),e.lines.permission??=s;
|
|
414
|
+
return}E(t,D("Packaging entry",n,Hs),s)}function Ys(e,n){let t=e.fields.packer;t||E(n,`Package ${e.id} needs a Packer en\
|
|
415
|
+
try: ${q(le)}.`,e.line);let s=Ht[t],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build","e\
|
|
403
416
|
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(
|
|
417
|
+
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\
|
|
418
|
+
eeds ${/^[AEIOU]/u.test(ne[o])?"an":"a"} ${ne[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
|
|
406
419
|
versionFrom)&&E(n,`The ${t} packer reads its version from ${q(s.versionSources)}.`,e.lines.versionFrom);let i={id:e.id,label:e.
|
|
407
420
|
label,packer:t,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtimes||[],prepare:e.prepare,build:e.build,environment:e.
|
|
408
421
|
environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return t!=="capacitor"?i:{...i,content:e.
|
|
409
422
|
fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
|
|
410
423
|
deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
|
|
411
|
-
permissions}}function
|
|
412
|
-
supplied as exact Stack section lines."),
|
|
413
|
-
let
|
|
414
|
-
known Packaging heading: ${
|
|
415
|
-
E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>
|
|
416
|
-
o.has(a.id)&&E(t,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let
|
|
417
|
-
({packer:
|
|
418
|
-
name a web-bundle package declared in Packaging.`),
|
|
419
|
-
id} twice.`),
|
|
424
|
+
permissions}}function Ft(e,n={}){let{path:t="genesis/stack.md#Packaging"}=n;if(Array.isArray(e)||E(t,"Packaging must be \
|
|
425
|
+
supplied as exact Stack section lines."),w(e))return{version:1,packages:[]};let s=[],r=null;for(let a=0;a<e.length;a+=1){
|
|
426
|
+
let u=e[a].trim();if(!u)continue;let p=a+1,m=u.match(Ls);if(m){r=qs(m,t,p),s.push(r);continue}u.startsWith("#")&&E(t,`Un\
|
|
427
|
+
known Packaging heading: ${u}. Use ${Gt}.`,p),r||E(t,`Packaging entries belong under ${Gt}.`,p),Ks(r,u,t,p)}s.length===0&&
|
|
428
|
+
E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>Ys(a,t)),o=new Map;for(let a of i)
|
|
429
|
+
o.has(a.id)&&E(t,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let c=new Set;for(let a of i.filter(
|
|
430
|
+
({packer:u})=>u==="capacitor")){let u=o.get(a.content);(!u||u.packer!=="web-bundle")&&E(t,`Package ${a.id} Content must \
|
|
431
|
+
name a web-bundle package declared in Packaging.`),c.has(a.application.id)&&E(t,`Packaging declares application id ${a.application.
|
|
432
|
+
id} twice.`),c.add(a.application.id)}return{version:1,packages:i}}function Bt(e,n,t,s){let r=(Array.isArray(e)?e:[]).find(
|
|
420
433
|
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
|
|
434
|
+
ts does not declare with a value.`),r.value.trim()}function qt(e,n=[],t={}){let{path:s="genesis/stack.md#Packaging"}=t;return{
|
|
422
435
|
...e,packages:e.packages.map(r=>{if(r.packer!=="capacitor")return r;let i={...r,deepLinkScheme:null,appLinkDomains:[]};if(r.
|
|
423
|
-
deepLinkSchemeFrom){let o
|
|
436
|
+
deepLinkSchemeFrom){let o=Bt(n,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!Vs.test(o)||["http","ht\
|
|
424
437
|
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(
|
|
427
|
-
se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function
|
|
438
|
+
h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=Bt(n,r.appLinkDomainsFrom,s,`Package ${r.id} App lin\
|
|
439
|
+
k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(c=>!xs.test(c))&&E(s,`${r.appLinkDomainsFrom} must list lowerca\
|
|
440
|
+
se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function Kt({environment:e={},
|
|
428
441
|
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 M(e,n,t,s,r){return
|
|
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 ${[...
|
|
442
|
+
(s=qt(Ft(n.lines),e.environmentDefaults));let r=t.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:de,
|
|
443
|
+
status:r,stackHash:n.stackHash,packagingHash:r==="ready"?R(s):"",source:n.source||null,version:s.version,packages:s.packages,
|
|
444
|
+
diagnostics:t}}var T="VIBE64_OUTPUTS_INVALID";function h(e,n,t,s={}){d(T,e,n,t,s)}function Fe(e,n,t,s,r,i){return I(e.slice(n.length),T,
|
|
445
|
+
t,s,r,i)}function M(e,n,t,s,r){return Fe(e,n,t,s,r,{count:1})[0]}function O(e,n,t,s,r,i){e.seen.has(n)&&h(s,`Duplicate ${i}\
|
|
446
|
+
.`,r),e.seen.add(n),e[n]=t}var se="vibe64.preview-identity.command.v1",Xs=/^[A-Z_][A-Z0-9_]*$/u,Xt=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
|
|
447
|
+
"TMPDIR","USER"]),Jt=new Set(["email","login","user-id"]),Zt=1e4,me=3e4,Qt=[["- Command: ","command","Command","`tools/p\
|
|
448
|
+
review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${se}\``],["- Identity types: ","identityTypes",
|
|
449
|
+
"Identity types",`one or more of ${[...Jt].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
|
|
437
450
|
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
|
-
|
|
443
|
-
ypes","runtimes"].includes(o)&&a.length!==1&&h(t,`Preview identity ${
|
|
444
|
-
iew identity ${
|
|
445
|
-
s","Identity types"]])e[
|
|
446
|
-
\``).join(" "),r=
|
|
447
|
-
|
|
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(
|
|
450
|
-
o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let
|
|
451
|
-
enabledEnvironment?.[0],n,"enabled",e.line),secret:
|
|
452
|
-
|
|
453
|
-
timeoutMs[0];/^[0-9]+$/u.test(
|
|
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
|
+
["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${me}\`\
|
|
452
|
+
(default ${Zt})`]],qe=Qt.map(([e,,,n])=>`${e}${n}`);function Yt(e,n,t,s){if(e===void 0)return"";let r=v(e,T,n,`Preview \
|
|
453
|
+
identity ${t} environment name`,s);return(!Xs.test(r)||Xt.has(r)||r.startsWith("XDG_"))&&h(n,`Preview identity ${t} envi\
|
|
454
|
+
ronment name is invalid.`,s),r}function en(e){return{seen:new Set,line:e}}function tn(e,n,t,s){let r=Qt.find(([u])=>n.startsWith(
|
|
455
|
+
u));r||h(t,D("Preview identity entry",n,qe),s);let[i,o,c]=r,a=Fe(n,i,t,`Preview identity ${c}`,s);!["command","identityT\
|
|
456
|
+
ypes","runtimes"].includes(o)&&a.length!==1&&h(t,`Preview identity ${c} accepts exactly one value.`,s),O(e,o,a,t,s,`Prev\
|
|
457
|
+
iew identity ${c} entry`)}function nn(e,n,t){for(let[u,p]of[["command","Command"],["protocol","Protocol"],["identityType\
|
|
458
|
+
s","Identity types"]])e[u]||h(n,`Output target ${t} Preview identity needs ${p}.`,e.line);let s=e.command.map(u=>`\`${u}\
|
|
459
|
+
\``).join(" "),r=A(s,T,n,"Preview identity command",e.line);(!r[0].includes("/")||r[0].includes("\\")||r[0].split("/").some(
|
|
460
|
+
u=>!u||[".",".."].includes(u))||r.some(u=>/\{(?:host|port)\}/u.test(u)))&&h(n,"Preview identity command must use a liter\
|
|
461
|
+
al app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==se&&h(n,`Preview identity protocol must be ${se}\
|
|
462
|
+
.`,e.line);let o=[...new Set(e.identityTypes.map(u=>(Jt.has(u)||h(n,`Unsupported preview identity type: ${u}.`,e.line),u)))];
|
|
463
|
+
o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let c={enabled:Yt(e.
|
|
464
|
+
enabledEnvironment?.[0],n,"enabled",e.line),secret:Yt(e.secretEnvironment?.[0],n,"secret",e.line)};c.enabled&&c.enabled===
|
|
465
|
+
c.secret&&h(n,"Preview identity enabled and secret environment names must differ.",e.line);let a=Zt;if(e.timeoutMs){let u=e.
|
|
466
|
+
timeoutMs[0];/^[0-9]+$/u.test(u)||h(n,`Preview identity Timeout ms must be from 1 through ${me}.`,e.line),a=Number(u),(!Number.
|
|
467
|
+
isSafeInteger(a)||a<1||a>me)&&h(n,`Preview identity Timeout ms must be from 1 through ${me}.`,e.line)}return{command:r,environment:c,
|
|
468
|
+
identityTypes:o,protocol:i,runtimes:e.runtimes?N(e.runtimes.map(u=>`\`${u}\``).join(" "),T,n,"Preview identity runtimes",
|
|
469
|
+
e.line):[],timeoutMs:a}}var Js="vibe64.outputs.v1",fe="Outputs",Zs=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ke=/\{([a-z][a-z0-9:-]*)\}/gu,Qs=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
470
|
+
er=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,tr=/^#### Download `([^`\r\n]+)`$/u,nr=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
|
|
471
|
+
on=new Set(["finite","interactive"]),Ye=new Set(["development","test"]),an=new Set(["terminal","web"]),sn=16,he=e=>[...e].
|
|
472
|
+
map(n=>`\`${n}\``).join(" or "),sr=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
|
|
473
|
+
on","#### Preview identity","#### Download `id`"]),ge=Object.freeze({target:["- Default.",`- Mode: ${he(on)}`,`- Data: ${he(
|
|
474
|
+
Ye)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
|
|
475
|
+
"- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${he(an)}`,"- Preferred port: `1024` t\
|
|
476
|
+
hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:qe,download:["- Path:\
|
|
477
|
+
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function Xe(e,n,t,s){let r=v(e,T,n,t,s);return Zs.test(
|
|
478
|
+
r)||h(n,`${t} must use lowercase letters, digits, and single hyphens.`,s),r}function rr(e,n,t,s){let r=A(e,T,n,t,s);for(let i of r)
|
|
479
|
+
i.replace(Ke,"").includes("{parameter:")&&h(n,`${t} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(Ke)].some(
|
|
467
480
|
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
|
|
481
|
+
, {port}, and {parameter:id} placeholders.`,s);return r}function ir(e,n,t){return{id:Xe(e[1],n,"Output target id",t),label:v(
|
|
482
|
+
e[2],T,n,"Output target label",t),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,
|
|
483
|
+
downloads:[],parameters:[],seen:new Set,line:t}}function or(e,n,t,s){if(n==="- Required."){O(e,"required",!0,t,s,"Parame\
|
|
471
484
|
ter Required entry");return}for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(n.startsWith(
|
|
472
|
-
o)){let
|
|
473
|
-
s)}function
|
|
485
|
+
o)){let c=M(n,o,t,`Parameter ${r}`,s);O(e,i,c,t,s,`Parameter ${r} entry`);return}}h(t,D("Outputs parameter entry",n,ge.parameter),
|
|
486
|
+
s)}function ar(e,n={}){let t=e.parameters||[],s=i=>d("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!n||typeof n!="obj\
|
|
474
487
|
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
488
|
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
489
|
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
|
|
490
|
+
t, at most 4096 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function cr(e){return{kind:"",
|
|
491
|
+
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function ur(e,n,t){return{id:Xe(e[1],n,"Download id",
|
|
492
|
+
t),path:"",name:"",mediaType:"",seen:new Set,line:t}}function pr(e,n,t){/^[0-9]+$/u.test(e)||h(n,"Web presentation prefe\
|
|
480
493
|
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=M(n,"- Data: ",t,"Output target Data",s);
|
|
483
|
-
e,"dataMode",i,t,s,"output target Data entry");return}if(n==="- Default."){
|
|
484
|
-
ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);
|
|
485
|
-
Mode must be `interactive` or `finite`.",s),
|
|
486
|
-
ir: ")){
|
|
487
|
-
Workdir entry");return}if(n.startsWith("- Runtimes: ")){
|
|
494
|
+
h(n,"Web presentation preferred port must be an integer from 1024 through 65535.",t),s}function lr(e,n,t,s){if(n.startsWith(
|
|
495
|
+
"- Data: ")){let i=M(n,"- Data: ",t,"Output target Data",s);Ye.has(i)||h(t,`Output target Data must be ${he(Ye)}.`,s),O(
|
|
496
|
+
e,"dataMode",i,t,s,"output target Data entry");return}if(n==="- Default."){O(e,"default",!0,t,s,"output target Default e\
|
|
497
|
+
ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);on.has(i)||h(t,"Output target \
|
|
498
|
+
Mode must be `interactive` or `finite`.",s),O(e,"mode",i,t,s,"output target Mode entry");return}if(n.startsWith("- Workd\
|
|
499
|
+
ir: ")){O(e,"workdir",b(M(n,"- Workdir: ",t,"Output target Workdir",s),T,t,"Output target workdir",s),t,s,"output target\
|
|
500
|
+
Workdir entry");return}if(n.startsWith("- Runtimes: ")){O(e,"runtimeRequirements",N(n.slice(12),T,t,"Output target runt\
|
|
488
501
|
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:
|
|
491
|
-
label",s),argv:o,role:i});return}h(t
|
|
492
|
-
if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);
|
|
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
|
|
502
|
+
let i=r[1].toLowerCase(),o=rr(r[3],t,"Output step command",s);i!=="run"&&o.some(c=>/\{(?:host|port)\}/u.test(c))&&h(t,"O\
|
|
503
|
+
nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:v(r[2],T,t,"Output step\
|
|
504
|
+
label",s),argv:o,role:i});return}h(t,D("Outputs target entry",n,[...ge.target,...sr.slice(1)]),s)}function dr(e,n,t,s){
|
|
505
|
+
if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);an.has(r)||h(t,"Presentation Kind must be `te\
|
|
506
|
+
rminal` or `web`.",s),O(e,"kind",r,t,s,"Presentation Kind entry");return}if(n.startsWith("- Preferred port: ")){O(e,"pre\
|
|
507
|
+
ferredPort",pr(M(n,"- Preferred port: ",t,"Web presentation Preferred port",s),t,s),t,s,"Presentation Preferred port ent\
|
|
508
|
+
ry");return}if(n.startsWith("- URL path: ")){O(e,"urlPath",_e(M(n,"- URL path: ",t,"Web presentation URL path",s),T,t,"W\
|
|
509
|
+
eb presentation URL path",s),t,s,"Presentation URL path entry");return}if(n.startsWith("- Ready when: ")){O(e,"readiness",
|
|
510
|
+
ce(n,T,t,"Web presentation readiness",s),t,s,"Presentation Ready when entry");return}h(t,D("Presentation entry",n,ge.presentation),
|
|
511
|
+
s)}function mr(e,n,t){let s=v(e,T,n,"Download Name",t);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||
|
|
512
|
+
s.trim()!==s)&&h(n,"Download Name must be a safe filename without path separators.",t),s}function hr(e,n,t){let s=v(e,T,
|
|
513
|
+
n,"Download Media type",t);return(s.length>127||!nr.test(s))&&h(n,"Download Media type must be a lowercase type/subtype \
|
|
514
|
+
value.",t),s}function fr(e,n,t,s){if(n.startsWith("- Path: ")){O(e,"path",b(M(n,"- Path: ",t,"Download Path",s),T,t,"Dow\
|
|
515
|
+
nload path",s,{allowRoot:!1}),t,s,"Download Path entry");return}if(n.startsWith("- Name: ")){O(e,"name",mr(M(n,"- Name: ",
|
|
516
|
+
t,"Download Name",s),t,s),t,s,"Download Name entry");return}if(n.startsWith("- Media type: ")){O(e,"mediaType",hr(M(n,"-\
|
|
517
|
+
Media type: ",t,"Download Media type",s),t,s),t,s,"Download Media type entry");return}h(t,D("Download entry",n,ge.download),
|
|
518
|
+
s)}function gr(e,n,t){for(let[s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||h(n,`Output targe\
|
|
519
|
+
t ${t} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Er(e,n,t){
|
|
507
520
|
return e.kind||h(n,`Output target ${t} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
|
|
508
521
|
readiness||e.seen.has("urlPath"))&&h(n,`Output target ${t} terminal Presentation accepts only Kind.`,e.line),{kind:"term\
|
|
509
522
|
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
|
|
523
|
+
preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function rn(e,n){e.mode||h(n,`Output target ${e.id} needs one Mo\
|
|
511
524
|
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
|
-
run:2};for(let
|
|
513
|
-
be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:
|
|
514
|
-
id));new Set(r.map(({id:
|
|
525
|
+
run:2};for(let u=1;u<e.steps.length;u+=1)t[e.steps[u].role]<t[e.steps[u-1].role]&&h(n,`Output target ${e.id} steps must \
|
|
526
|
+
be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:u})=>u==="run"),r=e.downloads.map(u=>gr(u,n,e.
|
|
527
|
+
id));new Set(r.map(({id:u})=>u)).size!==r.length&&h(n,`Output target ${e.id} contains a duplicate Download id.`,e.line),
|
|
515
528
|
e.mode==="finite"?((s.length>0||e.presentation||e.previewIdentity)&&h(n,`Finite output target ${e.id} cannot have Run, P\
|
|
516
529
|
resentation, or Preview identity entries.`,e.line),r.length===0&&h(n,`Finite output target ${e.id} needs at least one Do\
|
|
517
530
|
wnload.`,e.line)):s.length!==1||e.steps.at(-1).role!=="run"?h(n,`Interactive output target ${e.id} needs exactly one fin\
|
|
518
531
|
al Run step.`,e.line):e.presentation||h(n,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?
|
|
519
|
-
|
|
520
|
-
"host","port"].includes(
|
|
521
|
-
let
|
|
522
|
-
arget ${e.id} may declare at most ${
|
|
523
|
-
meter:"))){let p=
|
|
524
|
-
eter:${
|
|
532
|
+
Er(e.presentation,n,e.id):null,o=e.steps.flatMap(({argv:u})=>u.flatMap(p=>[...p.matchAll(Ke)].map(m=>m[1])));o.some(u=>[
|
|
533
|
+
"host","port"].includes(u))&&i?.kind!=="web"&&h(n,"Only a web output target may use {host} or {port} placeholders.",e.line);
|
|
534
|
+
let c=e.parameters.map(({seen:u,...p})=>p),a=new Set(c.map(({id:u})=>u));(c.length>sn||a.size!==c.length)&&h(n,`Output t\
|
|
535
|
+
arget ${e.id} may declare at most ${sn} parameters with unique ids.`,e.line);for(let u of o.filter(p=>p.startsWith("para\
|
|
536
|
+
meter:"))){let p=u.slice(10);a.has(p)||h(n,`Undeclared output parameter: ${p}.`,e.line)}for(let u of c)o.includes(`param\
|
|
537
|
+
eter:${u.id}`)||h(n,`Output parameter ${u.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!==
|
|
525
538
|
"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
539
|
mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,
|
|
527
|
-
downloads:r,...
|
|
540
|
+
downloads:r,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:nn(e.previewIdentity,n,e.id)}:{}}}function Ee(e,n={}){
|
|
528
541
|
let{path:t="genesis/stack.md#Outputs"}=n;if(Array.isArray(e)||h(t,"Outputs must be supplied as exact Stack section lines\
|
|
529
|
-
."),
|
|
530
|
-
continue;let p=a+1,m=
|
|
531
|
-
begin with a Target heading.",p);let l=
|
|
532
|
-
ter label",p),default:"",description:"",required:!1,seen:new Set};r.parameters.push(g),i="parameter",o=g;continue}if(
|
|
542
|
+
."),w(e))return{version:1,targets:[]};let s=[],r=null,i="target",o=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)
|
|
543
|
+
continue;let p=a+1,m=u.match(Qs);if(m){r&&s.push(rn(r,t)),r=ir(m,t,p),i="target",o=null;continue}r||h(t,"## Outputs must\
|
|
544
|
+
begin with a Target heading.",p);let l=u.match(er);if(l){let g={id:Xe(l[1],t,"Parameter id",p),label:v(l[2],T,t,"Parame\
|
|
545
|
+
ter label",p),default:"",description:"",required:!1,seen:new Set};r.parameters.push(g),i="parameter",o=g;continue}if(u===
|
|
533
546
|
"#### 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=
|
|
537
|
-
resentation"?
|
|
538
|
-
0&&h(t,"## Outputs needs at least one Target or exactly `- Nothing.`.");let
|
|
539
|
-
|
|
540
|
-
t most one default target."),{version:1,targets:s}}function
|
|
541
|
-
isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:[]).map((
|
|
542
|
-
length?r[a].join(" and "):String(
|
|
547
|
+
cr(p),i="presentation",o=r.presentation;continue}if(u==="#### Preview identity"){r.previewIdentity&&h(t,"Preview identit\
|
|
548
|
+
y must appear at most once below an output target.",p),r.previewIdentity=en(p),i="previewIdentity",o=r.previewIdentity;continue}
|
|
549
|
+
let f=u.match(tr);if(f){let g=ur(f,t,p);r.downloads.push(g),i="download",o=g;continue}i==="parameter"?or(o,u,t,p):i==="p\
|
|
550
|
+
resentation"?dr(o,u,t,p):i==="previewIdentity"?tn(o,u,t,p):i==="download"?fr(o,u,t,p):lr(r,u,t,p)}r&&s.push(rn(r,t)),s.length===
|
|
551
|
+
0&&h(t,"## Outputs needs at least one Target or exactly `- Nothing.`.");let c=s.map(({id:a})=>a);return new Set(c).size!==
|
|
552
|
+
c.length&&h(t,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(t,"Outputs may declare a\
|
|
553
|
+
t most one default target."),{version:1,targets:s}}function yr(e,n={}){let{resourcesPreparing:t=!1}=n,s=e.details||{},r=Array.
|
|
554
|
+
isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:[]).map((c,a)=>Array.isArray(r[a])&&r[a].
|
|
555
|
+
length?r[a].join(" and "):String(c)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!i.length)return e.message;let o=String(
|
|
543
556
|
s.resource||"").trim()||"resources";return t?`Vibe64 is still setting up this app's ${o}. Preview can start when workspa\
|
|
544
557
|
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
|
|
558
|
+
Env (in Dash, under Development), then press Check again.`}function cn({environment:e={},section:n={},resourcesPreparing:t=!1}={}){
|
|
546
559
|
H(n,e,"Outputs section");let s=[...n.diagnostics||[]],r=[...e.diagnostics||[]],i={version:1,targets:[]};n.status==="read\
|
|
547
|
-
y"&&(i=
|
|
548
|
-
p=>({...p,source:n.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],
|
|
549
|
-
length>0?
|
|
550
|
-
[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:z(
|
|
551
|
-
resources:structuredClone(e.resources||[]),targets:
|
|
552
|
-
t services",
|
|
553
|
-
if(Array.isArray(e)||d(J,Z,"Expected exact Project services section lines."),
|
|
560
|
+
y"&&(i=Ee(n.lines));let o=r.length===0?null:[...new Set(r.map(p=>yr(p,{resourcesPreparing:t})))].join(" "),c=i.targets.map(
|
|
561
|
+
p=>({...p,source:n.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],u="ready";return a.
|
|
562
|
+
length>0?u="blocked":c.length===0&&(u="unconfigured"),{contract:Js,status:u,stackHash:n.stackHash,components:[...n.components||
|
|
563
|
+
[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:z(c.flatMap(p=>p.runtimeRequirements)),
|
|
564
|
+
resources:structuredClone(e.resources||[]),targets:c,diagnostics:a}}var un="Project services",br="vibe64.project-services.v1",J="VIBE64_PROJECT_SERVICES_INVALID",Z="genesis/stack.md#Projec\
|
|
565
|
+
t services",vr="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function pn(e){
|
|
566
|
+
if(Array.isArray(e)||d(J,Z,"Expected exact Project services section lines."),w(e))return[];let n=[];for(let[t,s]of e.entries()){
|
|
554
567
|
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(
|
|
562
|
-
setup must be supplied as exact Stack section lines."),
|
|
563
|
-
if(!i)continue;let o=r+1,
|
|
564
|
-
|
|
565
|
-
0&&
|
|
566
|
-
|
|
567
|
-
let t=[...n.diagnostics||[]],s=[];n.status==="ready"&&(s=
|
|
568
|
-
if(!l.condition||await
|
|
568
|
+
o||d(J,Z,`Use: ${vr}`,i),n.some(({id:a})=>a===o[1])&&d(J,Z,"Duplicate project service id.",i);let c=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
|
|
569
|
+
n.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:N(c?c[1]:o[3],J,Z,"Service runtimes",i),workdir:b(c?.[2]||
|
|
570
|
+
".",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\
|
|
571
|
+
`- Nothing.`."),n}function ln(e={}){let n=e.status==="ready"?pn(e.lines):[];return{contract:br,status:e.status==="block\
|
|
572
|
+
ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?R(n):"",diagnostics:e.diagnostics||[]}}import{access as wr}from"node:fs/promises";import mn from"node:path";var Sr="vibe64.workspace-setup.v1",re="Workspace setup",Ze="VIBE64_WORKSPACE_SETUP_INVALID",dn="- Prepare `label` with `\
|
|
573
|
+
runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",Ir=/^- Prepare `([^`\r\n]+)` (.+)$/u;function Je(e,n,t,s={}){
|
|
574
|
+
d(Ze,e,n,t,s)}function ye(e,n={}){let{path:t="genesis/stack.md#Workspace setup"}=n;if(Array.isArray(e)||Je(t,"Workspace \
|
|
575
|
+
setup must be supplied as exact Stack section lines."),w(e))return[];let s=[];for(let r=0;r<e.length;r+=1){let i=e[r].trim();
|
|
576
|
+
if(!i)continue;let o=r+1,c=i.match(Ir);c||Je(t,`Every Workspace setup entry must use: ${dn}`,o,{observed:i}),s.push({label:v(
|
|
577
|
+
c[1],Ze,t,"Workspace setup step label",o),...ue(c[2],Ze,t,"Workspace setup",o,{form:dn,observed:i})})}return s.length===
|
|
578
|
+
0&&Je(t,"## Workspace setup needs at least one Prepare entry or exactly `- Nothing.`."),s}async function Tr(e,n){try{return await wr(
|
|
579
|
+
mn.join(e,n)),!0}catch(t){if(["ENOENT","ENOTDIR"].includes(t?.code))return!1;throw t}}async function hn({projectRoot:e,section:n={}}={}){
|
|
580
|
+
let t=[...n.diagnostics||[]],s=[];n.status==="ready"&&(s=ye(n.lines));let r=[],i=[],o=mn.resolve(e);if(t.length===0)for(let l of s){
|
|
581
|
+
if(!l.condition||await Tr(o,l.condition.pathExists)){r.push(l);continue}l.condition.onMissing==="wait"&&i.push(l.condition.
|
|
569
582
|
pathExists)}if(i.length>0){let l=z(i);t.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting \
|
|
570
|
-
for project ${l.length===1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let
|
|
571
|
-
ORKSPACE_SETUP_WAITING"),a=t.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),
|
|
572
|
-
length>0&&(
|
|
573
|
-
stackHash,recipeHash:
|
|
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 G(e,n,t){d(
|
|
577
|
-
e,n,t)}function
|
|
578
|
-
quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function
|
|
583
|
+
for project ${l.length===1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let c=t.some(({code:l})=>l==="VIBE64_W\
|
|
584
|
+
ORKSPACE_SETUP_WAITING"),a=t.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),u="unconfigured";a?u="blocked":!c&&r.
|
|
585
|
+
length>0&&(u="ready");let p=r.map(({condition:l,...f})=>f),m={version:1,steps:p};return{contract:Sr,status:u,stackHash:n.
|
|
586
|
+
stackHash,recipeHash:u==="ready"?R(m):"",components:[...n.components||[]],source:n.source||null,runtimeRequirements:z(p.
|
|
587
|
+
flatMap(l=>l.runtimeRequirements)),steps:p,diagnostics:t}}var kr="vibe64.resource-estimates.v1",be="Resource estimates",En="VIBE64_RESOURCE_ESTIMATES_INVALID",_r=1024*1024,fn=1024*
|
|
588
|
+
1024,gn=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
|
|
589
|
+
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,n,t){d(En,
|
|
590
|
+
e,n,t)}function Qe(e,n,t,s,r){let i=e.get(n),o=e.get(t);return(i===void 0||o===void 0||i>o)&&G(s,"Each resource phase re\
|
|
591
|
+
quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function yn(e,n={}){
|
|
579
592
|
let{path:t="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:r=!1}=n;(!Array.isArray(e)||e.length>2048||
|
|
580
593
|
e.some(p=>typeof p!="string")||Buffer.byteLength(e.join(`
|
|
581
594
|
`),"utf8")>64*1024)&&G(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let i={version:1,
|
|
582
|
-
outputs:[],workspaceSetup:null};if(
|
|
595
|
+
outputs:[],workspaceSetup:null};if(w(e))return i;let o=new Map(s.map(p=>[p.id,p])),c=new Set,a=null;function u(){if(!a)return;
|
|
583
596
|
let{targetId:p,mode:m,fields:l,line:f}=a;if(m==="interactive"){(l.has("typical")||l.has("high"))&&G(t,"Interactive outpu\
|
|
584
|
-
ts require separate Startup and Running estimates.",f),i.outputs.push({targetId:p,mode:m,startup:
|
|
585
|
-
startupHigh",t,f),running:
|
|
586
|
-
G(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",f);let g=
|
|
597
|
+
ts require separate Startup and Running estimates.",f),i.outputs.push({targetId:p,mode:m,startup:Qe(l,"startupTypical","\
|
|
598
|
+
startupHigh",t,f),running:Qe(l,"runningTypical","runningHigh",t,f)});return}(l.size!==2||!l.has("typical")||!l.has("high"))&&
|
|
599
|
+
G(t,"Finite outputs and Workspace setup require only Typical MiB and High MiB.",f);let g=Qe(l,"typical","high",t,f);p?i.
|
|
587
600
|
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
|
-
continue;let f=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(f||m==="### Workspace setup"){
|
|
589
|
-
"",Y=P?`output:${P}`:"workspace-setup";
|
|
601
|
+
continue;let f=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(f||m==="### Workspace setup"){u();let P=f?.[1]||
|
|
602
|
+
"",Y=P?`output:${P}`:"workspace-setup";c.has(Y)&&G(t,"Resource estimates contains a duplicate operation.",l),c.add(Y);let Q=o.
|
|
590
603
|
get(P);P&&!["interactive","finite"].includes(Q?.mode)&&G(t,`Resource estimate references an undeclared output: ${P}.`,l),
|
|
591
604
|
!P&&!r&&G(t,"Resource estimate references undeclared Workspace setup steps.",l),a={targetId:P,mode:Q?.mode||"setup",fields:new Map,
|
|
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
|
|
605
|
+
line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),S=g&&gn.get(g[1]);(!a||!S)&&G(t,`Expected an Output\
|
|
606
|
+
or Workspace setup heading followed by positive integer MiB estimates: ${[...gn.keys()].map(P=>`- ${P}: \`number\``).join(
|
|
607
|
+
"; ")}.`,l),a.fields.has(S)&&G(t,`Duplicate resource field: ${g[1]}.`,l);let _=Number(g[2]);(!Number.isSafeInteger(_)||_>
|
|
608
|
+
fn)&&G(t,`Resource estimates must be between 1 and ${fn} MiB.`,l),a.fields.set(S,_*_r)}return u(),c.size===0&&G(t,"Resou\
|
|
609
|
+
rce estimates needs an operation or exactly `- Nothing.`."),i}function ve({section:e={},outputsSection:n={},workspaceSetupSection:t={}}={}){
|
|
597
610
|
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
|
-
|
|
611
|
+
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=yn(e.lines,{targets:n.status==="read\
|
|
612
|
+
y"?Ee(n.lines).targets:[],hasWorkspaceSetup:t.status==="ready"&&ye(t.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
|
|
613
|
+
kOperationError")throw o;s.push({code:En,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"i\
|
|
614
|
+
nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:kr,status:i,stackHash:e.stackHash,sectionHash:e.
|
|
615
|
+
sectionHash||"",estimatesHash:i==="ready"?R(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
|
|
616
|
+
fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var Or="vibe64.integration-setup.v1",bn="Integration setup",ie="VIBE64_INTEGRATION_SETUP_INVALID",Rr="- Command with `ru\
|
|
617
|
+
ntime` in `workdir`: `command` `argument`...";function vn(e,n={}){let{path:t="genesis/stack.md#Integration setup"}=n;if(Array.
|
|
618
|
+
isArray(e)||d(ie,t,"Integration setup requires exact Stack section lines."),w(e))return null;let s=e.map(i=>i.trim()).filter(
|
|
619
|
+
Boolean),r=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return r||d(ie,t,`Integration setu\
|
|
620
|
+
p requires exactly one entry: ${Rr}; or - Nothing.`),{argv:A(r[3],ie,t,"Integration setup command"),workdir:b(r[2],ie,t,
|
|
621
|
+
"Integration setup workdir"),runtimeRequirements:N(r[1],ie,t,"Integration setup runtimes")}}function wn({section:e={}}={}){
|
|
622
|
+
let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?vn(e.lines):null;return{contract:Or,status:n.length?"blo\
|
|
623
|
+
cked":t?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:t?R({version:1,command:t}):"",source:e.source||null,components:[
|
|
624
|
+
...e.components||[]],command:t,diagnostics:n}}var Ar=new URL("./index.js",import.meta.url).href,Tn=Cr(Ar),we=new Map;async function Pr(e){if(!B.isAbsolute(e||""))throw new TypeError(
|
|
625
|
+
"Genesis host context requires an absolute runtime root.");let n=B.join(e,"genesis-context");if(!we.has(n)){let t=Nt(n).
|
|
626
|
+
catch(s=>{throw we.delete(n),s});we.set(n,t)}return we.get(n)}var{GENESIS_CONTRACTS:C,HOST_CONTEXT_RESOLVER_DATA_ENV:Dr,
|
|
627
|
+
HOST_CONTEXT_RESOLVER_ENV:$r,addStack:Vr,applyTemplate:xr,generatePrompt:jr,indexCodebase:Lr,initialize:Mr,inspectCollaboration:Gr,
|
|
628
|
+
inspectDerivedArtifacts:Ur,inspectEngineering:Br,inspectEnvironment:Se,inspectProject:Wr,inspectProjectFormat:Hr,inspectAgentIntegrations:zr,
|
|
629
|
+
inspectSkills:Fr,inspectStackSection:qr,inspectStackSections:Kr,inspectSubsystems:Yr,listTemplates:Xr,parserEnvironment:$o,
|
|
630
|
+
setCollaboration:Jr,setEngineeringProfile:Zr,syncAgentIntegrations:Qr,syncSkills:ei,withTrustedGitRepository:ti,SOURCE_EXPLANATION_PROMPT_VERSION:Vo,
|
|
631
|
+
sourceExplanationGuidance:xo,validateArchitectureFacts:jo,mergeArchitectureObservations:Lo,validateCityDocument:Mo,validateCallWeb:Go,
|
|
632
|
+
CALL_WEB_SCHEMA:Uo,MACHINE_CITY_SCHEMA:Bo,PROGRAM_CITY_SCHEMA:Wo,CITY_SCHEMA_VERSION:Ho}=oe;async function zo(e){let n=await Pr(
|
|
633
|
+
e);return{[$r]:ci(),[Dr]:JSON.stringify({registryPath:n.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var Fo="genesis\
|
|
634
|
+
/blueprint.md",qo="genesis/subsystems.md",ni=Object.freeze(["vue","django-postgresql","jskit-postgresql","postgresql","r\
|
|
635
|
+
ails-postgresql","spring-boot-postgresql"]),si=Object.freeze(["genesis-stack"]),In=Object.freeze({BLUEPRINT_INVALID:"blu\
|
|
636
|
+
eprint",BLUEPRINT_REQUIRED:"start"}),kn=new Set(["adopt","blueprint","describe","deslop","program","review","start","ui-\
|
|
637
|
+
pass","work"]),et=15e3;function tt(e,n=et){let t,s=new Promise((r,i)=>{t=setTimeout(()=>i(Object.assign(new Error(`Genes\
|
|
638
|
+
is did not answer within ${n} ms.`),{code:"vibe64_genesis_timeout"})),n)});return Promise.race([Promise.resolve().then(e),
|
|
639
|
+
s]).finally(()=>clearTimeout(t))}function ri(e,n={}){let{required:t=!1}=n,s=x(e);if(!s&&!t)return"";if(!kn.has(s))throw new TypeError(
|
|
640
|
+
s?`Unknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an explicit task.");return s}function ii(e={}){return ri(
|
|
641
|
+
e.genesisTask)||"work"}function oi(e={},n={}){return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,n.label].
|
|
642
|
+
map(x).find(Boolean)||"Continue the requested project work."}function ai(){let e=(Tn.resolve.paths("genesis-compiler")||
|
|
643
|
+
[]).find(n=>Sn(B.join(n,"genesis-compiler"))&&Sn(B.join(n,".bin","genesis")));if(!e)throw new Error("The installed Genes\
|
|
644
|
+
is compiler executable could not be located.");return B.join(e,".bin")}function _n(){let e=Tn.resolve("@local/vibe64-gen\
|
|
645
|
+
esis/server");return B.resolve(B.dirname(e),"../../bin")}function ci(){return B.resolve(_n(),"vibe64-genesis-host-contex\
|
|
646
|
+
t")}function Ko(e=[]){let n=_n(),t=ai();return[...(Array.isArray(e)?e:[]).filter(r=>![n,t].includes(x(r))),n]}function ui(e={},n={}){
|
|
647
|
+
let{prompt:t=!1}=n;return{...e,...t?{hiddenStackPieces:ni}:{},stackPackages:si}}function Yo(e={}){return W(Vr,e)}function Xo(e={}){
|
|
648
|
+
return W(Mr,e)}function Jo(e={}){return te(Fr,e)}function Zo(e={}){return W(ei,e)}function Qo(e={}){return W(Qr,e)}function ea(e={}){
|
|
649
|
+
return te(zr,e)}function ta(e={}){return te(Yr,e)}async function na(e={}){return vt(await K(ft,e))}async function sa(e={}){
|
|
650
|
+
return It(await K(wt,e))}function ra(e={}){return W(Lr,e)}function pi(){let e=Ur();if(e?.contract!==C.derivedArtifacts)throw new Error(
|
|
651
|
+
`Genesis returned ${e?.contract||"no contract identity"}; expected ${C.derivedArtifacts}.`);let n=Array.isArray(e.artifacts)?
|
|
652
|
+
e.artifacts:[];if(!n.length||n.some(t=>!x(t?.path)))throw new Error("Genesis returned an invalid derived-artifact contra\
|
|
653
|
+
ct.");return{...e,artifacts:n.map(t=>({...t}))}}var On=pi(),ia=Object.freeze(On.artifacts.map(e=>e.path)),nt=new Map(On.
|
|
654
|
+
artifacts.map(e=>[e.id,e])),li=nt.get("machine-city")?.path,di=nt.get("program-city")?.path;if(!li||!di)throw new Error(
|
|
655
|
+
"Genesis did not declare both City projection artifacts.");var mi=nt.get("call-web")?.path;if(!mi)throw new Error("Genes\
|
|
656
|
+
is did not declare its call-web artifact.");async function W(e,n={},t={}){let s=x(n.projectRoot);if(!s||!B.isAbsolute(s))
|
|
657
|
+
throw new TypeError("Genesis operations require an explicit absolute projectRoot.");return ti(s,()=>e(ui(n,t)))}function Rn(){}
|
|
658
|
+
function hi(e){return`Genesis project guidance is unavailable for this conversation (${x(e?.message||e).replace(/\s+/gu,
|
|
659
|
+
" ").slice(0,300)||"no reason given"}). Work from the repository itself, where the genesis/ files still describe the pro\
|
|
660
|
+
ject when present, and tell the user that Genesis guidance did not load if it matters to the request.`}async function oa({
|
|
661
|
+
workdir:e,promptContext:n},{onGenesisUnavailable:t=Rn,timeoutMs:s=et}={}){let r=ee(n);if(n.scope==="ephemeral")return r;
|
|
662
|
+
let i;try{let o=await tt(()=>W(oe.projectSessionContext,{projectRoot:e,hostDriver:ee,hostDriverInput:n}),s);if(typeof o?.
|
|
663
|
+
output=="string"&&o.output.trim())return o.output;i=new Error("Genesis returned no session guidance.")}catch(o){i=o}return t(
|
|
664
|
+
i),`${hi(i)}
|
|
665
|
+
|
|
666
|
+
${r}`}function te(e,n={}){return tt(()=>W(e,n))}function An(e,n){if(e?.contract!==n)throw new Error(`Genesis returned ${e?.
|
|
667
|
+
contract||"no contract identity"}; expected ${n}.`);return e}async function F(e,n,t={}){return An(await te(e,t),n)}async function st(e,n,t={}){
|
|
668
|
+
return An(await W(e,t),n)}function K(e,n={}){return F(t=>qr({...t,name:e}),C.stackSection,n)}async function rt(e,n={}){let t=await te(
|
|
669
|
+
s=>Kr({...s,names:e}),n);if(!Array.isArray(t)||t.length!==e.length||t.some((s,r)=>s?.contract!==C.stackSection||s.name!==
|
|
670
|
+
e[r]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return t}async function aa(e={}){if((await fi(
|
|
671
|
+
e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its Stack can be\
|
|
672
|
+
inspected."),{code:"vibe64_stack_format_required"});await Nr(B.join(e.projectRoot,Ce),"utf8");let t=await K(re,e);return{
|
|
673
|
+
components:t.components,stackHash:t.stackHash}}async function ca(e={}){let[n,t]=await Promise.all([K(Pt,e),F(Se,C.environment,
|
|
674
|
+
e)]);return jt({environment:t,section:n})}async function ua(e={}){let[n,t]=await Promise.all([K(Wt,e),F(Se,C.environment,
|
|
675
|
+
e)]);return Kt({environment:t,section:n})}function pa(e={}){return W(oe.verify,e)}function la(e={}){return F(Se,C.environment,
|
|
676
|
+
e)}function da(e={}){return F(Wr,C.projectInspection,e)}function ma(e={}){return F(Xr,C.templates,e)}function ha(e={}){return st(
|
|
677
|
+
xr,C.templateApplication,e)}function fa(e={}){return F(Br,C.engineering,e)}function ga(e={}){return F(Gr,C.collaboration,
|
|
678
|
+
e)}async function fi(e={}){let n=await te(Hr,e);if(!x(n?.status))throw new Error("Genesis did not return a project-forma\
|
|
679
|
+
t status.");return{...n}}function Ea(e={}){return st(Zr,C.engineering,e)}function ya(e={}){return st(Jr,C.collaboration,
|
|
680
|
+
e)}async function ba({resourcesPreparing:e=!1,...n}={}){let[[t,s,r],i]=await Promise.all([rt([fe,be,re],n),F(Se,C.environment,
|
|
681
|
+
n)]);return{...cn({environment:i,section:t,resourcesPreparing:e===!0}),resourceEstimates:ve({section:s,outputsSection:t,
|
|
682
|
+
workspaceSetupSection:r})}}async function va(e={}){let n=await K(bn,e);return wn({section:n})}async function wa(e={}){return lt(
|
|
683
|
+
await K(ut,e))}async function Sa(e={}){return ln(await K(un,e))}async function Ia(e={}){let[n,t,s]=await rt([re,be,fe],e);
|
|
684
|
+
return{...await hn({projectRoot:e.projectRoot,section:n}),resourceEstimates:ve({section:t,outputsSection:s,workspaceSetupSection:n})}}
|
|
685
|
+
async function Ta(e={}){let[n,t,s]=await rt([be,fe,re],e);return ve({section:n,outputsSection:t,workspaceSetupSection:s})}
|
|
686
|
+
async function ka({action:e={},environment:n,input:t={},onGenesisUnavailable:s=Rn,projectRoot:r,timeoutMs:i=et}){let o=ii(
|
|
687
|
+
e),c=oi(t,e),a=g=>W(jr,{environment:n,projectRoot:r,request:c,sessionContextInstalled:!0,task:g},{prompt:!0}),u=async()=>{
|
|
688
|
+
try{return{result:await a(o),task:o}}catch(g){let S=Object.hasOwn(In,String(g?.code))?In[g.code]:"";if(!S||S===o||t.automaticGenesisTask===
|
|
689
|
+
!0)throw g;return{result:await a(S),task:S}}},p;try{if(p=await tt(u,i),typeof p.result?.prompt!="string"||!p.result.prompt.
|
|
690
|
+
trim())throw new Error("Genesis returned no prompt.")}catch(g){return s(g),{prompt:c}}let{result:m,task:l}=p,f=kn.has(x(
|
|
691
|
+
m.task))?x(m.task):l;return{context:{genesis:!0,requestedTask:o,task:f,verificationCommands:m.verificationCommands,warnings:m.
|
|
692
|
+
warnings},originalPrompt:c,prompt:m.prompt,promptId:x(e.promptId||e.id)||f}}export{Uo as CALL_WEB_SCHEMA,Ho as CITY_SCHEMA_VERSION,Fo as GENESIS_BLUEPRINT_PATH,mi as GENESIS_CALL_WEB_PATH,ia as GENESIS_DERIVED_ARTIFACT_PATHS,
|
|
693
|
+
li as GENESIS_MACHINE_CITY_PATH,di as GENESIS_PROGRAM_CITY_PATH,Ce as GENESIS_STACK_PATH,Tt as GENESIS_STACK_SECTION_AMBIGUOUS,
|
|
694
|
+
qo as GENESIS_SUBSYSTEMS_PATH,et as GENESIS_USER_PATH_TIMEOUT_MS,Bo as MACHINE_CITY_SCHEMA,Wo as PROGRAM_CITY_SCHEMA,Vo as SOURCE_EXPLANATION_PROMPT_VERSION,
|
|
695
|
+
Ct as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,de as VIBE64_PACKAGING_CONTRACT,se as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,
|
|
696
|
+
Yo as addGenesisStack,ha as applyGenesisTemplate,ri as assertGenesisPromptTask,_n as genesisCommandShimDirectory,ai as genesisPackageBinDirectory,
|
|
697
|
+
$o as genesisParserEnvironment,is as genesisProjectContractNeedsAttention,cs as genesisProjectFileDiagnostic,as as genesisProjectFileUnreadable,
|
|
698
|
+
oi as genesisPromptRequest,ii as genesisPromptTask,Xo as initializeGenesisProject,ea as inspectGenesisAgentIntegrations,
|
|
699
|
+
ga as inspectGenesisCollaboration,pi as inspectGenesisDerivedArtifacts,fa as inspectGenesisEngineering,la as inspectGenesisEnvironment,
|
|
700
|
+
da as inspectGenesisProject,fi as inspectGenesisProjectFormat,Jo as inspectGenesisSkills,aa as inspectGenesisStackComponents,
|
|
701
|
+
ta as inspectGenesisSubsystems,na as inspectVibe64ArchitectureInspection,sa as inspectVibe64ArchitectureLayout,wa as inspectVibe64ConnectedDevelopment,
|
|
702
|
+
ca as inspectVibe64Deployment,va as inspectVibe64IntegrationSetup,ba as inspectVibe64Outputs,ua as inspectVibe64Packaging,
|
|
703
|
+
Sa as inspectVibe64ProjectServices,Ta as inspectVibe64ResourceEstimates,Ia as inspectVibe64WorkspaceSetup,ma as listGenesisTemplates,
|
|
704
|
+
Lo as mergeArchitectureObservations,xt as parseVibe64DeploymentLines,vn as parseVibe64IntegrationSetupLines,Ee as parseVibe64OutputsLines,
|
|
705
|
+
Ft as parseVibe64PackagingLines,pn as parseVibe64ProjectServicesLines,yn as parseVibe64ResourceEstimatesLines,ye as parseVibe64WorkspaceSetupLines,
|
|
706
|
+
ts as readArchitecturePreviewLocator,ra as refreshGenesisCities,ka as renderGenesisPrompt,ar as resolveVibe64OutputParameters,
|
|
707
|
+
qt as resolveVibe64PackagingEnvironment,ya as setGenesisCollaboration,Ea as setGenesisEngineeringProfile,xo as sourceExplanationGuidance,
|
|
708
|
+
Qo as syncGenesisAgentIntegrations,Zo as syncGenesisSkills,jo as validateArchitectureFacts,Go as validateCallWeb,Mo as validateCityDocument,
|
|
709
|
+
pa as verifyGenesisProject,oa as vibe64ConversationInstructions,ee as vibe64Driver,zo as vibe64HostContextEnvironment,Pr as vibe64HostContextRegistry,
|
|
710
|
+
ci as vibe64HostContextResolverPath,Ko as withGenesisCommandShim,tt as withinGenesisDeadline};
|