docuvia 1.8.14 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{Aa as N,ea as c}from"./chunk-WL3HOIHC.js";import*as a 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 i={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"},v={PASS:"\u2713",FAIL:"\u2717"},u="\u25C6";var E={SPACE:" ",EMPTY:""};function L(e){return e.replace(/\s+/g,E.SPACE).trim()}function h(e,n){if(e.length<=n)return[e];let t=e.split(E.SPACE),r=[],o=E.EMPTY;for(let s of t){let A=o?`${o}${E.SPACE}${s}`:s;A.length>n&&o?(r.push(o),o=s):o=A}return o&&r.push(o),r}function U(e,n){return e+E.SPACE.repeat(Math.max(0,n-e.length))}function O(e,n,t,r){return n+e.map(o=>i.HORIZONTAL.repeat(o+2)).join(t)+r}function C(e,n){let t=e.map((r,o)=>U(r??E.EMPTY,n[o]));return`${i.VERTICAL} ${t.join(` ${i.VERTICAL} `)} ${i.VERTICAL}`}function f(e,n){return e.map((t,r)=>{let o=Math.max(t.header.length,...n.map(s=>(s[r]??E.EMPTY).length));return t.maxWidth?Math.min(o,t.maxWidth):o})}function D(e,n){let t=e.map(_=>L(_.header)),r=n.map(_=>_.map(d=>L(d??E.EMPTY))),o=f(e.map((_,d)=>({..._,header:t[d]})),r),s=r.map(_=>e.map((d,T)=>h(_[T]??E.EMPTY,o[T]))),A=[O(o,i.TOP_LEFT,i.T_DOWN,i.TOP_RIGHT),C(t,o),O(o,i.T_RIGHT,i.CROSS,i.T_LEFT)];for(let _ of s){let d=Math.max(..._.map(T=>T.length));for(let T=0;T<d;T++)A.push(C(_.map(m=>m[T]??E.EMPTY),o))}return A.push(O(o,i.BOTTOM_LEFT,i.T_UP,i.BOTTOM_RIGHT)),A}function g(e){let n=i.HORIZONTAL.repeat(e.length+2);return[`${i.TOP_LEFT}${n}${i.TOP_RIGHT}`,`${i.VERTICAL} ${e} ${i.VERTICAL}`,`${i.BOTTOM_LEFT}${n}${i.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 n of g(e))console.log(l.cyan(n));console.log()},section:e=>{console.log(),console.log(l.bold(l.cyan(`${u} ${e}`)))},table:(e,n)=>{for(let t of D(e,n))console.log(t)},askConfirm:async(e,n=!0)=>await b({message:e,default:n}),askSelect:async(e,n)=>await P({message:e,choices:n}),askCheckbox:async(e,n)=>await F({message:e,choices:n}),askInput:async(e,n)=>await H({message:e,default:n})};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,n)=>`Unexpected shape for "${e}" in ${n} (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,n,t)=>`Parsed ${e}/${n} file(s) (${t} failed).`,ANALYZE_AUTO_DELTA_SUCCESS:"Delta ingestion complete.",ANALYZE_AUTO_DELTA_SUMMARY:(e,n,t)=>`Re-parsed ${e} file(s), dropped ${n} deleted file(s)`+(t>0?`, queued ${t} 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,n)=>`${e} persisted, ${n} deduplicated`,ANALYZE_DECISION_LINE:(e,n,t)=>`${n} (${e}, confidence: ${t})`,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,n,t,r,o)=>`${e} file(s) processed, ${n} corrected edge(s) applied`+(t>0?`, ${t} file(s) left queued for the next batch`:"")+(r>0?`, ${r} file(s) permanently failed (not re-queued)`:"")+(o?", 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{Ca as N,ga as c}from"./chunk-S66GYDVI.js";import*as a 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 i={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"},v={PASS:"\u2713",FAIL:"\u2717"},u="\u25C6";var E={SPACE:" ",EMPTY:""};function L(e){return e.replace(/\s+/g,E.SPACE).trim()}function h(e,n){if(e.length<=n)return[e];let t=e.split(E.SPACE),r=[],o=E.EMPTY;for(let s of t){let A=o?`${o}${E.SPACE}${s}`:s;A.length>n&&o?(r.push(o),o=s):o=A}return o&&r.push(o),r}function U(e,n){return e+E.SPACE.repeat(Math.max(0,n-e.length))}function O(e,n,t,r){return n+e.map(o=>i.HORIZONTAL.repeat(o+2)).join(t)+r}function C(e,n){let t=e.map((r,o)=>U(r??E.EMPTY,n[o]));return`${i.VERTICAL} ${t.join(` ${i.VERTICAL} `)} ${i.VERTICAL}`}function f(e,n){return e.map((t,r)=>{let o=Math.max(t.header.length,...n.map(s=>(s[r]??E.EMPTY).length));return t.maxWidth?Math.min(o,t.maxWidth):o})}function D(e,n){let t=e.map(_=>L(_.header)),r=n.map(_=>_.map(d=>L(d??E.EMPTY))),o=f(e.map((_,d)=>({..._,header:t[d]})),r),s=r.map(_=>e.map((d,T)=>h(_[T]??E.EMPTY,o[T]))),A=[O(o,i.TOP_LEFT,i.T_DOWN,i.TOP_RIGHT),C(t,o),O(o,i.T_RIGHT,i.CROSS,i.T_LEFT)];for(let _ of s){let d=Math.max(..._.map(T=>T.length));for(let T=0;T<d;T++)A.push(C(_.map(m=>m[T]??E.EMPTY),o))}return A.push(O(o,i.BOTTOM_LEFT,i.T_UP,i.BOTTOM_RIGHT)),A}function g(e){let n=i.HORIZONTAL.repeat(e.length+2);return[`${i.TOP_LEFT}${n}${i.TOP_RIGHT}`,`${i.VERTICAL} ${e} ${i.VERTICAL}`,`${i.BOTTOM_LEFT}${n}${i.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 n of g(e))console.log(l.cyan(n));console.log()},section:e=>{console.log(),console.log(l.bold(l.cyan(`${u} ${e}`)))},table:(e,n)=>{for(let t of D(e,n))console.log(t)},askConfirm:async(e,n=!0)=>await b({message:e,default:n}),askSelect:async(e,n)=>await P({message:e,choices:n}),askCheckbox:async(e,n)=>await F({message:e,choices:n}),askInput:async(e,n)=>await H({message:e,default:n})};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,n)=>`Unexpected shape for "${e}" in ${n} (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,n,t)=>`Parsed ${e}/${n} file(s) (${t} failed).`,ANALYZE_AUTO_DELTA_SUCCESS:"Delta ingestion complete.",ANALYZE_AUTO_DELTA_SUMMARY:(e,n,t)=>`Re-parsed ${e} file(s), dropped ${n} deleted file(s)`+(t>0?`, queued ${t} 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,n)=>`${e} persisted, ${n} deduplicated`,ANALYZE_DECISION_LINE:(e,n,t)=>`${n} (${e}, confidence: ${t})`,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,n,t,r,o)=>`${e} file(s) processed, ${n} corrected edge(s) applied`+(t>0?`, ${t} file(s) left queued for the next batch`:"")+(r>0?`, ${r} file(s) permanently failed (not re-queued)`:"")+(o?", 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,n,t)=>`Tier C: ${e} candidate(s) processed, ${n} decision(s) persisted`+(t>0?`, ${t} 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,n,t)=>`${e} flushed, ${n} deduplicated`+(t>0?`, ${t} left staged for a future commit.`:"."),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,n)=>`${e} of ${n} 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,n)=>`Removed git hooks (post-commit: ${e?"removed":"not present"}, pre-push: ${n?"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,n)=>`Summary: ${e}/${n} 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,n)=>`No callers found, but ${e} of ${n} 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,n,t)=>`Nodes: ${e}, Links: ${n}, Groups: ${t}`,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,n)=>`Unknown hook '${e??""}' -- valid names: ${n.join(", ")}`,HOOKS_UNKNOWN_SUBCOMMAND:e=>`Unknown 'docuvia hooks' subcommand '${e??""}' -- expected list, enable, disable, or check`};async function j(e,n,t){let r;try{r=await a.readFile(e,c)}catch(o){o.code!==N&&I.warn(`${S.FS_READ_ERROR}${e} (${o.code??S.FS_READ_ERROR_UNKNOWN_CODE}); creating a new file instead of appending`)}if(r===void 0){await a.mkdir(p.dirname(e),{recursive:!0}),await a.writeFile(e,n),I.success(S.FS_CREATED+e);return}r.includes(t)?I.info(S.FS_ALREADY_EXISTS+e):(await a.appendFile(e,`
4
4
  ${n}`),I.success(S.FS_APPENDED+e))}async function G(e){try{let n=await a.readFile(e,c),t=`${e}.bak`;return await a.writeFile(t,n,c),t}catch{return null}}async function J(e,n,t){try{let r=await a.readFile(e,c),o=r.indexOf(n);if(o===-1)return!1;let s=r.indexOf(t,o);if(s===-1)return!1;await G(e);let A=r.slice(0,o),_=r.slice(s+t.length);return await a.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{i as a,v as b,I as c,S as d,j as e,G as f,J as g};
6
- //# sourceMappingURL=chunk-YBPQ2IUS.js.map
6
+ //# sourceMappingURL=chunk-YDHQRUDO.js.map
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{F as e,H as o,Ka as t,_ as n}from"./chunk-WL3HOIHC.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
2
+ import{H as e,J as o,Ma as t,aa as n}from"./chunk-S66GYDVI.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-KDURFY2Q.js.map
82
+ //# sourceMappingURL=chunk-YDTYZF6M.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/constants/init-templates.ts"],"sourcesContent":["// Shared with lib/ui-core's DoctorWorkflow agent-hooks diagnostic -- defined in\n// @workspace/contracts so neither side depends on the other; re-exported here so this file\n// stays the single import path\n// every platform installer already uses. Also imported (not just re-exported) below so\n// CLAUDE_PROJECT_HOOKS_DIR can build off the same value instead of re-typing it.\nimport { CLAUDE_HOOKS_DIR } from \"@workspace/contracts\";\nexport {\n CLAUDE_HOOKS_DIR,\n CURSOR_HOOKS_DIR,\n DOCUVIA_HOOK_JS_FILENAME,\n DOCUVIA_HOOK_CJS_FILENAME,\n} from \"@workspace/contracts\";\n// `context-injection`'s enforcement gate (issue #42 §7.5): this file is itself normal\n// TypeScript, so it can import the shared literal values and interpolate them into the\n// generated `.js` template text at compile time -- the *generated* raw hook script on disk just\n// contains the resolved strings, no runtime import (a standalone `.js` hook file has no\n// `@workspace/contracts` to import from).\nimport {\n HookNames,\n HOOKS_CONFIG_FILE_NAME,\n DOCUVIA_DIR_NAME,\n} from \"@workspace/contracts\";\n\nexport const GITHUB_DIR = \".github\";\nexport const CLAUDE_DIR = \".claude\";\n\nexport const HOOKS_CONFIG_FILENAME = \"hooks.json\";\nexport const SETTINGS_JSON_FILENAME = \"settings.json\";\n\nexport const CURSOR_MCP_CONFIG_PATH = \".cursor/mcp.json\";\nexport const CLAUDE_DESKTOP_CONFIG_FILENAME = \"claude_desktop_config.json\";\nexport const MCP_SERVER_ALIAS = \"docuvia-local\";\n\nexport const COPILOT_INSTRUCTIONS_FILENAME = \"copilot-instructions.md\";\nexport const CLAUDE_MD_FILENAME = \"CLAUDE.md\";\nexport const CURSOR_RULES_FILENAME = \".cursorrules\";\nexport const AGENT_INSTRUCTIONS_MARKER = \"docuvia:start\";\nexport const AGENT_INSTRUCTIONS_END_MARKER = \"docuvia:end\";\n\n// PLAT-008 legacy-only: these two files were written by the retired \"Markdown Agents\" catch-all\n// and are never installed to anymore, but `uninstall` still best-effort cleans them up for repos\n// set up under an older Docuvia version.\nexport const WINDSURF_RULES_FILENAME = \".windsurfrules\";\nexport const LLMS_TXT_FILENAME = \"llms.txt\";\n\nexport const AGENTS_MD_FILENAME = \"AGENTS.md\";\nexport const HERMES_MD_FILENAME = \".hermes.md\";\nexport const CONTINUE_RULES_DIR = \".continue/rules\";\nexport const CONTINUE_RULES_FILENAME = \"docuvia.md\";\n\nexport const PLATFORM_NAME_CURSOR = \"Cursor\";\nexport const PLATFORM_NAME_CLAUDE = \"Claude\";\nexport const PLATFORM_NAME_COPILOT = \"GitHub Copilot\";\nexport const PLATFORM_NAME_CODEX = \"Codex\";\nexport const PLATFORM_NAME_CONTINUE = \"Continue\";\nexport const PLATFORM_NAME_HERMES = \"Hermes Agent\";\n\n// Stable, CLI-facing identifiers for --platform= — PLATFORM_NAME_* above is the display name only.\nexport const PLATFORM_SLUG_CURSOR = \"cursor\";\nexport const PLATFORM_SLUG_CLAUDE = \"claude\";\nexport const PLATFORM_SLUG_COPILOT = \"copilot\";\nexport const PLATFORM_SLUG_CODEX = \"codex\";\nexport const PLATFORM_SLUG_CONTINUE = \"continue\";\nexport const PLATFORM_SLUG_HERMES = \"hermes\";\n\n// Literal placeholder text written into each platform's hooks.json `${HOOKS_DIR}` substitution —\n// the platform itself expands these at runtime, so they must stay un-interpolated here.\nexport const CLAUDE_PLUGIN_HOOKS_DIR = \"${CLAUDE_PLUGIN_ROOT}/hooks\";\nexport const CURSOR_PLUGIN_HOOKS_DIR = \"${CURSOR_PLUGIN_ROOT}/hooks\";\n\n// Project-level equivalent of CLAUDE_PLUGIN_HOOKS_DIR above. `${CLAUDE_PLUGIN_ROOT}` only resolves\n// inside a formal Claude Code plugin install (and is currently broken there too --\n// anthropics/claude-code#24529); `${CLAUDE_PROJECT_DIR}` resolves correctly today in a project-level\n// `.claude/settings.json` hook, so ClaudePlatform also writes a hook entry through this path,\n// pointing at the same `.claude/hooks` dir `configureHooks` already writes `docuvia-hook.js` into\n// (roadmap-and-open-items.md item 26).\nexport const CLAUDE_PROJECT_HOOKS_DIR =\n \"${CLAUDE_PROJECT_DIR}/\" + CLAUDE_HOOKS_DIR;\n\nexport const NPX_COMMAND = \"npx\";\nexport const NPX_YES_FLAG = \"-y\";\nexport const NPX_NO_INSTALL_FLAG = \"--no-install\";\nexport const DOCUVIA_MCP_LAUNCH_ARGS = [\"docuvia\", \"mcp\"];\nexport const DOCUVIA_WORKSPACE_ROOT_ENV_VAR = \"DOCUVIA_WORKSPACE_ROOT\";\n\nexport const DOCUVIA_HOOK_JS = `#!/usr/bin/env node\n/**\n * Docuvia Agent Hook\n * Intercepts AI searches and augments with high-density AST context from local SQLite.\n */\nconst { execFileSync } = require('child_process');\n\nfunction readInput() {\n try {\n const data = require('fs').readFileSync(0, 'utf-8');\n return JSON.parse(data);\n } catch {\n return {};\n }\n}\n\n// \\`docuvia hooks disable ${HookNames.CONTEXT_INJECTION}\\`'s enforcement (issue #42 §7.5) -- a\n// plain synchronous read, no subprocess: this hook fires on every Grep/Glob/Bash/Read, so a\n// second \\`npx docuvia ...\\` spawn per call would be a real, continuous latency cost, not a\n// one-off. Missing/unparseable config -> enabled (fail open, matches the always-on behavior this\n// toggle is retrofitted onto).\nfunction isEnabled() {\n try {\n const config = JSON.parse(\n require('fs').readFileSync('${DOCUVIA_DIR_NAME}/${HOOKS_CONFIG_FILE_NAME}', 'utf-8'),\n );\n return config['${HookNames.CONTEXT_INJECTION}'] !== false;\n } catch {\n return true;\n }\n}\n\nconst input = readInput();\n// Use the query arguments as the target to retrieve context\nconst target = input.args ? input.args.query || input.args.pattern : null;\n\nif (target && isEnabled()) {\n try {\n // Call the local Docuvia CLI to retrieve exact L2/L3 structural context. target is passed as a\n // literal argv element via execFileSync (no shell) instead of string-interpolated into an\n // execSync shell command (issue #51): target is tool-call input (Grep/Glob/Bash/Read\n // query/pattern) that an agent or, transitively, a prompt can influence, so the old\n // interpolation was a real shell-injection exposure. npx is a .cmd shim on Windows that\n // execFileSync can't spawn as a bare name, so resolve the platform-specific name inline (this\n // standalone script can't import windows-shell-spawn.ts).\n const npx = process.platform === 'win32' ? 'npx.cmd' : 'npx';\n const context = execFileSync(\n npx,\n ['--no-install', 'docuvia', 'query', target, '--format=prompt'],\n { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] },\n );\n if (context && context.trim().length > 0) {\n console.log(\"=== Docuvia Context injected ===\");\n console.log(context);\n console.log(\"================================\");\n }\n } catch (e) {\n const errorMsg = e instanceof Error ? e.message : String(e);\n console.error(\"[Docuvia Pre-Command] Failed to retrieve context: \" + errorMsg);\n }\n}\n`;\n\n// Named so the merge/prune logic in claude.platform.ts's project-level `.claude/settings.json`\n// support reuses this exact key instead of re-typing the literal (a typo there would silently\n// desync the two).\nexport const HOOK_EVENT_PRE_TOOL_USE = \"PreToolUse\";\n\nexport const HOOKS_JSON = JSON.stringify(\n {\n [HOOK_EVENT_PRE_TOOL_USE]: [\n {\n hooks: [\n {\n command: \"node ${HOOKS_DIR}/docuvia-hook.js\",\n statusMessage: \"Enriching with Docuvia architectural context...\",\n timeout: 5,\n type: \"command\",\n },\n ],\n matcher: \"Grep|Glob|Bash|Read\",\n },\n ],\n },\n null,\n 2,\n);\n\nexport const AGENT_INSTRUCTIONS = `\n<!-- ${AGENT_INSTRUCTIONS_MARKER} -->\n# Docuvia — Codebase Knowledge Evolver\n\nThis project uses Docuvia to manage architectural context and prevent blast-radius regressions.\nGrep/Glob/Read are the most expensive tools available to you — before reaching for them to explore the codebase, query the local knowledge graph instead, and before editing a symbol or file, check its blast radius:\n\nRun: \\`npx --no-install docuvia query \"<concept_or_file>\" --format=prompt\\`\nRun: \\`npx --no-install docuvia impact <symbolOrFile>\\`\n\nUse the results to understand architectural boundaries, historical decisions, and potential blast radius before modifying code. Only fall back to Grep/Glob/Read when the graph returns nothing, the target is flagged \\`tier_b_status=\"unprocessed\"\\` (unknown, not zero), you need exact source text/formatting a structural query can't capture, or \\`query\\` returns a non-\\`exact\\` \\`match_type\\` (keyword/neighbor) for what should be a well-known symbol or file.\n\nAfter making a code change that reflects a real architectural decision, rule, or notable rationale, stage it so the graph picks it up without a separate write step:\n\nRun: \\`npx --no-install docuvia analyze <file> --agent-authored --stage\\`\n\nPipe a JSON payload on stdin (default) — \\`{\"decisions\":[{\"title\":string,\"content\":string,\"nodeType\":\"change\"|\"rule\"|\"decision\"|\"context\",\"confidence\":number}]}\\` — or pass \\`--decisions-file=<path>\\` instead. Put \\`--agent-authored\\`/\\`--stage\\` after the positional \\`<file>\\`, not before — 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 — nothing else to run.\n<!-- docuvia:end -->\n`;\n"],"mappings":";8DAuBO,IAAMA,EAAa,UACbC,EAAa,UAEbC,EAAwB,aACxBC,EAAyB,gBAEzBC,EAAyB,mBACzBC,EAAiC,6BACjCC,EAAmB,gBAEnBC,EAAgC,0BAChCC,EAAqB,YACrBC,EAAwB,eACxBC,EAA4B,gBAC5BC,EAAgC,cAKhCC,EAA0B,iBAC1BC,EAAoB,WAEpBC,EAAqB,YACrBC,EAAqB,aACrBC,EAAqB,kBACrBC,EAA0B,aAE1BC,EAAuB,SACvBC,EAAuB,SACvBC,EAAwB,iBACxBC,EAAsB,QACtBC,EAAyB,WACzBC,EAAuB,eAGvBC,EAAuB,SACvBC,EAAuB,SACvBC,EAAwB,UACxBC,EAAsB,QACtBC,EAAyB,WACzBC,EAAuB,SAIvBC,EAA0B,8BAC1BC,EAA0B,8BAQ1BC,EACX,yBAA2BC,EAEhBC,EAAc,MACdC,EAAe,KACfC,EAAsB,eACtBC,EAA0B,CAAC,UAAW,KAAK,EAC3CC,EAAiC,yBAEjCC,EAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAgBFC,EAAU,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAQpBC,CAAgB,IAAIC,CAAsB;AAAA;AAAA,qBAEzDF,EAAU,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwCnCG,EAA0B,aAE1BC,EAAa,KAAK,UAC7B,CACE,CAACD,CAAuB,EAAG,CACzB,CACE,MAAO,CACL,CACE,QAAS,oCACT,cAAe,kDACf,QAAS,EACT,KAAM,SACR,CACF,EACA,QAAS,qBACX,CACF,CACF,EACA,KACA,CACF,EAEaE,EAAqB;AAAA,OAC3BnC,CAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":["GITHUB_DIR","CLAUDE_DIR","HOOKS_CONFIG_FILENAME","SETTINGS_JSON_FILENAME","CURSOR_MCP_CONFIG_PATH","CLAUDE_DESKTOP_CONFIG_FILENAME","MCP_SERVER_ALIAS","COPILOT_INSTRUCTIONS_FILENAME","CLAUDE_MD_FILENAME","CURSOR_RULES_FILENAME","AGENT_INSTRUCTIONS_MARKER","AGENT_INSTRUCTIONS_END_MARKER","WINDSURF_RULES_FILENAME","LLMS_TXT_FILENAME","AGENTS_MD_FILENAME","HERMES_MD_FILENAME","CONTINUE_RULES_DIR","CONTINUE_RULES_FILENAME","PLATFORM_NAME_CURSOR","PLATFORM_NAME_CLAUDE","PLATFORM_NAME_COPILOT","PLATFORM_NAME_CODEX","PLATFORM_NAME_CONTINUE","PLATFORM_NAME_HERMES","PLATFORM_SLUG_CURSOR","PLATFORM_SLUG_CLAUDE","PLATFORM_SLUG_COPILOT","PLATFORM_SLUG_CODEX","PLATFORM_SLUG_CONTINUE","PLATFORM_SLUG_HERMES","CLAUDE_PLUGIN_HOOKS_DIR","CURSOR_PLUGIN_HOOKS_DIR","CLAUDE_PROJECT_HOOKS_DIR","CLAUDE_HOOKS_DIR","NPX_COMMAND","NPX_YES_FLAG","NPX_NO_INSTALL_FLAG","DOCUVIA_MCP_LAUNCH_ARGS","DOCUVIA_WORKSPACE_ROOT_ENV_VAR","DOCUVIA_HOOK_JS","HookNames","DOCUVIA_DIR_NAME","HOOKS_CONFIG_FILE_NAME","HOOK_EVENT_PRE_TOOL_USE","HOOKS_JSON","AGENT_INSTRUCTIONS"]}
1
+ {"version":3,"sources":["../src/constants/init-templates.ts"],"sourcesContent":["// Shared with lib/ui-core's DoctorWorkflow agent-hooks diagnostic -- defined in\n// @workspace/contracts so neither side depends on the other; re-exported here so this file\n// stays the single import path\n// every platform installer already uses. Also imported (not just re-exported) below so\n// CLAUDE_PROJECT_HOOKS_DIR can build off the same value instead of re-typing it.\nimport { CLAUDE_HOOKS_DIR } from \"@workspace/contracts\";\nexport {\n CLAUDE_HOOKS_DIR,\n CURSOR_HOOKS_DIR,\n DOCUVIA_HOOK_JS_FILENAME,\n DOCUVIA_HOOK_CJS_FILENAME,\n} from \"@workspace/contracts\";\n// `context-injection`'s enforcement gate (issue #42 §7.5): this file is itself normal\n// TypeScript, so it can import the shared literal values and interpolate them into the\n// generated `.js` template text at compile time -- the *generated* raw hook script on disk just\n// contains the resolved strings, no runtime import (a standalone `.js` hook file has no\n// `@workspace/contracts` to import from).\nimport {\n HookNames,\n HOOKS_CONFIG_FILE_NAME,\n DOCUVIA_DIR_NAME,\n} from \"@workspace/contracts\";\n\nexport const GITHUB_DIR = \".github\";\nexport const CLAUDE_DIR = \".claude\";\n\nexport const HOOKS_CONFIG_FILENAME = \"hooks.json\";\nexport const SETTINGS_JSON_FILENAME = \"settings.json\";\n\nexport const CURSOR_MCP_CONFIG_PATH = \".cursor/mcp.json\";\nexport const CLAUDE_DESKTOP_CONFIG_FILENAME = \"claude_desktop_config.json\";\nexport const MCP_SERVER_ALIAS = \"docuvia-local\";\n\nexport const COPILOT_INSTRUCTIONS_FILENAME = \"copilot-instructions.md\";\nexport const CLAUDE_MD_FILENAME = \"CLAUDE.md\";\nexport const CURSOR_RULES_FILENAME = \".cursorrules\";\nexport const AGENT_INSTRUCTIONS_MARKER = \"docuvia:start\";\nexport const AGENT_INSTRUCTIONS_END_MARKER = \"docuvia:end\";\n\n// PLAT-008 legacy-only: these two files were written by the retired \"Markdown Agents\" catch-all\n// and are never installed to anymore, but `uninstall` still best-effort cleans them up for repos\n// set up under an older Docuvia version.\nexport const WINDSURF_RULES_FILENAME = \".windsurfrules\";\nexport const LLMS_TXT_FILENAME = \"llms.txt\";\n\nexport const AGENTS_MD_FILENAME = \"AGENTS.md\";\nexport const HERMES_MD_FILENAME = \".hermes.md\";\nexport const CONTINUE_RULES_DIR = \".continue/rules\";\nexport const CONTINUE_RULES_FILENAME = \"docuvia.md\";\n\nexport const PLATFORM_NAME_CURSOR = \"Cursor\";\nexport const PLATFORM_NAME_CLAUDE = \"Claude\";\nexport const PLATFORM_NAME_COPILOT = \"GitHub Copilot\";\nexport const PLATFORM_NAME_CODEX = \"Codex\";\nexport const PLATFORM_NAME_CONTINUE = \"Continue\";\nexport const PLATFORM_NAME_HERMES = \"Hermes Agent\";\n\n// Stable, CLI-facing identifiers for --platform= — PLATFORM_NAME_* above is the display name only.\nexport const PLATFORM_SLUG_CURSOR = \"cursor\";\nexport const PLATFORM_SLUG_CLAUDE = \"claude\";\nexport const PLATFORM_SLUG_COPILOT = \"copilot\";\nexport const PLATFORM_SLUG_CODEX = \"codex\";\nexport const PLATFORM_SLUG_CONTINUE = \"continue\";\nexport const PLATFORM_SLUG_HERMES = \"hermes\";\n\n// Literal placeholder text written into each platform's hooks.json `${HOOKS_DIR}` substitution —\n// the platform itself expands these at runtime, so they must stay un-interpolated here.\nexport const CLAUDE_PLUGIN_HOOKS_DIR = \"${CLAUDE_PLUGIN_ROOT}/hooks\";\nexport const CURSOR_PLUGIN_HOOKS_DIR = \"${CURSOR_PLUGIN_ROOT}/hooks\";\n\n// Project-level equivalent of CLAUDE_PLUGIN_HOOKS_DIR above. `${CLAUDE_PLUGIN_ROOT}` only resolves\n// inside a formal Claude Code plugin install (and is currently broken there too --\n// anthropics/claude-code#24529); `${CLAUDE_PROJECT_DIR}` resolves correctly today in a project-level\n// `.claude/settings.json` hook, so ClaudePlatform also writes a hook entry through this path,\n// pointing at the same `.claude/hooks` dir `configureHooks` already writes `docuvia-hook.js` into\n// (roadmap-and-open-items.md item 26).\nexport const CLAUDE_PROJECT_HOOKS_DIR =\n \"${CLAUDE_PROJECT_DIR}/\" + CLAUDE_HOOKS_DIR;\n\nexport const NPX_COMMAND = \"npx\";\nexport const NPX_YES_FLAG = \"-y\";\nexport const NPX_NO_INSTALL_FLAG = \"--no-install\";\nexport const DOCUVIA_MCP_LAUNCH_ARGS = [\"docuvia\", \"mcp\"];\nexport const DOCUVIA_WORKSPACE_ROOT_ENV_VAR = \"DOCUVIA_WORKSPACE_ROOT\";\n\nexport const DOCUVIA_HOOK_JS = `#!/usr/bin/env node\n/**\n * Docuvia Agent Hook\n * Intercepts AI searches and augments with high-density AST context from local SQLite.\n */\nconst { execFileSync } = require('child_process');\n\nfunction readInput() {\n try {\n const data = require('fs').readFileSync(0, 'utf-8');\n return JSON.parse(data);\n } catch {\n return {};\n }\n}\n\n// \\`docuvia hooks disable ${HookNames.CONTEXT_INJECTION}\\`'s enforcement (issue #42 §7.5) -- a\n// plain synchronous read, no subprocess: this hook fires on every Grep/Glob/Bash/Read, so a\n// second \\`npx docuvia ...\\` spawn per call would be a real, continuous latency cost, not a\n// one-off. Missing/unparseable config -> enabled (fail open, matches the always-on behavior this\n// toggle is retrofitted onto).\nfunction isEnabled() {\n try {\n const config = JSON.parse(\n require('fs').readFileSync('${DOCUVIA_DIR_NAME}/${HOOKS_CONFIG_FILE_NAME}', 'utf-8'),\n );\n return config['${HookNames.CONTEXT_INJECTION}'] !== false;\n } catch {\n return true;\n }\n}\n\nconst input = readInput();\n// Use the query arguments as the target to retrieve context\nconst target = input.args ? input.args.query || input.args.pattern : null;\n\nif (target && isEnabled()) {\n try {\n // Call the local Docuvia CLI to retrieve exact L2/L3 structural context. target is passed as a\n // literal argv element via execFileSync (no shell) instead of string-interpolated into an\n // execSync shell command (issue #51): target is tool-call input (Grep/Glob/Bash/Read\n // query/pattern) that an agent or, transitively, a prompt can influence, so the old\n // interpolation was a real shell-injection exposure. npx is a .cmd shim on Windows that\n // execFileSync can't spawn as a bare name, so resolve the platform-specific name inline (this\n // standalone script can't import windows-shell-spawn.ts).\n const npx = process.platform === 'win32' ? 'npx.cmd' : 'npx';\n const context = execFileSync(\n npx,\n ['--no-install', 'docuvia', 'query', target, '--format=prompt'],\n { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] },\n );\n if (context && context.trim().length > 0) {\n console.log(\"=== Docuvia Context injected ===\");\n console.log(context);\n console.log(\"================================\");\n }\n } catch (e) {\n const errorMsg = e instanceof Error ? e.message : String(e);\n console.error(\"[Docuvia Pre-Command] Failed to retrieve context: \" + errorMsg);\n }\n}\n`;\n\n// Named so the merge/prune logic in claude.platform.ts's project-level `.claude/settings.json`\n// support reuses this exact key instead of re-typing the literal (a typo there would silently\n// desync the two).\nexport const HOOK_EVENT_PRE_TOOL_USE = \"PreToolUse\";\n\nexport const HOOKS_JSON = JSON.stringify(\n {\n [HOOK_EVENT_PRE_TOOL_USE]: [\n {\n hooks: [\n {\n command: \"node ${HOOKS_DIR}/docuvia-hook.js\",\n statusMessage: \"Enriching with Docuvia architectural context...\",\n timeout: 5,\n type: \"command\",\n },\n ],\n matcher: \"Grep|Glob|Bash|Read\",\n },\n ],\n },\n null,\n 2,\n);\n\nexport const AGENT_INSTRUCTIONS = `\n<!-- ${AGENT_INSTRUCTIONS_MARKER} -->\n# Docuvia — Codebase Knowledge Evolver\n\nThis project uses Docuvia to manage architectural context and prevent blast-radius regressions.\nGrep/Glob/Read are the most expensive tools available to you — before reaching for them to explore the codebase, query the local knowledge graph instead, and before editing a symbol or file, check its blast radius:\n\nRun: \\`npx --no-install docuvia query \"<concept_or_file>\" --format=prompt\\`\nRun: \\`npx --no-install docuvia impact <symbolOrFile>\\`\n\nUse the results to understand architectural boundaries, historical decisions, and potential blast radius before modifying code. Only fall back to Grep/Glob/Read when the graph returns nothing, the target is flagged \\`tier_b_status=\"unprocessed\"\\` (unknown, not zero), you need exact source text/formatting a structural query can't capture, or \\`query\\` returns a non-\\`exact\\` \\`match_type\\` (keyword/neighbor) for what should be a well-known symbol or file.\n\nAfter making a code change that reflects a real architectural decision, rule, or notable rationale, stage it so the graph picks it up without a separate write step:\n\nRun: \\`npx --no-install docuvia analyze <file> --agent-authored --stage\\`\n\nPipe a JSON payload on stdin (default) — \\`{\"decisions\":[{\"title\":string,\"content\":string,\"nodeType\":\"change\"|\"rule\"|\"decision\"|\"context\",\"confidence\":number}]}\\` — or pass \\`--decisions-file=<path>\\` instead. Put \\`--agent-authored\\`/\\`--stage\\` after the positional \\`<file>\\`, not before — 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 — nothing else to run.\n<!-- docuvia:end -->\n`;\n"],"mappings":";+DAuBO,IAAMA,EAAa,UACbC,EAAa,UAEbC,EAAwB,aACxBC,EAAyB,gBAEzBC,EAAyB,mBACzBC,EAAiC,6BACjCC,EAAmB,gBAEnBC,EAAgC,0BAChCC,EAAqB,YACrBC,EAAwB,eACxBC,EAA4B,gBAC5BC,EAAgC,cAKhCC,EAA0B,iBAC1BC,EAAoB,WAEpBC,EAAqB,YACrBC,EAAqB,aACrBC,EAAqB,kBACrBC,EAA0B,aAE1BC,EAAuB,SACvBC,EAAuB,SACvBC,EAAwB,iBACxBC,EAAsB,QACtBC,EAAyB,WACzBC,EAAuB,eAGvBC,EAAuB,SACvBC,EAAuB,SACvBC,EAAwB,UACxBC,EAAsB,QACtBC,EAAyB,WACzBC,EAAuB,SAIvBC,EAA0B,8BAC1BC,EAA0B,8BAQ1BC,EACX,yBAA2BC,EAEhBC,EAAc,MACdC,EAAe,KACfC,EAAsB,eACtBC,EAA0B,CAAC,UAAW,KAAK,EAC3CC,EAAiC,yBAEjCC,EAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAgBFC,EAAU,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAQpBC,CAAgB,IAAIC,CAAsB;AAAA;AAAA,qBAEzDF,EAAU,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwCnCG,EAA0B,aAE1BC,EAAa,KAAK,UAC7B,CACE,CAACD,CAAuB,EAAG,CACzB,CACE,MAAO,CACL,CACE,QAAS,oCACT,cAAe,kDACf,QAAS,EACT,KAAM,SACR,CACF,EACA,QAAS,qBACX,CACF,CACF,EACA,KACA,CACF,EAEaE,EAAqB;AAAA,OAC3BnC,CAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":["GITHUB_DIR","CLAUDE_DIR","HOOKS_CONFIG_FILENAME","SETTINGS_JSON_FILENAME","CURSOR_MCP_CONFIG_PATH","CLAUDE_DESKTOP_CONFIG_FILENAME","MCP_SERVER_ALIAS","COPILOT_INSTRUCTIONS_FILENAME","CLAUDE_MD_FILENAME","CURSOR_RULES_FILENAME","AGENT_INSTRUCTIONS_MARKER","AGENT_INSTRUCTIONS_END_MARKER","WINDSURF_RULES_FILENAME","LLMS_TXT_FILENAME","AGENTS_MD_FILENAME","HERMES_MD_FILENAME","CONTINUE_RULES_DIR","CONTINUE_RULES_FILENAME","PLATFORM_NAME_CURSOR","PLATFORM_NAME_CLAUDE","PLATFORM_NAME_COPILOT","PLATFORM_NAME_CODEX","PLATFORM_NAME_CONTINUE","PLATFORM_NAME_HERMES","PLATFORM_SLUG_CURSOR","PLATFORM_SLUG_CLAUDE","PLATFORM_SLUG_COPILOT","PLATFORM_SLUG_CODEX","PLATFORM_SLUG_CONTINUE","PLATFORM_SLUG_HERMES","CLAUDE_PLUGIN_HOOKS_DIR","CURSOR_PLUGIN_HOOKS_DIR","CLAUDE_PROJECT_HOOKS_DIR","CLAUDE_HOOKS_DIR","NPX_COMMAND","NPX_YES_FLAG","NPX_NO_INSTALL_FLAG","DOCUVIA_MCP_LAUNCH_ARGS","DOCUVIA_WORKSPACE_ROOT_ENV_VAR","DOCUVIA_HOOK_JS","HookNames","DOCUVIA_DIR_NAME","HOOKS_CONFIG_FILE_NAME","HOOK_EVENT_PRE_TOOL_USE","HOOKS_JSON","AGENT_INSTRUCTIONS"]}