@directive-run/mcp 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var crypto=require('crypto'),claudePlugin=require('@directive-run/claude-plugin'),knowledge=require('@directive-run/knowledge'),scaffold=require('@directive-run/scaffold'),mcp_js=require('@modelcontextprotocol/sdk/server/mcp.js'),zod=require('zod'),url=require('url'),worker_threads=require('worker_threads'),lint=require('@directive-run/lint'),http=require('http'),sse_js=require('@modelcontextprotocol/sdk/server/sse.js');var f=[{name:"@directive-run/ai",version:"1.17.0",description:"AI guardrails and orchestration for Directive. Prompt injection, PII detection, cost tracking, multi-agent patterns.",homepage:"https://directive.run",keywords:["directive","ai","agents","guardrails","orchestration","llm","constraint-driven","ai-safety","prompt-injection","pii-detection","cost-tracking","multi-agent","openai","anthropic","ollama","gemini"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:[".","./anthropic","./devtools","./evals","./gemini","./guardrails","./mcp","./multi-agent","./ollama","./openai","./predicate","./testing"],directory:"ai",published:true},{name:"@directive-run/claude-plugin",version:"1.17.0",description:"Claude Code plugin for Directive \u2014 12 skills covering modules, constraints, resolvers, derivations, AI orchestration, and adapters. Installable via Claude Code's plugin marketplace or consumable programmatically as an npm package.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","claude","claude-code","skills","ai-rules","plugin","agents","knowledge"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:["."],directory:"claude-plugin",published:true},{name:"@directive-run/cli",version:"1.17.0",description:"CLI tools for Directive \u2014 AI coding rules, scaffolding, and more.",homepage:"https://directive.run",keywords:["directive","cli","ai-rules","cursor","copilot","claude","windsurf","cline","llms-txt"],dependencies:["@clack/prompts","@directive-run/knowledge","@directive-run/scaffold","picocolors"],peerDependencies:["@directive-run/timeline"],optionalDependencies:[],exports:[".","./llms.txt"],directory:"cli",published:true},{name:"@directive-run/core",version:"1.17.0",description:"The constraint-driven runtime for TypeScript. Declare what must be true \u2014 the runtime makes it happen.",homepage:"https://directive.run",keywords:["directive","constraint-driven","state-management","constraints","reactive","runtime","typescript","ai-guardrails","zero-dependencies","auto-tracking","framework-agnostic","declarative"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:[".","./adapter-utils","./internals","./migration","./plugins","./testing","./worker"],directory:"core",published:true},{name:"@directive-run/el",version:"1.1.0",description:"Vanilla DOM adapter for Directive. Typed element creation + reactive bindings + JSX runtime.",homepage:"https://directive.run",keywords:["directive","vanilla","dom","elements","jsx","htm","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","htm"],optionalDependencies:[],exports:[".","./htm","./jsx-dev-runtime","./jsx-runtime"],directory:"el",published:true},{name:"@directive-run/knowledge",version:"1.17.0",description:"Knowledge files, examples, and validation for Directive \u2014 the constraint-driven TypeScript runtime.",homepage:"https://directive.run",keywords:["directive","knowledge","ai-rules","examples"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:["."],directory:"knowledge",published:true},{name:"@directive-run/lint",version:"0.1.0",description:"ts-morph-based static analysis for Directive code. Rule registry + executable checks + autofixes. Consumed by @directive-run/mcp (review_source, fix_code tools) and the future `directive doctor lint` CLI command. Anti-pattern data sourced from @directive-run/knowledge so rule IDs stay in lock-step.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","lint","ast","ts-morph","review","anti-patterns"],dependencies:[],peerDependencies:[],optionalDependencies:["ts-morph"],exports:[".","./worker"],directory:"lint",published:true},{name:"@directive-run/lit",version:"1.17.0",description:"Lit web components adapter for Directive.",homepage:"https://directive.run",keywords:["directive","lit","web-components","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","lit"],optionalDependencies:[],exports:["."],directory:"lit",published:true},{name:"@directive-run/mcp",version:"0.2.0",description:"Model Context Protocol server that exposes Directive to AI clients \u2014 knowledge files, code examples, and Claude Code skill bundles today, with room to grow into runtime introspection and tooling. stdio for local clients (Claude Desktop, Cursor, MCP Inspector), SSE for hosted deployments at mcp.directive.run.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","mcp","model-context-protocol","knowledge","ai-rules","sse","stdio"],dependencies:["@directive-run/claude-plugin","@directive-run/knowledge","@directive-run/lint","@directive-run/scaffold","@modelcontextprotocol/sdk","zod"],peerDependencies:[],optionalDependencies:["ts-morph"],exports:["."],directory:"mcp",published:true},{name:"@directive-run/mutator",version:"0.3.1",description:"Discriminated mutation helper for Directive \u2014 collapse the pendingAction ceremony to a typed handler map.",homepage:"https://directive.run",keywords:["directive","mutator","state-management","discriminated-union","optimistic-update"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:["."],directory:"mutator",published:true},{name:"@directive-run/optimistic",version:"0.2.0",description:"Resolver-scope optimistic update + automatic rollback for Directive.",homepage:"https://directive.run",keywords:["directive","optimistic","rollback","snapshot","state-management"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:["."],directory:"optimistic",published:true},{name:"@directive-run/query",version:"1.2.0",description:"Declarative data fetching for Directive. Constraint-driven queries with causal cache invalidation.",homepage:"https://directive.run",keywords:["directive","data-fetching","query","cache","stale-while-revalidate","constraint-driven","reactive","typescript"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:["."],directory:"query",published:true},{name:"@directive-run/react",version:"1.17.0",description:"React hooks and components for Directive.",homepage:"https://directive.run",keywords:["directive","react","hooks","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","react"],optionalDependencies:[],exports:["."],directory:"react",published:true},{name:"@directive-run/scaffold",version:"0.1.0",description:"Pure source-string generators for Directive modules and orchestrators. Shared substrate consumed by @directive-run/cli (its `directive new` command) and @directive-run/mcp (its `generate_module` tool). Zero runtime dependencies.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","scaffold","codegen","module-generator"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:["."],directory:"scaffold",published:true},{name:"@directive-run/solid",version:"1.17.0",description:"Solid.js signals adapter for Directive.",homepage:"https://directive.run",keywords:["directive","solid","solidjs","signals","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","solid-js"],optionalDependencies:[],exports:["."],directory:"solid",published:true},{name:"@directive-run/svelte",version:"1.17.0",description:"Svelte stores adapter for Directive.",homepage:"https://directive.run",keywords:["directive","svelte","stores","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","svelte"],optionalDependencies:[],exports:["."],directory:"svelte",published:true},{name:"@directive-run/timeline",version:"0.3.1",description:"Time-travel test REPL for Directive. Auto-renders the causal-graph timeline of any failing test.",homepage:"https://directive.run",keywords:["directive","time-travel","test-debugging","vitest","causal-graph","state-management"],dependencies:[],peerDependencies:["@directive-run/core","vitest"],optionalDependencies:[],exports:[".","./matchers","./reporter"],directory:"timeline",published:true},{name:"@directive-run/vite-plugin-api-proxy",version:"0.1.1",description:"",keywords:[],dependencies:[],peerDependencies:["vite"],optionalDependencies:[],exports:["."],directory:"vite-plugin-api-proxy",published:false},{name:"@directive-run/vue",version:"1.17.0",description:"Vue composition API adapter for Directive.",homepage:"https://directive.run",keywords:["directive","vue","composition-api","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","vue"],optionalDependencies:[],exports:["."],directory:"vue",published:true}],S="2026-06-03T13:37:41.769Z";var _=2e5,D=5e3,Z=/^[\w./-]{1,128}$/,l=class extends Error{constructor(r,i){super(r);this.code=i;}};function T(e){let t=Buffer.byteLength(e.source,"utf8");if(t>_)throw new l(`source is ${t} bytes (max ${_})`,"source-too-large");let r="fileName"in e?e.fileName:void 0;if(r!==void 0&&!Z.test(r))throw new l("invalid fileName","bad-filename")}async function q(){let e=await undefined("@directive-run/lint/worker");return url.fileURLToPath(e)}async function E(e){let t=await q(),r=new worker_threads.Worker(t,{stderr:false}),i=null;try{return await new Promise((n,s)=>{let c=!1;r.once("message",a=>{c=!0,a.ok&&a.result!==void 0?n(a.result):s(new l(a.error??"worker returned without result","worker-error"));}),r.once("error",a=>{c=!0,s(new l(a.message,"worker-error"));}),r.once("exit",a=>{!c&&a!==0&&a!==null&&s(new l(`worker exited with code ${a} before responding`,"worker-error"));}),i=setTimeout(()=>{r.terminate(),s(new l(`parse exceeded ${D}ms budget`,"timeout"));},D),r.postMessage(e);})}finally{i&&clearTimeout(i),await r.terminate().catch(()=>{});}}function $(){return process.env.DIRECTIVE_MCP_USE_LINT_WORKER==="1"}async function R(e){return T(e),$()?E({kind:"run",source:e.source,options:{fileName:e.fileName,ruleFilter:e.ruleFilter}}):lint.runRules(e.source,{fileName:e.fileName,ruleFilter:e.ruleFilter})}async function I(e){return T(e),$()?E({kind:"fix",source:e.source,finding:e.finding}):lint.applyFix(e.source,e.finding)}var Q=3600*1e3,ee=3e3,C=new Map;function P(){return f.map(e=>({name:e.name,summary:e.description,published:e.published}))}async function A(e){let t=f.find(n=>n.name===e);if(!t)return;let{liveVersion:r,stale:i}=await re(t);return te(t,r,i)}function te(e,t,r){return {name:e.name,description:e.description,homepage:e.homepage,keywords:e.keywords,dependencies:e.dependencies,peerDependencies:e.peerDependencies,optionalDependencies:e.optionalDependencies,exports:e.exports,published:e.published,npmUrl:e.published?`https://www.npmjs.com/package/${e.name}`:void 0,bakedVersion:e.version,liveVersion:t,stale:r}}async function re(e){if(!e.published)return {stale:true};let t=C.get(e.name);if(t&&Date.now()-t.fetchedAt<Q)return {liveVersion:t.liveVersion,stale:t.liveVersion===void 0};let r=await ie(e.name);return C.set(e.name,{fetchedAt:Date.now(),liveVersion:r.liveVersion,latest:r.liveVersion,error:r.error}),{liveVersion:r.liveVersion,stale:r.liveVersion===void 0}}async function ie(e){let t=`https://registry.npmjs.org/${encodeURIComponent(e).replace(/%2F/g,"/")}/latest`,r=new AbortController,i=setTimeout(()=>r.abort(),ee);try{let n=await fetch(t,{signal:r.signal});if(!n.ok)return {error:`HTTP ${n.status}`};let s=await n.json();return typeof s.version=="string"?{liveVersion:s.version}:{error:"no version field"}}catch(n){return {error:n.message}}finally{clearTimeout(i);}}var M="0.2.0",U=50,O=200,N=512;function ke(e){return e.length>O?`${e.slice(0,O)}\u2026`:e}function F(e,t,r){let i=e.toLowerCase(),n=[];for(let[s,c]of t){let a=c.split(`
|
|
1
|
+
'use strict';var crypto=require('crypto'),claudePlugin=require('@directive-run/claude-plugin'),knowledge=require('@directive-run/knowledge'),scaffold=require('@directive-run/scaffold'),mcp_js=require('@modelcontextprotocol/sdk/server/mcp.js'),zod=require('zod'),url=require('url'),worker_threads=require('worker_threads'),lint=require('@directive-run/lint'),http=require('http'),sse_js=require('@modelcontextprotocol/sdk/server/sse.js');var f=[{name:"@directive-run/ai",version:"1.17.0",description:"AI guardrails and orchestration for Directive. Prompt injection, PII detection, cost tracking, multi-agent patterns.",homepage:"https://directive.run",keywords:["directive","ai","agents","guardrails","orchestration","llm","constraint-driven","ai-safety","prompt-injection","pii-detection","cost-tracking","multi-agent","openai","anthropic","ollama","gemini"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:[".","./anthropic","./devtools","./evals","./gemini","./guardrails","./mcp","./multi-agent","./ollama","./openai","./predicate","./testing"],directory:"ai",published:true},{name:"@directive-run/claude-plugin",version:"1.17.0",description:"Claude Code plugin for Directive \u2014 12 skills covering modules, constraints, resolvers, derivations, AI orchestration, and adapters. Installable via Claude Code's plugin marketplace or consumable programmatically as an npm package.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","claude","claude-code","skills","ai-rules","plugin","agents","knowledge"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:["."],directory:"claude-plugin",published:true},{name:"@directive-run/cli",version:"1.17.0",description:"CLI tools for Directive \u2014 AI coding rules, scaffolding, and more.",homepage:"https://directive.run",keywords:["directive","cli","ai-rules","cursor","copilot","claude","windsurf","cline","llms-txt"],dependencies:["@clack/prompts","@directive-run/knowledge","@directive-run/scaffold","picocolors"],peerDependencies:["@directive-run/timeline"],optionalDependencies:[],exports:[".","./llms.txt"],directory:"cli",published:true},{name:"@directive-run/core",version:"1.17.0",description:"The constraint-driven runtime for TypeScript. Declare what must be true \u2014 the runtime makes it happen.",homepage:"https://directive.run",keywords:["directive","constraint-driven","state-management","constraints","reactive","runtime","typescript","ai-guardrails","zero-dependencies","auto-tracking","framework-agnostic","declarative"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:[".","./adapter-utils","./internals","./migration","./plugins","./testing","./worker"],directory:"core",published:true},{name:"@directive-run/el",version:"1.1.0",description:"Vanilla DOM adapter for Directive. Typed element creation + reactive bindings + JSX runtime.",homepage:"https://directive.run",keywords:["directive","vanilla","dom","elements","jsx","htm","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","htm"],optionalDependencies:[],exports:[".","./htm","./jsx-dev-runtime","./jsx-runtime"],directory:"el",published:true},{name:"@directive-run/knowledge",version:"1.17.0",description:"Knowledge files, examples, and validation for Directive \u2014 the constraint-driven TypeScript runtime.",homepage:"https://directive.run",keywords:["directive","knowledge","ai-rules","examples"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:["."],directory:"knowledge",published:true},{name:"@directive-run/lint",version:"0.1.1",description:"ts-morph-based static analysis for Directive code. Rule registry + executable checks + autofixes. Consumed by @directive-run/mcp (review_source, fix_code tools) and the future `directive doctor lint` CLI command. Anti-pattern data sourced from @directive-run/knowledge so rule IDs stay in lock-step.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","lint","ast","ts-morph","review","anti-patterns"],dependencies:[],peerDependencies:[],optionalDependencies:["ts-morph"],exports:[".","./worker"],directory:"lint",published:true},{name:"@directive-run/lit",version:"1.17.0",description:"Lit web components adapter for Directive.",homepage:"https://directive.run",keywords:["directive","lit","web-components","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","lit"],optionalDependencies:[],exports:["."],directory:"lit",published:true},{name:"@directive-run/mcp",version:"0.2.1",description:"Model Context Protocol server that exposes Directive to AI clients \u2014 knowledge files, code examples, and Claude Code skill bundles today, with room to grow into runtime introspection and tooling. stdio for local clients (Claude Desktop, Cursor, MCP Inspector), SSE for hosted deployments at mcp.directive.run.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","mcp","model-context-protocol","knowledge","ai-rules","sse","stdio"],dependencies:["@directive-run/claude-plugin","@directive-run/knowledge","@directive-run/lint","@directive-run/scaffold","@modelcontextprotocol/sdk","zod"],peerDependencies:[],optionalDependencies:["ts-morph"],exports:["."],directory:"mcp",published:true},{name:"@directive-run/mutator",version:"0.3.1",description:"Discriminated mutation helper for Directive \u2014 collapse the pendingAction ceremony to a typed handler map.",homepage:"https://directive.run",keywords:["directive","mutator","state-management","discriminated-union","optimistic-update"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:["."],directory:"mutator",published:true},{name:"@directive-run/optimistic",version:"0.2.0",description:"Resolver-scope optimistic update + automatic rollback for Directive.",homepage:"https://directive.run",keywords:["directive","optimistic","rollback","snapshot","state-management"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:["."],directory:"optimistic",published:true},{name:"@directive-run/query",version:"1.2.0",description:"Declarative data fetching for Directive. Constraint-driven queries with causal cache invalidation.",homepage:"https://directive.run",keywords:["directive","data-fetching","query","cache","stale-while-revalidate","constraint-driven","reactive","typescript"],dependencies:[],peerDependencies:["@directive-run/core"],optionalDependencies:[],exports:["."],directory:"query",published:true},{name:"@directive-run/react",version:"1.17.0",description:"React hooks and components for Directive.",homepage:"https://directive.run",keywords:["directive","react","hooks","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","react"],optionalDependencies:[],exports:["."],directory:"react",published:true},{name:"@directive-run/scaffold",version:"0.1.0",description:"Pure source-string generators for Directive modules and orchestrators. Shared substrate consumed by @directive-run/cli (its `directive new` command) and @directive-run/mcp (its `generate_module` tool). Zero runtime dependencies.",homepage:"https://directive.run/docs/ide-integration",keywords:["directive","scaffold","codegen","module-generator"],dependencies:[],peerDependencies:[],optionalDependencies:[],exports:["."],directory:"scaffold",published:true},{name:"@directive-run/solid",version:"1.17.0",description:"Solid.js signals adapter for Directive.",homepage:"https://directive.run",keywords:["directive","solid","solidjs","signals","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","solid-js"],optionalDependencies:[],exports:["."],directory:"solid",published:true},{name:"@directive-run/svelte",version:"1.17.0",description:"Svelte stores adapter for Directive.",homepage:"https://directive.run",keywords:["directive","svelte","stores","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","svelte"],optionalDependencies:[],exports:["."],directory:"svelte",published:true},{name:"@directive-run/timeline",version:"0.3.1",description:"Time-travel test REPL for Directive. Auto-renders the causal-graph timeline of any failing test.",homepage:"https://directive.run",keywords:["directive","time-travel","test-debugging","vitest","causal-graph","state-management"],dependencies:[],peerDependencies:["@directive-run/core","vitest"],optionalDependencies:[],exports:[".","./matchers","./reporter"],directory:"timeline",published:true},{name:"@directive-run/vite-plugin-api-proxy",version:"0.1.1",description:"",keywords:[],dependencies:[],peerDependencies:["vite"],optionalDependencies:[],exports:["."],directory:"vite-plugin-api-proxy",published:false},{name:"@directive-run/vue",version:"1.17.0",description:"Vue composition API adapter for Directive.",homepage:"https://directive.run",keywords:["directive","vue","composition-api","state-management","reactive","constraint-driven"],dependencies:[],peerDependencies:["@directive-run/core","@directive-run/query","vue"],optionalDependencies:[],exports:["."],directory:"vue",published:true}],S="2026-06-04T00:02:07.900Z";var _=2e5,D=5e3,Z=/^[\w./-]{1,128}$/,l=class extends Error{constructor(r,i){super(r);this.code=i;}};function T(e){let t=Buffer.byteLength(e.source,"utf8");if(t>_)throw new l(`source is ${t} bytes (max ${_})`,"source-too-large");let r="fileName"in e?e.fileName:void 0;if(r!==void 0&&!Z.test(r))throw new l("invalid fileName","bad-filename")}async function q(){let e=await undefined("@directive-run/lint/worker");return url.fileURLToPath(e)}async function E(e){let t=await q(),r=new worker_threads.Worker(t,{stderr:false}),i=null;try{return await new Promise((n,s)=>{let c=!1;r.once("message",a=>{c=!0,a.ok&&a.result!==void 0?n(a.result):s(new l(a.error??"worker returned without result","worker-error"));}),r.once("error",a=>{c=!0,s(new l(a.message,"worker-error"));}),r.once("exit",a=>{!c&&a!==0&&a!==null&&s(new l(`worker exited with code ${a} before responding`,"worker-error"));}),i=setTimeout(()=>{r.terminate(),s(new l(`parse exceeded ${D}ms budget`,"timeout"));},D),r.postMessage(e);})}finally{i&&clearTimeout(i),await r.terminate().catch(()=>{});}}function $(){return process.env.DIRECTIVE_MCP_USE_LINT_WORKER==="1"}async function R(e){return T(e),$()?E({kind:"run",source:e.source,options:{fileName:e.fileName,ruleFilter:e.ruleFilter}}):lint.runRules(e.source,{fileName:e.fileName,ruleFilter:e.ruleFilter})}async function I(e){return T(e),$()?E({kind:"fix",source:e.source,finding:e.finding}):lint.applyFix(e.source,e.finding)}var Q=3600*1e3,ee=3e3,C=new Map;function P(){return f.map(e=>({name:e.name,summary:e.description,published:e.published}))}async function A(e){let t=f.find(n=>n.name===e);if(!t)return;let{liveVersion:r,stale:i}=await re(t);return te(t,r,i)}function te(e,t,r){return {name:e.name,description:e.description,homepage:e.homepage,keywords:e.keywords,dependencies:e.dependencies,peerDependencies:e.peerDependencies,optionalDependencies:e.optionalDependencies,exports:e.exports,published:e.published,npmUrl:e.published?`https://www.npmjs.com/package/${e.name}`:void 0,bakedVersion:e.version,liveVersion:t,stale:r}}async function re(e){if(!e.published)return {stale:true};let t=C.get(e.name);if(t&&Date.now()-t.fetchedAt<Q)return {liveVersion:t.liveVersion,stale:t.liveVersion===void 0};let r=await ie(e.name);return C.set(e.name,{fetchedAt:Date.now(),liveVersion:r.liveVersion,latest:r.liveVersion,error:r.error}),{liveVersion:r.liveVersion,stale:r.liveVersion===void 0}}async function ie(e){let t=`https://registry.npmjs.org/${encodeURIComponent(e).replace(/%2F/g,"/")}/latest`,r=new AbortController,i=setTimeout(()=>r.abort(),ee);try{let n=await fetch(t,{signal:r.signal});if(!n.ok)return {error:`HTTP ${n.status}`};let s=await n.json();return typeof s.version=="string"?{liveVersion:s.version}:{error:"no version field"}}catch(n){return {error:n.message}}finally{clearTimeout(i);}}var M="0.2.0",U=50,O=200,N=512;function ke(e){return e.length>O?`${e.slice(0,O)}\u2026`:e}function F(e,t,r){let i=e.toLowerCase(),n=[];for(let[s,c]of t){let a=c.split(`
|
|
2
2
|
`);for(let d=0;d<a.length;d++){let p=a[d];if(p.toLowerCase().includes(i)&&(n.push(`${s}${r}:${d+1}: ${ke(p)}`),n.length>=U))return n}}return n}function V(e,t){return t.length===0?`No matches for '${e}'.`:`${t.length===U?`${t.length}+ matches (truncated):`:`${t.length} matches:`}
|
|
3
3
|
${t.join(`
|
|
4
4
|
`)}`}var v=null;function we(){if(v)return v;let e=crypto.createHash("sha256");for(let[t,r]of Array.from(knowledge.getAllKnowledge()).sort(([i],[n])=>i.localeCompare(n)))e.update(t),e.update("\0"),e.update(r),e.update("\0");return v=e.digest("hex").slice(0,16),v}var g={transport:"stdio",authEnabled:false};function j(e){g=e;}function h(e,t,r){r.length!==0&&e.push("",`**${t}:**`,...r.map(i=>`- ${i}`));}function be(e){let t=[`# ${e.name}`,e.description,"",`**Version (live):** ${e.liveVersion??"unknown"}`,`**Version (baked):** ${e.bakedVersion}${e.stale?" (live fetch failed; using baked)":""}`,`**Published to npm:** ${e.published?"yes":"no (private workspace package)"}`];return e.homepage&&t.push(`**Homepage:** ${e.homepage}`),e.npmUrl&&t.push(`**npm:** ${e.npmUrl}`),h(t,"Dependencies",e.dependencies),h(t,"Peer dependencies",e.peerDependencies),h(t,"Optional dependencies",e.optionalDependencies),h(t,"Exports",e.exports),t.join(`
|