@remoraflow/ui 0.4.0 → 0.5.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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +606 -606
- package/dist/index.js.map +5 -5
- package/dist/styles.css +2 -0
- package/dist/workflow-viewer.d.ts +3 -2
- package/dist/workflow-viewer.d.ts.map +1 -1
- package/package.json +8 -2
package/dist/index.js
CHANGED
|
@@ -128,13 +128,135 @@ function ReplaySlider({
|
|
|
128
128
|
]
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
+
// src/components/step-palette.tsx
|
|
132
|
+
import {
|
|
133
|
+
Bot,
|
|
134
|
+
FileOutput,
|
|
135
|
+
GitBranch,
|
|
136
|
+
Hand,
|
|
137
|
+
Moon,
|
|
138
|
+
Play,
|
|
139
|
+
Repeat,
|
|
140
|
+
Sparkles,
|
|
141
|
+
Timer,
|
|
142
|
+
Wrench
|
|
143
|
+
} from "lucide-react";
|
|
144
|
+
import { useCallback, useState } from "react";
|
|
145
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
146
|
+
var STEP_TYPES = [
|
|
147
|
+
{
|
|
148
|
+
type: "start",
|
|
149
|
+
label: "Start",
|
|
150
|
+
color: "text-green-600 dark:text-green-400",
|
|
151
|
+
icon: Play
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: "end",
|
|
155
|
+
label: "End",
|
|
156
|
+
color: "text-muted-foreground",
|
|
157
|
+
icon: Hand
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: "tool-call",
|
|
161
|
+
label: "Tool Call",
|
|
162
|
+
color: "text-blue-600 dark:text-blue-400",
|
|
163
|
+
icon: Wrench
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: "llm-prompt",
|
|
167
|
+
label: "LLM Prompt",
|
|
168
|
+
color: "text-violet-600 dark:text-violet-400",
|
|
169
|
+
icon: Sparkles
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
type: "extract-data",
|
|
173
|
+
label: "Extract Data",
|
|
174
|
+
color: "text-purple-600 dark:text-purple-400",
|
|
175
|
+
icon: FileOutput
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: "switch-case",
|
|
179
|
+
label: "Switch Case",
|
|
180
|
+
color: "text-amber-600 dark:text-amber-400",
|
|
181
|
+
icon: GitBranch
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: "for-each",
|
|
185
|
+
label: "For Each",
|
|
186
|
+
color: "text-emerald-600 dark:text-emerald-400",
|
|
187
|
+
icon: Repeat
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
type: "sleep",
|
|
191
|
+
label: "Sleep",
|
|
192
|
+
color: "text-yellow-600 dark:text-yellow-400",
|
|
193
|
+
icon: Moon
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: "wait-for-condition",
|
|
197
|
+
label: "Wait",
|
|
198
|
+
color: "text-orange-600 dark:text-orange-400",
|
|
199
|
+
icon: Timer
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
type: "agent-loop",
|
|
203
|
+
label: "Agent Loop",
|
|
204
|
+
color: "text-teal-600 dark:text-teal-400",
|
|
205
|
+
icon: Bot
|
|
206
|
+
}
|
|
207
|
+
];
|
|
208
|
+
function StepPalette({ onAddStep }) {
|
|
209
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
210
|
+
const onDragStart = useCallback((event, type) => {
|
|
211
|
+
event.dataTransfer.setData("application/remora-step-type", type);
|
|
212
|
+
event.dataTransfer.effectAllowed = "move";
|
|
213
|
+
}, []);
|
|
214
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
215
|
+
className: "bg-card border border-border rounded-lg shadow-md overflow-hidden w-[160px]",
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ jsxs2("button", {
|
|
218
|
+
type: "button",
|
|
219
|
+
onClick: () => setCollapsed(!collapsed),
|
|
220
|
+
className: "w-full px-3 py-1.5 text-xs font-medium text-foreground flex items-center justify-between hover:bg-muted/50 transition-colors",
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ jsx3("span", {
|
|
223
|
+
children: "Add Steps"
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ jsx3("span", {
|
|
226
|
+
className: `text-[10px] text-muted-foreground transition-transform ${collapsed ? "" : "rotate-180"}`,
|
|
227
|
+
children: "▲"
|
|
228
|
+
})
|
|
229
|
+
]
|
|
230
|
+
}),
|
|
231
|
+
!collapsed && /* @__PURE__ */ jsx3("div", {
|
|
232
|
+
className: "border-t border-border",
|
|
233
|
+
children: STEP_TYPES.map((entry) => /* @__PURE__ */ jsxs2("button", {
|
|
234
|
+
type: "button",
|
|
235
|
+
onClick: () => onAddStep(entry.type),
|
|
236
|
+
draggable: true,
|
|
237
|
+
onDragStart: (e) => onDragStart(e, entry.type),
|
|
238
|
+
className: "w-full px-3 py-1 text-left hover:bg-muted/50 transition-colors cursor-grab active:cursor-grabbing flex items-center gap-1.5",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ jsx3(entry.icon, {
|
|
241
|
+
className: `w-3.5 h-3.5 shrink-0 ${entry.color}`
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ jsx3("span", {
|
|
244
|
+
className: `text-[10px] font-semibold uppercase tracking-wide ${entry.color}`,
|
|
245
|
+
children: entry.label
|
|
246
|
+
})
|
|
247
|
+
]
|
|
248
|
+
}, entry.type))
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
});
|
|
252
|
+
}
|
|
131
253
|
// src/components/ui/collapsible.tsx
|
|
132
254
|
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
133
|
-
import { jsx as
|
|
255
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
134
256
|
function Collapsible({
|
|
135
257
|
...props
|
|
136
258
|
}) {
|
|
137
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ jsx4(CollapsiblePrimitive.Root, {
|
|
138
260
|
"data-slot": "collapsible",
|
|
139
261
|
...props
|
|
140
262
|
});
|
|
@@ -142,7 +264,7 @@ function Collapsible({
|
|
|
142
264
|
function CollapsibleTrigger({
|
|
143
265
|
...props
|
|
144
266
|
}) {
|
|
145
|
-
return /* @__PURE__ */
|
|
267
|
+
return /* @__PURE__ */ jsx4(CollapsiblePrimitive.CollapsibleTrigger, {
|
|
146
268
|
"data-slot": "collapsible-trigger",
|
|
147
269
|
...props
|
|
148
270
|
});
|
|
@@ -150,7 +272,7 @@ function CollapsibleTrigger({
|
|
|
150
272
|
function CollapsibleContent({
|
|
151
273
|
...props
|
|
152
274
|
}) {
|
|
153
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ jsx4(CollapsiblePrimitive.CollapsibleContent, {
|
|
154
276
|
"data-slot": "collapsible-content",
|
|
155
277
|
...props
|
|
156
278
|
});
|
|
@@ -158,12 +280,12 @@ function CollapsibleContent({
|
|
|
158
280
|
// src/components/ui/dropdown-menu.tsx
|
|
159
281
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
160
282
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
161
|
-
import { jsx as
|
|
283
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
162
284
|
"use client";
|
|
163
285
|
function DropdownMenu({
|
|
164
286
|
...props
|
|
165
287
|
}) {
|
|
166
|
-
return /* @__PURE__ */
|
|
288
|
+
return /* @__PURE__ */ jsx5(DropdownMenuPrimitive.Root, {
|
|
167
289
|
"data-slot": "dropdown-menu",
|
|
168
290
|
...props
|
|
169
291
|
});
|
|
@@ -171,7 +293,7 @@ function DropdownMenu({
|
|
|
171
293
|
function DropdownMenuTrigger({
|
|
172
294
|
...props
|
|
173
295
|
}) {
|
|
174
|
-
return /* @__PURE__ */
|
|
296
|
+
return /* @__PURE__ */ jsx5(DropdownMenuPrimitive.Trigger, {
|
|
175
297
|
"data-slot": "dropdown-menu-trigger",
|
|
176
298
|
...props
|
|
177
299
|
});
|
|
@@ -181,8 +303,8 @@ function DropdownMenuContent({
|
|
|
181
303
|
sideOffset = 4,
|
|
182
304
|
...props
|
|
183
305
|
}) {
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
children: /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ jsx5(DropdownMenuPrimitive.Portal, {
|
|
307
|
+
children: /* @__PURE__ */ jsx5(DropdownMenuPrimitive.Content, {
|
|
186
308
|
"data-slot": "dropdown-menu-content",
|
|
187
309
|
sideOffset,
|
|
188
310
|
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className),
|
|
@@ -196,7 +318,7 @@ function DropdownMenuItem({
|
|
|
196
318
|
variant = "default",
|
|
197
319
|
...props
|
|
198
320
|
}) {
|
|
199
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ jsx5(DropdownMenuPrimitive.Item, {
|
|
200
322
|
"data-slot": "dropdown-menu-item",
|
|
201
323
|
"data-inset": inset,
|
|
202
324
|
"data-variant": variant,
|
|
@@ -209,7 +331,7 @@ function DropdownMenuLabel({
|
|
|
209
331
|
inset,
|
|
210
332
|
...props
|
|
211
333
|
}) {
|
|
212
|
-
return /* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ jsx5(DropdownMenuPrimitive.Label, {
|
|
213
335
|
"data-slot": "dropdown-menu-label",
|
|
214
336
|
"data-inset": inset,
|
|
215
337
|
className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
@@ -220,16 +342,16 @@ function DropdownMenuSeparator({
|
|
|
220
342
|
className,
|
|
221
343
|
...props
|
|
222
344
|
}) {
|
|
223
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ jsx5(DropdownMenuPrimitive.Separator, {
|
|
224
346
|
"data-slot": "dropdown-menu-separator",
|
|
225
347
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
226
348
|
...props
|
|
227
349
|
});
|
|
228
350
|
}
|
|
229
351
|
// src/components/ui/input.tsx
|
|
230
|
-
import { jsx as
|
|
352
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
231
353
|
function Input({ className, type, ...props }) {
|
|
232
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ jsx6("input", {
|
|
233
355
|
type,
|
|
234
356
|
"data-slot": "input",
|
|
235
357
|
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
|
|
@@ -238,13 +360,13 @@ function Input({ className, type, ...props }) {
|
|
|
238
360
|
}
|
|
239
361
|
// src/components/ui/label.tsx
|
|
240
362
|
import { Label as LabelPrimitive } from "radix-ui";
|
|
241
|
-
import { jsx as
|
|
363
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
242
364
|
"use client";
|
|
243
365
|
function Label({
|
|
244
366
|
className,
|
|
245
367
|
...props
|
|
246
368
|
}) {
|
|
247
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ jsx7(LabelPrimitive.Root, {
|
|
248
370
|
"data-slot": "label",
|
|
249
371
|
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
250
372
|
...props
|
|
@@ -253,11 +375,11 @@ function Label({
|
|
|
253
375
|
// src/components/ui/select.tsx
|
|
254
376
|
import { CheckIcon as CheckIcon2, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
255
377
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
256
|
-
import { jsx as
|
|
378
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
257
379
|
function Select({
|
|
258
380
|
...props
|
|
259
381
|
}) {
|
|
260
|
-
return /* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Root, {
|
|
261
383
|
"data-slot": "select",
|
|
262
384
|
...props
|
|
263
385
|
});
|
|
@@ -265,7 +387,7 @@ function Select({
|
|
|
265
387
|
function SelectValue({
|
|
266
388
|
...props
|
|
267
389
|
}) {
|
|
268
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Value, {
|
|
269
391
|
"data-slot": "select-value",
|
|
270
392
|
...props
|
|
271
393
|
});
|
|
@@ -276,16 +398,16 @@ function SelectTrigger({
|
|
|
276
398
|
children,
|
|
277
399
|
...props
|
|
278
400
|
}) {
|
|
279
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ jsxs4(SelectPrimitive.Trigger, {
|
|
280
402
|
"data-slot": "select-trigger",
|
|
281
403
|
"data-size": size,
|
|
282
404
|
className: cn("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className),
|
|
283
405
|
...props,
|
|
284
406
|
children: [
|
|
285
407
|
children,
|
|
286
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.Icon, {
|
|
287
409
|
asChild: true,
|
|
288
|
-
children: /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ jsx8(ChevronDownIcon, {
|
|
289
411
|
className: "size-4 opacity-50"
|
|
290
412
|
})
|
|
291
413
|
})
|
|
@@ -299,20 +421,20 @@ function SelectContent({
|
|
|
299
421
|
align = "center",
|
|
300
422
|
...props
|
|
301
423
|
}) {
|
|
302
|
-
return /* @__PURE__ */
|
|
303
|
-
children: /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, {
|
|
425
|
+
children: /* @__PURE__ */ jsxs4(SelectPrimitive.Content, {
|
|
304
426
|
"data-slot": "select-content",
|
|
305
427
|
className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
306
428
|
position,
|
|
307
429
|
align,
|
|
308
430
|
...props,
|
|
309
431
|
children: [
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
|
|
433
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.Viewport, {
|
|
312
434
|
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
313
435
|
children
|
|
314
436
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ jsx8(SelectScrollDownButton, {})
|
|
316
438
|
]
|
|
317
439
|
})
|
|
318
440
|
});
|
|
@@ -322,21 +444,21 @@ function SelectItem({
|
|
|
322
444
|
children,
|
|
323
445
|
...props
|
|
324
446
|
}) {
|
|
325
|
-
return /* @__PURE__ */
|
|
447
|
+
return /* @__PURE__ */ jsxs4(SelectPrimitive.Item, {
|
|
326
448
|
"data-slot": "select-item",
|
|
327
449
|
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
328
450
|
...props,
|
|
329
451
|
children: [
|
|
330
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ jsx8("span", {
|
|
331
453
|
"data-slot": "select-item-indicator",
|
|
332
454
|
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
333
|
-
children: /* @__PURE__ */
|
|
334
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ jsx8(SelectPrimitive.ItemIndicator, {
|
|
456
|
+
children: /* @__PURE__ */ jsx8(CheckIcon2, {
|
|
335
457
|
className: "size-4"
|
|
336
458
|
})
|
|
337
459
|
})
|
|
338
460
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.ItemText, {
|
|
340
462
|
children
|
|
341
463
|
})
|
|
342
464
|
]
|
|
@@ -346,11 +468,11 @@ function SelectScrollUpButton({
|
|
|
346
468
|
className,
|
|
347
469
|
...props
|
|
348
470
|
}) {
|
|
349
|
-
return /* @__PURE__ */
|
|
471
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollUpButton, {
|
|
350
472
|
"data-slot": "select-scroll-up-button",
|
|
351
473
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
352
474
|
...props,
|
|
353
|
-
children: /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ jsx8(ChevronUpIcon, {
|
|
354
476
|
className: "size-4"
|
|
355
477
|
})
|
|
356
478
|
});
|
|
@@ -359,54 +481,54 @@ function SelectScrollDownButton({
|
|
|
359
481
|
className,
|
|
360
482
|
...props
|
|
361
483
|
}) {
|
|
362
|
-
return /* @__PURE__ */
|
|
484
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollDownButton, {
|
|
363
485
|
"data-slot": "select-scroll-down-button",
|
|
364
486
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
365
487
|
...props,
|
|
366
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ jsx8(ChevronDownIcon, {
|
|
367
489
|
className: "size-4"
|
|
368
490
|
})
|
|
369
491
|
});
|
|
370
492
|
}
|
|
371
493
|
// src/components/ui/switch.tsx
|
|
372
494
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
373
|
-
import { jsx as
|
|
495
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
374
496
|
function Switch({
|
|
375
497
|
className,
|
|
376
498
|
size = "default",
|
|
377
499
|
...props
|
|
378
500
|
}) {
|
|
379
|
-
return /* @__PURE__ */
|
|
501
|
+
return /* @__PURE__ */ jsx9(SwitchPrimitive.Root, {
|
|
380
502
|
"data-slot": "switch",
|
|
381
503
|
"data-size": size,
|
|
382
504
|
className: cn("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80", className),
|
|
383
505
|
...props,
|
|
384
|
-
children: /* @__PURE__ */
|
|
506
|
+
children: /* @__PURE__ */ jsx9(SwitchPrimitive.Thumb, {
|
|
385
507
|
"data-slot": "switch-thumb",
|
|
386
508
|
className: cn("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")
|
|
387
509
|
})
|
|
388
510
|
});
|
|
389
511
|
}
|
|
390
512
|
// src/components/ui/textarea.tsx
|
|
391
|
-
import { jsx as
|
|
513
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
392
514
|
function Textarea({ className, ...props }) {
|
|
393
|
-
return /* @__PURE__ */
|
|
515
|
+
return /* @__PURE__ */ jsx10("textarea", {
|
|
394
516
|
"data-slot": "textarea",
|
|
395
517
|
className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40", className),
|
|
396
518
|
...props
|
|
397
519
|
});
|
|
398
520
|
}
|
|
399
521
|
// src/editors/expression-editor.tsx
|
|
400
|
-
import { useCallback, useEffect as useEffect2, useRef as useRef2, useState } from "react";
|
|
522
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
401
523
|
|
|
402
524
|
// src/components/ui/tabs.tsx
|
|
403
525
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
404
|
-
import { jsx as
|
|
526
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
405
527
|
function Tabs({
|
|
406
528
|
className,
|
|
407
529
|
...props
|
|
408
530
|
}) {
|
|
409
|
-
return /* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ jsx11(TabsPrimitive.Root, {
|
|
410
532
|
"data-slot": "tabs",
|
|
411
533
|
className: cn("flex flex-col gap-2", className),
|
|
412
534
|
...props
|
|
@@ -416,7 +538,7 @@ function TabsList({
|
|
|
416
538
|
className,
|
|
417
539
|
...props
|
|
418
540
|
}) {
|
|
419
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ jsx11(TabsPrimitive.List, {
|
|
420
542
|
"data-slot": "tabs-list",
|
|
421
543
|
className: cn("inline-flex w-fit items-center justify-center rounded-lg bg-muted/50 p-0.5 text-muted-foreground", className),
|
|
422
544
|
...props
|
|
@@ -426,7 +548,7 @@ function TabsTrigger({
|
|
|
426
548
|
className,
|
|
427
549
|
...props
|
|
428
550
|
}) {
|
|
429
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ jsx11(TabsPrimitive.Trigger, {
|
|
430
552
|
"data-slot": "tabs-trigger",
|
|
431
553
|
className: cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-2.5 py-1 text-[11px] font-medium transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:shadow-sm", className),
|
|
432
554
|
...props
|
|
@@ -436,7 +558,7 @@ function TabsContent({
|
|
|
436
558
|
className,
|
|
437
559
|
...props
|
|
438
560
|
}) {
|
|
439
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ jsx11(TabsPrimitive.Content, {
|
|
440
562
|
"data-slot": "tabs-content",
|
|
441
563
|
className: cn("flex-1 outline-none", className),
|
|
442
564
|
...props
|
|
@@ -568,7 +690,7 @@ function buildEditorTheme(dark, scrollerMaxHeight) {
|
|
|
568
690
|
}
|
|
569
691
|
|
|
570
692
|
// src/editors/json-code-editor.tsx
|
|
571
|
-
import { jsx as
|
|
693
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
572
694
|
function JsonCodeEditor({
|
|
573
695
|
value,
|
|
574
696
|
onChange,
|
|
@@ -660,14 +782,14 @@ function JsonCodeEditor({
|
|
|
660
782
|
observer.observe(el, { attributes: true, attributeFilter: ["class"] });
|
|
661
783
|
return () => observer.disconnect();
|
|
662
784
|
}, []);
|
|
663
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ jsx12("div", {
|
|
664
786
|
ref: containerRef,
|
|
665
787
|
className: cn("json-code-editor", className)
|
|
666
788
|
});
|
|
667
789
|
}
|
|
668
790
|
|
|
669
791
|
// src/editors/expression-editor.tsx
|
|
670
|
-
import { jsx as
|
|
792
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
671
793
|
function inferLiteralType(value) {
|
|
672
794
|
if (typeof value === "string")
|
|
673
795
|
return "string";
|
|
@@ -719,7 +841,7 @@ function ExpressionEditor({
|
|
|
719
841
|
const hintedLiteralType = schemaTypeToLiteralType(schemaHint?.type);
|
|
720
842
|
const hasEnum = schemaHint?.enum && schemaHint.enum.length > 0;
|
|
721
843
|
const allowTemplate = !schemaHint?.type || schemaHint.type === "string";
|
|
722
|
-
const [literalType, setLiteralType] =
|
|
844
|
+
const [literalType, setLiteralType] = useState2(hintedLiteralType ?? (value.type === "literal" ? inferLiteralType(value.value) : "string"));
|
|
723
845
|
const prevExprType = useRef2(value.type);
|
|
724
846
|
useEffect2(() => {
|
|
725
847
|
if (value.type === "literal" && prevExprType.current !== "literal") {
|
|
@@ -727,7 +849,7 @@ function ExpressionEditor({
|
|
|
727
849
|
}
|
|
728
850
|
prevExprType.current = value.type;
|
|
729
851
|
}, [value, hintedLiteralType]);
|
|
730
|
-
const handleTypeChange =
|
|
852
|
+
const handleTypeChange = useCallback2((newType) => {
|
|
731
853
|
switch (newType) {
|
|
732
854
|
case "literal":
|
|
733
855
|
if (hasEnum) {
|
|
@@ -756,7 +878,7 @@ function ExpressionEditor({
|
|
|
756
878
|
break;
|
|
757
879
|
}
|
|
758
880
|
}, [value, onChange, hasEnum, schemaHint]);
|
|
759
|
-
const handleLiteralChange =
|
|
881
|
+
const handleLiteralChange = useCallback2((raw, type) => {
|
|
760
882
|
let parsed;
|
|
761
883
|
switch (type) {
|
|
762
884
|
case "string":
|
|
@@ -778,7 +900,7 @@ function ExpressionEditor({
|
|
|
778
900
|
}
|
|
779
901
|
onChange({ type: "literal", value: parsed });
|
|
780
902
|
}, [onChange]);
|
|
781
|
-
const handleLiteralTypeChange =
|
|
903
|
+
const handleLiteralTypeChange = useCallback2((lt) => {
|
|
782
904
|
const newType = lt;
|
|
783
905
|
setLiteralType(newType);
|
|
784
906
|
switch (newType) {
|
|
@@ -796,38 +918,38 @@ function ExpressionEditor({
|
|
|
796
918
|
break;
|
|
797
919
|
}
|
|
798
920
|
}, [onChange]);
|
|
799
|
-
return /* @__PURE__ */
|
|
921
|
+
return /* @__PURE__ */ jsxs5("div", {
|
|
800
922
|
className: "space-y-1.5",
|
|
801
923
|
children: [
|
|
802
|
-
label && /* @__PURE__ */
|
|
924
|
+
label && /* @__PURE__ */ jsx13("div", {
|
|
803
925
|
className: "text-[11px] font-medium text-muted-foreground mb-1",
|
|
804
926
|
children: label
|
|
805
927
|
}),
|
|
806
928
|
(() => {
|
|
807
929
|
const litVal = value.type === "literal" ? value.value : undefined;
|
|
808
|
-
return /* @__PURE__ */
|
|
930
|
+
return /* @__PURE__ */ jsxs5(Tabs, {
|
|
809
931
|
value: value.type,
|
|
810
932
|
onValueChange: handleTypeChange,
|
|
811
933
|
children: [
|
|
812
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ jsxs5(TabsList, {
|
|
813
935
|
children: [
|
|
814
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ jsx13(TabsTrigger, {
|
|
815
937
|
value: "literal",
|
|
816
938
|
children: "Literal"
|
|
817
939
|
}),
|
|
818
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ jsx13(TabsTrigger, {
|
|
819
941
|
value: "jmespath",
|
|
820
942
|
children: "Expression"
|
|
821
943
|
}),
|
|
822
|
-
allowTemplate && /* @__PURE__ */
|
|
944
|
+
allowTemplate && /* @__PURE__ */ jsx13(TabsTrigger, {
|
|
823
945
|
value: "template",
|
|
824
946
|
children: "String Template"
|
|
825
947
|
})
|
|
826
948
|
]
|
|
827
949
|
}),
|
|
828
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ jsx13(TabsContent, {
|
|
829
951
|
value: "literal",
|
|
830
|
-
children: hasEnum ? /* @__PURE__ */
|
|
952
|
+
children: hasEnum ? /* @__PURE__ */ jsxs5(Select, {
|
|
831
953
|
value: String(litVal ?? ""),
|
|
832
954
|
onValueChange: (val) => {
|
|
833
955
|
const match = schemaHint?.enum?.find((e) => String(e) === val);
|
|
@@ -837,51 +959,51 @@ function ExpressionEditor({
|
|
|
837
959
|
});
|
|
838
960
|
},
|
|
839
961
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ jsx13(SelectTrigger, {
|
|
841
963
|
className: "h-8 text-xs font-mono w-full",
|
|
842
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ jsx13(SelectValue, {
|
|
843
965
|
placeholder: "-- select --"
|
|
844
966
|
})
|
|
845
967
|
}),
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
children: schemaHint?.enum?.map((v) => /* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ jsx13(SelectContent, {
|
|
969
|
+
children: schemaHint?.enum?.map((v) => /* @__PURE__ */ jsx13(SelectItem, {
|
|
848
970
|
value: String(v),
|
|
849
971
|
children: String(v)
|
|
850
972
|
}, String(v)))
|
|
851
973
|
})
|
|
852
974
|
]
|
|
853
|
-
}) : hintedLiteralType ? /* @__PURE__ */
|
|
975
|
+
}) : hintedLiteralType ? /* @__PURE__ */ jsx13(LiteralWidget, {
|
|
854
976
|
type: hintedLiteralType,
|
|
855
977
|
value: litVal,
|
|
856
978
|
onChange: (raw) => handleLiteralChange(raw, hintedLiteralType),
|
|
857
979
|
onValueChange: onChange
|
|
858
|
-
}) : /* @__PURE__ */
|
|
980
|
+
}) : /* @__PURE__ */ jsxs5(Tabs, {
|
|
859
981
|
value: literalType,
|
|
860
982
|
onValueChange: handleLiteralTypeChange,
|
|
861
983
|
children: [
|
|
862
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsxs5(TabsList, {
|
|
863
985
|
children: [
|
|
864
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ jsx13(TabsTrigger, {
|
|
865
987
|
value: "string",
|
|
866
988
|
children: "string"
|
|
867
989
|
}),
|
|
868
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ jsx13(TabsTrigger, {
|
|
869
991
|
value: "number",
|
|
870
992
|
children: "number"
|
|
871
993
|
}),
|
|
872
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ jsx13(TabsTrigger, {
|
|
873
995
|
value: "boolean",
|
|
874
996
|
children: "boolean"
|
|
875
997
|
}),
|
|
876
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ jsx13(TabsTrigger, {
|
|
877
999
|
value: "json",
|
|
878
1000
|
children: "json"
|
|
879
1001
|
})
|
|
880
1002
|
]
|
|
881
1003
|
}),
|
|
882
|
-
/* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ jsx13(TabsContent, {
|
|
883
1005
|
value: "string",
|
|
884
|
-
children: /* @__PURE__ */
|
|
1006
|
+
children: /* @__PURE__ */ jsx13(Input, {
|
|
885
1007
|
type: "text",
|
|
886
1008
|
value: String(litVal ?? ""),
|
|
887
1009
|
onChange: (e) => handleLiteralChange(e.target.value, "string"),
|
|
@@ -889,9 +1011,9 @@ function ExpressionEditor({
|
|
|
889
1011
|
placeholder: "Enter value..."
|
|
890
1012
|
})
|
|
891
1013
|
}),
|
|
892
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ jsx13(TabsContent, {
|
|
893
1015
|
value: "number",
|
|
894
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ jsx13(Input, {
|
|
895
1017
|
type: "number",
|
|
896
1018
|
value: String(litVal ?? ""),
|
|
897
1019
|
onChange: (e) => handleLiteralChange(e.target.value, "number"),
|
|
@@ -899,26 +1021,26 @@ function ExpressionEditor({
|
|
|
899
1021
|
placeholder: "0"
|
|
900
1022
|
})
|
|
901
1023
|
}),
|
|
902
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ jsx13(TabsContent, {
|
|
903
1025
|
value: "boolean",
|
|
904
|
-
children: /* @__PURE__ */
|
|
1026
|
+
children: /* @__PURE__ */ jsxs5(Select, {
|
|
905
1027
|
value: litVal === true ? "true" : "false",
|
|
906
1028
|
onValueChange: (val) => onChange({
|
|
907
1029
|
type: "literal",
|
|
908
1030
|
value: val === "true"
|
|
909
1031
|
}),
|
|
910
1032
|
children: [
|
|
911
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ jsx13(SelectTrigger, {
|
|
912
1034
|
className: "h-8 text-xs font-mono w-full",
|
|
913
|
-
children: /* @__PURE__ */
|
|
1035
|
+
children: /* @__PURE__ */ jsx13(SelectValue, {})
|
|
914
1036
|
}),
|
|
915
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ jsxs5(SelectContent, {
|
|
916
1038
|
children: [
|
|
917
|
-
/* @__PURE__ */
|
|
1039
|
+
/* @__PURE__ */ jsx13(SelectItem, {
|
|
918
1040
|
value: "true",
|
|
919
1041
|
children: "true"
|
|
920
1042
|
}),
|
|
921
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ jsx13(SelectItem, {
|
|
922
1044
|
value: "false",
|
|
923
1045
|
children: "false"
|
|
924
1046
|
})
|
|
@@ -927,9 +1049,9 @@ function ExpressionEditor({
|
|
|
927
1049
|
]
|
|
928
1050
|
})
|
|
929
1051
|
}),
|
|
930
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ jsx13(TabsContent, {
|
|
931
1053
|
value: "json",
|
|
932
|
-
children: /* @__PURE__ */
|
|
1054
|
+
children: /* @__PURE__ */ jsx13(JsonCodeEditor, {
|
|
933
1055
|
value: typeof litVal === "string" ? litVal : JSON.stringify(litVal, null, 2),
|
|
934
1056
|
onChange: (val) => handleLiteralChange(val, "json"),
|
|
935
1057
|
placeholderText: '{"key": "value"}'
|
|
@@ -938,9 +1060,9 @@ function ExpressionEditor({
|
|
|
938
1060
|
]
|
|
939
1061
|
})
|
|
940
1062
|
}),
|
|
941
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ jsx13(TabsContent, {
|
|
942
1064
|
value: "jmespath",
|
|
943
|
-
children: /* @__PURE__ */
|
|
1065
|
+
children: /* @__PURE__ */ jsx13(Input, {
|
|
944
1066
|
value: value.type === "jmespath" ? value.expression : "",
|
|
945
1067
|
onChange: (e) => onChange({
|
|
946
1068
|
type: "jmespath",
|
|
@@ -950,9 +1072,9 @@ function ExpressionEditor({
|
|
|
950
1072
|
placeholder: "stepId.outputKey"
|
|
951
1073
|
})
|
|
952
1074
|
}),
|
|
953
|
-
allowTemplate && /* @__PURE__ */
|
|
1075
|
+
allowTemplate && /* @__PURE__ */ jsx13(TabsContent, {
|
|
954
1076
|
value: "template",
|
|
955
|
-
children: /* @__PURE__ */
|
|
1077
|
+
children: /* @__PURE__ */ jsx13(Textarea, {
|
|
956
1078
|
value: value.type === "template" ? value.template : "",
|
|
957
1079
|
onChange: (e) => onChange({
|
|
958
1080
|
type: "template",
|
|
@@ -977,7 +1099,7 @@ function LiteralWidget({
|
|
|
977
1099
|
}) {
|
|
978
1100
|
switch (type) {
|
|
979
1101
|
case "string":
|
|
980
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ jsx13(Input, {
|
|
981
1103
|
type: "text",
|
|
982
1104
|
value: String(value ?? ""),
|
|
983
1105
|
onChange: (e) => onChange(e.target.value),
|
|
@@ -985,7 +1107,7 @@ function LiteralWidget({
|
|
|
985
1107
|
placeholder: "Enter value..."
|
|
986
1108
|
});
|
|
987
1109
|
case "number":
|
|
988
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ jsx13(Input, {
|
|
989
1111
|
type: "number",
|
|
990
1112
|
value: String(value ?? ""),
|
|
991
1113
|
onChange: (e) => onChange(e.target.value),
|
|
@@ -993,24 +1115,24 @@ function LiteralWidget({
|
|
|
993
1115
|
placeholder: "0"
|
|
994
1116
|
});
|
|
995
1117
|
case "boolean":
|
|
996
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ jsxs5(Select, {
|
|
997
1119
|
value: value === true ? "true" : "false",
|
|
998
1120
|
onValueChange: (val) => onValueChange({
|
|
999
1121
|
type: "literal",
|
|
1000
1122
|
value: val === "true"
|
|
1001
1123
|
}),
|
|
1002
1124
|
children: [
|
|
1003
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ jsx13(SelectTrigger, {
|
|
1004
1126
|
className: "h-8 text-xs font-mono w-full",
|
|
1005
|
-
children: /* @__PURE__ */
|
|
1127
|
+
children: /* @__PURE__ */ jsx13(SelectValue, {})
|
|
1006
1128
|
}),
|
|
1007
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ jsxs5(SelectContent, {
|
|
1008
1130
|
children: [
|
|
1009
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ jsx13(SelectItem, {
|
|
1010
1132
|
value: "true",
|
|
1011
1133
|
children: "true"
|
|
1012
1134
|
}),
|
|
1013
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ jsx13(SelectItem, {
|
|
1014
1136
|
value: "false",
|
|
1015
1137
|
children: "false"
|
|
1016
1138
|
})
|
|
@@ -1019,7 +1141,7 @@ function LiteralWidget({
|
|
|
1019
1141
|
]
|
|
1020
1142
|
});
|
|
1021
1143
|
case "json":
|
|
1022
|
-
return /* @__PURE__ */
|
|
1144
|
+
return /* @__PURE__ */ jsx13(JsonCodeEditor, {
|
|
1023
1145
|
value: typeof value === "string" ? value : JSON.stringify(value, null, 2),
|
|
1024
1146
|
onChange,
|
|
1025
1147
|
placeholderText: '{"key": "value"}'
|
|
@@ -1032,7 +1154,7 @@ import { syntaxHighlighting as syntaxHighlighting2 } from "@codemirror/language"
|
|
|
1032
1154
|
import { Compartment as Compartment2, EditorState as EditorState2 } from "@codemirror/state";
|
|
1033
1155
|
import { EditorView as EditorView3 } from "@codemirror/view";
|
|
1034
1156
|
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
1035
|
-
import { jsx as
|
|
1157
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1036
1158
|
function buildViewerTheme(dark) {
|
|
1037
1159
|
const viewerTheme = EditorView3.theme({
|
|
1038
1160
|
"&": {
|
|
@@ -1120,7 +1242,7 @@ function JsonViewer({ value, className }) {
|
|
|
1120
1242
|
observer.observe(el, { attributes: true, attributeFilter: ["class"] });
|
|
1121
1243
|
return () => observer.disconnect();
|
|
1122
1244
|
}, []);
|
|
1123
|
-
return /* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ jsx14("div", {
|
|
1124
1246
|
ref: containerRef,
|
|
1125
1247
|
className: cn("json-viewer", className),
|
|
1126
1248
|
style: hidden ? { display: "none" } : undefined
|
|
@@ -1963,13 +2085,13 @@ function buildEditableLayout(workflow, diagnostics = [], executionState, positio
|
|
|
1963
2085
|
}
|
|
1964
2086
|
// src/hooks/use-workflow-execution.ts
|
|
1965
2087
|
import { hashWorkflow } from "@remoraflow/core";
|
|
1966
|
-
import { useCallback as
|
|
2088
|
+
import { useCallback as useCallback3, useEffect as useEffect4, useRef as useRef4, useState as useState3 } from "react";
|
|
1967
2089
|
function useWorkflowExecution(workflow, options) {
|
|
1968
|
-
const [executionState, setExecutionState] =
|
|
1969
|
-
const [stateHistory, setStateHistory] =
|
|
1970
|
-
const [isRunning, setIsRunning] =
|
|
1971
|
-
const [replayIndex, setReplayIndex] =
|
|
1972
|
-
const [pausedState, setPausedState] =
|
|
2090
|
+
const [executionState, setExecutionState] = useState3(null);
|
|
2091
|
+
const [stateHistory, setStateHistory] = useState3([]);
|
|
2092
|
+
const [isRunning, setIsRunning] = useState3(false);
|
|
2093
|
+
const [replayIndex, setReplayIndex] = useState3(null);
|
|
2094
|
+
const [pausedState, setPausedState] = useState3(() => {
|
|
1973
2095
|
if (!workflow)
|
|
1974
2096
|
return null;
|
|
1975
2097
|
return options.persist?.load(hashWorkflow(workflow)) ?? null;
|
|
@@ -1989,7 +2111,7 @@ function useWorkflowExecution(workflow, options) {
|
|
|
1989
2111
|
options.persist?.clear(hash);
|
|
1990
2112
|
}
|
|
1991
2113
|
}, [workflow, pausedState, options.persist]);
|
|
1992
|
-
const startStreaming =
|
|
2114
|
+
const startStreaming = useCallback3(async (inputs, initialState) => {
|
|
1993
2115
|
if (!workflow)
|
|
1994
2116
|
return;
|
|
1995
2117
|
const ac = new AbortController;
|
|
@@ -2026,7 +2148,7 @@ function useWorkflowExecution(workflow, options) {
|
|
|
2026
2148
|
abortRef.current = null;
|
|
2027
2149
|
}
|
|
2028
2150
|
}, [workflow, options]);
|
|
2029
|
-
const run =
|
|
2151
|
+
const run = useCallback3((inputs) => {
|
|
2030
2152
|
if (!workflow || isRunning)
|
|
2031
2153
|
return;
|
|
2032
2154
|
const resolvedInputs = inputs ?? {};
|
|
@@ -2041,7 +2163,7 @@ function useWorkflowExecution(workflow, options) {
|
|
|
2041
2163
|
setIsRunning(true);
|
|
2042
2164
|
startStreaming(resolvedInputs);
|
|
2043
2165
|
}, [workflow, isRunning, startStreaming, options]);
|
|
2044
|
-
const pause =
|
|
2166
|
+
const pause = useCallback3(() => {
|
|
2045
2167
|
if (!workflow || !isRunning)
|
|
2046
2168
|
return;
|
|
2047
2169
|
const wfHash = hashWorkflow(workflow);
|
|
@@ -2053,7 +2175,7 @@ function useWorkflowExecution(workflow, options) {
|
|
|
2053
2175
|
abortRef.current?.abort();
|
|
2054
2176
|
setIsRunning(false);
|
|
2055
2177
|
}, [workflow, isRunning, options]);
|
|
2056
|
-
const resume =
|
|
2178
|
+
const resume = useCallback3(() => {
|
|
2057
2179
|
if (!workflow || !pausedState || isRunning)
|
|
2058
2180
|
return;
|
|
2059
2181
|
const wfHash = hashWorkflow(workflow);
|
|
@@ -2067,7 +2189,7 @@ function useWorkflowExecution(workflow, options) {
|
|
|
2067
2189
|
setIsRunning(true);
|
|
2068
2190
|
startStreaming(lastInputsRef.current, pausedState);
|
|
2069
2191
|
}, [workflow, pausedState, isRunning, startStreaming, options]);
|
|
2070
|
-
const reset =
|
|
2192
|
+
const reset = useCallback3(() => {
|
|
2071
2193
|
abortRef.current?.abort();
|
|
2072
2194
|
setExecutionState(null);
|
|
2073
2195
|
setStateHistory([]);
|
|
@@ -2078,14 +2200,14 @@ function useWorkflowExecution(workflow, options) {
|
|
|
2078
2200
|
if (workflow)
|
|
2079
2201
|
options.persist?.clear(hashWorkflow(workflow));
|
|
2080
2202
|
}, [workflow, options]);
|
|
2081
|
-
const seekTo =
|
|
2203
|
+
const seekTo = useCallback3((index) => {
|
|
2082
2204
|
const isAtEnd = index === stateHistoryRef.current.length - 1;
|
|
2083
2205
|
setReplayIndex(isAtEnd ? null : index);
|
|
2084
2206
|
const target = stateHistoryRef.current[index];
|
|
2085
2207
|
if (target)
|
|
2086
2208
|
setExecutionState(target);
|
|
2087
2209
|
}, []);
|
|
2088
|
-
const goLive =
|
|
2210
|
+
const goLive = useCallback3(() => {
|
|
2089
2211
|
setReplayIndex(null);
|
|
2090
2212
|
const latest = stateHistoryRef.current[stateHistoryRef.current.length - 1] ?? null;
|
|
2091
2213
|
setExecutionState(latest);
|
|
@@ -2106,86 +2228,86 @@ function useWorkflowExecution(workflow, options) {
|
|
|
2106
2228
|
}
|
|
2107
2229
|
// src/panels/shared.tsx
|
|
2108
2230
|
import {
|
|
2109
|
-
Bot,
|
|
2110
|
-
FileOutput,
|
|
2111
|
-
GitBranch,
|
|
2112
|
-
Hand,
|
|
2113
|
-
Moon,
|
|
2114
|
-
Play,
|
|
2115
|
-
Repeat,
|
|
2116
|
-
Sparkles,
|
|
2117
|
-
Timer,
|
|
2118
|
-
Wrench
|
|
2231
|
+
Bot as Bot2,
|
|
2232
|
+
FileOutput as FileOutput2,
|
|
2233
|
+
GitBranch as GitBranch2,
|
|
2234
|
+
Hand as Hand2,
|
|
2235
|
+
Moon as Moon2,
|
|
2236
|
+
Play as Play2,
|
|
2237
|
+
Repeat as Repeat2,
|
|
2238
|
+
Sparkles as Sparkles2,
|
|
2239
|
+
Timer as Timer2,
|
|
2240
|
+
Wrench as Wrench2
|
|
2119
2241
|
} from "lucide-react";
|
|
2120
|
-
import { jsx as
|
|
2242
|
+
import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2121
2243
|
var STEP_TYPE_META = {
|
|
2122
2244
|
start: {
|
|
2123
2245
|
label: "Start",
|
|
2124
2246
|
color: "text-green-600 dark:text-green-400",
|
|
2125
|
-
icon:
|
|
2247
|
+
icon: Play2
|
|
2126
2248
|
},
|
|
2127
2249
|
end: {
|
|
2128
2250
|
label: "End",
|
|
2129
2251
|
color: "text-muted-foreground",
|
|
2130
|
-
icon:
|
|
2252
|
+
icon: Hand2
|
|
2131
2253
|
},
|
|
2132
2254
|
"tool-call": {
|
|
2133
2255
|
label: "Tool Call",
|
|
2134
2256
|
color: "text-blue-600 dark:text-blue-400",
|
|
2135
|
-
icon:
|
|
2257
|
+
icon: Wrench2
|
|
2136
2258
|
},
|
|
2137
2259
|
"llm-prompt": {
|
|
2138
2260
|
label: "LLM Prompt",
|
|
2139
2261
|
color: "text-violet-600 dark:text-violet-400",
|
|
2140
|
-
icon:
|
|
2262
|
+
icon: Sparkles2
|
|
2141
2263
|
},
|
|
2142
2264
|
"extract-data": {
|
|
2143
2265
|
label: "Extract Data",
|
|
2144
2266
|
color: "text-purple-600 dark:text-purple-400",
|
|
2145
|
-
icon:
|
|
2267
|
+
icon: FileOutput2
|
|
2146
2268
|
},
|
|
2147
2269
|
"switch-case": {
|
|
2148
2270
|
label: "Switch Case",
|
|
2149
2271
|
color: "text-amber-600 dark:text-amber-400",
|
|
2150
|
-
icon:
|
|
2272
|
+
icon: GitBranch2
|
|
2151
2273
|
},
|
|
2152
2274
|
"for-each": {
|
|
2153
2275
|
label: "For Each",
|
|
2154
2276
|
color: "text-emerald-600 dark:text-emerald-400",
|
|
2155
|
-
icon:
|
|
2277
|
+
icon: Repeat2
|
|
2156
2278
|
},
|
|
2157
2279
|
sleep: {
|
|
2158
2280
|
label: "Sleep",
|
|
2159
2281
|
color: "text-yellow-600 dark:text-yellow-400",
|
|
2160
|
-
icon:
|
|
2282
|
+
icon: Moon2
|
|
2161
2283
|
},
|
|
2162
2284
|
"wait-for-condition": {
|
|
2163
2285
|
label: "Wait",
|
|
2164
2286
|
color: "text-orange-600 dark:text-orange-400",
|
|
2165
|
-
icon:
|
|
2287
|
+
icon: Timer2
|
|
2166
2288
|
},
|
|
2167
2289
|
"agent-loop": {
|
|
2168
2290
|
label: "Agent Loop",
|
|
2169
2291
|
color: "text-teal-600 dark:text-teal-400",
|
|
2170
|
-
icon:
|
|
2292
|
+
icon: Bot2
|
|
2171
2293
|
}
|
|
2172
2294
|
};
|
|
2173
2295
|
function TypeBadge({ type }) {
|
|
2174
2296
|
const meta = STEP_TYPE_META[type];
|
|
2175
2297
|
if (!meta) {
|
|
2176
|
-
return /* @__PURE__ */
|
|
2298
|
+
return /* @__PURE__ */ jsx15("span", {
|
|
2177
2299
|
className: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",
|
|
2178
2300
|
children: type
|
|
2179
2301
|
});
|
|
2180
2302
|
}
|
|
2181
2303
|
const Icon = meta.icon;
|
|
2182
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ jsxs6("span", {
|
|
2183
2305
|
className: `inline-flex items-center gap-1.5 shrink-0 ${meta.color}`,
|
|
2184
2306
|
children: [
|
|
2185
|
-
/* @__PURE__ */
|
|
2307
|
+
/* @__PURE__ */ jsx15(Icon, {
|
|
2186
2308
|
className: "w-3.5 h-3.5"
|
|
2187
2309
|
}),
|
|
2188
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2189
2311
|
className: "text-[10px] font-semibold uppercase tracking-wide",
|
|
2190
2312
|
children: meta.label
|
|
2191
2313
|
})
|
|
@@ -2193,20 +2315,20 @@ function TypeBadge({ type }) {
|
|
|
2193
2315
|
});
|
|
2194
2316
|
}
|
|
2195
2317
|
function SectionHeader({ children }) {
|
|
2196
|
-
return /* @__PURE__ */
|
|
2318
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
2197
2319
|
className: "text-xs font-semibold text-foreground mb-2",
|
|
2198
2320
|
children
|
|
2199
2321
|
});
|
|
2200
2322
|
}
|
|
2201
2323
|
function Label2({ children }) {
|
|
2202
|
-
return /* @__PURE__ */
|
|
2324
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
2203
2325
|
className: "text-[11px] font-medium text-muted-foreground mb-1",
|
|
2204
2326
|
children
|
|
2205
2327
|
});
|
|
2206
2328
|
}
|
|
2207
2329
|
|
|
2208
2330
|
// src/panels/step-detail-panel.tsx
|
|
2209
|
-
import { jsx as
|
|
2331
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2210
2332
|
function jsonString(value) {
|
|
2211
2333
|
return typeof value === "string" ? value : JSON.stringify(value, null, 2);
|
|
2212
2334
|
}
|
|
@@ -2225,7 +2347,7 @@ function StatusBadge({ summary }) {
|
|
|
2225
2347
|
failed: "bg-red-50 text-red-700 border border-red-200 dark:bg-red-950/40 dark:text-red-300 dark:border-red-800",
|
|
2226
2348
|
skipped: "bg-muted text-muted-foreground border border-border"
|
|
2227
2349
|
};
|
|
2228
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ jsx16("span", {
|
|
2229
2351
|
className: `text-[11px] font-semibold px-2.5 py-0.5 rounded-full ${colors[summary.status]}`,
|
|
2230
2352
|
children: summary.status
|
|
2231
2353
|
});
|
|
@@ -2236,13 +2358,13 @@ function ResolvedCode({
|
|
|
2236
2358
|
}) {
|
|
2237
2359
|
const display = jsonString(value);
|
|
2238
2360
|
if (typeof value === "string") {
|
|
2239
|
-
return /* @__PURE__ */
|
|
2361
|
+
return /* @__PURE__ */ jsx16("pre", {
|
|
2240
2362
|
className: "text-xs text-emerald-700 bg-emerald-50 dark:text-emerald-300 dark:bg-emerald-950/40 rounded-md p-2.5 whitespace-pre-wrap font-mono overflow-auto max-h-[200px] cursor-default border border-emerald-200/60 dark:border-emerald-900/50",
|
|
2241
2363
|
title: expression,
|
|
2242
2364
|
children: display
|
|
2243
2365
|
});
|
|
2244
2366
|
}
|
|
2245
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ jsx16(JsonViewer, {
|
|
2246
2368
|
value: display
|
|
2247
2369
|
});
|
|
2248
2370
|
}
|
|
@@ -2253,42 +2375,42 @@ function StepParams({
|
|
|
2253
2375
|
const resolved = resolvedInputs;
|
|
2254
2376
|
switch (step.type) {
|
|
2255
2377
|
case "tool-call":
|
|
2256
|
-
return /* @__PURE__ */
|
|
2378
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2257
2379
|
className: "space-y-3",
|
|
2258
2380
|
children: [
|
|
2259
|
-
/* @__PURE__ */
|
|
2381
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2260
2382
|
children: [
|
|
2261
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2262
2384
|
children: "Tool"
|
|
2263
2385
|
}),
|
|
2264
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2265
2387
|
className: "text-xs font-mono font-medium text-foreground bg-muted/40 rounded px-2 py-1 inline-block",
|
|
2266
2388
|
children: step.params.toolName
|
|
2267
2389
|
})
|
|
2268
2390
|
]
|
|
2269
2391
|
}),
|
|
2270
|
-
Object.keys(step.params.toolInput).length > 0 && /* @__PURE__ */
|
|
2392
|
+
Object.keys(step.params.toolInput).length > 0 && /* @__PURE__ */ jsxs7("div", {
|
|
2271
2393
|
children: [
|
|
2272
|
-
/* @__PURE__ */
|
|
2394
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2273
2395
|
children: "Inputs"
|
|
2274
2396
|
}),
|
|
2275
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2276
2398
|
className: "space-y-1.5",
|
|
2277
2399
|
children: Object.entries(step.params.toolInput).map(([key, val]) => {
|
|
2278
2400
|
const resolvedVal = resolved?.[key];
|
|
2279
2401
|
const hasResolved = resolvedVal !== undefined;
|
|
2280
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2281
2403
|
className: "flex gap-2 text-xs items-baseline",
|
|
2282
2404
|
children: [
|
|
2283
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2284
2406
|
className: "font-mono font-medium text-muted-foreground shrink-0",
|
|
2285
2407
|
children: key
|
|
2286
2408
|
}),
|
|
2287
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2288
2410
|
className: "text-muted-foreground/40",
|
|
2289
2411
|
children: "="
|
|
2290
2412
|
}),
|
|
2291
|
-
/* @__PURE__ */
|
|
2413
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2292
2414
|
className: `font-mono ${hasResolved ? "text-emerald-700 dark:text-emerald-300" : "text-foreground"}`,
|
|
2293
2415
|
title: hasResolved ? renderExpression2(val) : undefined,
|
|
2294
2416
|
children: hasResolved ? typeof resolvedVal === "string" ? resolvedVal : JSON.stringify(resolvedVal) : renderExpression2(val)
|
|
@@ -2302,29 +2424,29 @@ function StepParams({
|
|
|
2302
2424
|
]
|
|
2303
2425
|
});
|
|
2304
2426
|
case "llm-prompt":
|
|
2305
|
-
return /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2306
2428
|
className: "space-y-2",
|
|
2307
2429
|
children: [
|
|
2308
|
-
/* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2309
2431
|
children: [
|
|
2310
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2311
2433
|
children: "Prompt"
|
|
2312
2434
|
}),
|
|
2313
|
-
resolved?.prompt ? /* @__PURE__ */
|
|
2435
|
+
resolved?.prompt ? /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2314
2436
|
value: resolved.prompt,
|
|
2315
2437
|
expression: step.params.prompt
|
|
2316
|
-
}) : /* @__PURE__ */
|
|
2438
|
+
}) : /* @__PURE__ */ jsx16("pre", {
|
|
2317
2439
|
className: "text-xs rounded p-2 whitespace-pre-wrap font-mono text-foreground bg-muted",
|
|
2318
2440
|
children: step.params.prompt
|
|
2319
2441
|
})
|
|
2320
2442
|
]
|
|
2321
2443
|
}),
|
|
2322
|
-
/* @__PURE__ */
|
|
2444
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2323
2445
|
children: [
|
|
2324
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2325
2447
|
children: "Output Format"
|
|
2326
2448
|
}),
|
|
2327
|
-
/* @__PURE__ */
|
|
2449
|
+
/* @__PURE__ */ jsx16(JsonViewer, {
|
|
2328
2450
|
value: JSON.stringify(step.params.outputFormat, null, 2)
|
|
2329
2451
|
})
|
|
2330
2452
|
]
|
|
@@ -2332,28 +2454,28 @@ function StepParams({
|
|
|
2332
2454
|
]
|
|
2333
2455
|
});
|
|
2334
2456
|
case "extract-data":
|
|
2335
|
-
return /* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2336
2458
|
className: "space-y-2",
|
|
2337
2459
|
children: [
|
|
2338
|
-
/* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2339
2461
|
children: [
|
|
2340
|
-
/* @__PURE__ */
|
|
2462
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2341
2463
|
children: "Source"
|
|
2342
2464
|
}),
|
|
2343
|
-
resolved?.sourceData !== undefined ? /* @__PURE__ */
|
|
2465
|
+
resolved?.sourceData !== undefined ? /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2344
2466
|
value: resolved.sourceData,
|
|
2345
2467
|
expression: renderExpression2(step.params.sourceData)
|
|
2346
|
-
}) : /* @__PURE__ */
|
|
2468
|
+
}) : /* @__PURE__ */ jsx16(Code, {
|
|
2347
2469
|
children: renderExpression2(step.params.sourceData)
|
|
2348
2470
|
})
|
|
2349
2471
|
]
|
|
2350
2472
|
}),
|
|
2351
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2352
2474
|
children: [
|
|
2353
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2354
2476
|
children: "Output Format"
|
|
2355
2477
|
}),
|
|
2356
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ jsx16(JsonViewer, {
|
|
2357
2479
|
value: JSON.stringify(step.params.outputFormat, null, 2)
|
|
2358
2480
|
})
|
|
2359
2481
|
]
|
|
@@ -2361,41 +2483,41 @@ function StepParams({
|
|
|
2361
2483
|
]
|
|
2362
2484
|
});
|
|
2363
2485
|
case "switch-case":
|
|
2364
|
-
return /* @__PURE__ */
|
|
2486
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2365
2487
|
className: "space-y-3",
|
|
2366
2488
|
children: [
|
|
2367
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2368
2490
|
children: [
|
|
2369
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2370
2492
|
children: "Switch On"
|
|
2371
2493
|
}),
|
|
2372
|
-
resolved?.switchOn !== undefined ? /* @__PURE__ */
|
|
2494
|
+
resolved?.switchOn !== undefined ? /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2373
2495
|
value: resolved.switchOn,
|
|
2374
2496
|
expression: renderExpression2(step.params.switchOn)
|
|
2375
|
-
}) : /* @__PURE__ */
|
|
2497
|
+
}) : /* @__PURE__ */ jsx16(Code, {
|
|
2376
2498
|
children: renderExpression2(step.params.switchOn)
|
|
2377
2499
|
})
|
|
2378
2500
|
]
|
|
2379
2501
|
}),
|
|
2380
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2381
2503
|
children: [
|
|
2382
|
-
/* @__PURE__ */
|
|
2504
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2383
2505
|
children: "Cases"
|
|
2384
2506
|
}),
|
|
2385
|
-
/* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2386
2508
|
className: "space-y-1.5",
|
|
2387
|
-
children: step.params.cases.map((c) => /* @__PURE__ */
|
|
2509
|
+
children: step.params.cases.map((c) => /* @__PURE__ */ jsxs7("div", {
|
|
2388
2510
|
className: "text-xs flex items-center gap-2 bg-muted/30 rounded-md px-2.5 py-1.5",
|
|
2389
2511
|
children: [
|
|
2390
|
-
/* @__PURE__ */
|
|
2512
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2391
2513
|
className: "font-mono font-medium text-muted-foreground",
|
|
2392
2514
|
children: c.value.type === "default" ? "default" : renderExpression2(c.value)
|
|
2393
2515
|
}),
|
|
2394
|
-
/* @__PURE__ */
|
|
2516
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2395
2517
|
className: "text-muted-foreground/40",
|
|
2396
2518
|
children: "→"
|
|
2397
2519
|
}),
|
|
2398
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2399
2521
|
className: "font-mono font-medium text-foreground",
|
|
2400
2522
|
children: c.branchBodyStepId
|
|
2401
2523
|
})
|
|
@@ -2407,38 +2529,38 @@ function StepParams({
|
|
|
2407
2529
|
]
|
|
2408
2530
|
});
|
|
2409
2531
|
case "for-each":
|
|
2410
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2411
2533
|
className: "space-y-2",
|
|
2412
2534
|
children: [
|
|
2413
|
-
/* @__PURE__ */
|
|
2535
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2414
2536
|
children: [
|
|
2415
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2416
2538
|
children: "Target"
|
|
2417
2539
|
}),
|
|
2418
|
-
resolved?.target !== undefined ? /* @__PURE__ */
|
|
2540
|
+
resolved?.target !== undefined ? /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2419
2541
|
value: resolved.target,
|
|
2420
2542
|
expression: renderExpression2(step.params.target)
|
|
2421
|
-
}) : /* @__PURE__ */
|
|
2543
|
+
}) : /* @__PURE__ */ jsx16(Code, {
|
|
2422
2544
|
children: renderExpression2(step.params.target)
|
|
2423
2545
|
})
|
|
2424
2546
|
]
|
|
2425
2547
|
}),
|
|
2426
|
-
/* @__PURE__ */
|
|
2548
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2427
2549
|
children: [
|
|
2428
|
-
/* @__PURE__ */
|
|
2550
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2429
2551
|
children: "Item Variable"
|
|
2430
2552
|
}),
|
|
2431
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ jsx16(Code, {
|
|
2432
2554
|
children: step.params.itemName
|
|
2433
2555
|
})
|
|
2434
2556
|
]
|
|
2435
2557
|
}),
|
|
2436
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2437
2559
|
children: [
|
|
2438
|
-
/* @__PURE__ */
|
|
2560
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2439
2561
|
children: "Loop Body"
|
|
2440
2562
|
}),
|
|
2441
|
-
/* @__PURE__ */
|
|
2563
|
+
/* @__PURE__ */ jsx16(Code, {
|
|
2442
2564
|
children: step.params.loopBodyStepId
|
|
2443
2565
|
})
|
|
2444
2566
|
]
|
|
@@ -2446,17 +2568,17 @@ function StepParams({
|
|
|
2446
2568
|
]
|
|
2447
2569
|
});
|
|
2448
2570
|
case "sleep":
|
|
2449
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
2450
2572
|
className: "space-y-2",
|
|
2451
|
-
children: /* @__PURE__ */
|
|
2573
|
+
children: /* @__PURE__ */ jsxs7("div", {
|
|
2452
2574
|
children: [
|
|
2453
|
-
/* @__PURE__ */
|
|
2575
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2454
2576
|
children: "Duration"
|
|
2455
2577
|
}),
|
|
2456
|
-
resolved?.durationMs !== undefined ? /* @__PURE__ */
|
|
2578
|
+
resolved?.durationMs !== undefined ? /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2457
2579
|
value: `${resolved.durationMs}ms`,
|
|
2458
2580
|
expression: renderExpression2(step.params.durationMs)
|
|
2459
|
-
}) : /* @__PURE__ */
|
|
2581
|
+
}) : /* @__PURE__ */ jsxs7(Code, {
|
|
2460
2582
|
children: [
|
|
2461
2583
|
renderExpression2(step.params.durationMs),
|
|
2462
2584
|
"ms"
|
|
@@ -2466,48 +2588,48 @@ function StepParams({
|
|
|
2466
2588
|
})
|
|
2467
2589
|
});
|
|
2468
2590
|
case "wait-for-condition":
|
|
2469
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2470
2592
|
className: "space-y-2",
|
|
2471
2593
|
children: [
|
|
2472
|
-
/* @__PURE__ */
|
|
2594
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2473
2595
|
children: [
|
|
2474
|
-
/* @__PURE__ */
|
|
2596
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2475
2597
|
children: "Condition"
|
|
2476
2598
|
}),
|
|
2477
|
-
resolved?.condition !== undefined ? /* @__PURE__ */
|
|
2599
|
+
resolved?.condition !== undefined ? /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2478
2600
|
value: resolved.condition,
|
|
2479
2601
|
expression: renderExpression2(step.params.condition)
|
|
2480
|
-
}) : /* @__PURE__ */
|
|
2602
|
+
}) : /* @__PURE__ */ jsx16(Code, {
|
|
2481
2603
|
children: renderExpression2(step.params.condition)
|
|
2482
2604
|
})
|
|
2483
2605
|
]
|
|
2484
2606
|
}),
|
|
2485
|
-
/* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2486
2608
|
children: [
|
|
2487
|
-
/* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2488
2610
|
children: "Condition Step"
|
|
2489
2611
|
}),
|
|
2490
|
-
/* @__PURE__ */
|
|
2612
|
+
/* @__PURE__ */ jsx16(Code, {
|
|
2491
2613
|
children: step.params.conditionStepId
|
|
2492
2614
|
})
|
|
2493
2615
|
]
|
|
2494
2616
|
}),
|
|
2495
|
-
step.params.maxAttempts && /* @__PURE__ */
|
|
2617
|
+
step.params.maxAttempts && /* @__PURE__ */ jsxs7("div", {
|
|
2496
2618
|
children: [
|
|
2497
|
-
/* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2498
2620
|
children: "Max Attempts"
|
|
2499
2621
|
}),
|
|
2500
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ jsx16(Code, {
|
|
2501
2623
|
children: renderExpression2(step.params.maxAttempts)
|
|
2502
2624
|
})
|
|
2503
2625
|
]
|
|
2504
2626
|
}),
|
|
2505
|
-
step.params.intervalMs && /* @__PURE__ */
|
|
2627
|
+
step.params.intervalMs && /* @__PURE__ */ jsxs7("div", {
|
|
2506
2628
|
children: [
|
|
2507
|
-
/* @__PURE__ */
|
|
2629
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2508
2630
|
children: "Interval"
|
|
2509
2631
|
}),
|
|
2510
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ jsxs7(Code, {
|
|
2511
2633
|
children: [
|
|
2512
2634
|
renderExpression2(step.params.intervalMs),
|
|
2513
2635
|
"ms"
|
|
@@ -2515,12 +2637,12 @@ function StepParams({
|
|
|
2515
2637
|
})
|
|
2516
2638
|
]
|
|
2517
2639
|
}),
|
|
2518
|
-
step.params.timeoutMs && /* @__PURE__ */
|
|
2640
|
+
step.params.timeoutMs && /* @__PURE__ */ jsxs7("div", {
|
|
2519
2641
|
children: [
|
|
2520
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2521
2643
|
children: "Timeout"
|
|
2522
2644
|
}),
|
|
2523
|
-
/* @__PURE__ */
|
|
2645
|
+
/* @__PURE__ */ jsxs7(Code, {
|
|
2524
2646
|
children: [
|
|
2525
2647
|
renderExpression2(step.params.timeoutMs),
|
|
2526
2648
|
"ms"
|
|
@@ -2531,46 +2653,46 @@ function StepParams({
|
|
|
2531
2653
|
]
|
|
2532
2654
|
});
|
|
2533
2655
|
case "agent-loop":
|
|
2534
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2535
2657
|
className: "space-y-2",
|
|
2536
2658
|
children: [
|
|
2537
|
-
/* @__PURE__ */
|
|
2659
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2538
2660
|
children: [
|
|
2539
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2540
2662
|
children: "Instructions"
|
|
2541
2663
|
}),
|
|
2542
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ jsx16("pre", {
|
|
2543
2665
|
className: "text-xs rounded p-2 whitespace-pre-wrap font-mono text-foreground bg-muted",
|
|
2544
2666
|
children: step.params.instructions
|
|
2545
2667
|
})
|
|
2546
2668
|
]
|
|
2547
2669
|
}),
|
|
2548
|
-
step.params.tools.length > 0 && /* @__PURE__ */
|
|
2670
|
+
step.params.tools.length > 0 && /* @__PURE__ */ jsxs7("div", {
|
|
2549
2671
|
children: [
|
|
2550
|
-
/* @__PURE__ */
|
|
2672
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2551
2673
|
children: "Tools"
|
|
2552
2674
|
}),
|
|
2553
|
-
/* @__PURE__ */
|
|
2675
|
+
/* @__PURE__ */ jsx16(Code, {
|
|
2554
2676
|
children: step.params.tools.join(", ")
|
|
2555
2677
|
})
|
|
2556
2678
|
]
|
|
2557
2679
|
}),
|
|
2558
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2559
2681
|
children: [
|
|
2560
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2561
2683
|
children: "Output Format"
|
|
2562
2684
|
}),
|
|
2563
|
-
/* @__PURE__ */
|
|
2685
|
+
/* @__PURE__ */ jsx16(JsonViewer, {
|
|
2564
2686
|
value: JSON.stringify(step.params.outputFormat, null, 2)
|
|
2565
2687
|
})
|
|
2566
2688
|
]
|
|
2567
2689
|
}),
|
|
2568
|
-
step.params.maxSteps && /* @__PURE__ */
|
|
2690
|
+
step.params.maxSteps && /* @__PURE__ */ jsxs7("div", {
|
|
2569
2691
|
children: [
|
|
2570
|
-
/* @__PURE__ */
|
|
2692
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2571
2693
|
children: "Max Steps"
|
|
2572
2694
|
}),
|
|
2573
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ jsx16(Code, {
|
|
2574
2696
|
children: renderExpression2(step.params.maxSteps)
|
|
2575
2697
|
})
|
|
2576
2698
|
]
|
|
@@ -2581,17 +2703,17 @@ function StepParams({
|
|
|
2581
2703
|
return null;
|
|
2582
2704
|
case "end":
|
|
2583
2705
|
if (step.params?.output) {
|
|
2584
|
-
return /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
2585
2707
|
className: "space-y-2",
|
|
2586
|
-
children: /* @__PURE__ */
|
|
2708
|
+
children: /* @__PURE__ */ jsxs7("div", {
|
|
2587
2709
|
children: [
|
|
2588
|
-
/* @__PURE__ */
|
|
2710
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2589
2711
|
children: "Output"
|
|
2590
2712
|
}),
|
|
2591
|
-
resolved?.output !== undefined ? /* @__PURE__ */
|
|
2713
|
+
resolved?.output !== undefined ? /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2592
2714
|
value: resolved.output,
|
|
2593
2715
|
expression: renderExpression2(step.params.output)
|
|
2594
|
-
}) : /* @__PURE__ */
|
|
2716
|
+
}) : /* @__PURE__ */ jsx16(Code, {
|
|
2595
2717
|
children: renderExpression2(step.params.output)
|
|
2596
2718
|
})
|
|
2597
2719
|
]
|
|
@@ -2602,13 +2724,13 @@ function StepParams({
|
|
|
2602
2724
|
}
|
|
2603
2725
|
}
|
|
2604
2726
|
function Label3({ children }) {
|
|
2605
|
-
return /* @__PURE__ */
|
|
2727
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
2606
2728
|
className: "text-[11px] font-medium text-muted-foreground mb-1",
|
|
2607
2729
|
children
|
|
2608
2730
|
});
|
|
2609
2731
|
}
|
|
2610
2732
|
function Code({ children }) {
|
|
2611
|
-
return /* @__PURE__ */
|
|
2733
|
+
return /* @__PURE__ */ jsx16("pre", {
|
|
2612
2734
|
className: "text-xs rounded-md p-2.5 whitespace-pre-wrap font-mono overflow-auto max-h-[200px] text-foreground bg-muted/60 border border-border/50",
|
|
2613
2735
|
children
|
|
2614
2736
|
});
|
|
@@ -2638,10 +2760,10 @@ var recordStatusColors = {
|
|
|
2638
2760
|
function TraceSection({ trace }) {
|
|
2639
2761
|
if (trace.length === 0)
|
|
2640
2762
|
return null;
|
|
2641
|
-
return /* @__PURE__ */
|
|
2763
|
+
return /* @__PURE__ */ jsxs7("details", {
|
|
2642
2764
|
className: "text-xs group",
|
|
2643
2765
|
children: [
|
|
2644
|
-
/* @__PURE__ */
|
|
2766
|
+
/* @__PURE__ */ jsxs7("summary", {
|
|
2645
2767
|
className: "text-[11px] font-medium text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors py-0.5",
|
|
2646
2768
|
children: [
|
|
2647
2769
|
"Agent Trace (",
|
|
@@ -2651,9 +2773,9 @@ function TraceSection({ trace }) {
|
|
|
2651
2773
|
")"
|
|
2652
2774
|
]
|
|
2653
2775
|
}),
|
|
2654
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2655
2777
|
className: "mt-1.5",
|
|
2656
|
-
children: /* @__PURE__ */
|
|
2778
|
+
children: /* @__PURE__ */ jsx16(JsonViewer, {
|
|
2657
2779
|
value: JSON.stringify(trace, null, 2)
|
|
2658
2780
|
})
|
|
2659
2781
|
})
|
|
@@ -2662,28 +2784,28 @@ function TraceSection({ trace }) {
|
|
|
2662
2784
|
}
|
|
2663
2785
|
function ExecutionRecordCard({ record }) {
|
|
2664
2786
|
const pathLabel = record.path.length > 0 ? record.path.map(formatPathSegment).join(" > ") : null;
|
|
2665
|
-
return /* @__PURE__ */
|
|
2787
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2666
2788
|
className: "border border-border rounded-lg p-3 space-y-2 bg-card",
|
|
2667
2789
|
children: [
|
|
2668
|
-
pathLabel && /* @__PURE__ */
|
|
2790
|
+
pathLabel && /* @__PURE__ */ jsx16("div", {
|
|
2669
2791
|
className: "text-[11px] font-medium text-muted-foreground",
|
|
2670
2792
|
children: pathLabel
|
|
2671
2793
|
}),
|
|
2672
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2673
2795
|
className: "flex items-center gap-2",
|
|
2674
2796
|
children: [
|
|
2675
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2676
2798
|
className: `text-[11px] font-semibold px-2.5 py-0.5 rounded-full ${recordStatusColors[record.status]}`,
|
|
2677
2799
|
children: record.status
|
|
2678
2800
|
}),
|
|
2679
|
-
record.durationMs !== undefined && /* @__PURE__ */
|
|
2801
|
+
record.durationMs !== undefined && /* @__PURE__ */ jsxs7("span", {
|
|
2680
2802
|
className: "text-[11px] text-muted-foreground tabular-nums",
|
|
2681
2803
|
children: [
|
|
2682
2804
|
record.durationMs,
|
|
2683
2805
|
"ms"
|
|
2684
2806
|
]
|
|
2685
2807
|
}),
|
|
2686
|
-
record.retries.length > 0 && /* @__PURE__ */
|
|
2808
|
+
record.retries.length > 0 && /* @__PURE__ */ jsxs7("span", {
|
|
2687
2809
|
className: "text-[11px] font-medium text-amber-600 dark:text-amber-400",
|
|
2688
2810
|
children: [
|
|
2689
2811
|
record.retries.length,
|
|
@@ -2693,47 +2815,47 @@ function ExecutionRecordCard({ record }) {
|
|
|
2693
2815
|
})
|
|
2694
2816
|
]
|
|
2695
2817
|
}),
|
|
2696
|
-
record.resolvedInputs !== undefined && /* @__PURE__ */
|
|
2818
|
+
record.resolvedInputs !== undefined && /* @__PURE__ */ jsxs7("details", {
|
|
2697
2819
|
className: "text-xs group",
|
|
2698
2820
|
children: [
|
|
2699
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ jsx16("summary", {
|
|
2700
2822
|
className: "text-[11px] font-medium text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors py-0.5",
|
|
2701
2823
|
children: "Resolved Inputs"
|
|
2702
2824
|
}),
|
|
2703
|
-
/* @__PURE__ */
|
|
2825
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2704
2826
|
className: "mt-1.5",
|
|
2705
|
-
children: /* @__PURE__ */
|
|
2827
|
+
children: /* @__PURE__ */ jsx16(ResolvedCode, {
|
|
2706
2828
|
value: record.resolvedInputs
|
|
2707
2829
|
})
|
|
2708
2830
|
})
|
|
2709
2831
|
]
|
|
2710
2832
|
}),
|
|
2711
|
-
record.output !== undefined && /* @__PURE__ */
|
|
2833
|
+
record.output !== undefined && /* @__PURE__ */ jsxs7("details", {
|
|
2712
2834
|
className: "text-xs group",
|
|
2713
2835
|
children: [
|
|
2714
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ jsx16("summary", {
|
|
2715
2837
|
className: "text-[11px] font-medium text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors py-0.5",
|
|
2716
2838
|
children: "Output"
|
|
2717
2839
|
}),
|
|
2718
|
-
/* @__PURE__ */
|
|
2840
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2719
2841
|
className: "mt-1.5",
|
|
2720
|
-
children: /* @__PURE__ */
|
|
2842
|
+
children: /* @__PURE__ */ jsx16(JsonViewer, {
|
|
2721
2843
|
value: jsonString(record.output)
|
|
2722
2844
|
})
|
|
2723
2845
|
})
|
|
2724
2846
|
]
|
|
2725
2847
|
}),
|
|
2726
|
-
record.trace && record.trace.length > 0 && /* @__PURE__ */
|
|
2848
|
+
record.trace && record.trace.length > 0 && /* @__PURE__ */ jsx16(TraceSection, {
|
|
2727
2849
|
trace: record.trace
|
|
2728
2850
|
}),
|
|
2729
|
-
record.error && /* @__PURE__ */
|
|
2851
|
+
record.error && /* @__PURE__ */ jsxs7("div", {
|
|
2730
2852
|
className: "text-xs p-2.5 rounded-md bg-red-50 text-red-700 border border-red-200/80 dark:bg-red-950/30 dark:text-red-300 dark:border-red-800/60",
|
|
2731
2853
|
children: [
|
|
2732
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2733
2855
|
className: "font-semibold font-mono",
|
|
2734
2856
|
children: record.error.code
|
|
2735
2857
|
}),
|
|
2736
|
-
/* @__PURE__ */
|
|
2858
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2737
2859
|
className: "mt-1 leading-relaxed",
|
|
2738
2860
|
children: record.error.message
|
|
2739
2861
|
})
|
|
@@ -2749,16 +2871,16 @@ function StepDetailPanel({
|
|
|
2749
2871
|
executionRecords,
|
|
2750
2872
|
onClose
|
|
2751
2873
|
}) {
|
|
2752
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
2753
2875
|
className: "w-[360px] border-l h-full min-h-0 overflow-y-auto bg-card border-border",
|
|
2754
2876
|
children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2756
2878
|
className: "sticky top-0 z-10 border-b px-4 py-3 flex items-center justify-between bg-card/95 backdrop-blur-sm border-border",
|
|
2757
2879
|
children: [
|
|
2758
|
-
/* @__PURE__ */
|
|
2880
|
+
/* @__PURE__ */ jsx16(TypeBadge, {
|
|
2759
2881
|
type: step.type
|
|
2760
2882
|
}),
|
|
2761
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ jsx16("button", {
|
|
2762
2884
|
type: "button",
|
|
2763
2885
|
onClick: onClose,
|
|
2764
2886
|
className: "text-lg leading-none text-muted-foreground hover:text-foreground shrink-0 rounded-md w-7 h-7 flex items-center justify-center hover:bg-muted transition-colors",
|
|
@@ -2766,84 +2888,84 @@ function StepDetailPanel({
|
|
|
2766
2888
|
})
|
|
2767
2889
|
]
|
|
2768
2890
|
}),
|
|
2769
|
-
/* @__PURE__ */
|
|
2891
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2770
2892
|
className: "px-4 py-4 space-y-5",
|
|
2771
2893
|
children: [
|
|
2772
|
-
/* @__PURE__ */
|
|
2894
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2773
2895
|
className: "font-medium text-sm text-foreground",
|
|
2774
2896
|
children: step.name
|
|
2775
2897
|
}),
|
|
2776
|
-
/* @__PURE__ */
|
|
2898
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2777
2899
|
children: [
|
|
2778
|
-
/* @__PURE__ */
|
|
2900
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2779
2901
|
children: "Step ID"
|
|
2780
2902
|
}),
|
|
2781
|
-
/* @__PURE__ */
|
|
2903
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2782
2904
|
className: "text-xs font-mono text-muted-foreground bg-muted/40 rounded px-2 py-1 inline-block",
|
|
2783
2905
|
children: step.id
|
|
2784
2906
|
})
|
|
2785
2907
|
]
|
|
2786
2908
|
}),
|
|
2787
|
-
step.description && /* @__PURE__ */
|
|
2909
|
+
step.description && /* @__PURE__ */ jsxs7("div", {
|
|
2788
2910
|
children: [
|
|
2789
|
-
/* @__PURE__ */
|
|
2911
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2790
2912
|
children: "Description"
|
|
2791
2913
|
}),
|
|
2792
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2793
2915
|
className: "text-xs text-muted-foreground leading-relaxed",
|
|
2794
2916
|
children: step.description
|
|
2795
2917
|
})
|
|
2796
2918
|
]
|
|
2797
2919
|
}),
|
|
2798
|
-
step.nextStepId && /* @__PURE__ */
|
|
2920
|
+
step.nextStepId && /* @__PURE__ */ jsxs7("div", {
|
|
2799
2921
|
children: [
|
|
2800
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2801
2923
|
children: "Next Step"
|
|
2802
2924
|
}),
|
|
2803
|
-
/* @__PURE__ */
|
|
2925
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2804
2926
|
className: "text-xs font-mono text-muted-foreground bg-muted/40 rounded px-2 py-1 inline-block",
|
|
2805
2927
|
children: step.nextStepId
|
|
2806
2928
|
})
|
|
2807
2929
|
]
|
|
2808
2930
|
}),
|
|
2809
|
-
/* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2810
2932
|
className: "border-t pt-4 border-border",
|
|
2811
2933
|
children: [
|
|
2812
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx16(SectionHeader, {
|
|
2813
2935
|
children: "Parameters"
|
|
2814
2936
|
}),
|
|
2815
|
-
/* @__PURE__ */
|
|
2937
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2816
2938
|
className: "mt-1",
|
|
2817
|
-
children: /* @__PURE__ */
|
|
2939
|
+
children: /* @__PURE__ */ jsx16(StepParams, {
|
|
2818
2940
|
step,
|
|
2819
2941
|
resolvedInputs: executionRecords?.length ? executionRecords[executionRecords.length - 1]?.resolvedInputs : undefined
|
|
2820
2942
|
})
|
|
2821
2943
|
})
|
|
2822
2944
|
]
|
|
2823
2945
|
}),
|
|
2824
|
-
executionSummary && /* @__PURE__ */
|
|
2946
|
+
executionSummary && /* @__PURE__ */ jsxs7("div", {
|
|
2825
2947
|
className: "border-t border-border pt-4",
|
|
2826
2948
|
children: [
|
|
2827
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ jsx16(SectionHeader, {
|
|
2828
2950
|
children: "Execution"
|
|
2829
2951
|
}),
|
|
2830
|
-
/* @__PURE__ */
|
|
2952
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2831
2953
|
className: "mt-1 space-y-3",
|
|
2832
2954
|
children: [
|
|
2833
|
-
/* @__PURE__ */
|
|
2955
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2834
2956
|
className: "flex items-center gap-2 flex-wrap",
|
|
2835
2957
|
children: [
|
|
2836
|
-
/* @__PURE__ */
|
|
2958
|
+
/* @__PURE__ */ jsx16(StatusBadge, {
|
|
2837
2959
|
summary: executionSummary
|
|
2838
2960
|
}),
|
|
2839
|
-
executionSummary.latestDurationMs !== undefined && /* @__PURE__ */
|
|
2961
|
+
executionSummary.latestDurationMs !== undefined && /* @__PURE__ */ jsxs7("span", {
|
|
2840
2962
|
className: "text-[11px] text-muted-foreground tabular-nums",
|
|
2841
2963
|
children: [
|
|
2842
2964
|
executionSummary.latestDurationMs,
|
|
2843
2965
|
"ms"
|
|
2844
2966
|
]
|
|
2845
2967
|
}),
|
|
2846
|
-
executionSummary.executionCount > 1 && /* @__PURE__ */
|
|
2968
|
+
executionSummary.executionCount > 1 && /* @__PURE__ */ jsxs7("span", {
|
|
2847
2969
|
className: "text-[11px] text-muted-foreground",
|
|
2848
2970
|
children: [
|
|
2849
2971
|
"(",
|
|
@@ -2855,33 +2977,33 @@ function StepDetailPanel({
|
|
|
2855
2977
|
})
|
|
2856
2978
|
]
|
|
2857
2979
|
}),
|
|
2858
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
2859
2981
|
children: [
|
|
2860
|
-
/* @__PURE__ */
|
|
2982
|
+
/* @__PURE__ */ jsx16(Label3, {
|
|
2861
2983
|
children: "Output"
|
|
2862
2984
|
}),
|
|
2863
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsx16(JsonViewer, {
|
|
2864
2986
|
value: executionSummary.latestOutput !== undefined ? jsonString(executionSummary.latestOutput) : undefined
|
|
2865
2987
|
})
|
|
2866
2988
|
]
|
|
2867
2989
|
}),
|
|
2868
|
-
executionSummary.latestTrace && executionSummary.latestTrace.length > 0 && /* @__PURE__ */
|
|
2990
|
+
executionSummary.latestTrace && executionSummary.latestTrace.length > 0 && /* @__PURE__ */ jsx16(TraceSection, {
|
|
2869
2991
|
trace: executionSummary.latestTrace
|
|
2870
2992
|
}),
|
|
2871
|
-
executionSummary.latestError && /* @__PURE__ */
|
|
2993
|
+
executionSummary.latestError && /* @__PURE__ */ jsxs7("div", {
|
|
2872
2994
|
className: "text-xs p-2.5 rounded-md bg-red-50 text-red-700 border border-red-200/80 dark:bg-red-950/30 dark:text-red-300 dark:border-red-800/60",
|
|
2873
2995
|
children: [
|
|
2874
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2875
2997
|
className: "font-semibold font-mono",
|
|
2876
2998
|
children: executionSummary.latestError.code
|
|
2877
2999
|
}),
|
|
2878
|
-
/* @__PURE__ */
|
|
3000
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2879
3001
|
className: "mt-1 leading-relaxed",
|
|
2880
3002
|
children: executionSummary.latestError.message
|
|
2881
3003
|
})
|
|
2882
3004
|
]
|
|
2883
3005
|
}),
|
|
2884
|
-
executionSummary.totalRetries > 0 && /* @__PURE__ */
|
|
3006
|
+
executionSummary.totalRetries > 0 && /* @__PURE__ */ jsxs7("div", {
|
|
2885
3007
|
className: "text-[11px] font-medium text-amber-600 dark:text-amber-400",
|
|
2886
3008
|
children: [
|
|
2887
3009
|
executionSummary.totalRetries,
|
|
@@ -2895,36 +3017,36 @@ function StepDetailPanel({
|
|
|
2895
3017
|
})
|
|
2896
3018
|
]
|
|
2897
3019
|
}),
|
|
2898
|
-
executionRecords && executionRecords.length > 0 && /* @__PURE__ */
|
|
3020
|
+
executionRecords && executionRecords.length > 0 && /* @__PURE__ */ jsxs7("div", {
|
|
2899
3021
|
className: "border-t border-border pt-4",
|
|
2900
3022
|
children: [
|
|
2901
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ jsx16(SectionHeader, {
|
|
2902
3024
|
children: "Execution History"
|
|
2903
3025
|
}),
|
|
2904
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2905
3027
|
className: "space-y-2 mt-1",
|
|
2906
|
-
children: executionRecords.map((record, i) => /* @__PURE__ */
|
|
3028
|
+
children: executionRecords.map((record, i) => /* @__PURE__ */ jsx16(ExecutionRecordCard, {
|
|
2907
3029
|
record
|
|
2908
3030
|
}, `${record.stepId}-${i}`))
|
|
2909
3031
|
})
|
|
2910
3032
|
]
|
|
2911
3033
|
}),
|
|
2912
|
-
diagnostics.length > 0 && /* @__PURE__ */
|
|
3034
|
+
diagnostics.length > 0 && /* @__PURE__ */ jsxs7("div", {
|
|
2913
3035
|
className: "border-t pt-4 border-border",
|
|
2914
3036
|
children: [
|
|
2915
|
-
/* @__PURE__ */
|
|
3037
|
+
/* @__PURE__ */ jsx16(SectionHeader, {
|
|
2916
3038
|
children: "Diagnostics"
|
|
2917
3039
|
}),
|
|
2918
|
-
/* @__PURE__ */
|
|
3040
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2919
3041
|
className: "space-y-2 mt-1",
|
|
2920
|
-
children: diagnostics.map((d) => /* @__PURE__ */
|
|
3042
|
+
children: diagnostics.map((d) => /* @__PURE__ */ jsxs7("div", {
|
|
2921
3043
|
className: `text-xs p-2.5 rounded-md ${d.severity === "error" ? "bg-red-50 text-red-700 border border-red-200/80 dark:bg-red-950/30 dark:text-red-300 dark:border-red-800/60" : "bg-amber-50 text-amber-700 border border-amber-200/80 dark:bg-amber-950/30 dark:text-amber-300 dark:border-amber-800/60"}`,
|
|
2922
3044
|
children: [
|
|
2923
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2924
3046
|
className: "font-semibold font-mono",
|
|
2925
3047
|
children: d.code
|
|
2926
3048
|
}),
|
|
2927
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2928
3050
|
className: "mt-1 leading-relaxed",
|
|
2929
3051
|
children: d.message
|
|
2930
3052
|
})
|
|
@@ -2939,20 +3061,20 @@ function StepDetailPanel({
|
|
|
2939
3061
|
});
|
|
2940
3062
|
}
|
|
2941
3063
|
// src/editors/shared-editors.tsx
|
|
2942
|
-
import { useCallback as
|
|
2943
|
-
import { jsx as
|
|
3064
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useState as useState4 } from "react";
|
|
3065
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2944
3066
|
var ID_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]+$/;
|
|
2945
3067
|
function StepIdInput({
|
|
2946
3068
|
value,
|
|
2947
3069
|
onChange
|
|
2948
3070
|
}) {
|
|
2949
|
-
const [draft, setDraft] =
|
|
2950
|
-
const [error, setError] =
|
|
3071
|
+
const [draft, setDraft] = useState4(value);
|
|
3072
|
+
const [error, setError] = useState4("");
|
|
2951
3073
|
useEffect5(() => {
|
|
2952
3074
|
setDraft(value);
|
|
2953
3075
|
setError("");
|
|
2954
3076
|
}, [value]);
|
|
2955
|
-
const handleBlur =
|
|
3077
|
+
const handleBlur = useCallback4(() => {
|
|
2956
3078
|
if (!draft || !ID_REGEX.test(draft)) {
|
|
2957
3079
|
setError("Must start with letter/underscore, contain only letters, digits, underscores (min 2 chars)");
|
|
2958
3080
|
return;
|
|
@@ -2962,19 +3084,19 @@ function StepIdInput({
|
|
|
2962
3084
|
onChange(draft);
|
|
2963
3085
|
}
|
|
2964
3086
|
}, [draft, value, onChange]);
|
|
2965
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ jsxs8("div", {
|
|
2966
3088
|
children: [
|
|
2967
|
-
/* @__PURE__ */
|
|
3089
|
+
/* @__PURE__ */ jsx17(Label2, {
|
|
2968
3090
|
children: "Step ID"
|
|
2969
3091
|
}),
|
|
2970
|
-
/* @__PURE__ */
|
|
3092
|
+
/* @__PURE__ */ jsx17(Input, {
|
|
2971
3093
|
value: draft,
|
|
2972
3094
|
onChange: (e) => setDraft(e.target.value),
|
|
2973
3095
|
onBlur: handleBlur,
|
|
2974
3096
|
className: cn("h-8 text-xs font-mono", error && "border-red-500 focus-visible:ring-red-500/50"),
|
|
2975
3097
|
placeholder: "step_id"
|
|
2976
3098
|
}),
|
|
2977
|
-
error && /* @__PURE__ */
|
|
3099
|
+
error && /* @__PURE__ */ jsx17("div", {
|
|
2978
3100
|
className: "text-[10px] text-red-500 mt-0.5",
|
|
2979
3101
|
children: error
|
|
2980
3102
|
})
|
|
@@ -2988,28 +3110,28 @@ function StepIdDropdown({
|
|
|
2988
3110
|
stepIds,
|
|
2989
3111
|
allowEmpty
|
|
2990
3112
|
}) {
|
|
2991
|
-
return /* @__PURE__ */
|
|
3113
|
+
return /* @__PURE__ */ jsxs8("div", {
|
|
2992
3114
|
children: [
|
|
2993
|
-
/* @__PURE__ */
|
|
3115
|
+
/* @__PURE__ */ jsx17(Label2, {
|
|
2994
3116
|
children: label
|
|
2995
3117
|
}),
|
|
2996
|
-
/* @__PURE__ */
|
|
3118
|
+
/* @__PURE__ */ jsxs8(Select, {
|
|
2997
3119
|
value: value || "__empty__",
|
|
2998
3120
|
onValueChange: (val) => onChange(val === "__empty__" ? "" : val),
|
|
2999
3121
|
children: [
|
|
3000
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ jsx17(SelectTrigger, {
|
|
3001
3123
|
className: "h-8 text-xs font-mono w-full",
|
|
3002
|
-
children: /* @__PURE__ */
|
|
3124
|
+
children: /* @__PURE__ */ jsx17(SelectValue, {
|
|
3003
3125
|
placeholder: "— none —"
|
|
3004
3126
|
})
|
|
3005
3127
|
}),
|
|
3006
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ jsxs8(SelectContent, {
|
|
3007
3129
|
children: [
|
|
3008
|
-
(allowEmpty || !value) && /* @__PURE__ */
|
|
3130
|
+
(allowEmpty || !value) && /* @__PURE__ */ jsx17(SelectItem, {
|
|
3009
3131
|
value: "__empty__",
|
|
3010
3132
|
children: "— none —"
|
|
3011
3133
|
}),
|
|
3012
|
-
stepIds.map((id) => /* @__PURE__ */
|
|
3134
|
+
stepIds.map((id) => /* @__PURE__ */ jsx17(SelectItem, {
|
|
3013
3135
|
value: id,
|
|
3014
3136
|
children: id
|
|
3015
3137
|
}, id))
|
|
@@ -3025,22 +3147,22 @@ function JsonEditor({
|
|
|
3025
3147
|
value,
|
|
3026
3148
|
onChange
|
|
3027
3149
|
}) {
|
|
3028
|
-
const [draft, setDraft] =
|
|
3150
|
+
const [draft, setDraft] = useState4(JSON.stringify(value, null, 2));
|
|
3029
3151
|
useEffect5(() => {
|
|
3030
3152
|
setDraft(JSON.stringify(value, null, 2));
|
|
3031
3153
|
}, [value]);
|
|
3032
|
-
const handleBlur =
|
|
3154
|
+
const handleBlur = useCallback4(() => {
|
|
3033
3155
|
try {
|
|
3034
3156
|
const parsed = JSON.parse(draft);
|
|
3035
3157
|
onChange(parsed);
|
|
3036
3158
|
} catch {}
|
|
3037
3159
|
}, [draft, onChange]);
|
|
3038
|
-
return /* @__PURE__ */
|
|
3160
|
+
return /* @__PURE__ */ jsxs8("div", {
|
|
3039
3161
|
children: [
|
|
3040
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ jsx17(Label2, {
|
|
3041
3163
|
children: label
|
|
3042
3164
|
}),
|
|
3043
|
-
/* @__PURE__ */
|
|
3165
|
+
/* @__PURE__ */ jsx17(JsonCodeEditor, {
|
|
3044
3166
|
value: draft,
|
|
3045
3167
|
onChange: setDraft,
|
|
3046
3168
|
onBlur: handleBlur
|
|
@@ -3050,21 +3172,21 @@ function JsonEditor({
|
|
|
3050
3172
|
}
|
|
3051
3173
|
|
|
3052
3174
|
// src/editors/params/agent-loop-params.tsx
|
|
3053
|
-
import { jsx as
|
|
3175
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3054
3176
|
function AgentLoopParams({
|
|
3055
3177
|
step,
|
|
3056
3178
|
onChange,
|
|
3057
3179
|
availableToolNames
|
|
3058
3180
|
}) {
|
|
3059
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ jsxs9("div", {
|
|
3060
3182
|
className: "space-y-3",
|
|
3061
3183
|
children: [
|
|
3062
|
-
/* @__PURE__ */
|
|
3184
|
+
/* @__PURE__ */ jsxs9("div", {
|
|
3063
3185
|
children: [
|
|
3064
|
-
/* @__PURE__ */
|
|
3186
|
+
/* @__PURE__ */ jsx18(Label2, {
|
|
3065
3187
|
children: "Instructions"
|
|
3066
3188
|
}),
|
|
3067
|
-
/* @__PURE__ */
|
|
3189
|
+
/* @__PURE__ */ jsx18(Textarea, {
|
|
3068
3190
|
value: step.params.instructions,
|
|
3069
3191
|
onChange: (e) => onChange({
|
|
3070
3192
|
params: {
|
|
@@ -3078,17 +3200,17 @@ function AgentLoopParams({
|
|
|
3078
3200
|
})
|
|
3079
3201
|
]
|
|
3080
3202
|
}),
|
|
3081
|
-
/* @__PURE__ */
|
|
3203
|
+
/* @__PURE__ */ jsxs9("div", {
|
|
3082
3204
|
children: [
|
|
3083
|
-
/* @__PURE__ */
|
|
3205
|
+
/* @__PURE__ */ jsx18(Label2, {
|
|
3084
3206
|
children: "Tools"
|
|
3085
3207
|
}),
|
|
3086
|
-
availableToolNames.length > 0 ? /* @__PURE__ */
|
|
3208
|
+
availableToolNames.length > 0 ? /* @__PURE__ */ jsx18("div", {
|
|
3087
3209
|
className: "space-y-1",
|
|
3088
|
-
children: availableToolNames.map((name) => /* @__PURE__ */
|
|
3210
|
+
children: availableToolNames.map((name) => /* @__PURE__ */ jsxs9("label", {
|
|
3089
3211
|
className: "flex items-center gap-2.5 text-xs text-foreground cursor-pointer select-none",
|
|
3090
3212
|
children: [
|
|
3091
|
-
/* @__PURE__ */
|
|
3213
|
+
/* @__PURE__ */ jsx18("input", {
|
|
3092
3214
|
type: "checkbox",
|
|
3093
3215
|
className: "rounded border-border accent-foreground",
|
|
3094
3216
|
checked: step.params.tools.includes(name),
|
|
@@ -3102,7 +3224,7 @@ function AgentLoopParams({
|
|
|
3102
3224
|
name
|
|
3103
3225
|
]
|
|
3104
3226
|
}, name))
|
|
3105
|
-
}) : /* @__PURE__ */
|
|
3227
|
+
}) : /* @__PURE__ */ jsx18(Input, {
|
|
3106
3228
|
value: step.params.tools.join(", "),
|
|
3107
3229
|
onChange: (e) => onChange({
|
|
3108
3230
|
params: {
|
|
@@ -3115,7 +3237,7 @@ function AgentLoopParams({
|
|
|
3115
3237
|
})
|
|
3116
3238
|
]
|
|
3117
3239
|
}),
|
|
3118
|
-
/* @__PURE__ */
|
|
3240
|
+
/* @__PURE__ */ jsx18(JsonEditor, {
|
|
3119
3241
|
label: "Output Format (JSON Schema)",
|
|
3120
3242
|
value: step.params.outputFormat,
|
|
3121
3243
|
onChange: (val) => onChange({ params: { ...step.params, outputFormat: val } })
|
|
@@ -3125,7 +3247,7 @@ function AgentLoopParams({
|
|
|
3125
3247
|
}
|
|
3126
3248
|
|
|
3127
3249
|
// src/editors/params/end-params.tsx
|
|
3128
|
-
import { jsx as
|
|
3250
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3129
3251
|
function EndParams({
|
|
3130
3252
|
step,
|
|
3131
3253
|
onChange,
|
|
@@ -3134,13 +3256,13 @@ function EndParams({
|
|
|
3134
3256
|
}) {
|
|
3135
3257
|
const hasOutput = !!step.params?.output;
|
|
3136
3258
|
const hasSchema = !!workflowOutputSchema;
|
|
3137
|
-
return /* @__PURE__ */
|
|
3259
|
+
return /* @__PURE__ */ jsxs10("div", {
|
|
3138
3260
|
className: "space-y-3",
|
|
3139
3261
|
children: [
|
|
3140
|
-
/* @__PURE__ */
|
|
3262
|
+
/* @__PURE__ */ jsxs10("label", {
|
|
3141
3263
|
className: "flex items-center gap-2.5 text-xs text-foreground cursor-pointer select-none group",
|
|
3142
3264
|
children: [
|
|
3143
|
-
/* @__PURE__ */
|
|
3265
|
+
/* @__PURE__ */ jsx19("input", {
|
|
3144
3266
|
type: "checkbox",
|
|
3145
3267
|
checked: hasOutput,
|
|
3146
3268
|
onChange: (e) => {
|
|
@@ -3159,15 +3281,15 @@ function EndParams({
|
|
|
3159
3281
|
"Has output expression"
|
|
3160
3282
|
]
|
|
3161
3283
|
}),
|
|
3162
|
-
hasOutput && step.params?.output && /* @__PURE__ */
|
|
3284
|
+
hasOutput && step.params?.output && /* @__PURE__ */ jsx19(ExpressionEditor, {
|
|
3163
3285
|
label: "Output",
|
|
3164
3286
|
value: step.params.output,
|
|
3165
3287
|
onChange: (val) => onChange({ params: { output: val } })
|
|
3166
3288
|
}),
|
|
3167
|
-
/* @__PURE__ */
|
|
3289
|
+
/* @__PURE__ */ jsxs10("label", {
|
|
3168
3290
|
className: "flex items-center gap-2.5 text-xs text-foreground cursor-pointer select-none group",
|
|
3169
3291
|
children: [
|
|
3170
|
-
/* @__PURE__ */
|
|
3292
|
+
/* @__PURE__ */ jsx19("input", {
|
|
3171
3293
|
type: "checkbox",
|
|
3172
3294
|
checked: hasSchema,
|
|
3173
3295
|
onChange: (e) => {
|
|
@@ -3189,7 +3311,7 @@ function EndParams({
|
|
|
3189
3311
|
"Workflow has output schema"
|
|
3190
3312
|
]
|
|
3191
3313
|
}),
|
|
3192
|
-
hasSchema && workflowOutputSchema && /* @__PURE__ */
|
|
3314
|
+
hasSchema && workflowOutputSchema && /* @__PURE__ */ jsx19(JsonEditor, {
|
|
3193
3315
|
label: "Output Schema (JSON Schema)",
|
|
3194
3316
|
value: workflowOutputSchema,
|
|
3195
3317
|
onChange: (val) => onWorkflowMetaChange?.({ outputSchema: val })
|
|
@@ -3199,20 +3321,20 @@ function EndParams({
|
|
|
3199
3321
|
}
|
|
3200
3322
|
|
|
3201
3323
|
// src/editors/params/extract-data-params.tsx
|
|
3202
|
-
import { jsx as
|
|
3324
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3203
3325
|
function ExtractDataParams({
|
|
3204
3326
|
step,
|
|
3205
3327
|
onChange
|
|
3206
3328
|
}) {
|
|
3207
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ jsxs11("div", {
|
|
3208
3330
|
className: "space-y-3",
|
|
3209
3331
|
children: [
|
|
3210
|
-
/* @__PURE__ */
|
|
3332
|
+
/* @__PURE__ */ jsx20(ExpressionEditor, {
|
|
3211
3333
|
label: "Source Data",
|
|
3212
3334
|
value: step.params.sourceData,
|
|
3213
3335
|
onChange: (val) => onChange({ params: { ...step.params, sourceData: val } })
|
|
3214
3336
|
}),
|
|
3215
|
-
/* @__PURE__ */
|
|
3337
|
+
/* @__PURE__ */ jsx20(JsonEditor, {
|
|
3216
3338
|
label: "Output Format (JSON Schema)",
|
|
3217
3339
|
value: step.params.outputFormat,
|
|
3218
3340
|
onChange: (val) => onChange({ params: { ...step.params, outputFormat: val } })
|
|
@@ -3222,26 +3344,26 @@ function ExtractDataParams({
|
|
|
3222
3344
|
}
|
|
3223
3345
|
|
|
3224
3346
|
// src/editors/params/for-each-params.tsx
|
|
3225
|
-
import { jsx as
|
|
3347
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3226
3348
|
function ForEachParams({
|
|
3227
3349
|
step,
|
|
3228
3350
|
onChange,
|
|
3229
3351
|
allStepIds
|
|
3230
3352
|
}) {
|
|
3231
|
-
return /* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
3232
3354
|
className: "space-y-3",
|
|
3233
3355
|
children: [
|
|
3234
|
-
/* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ jsx21(ExpressionEditor, {
|
|
3235
3357
|
label: "Target Array",
|
|
3236
3358
|
value: step.params.target,
|
|
3237
3359
|
onChange: (val) => onChange({ params: { ...step.params, target: val } })
|
|
3238
3360
|
}),
|
|
3239
|
-
/* @__PURE__ */
|
|
3361
|
+
/* @__PURE__ */ jsxs12("div", {
|
|
3240
3362
|
children: [
|
|
3241
|
-
/* @__PURE__ */
|
|
3363
|
+
/* @__PURE__ */ jsx21(Label2, {
|
|
3242
3364
|
children: "Item Variable Name"
|
|
3243
3365
|
}),
|
|
3244
|
-
/* @__PURE__ */
|
|
3366
|
+
/* @__PURE__ */ jsx21(Input, {
|
|
3245
3367
|
value: step.params.itemName,
|
|
3246
3368
|
onChange: (e) => onChange({
|
|
3247
3369
|
params: { ...step.params, itemName: e.target.value }
|
|
@@ -3251,7 +3373,7 @@ function ForEachParams({
|
|
|
3251
3373
|
})
|
|
3252
3374
|
]
|
|
3253
3375
|
}),
|
|
3254
|
-
/* @__PURE__ */
|
|
3376
|
+
/* @__PURE__ */ jsx21(StepIdDropdown, {
|
|
3255
3377
|
label: "Loop Body Step",
|
|
3256
3378
|
value: step.params.loopBodyStepId,
|
|
3257
3379
|
onChange: (id) => onChange({
|
|
@@ -3268,20 +3390,20 @@ function ForEachParams({
|
|
|
3268
3390
|
}
|
|
3269
3391
|
|
|
3270
3392
|
// src/editors/params/llm-prompt-params.tsx
|
|
3271
|
-
import { jsx as
|
|
3393
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3272
3394
|
function LlmPromptParams({
|
|
3273
3395
|
step,
|
|
3274
3396
|
onChange
|
|
3275
3397
|
}) {
|
|
3276
|
-
return /* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ jsxs13("div", {
|
|
3277
3399
|
className: "space-y-3",
|
|
3278
3400
|
children: [
|
|
3279
|
-
/* @__PURE__ */
|
|
3401
|
+
/* @__PURE__ */ jsxs13("div", {
|
|
3280
3402
|
children: [
|
|
3281
|
-
/* @__PURE__ */
|
|
3403
|
+
/* @__PURE__ */ jsx22(Label2, {
|
|
3282
3404
|
children: "Prompt"
|
|
3283
3405
|
}),
|
|
3284
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsx22(Textarea, {
|
|
3285
3407
|
value: step.params.prompt,
|
|
3286
3408
|
onChange: (e) => onChange({
|
|
3287
3409
|
params: { ...step.params, prompt: e.target.value }
|
|
@@ -3292,7 +3414,7 @@ function LlmPromptParams({
|
|
|
3292
3414
|
})
|
|
3293
3415
|
]
|
|
3294
3416
|
}),
|
|
3295
|
-
/* @__PURE__ */
|
|
3417
|
+
/* @__PURE__ */ jsx22(JsonEditor, {
|
|
3296
3418
|
label: "Output Format (JSON Schema)",
|
|
3297
3419
|
value: step.params.outputFormat,
|
|
3298
3420
|
onChange: (val) => onChange({ params: { ...step.params, outputFormat: val } })
|
|
@@ -3302,12 +3424,12 @@ function LlmPromptParams({
|
|
|
3302
3424
|
}
|
|
3303
3425
|
|
|
3304
3426
|
// src/editors/params/sleep-params.tsx
|
|
3305
|
-
import { jsx as
|
|
3427
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3306
3428
|
function SleepParams({
|
|
3307
3429
|
step,
|
|
3308
3430
|
onChange
|
|
3309
3431
|
}) {
|
|
3310
|
-
return /* @__PURE__ */
|
|
3432
|
+
return /* @__PURE__ */ jsx23(ExpressionEditor, {
|
|
3311
3433
|
label: "Duration (ms)",
|
|
3312
3434
|
value: step.params.durationMs,
|
|
3313
3435
|
onChange: (val) => onChange({ params: { ...step.params, durationMs: val } })
|
|
@@ -3315,19 +3437,19 @@ function SleepParams({
|
|
|
3315
3437
|
}
|
|
3316
3438
|
|
|
3317
3439
|
// src/editors/params/start-params.tsx
|
|
3318
|
-
import { jsx as
|
|
3440
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3319
3441
|
function StartParams({
|
|
3320
3442
|
workflowInputSchema,
|
|
3321
3443
|
onWorkflowMetaChange
|
|
3322
3444
|
}) {
|
|
3323
3445
|
const hasSchema = !!workflowInputSchema;
|
|
3324
|
-
return /* @__PURE__ */
|
|
3446
|
+
return /* @__PURE__ */ jsxs14("div", {
|
|
3325
3447
|
className: "space-y-3",
|
|
3326
3448
|
children: [
|
|
3327
|
-
/* @__PURE__ */
|
|
3449
|
+
/* @__PURE__ */ jsxs14("label", {
|
|
3328
3450
|
className: "flex items-center gap-2.5 text-xs text-foreground cursor-pointer select-none group",
|
|
3329
3451
|
children: [
|
|
3330
|
-
/* @__PURE__ */
|
|
3452
|
+
/* @__PURE__ */ jsx24("input", {
|
|
3331
3453
|
type: "checkbox",
|
|
3332
3454
|
checked: hasSchema,
|
|
3333
3455
|
className: "rounded border-border accent-foreground",
|
|
@@ -3349,7 +3471,7 @@ function StartParams({
|
|
|
3349
3471
|
"Workflow has input schema"
|
|
3350
3472
|
]
|
|
3351
3473
|
}),
|
|
3352
|
-
hasSchema && workflowInputSchema && /* @__PURE__ */
|
|
3474
|
+
hasSchema && workflowInputSchema && /* @__PURE__ */ jsx24(JsonEditor, {
|
|
3353
3475
|
label: "Input Schema (JSON Schema)",
|
|
3354
3476
|
value: workflowInputSchema,
|
|
3355
3477
|
onChange: (val) => onWorkflowMetaChange?.({ inputSchema: val })
|
|
@@ -3359,42 +3481,42 @@ function StartParams({
|
|
|
3359
3481
|
}
|
|
3360
3482
|
|
|
3361
3483
|
// src/editors/params/switch-case-params.tsx
|
|
3362
|
-
import { jsx as
|
|
3484
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3363
3485
|
function SwitchCaseParams({
|
|
3364
3486
|
step,
|
|
3365
3487
|
onChange,
|
|
3366
3488
|
allStepIds
|
|
3367
3489
|
}) {
|
|
3368
|
-
return /* @__PURE__ */
|
|
3490
|
+
return /* @__PURE__ */ jsxs15("div", {
|
|
3369
3491
|
className: "space-y-3",
|
|
3370
3492
|
children: [
|
|
3371
|
-
/* @__PURE__ */
|
|
3493
|
+
/* @__PURE__ */ jsx25(ExpressionEditor, {
|
|
3372
3494
|
label: "Switch On",
|
|
3373
3495
|
value: step.params.switchOn,
|
|
3374
3496
|
onChange: (val) => onChange({ params: { ...step.params, switchOn: val } })
|
|
3375
3497
|
}),
|
|
3376
|
-
/* @__PURE__ */
|
|
3498
|
+
/* @__PURE__ */ jsxs15("div", {
|
|
3377
3499
|
children: [
|
|
3378
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ jsx25(Label2, {
|
|
3379
3501
|
children: "Cases"
|
|
3380
3502
|
}),
|
|
3381
|
-
/* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ jsxs15("div", {
|
|
3382
3504
|
className: "space-y-2",
|
|
3383
3505
|
children: [
|
|
3384
|
-
step.params.cases.map((c, i) => /* @__PURE__ */
|
|
3506
|
+
step.params.cases.map((c, i) => /* @__PURE__ */ jsxs15("div", {
|
|
3385
3507
|
className: "border border-border/70 rounded-lg p-3 space-y-2 bg-muted/20",
|
|
3386
3508
|
children: [
|
|
3387
|
-
/* @__PURE__ */
|
|
3509
|
+
/* @__PURE__ */ jsxs15("div", {
|
|
3388
3510
|
className: "flex items-center justify-between",
|
|
3389
3511
|
children: [
|
|
3390
|
-
/* @__PURE__ */
|
|
3512
|
+
/* @__PURE__ */ jsxs15("span", {
|
|
3391
3513
|
className: "text-xs font-semibold text-foreground",
|
|
3392
3514
|
children: [
|
|
3393
3515
|
"Case ",
|
|
3394
3516
|
i + 1
|
|
3395
3517
|
]
|
|
3396
3518
|
}),
|
|
3397
|
-
/* @__PURE__ */
|
|
3519
|
+
/* @__PURE__ */ jsx25(Button, {
|
|
3398
3520
|
variant: "ghost",
|
|
3399
3521
|
size: "xs",
|
|
3400
3522
|
className: "text-red-500 hover:text-red-700",
|
|
@@ -3408,10 +3530,10 @@ function SwitchCaseParams({
|
|
|
3408
3530
|
})
|
|
3409
3531
|
]
|
|
3410
3532
|
}),
|
|
3411
|
-
c.value.type === "default" ? /* @__PURE__ */
|
|
3533
|
+
c.value.type === "default" ? /* @__PURE__ */ jsx25("div", {
|
|
3412
3534
|
className: "text-xs text-muted-foreground italic",
|
|
3413
3535
|
children: "default case"
|
|
3414
|
-
}) : /* @__PURE__ */
|
|
3536
|
+
}) : /* @__PURE__ */ jsx25(ExpressionEditor, {
|
|
3415
3537
|
label: "Value",
|
|
3416
3538
|
value: c.value,
|
|
3417
3539
|
onChange: (val) => {
|
|
@@ -3422,7 +3544,7 @@ function SwitchCaseParams({
|
|
|
3422
3544
|
});
|
|
3423
3545
|
}
|
|
3424
3546
|
}),
|
|
3425
|
-
/* @__PURE__ */
|
|
3547
|
+
/* @__PURE__ */ jsx25(StepIdDropdown, {
|
|
3426
3548
|
label: "Branch Body Step",
|
|
3427
3549
|
value: c.branchBodyStepId,
|
|
3428
3550
|
onChange: (id) => {
|
|
@@ -3440,10 +3562,10 @@ function SwitchCaseParams({
|
|
|
3440
3562
|
})
|
|
3441
3563
|
]
|
|
3442
3564
|
}, `case-${c.branchBodyStepId || "empty"}-${i}`)),
|
|
3443
|
-
/* @__PURE__ */
|
|
3565
|
+
/* @__PURE__ */ jsxs15("div", {
|
|
3444
3566
|
className: "flex gap-1",
|
|
3445
3567
|
children: [
|
|
3446
|
-
/* @__PURE__ */
|
|
3568
|
+
/* @__PURE__ */ jsx25(Button, {
|
|
3447
3569
|
variant: "secondary",
|
|
3448
3570
|
size: "sm",
|
|
3449
3571
|
onClick: () => {
|
|
@@ -3463,7 +3585,7 @@ function SwitchCaseParams({
|
|
|
3463
3585
|
},
|
|
3464
3586
|
children: "Add Case"
|
|
3465
3587
|
}),
|
|
3466
|
-
/* @__PURE__ */
|
|
3588
|
+
/* @__PURE__ */ jsx25(Button, {
|
|
3467
3589
|
variant: "secondary",
|
|
3468
3590
|
size: "sm",
|
|
3469
3591
|
onClick: () => {
|
|
@@ -3495,7 +3617,7 @@ function SwitchCaseParams({
|
|
|
3495
3617
|
|
|
3496
3618
|
// src/editors/params/tool-call-params.tsx
|
|
3497
3619
|
import { useEffect as useEffect6, useRef as useRef5 } from "react";
|
|
3498
|
-
import { jsx as
|
|
3620
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3499
3621
|
function ToolCallParams({
|
|
3500
3622
|
step,
|
|
3501
3623
|
onChange,
|
|
@@ -3529,34 +3651,34 @@ function ToolCallParams({
|
|
|
3529
3651
|
step.params
|
|
3530
3652
|
]);
|
|
3531
3653
|
const displayKeys = schemaKeys ?? Object.keys(step.params.toolInput);
|
|
3532
|
-
return /* @__PURE__ */
|
|
3654
|
+
return /* @__PURE__ */ jsxs16("div", {
|
|
3533
3655
|
className: "space-y-3",
|
|
3534
3656
|
children: [
|
|
3535
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ jsxs16("div", {
|
|
3536
3658
|
children: [
|
|
3537
|
-
/* @__PURE__ */
|
|
3659
|
+
/* @__PURE__ */ jsx26(Label2, {
|
|
3538
3660
|
children: "Tool Name"
|
|
3539
3661
|
}),
|
|
3540
|
-
availableToolNames.length > 0 ? /* @__PURE__ */
|
|
3662
|
+
availableToolNames.length > 0 ? /* @__PURE__ */ jsxs16(Select, {
|
|
3541
3663
|
value: step.params.toolName,
|
|
3542
3664
|
onValueChange: (val) => onChange({
|
|
3543
3665
|
params: { ...step.params, toolName: val }
|
|
3544
3666
|
}),
|
|
3545
3667
|
children: [
|
|
3546
|
-
/* @__PURE__ */
|
|
3668
|
+
/* @__PURE__ */ jsx26(SelectTrigger, {
|
|
3547
3669
|
className: "h-8 text-xs font-mono w-full",
|
|
3548
|
-
children: /* @__PURE__ */
|
|
3670
|
+
children: /* @__PURE__ */ jsx26(SelectValue, {
|
|
3549
3671
|
placeholder: "-- select tool --"
|
|
3550
3672
|
})
|
|
3551
3673
|
}),
|
|
3552
|
-
/* @__PURE__ */
|
|
3553
|
-
children: availableToolNames.map((name) => /* @__PURE__ */
|
|
3674
|
+
/* @__PURE__ */ jsx26(SelectContent, {
|
|
3675
|
+
children: availableToolNames.map((name) => /* @__PURE__ */ jsx26(SelectItem, {
|
|
3554
3676
|
value: name,
|
|
3555
3677
|
children: name
|
|
3556
3678
|
}, name))
|
|
3557
3679
|
})
|
|
3558
3680
|
]
|
|
3559
|
-
}) : /* @__PURE__ */
|
|
3681
|
+
}) : /* @__PURE__ */ jsx26(Input, {
|
|
3560
3682
|
value: step.params.toolName,
|
|
3561
3683
|
onChange: (e) => onChange({
|
|
3562
3684
|
params: { ...step.params, toolName: e.target.value }
|
|
@@ -3566,42 +3688,42 @@ function ToolCallParams({
|
|
|
3566
3688
|
})
|
|
3567
3689
|
]
|
|
3568
3690
|
}),
|
|
3569
|
-
schema?.description && /* @__PURE__ */
|
|
3691
|
+
schema?.description && /* @__PURE__ */ jsx26("p", {
|
|
3570
3692
|
className: "text-[11px] text-muted-foreground leading-snug",
|
|
3571
3693
|
children: schema.description
|
|
3572
3694
|
}),
|
|
3573
|
-
displayKeys.length > 0 && /* @__PURE__ */
|
|
3695
|
+
displayKeys.length > 0 && /* @__PURE__ */ jsxs16("div", {
|
|
3574
3696
|
children: [
|
|
3575
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ jsx26(Label2, {
|
|
3576
3698
|
children: "Tool Inputs"
|
|
3577
3699
|
}),
|
|
3578
|
-
/* @__PURE__ */
|
|
3700
|
+
/* @__PURE__ */ jsx26("div", {
|
|
3579
3701
|
className: "space-y-2",
|
|
3580
3702
|
children: displayKeys.map((key) => {
|
|
3581
3703
|
const expr = step.params.toolInput[key];
|
|
3582
3704
|
const isRequired = requiredKeys.has(key);
|
|
3583
3705
|
const propSchema = schema?.inputSchema.properties?.[key];
|
|
3584
|
-
return /* @__PURE__ */
|
|
3706
|
+
return /* @__PURE__ */ jsxs16("div", {
|
|
3585
3707
|
className: "border border-border/70 rounded-lg p-3 bg-muted/20",
|
|
3586
3708
|
children: [
|
|
3587
|
-
/* @__PURE__ */
|
|
3709
|
+
/* @__PURE__ */ jsxs16("div", {
|
|
3588
3710
|
className: "flex items-center gap-1.5 mb-1.5",
|
|
3589
3711
|
children: [
|
|
3590
|
-
/* @__PURE__ */
|
|
3712
|
+
/* @__PURE__ */ jsx26("span", {
|
|
3591
3713
|
className: "text-xs font-mono font-medium text-foreground",
|
|
3592
3714
|
children: key
|
|
3593
3715
|
}),
|
|
3594
|
-
isRequired && /* @__PURE__ */
|
|
3716
|
+
isRequired && /* @__PURE__ */ jsx26("span", {
|
|
3595
3717
|
className: "text-[10px] font-semibold text-red-500 bg-red-50 dark:bg-red-950/30 px-1.5 py-0.5 rounded",
|
|
3596
3718
|
children: "required"
|
|
3597
3719
|
})
|
|
3598
3720
|
]
|
|
3599
3721
|
}),
|
|
3600
|
-
propSchema?.description && /* @__PURE__ */
|
|
3722
|
+
propSchema?.description && /* @__PURE__ */ jsx26("p", {
|
|
3601
3723
|
className: "text-[10px] text-muted-foreground mb-2 leading-relaxed",
|
|
3602
3724
|
children: propSchema.description
|
|
3603
3725
|
}),
|
|
3604
|
-
/* @__PURE__ */
|
|
3726
|
+
/* @__PURE__ */ jsx26(ExpressionEditor, {
|
|
3605
3727
|
value: expr ?? { type: "literal", value: "" },
|
|
3606
3728
|
onChange: (val) => onChange({
|
|
3607
3729
|
params: {
|
|
@@ -3625,16 +3747,16 @@ function ToolCallParams({
|
|
|
3625
3747
|
}
|
|
3626
3748
|
|
|
3627
3749
|
// src/editors/params/wait-for-condition-params.tsx
|
|
3628
|
-
import { jsx as
|
|
3750
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3629
3751
|
function WaitForConditionParams({
|
|
3630
3752
|
step,
|
|
3631
3753
|
onChange,
|
|
3632
3754
|
allStepIds
|
|
3633
3755
|
}) {
|
|
3634
|
-
return /* @__PURE__ */
|
|
3756
|
+
return /* @__PURE__ */ jsxs17("div", {
|
|
3635
3757
|
className: "space-y-3",
|
|
3636
3758
|
children: [
|
|
3637
|
-
/* @__PURE__ */
|
|
3759
|
+
/* @__PURE__ */ jsx27(StepIdDropdown, {
|
|
3638
3760
|
label: "Condition Step",
|
|
3639
3761
|
value: step.params.conditionStepId,
|
|
3640
3762
|
onChange: (id) => onChange({
|
|
@@ -3646,19 +3768,19 @@ function WaitForConditionParams({
|
|
|
3646
3768
|
stepIds: allStepIds,
|
|
3647
3769
|
allowEmpty: true
|
|
3648
3770
|
}),
|
|
3649
|
-
/* @__PURE__ */
|
|
3771
|
+
/* @__PURE__ */ jsx27(ExpressionEditor, {
|
|
3650
3772
|
label: "Condition",
|
|
3651
3773
|
value: step.params.condition,
|
|
3652
3774
|
onChange: (val) => onChange({ params: { ...step.params, condition: val } })
|
|
3653
3775
|
}),
|
|
3654
|
-
step.params.maxAttempts && /* @__PURE__ */
|
|
3776
|
+
step.params.maxAttempts && /* @__PURE__ */ jsx27(ExpressionEditor, {
|
|
3655
3777
|
label: "Max Attempts",
|
|
3656
3778
|
value: step.params.maxAttempts,
|
|
3657
3779
|
onChange: (val) => onChange({
|
|
3658
3780
|
params: { ...step.params, maxAttempts: val }
|
|
3659
3781
|
})
|
|
3660
3782
|
}),
|
|
3661
|
-
step.params.intervalMs && /* @__PURE__ */
|
|
3783
|
+
step.params.intervalMs && /* @__PURE__ */ jsx27(ExpressionEditor, {
|
|
3662
3784
|
label: "Interval (ms)",
|
|
3663
3785
|
value: step.params.intervalMs,
|
|
3664
3786
|
onChange: (val) => onChange({
|
|
@@ -3670,7 +3792,7 @@ function WaitForConditionParams({
|
|
|
3670
3792
|
}
|
|
3671
3793
|
|
|
3672
3794
|
// src/panels/step-editor-panel.tsx
|
|
3673
|
-
import { jsx as
|
|
3795
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3674
3796
|
function StepParamsEditor({
|
|
3675
3797
|
step,
|
|
3676
3798
|
onChange,
|
|
@@ -3683,60 +3805,60 @@ function StepParamsEditor({
|
|
|
3683
3805
|
}) {
|
|
3684
3806
|
switch (step.type) {
|
|
3685
3807
|
case "tool-call":
|
|
3686
|
-
return /* @__PURE__ */
|
|
3808
|
+
return /* @__PURE__ */ jsx28(ToolCallParams, {
|
|
3687
3809
|
step,
|
|
3688
3810
|
onChange,
|
|
3689
3811
|
availableToolNames,
|
|
3690
3812
|
toolSchemas
|
|
3691
3813
|
});
|
|
3692
3814
|
case "llm-prompt":
|
|
3693
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsx28(LlmPromptParams, {
|
|
3694
3816
|
step,
|
|
3695
3817
|
onChange
|
|
3696
3818
|
});
|
|
3697
3819
|
case "extract-data":
|
|
3698
|
-
return /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsx28(ExtractDataParams, {
|
|
3699
3821
|
step,
|
|
3700
3822
|
onChange
|
|
3701
3823
|
});
|
|
3702
3824
|
case "switch-case":
|
|
3703
|
-
return /* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ jsx28(SwitchCaseParams, {
|
|
3704
3826
|
step,
|
|
3705
3827
|
onChange,
|
|
3706
3828
|
allStepIds
|
|
3707
3829
|
});
|
|
3708
3830
|
case "for-each":
|
|
3709
|
-
return /* @__PURE__ */
|
|
3831
|
+
return /* @__PURE__ */ jsx28(ForEachParams, {
|
|
3710
3832
|
step,
|
|
3711
3833
|
onChange,
|
|
3712
3834
|
allStepIds
|
|
3713
3835
|
});
|
|
3714
3836
|
case "sleep":
|
|
3715
|
-
return /* @__PURE__ */
|
|
3837
|
+
return /* @__PURE__ */ jsx28(SleepParams, {
|
|
3716
3838
|
step,
|
|
3717
3839
|
onChange
|
|
3718
3840
|
});
|
|
3719
3841
|
case "wait-for-condition":
|
|
3720
|
-
return /* @__PURE__ */
|
|
3842
|
+
return /* @__PURE__ */ jsx28(WaitForConditionParams, {
|
|
3721
3843
|
step,
|
|
3722
3844
|
onChange,
|
|
3723
3845
|
allStepIds
|
|
3724
3846
|
});
|
|
3725
3847
|
case "agent-loop":
|
|
3726
|
-
return /* @__PURE__ */
|
|
3848
|
+
return /* @__PURE__ */ jsx28(AgentLoopParams, {
|
|
3727
3849
|
step,
|
|
3728
3850
|
onChange,
|
|
3729
3851
|
availableToolNames
|
|
3730
3852
|
});
|
|
3731
3853
|
case "end":
|
|
3732
|
-
return /* @__PURE__ */
|
|
3854
|
+
return /* @__PURE__ */ jsx28(EndParams, {
|
|
3733
3855
|
step,
|
|
3734
3856
|
onChange,
|
|
3735
3857
|
workflowOutputSchema,
|
|
3736
3858
|
onWorkflowMetaChange
|
|
3737
3859
|
});
|
|
3738
3860
|
case "start":
|
|
3739
|
-
return /* @__PURE__ */
|
|
3861
|
+
return /* @__PURE__ */ jsx28(StartParams, {
|
|
3740
3862
|
workflowInputSchema,
|
|
3741
3863
|
onWorkflowMetaChange
|
|
3742
3864
|
});
|
|
@@ -3747,30 +3869,30 @@ function DiagnosticsSection({ diagnostics }) {
|
|
|
3747
3869
|
return null;
|
|
3748
3870
|
const errors = diagnostics.filter((d) => d.severity === "error");
|
|
3749
3871
|
const warnings = diagnostics.filter((d) => d.severity === "warning");
|
|
3750
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ jsxs18("div", {
|
|
3751
3873
|
className: "space-y-1.5",
|
|
3752
3874
|
children: [
|
|
3753
|
-
errors.map((d, i) => /* @__PURE__ */
|
|
3875
|
+
errors.map((d, i) => /* @__PURE__ */ jsxs18("div", {
|
|
3754
3876
|
className: "flex gap-2 items-start text-[11px] text-red-700 dark:text-red-300 bg-red-50 dark:bg-red-950/30 rounded-md px-2.5 py-2 border border-red-200/80 dark:border-red-900/60",
|
|
3755
3877
|
children: [
|
|
3756
|
-
/* @__PURE__ */
|
|
3878
|
+
/* @__PURE__ */ jsx28("span", {
|
|
3757
3879
|
className: "shrink-0 font-semibold bg-red-100 dark:bg-red-900/50 px-1.5 py-0.5 rounded text-[10px]",
|
|
3758
3880
|
children: "Error"
|
|
3759
3881
|
}),
|
|
3760
|
-
/* @__PURE__ */
|
|
3882
|
+
/* @__PURE__ */ jsx28("span", {
|
|
3761
3883
|
className: "leading-relaxed",
|
|
3762
3884
|
children: d.message
|
|
3763
3885
|
})
|
|
3764
3886
|
]
|
|
3765
3887
|
}, `err-${d.code}-${i}`)),
|
|
3766
|
-
warnings.map((d, i) => /* @__PURE__ */
|
|
3888
|
+
warnings.map((d, i) => /* @__PURE__ */ jsxs18("div", {
|
|
3767
3889
|
className: "flex gap-2 items-start text-[11px] text-amber-700 dark:text-amber-300 bg-amber-50 dark:bg-amber-950/30 rounded-md px-2.5 py-2 border border-amber-200/80 dark:border-amber-900/60",
|
|
3768
3890
|
children: [
|
|
3769
|
-
/* @__PURE__ */
|
|
3891
|
+
/* @__PURE__ */ jsx28("span", {
|
|
3770
3892
|
className: "shrink-0 font-semibold bg-amber-100 dark:bg-amber-900/50 px-1.5 py-0.5 rounded text-[10px]",
|
|
3771
3893
|
children: "Warn"
|
|
3772
3894
|
}),
|
|
3773
|
-
/* @__PURE__ */
|
|
3895
|
+
/* @__PURE__ */ jsx28("span", {
|
|
3774
3896
|
className: "leading-relaxed",
|
|
3775
3897
|
children: d.message
|
|
3776
3898
|
})
|
|
@@ -3791,16 +3913,16 @@ function StepEditorPanel({
|
|
|
3791
3913
|
onWorkflowMetaChange,
|
|
3792
3914
|
onClose
|
|
3793
3915
|
}) {
|
|
3794
|
-
return /* @__PURE__ */
|
|
3916
|
+
return /* @__PURE__ */ jsxs18("div", {
|
|
3795
3917
|
className: "w-[360px] border-l h-full min-h-0 overflow-y-auto bg-card border-border",
|
|
3796
3918
|
children: [
|
|
3797
|
-
/* @__PURE__ */
|
|
3919
|
+
/* @__PURE__ */ jsxs18("div", {
|
|
3798
3920
|
className: "sticky top-0 z-10 border-b px-4 py-3 flex items-center justify-between bg-card/95 backdrop-blur-sm border-border",
|
|
3799
3921
|
children: [
|
|
3800
|
-
/* @__PURE__ */
|
|
3922
|
+
/* @__PURE__ */ jsx28(TypeBadge, {
|
|
3801
3923
|
type: step.type
|
|
3802
3924
|
}),
|
|
3803
|
-
/* @__PURE__ */
|
|
3925
|
+
/* @__PURE__ */ jsx28("button", {
|
|
3804
3926
|
type: "button",
|
|
3805
3927
|
onClick: onClose,
|
|
3806
3928
|
className: "text-lg leading-none text-muted-foreground hover:text-foreground shrink-0 rounded-md w-7 h-7 flex items-center justify-center hover:bg-muted transition-colors",
|
|
@@ -3808,18 +3930,18 @@ function StepEditorPanel({
|
|
|
3808
3930
|
})
|
|
3809
3931
|
]
|
|
3810
3932
|
}),
|
|
3811
|
-
/* @__PURE__ */
|
|
3933
|
+
/* @__PURE__ */ jsxs18("div", {
|
|
3812
3934
|
className: "px-4 py-4 space-y-5",
|
|
3813
3935
|
children: [
|
|
3814
|
-
/* @__PURE__ */
|
|
3936
|
+
/* @__PURE__ */ jsx28(DiagnosticsSection, {
|
|
3815
3937
|
diagnostics
|
|
3816
3938
|
}),
|
|
3817
|
-
/* @__PURE__ */
|
|
3939
|
+
/* @__PURE__ */ jsxs18("div", {
|
|
3818
3940
|
children: [
|
|
3819
|
-
/* @__PURE__ */
|
|
3941
|
+
/* @__PURE__ */ jsx28(Label2, {
|
|
3820
3942
|
children: "Name"
|
|
3821
3943
|
}),
|
|
3822
|
-
/* @__PURE__ */
|
|
3944
|
+
/* @__PURE__ */ jsx28(Input, {
|
|
3823
3945
|
value: step.name,
|
|
3824
3946
|
onChange: (e) => onChange({ name: e.target.value }),
|
|
3825
3947
|
className: "h-9 text-sm",
|
|
@@ -3827,16 +3949,16 @@ function StepEditorPanel({
|
|
|
3827
3949
|
})
|
|
3828
3950
|
]
|
|
3829
3951
|
}),
|
|
3830
|
-
/* @__PURE__ */
|
|
3952
|
+
/* @__PURE__ */ jsx28(StepIdInput, {
|
|
3831
3953
|
value: step.id,
|
|
3832
3954
|
onChange: (id) => onChange({ id })
|
|
3833
3955
|
}),
|
|
3834
|
-
/* @__PURE__ */
|
|
3956
|
+
/* @__PURE__ */ jsxs18("div", {
|
|
3835
3957
|
children: [
|
|
3836
|
-
/* @__PURE__ */
|
|
3958
|
+
/* @__PURE__ */ jsx28(Label2, {
|
|
3837
3959
|
children: "Description"
|
|
3838
3960
|
}),
|
|
3839
|
-
/* @__PURE__ */
|
|
3961
|
+
/* @__PURE__ */ jsx28(Textarea, {
|
|
3840
3962
|
value: step.description,
|
|
3841
3963
|
onChange: (e) => onChange({ description: e.target.value }),
|
|
3842
3964
|
rows: 2,
|
|
@@ -3845,13 +3967,13 @@ function StepEditorPanel({
|
|
|
3845
3967
|
})
|
|
3846
3968
|
]
|
|
3847
3969
|
}),
|
|
3848
|
-
/* @__PURE__ */
|
|
3970
|
+
/* @__PURE__ */ jsxs18("div", {
|
|
3849
3971
|
className: "border-t pt-4 border-border",
|
|
3850
3972
|
children: [
|
|
3851
|
-
/* @__PURE__ */
|
|
3973
|
+
/* @__PURE__ */ jsx28(SectionHeader, {
|
|
3852
3974
|
children: "Parameters"
|
|
3853
3975
|
}),
|
|
3854
|
-
/* @__PURE__ */
|
|
3976
|
+
/* @__PURE__ */ jsx28(StepParamsEditor, {
|
|
3855
3977
|
step,
|
|
3856
3978
|
onChange,
|
|
3857
3979
|
availableToolNames,
|
|
@@ -3869,9 +3991,9 @@ function StepEditorPanel({
|
|
|
3869
3991
|
});
|
|
3870
3992
|
}
|
|
3871
3993
|
// src/theme.tsx
|
|
3872
|
-
import { useEffect as useEffect7, useMemo, useState as
|
|
3994
|
+
import { useEffect as useEffect7, useMemo, useState as useState5 } from "react";
|
|
3873
3995
|
function useDarkMode() {
|
|
3874
|
-
const [dark, setDark] =
|
|
3996
|
+
const [dark, setDark] = useState5(() => typeof document !== "undefined" && document.documentElement.classList.contains("dark"));
|
|
3875
3997
|
useEffect7(() => {
|
|
3876
3998
|
const el = document.documentElement;
|
|
3877
3999
|
const observer = new MutationObserver(() => {
|
|
@@ -3896,7 +4018,7 @@ function resolveCssColor(varName, fallback) {
|
|
|
3896
4018
|
}
|
|
3897
4019
|
function useThemeColors() {
|
|
3898
4020
|
const dark = useDarkMode();
|
|
3899
|
-
const [revision, setRevision] =
|
|
4021
|
+
const [revision, setRevision] = useState5(0);
|
|
3900
4022
|
useEffect7(() => {
|
|
3901
4023
|
if (typeof document === "undefined")
|
|
3902
4024
|
return;
|
|
@@ -4054,36 +4176,35 @@ import {
|
|
|
4054
4176
|
useEdgesState,
|
|
4055
4177
|
useNodesState
|
|
4056
4178
|
} from "@xyflow/react";
|
|
4057
|
-
import"@xyflow/react/dist/style.css";
|
|
4058
4179
|
import { Braces, LayoutGrid } from "lucide-react";
|
|
4059
4180
|
import { useCallback as useCallback9, useEffect as useEffect11, useMemo as useMemo3, useRef as useRef9, useState as useState10 } from "react";
|
|
4060
4181
|
|
|
4061
4182
|
// src/components/canvas-context-menu.tsx
|
|
4062
4183
|
import {
|
|
4063
|
-
Bot as
|
|
4064
|
-
FileOutput as
|
|
4065
|
-
GitBranch as
|
|
4066
|
-
Hand as
|
|
4067
|
-
Moon as
|
|
4068
|
-
Play as
|
|
4069
|
-
Repeat as
|
|
4070
|
-
Sparkles as
|
|
4071
|
-
Timer as
|
|
4072
|
-
Wrench as
|
|
4184
|
+
Bot as Bot3,
|
|
4185
|
+
FileOutput as FileOutput3,
|
|
4186
|
+
GitBranch as GitBranch3,
|
|
4187
|
+
Hand as Hand3,
|
|
4188
|
+
Moon as Moon3,
|
|
4189
|
+
Play as Play3,
|
|
4190
|
+
Repeat as Repeat3,
|
|
4191
|
+
Sparkles as Sparkles3,
|
|
4192
|
+
Timer as Timer3,
|
|
4193
|
+
Wrench as Wrench3
|
|
4073
4194
|
} from "lucide-react";
|
|
4074
4195
|
import { useEffect as useEffect8, useRef as useRef6 } from "react";
|
|
4075
|
-
import { jsx as
|
|
4076
|
-
var
|
|
4077
|
-
{ type: "start", label: "Start", icon:
|
|
4078
|
-
{ type: "end", label: "End", icon:
|
|
4079
|
-
{ type: "tool-call", label: "Tool Call", icon:
|
|
4080
|
-
{ type: "llm-prompt", label: "LLM Prompt", icon:
|
|
4081
|
-
{ type: "extract-data", label: "Extract Data", icon:
|
|
4082
|
-
{ type: "switch-case", label: "Switch Case", icon:
|
|
4083
|
-
{ type: "for-each", label: "For Each", icon:
|
|
4084
|
-
{ type: "sleep", label: "Sleep", icon:
|
|
4085
|
-
{ type: "wait-for-condition", label: "Wait for Condition", icon:
|
|
4086
|
-
{ type: "agent-loop", label: "Agent Loop", icon:
|
|
4196
|
+
import { jsx as jsx29, jsxs as jsxs19, Fragment } from "react/jsx-runtime";
|
|
4197
|
+
var STEP_TYPES2 = [
|
|
4198
|
+
{ type: "start", label: "Start", icon: Play3 },
|
|
4199
|
+
{ type: "end", label: "End", icon: Hand3 },
|
|
4200
|
+
{ type: "tool-call", label: "Tool Call", icon: Wrench3 },
|
|
4201
|
+
{ type: "llm-prompt", label: "LLM Prompt", icon: Sparkles3 },
|
|
4202
|
+
{ type: "extract-data", label: "Extract Data", icon: FileOutput3 },
|
|
4203
|
+
{ type: "switch-case", label: "Switch Case", icon: GitBranch3 },
|
|
4204
|
+
{ type: "for-each", label: "For Each", icon: Repeat3 },
|
|
4205
|
+
{ type: "sleep", label: "Sleep", icon: Moon3 },
|
|
4206
|
+
{ type: "wait-for-condition", label: "Wait for Condition", icon: Timer3 },
|
|
4207
|
+
{ type: "agent-loop", label: "Agent Loop", icon: Bot3 }
|
|
4087
4208
|
];
|
|
4088
4209
|
function CanvasContextMenu({
|
|
4089
4210
|
position,
|
|
@@ -4118,40 +4239,40 @@ function CanvasContextMenu({
|
|
|
4118
4239
|
top: position.y,
|
|
4119
4240
|
zIndex: 50
|
|
4120
4241
|
};
|
|
4121
|
-
return /* @__PURE__ */
|
|
4242
|
+
return /* @__PURE__ */ jsxs19("div", {
|
|
4122
4243
|
ref: menuRef,
|
|
4123
4244
|
style: menuStyle,
|
|
4124
4245
|
className: "bg-card border border-border rounded-lg shadow-xl py-1 min-w-[180px] text-sm",
|
|
4125
4246
|
children: [
|
|
4126
|
-
targetNodeId && /* @__PURE__ */
|
|
4247
|
+
targetNodeId && /* @__PURE__ */ jsxs19(Fragment, {
|
|
4127
4248
|
children: [
|
|
4128
|
-
onEditNode && /* @__PURE__ */
|
|
4249
|
+
onEditNode && /* @__PURE__ */ jsx29("button", {
|
|
4129
4250
|
type: "button",
|
|
4130
4251
|
onClick: () => onEditNode(targetNodeId),
|
|
4131
4252
|
className: "w-full px-3 py-1.5 text-left text-foreground hover:bg-muted/50 transition-colors",
|
|
4132
4253
|
children: "Edit Step"
|
|
4133
4254
|
}),
|
|
4134
|
-
onDeleteNode && /* @__PURE__ */
|
|
4255
|
+
onDeleteNode && /* @__PURE__ */ jsx29("button", {
|
|
4135
4256
|
type: "button",
|
|
4136
4257
|
onClick: () => onDeleteNode(targetNodeId),
|
|
4137
4258
|
className: "w-full px-3 py-1.5 text-left text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",
|
|
4138
4259
|
children: "Delete Step"
|
|
4139
4260
|
}),
|
|
4140
|
-
/* @__PURE__ */
|
|
4261
|
+
/* @__PURE__ */ jsx29("div", {
|
|
4141
4262
|
className: "border-t border-border my-1"
|
|
4142
4263
|
})
|
|
4143
4264
|
]
|
|
4144
4265
|
}),
|
|
4145
|
-
/* @__PURE__ */
|
|
4266
|
+
/* @__PURE__ */ jsx29("div", {
|
|
4146
4267
|
className: "px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",
|
|
4147
4268
|
children: "Add Step"
|
|
4148
4269
|
}),
|
|
4149
|
-
|
|
4270
|
+
STEP_TYPES2.map((entry) => /* @__PURE__ */ jsxs19("button", {
|
|
4150
4271
|
type: "button",
|
|
4151
4272
|
onClick: () => onAddStep(entry.type, canvasPosition),
|
|
4152
4273
|
className: "w-full px-3 py-1.5 text-left text-foreground hover:bg-muted/50 transition-colors flex items-center gap-2",
|
|
4153
4274
|
children: [
|
|
4154
|
-
/* @__PURE__ */
|
|
4275
|
+
/* @__PURE__ */ jsx29(entry.icon, {
|
|
4155
4276
|
className: "w-3.5 h-3.5 text-muted-foreground shrink-0"
|
|
4156
4277
|
}),
|
|
4157
4278
|
entry.label
|
|
@@ -4161,129 +4282,6 @@ function CanvasContextMenu({
|
|
|
4161
4282
|
});
|
|
4162
4283
|
}
|
|
4163
4284
|
|
|
4164
|
-
// src/components/step-palette.tsx
|
|
4165
|
-
import {
|
|
4166
|
-
Bot as Bot3,
|
|
4167
|
-
FileOutput as FileOutput3,
|
|
4168
|
-
GitBranch as GitBranch3,
|
|
4169
|
-
Hand as Hand3,
|
|
4170
|
-
Moon as Moon3,
|
|
4171
|
-
Play as Play3,
|
|
4172
|
-
Repeat as Repeat3,
|
|
4173
|
-
Sparkles as Sparkles3,
|
|
4174
|
-
Timer as Timer3,
|
|
4175
|
-
Wrench as Wrench3
|
|
4176
|
-
} from "lucide-react";
|
|
4177
|
-
import { useCallback as useCallback4, useState as useState5 } from "react";
|
|
4178
|
-
import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4179
|
-
var STEP_TYPES2 = [
|
|
4180
|
-
{
|
|
4181
|
-
type: "start",
|
|
4182
|
-
label: "Start",
|
|
4183
|
-
color: "text-green-600 dark:text-green-400",
|
|
4184
|
-
icon: Play3
|
|
4185
|
-
},
|
|
4186
|
-
{
|
|
4187
|
-
type: "end",
|
|
4188
|
-
label: "End",
|
|
4189
|
-
color: "text-muted-foreground",
|
|
4190
|
-
icon: Hand3
|
|
4191
|
-
},
|
|
4192
|
-
{
|
|
4193
|
-
type: "tool-call",
|
|
4194
|
-
label: "Tool Call",
|
|
4195
|
-
color: "text-blue-600 dark:text-blue-400",
|
|
4196
|
-
icon: Wrench3
|
|
4197
|
-
},
|
|
4198
|
-
{
|
|
4199
|
-
type: "llm-prompt",
|
|
4200
|
-
label: "LLM Prompt",
|
|
4201
|
-
color: "text-violet-600 dark:text-violet-400",
|
|
4202
|
-
icon: Sparkles3
|
|
4203
|
-
},
|
|
4204
|
-
{
|
|
4205
|
-
type: "extract-data",
|
|
4206
|
-
label: "Extract Data",
|
|
4207
|
-
color: "text-purple-600 dark:text-purple-400",
|
|
4208
|
-
icon: FileOutput3
|
|
4209
|
-
},
|
|
4210
|
-
{
|
|
4211
|
-
type: "switch-case",
|
|
4212
|
-
label: "Switch Case",
|
|
4213
|
-
color: "text-amber-600 dark:text-amber-400",
|
|
4214
|
-
icon: GitBranch3
|
|
4215
|
-
},
|
|
4216
|
-
{
|
|
4217
|
-
type: "for-each",
|
|
4218
|
-
label: "For Each",
|
|
4219
|
-
color: "text-emerald-600 dark:text-emerald-400",
|
|
4220
|
-
icon: Repeat3
|
|
4221
|
-
},
|
|
4222
|
-
{
|
|
4223
|
-
type: "sleep",
|
|
4224
|
-
label: "Sleep",
|
|
4225
|
-
color: "text-yellow-600 dark:text-yellow-400",
|
|
4226
|
-
icon: Moon3
|
|
4227
|
-
},
|
|
4228
|
-
{
|
|
4229
|
-
type: "wait-for-condition",
|
|
4230
|
-
label: "Wait",
|
|
4231
|
-
color: "text-orange-600 dark:text-orange-400",
|
|
4232
|
-
icon: Timer3
|
|
4233
|
-
},
|
|
4234
|
-
{
|
|
4235
|
-
type: "agent-loop",
|
|
4236
|
-
label: "Agent Loop",
|
|
4237
|
-
color: "text-teal-600 dark:text-teal-400",
|
|
4238
|
-
icon: Bot3
|
|
4239
|
-
}
|
|
4240
|
-
];
|
|
4241
|
-
function StepPalette({ onAddStep }) {
|
|
4242
|
-
const [collapsed, setCollapsed] = useState5(false);
|
|
4243
|
-
const onDragStart = useCallback4((event, type) => {
|
|
4244
|
-
event.dataTransfer.setData("application/remora-step-type", type);
|
|
4245
|
-
event.dataTransfer.effectAllowed = "move";
|
|
4246
|
-
}, []);
|
|
4247
|
-
return /* @__PURE__ */ jsxs19("div", {
|
|
4248
|
-
className: "bg-card border border-border rounded-lg shadow-md overflow-hidden w-[160px]",
|
|
4249
|
-
children: [
|
|
4250
|
-
/* @__PURE__ */ jsxs19("button", {
|
|
4251
|
-
type: "button",
|
|
4252
|
-
onClick: () => setCollapsed(!collapsed),
|
|
4253
|
-
className: "w-full px-3 py-1.5 text-xs font-medium text-foreground flex items-center justify-between hover:bg-muted/50 transition-colors",
|
|
4254
|
-
children: [
|
|
4255
|
-
/* @__PURE__ */ jsx29("span", {
|
|
4256
|
-
children: "Add Steps"
|
|
4257
|
-
}),
|
|
4258
|
-
/* @__PURE__ */ jsx29("span", {
|
|
4259
|
-
className: `text-[10px] text-muted-foreground transition-transform ${collapsed ? "" : "rotate-180"}`,
|
|
4260
|
-
children: "▲"
|
|
4261
|
-
})
|
|
4262
|
-
]
|
|
4263
|
-
}),
|
|
4264
|
-
!collapsed && /* @__PURE__ */ jsx29("div", {
|
|
4265
|
-
className: "border-t border-border",
|
|
4266
|
-
children: STEP_TYPES2.map((entry) => /* @__PURE__ */ jsxs19("button", {
|
|
4267
|
-
type: "button",
|
|
4268
|
-
onClick: () => onAddStep(entry.type),
|
|
4269
|
-
draggable: true,
|
|
4270
|
-
onDragStart: (e) => onDragStart(e, entry.type),
|
|
4271
|
-
className: "w-full px-3 py-1 text-left hover:bg-muted/50 transition-colors cursor-grab active:cursor-grabbing flex items-center gap-1.5",
|
|
4272
|
-
children: [
|
|
4273
|
-
/* @__PURE__ */ jsx29(entry.icon, {
|
|
4274
|
-
className: `w-3.5 h-3.5 shrink-0 ${entry.color}`
|
|
4275
|
-
}),
|
|
4276
|
-
/* @__PURE__ */ jsx29("span", {
|
|
4277
|
-
className: `text-[10px] font-semibold uppercase tracking-wide ${entry.color}`,
|
|
4278
|
-
children: entry.label
|
|
4279
|
-
})
|
|
4280
|
-
]
|
|
4281
|
-
}, entry.type))
|
|
4282
|
-
})
|
|
4283
|
-
]
|
|
4284
|
-
});
|
|
4285
|
-
}
|
|
4286
|
-
|
|
4287
4285
|
// src/components/workflow-json-dialog.tsx
|
|
4288
4286
|
import { Copy, X } from "lucide-react";
|
|
4289
4287
|
import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef7, useState as useState6 } from "react";
|
|
@@ -6069,7 +6067,8 @@ function WorkflowViewer({
|
|
|
6069
6067
|
isEditing = false,
|
|
6070
6068
|
onWorkflowChange,
|
|
6071
6069
|
tools,
|
|
6072
|
-
toolSchemas: toolSchemasProp
|
|
6070
|
+
toolSchemas: toolSchemasProp,
|
|
6071
|
+
hideDetailPanel = false
|
|
6073
6072
|
}) {
|
|
6074
6073
|
const theme = useThemeColors();
|
|
6075
6074
|
const containerRef = useRef9(null);
|
|
@@ -6528,7 +6527,7 @@ function WorkflowViewer({
|
|
|
6528
6527
|
})
|
|
6529
6528
|
]
|
|
6530
6529
|
}),
|
|
6531
|
-
selectedStep && (isEditing ? /* @__PURE__ */ jsx45(StepEditorPanel, {
|
|
6530
|
+
!hideDetailPanel && selectedStep && (isEditing ? /* @__PURE__ */ jsx45(StepEditorPanel, {
|
|
6532
6531
|
step: selectedStep,
|
|
6533
6532
|
availableToolNames,
|
|
6534
6533
|
allStepIds,
|
|
@@ -6568,6 +6567,7 @@ export {
|
|
|
6568
6567
|
WorkflowViewer,
|
|
6569
6568
|
Textarea,
|
|
6570
6569
|
Switch,
|
|
6570
|
+
StepPalette,
|
|
6571
6571
|
StepEditorPanel,
|
|
6572
6572
|
StepDetailPanel,
|
|
6573
6573
|
SelectValue,
|
|
@@ -6593,4 +6593,4 @@ export {
|
|
|
6593
6593
|
Button
|
|
6594
6594
|
};
|
|
6595
6595
|
|
|
6596
|
-
//# debugId=
|
|
6596
|
+
//# debugId=DDBA2E62E0B449AE64756E2164756E21
|