@locusgraph/loop 0.2.0 → 0.3.0

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 (75) hide show
  1. package/dist/agent/pulse/gradient-label.js +12 -62
  2. package/dist/agent/pulse/marks/bars-mark.js +15 -37
  3. package/dist/agent/pulse/marks/glyph-mark.js +15 -54
  4. package/dist/agent/pulse/marks/locus-mark.js +12 -36
  5. package/dist/agent/pulse/marks/orb-mark.js +9 -19
  6. package/dist/agent/pulse/marks/spinner-mark.js +20 -29
  7. package/dist/agent/pulse/pulse.js +36 -123
  8. package/dist/agent/pulse/use-loop-animation.js +12 -33
  9. package/dist/agent/steps/step-icon.js +26 -96
  10. package/dist/agent/steps/steps.js +47 -210
  11. package/dist/agent/thinking/thinking.js +2 -2
  12. package/dist/agent/tool/json-block.js +11 -31
  13. package/dist/agent/tool/tool-status.js +12 -35
  14. package/dist/approval/inbox/inbox-row.js +76 -301
  15. package/dist/approval/inbox/inbox.js +39 -190
  16. package/dist/approval/inbox/virtual-inbox-list.js +26 -102
  17. package/dist/approval/memory/memory-review.js +36 -170
  18. package/dist/approval/memory/memory-row.js +50 -185
  19. package/dist/approval/plan/plan-review.js +73 -223
  20. package/dist/approval/plan/plan-step-row.js +76 -180
  21. package/dist/approval/plan/question-choices.js +44 -130
  22. package/dist/approval/plan/question.js +38 -154
  23. package/dist/approval/run/run-bar.js +39 -123
  24. package/dist/approval/shared/risk-badge.js +9 -24
  25. package/dist/approval/shared/use-focus-on-mount.js +5 -21
  26. package/dist/approval/spend/raise-cap-form.js +48 -221
  27. package/dist/approval/spend/spend-gate.js +40 -155
  28. package/dist/approval/spend/spend-meter.js +86 -313
  29. package/dist/approval/tool/approval.js +35 -194
  30. package/dist/approval/tool/args/args-editor.js +46 -204
  31. package/dist/approval/tool/args/args-field.js +55 -238
  32. package/dist/approval/tool/deny-form.js +36 -123
  33. package/dist/approval/tool/tool-inputs.js +24 -89
  34. package/dist/chat/chat/use-stick-to-bottom.js +60 -113
  35. package/dist/chat/chat/virtual-chat-items.js +34 -127
  36. package/dist/chat/composer/composer-actions.js +46 -129
  37. package/dist/chat/composer/use-auto-grow.js +8 -23
  38. package/dist/chat/files/files.js +66 -291
  39. package/dist/chat/reply/fenced-code.js +10 -32
  40. package/dist/chat/reply/markdown-components.js +2 -2
  41. package/dist/chat/reply/reply.js +24 -99
  42. package/dist/chat/turn/turn.js +46 -197
  43. package/dist/cost/context.js +65 -282
  44. package/dist/cost/cost-steps.js +42 -195
  45. package/dist/cost/cost.js +108 -497
  46. package/dist/cost/model-picker.js +42 -172
  47. package/dist/cost/shared/context-breakdown.js +65 -281
  48. package/dist/cost/shared/meter-marks.js +34 -92
  49. package/dist/cost/shared/model-option-row.js +35 -158
  50. package/dist/cost/shared/step-cost-row.js +37 -222
  51. package/dist/memory/cite.js +58 -179
  52. package/dist/memory/memorized.js +43 -195
  53. package/dist/memory/recall.js +68 -263
  54. package/dist/memory/shared/disclosure.d.ts +2 -2
  55. package/dist/memory/shared/disclosure.js +1 -1
  56. package/dist/memory/shared/source-mark.js +10 -38
  57. package/dist/memory/sources.js +52 -230
  58. package/dist/shared/decision-summary.js +35 -117
  59. package/dist/shared/panel-empty.js +15 -73
  60. package/dist/shared/panel.js +65 -239
  61. package/dist/shared/status-dot.js +10 -32
  62. package/dist/thread/actions/action-button.js +10 -53
  63. package/dist/thread/actions/branch-switcher.js +21 -95
  64. package/dist/thread/canvas/canvas.js +1 -1
  65. package/dist/thread/canvas/version-switcher.js +31 -126
  66. package/dist/thread/code/code.js +2 -2
  67. package/dist/thread/code/copy-code-button.js +24 -56
  68. package/dist/thread/history/history.js +1 -1
  69. package/dist/thread/history/row/history-row.js +18 -97
  70. package/dist/thread/history/row/thread-item-menu.js +19 -72
  71. package/dist/thread/history/row/thread-title-editor.js +29 -72
  72. package/dist/thread/history/virtual-history-list.js +46 -82
  73. package/dist/thread/starters/starters.js +27 -87
  74. package/dist/thread/use-copied.js +10 -38
  75. package/package.json +3 -3
package/dist/cost/cost.js CHANGED
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { Money as CoinsIcon } from "@carbon/icons-react";
3
2
  import { cn } from "@locusgraph/components";
4
3
  import { formatCount, formatMicroUsd, pluralize } from "@locusgraph/utils";
@@ -12,520 +11,132 @@ function modelsOf(attempts) {
12
11
  const models = [...new Set(attempts.map(attempt => attempt.model).filter(Boolean))];
13
12
  return models.length > 0 ? models.join(", ") : undefined;
14
13
  }
15
- function WastedNote(t0) {
16
- const $ = _c(7);
17
- const {
18
- totals
19
- } = t0;
20
- if (totals.failedAttempts === 0) {
21
- return null;
22
- }
23
- let t1;
24
- if ($[0] !== totals.failedAttempts) {
25
- t1 = pluralize(totals.failedAttempts, "failed attempt");
26
- $[0] = totals.failedAttempts;
27
- $[1] = t1;
28
- } else {
29
- t1 = $[1];
30
- }
31
- let t2;
32
- if ($[2] !== totals.wastedMicroUsd) {
33
- t2 = formatMicroUsd(totals.wastedMicroUsd);
34
- $[2] = totals.wastedMicroUsd;
35
- $[3] = t2;
36
- } else {
37
- t2 = $[3];
38
- }
39
- let t3;
40
- if ($[4] !== t1 || $[5] !== t2) {
41
- t3 = /*#__PURE__*/_jsxs("span", {
42
- "data-slot": "cost-wasted",
43
- className: "text-destructive tabular-nums",
44
- children: [t1, " \xB7 ", t2, " ", "wasted"]
45
- });
46
- $[4] = t1;
47
- $[5] = t2;
48
- $[6] = t3;
49
- } else {
50
- t3 = $[6];
51
- }
52
- return t3;
14
+ function WastedNote({
15
+ totals
16
+ }) {
17
+ if (totals.failedAttempts === 0) return null;
18
+ return /*#__PURE__*/_jsxs("span", {
19
+ "data-slot": "cost-wasted",
20
+ className: "text-destructive tabular-nums",
21
+ children: [pluralize(totals.failedAttempts, "failed attempt"), " \xB7 ", formatMicroUsd(totals.wastedMicroUsd), " ", "wasted"]
22
+ });
53
23
  }
54
- function CompactCost(t0) {
55
- const $ = _c(26);
56
- const {
57
- attempts,
58
- totals,
59
- className
60
- } = t0;
61
- let t1;
62
- if ($[0] !== attempts) {
63
- t1 = modelsOf(attempts);
64
- $[0] = attempts;
65
- $[1] = t1;
66
- } else {
67
- t1 = $[1];
68
- }
69
- const model = t1;
70
- const t2 = totals.failedAttempts > 0 || undefined;
71
- let t3;
72
- if ($[2] !== className) {
73
- t3 = cn("inline-flex flex-wrap items-baseline gap-x-3 gap-y-0.5 font-mono text-[11px] text-muted-foreground tabular-nums", className);
74
- $[2] = className;
75
- $[3] = t3;
76
- } else {
77
- t3 = $[3];
78
- }
79
- let t4;
80
- if ($[4] !== totals.costMicroUsd) {
81
- t4 = formatMicroUsd(totals.costMicroUsd);
82
- $[4] = totals.costMicroUsd;
83
- $[5] = t4;
84
- } else {
85
- t4 = $[5];
86
- }
87
- let t5;
88
- if ($[6] !== t4) {
89
- t5 = /*#__PURE__*/_jsx("span", {
24
+ function CompactCost({
25
+ attempts,
26
+ totals,
27
+ className
28
+ }) {
29
+ const model = modelsOf(attempts);
30
+ return /*#__PURE__*/_jsxs("span", {
31
+ "data-slot": "cost",
32
+ "data-variant": "compact",
33
+ "data-failed": totals.failedAttempts > 0 || undefined,
34
+ className: cn("inline-flex flex-wrap items-baseline gap-x-3 gap-y-0.5 font-mono text-[11px] text-muted-foreground tabular-nums", className),
35
+ children: [/*#__PURE__*/_jsx("span", {
90
36
  className: "font-medium text-foreground",
91
- children: t4
92
- });
93
- $[6] = t4;
94
- $[7] = t5;
95
- } else {
96
- t5 = $[7];
97
- }
98
- let t6;
99
- if ($[8] !== totals.inputTokens) {
100
- t6 = formatCount(totals.inputTokens);
101
- $[8] = totals.inputTokens;
102
- $[9] = t6;
103
- } else {
104
- t6 = $[9];
105
- }
106
- let t7;
107
- if ($[10] !== totals.outputTokens) {
108
- t7 = formatCount(totals.outputTokens);
109
- $[10] = totals.outputTokens;
110
- $[11] = t7;
111
- } else {
112
- t7 = $[11];
113
- }
114
- let t8;
115
- if ($[12] !== t6 || $[13] !== t7) {
116
- t8 = /*#__PURE__*/_jsxs("span", {
37
+ children: formatMicroUsd(totals.costMicroUsd)
38
+ }), /*#__PURE__*/_jsxs("span", {
117
39
  className: "whitespace-nowrap",
118
- children: [t6, " in \xB7 ", t7, " out"]
119
- });
120
- $[12] = t6;
121
- $[13] = t7;
122
- $[14] = t8;
123
- } else {
124
- t8 = $[14];
125
- }
126
- let t9;
127
- if ($[15] !== model) {
128
- t9 = model && /*#__PURE__*/_jsx("span", {
40
+ children: [formatCount(totals.inputTokens), " in \xB7 ", formatCount(totals.outputTokens), " out"]
41
+ }), model && /*#__PURE__*/_jsx("span", {
129
42
  children: model
130
- });
131
- $[15] = model;
132
- $[16] = t9;
133
- } else {
134
- t9 = $[16];
135
- }
136
- let t10;
137
- if ($[17] !== totals) {
138
- t10 = /*#__PURE__*/_jsx(WastedNote, {
43
+ }), /*#__PURE__*/_jsx(WastedNote, {
139
44
  totals: totals
140
- });
141
- $[17] = totals;
142
- $[18] = t10;
143
- } else {
144
- t10 = $[18];
145
- }
146
- let t11;
147
- if ($[19] !== t10 || $[20] !== t2 || $[21] !== t3 || $[22] !== t5 || $[23] !== t8 || $[24] !== t9) {
148
- t11 = /*#__PURE__*/_jsxs("span", {
149
- "data-slot": "cost",
150
- "data-variant": "compact",
151
- "data-failed": t2,
152
- className: t3,
153
- children: [t5, t8, t9, t10]
154
- });
155
- $[19] = t10;
156
- $[20] = t2;
157
- $[21] = t3;
158
- $[22] = t5;
159
- $[23] = t8;
160
- $[24] = t9;
161
- $[25] = t11;
162
- } else {
163
- t11 = $[25];
164
- }
165
- return t11;
45
+ })]
46
+ });
166
47
  }
167
- function AttemptRow(t0) {
168
- const $ = _c(32);
169
- const {
170
- attempt,
171
- position
172
- } = t0;
173
- const t1 = attempt.failed || undefined;
174
- const t2 = position + 1;
175
- let t3;
176
- if ($[0] !== t2) {
177
- t3 = /*#__PURE__*/_jsxs("span", {
178
- className: "eyebrow",
179
- children: ["#", t2]
180
- });
181
- $[0] = t2;
182
- $[1] = t3;
183
- } else {
184
- t3 = $[1];
185
- }
186
- const t4 = attempt.failed && "text-muted-foreground";
187
- let t5;
188
- if ($[2] !== t4) {
189
- t5 = cn("truncate", t4);
190
- $[2] = t4;
191
- $[3] = t5;
192
- } else {
193
- t5 = $[3];
194
- }
195
- const t6 = attempt.model ?? "Attempt";
196
- let t7;
197
- if ($[4] !== t5 || $[5] !== t6) {
198
- t7 = /*#__PURE__*/_jsx("span", {
199
- className: t5,
200
- children: t6
201
- });
202
- $[4] = t5;
203
- $[5] = t6;
204
- $[6] = t7;
205
- } else {
206
- t7 = $[6];
207
- }
208
- let t8;
209
- if ($[7] !== attempt.failed) {
210
- t8 = attempt.failed && /*#__PURE__*/_jsx("span", {
211
- className: "font-mono text-[11px] tracking-wide text-destructive uppercase",
212
- children: "Failed"
213
- });
214
- $[7] = attempt.failed;
215
- $[8] = t8;
216
- } else {
217
- t8 = $[8];
218
- }
219
- let t9;
220
- if ($[9] !== t3 || $[10] !== t7 || $[11] !== t8) {
221
- t9 = /*#__PURE__*/_jsxs("span", {
48
+ function AttemptRow({
49
+ attempt,
50
+ position
51
+ }) {
52
+ return /*#__PURE__*/_jsxs("li", {
53
+ "data-slot": "cost-attempt",
54
+ "data-failed": attempt.failed || undefined,
55
+ className: "grid grid-cols-[1fr_auto_4.5rem] items-baseline gap-x-4 px-5 py-2.5 text-sm tabular-nums",
56
+ children: [/*#__PURE__*/_jsxs("span", {
222
57
  className: "flex min-w-0 items-baseline gap-2",
223
- children: [t3, t7, t8]
224
- });
225
- $[9] = t3;
226
- $[10] = t7;
227
- $[11] = t8;
228
- $[12] = t9;
229
- } else {
230
- t9 = $[12];
231
- }
232
- let t10;
233
- if ($[13] !== attempt.inputTokens) {
234
- t10 = formatCount(attempt.inputTokens);
235
- $[13] = attempt.inputTokens;
236
- $[14] = t10;
237
- } else {
238
- t10 = $[14];
239
- }
240
- let t11;
241
- if ($[15] !== attempt.outputTokens) {
242
- t11 = formatCount(attempt.outputTokens);
243
- $[15] = attempt.outputTokens;
244
- $[16] = t11;
245
- } else {
246
- t11 = $[16];
247
- }
248
- let t12;
249
- if ($[17] !== t10 || $[18] !== t11) {
250
- t12 = /*#__PURE__*/_jsxs("span", {
58
+ children: [/*#__PURE__*/_jsxs("span", {
59
+ className: "locus-eyebrow",
60
+ children: ["#", position + 1]
61
+ }), /*#__PURE__*/_jsx("span", {
62
+ className: cn("truncate", attempt.failed && "text-muted-foreground"),
63
+ children: attempt.model ?? "Attempt"
64
+ }), attempt.failed && /*#__PURE__*/_jsx("span", {
65
+ className: "font-mono text-[11px] tracking-wide text-destructive uppercase",
66
+ children: "Failed"
67
+ })]
68
+ }), /*#__PURE__*/_jsxs("span", {
251
69
  className: "font-mono text-[11px] text-muted-foreground max-sm:hidden",
252
- children: [t10, " in \xB7 ", t11, " out"]
253
- });
254
- $[17] = t10;
255
- $[18] = t11;
256
- $[19] = t12;
257
- } else {
258
- t12 = $[19];
259
- }
260
- const t13 = attempt.failed && "text-muted-foreground line-through";
261
- let t14;
262
- if ($[20] !== t13) {
263
- t14 = cn("text-right font-mono text-xs", t13);
264
- $[20] = t13;
265
- $[21] = t14;
266
- } else {
267
- t14 = $[21];
268
- }
269
- let t15;
270
- if ($[22] !== attempt.costMicroUsd) {
271
- t15 = formatMicroUsd(attempt.costMicroUsd);
272
- $[22] = attempt.costMicroUsd;
273
- $[23] = t15;
274
- } else {
275
- t15 = $[23];
276
- }
277
- let t16;
278
- if ($[24] !== t14 || $[25] !== t15) {
279
- t16 = /*#__PURE__*/_jsx("span", {
280
- className: t14,
281
- children: t15
282
- });
283
- $[24] = t14;
284
- $[25] = t15;
285
- $[26] = t16;
286
- } else {
287
- t16 = $[26];
288
- }
289
- let t17;
290
- if ($[27] !== t1 || $[28] !== t12 || $[29] !== t16 || $[30] !== t9) {
291
- t17 = /*#__PURE__*/_jsxs("li", {
292
- "data-slot": "cost-attempt",
293
- "data-failed": t1,
294
- className: "grid grid-cols-[1fr_auto_4.5rem] items-baseline gap-x-4 px-5 py-2.5 text-sm tabular-nums",
295
- children: [t9, t12, t16]
296
- });
297
- $[27] = t1;
298
- $[28] = t12;
299
- $[29] = t16;
300
- $[30] = t9;
301
- $[31] = t17;
302
- } else {
303
- t17 = $[31];
304
- }
305
- return t17;
70
+ children: [formatCount(attempt.inputTokens), " in \xB7 ", formatCount(attempt.outputTokens), " out"]
71
+ }), /*#__PURE__*/_jsx("span", {
72
+ className: cn("text-right font-mono text-xs", attempt.failed && "text-muted-foreground line-through"),
73
+ children: formatMicroUsd(attempt.costMicroUsd)
74
+ })]
75
+ });
306
76
  }
307
- function DetailedCost(t0) {
308
- const $ = _c(36);
309
- const {
310
- attempts,
311
- totals,
312
- label,
313
- className
314
- } = t0;
77
+ function DetailedCost({
78
+ attempts,
79
+ totals,
80
+ label,
81
+ className
82
+ }) {
315
83
  const failed = totals.failedAttempts > 0;
316
- const t1 = failed || undefined;
317
- let t2;
318
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
319
- t2 = /*#__PURE__*/_jsx(CoinsIcon, {
320
- "aria-hidden": true
321
- });
322
- $[0] = t2;
323
- } else {
324
- t2 = $[0];
325
- }
326
- let t3;
327
- if ($[1] !== attempts.length) {
328
- t3 = pluralize(attempts.length, "attempt");
329
- $[1] = attempts.length;
330
- $[2] = t3;
331
- } else {
332
- t3 = $[2];
333
- }
334
- let t4;
335
- if ($[3] !== label || $[4] !== t3) {
336
- t4 = /*#__PURE__*/_jsx(PanelHeader, {
337
- icon: t2,
84
+ return /*#__PURE__*/_jsxs(ApprovalPanel, {
85
+ "data-slot": "cost",
86
+ "data-variant": "detailed",
87
+ "data-failed": failed || undefined,
88
+ "aria-label": label,
89
+ className: className,
90
+ children: [/*#__PURE__*/_jsx(PanelHeader, {
91
+ icon: /*#__PURE__*/_jsx(CoinsIcon, {
92
+ "aria-hidden": true
93
+ }),
338
94
  eyebrow: label,
339
- aside: t3
340
- });
341
- $[3] = label;
342
- $[4] = t3;
343
- $[5] = t4;
344
- } else {
345
- t4 = $[5];
346
- }
347
- let t5;
348
- if ($[6] !== totals.costMicroUsd) {
349
- t5 = formatMicroUsd(totals.costMicroUsd);
350
- $[6] = totals.costMicroUsd;
351
- $[7] = t5;
352
- } else {
353
- t5 = $[7];
354
- }
355
- let t6;
356
- if ($[8] !== t5) {
357
- t6 = /*#__PURE__*/_jsx("span", {
358
- className: "text-2xl font-semibold tracking-tight tabular-nums",
359
- children: t5
360
- });
361
- $[8] = t5;
362
- $[9] = t6;
363
- } else {
364
- t6 = $[9];
365
- }
366
- let t7;
367
- if ($[10] !== totals.inputTokens) {
368
- t7 = formatCount(totals.inputTokens);
369
- $[10] = totals.inputTokens;
370
- $[11] = t7;
371
- } else {
372
- t7 = $[11];
373
- }
374
- let t8;
375
- if ($[12] !== totals.outputTokens) {
376
- t8 = formatCount(totals.outputTokens);
377
- $[12] = totals.outputTokens;
378
- $[13] = t8;
379
- } else {
380
- t8 = $[13];
381
- }
382
- let t9;
383
- if ($[14] !== t7 || $[15] !== t8) {
384
- t9 = /*#__PURE__*/_jsxs("span", {
385
- children: [t7, " in \xB7 ", t8, " out"]
386
- });
387
- $[14] = t7;
388
- $[15] = t8;
389
- $[16] = t9;
390
- } else {
391
- t9 = $[16];
392
- }
393
- let t10;
394
- if ($[17] !== totals) {
395
- t10 = /*#__PURE__*/_jsx(WastedNote, {
396
- totals: totals
397
- });
398
- $[17] = totals;
399
- $[18] = t10;
400
- } else {
401
- t10 = $[18];
402
- }
403
- let t11;
404
- if ($[19] !== t10 || $[20] !== t9) {
405
- t11 = /*#__PURE__*/_jsxs("span", {
406
- className: "flex flex-wrap gap-x-3 gap-y-0.5 text-xs text-muted-foreground tabular-nums",
407
- children: [t9, t10]
408
- });
409
- $[19] = t10;
410
- $[20] = t9;
411
- $[21] = t11;
412
- } else {
413
- t11 = $[21];
414
- }
415
- let t12;
416
- if ($[22] !== t11 || $[23] !== t6) {
417
- t12 = /*#__PURE__*/_jsxs("div", {
95
+ aside: pluralize(attempts.length, "attempt")
96
+ }), /*#__PURE__*/_jsxs("div", {
418
97
  className: "flex flex-col gap-1 px-5 pt-2 pb-4",
419
- children: [t6, t11]
420
- });
421
- $[22] = t11;
422
- $[23] = t6;
423
- $[24] = t12;
424
- } else {
425
- t12 = $[24];
426
- }
427
- let t13;
428
- if ($[25] !== attempts) {
429
- t13 = attempts.map(_temp);
430
- $[25] = attempts;
431
- $[26] = t13;
432
- } else {
433
- t13 = $[26];
434
- }
435
- let t14;
436
- if ($[27] !== t13) {
437
- t14 = /*#__PURE__*/_jsx("ol", {
98
+ children: [/*#__PURE__*/_jsx("span", {
99
+ className: "text-2xl font-semibold tracking-tight tabular-nums",
100
+ children: formatMicroUsd(totals.costMicroUsd)
101
+ }), /*#__PURE__*/_jsxs("span", {
102
+ className: "flex flex-wrap gap-x-3 gap-y-0.5 text-xs text-muted-foreground tabular-nums",
103
+ children: [/*#__PURE__*/_jsxs("span", {
104
+ children: [formatCount(totals.inputTokens), " in \xB7 ", formatCount(totals.outputTokens), " out"]
105
+ }), /*#__PURE__*/_jsx(WastedNote, {
106
+ totals: totals
107
+ })]
108
+ })]
109
+ }), /*#__PURE__*/_jsx("ol", {
438
110
  className: "flex flex-col divide-y divide-border border-t border-border",
439
- children: t13
440
- });
441
- $[27] = t13;
442
- $[28] = t14;
443
- } else {
444
- t14 = $[28];
445
- }
446
- let t15;
447
- if ($[29] !== className || $[30] !== label || $[31] !== t1 || $[32] !== t12 || $[33] !== t14 || $[34] !== t4) {
448
- t15 = /*#__PURE__*/_jsxs(ApprovalPanel, {
449
- "data-slot": "cost",
450
- "data-variant": "detailed",
451
- "data-failed": t1,
452
- "aria-label": label,
453
- className: className,
454
- children: [t4, t12, t14]
455
- });
456
- $[29] = className;
457
- $[30] = label;
458
- $[31] = t1;
459
- $[32] = t12;
460
- $[33] = t14;
461
- $[34] = t4;
462
- $[35] = t15;
463
- } else {
464
- t15 = $[35];
465
- }
466
- return t15;
467
- }
468
- function _temp(attempt, position) {
469
- return /*#__PURE__*/_jsx(AttemptRow, {
470
- attempt: attempt,
471
- position: position
472
- }, position);
111
+ children: attempts.map((attempt, position) =>
112
+ /*#__PURE__*/
113
+ // biome-ignore lint/suspicious/noArrayIndexKey: attempts carry no id and keep their order
114
+ _jsx(AttemptRow, {
115
+ attempt: attempt,
116
+ position: position
117
+ }, position))
118
+ })]
119
+ });
473
120
  }
474
- export function Cost(t0) {
475
- const $ = _c(12);
476
- const {
477
- usage,
478
- variant: t1,
479
- label: t2,
480
- className
481
- } = t0;
482
- const variant = t1 === undefined ? "compact" : t1;
483
- const label = t2 === undefined ? "Run cost" : t2;
484
- let attempts;
485
- let t3;
486
- if ($[0] !== usage) {
487
- attempts = attemptsOf(usage);
488
- t3 = sumUsage(attempts);
489
- $[0] = usage;
490
- $[1] = attempts;
491
- $[2] = t3;
492
- } else {
493
- attempts = $[1];
494
- t3 = $[2];
495
- }
496
- const totals = t3;
121
+ export function Cost({
122
+ usage,
123
+ variant = "compact",
124
+ label = "Run cost",
125
+ className
126
+ }) {
127
+ const attempts = attemptsOf(usage);
128
+ const totals = sumUsage(attempts);
497
129
  if (variant === "detailed") {
498
- let t4;
499
- if ($[3] !== attempts || $[4] !== className || $[5] !== label || $[6] !== totals) {
500
- t4 = /*#__PURE__*/_jsx(DetailedCost, {
501
- attempts: attempts,
502
- totals: totals,
503
- label: label,
504
- className: className
505
- });
506
- $[3] = attempts;
507
- $[4] = className;
508
- $[5] = label;
509
- $[6] = totals;
510
- $[7] = t4;
511
- } else {
512
- t4 = $[7];
513
- }
514
- return t4;
515
- }
516
- let t4;
517
- if ($[8] !== attempts || $[9] !== className || $[10] !== totals) {
518
- t4 = /*#__PURE__*/_jsx(CompactCost, {
130
+ return /*#__PURE__*/_jsx(DetailedCost, {
519
131
  attempts: attempts,
520
132
  totals: totals,
133
+ label: label,
521
134
  className: className
522
135
  });
523
- $[8] = attempts;
524
- $[9] = className;
525
- $[10] = totals;
526
- $[11] = t4;
527
- } else {
528
- t4 = $[11];
529
136
  }
530
- return t4;
137
+ return /*#__PURE__*/_jsx(CompactCost, {
138
+ attempts: attempts,
139
+ totals: totals,
140
+ className: className
141
+ });
531
142
  }