@vibgrate/haile 2026.910.3 → 2026.911.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arch-ui/map.js +652 -0
- package/dist/engine/haile.wasm +0 -0
- package/dist/index.d.ts +4 -9
- package/dist/index.js +10 -10
- package/package.json +6 -1
package/dist/engine/haile.wasm
CHANGED
|
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
|
|
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=
|
|
4
|
-
`),1;let
|
|
5
|
-
`),1;let
|
|
6
|
-
`),1;let s=e,f=
|
|
7
|
-
`),1;let n;try{let
|
|
8
|
-
`),1;n=JSON.parse(
|
|
9
|
-
`),1}let o=
|
|
10
|
-
`),
|
|
11
|
-
`),1}return 0}function
|
|
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.
|
|
3
|
+
"version": "2026.911.1",
|
|
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"
|