vibe64 0.1.60 → 0.1.62
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 +549 -547
- package/bin/upgrade-state.js +113 -105
- package/dist/assets/{GithubBrowserTabs-Vv-64NIg.js → GithubBrowserTabs-BJ2NXiuQ.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-rolg-sXl.js → LocalDatabaseServer-Z5VQcWgu.js} +1 -1
- package/dist/assets/{SelectField-DwWoHC2p.js → SelectField-RGWl_ms9.js} +1 -1
- package/dist/assets/{ShellOutlet-Clsh2qYP.js → ShellOutlet-CdjsJfg9.js} +1 -1
- package/dist/assets/VAutocomplete-BnpXAJGa.js +1 -0
- package/dist/assets/{VCheckbox-B40zJSbZ.js → VCheckbox-BK0ss4F4.js} +1 -1
- package/dist/assets/{VCheckboxBtn-6ebHAnh9.js → VCheckboxBtn-DDlYJnth.js} +1 -1
- package/dist/assets/{VDialog-B2W9wqR8.js → VDialog-BCIrX462.js} +1 -1
- package/dist/assets/VMenu-Bql3E6DV.js +1 -0
- package/dist/assets/VMenu-DCU7zd0B.css +1 -0
- package/dist/assets/VOverlay-EPzW7eVB.js +1 -0
- package/dist/assets/{VRadioGroup-D1duMMwJ.js → VRadioGroup-CL3HTmyT.js} +1 -1
- package/dist/assets/VSelect-Ch00dyiM.js +1 -0
- package/dist/assets/VSkeletonLoader-Bl9P5wdh.js +1 -0
- package/dist/assets/VSkeletonLoader-DXZarZ9m.css +1 -0
- package/dist/assets/{VSwitch-DUkp5sfW.js → VSwitch-DftK1EyR.js} +1 -1
- package/dist/assets/{VTextField-BMvaWVTN.js → VTextField-B9R7EIjg.js} +1 -1
- package/dist/assets/{VTextarea-CLaWcpd_.js → VTextarea-CMgyRNk-.js} +1 -1
- package/dist/assets/{Vibe64AsyncModuleState-C9rLM2H0.js → Vibe64AsyncModuleState-9bN0_H45.js} +1 -1
- package/dist/assets/Vibe64AuthSettingsButton-B4FbKoV7.js +5 -0
- package/dist/assets/{Vibe64AuthSettingsButton-DbL7Ukry.css → Vibe64AuthSettingsButton-DFfFPrd7.css} +1 -1
- package/dist/assets/{Vibe64ConversationLog-K6aUo3q1.js → Vibe64ConversationLog-Dk2jeU21.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-C_wkAaSb.js → Vibe64DashboardShell-BGE8m2VG.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-Dy88t2ZX.js → Vibe64DatabaseWorkspace-BrB-0zdd.js} +1 -1
- package/dist/assets/Vibe64DestinationButton-CdyyK9tj.js +1 -0
- package/dist/assets/Vibe64DestinationButton-ZxY1Lwie.css +1 -0
- package/dist/assets/Vibe64FileArea-B8_Tqtgv.js +1 -0
- package/dist/assets/Vibe64OutputControls-JHBVJBQ4.js +8 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-CWw4w5SA.js → Vibe64RepositoryWorkspace-DFuF1aDy.js} +1 -1
- package/dist/assets/Vibe64SessionFiles-Ih3aXiKq.js +1 -0
- package/dist/assets/{Vibe64SessionSourceEditor-BVfoXgmZ.js → Vibe64SessionSourceEditor-EUExI1YB.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView-BYLWabXY.css → Vibe64UiStoryboardView-DqLN6ofL.css} +1 -1
- package/dist/assets/Vibe64UiStoryboardView-DrE3Dqjr.js +8 -0
- package/dist/assets/{Vibe64UnavailableSessions-BRB2bUR_.js → Vibe64UnavailableSessions-CCWWp2-Y.js} +1 -1
- package/dist/assets/_pageId_-JF3VAGm5.js +1 -0
- package/dist/assets/_sessionId_-7PyIUeUr.css +1 -0
- package/dist/assets/_sessionId_-DzhYkoTF.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_-C5yeqlpL.js → _slug_-CK9TQknP.js} +6 -6
- package/dist/assets/_slug_-CZmGS16g.css +1 -0
- package/dist/assets/access-BOqP7tK6.js +1 -0
- package/dist/assets/{app-BKwP6m9e.js → app-C9NRUu1x.js} +1 -1
- package/dist/assets/{changes-DT8e3wYn.js → changes-Df2TTLEm.js} +1 -1
- package/dist/assets/{client-CUQfIUus.css → client-BBJzQIWS.css} +1 -1
- package/dist/assets/{client-B_iZQVU8.js → client-BRcncaFt.js} +1 -1
- package/dist/assets/client-Bkk7jZD9.js +1 -0
- package/dist/assets/{client-Cf6iimPy.js → client-BzNAjCJm.js} +2 -2
- package/dist/assets/{client-BHa4BumO.js → client-CiGvH-QO.js} +2 -2
- package/dist/assets/client-DdNHOrl8.js +2 -0
- package/dist/assets/conversation-D7T_us2O.js +1 -0
- package/dist/assets/{conversation-DA_fbJJD.css → conversation-ZN3-8jbz.css} +1 -1
- package/dist/assets/{conversation-CsB1b1JZ.js → conversation-wiDH8Ni4.js} +4 -4
- package/dist/assets/{dashboard-DRwBugiR.js → dashboard-Dt57zpvc.js} +1 -1
- package/dist/assets/{english-definitions-Bi3yaDu7.js → english-definitions-C0n2xolE.js} +1 -1
- package/dist/assets/env-CIJebqCq.js +1 -0
- 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/{fileTypes-DRyfajWx.js → fileTypes-2k5HCkMT.js} +1 -1
- package/dist/assets/health-B9ZoQC78.js +1 -0
- package/dist/assets/history-DqtrCyKI.js +1 -0
- package/dist/assets/{i18n-B5lc019_.js → i18n-Dm74yE_M.js} +1 -1
- package/dist/assets/{index-Wcdz2Rey.js → index-tPEeYKmw.js} +5 -5
- package/dist/assets/{integrations-BHURBo17.js → integrations-BST4Qw-s.js} +11 -4
- package/dist/assets/{integrations-Bo_beIy3.css → integrations-CwgrZgmM.css} +1 -1
- package/dist/assets/issues-CN8brLcd.js +1 -0
- package/dist/assets/issues-D46llNv-.css +1 -0
- package/dist/assets/{learning-BrBAyLFt.js → learning-B8e42exz.js} +1 -1
- package/dist/assets/{pages-BTk_FkDr.js → pages-DWmGyVcJ.js} +1 -1
- package/dist/assets/{project-files-CTGwnBh7.js → project-files-CiFrH7b9.js} +1 -1
- package/dist/assets/publish-D1Cm9dcY.js +3 -0
- package/dist/assets/pull-requests-DtqrTix0.css +1 -0
- package/dist/assets/pull-requests-ujRUy7Rf.js +1 -0
- package/dist/assets/{repository-DknGo0hr.js → repository-v-kDk9e_.js} +1 -1
- package/dist/assets/settings-CMMTWcem.js +1 -0
- package/dist/assets/thinkingText-mMYz6e03.js +8 -0
- package/dist/assets/{useArchivedVibe64Sessions-DI9ow2ds.js → useArchivedVibe64Sessions-C3w4gzum.js} +1 -1
- package/dist/assets/useAssistantAttachments-BkYZckgz.js +2 -0
- package/dist/assets/{useCommand-YOAaO5Wz.js → useCommand-CNDe8gM-.js} +1 -1
- package/dist/assets/{useUiFeedback-Bixow9mW.js → useUiFeedback-CWb6o71Z.js} +1 -1
- package/dist/assets/useVibe64ConversationLog-BfW5VQBw.js +2 -0
- package/dist/assets/{useVibe64Learning-RE4HXHqo.js → useVibe64Learning-DiLAIKbI.js} +1 -1
- package/dist/assets/{useVibe64SessionData-Df7M5k1M.js → useVibe64SessionData-BZUDqDiW.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-B0USk6X6.js → useVibe64SessionSelection-ChkFsI6Y.js} +1 -1
- package/dist/assets/vibe64RepositoryRealtime-BamEfp1M.js +1 -0
- package/dist/assets/{vibe64RepositoryRealtime-ByZfq2fE.css → vibe64RepositoryRealtime-rnWlv9jw.css} +1 -1
- package/dist/assets/vibe64SessionFocus-BCojr4E-.css +1 -0
- package/dist/assets/vibe64SessionFocus-CfH5XqgI.js +1 -0
- package/dist/index.html +28 -32
- package/docs/colleague-usage/ai-tasks.md +3 -1
- package/docs/colleague-usage/auto-workflow.md +6 -3
- package/docs/colleague-usage/back-navigation.md +16 -13
- package/docs/colleague-usage/chat-settings.md +20 -0
- 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/colleague-watches.md +1 -1
- package/docs/colleague-usage/connected-projects.md +1 -1
- 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/github-work.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/project-messages.md +1 -1
- package/docs/colleague-usage/session-archive.md +3 -1
- package/docs/colleague-usage/sessions.md +3 -3
- package/docs/colleague-usage/ui-pass.md +1 -1
- 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/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 +1 -0
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +1 -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/package.json +1 -1
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-ai-tasks/package.json +2 -1
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +484 -468
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +59 -59
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +93 -67
- package/node_modules/@local/vibe64-genesis/src/server/index.js +463 -453
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +60 -58
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +285 -282
- package/package.json +14 -14
- package/server.bundle.mjs +27312 -27279
- package/dist/assets/VAlert-Bp38AD8H.css +0 -1
- package/dist/assets/VAlert-DyCQWe9P.js +0 -1
- package/dist/assets/VAutocomplete-CiXrKMyn.js +0 -1
- package/dist/assets/VDivider-DGkInAUr.js +0 -1
- package/dist/assets/VDivider-DvkP_iX7.css +0 -1
- package/dist/assets/VMenu-9TUL6_ph.css +0 -1
- package/dist/assets/VMenu-DQ9SZ1Fq.js +0 -1
- package/dist/assets/VOverlay-DUKRqNx3.js +0 -1
- package/dist/assets/VSelect-9lMtP5cu.js +0 -1
- package/dist/assets/VSkeletonLoader-C5ZRrPV4.js +0 -1
- package/dist/assets/VSkeletonLoader-LCPSxykp.css +0 -1
- package/dist/assets/Vibe64AuthSettingsButton-BICxvZDm.js +0 -5
- package/dist/assets/Vibe64FileArea-BU5rPyqx.js +0 -1
- package/dist/assets/Vibe64OutputControls-Z2K52QCc.js +0 -8
- package/dist/assets/Vibe64SessionFiles-DI8ZH6aF.js +0 -1
- package/dist/assets/Vibe64UiStoryboardView-C-99xlAo.js +0 -8
- package/dist/assets/_pageId_-DPJ8pvUs.js +0 -1
- package/dist/assets/_sessionId_-B5V2Fs2n.css +0 -1
- package/dist/assets/_sessionId_-CiU1Awul.js +0 -1
- package/dist/assets/_sessionTool_-Be88HWbv.css +0 -1
- package/dist/assets/_slug_-Vy_1jrpy.css +0 -1
- package/dist/assets/access-Cq6GEVhT.js +0 -1
- package/dist/assets/client-C-Rw8t8y.js +0 -1
- package/dist/assets/client-DWPSlYBq.js +0 -2
- package/dist/assets/conversation-p_mmD9ie.js +0 -8
- package/dist/assets/env-ObiVMW6f.js +0 -1
- package/dist/assets/health-Ev-UBIsw.js +0 -1
- package/dist/assets/history-U6UcbKBZ.js +0 -1
- package/dist/assets/issues-D4Asc_wa.css +0 -1
- package/dist/assets/issues-DEzrDqDU.js +0 -1
- package/dist/assets/publish-BYZ7KRzq.js +0 -3
- package/dist/assets/pull-requests-C-puL4SG.js +0 -1
- package/dist/assets/pull-requests-DgWKsMdI.css +0 -1
- package/dist/assets/settings-BmOQ1NnW.js +0 -1
- package/dist/assets/ssrBoot-C6UwmCGc.js +0 -1
- package/dist/assets/useAssistantAttachments-CkseokGM.js +0 -2
- package/dist/assets/useVibe64ConversationLog-BkcPA64C.js +0 -2
- package/dist/assets/vibe64RepositoryRealtime-DKSXVg1B.js +0 -1
- package/dist/assets/vibe64SessionFocus-BJLy8eTE.js +0 -1
- package/dist/assets/vibe64SessionFocus-DdYRpG72.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 ae(e,
|
|
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
|
|
13
|
-
a.length>
|
|
14
|
-
y":`exactly ${o}`;d(n,t,`${s} must contain ${
|
|
15
|
-
"string"&&!!e&&!/[\s\0{}]/u.test(e)&&!Te.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function A(e,n,t,s,r){let i=
|
|
16
|
-
e,n,t,s,r);return
|
|
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
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
|
|
19
|
-
lative path.`,r),e}function N(e,n,t,s,r){let i=
|
|
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 _e(e,n,t,s,r){let i=
|
|
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
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:_e(i[1],n,t,`${s} path`,r),status:o}}var
|
|
26
|
-
|
|
27
|
-
function ue(e,n,t,s,r,{form:i,observed:o=e}){let
|
|
28
|
-
{observed:o});let a=
|
|
29
|
-
argv:A(
|
|
30
|
-
orkdir`,r),...m?{condition:{pathExists:
|
|
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
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
32
|
function R(e){let n=`${JSON.stringify(ke(e),null,2)}
|
|
33
|
-
`;return`sha256:${
|
|
33
|
+
`;return`sha256:${Cn("sha256").update(n).digest("hex")}`}function H(e={},n={},t="operation"){if(e.stackHash!==n.stackHash)
|
|
34
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
|
|
36
|
-
thing."}var
|
|
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",Oe="with `runtime` [in `workdir`]: `command` `argument`...",
|
|
42
|
-
Prepare \`label\` ${Oe}`,Verify:`- Verify \`label\` ${Oe}`,"Custom runner":`- Custom runner ${Oe}`}),
|
|
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,"Declare exactly one default package type.",f),
|
|
47
|
-
g[1])||d($,V,`Default package type must be ${
|
|
48
|
-
if(S){n&&d($,V,"Declare exactly one Sources file.",f),n=
|
|
49
|
-
some(
|
|
50
|
-
P=_?null:l.match(
|
|
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
51
|
"verify":"prepare";!_&&a&&Q==="prepare"&&d($,V,"All Prepare entries must precede Verify entries.",f),a||=!_&&Q==="verify";
|
|
52
|
-
let Ie={label:_?
|
|
53
|
-
{form:
|
|
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
54
|
ot prove source consumption.",f),_?(s&&d($,V,"Declare exactly one Custom runner.",f),s=Ie):r.push({...Ie,phase:Q})}!(t&&
|
|
55
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
|
|
57
|
-
"blocked":r.length||s?"ready":"unconfigured";return{contract:
|
|
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
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",
|
|
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
62
|
dir","argv","timeout","maxBuffer"]),Ae=Object.freeze({Runtime:["runtimeRequirements","`runtime`..."],Directory:["workdir",
|
|
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(Ae).join("|")}): (.+)$`,"u");function
|
|
67
|
-
cture inspection requires exact Stack section lines."),
|
|
68
|
-
i[
|
|
69
|
-
let p=
|
|
70
|
-
d.",
|
|
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
71
|
let f=Object.entries(Ae).map(([g,[,S]])=>`- ${g}: ${S}`).join("; ");d(k,t,`Unknown architecture inspector field. Use one\
|
|
72
|
-
of: ${f}.`,
|
|
73
|
-
k,t,"Inspector runtime",
|
|
74
|
-
requiredFiles")i[l]=
|
|
75
|
-
rkdir")i[l]=
|
|
76
|
-
"timeout"?
|
|
77
|
-
i[l]=l==="timeout"?g*1e3:g}}}return o(),s.length||d(k,t,"Use an Inspector entry or - Nothing."),s}function
|
|
78
|
-
e,k,n,"Preview locator",t,{allowRoot:!1}),e.endsWith(".js")||d(k,n,"Preview locator must name a .js file.",t),e}function
|
|
79
|
-
return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function
|
|
80
|
-
|
|
81
|
-
entries())o=
|
|
82
|
-
a symlink"),o=i=await Re(o),(await
|
|
83
|
-
o||!o.startsWith(`${i}${
|
|
84
|
-
stat();return a.isFile()||t("must be a regular file"),a.size>
|
|
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(
|
|
92
|
-
!o.purpose||!o.subsystems.length)&&d(
|
|
93
|
-
|
|
94
|
-
r.has(m[1])&&d(
|
|
95
|
-
(!o||!l)&&d(
|
|
96
|
-
if(l[1]==="Subsystem"){let g=
|
|
97
|
-
ce.",a+1),i.add(g),o.subsystems.push({root:g})}else{let g=l[1].toLowerCase();o[g]!==void 0&&d(
|
|
98
|
-
1),g==="kind"&&!Ne.includes(f[0])&&d(
|
|
99
|
-
s.length||d(
|
|
100
|
-
groups:e.status==="ready"?
|
|
101
|
-
import B from"node:path";var
|
|
102
|
-
includes(String(e?.code||"").trim())}var Ce="genesis/stack.md",
|
|
103
|
-
return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!
|
|
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
|
+
!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
|
+
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
|
+
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
|
+
(!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=b(f[0],U,t,"Subsystem root",a+1);i.has(g)&&d(U,t,"Each directory root may be placed only on\
|
|
97
|
+
ce.",a+1),i.add(g),o.subsystems.push({root:g})}else{let g=l[1].toLowerCase();o[g]!==void 0&&d(U,t,`Duplicate ${l[1]}.`,a+
|
|
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
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
|
|
106
|
-
import
|
|
107
|
-
"managedPreview"]),
|
|
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\
|
|
@@ -177,7 +177,7 @@ waits for cleanup/restoration; retry if cleanup needs attention. Never kill test
|
|
|
177
177
|
exit alone does not prove tests stopped. Recheck status before reporting a busy blocker.","If a managed command reports \
|
|
178
178
|
kernel task denials or a resource incident, report the blocker with its diagnostic and incident ID and ask the platform \
|
|
179
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."]),
|
|
180
|
+
ss/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),ms=Object.freeze(
|
|
181
181
|
['Pages: `vibe64-helper pages publish <file.html|folder> [--title "Title"]` publishes an HTML page (one file, or a folde\
|
|
182
182
|
r with index.html and its own scripts, styles, data and images) that everyone with access to this project can open from \
|
|
183
183
|
Vibe64\'s Pages list; `vibe64-helper pages update <page-id> <file.html|folder>` gives a page a new version under the same\
|
|
@@ -199,7 +199,7 @@ e data; use --prompt only when gathering it needs judgement.","Before making a p
|
|
|
199
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
200
|
answers, code changes, or documents that belong in the repository. Offer at most once per topic; do not nag.","Everyone \
|
|
201
201
|
with access to the project can open a page: never put secrets in one, or anything not every project member should see."]),
|
|
202
|
-
|
|
202
|
+
hs=Object.freeze(["Each managed shell command receives current development Env from Vibe64, including declared resource \
|
|
203
203
|
bindings; use them in ordinary commands. Do not build environment injection or copy managed credentials into source. Res\
|
|
204
204
|
ource provisioning and application migrations remain separate preparation steps.","Use `vibe64-helper env status [develo\
|
|
205
205
|
pment|production|all]` to inspect configured key names without revealing values.","Pipe an available value to `vibe64-he\
|
|
@@ -213,20 +213,20 @@ pes without explicit direction, or edit Vibe64 runtime/session storage.","After
|
|
|
213
213
|
d scope and key names, never their values, and claim success only when the command succeeded.","Store a secret the appli\
|
|
214
214
|
cation needs generated (such as an application key) by generating it with the framework's own generator and piping it to\
|
|
215
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
|
|
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
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
|
|
218
|
+
`${t} contains unsupported fields: ${r.join(", ")}.`)}function Rt(e){if(Pe(e,["conversationKind","scope","session","host\
|
|
219
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(!
|
|
221
|
-
throw new TypeError("Vibe64 session context has an unknown conversationKind.");let n=
|
|
222
|
-
lities");Pe(n,[...
|
|
223
|
-
throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);return[s,n[s]]}));for(let s of
|
|
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
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
|
|
226
|
-
Pe(e,["scope","stableContext"],"Vibe64 ephemeral context");let n=String(e.stableContext||"").trim();if(!n||n.length>
|
|
227
|
-
"Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:n}}function
|
|
228
|
-
scope==="session")return
|
|
229
|
-
sion and ephemeral scopes only.")}function
|
|
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
230
|
4 CONVERSATION CONTEXT","",...n==="main"?["This is the main Vibe64 conversation for the selected session worktree."]:["T\
|
|
231
231
|
his is a user-visible temporary conversation in the selected session worktree, with the same tools and project access as\
|
|
232
232
|
main chat.","Its messages stay out of main History. Closing this conversation preserves project edits and removes only \
|
|
@@ -255,154 +255,164 @@ s are this session's own copies at `../connected/<name>`, listed in the Stack's
|
|
|
255
255
|
on status --json` under `repository.connected`: edit them like this session's source; Save and Update cover them, so nev\
|
|
256
256
|
er commit, push, fetch or rebase them yourself.","Vibe64-owned contracts (Stack sections such as Workspace setup and Out\
|
|
257
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.",
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
session
|
|
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
|
-
|
|
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),
|
|
308
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.
|
|
309
|
-
join(n,`.sessions.${process.pid}.${
|
|
310
|
-
await
|
|
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=""){
|
|
311
314
|
if(i)throw new Error("The Genesis host context registry is closed.");if(typeof p!="string"||!p.trim())throw new TypeError(
|
|
312
315
|
"Genesis host context requires a native conversation ID.");let f=structuredClone(m);ee(f);let g={upstreamSessionId:p,workdir:l,
|
|
313
316
|
promptContext:f},S=r.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(g))return;let _=new Map(s);
|
|
314
|
-
_.set(p,g),await o(_),s=_});r=S,await S}async function
|
|
315
|
-
force:!0})}return Object.freeze({registryPath:t,get:
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
"
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
r.add("
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
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:[
|
|
360
370
|
"versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
|
|
361
371
|
prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
|
|
362
372
|
ect.toml","external"]}),"web-bundle":Object.freeze({entries:["workdir","runtimes","prepare","build","environment","outpu\
|
|
363
373
|
t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({entries:["workdir","content","platforms","a\
|
|
364
374
|
pplicationId","name","icon","versionFrom","deepLinkSchemeFrom","appLinkDomainsFrom","permission"],required:["content","p\
|
|
365
375
|
latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),le=Object.freeze(Object.
|
|
366
|
-
keys(
|
|
376
|
+
keys(Ht)),Be=Object.freeze(["android"]),We=Object.freeze(["package.json","pyproject.toml","external"]),q=e=>e.map(n=>`\`${n}\
|
|
367
377
|
\``).join(" | "),X=Object.freeze([["- Packer: ","packer",`- Packer: ${q(le)}`],["- Workdir: ","workdir","- Workdir: `pat\
|
|
368
378
|
h`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from:\
|
|
369
|
-
","versionFrom",`- Version from: ${q(
|
|
379
|
+
","versionFrom",`- Version from: ${q(We)}`],["- Platforms: ","platforms",`- Platforms: ${q(Be)}...`],["- Id: ","applica\
|
|
370
380
|
tionId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/icon\
|
|
371
381
|
-1024.png`"],["- Deep link scheme from: ","deepLinkSchemeFrom","- Deep link scheme from: `ENV_NAME`"],["- App link domai\
|
|
372
|
-
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([
|
|
373
383
|
X[0][2],X[1][2],X[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",X[3][2],X[4][2],
|
|
374
384
|
"- Content: package `web-bundle-id`",...X.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),ne=Object.
|
|
375
385
|
freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Environment",
|
|
376
386
|
output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Name",icon:"\
|
|
377
387
|
Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permission"});function E(e,n,t){
|
|
378
|
-
d(j,e,n,t)}function
|
|
379
|
-
single hyphens.`,s),r}function
|
|
380
|
-
some(r=>
|
|
381
|
-
ust be an uppercase environment variable name.`,s),e}function
|
|
382
|
-
plicate ${ne[n]} entry.`,r),e.seen.add(n),e.fields[n]=t,e.lines[n]=r}function
|
|
383
|
-
"runtimes")return N(n.slice(t.length),j,s,i,r);if(e==="platforms"){let
|
|
384
|
-
includes(a))&&E(s,`${i} must be ${q(
|
|
385
|
-
let o=
|
|
386
|
-
e ${q(le)}.`,r),o;if(["workdir","output"].includes(e))return
|
|
387
|
-
o,j,s,i,r,{allowRoot:!1});return
|
|
388
|
-
"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,
|
|
389
399
|
`${i} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and underscores; each part starts with a let\
|
|
390
|
-
ter).`,r),o):e==="name"?((o.trim()!==o||o.length
|
|
391
|
-
ces.`,r),o):
|
|
392
|
-
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(
|
|
393
403
|
n)&&E(t,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Content package at its l\
|
|
394
|
-
ockfile versions.",s);for(let[a,
|
|
395
|
-
"content",
|
|
396
|
-
ging ${i[1]} command`;e[a].push({label:
|
|
397
|
-
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}\
|
|
398
408
|
looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(p=>p.name===a)&&E(t,`Packa\
|
|
399
|
-
ge ${e.id} has a duplicate Environment ${a}.`,s);let
|
|
400
|
-
ging Environment value",s)[0];e.environment.push({name:a,value:
|
|
401
|
-
let a=
|
|
402
|
-
E(t,`Packaging Permission reason is plain user-facing text of at most ${
|
|
403
|
-
a)&&E(t,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:
|
|
404
|
-
return}E(t,D("Packaging entry",n,
|
|
405
|
-
try: ${q(le)}.`,e.line);let s=
|
|
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\
|
|
406
416
|
nvironment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of r)s.entries.includes(o)||E(
|
|
407
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\
|
|
408
418
|
eeds ${/^[AEIOU]/u.test(ne[o])?"an":"a"} ${ne[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
|
|
@@ -411,290 +421,290 @@ label,packer:t,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtim
|
|
|
411
421
|
environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return t!=="capacitor"?i:{...i,content:e.
|
|
412
422
|
fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
|
|
413
423
|
deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
|
|
414
|
-
permissions}}function
|
|
415
|
-
supplied as exact Stack section lines."),
|
|
416
|
-
let
|
|
417
|
-
known Packaging heading: ${
|
|
418
|
-
E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>
|
|
419
|
-
o.has(a.id)&&E(t,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let
|
|
420
|
-
({packer:
|
|
421
|
-
name a web-bundle package declared in Packaging.`),
|
|
422
|
-
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(
|
|
423
433
|
i=>i?.name===n);return(!r||typeof r.value!="string"||!r.value.trim())&&E(t,`${s} names ${n}, which ## Environment defaul\
|
|
424
|
-
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{
|
|
425
435
|
...e,packages:e.packages.map(r=>{if(r.packer!=="capacitor")return r;let i={...r,deepLinkScheme:null,appLinkDomains:[]};if(r.
|
|
426
|
-
deepLinkSchemeFrom){let o=
|
|
436
|
+
deepLinkSchemeFrom){let o=Bt(n,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!Vs.test(o)||["http","ht\
|
|
427
437
|
tps","file","content","javascript"].includes(o))&&E(s,`${r.deepLinkSchemeFrom} must be a custom lowercase URL scheme suc\
|
|
428
|
-
h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=
|
|
429
|
-
k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(
|
|
430
|
-
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={},
|
|
431
441
|
section:n={}}={}){H(n,e,"Packaging section");let t=[...n.diagnostics||[]],s={version:1,packages:[]};n.status==="ready"&&
|
|
432
|
-
(s=
|
|
442
|
+
(s=qt(Ft(n.lines),e.environmentDefaults));let r=t.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:de,
|
|
433
443
|
status:r,stackHash:n.stackHash,packagingHash:r==="ready"?R(s):"",source:n.source||null,version:s.version,packages:s.packages,
|
|
434
|
-
diagnostics:t}}var
|
|
435
|
-
t,s,r,i)}function
|
|
436
|
-
.`,r),e.seen.add(n),e[n]=t}var se="vibe64.preview-identity.command.v1",
|
|
437
|
-
"TMPDIR","USER"]),
|
|
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\
|
|
438
448
|
review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${se}\``],["- Identity types: ","identityTypes",
|
|
439
|
-
"Identity types",`one or more of ${[...
|
|
449
|
+
"Identity types",`one or more of ${[...Jt].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
|
|
440
450
|
t","Enabled environment","`ENV_NAME`"],["- Secret environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],
|
|
441
451
|
["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${me}\`\
|
|
442
|
-
(default ${
|
|
443
|
-
identity ${t} environment name`,s);return(!
|
|
444
|
-
ronment name is invalid.`,s),r}function
|
|
445
|
-
|
|
446
|
-
ypes","runtimes"].includes(o)&&a.length!==1&&h(t,`Preview identity ${
|
|
447
|
-
iew identity ${
|
|
448
|
-
s","Identity types"]])e[
|
|
449
|
-
\``).join(" "),r=A(s,
|
|
450
|
-
|
|
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\
|
|
451
461
|
al app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==se&&h(n,`Preview identity protocol must be ${se}\
|
|
452
|
-
.`,e.line);let o=[...new Set(e.identityTypes.map(
|
|
453
|
-
o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let
|
|
454
|
-
enabledEnvironment?.[0],n,"enabled",e.line),secret:
|
|
455
|
-
|
|
456
|
-
timeoutMs[0];/^[0-9]+$/u.test(
|
|
457
|
-
isSafeInteger(a)||a<1||a>me)&&h(n,`Preview identity Timeout ms must be from 1 through ${me}.`,e.line)}return{command:r,environment:
|
|
458
|
-
identityTypes:o,protocol:i,runtimes:e.runtimes?N(e.runtimes.map(
|
|
459
|
-
e.line):[],timeoutMs:a}}var
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
map(n=>`\`${n}\``).join(" or "),
|
|
463
|
-
on","#### Preview identity","#### Download `id`"]),ge=Object.freeze({target:["- Default.",`- Mode: ${he(
|
|
464
|
-
|
|
465
|
-
"- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${he(
|
|
466
|
-
hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:
|
|
467
|
-
`path`","- Name: `file-name`","- Media type: `type/subtype`"]});function
|
|
468
|
-
r)||h(n,`${t} must use lowercase letters, digits, and single hyphens.`,s),r}function
|
|
469
|
-
i.replace(
|
|
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(
|
|
470
480
|
o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&h(n,`${t} supports only {host}\
|
|
471
|
-
, {port}, and {parameter:id} placeholders.`,s);return r}function
|
|
472
|
-
e[2],
|
|
473
|
-
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\
|
|
474
484
|
ter Required entry");return}for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(n.startsWith(
|
|
475
|
-
o)){let
|
|
476
|
-
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\
|
|
477
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.
|
|
478
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.
|
|
479
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\
|
|
480
|
-
t, at most 4096 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function
|
|
481
|
-
preferredPort:null,urlPath:"/",readiness:null,seen:new Set,line:e}}function
|
|
482
|
-
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\
|
|
483
493
|
rred port must be an integer from 1024 through 65535.",t);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&
|
|
484
|
-
h(n,"Web presentation preferred port must be an integer from 1024 through 65535.",t),s}function
|
|
485
|
-
"- Data: ")){let i=
|
|
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(
|
|
486
496
|
e,"dataMode",i,t,s,"output target Data entry");return}if(n==="- Default."){O(e,"default",!0,t,s,"output target Default e\
|
|
487
|
-
ntry");return}if(n.startsWith("- Mode: ")){let i=
|
|
497
|
+
ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);on.has(i)||h(t,"Output target \
|
|
488
498
|
Mode must be `interactive` or `finite`.",s),O(e,"mode",i,t,s,"output target Mode entry");return}if(n.startsWith("- Workd\
|
|
489
|
-
ir: ")){O(e,"workdir",
|
|
490
|
-
Workdir entry");return}if(n.startsWith("- Runtimes: ")){O(e,"runtimeRequirements",N(n.slice(12),
|
|
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\
|
|
491
501
|
imes",s),t,s,"output target Runtimes entry");return}let r=n.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(r){
|
|
492
|
-
let i=r[1].toLowerCase(),o=
|
|
493
|
-
nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:
|
|
494
|
-
label",s),argv:o,role:i});return}h(t,D("Outputs target entry",n,[...ge.target,...
|
|
495
|
-
if(n.startsWith("- Kind: ")){let r=
|
|
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\
|
|
496
506
|
rminal` or `web`.",s),O(e,"kind",r,t,s,"Presentation Kind entry");return}if(n.startsWith("- Preferred port: ")){O(e,"pre\
|
|
497
|
-
ferredPort",
|
|
498
|
-
ry");return}if(n.startsWith("- URL path: ")){O(e,"urlPath",_e(
|
|
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\
|
|
499
509
|
eb presentation URL path",s),t,s,"Presentation URL path entry");return}if(n.startsWith("- Ready when: ")){O(e,"readiness",
|
|
500
|
-
ce(n,
|
|
501
|
-
s)}function
|
|
502
|
-
s.trim()!==s)&&h(n,"Download Name must be a safe filename without path separators.",t),s}function
|
|
503
|
-
n,"Download Media type",t);return(s.length>127||!
|
|
504
|
-
value.",t),s}function
|
|
505
|
-
nload path",s,{allowRoot:!1}),t,s,"Download Path entry");return}if(n.startsWith("- Name: ")){O(e,"name",
|
|
506
|
-
t,"Download Name",s),t,s),t,s,"Download Name entry");return}if(n.startsWith("- Media type: ")){O(e,"mediaType",
|
|
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,"-\
|
|
507
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),
|
|
508
|
-
s)}function
|
|
509
|
-
t ${t} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function
|
|
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){
|
|
510
520
|
return e.kind||h(n,`Output target ${t} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
|
|
511
521
|
readiness||e.seen.has("urlPath"))&&h(n,`Output target ${t} terminal Presentation accepts only Kind.`,e.line),{kind:"term\
|
|
512
522
|
inal"}):(e.readiness||h(n,`Output target ${t} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.
|
|
513
|
-
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\
|
|
514
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,
|
|
515
|
-
run:2};for(let
|
|
516
|
-
be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:
|
|
517
|
-
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),
|
|
518
528
|
e.mode==="finite"?((s.length>0||e.presentation||e.previewIdentity)&&h(n,`Finite output target ${e.id} cannot have Run, P\
|
|
519
529
|
resentation, or Preview identity entries.`,e.line),r.length===0&&h(n,`Finite output target ${e.id} needs at least one Do\
|
|
520
530
|
wnload.`,e.line)):s.length!==1||e.steps.at(-1).role!=="run"?h(n,`Interactive output target ${e.id} needs exactly one fin\
|
|
521
531
|
al Run step.`,e.line):e.presentation||h(n,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?
|
|
522
|
-
|
|
523
|
-
"host","port"].includes(
|
|
524
|
-
let
|
|
525
|
-
arget ${e.id} may declare at most ${
|
|
526
|
-
meter:"))){let p=
|
|
527
|
-
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!==
|
|
528
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.
|
|
529
539
|
mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,
|
|
530
|
-
downloads:r,...
|
|
540
|
+
downloads:r,...c.length?{parameters:c}:{},...e.previewIdentity?{previewIdentity:nn(e.previewIdentity,n,e.id)}:{}}}function Ee(e,n={}){
|
|
531
541
|
let{path:t="genesis/stack.md#Outputs"}=n;if(Array.isArray(e)||h(t,"Outputs must be supplied as exact Stack section lines\
|
|
532
|
-
."),
|
|
533
|
-
continue;let p=a+1,m=
|
|
534
|
-
begin with a Target heading.",p);let l=
|
|
535
|
-
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===
|
|
536
546
|
"#### Presentation"){r.presentation&&h(t,"Presentation must appear at most once below an output target.",p),r.presentation=
|
|
537
|
-
|
|
538
|
-
y must appear at most once below an output target.",p),r.previewIdentity=
|
|
539
|
-
let f=
|
|
540
|
-
resentation"?
|
|
541
|
-
0&&h(t,"## Outputs needs at least one Target or exactly `- Nothing.`.");let
|
|
542
|
-
|
|
543
|
-
t most one default target."),{version:1,targets:s}}function
|
|
544
|
-
isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:[]).map((
|
|
545
|
-
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(
|
|
546
556
|
s.resource||"").trim()||"resources";return t?`Vibe64 is still setting up this app's ${o}. Preview can start when workspa\
|
|
547
557
|
ce setup finishes; then press Check again.`:`This app needs its ${o} before Preview can start: set ${i.join(", or ")} in\
|
|
548
|
-
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}={}){
|
|
549
559
|
H(n,e,"Outputs section");let s=[...n.diagnostics||[]],r=[...e.diagnostics||[]],i={version:1,targets:[]};n.status==="read\
|
|
550
|
-
y"&&(i=Ee(n.lines));let o=r.length===0?null:[...new Set(r.map(p=>
|
|
551
|
-
p=>({...p,source:n.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],
|
|
552
|
-
length>0?
|
|
553
|
-
[]],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:z(
|
|
554
|
-
resources:structuredClone(e.resources||[]),targets:
|
|
555
|
-
t services",
|
|
556
|
-
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()){
|
|
557
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);
|
|
558
|
-
o||d(J,Z,`Use: ${
|
|
559
|
-
n.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:N(
|
|
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]||
|
|
560
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\
|
|
561
|
-
`- Nothing.`."),n}function
|
|
562
|
-
ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?R(n):"",diagnostics:e.diagnostics||[]}}import{access as
|
|
563
|
-
runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",
|
|
564
|
-
d(
|
|
565
|
-
setup must be supplied as exact Stack section lines."),
|
|
566
|
-
if(!i)continue;let o=r+1,
|
|
567
|
-
|
|
568
|
-
0&&
|
|
569
|
-
|
|
570
|
-
let t=[...n.diagnostics||[]],s=[];n.status==="ready"&&(s=ye(n.lines));let r=[],i=[],o=
|
|
571
|
-
if(!l.condition||await
|
|
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.
|
|
572
582
|
pathExists)}if(i.length>0){let l=z(i);t.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting \
|
|
573
|
-
for project ${l.length===1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let
|
|
574
|
-
ORKSPACE_SETUP_WAITING"),a=t.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),
|
|
575
|
-
length>0&&(
|
|
576
|
-
stackHash,recipeHash:
|
|
577
|
-
flatMap(l=>l.runtimeRequirements)),steps:p,diagnostics:t}}var
|
|
578
|
-
1024,
|
|
579
|
-
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function
|
|
580
|
-
e,n,t)}function
|
|
581
|
-
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={}){
|
|
582
592
|
let{path:t="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:r=!1}=n;(!Array.isArray(e)||e.length>2048||
|
|
583
593
|
e.some(p=>typeof p!="string")||Buffer.byteLength(e.join(`
|
|
584
|
-
`),"utf8")>64*1024)&&
|
|
585
|
-
outputs:[],workspaceSetup:null};if(
|
|
586
|
-
let{targetId:p,mode:m,fields:l,line:f}=a;if(m==="interactive"){(l.has("typical")||l.has("high"))&&
|
|
587
|
-
ts require separate Startup and Running estimates.",f),i.outputs.push({targetId:p,mode:m,startup:
|
|
588
|
-
startupHigh",t,f),running:
|
|
589
|
-
|
|
594
|
+
`),"utf8")>64*1024)&&G(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let i={version:1,
|
|
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;
|
|
596
|
+
let{targetId:p,mode:m,fields:l,line:f}=a;if(m==="interactive"){(l.has("typical")||l.has("high"))&&G(t,"Interactive outpu\
|
|
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.
|
|
590
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)
|
|
591
|
-
continue;let f=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(f||m==="### Workspace setup"){
|
|
592
|
-
"",Y=P?`output:${P}`:"workspace-setup";
|
|
593
|
-
get(P);P&&!["interactive","finite"].includes(Q?.mode)&&
|
|
594
|
-
!P&&!r&&
|
|
595
|
-
line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),S=g&&
|
|
596
|
-
or Workspace setup heading followed by positive integer MiB estimates: ${[...
|
|
597
|
-
"; ")}.`,l),a.fields.has(S)&&
|
|
598
|
-
|
|
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.
|
|
603
|
+
get(P);P&&!["interactive","finite"].includes(Q?.mode)&&G(t,`Resource estimate references an undeclared output: ${P}.`,l),
|
|
604
|
+
!P&&!r&&G(t,"Resource estimate references undeclared Workspace setup steps.",l),a={targetId:P,mode:Q?.mode||"setup",fields:new Map,
|
|
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\
|
|
599
609
|
rce estimates needs an operation or exactly `- Nothing.`."),i}function ve({section:e={},outputsSection:n={},workspaceSetupSection:t={}}={}){
|
|
600
610
|
H(e,n,"Resource estimates and Outputs"),H(e,t,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={
|
|
601
|
-
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=
|
|
611
|
+
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=yn(e.lines,{targets:n.status==="read\
|
|
602
612
|
y"?Ee(n.lines).targets:[],hasWorkspaceSetup:t.status==="ready"&&ye(t.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
|
|
603
|
-
kOperationError")throw o;s.push({code:
|
|
604
|
-
nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:
|
|
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.
|
|
605
615
|
sectionHash||"",estimatesHash:i==="ready"?R(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
|
|
606
|
-
fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var
|
|
607
|
-
ntime` in `workdir`: `command` `argument`...";function
|
|
608
|
-
isArray(e)||d(ie,t,"Integration setup requires exact Stack section lines."),
|
|
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(
|
|
609
619
|
Boolean),r=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return r||d(ie,t,`Integration setu\
|
|
610
|
-
p requires exactly one entry: ${
|
|
611
|
-
"Integration setup workdir"),runtimeRequirements:N(r[1],ie,t,"Integration setup runtimes")}}function
|
|
612
|
-
let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?
|
|
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\
|
|
613
623
|
cked":t?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:t?R({version:1,command:t}):"",source:e.source||null,components:[
|
|
614
|
-
...e.components||[]],command:t,diagnostics:n}}var
|
|
615
|
-
"Genesis host context requires an absolute runtime root.");let n=B.join(e,"genesis-context");if(!we.has(n)){let t=
|
|
616
|
-
catch(s=>{throw we.delete(n),s});we.set(n,t)}return we.get(n)}var{GENESIS_CONTRACTS:C,HOST_CONTEXT_RESOLVER_DATA_ENV:
|
|
617
|
-
HOST_CONTEXT_RESOLVER_ENV
|
|
618
|
-
inspectDerivedArtifacts:
|
|
619
|
-
inspectSkills:
|
|
620
|
-
setCollaboration:
|
|
621
|
-
sourceExplanationGuidance:
|
|
622
|
-
CALL_WEB_SCHEMA:
|
|
623
|
-
e);return{[
|
|
624
|
-
/blueprint.md",
|
|
625
|
-
ails-postgresql","spring-boot-postgresql"]),
|
|
626
|
-
eprint",BLUEPRINT_REQUIRED:"start"}),
|
|
627
|
-
pass","work"]),
|
|
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\
|
|
628
638
|
is did not answer within ${n} ms.`),{code:"vibe64_genesis_timeout"})),n)});return Promise.race([Promise.resolve().then(e),
|
|
629
|
-
s]).finally(()=>clearTimeout(t))}function
|
|
630
|
-
s?`Unknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an explicit task.");return s}function
|
|
631
|
-
e.genesisTask)||"work"}function
|
|
632
|
-
map(x).find(Boolean)||"Continue the requested project work."}function
|
|
633
|
-
[]).find(n=>
|
|
634
|
-
is compiler executable could not be located.");return B.join(e,".bin")}function
|
|
635
|
-
esis/server");return B.resolve(B.dirname(e),"../../bin")}function
|
|
636
|
-
t")}function
|
|
637
|
-
let{prompt:t=!1}=n;return{...e,...t?{hiddenStackPieces:
|
|
638
|
-
return W(
|
|
639
|
-
return te(
|
|
640
|
-
return
|
|
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(
|
|
641
651
|
`Genesis returned ${e?.contract||"no contract identity"}; expected ${C.derivedArtifacts}.`);let n=Array.isArray(e.artifacts)?
|
|
642
652
|
e.artifacts:[];if(!n.length||n.some(t=>!x(t?.path)))throw new Error("Genesis returned an invalid derived-artifact contra\
|
|
643
|
-
ct.");return{...e,artifacts:n.map(t=>({...t}))}}var
|
|
644
|
-
artifacts.map(e=>[e.id,e])),
|
|
645
|
-
"Genesis did not declare both City projection artifacts.");var
|
|
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\
|
|
646
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))
|
|
647
|
-
throw new TypeError("Genesis operations require an explicit absolute projectRoot.");return
|
|
648
|
-
function
|
|
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,
|
|
649
659
|
" ").slice(0,300)||"no reason given"}). Work from the repository itself, where the genesis/ files still describe the pro\
|
|
650
|
-
ject when present, and tell the user that Genesis guidance did not load if it matters to the request.`}async function
|
|
651
|
-
workdir:e,promptContext:n},{onGenesisUnavailable:t=
|
|
652
|
-
let i;try{let o=await
|
|
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?.
|
|
653
663
|
output=="string"&&o.output.trim())return o.output;i=new Error("Genesis returned no session guidance.")}catch(o){i=o}return t(
|
|
654
|
-
i),`${
|
|
664
|
+
i),`${hi(i)}
|
|
655
665
|
|
|
656
|
-
${r}`}function te(e,n={}){return
|
|
657
|
-
contract||"no contract identity"}; expected ${n}.`);return e}async function F(e,n,t={}){return
|
|
658
|
-
return
|
|
659
|
-
s=>
|
|
660
|
-
e[r]))throw new Error("Genesis returned an invalid Stack section inspection batch.");return t}async function
|
|
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(
|
|
661
671
|
e)).status!=="current")throw Object.assign(new Error("The project needs a current Genesis format before its Stack can be\
|
|
662
|
-
inspected."),{code:"vibe64_stack_format_required"});await
|
|
663
|
-
components:t.components,stackHash:t.stackHash}}async function
|
|
664
|
-
e)]);return
|
|
665
|
-
e)]);return
|
|
666
|
-
e)}function
|
|
667
|
-
|
|
668
|
-
e)}async function
|
|
669
|
-
t status.");return{...n}}function
|
|
670
|
-
e)}async function
|
|
671
|
-
n)]);return{...
|
|
672
|
-
workspaceSetupSection:r})}}async function
|
|
673
|
-
await K(
|
|
674
|
-
return{...await
|
|
675
|
-
async function
|
|
676
|
-
async function
|
|
677
|
-
e),
|
|
678
|
-
try{return{result:await a(o),task:o}}catch(g){let S=Object.hasOwn(
|
|
679
|
-
!0)throw g;return{result:await a(S),task:S}}},p;try{if(p=await
|
|
680
|
-
trim())throw new Error("Genesis returned no prompt.")}catch(g){return s(g),{prompt:
|
|
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(
|
|
681
691
|
m.task))?x(m.task):l;return{context:{genesis:!0,requestedTask:o,task:f,verificationCommands:m.verificationCommands,warnings:m.
|
|
682
|
-
warnings},originalPrompt:
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
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};
|