docuvia 1.8.15 → 1.9.0
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/ast-worker.js +1 -1
- package/dist/{chunk-CNYHBOCB.js → chunk-GKVVCJYO.js} +2 -2
- package/dist/{chunk-WL3HOIHC.js → chunk-S66GYDVI.js} +4 -4
- package/dist/{chunk-WL3HOIHC.js.map → chunk-S66GYDVI.js.map} +1 -1
- package/dist/{chunk-YBPQ2IUS.js → chunk-YDHQRUDO.js} +2 -2
- package/dist/{chunk-KDURFY2Q.js → chunk-YDTYZF6M.js} +2 -2
- package/dist/{chunk-KDURFY2Q.js.map → chunk-YDTYZF6M.js.map} +1 -1
- package/dist/cli.js +89 -86
- package/dist/cli.js.map +1 -1
- package/dist/fs-utils-GTWXKFBQ.js +3 -0
- package/dist/{init-templates-R6BFAJUH.js → init-templates-XTJ5KZQE.js} +2 -2
- package/package.json +1 -1
- package/dist/fs-utils-FRYB7LND.js +0 -3
- /package/dist/{chunk-CNYHBOCB.js.map → chunk-GKVVCJYO.js.map} +0 -0
- /package/dist/{chunk-YBPQ2IUS.js.map → chunk-YDHQRUDO.js.map} +0 -0
- /package/dist/{fs-utils-FRYB7LND.js.map → fs-utils-GTWXKFBQ.js.map} +0 -0
- /package/dist/{init-templates-R6BFAJUH.js.map → init-templates-XTJ5KZQE.js.map} +0 -0
package/dist/ast-worker.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c,d as a,e as y,f as _,h as T}from"./chunk-
|
|
2
|
+
import{c,d as a,e as y,f as _,h as T}from"./chunk-GKVVCJYO.js";import{d as L,ha as P,ka as E}from"./chunk-S66GYDVI.js";import"./chunk-KVOCOCYJ.js";import{parentPort as N}from"worker_threads";import{Parser as w,Language as U}from"web-tree-sitter";import*as O from"path";import*as D from"fs";import{createHash as H}from"crypto";function h(e){return H(P).update(e.text).digest("hex")}var x=new L(e=>N?.postMessage(e));process.on("uncaughtException",e=>{x.error(a.WORKER_UNCAUGHT_EXCEPTION,{error:e instanceof Error?e.message:String(e)})});process.on("unhandledRejection",e=>{x.error(a.WORKER_UNHANDLED_REJECTION,{error:e instanceof Error?e.message:String(e)})});var S=!1,b=null;function G(){return b??=_(),b}var C=new Map;function K(e){let t=C.get(e);return t||(t=U.load(e),C.set(e,t)),t}function Y(e){let t=[],n=e.matchAll(/import\s+{([^}]+)}\s+from\s+['"]([^'"]+)['"]/g);for(let r of n)t.push({localName:r[1].trim(),originalName:r[1].trim(),modulePath:r[2]});return t}function F(e){return e.childForFieldName("name")?.text||e.descendantsOfType("identifier")[0]?.text||a.ANONYMOUS_NAME}function Q(e){let t=e.childForFieldName("declarator")?.childForFieldName("declarator");if(t)return t.type===c.QUALIFIED_IDENTIFIER?t.childForFieldName("name")?.text??a.ANONYMOUS_NAME:t.text}function V(e){let t=e.childForFieldName("name");if(t)return t.text;let n=Q(e);if(n)return n;let r=new Set([c.VARIABLE_DECLARATOR,c.ASSIGNMENT_EXPRESSION,c.PAIR,c.PUBLIC_FIELD_DEFINITION]),o=e.parent;for(;o&&o.type!==c.ARGUMENTS;){if(r.has(o.type)){let s=o.childForFieldName("name")||o.childForFieldName("key")||o.childForFieldName("left");if(s)return s.text}o=o.parent}return a.ANONYMOUS_NAME}function W(e){return e.childForFieldName("function")||e.childForFieldName("expression")||e.childForFieldName("type")||e.childForFieldName("name")||e.childForFieldName("method")||e}function J(e){let t=W(e),n=t.namedChildren,r=n[n.length-1],o=n.length>=2?n[n.length-2]:void 0;if(!r||!o)return{targetFunction:f(t.text),calleeName:t.text,calleeKind:"bare"};if(!j.has(r.type))return{targetFunction:f(t.text),calleeKind:"computed"};let s=r.text,i=o.text;return i.includes("(")?{targetFunction:f(t.text),calleeName:s,receiverText:i,calleeKind:"arg-chain"}:{targetFunction:f(t.text),calleeName:s,receiverText:i,calleeKind:i==="this"||i==="super"?"this":"member"}}function f(e){return e.replace(/\s+/g,"")}var j=new Set(["identifier","property_identifier","field_identifier","shorthand_property_identifier","attribute"]);function B(e){return((e.childForFieldName("property")||e.childForFieldName("field")||e.childForFieldName("attribute")||e.childForFieldName("name")||e.childForFieldName("method"))??e).startPosition}function g(e,t){let n=e.parent;for(;n;){if(t.has(n.id))return F(n);n=n.parent}return a.ANONYMOUS_NAME}function v(e){return e.type===c.TYPE_IDENTIFIER?e.text:e.descendantsOfType(c.TYPE_IDENTIFIER)[0]?.text}function X(e){let t=e.parent;for(;t;){if(t.type===c.IMPL_ITEM){let n=t.childForFieldName("type");return n?v(n):void 0}t=t.parent}}function z(e){let n=e.childForFieldName("receiver")?.namedChild(0)?.childForFieldName("type");return n?v(n):void 0}function Z(e){let n=e.childForFieldName("declarator")?.childForFieldName("declarator");if(n?.type!==c.QUALIFIED_IDENTIFIER)return;let r=n.childForFieldName("scope");if(r)return r.type===c.QUALIFIED_IDENTIFIER?r.childForFieldName("name")?.text:r.text}function $(e){return X(e)??z(e)??Z(e)}function q(e,t,n){let r=t.extractClasses(e.rootNode);for(let o of r)n.push({name:F(o),startLine:o.startPosition.row,endLine:o.endPosition.row,methods:[],contentHash:h(o)});return r}var ee=new Set(["arrow_function","function_expression"]);function te(e,t,n){let r=t.extractVariables?.(e.rootNode)??[];for(let o of r){let s=o.childForFieldName("value");s&&ee.has(s.type)||n.push({name:F(o),startLine:o.startPosition.row,endLine:o.endPosition.row,contentHash:h(o)})}return r}function ne(e,t,n,r){let o=new Set(r.map(i=>i.id)),s=t.extractFunctions(e.rootNode);for(let i of s){let d=g(i,o),l=d===a.ANONYMOUS_NAME?$(i):d;n.push({name:V(i),startLine:i.startPosition.row,endLine:i.endPosition.row,contentHash:h(i),containerName:l})}return s}function re(e,t,n,r){let o=new Set(n.map(i=>i.id)),s=t.extractCalls(e.rootNode);for(let i of s){if(r.length>=1e3)break;let d=B(i),l=J(i);r.push({sourceFunction:g(i,o),targetFunction:l.targetFunction,startLine:d.row,startColumn:d.column,calleeName:l.calleeName,receiverText:l.receiverText,calleeKind:l.calleeKind})}}function oe(e,t,n,r){if(!t.extractImplements)return;let o=new Set(n.map(s=>s.id));for(let s of t.extractImplements(e.rootNode))r.push({sourceClass:g(s,o),targetInterface:s.text})}function se(e,t,n,r){if(!t.extractExtends)return;let o=new Set(n.map(s=>s.id));for(let s of t.extractExtends(e.rootNode))r.push({sourceClass:g(s,o),targetClass:s.text})}var ie=new Set([E.TYPESCRIPT,E.JAVASCRIPT]),ae="Worker",ce="path",le="resolve",de="join",ue="__dirname";function me(e){if(e.type!=="call_expression")return!1;let t=e.childForFieldName("function");if(!t||t.type!=="member_expression")return!1;let n=t.childForFieldName("object")?.text,r=t.childForFieldName("property")?.text;return n===ce&&(r===le||r===de)}function ge(e){let t=e.childForFieldName("arguments");return!t||!t.namedChildren.some(o=>o?.type==="identifier"&&o.text===ue)?void 0:t.descendantsOfType("string")[0]?.text.replace(/['"]/g,"")}function pe(e,t){for(let n of e.rootNode.descendantsOfType(c.ASSIGNMENT_EXPRESSION)){if(!n)continue;let r=n.childForFieldName("left"),o=n.childForFieldName("right");if(r?.text!==t||!o||!me(o))continue;let s=ge(o);if(s)return s}}function fe(e,t){if(t.type==="string")return t.text.replace(/['"]/g,"");if(t.type==="identifier"||t.type==="member_expression")return pe(e,t.text)}function Ne(e,t,n,r){if(!ie.has(t))return;let o=new Set(n.map(s=>s.id));for(let s of e.rootNode.descendantsOfType("new_expression")){if(!s||s.childForFieldName("constructor")?.text!==ae)continue;let l=s.childForFieldName("arguments")?.namedChildren.find(p=>p!==null);if(!l)continue;let m=fe(e,l);m&&r.push({sourceFunction:g(s,o),targetPath:m})}}function Ee(e,t,n){let r=[],o=[],s=[],i=[],d=[],l=[],m=[],p=[],A=[],I=[];if(e){r.push(a.parsedViaTreeSitter(e.rootNode.childCount));try{let u=q(e,t,d),R=ne(e,t,i,u),M=t.extractImports(e.rootNode);o.push(...y(M)),te(e,t,l),re(e,t,R,m),oe(e,t,u,p),se(e,t,u,A),Ne(e,n,R,I),r.push(a.QUERIED_VIA_LANGUAGE_PROVIDER)}catch(u){r.push(a.providerQueryFailed(u instanceof Error?u.message:String(u)))}}return{imports:o,exports:s,functions:i,classes:d,variables:l,calls:m,implements:p,extends:A,workerSpawns:I,decisions:r}}function he(e,t){for(let n of e.drainQueryCompileFailures?.()??[])x.error(a.QUERY_COMPILE_FAILED,{language:t,kind:n.kind,pattern:n.pattern,message:n.message})}function xe(e,t,n,r){let o=new w;o.setLanguage(n),t.initQueries?.(n),he(t,r);let s=o.parse(e),i=Ee(s,t,r);return s&&s.delete(),o.delete(),i}async function Fe(e){S||(await w.init(),S=!0);let t=await G(),n=O.extname(e.filePath),r=t.getProviderForExtension(n);if(!r)return{taskId:e.taskId,success:!0,data:{imports:[],exports:[],functions:[],classes:[],calls:[],decisions:[a.noLanguageProviderForExtension(n)]}};let{wasmPath:o,attemptedPaths:s}=T(r.wasm_file);if(!D.existsSync(o))return{taskId:e.taskId,success:!0,data:{imports:Y(e.code),exports:[],functions:[],classes:[],calls:[],decisions:[a.wasmNotFound(e.language,s.join(", "))]}};let i=await K(o),d=xe(e.code,r,i,e.language);return{taskId:e.taskId,success:!0,data:d}}N?.on("message",async e=>{try{let t=await Fe(e);N?.postMessage(t)}catch(t){N?.postMessage({taskId:e.taskId,success:!1,error:t.stack||String(t)})}});export{Fe as buildParseResponse,ne as collectFunctionNodes,Ne as collectWorkerSpawns,J as getCalleeEvidence,he as reportQueryCompileFailures,V as resolveCallableName,T as resolveWasmPath};
|
|
3
3
|
//# sourceMappingURL=ast-worker.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{ea as F,ia as u,ja as v,ka as k,la as Y,ma as G,na as H,oa as B,pa as Q,qa as V,ra as j,sa as W,ta as q}from"./chunk-WL3HOIHC.js";var J="anonymous";var Dt="AstWorkerCrashError",Pt={ARGUMENTS:"arguments",VARIABLE_DECLARATOR:"variable_declarator",ASSIGNMENT_EXPRESSION:"assignment_expression",PAIR:"pair",PUBLIC_FIELD_DEFINITION:"public_field_definition",IMPL_ITEM:"impl_item",TYPE_IDENTIFIER:"type_identifier",POINTER_TYPE:"pointer_type",QUALIFIED_IDENTIFIER:"qualified_identifier"},Ft={PARSE_FAILURE_NO_DETAIL:"parse returned success=false with no error detail",PARSE_FAILURE_RESULT:"AST parse returned failure result",PARSE_THREW:"AST parse threw (worker crash or rejection)",WORKER_UNCAUGHT_EXCEPTION:"AST worker uncaughtException",QUERY_COMPILE_FAILED:"AST language query failed to compile; using fallback",WORKER_UNHANDLED_REJECTION:"AST worker unhandledRejection",WORKER_EXITED_DURING_SHUTDOWN:"AST worker exited during pool shutdown (expected)",WORKER_CRASHED_EXITED:"AST worker crashed/exited",WORKER_EXITED_UNEXPECTEDLY:"Worker exited unexpectedly",POOL_TERMINATED:"AST worker pool terminated before task completion",UNKNOWN_FILE:"(unknown file)",PARSE_CACHE_HIT:"AST parse cache hit",CACHE_METRICS_AND_QUEUE_PERFORMANCE:"AST cache metrics and queue performance",TASK_TIMED_OUT_TERMINATING:"AST worker task timed out \u2014 terminating stuck worker",WORKER_TERMINATE_FAILED:"AST worker terminate() rejected \u2014 forced termination did not complete",QUERIED_VIA_LANGUAGE_PROVIDER:"Queried nodes using @workspace/ast-core LanguageProvider",ANONYMOUS_NAME:J,workerCrashWhileParsing:n=>`AST worker crashed while parsing ${n}: `,taskTimedOutAfterMs:(n,e)=>`AST worker task ${n} timed out after ${e}ms`,workerExitedWithCode:n=>`Worker exited with code ${n}`,noLanguageProviderForExtension:n=>`No language provider registered for extension ${n}`,wasmNotFound:(n,e)=>`WASM not found for ${n}, AST parsing skipped (Regex fallback used). Tried paths: ${e}`,parsedViaTreeSitter:n=>`Parsed via web-tree-sitter (nodes: ${n})`,providerQueryFailed:n=>`ast-core provider query failed: ${n}`};var p={FILE:"file",CLASS:"class",FUNCTION:"function",CALL:"call",METHOD_CALL:"method_call",IMPORT:"import",API_CONTRACT:"api_contract"};var N={IDENTIFIER:"identifier",SCOPED_IDENTIFIER:"scoped_identifier",QUALIFIED_IDENTIFIER:"qualified_identifier",DOTTED_NAME:"dotted_name",ALIASED_IMPORT:"aliased_import",USE_AS_CLAUSE:"use_as_clause",USE_WILDCARD:"use_wildcard",SCOPED_USE_LIST:"scoped_use_list",USE_LIST:"use_list",DOT:"dot",BLANK_IDENTIFIER:"blank_identifier",NAMESPACE_USE_DECLARATION:"namespace_use_declaration",INCLUDE_EXPRESSION:"include_expression",INCLUDE_ONCE_EXPRESSION:"include_once_expression",REQUIRE_EXPRESSION:"require_expression",REQUIRE_ONCE_EXPRESSION:"require_once_expression",IMPORT_STATEMENT:"import_statement",IMPORT_FROM_STATEMENT:"import_from_statement",USE_DECLARATION:"use_declaration",IMPORT_DECLARATION:"import_declaration",PREPROC_INCLUDE:"preproc_include",USING_DECLARATION:"using_declaration",CALL:"call",USING_DIRECTIVE:"using_directive",CALL_EXPRESSION:"call_expression",METHOD_INVOCATION:"method_invocation",EXPLICIT_CONSTRUCTOR_INVOCATION:"explicit_constructor_invocation",COMMAND_CALL:"command_call",FUNCTION_CALL_EXPRESSION:"function_call_expression",MEMBER_CALL_EXPRESSION:"member_call_expression",SCOPED_CALL_EXPRESSION:"scoped_call_expression",INVOCATION_EXPRESSION:"invocation_expression",OBJECT_CREATION_EXPRESSION:"object_creation_expression",MEMBER_EXPRESSION:"member_expression",ATTRIBUTE:"attribute",MEMBER_ACCESS_EXPRESSION:"member_access_expression",VARIABLE_DECLARATION:"variable_declaration",LEXICAL_DECLARATION:"lexical_declaration",VARIABLE_DECLARATOR:"variable_declarator",ARROW_FUNCTION:"arrow_function",FUNCTION_DECLARATION:"function_declaration",METHOD_DEFINITION:"method_definition",CLASS_DECLARATION:"class_declaration",INTERFACE_DECLARATION:"interface_declaration",TYPE_ALIAS_DECLARATION:"type_alias_declaration",EXPORT_STATEMENT:"export_statement"};var d="*",me=["require","require_relative","load"],K="this",_e="new";function yt(n){let e=[];for(let o of n){let r=o.type,i=Ae[r];if(i){i(o,e);continue}if(we(r)){ve(o,r,e);continue}Ye(o,e)}return e}var Ae={[N.IMPORT_STATEMENT]:pe,[N.EXPORT_STATEMENT]:Ce,[N.IMPORT_FROM_STATEMENT]:Oe,[N.USE_DECLARATION]:ge,[N.IMPORT_DECLARATION]:xe,[N.PREPROC_INCLUDE]:Me,[N.USING_DECLARATION]:Ue,[N.CALL]:ye,[N.USING_DIRECTIVE]:ke};function pe(n,e){let o=n.descendantsOfType("string").pop();if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.descendantsOfType("namespace_import")[0];if(i){let l=i.descendantsOfType("identifier")[0];l&&e.push({localName:l.text,originalName:d,modulePath:r});return}let s=n.descendantsOfType("named_imports")[0];if(s){let l=s.descendantsOfType("import_specifier");for(let I of l){if(!I)continue;let E=I.childForFieldName("name"),f=I.childForFieldName("alias");if(E){let S=E.text,C=f?f.text:S;e.push({localName:C,originalName:S,modulePath:r})}}return}let c=n.descendantsOfType("identifier")[0];c&&e.push({localName:c.text,originalName:d,modulePath:r})}function Ce(n,e){let o=n.childForFieldName("source");if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.descendantsOfType("export_clause")[0];if(i)for(let s of i.descendantsOfType("export_specifier")){if(!s)continue;let c=s.childForFieldName("name");if(!c)continue;let l=s.childForFieldName("alias");e.push({localName:l?l.text:c.text,originalName:c.text,modulePath:r,viaReexport:!0})}}function Oe(n,e){let o=n.childForFieldName("module_name");if(!o)return;let r=o.text;if(n.descendantsOfType("wildcard_import")[0])return;n.childForFieldName("name")&&Ge(n,r,e)}function Se(n,e){let o=n.childForFieldName("path"),r=n.childForFieldName("alias");o&&r&&e.push({localName:r.text,originalName:d,modulePath:o.text})}function Re(n,e,o){let r=n.childForFieldName("path"),i=n.childForFieldName("alias");r&&i&&o.push({localName:i.text,originalName:d,modulePath:`${e}::${r.text}`})}function Le(n,e,o){let r=n.descendantsOfType("identifier").pop();r&&o.push({localName:r.text,originalName:d,modulePath:`${e}::${n.text}`})}function he(n,e,o){if(n.type===N.USE_AS_CLAUSE){Re(n,e,o);return}if(n.type===N.IDENTIFIER){o.push({localName:n.text,originalName:d,modulePath:`${e}::${n.text}`});return}n.type===N.SCOPED_IDENTIFIER&&Le(n,e,o)}function De(n,e){let o=n.childForFieldName("path"),r=n.childForFieldName("list");if(!o||!r)return;let i=o.text;for(let s of r.namedChildren)s&&he(s,i,e)}function Pe(n,e){let o=n.descendantsOfType("identifier"),r=o[o.length-1];r&&e.push({localName:r.text,originalName:d,modulePath:n.text})}function Fe(n,e){for(let o of n.namedChildren)o&&o.type===N.IDENTIFIER&&e.push({localName:o.text,originalName:d,modulePath:o.text})}function ge(n,e){let o=n.childForFieldName("argument");if(o){if(o.type===N.USE_AS_CLAUSE){Se(o,e);return}if(o.type!==N.USE_WILDCARD){if(o.type===N.SCOPED_USE_LIST){De(o,e);return}if(o.type===N.SCOPED_IDENTIFIER||o.type===N.IDENTIFIER){Pe(o,e);return}o.type===N.USE_LIST&&Fe(o,e)}}}function $e(n,e){let o=n.childForFieldName("path");if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.childForFieldName("name");if(i){if(i.type===N.DOT||i.type===N.BLANK_IDENTIFIER)return;e.push({localName:i.text,originalName:d,modulePath:r})}else{let s=r.split("/"),c=s[s.length-1];e.push({localName:c,originalName:d,modulePath:r})}}function xe(n,e){let o=n.descendantsOfType("import_spec_list")[0];if(!o)return;let r=o.descendantsOfType("import_spec");for(let i of r)i&&$e(i,e)}function Me(n,e){let o=n.childForFieldName("path");if(o){let r=o.text.replace(/[<>"']/g,"");e.push({localName:r,originalName:d,modulePath:r})}}function Ue(n,e){let o=n.namedChildren;for(let r of o)if(r)if(r.type===N.QUALIFIED_IDENTIFIER){let i=r.descendantsOfType("identifier"),s=i[i.length-1];s&&e.push({localName:s.text,originalName:d,modulePath:r.text})}else r.type===N.IDENTIFIER&&e.push({localName:r.text,originalName:d,modulePath:r.text})}function ye(n,e){let o=n.childForFieldName("method");if(!o)return;let r=o.text;if(!me.includes(r))return;let i=n.childForFieldName("arguments");if(!i)return;let s=i.descendantsOfType("string_content")[0]||i.descendantsOfType("string")[0];if(!s)return;let c=s.text.replace(/['"]/g,""),l=c.replace(/\.rb$/,"");e.push({localName:l,originalName:d,modulePath:c})}function we(n){return n===N.NAMESPACE_USE_DECLARATION||n===N.INCLUDE_EXPRESSION||n===N.INCLUDE_ONCE_EXPRESSION||n===N.REQUIRE_EXPRESSION||n===N.REQUIRE_ONCE_EXPRESSION}function be(n,e){let o=n.descendantsOfType("qualified_name")[0]||n.descendantsOfType("name")[0];if(o){let r=o.text,i=r.split("\\"),s=i[i.length-1];e.push({localName:s,originalName:d,modulePath:r})}}function Xe(n,e){let o=n.descendantsOfType("string")[0]||n.descendantsOfType("string_content")[0];if(o){let r=o.text.replace(/['"]/g,"");e.push({localName:r,originalName:d,modulePath:r})}}function ve(n,e,o){e===N.NAMESPACE_USE_DECLARATION?be(n,o):Xe(n,o)}function ke(n,e){let o=n.descendantsOfType("qualified_name")[0]||n.descendantsOfType("identifier")[0];if(o){let r=o.text,i=r.split("."),s=i[i.length-1];e.push({localName:s,originalName:d,modulePath:r})}}function Ye(n,e){let o=n.descendantsOfType("string").pop();if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.descendantsOfType("identifier");for(let s of i)s&&(e.some(c=>c.localName===s.text)||e.push({localName:s.text,originalName:s.text,modulePath:r}))}function Ge(n,e,o){if(n.childForFieldName("name")){for(let i of n.namedChildren)if(i)if(i.type===N.ALIASED_IMPORT){let s=i.childForFieldName("name"),c=i.childForFieldName("alias");s&&c&&o.push({localName:c.text,originalName:s.text,modulePath:e})}else if(i.type===N.DOTTED_NAME){let s=i.descendantsOfType("identifier"),c=s[s.length-1];c&&o.push({localName:c.text,originalName:i.text,modulePath:e})}else i.type===N.IDENTIFIER&&o.push({localName:i.text,originalName:i.text,modulePath:e})}}function He(n){let e=n.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===N.MEMBER_EXPRESSION){let o=e.childForFieldName("property"),r=e.childForFieldName("object");if(o)return{isMethodCall:!0,methodName:o.text,objectName:r?.text}}return{isMethodCall:!1,methodName:e.text}}function Be(n){let e=n.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===N.ATTRIBUTE){let o=e.childForFieldName("attribute"),r=e.childForFieldName("object");if(o)return{isMethodCall:!0,methodName:o.text,objectName:r?.text}}return{isMethodCall:!1,methodName:e.text}}function Qe(n){let e=n.childForFieldName("name"),o=n.childForFieldName("object");if(e)return{isMethodCall:!0,methodName:e.text,objectName:o?.text}}function Ve(n){return{isMethodCall:!0,methodName:n.childForFieldName("constructor")?.text||K,objectName:K}}function je(n){let e=n.childForFieldName("method");if(!e)return;let o=n.childForFieldName("receiver");return o?{isMethodCall:!0,methodName:e.text,objectName:o.text}:{isMethodCall:!1,methodName:e.text}}function U(n){let e=n.type,r=n.childForFieldName("name")?.text||"";if(e===N.MEMBER_CALL_EXPRESSION){let i=n.childForFieldName("object");return{isMethodCall:!0,methodName:r,objectName:i?.text}}if(e===N.SCOPED_CALL_EXPRESSION){let i=n.childForFieldName("scope");return{isMethodCall:!0,methodName:r,objectName:i?.text}}return{isMethodCall:!1,methodName:r}}function We(n){let e=n.childForFieldName("function")||n.namedChildren[0];if(e&&e.type===N.MEMBER_ACCESS_EXPRESSION){let o=e.childForFieldName("name"),r=e.childForFieldName("expression");if(o)return{isMethodCall:!0,methodName:o.text,objectName:r?.text}}if(e)return{isMethodCall:!1,methodName:e.text}}function qe(n){let e=n.childForFieldName("type");return{isMethodCall:!0,methodName:_e,objectName:e?.text}}var wt={[N.CALL_EXPRESSION]:He,[N.CALL]:Be,[N.METHOD_INVOCATION]:Qe,[N.EXPLICIT_CONSTRUCTOR_INVOCATION]:Ve,[N.COMMAND_CALL]:je,[N.FUNCTION_CALL_EXPRESSION]:U,[N.MEMBER_CALL_EXPRESSION]:U,[N.SCOPED_CALL_EXPRESSION]:U,[N.INVOCATION_EXPRESSION]:We,[N.OBJECT_CREATION_EXPRESSION]:qe};var Je=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,L=class n extends Date{#t=!1;#n=!1;#e=null;constructor(e){let o=!0,r=!0,i="Z";if(typeof e=="string"){let s=e.match(Je);s?(s[1]||(o=!1,e=`0000-01-01T${e}`),r=!!s[2],r&&e[10]===" "&&(e=e.replace(" ","T")),s[2]&&+s[2]>23?e="":(i=s[3]||null,e=e.toUpperCase(),!i&&r&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=o,this.#n=r,this.#e=i)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#e===null)return e.slice(0,-1);if(this.#e==="Z")return e;let o=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return o=this.#e[0]==="-"?o:-o,new Date(this.getTime()-o*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,o="Z"){let r=new n(e);return r.#e=o,r}static wrapAsLocalDateTime(e){let o=new n(e);return o.#e=null,o}static wrapAsLocalDate(e){let o=new n(e);return o.#n=!1,o.#e=null,o}static wrapAsLocalTime(e){let o=new n(e);return o.#t=!1,o.#e=null,o}};function Ke(n,e){let o=n.slice(0,e).split(/\r\n|\n|\r/g);return[o.length,o.pop().length+1]}function ze(n,e,o){let r=n.split(/\r\n|\n|\r/g),i="",s=(Math.log10(e+1)|0)+1;for(let c=e-1;c<=e+1;c++){let l=r[c-1];l&&(i+=c.toString().padEnd(s," "),i+=": ",i+=l,i+=`
|
|
2
|
+
import{ga as F,ka as u,la as v,ma as k,na as Y,oa as G,pa as H,qa as B,ra as Q,sa as V,ta as j,ua as W,va as q}from"./chunk-S66GYDVI.js";var J="anonymous";var Dt="AstWorkerCrashError",Pt={ARGUMENTS:"arguments",VARIABLE_DECLARATOR:"variable_declarator",ASSIGNMENT_EXPRESSION:"assignment_expression",PAIR:"pair",PUBLIC_FIELD_DEFINITION:"public_field_definition",IMPL_ITEM:"impl_item",TYPE_IDENTIFIER:"type_identifier",POINTER_TYPE:"pointer_type",QUALIFIED_IDENTIFIER:"qualified_identifier"},Ft={PARSE_FAILURE_NO_DETAIL:"parse returned success=false with no error detail",PARSE_FAILURE_RESULT:"AST parse returned failure result",PARSE_THREW:"AST parse threw (worker crash or rejection)",WORKER_UNCAUGHT_EXCEPTION:"AST worker uncaughtException",QUERY_COMPILE_FAILED:"AST language query failed to compile; using fallback",WORKER_UNHANDLED_REJECTION:"AST worker unhandledRejection",WORKER_EXITED_DURING_SHUTDOWN:"AST worker exited during pool shutdown (expected)",WORKER_CRASHED_EXITED:"AST worker crashed/exited",WORKER_EXITED_UNEXPECTEDLY:"Worker exited unexpectedly",POOL_TERMINATED:"AST worker pool terminated before task completion",UNKNOWN_FILE:"(unknown file)",PARSE_CACHE_HIT:"AST parse cache hit",CACHE_METRICS_AND_QUEUE_PERFORMANCE:"AST cache metrics and queue performance",TASK_TIMED_OUT_TERMINATING:"AST worker task timed out \u2014 terminating stuck worker",WORKER_TERMINATE_FAILED:"AST worker terminate() rejected \u2014 forced termination did not complete",QUERIED_VIA_LANGUAGE_PROVIDER:"Queried nodes using @workspace/ast-core LanguageProvider",ANONYMOUS_NAME:J,workerCrashWhileParsing:n=>`AST worker crashed while parsing ${n}: `,taskTimedOutAfterMs:(n,e)=>`AST worker task ${n} timed out after ${e}ms`,workerExitedWithCode:n=>`Worker exited with code ${n}`,noLanguageProviderForExtension:n=>`No language provider registered for extension ${n}`,wasmNotFound:(n,e)=>`WASM not found for ${n}, AST parsing skipped (Regex fallback used). Tried paths: ${e}`,parsedViaTreeSitter:n=>`Parsed via web-tree-sitter (nodes: ${n})`,providerQueryFailed:n=>`ast-core provider query failed: ${n}`};var p={FILE:"file",CLASS:"class",FUNCTION:"function",CALL:"call",METHOD_CALL:"method_call",IMPORT:"import",API_CONTRACT:"api_contract"};var N={IDENTIFIER:"identifier",SCOPED_IDENTIFIER:"scoped_identifier",QUALIFIED_IDENTIFIER:"qualified_identifier",DOTTED_NAME:"dotted_name",ALIASED_IMPORT:"aliased_import",USE_AS_CLAUSE:"use_as_clause",USE_WILDCARD:"use_wildcard",SCOPED_USE_LIST:"scoped_use_list",USE_LIST:"use_list",DOT:"dot",BLANK_IDENTIFIER:"blank_identifier",NAMESPACE_USE_DECLARATION:"namespace_use_declaration",INCLUDE_EXPRESSION:"include_expression",INCLUDE_ONCE_EXPRESSION:"include_once_expression",REQUIRE_EXPRESSION:"require_expression",REQUIRE_ONCE_EXPRESSION:"require_once_expression",IMPORT_STATEMENT:"import_statement",IMPORT_FROM_STATEMENT:"import_from_statement",USE_DECLARATION:"use_declaration",IMPORT_DECLARATION:"import_declaration",PREPROC_INCLUDE:"preproc_include",USING_DECLARATION:"using_declaration",CALL:"call",USING_DIRECTIVE:"using_directive",CALL_EXPRESSION:"call_expression",METHOD_INVOCATION:"method_invocation",EXPLICIT_CONSTRUCTOR_INVOCATION:"explicit_constructor_invocation",COMMAND_CALL:"command_call",FUNCTION_CALL_EXPRESSION:"function_call_expression",MEMBER_CALL_EXPRESSION:"member_call_expression",SCOPED_CALL_EXPRESSION:"scoped_call_expression",INVOCATION_EXPRESSION:"invocation_expression",OBJECT_CREATION_EXPRESSION:"object_creation_expression",MEMBER_EXPRESSION:"member_expression",ATTRIBUTE:"attribute",MEMBER_ACCESS_EXPRESSION:"member_access_expression",VARIABLE_DECLARATION:"variable_declaration",LEXICAL_DECLARATION:"lexical_declaration",VARIABLE_DECLARATOR:"variable_declarator",ARROW_FUNCTION:"arrow_function",FUNCTION_DECLARATION:"function_declaration",METHOD_DEFINITION:"method_definition",CLASS_DECLARATION:"class_declaration",INTERFACE_DECLARATION:"interface_declaration",TYPE_ALIAS_DECLARATION:"type_alias_declaration",EXPORT_STATEMENT:"export_statement"};var d="*",me=["require","require_relative","load"],K="this",_e="new";function yt(n){let e=[];for(let o of n){let r=o.type,i=Ae[r];if(i){i(o,e);continue}if(we(r)){ve(o,r,e);continue}Ye(o,e)}return e}var Ae={[N.IMPORT_STATEMENT]:pe,[N.EXPORT_STATEMENT]:Ce,[N.IMPORT_FROM_STATEMENT]:Oe,[N.USE_DECLARATION]:ge,[N.IMPORT_DECLARATION]:xe,[N.PREPROC_INCLUDE]:Me,[N.USING_DECLARATION]:Ue,[N.CALL]:ye,[N.USING_DIRECTIVE]:ke};function pe(n,e){let o=n.descendantsOfType("string").pop();if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.descendantsOfType("namespace_import")[0];if(i){let l=i.descendantsOfType("identifier")[0];l&&e.push({localName:l.text,originalName:d,modulePath:r});return}let s=n.descendantsOfType("named_imports")[0];if(s){let l=s.descendantsOfType("import_specifier");for(let I of l){if(!I)continue;let E=I.childForFieldName("name"),f=I.childForFieldName("alias");if(E){let S=E.text,C=f?f.text:S;e.push({localName:C,originalName:S,modulePath:r})}}return}let c=n.descendantsOfType("identifier")[0];c&&e.push({localName:c.text,originalName:d,modulePath:r})}function Ce(n,e){let o=n.childForFieldName("source");if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.descendantsOfType("export_clause")[0];if(i)for(let s of i.descendantsOfType("export_specifier")){if(!s)continue;let c=s.childForFieldName("name");if(!c)continue;let l=s.childForFieldName("alias");e.push({localName:l?l.text:c.text,originalName:c.text,modulePath:r,viaReexport:!0})}}function Oe(n,e){let o=n.childForFieldName("module_name");if(!o)return;let r=o.text;if(n.descendantsOfType("wildcard_import")[0])return;n.childForFieldName("name")&&Ge(n,r,e)}function Se(n,e){let o=n.childForFieldName("path"),r=n.childForFieldName("alias");o&&r&&e.push({localName:r.text,originalName:d,modulePath:o.text})}function Re(n,e,o){let r=n.childForFieldName("path"),i=n.childForFieldName("alias");r&&i&&o.push({localName:i.text,originalName:d,modulePath:`${e}::${r.text}`})}function Le(n,e,o){let r=n.descendantsOfType("identifier").pop();r&&o.push({localName:r.text,originalName:d,modulePath:`${e}::${n.text}`})}function he(n,e,o){if(n.type===N.USE_AS_CLAUSE){Re(n,e,o);return}if(n.type===N.IDENTIFIER){o.push({localName:n.text,originalName:d,modulePath:`${e}::${n.text}`});return}n.type===N.SCOPED_IDENTIFIER&&Le(n,e,o)}function De(n,e){let o=n.childForFieldName("path"),r=n.childForFieldName("list");if(!o||!r)return;let i=o.text;for(let s of r.namedChildren)s&&he(s,i,e)}function Pe(n,e){let o=n.descendantsOfType("identifier"),r=o[o.length-1];r&&e.push({localName:r.text,originalName:d,modulePath:n.text})}function Fe(n,e){for(let o of n.namedChildren)o&&o.type===N.IDENTIFIER&&e.push({localName:o.text,originalName:d,modulePath:o.text})}function ge(n,e){let o=n.childForFieldName("argument");if(o){if(o.type===N.USE_AS_CLAUSE){Se(o,e);return}if(o.type!==N.USE_WILDCARD){if(o.type===N.SCOPED_USE_LIST){De(o,e);return}if(o.type===N.SCOPED_IDENTIFIER||o.type===N.IDENTIFIER){Pe(o,e);return}o.type===N.USE_LIST&&Fe(o,e)}}}function $e(n,e){let o=n.childForFieldName("path");if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.childForFieldName("name");if(i){if(i.type===N.DOT||i.type===N.BLANK_IDENTIFIER)return;e.push({localName:i.text,originalName:d,modulePath:r})}else{let s=r.split("/"),c=s[s.length-1];e.push({localName:c,originalName:d,modulePath:r})}}function xe(n,e){let o=n.descendantsOfType("import_spec_list")[0];if(!o)return;let r=o.descendantsOfType("import_spec");for(let i of r)i&&$e(i,e)}function Me(n,e){let o=n.childForFieldName("path");if(o){let r=o.text.replace(/[<>"']/g,"");e.push({localName:r,originalName:d,modulePath:r})}}function Ue(n,e){let o=n.namedChildren;for(let r of o)if(r)if(r.type===N.QUALIFIED_IDENTIFIER){let i=r.descendantsOfType("identifier"),s=i[i.length-1];s&&e.push({localName:s.text,originalName:d,modulePath:r.text})}else r.type===N.IDENTIFIER&&e.push({localName:r.text,originalName:d,modulePath:r.text})}function ye(n,e){let o=n.childForFieldName("method");if(!o)return;let r=o.text;if(!me.includes(r))return;let i=n.childForFieldName("arguments");if(!i)return;let s=i.descendantsOfType("string_content")[0]||i.descendantsOfType("string")[0];if(!s)return;let c=s.text.replace(/['"]/g,""),l=c.replace(/\.rb$/,"");e.push({localName:l,originalName:d,modulePath:c})}function we(n){return n===N.NAMESPACE_USE_DECLARATION||n===N.INCLUDE_EXPRESSION||n===N.INCLUDE_ONCE_EXPRESSION||n===N.REQUIRE_EXPRESSION||n===N.REQUIRE_ONCE_EXPRESSION}function be(n,e){let o=n.descendantsOfType("qualified_name")[0]||n.descendantsOfType("name")[0];if(o){let r=o.text,i=r.split("\\"),s=i[i.length-1];e.push({localName:s,originalName:d,modulePath:r})}}function Xe(n,e){let o=n.descendantsOfType("string")[0]||n.descendantsOfType("string_content")[0];if(o){let r=o.text.replace(/['"]/g,"");e.push({localName:r,originalName:d,modulePath:r})}}function ve(n,e,o){e===N.NAMESPACE_USE_DECLARATION?be(n,o):Xe(n,o)}function ke(n,e){let o=n.descendantsOfType("qualified_name")[0]||n.descendantsOfType("identifier")[0];if(o){let r=o.text,i=r.split("."),s=i[i.length-1];e.push({localName:s,originalName:d,modulePath:r})}}function Ye(n,e){let o=n.descendantsOfType("string").pop();if(!o)return;let r=o.text.replace(/['"]/g,""),i=n.descendantsOfType("identifier");for(let s of i)s&&(e.some(c=>c.localName===s.text)||e.push({localName:s.text,originalName:s.text,modulePath:r}))}function Ge(n,e,o){if(n.childForFieldName("name")){for(let i of n.namedChildren)if(i)if(i.type===N.ALIASED_IMPORT){let s=i.childForFieldName("name"),c=i.childForFieldName("alias");s&&c&&o.push({localName:c.text,originalName:s.text,modulePath:e})}else if(i.type===N.DOTTED_NAME){let s=i.descendantsOfType("identifier"),c=s[s.length-1];c&&o.push({localName:c.text,originalName:i.text,modulePath:e})}else i.type===N.IDENTIFIER&&o.push({localName:i.text,originalName:i.text,modulePath:e})}}function He(n){let e=n.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===N.MEMBER_EXPRESSION){let o=e.childForFieldName("property"),r=e.childForFieldName("object");if(o)return{isMethodCall:!0,methodName:o.text,objectName:r?.text}}return{isMethodCall:!1,methodName:e.text}}function Be(n){let e=n.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===N.ATTRIBUTE){let o=e.childForFieldName("attribute"),r=e.childForFieldName("object");if(o)return{isMethodCall:!0,methodName:o.text,objectName:r?.text}}return{isMethodCall:!1,methodName:e.text}}function Qe(n){let e=n.childForFieldName("name"),o=n.childForFieldName("object");if(e)return{isMethodCall:!0,methodName:e.text,objectName:o?.text}}function Ve(n){return{isMethodCall:!0,methodName:n.childForFieldName("constructor")?.text||K,objectName:K}}function je(n){let e=n.childForFieldName("method");if(!e)return;let o=n.childForFieldName("receiver");return o?{isMethodCall:!0,methodName:e.text,objectName:o.text}:{isMethodCall:!1,methodName:e.text}}function U(n){let e=n.type,r=n.childForFieldName("name")?.text||"";if(e===N.MEMBER_CALL_EXPRESSION){let i=n.childForFieldName("object");return{isMethodCall:!0,methodName:r,objectName:i?.text}}if(e===N.SCOPED_CALL_EXPRESSION){let i=n.childForFieldName("scope");return{isMethodCall:!0,methodName:r,objectName:i?.text}}return{isMethodCall:!1,methodName:r}}function We(n){let e=n.childForFieldName("function")||n.namedChildren[0];if(e&&e.type===N.MEMBER_ACCESS_EXPRESSION){let o=e.childForFieldName("name"),r=e.childForFieldName("expression");if(o)return{isMethodCall:!0,methodName:o.text,objectName:r?.text}}if(e)return{isMethodCall:!1,methodName:e.text}}function qe(n){let e=n.childForFieldName("type");return{isMethodCall:!0,methodName:_e,objectName:e?.text}}var wt={[N.CALL_EXPRESSION]:He,[N.CALL]:Be,[N.METHOD_INVOCATION]:Qe,[N.EXPLICIT_CONSTRUCTOR_INVOCATION]:Ve,[N.COMMAND_CALL]:je,[N.FUNCTION_CALL_EXPRESSION]:U,[N.MEMBER_CALL_EXPRESSION]:U,[N.SCOPED_CALL_EXPRESSION]:U,[N.INVOCATION_EXPRESSION]:We,[N.OBJECT_CREATION_EXPRESSION]:qe};var Je=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,L=class n extends Date{#t=!1;#n=!1;#e=null;constructor(e){let o=!0,r=!0,i="Z";if(typeof e=="string"){let s=e.match(Je);s?(s[1]||(o=!1,e=`0000-01-01T${e}`),r=!!s[2],r&&e[10]===" "&&(e=e.replace(" ","T")),s[2]&&+s[2]>23?e="":(i=s[3]||null,e=e.toUpperCase(),!i&&r&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=o,this.#n=r,this.#e=i)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#e===null)return e.slice(0,-1);if(this.#e==="Z")return e;let o=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return o=this.#e[0]==="-"?o:-o,new Date(this.getTime()-o*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,o="Z"){let r=new n(e);return r.#e=o,r}static wrapAsLocalDateTime(e){let o=new n(e);return o.#e=null,o}static wrapAsLocalDate(e){let o=new n(e);return o.#n=!1,o.#e=null,o}static wrapAsLocalTime(e){let o=new n(e);return o.#t=!1,o.#e=null,o}};function Ke(n,e){let o=n.slice(0,e).split(/\r\n|\n|\r/g);return[o.length,o.pop().length+1]}function ze(n,e,o){let r=n.split(/\r\n|\n|\r/g),i="",s=(Math.log10(e+1)|0)+1;for(let c=e-1;c<=e+1;c++){let l=r[c-1];l&&(i+=c.toString().padEnd(s," "),i+=": ",i+=l,i+=`
|
|
3
3
|
`,c===e&&(i+=" ".repeat(s+o+2),i+=`^
|
|
4
4
|
`))}return i}var T=class extends Error{line;column;codeblock;constructor(e,o){let[r,i]=Ke(o.toml,o.ptr),s=ze(o.toml,r,i);super(`Invalid TOML document: ${e}
|
|
5
5
|
|
|
@@ -59,4 +59,4 @@ smol-toml/dist/index.js:
|
|
|
59
59
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
60
60
|
*)
|
|
61
61
|
*/
|
|
62
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-GKVVCJYO.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
var a={DEBUG:"debug",INFO:"info",WARN:"warn",ERROR:"error"};var p="ipc-log",X=new Set(Object.values(a));function O(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function
|
|
2
|
+
var a={DEBUG:"debug",INFO:"info",WARN:"warn",ERROR:"error"};var p="ipc-log",X=new Set(Object.values(a));function O(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function T(t){if(!O(t))return!1;let{type:e,level:o,message:r,context:s}=t;return e===p&&typeof o=="string"&&X.has(o)&&typeof r=="string"&&(s===void 0||O(s))}var f=class{constructor(e){this.postMessageFn=e}postMessageFn;debug(e,o){this.send(a.DEBUG,e,o)}info(e,o){this.send(a.INFO,e,o)}warn(e,o){this.send(a.WARN,e,o)}error(e,o){this.send(a.ERROR,e,o)}onLog(){return()=>{}}send(e,o,r){let s=r?{type:p,level:e,message:o,context:r}:{type:p,level:e,message:o};this.postMessageFn(s)}};var m={CONTEXT_INJECTION:"context-injection",COMMIT_L3_WRITE:"commit-l3-write",TIER_B_C_PREPUSH:"tier-b-c-prepush"},z={[m.CONTEXT_INJECTION]:!0,[m.COMMIT_L3_WRITE]:!0,[m.TIER_B_C_PREPUSH]:!0};var L=".docuvia",Q="logs",q="init.log",J="clean.log",Z="status.log",$="sync.log",ee="analyze.log",te="review.log",oe="impact.log",re="query.log",ne="export-topology.log",se="snapshot.log",ie="hydrate.log",ae="sync-knowledge.log",S="node_modules",ce="local.db",le="init.lock",pe="tierC.lock",ge="sync-state.json",de="hooks-config.json",ue="pending-l3-decisions.json";var me="utf8";var Ee="sha256";var i={TYPESCRIPT:"typescript",JAVASCRIPT:"javascript",PYTHON:"python",RUST:"rust",GO:"go",JAVA:"java",C:"c",CPP:"cpp",RUBY:"ruby",PHP:"php",CSHARP:"csharp"};var _e="EEXIST",ye="ENOENT",Te="EPERM",fe="EACCES",Le="EBUSY";var Se=".claude/hooks",Re=".cursor/hooks",Ie="docuvia-hook.js",Ae="docuvia-hook.cjs";var g=class{listeners=new Set;debug(e,o){this.emit(a.DEBUG,e,o)}info(e,o){this.emit(a.INFO,e,o)}warn(e,o){this.emit(a.WARN,e,o)}error(e,o){this.emit(a.ERROR,e,o)}onLog(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e,o,r){let s=r?{level:e,message:o,context:r}:{level:e,message:o};for(let d of this.listeners)d(s)}};function he(){return new g}var R=class{constructor(e){this.logger=e}logger;handleMessage(e){return T(e)?(this.logger[e.level](e.message,e.context),!0):!1}};var l={GIT_COMMAND_FAILED:"GIT_COMMAND_FAILED",GIT_NETWORK_TIMEOUT:"GIT_NETWORK_TIMEOUT",GIT_NOT_A_REPOSITORY:"GIT_NOT_A_REPOSITORY",GIT_BRANCH_CREATE_FAILED:"GIT_BRANCH_CREATE_FAILED",GIT_HOOK_INSTALL_FAILED:"GIT_HOOK_INSTALL_FAILED",GIT_FAST_IMPORT_FAILED:"GIT_FAST_IMPORT_FAILED",DB_OPEN_FAILED:"DB_OPEN_FAILED",DB_NOT_FOUND:"DB_NOT_FOUND",DB_MIGRATION_FAILED:"DB_MIGRATION_FAILED",DB_QUERY_FAILED:"DB_QUERY_FAILED",DB_LOCKED:"DB_LOCKED",AST_WORKER_CRASHED:"AST_WORKER_CRASHED",AST_PARSE_FAILED:"AST_PARSE_FAILED",FS_READ_FAILED:"FS_READ_FAILED",FS_PATH_TRAVERSAL:"FS_PATH_TRAVERSAL",FACTORY_TOKEN_NOT_REGISTERED:"FACTORY_TOKEN_NOT_REGISTERED",FACTORY_LOCKED:"FACTORY_LOCKED",MEMORY_SCOPE_NOT_FOUND:"MEMORY_SCOPE_NOT_FOUND",SYNC_FETCH_FAILED:"SYNC_FETCH_FAILED",SYNC_PUSH_FAILED:"SYNC_PUSH_FAILED",LLM_NOT_INITIALIZED:"LLM_NOT_INITIALIZED",LLM_CHAT_COMPLETION_FAILED:"LLM_CHAT_COMPLETION_FAILED",LLM_HTTP_FAILED:"LLM_HTTP_FAILED",LLM_RATE_LIMITED:"LLM_RATE_LIMITED",LLM_AUTH_FAILED:"LLM_AUTH_FAILED",LLM_STREAM_FAILED:"LLM_STREAM_FAILED",LLM_INVALID_RESPONSE:"LLM_INVALID_RESPONSE",INIT_WORKFLOW_FAILED:"INIT_WORKFLOW_FAILED",CLEAN_WORKFLOW_FAILED:"CLEAN_WORKFLOW_FAILED",UNINSTALL_WORKFLOW_FAILED:"UNINSTALL_WORKFLOW_FAILED",INVALID_INPUT:"INVALID_INPUT"};var Ne="DocuviaError",c=class t extends Error{code;cause;constructor(e,o,r){super(o),this.name=Ne,this.code=e,this.cause=r}static wrap(e,o,r){if(r instanceof t)return r;let s=r instanceof Error?r.message:String(r);return new t(e,`${o}: ${s}`,r)}};var Ce={WORKSPACE_ROOT:"workspaceRoot",API_URL:"apiUrl",PROJECT_ID:"projectId",COMMIT_SHA:"commitSha",TARGET_PATH:"targetPath",LLM_BASE_URL:"llmBaseUrl",LLM_MODEL:"llmModel",BASE_REF:"baseRef",TARGET:"target",ESCALATE_TO_LSP:"escalateToLsp",TIER_B_FULL_RESYNC:"tierBFullResync",LIMIT:"limit",COLLAPSE:"collapse",KEEP_DB:"keepDb",LSP_BINARY_OVERRIDE:"lspBinaryOverride",LSP_ARGS_OVERRIDE:"lspArgsOverride",LSP_TIMEOUT_MS:"lspTimeoutMs",LSP_MAX_PROCESSES:"lspMaxProcesses",TIER_B_COMMIT_CAP:"tierBCommitCap",TIER_C_DAILY_CALL_CAP:"tierCDailyCallCap",TIER_C_DAILY_TOKEN_CAP:"tierCDailyTokenCap",TIER_C_WALL_CLOCK_MS:"tierCWallClockMs",TIER_C_ITEM_CAP:"tierCItemCap",TIER_C_LOAD_THRESHOLD:"tierCLoadThreshold",GIT_NETWORK_TIMEOUT_MS:"gitNetworkTimeoutMs",FORCE:"force",TIER_C_DRAIN_ALL:"tierCDrainAll",AGENT_AUTHORED_DECISIONS:"agentAuthoredDecisions",HOOK_NAME:"hookName",HOOK_ENABLED:"hookEnabled",FLUSH_STAGED_L3:"flushStagedL3"},Oe={SCOPE_NOT_FOUND:(t,e)=>`Cannot set "${t}": memory scope "${e}" was never created`},E=class{scopes=new Map;createScope(e){this.scopes.has(e)||this.scopes.set(e,new Map)}set(e,o,r){let s=this.scopes.get(e);if(!s)throw new c(l.MEMORY_SCOPE_NOT_FOUND,Oe.SCOPE_NOT_FOUND(o,e));s.set(o,r)}get(e,o){return this.scopes.get(e)?.get(o)}deleteScope(e){this.scopes.delete(e)}hasScope(e){return this.scopes.has(e)}},Pe=new E;var P={REGISTER_LOCKED:t=>`Cannot register "${t}": factory is locked (test isolation)`,PROVIDER_NOT_REGISTERED:t=>`No provider registered for "${t}" \u2014 the implementation library that owns it was never imported for its registration side effect`},_=class{providers=new Map;locked=!1;register(e,o){if(this.locked)throw new c(l.FACTORY_LOCKED,P.REGISTER_LOCKED(String(e.description)));this.providers.set(e,o)}resolve(e,o){let r=this.providers.get(e);if(!r)throw new c(l.FACTORY_TOKEN_NOT_REGISTERED,P.PROVIDER_NOT_REGISTERED(String(e.description)));return r(this,o)}has(e){return this.providers.has(e)}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.providers.clear(),this.locked=!1}},v=new _;function n(t){return Symbol(t)}var ve={GitProvider:n("IGitProvider"),LineBlameProvider:n("ILineBlameProvider"),KnowledgeGitService:n("IKnowledgeGitService"),FileDiscovery:n("IFileDiscovery"),ConfigScanner:n("IConfigScanner"),VcsScanner:n("IVcsScanner"),AstProcessor:n("IAstProcessor"),GraphPersister:n("IGraphPersister"),TempFileManager:n("TempFileManager"),GraphStoreOpener:n("GraphStoreOpener"),ProcessLock:n("ProcessLock"),RemoteSyncClient:n("RemoteSyncClient"),LlmClient:n("LlmClient"),QueryService:n("IQueryService"),TierBCoverageHintProvider:n("ITierBCoverageHintProvider"),ImpactService:n("IImpactService"),ChangeDetectionService:n("IChangeDetectionService"),TopologyBuilder:n("ITopologyBuilder"),SnapshotRenderer:n("ISnapshotRenderer"),HydrationService:n("IHydrationService"),DiagnosticRunnerDb:n("DiagnosticRunnerDb"),DiagnosticRunnerGit:n("DiagnosticRunnerGit"),SemanticDiffAnalyzer:n("ISemanticDiffAnalyzer"),EdgeResolutionProviders:n("EdgeResolutionProviders")};var xe={ADDED:"added",MODIFIED:"modified",DELETED:"deleted",RENAMED:"renamed"};var De={LSP:"lsp",LLM_INFERRED:"llm-inferred"},Me={TYPESCRIPT:"typescript",PYTHON:"python",GO:"go",RUST:"rust",JAVA:"java",CPP:"cpp",CSHARP:"csharp",PHP:"php",RUBY:"ruby"};var be={NO_REMOTE:"no-remote",UP_TO_DATE:"up-to-date",FAST_FORWARDED_LOCAL:"fast-forwarded-local",PUSHED_LOCAL:"pushed-local",MERGED:"merged"};var ke={MODULE:"module",PACKAGE:"package",PCD:"pcd"},Fe={CONTAINS:"contains",CALLS:"calls",IMPLEMENTS:"implements",EXTENDS:"extends",IMPORTS:"imports",DEPENDS_ON:"depends_on",DECISION:"decision"},I={CHANGE:"change",RULE:"rule",DECISION:"decision",CONTEXT:"context"},we={PENDING:"pending",ACTIVE:"active",DRAFT:"draft",GARBAGE:"garbage"},Ge={ANALYZE:"analyze",AGENT_AUTHORED:"agent-authored"};var He=I,Ke={AUTO_FULL_INGESTION:"autoFullIngestion",AUTO_DELTA:"autoDelta",AUTO_DELTA_NOOP:"autoDeltaNoop",DECISION_EXTRACTION:"decisionExtraction",TIER_B_BATCH:"tierBBatch",FLUSH_STAGED_L3:"flushStagedL3"};var Be={CREATE_L3:"CREATE_L3"};var Ue={SYSTEM:"system",USER:"user",ASSISTANT:"assistant",TOOL:"tool"},je="function";var Ye={LOW:"LOW",MEDIUM:"MEDIUM",HIGH:"HIGH",CRITICAL:"CRITICAL",UNKNOWN:"UNKNOWN"},Ve={EXACT:"exact",LOWER_BOUND:"lower-bound"},We={BOUNDED:"bounded",UNRESOLVED:"unresolved"},Xe={DYNAMIC_IMPORT:"dynamic-import"},ze={LSP_FALLBACK:"lsp-fallback",DYNAMIC_CANDIDATE:"dynamic-candidate"};var Qe={L2:"l2",L3:"l3"};var qe={FILE:"file",SYMBOL:"symbol",DECISION:"decision"},Je={AUTO:"auto",FILE:"file",SYMBOL:"symbol"},Ze={L1_TAG:"l1_tag",DIRECTORY:"directory"};var $e={TYPESCRIPT:"typescript",REACT:"react",EXPRESS:"express",VUE:"vue"},et={UNKNOWN:"unknown",JAVASCRIPT:"javascript",GENERIC:"generic",RUST:"rust",PYTHON:"python",GO:"go"},tt="general",ot={FRONTEND:"frontend",BACKEND:"backend",NEXTJS:"nextjs",SSR:"ssr",DRIZZLE:"drizzle",DATABASE:"database",TAILWINDCSS:"tailwindcss",CSS:"css",JEST:"jest",TESTING:"testing",VITEST:"vitest",POSTGRES:"postgres",MONOREPO:"monorepo",TOKIO:"tokio",ASYNC:"async",ACTIX:"actix",SERDE:"serde",TAURI:"tauri",DESKTOP:"desktop",DJANGO:"django",FASTAPI:"fastapi",PANDAS:"pandas",DATA:"data",GIN:"gin",STRICT_TS:"strict-ts",VITE:"vite",BUILD_TOOL:"build-tool"};var x="origin",A={KNOWLEDGE_ROOT:"docuvia-knowledge",KNOWLEDGE_LOG_SCAN_LIMIT:5e3,KNOWLEDGE_DIR_NAME:"knowledge",GRAPH_DIR_NAME:"graph",L3_DIR_NAME:"_l3",NODES_JSONL_NAME:"nodes.jsonl",EDGES_JSONL_NAME:"edges.jsonl",SOURCE_COMMIT_TRAILER_KEY:"Docuvia-Source",POST_COMMIT_HOOK_NAME:"post-commit",POST_COMMIT_HOOK_MARKER:"docuvia analyze",POST_COMMIT_FLUSH_L3_MARKER:"docuvia analyze --flush-staged-l3",POST_COMMIT_NOHUP_MARKER:"nohup npx --no-install docuvia analyze",DOCUVIA_HOOK_HEADER_COMMENT:"# Docuvia Knowledge Graph Evolver Hook",POST_COMMIT_HOOK_CONTENT:`#!/bin/bash
|
|
3
3
|
# Docuvia Knowledge Graph Evolver Hook
|
|
4
4
|
# Non-intrusively extracts AST deltas in the background
|
|
5
5
|
if command -v npx > /dev/null 2>&1; then
|
|
@@ -94,6 +94,6 @@ fi
|
|
|
94
94
|
# Never blocks the push on a Tier B failure -- PLAT-007's reliability requirement (failures
|
|
95
95
|
# only ever surface via JSONL logs / doctor, never to the pushing developer).
|
|
96
96
|
exit 0
|
|
97
|
-
`,META_KEY_TIER_C_QUEUE:"tierCQueue",META_KEY_TIER_C_BUDGET:"tierCBudget",DEFAULT_TIER_C_DAILY_CALL_CAP:50,DEFAULT_TIER_C_DAILY_TOKEN_CAP:1e5,DEFAULT_TIER_C_WALL_CLOCK_MS:12e3,DEFAULT_TIER_C_ITEM_CAP:20,DEFAULT_TIER_C_LOAD_THRESHOLD:.8,DEFAULT_TIER_C_MAX_ITEM_FAILURES:3};import
|
|
98
|
-
`)){let o=e.trim();if(o.startsWith(Y))return o.slice(Y.length).trim()}}function
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
`,META_KEY_TIER_C_QUEUE:"tierCQueue",META_KEY_TIER_C_BUDGET:"tierCBudget",DEFAULT_TIER_C_DAILY_CALL_CAP:50,DEFAULT_TIER_C_DAILY_TOKEN_CAP:1e5,DEFAULT_TIER_C_WALL_CLOCK_MS:12e3,DEFAULT_TIER_C_ITEM_CAP:20,DEFAULT_TIER_C_LOAD_THRESHOLD:.8,DEFAULT_TIER_C_MAX_ITEM_FAILURES:3};import y from"path";var D=[".ts",".tsx",".mts",".cts"],M=[".js",".jsx",".mjs",".cjs"],b=[".py"],k=[".rs"],F=[".go"],w=[".java"],G=[".c",".h"],H=[".cpp",".cxx",".cc",".hpp",".hxx",".hh",".cu",".cuh"],K=[".rb",".rake",".gemspec"],B=[".php",".phtml",".php3",".php4",".php5",".phps"],U=[".cs"],h=new Set(["Rakefile","Gemfile","Guardfile","Vagrantfile","Brewfile"]),N=(()=>{let t=new Map,e=[[i.TYPESCRIPT,D],[i.JAVASCRIPT,M],[i.PYTHON,b],[i.RUST,k],[i.GO,F],[i.JAVA,w],[i.C,G],[i.CPP,H],[i.RUBY,K],[i.PHP,B],[i.CSHARP,U]];for(let[o,r]of e)for(let s of r)t.set(s,o);return t})();function rt(t){let e=N.get(y.extname(t).toLowerCase());return e||(h.has(y.basename(t))?i.RUBY:void 0)}function j(t){return N.has(y.extname(t).toLowerCase())?!0:h.has(y.basename(t))}function nt(){return Array.from(N.keys()).map(t=>t.replace(/^\./,""))}function st(t){return j(t)&&!t.includes(`${S}/`)&&!t.includes(`${L}/`)}var it={TIMED_OUT_WAITING:t=>`Timed out waiting for the lock at ${t} \u2014 another process may be stuck`},C=class extends Error{constructor(e){super(it.TIMED_OUT_WAITING(e)),this.name="ProcessLockTimeoutError"}};var Y=`${A.SOURCE_COMMIT_TRAILER_KEY}: `;function at(t){for(let e of t.split(`
|
|
98
|
+
`)){let o=e.trim();if(o.startsWith(Y))return o.slice(Y.length).trim()}}function ct(t,e,o,r){if(!o&&!r)return;let d=(e?t.files.getTierBFileStatus(e):void 0)?.lastProcessedAt??null,V=r&&d===null,u=t.files.getTierBCoverage(),W=o&&u.processedFiles<u.totalFiles;if(!(!V&&!W))return{ownFileLastProcessedAt:d,workspaceFilesProcessed:u.processedFiles,workspaceFilesTotal:u.totalFiles}}function lt(t){let e={total:0,resolved:0,selfDiscarded:0,unresolved:0,unresolvable:0,external:0,unknownReceiver:0};for(let o of Object.values(t))e.total+=o.total,e.resolved+=o.resolved,e.selfDiscarded+=o.selfDiscarded,e.unresolvable=(e.unresolvable??0)+(o.unresolvable??0),e.external=(e.external??0)+(o.external??0),e.unknownReceiver=(e.unknownReceiver??0)+(o.unknownReceiver??0),e.unresolved+=o.unresolved;return e}function pt(t){return t.total-t.selfDiscarded-(t.unresolvable??0)-(t.external??0)-(t.unknownReceiver??0)}var gt={PASS:"pass",FAIL:"fail"};export{a,g as b,he as c,f as d,R as e,l as f,c as g,Ce as h,Pe as i,v as j,ve as k,xe as l,De as m,Me as n,be as o,ke as p,Fe as q,we as r,Ge as s,He as t,Ke as u,Be as v,Ue as w,je as x,Ye as y,Ve as z,We as A,Xe as B,ze as C,Qe as D,qe as E,Je as F,Ze as G,m as H,z as I,L as J,Q as K,q as L,J as M,Z as N,$ as O,ee as P,te as Q,oe as R,re as S,ne as T,se as U,ie as V,ae as W,S as X,ce as Y,le as Z,pe as _,ge as $,de as aa,ue as ba,$e as ca,et as da,tt as ea,ot as fa,me as ga,Ee as ha,x as ia,A as ja,i as ka,D as la,M as ma,b as na,k as oa,F as pa,w as qa,G as ra,H as sa,K as ta,B as ua,U as va,h as wa,rt as xa,j as ya,nt as za,st as Aa,_e as Ba,ye as Ca,Te as Da,fe as Ea,Le as Fa,C as Ga,at as Ha,ct as Ia,lt as Ja,pt as Ka,gt as La,Se as Ma,Re as Na,Ie as Oa,Ae as Pa};
|
|
99
|
+
//# sourceMappingURL=chunk-S66GYDVI.js.map
|