@locusgraph/loop 0.2.0 → 0.2.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 (68) 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/tool/json-block.js +11 -31
  12. package/dist/agent/tool/tool-status.js +12 -35
  13. package/dist/approval/inbox/inbox-row.js +76 -301
  14. package/dist/approval/inbox/inbox.js +39 -190
  15. package/dist/approval/inbox/virtual-inbox-list.js +26 -102
  16. package/dist/approval/memory/memory-review.js +36 -170
  17. package/dist/approval/memory/memory-row.js +50 -185
  18. package/dist/approval/plan/plan-review.js +73 -223
  19. package/dist/approval/plan/plan-step-row.js +76 -180
  20. package/dist/approval/plan/question-choices.js +44 -130
  21. package/dist/approval/plan/question.js +38 -154
  22. package/dist/approval/run/run-bar.js +39 -123
  23. package/dist/approval/shared/risk-badge.js +9 -24
  24. package/dist/approval/shared/use-focus-on-mount.js +5 -21
  25. package/dist/approval/spend/raise-cap-form.js +48 -221
  26. package/dist/approval/spend/spend-gate.js +40 -155
  27. package/dist/approval/spend/spend-meter.js +85 -312
  28. package/dist/approval/tool/approval.js +35 -194
  29. package/dist/approval/tool/args/args-editor.js +46 -204
  30. package/dist/approval/tool/args/args-field.js +55 -238
  31. package/dist/approval/tool/deny-form.js +36 -123
  32. package/dist/approval/tool/tool-inputs.js +23 -88
  33. package/dist/chat/chat/use-stick-to-bottom.js +60 -113
  34. package/dist/chat/chat/virtual-chat-items.js +34 -127
  35. package/dist/chat/composer/composer-actions.js +46 -129
  36. package/dist/chat/composer/use-auto-grow.js +8 -23
  37. package/dist/chat/files/files.js +66 -291
  38. package/dist/chat/reply/fenced-code.js +10 -32
  39. package/dist/chat/reply/reply.js +24 -99
  40. package/dist/chat/turn/turn.js +46 -197
  41. package/dist/cost/context.js +65 -282
  42. package/dist/cost/cost-steps.js +42 -195
  43. package/dist/cost/cost.js +108 -497
  44. package/dist/cost/model-picker.js +42 -172
  45. package/dist/cost/shared/context-breakdown.js +64 -280
  46. package/dist/cost/shared/meter-marks.js +34 -92
  47. package/dist/cost/shared/model-option-row.js +35 -158
  48. package/dist/cost/shared/step-cost-row.js +37 -222
  49. package/dist/memory/cite.js +58 -179
  50. package/dist/memory/memorized.js +42 -194
  51. package/dist/memory/recall.js +68 -263
  52. package/dist/memory/shared/source-mark.js +10 -38
  53. package/dist/memory/sources.js +52 -230
  54. package/dist/shared/decision-summary.js +35 -117
  55. package/dist/shared/panel-empty.js +15 -73
  56. package/dist/shared/panel.js +65 -239
  57. package/dist/shared/status-dot.js +10 -32
  58. package/dist/thread/actions/action-button.js +10 -53
  59. package/dist/thread/actions/branch-switcher.js +21 -95
  60. package/dist/thread/canvas/version-switcher.js +31 -126
  61. package/dist/thread/code/copy-code-button.js +24 -56
  62. package/dist/thread/history/row/history-row.js +18 -97
  63. package/dist/thread/history/row/thread-item-menu.js +19 -72
  64. package/dist/thread/history/row/thread-title-editor.js +29 -72
  65. package/dist/thread/history/virtual-history-list.js +46 -82
  66. package/dist/thread/starters/starters.js +27 -87
  67. package/dist/thread/use-copied.js +10 -38
  68. package/package.json +3 -3
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "@locusgraph/components";
3
2
  import { formatMicroUsd } from "@locusgraph/utils";
4
3
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -36,45 +35,16 @@ function labelAlignment(position) {
36
35
  if (position < 20) return "";
37
36
  return "-translate-x-1/2";
38
37
  }
39
- function Amount(t0) {
40
- const $ = _c(7);
41
- const {
42
- value,
43
- muted
44
- } = t0;
45
- const t1 = !muted && "text-foreground";
46
- let t2;
47
- if ($[0] !== t1) {
48
- t2 = cn("font-medium", t1);
49
- $[0] = t1;
50
- $[1] = t2;
51
- } else {
52
- t2 = $[1];
53
- }
54
- let t3;
55
- if ($[2] !== value) {
56
- t3 = formatMicroUsd(value);
57
- $[2] = value;
58
- $[3] = t3;
59
- } else {
60
- t3 = $[3];
61
- }
62
- let t4;
63
- if ($[4] !== t2 || $[5] !== t3) {
64
- t4 = /*#__PURE__*/_jsx("span", {
65
- className: t2,
66
- children: t3
67
- });
68
- $[4] = t2;
69
- $[5] = t3;
70
- $[6] = t4;
71
- } else {
72
- t4 = $[6];
73
- }
74
- return t4;
38
+ function Amount({
39
+ value,
40
+ muted
41
+ }) {
42
+ return /*#__PURE__*/_jsx("span", {
43
+ className: cn("font-medium", !muted && "text-foreground"),
44
+ children: formatMicroUsd(value)
45
+ });
75
46
  }
76
47
  function MeterLegend(props) {
77
- const $ = _c(7);
78
48
  const {
79
49
  spentMicroUsd,
80
50
  estimateMicroUsd,
@@ -83,295 +53,98 @@ function MeterLegend(props) {
83
53
  outOfCredits,
84
54
  muted
85
55
  } = props;
86
- let t0;
87
- if ($[0] !== balanceMicroUsd || $[1] !== capMicroUsd || $[2] !== estimateMicroUsd || $[3] !== muted || $[4] !== outOfCredits || $[5] !== spentMicroUsd) {
88
- t0 = /*#__PURE__*/_jsx("div", {
89
- className: "flex flex-wrap justify-between gap-x-4 gap-y-1 text-xs text-muted-foreground tabular-nums",
90
- children: outOfCredits ? /*#__PURE__*/_jsxs(_Fragment, {
91
- children: [/*#__PURE__*/_jsxs("span", {
92
- children: ["Next step needs ", /*#__PURE__*/_jsx(Amount, {
93
- value: estimateMicroUsd,
94
- muted: muted
95
- }), ", you have", " ", /*#__PURE__*/_jsx("span", {
96
- className: cn("font-medium", !muted && "text-destructive"),
97
- children: formatMicroUsd(balanceMicroUsd)
98
- }), " ", "in credits"]
99
- }), /*#__PURE__*/_jsxs("span", {
100
- children: [formatMicroUsd(spentMicroUsd), " spent this run"]
101
- })]
102
- }) : /*#__PURE__*/_jsxs(_Fragment, {
103
- children: [/*#__PURE__*/_jsxs("span", {
104
- children: [/*#__PURE__*/_jsx(Amount, {
105
- value: spentMicroUsd,
106
- muted: muted
107
- }), " spent of a", " ", /*#__PURE__*/_jsx(Amount, {
108
- value: capMicroUsd,
109
- muted: muted
110
- }), " cap"]
111
- }), /*#__PURE__*/_jsxs("span", {
112
- children: [formatMicroUsd(balanceMicroUsd), " credits left"]
113
- })]
114
- })
115
- });
116
- $[0] = balanceMicroUsd;
117
- $[1] = capMicroUsd;
118
- $[2] = estimateMicroUsd;
119
- $[3] = muted;
120
- $[4] = outOfCredits;
121
- $[5] = spentMicroUsd;
122
- $[6] = t0;
123
- } else {
124
- t0 = $[6];
125
- }
126
- return t0;
56
+ return /*#__PURE__*/_jsx("div", {
57
+ className: "flex flex-wrap justify-between gap-x-4 gap-y-1 text-xs text-muted-foreground tabular-nums",
58
+ children: outOfCredits ? /*#__PURE__*/_jsxs(_Fragment, {
59
+ children: [/*#__PURE__*/_jsxs("span", {
60
+ children: ["Next step needs ", /*#__PURE__*/_jsx(Amount, {
61
+ value: estimateMicroUsd,
62
+ muted: muted
63
+ }), ", you have", " ", /*#__PURE__*/_jsx("span", {
64
+ className: cn("font-medium", !muted && "text-destructive"),
65
+ children: formatMicroUsd(balanceMicroUsd)
66
+ }), " ", "in credits"]
67
+ }), /*#__PURE__*/_jsxs("span", {
68
+ children: [formatMicroUsd(spentMicroUsd), " spent this run"]
69
+ })]
70
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
71
+ children: [/*#__PURE__*/_jsxs("span", {
72
+ children: [/*#__PURE__*/_jsx(Amount, {
73
+ value: spentMicroUsd,
74
+ muted: muted
75
+ }), " spent of a", " ", /*#__PURE__*/_jsx(Amount, {
76
+ value: capMicroUsd,
77
+ muted: muted
78
+ }), " cap"]
79
+ }), /*#__PURE__*/_jsxs("span", {
80
+ children: [formatMicroUsd(balanceMicroUsd), " credits left"]
81
+ })]
82
+ })
83
+ });
127
84
  }
128
85
  export function SpendMeter(props) {
129
- const $ = _c(58);
130
86
  const {
131
87
  outOfCredits,
132
- muted: t0
88
+ muted = false
133
89
  } = props;
134
- const muted = t0 === undefined ? false : t0;
135
- let baseWidth;
136
- let estimateWidth;
137
- let limitPosition;
138
- let t1;
139
- let t10;
140
- let t11;
141
- let t2;
142
- let t3;
143
- let t4;
144
- let t5;
145
- let t6;
146
- let t7;
147
- let t8;
148
- let t9;
149
- if ($[0] !== outOfCredits || $[1] !== props) {
150
- const {
151
- base,
152
- extra,
153
- scale,
154
- limit,
155
- limitLabel
156
- } = meterFrame(props);
157
- baseWidth = percentOf(base, scale);
158
- estimateWidth = percentOf(extra, scale);
159
- limitPosition = percentOf(limit, scale);
160
- const projected = base + extra;
161
- t9 = "spend-meter";
162
- t10 = "flex flex-col gap-1.5";
163
- const t12 = `${limitPosition}%`;
164
- let t13;
165
- if ($[16] !== t12) {
166
- t13 = {
167
- left: t12
168
- };
169
- $[16] = t12;
170
- $[17] = t13;
171
- } else {
172
- t13 = $[17];
173
- }
174
- t11 = /*#__PURE__*/_jsx("div", {
90
+ const {
91
+ base,
92
+ extra,
93
+ scale,
94
+ limit,
95
+ limitLabel
96
+ } = meterFrame(props);
97
+ const baseWidth = percentOf(base, scale);
98
+ const estimateWidth = percentOf(extra, scale);
99
+ const limitPosition = percentOf(limit, scale);
100
+ const projected = base + extra;
101
+ return /*#__PURE__*/_jsxs("div", {
102
+ "data-slot": "spend-meter",
103
+ className: "flex flex-col gap-1.5",
104
+ children: [/*#__PURE__*/_jsx("div", {
175
105
  "aria-hidden": true,
176
106
  className: "relative h-4",
177
107
  children: /*#__PURE__*/_jsxs("span", {
178
108
  className: cn("eyebrow absolute bottom-0 whitespace-nowrap", labelAlignment(limitPosition)),
179
- style: t13,
109
+ style: {
110
+ left: `${limitPosition}%`
111
+ },
180
112
  children: [limitLabel, " ", formatMicroUsd(limit)]
181
113
  })
182
- });
183
- t4 = "meter";
184
- t5 = outOfCredits ? "Next step against your credits" : "Run spend against its cap";
185
- t6 = 0;
186
- t7 = scale;
187
- t8 = projected;
188
- if ($[18] !== projected) {
189
- t1 = formatMicroUsd(projected);
190
- $[18] = projected;
191
- $[19] = t1;
192
- } else {
193
- t1 = $[19];
194
- }
195
- if ($[20] !== limitLabel) {
196
- t2 = limitLabel.toLowerCase();
197
- $[20] = limitLabel;
198
- $[21] = t2;
199
- } else {
200
- t2 = $[21];
201
- }
202
- t3 = formatMicroUsd(limit);
203
- $[0] = outOfCredits;
204
- $[1] = props;
205
- $[2] = baseWidth;
206
- $[3] = estimateWidth;
207
- $[4] = limitPosition;
208
- $[5] = t1;
209
- $[6] = t10;
210
- $[7] = t11;
211
- $[8] = t2;
212
- $[9] = t3;
213
- $[10] = t4;
214
- $[11] = t5;
215
- $[12] = t6;
216
- $[13] = t7;
217
- $[14] = t8;
218
- $[15] = t9;
219
- } else {
220
- baseWidth = $[2];
221
- estimateWidth = $[3];
222
- limitPosition = $[4];
223
- t1 = $[5];
224
- t10 = $[6];
225
- t11 = $[7];
226
- t2 = $[8];
227
- t3 = $[9];
228
- t4 = $[10];
229
- t5 = $[11];
230
- t6 = $[12];
231
- t7 = $[13];
232
- t8 = $[14];
233
- t9 = $[15];
234
- }
235
- const t12 = `${t1} after the next step, ${t2} ${t3}`;
236
- const t13 = muted ? "bg-muted-foreground/40" : "bg-foreground/70";
237
- let t14;
238
- if ($[22] !== t13) {
239
- t14 = cn("absolute inset-y-0 left-0", t13);
240
- $[22] = t13;
241
- $[23] = t14;
242
- } else {
243
- t14 = $[23];
244
- }
245
- const t15 = `${baseWidth}%`;
246
- let t16;
247
- if ($[24] !== t15) {
248
- t16 = {
249
- width: t15
250
- };
251
- $[24] = t15;
252
- $[25] = t16;
253
- } else {
254
- t16 = $[25];
255
- }
256
- let t17;
257
- if ($[26] !== t14 || $[27] !== t16) {
258
- t17 = /*#__PURE__*/_jsx("span", {
259
- "aria-hidden": true,
260
- className: t14,
261
- style: t16
262
- });
263
- $[26] = t14;
264
- $[27] = t16;
265
- $[28] = t17;
266
- } else {
267
- t17 = $[28];
268
- }
269
- const t18 = muted ? "bg-muted-foreground/25" : outOfCredits ? "bg-destructive" : "bg-warn";
270
- let t19;
271
- if ($[29] !== t18) {
272
- t19 = cn("absolute inset-y-0", t18);
273
- $[29] = t18;
274
- $[30] = t19;
275
- } else {
276
- t19 = $[30];
277
- }
278
- const t20 = `${baseWidth}%`;
279
- const t21 = `${estimateWidth}%`;
280
- let t22;
281
- if ($[31] !== t20 || $[32] !== t21) {
282
- t22 = {
283
- left: t20,
284
- width: t21
285
- };
286
- $[31] = t20;
287
- $[32] = t21;
288
- $[33] = t22;
289
- } else {
290
- t22 = $[33];
291
- }
292
- let t23;
293
- if ($[34] !== t19 || $[35] !== t22) {
294
- t23 = /*#__PURE__*/_jsx("span", {
295
- "aria-hidden": true,
296
- className: t19,
297
- style: t22
298
- });
299
- $[34] = t19;
300
- $[35] = t22;
301
- $[36] = t23;
302
- } else {
303
- t23 = $[36];
304
- }
305
- const t24 = `${limitPosition}%`;
306
- let t25;
307
- if ($[37] !== t24) {
308
- t25 = /*#__PURE__*/_jsx("span", {
309
- "aria-hidden": true,
310
- className: "absolute -inset-y-1 -ml-px w-px bg-foreground",
311
- style: {
312
- left: t24
313
- }
314
- });
315
- $[37] = t24;
316
- $[38] = t25;
317
- } else {
318
- t25 = $[38];
319
- }
320
- let t26;
321
- if ($[39] !== t12 || $[40] !== t17 || $[41] !== t23 || $[42] !== t25 || $[43] !== t4 || $[44] !== t5 || $[45] !== t6 || $[46] !== t7 || $[47] !== t8) {
322
- t26 = /*#__PURE__*/_jsxs("div", {
323
- role: t4,
324
- "aria-label": t5,
325
- "aria-valuemin": t6,
326
- "aria-valuemax": t7,
327
- "aria-valuenow": t8,
328
- "aria-valuetext": t12,
114
+ }), /*#__PURE__*/_jsxs("div", {
115
+ role: "meter",
116
+ "aria-label": outOfCredits ? "Next step against your credits" : "Run spend against its cap",
117
+ "aria-valuemin": 0,
118
+ "aria-valuemax": scale,
119
+ "aria-valuenow": projected,
120
+ "aria-valuetext": `${formatMicroUsd(projected)} after the next step, ${limitLabel.toLowerCase()} ${formatMicroUsd(limit)}`,
329
121
  className: "relative h-1.5 bg-muted-foreground/20",
330
- children: [t17, t23, t25]
331
- });
332
- $[39] = t12;
333
- $[40] = t17;
334
- $[41] = t23;
335
- $[42] = t25;
336
- $[43] = t4;
337
- $[44] = t5;
338
- $[45] = t6;
339
- $[46] = t7;
340
- $[47] = t8;
341
- $[48] = t26;
342
- } else {
343
- t26 = $[48];
344
- }
345
- let t27;
346
- if ($[49] !== muted || $[50] !== props) {
347
- t27 = /*#__PURE__*/_jsx("div", {
122
+ children: [/*#__PURE__*/_jsx("span", {
123
+ "aria-hidden": true,
124
+ className: cn("absolute inset-y-0 left-0", muted ? "bg-muted-foreground/40" : "bg-foreground/70"),
125
+ style: {
126
+ width: `${baseWidth}%`
127
+ }
128
+ }), /*#__PURE__*/_jsx("span", {
129
+ "aria-hidden": true,
130
+ className: cn("absolute inset-y-0", muted ? "bg-muted-foreground/25" : outOfCredits ? "bg-destructive" : "bg-warn"),
131
+ style: {
132
+ left: `${baseWidth}%`,
133
+ width: `${estimateWidth}%`
134
+ }
135
+ }), /*#__PURE__*/_jsx("span", {
136
+ "aria-hidden": true,
137
+ className: "absolute -inset-y-1 -ml-px w-px bg-foreground",
138
+ style: {
139
+ left: `${limitPosition}%`
140
+ }
141
+ })]
142
+ }), /*#__PURE__*/_jsx("div", {
348
143
  className: "pt-0.5",
349
144
  children: /*#__PURE__*/_jsx(MeterLegend, {
350
145
  ...props,
351
146
  muted: muted
352
147
  })
353
- });
354
- $[49] = muted;
355
- $[50] = props;
356
- $[51] = t27;
357
- } else {
358
- t27 = $[51];
359
- }
360
- let t28;
361
- if ($[52] !== t10 || $[53] !== t11 || $[54] !== t26 || $[55] !== t27 || $[56] !== t9) {
362
- t28 = /*#__PURE__*/_jsxs("div", {
363
- "data-slot": t9,
364
- className: t10,
365
- children: [t11, t26, t27]
366
- });
367
- $[52] = t10;
368
- $[53] = t11;
369
- $[54] = t26;
370
- $[55] = t27;
371
- $[56] = t9;
372
- $[57] = t28;
373
- } else {
374
- t28 = $[57];
375
- }
376
- return t28;
148
+ })]
149
+ });
377
150
  }
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { ShieldAlert as ShieldAlertIcon, Tools as WrenchIcon } from "@carbon/icons-react";
3
2
  import { Button, cn } from "@locusgraph/components";
4
3
  import { useState } from "react";
@@ -39,125 +38,45 @@ function headerStatus(awaiting, decision) {
39
38
  function decidedResult(toolName, state, decision) {
40
39
  return settledStateLabels[state] ?? `${toolName} ${decision.approved ? "approved" : "denied"}`;
41
40
  }
42
- export function Approval(t0) {
43
- const $ = _c(64);
44
- const {
45
- part,
46
- risk: t1,
47
- actionLabel,
48
- description,
49
- decision,
50
- onApprove,
51
- onDeny,
52
- autoFocus: t2,
53
- className
54
- } = t0;
55
- const risk = t1 === undefined ? "write" : t1;
56
- const autoFocus = t2 === undefined ? true : t2;
41
+ export function Approval({
42
+ part,
43
+ risk = "write",
44
+ actionLabel,
45
+ description,
46
+ decision,
47
+ onApprove,
48
+ onDeny,
49
+ autoFocus = true,
50
+ className
51
+ }) {
57
52
  const [denying, setDenying] = useState(false);
58
- let t3;
59
- if ($[0] !== part) {
60
- t3 = toolNameOf(part);
61
- $[0] = part;
62
- $[1] = t3;
63
- } else {
64
- t3 = $[1];
65
- }
66
- const toolName = t3;
53
+ const toolName = toolNameOf(part);
67
54
  const awaiting = !decision && part.state === "approval-requested";
68
55
  const approveRef = useFocusOnMount(autoFocus && awaiting);
69
56
  const destructive = risk === "destructive";
70
57
  const Icon = destructive ? ShieldAlertIcon : WrenchIcon;
71
- let t4;
72
- if ($[2] !== awaiting || $[3] !== decision) {
73
- t4 = headerStatus(awaiting, decision);
74
- $[2] = awaiting;
75
- $[3] = decision;
76
- $[4] = t4;
77
- } else {
78
- t4 = $[4];
79
- }
80
- const header = t4;
81
- const t5 = decision ? decision.approved ? "approved" : "denied" : part.state;
82
- const t6 = `Approve ${toolName}`;
83
- const t7 = awaiting && riskRing[risk];
84
- let t8;
85
- if ($[5] !== className || $[6] !== t7) {
86
- t8 = cn(t7, className);
87
- $[5] = className;
88
- $[6] = t7;
89
- $[7] = t8;
90
- } else {
91
- t8 = $[7];
92
- }
93
- let t9;
94
- if ($[8] !== Icon) {
95
- t9 = /*#__PURE__*/_jsx(Icon, {
96
- "aria-hidden": true
97
- });
98
- $[8] = Icon;
99
- $[9] = t9;
100
- } else {
101
- t9 = $[9];
102
- }
103
- const t10 = awaiting ? "Approval needed" : "Tool call";
104
- const t11 = riskLabels[risk];
105
- let t12;
106
- if ($[10] !== header.status || $[11] !== header.tone || $[12] !== t10 || $[13] !== t11 || $[14] !== t9) {
107
- t12 = /*#__PURE__*/_jsx(PanelHeader, {
108
- icon: t9,
109
- eyebrow: t10,
110
- aside: t11,
58
+ const header = headerStatus(awaiting, decision);
59
+ return /*#__PURE__*/_jsxs(ApprovalPanel, {
60
+ "data-slot": "approval",
61
+ "data-risk": risk,
62
+ "data-state": decision ? decision.approved ? "approved" : "denied" : part.state,
63
+ "aria-label": `Approve ${toolName}`,
64
+ className: cn(awaiting && riskRing[risk], className),
65
+ children: [/*#__PURE__*/_jsx(PanelHeader, {
66
+ icon: /*#__PURE__*/_jsx(Icon, {
67
+ "aria-hidden": true
68
+ }),
69
+ eyebrow: awaiting ? "Approval needed" : "Tool call",
70
+ aside: riskLabels[risk],
111
71
  status: header.status,
112
72
  tone: header.tone
113
- });
114
- $[10] = header.status;
115
- $[11] = header.tone;
116
- $[12] = t10;
117
- $[13] = t11;
118
- $[14] = t9;
119
- $[15] = t12;
120
- } else {
121
- t12 = $[15];
122
- }
123
- const t13 = !awaiting && "text-muted-foreground";
124
- let t14;
125
- if ($[16] !== t13) {
126
- t14 = cn("truncate font-mono", t13);
127
- $[16] = t13;
128
- $[17] = t14;
129
- } else {
130
- t14 = $[17];
131
- }
132
- let t15;
133
- if ($[18] !== t14 || $[19] !== toolName) {
134
- t15 = /*#__PURE__*/_jsx(PanelTitle, {
135
- className: t14,
73
+ }), /*#__PURE__*/_jsx(PanelTitle, {
74
+ className: cn("truncate font-mono", !awaiting && "text-muted-foreground"),
136
75
  children: toolName
137
- });
138
- $[18] = t14;
139
- $[19] = toolName;
140
- $[20] = t15;
141
- } else {
142
- t15 = $[20];
143
- }
144
- let t16;
145
- if ($[21] !== awaiting || $[22] !== description || $[23] !== risk || $[24] !== toolName) {
146
- t16 = awaiting && /*#__PURE__*/_jsx("p", {
76
+ }), awaiting && /*#__PURE__*/_jsx("p", {
147
77
  className: "px-5 pt-1 text-sm text-muted-foreground",
148
78
  children: description ?? riskCopy[risk](toolName)
149
- });
150
- $[21] = awaiting;
151
- $[22] = description;
152
- $[23] = risk;
153
- $[24] = toolName;
154
- $[25] = t16;
155
- } else {
156
- t16 = $[25];
157
- }
158
- let t17;
159
- if ($[26] !== actionLabel || $[27] !== approveRef || $[28] !== awaiting || $[29] !== denying || $[30] !== destructive || $[31] !== onApprove || $[32] !== part || $[33] !== toolName) {
160
- t17 = awaiting && !denying && /*#__PURE__*/_jsxs(_Fragment, {
79
+ }), awaiting && !denying && /*#__PURE__*/_jsxs(_Fragment, {
161
80
  children: [/*#__PURE__*/_jsx(PanelBody, {
162
81
  children: /*#__PURE__*/_jsx(ToolInputs, {
163
82
  input: part.input
@@ -185,22 +104,7 @@ export function Approval(t0) {
185
104
  })]
186
105
  })]
187
106
  })]
188
- });
189
- $[26] = actionLabel;
190
- $[27] = approveRef;
191
- $[28] = awaiting;
192
- $[29] = denying;
193
- $[30] = destructive;
194
- $[31] = onApprove;
195
- $[32] = part;
196
- $[33] = toolName;
197
- $[34] = t17;
198
- } else {
199
- t17 = $[34];
200
- }
201
- let t18;
202
- if ($[35] !== awaiting || $[36] !== denying || $[37] !== onDeny || $[38] !== part) {
203
- t18 = awaiting && denying && /*#__PURE__*/_jsxs(_Fragment, {
107
+ }), awaiting && denying && /*#__PURE__*/_jsxs(_Fragment, {
204
108
  children: [/*#__PURE__*/_jsx(PanelBody, {
205
109
  className: "pb-4",
206
110
  children: /*#__PURE__*/_jsx(ToolInputs, {
@@ -211,18 +115,7 @@ export function Approval(t0) {
211
115
  onDeny: onDeny,
212
116
  onBack: () => setDenying(false)
213
117
  })]
214
- });
215
- $[35] = awaiting;
216
- $[36] = denying;
217
- $[37] = onDeny;
218
- $[38] = part;
219
- $[39] = t18;
220
- } else {
221
- t18 = $[39];
222
- }
223
- let t19;
224
- if ($[40] !== awaiting || $[41] !== decision || $[42] !== part || $[43] !== toolName) {
225
- t19 = !awaiting && /*#__PURE__*/_jsx(PanelBody, {
118
+ }), !awaiting && /*#__PURE__*/_jsx(PanelBody, {
226
119
  className: "pt-3",
227
120
  children: decision ? /*#__PURE__*/_jsx(DecisionSummary, {
228
121
  decision: decision,
@@ -231,60 +124,8 @@ export function Approval(t0) {
231
124
  className: "text-sm text-muted-foreground",
232
125
  children: settledLabel(part.state)
233
126
  })
234
- });
235
- $[40] = awaiting;
236
- $[41] = decision;
237
- $[42] = part;
238
- $[43] = toolName;
239
- $[44] = t19;
240
- } else {
241
- t19 = $[44];
242
- }
243
- let t20;
244
- if ($[45] !== awaiting || $[46] !== decision || $[47] !== part || $[48] !== toolName) {
245
- t20 = decision ? `${toolName} ${decision.approved ? "approved" : "denied"} by ${decision.by}` : awaiting ? `${toolName} is waiting for your approval` : settledLabel(part.state);
246
- $[45] = awaiting;
247
- $[46] = decision;
248
- $[47] = part;
249
- $[48] = toolName;
250
- $[49] = t20;
251
- } else {
252
- t20 = $[49];
253
- }
254
- let t21;
255
- if ($[50] !== t20) {
256
- t21 = /*#__PURE__*/_jsx(LiveStatus, {
257
- message: t20
258
- });
259
- $[50] = t20;
260
- $[51] = t21;
261
- } else {
262
- t21 = $[51];
263
- }
264
- let t22;
265
- if ($[52] !== risk || $[53] !== t12 || $[54] !== t15 || $[55] !== t16 || $[56] !== t17 || $[57] !== t18 || $[58] !== t19 || $[59] !== t21 || $[60] !== t5 || $[61] !== t6 || $[62] !== t8) {
266
- t22 = /*#__PURE__*/_jsxs(ApprovalPanel, {
267
- "data-slot": "approval",
268
- "data-risk": risk,
269
- "data-state": t5,
270
- "aria-label": t6,
271
- className: t8,
272
- children: [t12, t15, t16, t17, t18, t19, t21]
273
- });
274
- $[52] = risk;
275
- $[53] = t12;
276
- $[54] = t15;
277
- $[55] = t16;
278
- $[56] = t17;
279
- $[57] = t18;
280
- $[58] = t19;
281
- $[59] = t21;
282
- $[60] = t5;
283
- $[61] = t6;
284
- $[62] = t8;
285
- $[63] = t22;
286
- } else {
287
- t22 = $[63];
288
- }
289
- return t22;
127
+ }), /*#__PURE__*/_jsx(LiveStatus, {
128
+ message: decision ? `${toolName} ${decision.approved ? "approved" : "denied"} by ${decision.by}` : awaiting ? `${toolName} is waiting for your approval` : settledLabel(part.state)
129
+ })]
130
+ });
290
131
  }