docuvia 1.17.2 → 1.18.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.
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{Xa as u,sa as c}from"./chunk-HYERMOZO.js";import*as s from"fs/promises";import*as p from"path";import{select as P,confirm as b,input as H,checkbox as F}from"@inquirer/prompts";import Y from"picocolors";import M from"ora";var r={TOP_LEFT:"\u250C",TOP_RIGHT:"\u2510",BOTTOM_LEFT:"\u2514",BOTTOM_RIGHT:"\u2518",HORIZONTAL:"\u2500",VERTICAL:"\u2502",T_DOWN:"\u252C",T_UP:"\u2534",T_RIGHT:"\u251C",T_LEFT:"\u2524",CROSS:"\u253C"},w={PASS:"\u2713",FAIL:"\u2717"},N="\u25C6";var E={SPACE:" ",EMPTY:""};function L(e){return e.replace(/\s+/g,E.SPACE).trim()}function m(e,t){if(e.length<=t)return[e];let n=e.split(E.SPACE),i=[],o=E.EMPTY;for(let a of n){let A=o?`${o}${E.SPACE}${a}`:a;A.length>t&&o?(i.push(o),o=a):o=A}return o&&i.push(o),i}function U(e,t){return e+E.SPACE.repeat(Math.max(0,t-e.length))}function O(e,t,n,i){return t+e.map(o=>r.HORIZONTAL.repeat(o+2)).join(n)+i}function C(e,t){let n=e.map((i,o)=>U(i??E.EMPTY,t[o]));return`${r.VERTICAL} ${n.join(` ${r.VERTICAL} `)} ${r.VERTICAL}`}function f(e,t){return e.map((n,i)=>{let o=Math.max(n.header.length,...t.map(a=>(a[i]??E.EMPTY).length));return n.maxWidth?Math.min(o,n.maxWidth):o})}function D(e,t){let n=e.map(_=>L(_.header)),i=t.map(_=>_.map(d=>L(d??E.EMPTY))),o=f(e.map((_,d)=>({..._,header:n[d]})),i),a=i.map(_=>e.map((d,T)=>m(_[T]??E.EMPTY,o[T]))),A=[O(o,r.TOP_LEFT,r.T_DOWN,r.TOP_RIGHT),C(n,o),O(o,r.T_RIGHT,r.CROSS,r.T_LEFT)];for(let _ of a){let d=Math.max(..._.map(T=>T.length));for(let T=0;T<d;T++)A.push(C(_.map(h=>h[T]??E.EMPTY),o))}return A.push(O(o,r.BOTTOM_LEFT,r.T_UP,r.BOTTOM_RIGHT)),A}function g(e){let t=r.HORIZONTAL.repeat(e.length+2);return[`${r.TOP_LEFT}${t}${r.TOP_RIGHT}`,`${r.VERTICAL} ${e} ${r.VERTICAL}`,`${r.BOTTOM_LEFT}${t}${r.BOTTOM_RIGHT}`]}var y="cyan",R={INFO:"\u2139",SUCCESS:"\u2714",WARN:"\u26A0",ERROR:"\u2716"},l=Y.createColors(!!process.stdout.isTTY&&!process.env.NO_COLOR),I={spinner:e=>M({text:e,color:y}),info:e=>console.log(l.cyan(`${R.INFO} ${e}`)),success:e=>console.log(l.green(`${R.SUCCESS} ${e}`)),warn:e=>console.warn(l.yellow(`${R.WARN} ${e}`)),error:e=>console.error(l.red(`${R.ERROR} ${e}`)),log:e=>console.log(e??""),header:e=>{console.log();for(let t of g(e))console.log(l.cyan(t));console.log()},section:e=>{console.log(),console.log(l.bold(l.cyan(`${N} ${e}`)))},table:(e,t)=>{for(let n of D(e,t))console.log(n)},askConfirm:async(e,t=!0)=>await b({message:e,default:t}),askSelect:async(e,t)=>await P({message:e,choices:t}),askCheckbox:async(e,t)=>await F({message:e,choices:t}),askInput:async(e,t)=>await H({message:e,default:t})};var S={CLI_HEADER:"Docuvia Knowledge Graph",CLI_PROMPT_ACTION:"What would you like to do?",CLI_UNKNOWN_COMMAND:"Unknown command: ",CLI_FATAL_ERROR:"Fatal error: ",CLI_INTERACTIVE_NO_TTY:"--interactive requires a real terminal and is disabled under CI -- cannot launch the wizard menu.",CLI_INTERACTIVE_UNAVAILABLE:"--interactive was requested, but this session has no usable TTY (or is running under CI) -- continuing non-interactively.",INIT_HEADER:"Initialize Docuvia",INIT_CONFIRM:"Initialize Docuvia in this workspace?",INIT_ABORTED:"Initialization aborted.",INIT_START:"Starting initialization...",INIT_FAILED:"Initialization failed: ",INIT_AGENT_HOOKS:"Initializing AI Agent integrations for Docuvia...",INIT_LOCK_WAITING:"Another `docuvia init` is already running in this workspace; waiting for it to finish...",INIT_HOOKS_CONFIG_MCP:"Configuring MCP Servers...",INIT_HOOKS_REGISTERED_MCP:"Registered MCP server in: ",INIT_HOOKS_FAIL_CURSOR_MCP:"Could not configure Cursor MCP: ",INIT_HOOKS_SUCCESS:"Docuvia Agent Integrations successfully installed!",INIT_HOOKS_SUPPORTED:"Supported platforms: Claude Code, Cursor, GitHub Copilot, Codex, Continue, Hermes Agent.",INIT_HOOKS_FAIL:"Failed to initialize agent integrations: ",INIT_HOOKS_SELECT:"Which AI Agent integrations would you like to install?",INIT_HOOKS_NONE_SELECTED:"No platforms selected. Skipping agent integrations.",INIT_CLAUDE_MCP_MANUAL_SNIPPET:"To use Docuvia from Claude Desktop, add this to your global MCP config",FS_APPENDED:"Appended instructions to: ",FS_ALREADY_EXISTS:"Instructions already exist in: ",FS_CREATED:"Created: ",FS_READ_ERROR:"Could not read ",FS_READ_ERROR_UNKNOWN_CODE:"unknown error",FS_BLOCK_REMOVED_PREFIX:"Removed block from ",FS_BLOCK_REMOVED_SUFFIX:" (backup created)",FS_UNEXPECTED_SHAPE:(e,t)=>`Unexpected shape for "${e}" in ${t} (expected an array); leaving it untouched`,CLEAN_HEADER:"Clean Docuvia Database",CLEAN_CONFIRM:"This will permanently delete the local Docuvia database. Continue?",CLEAN_ABORTED:"Clean aborted.",CLEAN_START:"Cleaning database...",CLEAN_SUCCESS:"Clean complete. ",CLEAN_FAIL:"Clean failed: ",STATUS_START:"Getting status...",STATUS_SUCCESS:"Status retrieved.",STATUS_FAIL:"Failed to get status: ",STATUS_HEADER:"Docuvia Status",STATUS_COL_METRIC:"Metric",STATUS_COL_VALUE:"Value",STATUS_METRIC_PROJECTS:"Projects",STATUS_METRIC_L2_NODES:"L2 Nodes",STATUS_METRIC_L3_DECISIONS:"L3 Decisions",STATUS_METRIC_TIER_B_COVERAGE:"Tier B Coverage",STATUS_METRIC_TIER_C_QUEUE:"Tier C Queue",STATUS_METRIC_GRAPH_FRESHNESS:"Graph Freshness",STATUS_FRESHNESS_FRESH:"\u2713 fresh",STATUS_FRESHNESS_STALE:"\u26A0 stale (run 'docuvia analyze' or see 'docuvia doctor')",STATUS_FRESHNESS_UNKNOWN:"? unknown",PUBLISH_HEADER:"Publish to Docuvia",PUBLISH_MISSING_PROJECT_ID:"Project ID is required when not running interactively.",PUBLISH_NO_PROJECT_ID_PROVIDED:"No project ID provided.",PUBLISH_PROMPT_PROJECT_ID:"Enter the project ID to publish to: ",PUBLISH_PROJECT_ID_REQUIRED:"Project ID is required.",PUBLISH_MISSING_ENV:"DOCUVIA_API_URL and/or MCP_PAT are not set.",PUBLISH_SKIP:"Skipping publish.",PUBLISH_START:"Starting publish for project ",PUBLISH_SUCCESS:"Publish complete.",PUBLISH_FAIL:"Publish failed: ",ANALYZE_HEADER:"Analyze Project",ANALYZE_START:"Analyzing project...",ANALYZE_SUCCESS:"Analysis complete.",ANALYZE_FAIL:"Analysis failed: ",ANALYZE_PROJECT_TYPE:"Project Type: ",ANALYZE_SUGGESTED_TAGS:"Suggested Tags: ",ANALYZE_NONE:"none",ANALYZE_AUTO_FULL_SUCCESS:"Full ingestion complete.",ANALYZE_AUTO_FULL_SUMMARY:(e,t,n)=>`Parsed ${e}/${t} file(s) (${n} failed).`,ANALYZE_AUTO_DELTA_SUCCESS:"Delta ingestion complete.",ANALYZE_AUTO_DELTA_SUMMARY:(e,t,n)=>`Re-parsed ${e} file(s), dropped ${t} deleted file(s)`+(n>0?`, queued ${n} file(s) for Tier B.`:"."),ANALYZE_AUTO_NOOP_SUCCESS:"Already up to date.",ANALYZE_AUTO_NOOP_DIRTY_WORKTREE_SUCCESS:"Already up to date with HEAD -- uncommitted changes in the working tree were not analyzed (commit them, then re-run).",ANALYZE_LLM_MISSING_ENV:"AI_DOCUVIA_INTEGRATIONS_OPENAI_BASE_URL and a model (AI_DOCUVIA_MODEL or AI_DOCUVIA_FAST_MODEL) must be set to analyze a specific path.",ANALYZE_FOCUSED_HEADER:"Analyze Path",ANALYZE_FOCUSED_START:"Extracting decisions from ",ANALYZE_FOCUSED_SUCCESS:"Decision extraction complete.",ANALYZE_FOCUSED_FAIL:"Decision extraction failed: ",ANALYZE_FOCUSED_NONE:"No decision-worthy content found.",ANALYZE_FOCUSED_PERSISTED:(e,t)=>`${e} persisted, ${t} deduplicated`,ANALYZE_DECISION_LINE:(e,t,n)=>`${t} (${e}, confidence: ${n})`,ANALYZE_DECISION_CONTENT_PREFIX:" ",ANALYZE_TIER_B_HEADER:"Analyze -- Tier B (LSP escalation)",ANALYZE_TIER_B_START:"Running the Tier B LSP escalation batch...",ANALYZE_TIER_B_SUCCESS:"Tier B batch complete.",ANALYZE_TIER_B_FAIL:"Tier B batch failed: ",ANALYZE_TIER_B_SUMMARY:(e,t,n,i,o,a)=>`${e} file(s) processed, ${t} corrected edge(s) applied`+(n>0?`, ${n} file(s) left queued for the next batch`:"")+(o>0?`, ${o} file(s) not applicable to their LSP project (kept at Tier A)`:"")+(i>0?`, ${i} file(s) permanently failed (not re-queued)`:"")+(a?", zero-progress watchdog tripped: no next-batch re-queue remains":"")+".",ANALYZE_TIER_B_DEGRADED:e=>`LSP unavailable -- AST-level edges left untouched (${e})`,ANALYZE_TIER_B_GATE_NOT_READY:e=>`LSP prerequisites are not ready: ${e}`,ANALYZE_TIER_B_GATE_PROMPT:"Continue with AST-only precision (skip the LSP-corrected cross-file edges this batch)?",ANALYZE_TIER_B_GATE_DECLINED:"Aborted -- install typescript-language-server as a project devDependency (or pass --fallback-ast) and try again.",ANALYZE_TIER_B_GATE_FAILED:e=>`LSP prerequisites are not ready: ${e}
2
+ import{Fa as c,mb as u}from"./chunk-AUAV2EQW.js";import*as s from"fs/promises";import*as p from"path";import{select as P,confirm as b,input as H,checkbox as F}from"@inquirer/prompts";import Y from"picocolors";import M from"ora";var r={TOP_LEFT:"\u250C",TOP_RIGHT:"\u2510",BOTTOM_LEFT:"\u2514",BOTTOM_RIGHT:"\u2518",HORIZONTAL:"\u2500",VERTICAL:"\u2502",T_DOWN:"\u252C",T_UP:"\u2534",T_RIGHT:"\u251C",T_LEFT:"\u2524",CROSS:"\u253C"},w={PASS:"\u2713",FAIL:"\u2717"},N="\u25C6";var E={SPACE:" ",EMPTY:""};function L(e){return e.replace(/\s+/g,E.SPACE).trim()}function m(e,t){if(e.length<=t)return[e];let n=e.split(E.SPACE),i=[],o=E.EMPTY;for(let a of n){let A=o?`${o}${E.SPACE}${a}`:a;A.length>t&&o?(i.push(o),o=a):o=A}return o&&i.push(o),i}function U(e,t){return e+E.SPACE.repeat(Math.max(0,t-e.length))}function O(e,t,n,i){return t+e.map(o=>r.HORIZONTAL.repeat(o+2)).join(n)+i}function C(e,t){let n=e.map((i,o)=>U(i??E.EMPTY,t[o]));return`${r.VERTICAL} ${n.join(` ${r.VERTICAL} `)} ${r.VERTICAL}`}function f(e,t){return e.map((n,i)=>{let o=Math.max(n.header.length,...t.map(a=>(a[i]??E.EMPTY).length));return n.maxWidth?Math.min(o,n.maxWidth):o})}function D(e,t){let n=e.map(_=>L(_.header)),i=t.map(_=>_.map(d=>L(d??E.EMPTY))),o=f(e.map((_,d)=>({..._,header:n[d]})),i),a=i.map(_=>e.map((d,T)=>m(_[T]??E.EMPTY,o[T]))),A=[O(o,r.TOP_LEFT,r.T_DOWN,r.TOP_RIGHT),C(n,o),O(o,r.T_RIGHT,r.CROSS,r.T_LEFT)];for(let _ of a){let d=Math.max(..._.map(T=>T.length));for(let T=0;T<d;T++)A.push(C(_.map(h=>h[T]??E.EMPTY),o))}return A.push(O(o,r.BOTTOM_LEFT,r.T_UP,r.BOTTOM_RIGHT)),A}function g(e){let t=r.HORIZONTAL.repeat(e.length+2);return[`${r.TOP_LEFT}${t}${r.TOP_RIGHT}`,`${r.VERTICAL} ${e} ${r.VERTICAL}`,`${r.BOTTOM_LEFT}${t}${r.BOTTOM_RIGHT}`]}var y="cyan",R={INFO:"\u2139",SUCCESS:"\u2714",WARN:"\u26A0",ERROR:"\u2716"},l=Y.createColors(!!process.stdout.isTTY&&!process.env.NO_COLOR),I={spinner:e=>M({text:e,color:y}),info:e=>console.log(l.cyan(`${R.INFO} ${e}`)),success:e=>console.log(l.green(`${R.SUCCESS} ${e}`)),warn:e=>console.warn(l.yellow(`${R.WARN} ${e}`)),error:e=>console.error(l.red(`${R.ERROR} ${e}`)),log:e=>console.log(e??""),header:e=>{console.log();for(let t of g(e))console.log(l.cyan(t));console.log()},section:e=>{console.log(),console.log(l.bold(l.cyan(`${N} ${e}`)))},table:(e,t)=>{for(let n of D(e,t))console.log(n)},askConfirm:async(e,t=!0)=>await b({message:e,default:t}),askSelect:async(e,t)=>await P({message:e,choices:t}),askCheckbox:async(e,t)=>await F({message:e,choices:t}),askInput:async(e,t)=>await H({message:e,default:t})};var S={CLI_HEADER:"Docuvia Knowledge Graph",CLI_PROMPT_ACTION:"What would you like to do?",CLI_UNKNOWN_COMMAND:"Unknown command: ",CLI_FATAL_ERROR:"Fatal error: ",CLI_INTERACTIVE_NO_TTY:"--interactive requires a real terminal and is disabled under CI -- cannot launch the wizard menu.",CLI_INTERACTIVE_UNAVAILABLE:"--interactive was requested, but this session has no usable TTY (or is running under CI) -- continuing non-interactively.",INIT_HEADER:"Initialize Docuvia",INIT_CONFIRM:"Initialize Docuvia in this workspace?",INIT_ABORTED:"Initialization aborted.",INIT_START:"Starting initialization...",INIT_FAILED:"Initialization failed: ",INIT_AGENT_HOOKS:"Initializing AI Agent integrations for Docuvia...",INIT_LOCK_WAITING:"Another `docuvia init` is already running in this workspace; waiting for it to finish...",INIT_HOOKS_CONFIG_MCP:"Configuring MCP Servers...",INIT_HOOKS_REGISTERED_MCP:"Registered MCP server in: ",INIT_HOOKS_FAIL_CURSOR_MCP:"Could not configure Cursor MCP: ",INIT_HOOKS_SUCCESS:"Docuvia Agent Integrations successfully installed!",INIT_HOOKS_SUPPORTED:"Supported platforms: Claude Code, Cursor, GitHub Copilot, Codex, Continue, Hermes Agent.",INIT_HOOKS_FAIL:"Failed to initialize agent integrations: ",INIT_HOOKS_SELECT:"Which AI Agent integrations would you like to install?",INIT_HOOKS_NONE_SELECTED:"No platforms selected. Skipping agent integrations.",INIT_CLAUDE_MCP_MANUAL_SNIPPET:"To use Docuvia from Claude Desktop, add this to your global MCP config",FS_APPENDED:"Appended instructions to: ",FS_ALREADY_EXISTS:"Instructions already exist in: ",FS_CREATED:"Created: ",FS_READ_ERROR:"Could not read ",FS_READ_ERROR_UNKNOWN_CODE:"unknown error",FS_BLOCK_REMOVED_PREFIX:"Removed block from ",FS_BLOCK_REMOVED_SUFFIX:" (backup created)",FS_UNEXPECTED_SHAPE:(e,t)=>`Unexpected shape for "${e}" in ${t} (expected an array); leaving it untouched`,CLEAN_HEADER:"Clean Docuvia Database",CLEAN_CONFIRM:"This will permanently delete the local Docuvia database. Continue?",CLEAN_ABORTED:"Clean aborted.",CLEAN_START:"Cleaning database...",CLEAN_SUCCESS:"Clean complete. ",CLEAN_FAIL:"Clean failed: ",STATUS_START:"Getting status...",STATUS_SUCCESS:"Status retrieved.",STATUS_FAIL:"Failed to get status: ",STATUS_HEADER:"Docuvia Status",STATUS_COL_METRIC:"Metric",STATUS_COL_VALUE:"Value",STATUS_METRIC_PROJECTS:"Projects",STATUS_METRIC_L2_NODES:"L2 Nodes",STATUS_METRIC_L3_DECISIONS:"L3 Decisions",STATUS_METRIC_TIER_B_COVERAGE:"Tier B Coverage",STATUS_METRIC_TIER_C_QUEUE:"Tier C Queue",STATUS_METRIC_GRAPH_FRESHNESS:"Graph Freshness",STATUS_FRESHNESS_FRESH:"\u2713 fresh",STATUS_FRESHNESS_STALE:"\u26A0 stale (run 'docuvia analyze' or see 'docuvia doctor')",STATUS_FRESHNESS_UNKNOWN:"? unknown",PUBLISH_HEADER:"Publish to Docuvia",PUBLISH_MISSING_PROJECT_ID:"Project ID is required when not running interactively.",PUBLISH_NO_PROJECT_ID_PROVIDED:"No project ID provided.",PUBLISH_PROMPT_PROJECT_ID:"Enter the project ID to publish to: ",PUBLISH_PROJECT_ID_REQUIRED:"Project ID is required.",PUBLISH_MISSING_ENV:"DOCUVIA_API_URL and/or MCP_PAT are not set.",PUBLISH_SKIP:"Skipping publish.",PUBLISH_START:"Starting publish for project ",PUBLISH_SUCCESS:"Publish complete.",PUBLISH_FAIL:"Publish failed: ",ANALYZE_HEADER:"Analyze Project",ANALYZE_START:"Analyzing project...",ANALYZE_SUCCESS:"Analysis complete.",ANALYZE_FAIL:"Analysis failed: ",ANALYZE_PROJECT_TYPE:"Project Type: ",ANALYZE_SUGGESTED_TAGS:"Suggested Tags: ",ANALYZE_NONE:"none",ANALYZE_AUTO_FULL_SUCCESS:"Full ingestion complete.",ANALYZE_AUTO_FULL_SUMMARY:(e,t,n)=>`Parsed ${e}/${t} file(s) (${n} failed).`,ANALYZE_AUTO_DELTA_SUCCESS:"Delta ingestion complete.",ANALYZE_AUTO_DELTA_SUMMARY:(e,t,n)=>`Re-parsed ${e} file(s), dropped ${t} deleted file(s)`+(n>0?`, queued ${n} file(s) for Tier B.`:"."),ANALYZE_AUTO_NOOP_SUCCESS:"Already up to date.",ANALYZE_AUTO_NOOP_DIRTY_WORKTREE_SUCCESS:"Already up to date with HEAD -- uncommitted changes in the working tree were not analyzed (commit them, then re-run).",ANALYZE_LLM_MISSING_ENV:"AI_DOCUVIA_INTEGRATIONS_OPENAI_BASE_URL and a model (AI_DOCUVIA_MODEL or AI_DOCUVIA_FAST_MODEL) must be set to analyze a specific path.",ANALYZE_FOCUSED_HEADER:"Analyze Path",ANALYZE_FOCUSED_START:"Extracting decisions from ",ANALYZE_FOCUSED_SUCCESS:"Decision extraction complete.",ANALYZE_FOCUSED_FAIL:"Decision extraction failed: ",ANALYZE_FOCUSED_NONE:"No decision-worthy content found.",ANALYZE_FOCUSED_PERSISTED:(e,t)=>`${e} persisted, ${t} deduplicated`,ANALYZE_DECISION_LINE:(e,t,n)=>`${t} (${e}, confidence: ${n})`,ANALYZE_DECISION_CONTENT_PREFIX:" ",ANALYZE_TIER_B_HEADER:"Analyze -- Tier B (LSP escalation)",ANALYZE_TIER_B_START:"Running the Tier B LSP escalation batch...",ANALYZE_TIER_B_SUCCESS:"Tier B batch complete.",ANALYZE_TIER_B_FAIL:"Tier B batch failed: ",ANALYZE_TIER_B_SUMMARY:(e,t,n,i,o,a)=>`${e} file(s) processed, ${t} corrected edge(s) applied`+(n>0?`, ${n} file(s) left queued for the next batch`:"")+(o>0?`, ${o} file(s) not applicable to their LSP project (kept at Tier A)`:"")+(i>0?`, ${i} file(s) permanently failed (not re-queued)`:"")+(a?", zero-progress watchdog tripped: no next-batch re-queue remains":"")+".",ANALYZE_TIER_B_DEGRADED:e=>`LSP unavailable -- AST-level edges left untouched (${e})`,ANALYZE_TIER_B_GATE_NOT_READY:e=>`LSP prerequisites are not ready: ${e}`,ANALYZE_TIER_B_GATE_PROMPT:"Continue with AST-only precision (skip the LSP-corrected cross-file edges this batch)?",ANALYZE_TIER_B_GATE_DECLINED:"Aborted -- install typescript-language-server as a project devDependency (or pass --fallback-ast) and try again.",ANALYZE_TIER_B_GATE_FAILED:e=>`LSP prerequisites are not ready: ${e}
3
3
  Build/compile the target project (Docuvia's Tier B relies on a working language server), then run 'docuvia doctor' to confirm. Pass --fallback-ast to proceed with AST-only precision instead.`,ANALYZE_TIER_C_SUMMARY:(e,t,n)=>`Tier C: ${e} candidate(s) processed, ${t} decision(s) persisted`+(n>0?`, ${n} left queued for the next run.`:"."),ANALYZE_TIER_C_SKIPPED:e=>`Tier C: drain skipped this run (${e}).`,ANALYZE_AGENT_AUTHORED_MISSING_TARGET:"--agent-authored requires a target path, e.g. docuvia analyze <path> --agent-authored",ANALYZE_AGENT_AUTHORED_MISSING_PAYLOAD:"No decisions payload found -- pipe JSON via stdin or pass --decisions-file=<path>",ANALYZE_AGENT_AUTHORED_INVALID_JSON:e=>`--agent-authored payload is not valid JSON: ${e}`,ANALYZE_AGENT_AUTHORED_INVALID_SHAPE:e=>`--agent-authored payload does not match the expected shape: ${e}`,ANALYZE_LSP_ARGS_INVALID_JSON:e=>`DOCUVIA_LSP_ARGS starts with '[' but is not valid JSON -- use a JSON array of strings, or plain space-separated args: ${e}`,ANALYZE_LSP_ARGS_INVALID_SHAPE:"DOCUVIA_LSP_ARGS JSON array must contain only strings",ANALYZE_STAGE_HEADER:"Stage Decisions",ANALYZE_STAGE_START:"Staging decisions from ",ANALYZE_STAGE_SUCCESS:"Staged.",ANALYZE_STAGE_SUMMARY:e=>`${e} decision(s) staged -- flushed automatically on the next commit that touches this file.`,ANALYZE_FLUSH_STAGED_L3_HEADER:"Flush Staged L3 Decisions",ANALYZE_FLUSH_STAGED_L3_START:"Flushing staged L3 decisions...",ANALYZE_FLUSH_STAGED_L3_SUCCESS:"Flush complete.",ANALYZE_FLUSH_STAGED_L3_DISABLED_SUCCESS:"commit-l3-write is disabled -- nothing flushed.",ANALYZE_FLUSH_STAGED_L3_SUMMARY:(e,t,n)=>`${e} flushed, ${t} deduplicated`+(n>0?`, ${n} left staged for a future commit.`:"."),ANALYZE_AGENT_AUTHORED_STAGED_UNTIL_INGESTED:(e,t)=>t?`${e} decision(s) staged, not written: there is no knowledge graph yet. Run \`docuvia init\`; they are written on the next commit that touches this file.`:`${e} decision(s) staged, not written: this file is not in the knowledge graph yet (new or uncommitted). They are written automatically when a commit that touches it is ingested.`,ANALYZE_FLUSH_STAGED_L3_NO_GRAPH_ADVICE:"Some staged decisions could not be attached: the knowledge graph is empty (or hasn't ingested this file yet). Run `docuvia init` first -- decisions need a graph to attach to. They stay staged and retry on the next flush.",REVIEW_HEADER:"Review Changes",REVIEW_START:"Analyzing changes...",REVIEW_SUCCESS:"Analysis complete.",REVIEW_AGAINST:" against ",REVIEW_FAIL:"Review failed: ",REVIEW_FILES_CHANGED:"Files changed: ",REVIEW_RISK_PREFIX:"Risk level: ",REVIEW_WHY_HEADER:"Why (L3 decisions/context)",REVIEW_WHY_PREFIX:"Decision: ",IMPACT_HEADER:"Impact Analysis",IMPACT_MISSING_TARGET:"A target symbol/module name is required.",IMPACT_START:"Resolving blast radius for ",IMPACT_SUCCESS:"Resolved blast radius for ",IMPACT_FAIL:"Impact analysis failed: ",IMPACT_NOT_FOUND:"No matching node found for ",IMPACT_BLAST_RADIUS_HEADER:"Blast Radius",IMPACT_NO_DEPENDENTS:"No dependents found.",IMPACT_RISK_PREFIX:"Risk level: ",IMPACT_WHY_PREFIX:"Decision: ",IMPACT_COL_NAME:"Name",IMPACT_COL_TYPE:"Type",IMPACT_COL_SOURCE:"Source",IMPACT_EDGE_SOURCE_STATIC:"static",IMPACT_ENTRY_WHY_LABEL:e=>`${e}:`,IMPACT_TIER_B_INCOMPLETE:(e,t)=>`${e} of ${t} tracked file(s) have never been Tier B-processed -- this may be incomplete, not confirmed zero. Run \`docuvia analyze --escalate-to-lsp --full\` to resync.`,IMPACT_RISK_NOTE_PREFIX:"Note: ",UNINSTALL_HEADER:"Uninstall Docuvia2 Integrations",UNINSTALL_START:"Uninstalling Docuvia2 integrations...",UNINSTALL_SUCCESS_CLEAN:"Cleaned Docuvia: ",UNINSTALL_FAIL_CLEAN:"Failed to clean Docuvia directory: ",UNINSTALL_SUCCESS:"Docuvia2 uninstalled successfully. Backup files (.bak) were created for modified Markdown files.",UNINSTALL_FAIL:"Uninstall failed: ",UNINSTALL_HOOKS_SELECT:"Which AI Agent integrations would you like to uninstall?",UNINSTALL_KEEP_DB:"Skipping local database cleanup (--keep-db).",UNINSTALL_INVALID_WORKSPACE_ROOT:"Workspace root must not be empty.",UNINSTALL_PLATFORM_FAIL:"Failed to uninstall hooks for ",UNINSTALL_PLATFORM_FAIL_MID:": ",UNINSTALL_PARTIAL:"Uninstall completed with failures: ",UNINSTALL_DB_CLEANUP_FAILURE_NAME:"local database cleanup",UNINSTALL_HOOKS_FAIL_LOG:"uninstallHooks failed for platform ",UNINSTALL_DB_CLEANUP_FAIL_LOG:"uninstall's database cleanup failed",UNINSTALL_FAIL_LOG:"uninstall failed",UNINSTALL_REMOVED_FILE_PREFIX:"Removed ",UNINSTALL_REMOVED_MCP_SERVER_PREFIX:"Removed MCP server from ",UNINSTALL_REMOVED_HOOK_FROM_SETTINGS_PREFIX:"Removed the Docuvia hook entry from ",UNINSTALL_CLAUDE_MCP_MANUAL_REMINDER:"To finish uninstalling, manually remove the Docuvia MCP server entry from your global MCP config",UNINSTALL_GIT_HOOKS_SUCCESS:(e,t)=>`Removed git hooks (post-commit: ${e?"removed":"not present"}, pre-push: ${t?"removed":"not present"}).`,UNINSTALL_GIT_HOOKS_FAIL:"Failed to remove git hooks: ",UNINSTALL_GIT_HOOKS_FAIL_LOG:"uninstall's git hooks removal failed",UNINSTALL_GIT_HOOKS_FAILURE_NAME:"git hooks removal",UNINSTALL_KNOWLEDGE_BRANCH_DELETED:"Deleted the hidden docuvia-knowledge git branch.",UNINSTALL_DOCUVIA_DIR_REMOVED:"Removed the .docuvia/ directory.",UNINSTALL_DOCUVIA_DIR_FAIL:"Failed to remove the .docuvia/ directory: ",UNINSTALL_DOCUVIA_DIR_FAIL_LOG:"uninstall's .docuvia/ directory removal failed",UNINSTALL_DOCUVIA_DIR_FAILURE_NAME:".docuvia/ directory removal",DOCTOR_HEADER:"Docuvia Doctor Diagnostics",DOCTOR_START:"Running diagnostics...",DOCTOR_FAIL:"Doctor failed: ",DOCTOR_SUMMARY_PASSED:(e,t)=>`Summary: ${e}/${t} checks passed.`,DOCTOR_FIX_HINT:"Tip: run `docuvia doctor --fix` to attempt automatic repair.",DOCTOR_COL_CHECK:"Check",DOCTOR_COL_STATUS:"Status",DOCTOR_COL_MESSAGE:"Message",DOCTOR_COL_FIX:"Suggested Fix",DOCTOR_STATUS_PASS:"PASS",DOCTOR_STATUS_FAIL:"FAIL",DOCTOR_CATEGORY_DATABASE:"Database",DOCTOR_CATEGORY_GIT:"Git",DOCTOR_CATEGORY_GIT_HOOKS:"Git Hooks",DOCTOR_CATEGORY_LOGS:"Logs",DOCTOR_CATEGORY_TIER_B:"Tier B Batch",DOCTOR_CATEGORY_TIER_B_COVERAGE:"Tier B Coverage",DOCTOR_CATEGORY_LLM:"LLM Integration",DOCTOR_CATEGORY_LSP:"LSP Providers",DOCTOR_CATEGORY_AGENT_HOOKS:"AI Agent Hooks",DOCTOR_CATEGORY_AGENT_ADOPTION:"Docuvia-First Workflow",DOCTOR_CATEGORY_OTHER:"Other",QUERY_HEADER:"Query Knowledge Graph",QUERY_PROMPT_TARGET:"What would you like to query? ",QUERY_MISSING_TARGET:"A query target is required (pass it as an argument).",QUERY_MISSING_TARGET_NON_TTY:"A query target is required.",QUERY_START:"Querying local knowledge graph for ",QUERY_FOUND:"Query resolved for ",QUERY_FAIL:"Query failed: ",QUERY_CONTEXT_HEADER:"Query Results",QUERY_L2_PREFIX:"Module: ",QUERY_NO_L2:"No matching module found.",QUERY_L3_PREFIX:"Decision: ",QUERY_L3_PROVENANCE:e=>` (${e.join(", ")})`,QUERY_UNKNOWN_STATUS:"unknown",QUERY_INCOMING_HEADER:"Incoming (callers/dependents)",QUERY_OUTGOING_HEADER:"Outgoing (dependencies)",QUERY_COL_NAME:"Name",QUERY_COL_RELATION:"Relation",QUERY_INVALID_LIMIT:"Ignoring invalid --limit value (must be a positive integer): ",QUERY_TIER_B_INCOMING_UNPROCESSED:(e,t)=>`No callers found, but ${e} of ${t} tracked file(s) have never been Tier B-processed -- this may be incomplete, not confirmed zero. Run \`docuvia analyze --escalate-to-lsp --full\` to resync.`,QUERY_TIER_B_OUTGOING_UNPROCESSED:"No callees found, but this symbol's own file has never been Tier B-processed -- this may be incomplete, not confirmed zero. Run `docuvia analyze --escalate-to-lsp --full` to resync.",QUERY_MATCH_TYPE_EXACT:" (exact match)",QUERY_MATCH_TYPE_KEYWORD:" (keyword match -- verify with Grep/Glob if unsure)",QUERY_MATCH_TYPE_NEIGHBOR:" (neighbor match)",EXPORT_HEADER:"Export Topology",EXPORT_START:"Exporting topology...",EXPORT_SUCCESS:"Exported topology to ",EXPORT_FAIL:"Export failed: ",EXPORT_STATS_LINE:(e,t,n)=>`Nodes: ${e}, Links: ${t}, Groups: ${n}`,EXPORT_COLLAPSED_LINE:"Collapsed: yes (fewer nodes than the raw graph).",EXPORT_FOLDED_LINE:e=>`Folded links: ${e} more relationship(s) folded within files at this granularity; pass --collapse=symbol for the full symbol-level view.`,EXPORT_HTML_PATH_LINE:e=>`HTML viewer: ${e}`,SNAPSHOT_HEADER:"Snapshot Knowledge Graph",SNAPSHOT_START:"Packing knowledge graph snapshot...",SNAPSHOT_SUCCESS:"Snapshot packed onto the knowledge branch.",SNAPSHOT_FAIL:"Snapshot failed: ",SNAPSHOT_NODES_WRITTEN_LINE:e=>`Nodes written: ${e}`,SNAPSHOT_EDGES_WRITTEN_LINE:e=>`Edges written: ${e}`,SNAPSHOT_MARKDOWN_WRITTEN_LINE:e=>`Markdown files written: ${e}`,HYDRATE_HEADER:"Hydrate Local Database",HYDRATE_START:"Hydrating local database from the knowledge branch...",HYDRATE_SUCCESS:"Hydrated local database.",HYDRATE_NOTHING:'Nothing to hydrate from yet \u2014 run "docuvia init" first.',HYDRATE_FAIL:"Hydrate failed: ",HYDRATE_NODES_LOADED_LINE:e=>`Nodes loaded: ${e}`,HYDRATE_EDGES_LOADED_LINE:e=>`Edges loaded: ${e}`,HYDRATE_EDGES_DROPPED_LINE:e=>`Dangling edges dropped: ${e}`,HYDRATE_REFUSED:e=>`Refused to hydrate: ${e==="pending-local-write"?"a knowledge-branch write from this workspace hasn't been confirmed yet":"this would replace local.db's graph with a drastically smaller one"}. Local data was left untouched. Re-run with --force if you're sure.`,SYNC_KNOWLEDGE_HEADER:"Sync Knowledge Branch",SYNC_KNOWLEDGE_START:"Reconciling the knowledge branch with the remote...",SYNC_KNOWLEDGE_NO_REMOTE:"No remote reachable \u2014 nothing to reconcile (offline or no origin configured).",SYNC_KNOWLEDGE_UP_TO_DATE:"Knowledge branch is already up to date with the remote.",SYNC_KNOWLEDGE_FAST_FORWARDED:"Fast-forwarded the local knowledge branch to the remote.",SYNC_KNOWLEDGE_PUSHED:"Pushed the local knowledge branch to the remote.",SYNC_KNOWLEDGE_MERGED:"Merged the diverged knowledge branch and pushed the result.",SYNC_KNOWLEDGE_FAIL:"Knowledge branch sync failed: ",HOOKS_HEADER:"Docuvia Hooks",HOOKS_COL_NAME:"Hook",HOOKS_COL_STATUS:"Status",HOOKS_STATUS_ENABLED:"enabled",HOOKS_STATUS_DISABLED:"disabled",HOOKS_LIST_FAIL:"Failed to list hooks: ",HOOKS_SET_FAIL:"Failed to update hook: ",HOOKS_ENABLED:e=>`Enabled hook: ${e}`,HOOKS_DISABLED:e=>`Disabled hook: ${e}`,HOOKS_INVALID_NAME:(e,t)=>`Unknown hook '${e??""}' -- valid names: ${t.join(", ")}`,HOOKS_UNKNOWN_SUBCOMMAND:e=>`Unknown 'docuvia hooks' subcommand '${e??""}' -- expected list, enable, disable, or check`};async function j(e,t,n){let i;try{i=await s.readFile(e,c)}catch(o){o.code!==u&&I.warn(`${S.FS_READ_ERROR}${e} (${o.code??S.FS_READ_ERROR_UNKNOWN_CODE}); creating a new file instead of appending`)}if(i===void 0){await s.mkdir(p.dirname(e),{recursive:!0}),await s.writeFile(e,t),I.success(S.FS_CREATED+e);return}i.includes(n)?I.info(S.FS_ALREADY_EXISTS+e):(await s.appendFile(e,`
4
4
  ${t}`),I.success(S.FS_APPENDED+e))}async function G(e){try{let t=await s.readFile(e,c),n=`${e}.bak`;return await s.writeFile(n,t,c),n}catch{return null}}async function J(e,t,n){try{let i=await s.readFile(e,c),o=i.indexOf(t);if(o===-1)return!1;let a=i.indexOf(n,o);if(a===-1)return!1;await G(e);let A=i.slice(0,o),_=i.slice(a+n.length);return await s.writeFile(e,(A+_).trim()+`
5
5
  `,c),I.success(`${S.FS_BLOCK_REMOVED_PREFIX}${e}${S.FS_BLOCK_REMOVED_SUFFIX}`),!0}catch{return!1}}export{r as a,w as b,I as c,S as d,j as e,G as f,J as g};
6
- //# sourceMappingURL=chunk-6U56UWBD.js.map
6
+ //# sourceMappingURL=chunk-C5P52XYH.js.map
@@ -0,0 +1,62 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{Fa as P,Ja as d,Pa as Y,Qa as B,Ra as G,Sa as H,Ta as Q,Ua as V,Va as j,Wa as W,Xa as q,Ya as J,Za as K}from"./chunk-AUAV2EQW.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,...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
+ `,a===e&&(i+=" ".repeat(s+n+2),i+=`^
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
+
6
+ ${s}`,n),this.line=o,this.column=i,this.codeblock=s}};var Tt=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,dt=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,mt=/^[+-]?0[0-9_]/;function F(t,e){let n=t[e++],o=n,i=n==="'",s=n===t[e]&&n===t[e+1];s&&(t[e+=2]===`
7
+ `?e++:t[e]==="\r"&&t[e+1]===`
8
+ `&&(e+=2));let a="",E=e,I=0;for(let N=e;N<t.length;N++)if(n=t[N],s&&(n===`
9
+ `||n==="\r"&&t[N+1]===`
10
+ `))I=I&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new f("control characters are not allowed in strings",{toml:t,ptr:N});if((!I||I===3)&&n===o&&(!s||t[N+1]===o&&t[N+2]===o))return s&&(t[N+3]===o&&N++,t[N+3]===o&&N++),[I?a:a+t.slice(E,N),N+(s?3:1)];if(!I)!i&&n==="\\"&&(a+=t.slice(E,E=N),I=1);else if(I===1)if(n==="x"||n==="u"||n==="U"){let u=0,M=n==="x"?2:n==="u"?4:8;for(let R=0;R<M;R++,N++){let m=t.charCodeAt(N+1),C=m>=48&&m<=57?m-48:m>=65&&m<=70?m-65+10:m>=97&&m<=102?m-97+10:-1;if(C<0)throw new f("invalid non-hex character in unicode escape",{toml:t,ptr:N+1});u=u<<4|C}if(u<0||u>1114111||u>=55296&&u<=57343)throw new f("invalid unicode escape",{toml:t,ptr:N});a+=String.fromCodePoint(u),E=N+1,I=0}else if(n===" "||n===" ")I=2;else{if(n==="b")a+="\b";else if(n==="t")a+=" ";else if(n==="n")a+=`
11
+ `;else if(n==="f")a+="\f";else if(n==="r")a+="\r";else if(n==="e")a+="\x1B";else if(n==='"')a+='"';else if(n==="\\")a+="\\";else throw new f("unrecognized escape sequence",{toml:t,ptr:N});E=N+1,I=0}else if(n!==" "&&n!==" "){if(I===2)throw new f("invalid escape: only line-ending whitespace may be escaped",{toml:t,ptr:E});I=!i&&n==="\\"?1:0,E=N}}throw new f("unfinished string",{toml:t,ptr:e})}function ee(t,e,n,o){if(t==="true")return!0;if(t==="false")return!1;if(t==="-inf")return-1/0;if(t==="inf"||t==="+inf")return 1/0;if(t==="nan"||t==="+nan"||t==="-nan")return NaN;if(t==="-0")return o?0n:0;let i=Tt.test(t);if(i||dt.test(t)){if(mt.test(t))throw new f("leading zeroes are not allowed",{toml:e,ptr:n});t=t.replace(/_/g,"");let a=+t;if(isNaN(a))throw new f("invalid number",{toml:e,ptr:n});if(i){if((i=!Number.isSafeInteger(a))&&!o)throw new f("integer value cannot be represented losslessly",{toml:e,ptr:n});(i||o===!0)&&(a=BigInt(t))}return a}let s=new L(t);if(!s.isValid())throw new f("invalid value",{toml:e,ptr:n});return s}function g(t,e=0,n=t.length){let o=t.indexOf(`
12
+ `,e);return t[o-1]==="\r"&&o--,o<=n?o:-1}function S(t,e){for(let n=e;n<t.length;n++){let o=t[n];if(o===`
13
+ `)return n;if(o==="\r"&&t[n+1]===`
14
+ `)return n+1;if(o<" "&&o!==" "||o==="\x7F")throw new f("control characters are not allowed in comments",{toml:t,ptr:e})}return t.length}function p(t,e,n,o){let i;for(;;){for(;(i=t[e])===" "||i===" "||!n&&(i===`
15
+ `||i==="\r"&&t[e+1]===`
16
+ `);)e++;if(o||i!=="#")break;e=S(t,e)}return e}function te(t,e,n,o,i=!1){if(!o)return e=g(t,e),e<0?t.length:e;for(let s=e;s<t.length;s++){let a=t[s];if(a==="#")s=g(t,s);else{if(a===n)return s+1;if(a===o||i&&(a===`
17
+ `||a==="\r"&&t[s+1]===`
18
+ `))return s}}throw new f("cannot find end of structure",{toml:t,ptr:e})}function _t(t,e,n){let o=t.slice(e,n),i=o.indexOf("#");return i>-1&&(S(t,i),o=o.slice(0,i)),[o.trimEnd(),i]}function h(t,e,n,o,i){if(o===0)throw new f("document contains excessively nested structures. aborting.",{toml:t,ptr:e});let s=t[e];if(s==="["||s==="{"){let[I,N]=s==="["?re(t,e,o,i):ne(t,e,o,i);if(n){if(N=p(t,N),t[N]===",")N++;else if(t[N]!==n)throw new f("expected comma or end of structure",{toml:t,ptr:N})}return[I,N]}if(s==='"'||s==="'"){let[I,N]=F(t,e);if(n){if(N=p(t,N),t[N]&&t[N]!==","&&t[N]!==n&&t[N]!==`
19
+ `&&t[N]!=="\r")throw new f("unexpected character encountered",{toml:t,ptr:N});t[N]===","&&N++}return[I,N]}let a=te(t,e,",",n),E=_t(t,e,a-(t[a-1]===","?1:0));if(!E[0])throw new f("incomplete key-value declaration: no value specified",{toml:t,ptr:e});return n&&E[1]>-1&&(a=p(t,e+E[1]),t[a]===","&&a++),[ee(E[0],t,e,i),a]}var pt=/^[a-zA-Z0-9-_]+[ \t]*$/;function x(t,e,n="="){let o=e-1,i=[],s=t.indexOf(n,e);if(s<0)throw new f("incomplete key-value: cannot find end of key",{toml:t,ptr:e});do{let a=t[e=++o];if(a!==" "&&a!==" ")if(a==='"'||a==="'"){if(a===t[e+1]&&a===t[e+2])throw new f("multiline strings are not allowed in keys",{toml:t,ptr:e});let[E,I]=F(t,e);o=t.indexOf(".",I);let N=t.slice(I,o<0||o>s?s:o),u=g(N);if(u>-1)throw new f("newlines are not allowed in keys",{toml:t,ptr:e+o+u});if(N.trimStart())throw new f("found extra tokens after the string part",{toml:t,ptr:I});if(s<I&&(s=t.indexOf(n,I),s<0))throw new f("incomplete key-value: cannot find end of key",{toml:t,ptr:e});i.push(E)}else{o=t.indexOf(".",e);let E=t.slice(e,o<0||o>s?s:o);if(!pt.test(E))throw new f("only letter, numbers, dashes and underscores are allowed in keys",{toml:t,ptr:e});i.push(E.trimEnd())}}while(o+1&&o<s);return[i,p(t,s+1,!0,!0)]}function ne(t,e,n,o){let i={},s=new Set,a;for(e++;(a=t[e++])!=="}"&&a;){if(a===",")throw new f("expected value, found comma",{toml:t,ptr:e-1});if(a==="#")e=S(t,e);else if(a!==" "&&a!==" "&&a!==`
20
+ `&&a!=="\r"){let E,I=i,N=!1,[u,M]=x(t,e-1);for(let C=0;C<u.length;C++){if(C&&(I=N?I[E]:I[E]={}),E=u[C],(N=Object.hasOwn(I,E))&&(typeof I[E]!="object"||s.has(I[E])))throw new f("trying to redefine an already defined value",{toml:t,ptr:e});!N&&E==="__proto__"&&Object.defineProperty(I,E,{enumerable:!0,configurable:!0,writable:!0})}if(N)throw new f("trying to redefine an already defined value",{toml:t,ptr:e});let[R,m]=h(t,M,"}",n-1,o);s.add(R),I[E]=R,e=m}}if(!a)throw new f("unfinished table encountered",{toml:t,ptr:e});return[i,e]}function re(t,e,n,o){let i=[],s;for(e++;(s=t[e++])!=="]"&&s;){if(s===",")throw new f("expected value, found comma",{toml:t,ptr:e-1});if(s==="#")e=S(t,e);else if(s!==" "&&s!==" "&&s!==`
21
+ `&&s!=="\r"){let a=h(t,e-1,"]",n-1,o);i.push(a[0]),e=a[1]}}if(!s)throw new f("unfinished array encountered",{toml:t,ptr:e});return[i,e]}function oe(t,e,n,o){let i=e,s=n,a,E=!1,I;for(let N=0;N<t.length;N++){if(N){if(i=E?i[a]:i[a]={},s=(I=s[a]).c,o===0&&(I.t===1||I.t===2))return null;if(I.t===2){let u=i.length-1;i=i[u],s=s[u].c}}if(a=t[N],(E=Object.hasOwn(i,a))&&s[a]?.t===0&&s[a]?.d)return null;E||(a==="__proto__"&&(Object.defineProperty(i,a,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(s,a,{enumerable:!0,configurable:!0,writable:!0})),s[a]={t:N<t.length-1&&o===2?3:o,d:!1,i:0,c:{}})}if(I=s[a],I.t!==o&&!(o===1&&I.t===3)||(o===2&&(I.d||(I.d=!0,i[a]=[]),i[a].push(i={}),I.c[I.i++]=I={t:1,d:!1,i:0,c:{}}),I.d))return null;if(I.d=!0,o===1)i=E?i[a]:i[a]={};else if(o===0&&E)return null;return[a,i,I.c]}function b(t,{maxDepth:e=1e3,integersAsBigInt:n}={}){let o={},i={},s=o,a=i;for(let E=p(t,0);E<t.length;){if(t[E]==="["){let I=t[++E]==="[",N=x(t,E+=+I,"]");if(I){if(t[N[1]-1]!=="]")throw new f("expected end of table declaration",{toml:t,ptr:N[1]-1});N[1]++}let u=oe(N[0],o,i,I?2:1);if(!u)throw new f("trying to redefine an already defined table or value",{toml:t,ptr:E});a=u[2],s=u[1],E=N[1]}else{let I=x(t,E),N=oe(I[0],s,a,0);if(!N)throw new f("trying to redefine an already defined table or value",{toml:t,ptr:E});let u=h(t,I[1],void 0,e,n);N[1][N[0]]=u[0],E=u[1]}if(E=p(t,E,!0),t[E]&&t[E]!==`
22
+ `&&t[E]!=="\r")throw new f("each key-value declaration must be followed by an end-of-line",{toml:t,ptr:E});E=p(t,E)}return o}import{Query as At}from"web-tree-sitter";var c={CLASS:"class",FUNCTION:"function",VARIABLE:"variable",IMPORT:"import",CALL:"call",IMPLEMENTS:"implements",EXTENDS:"extends"};var O=class{buildScopeMap(e){return this.config.buildScopeMap?this.config.buildScopeMap(e):new Map}classifyCall(e){return this.config.classifyCall?this.config.classifyCall(e):{isMethodCall:!1,methodName:e.text}}wasm_file;config;compiledQueries=null;constructor(e){this.config=e,this.wasm_file=e.wasm_file}initQueries(e){if(this.compiledQueries||!this.config.queries)return;let n=this.config.queries;this.compiledQueries={classes:this.compileQuery(e,n.classes,"classes"),functions:this.compileQuery(e,n.functions,"functions"),variables:this.compileQuery(e,n.variables,"variables"),imports:this.compileQuery(e,n.imports,"imports"),calls:this.compileQuery(e,n.calls,"calls"),implements:this.compileQuery(e,n.implements,"implements"),extends:this.compileQuery(e,n.extends,"extends")}}queryCompileFailures=[];drainQueryCompileFailures(){return this.queryCompileFailures.splice(0)}compileQuery(e,n,o){if(n)try{return new At(e,n)}catch(i){this.queryCompileFailures.push({kind:o,pattern:n,message:i instanceof Error?i.message:String(i)});return}}deleteQueries(){this.compiledQueries&&(this.compiledQueries.classes?.delete(),this.compiledQueries.functions?.delete(),this.compiledQueries.variables?.delete(),this.compiledQueries.imports?.delete(),this.compiledQueries.calls?.delete(),this.compiledQueries.implements?.delete(),this.compiledQueries.extends?.delete(),this.compiledQueries=null)}captureNodes(e,n,o){if(!o)return[];let i=o.captures(e),s=[];for(let a of i)(n.length===0||n.includes(a.name))&&s.push(a.node);return s}extractClasses(e){return this.extractNodes(e,this.compiledQueries?.classes,[A.CLASS],this.config.classes)}extractFunctions(e){return this.extractNodes(e,this.compiledQueries?.functions,[A.FUNCTION],this.config.functions)}extractVariables(e){return this.extractNodes(e,this.compiledQueries?.variables,[c.VARIABLE],[])}extractImports(e){return this.extractNodes(e,this.compiledQueries?.imports,[A.IMPORT],this.config.imports)}extractCalls(e){return this.extractNodes(e,this.compiledQueries?.calls,[A.CALL],this.config.calls)}extractImplements(e){return this.extractNodes(e,this.compiledQueries?.implements,[c.IMPLEMENTS],this.config.implements||[])}extractExtends(e){return this.extractNodes(e,this.compiledQueries?.extends,[c.EXTENDS],this.config.extends||[])}extractNodes(e,n,o,i){if(n)return this.captureNodes(e,o,n);let s=[];for(let a of i)s.push(...e.descendantsOfType(a).filter(Boolean));return s}};var Ct="languages.toml",Ot=256*1024;function ie(t){return Array.isArray(t)&&t.every(e=>typeof e=="string")}var St=["extensions","imports","classes","functions","calls"],Rt=["implements","extends"];function Lt(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.wasm_file!="string"?!1:St.every(n=>ie(e[n]))&&Rt.every(n=>{let o=e[n];return o==null||ie(o)})}function ht(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.languages||typeof e.languages!="object"||!Object.values(e.languages).every(Lt))}function Dt(t,e,n){let o=t.relative(e,n);return o===""||o!==".."&&!o.startsWith(`..${t.sep}`)&&!t.isAbsolute(o)}async function Pt(t,e,n){let o=e.join(n,Ct);try{let[i,s]=await Promise.all([t.realpath(n),t.realpath(o)]);if(!Dt(e,i,s))return;let a=await t.open(s,"r");try{let E=await a.stat();return!E.isFile()||E.size>Ot?void 0:await a.readFile(P)}finally{await a.close()}}catch{return}}var $=class t{config;extToProviderMap;constructor(e){this.config=e||{languages:{}},this.extToProviderMap=new Map,this.buildCache()}buildCache(){this.extToProviderMap.clear();for(let[e,n]of Object.entries(this.config.languages)){let o=new O(n);for(let i of n.extensions)this.extToProviderMap.set(i,o)}}static loadFromString(e,n){let o=n||{languages:{}};if(!e)return new t(o);try{let i=b(e);if(ht(i)){let s={...o.languages,...i.languages};return new t({languages:s})}}catch{}return new t(o)}static async load(e,n){let o=n||{languages:{}};try{let i=t.getProcessLike();if(i&&i.versions&&i.versions.node&&i.cwd){let s=await import("fs/promises"),a=await import("path"),E=a.resolve(e??i.cwd()),I=await Pt(s,a,E);return t.loadFromString(I,o)}}catch{}return new t(o)}static getProcessLike(){if(typeof globalThis>"u")return;let n=globalThis.process;if(!(!n||typeof n!="object"))return n}getProviderForExtension(e){return this.extToProviderMap.get(e)}registerProvider(e,n){for(let o of e)this.extToProviderMap.set(o,n)}getConfig(){return this.config}};var r={IDENTIFIER:"identifier",TYPE_IDENTIFIER:"type_identifier",CALL:"call",CALL_EXPRESSION:"call_expression",CLASS_DECLARATION:"class_declaration",ABSTRACT_CLASS_DECLARATION:"abstract_class_declaration",INTERFACE_DECLARATION:"interface_declaration",ENUM_DECLARATION:"enum_declaration",METHOD_DECLARATION:"method_declaration",METHOD_DEFINITION:"method_definition",FUNCTION_DECLARATION:"function_declaration",FUNCTION_DEFINITION:"function_definition",ARROW_FUNCTION:"arrow_function",MEMBER_EXPRESSION:"member_expression",IMPORT_STATEMENT:"import_statement",IMPORT_DECLARATION:"import_declaration",USE_DECLARATION:"use_declaration",ATTRIBUTE:"attribute",STRUCT_SPECIFIER:"struct_specifier",ENUM_SPECIFIER:"enum_specifier",UNION_SPECIFIER:"union_specifier",TYPE_DEFINITION:"type_definition",FUNCTION_DECLARATOR:"function_declarator",CLASS_SPECIFIER:"class_specifier",FIELD_EXPRESSION:"field_expression",PREPROC_INCLUDE:"preproc_include",USING_DECLARATION:"using_declaration",STRUCT_DECLARATION:"struct_declaration",RECORD_DECLARATION:"record_declaration",CONSTRUCTOR_DECLARATION:"constructor_declaration",DESTRUCTOR_DECLARATION:"destructor_declaration",CONVERSION_OPERATOR_DECLARATION:"conversion_operator_declaration",OPERATOR_DECLARATION:"operator_declaration",LOCAL_FUNCTION_STATEMENT:"local_function_statement",USING_DIRECTIVE:"using_directive",INVOCATION_EXPRESSION:"invocation_expression",OBJECT_CREATION_EXPRESSION:"object_creation_expression",BASE_LIST:"base_list",TYPE_DECLARATION:"type_declaration",TYPE_SPEC:"type_spec",FIELD_IDENTIFIER:"field_identifier",SELECTOR_EXPRESSION:"selector_expression",ANNOTATION_TYPE_DECLARATION:"annotation_type_declaration",COMPACT_CONSTRUCTOR_DECLARATION:"compact_constructor_declaration",METHOD_INVOCATION:"method_invocation",EXPLICIT_CONSTRUCTOR_INVOCATION:"explicit_constructor_invocation",SUPERCLASS:"superclass",SUPER_INTERFACES:"super_interfaces",TYPE_LIST:"type_list",GENERATOR_FUNCTION_DECLARATION:"generator_function_declaration",GENERATOR_FUNCTION:"generator_function",FUNCTION_EXPRESSION:"function_expression",PROPERTY_IDENTIFIER:"property_identifier",IMPLEMENTS_CLAUSE:"implements_clause",EXTENDS_CLAUSE:"extends_clause",TYPE_ALIAS_DECLARATION:"type_alias_declaration",CLASS_HERITAGE:"class_heritage",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",TRAIT_DECLARATION:"trait_declaration",FUNCTION_CALL_EXPRESSION:"function_call_expression",MEMBER_CALL_EXPRESSION:"member_call_expression",SCOPED_CALL_EXPRESSION:"scoped_call_expression",NAME:"name",BASE_CLAUSE:"base_clause",CLASS_INTERFACE_CLAUSE:"class_interface_clause",IMPORT_FROM_STATEMENT:"import_from_statement",CLASS_DEFINITION:"class_definition",ARGUMENT_LIST:"argument_list",CLASS:"class",MODULE:"module",SINGLETON_CLASS:"singleton_class",METHOD:"method",SINGLETON_METHOD:"singleton_method",CONSTANT:"constant",SCOPE_RESOLUTION:"scope_resolution",BASE_CLASS_CLAUSE:"base_class_clause",QUALIFIED_IDENTIFIER:"qualified_identifier",STRUCT_ITEM:"struct_item",ENUM_ITEM:"enum_item",UNION_ITEM:"union_item",TRAIT_ITEM:"trait_item",FUNCTION_ITEM:"function_item"};var Ft="tree-sitter-typescript.wasm",se={extensions:Y,wasm_file:Ft,imports:[r.IMPORT_STATEMENT,l.EXPORT_STATEMENT],classes:[r.CLASS_DECLARATION,r.ABSTRACT_CLASS_DECLARATION,r.INTERFACE_DECLARATION,r.ENUM_DECLARATION,r.TYPE_ALIAS_DECLARATION],functions:[r.FUNCTION_DECLARATION,r.METHOD_DEFINITION,r.ARROW_FUNCTION,r.FUNCTION_EXPRESSION,r.GENERATOR_FUNCTION_DECLARATION,r.GENERATOR_FUNCTION],calls:[r.CALL_EXPRESSION],implements:[r.IMPLEMENTS_CLAUSE],extends:[r.EXTENDS_CLAUSE],queries:{classes:`(${r.CLASS_DECLARATION} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.ABSTRACT_CLASS_DECLARATION} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.INTERFACE_DECLARATION} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.ENUM_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.TYPE_ALIAS_DECLARATION} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS}`,functions:`(${r.FUNCTION_DECLARATION}) @${c.FUNCTION} (${r.METHOD_DEFINITION}) @${c.FUNCTION} (${r.ARROW_FUNCTION}) @${c.FUNCTION} (${r.FUNCTION_EXPRESSION}) @${c.FUNCTION} (${r.GENERATOR_FUNCTION_DECLARATION}) @${c.FUNCTION} (${r.GENERATOR_FUNCTION}) @${c.FUNCTION}`,imports:`(${r.IMPORT_STATEMENT}) @${c.IMPORT} (${l.EXPORT_STATEMENT} source: (string)) @${c.IMPORT}`,variables:`(export_statement declaration: (lexical_declaration (variable_declarator name: (${r.IDENTIFIER})) @${c.VARIABLE}))`,calls:`(${r.CALL_EXPRESSION} function: [(${r.IDENTIFIER}) (${r.MEMBER_EXPRESSION})] @${c.CALL})`,implements:`(${r.IMPLEMENTS_CLAUSE} (_) @${c.IMPLEMENTS})`,extends:`(${r.EXTENDS_CLAUSE} value: (_) @${c.EXTENDS})`}};var gt="tree-sitter-javascript.wasm",ae={extensions:B,wasm_file:gt,imports:[r.IMPORT_STATEMENT,l.EXPORT_STATEMENT],classes:[r.CLASS_DECLARATION],functions:[r.FUNCTION_DECLARATION,r.METHOD_DEFINITION,r.ARROW_FUNCTION,r.FUNCTION_EXPRESSION,r.GENERATOR_FUNCTION_DECLARATION,r.GENERATOR_FUNCTION],calls:[r.CALL_EXPRESSION],extends:[r.CLASS_HERITAGE],queries:{classes:`(${r.CLASS_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS}`,functions:`(${r.FUNCTION_DECLARATION}) @${c.FUNCTION} (${r.METHOD_DEFINITION}) @${c.FUNCTION} (${r.ARROW_FUNCTION}) @${c.FUNCTION} (${r.FUNCTION_EXPRESSION}) @${c.FUNCTION} (${r.GENERATOR_FUNCTION_DECLARATION}) @${c.FUNCTION} (${r.GENERATOR_FUNCTION}) @${c.FUNCTION}`,imports:`(${r.IMPORT_STATEMENT}) @${c.IMPORT} (${l.EXPORT_STATEMENT} source: (string)) @${c.IMPORT}`,variables:`(export_statement declaration: (lexical_declaration (variable_declarator name: (${r.IDENTIFIER})) @${c.VARIABLE}))`,calls:`(${r.CALL_EXPRESSION} function: [(${r.IDENTIFIER}) (${r.MEMBER_EXPRESSION})] @${c.CALL})`,extends:`(${r.CLASS_HERITAGE} "extends" (_) @${c.EXTENDS})`}};var xt="tree-sitter-python.wasm",ce={extensions:G,wasm_file:xt,imports:[r.IMPORT_STATEMENT,r.IMPORT_FROM_STATEMENT],classes:[r.CLASS_DEFINITION],functions:[r.FUNCTION_DEFINITION],calls:[r.CALL],extends:[r.CLASS_DEFINITION],queries:{classes:`(${r.CLASS_DEFINITION} name: (${r.IDENTIFIER})) @${c.CLASS}`,functions:`(${r.FUNCTION_DEFINITION} name: (${r.IDENTIFIER})) @${c.FUNCTION}`,imports:`(${r.IMPORT_STATEMENT}) @${c.IMPORT} (${r.IMPORT_FROM_STATEMENT}) @${c.IMPORT}`,calls:`(${r.CALL} function: [(${r.IDENTIFIER}) (${r.ATTRIBUTE})] @${c.CALL})`,extends:`(${r.CLASS_DEFINITION} (${r.ARGUMENT_LIST} [(${r.IDENTIFIER}) (${r.ATTRIBUTE})] @${c.EXTENDS}))`}};var $t="tree-sitter-rust.wasm",le={extensions:H,wasm_file:$t,imports:[r.USE_DECLARATION],classes:[r.STRUCT_ITEM,r.ENUM_ITEM,r.UNION_ITEM,r.TRAIT_ITEM],functions:[r.FUNCTION_ITEM],calls:[r.CALL_EXPRESSION],queries:{classes:`(${r.STRUCT_ITEM} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.ENUM_ITEM} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.UNION_ITEM} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.TRAIT_ITEM} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS}`,functions:`(${r.FUNCTION_ITEM} name: (${r.IDENTIFIER})) @${c.FUNCTION}`,imports:`(${r.USE_DECLARATION}) @${c.IMPORT}`,calls:`(${r.CALL_EXPRESSION} function: [(${r.IDENTIFIER}) (${r.FIELD_EXPRESSION})] @${c.CALL})`}};var yt="tree-sitter-go.wasm",Ee={extensions:Q,wasm_file:yt,imports:[r.IMPORT_DECLARATION],classes:[r.TYPE_DECLARATION],functions:[r.FUNCTION_DECLARATION,r.METHOD_DECLARATION],calls:[r.CALL_EXPRESSION],queries:{classes:`(${r.TYPE_SPEC} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS}`,functions:`(${r.FUNCTION_DECLARATION} name: (${r.IDENTIFIER})) @${c.FUNCTION} (${r.METHOD_DECLARATION} name: (${r.FIELD_IDENTIFIER})) @${c.FUNCTION}`,imports:`(${r.IMPORT_DECLARATION}) @${c.IMPORT}`,calls:`(${r.CALL_EXPRESSION} function: [(${r.IDENTIFIER}) (${r.SELECTOR_EXPRESSION})] @${c.CALL})`}};var Mt="tree-sitter-java.wasm",Ne={extensions:V,wasm_file:Mt,imports:[r.IMPORT_DECLARATION],classes:[r.CLASS_DECLARATION,r.INTERFACE_DECLARATION,r.ENUM_DECLARATION,r.ANNOTATION_TYPE_DECLARATION,r.RECORD_DECLARATION],functions:[r.METHOD_DECLARATION,r.CONSTRUCTOR_DECLARATION,r.COMPACT_CONSTRUCTOR_DECLARATION],calls:[r.METHOD_INVOCATION,r.EXPLICIT_CONSTRUCTOR_INVOCATION],extends:[r.SUPERCLASS],implements:[r.SUPER_INTERFACES],queries:{classes:`(${r.CLASS_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.INTERFACE_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.ENUM_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.ANNOTATION_TYPE_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.RECORD_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS}`,functions:`(${r.METHOD_DECLARATION} name: (${r.IDENTIFIER})) @${c.FUNCTION} (${r.CONSTRUCTOR_DECLARATION} name: (${r.IDENTIFIER})) @${c.FUNCTION} (${r.COMPACT_CONSTRUCTOR_DECLARATION} name: (${r.IDENTIFIER})) @${c.FUNCTION}`,imports:`(${r.IMPORT_DECLARATION}) @${c.IMPORT}`,calls:`(${r.METHOD_INVOCATION} name: (${r.IDENTIFIER}) @${c.CALL}) (${r.EXPLICIT_CONSTRUCTOR_INVOCATION}) @${c.CALL}`,extends:`(${r.SUPERCLASS} (${r.TYPE_IDENTIFIER}) @${c.EXTENDS})`,implements:`(${r.SUPER_INTERFACES} (${r.TYPE_LIST} (${r.TYPE_IDENTIFIER}) @${c.IMPLEMENTS}))`}};var Ut="tree-sitter-c.wasm",Ie={extensions:j,wasm_file:Ut,imports:[r.PREPROC_INCLUDE],classes:[r.STRUCT_SPECIFIER,r.ENUM_SPECIFIER,r.UNION_SPECIFIER,r.TYPE_DEFINITION],functions:[r.FUNCTION_DEFINITION],calls:[r.CALL_EXPRESSION],queries:{classes:`(${r.STRUCT_SPECIFIER} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.ENUM_SPECIFIER} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.UNION_SPECIFIER} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.TYPE_DEFINITION} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS}`,functions:`(${r.FUNCTION_DEFINITION} declarator: (${r.FUNCTION_DECLARATOR} declarator: (${r.IDENTIFIER}))) @${c.FUNCTION}`,imports:`(${r.PREPROC_INCLUDE}) @${c.IMPORT}`,calls:`(${r.CALL_EXPRESSION} function: (${r.IDENTIFIER}) @${c.CALL})`}};var wt="tree-sitter-cpp.wasm",fe={extensions:W,wasm_file:wt,imports:[r.PREPROC_INCLUDE,r.USING_DECLARATION],classes:[r.CLASS_SPECIFIER,r.STRUCT_SPECIFIER,r.ENUM_SPECIFIER,r.UNION_SPECIFIER,r.TYPE_DEFINITION],functions:[r.FUNCTION_DEFINITION],calls:[r.CALL_EXPRESSION],extends:[r.BASE_CLASS_CLAUSE],queries:{classes:`(${r.CLASS_SPECIFIER} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.STRUCT_SPECIFIER} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.ENUM_SPECIFIER} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.UNION_SPECIFIER} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS} (${r.TYPE_DEFINITION} name: (${r.TYPE_IDENTIFIER})) @${c.CLASS}`,functions:`(${r.FUNCTION_DEFINITION} declarator: (${r.FUNCTION_DECLARATOR} declarator: [(${r.IDENTIFIER}) (${r.FIELD_IDENTIFIER}) (${r.QUALIFIED_IDENTIFIER})])) @${c.FUNCTION}`,imports:`(${r.PREPROC_INCLUDE}) @${c.IMPORT} (${r.USING_DECLARATION}) @${c.IMPORT}`,calls:`(${r.CALL_EXPRESSION} function: [(${r.IDENTIFIER}) (${r.FIELD_EXPRESSION})] @${c.CALL})`,extends:`(${r.BASE_CLASS_CLAUSE} (${r.TYPE_IDENTIFIER}) @${c.EXTENDS})`}};var bt="tree-sitter-ruby.wasm",ue={extensions:q,wasm_file:bt,imports:[r.CALL],classes:[r.CLASS,r.MODULE,r.SINGLETON_CLASS],functions:[r.METHOD,r.SINGLETON_METHOD],calls:[r.CALL],extends:[r.SUPERCLASS],queries:{classes:`(${r.CLASS} name: [(${r.CONSTANT}) (${r.SCOPE_RESOLUTION})]) @${c.CLASS} (${r.MODULE} name: (${r.CONSTANT})) @${c.CLASS} (${r.SINGLETON_CLASS}) @${c.CLASS}`,functions:`(${r.METHOD} name: (${r.IDENTIFIER})) @${c.FUNCTION} (${r.SINGLETON_METHOD} name: (${r.IDENTIFIER})) @${c.FUNCTION}`,imports:`((${r.CALL} method: (${r.IDENTIFIER}) @_method) @${c.IMPORT} (#match? @_method "^(require|require_relative|load)$"))`,calls:`(${r.CALL} method: (${r.IDENTIFIER}) @${c.CALL})`,extends:`(${r.SUPERCLASS} (_) @${c.EXTENDS})`}};var Xt="tree-sitter-php.wasm",Te={extensions:J,wasm_file:Xt,imports:[r.NAMESPACE_USE_DECLARATION,r.INCLUDE_EXPRESSION,r.INCLUDE_ONCE_EXPRESSION,r.REQUIRE_EXPRESSION,r.REQUIRE_ONCE_EXPRESSION],classes:[r.CLASS_DECLARATION,r.INTERFACE_DECLARATION,r.TRAIT_DECLARATION,r.ENUM_DECLARATION],functions:[r.FUNCTION_DEFINITION,r.METHOD_DECLARATION],calls:[r.FUNCTION_CALL_EXPRESSION,r.MEMBER_CALL_EXPRESSION,r.SCOPED_CALL_EXPRESSION],extends:[r.BASE_CLAUSE],implements:[r.CLASS_INTERFACE_CLAUSE],queries:{classes:`(${r.CLASS_DECLARATION} name: (${r.NAME})) @${c.CLASS} (${r.INTERFACE_DECLARATION} name: (${r.NAME})) @${c.CLASS} (${r.TRAIT_DECLARATION} name: (${r.NAME})) @${c.CLASS} (${r.ENUM_DECLARATION} name: (${r.NAME})) @${c.CLASS}`,functions:`(${r.FUNCTION_DEFINITION} name: (${r.NAME})) @${c.FUNCTION} (${r.METHOD_DECLARATION} name: (${r.NAME})) @${c.FUNCTION}`,imports:`(${r.NAMESPACE_USE_DECLARATION}) @${c.IMPORT} (${r.INCLUDE_EXPRESSION}) @${c.IMPORT} (${r.INCLUDE_ONCE_EXPRESSION}) @${c.IMPORT} (${r.REQUIRE_EXPRESSION}) @${c.IMPORT} (${r.REQUIRE_ONCE_EXPRESSION}) @${c.IMPORT}`,calls:`(${r.FUNCTION_CALL_EXPRESSION} function: (${r.NAME}) @${c.CALL}) (${r.MEMBER_CALL_EXPRESSION} name: (${r.NAME}) @${c.CALL}) (${r.SCOPED_CALL_EXPRESSION} name: (${r.NAME}) @${c.CALL})`,extends:`(${r.BASE_CLAUSE} (${r.NAME}) @${c.EXTENDS})`,implements:`(${r.CLASS_INTERFACE_CLAUSE} (${r.NAME}) @${c.IMPLEMENTS})`}};var vt="tree-sitter-c_sharp.wasm",de={extensions:K,wasm_file:vt,imports:[r.USING_DIRECTIVE],classes:[r.CLASS_DECLARATION,r.STRUCT_DECLARATION,r.INTERFACE_DECLARATION,r.ENUM_DECLARATION,r.RECORD_DECLARATION],functions:[r.METHOD_DECLARATION,r.CONSTRUCTOR_DECLARATION,r.DESTRUCTOR_DECLARATION,r.CONVERSION_OPERATOR_DECLARATION,r.OPERATOR_DECLARATION,r.LOCAL_FUNCTION_STATEMENT],calls:[r.INVOCATION_EXPRESSION,r.OBJECT_CREATION_EXPRESSION],extends:[r.BASE_LIST],queries:{classes:`(${r.CLASS_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.STRUCT_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.INTERFACE_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.ENUM_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS} (${r.RECORD_DECLARATION} name: (${r.IDENTIFIER})) @${c.CLASS}`,functions:`(${r.METHOD_DECLARATION} name: (${r.IDENTIFIER})) @${c.FUNCTION} (${r.CONSTRUCTOR_DECLARATION} name: (${r.IDENTIFIER})) @${c.FUNCTION} (${r.DESTRUCTOR_DECLARATION}) @${c.FUNCTION} (${r.CONVERSION_OPERATOR_DECLARATION}) @${c.FUNCTION} (${r.OPERATOR_DECLARATION}) @${c.FUNCTION} (${r.LOCAL_FUNCTION_STATEMENT}) @${c.FUNCTION}`,imports:`(${r.USING_DIRECTIVE}) @${c.IMPORT}`,calls:`(${r.INVOCATION_EXPRESSION}) @${c.CALL} (${r.OBJECT_CREATION_EXPRESSION}) @${c.CALL}`,extends:`(${r.BASE_LIST} (_) @${c.EXTENDS})`}};var kt={languages:{[d.TYPESCRIPT]:se,[d.JAVASCRIPT]:ae,[d.PYTHON]:ce,[d.RUST]:le,[d.GO]:Ee,[d.JAVA]:Ne,[d.C]:Ie,[d.CPP]:fe,[d.RUBY]:ue,[d.PHP]:Te,[d.CSHARP]:de}},y=".tsx",me="tree-sitter-typescript.wasm",Yt="tree-sitter-tsx.wasm";function Bt(t,e){let n;for(let[o,i]of Object.entries(t.languages))i.extensions.includes(e)&&(n=o);return n}function Gt(t){let e=t.getProviderForExtension(y),n=t.getConfig(),o=n.languages[d.TYPESCRIPT];return!o||o.wasm_file!==me||Bt(n,y)!==d.TYPESCRIPT||!e||e.wasm_file!==me||t.registerProvider([y],new O({...o,extensions:[y],wasm_file:Yt})),t}async function no(t){return Gt(await $.load(t,kt))}import{Parser as lo,Language as Eo}from"web-tree-sitter";var D;(function(t){t[t.INTERNAL_LOGIC=0]="INTERNAL_LOGIC",t[t.CONTRACT_CHANGED=1]="CONTRACT_CHANGED"})(D||(D={}));var X=new Set([l.FUNCTION_DECLARATION,l.METHOD_DEFINITION,l.ARROW_FUNCTION,l.CLASS_DECLARATION,l.INTERFACE_DECLARATION,l.TYPE_ALIAS_DECLARATION,l.EXPORT_STATEMENT,l.LEXICAL_DECLARATION,l.VARIABLE_DECLARATION]),_e=class{parser;lang;constructor(e,n){this.parser=e,this.lang=n,this.parser.setLanguage(this.lang)}analyze(e,n,o){let i=this.parser.parse(e),s=this.parser.parse(n);if(!i||!s)return i&&i.delete(),s&&s.delete(),[];let a=[];try{let E=this.buildNodeIndex(i.rootNode),I=new Set;for(let N of o)a.push(...this.processChangedRange(N,s.rootNode,E,I))}finally{i&&i.delete(),s&&s.delete()}return a}processChangedRange(e,n,o,i){let s=this.getSmallestContainingNode(n,e);if(!s)return[];let a=this.findSemanticBoundary(s);if(!a)return this.resolveSpanningBoundaries(s,e,o,i);let E=this.buildModifiedNode(a,o,i);return E?[E]:[]}resolveSpanningBoundaries(e,n,o,i){let s=[];for(let a of e.children){if(!a||a.endPosition.row<n.startRow||a.startPosition.row>n.endRow)continue;let E={startRow:Math.max(n.startRow,a.startPosition.row),endRow:Math.min(n.endRow,a.endPosition.row)},I=this.getSmallestContainingNode(a,E);if(!I)continue;let N=this.findSemanticBoundary(I);if(!N)continue;let u=this.buildModifiedNode(N,o,i);u&&s.push(u)}return s}buildModifiedNode(e,n,o){if(o.has(e.id))return null;o.add(e.id);let i=this.getNodeName(e),s=i?n.get(`${e.type}::${i}`):void 0,a=this.resolvePruningLevel(s,e);return{nodeId:i||this.getStableStructuralNodeId(e),nodeType:e.type,pruningLevel:a,newRange:{startRow:e.startPosition.row,endRow:e.endPosition.row}}}resolvePruningLevel(e,n){if(!e)return D.CONTRACT_CHANGED;let o=this.getSignature(e),i=this.getSignature(n);return o===i?D.INTERNAL_LOGIC:D.CONTRACT_CHANGED}buildNodeIndex(e){let n=new Map,o=i=>{if(X.has(i.type)){let s=this.getNodeName(i),a=s?`${i.type}::${s}`:null;a&&!n.has(a)&&n.set(a,i)}for(let s of i.children)s&&o(s)};return o(e),n}getSmallestContainingNode(e,n){if(e.startPosition.row>n.endRow||e.endPosition.row<n.startRow)return null;if(e.startPosition.row<=n.startRow&&e.endPosition.row>=n.endRow){for(let o of e.children){if(!o)continue;let i=this.getSmallestContainingNode(o,n);if(i)return i}return e}return null}findSemanticBoundary(e){let n=e;for(;n;){if(X.has(n.type))return n;n=n.parent}return null}getNodeName(e){let n=e.childForFieldName("name");if(n)return n.text;let o=this.getExportedDeclarationName(e);return o||this.getVariableDeclarationName(e)}getExportedDeclarationName(e){if(e.type!==l.EXPORT_STATEMENT)return null;let n=e.childForFieldName("declaration");if(n){let o=this.getNodeName(n);if(o)return o}for(let o of e.namedChildren){if(!o||o.type===l.EXPORT_STATEMENT||!X.has(o.type))continue;let i=this.getNodeName(o);if(i)return i}return null}getVariableDeclarationName(e){return e.type!==l.VARIABLE_DECLARATION&&e.type!==l.LEXICAL_DECLARATION?null:e.children.find(o=>o.type===l.VARIABLE_DECLARATOR)?.childForFieldName("name")?.text??null}getStableStructuralNodeId(e){return`${e.type}@${e.startPosition.row}:${e.startPosition.column}-${e.endPosition.row}:${e.endPosition.column}`}getSignature(e){let n=e.childForFieldName("body")||e.childForFieldName("value");if(e.type===l.VARIABLE_DECLARATION||e.type===l.LEXICAL_DECLARATION){let o=e.children.find(i=>i.type===l.VARIABLE_DECLARATOR);if(o){let i=o.childForFieldName("value");if(i&&i.type===l.ARROW_FUNCTION){let s=i.childForFieldName("body");if(s)return this.getTextExcludingNode(e,s)}}}return n?this.getTextExcludingNode(e,n):e.text}getTextExcludingNode(e,n){let o=[],i=s=>{if(s.id!==n.id)if(s.childCount===0)o.push(s.text);else for(let a of s.children)a&&i(a)};return i(e),o.join(" ").trim().replace(/\s+/g," ")}};import*as _ from"path";import*as k from"fs";import{createRequire as Ht}from"module";import{fileURLToPath as Qt}from"url";var Vt=Qt(import.meta.url),v=_.dirname(Vt),jt=Ht(import.meta.url);function ei(t){let e=_.resolve(v,"../../../../"),n=[];try{let i=jt.resolve("tree-sitter-wasms/package.json",{paths:[v,e]}),s=_.join(_.dirname(i),"out",t);if(n.push(s),k.existsSync(s))return{wasmPath:s,attemptedPaths:n}}catch{}let o=[_.resolve(e,`node_modules/tree-sitter-wasms/out/${t}`),_.resolve(v,`../../../node_modules/tree-sitter-wasms/out/${t}`),_.resolve(e,`node_modules/.pnpm/tree-sitter-wasms@0.1.13/node_modules/tree-sitter-wasms/out/${t}`),_.resolve(e,`artifacts/vscode-client/out/wasm/${t}`)];for(let i of o)if(n.push(i),k.existsSync(i))return{wasmPath:i,attemptedPaths:n};return{wasmPath:o[o.length-1],attemptedPaths:n}}function ri(t,e,n){if(!t.has(e))return e;let o=`${e}@L${n}`;if(!t.has(o))return o;let i=2;for(;t.has(`${o}#${i}`);)i++;return`${o}#${i}`}function oi(t,e,n){return n?`${t}#${n}.${e}`:`${t}#${e}`}export{z as a,Jt as b,Kt as c,zt as d,ri as e,oi as f,on as g,sn as h,r as i,no as j,_e as k,ei as l};
23
+ /*! Bundled license information:
24
+
25
+ smol-toml/dist/date.js:
26
+ smol-toml/dist/error.js:
27
+ smol-toml/dist/primitive.js:
28
+ smol-toml/dist/util.js:
29
+ smol-toml/dist/extract.js:
30
+ smol-toml/dist/struct.js:
31
+ smol-toml/dist/parse.js:
32
+ smol-toml/dist/stringify.js:
33
+ smol-toml/dist/index.js:
34
+ (*!
35
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
36
+ * SPDX-License-Identifier: BSD-3-Clause
37
+ *
38
+ * Redistribution and use in source and binary forms, with or without
39
+ * modification, are permitted provided that the following conditions are met:
40
+ *
41
+ * 1. Redistributions of source code must retain the above copyright notice, this
42
+ * list of conditions and the following disclaimer.
43
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
44
+ * this list of conditions and the following disclaimer in the
45
+ * documentation and/or other materials provided with the distribution.
46
+ * 3. Neither the name of the copyright holder nor the names of its contributors
47
+ * may be used to endorse or promote products derived from this software without
48
+ * specific prior written permission.
49
+ *
50
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
51
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
52
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
53
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
54
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
56
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
57
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
58
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
59
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60
+ *)
61
+ */
62
+ //# sourceMappingURL=chunk-QLKE7SQF.js.map