@tangle-network/agent-app 3.0.10 → 3.0.12

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.
Files changed (29) hide show
  1. package/dist/assistant/index.js +7 -7
  2. package/dist/chat-react/index.js +4 -4
  3. package/dist/{chunk-N7IBDET7.js → chunk-ENK2VT7O.js} +68 -75
  4. package/dist/{chunk-N7IBDET7.js.map → chunk-ENK2VT7O.js.map} +1 -1
  5. package/dist/{chunk-NQT4IPUF.js → chunk-KIU3X2UF.js} +3 -3
  6. package/dist/{chunk-JBTUNGXV.js → chunk-KV63GEO7.js} +4 -4
  7. package/dist/{chunk-T4YYINOM.js → chunk-OJKMW2CB.js} +3 -3
  8. package/dist/{chunk-3NMXB62K.js → chunk-S2UGXHHZ.js} +129 -119
  9. package/dist/chunk-S2UGXHHZ.js.map +1 -0
  10. package/dist/{chunk-7PZBBYNU.js → chunk-TKEC2UL4.js} +2 -2
  11. package/dist/{chunk-BX3MAXJI.js → chunk-W6NLRGZT.js} +3 -3
  12. package/dist/{mention-editor-WQYVWDOB.js → mention-editor-BGUVPI75.js} +2 -2
  13. package/dist/settings-react/index.js +1 -1
  14. package/dist/studio-react/index.js +1 -1
  15. package/dist/web-react/agent-profile-editor.js +4 -4
  16. package/dist/web-react/agent-session-controls.d.ts +35 -16
  17. package/dist/web-react/controls.d.ts +1 -1
  18. package/dist/web-react/index.d.ts +2 -2
  19. package/dist/web-react/index.js +11 -7
  20. package/dist/web-react/picker-presentation.d.ts +15 -4
  21. package/dist/workspace-react/index.js +3 -3
  22. package/package.json +1 -1
  23. package/dist/chunk-3NMXB62K.js.map +0 -1
  24. /package/dist/{chunk-NQT4IPUF.js.map → chunk-KIU3X2UF.js.map} +0 -0
  25. /package/dist/{chunk-JBTUNGXV.js.map → chunk-KV63GEO7.js.map} +0 -0
  26. /package/dist/{chunk-T4YYINOM.js.map → chunk-OJKMW2CB.js.map} +0 -0
  27. /package/dist/{chunk-7PZBBYNU.js.map → chunk-TKEC2UL4.js.map} +0 -0
  28. /package/dist/{chunk-BX3MAXJI.js.map → chunk-W6NLRGZT.js.map} +0 -0
  29. /package/dist/{mention-editor-WQYVWDOB.js.map → mention-editor-BGUVPI75.js.map} +0 -0
@@ -149,8 +149,43 @@ function PopoverSurface({
149
149
  );
150
150
  }
151
151
 
152
- // src/web-react/picker-presentation.ts
152
+ // src/web-react/picker-presentation.tsx
153
+ import { forwardRef } from "react";
154
+ import { Chip } from "@tangle-network/ui/primitives";
155
+
156
+ // src/web-react/control-glyphs.tsx
157
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
158
+ function ChevronDown({ className }) {
159
+ return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "m6 9 6 6 6-6" }) });
160
+ }
161
+ function SearchGlyph({ className }) {
162
+ return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
163
+ /* @__PURE__ */ jsx2("circle", { cx: "11", cy: "11", r: "8" }),
164
+ /* @__PURE__ */ jsx2("path", { d: "m21 21-4.3-4.3" })
165
+ ] });
166
+ }
167
+ function SparkleGlyph({ className }) {
168
+ return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1m0-12.8-2.1 2.1M7.7 16.3l-2.1 2.1" }) });
169
+ }
170
+ function BrainGlyph({ className }) {
171
+ return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
172
+ /* @__PURE__ */ jsx2("path", { d: "M12 18V5" }),
173
+ /* @__PURE__ */ jsx2("path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" }),
174
+ /* @__PURE__ */ jsx2("path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" }),
175
+ /* @__PURE__ */ jsx2("path", { d: "M17.997 5.125a4 4 0 0 1 2.526 5.77" }),
176
+ /* @__PURE__ */ jsx2("path", { d: "M18 18a4 4 0 0 0 2-7.464" }),
177
+ /* @__PURE__ */ jsx2("path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" }),
178
+ /* @__PURE__ */ jsx2("path", { d: "M6 18a4 4 0 0 1-2-7.464" }),
179
+ /* @__PURE__ */ jsx2("path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77" })
180
+ ] });
181
+ }
182
+ function CheckGlyph({ className }) {
183
+ return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "M20 6 9 17l-5-5" }) });
184
+ }
185
+
186
+ // src/web-react/picker-presentation.tsx
153
187
  import { fieldPresentation, fieldSizes, fieldTouchText } from "@tangle-network/ui/presentation";
188
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
154
189
  var POPOVER_OPTION_FOCUS = "focus-visible:[outline-offset:-2px]";
155
190
  var OVERLAY_SHADOW = "shadow-[var(--shadow-overlay)]";
156
191
  function pickerRootClass(fullWidth) {
@@ -159,7 +194,15 @@ function pickerRootClass(fullWidth) {
159
194
  function fieldPickerTriggerClass({ interactive = true } = {}) {
160
195
  return `${fieldPresentation} ${fieldSizes.md} ${fieldTouchText} inline-flex w-full min-w-0 items-center justify-between gap-2 whitespace-nowrap border text-left font-normal text-foreground disabled:cursor-not-allowed disabled:opacity-50 ${interactive ? "data-[state=open]:border-[var(--ix-hover-border)] data-[state=open]:shadow-[var(--ix-after)]" : "cursor-default"}`;
161
196
  }
162
- var CHIP_PICKER_TRIGGER = "inline-flex h-[var(--control-height-sm,2rem)] items-center gap-1.5 whitespace-nowrap rounded-full border border-border bg-card px-3 text-sm font-medium text-foreground transition";
197
+ var PickerTrigger = forwardRef(
198
+ ({ variant = "chip", icon, trailing = /* @__PURE__ */ jsx3(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }), children, className, ...props }, ref) => variant === "chip" ? /* @__PURE__ */ jsxs2(Chip, { ref, size: "md", emphasis: "outline", icon, className: `[&>span:last-child]:inline-flex [&>span:last-child]:flex-1 [&>span:last-child]:items-center [&>span:last-child]:justify-between [&>span:last-child]:gap-1.5 ${className ?? ""}`, ...props, children: [
199
+ children,
200
+ trailing
201
+ ] }) : /* @__PURE__ */ jsxs2("button", { ref, type: "button", className, ...props, children: [
202
+ children,
203
+ trailing
204
+ ] })
205
+ );
163
206
  var QUIET_PICKER_TRIGGER_BASE = "inline-flex h-[var(--control-height-sm,2rem)] shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-transparent px-2 text-sm font-normal text-muted-foreground transition focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";
164
207
  var QUIET_PICKER_TRIGGER_INTERACTIVE = "hover:bg-accent hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground";
165
208
  function quietPickerTriggerClass({ interactive = true } = {}) {
@@ -200,39 +243,7 @@ function usePending() {
200
243
  // src/web-react/model-picker.tsx
201
244
  import { useCallback as useCallback2, useEffect as useEffect3, useId as useId2, useMemo, useRef as useRef3, useState as useState3 } from "react";
202
245
  import { StatusPill } from "@tangle-network/ui/primitives";
203
-
204
- // src/web-react/control-glyphs.tsx
205
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
206
- function ChevronDown({ className }) {
207
- return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "m6 9 6 6 6-6" }) });
208
- }
209
- function SearchGlyph({ className }) {
210
- return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
211
- /* @__PURE__ */ jsx2("circle", { cx: "11", cy: "11", r: "8" }),
212
- /* @__PURE__ */ jsx2("path", { d: "m21 21-4.3-4.3" })
213
- ] });
214
- }
215
- function SparkleGlyph({ className }) {
216
- return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1m0-12.8-2.1 2.1M7.7 16.3l-2.1 2.1" }) });
217
- }
218
- function BrainGlyph({ className }) {
219
- return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
220
- /* @__PURE__ */ jsx2("path", { d: "M12 18V5" }),
221
- /* @__PURE__ */ jsx2("path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" }),
222
- /* @__PURE__ */ jsx2("path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" }),
223
- /* @__PURE__ */ jsx2("path", { d: "M17.997 5.125a4 4 0 0 1 2.526 5.77" }),
224
- /* @__PURE__ */ jsx2("path", { d: "M18 18a4 4 0 0 0 2-7.464" }),
225
- /* @__PURE__ */ jsx2("path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" }),
226
- /* @__PURE__ */ jsx2("path", { d: "M6 18a4 4 0 0 1-2-7.464" }),
227
- /* @__PURE__ */ jsx2("path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77" })
228
- ] });
229
- }
230
- function CheckGlyph({ className }) {
231
- return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "M20 6 9 17l-5-5" }) });
232
- }
233
-
234
- // src/web-react/model-picker.tsx
235
- import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
246
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
236
247
  function formatPrice(p) {
237
248
  if (!p) return void 0;
238
249
  const n = Number(p);
@@ -264,15 +275,15 @@ function formatContext(len) {
264
275
  function ModelMarks({ model, size, renderProviderBadge }) {
265
276
  const brand = model.maker?.trim() || model.provider;
266
277
  const host = model.servedBy?.trim();
267
- const primary = renderProviderBadge ? renderProviderBadge(brand) : /* @__PURE__ */ jsx3(ProviderLogo, { provider: brand, size });
278
+ const primary = renderProviderBadge ? renderProviderBadge(brand) : /* @__PURE__ */ jsx4(ProviderLogo, { provider: brand, size });
268
279
  if (!host || host.toLowerCase() === brand.toLowerCase()) return primary;
269
- return /* @__PURE__ */ jsxs2("span", { className: "inline-flex items-center gap-0.5", children: [
280
+ return /* @__PURE__ */ jsxs3("span", { className: "inline-flex items-center gap-0.5", children: [
270
281
  primary,
271
- /* @__PURE__ */ jsx3(ProviderLogo, { provider: host, size })
282
+ /* @__PURE__ */ jsx4(ProviderLogo, { provider: host, size })
272
283
  ] });
273
284
  }
274
285
  function SectionHeader({ children }) {
275
- return /* @__PURE__ */ jsx3("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children });
286
+ return /* @__PURE__ */ jsx4("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children });
276
287
  }
277
288
  function ModelRow({
278
289
  model,
@@ -287,7 +298,7 @@ function ModelRow({
287
298
  const unavailable = model.status === "unavailable";
288
299
  const flagged = unavailable || model.status === "limited";
289
300
  const capability = model.capability ?? (flagged ? model.statusReason : void 0);
290
- return /* @__PURE__ */ jsxs2(
301
+ return /* @__PURE__ */ jsxs3(
291
302
  "button",
292
303
  {
293
304
  type: "button",
@@ -298,7 +309,7 @@ function ModelRow({
298
309
  children: [
299
310
  thumb ? (
300
311
  // A media model shows what it makes: a 40px example beside its name.
301
- /* @__PURE__ */ jsx3(
312
+ /* @__PURE__ */ jsx4(
302
313
  "img",
303
314
  {
304
315
  src: thumb,
@@ -309,21 +320,21 @@ function ModelRow({
309
320
  className: `size-10 shrink-0 rounded-md border border-border object-cover${unavailable ? " opacity-50" : ""}`
310
321
  }
311
322
  )
312
- ) : /* @__PURE__ */ jsx3("span", { className: "shrink-0", "aria-hidden": true, children: /* @__PURE__ */ jsx3(ModelMarks, { model, size: 16, renderProviderBadge }) }),
313
- /* @__PURE__ */ jsxs2("span", { className: "min-w-0 flex-1", children: [
314
- /* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-center gap-1.5", children: [
315
- thumb && /* @__PURE__ */ jsx3("span", { className: "shrink-0", "aria-hidden": true, children: /* @__PURE__ */ jsx3(ModelMarks, { model, size: 14, renderProviderBadge }) }),
316
- /* @__PURE__ */ jsx3("span", { className: `min-w-0 break-words [overflow-wrap:anywhere]${unavailable ? " text-muted-foreground" : ""}`, children: model.name }),
317
- flagged && /* @__PURE__ */ jsx3(StatusPill, { tone: "warning", size: "sm", className: "shrink-0", title: model.statusReason, "data-model-status": model.status, children: unavailable ? "Unavailable" : "Limited" })
323
+ ) : /* @__PURE__ */ jsx4("span", { className: "shrink-0", "aria-hidden": true, children: /* @__PURE__ */ jsx4(ModelMarks, { model, size: 16, renderProviderBadge }) }),
324
+ /* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
325
+ /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-center gap-1.5", children: [
326
+ thumb && /* @__PURE__ */ jsx4("span", { className: "shrink-0", "aria-hidden": true, children: /* @__PURE__ */ jsx4(ModelMarks, { model, size: 14, renderProviderBadge }) }),
327
+ /* @__PURE__ */ jsx4("span", { className: `min-w-0 break-words [overflow-wrap:anywhere]${unavailable ? " text-muted-foreground" : ""}`, children: model.name }),
328
+ flagged && /* @__PURE__ */ jsx4(StatusPill, { tone: "warning", size: "sm", className: "shrink-0", title: model.statusReason, "data-model-status": model.status, children: unavailable ? "Unavailable" : "Limited" })
318
329
  ] }),
319
- capability && /* @__PURE__ */ jsx3("span", { className: "mt-0.5 block truncate text-xs font-normal text-muted-foreground", "data-model-capability": true, children: capability }),
320
- (ctx || price || !media && !model.supportsTools) && /* @__PURE__ */ jsxs2("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs font-normal text-muted-foreground", children: [
321
- !media && !model.supportsTools && /* @__PURE__ */ jsx3("span", { className: "rounded bg-secondary px-1.5 py-0.5", children: "no tools" }),
322
- !media && ctx && /* @__PURE__ */ jsx3("span", { children: ctx }),
323
- price && /* @__PURE__ */ jsx3("span", { "data-model-price": true, children: price })
330
+ capability && /* @__PURE__ */ jsx4("span", { className: "mt-0.5 block truncate text-xs font-normal text-muted-foreground", "data-model-capability": true, children: capability }),
331
+ (ctx || price || !media && !model.supportsTools) && /* @__PURE__ */ jsxs3("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs font-normal text-muted-foreground", children: [
332
+ !media && !model.supportsTools && /* @__PURE__ */ jsx4("span", { className: "rounded bg-secondary px-1.5 py-0.5", children: "no tools" }),
333
+ !media && ctx && /* @__PURE__ */ jsx4("span", { children: ctx }),
334
+ price && /* @__PURE__ */ jsx4("span", { "data-model-price": true, children: price })
324
335
  ] })
325
336
  ] }),
326
- selected && /* @__PURE__ */ jsx3(CheckGlyph, { className: "h-3.5 w-3.5 shrink-0 text-primary" })
337
+ selected && /* @__PURE__ */ jsx4(CheckGlyph, { className: "h-3.5 w-3.5 shrink-0 text-primary" })
327
338
  ]
328
339
  }
329
340
  );
@@ -423,12 +434,14 @@ function ModelPicker({
423
434
  triggerRef.current?.focus();
424
435
  onChange(modelId);
425
436
  };
426
- const row = (model) => /* @__PURE__ */ jsx3(ModelRow, { model, selected: model.id === value, onSelect: () => select(model.id), renderProviderBadge }, model.id);
427
- return /* @__PURE__ */ jsxs2("div", { ref: containerRef, className: variant === "field" ? "relative flex w-full min-w-0" : "relative inline-flex min-w-0 max-w-full", children: [
428
- /* @__PURE__ */ jsxs2(
429
- "button",
437
+ const row = (model) => /* @__PURE__ */ jsx4(ModelRow, { model, selected: model.id === value, onSelect: () => select(model.id), renderProviderBadge }, model.id);
438
+ const glyph = /* @__PURE__ */ jsx4("span", { className: "shrink-0", "aria-hidden": true, children: selected ? /* @__PURE__ */ jsx4(ModelMarks, { model: selected, size: 16, renderProviderBadge }) : /* @__PURE__ */ jsx4(SparkleGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }) });
439
+ return /* @__PURE__ */ jsxs3("div", { ref: containerRef, className: variant === "field" ? "relative flex w-full min-w-0" : "relative inline-flex min-w-0 max-w-full", children: [
440
+ /* @__PURE__ */ jsx4(
441
+ PickerTrigger,
430
442
  {
431
- type: "button",
443
+ variant,
444
+ icon: triggerContent ? void 0 : glyph,
432
445
  ...triggerProps,
433
446
  id,
434
447
  disabled,
@@ -446,21 +459,18 @@ function ModelPicker({
446
459
  },
447
460
  title: selected ? `${selectedLabel}${selected.servedBy ? ` \xB7 served by ${selected.servedBy}` : ""}` : selectedLabel || defaultOption?.label || "Select model",
448
461
  "data-state": expanded ? "open" : "closed",
449
- className: `${variant === "field" ? fieldPickerTriggerClass({ interactive: !disabled }) : variant === "quiet" ? quietPickerTriggerClass({ interactive: !disabled }) : `${CHIP_PICKER_TRIGGER} ${disabled ? "" : "hover:bg-accent"}`} max-w-full disabled:cursor-not-allowed disabled:opacity-50`,
450
- children: [
451
- triggerContent ?? /* @__PURE__ */ jsxs2("span", { className: variant === "field" ? "flex min-w-0 flex-1 items-center gap-2" : "contents", children: [
452
- /* @__PURE__ */ jsx3("span", { className: "shrink-0", "aria-hidden": true, children: selected ? /* @__PURE__ */ jsx3(ModelMarks, { model: selected, size: 16, renderProviderBadge }) : /* @__PURE__ */ jsx3(SparkleGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }) }),
453
- /* @__PURE__ */ jsx3("span", { className: variant === "field" ? `min-w-0 flex-1 truncate ${value ? "" : "text-muted-foreground"}` : "max-w-[160px] truncate", children: selectedLabel || defaultOption?.label || "Select model" })
454
- ] }),
455
- /* @__PURE__ */ jsx3(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
456
- ]
462
+ className: `${variant === "field" ? fieldPickerTriggerClass({ interactive: !disabled }) : variant === "quiet" ? quietPickerTriggerClass({ interactive: !disabled }) : ""} max-w-full disabled:cursor-not-allowed disabled:opacity-50`,
463
+ children: triggerContent ?? /* @__PURE__ */ jsxs3("span", { className: variant === "field" ? "flex min-w-0 flex-1 items-center gap-2" : "contents", children: [
464
+ variant !== "chip" && glyph,
465
+ /* @__PURE__ */ jsx4("span", { className: variant === "field" ? `min-w-0 flex-1 truncate ${value ? "" : "text-muted-foreground"}` : "max-w-[160px] truncate", children: selectedLabel || defaultOption?.label || "Select model" })
466
+ ] })
457
467
  }
458
468
  ),
459
- describeValue && value && /* @__PURE__ */ jsxs2("span", { id: valueId, className: "sr-only", children: [
469
+ describeValue && value && /* @__PURE__ */ jsxs3("span", { id: valueId, className: "sr-only", children: [
460
470
  "Selected model: ",
461
471
  selectedLabel
462
472
  ] }),
463
- /* @__PURE__ */ jsxs2(
473
+ /* @__PURE__ */ jsxs3(
464
474
  PopoverSurface,
465
475
  {
466
476
  open: expanded,
@@ -474,9 +484,9 @@ function ModelPicker({
474
484
  side: variant === "field" ? "below" : void 0,
475
485
  className: `flex w-[420px] max-w-[calc(100vw-2rem)] flex-col overflow-hidden rounded-xl border border-card-edge bg-popover text-foreground ${OVERLAY_SHADOW}`,
476
486
  children: [
477
- /* @__PURE__ */ jsx3("div", { className: "shrink-0 border-b border-border px-3 py-2", children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 rounded-lg border border-strong bg-background px-3 py-2 focus-within:ring-2 focus-within:ring-ring", children: [
478
- /* @__PURE__ */ jsx3(SearchGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
479
- /* @__PURE__ */ jsx3(
487
+ /* @__PURE__ */ jsx4("div", { className: "shrink-0 border-b border-border px-3 py-2", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 rounded-lg border border-strong bg-background px-3 py-2 focus-within:ring-2 focus-within:ring-ring", children: [
488
+ /* @__PURE__ */ jsx4(SearchGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
489
+ /* @__PURE__ */ jsx4(
480
490
  "input",
481
491
  {
482
492
  ref: inputRef,
@@ -489,8 +499,8 @@ function ModelPicker({
489
499
  }
490
500
  )
491
501
  ] }) }),
492
- /* @__PURE__ */ jsxs2("div", { className: "max-h-[520px] min-h-0 overflow-y-auto p-1 pb-2", children: [
493
- defaultOption && !query.trim() && /* @__PURE__ */ jsxs2(
502
+ /* @__PURE__ */ jsxs3("div", { className: "max-h-[520px] min-h-0 overflow-y-auto p-1 pb-2", children: [
503
+ defaultOption && !query.trim() && /* @__PURE__ */ jsxs3(
494
504
  "button",
495
505
  {
496
506
  type: "button",
@@ -498,23 +508,23 @@ function ModelPicker({
498
508
  "aria-pressed": !value,
499
509
  className: `flex w-full items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm transition ${POPOVER_OPTION_FOCUS} ${value ? "hover:bg-accent" : "bg-primary/10 font-medium"}`,
500
510
  children: [
501
- /* @__PURE__ */ jsx3(SparkleGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
502
- /* @__PURE__ */ jsx3("span", { className: "min-w-0 flex-1", children: defaultOption.label }),
503
- !value && /* @__PURE__ */ jsx3(CheckGlyph, { className: "h-3.5 w-3.5 shrink-0 text-primary" })
511
+ /* @__PURE__ */ jsx4(SparkleGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
512
+ /* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: defaultOption.label }),
513
+ !value && /* @__PURE__ */ jsx4(CheckGlyph, { className: "h-3.5 w-3.5 shrink-0 text-primary" })
504
514
  ]
505
515
  }
506
516
  ),
507
- value && !selected && /* @__PURE__ */ jsxs2("div", { className: "mx-2 mb-1 mt-2 rounded-lg bg-secondary px-3 py-2 text-sm", children: [
508
- /* @__PURE__ */ jsx3("p", { className: "text-xs font-medium text-muted-foreground", children: "Saved model" }),
509
- /* @__PURE__ */ jsx3("p", { className: "break-words [overflow-wrap:anywhere]", children: value }),
510
- /* @__PURE__ */ jsx3("p", { className: "mt-1 text-xs text-muted-foreground", children: loading || unavailable ? "Your saved selection is unchanged." : "Not in this catalogue. Your saved selection is unchanged." })
517
+ value && !selected && /* @__PURE__ */ jsxs3("div", { className: "mx-2 mb-1 mt-2 rounded-lg bg-secondary px-3 py-2 text-sm", children: [
518
+ /* @__PURE__ */ jsx4("p", { className: "text-xs font-medium text-muted-foreground", children: "Saved model" }),
519
+ /* @__PURE__ */ jsx4("p", { className: "break-words [overflow-wrap:anywhere]", children: value }),
520
+ /* @__PURE__ */ jsx4("p", { className: "mt-1 text-xs text-muted-foreground", children: loading || unavailable ? "Your saved selection is unchanged." : "Not in this catalogue. Your saved selection is unchanged." })
511
521
  ] }),
512
- loading ? /* @__PURE__ */ jsx3("div", { role: "status", className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading models..." }) : unavailable ? /* @__PURE__ */ jsxs2("div", { className: "px-3 py-4 text-sm", children: [
513
- /* @__PURE__ */ jsxs2("div", { role: "alert", children: [
514
- /* @__PURE__ */ jsx3("p", { className: "font-medium", children: "Model catalogue unavailable" }),
515
- /* @__PURE__ */ jsx3("p", { className: "mt-1 break-words text-muted-foreground [overflow-wrap:anywhere]", children: error || "The catalogue could not be loaded." })
522
+ loading ? /* @__PURE__ */ jsx4("div", { role: "status", className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading models..." }) : unavailable ? /* @__PURE__ */ jsxs3("div", { className: "px-3 py-4 text-sm", children: [
523
+ /* @__PURE__ */ jsxs3("div", { role: "alert", children: [
524
+ /* @__PURE__ */ jsx4("p", { className: "font-medium", children: "Model catalogue unavailable" }),
525
+ /* @__PURE__ */ jsx4("p", { className: "mt-1 break-words text-muted-foreground [overflow-wrap:anywhere]", children: error || "The catalogue could not be loaded." })
516
526
  ] }),
517
- onRetry && /* @__PURE__ */ jsx3(
527
+ onRetry && /* @__PURE__ */ jsx4(
518
528
  "button",
519
529
  {
520
530
  type: "button",
@@ -526,24 +536,24 @@ function ModelPicker({
526
536
  children: "Retry"
527
537
  }
528
538
  )
529
- ] }) : models.length === 0 ? /* @__PURE__ */ jsx3("div", { role: "status", className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models available" }) : filtered ? /* @__PURE__ */ jsxs2(Fragment, { children: [
530
- filtered.length === 0 && /* @__PURE__ */ jsx3("div", { role: "status", className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models match your search" }),
539
+ ] }) : models.length === 0 ? /* @__PURE__ */ jsx4("div", { role: "status", className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models available" }) : filtered ? /* @__PURE__ */ jsxs3(Fragment, { children: [
540
+ filtered.length === 0 && /* @__PURE__ */ jsx4("div", { role: "status", className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models match your search" }),
531
541
  filtered.map(row)
532
- ] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
533
- priorityGroup && sections.priority.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
534
- /* @__PURE__ */ jsx3(SectionHeader, { children: priorityGroup.label }),
542
+ ] }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
543
+ priorityGroup && sections.priority.length > 0 && /* @__PURE__ */ jsxs3(Fragment, { children: [
544
+ /* @__PURE__ */ jsx4(SectionHeader, { children: priorityGroup.label }),
535
545
  sections.priority.map(row)
536
546
  ] }),
537
- sections.currentSelection && !showAll && /* @__PURE__ */ jsxs2(Fragment, { children: [
538
- /* @__PURE__ */ jsx3(SectionHeader, { children: "Selected model" }),
547
+ sections.currentSelection && !showAll && /* @__PURE__ */ jsxs3(Fragment, { children: [
548
+ /* @__PURE__ */ jsx4(SectionHeader, { children: "Selected model" }),
539
549
  row(sections.currentSelection)
540
550
  ] }),
541
- sections.recommended.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
542
- /* @__PURE__ */ jsx3(SectionHeader, { children: recommendedLabel }),
551
+ sections.recommended.length > 0 && /* @__PURE__ */ jsxs3(Fragment, { children: [
552
+ /* @__PURE__ */ jsx4(SectionHeader, { children: recommendedLabel }),
543
553
  sections.recommended.map(row)
544
554
  ] }),
545
- sections.recommended.length === 0 && sections.priority.length === 0 && !sections.currentSelection && /* @__PURE__ */ jsx3("div", { className: "px-3 py-3 text-sm text-muted-foreground", children: "Search or browse all models" }),
546
- sections.byProvider.length > 0 && /* @__PURE__ */ jsx3(
555
+ sections.recommended.length === 0 && sections.priority.length === 0 && !sections.currentSelection && /* @__PURE__ */ jsx4("div", { className: "px-3 py-3 text-sm text-muted-foreground", children: "Search or browse all models" }),
556
+ sections.byProvider.length > 0 && /* @__PURE__ */ jsx4(
547
557
  "button",
548
558
  {
549
559
  type: "button",
@@ -553,8 +563,8 @@ function ModelPicker({
553
563
  children: showAll ? "Hide older models" : "Browse all models"
554
564
  }
555
565
  ),
556
- showAll && sections.byProvider.map((group) => /* @__PURE__ */ jsxs2("div", { children: [
557
- /* @__PURE__ */ jsx3(SectionHeader, { children: group.provider }),
566
+ showAll && sections.byProvider.map((group) => /* @__PURE__ */ jsxs3("div", { children: [
567
+ /* @__PURE__ */ jsx4(SectionHeader, { children: group.provider }),
558
568
  group.items.map(row)
559
569
  ] }, group.provider))
560
570
  ] })
@@ -567,7 +577,7 @@ function ModelPicker({
567
577
 
568
578
  // src/web-react/effort-picker.tsx
569
579
  import { useId as useId3, useState as useState4 } from "react";
570
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
580
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
571
581
  var KNOWN_EFFORT_LABELS = {
572
582
  off: "Off",
573
583
  low: "Quick",
@@ -608,7 +618,7 @@ function effortMeterFill(levelId, levels = DEFAULT_EFFORT_LEVELS) {
608
618
  return Math.max(1, Math.floor((index + 1) * EFFORT_METER_SEGMENTS / active.length));
609
619
  }
610
620
  function EffortMeter({ fill, className }) {
611
- return /* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: `inline-flex items-center gap-[2px] ${className ?? ""}`, children: Array.from({ length: EFFORT_METER_SEGMENTS }, (_, i) => /* @__PURE__ */ jsx4(
621
+ return /* @__PURE__ */ jsx5("span", { "aria-hidden": true, className: `inline-flex items-center gap-[2px] ${className ?? ""}`, children: Array.from({ length: EFFORT_METER_SEGMENTS }, (_, i) => /* @__PURE__ */ jsx5(
612
622
  "span",
613
623
  {
614
624
  className: "h-3 w-[3px] rounded-full bg-current",
@@ -636,11 +646,12 @@ function EffortPicker({
636
646
  const rendered = reconcileEffortLevels(value, levels);
637
647
  const isDeclared = (id2) => levels.some((l) => l.id === id2) && !UNPLACEABLE_LEVEL_IDS.has(id2);
638
648
  const selected = rendered.find((l) => l.id === value);
639
- return /* @__PURE__ */ jsxs3("div", { ref: containerRef, className: pickerRootClass(fullWidth || field), children: [
640
- /* @__PURE__ */ jsxs3(
641
- "button",
649
+ return /* @__PURE__ */ jsxs4("div", { ref: containerRef, className: pickerRootClass(fullWidth || field), children: [
650
+ /* @__PURE__ */ jsxs4(
651
+ PickerTrigger,
642
652
  {
643
- type: "button",
653
+ variant,
654
+ icon: /* @__PURE__ */ jsx5(BrainGlyph, { className: "h-3.5 w-3.5 shrink-0" }),
644
655
  ...triggerProps,
645
656
  id,
646
657
  disabled,
@@ -649,28 +660,27 @@ function EffortPicker({
649
660
  onClick: () => setOpen(!open),
650
661
  title: label ? `${label} \u2014 how hard the agent reasons before answering` : "Reasoning effort",
651
662
  "data-state": open ? "open" : "closed",
652
- className: `${field ? fieldPickerTriggerClass({ interactive: !disabled }) : variant === "quiet" ? quietPickerTriggerClass() : `${CHIP_PICKER_TRIGGER} shrink-0 hover:bg-accent`} ${fullWidth ? "w-full" : ""}`,
663
+ className: `${field ? fieldPickerTriggerClass({ interactive: !disabled }) : variant === "quiet" ? quietPickerTriggerClass() : ""} ${fullWidth ? "w-full" : ""}`,
653
664
  children: [
654
- /* @__PURE__ */ jsx4(BrainGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
655
- /* @__PURE__ */ jsxs3("span", { className: fullWidth || field ? "flex-1 truncate text-left" : void 0, children: [
656
- label ? /* @__PURE__ */ jsxs3("span", { className: "text-muted-foreground", children: [
665
+ variant !== "chip" && /* @__PURE__ */ jsx5(BrainGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
666
+ /* @__PURE__ */ jsxs4("span", { className: fullWidth || field ? "flex-1 truncate text-left" : void 0, children: [
667
+ label ? /* @__PURE__ */ jsxs4("span", { className: "text-muted-foreground", children: [
657
668
  label,
658
669
  ": "
659
670
  ] }) : null,
660
671
  selected ? selected.label : "\u2014"
661
672
  ] }),
662
- selected && isDeclared(selected.id) && /* @__PURE__ */ jsx4(
673
+ selected && isDeclared(selected.id) && /* @__PURE__ */ jsx5(
663
674
  EffortMeter,
664
675
  {
665
676
  fill: effortMeterFill(selected.id, levels),
666
677
  className: variant === "quiet" ? "shrink-0" : "shrink-0 text-foreground"
667
678
  }
668
- ),
669
- /* @__PURE__ */ jsx4(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
679
+ )
670
680
  ]
671
681
  }
672
682
  ),
673
- /* @__PURE__ */ jsx4(
683
+ /* @__PURE__ */ jsx5(
674
684
  PopoverSurface,
675
685
  {
676
686
  open,
@@ -681,7 +691,7 @@ function EffortPicker({
681
691
  matchTriggerWidth: fullWidth || field,
682
692
  side: field ? "below" : void 0,
683
693
  className: `w-44 overflow-y-auto rounded-xl border border-card-edge bg-popover p-1 ${OVERLAY_SHADOW}`,
684
- children: rendered.map((l) => /* @__PURE__ */ jsxs3(
694
+ children: rendered.map((l) => /* @__PURE__ */ jsxs4(
685
695
  "button",
686
696
  {
687
697
  type: "button",
@@ -693,10 +703,10 @@ function EffortPicker({
693
703
  },
694
704
  className: `flex min-h-[40px] w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition ${POPOVER_OPTION_FOCUS} ${l.id === value ? "bg-primary/10 font-medium" : "hover:bg-accent"}`,
695
705
  children: [
696
- /* @__PURE__ */ jsx4(BrainGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
697
- /* @__PURE__ */ jsx4("span", { className: "truncate", children: l.label }),
698
- isDeclared(l.id) && /* @__PURE__ */ jsx4(EffortMeter, { fill: effortMeterFill(l.id, levels), className: "ml-auto text-foreground" }),
699
- l.id === value && /* @__PURE__ */ jsx4(CheckGlyph, { className: `${isDeclared(l.id) ? "" : "ml-auto "}h-3.5 w-3.5 shrink-0 text-primary` })
706
+ /* @__PURE__ */ jsx5(BrainGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
707
+ /* @__PURE__ */ jsx5("span", { className: "truncate", children: l.label }),
708
+ isDeclared(l.id) && /* @__PURE__ */ jsx5(EffortMeter, { fill: effortMeterFill(l.id, levels), className: "ml-auto text-foreground" }),
709
+ l.id === value && /* @__PURE__ */ jsx5(CheckGlyph, { className: `${isDeclared(l.id) ? "" : "ml-auto "}h-3.5 w-3.5 shrink-0 text-primary` })
700
710
  ]
701
711
  },
702
712
  l.id
@@ -718,7 +728,7 @@ export {
718
728
  OVERLAY_SHADOW,
719
729
  pickerRootClass,
720
730
  fieldPickerTriggerClass,
721
- CHIP_PICKER_TRIGGER,
731
+ PickerTrigger,
722
732
  quietPickerTriggerClass,
723
733
  usePending,
724
734
  formatModelPrice,
@@ -732,4 +742,4 @@ export {
732
742
  EffortMeter,
733
743
  EffortPicker
734
744
  };
735
- //# sourceMappingURL=chunk-3NMXB62K.js.map
745
+ //# sourceMappingURL=chunk-S2UGXHHZ.js.map