@arbidocs/blocks 0.4.79 → 0.4.81
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 +278 -278
- package/dist/agents/index.js +3 -3
- package/dist/agents/workflows/StepBarFrame.d.ts +8 -2
- package/dist/agents/workflows/WorkflowRunner.d.ts +35 -3
- package/dist/agents/workflows/run.d.ts +10 -0
- package/dist/agents/workflows/stepWindow.d.ts +7 -0
- package/dist/agents/workflows/types.d.ts +4 -2
- package/dist/{chunk-5XVWGJ2H.cjs → chunk-B3WCKBJ7.cjs} +3 -3
- package/dist/{chunk-5XVWGJ2H.cjs.map → chunk-B3WCKBJ7.cjs.map} +1 -1
- package/dist/{chunk-YGUKTFKW.cjs → chunk-BX7JWZWE.cjs} +122 -14
- package/dist/chunk-BX7JWZWE.cjs.map +1 -0
- package/dist/{chunk-3YET6D5E.cjs → chunk-F5WIETZY.cjs} +58 -43
- package/dist/chunk-F5WIETZY.cjs.map +1 -0
- package/dist/{chunk-O35LRB3P.js → chunk-GJV2G4FC.js} +3 -3
- package/dist/{chunk-O35LRB3P.js.map → chunk-GJV2G4FC.js.map} +1 -1
- package/dist/{chunk-BMOL5DN6.js → chunk-I56ORHPY.js} +27 -12
- package/dist/chunk-I56ORHPY.js.map +1 -0
- package/dist/{chunk-CWAZNXC5.js → chunk-SWSVPQNB.js} +30 -8
- package/dist/chunk-SWSVPQNB.js.map +1 -0
- package/dist/{chunk-6GXF62XN.js → chunk-THCFZKTM.js} +118 -15
- package/dist/chunk-THCFZKTM.js.map +1 -0
- package/dist/{chunk-MLAHDAN5.cjs → chunk-UA2AMDR6.cjs} +30 -8
- package/dist/chunk-UA2AMDR6.cjs.map +1 -0
- package/dist/connect/index.cjs +145 -62
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -1
- package/dist/connect/index.js +106 -23
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedWorkflowRunner.d.ts +30 -4
- package/dist/files/index.cjs +2 -2
- package/dist/files/index.js +2 -2
- package/dist/index.cjs +467 -467
- package/dist/index.js +7 -7
- package/dist/settings/index.cjs +35 -35
- package/dist/settings/index.js +3 -3
- package/dist/workflow-canvas/index.cjs +46 -46
- package/dist/workflow-canvas/index.js +3 -3
- package/dist/workspaces/index.cjs +1 -1
- package/dist/workspaces/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-3YET6D5E.cjs.map +0 -1
- package/dist/chunk-6GXF62XN.js.map +0 -1
- package/dist/chunk-BMOL5DN6.js.map +0 -1
- package/dist/chunk-CWAZNXC5.js.map +0 -1
- package/dist/chunk-MLAHDAN5.cjs.map +0 -1
- package/dist/chunk-YGUKTFKW.cjs.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 chunkBX7JWZWE_cjs = require('./chunk-BX7JWZWE.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');
|
|
@@ -14,11 +14,11 @@ 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
16
|
var chunkC54XEN5T_cjs = require('./chunk-C54XEN5T.cjs');
|
|
17
|
-
var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
|
|
18
17
|
var chunkB4SRYJLM_cjs = require('./chunk-B4SRYJLM.cjs');
|
|
19
18
|
var chunk7UTB4PHM_cjs = require('./chunk-7UTB4PHM.cjs');
|
|
20
19
|
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
21
20
|
var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
|
|
21
|
+
var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
|
|
22
22
|
var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
|
|
23
23
|
var react = require('react');
|
|
24
24
|
var ui = require('@arbidocs/react/ui');
|
|
@@ -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({ ...chunkBX7JWZWE_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 = chunkBX7JWZWE_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(chunkBX7JWZWE_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
|
+
chunkBX7JWZWE_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 = chunkBX7JWZWE_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 = chunkBX7JWZWE_cjs.defaultInputs(workflow);
|
|
372
|
+
if (Object.keys(chunkBX7JWZWE_cjs.validateInputs(workflow, inputs)).length === 0) {
|
|
373
|
+
Promise.resolve(onLaunch(chunkBX7JWZWE_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(chunkBX7JWZWE_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 chunkBX7JWZWE_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 = chunkBX7JWZWE_cjs.workflowSteps(workflow);
|
|
549
|
+
const [inputs, setInputs] = react.useState(() => chunkBX7JWZWE_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") && chunkBX7JWZWE_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" ? chunkBX7JWZWE_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 chunkBX7JWZWE_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 = chunkBX7JWZWE_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: chunkBX7JWZWE_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`.
|
|
@@ -6269,10 +6269,18 @@ function TaskActivityTimeline({
|
|
|
6269
6269
|
return { headline: "Step done" };
|
|
6270
6270
|
case "step_skipped":
|
|
6271
6271
|
return { headline: "Step skipped" };
|
|
6272
|
-
case "step_waiting":
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6272
|
+
case "step_waiting": {
|
|
6273
|
+
const documents = chunkBX7JWZWE_cjs.eventWaitingDocuments(detail);
|
|
6274
|
+
return {
|
|
6275
|
+
headline: documents ? chunkBX7JWZWE_cjs.waitingForDocumentsText(documents.length) : "Waiting on people"
|
|
6276
|
+
};
|
|
6277
|
+
}
|
|
6278
|
+
case "step_progress": {
|
|
6279
|
+
const documents = chunkBX7JWZWE_cjs.eventWaitingDocuments(detail);
|
|
6280
|
+
return {
|
|
6281
|
+
headline: documents ? chunkBX7JWZWE_cjs.waitingForDocumentsText(documents.length) : detail.signed ? "Signed" : "Step moved on"
|
|
6282
|
+
};
|
|
6283
|
+
}
|
|
6276
6284
|
case "step_sent_back":
|
|
6277
6285
|
return { headline: "Sent the work back" };
|
|
6278
6286
|
case "step_ready":
|
|
@@ -6509,7 +6517,7 @@ function groupThreadActivity(steps, items) {
|
|
|
6509
6517
|
continue;
|
|
6510
6518
|
}
|
|
6511
6519
|
if (current === void 0) out.before.push(item);
|
|
6512
|
-
else if (
|
|
6520
|
+
else if (chunkBX7JWZWE_cjs.isRunFinished(steps, states)) out.after.push(item);
|
|
6513
6521
|
else {
|
|
6514
6522
|
const status = states[current]?.status;
|
|
6515
6523
|
const at = status === "done" || status === "skipped" ? steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? ""))?.id ?? current : current;
|
|
@@ -6627,11 +6635,13 @@ function WorkflowThreadStrip({
|
|
|
6627
6635
|
const chevron = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-3 shrink-0 text-muted-foreground" });
|
|
6628
6636
|
const [selected, setSelected] = react.useState(null);
|
|
6629
6637
|
const [open, setOpen] = react.useState(null);
|
|
6630
|
-
const phaseOf = (id) =>
|
|
6638
|
+
const phaseOf = (id) => chunkBX7JWZWE_cjs.stepPhase(steps, states, id);
|
|
6631
6639
|
const iconOf = (step) => step.icon && renderIcon ? renderIcon(step.icon) : void 0;
|
|
6632
6640
|
const waitingOf = (id) => {
|
|
6633
6641
|
const step = steps.find((s) => s.id === id);
|
|
6634
6642
|
const phase = phaseOf(id);
|
|
6643
|
+
const documents = chunkBX7JWZWE_cjs.waitingDocuments(states[id]);
|
|
6644
|
+
if (documents.length) return chunkBX7JWZWE_cjs.waitingForDocumentsText(documents.length);
|
|
6635
6645
|
const name = step && (phase === "ready" || phase === "waiting") ? assigneeOf?.(step) : void 0;
|
|
6636
6646
|
return name ? l.waitingFor.replace("{name}", name) : void 0;
|
|
6637
6647
|
};
|
|
@@ -6639,21 +6649,21 @@ function WorkflowThreadStrip({
|
|
|
6639
6649
|
const phase = phaseOf(step.id);
|
|
6640
6650
|
const happened = grouped.byStep[step.id] ?? [];
|
|
6641
6651
|
const assignee = phase === "ready" || phase === "waiting" ? assigneeOf?.(step) : void 0;
|
|
6642
|
-
const waiting =
|
|
6652
|
+
const waiting = waitingOf(step.id);
|
|
6643
6653
|
const sentBack = states[step.id]?.sentBack;
|
|
6644
6654
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: open === step.id, onOpenChange: (o) => setOpen(o ? step.id : null), children: [
|
|
6645
6655
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6646
6656
|
"button",
|
|
6647
6657
|
{
|
|
6648
6658
|
type: "button",
|
|
6649
|
-
className: ui.cn(
|
|
6659
|
+
className: ui.cn(chunkBX7JWZWE_cjs.STEP_PILL, "py-0.5", chunkBX7JWZWE_cjs.stepPillTone(phase, isCurrent)),
|
|
6650
6660
|
"aria-current": isCurrent ? "step" : void 0,
|
|
6651
6661
|
title: waiting ? `${step.title} \xB7 ${waiting}` : step.title,
|
|
6652
6662
|
"data-phase": phase,
|
|
6653
6663
|
"data-testid": `workflow-thread-step-${step.id}`,
|
|
6654
6664
|
children: [
|
|
6655
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6656
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: ui.cn(
|
|
6665
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkBX7JWZWE_cjs.PhaseMark, { phase, icon: iconOf(step) }),
|
|
6666
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: ui.cn(chunkBX7JWZWE_cjs.STEP_LABEL, isCurrent ? chunkBX7JWZWE_cjs.STEP_LABEL_MAX_CURRENT : chunkBX7JWZWE_cjs.STEP_LABEL_MAX), children: step.title }),
|
|
6657
6667
|
sentBack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6658
6668
|
lucideReact.CornerUpLeft,
|
|
6659
6669
|
{
|
|
@@ -6665,7 +6675,7 @@ function WorkflowThreadStrip({
|
|
|
6665
6675
|
assignee && isCurrent && !narrow && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6666
6676
|
"span",
|
|
6667
6677
|
{
|
|
6668
|
-
className: ui.cn(
|
|
6678
|
+
className: ui.cn(chunkBX7JWZWE_cjs.STEP_EXTRA, "flex max-w-[12rem] items-center gap-0.5"),
|
|
6669
6679
|
title: waiting,
|
|
6670
6680
|
"data-testid": `workflow-thread-step-${step.id}-assignee`,
|
|
6671
6681
|
children: [
|
|
@@ -6686,7 +6696,7 @@ function WorkflowThreadStrip({
|
|
|
6686
6696
|
"data-testid": `workflow-thread-step-${step.id}-menu`,
|
|
6687
6697
|
children: [
|
|
6688
6698
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs font-semibold", children: step.title }),
|
|
6689
|
-
|
|
6699
|
+
waiting && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs", "data-testid": `workflow-thread-step-${step.id}-waiting-for`, children: waiting }),
|
|
6690
6700
|
sentBack && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs text-amber-700 dark:text-amber-300", children: l.sentBack }),
|
|
6691
6701
|
/* @__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
6702
|
happened.map((item) => /* @__PURE__ */ jsxRuntime.jsx(Entry, { item }, item.id)),
|
|
@@ -6724,9 +6734,9 @@ function WorkflowThreadStrip({
|
|
|
6724
6734
|
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
6735
|
] }) : null;
|
|
6726
6736
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("min-w-0 flex-1", className), "data-testid": "workflow-thread-strip", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6727
|
-
|
|
6737
|
+
chunkBX7JWZWE_cjs.StepBarFrame,
|
|
6728
6738
|
{
|
|
6729
|
-
levels:
|
|
6739
|
+
levels: chunkBX7JWZWE_cjs.stepLevels(steps),
|
|
6730
6740
|
phaseOf,
|
|
6731
6741
|
current: selected,
|
|
6732
6742
|
onSelect: (id) => {
|
|
@@ -6811,7 +6821,12 @@ function compactThreadActivity(events) {
|
|
|
6811
6821
|
const count = Math.max(1, entry.recipients.length);
|
|
6812
6822
|
entry.label = `Notified ${count} ${count === 1 ? "user" : "users"}`;
|
|
6813
6823
|
} else if (STEP_LABELS[event.kind]) {
|
|
6814
|
-
|
|
6824
|
+
const documents = chunkBX7JWZWE_cjs.eventWaitingDocuments(event.detail);
|
|
6825
|
+
result.push({
|
|
6826
|
+
event,
|
|
6827
|
+
label: documents ? chunkBX7JWZWE_cjs.waitingForDocumentsText(documents.length) : STEP_LABELS[event.kind],
|
|
6828
|
+
recipients: []
|
|
6829
|
+
});
|
|
6815
6830
|
} else if (["artifact_created", "artifact_edited", "document_added", "document_removed"].includes(
|
|
6816
6831
|
event.kind
|
|
6817
6832
|
)) {
|
|
@@ -7208,7 +7223,7 @@ function defaultTaskComposerValues(workflows, initial) {
|
|
|
7208
7223
|
return {
|
|
7209
7224
|
assignee: "me",
|
|
7210
7225
|
workflowId,
|
|
7211
|
-
inputs: workflow ? { ...
|
|
7226
|
+
inputs: workflow ? { ...chunkBX7JWZWE_cjs.defaultInputs(workflow), ...initial?.inputs } : { ...initial?.inputs },
|
|
7212
7227
|
when: "manual",
|
|
7213
7228
|
runAt: "",
|
|
7214
7229
|
rrule: "",
|
|
@@ -7317,7 +7332,7 @@ function WorkflowComposer({
|
|
|
7317
7332
|
return !docs?.length;
|
|
7318
7333
|
})
|
|
7319
7334
|
);
|
|
7320
|
-
const whatMissing = !workflow || Object.keys(
|
|
7335
|
+
const whatMissing = !workflow || Object.keys(chunkBX7JWZWE_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs)).length > 0;
|
|
7321
7336
|
const runAtPast = values.when === "once" && values.runAt !== "" && values.runAt !== initialValues?.runAt && new Date(values.runAt).getTime() <= Date.now();
|
|
7322
7337
|
const whenMissing = missingWhen(values, runAtPast);
|
|
7323
7338
|
const scheduled = values.when !== "now" && values.when !== "manual";
|
|
@@ -7329,7 +7344,7 @@ function WorkflowComposer({
|
|
|
7329
7344
|
setValues({
|
|
7330
7345
|
...values,
|
|
7331
7346
|
workflowId: next,
|
|
7332
|
-
inputs: def ?
|
|
7347
|
+
inputs: def ? chunkBX7JWZWE_cjs.defaultInputs(def) : {},
|
|
7333
7348
|
...def?.documentAction ? { access: "standing" } : {}
|
|
7334
7349
|
});
|
|
7335
7350
|
};
|
|
@@ -7467,7 +7482,7 @@ function WorkflowComposer({
|
|
|
7467
7482
|
}
|
|
7468
7483
|
),
|
|
7469
7484
|
!noFiles && workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7470
|
-
|
|
7485
|
+
chunkBX7JWZWE_cjs.SchemaForm,
|
|
7471
7486
|
{
|
|
7472
7487
|
fields,
|
|
7473
7488
|
values: values.inputs,
|
|
@@ -7906,7 +7921,7 @@ function WorkTaskComposer({
|
|
|
7906
7921
|
}, [open]);
|
|
7907
7922
|
const workflow = workflows.find((w) => w.id === values.workflowId);
|
|
7908
7923
|
const fields = workflow?.inputs ?? [];
|
|
7909
|
-
const errors = workflow ?
|
|
7924
|
+
const errors = workflow ? chunkBX7JWZWE_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs) : {};
|
|
7910
7925
|
const hasWork = configOpen && Boolean(workflow) && Object.keys(errors).length === 0;
|
|
7911
7926
|
const unattended = hasWork && values.when !== "now" && values.when !== "manual";
|
|
7912
7927
|
const canConfigure = !isEdit || seed.assignee === "agent";
|
|
@@ -7914,7 +7929,7 @@ function WorkTaskComposer({
|
|
|
7914
7929
|
const set = (key, value) => setValues({ ...values, [key]: value });
|
|
7915
7930
|
const pickWorkflow = (id2) => {
|
|
7916
7931
|
const next = workflows.find((w) => w.id === id2);
|
|
7917
|
-
setValues({ ...values, workflowId: id2, inputs: next ?
|
|
7932
|
+
setValues({ ...values, workflowId: id2, inputs: next ? chunkBX7JWZWE_cjs.defaultInputs(next) : {} });
|
|
7918
7933
|
};
|
|
7919
7934
|
const openConfigure = () => {
|
|
7920
7935
|
setConfigOpen(true);
|
|
@@ -8100,7 +8115,7 @@ function WorkTaskComposer({
|
|
|
8100
8115
|
)
|
|
8101
8116
|
] }),
|
|
8102
8117
|
workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8103
|
-
|
|
8118
|
+
chunkBX7JWZWE_cjs.SchemaForm,
|
|
8104
8119
|
{
|
|
8105
8120
|
fields,
|
|
8106
8121
|
values: values.inputs,
|
|
@@ -10283,5 +10298,5 @@ exports.workflowToComposerValues = workflowToComposerValues;
|
|
|
10283
10298
|
exports.workflowToSkillMarkdown = workflowToSkillMarkdown;
|
|
10284
10299
|
exports.workflowTriggerType = workflowTriggerType;
|
|
10285
10300
|
exports.workflowWhen = workflowWhen;
|
|
10286
|
-
//# sourceMappingURL=chunk-
|
|
10287
|
-
//# sourceMappingURL=chunk-
|
|
10301
|
+
//# sourceMappingURL=chunk-F5WIETZY.cjs.map
|
|
10302
|
+
//# sourceMappingURL=chunk-F5WIETZY.cjs.map
|