@arbidocs/blocks 0.4.122 → 0.4.124
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/{StreamedArtifactEditor-IZWYNFMM.cjs → StreamedArtifactEditor-DNBDUNP2.cjs} +5 -5
- package/dist/{StreamedArtifactEditor-IZWYNFMM.cjs.map → StreamedArtifactEditor-DNBDUNP2.cjs.map} +1 -1
- package/dist/{StreamedArtifactEditor-HTNPG4NB.js → StreamedArtifactEditor-WDHPTWX7.js} +3 -3
- package/dist/{StreamedArtifactEditor-HTNPG4NB.js.map → StreamedArtifactEditor-WDHPTWX7.js.map} +1 -1
- package/dist/agents/index.cjs +390 -326
- package/dist/agents/index.js +9 -9
- package/dist/agents/tasks/ConversationListView.d.ts +2 -1
- package/dist/agents/tasks/ConversationTurnSpeaker.d.ts +3 -1
- package/dist/agents/tasks/TaskFlow.d.ts +17 -0
- package/dist/agents/tasks/ThreadLauncher.d.ts +51 -0
- package/dist/agents/tasks/ThreadStatusLine.d.ts +33 -0
- package/dist/agents/tasks/WorkflowRunStatus.d.ts +32 -0
- package/dist/agents/tasks/WorkflowThreadStrip.d.ts +29 -3
- package/dist/agents/tasks/compact-thread-activity.d.ts +5 -2
- package/dist/agents/tasks/index.d.ts +3 -0
- package/dist/agents/workflows/StepBarFrame.d.ts +18 -17
- package/dist/agents/workflows/StepChip.d.ts +37 -0
- package/dist/agents/workflows/StepDocuments.d.ts +64 -0
- package/dist/agents/workflows/WorkflowStepBar.d.ts +1 -2
- package/dist/agents/workflows/index.d.ts +2 -0
- package/dist/agents/workflows/stepKinds.d.ts +24 -0
- package/dist/artifacts/VersionTimeline.d.ts +7 -0
- package/dist/artifacts/index.cjs +21 -21
- package/dist/artifacts/index.js +1 -1
- package/dist/chat/ChatPage.d.ts +1 -1
- package/dist/chat/DraftingDocChip.d.ts +22 -0
- package/dist/chat/WorkflowStepChip.d.ts +23 -5
- package/dist/chat/chat-page-types.d.ts +18 -2
- package/dist/chat/flashMessage.d.ts +6 -0
- package/dist/chat/index.cjs +144 -131
- package/dist/chat/index.d.ts +2 -0
- package/dist/chat/index.js +4 -3
- package/dist/{chunk-SHASZLGD.js → chunk-3AV7HP6G.js} +3 -3
- package/dist/{chunk-SHASZLGD.js.map → chunk-3AV7HP6G.js.map} +1 -1
- package/dist/{chunk-UDK553WP.cjs → chunk-4VCKYR4D.cjs} +4 -4
- package/dist/{chunk-UDK553WP.cjs.map → chunk-4VCKYR4D.cjs.map} +1 -1
- package/dist/chunk-7HAM7Y5U.js +907 -0
- package/dist/chunk-7HAM7Y5U.js.map +1 -0
- package/dist/{chunk-TCNYKDYE.js → chunk-CXLVI3SB.js} +73 -40
- package/dist/chunk-CXLVI3SB.js.map +1 -0
- package/dist/{chunk-N7ARMX3O.cjs → chunk-D7WCGOD4.cjs} +3 -3
- package/dist/{chunk-N7ARMX3O.cjs.map → chunk-D7WCGOD4.cjs.map} +1 -1
- package/dist/{chunk-ZP4IFW2E.js → chunk-EJSJ27HV.js} +733 -185
- package/dist/chunk-EJSJ27HV.js.map +1 -0
- package/dist/{chunk-AY32GGKU.js → chunk-ERNMU6RV.js} +132 -752
- package/dist/chunk-ERNMU6RV.js.map +1 -0
- package/dist/{chunk-XFZ7HNPG.js → chunk-ETN5EZI4.js} +3 -3
- package/dist/{chunk-XFZ7HNPG.js.map → chunk-ETN5EZI4.js.map} +1 -1
- package/dist/{chunk-Z2NSU7D5.cjs → chunk-FL5TEBTM.cjs} +770 -216
- package/dist/chunk-FL5TEBTM.cjs.map +1 -0
- package/dist/chunk-HM23LXUP.cjs +976 -0
- package/dist/chunk-HM23LXUP.cjs.map +1 -0
- package/dist/{chunk-WN64RF46.js → chunk-HQH35JWC.js} +3 -3
- package/dist/{chunk-WN64RF46.js.map → chunk-HQH35JWC.js.map} +1 -1
- package/dist/{chunk-XSUOEJB3.cjs → chunk-MRURIBBB.cjs} +163 -837
- package/dist/chunk-MRURIBBB.cjs.map +1 -0
- package/dist/{chunk-65HZ36MY.js → chunk-OTDGTBAS.js} +20 -3
- package/dist/chunk-OTDGTBAS.js.map +1 -0
- package/dist/{chunk-CK4C3IQR.cjs → chunk-VMZXFYHK.cjs} +47 -6
- package/dist/chunk-VMZXFYHK.cjs.map +1 -0
- package/dist/{chunk-SVJQWLOF.cjs → chunk-W4GXDARU.cjs} +20 -3
- package/dist/chunk-W4GXDARU.cjs.map +1 -0
- package/dist/{chunk-US5ASM4G.cjs → chunk-WEUCLOBB.cjs} +5 -5
- package/dist/{chunk-US5ASM4G.cjs.map → chunk-WEUCLOBB.cjs.map} +1 -1
- package/dist/{chunk-S2KVJYBD.cjs → chunk-WV4IDVDQ.cjs} +76 -43
- package/dist/chunk-WV4IDVDQ.cjs.map +1 -0
- package/dist/{chunk-2FUJXMGO.js → chunk-Y4X3RBFI.js} +44 -6
- package/dist/{chunk-CK4C3IQR.cjs.map → chunk-Y4X3RBFI.js.map} +1 -1
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +4 -4
- package/dist/connect/docx.js +3 -3
- package/dist/connect/index.cjs +68 -51
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +37 -20
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/WorkflowRunThread.d.ts +4 -4
- package/dist/connection/ai.d.ts +2 -0
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +3 -3
- package/dist/files/index.js +3 -3
- package/dist/index.cjs +728 -652
- package/dist/index.js +16 -16
- package/dist/settings/index.cjs +1 -1
- package/dist/settings/index.js +1 -1
- package/dist/shell/index.cjs +10 -10
- package/dist/shell/index.js +2 -2
- package/dist/site/index.cjs +5 -5
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +6 -5
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +5 -4
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/WorkflowCanvas.d.ts +0 -9
- package/dist/workflow-canvas/edit.d.ts +2 -11
- package/dist/workflow-canvas/index.cjs +63 -87
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +14 -38
- package/dist/workflow-canvas/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.cjs +25 -13
- package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.cts +3 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.ts +3 -1
- package/node_modules/@arbidocs/coedit/dist/commands.js +25 -14
- package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
- package/src/blocks.css +168 -0
- package/src/workflow-canvas/canvas.css +2 -40
- package/dist/chunk-2FUJXMGO.js.map +0 -1
- package/dist/chunk-65HZ36MY.js.map +0 -1
- package/dist/chunk-AY32GGKU.js.map +0 -1
- package/dist/chunk-B4SRYJLM.cjs +0 -107
- package/dist/chunk-B4SRYJLM.cjs.map +0 -1
- package/dist/chunk-HOXKR26S.js +0 -103
- package/dist/chunk-HOXKR26S.js.map +0 -1
- package/dist/chunk-S2KVJYBD.cjs.map +0 -1
- package/dist/chunk-SVJQWLOF.cjs.map +0 -1
- package/dist/chunk-TCNYKDYE.js.map +0 -1
- package/dist/chunk-XSUOEJB3.cjs.map +0 -1
- package/dist/chunk-Z2NSU7D5.cjs.map +0 -1
- package/dist/chunk-ZP4IFW2E.js.map +0 -1
|
@@ -82,13 +82,4 @@ export interface WorkflowCanvasProps {
|
|
|
82
82
|
}
|
|
83
83
|
/** The id of the trigger node (selecting it selects the workflow's start). */
|
|
84
84
|
export declare const TRIGGER_NODE = "__trigger";
|
|
85
|
-
export declare const STEP_KIND_ICONS: {
|
|
86
|
-
readonly form: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
87
|
-
readonly upload: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
88
|
-
readonly agent: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
89
|
-
readonly review: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
90
|
-
readonly sign: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
91
|
-
readonly email_draft: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
92
|
-
readonly tabular_review: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
93
|
-
};
|
|
94
85
|
export declare function WorkflowCanvas({ workflow, onChange, selected, onSelect, focus, onAddAfter, phases, workflowTitle, assigneeOf, trigger, renderIcon, labels, className, reserveRight, testId, }: WorkflowCanvasProps): import("react").JSX.Element;
|
|
@@ -3,20 +3,12 @@
|
|
|
3
3
|
* their own. Every result keeps the steps in dependency order with every edge written out
|
|
4
4
|
* (`after`), so a reordering never changes what a step waits for.
|
|
5
5
|
*/
|
|
6
|
-
import { type WorkflowDefinition, type WorkflowStep } from '../agents';
|
|
6
|
+
import { type WorkflowDefinition, type WorkflowStep, type WorkflowStepKind } from '../agents';
|
|
7
7
|
type Steps = Extract<WorkflowDefinition['run'], {
|
|
8
8
|
kind: 'steps';
|
|
9
9
|
}>;
|
|
10
10
|
export type WorkflowLayout = NonNullable<Steps['layout']>;
|
|
11
|
-
|
|
12
|
-
* What the builder's add menus offer: each kind of step, with each platform action (an
|
|
13
|
-
* `action` step) as a kind of its own.
|
|
14
|
-
*/
|
|
15
|
-
export type WorkflowStepKind = 'form' | 'upload' | 'agent' | 'review' | 'sign' | 'email_draft' | 'tabular_review';
|
|
16
|
-
/** Every kind, in the order the add menus list them. */
|
|
17
|
-
export declare const WORKFLOW_STEP_KINDS: readonly WorkflowStepKind[];
|
|
18
|
-
/** A step's kind as the builder shows it: an action step is its action's type. */
|
|
19
|
-
export declare const stepKindOf: (step: WorkflowStep) => WorkflowStepKind;
|
|
11
|
+
export { WORKFLOW_STEP_KINDS, stepKindOf, type WorkflowStepKind } from '../agents';
|
|
20
12
|
/** A new, empty stepped workflow. */
|
|
21
13
|
export declare function newSteppedWorkflow(id: string, title: string): WorkflowDefinition;
|
|
22
14
|
/** A step id from a title: lowercase words joined by hyphens, unique within the workflow. */
|
|
@@ -59,4 +51,3 @@ export declare function moveStep(workflow: WorkflowDefinition, id: string, posit
|
|
|
59
51
|
export declare function autoLayout(steps: WorkflowStep[]): WorkflowLayout;
|
|
60
52
|
/** The workflow's layout, with any unplaced step placed by depth. */
|
|
61
53
|
export declare function layoutWithDefaults(workflow: WorkflowDefinition): WorkflowLayout;
|
|
62
|
-
export {};
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-ZV3BKLFY.cjs');
|
|
5
|
+
var chunkFL5TEBTM_cjs = require('../chunk-FL5TEBTM.cjs');
|
|
7
6
|
require('../chunk-S5HZBXZA.cjs');
|
|
8
7
|
require('../chunk-ZW6FPIFC.cjs');
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-7D737FLE.cjs');
|
|
8
|
+
var chunkMRURIBBB_cjs = require('../chunk-MRURIBBB.cjs');
|
|
11
9
|
require('../chunk-N26CXGXC.cjs');
|
|
12
10
|
require('../chunk-3AFWGEDJ.cjs');
|
|
13
11
|
require('../chunk-DVUZTGVL.cjs');
|
|
14
|
-
require('../chunk-OB5F4577.cjs');
|
|
15
12
|
require('../chunk-DETZZBG2.cjs');
|
|
16
|
-
var chunk32HW2Q33_cjs = require('../chunk-32HW2Q33.cjs');
|
|
17
13
|
require('../chunk-V4ISCZJ7.cjs');
|
|
18
14
|
require('../chunk-2EI7NCUA.cjs');
|
|
19
15
|
require('../chunk-C2CWWEHO.cjs');
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
22
|
-
require('../chunk-
|
|
16
|
+
require('../chunk-ZV3BKLFY.cjs');
|
|
17
|
+
require('../chunk-7D737FLE.cjs');
|
|
18
|
+
require('../chunk-OB5F4577.cjs');
|
|
23
19
|
require('../chunk-7RGLTF76.cjs');
|
|
24
20
|
require('../chunk-ULWRNGGE.cjs');
|
|
21
|
+
var chunkHM23LXUP_cjs = require('../chunk-HM23LXUP.cjs');
|
|
22
|
+
require('../chunk-7UTB4PHM.cjs');
|
|
23
|
+
var chunk32HW2Q33_cjs = require('../chunk-32HW2Q33.cjs');
|
|
24
|
+
require('../chunk-FX3K6LNZ.cjs');
|
|
25
25
|
require('../chunk-PPCATBOY.cjs');
|
|
26
26
|
require('../chunk-MHVNT4J3.cjs');
|
|
27
27
|
require('../chunk-C54XEN5T.cjs');
|
|
@@ -35,16 +35,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
35
35
|
var react$1 = require('@xyflow/react');
|
|
36
36
|
|
|
37
37
|
// src/workflow-canvas/edit.ts
|
|
38
|
-
var WORKFLOW_STEP_KINDS = [
|
|
39
|
-
"form",
|
|
40
|
-
"upload",
|
|
41
|
-
"agent",
|
|
42
|
-
"review",
|
|
43
|
-
"sign",
|
|
44
|
-
"email_draft",
|
|
45
|
-
"tabular_review"
|
|
46
|
-
];
|
|
47
|
-
var stepKindOf = (step) => step.kind === "action" ? step.action.type : step.kind;
|
|
48
38
|
function newSteppedWorkflow(id, title) {
|
|
49
39
|
return {
|
|
50
40
|
id,
|
|
@@ -60,11 +50,11 @@ function withSteps(workflow, steps, layout) {
|
|
|
60
50
|
const run = workflow.run.kind === "steps" ? workflow.run : { kind: "steps", steps: [] };
|
|
61
51
|
return {
|
|
62
52
|
...workflow,
|
|
63
|
-
run: { ...run, steps:
|
|
53
|
+
run: { ...run, steps: chunkHM23LXUP_cjs.orderSteps(steps), layout: layout ?? run.layout }
|
|
64
54
|
};
|
|
65
55
|
}
|
|
66
56
|
var layoutOf = (workflow) => workflow.run.kind === "steps" && workflow.run.layout || {};
|
|
67
|
-
var explicit = (steps) => steps.map((s) => ({ ...s, after:
|
|
57
|
+
var explicit = (steps) => steps.map((s) => ({ ...s, after: chunkHM23LXUP_cjs.stepDependencies(steps, s.id) }));
|
|
68
58
|
function stepIdFor(steps, title) {
|
|
69
59
|
const base = title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "") || "step";
|
|
70
60
|
const taken = new Set(steps.map((s) => s.id));
|
|
@@ -111,7 +101,7 @@ function blankStep(kind, id, title) {
|
|
|
111
101
|
}
|
|
112
102
|
}
|
|
113
103
|
function addStep(workflow, kind, options = {}) {
|
|
114
|
-
const steps = explicit(
|
|
104
|
+
const steps = explicit(chunkHM23LXUP_cjs.workflowSteps(workflow));
|
|
115
105
|
const title = options.title ?? DEFAULT_TITLES[kind];
|
|
116
106
|
const id = stepIdFor(steps, title);
|
|
117
107
|
const step = { ...blankStep(kind, id, title), after: options.after ? [options.after] : [] };
|
|
@@ -120,7 +110,7 @@ function addStep(workflow, kind, options = {}) {
|
|
|
120
110
|
return { workflow: withSteps(workflow, [...steps, step], layout), id };
|
|
121
111
|
}
|
|
122
112
|
function removeStep(workflow, id) {
|
|
123
|
-
const steps = explicit(
|
|
113
|
+
const steps = explicit(chunkHM23LXUP_cjs.workflowSteps(workflow));
|
|
124
114
|
const removed = steps.find((s) => s.id === id);
|
|
125
115
|
if (!removed) return workflow;
|
|
126
116
|
const bridged = steps.filter((s) => s.id !== id).map(
|
|
@@ -133,8 +123,8 @@ function removeStep(workflow, id) {
|
|
|
133
123
|
return withSteps(workflow, bridged, layout);
|
|
134
124
|
}
|
|
135
125
|
function connectSteps(workflow, from, to) {
|
|
136
|
-
const steps = explicit(
|
|
137
|
-
if (from === to || !steps.some((s) => s.id === from) ||
|
|
126
|
+
const steps = explicit(chunkHM23LXUP_cjs.workflowSteps(workflow));
|
|
127
|
+
if (from === to || !steps.some((s) => s.id === from) || chunkHM23LXUP_cjs.dependsOn(steps, from, to)) {
|
|
138
128
|
return workflow;
|
|
139
129
|
}
|
|
140
130
|
return withSteps(
|
|
@@ -144,16 +134,16 @@ function connectSteps(workflow, from, to) {
|
|
|
144
134
|
)
|
|
145
135
|
);
|
|
146
136
|
}
|
|
147
|
-
var wouldCycle = (workflow, from, to) => from === to ||
|
|
137
|
+
var wouldCycle = (workflow, from, to) => from === to || chunkHM23LXUP_cjs.dependsOn(chunkHM23LXUP_cjs.workflowSteps(workflow), from, to);
|
|
148
138
|
function disconnectSteps(workflow, from, to) {
|
|
149
|
-
const steps = explicit(
|
|
139
|
+
const steps = explicit(chunkHM23LXUP_cjs.workflowSteps(workflow));
|
|
150
140
|
return withSteps(
|
|
151
141
|
workflow,
|
|
152
142
|
steps.map((s) => s.id === to ? { ...s, after: (s.after ?? []).filter((d) => d !== from) } : s)
|
|
153
143
|
);
|
|
154
144
|
}
|
|
155
145
|
function updateStep(workflow, id, patch) {
|
|
156
|
-
const steps = explicit(
|
|
146
|
+
const steps = explicit(chunkHM23LXUP_cjs.workflowSteps(workflow));
|
|
157
147
|
return withSteps(
|
|
158
148
|
workflow,
|
|
159
149
|
steps.map(
|
|
@@ -167,7 +157,7 @@ var renameIn = (text, from, to) => text.replace(
|
|
|
167
157
|
);
|
|
168
158
|
function renameInput(workflow, from, to) {
|
|
169
159
|
if (from === to) return workflow;
|
|
170
|
-
const steps =
|
|
160
|
+
const steps = chunkHM23LXUP_cjs.workflowSteps(workflow).map((s) => {
|
|
171
161
|
if (s.kind === "agent")
|
|
172
162
|
return {
|
|
173
163
|
...s,
|
|
@@ -216,13 +206,13 @@ function renameInput(workflow, from, to) {
|
|
|
216
206
|
var renamePerson = (a, from, to) => "input" in a && a.input === from ? { input: to } : a;
|
|
217
207
|
var renameRef = (r, from, to) => "input" in r && r.input === from ? { input: to } : r;
|
|
218
208
|
function moveStep(workflow, id, position) {
|
|
219
|
-
return withSteps(workflow,
|
|
209
|
+
return withSteps(workflow, chunkHM23LXUP_cjs.workflowSteps(workflow), { ...layoutOf(workflow), [id]: position });
|
|
220
210
|
}
|
|
221
211
|
var COLUMN = 300;
|
|
222
212
|
var ROW = 140;
|
|
223
213
|
function autoLayout(steps) {
|
|
224
214
|
const layout = {};
|
|
225
|
-
|
|
215
|
+
chunkHM23LXUP_cjs.stepLevels(steps).forEach(
|
|
226
216
|
(level, x) => level.forEach((s, y) => {
|
|
227
217
|
layout[s.id] = { x: x * COLUMN, y: (y - (level.length - 1) / 2) * ROW };
|
|
228
218
|
})
|
|
@@ -230,7 +220,7 @@ function autoLayout(steps) {
|
|
|
230
220
|
return layout;
|
|
231
221
|
}
|
|
232
222
|
function layoutWithDefaults(workflow) {
|
|
233
|
-
const auto = autoLayout(
|
|
223
|
+
const auto = autoLayout(chunkHM23LXUP_cjs.workflowSteps(workflow));
|
|
234
224
|
return { ...auto, ...layoutOf(workflow) };
|
|
235
225
|
}
|
|
236
226
|
var DEFAULT_SIGNALS_EDITOR_LABELS = {
|
|
@@ -327,9 +317,9 @@ function SignalsEditor({
|
|
|
327
317
|
{
|
|
328
318
|
className: ui.cn(
|
|
329
319
|
"space-y-1.5 rounded-md border p-2",
|
|
330
|
-
|
|
320
|
+
chunkMRURIBBB_cjs.isIncompleteSignal(signal) ? "border-destructive/50" : "border-border"
|
|
331
321
|
),
|
|
332
|
-
"data-incomplete":
|
|
322
|
+
"data-incomplete": chunkMRURIBBB_cjs.isIncompleteSignal(signal) || void 0,
|
|
333
323
|
"data-testid": `${testId}-${i}`,
|
|
334
324
|
children: [
|
|
335
325
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1158,7 +1148,7 @@ function StepInspector({
|
|
|
1158
1148
|
}) {
|
|
1159
1149
|
const l = { ...DEFAULT_STEP_INSPECTOR_LABELS, ...labels };
|
|
1160
1150
|
const ol = { ...DEFAULT_FIELD_OPTIONS_EDITOR_LABELS, ...optionLabels };
|
|
1161
|
-
const steps =
|
|
1151
|
+
const steps = chunkHM23LXUP_cjs.workflowSteps(workflow);
|
|
1162
1152
|
const step = steps.find((s) => s.id === stepId);
|
|
1163
1153
|
const run = workflow.run.kind === "steps" ? workflow.run : void 0;
|
|
1164
1154
|
if (!step || !run) {
|
|
@@ -1185,8 +1175,8 @@ function StepInspector({
|
|
|
1185
1175
|
const patch = (p) => onChange(updateStep(workflow, step.id, p));
|
|
1186
1176
|
const al = { ...DEFAULT_STEP_ACTION_SETTINGS_LABELS, ...actionLabels };
|
|
1187
1177
|
const ctx = {
|
|
1188
|
-
earlier:
|
|
1189
|
-
fields:
|
|
1178
|
+
earlier: chunkHM23LXUP_cjs.upstreamSteps(steps, step.id),
|
|
1179
|
+
fields: chunkHM23LXUP_cjs.runFields(workflow),
|
|
1190
1180
|
people,
|
|
1191
1181
|
tags,
|
|
1192
1182
|
documents
|
|
@@ -1207,7 +1197,7 @@ function StepInspector({
|
|
|
1207
1197
|
)
|
|
1208
1198
|
);
|
|
1209
1199
|
};
|
|
1210
|
-
const deps =
|
|
1200
|
+
const deps = chunkHM23LXUP_cjs.stepDependencies(steps, step.id);
|
|
1211
1201
|
const titleOf = (id) => steps.find((s) => s.id === id)?.title ?? id;
|
|
1212
1202
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": `${testId}-step`, children: [
|
|
1213
1203
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
@@ -1288,7 +1278,7 @@ function StepInspector({
|
|
|
1288
1278
|
{
|
|
1289
1279
|
step,
|
|
1290
1280
|
workflows,
|
|
1291
|
-
fields:
|
|
1281
|
+
fields: chunkHM23LXUP_cjs.runFields(workflow).map((f) => f.name),
|
|
1292
1282
|
patch,
|
|
1293
1283
|
l,
|
|
1294
1284
|
testId
|
|
@@ -1349,7 +1339,7 @@ function StepInspector({
|
|
|
1349
1339
|
testId: `${testId}-review-grid`
|
|
1350
1340
|
}
|
|
1351
1341
|
),
|
|
1352
|
-
|
|
1342
|
+
chunkHM23LXUP_cjs.canAssign(step) && /* @__PURE__ */ jsxRuntime.jsx(AssigneeSettings, { step, patch, ctx, l: al, testId }),
|
|
1353
1343
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1354
1344
|
SignalsEditor,
|
|
1355
1345
|
{
|
|
@@ -1615,7 +1605,7 @@ function triggerFields(trigger, clearOthers) {
|
|
|
1615
1605
|
return {
|
|
1616
1606
|
timezone: trigger.timezone,
|
|
1617
1607
|
rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
|
|
1618
|
-
run_at: trigger.start === "once" ?
|
|
1608
|
+
run_at: trigger.start === "once" ? chunkFL5TEBTM_cjs.localInputToIso(trigger.runAt) : none,
|
|
1619
1609
|
event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
|
|
1620
1610
|
// A step signal is `workflow_signal` narrowed to one signal name.
|
|
1621
1611
|
event_filter: filter ?? none,
|
|
@@ -1631,7 +1621,7 @@ function plan(value, options) {
|
|
|
1631
1621
|
criteria: [],
|
|
1632
1622
|
max_passes: 3,
|
|
1633
1623
|
documents: [],
|
|
1634
|
-
steps:
|
|
1624
|
+
steps: chunkMRURIBBB_cjs.toPlanSteps(value.workflow, options)
|
|
1635
1625
|
};
|
|
1636
1626
|
}
|
|
1637
1627
|
function builderToWorkflowRequest(value, workspaceId, options = {}) {
|
|
@@ -1666,7 +1656,7 @@ function builderToWorkflowUpdate(value, options = {}) {
|
|
|
1666
1656
|
}
|
|
1667
1657
|
function workflowRecordToBuilder(record) {
|
|
1668
1658
|
const planned = record.plan?.steps ?? [];
|
|
1669
|
-
const steps = planned.length ?
|
|
1659
|
+
const steps = planned.length ? chunkMRURIBBB_cjs.fromPlanSteps(planned) : record.prompt || record.skill_ref ? [
|
|
1670
1660
|
{
|
|
1671
1661
|
id: "work",
|
|
1672
1662
|
kind: "agent",
|
|
@@ -1674,7 +1664,7 @@ function workflowRecordToBuilder(record) {
|
|
|
1674
1664
|
...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
|
|
1675
1665
|
}
|
|
1676
1666
|
] : [];
|
|
1677
|
-
const when =
|
|
1667
|
+
const when = chunkFL5TEBTM_cjs.workflowWhen(record);
|
|
1678
1668
|
return {
|
|
1679
1669
|
workflow: {
|
|
1680
1670
|
id: record.external_id,
|
|
@@ -1683,12 +1673,12 @@ function workflowRecordToBuilder(record) {
|
|
|
1683
1673
|
inputs: [],
|
|
1684
1674
|
landing: "chat",
|
|
1685
1675
|
schedulable: false,
|
|
1686
|
-
run: { kind: "steps", steps, layout:
|
|
1676
|
+
run: { kind: "steps", steps, layout: chunkMRURIBBB_cjs.layoutFromPlanSteps(planned ?? []) }
|
|
1687
1677
|
},
|
|
1688
1678
|
trigger: {
|
|
1689
1679
|
...DEFAULT_WORKFLOW_TRIGGER,
|
|
1690
1680
|
start: when === "now" ? "manual" : when,
|
|
1691
|
-
runAt:
|
|
1681
|
+
runAt: chunkFL5TEBTM_cjs.isoToLocalInput(record.run_at),
|
|
1692
1682
|
rrule: record.rrule ?? "",
|
|
1693
1683
|
timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
|
|
1694
1684
|
eventKind: record.event_kind ?? "",
|
|
@@ -1744,7 +1734,7 @@ function triggerSummary(trigger, options = {}) {
|
|
|
1744
1734
|
case "once":
|
|
1745
1735
|
return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
|
|
1746
1736
|
case "repeat":
|
|
1747
|
-
return trigger.rrule ?
|
|
1737
|
+
return trigger.rrule ? chunkFL5TEBTM_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
|
|
1748
1738
|
case "event":
|
|
1749
1739
|
if (isSignalTrigger(trigger))
|
|
1750
1740
|
return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
|
|
@@ -1803,7 +1793,7 @@ function TriggerInspector({
|
|
|
1803
1793
|
}
|
|
1804
1794
|
)
|
|
1805
1795
|
] }),
|
|
1806
|
-
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1796
|
+
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkFL5TEBTM_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
|
|
1807
1797
|
trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1808
1798
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
|
|
1809
1799
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1855,7 +1845,7 @@ function TriggerInspector({
|
|
|
1855
1845
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1856
1846
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
|
|
1857
1847
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1858
|
-
|
|
1848
|
+
chunkFL5TEBTM_cjs.AgentSelect,
|
|
1859
1849
|
{
|
|
1860
1850
|
agents,
|
|
1861
1851
|
value: trigger.agentId,
|
|
@@ -1923,13 +1913,7 @@ function revealCenter(node, view, frame, reserveRight = 0) {
|
|
|
1923
1913
|
};
|
|
1924
1914
|
}
|
|
1925
1915
|
var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
1926
|
-
|
|
1927
|
-
upload: "Upload",
|
|
1928
|
-
agent: "AI step",
|
|
1929
|
-
review: "Approval",
|
|
1930
|
-
sign: "Sign",
|
|
1931
|
-
email_draft: "Email draft",
|
|
1932
|
-
tabular_review: "Tabular review",
|
|
1916
|
+
...chunkHM23LXUP_cjs.DEFAULT_STEP_KIND_LABELS,
|
|
1933
1917
|
redline: "Tracked changes",
|
|
1934
1918
|
branch: "Branch",
|
|
1935
1919
|
kindHints: {
|
|
@@ -1960,16 +1944,7 @@ var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
|
1960
1944
|
fitView: "Fit view"
|
|
1961
1945
|
};
|
|
1962
1946
|
var TRIGGER_NODE = "__trigger";
|
|
1963
|
-
var
|
|
1964
|
-
form: lucideReact.FileInput,
|
|
1965
|
-
upload: lucideReact.Upload,
|
|
1966
|
-
agent: lucideReact.Bot,
|
|
1967
|
-
review: lucideReact.ClipboardCheck,
|
|
1968
|
-
sign: lucideReact.PenLine,
|
|
1969
|
-
email_draft: lucideReact.Mail,
|
|
1970
|
-
tabular_review: lucideReact.Table2
|
|
1971
|
-
};
|
|
1972
|
-
var KINDS = WORKFLOW_STEP_KINDS;
|
|
1947
|
+
var KINDS = chunkHM23LXUP_cjs.WORKFLOW_STEP_KINDS;
|
|
1973
1948
|
function AddNext({
|
|
1974
1949
|
from,
|
|
1975
1950
|
onAdd,
|
|
@@ -1991,7 +1966,7 @@ function AddNext({
|
|
|
1991
1966
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.PopoverContent, { side: "right", align: "start", className: "w-60 p-1.5", children: [
|
|
1992
1967
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 pb-1 pt-0.5 text-xs font-medium text-muted-foreground", children: l.addNext }),
|
|
1993
1968
|
KINDS.map((kind) => {
|
|
1994
|
-
const Icon = STEP_KIND_ICONS[kind];
|
|
1969
|
+
const Icon = chunkHM23LXUP_cjs.STEP_KIND_ICONS[kind];
|
|
1995
1970
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1996
1971
|
"button",
|
|
1997
1972
|
{
|
|
@@ -2030,8 +2005,8 @@ function PhaseMark({ phase }) {
|
|
|
2030
2005
|
}
|
|
2031
2006
|
function StepNode({ data }) {
|
|
2032
2007
|
const { step, phase, summary, assignee, icon, l, onAdd, testId } = data;
|
|
2033
|
-
const kind = stepKindOf(step);
|
|
2034
|
-
const KindIcon = STEP_KIND_ICONS[kind];
|
|
2008
|
+
const kind = chunkHM23LXUP_cjs.stepKindOf(step);
|
|
2009
|
+
const KindIcon = chunkHM23LXUP_cjs.STEP_KIND_ICONS[kind];
|
|
2035
2010
|
const redline = step.kind === "agent" && !!step.editDocument;
|
|
2036
2011
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2037
2012
|
"div",
|
|
@@ -2165,12 +2140,12 @@ function WorkflowCanvas({
|
|
|
2165
2140
|
testId = "workflow-canvas"
|
|
2166
2141
|
}) {
|
|
2167
2142
|
const l = react.useMemo(() => ({ ...DEFAULT_WORKFLOW_CANVAS_LABELS, ...labels }), [labels]);
|
|
2168
|
-
const steps =
|
|
2143
|
+
const steps = chunkHM23LXUP_cjs.workflowSteps(workflow);
|
|
2169
2144
|
const editable = !!onChange;
|
|
2170
2145
|
const built = react.useMemo(() => {
|
|
2171
2146
|
const layout = layoutWithDefaults(workflow);
|
|
2172
|
-
const all =
|
|
2173
|
-
const roots = all.filter((s) =>
|
|
2147
|
+
const all = chunkHM23LXUP_cjs.workflowSteps(workflow);
|
|
2148
|
+
const roots = all.filter((s) => chunkHM23LXUP_cjs.stepDependencies(all, s.id).length === 0);
|
|
2174
2149
|
const triggerNode = trigger ? [
|
|
2175
2150
|
{
|
|
2176
2151
|
id: TRIGGER_NODE,
|
|
@@ -2219,7 +2194,7 @@ function WorkflowCanvas({
|
|
|
2219
2194
|
react.useEffect(() => setNodes(built), [built]);
|
|
2220
2195
|
const edges = react.useMemo(
|
|
2221
2196
|
() => steps.flatMap((s) => {
|
|
2222
|
-
const deps =
|
|
2197
|
+
const deps = chunkHM23LXUP_cjs.stepDependencies(steps, s.id);
|
|
2223
2198
|
const from = deps.length ? deps : trigger ? [TRIGGER_NODE] : [];
|
|
2224
2199
|
return from.map((d) => ({
|
|
2225
2200
|
id: `${d}->${s.id}`,
|
|
@@ -2261,11 +2236,12 @@ function WorkflowCanvas({
|
|
|
2261
2236
|
const selectedRef = react.useRef(selected);
|
|
2262
2237
|
selectedRef.current = selected;
|
|
2263
2238
|
const fit = react.useCallback(
|
|
2264
|
-
async (flow, anchorOnSelection) => {
|
|
2239
|
+
async (flow, anchorOnSelection, whole = false) => {
|
|
2265
2240
|
await flow.fitView({
|
|
2266
2241
|
padding: { top: "48px", bottom: "48px", left: "48px", right: `${reserveRight + 48}px` },
|
|
2267
2242
|
maxZoom: 1
|
|
2268
2243
|
});
|
|
2244
|
+
if (whole) return;
|
|
2269
2245
|
const box = frame.current;
|
|
2270
2246
|
const picked = anchorOnSelection ? selectedRef.current : null;
|
|
2271
2247
|
const view = readableViewport(
|
|
@@ -2357,7 +2333,7 @@ function WorkflowCanvas({
|
|
|
2357
2333
|
react$1.ControlButton,
|
|
2358
2334
|
{
|
|
2359
2335
|
className: "react-flow__controls-fitview",
|
|
2360
|
-
onClick: () => flowRef.current && void fit(flowRef.current, true),
|
|
2336
|
+
onClick: () => flowRef.current && void fit(flowRef.current, false, true),
|
|
2361
2337
|
title: l.fitView,
|
|
2362
2338
|
"aria-label": l.fitView,
|
|
2363
2339
|
"data-testid": `${testId}-fit`,
|
|
@@ -2388,7 +2364,7 @@ function WorkflowCanvas({
|
|
|
2388
2364
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold", children: l.emptyTitle }),
|
|
2389
2365
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: l.emptyHint }),
|
|
2390
2366
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 grid grid-cols-2 gap-2", children: KINDS.map((kind) => {
|
|
2391
|
-
const Icon = STEP_KIND_ICONS[kind];
|
|
2367
|
+
const Icon = chunkHM23LXUP_cjs.STEP_KIND_ICONS[kind];
|
|
2392
2368
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2393
2369
|
"button",
|
|
2394
2370
|
{
|
|
@@ -2438,7 +2414,7 @@ var DEFAULT_WORKFLOW_BUILDER_LABELS = {
|
|
|
2438
2414
|
}
|
|
2439
2415
|
};
|
|
2440
2416
|
var PANEL_WIDTH = 344;
|
|
2441
|
-
var KINDS2 = WORKFLOW_STEP_KINDS;
|
|
2417
|
+
var KINDS2 = chunkHM23LXUP_cjs.WORKFLOW_STEP_KINDS;
|
|
2442
2418
|
function WorkflowBuilder({
|
|
2443
2419
|
value,
|
|
2444
2420
|
onChange,
|
|
@@ -2470,12 +2446,12 @@ function WorkflowBuilder({
|
|
|
2470
2446
|
const [mode, setMode] = react.useState("design");
|
|
2471
2447
|
const [adding, setAdding] = react.useState(false);
|
|
2472
2448
|
const { workflow, trigger } = value;
|
|
2473
|
-
const steps =
|
|
2474
|
-
const problems =
|
|
2475
|
-
const missing =
|
|
2449
|
+
const steps = chunkHM23LXUP_cjs.workflowSteps(workflow);
|
|
2450
|
+
const problems = chunkHM23LXUP_cjs.validateWorkflowGraph(steps);
|
|
2451
|
+
const missing = chunkHM23LXUP_cjs.stepConfigProblems(steps);
|
|
2476
2452
|
const nameOf = (id) => people.find((p) => p.value === id)?.label;
|
|
2477
|
-
const fields =
|
|
2478
|
-
const assigneeOf = (step) =>
|
|
2453
|
+
const fields = chunkHM23LXUP_cjs.runFields(workflow);
|
|
2454
|
+
const assigneeOf = (step) => chunkHM23LXUP_cjs.canAssign(step) ? chunkHM23LXUP_cjs.assigneeName(step.assignee, { nameOf, fields }) : void 0;
|
|
2479
2455
|
const titles = react.useMemo(() => new Map(workflows.map((w) => [w.id, w.title])), [workflows]);
|
|
2480
2456
|
const setWorkflow = (next) => onChange({ ...value, workflow: next });
|
|
2481
2457
|
const addAfter = (from, kind) => {
|
|
@@ -2544,7 +2520,7 @@ function WorkflowBuilder({
|
|
|
2544
2520
|
l.addStep
|
|
2545
2521
|
] }) }),
|
|
2546
2522
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverContent, { align: "start", className: "w-64 p-1.5", children: KINDS2.map((kind) => {
|
|
2547
|
-
const Icon = STEP_KIND_ICONS[kind];
|
|
2523
|
+
const Icon = chunkHM23LXUP_cjs.STEP_KIND_ICONS[kind];
|
|
2548
2524
|
const cls = { ...DEFAULT_WORKFLOW_CANVAS_LABELS, ...canvasLabels };
|
|
2549
2525
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2550
2526
|
"button",
|
|
@@ -2706,13 +2682,13 @@ function WorkflowPreview({
|
|
|
2706
2682
|
renderIcon,
|
|
2707
2683
|
testId
|
|
2708
2684
|
}) {
|
|
2709
|
-
const run =
|
|
2685
|
+
const run = chunkFL5TEBTM_cjs.useWorkflowPreview(workflow, {
|
|
2710
2686
|
resolveWorkflow: (id) => workflows.find((w) => w.id === id),
|
|
2711
2687
|
compose,
|
|
2712
2688
|
answer
|
|
2713
2689
|
});
|
|
2714
2690
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2715
|
-
|
|
2691
|
+
chunkMRURIBBB_cjs.WorkflowRunner,
|
|
2716
2692
|
{
|
|
2717
2693
|
workflow,
|
|
2718
2694
|
run,
|
|
@@ -2799,7 +2775,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2799
2775
|
() => [
|
|
2800
2776
|
...hostWorkflows,
|
|
2801
2777
|
...(skills.data ?? []).map(
|
|
2802
|
-
(s) =>
|
|
2778
|
+
(s) => chunkHM23LXUP_cjs.skillToWorkflow({
|
|
2803
2779
|
name: s.name,
|
|
2804
2780
|
slug: s.slug,
|
|
2805
2781
|
description: s.description,
|
|
@@ -2815,7 +2791,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2815
2791
|
}));
|
|
2816
2792
|
const tasks = (conversations.data ?? []).filter((c) => c.status && c.status !== "done").map((c) => ({ value: c.external_id, label: c.title || c.external_id }));
|
|
2817
2793
|
const options = { resolveWorkflow: (wid) => workflows.find((w) => w.id === wid), compose };
|
|
2818
|
-
const problem = triggerProblem(value.trigger) ?? (
|
|
2794
|
+
const problem = triggerProblem(value.trigger) ?? (chunkHM23LXUP_cjs.validateWorkflowGraph(chunkHM23LXUP_cjs.workflowSteps(value.workflow)).length || chunkHM23LXUP_cjs.stepConfigProblems(chunkHM23LXUP_cjs.workflowSteps(value.workflow)).length ? "graph" : null);
|
|
2819
2795
|
const busy = !!pending || create.isPending || update.isPending || run.isPending;
|
|
2820
2796
|
const save = async () => {
|
|
2821
2797
|
if (!workspaceId) return void 0;
|