@precisionutilityguild/liquid-shadow 1.0.2 → 1.0.3

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 +1 @@
1
- import{parentPort as i,workerData as y}from"worker_threads";import g from"pino";var p={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},m=g({level:process.env.LOG_LEVEL||"info",base:{service:"liquid-shadow"},formatters:{level(e,r){return{level:e,severity:p[r]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),a=m;var n=null;async function f(){return n||(n=await import("@xenova/transformers"),n.env.cacheDir=y?.cacheDir||"./.cache",n.env.allowLocalModels=!1),n}var c=null;async function M(){let{pipeline:e}=await f();c=await e("feature-extraction","Xenova/all-MiniLM-L6-v2")}async function h(e){if(e.length===0)return[];try{let r=await c(e,{pooling:"mean",normalize:!0}),[t,s]=r.dims,o=[];for(let l=0;l<t;l++){let d=l*s,u=d+s;o.push(Array.from(r.data.slice(d,u)))}return o}catch(r){a.error({err:r,batchSize:e.length},"Vectorized batch embedding failed, falling back to sequential");let t=[];for(let s of e){if(!s||s.trim().length===0){t.push(null);continue}try{let o=await c(s,{pooling:"mean",normalize:!0});t.push(Array.from(o.data))}catch{t.push(null)}}return t}}async function b(e){if(e.type==="shutdown"&&process.exit(0),e.type==="embed")try{let r=await h(e.texts),t={type:"result",id:e.id,embeddings:r};i?.postMessage(t)}catch(r){let t={type:"error",id:e.id,error:r instanceof Error?r.message:String(r)};i?.postMessage(t)}}async function v(){await M();let e={type:"ready"};i?.postMessage(e),i?.on("message",r=>{b(r).catch(t=>{a.error({error:t},"Worker error")})})}v().catch(e=>{a.error({error:e},"Failed to initialize embedding worker"),process.exit(1)});
1
+ import{parentPort as i,workerData as y}from"worker_threads";import g from"pino";var p={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},m=g({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(e,r){return{level:e,severity:p[r]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),a=m;var n=null;async function f(){return n||(n=await import("@xenova/transformers"),n.env.cacheDir=y?.cacheDir||"./.cache",n.env.allowLocalModels=!0),n}var c=null;async function M(){let{pipeline:e}=await f();c=await e("feature-extraction","Xenova/all-MiniLM-L6-v2")}async function h(e){if(e.length===0)return[];try{let r=await c(e,{pooling:"mean",normalize:!0}),[t,s]=r.dims,o=[];for(let l=0;l<t;l++){let d=l*s,u=d+s;o.push(Array.from(r.data.slice(d,u)))}return o}catch(r){a.error({err:r,batchSize:e.length},"Vectorized batch embedding failed, falling back to sequential");let t=[];for(let s of e){if(!s||s.trim().length===0){t.push(null);continue}try{let o=await c(s,{pooling:"mean",normalize:!0});t.push(Array.from(o.data))}catch{t.push(null)}}return t}}async function b(e){if(e.type==="shutdown"&&process.exit(0),e.type==="embed")try{let r=await h(e.texts),t={type:"result",id:e.id,embeddings:r};i?.postMessage(t)}catch(r){let t={type:"error",id:e.id,error:r instanceof Error?r.message:String(r)};i?.postMessage(t)}}async function v(){await M();let e={type:"ready"};i?.postMessage(e),i?.on("message",r=>{b(r).catch(t=>{a.error({error:t},"Worker error")})})}v().catch(e=>{a.error({error:e},"Failed to initialize embedding worker"),process.exit(1)});
@@ -0,0 +1,36 @@
1
+ import fe from"@swc/core";import Pe from"fs";function he(e){let t=e.split(`
2
+ `),i=[],n=0;for(let s of t)i.push(n),n+=s.length+1;return i}function I(e,t){for(let i=0;i<t.length;i++)if(t[i+1]>e||i===t.length-1)return i+1;return 1}function te(e,t){return t.slice(0,e).toString("utf8").length}function ye(e){if(e.toString("utf8").length===e.length)return n=>n;let i=new Map;return n=>{let s=i.get(n);return s===void 0&&(s=e.slice(0,n).toString("utf8").length,i.set(n,s)),s}}function ge(e,t,i){let n=e.start-t,s=e.end-t;return n<0||s>i.length?"":i.slice(n,s).toString("utf8")}function be(e){let t=[],i=/\/\*\*[\s\S]*?\*\//g,n;for(;(n=i.exec(e))!==null;)t.push({start:n.index,end:n.index+n[0].length,text:n[0]});return t}function F(e,t,i){for(let n of t){if(n.start===e)return n.text;if(n.start>e&&n.start<e+50){let s=i.substring(e,n.start);if(/^\s*$/.test(s))return n.text}if(n.end<=e&&n.end>e-50){let s=i.substring(n.end,e);if(/^\s*$/.test(s))return n.text}}return""}function xe(e){if(!e)return"";let i=e.replace(/\/\*\*|\*\/|\*/g,"").trim().split(`
3
+ `)[0].trim();return i.length>200?i.substring(0,197)+"...":i}function ne(e,t,i){let n=e.toLowerCase(),s=t.toLowerCase();return n.includes("components/")||n.endsWith(".tsx")?"Component":n.startsWith("use")||s.startsWith("use")?"Hook":n.includes("models/")||s.endsWith("model")?"Model":n.includes("services/")||n.includes("controllers/")||n.includes("handlers/")||n.includes("mcp/")||n.endsWith("service.ts")||n.endsWith("controller.ts")||n.endsWith("handler.ts")||s.endsWith("service")||s.endsWith("controller")||s.endsWith("handler")?"Service":n.includes("repositories/")||n.includes("repos/")||n.endsWith("repository.ts")||n.endsWith("repo.ts")||s.endsWith("repository")||s.endsWith("repo")?"Repository":i==="TsInterfaceDeclaration"||i==="TsTypeAliasDeclaration"?"Type Definition":"Other"}function K(e){let t=[];return/\b(fetch|axios|superagent|got)\s*\(|import\s+.*\b(http|https|node-fetch)\b/i.test(e)&&t.push("Network"),(/\b(knex|prisma|typeorm|mongoose|sequelize|pg|mysql|sqlite3)\b/i.test(e)||/\b(SELECT\s+.*FROM|INSERT\s+INTO|UPDATE\s+.*SET|DELETE\s+FROM)\b/i.test(e)||/\.query\s*\(|\.execute\s*\(/i.test(e)&&/db|database|client|pool/i.test(e))&&t.push("Database"),(/\bfs\./i.test(e)||/\b(readFileSync|writeFileSync|readFile|writeFile|readdir)\b/.test(e)||/import\s+.*\bfs\b/.test(e))&&t.push("File System"),(/\b(localStorage|sessionStorage|indexedDB)\./.test(e)||/\bdocument\.cookie\b/.test(e))&&t.push("Browser Storage"),t}function N(e,t){if(!e)return"";let i=e.replace(/^([\s\S]*?\*\/)?\s*/,"").replace(/^.*\} from ['"].*['"];?\s*/,"").replace(/^import .*['"];?\s*/,"").trim();if(t==="TsInterfaceDeclaration"||t==="TsTypeAliasDeclaration")return i;let n=0,s=0,p=i.length;for(let d=0;d<i.length;d++){let h=i[d];if(h==="(")n++;else if(h===")")n--;else if(h==="<")s++;else if(h===">")s--;else if(h==="{"){if(n===0&&s===0){p=d;break}}else if(h==="; "&&n===0&&s===0){p=d;break}else if(h==="="&&i[d+1]===">"&&n===0&&s===0){p=d+2;break}}return i.substring(0,p).trim()}function De(e){let t=[];for(let i of e)i.type==="ImportDeclaration"&&t.push({module:i.source.value,name:i.specifiers.map(n=>n.type==="ImportDefaultSpecifier"?"default":n.type==="ImportNamespaceSpecifier"?"*":n.local?.value||n.imported?.value||"*").join("","")}),i.type==="ExportAllDeclaration"&&t.push({module:i.source.value,name:"*"}),i.type==="ExportNamedDeclaration"&&i.source&&t.push({module:i.source.value,name:i.specifiers.map(n=>n.type==="ExportSpecifier"?n.orig.value:"*").join(", ")});return t}function ve(e,t,i,n,s,p,d,h,g){let l=g??(a=>te(a,i)),f=[];for(let a of e){if(a.type==="ExportDeclaration"){let c=a.declaration,r=c.type,o="";r==="VariableDeclaration"?o=c.declarations.map(M=>M.id.value).join("",""):o=c.id?.value||c.identifier?.value||"anonymous";let u=l(a.span.start-t),y=l(a.span.end-t),m=F(u,p,n),b=h(a.span),C=[];if(a.type==="ExportDeclaration"&&(r==="ClassDeclaration"||r==="ClassExpression")){let M=c.body||[];for(let _ of M)if(_.type==="ClassMethod"||_.type==="ClassProperty"){let L=_.key.value;if(!L)continue;let k=l(_.span.start-t),q=l(_.span.end-t),P=h(_.span),T=F(k,p,n);C.push({name:L,kind:_.type,signature:N(P,_.type),line:I(k,s),endLine:I(q,s),doc:T,classification:_.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(r==="FunctionDeclaration"&&c.body?.type==="BlockStatement")C=pe(c.body.stmts,t,i,n,s,p,h,l);else if(r==="VariableDeclaration"){for(let M of c.declarations)if(M.init&&(M.init.type==="ArrowFunctionExpression"||M.init.type==="FunctionExpression")&&M.init.body?.type==="BlockStatement"){C=pe(M.init.body.stmts,t,i,n,s,p,h,l);break}}f.push({name:o,kind:r,signature:N(b,r),line:I(u,s),endLine:I(y,s),doc:m,classification:ne(d,o,r),capabilities:JSON.stringify(K(b)),members:C})}if(a.type==="ExportNamedDeclaration"){for(let c of a.specifiers)if(c.type==="ExportSpecifier"){let r=l(a.span.start-t),o=l(a.span.end-t),u=F(r,p,n);f.push({name:c.exported?.value||c.orig.value,kind:"ExportSpecifier",signature:`export { ${c.orig.value} }`,line:I(r,s),endLine:I(o,s),doc:u,classification:"Export mapping",capabilities:"[]"})}}if(a.type==="ExportDefaultDeclaration"){let c=l(a.span.start-t),r=l(a.span.end-t),o=F(c,p,n),u=h(a.span),y=[];if(a.decl.type==="ClassExpression"||a.decl.type==="ClassDeclaration"){let m=a.decl.body||[];for(let b of m)if(b.type==="ClassMethod"||b.type==="ClassProperty"){let C=b.key.value;if(!C)continue;let M=l(b.span.start-t),_=l(b.span.end-t),L=h(b.span),k=F(M,p,n);y.push({name:C,kind:b.type,signature:N(L,b.type),line:I(M,s),endLine:I(_,s),doc:k,classification:b.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(a.decl.type==="FunctionExpression"||a.decl.type==="FunctionDeclaration"||a.decl.type==="ArrowFunctionExpression")&&a.decl.body?.type==="BlockStatement"&&(y=pe(a.decl.body.stmts,t,i,n,s,p,h,l));f.push({name:"default",kind:"DefaultExport",signature:N(u,"DefaultExport"),line:I(c,s),endLine:I(r,s),doc:o,classification:"Default Export",capabilities:JSON.stringify(K(u)),members:y})}if(a.type==="ExportAllDeclaration"){let c=l(a.span.start-t),r=l(a.span.end-t),o=a.source.value,u=F(c,p,n);f.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${o}"`,line:I(c,s),endLine:I(r,s),doc:u,classification:"Re-export",capabilities:"[]"})}}return f}function pe(e,t,i,n,s,p,d,h){let g=[];for(let l of e){if(l.type==="VariableDeclaration")for(let f of l.declarations){let a=[],c=r=>{if(r.type==="Identifier")a.push({name:r.value,span:r.span});else if(r.type==="ArrayPattern")for(let o of r.elements)o&&c(o);else if(r.type==="ObjectPattern")for(let o of r.properties)o.type==="AssignmentPatternProperty"?a.push({name:o.key.value,span:o.span}):o.type==="KeyValuePatternProperty"&&c(o.value)};c(f.id);for(let r of a){let o=h(r.span.start-t),u=h(r.span.end-t),y=d(r.span),m=F(o,p,n);g.push({name:r.name,kind:"VariableDeclaration",signature:N(y,"VariableDeclaration"),line:I(o,s),endLine:I(u,s),doc:m,classification:"Internal Variable",capabilities:"[]"})}}if(l.type==="FunctionDeclaration"){let f=l.identifier?.value||l.ident?.value||"anonymous",a=h(l.span.start-t),c=h(l.span.end-t),r=d(l.span),o=F(a,p,n);g.push({name:f,kind:"FunctionDeclaration",signature:N(r,"FunctionDeclaration"),line:I(a,s),endLine:I(c,s),doc:o,classification:"Internal Function",capabilities:"[]"})}if(l.type==="ReturnStatement"&&l.argument?.type==="ObjectExpression")for(let f of l.argument.properties){let a="",c=f.span||f.key?.span||f.ident?.span;if(f.type==="KeyValueProperty"){let r=f.key;a=r?.value||r?.raw||(r?.type==="Identifier"?r.value:"")}else f.type==="MethodProperty"?a=f.key?.value||f.key?.raw||"":f.type==="ShorthandProperty"?a=f.ident?.value||"":f.type==="Identifier"&&(a=f.value||"");if(a&&c){let r=h(c.start-t),o=h(c.end-t),u=d(c),y=F(r,p,n);g.push({name:a,kind:"ReturnProperty",signature:N(u,"ReturnProperty"),line:I(r,s),endLine:I(o,s),doc:y,classification:"Return Member",capabilities:"[]"})}}if(l.type==="ExpressionStatement"&&l.expression.type==="CallExpression"){let f=l.expression;if(f.callee.type==="MemberExpression"&&(f.callee.property?.value==="on"||f.callee.property?.value==="once")){let a=f.arguments[0]?.expression?.value,c=f.arguments[1]?.expression;if(a&&c&&(c.type==="ArrowFunctionExpression"||c.type==="FunctionExpression")){let r=h(c.span.start-t),o=h(c.span.end-t),u=d(c.span);g.push({name:`on:${a}`,kind:c.type,signature:N(u,c.type),line:I(r,s),endLine:I(o,s),doc:"",classification:"Event Handler",capabilities:"[]"})}}if(f.callee.type==="Identifier"&&f.callee.value==="addRoute"&&f.arguments.length>=3){let a=f.arguments[2].expression;if(a.type==="StringLiteral"){let c=a.value,r=h(f.span.start-t),o=h(f.span.end-t),u=d(f.span);g.push({name:c,kind:"HTTP Route",signature:N(u,"HTTP Route"),line:I(r,s),endLine:I(o,s),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:c})})}}}}return g}function Se(e,t,i,n,s,p){let d=p??(l=>te(l,i)),h=[];function g(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let f=we(l);if(f){let a=d(l.span.start-t);h.push({...f,line:I(a,n),snippet:s(l.span)})}}for(let f of Object.keys(l)){if(f==="span")continue;let a=l[f];Array.isArray(a)?a.forEach(g):typeof a=="object"&&g(a)}}}return e.forEach(g),h}function we(e){let{callee:t,arguments:i}=e;if(!i||i.length===0)return null;if(t.type==="Identifier"&&t.value,t.type==="Identifier"&&t.value==="addRoute"&&i.length>=3){let n=i[2].expression;if(n.type==="StringLiteral")return{type:"api_route",name:n.value,direction:"consume"}}if(t.type==="MemberExpression"&&t.property?.type==="Identifier"){let n=t.property.value;if(n==="emit"&&i[0].expression.type==="StringLiteral")return{type:"socket_event",name:i[0].expression.value,direction:"produce"};if(n==="on"&&i[0].expression.type==="StringLiteral")return{type:"socket_event",name:i[0].expression.value,direction:"consume"};if(["get","post","put","delete","patch"].includes(n)&&i[0].expression.type==="StringLiteral"){let p=i[0].expression.value,d=t.object.type==="Identifier"?t.object.value:"";if(["axios","http","request","appApi","restApi","adminApi","client"].includes(d))return{type:"api_route",name:p,direction:"produce"};if(p.startsWith("/"))return{type:"api_route",name:p,direction:"consume"}}}return t.type==="Identifier"&&t.value==="fetch"&&i[0].expression.type==="StringLiteral"?{type:"api_route",name:i[0].expression.value,direction:"produce"}:null}function X(e){let{classification:t,capabilities:i,exports:n,fileName:s}=e,p={Network:"API integration",Database:"data persistence","File System":"file I/O operations","Browser Storage":"client-side storage"},d=i.map(o=>p[o]).filter(Boolean).join(" and "),g={Component:(o,u)=>{let y=u.find(b=>b.kind==="FunctionDeclaration"||b.kind==="ClassDeclaration")?.name,m=y?`React component: ${y}`:"React UI component";return o?`${m} with ${o}`:m},Hook:(o,u)=>{let y=u.find(b=>b.name.startsWith("use"))?.name,m=y?`Custom React hook: ${y}`:"Custom React hook";return o?`${m} for ${o}`:m},Service:(o,u)=>{let m=`Service layer: ${u[0]?.name||"Service"}`;return o?`${m} handling ${o}`:m},Repository:(o,u)=>`Data repository: ${u[0]?.name||"Repository"} for ${o||"data access"}`,"Type Definition":(o,u)=>`Type definitions: ${u.slice(0,3).map(m=>m.name).join("")}${u.length>3?"...":""}`,Model:(o,u)=>`Data model: ${u[0]?.name||"Model"}`,"HTTP Route":(o,u)=>{let y=u.filter(m=>m.classification==="Service Boundary");return y.length>0?`API endpoints: ${y.slice(0,3).map(m=>m.name).join("")}`:"API route handler"},"Micro IR (PHP)":(o,u)=>{let y=u.some(b=>b.classification==="Service Boundary"),m=u.find(b=>b.kind==="ClassDeclaration")?.name;return y?"PHP controller with API routes":m?`PHP class: ${m}`:"PHP module"},"Micro IR (Python)":(o,u)=>{let y=u.some(b=>b.classification==="Service Boundary"),m=u.find(b=>b.kind==="ClassDeclaration")?.name;return y?"Python API handler with routes":m?`Python class: ${m}`:"Python module"},"Micro IR (Go/TS) ":(o,u)=>{let y=u.some(b=>b.kind==="TypeDeclaration"),m=u.filter(b=>b.kind==="FunctionDeclaration");return y&&m.length>0?`Go package: types and ${m.length} function(s)`:y?"Go package: type definitions":m.length>0?`Go package: ${m[0].name} and ${m.length} function(s)`:"Go module"},"Micro IR (Rust/TS) ":(o,u)=>{let y=u.find(C=>C.kind==="TraitDeclaration")?.name,m=u.find(C=>C.kind==="StructDeclaration")?.name,b=u.filter(C=>C.kind==="FunctionDeclaration");return y?o.includes("Rust trait")?`Rust module: trait ${y}`:`Rust module: ${y}`:m?`Rust module: struct ${m}`:b.length>0?`Rust module: ${b.length} function(s)`:"Rust module"}}[t];if(g)return g(d,n);if(n.length===0)return s?`Module: ${s}`:"Module with no exports";let l=n.filter(o=>o.kind==="FunctionDeclaration"),f=n.filter(o=>o.kind==="ClassDeclaration"),a=n.filter(o=>o.kind==="TsInterfaceDeclaration"||o.kind==="TsTypeAliasDeclaration"),c=[];if(f.length>0&&c.push(`Class: ${f[0].name}`),l.length>0){let o=l.slice(0,2).map(u=>u.name).join("");c.push(`Functions: ${o}`)}a.length>0&&c.push(`Types: ${a.length}`);let r=c.length>0?c.join(" | "):`Module with ${n.length} export(s)`;return d?`${r} \u2014 ${d}`:r}function Te(e){let t=new Set;function i(n){if(!(!n||typeof n!="object")){n.typeAnnotation&&E(n.typeAnnotation,t),(n.type==="TsTypeReference"||n.type==="TsTypeAnnotation")&&E(n,t);for(let s in n){if(s==="span"||s==="comments"||s==="interpreter")continue;let p=n[s];p&&typeof p=="object"&&(Array.isArray(p)?p.forEach(i):i(p))}}}return e.forEach(n=>i(n)),Array.from(t)}function E(e,t){if(e){if(e.type==="TsTypeAnnotation"){E(e.typeAnnotation,t);return}e.type==="TsTypeReference"&&(e.typeName?.type==="Identifier"&&t.add(e.typeName.value),e.typeName?.type==="TsQualifiedName"&&Ce(e.typeName,t),e.typeParams&&E(e.typeParams,t)),e.type==="TsArrayType"&&E(e.elementType,t),e.type==="TsUnionType"&&e.types?.forEach(i=>E(i,t)),e.type==="TsIntersectionType"&&e.types?.forEach(i=>E(i,t)),e.type==="TsTupleType"&&e.elemTypes?.forEach(i=>E(i.ty,t)),(e.type==="TsFunctionType"||e.type==="TsConstructorType")&&(e.params?.forEach(i=>E(i.typeAnnotation,t)),e.typeAnnotation&&E(e.typeAnnotation,t)),e.type==="TsTypeParameterDeclaration"&&e.params?.forEach(i=>{i.constraint&&E(i.constraint,t),i.default&&E(i.default,t)}),e.type==="TsTypeParameterInstantiation"&&e.params?.forEach(i=>E(i,t)),e.type==="TsMappedType"&&e.typeAnnotation&&E(e.typeAnnotation,t),e.type==="TsIndexedAccessType"&&(E(e.objectType,t),E(e.indexType,t)),e.type==="TsConditionalType"&&(E(e.checkType,t),E(e.extendsType,t),E(e.trueType,t),E(e.falseType,t)),e.type==="TsTypeLiteral"&&e.members?.forEach(i=>{i.typeAnnotation&&E(i.typeAnnotation,t)})}}function Ce(e,t){e.type==="TsQualifiedName"?(e.left&&Ce(e.left,t),e.right?.value&&t.add(e.right.value)):e.type==="Identifier"&&t.add(e.value)}import Ae from"path";import me from"path";import Ee from"path";import Je from"fs";import{fileURLToPath as je}from"url";import*as U from"web-tree-sitter";import Le from"pino";var $e={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},Fe=Le({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(e,t){return{level:e,severity:$e[t]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),H=Fe;import{fileURLToPath as Ne}from"node:url";import{dirname as ue,join as Me,resolve as We}from"node:path";import{existsSync as ze}from"node:fs";var Be=Ne(import.meta.url),Re=ue(Be);function Ze(){let e=Re;for(;e!==ue(e);){if(ze(Me(e,"package.json")))return e;e=ue(e)}return We(Re,"..","..")}function Ie(...e){return Me(Ze(),...e)}var ht=Ee.dirname(je(import.meta.url)),ke=H.child({module:"parser:tree-sitter"}),ie=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let t=U.Parser||U;await t.init(),this.parser=new t}async getLanguage(t){if(this.languages.has(t))return this.languages.get(t);let i=Ie("resources","grammars",`tree-sitter-${this.getLangName(t)}.wasm`);if(!Je.existsSync(i))return ke.warn({grammarPath:i},"Grammar WASM not found"),null;try{let n=await U.Language.load(i);return this.languages.set(t,n),n}catch(n){return ke.error({err:n,ext:t},"Failed to load language grammar"),null}}getLangName(t){switch(t.toLowerCase()){case".php":return"php";case".py":return"python";case".go":return"go";case".rs":return"rust";default:return""}}getQueries(t){switch(t.toLowerCase()){case".php":return`
4
+ (function_definition name: (name) @name) @func
5
+ (class_declaration name: (name) @name) @class
6
+ (interface_declaration name: (name) @name) @interface
7
+ (trait_declaration name: (name) @name) @trait
8
+ (method_declaration name: (name) @name) @method
9
+ (namespace_use_declaration (namespace_use_clause (qualified_name) @name)) @import
10
+ `;case".py":return`
11
+ (function_definition name: (identifier) @name) @func
12
+ (class_definition name: (identifier) @name) @class
13
+ (import_statement name: (dotted_name) @name) @import
14
+ (import_from_statement module_name: (dotted_name) @name) @import
15
+ `;case".go":return`
16
+ (function_declaration name: (identifier) @name) @func
17
+ (method_declaration name: (identifier) @name) @func
18
+ (type_declaration (type_spec name: (identifier) @name)) @type
19
+ (import_spec path: (interpreted_string_literal) @name) @import
20
+ `;case".rs":return`
21
+ (function_item name: (identifier) @name) @func
22
+ (struct_item name: (_type_identifier) @name) @struct
23
+ (enum_item name: (_type_identifier) @name) @enum
24
+ (trait_item name: (_type_identifier) @name) @trait
25
+ (type_item name: (_type_identifier) @name) @type
26
+ (use_declaration argument: (_) @name) @import
27
+ `;default:return""}}mapKind(t,i){if(t==="import")return"ImportDeclaration";if(i===".php"){if(t==="func")return"FunctionDeclaration";if(t==="class")return"ClassDeclaration";if(t==="interface")return"InterfaceDeclaration";if(t==="trait")return"TraitDeclaration";if(t==="method")return"MethodDeclaration"}if(i===".py"){if(t==="func")return"FunctionDeclaration";if(t==="class")return"ClassDeclaration"}if(i===".go"){if(t==="func")return"FunctionDeclaration";if(t==="type")return"TypeDeclaration"}if(i===".rs"){if(t==="func")return"FunctionDeclaration";if(t==="struct")return"StructDeclaration";if(t==="enum")return"EnumDeclaration";if(t==="trait")return"TraitDeclaration";if(t==="type")return"TypeDeclaration"}return"Unknown"}mapClassification(t){return t==="import"?"Dependency":t==="func"||t==="method"?"Function":t==="class"||t==="interface"||t==="trait"||t==="struct"||t==="enum"||t==="type"?"Class":"Other"}async parse(t,i){await this.ensureInitialized();let n=Ee.extname(t).toLowerCase(),s=await this.getLanguage(n);if(!s||!this.parser)return[];this.parser.setLanguage(s);let p=this.parser.parse(i),d=i.split(`
28
+ `),h=this.getQueries(n);if(!h)return[];let l=new U.Query(s,h).matches(p.rootNode),f=[];for(let a of l){let c=a.captures.find(u=>u.name==="name")?.node,r=a.captures[0].node,o=a.captures[0].name;if(c){let u=r.startPosition.row+1,y=r.endPosition.row+1,m=d[r.startPosition.row].trim();f.push({name:c.text,kind:this.mapKind(o,n),classification:this.mapClassification(o),signature:m,line:u,endLine:y,doc:"",capabilities:"{}"})}}return f}};var se=class{parse(t,i=!1){let n=[],s=[],p=t.split(`
29
+ `),d="",h="",g=0,l=0,f=-1,a=-1,c=[],r=[],o=!1,u=i?"api":"",y="",m=/^namespace\s+([a-zA-Z0-9_\\]+);/,b=/^(?:abstract\s+)?(?:readonly\s+)?class\s+([a-zA-Z0-9_]+)/,C=/^interface\s+([a-zA-Z0-9_]+)/,M=/^trait\s+([a-zA-Z0-9_]+)/,_=/^(?:public|protected|private|static|\s)*function\s+([a-zA-Z0-9_]+)\s*\(/,L=/^use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/,k=/^#\[([a-zA-Z0-9_\\]+)(?:\((.*)\))?\]/,q=/(?:Route::|router->|\$router->|->)(get|post|put|delete|patch|match)\s*\(\s*(?:uri\s*:\s*)?['"]([^'"]+)['"]/,P=/->prefix\s*\(\s*(?:prefix\s*:\s*)?['"]([^'"]+)['"]/;for(let T=0;T<p.length;T++){let S=p[T].trim();if(!S)continue;let $=(S.match(/{/g)||[]).length,oe=(S.match(/}/g)||[]).length,ce=l;if(l+=$-oe,h&&l<=a){let v=n.find(x=>x.name===h&&x.line===g);v&&(v.endLine=T+1),h="",a=-1}if(d&&l<=f){let v=n.find(x=>x.name===d&&(x.kind==="ClassDeclaration"||x.kind==="TraitDeclaration"||x.kind==="InterfaceDeclaration"));v&&(v.endLine=T+1),d="",f=-1}let Y=S.match(P);if(Y&&(u=Y[1]),S.includes("});")&&(u=""),S.startsWith("/**")){o=!0,r=[];continue}if(o){S.endsWith("*/")?o=!1:r.push(S.replace(/^\*\s?/,""));continue}let G=S.match(k);if(G){c.push(G[1]);continue}let O=S.match(m);if(O){y=O[1]||"",c=[],r=[];continue}let R=S.match(b);if(R){d=R[1],f=l-$;let v={attributes:c};y&&(v.namespace=y),n.push({name:d,kind:"ClassDeclaration",classification:"Class",signature:`class ${d}`,line:T+1,endLine:T+1,doc:r.join(`
30
+ `).trim(),capabilities:JSON.stringify(v),members:[]}),c=[],r=[];continue}let D=S.match(C);if(D){let v=D[1];d=v,f=l-$,n.push({name:v,kind:"InterfaceDeclaration",classification:"Interface",signature:`interface ${v}`,line:T+1,endLine:T+1,doc:r.join(`
31
+ `).trim(),capabilities:JSON.stringify({attributes:c}),members:[]}),c=[],r=[];continue}let w=S.match(M);if(w){let v=w[1];d=v,f=l-$,n.push({name:v,kind:"TraitDeclaration",classification:"Trait",signature:`trait ${v}`,line:T+1,endLine:T+1,doc:r.join(`
32
+ `).trim(),capabilities:JSON.stringify({attributes:c}),members:[]}),c=[],r=[];continue}let Q=S.match(_);if(Q){let v=Q[1],x=!!d;h=v,g=T+1,a=l-$;let j=!1,W={};for(let A of c)A.toLowerCase().includes("route")&&(j=!0,W={type:"route",method:"GET",path:"/"});let z=r.join(`
33
+ `).trim();if(j){let A=W.path||"/";n.push({name:A,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${v}`,line:T+1,endLine:T+1,doc:z,capabilities:JSON.stringify({type:"route",handler:d?`${d}@${v}`:v,...W})}),s.push({type:"api_route",name:A,direction:"consume",line:T+1,snippet:S})}n.push({name:v,kind:x?"MethodDeclaration":"FunctionDeclaration",classification:x?"Method":"Function",signature:`${x?d+":: ":""}${v}`,line:T+1,endLine:T+1,doc:z,capabilities:JSON.stringify({attributes:c})}),c=[],r=[];continue}let Z=S.match(L);if(Z){let v=Z[1]||"",x=Z[2]||v.split("\\").pop()||"";n.push({name:x,kind:"ImportSpecifier",classification:"Dependency",signature:`use ${v}`,line:T+1,endLine:T+1,doc:"",capabilities:JSON.stringify({type:"use",namespace:v})}),c=[],r=[];continue}let V=S.match(q);if(V){let v=V[1].toUpperCase(),x=V[2];if(S.includes("Route::")||S.includes("router->")||S.includes("action")||S.includes(",")&&!S.includes("view(")){if(u){let B=u.startsWith("/")?u:`/${u}`,le=x.startsWith("/")?x:`/${x}`;x=(B+le).replace(/\/+/g,"/")}let W=null,z=S.match(/\[\s*([a-zA-Z0-9_]+)::class\s*,\s*['"]([^'"]+)['"]\s*\]/);if(z)W=`${z[1]}@${z[2]}`;else if(S.includes("::class")){let B=S.match(/([a-zA-Z0-9_]+)::class/);B&&(W=B[1])}let A=S;!S.endsWith(");")&&T+1<p.length&&(A+=" "+p[T+1].trim(),!A.endsWith(");")&&T+2<p.length&&(A+=" "+p[T+2].trim())),n.push({name:x,kind:"HTTP Route",classification:"Service Boundary",signature:A,line:T+1,endLine:T+1,doc:"",capabilities:JSON.stringify({type:"route",method:v,path:x,handler:W})}),s.push({type:"api_route",name:x,direction:"consume",line:T+1,snippet:A,method:v,url:x}),r=[];continue}}let ee=/(?:\$client|client|Http)::(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)|(?:\$client|client)->(request|get|post|put|delete|patch)\s*\(\s*([^,)]+)/,J=S.match(ee);if(J){let v=(J[1]||J[3]).toUpperCase(),x=(J[2]||J[4]).trim();(x.startsWith("'")&&x.endsWith("'")||x.startsWith('"')&&x.endsWith('"'))&&(x=x.substring(1,x.length-1)),s.push({type:"api_route",name:x,direction:"produce",line:T+1,snippet:S,method:v,url:x})}!S.startsWith("#[")&&!S.startsWith("//")&&!S.startsWith("*")&&!o&&(c=[],r=[])}return{nodes:n,events:s}}};var re=class{currentRoutePrefix="";parse(t){this.currentRoutePrefix="";let i=[],n=[],s=t.split(`
34
+ `),p=[{indent:-1,name:"root",type:"root"}],d=[],h=/^class\s+([a-zA-Z0-9_]+)/,g=/^async\s+def\s+([a-zA-Z0-9_]+)|^def\s+([a-zA-Z0-9_]+)/,l=/^(?:from\s+([a-zA-Z0-9_\.]+)\s+import|import\s+([a-zA-Z0-9_\.]+))/,f=/^@(.*)/;function a(m){return m.trim().split(/[.(]/)[0]?.trim()||m}function c(m){let b=m.decorators.map(M=>a(M.raw)),C={decorators:m.decorators,decoratorNames:b};return m.async===!0&&(C.async=!0),JSON.stringify(C)}let r=!1,o="",u=[],y=[];for(let m=0;m<s.length;m++){let b=s[m],C=b.trim();if(!C||C.startsWith("#"))continue;let M=/^([a-zA-Z0-9_]+)\s*=\s*(?:APIRouter|Blueprint)\s*\(\s*(?:prefix\s*=\s*)?['"]([^'"]+)['"]/,_=C.match(M);if(_&&(this.currentRoutePrefix=_[2]),r){if(C.endsWith(o)||C.includes(o)){r=!1;let R=C.replace(o,"").trim();R&&u.push(R);let D=p[p.length-1];D.node&&(D.node.doc=u.join(`
35
+ `).trim()),u=[]}else u.push(C);continue}let L=b.search(/\S/),k=b.trim(),q=k.match(/^(['"]{3})/);if(q){let R=q[1],D=p[p.length-1];if(D.node&&!D.node.doc){if(k.substring(3).includes(R)){let w=k.replace(new RegExp(R,"g"),"").trim();D.node.doc=w}else{r=!0,o=R;let w=k.substring(3).trim();w&&u.push(w)}continue}}for(;p.length>1&&p[p.length-1].indent>=L;)p.pop();let P=p[p.length-1],T=k.match(f);if(T){d.push({raw:T[1].trim(),line:m+1});continue}let S=k.match(h);if(S){let R=S[1],D={name:R,kind:"ClassDeclaration",classification:"Class",signature:`class ${R}`,line:m+1,endLine:m+1,doc:"",capabilities:c({decorators:d}),members:[]};y.push(D),P.node?(P.node.members||(P.node.members=[]),P.node.members.push(D)):i.push(D),p.push({indent:L,name:R,type:"class",node:D}),d=[];continue}let $=k.match(g);if($){let R=!!$[1],D=$[1]||$[2],w=P.type==="class",Q=!1,Z={};for(let x of d)if(x.raw.match(/(?:app|router)\.(get|post|put|delete|patch)/)){Q=!0;let W=["get","post","put","delete","patch"].find(B=>x.raw.toLowerCase().includes(`.${B}`))?.toUpperCase()||"GET",z=x.raw.match(/['"]([^'"]+)['"]/),A=z?z[1]:"/";if(this.currentRoutePrefix){let B=this.currentRoutePrefix.endsWith("/")?this.currentRoutePrefix.slice(0,-1):this.currentRoutePrefix,le=A.startsWith("/")?A:`/${A}`;A=B+le}Z={type:"route",method:W,path:A}}if(Q){let x=Z.path||"",j={name:x||D,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${D}`,line:m+1,endLine:m+1,doc:"",capabilities:JSON.stringify({handler:w?`${P.name}.${D}`:D,async:R,...Z})};y.push(j),i.push(j),n.push({type:"api_route",name:x,direction:"consume",line:m+1,snippet:k})}let V=d.some(x=>x.raw==="staticmethod"),ee=d.some(x=>x.raw==="classmethod"),J=`${R?"async ":""}${w?(V?"@staticmethod ":ee?"@classmethod ":"")+P.name+".":""}${D}`,v={name:D,kind:R&&w?"AsyncMethodDeclaration":R?"AsyncFunctionDeclaration":w?"MethodDeclaration":"FunctionDeclaration",classification:w?V||ee?"Static Method":"Method":"Function",signature:J,line:m+1,endLine:m+1,doc:"",capabilities:c({decorators:d,async:R}),members:[]};y.push(v),P.node?(P.node.members||(P.node.members=[]),P.node.members.push(v)):i.push(v),p.push({indent:L,name:D,type:"function",node:v}),d=[];continue}let oe=/^(?:path|re_path|url)\s*\(\s*['"]([^'"]+)['"]/,ce=k.match(oe);if(ce){let R=ce[1].replace(/^\^/,""),D={name:R,kind:"HTTP Route",classification:"Service Boundary",signature:k.trim(),line:m+1,endLine:m+1,doc:"",capabilities:JSON.stringify({type:"route",method:"GET",path:R})};y.push(D),i.push(D),n.push({type:"api_route",name:R,direction:"consume",line:m+1,snippet:k});continue}let Y=/(?:requests|httpx|client|http)\.(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)/,G=k.match(Y);if(G){let R=G[1].toUpperCase(),D=G[2].trim();(D.startsWith("'")&&D.endsWith("'")||D.startsWith('"')&&D.endsWith('"'))&&(D=D.substring(1,D.length-1)),n.push({type:"api_route",name:D,direction:"produce",line:m+1,snippet:k,method:R,url:D})}let O=k.match(l);if(O){let R=O[1]||O[2],D={name:R,kind:"ImportSpecifier",classification:"Dependency",signature:`import ${R}`,line:m+1,endLine:m+1,doc:"",capabilities:JSON.stringify({type:"import",module:R})};y.push(D),i.push(D),d=[];continue}d=[],P.node&&(P.node.endLine=m+1)}return{nodes:y,events:n}}};var _e=[{extension:[".php"],rules:[]},{extension:[".py"],rules:[]},{extension:[".go"],rules:[{regex:/func\s+([a-zA-Z0-9_]+)\(/g,onMatch:e=>({name:e[1],kind:"FunctionDeclaration",classification:"Function",signature:e[0]})},{regex:/func\s+\([^\)]+\)\s+([a-zA-Z0-9_]+)\(/g,onMatch:e=>({name:e[1],kind:"MethodDeclaration",classification:"Method",signature:e[0]})},{regex:/import\s+['"]([^'"]+)['"]/g,onMatch:e=>({name:e[1],kind:"ImportSpecifier",classification:"Dependency",signature:e[0],meta:{type:"import",path:e[1]}})}]},{extension:[".rs"],rules:[{regex:/fn\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:e=>({name:e[1],kind:"FunctionDeclaration",classification:"Function",signature:e[0]})},{regex:/struct\s+([a-zA-Z0-9_]+)/g,onMatch:e=>({name:e[1],kind:"StructDeclaration",classification:"Class",signature:e[0]})},{regex:/enum\s+([a-zA-Z0-9_]+)/g,onMatch:e=>({name:e[1],kind:"EnumDeclaration",classification:"Class",signature:e[0]})},{regex:/trait\s+([a-zA-Z0-9_]+)/g,onMatch:e=>({name:e[1],kind:"TraitDeclaration",classification:"Class",signature:e[0]})},{regex:/use\s+([a-zA-Z0-9_:]+(?:\s+as\s+[a-zA-Z0-9_]+)?);/g,onMatch:e=>({name:e[1].trim(),kind:"ImportDeclaration",classification:"Dependency",signature:e[0],meta:{type:"import",path:e[1].trim()}})}]},{extension:[".ts",".tsx",".js",".jsx",".mjs",".cjs"],rules:[{regex:/(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:e=>({name:e[1],kind:"FunctionDeclaration",classification:"Function"})},{regex:/(?:export\s+)?class\s+([a-zA-Z0-9_]+)/g,onMatch:e=>({name:e[1],kind:"ClassDeclaration",classification:"Class"})},{regex:/(?:export\s+)?interface\s+([a-zA-Z0-9_]+)/g,onMatch:e=>({name:e[1],kind:"InterfaceDeclaration",classification:"Interface"})},{regex:/(?:export\s+)?const\s+([a-zA-Z0-9_]+)\s*=/g,onMatch:e=>({name:e[1],kind:"VariableDeclaration",classification:"Constant"})},{regex:/import\s+.*\s+from\s+['"]([^'"]+)['"]/g,onMatch:e=>({name:e[1],kind:"ImportDeclaration",classification:"Dependency",meta:{path:e[1]}})}]}];function He(e,t){let i=[];if(e===".go"&&t.some(n=>n.kind==="TypeDeclaration")&&i.push("Go type"),e===".rs"&&(t.some(n=>n.kind==="TraitDeclaration")&&i.push("Rust trait"),t.some(n=>n.kind==="StructDeclaration")&&i.push("Rust struct"),t.some(n=>n.kind==="EnumDeclaration")&&i.push("Rust enum")),e===".py"){for(let n of t)if(n.capabilities)try{if(JSON.parse(n.capabilities).decoratorNames?.length){i.push("Python decorators");break}}catch{}t.some(n=>n.kind==="AsyncFunctionDeclaration"||n.kind==="AsyncMethodDeclaration")&&i.push("Async")}return i}var ae=class{phpParser=new se;pythonParser=new re;treeSitterParser=new ie;supports(t){return _e.some(i=>i.extension.includes(t.toLowerCase()))}async parse(t,i){let n=me.extname(t).toLowerCase(),s=[],p=[];if(n===".php"||n===".py"||n===".go"||n===".rs"){if(n===".py"){let g=this.pythonParser.parse(i);s=g.nodes,p=g.events}else if(n===".php"){let g=t.toLowerCase().endsWith("api.php"),l=this.phpParser.parse(i,g);s=l.nodes,p=l.events}else try{s=await this.treeSitterParser.parse(t,i)}catch{}if(s.length>0){let g=n===".php"?"Micro IR (PHP/TS) ":n===".py"?"Micro IR (Python/TS) ":n===".go"?"Micro IR (Go/TS) ":"Micro IR (Rust/TS) ",l=s.filter(r=>r.classification!=="Dependency"),f=s.filter(r=>r.classification==="Dependency"),a=He(n,s),c=X({classification:g,capabilities:a,exports:l.map(r=>({name:r.name,kind:r.kind,classification:r.classification})),fileName:me.basename(t)});return{exports:l,imports:f.map(r=>({module:r.name,name:r.name,kind:r.kind,classification:r.classification})),events:p,classification:g,summary:c||`${n.substring(1).toUpperCase()} module`,parseStatus:"success"}}}let d=_e.find(g=>g.extension.includes(n));if(!d)return{exports:[],imports:[],classification:"Unknown",summary:"",parseStatus:"failed",parseError:`Unsupported file extension: ${n}`};for(let g of d.rules){g.regex.lastIndex=0;let l;for(;(l=g.regex.exec(i))!==null;){let f=g.onMatch(l),a=i.substring(0,l.index).split(`
36
+ `).length;s.push({name:f.name||"anonymous",kind:f.kind||"Unknown",classification:f.classification||"Other",signature:f.signature||l[0],line:a,endLine:a,doc:"",capabilities:JSON.stringify(f.meta||{})})}}let h=X({classification:`Micro IR (${n.substring(1).toUpperCase()})`,capabilities:[],exports:s.map(g=>({name:g.name,kind:g.kind,classification:g.classification})),fileName:me.basename(t)});return{exports:s,imports:[],classification:`Micro IR (${n.substring(1).toUpperCase()})`,summary:h||"Module",parseStatus:s.length>0?"success":"partial"}}};var de=new ae;async function Nt(e){let t=Ae.extname(e);if(de.supports(t)&&t!==".ts"&&t!==".tsx")try{let p=await Pe.promises.readFile(e,"utf-8");return{...await de.parse(e,p),content:p}}catch(p){return H.error({filePath:e,error:p.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:p.message}}let i;try{i=await Pe.promises.readFile(e)}catch(p){return{exports:[],imports:[],classification:"Error",summary:"",content:"",parseStatus:"failed",parseError:`File read error: ${p.message}`}}let n=i.toString("utf8"),s=he(n);try{let p=e.endsWith(".tsx"),d=e.endsWith(".d.ts")||e.endsWith(".d.tsx"),h,g={syntax:"typescript",tsx:p,decorators:!0,comments:!0};if(d)try{h=fe.parseSync(n,g)}catch{h=fe.parseSync(n,{...g,isModule:!1})}else h=fe.parseSync(n,g);let l=h.span.start,f=ye(i),a=be(n),c=M=>ge(M,l,i),r=De(h.body),o=Te(h.body);o.length>0&&H.debug({filePath:e,count:o.length},"Extracted type references"),o.forEach(M=>{r.push({module:"__type_reference__",name:M})});let u=ve(h.body,l,i,n,s,a,e,c,f),y=Se(h.body,l,i,s,c,f),m=ne(e,"","Module"),b=a.length>0&&a[0].start===0?a[0].text:u.find(M=>M.doc)?.doc||"",C=xe(b);if(!C&&u.length>0){let M=K(n);C=X({classification:m,capabilities:M,exports:u.map(_=>({name:_.name,kind:_.kind,classification:_.classification})),fileName:Ae.basename(e)})}return{exports:u,imports:r,events:y,classification:m,summary:C,content:n,parseStatus:"success"}}catch(p){H.warn({filePath:e,error:p.message},"SWC parsing failed, using heuristic fallback");try{let d=await de.parse(e,n);return{...d,content:n,classification:d.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${p.message}`}}catch(d){return H.error({filePath:e,error:d.message},"All parsing strategies failed"),{exports:[],imports:[],classification:"Error",summary:"",content:n,parseStatus:"failed",parseError:`All parsing strategies failed: ${d.message}`}}}}export{Nt as parseFile};
@@ -0,0 +1 @@
1
+ import{parentPort as i}from"node:worker_threads";import{fileURLToPath as d}from"node:url";import{dirname as f,join as n}from"node:path";import{existsSync as c}from"node:fs";var l=d(import.meta.url),a=f(l),t=null;async function p(){if(t)return t;let e,r=n(a,"index.ts"),s=n(a,"index.js");if(c(r)&&l.endsWith(".ts"))e=r;else if(c(s))e=s;else throw new Error(`Cannot find parser module in ${a}`);return t=(await import(e)).parseFile,t}async function g(e){if(e.type==="shutdown"&&process.exit(0),e.type==="parse")try{let s=await(await p())(e.filePath),o={type:"result",id:e.id,result:s};i?.postMessage(o)}catch(r){let s={type:"error",id:e.id,error:r instanceof Error?r.message:String(r)};i?.postMessage(s)}}async function y(){await p();let e={type:"ready"};i?.postMessage(e),i?.on("message",r=>{g(r).catch(s=>{console.error("Parser worker error:",s)})})}y().catch(e=>{console.error("Failed to initialize parser worker:",e),process.exit(1)});
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.2",
2
+ "version": "1.0.3",
3
3
  "toolsByPrefix": {
4
4
  "RECON": {
5
5
  "subcommands": [
@@ -34,6 +34,7 @@
34
34
  "briefing",
35
35
  "chronicle",
36
36
  "context",
37
+ "crystallize",
37
38
  "graph",
38
39
  "health",
39
40
  "log",
@@ -77,58 +78,63 @@
77
78
  "resources": [],
78
79
  "skills": [
79
80
  {
80
- "slug": "audit",
81
- "name": "AUDIT",
81
+ "slug": "shadow_audit",
82
+ "name": "SHADOW_AUDIT",
82
83
  "description": "name: audit"
83
84
  },
84
85
  {
85
- "slug": "chronicle",
86
- "name": "CHRONICLE",
86
+ "slug": "shadow_chronicle",
87
+ "name": "SHADOW_CHRONICLE",
87
88
  "description": "name: chronicle"
88
89
  },
89
90
  {
90
- "slug": "continue",
91
- "name": "CONTINUE",
91
+ "slug": "shadow_continue",
92
+ "name": "SHADOW_CONTINUE",
92
93
  "description": "name: continue"
93
94
  },
94
95
  {
95
- "slug": "mission",
96
- "name": "MISSION",
96
+ "slug": "shadow_crystallize",
97
+ "name": "SHADOW_CRYSTALLIZE",
98
+ "description": "name: crystallize"
99
+ },
100
+ {
101
+ "slug": "shadow_mission",
102
+ "name": "SHADOW_MISSION",
97
103
  "description": "name: mission"
98
104
  },
99
105
  {
100
- "slug": "onboard",
101
- "name": "ONBOARD",
106
+ "slug": "shadow_onboard",
107
+ "name": "SHADOW_ONBOARD",
102
108
  "description": "name: onboard"
103
109
  },
104
110
  {
105
- "slug": "research",
106
- "name": "RESEARCH",
111
+ "slug": "shadow_research",
112
+ "name": "SHADOW_RESEARCH",
107
113
  "description": "name: research"
108
114
  },
109
115
  {
110
- "slug": "sync",
111
- "name": "SYNC",
116
+ "slug": "shadow_sync",
117
+ "name": "SHADOW_SYNC",
112
118
  "description": "name: sync"
113
119
  },
114
120
  {
115
- "slug": "synthesize",
116
- "name": "SYNTHESIZE",
121
+ "slug": "shadow_synthesize",
122
+ "name": "SHADOW_SYNTHESIZE",
117
123
  "description": "name: synthesize"
118
124
  },
119
125
  {
120
- "slug": "trace-impact",
121
- "name": "TRACE IMPACT",
126
+ "slug": "shadow_trace_impact",
127
+ "name": "SHADOW_TRACE_IMPACT",
122
128
  "description": "name: trace-impact"
123
129
  },
124
130
  {
125
- "slug": "understand",
126
- "name": "UNDERSTAND",
131
+ "slug": "shadow_understand",
132
+ "name": "SHADOW_UNDERSTAND",
127
133
  "description": "name: understand"
128
134
  },
129
135
  {
130
- "slug": "workspace",
131
- "name": "WORKSPACE",
136
+ "slug": "shadow_workspace",
137
+ "name": "SHADOW_WORKSPACE",
132
138
  "description": "name: workspace"
133
139
  }
134
140
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@precisionutilityguild/liquid-shadow",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Tactical Repository Intelligence Operative - Liquid Shadow Ecosystem",
5
5
  "homepage": "https://liquidshadow.pugcorp.online/",
6
6
  "repository": {