@ycodium-ai/plugin-tool-display 0.2.5557 → 0.2.5751

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,8 +1,14 @@
1
- var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
1
+ var K=`/*! 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 {
5
5
  @scope (.ycodium-tool-display-ui) {
6
+ .fixed:where(:scope, *) {
7
+ position: fixed;
8
+ }
9
+ .static:where(:scope, *) {
10
+ position: static;
11
+ }
6
12
  .m-1:where(:scope, *) {
7
13
  margin: calc(var(--spacing, 0.25rem) * 1);
8
14
  }
@@ -15,19 +21,32 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
15
21
  -webkit-box-orient: vertical;
16
22
  -webkit-line-clamp: 3;
17
23
  }
24
+ .contents:where(:scope, *) {
25
+ display: contents;
26
+ }
18
27
  .flex:where(:scope, *) {
19
28
  display: flex;
20
29
  }
21
30
  .grid:where(:scope, *) {
22
31
  display: grid;
23
32
  }
33
+ .inline:where(:scope, *) {
34
+ display: inline;
35
+ }
24
36
  .inline-flex:where(:scope, *) {
25
37
  display: inline-flex;
26
38
  }
39
+ .inline-grid:where(:scope, *) {
40
+ display: inline-grid;
41
+ }
27
42
  .size-4:where(:scope, *) {
28
43
  width: calc(var(--spacing, 0.25rem) * 4);
29
44
  height: calc(var(--spacing, 0.25rem) * 4);
30
45
  }
46
+ .size-6:where(:scope, *) {
47
+ width: calc(var(--spacing, 0.25rem) * 6);
48
+ height: calc(var(--spacing, 0.25rem) * 6);
49
+ }
31
50
  .size-icon-1:where(:scope, *) {
32
51
  width: var(--control-icon-1);
33
52
  height: var(--control-icon-1);
@@ -35,6 +54,12 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
35
54
  .min-h-8:where(:scope, *) {
36
55
  min-height: calc(var(--spacing, 0.25rem) * 8);
37
56
  }
57
+ .w-fit:where(:scope, *) {
58
+ width: fit-content;
59
+ }
60
+ .w-full:where(:scope, *) {
61
+ width: 100%;
62
+ }
38
63
  .max-w-lg:where(:scope, *) {
39
64
  max-width: var(--container-lg, 32rem);
40
65
  }
@@ -53,12 +78,21 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
53
78
  .grid-cols-\\[3\\.5em_minmax\\(0\\,1fr\\)\\]:where(:scope, *) {
54
79
  grid-template-columns: 3.5em minmax(0,1fr);
55
80
  }
81
+ .grid-cols-\\[4ch_4ch\\]:where(:scope, *) {
82
+ grid-template-columns: 4ch 4ch;
83
+ }
84
+ .flex-wrap:where(:scope, *) {
85
+ flex-wrap: wrap;
86
+ }
56
87
  .items-center:where(:scope, *) {
57
88
  align-items: center;
58
89
  }
59
90
  .gap-1:where(:scope, *) {
60
91
  gap: calc(var(--spacing, 0.25rem) * 1);
61
92
  }
93
+ .gap-1\\.5:where(:scope, *) {
94
+ gap: calc(var(--spacing, 0.25rem) * 1.5);
95
+ }
62
96
  .gap-2:where(:scope, *) {
63
97
  gap: calc(var(--spacing, 0.25rem) * 2);
64
98
  }
@@ -84,6 +118,19 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
84
118
  .rounded-md:where(:scope, *) {
85
119
  border-radius: calc(var(--radius) - 2px);
86
120
  }
121
+ .rounded-sm:where(:scope, *) {
122
+ border-radius: calc(var(--radius) - 4px);
123
+ }
124
+ .border:where(:scope, *) {
125
+ border-style: var(--tw-border-style);
126
+ border-width: 1px;
127
+ }
128
+ .border-border\\/70:where(:scope, *) {
129
+ border-color: var(--contrast-border);
130
+ @supports (color: color-mix(in lab, red, red)) {
131
+ border-color: color-mix(in oklab, var(--contrast-border) 70%, transparent);
132
+ }
133
+ }
87
134
  .bg-background\\/60:where(:scope, *) {
88
135
  background-color: var(--background);
89
136
  @supports (color: color-mix(in lab, red, red)) {
@@ -96,12 +143,24 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
96
143
  background-color: color-mix(in oklab, var(--destructive) 5%, transparent);
97
144
  }
98
145
  }
146
+ .bg-muted\\/40:where(:scope, *) {
147
+ background-color: var(--muted);
148
+ @supports (color: color-mix(in lab, red, red)) {
149
+ background-color: color-mix(in oklab, var(--muted) 40%, transparent);
150
+ }
151
+ }
99
152
  .bg-success\\/5:where(:scope, *) {
100
153
  background-color: var(--success);
101
154
  @supports (color: color-mix(in lab, red, red)) {
102
155
  background-color: color-mix(in oklab, var(--success) 5%, transparent);
103
156
  }
104
157
  }
158
+ .p-0:where(:scope, *) {
159
+ padding: calc(var(--spacing, 0.25rem) * 0);
160
+ }
161
+ .p-2\\.5:where(:scope, *) {
162
+ padding: calc(var(--spacing, 0.25rem) * 2.5);
163
+ }
105
164
  .p-3:where(:scope, *) {
106
165
  padding: calc(var(--spacing, 0.25rem) * 3);
107
166
  }
@@ -126,14 +185,63 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
126
185
  .text-end:where(:scope, *) {
127
186
  text-align: end;
128
187
  }
188
+ .text-left:where(:scope, *) {
189
+ text-align: left;
190
+ }
191
+ .text-right:where(:scope, *) {
192
+ text-align: right;
193
+ }
194
+ .align-middle:where(:scope, *) {
195
+ vertical-align: middle;
196
+ }
197
+ .font-mono:where(:scope, *) {
198
+ font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
199
+ monospace);
200
+ }
201
+ .text-lg:where(:scope, *) {
202
+ font-size: var(--text-lg, 1.125rem);
203
+ line-height: var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));
204
+ }
129
205
  .text-sm:where(:scope, *) {
130
206
  font-size: var(--text-sm, 0.875rem);
131
207
  line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
132
208
  }
209
+ .text-ui-2xs:where(:scope, *) {
210
+ font-size: var(--ui-text-2xs);
211
+ line-height: var(--tw-leading, var(--ui-leading-2xs));
212
+ }
213
+ .text-ui-sm:where(:scope, *) {
214
+ font-size: var(--ui-text-sm);
215
+ line-height: var(--tw-leading, var(--ui-leading-sm));
216
+ }
217
+ .text-ui-xs:where(:scope, *) {
218
+ font-size: var(--ui-text-xs);
219
+ line-height: var(--tw-leading, var(--ui-leading-xs));
220
+ }
221
+ .text-xs:where(:scope, *) {
222
+ font-size: var(--text-xs, 0.75rem);
223
+ line-height: var(--tw-leading, var(--text-xs--line-height, calc(1 / 0.75)));
224
+ }
225
+ .leading-none:where(:scope, *) {
226
+ --tw-leading: 1;
227
+ line-height: 1;
228
+ }
133
229
  .font-medium:where(:scope, *) {
134
230
  --tw-font-weight: var(--font-weight-medium, 500);
135
231
  font-weight: var(--font-weight-medium, 500);
136
232
  }
233
+ .font-semibold:where(:scope, *) {
234
+ --tw-font-weight: var(--font-weight-semibold, 600);
235
+ font-weight: var(--font-weight-semibold, 600);
236
+ }
237
+ .tracking-\\[0\\.2em\\]:where(:scope, *) {
238
+ --tw-tracking: 0.2em;
239
+ letter-spacing: 0.2em;
240
+ }
241
+ .tracking-wider:where(:scope, *) {
242
+ --tw-tracking: var(--tracking-wider, 0.05em);
243
+ letter-spacing: var(--tracking-wider, 0.05em);
244
+ }
137
245
  .\\[overflow-wrap\\:anywhere\\]:where(:scope, *) {
138
246
  overflow-wrap: anywhere;
139
247
  }
@@ -146,22 +254,56 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
146
254
  .whitespace-pre-wrap:where(:scope, *) {
147
255
  white-space: pre-wrap;
148
256
  }
257
+ .text-\\[var\\(--control-disabled-foreground\\)\\]:where(:scope, *) {
258
+ color: var(--control-disabled-foreground);
259
+ }
149
260
  .text-destructive-foreground:where(:scope, *) {
150
261
  color: var(--destructive-foreground);
151
262
  }
263
+ .text-diff-addition:where(:scope, *) {
264
+ color: var(--diff-addition);
265
+ }
266
+ .text-diff-deletion:where(:scope, *) {
267
+ color: var(--diff-deletion);
268
+ }
152
269
  .text-foreground:where(:scope, *) {
153
270
  color: var(--contrast-foreground);
154
271
  }
272
+ .text-icon-muted:where(:scope, *) {
273
+ color: var(--contrast-icon-muted);
274
+ }
155
275
  .text-muted-foreground:where(:scope, *) {
156
276
  color: var(--contrast-muted-foreground);
157
277
  }
278
+ .text-muted-foreground\\/70:where(:scope, *) {
279
+ color: var(--contrast-muted-foreground);
280
+ @supports (color: color-mix(in lab, red, red)) {
281
+ color: color-mix(in oklab, var(--contrast-muted-foreground) 70%, transparent);
282
+ }
283
+ }
284
+ .text-primary:where(:scope, *) {
285
+ color: var(--primary);
286
+ }
158
287
  .text-success-foreground:where(:scope, *) {
159
288
  color: var(--success-foreground);
160
289
  }
290
+ .uppercase:where(:scope, *) {
291
+ text-transform: uppercase;
292
+ }
161
293
  .tabular-nums:where(:scope, *) {
162
294
  --tw-numeric-spacing: tabular-nums;
163
295
  font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
164
296
  }
297
+ .underline:where(:scope, *) {
298
+ text-decoration-line: underline;
299
+ }
300
+ .underline-offset-2:where(:scope, *) {
301
+ text-underline-offset: 2px;
302
+ }
303
+ .outline:where(:scope, *) {
304
+ outline-style: var(--tw-outline-style);
305
+ outline-width: 1px;
306
+ }
165
307
  .select-none:where(:scope, *) {
166
308
  -webkit-user-select: none;
167
309
  user-select: none;
@@ -175,6 +317,13 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
175
317
  margin-bottom: calc(var(--spacing, 0.25rem) * 0);
176
318
  }
177
319
  }
320
+ .hover\\:text-foreground:where(:scope, *) {
321
+ &:hover {
322
+ @media (hover: hover) {
323
+ color: var(--contrast-foreground);
324
+ }
325
+ }
326
+ }
178
327
  .\\[\\&_p\\]\\:my-0:where(:scope, *) {
179
328
  & p {
180
329
  margin-block: calc(var(--spacing, 0.25rem) * 0);
@@ -200,31 +349,35 @@ var E=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
200
349
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
201
350
  *, ::before, ::after, ::backdrop {
202
351
  --tw-space-y-reverse: 0;
352
+ --tw-border-style: solid;
353
+ --tw-leading: initial;
203
354
  --tw-font-weight: initial;
355
+ --tw-tracking: initial;
204
356
  --tw-ordinal: initial;
205
357
  --tw-slashed-zero: initial;
206
358
  --tw-numeric-figure: initial;
207
359
  --tw-numeric-spacing: initial;
208
360
  --tw-numeric-fraction: initial;
361
+ --tw-outline-style: solid;
209
362
  }
210
363
  }
211
364
  }
212
- `;var Le=window.__ycodiumPluginHost.react;var{Activity:Ee,Children:Ve,Component:ze,Fragment:Ne,Profiler:Xe,PureComponent:Ke,StrictMode:Ze,Suspense:Qe,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:Je,__COMPILER_RUNTIME:_e,act:$e,cache:je,cacheSignal:Ye,captureOwnerStack:ea,cloneElement:aa,createContext:V,createElement:g,createRef:ta,forwardRef:R,isValidElement:oa,lazy:ua,memo:la,startTransition:da,unstable_useCacheRefresh:ra,use:sa,useActionState:fa,useCallback:ia,useContext:z,useDebugValue:na,useDeferredValue:ca,useEffect:pa,useEffectEvent:ma,useId:La,useImperativeHandle:Ia,useInsertionEffect:N,useLayoutEffect:xa,useMemo:Ca,useOptimistic:ha,useReducer:ga,useRef:Sa,useState:U,useSyncExternalStore:wa,useTransition:ka,version:ya}=Le;var X=V(null),K=X.Provider;function w(){let e=z(X);if(e===null)throw new Error("Tool display UI has not been registered.");return e}function Ie(e){return`__ycodium${e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}Scope`}function xe(e){let a=globalThis,t=Ie(e),o=(a[t]??0)+1;return a[t]=o,`ycodium-${e}-ui-${o}`}function Z(e,a){let t=xe(a),o=e.replaceAll(`.ycodium-${a}-ui`,`.${t}`),l=0,u=null;return{scopeClass:t,retain(){return typeof document>"u"?()=>{}:(l===0&&(u=document.createElement("style"),u.setAttribute("data-ycodium-plugin-css",a),u.textContent=o,document.head.appendChild(u)),l+=1,()=>{l-=1,l===0&&u!==null&&(u.remove(),u=null)})}}}function Ce(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 O(e){return e.replaceAll("\\","/")}function H(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function he(e){return H(O(e.replace(/[\\/]+$/,"")))}function ge(e){return e.slice(e.lastIndexOf("/")+1)}function Se(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function we(e){return e.startsWith("\\\\")||/^[A-Za-z]:([/\\]|$)/.test(H(O(e)))}function P(e,a){let{path:t,line:o,column:l}=Ce(e),u=H(O(t)),f=u;if(a){let i=he(a),s=ge(i),n=we(a)?r=>r.toLowerCase():r=>r,I=n(u),p=n(i);if(I===p)f=s;else if(I.startsWith(`${p}/`))f=`${s}/${u.slice(i.length+1)}`;else if(!Se(u)){let r=u.replace(/^\.\/+/,"").replace(/^\/+/,"");f=I.startsWith(`${n(s)}/`)?u:`${s}/${r}`}}return o?`${f}:${o}${l?`:${l}`:""}`:f}function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function A(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function ke({entry:e,details:a}){let t=a.input?.text??e.toolIo?.input;if(!t)return null;let o=A(t);return C(o)}function J(e){let a=C(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 _(e){return e.entry.toolLifecycleStatus==="completed"&&!e.entry.displayFailed&&(e.details.exitCode===void 0||e.details.exitCode===0)}function ye(e,a){let t=e.entry.toolLabel?.path??a?.file_path;return typeof t=="string"&&t.trim()?P(t,e.workspaceRoot):null}function Pe(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(`
365
+ `;var ge=window.__ycodiumPluginHost.react;var{Activity:Ye,Children:ea,Component:Ce,Fragment:he,Profiler:aa,PureComponent:ta,StrictMode:oa,Suspense:la,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ra,__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,l=null;return{scopeClass:t,retain(){if(typeof document>"u")return()=>{};u===0&&(l=document.createElement("style"),l.setAttribute("data-ycodium-plugin-css",a),l.textContent=o,document.head.appendChild(l)),u+=1;let s=!1;return()=>{s||(s=!0,u=Math.max(0,u-1),u===0&&l!==null&&(l.remove(),l=null))}}}}var{jsx:r,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:l,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),...!l&&!ee(i)&&{"aria-hidden":"true"},...i},[...s.map(([n,x])=>C(n,x)),...Array.isArray(l)?l:[l]]));var I=(e,a)=>{let t=R(({className:o,...u},l)=>C(ae,{ref:l,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),l=z(V(t)),s=l;if(a){let i=Ue(a),f=Oe(i),n=Ee(a)?d=>d.toLowerCase():d=>d,x=n(l),m=n(i);if(x===m)s=f;else if(x.startsWith(`${m}/`))s=`${f}/${l.slice(i.length+1)}`;else if(!He(l)){let d=l.replace(/^\.\/+/,"").replace(/^\/+/,"");s=x.startsWith(`${n(f)}/`)?l:`${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 le(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(`
213
366
 
214
- `)}}function Ae(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=ye(e,ke(e)),l=t.output?.text;if(!o||!l)return null;let u=[];for(let f of(l.endsWith(`
215
- `)?l.slice(0,-1):l).split(`
216
- `)){let i=/^\s*(\d+)→(.*)$/u.exec(f);if(!i)return null;let s=Number(i[1]);if(!Number.isSafeInteger(s)||s<1)return null;let n=u.at(-1);if(n&&s<=n.number)return null;u.push({number:s,text:i[2]})}return{kind:"read",path:o,lines:u,copyText:u.map(f=>f.text).join(`
217
- `)}}function De(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[f,i]of l.entries()){if(typeof i!="object"||i===null||Array.isArray(i))return null;let{path:s,diff:n}=i;if(typeof s!="string"||!s.trim()||typeof n!="string"||!n)return null;let I=[],p=n.split(`
218
- `);for(let[r,c]of p.entries()){let m=c.startsWith("+++")||c.startsWith("---")?"context":c.startsWith("+")?"added":c.startsWith("-")?"removed":"context",W=I.at(-1);W?.kind===m?W.lines.push(c):I.push({line:r,kind:m,lines:[c]})}u.push({key:`${s}:${f}`,path:P(s,e.workspaceRoot),patch:n,parts:I})}return{kind:"change",files:u,copyText:u.map(f=>`${f.path}
219
- ${f.patch}`).join(`
367
+ `)}}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 l=[];for(let s of(u.endsWith(`
368
+ `)?u.slice(0,-1):u).split(`
369
+ `)){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=l.at(-1);if(n&&f<=n.number)return null;l.push({number:f,text:i[2]})}return{kind:"read",path:o,lines:l,copyText:l.map(s=>s.text).join(`
370
+ `)}}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 l=[];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(`
371
+ `);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]})}l.push({key:`${f}:${s}`,path:y(f,e.workspaceRoot),patch:n,parts:x})}return{kind:"change",files:l,copyText:l.map(s=>`${s.path}
372
+ ${s.patch}`).join(`
220
373
 
221
- `)}}function Be(e){if(!_(e))return null;let a=J(e);if(a!=="grep"&&a!=="glob")return null;let t=e.details.output?.text;if(!t)return null;let o=C(A(e.details.input?.text??e.entry.toolIo?.input)),l=A(t),u=C(l),f=t.trimStart().startsWith("{")||t.trimStart().startsWith("[");if(u?.isError===!0||typeof u?.error=="string")return null;let i=typeof o?.pattern=="string"?o.pattern:e.entry.toolLabel?.detail??e.entry.label;if(a==="glob"){let p=u!==null||Array.isArray(l);if(!p&&f)return null;let r=u?u.filenames??u.paths:Array.isArray(l)?l:t.trim().split(`
222
- `);return!Array.isArray(r)||!r.every(c=>typeof c=="string"&&c.length>0)||!p&&!r.every(c=>/[/\\]|\.[a-z0-9]{1,12}$/i.test(c))?null:{kind:"search",resultKind:"paths",pattern:i,paths:r.map(c=>P(c,e.workspaceRoot)),copyText:t}}let s=typeof u?.content=="string"?u.content:t;if(u&&!Array.isArray(u.files)&&typeof u.content!="string"||!u&&f)return null;let n=new Map,I=(p,r,c)=>{let m=n.get(p)??[];m.push({line:r,text:c,key:`${r}:${m.length}`}),n.set(p,m)};if(Array.isArray(u?.files))for(let p of u.files){let r=C(p);if(typeof r?.path!="string"||!r.path||!Array.isArray(r.matches))return null;for(let c of r.matches){let m=C(c);if(typeof m?.lineNumber!="number"||!Number.isSafeInteger(m.lineNumber)||m.lineNumber<1||typeof m?.line!="string")return null;I(r.path,m.lineNumber,m.line)}}else for(let p of s.trimEnd().split(`
223
- `)){let r=/^(.+?):([1-9]\d*):(.*)$/u.exec(p);if(!r||!Number.isSafeInteger(Number(r[2])))return null;I(r[1],Number(r[2]),r[3])}return{kind:"search",resultKind:"matches",pattern:i,files:[...n].map(([p,r])=>({key:p,path:P(p,e.workspaceRoot),matches:r})),copyText:t}}function Q(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 Te(e){if(!_(e))return null;let a=J(e);if(e.entry.itemType!=="web_search"&&a!=="websearch"&&a!=="webfetch"||a==="grep"||a==="glob")return null;let t=e.details.output?.text,o=A(t);if(!t)return null;let l=C(o);if(l?.isError===!0||typeof l?.error=="string")return null;let u=l?.sources??l?.results??(Array.isArray(o)?o:void 0),f=C(A(e.details.input?.text??e.entry.toolIo?.input)),i=typeof f?.query=="string"?f.query:e.entry.toolLabel?.detail??e.entry.label;if(Array.isArray(u)){let p=[];for(let r of u){let c=C(r),m=Q(c?.url);if(!m||c?.title!==void 0&&typeof c.title!="string"||c?.snippet!==void 0&&typeof c.snippet!="string")return null;p.push({key:`${m}:${p.length}`,url:m,title:typeof c?.title=="string"?c.title:m,...typeof c?.snippet=="string"?{snippet:c.snippet}:{}})}return l?.answer!==void 0&&typeof l.answer!="string"?null:{kind:"web",query:i,sources:p,copyText:t,...typeof l?.answer=="string"?{answer:l.answer}:{}}}let s=Q(l?.url),n=l?.statusCode;if(!s||typeof n!="number"||!Number.isInteger(n)||n<100||n>599)return null;let I=typeof l?.title=="string"?l.title:s;return{kind:"web",query:I,sources:[{key:s,url:s,title:I}],copyText:t,statusCode:n,...typeof l?.text=="string"?{answer:l.text}:{}}}var Fe=[Pe,Ae,De,Be,Te];function $(e){for(let a of Fe){let t=a(e);if(t)return t}return null}function j(e){return[e.input,e.output,e.raw].filter(a=>a!==void 0).map(a=>a.text).join(`
374
+ `)}}function Xe(e){if(!le(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),l=g(u),s=t.trimStart().startsWith("{")||t.trimStart().startsWith("[");if(l?.isError===!0||typeof l?.error=="string")return null;let i=typeof o?.pattern=="string"?o.pattern:e.entry.toolLabel?.detail??e.entry.label;if(a==="glob"){let m=l!==null||Array.isArray(u);if(!m&&s)return null;let d=l?l.filenames??l.paths:Array.isArray(u)?u:t.trim().split(`
375
+ `);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 l?.content=="string"?l.content:t;if(l&&!Array.isArray(l.files)&&typeof l.content!="string"||!l&&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(l?.files))for(let m of l.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(`
376
+ `)){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(!le(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 l=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(l)){let m=[];for(let d of l){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 re(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(`
224
377
 
225
- `)}function D(...e){return e.filter(a=>typeof a=="string"&&a.length>0).join(" ")}var v=(...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 G=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=R(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:f,...i},s)=>g("svg",{ref:s,...ae,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:v("lucide",l),...!u&&!te(i)&&{"aria-hidden":"true"},...i},[...f.map(([n,I])=>g(n,I)),...Array.isArray(u)?u:[u]]));var x=(e,a)=>{let t=R(({className:o,...l},u)=>g(oe,{ref:u,iconNode:a,className:v(`lucide-${Y(G(e))}`,`lucide-${e}`,o),...l}));return t.displayName=G(e),t};var Me=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],B=x("check",Me);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"}]],T=x("copy",be);var Re=[["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"}]],F=x("globe",Re);var ve=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],M=x("search",ve);var qe=[["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=x("square-terminal",qe);function k(e){return(a=>g(w().ui[e],{...a,className:`ycodium-tool-display-ui ${typeof a.className=="string"?a.className:""}`}))}var q=k("Button"),ue=k("Tooltip"),le=k("TooltipPopup"),de=k("TooltipTrigger"),re=k("Markdown"),se=k("DetailViewport");function S(){return{t:w().i18n.usePluginTranslation()}}var{jsx:d,jsxs:L,Fragment:Ct}=window.__ycodiumPluginHost.jsxRuntime;function fe({text:e}){let{t:a}=S(),t=w(),[o,l]=U(null),[u,f]=U(!1),i=o===e;return L("span",{className:"inline-flex items-center gap-1",children:[d(q,{type:"button",variant:"ghost-muted",size:"icon-xs","aria-label":a(i?"copied":"copy"),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&s.stopPropagation()},onClick:()=>{Promise.resolve(t.writeClipboard(e)).then(()=>{l(e),f(!1)},()=>{f(!0),t.notify(a("copyFailed"),"error")})},children:i?d(B,{"aria-hidden":!0,className:"size-icon-1"}):d(T,{"aria-hidden":!0,className:"size-icon-1"})}),u?d("span",{role:"status",className:"tool-meta text-destructive-foreground",children:a("copyFailed")}):null]})}var ie=new Map;function y(e){ie.set(e.kind,e)}function ne(e){return ie.get(e.kind)}function b({text:e}){return L(ue,{children:[d(de,{render:d("code",{className:"min-w-0 truncate text-foreground"}),children:e}),d(le,{className:"max-w-lg whitespace-pre-wrap break-words",children:e})]})}function Ue({model:e}){let{t:a}=S();if(e.resultKind==="paths")return e.paths.length===0?d("p",{className:"px-2 pb-2 text-muted-foreground",children:a("noSearchResults")}):d("pre",{className:"tool-body whitespace-pre-wrap break-words px-2 pb-2 text-foreground",children:e.paths.slice(0,16).join(`
226
- `)});let t=16;return d("div",{className:"tool-body px-2 pb-2",children:e.files.length===0?d("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:L("div",{"data-search-file":o.path,className:"mb-2 last:mb-0",children:[d("p",{className:"break-all font-medium text-foreground",children:o.path}),l.map(u=>L("div",{"data-search-line":u.line,className:"grid grid-cols-[3.5em_minmax(0,1fr)]",children:[d("span",{"aria-hidden":!0,className:"pe-3 text-end text-muted-foreground tabular-nums select-none",children:u.line}),d("span",{className:"whitespace-pre-wrap break-words text-foreground [overflow-wrap:anywhere]",children:u.text||`
227
- `})]},u.key))]},o.key)})})}function Oe({model:e,context:a}){let{t}=S();return L("div",{className:"space-y-2 px-2 pb-2 text-foreground",children:[e.statusCode!==void 0?d("p",{className:D("tool-meta",e.statusCode>=400&&"text-destructive-foreground"),children:t("httpStatus",{status:e.statusCode})}):null,e.answer?d("p",{className:"tool-process-text line-clamp-3 whitespace-pre-wrap",children:e.answer}):null,e.sources.length===0?d("p",{className:"tool-process-text text-muted-foreground",children:t("noWebSources")}):e.sources.slice(0,8).map(o=>L("div",{"data-web-source":o.url,className:"space-y-0.5",children:[o.title!==e.query?d("p",{className:"tool-process-text font-medium",children:o.title}):null,d(re,{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?d("p",{className:"tool-meta line-clamp-3 whitespace-pre-wrap text-muted-foreground",children:o.snippet}):null]},o.key))]})}y({kind:"terminal",heading:e=>L("span",{className:"flex min-w-0 items-center gap-2 text-foreground",children:[d(h,{"aria-hidden":!0,className:"size-4 shrink-0 text-muted-foreground"}),d(b,{text:e.command})]}),body:e=>d("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})});y({kind:"read",hiddenLines:e=>Math.max(0,e.lines.length-16),heading:e=>d(b,{text:e.path}),body:e=>d("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?d("div",{"aria-hidden":!0,className:"ps-[3.5em] text-muted-foreground",children:"\u2026"},"gap"):L("div",{"data-source-line":a.number,className:"grid grid-cols-[3.5em_minmax(0,1fr)]",children:[d("span",{"aria-hidden":!0,className:"pe-3 text-end text-muted-foreground select-none tabular-nums",children:a.number}),d("span",{className:"whitespace-pre-wrap break-words pe-2 [overflow-wrap:anywhere]",children:a.text||`
228
- `})]},a.number))})});y({kind:"change",heading:e=>d(b,{text:e.files.map(a=>a.path).join(", ")}),body:e=>d("div",{className:"tool-body cursor-text pb-2 select-text",children:e.files.map(a=>L("div",{children:[e.files.length>1?d("p",{className:"px-2 py-1 text-foreground",children:a.path}):null,a.parts.length>64?d("pre",{className:"whitespace-pre-wrap break-words px-2 text-foreground [overflow-wrap:anywhere]",children:a.patch}):a.parts.map(t=>d("pre",{"data-change-line":t.kind,className:D("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(`
229
- `)},t.line))]},a.key))})});y({kind:"search",hasMoreResults:e=>e.resultKind==="paths"?e.paths.length>16:e.files.reduce((a,t)=>a+t.matches.length,0)>16,heading:e=>L("span",{className:"flex min-w-0 items-center gap-2",children:[d(M,{"aria-hidden":!0,className:"size-4 shrink-0"}),d(b,{text:e.pattern})]}),body:e=>d(Ue,{model:e})});y({kind:"web",hasMoreResults:e=>e.sources.length>8,heading:e=>L("span",{className:"flex min-w-0 items-center gap-2",children:[d(F,{"aria-hidden":!0,className:"size-4 shrink-0"}),d(b,{text:e.query})]}),body:(e,a)=>d(Oe,{model:e,context:a})});function He({text:e}){return d("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 ce({retain:e}){return N(()=>e(),[e]),null}function pe(e){let{t:a}=S(),t=$(e),o=t?ne(t):void 0,l=t&&o?.hiddenLines?o.hiddenLines(t):0,u=t&&o?.hasMoreResults?o.hasMoreResults(t):!1,f=[e.details.input,e.details.output,e.details.raw].filter(n=>n!==void 0),i=t?.copyText??j(e.details);if(!i&&!t)return null;let s=e.details.files.length>0&&t?.kind!=="change"&&t?.kind!=="search";return L("div",{className:D("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:[L("div",{className:"tool-meta flex min-h-8 items-center gap-2 px-2 text-muted-foreground",children:[d("span",{className:"min-w-0 flex-1",children:t&&o?o.heading(t):null}),e.summary?d("span",{children:a("summary")}):null,f.some(n=>n.truncated)?d("span",{children:a("truncated")}):null,d(fe,{text:i})]}),d(se,{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):d(He,{text:i})}),l||u?d(q,{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,s?d("div",{className:"min-w-0 px-2 pb-2",children:d("pre",{className:"tool-body whitespace-pre-wrap break-words text-foreground select-text",children:e.details.files.join(`
230
- `)})}):null]})}function Ge(e){if(["Button","Tooltip","TooltipTrigger","TooltipPopup","Markdown","DetailViewport"].some(l=>e.ui[l]===void 0)){let l=function(){let u=e.i18n.usePluginTranslation();return d("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=Z(E,"tool-display");return{pages:{},panels:{},views:{toolCall:function(u){return L(K,{value:e,children:[d(ce,{retain:t.retain}),d(pe,{...u,scopeClass:t.scopeClass})]})}}}}export{Ge as default};
378
+ `)}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),[l,s]=q(!1),i=o===e;return p("span",{className:"inline-flex items-center gap-1",children:[r(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?r(T,{"aria-hidden":!0,className:"size-icon-1"}):r(b,{"aria-hidden":!0,className:"size-icon-1"})}),l?r("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:[r(fe,{render:r("code",{className:"min-w-0 truncate text-foreground"}),children:e}),r(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?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(`
379
+ `)});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 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:[r("p",{className:"break-all font-medium text-foreground",children:o.path}),u.map(l=>p("div",{"data-search-line":l.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:l.line}),r("span",{className:"whitespace-pre-wrap break-words text-foreground [overflow-wrap:anywhere]",children:l.text||`
380
+ `})]},l.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?r("p",{className:v("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(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?r("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:[r(h,{"aria-hidden":!0,className:"size-4 shrink-0 text-muted-foreground"}),r(F,{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})});P({kind:"read",hiddenLines:e=>Math.max(0,e.lines.length-16),heading:e=>r(F,{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||`
381
+ `})]},a.number))})});P({kind:"change",heading:e=>r(F,{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: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(`
382
+ `)},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:[r(D,{"aria-hidden":!0,className:"size-4 shrink-0"}),r(F,{text:e.pattern})]}),body:e=>r($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:[r(A,{"aria-hidden":!0,className:"size-4 shrink-0"}),r(F,{text:e.query})]}),body:(e,a)=>r(Ze,{model:e,context:a})});function Qe({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 Le({retain:e}){return H(()=>e(),[e]),null}function xe(e){let{t:a}=S(),t=re(e),o=t?me(t):void 0,u=t&&o?.hiddenLines?o.hiddenLines(t):0,l=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:[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(n=>n.truncated)?r("span",{children:a("truncated")}):null,r(ce,{text:i})]}),r(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):r(Qe,{text:i})}),u||l?r(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?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(`
383
+ `)})}):null]})}function Je(e){if(["Button","Tooltip","TooltipTrigger","TooltipPopup","Markdown","DetailViewport"].some(u=>e.ui[u]===void 0)){let u=function(){let l=e.i18n.usePluginTranslation();return r("p",{role:"status",className:"p-3 text-sm text-muted-foreground",children:l("hostUpgradeRequired")})};var o=u;return{pages:{},panels:{},views:{toolCall:u}}}let t=E(K,"tool-display");return{pages:{},panels:{},views:{toolCall:function(l){return p(Q,{value:e,children:[r(Le,{retain:t.retain}),r(xe,{...l,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 = 175;
5
+ var PLUGIN_API_VERSION = 180;
6
6
 
7
7
  // src/index.ts
8
8
  import { TOOL_DISPLAY_PLUGIN_ID } from "@ycodium-ai/plugin-api/tool-display";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-tool-display",
3
- "version": "0.2.5557",
3
+ "version": "0.2.5751",
4
4
  "description": "Renders command, read, change, search, and web tool calls from recorded facts.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -35,10 +35,8 @@
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.5557",
39
- "ycodium-plugin-testing": "0.0.0",
40
- "ycodium-workspace-path": "0.0.0",
41
- "ycodium-ui-hooks": "0.0.0"
38
+ "@ycodium-ai/plugin-api": "0.2.5751",
39
+ "ycodium-plugin-testing": "0.0.0"
42
40
  },
43
41
  "ycodium": {
44
42
  "plugin": "./dist/index.js",