@ycodium-ai/plugin-tool-display 0.2.6212 → 0.2.6253

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/assets/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- var K=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
1
+ var $=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
2
  @layer properties, theme, base, components, utilities;
3
3
  @layer properties;
4
4
  @layer utilities {
@@ -365,22 +365,22 @@ var K=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
365
365
  }
366
366
  }
367
367
  }
368
- `;var ge=window.__ycodiumPluginHost.react;var{Activity:Ye,Children:ea,Component:Ce,Fragment:he,Profiler:aa,PureComponent:ta,StrictMode:oa,Suspense:ra,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:la,__COMPILER_RUNTIME:ua,act:da,cache:sa,cacheSignal:fa,captureOwnerStack:ia,cloneElement:na,createContext:M,createElement:C,createRef:ca,forwardRef:R,isValidElement:pa,lazy:ma,memo:Se,startTransition:La,unstable_useCacheRefresh:xa,use:we,useActionState:Ia,useCallback:_,useContext:$,useDebugValue:ga,useDeferredValue:Ca,useEffect:ye,useEffectEvent:ha,useId:Sa,useImperativeHandle:wa,useInsertionEffect:H,useLayoutEffect:ya,useMemo:ke,useOptimistic:ka,useReducer:Pa,useRef:Pe,useState:q,useSyncExternalStore:Te,useTransition:Ta,version:ba}=ge;var Z=M(null),Q=Z.Provider;function w(){let e=$(Z);if(e===null)throw new Error("Tool display UI has not been registered.");return e}function be(e){return`__ycodium${e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}Scope`}function Ae(e){let a=globalThis,t=be(e),o=(a[t]??0)+1;return a[t]=o,`ycodium-${e}-ui-${o}`}function E(e,a){let t=Ae(a),o=e.replaceAll(`.ycodium-${a}-ui`,`.${t}`),u=0,r=null;return{scopeClass:t,retain(){if(typeof document>"u")return()=>{};u===0&&(r=document.createElement("style"),r.setAttribute("data-ycodium-plugin-css",a),r.textContent=o,document.head.appendChild(r)),u+=1;let s=!1;return()=>{s||(s=!0,u=Math.max(0,u-1),u===0&&r!==null&&(r.remove(),r=null))}}}}var{jsx:l,jsxs:p,Fragment:N}=window.__ycodiumPluginHost.jsxRuntime;var Ga=M(null);var U=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim();var J=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var j=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,o)=>o?o.toUpperCase():t.toLowerCase());var G=e=>{let a=j(e);return a.charAt(0).toUpperCase()+a.slice(1)};var Y={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ee=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var ae=R(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:u="",children:r,iconNode:s,...i},f)=>C("svg",{ref:f,...Y,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:U("lucide",u),...!r&&!ee(i)&&{"aria-hidden":"true"},...i},[...s.map(([n,x])=>C(n,x)),...Array.isArray(r)?r:[r]]));var I=(e,a)=>{let t=R(({className:o,...u},r)=>C(ae,{ref:r,iconNode:a,className:U(`lucide-${J(G(e))}`,`lucide-${e}`,o),...u}));return t.displayName=G(e),t};var De=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],T=I("check",De);var Be=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],b=I("copy",Be);var ve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],A=I("globe",ve);var Fe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],D=I("search",Fe);var Me=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],h=I("square-terminal",Me);var W="[a-zA-Z][a-zA-Z0-9:_-]*";var Re="ycodium",Rt=`${Re}:`,qt=new RegExp(String.raw`(^|\s)([$/])(${W})(?=\s|$)`,"g");var Ut=new RegExp(String.raw`([$/])(${W})(?=\s|$)`,"y");var Ot=new RegExp(String.raw`^/(${W})$`);function qe(e){let a=e.match(/:(\d+)$/);if(!a?.[1])return{path:e,line:void 0,column:void 0};let t=e.slice(0,-a[0].length),o=t.match(/:(\d+)$/);return o?.[1]?{path:t.slice(0,-o[0].length),line:o[1],column:a[1]}:{path:t,line:a[1],column:void 0}}function V(e){return e.replaceAll("\\","/")}function z(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function Ue(e){return z(V(e.replace(/[\\/]+$/,"")))}function Oe(e){return e.slice(e.lastIndexOf("/")+1)}function He(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function Ee(e){return e.startsWith("\\\\")||/^[A-Za-z]:([/\\]|$)/.test(z(V(e)))}function y(e,a){let{path:t,line:o,column:u}=qe(e),r=z(V(t)),s=r;if(a){let i=Ue(a),f=Oe(i),n=Ee(a)?d=>d.toLowerCase():d=>d,x=n(r),m=n(i);if(x===m)s=f;else if(x.startsWith(`${m}/`))s=`${f}/${r.slice(i.length+1)}`;else if(!He(r)){let d=r.replace(/^\.\/+/,"").replace(/^\/+/,"");s=x.startsWith(`${n(f)}/`)?r:`${f}/${d}`}}return o?`${s}:${o}${u?`:${u}`:""}`:s}function g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function B(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Ne({entry:e,details:a}){let t=a.input?.text??e.toolIo?.input;if(!t)return null;let o=B(t);return g(o)}function oe(e){let a=g(e.entry.toolData),t=e.entry.toolLabel?.name??a?.tool??e.entry.toolTitle??e.entry.label;return typeof t=="string"?t.toLowerCase().replace(/[ _-]/g,""):""}function re(e){return e.entry.toolLifecycleStatus==="completed"&&!e.entry.displayFailed&&(e.details.exitCode===void 0||e.details.exitCode===0)}function Ge(e,a){let t=e.entry.toolLabel?.path??a?.file_path;return typeof t=="string"&&t.trim()?y(t,e.workspaceRoot):null}function We(e){let{entry:a,details:t}=e;if(a.requestKind!=="command"&&a.itemType!=="command_execution")return null;let o=t.input?.text;return!o||t.raw?null:{kind:"terminal",command:o,output:t.output?.text??"",copyText:[o,t.output?.text].filter(u=>u!==void 0).join(`
368
+ `;var Ce=window.__ycodiumPluginHost.react;var{Activity:ea,Children:aa,Component:he,Fragment:Se,Profiler:ta,PureComponent:oa,StrictMode:ra,Suspense:la,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ua,__COMPILER_RUNTIME:da,act:sa,cache:fa,cacheSignal:ia,captureOwnerStack:na,cloneElement:ca,createContext:q,createElement:S,createRef:pa,forwardRef:U,isValidElement:ma,lazy:La,memo:we,startTransition:xa,unstable_useCacheRefresh:Ia,use:ye,useActionState:ga,useCallback:Z,useContext:Q,useDebugValue:Ca,useDeferredValue:ha,useEffect:ke,useEffectEvent:Sa,useId:wa,useImperativeHandle:ya,useInsertionEffect:N,useLayoutEffect:ka,useMemo:Pe,useOptimistic:Pa,useReducer:Ta,useRef:Te,useState:O,useSyncExternalStore:be,useTransition:ba,version:Aa}=Ce;var J=q(null),j=J.Provider;function k(){let e=Q(J);if(e===null)throw new Error("Tool display UI has not been registered.");return e}function Ae(e){return`__ycodium${e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}Scope`}function De(e){let a=globalThis,t=Ae(e),o=(a[t]??0)+1;return a[t]=o,`ycodium-${e}-ui-${o}`}function G(e,a){let t=De(a),o=e.replaceAll(`.ycodium-${a}-ui`,`.${t}`),l=0,u=null;return{scopeClass:t,retain(){if(typeof document>"u")return()=>{};l===0&&(u=document.createElement("style"),u.setAttribute("data-ycodium-plugin-css",a),u.textContent=o,document.head.appendChild(u)),l+=1;let s=!1;return()=>{s||(s=!0,l=Math.max(0,l-1),l===0&&u!==null&&(u.remove(),u=null))}}}}var{jsx:r,jsxs:p,Fragment:W}=window.__ycodiumPluginHost.jsxRuntime;var Wa=q(null);var H=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim();var Y=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var ee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,o)=>o?o.toUpperCase():t.toLowerCase());var V=e=>{let a=ee(e);return a.charAt(0).toUpperCase()+a.slice(1)};var ae={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var te=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var oe=U(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:s,...d},f)=>S("svg",{ref:f,...ae,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:H("lucide",l),...!u&&!te(d)&&{"aria-hidden":"true"},...d},[...s.map(([c,m])=>S(c,m)),...Array.isArray(u)?u:[u]]));var C=(e,a)=>{let t=U(({className:o,...l},u)=>S(oe,{ref:u,iconNode:a,className:H(`lucide-${Y(V(e))}`,`lucide-${e}`,o),...l}));return t.displayName=V(e),t};var Be=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],A=C("check",Be);var ve=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],D=C("copy",ve);var Fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],B=C("globe",Fe);var Me=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],v=C("search",Me);var Re=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],w=C("square-terminal",Re);var z="[a-zA-Z][a-zA-Z0-9:_-]*";var qe="ycodium",qt=`${qe}:`,Ut=new RegExp(String.raw`(^|\s)([$/])(${z})(?=\s|$)`,"g");var Ot=new RegExp(String.raw`([$/])(${z})(?=\s|$)`,"y");var Ht=new RegExp(String.raw`^/(${z})$`);function Ue(e){let a=e.match(/:(\d+)$/);if(!a?.[1])return{path:e,line:void 0,column:void 0};let t=e.slice(0,-a[0].length),o=t.match(/:(\d+)$/);return o?.[1]?{path:t.slice(0,-o[0].length),line:o[1],column:a[1]}:{path:t,line:a[1],column:void 0}}function X(e){return e.replaceAll("\\","/")}function K(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function Oe(e){return K(X(e.replace(/[\\/]+$/,"")))}function He(e){return e.slice(e.lastIndexOf("/")+1)}function Ee(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function Ne(e){return e.startsWith("\\\\")||/^[A-Za-z]:([/\\]|$)/.test(K(X(e)))}function P(e,a){let{path:t,line:o,column:l}=Ue(e),u=K(X(t)),s=u;if(a){let d=Oe(a),f=He(d),c=Ne(a)?I=>I.toLowerCase():I=>I,m=c(u),L=c(d);if(m===L)s=f;else if(m.startsWith(`${L}/`))s=`${f}/${u.slice(d.length+1)}`;else if(!Ee(u)){let I=u.replace(/^\.\/+/,"").replace(/^\/+/,"");s=m.startsWith(`${c(f)}/`)?u:`${f}/${I}`}}return o?`${s}:${o}${l?`:${l}`:""}`:s}function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function F(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Ge({entry:e,details:a}){let t=a.input?.text??e.toolIo?.input;if(!t)return null;let o=F(t);return h(o)}function _(e){let a=h(e.entry.toolData),t=e.entry.toolLabel?.name??a?.tool??e.entry.toolTitle??e.entry.label;return typeof t=="string"?t.toLowerCase().replace(/[ _-]/g,""):""}function le(e){return e.entry.toolLifecycleStatus==="completed"&&!e.entry.displayFailed&&(e.details.exitCode===void 0||e.details.exitCode===0)}function We(e,a){let t=e.entry.toolLabel?.path??a?.file_path??a?.Path??a?.filePath??a?.target_file??a?.path;return typeof t=="string"&&t.trim()?P(t,e.workspaceRoot):null}function Ve(e){let{entry:a,details:t}=e;if(a.requestKind!=="command"&&a.itemType!=="command_execution")return null;let o=t.input?.text;return!o||t.raw?null:{kind:"terminal",command:o,output:t.output?.text??"",copyText:[o,t.output?.text].filter(l=>l!==void 0).join(`
369
369
 
370
- `)}}function Ve(e){let{entry:a,details:t}=e;if(a.requestKind!=="file-read"&&a.toolTitle!=="Read File"||a.displayFailed||t.raw||t.exitCode!==void 0&&t.exitCode!==0)return null;let o=Ge(e,Ne(e)),u=t.output?.text;if(!o||!u)return null;let r=[];for(let s of(u.endsWith(`
371
- `)?u.slice(0,-1):u).split(`
372
- `)){let i=/^\s*(\d+)→(.*)$/u.exec(s);if(!i)return null;let f=Number(i[1]);if(!Number.isSafeInteger(f)||f<1)return null;let n=r.at(-1);if(n&&f<=n.number)return null;r.push({number:f,text:i[2]})}return{kind:"read",path:o,lines:r,copyText:r.map(s=>s.text).join(`
373
- `)}}function ze(e){let{entry:a,details:t}=e;if(a.requestKind!=="file-change"&&a.itemType!=="file_change"||a.toolLifecycleStatus!=="completed"||a.displayFailed||t.exitCode!==void 0&&t.exitCode!==0)return null;let o=a.toolData;if(typeof o!="object"||o===null||Array.isArray(o))return null;let u=o.changes;if(!Array.isArray(u)||u.length===0)return null;let r=[];for(let[s,i]of u.entries()){if(typeof i!="object"||i===null||Array.isArray(i))return null;let{path:f,diff:n}=i;if(typeof f!="string"||!f.trim()||typeof n!="string"||!n)return null;let x=[],m=n.split(`
374
- `);for(let[d,c]of m.entries()){let L=c.startsWith("+++")||c.startsWith("---")?"context":c.startsWith("+")?"added":c.startsWith("-")?"removed":"context",X=x.at(-1);X?.kind===L?X.lines.push(c):x.push({line:d,kind:L,lines:[c]})}r.push({key:`${f}:${s}`,path:y(f,e.workspaceRoot),patch:n,parts:x})}return{kind:"change",files:r,copyText:r.map(s=>`${s.path}
370
+ `)}}function ze(e){let{entry:a,details:t}=e,o=_(e),l=a.toolTitle?.toLowerCase().replace(/[ _-]/g,"");if(a.requestKind!=="file-read"&&l!=="readfile"&&o!=="read"&&o!=="readfile"&&o!=="viewfile"||a.displayFailed||t.raw||t.exitCode!==void 0&&t.exitCode!==0)return null;let u=We(e,Ge(e)),s=t.output?.text;if(!u||!s)return null;let d=[];for(let f of(s.endsWith(`
371
+ `)?s.slice(0,-1):s).split(`
372
+ `)){let c=/^\s*(\d+)→(.*)$/u.exec(f);if(!c)return null;let m=Number(c[1]);if(!Number.isSafeInteger(m)||m<1)return null;let L=d.at(-1);if(L&&m<=L.number)return null;d.push({number:m,text:c[2]})}return{kind:"read",path:u,lines:d,copyText:d.map(f=>f.text).join(`
373
+ `)}}function Xe(e){let{entry:a,details:t}=e;if(a.requestKind!=="file-change"&&a.itemType!=="file_change"||a.toolLifecycleStatus!=="completed"||a.displayFailed||t.exitCode!==void 0&&t.exitCode!==0)return null;let o=a.toolData;if(typeof o!="object"||o===null||Array.isArray(o))return null;let l=o.changes;if(!Array.isArray(l)||l.length===0)return null;let u=[];for(let[s,d]of l.entries()){if(typeof d!="object"||d===null||Array.isArray(d))return null;let{path:f,diff:c}=d;if(typeof f!="string"||!f.trim()||typeof c!="string"||!c)return null;let m=[],L=c.split(`
374
+ `);for(let[I,i]of L.entries()){let n=i.startsWith("+++")||i.startsWith("---")?"context":i.startsWith("+")?"added":i.startsWith("-")?"removed":"context",x=m.at(-1);x?.kind===n?x.lines.push(i):m.push({line:I,kind:n,lines:[i]})}u.push({key:`${f}:${s}`,path:P(f,e.workspaceRoot),patch:c,parts:m})}return{kind:"change",files:u,copyText:u.map(s=>`${s.path}
375
375
  ${s.patch}`).join(`
376
376
 
377
- `)}}function Xe(e){if(!re(e))return null;let a=oe(e);if(a!=="grep"&&a!=="glob")return null;let t=e.details.output?.text;if(!t)return null;let o=g(B(e.details.input?.text??e.entry.toolIo?.input)),u=B(t),r=g(u),s=t.trimStart().startsWith("{")||t.trimStart().startsWith("[");if(r?.isError===!0||typeof r?.error=="string")return null;let i=typeof o?.pattern=="string"?o.pattern:e.entry.toolLabel?.detail??e.entry.label;if(a==="glob"){let m=r!==null||Array.isArray(u);if(!m&&s)return null;let d=r?r.filenames??r.paths:Array.isArray(u)?u:t.trim().split(`
378
- `);return!Array.isArray(d)||!d.every(c=>typeof c=="string"&&c.length>0)||!m&&!d.every(c=>/[/\\]|\.[a-z0-9]{1,12}$/i.test(c))?null:{kind:"search",resultKind:"paths",pattern:i,paths:d.map(c=>y(c,e.workspaceRoot)),copyText:t}}let f=typeof r?.content=="string"?r.content:t;if(r&&!Array.isArray(r.files)&&typeof r.content!="string"||!r&&s)return null;let n=new Map,x=(m,d,c)=>{let L=n.get(m)??[];L.push({line:d,text:c,key:`${d}:${L.length}`}),n.set(m,L)};if(Array.isArray(r?.files))for(let m of r.files){let d=g(m);if(typeof d?.path!="string"||!d.path||!Array.isArray(d.matches))return null;for(let c of d.matches){let L=g(c);if(typeof L?.lineNumber!="number"||!Number.isSafeInteger(L.lineNumber)||L.lineNumber<1||typeof L?.line!="string")return null;x(d.path,L.lineNumber,L.line)}}else for(let m of f.trimEnd().split(`
379
- `)){let d=/^(.+?):([1-9]\d*):(.*)$/u.exec(m);if(!d||!Number.isSafeInteger(Number(d[2])))return null;x(d[1],Number(d[2]),d[3])}return{kind:"search",resultKind:"matches",pattern:i,files:[...n].map(([m,d])=>({key:m,path:y(m,e.workspaceRoot),matches:d})),copyText:t}}function te(e){if(typeof e!="string")return null;try{let a=new URL(e);return(a.protocol==="http:"||a.protocol==="https:")&&!a.username&&!a.password?a.href:null}catch{return null}}function Ke(e){if(!re(e))return null;let a=oe(e);if(e.entry.itemType!=="web_search"&&a!=="websearch"&&a!=="webfetch"||a==="grep"||a==="glob")return null;let t=e.details.output?.text,o=B(t);if(!t)return null;let u=g(o);if(u?.isError===!0||typeof u?.error=="string")return null;let r=u?.sources??u?.results??(Array.isArray(o)?o:void 0),s=g(B(e.details.input?.text??e.entry.toolIo?.input)),i=typeof s?.query=="string"?s.query:e.entry.toolLabel?.detail??e.entry.label;if(Array.isArray(r)){let m=[];for(let d of r){let c=g(d),L=te(c?.url);if(!L||c?.title!==void 0&&typeof c.title!="string"||c?.snippet!==void 0&&typeof c.snippet!="string")return null;m.push({key:`${L}:${m.length}`,url:L,title:typeof c?.title=="string"?c.title:L,...typeof c?.snippet=="string"?{snippet:c.snippet}:{}})}return u?.answer!==void 0&&typeof u.answer!="string"?null:{kind:"web",query:i,sources:m,copyText:t,...typeof u?.answer=="string"?{answer:u.answer}:{}}}let f=te(u?.url),n=u?.statusCode;if(!f||typeof n!="number"||!Number.isInteger(n)||n<100||n>599)return null;let x=typeof u?.title=="string"?u.title:f;return{kind:"web",query:x,sources:[{key:f,url:f,title:x}],copyText:t,statusCode:n,...typeof u?.text=="string"?{answer:u.text}:{}}}var _e=[We,Ve,ze,Xe,Ke];function le(e){for(let a of _e){let t=a(e);if(t)return t}return null}function ue(e){return[e.input,e.output,e.raw].filter(a=>a!==void 0).map(a=>a.text).join(`
377
+ `)}}function Ke(e){if(!le(e))return null;let a=_(e),t=a==="glob"||a==="findbyname"||a==="filesearch";if(!(a==="grep"||a==="grepsearch"||a==="ripgrep")&&!t)return null;let l=e.details.output?.text;if(!l)return null;let u=h(F(e.details.input?.text??e.entry.toolIo?.input)),s=F(l),d=h(s),f=l.trimStart().startsWith("{")||l.trimStart().startsWith("[");if(d?.isError===!0||typeof d?.error=="string")return null;let c=typeof u?.pattern=="string"?u.pattern:typeof u?.Pattern=="string"?u.Pattern:typeof u?.Query=="string"?u.Query:e.entry.toolLabel?.detail??e.entry.label;if(t){let i=d!==null||Array.isArray(s);if(!i&&f)return null;let n=d?d.filenames??d.paths:Array.isArray(s)?s:l.trim().split(`
378
+ `);return!Array.isArray(n)||!n.every(x=>typeof x=="string"&&x.length>0)||!i&&!n.every(x=>/[/\\]|\.[a-z0-9]{1,12}$/i.test(x))?null:{kind:"search",resultKind:"paths",pattern:c,paths:n.map(x=>P(x,e.workspaceRoot)),copyText:l}}let m=typeof d?.content=="string"?d.content:l;if(d&&!Array.isArray(d.files)&&typeof d.content!="string"||!d&&f)return null;let L=new Map,I=(i,n,x)=>{let g=L.get(i)??[];g.push({line:n,text:x,key:`${n}:${g.length}`}),L.set(i,g)};if(Array.isArray(d?.files))for(let i of d.files){let n=h(i);if(typeof n?.path!="string"||!n.path||!Array.isArray(n.matches))return null;for(let x of n.matches){let g=h(x);if(typeof g?.lineNumber!="number"||!Number.isSafeInteger(g.lineNumber)||g.lineNumber<1||typeof g?.line!="string")return null;I(n.path,g.lineNumber,g.line)}}else for(let i of m.trimEnd().split(`
379
+ `)){let n=/^(.+?):([1-9]\d*):(.*)$/u.exec(i);if(!n||!Number.isSafeInteger(Number(n[2])))return null;I(n[1],Number(n[2]),n[3])}return{kind:"search",resultKind:"matches",pattern:c,files:[...L].map(([i,n])=>({key:i,path:P(i,e.workspaceRoot),matches:n})),copyText:l}}function re(e){if(typeof e!="string")return null;try{let a=new URL(e);return(a.protocol==="http:"||a.protocol==="https:")&&!a.username&&!a.password?a.href:null}catch{return null}}function _e(e){if(!le(e))return null;let a=_(e);if(e.entry.itemType!=="web_search"&&a!=="websearch"&&a!=="webfetch"||a==="grep"||a==="glob")return null;let t=e.details.output?.text,o=F(t);if(!t)return null;let l=h(o);if(l?.isError===!0||typeof l?.error=="string")return null;let u=l?.sources??l?.results??(Array.isArray(o)?o:void 0),s=h(F(e.details.input?.text??e.entry.toolIo?.input)),d=typeof s?.query=="string"?s.query:e.entry.toolLabel?.detail??e.entry.label;if(Array.isArray(u)){let L=[];for(let I of u){let i=h(I),n=re(i?.url);if(!n||i?.title!==void 0&&typeof i.title!="string"||i?.snippet!==void 0&&typeof i.snippet!="string")return null;L.push({key:`${n}:${L.length}`,url:n,title:typeof i?.title=="string"?i.title:n,...typeof i?.snippet=="string"?{snippet:i.snippet}:{}})}return l?.answer!==void 0&&typeof l.answer!="string"?null:{kind:"web",query:d,sources:L,copyText:t,...typeof l?.answer=="string"?{answer:l.answer}:{}}}let f=re(l?.url),c=l?.statusCode;if(!f||typeof c!="number"||!Number.isInteger(c)||c<100||c>599)return null;let m=typeof l?.title=="string"?l.title:f;return{kind:"web",query:m,sources:[{key:f,url:f,title:m}],copyText:t,statusCode:c,...typeof l?.text=="string"?{answer:l.text}:{}}}var $e=[Ve,ze,Xe,Ke,_e];function ue(e){for(let a of $e){let t=a(e);if(t)return t}return null}function de(e){return[e.input,e.output,e.raw].filter(a=>a!==void 0).map(a=>a.text).join(`
380
380
 
381
- `)}function v(...e){return e.filter(a=>typeof a=="string"&&a.length>0).join(" ")}function k(e){return(a=>C(w().ui[e],{...a,className:`ycodium-tool-display-ui ${typeof a.className=="string"?a.className:""}`}))}var O=k("Button"),de=k("Tooltip"),se=k("TooltipPopup"),fe=k("TooltipTrigger"),ie=k("Markdown"),ne=k("DetailViewport");function S(){return{t:w().i18n.usePluginTranslation()}}function ce({text:e}){let{t:a}=S(),t=w(),[o,u]=q(null),[r,s]=q(!1),i=o===e;return p("span",{className:"inline-flex items-center gap-1",children:[l(O,{type:"button",variant:"ghost-muted",size:"icon-xs","aria-label":a(i?"copied":"copy"),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&f.stopPropagation()},onClick:()=>{Promise.resolve(t.writeClipboard(e)).then(()=>{u(e),s(!1)},()=>{s(!0),t.notify(a("copyFailed"),"error")})},children:i?l(T,{"aria-hidden":!0,className:"size-icon-1"}):l(b,{"aria-hidden":!0,className:"size-icon-1"})}),r?l("span",{role:"status",className:"tool-meta text-destructive-foreground",children:a("copyFailed")}):null]})}var pe=new Map;function P(e){pe.set(e.kind,e)}function me(e){return pe.get(e.kind)}function F({text:e}){return p(de,{children:[l(fe,{render:l("code",{className:"min-w-0 truncate text-foreground"}),children:e}),l(se,{className:"max-w-lg whitespace-pre-wrap break-words",children:e})]})}function $e({model:e}){let{t:a}=S();if(e.resultKind==="paths")return e.paths.length===0?l("p",{className:"px-2 pb-2 text-muted-foreground",children:a("noSearchResults")}):l("pre",{className:"tool-body whitespace-pre-wrap break-words px-2 pb-2 text-foreground",children:e.paths.slice(0,16).join(`
382
- `)});let t=16;return l("div",{className:"tool-body px-2 pb-2",children:e.files.length===0?l("p",{className:"text-muted-foreground",children:a("noSearchResults")}):e.files.map(o=>{let u=o.matches.slice(0,t);return t-=u.length,u.length===0?null:p("div",{"data-search-file":o.path,className:"mb-2 last:mb-0",children:[l("p",{className:"break-all font-medium text-foreground",children:o.path}),u.map(r=>p("div",{"data-search-line":r.line,className:"grid grid-cols-[3.5em_minmax(0,1fr)]",children:[l("span",{"aria-hidden":!0,className:"pe-3 text-end text-muted-foreground tabular-nums select-none",children:r.line}),l("span",{className:"whitespace-pre-wrap break-words text-foreground [overflow-wrap:anywhere]",children:r.text||`
383
- `})]},r.key))]},o.key)})})}function Ze({model:e,context:a}){let{t}=S();return p("div",{className:"space-y-2 px-2 pb-2 text-foreground",children:[e.statusCode!==void 0?l("p",{className:v("tool-meta",e.statusCode>=400&&"text-destructive-foreground"),children:t("httpStatus",{status:e.statusCode})}):null,e.answer?l("p",{className:"tool-process-text line-clamp-3 whitespace-pre-wrap",children:e.answer}):null,e.sources.length===0?l("p",{className:"tool-process-text text-muted-foreground",children:t("noWebSources")}):e.sources.slice(0,8).map(o=>p("div",{"data-web-source":o.url,className:"space-y-0.5",children:[o.title!==e.query?l("p",{className:"tool-process-text font-medium",children:o.title}):null,l(ie,{text:`<${o.url}>`,className:"tool-meta [&_p]:my-0",...a.threadRef===void 0?{}:{threadRef:a.threadRef},...a.workspaceRoot===void 0?{}:{cwd:a.workspaceRoot}}),o.snippet?l("p",{className:"tool-meta line-clamp-3 whitespace-pre-wrap text-muted-foreground",children:o.snippet}):null]},o.key))]})}P({kind:"terminal",heading:e=>p("span",{className:"flex min-w-0 items-center gap-2 text-foreground",children:[l(h,{"aria-hidden":!0,className:"size-4 shrink-0 text-muted-foreground"}),l(F,{text:e.command})]}),body:e=>l("pre",{className:"tool-body cursor-text whitespace-pre-wrap break-words px-2 pb-2 text-foreground select-text [overflow-wrap:anywhere]",children:e.output})});P({kind:"read",hiddenLines:e=>Math.max(0,e.lines.length-16),heading:e=>l(F,{text:e.path}),body:e=>l("div",{className:"tool-body cursor-text pb-2 text-foreground select-text",children:(e.lines.length>16?[...e.lines.slice(0,8),null,...e.lines.slice(-8)]:e.lines).map(a=>a===null?l("div",{"aria-hidden":!0,className:"ps-[3.5em] text-muted-foreground",children:"\u2026"},"gap"):p("div",{"data-source-line":a.number,className:"grid grid-cols-[3.5em_minmax(0,1fr)]",children:[l("span",{"aria-hidden":!0,className:"pe-3 text-end text-muted-foreground select-none tabular-nums",children:a.number}),l("span",{className:"whitespace-pre-wrap break-words pe-2 [overflow-wrap:anywhere]",children:a.text||`
384
- `})]},a.number))})});P({kind:"change",heading:e=>l(F,{text:e.files.map(a=>a.path).join(", ")}),body:e=>l("div",{className:"tool-body cursor-text pb-2 select-text",children:e.files.map(a=>p("div",{children:[e.files.length>1?l("p",{className:"px-2 py-1 text-foreground",children:a.path}):null,a.parts.length>64?l("pre",{className:"whitespace-pre-wrap break-words px-2 text-foreground [overflow-wrap:anywhere]",children:a.patch}):a.parts.map(t=>l("pre",{"data-change-line":t.kind,className:v("whitespace-pre-wrap break-words px-2 [overflow-wrap:anywhere]",t.kind==="removed"?"bg-destructive/5 text-destructive-foreground":t.kind==="added"?"bg-success/5 text-success-foreground":"text-muted-foreground"),children:t.lines.join(`
385
- `)},t.line))]},a.key))})});P({kind:"search",hasMoreResults:e=>e.resultKind==="paths"?e.paths.length>16:e.files.reduce((a,t)=>a+t.matches.length,0)>16,heading:e=>p("span",{className:"flex min-w-0 items-center gap-2",children:[l(D,{"aria-hidden":!0,className:"size-4 shrink-0"}),l(F,{text:e.pattern})]}),body:e=>l($e,{model:e})});P({kind:"web",hasMoreResults:e=>e.sources.length>8,heading:e=>p("span",{className:"flex min-w-0 items-center gap-2",children:[l(A,{"aria-hidden":!0,className:"size-4 shrink-0"}),l(F,{text:e.query})]}),body:(e,a)=>l(Ze,{model:e,context:a})});function Qe({text:e}){return l("pre",{className:"tool-body cursor-text whitespace-pre-wrap break-words px-2 pb-2 text-foreground select-text [overflow-wrap:anywhere]",children:e})}function Le({retain:e}){return H(()=>e(),[e]),null}function xe(e){let{t:a}=S(),t=le(e),o=t?me(t):void 0,u=t&&o?.hiddenLines?o.hiddenLines(t):0,r=t&&o?.hasMoreResults?o.hasMoreResults(t):!1,s=[e.details.input,e.details.output,e.details.raw].filter(n=>n!==void 0),i=t?.copyText??ue(e.details);if(!i&&!t)return null;let f=e.details.files.length>0&&t?.kind!=="change"&&t?.kind!=="search";return p("div",{className:v("ycodium-tool-display-ui",e.scopeClass,"min-w-0 rounded-md bg-background/60"),"data-tool-overview":!0,"data-tool-overview-kind":t?.kind??"generic",children:[p("div",{className:"tool-meta flex min-h-8 items-center gap-2 px-2 text-muted-foreground",children:[l("span",{className:"min-w-0 flex-1",children:t&&o?o.heading(t):null}),e.summary?l("span",{children:a("summary")}):null,s.some(n=>n.truncated)?l("span",{children:a("truncated")}):null,l(ce,{text:i})]}),l(ne,{threadKey:e.threadKey??"unscoped",stateKey:`${e.stateKey??e.entry.id}:overview`,maxHeight:"8lh",className:"tool-body",followTail:e.followOutputTail===!0,...e.onDisclosureChange===void 0?{}:{onDisclosureChange:e.onDisclosureChange},children:t&&o?o.body(t,e):l(Qe,{text:i})}),u||r?l(O,{size:"xs",variant:"ghost-muted",className:"m-1",disabled:e.onShowOutput===void 0,onClick:e.onShowOutput,children:u?a("showMoreLines",{count:u}):a("showAllResults")}):null,f?l("div",{className:"min-w-0 px-2 pb-2",children:l("pre",{className:"tool-body whitespace-pre-wrap break-words text-foreground select-text",children:e.details.files.join(`
386
- `)})}):null]})}function Je(e){if(["Button","Tooltip","TooltipTrigger","TooltipPopup","Markdown","DetailViewport"].some(u=>e.ui[u]===void 0)){let u=function(){let r=e.i18n.usePluginTranslation();return l("p",{role:"status",className:"p-3 text-sm text-muted-foreground",children:r("hostUpgradeRequired")})};var o=u;return{pages:{},panels:{},views:{toolCall:u}}}let t=E(K,"tool-display");return{pages:{},panels:{},views:{toolCall:function(r){return p(Q,{value:e,children:[l(Le,{retain:t.retain}),l(xe,{...r,scopeClass:t.scopeClass})]})}}}}export{Je as default};
381
+ `)}function M(...e){return e.filter(a=>typeof a=="string"&&a.length>0).join(" ")}function T(e){return(a=>S(k().ui[e],{...a,className:`ycodium-tool-display-ui ${typeof a.className=="string"?a.className:""}`}))}var E=T("Button"),se=T("Tooltip"),fe=T("TooltipPopup"),ie=T("TooltipTrigger"),ne=T("Markdown"),ce=T("DetailViewport");function y(){return{t:k().i18n.usePluginTranslation()}}function pe({text:e}){let{t:a}=y(),t=k(),[o,l]=O(null),[u,s]=O(!1),d=o===e;return p("span",{className:"inline-flex items-center gap-1",children:[r(E,{type:"button",variant:"ghost-muted",size:"icon-xs","aria-label":a(d?"copied":"copy"),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&f.stopPropagation()},onClick:()=>{Promise.resolve(t.writeClipboard(e)).then(()=>{l(e),s(!1)},()=>{s(!0),t.notify(a("copyFailed"),"error")})},children:d?r(A,{"aria-hidden":!0,className:"size-icon-1"}):r(D,{"aria-hidden":!0,className:"size-icon-1"})}),u?r("span",{role:"status",className:"tool-meta text-destructive-foreground",children:a("copyFailed")}):null]})}var me=new Map;function b(e){me.set(e.kind,e)}function Le(e){return me.get(e.kind)}function R({text:e}){return p(se,{children:[r(ie,{render:r("code",{className:"min-w-0 truncate text-foreground"}),children:e}),r(fe,{className:"max-w-lg whitespace-pre-wrap break-words",children:e})]})}function Ze({model:e}){let{t:a}=y();if(e.resultKind==="paths")return e.paths.length===0?r("p",{className:"px-2 pb-2 text-muted-foreground",children:a("noSearchResults")}):r("pre",{className:"tool-body whitespace-pre-wrap break-words px-2 pb-2 text-foreground",children:e.paths.slice(0,16).join(`
382
+ `)});let t=16;return r("div",{className:"tool-body px-2 pb-2",children:e.files.length===0?r("p",{className:"text-muted-foreground",children:a("noSearchResults")}):e.files.map(o=>{let l=o.matches.slice(0,t);return t-=l.length,l.length===0?null:p("div",{"data-search-file":o.path,className:"mb-2 last:mb-0",children:[r("p",{className:"break-all font-medium text-foreground",children:o.path}),l.map(u=>p("div",{"data-search-line":u.line,className:"grid grid-cols-[3.5em_minmax(0,1fr)]",children:[r("span",{"aria-hidden":!0,className:"pe-3 text-end text-muted-foreground tabular-nums select-none",children:u.line}),r("span",{className:"whitespace-pre-wrap break-words text-foreground [overflow-wrap:anywhere]",children:u.text||`
383
+ `})]},u.key))]},o.key)})})}function Qe({model:e,context:a}){let{t}=y();return p("div",{className:"space-y-2 px-2 pb-2 text-foreground",children:[e.statusCode!==void 0?r("p",{className:M("tool-meta",e.statusCode>=400&&"text-destructive-foreground"),children:t("httpStatus",{status:e.statusCode})}):null,e.answer?r("p",{className:"tool-process-text line-clamp-3 whitespace-pre-wrap",children:e.answer}):null,e.sources.length===0?r("p",{className:"tool-process-text text-muted-foreground",children:t("noWebSources")}):e.sources.slice(0,8).map(o=>p("div",{"data-web-source":o.url,className:"space-y-0.5",children:[o.title!==e.query?r("p",{className:"tool-process-text font-medium",children:o.title}):null,r(ne,{text:`<${o.url}>`,className:"tool-meta [&_p]:my-0",...a.threadRef===void 0?{}:{threadRef:a.threadRef},...a.workspaceRoot===void 0?{}:{cwd:a.workspaceRoot}}),o.snippet?r("p",{className:"tool-meta line-clamp-3 whitespace-pre-wrap text-muted-foreground",children:o.snippet}):null]},o.key))]})}b({kind:"terminal",heading:e=>p("span",{className:"flex min-w-0 items-center gap-2 text-foreground",children:[r(w,{"aria-hidden":!0,className:"size-4 shrink-0 text-muted-foreground"}),r(R,{text:e.command})]}),body:e=>r("pre",{className:"tool-body cursor-text whitespace-pre-wrap break-words px-2 pb-2 text-foreground select-text [overflow-wrap:anywhere]",children:e.output})});b({kind:"read",hiddenLines:e=>Math.max(0,e.lines.length-16),heading:e=>r(R,{text:e.path}),body:e=>r("div",{className:"tool-body cursor-text pb-2 text-foreground select-text",children:(e.lines.length>16?[...e.lines.slice(0,8),null,...e.lines.slice(-8)]:e.lines).map(a=>a===null?r("div",{"aria-hidden":!0,className:"ps-[3.5em] text-muted-foreground",children:"\u2026"},"gap"):p("div",{"data-source-line":a.number,className:"grid grid-cols-[3.5em_minmax(0,1fr)]",children:[r("span",{"aria-hidden":!0,className:"pe-3 text-end text-muted-foreground select-none tabular-nums",children:a.number}),r("span",{className:"whitespace-pre-wrap break-words pe-2 [overflow-wrap:anywhere]",children:a.text||`
384
+ `})]},a.number))})});b({kind:"change",heading:e=>r(R,{text:e.files.map(a=>a.path).join(", ")}),body:e=>r("div",{className:"tool-body cursor-text pb-2 select-text",children:e.files.map(a=>p("div",{children:[e.files.length>1?r("p",{className:"px-2 py-1 text-foreground",children:a.path}):null,a.parts.length>64?r("pre",{className:"whitespace-pre-wrap break-words px-2 text-foreground [overflow-wrap:anywhere]",children:a.patch}):a.parts.map(t=>r("pre",{"data-change-line":t.kind,className:M("whitespace-pre-wrap break-words px-2 [overflow-wrap:anywhere]",t.kind==="removed"?"bg-destructive/5 text-destructive-foreground":t.kind==="added"?"bg-success/5 text-success-foreground":"text-muted-foreground"),children:t.lines.join(`
385
+ `)},t.line))]},a.key))})});b({kind:"search",hasMoreResults:e=>e.resultKind==="paths"?e.paths.length>16:e.files.reduce((a,t)=>a+t.matches.length,0)>16,heading:e=>p("span",{className:"flex min-w-0 items-center gap-2",children:[r(v,{"aria-hidden":!0,className:"size-4 shrink-0"}),r(R,{text:e.pattern})]}),body:e=>r(Ze,{model:e})});b({kind:"web",hasMoreResults:e=>e.sources.length>8,heading:e=>p("span",{className:"flex min-w-0 items-center gap-2",children:[r(B,{"aria-hidden":!0,className:"size-4 shrink-0"}),r(R,{text:e.query})]}),body:(e,a)=>r(Qe,{model:e,context:a})});function Je({text:e}){return r("pre",{className:"tool-body cursor-text whitespace-pre-wrap break-words px-2 pb-2 text-foreground select-text [overflow-wrap:anywhere]",children:e})}function xe({retain:e}){return N(()=>e(),[e]),null}function Ie(e){let{t:a}=y(),t=ue(e),o=t?Le(t):void 0,l=t&&o?.hiddenLines?o.hiddenLines(t):0,u=t&&o?.hasMoreResults?o.hasMoreResults(t):!1,s=[e.details.input,e.details.output,e.details.raw].filter(c=>c!==void 0),d=t?.copyText??de(e.details);if(!d&&!t)return null;let f=e.details.files.length>0&&t?.kind!=="change"&&t?.kind!=="search";return p("div",{className:M("ycodium-tool-display-ui",e.scopeClass,"min-w-0 rounded-md bg-background/60"),"data-tool-overview":!0,"data-tool-overview-kind":t?.kind??"generic",children:[p("div",{className:"tool-meta flex min-h-8 items-center gap-2 px-2 text-muted-foreground",children:[r("span",{className:"min-w-0 flex-1",children:t&&o?o.heading(t):null}),e.summary?r("span",{children:a("summary")}):null,s.some(c=>c.truncated)?r("span",{children:a("truncated")}):null,r(pe,{text:d})]}),r(ce,{threadKey:e.threadKey??"unscoped",stateKey:`${e.stateKey??e.entry.id}:overview`,maxHeight:"8lh",className:"tool-body",followTail:e.followOutputTail===!0,...e.onDisclosureChange===void 0?{}:{onDisclosureChange:e.onDisclosureChange},children:t&&o?o.body(t,e):r(Je,{text:d})}),l||u?r(E,{size:"xs",variant:"ghost-muted",className:"m-1",disabled:e.onShowOutput===void 0,onClick:e.onShowOutput,children:l?a("showMoreLines",{count:l}):a("showAllResults")}):null,f?r("div",{className:"min-w-0 px-2 pb-2",children:r("pre",{className:"tool-body whitespace-pre-wrap break-words text-foreground select-text",children:e.details.files.join(`
386
+ `)})}):null]})}function je(e){if(["Button","Tooltip","TooltipTrigger","TooltipPopup","Markdown","DetailViewport"].some(l=>e.ui[l]===void 0)){let l=function(){let u=e.i18n.usePluginTranslation();return r("p",{role:"status",className:"p-3 text-sm text-muted-foreground",children:u("hostUpgradeRequired")})};var o=l;return{pages:{},panels:{},views:{toolCall:l}}}let t=G($,"tool-display");return{pages:{},panels:{},views:{toolCall:function(u){return p(j,{value:e,children:[r(xe,{retain:t.retain}),r(Ie,{...u,scopeClass:t.scopeClass})]})}}}}export{je as default};
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { definePlugin } from "@ycodium-ai/plugin-api";
3
3
 
4
4
  // ../../packages/plugin-api/src/version.ts
5
- var PLUGIN_API_VERSION = 201;
5
+ var PLUGIN_API_VERSION = 202;
6
6
 
7
7
  // src/index.ts
8
8
  import { TOOL_DISPLAY_PLUGIN_ID } from "@ycodium-ai/plugin-api/tool-display";
package/dist/models.js CHANGED
@@ -83,7 +83,7 @@ function completed(context) {
83
83
  return context.entry.toolLifecycleStatus === "completed" && !context.entry.displayFailed && (context.details.exitCode === void 0 || context.details.exitCode === 0);
84
84
  }
85
85
  function reportedPath(context, input) {
86
- const value = context.entry.toolLabel?.path ?? input?.file_path;
86
+ const value = context.entry.toolLabel?.path ?? input?.file_path ?? input?.Path ?? input?.filePath ?? input?.target_file ?? input?.path;
87
87
  return typeof value === "string" && value.trim() ? formatWorkspaceRelativePath(value, context.workspaceRoot) : null;
88
88
  }
89
89
  function commandOverviewModel(context) {
@@ -100,7 +100,11 @@ function commandOverviewModel(context) {
100
100
  }
101
101
  function readOverviewModel(context) {
102
102
  const { entry, details } = context;
103
- if (entry.requestKind !== "file-read" && entry.toolTitle !== "Read File") return null;
103
+ const tool = toolName(context);
104
+ const titleId = entry.toolTitle?.toLowerCase().replace(/[ _-]/g, "");
105
+ if (entry.requestKind !== "file-read" && titleId !== "readfile" && tool !== "read" && tool !== "readfile" && tool !== "viewfile") {
106
+ return null;
107
+ }
104
108
  if (entry.displayFailed || details.raw || details.exitCode !== void 0 && details.exitCode !== 0) {
105
109
  return null;
106
110
  }
@@ -158,7 +162,9 @@ ${file.patch}`).join("\n\n")
158
162
  function searchOverviewModel(context) {
159
163
  if (!completed(context)) return null;
160
164
  const tool = toolName(context);
161
- if (tool !== "grep" && tool !== "glob") return null;
165
+ const isGlobLike = tool === "glob" || tool === "findbyname" || tool === "filesearch";
166
+ const isGrepLike = tool === "grep" || tool === "grepsearch" || tool === "ripgrep";
167
+ if (!isGrepLike && !isGlobLike) return null;
162
168
  const output = context.details.output?.text;
163
169
  if (!output) return null;
164
170
  const input = record(parseJson(context.details.input?.text ?? context.entry.toolIo?.input));
@@ -166,8 +172,8 @@ function searchOverviewModel(context) {
166
172
  const result = record(decoded);
167
173
  const jsonShape = output.trimStart().startsWith("{") || output.trimStart().startsWith("[");
168
174
  if (result?.isError === true || typeof result?.error === "string") return null;
169
- const pattern = typeof input?.pattern === "string" ? input.pattern : context.entry.toolLabel?.detail ?? context.entry.label;
170
- if (tool === "glob") {
175
+ const pattern = typeof input?.pattern === "string" ? input.pattern : typeof input?.Pattern === "string" ? input.Pattern : typeof input?.Query === "string" ? input.Query : context.entry.toolLabel?.detail ?? context.entry.label;
176
+ if (isGlobLike) {
171
177
  const structured = result !== null || Array.isArray(decoded);
172
178
  if (!structured && jsonShape) return null;
173
179
  const paths = result ? result.filenames ?? result.paths : Array.isArray(decoded) ? decoded : output.trim().split("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-tool-display",
3
- "version": "0.2.6212",
3
+ "version": "0.2.6253",
4
4
  "description": "Renders command, read, change, search, and web tool calls from recorded facts.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -35,7 +35,7 @@
35
35
  "tailwindcss": "^4.0.0",
36
36
  "typescript": "~6.0.3",
37
37
  "vite-plus": "0.2.2",
38
- "@ycodium-ai/plugin-api": "0.2.6212",
38
+ "@ycodium-ai/plugin-api": "0.2.6253",
39
39
  "ycodium-plugin-testing": "0.0.0"
40
40
  },
41
41
  "ycodium": {