@arbidocs/blocks 0.4.135 → 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 (123) hide show
  1. package/dist/agents/index.cjs +422 -367
  2. package/dist/agents/index.js +8 -9
  3. package/dist/agents/skills/index.d.ts +2 -0
  4. package/dist/agents/skills/skillFiles.d.ts +65 -0
  5. package/dist/agents/skills/skillImport.d.ts +36 -0
  6. package/dist/agents/workflows/WorkflowDocumentsField.d.ts +42 -5
  7. package/dist/agents/workflows/index.d.ts +3 -3
  8. package/dist/agents/workflows/workflow.d.ts +19 -0
  9. package/dist/agents/workflows/workspaceScope.d.ts +12 -0
  10. package/dist/chat/index.cjs +138 -138
  11. package/dist/chat/index.js +3 -3
  12. package/dist/chunk-2KUCVSFF.js +51 -0
  13. package/dist/chunk-2KUCVSFF.js.map +1 -0
  14. package/dist/{chunk-GDBDHOI4.js → chunk-3RJN2VTL.js} +36 -6
  15. package/dist/chunk-3RJN2VTL.js.map +1 -0
  16. package/dist/{chunk-6AALMYPS.cjs → chunk-6F7SZCVL.cjs} +23 -2
  17. package/dist/chunk-6F7SZCVL.cjs.map +1 -0
  18. package/dist/{chunk-PUCY3UXN.js → chunk-7M4C6CK7.js} +3 -3
  19. package/dist/{chunk-PUCY3UXN.js.map → chunk-7M4C6CK7.js.map} +1 -1
  20. package/dist/{chunk-2PNNCEPH.js → chunk-ATJUVHVB.js} +1545 -8
  21. package/dist/chunk-ATJUVHVB.js.map +1 -0
  22. package/dist/{chunk-4S5IDT5F.cjs → chunk-BUNZWOPX.cjs} +5 -5
  23. package/dist/{chunk-4S5IDT5F.cjs.map → chunk-BUNZWOPX.cjs.map} +1 -1
  24. package/dist/{chunk-KYDRUFWT.cjs → chunk-C3ZRLULA.cjs} +5 -5
  25. package/dist/{chunk-KYDRUFWT.cjs.map → chunk-C3ZRLULA.cjs.map} +1 -1
  26. package/dist/{chunk-SARREDFP.cjs → chunk-CHVCTKF4.cjs} +1620 -47
  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-4UMXQPNA.js → chunk-E5OYHJMU.js} +3 -3
  31. package/dist/{chunk-4UMXQPNA.js.map → chunk-E5OYHJMU.js.map} +1 -1
  32. package/dist/{chunk-PJJY6CYL.cjs → chunk-EHOPZBAX.cjs} +11 -11
  33. package/dist/{chunk-PJJY6CYL.cjs.map → chunk-EHOPZBAX.cjs.map} +1 -1
  34. package/dist/{chunk-4QIIDXLF.cjs → chunk-HDYWXEQU.cjs} +8 -8
  35. package/dist/{chunk-4QIIDXLF.cjs.map → chunk-HDYWXEQU.cjs.map} +1 -1
  36. package/dist/{chunk-GZPTWHP5.cjs → chunk-HLB4DIYV.cjs} +5 -5
  37. package/dist/{chunk-GZPTWHP5.cjs.map → chunk-HLB4DIYV.cjs.map} +1 -1
  38. package/dist/{chunk-TT6XV6WM.cjs → chunk-JY73DJOS.cjs} +78 -1274
  39. package/dist/chunk-JY73DJOS.cjs.map +1 -0
  40. package/dist/{chunk-ARDHLU73.cjs → chunk-KDUGTKVI.cjs} +21 -2
  41. package/dist/chunk-KDUGTKVI.cjs.map +1 -0
  42. package/dist/{chunk-UMIY4SQS.js → chunk-KMNZ2RVO.js} +17 -1191
  43. package/dist/chunk-KMNZ2RVO.js.map +1 -0
  44. package/dist/{chunk-6S5FLMWG.js → chunk-KSHKTOY2.js} +203 -7
  45. package/dist/chunk-KSHKTOY2.js.map +1 -0
  46. package/dist/{chunk-4RLCRFZS.js → chunk-L2PAPOZ5.js} +21 -3
  47. package/dist/chunk-L2PAPOZ5.js.map +1 -0
  48. package/dist/{chunk-QYTYW74G.js → chunk-L3T7OJRX.js} +4 -4
  49. package/dist/{chunk-QYTYW74G.js.map → chunk-L3T7OJRX.js.map} +1 -1
  50. package/dist/{chunk-ENDP7JER.js → chunk-M33QUNFH.js} +3 -3
  51. package/dist/{chunk-ENDP7JER.js.map → chunk-M33QUNFH.js.map} +1 -1
  52. package/dist/chunk-RFIBUWLF.cjs +232 -0
  53. package/dist/chunk-RFIBUWLF.cjs.map +1 -0
  54. package/dist/{chunk-N26CXGXC.cjs → chunk-RQ2Y7USX.cjs} +201 -3
  55. package/dist/chunk-RQ2Y7USX.cjs.map +1 -0
  56. package/dist/chunk-UUHUQHXR.cjs +56 -0
  57. package/dist/chunk-UUHUQHXR.cjs.map +1 -0
  58. package/dist/{chunk-SZX44LCT.js → chunk-VMESMX7N.js} +3 -3
  59. package/dist/{chunk-SZX44LCT.js.map → chunk-VMESMX7N.js.map} +1 -1
  60. package/dist/{chunk-QDEODGXE.cjs → chunk-WS5EX7DN.cjs} +37 -6
  61. package/dist/chunk-WS5EX7DN.cjs.map +1 -0
  62. package/dist/{chunk-2DFDFOM7.js → chunk-YOMPLCP6.js} +22 -3
  63. package/dist/chunk-YOMPLCP6.js.map +1 -0
  64. package/dist/connect/docx.cjs +4 -4
  65. package/dist/connect/docx.js +3 -3
  66. package/dist/connect/index.cjs +463 -97
  67. package/dist/connect/index.cjs.map +1 -1
  68. package/dist/connect/index.d.ts +5 -2
  69. package/dist/connect/index.js +387 -49
  70. package/dist/connect/index.js.map +1 -1
  71. package/dist/connection/ConnectedSkillUpload.d.ts +26 -2
  72. package/dist/connection/ConnectedWorkflowBuilder.d.ts +24 -12
  73. package/dist/connection/ConnectedWorkflowLauncher.d.ts +35 -0
  74. package/dist/connection/ConnectedWorkflowsTable.d.ts +62 -0
  75. package/dist/connection/ConnectionProvider.d.ts +17 -0
  76. package/dist/connection/workspaceData.d.ts +45 -0
  77. package/dist/facts/index.cjs +1 -1
  78. package/dist/facts/index.js +1 -1
  79. package/dist/files/index.cjs +1 -1
  80. package/dist/files/index.js +1 -1
  81. package/dist/home/index.cjs +20 -21
  82. package/dist/home/index.cjs.map +1 -1
  83. package/dist/home/index.js +2 -3
  84. package/dist/home/index.js.map +1 -1
  85. package/dist/index.cjs +610 -555
  86. package/dist/index.cjs.map +1 -1
  87. package/dist/index.js +14 -15
  88. package/dist/index.js.map +1 -1
  89. package/dist/settings/index.cjs +11 -11
  90. package/dist/settings/index.js +2 -2
  91. package/dist/shell/index.cjs +1 -1
  92. package/dist/shell/index.js +1 -1
  93. package/dist/site/index.cjs +5 -5
  94. package/dist/site/index.js +1 -1
  95. package/dist/studio/index.cjs +7 -7
  96. package/dist/studio/index.js +5 -5
  97. package/dist/workflow-canvas/index.cjs +122 -96
  98. package/dist/workflow-canvas/index.cjs.map +1 -1
  99. package/dist/workflow-canvas/index.d.ts +1 -1
  100. package/dist/workflow-canvas/index.js +73 -48
  101. package/dist/workflow-canvas/index.js.map +1 -1
  102. package/node_modules/@arbidocs/coedit/package.json +1 -1
  103. package/package.json +4 -4
  104. package/dist/chunk-2DFDFOM7.js.map +0 -1
  105. package/dist/chunk-2PNNCEPH.js.map +0 -1
  106. package/dist/chunk-4RLCRFZS.js.map +0 -1
  107. package/dist/chunk-4XJZ6AAY.js +0 -407
  108. package/dist/chunk-4XJZ6AAY.js.map +0 -1
  109. package/dist/chunk-6AALMYPS.cjs.map +0 -1
  110. package/dist/chunk-6S5FLMWG.js.map +0 -1
  111. package/dist/chunk-7D737FLE.cjs +0 -43
  112. package/dist/chunk-7D737FLE.cjs.map +0 -1
  113. package/dist/chunk-ARDHLU73.cjs.map +0 -1
  114. package/dist/chunk-GDBDHOI4.js.map +0 -1
  115. package/dist/chunk-N26CXGXC.cjs.map +0 -1
  116. package/dist/chunk-QDEODGXE.cjs.map +0 -1
  117. package/dist/chunk-S5HZBXZA.cjs +0 -430
  118. package/dist/chunk-S5HZBXZA.cjs.map +0 -1
  119. package/dist/chunk-SARREDFP.cjs.map +0 -1
  120. package/dist/chunk-TT6XV6WM.cjs.map +0 -1
  121. package/dist/chunk-UMIY4SQS.js.map +0 -1
  122. package/dist/chunk-XD2M6LIG.js +0 -41
  123. package/dist/chunk-XD2M6LIG.js.map +0 -1
@@ -3,31 +3,35 @@
3
3
 
4
4
  var chunkO4YPVYPO_cjs = require('../chunk-O4YPVYPO.cjs');
5
5
  var chunkAAFX64WD_cjs = require('../chunk-AAFX64WD.cjs');
6
- var chunk4QIIDXLF_cjs = require('../chunk-4QIIDXLF.cjs');
7
- var chunkGZPTWHP5_cjs = require('../chunk-GZPTWHP5.cjs');
8
- var chunkARDHLU73_cjs = require('../chunk-ARDHLU73.cjs');
6
+ var chunkHDYWXEQU_cjs = require('../chunk-HDYWXEQU.cjs');
7
+ var chunkUUHUQHXR_cjs = require('../chunk-UUHUQHXR.cjs');
8
+ var chunkHLB4DIYV_cjs = require('../chunk-HLB4DIYV.cjs');
9
+ var chunkKDUGTKVI_cjs = require('../chunk-KDUGTKVI.cjs');
9
10
  var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
10
11
  require('../chunk-S24XEVPS.cjs');
11
12
  require('../chunk-V5OAXIBN.cjs');
12
13
  require('../chunk-5FYU7ZIU.cjs');
13
- var chunkKYDRUFWT_cjs = require('../chunk-KYDRUFWT.cjs');
14
+ var chunkC3ZRLULA_cjs = require('../chunk-C3ZRLULA.cjs');
14
15
  var chunkO6IEZDRC_cjs = require('../chunk-O6IEZDRC.cjs');
15
16
  var chunkI2QSDQQV_cjs = require('../chunk-I2QSDQQV.cjs');
16
17
  require('../chunk-RC25WMVB.cjs');
17
- var chunkSARREDFP_cjs = require('../chunk-SARREDFP.cjs');
18
+ var chunkCHVCTKF4_cjs = require('../chunk-CHVCTKF4.cjs');
18
19
  require('../chunk-DETZZBG2.cjs');
19
- var chunkN26CXGXC_cjs = require('../chunk-N26CXGXC.cjs');
20
+ var chunkRQ2Y7USX_cjs = require('../chunk-RQ2Y7USX.cjs');
21
+ require('../chunk-ZW6FPIFC.cjs');
22
+ require('../chunk-WS5EX7DN.cjs');
23
+ require('../chunk-R26BK7YL.cjs');
24
+ require('../chunk-V4ISCZJ7.cjs');
20
25
  var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
21
26
  require('../chunk-C2CWWEHO.cjs');
22
- require('../chunk-7D737FLE.cjs');
23
27
  var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
24
28
  require('../chunk-ADOKTJHV.cjs');
25
29
  var chunkDWZXSPMB_cjs = require('../chunk-DWZXSPMB.cjs');
26
30
  var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
27
- var chunkPJJY6CYL_cjs = require('../chunk-PJJY6CYL.cjs');
31
+ var chunkEHOPZBAX_cjs = require('../chunk-EHOPZBAX.cjs');
28
32
  require('../chunk-B6MVQCXW.cjs');
29
33
  var chunkJKB7WT7L_cjs = require('../chunk-JKB7WT7L.cjs');
30
- var chunk6AALMYPS_cjs = require('../chunk-6AALMYPS.cjs');
34
+ var chunk6F7SZCVL_cjs = require('../chunk-6F7SZCVL.cjs');
31
35
  require('../chunk-32HW2Q33.cjs');
32
36
  require('../chunk-7UTB4PHM.cjs');
33
37
  require('../chunk-FX3K6LNZ.cjs');
@@ -42,15 +46,15 @@ var reactQuery = require('@tanstack/react-query');
42
46
  var react$1 = require('@arbidocs/react');
43
47
  var jsxRuntime = require('react/jsx-runtime');
44
48
  var ui = require('@arbidocs/react/ui');
45
- var artifacts = require('@arbidocs/react/artifacts');
46
49
  var lucideReact = require('lucide-react');
50
+ var artifacts = require('@arbidocs/react/artifacts');
47
51
  var documentTools = require('@arbidocs/react/document-tools');
48
52
  var shell = require('@arbidocs/react/shell');
49
53
  var client = require('@arbidocs/client');
50
54
  var reactDom = require('react-dom');
51
55
 
52
56
  function ConnectionBoundWebSocket({ children }) {
53
- const { status } = chunkARDHLU73_cjs.useConnection();
57
+ const { status } = chunkKDUGTKVI_cjs.useConnection();
54
58
  return /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiWebSocketProvider, { enabled: status === "authenticated", children });
55
59
  }
56
60
  function ArbiAppProvider({
@@ -63,10 +67,10 @@ function ArbiAppProvider({
63
67
  })
64
68
  );
65
69
  const providerUrl = config.apiUrl || config.demoApiUrl || "https://demo.arbi.local";
66
- return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiProvider, { url: providerUrl, deploymentDomain: config.deploymentDomain, children: /* @__PURE__ */ jsxRuntime.jsx(chunkARDHLU73_cjs.ConnectionProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(ConnectionBoundWebSocket, { children }) }) }) });
70
+ return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiProvider, { url: providerUrl, deploymentDomain: config.deploymentDomain, children: /* @__PURE__ */ jsxRuntime.jsx(chunkKDUGTKVI_cjs.ConnectionProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(ConnectionBoundWebSocket, { children }) }) }) });
67
71
  }
68
72
  function ConnectedTaskAccessRequest({ conversationId }) {
69
- const { workspaceId } = chunkARDHLU73_cjs.useConnection();
73
+ const { workspaceId } = chunkKDUGTKVI_cjs.useConnection();
70
74
  const tasks = react$1.useConversations(workspaceId ?? void 0, { live: true });
71
75
  const run = react$1.useRunConversation();
72
76
  const task = tasks.data?.find((item) => item.external_id === conversationId);
@@ -98,7 +102,7 @@ function ConnectedWorkspaceActivity({
98
102
  pageSize,
99
103
  ...listProps
100
104
  }) {
101
- const { workspaceId: selected, status, ensureWorkspaceOpen } = chunkARDHLU73_cjs.useConnection();
105
+ const { workspaceId: selected, status, ensureWorkspaceOpen } = chunkKDUGTKVI_cjs.useConnection();
102
106
  const workspaceId = workspaceProp ?? selected ?? void 0;
103
107
  const live = status === "authenticated" && !!workspaceId;
104
108
  const feed = react$1.useWorkspaceActivity(workspaceId, {
@@ -125,7 +129,7 @@ function ConnectedWorkspaceActivity({
125
129
  [feed.data]
126
130
  );
127
131
  return /* @__PURE__ */ jsxRuntime.jsx(
128
- chunkKYDRUFWT_cjs.WorkspaceActivityList,
132
+ chunkC3ZRLULA_cjs.WorkspaceActivityList,
129
133
  {
130
134
  ...listProps,
131
135
  items,
@@ -144,14 +148,14 @@ function ConnectedWorkspaceNotificationMenu({
144
148
  workspaceId: workspaceProp,
145
149
  ...menuProps
146
150
  }) {
147
- const { workspaceId: selected, status } = chunkARDHLU73_cjs.useConnection();
151
+ const { workspaceId: selected, status } = chunkKDUGTKVI_cjs.useConnection();
148
152
  const workspaceId = workspaceProp ?? selected;
149
153
  const { level, setLevel, isLoading, isSaving } = react$1.useWorkspaceNotificationLevel(workspaceId, {
150
154
  enabled: status === "authenticated"
151
155
  });
152
156
  if (!workspaceId) return null;
153
157
  return /* @__PURE__ */ jsxRuntime.jsx(
154
- chunkKYDRUFWT_cjs.WorkspaceNotificationMenu,
158
+ chunkC3ZRLULA_cjs.WorkspaceNotificationMenu,
155
159
  {
156
160
  ...menuProps,
157
161
  level,
@@ -165,12 +169,12 @@ function ConnectedThreadFollow({
165
169
  as = "button",
166
170
  ...props
167
171
  }) {
168
- const { status } = chunkARDHLU73_cjs.useConnection();
172
+ const { status } = chunkKDUGTKVI_cjs.useConnection();
169
173
  const { following, setFollowing, isLoading, isSaving } = react$1.useFollowThread(conversationId, {
170
174
  enabled: status === "authenticated"
171
175
  });
172
176
  if (!conversationId) return null;
173
- const Control = as === "menu-item" ? chunkKYDRUFWT_cjs.ThreadFollowMenuItem : chunkKYDRUFWT_cjs.ThreadFollowButton;
177
+ const Control = as === "menu-item" ? chunkC3ZRLULA_cjs.ThreadFollowMenuItem : chunkC3ZRLULA_cjs.ThreadFollowButton;
174
178
  return /* @__PURE__ */ jsxRuntime.jsx(
175
179
  Control,
176
180
  {
@@ -181,48 +185,381 @@ function ConnectedThreadFollow({
181
185
  }
182
186
  );
183
187
  }
184
- function ConnectedSkillUpload() {
185
- const [name, setName] = react.useState("");
186
- const [file, setFile] = react.useState(null);
187
- const upload = react$1.useUploadSkillFiles();
188
- const slug = name.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
189
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-3 rounded-lg border p-4", "data-testid": "skill-upload", children: [
190
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold", children: "Add a skill" }),
191
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Upload a SKILL.md file containing the instructions your assistant should follow." }),
192
- /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "skill-upload-name", children: "Skill name" }),
193
- /* @__PURE__ */ jsxRuntime.jsx(
194
- ui.Input,
195
- {
196
- id: "skill-upload-name",
197
- value: name,
198
- onChange: (event) => setName(event.target.value),
199
- placeholder: "disclosure-review",
200
- "data-testid": "skill-upload-name"
201
- }
188
+ function useConnectedWorkspaceRole() {
189
+ const { workspaceId, live, userId, ensureWorkspaceOpen } = chunkKDUGTKVI_cjs.useConnectedWorkspace();
190
+ const { data: members = [] } = react$1.useWorkspaceUsers(workspaceId ?? void 0, {
191
+ enabled: live && !!workspaceId,
192
+ beforeFetch: ensureWorkspaceOpen
193
+ });
194
+ const role = members.find((m) => m.user.external_id === userId)?.role;
195
+ return {
196
+ members,
197
+ role,
198
+ /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */
199
+ canEditShared: role === "owner" || role === "collaborator",
200
+ /** With an item's creator, the only one who deletes it. */
201
+ isWorkspaceOwner: role === "owner"
202
+ };
203
+ }
204
+ var DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS = {
205
+ updateFailed: "Could not update the workflow",
206
+ deleteTitle: "Delete workflow",
207
+ deleteOne: (name) => `Delete \u201C${name}\u201D? Threads it already created stay.`,
208
+ deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,
209
+ runFailed: "The workflow failed. You can send an error report from its history.",
210
+ noThread: "The workflow did not create a thread.",
211
+ documentAction: (workflow) => workflow.action?.type === "email_documents" ? "Preparing your document email" : "Reviewing documents",
212
+ untitledTask: "Untitled thread"
213
+ };
214
+ var messageOf = (error) => error instanceof Error ? error.message : "";
215
+ function ConnectedWorkflowsTable({
216
+ filter,
217
+ describeTrigger = (w) => chunkCHVCTKF4_cjs.workflowTriggerType(w).replaceAll("_", " "),
218
+ formatDate = chunkKDG6FER6_cjs.fmtDate,
219
+ onViewRuns,
220
+ connectedLabels,
221
+ ...tableProps
222
+ }) {
223
+ const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels };
224
+ const { notify, confirm, openConversation } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
225
+ const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole();
226
+ const { data: saved = [], isLoading } = react$1.useWorkflows({ live: true });
227
+ const { data: conversations, refetch } = chunkUUHUQHXR_cjs.useConnectedConversations({ live: true });
228
+ const { data: agents = [] } = react$1.useAgents();
229
+ const update = react$1.useUpdateWorkflow();
230
+ const remove = react$1.useDeleteWorkflow();
231
+ const run = react$1.useRunWorkflow();
232
+ const [busyId, setBusyId] = react.useState(null);
233
+ const workflows = react.useMemo(() => filter ? saved.filter(filter) : saved, [saved, filter]);
234
+ const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ""}`).join("|");
235
+ react.useEffect(() => {
236
+ void refetch?.();
237
+ }, [firingStamp, refetch]);
238
+ const lastRuns = react.useMemo(() => {
239
+ const out = {};
240
+ for (const c of conversations) {
241
+ const id = c.workflow_ext_id;
242
+ if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))
243
+ out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status };
244
+ }
245
+ return out;
246
+ }, [conversations]);
247
+ const agentNames = react.useMemo(
248
+ () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),
249
+ [agents]
250
+ );
251
+ const taskNames = react.useMemo(
252
+ () => Object.fromEntries(
253
+ conversations.filter((c) => c.status != null).map((c) => [c.external_id, c.title || l.untitledTask])
202
254
  ),
203
- /* @__PURE__ */ jsxRuntime.jsx(
204
- ui.Input,
255
+ [conversations, l.untitledTask]
256
+ );
257
+ const act = async (workflow, action) => {
258
+ setBusyId(workflow.external_id);
259
+ try {
260
+ await action();
261
+ } catch (error) {
262
+ notify(messageOf(error) || l.updateFailed, "error");
263
+ } finally {
264
+ setBusyId(null);
265
+ }
266
+ };
267
+ const setActive = (workflow, active) => act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }));
268
+ const deleteAll = async (items) => {
269
+ if (!items.length) return;
270
+ const ok = await confirm({
271
+ title: l.deleteTitle,
272
+ message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length)
273
+ });
274
+ if (!ok) return;
275
+ for (const workflow of items)
276
+ await act(workflow, () => remove.mutateAsync(workflow.external_id));
277
+ };
278
+ return /* @__PURE__ */ jsxRuntime.jsx(
279
+ chunkCHVCTKF4_cjs.WorkflowsTable,
280
+ {
281
+ ...tableProps,
282
+ workflows,
283
+ isLoading,
284
+ busyId,
285
+ describeTrigger,
286
+ formatDate,
287
+ agentNames,
288
+ taskNames,
289
+ lastRuns,
290
+ canEditShared,
291
+ isWorkspaceOwner,
292
+ onOpenThread: (conversationId) => openConversation(conversationId),
293
+ onViewRuns,
294
+ onToggleActive: (workflow, active) => void setActive(workflow, active),
295
+ onToggleActiveMany: (items, active) => {
296
+ void (async () => {
297
+ for (const workflow of items) await setActive(workflow, active);
298
+ })();
299
+ },
300
+ onToggleShared: (workflow, shared) => void act(
301
+ workflow,
302
+ () => update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })
303
+ ),
304
+ onDelete: (workflow) => void deleteAll([workflow]),
305
+ onDeleteMany: (items) => void deleteAll(items),
306
+ onRun: (workflow) => void act(workflow, async () => {
307
+ const result = await run.mutateAsync(workflow.external_id);
308
+ if (result.conversation_ext_id) openConversation(result.conversation_ext_id);
309
+ if (result.error) {
310
+ onViewRuns?.(workflow);
311
+ notify(l.runFailed, "error");
312
+ return;
313
+ }
314
+ if (result.execution_id && !result.conversation_ext_id) {
315
+ onViewRuns?.(workflow);
316
+ notify(l.documentAction(workflow), "success");
317
+ return;
318
+ }
319
+ if (!result.conversation_ext_id) throw new Error(l.noThread);
320
+ })
321
+ }
322
+ );
323
+ }
324
+ var IMAGE_FILE_TYPES = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "bmp", "tiff", "webp"]);
325
+ function toWorkflowFieldDocument(doc) {
326
+ const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? "").toLowerCase());
327
+ return {
328
+ id: doc.external_id,
329
+ title: doc.doc_metadata?.title || doc.file_name || doc.external_id,
330
+ fileName: doc.file_name,
331
+ pages: isImage ? null : doc.n_pages ?? null,
332
+ tokens: isImage ? null : doc.tokens ?? null,
333
+ status: doc.status,
334
+ isImage
335
+ };
336
+ }
337
+ function useConnectedWorkflowScopeSource() {
338
+ const { data: docs } = chunkUUHUQHXR_cjs.useConnectedDocuments();
339
+ const { data: tags } = chunkUUHUQHXR_cjs.useConnectedTags();
340
+ return react.useMemo(() => chunkCHVCTKF4_cjs.buildWorkflowScopeSource(docs, chunkCHVCTKF4_cjs.documentScopeLabels(tags)), [docs, tags]);
341
+ }
342
+ function useConnectedAgentOptions() {
343
+ const { data: agents } = react$1.useAgents();
344
+ return react.useMemo(
345
+ () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),
346
+ [agents]
347
+ );
348
+ }
349
+ function ConnectedWorkflowDocumentsField({
350
+ field,
351
+ value,
352
+ onChange,
353
+ onAddFiles,
354
+ labels
355
+ }) {
356
+ const arbi = react$1.useArbi();
357
+ const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
358
+ const { ensureWorkspaceOpen } = chunkKDUGTKVI_cjs.useConnectedWorkspace();
359
+ const { data: docs, loaded, refetch } = chunkUUHUQHXR_cjs.useConnectedDocuments();
360
+ const documents = react.useMemo(() => docs.map(toWorkflowFieldDocument), [docs]);
361
+ const chosen = value.documents ?? [];
362
+ const { data: thumbnails } = react$1.useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 });
363
+ const input = react.useRef(null);
364
+ const [adding, setAdding] = react.useState(false);
365
+ const upload = react.useCallback(
366
+ async (files) => {
367
+ setAdding(true);
368
+ try {
369
+ await ensureWorkspaceOpen();
370
+ for (const file of files) await arbi.documents.uploadFile(file, file.name);
371
+ } catch (error) {
372
+ notify(error instanceof Error && error.message ? error.message : String(error), "error");
373
+ } finally {
374
+ setAdding(false);
375
+ await refetch?.();
376
+ }
377
+ },
378
+ [arbi, ensureWorkspaceOpen, notify, refetch]
379
+ );
380
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
381
+ !onAddFiles && /* @__PURE__ */ jsxRuntime.jsx(
382
+ "input",
205
383
  {
384
+ ref: input,
206
385
  type: "file",
207
- accept: ".md",
208
- "aria-label": "Skill instructions file",
209
- onChange: (event) => setFile(event.target.files?.[0] ?? null),
210
- "data-testid": "skill-upload-file"
386
+ multiple: true,
387
+ className: "hidden",
388
+ "aria-label": "Add files",
389
+ "data-testid": "workflow-add-files-input",
390
+ onChange: (e) => {
391
+ const files = Array.from(e.target.files ?? []);
392
+ e.target.value = "";
393
+ if (files.length) void upload(files);
394
+ }
211
395
  }
212
396
  ),
213
397
  /* @__PURE__ */ jsxRuntime.jsx(
214
- ui.Button,
398
+ chunkCHVCTKF4_cjs.WorkflowDocumentsField,
215
399
  {
216
- disabled: !slug || !file || upload.isPending,
217
- onClick: () => file && upload.mutate([{ folder: `skills/${slug}`, fileName: "SKILL.md", content: file }]),
218
- "data-testid": "skill-upload-submit",
219
- children: upload.isPending ? "Uploading\u2026" : "Upload skill"
400
+ field,
401
+ value,
402
+ onChange,
403
+ documents,
404
+ loaded,
405
+ thumbnailOf: (id) => thumbnails?.[id],
406
+ onAddFiles: onAddFiles ?? ((files) => files?.length ? void upload(files) : input.current?.click()),
407
+ adding,
408
+ labels
220
409
  }
221
- ),
222
- upload.isSuccess && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", className: "text-sm", children: "Uploaded. The skill will appear once processing finishes." }),
223
- upload.error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive", children: upload.error.message })
410
+ )
224
411
  ] });
225
412
  }
413
+ function ConnectedWorkflowLauncher({
414
+ onAddFiles,
415
+ ...props
416
+ }) {
417
+ const scopeSource = useConnectedWorkflowScopeSource();
418
+ const agents = useConnectedAgentOptions();
419
+ return /* @__PURE__ */ jsxRuntime.jsx(
420
+ chunkCHVCTKF4_cjs.WorkflowLauncher,
421
+ {
422
+ ...props,
423
+ scopeSource,
424
+ agents,
425
+ renderDocuments: (field, value, onChange) => /* @__PURE__ */ jsxRuntime.jsx(
426
+ ConnectedWorkflowDocumentsField,
427
+ {
428
+ field,
429
+ value,
430
+ onChange,
431
+ onAddFiles
432
+ }
433
+ )
434
+ }
435
+ );
436
+ }
437
+ var DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = {
438
+ title: "Add a skill",
439
+ description: "Bring in a skill someone sent you, from a file or a link.",
440
+ fromFile: "From a file",
441
+ chooseFile: "Choose a file",
442
+ fromLink: "From a link",
443
+ linkPlaceholder: "https://\u2026/SKILL.md",
444
+ add: "Add",
445
+ cancel: "Cancel",
446
+ added: (slug) => `${slug} added`,
447
+ failed: "Could not add the skill"
448
+ };
449
+ function ConnectedSkillUpload({ onDone, labels, className }) {
450
+ const l = { ...DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS, ...labels };
451
+ const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
452
+ const upload = react$1.useUploadSkillFiles();
453
+ const fileRef = react.useRef(null);
454
+ const [url, setUrl] = react.useState("");
455
+ const [busy, setBusy] = react.useState(false);
456
+ const add = async (read) => {
457
+ setBusy(true);
458
+ try {
459
+ const { slug, entries } = await read();
460
+ await upload.mutateAsync(
461
+ entries.map((e) => ({
462
+ folder: e.folder,
463
+ fileName: e.fileName,
464
+ content: new Blob([e.content], { type: "text/markdown" })
465
+ }))
466
+ );
467
+ notify(l.added(slug), "success");
468
+ setUrl("");
469
+ onDone?.(slug);
470
+ } catch (error) {
471
+ notify(error instanceof Error && error.message ? error.message : l.failed, "error");
472
+ } finally {
473
+ setBusy(false);
474
+ }
475
+ };
476
+ return /* @__PURE__ */ jsxRuntime.jsxs(
477
+ "div",
478
+ {
479
+ className: ui.cn("flex flex-col gap-6 overflow-y-auto p-4", className),
480
+ "data-testid": "skills-add-view",
481
+ children: [
482
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
483
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold", children: l.title }),
484
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.description })
485
+ ] }),
486
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
487
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { children: l.fromFile }),
488
+ /* @__PURE__ */ jsxRuntime.jsx(
489
+ "input",
490
+ {
491
+ ref: fileRef,
492
+ type: "file",
493
+ accept: ".md,.markdown,.zip",
494
+ className: "hidden",
495
+ "data-testid": "skills-add-file-input",
496
+ onChange: (e) => {
497
+ const file = e.target.files?.[0];
498
+ e.target.value = "";
499
+ if (file) void add(() => chunkCHVCTKF4_cjs.importSkillFile(file));
500
+ }
501
+ }
502
+ ),
503
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
504
+ ui.Button,
505
+ {
506
+ variant: "outline",
507
+ disabled: busy,
508
+ onClick: () => fileRef.current?.click(),
509
+ className: "pointer-coarse:min-h-11",
510
+ "data-testid": "skills-add-file",
511
+ children: [
512
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "mr-1.5 size-4" }),
513
+ l.chooseFile
514
+ ]
515
+ }
516
+ ) })
517
+ ] }),
518
+ /* @__PURE__ */ jsxRuntime.jsxs(
519
+ "form",
520
+ {
521
+ className: "space-y-2",
522
+ onSubmit: (e) => {
523
+ e.preventDefault();
524
+ if (url.trim()) void add(() => chunkCHVCTKF4_cjs.importSkillFromUrl(url));
525
+ },
526
+ children: [
527
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "skills-add-url", children: l.fromLink }),
528
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 sm:flex-row", children: [
529
+ /* @__PURE__ */ jsxRuntime.jsx(
530
+ ui.Input,
531
+ {
532
+ id: "skills-add-url",
533
+ value: url,
534
+ onChange: (e) => setUrl(e.target.value),
535
+ placeholder: l.linkPlaceholder,
536
+ inputMode: "url",
537
+ className: "pointer-coarse:min-h-11",
538
+ "data-testid": "skills-add-url-input"
539
+ }
540
+ ),
541
+ /* @__PURE__ */ jsxRuntime.jsxs(
542
+ ui.Button,
543
+ {
544
+ type: "submit",
545
+ disabled: busy || !url.trim(),
546
+ className: "pointer-coarse:min-h-11",
547
+ "data-testid": "skills-add-url-submit",
548
+ children: [
549
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2, { className: "mr-1.5 size-4" }),
550
+ l.add
551
+ ]
552
+ }
553
+ )
554
+ ] })
555
+ ]
556
+ }
557
+ ),
558
+ onDone && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "ghost", onClick: () => onDone(), className: "pointer-coarse:min-h-11", children: l.cancel }) })
559
+ ]
560
+ }
561
+ );
562
+ }
226
563
  var StreamedArtifactEditor = react.lazy(() => import('../StreamedArtifactEditor-TQAND4H5.cjs'));
227
564
  function StreamedArtifact({
228
565
  artifacts: artifacts$1,
@@ -296,7 +633,7 @@ function StreamedArtifact({
296
633
  }
297
634
  var STARTING = /* @__PURE__ */ new Set(["pending", "running"]);
298
635
  function formValues(step, inputs) {
299
- const fields = chunk6AALMYPS_cjs.stepFields(step);
636
+ const fields = chunk6F7SZCVL_cjs.stepFields(step);
300
637
  if (!fields.length) return void 0;
301
638
  if (step.kind === "form")
302
639
  return Object.fromEntries(fields.map((f) => [f.name, inputs[f.name] ?? ""]));
@@ -330,11 +667,11 @@ function useAnswerRetry(missing, refetch) {
330
667
  }
331
668
  function useWorkflowThread(workflow, options = {}) {
332
669
  const arbi = react$1.useArbi();
333
- const { ensureWorkspaceOpen, status } = chunkARDHLU73_cjs.useConnection();
334
- const { wsId } = chunk4QIIDXLF_cjs.useWorkspaceDocs();
670
+ const { ensureWorkspaceOpen, status } = chunkKDUGTKVI_cjs.useConnection();
671
+ const { wsId } = chunkHDYWXEQU_cjs.useWorkspaceDocs();
335
672
  const [threadId, setThreadId] = react.useState(options.conversationId);
336
673
  const [localInputs, setLocalInputs] = react.useState(
337
- () => chunk6AALMYPS_cjs.initialRunInputs(workflow, options.initialInputs)
674
+ () => chunk6F7SZCVL_cjs.initialRunInputs(workflow, options.initialInputs)
338
675
  );
339
676
  const [edits, setEdits] = react.useState({});
340
677
  const [localStates, setLocalStates] = react.useState({});
@@ -354,12 +691,12 @@ function useWorkflowThread(workflow, options = {}) {
354
691
  );
355
692
  const conversation = conversations.data?.find((c) => c.external_id === threadId);
356
693
  const steps = react.useMemo(
357
- () => chunk6AALMYPS_cjs.workflowSteps(workflow).length > 0 ? chunk6AALMYPS_cjs.workflowSteps(workflow) : chunkSARREDFP_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
694
+ () => chunk6F7SZCVL_cjs.workflowSteps(workflow).length > 0 ? chunk6F7SZCVL_cjs.workflowSteps(workflow) : chunkCHVCTKF4_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
358
695
  [workflow, conversation?.plan?.steps]
359
696
  );
360
697
  const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
361
698
  const serverStates = react.useMemo(
362
- () => chunk6AALMYPS_cjs.stepStatesFromActivity(activity.data ?? []),
699
+ () => chunk6F7SZCVL_cjs.stepStatesFromActivity(activity.data ?? []),
363
700
  [activity.data]
364
701
  );
365
702
  const working = steps.some(
@@ -402,7 +739,7 @@ function useWorkflowThread(workflow, options = {}) {
402
739
  async (values, done) => {
403
740
  await ensureWorkspaceOpen();
404
741
  const created = await createWork.mutateAsync({
405
- title: chunk6AALMYPS_cjs.runThreadTitle(workflow, values).slice(0, 60),
742
+ title: chunk6F7SZCVL_cjs.runThreadTitle(workflow, values).slice(0, 60),
406
743
  description: workflow.description || null,
407
744
  prompt: null,
408
745
  skill_ref: null,
@@ -414,7 +751,7 @@ function useWorkflowThread(workflow, options = {}) {
414
751
  criteria: [],
415
752
  max_passes: 3,
416
753
  documents: [],
417
- steps: chunkSARREDFP_cjs.toPlanSteps(workflow, {
754
+ steps: chunkCHVCTKF4_cjs.toPlanSteps(workflow, {
418
755
  inputs: values,
419
756
  resolveWorkflow: options.resolveWorkflow,
420
757
  compose: options.compose
@@ -501,7 +838,7 @@ function useWorkflowThread(workflow, options = {}) {
501
838
  const anyRunning = Object.values(states).some((s) => s.status === "running");
502
839
  const needsStart = !threadId || idle && !anyRunning;
503
840
  const runError = idle ? conversation?.last_error ?? null : null;
504
- const view = chunkSARREDFP_cjs.useWorkflowView({
841
+ const view = chunkCHVCTKF4_cjs.useWorkflowView({
505
842
  steps,
506
843
  states,
507
844
  inputs,
@@ -544,7 +881,7 @@ function WorkflowRunThread({
544
881
  if (listed && activeThreadId !== conversationId) selectThread(conversationId);
545
882
  }, [listed, activeThreadId, conversationId, selectThread]);
546
883
  return /* @__PURE__ */ jsxRuntime.jsx(
547
- chunkPJJY6CYL_cjs.ChatPage,
884
+ chunkEHOPZBAX_cjs.ChatPage,
548
885
  {
549
886
  chat: { ...chat, threads: chat.threads.filter((t) => t.id === conversationId) },
550
887
  singleThread: true,
@@ -580,9 +917,9 @@ function WorkflowSignDialog({
580
917
  labels
581
918
  }) {
582
919
  const arbi = react$1.useArbi();
583
- const { user, ensureWorkspaceOpen } = chunkARDHLU73_cjs.useConnection();
920
+ const { user, ensureWorkspaceOpen } = chunkKDUGTKVI_cjs.useConnection();
584
921
  const tools = documentTools.useOptionalDocumentTools();
585
- const { id, version: stepVersion } = chunk6AALMYPS_cjs.splitDocRef(docRef);
922
+ const { id, version: stepVersion } = chunk6F7SZCVL_cjs.splitDocRef(docRef);
586
923
  const [version, setVersion] = react.useState(stepVersion);
587
924
  const [pdf, setPdf] = react.useState(null);
588
925
  const [preparing, setPreparing] = react.useState(false);
@@ -660,7 +997,7 @@ function WorkflowWordDialog({
660
997
  onClose,
661
998
  labels
662
999
  }) {
663
- const { id } = chunk6AALMYPS_cjs.splitDocRef(docRef);
1000
+ const { id } = chunk6F7SZCVL_cjs.splitDocRef(docRef);
664
1001
  return /* @__PURE__ */ jsxRuntime.jsx(
665
1002
  chunkULWRNGGE_cjs.ModalScaffold,
666
1003
  {
@@ -669,7 +1006,7 @@ function WorkflowWordDialog({
669
1006
  title: title ?? labels.wordTitle,
670
1007
  size: "xl",
671
1008
  testId: "workflow-word-dialog",
672
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkGZPTWHP5_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
1009
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkHLB4DIYV_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
673
1010
  }
674
1011
  );
675
1012
  }
@@ -680,7 +1017,7 @@ function WorkflowReviewGridDialog({
680
1017
  onOpenDocument,
681
1018
  labels
682
1019
  }) {
683
- const { workspaceId } = chunkARDHLU73_cjs.useConnection();
1020
+ const { workspaceId } = chunkKDUGTKVI_cjs.useConnection();
684
1021
  const allTags = react$1.useTags(workspaceId ?? void 0);
685
1022
  const all = react$1.useDocuments(workspaceId ?? void 0);
686
1023
  const isLoading = allTags.isLoading || all.isLoading || all.isFetching && !all.isFetchedAfterMount;
@@ -808,8 +1145,8 @@ function ConnectedWorkflowRunner({
808
1145
  const l = { ...DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, ...connectedLabels };
809
1146
  const dl = { ...DEFAULT_WORKFLOW_RUNNER_DIALOG_LABELS, ...dialogLabels };
810
1147
  const arbi = react$1.useArbi();
811
- const { ensureWorkspaceOpen, user } = chunkARDHLU73_cjs.useConnection();
812
- const { wsId } = chunk4QIIDXLF_cjs.useWorkspaceDocs();
1148
+ const { ensureWorkspaceOpen, user } = chunkKDUGTKVI_cjs.useConnection();
1149
+ const { wsId } = chunkHDYWXEQU_cjs.useWorkspaceDocs();
813
1150
  const { data: docs = [], refetch } = react$1.useDocuments(wsId);
814
1151
  const [sending, setSending] = react.useState([]);
815
1152
  const [added, setAdded] = react.useState({});
@@ -832,7 +1169,7 @@ function ConnectedWorkflowRunner({
832
1169
  () => ({
833
1170
  me: user?.externalId,
834
1171
  openDocument: onOpenDocument && ((ref) => {
835
- const { id, version } = chunk6AALMYPS_cjs.splitDocRef(ref);
1172
+ const { id, version } = chunk6F7SZCVL_cjs.splitDocRef(ref);
836
1173
  onOpenDocument(id, version);
837
1174
  }),
838
1175
  openDraft: onOpenDraft && ((draftId) => onOpenDraft(draftId)),
@@ -842,7 +1179,7 @@ function ConnectedWorkflowRunner({
842
1179
  const w = state.waiting;
843
1180
  if (w?.doc_ext_id) setDialog({ kind: "sign", docRef: w.doc_ext_id });
844
1181
  }),
845
- openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(chunk6AALMYPS_cjs.splitDocRef(ref).id) ?? "" })),
1182
+ openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(chunk6F7SZCVL_cjs.splitDocRef(ref).id) ?? "" })),
846
1183
  openReview: hostActions?.openReview ?? ((tags, documents) => setDialog({ kind: "review", tags, documents }))
847
1184
  }),
848
1185
  [user?.externalId, onOpenDocument, onOpenDraft, onOpenMessage, hostActions, nameOfDoc, inThread]
@@ -978,7 +1315,7 @@ function ConnectedWorkflowRunner({
978
1315
  );
979
1316
  };
980
1317
  const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
981
- chunkSARREDFP_cjs.WorkflowRunner,
1318
+ chunkCHVCTKF4_cjs.WorkflowRunner,
982
1319
  {
983
1320
  people,
984
1321
  ...runnerProps,
@@ -1024,10 +1361,10 @@ function ConnectedWorkflowRunner({
1024
1361
  ) }),
1025
1362
  inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1026
1363
  /* @__PURE__ */ jsxRuntime.jsx(
1027
- chunkSARREDFP_cjs.WorkflowStepBar,
1364
+ chunkCHVCTKF4_cjs.WorkflowStepBar,
1028
1365
  {
1029
1366
  run: view,
1030
- levels: chunk6AALMYPS_cjs.stepLevels(view.steps),
1367
+ levels: chunk6F7SZCVL_cjs.stepLevels(view.steps),
1031
1368
  doneTitle: (workflow.run.kind === "steps" ? workflow.run.completion?.title : void 0) ?? runnerProps.labels?.complete ?? "Done",
1032
1369
  icon: (key) => key && runnerProps.renderIcon ? runnerProps.renderIcon(key) : void 0,
1033
1370
  tid: (suffix) => `${testIdPrefix}-${suffix}`
@@ -1047,13 +1384,13 @@ function ConnectedWorkflowRunner({
1047
1384
  return state ? [[s.id, state]] : [];
1048
1385
  })
1049
1386
  );
1050
- const ref = chunk6AALMYPS_cjs.stepDocuments(view.steps, states, id).at(-1);
1387
+ const ref = chunk6F7SZCVL_cjs.stepDocuments(view.steps, states, id).at(-1);
1051
1388
  const open = actions.openDocument ?? actions.openRedline;
1052
1389
  return {
1053
1390
  title: step.title,
1054
- kind: chunk6AALMYPS_cjs.stepKindOf(step),
1391
+ kind: chunk6F7SZCVL_cjs.stepKindOf(step),
1055
1392
  phase: view.phaseOf(id),
1056
- document: ref && open ? { name: nameOfDoc(chunk6AALMYPS_cjs.splitDocRef(ref).id) ?? ref, onOpen: () => open(ref) } : void 0
1393
+ document: ref && open ? { name: nameOfDoc(chunk6F7SZCVL_cjs.splitDocRef(ref).id) ?? ref, onOpen: () => open(ref) } : void 0
1057
1394
  };
1058
1395
  },
1059
1396
  targetMessageId: target,
@@ -1120,7 +1457,7 @@ function ReviewNotify({
1120
1457
  testId
1121
1458
  }) {
1122
1459
  const arbi = react$1.useArbi();
1123
- const { status, user, ensureWorkspaceOpen } = chunkARDHLU73_cjs.useConnection();
1460
+ const { status, user, ensureWorkspaceOpen } = chunkKDUGTKVI_cjs.useConnection();
1124
1461
  const { data: members = [] } = react$1.useWorkspaceUsers(workspaceId, {
1125
1462
  enabled: status === "authenticated" && !!workspaceId,
1126
1463
  beforeFetch: ensureWorkspaceOpen
@@ -1197,7 +1534,7 @@ function ConnectedTagTable({
1197
1534
  ...props
1198
1535
  }) {
1199
1536
  const arbi = react$1.useArbi();
1200
- const { workspaceId, status, ensureWorkspaceOpen } = chunkARDHLU73_cjs.useConnection();
1537
+ const { workspaceId, status, ensureWorkspaceOpen } = chunkKDUGTKVI_cjs.useConnection();
1201
1538
  const schema = react$1.useTagKindSchema(kind);
1202
1539
  const rows = react$1.useTags(workspaceId ?? void 0, {
1203
1540
  kind,
@@ -1225,7 +1562,7 @@ function ConnectedTagTable({
1225
1562
  const fail = (e) => setError(e instanceof Error ? e.message : String(e));
1226
1563
  const snapshot = (data) => {
1227
1564
  const title = exportTitle ?? KIND_TITLES[kind];
1228
- const bytes = chunkKYDRUFWT_cjs.tagTableDocx(data, {
1565
+ const bytes = chunkC3ZRLULA_cjs.tagTableDocx(data, {
1229
1566
  title,
1230
1567
  nameOf: (id) => people.find((p) => p.value === id)?.label
1231
1568
  });
@@ -1235,7 +1572,7 @@ function ConnectedTagTable({
1235
1572
  };
1236
1573
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1237
1574
  /* @__PURE__ */ jsxRuntime.jsx(
1238
- chunkKYDRUFWT_cjs.TagTable,
1575
+ chunkC3ZRLULA_cjs.TagTable,
1239
1576
  {
1240
1577
  ...props,
1241
1578
  table,
@@ -1301,7 +1638,7 @@ function ConnectedTagTable({
1301
1638
  ] });
1302
1639
  }
1303
1640
  function useConnectedShellWorkspaces(options = {}) {
1304
- const { workspaceId, setWorkspace } = chunkARDHLU73_cjs.useConnection();
1641
+ const { workspaceId, setWorkspace } = chunkKDUGTKVI_cjs.useConnection();
1305
1642
  const query = react$1.useWorkspaces();
1306
1643
  return react$1.useShellWorkspaces({
1307
1644
  ...options,
@@ -1695,7 +2032,7 @@ function ConnectedDangerZone({ renderSubscriptionLink }) {
1695
2032
  }
1696
2033
  function useConnectedDocxNotifications(onOpen) {
1697
2034
  const arbi = react$1.useArbi();
1698
- const { status, user, apiUrl } = chunkARDHLU73_cjs.useConnection();
2035
+ const { status, user, apiUrl } = chunkKDUGTKVI_cjs.useConnection();
1699
2036
  const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
1700
2037
  const queries = reactQuery.useQueryClient();
1701
2038
  const source = `docx-mentions:${apiUrl}:${user?.externalId || ""}`;
@@ -1761,7 +2098,7 @@ function useConnectedDocxNotifications(onOpen) {
1761
2098
  };
1762
2099
  }
1763
2100
  function useConnectedWorkNotifications(onOpen) {
1764
- const { status, user, apiUrl } = chunkARDHLU73_cjs.useConnection();
2101
+ const { status, user, apiUrl } = chunkKDUGTKVI_cjs.useConnection();
1765
2102
  const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
1766
2103
  const source = `work-notifications:${apiUrl}:${user?.externalId || ""}`;
1767
2104
  const { data = [], markRead: persistRead } = react$1.useWorkNotifications({
@@ -3376,7 +3713,7 @@ function ConnectedMailbox({
3376
3713
  testIds: { root: "mail-search", input: "mail-filter-input" },
3377
3714
  className: "min-w-28 flex-1 sm:max-w-72",
3378
3715
  filter: /* @__PURE__ */ jsxRuntime.jsx(
3379
- chunkN26CXGXC_cjs.TriStateFilterMenu,
3716
+ chunkRQ2Y7USX_cjs.TriStateFilterMenu,
3380
3717
  {
3381
3718
  testId: "mail-bar-filter-button",
3382
3719
  open: filterMenuOpen,
@@ -3765,7 +4102,7 @@ function ActiveChat({ agentId, workspaceId }) {
3765
4102
  activeArtifact: () => chunkJKB7WT7L_cjs.takeOpenDocumentForTurn({ workspaceId })
3766
4103
  });
3767
4104
  return /* @__PURE__ */ jsxRuntime.jsx(
3768
- chunkPJJY6CYL_cjs.ChatPage,
4105
+ chunkEHOPZBAX_cjs.ChatPage,
3769
4106
  {
3770
4107
  chat: { ...chat, assistantMode: void 0, setAssistantMode: void 0 },
3771
4108
  documentsRequired: false,
@@ -3827,51 +4164,71 @@ function ConnectedAgentChatPanel({
3827
4164
 
3828
4165
  Object.defineProperty(exports, "ConnectedAssistantDock", {
3829
4166
  enumerable: true,
3830
- get: function () { return chunk4QIIDXLF_cjs.ConnectedAssistantDock; }
4167
+ get: function () { return chunkHDYWXEQU_cjs.ConnectedAssistantDock; }
3831
4168
  });
3832
4169
  Object.defineProperty(exports, "redlineStats", {
3833
4170
  enumerable: true,
3834
- get: function () { return chunk4QIIDXLF_cjs.redlineStats; }
4171
+ get: function () { return chunkHDYWXEQU_cjs.redlineStats; }
3835
4172
  });
3836
4173
  Object.defineProperty(exports, "textToArtifact", {
3837
4174
  enumerable: true,
3838
- get: function () { return chunk4QIIDXLF_cjs.textToArtifact; }
4175
+ get: function () { return chunkHDYWXEQU_cjs.textToArtifact; }
3839
4176
  });
3840
4177
  Object.defineProperty(exports, "toRedlineMarkdown", {
3841
4178
  enumerable: true,
3842
- get: function () { return chunk4QIIDXLF_cjs.toRedlineMarkdown; }
4179
+ get: function () { return chunkHDYWXEQU_cjs.toRedlineMarkdown; }
3843
4180
  });
3844
4181
  Object.defineProperty(exports, "useConnectedAiTask", {
3845
4182
  enumerable: true,
3846
- get: function () { return chunk4QIIDXLF_cjs.useConnectedAiTask; }
4183
+ get: function () { return chunkHDYWXEQU_cjs.useConnectedAiTask; }
3847
4184
  });
3848
4185
  Object.defineProperty(exports, "useConnectedChat", {
3849
4186
  enumerable: true,
3850
- get: function () { return chunk4QIIDXLF_cjs.useConnectedChat; }
4187
+ get: function () { return chunkHDYWXEQU_cjs.useConnectedChat; }
3851
4188
  });
3852
4189
  Object.defineProperty(exports, "useSemanticSearch", {
3853
4190
  enumerable: true,
3854
- get: function () { return chunk4QIIDXLF_cjs.useSemanticSearch; }
4191
+ get: function () { return chunkHDYWXEQU_cjs.useSemanticSearch; }
3855
4192
  });
3856
4193
  Object.defineProperty(exports, "useWorkspaceDocs", {
3857
4194
  enumerable: true,
3858
- get: function () { return chunk4QIIDXLF_cjs.useWorkspaceDocs; }
4195
+ get: function () { return chunkHDYWXEQU_cjs.useWorkspaceDocs; }
4196
+ });
4197
+ Object.defineProperty(exports, "ConnectedWorkspaceDataProvider", {
4198
+ enumerable: true,
4199
+ get: function () { return chunkUUHUQHXR_cjs.ConnectedWorkspaceDataProvider; }
4200
+ });
4201
+ Object.defineProperty(exports, "useConnectedConversations", {
4202
+ enumerable: true,
4203
+ get: function () { return chunkUUHUQHXR_cjs.useConnectedConversations; }
4204
+ });
4205
+ Object.defineProperty(exports, "useConnectedDocuments", {
4206
+ enumerable: true,
4207
+ get: function () { return chunkUUHUQHXR_cjs.useConnectedDocuments; }
4208
+ });
4209
+ Object.defineProperty(exports, "useConnectedTags", {
4210
+ enumerable: true,
4211
+ get: function () { return chunkUUHUQHXR_cjs.useConnectedTags; }
3859
4212
  });
3860
4213
  Object.defineProperty(exports, "ConnectionProvider", {
3861
4214
  enumerable: true,
3862
- get: function () { return chunkARDHLU73_cjs.ConnectionProvider; }
4215
+ get: function () { return chunkKDUGTKVI_cjs.ConnectionProvider; }
3863
4216
  });
3864
4217
  Object.defineProperty(exports, "SESSION_EXPIRED_MESSAGE", {
3865
4218
  enumerable: true,
3866
- get: function () { return chunkARDHLU73_cjs.SESSION_EXPIRED_MESSAGE; }
4219
+ get: function () { return chunkKDUGTKVI_cjs.SESSION_EXPIRED_MESSAGE; }
3867
4220
  });
3868
4221
  Object.defineProperty(exports, "isAuthenticated", {
3869
4222
  enumerable: true,
3870
- get: function () { return chunkARDHLU73_cjs.isAuthenticated; }
4223
+ get: function () { return chunkKDUGTKVI_cjs.isAuthenticated; }
4224
+ });
4225
+ Object.defineProperty(exports, "useConnectedWorkspace", {
4226
+ enumerable: true,
4227
+ get: function () { return chunkKDUGTKVI_cjs.useConnectedWorkspace; }
3871
4228
  });
3872
4229
  Object.defineProperty(exports, "useConnection", {
3873
4230
  enumerable: true,
3874
- get: function () { return chunkARDHLU73_cjs.useConnection; }
4231
+ get: function () { return chunkKDUGTKVI_cjs.useConnection; }
3875
4232
  });
3876
4233
  exports.ArbiAppProvider = ArbiAppProvider;
3877
4234
  exports.ConnectedAgentChatPanel = ConnectedAgentChatPanel;
@@ -3893,16 +4250,25 @@ exports.ConnectedSkillUpload = ConnectedSkillUpload;
3893
4250
  exports.ConnectedTagTable = ConnectedTagTable;
3894
4251
  exports.ConnectedTaskAccessRequest = ConnectedTaskAccessRequest;
3895
4252
  exports.ConnectedThreadFollow = ConnectedThreadFollow;
4253
+ exports.ConnectedWorkflowDocumentsField = ConnectedWorkflowDocumentsField;
4254
+ exports.ConnectedWorkflowLauncher = ConnectedWorkflowLauncher;
3896
4255
  exports.ConnectedWorkflowRunner = ConnectedWorkflowRunner;
4256
+ exports.ConnectedWorkflowsTable = ConnectedWorkflowsTable;
3897
4257
  exports.ConnectedWorkspaceActivity = ConnectedWorkspaceActivity;
3898
4258
  exports.ConnectedWorkspaceNotificationMenu = ConnectedWorkspaceNotificationMenu;
4259
+ exports.DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS;
4260
+ exports.DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS = DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS;
3899
4261
  exports.DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS = DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS;
3900
4262
  exports.StreamedArtifact = StreamedArtifact;
3901
4263
  exports.WorkflowRunThread = WorkflowRunThread;
3902
4264
  exports.defaultUnmetPasswordRequirement = defaultUnmetPasswordRequirement;
3903
4265
  exports.resolveMailbox = resolveMailbox;
4266
+ exports.toWorkflowFieldDocument = toWorkflowFieldDocument;
4267
+ exports.useConnectedAgentOptions = useConnectedAgentOptions;
3904
4268
  exports.useConnectedDocxNotifications = useConnectedDocxNotifications;
3905
4269
  exports.useConnectedShellWorkspaces = useConnectedShellWorkspaces;
3906
4270
  exports.useConnectedWorkNotifications = useConnectedWorkNotifications;
4271
+ exports.useConnectedWorkflowScopeSource = useConnectedWorkflowScopeSource;
4272
+ exports.useConnectedWorkspaceRole = useConnectedWorkspaceRole;
3907
4273
  //# sourceMappingURL=index.cjs.map
3908
4274
  //# sourceMappingURL=index.cjs.map