vibe64 0.1.58 → 0.1.59

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-core",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-runtime",
3
- "version": "0.2.34",
3
+ "version": "0.2.35",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-voice",
3
- "version": "0.2.34",
3
+ "version": "0.2.35",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/connector-google-calendar",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared": "./src/shared/english-definition.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/connectors-catalog",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared/ai": "./src/shared/english-ai.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/connectors-core",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared/configuration": "./src/shared/configuration.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/payments-core",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared": "./src/shared/configuration.js",
@@ -1,73 +1,73 @@
1
1
  import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
2
- import{createHash as Sn}from"node:crypto";import Ie from"node:path";var oe=class extends Error{constructor(n,t,s=void 0){
2
+ import{createHash as wn}from"node:crypto";import Ie from"node:path";var oe=class extends Error{constructor(n,t,s=void 0){
3
3
  super(t),this.name="Vibe64StackOperationError",this.code=n,s!==void 0&&(this.details=s)}},Qe=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"}),In=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
8
- function Tn(e,n){let t=Qe[e],s=String(n).replace(In,"");return t?`${s} Exact grammar: vibe64-helper spec ${t}.`:s}function $(e,n,t){
9
- return`Unknown ${e}: ${n}. Use one of: ${t.join("; ")}.`}function d(e,n,t,s,r={}){throw new oe(e,Tn(e,t),{path:n,...s===
7
+ architecture-inspection",VIBE64_ARCHITECTURE_LAYOUT_INVALID:"architecture-layout"}),Sn=/ Exact grammar: vibe64-helper spec [a-z-]+\.$/u;
8
+ function In(e,n){let t=Qe[e],s=String(n).replace(Sn,"");return t?`${s} Exact grammar: vibe64-helper spec ${t}.`:s}function $(e,n,t){
9
+ return`Unknown ${e}: ${n}. Use one of: ${t.join("; ")}.`}function d(e,n,t,s,r={}){throw new oe(e,In(e,t),{path:n,...s===
10
10
  void 0?{}:{line:s},...r})}function b(e,n,t,s,r){return(typeof e!="string"||!e.trim()||/[\0\r\n]/u.test(e))&&d(n,t,`${s} \
11
- must be one non-empty line.`,r),e.trim()}function kn(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:u=64}=i,a=kn(e);if(!a||
11
+ must be one non-empty line.`,r),e.trim()}function Tn(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:u=64}=i,a=Tn(e);if(!a||
13
13
  a.length>u||o!==void 0&&a.length!==o||a.some(c=>c.length>4096||/[\0\r\n]/u.test(c))){let c=o===void 0?"separate non-empt\
14
- y":`exactly ${o}`;d(n,t,`${s} must contain ${c} backticked ${o===1?"value":"values"}.`,r)}return a}function _n(e=""){return typeof e==
14
+ y":`exactly ${o}`;d(n,t,`${s} must contain ${c} backticked ${o===1?"value":"values"}.`,r)}return a}function kn(e=""){return typeof e==
15
15
  "string"&&!!e&&!/[\s\0{}]/u.test(e)&&!Ie.isAbsolute(e)&&!e.split(/[\\/]/u).includes("..")}function R(e,n,t,s,r){let i=I(
16
- e,n,t,s,r);return _n(i[0])||d(n,t,`${s} must begin with a safe executable.`,r),i}function On(e=""){return typeof e=="str\
16
+ e,n,t,s,r);return kn(i[0])||d(n,t,`${s} must begin with a safe executable.`,r),i}function _n(e=""){return typeof e=="str\
17
17
  ing"&&!!e&&!/[\0\r\n\\]/u.test(e)&&!Ie.posix.isAbsolute(e)&&Ie.posix.normalize(e)===e&&!e.split("/").some(n=>!n||n==="..")}
18
- function y(e,n,t,s,r,i={}){let{allowRoot:o=!0}=i;return(!On(e)||!o&&e===".")&&d(n,t,`${s} must be a canonical project-re\
18
+ function y(e,n,t,s,r,i={}){let{allowRoot:o=!0}=i;return(!_n(e)||!o&&e===".")&&d(n,t,`${s} must be a canonical project-re\
19
19
  lative path.`,r),e}function A(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
21
  contains a duplicate technology id.`,r),i}function ke(e,n,t,s,r){let i=b(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 ae(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:ke(i[1],n,t,`${s} path`,r),status:o}}var Rn=/^with (.+?):[ \t]+(.+)$/u,
26
- An=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,Nn=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Cn=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
27
- function ce(e,n,t,s,r,{form:i,observed:o=e}){let u=String(e||"").match(Rn);u||d(n,t,`Every ${s} entry must use: ${i}`,r,
28
- {observed:o});let a=u[1].match(An),c=a?null:u[1].match(Nn),p=a?a[1]:c?c[1]:u[1],m=a?.[2]||c?.[2]||"",l=p.match(Cn);return{
25
+ be from 200 through 399.`,r),{kind:"http",method:"GET",path:ke(i[1],n,t,`${s} path`,r),status:o}}var On=/^with (.+?):[ \t]+(.+)$/u,
26
+ Rn=/^(.*?)[ \t]+when `([^`\r\n]+)` exists$/u,An=/^(.*?)[ \t]+if `([^`\r\n]+)` exists$/u,Nn=/^(.*?)[ \t]+in `([^`\r\n]+)`$/u;
27
+ function ce(e,n,t,s,r,{form:i,observed:o=e}){let u=String(e||"").match(On);u||d(n,t,`Every ${s} entry must use: ${i}`,r,
28
+ {observed:o});let a=u[1].match(Rn),c=a?null:u[1].match(An),p=a?a[1]:c?c[1]:u[1],m=a?.[2]||c?.[2]||"",l=p.match(Nn);return{
29
29
  argv:R(u[2],n,t,`${s} command`,r),runtimeRequirements:A(l?l[1]:p,n,t,`${s} runtimes`,r),workdir:y(l?l[2]:".",n,t,`${s} w\
30
30
  orkdir`,r),...m?{condition:{pathExists:y(m,n,t,`${s} condition path`,r,{allowRoot:!1}),onMissing:a?"wait":"skip"}}:{}}}function Te(e){
31
31
  return Array.isArray(e)?e.map(Te):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(n=>[n,Te(e[n])])):e}
32
32
  function O(e){let n=`${JSON.stringify(Te(e),null,2)}
33
- `;return`sha256:${Sn("sha256").update(n).digest("hex")}`}function H(e={},n={},t="operation"){if(e.stackHash!==n.stackHash)
33
+ `;return`sha256:${wn("sha256").update(n).digest("hex")}`}function H(e={},n={},t="operation"){if(e.stackHash!==n.stackHash)
34
34
  throw new oe("VIBE64_STACK_CHANGED",`The Stack changed while Vibe64 inspected its ${t}. Retry the operation.`)}function z(e=[]){
35
35
  return[...new Set(e)].sort()}function v(e=[]){let n=e.map(t=>t.trim()).filter(Boolean);return n.length===1&&n[0]==="- No\
36
- thing."}var oi=Object.freeze({SPEC_BY_ERROR_CODE:Qe});var Pn="custom";var Dn=Object.freeze([Object.freeze({value:"npm",label:"npm (Node.js)"}),Object.freeze({value:"composer",label:"Composer\
36
+ thing."}var oi=Object.freeze({SPEC_BY_ERROR_CODE:Qe});var Cn="custom";var Pn=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:Pn,label:"custom"})]);var et=Object.freeze(Dn.map(e=>e.value));function tt(e){return typeof e=="string"&&et.includes(e)}function nt(e="or"){let n=et;return`${n.slice(0,-1).join(", ")} ${e} ${n.at(-1)}`}var st="Connected development",$n="vibe64.connected-development.v1",V="VIBE64_CONNECTED_DEVELOPMENT_INVALID",x="genesis/\
40
+ freeze({value:Cn,label:"custom"})]);var et=Object.freeze(Pn.map(e=>e.value));function tt(e){return typeof e=="string"&&et.includes(e)}function nt(e="or"){let n=et;return`${n.slice(0,-1).join(", ")} ${e} ${n.at(-1)}`}var st="Connected development",Dn="vibe64.connected-development.v1",V="VIBE64_CONNECTED_DEVELOPMENT_INVALID",x="genesis/\
41
41
  stack.md#Connected development",_e="with `runtime` [in `workdir`]: `command` `argument`...",rt=Object.freeze({Prepare:`-\
42
- Prepare \`label\` ${_e}`,Verify:`- Verify \`label\` ${_e}`,"Custom runner":`- Custom runner ${_e}`}),Vn=Object.freeze([
43
- "- Default package type: `type`","- Sources file: `path`",...Object.values(rt)]),xn=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
44
- jn=/^- Custom runner (.+)$/u,Ln="Custom connected source";function it(e={}){let n="",t="",s=null,r=[],i=[...e.diagnostics||
42
+ Prepare \`label\` ${_e}`,Verify:`- Verify \`label\` ${_e}`,"Custom runner":`- Custom runner ${_e}`}),$n=Object.freeze([
43
+ "- Default package type: `type`","- Sources file: `path`",...Object.values(rt)]),Vn=/^- (Prepare|Verify) `([^`\r\n]+)` (.+)$/u,
44
+ xn=/^- Custom runner (.+)$/u,jn="Custom connected source";function it(e={}){let n="",t="",s=null,r=[],i=[...e.diagnostics||
45
45
  []],o=e.status==="ready";if(o&&!v(e.lines)){let a=!1;for(let[p,m]of e.lines.entries()){let l=m.trim();if(!l)continue;let f=p+
46
46
  1,g=l.match(/^- Default package type: `([^`\r\n]*)`$/u);if(g){t&&d(V,x,"Declare exactly one default package type.",f),tt(
47
47
  g[1])||d(V,x,`Default package type must be ${nt()}.`,f),t=g[1];continue}let C=l.match(/^- Sources file: `([^`\r\n]+)`$/u);
48
48
  if(C){n&&d(V,x,"Declare exactly one Sources file.",f),n=y(C[1],V,x,"Connected sources file",f,{allowRoot:!1}),n.split("/").
49
- some(wn=>wn.toLowerCase()===".git")&&d(V,x,"The Sources file must be outside Git metadata.",f);continue}let k=l.match(jn),
50
- P=k?null:l.match(xn);!k&&!P&&d(V,x,$("Connected development entry",l,Vn),f);let Y=k?"Custom runner":P[1],Q=Y==="Verify"?
49
+ some(vn=>vn.toLowerCase()===".git")&&d(V,x,"The Sources file must be outside Git metadata.",f);continue}let k=l.match(xn),
50
+ P=k?null:l.match(Vn);!k&&!P&&d(V,x,$("Connected development entry",l,$n),f);let Y=k?"Custom runner":P[1],Q=Y==="Verify"?
51
51
  "verify":"prepare";!k&&a&&Q==="prepare"&&d(V,x,"All Prepare entries must precede Verify entries.",f),a||=!k&&Q==="verify";
52
- let Se={label:k?Ln:b(P[2],V,x,`Connected development ${Y} label`,f),...ce(k?k[1]:P[3],V,x,`Connected development ${Y}`,f,
52
+ let Se={label:k?jn:b(P[2],V,x,`Connected development ${Y} label`,f),...ce(k?k[1]:P[3],V,x,`Connected development ${Y}`,f,
53
53
  {form:rt[Y],observed:l})};Se.condition&&d(V,x,"Connected development steps must run unconditionally; a skipped step cann\
54
54
  ot prove source consumption.",f),k?(s&&d(V,x,"Declare exactly one Custom runner.",f),s=Se):r.push({...Se,phase:Q})}!(t&&
55
55
  !n&&!r.length&&!s)&&(!n||!r.some(p=>p.phase==="verify")&&!s)&&d(V,x,"Declare a default package type alone, or a Sources \
56
56
  file with Verify entries or a Custom runner; use `- Nothing.` for no declaration.")}let u=e.status==="blocked"||i.length?
57
- "blocked":r.length||s?"ready":"unconfigured";return{contract:$n,declared:o,status:u,stackHash:e.stackHash,recipeHash:u===
57
+ "blocked":r.length||s?"ready":"unconfigured";return{contract:Dn,declared:o,status:u,stackHash:e.stackHash,recipeHash:u===
58
58
  "ready"?O({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 Mn,open as Gn,realpath as Oe,stat as Un}from"node:fs/promises";import{constants as ot}from"node:fs";import at from"node:path";var Bn="vibe64.architecture-inspection.v1",ut="Architecture inspection",T="VIBE64_ARCHITECTURE_INSPECTION_INVALID",ue="g\
61
- enesis/stack.md#Architecture inspection",pt=120,lt=64*1024*1024,ct=64*1024,Wn=Object.freeze(["runtimeRequirements","work\
60
+ a=>a.runtimeRequirements)),diagnostics:i}}import{lstat as Ln,open as Mn,realpath as Oe,stat as Gn}from"node:fs/promises";import{constants as ot}from"node:fs";import at from"node:path";var Un="vibe64.architecture-inspection.v1",ut="Architecture inspection",T="VIBE64_ARCHITECTURE_INSPECTION_INVALID",ue="g\
61
+ enesis/stack.md#Architecture inspection",pt=120,lt=64*1024*1024,ct=64*1024,Bn=Object.freeze(["runtimeRequirements","work\
62
62
  dir","argv","timeout","maxBuffer"]),Re=Object.freeze({Runtime:["runtimeRequirements","`runtime`..."],Directory:["workdir",
63
63
  "`path`"],Command:["argv","`command` `argument`..."],"Timeout seconds":["timeout",`\`1\` through \`${pt}\``],"Max output\
64
64
  bytes":["maxBuffer",`\`1\` through \`${lt}\``],"Entry files":["entryFiles","`path`... (optional)"],"Required files":["r\
65
- equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),Hn=new RegExp(
65
+ equiredFiles","`path`... (optional)"],"Preview locator":["previewLocator","`path` (optional .js file)"]}),Wn=new RegExp(
66
66
  `^- (${Object.keys(Re).join("|")}): (.+)$`,"u");function dt(e,n={}){let{path:t=ue}=n;if(Array.isArray(e)||d(T,t,"Archite\
67
- cture inspection requires exact Stack section lines."),v(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let u of Wn)
67
+ cture inspection requires exact Stack section lines."),v(e))return[];let s=[],r=new Set,i;function o(){if(i){for(let u of Bn)
68
68
  i[u]===void 0&&d(T,t,`${i.id} is missing ${u}.`);s.push(i),i=null}}for(let[u,a]of e.entries()){let c=a.trim();if(!c)continue;
69
69
  let p=c.match(/^### Inspector `([a-z0-9]+(?:-[a-z0-9]+)*)`: (.+)$/u);if(p){o(),r.has(p[1])&&d(T,t,"Duplicate inspector i\
70
- d.",u+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||d(T,t,"Expected an Inspector heading.",u+1);let m=c.match(Hn);if(!m){
70
+ d.",u+1),r.add(p[1]),i={id:p[1],title:p[2]};continue}i||d(T,t,"Expected an Inspector heading.",u+1);let m=c.match(Wn);if(!m){
71
71
  let f=Object.entries(Re).map(([g,[,C]])=>`- ${g}: ${C}`).join("; ");d(T,t,`Unknown architecture inspector field. Use one\
72
72
  of: ${f}.`,u+1)}let[l]=Re[m[1]];if(i[l]!==void 0&&d(T,t,`Duplicate ${m[1]}.`,u+1),l==="runtimeRequirements")i[l]=A(m[2],
73
73
  T,t,"Inspector runtime",u+1);else if(l==="argv")i[l]=R(m[2],T,t,"Inspector command",u+1);else if(l==="entryFiles"||l==="\
@@ -75,18 +75,18 @@ requiredFiles")i[l]=I(m[2],T,t,m[1],u+1).map(f=>y(f,T,t,m[1],u+1));else{let[f]=I
75
75
  rkdir")i[l]=y(f,T,t,"Inspector directory",u+1);else if(l==="previewLocator")i[l]=mt(f,t,u+1);else{let g=Number(f),C=l===
76
76
  "timeout"?pt:lt;(!/^[1-9][0-9]*$/u.test(f)||!Number.isSafeInteger(g)||g>C)&&d(T,t,`${m[1]} must be from 1 to ${C}.`,u+1),
77
77
  i[l]=l==="timeout"?g*1e3:g}}}return o(),s.length||d(T,t,"Use an Inspector entry or - Nothing."),s}function mt(e,n,t){return y(
78
- e,T,n,"Preview locator",t,{allowRoot:!1}),e.endsWith(".js")||d(T,n,"Preview locator must name a .js file.",t),e}function zn(e,n){
79
- return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function Fn(e,n){
78
+ e,T,n,"Preview locator",t,{allowRoot:!1}),e.endsWith(".js")||d(T,n,"Preview locator must name a .js file.",t),e}function Hn(e,n){
79
+ return e[n-1]==="node_modules"&&!e[n].startsWith("@")||e[n-2]==="node_modules"&&e[n-1].startsWith("@")}async function zn(e,n){
80
80
  mt(n,ue);let t=i=>d(T,ue,`Preview locator \`${n}\` ${i}.`),s=n.split("/"),r;try{let i=await Oe(e),o=i,u=!1;for(let[c,p]of s.
81
- entries())o=at.join(o,p),(await Mn(o)).isSymbolicLink()&&((u||c===s.length-1||!zn(s,c))&&t("must not be or pass through \
82
- a symlink"),o=i=await Oe(o),(await Un(i)).isDirectory()||t("links a package that is not a folder"),u=!0);(await Oe(o)!==
83
- o||!o.startsWith(`${i}${at.sep}`))&&t("must not be or pass through a symlink"),r=await Gn(o,ot.O_RDONLY|ot.O_NOFOLLOW);let a=await r.
81
+ entries())o=at.join(o,p),(await Ln(o)).isSymbolicLink()&&((u||c===s.length-1||!Hn(s,c))&&t("must not be or pass through \
82
+ a symlink"),o=i=await Oe(o),(await Gn(i)).isDirectory()||t("links a package that is not a folder"),u=!0);(await Oe(o)!==
83
+ o||!o.startsWith(`${i}${at.sep}`))&&t("must not be or pass through a symlink"),r=await Mn(o,ot.O_RDONLY|ot.O_NOFOLLOW);let a=await r.
84
84
  stat();return a.isFile()||t("must be a regular file"),a.size>ct&&t(`must be at most ${ct} 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
86
  "ELOOP"&&t("must not be or pass through a symlink"),i}finally{await r?.close()}}function ht(e){let n=e.status==="ready"?
87
87
  dt(e.lines):[];for(let t of n)t.runtimeRequirements.some(s=>!e.components.includes(s))&&d(T,ue,"Inspector runtimes must \
88
- be selected in Stack.");return{contract:Bn,status:e.status,stackHash:e.stackHash,inspectors:n,recipeHash:O(n),diagnostics:e.
89
- diagnostics||[]}}var gi=Object.freeze({parseVibe64ArchitectureInspectionLines:dt});var qn="vibe64.architecture-layout.v1",ft="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Ae=Object.freeze(
88
+ be selected in Stack.");return{contract:Un,status:e.status,stackHash:e.stackHash,inspectors:n,recipeHash:O(n),diagnostics:e.
89
+ diagnostics||[]}}var gi=Object.freeze({parseVibe64ArchitectureInspectionLines:dt});var Fn="vibe64.architecture-layout.v1",ft="Architecture layout",U="VIBE64_ARCHITECTURE_LAYOUT_INVALID",Ae=Object.freeze(
90
90
  ["layer","libraries","support"]);function gt(e,n={}){let{path:t="genesis/stack.md#Architecture layout"}=n;if(Array.isArray(
91
91
  e)||d(U,t,"Expected exact Stack section lines."),v(e))return[];let s=[],r=new Set,i=new Set,o;function u(){o&&((!o.kind||
92
92
  !o.purpose||!o.subsystems.length)&&d(U,t,`${o.id} needs Kind, Purpose and at least one Subsystem.`),s.push(o))}for(let[a,
@@ -96,15 +96,15 @@ r.has(m[1])&&d(U,t,"Duplicate group id.",a+1),r.add(m[1]),o={id:m[1],title:m[2],
96
96
  if(l[1]==="Subsystem"){let g=y(f[0],U,t,"Subsystem root",a+1);i.has(g)&&d(U,t,"Each directory root may be placed only on\
97
97
  ce.",a+1),i.add(g),o.subsystems.push({root:g})}else{let g=l[1].toLowerCase();o[g]!==void 0&&d(U,t,`Duplicate ${l[1]}.`,a+
98
98
  1),g==="kind"&&!Ae.includes(f[0])&&d(U,t,`Kind must be ${Ae.slice(0,-1).join(", ")} or ${Ae.at(-1)}.`,a+1),o[g]=f[0]}}return u(),
99
- s.length||d(U,t,"Use a Group entry or - Nothing."),s}function Et(e){return{contract:qn,status:e.status,stackHash:e.stackHash,
100
- groups:e.status==="ready"?gt(e.lines):[],diagnostics:e.diagnostics||[]}}var bi=Object.freeze({parseVibe64ArchitectureLayoutLines:gt});import{existsSync as fn}from"node:fs";import{readFile as br}from"node:fs/promises";import{createRequire as vr}from"node:module";
101
- import W from"node:path";var Kn="STACK_PROJECT_CONTRACTS_INCOMPLETE",yt="STACK_SECTION_AMBIGUOUS",Yn=Object.freeze([Kn,yt]);function Xn(e){return Yn.
102
- includes(String(e?.code||"").trim())}var Ne="genesis/stack.md",Jn=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function bt(e){
103
- return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!Jn.some(n=>String(e.code).startsWith(n))}function Zn(e){
99
+ s.length||d(U,t,"Use a Group entry or - Nothing."),s}function Et(e){return{contract:Fn,status:e.status,stackHash:e.stackHash,
100
+ groups:e.status==="ready"?gt(e.lines):[],diagnostics:e.diagnostics||[]}}var bi=Object.freeze({parseVibe64ArchitectureLayoutLines:gt});import{existsSync as hn}from"node:fs";import{readFile as br}from"node:fs/promises";import{createRequire as vr}from"node:module";
101
+ import W from"node:path";var qn="STACK_PROJECT_CONTRACTS_INCOMPLETE",yt="STACK_SECTION_AMBIGUOUS",Kn=Object.freeze([qn,yt]);function Yn(e){return Kn.
102
+ includes(String(e?.code||"").trim())}var Ne="genesis/stack.md",Xn=Object.freeze(["GIT_","PROCESS_","HOST_CONTEXT_"]);function Jn(e){
103
+ return e instanceof SyntaxError?!0:e?.name!=="GenesisError"?!1:!Xn.some(n=>String(e.code).startsWith(n))}function Zn(e){
104
104
  let{path:n="",line:t,observed:s}=e.details||{},r=Number.isSafeInteger(t)?` (line ${t}${n===Ne?" 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 ie from"genesis-compiler";import{randomUUID as cs}from"node:crypto";import{mkdir as us,mkdtemp as ps,readFile as ls,rename as ds,rm as Tt,writeFile as ms}from"node:fs/promises";
106
- import hs from"node:os";import Pe from"node:path";function F(e){return String(e||"").trim()}var Qn=Object.freeze(["main","temporary"]),vt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
107
- "managedPreview"]),wt=Object.freeze(["managedPages"]),es=64*1024,ts=Object.freeze(["When user input is necessary, ask no\
105
+ i=n&&(r||!e.message.includes(n))?`${n}${r}: `:"",o=typeof s=="string"?` Found: "${s}".`:"";return`${i}${e.message}${o}`}import*as ie from"genesis-compiler";import{randomUUID as cs}from"node:crypto";import{mkdir as us,mkdtemp as ps,readFile as ls,rename as ds,rm as It,writeFile as ms}from"node:fs/promises";
106
+ import hs from"node:os";import Pe from"node:path";function F(e){return String(e||"").trim()}var Qn=Object.freeze(["main","temporary"]),bt=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
107
+ "managedPreview"]),vt=Object.freeze(["managedPages"]),es=64*1024,ts=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.","\
@@ -209,21 +209,21 @@ reads with `vibe64-helper env link <development|production> <KEY> <saved-id> <fi
209
209
  cit direction, or edit Vibe64 runtime/session storage.","After an Env mutation, report only the affected scope and key n\
210
210
  ames, never their values, and claim success only when the command succeeded.","Store a secret the application needs gene\
211
211
  rated (such as an application key) by generating it with the framework's own generator and piping it to `vibe64-helper e\
212
- nv set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that file from Env."]);function St(e,n){
212
+ nv set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that file from Env."]);function wt(e,n){
213
213
  if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`${n} must be an object.`);return e}function Ce(e,n,t){let s=new Set(
214
214
  n),r=Object.keys(e).filter(i=>!s.has(i));if(r.length>0)throw new TypeError(`${t} contains unsupported fields: ${r.join("\
215
- , ")}.`)}function It(e){if(Ce(e,["conversationKind","scope","session","hostGuidance"],"Vibe64 session context"),e.hostGuidance!==
215
+ , ")}.`)}function St(e){if(Ce(e,["conversationKind","scope","session","hostGuidance"],"Vibe64 session context"),e.hostGuidance!==
216
216
  void 0&&(typeof e.hostGuidance!="string"||Buffer.byteLength(e.hostGuidance,"utf8")>1024))throw new TypeError("Vibe64 hos\
217
217
  t guidance must be bounded text supplied by the host.");if(!Qn.includes(e.conversationKind))throw new TypeError("Vibe64 \
218
- session context has an unknown conversationKind.");let n=St(e.session,"Vibe64 session capabilities");Ce(n,[...vt,...wt],
219
- "Vibe64 session capabilities");let t=Object.fromEntries(vt.map(s=>{if(typeof n[s]!="boolean")throw new TypeError(`Vibe64\
220
- session capability ${s} must be boolean.`);return[s,n[s]]}));for(let s of wt){if(n[s]!==void 0&&typeof n[s]!="boolean")
218
+ session context has an unknown conversationKind.");let n=wt(e.session,"Vibe64 session capabilities");Ce(n,[...bt,...vt],
219
+ "Vibe64 session capabilities");let t=Object.fromEntries(bt.map(s=>{if(typeof n[s]!="boolean")throw new TypeError(`Vibe64\
220
+ session capability ${s} must be boolean.`);return[s,n[s]]}));for(let s of vt){if(n[s]!==void 0&&typeof n[s]!="boolean")
221
221
  throw new TypeError(`Vibe64 session capability ${s} must be boolean.`);n[s]===!0&&(t[s]=!0)}return{conversationKind:e.conversationKind,
222
222
  scope:"session",...e.hostGuidance?{hostGuidance:e.hostGuidance}:{},session:t}}function is(e){Ce(e,["scope","stableContex\
223
223
  t"],"Vibe64 ephemeral context");let n=String(e.stableContext||"").trim();if(!n||n.length>es)throw new TypeError("Vibe64 \
224
224
  ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:n}}function os(e){if(e.scope===
225
- "session")return It(e);if(e.scope==="ephemeral")return is(e);throw new TypeError("The Vibe64 driver supports session and\
226
- ephemeral scopes only.")}function as(e){let{conversationKind:n,session:t,hostGuidance:s=""}=It(e);return["VIBE64 CONVER\
225
+ "session")return St(e);if(e.scope==="ephemeral")return is(e);throw new TypeError("The Vibe64 driver supports session and\
226
+ ephemeral scopes only.")}function as(e){let{conversationKind:n,session:t,hostGuidance:s=""}=St(e);return["VIBE64 CONVER\
227
227
  SATION CONTEXT","",...n==="main"?["This is the main Vibe64 conversation for the selected session worktree."]:["This is a\
228
228
  user-visible temporary conversation in the selected session worktree, with the same tools and project access as main ch\
229
229
  at.","Its messages stay out of main History. Closing this conversation preserves project edits and removes only its conv\
@@ -300,17 +300,17 @@ ut, lost response or unreadable response, its effects are unconfirmed: use a rea
300
300
  state before repeating any write. Never claim that a comment was posted or not posted, or that a push succeeded or faile\
301
301
  d, from those errors alone. If verification is unavailable, report the outcome as unknown and stop; do not repeat the wr\
302
302
  ite or claim a safe rollback."]:[]].join(`
303
- `)}function ee(e={}){let n=St(e,"Vibe64 driver input"),t=os(n);return t.scope==="session"?as(t):t.stableContext}async function kt(e=""){let n=e||await ps(Pe.join(hs.tmpdir(),"vibe64-genesis-context-"));await us(n,{recursive:!0,mode:448});
303
+ `)}function ee(e={}){let n=wt(e,"Vibe64 driver input"),t=os(n);return t.scope==="session"?as(t):t.stableContext}async function Tt(e=""){let n=e||await ps(Pe.join(hs.tmpdir(),"vibe64-genesis-context-"));await us(n,{recursive:!0,mode:448});
304
304
  let t=Pe.join(n,"sessions.json"),s=new Map;try{let p=JSON.parse(await ls(t,"utf8"));for(let m of p.sessions)ee(m.promptContext),
305
305
  s.set(m.upstreamSessionId,m)}catch(p){if(p.code!=="ENOENT")throw p}let r=Promise.resolve(),i=!1;async function o(p){let m=Pe.
306
306
  join(n,`.sessions.${process.pid}.${cs()}.tmp`);try{await ms(m,JSON.stringify({sessions:[...p.values()]}),{flag:"wx",mode:384}),
307
- await ds(m,t)}finally{await Tt(m,{force:!0})}}await o(s);function u(p){return structuredClone(s.get(p))}async function a(p,m,l=""){
307
+ await ds(m,t)}finally{await It(m,{force:!0})}}await o(s);function u(p){return structuredClone(s.get(p))}async function a(p,m,l=""){
308
308
  if(i)throw new Error("The Genesis host context registry is closed.");if(typeof p!="string"||!p.trim())throw new TypeError(
309
309
  "Genesis host context requires a native conversation ID.");let f=structuredClone(m);ee(f);let g={upstreamSessionId:p,workdir:l,
310
310
  promptContext:f},C=r.catch(()=>{}).then(async()=>{if(JSON.stringify(s.get(p))===JSON.stringify(g))return;let k=new Map(s);
311
- k.set(p,g),await o(k),s=k});r=C,await C}async function c(){i=!0,await r.catch(()=>{}),s.clear(),e||await Tt(n,{recursive:!0,
312
- force:!0})}return Object.freeze({registryPath:t,get:u,register:a,close:c})}var _t="vibe64.application-deployment.v1",Ot="Deployment",B="VIBE64_DEPLOYMENT_INVALID",fs=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
313
- xe="- Recreate on restore: ",je="- Generated secrets: ",Le="- Setup code: ",Rt=/^[A-Z_][A-Z0-9_]*$/u,De=Object.freeze({prepare:0,
311
+ k.set(p,g),await o(k),s=k});r=C,await C}async function c(){i=!0,await r.catch(()=>{}),s.clear(),e||await It(n,{recursive:!0,
312
+ force:!0})}return Object.freeze({registryPath:t,get:u,register:a,close:c})}var kt="vibe64.application-deployment.v1",_t="Deployment",B="VIBE64_DEPLOYMENT_INVALID",fs=/^- (Prepare|Build|Migrate|Serve) `([^`\r\n]+)`:[ \t]+(.+)$/u,
313
+ xe="- Recreate on restore: ",je="- Generated secrets: ",Le="- Setup code: ",Ot=/^[A-Z_][A-Z0-9_]*$/u,De=Object.freeze({prepare:0,
314
314
  build:1,migrate:2,serve:3}),$e=Object.keys(De).map(e=>e[0].toUpperCase()+e.slice(1)),gs=Object.freeze(["- Workdir: `path\
315
315
  `","- Runtimes: `runtime`...",`${xe}\`glob\`...`,`${je}\`NAME\`...`,`${Le}\`NAME\``,"- Ready when: `GET` `/path` returns\
316
316
  `200`",`- ${$e.join("|")} \`label\`: \`command\` \`argument\`...`]);function w(e,n,t,s={}){d(B,e,n,t,s)}function Es(e,n,t){
@@ -318,14 +318,14 @@ let s=I(e.slice(xe.length),B,n,"Deployment Recreate on restore paths",t);return
318
318
  "\\")||r.includes("***")||/[?[\]{}!]/u.test(r)||r.split("/").some(i=>!i||[".",".."].includes(i)))&&w(n,"Deployment Recre\
319
319
  ate on restore paths must be canonical project-relative globs using only * and ** wildcards.",t),new Set(s).size!==s.length&&
320
320
  w(n,"Deployment contains a duplicate Recreate on restore path.",t),s}function ys(e,n,t){let s=I(e.slice(je.length),B,n,"\
321
- Deployment Generated secrets",t);return s.some(r=>!Rt.test(r))&&w(n,"Deployment Generated secrets must be uppercase envi\
321
+ Deployment Generated secrets",t);return s.some(r=>!Ot.test(r))&&w(n,"Deployment Generated secrets must be uppercase envi\
322
322
  ronment variable names.",t),new Set(s).size!==s.length&&w(n,"Deployment contains a duplicate Generated secrets name.",t),
323
- s}function bs(e,n,t){let[s]=I(e.slice(Le.length),B,n,"Deployment Setup code",t,{count:1});return Rt.test(s)||w(n,"Deploy\
323
+ s}function bs(e,n,t){let[s]=I(e.slice(Le.length),B,n,"Deployment Setup code",t,{count:1});return Ot.test(s)||w(n,"Deploy\
324
324
  ment Setup code must be an uppercase environment variable name.",t),s}function vs(e,n,t){let s=R(e[3],B,n,"Deployment co\
325
325
  mmand",t);return s.some(r=>/\{(?:host|port)\}/u.test(r))&&w(n,"Deployment commands take no {host} or {port} placeholders\
326
326
  ; Serve reads HOST and PORT from its environment.",t),{label:b(e[2],B,n,"Deployment step label",t),argv:s,role:e[1].toLowerCase()}}
327
327
  function Ve(){return{version:1,artifact:{disposablePaths:[]},workdir:".",runtimeRequirements:[],generatedSecrets:[],setupCode:"",
328
- readiness:null,steps:[]}}function At(e,n={}){let{path:t="genesis/stack.md#Deployment"}=n;if(Array.isArray(e)||w(t,"Deplo\
328
+ readiness:null,steps:[]}}function Rt(e,n={}){let{path:t="genesis/stack.md#Deployment"}=n;if(Array.isArray(e)||w(t,"Deplo\
329
329
  yment must be supplied as exact Stack section lines."),v(e))return Ve();let s=Ve(),r=new Set;for(let o=0;o<e.length;o+=1){
330
330
  let u=e[o].trim();if(!u)continue;let a=o+1;if(u.startsWith("- Workdir: ")){r.has("workdir")&&w(t,"Duplicate Deployment W\
331
331
  orkdir.",a),r.add("workdir");let p=I(u.slice(11),B,t,"Deployment Workdir",a,{count:1})[0];s.workdir=y(p,B,t,"Deployment \
@@ -343,30 +343,30 @@ w(t,"## Deployment needs at least one command or exactly `- Nothing.`."),(s.step
343
343
  at(-1)}.`);return s.readiness||w(t,"Deployment needs one Ready when entry."),s.generatedSecrets.includes(s.setupCode)&&w(
344
344
  t,"Deployment Setup code is generated already; leave it out of Generated secrets."),s.artifact.disposablePaths.length>0&&
345
345
  !s.steps.some(({role:o})=>o==="prepare")&&w(t,"Deployment may recreate paths on restore only when it declares a Prepare \
346
- step."),s}function Nt({environment:e={},section:n={}}={}){H(n,e,"Deployment section");let t=[...n.diagnostics||[]],s=Ve();
347
- n.status==="ready"&&(s=At(n.lines));let r=t.length>0?"blocked":s.steps.length>0?"ready":"unconfigured",i={version:s.version,
346
+ step."),s}function At({environment:e={},section:n={}}={}){H(n,e,"Deployment section");let t=[...n.diagnostics||[]],s=Ve();
347
+ n.status==="ready"&&(s=Rt(n.lines));let r=t.length>0?"blocked":s.steps.length>0?"ready":"unconfigured",i={version:s.version,
348
348
  artifact:s.artifact,workdir:s.workdir,runtimeRequirements:s.runtimeRequirements,generatedSecrets:s.generatedSecrets,setupCode:s.
349
- setupCode,readiness:s.readiness,steps:s.steps};return{contract:_t,status:r,stackHash:n.stackHash,recipeHash:r==="ready"?
349
+ setupCode,readiness:s.readiness,steps:s.steps};return{contract:kt,status:r,stackHash:n.stackHash,recipeHash:r==="ready"?
350
350
  O(i):"",components:[...n.components||[]],source:n.source||null,runtimeRequirements:z(s.runtimeRequirements),resources:structuredClone(
351
- e.resources||[]),...i,diagnostics:t}}var le="vibe64.packaging.v1",xt="Packaging",$i=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
351
+ e.resources||[]),...i,diagnostics:t}}var le="vibe64.packaging.v1",Vt="Packaging",$i=Object.freeze(["genesis",".genesis",".agents",".claude",".codex",".openco\
352
352
  de"]),j="VIBE64_PACKAGING_INVALID",ws=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Ss=/^[A-Z_][A-Z0-9_]*$/u,Is=/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)+$/u,
353
353
  Ts=/^[a-z][a-z0-9+.-]*$/u,ks=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u,_s=/\{[^{}\s]*\}/u,
354
354
  Os=/^### Package `([^`\r\n]+)`:[ \t]+(.+)$/u,Rs=/^- (Prepare|Build) `([^`\r\n]+)`:[ \t]+(.+)$/u,As=/^- Environment `([^`\r\n]+)`:[ \t]+(.+)$/u,
355
- Ns=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Cs=/^- Content: package `([^`\r\n]+)`$/u,Ct=50,Pt=500,Ps=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
356
- jt=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
355
+ Ns=/^- Permission `([^`\r\n]+)`:[ \t]+(.+)$/u,Cs=/^- Content: package `([^`\r\n]+)`$/u,Nt=50,Ct=500,Ps=/(?:^|_)(?:TOKEN|SECRET|PASSWORD|PASSPHRASE|PRIVATE_KEY|API_KEY|CREDENTIALS?)(?:_|$)/u,
356
+ xt=Object.freeze({npm:Object.freeze({entries:["workdir","runtimes","prepare","build","environment","versionFrom"],required:[
357
357
  "versionFrom"],versionSources:["package.json","external"]}),"python-dist":Object.freeze({entries:["workdir","runtimes","\
358
358
  prepare","build","environment","output","versionFrom"],required:["build","output","versionFrom"],versionSources:["pyproj\
359
359
  ect.toml","external"]}),"web-bundle":Object.freeze({entries:["workdir","runtimes","prepare","build","environment","outpu\
360
360
  t"],required:["build","output"],versionSources:[]}),capacitor:Object.freeze({entries:["workdir","content","platforms","a\
361
361
  pplicationId","name","icon","versionFrom","deepLinkSchemeFrom","appLinkDomainsFrom","permission"],required:["content","p\
362
362
  latforms","applicationId","name","icon","versionFrom"],versionSources:["package.json","external"]})}),pe=Object.freeze(Object.
363
- keys(jt)),Me=Object.freeze(["android"]),Ge=Object.freeze(["package.json","pyproject.toml","external"]),q=e=>e.map(n=>`\`${n}\
363
+ keys(xt)),Me=Object.freeze(["android"]),Ge=Object.freeze(["package.json","pyproject.toml","external"]),q=e=>e.map(n=>`\`${n}\
364
364
  \``).join(" | "),X=Object.freeze([["- Packer: ","packer",`- Packer: ${q(pe)}`],["- Workdir: ","workdir","- Workdir: `pat\
365
365
  h`"],["- Runtimes: ","runtimes","- Runtimes: `runtime`..."],["- Output: ","output","- Output: `path`"],["- Version from:\
366
366
  ","versionFrom",`- Version from: ${q(Ge)}`],["- Platforms: ","platforms",`- Platforms: ${q(Me)}...`],["- Id: ","applica\
367
367
  tionId","- Id: `reverse.dns.id`"],["- Name: ","name","- Name: `Display name`"],["- Icon: ","icon","- Icon: `path/to/icon\
368
368
  -1024.png`"],["- Deep link scheme from: ","deepLinkSchemeFrom","- Deep link scheme from: `ENV_NAME`"],["- App link domai\
369
- ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),Dt="### Package `id`: Label",Ds=Object.freeze([
369
+ ns from: ","appLinkDomainsFrom","- App link domains from: `ENV_NAME`"]]),Pt="### Package `id`: Label",Ds=Object.freeze([
370
370
  X[0][2],X[1][2],X[2][2],"- Prepare|Build `label`: `command` `argument`...","- Environment `NAME`: `value`",X[3][2],X[4][2],
371
371
  "- Content: package `web-bundle-id`",...X.slice(5).map(([,,e])=>e),"- Permission `id`: User-facing reason."]),te=Object.
372
372
  freeze({packer:"Packer",workdir:"Workdir",runtimes:"Runtimes",prepare:"Prepare",build:"Build",environment:"Environment",
@@ -374,8 +374,8 @@ output:"Output",versionFrom:"Version from",content:"Content",platforms:"Platform
374
374
  Icon",deepLinkSchemeFrom:"Deep link scheme from",appLinkDomainsFrom:"App link domains from",permission:"Permission"});function E(e,n,t){
375
375
  d(j,e,n,t)}function Ue(e,n,t,s){let r=b(e,j,n,t,s);return ws.test(r)||E(n,`${t} must use lowercase letters, digits, and \
376
376
  single hyphens.`,s),r}function $s(e,n,t,s,r){return I(e.slice(n.length),j,t,s,r,{count:1})[0]}function Be(e,n,t,s){return e.
377
- some(r=>_s.test(r))&&E(n,`${t} takes no placeholders in ${le}.`,s),e}function Lt(e,n,t,s){return Ss.test(e)||E(n,`${t} m\
378
- ust be an uppercase environment variable name.`,s),e}function $t(e,n,t,s,r){e.seen.has(n)&&E(s,`Package ${e.id} has a du\
377
+ some(r=>_s.test(r))&&E(n,`${t} takes no placeholders in ${le}.`,s),e}function jt(e,n,t,s){return Ss.test(e)||E(n,`${t} m\
378
+ ust be an uppercase environment variable name.`,s),e}function Dt(e,n,t,s,r){e.seen.has(n)&&E(s,`Package ${e.id} has a du\
379
379
  plicate ${te[n]} entry.`,r),e.seen.add(n),e.fields[n]=t,e.lines[n]=r}function Vs(e,n,t,s,r){let i=`Packaging ${te[e]}`;if(e===
380
380
  "runtimes")return A(n.slice(t.length),j,s,i,r);if(e==="platforms"){let u=I(n.slice(t.length),j,s,i,r);return u.some(a=>!Me.
381
381
  includes(a))&&E(s,`${i} must be ${q(Me)}.`,r),new Set(u).size!==u.length&&E(s,`${i} contains a duplicate platform.`,r),u}
@@ -384,22 +384,22 @@ e ${q(pe)}.`,r),o;if(["workdir","output"].includes(e))return y(o,j,s,i,r,{allowR
384
384
  o,j,s,i,r,{allowRoot:!1});return u.toLowerCase().endsWith(".png")||E(s,`${i} must be a 1024x1024 PNG file.`,r),u}return e===
385
385
  "versionFrom"?(Ge.includes(o)||E(s,`${i} must be ${q(Ge)}.`,r),o):e==="applicationId"?((!Is.test(o)||o.length>150)&&E(s,
386
386
  `${i} must be a reverse-DNS id such as \`com.example.notes\` (letters, digits and underscores; each part starts with a let\
387
- ter).`,r),o):e==="name"?((o.trim()!==o||o.length>Ct)&&E(s,`${i} must be at most ${Ct} characters without surrounding spa\
388
- ces.`,r),o):Lt(o,s,i,r)}function xs(e,n,t){return{id:Ue(e[1],n,"Package id",t),label:b(e[2],j,n,"Package label",t),fields:{},
387
+ ter).`,r),o):e==="name"?((o.trim()!==o||o.length>Nt)&&E(s,`${i} must be at most ${Nt} characters without surrounding spa\
388
+ ces.`,r),o):jt(o,s,i,r)}function xs(e,n,t){return{id:Ue(e[1],n,"Package id",t),label:b(e[2],j,n,"Package label",t),fields:{},
389
389
  lines:{},prepare:[],build:[],environment:[],permissions:[],seen:new Set,line:t}}function js(e,n,t,s){/^- Plugins?\b/u.test(
390
390
  n)&&E(t,"Packaging takes no Plugin list: the generated shell installs the native plugins of the Content package at its l\
391
- ockfile versions.",s);for(let[a,c]of X)if(n.startsWith(a)){$t(e,c,Vs(c,n,a,t,s),t,s);return}let r=n.match(Cs);if(r){$t(e,
391
+ ockfile versions.",s);for(let[a,c]of X)if(n.startsWith(a)){Dt(e,c,Vs(c,n,a,t,s),t,s);return}let r=n.match(Cs);if(r){Dt(e,
392
392
  "content",Ue(r[1],t,"Packaging Content package",s),t,s);return}let i=n.match(Rs);if(i){let a=i[1].toLowerCase(),c=`Packa\
393
393
  ging ${i[1]} command`;e[a].push({label:b(i[2],j,t,`Packaging ${i[1]} label`,s),argv:Be(R(i[3],j,t,c,s),t,c,s)}),e.lines[a]??=
394
- s;return}let o=n.match(As);if(o){let a=Lt(o[1],t,"Packaging Environment name",s);Ps.test(a)&&E(t,`Packaging Environment ${a}\
394
+ s;return}let o=n.match(As);if(o){let a=jt(o[1],t,"Packaging Environment name",s);Ps.test(a)&&E(t,`Packaging Environment ${a}\
395
395
  looks like a credential. Packaging holds only non-secret build facts.`,s),e.environment.some(p=>p.name===a)&&E(t,`Packa\
396
396
  ge ${e.id} has a duplicate Environment ${a}.`,s);let c=Be(I(o[2],j,t,"Packaging Environment value",s,{count:1}),t,"Packa\
397
397
  ging Environment value",s)[0];e.environment.push({name:a,value:c}),e.lines.environment??=s;return}let u=n.match(Ns);if(u){
398
- let a=Ue(u[1],t,"Packaging Permission id",s),c=b(u[2],j,t,"Packaging Permission reason",s);(c.includes("`")||c.length>Pt)&&
399
- E(t,`Packaging Permission reason is plain user-facing text of at most ${Pt} characters.`,s),e.permissions.some(p=>p.id===
398
+ let a=Ue(u[1],t,"Packaging Permission id",s),c=b(u[2],j,t,"Packaging Permission reason",s);(c.includes("`")||c.length>Ct)&&
399
+ E(t,`Packaging Permission reason is plain user-facing text of at most ${Ct} characters.`,s),e.permissions.some(p=>p.id===
400
400
  a)&&E(t,`Package ${e.id} has a duplicate Permission ${a}.`,s),e.permissions.push({id:a,reason:c}),e.lines.permission??=s;
401
401
  return}E(t,$("Packaging entry",n,Ds),s)}function Ls(e,n){let t=e.fields.packer;t||E(n,`Package ${e.id} needs a Packer en\
402
- try: ${q(pe)}.`,e.line);let s=jt[t],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build","e\
402
+ try: ${q(pe)}.`,e.line);let s=xt[t],r=new Set([...Object.keys(e.fields).filter(o=>o!=="packer"),...["prepare","build","e\
403
403
  nvironment"].filter(o=>e[o].length),...e.permissions.length?["permission"]:[]]);for(let o of r)s.entries.includes(o)||E(
404
404
  n,`The ${t} packer takes no ${te[o]} entry.`,e.lines[o]);for(let o of s.required)r.has(o)||E(n,`Package ${e.id} (${t}) n\
405
405
  eeds ${/^[AEIOU]/u.test(te[o])?"an":"a"} ${te[o]} entry.`,e.line);e.fields.versionFrom&&!s.versionSources.includes(e.fields.
@@ -408,58 +408,58 @@ label,packer:t,workdir:e.fields.workdir||".",runtimeRequirements:e.fields.runtim
408
408
  environment,output:e.fields.output||null,versionFrom:e.fields.versionFrom||null};return t!=="capacitor"?i:{...i,content:e.
409
409
  fields.content,platforms:e.fields.platforms,application:{id:e.fields.applicationId,name:e.fields.name,icon:e.fields.icon},
410
410
  deepLinkSchemeFrom:e.fields.deepLinkSchemeFrom||null,appLinkDomainsFrom:e.fields.appLinkDomainsFrom||null,permissions:e.
411
- permissions}}function Mt(e,n={}){let{path:t="genesis/stack.md#Packaging"}=n;if(Array.isArray(e)||E(t,"Packaging must be \
411
+ permissions}}function Lt(e,n={}){let{path:t="genesis/stack.md#Packaging"}=n;if(Array.isArray(e)||E(t,"Packaging must be \
412
412
  supplied as exact Stack section lines."),v(e))return{version:1,packages:[]};let s=[],r=null;for(let a=0;a<e.length;a+=1){
413
413
  let c=e[a].trim();if(!c)continue;let p=a+1,m=c.match(Os);if(m){r=xs(m,t,p),s.push(r);continue}c.startsWith("#")&&E(t,`Un\
414
- known Packaging heading: ${c}. Use ${Dt}.`,p),r||E(t,`Packaging entries belong under ${Dt}.`,p),js(r,c,t,p)}s.length===0&&
414
+ known Packaging heading: ${c}. Use ${Pt}.`,p),r||E(t,`Packaging entries belong under ${Pt}.`,p),js(r,c,t,p)}s.length===0&&
415
415
  E(t,"## Packaging needs at least one Package or exactly `- Nothing.`.");let i=s.map(a=>Ls(a,t)),o=new Map;for(let a of i)
416
416
  o.has(a.id)&&E(t,`Packaging contains a duplicate package id ${a.id}.`),o.set(a.id,a);let u=new Set;for(let a of i.filter(
417
417
  ({packer:c})=>c==="capacitor")){let c=o.get(a.content);(!c||c.packer!=="web-bundle")&&E(t,`Package ${a.id} Content must \
418
418
  name a web-bundle package declared in Packaging.`),u.has(a.application.id)&&E(t,`Packaging declares application id ${a.application.
419
- id} twice.`),u.add(a.application.id)}return{version:1,packages:i}}function Vt(e,n,t,s){let r=(Array.isArray(e)?e:[]).find(
419
+ id} twice.`),u.add(a.application.id)}return{version:1,packages:i}}function $t(e,n,t,s){let r=(Array.isArray(e)?e:[]).find(
420
420
  i=>i?.name===n);return(!r||typeof r.value!="string"||!r.value.trim())&&E(t,`${s} names ${n}, which ## Environment defaul\
421
- ts does not declare with a value.`),r.value.trim()}function Gt(e,n=[],t={}){let{path:s="genesis/stack.md#Packaging"}=t;return{
421
+ ts does not declare with a value.`),r.value.trim()}function Mt(e,n=[],t={}){let{path:s="genesis/stack.md#Packaging"}=t;return{
422
422
  ...e,packages:e.packages.map(r=>{if(r.packer!=="capacitor")return r;let i={...r,deepLinkScheme:null,appLinkDomains:[]};if(r.
423
- deepLinkSchemeFrom){let o=Vt(n,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!Ts.test(o)||["http","ht\
423
+ deepLinkSchemeFrom){let o=$t(n,r.deepLinkSchemeFrom,s,`Package ${r.id} Deep link scheme from`);(!Ts.test(o)||["http","ht\
424
424
  tps","file","content","javascript"].includes(o))&&E(s,`${r.deepLinkSchemeFrom} must be a custom lowercase URL scheme suc\
425
- h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=Vt(n,r.appLinkDomainsFrom,s,`Package ${r.id} App lin\
425
+ h as \`notes\`.`),i.deepLinkScheme=o}if(r.appLinkDomainsFrom){let o=$t(n,r.appLinkDomainsFrom,s,`Package ${r.id} App lin\
426
426
  k domains from`).split(/[\s,]+/u).filter(Boolean);o.some(u=>!ks.test(u))&&E(s,`${r.appLinkDomainsFrom} must list lowerca\
427
- se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function Ut({environment:e={},
427
+ se domain names separated by commas or spaces.`),i.appLinkDomains=[...new Set(o)]}return i})}}function Gt({environment:e={},
428
428
  section:n={}}={}){H(n,e,"Packaging section");let t=[...n.diagnostics||[]],s={version:1,packages:[]};n.status==="ready"&&
429
- (s=Gt(Mt(n.lines),e.environmentDefaults));let r=t.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:le,
429
+ (s=Mt(Lt(n.lines),e.environmentDefaults));let r=t.length>0?"blocked":s.packages.length>0?"ready":"unconfigured";return{contract:le,
430
430
  status:r,stackHash:n.stackHash,packagingHash:r==="ready"?O(s):"",source:n.source||null,version:s.version,packages:s.packages,
431
431
  diagnostics:t}}var S="VIBE64_OUTPUTS_INVALID";function h(e,n,t,s={}){d(S,e,n,t,s)}function We(e,n,t,s,r,i){return I(e.slice(n.length),S,
432
432
  t,s,r,i)}function M(e,n,t,s,r){return We(e,n,t,s,r,{count:1})[0]}function _(e,n,t,s,r,i){e.seen.has(n)&&h(s,`Duplicate ${i}\
433
- .`,r),e.seen.add(n),e[n]=t}var ne="vibe64.preview-identity.command.v1",Ms=/^[A-Z_][A-Z0-9_]*$/u,Wt=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
434
- "TMPDIR","USER"]),Ht=new Set(["email","login","user-id"]),zt=1e4,de=3e4,Ft=[["- Command: ","command","Command","`tools/p\
433
+ .`,r),e.seen.add(n),e[n]=t}var ne="vibe64.preview-identity.command.v1",Ms=/^[A-Z_][A-Z0-9_]*$/u,Bt=new Set(["HOME","LOGNAME","NODE_OPTIONS","PATH",
434
+ "TMPDIR","USER"]),Wt=new Set(["email","login","user-id"]),Ht=1e4,de=3e4,zt=[["- Command: ","command","Command","`tools/p\
435
435
  review-identity` `argument`..."],["- Protocol: ","protocol","Protocol",`\`${ne}\``],["- Identity types: ","identityTypes",
436
- "Identity types",`one or more of ${[...Ht].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
436
+ "Identity types",`one or more of ${[...Wt].map(e=>`\`${e}\``).join(" ")}`],["- Enabled environment: ","enabledEnvironmen\
437
437
  t","Enabled environment","`ENV_NAME`"],["- Secret environment: ","secretEnvironment","Secret environment","`ENV_NAME`"],
438
438
  ["- Runtimes: ","runtimes","Runtimes","`runtime`..."],["- Timeout ms: ","timeoutMs","Timeout ms",`\`1\` through \`${de}\`\
439
- (default ${zt})`]],He=Ft.map(([e,,,n])=>`${e}${n}`);function Bt(e,n,t,s){if(e===void 0)return"";let r=b(e,S,n,`Preview \
440
- identity ${t} environment name`,s);return(!Ms.test(r)||Wt.has(r)||r.startsWith("XDG_"))&&h(n,`Preview identity ${t} envi\
441
- ronment name is invalid.`,s),r}function qt(e){return{seen:new Set,line:e}}function Kt(e,n,t,s){let r=Ft.find(([c])=>n.startsWith(
439
+ (default ${Ht})`]],He=zt.map(([e,,,n])=>`${e}${n}`);function Ut(e,n,t,s){if(e===void 0)return"";let r=b(e,S,n,`Preview \
440
+ identity ${t} environment name`,s);return(!Ms.test(r)||Bt.has(r)||r.startsWith("XDG_"))&&h(n,`Preview identity ${t} envi\
441
+ ronment name is invalid.`,s),r}function Ft(e){return{seen:new Set,line:e}}function qt(e,n,t,s){let r=zt.find(([c])=>n.startsWith(
442
442
  c));r||h(t,$("Preview identity entry",n,He),s);let[i,o,u]=r,a=We(n,i,t,`Preview identity ${u}`,s);!["command","identityT\
443
443
  ypes","runtimes"].includes(o)&&a.length!==1&&h(t,`Preview identity ${u} accepts exactly one value.`,s),_(e,o,a,t,s,`Prev\
444
- iew identity ${u} entry`)}function Yt(e,n,t){for(let[c,p]of[["command","Command"],["protocol","Protocol"],["identityType\
444
+ iew identity ${u} entry`)}function Kt(e,n,t){for(let[c,p]of[["command","Command"],["protocol","Protocol"],["identityType\
445
445
  s","Identity types"]])e[c]||h(n,`Output target ${t} Preview identity needs ${p}.`,e.line);let s=e.command.map(c=>`\`${c}\
446
446
  \``).join(" "),r=R(s,S,n,"Preview identity command",e.line);(!r[0].includes("/")||r[0].includes("\\")||r[0].split("/").some(
447
447
  c=>!c||[".",".."].includes(c))||r.some(c=>/\{(?:host|port)\}/u.test(c)))&&h(n,"Preview identity command must use a liter\
448
448
  al app-owned project-relative executable.",e.line);let i=e.protocol[0];i!==ne&&h(n,`Preview identity protocol must be ${ne}\
449
- .`,e.line);let o=[...new Set(e.identityTypes.map(c=>(Ht.has(c)||h(n,`Unsupported preview identity type: ${c}.`,e.line),c)))];
450
- o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let u={enabled:Bt(e.
451
- enabledEnvironment?.[0],n,"enabled",e.line),secret:Bt(e.secretEnvironment?.[0],n,"secret",e.line)};u.enabled&&u.enabled===
452
- u.secret&&h(n,"Preview identity enabled and secret environment names must differ.",e.line);let a=zt;if(e.timeoutMs){let c=e.
449
+ .`,e.line);let o=[...new Set(e.identityTypes.map(c=>(Wt.has(c)||h(n,`Unsupported preview identity type: ${c}.`,e.line),c)))];
450
+ o.length!==e.identityTypes.length&&h(n,"Preview identity types must not contain duplicates.",e.line);let u={enabled:Ut(e.
451
+ enabledEnvironment?.[0],n,"enabled",e.line),secret:Ut(e.secretEnvironment?.[0],n,"secret",e.line)};u.enabled&&u.enabled===
452
+ u.secret&&h(n,"Preview identity enabled and secret environment names must differ.",e.line);let a=Ht;if(e.timeoutMs){let c=e.
453
453
  timeoutMs[0];/^[0-9]+$/u.test(c)||h(n,`Preview identity Timeout ms must be from 1 through ${de}.`,e.line),a=Number(c),(!Number.
454
454
  isSafeInteger(a)||a<1||a>de)&&h(n,`Preview identity Timeout ms must be from 1 through ${de}.`,e.line)}return{command:r,environment:u,
455
455
  identityTypes:o,protocol:i,runtimes:e.runtimes?A(e.runtimes.map(c=>`\`${c}\``).join(" "),S,n,"Preview identity runtimes",
456
456
  e.line):[],timeoutMs:a}}var Gs="vibe64.outputs.v1",he="Outputs",Us=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,ze=/\{([a-z][a-z0-9:-]*)\}/gu,Bs=/^### Target `([^`\r\n]+)`:[ \t]+(.+)$/u,
457
457
  Ws=/^#### Parameter `([^`\r\n]+)`:[ \t]+(.+)$/u,Hs=/^#### Download `([^`\r\n]+)`$/u,zs=/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/u,
458
- Zt=new Set(["finite","interactive"]),Fe=new Set(["development","test"]),Qt=new Set(["terminal","web"]),Xt=16,me=e=>[...e].
458
+ Jt=new Set(["finite","interactive"]),Fe=new Set(["development","test"]),Zt=new Set(["terminal","web"]),Yt=16,me=e=>[...e].
459
459
  map(n=>`\`${n}\``).join(" or "),Fs=Object.freeze(["### Target `id`: Label","#### Parameter `id`: Label","#### Presentati\
460
- on","#### Preview identity","#### Download `id`"]),fe=Object.freeze({target:["- Default.",`- Mode: ${me(Zt)}`,`- Data: ${me(
460
+ on","#### Preview identity","#### Download `id`"]),fe=Object.freeze({target:["- Default.",`- Mode: ${me(Jt)}`,`- Data: ${me(
461
461
  Fe)}`,"- Workdir: `path`","- Runtimes: `runtime`...","- Prepare|Build|Run `label`: `command` `argument`..."],parameter:[
462
- "- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${me(Qt)}`,"- Preferred port: `1024` t\
462
+ "- Default: `text`","- Description: `text`","- Required."],presentation:[`- Kind: ${me(Zt)}`,"- Preferred port: `1024` t\
463
463
  hrough `65535`","- URL path: `/path`","- Ready when: `GET` `/path` returns `200`"],previewIdentity:He,download:["- Path:\
464
464
  `path`","- Name: `file-name`","- Media type: `type/subtype`"]});function qe(e,n,t,s){let r=b(e,S,n,t,s);return Us.test(
465
465
  r)||h(n,`${t} must use lowercase letters, digits, and single hyphens.`,s),r}function qs(e,n,t,s){let r=R(e,S,n,t,s);for(let i of r)
@@ -481,7 +481,7 @@ rred port must be an integer from 1024 through 65535.",t);let s=Number(e);return
481
481
  h(n,"Web presentation preferred port must be an integer from 1024 through 65535.",t),s}function er(e,n,t,s){if(n.startsWith(
482
482
  "- Data: ")){let i=M(n,"- Data: ",t,"Output target Data",s);Fe.has(i)||h(t,`Output target Data must be ${me(Fe)}.`,s),_(
483
483
  e,"dataMode",i,t,s,"output target Data entry");return}if(n==="- Default."){_(e,"default",!0,t,s,"output target Default e\
484
- ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);Zt.has(i)||h(t,"Output target \
484
+ ntry");return}if(n.startsWith("- Mode: ")){let i=M(n,"- Mode: ",t,"Output target Mode",s);Jt.has(i)||h(t,"Output target \
485
485
  Mode must be `interactive` or `finite`.",s),_(e,"mode",i,t,s,"output target Mode entry");return}if(n.startsWith("- Workd\
486
486
  ir: ")){_(e,"workdir",y(M(n,"- Workdir: ",t,"Output target Workdir",s),S,t,"Output target workdir",s),t,s,"output target\
487
487
  Workdir entry");return}if(n.startsWith("- Runtimes: ")){_(e,"runtimeRequirements",A(n.slice(12),S,t,"Output target runt\
@@ -489,7 +489,7 @@ imes",s),t,s,"output target Runtimes entry");return}let r=n.match(/^- (Prepare|B
489
489
  let i=r[1].toLowerCase(),o=qs(r[3],t,"Output step command",s);i!=="run"&&o.some(u=>/\{(?:host|port)\}/u.test(u))&&h(t,"O\
490
490
  nly a web presentation's Run step may use {host} or {port} placeholders.",s),e.steps.push({label:b(r[2],S,t,"Output step\
491
491
  label",s),argv:o,role:i});return}h(t,$("Outputs target entry",n,[...fe.target,...Fs.slice(1)]),s)}function tr(e,n,t,s){
492
- if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);Qt.has(r)||h(t,"Presentation Kind must be `te\
492
+ if(n.startsWith("- Kind: ")){let r=M(n,"- Kind: ",t,"Presentation Kind",s);Zt.has(r)||h(t,"Presentation Kind must be `te\
493
493
  rminal` or `web`.",s),_(e,"kind",r,t,s,"Presentation Kind entry");return}if(n.startsWith("- Preferred port: ")){_(e,"pre\
494
494
  ferredPort",Qs(M(n,"- Preferred port: ",t,"Web presentation Preferred port",s),t,s),t,s,"Presentation Preferred port ent\
495
495
  ry");return}if(n.startsWith("- URL path: ")){_(e,"urlPath",ke(M(n,"- URL path: ",t,"Web presentation URL path",s),S,t,"W\
@@ -507,7 +507,7 @@ t ${t} Download ${e.id} needs ${r}.`,e.line);return{id:e.id,path:e.path,name:e.n
507
507
  return e.kind||h(n,`Output target ${t} Presentation needs Kind.`,e.line),e.kind==="terminal"?((e.preferredPort!==null||e.
508
508
  readiness||e.seen.has("urlPath"))&&h(n,`Output target ${t} terminal Presentation accepts only Kind.`,e.line),{kind:"term\
509
509
  inal"}):(e.readiness||h(n,`Output target ${t} web Presentation needs one Ready when entry.`,e.line),{kind:"web",preferredPort:e.
510
- preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function Jt(e,n){e.mode||h(n,`Output target ${e.id} needs one Mo\
510
+ preferredPort,urlPath:e.urlPath,readiness:e.readiness})}function Xt(e,n){e.mode||h(n,`Output target ${e.id} needs one Mo\
511
511
  de entry.`,e.line),e.steps.length===0&&h(n,`Output target ${e.id} needs at least one step.`,e.line);let t={prepare:0,build:1,
512
512
  run:2};for(let c=1;c<e.steps.length;c+=1)t[e.steps[c].role]<t[e.steps[c-1].role]&&h(n,`Output target ${e.id} steps must \
513
513
  be ordered Prepare, Build, then Run.`,e.line);let s=e.steps.filter(({role:c})=>c==="run"),r=e.downloads.map(c=>ir(c,n,e.
@@ -518,23 +518,23 @@ wnload.`,e.line)):s.length!==1||e.steps.at(-1).role!=="run"?h(n,`Interactive out
518
518
  al Run step.`,e.line):e.presentation||h(n,`Interactive output target ${e.id} needs one Presentation.`,e.line);let i=e.presentation?
519
519
  or(e.presentation,n,e.id):null,o=e.steps.flatMap(({argv:c})=>c.flatMap(p=>[...p.matchAll(ze)].map(m=>m[1])));o.some(c=>[
520
520
  "host","port"].includes(c))&&i?.kind!=="web"&&h(n,"Only a web output target may use {host} or {port} placeholders.",e.line);
521
- let u=e.parameters.map(({seen:c,...p})=>p),a=new Set(u.map(({id:c})=>c));(u.length>Xt||a.size!==u.length)&&h(n,`Output t\
522
- arget ${e.id} may declare at most ${Xt} parameters with unique ids.`,e.line);for(let c of o.filter(p=>p.startsWith("para\
521
+ let u=e.parameters.map(({seen:c,...p})=>p),a=new Set(u.map(({id:c})=>c));(u.length>Yt||a.size!==u.length)&&h(n,`Output t\
522
+ arget ${e.id} may declare at most ${Yt} parameters with unique ids.`,e.line);for(let c of o.filter(p=>p.startsWith("para\
523
523
  meter:"))){let p=c.slice(10);a.has(p)||h(n,`Undeclared output parameter: ${p}.`,e.line)}for(let c of u)o.includes(`param\
524
524
  eter:${c.id}`)||h(n,`Output parameter ${c.id} must be used in a step command.`,e.line);return e.previewIdentity&&i?.kind!==
525
525
  "web"&&h(n,"Only a web output target may declare Preview identity.",e.line),{id:e.id,label:e.label,default:e.default,mode:e.
526
526
  mode,workdir:e.workdir,runtimeRequirements:e.runtimeRequirements,...e.dataMode?{dataMode:e.dataMode}:{},steps:e.steps,presentation:i,
527
- downloads:r,...u.length?{parameters:u}:{},...e.previewIdentity?{previewIdentity:Yt(e.previewIdentity,n,e.id)}:{}}}function ge(e,n={}){
527
+ downloads:r,...u.length?{parameters:u}:{},...e.previewIdentity?{previewIdentity:Kt(e.previewIdentity,n,e.id)}:{}}}function ge(e,n={}){
528
528
  let{path:t="genesis/stack.md#Outputs"}=n;if(Array.isArray(e)||h(t,"Outputs must be supplied as exact Stack section lines\
529
529
  ."),v(e))return{version:1,targets:[]};let s=[],r=null,i="target",o=null;for(let a=0;a<e.length;a+=1){let c=e[a].trim();if(!c)
530
- continue;let p=a+1,m=c.match(Bs);if(m){r&&s.push(Jt(r,t)),r=Ks(m,t,p),i="target",o=null;continue}r||h(t,"## Outputs must\
530
+ continue;let p=a+1,m=c.match(Bs);if(m){r&&s.push(Xt(r,t)),r=Ks(m,t,p),i="target",o=null;continue}r||h(t,"## Outputs must\
531
531
  begin with a Target heading.",p);let l=c.match(Ws);if(l){let g={id:qe(l[1],t,"Parameter id",p),label:b(l[2],S,t,"Parame\
532
532
  ter label",p),default:"",description:"",required:!1,seen:new Set};r.parameters.push(g),i="parameter",o=g;continue}if(c===
533
533
  "#### Presentation"){r.presentation&&h(t,"Presentation must appear at most once below an output target.",p),r.presentation=
534
534
  Js(p),i="presentation",o=r.presentation;continue}if(c==="#### Preview identity"){r.previewIdentity&&h(t,"Preview identit\
535
- y must appear at most once below an output target.",p),r.previewIdentity=qt(p),i="previewIdentity",o=r.previewIdentity;continue}
535
+ y must appear at most once below an output target.",p),r.previewIdentity=Ft(p),i="previewIdentity",o=r.previewIdentity;continue}
536
536
  let f=c.match(Hs);if(f){let g=Zs(f,t,p);r.downloads.push(g),i="download",o=g;continue}i==="parameter"?Ys(o,c,t,p):i==="p\
537
- resentation"?tr(o,c,t,p):i==="previewIdentity"?Kt(o,c,t,p):i==="download"?rr(o,c,t,p):er(r,c,t,p)}r&&s.push(Jt(r,t)),s.length===
537
+ resentation"?tr(o,c,t,p):i==="previewIdentity"?qt(o,c,t,p):i==="download"?rr(o,c,t,p):er(r,c,t,p)}r&&s.push(Xt(r,t)),s.length===
538
538
  0&&h(t,"## Outputs needs at least one Target or exactly `- Nothing.`.");let u=s.map(({id:a})=>a);return new Set(u).size!==
539
539
  u.length&&h(t,"Outputs contains a duplicate target id."),s.filter(({default:a})=>a).length>1&&h(t,"Outputs may declare a\
540
540
  t most one default target."),{version:1,targets:s}}function ar(e,n={}){let{resourcesPreparing:t=!1}=n,s=e.details||{},r=Array.
@@ -542,40 +542,40 @@ isArray(s.missing)?s.missing:[],i=(Array.isArray(s.alternatives)?s.alternatives:
542
542
  length?r[a].join(" and "):String(u)).filter(Boolean);if(e.code!=="STACK_RESOURCE_MISSING"||!i.length)return e.message;let o=String(
543
543
  s.resource||"").trim()||"resources";return t?`Vibe64 is still setting up this app's ${o}. Preview can start when workspa\
544
544
  ce setup finishes; then press Check again.`:`This app needs its ${o} before Preview can start: set ${i.join(", or ")} in\
545
- Env (in Dash, under Development), then press Check again.`}function en({environment:e={},section:n={},resourcesPreparing:t=!1}={}){
545
+ Env (in Dash, under Development), then press Check again.`}function Qt({environment:e={},section:n={},resourcesPreparing:t=!1}={}){
546
546
  H(n,e,"Outputs section");let s=[...n.diagnostics||[]],r=[...e.diagnostics||[]],i={version:1,targets:[]};n.status==="read\
547
547
  y"&&(i=ge(n.lines));let o=r.length===0?null:[...new Set(r.map(p=>ar(p,{resourcesPreparing:t})))].join(" "),u=i.targets.map(
548
548
  p=>({...p,source:n.source||null,available:s.length===0&&r.length===0,disabledReason:o})),a=[...s,...r],c="ready";return a.
549
549
  length>0?c="blocked":u.length===0&&(c="unconfigured"),{contract:Gs,status:c,stackHash:n.stackHash,components:[...n.components||
550
550
  []],environmentDefaults:structuredClone(e.environmentDefaults||[]),runtimeRequirements:z(u.flatMap(p=>p.runtimeRequirements)),
551
- resources:structuredClone(e.resources||[]),targets:u,diagnostics:a}}var tn="Project services",cr="vibe64.project-services.v1",J="VIBE64_PROJECT_SERVICES_INVALID",Z="genesis/stack.md#Projec\
552
- t services",ur="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function nn(e){
551
+ resources:structuredClone(e.resources||[]),targets:u,diagnostics:a}}var en="Project services",cr="vibe64.project-services.v1",J="VIBE64_PROJECT_SERVICES_INVALID",Z="genesis/stack.md#Projec\
552
+ t services",ur="- Start `service-id` [per session] with `runtime` [in `workdir`]: `command` `argument`...";function tn(e){
553
553
  if(Array.isArray(e)||d(J,Z,"Expected exact Project services section lines."),v(e))return[];let n=[];for(let[t,s]of e.entries()){
554
554
  let r=s.trim();if(!r)continue;let i=t+1,o=r.match(/^- Start `([a-z][a-z0-9-]{0,63})`( per session)? with (.+?): (.+)$/u);
555
555
  o||d(J,Z,`Use: ${ur}`,i),n.some(({id:a})=>a===o[1])&&d(J,Z,"Duplicate project service id.",i);let u=o[3].match(/^(.*?) in `([^`\r\n]+)`$/u);
556
556
  n.push({id:o[1],...o[2]?{scope:"session"}:{},runtimeRequirements:A(u?u[1]:o[3],J,Z,"Service runtimes",i),workdir:y(u?.[2]||
557
557
  ".",J,Z,"Service workdir",i),argv:R(o[4],J,Z,"Service command",i)})}return n.length||d(J,Z,"Declare a service or exactly\
558
- `- Nothing.`."),n}function sn(e={}){let n=e.status==="ready"?nn(e.lines):[];return{contract:cr,status:e.status==="block\
559
- ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?O(n):"",diagnostics:e.diagnostics||[]}}import{access as pr}from"node:fs/promises";import on from"node:path";var lr="vibe64.workspace-setup.v1",se="Workspace setup",Ye="VIBE64_WORKSPACE_SETUP_INVALID",rn="- Prepare `label` with `\
558
+ `- Nothing.`."),n}function nn(e={}){let n=e.status==="ready"?tn(e.lines):[];return{contract:cr,status:e.status==="block\
559
+ ed"?"blocked":n.length?"ready":"unconfigured",services:n,recipeHash:n.length?O(n):"",diagnostics:e.diagnostics||[]}}import{access as pr}from"node:fs/promises";import rn from"node:path";var lr="vibe64.workspace-setup.v1",se="Workspace setup",Ye="VIBE64_WORKSPACE_SETUP_INVALID",sn="- Prepare `label` with `\
560
560
  runtime` [in `workdir`] [when|if `path` exists]: `command` `argument`...",dr=/^- Prepare `([^`\r\n]+)` (.+)$/u;function Ke(e,n,t,s={}){
561
561
  d(Ye,e,n,t,s)}function Ee(e,n={}){let{path:t="genesis/stack.md#Workspace setup"}=n;if(Array.isArray(e)||Ke(t,"Workspace \
562
562
  setup must be supplied as exact Stack section lines."),v(e))return[];let s=[];for(let r=0;r<e.length;r+=1){let i=e[r].trim();
563
- if(!i)continue;let o=r+1,u=i.match(dr);u||Ke(t,`Every Workspace setup entry must use: ${rn}`,o,{observed:i}),s.push({label:b(
564
- u[1],Ye,t,"Workspace setup step label",o),...ce(u[2],Ye,t,"Workspace setup",o,{form:rn,observed:i})})}return s.length===
563
+ if(!i)continue;let o=r+1,u=i.match(dr);u||Ke(t,`Every Workspace setup entry must use: ${sn}`,o,{observed:i}),s.push({label:b(
564
+ u[1],Ye,t,"Workspace setup step label",o),...ce(u[2],Ye,t,"Workspace setup",o,{form:sn,observed:i})})}return s.length===
565
565
  0&&Ke(t,"## Workspace setup needs at least one Prepare entry or exactly `- Nothing.`."),s}async function mr(e,n){try{return await pr(
566
- on.join(e,n)),!0}catch(t){if(["ENOENT","ENOTDIR"].includes(t?.code))return!1;throw t}}async function an({projectRoot:e,section:n={}}={}){
567
- let t=[...n.diagnostics||[]],s=[];n.status==="ready"&&(s=Ee(n.lines));let r=[],i=[],o=on.resolve(e);if(t.length===0)for(let l of s){
566
+ rn.join(e,n)),!0}catch(t){if(["ENOENT","ENOTDIR"].includes(t?.code))return!1;throw t}}async function on({projectRoot:e,section:n={}}={}){
567
+ let t=[...n.diagnostics||[]],s=[];n.status==="ready"&&(s=Ee(n.lines));let r=[],i=[],o=rn.resolve(e);if(t.length===0)for(let l of s){
568
568
  if(!l.condition||await mr(o,l.condition.pathExists)){r.push(l);continue}l.condition.onMissing==="wait"&&i.push(l.condition.
569
569
  pathExists)}if(i.length>0){let l=z(i);t.push({code:"VIBE64_WORKSPACE_SETUP_WAITING",message:`Workspace setup is waiting \
570
570
  for project ${l.length===1?"path":"paths"}: ${l.join(", ")}.`,details:{paths:l}})}let u=t.some(({code:l})=>l==="VIBE64_W\
571
571
  ORKSPACE_SETUP_WAITING"),a=t.some(({code:l})=>l!=="VIBE64_WORKSPACE_SETUP_WAITING"),c="unconfigured";a?c="blocked":!u&&r.
572
572
  length>0&&(c="ready");let p=r.map(({condition:l,...f})=>f),m={version:1,steps:p};return{contract:lr,status:c,stackHash:n.
573
573
  stackHash,recipeHash:c==="ready"?O(m):"",components:[...n.components||[]],source:n.source||null,runtimeRequirements:z(p.
574
- flatMap(l=>l.runtimeRequirements)),steps:p,diagnostics:t}}var hr="vibe64.resource-estimates.v1",ye="Resource estimates",pn="VIBE64_RESOURCE_ESTIMATES_INVALID",fr=1024*1024,cn=1024*
575
- 1024,un=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
576
- ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,n,t){d(pn,
574
+ flatMap(l=>l.runtimeRequirements)),steps:p,diagnostics:t}}var hr="vibe64.resource-estimates.v1",ye="Resource estimates",un="VIBE64_RESOURCE_ESTIMATES_INVALID",fr=1024*1024,an=1024*
575
+ 1024,cn=new Map([["Startup typical MiB","startupTypical"],["Startup high MiB","startupHigh"],["Running typical MiB","run\
576
+ ningTypical"],["Running high MiB","runningHigh"],["Typical MiB","typical"],["High MiB","high"]]);function G(e,n,t){d(un,
577
577
  e,n,t)}function Xe(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\
578
- quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function ln(e,n={}){
578
+ quires typical and high estimates, with typical no greater than high.",r),{typicalBytes:i,highBytes:o}}function pn(e,n={}){
579
579
  let{path:t="genesis/stack.md#Resource estimates",targets:s=[],hasWorkspaceSetup:r=!1}=n;(!Array.isArray(e)||e.length>2048||
580
580
  e.some(p=>typeof p!="string")||Buffer.byteLength(e.join(`
581
581
  `),"utf8")>64*1024)&&G(t,"Resource estimates must be exact Stack section lines within 64 KiB and 2048 lines.");let i={version:1,
@@ -589,27 +589,27 @@ continue;let f=m.match(/^### Output `([a-z0-9]+(?:-[a-z0-9]+)*)`$/u);if(f||m==="
589
589
  "",Y=P?`output:${P}`:"workspace-setup";u.has(Y)&&G(t,"Resource estimates contains a duplicate operation.",l),u.add(Y);let Q=o.
590
590
  get(P);P&&!["interactive","finite"].includes(Q?.mode)&&G(t,`Resource estimate references an undeclared output: ${P}.`,l),
591
591
  !P&&!r&&G(t,"Resource estimate references undeclared Workspace setup steps.",l),a={targetId:P,mode:Q?.mode||"setup",fields:new Map,
592
- line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),C=g&&un.get(g[1]);(!a||!C)&&G(t,`Expected an Output\
593
- or Workspace setup heading followed by positive integer MiB estimates: ${[...un.keys()].map(P=>`- ${P}: \`number\``).join(
592
+ line:l};continue}let g=m.match(/^- ([A-Za-z ]+): `([1-9][0-9]*)`$/u),C=g&&cn.get(g[1]);(!a||!C)&&G(t,`Expected an Output\
593
+ or Workspace setup heading followed by positive integer MiB estimates: ${[...cn.keys()].map(P=>`- ${P}: \`number\``).join(
594
594
  "; ")}.`,l),a.fields.has(C)&&G(t,`Duplicate resource field: ${g[1]}.`,l);let k=Number(g[2]);(!Number.isSafeInteger(k)||k>
595
- cn)&&G(t,`Resource estimates must be between 1 and ${cn} MiB.`,l),a.fields.set(C,k*fr)}return c(),u.size===0&&G(t,"Resou\
595
+ an)&&G(t,`Resource estimates must be between 1 and ${an} MiB.`,l),a.fields.set(C,k*fr)}return c(),u.size===0&&G(t,"Resou\
596
596
  rce estimates needs an operation or exactly `- Nothing.`."),i}function be({section:e={},outputsSection:n={},workspaceSetupSection:t={}}={}){
597
597
  H(e,n,"Resource estimates and Outputs"),H(e,t,"Resource estimates and Workspace setup");let s=[...e.diagnostics||[]],r={
598
- version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=ln(e.lines,{targets:n.status==="read\
598
+ version:1,outputs:[],workspaceSetup:null};if(e.status==="ready"&&s.length===0)try{r=pn(e.lines,{targets:n.status==="read\
599
599
  y"?ge(n.lines).targets:[],hasWorkspaceSetup:t.status==="ready"&&Ee(t.lines).length>0})}catch(o){if(o?.name!=="Vibe64Stac\
600
- kOperationError")throw o;s.push({code:pn,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"i\
600
+ kOperationError")throw o;s.push({code:un,message:o.message,details:{...o.details,causeCode:o.code}})}let i=s.length>0?"i\
601
601
  nvalid":r.outputs.length>0||r.workspaceSetup?"ready":"unconfigured";return{contract:hr,status:i,stackHash:e.stackHash,sectionHash:e.
602
602
  sectionHash||"",estimatesHash:i==="ready"?O(r):"",source:e.source||null,outputs:r.outputs,workspaceSetup:r.workspaceSetup,
603
- fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var gr="vibe64.integration-setup.v1",dn="Integration setup",re="VIBE64_INTEGRATION_SETUP_INVALID",Er="- Command with `ru\
604
- ntime` in `workdir`: `command` `argument`...";function mn(e,n={}){let{path:t="genesis/stack.md#Integration setup"}=n;if(Array.
603
+ fallbackReason:i==="invalid"?"invalid-estimates":i==="unconfigured"?"not-declared":null,diagnostics:s}}var gr="vibe64.integration-setup.v1",ln="Integration setup",re="VIBE64_INTEGRATION_SETUP_INVALID",Er="- Command with `ru\
604
+ ntime` in `workdir`: `command` `argument`...";function dn(e,n={}){let{path:t="genesis/stack.md#Integration setup"}=n;if(Array.
605
605
  isArray(e)||d(re,t,"Integration setup requires exact Stack section lines."),v(e))return null;let s=e.map(i=>i.trim()).filter(
606
606
  Boolean),r=s.length===1&&s[0].match(/^- Command with (.+?) in `([^`\r\n]+)`: (.+)$/u);return r||d(re,t,`Integration setu\
607
607
  p requires exactly one entry: ${Er}; or - Nothing.`),{argv:R(r[3],re,t,"Integration setup command"),workdir:y(r[2],re,t,
608
- "Integration setup workdir"),runtimeRequirements:A(r[1],re,t,"Integration setup runtimes")}}function hn({section:e={}}={}){
609
- let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?mn(e.lines):null;return{contract:gr,status:n.length?"blo\
608
+ "Integration setup workdir"),runtimeRequirements:A(r[1],re,t,"Integration setup runtimes")}}function mn({section:e={}}={}){
609
+ let n=[...e.diagnostics||[]],t=e.status==="ready"&&n.length===0?dn(e.lines):null;return{contract:gr,status:n.length?"blo\
610
610
  cked":t?"ready":"unconfigured",stackHash:e.stackHash,recipeHash:t?O({version:1,command:t}):"",source:e.source||null,components:[
611
- ...e.components||[]],command:t,diagnostics:n}}var yr=new URL("./index.js",import.meta.url).href,En=vr(yr),ve=new Map;async function wr(e){if(!W.isAbsolute(e||""))throw new TypeError(
612
- "Genesis host context requires an absolute runtime root.");let n=W.join(e,"genesis-context");if(!ve.has(n)){let t=kt(n).
611
+ ...e.components||[]],command:t,diagnostics:n}}var yr=new URL("./index.js",import.meta.url).href,gn=vr(yr),ve=new Map;async function wr(e){if(!W.isAbsolute(e||""))throw new TypeError(
612
+ "Genesis host context requires an absolute runtime root.");let n=W.join(e,"genesis-context");if(!ve.has(n)){let t=Tt(n).
613
613
  catch(s=>{throw ve.delete(n),s});ve.set(n,t)}return ve.get(n)}var{GENESIS_CONTRACTS:N,HOST_CONTEXT_RESOLVER_DATA_ENV:Sr,
614
614
  HOST_CONTEXT_RESOLVER_ENV:Ir,addStack:Tr,applyTemplate:kr,generatePrompt:_r,indexCodebase:Or,initialize:Rr,inspectCollaboration:Ar,
615
615
  inspectDerivedArtifacts:Nr,inspectEngineering:Cr,inspectEnvironment:we,inspectProject:Pr,inspectProjectFormat:Dr,inspectAgentIntegrations:$r,
@@ -619,23 +619,23 @@ sourceExplanationGuidance:To,validateArchitectureFacts:ko,mergeArchitectureObser
619
619
  CALL_WEB_SCHEMA:Ao,MACHINE_CITY_SCHEMA:No,PROGRAM_CITY_SCHEMA:Co,CITY_SCHEMA_VERSION:Po}=ie;async function Do(e){let n=await wr(
620
620
  e);return{[Ir]:Jr(),[Sr]:JSON.stringify({registryPath:n.registryPath}),GENESIS_TURN_CONTEXT_ENABLED:"0"}}var $o="genesis\
621
621
  /blueprint.md",Vo="genesis/subsystems.md",zr=Object.freeze(["vue","django-postgresql","jskit-postgresql","postgresql","r\
622
- ails-postgresql","spring-boot-postgresql"]),Fr=Object.freeze(["genesis-stack"]),gn=Object.freeze({BLUEPRINT_INVALID:"blu\
622
+ ails-postgresql","spring-boot-postgresql"]),Fr=Object.freeze(["genesis-stack"]),fn=Object.freeze({BLUEPRINT_INVALID:"blu\
623
623
  eprint",BLUEPRINT_REQUIRED:"start"}),qr=new Set(["adopt","blueprint","describe","deslop","program","review","start","ui-\
624
- pass","work"]);function yn(e,n={}){let{required:t=!1}=n,s=F(e);if(!s&&!t)return"";if(!qr.has(s))throw new TypeError(s?`U\
625
- nknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an explicit task.");return s}function Kr(e={}){return yn(
624
+ pass","work"]);function En(e,n={}){let{required:t=!1}=n,s=F(e);if(!s&&!t)return"";if(!qr.has(s))throw new TypeError(s?`U\
625
+ nknown Genesis prompt task: ${s}.`:"Genesis prompt actions require an explicit task.");return s}function Kr(e={}){return En(
626
626
  e.genesisTask)||"work"}function Yr(e={},n={}){return[e.conversationRequest,e.feedback,e.request,e.plan,e.description,n.label].
627
- map(F).find(Boolean)||"Continue the requested project work."}function Xr(){let e=(En.resolve.paths("genesis-compiler")||
628
- []).find(n=>fn(W.join(n,"genesis-compiler"))&&fn(W.join(n,".bin","genesis")));if(!e)throw new Error("The installed Genes\
629
- is compiler executable could not be located.");return W.join(e,".bin")}function bn(){let e=En.resolve("@local/vibe64-gen\
630
- esis/server");return W.resolve(W.dirname(e),"../../bin")}function Jr(){return W.resolve(bn(),"vibe64-genesis-host-contex\
631
- t")}function xo(e=[]){let n=bn(),t=Xr();return[...(Array.isArray(e)?e:[]).filter(r=>![n,t].includes(F(r))),n]}function Zr(e={},n={}){
627
+ map(F).find(Boolean)||"Continue the requested project work."}function Xr(){let e=(gn.resolve.paths("genesis-compiler")||
628
+ []).find(n=>hn(W.join(n,"genesis-compiler"))&&hn(W.join(n,".bin","genesis")));if(!e)throw new Error("The installed Genes\
629
+ is compiler executable could not be located.");return W.join(e,".bin")}function yn(){let e=gn.resolve("@local/vibe64-gen\
630
+ esis/server");return W.resolve(W.dirname(e),"../../bin")}function Jr(){return W.resolve(yn(),"vibe64-genesis-host-contex\
631
+ t")}function xo(e=[]){let n=yn(),t=Xr();return[...(Array.isArray(e)?e:[]).filter(r=>![n,t].includes(F(r))),n]}function Zr(e={},n={}){
632
632
  let{prompt:t=!1}=n;return{...e,...t?{hiddenStackPieces:zr}:{},stackPackages:Fr}}function jo(e={}){return D(Tr,e)}function Lo(e={}){
633
633
  return D(Rr,e)}function Mo(e={}){return D(Vr,e)}function Go(e={}){return D(Wr,e)}function Uo(e={}){return D(Br,e)}function Bo(e={}){
634
634
  return D($r,e)}function Wo(e={}){return D(Lr,e)}async function Ho(e={}){return ht(await K(ut,e))}async function zo(e={}){
635
635
  return Et(await K(ft,e))}function Fo(e={}){return D(Or,e)}function Qr(){let e=Nr();if(e?.contract!==N.derivedArtifacts)throw new Error(
636
636
  `Genesis returned ${e?.contract||"no contract identity"}; expected ${N.derivedArtifacts}.`);let n=Array.isArray(e.artifacts)?
637
637
  e.artifacts:[];if(!n.length||n.some(t=>!F(t?.path)))throw new Error("Genesis returned an invalid derived-artifact contra\
638
- ct.");return{...e,artifacts:n.map(t=>({...t}))}}var vn=Qr(),qo=Object.freeze(vn.artifacts.map(e=>e.path)),Je=new Map(vn.
638
+ ct.");return{...e,artifacts:n.map(t=>({...t}))}}var bn=Qr(),qo=Object.freeze(bn.artifacts.map(e=>e.path)),Je=new Map(bn.
639
639
  artifacts.map(e=>[e.id,e])),ei=Je.get("machine-city")?.path,ti=Je.get("program-city")?.path;if(!ei||!ti)throw new Error(
640
640
  "Genesis did not declare both City projection artifacts.");var ni=Je.get("call-web")?.path;if(!ni)throw new Error("Genes\
641
641
  is did not declare its call-web artifact.");async function D(e,n={},t={}){let s=F(n.projectRoot);if(!s||!W.isAbsolute(s))
@@ -648,39 +648,39 @@ e.length||t.some((s,r)=>s?.contract!==N.stackSection||s.name!==e[r]))throw new E
648
648
  section inspection batch.");return t}async function Yo(e={}){if((await si(e)).status!=="current")throw Object.assign(new Error(
649
649
  "The project needs a current Genesis format before its Stack can be inspected."),{code:"vibe64_stack_format_required"});
650
650
  await br(W.join(e.projectRoot,Ne),"utf8");let t=await K(se,e);return{components:t.components,stackHash:t.stackHash}}async function Xo(e={}){
651
- let[n,t]=await Promise.all([K(Ot,e),L(we,N.environment,e)]);return Nt({environment:t,section:n})}async function Jo(e={}){
652
- let[n,t]=await Promise.all([K(xt,e),L(we,N.environment,e)]);return Ut({environment:t,section:n})}function Zo(e={}){return D(
651
+ let[n,t]=await Promise.all([K(_t,e),L(we,N.environment,e)]);return At({environment:t,section:n})}async function Jo(e={}){
652
+ let[n,t]=await Promise.all([K(Vt,e),L(we,N.environment,e)]);return Gt({environment:t,section:n})}function Zo(e={}){return D(
653
653
  ie.verify,e)}function Qo(e={}){return L(we,N.environment,e)}function ea(e={}){return L(Pr,N.projectInspection,e)}function ta(e={}){
654
654
  return L(Mr,N.templates,e)}function na(e={}){return L(kr,N.templateApplication,e)}function sa(e={}){return L(Cr,N.engineering,
655
655
  e)}function ra(e={}){return L(Ar,N.collaboration,e)}async function si(e={}){let n=await D(Dr,e);if(!F(n?.status))throw new Error(
656
656
  "Genesis did not return a project-format status.");return{...n}}function ia(e={}){return L(Ur,N.engineering,e)}function oa(e={}){
657
657
  return L(Gr,N.collaboration,e)}async function aa({resourcesPreparing:e=!1,...n}={}){let[[t,s,r],i]=await Promise.all([Ze(
658
- [he,ye,se],n),L(we,N.environment,n)]);return{...en({environment:i,section:t,resourcesPreparing:e===!0}),resourceEstimates:be(
659
- {section:s,outputsSection:t,workspaceSetupSection:r})}}async function ca(e={}){let n=await K(dn,e);return hn({section:n})}
660
- async function ua(e={}){return it(await K(st,e))}async function pa(e={}){return sn(await K(tn,e))}async function la(e={}){
661
- let[n,t,s]=await Ze([se,ye,he],e);return{...await an({projectRoot:e.projectRoot,section:n}),resourceEstimates:be({section:t,
658
+ [he,ye,se],n),L(we,N.environment,n)]);return{...Qt({environment:i,section:t,resourcesPreparing:e===!0}),resourceEstimates:be(
659
+ {section:s,outputsSection:t,workspaceSetupSection:r})}}async function ca(e={}){let n=await K(ln,e);return mn({section:n})}
660
+ async function ua(e={}){return it(await K(st,e))}async function pa(e={}){return nn(await K(en,e))}async function la(e={}){
661
+ let[n,t,s]=await Ze([se,ye,he],e);return{...await on({projectRoot:e.projectRoot,section:n}),resourceEstimates:be({section:t,
662
662
  outputsSection:s,workspaceSetupSection:n})}}async function da(e={}){let[n,t,s]=await Ze([ye,he,se],e);return be({section:n,
663
663
  outputsSection:t,workspaceSetupSection:s})}async function ma({action:e={},environment:n,input:t={},projectRoot:s}){let r=Kr(
664
- e),i=Yr(t,e),o=m=>D(_r,{environment:n,projectRoot:s,request:i,sessionContextInstalled:!0,task:m},{prompt:!0}),u=m=>{if(!bt(
665
- m))throw m;return{prompt:i}},a=r,c;try{c=await o(a)}catch(m){let l=Object.hasOwn(gn,String(m?.code))?gn[m.code]:"";if(!l||
666
- l===r||t.automaticGenesisTask===!0)return u(m);a=l;try{c=await o(a)}catch(f){return u(f)}}let p=yn(c.task)||a;return{context:{
667
- genesis:!0,requestedTask:r,task:p,verificationCommands:c.verificationCommands,warnings:c.warnings},originalPrompt:i,prompt:c.
668
- prompt,promptId:F(e.promptId||e.id)||p}}export{Ao as CALL_WEB_SCHEMA,Po as CITY_SCHEMA_VERSION,$o as GENESIS_BLUEPRINT_PATH,ni as GENESIS_CALL_WEB_PATH,qo as GENESIS_DERIVED_ARTIFACT_PATHS,
664
+ e),i=Yr(t,e),o=m=>D(_r,{environment:n,projectRoot:s,request:i,sessionContextInstalled:!0,task:m},{prompt:!0}),u=()=>({prompt:i}),
665
+ a=r,c;try{c=await o(a)}catch(m){let l=Object.hasOwn(fn,String(m?.code))?fn[m.code]:"";if(!l||l===r||t.automaticGenesisTask===
666
+ !0)return u();a=l;try{c=await o(a)}catch{return u()}}let p=En(c.task)||a;return{context:{genesis:!0,requestedTask:r,task:p,
667
+ verificationCommands:c.verificationCommands,warnings:c.warnings},originalPrompt:i,prompt:c.prompt,promptId:F(e.promptId||
668
+ e.id)||p}}export{Ao as CALL_WEB_SCHEMA,Po as CITY_SCHEMA_VERSION,$o as GENESIS_BLUEPRINT_PATH,ni as GENESIS_CALL_WEB_PATH,qo as GENESIS_DERIVED_ARTIFACT_PATHS,
669
669
  ei as GENESIS_MACHINE_CITY_PATH,ti as GENESIS_PROGRAM_CITY_PATH,Ne as GENESIS_STACK_PATH,yt as GENESIS_STACK_SECTION_AMBIGUOUS,
670
670
  Vo as GENESIS_SUBSYSTEMS_PATH,No as MACHINE_CITY_SCHEMA,Co as PROGRAM_CITY_SCHEMA,Io as SOURCE_EXPLANATION_PROMPT_VERSION,
671
- _t as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,le as VIBE64_PACKAGING_CONTRACT,ne as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,
672
- jo as addGenesisStack,na as applyGenesisTemplate,yn as assertGenesisPromptTask,bn as genesisCommandShimDirectory,Xr as genesisPackageBinDirectory,
673
- So as genesisParserEnvironment,Xn as genesisProjectContractNeedsAttention,Zn as genesisProjectFileDiagnostic,bt as genesisProjectFileUnreadable,
671
+ kt as VIBE64_APPLICATION_DEPLOYMENT_CONTRACT,le as VIBE64_PACKAGING_CONTRACT,ne as VIBE64_PREVIEW_IDENTITY_COMMAND_PROTOCOL,
672
+ jo as addGenesisStack,na as applyGenesisTemplate,En as assertGenesisPromptTask,yn as genesisCommandShimDirectory,Xr as genesisPackageBinDirectory,
673
+ So as genesisParserEnvironment,Yn as genesisProjectContractNeedsAttention,Zn as genesisProjectFileDiagnostic,Jn as genesisProjectFileUnreadable,
674
674
  Yr as genesisPromptRequest,Kr as genesisPromptTask,Lo as initializeGenesisProject,Bo as inspectGenesisAgentIntegrations,
675
675
  ra as inspectGenesisCollaboration,Qr as inspectGenesisDerivedArtifacts,sa as inspectGenesisEngineering,Qo as inspectGenesisEnvironment,
676
676
  ea as inspectGenesisProject,si as inspectGenesisProjectFormat,Mo as inspectGenesisSkills,Yo as inspectGenesisStackComponents,
677
677
  Wo as inspectGenesisSubsystems,Ho as inspectVibe64ArchitectureInspection,zo as inspectVibe64ArchitectureLayout,ua as inspectVibe64ConnectedDevelopment,
678
678
  Xo as inspectVibe64Deployment,ca as inspectVibe64IntegrationSetup,aa as inspectVibe64Outputs,Jo as inspectVibe64Packaging,
679
679
  pa as inspectVibe64ProjectServices,da as inspectVibe64ResourceEstimates,la as inspectVibe64WorkspaceSetup,ta as listGenesisTemplates,
680
- _o as mergeArchitectureObservations,At as parseVibe64DeploymentLines,mn as parseVibe64IntegrationSetupLines,ge as parseVibe64OutputsLines,
681
- Mt as parseVibe64PackagingLines,nn as parseVibe64ProjectServicesLines,ln as parseVibe64ResourceEstimatesLines,Ee as parseVibe64WorkspaceSetupLines,
682
- Fn as readArchitecturePreviewLocator,Fo as refreshGenesisCities,ma as renderGenesisPrompt,Xs as resolveVibe64OutputParameters,
683
- Gt as resolveVibe64PackagingEnvironment,oa as setGenesisCollaboration,ia as setGenesisEngineeringProfile,To as sourceExplanationGuidance,
680
+ _o as mergeArchitectureObservations,Rt as parseVibe64DeploymentLines,dn as parseVibe64IntegrationSetupLines,ge as parseVibe64OutputsLines,
681
+ Lt as parseVibe64PackagingLines,tn as parseVibe64ProjectServicesLines,pn as parseVibe64ResourceEstimatesLines,Ee as parseVibe64WorkspaceSetupLines,
682
+ zn as readArchitecturePreviewLocator,Fo as refreshGenesisCities,ma as renderGenesisPrompt,Xs as resolveVibe64OutputParameters,
683
+ Mt as resolveVibe64PackagingEnvironment,oa as setGenesisCollaboration,ia as setGenesisEngineeringProfile,To as sourceExplanationGuidance,
684
684
  Uo as syncGenesisAgentIntegrations,Go as syncGenesisSkills,ko as validateArchitectureFacts,Ro as validateCallWeb,Oo as validateCityDocument,
685
685
  Zo as verifyGenesisProject,Ko as vibe64ConversationInstructions,ee as vibe64Driver,Do as vibe64HostContextEnvironment,wr as vibe64HostContextRegistry,
686
686
  Jr as vibe64HostContextResolverPath,xo as withGenesisCommandShim};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe64",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "private": false,
5
5
  "description": "Run Vibe64 against the current project.",
6
6
  "type": "module",
@@ -53,15 +53,15 @@
53
53
  "@fastify/static": "10.1.4",
54
54
  "@fastify/websocket": "11.3.1",
55
55
  "@jskit-ai/agent": "0.1.2",
56
- "@jskit-ai/assistant-core": "0.2.32",
57
- "@jskit-ai/assistant-runtime": "0.2.34",
58
- "@jskit-ai/assistant-voice": "0.2.34",
59
- "@jskit-ai/connector-google-calendar": "0.2.18",
60
- "@jskit-ai/connectors-catalog": "0.2.18",
61
- "@jskit-ai/connectors-core": "0.2.18",
56
+ "@jskit-ai/assistant-core": "0.2.33",
57
+ "@jskit-ai/assistant-runtime": "0.2.35",
58
+ "@jskit-ai/assistant-voice": "0.2.35",
59
+ "@jskit-ai/connector-google-calendar": "0.2.19",
60
+ "@jskit-ai/connectors-catalog": "0.2.19",
61
+ "@jskit-ai/connectors-core": "0.2.19",
62
62
  "@jskit-ai/http-runtime": "0.2.15",
63
63
  "@jskit-ai/kernel": "0.2.15",
64
- "@jskit-ai/payments-core": "0.2.6",
64
+ "@jskit-ai/payments-core": "0.2.7",
65
65
  "@jskit-ai/realtime": "0.2.22",
66
66
  "@jskit-ai/resource-core": "0.1.206",
67
67
  "@jskit-ai/uploads-runtime": "0.2.15",
package/server.bundle.mjs CHANGED
@@ -50397,15 +50397,17 @@ dable:${_wi("sha256").update(m).digest("hex").slice(0,32)}`,text:`A project file
50397
50397
  till sent, and the AI is told about it so it can fix the file.`});g&&await e.publishTerminalSessionChanged("agentTermina\
50398
50398
  l",d,"project-file-unreadable",{conversationLogPatch:{type:"upsert-turn",turn:g},...h?{conversationId:h}:{}})}async function l(d,p){
50399
50399
  if(await i.requireAssistantAccess(d,p),Dg(p.session))return;let f=Ke(p.session);if(!(!f||!bwi(wwi.join(f,Swi))||(await i.
50400
- hasActiveTemporaryConversation(d,{},p)).active||(await xwi({projectRoot:f})).status!=="current")){EEe(p.runtime)&&await Y7r(
50401
- f);try{await c(d,f)}catch(g){if(Ewi(g)){tt(n,"warn",{code:g.code,component:"vibe64.agent_skills",event:"vibe64.agent_ski\
50402
- lls.refresh_deferred",sessionId:d},"Project contracts need repair or a project decision; skill refresh deferred so chat \
50403
- remains available.");return}if(g?.code==="AGENT_SKILL_UNAVAILABLE"){await t.invalidateWorkspaceSetup(p,`${g.message} Run\
50404
- workspace preparation to restore the project's declared dependencies. Chat remains available.`),tt(n,"warn",{code:g.code,
50405
- component:"vibe64.agent_skills",event:"vibe64.agent_skills.preparation_required",sessionId:d},"Project skill refresh req\
50406
- uires workspace preparation.");return}if(!Twi(g))throw g;tt(n,"warn",{code:g.code||g.name,component:"vibe64.agent_skills",
50407
- event:"vibe64.agent_skills.project_file_unreadable",sessionId:d},"A project file cannot be read; skill refresh deferred \
50408
- and the message sent."),await u(d,p,g)}}}return Object.freeze({prepareAgentSkillsInsideAgentWrite:l,prepareAssistantChangeover:s,
50400
+ hasActiveTemporaryConversation(d,{},p)).active))try{if((await xwi({projectRoot:f})).status!=="current")return;EEe(p.runtime)&&
50401
+ await Y7r(f),await c(d,f)}catch(h){if(Ewi(h)){tt(n,"warn",{code:h.code,component:"vibe64.agent_skills",event:"vibe64.age\
50402
+ nt_skills.refresh_deferred",sessionId:d},"Project contracts need repair or a project decision; skill refresh deferred so\
50403
+ chat remains available.");return}if(h?.code==="AGENT_SKILL_UNAVAILABLE"){await t.invalidateWorkspaceSetup(p,`${h.message}\
50404
+ Run workspace preparation to restore the project's declared dependencies. Chat remains available.`),tt(n,"warn",{code:h.
50405
+ code,component:"vibe64.agent_skills",event:"vibe64.agent_skills.preparation_required",sessionId:d},"Project skill refres\
50406
+ h requires workspace preparation.");return}if(Twi(h)){tt(n,"warn",{code:h.code||h.name,component:"vibe64.agent_skills",event:"\
50407
+ vibe64.agent_skills.project_file_unreadable",sessionId:d},"A project file cannot be read; skill refresh deferred and the\
50408
+ message sent."),await u(d,p,h);return}tt(n,"warn",{code:h?.code||h?.name,component:"vibe64.agent_skills",error:String(h?.
50409
+ message||h),event:"vibe64.agent_skills.preparation_failed",sessionId:d},"Preparing the project's agent guidance failed; \
50410
+ the message is sent without the refresh.")}}return Object.freeze({prepareAgentSkillsInsideAgentWrite:l,prepareAssistantChangeover:s,
50409
50411
  prepareRoutingSelection:a})}import{genesisParserEnvironment as SIi,withGenesisCommandShim as EIi}from"@local/vibe64-genesis/server";import Owi,{randomUUID as kpt}from"node:crypto";import X7r from"node:http";import{mkdir as kwi,rm as Npt,stat as Pwi}from"node:fs/promises";
50410
50412
  import{tmpdir as Nwi}from"node:os";import Mpt from"node:path";wt();be();var jpt=new Set;function Q7r(e){return jpt.add(e),()=>jpt.delete(e)}function Dpt(e,t,r=""){let n={socketPath:e.
50411
50413
  socketPath,sessionId:e.sessionId,generationId:e.generationId,reason:t};tt(e.commandService.logger,t==="rejected"?"warn":