@arbidocs/blocks 0.4.142 → 0.4.144
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 +435 -432
- package/dist/agents/index.js +7 -4
- package/dist/chat/index.cjs +139 -138
- package/dist/chat/index.js +4 -3
- package/dist/{chunk-N5X37J3D.js → chunk-2FJMTZNJ.js} +8 -5
- package/dist/chunk-2FJMTZNJ.js.map +1 -0
- package/dist/chunk-33ZOUJXA.js +561 -0
- package/dist/chunk-33ZOUJXA.js.map +1 -0
- package/dist/{chunk-S24XEVPS.cjs → chunk-464YPRAE.cjs} +33 -2
- package/dist/chunk-464YPRAE.cjs.map +1 -0
- package/dist/{chunk-7YLJHTDC.cjs → chunk-5A2QQAF5.cjs} +11 -11
- package/dist/{chunk-7YLJHTDC.cjs.map → chunk-5A2QQAF5.cjs.map} +1 -1
- package/dist/chunk-76L6LOP3.cjs +308 -0
- package/dist/chunk-76L6LOP3.cjs.map +1 -0
- package/dist/{chunk-FXG7TFAG.js → chunk-7NGAWGA3.js} +3 -3
- package/dist/{chunk-FXG7TFAG.js.map → chunk-7NGAWGA3.js.map} +1 -1
- package/dist/chunk-A6J2IBUG.js +1602 -0
- package/dist/chunk-A6J2IBUG.js.map +1 -0
- package/dist/{chunk-DPGFEMVT.cjs → chunk-ABUO6PIQ.cjs} +51 -1659
- package/dist/chunk-ABUO6PIQ.cjs.map +1 -0
- package/dist/chunk-AOSUHWIL.js +98 -0
- package/dist/chunk-AOSUHWIL.js.map +1 -0
- package/dist/{chunk-GBS6QVGS.cjs → chunk-BUWBXJ2N.cjs} +5 -5
- package/dist/{chunk-GBS6QVGS.cjs.map → chunk-BUWBXJ2N.cjs.map} +1 -1
- package/dist/chunk-CQCC7LE7.js +210 -0
- package/dist/chunk-CQCC7LE7.js.map +1 -0
- package/dist/{chunk-UGCKUXRV.js → chunk-CSI2B2H5.js} +3 -3
- package/dist/{chunk-UGCKUXRV.js.map → chunk-CSI2B2H5.js.map} +1 -1
- package/dist/{chunk-JO3EMZ4X.js → chunk-GWSGIZQ5.js} +3 -3
- package/dist/{chunk-JO3EMZ4X.js.map → chunk-GWSGIZQ5.js.map} +1 -1
- package/dist/{chunk-OWCEQKAR.cjs → chunk-JSTKEZBS.cjs} +21 -318
- package/dist/chunk-JSTKEZBS.cjs.map +1 -0
- package/dist/{chunk-CKCBBYTA.js → chunk-KSHKTOY2.js} +5 -205
- package/dist/chunk-KSHKTOY2.js.map +1 -0
- package/dist/chunk-LJJJ6CYH.cjs +62 -0
- package/dist/chunk-LJJJ6CYH.cjs.map +1 -0
- package/dist/chunk-MHFF5N65.cjs +101 -0
- package/dist/chunk-MHFF5N65.cjs.map +1 -0
- package/dist/{chunk-GYAUJ4KT.js → chunk-MTSKK3BN.js} +32 -3
- package/dist/chunk-MTSKK3BN.js.map +1 -0
- package/dist/chunk-O2ODDTMA.cjs +1627 -0
- package/dist/chunk-O2ODDTMA.cjs.map +1 -0
- package/dist/{chunk-3BFGL2JL.cjs → chunk-ODRHHWHY.cjs} +4 -4
- package/dist/{chunk-3BFGL2JL.cjs.map → chunk-ODRHHWHY.cjs.map} +1 -1
- package/dist/{chunk-Y5KTM3V5.js → chunk-PDKM27DF.js} +17 -295
- package/dist/chunk-PDKM27DF.js.map +1 -0
- package/dist/{chunk-OAL3B2ZU.cjs → chunk-PLJ7PHWU.cjs} +5 -5
- package/dist/{chunk-OAL3B2ZU.cjs.map → chunk-PLJ7PHWU.cjs.map} +1 -1
- package/dist/chunk-RA3ZJ45L.cjs +574 -0
- package/dist/chunk-RA3ZJ45L.cjs.map +1 -0
- package/dist/chunk-RFIBUWLF.cjs +232 -0
- package/dist/chunk-RFIBUWLF.cjs.map +1 -0
- package/dist/{chunk-MIDXCYZB.cjs → chunk-RQ2Y7USX.cjs} +15 -235
- package/dist/chunk-RQ2Y7USX.cjs.map +1 -0
- package/dist/chunk-SV65E4QW.js +58 -0
- package/dist/chunk-SV65E4QW.js.map +1 -0
- package/dist/chunk-TZGBRLPK.js +288 -0
- package/dist/chunk-TZGBRLPK.js.map +1 -0
- package/dist/{chunk-PROK33G6.js → chunk-X3TGXEFS.js} +11 -1596
- package/dist/chunk-X3TGXEFS.js.map +1 -0
- package/dist/{chunk-HIJUXAWS.cjs → chunk-XGZX22ET.cjs} +77 -74
- package/dist/chunk-XGZX22ET.cjs.map +1 -0
- package/dist/{chunk-5BXEYYH6.js → chunk-ZM26YEOT.js} +3 -3
- package/dist/{chunk-5BXEYYH6.js.map → chunk-ZM26YEOT.js.map} +1 -1
- package/dist/connect/docx.cjs +35 -6
- package/dist/connect/docx.cjs.map +1 -1
- package/dist/connect/docx.d.ts +9 -2
- package/dist/connect/docx.js +29 -5
- package/dist/connect/docx.js.map +1 -1
- package/dist/connect/index.cjs +126 -339
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +15 -260
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/docx/ConnectedNativeDocxComparison.d.ts +5 -0
- package/dist/connection/docx/ConnectedNativeDocxEditor.d.ts +16 -0
- package/dist/connection/{ConnectedStreamedWordArtifact.d.ts → docx/ConnectedStreamedWordArtifact.d.ts} +1 -1
- package/dist/connection/docx/support.d.ts +27 -0
- package/dist/connection/docx/useConnectedDocxReferences.d.ts +2 -0
- package/dist/connection/docx/useConnectedHouseTemplate.d.ts +2 -0
- package/dist/docx/index.cjs +17 -63
- package/dist/docx/index.cjs.map +1 -1
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/index.js +2 -64
- package/dist/docx/index.js.map +1 -1
- package/dist/docx/template/candidates.d.ts +16 -0
- package/dist/index.cjs +625 -609
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/deep-link.d.ts +46 -0
- package/dist/settings/index.cjs +10 -9
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/studio/index.cjs +5 -4
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +4 -3
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +58 -55
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +7 -4
- package/dist/workflow-canvas/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
- package/dist/chunk-4TR5QCCX.cjs +0 -43
- package/dist/chunk-4TR5QCCX.cjs.map +0 -1
- package/dist/chunk-7NDW4KF4.cjs +0 -112
- package/dist/chunk-7NDW4KF4.cjs.map +0 -1
- package/dist/chunk-CKCBBYTA.js.map +0 -1
- package/dist/chunk-DPGFEMVT.cjs.map +0 -1
- package/dist/chunk-ETXYVO6E.js +0 -109
- package/dist/chunk-ETXYVO6E.js.map +0 -1
- package/dist/chunk-GYAUJ4KT.js.map +0 -1
- package/dist/chunk-HIJUXAWS.cjs.map +0 -1
- package/dist/chunk-MCKOZACC.js +0 -41
- package/dist/chunk-MCKOZACC.js.map +0 -1
- package/dist/chunk-MIDXCYZB.cjs.map +0 -1
- package/dist/chunk-N5X37J3D.js.map +0 -1
- package/dist/chunk-OWCEQKAR.cjs.map +0 -1
- package/dist/chunk-PROK33G6.js.map +0 -1
- package/dist/chunk-S24XEVPS.cjs.map +0 -1
- package/dist/chunk-Y5KTM3V5.js.map +0 -1
- package/dist/connection/ConnectedNativeDocxEditor.d.ts +0 -6
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkJZNXRMLH_cjs = require('../chunk-JZNXRMLH.cjs');
|
|
5
5
|
var chunkGFNELPDP_cjs = require('../chunk-GFNELPDP.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var chunkXGZX22ET_cjs = require('../chunk-XGZX22ET.cjs');
|
|
7
|
+
var chunkABUO6PIQ_cjs = require('../chunk-ABUO6PIQ.cjs');
|
|
8
|
+
require('../chunk-RFIBUWLF.cjs');
|
|
9
|
+
var chunkO2ODDTMA_cjs = require('../chunk-O2ODDTMA.cjs');
|
|
8
10
|
require('../chunk-WS5EX7DN.cjs');
|
|
11
|
+
require('../chunk-RQ2Y7USX.cjs');
|
|
9
12
|
require('../chunk-AHDJXIUB.cjs');
|
|
10
|
-
require('../chunk-MIDXCYZB.cjs');
|
|
11
13
|
require('../chunk-ZW6FPIFC.cjs');
|
|
12
14
|
require('../chunk-3AFWGEDJ.cjs');
|
|
13
15
|
require('../chunk-DVUZTGVL.cjs');
|
|
@@ -17,7 +19,8 @@ require('../chunk-V4ISCZJ7.cjs');
|
|
|
17
19
|
require('../chunk-2EI7NCUA.cjs');
|
|
18
20
|
require('../chunk-C2CWWEHO.cjs');
|
|
19
21
|
require('../chunk-7RGLTF76.cjs');
|
|
20
|
-
var
|
|
22
|
+
var chunkJSTKEZBS_cjs = require('../chunk-JSTKEZBS.cjs');
|
|
23
|
+
var chunk76L6LOP3_cjs = require('../chunk-76L6LOP3.cjs');
|
|
21
24
|
require('../chunk-7UTB4PHM.cjs');
|
|
22
25
|
var chunk32HW2Q33_cjs = require('../chunk-32HW2Q33.cjs');
|
|
23
26
|
require('../chunk-FX3K6LNZ.cjs');
|
|
@@ -50,11 +53,11 @@ function withSteps(workflow, steps, layout) {
|
|
|
50
53
|
const run = workflow.run.kind === "steps" ? workflow.run : { kind: "steps", steps: [] };
|
|
51
54
|
return {
|
|
52
55
|
...workflow,
|
|
53
|
-
run: { ...run, steps:
|
|
56
|
+
run: { ...run, steps: chunkJSTKEZBS_cjs.orderSteps(steps), layout: layout ?? run.layout }
|
|
54
57
|
};
|
|
55
58
|
}
|
|
56
59
|
var layoutOf = (workflow) => workflow.run.kind === "steps" && workflow.run.layout || {};
|
|
57
|
-
var explicit = (steps) => steps.map((s) => ({ ...s, after:
|
|
60
|
+
var explicit = (steps) => steps.map((s) => ({ ...s, after: chunkJSTKEZBS_cjs.stepDependencies(steps, s.id) }));
|
|
58
61
|
function stepIdFor(steps, title) {
|
|
59
62
|
const base = title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "") || "step";
|
|
60
63
|
const taken = new Set(steps.map((s) => s.id));
|
|
@@ -101,7 +104,7 @@ function blankStep(kind, id, title) {
|
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
function addStep(workflow, kind, options = {}) {
|
|
104
|
-
const steps = explicit(
|
|
107
|
+
const steps = explicit(chunkJSTKEZBS_cjs.workflowSteps(workflow));
|
|
105
108
|
const title = options.title ?? DEFAULT_TITLES[kind];
|
|
106
109
|
const id = stepIdFor(steps, title);
|
|
107
110
|
const step = { ...blankStep(kind, id, title), after: options.after ? [options.after] : [] };
|
|
@@ -110,7 +113,7 @@ function addStep(workflow, kind, options = {}) {
|
|
|
110
113
|
return { workflow: withSteps(workflow, [...steps, step], layout), id };
|
|
111
114
|
}
|
|
112
115
|
function removeStep(workflow, id) {
|
|
113
|
-
const steps = explicit(
|
|
116
|
+
const steps = explicit(chunkJSTKEZBS_cjs.workflowSteps(workflow));
|
|
114
117
|
const removed = steps.find((s) => s.id === id);
|
|
115
118
|
if (!removed) return workflow;
|
|
116
119
|
const bridged = steps.filter((s) => s.id !== id).map(
|
|
@@ -123,8 +126,8 @@ function removeStep(workflow, id) {
|
|
|
123
126
|
return withSteps(workflow, bridged, layout);
|
|
124
127
|
}
|
|
125
128
|
function connectSteps(workflow, from, to) {
|
|
126
|
-
const steps = explicit(
|
|
127
|
-
if (from === to || !steps.some((s) => s.id === from) ||
|
|
129
|
+
const steps = explicit(chunkJSTKEZBS_cjs.workflowSteps(workflow));
|
|
130
|
+
if (from === to || !steps.some((s) => s.id === from) || chunkJSTKEZBS_cjs.dependsOn(steps, from, to)) {
|
|
128
131
|
return workflow;
|
|
129
132
|
}
|
|
130
133
|
return withSteps(
|
|
@@ -134,16 +137,16 @@ function connectSteps(workflow, from, to) {
|
|
|
134
137
|
)
|
|
135
138
|
);
|
|
136
139
|
}
|
|
137
|
-
var wouldCycle = (workflow, from, to) => from === to ||
|
|
140
|
+
var wouldCycle = (workflow, from, to) => from === to || chunkJSTKEZBS_cjs.dependsOn(chunkJSTKEZBS_cjs.workflowSteps(workflow), from, to);
|
|
138
141
|
function disconnectSteps(workflow, from, to) {
|
|
139
|
-
const steps = explicit(
|
|
142
|
+
const steps = explicit(chunkJSTKEZBS_cjs.workflowSteps(workflow));
|
|
140
143
|
return withSteps(
|
|
141
144
|
workflow,
|
|
142
145
|
steps.map((s) => s.id === to ? { ...s, after: (s.after ?? []).filter((d) => d !== from) } : s)
|
|
143
146
|
);
|
|
144
147
|
}
|
|
145
148
|
function updateStep(workflow, id, patch) {
|
|
146
|
-
const steps = explicit(
|
|
149
|
+
const steps = explicit(chunkJSTKEZBS_cjs.workflowSteps(workflow));
|
|
147
150
|
return withSteps(
|
|
148
151
|
workflow,
|
|
149
152
|
steps.map(
|
|
@@ -157,7 +160,7 @@ var renameIn = (text, from, to) => text.replace(
|
|
|
157
160
|
);
|
|
158
161
|
function renameInput(workflow, from, to) {
|
|
159
162
|
if (from === to) return workflow;
|
|
160
|
-
const steps =
|
|
163
|
+
const steps = chunkJSTKEZBS_cjs.workflowSteps(workflow).map((s) => {
|
|
161
164
|
if (s.kind === "agent")
|
|
162
165
|
return {
|
|
163
166
|
...s,
|
|
@@ -206,13 +209,13 @@ function renameInput(workflow, from, to) {
|
|
|
206
209
|
var renamePerson = (a, from, to) => "input" in a && a.input === from ? { input: to } : a;
|
|
207
210
|
var renameRef = (r, from, to) => "input" in r && r.input === from ? { input: to } : r;
|
|
208
211
|
function moveStep(workflow, id, position) {
|
|
209
|
-
return withSteps(workflow,
|
|
212
|
+
return withSteps(workflow, chunkJSTKEZBS_cjs.workflowSteps(workflow), { ...layoutOf(workflow), [id]: position });
|
|
210
213
|
}
|
|
211
214
|
var COLUMN = 300;
|
|
212
215
|
var ROW = 140;
|
|
213
216
|
function autoLayout(steps) {
|
|
214
217
|
const layout = {};
|
|
215
|
-
|
|
218
|
+
chunkJSTKEZBS_cjs.stepLevels(steps).forEach(
|
|
216
219
|
(level, x) => level.forEach((s, y) => {
|
|
217
220
|
layout[s.id] = { x: x * COLUMN, y: (y - (level.length - 1) / 2) * ROW };
|
|
218
221
|
})
|
|
@@ -220,7 +223,7 @@ function autoLayout(steps) {
|
|
|
220
223
|
return layout;
|
|
221
224
|
}
|
|
222
225
|
function layoutWithDefaults(workflow) {
|
|
223
|
-
const auto = autoLayout(
|
|
226
|
+
const auto = autoLayout(chunkJSTKEZBS_cjs.workflowSteps(workflow));
|
|
224
227
|
return { ...auto, ...layoutOf(workflow) };
|
|
225
228
|
}
|
|
226
229
|
var DEFAULT_SIGNALS_EDITOR_LABELS = {
|
|
@@ -317,9 +320,9 @@ function SignalsEditor({
|
|
|
317
320
|
{
|
|
318
321
|
className: ui.cn(
|
|
319
322
|
"space-y-1.5 rounded-md border p-2",
|
|
320
|
-
|
|
323
|
+
chunkABUO6PIQ_cjs.isIncompleteSignal(signal) ? "border-destructive/50" : "border-border"
|
|
321
324
|
),
|
|
322
|
-
"data-incomplete":
|
|
325
|
+
"data-incomplete": chunkABUO6PIQ_cjs.isIncompleteSignal(signal) || void 0,
|
|
323
326
|
"data-testid": `${testId}-${i}`,
|
|
324
327
|
children: [
|
|
325
328
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1148,7 +1151,7 @@ function StepInspector({
|
|
|
1148
1151
|
}) {
|
|
1149
1152
|
const l = { ...DEFAULT_STEP_INSPECTOR_LABELS, ...labels };
|
|
1150
1153
|
const ol = { ...DEFAULT_FIELD_OPTIONS_EDITOR_LABELS, ...optionLabels };
|
|
1151
|
-
const steps =
|
|
1154
|
+
const steps = chunkJSTKEZBS_cjs.workflowSteps(workflow);
|
|
1152
1155
|
const step = steps.find((s) => s.id === stepId);
|
|
1153
1156
|
const run = workflow.run.kind === "steps" ? workflow.run : void 0;
|
|
1154
1157
|
if (!step || !run) {
|
|
@@ -1175,8 +1178,8 @@ function StepInspector({
|
|
|
1175
1178
|
const patch = (p) => onChange(updateStep(workflow, step.id, p));
|
|
1176
1179
|
const al = { ...DEFAULT_STEP_ACTION_SETTINGS_LABELS, ...actionLabels };
|
|
1177
1180
|
const ctx = {
|
|
1178
|
-
earlier:
|
|
1179
|
-
fields:
|
|
1181
|
+
earlier: chunkJSTKEZBS_cjs.upstreamSteps(steps, step.id),
|
|
1182
|
+
fields: chunkJSTKEZBS_cjs.runFields(workflow),
|
|
1180
1183
|
people,
|
|
1181
1184
|
tags,
|
|
1182
1185
|
documents
|
|
@@ -1197,7 +1200,7 @@ function StepInspector({
|
|
|
1197
1200
|
)
|
|
1198
1201
|
);
|
|
1199
1202
|
};
|
|
1200
|
-
const deps =
|
|
1203
|
+
const deps = chunkJSTKEZBS_cjs.stepDependencies(steps, step.id);
|
|
1201
1204
|
const titleOf = (id) => steps.find((s) => s.id === id)?.title ?? id;
|
|
1202
1205
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": `${testId}-step`, children: [
|
|
1203
1206
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
@@ -1278,7 +1281,7 @@ function StepInspector({
|
|
|
1278
1281
|
{
|
|
1279
1282
|
step,
|
|
1280
1283
|
workflows,
|
|
1281
|
-
fields:
|
|
1284
|
+
fields: chunkJSTKEZBS_cjs.runFields(workflow).map((f) => f.name),
|
|
1282
1285
|
patch,
|
|
1283
1286
|
l,
|
|
1284
1287
|
testId
|
|
@@ -1339,7 +1342,7 @@ function StepInspector({
|
|
|
1339
1342
|
testId: `${testId}-review-grid`
|
|
1340
1343
|
}
|
|
1341
1344
|
),
|
|
1342
|
-
|
|
1345
|
+
chunkJSTKEZBS_cjs.canAssign(step) && /* @__PURE__ */ jsxRuntime.jsx(AssigneeSettings, { step, patch, ctx, l: al, testId }),
|
|
1343
1346
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1344
1347
|
SignalsEditor,
|
|
1345
1348
|
{
|
|
@@ -1605,7 +1608,7 @@ function triggerFields(trigger, clearOthers) {
|
|
|
1605
1608
|
return {
|
|
1606
1609
|
timezone: trigger.timezone,
|
|
1607
1610
|
rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
|
|
1608
|
-
run_at: trigger.start === "once" ?
|
|
1611
|
+
run_at: trigger.start === "once" ? chunkXGZX22ET_cjs.localInputToIso(trigger.runAt) : none,
|
|
1609
1612
|
event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
|
|
1610
1613
|
// A step signal is `workflow_signal` narrowed to one signal name.
|
|
1611
1614
|
event_filter: filter ?? none,
|
|
@@ -1621,7 +1624,7 @@ function plan(value, options) {
|
|
|
1621
1624
|
criteria: [],
|
|
1622
1625
|
max_passes: 3,
|
|
1623
1626
|
documents: [],
|
|
1624
|
-
steps:
|
|
1627
|
+
steps: chunkABUO6PIQ_cjs.toPlanSteps(value.workflow, options)
|
|
1625
1628
|
};
|
|
1626
1629
|
}
|
|
1627
1630
|
function builderToWorkflowRequest(value, workspaceId, options = {}) {
|
|
@@ -1656,7 +1659,7 @@ function builderToWorkflowUpdate(value, options = {}) {
|
|
|
1656
1659
|
}
|
|
1657
1660
|
function workflowRecordToBuilder(record) {
|
|
1658
1661
|
const planned = record.plan?.steps ?? [];
|
|
1659
|
-
const steps = planned.length ?
|
|
1662
|
+
const steps = planned.length ? chunkABUO6PIQ_cjs.fromPlanSteps(planned) : record.prompt || record.skill_ref ? [
|
|
1660
1663
|
{
|
|
1661
1664
|
id: "work",
|
|
1662
1665
|
kind: "agent",
|
|
@@ -1664,7 +1667,7 @@ function workflowRecordToBuilder(record) {
|
|
|
1664
1667
|
...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
|
|
1665
1668
|
}
|
|
1666
1669
|
] : [];
|
|
1667
|
-
const when =
|
|
1670
|
+
const when = chunkXGZX22ET_cjs.workflowWhen(record);
|
|
1668
1671
|
return {
|
|
1669
1672
|
workflow: {
|
|
1670
1673
|
id: record.external_id,
|
|
@@ -1673,12 +1676,12 @@ function workflowRecordToBuilder(record) {
|
|
|
1673
1676
|
inputs: [],
|
|
1674
1677
|
landing: "chat",
|
|
1675
1678
|
schedulable: false,
|
|
1676
|
-
run: { kind: "steps", steps, layout:
|
|
1679
|
+
run: { kind: "steps", steps, layout: chunkABUO6PIQ_cjs.layoutFromPlanSteps(planned ?? []) }
|
|
1677
1680
|
},
|
|
1678
1681
|
trigger: {
|
|
1679
1682
|
...DEFAULT_WORKFLOW_TRIGGER,
|
|
1680
1683
|
start: when === "now" ? "manual" : when,
|
|
1681
|
-
runAt:
|
|
1684
|
+
runAt: chunkXGZX22ET_cjs.isoToLocalInput(record.run_at),
|
|
1682
1685
|
rrule: record.rrule ?? "",
|
|
1683
1686
|
timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
|
|
1684
1687
|
eventKind: record.event_kind ?? "",
|
|
@@ -1734,7 +1737,7 @@ function triggerSummary(trigger, options = {}) {
|
|
|
1734
1737
|
case "once":
|
|
1735
1738
|
return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
|
|
1736
1739
|
case "repeat":
|
|
1737
|
-
return trigger.rrule ?
|
|
1740
|
+
return trigger.rrule ? chunkXGZX22ET_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
|
|
1738
1741
|
case "event":
|
|
1739
1742
|
if (isSignalTrigger(trigger))
|
|
1740
1743
|
return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
|
|
@@ -1793,7 +1796,7 @@ function TriggerInspector({
|
|
|
1793
1796
|
}
|
|
1794
1797
|
)
|
|
1795
1798
|
] }),
|
|
1796
|
-
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1799
|
+
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkXGZX22ET_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
|
|
1797
1800
|
trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1798
1801
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
|
|
1799
1802
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1845,7 +1848,7 @@ function TriggerInspector({
|
|
|
1845
1848
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1846
1849
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
|
|
1847
1850
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1848
|
-
|
|
1851
|
+
chunkO2ODDTMA_cjs.AgentSelect,
|
|
1849
1852
|
{
|
|
1850
1853
|
agents,
|
|
1851
1854
|
value: trigger.agentId,
|
|
@@ -1913,7 +1916,7 @@ function revealCenter(node, view, frame, reserveRight = 0) {
|
|
|
1913
1916
|
};
|
|
1914
1917
|
}
|
|
1915
1918
|
var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
1916
|
-
...
|
|
1919
|
+
...chunkJSTKEZBS_cjs.DEFAULT_STEP_KIND_LABELS,
|
|
1917
1920
|
redline: "Tracked changes",
|
|
1918
1921
|
branch: "Branch",
|
|
1919
1922
|
kindHints: {
|
|
@@ -1944,7 +1947,7 @@ var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
|
1944
1947
|
fitView: "Fit view"
|
|
1945
1948
|
};
|
|
1946
1949
|
var TRIGGER_NODE = "__trigger";
|
|
1947
|
-
var KINDS =
|
|
1950
|
+
var KINDS = chunkJSTKEZBS_cjs.WORKFLOW_STEP_KINDS;
|
|
1948
1951
|
function AddNext({
|
|
1949
1952
|
from,
|
|
1950
1953
|
onAdd,
|
|
@@ -1966,7 +1969,7 @@ function AddNext({
|
|
|
1966
1969
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.PopoverContent, { side: "right", align: "start", className: "w-60 p-1.5", children: [
|
|
1967
1970
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 pb-1 pt-0.5 text-xs font-medium text-muted-foreground", children: l.addNext }),
|
|
1968
1971
|
KINDS.map((kind) => {
|
|
1969
|
-
const Icon =
|
|
1972
|
+
const Icon = chunkJSTKEZBS_cjs.STEP_KIND_ICONS[kind];
|
|
1970
1973
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1971
1974
|
"button",
|
|
1972
1975
|
{
|
|
@@ -2005,8 +2008,8 @@ function PhaseMark({ phase }) {
|
|
|
2005
2008
|
}
|
|
2006
2009
|
function StepNode({ data }) {
|
|
2007
2010
|
const { step, phase, summary, assignee, icon, l, onAdd, testId } = data;
|
|
2008
|
-
const kind =
|
|
2009
|
-
const KindIcon =
|
|
2011
|
+
const kind = chunkJSTKEZBS_cjs.stepKindOf(step);
|
|
2012
|
+
const KindIcon = chunkJSTKEZBS_cjs.STEP_KIND_ICONS[kind];
|
|
2010
2013
|
const redline = step.kind === "agent" && !!step.editDocument;
|
|
2011
2014
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2012
2015
|
"div",
|
|
@@ -2140,12 +2143,12 @@ function WorkflowCanvas({
|
|
|
2140
2143
|
testId = "workflow-canvas"
|
|
2141
2144
|
}) {
|
|
2142
2145
|
const l = react.useMemo(() => ({ ...DEFAULT_WORKFLOW_CANVAS_LABELS, ...labels }), [labels]);
|
|
2143
|
-
const steps =
|
|
2146
|
+
const steps = chunkJSTKEZBS_cjs.workflowSteps(workflow);
|
|
2144
2147
|
const editable = !!onChange;
|
|
2145
2148
|
const built = react.useMemo(() => {
|
|
2146
2149
|
const layout = layoutWithDefaults(workflow);
|
|
2147
|
-
const all =
|
|
2148
|
-
const roots = all.filter((s) =>
|
|
2150
|
+
const all = chunkJSTKEZBS_cjs.workflowSteps(workflow);
|
|
2151
|
+
const roots = all.filter((s) => chunkJSTKEZBS_cjs.stepDependencies(all, s.id).length === 0);
|
|
2149
2152
|
const triggerNode = trigger ? [
|
|
2150
2153
|
{
|
|
2151
2154
|
id: TRIGGER_NODE,
|
|
@@ -2194,7 +2197,7 @@ function WorkflowCanvas({
|
|
|
2194
2197
|
react.useEffect(() => setNodes(built), [built]);
|
|
2195
2198
|
const edges = react.useMemo(
|
|
2196
2199
|
() => steps.flatMap((s) => {
|
|
2197
|
-
const deps =
|
|
2200
|
+
const deps = chunkJSTKEZBS_cjs.stepDependencies(steps, s.id);
|
|
2198
2201
|
const from = deps.length ? deps : trigger ? [TRIGGER_NODE] : [];
|
|
2199
2202
|
return from.map((d) => ({
|
|
2200
2203
|
id: `${d}->${s.id}`,
|
|
@@ -2364,7 +2367,7 @@ function WorkflowCanvas({
|
|
|
2364
2367
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold", children: l.emptyTitle }),
|
|
2365
2368
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: l.emptyHint }),
|
|
2366
2369
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 grid grid-cols-2 gap-2", children: KINDS.map((kind) => {
|
|
2367
|
-
const Icon =
|
|
2370
|
+
const Icon = chunkJSTKEZBS_cjs.STEP_KIND_ICONS[kind];
|
|
2368
2371
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2369
2372
|
"button",
|
|
2370
2373
|
{
|
|
@@ -2414,7 +2417,7 @@ var DEFAULT_WORKFLOW_BUILDER_LABELS = {
|
|
|
2414
2417
|
}
|
|
2415
2418
|
};
|
|
2416
2419
|
var PANEL_WIDTH = 344;
|
|
2417
|
-
var KINDS2 =
|
|
2420
|
+
var KINDS2 = chunkJSTKEZBS_cjs.WORKFLOW_STEP_KINDS;
|
|
2418
2421
|
function WorkflowBuilder({
|
|
2419
2422
|
value,
|
|
2420
2423
|
onChange,
|
|
@@ -2446,12 +2449,12 @@ function WorkflowBuilder({
|
|
|
2446
2449
|
const [mode, setMode] = react.useState("design");
|
|
2447
2450
|
const [adding, setAdding] = react.useState(false);
|
|
2448
2451
|
const { workflow, trigger } = value;
|
|
2449
|
-
const steps =
|
|
2450
|
-
const problems =
|
|
2451
|
-
const missing =
|
|
2452
|
+
const steps = chunkJSTKEZBS_cjs.workflowSteps(workflow);
|
|
2453
|
+
const problems = chunkJSTKEZBS_cjs.validateWorkflowGraph(steps);
|
|
2454
|
+
const missing = chunkJSTKEZBS_cjs.stepConfigProblems(steps);
|
|
2452
2455
|
const nameOf = (id) => people.find((p) => p.value === id)?.label;
|
|
2453
|
-
const fields =
|
|
2454
|
-
const assigneeOf = (step) =>
|
|
2456
|
+
const fields = chunkJSTKEZBS_cjs.runFields(workflow);
|
|
2457
|
+
const assigneeOf = (step) => chunkJSTKEZBS_cjs.canAssign(step) ? chunkJSTKEZBS_cjs.assigneeName(step.assignee, { nameOf, fields }) : void 0;
|
|
2455
2458
|
const titles = react.useMemo(() => new Map(workflows.map((w) => [w.id, w.title])), [workflows]);
|
|
2456
2459
|
const setWorkflow = (next) => onChange({ ...value, workflow: next });
|
|
2457
2460
|
const addAfter = (from, kind) => {
|
|
@@ -2520,7 +2523,7 @@ function WorkflowBuilder({
|
|
|
2520
2523
|
l.addStep
|
|
2521
2524
|
] }) }),
|
|
2522
2525
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverContent, { align: "start", className: "w-64 p-1.5", children: KINDS2.map((kind) => {
|
|
2523
|
-
const Icon =
|
|
2526
|
+
const Icon = chunkJSTKEZBS_cjs.STEP_KIND_ICONS[kind];
|
|
2524
2527
|
const cls = { ...DEFAULT_WORKFLOW_CANVAS_LABELS, ...canvasLabels };
|
|
2525
2528
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2526
2529
|
"button",
|
|
@@ -2682,13 +2685,13 @@ function WorkflowPreview({
|
|
|
2682
2685
|
renderIcon,
|
|
2683
2686
|
testId
|
|
2684
2687
|
}) {
|
|
2685
|
-
const run =
|
|
2688
|
+
const run = chunkXGZX22ET_cjs.useWorkflowPreview(workflow, {
|
|
2686
2689
|
resolveWorkflow: (id) => workflows.find((w) => w.id === id),
|
|
2687
2690
|
compose,
|
|
2688
2691
|
answer
|
|
2689
2692
|
});
|
|
2690
2693
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2691
|
-
|
|
2694
|
+
chunkABUO6PIQ_cjs.WorkflowRunner,
|
|
2692
2695
|
{
|
|
2693
2696
|
workflow,
|
|
2694
2697
|
run,
|
|
@@ -2801,7 +2804,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2801
2804
|
}
|
|
2802
2805
|
}, [record, loaded]);
|
|
2803
2806
|
const workflows = react.useMemo(() => {
|
|
2804
|
-
const merged =
|
|
2807
|
+
const merged = chunk76L6LOP3_cjs.mergeSkillWorkflows(hostWorkflows, skills.data ?? []);
|
|
2805
2808
|
return [...merged.host, ...merged.skills];
|
|
2806
2809
|
}, [hostWorkflows, skills.data]);
|
|
2807
2810
|
const agents = (agentsQuery.data ?? []).map((a) => ({
|
|
@@ -2810,7 +2813,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2810
2813
|
}));
|
|
2811
2814
|
const tasks = conversations.filter((c) => c.status && c.status !== "done").map((c) => ({ value: c.external_id, label: c.title || l.untitledTask }));
|
|
2812
2815
|
const options = { resolveWorkflow: (wid) => workflows.find((w) => w.id === wid), compose };
|
|
2813
|
-
const problem = triggerProblem(value.trigger) ?? (
|
|
2816
|
+
const problem = triggerProblem(value.trigger) ?? (chunkJSTKEZBS_cjs.validateWorkflowGraph(chunkJSTKEZBS_cjs.workflowSteps(value.workflow)).length || chunkJSTKEZBS_cjs.stepConfigProblems(chunkJSTKEZBS_cjs.workflowSteps(value.workflow)).length ? "graph" : null);
|
|
2814
2817
|
const busy = !!pending || create.isPending || update.isPending || run.isPending;
|
|
2815
2818
|
const save = async () => {
|
|
2816
2819
|
if (!workspaceId) return void 0;
|