@arbidocs/blocks 0.4.75 → 0.4.76
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 +265 -253
- package/dist/agents/index.js +3 -3
- package/dist/agents/tasks/TaskActivityTimeline.d.ts +1 -1
- package/dist/agents/tasks/WorkflowThreadStrip.d.ts +38 -1
- package/dist/agents/tasks/index.d.ts +2 -1
- package/dist/agents/tasks/linkedRuns.d.ts +31 -0
- package/dist/agents/workflows/index.d.ts +1 -1
- package/dist/agents/workflows/planSteps.d.ts +3 -1
- package/dist/agents/workflows/types.d.ts +27 -0
- package/dist/{chunk-YWYVIQ7T.js → chunk-22P5KNIM.js} +24 -4
- package/dist/chunk-22P5KNIM.js.map +1 -0
- package/dist/{chunk-F4LUD3YC.cjs → chunk-7FKARMA3.cjs} +158 -53
- package/dist/chunk-7FKARMA3.cjs.map +1 -0
- package/dist/{chunk-LT2UORRG.js → chunk-TKB7TVMW.js} +132 -29
- package/dist/chunk-TKB7TVMW.js.map +1 -0
- package/dist/{chunk-P2RBE3FD.cjs → chunk-VYRKO3XU.cjs} +24 -3
- package/dist/chunk-VYRKO3XU.cjs.map +1 -0
- package/dist/connect/index.cjs +10 -10
- package/dist/connect/index.js +3 -3
- 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 +430 -418
- package/dist/index.js +7 -7
- package/dist/settings/index.cjs +1 -1
- package/dist/settings/index.js +1 -1
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/studio/index.cjs +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/workflow-canvas/SignalsEditor.d.ts +41 -0
- package/dist/workflow-canvas/StepInspector.d.ts +4 -1
- package/dist/workflow-canvas/TriggerInspector.d.ts +11 -2
- package/dist/workflow-canvas/WorkflowBuilder.d.ts +7 -2
- package/dist/workflow-canvas/index.cjs +443 -149
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.d.ts +2 -1
- package/dist/workflow-canvas/index.js +410 -123
- package/dist/workflow-canvas/index.js.map +1 -1
- package/dist/workflow-canvas/trigger.d.ts +20 -1
- package/package.json +4 -4
- package/dist/chunk-F4LUD3YC.cjs.map +0 -1
- package/dist/chunk-LT2UORRG.js.map +0 -1
- package/dist/chunk-P2RBE3FD.cjs.map +0 -1
- package/dist/chunk-YWYVIQ7T.js.map +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkYJQVLVBJ_cjs = require('./chunk-YJQVLVBJ.cjs');
|
|
5
5
|
var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkVYRKO3XU_cjs = require('./chunk-VYRKO3XU.cjs');
|
|
7
7
|
var chunk7RGLTF76_cjs = require('./chunk-7RGLTF76.cjs');
|
|
8
8
|
var chunk3AFWGEDJ_cjs = require('./chunk-3AFWGEDJ.cjs');
|
|
9
9
|
var chunkVFUWWH52_cjs = require('./chunk-VFUWWH52.cjs');
|
|
@@ -13,10 +13,10 @@ var chunkIXALYQT7_cjs = require('./chunk-IXALYQT7.cjs');
|
|
|
13
13
|
var chunkZ5VUZ6YD_cjs = require('./chunk-Z5VUZ6YD.cjs');
|
|
14
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');
|
|
16
17
|
var chunkB4SRYJLM_cjs = require('./chunk-B4SRYJLM.cjs');
|
|
17
18
|
var chunk7UTB4PHM_cjs = require('./chunk-7UTB4PHM.cjs');
|
|
18
19
|
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({ ...chunkVYRKO3XU_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 = chunkVYRKO3XU_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(chunkVYRKO3XU_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
|
+
chunkVYRKO3XU_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 = chunkVYRKO3XU_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 = chunkVYRKO3XU_cjs.defaultInputs(workflow);
|
|
372
|
+
if (Object.keys(chunkVYRKO3XU_cjs.validateInputs(workflow, inputs)).length === 0) {
|
|
373
|
+
Promise.resolve(onLaunch(chunkVYRKO3XU_cjs.buildLaunch(workflow, inputs, void 0))).catch(() => {
|
|
374
374
|
});
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
@@ -506,7 +506,7 @@ function WorkflowDocumentsField({
|
|
|
506
506
|
|
|
507
507
|
// src/agents/workflows/skillMarkdown.ts
|
|
508
508
|
var JSON_KEYS = /* @__PURE__ */ new Set(["inputs"]);
|
|
509
|
-
var oneLine = (
|
|
509
|
+
var oneLine = (text2) => text2.replace(/\s*\n\s*/g, " ").trim();
|
|
510
510
|
var skillSlug = (raw) => raw.toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
511
511
|
function workflowToSkillMarkdown(workflow) {
|
|
512
512
|
const { run } = workflow;
|
|
@@ -520,15 +520,15 @@ 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(chunkVYRKO3XU_cjs.fieldToFrontmatter))}`);
|
|
524
524
|
}
|
|
525
525
|
lines.push("---", "", run.promptTemplate.trim(), "");
|
|
526
526
|
return lines.join("\n");
|
|
527
527
|
}
|
|
528
|
-
function workflowFromSkillMarkdown(id,
|
|
529
|
-
const match = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/.exec(
|
|
528
|
+
function workflowFromSkillMarkdown(id, text2) {
|
|
529
|
+
const match = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/.exec(text2);
|
|
530
530
|
const frontmatter = {};
|
|
531
|
-
const body = match ? match[2] :
|
|
531
|
+
const body = match ? match[2] : text2;
|
|
532
532
|
for (const line of (match ? match[1] : "").split("\n")) {
|
|
533
533
|
const i = line.indexOf(":");
|
|
534
534
|
if (i < 1) continue;
|
|
@@ -542,11 +542,11 @@ function workflowFromSkillMarkdown(id, text) {
|
|
|
542
542
|
} else if (value === "true" || value === "false") frontmatter[key] = value === "true";
|
|
543
543
|
else frontmatter[key] = value;
|
|
544
544
|
}
|
|
545
|
-
return
|
|
545
|
+
return chunkVYRKO3XU_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 = chunkVYRKO3XU_cjs.workflowSteps(workflow);
|
|
549
|
+
const [inputs, setInputs] = react.useState(() => chunkVYRKO3XU_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());
|
|
@@ -567,9 +567,9 @@ function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, reso
|
|
|
567
567
|
}, []);
|
|
568
568
|
react.useEffect(() => {
|
|
569
569
|
if (Object.values(states).some((s) => s.status === "running")) return;
|
|
570
|
-
const next = steps.find((s) => s.kind === "agent" &&
|
|
570
|
+
const next = steps.find((s) => s.kind === "agent" && chunkVYRKO3XU_cjs.stepPhase(steps, states, s.id) === "ready");
|
|
571
571
|
if (!next || next.kind !== "agent") return;
|
|
572
|
-
const prompt =
|
|
572
|
+
const prompt = chunkVYRKO3XU_cjs.composeStepPrompt(workflow, next, inputs, { resolveWorkflow, compose });
|
|
573
573
|
set(next.id, { status: "running", startedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
574
574
|
timers.current.set(
|
|
575
575
|
next.id,
|
|
@@ -579,7 +579,7 @@ function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, reso
|
|
|
579
579
|
}, delayMs)
|
|
580
580
|
);
|
|
581
581
|
}, [states, steps, workflow]);
|
|
582
|
-
return
|
|
582
|
+
return chunkVYRKO3XU_cjs.useWorkflowView({
|
|
583
583
|
steps,
|
|
584
584
|
states,
|
|
585
585
|
inputs,
|
|
@@ -2030,7 +2030,7 @@ function TaskPlan({
|
|
|
2030
2030
|
);
|
|
2031
2031
|
}
|
|
2032
2032
|
const patch = (fields) => onChange({ ...plan, ...fields });
|
|
2033
|
-
const setCriterion = (idx,
|
|
2033
|
+
const setCriterion = (idx, text2) => patch({ criteria: plan.criteria.map((c, i) => i === idx ? { ...c, text: text2 } : c) });
|
|
2034
2034
|
const addCriterion = () => patch({ criteria: [...plan.criteria, { id: nextCriterionId(plan.criteria), text: "" }] });
|
|
2035
2035
|
const removeCriterion = (idx) => patch({ criteria: plan.criteria.filter((_, i) => i !== idx) });
|
|
2036
2036
|
const count = plan.criteria.length;
|
|
@@ -2976,10 +2976,10 @@ function TaskStatusPill({
|
|
|
2976
2976
|
const generating = key === "generating";
|
|
2977
2977
|
const now = useNow(generating && Boolean(runStartedAt));
|
|
2978
2978
|
const started = runStartedAt ? Date.parse(runStartedAt) : NaN;
|
|
2979
|
-
let
|
|
2979
|
+
let text2 = STATUS_LABELS[key];
|
|
2980
2980
|
let tone = STATUS_TONE[key];
|
|
2981
2981
|
if (awaitingAccess) {
|
|
2982
|
-
|
|
2982
|
+
text2 = l.waitingForAccess;
|
|
2983
2983
|
tone = "danger";
|
|
2984
2984
|
}
|
|
2985
2985
|
const elapsed = generating && !Number.isNaN(started) ? formatElapsed(started, now) : null;
|
|
@@ -2992,7 +2992,7 @@ function TaskStatusPill({
|
|
|
2992
2992
|
"data-status": key,
|
|
2993
2993
|
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: `task-status-${id}` }),
|
|
2994
2994
|
children: [
|
|
2995
|
-
|
|
2995
|
+
text2,
|
|
2996
2996
|
elapsed && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tabular-nums opacity-70", children: [
|
|
2997
2997
|
"\xB7 ",
|
|
2998
2998
|
elapsed
|
|
@@ -3398,8 +3398,8 @@ function TaskTable(props) {
|
|
|
3398
3398
|
const map = new Map(STATUS_ORDER.map((s) => [s, 0]));
|
|
3399
3399
|
let all = 0;
|
|
3400
3400
|
for (const task of tasks) {
|
|
3401
|
-
const
|
|
3402
|
-
if (q && !
|
|
3401
|
+
const text2 = `${nameOf(task)} ${task.description ?? ""}`.toLowerCase();
|
|
3402
|
+
if (q && !text2.includes(q)) continue;
|
|
3403
3403
|
all += 1;
|
|
3404
3404
|
const s = asTaskStatus(task.status);
|
|
3405
3405
|
map.set(s, (map.get(s) ?? 0) + 1);
|
|
@@ -4944,8 +4944,8 @@ function isoToLocalInput(iso) {
|
|
|
4944
4944
|
return new Date(d.getTime() - d.getTimezoneOffset() * 6e4).toISOString().slice(0, 16);
|
|
4945
4945
|
}
|
|
4946
4946
|
var DERIVED_NAME_WORDS = 6;
|
|
4947
|
-
function firstWords(
|
|
4948
|
-
const words =
|
|
4947
|
+
function firstWords(text2, count = DERIVED_NAME_WORDS) {
|
|
4948
|
+
const words = text2.trim().split(/\s+/).filter(Boolean);
|
|
4949
4949
|
if (words.length <= count) return words.join(" ");
|
|
4950
4950
|
return `${words.slice(0, count).join(" ")}\u2026`;
|
|
4951
4951
|
}
|
|
@@ -4992,7 +4992,7 @@ function workflowTaskFields(workflow, inputs, name, context) {
|
|
|
4992
4992
|
}
|
|
4993
4993
|
const typed = name?.trim();
|
|
4994
4994
|
if (workflow.options?.agent === false) {
|
|
4995
|
-
const message =
|
|
4995
|
+
const message = chunkVYRKO3XU_cjs.composeWorkflowPrompt(workflow, inputs, context);
|
|
4996
4996
|
return { name: typed || message, prompt: "", skill_ref: null, skill_inputs: null };
|
|
4997
4997
|
}
|
|
4998
4998
|
const derived = typed || deriveWorkflowName(workflow, inputs);
|
|
@@ -5006,7 +5006,7 @@ function workflowTaskFields(workflow, inputs, name, context) {
|
|
|
5006
5006
|
}
|
|
5007
5007
|
return {
|
|
5008
5008
|
name: derived,
|
|
5009
|
-
prompt:
|
|
5009
|
+
prompt: chunkVYRKO3XU_cjs.composeWorkflowPrompt(workflow, inputs, context),
|
|
5010
5010
|
skill_ref: null,
|
|
5011
5011
|
// The files a run is bound to travel in the saved inputs, whatever the template: the server binds
|
|
5012
5012
|
// the run to the ids listed under any input's `documents`.
|
|
@@ -5539,7 +5539,7 @@ function TaskTriggerChip({
|
|
|
5539
5539
|
}) {
|
|
5540
5540
|
const l = { ...DEFAULT_TASK_TRIGGER_CHIP_LABELS, ...labels };
|
|
5541
5541
|
const chained = Boolean(afterTaskId);
|
|
5542
|
-
const
|
|
5542
|
+
const text2 = chained ? afterTaskName ? l.after(afterTaskName) : l.afterUnknown : triggerType === "on_demand" ? l.onDemand : summary;
|
|
5543
5543
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5544
5544
|
"span",
|
|
5545
5545
|
{
|
|
@@ -5548,7 +5548,7 @@ function TaskTriggerChip({
|
|
|
5548
5548
|
"data-trigger": chained ? "task" : triggerType,
|
|
5549
5549
|
children: [
|
|
5550
5550
|
/* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { type: triggerType, chained }),
|
|
5551
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children:
|
|
5551
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: text2 })
|
|
5552
5552
|
]
|
|
5553
5553
|
}
|
|
5554
5554
|
);
|
|
@@ -5781,9 +5781,9 @@ function WorkflowsTable(props) {
|
|
|
5781
5781
|
renderName: (w) => {
|
|
5782
5782
|
const { l: lb } = latest.current;
|
|
5783
5783
|
const skill = isSkillRow(w);
|
|
5784
|
-
const
|
|
5784
|
+
const text2 = skill ? latest.current.actionText(w) : w.description || latest.current.actionText(w);
|
|
5785
5785
|
const stem = w.name.replace(/…$/, "").trim();
|
|
5786
|
-
const about =
|
|
5786
|
+
const about = text2 && text2.trim() !== w.name.trim() && text2.trim() !== stem ? text2 : "";
|
|
5787
5787
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 leading-tight", children: [
|
|
5788
5788
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
5789
5789
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6212,7 +6212,9 @@ var ICONS = {
|
|
|
6212
6212
|
step_started: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-3.5", "aria-hidden": true }),
|
|
6213
6213
|
step_done: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "size-3.5", "aria-hidden": true }),
|
|
6214
6214
|
step_skipped: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "size-3.5", "aria-hidden": true }),
|
|
6215
|
-
step_failed: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3.5", "aria-hidden": true })
|
|
6215
|
+
step_failed: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3.5", "aria-hidden": true }),
|
|
6216
|
+
step_signal: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Flag, { className: "size-3.5", "aria-hidden": true }),
|
|
6217
|
+
linked_run: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { className: "size-3.5", "aria-hidden": true })
|
|
6216
6218
|
};
|
|
6217
6219
|
var asString = (v) => typeof v === "string" && v.trim() ? v : null;
|
|
6218
6220
|
function summarizeError(error) {
|
|
@@ -6257,6 +6259,12 @@ function TaskActivityTimeline({
|
|
|
6257
6259
|
return { headline: "Step done" };
|
|
6258
6260
|
case "step_skipped":
|
|
6259
6261
|
return { headline: "Step skipped" };
|
|
6262
|
+
case "step_signal":
|
|
6263
|
+
return { headline: `Signalled \u201C${asString(detail.signal) ?? "a signal"}\u201D` };
|
|
6264
|
+
case "linked_run":
|
|
6265
|
+
return {
|
|
6266
|
+
headline: `Started a linked workflow on \u201C${asString(detail.signal) ?? "a signal"}\u201D`
|
|
6267
|
+
};
|
|
6260
6268
|
case "step_failed":
|
|
6261
6269
|
return {
|
|
6262
6270
|
headline: "Step failed",
|
|
@@ -6475,7 +6483,7 @@ function groupThreadActivity(steps, items) {
|
|
|
6475
6483
|
continue;
|
|
6476
6484
|
}
|
|
6477
6485
|
if (current === void 0) out.before.push(item);
|
|
6478
|
-
else if (
|
|
6486
|
+
else if (chunkVYRKO3XU_cjs.isRunFinished(steps, states)) out.after.push(item);
|
|
6479
6487
|
else {
|
|
6480
6488
|
const status = states[current]?.status;
|
|
6481
6489
|
const at = status === "done" || status === "skipped" ? steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? ""))?.id ?? current : current;
|
|
@@ -6487,8 +6495,64 @@ function groupThreadActivity(steps, items) {
|
|
|
6487
6495
|
var DEFAULT_WORKFLOW_THREAD_STRIP_LABELS = {
|
|
6488
6496
|
happened: "{count} in this step",
|
|
6489
6497
|
nothingYet: "Nothing here yet.",
|
|
6490
|
-
skip: "Skip this step"
|
|
6498
|
+
skip: "Skip this step",
|
|
6499
|
+
startedBy: "Started by {step} in {thread}",
|
|
6500
|
+
signalled: "This step signalled \u201C{signal}\u201D",
|
|
6501
|
+
linkedRun: "Started on \u201C{signal}\u201D: open its thread"
|
|
6491
6502
|
};
|
|
6503
|
+
function WorkflowThreadStartedBy({
|
|
6504
|
+
origin,
|
|
6505
|
+
labels
|
|
6506
|
+
}) {
|
|
6507
|
+
const l = { ...DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, ...labels };
|
|
6508
|
+
const text2 = l.startedBy.replace("{step}", origin.stepTitle).replace("{thread}", origin.threadTitle);
|
|
6509
|
+
const className = "flex max-w-64 shrink-0 items-center gap-1 truncate rounded-full border border-border px-2 py-0.5 text-[11px] text-muted-foreground";
|
|
6510
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6511
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CornerLeftUp, { className: "size-3 shrink-0" }),
|
|
6512
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: text2 })
|
|
6513
|
+
] });
|
|
6514
|
+
return origin.onSelect ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6515
|
+
"button",
|
|
6516
|
+
{
|
|
6517
|
+
type: "button",
|
|
6518
|
+
onClick: origin.onSelect,
|
|
6519
|
+
title: origin.signal ? `${text2} (${origin.signal})` : text2,
|
|
6520
|
+
className: ui.cn(className, "hover:border-primary/40 hover:text-primary"),
|
|
6521
|
+
"data-testid": "workflow-thread-started-by",
|
|
6522
|
+
children: content
|
|
6523
|
+
}
|
|
6524
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className, title: text2, "data-testid": "workflow-thread-started-by", children: content });
|
|
6525
|
+
}
|
|
6526
|
+
function SignalPill({ signal, l }) {
|
|
6527
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6528
|
+
"span",
|
|
6529
|
+
{
|
|
6530
|
+
className: "flex shrink-0 items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[11px] text-amber-700 dark:text-amber-300",
|
|
6531
|
+
title: l.signalled.replace("{signal}", signal.signal),
|
|
6532
|
+
"data-testid": `workflow-thread-signal-${signal.step}-${signal.signal}`,
|
|
6533
|
+
children: [
|
|
6534
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Flag, { className: "size-3 shrink-0" }),
|
|
6535
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: signal.signal }),
|
|
6536
|
+
signal.runs.map((run) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6537
|
+
"button",
|
|
6538
|
+
{
|
|
6539
|
+
type: "button",
|
|
6540
|
+
onClick: run.onSelect,
|
|
6541
|
+
disabled: !run.onSelect,
|
|
6542
|
+
title: l.linkedRun.replace("{signal}", signal.signal),
|
|
6543
|
+
className: "flex max-w-40 items-center gap-0.5 truncate rounded-full bg-background/80 px-1.5 text-foreground hover:text-primary disabled:cursor-default",
|
|
6544
|
+
"data-testid": `workflow-thread-linked-${run.id}`,
|
|
6545
|
+
children: [
|
|
6546
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { className: "size-3 shrink-0" }),
|
|
6547
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: run.label })
|
|
6548
|
+
]
|
|
6549
|
+
},
|
|
6550
|
+
run.id
|
|
6551
|
+
))
|
|
6552
|
+
]
|
|
6553
|
+
}
|
|
6554
|
+
);
|
|
6555
|
+
}
|
|
6492
6556
|
function Mark({ phase, icon }) {
|
|
6493
6557
|
if (phase === "done") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5" });
|
|
6494
6558
|
if (phase === "running") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3.5 animate-spin" });
|
|
@@ -6529,11 +6593,14 @@ function WorkflowThreadStrip({
|
|
|
6529
6593
|
renderIcon,
|
|
6530
6594
|
onSkip,
|
|
6531
6595
|
renderStepAction,
|
|
6596
|
+
signals = [],
|
|
6597
|
+
startedBy,
|
|
6532
6598
|
labels,
|
|
6533
6599
|
className
|
|
6534
6600
|
}) {
|
|
6535
6601
|
const l = { ...DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, ...labels };
|
|
6536
6602
|
const grouped = groupThreadActivity(steps, items);
|
|
6603
|
+
const strays = signals.filter((s) => !steps.some((step) => step.id === s.step));
|
|
6537
6604
|
const chevron = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-3 shrink-0 text-muted-foreground" });
|
|
6538
6605
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6539
6606
|
"div",
|
|
@@ -6543,12 +6610,16 @@ function WorkflowThreadStrip({
|
|
|
6543
6610
|
"aria-label": "Workflow steps",
|
|
6544
6611
|
"data-testid": "workflow-thread-strip",
|
|
6545
6612
|
children: /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: "flex w-max min-w-full items-center gap-1", children: [
|
|
6613
|
+
startedBy && /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6614
|
+
/* @__PURE__ */ jsxRuntime.jsx(WorkflowThreadStartedBy, { origin: startedBy, labels }),
|
|
6615
|
+
chevron
|
|
6616
|
+
] }),
|
|
6546
6617
|
grouped.before.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6547
6618
|
/* @__PURE__ */ jsxRuntime.jsx(Entry, { item }),
|
|
6548
6619
|
chevron
|
|
6549
6620
|
] }, item.id)),
|
|
6550
6621
|
steps.map((step, i) => {
|
|
6551
|
-
const phase =
|
|
6622
|
+
const phase = chunkVYRKO3XU_cjs.stepPhase(steps, states, step.id);
|
|
6552
6623
|
const happened = grouped.byStep[step.id] ?? [];
|
|
6553
6624
|
const chip = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6554
6625
|
"span",
|
|
@@ -6599,18 +6670,50 @@ function WorkflowThreadStrip({
|
|
|
6599
6670
|
}
|
|
6600
6671
|
)
|
|
6601
6672
|
] }),
|
|
6602
|
-
(
|
|
6673
|
+
signals.filter((s) => s.step === step.id).map((s) => /* @__PURE__ */ jsxRuntime.jsx(SignalPill, { signal: s, l }, `${s.step}-${s.signal}`)),
|
|
6674
|
+
(i < steps.length - 1 || grouped.after.length > 0 || strays.length > 0) && chevron
|
|
6603
6675
|
] }, step.id);
|
|
6604
6676
|
}),
|
|
6605
6677
|
grouped.after.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex shrink-0 items-center gap-1", children: [
|
|
6606
6678
|
/* @__PURE__ */ jsxRuntime.jsx(Entry, { item }),
|
|
6607
|
-
i < grouped.after.length - 1 && chevron
|
|
6608
|
-
] }, item.id))
|
|
6679
|
+
(i < grouped.after.length - 1 || strays.length > 0) && chevron
|
|
6680
|
+
] }, item.id)),
|
|
6681
|
+
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}`))
|
|
6609
6682
|
] })
|
|
6610
6683
|
}
|
|
6611
6684
|
);
|
|
6612
6685
|
}
|
|
6613
6686
|
|
|
6687
|
+
// src/agents/tasks/linkedRuns.ts
|
|
6688
|
+
var text = (v) => typeof v === "string" && v ? v : void 0;
|
|
6689
|
+
function linkedRunsFromActivity(events) {
|
|
6690
|
+
const raised = [];
|
|
6691
|
+
let startedBy;
|
|
6692
|
+
const entry = (step, signal) => {
|
|
6693
|
+
let found = raised.find((r) => r.step === step && r.signal === signal);
|
|
6694
|
+
if (!found) raised.push(found = { step, signal, runs: [] });
|
|
6695
|
+
return found;
|
|
6696
|
+
};
|
|
6697
|
+
for (const e of events ?? []) {
|
|
6698
|
+
const d = e.detail ?? {};
|
|
6699
|
+
const step = text(d.step);
|
|
6700
|
+
const signal = text(d.signal);
|
|
6701
|
+
if (e.kind === "step_signal" && step && signal) entry(step, signal);
|
|
6702
|
+
else if (e.kind === "linked_run" && step && signal) {
|
|
6703
|
+
const conversationId = text(d.conversation_ext_id);
|
|
6704
|
+
const runs = entry(step, signal).runs;
|
|
6705
|
+
if (conversationId && !runs.some((r) => r.conversationId === conversationId))
|
|
6706
|
+
runs.push({ conversationId, workflowId: text(d.workflow_ext_id) });
|
|
6707
|
+
} else if (e.kind === "created" && d.linked_from && typeof d.linked_from === "object") {
|
|
6708
|
+
const from = d.linked_from;
|
|
6709
|
+
const conversationId = text(from.conversation_ext_id);
|
|
6710
|
+
if (conversationId)
|
|
6711
|
+
startedBy = { conversationId, step: text(from.step), signal: text(from.signal) };
|
|
6712
|
+
}
|
|
6713
|
+
}
|
|
6714
|
+
return startedBy ? { raised, startedBy } : { raised };
|
|
6715
|
+
}
|
|
6716
|
+
|
|
6614
6717
|
// src/agents/tasks/compact-thread-activity.ts
|
|
6615
6718
|
var STEP_LABELS = {
|
|
6616
6719
|
step_started: "Step started",
|
|
@@ -7037,7 +7140,7 @@ function defaultTaskComposerValues(workflows, initial) {
|
|
|
7037
7140
|
return {
|
|
7038
7141
|
assignee: "me",
|
|
7039
7142
|
workflowId,
|
|
7040
|
-
inputs: workflow ? { ...
|
|
7143
|
+
inputs: workflow ? { ...chunkVYRKO3XU_cjs.defaultInputs(workflow), ...initial?.inputs } : { ...initial?.inputs },
|
|
7041
7144
|
when: "manual",
|
|
7042
7145
|
runAt: "",
|
|
7043
7146
|
rrule: "",
|
|
@@ -7146,7 +7249,7 @@ function WorkflowComposer({
|
|
|
7146
7249
|
return !docs?.length;
|
|
7147
7250
|
})
|
|
7148
7251
|
);
|
|
7149
|
-
const whatMissing = !workflow || Object.keys(
|
|
7252
|
+
const whatMissing = !workflow || Object.keys(chunkVYRKO3XU_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs)).length > 0;
|
|
7150
7253
|
const runAtPast = values.when === "once" && values.runAt !== "" && values.runAt !== initialValues?.runAt && new Date(values.runAt).getTime() <= Date.now();
|
|
7151
7254
|
const whenMissing = missingWhen(values, runAtPast);
|
|
7152
7255
|
const scheduled = values.when !== "now" && values.when !== "manual";
|
|
@@ -7158,7 +7261,7 @@ function WorkflowComposer({
|
|
|
7158
7261
|
setValues({
|
|
7159
7262
|
...values,
|
|
7160
7263
|
workflowId: next,
|
|
7161
|
-
inputs: def ?
|
|
7264
|
+
inputs: def ? chunkVYRKO3XU_cjs.defaultInputs(def) : {},
|
|
7162
7265
|
...def?.documentAction ? { access: "standing" } : {}
|
|
7163
7266
|
});
|
|
7164
7267
|
};
|
|
@@ -7296,7 +7399,7 @@ function WorkflowComposer({
|
|
|
7296
7399
|
}
|
|
7297
7400
|
),
|
|
7298
7401
|
!noFiles && workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7299
|
-
|
|
7402
|
+
chunkVYRKO3XU_cjs.SchemaForm,
|
|
7300
7403
|
{
|
|
7301
7404
|
fields,
|
|
7302
7405
|
values: values.inputs,
|
|
@@ -7735,7 +7838,7 @@ function WorkTaskComposer({
|
|
|
7735
7838
|
}, [open]);
|
|
7736
7839
|
const workflow = workflows.find((w) => w.id === values.workflowId);
|
|
7737
7840
|
const fields = workflow?.inputs ?? [];
|
|
7738
|
-
const errors = workflow ?
|
|
7841
|
+
const errors = workflow ? chunkVYRKO3XU_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs) : {};
|
|
7739
7842
|
const hasWork = configOpen && Boolean(workflow) && Object.keys(errors).length === 0;
|
|
7740
7843
|
const unattended = hasWork && values.when !== "now" && values.when !== "manual";
|
|
7741
7844
|
const canConfigure = !isEdit || seed.assignee === "agent";
|
|
@@ -7743,7 +7846,7 @@ function WorkTaskComposer({
|
|
|
7743
7846
|
const set = (key, value) => setValues({ ...values, [key]: value });
|
|
7744
7847
|
const pickWorkflow = (id2) => {
|
|
7745
7848
|
const next = workflows.find((w) => w.id === id2);
|
|
7746
|
-
setValues({ ...values, workflowId: id2, inputs: next ?
|
|
7849
|
+
setValues({ ...values, workflowId: id2, inputs: next ? chunkVYRKO3XU_cjs.defaultInputs(next) : {} });
|
|
7747
7850
|
};
|
|
7748
7851
|
const openConfigure = () => {
|
|
7749
7852
|
setConfigOpen(true);
|
|
@@ -7929,7 +8032,7 @@ function WorkTaskComposer({
|
|
|
7929
8032
|
)
|
|
7930
8033
|
] }),
|
|
7931
8034
|
workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7932
|
-
|
|
8035
|
+
chunkVYRKO3XU_cjs.SchemaForm,
|
|
7933
8036
|
{
|
|
7934
8037
|
fields,
|
|
7935
8038
|
values: values.inputs,
|
|
@@ -9021,7 +9124,7 @@ function AgentBarNotes({
|
|
|
9021
9124
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("mx-3 mb-2 space-y-1.5", className), children });
|
|
9022
9125
|
}
|
|
9023
9126
|
function AgentBarQueuedNote({
|
|
9024
|
-
text,
|
|
9127
|
+
text: text2,
|
|
9025
9128
|
isAcknowledged,
|
|
9026
9129
|
labels,
|
|
9027
9130
|
testId = "agent-queued-message"
|
|
@@ -9043,7 +9146,7 @@ function AgentBarQueuedNote({
|
|
|
9043
9146
|
children: l.queuedMessage
|
|
9044
9147
|
}
|
|
9045
9148
|
),
|
|
9046
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-2 whitespace-pre-line text-sm text-foreground", title:
|
|
9149
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-2 whitespace-pre-line text-sm text-foreground", title: text2, children: text2 })
|
|
9047
9150
|
] })
|
|
9048
9151
|
]
|
|
9049
9152
|
}
|
|
@@ -10043,6 +10146,7 @@ exports.WORKFLOW_COLUMN_ORDER = WORKFLOW_COLUMN_ORDER;
|
|
|
10043
10146
|
exports.WorkflowConfigDialog = WorkflowConfigDialog;
|
|
10044
10147
|
exports.WorkflowDocumentsField = WorkflowDocumentsField;
|
|
10045
10148
|
exports.WorkflowLauncher = WorkflowLauncher;
|
|
10149
|
+
exports.WorkflowThreadStartedBy = WorkflowThreadStartedBy;
|
|
10046
10150
|
exports.WorkflowThreadStrip = WorkflowThreadStrip;
|
|
10047
10151
|
exports.WorkflowsTable = WorkflowsTable;
|
|
10048
10152
|
exports.WorkflowsToolbar = WorkflowsToolbar;
|
|
@@ -10085,6 +10189,7 @@ exports.isPlainTodo = isPlainTodo;
|
|
|
10085
10189
|
exports.isSkillRow = isSkillRow;
|
|
10086
10190
|
exports.isValidAgentName = isValidAgentName;
|
|
10087
10191
|
exports.isoToLocalInput = isoToLocalInput;
|
|
10192
|
+
exports.linkedRunsFromActivity = linkedRunsFromActivity;
|
|
10088
10193
|
exports.localInputToIso = localInputToIso;
|
|
10089
10194
|
exports.matchWorkflowScope = matchWorkflowScope;
|
|
10090
10195
|
exports.moveTargets = moveTargets;
|
|
@@ -10110,5 +10215,5 @@ exports.workflowToComposerValues = workflowToComposerValues;
|
|
|
10110
10215
|
exports.workflowToSkillMarkdown = workflowToSkillMarkdown;
|
|
10111
10216
|
exports.workflowTriggerType = workflowTriggerType;
|
|
10112
10217
|
exports.workflowWhen = workflowWhen;
|
|
10113
|
-
//# sourceMappingURL=chunk-
|
|
10114
|
-
//# sourceMappingURL=chunk-
|
|
10218
|
+
//# sourceMappingURL=chunk-7FKARMA3.cjs.map
|
|
10219
|
+
//# sourceMappingURL=chunk-7FKARMA3.cjs.map
|