@locusgraph/loop 0.3.0 → 0.4.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 (130) hide show
  1. package/dist/agent/index.d.ts +1 -1
  2. package/dist/agent/pulse/gradient-label.js +70 -17
  3. package/dist/agent/pulse/marks/bars-mark.js +39 -15
  4. package/dist/agent/pulse/marks/glyph-mark.js +57 -16
  5. package/dist/agent/pulse/marks/locus-mark.js +39 -13
  6. package/dist/agent/pulse/marks/orb-mark.js +21 -9
  7. package/dist/agent/pulse/pulse.js +1 -1
  8. package/dist/agent/pulse/use-loop-animation.d.ts +0 -1
  9. package/dist/agent/pulse/use-loop-animation.js +36 -15
  10. package/dist/agent/steps/step-icon.js +20 -13
  11. package/dist/agent/steps/steps.js +39 -37
  12. package/dist/agent/thinking/thinking.js +65 -62
  13. package/dist/agent/tool/json-block.js +10 -7
  14. package/dist/agent/tool/tool-status.d.ts +2 -0
  15. package/dist/agent/tool/tool-status.js +16 -13
  16. package/dist/agent/tool/tool.d.ts +8 -1
  17. package/dist/agent/tool/tool.js +238 -119
  18. package/dist/approval/inbox/inbox-row.d.ts +3 -3
  19. package/dist/approval/inbox/inbox-row.js +248 -86
  20. package/dist/approval/inbox/inbox.d.ts +3 -3
  21. package/dist/approval/inbox/inbox.js +251 -57
  22. package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
  23. package/dist/approval/inbox/virtual-inbox-list.js +107 -30
  24. package/dist/approval/memory/memory-review.js +228 -91
  25. package/dist/approval/memory/memory-row.js +192 -56
  26. package/dist/approval/plan/plan-review.js +241 -108
  27. package/dist/approval/plan/plan-step-row.js +184 -77
  28. package/dist/approval/plan/plan-steps.d.ts +1 -1
  29. package/dist/approval/plan/plan-steps.js +2 -2
  30. package/dist/approval/plan/question-choices.js +139 -48
  31. package/dist/approval/plan/question.js +189 -67
  32. package/dist/approval/run/run-bar.js +138 -49
  33. package/dist/approval/shared/approval-line.d.ts +27 -0
  34. package/dist/approval/shared/approval-line.js +85 -0
  35. package/dist/approval/shared/risk-badge.d.ts +3 -5
  36. package/dist/approval/shared/risk-badge.js +11 -19
  37. package/dist/approval/shared/time.d.ts +0 -1
  38. package/dist/approval/shared/time.js +0 -1
  39. package/dist/approval/shared/use-focus-on-mount.js +23 -5
  40. package/dist/approval/shared/use-focus-when-settled.d.ts +2 -0
  41. package/dist/approval/shared/use-focus-when-settled.js +18 -0
  42. package/dist/approval/spend/raise-cap-form.d.ts +2 -2
  43. package/dist/approval/spend/raise-cap-form.js +235 -52
  44. package/dist/approval/spend/spend-gate.js +200 -106
  45. package/dist/approval/spend/spend-math.d.ts +1 -0
  46. package/dist/approval/spend/spend-math.js +5 -2
  47. package/dist/approval/spend/spend-meter.js +5 -5
  48. package/dist/approval/tool/approval.js +157 -96
  49. package/dist/approval/tool/args/args-editor.js +232 -81
  50. package/dist/approval/tool/args/args-field.js +333 -60
  51. package/dist/approval/tool/deny-form.js +114 -32
  52. package/dist/approval/tool/tool-inputs.js +93 -33
  53. package/dist/chat/chat/chat.js +5 -4
  54. package/dist/chat/chat/use-stick-to-bottom.js +116 -63
  55. package/dist/chat/chat/virtual-chat-items.js +129 -34
  56. package/dist/chat/composer/composer-actions.d.ts +1 -2
  57. package/dist/chat/composer/composer-actions.js +136 -50
  58. package/dist/chat/composer/composer-status.d.ts +2 -0
  59. package/dist/chat/composer/composer-status.js +3 -0
  60. package/dist/chat/composer/composer.d.ts +1 -1
  61. package/dist/chat/composer/composer.js +6 -4
  62. package/dist/chat/composer/use-auto-grow.js +29 -8
  63. package/dist/chat/files/files.js +296 -67
  64. package/dist/chat/index.d.ts +1 -1
  65. package/dist/chat/index.js +1 -1
  66. package/dist/chat/reply/fenced-code.js +1 -1
  67. package/dist/chat/reply/markdown-components.js +9 -116
  68. package/dist/chat/reply/reply.js +2 -2
  69. package/dist/chat/turn/group-parts.d.ts +1 -0
  70. package/dist/chat/turn/group-parts.js +6 -3
  71. package/dist/chat/turn/turn.js +13 -4
  72. package/dist/cost/context.js +3 -3
  73. package/dist/cost/cost-steps.js +31 -30
  74. package/dist/cost/cost.js +39 -39
  75. package/dist/cost/model-picker.js +176 -43
  76. package/dist/cost/shared/context-breakdown.js +10 -11
  77. package/dist/cost/shared/model-option-row.js +4 -3
  78. package/dist/cost/shared/step-cost-row.js +11 -12
  79. package/dist/cost/shared/usage-totals.d.ts +1 -0
  80. package/dist/cost/shared/usage-totals.js +19 -1
  81. package/dist/memory/cite.js +190 -59
  82. package/dist/memory/memorized.js +231 -62
  83. package/dist/memory/recall.js +272 -85
  84. package/dist/memory/shared/host-label.d.ts +1 -1
  85. package/dist/memory/shared/host-label.js +2 -2
  86. package/dist/memory/shared/source-mark.js +1 -1
  87. package/dist/memory/sources.d.ts +2 -1
  88. package/dist/memory/sources.js +277 -62
  89. package/dist/shared/decision-summary.js +2 -1
  90. package/dist/shared/line.d.ts +10 -0
  91. package/dist/shared/line.js +11 -0
  92. package/dist/shared/live-status.d.ts +3 -0
  93. package/dist/shared/live-status.js +11 -0
  94. package/dist/shared/reduced-motion.d.ts +1 -0
  95. package/dist/shared/reduced-motion.js +3 -0
  96. package/dist/shared/virtual/use-list-virtualizer.js +2 -0
  97. package/dist/thread/actions/action-button.js +1 -1
  98. package/dist/thread/actions/actions.d.ts +3 -1
  99. package/dist/thread/actions/actions.js +100 -81
  100. package/dist/thread/actions/branch-switcher.js +129 -23
  101. package/dist/thread/canvas/canvas-meta.d.ts +9 -0
  102. package/dist/thread/canvas/canvas-meta.js +35 -0
  103. package/dist/thread/canvas/canvas.d.ts +1 -1
  104. package/dist/thread/canvas/canvas.js +64 -74
  105. package/dist/thread/canvas/version-switcher.d.ts +1 -0
  106. package/dist/thread/canvas/version-switcher.js +161 -45
  107. package/dist/thread/code/code.js +4 -6
  108. package/dist/thread/code/copy-code-button.d.ts +2 -1
  109. package/dist/thread/code/copy-code-button.js +91 -26
  110. package/dist/thread/history/history.d.ts +1 -1
  111. package/dist/thread/history/history.js +104 -104
  112. package/dist/thread/history/row/history-row.js +106 -22
  113. package/dist/thread/history/row/thread-item-menu.js +84 -20
  114. package/dist/thread/history/row/thread-title-editor.js +74 -29
  115. package/dist/thread/history/virtual-history-list.js +83 -46
  116. package/dist/thread/index.d.ts +1 -0
  117. package/dist/thread/index.js +1 -0
  118. package/dist/thread/starters/starters.js +91 -28
  119. package/dist/thread/use-copied.js +40 -10
  120. package/package.json +6 -6
  121. package/dist/agent/shared/status-dot.d.ts +0 -1
  122. package/dist/agent/shared/status-dot.js +0 -1
  123. package/dist/approval/shared/decision-line.d.ts +0 -1
  124. package/dist/approval/shared/decision-line.js +0 -1
  125. package/dist/memory/shared/disclosure.d.ts +0 -6
  126. package/dist/memory/shared/disclosure.js +0 -6
  127. package/dist/shared/panel.d.ts +0 -19
  128. package/dist/shared/panel.js +0 -77
  129. package/dist/shared/status-dot.d.ts +0 -6
  130. package/dist/shared/status-dot.js +0 -20
@@ -1,85 +1,358 @@
1
- import { Checkbox, Input, Label, NativeSelect, NativeSelectOption } from "@locusgraph/components";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { Checkbox, cn } from "@locusgraph/components";
5
+ import { CaretDown as ChevronDownIcon } from "@phosphor-icons/react/ssr";
6
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
7
+ const valueWellClass = "flex h-control min-w-0 flex-1 items-center gap-2 bg-muted px-3 transition-shadow focus-within:ring-1 focus-within:ring-ring has-[[aria-invalid=true]]:ring-1 has-[[aria-invalid=true]]:ring-destructive motion-reduce:transition-none";
8
+ const bareControlClass = "h-full min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-faint";
3
9
  function describedBy(id, field, error) {
4
10
  const ids = [field.description && `${id}-hint`, error && `${id}-error`].filter(Boolean);
5
11
  return ids.length > 0 ? ids.join(" ") : undefined;
6
12
  }
7
- function FieldControl({
8
- id,
9
- field,
10
- draft,
11
- error,
12
- onChange
13
- }) {
14
- const shared = {
13
+ function FieldControl(t0) {
14
+ const $ = _c(42);
15
+ const {
15
16
  id,
16
- name: field.name,
17
- "aria-invalid": error ? true : undefined,
18
- "aria-describedby": describedBy(id, field, error),
19
- "aria-required": field.required || undefined
20
- };
17
+ field,
18
+ draft,
19
+ error,
20
+ onChange
21
+ } = t0;
22
+ const t1 = field.name;
23
+ const t2 = error ? true : undefined;
24
+ let t3;
25
+ if ($[0] !== error || $[1] !== field || $[2] !== id) {
26
+ t3 = describedBy(id, field, error);
27
+ $[0] = error;
28
+ $[1] = field;
29
+ $[2] = id;
30
+ $[3] = t3;
31
+ } else {
32
+ t3 = $[3];
33
+ }
34
+ const t4 = field.required || undefined;
35
+ let t5;
36
+ if ($[4] !== field.name || $[5] !== id || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
37
+ t5 = {
38
+ id,
39
+ name: t1,
40
+ "aria-invalid": t2,
41
+ "aria-describedby": t3,
42
+ "aria-required": t4
43
+ };
44
+ $[4] = field.name;
45
+ $[5] = id;
46
+ $[6] = t2;
47
+ $[7] = t3;
48
+ $[8] = t4;
49
+ $[9] = t5;
50
+ } else {
51
+ t5 = $[9];
52
+ }
53
+ const shared = t5;
21
54
  if (field.type === "boolean") {
22
- return /*#__PURE__*/_jsx(Checkbox, {
23
- ...shared,
24
- checked: draft === true,
25
- onCheckedChange: checked => onChange(checked === true)
26
- });
55
+ const t6 = draft === true;
56
+ let t7;
57
+ if ($[10] !== onChange) {
58
+ t7 = checked => onChange(checked === true);
59
+ $[10] = onChange;
60
+ $[11] = t7;
61
+ } else {
62
+ t7 = $[11];
63
+ }
64
+ let t8;
65
+ if ($[12] !== shared || $[13] !== t6 || $[14] !== t7) {
66
+ t8 = /*#__PURE__*/_jsx(Checkbox, {
67
+ ...shared,
68
+ checked: t6,
69
+ onCheckedChange: t7
70
+ });
71
+ $[12] = shared;
72
+ $[13] = t6;
73
+ $[14] = t7;
74
+ $[15] = t8;
75
+ } else {
76
+ t8 = $[15];
77
+ }
78
+ return t8;
27
79
  }
28
80
  const text = typeof draft === "string" ? draft : "";
29
81
  if (field.type === "select") {
30
- return /*#__PURE__*/_jsxs(NativeSelect, {
31
- ...shared,
32
- value: text,
33
- onChange: event => onChange(event.target.value),
34
- children: [/*#__PURE__*/_jsx(NativeSelectOption, {
82
+ let t6;
83
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
84
+ t6 = cn(bareControlClass, "appearance-none has-[option[value='']:checked]:text-faint");
85
+ $[16] = t6;
86
+ } else {
87
+ t6 = $[16];
88
+ }
89
+ let t7;
90
+ if ($[17] !== onChange) {
91
+ t7 = event => onChange(event.target.value);
92
+ $[17] = onChange;
93
+ $[18] = t7;
94
+ } else {
95
+ t7 = $[18];
96
+ }
97
+ let t8;
98
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
99
+ t8 = /*#__PURE__*/_jsx("option", {
35
100
  value: "",
36
101
  children: "Choose\u2026"
37
- }), (field.options ?? []).map(option => /*#__PURE__*/_jsx(NativeSelectOption, {
38
- value: option.value,
39
- children: option.label
40
- }, option.value))]
102
+ });
103
+ $[19] = t8;
104
+ } else {
105
+ t8 = $[19];
106
+ }
107
+ let t9;
108
+ if ($[20] !== field.options) {
109
+ t9 = field.options ?? [];
110
+ $[20] = field.options;
111
+ $[21] = t9;
112
+ } else {
113
+ t9 = $[21];
114
+ }
115
+ let t10;
116
+ if ($[22] !== t9) {
117
+ t10 = t9.map(_temp);
118
+ $[22] = t9;
119
+ $[23] = t10;
120
+ } else {
121
+ t10 = $[23];
122
+ }
123
+ let t11;
124
+ if ($[24] !== shared || $[25] !== t10 || $[26] !== t7 || $[27] !== text) {
125
+ t11 = /*#__PURE__*/_jsxs("select", {
126
+ ...shared,
127
+ value: text,
128
+ className: t6,
129
+ onChange: t7,
130
+ children: [t8, t10]
131
+ });
132
+ $[24] = shared;
133
+ $[25] = t10;
134
+ $[26] = t7;
135
+ $[27] = text;
136
+ $[28] = t11;
137
+ } else {
138
+ t11 = $[28];
139
+ }
140
+ let t12;
141
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
142
+ t12 = /*#__PURE__*/_jsx(ChevronDownIcon, {
143
+ weight: "bold",
144
+ "aria-hidden": true,
145
+ className: "pointer-events-none size-3.5 shrink-0 text-faint"
146
+ });
147
+ $[29] = t12;
148
+ } else {
149
+ t12 = $[29];
150
+ }
151
+ let t13;
152
+ if ($[30] !== t11) {
153
+ t13 = /*#__PURE__*/_jsxs(_Fragment, {
154
+ children: [t11, t12]
155
+ });
156
+ $[30] = t11;
157
+ $[31] = t13;
158
+ } else {
159
+ t13 = $[31];
160
+ }
161
+ return t13;
162
+ }
163
+ const t6 = field.type === "number" ? "number" : "text";
164
+ const t7 = field.type === "number" ? "decimal" : undefined;
165
+ let t8;
166
+ if ($[32] !== onChange) {
167
+ t8 = event_0 => onChange(event_0.target.value);
168
+ $[32] = onChange;
169
+ $[33] = t8;
170
+ } else {
171
+ t8 = $[33];
172
+ }
173
+ let t9;
174
+ if ($[34] !== field.max || $[35] !== field.min || $[36] !== shared || $[37] !== t6 || $[38] !== t7 || $[39] !== t8 || $[40] !== text) {
175
+ t9 = /*#__PURE__*/_jsx("input", {
176
+ ...shared,
177
+ type: t6,
178
+ inputMode: t7,
179
+ min: field.min,
180
+ max: field.max,
181
+ value: text,
182
+ className: bareControlClass,
183
+ onChange: t8
41
184
  });
185
+ $[34] = field.max;
186
+ $[35] = field.min;
187
+ $[36] = shared;
188
+ $[37] = t6;
189
+ $[38] = t7;
190
+ $[39] = t8;
191
+ $[40] = text;
192
+ $[41] = t9;
193
+ } else {
194
+ t9 = $[41];
42
195
  }
43
- return /*#__PURE__*/_jsx(Input, {
44
- ...shared,
45
- type: field.type === "number" ? "number" : "text",
46
- inputMode: field.type === "number" ? "decimal" : undefined,
47
- min: field.min,
48
- max: field.max,
49
- value: text,
50
- onChange: event => onChange(event.target.value)
51
- });
196
+ return t9;
197
+ }
198
+ function _temp(option) {
199
+ return /*#__PURE__*/_jsx("option", {
200
+ value: option.value,
201
+ children: option.label
202
+ }, option.value);
203
+ }
204
+ function FieldValue(props) {
205
+ const $ = _c(4);
206
+ if (props.field.type === "boolean") {
207
+ let t0;
208
+ if ($[0] !== props) {
209
+ t0 = /*#__PURE__*/_jsx("div", {
210
+ className: "flex h-control flex-1 items-center px-3",
211
+ children: /*#__PURE__*/_jsx(FieldControl, {
212
+ ...props
213
+ })
214
+ });
215
+ $[0] = props;
216
+ $[1] = t0;
217
+ } else {
218
+ t0 = $[1];
219
+ }
220
+ return t0;
221
+ }
222
+ let t0;
223
+ if ($[2] !== props) {
224
+ t0 = /*#__PURE__*/_jsx("div", {
225
+ className: valueWellClass,
226
+ children: /*#__PURE__*/_jsx(FieldControl, {
227
+ ...props
228
+ })
229
+ });
230
+ $[2] = props;
231
+ $[3] = t0;
232
+ } else {
233
+ t0 = $[3];
234
+ }
235
+ return t0;
52
236
  }
53
237
  export function ArgsField(props) {
238
+ const $ = _c(27);
54
239
  const {
55
240
  id,
56
241
  field,
57
242
  error
58
243
  } = props;
59
- const inline = field.type === "boolean";
60
- return /*#__PURE__*/_jsxs("div", {
61
- "data-slot": "args-field",
62
- "data-type": field.type,
63
- className: "flex flex-col gap-1.5 [&_[data-slot=native-select-wrapper]]:w-full",
64
- children: [/*#__PURE__*/_jsxs("div", {
65
- className: inline ? "flex flex-row-reverse items-center justify-end gap-2" : "contents",
66
- children: [/*#__PURE__*/_jsxs(Label, {
67
- htmlFor: id,
68
- children: [field.label, field.required && /*#__PURE__*/_jsx("span", {
69
- className: "text-xs font-normal text-muted-foreground",
70
- children: "required"
71
- })]
72
- }), /*#__PURE__*/_jsx(FieldControl, {
73
- ...props
74
- })]
75
- }), field.description && /*#__PURE__*/_jsx("p", {
244
+ const optional = !field.required && field.type !== "boolean";
245
+ let t0;
246
+ if ($[0] !== field.label) {
247
+ t0 = /*#__PURE__*/_jsx("span", {
248
+ className: "truncate",
249
+ children: field.label
250
+ });
251
+ $[0] = field.label;
252
+ $[1] = t0;
253
+ } else {
254
+ t0 = $[1];
255
+ }
256
+ let t1;
257
+ if ($[2] !== optional) {
258
+ t1 = optional && /*#__PURE__*/_jsx("span", {
259
+ className: "text-xs text-faint",
260
+ children: "Optional"
261
+ });
262
+ $[2] = optional;
263
+ $[3] = t1;
264
+ } else {
265
+ t1 = $[3];
266
+ }
267
+ let t2;
268
+ if ($[4] !== field.required) {
269
+ t2 = field.required && /*#__PURE__*/_jsx("span", {
270
+ className: "sr-only",
271
+ children: " (required)"
272
+ });
273
+ $[4] = field.required;
274
+ $[5] = t2;
275
+ } else {
276
+ t2 = $[5];
277
+ }
278
+ let t3;
279
+ if ($[6] !== id || $[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
280
+ t3 = /*#__PURE__*/_jsxs("label", {
281
+ htmlFor: id,
282
+ className: "flex w-32 shrink-0 cursor-pointer flex-col text-muted-foreground",
283
+ children: [t0, t1, t2]
284
+ });
285
+ $[6] = id;
286
+ $[7] = t0;
287
+ $[8] = t1;
288
+ $[9] = t2;
289
+ $[10] = t3;
290
+ } else {
291
+ t3 = $[10];
292
+ }
293
+ let t4;
294
+ if ($[11] !== props) {
295
+ t4 = /*#__PURE__*/_jsx(FieldValue, {
296
+ ...props
297
+ });
298
+ $[11] = props;
299
+ $[12] = t4;
300
+ } else {
301
+ t4 = $[12];
302
+ }
303
+ let t5;
304
+ if ($[13] !== t3 || $[14] !== t4) {
305
+ t5 = /*#__PURE__*/_jsxs("div", {
306
+ className: "flex min-w-0 items-center gap-4 text-sm",
307
+ children: [t3, t4]
308
+ });
309
+ $[13] = t3;
310
+ $[14] = t4;
311
+ $[15] = t5;
312
+ } else {
313
+ t5 = $[15];
314
+ }
315
+ let t6;
316
+ if ($[16] !== field.description || $[17] !== id) {
317
+ t6 = field.description && /*#__PURE__*/_jsx("p", {
76
318
  id: `${id}-hint`,
77
- className: "text-xs text-muted-foreground",
319
+ className: "pl-39 text-xs text-faint",
78
320
  children: field.description
79
- }), error && /*#__PURE__*/_jsx("p", {
321
+ });
322
+ $[16] = field.description;
323
+ $[17] = id;
324
+ $[18] = t6;
325
+ } else {
326
+ t6 = $[18];
327
+ }
328
+ let t7;
329
+ if ($[19] !== error || $[20] !== id) {
330
+ t7 = error && /*#__PURE__*/_jsx("p", {
80
331
  id: `${id}-error`,
81
- className: "text-xs text-destructive",
332
+ className: "pl-39 text-xs text-destructive",
82
333
  children: error
83
- })]
84
- });
334
+ });
335
+ $[19] = error;
336
+ $[20] = id;
337
+ $[21] = t7;
338
+ } else {
339
+ t7 = $[21];
340
+ }
341
+ let t8;
342
+ if ($[22] !== field.type || $[23] !== t5 || $[24] !== t6 || $[25] !== t7) {
343
+ t8 = /*#__PURE__*/_jsxs("div", {
344
+ "data-slot": "args-field",
345
+ "data-type": field.type,
346
+ className: "flex flex-col gap-1",
347
+ children: [t5, t6, t7]
348
+ });
349
+ $[22] = field.type;
350
+ $[23] = t5;
351
+ $[24] = t6;
352
+ $[25] = t7;
353
+ $[26] = t8;
354
+ } else {
355
+ t8 = $[26];
356
+ }
357
+ return t8;
85
358
  }
@@ -1,48 +1,130 @@
1
+ "use client";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
1
4
  import { Button, Label, Textarea } from "@locusgraph/components";
2
5
  import { useId, useState } from "react";
3
- import { PanelBody, PanelFooter } from "../../shared/panel.js";
4
6
  import { useFocusOnMount } from "../shared/use-focus-on-mount.js";
5
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- export function DenyForm({
7
- onDeny,
8
- onBack
9
- }) {
8
+ export function DenyForm(t0) {
9
+ const $ = _c(21);
10
+ const {
11
+ onDeny,
12
+ onBack
13
+ } = t0;
10
14
  const [reason, setReason] = useState("");
11
15
  const reasonId = useId();
12
16
  const reasonRef = useFocusOnMount(true);
13
- const trimmed = reason.trim();
14
- return /*#__PURE__*/_jsxs("form", {
15
- "data-slot": "deny-form",
16
- onSubmit: event => {
17
+ let t1;
18
+ if ($[0] !== reason) {
19
+ t1 = reason.trim();
20
+ $[0] = reason;
21
+ $[1] = t1;
22
+ } else {
23
+ t1 = $[1];
24
+ }
25
+ const trimmed = t1;
26
+ let t2;
27
+ if ($[2] !== onDeny || $[3] !== trimmed) {
28
+ t2 = event => {
17
29
  event.preventDefault();
18
30
  onDeny(trimmed === "" ? undefined : trimmed);
19
- },
20
- children: [/*#__PURE__*/_jsxs(PanelBody, {
21
- className: "gap-2 pt-0",
22
- children: [/*#__PURE__*/_jsx(Label, {
23
- htmlFor: reasonId,
24
- className: "text-xs font-normal text-muted-foreground",
25
- children: "Reason for the agent (optional)"
26
- }), /*#__PURE__*/_jsx(Textarea, {
27
- id: reasonId,
28
- ref: reasonRef,
29
- value: reason,
30
- placeholder: "Tell the agent what to do instead",
31
- onChange: event => setReason(event.target.value)
32
- })]
33
- }), /*#__PURE__*/_jsxs(PanelFooter, {
34
- children: [/*#__PURE__*/_jsx(Button, {
31
+ };
32
+ $[2] = onDeny;
33
+ $[3] = trimmed;
34
+ $[4] = t2;
35
+ } else {
36
+ t2 = $[4];
37
+ }
38
+ let t3;
39
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
40
+ t3 = /*#__PURE__*/_jsx("span", {
41
+ className: "text-xs text-faint",
42
+ children: "Optional"
43
+ });
44
+ $[5] = t3;
45
+ } else {
46
+ t3 = $[5];
47
+ }
48
+ let t4;
49
+ if ($[6] !== reasonId) {
50
+ t4 = /*#__PURE__*/_jsxs(Label, {
51
+ htmlFor: reasonId,
52
+ className: "text-sm font-normal text-muted-foreground",
53
+ children: ["Why deny? ", t3]
54
+ });
55
+ $[6] = reasonId;
56
+ $[7] = t4;
57
+ } else {
58
+ t4 = $[7];
59
+ }
60
+ let t5;
61
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
62
+ t5 = event_0 => setReason(event_0.target.value);
63
+ $[8] = t5;
64
+ } else {
65
+ t5 = $[8];
66
+ }
67
+ let t6;
68
+ if ($[9] !== reason || $[10] !== reasonId || $[11] !== reasonRef) {
69
+ t6 = /*#__PURE__*/_jsx(Textarea, {
70
+ id: reasonId,
71
+ ref: reasonRef,
72
+ value: reason,
73
+ className: "border-transparent bg-muted shadow-none placeholder:text-faint dark:bg-muted",
74
+ placeholder: "Tell the agent what to do instead",
75
+ onChange: t5
76
+ });
77
+ $[9] = reason;
78
+ $[10] = reasonId;
79
+ $[11] = reasonRef;
80
+ $[12] = t6;
81
+ } else {
82
+ t6 = $[12];
83
+ }
84
+ let t7;
85
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
86
+ t7 = /*#__PURE__*/_jsx(Button, {
87
+ type: "submit",
88
+ variant: "destructive",
89
+ size: "sm",
90
+ children: "Send denial"
91
+ });
92
+ $[13] = t7;
93
+ } else {
94
+ t7 = $[13];
95
+ }
96
+ let t8;
97
+ if ($[14] !== onBack) {
98
+ t8 = /*#__PURE__*/_jsxs("div", {
99
+ className: "flex flex-wrap gap-2",
100
+ children: [t7, /*#__PURE__*/_jsx(Button, {
35
101
  type: "button",
36
102
  variant: "ghost",
37
103
  size: "sm",
38
104
  onClick: onBack,
39
105
  children: "Back"
40
- }), /*#__PURE__*/_jsx(Button, {
41
- type: "submit",
42
- variant: "destructive",
43
- size: "sm",
44
- children: "Send denial"
45
106
  })]
46
- })]
47
- });
107
+ });
108
+ $[14] = onBack;
109
+ $[15] = t8;
110
+ } else {
111
+ t8 = $[15];
112
+ }
113
+ let t9;
114
+ if ($[16] !== t2 || $[17] !== t4 || $[18] !== t6 || $[19] !== t8) {
115
+ t9 = /*#__PURE__*/_jsxs("form", {
116
+ "data-slot": "deny-form",
117
+ className: "flex flex-col gap-2 pt-1",
118
+ onSubmit: t2,
119
+ children: [t4, t6, t8]
120
+ });
121
+ $[16] = t2;
122
+ $[17] = t4;
123
+ $[18] = t6;
124
+ $[19] = t8;
125
+ $[20] = t9;
126
+ } else {
127
+ t9 = $[20];
128
+ }
129
+ return t9;
48
130
  }