@locusgraph/loop 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/agent/pulse/gradient-label.js +64 -12
  2. package/dist/agent/pulse/marks/bars-mark.js +39 -15
  3. package/dist/agent/pulse/marks/glyph-mark.js +56 -15
  4. package/dist/agent/pulse/marks/locus-mark.js +38 -12
  5. package/dist/agent/pulse/marks/orb-mark.js +21 -9
  6. package/dist/agent/pulse/pulse.js +1 -1
  7. package/dist/agent/pulse/use-loop-animation.js +35 -12
  8. package/dist/agent/thinking/thinking.js +2 -2
  9. package/dist/agent/tool/tool-status.js +1 -1
  10. package/dist/approval/inbox/inbox-row.js +303 -76
  11. package/dist/approval/inbox/inbox.js +192 -39
  12. package/dist/approval/inbox/virtual-inbox-list.js +104 -26
  13. package/dist/approval/memory/memory-review.js +172 -36
  14. package/dist/approval/memory/memory-row.js +187 -50
  15. package/dist/approval/plan/plan-review.js +225 -73
  16. package/dist/approval/plan/plan-step-row.js +182 -76
  17. package/dist/approval/plan/question-choices.js +132 -44
  18. package/dist/approval/plan/question.js +156 -38
  19. package/dist/approval/run/run-bar.js +125 -39
  20. package/dist/approval/shared/use-focus-on-mount.js +23 -5
  21. package/dist/approval/spend/raise-cap-form.js +223 -48
  22. package/dist/approval/spend/spend-gate.js +157 -40
  23. package/dist/approval/spend/spend-meter.js +1 -1
  24. package/dist/approval/tool/approval.js +196 -35
  25. package/dist/approval/tool/args/args-editor.js +206 -46
  26. package/dist/approval/tool/args/args-field.js +240 -55
  27. package/dist/approval/tool/deny-form.js +125 -36
  28. package/dist/approval/tool/tool-inputs.js +91 -24
  29. package/dist/chat/chat/use-stick-to-bottom.js +115 -60
  30. package/dist/chat/chat/virtual-chat-items.js +129 -34
  31. package/dist/chat/composer/composer-actions.d.ts +1 -2
  32. package/dist/chat/composer/composer-actions.js +132 -49
  33. package/dist/chat/composer/composer-status.d.ts +2 -0
  34. package/dist/chat/composer/composer-status.js +3 -0
  35. package/dist/chat/composer/composer.d.ts +1 -1
  36. package/dist/chat/composer/composer.js +2 -1
  37. package/dist/chat/composer/use-auto-grow.js +25 -8
  38. package/dist/chat/files/files.js +293 -66
  39. package/dist/chat/index.d.ts +1 -1
  40. package/dist/chat/index.js +1 -1
  41. package/dist/chat/reply/markdown-components.js +2 -2
  42. package/dist/cost/context.js +1 -1
  43. package/dist/cost/cost.js +1 -1
  44. package/dist/cost/model-picker.js +174 -42
  45. package/dist/cost/shared/context-breakdown.js +1 -1
  46. package/dist/memory/cite.js +181 -58
  47. package/dist/memory/memorized.js +197 -43
  48. package/dist/memory/recall.js +265 -68
  49. package/dist/memory/shared/disclosure.d.ts +2 -2
  50. package/dist/memory/shared/disclosure.js +1 -1
  51. package/dist/memory/sources.js +232 -52
  52. package/dist/shared/panel.js +1 -1
  53. package/dist/shared/virtual/use-list-virtualizer.js +2 -0
  54. package/dist/thread/actions/branch-switcher.js +97 -21
  55. package/dist/thread/canvas/canvas.js +1 -1
  56. package/dist/thread/canvas/version-switcher.js +128 -31
  57. package/dist/thread/code/code.js +2 -2
  58. package/dist/thread/code/copy-code-button.js +58 -24
  59. package/dist/thread/history/history.js +1 -1
  60. package/dist/thread/history/row/history-row.js +99 -18
  61. package/dist/thread/history/row/thread-item-menu.js +74 -19
  62. package/dist/thread/history/row/thread-title-editor.js +74 -29
  63. package/dist/thread/history/virtual-history-list.js +84 -46
  64. package/dist/thread/starters/starters.js +89 -27
  65. package/dist/thread/use-copied.js +40 -10
  66. package/package.json +3 -3
@@ -1,3 +1,6 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { Code as FileCodeIcon, DocumentBlank as FileIcon, DataTable as FileSpreadsheetIcon, Document as FileTextIcon, Close as XIcon } from "@carbon/icons-react";
2
5
  import { cn } from "@locusgraph/components";
3
6
  import { fileExtensionLabel, formatBytes, isImageFile } from "./file-meta.js";
@@ -12,15 +15,33 @@ function describeFile(item) {
12
15
  const description = parts.filter(Boolean).join(" · ");
13
16
  return description || undefined;
14
17
  }
15
- function FilePreview({
16
- item,
17
- isGrid
18
- }) {
19
- const Icon = iconForMediaType(item.mediaType);
20
- return /*#__PURE__*/_jsx("span", {
21
- "data-slot": "files-preview",
22
- className: cn("grid shrink-0 place-items-center overflow-hidden bg-muted text-muted-foreground", isGrid ? "aspect-[16/10] w-full" : "size-10"),
23
- children: isImageFile(item) ? /*#__PURE__*/_jsx("img", {
18
+ function FilePreview(t0) {
19
+ const $ = _c(11);
20
+ const {
21
+ item,
22
+ isGrid
23
+ } = t0;
24
+ let t1;
25
+ if ($[0] !== item.mediaType) {
26
+ t1 = iconForMediaType(item.mediaType);
27
+ $[0] = item.mediaType;
28
+ $[1] = t1;
29
+ } else {
30
+ t1 = $[1];
31
+ }
32
+ const Icon = t1;
33
+ const t2 = isGrid ? "aspect-[16/10] w-full" : "size-10";
34
+ let t3;
35
+ if ($[2] !== t2) {
36
+ t3 = cn("grid shrink-0 place-items-center overflow-hidden bg-muted text-muted-foreground", t2);
37
+ $[2] = t2;
38
+ $[3] = t3;
39
+ } else {
40
+ t3 = $[3];
41
+ }
42
+ let t4;
43
+ if ($[4] !== Icon || $[5] !== isGrid || $[6] !== item) {
44
+ t4 = isImageFile(item) ? /*#__PURE__*/_jsx("img", {
24
45
  src: item.url,
25
46
  alt: "",
26
47
  loading: "lazy",
@@ -28,75 +49,281 @@ function FilePreview({
28
49
  }) : /*#__PURE__*/_jsx(Icon, {
29
50
  "aria-hidden": "true",
30
51
  className: isGrid ? "size-6" : "size-4"
31
- })
32
- });
52
+ });
53
+ $[4] = Icon;
54
+ $[5] = isGrid;
55
+ $[6] = item;
56
+ $[7] = t4;
57
+ } else {
58
+ t4 = $[7];
59
+ }
60
+ let t5;
61
+ if ($[8] !== t3 || $[9] !== t4) {
62
+ t5 = /*#__PURE__*/_jsx("span", {
63
+ "data-slot": "files-preview",
64
+ className: t3,
65
+ children: t4
66
+ });
67
+ $[8] = t3;
68
+ $[9] = t4;
69
+ $[10] = t5;
70
+ } else {
71
+ t5 = $[10];
72
+ }
73
+ return t5;
33
74
  }
34
- function RemoveButton({
35
- item,
36
- isGrid,
37
- onRemove
38
- }) {
39
- return /*#__PURE__*/_jsx("button", {
40
- type: "button",
41
- "aria-label": `Remove ${item.name}`,
42
- onClick: () => onRemove(item.id),
43
- className: cn("grid size-6 shrink-0 place-items-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring", isGrid && "absolute top-1 right-1 bg-card/90"),
44
- children: /*#__PURE__*/_jsx(XIcon, {
75
+ function RemoveButton(t0) {
76
+ const $ = _c(10);
77
+ const {
78
+ item,
79
+ isGrid,
80
+ onRemove
81
+ } = t0;
82
+ const t1 = `Remove ${item.name}`;
83
+ let t2;
84
+ if ($[0] !== item.id || $[1] !== onRemove) {
85
+ t2 = () => onRemove(item.id);
86
+ $[0] = item.id;
87
+ $[1] = onRemove;
88
+ $[2] = t2;
89
+ } else {
90
+ t2 = $[2];
91
+ }
92
+ const t3 = isGrid && "absolute top-1 right-1 bg-card/90";
93
+ let t4;
94
+ if ($[3] !== t3) {
95
+ t4 = cn("grid size-6 shrink-0 place-items-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring", t3);
96
+ $[3] = t3;
97
+ $[4] = t4;
98
+ } else {
99
+ t4 = $[4];
100
+ }
101
+ let t5;
102
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
103
+ t5 = /*#__PURE__*/_jsx(XIcon, {
45
104
  "aria-hidden": "true",
46
105
  className: "size-3.5"
47
- })
48
- });
106
+ });
107
+ $[5] = t5;
108
+ } else {
109
+ t5 = $[5];
110
+ }
111
+ let t6;
112
+ if ($[6] !== t1 || $[7] !== t2 || $[8] !== t4) {
113
+ t6 = /*#__PURE__*/_jsx("button", {
114
+ type: "button",
115
+ "aria-label": t1,
116
+ onClick: t2,
117
+ className: t4,
118
+ children: t5
119
+ });
120
+ $[6] = t1;
121
+ $[7] = t2;
122
+ $[8] = t4;
123
+ $[9] = t6;
124
+ } else {
125
+ t6 = $[9];
126
+ }
127
+ return t6;
49
128
  }
50
- function FileChip({
51
- item,
52
- isGrid,
53
- onRemove
54
- }) {
55
- const description = describeFile(item);
56
- return /*#__PURE__*/_jsxs("li", {
57
- "data-slot": "files-item",
58
- className: cn("relative flex min-w-0 bg-card text-card-foreground ring-1 ring-border", isGrid ? "flex-col" : "w-60 max-w-full items-center gap-2.5 pr-1", !isGrid && !onRemove && "pr-3"),
59
- children: [/*#__PURE__*/_jsx(FilePreview, {
129
+ function FileChip(t0) {
130
+ const $ = _c(27);
131
+ const {
132
+ item,
133
+ isGrid,
134
+ onRemove
135
+ } = t0;
136
+ let t1;
137
+ if ($[0] !== item) {
138
+ t1 = describeFile(item);
139
+ $[0] = item;
140
+ $[1] = t1;
141
+ } else {
142
+ t1 = $[1];
143
+ }
144
+ const description = t1;
145
+ const t2 = isGrid ? "flex-col" : "w-60 max-w-full items-center gap-2.5 pr-1";
146
+ const t3 = !isGrid && !onRemove && "pr-3";
147
+ let t4;
148
+ if ($[2] !== t2 || $[3] !== t3) {
149
+ t4 = cn("relative flex min-w-0 bg-card text-card-foreground ring-1 ring-border", t2, t3);
150
+ $[2] = t2;
151
+ $[3] = t3;
152
+ $[4] = t4;
153
+ } else {
154
+ t4 = $[4];
155
+ }
156
+ let t5;
157
+ if ($[5] !== isGrid || $[6] !== item) {
158
+ t5 = /*#__PURE__*/_jsx(FilePreview, {
60
159
  item: item,
61
160
  isGrid: isGrid
62
- }), /*#__PURE__*/_jsxs("span", {
63
- className: cn("flex min-w-0 flex-1 flex-col gap-0.5", isGrid && "px-2.5 py-2"),
64
- children: [/*#__PURE__*/_jsx("span", {
65
- title: item.name,
66
- className: "truncate text-xs leading-tight font-medium",
67
- children: item.name
68
- }), description && /*#__PURE__*/_jsx("span", {
69
- className: "truncate font-mono text-xs leading-tight text-muted-foreground tabular-nums",
70
- children: description
71
- })]
72
- }), onRemove && /*#__PURE__*/_jsx(RemoveButton, {
161
+ });
162
+ $[5] = isGrid;
163
+ $[6] = item;
164
+ $[7] = t5;
165
+ } else {
166
+ t5 = $[7];
167
+ }
168
+ const t6 = isGrid && "px-2.5 py-2";
169
+ let t7;
170
+ if ($[8] !== t6) {
171
+ t7 = cn("flex min-w-0 flex-1 flex-col gap-0.5", t6);
172
+ $[8] = t6;
173
+ $[9] = t7;
174
+ } else {
175
+ t7 = $[9];
176
+ }
177
+ let t8;
178
+ if ($[10] !== item.name) {
179
+ t8 = /*#__PURE__*/_jsx("span", {
180
+ title: item.name,
181
+ className: "truncate text-xs leading-tight font-medium",
182
+ children: item.name
183
+ });
184
+ $[10] = item.name;
185
+ $[11] = t8;
186
+ } else {
187
+ t8 = $[11];
188
+ }
189
+ let t9;
190
+ if ($[12] !== description) {
191
+ t9 = description && /*#__PURE__*/_jsx("span", {
192
+ className: "truncate font-mono text-xs leading-tight text-muted-foreground tabular-nums",
193
+ children: description
194
+ });
195
+ $[12] = description;
196
+ $[13] = t9;
197
+ } else {
198
+ t9 = $[13];
199
+ }
200
+ let t10;
201
+ if ($[14] !== t7 || $[15] !== t8 || $[16] !== t9) {
202
+ t10 = /*#__PURE__*/_jsxs("span", {
203
+ className: t7,
204
+ children: [t8, t9]
205
+ });
206
+ $[14] = t7;
207
+ $[15] = t8;
208
+ $[16] = t9;
209
+ $[17] = t10;
210
+ } else {
211
+ t10 = $[17];
212
+ }
213
+ let t11;
214
+ if ($[18] !== isGrid || $[19] !== item || $[20] !== onRemove) {
215
+ t11 = onRemove && /*#__PURE__*/_jsx(RemoveButton, {
73
216
  item: item,
74
217
  isGrid: isGrid,
75
218
  onRemove: onRemove
76
- })]
77
- });
219
+ });
220
+ $[18] = isGrid;
221
+ $[19] = item;
222
+ $[20] = onRemove;
223
+ $[21] = t11;
224
+ } else {
225
+ t11 = $[21];
226
+ }
227
+ let t12;
228
+ if ($[22] !== t10 || $[23] !== t11 || $[24] !== t4 || $[25] !== t5) {
229
+ t12 = /*#__PURE__*/_jsxs("li", {
230
+ "data-slot": "files-item",
231
+ className: t4,
232
+ children: [t5, t10, t11]
233
+ });
234
+ $[22] = t10;
235
+ $[23] = t11;
236
+ $[24] = t4;
237
+ $[25] = t5;
238
+ $[26] = t12;
239
+ } else {
240
+ t12 = $[26];
241
+ }
242
+ return t12;
78
243
  }
79
- export function Files({
80
- items,
81
- layout = "inline",
82
- onRemove,
83
- className,
84
- ...props
85
- }) {
244
+ export function Files(t0) {
245
+ const $ = _c(21);
246
+ let className;
247
+ let items;
248
+ let onRemove;
249
+ let props;
250
+ let t1;
251
+ if ($[0] !== t0) {
252
+ ({
253
+ items,
254
+ layout: t1,
255
+ onRemove,
256
+ className,
257
+ ...props
258
+ } = t0);
259
+ $[0] = t0;
260
+ $[1] = className;
261
+ $[2] = items;
262
+ $[3] = onRemove;
263
+ $[4] = props;
264
+ $[5] = t1;
265
+ } else {
266
+ className = $[1];
267
+ items = $[2];
268
+ onRemove = $[3];
269
+ props = $[4];
270
+ t1 = $[5];
271
+ }
272
+ const layout = t1 === undefined ? "inline" : t1;
86
273
  if (items.length === 0) {
87
274
  return null;
88
275
  }
89
276
  const isGrid = layout === "grid";
90
- return /*#__PURE__*/_jsx("ul", {
91
- "data-slot": "files",
92
- "data-layout": layout,
93
- "aria-label": "Files",
94
- className: cn(isGrid ? "grid grid-cols-2 gap-2 sm:grid-cols-3" : "flex flex-wrap gap-2", className),
95
- ...props,
96
- children: items.map(item => /*#__PURE__*/_jsx(FileChip, {
97
- item: item,
98
- isGrid: isGrid,
99
- onRemove: onRemove
100
- }, item.id))
101
- });
277
+ const t2 = isGrid ? "grid grid-cols-2 gap-2 sm:grid-cols-3" : "flex flex-wrap gap-2";
278
+ let t3;
279
+ if ($[6] !== className || $[7] !== t2) {
280
+ t3 = cn(t2, className);
281
+ $[6] = className;
282
+ $[7] = t2;
283
+ $[8] = t3;
284
+ } else {
285
+ t3 = $[8];
286
+ }
287
+ let t4;
288
+ if ($[9] !== isGrid || $[10] !== items || $[11] !== onRemove) {
289
+ let t5;
290
+ if ($[13] !== isGrid || $[14] !== onRemove) {
291
+ t5 = item => /*#__PURE__*/_jsx(FileChip, {
292
+ item: item,
293
+ isGrid: isGrid,
294
+ onRemove: onRemove
295
+ }, item.id);
296
+ $[13] = isGrid;
297
+ $[14] = onRemove;
298
+ $[15] = t5;
299
+ } else {
300
+ t5 = $[15];
301
+ }
302
+ t4 = items.map(t5);
303
+ $[9] = isGrid;
304
+ $[10] = items;
305
+ $[11] = onRemove;
306
+ $[12] = t4;
307
+ } else {
308
+ t4 = $[12];
309
+ }
310
+ let t5;
311
+ if ($[16] !== layout || $[17] !== props || $[18] !== t3 || $[19] !== t4) {
312
+ t5 = /*#__PURE__*/_jsx("ul", {
313
+ "data-slot": "files",
314
+ "data-layout": layout,
315
+ "aria-label": "Files",
316
+ className: t3,
317
+ ...props,
318
+ children: t4
319
+ });
320
+ $[16] = layout;
321
+ $[17] = props;
322
+ $[18] = t3;
323
+ $[19] = t4;
324
+ $[20] = t5;
325
+ } else {
326
+ t5 = $[20];
327
+ }
328
+ return t5;
102
329
  }
@@ -1,6 +1,6 @@
1
1
  export * from "./chat/chat.js";
2
2
  export * from "./composer/composer.js";
3
- export { type ComposerStatus, isComposerBusy } from "./composer/composer-actions.js";
3
+ export { type ComposerStatus, isComposerBusy } from "./composer/composer-status.js";
4
4
  export { type FileItem, fileFromFilePart, formatBytes } from "./files/file-meta.js";
5
5
  export * from "./files/files.js";
6
6
  export * from "./reply/reply.js";
@@ -1,6 +1,6 @@
1
1
  export * from "./chat/chat.js";
2
2
  export * from "./composer/composer.js";
3
- export { isComposerBusy } from "./composer/composer-actions.js";
3
+ export { isComposerBusy } from "./composer/composer-status.js";
4
4
  export { fileFromFilePart, formatBytes } from "./files/file-meta.js";
5
5
  export * from "./files/files.js";
6
6
  export * from "./reply/reply.js";
@@ -50,7 +50,7 @@ export const markdownComponents = {
50
50
  className,
51
51
  ...props
52
52
  }) => /*#__PURE__*/_jsx("h4", {
53
- className: cn("eyebrow mt-5 mb-1.5 first:mt-0", className),
53
+ className: cn("locus-eyebrow mt-5 mb-1.5 first:mt-0", className),
54
54
  ...props
55
55
  }),
56
56
  ul: ({
@@ -128,7 +128,7 @@ export const markdownComponents = {
128
128
  className,
129
129
  ...props
130
130
  }) => /*#__PURE__*/_jsx("th", {
131
- className: cn("eyebrow border-b bg-muted/30 px-3 py-2 text-left font-normal", className),
131
+ className: cn("locus-eyebrow border-b bg-muted/30 px-3 py-2 text-left font-normal", className),
132
132
  ...props
133
133
  }),
134
134
  td: ({
@@ -42,7 +42,7 @@ function BarContent({
42
42
  children: [/*#__PURE__*/_jsxs("span", {
43
43
  className: "flex items-baseline justify-between gap-4 font-mono text-[11px] tabular-nums",
44
44
  children: [/*#__PURE__*/_jsx("span", {
45
- className: "eyebrow",
45
+ className: "locus-eyebrow",
46
46
  children: label
47
47
  }), /*#__PURE__*/_jsxs("span", {
48
48
  className: cn(status === "ok" && "text-foreground"),
package/dist/cost/cost.js CHANGED
@@ -56,7 +56,7 @@ function AttemptRow({
56
56
  children: [/*#__PURE__*/_jsxs("span", {
57
57
  className: "flex min-w-0 items-baseline gap-2",
58
58
  children: [/*#__PURE__*/_jsxs("span", {
59
- className: "eyebrow",
59
+ className: "locus-eyebrow",
60
60
  children: ["#", position + 1]
61
61
  }), /*#__PURE__*/_jsx("span", {
62
62
  className: cn("truncate", attempt.failed && "text-muted-foreground"),
@@ -1,54 +1,186 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { ChevronDown as ChevronDownIcon } from "@carbon/icons-react";
2
5
  import { cn, DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuTrigger } from "@locusgraph/components";
3
6
  import { ModelOptionRow } from "./shared/model-option-row.js";
4
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
8
  export { modelPriceLabel } from "./shared/model-option-row.js";
6
- export function ModelPicker({
7
- models,
8
- value,
9
- onChange,
10
- label = "Model",
11
- disabled = false,
12
- className
13
- }) {
14
- const selected = models.find(model => model.id === value);
15
- return /*#__PURE__*/_jsxs(DropdownMenu, {
16
- children: [/*#__PURE__*/_jsxs(DropdownMenuTrigger, {
9
+ export function ModelPicker(t0) {
10
+ const $ = _c(36);
11
+ const {
12
+ models,
13
+ value,
14
+ onChange,
15
+ label: t1,
16
+ disabled: t2,
17
+ className
18
+ } = t0;
19
+ const label = t1 === undefined ? "Model" : t1;
20
+ const disabled = t2 === undefined ? false : t2;
21
+ let t3;
22
+ if ($[0] !== models || $[1] !== value) {
23
+ let t4;
24
+ if ($[3] !== value) {
25
+ t4 = model => model.id === value;
26
+ $[3] = value;
27
+ $[4] = t4;
28
+ } else {
29
+ t4 = $[4];
30
+ }
31
+ t3 = models.find(t4);
32
+ $[0] = models;
33
+ $[1] = value;
34
+ $[2] = t3;
35
+ } else {
36
+ t3 = $[2];
37
+ }
38
+ const selected = t3;
39
+ const t4 = `${label}: ${selected?.name ?? "none selected"}`;
40
+ let t5;
41
+ if ($[5] !== className) {
42
+ t5 = cn("group inline-flex h-7 max-w-full items-center gap-1.5 rounded-full px-2.5 text-xs outline-none transition-colors duration-150 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/70 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent motion-reduce:transition-none", className);
43
+ $[5] = className;
44
+ $[6] = t5;
45
+ } else {
46
+ t5 = $[6];
47
+ }
48
+ const t6 = selected?.name ?? label;
49
+ let t7;
50
+ if ($[7] !== t6) {
51
+ t7 = /*#__PURE__*/_jsx("span", {
52
+ className: "truncate font-medium",
53
+ children: t6
54
+ });
55
+ $[7] = t6;
56
+ $[8] = t7;
57
+ } else {
58
+ t7 = $[8];
59
+ }
60
+ let t8;
61
+ if ($[9] !== selected) {
62
+ t8 = selected && /*#__PURE__*/_jsx("span", {
63
+ className: "truncate text-muted-foreground max-sm:hidden",
64
+ children: selected.provider
65
+ });
66
+ $[9] = selected;
67
+ $[10] = t8;
68
+ } else {
69
+ t8 = $[10];
70
+ }
71
+ let t9;
72
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
73
+ t9 = /*#__PURE__*/_jsx(ChevronDownIcon, {
74
+ "aria-hidden": true,
75
+ className: "size-3 shrink-0 text-muted-foreground transition-transform duration-150 group-data-[state=open]:rotate-180 motion-reduce:transition-none"
76
+ });
77
+ $[11] = t9;
78
+ } else {
79
+ t9 = $[11];
80
+ }
81
+ let t10;
82
+ if ($[12] !== disabled || $[13] !== t4 || $[14] !== t5 || $[15] !== t7 || $[16] !== t8 || $[17] !== value) {
83
+ t10 = /*#__PURE__*/_jsxs(DropdownMenuTrigger, {
17
84
  "data-slot": "model-picker",
18
85
  "data-value": value,
19
86
  disabled: disabled,
20
- "aria-label": `${label}: ${selected?.name ?? "none selected"}`,
21
- className: cn("group inline-flex h-7 max-w-full items-center gap-1.5 rounded-full px-2.5 text-xs outline-none transition-colors duration-150 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/70 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent motion-reduce:transition-none", className),
22
- children: [/*#__PURE__*/_jsx("span", {
23
- className: "truncate font-medium",
24
- children: selected?.name ?? label
25
- }), selected && /*#__PURE__*/_jsx("span", {
26
- className: "truncate text-muted-foreground max-sm:hidden",
27
- children: selected.provider
28
- }), /*#__PURE__*/_jsx(ChevronDownIcon, {
29
- "aria-hidden": true,
30
- className: "size-3 shrink-0 text-muted-foreground transition-transform duration-150 group-data-[state=open]:rotate-180 motion-reduce:transition-none"
31
- })]
32
- }), /*#__PURE__*/_jsxs(DropdownMenuContent, {
87
+ "aria-label": t4,
88
+ className: t5,
89
+ children: [t7, t8, t9]
90
+ });
91
+ $[12] = disabled;
92
+ $[13] = t4;
93
+ $[14] = t5;
94
+ $[15] = t7;
95
+ $[16] = t8;
96
+ $[17] = value;
97
+ $[18] = t10;
98
+ } else {
99
+ t10 = $[18];
100
+ }
101
+ let t11;
102
+ if ($[19] !== label) {
103
+ t11 = /*#__PURE__*/_jsx("span", {
104
+ children: label
105
+ });
106
+ $[19] = label;
107
+ $[20] = t11;
108
+ } else {
109
+ t11 = $[20];
110
+ }
111
+ let t12;
112
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
113
+ t12 = /*#__PURE__*/_jsx("span", {
114
+ className: "pr-7",
115
+ children: "Per 1M tokens"
116
+ });
117
+ $[21] = t12;
118
+ } else {
119
+ t12 = $[21];
120
+ }
121
+ let t13;
122
+ if ($[22] !== t11) {
123
+ t13 = /*#__PURE__*/_jsxs(DropdownMenuLabel, {
124
+ className: "locus-eyebrow flex justify-between gap-3 border-b border-border px-3 py-2 font-normal",
125
+ children: [t11, t12]
126
+ });
127
+ $[22] = t11;
128
+ $[23] = t13;
129
+ } else {
130
+ t13 = $[23];
131
+ }
132
+ let t14;
133
+ if ($[24] !== models) {
134
+ t14 = models.map(_temp);
135
+ $[24] = models;
136
+ $[25] = t14;
137
+ } else {
138
+ t14 = $[25];
139
+ }
140
+ let t15;
141
+ if ($[26] !== onChange || $[27] !== t14 || $[28] !== value) {
142
+ t15 = /*#__PURE__*/_jsx(DropdownMenuRadioGroup, {
143
+ value: value,
144
+ onValueChange: onChange,
145
+ className: "flex flex-col divide-y divide-border",
146
+ children: t14
147
+ });
148
+ $[26] = onChange;
149
+ $[27] = t14;
150
+ $[28] = value;
151
+ $[29] = t15;
152
+ } else {
153
+ t15 = $[29];
154
+ }
155
+ let t16;
156
+ if ($[30] !== t13 || $[31] !== t15) {
157
+ t16 = /*#__PURE__*/_jsxs(DropdownMenuContent, {
33
158
  align: "start",
34
159
  sideOffset: 6,
35
160
  className: "w-80 rounded-none border-0 bg-popover p-0 shadow-overlay ring-1 ring-border",
36
- children: [/*#__PURE__*/_jsxs(DropdownMenuLabel, {
37
- className: "eyebrow flex justify-between gap-3 border-b border-border px-3 py-2 font-normal",
38
- children: [/*#__PURE__*/_jsx("span", {
39
- children: label
40
- }), /*#__PURE__*/_jsx("span", {
41
- className: "pr-7",
42
- children: "Per 1M tokens"
43
- })]
44
- }), /*#__PURE__*/_jsx(DropdownMenuRadioGroup, {
45
- value: value,
46
- onValueChange: onChange,
47
- className: "flex flex-col divide-y divide-border",
48
- children: models.map(model => /*#__PURE__*/_jsx(ModelOptionRow, {
49
- model: model
50
- }, model.id))
51
- })]
52
- })]
53
- });
161
+ children: [t13, t15]
162
+ });
163
+ $[30] = t13;
164
+ $[31] = t15;
165
+ $[32] = t16;
166
+ } else {
167
+ t16 = $[32];
168
+ }
169
+ let t17;
170
+ if ($[33] !== t10 || $[34] !== t16) {
171
+ t17 = /*#__PURE__*/_jsxs(DropdownMenu, {
172
+ children: [t10, t16]
173
+ });
174
+ $[33] = t10;
175
+ $[34] = t16;
176
+ $[35] = t17;
177
+ } else {
178
+ t17 = $[35];
179
+ }
180
+ return t17;
181
+ }
182
+ function _temp(model_0) {
183
+ return /*#__PURE__*/_jsx(ModelOptionRow, {
184
+ model: model_0
185
+ }, model_0.id);
54
186
  }
@@ -48,7 +48,7 @@ export function ContextBreakdown({
48
48
  "data-slot": "context-breakdown",
49
49
  className: "flex flex-col",
50
50
  children: [/*#__PURE__*/_jsxs("div", {
51
- className: "eyebrow flex items-center gap-2 px-4 pt-3",
51
+ className: "locus-eyebrow flex items-center gap-2 px-4 pt-3",
52
52
  children: [/*#__PURE__*/_jsx("span", {
53
53
  children: label
54
54
  }), /*#__PURE__*/_jsxs("span", {