@vpxa/aikit 0.1.129 → 0.1.131

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.
@@ -9,7 +9,7 @@ import{DependencyAnalyzer as e,DiagramGenerator as t,EntryPointAnalyzer as n,Pat
9
9
  ### Patterns Detected
10
10
  `),n.push(`| Pattern | Confidence | Count |`),n.push(`|---------|-----------|-------|`);for(let t of e.patterns)n.push(`| ${t.name} | ${t.confidence} | ${t.count} |`)}else t===`normal`&&n.push(`\n**Patterns:** ${e.patterns.map(e=>e.name).join(`, `)}`);return n.join(`
11
11
  `)}const rt=/^[a-zA-Z0-9_./\-~^@{}]+$/;function it(e){let{from:t,to:n=`HEAD`,format:r=`grouped`,includeBreaking:i=!0,cwd:a=process.cwd()}=e;if(!rt.test(t))throw Error(`Invalid git ref: ${t}`);if(!rt.test(n))throw Error(`Invalid git ref: ${n}`);let o;try{o=u(`git`,[`log`,`${t}..${n}`,`--format=%H%s%b%an%ai`],{cwd:a,encoding:`utf8`,maxBuffer:10*1024*1024,timeout:3e4})}catch{throw Error(`Git log failed. Ensure "${t}" and "${n}" are valid refs.`)}let s=o.split(``).map(e=>e.trim()).filter(Boolean).map(e=>{let[t=``,n=``,r=``,i=``,a=``]=e.split(``),o=n.match(/^(\w+)(?:\(([^)]*)\))?(!)?:\s*(.+)/);return{hash:t.slice(0,8),type:o?.[1]??`other`,scope:o?.[2]??``,subject:o?.[4]??n,body:r.trim(),author:i.trim(),date:a.trim().split(` `)[0],breaking:!!(o?.[3]||/BREAKING[\s-]CHANGE/i.test(r))}}),c={},l=0;for(let e of s)c[e.type]=(c[e.type]??0)+1,e.breaking&&l++;return{entries:s,markdown:at(s,r,i),stats:{total:s.length,breaking:l,types:c}}}function at(e,t,n){let r=[`# Changelog`,``];if(n){let t=e.filter(e=>e.breaking);if(t.length>0){r.push(`## Breaking Changes`,``);for(let e of t)r.push(`- ${e.subject} (${e.hash})`);r.push(``)}}if(t===`grouped`){let t={};for(let n of e)t[n.type]||(t[n.type]=[]),t[n.type].push(n);let n=[`feat`,`fix`,`refactor`,`perf`,`test`,`docs`,`chore`],i={feat:`Features`,fix:`Bug Fixes`,refactor:`Refactoring`,perf:`Performance`,test:`Tests`,docs:`Documentation`,chore:`Chores`,other:`Other`};for(let e of[...n,...Object.keys(t).filter(e=>!n.includes(e))])if(t[e]?.length){r.push(`## ${i[e]??e}`,``);for(let n of t[e]){let e=n.scope?`**${n.scope}:** `:``;r.push(`- ${e}${n.subject} (${n.hash})`)}r.push(``)}}else if(t===`chronological`)for(let t of e){let e=t.scope?`(${t.scope}) `:``;r.push(`- \`${t.date}\` ${t.type}: ${e}${t.subject} (${t.hash})`)}else{let t={};for(let n of e){let e=n.scope||`general`;t[e]||(t[e]=[]),t[e].push(n)}for(let[e,n]of Object.entries(t)){r.push(`## ${e}`,``);for(let e of n)r.push(`- ${e.type}: ${e.subject} (${e.hash})`);r.push(``)}}return r.join(`
12
- `)}const ot=/^[a-z0-9][a-z0-9-]*$/,st=new Map;function ct(e){let t=w(e),n=st.get(t);if(n!==void 0)return n;try{return u(`git`,[`rev-parse`,`--git-dir`],{cwd:t,timeout:1e4,encoding:`utf8`}),st.set(t,!0),!0}catch{return st.set(t,!1),!1}}function U(e,t,n,r){try{return u(`git`,e,{cwd:t,timeout:1e4,input:n,encoding:`utf8`}).trim()}catch(t){r||console.warn(`Git operation failed (${e.join(` `)}): ${t instanceof Error?t.message:String(t)}`);return}}function lt(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,60)||`untitled`}function ut(e,t,n,r,i){let a=U([`hash-object`,`-w`,`--stdin`],i,n);if(!a)return;let o=U([`mktree`],i,`100644 blob ${a}\t${t}\n`);if(!o)return;let s=U([`rev-parse`,e],i,void 0,!0),c=[`commit-tree`,o];s&&c.push(`-p`,s),c.push(`-m`,r);let l=U(c,i);if(l)return U([`update-ref`,e,l],i)===void 0?void 0:l}function dt(){st.clear()}const ft=`refs/aikit/checkpoints`,pt=ot;function W(e){let t=lt(e);return t===`untitled`?`checkpoint`:t}function mt(e,t,n){if(typeof e!=`string`||e.length<1||e.length>120)throw Error(`Checkpoint label must be 1-120 characters.`);if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Checkpoint data must be a JSON-serializable object.`);let r;try{r=JSON.stringify(t)}catch{throw Error(`Checkpoint data must be a JSON-serializable object.`)}if(typeof r!=`string`)throw Error(`Checkpoint data must be a JSON-serializable object.`);if(Buffer.byteLength(r,`utf8`)>5e5)throw Error(`Checkpoint data must be 500KB or less when serialized.`);if(n?.notes!==void 0&&Buffer.byteLength(n.notes,`utf8`)>1e4)throw Error(`Checkpoint notes must be 10KB or less.`)}function ht(e,t){let n=W(e.label),r=`${ft}/${n}`;if(ot.test(n))return ut(r,`checkpoint.json`,`${JSON.stringify(e,null,2)}\n`,`checkpoint: ${e.label}`,t)}function gt(e,t){let n=new Set,r=/^\d+-(.+)$/.exec(e);r?.[1]&&n.add(r[1]),n.add(W(e));for(let e of n){if(!pt.test(e))continue;let n=U([`rev-parse`,`${ft}/${e}`],t);if(!n)continue;let r=U([`cat-file`,`blob`,`${n}:checkpoint.json`],t);if(r)try{let e=JSON.parse(r);if(typeof e?.id!=`string`||typeof e.label!=`string`||typeof e.createdAt!=`string`||!e.data||typeof e.data!=`object`||Array.isArray(e.data))continue;return mt(e.label,e.data,{notes:e.notes}),{...e,gitSha:n}}catch(e){console.warn(`Corrupt git-backed checkpoint ${n}: ${e instanceof Error?e.message:String(e)}`)}}}function _t(e){let t=w(z(e??process.cwd()),`checkpoints`);return j(t)||M(t,{recursive:!0}),t}function vt(e,t,n){mt(e,t,{notes:n?.notes});let r=W(e),i={id:`${Date.now()}-${r}`,label:e,createdAt:new Date().toISOString(),data:t,files:n?.files,notes:n?.notes},a=w(_t(n?.cwd),`${i.id}.json`),o=`${a}.tmp`;L(o,`${JSON.stringify(i,null,2)}\n`,`utf-8`),F(o,a);let s=n?.cwd??process.cwd();if(ct(s)){let e=ht(i,s);e&&(i.gitSha=e)}return i}function yt(e,t){let n=_t(t),r=w(n,`${e}.json`);if(r.startsWith(w(n))){if(!j(r)){let n=t??process.cwd();return ct(n)?gt(e,n):void 0}try{return JSON.parse(N(r,`utf-8`))}catch(e){if(e?.code===`ENOENT`)return;console.warn(`Corrupt state file ${r}: ${e instanceof Error?e.message:String(e)}`);return}}}function bt(e){let t=_t(e);return P(t).filter(e=>e.endsWith(`.json`)).flatMap(e=>{let n=w(t,e);try{return[JSON.parse(N(n,`utf-8`))]}catch(e){return e?.code===`ENOENT`||console.warn(`Corrupt state file ${n}: ${e instanceof Error?e.message:String(e)}`),[]}}).sort((e,t)=>t.createdAt.localeCompare(e.createdAt))}function xt(e){return bt(e)[0]}function St(e,t,n){let r=yt(e,n),i=yt(t,n);if(!r||!i)return;let a=new Set(Object.keys(r.data)),o=new Set(Object.keys(i.data));return{fromId:e,toId:t,added:[...o].filter(e=>!a.has(e)),removed:[...a].filter(e=>!o.has(e)),modified:[...a].filter(e=>o.has(e)).filter(e=>JSON.stringify(r.data[e])!==JSON.stringify(i.data[e]))}}function Ct(e,t){let n=t?.cwd??process.cwd(),r=t?.limit??20,i=W(e);if(ct(n)){let e=`refs/aikit/checkpoints/${i}`,t=U([`log`,`--format=%H %aI %s`,`-n`,String(r),e],n);if(t)return t.trim().split(`
12
+ `)}const ot=/^[a-z0-9][a-z0-9-]*$/,st=new Map;function ct(e){let t=w(e),n=st.get(t);if(n!==void 0)return n;try{return u(`git`,[`rev-parse`,`--git-dir`],{cwd:t,timeout:1e4,encoding:`utf8`}),st.set(t,!0),!0}catch{return st.set(t,!1),!1}}function U(e,t,n,r){try{return u(`git`,e,{cwd:t,timeout:1e4,input:n,encoding:`utf8`,stdio:[`pipe`,`pipe`,`pipe`]}).trim()}catch(t){r||console.warn(`Git operation failed (${e.join(` `)}): ${t instanceof Error?t.message:String(t)}`);return}}function lt(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,60)||`untitled`}function ut(e,t,n,r,i){let a=U([`hash-object`,`-w`,`--stdin`],i,n);if(!a)return;let o=U([`mktree`],i,`100644 blob ${a}\t${t}\n`);if(!o)return;let s=U([`rev-parse`,e],i,void 0,!0),c=[`commit-tree`,o];s&&c.push(`-p`,s),c.push(`-m`,r);let l=U(c,i);if(l)return U([`update-ref`,e,l],i)===void 0?void 0:l}function dt(){st.clear()}const ft=`refs/aikit/checkpoints`,pt=ot;function W(e){let t=lt(e);return t===`untitled`?`checkpoint`:t}function mt(e,t,n){if(typeof e!=`string`||e.length<1||e.length>120)throw Error(`Checkpoint label must be 1-120 characters.`);if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Checkpoint data must be a JSON-serializable object.`);let r;try{r=JSON.stringify(t)}catch{throw Error(`Checkpoint data must be a JSON-serializable object.`)}if(typeof r!=`string`)throw Error(`Checkpoint data must be a JSON-serializable object.`);if(Buffer.byteLength(r,`utf8`)>5e5)throw Error(`Checkpoint data must be 500KB or less when serialized.`);if(n?.notes!==void 0&&Buffer.byteLength(n.notes,`utf8`)>1e4)throw Error(`Checkpoint notes must be 10KB or less.`)}function ht(e,t){let n=W(e.label),r=`${ft}/${n}`;if(ot.test(n))return ut(r,`checkpoint.json`,`${JSON.stringify(e,null,2)}\n`,`checkpoint: ${e.label}`,t)}function gt(e,t){let n=new Set,r=/^\d+-(.+)$/.exec(e);r?.[1]&&n.add(r[1]),n.add(W(e));for(let e of n){if(!pt.test(e))continue;let n=U([`rev-parse`,`${ft}/${e}`],t);if(!n)continue;let r=U([`cat-file`,`blob`,`${n}:checkpoint.json`],t);if(r)try{let e=JSON.parse(r);if(typeof e?.id!=`string`||typeof e.label!=`string`||typeof e.createdAt!=`string`||!e.data||typeof e.data!=`object`||Array.isArray(e.data))continue;return mt(e.label,e.data,{notes:e.notes}),{...e,gitSha:n}}catch(e){console.warn(`Corrupt git-backed checkpoint ${n}: ${e instanceof Error?e.message:String(e)}`)}}}function _t(e){let t=w(z(e??process.cwd()),`checkpoints`);return j(t)||M(t,{recursive:!0}),t}function vt(e,t,n){mt(e,t,{notes:n?.notes});let r=W(e),i={id:`${Date.now()}-${r}`,label:e,createdAt:new Date().toISOString(),data:t,files:n?.files,notes:n?.notes},a=w(_t(n?.cwd),`${i.id}.json`),o=`${a}.tmp`;L(o,`${JSON.stringify(i,null,2)}\n`,`utf-8`),F(o,a);let s=n?.cwd??process.cwd();if(ct(s)){let e=ht(i,s);e&&(i.gitSha=e)}return i}function yt(e,t){let n=_t(t),r=w(n,`${e}.json`);if(r.startsWith(w(n))){if(!j(r)){let n=t??process.cwd();return ct(n)?gt(e,n):void 0}try{return JSON.parse(N(r,`utf-8`))}catch(e){if(e?.code===`ENOENT`)return;console.warn(`Corrupt state file ${r}: ${e instanceof Error?e.message:String(e)}`);return}}}function bt(e){let t=_t(e);return P(t).filter(e=>e.endsWith(`.json`)).flatMap(e=>{let n=w(t,e);try{return[JSON.parse(N(n,`utf-8`))]}catch(e){return e?.code===`ENOENT`||console.warn(`Corrupt state file ${n}: ${e instanceof Error?e.message:String(e)}`),[]}}).sort((e,t)=>t.createdAt.localeCompare(e.createdAt))}function xt(e){return bt(e)[0]}function St(e,t,n){let r=yt(e,n),i=yt(t,n);if(!r||!i)return;let a=new Set(Object.keys(r.data)),o=new Set(Object.keys(i.data));return{fromId:e,toId:t,added:[...o].filter(e=>!a.has(e)),removed:[...a].filter(e=>!o.has(e)),modified:[...a].filter(e=>o.has(e)).filter(e=>JSON.stringify(r.data[e])!==JSON.stringify(i.data[e]))}}function Ct(e,t){let n=t?.cwd??process.cwd(),r=t?.limit??20,i=W(e);if(ct(n)){let e=`refs/aikit/checkpoints/${i}`,t=U([`log`,`--format=%H %aI %s`,`-n`,String(r),e],n);if(t)return t.trim().split(`
13
13
  `).filter(Boolean).map(e=>{let[t,n,...r]=e.split(` `);return{sha:t,id:t.slice(0,12),createdAt:n,label:r.join(` `)}})}return bt(n).filter(e=>W(e.label)===i).slice(0,r).map(e=>({id:e.id,createdAt:e.createdAt,label:e.label}))}function wt(e){let t=bt(e?.cwd),n=e?.keepLast??10,r=e?.dryRun??!0,i=e?.maxAgeDays===void 0?void 0:Date.now()-e.maxAgeDays*864e5,a=e?.label?W(e.label):void 0,o=new Map;for(let e of t){let t=W(e.label);if(a&&t!==a)continue;let n=o.get(t);n?n.push(e):o.set(t,[e])}let s=[],c=0;for(let e of o.values())e.forEach((e,t)=>{let r=Date.parse(e.createdAt);if(t<n&&!(i!==void 0&&!Number.isNaN(r)&&r<i)){c+=1;return}s.push(e.id)});if(!r&&s.length>0){let t=_t(e?.cwd),n=e?.cwd??process.cwd(),r=new Set(s);for(let e of s){let n=w(t,`${e}.json`);if(n.startsWith(w(t)))try{ie(n)}catch(e){if(e?.code===`ENOENT`)continue;console.warn(`Failed to remove checkpoint ${n}: ${e instanceof Error?e.message:String(e)}`)}}if(ct(n))for(let[e,t]of o.entries())t.every(e=>r.has(e.id))&&pt.test(e)&&U([`update-ref`,`-d`,`${ft}/${e}`],n)}return{deleted:s.length,kept:c,labels:[...o.keys()],deletedIds:s}}const Tt=[`.ts`,`.tsx`,`.js`,`.jsx`],Et=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,R.state]);function Dt(e){return e.replace(/\\/g,`/`)}function Ot(e){return e.replace(/[.+^${}()|[\]\\]/g,`\\$&`)}function kt(e,t){let n=Dt(e),r=Dt(t).trim();if(!r)return!1;let i=Ot(r).replace(/\*\*/g,`::DOUBLE_STAR::`).replace(/\*/g,`[^/]*`).replace(/\?/g,`[^/]`).replace(/::DOUBLE_STAR::/g,`.*`);return RegExp(`^${i}$`).test(n)}function At(e,t,n){return t.some(t=>kt(e,t)?!0:n?kt(`${e}/`,t):!1)}async function jt(e,t,n){let r=[],i=t.map(e=>e.toLowerCase());async function a(t){let o=await m(t);for(let s of o){if(Et.has(s))continue;let o=S(t,s),c=await g(o),l=Dt(C(e,o));if(c.isDirectory()){At(l,n,!0)||await a(o);continue}At(l,n,!1)||i.includes(b(s).toLowerCase())&&r.push(o)}}return await a(e),r.sort((e,t)=>e.localeCompare(t)),r}const Mt=R.restorePoints;function Nt(){let e=S(process.cwd(),Mt);return j(e)||M(e,{recursive:!0}),e}function Pt(e,t,n){let r=Nt(),i=`${Date.now()}-${e}`,a={id:i,timestamp:new Date().toISOString(),operation:e,files:t,description:n};L(S(r,`${i}.json`),`${JSON.stringify(a,null,2)}\n`,`utf-8`);let o=P(r).filter(e=>e.endsWith(`.json`)).sort();for(;o.length>50;){let e=o.shift();if(!e)break;try{ie(S(r,e))}catch{}}return i}function Ft(){let e=S(process.cwd(),Mt);return j(e)?P(e).filter(e=>e.endsWith(`.json`)).sort().reverse().map(t=>{try{return JSON.parse(N(S(e,t),`utf-8`))}catch(n){return console.debug(`Skipping corrupt restore point ${S(e,t)}: ${n instanceof Error?n.message:String(n)}`),null}}).filter(e=>e!==null):[]}async function It(e){let t=S(S(process.cwd(),Mt),`${e}.json`);if(!j(t))throw Error(`Restore point not found: ${e}`);let n=JSON.parse(N(t,`utf-8`)),r=[];for(let e of n.files){let t=y(e.path);j(t)||M(t,{recursive:!0}),await _(e.path,e.content,`utf-8`),r.push(e.path)}return r}function Lt(e){return e.replace(/\\/g,`/`)}async function Rt(e){let{rootPath:t,rules:n,extensions:r=Tt,exclude:i=[],dryRun:a=!1}=e,o=n.map(e=>({...e,regex:new RegExp(e.pattern,`g`)})),s=await jt(t,r,i),c=[],l=new Set,u=0,d=[];for(let e of s){let n=Lt(C(t,e)),r=await p(e,`utf-8`),i=r.split(/\r?\n/),s=!1;for(let[e,t]of o.entries())if(!(t.fileFilter&&!kt(n,t.fileFilter)))for(let r=0;r<i.length;r++){let a=i[r];t.regex.lastIndex=0;let o=a.replace(t.regex,t.replacement);a!==o&&(i[r]=o,s=!0,l.add(e),c.push({rule:t.description,path:n,line:r+1,before:a,after:o}))}s&&(u+=1,a||(d.push({path:e,content:r}),await _(e,i.join(`
14
14
  `),`utf-8`)))}return!a&&d.length>0&&Pt(`codemod`,d,`codemod: ${n.length} rules, ${u} files`),{changes:c,rulesApplied:l.size,filesModified:u,dryRun:a}}const zt=new ce({max:200,ttl:1e3*60*30});function Bt(e){return B(`sha256`).update(e).digest(`hex`).slice(0,16)}function Vt(e,t){let n=Bt(t),r=zt.get(e);if(zt.set(e,{hash:n,text:t,timestamp:Date.now()}),!r||r.hash===n)return{text:r?.hash===n?`[No changes since last read]`:t,isDelta:r?.hash===n,hash:n};let i=se(e,e,r.text,t,`previous`,`current`,{context:3});return i.length>=t.length*.8?{text:t,isDelta:!1,hash:n}:{text:i,isDelta:!0,hash:n}}const Ht=.6;function Ut(e){if(!e||e.length===0)return 0;let t=le(e),n=e.length;return n===0?0:Math.min(t.length/n,Ht)/Ht}function Wt(e){if(e.length===0)return[];let t=new Map,n=[];for(let r of e){let e=le(r);n.push(e);for(let n of e)t.set(n,(t.get(n)??0)+1)}let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=n[i];if(!a||o.length===0){r.push(0);continue}let s=Math.min(o.length/a.length,Ht)/Ht,c=0;for(let e of o)(t.get(e)??0)===1&&c++;let l=c/o.length,u=.6*s+.4*l;r.push(Math.min(u,1))}return r}function Gt(e){if(!e||e.length===0)return 0;let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);let n=0,r=e.length;for(let e of t.values()){let t=e/r;t>0&&(n-=t*Math.log2(t))}return Math.min(n/6.6,1)}function Kt(e){try{return Ut(e)}catch{return Gt(e)}}async function qt(e,t){let{query:n,maxChars:r=3e3,minScore:i=.3,segmentation:a=`paragraph`}=t,o=t.tokenBudget?t.tokenBudget*4:r,s;if(t.text)s=t.text;else if(t.path){let e;try{e=await g(t.path)}catch(e){let n=e.code;throw n===`ENOENT`?Error(`File not found: ${t.path}. Check the path and try again.`):n===`EACCES`||n===`EPERM`?Error(`Permission denied reading ${t.path}. The file exists but is not accessible.`):e}if(e.isDirectory())throw Error(`Path is a directory: ${t.path}. compact requires a file path, not a directory. Use analyze({ aspect: "structure", path }) or find to explore directories.`);if(e.size>1e7)throw Error(`File too large (${(e.size/1e6).toFixed(1)}MB). compact supports files up to 10MB. Consider splitting or using search instead.`);s=t.cache?(await t.cache.get(t.path)).content:await p(t.path,`utf-8`)}else throw Error(`Either "text" or "path" must be provided`);if(t.mode===`delta`&&t.path){let e=Vt(t.path,s);if(e.isDelta)return{text:e.text,originalChars:s.length,compressedChars:e.text.length,ratio:e.text.length/s.length,segmentsKept:1,segmentsTotal:1}}if(s.length<=o)return{text:s,originalChars:s.length,compressedChars:s.length,ratio:1,segmentsKept:1,segmentsTotal:1};let c=Ye(s,a);if(c.length===0)return{text:``,originalChars:s.length,compressedChars:0,ratio:0,segmentsKept:0,segmentsTotal:0};let l=await e.embed(n),u=Wt(c),d=[];for(let t=0;t<c.length;t++){let n=.85*Xe(l,await e.embed(c[t]))+.15*(u[t]??0);d.push({text:c[t],score:n,index:t})}let f=d.filter(e=>e.score>=i).sort((e,t)=>t.score-e.score),m=[],h=0;for(let e of f){if(h+e.text.length>o){h===0&&(m.push({...e,text:e.text.slice(0,o)}),h=o);break}m.push(e),h+=e.text.length+2}let _=Ze(m.sort((e,t)=>t.score-e.score)).map(e=>e.text).join(`
15
15
 
@@ -1,6 +1,6 @@
1
1
  // AUTO-GENERATED - do not edit manually.
2
2
  // Source: packages/server/src/tools/present/block-registry.ts
3
- // Generated at: 2026-05-09T23:23:08.325Z
3
+ // Generated at: 2026-05-10T12:35:16.736Z
4
4
 
5
5
  export const ALL_BLOCK_DOCS = "| Type | Description | Value Shape |\n|------|-------------|-------------|\n| `markdown` | Markdown content rendered with the marked parser. | `string` |\n| `code` | Formatted code block rendered inside pre/code tags. | `string` |\n| `mermaid` | Mermaid diagram source rendered in a mermaid pre block. | `string` |\n| `table` | Tabular data rendered from records or explicit headers and rows. | `Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }` |\n| `metrics` | Metric cards showing label/value pairs with optional trend and status. | `Array<{ label: string; value: string | number; trend?: string | number; status?: string }>` |\n| `cards` | Card grid for titled items with optional body, badge, and status. | `Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>` |\n| `tree` | Hierarchical object or name/children tree rendered recursively. | `{ name: string; children?: unknown[] } | Record<string, unknown>` |\n| `graph` | Node and edge graph rendered as a Mermaid flow graph in HTML mode. | `{ nodes: Array<{ id: string; label?: string }>; edges: Array<{ from: string; to: string; label?: string }> }` |\n| `chart` | Structured chart definition rendered as SVG. | `{ chartType: string; data: Record<string, unknown>[]; xKey: string; yKeys: string[] }` |\n| `timeline` | Timeline entries rendered as a vertical sequence of events. | `Array<{ title: string; description?: string; timestamp?: string; status?: string }>` |\n| `checklist` | Checklist items with boolean checked state. | `Array<{label, checked}> | {items: Array<{label, checked}>}` |\n| `comparison` | Side-by-side comparison columns with titled item lists. | `Array<{title, items}> | {columns: Array<{title, items}>}` |\n| `status-board` | Status categories containing labeled status items. | `Array<{category, items}> | {items: Array<{category, items}>}` |\n| `prompt` | Prompt payload rendered through the prompt display helper. | `unknown` |\n| `progress` | Progress bar with current value and optional maximum. | `{label, value, max?} | {items: Array<{label, value, max?, color?}>}` |\n| `viewer-link` | Styled card linking to a standalone interactive viewer. | `{ viewerType: string; label: string; description?: string; url?: string; icon?: string }` |\n| `docs-browser` | Collapsible file tree with markdown content for documentation browsing. | `{ files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }` |\n| `text` | Plain text content rendered through the markdown parser. | `string` |\n| `heading` | Single heading with configurable level from h1 to h6. | `string` |\n| `paragraph` | Single paragraph rendered inside a p tag. | `string` |\n| `separator` | Horizontal rule used to separate adjacent blocks. | `undefined` |\n| `actions` | Action bar containing button and select action definitions. | `Array<{ type: string; id: string; label: string; variant?: string; options?: Array<string | { label: string; value: string }> }>` |\n\n### Usage Examples\n\n#### `viewer-link`\n\n```typescript\n{\n type: 'viewer-link',\n value: {\n viewerType: 'c4',\n label: 'Open Interactive C4 Diagram',\n description: 'Drag, zoom, and pan with ELK auto-layout',\n icon: '🏗️',\n },\n}\n```\n\n#### `docs-browser`\n\n```typescript\n{\n type: 'docs-browser',\n value: {\n title: 'Project Docs',\n files: [\n { path: 'docs/README.md', title: 'Overview', status: 'current' },\n { path: 'docs/api.md', title: 'API Reference', status: 'stale' },\n ],\n },\n}\n```";
6
6