@arbidocs/blocks 0.5.141 → 0.5.143
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/{ConnectedCallDock-ZNS5BS2R.cjs → ConnectedCallDock-JVLJEWLJ.cjs} +12 -12
- package/dist/{ConnectedCallDock-ZNS5BS2R.cjs.map → ConnectedCallDock-JVLJEWLJ.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-ACNVSFH7.cjs → ConnectedCallRoom-7YQRDIS3.cjs} +12 -12
- package/dist/{ConnectedCallRoom-ACNVSFH7.cjs.map → ConnectedCallRoom-7YQRDIS3.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-QKY66ZJ7.cjs → ConnectedNativeDocxComparison-FWUYOTSF.cjs} +12 -12
- package/dist/{ConnectedNativeDocxComparison-QKY66ZJ7.cjs.map → ConnectedNativeDocxComparison-FWUYOTSF.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-3JXN6SRT.cjs → ConnectedPresentation-JJXQBIV2.cjs} +13 -13
- package/dist/{ConnectedPresentation-3JXN6SRT.cjs.map → ConnectedPresentation-JJXQBIV2.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-GM5D7IUG.cjs → ConnectedProductionSetDialog-EOWZQ6J3.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-GM5D7IUG.cjs.map → ConnectedProductionSetDialog-EOWZQ6J3.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-IECS2MJI.cjs → ConnectedSlidesTab-BLR762KY.cjs} +13 -13
- package/dist/{ConnectedSlidesTab-IECS2MJI.cjs.map → ConnectedSlidesTab-BLR762KY.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-PHEOVHKH.cjs → ConnectedStreamedWordArtifact-LXXTFGIW.cjs} +12 -12
- package/dist/{ConnectedStreamedWordArtifact-PHEOVHKH.cjs.map → ConnectedStreamedWordArtifact-LXXTFGIW.cjs.map} +1 -1
- package/dist/DocumentReviewCard-ENCPTGJE.cjs +1 -1
- package/dist/{FilesViewerDialog-OFUBS5VA.cjs → FilesViewerDialog-VOCAK22P.cjs} +24 -24
- package/dist/{FilesViewerDialog-OFUBS5VA.cjs.map → FilesViewerDialog-VOCAK22P.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-A2YTG4OQ.cjs → WorkspaceTableView-2RH33X3U.cjs} +3 -3
- package/dist/{WorkspaceTableView-A2YTG4OQ.cjs.map → WorkspaceTableView-2RH33X3U.cjs.map} +1 -1
- package/dist/agents/index.cjs +363 -363
- package/dist/agents/workflows/StepParts.js +3 -0
- package/dist/agents/workflows/StepParts.js.map +2 -2
- package/dist/agents/workflows/WorkflowStepAction.d.ts +3 -1
- package/dist/agents/workflows/WorkflowStepAction.js +24 -3
- package/dist/agents/workflows/WorkflowStepAction.js.map +2 -2
- package/dist/agents/workflows/planSteps.js +24 -0
- package/dist/agents/workflows/planSteps.js.map +2 -2
- package/dist/agents/workflows/run.d.ts +1 -1
- package/dist/agents/workflows/run.js +9 -1
- package/dist/agents/workflows/run.js.map +2 -2
- package/dist/agents/workflows/stepKinds.d.ts +2 -1
- package/dist/agents/workflows/stepKinds.js +7 -4
- package/dist/agents/workflows/stepKinds.js.map +2 -2
- package/dist/agents/workflows/types.d.ts +22 -1
- package/dist/agents/workflows/types.js.map +1 -1
- package/dist/agents/workflows/useWorkflowView.js +13 -2
- package/dist/agents/workflows/useWorkflowView.js.map +3 -3
- package/dist/{ai-QEXZ4SYR.cjs → ai-YX3OAC4F.cjs} +24 -24
- package/dist/ai-YX3OAC4F.cjs.map +1 -0
- package/dist/calls/index.cjs +3 -3
- package/dist/chat/index.cjs +59 -59
- package/dist/{chunk-DGAGSP5G.cjs → chunk-2V5HW6T5.cjs} +6 -6
- package/dist/{chunk-DGAGSP5G.cjs.map → chunk-2V5HW6T5.cjs.map} +1 -1
- package/dist/{chunk-TXBXIUTX.cjs → chunk-2VEQKLNN.cjs} +6 -6
- package/dist/{chunk-TXBXIUTX.cjs.map → chunk-2VEQKLNN.cjs.map} +1 -1
- package/dist/{chunk-TOYKBRAU.cjs → chunk-2XZ3HBAA.cjs} +27 -27
- package/dist/{chunk-TOYKBRAU.cjs.map → chunk-2XZ3HBAA.cjs.map} +1 -1
- package/dist/{chunk-NGPYPW7M.cjs → chunk-36YSDDHB.cjs} +13 -13
- package/dist/{chunk-NGPYPW7M.cjs.map → chunk-36YSDDHB.cjs.map} +1 -1
- package/dist/{chunk-QCC57APO.cjs → chunk-3RN64MXC.cjs} +4 -4
- package/dist/{chunk-QCC57APO.cjs.map → chunk-3RN64MXC.cjs.map} +1 -1
- package/dist/{chunk-HZG4GRDA.cjs → chunk-3Y75LUCT.cjs} +3 -3
- package/dist/{chunk-HZG4GRDA.cjs.map → chunk-3Y75LUCT.cjs.map} +1 -1
- package/dist/{chunk-F6CEPWIF.cjs → chunk-5RMVFFVW.cjs} +7 -7
- package/dist/{chunk-F6CEPWIF.cjs.map → chunk-5RMVFFVW.cjs.map} +1 -1
- package/dist/{chunk-RGSFPWG2.cjs → chunk-6NHOZTIY.cjs} +81 -76
- package/dist/chunk-6NHOZTIY.cjs.map +1 -0
- package/dist/{chunk-MSJGEZHL.cjs → chunk-6RJXO2NF.cjs} +6 -6
- package/dist/{chunk-MSJGEZHL.cjs.map → chunk-6RJXO2NF.cjs.map} +1 -1
- package/dist/{chunk-OOHBXCDV.cjs → chunk-6TU4YLFW.cjs} +18 -18
- package/dist/{chunk-OOHBXCDV.cjs.map → chunk-6TU4YLFW.cjs.map} +1 -1
- package/dist/{chunk-QFXOTJ6G.cjs → chunk-73ECBDG7.cjs} +38 -14
- package/dist/chunk-73ECBDG7.cjs.map +1 -0
- package/dist/{chunk-5A6T4W46.cjs → chunk-7D4WXUBS.cjs} +7 -7
- package/dist/{chunk-5A6T4W46.cjs.map → chunk-7D4WXUBS.cjs.map} +1 -1
- package/dist/{chunk-PIYYBPHH.cjs → chunk-BCRB42SP.cjs} +56 -5
- package/dist/chunk-BCRB42SP.cjs.map +1 -0
- package/dist/{chunk-OOW7H2YD.cjs → chunk-FK7MBD5H.cjs} +6 -6
- package/dist/{chunk-OOW7H2YD.cjs.map → chunk-FK7MBD5H.cjs.map} +1 -1
- package/dist/{chunk-X46QYO4S.cjs → chunk-FSGMWE5I.cjs} +9 -9
- package/dist/{chunk-X46QYO4S.cjs.map → chunk-FSGMWE5I.cjs.map} +1 -1
- package/dist/{chunk-ZTHYJP4G.cjs → chunk-GF3I3SA4.cjs} +10 -10
- package/dist/{chunk-ZTHYJP4G.cjs.map → chunk-GF3I3SA4.cjs.map} +1 -1
- package/dist/{chunk-EQTZQD66.cjs → chunk-I2LJ7RZ2.cjs} +17 -9
- package/dist/chunk-I2LJ7RZ2.cjs.map +1 -0
- package/dist/{chunk-LFMOQALU.cjs → chunk-JJDJLAC7.cjs} +9 -9
- package/dist/{chunk-LFMOQALU.cjs.map → chunk-JJDJLAC7.cjs.map} +1 -1
- package/dist/{chunk-VL7ZX4KQ.cjs → chunk-KMOIE2XH.cjs} +12 -9
- package/dist/chunk-KMOIE2XH.cjs.map +1 -0
- package/dist/{chunk-MEYQLQWS.cjs → chunk-MC34TXSS.cjs} +17 -17
- package/dist/{chunk-MEYQLQWS.cjs.map → chunk-MC34TXSS.cjs.map} +1 -1
- package/dist/{chunk-UWTCK5IN.cjs → chunk-NPRNR54M.cjs} +8 -8
- package/dist/{chunk-UWTCK5IN.cjs.map → chunk-NPRNR54M.cjs.map} +1 -1
- package/dist/{chunk-ORQXGMCC.cjs → chunk-OE36OY64.cjs} +17 -17
- package/dist/{chunk-ORQXGMCC.cjs.map → chunk-OE36OY64.cjs.map} +1 -1
- package/dist/{chunk-IZNSTFAT.cjs → chunk-P2AZ2HX7.cjs} +76 -76
- package/dist/{chunk-IZNSTFAT.cjs.map → chunk-P2AZ2HX7.cjs.map} +1 -1
- package/dist/{chunk-FRRF2OQ7.cjs → chunk-PI4U4LEN.cjs} +8 -8
- package/dist/{chunk-FRRF2OQ7.cjs.map → chunk-PI4U4LEN.cjs.map} +1 -1
- package/dist/{chunk-TIBTTITZ.cjs → chunk-SK6LFIU2.cjs} +3 -3
- package/dist/{chunk-TIBTTITZ.cjs.map → chunk-SK6LFIU2.cjs.map} +1 -1
- package/dist/{chunk-R5NTEW4L.cjs → chunk-UKAN76CS.cjs} +144 -109
- package/dist/chunk-UKAN76CS.cjs.map +1 -0
- package/dist/{chunk-JN5YMHGI.cjs → chunk-XPQR2PJX.cjs} +2 -2
- package/dist/chunk-XPQR2PJX.cjs.map +1 -0
- package/dist/{chunk-2EY52GDM.cjs → chunk-YOSRBLLD.cjs} +7 -7
- package/dist/{chunk-2EY52GDM.cjs.map → chunk-YOSRBLLD.cjs.map} +1 -1
- package/dist/{chunk-6CGMSJLB.cjs → chunk-YST6GVN5.cjs} +16 -16
- package/dist/{chunk-6CGMSJLB.cjs.map → chunk-YST6GVN5.cjs.map} +1 -1
- package/dist/{chunk-RSQGDXAF.cjs → chunk-YZ25NAR3.cjs} +11 -11
- package/dist/{chunk-RSQGDXAF.cjs.map → chunk-YZ25NAR3.cjs.map} +1 -1
- package/dist/{chunk-N2YDYEUL.cjs → chunk-Z6FJLJWX.cjs} +4 -4
- package/dist/{chunk-N2YDYEUL.cjs.map → chunk-Z6FJLJWX.cjs.map} +1 -1
- package/dist/connect/docx.cjs +15 -15
- package/dist/connect/index.cjs +477 -430
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +13 -13
- package/dist/connection/ConnectedWorkflowBuilder.js +8 -0
- package/dist/connection/ConnectedWorkflowBuilder.js.map +2 -2
- package/dist/connection/billing/StripeCheckoutModal.js +1 -1
- package/dist/connection/billing/StripeCheckoutModal.js.map +2 -2
- package/dist/connection/databases/ConnectedDatabasesPage.js +50 -8
- package/dist/connection/databases/ConnectedDatabasesPage.js.map +2 -2
- package/dist/connection/notification-center/useOpenNotificationTarget.d.ts +2 -0
- package/dist/connection/notification-center/useOpenNotificationTarget.js +11 -2
- package/dist/connection/notification-center/useOpenNotificationTarget.js.map +2 -2
- package/dist/connection/tasks/ConnectedThreadTaskBar.js +9 -2
- package/dist/connection/tasks/ConnectedThreadTaskBar.js.map +2 -2
- package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +2 -2
- package/dist/databases/DatabaseColumnDialog.d.ts +13 -0
- package/dist/databases/DatabaseColumnDialog.js +38 -1
- package/dist/databases/DatabaseColumnDialog.js.map +2 -2
- package/dist/databases/DatabaseRowDetail.d.ts +6 -1
- package/dist/databases/DatabaseRowDetail.js +15 -1
- package/dist/databases/DatabaseRowDetail.js.map +2 -2
- package/dist/databases/column-types.d.ts +14 -0
- package/dist/databases/column-types.js.map +2 -2
- package/dist/databases/databaseColumns.js +1 -1
- package/dist/databases/databaseColumns.js.map +2 -2
- package/dist/databases/index.cjs +48 -48
- package/dist/embed/index.cjs +25 -25
- package/dist/facts/index.cjs +43 -43
- package/dist/index.cjs +525 -525
- package/dist/office/index.cjs +5 -5
- package/dist/settings/index.cjs +1 -1
- package/dist/studio/index.cjs +15 -15
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/StepActionSettings.d.ts +25 -1
- package/dist/workflow-canvas/StepActionSettings.js +113 -1
- package/dist/workflow-canvas/StepActionSettings.js.map +2 -2
- package/dist/workflow-canvas/StepInspector.d.ts +5 -3
- package/dist/workflow-canvas/StepInspector.js +14 -1
- package/dist/workflow-canvas/StepInspector.js.map +2 -2
- package/dist/workflow-canvas/WorkflowBuilder.d.ts +4 -2
- package/dist/workflow-canvas/WorkflowBuilder.js +8 -2
- package/dist/workflow-canvas/WorkflowBuilder.js.map +2 -2
- package/dist/workflow-canvas/WorkflowCanvas.d.ts +4 -0
- package/dist/workflow-canvas/WorkflowCanvas.js +5 -1
- package/dist/workflow-canvas/WorkflowCanvas.js.map +2 -2
- package/dist/workflow-canvas/edit.js +19 -1
- package/dist/workflow-canvas/edit.js.map +2 -2
- package/dist/workflow-canvas/index.cjs +240 -84
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/blocks.css +3 -0
- package/dist/ai-QEXZ4SYR.cjs.map +0 -1
- package/dist/chunk-EQTZQD66.cjs.map +0 -1
- package/dist/chunk-JN5YMHGI.cjs.map +0 -1
- package/dist/chunk-PIYYBPHH.cjs.map +0 -1
- package/dist/chunk-QFXOTJ6G.cjs.map +0 -1
- package/dist/chunk-R5NTEW4L.cjs.map +0 -1
- package/dist/chunk-RGSFPWG2.cjs.map +0 -1
- package/dist/chunk-VL7ZX4KQ.cjs.map +0 -1
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkCYN66TBO_cjs = require('./chunk-CYN66TBO.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk73ECBDG7_cjs = require('./chunk-73ECBDG7.cjs');
|
|
6
6
|
var chunkI4IS6ST6_cjs = require('./chunk-I4IS6ST6.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunk7D4WXUBS_cjs = require('./chunk-7D4WXUBS.cjs');
|
|
8
8
|
var chunkOYXWQTHF_cjs = require('./chunk-OYXWQTHF.cjs');
|
|
9
9
|
var chunkS237ORM3_cjs = require('./chunk-S237ORM3.cjs');
|
|
10
10
|
var chunkII2OEXHW_cjs = require('./chunk-II2OEXHW.cjs');
|
|
11
11
|
var chunkJJZOL5MG_cjs = require('./chunk-JJZOL5MG.cjs');
|
|
12
12
|
var chunk3YEXZX4H_cjs = require('./chunk-3YEXZX4H.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkYZ25NAR3_cjs = require('./chunk-YZ25NAR3.cjs');
|
|
14
14
|
var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
|
|
15
|
+
var chunkS5OGPQSB_cjs = require('./chunk-S5OGPQSB.cjs');
|
|
15
16
|
var chunkRL2HI6NP_cjs = require('./chunk-RL2HI6NP.cjs');
|
|
16
17
|
var chunk6UZC4XVV_cjs = require('./chunk-6UZC4XVV.cjs');
|
|
17
|
-
var chunkS5OGPQSB_cjs = require('./chunk-S5OGPQSB.cjs');
|
|
18
18
|
var chunkOUGRCQM7_cjs = require('./chunk-OUGRCQM7.cjs');
|
|
19
19
|
var chunkZVEW3JBT_cjs = require('./chunk-ZVEW3JBT.cjs');
|
|
20
20
|
var chunkSJSGSHIT_cjs = require('./chunk-SJSGSHIT.cjs');
|
|
21
21
|
var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
|
|
22
22
|
var chunkIN6ILI5A_cjs = require('./chunk-IN6ILI5A.cjs');
|
|
23
|
-
var
|
|
23
|
+
var chunkKMOIE2XH_cjs = require('./chunk-KMOIE2XH.cjs');
|
|
24
24
|
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var chunkI2LJ7RZ2_cjs = require('./chunk-I2LJ7RZ2.cjs');
|
|
26
|
+
var chunkXPQR2PJX_cjs = require('./chunk-XPQR2PJX.cjs');
|
|
27
27
|
var chunkIPSHAMO2_cjs = require('./chunk-IPSHAMO2.cjs');
|
|
28
28
|
var chunkLIKDQBNJ_cjs = require('./chunk-LIKDQBNJ.cjs');
|
|
29
29
|
var chunkYZBDHBKI_cjs = require('./chunk-YZBDHBKI.cjs');
|
|
@@ -60,7 +60,7 @@ function resolveScopeInputs(workflow, inputs, scopeSource) {
|
|
|
60
60
|
for (const field of workflow.inputs) {
|
|
61
61
|
if (field.type !== "scope") continue;
|
|
62
62
|
const raw = inputs[field.name];
|
|
63
|
-
const scope =
|
|
63
|
+
const scope = chunkXPQR2PJX_cjs.isWorkflowScope(raw) ? raw : { folders: [], labels: [] };
|
|
64
64
|
next[field.name] = { ...scope, documents: scopeSource.resolveDocuments(scope) };
|
|
65
65
|
}
|
|
66
66
|
return next;
|
|
@@ -82,7 +82,7 @@ function workflowToSkillMarkdown(workflow) {
|
|
|
82
82
|
if (workflow.landing !== "chat") lines.push(`landing: ${workflow.landing}`);
|
|
83
83
|
if (workflow.requiresFiles) lines.push("requires_files: true");
|
|
84
84
|
if (workflow.inputs.length > 0) {
|
|
85
|
-
lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(
|
|
85
|
+
lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(chunkXPQR2PJX_cjs.fieldToFrontmatter))}`);
|
|
86
86
|
}
|
|
87
87
|
lines.push("---", "", run.promptTemplate.trim(), "");
|
|
88
88
|
return lines.join("\n");
|
|
@@ -104,12 +104,12 @@ function workflowFromSkillMarkdown(id, text) {
|
|
|
104
104
|
} else if (value === "true" || value === "false") frontmatter[key] = value === "true";
|
|
105
105
|
else frontmatter[key] = value;
|
|
106
106
|
}
|
|
107
|
-
return
|
|
107
|
+
return chunkXPQR2PJX_cjs.workflowFromFrontmatter(id, frontmatter, body);
|
|
108
108
|
}
|
|
109
109
|
var errorMessage = (e) => e instanceof Error ? e.message : typeof e === "string" ? e : "Something went wrong.";
|
|
110
110
|
function firstOpen(steps, states) {
|
|
111
111
|
const open = steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? "pending"));
|
|
112
|
-
return open?.id ?? (steps.length &&
|
|
112
|
+
return open?.id ?? (steps.length && chunkI2LJ7RZ2_cjs.isRunFinished(steps, states) ? null : steps[0]?.id ?? null);
|
|
113
113
|
}
|
|
114
114
|
function useWorkflowView(options) {
|
|
115
115
|
const { steps, states, inputs, setInput, loaded = true } = options;
|
|
@@ -125,6 +125,17 @@ function useWorkflowView(options) {
|
|
|
125
125
|
placed.current = true;
|
|
126
126
|
setCurrent(firstOpen(steps, states));
|
|
127
127
|
}, [steps, states, loaded]);
|
|
128
|
+
const open = loaded ? firstOpen(steps, states) : null;
|
|
129
|
+
const lastOpen = react.useRef(open);
|
|
130
|
+
react.useEffect(() => {
|
|
131
|
+
if (open === lastOpen.current) return;
|
|
132
|
+
lastOpen.current = open;
|
|
133
|
+
const at = (id) => steps.findIndex((s) => s.id === id);
|
|
134
|
+
if (open && at(open) < at(current)) {
|
|
135
|
+
setShowErrors(false);
|
|
136
|
+
setCurrent(open);
|
|
137
|
+
}
|
|
138
|
+
}, [open, current, steps]);
|
|
128
139
|
const step = steps.find((s) => s.id === current);
|
|
129
140
|
const following = react.useCallback(
|
|
130
141
|
(id) => {
|
|
@@ -137,8 +148,8 @@ function useWorkflowView(options) {
|
|
|
137
148
|
(id) => {
|
|
138
149
|
const { steps: s, states: st } = optionsRef.current;
|
|
139
150
|
const i = s.findIndex((x) => x.id === id);
|
|
140
|
-
const
|
|
141
|
-
return
|
|
151
|
+
const open2 = s.slice(i + 1).find((x) => !["done", "skipped"].includes(st[x.id]?.status ?? "pending"));
|
|
152
|
+
return open2?.id ?? following(id);
|
|
142
153
|
},
|
|
143
154
|
[following]
|
|
144
155
|
);
|
|
@@ -149,11 +160,11 @@ function useWorkflowView(options) {
|
|
|
149
160
|
}),
|
|
150
161
|
[]
|
|
151
162
|
);
|
|
152
|
-
const action = busy ? "wait" :
|
|
163
|
+
const action = busy ? "wait" : chunkI2LJ7RZ2_cjs.nextAction(steps, states, current, actionOptions(options));
|
|
153
164
|
const next = react.useCallback(async () => {
|
|
154
165
|
const { steps: s, states: st, inputs: values } = optionsRef.current;
|
|
155
166
|
const at = s.find((x) => x.id === current);
|
|
156
|
-
const act2 =
|
|
167
|
+
const act2 = chunkI2LJ7RZ2_cjs.nextAction(s, st, current, actionOptions(optionsRef.current));
|
|
157
168
|
if (!at || act2 === "wait" || busy) return;
|
|
158
169
|
setActionError(null);
|
|
159
170
|
if (act2 === "finish") return setCurrent(null);
|
|
@@ -164,7 +175,7 @@ function useWorkflowView(options) {
|
|
|
164
175
|
await (act2 === "start" ? optionsRef.current.start?.() : optionsRef.current.retry?.(at.id));
|
|
165
176
|
return;
|
|
166
177
|
}
|
|
167
|
-
if (Object.keys(
|
|
178
|
+
if (Object.keys(chunkI2LJ7RZ2_cjs.validateStep(at, values)).length > 0) {
|
|
168
179
|
setShowErrors(true);
|
|
169
180
|
return;
|
|
170
181
|
}
|
|
@@ -265,10 +276,10 @@ function useWorkflowView(options) {
|
|
|
265
276
|
inputs,
|
|
266
277
|
setInput,
|
|
267
278
|
stateOf: (id) => states[id],
|
|
268
|
-
phaseOf: (id) =>
|
|
269
|
-
failedUpstreamOf: (id) =>
|
|
279
|
+
phaseOf: (id) => chunkI2LJ7RZ2_cjs.stepPhase(steps, states, id),
|
|
280
|
+
failedUpstreamOf: (id) => chunkI2LJ7RZ2_cjs.failedUpstream(steps, states, id),
|
|
270
281
|
isLocked,
|
|
271
|
-
errors: showErrors && step && !isLocked(step.id) ?
|
|
282
|
+
errors: showErrors && step && !isLocked(step.id) ? chunkI2LJ7RZ2_cjs.validateStep(step, inputs) : {},
|
|
272
283
|
busy,
|
|
273
284
|
actionError,
|
|
274
285
|
isRunning: Object.values(states).some((s) => s.status === "running"),
|
|
@@ -286,11 +297,11 @@ function useWorkflowView(options) {
|
|
|
286
297
|
nameOf: options.nameOf,
|
|
287
298
|
assigneeOf: (id) => {
|
|
288
299
|
const s = steps.find((x) => x.id === id);
|
|
289
|
-
if (!s || !
|
|
290
|
-
return
|
|
300
|
+
if (!s || !chunkI2LJ7RZ2_cjs.canAssign(s)) return void 0;
|
|
301
|
+
return chunkI2LJ7RZ2_cjs.assigneeName(s.assignee, {
|
|
291
302
|
nameOf: options.nameOf,
|
|
292
303
|
inputs,
|
|
293
|
-
fields:
|
|
304
|
+
fields: chunkI2LJ7RZ2_cjs.runFieldsOf(steps),
|
|
294
305
|
announcedTo: states[id]?.announcedTo
|
|
295
306
|
});
|
|
296
307
|
},
|
|
@@ -496,7 +507,7 @@ function StepBarFrame({
|
|
|
496
507
|
phase === "blocked" && "opacity-60"
|
|
497
508
|
),
|
|
498
509
|
"aria-hidden": true,
|
|
499
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
510
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkKMOIE2XH_cjs.StepBadgeMark, { phase, icon: icon?.(s) })
|
|
500
511
|
}
|
|
501
512
|
),
|
|
502
513
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", title: s.title, children: s.title }),
|
|
@@ -610,7 +621,7 @@ function StepBarFrame({
|
|
|
610
621
|
phase: kind === "working" ? "running" : "failed",
|
|
611
622
|
className: "min-w-0 shrink",
|
|
612
623
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
613
|
-
|
|
624
|
+
chunkKMOIE2XH_cjs.StepChip,
|
|
614
625
|
{
|
|
615
626
|
kind: kindOf(s),
|
|
616
627
|
phase: kind === "working" ? "running" : "failed",
|
|
@@ -784,7 +795,7 @@ var DEFAULT_WORKFLOW_STEP_PARTS_LABELS = {
|
|
|
784
795
|
someone: "someone"
|
|
785
796
|
};
|
|
786
797
|
var docName = (ref, nameOfDoc) => {
|
|
787
|
-
const { id, version } =
|
|
798
|
+
const { id, version } = chunkI2LJ7RZ2_cjs.splitDocRef(ref);
|
|
788
799
|
const name = nameOfDoc?.(id) ?? id;
|
|
789
800
|
return version ? `${name} \xB7 v${version}` : name;
|
|
790
801
|
};
|
|
@@ -866,7 +877,7 @@ function SendBackControl({
|
|
|
866
877
|
const states = Object.fromEntries(
|
|
867
878
|
run.steps.map((s) => [s.id, run.stateOf(s.id) ?? { status: "pending" }])
|
|
868
879
|
);
|
|
869
|
-
const targets =
|
|
880
|
+
const targets = chunkI2LJ7RZ2_cjs.sendBackTargets(run.steps, states, step.id);
|
|
870
881
|
const [open, setOpen] = react.useState(false);
|
|
871
882
|
const [to, setTo] = react.useState(targets[0]?.id ?? "");
|
|
872
883
|
const [note, setNote] = react.useState("");
|
|
@@ -956,7 +967,7 @@ function ApprovalEvidence({
|
|
|
956
967
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex flex-wrap items-center gap-1.5 text-sm font-medium", children: [
|
|
957
968
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "size-4 text-primary" }),
|
|
958
969
|
approver ? l.approvedBy.replace("{name}", approver) : null,
|
|
959
|
-
state.at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-normal text-muted-foreground", children: l.approvedAt.replace("{date}",
|
|
970
|
+
state.at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-normal text-muted-foreground", children: l.approvedAt.replace("{date}", chunkKMOIE2XH_cjs.formatDate(state.at)) })
|
|
960
971
|
] }),
|
|
961
972
|
evidence.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
962
973
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: l.approvedWhat }),
|
|
@@ -989,7 +1000,7 @@ function ApprovalEvidence({
|
|
|
989
1000
|
] }),
|
|
990
1001
|
(step.fields ?? []).length > 0 && /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs", children: (step.fields ?? []).map((f) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "contents", children: [
|
|
991
1002
|
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
|
|
992
|
-
/* @__PURE__ */ jsxRuntime.jsx("dd", { "data-testid": `${testId}-evidence-field-${f.name}`, children:
|
|
1003
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { "data-testid": `${testId}-evidence-field-${f.name}`, children: chunkKMOIE2XH_cjs.shownValue(run.inputs[f.name], f, run.nameOf) })
|
|
993
1004
|
] }, f.name)) })
|
|
994
1005
|
] });
|
|
995
1006
|
}
|
|
@@ -1085,7 +1096,7 @@ function ActionStepBody({
|
|
|
1085
1096
|
waiting?.expires_at && phase === "waiting" && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
1086
1097
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "size-3.5" }),
|
|
1087
1098
|
" ",
|
|
1088
|
-
l.expires.replace("{date}",
|
|
1099
|
+
l.expires.replace("{date}", chunkKMOIE2XH_cjs.formatDate(waiting.expires_at))
|
|
1089
1100
|
] }),
|
|
1090
1101
|
phase === "waiting" && mine && !declining && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
1091
1102
|
actions?.sign && state && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1164,7 +1175,7 @@ function ActionStepBody({
|
|
|
1164
1175
|
] });
|
|
1165
1176
|
} else if (a.type === "email_draft") {
|
|
1166
1177
|
const draftId = state?.waiting?.draft_id ?? (typeof state?.output?.draft_id === "string" ? state.output.draft_id : void 0);
|
|
1167
|
-
const gmailUrl =
|
|
1178
|
+
const gmailUrl = chunkXPQR2PJX_cjs.gmailDraftUrl(state?.waiting);
|
|
1168
1179
|
body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1169
1180
|
underWay && working(l.preparingDraft),
|
|
1170
1181
|
phase === "waiting" && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: gmailUrl ? l.draftReadyInGmail : l.draftReady }),
|
|
@@ -1201,6 +1212,9 @@ function ActionStepBody({
|
|
|
1201
1212
|
}
|
|
1202
1213
|
))
|
|
1203
1214
|
] });
|
|
1215
|
+
} else if (a.type === "approval") {
|
|
1216
|
+
const decided = state?.output?.decision;
|
|
1217
|
+
body = /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", "data-testid": `${testId}-approval`, children: phase === "done" ? `Decided: ${decided ?? "approved"}` : phase === "waiting" || underWay ? "Waiting for a decision on the request" : "Submits a request for approval" });
|
|
1204
1218
|
} else {
|
|
1205
1219
|
const tags = state?.output?.tag_ext_ids ?? a.tags;
|
|
1206
1220
|
const docs = state?.output?.doc_ext_ids ?? [];
|
|
@@ -1257,7 +1271,7 @@ function WorkflowStepBar({
|
|
|
1257
1271
|
const name = `${title} (${l.phases[phase]})`;
|
|
1258
1272
|
if (s.id === DONE)
|
|
1259
1273
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1260
|
-
|
|
1274
|
+
chunkKMOIE2XH_cjs.StepChip,
|
|
1261
1275
|
{
|
|
1262
1276
|
inert: true,
|
|
1263
1277
|
kind: "start",
|
|
@@ -1271,17 +1285,17 @@ function WorkflowStepBar({
|
|
|
1271
1285
|
"data-testid": tid("step-done")
|
|
1272
1286
|
}
|
|
1273
1287
|
);
|
|
1274
|
-
const kind =
|
|
1275
|
-
const KindIcon =
|
|
1288
|
+
const kind = chunkKMOIE2XH_cjs.stepKindOf(s);
|
|
1289
|
+
const KindIcon = chunkKMOIE2XH_cjs.STEP_KIND_ICONS[kind];
|
|
1276
1290
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1277
|
-
|
|
1291
|
+
chunkKMOIE2XH_cjs.StepChip,
|
|
1278
1292
|
{
|
|
1279
1293
|
kind,
|
|
1280
1294
|
phase,
|
|
1281
1295
|
icon: icon(s.icon) ?? /* @__PURE__ */ jsxRuntime.jsx(KindIcon, {}),
|
|
1282
1296
|
label: s.title,
|
|
1283
1297
|
current: isCurrent,
|
|
1284
|
-
heading:
|
|
1298
|
+
heading: chunkKMOIE2XH_cjs.DEFAULT_STEP_KIND_LABELS[kind],
|
|
1285
1299
|
labelClassName: isCurrent ? STEP_LABEL_CURRENT : ui.cn(STEP_LABEL, STEP_LABEL_MAX),
|
|
1286
1300
|
labelTestId: tid(`step-${s.id}-label`),
|
|
1287
1301
|
onClick: () => run.goTo(s.id),
|
|
@@ -1314,7 +1328,7 @@ function WorkflowStepBar({
|
|
|
1314
1328
|
isSelectable: (id) => id !== DONE,
|
|
1315
1329
|
renderStep: (s) => pill(s),
|
|
1316
1330
|
icon: (s) => s.id === DONE ? doneIcon : icon(s.icon),
|
|
1317
|
-
kindOf: (s) => s.id === DONE ? "start" :
|
|
1331
|
+
kindOf: (s) => s.id === DONE ? "start" : chunkKMOIE2XH_cjs.stepKindOf(s),
|
|
1318
1332
|
disabled: run.busy,
|
|
1319
1333
|
labels,
|
|
1320
1334
|
tid,
|
|
@@ -1393,7 +1407,7 @@ function WorkflowRunner({
|
|
|
1393
1407
|
const { steps, step, isComplete, action } = run;
|
|
1394
1408
|
const completion = workflow.run.kind === "steps" ? workflow.run.completion : void 0;
|
|
1395
1409
|
const tid = (suffix) => `${testIdPrefix}-${suffix}`;
|
|
1396
|
-
const levels =
|
|
1410
|
+
const levels = chunkI2LJ7RZ2_cjs.stepLevels(steps);
|
|
1397
1411
|
const icon = (key) => key && renderIcon ? renderIcon(key) : void 0;
|
|
1398
1412
|
const added = step?.kind === "upload" ? (files ?? []).filter((f) => f.addedFor === step.id) : [];
|
|
1399
1413
|
const unread = added.filter((f) => f.status === "processing").length;
|
|
@@ -1401,7 +1415,7 @@ function WorkflowRunner({
|
|
|
1401
1415
|
const sending = added.filter((f) => f.status === "uploading").length;
|
|
1402
1416
|
const unsent = added.filter((f) => f.status === "upload-failed").length;
|
|
1403
1417
|
const uploadHold = step?.kind === "upload" && (sending > 0 || uploading || unsent > 0);
|
|
1404
|
-
const docsWait = !!step &&
|
|
1418
|
+
const docsWait = !!step && chunkI2LJ7RZ2_cjs.waitingDocuments(run.stateOf(step.id)).length > 0;
|
|
1405
1419
|
const nextLabel = sending ? sending === 1 ? l.uploadingFile : l.uploadingFiles.replace("{count}", String(sending)) : uploadHold && uploading ? l.uploadingAny : uploadHold ? unsent === 1 ? l.uploadFailed : l.uploadsFailed.replace("{count}", String(unsent)) : reading ? l.readingFiles.replace("{current}", String(Math.min(added.length - unread + 1, added.length))).replace("{count}", String(added.length)) : action === "start" ? l.start : action === "retry" ? l.retry : action === "finish" ? l.finish : action === "complete" && step?.kind === "review" ? l.approve : action === "complete" && step?.kind === "action" ? l.markSent : action === "wait" && (run.isRunning || run.busy || docsWait) ? l.working : (step && !run.isLocked(step.id) ? step.nextLabel : void 0) ?? l.next;
|
|
1406
1420
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn(compact ? "space-y-3" : "space-y-6", className), "data-testid": testIdPrefix, children: [
|
|
1407
1421
|
!hideStepBar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1433,13 +1447,13 @@ function WorkflowRunner({
|
|
|
1433
1447
|
/* @__PURE__ */ jsxRuntime.jsx(StepNotices, { run, step, l, tid }),
|
|
1434
1448
|
run.phaseOf(step.id) === "blocked" ? /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { className: ui.cn(box, "p-6"), "data-testid": tid(step.id), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", "data-testid": tid(`${step.id}-blocked`), children: l.blocked.replace(
|
|
1435
1449
|
"{steps}",
|
|
1436
|
-
|
|
1450
|
+
chunkI2LJ7RZ2_cjs.stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
|
|
1437
1451
|
) }) }) : step.kind === "form" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
|
|
1438
1452
|
/* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon), testId: tid(`${step.id}-title`) }),
|
|
1439
1453
|
/* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
|
|
1440
1454
|
/* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
|
|
1441
1455
|
/* @__PURE__ */ jsxRuntime.jsx("fieldset", { disabled: run.isLocked(step.id), className: "contents", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1442
|
-
|
|
1456
|
+
chunkYZ25NAR3_cjs.SchemaForm,
|
|
1443
1457
|
{
|
|
1444
1458
|
fields: step.inputs,
|
|
1445
1459
|
values: run.inputs,
|
|
@@ -1485,11 +1499,11 @@ function WorkflowRunner({
|
|
|
1485
1499
|
] }) : step.kind === "review" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
|
|
1486
1500
|
/* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon) }),
|
|
1487
1501
|
/* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
|
|
1488
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children:
|
|
1502
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: chunkI2LJ7RZ2_cjs.reviewInstructions(step, run.inputs) }),
|
|
1489
1503
|
/* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
|
|
1490
1504
|
!(run.phaseOf(step.id) === "done" && run.stateOf(step.id)?.by) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", "data-testid": tid(`${step.id}-status`), children: run.phaseOf(step.id) === "done" ? l.approved : run.phaseOf(step.id) === "skipped" ? l.skipped : l.awaitingReview }),
|
|
1491
1505
|
(step.fields ?? []).length > 0 && run.phaseOf(step.id) === "ready" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1492
|
-
|
|
1506
|
+
chunkYZ25NAR3_cjs.SchemaForm,
|
|
1493
1507
|
{
|
|
1494
1508
|
fields: step.fields ?? [],
|
|
1495
1509
|
values: run.inputs,
|
|
@@ -1746,8 +1760,8 @@ function AgentStepBody({
|
|
|
1746
1760
|
}) {
|
|
1747
1761
|
const state = run.stateOf(step.id);
|
|
1748
1762
|
const phase = run.phaseOf(step.id);
|
|
1749
|
-
const pending =
|
|
1750
|
-
const pendingNames = pending.flatMap((ref) => nameOfDoc?.(
|
|
1763
|
+
const pending = chunkI2LJ7RZ2_cjs.waitingDocuments(state);
|
|
1764
|
+
const pendingNames = pending.flatMap((ref) => nameOfDoc?.(chunkI2LJ7RZ2_cjs.splitDocRef(ref).id) ?? []);
|
|
1751
1765
|
const header = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1752
1766
|
/* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon }),
|
|
1753
1767
|
phase === "failed" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: run.retry && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1830,7 +1844,7 @@ function StepNotices({
|
|
|
1830
1844
|
l,
|
|
1831
1845
|
tid
|
|
1832
1846
|
}) {
|
|
1833
|
-
const notStarted = !
|
|
1847
|
+
const notStarted = !chunkI2LJ7RZ2_cjs.isPersonStep(step) && run.needsStart && run.phaseOf(step.id) === "ready";
|
|
1834
1848
|
const failed = run.failedUpstreamOf(step.id);
|
|
1835
1849
|
if (!notStarted && failed.length === 0) return null;
|
|
1836
1850
|
const why = (error) => error ? `: ${error}` : "";
|
|
@@ -1886,7 +1900,7 @@ var asForm = (step) => ({
|
|
|
1886
1900
|
id: step.id,
|
|
1887
1901
|
title: step.title,
|
|
1888
1902
|
description: "",
|
|
1889
|
-
inputs:
|
|
1903
|
+
inputs: chunkI2LJ7RZ2_cjs.stepFields(step),
|
|
1890
1904
|
run: { kind: "operation" },
|
|
1891
1905
|
landing: "chat"
|
|
1892
1906
|
});
|
|
@@ -1904,7 +1918,8 @@ function WorkflowStepAction({
|
|
|
1904
1918
|
onDecline,
|
|
1905
1919
|
onOpenDocument,
|
|
1906
1920
|
onOpenDraft,
|
|
1907
|
-
onOpenReview
|
|
1921
|
+
onOpenReview,
|
|
1922
|
+
onOpenRequest
|
|
1908
1923
|
}) {
|
|
1909
1924
|
if (step.kind === "upload" && phase === "ready" && onUpload)
|
|
1910
1925
|
return /* @__PURE__ */ jsxRuntime.jsx(UploadStepAction, { step, onUpload, onComplete });
|
|
@@ -1912,7 +1927,7 @@ function WorkflowStepAction({
|
|
|
1912
1927
|
StepAction,
|
|
1913
1928
|
{
|
|
1914
1929
|
...{ step, phase, steps, states, inputs, me, nameOf, onComplete, onSendBack, onDecline },
|
|
1915
|
-
...{ onOpenDocument, onOpenDraft, onOpenReview }
|
|
1930
|
+
...{ onOpenDocument, onOpenDraft, onOpenReview, onOpenRequest }
|
|
1916
1931
|
}
|
|
1917
1932
|
);
|
|
1918
1933
|
}
|
|
@@ -2059,15 +2074,16 @@ function StepAction({
|
|
|
2059
2074
|
onDecline,
|
|
2060
2075
|
onOpenDocument,
|
|
2061
2076
|
onOpenDraft,
|
|
2062
|
-
onOpenReview
|
|
2077
|
+
onOpenReview,
|
|
2078
|
+
onOpenRequest
|
|
2063
2079
|
}) {
|
|
2064
|
-
const fields =
|
|
2080
|
+
const fields = chunkI2LJ7RZ2_cjs.stepFields(step);
|
|
2065
2081
|
const [values, setValues] = react.useState(
|
|
2066
|
-
() => fields.length ? { ...
|
|
2082
|
+
() => fields.length ? { ...chunkXPQR2PJX_cjs.defaultInputs(asForm(step)), ...inputs } : {}
|
|
2067
2083
|
);
|
|
2068
2084
|
const [open, setOpen] = react.useState(null);
|
|
2069
2085
|
const [note, setNote] = react.useState("");
|
|
2070
|
-
const targets =
|
|
2086
|
+
const targets = chunkI2LJ7RZ2_cjs.sendBackTargets(steps, states, step.id);
|
|
2071
2087
|
const [to, setTo] = react.useState(targets[0]?.id ?? "");
|
|
2072
2088
|
const [busy, setBusy] = react.useState(false);
|
|
2073
2089
|
const [error, setError] = react.useState(null);
|
|
@@ -2104,7 +2120,7 @@ function StepAction({
|
|
|
2104
2120
|
const waiting = state?.waiting;
|
|
2105
2121
|
if (phase !== "waiting") return null;
|
|
2106
2122
|
if (step.action.type === "email_draft") {
|
|
2107
|
-
const gmailUrl =
|
|
2123
|
+
const gmailUrl = chunkXPQR2PJX_cjs.gmailDraftUrl(waiting);
|
|
2108
2124
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 p-1", "data-testid": tid, children: [
|
|
2109
2125
|
gmailUrl ? /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "sm", variant: "outline", className: "w-full", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2110
2126
|
"a",
|
|
@@ -2140,6 +2156,25 @@ function StepAction({
|
|
|
2140
2156
|
errorLine
|
|
2141
2157
|
] });
|
|
2142
2158
|
}
|
|
2159
|
+
if (step.action.type === "approval") {
|
|
2160
|
+
const approvers = waiting?.approvers ?? [];
|
|
2161
|
+
const database = waiting?.database;
|
|
2162
|
+
const row = waiting?.row;
|
|
2163
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 p-1", "data-testid": tid, children: [
|
|
2164
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Waiting for a decision from" }),
|
|
2165
|
+
approvers.map((id) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-xs", "data-testid": `${tid}-approver-${id}`, children: nameOf?.(id) ?? id }, id)),
|
|
2166
|
+
database && row && onOpenRequest && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2167
|
+
ui.Button,
|
|
2168
|
+
{
|
|
2169
|
+
size: "sm",
|
|
2170
|
+
className: "w-full",
|
|
2171
|
+
onClick: () => onOpenRequest(database, row),
|
|
2172
|
+
"data-testid": `${tid}-open-request`,
|
|
2173
|
+
children: me && approvers.includes(me) ? "Open and decide" : "Open the request"
|
|
2174
|
+
}
|
|
2175
|
+
)
|
|
2176
|
+
] });
|
|
2177
|
+
}
|
|
2143
2178
|
if (step.action.type === "sign") {
|
|
2144
2179
|
const signers = waiting?.signers ?? [];
|
|
2145
2180
|
const signed = waiting?.signed ?? [];
|
|
@@ -2247,10 +2282,10 @@ function StepAction({
|
|
|
2247
2282
|
] });
|
|
2248
2283
|
}
|
|
2249
2284
|
if (fields.length && open === "form") {
|
|
2250
|
-
const errors =
|
|
2285
|
+
const errors = chunkXPQR2PJX_cjs.validateInputs(asForm(step), values);
|
|
2251
2286
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 p-1", "data-testid": tid, children: [
|
|
2252
2287
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2253
|
-
|
|
2288
|
+
chunkYZ25NAR3_cjs.SchemaForm,
|
|
2254
2289
|
{
|
|
2255
2290
|
fields,
|
|
2256
2291
|
values,
|
|
@@ -2318,7 +2353,7 @@ function requiredLabelsOf(workflow) {
|
|
|
2318
2353
|
return workflow.requiredLabels ?? [];
|
|
2319
2354
|
}
|
|
2320
2355
|
function unresolvedLabelRefs(workflow, ids = {}) {
|
|
2321
|
-
return
|
|
2356
|
+
return chunkI2LJ7RZ2_cjs.workflowSteps(workflow).flatMap(
|
|
2322
2357
|
(step) => step.kind === "action" && step.action.type === "tabular_review" ? step.action.tags.filter((t) => {
|
|
2323
2358
|
const key = labelRefKey(t);
|
|
2324
2359
|
return key !== void 0 && !ids[key];
|
|
@@ -3830,7 +3865,7 @@ var SKILL_FIELD_TYPE_LABELS = {
|
|
|
3830
3865
|
person: "A person"
|
|
3831
3866
|
};
|
|
3832
3867
|
function buildLibrarySkills(builtins, listings) {
|
|
3833
|
-
const { host, skills } =
|
|
3868
|
+
const { host, skills } = chunkXPQR2PJX_cjs.mergeSkillWorkflows(builtins, listings);
|
|
3834
3869
|
const builtinIds = new Set(builtins.map((w) => w.id));
|
|
3835
3870
|
const stored = new Map(listings.filter((s) => s.doc_ext_id).map((s) => [s.slug, s]));
|
|
3836
3871
|
return [...host, ...skills].flatMap((workflow) => {
|
|
@@ -4457,16 +4492,16 @@ var DEFAULT_RECURRENCE_BUILDER_LABELS = {
|
|
|
4457
4492
|
var pad2 = (n) => String(n).padStart(2, "0");
|
|
4458
4493
|
function RecurrenceBuilder({ rrule, onChange, testIds, labels }) {
|
|
4459
4494
|
const l = { ...DEFAULT_RECURRENCE_BUILDER_LABELS, ...labels };
|
|
4460
|
-
const [advanced, setAdvanced] = react.useState(() => !!rrule &&
|
|
4495
|
+
const [advanced, setAdvanced] = react.useState(() => !!rrule && chunk73ECBDG7_cjs.parseRRule(rrule) === null);
|
|
4461
4496
|
const [preset, setPreset] = react.useState(
|
|
4462
|
-
() =>
|
|
4497
|
+
() => chunk73ECBDG7_cjs.parseRRule(rrule) ?? chunk73ECBDG7_cjs.DEFAULT_RECURRENCE
|
|
4463
4498
|
);
|
|
4464
4499
|
react.useEffect(() => {
|
|
4465
|
-
if (!rrule) onChange(
|
|
4500
|
+
if (!rrule) onChange(chunk73ECBDG7_cjs.buildRRule(chunk73ECBDG7_cjs.DEFAULT_RECURRENCE));
|
|
4466
4501
|
}, []);
|
|
4467
4502
|
const update = (next) => {
|
|
4468
4503
|
setPreset(next);
|
|
4469
|
-
onChange(
|
|
4504
|
+
onChange(chunk73ECBDG7_cjs.buildRRule(next));
|
|
4470
4505
|
};
|
|
4471
4506
|
const toggleWeekday = (day) => {
|
|
4472
4507
|
const has = preset.weekdays.includes(day);
|
|
@@ -4496,9 +4531,9 @@ function RecurrenceBuilder({ rrule, onChange, testIds, labels }) {
|
|
|
4496
4531
|
type: "button",
|
|
4497
4532
|
className: "text-sm text-muted-foreground hover:text-foreground",
|
|
4498
4533
|
onClick: () => {
|
|
4499
|
-
const parsed =
|
|
4500
|
-
setPreset(parsed ??
|
|
4501
|
-
if (!parsed) onChange(
|
|
4534
|
+
const parsed = chunk73ECBDG7_cjs.parseRRule(rrule);
|
|
4535
|
+
setPreset(parsed ?? chunk73ECBDG7_cjs.DEFAULT_RECURRENCE);
|
|
4536
|
+
if (!parsed) onChange(chunk73ECBDG7_cjs.buildRRule(chunk73ECBDG7_cjs.DEFAULT_RECURRENCE));
|
|
4502
4537
|
setAdvanced(false);
|
|
4503
4538
|
},
|
|
4504
4539
|
"data-testid": chunkPLIF5CUV_cjs.testIdOr(testIds?.simple, { testId: "task-recurrence-simple" }),
|
|
@@ -4576,7 +4611,7 @@ function RecurrenceBuilder({ rrule, onChange, testIds, labels }) {
|
|
|
4576
4611
|
] }),
|
|
4577
4612
|
preset.frequency === "weekly" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
4578
4613
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { children: l.on }),
|
|
4579
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1", children:
|
|
4614
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1", children: chunk73ECBDG7_cjs.WEEKDAYS.map((day) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4580
4615
|
ui.Button,
|
|
4581
4616
|
{
|
|
4582
4617
|
type: "button",
|
|
@@ -6011,7 +6046,7 @@ function ConversationListView(p) {
|
|
|
6011
6046
|
}
|
|
6012
6047
|
),
|
|
6013
6048
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: liveProps.current.renderThread ? liveProps.current.renderThread(data) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
6014
|
-
|
|
6049
|
+
chunk73ECBDG7_cjs.EntityChip,
|
|
6015
6050
|
{
|
|
6016
6051
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "size-4", "aria-hidden": true }),
|
|
6017
6052
|
label: data.title?.trim() || "Untitled thread",
|
|
@@ -6380,13 +6415,13 @@ function NewThreadDialog({
|
|
|
6380
6415
|
...labels
|
|
6381
6416
|
};
|
|
6382
6417
|
const seed = react.useMemo(
|
|
6383
|
-
() => ({ ...
|
|
6418
|
+
() => ({ ...chunk7D4WXUBS_cjs.EMPTY_NEW_THREAD, ...initialValues }),
|
|
6384
6419
|
// Seeded once per open.
|
|
6385
6420
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6386
6421
|
[open]
|
|
6387
6422
|
);
|
|
6388
6423
|
const [values, setValues] = react.useState(seed);
|
|
6389
|
-
const [detailsOpen, setDetailsOpen] = react.useState(
|
|
6424
|
+
const [detailsOpen, setDetailsOpen] = react.useState(chunk7D4WXUBS_cjs.hasTaskFields(seed));
|
|
6390
6425
|
const [submitError, setSubmitError] = react.useState(null);
|
|
6391
6426
|
const id = chunkPLIF5CUV_cjs.testIdOr(testId, { testId: "new-thread" });
|
|
6392
6427
|
const set = (key, value) => setValues((v) => ({ ...v, [key]: value }));
|
|
@@ -6419,7 +6454,7 @@ function NewThreadDialog({
|
|
|
6419
6454
|
setSubmitError(null);
|
|
6420
6455
|
try {
|
|
6421
6456
|
await onSubmit(values);
|
|
6422
|
-
setValues(
|
|
6457
|
+
setValues(chunk7D4WXUBS_cjs.EMPTY_NEW_THREAD);
|
|
6423
6458
|
setDetailsOpen(false);
|
|
6424
6459
|
} catch (error) {
|
|
6425
6460
|
setSubmitError(error instanceof Error ? error.message : "Could not create the thread");
|
|
@@ -6667,12 +6702,12 @@ function taskActivityHeadline(e, labels = DEFAULT_TASK_ACTIVITY_LABELS, agentNam
|
|
|
6667
6702
|
case "step_skipped":
|
|
6668
6703
|
return "Step skipped";
|
|
6669
6704
|
case "step_waiting": {
|
|
6670
|
-
const documents =
|
|
6671
|
-
return documents ?
|
|
6705
|
+
const documents = chunkI2LJ7RZ2_cjs.eventWaitingDocuments(detail);
|
|
6706
|
+
return documents ? chunkI2LJ7RZ2_cjs.waitingForDocumentsText(documents.length) : "Waiting on people";
|
|
6672
6707
|
}
|
|
6673
6708
|
case "step_progress": {
|
|
6674
|
-
const documents =
|
|
6675
|
-
return documents ?
|
|
6709
|
+
const documents = chunkI2LJ7RZ2_cjs.eventWaitingDocuments(detail);
|
|
6710
|
+
return documents ? chunkI2LJ7RZ2_cjs.waitingForDocumentsText(documents.length) : detail.signed ? "Signed" : "Step moved on";
|
|
6676
6711
|
}
|
|
6677
6712
|
case "step_sent_back":
|
|
6678
6713
|
return "Sent the work back";
|
|
@@ -6827,10 +6862,10 @@ function WorkflowRunStatus({
|
|
|
6827
6862
|
testId = "workflow-run-status"
|
|
6828
6863
|
}) {
|
|
6829
6864
|
const l = { ...DEFAULT_WORKFLOW_RUN_STATUS_LABELS, ...labels };
|
|
6830
|
-
const ordered =
|
|
6831
|
-
const phaseOf = (id) => isLoading ? "blocked" :
|
|
6832
|
-
const finished = !isLoading &&
|
|
6833
|
-
const atId = finished || isLoading ? void 0 : activeStepId(
|
|
6865
|
+
const ordered = chunkI2LJ7RZ2_cjs.stepLevels(steps).flat();
|
|
6866
|
+
const phaseOf = (id) => isLoading ? "blocked" : chunkI2LJ7RZ2_cjs.stepPhase(steps, states, id);
|
|
6867
|
+
const finished = !isLoading && chunkI2LJ7RZ2_cjs.isRunFinished(steps, states);
|
|
6868
|
+
const atId = finished || isLoading ? void 0 : activeStepId(chunkI2LJ7RZ2_cjs.stepLevels(steps), phaseOf);
|
|
6834
6869
|
const at = ordered.find((s) => s.id === atId);
|
|
6835
6870
|
const phase = at ? phaseOf(at.id) : "done";
|
|
6836
6871
|
const assignee = at && ["ready", "waiting"].includes(phase) ? assigneeOf?.(at) : void 0;
|
|
@@ -6862,7 +6897,7 @@ function WorkflowRunStatus({
|
|
|
6862
6897
|
"span",
|
|
6863
6898
|
{
|
|
6864
6899
|
className: ui.cn(
|
|
6865
|
-
`wf-kind-${
|
|
6900
|
+
`wf-kind-${chunkKMOIE2XH_cjs.stepKindOf(s)}`,
|
|
6866
6901
|
"h-1.5 w-3 shrink-0 rounded-full",
|
|
6867
6902
|
SEGMENT[phaseOf(s.id)],
|
|
6868
6903
|
s.id === atId && "w-5"
|
|
@@ -6908,7 +6943,7 @@ function groupThreadActivity(steps, items) {
|
|
|
6908
6943
|
continue;
|
|
6909
6944
|
}
|
|
6910
6945
|
if (current === void 0) out.before.push(item);
|
|
6911
|
-
else if (
|
|
6946
|
+
else if (chunkI2LJ7RZ2_cjs.isRunFinished(steps, states)) out.after.push(item);
|
|
6912
6947
|
else {
|
|
6913
6948
|
const status = states[current]?.status;
|
|
6914
6949
|
const at = status === "done" || status === "skipped" ? steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? ""))?.id ?? current : current;
|
|
@@ -6931,9 +6966,9 @@ var DEFAULT_WORKFLOW_THREAD_STRIP_LABELS = {
|
|
|
6931
6966
|
after: "After",
|
|
6932
6967
|
beforeSteps: "Before the first step",
|
|
6933
6968
|
afterSteps: "After the last step",
|
|
6934
|
-
kinds:
|
|
6935
|
-
documents:
|
|
6936
|
-
record:
|
|
6969
|
+
kinds: chunkKMOIE2XH_cjs.DEFAULT_STEP_KIND_LABELS,
|
|
6970
|
+
documents: chunkKMOIE2XH_cjs.DEFAULT_STEP_DOCUMENT_LABELS,
|
|
6971
|
+
record: chunkKMOIE2XH_cjs.DEFAULT_STEP_RECORD_LABELS
|
|
6937
6972
|
};
|
|
6938
6973
|
function WorkflowThreadStartedBy({
|
|
6939
6974
|
origin,
|
|
@@ -7064,7 +7099,7 @@ function EntriesChip({
|
|
|
7064
7099
|
const latest = items.at(-1);
|
|
7065
7100
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
7066
7101
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7067
|
-
|
|
7102
|
+
chunkKMOIE2XH_cjs.StepChip,
|
|
7068
7103
|
{
|
|
7069
7104
|
kind,
|
|
7070
7105
|
phase: "ready",
|
|
@@ -7116,17 +7151,17 @@ function WorkflowThreadStrip({
|
|
|
7116
7151
|
onSelectStep?.(id);
|
|
7117
7152
|
};
|
|
7118
7153
|
const [open, setOpen] = react.useState(null);
|
|
7119
|
-
const phaseOf = (id) =>
|
|
7154
|
+
const phaseOf = (id) => chunkI2LJ7RZ2_cjs.stepPhase(steps, states, id);
|
|
7120
7155
|
const iconOf = (step) => step.icon && renderIcon ? renderIcon(step.icon) : void 0;
|
|
7121
7156
|
const glyphOf = (step) => {
|
|
7122
|
-
const KindIcon =
|
|
7157
|
+
const KindIcon = chunkKMOIE2XH_cjs.STEP_KIND_ICONS[chunkKMOIE2XH_cjs.stepKindOf(step)];
|
|
7123
7158
|
return iconOf(step) ?? /* @__PURE__ */ jsxRuntime.jsx(KindIcon, {});
|
|
7124
7159
|
};
|
|
7125
7160
|
const waitingOf = (id) => {
|
|
7126
7161
|
const step = steps.find((s) => s.id === id);
|
|
7127
7162
|
const phase = phaseOf(id);
|
|
7128
|
-
const documents =
|
|
7129
|
-
if (documents.length) return
|
|
7163
|
+
const documents = chunkI2LJ7RZ2_cjs.waitingDocuments(states[id]);
|
|
7164
|
+
if (documents.length) return chunkI2LJ7RZ2_cjs.waitingForDocumentsText(documents.length);
|
|
7130
7165
|
const name = step && (phase === "ready" || phase === "waiting") ? assigneeOf?.(step) : void 0;
|
|
7131
7166
|
return name ? l.waitingFor.replace("{name}", name) : void 0;
|
|
7132
7167
|
};
|
|
@@ -7136,8 +7171,8 @@ function WorkflowThreadStrip({
|
|
|
7136
7171
|
const assignee = phase === "ready" || phase === "waiting" ? assigneeOf?.(step) : void 0;
|
|
7137
7172
|
const waiting = waitingOf(step.id);
|
|
7138
7173
|
const sentBack = states[step.id]?.sentBack;
|
|
7139
|
-
const kind =
|
|
7140
|
-
const documents =
|
|
7174
|
+
const kind = chunkKMOIE2XH_cjs.stepKindOf(step);
|
|
7175
|
+
const documents = chunkKMOIE2XH_cjs.stepDocuments(steps, states, step.id);
|
|
7141
7176
|
const latestDoc = onOpenDocument ? documents.at(-1) : void 0;
|
|
7142
7177
|
const finished = ["done", "skipped", "failed"].includes(phase);
|
|
7143
7178
|
const chip = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7150,7 +7185,7 @@ function WorkflowThreadStrip({
|
|
|
7150
7185
|
},
|
|
7151
7186
|
children: [
|
|
7152
7187
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7153
|
-
|
|
7188
|
+
chunkKMOIE2XH_cjs.StepChip,
|
|
7154
7189
|
{
|
|
7155
7190
|
kind,
|
|
7156
7191
|
phase,
|
|
@@ -7199,7 +7234,7 @@ function WorkflowThreadStrip({
|
|
|
7199
7234
|
),
|
|
7200
7235
|
sentBack && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs text-amber-700 dark:text-amber-300", children: l.sentBack }),
|
|
7201
7236
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7202
|
-
|
|
7237
|
+
chunkKMOIE2XH_cjs.StepDocumentCards,
|
|
7203
7238
|
{
|
|
7204
7239
|
refs: documents,
|
|
7205
7240
|
heading: step.kind === "review" ? phase === "done" ? l.documents.approved : l.documents.toApprove : l.documents.produced,
|
|
@@ -7210,7 +7245,7 @@ function WorkflowThreadStrip({
|
|
|
7210
7245
|
}
|
|
7211
7246
|
),
|
|
7212
7247
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7213
|
-
|
|
7248
|
+
chunkKMOIE2XH_cjs.StepRecord,
|
|
7214
7249
|
{
|
|
7215
7250
|
step,
|
|
7216
7251
|
state: states[step.id],
|
|
@@ -7242,10 +7277,10 @@ function WorkflowThreadStrip({
|
|
|
7242
7277
|
return latestDoc ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center", children: [
|
|
7243
7278
|
chip,
|
|
7244
7279
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7245
|
-
|
|
7280
|
+
chunkKMOIE2XH_cjs.StepDocumentButton,
|
|
7246
7281
|
{
|
|
7247
7282
|
kind,
|
|
7248
|
-
name: nameOfDoc?.(
|
|
7283
|
+
name: nameOfDoc?.(chunkI2LJ7RZ2_cjs.splitDocRef(latestDoc).id) ?? latestDoc,
|
|
7249
7284
|
onOpen: () => onOpenDocument?.(latestDoc),
|
|
7250
7285
|
testId: `workflow-thread-step-${step.id}-open-document`
|
|
7251
7286
|
}
|
|
@@ -7278,17 +7313,17 @@ function WorkflowThreadStrip({
|
|
|
7278
7313
|
),
|
|
7279
7314
|
strays.map((s) => /* @__PURE__ */ jsxRuntime.jsx(SignalPill, { signal: s, l }, `${s.step}-${s.signal}`))
|
|
7280
7315
|
] }) : null;
|
|
7281
|
-
const at = steps.find((s) => s.id === (selected ?? activeStepId(
|
|
7282
|
-
const headingPx = (step) => `${l.kinds[
|
|
7316
|
+
const at = steps.find((s) => s.id === (selected ?? activeStepId(chunkI2LJ7RZ2_cjs.stepLevels(steps), phaseOf)));
|
|
7317
|
+
const headingPx = (step) => `${l.kinds[chunkKMOIE2XH_cjs.stepKindOf(step)]} \xB7 ${waitingOf(step.id) ?? ""}`.length * 5.6 - step.title.length * 6.5;
|
|
7283
7318
|
const reserve = {
|
|
7284
|
-
always: (at ? Math.max(0, headingPx(at)) : 0) + steps.filter((s) => grouped.byStep[s.id]?.length).length * BEADS_PX + (onOpenDocument ? steps.filter((s) =>
|
|
7319
|
+
always: (at ? Math.max(0, headingPx(at)) : 0) + steps.filter((s) => grouped.byStep[s.id]?.length).length * BEADS_PX + (onOpenDocument ? steps.filter((s) => chunkKMOIE2XH_cjs.stepDocuments(steps, states, s.id).length).length * DOC_BUTTON_PX : 0),
|
|
7285
7320
|
leading: leading ? 150 : 0,
|
|
7286
7321
|
trailing: trailing ? 120 : 0
|
|
7287
7322
|
};
|
|
7288
7323
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("min-w-0 flex-1", className), "data-testid": "workflow-thread-strip", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7289
7324
|
StepBarFrame,
|
|
7290
7325
|
{
|
|
7291
|
-
levels:
|
|
7326
|
+
levels: chunkI2LJ7RZ2_cjs.stepLevels(steps),
|
|
7292
7327
|
phaseOf,
|
|
7293
7328
|
current: selected,
|
|
7294
7329
|
onSelect: (id) => {
|
|
@@ -7302,7 +7337,7 @@ function WorkflowThreadStrip({
|
|
|
7302
7337
|
reservePx: reserve,
|
|
7303
7338
|
maxSpan,
|
|
7304
7339
|
icon: glyphOf,
|
|
7305
|
-
kindOf:
|
|
7340
|
+
kindOf: chunkKMOIE2XH_cjs.stepKindOf,
|
|
7306
7341
|
labels: { waitingFor: l.waitingFor, ...barLabels },
|
|
7307
7342
|
tid: (suffix) => `workflow-thread-${suffix}`
|
|
7308
7343
|
}
|
|
@@ -7547,7 +7582,7 @@ function defaultTaskComposerValues(workflows, initial) {
|
|
|
7547
7582
|
return {
|
|
7548
7583
|
assignee: "me",
|
|
7549
7584
|
workflowId,
|
|
7550
|
-
inputs: workflow ? { ...
|
|
7585
|
+
inputs: workflow ? { ...chunkXPQR2PJX_cjs.defaultInputs(workflow), ...initial?.inputs } : { ...initial?.inputs },
|
|
7551
7586
|
when: "manual",
|
|
7552
7587
|
runAt: "",
|
|
7553
7588
|
rrule: "",
|
|
@@ -7655,19 +7690,19 @@ function WorkflowComposer({
|
|
|
7655
7690
|
return !docs?.length;
|
|
7656
7691
|
})
|
|
7657
7692
|
);
|
|
7658
|
-
const whatMissing = !workflow || Object.keys(
|
|
7693
|
+
const whatMissing = !workflow || Object.keys(chunkXPQR2PJX_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs)).length > 0;
|
|
7659
7694
|
const runAtPast = values.when === "once" && values.runAt !== "" && values.runAt !== initialValues?.runAt && new Date(values.runAt).getTime() <= Date.now();
|
|
7660
7695
|
const whenMissing = missingWhen(values, runAtPast);
|
|
7661
7696
|
const scheduled = values.when !== "now" && values.when !== "manual";
|
|
7662
7697
|
const agentMissing = scheduled && values.agentId === "";
|
|
7663
7698
|
const canSubmit = !whatMissing && !noFiles && whenMissing === null && !agentMissing && !isPending && !planDrafting;
|
|
7664
|
-
const derivedName = workflow ?
|
|
7699
|
+
const derivedName = workflow ? chunk7D4WXUBS_cjs.deriveWorkflowName(workflow, values.inputs) : "";
|
|
7665
7700
|
const pickWorkflow = (next) => {
|
|
7666
7701
|
const def = workflows.find((w) => w.id === next);
|
|
7667
7702
|
setValues({
|
|
7668
7703
|
...values,
|
|
7669
7704
|
workflowId: next,
|
|
7670
|
-
inputs: def ?
|
|
7705
|
+
inputs: def ? chunkXPQR2PJX_cjs.defaultInputs(def) : {},
|
|
7671
7706
|
...def?.documentAction ? { access: "standing" } : {}
|
|
7672
7707
|
});
|
|
7673
7708
|
};
|
|
@@ -7805,7 +7840,7 @@ function WorkflowComposer({
|
|
|
7805
7840
|
}
|
|
7806
7841
|
),
|
|
7807
7842
|
!noFiles && workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7808
|
-
|
|
7843
|
+
chunkYZ25NAR3_cjs.SchemaForm,
|
|
7809
7844
|
{
|
|
7810
7845
|
fields,
|
|
7811
7846
|
values: values.inputs,
|
|
@@ -8243,7 +8278,7 @@ function WorkTaskComposer({
|
|
|
8243
8278
|
}, [open]);
|
|
8244
8279
|
const workflow = workflows.find((w) => w.id === values.workflowId);
|
|
8245
8280
|
const fields = workflow?.inputs ?? [];
|
|
8246
|
-
const errors = workflow ?
|
|
8281
|
+
const errors = workflow ? chunkXPQR2PJX_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs) : {};
|
|
8247
8282
|
const hasWork = configOpen && Boolean(workflow) && Object.keys(errors).length === 0;
|
|
8248
8283
|
const unattended = hasWork && values.when !== "now" && values.when !== "manual";
|
|
8249
8284
|
const canConfigure = !isEdit || seed.assignee === "agent";
|
|
@@ -8251,7 +8286,7 @@ function WorkTaskComposer({
|
|
|
8251
8286
|
const set = (key, value) => setValues({ ...values, [key]: value });
|
|
8252
8287
|
const pickWorkflow = (id2) => {
|
|
8253
8288
|
const next = workflows.find((w) => w.id === id2);
|
|
8254
|
-
setValues({ ...values, workflowId: id2, inputs: next ?
|
|
8289
|
+
setValues({ ...values, workflowId: id2, inputs: next ? chunkXPQR2PJX_cjs.defaultInputs(next) : {} });
|
|
8255
8290
|
};
|
|
8256
8291
|
const openConfigure = () => {
|
|
8257
8292
|
setConfigOpen(true);
|
|
@@ -8437,7 +8472,7 @@ function WorkTaskComposer({
|
|
|
8437
8472
|
)
|
|
8438
8473
|
] }),
|
|
8439
8474
|
workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8440
|
-
|
|
8475
|
+
chunkYZ25NAR3_cjs.SchemaForm,
|
|
8441
8476
|
{
|
|
8442
8477
|
fields,
|
|
8443
8478
|
values: values.inputs,
|
|
@@ -10045,5 +10080,5 @@ exports.useWorkflowView = useWorkflowView;
|
|
|
10045
10080
|
exports.withLabelIds = withLabelIds;
|
|
10046
10081
|
exports.workflowFromSkillMarkdown = workflowFromSkillMarkdown;
|
|
10047
10082
|
exports.workflowToSkillMarkdown = workflowToSkillMarkdown;
|
|
10048
|
-
//# sourceMappingURL=chunk-
|
|
10049
|
-
//# sourceMappingURL=chunk-
|
|
10083
|
+
//# sourceMappingURL=chunk-UKAN76CS.cjs.map
|
|
10084
|
+
//# sourceMappingURL=chunk-UKAN76CS.cjs.map
|