@vpxa/aikit 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpxa/aikit",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "description": "Local-first AI developer toolkit — knowledge base, code analysis, context management, and developer tools for LLM agents",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- import{FLOW_DIRS as e,MCP_SERVER_ENTRY as t,SERVER_NAME as n,SKILL_NAMES as r,VSCODE_SETTINGS as i}from"./constants.js";import{buildAgentsMd as a,buildCopilotInstructions as o}from"./templates.js";import{smartCopySubdir as s}from"./scaffold.js";import{existsSync as c,mkdirSync as l,readFileSync as u,unlinkSync as d,writeFileSync as f}from"node:fs";import{dirname as p,resolve as m}from"node:path";import{fileURLToPath as h}from"node:url";import{getGlobalDataDir as g,saveRegistry as _}from"../../../../core/dist/index.js";import{homedir as v}from"node:os";function y(){let e=v(),t=process.platform,n=[],r=m(e,`.copilot`),i=m(r,`instructions`),a=m(e,`.claude`),o=m(e,`.cursor`),s=m(e,`.windsurf`);if(t===`win32`){let t=process.env.APPDATA??m(e,`AppData`,`Roaming`);n.push({ide:`VS Code`,configDir:m(t,`Code`,`User`),mcpConfigPath:m(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:m(t,`Code - Insiders`,`User`),mcpConfigPath:m(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:m(t,`VSCodium`,`User`),mcpConfigPath:m(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:m(t,`Cursor`,`User`),mcpConfigPath:m(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:m(t,`Cursor Nightly`,`User`),mcpConfigPath:m(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:m(t,`Windsurf`,`User`),mcpConfigPath:m(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}else if(t===`darwin`){let t=m(e,`Library`,`Application Support`);n.push({ide:`VS Code`,configDir:m(t,`Code`,`User`),mcpConfigPath:m(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:m(t,`Code - Insiders`,`User`),mcpConfigPath:m(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:m(t,`VSCodium`,`User`),mcpConfigPath:m(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:m(t,`Cursor`,`User`),mcpConfigPath:m(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:m(t,`Cursor Nightly`,`User`),mcpConfigPath:m(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:m(t,`Windsurf`,`User`),mcpConfigPath:m(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}else{let t=process.env.XDG_CONFIG_HOME??m(e,`.config`);n.push({ide:`VS Code`,configDir:m(t,`Code`,`User`),mcpConfigPath:m(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:m(t,`Code - Insiders`,`User`),mcpConfigPath:m(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:m(t,`VSCodium`,`User`),mcpConfigPath:m(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:m(t,`Cursor`,`User`),mcpConfigPath:m(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:m(t,`Cursor Nightly`,`User`),mcpConfigPath:m(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:m(t,`Windsurf`,`User`),mcpConfigPath:m(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}return n.push({ide:`Claude Code`,configDir:m(e,`.claude`),mcpConfigPath:m(e,`.claude`,`mcp.json`),globalScaffoldRoot:a,instructionsRoot:null}),n.filter(e=>c(e.configDir))}function b(e,n,r=!1){let{mcpConfigPath:i,configDir:a}=e,o={...t},s={};if(c(i)){try{let e=u(i,`utf-8`);s=JSON.parse(e)}catch{let e=`${i}.bak`;f(e,u(i,`utf-8`),`utf-8`),console.log(` Backed up invalid ${i} to ${e}`),s={}}if((s.servers??s.mcpServers??{})[n]&&!r){console.log(` ${e.ide}: ${n} already configured (use --force to update)`);return}}let d=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`,`Windsurf`]).has(e.ide)?`servers`:`mcpServers`,p=s[d]??{};p[n]=o,s[d]=p,l(a,{recursive:!0}),f(i,`${JSON.stringify(s,null,2)}\n`,`utf-8`),console.log(` ${e.ide}: configured ${n} in ${i}`)}const x=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`]);function S(e,t=!1){if(!x.has(e.ide))return;let n=m(e.configDir,`settings.json`),r={};if(c(n))try{let e=u(n,`utf-8`);r=JSON.parse(e)}catch{console.log(` ${e.ide}: skipped settings.json (invalid JSON)`);return}let a=!1;for(let[e,n]of Object.entries(i))if(typeof n==`object`&&n){let t=typeof r[e]==`object`&&r[e]!==null?r[e]:{},i={...t,...n};JSON.stringify(i)!==JSON.stringify(t)&&(r[e]=i,a=!0)}else (t||!(e in r))&&(r[e]=n,a=!0);a&&(f(n,`${JSON.stringify(r,null,2)}\n`,`utf-8`),console.log(` ${e.ide}: updated settings.json`))}function C(t,n,i,u,d=!1){let p=new Set;for(let e of n)e.globalScaffoldRoot&&p.add(e.globalScaffoldRoot);if(p.size===0){console.log(` No IDEs with global scaffold support detected.`);return}let h=m(t,`scaffold`,`general`);for(let n of p){s(h,n,`agents`,u,d),s(h,n,`prompts`,u,d);let i=0;for(let e of r)c(m(h,`skills`,e))&&(s(h,n,`skills/${e}`,u,d),i++);for(let r of e){let e=m(t,`scaffold`,`flows`,r);c(m(e,`skills`))&&s(e,m(n,`flows`,r),`skills`,u,d)}console.log(` ${n}: scaffold updated (${i} skills)`)}let g=new Set,_=o(`aikit`,i),v=a(`aikit`,i);for(let e of n){if(!e.globalScaffoldRoot)continue;let t=e.globalScaffoldRoot;if(e.ide===`Claude Code`){let e=m(t,`CLAUDE.md`);f(e,`${_}\n---\n\n${v}`,`utf-8`),g.add(e)}else if(e.ide===`VS Code`||e.ide===`VS Code Insiders`||e.ide===`VSCodium`){let n=e.instructionsRoot??t;l(n,{recursive:!0});let r=m(n,`copilot-instructions.md`);g.has(r)||(f(r,`---\napplyTo: "**"\n---\n\n${_}\n---\n\n${v}`,`utf-8`),g.add(r))}else if(e.ide===`Cursor`||e.ide===`Cursor Nightly`){let e=m(t,`rules`);l(e,{recursive:!0});let n=m(e,`aikit.mdc`);g.has(n)||(f(n,`${_}\n---\n\n${v}`,`utf-8`),g.add(n))}else if(e.ide===`Windsurf`){let e=m(t,`rules`);l(e,{recursive:!0});let n=m(e,`aikit.md`);g.has(n)||(f(n,`${_}\n---\n\n${v}`,`utf-8`),g.add(n))}}g.size>0&&console.log(` Instruction files: ${[...g].join(`, `)}`)}function w(e){let t=[];for(let n of e){if(!n.globalScaffoldRoot)continue;let e=n.globalScaffoldRoot;if(n.ide===`VS Code`||n.ide===`VS Code Insiders`||n.ide===`VSCodium`){let r=n.instructionsRoot??e;t.push(m(r,`kb.instructions.md`)),t.push(m(r,`aikit.instructions.md`))}else n.ide===`Cursor`||n.ide===`Cursor Nightly`?t.push(m(e,`rules`,`kb.mdc`)):n.ide===`Windsurf`&&t.push(m(e,`rules`,`kb.md`))}for(let e of t)c(e)&&(d(e),console.log(` Removed legacy file: ${e}`))}async function T(e){let t=n,r=m(p(h(import.meta.url)),`..`,`..`,`..`,`..`,`..`,`package.json`),i=JSON.parse(u(r,`utf-8`)).version;console.log(`Initializing @vpxa/aikit v${i}...\n`);let a=g();l(a,{recursive:!0}),console.log(` Global data store: ${a}`),_({version:1,workspaces:{}}),console.log(` Created registry.json`);let o=y();if(o.length===0)console.log(`
1
+ import{FLOW_DIRS as e,MCP_SERVER_ENTRY as t,SERVER_NAME as n,SKILL_NAMES as r,VSCODE_SETTINGS as i}from"./constants.js";import{buildAgentsMd as a,buildCopilotInstructions as o}from"./templates.js";import{smartCopySubdir as s}from"./scaffold.js";import{existsSync as c,mkdirSync as l,readFileSync as u,unlinkSync as d,writeFileSync as f}from"node:fs";import{dirname as p,resolve as m}from"node:path";import{fileURLToPath as h}from"node:url";import{getGlobalDataDir as g,saveRegistry as _}from"../../../../core/dist/index.js";import{homedir as v}from"node:os";function y(){let e=v(),t=process.platform,n=[],r=m(e,`.copilot`),i=m(r,`instructions`),a=m(e,`.claude`),o=m(e,`.cursor`),s=m(e,`.windsurf`);if(t===`win32`){let t=process.env.APPDATA??m(e,`AppData`,`Roaming`);n.push({ide:`VS Code`,configDir:m(t,`Code`,`User`),mcpConfigPath:m(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:m(t,`Code - Insiders`,`User`),mcpConfigPath:m(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:m(t,`VSCodium`,`User`),mcpConfigPath:m(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:m(t,`Cursor`,`User`),mcpConfigPath:m(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:m(t,`Cursor Nightly`,`User`),mcpConfigPath:m(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:m(t,`Windsurf`,`User`),mcpConfigPath:m(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}else if(t===`darwin`){let t=m(e,`Library`,`Application Support`);n.push({ide:`VS Code`,configDir:m(t,`Code`,`User`),mcpConfigPath:m(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:m(t,`Code - Insiders`,`User`),mcpConfigPath:m(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:m(t,`VSCodium`,`User`),mcpConfigPath:m(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:m(t,`Cursor`,`User`),mcpConfigPath:m(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:m(t,`Cursor Nightly`,`User`),mcpConfigPath:m(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:m(t,`Windsurf`,`User`),mcpConfigPath:m(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}else{let t=process.env.XDG_CONFIG_HOME??m(e,`.config`);n.push({ide:`VS Code`,configDir:m(t,`Code`,`User`),mcpConfigPath:m(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:m(t,`Code - Insiders`,`User`),mcpConfigPath:m(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:m(t,`VSCodium`,`User`),mcpConfigPath:m(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:m(t,`Cursor`,`User`),mcpConfigPath:m(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:m(t,`Cursor Nightly`,`User`),mcpConfigPath:m(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:m(t,`Windsurf`,`User`),mcpConfigPath:m(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}return n.push({ide:`Claude Code`,configDir:m(e,`.claude`),mcpConfigPath:m(e,`.claude`,`mcp.json`),globalScaffoldRoot:a,instructionsRoot:null}),n.push({ide:`Copilot CLI`,configDir:r,mcpConfigPath:m(r,`mcp-config.json`),globalScaffoldRoot:null,instructionsRoot:null}),n.filter(e=>c(e.configDir))}function b(e,n,r=!1){let{mcpConfigPath:i,configDir:a}=e,o={...t},s={};if(c(i)){try{let e=u(i,`utf-8`);s=JSON.parse(e)}catch{let e=`${i}.bak`;f(e,u(i,`utf-8`),`utf-8`),console.log(` Backed up invalid ${i} to ${e}`),s={}}if((s.servers??s.mcpServers??{})[n]&&!r){console.log(` ${e.ide}: ${n} already configured (use --force to update)`);return}}let d=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`,`Windsurf`]).has(e.ide)?`servers`:`mcpServers`,p=s[d]??{};e.ide===`Copilot CLI`?p[n]={...o,tools:[`*`]}:p[n]=o,s[d]=p,l(a,{recursive:!0}),f(i,`${JSON.stringify(s,null,2)}\n`,`utf-8`),console.log(` ${e.ide}: configured ${n} in ${i}`)}const x=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`]);function S(e,t=!1){if(!x.has(e.ide))return;let n=m(e.configDir,`settings.json`),r={};if(c(n))try{let e=u(n,`utf-8`);r=JSON.parse(e)}catch{console.log(` ${e.ide}: skipped settings.json (invalid JSON)`);return}let a=!1;for(let[e,n]of Object.entries(i))if(typeof n==`object`&&n){let t=typeof r[e]==`object`&&r[e]!==null?r[e]:{},i={...t,...n};JSON.stringify(i)!==JSON.stringify(t)&&(r[e]=i,a=!0)}else (t||!(e in r))&&(r[e]=n,a=!0);a&&(f(n,`${JSON.stringify(r,null,2)}\n`,`utf-8`),console.log(` ${e.ide}: updated settings.json`))}function C(t,n,i,u,d=!1){let p=new Set;for(let e of n)e.globalScaffoldRoot&&p.add(e.globalScaffoldRoot);if(p.size===0){console.log(` No IDEs with global scaffold support detected.`);return}let h=m(t,`scaffold`,`general`);for(let n of p){s(h,n,`agents`,u,d),s(h,n,`prompts`,u,d);let i=0;for(let e of r)c(m(h,`skills`,e))&&(s(h,n,`skills/${e}`,u,d),i++);for(let r of e){let e=m(t,`scaffold`,`flows`,r);c(m(e,`skills`))&&s(e,m(n,`flows`,r),`skills`,u,d)}console.log(` ${n}: scaffold updated (${i} skills)`)}let g=new Set,_=o(`aikit`,i),v=a(`aikit`,i);for(let e of n){if(!e.globalScaffoldRoot)continue;let t=e.globalScaffoldRoot;if(e.ide===`Claude Code`){let e=m(t,`CLAUDE.md`);f(e,`${_}\n---\n\n${v}`,`utf-8`),g.add(e)}else if(e.ide===`VS Code`||e.ide===`VS Code Insiders`||e.ide===`VSCodium`){let n=e.instructionsRoot??t;l(n,{recursive:!0});let r=m(n,`copilot-instructions.md`);g.has(r)||(f(r,`---\napplyTo: "**"\n---\n\n${_}\n---\n\n${v}`,`utf-8`),g.add(r))}else if(e.ide===`Cursor`||e.ide===`Cursor Nightly`){let e=m(t,`rules`);l(e,{recursive:!0});let n=m(e,`aikit.mdc`);g.has(n)||(f(n,`${_}\n---\n\n${v}`,`utf-8`),g.add(n))}else if(e.ide===`Windsurf`){let e=m(t,`rules`);l(e,{recursive:!0});let n=m(e,`aikit.md`);g.has(n)||(f(n,`${_}\n---\n\n${v}`,`utf-8`),g.add(n))}}g.size>0&&console.log(` Instruction files: ${[...g].join(`, `)}`)}function w(e){let t=[];for(let n of e){if(!n.globalScaffoldRoot)continue;let e=n.globalScaffoldRoot;if(n.ide===`VS Code`||n.ide===`VS Code Insiders`||n.ide===`VSCodium`){let r=n.instructionsRoot??e;t.push(m(r,`kb.instructions.md`)),t.push(m(r,`aikit.instructions.md`))}else n.ide===`Cursor`||n.ide===`Cursor Nightly`?t.push(m(e,`rules`,`kb.mdc`)):n.ide===`Windsurf`&&t.push(m(e,`rules`,`kb.md`))}for(let e of t)c(e)&&(d(e),console.log(` Removed legacy file: ${e}`))}async function T(e){let t=n,r=m(p(h(import.meta.url)),`..`,`..`,`..`,`..`,`..`,`package.json`),i=JSON.parse(u(r,`utf-8`)).version;console.log(`Initializing @vpxa/aikit v${i}...\n`);let a=g();l(a,{recursive:!0}),console.log(` Global data store: ${a}`),_({version:1,workspaces:{}}),console.log(` Created registry.json`);let o=y();if(o.length===0)console.log(`
2
2
  No supported IDEs detected. You can manually add the MCP server config.`);else{console.log(`\n Detected ${o.length} IDE(s):`);for(let n of o)b(n,t,e.force),S(n,e.force)}let s=m(p(h(import.meta.url)),`..`,`..`,`..`,`..`,`..`);console.log(`
3
3
  Installing scaffold files:`),C(s,o,t,i,e.force),w(o),console.log(`
4
4
  User-level AI Kit installation complete!`),console.log(`
@@ -229,6 +229,7 @@ declare const GitContextOutputSchema: z.ZodObject<{
229
229
  hash: z.ZodString;
230
230
  message: z.ZodString;
231
231
  author: z.ZodString;
232
+ date: z.ZodString;
232
233
  }, z.core.$strip>>;
233
234
  }, z.core.$strip>;
234
235
  declare const CompactOutputSchema: z.ZodObject<{
@@ -1 +1 @@
1
- import{z as e}from"zod";const t=e.object({totalRecords:e.number(),totalFiles:e.number(),lastIndexedAt:e.string().nullable(),onboarded:e.boolean(),onboardDir:e.string(),contentTypes:e.record(e.string(),e.number()),wasmAvailable:e.boolean(),graphStats:e.object({nodes:e.number(),edges:e.number()}).nullable(),curatedCount:e.number(),serverVersion:e.string(),scaffoldVersion:e.string().nullable(),workspaceScaffoldVersion:e.string().nullable(),upgradeAvailable:e.boolean()}),n=e.object({entries:e.array(e.object({path:e.string(),title:e.string(),category:e.string(),tags:e.array(e.string()),version:e.number(),preview:e.string()})),totalCount:e.number()}),r=e.object({ok:e.boolean(),checks:e.array(e.object({name:e.string(),ok:e.boolean(),message:e.string().optional()}))}),i=e.object({summary:e.object({totalFiles:e.number(),totalLines:e.number(),totalCodeLines:e.number(),totalFunctions:e.number(),avgComplexity:e.number(),maxComplexity:e.object({value:e.number(),file:e.string()})}),files:e.array(e.object({path:e.string(),lines:e.number(),code:e.number(),complexity:e.number(),functions:e.number()}))}),a=e.object({platform:e.string(),arch:e.string(),nodeVersion:e.string(),cwd:e.string(),cpus:e.number(),memoryFreeGb:e.number(),memoryTotalGb:e.number()}),o=e.object({iso:e.string(),unix:e.number(),timezone:e.string(),formatted:e.string()}),s=e.object({passed:e.boolean(),errorCount:e.number(),warningCount:e.number(),topErrors:e.array(e.string())}),c=e.object({passed:e.boolean(),tsc:s,biome:s}),l=e.object({name:e.string(),definedIn:e.object({path:e.string(),line:e.number(),kind:e.string(),signature:e.string().optional()}).nullable(),importedBy:e.array(e.object({path:e.string(),line:e.number(),importStatement:e.string()})),referencedIn:e.array(e.object({path:e.string(),line:e.number(),context:e.string(),scope:e.string().optional()})),graphContext:e.object({definingModule:e.string().optional(),importedByModules:e.array(e.string()),siblingSymbols:e.array(e.string())}).nullable()}),u=e.object({sourcePath:e.string(),contentType:e.string(),score:e.number(),headingPath:e.string().optional(),startLine:e.number().optional(),endLine:e.number().optional(),origin:e.string().optional(),category:e.string().optional(),tags:e.array(e.string()).optional()}),d=e.object({results:e.array(u),totalResults:e.number(),searchMode:e.string(),query:e.string()}),f=e.object({path:e.string(),line:e.number().optional(),matchType:e.string(),preview:e.string()}),p=e.object({matches:e.array(f),totalMatches:e.number(),pattern:e.string(),truncated:e.boolean()}),m=e.object({path:e.string(),relevance:e.number(),estimatedTokens:e.number(),focusLines:e.array(e.string()).optional()}),h=e.object({files:e.array(m),totalFiles:e.number(),totalEstimatedTokens:e.number(),task:e.string()}),g=e.object({path:e.string(),impact:e.string(),reason:e.string()}),_=e.object({changedFiles:e.array(e.string()),affectedFiles:e.array(g),totalAffected:e.number(),riskLevel:e.string()}),v=e.object({name:e.string(),passed:e.boolean(),message:e.string().optional(),severity:e.string().optional()}),y=e.object({passed:e.boolean(),score:e.number(),checks:e.array(v),summary:e.string()}),b=e.object({id:e.string(),name:e.string(),type:e.string(),sourcePath:e.string().optional()}),x=e.object({fromId:e.string(),toId:e.string(),type:e.string()}),S=e.object({nodes:e.array(b),edges:e.array(x),totalNodes:e.number(),totalEdges:e.number(),query:e.string()}),C=e.object({symbols:e.array(e.object({name:e.string(),path:e.string(),line:e.number().optional(),kind:e.string()})),totalDead:e.number()}),w=e.object({files:e.number(),packages:e.number(),languages:e.record(e.string(),e.number()),tree:e.string()}),T=e.object({path:e.string(),language:e.string(),lines:e.number(),imports:e.number(),exports:e.number(),functions:e.number(),classes:e.number()}),E=e.object({gitRoot:e.string(),branch:e.string(),commitCount:e.number(),hasUncommitted:e.boolean(),recentCommits:e.array(e.object({hash:e.string(),message:e.string(),author:e.string()}))}),D=e.object({originalChars:e.number(),compressedChars:e.number(),ratio:e.number(),segmentsKept:e.number(),segmentsTotal:e.number()});export{w as AnalyzeStructureOutputSchema,y as AuditOutputSchema,_ as BlastRadiusOutputSchema,c as CheckOutputSchema,D as CompactOutputSchema,C as DeadSymbolsOutputSchema,a as EnvOutputSchema,T as FileSummaryOutputSchema,p as FindOutputSchema,E as GitContextOutputSchema,S as GraphOutputSchema,r as HealthOutputSchema,n as ListOutputSchema,i as MeasureOutputSchema,h as ScopeMapOutputSchema,d as SearchOutputSchema,t as StatusOutputSchema,l as SymbolOutputSchema,o as TimeOutputSchema};
1
+ import{z as e}from"zod";const t=e.object({totalRecords:e.number(),totalFiles:e.number(),lastIndexedAt:e.string().nullable(),onboarded:e.boolean(),onboardDir:e.string(),contentTypes:e.record(e.string(),e.number()),wasmAvailable:e.boolean(),graphStats:e.object({nodes:e.number(),edges:e.number()}).nullable(),curatedCount:e.number(),serverVersion:e.string(),scaffoldVersion:e.string().nullable(),workspaceScaffoldVersion:e.string().nullable(),upgradeAvailable:e.boolean()}),n=e.object({entries:e.array(e.object({path:e.string(),title:e.string(),category:e.string(),tags:e.array(e.string()),version:e.number(),preview:e.string()})),totalCount:e.number()}),r=e.object({ok:e.boolean(),checks:e.array(e.object({name:e.string(),ok:e.boolean(),message:e.string().optional()}))}),i=e.object({summary:e.object({totalFiles:e.number(),totalLines:e.number(),totalCodeLines:e.number(),totalFunctions:e.number(),avgComplexity:e.number(),maxComplexity:e.object({value:e.number(),file:e.string()})}),files:e.array(e.object({path:e.string(),lines:e.number(),code:e.number(),complexity:e.number(),functions:e.number()}))}),a=e.object({platform:e.string(),arch:e.string(),nodeVersion:e.string(),cwd:e.string(),cpus:e.number(),memoryFreeGb:e.number(),memoryTotalGb:e.number()}),o=e.object({iso:e.string(),unix:e.number(),timezone:e.string(),formatted:e.string()}),s=e.object({passed:e.boolean(),errorCount:e.number(),warningCount:e.number(),topErrors:e.array(e.string())}),c=e.object({passed:e.boolean(),tsc:s,biome:s}),l=e.object({name:e.string(),definedIn:e.object({path:e.string(),line:e.number(),kind:e.string(),signature:e.string().optional()}).nullable(),importedBy:e.array(e.object({path:e.string(),line:e.number(),importStatement:e.string()})),referencedIn:e.array(e.object({path:e.string(),line:e.number(),context:e.string(),scope:e.string().optional()})),graphContext:e.object({definingModule:e.string().optional(),importedByModules:e.array(e.string()),siblingSymbols:e.array(e.string())}).nullable()}),u=e.object({sourcePath:e.string(),contentType:e.string(),score:e.number(),headingPath:e.string().optional(),startLine:e.number().optional(),endLine:e.number().optional(),origin:e.string().optional(),category:e.string().optional(),tags:e.array(e.string()).optional()}),d=e.object({results:e.array(u),totalResults:e.number(),searchMode:e.string(),query:e.string()}),f=e.object({path:e.string(),line:e.number().optional(),matchType:e.string(),preview:e.string()}),p=e.object({matches:e.array(f),totalMatches:e.number(),pattern:e.string(),truncated:e.boolean()}),m=e.object({path:e.string(),relevance:e.number(),estimatedTokens:e.number(),focusLines:e.array(e.string()).optional()}),h=e.object({files:e.array(m),totalFiles:e.number(),totalEstimatedTokens:e.number(),task:e.string()}),g=e.object({path:e.string(),impact:e.string(),reason:e.string()}),_=e.object({changedFiles:e.array(e.string()),affectedFiles:e.array(g),totalAffected:e.number(),riskLevel:e.string()}),v=e.object({name:e.string(),passed:e.boolean(),message:e.string().optional(),severity:e.string().optional()}),y=e.object({passed:e.boolean(),score:e.number(),checks:e.array(v),summary:e.string()}),b=e.object({id:e.string(),name:e.string(),type:e.string(),sourcePath:e.string().optional()}),x=e.object({fromId:e.string(),toId:e.string(),type:e.string()}),S=e.object({nodes:e.array(b),edges:e.array(x),totalNodes:e.number(),totalEdges:e.number(),query:e.string()}),C=e.object({symbols:e.array(e.object({name:e.string(),path:e.string(),line:e.number().optional(),kind:e.string()})),totalDead:e.number()}),w=e.object({files:e.number(),packages:e.number(),languages:e.record(e.string(),e.number()),tree:e.string()}),T=e.object({path:e.string(),language:e.string(),lines:e.number(),imports:e.number(),exports:e.number(),functions:e.number(),classes:e.number()}),E=e.object({gitRoot:e.string(),branch:e.string(),commitCount:e.number(),hasUncommitted:e.boolean(),recentCommits:e.array(e.object({hash:e.string(),message:e.string(),author:e.string(),date:e.string()}))}),D=e.object({originalChars:e.number(),compressedChars:e.number(),ratio:e.number(),segmentsKept:e.number(),segmentsTotal:e.number()});export{w as AnalyzeStructureOutputSchema,y as AuditOutputSchema,_ as BlastRadiusOutputSchema,c as CheckOutputSchema,D as CompactOutputSchema,C as DeadSymbolsOutputSchema,a as EnvOutputSchema,T as FileSummaryOutputSchema,p as FindOutputSchema,E as GitContextOutputSchema,S as GraphOutputSchema,r as HealthOutputSchema,n as ListOutputSchema,i as MeasureOutputSchema,h as ScopeMapOutputSchema,d as SearchOutputSchema,t as StatusOutputSchema,l as SymbolOutputSchema,o as TimeOutputSchema};
@@ -107,9 +107,10 @@ Batch 2 (after batch 1):
107
107
 
108
108
  ## Output Rules
109
109
 
110
- - Structured data >3 sentences → \`present({ format: "html" })\`
110
+ - Structured data >3 sentences → \`present({ format: "html" })\` (or \`format: "browser"\` in CLI mode)
111
111
  - Charts, tables, dependency graphs → always \`present\`
112
112
  - Short confirmations and questions → normal chat
113
+ - **CLI mode:** Always use \`format: "browser"\` — the \`html\` format's UIResource is invisible in terminal environments. The \`browser\` format auto-opens the system browser.
113
114
 
114
115
  ## Subagent Output Relay
115
116
 
@@ -117,7 +118,7 @@ When subagents complete, their visual outputs (from \`present\`) are NOT visible
117
118
  **You MUST relay key findings:**
118
119
 
119
120
  1. After every subagent completes, extract key data from the returned text
120
- 2. If the subagent mentions charts, tables, or visual data → re-present using \`present({ format: "html" })\`
121
+ 2. If the subagent mentions charts, tables, or visual data → re-present using \`present({ format: "html" })\` (or \`format: "browser"\` in CLI mode)
121
122
  3. If the subagent returns structured findings → summarize and present to user
122
123
  4. **Never assume the user saw subagent output** — always relay or re-present
123
124
 
@@ -232,12 +233,14 @@ When subagents complete, their visual outputs (from \`present\`) are NOT visible
232
233
  **You MUST relay key findings:**
233
234
 
234
235
  1. After every subagent completes, extract key data from the returned text
235
- 2. If the subagent mentions charts, tables, or visual data → re-present using \`present({ format: "html" })\`
236
+ 2. If the subagent mentions charts, tables, or visual data → re-present using \`present({ format: "html" })\` (or \`format: "browser"\` in CLI mode)
236
237
  3. If the subagent returns structured findings → summarize and present to user
237
238
  4. **Never assume the user saw subagent output** — always relay or re-present
238
239
 
239
240
  **Rule: Every subagent batch completion MUST be followed by a user-visible summary or presentation.**
240
241
 
242
+ > **CLI mode:** Always use \`format: "browser"\` instead of \`format: "html"\` — the UIResource is invisible in terminal. The browser format auto-opens the system browser.
243
+
241
244
  ## Output Format
242
245
 
243
246
  \`\`\`markdown
@@ -298,12 +298,14 @@ When you need user input or need to explain something before asking:
298
298
  | Simple explanation + question | **Elicitation** | Text-only explanation, then ask via elicitation fields |
299
299
  | Rich content explanation + question | **\`present\` (mode: html)** + **Elicitation** | Use \`present({ format: "html" })\` for rich visual explanation (tables, charts, diagrams), then use elicitation for user input |
300
300
  | Complex visual explanation | **\`present\` (mode: browser)** | Use \`present({ format: "browser" })\` for full HTML dashboard. Confirmation/selection can be handled via browser actions, but for other user input fall back to elicitation |
301
+ | **CLI mode** (any rich content) | **\`present\` (mode: browser)** | In CLI/terminal mode, **always use \`format: "browser"\`**. The \`html\` format's UIResource is invisible in terminal — only markdown fallback text renders. The \`browser\` format auto-opens the system browser. |
301
302
 
302
303
  **Rules:**
303
304
  - **Never dump long tables or complex visuals as plain text** — use \`present\` to render them properly
304
305
  - **Confirmation selections** (yes/no, pick from list) can be handled inside browser mode via actions
305
306
  - **Free-form text input** always goes through elicitation, even when using \`present\` for the explanation
306
307
  - **Prefer the simplest method** that adequately conveys the information
308
+ - **CLI mode override:** When running in terminal (not VS Code chat), always use \`format: "browser"\` for any rich content
307
309
 
308
310
  ---
309
311
 
@@ -124,9 +124,10 @@ Batch 2 (after batch 1):
124
124
 
125
125
  ## Output Rules
126
126
 
127
- - Structured data >3 sentences → `present({ format: "html" })`
127
+ - Structured data >3 sentences → `present({ format: "html" })` (or `format: "browser"` in CLI mode)
128
128
  - Charts, tables, dependency graphs → always `present`
129
129
  - Short confirmations and questions → normal chat
130
+ - **CLI mode:** Always use `format: "browser"` — the `html` format's UIResource is invisible in terminal environments. The `browser` format auto-opens the system browser.
130
131
 
131
132
  ## Subagent Output Relay
132
133
 
@@ -134,7 +135,7 @@ When subagents complete, their visual outputs (from `present`) are NOT visible t
134
135
  **You MUST relay key findings:**
135
136
 
136
137
  1. After every subagent completes, extract key data from the returned text
137
- 2. If the subagent mentions charts, tables, or visual data → re-present using `present({ format: "html" })`
138
+ 2. If the subagent mentions charts, tables, or visual data → re-present using `present({ format: "html" })` (or `format: "browser"` in CLI mode)
138
139
  3. If the subagent returns structured findings → summarize and present to user
139
140
  4. **Never assume the user saw subagent output** — always relay or re-present
140
141
 
@@ -44,12 +44,14 @@ When subagents complete, their visual outputs (from `present`) are NOT visible t
44
44
  **You MUST relay key findings:**
45
45
 
46
46
  1. After every subagent completes, extract key data from the returned text
47
- 2. If the subagent mentions charts, tables, or visual data → re-present using `present({ format: "html" })`
47
+ 2. If the subagent mentions charts, tables, or visual data → re-present using `present({ format: "html" })` (or `format: "browser"` in CLI mode)
48
48
  3. If the subagent returns structured findings → summarize and present to user
49
49
  4. **Never assume the user saw subagent output** — always relay or re-present
50
50
 
51
51
  **Rule: Every subagent batch completion MUST be followed by a user-visible summary or presentation.**
52
52
 
53
+ > **CLI mode:** Always use `format: "browser"` instead of `format: "html"` — the UIResource is invisible in terminal. The browser format auto-opens the system browser.
54
+
53
55
  ## Output Format
54
56
 
55
57
  ```markdown
@@ -290,12 +290,14 @@ When you need user input or need to explain something before asking:
290
290
  | Simple explanation + question | **Elicitation** | Text-only explanation, then ask via elicitation fields |
291
291
  | Rich content explanation + question | **`present` (mode: html)** + **Elicitation** | Use `present({ format: "html" })` for rich visual explanation (tables, charts, diagrams), then use elicitation for user input |
292
292
  | Complex visual explanation | **`present` (mode: browser)** | Use `present({ format: "browser" })` for full HTML dashboard. Confirmation/selection can be handled via browser actions, but for other user input fall back to elicitation |
293
+ | **CLI mode** (any rich content) | **`present` (mode: browser)** | In CLI/terminal mode, **always use `format: "browser"`**. The `html` format's UIResource is invisible in terminal — only markdown fallback text renders. The `browser` format auto-opens the system browser. |
293
294
 
294
295
  **Rules:**
295
296
  - **Never dump long tables or complex visuals as plain text** — use `present` to render them properly
296
297
  - **Confirmation selections** (yes/no, pick from list) can be handled inside browser mode via actions
297
298
  - **Free-form text input** always goes through elicitation, even when using `present` for the explanation
298
299
  - **Prefer the simplest method** that adequately conveys the information
300
+ - **CLI mode override:** When running in terminal (not VS Code chat), always use `format: "browser"` for any rich content
299
301
 
300
302
  ---
301
303
 
@@ -195,7 +195,7 @@ Lane actions: `create` (copy files to lane), `list`, `status` (modified/added/de
195
195
  ### Presentation (1)
196
196
  | Tool | CLI | Purpose |
197
197
  |------|-----|---------|
198
- | `present` | — | Rich dashboards, charts, tables, timelines. Use `format: "browser"` then `openBrowserPage` to display |
198
+ | `present` | — | Rich dashboards, charts, tables, timelines. Use `format: "browser"` then `openBrowserPage` to display. **In CLI mode (no VS Code chat), always use `format: "browser"`** — `html` UIResource is invisible in terminal. |
199
199
 
200
200
  ### Brainstorming (1)
201
201
  | Tool | CLI | Purpose |
@@ -19,9 +19,12 @@ The `present` tool renders structured content as a professional dark-themed dash
19
19
  | Need user input back (confirmations, selections, form data) | **`browser`** | Browser supports blocking actions that return data |
20
20
  | Rich visual dashboards without interaction | **`html`** | Prefer in-chat when no response is needed |
21
21
  | User explicitly asks for browser | **`browser`** | Respect explicit preference |
22
+ | **Running in CLI mode** (no VS Code chat panel) | **`browser`** | `html` UIResource is invisible in CLI — only plain markdown renders. Use `browser` so the system browser opens automatically with full rich visualization. |
22
23
 
23
24
  **Rule: If no user interaction is needed, use `format: "html"`. If you need user interaction, use `format: "browser"`.**
24
25
 
26
+ > **⚠️ CLI Mode Override:** When running in CLI mode (terminal, not VS Code chat), **always use `format: "browser"`** regardless of whether interaction is needed. The `html` format relies on UIResource rendering in VS Code's MCP Apps panel — in CLI, only the markdown fallback text is shown, losing all rich visualizations (charts, tables, dashboards). The `browser` format starts a local HTTP server and auto-opens the system browser after 8 seconds, which works reliably in CLI.
27
+
25
28
  ---
26
29
 
27
30
  ## Browser Workflow (IMPORTANT — read carefully)
@@ -152,7 +155,7 @@ The dashboard uses a professional dark theme:
152
155
 
153
156
  ## Best Practices
154
157
 
155
- 1. **Use `browser` format** for data-rich content — charts, tables, dashboards
158
+ 1. **Use `browser` format** for data-rich content — charts, tables, dashboards. **Always use `browser` in CLI mode** (the `html` UIResource doesn't render in terminal environments).
156
159
  2. **Combine block types** — metrics + charts + tables in one page
157
160
  3. **Add titles** to every block for clear section headings
158
161
  4. **Use actions** when you need user decisions — the tool returns the selection