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