vibe64 0.1.43 → 0.1.44
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.
|
@@ -7,7 +7,7 @@ VIBE64_PROJECT_SERVICES_INVALID:"project-services",VIBE64_INTEGRATION_SETUP_INVA
|
|
|
7
7
|
architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),en=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
|
|
8
8
|
function tn(e,t){let n=Qt[e],s=String(t).replace(en,"");return n?`${s} Exact grammar: vibe64-helper spec ${n}.`:s}function D(e,t,n){
|
|
9
9
|
return`Unknown ${e}: ${t}. Use one of: ${n.join("; ")}.`}function l(e,t,n,s,r={}){throw new ce(e,tn(e,n),{path:t,...s===
|
|
10
|
-
void 0?{}:{line:s},...r})}function
|
|
10
|
+
void 0?{}:{line:s},...r})}function v(e,t,n,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&l(t,n,`${s} \
|
|
11
11
|
must be one non-empty line.`,r),e.trim()}function nn(e){let t=[...String(e||"").matchAll(/`([^`\r\n]+)`/gu)];return t.length===
|
|
12
12
|
0||t.map(n=>n[0]).join(" ")!==e?null:t.map(n=>n[1])}function I(e,t,n,s,r,{count:i,maximum:o=64}={}){let a=nn(e);if(!a||a.
|
|
13
13
|
length>o||i!==void 0&&a.length!==i||a.some(u=>u.length>4096||/[\0\r\n]/u.test(u))){let u=i===void 0?"separate non-empty":
|
|
@@ -18,7 +18,7 @@ ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!we.posix.isAbsolute(e)&&we.posix.normalize(e
|
|
|
18
18
|
function E(e,t,n,s,r,{allowRoot:i=!0}={}){return(!rn(e)||!i&&e===".")&&l(t,n,`${s} must be a canonical project-relative \
|
|
19
19
|
path.`,r),e}function O(e,t,n,s,r){let i=I(e,t,n,s,r);return i.some(o=>!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o))&&l(t,n,`${s}\
|
|
20
20
|
must use lowercase technology ids separated into backticked values.`,r),new Set(i).size!==i.length&&l(t,n,`${s} contain\
|
|
21
|
-
s a duplicate technology id.`,r),i}function Se(e,t,n,s,r){let i=
|
|
21
|
+
s a duplicate technology id.`,r),i}function Se(e,t,n,s,r){let i=v(e,t,n,s,r);return(!i.startsWith("/")||i.startsWith("//")||
|
|
22
22
|
/[\\?#]/u.test(i))&&l(t,n,`${s} must begin with one slash and contain no query or fragment.`,r),i}function ue(e,t,n,s,r){
|
|
23
23
|
let i=e.match(/^- Ready when: `GET` `([^`\r\n]+)` returns `([0-9]{3})`$/u);i||l(t,n,`${s} must use \`- Ready when: \`GET\` \
|
|
24
24
|
\`/path\` returns \`200\`\`.`,r);let o=Number(i[2]);return(!Number.isInteger(o)||o<200||o>399)&&l(t,n,`${s} status must \
|
|
@@ -35,7 +35,7 @@ function Te(e,t,n,s={}){l(Z,e,t,n,s)}function Q(e,{path:t="genesis/stack.md#Work
|
|
|
35
35
|
t,"Workspace setup must be supplied as exact Stack section lines."),b(e))return[];let n=[];for(let s=0;s<e.length;s+=1){
|
|
36
36
|
let r=e[s].trim();if(!r)continue;let i=s+1,o=r.match(cn);o||Te(t,`Every Workspace setup entry must use: ${an}`,i,{observed:r});
|
|
37
37
|
let a=o[2].match(un),u=a?null:o[2].match(pn),c=a?a[1]:u?u[1]:o[2],p=a?.[2]||u?.[2]||"",m=c.match(ln),d=m?m[1]:c,h=m?m[2]:
|
|
38
|
-
".";n.push({label:
|
|
38
|
+
".";n.push({label:v(o[1],Z,t,"Workspace setup step label",i),argv:_(o[3],Z,t,"Workspace setup command",i),runtimeRequirements:O(
|
|
39
39
|
d,Z,t,"Workspace setup runtimes",i),workdir:E(h,Z,t,"Workspace setup workdir",i),...p?{condition:{pathExists:E(p,Z,t,"Wo\
|
|
40
40
|
rkspace setup condition path",i,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}})}return n.length===0&&Te(t,"## Workspace\
|
|
41
41
|
setup needs at least one Prepare entry or exactly `- Nothing.`."),n}async function dn(e,t){try{return await on(He.join(
|
|
@@ -55,9 +55,9 @@ freeze({value:mn,label:"custom"})]);var Fe=Object.freeze(fn.map(e=>e.value));fun
|
|
|
55
55
|
stack.md#Connected development",ke="with `runtime` [in `workdir`]: `command` `argument`...",gn=Object.freeze(["- Default\
|
|
56
56
|
package type: `type`","- Sources file: `path`",`- Prepare \`label\` ${ke}`,`- Verify \`label\` ${ke}`,`- Custom runner ${ke}`]);
|
|
57
57
|
function Je(e={}){let t="",n="",s=null,r=[],i=[...e.diagnostics||[]],o=e.status==="ready";if(o&&!b(e.lines)){let u=!1;for(let[
|
|
58
|
-
p,m]of e.lines.entries()){let d=m.trim();if(!d)continue;let h=p+1,
|
|
59
|
-
if(
|
|
60
|
-
n=
|
|
58
|
+
p,m]of e.lines.entries()){let d=m.trim();if(!d)continue;let h=p+1,y=d.match(/^- Default package type: `([^`\r\n]*)`$/u);
|
|
59
|
+
if(y){n&&l(x,P,"Declare exactly one default package type.",h),Ke(y[1])||l(x,P,`Default package type must be ${Ye()}.`,h),
|
|
60
|
+
n=y[1];continue}let X=d.match(/^- Sources file: `([^`\r\n]+)`$/u);if(X){t&&l(x,P,"Declare exactly one Sources file.",h),
|
|
61
61
|
t=E(X[1],x,P,"Connected sources file",h,{allowRoot:!1}),t.split("/").some(z=>z.toLowerCase()===".git")&&l(x,P,"The Sourc\
|
|
62
62
|
es file must be outside Git metadata.",h);continue}let k=d.startsWith("- Custom runner "),te=d.match(/^- (Prepare|Verify) /u);
|
|
63
63
|
!k&&!te&&l(x,P,D("Connected development entry",d,gn),h);let J=te?.[1]==="Verify"?"verify":"prepare";!k&&u&&J==="prepare"&&
|
|
@@ -83,24 +83,24 @@ ed an Inspector heading.",o+1);let p=u.match(En);p||l(R,t,`Unknown architecture
|
|
|
83
83
|
_e).map(([d,[,h]])=>`- ${d}: ${h}`).join("; ")}.`,o+1);let[m]=_e[p[1]];if(r[m]!==void 0&&l(R,t,`Duplicate ${p[1]}.`,o+1),
|
|
84
84
|
m==="runtimeRequirements")r[m]=O(p[2],R,t,"Inspector runtime",o+1);else if(m==="argv")r[m]=_(p[2],R,t,"Inspector command",
|
|
85
85
|
o+1);else if(m==="entryFiles"||m==="requiredFiles")r[m]=I(p[2],R,t,p[1],o+1).map(d=>E(d,R,t,p[1],o+1));else{let[d]=I(p[2],
|
|
86
|
-
R,t,p[1],o+1,{count:1});if(m==="workdir")r[m]=E(d,R,t,"Inspector directory",o+1);else{let h=Number(d),
|
|
87
|
-
4*1024*1024;(!/^[1-9][0-9]*$/u.test(d)||!Number.isSafeInteger(h)||h>
|
|
86
|
+
R,t,p[1],o+1,{count:1});if(m==="workdir")r[m]=E(d,R,t,"Inspector directory",o+1);else{let h=Number(d),y=m==="timeout"?60:
|
|
87
|
+
4*1024*1024;(!/^[1-9][0-9]*$/u.test(d)||!Number.isSafeInteger(h)||h>y)&&l(R,t,`${p[1]} must be from 1 to ${y}.`,o+1),r[m]=
|
|
88
88
|
m==="timeout"?h*1e3:h}}}return i(),n.length||l(R,t,"Use an Inspector entry or - Nothing."),n}function Qe(e){let t=e.status===
|
|
89
89
|
"ready"?bn(e.lines):[];for(let n of t)n.runtimeRequirements.some(s=>!e.components.includes(s))&&l(R,"genesis/stack.md#Ar\
|
|
90
90
|
chitecture inspection","Inspector runtimes must be selected in Stack.");return{contract:"vibe64.architecture-inspection.\
|
|
91
|
-
v1",status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:S(t),diagnostics:e.diagnostics||[]}}var et="Architecture layout",Oe=Object.freeze(["layer","libraries","support"]);function
|
|
91
|
+
v1",status:e.status,stackHash:e.stackHash,inspectors:t,recipeHash:S(t),diagnostics:e.diagnostics||[]}}var et="Architecture layout",Oe=Object.freeze(["layer","libraries","support"]);function yn(e,{path:t="genesis/stack.md#A\
|
|
92
92
|
rchitecture layout"}={}){let n="VIBE64_ARCHITECTURE_LAYOUT_INVALID";if(Array.isArray(e)||l(n,t,"Expected exact Stack sec\
|
|
93
93
|
tion lines."),b(e))return[];let s=[],r=new Set,i=new Set,o;function a(){o&&((!o.kind||!o.purpose||!o.subsystems.length)&&
|
|
94
94
|
l(n,t,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[u,c]of e.entries()){let p=c.trim();if(!p)
|
|
95
95
|
continue;let m=p.match(/^### Group `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(m){a(),r.has(m[1])&&l(n,t,"Duplicate group \
|
|
96
96
|
id.",u+1),r.add(m[1]),o={id:m[1],title:m[2],subsystems:[]};continue}let d=p.match(/^- (Kind|Purpose|Subsystem): (.+)$/u);
|
|
97
97
|
(!o||!d)&&l(n,t,"Expected a Group heading or Kind, Purpose, Subsystem field.",u+1);let h=I(d[2],n,t,d[1],u+1,{count:1});
|
|
98
|
-
if(d[1]==="Subsystem"){let
|
|
99
|
-
ce.",u+1),i.add(
|
|
100
|
-
1),
|
|
98
|
+
if(d[1]==="Subsystem"){let y=E(h[0],n,t,"Subsystem root",u+1);i.has(y)&&l(n,t,"Each directory root may be placed only on\
|
|
99
|
+
ce.",u+1),i.add(y),o.subsystems.push({root:y})}else{let y=d[1].toLowerCase();o[y]!==void 0&&l(n,t,`Duplicate ${d[1]}.`,u+
|
|
100
|
+
1),y==="kind"&&!Oe.includes(h[0])&&l(n,t,`Kind must be ${Oe.slice(0,-1).join(", ")} or ${Oe.at(-1)}.`,u+1),o[y]=h[0]}}return a(),
|
|
101
101
|
s.length||l(n,t,"Use a Group entry or - Nothing."),s}function tt(e){return{contract:"vibe64.architecture-layout.v1",status:e.
|
|
102
|
-
status,stackHash:e.stackHash,groups:e.status==="ready"?
|
|
103
|
-
import
|
|
102
|
+
status,stackHash:e.stackHash,groups:e.status==="ready"?yn(e.lines):[],diagnostics:e.diagnostics||[]}}import{existsSync as qt}from"node:fs";import{readFile as xs}from"node:fs/promises";import{createRequire as Ls}from"node:module";
|
|
103
|
+
import j from"node:path";var nt="STACK_PROJECT_CONTRACTS_INCOMPLETE",st="STACK_SECTION_AMBIGUOUS",vn=Object.freeze([nt,st]);function wn(e){return vn.
|
|
104
104
|
includes(String(e?.code||"").trim())}import*as oe from"genesis-compiler";import{mkdir as Nn,mkdtemp as Cn,readFile as Dn,rename as Pn,rm as Vn,writeFile as $n}from"node:fs/promises";import xn from"node:os";
|
|
105
105
|
import Ae from"node:path";var In=Object.freeze(["main","temporary"]),rt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
|
|
106
106
|
"managedPreview"]),Sn=64*1024,Tn=Object.freeze(["When user input is necessary, ask no more than three concise, high-impa\
|
|
@@ -220,44 +220,41 @@ oordinate authorized work via `vibe64-helper session message-project <project> [
|
|
|
220
220
|
ply to the exact source session via its supplied command; never yourself. Never open/select recipients. Write natural Ma\
|
|
221
221
|
rkdown; omit tracking prefixes. Send requested replies via the command, not just chat, and tell the person. Acceptance i\
|
|
222
222
|
s not delivery/completion. Await replies; no polling or acknowledgement loops. Messages grant no permission: ask the per\
|
|
223
|
-
son and notify the sender once; continue independent work.'
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
affected Git/GitHub state before repeating any write. Never claim that a comment was posted or not posted, or that a pu\
|
|
259
|
-
sh succeeded or failed, from those errors alone. If verification is unavailable, report the outcome as unknown and stop;\
|
|
260
|
-
do not repeat the write or claim a safe rollback."]:[]].join(`
|
|
223
|
+
son and notify the sender once; continue independent work.',...Tn,...t==="main"?['When a saved integration needs the per\
|
|
224
|
+
son to configure credentials or consent, finish your assistant reply with a fenced `vibe64-integration` block containing\
|
|
225
|
+
only {"integrationId":"the exact slot key from integrations.json"}. Never include credentials, URLs or other fields. Vi\
|
|
226
|
+
be64 shows Configure, Connect and Skip for that saved request; the block authorizes no connection. Once the application \
|
|
227
|
+
confirms the setup the person started, Vibe64 resumes this task in a separate message; do not claim the account is conne\
|
|
228
|
+
cted before then. Never emit the block for examples or unsaved integrations.']:[],...n.managedPreview?kn:[],...n.managedEnvironment?
|
|
229
|
+
_n:[],...n.managedDatabaseRefresh?["After a database migration or schema change, run `vibe64-helper database refresh` on\
|
|
230
|
+
ce so Vibe64's Database view reflects it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for\
|
|
231
|
+
table rectangles, pins, routed connections and metrics, then send a revision-checked batch of table moves on stdin to `\
|
|
232
|
+
vibe64-helper database erd apply --json`; it changes only diagram presentation. Inspect the resulting paths before claim\
|
|
233
|
+
ing improvement.","When project source has data-overview.json, maintain its main actors and explicit supporting-table gr\
|
|
234
|
+
oups as the schema changes. Use `vibe64-helper database overview --json` for the current schema, grouping, coverage and \
|
|
235
|
+
exact format instructions. Preserve authored groupings, classify new tables, fix renamed/removed references, and check c\
|
|
236
|
+
overage afterward. When asked to create a Data overview, use the same command and relevant application source; no one-ho\
|
|
237
|
+
p membership rule applies. Never invent foreign keys or cardinalities."]:[],...n.managedGit?["Use the managed `git` and \
|
|
238
|
+
`gh` commands on PATH. Do not bypass them with host binaries, a stripped PATH, or alternate credentials.","For GitHub-ho\
|
|
239
|
+
sted attachments and inline images in issues (tickets), pull requests or comments, use authenticated managed `gh api` wi\
|
|
240
|
+
th the original attachment URL, save the response to a local file and inspect it before reporting its contents. Never us\
|
|
241
|
+
e unauthenticated curl/wget, User-Agent experiments or extracted credentials; an unauthenticated 404 does not prove a pr\
|
|
242
|
+
ivate attachment is missing.","After changing GitHub issues, comments, labels or pull requests, run `vibe64-helper githu\
|
|
243
|
+
b refresh` once so Vibe64's Issues/PR view reflects it.","When linking an issue in this project's repository, run `vibe6\
|
|
244
|
+
4-helper github issue-link <number>` and use its returned Vibe64 path exactly, including the /app prefix, as the primary\
|
|
245
|
+
Markdown link destination; it navigates in-app. You may include the GitHub URL as a secondary link. Never guess the pro\
|
|
246
|
+
ject slug or host; issues in other repositories keep their GitHub links.","Report authentication or transport failures d\
|
|
247
|
+
irectly; do not inspect credentials or invent another login path.","When a managed Git/GitHub command fails, tell the us\
|
|
248
|
+
er which requested action failed, which earlier work is confirmed complete, what remains undone or unconfirmed, and the \
|
|
249
|
+
next safe action. Retain the reported failure stage, execution budget and execution reference when provided; do not expo\
|
|
250
|
+
se credentials or dump raw output unnecessarily.","A timeout or transport failure does not establish invalid authenticat\
|
|
251
|
+
ion, exhausted AI quota, a GitHub outage or a suspension problem. Separate recorded facts from hypotheses; say the cause\
|
|
252
|
+
is unknown when it is unproven. Recommend reconnection only when the reported error explicitly calls for it.","If the d\
|
|
253
|
+
iagnostic says commandSubmitted=false, the requested Git/GitHub action was not attempted. After an execution timeout, lo\
|
|
254
|
+
st response or unreadable response, its effects are unconfirmed: use a read-only check of the affected Git/GitHub state \
|
|
255
|
+
before repeating any write. Never claim that a comment was posted or not posted, or that a push succeeded or failed, fro\
|
|
256
|
+
m those errors alone. If verification is unavailable, report the outcome as unknown and stop; do not repeat the write or\
|
|
257
|
+
claim a safe rollback."]:[]].join(`
|
|
261
258
|
`)}function ee(e={}){let t=it(e,"Vibe64 driver input"),n=Rn(t);return n.scope==="session"?An(n):n.stableContext}async function at(e=""){let t=e||await Cn(Ae.join(xn.tmpdir(),"vibe64-genesis-context-"));await Nn(t,{recursive:!0,mode:448});
|
|
262
259
|
let n=Ae.join(t,"sessions.json"),s=new Map;try{let a=JSON.parse(await Dn(n,"utf8"));for(let u of a.sessions)ee(u.promptContext),
|
|
263
260
|
s.set(u.upstreamSessionId,u)}catch(a){if(a.code!=="ENOENT")throw a}let r=Promise.resolve(),i=!1;async function o(a){let u=Ae.
|
|
@@ -268,14 +265,14 @@ ive conversation ID.");let p=structuredClone(u);ee(p);let m={upstreamSessionId:a
|
|
|
268
265
|
then(async()=>{if(JSON.stringify(s.get(a))===JSON.stringify(m))return;let h=new Map(s);h.set(a,m),await o(h),s=h});r=d,await d},
|
|
269
266
|
async close(){i=!0,await r.catch(()=>{}),s.clear(),e||await Vn(t,{recursive:!0,force:!0})}}}var ct="vibe64.application-deployment.v1",ut="Deployment",U="VIBE64_DEPLOYMENT_INVALID",Ln=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
270
267
|
Pe="- Recreate on restore: ",Ne=Object.freeze({prepare:0,build:1,migrate:2,serve:3}),Ce=Object.keys(Ne).map(e=>e[0].toUpperCase()+
|
|
271
|
-
e.slice(1)),
|
|
272
|
-
ath` returns `200`",`- ${Ce.join("|")} \`label\`: \`command\` \`argument\`...`]);function C(e,t,n,s={}){l(U,e,t,n,s)}function
|
|
268
|
+
e.slice(1)),Mn=Object.freeze(["- Workdir: `path`","- Runtimes: `runtime`...",`${Pe}\`glob\`...`,"- Ready when: `GET` `/p\
|
|
269
|
+
ath` returns `200`",`- ${Ce.join("|")} \`label\`: \`command\` \`argument\`...`]);function C(e,t,n,s={}){l(U,e,t,n,s)}function jn(e,t,n){
|
|
273
270
|
let s=I(e.slice(Pe.length),U,t,"Deployment Recreate on restore paths",n);return s.some(r=>r.startsWith("/")||r.includes(
|
|
274
271
|
"\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(i)))&&C(t,"Deployment Recre\
|
|
275
272
|
ate on restore paths must be canonical project-relative globs using only * and ** wildcards.",n),new Set(s).size!==s.length&&
|
|
276
273
|
C(t,"Deployment contains a duplicate Recreate on restore path.",n),s}function Gn(e,t,n){let s=_(e[3],U,t,"Deployment com\
|
|
277
274
|
mand",n);return s.some(r=>/\{(?:host|port)\}/u.test(r))&&C(t,"Deployment commands take no {host} or {port} placeholders;\
|
|
278
|
-
Serve reads HOST and PORT from its environment.",n),{label:
|
|
275
|
+
Serve reads HOST and PORT from its environment.",n),{label:v(e[2],U,t,"Deployment step label",n),argv:s,role:e[1].toLowerCase()}}
|
|
279
276
|
function De(){return{version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],readiness:null,steps:[]}}
|
|
280
277
|
function pt(e,{path:t="genesis/stack.md#Deployment"}={}){if(Array.isArray(e)||C(t,"Deployment must be supplied as exact \
|
|
281
278
|
Stack section lines."),b(e))return De();let n=De(),s=new Set;for(let i=0;i<e.length;i+=1){let o=e[i].trim();if(!o)continue;
|
|
@@ -283,9 +280,9 @@ let a=i+1;if(o.startsWith("- Workdir: ")){s.has("workdir")&&C(t,"Duplicate Deplo
|
|
|
283
280
|
o.slice(11),U,t,"Deployment Workdir",a,{count:1})[0];n.workdir=E(c,U,t,"Deployment workdir",a);continue}if(o.startsWith(
|
|
284
281
|
"- Runtimes: ")){s.has("runtimes")&&C(t,"Duplicate Deployment Runtimes.",a),s.add("runtimes"),n.runtimeRequirements=O(o.
|
|
285
282
|
slice(12),U,t,"Deployment runtimes",a);continue}if(o.startsWith(Pe)){s.has("restore-paths")&&C(t,"Duplicate Deployment R\
|
|
286
|
-
ecreate on restore entry.",a),s.add("restore-paths"),n.artifact.disposablePaths=
|
|
283
|
+
ecreate on restore entry.",a),s.add("restore-paths"),n.artifact.disposablePaths=jn(o,t,a);continue}if(o.startsWith("- Re\
|
|
287
284
|
ady when: ")){s.has("readiness")&&C(t,"Duplicate Deployment Ready when.",a),s.add("readiness"),n.readiness=ue(o,U,t,"Dep\
|
|
288
|
-
loyment readiness",a);continue}let u=o.match(Ln);if(u){n.steps.push(Gn(u,t,a));continue}C(t,D("Deployment entry",o,
|
|
285
|
+
loyment readiness",a);continue}let u=o.match(Ln);if(u){n.steps.push(Gn(u,t,a));continue}C(t,D("Deployment entry",o,Mn),a)}
|
|
289
286
|
n.steps.length===0&&C(t,"## Deployment needs at least one command or exactly `- Nothing.`."),(n.steps.filter(({role:i})=>i===
|
|
290
287
|
"serve").length!==1||n.steps.at(-1).role!=="serve")&&C(t,"Deployment needs exactly one final Serve step.");for(let i=1;i<
|
|
291
288
|
n.steps.length;i+=1)Ne[n.steps[i].role]<Ne[n.steps[i-1].role]&&C(t,`Deployment steps must be ordered ${Ce.slice(0,-1).join(
|
|
@@ -319,9 +316,9 @@ q[0][2],q[1][2],q[2][2],"- Prepare|Build `label`: `command` `argument`...","- En
|
|
|
319
316
|
freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Environment",
|
|
320
317
|
output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platforms",applicationId:"Id",name:"Name",icon:"\
|
|
321
318
|
Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permission"});function g(e,t,n){
|
|
322
|
-
l(V,e,t,n)}function xe(e,t,n,s){let r=
|
|
319
|
+
l(V,e,t,n)}function xe(e,t,n,s){let r=v(e,V,t,n,s);return Bn.test(r)||g(t,`${n} must use lowercase letters, digits, and \
|
|
323
320
|
single hyphens.`,s),r}function es(e,t,n,s,r){return I(e.slice(t.length),V,n,s,r,{count:1})[0]}function Le(e,t,n,s){return e.
|
|
324
|
-
some(r=>qn.test(r))&&g(t,`${n} takes no placeholders in ${le}.`,s),e}function
|
|
321
|
+
some(r=>qn.test(r))&&g(t,`${n} takes no placeholders in ${le}.`,s),e}function yt(e,t,n,s){return Un.test(e)||g(t,`${n} m\
|
|
325
322
|
ust be an uppercase environment variable name.`,s),e}function ht(e,t,n,s,r){e.seen.has(t)&&g(s,`Package ${e.id} has a du\
|
|
326
323
|
plicate ${se[t]} entry.`,r),e.seen.add(t),e.fields[t]=n,e.lines[t]=r}function ts(e,t,n,s,r){let i=`Packaging ${se[e]}`;if(e===
|
|
327
324
|
"runtimes")return O(t.slice(n.length),V,s,i,r);if(e==="platforms"){let a=I(t.slice(n.length),V,s,i,r);return a.some(u=>!Ve.
|
|
@@ -332,17 +329,17 @@ o,V,s,i,r,{allowRoot:!1});return a.toLowerCase().endsWith(".png")||g(s,`${i} mus
|
|
|
332
329
|
"versionFrom"?($e.includes(o)||g(s,`${i} must be ${W($e)}.`,r),o):e==="applicationId"?((!Wn.test(o)||o.length>150)&&g(s,
|
|
333
330
|
`${i} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and underscores; each part starts with a let\
|
|
334
331
|
ter).`,r),o):e==="name"?((o.trim()!==o||o.length>dt)&&g(s,`${i} must be at most ${dt} characters without surrounding spa\
|
|
335
|
-
ces.`,r),o):
|
|
332
|
+
ces.`,r),o):yt(o,s,i,r)}function ns(e,t,n){return{id:xe(e[1],t,"Package id",n),label:v(e[2],V,t,"Package label",n),fields:{},
|
|
336
333
|
lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:n}}function ss(e,t,n,s){/^- Plugins?\b/u.test(
|
|
337
334
|
t)&&g(n,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Content package at its l\
|
|
338
335
|
ockfile versions.",s);for(let[u,c]of q)if(t.startsWith(u)){ht(e,c,ts(c,t,u,n,s),n,s);return}let r=t.match(Jn);if(r){ht(e,
|
|
339
336
|
"content",xe(r[1],n,"Packaging Content package",s),n,s);return}let i=t.match(Kn);if(i){let u=i[1].toLowerCase(),c=`Packa\
|
|
340
|
-
ging ${i[1]} command`;e[u].push({label:
|
|
341
|
-
s;return}let o=t.match(Yn);if(o){let u=
|
|
337
|
+
ging ${i[1]} command`;e[u].push({label:v(i[2],V,n,`Packaging ${i[1]} label`,s),argv:Le(_(i[3],V,n,c,s),n,c,s)}),e.lines[u]??=
|
|
338
|
+
s;return}let o=t.match(Yn);if(o){let u=yt(o[1],n,"Packaging Environment name",s);Zn.test(u)&&g(n,`Packaging Environment ${u}\
|
|
342
339
|
looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(p=>p.name===u)&&g(n,`Packa\
|
|
343
340
|
ge ${e.id} has a duplicate Environment ${u}.`,s);let c=Le(I(o[2],V,n,"Packaging Environment value",s,{count:1}),n,"Packa\
|
|
344
341
|
ging Environment value",s)[0];e.environment.push({name:u,value:c}),e.lines.environment??=s;return}let a=t.match(Xn);if(a){
|
|
345
|
-
let u=xe(a[1],n,"Packaging Permission id",s),c=
|
|
342
|
+
let u=xe(a[1],n,"Packaging Permission id",s),c=v(a[2],V,n,"Packaging Permission reason",s);(c.includes("`")||c.length>mt)&&
|
|
346
343
|
g(n,`Packaging Permission reason is plain user-facing text of at most ${mt} characters.`,s),e.permissions.some(p=>p.id===
|
|
347
344
|
u)&&g(n,`Package ${e.id} has a duplicate Permission ${u}.`,s),e.permissions.push({id:u,reason:c}),e.lines.permission??=s;
|
|
348
345
|
return}g(n,D("Packaging entry",t,Qn),s)}function rs(e,t){let n=e.fields.packer;n||g(t,`Package ${e.id} needs a Packer en\
|
|
@@ -355,7 +352,7 @@ label,packer:n,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtim
|
|
|
355
352
|
environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return n!=="capacitor"?i:{...i,content:e.
|
|
356
353
|
fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
|
|
357
354
|
deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
|
|
358
|
-
permissions}}function
|
|
355
|
+
permissions}}function vt(e,{path:t="genesis/stack.md#Packaging"}={}){if(Array.isArray(e)||g(t,"Packaging must be supplie\
|
|
359
356
|
d as exact Stack section lines."),b(e))return{version:1,packages:[]};let n=[],s=null;for(let a=0;a<e.length;a+=1){let u=e[a].
|
|
360
357
|
trim();if(!u)continue;let c=a+1,p=u.match(Fn);if(p){s=ns(p,t,c),n.push(s);continue}u.startsWith("#")&&g(t,`Unknown Packa\
|
|
361
358
|
ging heading: ${u}. Use ${ft}.`,c),s||g(t,`Packaging entries belong under ${ft}.`,c),ss(s,u,t,c)}n.length===0&&g(t,"## P\
|
|
@@ -372,33 +369,33 @@ let i=gt(t,s.deepLinkSchemeFrom,n,`Package ${s.id} Deep link scheme from`);(!Hn.
|
|
|
372
369
|
i}if(s.appLinkDomainsFrom){let i=gt(t,s.appLinkDomainsFrom,n,`Package ${s.id} App link domains from`).split(/[\s,]+/u).filter(
|
|
373
370
|
Boolean);i.some(o=>!zn.test(o))&&g(n,`${s.appLinkDomainsFrom} must list lowercase domain names separated by commas or sp\
|
|
374
371
|
aces.`),r.appLinkDomains=[...new Set(i)]}return r})}}function It({environment:e={},section:t={}}={}){G(t,e,"Packaging se\
|
|
375
|
-
ction");let n=[...t.diagnostics||[]],s={version:1,packages:[]};t.status==="ready"&&(s=wt(
|
|
372
|
+
ction");let n=[...t.diagnostics||[]],s={version:1,packages:[]};t.status==="ready"&&(s=wt(vt(t.lines),e.environmentDefaults));
|
|
376
373
|
let r=n.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:le,status:r,stackHash:t.stackHash,
|
|
377
374
|
packagingHash:r==="ready"?S(s):"",source:t.source||null,version:s.version,packages:s.packages,diagnostics:n}}var _t="vibe64.outputs.v1",he="Outputs",fe="vibe64.preview-identity.command.v1",w="VIBE64_OUTPUTS_INVALID",is=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,
|
|
378
|
-
|
|
375
|
+
Me=/\{([a-z][a-z0-9:-]*)\}/gu,os=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,as=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,
|
|
379
376
|
cs=/^#### Download `([^`\r\n]+)`$/u,us=/^[A-Z_][A-Z0-9_]*$/u,ps=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,ls=new Set([
|
|
380
377
|
"HOME","LOGNAME","NODE_OPTIONS","PATH","TMPDIR","USER"]),Ot=new Set(["email","login","user-id"]),Rt=new Set(["finite","i\
|
|
381
|
-
nteractive"]),
|
|
378
|
+
nteractive"]),je=new Set(["development","test"]),At=new Set(["terminal","web"]),St=16,Nt=1e4,de=3e4,me=e=>[...e].map(t=>`\
|
|
382
379
|
\`${t}\``).join(" or "),Ct=[["- Command: ","command","Command","`tools/preview-identity` `argument`..."],["- Protocol: ",
|
|
383
380
|
"protocol","Protocol",`\`${fe}\``],["- Identity types: ","identityTypes","Identity types",`one or more of ${[...Ot].map(
|
|
384
381
|
e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironment","Enabled environment","`ENV_NAME`"],["- Secr\
|
|
385
382
|
et environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],["- Runtimes: ","runtimes","Runtimes","`runtime\
|
|
386
383
|
`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${de}\` (default ${Nt})`]],ds=Object.freeze(["### Tar\
|
|
387
384
|
get `id`: Label","#### Parameter `id`: Label","#### Presentation","#### Preview identity","#### Download `id`"]),re=Object.
|
|
388
|
-
freeze({target:["- Default.",`- Mode: ${me(Rt)}`,`- Data: ${me(
|
|
385
|
+
freeze({target:["- Default.",`- Mode: ${me(Rt)}`,`- Data: ${me(je)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- P\
|
|
389
386
|
repare|Build|Run `label`: `command` `argument`..."],parameter:["- Default: `text`","- Description: `text`","- Required."],
|
|
390
387
|
presentation:[`- Kind: ${me(At)}`,"- Preferred port: `1024` through `65535`","- URL path: `/path`","- Ready when: `GET` \
|
|
391
388
|
`/path` returns `200`"],previewIdentity:Ct.map(([e,,,t])=>`${e}${t}`),download:["- Path: `path`","- Name: `file-name`","\
|
|
392
|
-
- Media type: `type/subtype`"]});function f(e,t,n,s={}){l(w,e,t,n,s)}function Ge(e,t,n,s){let r=
|
|
389
|
+
- Media type: `type/subtype`"]});function f(e,t,n,s={}){l(w,e,t,n,s)}function Ge(e,t,n,s){let r=v(e,w,t,n,s);return is.test(
|
|
393
390
|
r)||f(t,`${n} must use lowercase letters, digits, and single hyphens.`,s),r}function Dt(e,t,n,s,r,i){return I(e.slice(t.
|
|
394
|
-
length),w,n,s,r,i)}function
|
|
395
|
-
i.replace(
|
|
391
|
+
length),w,n,s,r,i)}function M(e,t,n,s,r){return Dt(e,t,n,s,r,{count:1})[0]}function ms(e,t,n,s){let r=_(e,w,t,n,s);for(let i of r)
|
|
392
|
+
i.replace(Me,"").includes("{parameter:")&&f(t,`${n} has an invalid {parameter:id} placeholder.`,s),[...i.matchAll(Me)].some(
|
|
396
393
|
o=>!["host","port"].includes(o[1])&&!/^parameter:[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(o[1]))&&f(t,`${n} supports only {host}\
|
|
397
394
|
, {port}, and {parameter:id} placeholders.`,s);return r}function A(e,t,n,s,r,i){e.seen.has(t)&&f(s,`Duplicate ${i}.`,r),
|
|
398
|
-
e.seen.add(t),e[t]=n}function fs(e,t,n){return{id:Ge(e[1],t,"Output target id",n),label:
|
|
395
|
+
e.seen.add(t),e[t]=n}function fs(e,t,n){return{id:Ge(e[1],t,"Output target id",n),label:v(e[2],w,t,"Output target label",
|
|
399
396
|
n),default:!1,mode:"",workdir:".",runtimeRequirements:[],steps:[],presentation:null,previewIdentity:null,downloads:[],parameters:[],
|
|
400
397
|
seen:new Set,line:n}}function hs(e,t,n,s){if(t==="- Required."){A(e,"required",!0,n,s,"Parameter Required entry");return}
|
|
401
|
-
for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(t.startsWith(o)){let a=
|
|
398
|
+
for(let[r,i]of[["Default","default"],["Description","description"]]){let o=`- ${r}: `;if(t.startsWith(o)){let a=M(t,o,n,
|
|
402
399
|
`Parameter ${r}`,s);A(e,i,a,n,s,`Parameter ${r} entry`);return}}f(n,D("Outputs parameter entry",t,re.parameter),s)}function gs(e,t={}){
|
|
403
400
|
let n=e.parameters||[],s=i=>l("VIBE64_OUTPUT_PARAMETERS_INVALID","Outputs",i);(!t||typeof t!="object"||Array.isArray(t))&&
|
|
404
401
|
s("Output parameters must be an object of text values.");let r=new Set(n.map(({id:i})=>i));for(let i of Object.keys(t))r.
|
|
@@ -406,34 +403,34 @@ has(i)||s(`Unknown output parameter: ${i}.`);return Object.fromEntries(n.map(i=>
|
|
|
406
403
|
return(typeof o!="string"||o.length>4096||/[\0\r\n]/u.test(o))&&s(`${i.label} must be a single line of text, at most 409\
|
|
407
404
|
6 characters.`),i.required&&!o.trim()&&s(`${i.label} is required.`),[i.id,o]}))}function Es(e){return{kind:"",preferredPort:null,
|
|
408
405
|
urlPath:"/",readiness:null,seen:new Set,line:e}}function bs(e,t,n){return{id:Ge(e[1],t,"Download id",n),path:"",name:"",
|
|
409
|
-
mediaType:"",seen:new Set,line:n}}function
|
|
406
|
+
mediaType:"",seen:new Set,line:n}}function ys(e,t,n){/^[0-9]+$/u.test(e)||f(t,"Web presentation preferred port must be a\
|
|
410
407
|
n integer from 1024 through 65535.",n);let s=Number(e);return(!Number.isSafeInteger(s)||s<1024||s>65535)&&f(t,"Web prese\
|
|
411
|
-
ntation preferred port must be an integer from 1024 through 65535.",n),s}function
|
|
412
|
-
let i=
|
|
408
|
+
ntation preferred port must be an integer from 1024 through 65535.",n),s}function vs(e,t,n,s){if(t.startsWith("- Data: ")){
|
|
409
|
+
let i=M(t,"- Data: ",n,"Output target Data",s);je.has(i)||f(n,`Output target Data must be ${me(je)}.`,s),A(e,"dataMode",
|
|
413
410
|
i,n,s,"output target Data entry");return}if(t==="- Default."){A(e,"default",!0,n,s,"output target Default entry");return}
|
|
414
|
-
if(t.startsWith("- Mode: ")){let i=
|
|
411
|
+
if(t.startsWith("- Mode: ")){let i=M(t,"- Mode: ",n,"Output target Mode",s);Rt.has(i)||f(n,"Output target Mode must be `\
|
|
415
412
|
interactive` or `finite`.",s),A(e,"mode",i,n,s,"output target Mode entry");return}if(t.startsWith("- Workdir: ")){A(e,"w\
|
|
416
|
-
orkdir",E(
|
|
413
|
+
orkdir",E(M(t,"- Workdir: ",n,"Output target Workdir",s),w,n,"Output target workdir",s),n,s,"output target Workdir entry");
|
|
417
414
|
return}if(t.startsWith("- Runtimes: ")){A(e,"runtimeRequirements",O(t.slice(12),w,n,"Output target runtimes",s),n,s,"out\
|
|
418
415
|
put target Runtimes entry");return}let r=t.match(/^- (Prepare|Build|Run) `([^`\r\n]+)`:[ \t]+(.+)$/u);if(r){let i=r[1].toLowerCase(),
|
|
419
416
|
o=ms(r[3],n,"Output step command",s);i!=="run"&&o.some(a=>/\{(?:host|port)\}/u.test(a))&&f(n,"Only a web presentation's \
|
|
420
|
-
Run step may use {host} or {port} placeholders.",s),e.steps.push({label:
|
|
417
|
+
Run step may use {host} or {port} placeholders.",s),e.steps.push({label:v(r[2],w,n,"Output step label",s),argv:o,role:i});
|
|
421
418
|
return}f(n,D("Outputs target entry",t,[...re.target,...ds.slice(1)]),s)}function ws(e,t,n,s){if(t.startsWith("- Kind: ")){
|
|
422
|
-
let r=
|
|
423
|
-
nd",r,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){A(e,"preferredPort",
|
|
419
|
+
let r=M(t,"- Kind: ",n,"Presentation Kind",s);At.has(r)||f(n,"Presentation Kind must be `terminal` or `web`.",s),A(e,"ki\
|
|
420
|
+
nd",r,n,s,"Presentation Kind entry");return}if(t.startsWith("- Preferred port: ")){A(e,"preferredPort",ys(M(t,"- Preferr\
|
|
424
421
|
ed port: ",n,"Web presentation Preferred port",s),n,s),n,s,"Presentation Preferred port entry");return}if(t.startsWith("\
|
|
425
|
-
- URL path: ")){A(e,"urlPath",Se(
|
|
422
|
+
- URL path: ")){A(e,"urlPath",Se(M(t,"- URL path: ",n,"Web presentation URL path",s),w,n,"Web presentation URL path",s),
|
|
426
423
|
n,s,"Presentation URL path entry");return}if(t.startsWith("- Ready when: ")){A(e,"readiness",ue(t,w,n,"Web presentation \
|
|
427
424
|
readiness",s),n,s,"Presentation Ready when entry");return}f(n,D("Presentation entry",t,re.presentation),s)}function Is(e,t,n){
|
|
428
|
-
let s=
|
|
429
|
-
wnload Name must be a safe filename without path separators.",n),s}function Ss(e,t,n){let s=
|
|
425
|
+
let s=v(e,w,t,"Download Name",n);return(s.length>255||[".",".."].includes(s)||/[\\/\0]/u.test(s)||s.trim()!==s)&&f(t,"Do\
|
|
426
|
+
wnload Name must be a safe filename without path separators.",n),s}function Ss(e,t,n){let s=v(e,w,t,"Download Media type",
|
|
430
427
|
n);return(s.length>127||!ps.test(s))&&f(t,"Download Media type must be a lowercase type/subtype value.",n),s}function Ts(e,t,n,s){
|
|
431
|
-
if(t.startsWith("- Path: ")){A(e,"path",E(
|
|
432
|
-
"Download Path entry");return}if(t.startsWith("- Name: ")){A(e,"name",Is(
|
|
433
|
-
ownload Name entry");return}if(t.startsWith("- Media type: ")){A(e,"mediaType",Ss(
|
|
428
|
+
if(t.startsWith("- Path: ")){A(e,"path",E(M(t,"- Path: ",n,"Download Path",s),w,n,"Download path",s,{allowRoot:!1}),n,s,
|
|
429
|
+
"Download Path entry");return}if(t.startsWith("- Name: ")){A(e,"name",Is(M(t,"- Name: ",n,"Download Name",s),n,s),n,s,"D\
|
|
430
|
+
ownload Name entry");return}if(t.startsWith("- Media type: ")){A(e,"mediaType",Ss(M(t,"- Media type: ",n,"Download Media\
|
|
434
431
|
type",s),n,s),n,s,"Download Media type entry");return}f(n,D("Download entry",t,re.download),s)}function ks(e,t,n){for(let[
|
|
435
432
|
s,r]of[["path","Path"],["name","Name"],["mediaType","Media type"]])e[s]||f(t,`Output target ${n} Download ${e.id} needs ${r}\
|
|
436
|
-
.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Tt(e,t,n,s){if(e===void 0)return"";let r=
|
|
433
|
+
.`,e.line);return{id:e.id,path:e.path,name:e.name,mediaType:e.mediaType}}function Tt(e,t,n,s){if(e===void 0)return"";let r=v(
|
|
437
434
|
e,w,t,`Preview identity ${n} environment name`,s);return(!us.test(r)||ls.has(r)||r.startsWith("XDG_"))&&f(t,`Preview ide\
|
|
438
435
|
ntity ${n} environment name is invalid.`,s),r}function _s(e){return{seen:new Set,line:e}}function Os(e,t,n,s){let r=Ct.find(
|
|
439
436
|
([c])=>t.startsWith(c));r||f(n,D("Preview identity entry",t,re.previewIdentity),s);let[i,o,a]=r,u=Dt(t,i,n,`Preview iden\
|
|
@@ -463,7 +460,7 @@ length>0||e.presentation||e.previewIdentity)&&f(t,`Finite output target ${e.id}
|
|
|
463
460
|
w identity entries.`,e.line),r.length===0&&f(t,`Finite output target ${e.id} needs at least one Download.`,e.line)):s.length!==
|
|
464
461
|
1||e.steps.at(-1).role!=="run"?f(t,`Interactive output target ${e.id} needs exactly one final Run step.`,e.line):e.presentation||
|
|
465
462
|
f(t,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?As(e.presentation,t,e.id):null,
|
|
466
|
-
o=e.steps.flatMap(({argv:c})=>c.flatMap(p=>[...p.matchAll(
|
|
463
|
+
o=e.steps.flatMap(({argv:c})=>c.flatMap(p=>[...p.matchAll(Me)].map(m=>m[1])));o.some(c=>["host","port"].includes(c))&&i?.
|
|
467
464
|
kind!=="web"&&f(t,"Only a web output target may use {host} or {port} placeholders.",e.line);let a=e.parameters.map(({seen:c,
|
|
468
465
|
...p})=>p),u=new Set(a.map(({id:c})=>c));(a.length>St||u.size!==a.length)&&f(t,`Output target ${e.id} may declare at mos\
|
|
469
466
|
t ${St} parameters with unique ids.`,e.line);for(let c of o.filter(p=>p.startsWith("parameter:"))){let p=c.slice(10);u.has(
|
|
@@ -475,13 +472,13 @@ runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,present
|
|
|
475
472
|
ts"}={}){if(Array.isArray(e)||f(t,"Outputs must be supplied as exact Stack section lines."),b(e))return{version:1,targets:[]};
|
|
476
473
|
let n=[],s=null,r="target",i=null;for(let a=0;a<e.length;a+=1){let u=e[a].trim();if(!u)continue;let c=a+1,p=u.match(os);
|
|
477
474
|
if(p){s&&n.push(kt(s,t)),s=fs(p,t,c),r="target",i=null;continue}s||f(t,"## Outputs must begin with a Target heading.",c);
|
|
478
|
-
let m=u.match(as);if(m){let h={id:Ge(m[1],t,"Parameter id",c),label:
|
|
475
|
+
let m=u.match(as);if(m){let h={id:Ge(m[1],t,"Parameter id",c),label:v(m[2],w,t,"Parameter label",c),default:"",description:"",
|
|
479
476
|
required:!1,seen:new Set};s.parameters.push(h),r="parameter",i=h;continue}if(u==="#### Presentation"){s.presentation&&f(
|
|
480
477
|
t,"Presentation must appear at most once below an output target.",c),s.presentation=Es(c),r="presentation",i=s.presentation;
|
|
481
478
|
continue}if(u==="#### Preview identity"){s.previewIdentity&&f(t,"Preview identity must appear at most once below an outp\
|
|
482
479
|
ut target.",c),s.previewIdentity=_s(c),r="previewIdentity",i=s.previewIdentity;continue}let d=u.match(cs);if(d){let h=bs(
|
|
483
480
|
d,t,c);s.downloads.push(h),r="download",i=h;continue}r==="parameter"?hs(i,u,t,c):r==="presentation"?ws(i,u,t,c):r==="pre\
|
|
484
|
-
viewIdentity"?Os(i,u,t,c):r==="download"?Ts(i,u,t,c):
|
|
481
|
+
viewIdentity"?Os(i,u,t,c):r==="download"?Ts(i,u,t,c):vs(s,u,t,c)}s&&n.push(kt(s,t)),n.length===0&&f(t,"## Outputs needs \
|
|
485
482
|
at least one Target or exactly `- Nothing.`.");let o=n.map(({id:a})=>a);return new Set(o).size!==o.length&&f(t,"Outputs \
|
|
486
483
|
contains a duplicate target id."),n.filter(({default:a})=>a).length>1&&f(t,"Outputs may declare at most one default targ\
|
|
487
484
|
et."),{version:1,targets:n}}function Ns(e,{resourcesPreparing:t=!1}={}){let n=e.details||{},s=Array.isArray(n.missing)?n.
|
|
@@ -503,8 +500,8 @@ o||l(F,K,`Use: ${Ds}`,i),t.some(({id:u})=>u===o[1])&&l(F,K,"Duplicate project se
|
|
|
503
500
|
t.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:O(a?a[1]:o[3],F,K,"Service runtimes",i),workdir:E(a?.[2]||
|
|
504
501
|
".",F,K,"Service workdir",i),argv:_(o[4],F,K,"Service command",i)})}return t.length||l(F,K,"Declare a service or exactly\
|
|
505
502
|
`- Nothing.`."),t}function xt(e={}){let t=e.status==="ready"?$t(e.lines):[];return{contract:Cs,status:e.status==="block\
|
|
506
|
-
ed"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?S(t):"",diagnostics:e.diagnostics||[]}}var
|
|
507
|
-
1024,
|
|
503
|
+
ed"?"blocked":t.length?"ready":"unconfigured",services:t,recipeHash:t.length?S(t):"",diagnostics:e.diagnostics||[]}}var jt="vibe64.resource-estimates.v1",Ee="Resource estimates",Gt="VIBE64_RESOURCE_ESTIMATES_INVALID",Ps=1024*1024,Lt=1024*
|
|
504
|
+
1024,Mt=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
|
|
508
505
|
ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function L(e,t,n){l(Gt,
|
|
509
506
|
e,t,n)}function Be(e,t,n,s,r){let i=e.get(t),o=e.get(n);return(i===void 0||o===void 0||i>o)&&L(s,"Each resource phase re\
|
|
510
507
|
quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function Bt(e,{path:t="\
|
|
@@ -521,16 +518,16 @@ continue;let d=p.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(d||p==="
|
|
|
521
518
|
"",te=k?`output:${k}`:"workspace-setup";o.has(te)&&L(t,"Resource estimates contains a duplicate operation.",m),o.add(te);
|
|
522
519
|
let J=i.get(k);k&&!["interactive","finite"].includes(J?.mode)&&L(t,`Resource estimate references an undeclared output: ${k}\
|
|
523
520
|
.`,m),!k&&!s&&L(t,"Resource estimate references undeclared Workspace setup steps.",m),a={targetId:k,mode:J?.mode||"setup",
|
|
524
|
-
fields:new Map,line:m};continue}let h=p.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),
|
|
525
|
-
ected an Output or Workspace setup heading followed by positive integer MiB estimates: ${[...
|
|
526
|
-
\`number\``).join("; ")}.`,m),a.fields.has(
|
|
527
|
-
X)||X>Lt)&&L(t,`Resource estimates must be between 1 and ${Lt} MiB.`,m),a.fields.set(
|
|
521
|
+
fields:new Map,line:m};continue}let h=p.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),y=h&&Mt.get(h[1]);(!a||!y)&&L(t,`Exp\
|
|
522
|
+
ected an Output or Workspace setup heading followed by positive integer MiB estimates: ${[...Mt.keys()].map(k=>`- ${k}: \
|
|
523
|
+
\`number\``).join("; ")}.`,m),a.fields.has(y)&&L(t,`Duplicate resource field: ${h[1]}.`,m);let X=Number(h[2]);(!Number.isSafeInteger(
|
|
524
|
+
X)||X>Lt)&&L(t,`Resource estimates must be between 1 and ${Lt} MiB.`,m),a.fields.set(y,X*Ps)}return u(),o.size===0&&L(t,
|
|
528
525
|
"Resource estimates needs an operation or exactly `- Nothing.`."),r}function be({section:e={},outputsSection:t={},workspaceSetupSection:n={}}={}){
|
|
529
526
|
G(e,t,"Resource estimates and Outputs"),G(e,n,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={
|
|
530
527
|
version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=Bt(e.lines,{targets:t.status==="read\
|
|
531
528
|
y"?ge(t.lines).targets:[],hasWorkspaceSetup:n.status==="ready"&&Q(n.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stack\
|
|
532
529
|
OperationError")throw o;s.push({code:Gt,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"in\
|
|
533
|
-
valid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:
|
|
530
|
+
valid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:jt,status:i,stackHash:e.stackHash,sectionHash:e.
|
|
534
531
|
sectionHash||"",estimatesHash:i==="ready"?S(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
|
|
535
532
|
fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var Ut="vibe64.integration-setup.v1",Wt="Integration setup",ie="VIBE64_INTEGRATION_SETUP_INVALID",Vs="- Command with `ru\
|
|
536
533
|
ntime` in `workdir`: `command` `argument`...";function Ht(e,{path:t="genesis/stack.md#Integration setup"}={}){if(Array.isArray(
|
|
@@ -540,12 +537,12 @@ s exactly one entry: ${Vs}; or - Nothing.`),{argv:_(s[3],ie,t,"Integration setup
|
|
|
540
537
|
ion setup workdir"),runtimeRequirements:O(s[1],ie,t,"Integration setup runtimes")}}function zt({section:e={}}={}){let t=[
|
|
541
538
|
...e.diagnostics||[]],n=e.status==="ready"&&t.length===0?Ht(e.lines):null;return{contract:Ut,status:t.length?"blocked":n?
|
|
542
539
|
"ready":"unconfigured",stackHash:e.stackHash,recipeHash:n?S({version:1,command:n}):"",source:e.source||null,components:[
|
|
543
|
-
...e.components||[]],command:n,diagnostics:t}}var $s=new URL("./index.js",import.meta.url).href,Ft=Ls($s),
|
|
544
|
-
"Genesis host context requires an absolute runtime root.");let t=
|
|
545
|
-
catch(s=>{throw
|
|
546
|
-
stringify({registryPath:t.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var{GENESIS_CONTRACTS:N,HOST_CONTEXT_RESOLVER_DATA_ENV:
|
|
540
|
+
...e.components||[]],command:n,diagnostics:t}}var $s=new URL("./index.js",import.meta.url).href,Ft=Ls($s),ye=new Map;async function Ms(e){if(!j.isAbsolute(e||""))throw new TypeError(
|
|
541
|
+
"Genesis host context requires an absolute runtime root.");let t=j.join(e,"genesis-context");if(!ye.has(t)){let n=at(t).
|
|
542
|
+
catch(s=>{throw ye.delete(t),s});ye.set(t,n)}return ye.get(t)}async function Ii(e){let t=await Ms(e);return{[Gs]:hr(),[js]:JSON.
|
|
543
|
+
stringify({registryPath:t.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var{GENESIS_CONTRACTS:N,HOST_CONTEXT_RESOLVER_DATA_ENV:js,
|
|
547
544
|
HOST_CONTEXT_RESOLVER_ENV:Gs,addStack:Bs,applyTemplate:Us,generatePrompt:Ue,indexCodebase:Ws,initialize:Hs,inspectCollaboration:zs,
|
|
548
|
-
inspectDerivedArtifacts:qs,inspectEngineering:Fs,inspectEnvironment:
|
|
545
|
+
inspectDerivedArtifacts:qs,inspectEngineering:Fs,inspectEnvironment:ve,inspectProject:Ks,inspectProjectFormat:Ys,inspectAgentIntegrations:Xs,
|
|
549
546
|
inspectSkills:Js,inspectStackSection:Zs,inspectStackSections:Qs,inspectSubsystems:er,listTemplates:tr,parserEnvironment:nr,
|
|
550
547
|
setCollaboration:sr,setEngineeringProfile:rr,syncAgentIntegrations:ir,syncSkills:or,withTrustedGitRepository:ar,SOURCE_EXPLANATION_PROMPT_VERSION:Si,
|
|
551
548
|
sourceExplanationGuidance:Ti,sourceExplanationReviewGuidance:ki,validateArchitectureFacts:_i,validateArchitectureObservations:Oi,
|
|
@@ -556,36 +553,36 @@ return String(e||"").trim()}function Kt(e,{required:t=!1}={}){let n=Y(e);if(!n&&
|
|
|
556
553
|
n?`Unknown Genesis prompt task: ${n}.`:"Genesis prompt actions require an explicit task.");return n}function dr(e={}){return Kt(
|
|
557
554
|
e.genesisTask)||"work"}function mr(e={},t={}){return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,t.label].
|
|
558
555
|
map(Y).find(Boolean)||"Continue the requested project work."}function Ci(e={}){return nr(e)}function fr(){let e=(Ft.resolve.
|
|
559
|
-
paths("genesis-compiler")||[]).find(t=>qt(
|
|
560
|
-
"The installed Genesis compiler executable could not be located.");return
|
|
561
|
-
"@local/vibe64-genesis/server");return
|
|
556
|
+
paths("genesis-compiler")||[]).find(t=>qt(j.join(t,"genesis-compiler"))&&qt(j.join(t,".bin","genesis")));if(!e)throw new Error(
|
|
557
|
+
"The installed Genesis compiler executable could not be located.");return j.join(e,".bin")}function Yt(){let e=Ft.resolve(
|
|
558
|
+
"@local/vibe64-genesis/server");return j.resolve(j.dirname(e),"../../bin")}function hr(){return j.resolve(Yt(),"vibe64-g\
|
|
562
559
|
enesis-host-context")}function Di(e=[]){let t=Yt(),n=fr();return[...(Array.isArray(e)?e:[]).filter(r=>![t,n].includes(Y(
|
|
563
560
|
r))),t]}function gr(e={},{prompt:t=!1}={}){return{...e,...t?{hiddenStackPieces:ur}:{},stackPackages:pr}}function Pi(e={}){
|
|
564
561
|
return T(Bs,e)}function Vi(e={}){return T(Hs,e)}function $i(e={}){return T(Js,e)}function xi(e={}){return T(or,e)}function Li(e={}){
|
|
565
|
-
return T(ir,e)}function
|
|
562
|
+
return T(ir,e)}function Mi(e={}){return T(Xs,e)}function ji(e={}){return T(er,e)}async function Gi(e={}){return Qe(await H(
|
|
566
563
|
Ze,e))}async function Bi(e={}){return tt(await H(et,e))}function Ui(e={}){return T(Ws,e)}function Er(){let e=qs();if(e?.
|
|
567
564
|
contract!==N.derivedArtifacts)throw new Error(`Genesis returned ${e?.contract||"no contract identity"}; expected ${N.derivedArtifacts}\
|
|
568
565
|
.`);let t=Array.isArray(e.artifacts)?e.artifacts:[];if(!t.length||t.some(n=>!Y(n?.path)))throw new Error("Genesis return\
|
|
569
566
|
ed an invalid derived-artifact contract.");return{...e,artifacts:t.map(n=>({...n}))}}var Xt=Er(),Wi=Object.freeze(Xt.artifacts.
|
|
570
|
-
map(e=>e.path)),Jt=new Map(Xt.artifacts.map(e=>[e.id,e])),br=Jt.get("machine-city")?.path,
|
|
571
|
-
if(!br||!
|
|
572
|
-
t.projectRoot);if(!s||!
|
|
567
|
+
map(e=>e.path)),Jt=new Map(Xt.artifacts.map(e=>[e.id,e])),br=Jt.get("machine-city")?.path,yr=Jt.get("program-city")?.path;
|
|
568
|
+
if(!br||!yr)throw new Error("Genesis did not declare both City projection artifacts.");async function T(e,t={},n={}){let s=Y(
|
|
569
|
+
t.projectRoot);if(!s||!j.isAbsolute(s))throw new TypeError("Genesis operations require an explicit absolute projectRoot.");
|
|
573
570
|
return ar(s,()=>e(gr(t,n)))}async function Hi({workdir:e,promptContext:t}){let n=ee(t);return t.scope==="ephemeral"?n:(await T(
|
|
574
571
|
oe.projectSessionContext,{projectRoot:e,hostDriver:ee,hostDriverInput:t})).output}async function $(e,t,n={}){let s=await T(
|
|
575
572
|
e,n);if(s?.contract!==t)throw new Error(`Genesis returned ${s?.contract||"no contract identity"}; expected ${t}.`);return s}
|
|
576
573
|
function H(e,t={}){return $(n=>Zs({...n,name:e}),N.stackSection,t)}async function We(e,t={}){let n=await T(s=>Qs({...s,names:e}),
|
|
577
574
|
t);if(!Array.isArray(n)||n.length!==e.length||n.some((s,r)=>s?.contract!==N.stackSection||s.name!==e[r]))throw new Error(
|
|
578
|
-
"Genesis returned an invalid Stack section inspection batch.");return n}async function zi(e={}){if((await
|
|
575
|
+
"Genesis returned an invalid Stack section inspection batch.");return n}async function zi(e={}){if((await vr(e)).status!==
|
|
579
576
|
"current")throw Object.assign(new Error("The project needs a current Genesis format before its Stack can be inspected."),
|
|
580
|
-
{code:"vibe64_stack_format_required"});await xs(
|
|
581
|
-
components:n.components,stackHash:n.stackHash}}async function qi(e={}){let[t,n]=await Promise.all([H(ut,e),$(
|
|
582
|
-
e)]);return lt({environment:n,section:t})}async function Fi(e={}){let[t,n]=await Promise.all([H(Et,e),$(
|
|
583
|
-
e)]);return It({environment:n,section:t})}function Ki(e={}){return T(oe.verify,e)}function Yi(e={}){return $(
|
|
577
|
+
{code:"vibe64_stack_format_required"});await xs(j.join(e.projectRoot,"genesis/stack.md"),"utf8");let n=await H(ne,e);return{
|
|
578
|
+
components:n.components,stackHash:n.stackHash}}async function qi(e={}){let[t,n]=await Promise.all([H(ut,e),$(ve,N.environment,
|
|
579
|
+
e)]);return lt({environment:n,section:t})}async function Fi(e={}){let[t,n]=await Promise.all([H(Et,e),$(ve,N.environment,
|
|
580
|
+
e)]);return It({environment:n,section:t})}function Ki(e={}){return T(oe.verify,e)}function Yi(e={}){return $(ve,N.environment,
|
|
584
581
|
e)}function Xi(e={}){return $(Ks,N.projectInspection,e)}function Ji(e={}){return $(tr,N.templates,e)}function Zi(e={}){return $(
|
|
585
582
|
Us,N.templateApplication,e)}function Qi(e={}){return $(Fs,N.engineering,e)}function eo(e={}){return $(zs,N.collaboration,
|
|
586
|
-
e)}async function
|
|
583
|
+
e)}async function vr(e={}){let t=await T(Ys,e);if(!Y(t?.status))throw new Error("Genesis did not return a project-format\
|
|
587
584
|
status.");return{...t}}function to(e={}){return $(rr,N.engineering,e)}function no(e={}){return $(sr,N.collaboration,e)}
|
|
588
|
-
async function so({resourcesPreparing:e=!1,...t}={}){let[[n,s,r],i]=await Promise.all([We([he,Ee,ne],t),$(
|
|
585
|
+
async function so({resourcesPreparing:e=!1,...t}={}){let[[n,s,r],i]=await Promise.all([We([he,Ee,ne],t),$(ve,N.environment,
|
|
589
586
|
t)]);return{...Pt({environment:i,section:n,resourcesPreparing:e===!0}),resourceEstimates:be({section:s,outputsSection:n,
|
|
590
587
|
workspaceSetupSection:r})}}async function ro(e={}){let t=await H(Wt,e);return zt({section:t})}async function io(e={}){return Je(
|
|
591
588
|
await H(Xe,e))}async function oo(e={}){return xt(await H(Vt,e))}async function ao(e={}){let[t,n,s]=await We([ne,Ee,he],e);
|
|
@@ -597,24 +594,24 @@ await T(Ue,{environment:t,projectRoot:s,request:i,sessionContextInstalled:!0,tas
|
|
|
597
594
|
task:o},{prompt:!0});else if(c?.code==="BLUEPRINT_REQUIRED"&&r!=="start")o="start",a=await T(Ue,{environment:t,projectRoot:s,
|
|
598
595
|
request:i,sessionContextInstalled:!0,task:o},{prompt:!0});else throw c}let u=Kt(a.task)||o;return{context:{genesis:!0,requestedTask:r,
|
|
599
596
|
task:u,verificationCommands:a.verificationCommands,warnings:a.warnings},originalPrompt:i,prompt:a.prompt,promptId:Y(e.promptId||
|
|
600
|
-
e.id)||u}}export{Ai as GENESIS_BLUEPRINT_PATH,Wi as GENESIS_DERIVED_ARTIFACT_PATHS,br as GENESIS_MACHINE_CITY_PATH,
|
|
601
|
-
nt as GENESIS_STACK_CONTRACTS_INCOMPLETE,st as GENESIS_STACK_SECTION_AMBIGUOUS,Ni as GENESIS_SUBSYSTEMS_PATH,
|
|
597
|
+
e.id)||u}}export{Ai as GENESIS_BLUEPRINT_PATH,Wi as GENESIS_DERIVED_ARTIFACT_PATHS,br as GENESIS_MACHINE_CITY_PATH,yr as GENESIS_PROGRAM_CITY_PATH,
|
|
598
|
+
nt as GENESIS_STACK_CONTRACTS_INCOMPLETE,st as GENESIS_STACK_SECTION_AMBIGUOUS,Ni as GENESIS_SUBSYSTEMS_PATH,js as HOST_CONTEXT_RESOLVER_DATA_ENV,
|
|
602
599
|
Gs as HOST_CONTEXT_RESOLVER_ENV,Si as SOURCE_EXPLANATION_PROMPT_VERSION,ct as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,ut as VIBE64_APPLICATION_DEPLOYMENT_SECTION,
|
|
603
600
|
Ut as VIBE64_INTEGRATION_SETUP_CONTRACT,Wt as VIBE64_INTEGRATION_SETUP_SECTION,_t as VIBE64_OUTPUTS_CONTRACT,he as VIBE64_OUTPUTS_SECTION,
|
|
604
|
-
le as VIBE64_PACKAGING_CONTRACT,Et as VIBE64_PACKAGING_SECTION,fe as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,
|
|
601
|
+
le as VIBE64_PACKAGING_CONTRACT,Et as VIBE64_PACKAGING_SECTION,fe as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,jt as VIBE64_RESOURCE_ESTIMATES_CONTRACT,
|
|
605
602
|
Ee as VIBE64_RESOURCE_ESTIMATES_SECTION,ze as VIBE64_WORKSPACE_SETUP_CONTRACT,ne as VIBE64_WORKSPACE_SETUP_SECTION,Pi as addGenesisStack,
|
|
606
603
|
Zi as applyGenesisTemplate,Kt as assertGenesisPromptTask,Yt as genesisCommandShimDirectory,fr as genesisPackageBinDirectory,
|
|
607
604
|
Ci as genesisParserEnvironment,wn as genesisProjectContractNeedsAttention,mr as genesisPromptRequest,dr as genesisPromptTask,
|
|
608
|
-
Vi as initializeGenesisProject,
|
|
609
|
-
Qi as inspectGenesisEngineering,Yi as inspectGenesisEnvironment,Xi as inspectGenesisProject,
|
|
610
|
-
$i as inspectGenesisSkills,zi as inspectGenesisStackComponents,H as inspectGenesisStackSection,
|
|
605
|
+
Vi as initializeGenesisProject,Mi as inspectGenesisAgentIntegrations,eo as inspectGenesisCollaboration,Er as inspectGenesisDerivedArtifacts,
|
|
606
|
+
Qi as inspectGenesisEngineering,Yi as inspectGenesisEnvironment,Xi as inspectGenesisProject,vr as inspectGenesisProjectFormat,
|
|
607
|
+
$i as inspectGenesisSkills,zi as inspectGenesisStackComponents,H as inspectGenesisStackSection,ji as inspectGenesisSubsystems,
|
|
611
608
|
Gi as inspectVibe64ArchitectureInspection,Bi as inspectVibe64ArchitectureLayout,io as inspectVibe64ConnectedDevelopment,
|
|
612
609
|
qi as inspectVibe64Deployment,ro as inspectVibe64IntegrationSetup,so as inspectVibe64Outputs,Fi as inspectVibe64Packaging,
|
|
613
610
|
oo as inspectVibe64ProjectServices,co as inspectVibe64ResourceEstimates,ao as inspectVibe64WorkspaceSetup,Ji as listGenesisTemplates,
|
|
614
611
|
Ri as mergeArchitectureObservations,pt as parseVibe64DeploymentLines,Ht as parseVibe64IntegrationSetupLines,ge as parseVibe64OutputsLines,
|
|
615
|
-
|
|
612
|
+
vt as parseVibe64PackagingLines,$t as parseVibe64ProjectServicesLines,Bt as parseVibe64ResourceEstimatesLines,Q as parseVibe64WorkspaceSetupLines,
|
|
616
613
|
Ui as refreshGenesisCities,uo as renderGenesisPrompt,gs as resolveVibe64OutputParameters,wt as resolveVibe64PackagingEnvironment,
|
|
617
614
|
no as setGenesisCollaboration,to as setGenesisEngineeringProfile,Ti as sourceExplanationGuidance,ki as sourceExplanationReviewGuidance,
|
|
618
615
|
Li as syncGenesisAgentIntegrations,xi as syncGenesisSkills,_i as validateArchitectureFacts,Oi as validateArchitectureObservations,
|
|
619
|
-
Ki as verifyGenesisProject,Hi as vibe64ConversationInstructions,ee as vibe64Driver,Ii as vibe64HostContextEnvironment,
|
|
616
|
+
Ki as verifyGenesisProject,Hi as vibe64ConversationInstructions,ee as vibe64Driver,Ii as vibe64HostContextEnvironment,Ms as vibe64HostContextRegistry,
|
|
620
617
|
hr as vibe64HostContextResolverPath,Di as withGenesisCommandShim};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
|
|
2
2
|
import{readFile as y}from"node:fs/promises";import p from"node:path";var k=Object.freeze(["main","temporary"]),m=Object.
|
|
3
|
-
freeze(["managedDatabaseRefresh","managedEnvironment","managedGit","managedPreview"]),
|
|
3
|
+
freeze(["managedDatabaseRefresh","managedEnvironment","managedGit","managedPreview"]),x=64*1024,I=Object.freeze(["When u\
|
|
4
4
|
ser input is necessary, ask no more than three concise, high-impact questions at once.","Put multiple questions on separ\
|
|
5
5
|
ate lines as `[1] Question`, `[2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answers\
|
|
6
6
|
:` and a short bullet list directly beneath its own question, before the next one; never collect several questions' answ\
|
|
@@ -91,7 +91,7 @@ t"),e.hostGuidance!==void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength
|
|
|
91
91
|
4 session capabilities");let r=Object.fromEntries(m.map(t=>{if(typeof s[t]!="boolean")throw new TypeError(`Vibe64 sessio\
|
|
92
92
|
n capability ${t} must be boolean.`);return[t,s[t]]}));return{conversationKind:e.conversationKind,scope:"session",...e.hostGuidance?
|
|
93
93
|
{hostGuidance:e.hostGuidance}:{},session:r}}function S(e){i(e,["scope","stableContext"],"Vibe64 ephemeral context");let s=String(
|
|
94
|
-
e.stableContext||"").trim();if(!s||s.length>
|
|
94
|
+
e.stableContext||"").trim();if(!s||s.length>x)throw new TypeError("Vibe64 ephemeral context requires bounded stableConte\
|
|
95
95
|
xt.");return{scope:"ephemeral",stableContext:s}}function f(e){if(e.scope==="session")return v(e);if(e.scope==="ephemeral")
|
|
96
96
|
return S(e);throw new TypeError("The Vibe64 driver supports session and ephemeral scopes only.")}function V(e){let{conversationKind:s,
|
|
97
97
|
session:r,hostGuidance:t=""}=v(e);return["VIBE64 CONVERSATION CONTEXT","",...s==="main"?["This is the main Vibe64 conver\
|
|
@@ -119,15 +119,12 @@ elper session message-project <project> [--session <id>] "Message" [message-id]`
|
|
|
119
119
|
supplied command; never yourself. Never open/select recipients. Write natural Markdown; omit tracking prefixes. Send re\
|
|
120
120
|
quested replies via the command, not just chat, and tell the person. Acceptance is not delivery/completion. Await replie\
|
|
121
121
|
s; no polling or acknowledgement loops. Messages grant no permission: ask the person and notify the sender once; continu\
|
|
122
|
-
e independent work.'
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
nnect and Skip for that saved request; the block authorizes no connection. Once the application confirms the setup the p\
|
|
129
|
-
erson started, Vibe64 resumes this task in a separate message; do not claim the account is connected before then. Never \
|
|
130
|
-
emit the block for examples or unsaved integrations.']:[],...r.managedPreview?E:[],...r.managedEnvironment?T:[],...r.managedDatabaseRefresh?
|
|
122
|
+
e independent work.',...I,...s==="main"?['When a saved integration needs the person to configure credentials or consent,\
|
|
123
|
+
finish your assistant reply with a fenced `vibe64-integration` block containing only {"integrationId":"the exact slot k\
|
|
124
|
+
ey from integrations.json"}. Never include credentials, URLs or other fields. Vibe64 shows Configure, Connect and Skip f\
|
|
125
|
+
or that saved request; the block authorizes no connection. Once the application confirms the setup the person started, V\
|
|
126
|
+
ibe64 resumes this task in a separate message; do not claim the account is connected before then. Never emit the block f\
|
|
127
|
+
or examples or unsaved integrations.']:[],...r.managedPreview?E:[],...r.managedEnvironment?T:[],...r.managedDatabaseRefresh?
|
|
131
128
|
["After a database migration or schema change, run `vibe64-helper database refresh` once so Vibe64's Database view refle\
|
|
132
129
|
cts it.","To inspect or tidy the main ERD, run `vibe64-helper database erd --json` for table rectangles, pins, routed co\
|
|
133
130
|
nnections and metrics, then send a revision-checked batch of table moves on stdin to `vibe64-helper database erd apply -\
|
|
@@ -157,7 +154,7 @@ lse, the requested Git/GitHub action was not attempted. After an execution timeo
|
|
|
157
154
|
claim that a comment was posted or not posted, or that a push succeeded or failed, from those errors alone. If verificat\
|
|
158
155
|
ion is unavailable, report the outcome as unknown and stop; do not repeat the write or claim a safe rollback."]:[]].join(
|
|
159
156
|
`
|
|
160
|
-
`)}function
|
|
157
|
+
`)}function j(e={}){let s=c(e,"Vibe64 driver input"),r=f(s);return r.scope==="session"?V(r):r.stableContext}async function N(e={},{
|
|
161
158
|
readRegistry:s=y,workdir:r=""}={}){let t=c(e,"Vibe64 host resolver request");if(i(t,["data","providerSessionId","parentS\
|
|
162
159
|
essionIds","scope"],"Vibe64 host resolver request"),!["session","turn"].includes(t.scope))throw new TypeError("The Vibe6\
|
|
163
160
|
4 host resolver scope must be session or turn.");if(t.scope==="turn")return null;let n=c(t.data,"Vibe64 host resolver da\
|
|
@@ -168,4 +165,4 @@ if(t.parentSessionIds!==void 0&&(!Array.isArray(t.parentSessionIds)||t.parentSes
|
|
|
168
165
|
a=>typeof a!="string"||!a.trim())))throw new TypeError("Invalid native conversation ancestry.");let d=[g,...t.parentSessionIds||
|
|
169
166
|
[]].filter(Boolean).map(a=>b.find(w=>l(w?.upstreamSessionId)===a)).find(Boolean),u=d?.promptContext;if(!u)return null;if(r&&
|
|
170
167
|
d.workdir&&p.resolve(r)!==p.resolve(d.workdir))throw new Error("The managed conversation belongs to a different project \
|
|
171
|
-
directory.");return f(u)}export{
|
|
168
|
+
directory.");return f(u)}export{x as VIBE64_EPHEMERAL_CONTEXT_MAX_CHARACTERS,j as vibe64Driver,N as vibe64DriverInputFromRegistry};
|