@locusgraph/loop 0.3.0 → 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.
- package/dist/agent/pulse/gradient-label.js +64 -12
- package/dist/agent/pulse/marks/bars-mark.js +39 -15
- package/dist/agent/pulse/marks/glyph-mark.js +56 -15
- package/dist/agent/pulse/marks/locus-mark.js +38 -12
- package/dist/agent/pulse/marks/orb-mark.js +21 -9
- package/dist/agent/pulse/use-loop-animation.js +35 -12
- package/dist/approval/inbox/inbox-row.js +303 -76
- package/dist/approval/inbox/inbox.js +192 -39
- package/dist/approval/inbox/virtual-inbox-list.js +104 -26
- package/dist/approval/memory/memory-review.js +172 -36
- package/dist/approval/memory/memory-row.js +187 -50
- package/dist/approval/plan/plan-review.js +225 -73
- package/dist/approval/plan/plan-step-row.js +182 -76
- package/dist/approval/plan/question-choices.js +132 -44
- package/dist/approval/plan/question.js +156 -38
- package/dist/approval/run/run-bar.js +125 -39
- package/dist/approval/shared/use-focus-on-mount.js +23 -5
- package/dist/approval/spend/raise-cap-form.js +223 -48
- package/dist/approval/spend/spend-gate.js +157 -40
- package/dist/approval/tool/approval.js +196 -35
- package/dist/approval/tool/args/args-editor.js +206 -46
- package/dist/approval/tool/args/args-field.js +240 -55
- package/dist/approval/tool/deny-form.js +125 -36
- package/dist/approval/tool/tool-inputs.js +90 -23
- package/dist/chat/chat/use-stick-to-bottom.js +115 -60
- package/dist/chat/chat/virtual-chat-items.js +129 -34
- package/dist/chat/composer/composer-actions.d.ts +1 -2
- package/dist/chat/composer/composer-actions.js +132 -49
- package/dist/chat/composer/composer-status.d.ts +2 -0
- package/dist/chat/composer/composer-status.js +3 -0
- package/dist/chat/composer/composer.d.ts +1 -1
- package/dist/chat/composer/composer.js +2 -1
- package/dist/chat/composer/use-auto-grow.js +25 -8
- package/dist/chat/files/files.js +293 -66
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/cost/model-picker.js +174 -42
- package/dist/memory/cite.js +181 -58
- package/dist/memory/memorized.js +196 -42
- package/dist/memory/recall.js +265 -68
- package/dist/memory/sources.js +232 -52
- package/dist/shared/virtual/use-list-virtualizer.js +2 -0
- package/dist/thread/actions/branch-switcher.js +97 -21
- package/dist/thread/canvas/version-switcher.js +128 -31
- package/dist/thread/code/copy-code-button.js +58 -24
- package/dist/thread/history/row/history-row.js +99 -18
- package/dist/thread/history/row/thread-item-menu.js +74 -19
- package/dist/thread/history/row/thread-title-editor.js +74 -29
- package/dist/thread/history/virtual-history-list.js +84 -46
- package/dist/thread/starters/starters.js +89 -27
- package/dist/thread/use-copied.js +40 -10
- package/package.json +1 -1
package/dist/chat/files/files.js
CHANGED
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
}
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -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-
|
|
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";
|
package/dist/chat/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./chat/chat.js";
|
|
2
2
|
export * from "./composer/composer.js";
|
|
3
|
-
export { isComposerBusy } from "./composer/composer-
|
|
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";
|
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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":
|
|
21
|
-
className:
|
|
22
|
-
children: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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: [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
}
|