@vibgrate/haile 2026.910.3 → 2026.910.4

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.
Binary file
package/dist/index.d.ts CHANGED
@@ -66,8 +66,10 @@ interface HaileFinding {
66
66
  * layer owns its ports, the domain stays pure, handlers only delegate.
67
67
  * `layered-v1`: controller → service → repository — the service layer owns
68
68
  * the ORM, and a controller must not read or write the store itself.
69
+ * `vertical-v1`: vertical slices — a request handler owns its slice end to
70
+ * end, reads and writes included; only the domain and the views stay pure.
69
71
  */
70
- type HailePolicy = "hexagonal-v1" | "layered-v1";
72
+ type HailePolicy = "hexagonal-v1" | "layered-v1" | "vertical-v1";
71
73
  declare const POLICIES: readonly HailePolicy[];
72
74
  declare const DEFAULT_POLICY: HailePolicy;
73
75
  interface HaileClassification {
@@ -105,6 +107,7 @@ interface HaileProvider {
105
107
  cap?: number;
106
108
  architecture?: boolean;
107
109
  tests?: boolean;
110
+ expand?: boolean;
108
111
  }): unknown;
109
112
  renderArchPage?(opts: {
110
113
  host: "browser" | "vscode";
@@ -138,14 +141,6 @@ declare function loadWasmHaileKernel(): WasmHaileKernel | null;
138
141
  /** Reset the memoized engine (tests only). */
139
142
  declare function resetWasmHaileKernelCache(): void;
140
143
 
141
- /**
142
- * Factory consumed by the public CLI seam (loadHaileProvider).
143
- *
144
- * Returns null when the wasm engine is missing — never a dummy provider,
145
- * never a TypeScript lexicon. Overview, slice, and the map page are kernel
146
- * exports; this file only parses JSON at the trust boundary.
147
- */
148
-
149
144
  declare function createHaileProvider(kernel?: WasmHaileKernel | null): HaileProvider | null;
150
145
 
151
146
  /**
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import{pathToFileURL as re}from"node:url";import*as y from"node:fs";import*as _ from"node:path";var v=["hexagonal-v1","layered-v1"],w="hexagonal-v1",H="vg.arch.v1",x="vg.arch.taxonomy.v1",A="vg.arch.ir.v1",m="haile-fast/2026.903.5",P="balanced",I=8e3,C=new Set(["function","method","route","test","component","job"]);var W=240,F=400,D=16,M=32,U=new Set(["public","private","protected","internal","static","async","override","virtual","abstract","final","def","fn","function","func","sub","pub","export","const","let","var","new","sealed","extern","unsafe","readonly","partial","default","synchronized","native","inline","constexpr","friend","explicit","operator","suspend","open","lateinit","get","set"]);function R(r){return C.has(r)}function K(r){switch(r){case"method":return"method";case"route":return"route";case"test":return"test";case"job":return"job";case"component":return"handler";default:return"function"}}function j(r,t=""){let a=t?r.indexOf(`${t}(`):-1;if(a<0&&(r.startsWith("@")||r.startsWith("[")))return[];let i=a>=0?a+t.length:r.indexOf("("),c=r.lastIndexOf(")");if(i<0||c<=i)return[];let e=r.slice(i+1,c).trim();return!e||e==="void"?[]:e.split(",").map(s=>s.trim()).filter(Boolean).slice(0,16).map(s=>{let f=s.replace(/\b(const|mut|ref|public|private|protected|readonly|final)\b/g,"").trim();if(f.includes(":")){let[o,d]=f.split(":").map(u=>u.trim());return{name:o||"arg",type_name:d||void 0}}let n=f.split(/\s+/);return n.length>=2?{name:n[n.length-1],type_name:n[0]}:{name:f}})}function q(r,t){let a=r.lastIndexOf("->");if(a>=0)return r.slice(a+2).replace(/[{;].*$/,"").trim()||void 0;let i=r.lastIndexOf(":"),c=r.lastIndexOf(")");if(i>c&&c>=0)return r.slice(i+1).replace(/[{;].*$/,"").replace(/\s*=>.*$/,"").trim()||void 0;let e=t?r.indexOf(`${t}(`):-1;if(e>0){let s=r.slice(0,e).trim(),f=0,n=0;for(let d=s.length-1;d>=0;d--){let u=s[d];if(u===">"||u==="]"||u===")")f++;else if(u==="<"||u==="["||u==="(")f--;else if(/\s/.test(u)&&f===0){n=d+1;break}}let o=s.slice(n).trim();if(o&&!o.startsWith("@")&&!o.startsWith("[")&&!U.has(o)&&o!=="void"&&!o.endsWith(")")&&!o.endsWith("]"))return o}}function $(r,t,a,i){let c=[],e=[],s=new Set,f=new Set;for(let n of t){if(n.src!==r||n.kind!=="call"&&n.kind!=="references")continue;let o=a.get(n.dst);if(!o)continue;let d=o.qualifiedName||o.name;if(!(!d||s.has(d))&&(s.add(d),c.push(d),o.file&&o.file!==i&&!f.has(o.file)&&e.length<D&&(f.add(o.file),e.push(o.file)),c.length>=24))break}return{calls:c,calleePaths:e}}function B(r,t,a){let i=new Map;for(let e of r)(e.kind==="file"||e.kind==="module")&&i.set(e.id,e.file);let c=new Map;for(let e of t){if(e.kind!=="import")continue;let s=i.get(e.src);if(!s)continue;let f=a.get(e.dst),n=f?.qualifiedName||f?.name;if(!n)continue;let o=c.get(s);o||(o=[],c.set(s,o)),o.length<M&&!o.includes(n)&&o.push(n)}return c}function k(r){let t=r.nodes??[],a=r.edges??[],i=new Map;for(let s of t)i.set(s.id,s);let c=B(t,a,i),e=[];for(let s of t){if(!R(s.kind))continue;let f=typeof s.decorators=="string"?s.decorators.trim():"",n=`${f?`${f} `:""}${s.signature??""}`.slice(0,F),{calls:o,calleePaths:d}=$(s.id,a,i,s.file),u=typeof s.doc=="string"?s.doc.trim().slice(0,W):"";e.push({node_id:s.id,file_path:s.file,name:s.name,qualified_name:s.qualifiedName||s.name,symbol_kind:K(s.kind),language:s.lang??"",signature:n,calls:o,parameters:j(n,s.name),return_type:q(n,s.name),...u?{doc:u}:{},callee_paths:d,imports:c.get(s.file)??[],...s.effects&&typeof s.effects=="object"?{effects:s.effects}:{},...Array.isArray(s.duties)?{duties:s.duties.slice(0,48)}:{}})}return e.sort((s,f)=>s.node_id<f.node_id?-1:s.node_id>f.node_id?1:0),e}import*as b from"node:fs";import{fileURLToPath as Y}from"node:url";var g;function V(){return[new URL("./engine/haile.wasm",import.meta.url),new URL("../engine/haile.wasm",import.meta.url),new URL("../crate/target/wasm32-unknown-unknown/release/vibgrate_haile_kernel.wasm",import.meta.url)].map(r=>Y(r))}function X(r){try{let t=new WebAssembly.Module(r),i=new WebAssembly.Instance(t,{}).exports;if(typeof i.vg_alloc!="function"||typeof i.vg_free!="function"||typeof i.vg_version!="function"||typeof i.vg_classify!="function"||!i.memory)return null;let c=n=>{let o=new TextEncoder().encode(n),d=i.vg_alloc(o.length);return new Uint8Array(i.memory.buffer,d,o.length).set(o),{ptr:d,len:o.length}},e=n=>{if(!n)return"";let o=new DataView(i.memory.buffer,n,4).getUint32(0,!0),d=new TextDecoder().decode(new Uint8Array(i.memory.buffer,n+4,o));return i.vg_free(n,4+o),d},s=(n,o)=>{let{ptr:d,len:u}=c(o);try{return e(n(d,u))}finally{i.vg_free(d,u)}},f={version:()=>{try{return e(i.vg_version())||m}catch{return m}},classifyJson:n=>{let o=JSON.stringify({name:n.name??"",path:n.path??"",symbolKind:n.symbolKind??"function",fileKind:n.fileKind??"source",calls:n.calls??[],types:n.types??[],idents:n.idents??[],profile:n.profile??"balanced",policy:n.policy??"hexagonal-v1",qualifiedName:n.qualifiedName??"",doc:n.doc??"",signature:n.signature??"",params:n.params??[],returnType:n.returnType??"",calleePaths:n.calleePaths??[],imports:n.imports??[],astRole:n.astRole??"",effects:n.effects??{},duties:n.duties??[]});return s(i.vg_classify,o)}};return typeof i.vg_overview=="function"&&(f.overviewJson=(n,o)=>s(i.vg_overview,JSON.stringify({graph:n,sidecar:o??null}))),typeof i.vg_slice=="function"&&(f.sliceJson=(n,o,d)=>s(i.vg_slice,JSON.stringify({graph:n,sidecar:o??null,spec:d??{}}))),typeof i.vg_arch_page=="function"&&(f.archPage=n=>s(i.vg_arch_page,JSON.stringify({host:n.host??"browser",nonce:n.nonce??"",theme:n.theme??""}))),f}catch{return null}}function L(){if(g!==void 0)return g;g=null;try{let r=V().find(t=>b.existsSync(t));return r&&(g=X(b.readFileSync(r))),g}catch{return g=null,g}}function z(){g=void 0}function T(r){return Array.isArray(r)?r.filter(t=>typeof t=="string"):[]}function G(r){if(!r)return null;try{return JSON.parse(r)}catch{return null}}function Q(r){if(!r)return null;try{let t=JSON.parse(r);if(!t||typeof t!="object")return null;let a=t.role&&typeof t.role=="object"?t.role:t,i=typeof a.primary=="string"?a.primary:"";if(!i)return null;let c=t.intent&&typeof t.intent=="object"?t.intent:{};return{primary:i,confidence:typeof a.confidence=="number"?a.confidence:0,band:typeof a.band=="string"?a.band:"abstain",alternatives:Array.isArray(a.alternatives)?a.alternatives.filter(e=>typeof e?.role=="string").map(e=>({role:e.role,confidence:typeof e.confidence=="number"?e.confidence:0})):[],purposes:Array.isArray(t.purposes)?t.purposes.filter(e=>typeof e?.purpose=="string").map(e=>({purpose:e.purpose,confidence:typeof e.confidence=="number"?e.confidence:0})):[],intent:{text:typeof c.text=="string"?c.text:"",verbs:T(c.verbs),objects:T(c.objects)},findings:Array.isArray(t.findings)?t.findings.filter(e=>typeof e?.rule=="string"&&typeof e?.message=="string").map(e=>({rule:e.rule,severity:typeof e.severity=="string"?e.severity:"warn",message:e.message,...typeof e.line=="number"&&Number.isFinite(e.line)&&e.line>0?{line:Math.floor(e.line)}:{}})).slice(0,8):[],evidence:Array.isArray(t.evidence)?t.evidence.filter(e=>typeof e?.kind=="string"&&typeof e?.signal=="string").map(e=>({kind:e.kind,signal:e.signal,weight:typeof e.weight=="number"?e.weight:0})):[]}}catch{return null}}function E(r){let t=r===void 0?L():r;if(!t)return null;let a={version:()=>t.version(),classify:i=>{try{return Q(t.classifyJson(i))}catch{return null}}};return t.overviewJson&&(a.projectOverview=(i,c)=>{try{return G(t.overviewJson(i,c))}catch{return null}}),t.sliceJson&&(a.projectSlice=(i,c,e)=>{try{return G(t.sliceJson(i,c,e))}catch{return null}}),t.archPage&&(a.renderArchPage=i=>{try{let c=t.archPage({host:i.host,theme:i.theme,nonce:i.nonce});return typeof c=="string"?c:""}catch{return""}}),a}var Z=new Set(["strict","balanced","exploratory"]),ee=new Set(v);function S(r,t){let a=r.indexOf(t);if(!(a<0||a+1>=r.length))return r[a+1]}function ne(){return new Promise((r,t)=>{let a=[];process.stdin.on("data",i=>a.push(Buffer.from(i))),process.stdin.on("end",()=>r(Buffer.concat(a).toString("utf8"))),process.stdin.on("error",t)})}async function O(r=process.argv.slice(2),t={}){if(r[0]!=="sidecar")return process.stderr.write(`usage: node index.js sidecar --stdin --out <file> --profile <strict|balanced|exploratory> [--policy <hexagonal-v1|layered-v1>]
1
+ import{pathToFileURL as se}from"node:url";import*as h from"node:fs";import*as w from"node:path";var b=["hexagonal-v1","layered-v1","vertical-v1"],H="hexagonal-v1",x="vg.arch.v1",A="vg.arch.taxonomy.v1",P="vg.arch.ir.v1",y="haile-fast/2026.903.5",I="balanced",k=8e3,R=new Set(["function","method","route","test","component","job"]);var W=240,F=400,D=16,M=32,q=new Set(["public","private","protected","internal","static","async","override","virtual","abstract","final","def","fn","function","func","sub","pub","export","const","let","var","new","sealed","extern","unsafe","readonly","partial","default","synchronized","native","inline","constexpr","friend","explicit","operator","suspend","open","lateinit","get","set"]);function K(r){return R.has(r)}function T(r){switch(r){case"method":return"method";case"route":return"route";case"test":return"test";case"job":return"job";case"component":return"handler";default:return"function"}}function $(r,i=""){let a=i?r.indexOf(`${i}(`):-1;if(a<0&&(r.startsWith("@")||r.startsWith("[")))return[];let t=a>=0?a+i.length:r.indexOf("("),l=r.lastIndexOf(")");if(t<0||l<=t)return[];let e=r.slice(t+1,l).trim();return!e||e==="void"?[]:e.split(",").map(s=>s.trim()).filter(Boolean).slice(0,16).map(s=>{let f=s.replace(/\b(const|mut|ref|public|private|protected|readonly|final)\b/g,"").trim();if(f.includes(":")){let[o,d]=f.split(":").map(u=>u.trim());return{name:o||"arg",type_name:d||void 0}}let n=f.split(/\s+/);return n.length>=2?{name:n[n.length-1],type_name:n[0]}:{name:f}})}function B(r,i){let a=r.lastIndexOf("->");if(a>=0)return r.slice(a+2).replace(/[{;].*$/,"").trim()||void 0;let t=r.lastIndexOf(":"),l=r.lastIndexOf(")");if(t>l&&l>=0)return r.slice(t+1).replace(/[{;].*$/,"").replace(/\s*=>.*$/,"").trim()||void 0;let e=i?r.indexOf(`${i}(`):-1;if(e>0){let s=r.slice(0,e).trim(),f=0,n=0;for(let d=s.length-1;d>=0;d--){let u=s[d];if(u===">"||u==="]"||u===")")f++;else if(u==="<"||u==="["||u==="(")f--;else if(/\s/.test(u)&&f===0){n=d+1;break}}let o=s.slice(n).trim();if(o&&!o.startsWith("@")&&!o.startsWith("[")&&!q.has(o)&&o!=="void"&&!o.endsWith(")")&&!o.endsWith("]"))return o}}function Y(r,i,a,t){let l=[],e=[],s=new Set,f=new Set;for(let n of i){if(n.src!==r||n.kind!=="call"&&n.kind!=="references")continue;let o=a.get(n.dst);if(!o)continue;let d=o.qualifiedName||o.name;if(!(!d||s.has(d))&&(s.add(d),l.push(d),o.file&&o.file!==t&&!f.has(o.file)&&e.length<D&&(f.add(o.file),e.push(o.file)),l.length>=24))break}return{calls:l,calleePaths:e}}function V(r,i,a){let t=new Map;for(let e of r)(e.kind==="file"||e.kind==="module")&&t.set(e.id,e.file);let l=new Map;for(let e of i){if(e.kind!=="import")continue;let s=t.get(e.src);if(!s)continue;let f=a.get(e.dst),n=f?.qualifiedName||f?.name;if(!n)continue;let o=l.get(s);o||(o=[],l.set(s,o)),o.length<M&&!o.includes(n)&&o.push(n)}return l}function L(r){let i=r.nodes??[],a=r.edges??[],t=new Map;for(let s of i)t.set(s.id,s);let l=V(i,a,t),e=[];for(let s of i){if(!K(s.kind))continue;let f=typeof s.decorators=="string"?s.decorators.trim():"",n=`${f?`${f} `:""}${s.signature??""}`.slice(0,F),{calls:o,calleePaths:d}=Y(s.id,a,t,s.file),u=typeof s.doc=="string"?s.doc.trim().slice(0,W):"";e.push({node_id:s.id,file_path:s.file,name:s.name,qualified_name:s.qualifiedName||s.name,symbol_kind:T(s.kind),language:s.lang??"",signature:n,calls:o,parameters:$(n,s.name),return_type:B(n,s.name),...u?{doc:u}:{},callee_paths:d,imports:l.get(s.file)??[],...s.effects&&typeof s.effects=="object"?{effects:s.effects}:{},...Array.isArray(s.duties)?{duties:s.duties.slice(0,48)}:{}})}return e.sort((s,f)=>s.node_id<f.node_id?-1:s.node_id>f.node_id?1:0),e}import*as J from"node:fs";import*as m from"node:path";import{fileURLToPath as ee}from"node:url";import*as _ from"node:fs";import{fileURLToPath as X}from"node:url";var g;function z(){return[new URL("./engine/haile.wasm",import.meta.url),new URL("../engine/haile.wasm",import.meta.url),new URL("../crate/target/wasm32-unknown-unknown/release/vibgrate_haile_kernel.wasm",import.meta.url)].map(r=>X(r))}function Q(r){try{let i=new WebAssembly.Module(r),t=new WebAssembly.Instance(i,{}).exports;if(typeof t.vg_alloc!="function"||typeof t.vg_free!="function"||typeof t.vg_version!="function"||typeof t.vg_classify!="function"||!t.memory)return null;let l=n=>{let o=new TextEncoder().encode(n),d=t.vg_alloc(o.length);return new Uint8Array(t.memory.buffer,d,o.length).set(o),{ptr:d,len:o.length}},e=n=>{if(!n)return"";let o=new DataView(t.memory.buffer,n,4).getUint32(0,!0),d=new TextDecoder().decode(new Uint8Array(t.memory.buffer,n+4,o));return t.vg_free(n,4+o),d},s=(n,o)=>{let{ptr:d,len:u}=l(o);try{return e(n(d,u))}finally{t.vg_free(d,u)}},f={version:()=>{try{return e(t.vg_version())||y}catch{return y}},classifyJson:n=>{let o=JSON.stringify({name:n.name??"",path:n.path??"",symbolKind:n.symbolKind??"function",fileKind:n.fileKind??"source",calls:n.calls??[],types:n.types??[],idents:n.idents??[],profile:n.profile??"balanced",policy:n.policy??"hexagonal-v1",qualifiedName:n.qualifiedName??"",doc:n.doc??"",signature:n.signature??"",params:n.params??[],returnType:n.returnType??"",calleePaths:n.calleePaths??[],imports:n.imports??[],astRole:n.astRole??"",effects:n.effects??{},duties:n.duties??[]});return s(t.vg_classify,o)}};return typeof t.vg_overview=="function"&&(f.overviewJson=(n,o)=>s(t.vg_overview,JSON.stringify({graph:n,sidecar:o??null}))),typeof t.vg_slice=="function"&&(f.sliceJson=(n,o,d)=>s(t.vg_slice,JSON.stringify({graph:n,sidecar:o??null,spec:d??{}}))),typeof t.vg_arch_page=="function"&&(f.archPage=n=>s(t.vg_arch_page,JSON.stringify({host:n.host??"browser",nonce:n.nonce??"",theme:n.theme??""}))),f}catch{return null}}function E(){if(g!==void 0)return g;g=null;try{let r=z().find(i=>_.existsSync(i));return r&&(g=Q(_.readFileSync(r))),g}catch{return g=null,g}}function Z(){g=void 0}function j(r){return Array.isArray(r)?r.filter(i=>typeof i=="string"):[]}function G(r){if(!r)return null;try{return JSON.parse(r)}catch{return null}}function ne(r){if(!r)return null;try{let i=JSON.parse(r);if(!i||typeof i!="object")return null;let a=i.role&&typeof i.role=="object"?i.role:i,t=typeof a.primary=="string"?a.primary:"";if(!t)return null;let l=i.intent&&typeof i.intent=="object"?i.intent:{};return{primary:t,confidence:typeof a.confidence=="number"?a.confidence:0,band:typeof a.band=="string"?a.band:"abstain",alternatives:Array.isArray(a.alternatives)?a.alternatives.filter(e=>typeof e?.role=="string").map(e=>({role:e.role,confidence:typeof e.confidence=="number"?e.confidence:0})):[],purposes:Array.isArray(i.purposes)?i.purposes.filter(e=>typeof e?.purpose=="string").map(e=>({purpose:e.purpose,confidence:typeof e.confidence=="number"?e.confidence:0})):[],intent:{text:typeof l.text=="string"?l.text:"",verbs:j(l.verbs),objects:j(l.objects)},findings:Array.isArray(i.findings)?i.findings.filter(e=>typeof e?.rule=="string"&&typeof e?.message=="string").map(e=>({rule:e.rule,severity:typeof e.severity=="string"?e.severity:"warn",message:e.message,...typeof e.line=="number"&&Number.isFinite(e.line)&&e.line>0?{line:Math.floor(e.line)}:{}})).slice(0,8):[],evidence:Array.isArray(i.evidence)?i.evidence.filter(e=>typeof e?.kind=="string"&&typeof e?.signal=="string").map(e=>({kind:e.kind,signal:e.signal,weight:typeof e.weight=="number"?e.weight:0})):[]}}catch{return null}}function S(r){let i=r===void 0?E():r;if(!i)return null;let a={version:()=>i.version(),classify:t=>{try{return ne(i.classifyJson(t))}catch{return null}}};return i.overviewJson&&(a.projectOverview=(t,l)=>{try{return G(i.overviewJson(t,l))}catch{return null}}),i.sliceJson&&(a.projectSlice=(t,l,e)=>{try{return G(i.sliceJson(t,l,e))}catch{return null}}),i.archPage&&(a.renderArchPage=t=>{try{let l=i.archPage({host:t.host,theme:t.theme,nonce:t.nonce});return typeof l=="string"?l:""}catch{return""}}),a.archUiAssets=()=>{try{let t=m.dirname(ee(import.meta.url)),l=[m.join(t,"arch-ui"),m.join(t,"..","dist","arch-ui"),m.join(t,"..","arch-ui")];for(let e of l)if(J.existsSync(m.join(e,"map.js")))return e;return null}catch{return null}},a}var re=new Set(["strict","balanced","exploratory"]),te=new Set(b);function O(r,i){let a=r.indexOf(i);if(!(a<0||a+1>=r.length))return r[a+1]}function ie(){return new Promise((r,i)=>{let a=[];process.stdin.on("data",t=>a.push(Buffer.from(t))),process.stdin.on("end",()=>r(Buffer.concat(a).toString("utf8"))),process.stdin.on("error",i)})}async function N(r=process.argv.slice(2),i={}){if(r[0]!=="sidecar")return process.stderr.write(`usage: node index.js sidecar --stdin --out <file> --profile <strict|balanced|exploratory> [--policy <hexagonal-v1|layered-v1|vertical-v1>]
2
2
  `),1;if(!r.includes("--stdin"))return process.stderr.write(`sidecar requires --stdin
3
- `),1;let a=S(r,"--out");if(!a)return process.stderr.write(`sidecar requires --out <file>
4
- `),1;let i=S(r,"--profile")??P;if(!Z.has(i))return process.stderr.write(`invalid --profile ${i}
5
- `),1;let c=i,e=S(r,"--policy")??w;if(!ee.has(e))return process.stderr.write(`invalid --policy ${e} (one of ${v.join(", ")})
6
- `),1;let s=e,f=t.provider===void 0?E():t.provider;if(!f)return process.stderr.write(`architecture kernel wasm missing \u2014 refusing to classify
7
- `),1;let n;try{let l=(await(t.readInput??ne)()).trim();if(!l)return process.stderr.write(`sidecar stdin was empty
8
- `),1;n=JSON.parse(l)}catch{return process.stderr.write(`sidecar stdin was not valid JSON
9
- `),1}let o=k({nodes:Array.isArray(n.nodes)?n.nodes:[],edges:Array.isArray(n.edges)?n.edges:[]}),d=f.version()||m,u=[],N=!1;for(let l of o){if(u.length>=8e3){N=!0;break}let p=f.classify({name:l.name,path:l.file_path,symbolKind:l.symbol_kind,fileKind:"source",calls:l.calls,types:[...l.parameters.map(h=>h.type_name).filter(h=>!!h),...l.return_type?[l.return_type]:[]],idents:[l.name,...l.calls].slice(0,24),profile:c,policy:s,qualifiedName:l.qualified_name,doc:l.doc??"",signature:l.signature,params:l.parameters.map(h=>h.name),returnType:l.return_type??"",calleePaths:l.callee_paths,imports:l.imports,...l.ast_role?{astRole:l.ast_role}:{},...l.effects?{effects:l.effects}:{},...l.duties?{duties:l.duties}:{}});p&&u.push({node_id:l.node_id,file_path:l.file_path,name:l.name,qualified_name:l.qualified_name,symbol_kind:l.symbol_kind,role:{primary:p.primary,alternatives:p.alternatives,confidence:p.confidence,band:p.band},purposes:p.purposes,intent:p.intent,evidence:p.evidence,...p.findings.length?{findings:p.findings}:{}})}let J={magic:H,taxonomy:x,ir:A,corpus_hash:n.provenance?.corpusHash??"",engine_version:d,profile:c,policy:s,symbols:u,...N?{symbols_capped:!0}:{}};try{y.mkdirSync(_.dirname(_.resolve(a)),{recursive:!0});let l=`${a}.${process.pid}.tmp`;y.writeFileSync(l,`${JSON.stringify(J)}
10
- `),y.renameSync(l,a)}catch{return process.stderr.write(`sidecar failed to write ${a}
11
- `),1}return 0}function te(){let r=process.argv[1];if(!r)return!1;try{return import.meta.url===re(r).href}catch{return!1}}te()&&O().then(r=>{process.exit(r)});export{w as DEFAULT_POLICY,P as DEFAULT_PROFILE,I as DEFAULT_SYMBOL_CAP,m as HAILE_ENGINE_VERSION,A as HAILE_IR,H as HAILE_MAGIC,x as HAILE_TAXONOMY,v as POLICIES,k as adaptGraph,E as createHaileProvider,R as isCallableKind,L as loadWasmHaileKernel,z as resetWasmHaileKernelCache,O as runSidecarCli,K as symbolKindOf};
3
+ `),1;let a=O(r,"--out");if(!a)return process.stderr.write(`sidecar requires --out <file>
4
+ `),1;let t=O(r,"--profile")??I;if(!re.has(t))return process.stderr.write(`invalid --profile ${t}
5
+ `),1;let l=t,e=O(r,"--policy")??H;if(!te.has(e))return process.stderr.write(`invalid --policy ${e} (one of ${b.join(", ")})
6
+ `),1;let s=e,f=i.provider===void 0?S():i.provider;if(!f)return process.stderr.write(`architecture kernel wasm missing \u2014 refusing to classify
7
+ `),1;let n;try{let c=(await(i.readInput??ie)()).trim();if(!c)return process.stderr.write(`sidecar stdin was empty
8
+ `),1;n=JSON.parse(c)}catch{return process.stderr.write(`sidecar stdin was not valid JSON
9
+ `),1}let o=L({nodes:Array.isArray(n.nodes)?n.nodes:[],edges:Array.isArray(n.edges)?n.edges:[]}),d=f.version()||y,u=[],C=!1;for(let c of o){if(u.length>=8e3){C=!0;break}let p=f.classify({name:c.name,path:c.file_path,symbolKind:c.symbol_kind,fileKind:"source",calls:c.calls,types:[...c.parameters.map(v=>v.type_name).filter(v=>!!v),...c.return_type?[c.return_type]:[]],idents:[c.name,...c.calls].slice(0,24),profile:l,policy:s,qualifiedName:c.qualified_name,doc:c.doc??"",signature:c.signature,params:c.parameters.map(v=>v.name),returnType:c.return_type??"",calleePaths:c.callee_paths,imports:c.imports,...c.ast_role?{astRole:c.ast_role}:{},...c.effects?{effects:c.effects}:{},...c.duties?{duties:c.duties}:{}});p&&u.push({node_id:c.node_id,file_path:c.file_path,name:c.name,qualified_name:c.qualified_name,symbol_kind:c.symbol_kind,role:{primary:p.primary,alternatives:p.alternatives,confidence:p.confidence,band:p.band},purposes:p.purposes,intent:p.intent,evidence:p.evidence,...p.findings.length?{findings:p.findings}:{}})}let U={magic:x,taxonomy:A,ir:P,corpus_hash:n.provenance?.corpusHash??"",engine_version:d,profile:l,policy:s,symbols:u,...C?{symbols_capped:!0}:{}};try{h.mkdirSync(w.dirname(w.resolve(a)),{recursive:!0});let c=`${a}.${process.pid}.tmp`;h.writeFileSync(c,`${JSON.stringify(U)}
10
+ `),h.renameSync(c,a)}catch{return process.stderr.write(`sidecar failed to write ${a}
11
+ `),1}return 0}function oe(){let r=process.argv[1];if(!r)return!1;try{return import.meta.url===se(r).href}catch{return!1}}oe()&&N().then(r=>{process.exit(r)});export{H as DEFAULT_POLICY,I as DEFAULT_PROFILE,k as DEFAULT_SYMBOL_CAP,y as HAILE_ENGINE_VERSION,P as HAILE_IR,x as HAILE_MAGIC,A as HAILE_TAXONOMY,b as POLICIES,L as adaptGraph,S as createHaileProvider,K as isCallableKind,E as loadWasmHaileKernel,Z as resetWasmHaileKernelCache,N as runSidecarCli,T as symbolKindOf};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibgrate/haile",
3
- "version": "2026.910.3",
3
+ "version": "2026.910.4",
4
4
  "description": "Vibgrate HAILE architecture kernel: deterministic callable classification (role, purposes, intent, band) over a vg-graph. Proprietary distribution — compiled WASM engine plus a minified loader; the taxonomy is not included.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -24,7 +24,12 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^26.4.1",
27
+ "@types/react": "^18.3.0",
28
+ "@types/react-dom": "^18.3.0",
29
+ "@xyflow/react": "^12.11.6",
27
30
  "esbuild": "^0.28.2",
31
+ "react": "^19.3.0",
32
+ "react-dom": "^19.3.0",
28
33
  "tsup": "^8.0.0",
29
34
  "typescript": "^5.4.0",
30
35
  "vitest": "^5.0.0"