@arbidocs/blocks 0.4.77 → 0.4.78
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/agents/index.cjs +289 -277
- package/dist/agents/index.js +5 -5
- package/dist/agents/tasks/WorkflowThreadStrip.d.ts +9 -4
- package/dist/agents/workflows/StepBarFrame.d.ts +75 -0
- package/dist/agents/workflows/WorkflowRunner.d.ts +5 -1
- package/dist/agents/workflows/WorkflowStepBar.d.ts +9 -11
- package/dist/agents/workflows/index.d.ts +2 -0
- package/dist/agents/workflows/stepWindow.d.ts +59 -0
- package/dist/chat/ChatPage.d.ts +1 -1
- package/dist/chat/chat-page-types.d.ts +5 -0
- package/dist/chat/index.cjs +124 -124
- package/dist/chat/index.js +2 -2
- package/dist/{chunk-HEVVT6IT.js → chunk-5OC5CGYX.js} +128 -124
- package/dist/chunk-5OC5CGYX.js.map +1 -0
- package/dist/chunk-CWAZNXC5.js +441 -0
- package/dist/chunk-CWAZNXC5.js.map +1 -0
- package/dist/{chunk-NIP5BOP7.js → chunk-EWSEQEPL.js} +5 -4
- package/dist/chunk-EWSEQEPL.js.map +1 -0
- package/dist/{chunk-UEU23PTW.js → chunk-ICBAFX5B.js} +3 -3
- package/dist/{chunk-UEU23PTW.js.map → chunk-ICBAFX5B.js.map} +1 -1
- package/dist/{chunk-EKIUMNCN.cjs → chunk-IF6VAYIA.cjs} +5 -5
- package/dist/{chunk-EKIUMNCN.cjs.map → chunk-IF6VAYIA.cjs.map} +1 -1
- package/dist/chunk-MLAHDAN5.cjs +450 -0
- package/dist/chunk-MLAHDAN5.cjs.map +1 -0
- package/dist/{chunk-HOD6OM7L.cjs → chunk-MP6FK43E.cjs} +5 -4
- package/dist/chunk-MP6FK43E.cjs.map +1 -0
- package/dist/{chunk-JFUN4D7D.cjs → chunk-SSDISIDW.cjs} +152 -148
- package/dist/chunk-SSDISIDW.cjs.map +1 -0
- package/dist/{chunk-3XR3IEGU.cjs → chunk-VFIZYSZB.cjs} +573 -168
- package/dist/chunk-VFIZYSZB.cjs.map +1 -0
- package/dist/{chunk-34UW6XUQ.js → chunk-WXRCMIAE.js} +567 -172
- package/dist/chunk-WXRCMIAE.js.map +1 -0
- package/dist/{chunk-GTXOV7IJ.cjs → chunk-XMBYDLZQ.cjs} +4 -4
- package/dist/{chunk-GTXOV7IJ.cjs.map → chunk-XMBYDLZQ.cjs.map} +1 -1
- package/dist/{chunk-OEM5ARVM.js → chunk-XQDM6T6C.js} +3 -3
- package/dist/{chunk-OEM5ARVM.js.map → chunk-XQDM6T6C.js.map} +1 -1
- package/dist/connect/index.cjs +209 -53
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +2 -0
- package/dist/connect/index.js +190 -36
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedTagMatrix.d.ts +20 -0
- package/dist/connection/ConnectedWorkflowRunner.d.ts +13 -1
- package/dist/connection/WorkflowRunThread.d.ts +21 -0
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/home/index.cjs +1 -1
- package/dist/home/index.js +1 -1
- package/dist/index.cjs +492 -447
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/studio/index.cjs +4 -4
- package/dist/studio/index.js +3 -3
- package/dist/tags/TagMatrix.d.ts +64 -0
- package/dist/tags/index.d.ts +3 -0
- package/dist/tags/tagMatrixModel.d.ts +39 -0
- package/dist/workflow-canvas/index.cjs +48 -48
- package/dist/workflow-canvas/index.js +5 -5
- package/package.json +4 -4
- package/dist/chunk-34UW6XUQ.js.map +0 -1
- package/dist/chunk-3XR3IEGU.cjs.map +0 -1
- package/dist/chunk-HEVVT6IT.js.map +0 -1
- package/dist/chunk-HOD6OM7L.cjs.map +0 -1
- package/dist/chunk-JFUN4D7D.cjs.map +0 -1
- package/dist/chunk-NIP5BOP7.js.map +0 -1
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkYJQVLVBJ_cjs = require('./chunk-YJQVLVBJ.cjs');
|
|
5
5
|
var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkVFIZYSZB_cjs = require('./chunk-VFIZYSZB.cjs');
|
|
7
7
|
var chunk7RGLTF76_cjs = require('./chunk-7RGLTF76.cjs');
|
|
8
|
+
var chunkZ5VUZ6YD_cjs = require('./chunk-Z5VUZ6YD.cjs');
|
|
9
|
+
var chunk7D737FLE_cjs = require('./chunk-7D737FLE.cjs');
|
|
8
10
|
var chunk3AFWGEDJ_cjs = require('./chunk-3AFWGEDJ.cjs');
|
|
9
11
|
var chunkVFUWWH52_cjs = require('./chunk-VFUWWH52.cjs');
|
|
10
12
|
var chunkV4ISCZJ7_cjs = require('./chunk-V4ISCZJ7.cjs');
|
|
11
13
|
var chunk2EI7NCUA_cjs = require('./chunk-2EI7NCUA.cjs');
|
|
12
14
|
var chunkIXALYQT7_cjs = require('./chunk-IXALYQT7.cjs');
|
|
13
|
-
var chunkZ5VUZ6YD_cjs = require('./chunk-Z5VUZ6YD.cjs');
|
|
14
|
-
var chunk7D737FLE_cjs = require('./chunk-7D737FLE.cjs');
|
|
15
15
|
var chunkOB5F4577_cjs = require('./chunk-OB5F4577.cjs');
|
|
16
|
-
var chunkC54XEN5T_cjs = require('./chunk-C54XEN5T.cjs');
|
|
17
16
|
var chunkB4SRYJLM_cjs = require('./chunk-B4SRYJLM.cjs');
|
|
18
17
|
var chunk7UTB4PHM_cjs = require('./chunk-7UTB4PHM.cjs');
|
|
19
18
|
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
19
|
+
var chunkC54XEN5T_cjs = require('./chunk-C54XEN5T.cjs');
|
|
20
20
|
var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
|
|
21
21
|
var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
|
|
22
22
|
var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
|
|
@@ -145,7 +145,7 @@ function WorkflowConfigDialog({
|
|
|
145
145
|
}) {
|
|
146
146
|
const l = { ...DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, ...labels };
|
|
147
147
|
const initialKey = JSON.stringify(initialInputs ?? {});
|
|
148
|
-
const seedKey = JSON.stringify({ ...
|
|
148
|
+
const seedKey = JSON.stringify({ ...chunkVFIZYSZB_cjs.defaultInputs(workflow), ...JSON.parse(initialKey) });
|
|
149
149
|
const seed = react.useMemo(() => JSON.parse(seedKey), [seedKey]);
|
|
150
150
|
const [inputs, setInputs] = useControllableState(inputsProp, seed, onInputsChange);
|
|
151
151
|
const [agentId, setAgentId] = useControllableState(
|
|
@@ -157,7 +157,7 @@ function WorkflowConfigDialog({
|
|
|
157
157
|
if (open && inputsProp === void 0) setInputs(seed);
|
|
158
158
|
}, [open, seed]);
|
|
159
159
|
const setField = (name, value) => setInputs({ ...inputs, [name]: value });
|
|
160
|
-
const errors =
|
|
160
|
+
const errors = chunkVFIZYSZB_cjs.validateInputs(workflow, inputs);
|
|
161
161
|
const valid = Object.keys(errors).length === 0;
|
|
162
162
|
const visibleErrors = Object.fromEntries(
|
|
163
163
|
Object.entries(errors).filter(([, e]) => e !== "required")
|
|
@@ -170,7 +170,7 @@ function WorkflowConfigDialog({
|
|
|
170
170
|
const blockedByScope = matchedCount !== null && matchedCount === 0 && Boolean(workflow.requiresFiles);
|
|
171
171
|
const showAgent = workflow.run.kind === "prompt" && workflow.options?.agent !== false && agents !== void 0 && agents.length > 0;
|
|
172
172
|
const launch = (values) => {
|
|
173
|
-
Promise.resolve(onLaunch(
|
|
173
|
+
Promise.resolve(onLaunch(chunkVFIZYSZB_cjs.buildLaunch(workflow, values, agentId))).catch(() => {
|
|
174
174
|
});
|
|
175
175
|
};
|
|
176
176
|
const submit = () => {
|
|
@@ -248,7 +248,7 @@ function WorkflowConfigDialog({
|
|
|
248
248
|
}
|
|
249
249
|
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
250
250
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
251
|
-
|
|
251
|
+
chunkVFIZYSZB_cjs.SchemaForm,
|
|
252
252
|
{
|
|
253
253
|
fields,
|
|
254
254
|
values: inputs,
|
|
@@ -326,7 +326,7 @@ function resolveScopeInputs(workflow, inputs, scopeSource) {
|
|
|
326
326
|
for (const field of workflow.inputs) {
|
|
327
327
|
if (field.type !== "scope") continue;
|
|
328
328
|
const raw = inputs[field.name];
|
|
329
|
-
const scope =
|
|
329
|
+
const scope = chunkVFIZYSZB_cjs.isWorkflowScope(raw) ? raw : { folders: [], labels: [] };
|
|
330
330
|
next[field.name] = { ...scope, documents: scopeSource.resolveDocuments(scope) };
|
|
331
331
|
}
|
|
332
332
|
return next;
|
|
@@ -368,9 +368,9 @@ function WorkflowLauncher({
|
|
|
368
368
|
};
|
|
369
369
|
const select = (workflow) => {
|
|
370
370
|
if (workflow.run.kind === "operation" && workflow.inputs.length === 0) {
|
|
371
|
-
const inputs =
|
|
372
|
-
if (Object.keys(
|
|
373
|
-
Promise.resolve(onLaunch(
|
|
371
|
+
const inputs = chunkVFIZYSZB_cjs.defaultInputs(workflow);
|
|
372
|
+
if (Object.keys(chunkVFIZYSZB_cjs.validateInputs(workflow, inputs)).length === 0) {
|
|
373
|
+
Promise.resolve(onLaunch(chunkVFIZYSZB_cjs.buildLaunch(workflow, inputs, void 0))).catch(() => {
|
|
374
374
|
});
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
@@ -520,7 +520,7 @@ function workflowToSkillMarkdown(workflow) {
|
|
|
520
520
|
if (workflow.landing !== "chat") lines.push(`landing: ${workflow.landing}`);
|
|
521
521
|
if (workflow.requiresFiles) lines.push("requires_files: true");
|
|
522
522
|
if (workflow.inputs.length > 0) {
|
|
523
|
-
lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(
|
|
523
|
+
lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(chunkVFIZYSZB_cjs.fieldToFrontmatter))}`);
|
|
524
524
|
}
|
|
525
525
|
lines.push("---", "", run.promptTemplate.trim(), "");
|
|
526
526
|
return lines.join("\n");
|
|
@@ -542,11 +542,11 @@ function workflowFromSkillMarkdown(id, text2) {
|
|
|
542
542
|
} else if (value === "true" || value === "false") frontmatter[key] = value === "true";
|
|
543
543
|
else frontmatter[key] = value;
|
|
544
544
|
}
|
|
545
|
-
return
|
|
545
|
+
return chunkVFIZYSZB_cjs.workflowFromFrontmatter(id, frontmatter, body);
|
|
546
546
|
}
|
|
547
547
|
function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, resolveWorkflow, compose } = {}) {
|
|
548
|
-
const steps =
|
|
549
|
-
const [inputs, setInputs] = react.useState(() =>
|
|
548
|
+
const steps = chunkVFIZYSZB_cjs.workflowSteps(workflow);
|
|
549
|
+
const [inputs, setInputs] = react.useState(() => chunkVFIZYSZB_cjs.initialRunInputs(workflow));
|
|
550
550
|
const [states, setStates] = react.useState({});
|
|
551
551
|
const set = (id, state) => setStates((s) => ({ ...s, [id]: state }));
|
|
552
552
|
const timers = react.useRef(/* @__PURE__ */ new Map());
|
|
@@ -568,10 +568,10 @@ function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, reso
|
|
|
568
568
|
react.useEffect(() => {
|
|
569
569
|
if (Object.values(states).some((s) => s.status === "running")) return;
|
|
570
570
|
const next = steps.find(
|
|
571
|
-
(s) => (s.kind === "agent" || s.kind === "action") &&
|
|
571
|
+
(s) => (s.kind === "agent" || s.kind === "action") && chunkVFIZYSZB_cjs.stepPhase(steps, states, s.id) === "ready"
|
|
572
572
|
);
|
|
573
573
|
if (!next || next.kind !== "agent" && next.kind !== "action") return;
|
|
574
|
-
const prompt = next.kind === "agent" ?
|
|
574
|
+
const prompt = next.kind === "agent" ? chunkVFIZYSZB_cjs.composeStepPrompt(workflow, next, inputs, { resolveWorkflow, compose }) : "";
|
|
575
575
|
set(next.id, { status: "running", startedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
576
576
|
timers.current.set(
|
|
577
577
|
next.id,
|
|
@@ -584,7 +584,7 @@ function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, reso
|
|
|
584
584
|
}, delayMs)
|
|
585
585
|
);
|
|
586
586
|
}, [states, steps, workflow]);
|
|
587
|
-
return
|
|
587
|
+
return chunkVFIZYSZB_cjs.useWorkflowView({
|
|
588
588
|
steps,
|
|
589
589
|
states,
|
|
590
590
|
inputs,
|
|
@@ -4997,7 +4997,7 @@ function workflowTaskFields(workflow, inputs, name, context) {
|
|
|
4997
4997
|
}
|
|
4998
4998
|
const typed = name?.trim();
|
|
4999
4999
|
if (workflow.options?.agent === false) {
|
|
5000
|
-
const message =
|
|
5000
|
+
const message = chunkVFIZYSZB_cjs.composeWorkflowPrompt(workflow, inputs, context);
|
|
5001
5001
|
return { name: typed || message, prompt: "", skill_ref: null, skill_inputs: null };
|
|
5002
5002
|
}
|
|
5003
5003
|
const derived = typed || deriveWorkflowName(workflow, inputs);
|
|
@@ -5011,7 +5011,7 @@ function workflowTaskFields(workflow, inputs, name, context) {
|
|
|
5011
5011
|
}
|
|
5012
5012
|
return {
|
|
5013
5013
|
name: derived,
|
|
5014
|
-
prompt:
|
|
5014
|
+
prompt: chunkVFIZYSZB_cjs.composeWorkflowPrompt(workflow, inputs, context),
|
|
5015
5015
|
skill_ref: null,
|
|
5016
5016
|
// The files a run is bound to travel in the saved inputs, whatever the template: the server binds
|
|
5017
5017
|
// the run to the ids listed under any input's `documents`.
|
|
@@ -6509,7 +6509,7 @@ function groupThreadActivity(steps, items) {
|
|
|
6509
6509
|
continue;
|
|
6510
6510
|
}
|
|
6511
6511
|
if (current === void 0) out.before.push(item);
|
|
6512
|
-
else if (
|
|
6512
|
+
else if (chunkVFIZYSZB_cjs.isRunFinished(steps, states)) out.after.push(item);
|
|
6513
6513
|
else {
|
|
6514
6514
|
const status = states[current]?.status;
|
|
6515
6515
|
const at = status === "done" || status === "skipped" ? steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? ""))?.id ?? current : current;
|
|
@@ -6581,14 +6581,6 @@ function SignalPill({ signal, l }) {
|
|
|
6581
6581
|
}
|
|
6582
6582
|
);
|
|
6583
6583
|
}
|
|
6584
|
-
function Mark({ phase, icon }) {
|
|
6585
|
-
if (phase === "done") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5" });
|
|
6586
|
-
if (phase === "running") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3.5 animate-spin" });
|
|
6587
|
-
if (phase === "waiting") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Hourglass, { className: "size-3.5" });
|
|
6588
|
-
if (phase === "failed") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3.5" });
|
|
6589
|
-
if (phase === "skipped") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusCircle, { className: "size-3.5" });
|
|
6590
|
-
return icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-3.5 items-center justify-center [&_svg]:size-3.5", children: icon }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-1.5 rounded-full bg-current" });
|
|
6591
|
-
}
|
|
6592
6584
|
function Entry({ item }) {
|
|
6593
6585
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6594
6586
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: item.avatar }),
|
|
@@ -6626,123 +6618,135 @@ function WorkflowThreadStrip({
|
|
|
6626
6618
|
startedBy,
|
|
6627
6619
|
assigneeOf,
|
|
6628
6620
|
labels,
|
|
6621
|
+
barLabels,
|
|
6629
6622
|
className
|
|
6630
6623
|
}) {
|
|
6631
6624
|
const l = { ...DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, ...labels };
|
|
6632
6625
|
const grouped = groupThreadActivity(steps, items);
|
|
6633
6626
|
const strays = signals.filter((s) => !steps.some((step) => step.id === s.step));
|
|
6634
6627
|
const chevron = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-3 shrink-0 text-muted-foreground" });
|
|
6635
|
-
|
|
6636
|
-
|
|
6628
|
+
const [selected, setSelected] = react.useState(null);
|
|
6629
|
+
const [open, setOpen] = react.useState(null);
|
|
6630
|
+
const phaseOf = (id) => chunkVFIZYSZB_cjs.stepPhase(steps, states, id);
|
|
6631
|
+
const iconOf = (step) => step.icon && renderIcon ? renderIcon(step.icon) : void 0;
|
|
6632
|
+
const waitingOf = (id) => {
|
|
6633
|
+
const step = steps.find((s) => s.id === id);
|
|
6634
|
+
const phase = phaseOf(id);
|
|
6635
|
+
const name = step && (phase === "ready" || phase === "waiting") ? assigneeOf?.(step) : void 0;
|
|
6636
|
+
return name ? l.waitingFor.replace("{name}", name) : void 0;
|
|
6637
|
+
};
|
|
6638
|
+
const pill = (step, isCurrent, narrow = false) => {
|
|
6639
|
+
const phase = phaseOf(step.id);
|
|
6640
|
+
const happened = grouped.byStep[step.id] ?? [];
|
|
6641
|
+
const assignee = phase === "ready" || phase === "waiting" ? assigneeOf?.(step) : void 0;
|
|
6642
|
+
const waiting = assignee ? l.waitingFor.replace("{name}", assignee) : void 0;
|
|
6643
|
+
const sentBack = states[step.id]?.sentBack;
|
|
6644
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: open === step.id, onOpenChange: (o) => setOpen(o ? step.id : null), children: [
|
|
6645
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6646
|
+
"button",
|
|
6647
|
+
{
|
|
6648
|
+
type: "button",
|
|
6649
|
+
className: ui.cn(chunkVFIZYSZB_cjs.STEP_PILL, "py-0.5", chunkVFIZYSZB_cjs.stepPillTone(phase, isCurrent)),
|
|
6650
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
6651
|
+
title: waiting ? `${step.title} \xB7 ${waiting}` : step.title,
|
|
6652
|
+
"data-phase": phase,
|
|
6653
|
+
"data-testid": `workflow-thread-step-${step.id}`,
|
|
6654
|
+
children: [
|
|
6655
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVFIZYSZB_cjs.PhaseMark, { phase, icon: iconOf(step) }),
|
|
6656
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: ui.cn(chunkVFIZYSZB_cjs.STEP_LABEL, isCurrent ? "max-w-[16rem]" : "max-w-[11rem]"), children: step.title }),
|
|
6657
|
+
sentBack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6658
|
+
lucideReact.CornerUpLeft,
|
|
6659
|
+
{
|
|
6660
|
+
className: "size-3 shrink-0 text-amber-600 dark:text-amber-400",
|
|
6661
|
+
"aria-label": l.sentBack,
|
|
6662
|
+
"data-testid": `workflow-thread-step-${step.id}-sent-back`
|
|
6663
|
+
}
|
|
6664
|
+
),
|
|
6665
|
+
assignee && isCurrent && !narrow && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6666
|
+
"span",
|
|
6667
|
+
{
|
|
6668
|
+
className: ui.cn(chunkVFIZYSZB_cjs.STEP_EXTRA, "flex max-w-[12rem] items-center gap-0.5"),
|
|
6669
|
+
title: waiting,
|
|
6670
|
+
"data-testid": `workflow-thread-step-${step.id}-assignee`,
|
|
6671
|
+
children: [
|
|
6672
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserRound, { className: "size-3 shrink-0" }),
|
|
6673
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: waiting })
|
|
6674
|
+
]
|
|
6675
|
+
}
|
|
6676
|
+
),
|
|
6677
|
+
happened.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 rounded-full bg-muted px-1.5 text-[10px] font-normal text-muted-foreground", children: happened.length })
|
|
6678
|
+
]
|
|
6679
|
+
}
|
|
6680
|
+
) }),
|
|
6681
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6682
|
+
ui.PopoverContent,
|
|
6683
|
+
{
|
|
6684
|
+
align: "start",
|
|
6685
|
+
className: "w-72 space-y-1 p-2",
|
|
6686
|
+
"data-testid": `workflow-thread-step-${step.id}-menu`,
|
|
6687
|
+
children: [
|
|
6688
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs font-semibold", children: step.title }),
|
|
6689
|
+
assignee && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs", "data-testid": `workflow-thread-step-${step.id}-waiting-for`, children: waiting }),
|
|
6690
|
+
sentBack && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs text-amber-700 dark:text-amber-300", children: l.sentBack }),
|
|
6691
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs font-medium text-muted-foreground", children: happened.length ? l.happened.replace("{count}", String(happened.length)) : l.nothingYet }),
|
|
6692
|
+
happened.map((item) => /* @__PURE__ */ jsxRuntime.jsx(Entry, { item }, item.id)),
|
|
6693
|
+
renderStepAction?.(step, phase),
|
|
6694
|
+
onSkip && ["ready", "blocked", "failed", "waiting"].includes(phase) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6695
|
+
"button",
|
|
6696
|
+
{
|
|
6697
|
+
type: "button",
|
|
6698
|
+
onClick: () => onSkip(step.id),
|
|
6699
|
+
className: "w-full rounded-md px-1 py-1 text-left text-xs text-muted-foreground hover:bg-accent",
|
|
6700
|
+
"data-testid": `workflow-thread-step-${step.id}-skip`,
|
|
6701
|
+
children: l.skip
|
|
6702
|
+
}
|
|
6703
|
+
)
|
|
6704
|
+
]
|
|
6705
|
+
}
|
|
6706
|
+
)
|
|
6707
|
+
] });
|
|
6708
|
+
};
|
|
6709
|
+
const leading = startedBy || grouped.before.length ? /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6710
|
+
startedBy && /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6711
|
+
/* @__PURE__ */ jsxRuntime.jsx(WorkflowThreadStartedBy, { origin: startedBy, labels }),
|
|
6712
|
+
chevron
|
|
6713
|
+
] }),
|
|
6714
|
+
grouped.before.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6715
|
+
/* @__PURE__ */ jsxRuntime.jsx(Entry, { item }),
|
|
6716
|
+
chevron
|
|
6717
|
+
] }, item.id))
|
|
6718
|
+
] }) : null;
|
|
6719
|
+
const trailing = grouped.after.length || strays.length ? /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6720
|
+
grouped.after.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6721
|
+
chevron,
|
|
6722
|
+
/* @__PURE__ */ jsxRuntime.jsx(Entry, { item })
|
|
6723
|
+
] }, item.id)),
|
|
6724
|
+
strays.map((s) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "flex shrink-0 items-center gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(SignalPill, { signal: s, l }) }, `${s.step}-${s.signal}`))
|
|
6725
|
+
] }) : null;
|
|
6726
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("min-w-0 flex-1", className), "data-testid": "workflow-thread-strip", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6727
|
+
chunkVFIZYSZB_cjs.StepBarFrame,
|
|
6637
6728
|
{
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
"span",
|
|
6658
|
-
{
|
|
6659
|
-
className: ui.cn(
|
|
6660
|
-
"flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-2 py-0.5 text-xs font-medium",
|
|
6661
|
-
phase === "running" || phase === "ready" || phase === "waiting" ? "border-primary bg-primary/10 text-primary" : phase === "done" || phase === "skipped" ? "border-primary/30 text-primary" : phase === "failed" ? "border-destructive/40 text-destructive" : "border-dashed border-border text-muted-foreground"
|
|
6662
|
-
),
|
|
6663
|
-
"data-phase": phase,
|
|
6664
|
-
"data-testid": `workflow-thread-step-${step.id}`,
|
|
6665
|
-
children: [
|
|
6666
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6667
|
-
Mark,
|
|
6668
|
-
{
|
|
6669
|
-
phase,
|
|
6670
|
-
icon: step.icon && renderIcon ? renderIcon(step.icon) : void 0
|
|
6671
|
-
}
|
|
6672
|
-
),
|
|
6673
|
-
step.title,
|
|
6674
|
-
sentBack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6675
|
-
lucideReact.CornerUpLeft,
|
|
6676
|
-
{
|
|
6677
|
-
className: "size-3 text-amber-600 dark:text-amber-400",
|
|
6678
|
-
"aria-label": l.sentBack,
|
|
6679
|
-
"data-testid": `workflow-thread-step-${step.id}-sent-back`
|
|
6680
|
-
}
|
|
6681
|
-
),
|
|
6682
|
-
assignee && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6683
|
-
"span",
|
|
6684
|
-
{
|
|
6685
|
-
className: "flex max-w-32 items-center gap-0.5 truncate font-normal opacity-80",
|
|
6686
|
-
title: l.waitingFor.replace("{name}", assignee),
|
|
6687
|
-
"data-testid": `workflow-thread-step-${step.id}-assignee`,
|
|
6688
|
-
children: [
|
|
6689
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserRound, { className: "size-3 shrink-0" }),
|
|
6690
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: assignee })
|
|
6691
|
-
]
|
|
6692
|
-
}
|
|
6693
|
-
),
|
|
6694
|
-
happened.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-muted px-1.5 text-[10px] text-muted-foreground", children: happened.length })
|
|
6695
|
-
]
|
|
6696
|
-
}
|
|
6697
|
-
);
|
|
6698
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6699
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
6700
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "rounded-full", children: chip }) }),
|
|
6701
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6702
|
-
ui.PopoverContent,
|
|
6703
|
-
{
|
|
6704
|
-
align: "start",
|
|
6705
|
-
className: "w-72 space-y-1 p-2",
|
|
6706
|
-
"data-testid": `workflow-thread-step-${step.id}-menu`,
|
|
6707
|
-
children: [
|
|
6708
|
-
assignee && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6709
|
-
"p",
|
|
6710
|
-
{
|
|
6711
|
-
className: "px-1 text-xs",
|
|
6712
|
-
"data-testid": `workflow-thread-step-${step.id}-waiting-for`,
|
|
6713
|
-
children: l.waitingFor.replace("{name}", assignee)
|
|
6714
|
-
}
|
|
6715
|
-
),
|
|
6716
|
-
sentBack && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs text-amber-700 dark:text-amber-300", children: l.sentBack }),
|
|
6717
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs font-medium text-muted-foreground", children: happened.length ? l.happened.replace("{count}", String(happened.length)) : l.nothingYet }),
|
|
6718
|
-
happened.map((item) => /* @__PURE__ */ jsxRuntime.jsx(Entry, { item }, item.id)),
|
|
6719
|
-
renderStepAction?.(step, phase),
|
|
6720
|
-
onSkip && ["ready", "blocked", "failed", "waiting"].includes(phase) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6721
|
-
"button",
|
|
6722
|
-
{
|
|
6723
|
-
type: "button",
|
|
6724
|
-
onClick: () => onSkip(step.id),
|
|
6725
|
-
className: "w-full rounded-md px-1 py-1 text-left text-xs text-muted-foreground hover:bg-accent",
|
|
6726
|
-
"data-testid": `workflow-thread-step-${step.id}-skip`,
|
|
6727
|
-
children: l.skip
|
|
6728
|
-
}
|
|
6729
|
-
)
|
|
6730
|
-
]
|
|
6731
|
-
}
|
|
6732
|
-
)
|
|
6733
|
-
] }),
|
|
6734
|
-
signals.filter((s) => s.step === step.id).map((s) => /* @__PURE__ */ jsxRuntime.jsx(SignalPill, { signal: s, l }, `${s.step}-${s.signal}`)),
|
|
6735
|
-
(i < steps.length - 1 || grouped.after.length > 0 || strays.length > 0) && chevron
|
|
6736
|
-
] }, step.id);
|
|
6737
|
-
}),
|
|
6738
|
-
grouped.after.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6739
|
-
/* @__PURE__ */ jsxRuntime.jsx(Entry, { item }),
|
|
6740
|
-
(i < grouped.after.length - 1 || strays.length > 0) && chevron
|
|
6741
|
-
] }, item.id)),
|
|
6742
|
-
strays.map((s) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "flex shrink-0 items-center gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(SignalPill, { signal: s, l }) }, `${s.step}-${s.signal}`))
|
|
6743
|
-
] })
|
|
6729
|
+
levels: chunkVFIZYSZB_cjs.stepLevels(steps),
|
|
6730
|
+
phaseOf,
|
|
6731
|
+
current: selected,
|
|
6732
|
+
onSelect: (id) => {
|
|
6733
|
+
setSelected(id);
|
|
6734
|
+
setOpen(id);
|
|
6735
|
+
},
|
|
6736
|
+
renderStep: (step, _level, win, narrow) => pill(
|
|
6737
|
+
step,
|
|
6738
|
+
step.id === win.levels[win.currentLevel]?.primary.id || step.id === selected,
|
|
6739
|
+
narrow
|
|
6740
|
+
),
|
|
6741
|
+
noteOf: waitingOf,
|
|
6742
|
+
renderAfter: (level) => signals.filter((s) => level.steps.some((step) => step.id === s.step)).map((s) => /* @__PURE__ */ jsxRuntime.jsx(SignalPill, { signal: s, l }, `${s.step}-${s.signal}`)),
|
|
6743
|
+
leading,
|
|
6744
|
+
trailing,
|
|
6745
|
+
icon: iconOf,
|
|
6746
|
+
labels: { waitingFor: l.waitingFor, ...barLabels },
|
|
6747
|
+
tid: (suffix) => `workflow-thread-${suffix}`
|
|
6744
6748
|
}
|
|
6745
|
-
);
|
|
6749
|
+
) });
|
|
6746
6750
|
}
|
|
6747
6751
|
|
|
6748
6752
|
// src/agents/tasks/linkedRuns.ts
|
|
@@ -7204,7 +7208,7 @@ function defaultTaskComposerValues(workflows, initial) {
|
|
|
7204
7208
|
return {
|
|
7205
7209
|
assignee: "me",
|
|
7206
7210
|
workflowId,
|
|
7207
|
-
inputs: workflow ? { ...
|
|
7211
|
+
inputs: workflow ? { ...chunkVFIZYSZB_cjs.defaultInputs(workflow), ...initial?.inputs } : { ...initial?.inputs },
|
|
7208
7212
|
when: "manual",
|
|
7209
7213
|
runAt: "",
|
|
7210
7214
|
rrule: "",
|
|
@@ -7313,7 +7317,7 @@ function WorkflowComposer({
|
|
|
7313
7317
|
return !docs?.length;
|
|
7314
7318
|
})
|
|
7315
7319
|
);
|
|
7316
|
-
const whatMissing = !workflow || Object.keys(
|
|
7320
|
+
const whatMissing = !workflow || Object.keys(chunkVFIZYSZB_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs)).length > 0;
|
|
7317
7321
|
const runAtPast = values.when === "once" && values.runAt !== "" && values.runAt !== initialValues?.runAt && new Date(values.runAt).getTime() <= Date.now();
|
|
7318
7322
|
const whenMissing = missingWhen(values, runAtPast);
|
|
7319
7323
|
const scheduled = values.when !== "now" && values.when !== "manual";
|
|
@@ -7325,7 +7329,7 @@ function WorkflowComposer({
|
|
|
7325
7329
|
setValues({
|
|
7326
7330
|
...values,
|
|
7327
7331
|
workflowId: next,
|
|
7328
|
-
inputs: def ?
|
|
7332
|
+
inputs: def ? chunkVFIZYSZB_cjs.defaultInputs(def) : {},
|
|
7329
7333
|
...def?.documentAction ? { access: "standing" } : {}
|
|
7330
7334
|
});
|
|
7331
7335
|
};
|
|
@@ -7463,7 +7467,7 @@ function WorkflowComposer({
|
|
|
7463
7467
|
}
|
|
7464
7468
|
),
|
|
7465
7469
|
!noFiles && workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7466
|
-
|
|
7470
|
+
chunkVFIZYSZB_cjs.SchemaForm,
|
|
7467
7471
|
{
|
|
7468
7472
|
fields,
|
|
7469
7473
|
values: values.inputs,
|
|
@@ -7902,7 +7906,7 @@ function WorkTaskComposer({
|
|
|
7902
7906
|
}, [open]);
|
|
7903
7907
|
const workflow = workflows.find((w) => w.id === values.workflowId);
|
|
7904
7908
|
const fields = workflow?.inputs ?? [];
|
|
7905
|
-
const errors = workflow ?
|
|
7909
|
+
const errors = workflow ? chunkVFIZYSZB_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs) : {};
|
|
7906
7910
|
const hasWork = configOpen && Boolean(workflow) && Object.keys(errors).length === 0;
|
|
7907
7911
|
const unattended = hasWork && values.when !== "now" && values.when !== "manual";
|
|
7908
7912
|
const canConfigure = !isEdit || seed.assignee === "agent";
|
|
@@ -7910,7 +7914,7 @@ function WorkTaskComposer({
|
|
|
7910
7914
|
const set = (key, value) => setValues({ ...values, [key]: value });
|
|
7911
7915
|
const pickWorkflow = (id2) => {
|
|
7912
7916
|
const next = workflows.find((w) => w.id === id2);
|
|
7913
|
-
setValues({ ...values, workflowId: id2, inputs: next ?
|
|
7917
|
+
setValues({ ...values, workflowId: id2, inputs: next ? chunkVFIZYSZB_cjs.defaultInputs(next) : {} });
|
|
7914
7918
|
};
|
|
7915
7919
|
const openConfigure = () => {
|
|
7916
7920
|
setConfigOpen(true);
|
|
@@ -8096,7 +8100,7 @@ function WorkTaskComposer({
|
|
|
8096
8100
|
)
|
|
8097
8101
|
] }),
|
|
8098
8102
|
workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8099
|
-
|
|
8103
|
+
chunkVFIZYSZB_cjs.SchemaForm,
|
|
8100
8104
|
{
|
|
8101
8105
|
fields,
|
|
8102
8106
|
values: values.inputs,
|
|
@@ -10279,5 +10283,5 @@ exports.workflowToComposerValues = workflowToComposerValues;
|
|
|
10279
10283
|
exports.workflowToSkillMarkdown = workflowToSkillMarkdown;
|
|
10280
10284
|
exports.workflowTriggerType = workflowTriggerType;
|
|
10281
10285
|
exports.workflowWhen = workflowWhen;
|
|
10282
|
-
//# sourceMappingURL=chunk-
|
|
10283
|
-
//# sourceMappingURL=chunk-
|
|
10286
|
+
//# sourceMappingURL=chunk-SSDISIDW.cjs.map
|
|
10287
|
+
//# sourceMappingURL=chunk-SSDISIDW.cjs.map
|