@arbidocs/blocks 0.4.136 → 0.4.137

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.
Files changed (128) hide show
  1. package/dist/agents/index.cjs +380 -373
  2. package/dist/agents/index.js +11 -12
  3. package/dist/agents/workflows/WorkflowDocumentsField.d.ts +42 -5
  4. package/dist/agents/workflows/index.d.ts +2 -2
  5. package/dist/agents/workflows/workspaceScope.d.ts +12 -0
  6. package/dist/calls/index.cjs +3 -3
  7. package/dist/calls/index.js +2 -2
  8. package/dist/chat/index.cjs +139 -139
  9. package/dist/chat/index.js +4 -4
  10. package/dist/chunk-2KUCVSFF.js +51 -0
  11. package/dist/chunk-2KUCVSFF.js.map +1 -0
  12. package/dist/{chunk-3FFRYZKV.js → chunk-3RJN2VTL.js} +36 -6
  13. package/dist/chunk-3RJN2VTL.js.map +1 -0
  14. package/dist/{chunk-OWCEQKAR.cjs → chunk-6F7SZCVL.cjs} +3 -3
  15. package/dist/{chunk-OWCEQKAR.cjs.map → chunk-6F7SZCVL.cjs.map} +1 -1
  16. package/dist/{chunk-JO3EMZ4X.js → chunk-7M4C6CK7.js} +3 -3
  17. package/dist/{chunk-JO3EMZ4X.js.map → chunk-7M4C6CK7.js.map} +1 -1
  18. package/dist/{chunk-OR4CO743.cjs → chunk-AAFX64WD.cjs} +3 -3
  19. package/dist/{chunk-OR4CO743.cjs.map → chunk-AAFX64WD.cjs.map} +1 -1
  20. package/dist/{chunk-IQU2GI6V.js → chunk-ATJUVHVB.js} +1301 -8
  21. package/dist/chunk-ATJUVHVB.js.map +1 -0
  22. package/dist/{chunk-OAL3B2ZU.cjs → chunk-BUNZWOPX.cjs} +5 -5
  23. package/dist/{chunk-OAL3B2ZU.cjs.map → chunk-BUNZWOPX.cjs.map} +1 -1
  24. package/dist/{chunk-N55UIXVT.cjs → chunk-C3ZRLULA.cjs} +5 -5
  25. package/dist/{chunk-N55UIXVT.cjs.map → chunk-C3ZRLULA.cjs.map} +1 -1
  26. package/dist/{chunk-LIHRGG4M.cjs → chunk-CHVCTKF4.cjs} +1365 -49
  27. package/dist/chunk-CHVCTKF4.cjs.map +1 -0
  28. package/dist/chunk-CQCC7LE7.js +210 -0
  29. package/dist/chunk-CQCC7LE7.js.map +1 -0
  30. package/dist/{chunk-ZAVEMQ37.cjs → chunk-DWZXSPMB.cjs} +3 -3
  31. package/dist/{chunk-ZAVEMQ37.cjs.map → chunk-DWZXSPMB.cjs.map} +1 -1
  32. package/dist/{chunk-VIU7AMHF.js → chunk-E5OYHJMU.js} +3 -3
  33. package/dist/{chunk-VIU7AMHF.js.map → chunk-E5OYHJMU.js.map} +1 -1
  34. package/dist/{chunk-7YLJHTDC.cjs → chunk-EHOPZBAX.cjs} +11 -11
  35. package/dist/{chunk-7YLJHTDC.cjs.map → chunk-EHOPZBAX.cjs.map} +1 -1
  36. package/dist/{chunk-5HFPRI3W.js → chunk-FUTMU4FR.js} +3 -3
  37. package/dist/{chunk-5HFPRI3W.js.map → chunk-FUTMU4FR.js.map} +1 -1
  38. package/dist/{chunk-IE5CUCZK.cjs → chunk-HDYWXEQU.cjs} +4 -4
  39. package/dist/{chunk-IE5CUCZK.cjs.map → chunk-HDYWXEQU.cjs.map} +1 -1
  40. package/dist/{chunk-C44D4WFG.cjs → chunk-HLB4DIYV.cjs} +3 -3
  41. package/dist/{chunk-C44D4WFG.cjs.map → chunk-HLB4DIYV.cjs.map} +1 -1
  42. package/dist/{chunk-OZLWSNUC.cjs → chunk-JY73DJOS.cjs} +80 -1232
  43. package/dist/chunk-JY73DJOS.cjs.map +1 -0
  44. package/dist/{chunk-LT2X5N37.js → chunk-KMNZ2RVO.js} +19 -1152
  45. package/dist/chunk-KMNZ2RVO.js.map +1 -0
  46. package/dist/{chunk-6S5FLMWG.js → chunk-KSHKTOY2.js} +203 -7
  47. package/dist/chunk-KSHKTOY2.js.map +1 -0
  48. package/dist/{chunk-ZNI4SW2G.js → chunk-L3T7OJRX.js} +3 -3
  49. package/dist/{chunk-ZNI4SW2G.js.map → chunk-L3T7OJRX.js.map} +1 -1
  50. package/dist/{chunk-RUB62J2X.js → chunk-M33QUNFH.js} +3 -3
  51. package/dist/{chunk-RUB62J2X.js.map → chunk-M33QUNFH.js.map} +1 -1
  52. package/dist/{chunk-DJM7DLCT.cjs → chunk-OPTBQSCV.cjs} +3 -3
  53. package/dist/{chunk-DJM7DLCT.cjs.map → chunk-OPTBQSCV.cjs.map} +1 -1
  54. package/dist/{chunk-GFYGYME3.js → chunk-OQ7RUNOC.js} +3 -3
  55. package/dist/{chunk-GFYGYME3.js.map → chunk-OQ7RUNOC.js.map} +1 -1
  56. package/dist/chunk-RFIBUWLF.cjs +232 -0
  57. package/dist/chunk-RFIBUWLF.cjs.map +1 -0
  58. package/dist/{chunk-N26CXGXC.cjs → chunk-RQ2Y7USX.cjs} +201 -3
  59. package/dist/chunk-RQ2Y7USX.cjs.map +1 -0
  60. package/dist/chunk-UUHUQHXR.cjs +56 -0
  61. package/dist/chunk-UUHUQHXR.cjs.map +1 -0
  62. package/dist/{chunk-ECERC6TI.js → chunk-VHJHY7TT.js} +3 -3
  63. package/dist/{chunk-ECERC6TI.js.map → chunk-VHJHY7TT.js.map} +1 -1
  64. package/dist/{chunk-5BXEYYH6.js → chunk-VMESMX7N.js} +3 -3
  65. package/dist/{chunk-5BXEYYH6.js.map → chunk-VMESMX7N.js.map} +1 -1
  66. package/dist/{chunk-44R3CCZT.cjs → chunk-WS5EX7DN.cjs} +37 -6
  67. package/dist/chunk-WS5EX7DN.cjs.map +1 -0
  68. package/dist/{chunk-Y5KTM3V5.js → chunk-YOMPLCP6.js} +3 -3
  69. package/dist/{chunk-Y5KTM3V5.js.map → chunk-YOMPLCP6.js.map} +1 -1
  70. package/dist/collaboration/index.cjs +51 -51
  71. package/dist/collaboration/index.js +3 -3
  72. package/dist/connect/docx.cjs +5 -5
  73. package/dist/connect/docx.js +4 -4
  74. package/dist/connect/index.cjs +353 -76
  75. package/dist/connect/index.cjs.map +1 -1
  76. package/dist/connect/index.d.ts +3 -0
  77. package/dist/connect/index.js +274 -20
  78. package/dist/connect/index.js.map +1 -1
  79. package/dist/connection/ConnectedWorkflowBuilder.d.ts +1 -1
  80. package/dist/connection/ConnectedWorkflowLauncher.d.ts +35 -0
  81. package/dist/connection/ConnectedWorkflowsTable.d.ts +62 -0
  82. package/dist/connection/workspaceData.d.ts +45 -0
  83. package/dist/document-tools/index.cjs +1 -1
  84. package/dist/document-tools/index.js +1 -1
  85. package/dist/facts/index.cjs +4 -4
  86. package/dist/facts/index.js +4 -4
  87. package/dist/files/index.cjs +3 -3
  88. package/dist/files/index.js +3 -3
  89. package/dist/home/index.cjs +22 -23
  90. package/dist/home/index.cjs.map +1 -1
  91. package/dist/home/index.js +4 -5
  92. package/dist/home/index.js.map +1 -1
  93. package/dist/index.cjs +733 -726
  94. package/dist/index.cjs.map +1 -1
  95. package/dist/index.js +20 -21
  96. package/dist/index.js.map +1 -1
  97. package/dist/retrieval/index.cjs +1 -1
  98. package/dist/retrieval/index.js +1 -1
  99. package/dist/settings/index.cjs +56 -56
  100. package/dist/settings/index.js +6 -6
  101. package/dist/shell/index.cjs +2 -2
  102. package/dist/shell/index.js +2 -2
  103. package/dist/site/index.cjs +5 -5
  104. package/dist/site/index.js +1 -1
  105. package/dist/studio/index.cjs +8 -8
  106. package/dist/studio/index.js +7 -7
  107. package/dist/workflow-canvas/index.cjs +73 -71
  108. package/dist/workflow-canvas/index.cjs.map +1 -1
  109. package/dist/workflow-canvas/index.js +23 -21
  110. package/dist/workflow-canvas/index.js.map +1 -1
  111. package/node_modules/@arbidocs/coedit/package.json +1 -1
  112. package/package.json +4 -4
  113. package/dist/chunk-3FFRYZKV.js.map +0 -1
  114. package/dist/chunk-44R3CCZT.cjs.map +0 -1
  115. package/dist/chunk-4XJZ6AAY.js +0 -407
  116. package/dist/chunk-4XJZ6AAY.js.map +0 -1
  117. package/dist/chunk-6S5FLMWG.js.map +0 -1
  118. package/dist/chunk-7D737FLE.cjs +0 -43
  119. package/dist/chunk-7D737FLE.cjs.map +0 -1
  120. package/dist/chunk-IQU2GI6V.js.map +0 -1
  121. package/dist/chunk-LIHRGG4M.cjs.map +0 -1
  122. package/dist/chunk-LT2X5N37.js.map +0 -1
  123. package/dist/chunk-N26CXGXC.cjs.map +0 -1
  124. package/dist/chunk-OZLWSNUC.cjs.map +0 -1
  125. package/dist/chunk-S5HZBXZA.cjs +0 -430
  126. package/dist/chunk-S5HZBXZA.cjs.map +0 -1
  127. package/dist/chunk-XD2M6LIG.js +0 -41
  128. package/dist/chunk-XD2M6LIG.js.map +0 -1
@@ -1,314 +1,35 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk44R3CCZT_cjs = require('./chunk-44R3CCZT.cjs');
5
- var chunkS5HZBXZA_cjs = require('./chunk-S5HZBXZA.cjs');
6
- var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
7
- var chunkLIHRGG4M_cjs = require('./chunk-LIHRGG4M.cjs');
8
- var chunk7D737FLE_cjs = require('./chunk-7D737FLE.cjs');
9
- var chunkN26CXGXC_cjs = require('./chunk-N26CXGXC.cjs');
10
4
  var chunk3AFWGEDJ_cjs = require('./chunk-3AFWGEDJ.cjs');
5
+ var chunkRFIBUWLF_cjs = require('./chunk-RFIBUWLF.cjs');
11
6
  var chunkDVUZTGVL_cjs = require('./chunk-DVUZTGVL.cjs');
7
+ var chunkCHVCTKF4_cjs = require('./chunk-CHVCTKF4.cjs');
8
+ var chunkRQ2Y7USX_cjs = require('./chunk-RQ2Y7USX.cjs');
9
+ var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
10
+ var chunkWS5EX7DN_cjs = require('./chunk-WS5EX7DN.cjs');
12
11
  var chunkR26BK7YL_cjs = require('./chunk-R26BK7YL.cjs');
13
12
  var chunkV4ISCZJ7_cjs = require('./chunk-V4ISCZJ7.cjs');
14
13
  var chunk2EI7NCUA_cjs = require('./chunk-2EI7NCUA.cjs');
15
14
  var chunkC2CWWEHO_cjs = require('./chunk-C2CWWEHO.cjs');
16
15
  var chunk7RGLTF76_cjs = require('./chunk-7RGLTF76.cjs');
17
- var chunkC4WSHRR6_cjs = require('./chunk-C4WSHRR6.cjs');
18
- var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
19
- var chunkOWCEQKAR_cjs = require('./chunk-OWCEQKAR.cjs');
16
+ var chunk6F7SZCVL_cjs = require('./chunk-6F7SZCVL.cjs');
20
17
  var chunk7UTB4PHM_cjs = require('./chunk-7UTB4PHM.cjs');
21
18
  var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
22
19
  var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
20
+ var chunkC4WSHRR6_cjs = require('./chunk-C4WSHRR6.cjs');
21
+ var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
23
22
  var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
24
- var react = require('react');
25
- var ui = require('@arbidocs/react/ui');
26
23
  var jsxRuntime = require('react/jsx-runtime');
24
+ var react = require('react');
27
25
  var lucideReact = require('lucide-react');
26
+ var ui = require('@arbidocs/react/ui');
28
27
 
29
- function useControllableState(value, defaultValue, onChange) {
30
- const [inner, setInner] = react.useState(defaultValue);
31
- const isControlled = value !== void 0;
32
- const current = isControlled ? value : inner;
33
- const onChangeRef = react.useRef(onChange);
34
- onChangeRef.current = onChange;
35
- const set = react.useCallback(
36
- (next) => {
37
- if (!isControlled) setInner(next);
38
- onChangeRef.current?.(next);
39
- },
40
- [isControlled]
41
- );
42
- return [current, set];
43
- }
44
- var DEFAULT_AGENT_SELECT_LABELS = {
45
- label: "Run as",
46
- myAssistant: "My assistant"
47
- };
48
- var ME = "__me__";
49
- function AgentSelect({
50
- agents,
51
- value,
52
- defaultValue = "",
53
- onValueChange,
54
- hideLabel,
55
- disabled,
56
- className,
57
- labels,
58
- testId,
59
- optionTestId
60
- }) {
61
- const l = { ...DEFAULT_AGENT_SELECT_LABELS, ...labels };
62
- const triggerId = react.useId();
63
- const [current, setCurrent] = useControllableState(value, defaultValue, onValueChange);
64
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex flex-col gap-1.5", className), "data-slot": "agent-select", children: [
65
- /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: triggerId, className: hideLabel ? "sr-only" : void 0, children: l.label }),
66
- /* @__PURE__ */ jsxRuntime.jsxs(
67
- ui.Select,
68
- {
69
- value: current === "" ? ME : current,
70
- onValueChange: (v) => setCurrent(v === ME ? "" : v),
71
- disabled,
72
- children: [
73
- /* @__PURE__ */ jsxRuntime.jsx(
74
- ui.SelectTrigger,
75
- {
76
- id: triggerId,
77
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "agent-select" }),
78
- className: "pointer-coarse:min-h-11",
79
- children: /* @__PURE__ */ jsxRuntime.jsx(ui.SelectValue, {})
80
- }
81
- ),
82
- /* @__PURE__ */ jsxRuntime.jsxs(ui.SelectContent, { children: [
83
- /* @__PURE__ */ jsxRuntime.jsx(
84
- ui.SelectItem,
85
- {
86
- value: ME,
87
- "data-testid": chunkMHVNT4J3_cjs.prefixedTestId(optionTestId, "me", {
88
- testId: "agent-select-option-me"
89
- }),
90
- children: l.myAssistant
91
- }
92
- ),
93
- agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(
94
- ui.SelectItem,
95
- {
96
- value: agent.id,
97
- "data-testid": chunkMHVNT4J3_cjs.prefixedTestId(optionTestId, agent.id, {
98
- testId: `agent-select-option-${agent.id}`
99
- }),
100
- children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
101
- agent.avatar,
102
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: agent.label }),
103
- agent.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: agent.description })
104
- ] })
105
- },
106
- agent.id
107
- ))
108
- ] })
109
- ]
110
- }
111
- )
112
- ] });
113
- }
114
- var DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS = {
115
- start: "Start",
116
- starting: "Starting\u2026",
117
- addFilesReason: "This reads your files, and there is nothing to read yet.",
118
- agentLabel: "Run as"
119
- };
120
- function WorkflowConfigDialog({
121
- workflow,
122
- open,
123
- onOpenChange,
124
- onLaunch,
125
- initialInputs,
126
- inputs: inputsProp,
127
- onInputsChange,
128
- scopeSource,
129
- renderScope,
130
- renderDocuments,
131
- renderIcon,
132
- addFilesAction,
133
- agents,
134
- agentId: agentIdProp,
135
- onAgentChange,
136
- isLaunching,
137
- submitLabel,
138
- fieldPlaceholder,
139
- renderNotice,
140
- labels,
141
- formLabels,
142
- agentLabels,
143
- testId,
144
- startTestId,
145
- className
146
- }) {
147
- const l = { ...DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, ...labels };
148
- const initialKey = JSON.stringify(initialInputs ?? {});
149
- const seedKey = JSON.stringify({ ...chunkOWCEQKAR_cjs.defaultInputs(workflow), ...JSON.parse(initialKey) });
150
- const seed = react.useMemo(() => JSON.parse(seedKey), [seedKey]);
151
- const [inputs, setInputs] = useControllableState(inputsProp, seed, onInputsChange);
152
- const [agentId, setAgentId] = useControllableState(
153
- agentIdProp,
154
- workflow.defaultAgentId ?? "",
155
- onAgentChange
156
- );
157
- react.useEffect(() => {
158
- if (open && inputsProp === void 0) setInputs(seed);
159
- }, [open, seed]);
160
- const setField = (name, value) => setInputs({ ...inputs, [name]: value });
161
- const errors = chunkOWCEQKAR_cjs.validateInputs(workflow, inputs);
162
- const valid = Object.keys(errors).length === 0;
163
- const visibleErrors = Object.fromEntries(
164
- Object.entries(errors).filter(([, e]) => e !== "required")
165
- );
166
- const scopeField = workflow.inputs.find((f) => f.type === "scope");
167
- const rawScope = scopeField ? inputs[scopeField.name] : void 0;
168
- const scopeValue = rawScope && typeof rawScope === "object" ? rawScope : { folders: [], labels: [] };
169
- const matchedCount = scopeSource && scopeField ? scopeSource.countMatching(scopeValue) : null;
170
- const noFiles = Boolean(workflow.requiresFiles && scopeSource && scopeSource.totalCount === 0);
171
- const blockedByScope = matchedCount !== null && matchedCount === 0 && Boolean(workflow.requiresFiles);
172
- const showAgent = workflow.run.kind === "prompt" && workflow.options?.agent !== false && agents !== void 0 && agents.length > 0;
173
- const launch = (values) => {
174
- Promise.resolve(onLaunch(chunkOWCEQKAR_cjs.buildLaunch(workflow, values, agentId))).catch(() => {
175
- });
176
- };
177
- const submit = () => {
178
- if (!valid || noFiles || blockedByScope || isLaunching) return;
179
- launch(inputs);
180
- };
181
- const fields = react.useMemo(
182
- () => workflow.inputs.map((f) => {
183
- const placeholder = fieldPlaceholder?.(f, inputs, workflow);
184
- return placeholder === void 0 ? f : { ...f, placeholder };
185
- }),
186
- [workflow, fieldPlaceholder, inputs]
187
- );
188
- const id = chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "workflow-dialog" });
189
- const formRef = react.useRef(null);
190
- const firstField = workflow.inputs.find((f) => !f.advanced);
191
- const focusPromptFirst = firstField?.type === "text" || firstField?.type === "longtext";
192
- const defaultScopeRender = scopeSource ? (_field, value, onChange) => /* @__PURE__ */ jsxRuntime.jsx(
193
- chunk44R3CCZT_cjs.ScopePicker,
194
- {
195
- folders: scopeSource.folders,
196
- unfiledCount: scopeSource.unfiledCount,
197
- labels: scopeSource.labels,
198
- totalCount: scopeSource.totalCount,
199
- matchedCount: scopeSource.countMatching(value),
200
- scope: value,
201
- onScopeChange: onChange
202
- }
203
- ) : void 0;
204
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
205
- ui.DialogContent,
206
- {
207
- presentation: "sheet",
208
- className: `max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-xl ${className ?? ""}`,
209
- "data-testid": id,
210
- "data-workflow": workflow.id,
211
- onOpenAutoFocus: (event) => {
212
- if (!focusPromptFirst || !firstField) return;
213
- const control = formRef.current?.querySelector(
214
- `[data-testid="${id}-field-${firstField.name}"]`
215
- );
216
- if (!control) return;
217
- event.preventDefault();
218
- control.focus();
219
- if (control instanceof HTMLInputElement || control instanceof HTMLTextAreaElement) {
220
- const end = control.value.length;
221
- control.setSelectionRange(end, end);
222
- }
223
- },
224
- children: [
225
- /* @__PURE__ */ jsxRuntime.jsx(
226
- chunk44R3CCZT_cjs.QuickActionDialogHeader,
227
- {
228
- icon: workflow.icon && renderIcon ? renderIcon(workflow.icon) : null,
229
- title: workflow.title,
230
- description: workflow.details ?? workflow.description,
231
- descriptionTestId: `${id}-description`
232
- }
233
- ),
234
- /* @__PURE__ */ jsxRuntime.jsx(
235
- "form",
236
- {
237
- ref: formRef,
238
- className: "mt-2 flex flex-col gap-4",
239
- onSubmit: (event) => {
240
- event.preventDefault();
241
- submit();
242
- },
243
- children: noFiles ? /* @__PURE__ */ jsxRuntime.jsx(
244
- chunk44R3CCZT_cjs.AddFilesFirst,
245
- {
246
- reason: l.addFilesReason,
247
- action: addFilesAction,
248
- testId: `${id}-empty-state`
249
- }
250
- ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
251
- /* @__PURE__ */ jsxRuntime.jsx(
252
- chunkLIHRGG4M_cjs.SchemaForm,
253
- {
254
- fields,
255
- values: inputs,
256
- onChange: setField,
257
- errors: visibleErrors,
258
- renderScope: renderScope ?? defaultScopeRender,
259
- renderDocuments,
260
- renderIcon,
261
- labels: formLabels,
262
- onEnterSubmit: submit,
263
- testIdPrefix: `${id}-field`
264
- }
265
- ),
266
- renderNotice?.({ workflow, inputs }),
267
- /* @__PURE__ */ jsxRuntime.jsxs(
268
- "div",
269
- {
270
- className: "flex flex-col gap-3 border-t border-border pt-3 sm:flex-row sm:items-end sm:justify-between",
271
- "data-slot": "workflow-footer",
272
- children: [
273
- showAgent ? /* @__PURE__ */ jsxRuntime.jsx(
274
- AgentSelect,
275
- {
276
- agents: agents ?? [],
277
- value: agentId,
278
- onValueChange: setAgentId,
279
- labels: { label: l.agentLabel, ...agentLabels },
280
- testId: `${id}-agent`,
281
- className: "sm:w-56"
282
- }
283
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
284
- /* @__PURE__ */ jsxRuntime.jsxs(
285
- ui.Button,
286
- {
287
- type: "submit",
288
- className: "gap-1.5 px-5 pointer-coarse:min-h-11",
289
- disabled: !valid || blockedByScope || isLaunching,
290
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(startTestId, { testId: "workflow-start-button" }),
291
- children: [
292
- isLaunching ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-4" }),
293
- isLaunching ? l.starting : submitLabel?.({ workflow, inputs, matchedCount }) ?? workflow.startLabel ?? l.start
294
- ]
295
- }
296
- )
297
- ]
298
- }
299
- )
300
- ] })
301
- }
302
- )
303
- ]
304
- }
305
- ) });
306
- }
307
28
  function defaultScopeRenderer(scopeSource) {
308
29
  if (!scopeSource) return void 0;
309
30
  return function renderScope(_field, value, onChange) {
310
31
  return /* @__PURE__ */ jsxRuntime.jsx(
311
- chunk44R3CCZT_cjs.ScopePicker,
32
+ chunkWS5EX7DN_cjs.ScopePicker,
312
33
  {
313
34
  folders: scopeSource.folders,
314
35
  unfiledCount: scopeSource.unfiledCount,
@@ -327,186 +48,14 @@ function resolveScopeInputs(workflow, inputs, scopeSource) {
327
48
  for (const field of workflow.inputs) {
328
49
  if (field.type !== "scope") continue;
329
50
  const raw = inputs[field.name];
330
- const scope = chunkOWCEQKAR_cjs.isWorkflowScope(raw) ? raw : { folders: [], labels: [] };
51
+ const scope = chunk6F7SZCVL_cjs.isWorkflowScope(raw) ? raw : { folders: [], labels: [] };
331
52
  next[field.name] = { ...scope, documents: scopeSource.resolveDocuments(scope) };
332
53
  }
333
54
  return next;
334
55
  }
335
- function WorkflowLauncher({
336
- workflows,
337
- tileWorkflows,
338
- onLaunch,
339
- showTiles = true,
340
- caption,
341
- captionTestId,
342
- tileTestId,
343
- disabledReason,
344
- activeId: activeIdProp,
345
- onActiveIdChange,
346
- initialInputsFor,
347
- testId,
348
- extraTiles = [],
349
- className,
350
- children,
351
- renderIcon,
352
- ...dialog
353
- }) {
354
- const [activeId, setActiveId] = useControllableState(
355
- activeIdProp,
356
- null,
357
- onActiveIdChange
358
- );
359
- const [isLaunching, setIsLaunching] = react.useState(false);
360
- const active = workflows.find((w) => w.id === activeId) ?? null;
361
- const run = async (launch) => {
362
- setIsLaunching(true);
363
- try {
364
- await onLaunch(launch);
365
- setActiveId(null);
366
- } finally {
367
- setIsLaunching(false);
368
- }
369
- };
370
- const select = (workflow) => {
371
- if (workflow.run.kind === "operation" && workflow.inputs.length === 0) {
372
- const inputs = chunkOWCEQKAR_cjs.defaultInputs(workflow);
373
- if (Object.keys(chunkOWCEQKAR_cjs.validateInputs(workflow, inputs)).length === 0) {
374
- Promise.resolve(onLaunch(chunkOWCEQKAR_cjs.buildLaunch(workflow, inputs, void 0))).catch(() => {
375
- });
376
- return;
377
- }
378
- }
379
- setActiveId(workflow.id);
380
- };
381
- const tiles = (tileWorkflows ?? workflows).map((workflow) => {
382
- const reason = disabledReason?.(workflow);
383
- return {
384
- id: workflow.id,
385
- iconNode: workflow.icon && renderIcon ? renderIcon(workflow.icon) : void 0,
386
- title: workflow.title,
387
- description: workflow.description,
388
- onSelect: () => select(workflow),
389
- disabled: reason !== void 0,
390
- disabledReason: reason,
391
- testId: tileTestId?.(workflow) ?? `workflow-tile-${workflow.id}`
392
- };
393
- });
394
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-slot": "workflow-launcher", children: [
395
- showTiles && /* @__PURE__ */ jsxRuntime.jsx(
396
- chunk44R3CCZT_cjs.StartTiles,
397
- {
398
- items: [...tiles, ...extraTiles],
399
- caption,
400
- captionTestId,
401
- testId
402
- }
403
- ),
404
- children,
405
- active && /* @__PURE__ */ jsxRuntime.jsx(
406
- WorkflowConfigDialog,
407
- {
408
- ...dialog,
409
- renderIcon,
410
- workflow: active,
411
- open: true,
412
- onOpenChange: (open) => !open && setActiveId(null),
413
- onLaunch: run,
414
- isLaunching,
415
- initialInputs: initialInputsFor?.(active)
416
- }
417
- )
418
- ] });
419
- }
420
-
421
- // src/agents/workflows/workspaceScope.ts
422
- var canonical = (path) => (path ?? "").split("/").map((part) => part.trim()).filter(Boolean).join("/");
423
- function matchWorkflowScope(docs, scope) {
424
- if (scope.documents?.length) {
425
- const ids = new Set(scope.documents);
426
- return docs.filter((doc) => ids.has(doc.external_id));
427
- }
428
- if (!scope.folders.length && !scope.labels.length) return docs;
429
- const folders = scope.folders.map(canonical);
430
- const labels = new Set(scope.labels);
431
- return docs.filter((doc) => {
432
- const folder = canonical(doc.folder);
433
- return folders.some(
434
- (path) => path === "" ? folder === "" : folder === path || folder.startsWith(`${path}/`)
435
- ) || doc.doctags?.some((tag) => labels.has(tag.tag_ext_id));
436
- });
437
- }
438
- function buildWorkflowScopeSource(docs, labels = []) {
439
- const counts = /* @__PURE__ */ new Map();
440
- for (const doc of docs) {
441
- const parts = canonical(doc.folder).split("/").filter(Boolean);
442
- for (let i = 1; i <= parts.length; i++) {
443
- const path = parts.slice(0, i).join("/");
444
- counts.set(path, (counts.get(path) ?? 0) + 1);
445
- }
446
- }
447
- return {
448
- folders: [...counts].sort(([a], [b]) => a.localeCompare(b)).map(([path, count]) => ({
449
- path,
450
- count,
451
- label: path.split("/").at(-1),
452
- depth: path.split("/").length - 1
453
- })),
454
- unfiledCount: docs.filter((doc) => !canonical(doc.folder)).length,
455
- labels: labels.map((label) => ({
456
- id: label.external_id,
457
- name: label.name,
458
- color: label.color ?? "currentColor",
459
- count: docs.filter((doc) => doc.doctags?.some((tag) => tag.tag_ext_id === label.external_id)).length
460
- })),
461
- totalCount: docs.length,
462
- countMatching: (scope) => matchWorkflowScope(docs, scope).length,
463
- resolveDocuments: (scope) => matchWorkflowScope(docs, scope).map((doc) => doc.external_id)
464
- };
465
- }
466
- function WorkflowDocumentsField({
467
- field,
468
- value,
469
- onChange,
470
- documents,
471
- addFilesAction
472
- }) {
473
- const ids = value.documents ?? [];
474
- const max = field.max ?? 1;
475
- const set = (documents2) => onChange({ ...value, documents: documents2 });
476
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": `workflow-documents-${field.name}`, className: "space-y-2", children: [
477
- /* @__PURE__ */ jsxRuntime.jsx(
478
- chunkS5HZBXZA_cjs.DocumentPicker,
479
- {
480
- groups: [{ id: "workspace", docs: documents }],
481
- value: ids[0] ?? "",
482
- selected: documents.find((doc) => doc.id === ids[0]),
483
- selectedIds: max > 1 ? ids : void 0,
484
- onValueChange: (id) => set(
485
- ids.includes(id) ? ids.filter((selected) => selected !== id) : [...ids, id].slice(-max)
486
- )
487
- }
488
- ),
489
- ids.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: ids.map((id) => /* @__PURE__ */ jsxRuntime.jsxs(
490
- ui.Button,
491
- {
492
- type: "button",
493
- variant: "outline",
494
- size: "sm",
495
- onClick: () => set(ids.filter((selected) => selected !== id)),
496
- "aria-label": `Remove ${documents.find((doc) => doc.id === id)?.title ?? id}`,
497
- children: [
498
- documents.find((doc) => doc.id === id)?.title ?? id,
499
- " \xD7"
500
- ]
501
- },
502
- id
503
- )) }),
504
- addFilesAction
505
- ] });
506
- }
507
56
  function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, resolveWorkflow, compose } = {}) {
508
- const steps = chunkOWCEQKAR_cjs.workflowSteps(workflow);
509
- const [inputs, setInputs] = react.useState(() => chunkOWCEQKAR_cjs.initialRunInputs(workflow));
57
+ const steps = chunk6F7SZCVL_cjs.workflowSteps(workflow);
58
+ const [inputs, setInputs] = react.useState(() => chunk6F7SZCVL_cjs.initialRunInputs(workflow));
510
59
  const [states, setStates] = react.useState({});
511
60
  const set = (id, state) => setStates((s) => ({ ...s, [id]: state }));
512
61
  const timers = react.useRef(/* @__PURE__ */ new Map());
@@ -528,10 +77,10 @@ function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, reso
528
77
  react.useEffect(() => {
529
78
  if (Object.values(states).some((s) => s.status === "running")) return;
530
79
  const next = steps.find(
531
- (s) => (s.kind === "agent" || s.kind === "action") && chunkOWCEQKAR_cjs.stepPhase(steps, states, s.id) === "ready"
80
+ (s) => (s.kind === "agent" || s.kind === "action") && chunk6F7SZCVL_cjs.stepPhase(steps, states, s.id) === "ready"
532
81
  );
533
82
  if (!next || next.kind !== "agent" && next.kind !== "action") return;
534
- const prompt = next.kind === "agent" ? chunkOWCEQKAR_cjs.composeStepPrompt(workflow, next, inputs, { resolveWorkflow, compose }) : "";
83
+ const prompt = next.kind === "agent" ? chunk6F7SZCVL_cjs.composeStepPrompt(workflow, next, inputs, { resolveWorkflow, compose }) : "";
535
84
  set(next.id, { status: "running", startedAt: (/* @__PURE__ */ new Date()).toISOString() });
536
85
  timers.current.set(
537
86
  next.id,
@@ -544,7 +93,7 @@ function useWorkflowPreview(workflow, { answer = "{prompt}", delayMs = 400, reso
544
93
  }, delayMs)
545
94
  );
546
95
  }, [states, steps, workflow]);
547
- return chunkLIHRGG4M_cjs.useWorkflowView({
96
+ return chunkCHVCTKF4_cjs.useWorkflowView({
548
97
  steps,
549
98
  states,
550
99
  inputs,
@@ -1032,7 +581,7 @@ function AgentCreator({
1032
581
  // eslint-disable-next-line react-hooks/exhaustive-deps
1033
582
  [open]
1034
583
  );
1035
- const [values, setValues] = useControllableState(
584
+ const [values, setValues] = chunkCHVCTKF4_cjs.useControllableState(
1036
585
  valuesProp,
1037
586
  seed,
1038
587
  onValuesChange
@@ -1160,7 +709,7 @@ function AgentCreator({
1160
709
  ] })
1161
710
  ] }),
1162
711
  /* @__PURE__ */ jsxRuntime.jsx(
1163
- chunk7D737FLE_cjs.FoldSection,
712
+ chunkWS5EX7DN_cjs.FoldSection,
1164
713
  {
1165
714
  label: l.advanced,
1166
715
  open: advancedOpen,
@@ -2444,13 +1993,13 @@ function describeRRule(rrule) {
2444
1993
  if (!rrule) return "Recurring";
2445
1994
  const preset = parseRRule(rrule);
2446
1995
  if (!preset) return rrule;
2447
- const time2 = `${pad2(preset.hour)}:${pad2(preset.minute)}`;
2448
- if (preset.frequency === "daily") return `Daily at ${time2}`;
1996
+ const time = `${pad2(preset.hour)}:${pad2(preset.minute)}`;
1997
+ if (preset.frequency === "daily") return `Daily at ${time}`;
2449
1998
  if (preset.frequency === "weekly") {
2450
1999
  const days = preset.weekdays.map((d) => WEEKDAY_LABELS[d]).join(", ");
2451
- return `Weekly on ${days} at ${time2}`;
2000
+ return `Weekly on ${days} at ${time}`;
2452
2001
  }
2453
- return `Monthly on the ${ordinal(preset.monthDay)} at ${time2}`;
2002
+ return `Monthly on the ${ordinal(preset.monthDay)} at ${time}`;
2454
2003
  }
2455
2004
  var DEFAULT_RECURRENCE_BUILDER_LABELS = {
2456
2005
  rruleLabel: "Custom schedule (iCalendar rule)",
@@ -2648,22 +2197,6 @@ function goalProgress(task) {
2648
2197
  if (!gs || gs.criteria_total == null) return null;
2649
2198
  return { met: gs.criteria_met ?? 0, total: gs.criteria_total, done: gs.done === true };
2650
2199
  }
2651
- function PersonPill({ person, size = "sm", testId }) {
2652
- return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": testId, className: "inline-flex min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2653
- ui.UserEntity,
2654
- {
2655
- variant: "pill",
2656
- size,
2657
- interactive: false,
2658
- showTooltip: false,
2659
- initials: chunkKDG6FER6_cjs.initials(person.label),
2660
- displayName: person.label,
2661
- avatarStyle: person.id ? ui.getEntityColorStyles(person.id) : void 0,
2662
- isAgent: person.isAgent,
2663
- isMe: person.isMe
2664
- }
2665
- ) });
2666
- }
2667
2200
  var DEFAULT_TASK_OUTPUTS_CELL_LABELS = {
2668
2201
  none: "\u2014",
2669
2202
  open: (count) => `${count} ${count === 1 ? "output" : "outputs"}`,
@@ -3357,7 +2890,7 @@ function TaskTable(props) {
3357
2890
  isMe: mine
3358
2891
  };
3359
2892
  };
3360
- const renderPerson = props.renderPerson ?? ((person) => /* @__PURE__ */ jsxRuntime.jsx(PersonPill, { person }));
2893
+ const renderPerson = props.renderPerson ?? ((person) => /* @__PURE__ */ jsxRuntime.jsx(chunkCHVCTKF4_cjs.PersonPill, { person }));
3361
2894
  const q = (query.trim() || (props.filterText ?? "").trim()).toLowerCase();
3362
2895
  const counts = react.useMemo(() => {
3363
2896
  const map = new Map(STATUS_ORDER.map((s) => [s, 0]));
@@ -3971,7 +3504,7 @@ function TaskInbox(p) {
3971
3504
  else next.add(id);
3972
3505
  return next;
3973
3506
  });
3974
- p.renderPerson ?? ((value) => /* @__PURE__ */ jsxRuntime.jsx(PersonPill, { person: value }));
3507
+ p.renderPerson ?? ((value) => /* @__PURE__ */ jsxRuntime.jsx(chunkCHVCTKF4_cjs.PersonPill, { person: value }));
3975
3508
  const taskById = new Map(all.map((t) => [t.external_id, t]));
3976
3509
  const visible = new Set(rows.map((t) => t.external_id));
3977
3510
  for (const task of rows) {
@@ -4159,7 +3692,7 @@ function TaskInbox(p) {
4159
3692
  fieldsButton: "tasks-filter-fields"
4160
3693
  },
4161
3694
  filter: /* @__PURE__ */ jsxRuntime.jsx(
4162
- chunkN26CXGXC_cjs.TriStateFilterMenu,
3695
+ chunkRQ2Y7USX_cjs.TriStateFilterMenu,
4163
3696
  {
4164
3697
  testId: "tasks-status-filter",
4165
3698
  open: filterOpen,
@@ -4669,7 +4202,7 @@ function TaskStartDialog({
4669
4202
  setSourceOpen(false);
4670
4203
  }, [open]);
4671
4204
  const textareaRef = react.useRef(null);
4672
- const mention = chunkOWCEQKAR_cjs.useMentionAutocomplete({
4205
+ const mention = chunk6F7SZCVL_cjs.useMentionAutocomplete({
4673
4206
  value: prompt,
4674
4207
  onValueChange: setPrompt,
4675
4208
  candidates: people,
@@ -5020,7 +4553,7 @@ function workflowTaskFields(workflow, inputs, name, context) {
5020
4553
  }
5021
4554
  const typed = name?.trim();
5022
4555
  if (workflow.options?.agent === false) {
5023
- const message = chunkOWCEQKAR_cjs.composeWorkflowPrompt(workflow, inputs, context);
4556
+ const message = chunk6F7SZCVL_cjs.composeWorkflowPrompt(workflow, inputs, context);
5024
4557
  return { name: typed || message, prompt: "", skill_ref: null, skill_inputs: null };
5025
4558
  }
5026
4559
  const derived = typed || deriveWorkflowName(workflow, inputs);
@@ -5034,7 +4567,7 @@ function workflowTaskFields(workflow, inputs, name, context) {
5034
4567
  }
5035
4568
  return {
5036
4569
  name: derived,
5037
- prompt: chunkOWCEQKAR_cjs.composeWorkflowPrompt(workflow, inputs, context),
4570
+ prompt: chunk6F7SZCVL_cjs.composeWorkflowPrompt(workflow, inputs, context),
5038
4571
  skill_ref: null,
5039
4572
  // The files a run is bound to travel in the saved inputs, whatever the template: the server binds
5040
4573
  // the run to the ids listed under any input's `documents`.
@@ -5537,672 +5070,6 @@ function NewThreadDialog({
5537
5070
  }
5538
5071
  ) });
5539
5072
  }
5540
- var DEFAULT_TASK_TRIGGER_CHIP_LABELS = {
5541
- after: (name) => `After \u201C${name}\u201D is done`,
5542
- afterUnknown: "After another task is done",
5543
- onDemand: "Manual"
5544
- };
5545
- function TriggerIcon({ type, chained }) {
5546
- const cls = "size-3.5 shrink-0 text-muted-foreground";
5547
- if (chained) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2, { className: cls, "aria-hidden": true });
5548
- switch (type) {
5549
- case "on_demand":
5550
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MousePointerClick, { className: cls, "aria-hidden": true });
5551
- case "recurring":
5552
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: cls, "aria-hidden": true });
5553
- case "event":
5554
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, { className: cls, "aria-hidden": true });
5555
- default:
5556
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: cls, "aria-hidden": true });
5557
- }
5558
- }
5559
- function TaskTriggerChip({
5560
- id,
5561
- triggerType,
5562
- summary,
5563
- afterTaskId,
5564
- afterTaskName,
5565
- testId,
5566
- labels
5567
- }) {
5568
- const l = { ...DEFAULT_TASK_TRIGGER_CHIP_LABELS, ...labels };
5569
- const chained = Boolean(afterTaskId);
5570
- const text2 = chained ? afterTaskName ? l.after(afterTaskName) : l.afterUnknown : triggerType === "on_demand" ? l.onDemand : summary;
5571
- return /* @__PURE__ */ jsxRuntime.jsxs(
5572
- "span",
5573
- {
5574
- className: "inline-flex min-w-0 max-w-full items-center gap-1.5 text-sm font-normal text-foreground",
5575
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: `task-trigger-${id}` }),
5576
- "data-trigger": chained ? "task" : triggerType,
5577
- children: [
5578
- /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { type: triggerType, chained }),
5579
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: text2 })
5580
- ]
5581
- }
5582
- );
5583
- }
5584
-
5585
- // src/agents/tasks/workflowRows.ts
5586
- var isSkillRow = (row) => row.kind === "skill";
5587
- var hasTrigger = (row) => !row.on_demand && Boolean(row.rrule || row.run_at || row.event_kind || row.after_conversation_ext_id);
5588
- function workflowStatus(row) {
5589
- if (isSkillRow(row) || !hasTrigger(row)) return "on_demand";
5590
- return row.active ? "active" : "paused";
5591
- }
5592
- function workflowTriggerType(workflow) {
5593
- if (workflow.on_demand) return "on_demand";
5594
- if (workflow.after_conversation_ext_id) return "after";
5595
- if (workflow.event_kind) return "event";
5596
- if (workflow.rrule) return "recurring";
5597
- if (workflow.run_at) return "one_time";
5598
- return "on_demand";
5599
- }
5600
- function workflowRunStatusLabel(status) {
5601
- if (!status) return "None";
5602
- const labels = {
5603
- completed: "Success",
5604
- success: "Success",
5605
- failed: "Failed",
5606
- running: "In progress",
5607
- awaiting_authorization: "Awaiting access"
5608
- };
5609
- return labels[status] ?? status.replaceAll("_", " ");
5610
- }
5611
- function listedRunStatus(status, threadStatus) {
5612
- if (threadStatus === "done" && status === "running") return "completed";
5613
- return status;
5614
- }
5615
-
5616
- // src/agents/tasks/workflowColumns.tsx
5617
- var WORKFLOW_COLUMN_ORDER = [
5618
- "name",
5619
- "trigger",
5620
- "last_run",
5621
- "result",
5622
- "status",
5623
- "shared",
5624
- "actions"
5625
- ];
5626
- function cell2(render) {
5627
- return (params) => params.data ? render(params.data) : null;
5628
- }
5629
- var time = (iso) => iso ? Date.parse(iso) : Number.POSITIVE_INFINITY;
5630
- function createWorkflowColumns(o) {
5631
- const l = o.labels;
5632
- const base = {
5633
- sortable: false,
5634
- cellStyle: { display: "flex", alignItems: "center" }
5635
- };
5636
- return [
5637
- {
5638
- ...base,
5639
- colId: "name",
5640
- sortable: true,
5641
- headerName: l.colName,
5642
- flex: 3,
5643
- minWidth: 210,
5644
- valueGetter: (p) => p.data?.name.toLowerCase() ?? "",
5645
- cellRenderer: cell2(o.renderName)
5646
- },
5647
- {
5648
- ...base,
5649
- colId: "trigger",
5650
- headerName: l.colTrigger,
5651
- flex: 2.4,
5652
- minWidth: 185,
5653
- valueGetter: (p) => p.data ? o.getTriggerText(p.data) : "",
5654
- cellRenderer: cell2(o.renderTrigger)
5655
- },
5656
- {
5657
- ...base,
5658
- colId: "last_run",
5659
- sortable: true,
5660
- headerName: l.colLastRun,
5661
- flex: 1.4,
5662
- minWidth: 140,
5663
- cellStyle: { display: "flex", alignItems: "center", padding: 0 },
5664
- valueGetter: (p) => time(p.data?.last_fired_at),
5665
- cellRenderer: cell2(o.renderLastRun)
5666
- },
5667
- {
5668
- ...base,
5669
- colId: "result",
5670
- headerName: "Result",
5671
- width: 130,
5672
- valueGetter: (p) => p.data?.last_run_status ?? "",
5673
- cellStyle: { display: "flex", alignItems: "center", padding: 0 },
5674
- cellRenderer: cell2(o.renderResult)
5675
- },
5676
- {
5677
- ...base,
5678
- colId: "status",
5679
- sortable: true,
5680
- headerName: l.colStatus,
5681
- width: 120,
5682
- valueGetter: (p) => p.data ? workflowStatus(p.data) : "",
5683
- cellRenderer: cell2(o.renderStatus)
5684
- },
5685
- {
5686
- ...base,
5687
- colId: "shared",
5688
- headerName: l.colShared,
5689
- headerTooltip: l.shared,
5690
- width: 96,
5691
- cellStyle: { display: "flex", alignItems: "center", justifyContent: "center" },
5692
- valueGetter: (p) => p.data?.shared ?? false,
5693
- cellRenderer: cell2(o.renderShared)
5694
- },
5695
- {
5696
- ...base,
5697
- colId: "actions",
5698
- headerName: "",
5699
- width: 180,
5700
- minWidth: 180,
5701
- cellStyle: { display: "flex", alignItems: "center", justifyContent: "flex-end" },
5702
- cellRenderer: cell2(o.renderActions)
5703
- }
5704
- ];
5705
- }
5706
-
5707
- // src/agents/tasks/workflowTableLabels.ts
5708
- var DEFAULT_WORKFLOW_LIST_LABELS = {
5709
- colName: "Name",
5710
- colType: "Type",
5711
- colTrigger: "When",
5712
- colAction: "What it does",
5713
- colAgent: "Agent",
5714
- colStatus: "Active",
5715
- colShared: "Shared",
5716
- colLastRun: "Last run",
5717
- colNextRun: "Next run",
5718
- shared: "Shared with the workspace",
5719
- sharedOwnerOnly: "Only the creator can change who can see this",
5720
- deleteOwnerOnly: "Only the creator or workspace owner can delete this",
5721
- typeSkill: "Skill",
5722
- typeWorkflow: "Workflow",
5723
- statusActive: "Active",
5724
- statusPaused: "Inactive",
5725
- statusOnDemand: "On demand",
5726
- activeSwitch: (name) => `Active: \u201C${name}\u201D`,
5727
- agent: "Agent",
5728
- myAssistant: "My assistant",
5729
- me: "Me",
5730
- someone: "Someone",
5731
- never: "Never",
5732
- none: "\u2014",
5733
- reminder: "Reminder",
5734
- failed: "Failed",
5735
- lastRunFailed: "Last run failed",
5736
- openLastRun: "Open the task this run created",
5737
- editWorkflow: "Edit",
5738
- run: "Run",
5739
- runLater: "Run later",
5740
- runNow: "Run now",
5741
- runs: "Runs",
5742
- delete: "Delete",
5743
- moreActions: "More actions",
5744
- searchLabel: "Search workflows",
5745
- searchPlaceholder: "Search workflows and skills\u2026",
5746
- emptyTitle: "Nothing to run yet",
5747
- emptyMessage: "Skills and workflows you can run will appear here.",
5748
- firstRun: "Run a skill now, or choose Run later to save it as a workflow that runs on its own.",
5749
- noMatches: "Nothing in this view.",
5750
- filterAll: "All",
5751
- filterSkills: "Skills",
5752
- filterWorkflows: "Workflows",
5753
- filterActive: "Active",
5754
- filterPaused: "Inactive",
5755
- makeActive: "Make active",
5756
- makePaused: "Deactivate",
5757
- selectAll: "Select all",
5758
- selectWorkflow: (name) => `Select ${name}`
5759
- };
5760
- var ROW_HEIGHT2 = 40;
5761
- function WorkflowsTable(props) {
5762
- const { workflows, isLoading, busyId, header, testId } = props;
5763
- const l = { ...DEFAULT_WORKFLOW_LIST_LABELS, ...props.labels };
5764
- const [filterStates, setFilterStates] = react.useState(/* @__PURE__ */ new Map());
5765
- const [filterOpen, setFilterOpen] = react.useState(false);
5766
- const [query, setQuery] = react.useState("");
5767
- const [selected, setSelected] = react.useState([]);
5768
- const apiRef = react.useRef(null);
5769
- const q = query.trim().toLowerCase();
5770
- const matches = (w) => !q || `${w.name} ${w.description ?? ""} ${w.prompt ?? ""} ${w.skill_ref ?? ""}`.toLowerCase().includes(q);
5771
- const inFilter = (w, f) => f === "all" || f === "skills" && isSkillRow(w) || f === "workflows" && !isSkillRow(w) || f === "active" && workflowStatus(w) === "active" || f === "paused" && workflowStatus(w) === "paused";
5772
- const counts = react.useMemo(() => {
5773
- const out = { all: 0, skills: 0, workflows: 0, active: 0, paused: 0 };
5774
- for (const w of workflows) {
5775
- if (!matches(w)) continue;
5776
- for (const f of Object.keys(out)) if (inFilter(w, f)) out[f] += 1;
5777
- }
5778
- return out;
5779
- }, [workflows, q]);
5780
- const shown = react.useMemo(
5781
- () => workflows.filter((w) => {
5782
- if (!matches(w)) return false;
5783
- for (const group of [
5784
- ["skills", "workflows"],
5785
- ["active", "paused"]
5786
- ]) {
5787
- const included = group.filter((f) => filterStates.get(f) === "include");
5788
- if (included.length && !included.some((f) => inFilter(w, f))) return false;
5789
- if (group.some((f) => filterStates.get(f) === "exclude" && inFilter(w, f))) return false;
5790
- }
5791
- return true;
5792
- }),
5793
- [workflows, filterStates, q]
5794
- );
5795
- const renderPerson = props.renderPerson ?? ((p) => /* @__PURE__ */ jsxRuntime.jsx(PersonPill, { person: p }));
5796
- const actionText = (w) => {
5797
- if (w.action)
5798
- return w.action.type === "email_documents" ? "Email latest documents" : "AI Review";
5799
- if (isSkillRow(w))
5800
- return w.description || w.skill_ref && props.skillNames?.[w.skill_ref] || w.name;
5801
- return w.skill_ref ? props.skillNames?.[w.skill_ref] ?? w.skill_ref : w.prompt?.trim() || l.reminder;
5802
- };
5803
- const latest = react.useRef({ props, l, renderPerson, actionText });
5804
- latest.current = { props, l, renderPerson, actionText };
5805
- const columnDefs = react.useMemo(
5806
- () => createWorkflowColumns({
5807
- labels: l,
5808
- getTriggerText: (w) => isSkillRow(w) ? l.statusOnDemand : latest.current.props.describeTrigger(w),
5809
- renderName: (w) => {
5810
- const { l: lb } = latest.current;
5811
- const skill = isSkillRow(w);
5812
- const text2 = skill ? latest.current.actionText(w) : w.description || latest.current.actionText(w);
5813
- const stem = w.name.replace(/…$/, "").trim();
5814
- const about = text2 && text2.trim() !== w.name.trim() && text2.trim() !== stem ? text2 : "";
5815
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 leading-tight", children: [
5816
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
5817
- /* @__PURE__ */ jsxRuntime.jsx(
5818
- "span",
5819
- {
5820
- className: ui.cn(
5821
- "truncate text-sm font-normal",
5822
- workflowStatus(w) === "paused" && "text-muted-foreground"
5823
- ),
5824
- "data-testid": `workflow-name-${w.external_id}`,
5825
- children: w.name
5826
- }
5827
- ),
5828
- skill && /* @__PURE__ */ jsxRuntime.jsx(
5829
- "span",
5830
- {
5831
- className: "shrink-0 rounded-full border border-border px-1.5 text-[11px] text-muted-foreground",
5832
- "data-testid": `workflow-type-${w.external_id}`,
5833
- children: lb.typeSkill
5834
- }
5835
- )
5836
- ] }),
5837
- about && !latest.current.props.automationsOnly && /* @__PURE__ */ jsxRuntime.jsx(
5838
- "p",
5839
- {
5840
- className: "truncate text-xs text-muted-foreground",
5841
- "data-testid": `workflow-action-${w.external_id}`,
5842
- children: about
5843
- }
5844
- )
5845
- ] });
5846
- },
5847
- renderTrigger: (w) => {
5848
- const { props: p } = latest.current;
5849
- const after = w.after_conversation_ext_id;
5850
- const skill = isSkillRow(w);
5851
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 leading-tight", children: /* @__PURE__ */ jsxRuntime.jsx(
5852
- TaskTriggerChip,
5853
- {
5854
- id: w.external_id,
5855
- testId: `workflow-trigger-${w.external_id}`,
5856
- triggerType: workflowTriggerType(w),
5857
- summary: skill ? "" : p.describeTrigger(w),
5858
- afterTaskId: after,
5859
- afterTaskName: after ? p.taskNames?.[after] : void 0,
5860
- labels: p.triggerChipLabels
5861
- }
5862
- ) });
5863
- },
5864
- renderStatus: (w) => {
5865
- const { props: p, l: lb } = latest.current;
5866
- const canEdit = w.is_owner !== false || Boolean(p.canEditShared);
5867
- return /* @__PURE__ */ jsxRuntime.jsx(
5868
- ui.Switch,
5869
- {
5870
- checked: hasTrigger(w) && !isSkillRow(w) && Boolean(w.active),
5871
- disabled: !hasTrigger(w) || isSkillRow(w) || !canEdit || p.busyId === w.external_id,
5872
- onCheckedChange: (next) => p.onToggleActive(w, next),
5873
- className: "disabled:data-[state=unchecked]:bg-muted dark:disabled:data-[state=unchecked]:bg-muted",
5874
- "aria-label": lb.activeSwitch(w.name),
5875
- "data-testid": `workflow-active-${w.external_id}`
5876
- }
5877
- );
5878
- },
5879
- renderShared: (w) => {
5880
- const { props: p, l: lb } = latest.current;
5881
- if (!p.onToggleShared || isSkillRow(w)) return null;
5882
- const isCreator = w.is_owner !== false;
5883
- return /* @__PURE__ */ jsxRuntime.jsx(
5884
- ui.VisibilityToggle,
5885
- {
5886
- items: { shared: w.shared ?? false },
5887
- onToggle: (share) => latest.current.props.onToggleShared?.(w, share),
5888
- disabled: !isCreator || p.busyId === w.external_id,
5889
- disabledTooltip: lb.sharedOwnerOnly,
5890
- showLabel: false,
5891
- "data-testid": `workflow-shared-${w.external_id}`
5892
- }
5893
- );
5894
- },
5895
- renderLastRun: (w) => {
5896
- const { props: p, l: lb } = latest.current;
5897
- const at = w.last_fired_at ?? p.lastRuns?.[w.external_id]?.at;
5898
- return /* @__PURE__ */ jsxRuntime.jsx(
5899
- "button",
5900
- {
5901
- type: "button",
5902
- className: "h-full w-full truncate px-4 text-left text-sm hover:text-primary",
5903
- onClick: () => p.onViewRuns?.(w),
5904
- title: "View run history",
5905
- "data-testid": `workflow-last-run-${w.external_id}`,
5906
- children: at ? p.formatDate(at) : lb.never
5907
- }
5908
- );
5909
- },
5910
- renderResult: (w) => {
5911
- const status = listedRunStatus(
5912
- w.last_run_status,
5913
- latest.current.props.lastRuns?.[w.external_id]?.threadStatus
5914
- );
5915
- const label = workflowRunStatusLabel(status);
5916
- return /* @__PURE__ */ jsxRuntime.jsx(
5917
- "button",
5918
- {
5919
- type: "button",
5920
- onClick: () => latest.current.props.onViewRuns?.(w),
5921
- title: "View run history",
5922
- className: ui.cn(
5923
- ui.badgeVariants({ variant: "outline" }),
5924
- "mx-4 cursor-pointer text-xs font-medium",
5925
- status === "failed" ? "border-red-border bg-red-bg text-red-text hover:bg-red-bg/80" : status === "completed" || status === "success" ? "border-green-border bg-green-bg text-green-text hover:bg-green-bg/80" : status ? "border-primary/20 bg-primary/10 text-primary hover:bg-primary/15" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"
5926
- ),
5927
- "data-testid": `workflow-result-${w.external_id}`,
5928
- children: label
5929
- }
5930
- );
5931
- },
5932
- renderActions: (w) => {
5933
- const { props: p, l: lb } = latest.current;
5934
- const id = w.external_id;
5935
- const skill = isSkillRow(w);
5936
- const busy = p.busyId === id;
5937
- const isOwner = w.is_owner !== false;
5938
- const canEdit = isOwner || Boolean(p.canEditShared);
5939
- const canAdmin = isOwner || Boolean(p.isWorkspaceOwner);
5940
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-1", children: [
5941
- (skill || canEdit) && /* @__PURE__ */ jsxRuntime.jsxs(
5942
- ui.Button,
5943
- {
5944
- size: "sm",
5945
- variant: "outline",
5946
- className: "h-8 gap-1.5 pointer-coarse:h-11",
5947
- disabled: busy,
5948
- onClick: () => p.onRun(w),
5949
- "data-testid": `workflow-run-btn-${id}`,
5950
- children: [
5951
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-3.5", "aria-hidden": true }),
5952
- lb.run
5953
- ]
5954
- }
5955
- ),
5956
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
5957
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
5958
- ui.Button,
5959
- {
5960
- variant: "ghost",
5961
- size: "icon",
5962
- className: "size-8 pointer-coarse:size-11",
5963
- "aria-label": lb.moreActions,
5964
- "data-testid": `workflow-menu-${id}`,
5965
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "size-4", "aria-hidden": true })
5966
- }
5967
- ) }),
5968
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", children: [
5969
- skill && p.onRunLater && /* @__PURE__ */ jsxRuntime.jsxs(
5970
- ui.DropdownMenuItem,
5971
- {
5972
- onSelect: () => p.onRunLater?.(w),
5973
- "data-testid": `workflow-run-later-${id}`,
5974
- children: [
5975
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "mr-2 size-4", "aria-hidden": true }),
5976
- lb.runLater
5977
- ]
5978
- }
5979
- ),
5980
- !skill && canEdit && /* @__PURE__ */ jsxRuntime.jsxs(
5981
- ui.DropdownMenuItem,
5982
- {
5983
- onSelect: () => p.onEdit(w),
5984
- "data-testid": `workflow-edit-${id}`,
5985
- children: [
5986
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "mr-2 size-4", "aria-hidden": true }),
5987
- lb.editWorkflow
5988
- ]
5989
- }
5990
- ),
5991
- !skill && p.onViewRuns && /* @__PURE__ */ jsxRuntime.jsxs(
5992
- ui.DropdownMenuItem,
5993
- {
5994
- onSelect: () => p.onViewRuns?.(w),
5995
- "data-testid": `workflow-runs-${id}`,
5996
- children: [
5997
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "mr-2 size-4", "aria-hidden": true }),
5998
- lb.runs
5999
- ]
6000
- }
6001
- ),
6002
- !skill && canEdit && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6003
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuSeparator, {}),
6004
- /* @__PURE__ */ jsxRuntime.jsxs(
6005
- ui.DropdownMenuItem,
6006
- {
6007
- disabled: busy || !canAdmin,
6008
- onSelect: () => p.onDelete(w),
6009
- title: canAdmin ? void 0 : lb.deleteOwnerOnly,
6010
- className: "text-destructive focus:text-destructive",
6011
- "data-testid": `workflow-delete-${id}`,
6012
- children: [
6013
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "mr-2 size-4", "aria-hidden": true }),
6014
- lb.delete
6015
- ]
6016
- }
6017
- )
6018
- ] })
6019
- ] })
6020
- ] })
6021
- ] });
6022
- }
6023
- }),
6024
- // Stable on purpose: only the header texts rebuild the columns (see `latest`).
6025
- // eslint-disable-next-line react-hooks/exhaustive-deps
6026
- [
6027
- l.colName,
6028
- l.colType,
6029
- l.colTrigger,
6030
- l.colAction,
6031
- l.colAgent,
6032
- l.colStatus,
6033
- l.colShared,
6034
- l.shared,
6035
- l.colLastRun,
6036
- l.colNextRun
6037
- ]
6038
- );
6039
- react.useEffect(() => {
6040
- apiRef.current?.refreshCells({ force: true });
6041
- }, [
6042
- busyId,
6043
- props.agentNames,
6044
- props.skillNames,
6045
- props.taskNames,
6046
- props.lastRuns,
6047
- props.renderPerson,
6048
- props.labels,
6049
- props.canEditShared,
6050
- props.isWorkspaceOwner
6051
- ]);
6052
- const mine = selected.filter((w) => !isSkillRow(w));
6053
- const adminSelected = mine.filter((w) => w.is_owner !== false || props.isWorkspaceOwner);
6054
- const editableSelected = mine.filter(
6055
- (w) => hasTrigger(w) && (w.is_owner !== false || props.canEditShared)
6056
- );
6057
- const clearSelection = () => setSelected([]);
6058
- return /* @__PURE__ */ jsxRuntime.jsxs(
6059
- "div",
6060
- {
6061
- className: "flex min-h-0 flex-1 flex-col",
6062
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "workflow-list" }),
6063
- children: [
6064
- /* @__PURE__ */ jsxRuntime.jsx(
6065
- chunk7RGLTF76_cjs.TabHeader,
6066
- {
6067
- testId: "automations-tab-header",
6068
- tabs: [
6069
- {
6070
- id: "automations",
6071
- label: "",
6072
- count: shown.length,
6073
- countIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Workflow, { className: "size-3.5" }),
6074
- countPlacement: "leading",
6075
- presentation: "count",
6076
- hasActiveFilters: !!q || [...filterStates.values()].some(Boolean)
6077
- },
6078
- ...props.tabs ?? []
6079
- ],
6080
- activeTabId: props.activeTabId ?? "automations",
6081
- onTabChange: props.onTabChange ?? (() => {
6082
- }),
6083
- firstTabContent: /* @__PURE__ */ jsxRuntime.jsx(
6084
- chunk2EI7NCUA_cjs.FilterInput,
6085
- {
6086
- value: query,
6087
- onChange: setQuery,
6088
- fields: ["text"],
6089
- onFieldsChange: () => {
6090
- },
6091
- hideFieldPicker: true,
6092
- ariaLabel: l.searchLabel,
6093
- testIds: { input: "workflow-search" },
6094
- filter: /* @__PURE__ */ jsxRuntime.jsx(
6095
- chunkN26CXGXC_cjs.TriStateFilterMenu,
6096
- {
6097
- testId: "automations-filter-button",
6098
- open: filterOpen,
6099
- onOpenChange: setFilterOpen,
6100
- filterStates,
6101
- onFiltersChange: setFilterStates,
6102
- triggerClassName: "flex h-5 items-center gap-0.5 rounded px-1 text-muted-foreground hover:text-foreground pointer-coarse:h-11! pointer-coarse:min-w-11 pointer-coarse:justify-center",
6103
- renderChevron: true,
6104
- disableHoverOpen: true,
6105
- options: [
6106
- ...!props.automationsOnly ? [
6107
- { id: "skills", label: l.filterSkills, count: counts.skills },
6108
- {
6109
- id: "workflows",
6110
- label: l.filterWorkflows,
6111
- count: counts.workflows
6112
- }
6113
- ] : [],
6114
- { id: "active", label: l.filterActive, count: counts.active },
6115
- { id: "paused", label: l.filterPaused, count: counts.paused }
6116
- ]
6117
- }
6118
- )
6119
- }
6120
- ),
6121
- rightContent: header
6122
- }
6123
- ),
6124
- props.content ? props.content : workflows.length === 0 && !isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
6125
- chunkZW6FPIFC_cjs.EmptyState,
6126
- {
6127
- icon: lucideReact.Workflow,
6128
- title: l.emptyTitle,
6129
- description: l.emptyMessage,
6130
- testId: "workflow-list-empty"
6131
- }
6132
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
6133
- chunkC2CWWEHO_cjs.GridView,
6134
- {
6135
- testId: "workflow-grid",
6136
- gridId: props.gridId ?? "workflows-grid-v2",
6137
- items: shown,
6138
- columnDefs,
6139
- getItemId: (w) => w.external_id,
6140
- getRowTestId: (w) => `workflow-row-${w.external_id}`,
6141
- isLoading,
6142
- showEmpty: shown.length === 0,
6143
- emptyState: { title: l.noMatches },
6144
- rowHeight: ROW_HEIGHT2,
6145
- height: "100%",
6146
- onGridReady: ({ api }) => {
6147
- apiRef.current = api;
6148
- },
6149
- onRowClick: (row) => props.onOpenRow?.(row),
6150
- selection: { mode: "multiple", selected, onSelectionChange: setSelected },
6151
- gridOptions: GRID_OPTIONS
6152
- }
6153
- ) }),
6154
- !props.content && /* @__PURE__ */ jsxRuntime.jsx(chunkV4ISCZJ7_cjs.SelectionBar, { count: selected.length, onClear: clearSelection, children: (isCompact) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6155
- props.onToggleActiveMany && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6156
- /* @__PURE__ */ jsxRuntime.jsx(
6157
- chunkV4ISCZJ7_cjs.SelectionBarAction,
6158
- {
6159
- icon: lucideReact.Play,
6160
- label: l.makeActive,
6161
- onClick: () => {
6162
- props.onToggleActiveMany?.(editableSelected, true);
6163
- clearSelection();
6164
- },
6165
- disabled: editableSelected.length === 0,
6166
- isCompact,
6167
- testId: "workflow-bulk-activate"
6168
- }
6169
- ),
6170
- /* @__PURE__ */ jsxRuntime.jsx(
6171
- chunkV4ISCZJ7_cjs.SelectionBarAction,
6172
- {
6173
- icon: lucideReact.Workflow,
6174
- label: l.makePaused,
6175
- onClick: () => {
6176
- props.onToggleActiveMany?.(editableSelected, false);
6177
- clearSelection();
6178
- },
6179
- disabled: editableSelected.length === 0,
6180
- isCompact,
6181
- testId: "workflow-bulk-pause"
6182
- }
6183
- )
6184
- ] }),
6185
- props.onDeleteMany && /* @__PURE__ */ jsxRuntime.jsx(
6186
- chunkV4ISCZJ7_cjs.SelectionBarAction,
6187
- {
6188
- icon: lucideReact.Trash2,
6189
- label: l.delete,
6190
- onClick: () => {
6191
- props.onDeleteMany?.(adminSelected);
6192
- clearSelection();
6193
- },
6194
- disabled: adminSelected.length === 0,
6195
- isCompact,
6196
- className: "border-red-border text-red-text hover:bg-red-bg hover:text-red-text",
6197
- testId: "workflow-bulk-delete"
6198
- }
6199
- )
6200
- ] }) })
6201
- ]
6202
- }
6203
- );
6204
- }
6205
- var GRID_OPTIONS = { suppressClickEdit: true };
6206
5073
  function TaskActivityDialog({
6207
5074
  open,
6208
5075
  onOpenChange,
@@ -6214,7 +5081,7 @@ function TaskActivityDialog({
6214
5081
  testId,
6215
5082
  ...timeline
6216
5083
  }) {
6217
- const l = { ...chunkLIHRGG4M_cjs.DEFAULT_TASK_ACTIVITY_LABELS, ...labels };
5084
+ const l = { ...chunkCHVCTKF4_cjs.DEFAULT_TASK_ACTIVITY_LABELS, ...labels };
6218
5085
  const id = chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "task-activity" });
6219
5086
  const count = events?.length ?? 0;
6220
5087
  const scrollToEnd = react.useCallback(
@@ -6229,7 +5096,7 @@ function TaskActivityDialog({
6229
5096
  /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { className: "truncate", children: taskName })
6230
5097
  ] }),
6231
5098
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-[55dvh] overflow-y-auto pr-1", "data-testid": `${id}-scroll`, children: [
6232
- isLoading && !events ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.loading }) : isError && !events ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: l.error }) : count === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.empty }) : /* @__PURE__ */ jsxRuntime.jsx(chunkLIHRGG4M_cjs.TaskActivityTimeline, { events: events ?? [], labels, testId: id, ...timeline }),
5099
+ isLoading && !events ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.loading }) : isError && !events ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: l.error }) : count === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.empty }) : /* @__PURE__ */ jsxRuntime.jsx(chunkCHVCTKF4_cjs.TaskActivityTimeline, { events: events ?? [], labels, testId: id, ...timeline }),
6233
5100
  /* @__PURE__ */ jsxRuntime.jsx("div", { ref: scrollToEnd })
6234
5101
  ] })
6235
5102
  ] }) });
@@ -6267,7 +5134,7 @@ function TaskFlow({
6267
5134
  },
6268
5135
  children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex w-max min-w-full items-center gap-1 py-0.5", children: items.map((item, i) => {
6269
5136
  const chip = (props) => /* @__PURE__ */ jsxRuntime.jsx(
6270
- chunkOWCEQKAR_cjs.StepChip,
5137
+ chunk6F7SZCVL_cjs.StepChip,
6271
5138
  {
6272
5139
  kind: "adhoc",
6273
5140
  phase: "ready",
@@ -6321,7 +5188,7 @@ function ThreadActivity({ item, children }) {
6321
5188
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-xl items-center gap-2", children: [
6322
5189
  /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "wf-link", "data-done": done || void 0 }),
6323
5190
  /* @__PURE__ */ jsxRuntime.jsx(
6324
- chunkOWCEQKAR_cjs.StepChip,
5191
+ chunk6F7SZCVL_cjs.StepChip,
6325
5192
  {
6326
5193
  inert: true,
6327
5194
  kind,
@@ -6340,7 +5207,7 @@ function ThreadActivity({ item, children }) {
6340
5207
  }
6341
5208
  ),
6342
5209
  document && /* @__PURE__ */ jsxRuntime.jsx(
6343
- chunkOWCEQKAR_cjs.StepDocumentButton,
5210
+ chunk6F7SZCVL_cjs.StepDocumentButton,
6344
5211
  {
6345
5212
  kind,
6346
5213
  name: document.name,
@@ -6407,7 +5274,7 @@ function ThreadLauncher({
6407
5274
  const [shared, setShared] = react.useState(false);
6408
5275
  const [started, setStarted] = react.useState(null);
6409
5276
  const textareaRef = react.useRef(null);
6410
- const mention = chunkOWCEQKAR_cjs.useMentionAutocomplete({
5277
+ const mention = chunk6F7SZCVL_cjs.useMentionAutocomplete({
6411
5278
  value: prompt,
6412
5279
  onValueChange: setPrompt,
6413
5280
  candidates: people,
@@ -6604,10 +5471,10 @@ function WorkflowRunStatus({
6604
5471
  testId = "workflow-run-status"
6605
5472
  }) {
6606
5473
  const l = { ...DEFAULT_WORKFLOW_RUN_STATUS_LABELS, ...labels };
6607
- const ordered = chunkOWCEQKAR_cjs.stepLevels(steps).flat();
6608
- const phaseOf = (id) => isLoading ? "blocked" : chunkOWCEQKAR_cjs.stepPhase(steps, states, id);
6609
- const finished = !isLoading && chunkOWCEQKAR_cjs.isRunFinished(steps, states);
6610
- const atId = finished || isLoading ? void 0 : chunkLIHRGG4M_cjs.activeStepId(chunkOWCEQKAR_cjs.stepLevels(steps), phaseOf);
5474
+ const ordered = chunk6F7SZCVL_cjs.stepLevels(steps).flat();
5475
+ const phaseOf = (id) => isLoading ? "blocked" : chunk6F7SZCVL_cjs.stepPhase(steps, states, id);
5476
+ const finished = !isLoading && chunk6F7SZCVL_cjs.isRunFinished(steps, states);
5477
+ const atId = finished || isLoading ? void 0 : chunkCHVCTKF4_cjs.activeStepId(chunk6F7SZCVL_cjs.stepLevels(steps), phaseOf);
6611
5478
  const at = ordered.find((s) => s.id === atId);
6612
5479
  const phase = at ? phaseOf(at.id) : "done";
6613
5480
  const assignee = at && ["ready", "waiting"].includes(phase) ? assigneeOf?.(at) : void 0;
@@ -6639,7 +5506,7 @@ function WorkflowRunStatus({
6639
5506
  "span",
6640
5507
  {
6641
5508
  className: ui.cn(
6642
- `wf-kind-${chunkOWCEQKAR_cjs.stepKindOf(s)}`,
5509
+ `wf-kind-${chunk6F7SZCVL_cjs.stepKindOf(s)}`,
6643
5510
  "h-1.5 w-3 shrink-0 rounded-full",
6644
5511
  SEGMENT[phaseOf(s.id)],
6645
5512
  s.id === atId && "w-5"
@@ -6685,7 +5552,7 @@ function groupThreadActivity(steps, items) {
6685
5552
  continue;
6686
5553
  }
6687
5554
  if (current === void 0) out.before.push(item);
6688
- else if (chunkOWCEQKAR_cjs.isRunFinished(steps, states)) out.after.push(item);
5555
+ else if (chunk6F7SZCVL_cjs.isRunFinished(steps, states)) out.after.push(item);
6689
5556
  else {
6690
5557
  const status = states[current]?.status;
6691
5558
  const at = status === "done" || status === "skipped" ? steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? ""))?.id ?? current : current;
@@ -6708,9 +5575,9 @@ var DEFAULT_WORKFLOW_THREAD_STRIP_LABELS = {
6708
5575
  after: "After",
6709
5576
  beforeSteps: "Before the first step",
6710
5577
  afterSteps: "After the last step",
6711
- kinds: chunkOWCEQKAR_cjs.DEFAULT_STEP_KIND_LABELS,
6712
- documents: chunkOWCEQKAR_cjs.DEFAULT_STEP_DOCUMENT_LABELS,
6713
- record: chunkOWCEQKAR_cjs.DEFAULT_STEP_RECORD_LABELS
5578
+ kinds: chunk6F7SZCVL_cjs.DEFAULT_STEP_KIND_LABELS,
5579
+ documents: chunk6F7SZCVL_cjs.DEFAULT_STEP_DOCUMENT_LABELS,
5580
+ record: chunk6F7SZCVL_cjs.DEFAULT_STEP_RECORD_LABELS
6714
5581
  };
6715
5582
  function WorkflowThreadStartedBy({
6716
5583
  origin,
@@ -6841,7 +5708,7 @@ function EntriesChip({
6841
5708
  const latest = items.at(-1);
6842
5709
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
6843
5710
  /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
6844
- chunkOWCEQKAR_cjs.StepChip,
5711
+ chunk6F7SZCVL_cjs.StepChip,
6845
5712
  {
6846
5713
  kind,
6847
5714
  phase: "ready",
@@ -6880,23 +5747,23 @@ function WorkflowThreadStrip({
6880
5747
  className
6881
5748
  }) {
6882
5749
  const l = { ...DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, ...labels };
6883
- const barL = { ...chunkLIHRGG4M_cjs.DEFAULT_STEP_BAR_LABELS, ...barLabels };
5750
+ const barL = { ...chunkCHVCTKF4_cjs.DEFAULT_STEP_BAR_LABELS, ...barLabels };
6884
5751
  const grouped = groupThreadActivity(steps, items);
6885
5752
  const strays = signals.filter((s) => !steps.some((step) => step.id === s.step));
6886
5753
  const link = /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "wf-link wf-kind-start max-w-6", "data-done": true });
6887
5754
  const [selected, setSelected] = react.useState(null);
6888
5755
  const [open, setOpen] = react.useState(null);
6889
- const phaseOf = (id) => chunkOWCEQKAR_cjs.stepPhase(steps, states, id);
5756
+ const phaseOf = (id) => chunk6F7SZCVL_cjs.stepPhase(steps, states, id);
6890
5757
  const iconOf = (step) => step.icon && renderIcon ? renderIcon(step.icon) : void 0;
6891
5758
  const glyphOf = (step) => {
6892
- const KindIcon = chunkOWCEQKAR_cjs.STEP_KIND_ICONS[chunkOWCEQKAR_cjs.stepKindOf(step)];
5759
+ const KindIcon = chunk6F7SZCVL_cjs.STEP_KIND_ICONS[chunk6F7SZCVL_cjs.stepKindOf(step)];
6893
5760
  return iconOf(step) ?? /* @__PURE__ */ jsxRuntime.jsx(KindIcon, {});
6894
5761
  };
6895
5762
  const waitingOf = (id) => {
6896
5763
  const step = steps.find((s) => s.id === id);
6897
5764
  const phase = phaseOf(id);
6898
- const documents = chunkOWCEQKAR_cjs.waitingDocuments(states[id]);
6899
- if (documents.length) return chunkOWCEQKAR_cjs.waitingForDocumentsText(documents.length);
5765
+ const documents = chunk6F7SZCVL_cjs.waitingDocuments(states[id]);
5766
+ if (documents.length) return chunk6F7SZCVL_cjs.waitingForDocumentsText(documents.length);
6900
5767
  const name = step && (phase === "ready" || phase === "waiting") ? assigneeOf?.(step) : void 0;
6901
5768
  return name ? l.waitingFor.replace("{name}", name) : void 0;
6902
5769
  };
@@ -6906,8 +5773,8 @@ function WorkflowThreadStrip({
6906
5773
  const assignee = phase === "ready" || phase === "waiting" ? assigneeOf?.(step) : void 0;
6907
5774
  const waiting = waitingOf(step.id);
6908
5775
  const sentBack = states[step.id]?.sentBack;
6909
- const kind = chunkOWCEQKAR_cjs.stepKindOf(step);
6910
- const documents = chunkOWCEQKAR_cjs.stepDocuments(steps, states, step.id);
5776
+ const kind = chunk6F7SZCVL_cjs.stepKindOf(step);
5777
+ const documents = chunk6F7SZCVL_cjs.stepDocuments(steps, states, step.id);
6911
5778
  const latestDoc = onOpenDocument ? documents.at(-1) : void 0;
6912
5779
  const finished = ["done", "skipped", "failed"].includes(phase);
6913
5780
  const chip = /* @__PURE__ */ jsxRuntime.jsxs(
@@ -6920,7 +5787,7 @@ function WorkflowThreadStrip({
6920
5787
  },
6921
5788
  children: [
6922
5789
  /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
6923
- chunkOWCEQKAR_cjs.StepChip,
5790
+ chunk6F7SZCVL_cjs.StepChip,
6924
5791
  {
6925
5792
  kind,
6926
5793
  phase,
@@ -6934,7 +5801,7 @@ function WorkflowThreadStrip({
6934
5801
  waiting
6935
5802
  ] })
6936
5803
  ] }),
6937
- labelClassName: isCurrent ? chunkLIHRGG4M_cjs.STEP_LABEL_CURRENT : ui.cn(chunkLIHRGG4M_cjs.STEP_LABEL, chunkLIHRGG4M_cjs.STEP_LABEL_MAX),
5804
+ labelClassName: isCurrent ? chunkCHVCTKF4_cjs.STEP_LABEL_CURRENT : ui.cn(chunkCHVCTKF4_cjs.STEP_LABEL, chunkCHVCTKF4_cjs.STEP_LABEL_MAX),
6938
5805
  className: ui.cn(latestDoc && "rounded-r-none"),
6939
5806
  title: waiting ? `${step.title} \xB7 ${waiting}` : step.title,
6940
5807
  "data-testid": `workflow-thread-step-${step.id}`,
@@ -6969,7 +5836,7 @@ function WorkflowThreadStrip({
6969
5836
  ),
6970
5837
  sentBack && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-1 text-xs text-amber-700 dark:text-amber-300", children: l.sentBack }),
6971
5838
  /* @__PURE__ */ jsxRuntime.jsx(
6972
- chunkOWCEQKAR_cjs.StepDocumentCards,
5839
+ chunk6F7SZCVL_cjs.StepDocumentCards,
6973
5840
  {
6974
5841
  refs: documents,
6975
5842
  heading: step.kind === "review" ? phase === "done" ? l.documents.approved : l.documents.toApprove : l.documents.produced,
@@ -6980,7 +5847,7 @@ function WorkflowThreadStrip({
6980
5847
  }
6981
5848
  ),
6982
5849
  /* @__PURE__ */ jsxRuntime.jsx(
6983
- chunkOWCEQKAR_cjs.StepRecord,
5850
+ chunk6F7SZCVL_cjs.StepRecord,
6984
5851
  {
6985
5852
  step,
6986
5853
  state: states[step.id],
@@ -7012,10 +5879,10 @@ function WorkflowThreadStrip({
7012
5879
  return latestDoc ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center", children: [
7013
5880
  chip,
7014
5881
  /* @__PURE__ */ jsxRuntime.jsx(
7015
- chunkOWCEQKAR_cjs.StepDocumentButton,
5882
+ chunk6F7SZCVL_cjs.StepDocumentButton,
7016
5883
  {
7017
5884
  kind,
7018
- name: nameOfDoc?.(chunkOWCEQKAR_cjs.splitDocRef(latestDoc).id) ?? latestDoc,
5885
+ name: nameOfDoc?.(chunk6F7SZCVL_cjs.splitDocRef(latestDoc).id) ?? latestDoc,
7019
5886
  onOpen: () => onOpenDocument?.(latestDoc),
7020
5887
  testId: `workflow-thread-step-${step.id}-open-document`
7021
5888
  }
@@ -7054,17 +5921,17 @@ function WorkflowThreadStrip({
7054
5921
  ] }),
7055
5922
  strays.map((s) => /* @__PURE__ */ jsxRuntime.jsx(SignalPill, { signal: s, l }, `${s.step}-${s.signal}`))
7056
5923
  ] }) : null;
7057
- const at = steps.find((s) => s.id === (selected ?? chunkLIHRGG4M_cjs.activeStepId(chunkOWCEQKAR_cjs.stepLevels(steps), phaseOf)));
7058
- const headingPx = (step) => `${l.kinds[chunkOWCEQKAR_cjs.stepKindOf(step)]} \xB7 ${waitingOf(step.id) ?? ""}`.length * 5.6 - step.title.length * 6.5;
5924
+ const at = steps.find((s) => s.id === (selected ?? chunkCHVCTKF4_cjs.activeStepId(chunk6F7SZCVL_cjs.stepLevels(steps), phaseOf)));
5925
+ const headingPx = (step) => `${l.kinds[chunk6F7SZCVL_cjs.stepKindOf(step)]} \xB7 ${waitingOf(step.id) ?? ""}`.length * 5.6 - step.title.length * 6.5;
7059
5926
  const reserve = {
7060
- always: (at ? Math.max(0, headingPx(at)) : 0) + steps.filter((s) => grouped.byStep[s.id]?.length).length * BEADS_PX + (onOpenDocument ? steps.filter((s) => chunkOWCEQKAR_cjs.stepDocuments(steps, states, s.id).length).length * DOC_BUTTON_PX : 0),
5927
+ always: (at ? Math.max(0, headingPx(at)) : 0) + steps.filter((s) => grouped.byStep[s.id]?.length).length * BEADS_PX + (onOpenDocument ? steps.filter((s) => chunk6F7SZCVL_cjs.stepDocuments(steps, states, s.id).length).length * DOC_BUTTON_PX : 0),
7061
5928
  leading: leading ? 150 : 0,
7062
5929
  trailing: trailing ? 120 : 0
7063
5930
  };
7064
5931
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("min-w-0 flex-1", className), "data-testid": "workflow-thread-strip", children: /* @__PURE__ */ jsxRuntime.jsx(
7065
- chunkLIHRGG4M_cjs.StepBarFrame,
5932
+ chunkCHVCTKF4_cjs.StepBarFrame,
7066
5933
  {
7067
- levels: chunkOWCEQKAR_cjs.stepLevels(steps),
5934
+ levels: chunk6F7SZCVL_cjs.stepLevels(steps),
7068
5935
  phaseOf,
7069
5936
  current: selected,
7070
5937
  onSelect: (id) => {
@@ -7077,7 +5944,7 @@ function WorkflowThreadStrip({
7077
5944
  trailing,
7078
5945
  reservePx: reserve,
7079
5946
  icon: glyphOf,
7080
- kindOf: chunkOWCEQKAR_cjs.stepKindOf,
5947
+ kindOf: chunk6F7SZCVL_cjs.stepKindOf,
7081
5948
  labels: { waitingFor: l.waitingFor, ...barLabels },
7082
5949
  tid: (suffix) => `workflow-thread-${suffix}`
7083
5950
  }
@@ -7153,11 +6020,11 @@ function compactThreadActivity(events, stepTitleOf) {
7153
6020
  const count = Math.max(1, entry.recipients.length);
7154
6021
  entry.label = `Notified ${count} ${count === 1 ? "user" : "users"}`;
7155
6022
  } else if (STEP_LABELS[event.kind]) {
7156
- const documents = chunkOWCEQKAR_cjs.eventWaitingDocuments(event.detail);
6023
+ const documents = chunk6F7SZCVL_cjs.eventWaitingDocuments(event.detail);
7157
6024
  const title = typeof event.detail?.step === "string" ? stepTitleOf?.(event.detail.step) : void 0;
7158
6025
  result.push({
7159
6026
  event,
7160
- label: documents ? chunkOWCEQKAR_cjs.waitingForDocumentsText(documents.length) : title && STEP_VERBS[event.kind] ? `${title} ${STEP_VERBS[event.kind]}` : STEP_LABELS[event.kind],
6027
+ label: documents ? chunk6F7SZCVL_cjs.waitingForDocumentsText(documents.length) : title && STEP_VERBS[event.kind] ? `${title} ${STEP_VERBS[event.kind]}` : STEP_LABELS[event.kind],
7161
6028
  recipients: []
7162
6029
  });
7163
6030
  } else if (["artifact_created", "artifact_edited", "document_added", "document_removed"].includes(
@@ -7297,7 +6164,7 @@ function TaskRunsDialog({
7297
6164
  "rounded-full px-2 py-0.5 text-xs font-medium capitalize",
7298
6165
  STATUS_STYLE[data.status] ?? "text-muted-foreground"
7299
6166
  ),
7300
- children: workflowRunStatusLabel(data.status)
6167
+ children: chunkCHVCTKF4_cjs.workflowRunStatusLabel(data.status)
7301
6168
  }
7302
6169
  )
7303
6170
  },
@@ -7564,7 +6431,7 @@ function defaultTaskComposerValues(workflows, initial) {
7564
6431
  return {
7565
6432
  assignee: "me",
7566
6433
  workflowId,
7567
- inputs: workflow ? { ...chunkOWCEQKAR_cjs.defaultInputs(workflow), ...initial?.inputs } : { ...initial?.inputs },
6434
+ inputs: workflow ? { ...chunk6F7SZCVL_cjs.defaultInputs(workflow), ...initial?.inputs } : { ...initial?.inputs },
7568
6435
  when: "manual",
7569
6436
  runAt: "",
7570
6437
  rrule: "",
@@ -7640,7 +6507,7 @@ function WorkflowComposer({
7640
6507
  // eslint-disable-next-line react-hooks/exhaustive-deps
7641
6508
  [workflows, open]
7642
6509
  );
7643
- const [values, setValues] = useControllableState(
6510
+ const [values, setValues] = chunkCHVCTKF4_cjs.useControllableState(
7644
6511
  valuesProp,
7645
6512
  seed,
7646
6513
  onValuesChange
@@ -7673,7 +6540,7 @@ function WorkflowComposer({
7673
6540
  return !docs?.length;
7674
6541
  })
7675
6542
  );
7676
- const whatMissing = !workflow || Object.keys(chunkOWCEQKAR_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs)).length > 0;
6543
+ const whatMissing = !workflow || Object.keys(chunk6F7SZCVL_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs)).length > 0;
7677
6544
  const runAtPast = values.when === "once" && values.runAt !== "" && values.runAt !== initialValues?.runAt && new Date(values.runAt).getTime() <= Date.now();
7678
6545
  const whenMissing = missingWhen(values, runAtPast);
7679
6546
  const scheduled = values.when !== "now" && values.when !== "manual";
@@ -7685,7 +6552,7 @@ function WorkflowComposer({
7685
6552
  setValues({
7686
6553
  ...values,
7687
6554
  workflowId: next,
7688
- inputs: def ? chunkOWCEQKAR_cjs.defaultInputs(def) : {},
6555
+ inputs: def ? chunk6F7SZCVL_cjs.defaultInputs(def) : {},
7689
6556
  ...def?.documentAction ? { access: "standing" } : {}
7690
6557
  });
7691
6558
  };
@@ -7813,7 +6680,7 @@ function WorkflowComposer({
7813
6680
  },
7814
6681
  "data-testid": `${id}-dropzone`,
7815
6682
  children: /* @__PURE__ */ jsxRuntime.jsx(
7816
- chunk44R3CCZT_cjs.AddFilesFirst,
6683
+ chunkWS5EX7DN_cjs.AddFilesFirst,
7817
6684
  {
7818
6685
  reason: l.addFilesReason,
7819
6686
  action: addFilesAction,
@@ -7823,7 +6690,7 @@ function WorkflowComposer({
7823
6690
  }
7824
6691
  ),
7825
6692
  !noFiles && workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
7826
- chunkLIHRGG4M_cjs.SchemaForm,
6693
+ chunkCHVCTKF4_cjs.SchemaForm,
7827
6694
  {
7828
6695
  fields,
7829
6696
  values: values.inputs,
@@ -8248,7 +7115,7 @@ function WorkTaskComposer({
8248
7115
  // eslint-disable-next-line react-hooks/exhaustive-deps
8249
7116
  [workflows, open]
8250
7117
  );
8251
- const [values, setValues] = useControllableState(
7118
+ const [values, setValues] = chunkCHVCTKF4_cjs.useControllableState(
8252
7119
  valuesProp,
8253
7120
  seed,
8254
7121
  onValuesChange
@@ -8262,7 +7129,7 @@ function WorkTaskComposer({
8262
7129
  }, [open]);
8263
7130
  const workflow = workflows.find((w) => w.id === values.workflowId);
8264
7131
  const fields = workflow?.inputs ?? [];
8265
- const errors = workflow ? chunkOWCEQKAR_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs) : {};
7132
+ const errors = workflow ? chunk6F7SZCVL_cjs.validateInputs({ ...workflow, inputs: fields }, values.inputs) : {};
8266
7133
  const hasWork = configOpen && Boolean(workflow) && Object.keys(errors).length === 0;
8267
7134
  const unattended = hasWork && values.when !== "now" && values.when !== "manual";
8268
7135
  const canConfigure = !isEdit || seed.assignee === "agent";
@@ -8270,7 +7137,7 @@ function WorkTaskComposer({
8270
7137
  const set = (key, value) => setValues({ ...values, [key]: value });
8271
7138
  const pickWorkflow = (id2) => {
8272
7139
  const next = workflows.find((w) => w.id === id2);
8273
- setValues({ ...values, workflowId: id2, inputs: next ? chunkOWCEQKAR_cjs.defaultInputs(next) : {} });
7140
+ setValues({ ...values, workflowId: id2, inputs: next ? chunk6F7SZCVL_cjs.defaultInputs(next) : {} });
8274
7141
  };
8275
7142
  const openConfigure = () => {
8276
7143
  setConfigOpen(true);
@@ -8456,7 +7323,7 @@ function WorkTaskComposer({
8456
7323
  )
8457
7324
  ] }),
8458
7325
  workflow && fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
8459
- chunkLIHRGG4M_cjs.SchemaForm,
7326
+ chunkCHVCTKF4_cjs.SchemaForm,
8460
7327
  {
8461
7328
  fields,
8462
7329
  values: values.inputs,
@@ -10400,7 +9267,7 @@ function AgentCreateView({
10400
9267
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-normal text-muted-foreground", children: l.optional })
10401
9268
  ] }),
10402
9269
  /* @__PURE__ */ jsxRuntime.jsx(
10403
- chunkS5HZBXZA_cjs.MultiSelect,
9270
+ chunkRFIBUWLF_cjs.MultiSelect,
10404
9271
  {
10405
9272
  data: workspaces.map((ws) => ({ label: ws.name, value: ws.id })),
10406
9273
  value: selectedWorkspaces,
@@ -10447,7 +9314,6 @@ exports.AgentCreator = AgentCreator;
10447
9314
  exports.AgentEditView = AgentEditView;
10448
9315
  exports.AgentGallery = AgentGallery;
10449
9316
  exports.AgentMainView = AgentMainView;
10450
- exports.AgentSelect = AgentSelect;
10451
9317
  exports.AgentTypeSelector = AgentTypeSelector;
10452
9318
  exports.CapabilityGrid = CapabilityGrid;
10453
9319
  exports.CapabilityTile = CapabilityTile;
@@ -10473,7 +9339,6 @@ exports.DEFAULT_AGENT_BAR_LABELS = DEFAULT_AGENT_BAR_LABELS;
10473
9339
  exports.DEFAULT_AGENT_CARD_LABELS = DEFAULT_AGENT_CARD_LABELS;
10474
9340
  exports.DEFAULT_AGENT_CREATOR_LABELS = DEFAULT_AGENT_CREATOR_LABELS;
10475
9341
  exports.DEFAULT_AGENT_GALLERY_LABELS = DEFAULT_AGENT_GALLERY_LABELS;
10476
- exports.DEFAULT_AGENT_SELECT_LABELS = DEFAULT_AGENT_SELECT_LABELS;
10477
9342
  exports.DEFAULT_AGENT_STEPS_LABELS = DEFAULT_AGENT_STEPS_LABELS;
10478
9343
  exports.DEFAULT_AGENT_TYPE_SELECTOR_LABELS = DEFAULT_AGENT_TYPE_SELECTOR_LABELS;
10479
9344
  exports.DEFAULT_AUTHORIZE_AGENT_LABELS = DEFAULT_AUTHORIZE_AGENT_LABELS;
@@ -10500,15 +9365,12 @@ exports.DEFAULT_TASK_PLAN_LABELS = DEFAULT_TASK_PLAN_LABELS;
10500
9365
  exports.DEFAULT_TASK_RUNS_DIALOG_LABELS = DEFAULT_TASK_RUNS_DIALOG_LABELS;
10501
9366
  exports.DEFAULT_TASK_STATUS_PILL_LABELS = DEFAULT_TASK_STATUS_PILL_LABELS;
10502
9367
  exports.DEFAULT_TASK_THREAD_CHIP_LABELS = DEFAULT_TASK_THREAD_CHIP_LABELS;
10503
- exports.DEFAULT_TASK_TRIGGER_CHIP_LABELS = DEFAULT_TASK_TRIGGER_CHIP_LABELS;
10504
9368
  exports.DEFAULT_THREAD_LAUNCHER_LABELS = DEFAULT_THREAD_LAUNCHER_LABELS;
10505
9369
  exports.DEFAULT_THREAD_STATE_LABELS = DEFAULT_THREAD_STATE_LABELS;
10506
9370
  exports.DEFAULT_TUPLE_ARRAY_FIELD_LABELS = DEFAULT_TUPLE_ARRAY_FIELD_LABELS;
10507
9371
  exports.DEFAULT_UPLOAD_TASK_ITEM_LABELS = DEFAULT_UPLOAD_TASK_ITEM_LABELS;
10508
9372
  exports.DEFAULT_UPLOAD_TASK_LIST_LABELS = DEFAULT_UPLOAD_TASK_LIST_LABELS;
10509
9373
  exports.DEFAULT_WORKFLOWS_CHROME_LABELS = DEFAULT_WORKFLOWS_CHROME_LABELS;
10510
- exports.DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS = DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS;
10511
- exports.DEFAULT_WORKFLOW_LIST_LABELS = DEFAULT_WORKFLOW_LIST_LABELS;
10512
9374
  exports.DEFAULT_WORKFLOW_RUN_STATUS_LABELS = DEFAULT_WORKFLOW_RUN_STATUS_LABELS;
10513
9375
  exports.DEFAULT_WORKFLOW_THREAD_STRIP_LABELS = DEFAULT_WORKFLOW_THREAD_STRIP_LABELS;
10514
9376
  exports.DERIVED_NAME_WORDS = DERIVED_NAME_WORDS;
@@ -10517,7 +9379,6 @@ exports.EntityChip = EntityChip;
10517
9379
  exports.GoalCriteria = GoalCriteria;
10518
9380
  exports.MAX_TASK_DEPTH = MAX_TASK_DEPTH;
10519
9381
  exports.NewThreadDialog = NewThreadDialog;
10520
- exports.PersonPill = PersonPill;
10521
9382
  exports.PillSelect = PillSelect;
10522
9383
  exports.RecurrenceBuilder = RecurrenceBuilder;
10523
9384
  exports.STATUS_LABELS = STATUS_LABELS;
@@ -10560,7 +9421,6 @@ exports.TaskStartDialog = TaskStartDialog;
10560
9421
  exports.TaskStatusPill = TaskStatusPill;
10561
9422
  exports.TaskTable = TaskTable;
10562
9423
  exports.TaskThreadChip = TaskThreadChip;
10563
- exports.TaskTriggerChip = TaskTriggerChip;
10564
9424
  exports.TasksToolbar = TasksToolbar;
10565
9425
  exports.ThreadActivity = ThreadActivity;
10566
9426
  exports.ThreadLauncher = ThreadLauncher;
@@ -10570,14 +9430,9 @@ exports.TupleArrayField = TupleArrayField;
10570
9430
  exports.UploadTaskItem = UploadTaskItem;
10571
9431
  exports.UploadTaskList = UploadTaskList;
10572
9432
  exports.WEEKDAYS = WEEKDAYS;
10573
- exports.WORKFLOW_COLUMN_ORDER = WORKFLOW_COLUMN_ORDER;
10574
- exports.WorkflowConfigDialog = WorkflowConfigDialog;
10575
- exports.WorkflowDocumentsField = WorkflowDocumentsField;
10576
- exports.WorkflowLauncher = WorkflowLauncher;
10577
9433
  exports.WorkflowRunStatus = WorkflowRunStatus;
10578
9434
  exports.WorkflowThreadStartedBy = WorkflowThreadStartedBy;
10579
9435
  exports.WorkflowThreadStrip = WorkflowThreadStrip;
10580
- exports.WorkflowsTable = WorkflowsTable;
10581
9436
  exports.WorkflowsToolbar = WorkflowsToolbar;
10582
9437
  exports.agentConfigSectionToValues = agentConfigSectionToValues;
10583
9438
  exports.agentCreatorToConfigSection = agentCreatorToConfigSection;
@@ -10585,7 +9440,6 @@ exports.asTaskStatus = asTaskStatus;
10585
9440
  exports.authModeFor = authModeFor;
10586
9441
  exports.buildRRule = buildRRule;
10587
9442
  exports.buildTaskRows = buildTaskRows;
10588
- exports.buildWorkflowScopeSource = buildWorkflowScopeSource;
10589
9443
  exports.compactThreadActivity = compactThreadActivity;
10590
9444
  exports.composePersona = composePersona;
10591
9445
  exports.composerToTaskQuery = composerToTaskQuery;
@@ -10593,7 +9447,6 @@ exports.composerToWorkRequest = composerToWorkRequest;
10593
9447
  exports.composerToWorkflowRequest = composerToWorkflowRequest;
10594
9448
  exports.composerToWorkflowUpdate = composerToWorkflowUpdate;
10595
9449
  exports.createTaskColumns = createTaskColumns;
10596
- exports.createWorkflowColumns = createWorkflowColumns;
10597
9450
  exports.createsWork = createsWork;
10598
9451
  exports.defaultScopeRenderer = defaultScopeRenderer;
10599
9452
  exports.defaultTaskComposerValues = defaultTaskComposerValues;
@@ -10607,7 +9460,6 @@ exports.formatElapsed = formatElapsed;
10607
9460
  exports.goalProgress = goalProgress;
10608
9461
  exports.groupThreadActivity = groupThreadActivity;
10609
9462
  exports.hasTaskFields = hasTaskFields;
10610
- exports.hasTrigger = hasTrigger;
10611
9463
  exports.humanizeSection = humanizeSection;
10612
9464
  exports.indexTasks = indexTasks;
10613
9465
  exports.inferType = inferType;
@@ -10615,12 +9467,10 @@ exports.inputDocumentIds = inputDocumentIds;
10615
9467
  exports.isAgenticWorkflow = isAgenticWorkflow;
10616
9468
  exports.isOutOfBounds = isOutOfBounds;
10617
9469
  exports.isPlainTodo = isPlainTodo;
10618
- exports.isSkillRow = isSkillRow;
10619
9470
  exports.isValidAgentName = isValidAgentName;
10620
9471
  exports.isoToLocalInput = isoToLocalInput;
10621
9472
  exports.linkedRunsFromActivity = linkedRunsFromActivity;
10622
9473
  exports.localInputToIso = localInputToIso;
10623
- exports.matchWorkflowScope = matchWorkflowScope;
10624
9474
  exports.moveTargets = moveTargets;
10625
9475
  exports.newThreadToRequest = newThreadToRequest;
10626
9476
  exports.nextCriterionId = nextCriterionId;
@@ -10636,10 +9486,8 @@ exports.taskComposerToUpdateRequest = taskComposerToUpdateRequest;
10636
9486
  exports.taskNeedsAccess = taskNeedsAccess;
10637
9487
  exports.taskToComposerValues = taskToComposerValues;
10638
9488
  exports.useWorkflowPreview = useWorkflowPreview;
10639
- exports.workflowStatus = workflowStatus;
10640
9489
  exports.workflowTaskFields = workflowTaskFields;
10641
9490
  exports.workflowToComposerValues = workflowToComposerValues;
10642
- exports.workflowTriggerType = workflowTriggerType;
10643
9491
  exports.workflowWhen = workflowWhen;
10644
- //# sourceMappingURL=chunk-OZLWSNUC.cjs.map
10645
- //# sourceMappingURL=chunk-OZLWSNUC.cjs.map
9492
+ //# sourceMappingURL=chunk-JY73DJOS.cjs.map
9493
+ //# sourceMappingURL=chunk-JY73DJOS.cjs.map