docuvia 1.20.0 → 1.21.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/ast-worker.js.map +1 -1
- package/dist/{chunk-34USPXMP.js → chunk-HMNSKM6W.js} +2 -2
- package/dist/{chunk-WULDFQHU.js → chunk-NKKCG232.js} +2 -2
- package/dist/{chunk-2OLMINDD.js → chunk-RRS2FFZT.js} +4 -4
- package/dist/chunk-RRS2FFZT.js.map +1 -0
- package/dist/{chunk-PXZ4QCE3.js → chunk-W2AEK3XF.js} +2 -2
- package/dist/cli.js +104 -104
- package/dist/cli.js.map +1 -1
- package/dist/fs-utils-LQ3M7FUG.js +3 -0
- package/dist/{init-templates-ZGWV56MV.js → init-templates-AFKLXE3A.js} +2 -2
- package/dist/q1-named-import-candidate-certification.json +45 -0
- package/package.json +1 -1
- package/dist/chunk-2OLMINDD.js.map +0 -1
- package/dist/fs-utils-GUMXA35G.js +0 -3
- /package/dist/{chunk-34USPXMP.js.map → chunk-HMNSKM6W.js.map} +0 -0
- /package/dist/{chunk-WULDFQHU.js.map → chunk-NKKCG232.js.map} +0 -0
- /package/dist/{chunk-PXZ4QCE3.js.map → chunk-W2AEK3XF.js.map} +0 -0
- /package/dist/{fs-utils-GUMXA35G.js.map → fs-utils-LQ3M7FUG.js.map} +0 -0
- /package/dist/{init-templates-ZGWV56MV.js.map → init-templates-AFKLXE3A.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{Ga as P,Ka as d,Qa as Y,Ra as B,Sa as G,Ta as H,Ua as Q,Va as V,Wa as j,Xa as W,Ya as q,Za as J,_a as K}from"./chunk-2OLMINDD.js";var z="anonymous";var Jt="AstWorkerCrashError",Kt={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"},zt={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:z,workerCrashWhileParsing:t=>`AST worker crashed while parsing ${t}: `,taskTimedOutAfterMs:(t,e)=>`AST worker task ${t} timed out after ${e}ms`,workerExitedWithCode:t=>`Worker exited with code ${t}`,noLanguageProviderForExtension:t=>`No language provider registered for extension ${t}`,wasmNotFound:(t,e)=>`WASM not found for ${t}, AST parsing skipped (Regex fallback used). Tried paths: ${e}`,parsedViaTreeSitter:t=>`Parsed via web-tree-sitter (nodes: ${t})`,providerQueryFailed:t=>`ast-core provider query failed: ${t}`};var A={FILE:"file",CLASS:"class",FUNCTION:"function",CALL:"call",METHOD_CALL:"method_call",IMPORT:"import",API_CONTRACT:"api_contract"};var l={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 T="*",pe=["require","require_relative","load"],Z="this",Ae="new";function on(t){let e=[];for(let n of t){let o=n.type,i=Ce[o];if(i){i(n,e);continue}if(ze(o)){tt(n,o,e);continue}rt(n,e)}return e}var Ce={[l.IMPORT_STATEMENT]:Oe,[l.EXPORT_STATEMENT]:xe,[l.IMPORT_FROM_STATEMENT]:Xe,[l.USE_DECLARATION]:Ve,[l.IMPORT_DECLARATION]:We,[l.PREPROC_INCLUDE]:qe,[l.USING_DECLARATION]:Je,[l.CALL]:Ke,[l.USING_DIRECTIVE]:nt};function Oe(t,e){let n=t.descendantsOfType("string").pop();if(!n)return;let o=n.text.replace(/['"]/g,""),i=/^import\s+type\b/u.test(t.text.trimStart());if(!Se(t,o,i,e)){if(Re(t,o,i,e)){he(t,o,i,e);return}ge(t,o,i,e)}}function Se(t,e,n,o){let i=t.descendantsOfType("namespace_import")[0];if(!i)return!1;let s=i.descendantsOfType("identifier")[0];return s&&o.push({localName:s.text,originalName:T,modulePath:e,...n?{isTypeOnly:!0}:{}}),!0}function Re(t,e,n,o){let i=t.descendantsOfType("named_imports")[0];if(!i)return!1;for(let s of i.descendantsOfType("import_specifier"))s&&Le(s,e,n,o);return!0}function Le(t,e,n,o){let i=t.childForFieldName("name");if(!i)return;let s=t.childForFieldName("alias"),a=i.text;o.push({localName:s?s.text:a,originalName:a,modulePath:e,...n||/^type\s/u.test(t.text.trimStart())?{isTypeOnly:!0}:{}})}function he(t,e,n,o){let i=De(t);!i||!Pe(t)||!Fe(t)||o.push({localName:i,originalName:"default",modulePath:e,isCombinedDefaultImport:!0,...n?{isTypeOnly:!0}:{}})}function De(t){let o=(t.descendantsOfType("import_clause")[0]?.namedChildren??[]).filter(s=>s!==null).find(s=>s.type==="identifier"),i=t.text.trimStart().match(/^import\s+(?:type\s+)?([$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*)\s*,\s*\{/u)?.[1];return o?.text??i}function Pe(t){return(t.descendantsOfType("import_clause")[0]?.namedChildren??[]).some(o=>o?.type==="named_imports")?!0:/^import\s+(?:type\s+)?[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*\s*,\s*\{/u.test(t.text.trimStart())}function Fe(t){return!!t.descendantsOfType("named_imports")[0]?.descendantsOfType("import_specifier").length}function ge(t,e,n,o){let i=t.descendantsOfType("identifier")[0];i&&o.push({localName:i.text,originalName:T,modulePath:e,isDefaultImport:!0,...n?{isTypeOnly:!0}:{}})}function xe(t,e){let n=t.childForFieldName("source");if(!n)return;let o=n.text.replace(/['"]/g,""),i=t.descendantsOfType("export_clause")[0];if(i)for(let s of i.descendantsOfType("export_specifier")){if(!s)continue;let a=s.childForFieldName("name");if(!a)continue;let E=s.childForFieldName("alias");e.push({localName:E?E.text:a.text,originalName:a.text,modulePath:o,viaReexport:!0})}}function $e(t){let e=t.childForFieldName("source");return e?e.text.replace(/^['"]|['"]$/gu,""):void 0}function w(t,e){return/^export\s+type\b/u.test(t.text.trimStart())||e!==void 0&&/^type(?:\s|$)/u.test(e.text.trimStart())}function ye(t,e,n){let o=n.childForFieldName("name");if(!o)return null;let i=n.childForFieldName("alias"),s=w(t,n),a=i?.text??o.text;return e!==void 0?{kind:"named",exportedName:a,importedName:o.text,modulePath:e,...s?{isTypeOnly:!0}:{}}:{kind:"local",exportedName:a,localName:o.text,...s?{isTypeOnly:!0}:{}}}function Me(t,e){let n=t.descendantsOfType("export_clause")[0];return n?n.descendantsOfType("export_specifier").flatMap(o=>{if(!o)return[];let i=ye(t,e,o);return i?[i]:[]}):null}function Ue(t,e){let n=t.text.trimStart().match(/^export\s+(?:type\s+)?\*\s+as\s+([$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*)/u)?.[1];return n?{kind:"namespace",exportedName:n,modulePath:e,...w(t)?{isTypeOnly:!0}:{}}:null}function we(t,e){return/^export\s+(?:type\s+)?\*\s+from\b/u.test(t.text.trimStart())?{kind:"star",exportedName:"*",modulePath:e,...w(t)?{isTypeOnly:!0}:{}}:null}function be(t){let e=$e(t),n=Me(t,e);if(n)return n;if(e===void 0)return[];let o=Ue(t,e);if(o)return[o];let i=we(t,e);return i?[i]:[]}function sn(t){let e=[];for(let n of t.namedChildren)n?.type===l.EXPORT_STATEMENT&&e.push(...be(n));return e}function Xe(t,e){let n=t.childForFieldName("module_name");if(!n)return;let o=n.text;if(t.descendantsOfType("wildcard_import")[0])return;t.childForFieldName("name")&&ot(t,o,e)}function ve(t,e){let n=t.childForFieldName("path"),o=t.childForFieldName("alias");n&&o&&e.push({localName:o.text,originalName:T,modulePath:n.text})}function ke(t,e,n){let o=t.childForFieldName("path"),i=t.childForFieldName("alias");o&&i&&n.push({localName:i.text,originalName:T,modulePath:`${e}::${o.text}`})}function Ye(t,e,n){let o=t.descendantsOfType("identifier").pop();o&&n.push({localName:o.text,originalName:T,modulePath:`${e}::${t.text}`})}function Be(t,e,n){if(t.type===l.USE_AS_CLAUSE){ke(t,e,n);return}if(t.type===l.IDENTIFIER){n.push({localName:t.text,originalName:T,modulePath:`${e}::${t.text}`});return}t.type===l.SCOPED_IDENTIFIER&&Ye(t,e,n)}function Ge(t,e){let n=t.childForFieldName("path"),o=t.childForFieldName("list");if(!n||!o)return;let i=n.text;for(let s of o.namedChildren)s&&Be(s,i,e)}function He(t,e){let n=t.descendantsOfType("identifier"),o=n[n.length-1];o&&e.push({localName:o.text,originalName:T,modulePath:t.text})}function Qe(t,e){for(let n of t.namedChildren)n&&n.type===l.IDENTIFIER&&e.push({localName:n.text,originalName:T,modulePath:n.text})}function Ve(t,e){let n=t.childForFieldName("argument");if(n){if(n.type===l.USE_AS_CLAUSE){ve(n,e);return}if(n.type!==l.USE_WILDCARD){if(n.type===l.SCOPED_USE_LIST){Ge(n,e);return}if(n.type===l.SCOPED_IDENTIFIER||n.type===l.IDENTIFIER){He(n,e);return}n.type===l.USE_LIST&&Qe(n,e)}}}function je(t,e){let n=t.childForFieldName("path");if(!n)return;let o=n.text.replace(/['"]/g,""),i=t.childForFieldName("name");if(i){if(i.type===l.DOT||i.type===l.BLANK_IDENTIFIER)return;e.push({localName:i.text,originalName:T,modulePath:o})}else{let s=o.split("/"),a=s[s.length-1];e.push({localName:a,originalName:T,modulePath:o})}}function We(t,e){let n=t.descendantsOfType("import_spec_list")[0];if(!n)return;let o=n.descendantsOfType("import_spec");for(let i of o)i&&je(i,e)}function qe(t,e){let n=t.childForFieldName("path");if(n){let o=n.text.replace(/[<>"']/g,"");e.push({localName:o,originalName:T,modulePath:o})}}function Je(t,e){let n=t.namedChildren;for(let o of n)if(o)if(o.type===l.QUALIFIED_IDENTIFIER){let i=o.descendantsOfType("identifier"),s=i[i.length-1];s&&e.push({localName:s.text,originalName:T,modulePath:o.text})}else o.type===l.IDENTIFIER&&e.push({localName:o.text,originalName:T,modulePath:o.text})}function Ke(t,e){let n=t.childForFieldName("method");if(!n)return;let o=n.text;if(!pe.includes(o))return;let i=t.childForFieldName("arguments");if(!i)return;let s=i.descendantsOfType("string_content")[0]||i.descendantsOfType("string")[0];if(!s)return;let a=s.text.replace(/['"]/g,""),E=a.replace(/\.rb$/,"");e.push({localName:E,originalName:T,modulePath:a})}function ze(t){return t===l.NAMESPACE_USE_DECLARATION||t===l.INCLUDE_EXPRESSION||t===l.INCLUDE_ONCE_EXPRESSION||t===l.REQUIRE_EXPRESSION||t===l.REQUIRE_ONCE_EXPRESSION}function Ze(t,e){let n=t.descendantsOfType("qualified_name")[0]||t.descendantsOfType("name")[0];if(n){let o=n.text,i=o.split("\\"),s=i[i.length-1];e.push({localName:s,originalName:T,modulePath:o})}}function et(t,e){let n=t.descendantsOfType("string")[0]||t.descendantsOfType("string_content")[0];if(n){let o=n.text.replace(/['"]/g,"");e.push({localName:o,originalName:T,modulePath:o})}}function tt(t,e,n){e===l.NAMESPACE_USE_DECLARATION?Ze(t,n):et(t,n)}function nt(t,e){let n=t.descendantsOfType("qualified_name")[0]||t.descendantsOfType("identifier")[0];if(n){let o=n.text,i=o.split("."),s=i[i.length-1];e.push({localName:s,originalName:T,modulePath:o})}}function rt(t,e){let n=t.descendantsOfType("string").pop();if(!n)return;let o=n.text.replace(/['"]/g,""),i=t.descendantsOfType("identifier");for(let s of i)s&&(e.some(a=>a.localName===s.text)||e.push({localName:s.text,originalName:s.text,modulePath:o}))}function ot(t,e,n){if(t.childForFieldName("name")){for(let i of t.namedChildren)if(i)if(i.type===l.ALIASED_IMPORT){let s=i.childForFieldName("name"),a=i.childForFieldName("alias");s&&a&&n.push({localName:a.text,originalName:s.text,modulePath:e})}else if(i.type===l.DOTTED_NAME){let s=i.descendantsOfType("identifier"),a=s[s.length-1];a&&n.push({localName:a.text,originalName:i.text,modulePath:e})}else i.type===l.IDENTIFIER&&n.push({localName:i.text,originalName:i.text,modulePath:e})}}function it(t){let e=t.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===l.MEMBER_EXPRESSION){let n=e.childForFieldName("property"),o=e.childForFieldName("object");if(n)return{isMethodCall:!0,methodName:n.text,objectName:o?.text}}return{isMethodCall:!1,methodName:e.text}}function st(t){let e=t.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===l.ATTRIBUTE){let n=e.childForFieldName("attribute"),o=e.childForFieldName("object");if(n)return{isMethodCall:!0,methodName:n.text,objectName:o?.text}}return{isMethodCall:!1,methodName:e.text}}function at(t){let e=t.childForFieldName("name"),n=t.childForFieldName("object");if(e)return{isMethodCall:!0,methodName:e.text,objectName:n?.text}}function ct(t){return{isMethodCall:!0,methodName:t.childForFieldName("constructor")?.text||Z,objectName:Z}}function lt(t){let e=t.childForFieldName("method");if(!e)return;let n=t.childForFieldName("receiver");return n?{isMethodCall:!0,methodName:e.text,objectName:n.text}:{isMethodCall:!1,methodName:e.text}}function U(t){let e=t.type,o=t.childForFieldName("name")?.text||"";if(e===l.MEMBER_CALL_EXPRESSION){let i=t.childForFieldName("object");return{isMethodCall:!0,methodName:o,objectName:i?.text}}if(e===l.SCOPED_CALL_EXPRESSION){let i=t.childForFieldName("scope");return{isMethodCall:!0,methodName:o,objectName:i?.text}}return{isMethodCall:!1,methodName:o}}function Et(t){let e=t.childForFieldName("function")||t.namedChildren[0];if(e&&e.type===l.MEMBER_ACCESS_EXPRESSION){let n=e.childForFieldName("name"),o=e.childForFieldName("expression");if(n)return{isMethodCall:!0,methodName:n.text,objectName:o?.text}}if(e)return{isMethodCall:!1,methodName:e.text}}function Nt(t){let e=t.childForFieldName("type");return{isMethodCall:!0,methodName:Ae,objectName:e?.text}}var an={[l.CALL_EXPRESSION]:it,[l.CALL]:st,[l.METHOD_INVOCATION]:at,[l.EXPLICIT_CONSTRUCTOR_INVOCATION]:ct,[l.COMMAND_CALL]:lt,[l.FUNCTION_CALL_EXPRESSION]:U,[l.MEMBER_CALL_EXPRESSION]:U,[l.SCOPED_CALL_EXPRESSION]:U,[l.INVOCATION_EXPRESSION]:Et,[l.OBJECT_CREATION_EXPRESSION]:Nt};var It=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,L=class t extends Date{#t=!1;#n=!1;#e=null;constructor(e){let n=!0,o=!0,i="Z";if(typeof e=="string"){let s=e.match(It);s?(s[1]||(n=!1,e=`0000-01-01T${e}`),o=!!s[2],o&&e[10]===" "&&(e=e.replace(" ","T")),s[2]&&+s[2]>23?e="":(i=s[3]||null,e=e.toUpperCase(),!i&&o&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=n,this.#n=o,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 n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,n="Z"){let o=new t(e);return o.#e=n,o}static wrapAsLocalDateTime(e){let n=new t(e);return n.#e=null,n}static wrapAsLocalDate(e){let n=new t(e);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(e){let n=new t(e);return n.#t=!1,n.#e=null,n}};function ft(t,e){let n=t.slice(0,e).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function ut(t,e,n){let o=t.split(/\r\n|\n|\r/g),i="",s=(Math.log10(e+1)|0)+1;for(let a=e-1;a<=e+1;a++){let E=o[a-1];E&&(i+=a.toString().padEnd(s," "),i+=": ",i+=E,i+=`
|
|
2
|
+
import{$a as K,Ha as P,La as d,Ra as Y,Sa as B,Ta as G,Ua as H,Va as Q,Wa as V,Xa as j,Ya as W,Za as q,_a as J}from"./chunk-RRS2FFZT.js";var z="anonymous";var Jt="AstWorkerCrashError",Kt={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"},zt={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:z,workerCrashWhileParsing:t=>`AST worker crashed while parsing ${t}: `,taskTimedOutAfterMs:(t,e)=>`AST worker task ${t} timed out after ${e}ms`,workerExitedWithCode:t=>`Worker exited with code ${t}`,noLanguageProviderForExtension:t=>`No language provider registered for extension ${t}`,wasmNotFound:(t,e)=>`WASM not found for ${t}, AST parsing skipped (Regex fallback used). Tried paths: ${e}`,parsedViaTreeSitter:t=>`Parsed via web-tree-sitter (nodes: ${t})`,providerQueryFailed:t=>`ast-core provider query failed: ${t}`};var A={FILE:"file",CLASS:"class",FUNCTION:"function",CALL:"call",METHOD_CALL:"method_call",IMPORT:"import",API_CONTRACT:"api_contract"};var l={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 T="*",pe=["require","require_relative","load"],Z="this",Ae="new";function on(t){let e=[];for(let n of t){let o=n.type,i=Ce[o];if(i){i(n,e);continue}if(ze(o)){tt(n,o,e);continue}rt(n,e)}return e}var Ce={[l.IMPORT_STATEMENT]:Oe,[l.EXPORT_STATEMENT]:xe,[l.IMPORT_FROM_STATEMENT]:Xe,[l.USE_DECLARATION]:Ve,[l.IMPORT_DECLARATION]:We,[l.PREPROC_INCLUDE]:qe,[l.USING_DECLARATION]:Je,[l.CALL]:Ke,[l.USING_DIRECTIVE]:nt};function Oe(t,e){let n=t.descendantsOfType("string").pop();if(!n)return;let o=n.text.replace(/['"]/g,""),i=/^import\s+type\b/u.test(t.text.trimStart());if(!Se(t,o,i,e)){if(Re(t,o,i,e)){he(t,o,i,e);return}ge(t,o,i,e)}}function Se(t,e,n,o){let i=t.descendantsOfType("namespace_import")[0];if(!i)return!1;let s=i.descendantsOfType("identifier")[0];return s&&o.push({localName:s.text,originalName:T,modulePath:e,...n?{isTypeOnly:!0}:{}}),!0}function Re(t,e,n,o){let i=t.descendantsOfType("named_imports")[0];if(!i)return!1;for(let s of i.descendantsOfType("import_specifier"))s&&Le(s,e,n,o);return!0}function Le(t,e,n,o){let i=t.childForFieldName("name");if(!i)return;let s=t.childForFieldName("alias"),a=i.text;o.push({localName:s?s.text:a,originalName:a,modulePath:e,...n||/^type\s/u.test(t.text.trimStart())?{isTypeOnly:!0}:{}})}function he(t,e,n,o){let i=De(t);!i||!Pe(t)||!Fe(t)||o.push({localName:i,originalName:"default",modulePath:e,isCombinedDefaultImport:!0,...n?{isTypeOnly:!0}:{}})}function De(t){let o=(t.descendantsOfType("import_clause")[0]?.namedChildren??[]).filter(s=>s!==null).find(s=>s.type==="identifier"),i=t.text.trimStart().match(/^import\s+(?:type\s+)?([$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*)\s*,\s*\{/u)?.[1];return o?.text??i}function Pe(t){return(t.descendantsOfType("import_clause")[0]?.namedChildren??[]).some(o=>o?.type==="named_imports")?!0:/^import\s+(?:type\s+)?[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*\s*,\s*\{/u.test(t.text.trimStart())}function Fe(t){return!!t.descendantsOfType("named_imports")[0]?.descendantsOfType("import_specifier").length}function ge(t,e,n,o){let i=t.descendantsOfType("identifier")[0];i&&o.push({localName:i.text,originalName:T,modulePath:e,isDefaultImport:!0,...n?{isTypeOnly:!0}:{}})}function xe(t,e){let n=t.childForFieldName("source");if(!n)return;let o=n.text.replace(/['"]/g,""),i=t.descendantsOfType("export_clause")[0];if(i)for(let s of i.descendantsOfType("export_specifier")){if(!s)continue;let a=s.childForFieldName("name");if(!a)continue;let E=s.childForFieldName("alias");e.push({localName:E?E.text:a.text,originalName:a.text,modulePath:o,viaReexport:!0})}}function $e(t){let e=t.childForFieldName("source");return e?e.text.replace(/^['"]|['"]$/gu,""):void 0}function w(t,e){return/^export\s+type\b/u.test(t.text.trimStart())||e!==void 0&&/^type(?:\s|$)/u.test(e.text.trimStart())}function ye(t,e,n){let o=n.childForFieldName("name");if(!o)return null;let i=n.childForFieldName("alias"),s=w(t,n),a=i?.text??o.text;return e!==void 0?{kind:"named",exportedName:a,importedName:o.text,modulePath:e,...s?{isTypeOnly:!0}:{}}:{kind:"local",exportedName:a,localName:o.text,...s?{isTypeOnly:!0}:{}}}function Me(t,e){let n=t.descendantsOfType("export_clause")[0];return n?n.descendantsOfType("export_specifier").flatMap(o=>{if(!o)return[];let i=ye(t,e,o);return i?[i]:[]}):null}function Ue(t,e){let n=t.text.trimStart().match(/^export\s+(?:type\s+)?\*\s+as\s+([$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*)/u)?.[1];return n?{kind:"namespace",exportedName:n,modulePath:e,...w(t)?{isTypeOnly:!0}:{}}:null}function we(t,e){return/^export\s+(?:type\s+)?\*\s+from\b/u.test(t.text.trimStart())?{kind:"star",exportedName:"*",modulePath:e,...w(t)?{isTypeOnly:!0}:{}}:null}function be(t){let e=$e(t),n=Me(t,e);if(n)return n;if(e===void 0)return[];let o=Ue(t,e);if(o)return[o];let i=we(t,e);return i?[i]:[]}function sn(t){let e=[];for(let n of t.namedChildren)n?.type===l.EXPORT_STATEMENT&&e.push(...be(n));return e}function Xe(t,e){let n=t.childForFieldName("module_name");if(!n)return;let o=n.text;if(t.descendantsOfType("wildcard_import")[0])return;t.childForFieldName("name")&&ot(t,o,e)}function ve(t,e){let n=t.childForFieldName("path"),o=t.childForFieldName("alias");n&&o&&e.push({localName:o.text,originalName:T,modulePath:n.text})}function ke(t,e,n){let o=t.childForFieldName("path"),i=t.childForFieldName("alias");o&&i&&n.push({localName:i.text,originalName:T,modulePath:`${e}::${o.text}`})}function Ye(t,e,n){let o=t.descendantsOfType("identifier").pop();o&&n.push({localName:o.text,originalName:T,modulePath:`${e}::${t.text}`})}function Be(t,e,n){if(t.type===l.USE_AS_CLAUSE){ke(t,e,n);return}if(t.type===l.IDENTIFIER){n.push({localName:t.text,originalName:T,modulePath:`${e}::${t.text}`});return}t.type===l.SCOPED_IDENTIFIER&&Ye(t,e,n)}function Ge(t,e){let n=t.childForFieldName("path"),o=t.childForFieldName("list");if(!n||!o)return;let i=n.text;for(let s of o.namedChildren)s&&Be(s,i,e)}function He(t,e){let n=t.descendantsOfType("identifier"),o=n[n.length-1];o&&e.push({localName:o.text,originalName:T,modulePath:t.text})}function Qe(t,e){for(let n of t.namedChildren)n&&n.type===l.IDENTIFIER&&e.push({localName:n.text,originalName:T,modulePath:n.text})}function Ve(t,e){let n=t.childForFieldName("argument");if(n){if(n.type===l.USE_AS_CLAUSE){ve(n,e);return}if(n.type!==l.USE_WILDCARD){if(n.type===l.SCOPED_USE_LIST){Ge(n,e);return}if(n.type===l.SCOPED_IDENTIFIER||n.type===l.IDENTIFIER){He(n,e);return}n.type===l.USE_LIST&&Qe(n,e)}}}function je(t,e){let n=t.childForFieldName("path");if(!n)return;let o=n.text.replace(/['"]/g,""),i=t.childForFieldName("name");if(i){if(i.type===l.DOT||i.type===l.BLANK_IDENTIFIER)return;e.push({localName:i.text,originalName:T,modulePath:o})}else{let s=o.split("/"),a=s[s.length-1];e.push({localName:a,originalName:T,modulePath:o})}}function We(t,e){let n=t.descendantsOfType("import_spec_list")[0];if(!n)return;let o=n.descendantsOfType("import_spec");for(let i of o)i&&je(i,e)}function qe(t,e){let n=t.childForFieldName("path");if(n){let o=n.text.replace(/[<>"']/g,"");e.push({localName:o,originalName:T,modulePath:o})}}function Je(t,e){let n=t.namedChildren;for(let o of n)if(o)if(o.type===l.QUALIFIED_IDENTIFIER){let i=o.descendantsOfType("identifier"),s=i[i.length-1];s&&e.push({localName:s.text,originalName:T,modulePath:o.text})}else o.type===l.IDENTIFIER&&e.push({localName:o.text,originalName:T,modulePath:o.text})}function Ke(t,e){let n=t.childForFieldName("method");if(!n)return;let o=n.text;if(!pe.includes(o))return;let i=t.childForFieldName("arguments");if(!i)return;let s=i.descendantsOfType("string_content")[0]||i.descendantsOfType("string")[0];if(!s)return;let a=s.text.replace(/['"]/g,""),E=a.replace(/\.rb$/,"");e.push({localName:E,originalName:T,modulePath:a})}function ze(t){return t===l.NAMESPACE_USE_DECLARATION||t===l.INCLUDE_EXPRESSION||t===l.INCLUDE_ONCE_EXPRESSION||t===l.REQUIRE_EXPRESSION||t===l.REQUIRE_ONCE_EXPRESSION}function Ze(t,e){let n=t.descendantsOfType("qualified_name")[0]||t.descendantsOfType("name")[0];if(n){let o=n.text,i=o.split("\\"),s=i[i.length-1];e.push({localName:s,originalName:T,modulePath:o})}}function et(t,e){let n=t.descendantsOfType("string")[0]||t.descendantsOfType("string_content")[0];if(n){let o=n.text.replace(/['"]/g,"");e.push({localName:o,originalName:T,modulePath:o})}}function tt(t,e,n){e===l.NAMESPACE_USE_DECLARATION?Ze(t,n):et(t,n)}function nt(t,e){let n=t.descendantsOfType("qualified_name")[0]||t.descendantsOfType("identifier")[0];if(n){let o=n.text,i=o.split("."),s=i[i.length-1];e.push({localName:s,originalName:T,modulePath:o})}}function rt(t,e){let n=t.descendantsOfType("string").pop();if(!n)return;let o=n.text.replace(/['"]/g,""),i=t.descendantsOfType("identifier");for(let s of i)s&&(e.some(a=>a.localName===s.text)||e.push({localName:s.text,originalName:s.text,modulePath:o}))}function ot(t,e,n){if(t.childForFieldName("name")){for(let i of t.namedChildren)if(i)if(i.type===l.ALIASED_IMPORT){let s=i.childForFieldName("name"),a=i.childForFieldName("alias");s&&a&&n.push({localName:a.text,originalName:s.text,modulePath:e})}else if(i.type===l.DOTTED_NAME){let s=i.descendantsOfType("identifier"),a=s[s.length-1];a&&n.push({localName:a.text,originalName:i.text,modulePath:e})}else i.type===l.IDENTIFIER&&n.push({localName:i.text,originalName:i.text,modulePath:e})}}function it(t){let e=t.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===l.MEMBER_EXPRESSION){let n=e.childForFieldName("property"),o=e.childForFieldName("object");if(n)return{isMethodCall:!0,methodName:n.text,objectName:o?.text}}return{isMethodCall:!1,methodName:e.text}}function st(t){let e=t.childForFieldName("function");if(!e)return{isMethodCall:!1,methodName:""};if(e.type===l.ATTRIBUTE){let n=e.childForFieldName("attribute"),o=e.childForFieldName("object");if(n)return{isMethodCall:!0,methodName:n.text,objectName:o?.text}}return{isMethodCall:!1,methodName:e.text}}function at(t){let e=t.childForFieldName("name"),n=t.childForFieldName("object");if(e)return{isMethodCall:!0,methodName:e.text,objectName:n?.text}}function ct(t){return{isMethodCall:!0,methodName:t.childForFieldName("constructor")?.text||Z,objectName:Z}}function lt(t){let e=t.childForFieldName("method");if(!e)return;let n=t.childForFieldName("receiver");return n?{isMethodCall:!0,methodName:e.text,objectName:n.text}:{isMethodCall:!1,methodName:e.text}}function U(t){let e=t.type,o=t.childForFieldName("name")?.text||"";if(e===l.MEMBER_CALL_EXPRESSION){let i=t.childForFieldName("object");return{isMethodCall:!0,methodName:o,objectName:i?.text}}if(e===l.SCOPED_CALL_EXPRESSION){let i=t.childForFieldName("scope");return{isMethodCall:!0,methodName:o,objectName:i?.text}}return{isMethodCall:!1,methodName:o}}function Et(t){let e=t.childForFieldName("function")||t.namedChildren[0];if(e&&e.type===l.MEMBER_ACCESS_EXPRESSION){let n=e.childForFieldName("name"),o=e.childForFieldName("expression");if(n)return{isMethodCall:!0,methodName:n.text,objectName:o?.text}}if(e)return{isMethodCall:!1,methodName:e.text}}function Nt(t){let e=t.childForFieldName("type");return{isMethodCall:!0,methodName:Ae,objectName:e?.text}}var an={[l.CALL_EXPRESSION]:it,[l.CALL]:st,[l.METHOD_INVOCATION]:at,[l.EXPLICIT_CONSTRUCTOR_INVOCATION]:ct,[l.COMMAND_CALL]:lt,[l.FUNCTION_CALL_EXPRESSION]:U,[l.MEMBER_CALL_EXPRESSION]:U,[l.SCOPED_CALL_EXPRESSION]:U,[l.INVOCATION_EXPRESSION]:Et,[l.OBJECT_CREATION_EXPRESSION]:Nt};var It=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,L=class t extends Date{#t=!1;#n=!1;#e=null;constructor(e){let n=!0,o=!0,i="Z";if(typeof e=="string"){let s=e.match(It);s?(s[1]||(n=!1,e=`0000-01-01T${e}`),o=!!s[2],o&&e[10]===" "&&(e=e.replace(" ","T")),s[2]&&+s[2]>23?e="":(i=s[3]||null,e=e.toUpperCase(),!i&&o&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=n,this.#n=o,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 n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,n="Z"){let o=new t(e);return o.#e=n,o}static wrapAsLocalDateTime(e){let n=new t(e);return n.#e=null,n}static wrapAsLocalDate(e){let n=new t(e);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(e){let n=new t(e);return n.#t=!1,n.#e=null,n}};function ft(t,e){let n=t.slice(0,e).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function ut(t,e,n){let o=t.split(/\r\n|\n|\r/g),i="",s=(Math.log10(e+1)|0)+1;for(let a=e-1;a<=e+1;a++){let E=o[a-1];E&&(i+=a.toString().padEnd(s," "),i+=": ",i+=E,i+=`
|
|
3
3
|
`,a===e&&(i+=" ".repeat(s+n+2),i+=`^
|
|
4
4
|
`))}return i}var f=class extends Error{line;column;codeblock;constructor(e,n){let[o,i]=ft(n.toml,n.ptr),s=ut(n.toml,o,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-HMNSKM6W.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{Ba as n,Ma as t,ea as e,ia as o}from"./chunk-RRS2FFZT.js";var _=".github",u=".claude",d="hooks.json",O="settings.json",E=".cursor/mcp.json",h="claude_desktop_config.json",x="docuvia-local",A="copilot-instructions.md",N="CLAUDE.md",R=".cursorrules",r="docuvia:start",g="docuvia:end",S=".windsurfrules",I="llms.txt",L="AGENTS.md",C=".hermes.md",m=".continue/rules",f="docuvia.md",T="Cursor",U="Claude",M="GitHub Copilot",D="Codex",y="Continue",F="Hermes Agent",b="cursor",v="claude",P="copilot",G="codex",w="continue",H="hermes",K="${CLAUDE_PLUGIN_ROOT}/hooks",k="${CURSOR_PLUGIN_ROOT}/hooks",J="${CLAUDE_PROJECT_DIR}/"+t,q="npx",V="-y",$="--no-install",j=["docuvia","mcp"],X="DOCUVIA_WORKSPACE_ROOT",B=`#!/usr/bin/env node
|
|
3
3
|
/**
|
|
4
4
|
* Docuvia Agent Hook
|
|
5
5
|
* Intercepts AI searches and augments with high-density AST context from local SQLite.
|
|
@@ -79,4 +79,4 @@ Run: \`npx --no-install docuvia analyze <file> --agent-authored --stage\`
|
|
|
79
79
|
Pipe a JSON payload on stdin (default) \u2014 \`{"decisions":[{"title":string,"content":string,"nodeType":"change"|"rule"|"decision"|"context","confidence":number}]}\` \u2014 or pass \`--decisions-file=<path>\` instead. Put \`--agent-authored\`/\`--stage\` after the positional \`<file>\`, not before \u2014 a flag preceding the path silently swallows it as the flag's own value. Staged decisions flush into the knowledge graph automatically the next time you commit a change touching that file \u2014 nothing else to run.
|
|
80
80
|
<!-- docuvia:end -->
|
|
81
81
|
`;export{_ as a,u as b,d as c,O as d,E as e,h as f,x as g,A as h,N as i,R as j,r as k,g as l,S as m,I as n,L as o,C as p,m as q,f as r,T as s,U as t,M as u,D as v,y as w,F as x,b as y,v as z,P as A,G as B,w as C,H as D,K as E,k as F,J as G,q as H,V as I,$ as J,j as K,X as L,B as M,s as N,W as O,z as P};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-NKKCG232.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 d="ipc-log",te=new Set(Object.values(a));function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function R(e){if(!v(e))return!1;let{type:t,level:n,message:o,context:i}=e;return t===d&&typeof n=="string"&&te.has(n)&&typeof o=="string"&&(i===void 0||v(i))}var C=class{constructor(t){this.postMessageFn=t}postMessageFn;debug(t,n){this.send(a.DEBUG,t,n)}info(t,n){this.send(a.INFO,t,n)}warn(t,n){this.send(a.WARN,t,n)}error(t,n){this.send(a.ERROR,t,n)}onLog(){return()=>{}}send(t,n,o){let i=o?{type:d,level:t,message:n,context:o}:{type:d,level:t,message:n};this.postMessageFn(i)}};var y={CONTEXT_INJECTION:"context-injection",COMMIT_L3_WRITE:"commit-l3-write",TIER_B_C_PREPUSH:"tier-b-c-prepush"},ne={[y.CONTEXT_INJECTION]:!0,[y.COMMIT_L3_WRITE]:!0,[y.TIER_B_C_PREPUSH]:!0};var f=".docuvia",oe="logs",re="init.log",ie="clean.log",se="status.log",ae="sync.log",le="analyze.log",ce="review.log",de="impact.log",pe="query.log",ue="export-topology.log",ge="snapshot.log",ye="hydrate.log",me="sync-knowledge.log",A="node_modules",Se="local.db",Ee="init.lock",_e="tierC.lock",Re="sync-state.json",Ce="hooks-config.json",fe="pending-l3-decisions.json";var Ae="utf8";var Te="sha256";var s={TYPESCRIPT:"typescript",JAVASCRIPT:"javascript",PYTHON:"python",RUST:"rust",GO:"go",JAVA:"java",C:"c",CPP:"cpp",RUBY:"ruby",PHP:"php",CSHARP:"csharp"};var x=".claude/hooks",P=".cursor/hooks",b="docuvia-hook.js",M="docuvia-hook.cjs";var Ie=[`${x}/${b}`,`${P}/${M}`];function T(e){let t=e.replaceAll("\\","/");return Ie.includes(t)}var Le="EEXIST",Ne="ENOENT",Oe="EPERM",he="EACCES",De="EBUSY",ve="win32";var p=class{listeners=new Set;debug(t,n){this.emit(a.DEBUG,t,n)}info(t,n){this.emit(a.INFO,t,n)}warn(t,n){this.emit(a.WARN,t,n)}error(t,n){this.emit(a.ERROR,t,n)}onLog(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(t,n,o){let i=o?{level:t,message:n,context:o}:{level:t,message:n};for(let u of this.listeners)u(i)}};function xe(){return new p}var I=class{constructor(t){this.logger=t}logger;handleMessage(t){return R(t)?(this.logger[t.level](t.message,t.context),!0):!1}};var c={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",CALL_RESOLUTION_PROJECTION_SOURCE_MISSING:"CALL_RESOLUTION_PROJECTION_SOURCE_MISSING",CALL_RESOLUTION_QUARANTINE_UNAVAILABLE:"CALL_RESOLUTION_QUARANTINE_UNAVAILABLE",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",SEMANTIC_CORPUS_LEAKAGE:"SEMANTIC_CORPUS_LEAKAGE",SEMANTIC_CORPUS_IO_FAILED:"SEMANTIC_CORPUS_IO_FAILED",SEMANTIC_CORPUS_INVALID:"SEMANTIC_CORPUS_INVALID",SEMANTIC_INVALID_REQUEST:"SEMANTIC_INVALID_REQUEST",SEMANTIC_INVALID_RESPONSE:"SEMANTIC_INVALID_RESPONSE",SEMANTIC_INPUT_LIMIT_EXCEEDED:"SEMANTIC_INPUT_LIMIT_EXCEEDED",SEMANTIC_CANCELLED:"SEMANTIC_CANCELLED",SEMANTIC_DEADLINE_EXCEEDED:"SEMANTIC_DEADLINE_EXCEEDED",SEMANTIC_INFERENCE_FAILED:"SEMANTIC_INFERENCE_FAILED",INIT_WORKFLOW_FAILED:"INIT_WORKFLOW_FAILED",CLEAN_WORKFLOW_FAILED:"CLEAN_WORKFLOW_FAILED",UNINSTALL_WORKFLOW_FAILED:"UNINSTALL_WORKFLOW_FAILED",INVALID_INPUT:"INVALID_INPUT"};var Pe="DocuviaError",l=class e extends Error{code;cause;constructor(t,n,o){super(n),this.name=Pe,this.code=t,this.cause=o}static wrap(t,n,o){if(o instanceof e)return o;let i=o instanceof Error?o.message:String(o);return new e(t,`${n}: ${i}`,o)}};var be={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",HEAD_REF:"headRef",TARGET:"target",ESCALATE_TO_LSP:"escalateToLsp",TIER_B_FULL_RESYNC:"tierBFullResync",LIMIT:"limit",EXPLAIN_RESOLUTION:"explainResolution",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"},Me={SCOPE_NOT_FOUND:(e,t)=>`Cannot set "${e}": memory scope "${t}" was never created`},m=class{scopes=new Map;createScope(t){this.scopes.has(t)||this.scopes.set(t,new Map)}set(t,n,o){let i=this.scopes.get(t);if(!i)throw new l(c.MEMORY_SCOPE_NOT_FOUND,Me.SCOPE_NOT_FOUND(n,t));i.set(n,o)}get(t,n){return this.scopes.get(t)?.get(n)}deleteScope(t){this.scopes.delete(t)}hasScope(t){return this.scopes.has(t)}},Fe=new m;var F={REGISTER_LOCKED:e=>`Cannot register "${e}": factory is locked (test isolation)`,PROVIDER_NOT_REGISTERED:e=>`No provider registered for "${e}" \u2014 the implementation library that owns it was never imported for its registration side effect`},S=class{providers=new Map;locked=!1;register(t,n){if(this.locked)throw new l(c.FACTORY_LOCKED,F.REGISTER_LOCKED(String(t.description)));this.providers.set(t,n)}resolve(t,n){let o=this.providers.get(t);if(!o)throw new l(c.FACTORY_TOKEN_NOT_REGISTERED,F.PROVIDER_NOT_REGISTERED(String(t.description)));return o(this,n)}has(t){return this.providers.has(t)}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.providers.clear(),this.locked=!1}},k=new S;function r(e){return Symbol(e)}var ke={HostEnvironment:r("HostEnvironmentSnapshot"),GitProvider:r("IGitProvider"),LineBlameProvider:r("ILineBlameProvider"),KnowledgeGitService:r("IKnowledgeGitService"),FileDiscovery:r("IFileDiscovery"),ConfigScanner:r("IConfigScanner"),VcsScanner:r("IVcsScanner"),AstProcessor:r("IAstProcessor"),GraphPersister:r("IGraphPersister"),TempFileManager:r("TempFileManager"),GraphStoreOpener:r("GraphStoreOpener"),ProcessLock:r("ProcessLock"),RemoteSyncClient:r("RemoteSyncClient"),LlmClient:r("LlmClient"),QueryService:r("IQueryService"),TierBCoverageHintProvider:r("ITierBCoverageHintProvider"),ImpactService:r("IImpactService"),ChangeDetectionService:r("IChangeDetectionService"),TopologyBuilder:r("ITopologyBuilder"),SnapshotRenderer:r("ISnapshotRenderer"),HydrationService:r("IHydrationService"),DiagnosticRunnerDb:r("DiagnosticRunnerDb"),DiagnosticRunnerGit:r("DiagnosticRunnerGit"),SemanticDiffAnalyzer:r("ISemanticDiffAnalyzer"),SemanticCorpusService:r("ISemanticCorpusService"),SemanticDecisionValidator:r("ISemanticDecisionValidator"),SemanticDecisionProvider:r("ISemanticDecisionProvider"),CallResolutionHypothesisService:r("ICallResolutionHypothesisService"),EdgeResolutionProviders:r("EdgeResolutionProviders")};var we={ADDED:"added",MODIFIED:"modified",DELETED:"deleted",RENAMED:"renamed"};var Ue={LSP:"lsp",LLM_INFERRED:"llm-inferred"},He={TYPESCRIPT:"typescript",PYTHON:"python",GO:"go",RUST:"rust",JAVA:"java",CPP:"cpp",CSHARP:"csharp",PHP:"php",RUBY:"ruby"};var Ke={EDGE_RELATION:"edge-relation",IMPACT_RELEVANCE:"impact-relevance",NEEDS_VERIFICATION:"needs-verification"};var Ge={CANDIDATE:"candidate",UNKNOWN:"unknown",VERIFY:"verify"},Be=1,Ve={MAX_CANDIDATES:32,MAX_OPTIONS:34,MAX_INPUT_BYTES:32*1024},je={SCORED:"scored",UNAVAILABLE:"unavailable"},Ye={RAW:"raw",CALIBRATED:"calibrated"},Qe={MODEL_NOT_INSTALLED:"model-not-installed",UNSUPPORTED_CAPABILITY:"unsupported-capability"};var qe={NO_REMOTE:"no-remote",UP_TO_DATE:"up-to-date",FAST_FORWARDED_LOCAL:"fast-forwarded-local",PUSHED_LOCAL:"pushed-local",MERGED:"merged"};import{createHash as We}from"crypto";function Xe(e){let t=Je(e.filePath);if(!/^[a-f0-9]{64}$/.test(e.sourceContentHash))throw new Error("Call-site source content hash must be a lowercase SHA-256 hex digest");if(!Number.isSafeInteger(e.startLine)||e.startLine<0)throw new Error("Call-site start line must be a non-negative zero-based integer");if(!Number.isSafeInteger(e.startColumn)||e.startColumn<0)throw new Error("Call-site start column must be a non-negative zero-based integer");if(!w(e.calleeKind))throw new Error("Call-site callee kind must be a non-empty string without NUL bytes");if(!w(e.calleeName))throw new Error("Call-site callee name must be a non-empty string without NUL bytes");return`call-site:v1:${We("sha256").update([t,e.sourceContentHash,String(e.startLine),String(e.startColumn),e.calleeKind,e.calleeName].join("\0"),"utf8").digest("hex")}`}function Je(e){if(typeof e!="string")throw new Error("Call-site path must be a workspace-relative POSIX path");if([e.length===0,e.endsWith("/"),e.startsWith("/"),/^[a-zA-Z]:/.test(e),e.includes("\\"),e.includes("\0")].some(Boolean))throw new Error("Call-site path must be a workspace-relative POSIX path");let n=[];for(let o of e.split("/"))if(!(!o||o===".")){if(o!==".."){n.push(o);continue}if(n.length===0)throw new Error("Call-site path must be a workspace-relative POSIX path");n.pop()}if(n.length===0)throw new Error("Call-site path must be a workspace-relative POSIX path");return n.join("/")}function w(e){return typeof e=="string"&&e.trim().length>0&&!e.includes("\0")}var ze="declared-member-hypothesis-v7",$e="ordered-evidence-v1";var Ze="q2:reexport-trace:v1",et="q3:super-call:v1",tt="q3:this-inherited:v1",nt="q3:typed-receiver:v1",ot="q3:new-receiver:v1";var rt="17f29ba13f08a288186c7bdbed2651248664643f98613df8d3087aade7b4f768";var it={MODULE:"module",PACKAGE:"package",PCD:"pcd"},st={CONTAINS:"contains",CALLS:"calls",IMPLEMENTS:"implements",EXTENDS:"extends",IMPORTS:"imports",DEPENDS_ON:"depends_on",DECISION:"decision"},L={CHANGE:"change",RULE:"rule",DECISION:"decision",CONTEXT:"context"},at={PENDING:"pending",ACTIVE:"active",DRAFT:"draft",GARBAGE:"garbage"},lt={ANALYZE:"analyze",AGENT_AUTHORED:"agent-authored"},ct={PROVEN:"proven",LIKELY:"likely",AMBIGUOUS:"ambiguous",UNRESOLVED:"unresolved",EXTERNAL:"external",UNSUPPORTED:"unsupported"},dt={TIER_B_TARGET_MISMATCH:"tier-b-target-mismatch"},pt={UNVERIFIED:"unverified",VERIFIED:"verified",CONTRADICTED:"contradicted"},ut="sha256-callsite-rule-v2",gt={SCOPE_RESOLVER:"scope-resolver",STRICT_PROOF:"strict-proof",HYPOTHESIS:"hypothesis",TIER_B:"tier-b"};var yt=L,mt={AUTO_FULL_INGESTION:"autoFullIngestion",AUTO_DELTA:"autoDelta",AUTO_DELTA_NOOP:"autoDeltaNoop",DECISION_EXTRACTION:"decisionExtraction",TIER_B_BATCH:"tierBBatch",FLUSH_STAGED_L3:"flushStagedL3"},St={NO_GRAPH:"no-graph",ANCHOR_NOT_IN_GRAPH:"anchor-not-in-graph"};var Et={CREATE_L3:"CREATE_L3"};var _t={SYSTEM:"system",USER:"user",ASSISTANT:"assistant",TOOL:"tool"},Rt="function";var Ct={LOW:"LOW",MEDIUM:"MEDIUM",HIGH:"HIGH",CRITICAL:"CRITICAL",UNKNOWN:"UNKNOWN"},ft={EXACT:"exact",LOWER_BOUND:"lower-bound"},At={BOUNDED:"bounded",UNRESOLVED:"unresolved"},Tt={DYNAMIC_IMPORT:"dynamic-import"},It={CORRUPT_JSON:"corrupt-json",NOT_ARRAY:"not-array",INVALID_RECORD:"invalid-record",MISSING:"missing",INCOMPLETE_SCAN:"incomplete-scan"},Lt={AVAILABLE:"available",UNAVAILABLE:"unavailable"},Nt={LSP_FALLBACK:"lsp-fallback",DYNAMIC_CANDIDATE:"dynamic-candidate"};var Ot={L2:"l2",L3:"l3"};var ht={FILE:"file",SYMBOL:"symbol",DECISION:"decision"},Dt={AUTO:"auto",FILE:"file",SYMBOL:"symbol"},vt={L1_TAG:"l1_tag",DIRECTORY:"directory"};var E={COMMIT_MESSAGE:"commitMessage",CONTRACT_SYMBOL:"contractSymbol"};function xt(e){if(e===void 0)return Ft();let t;try{t=JSON.parse(e)}catch{return U()}if(!Array.isArray(t))return U();let n=[],o=0;for(let i of t)Pt(i)?n.push(i):o++;return{entries:n,invalidCount:o,corrupt:!1}}function Pt(e){return!bt(e)||typeof e.target!="string"||typeof e.commitSha!="string"||!Mt(e)?!1:e.kind===E.COMMIT_MESSAGE?typeof e.message=="string":e.kind===E.CONTRACT_SYMBOL?typeof e.file=="string":!1}function bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Mt(e){return e.failCount===void 0||typeof e.failCount=="number"&&Number.isInteger(e.failCount)&&e.failCount>=0}function Ft(){return{entries:[],invalidCount:0,corrupt:!1}}function U(){return{entries:[],invalidCount:0,corrupt:!0}}var kt={TYPESCRIPT:"typescript",REACT:"react",EXPRESS:"express",VUE:"vue"},wt={UNKNOWN:"unknown",JAVASCRIPT:"javascript",GENERIC:"generic",RUST:"rust",PYTHON:"python",GO:"go"},Ut="general",Ht={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 H="origin",N={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",METADATA_JSON_NAME:"metadata.json",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
|
|
2
|
+
var a={DEBUG:"debug",INFO:"info",WARN:"warn",ERROR:"error"};var d="ipc-log",te=new Set(Object.values(a));function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function R(e){if(!v(e))return!1;let{type:t,level:n,message:o,context:i}=e;return t===d&&typeof n=="string"&&te.has(n)&&typeof o=="string"&&(i===void 0||v(i))}var C=class{constructor(t){this.postMessageFn=t}postMessageFn;debug(t,n){this.send(a.DEBUG,t,n)}info(t,n){this.send(a.INFO,t,n)}warn(t,n){this.send(a.WARN,t,n)}error(t,n){this.send(a.ERROR,t,n)}onLog(){return()=>{}}send(t,n,o){let i=o?{type:d,level:t,message:n,context:o}:{type:d,level:t,message:n};this.postMessageFn(i)}};var y={CONTEXT_INJECTION:"context-injection",COMMIT_L3_WRITE:"commit-l3-write",TIER_B_C_PREPUSH:"tier-b-c-prepush"},ne={[y.CONTEXT_INJECTION]:!0,[y.COMMIT_L3_WRITE]:!0,[y.TIER_B_C_PREPUSH]:!0};var f=".docuvia",oe="logs",re="init.log",ie="clean.log",se="status.log",ae="sync.log",le="analyze.log",ce="review.log",de="impact.log",pe="query.log",ue="export-topology.log",ge="snapshot.log",ye="hydrate.log",me="sync-knowledge.log",A="node_modules",Se="local.db",Ee="init.lock",_e="tierC.lock",Re="sync-state.json",Ce="hooks-config.json",fe="pending-l3-decisions.json";var Ae="utf8";var Te="sha256";var s={TYPESCRIPT:"typescript",JAVASCRIPT:"javascript",PYTHON:"python",RUST:"rust",GO:"go",JAVA:"java",C:"c",CPP:"cpp",RUBY:"ruby",PHP:"php",CSHARP:"csharp"};var x=".claude/hooks",P=".cursor/hooks",b="docuvia-hook.js",M="docuvia-hook.cjs";var Ie=[`${x}/${b}`,`${P}/${M}`];function T(e){let t=e.replaceAll("\\","/");return Ie.includes(t)}var Le="EEXIST",Ne="ENOENT",Oe="EPERM",he="EACCES",De="EBUSY",ve="win32";var p=class{listeners=new Set;debug(t,n){this.emit(a.DEBUG,t,n)}info(t,n){this.emit(a.INFO,t,n)}warn(t,n){this.emit(a.WARN,t,n)}error(t,n){this.emit(a.ERROR,t,n)}onLog(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(t,n,o){let i=o?{level:t,message:n,context:o}:{level:t,message:n};for(let u of this.listeners)u(i)}};function xe(){return new p}var I=class{constructor(t){this.logger=t}logger;handleMessage(t){return R(t)?(this.logger[t.level](t.message,t.context),!0):!1}};var c={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",CALL_RESOLUTION_PROJECTION_SOURCE_MISSING:"CALL_RESOLUTION_PROJECTION_SOURCE_MISSING",CALL_RESOLUTION_QUARANTINE_UNAVAILABLE:"CALL_RESOLUTION_QUARANTINE_UNAVAILABLE",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",SEMANTIC_CORPUS_LEAKAGE:"SEMANTIC_CORPUS_LEAKAGE",SEMANTIC_CORPUS_IO_FAILED:"SEMANTIC_CORPUS_IO_FAILED",SEMANTIC_CORPUS_INVALID:"SEMANTIC_CORPUS_INVALID",SEMANTIC_INVALID_REQUEST:"SEMANTIC_INVALID_REQUEST",SEMANTIC_INVALID_RESPONSE:"SEMANTIC_INVALID_RESPONSE",SEMANTIC_INPUT_LIMIT_EXCEEDED:"SEMANTIC_INPUT_LIMIT_EXCEEDED",SEMANTIC_CANCELLED:"SEMANTIC_CANCELLED",SEMANTIC_DEADLINE_EXCEEDED:"SEMANTIC_DEADLINE_EXCEEDED",SEMANTIC_INFERENCE_FAILED:"SEMANTIC_INFERENCE_FAILED",INIT_WORKFLOW_FAILED:"INIT_WORKFLOW_FAILED",CLEAN_WORKFLOW_FAILED:"CLEAN_WORKFLOW_FAILED",UNINSTALL_WORKFLOW_FAILED:"UNINSTALL_WORKFLOW_FAILED",INVALID_INPUT:"INVALID_INPUT"};var Pe="DocuviaError",l=class e extends Error{code;cause;constructor(t,n,o){super(n),this.name=Pe,this.code=t,this.cause=o}static wrap(t,n,o){if(o instanceof e)return o;let i=o instanceof Error?o.message:String(o);return new e(t,`${n}: ${i}`,o)}};var be={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",HEAD_REF:"headRef",TARGET:"target",ESCALATE_TO_LSP:"escalateToLsp",TIER_B_FULL_RESYNC:"tierBFullResync",LIMIT:"limit",EXPLAIN_RESOLUTION:"explainResolution",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"},Me={SCOPE_NOT_FOUND:(e,t)=>`Cannot set "${e}": memory scope "${t}" was never created`},m=class{scopes=new Map;createScope(t){this.scopes.has(t)||this.scopes.set(t,new Map)}set(t,n,o){let i=this.scopes.get(t);if(!i)throw new l(c.MEMORY_SCOPE_NOT_FOUND,Me.SCOPE_NOT_FOUND(n,t));i.set(n,o)}get(t,n){return this.scopes.get(t)?.get(n)}deleteScope(t){this.scopes.delete(t)}hasScope(t){return this.scopes.has(t)}},Fe=new m;var F={REGISTER_LOCKED:e=>`Cannot register "${e}": factory is locked (test isolation)`,PROVIDER_NOT_REGISTERED:e=>`No provider registered for "${e}" \u2014 the implementation library that owns it was never imported for its registration side effect`},S=class{providers=new Map;locked=!1;register(t,n){if(this.locked)throw new l(c.FACTORY_LOCKED,F.REGISTER_LOCKED(String(t.description)));this.providers.set(t,n)}resolve(t,n){let o=this.providers.get(t);if(!o)throw new l(c.FACTORY_TOKEN_NOT_REGISTERED,F.PROVIDER_NOT_REGISTERED(String(t.description)));return o(this,n)}has(t){return this.providers.has(t)}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.providers.clear(),this.locked=!1}},k=new S;function r(e){return Symbol(e)}var ke={HostEnvironment:r("HostEnvironmentSnapshot"),GitProvider:r("IGitProvider"),LineBlameProvider:r("ILineBlameProvider"),KnowledgeGitService:r("IKnowledgeGitService"),FileDiscovery:r("IFileDiscovery"),ConfigScanner:r("IConfigScanner"),VcsScanner:r("IVcsScanner"),AstProcessor:r("IAstProcessor"),GraphPersister:r("IGraphPersister"),TempFileManager:r("TempFileManager"),GraphStoreOpener:r("GraphStoreOpener"),ProcessLock:r("ProcessLock"),RemoteSyncClient:r("RemoteSyncClient"),LlmClient:r("LlmClient"),QueryService:r("IQueryService"),TierBCoverageHintProvider:r("ITierBCoverageHintProvider"),ImpactService:r("IImpactService"),ChangeDetectionService:r("IChangeDetectionService"),TopologyBuilder:r("ITopologyBuilder"),SnapshotRenderer:r("ISnapshotRenderer"),HydrationService:r("IHydrationService"),DiagnosticRunnerDb:r("DiagnosticRunnerDb"),DiagnosticRunnerGit:r("DiagnosticRunnerGit"),SemanticDiffAnalyzer:r("ISemanticDiffAnalyzer"),SemanticCorpusService:r("ISemanticCorpusService"),SemanticDecisionValidator:r("ISemanticDecisionValidator"),SemanticDecisionProvider:r("ISemanticDecisionProvider"),CallResolutionHypothesisService:r("ICallResolutionHypothesisService"),EdgeResolutionProviders:r("EdgeResolutionProviders")};var Ue={ADDED:"added",MODIFIED:"modified",DELETED:"deleted",RENAMED:"renamed"};var we={LSP:"lsp",LLM_INFERRED:"llm-inferred"},He={TYPESCRIPT:"typescript",PYTHON:"python",GO:"go",RUST:"rust",JAVA:"java",CPP:"cpp",CSHARP:"csharp",PHP:"php",RUBY:"ruby"};var Ge={EDGE_RELATION:"edge-relation",IMPACT_RELEVANCE:"impact-relevance",NEEDS_VERIFICATION:"needs-verification"};var Ke={CANDIDATE:"candidate",UNKNOWN:"unknown",VERIFY:"verify"},Be=1,Ve={MAX_CANDIDATES:32,MAX_OPTIONS:34,MAX_INPUT_BYTES:32*1024},je={SCORED:"scored",UNAVAILABLE:"unavailable"},Ye={RAW:"raw",CALIBRATED:"calibrated"},Qe={MODEL_NOT_INSTALLED:"model-not-installed",UNSUPPORTED_CAPABILITY:"unsupported-capability"};var qe={NO_REMOTE:"no-remote",UP_TO_DATE:"up-to-date",FAST_FORWARDED_LOCAL:"fast-forwarded-local",PUSHED_LOCAL:"pushed-local",MERGED:"merged"};import{createHash as We}from"crypto";function Xe(e){let t=Je(e.filePath);if(!/^[a-f0-9]{64}$/.test(e.sourceContentHash))throw new Error("Call-site source content hash must be a lowercase SHA-256 hex digest");if(!Number.isSafeInteger(e.startLine)||e.startLine<0)throw new Error("Call-site start line must be a non-negative zero-based integer");if(!Number.isSafeInteger(e.startColumn)||e.startColumn<0)throw new Error("Call-site start column must be a non-negative zero-based integer");if(!U(e.calleeKind))throw new Error("Call-site callee kind must be a non-empty string without NUL bytes");if(!U(e.calleeName))throw new Error("Call-site callee name must be a non-empty string without NUL bytes");return`call-site:v1:${We("sha256").update([t,e.sourceContentHash,String(e.startLine),String(e.startColumn),e.calleeKind,e.calleeName].join("\0"),"utf8").digest("hex")}`}function Je(e){if(typeof e!="string")throw new Error("Call-site path must be a workspace-relative POSIX path");if([e.length===0,e.endsWith("/"),e.startsWith("/"),/^[a-zA-Z]:/.test(e),e.includes("\\"),e.includes("\0")].some(Boolean))throw new Error("Call-site path must be a workspace-relative POSIX path");let n=[];for(let o of e.split("/"))if(!(!o||o===".")){if(o!==".."){n.push(o);continue}if(n.length===0)throw new Error("Call-site path must be a workspace-relative POSIX path");n.pop()}if(n.length===0)throw new Error("Call-site path must be a workspace-relative POSIX path");return n.join("/")}function U(e){return typeof e=="string"&&e.trim().length>0&&!e.includes("\0")}var ze="declared-member-hypothesis-v7",$e="ordered-evidence-v1";var Ze="q1:named-import:v1",et="q2:reexport-trace:v1",tt="q3:super-call:v1",nt="q3:this-inherited:v1",ot="q3:typed-receiver:v1",rt="q3:new-receiver:v1";var it="17f29ba13f08a288186c7bdbed2651248664643f98613df8d3087aade7b4f768";var st={MODULE:"module",PACKAGE:"package",PCD:"pcd"},at={CONTAINS:"contains",CALLS:"calls",IMPLEMENTS:"implements",EXTENDS:"extends",IMPORTS:"imports",DEPENDS_ON:"depends_on",DECISION:"decision"},L={CHANGE:"change",RULE:"rule",DECISION:"decision",CONTEXT:"context"},lt={PENDING:"pending",ACTIVE:"active",DRAFT:"draft",GARBAGE:"garbage"},ct={ANALYZE:"analyze",AGENT_AUTHORED:"agent-authored"},dt={PROVEN:"proven",LIKELY:"likely",AMBIGUOUS:"ambiguous",UNRESOLVED:"unresolved",EXTERNAL:"external",UNSUPPORTED:"unsupported"},pt={TIER_B_TARGET_MISMATCH:"tier-b-target-mismatch"},ut={UNVERIFIED:"unverified",VERIFIED:"verified",CONTRADICTED:"contradicted"},gt="sha256-callsite-rule-v2",yt={SCOPE_RESOLVER:"scope-resolver",STRICT_PROOF:"strict-proof",HYPOTHESIS:"hypothesis",TIER_B:"tier-b"};var mt=L,St={AUTO_FULL_INGESTION:"autoFullIngestion",AUTO_DELTA:"autoDelta",AUTO_DELTA_NOOP:"autoDeltaNoop",DECISION_EXTRACTION:"decisionExtraction",TIER_B_BATCH:"tierBBatch",FLUSH_STAGED_L3:"flushStagedL3"},Et={NO_GRAPH:"no-graph",ANCHOR_NOT_IN_GRAPH:"anchor-not-in-graph"};var _t={CREATE_L3:"CREATE_L3"};var Rt={SYSTEM:"system",USER:"user",ASSISTANT:"assistant",TOOL:"tool"},Ct="function";var ft={LOW:"LOW",MEDIUM:"MEDIUM",HIGH:"HIGH",CRITICAL:"CRITICAL",UNKNOWN:"UNKNOWN"},At={EXACT:"exact",LOWER_BOUND:"lower-bound"},Tt={BOUNDED:"bounded",UNRESOLVED:"unresolved"},It={DYNAMIC_IMPORT:"dynamic-import"},Lt={CORRUPT_JSON:"corrupt-json",NOT_ARRAY:"not-array",INVALID_RECORD:"invalid-record",MISSING:"missing",INCOMPLETE_SCAN:"incomplete-scan"},Nt={AVAILABLE:"available",UNAVAILABLE:"unavailable"},Ot={LSP_FALLBACK:"lsp-fallback",DYNAMIC_CANDIDATE:"dynamic-candidate"};var ht={L2:"l2",L3:"l3"};var Dt={FILE:"file",SYMBOL:"symbol",DECISION:"decision"},vt={AUTO:"auto",FILE:"file",SYMBOL:"symbol"},xt={L1_TAG:"l1_tag",DIRECTORY:"directory"};var E={COMMIT_MESSAGE:"commitMessage",CONTRACT_SYMBOL:"contractSymbol"};function Pt(e){if(e===void 0)return kt();let t;try{t=JSON.parse(e)}catch{return w()}if(!Array.isArray(t))return w();let n=[],o=0;for(let i of t)bt(i)?n.push(i):o++;return{entries:n,invalidCount:o,corrupt:!1}}function bt(e){return!Mt(e)||typeof e.target!="string"||typeof e.commitSha!="string"||!Ft(e)?!1:e.kind===E.COMMIT_MESSAGE?typeof e.message=="string":e.kind===E.CONTRACT_SYMBOL?typeof e.file=="string":!1}function Mt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ft(e){return e.failCount===void 0||typeof e.failCount=="number"&&Number.isInteger(e.failCount)&&e.failCount>=0}function kt(){return{entries:[],invalidCount:0,corrupt:!1}}function w(){return{entries:[],invalidCount:0,corrupt:!0}}var Ut={TYPESCRIPT:"typescript",REACT:"react",EXPRESS:"express",VUE:"vue"},wt={UNKNOWN:"unknown",JAVASCRIPT:"javascript",GENERIC:"generic",RUST:"rust",PYTHON:"python",GO:"go"},Ht="general",Gt={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 H="origin",N={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",METADATA_JSON_NAME:"metadata.json",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 _ from"path";var
|
|
98
|
-
`)){let n=t.trim();if(n.startsWith($))return n.slice($.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 _ from"path";var G=[".ts",".tsx",".mts",".cts"],K=[".js",".jsx",".mjs",".cjs"],B=[".py"],V=[".rs"],j=[".go"],Y=[".java"],Q=[".c",".h"],q=[".cpp",".cxx",".cc",".hpp",".hxx",".hh",".cu",".cuh"],W=[".rb",".rake",".gemspec"],X=[".php",".phtml",".php3",".php4",".php5",".phps"],J=[".cs"],O=new Set(["Rakefile","Gemfile","Guardfile","Vagrantfile","Brewfile"]),h=(()=>{let e=new Map,t=[[s.TYPESCRIPT,G],[s.JAVASCRIPT,K],[s.PYTHON,B],[s.RUST,V],[s.GO,j],[s.JAVA,Y],[s.C,Q],[s.CPP,q],[s.RUBY,W],[s.PHP,X],[s.CSHARP,J]];for(let[n,o]of t)for(let i of o)e.set(i,n);return e})();function Kt(e){let t=h.get(_.extname(e).toLowerCase());return t||(O.has(_.basename(e))?s.RUBY:void 0)}function z(e){return h.has(_.extname(e).toLowerCase())?!0:O.has(_.basename(e))}function Bt(){return Array.from(h.keys()).map(e=>e.replace(/^\./,""))}function Vt(e){return!T(e)&&z(e)&&!e.includes(`${A}/`)&&!e.includes(`${f}/`)}var jt="call-sites.jsonl";var Yt="call-resolutions.jsonl",Qt="impact.dynamic-dependencies.v1:",qt="snapshot.call-sites.availability.v1:",Wt={AVAILABLE:"available",UNAVAILABLE:"unavailable"},Xt="snapshot-call-sites-unavailable",Jt="snapshot.call-resolutions.availability.v1:",zt={AVAILABLE:"available",UNAVAILABLE:"unavailable"};var $t={TIMED_OUT_WAITING:e=>`Timed out waiting for the lock at ${e} \u2014 another process may be stuck`},D=class extends Error{constructor(t){super($t.TIMED_OUT_WAITING(t)),this.name="ProcessLockTimeoutError"}};var $=`${N.SOURCE_COMMIT_TRAILER_KEY}: `;function Zt(e){for(let t of e.split(`
|
|
98
|
+
`)){let n=t.trim();if(n.startsWith($))return n.slice($.length).trim()}}function en(e,t,n,o){if(!n&&!o)return;let u=(t?e.files.getTierBFileStatus(t):void 0)?.lastProcessedAt??null,Z=o&&u===null,g=e.files.getTierBCoverage(),ee=n&&g.processedFiles<g.totalFiles;if(!(!Z&&!ee))return{ownFileLastProcessedAt:u,workspaceFilesProcessed:g.processedFiles,workspaceFilesTotal:g.totalFiles}}function tn(e){let t={total:0,resolved:0,selfDiscarded:0,unresolved:0,unresolvable:0,external:0,unknownReceiver:0};for(let n of Object.values(e))t.total+=n.total,t.resolved+=n.resolved,t.selfDiscarded+=n.selfDiscarded,t.unresolvable=(t.unresolvable??0)+(n.unresolvable??0),t.external=(t.external??0)+(n.external??0),t.unknownReceiver=(t.unknownReceiver??0)+(n.unknownReceiver??0),t.unresolved+=n.unresolved;return t}function nn(e){return e.total-e.selfDiscarded-(e.unresolvable??0)-(e.external??0)-(e.unknownReceiver??0)}var on={PASS:"pass",FAIL:"fail"};export{a,p as b,xe as c,C as d,I as e,c as f,l as g,be as h,Fe as i,k as j,ke as k,Ue as l,we as m,He as n,Ge as o,Ke as p,Be as q,Ve as r,je as s,Ye as t,Qe as u,qe as v,Xe as w,ze as x,$e as y,Ze as z,et as A,tt as B,nt as C,ot as D,rt as E,it as F,st as G,at as H,lt as I,ct as J,dt as K,pt as L,ut as M,gt as N,yt as O,mt as P,St as Q,Et as R,_t as S,Rt as T,Ct as U,ft as V,At as W,Tt as X,It as Y,Lt as Z,Nt as _,Ot as $,ht as aa,Dt as ba,vt as ca,xt as da,y as ea,ne as fa,E as ga,Pt as ha,f as ia,oe as ja,re as ka,ie as la,se as ma,ae as na,le as oa,ce as pa,de as qa,pe as ra,ue as sa,ge as ta,ye as ua,me as va,A as wa,Se as xa,Ee as ya,_e as za,Re as Aa,Ce as Ba,fe as Ca,Ut as Da,wt as Ea,Ht as Fa,Gt as Ga,Ae as Ha,Te as Ia,H as Ja,N as Ka,s as La,x as Ma,P as Na,b as Oa,M as Pa,T as Qa,G as Ra,K as Sa,B as Ta,V as Ua,j as Va,Y as Wa,Q as Xa,q as Ya,W as Za,X as _a,J as $a,O as ab,Kt as bb,z as cb,Bt as db,Vt as eb,jt as fb,Yt as gb,Qt as hb,qt as ib,Wt as jb,Xt as kb,Jt as lb,zt as mb,Le as nb,Ne as ob,Oe as pb,he as qb,De as rb,ve as sb,D as tb,Zt as ub,en as vb,tn as wb,nn as xb,on as yb};
|
|
99
|
+
//# sourceMappingURL=chunk-RRS2FFZT.js.map
|