@arbidocs/blocks 0.4.137 → 0.4.139

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 (203) hide show
  1. package/dist/agents/definitions/AgentConnectInstructions.d.ts +12 -0
  2. package/dist/agents/definitions/defaults.d.ts +12 -0
  3. package/dist/agents/definitions/index.d.ts +2 -0
  4. package/dist/agents/index.cjs +457 -418
  5. package/dist/agents/index.js +12 -13
  6. package/dist/agents/skills/SkillLibraryDetail.d.ts +26 -0
  7. package/dist/agents/skills/index.d.ts +2 -0
  8. package/dist/agents/skills/skillLibrary.d.ts +46 -0
  9. package/dist/calendar/CalendarFormDialog.d.ts +13 -0
  10. package/dist/calendar/ProposeTimeDialog.d.ts +22 -0
  11. package/dist/calendar/WeeklyHoursEditor.d.ts +7 -0
  12. package/dist/calendar/access-setup.d.ts +8 -0
  13. package/dist/calendar/api-mapping.d.ts +22 -0
  14. package/dist/calendar/booking-form.d.ts +46 -0
  15. package/dist/calendar/conference.d.ts +11 -0
  16. package/dist/calendar/errors.d.ts +7 -0
  17. package/dist/calendar/feeds.d.ts +2 -0
  18. package/dist/calendar/freebusy.d.ts +22 -0
  19. package/dist/calendar/ics.d.ts +33 -0
  20. package/dist/calendar/index.cjs +472 -4293
  21. package/dist/calendar/index.cjs.map +1 -1
  22. package/dist/calendar/index.d.ts +17 -1
  23. package/dist/calendar/index.js +1 -4227
  24. package/dist/calendar/index.js.map +1 -1
  25. package/dist/calendar/requests.d.ts +42 -0
  26. package/dist/calendar/room-window.d.ts +6 -0
  27. package/dist/calendar/settings-value.d.ts +4 -0
  28. package/dist/calls/index.cjs +4 -4
  29. package/dist/calls/index.js +3 -3
  30. package/dist/chat/index.cjs +141 -141
  31. package/dist/chat/index.js +6 -6
  32. package/dist/{chunk-M33QUNFH.js → chunk-22WFGXG2.js} +3 -3
  33. package/dist/{chunk-M33QUNFH.js.map → chunk-22WFGXG2.js.map} +1 -1
  34. package/dist/{chunk-VMESMX7N.js → chunk-453PNNNW.js} +3 -3
  35. package/dist/{chunk-VMESMX7N.js.map → chunk-453PNNNW.js.map} +1 -1
  36. package/dist/{chunk-2KUCVSFF.js → chunk-45LRMW54.js} +3 -3
  37. package/dist/{chunk-2KUCVSFF.js.map → chunk-45LRMW54.js.map} +1 -1
  38. package/dist/chunk-5FTIHRZH.cjs +177 -0
  39. package/dist/chunk-5FTIHRZH.cjs.map +1 -0
  40. package/dist/{chunk-FUTMU4FR.js → chunk-5HFPRI3W.js} +3 -3
  41. package/dist/{chunk-FUTMU4FR.js.map → chunk-5HFPRI3W.js.map} +1 -1
  42. package/dist/{chunk-JY73DJOS.cjs → chunk-5UXDUOOB.cjs} +84 -1211
  43. package/dist/chunk-5UXDUOOB.cjs.map +1 -0
  44. package/dist/{chunk-ATJUVHVB.js → chunk-6QMWP5IU.js} +1445 -11
  45. package/dist/chunk-6QMWP5IU.js.map +1 -0
  46. package/dist/chunk-6YTHQ73P.cjs +5334 -0
  47. package/dist/chunk-6YTHQ73P.cjs.map +1 -0
  48. package/dist/{chunk-KMNZ2RVO.js → chunk-7QUUZBQZ.js} +15 -1109
  49. package/dist/chunk-7QUUZBQZ.js.map +1 -0
  50. package/dist/{chunk-C3ZRLULA.cjs → chunk-7X255TOM.cjs} +5 -5
  51. package/dist/{chunk-C3ZRLULA.cjs.map → chunk-7X255TOM.cjs.map} +1 -1
  52. package/dist/chunk-A3XPS2EU.js +245 -0
  53. package/dist/chunk-A3XPS2EU.js.map +1 -0
  54. package/dist/chunk-B3AHCIV5.js +5206 -0
  55. package/dist/chunk-B3AHCIV5.js.map +1 -0
  56. package/dist/{chunk-2Q7FDZAY.js → chunk-BPBSSMRB.js} +5 -163
  57. package/dist/chunk-BPBSSMRB.js.map +1 -0
  58. package/dist/{chunk-KSHKTOY2.js → chunk-CKCBBYTA.js} +205 -5
  59. package/dist/chunk-CKCBBYTA.js.map +1 -0
  60. package/dist/chunk-CYNF5PZI.js +170 -0
  61. package/dist/chunk-CYNF5PZI.js.map +1 -0
  62. package/dist/{chunk-OPTBQSCV.cjs → chunk-DJM7DLCT.cjs} +3 -3
  63. package/dist/{chunk-OPTBQSCV.cjs.map → chunk-DJM7DLCT.cjs.map} +1 -1
  64. package/dist/{chunk-E5OYHJMU.js → chunk-DN55PRGS.js} +4 -4
  65. package/dist/{chunk-E5OYHJMU.js.map → chunk-DN55PRGS.js.map} +1 -1
  66. package/dist/{chunk-VHJHY7TT.js → chunk-ECERC6TI.js} +3 -3
  67. package/dist/{chunk-VHJHY7TT.js.map → chunk-ECERC6TI.js.map} +1 -1
  68. package/dist/{chunk-KDUGTKVI.cjs → chunk-GFNELPDP.cjs} +17 -6
  69. package/dist/chunk-GFNELPDP.cjs.map +1 -0
  70. package/dist/{chunk-OGBXV326.cjs → chunk-GFRQG36Y.cjs} +2 -243
  71. package/dist/chunk-GFRQG36Y.cjs.map +1 -0
  72. package/dist/{chunk-WXYQ66KC.cjs → chunk-HEMU73OP.cjs} +2 -166
  73. package/dist/chunk-HEMU73OP.cjs.map +1 -0
  74. package/dist/{chunk-UUHUQHXR.cjs → chunk-JZNXRMLH.cjs} +6 -6
  75. package/dist/{chunk-UUHUQHXR.cjs.map → chunk-JZNXRMLH.cjs.map} +1 -1
  76. package/dist/{chunk-HDYWXEQU.cjs → chunk-K3HNLWZZ.cjs} +8 -8
  77. package/dist/{chunk-HDYWXEQU.cjs.map → chunk-K3HNLWZZ.cjs.map} +1 -1
  78. package/dist/{chunk-7M4C6CK7.js → chunk-KTFDUSON.js} +4 -4
  79. package/dist/{chunk-7M4C6CK7.js.map → chunk-KTFDUSON.js.map} +1 -1
  80. package/dist/{chunk-HLB4DIYV.cjs → chunk-MABUMUCA.cjs} +6 -6
  81. package/dist/{chunk-HLB4DIYV.cjs.map → chunk-MABUMUCA.cjs.map} +1 -1
  82. package/dist/{chunk-RQ2Y7USX.cjs → chunk-MIDXCYZB.cjs} +235 -15
  83. package/dist/chunk-MIDXCYZB.cjs.map +1 -0
  84. package/dist/{chunk-L3T7OJRX.js → chunk-MTPWZQTL.js} +4 -4
  85. package/dist/{chunk-L3T7OJRX.js.map → chunk-MTPWZQTL.js.map} +1 -1
  86. package/dist/{chunk-BUNZWOPX.cjs → chunk-O4ZIQDUT.cjs} +5 -5
  87. package/dist/{chunk-BUNZWOPX.cjs.map → chunk-O4ZIQDUT.cjs.map} +1 -1
  88. package/dist/{chunk-W3VYZXNS.js → chunk-O6W6RW3B.js} +5 -240
  89. package/dist/chunk-O6W6RW3B.js.map +1 -0
  90. package/dist/{chunk-WS5EX7DN.cjs → chunk-OGP6MQXQ.cjs} +3 -3
  91. package/dist/{chunk-WS5EX7DN.cjs.map → chunk-OGP6MQXQ.cjs.map} +1 -1
  92. package/dist/{chunk-6F7SZCVL.cjs → chunk-OWCEQKAR.cjs} +3 -3
  93. package/dist/{chunk-6F7SZCVL.cjs.map → chunk-OWCEQKAR.cjs.map} +1 -1
  94. package/dist/{chunk-OQ7RUNOC.js → chunk-PC5KVHX3.js} +22 -6
  95. package/dist/chunk-PC5KVHX3.js.map +1 -0
  96. package/dist/{chunk-CHVCTKF4.cjs → chunk-ULEDHANM.cjs} +1543 -66
  97. package/dist/chunk-ULEDHANM.cjs.map +1 -0
  98. package/dist/{chunk-L2PAPOZ5.js → chunk-US3S4DCB.js} +17 -6
  99. package/dist/chunk-US3S4DCB.js.map +1 -0
  100. package/dist/chunk-V46W7YLI.cjs +252 -0
  101. package/dist/chunk-V46W7YLI.cjs.map +1 -0
  102. package/dist/{chunk-3RJN2VTL.js → chunk-XDQXDWE7.js} +3 -3
  103. package/dist/{chunk-3RJN2VTL.js.map → chunk-XDQXDWE7.js.map} +1 -1
  104. package/dist/{chunk-EHOPZBAX.cjs → chunk-XOC44HQY.cjs} +12 -12
  105. package/dist/{chunk-EHOPZBAX.cjs.map → chunk-XOC44HQY.cjs.map} +1 -1
  106. package/dist/{chunk-YOMPLCP6.js → chunk-Y5KTM3V5.js} +3 -3
  107. package/dist/{chunk-YOMPLCP6.js.map → chunk-Y5KTM3V5.js.map} +1 -1
  108. package/dist/{chunk-DWZXSPMB.cjs → chunk-ZAVEMQ37.cjs} +3 -3
  109. package/dist/{chunk-DWZXSPMB.cjs.map → chunk-ZAVEMQ37.cjs.map} +1 -1
  110. package/dist/{chunk-AAFX64WD.cjs → chunk-ZXAWOLBQ.cjs} +22 -5
  111. package/dist/chunk-ZXAWOLBQ.cjs.map +1 -0
  112. package/dist/citations/QuietMarks.d.ts +5 -2
  113. package/dist/citations/index.cjs +15 -14
  114. package/dist/citations/index.js +3 -2
  115. package/dist/collaboration/index.cjs +51 -51
  116. package/dist/collaboration/index.js +3 -3
  117. package/dist/connect/docx.cjs +6 -6
  118. package/dist/connect/docx.js +5 -5
  119. package/dist/connect/index.cjs +6595 -1600
  120. package/dist/connect/index.cjs.map +1 -1
  121. package/dist/connect/index.d.ts +5 -0
  122. package/dist/connect/index.js +5064 -90
  123. package/dist/connect/index.js.map +1 -1
  124. package/dist/connection/ConnectedAgentCreator.d.ts +37 -0
  125. package/dist/connection/ConnectedSkillsLibrary.d.ts +26 -0
  126. package/dist/connection/ConnectedWorkflowHistory.d.ts +45 -0
  127. package/dist/connection/ConnectionProvider.d.ts +3 -1
  128. package/dist/connection/calendar/AddCalendarDialogs.d.ts +9 -0
  129. package/dist/connection/calendar/BookingPagesPanel.d.ts +13 -0
  130. package/dist/connection/calendar/CalendarAccountsPanel.d.ts +5 -0
  131. package/dist/connection/calendar/CalendarSettingsDialog.d.ts +12 -0
  132. package/dist/connection/calendar/ConnectedCalendar.d.ts +13 -0
  133. package/dist/connection/calendar/ConnectedMailInviteCard.d.ts +12 -0
  134. package/dist/connection/calendar/ConnectedPublicBooking.d.ts +9 -0
  135. package/dist/connection/calendar/ConnectedUpcomingEvents.d.ts +12 -0
  136. package/dist/connection/calendar/CopyField.d.ts +9 -0
  137. package/dist/connection/calendar/EventEditorDialog.d.ts +29 -0
  138. package/dist/connection/calendar/EventScheduling.d.ts +8 -0
  139. package/dist/connection/calendar/InvitationsPanel.d.ts +5 -0
  140. package/dist/connection/calendar/OpenAccessPanel.d.ts +7 -0
  141. package/dist/connection/calendar/PublishCalendarDialog.d.ts +8 -0
  142. package/dist/connection/calendar/RoomsDirectoryPanel.d.ts +8 -0
  143. package/dist/connection/calendar/ShareCalendarDialog.d.ts +6 -0
  144. package/dist/connection/calendar/copy.d.ts +2 -0
  145. package/dist/connection/calendar/index.d.ts +6 -0
  146. package/dist/connection/calendar/store.d.ts +47 -0
  147. package/dist/connection/calendar/types.d.ts +36 -0
  148. package/dist/connection/calendar/useWebinarAttendee.d.ts +3 -0
  149. package/dist/connection/notification-center/ConnectedNotificationCenter.d.ts +15 -0
  150. package/dist/connection/notification-center/NotificationCenter.d.ts +37 -0
  151. package/dist/connection/notification-center/NotificationEvent.d.ts +33 -0
  152. package/dist/connection/notification-center/index.d.ts +4 -0
  153. package/dist/connection/notification-center/items.d.ts +44 -0
  154. package/dist/document-tools/index.cjs +1 -1
  155. package/dist/document-tools/index.js +1 -1
  156. package/dist/facts/index.cjs +6 -6
  157. package/dist/facts/index.js +6 -6
  158. package/dist/files/index.cjs +6 -6
  159. package/dist/files/index.js +6 -6
  160. package/dist/home/index.cjs +20 -20
  161. package/dist/home/index.js +5 -5
  162. package/dist/index.cjs +969 -928
  163. package/dist/index.cjs.map +1 -1
  164. package/dist/index.js +26 -25
  165. package/dist/index.js.map +1 -1
  166. package/dist/retrieval/index.cjs +1 -1
  167. package/dist/retrieval/index.js +1 -1
  168. package/dist/settings/index.cjs +58 -72
  169. package/dist/settings/index.cjs.map +1 -1
  170. package/dist/settings/index.js +6 -23
  171. package/dist/settings/index.js.map +1 -1
  172. package/dist/shell/index.cjs +61 -60
  173. package/dist/shell/index.js +5 -4
  174. package/dist/site/index.cjs +5 -5
  175. package/dist/site/index.js +1 -1
  176. package/dist/studio/index.cjs +11 -11
  177. package/dist/studio/index.js +9 -9
  178. package/dist/workflow-canvas/index.cjs +69 -70
  179. package/dist/workflow-canvas/index.cjs.map +1 -1
  180. package/dist/workflow-canvas/index.js +14 -15
  181. package/dist/workflow-canvas/index.js.map +1 -1
  182. package/dist/workspaces/index.cjs +2 -2
  183. package/dist/workspaces/index.js +2 -2
  184. package/node_modules/@arbidocs/coedit/package.json +1 -1
  185. package/package.json +4 -4
  186. package/dist/chunk-2Q7FDZAY.js.map +0 -1
  187. package/dist/chunk-AAFX64WD.cjs.map +0 -1
  188. package/dist/chunk-ATJUVHVB.js.map +0 -1
  189. package/dist/chunk-CHVCTKF4.cjs.map +0 -1
  190. package/dist/chunk-CQCC7LE7.js +0 -210
  191. package/dist/chunk-CQCC7LE7.js.map +0 -1
  192. package/dist/chunk-JY73DJOS.cjs.map +0 -1
  193. package/dist/chunk-KDUGTKVI.cjs.map +0 -1
  194. package/dist/chunk-KMNZ2RVO.js.map +0 -1
  195. package/dist/chunk-KSHKTOY2.js.map +0 -1
  196. package/dist/chunk-L2PAPOZ5.js.map +0 -1
  197. package/dist/chunk-OGBXV326.cjs.map +0 -1
  198. package/dist/chunk-OQ7RUNOC.js.map +0 -1
  199. package/dist/chunk-RFIBUWLF.cjs +0 -232
  200. package/dist/chunk-RFIBUWLF.cjs.map +0 -1
  201. package/dist/chunk-RQ2Y7USX.cjs.map +0 -1
  202. package/dist/chunk-W3VYZXNS.js.map +0 -1
  203. package/dist/chunk-WXYQ66KC.cjs.map +0 -1
@@ -1,18 +1,20 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkDETZZBG2_cjs = require('./chunk-DETZZBG2.cjs');
5
- var chunkRQ2Y7USX_cjs = require('./chunk-RQ2Y7USX.cjs');
4
+ var chunkOGP6MQXQ_cjs = require('./chunk-OGP6MQXQ.cjs');
5
+ var chunkMIDXCYZB_cjs = require('./chunk-MIDXCYZB.cjs');
6
6
  var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
7
- var chunkWS5EX7DN_cjs = require('./chunk-WS5EX7DN.cjs');
7
+ var chunkDETZZBG2_cjs = require('./chunk-DETZZBG2.cjs');
8
+ var chunkR26BK7YL_cjs = require('./chunk-R26BK7YL.cjs');
8
9
  var chunkV4ISCZJ7_cjs = require('./chunk-V4ISCZJ7.cjs');
9
10
  var chunk2EI7NCUA_cjs = require('./chunk-2EI7NCUA.cjs');
10
- var chunkC2CWWEHO_cjs = require('./chunk-C2CWWEHO.cjs');
11
+ var chunkC4WSHRR6_cjs = require('./chunk-C4WSHRR6.cjs');
11
12
  var chunk7RGLTF76_cjs = require('./chunk-7RGLTF76.cjs');
12
- var chunk6F7SZCVL_cjs = require('./chunk-6F7SZCVL.cjs');
13
+ var chunkOWCEQKAR_cjs = require('./chunk-OWCEQKAR.cjs');
13
14
  var chunk32HW2Q33_cjs = require('./chunk-32HW2Q33.cjs');
14
- var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
15
15
  var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
16
+ var chunkC2CWWEHO_cjs = require('./chunk-C2CWWEHO.cjs');
17
+ var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
16
18
  var react = require('react');
17
19
  var lucideReact = require('lucide-react');
18
20
  var ui = require('@arbidocs/react/ui');
@@ -155,11 +157,11 @@ function FieldControl({
155
157
  ] });
156
158
  }
157
159
  case "scope": {
158
- const scope = chunk6F7SZCVL_cjs.isWorkflowScope(value) ? value : { folders: [], labels: [] };
160
+ const scope = chunkOWCEQKAR_cjs.isWorkflowScope(value) ? value : { folders: [], labels: [] };
159
161
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": testId, children: renderScope?.(field, scope, onChange) });
160
162
  }
161
163
  case "documents": {
162
- const picked = chunk6F7SZCVL_cjs.isWorkflowScope(value) ? value : { folders: [], labels: [], documents: [] };
164
+ const picked = chunkOWCEQKAR_cjs.isWorkflowScope(value) ? value : { folders: [], labels: [], documents: [] };
163
165
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": testId, children: renderDocuments?.(field, picked, onChange) });
164
166
  }
165
167
  case "person":
@@ -317,7 +319,7 @@ function SchemaForm({
317
319
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex flex-col gap-4", className), "data-slot": "schema-form", children: [
318
320
  common.map(render),
319
321
  advanced.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
320
- chunkWS5EX7DN_cjs.FoldSection,
322
+ chunkOGP6MQXQ_cjs.FoldSection,
321
323
  {
322
324
  label: l.advanced,
323
325
  open: advancedOpen,
@@ -448,7 +450,7 @@ function WorkflowConfigDialog({
448
450
  }) {
449
451
  const l = { ...DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, ...labels };
450
452
  const initialKey = JSON.stringify(initialInputs ?? {});
451
- const seedKey = JSON.stringify({ ...chunk6F7SZCVL_cjs.defaultInputs(workflow), ...JSON.parse(initialKey) });
453
+ const seedKey = JSON.stringify({ ...chunkOWCEQKAR_cjs.defaultInputs(workflow), ...JSON.parse(initialKey) });
452
454
  const seed = react.useMemo(() => JSON.parse(seedKey), [seedKey]);
453
455
  const [inputs, setInputs] = useControllableState(inputsProp, seed, onInputsChange);
454
456
  const [agentId, setAgentId] = useControllableState(
@@ -460,7 +462,7 @@ function WorkflowConfigDialog({
460
462
  if (open && inputsProp === void 0) setInputs(seed);
461
463
  }, [open, seed]);
462
464
  const setField = (name, value) => setInputs({ ...inputs, [name]: value });
463
- const errors = chunk6F7SZCVL_cjs.validateInputs(workflow, inputs);
465
+ const errors = chunkOWCEQKAR_cjs.validateInputs(workflow, inputs);
464
466
  const valid = Object.keys(errors).length === 0;
465
467
  const visibleErrors = Object.fromEntries(
466
468
  Object.entries(errors).filter(([, e]) => e !== "required")
@@ -473,7 +475,7 @@ function WorkflowConfigDialog({
473
475
  const blockedByScope = matchedCount !== null && matchedCount === 0 && Boolean(workflow.requiresFiles);
474
476
  const showAgent = workflow.run.kind === "prompt" && workflow.options?.agent !== false && agents !== void 0 && agents.length > 0;
475
477
  const launch = (values) => {
476
- Promise.resolve(onLaunch(chunk6F7SZCVL_cjs.buildLaunch(workflow, values, agentId))).catch(() => {
478
+ Promise.resolve(onLaunch(chunkOWCEQKAR_cjs.buildLaunch(workflow, values, agentId))).catch(() => {
477
479
  });
478
480
  };
479
481
  const submit = () => {
@@ -492,7 +494,7 @@ function WorkflowConfigDialog({
492
494
  const firstField = workflow.inputs.find((f) => !f.advanced);
493
495
  const focusPromptFirst = firstField?.type === "text" || firstField?.type === "longtext";
494
496
  const defaultScopeRender = scopeSource ? (_field, value, onChange) => /* @__PURE__ */ jsxRuntime.jsx(
495
- chunkWS5EX7DN_cjs.ScopePicker,
497
+ chunkOGP6MQXQ_cjs.ScopePicker,
496
498
  {
497
499
  folders: scopeSource.folders,
498
500
  unfiledCount: scopeSource.unfiledCount,
@@ -525,7 +527,7 @@ function WorkflowConfigDialog({
525
527
  },
526
528
  children: [
527
529
  /* @__PURE__ */ jsxRuntime.jsx(
528
- chunkWS5EX7DN_cjs.QuickActionDialogHeader,
530
+ chunkOGP6MQXQ_cjs.QuickActionDialogHeader,
529
531
  {
530
532
  icon: workflow.icon && renderIcon ? renderIcon(workflow.icon) : null,
531
533
  title: workflow.title,
@@ -543,7 +545,7 @@ function WorkflowConfigDialog({
543
545
  submit();
544
546
  },
545
547
  children: noFiles ? /* @__PURE__ */ jsxRuntime.jsx(
546
- chunkWS5EX7DN_cjs.AddFilesFirst,
548
+ chunkOGP6MQXQ_cjs.AddFilesFirst,
547
549
  {
548
550
  reason: l.addFilesReason,
549
551
  action: addFilesAction,
@@ -643,9 +645,9 @@ function WorkflowLauncher({
643
645
  };
644
646
  const select = (workflow) => {
645
647
  if (workflow.run.kind === "operation" && workflow.inputs.length === 0) {
646
- const inputs = chunk6F7SZCVL_cjs.defaultInputs(workflow);
647
- if (Object.keys(chunk6F7SZCVL_cjs.validateInputs(workflow, inputs)).length === 0) {
648
- Promise.resolve(onLaunch(chunk6F7SZCVL_cjs.buildLaunch(workflow, inputs, void 0))).catch(() => {
648
+ const inputs = chunkOWCEQKAR_cjs.defaultInputs(workflow);
649
+ if (Object.keys(chunkOWCEQKAR_cjs.validateInputs(workflow, inputs)).length === 0) {
650
+ Promise.resolve(onLaunch(chunkOWCEQKAR_cjs.buildLaunch(workflow, inputs, void 0))).catch(() => {
649
651
  });
650
652
  return;
651
653
  }
@@ -667,7 +669,7 @@ function WorkflowLauncher({
667
669
  });
668
670
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-slot": "workflow-launcher", children: [
669
671
  showTiles && /* @__PURE__ */ jsxRuntime.jsx(
670
- chunkWS5EX7DN_cjs.StartTiles,
672
+ chunkOGP6MQXQ_cjs.StartTiles,
671
673
  {
672
674
  items: [...tiles, ...extraTiles],
673
675
  caption,
@@ -867,7 +869,7 @@ function WorkflowDocumentsField({
867
869
  children: [
868
870
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
869
871
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
870
- chunkRQ2Y7USX_cjs.DocumentPicker,
872
+ chunkMIDXCYZB_cjs.DocumentPicker,
871
873
  {
872
874
  groups: [{ id: "all", heading: l.allDocuments, docs: [...offered].sort(byTitle) }],
873
875
  value: multiple ? "" : ids[0] ?? "",
@@ -1041,7 +1043,7 @@ function toStepField(f) {
1041
1043
  }
1042
1044
  var compact = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0 && v !== ""));
1043
1045
  function placeholders(workflow) {
1044
- return Object.fromEntries(chunk6F7SZCVL_cjs.runFields(workflow).map((f) => [f.name, `{{${f.name}}}`]));
1046
+ return Object.fromEntries(chunkOWCEQKAR_cjs.runFields(workflow).map((f) => [f.name, `{{${f.name}}}`]));
1045
1047
  }
1046
1048
  function agentStep(workflow, step, options) {
1047
1049
  const target = step.workflow ? options.resolveWorkflow?.(step.workflow) : void 0;
@@ -1050,11 +1052,11 @@ function agentStep(workflow, step, options) {
1050
1052
  ([, v]) => v !== void 0 && v !== null && v !== ""
1051
1053
  );
1052
1054
  const inputs = { ...placeholders(workflow), ...Object.fromEntries(given) };
1053
- return { skill: null, inputs: null, prompt: chunk6F7SZCVL_cjs.composeStepPrompt(workflow, step, inputs, options) };
1055
+ return { skill: null, inputs: null, prompt: chunkOWCEQKAR_cjs.composeStepPrompt(workflow, step, inputs, options) };
1054
1056
  }
1055
1057
  function toPlanSteps(workflow, options = {}) {
1056
1058
  const layout = workflow.run.kind === "steps" ? workflow.run.layout : void 0;
1057
- return chunk6F7SZCVL_cjs.workflowSteps(workflow).map((step) => {
1059
+ return chunkOWCEQKAR_cjs.workflowSteps(workflow).map((step) => {
1058
1060
  const ui = compact({
1059
1061
  description: step.description,
1060
1062
  icon: step.icon,
@@ -1081,8 +1083,8 @@ function toPlanSteps(workflow, options = {}) {
1081
1083
  ui,
1082
1084
  // An unfinished signal (still being typed) is not saved: the server would refuse it.
1083
1085
  ...step.signals?.some((s) => !isIncompleteSignal(s)) ? { signals: step.signals.filter((s) => !isIncompleteSignal(s)).map(toPlanSignal) } : {},
1084
- ...step.assignee && chunk6F7SZCVL_cjs.canAssign(step) ? { assignee: toPlanAssignee(step.assignee) } : {},
1085
- ...step.remindAfterHours && chunk6F7SZCVL_cjs.canAssign(step) ? { remind_after_hours: step.remindAfterHours } : {},
1086
+ ...step.assignee && chunkOWCEQKAR_cjs.canAssign(step) ? { assignee: toPlanAssignee(step.assignee) } : {},
1087
+ ...step.remindAfterHours && chunkOWCEQKAR_cjs.canAssign(step) ? { remind_after_hours: step.remindAfterHours } : {},
1086
1088
  // A review's fields are what approving it is checked against (the server's `fields`).
1087
1089
  ...step.kind === "review" && step.fields?.length ? { fields: step.fields.map(toStepField) } : {},
1088
1090
  ...step.kind === "action" ? { action: toPlanAction(step.action) } : {},
@@ -1200,7 +1202,7 @@ function workflowToSkillMarkdown(workflow) {
1200
1202
  if (workflow.landing !== "chat") lines.push(`landing: ${workflow.landing}`);
1201
1203
  if (workflow.requiresFiles) lines.push("requires_files: true");
1202
1204
  if (workflow.inputs.length > 0) {
1203
- lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(chunk6F7SZCVL_cjs.fieldToFrontmatter))}`);
1205
+ lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(chunkOWCEQKAR_cjs.fieldToFrontmatter))}`);
1204
1206
  }
1205
1207
  lines.push("---", "", run.promptTemplate.trim(), "");
1206
1208
  return lines.join("\n");
@@ -1222,12 +1224,12 @@ function workflowFromSkillMarkdown(id, text) {
1222
1224
  } else if (value === "true" || value === "false") frontmatter[key] = value === "true";
1223
1225
  else frontmatter[key] = value;
1224
1226
  }
1225
- return chunk6F7SZCVL_cjs.workflowFromFrontmatter(id, frontmatter, body);
1227
+ return chunkOWCEQKAR_cjs.workflowFromFrontmatter(id, frontmatter, body);
1226
1228
  }
1227
1229
  var errorMessage = (e) => e instanceof Error ? e.message : typeof e === "string" ? e : "Something went wrong.";
1228
1230
  function firstOpen(steps, states) {
1229
1231
  const open = steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? "pending"));
1230
- return open?.id ?? (steps.length && chunk6F7SZCVL_cjs.isRunFinished(steps, states) ? null : steps[0]?.id ?? null);
1232
+ return open?.id ?? (steps.length && chunkOWCEQKAR_cjs.isRunFinished(steps, states) ? null : steps[0]?.id ?? null);
1231
1233
  }
1232
1234
  function useWorkflowView(options) {
1233
1235
  const { steps, states, inputs, setInput, loaded = true } = options;
@@ -1267,11 +1269,11 @@ function useWorkflowView(options) {
1267
1269
  }),
1268
1270
  []
1269
1271
  );
1270
- const action = busy ? "wait" : chunk6F7SZCVL_cjs.nextAction(steps, states, current, actionOptions(options));
1272
+ const action = busy ? "wait" : chunkOWCEQKAR_cjs.nextAction(steps, states, current, actionOptions(options));
1271
1273
  const next = react.useCallback(async () => {
1272
1274
  const { steps: s, states: st, inputs: values } = optionsRef.current;
1273
1275
  const at = s.find((x) => x.id === current);
1274
- const act2 = chunk6F7SZCVL_cjs.nextAction(s, st, current, actionOptions(optionsRef.current));
1276
+ const act2 = chunkOWCEQKAR_cjs.nextAction(s, st, current, actionOptions(optionsRef.current));
1275
1277
  if (!at || act2 === "wait" || busy) return;
1276
1278
  setActionError(null);
1277
1279
  if (act2 === "finish") return setCurrent(null);
@@ -1282,7 +1284,7 @@ function useWorkflowView(options) {
1282
1284
  await (act2 === "start" ? optionsRef.current.start?.() : optionsRef.current.retry?.(at.id));
1283
1285
  return;
1284
1286
  }
1285
- if (Object.keys(chunk6F7SZCVL_cjs.validateStep(at, values)).length > 0) {
1287
+ if (Object.keys(chunkOWCEQKAR_cjs.validateStep(at, values)).length > 0) {
1286
1288
  setShowErrors(true);
1287
1289
  return;
1288
1290
  }
@@ -1383,10 +1385,10 @@ function useWorkflowView(options) {
1383
1385
  inputs,
1384
1386
  setInput,
1385
1387
  stateOf: (id) => states[id],
1386
- phaseOf: (id) => chunk6F7SZCVL_cjs.stepPhase(steps, states, id),
1387
- failedUpstreamOf: (id) => chunk6F7SZCVL_cjs.failedUpstream(steps, states, id),
1388
+ phaseOf: (id) => chunkOWCEQKAR_cjs.stepPhase(steps, states, id),
1389
+ failedUpstreamOf: (id) => chunkOWCEQKAR_cjs.failedUpstream(steps, states, id),
1388
1390
  isLocked,
1389
- errors: showErrors && step && !isLocked(step.id) ? chunk6F7SZCVL_cjs.validateStep(step, inputs) : {},
1391
+ errors: showErrors && step && !isLocked(step.id) ? chunkOWCEQKAR_cjs.validateStep(step, inputs) : {},
1390
1392
  busy,
1391
1393
  actionError,
1392
1394
  isRunning: Object.values(states).some((s) => s.status === "running"),
@@ -1404,11 +1406,11 @@ function useWorkflowView(options) {
1404
1406
  nameOf: options.nameOf,
1405
1407
  assigneeOf: (id) => {
1406
1408
  const s = steps.find((x) => x.id === id);
1407
- if (!s || !chunk6F7SZCVL_cjs.canAssign(s)) return void 0;
1408
- return chunk6F7SZCVL_cjs.assigneeName(s.assignee, {
1409
+ if (!s || !chunkOWCEQKAR_cjs.canAssign(s)) return void 0;
1410
+ return chunkOWCEQKAR_cjs.assigneeName(s.assignee, {
1409
1411
  nameOf: options.nameOf,
1410
1412
  inputs,
1411
- fields: chunk6F7SZCVL_cjs.runFieldsOf(steps),
1413
+ fields: chunkOWCEQKAR_cjs.runFieldsOf(steps),
1412
1414
  announcedTo: states[id]?.announcedTo
1413
1415
  });
1414
1416
  },
@@ -1542,7 +1544,7 @@ function StepBarFrame({
1542
1544
  }) {
1543
1545
  const l = { ...DEFAULT_STEP_BAR_LABELS, ...labels };
1544
1546
  const box = react.useRef(null);
1545
- const { width } = chunk6F7SZCVL_cjs.useElementSize(box);
1547
+ const { width } = chunkOWCEQKAR_cjs.useElementSize(box);
1546
1548
  const narrow = width > 0 && width < NARROW_PX;
1547
1549
  const [start, setStart] = react.useState(null);
1548
1550
  react.useEffect(() => setStart(null), [current]);
@@ -1609,7 +1611,7 @@ function StepBarFrame({
1609
1611
  phase === "blocked" && "opacity-60"
1610
1612
  ),
1611
1613
  "aria-hidden": true,
1612
- children: /* @__PURE__ */ jsxRuntime.jsx(chunk6F7SZCVL_cjs.StepBadgeMark, { phase, icon: icon?.(s) })
1614
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkOWCEQKAR_cjs.StepBadgeMark, { phase, icon: icon?.(s) })
1613
1615
  }
1614
1616
  ),
1615
1617
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", title: s.title, children: s.title }),
@@ -1717,7 +1719,7 @@ function StepBarFrame({
1717
1719
  };
1718
1720
  const running = win.runningHidden;
1719
1721
  const outOfViewChip = (s, kind) => /* @__PURE__ */ jsxRuntime.jsx(
1720
- chunk6F7SZCVL_cjs.StepChip,
1722
+ chunkOWCEQKAR_cjs.StepChip,
1721
1723
  {
1722
1724
  kind: kindOf(s),
1723
1725
  phase: kind === "working" ? "running" : "failed",
@@ -1890,7 +1892,7 @@ var DEFAULT_WORKFLOW_STEP_PARTS_LABELS = {
1890
1892
  someone: "someone"
1891
1893
  };
1892
1894
  var docName = (ref, nameOfDoc) => {
1893
- const { id, version } = chunk6F7SZCVL_cjs.splitDocRef(ref);
1895
+ const { id, version } = chunkOWCEQKAR_cjs.splitDocRef(ref);
1894
1896
  const name = nameOfDoc?.(id) ?? id;
1895
1897
  return version ? `${name} \xB7 v${version}` : name;
1896
1898
  };
@@ -1972,7 +1974,7 @@ function SendBackControl({
1972
1974
  const states = Object.fromEntries(
1973
1975
  run.steps.map((s) => [s.id, run.stateOf(s.id) ?? { status: "pending" }])
1974
1976
  );
1975
- const targets = chunk6F7SZCVL_cjs.sendBackTargets(run.steps, states, step.id);
1977
+ const targets = chunkOWCEQKAR_cjs.sendBackTargets(run.steps, states, step.id);
1976
1978
  const [open, setOpen] = react.useState(false);
1977
1979
  const [to, setTo] = react.useState(targets[0]?.id ?? "");
1978
1980
  const [note, setNote] = react.useState("");
@@ -2062,7 +2064,7 @@ function ApprovalEvidence({
2062
2064
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex flex-wrap items-center gap-1.5 text-sm font-medium", children: [
2063
2065
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "size-4 text-primary" }),
2064
2066
  approver ? l.approvedBy.replace("{name}", approver) : null,
2065
- state.at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-normal text-muted-foreground", children: l.approvedAt.replace("{date}", chunk6F7SZCVL_cjs.formatDate(state.at)) })
2067
+ state.at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-normal text-muted-foreground", children: l.approvedAt.replace("{date}", chunkOWCEQKAR_cjs.formatDate(state.at)) })
2066
2068
  ] }),
2067
2069
  evidence.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
2068
2070
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: l.approvedWhat }),
@@ -2095,7 +2097,7 @@ function ApprovalEvidence({
2095
2097
  ] }),
2096
2098
  (step.fields ?? []).length > 0 && /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs", children: (step.fields ?? []).map((f) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "contents", children: [
2097
2099
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
2098
- /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-testid": `${testId}-evidence-field-${f.name}`, children: chunk6F7SZCVL_cjs.shownValue(run.inputs[f.name], f, run.nameOf) })
2100
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-testid": `${testId}-evidence-field-${f.name}`, children: chunkOWCEQKAR_cjs.shownValue(run.inputs[f.name], f, run.nameOf) })
2099
2101
  ] }, f.name)) })
2100
2102
  ] });
2101
2103
  }
@@ -2191,7 +2193,7 @@ function ActionStepBody({
2191
2193
  waiting?.expires_at && phase === "waiting" && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
2192
2194
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "size-3.5" }),
2193
2195
  " ",
2194
- l.expires.replace("{date}", chunk6F7SZCVL_cjs.formatDate(waiting.expires_at))
2196
+ l.expires.replace("{date}", chunkOWCEQKAR_cjs.formatDate(waiting.expires_at))
2195
2197
  ] }),
2196
2198
  phase === "waiting" && mine && !declining && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2", children: [
2197
2199
  actions?.sign && state && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2349,7 +2351,7 @@ function WorkflowStepBar({
2349
2351
  const name = `${title} (${l.phases[phase]})`;
2350
2352
  if (s.id === DONE)
2351
2353
  return /* @__PURE__ */ jsxRuntime.jsx(
2352
- chunk6F7SZCVL_cjs.StepChip,
2354
+ chunkOWCEQKAR_cjs.StepChip,
2353
2355
  {
2354
2356
  inert: true,
2355
2357
  kind: "start",
@@ -2363,17 +2365,17 @@ function WorkflowStepBar({
2363
2365
  "data-testid": tid("step-done")
2364
2366
  }
2365
2367
  );
2366
- const kind = chunk6F7SZCVL_cjs.stepKindOf(s);
2367
- const KindIcon = chunk6F7SZCVL_cjs.STEP_KIND_ICONS[kind];
2368
+ const kind = chunkOWCEQKAR_cjs.stepKindOf(s);
2369
+ const KindIcon = chunkOWCEQKAR_cjs.STEP_KIND_ICONS[kind];
2368
2370
  return /* @__PURE__ */ jsxRuntime.jsx(
2369
- chunk6F7SZCVL_cjs.StepChip,
2371
+ chunkOWCEQKAR_cjs.StepChip,
2370
2372
  {
2371
2373
  kind,
2372
2374
  phase,
2373
2375
  icon: icon(s.icon) ?? /* @__PURE__ */ jsxRuntime.jsx(KindIcon, {}),
2374
2376
  label: s.title,
2375
2377
  current: isCurrent,
2376
- heading: chunk6F7SZCVL_cjs.DEFAULT_STEP_KIND_LABELS[kind],
2378
+ heading: chunkOWCEQKAR_cjs.DEFAULT_STEP_KIND_LABELS[kind],
2377
2379
  labelClassName: isCurrent ? STEP_LABEL_CURRENT : ui.cn(STEP_LABEL, STEP_LABEL_MAX),
2378
2380
  labelTestId: tid(`step-${s.id}-label`),
2379
2381
  onClick: () => run.goTo(s.id),
@@ -2406,7 +2408,7 @@ function WorkflowStepBar({
2406
2408
  isSelectable: (id) => id !== DONE,
2407
2409
  renderStep: (s) => pill(s),
2408
2410
  icon: (s) => s.id === DONE ? doneIcon : icon(s.icon),
2409
- kindOf: (s) => s.id === DONE ? "start" : chunk6F7SZCVL_cjs.stepKindOf(s),
2411
+ kindOf: (s) => s.id === DONE ? "start" : chunkOWCEQKAR_cjs.stepKindOf(s),
2410
2412
  disabled: run.busy,
2411
2413
  labels,
2412
2414
  tid,
@@ -2489,7 +2491,7 @@ function WorkflowRunner({
2489
2491
  const { steps, step, isComplete, action } = run;
2490
2492
  const completion = workflow.run.kind === "steps" ? workflow.run.completion : void 0;
2491
2493
  const tid = (suffix) => `${testIdPrefix}-${suffix}`;
2492
- const levels = chunk6F7SZCVL_cjs.stepLevels(steps);
2494
+ const levels = chunkOWCEQKAR_cjs.stepLevels(steps);
2493
2495
  const icon = (key) => key && renderIcon ? renderIcon(key) : void 0;
2494
2496
  const added = step?.kind === "upload" ? (files ?? []).filter((f) => f.addedFor === step.id) : [];
2495
2497
  const unread = added.filter((f) => f.status === "processing").length;
@@ -2497,7 +2499,7 @@ function WorkflowRunner({
2497
2499
  const sending = added.filter((f) => f.status === "uploading").length;
2498
2500
  const unsent = added.filter((f) => f.status === "upload-failed").length;
2499
2501
  const uploadHold = step?.kind === "upload" && (sending > 0 || uploading || unsent > 0);
2500
- const docsWait = !!step && chunk6F7SZCVL_cjs.waitingDocuments(run.stateOf(step.id)).length > 0;
2502
+ const docsWait = !!step && chunkOWCEQKAR_cjs.waitingDocuments(run.stateOf(step.id)).length > 0;
2501
2503
  const nextLabel = sending ? sending === 1 ? l.uploadingFile : l.uploadingFiles.replace("{count}", String(sending)) : uploadHold && uploading ? l.uploadingAny : uploadHold ? unsent === 1 ? l.uploadFailed : l.uploadsFailed.replace("{count}", String(unsent)) : reading ? l.readingFiles.replace("{current}", String(Math.min(added.length - unread + 1, added.length))).replace("{count}", String(added.length)) : action === "start" ? l.start : action === "retry" ? l.retry : action === "finish" ? l.finish : action === "complete" && step?.kind === "review" ? l.approve : action === "complete" && step?.kind === "action" ? l.markSent : action === "wait" && (run.isRunning || run.busy || docsWait) ? l.working : (step && !run.isLocked(step.id) ? step.nextLabel : void 0) ?? l.next;
2502
2504
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn(compact2 ? "space-y-3" : "space-y-6", className), "data-testid": testIdPrefix, children: [
2503
2505
  !hideStepBar && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2529,7 +2531,7 @@ function WorkflowRunner({
2529
2531
  /* @__PURE__ */ jsxRuntime.jsx(StepNotices, { run, step, l, tid }),
2530
2532
  run.phaseOf(step.id) === "blocked" ? /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { className: ui.cn(box, "p-6"), "data-testid": tid(step.id), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", "data-testid": tid(`${step.id}-blocked`), children: l.blocked.replace(
2531
2533
  "{steps}",
2532
- chunk6F7SZCVL_cjs.stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
2534
+ chunkOWCEQKAR_cjs.stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
2533
2535
  ) }) }) : step.kind === "form" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2534
2536
  /* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon), testId: tid(`${step.id}-title`) }),
2535
2537
  /* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
@@ -2585,7 +2587,7 @@ function WorkflowRunner({
2585
2587
  ] }) : step.kind === "review" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2586
2588
  /* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon) }),
2587
2589
  /* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2588
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: chunk6F7SZCVL_cjs.reviewInstructions(step, run.inputs) }),
2590
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: chunkOWCEQKAR_cjs.reviewInstructions(step, run.inputs) }),
2589
2591
  /* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2590
2592
  !(run.phaseOf(step.id) === "done" && run.stateOf(step.id)?.by) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", "data-testid": tid(`${step.id}-status`), children: run.phaseOf(step.id) === "done" ? l.approved : run.phaseOf(step.id) === "skipped" ? l.skipped : l.awaitingReview }),
2591
2593
  (step.fields ?? []).length > 0 && run.phaseOf(step.id) === "ready" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2852,8 +2854,8 @@ function AgentStepBody({
2852
2854
  }) {
2853
2855
  const state = run.stateOf(step.id);
2854
2856
  const phase = run.phaseOf(step.id);
2855
- const pending = chunk6F7SZCVL_cjs.waitingDocuments(state);
2856
- const pendingNames = pending.flatMap((ref) => nameOfDoc?.(chunk6F7SZCVL_cjs.splitDocRef(ref).id) ?? []);
2857
+ const pending = chunkOWCEQKAR_cjs.waitingDocuments(state);
2858
+ const pendingNames = pending.flatMap((ref) => nameOfDoc?.(chunkOWCEQKAR_cjs.splitDocRef(ref).id) ?? []);
2857
2859
  const header = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
2858
2860
  /* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon }),
2859
2861
  phase === "failed" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: run.retry && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2938,7 +2940,7 @@ function StepNotices({
2938
2940
  l,
2939
2941
  tid
2940
2942
  }) {
2941
- const notStarted = !chunk6F7SZCVL_cjs.isPersonStep(step) && run.needsStart && run.phaseOf(step.id) === "ready";
2943
+ const notStarted = !chunkOWCEQKAR_cjs.isPersonStep(step) && run.needsStart && run.phaseOf(step.id) === "ready";
2942
2944
  const failed = run.failedUpstreamOf(step.id);
2943
2945
  if (!notStarted && failed.length === 0) return null;
2944
2946
  const why = (error) => error ? `: ${error}` : "";
@@ -2974,6 +2976,1078 @@ function StepNotices({
2974
2976
  ))
2975
2977
  ] });
2976
2978
  }
2979
+ function CapabilityTile({
2980
+ label,
2981
+ description,
2982
+ icon: Icon,
2983
+ selected,
2984
+ onToggle,
2985
+ testId,
2986
+ className
2987
+ }) {
2988
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2989
+ "button",
2990
+ {
2991
+ type: "button",
2992
+ onClick: onToggle,
2993
+ "aria-pressed": selected,
2994
+ "data-testid": testId,
2995
+ "data-slot": "capability-tile",
2996
+ className: ui.cn(
2997
+ "flex flex-col items-start gap-1 rounded-lg p-3 text-left transition-colors pointer-coarse:min-h-11 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2998
+ selected ? "bg-accent text-accent-foreground ring-1 ring-inset ring-primary/30" : "bg-muted hover:bg-accent/60",
2999
+ className
3000
+ ),
3001
+ children: [
3002
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 16, className: selected ? "text-accent-foreground" : "text-muted-foreground" }),
3003
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium leading-tight", children: label }),
3004
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs leading-tight text-muted-foreground", children: description })
3005
+ ]
3006
+ }
3007
+ );
3008
+ }
3009
+ function CapabilityGrid({
3010
+ children,
3011
+ testId,
3012
+ className
3013
+ }) {
3014
+ return /* @__PURE__ */ jsxRuntime.jsx(
3015
+ "div",
3016
+ {
3017
+ className: ui.cn("grid grid-cols-2 gap-2 sm:grid-cols-4", className),
3018
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "agent-capabilities" }),
3019
+ children
3020
+ }
3021
+ );
3022
+ }
3023
+ var DEFAULT_AGENT_TYPE_SELECTOR_LABELS = {
3024
+ agentType: "Agent type"
3025
+ };
3026
+ function AgentTypeSelector({
3027
+ value,
3028
+ onChange,
3029
+ options,
3030
+ label,
3031
+ labels,
3032
+ testId,
3033
+ optionTestId
3034
+ }) {
3035
+ const l = { ...DEFAULT_AGENT_TYPE_SELECTOR_LABELS, ...labels };
3036
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "agent-type-selector" }), children: [
3037
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { children: label ?? l.agentType }),
3038
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-2", children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
3039
+ "button",
3040
+ {
3041
+ type: "button",
3042
+ onClick: () => onChange(opt.value),
3043
+ "aria-pressed": value === opt.value,
3044
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(optionTestId?.(opt.value), { testId: `agent-type-${opt.value}` }),
3045
+ className: ui.cn(
3046
+ "rounded-lg p-3 text-left transition-colors pointer-coarse:min-h-11 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3047
+ value === opt.value ? "bg-accent text-accent-foreground ring-1 ring-inset ring-primary/30" : "bg-muted hover:bg-accent/60"
3048
+ ),
3049
+ children: [
3050
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium", children: opt.title }),
3051
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-xs text-muted-foreground", children: opt.description })
3052
+ ]
3053
+ },
3054
+ opt.value
3055
+ )) })
3056
+ ] });
3057
+ }
3058
+ var DEFAULT_AGENT_AVATAR_FIELD_LABELS = {
3059
+ painting: "Painting\u2026",
3060
+ generate: "Generate avatar",
3061
+ regenerate: "Regenerate"
3062
+ };
3063
+ function AgentAvatarField({
3064
+ picture,
3065
+ isBusy,
3066
+ canGenerate,
3067
+ onGenerate,
3068
+ labels,
3069
+ testIds
3070
+ }) {
3071
+ const l = { ...DEFAULT_AGENT_AVATAR_FIELD_LABELS, ...labels };
3072
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", "data-slot": "agent-avatar-field", children: [
3073
+ /* @__PURE__ */ jsxRuntime.jsx(
3074
+ "div",
3075
+ {
3076
+ className: "flex size-24 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",
3077
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.preview, { testId: "agent-avatar-preview" }),
3078
+ children: isBusy ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-1 text-ai-ink", children: [
3079
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-7 animate-spin" }),
3080
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: l.painting })
3081
+ ] }) : picture ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: picture, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "size-10 text-ai-ink/70" })
3082
+ }
3083
+ ),
3084
+ /* @__PURE__ */ jsxRuntime.jsxs(
3085
+ ui.Button,
3086
+ {
3087
+ variant: "outline",
3088
+ size: "sm",
3089
+ className: "h-8 gap-1 px-2 text-xs pointer-coarse:h-11",
3090
+ disabled: isBusy || !canGenerate,
3091
+ onClick: onGenerate,
3092
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.generate, { testId: "agent-avatar-generate" }),
3093
+ children: [
3094
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wand2, { size: 12 }),
3095
+ " ",
3096
+ picture ? l.regenerate : l.generate
3097
+ ]
3098
+ }
3099
+ )
3100
+ ] });
3101
+ }
3102
+ var DEFAULT_AGENT_CREATOR_LABELS = {
3103
+ titleNew: "New agent",
3104
+ titleEdit: (name) => `Edit ${name}`,
3105
+ descriptionNew: "Say what this agent is for. Everything else follows from that.",
3106
+ descriptionEdit: "Change what this agent is for, or fine-tune it under Advanced.",
3107
+ describe: "What should it do?",
3108
+ describePlaceholder: "e.g. Reads new files each morning and tells me what changed, with sources.",
3109
+ describeHint: "This becomes the agent\u2019s persona and shapes every answer.",
3110
+ startFrom: "Or start from",
3111
+ summaryHeading: "What it can do (its tools)",
3112
+ summaryCan: (list) => `Can ${list}.`,
3113
+ summaryCannot: (list) => `Cannot ${list}.`,
3114
+ summaryNone: "It can read your files and answer. Nothing else is switched on yet.",
3115
+ summaryModel: (model) => `Uses ${model}.`,
3116
+ summaryModelAuto: "Uses the default model.",
3117
+ summaryWorkspaces: (list) => `Can read ${list}.`,
3118
+ summaryNoWorkspaces: "Cannot read any workspace yet. Give it access under Advanced.",
3119
+ summaryName: (name) => `Will be called ${name}.`,
3120
+ workspaceAccess: "Workspace access",
3121
+ workspaceAccessHint: "Each workspace stays separate. The agent can only read the ones you tick here.",
3122
+ workspaceAlready: "Already has access",
3123
+ revokeWorkspace: (name) => `Remove access to ${name}`,
3124
+ noWorkspacesToGrant: "You have no workspaces yet.",
3125
+ name: "Name",
3126
+ nameHint: "Letters, digits, - and _ only; must start with a letter or digit.",
3127
+ nameInvalid: "Letters, digits, - and _ only; must start with a letter or digit.",
3128
+ advanced: "Advanced",
3129
+ capabilities: "Tools",
3130
+ toolsHint: "Tools are switches on this agent: what it may do on its own, such as search the web or run code. Change them any time.",
3131
+ summaryChange: "Change tools",
3132
+ model: "Model",
3133
+ modelAuto: "Automatic",
3134
+ cancel: "Cancel",
3135
+ create: "Create agent",
3136
+ save: "Save changes",
3137
+ saving: "Saving\u2026"
3138
+ };
3139
+ var NAME_RE = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;
3140
+ var FILLER = /* @__PURE__ */ new Set([
3141
+ "a",
3142
+ "an",
3143
+ "the",
3144
+ "who",
3145
+ "that",
3146
+ "which",
3147
+ "to",
3148
+ "for",
3149
+ "and",
3150
+ "of",
3151
+ "i",
3152
+ "my"
3153
+ ]);
3154
+ function deriveAgentName(description) {
3155
+ const words = description.toLowerCase().replace(/[^a-z0-9\s-]/g, " ").split(/\s+/).filter((w) => w && !FILLER.has(w)).slice(0, 3);
3156
+ return words.join("-").slice(0, 64);
3157
+ }
3158
+ var isValidAgentName = (name) => NAME_RE.test(name) && name.length <= 64;
3159
+ var joinList = (items) => items.length <= 2 ? items.join(" and ") : `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
3160
+ function summarizeCapabilities(capabilities, enabled, modelName, labels = DEFAULT_AGENT_CREATOR_LABELS) {
3161
+ const on = capabilities.filter((c) => enabled[c.key]).map((c) => c.label.toLowerCase());
3162
+ const off = capabilities.filter((c) => !enabled[c.key]).map((c) => c.label.toLowerCase());
3163
+ const lines = [];
3164
+ if (on.length === 0) lines.push(labels.summaryNone);
3165
+ else {
3166
+ lines.push(labels.summaryCan(joinList(on)));
3167
+ if (off.length > 0) lines.push(labels.summaryCannot(joinList(off)));
3168
+ }
3169
+ lines.push(modelName ? labels.summaryModel(modelName) : labels.summaryModelAuto);
3170
+ return lines;
3171
+ }
3172
+ function summarizeAgent(capabilities, values, workspaces, labels = DEFAULT_AGENT_CREATOR_LABELS) {
3173
+ const lines = summarizeCapabilities(capabilities, values.capabilities, values.modelName, labels);
3174
+ const names = workspaces.filter((w) => values.workspaceIds.includes(w.id)).map((w) => w.name);
3175
+ lines.push(
3176
+ names.length > 0 ? labels.summaryWorkspaces(joinList(names)) : labels.summaryNoWorkspaces
3177
+ );
3178
+ if (values.name) lines.push(labels.summaryName(values.name));
3179
+ return lines;
3180
+ }
3181
+ var BLANK = {
3182
+ name: "",
3183
+ persona: "",
3184
+ capabilities: {},
3185
+ modelName: "",
3186
+ type: "builtin",
3187
+ workspaceIds: []
3188
+ };
3189
+ function AgentCreator({
3190
+ open,
3191
+ onOpenChange,
3192
+ isEdit = false,
3193
+ agentName,
3194
+ capabilities,
3195
+ templates = [],
3196
+ models = [],
3197
+ workspaces = [],
3198
+ grantedWorkspaceIds = [],
3199
+ onRevokeWorkspace,
3200
+ revokingWorkspaceId,
3201
+ avatar,
3202
+ types,
3203
+ values: valuesProp,
3204
+ initialValues,
3205
+ onValuesChange,
3206
+ advanced,
3207
+ isSaving,
3208
+ onSubmit,
3209
+ labels,
3210
+ testId
3211
+ }) {
3212
+ const l = { ...DEFAULT_AGENT_CREATOR_LABELS, ...labels };
3213
+ const seed = react.useMemo(
3214
+ () => ({ ...BLANK, ...initialValues }),
3215
+ // Seeded once per open.
3216
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3217
+ [open]
3218
+ );
3219
+ const [values, setValues] = useControllableState(
3220
+ valuesProp,
3221
+ seed,
3222
+ onValuesChange
3223
+ );
3224
+ const [advancedOpen, setAdvancedOpen] = react.useState(false);
3225
+ const [nameTouched, setNameTouched] = react.useState(false);
3226
+ react.useEffect(() => {
3227
+ if (open) {
3228
+ if (valuesProp === void 0) setValues(seed);
3229
+ setAdvancedOpen(false);
3230
+ setNameTouched(Boolean(seed.name));
3231
+ }
3232
+ }, [open]);
3233
+ const id = chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "agent-creator" });
3234
+ const name = values.name;
3235
+ const nameValid = isValidAgentName(name);
3236
+ const canSubmit = (isEdit || nameValid) && !isSaving;
3237
+ const patch = (next) => setValues({ ...values, ...next });
3238
+ const setPersona = (persona) => patch({ persona, ...!isEdit && !nameTouched ? { name: deriveAgentName(persona) } : {} });
3239
+ const applyTemplate = (t) => patch({
3240
+ persona: t.persona,
3241
+ capabilities: Object.fromEntries(
3242
+ capabilities.map((c) => [c.key, t.capabilities.includes(c.key)])
3243
+ ),
3244
+ ...!isEdit && !nameTouched ? { name: deriveAgentName(t.persona) } : {}
3245
+ });
3246
+ const summary = summarizeAgent(capabilities, values, workspaces, l);
3247
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
3248
+ ui.DialogContent,
3249
+ {
3250
+ presentation: "sheet",
3251
+ className: "max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-xl",
3252
+ "data-testid": id,
3253
+ children: [
3254
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
3255
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: isEdit ? l.titleEdit(agentName ?? name) : l.titleNew }),
3256
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: isEdit ? l.descriptionEdit : l.descriptionNew })
3257
+ ] }),
3258
+ /* @__PURE__ */ jsxRuntime.jsxs(
3259
+ "form",
3260
+ {
3261
+ className: "flex flex-col gap-5",
3262
+ onSubmit: (event) => {
3263
+ event.preventDefault();
3264
+ if (canSubmit) onSubmit(values);
3265
+ },
3266
+ children: [
3267
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
3268
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "agent-creator-describe", children: l.describe }),
3269
+ /* @__PURE__ */ jsxRuntime.jsx(
3270
+ ui.Textarea,
3271
+ {
3272
+ id: "agent-creator-describe",
3273
+ "data-testid": `${id}-describe`,
3274
+ value: values.persona,
3275
+ placeholder: l.describePlaceholder,
3276
+ rows: 4,
3277
+ autoFocus: true,
3278
+ onChange: (e) => setPersona(e.target.value)
3279
+ }
3280
+ ),
3281
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.describeHint })
3282
+ ] }),
3283
+ !isEdit && templates.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", "data-testid": `${id}-templates`, children: [
3284
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { children: l.startFrom }),
3285
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: templates.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
3286
+ "button",
3287
+ {
3288
+ type: "button",
3289
+ title: t.description,
3290
+ onClick: () => applyTemplate(t),
3291
+ "data-testid": `${id}-template-${t.id}`,
3292
+ className: ui.cn(
3293
+ "rounded-full border border-border px-3 py-1.5 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11 [&:hover]:bg-accent"
3294
+ ),
3295
+ children: t.title
3296
+ },
3297
+ t.id
3298
+ )) })
3299
+ ] }),
3300
+ /* @__PURE__ */ jsxRuntime.jsxs(
3301
+ "div",
3302
+ {
3303
+ className: "rounded-lg bg-muted p-3 text-sm",
3304
+ "data-testid": `${id}-summary`,
3305
+ "aria-live": "polite",
3306
+ children: [
3307
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground", children: [
3308
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "size-4 text-ai-ink", "aria-hidden": "true" }),
3309
+ l.summaryHeading
3310
+ ] }),
3311
+ summary.map((line) => /* @__PURE__ */ jsxRuntime.jsx("p", { children: line }, line)),
3312
+ /* @__PURE__ */ jsxRuntime.jsx(
3313
+ "button",
3314
+ {
3315
+ type: "button",
3316
+ onClick: () => setAdvancedOpen(true),
3317
+ "data-testid": `${id}-summary-change`,
3318
+ className: "mt-1 text-xs font-medium text-primary underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
3319
+ children: l.summaryChange
3320
+ }
3321
+ )
3322
+ ]
3323
+ }
3324
+ ),
3325
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-4", children: [
3326
+ typeof avatar === "function" ? avatar(values) : avatar,
3327
+ !isEdit && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
3328
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "agent-creator-name", children: l.name }),
3329
+ /* @__PURE__ */ jsxRuntime.jsx(
3330
+ ui.Input,
3331
+ {
3332
+ id: "agent-creator-name",
3333
+ "data-testid": `${id}-name`,
3334
+ value: name,
3335
+ placeholder: "research-assistant",
3336
+ "aria-invalid": name !== "" && !nameValid ? true : void 0,
3337
+ onChange: (e) => {
3338
+ setNameTouched(true);
3339
+ patch({ name: e.target.value });
3340
+ }
3341
+ }
3342
+ ),
3343
+ name !== "" && !nameValid && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", children: l.nameInvalid })
3344
+ ] })
3345
+ ] }),
3346
+ /* @__PURE__ */ jsxRuntime.jsx(
3347
+ chunkOGP6MQXQ_cjs.FoldSection,
3348
+ {
3349
+ label: l.advanced,
3350
+ open: advancedOpen,
3351
+ onOpenChange: setAdvancedOpen,
3352
+ testId: `${id}-advanced-toggle`,
3353
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
3354
+ !isEdit && types && types.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
3355
+ AgentTypeSelector,
3356
+ {
3357
+ value: values.type,
3358
+ onChange: (type) => patch({ type }),
3359
+ options: types,
3360
+ testId: `${id}-type`,
3361
+ optionTestId: (value) => `${id}-type-${value}`
3362
+ }
3363
+ ),
3364
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
3365
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { children: l.capabilities }),
3366
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.toolsHint }),
3367
+ /* @__PURE__ */ jsxRuntime.jsx(CapabilityGrid, { testId: `${id}-capabilities`, children: capabilities.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
3368
+ CapabilityTile,
3369
+ {
3370
+ label: c.label,
3371
+ description: c.description,
3372
+ icon: c.icon,
3373
+ selected: Boolean(values.capabilities[c.key]),
3374
+ onToggle: () => patch({
3375
+ capabilities: {
3376
+ ...values.capabilities,
3377
+ [c.key]: !values.capabilities[c.key]
3378
+ }
3379
+ }),
3380
+ testId: `${id}-cap-${c.key}`
3381
+ },
3382
+ c.key
3383
+ )) })
3384
+ ] }),
3385
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", "data-testid": `${id}-workspaces`, children: [
3386
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { children: l.workspaceAccess }),
3387
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.workspaceAccessHint }),
3388
+ workspaces.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.noWorkspacesToGrant }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: workspaces.map((w) => {
3389
+ const already = grantedWorkspaceIds.includes(w.id);
3390
+ const on = already || values.workspaceIds.includes(w.id);
3391
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1", children: [
3392
+ /* @__PURE__ */ jsxRuntime.jsx(
3393
+ "button",
3394
+ {
3395
+ type: "button",
3396
+ role: "checkbox",
3397
+ "aria-checked": on,
3398
+ disabled: already,
3399
+ title: already ? l.workspaceAlready : void 0,
3400
+ "data-testid": `${id}-workspace-${w.id}`,
3401
+ onClick: () => patch({
3402
+ workspaceIds: on ? values.workspaceIds.filter((x) => x !== w.id) : [...values.workspaceIds, w.id]
3403
+ }),
3404
+ className: ui.cn(
3405
+ "rounded-md border px-3 py-1.5 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60 pointer-coarse:min-h-11",
3406
+ on ? "border-primary bg-primary/10 text-primary" : "border-border [&:hover:not(:disabled)]:bg-accent"
3407
+ ),
3408
+ children: w.name
3409
+ }
3410
+ ),
3411
+ already && onRevokeWorkspace && /* @__PURE__ */ jsxRuntime.jsx(
3412
+ "button",
3413
+ {
3414
+ type: "button",
3415
+ "aria-label": l.revokeWorkspace(w.name),
3416
+ title: l.revokeWorkspace(w.name),
3417
+ disabled: revokingWorkspaceId === w.id,
3418
+ "data-testid": `${id}-workspace-${w.id}-revoke`,
3419
+ onClick: () => onRevokeWorkspace(w.id),
3420
+ className: "flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 pointer-coarse:size-11",
3421
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4", "aria-hidden": true })
3422
+ }
3423
+ )
3424
+ ] }, w.id);
3425
+ }) })
3426
+ ] }),
3427
+ models.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
3428
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { children: l.model }),
3429
+ /* @__PURE__ */ jsxRuntime.jsxs(
3430
+ ui.Select,
3431
+ {
3432
+ value: values.modelName || "__auto__",
3433
+ onValueChange: (v) => patch({ modelName: v === "__auto__" ? "" : v }),
3434
+ children: [
3435
+ /* @__PURE__ */ jsxRuntime.jsx(ui.SelectTrigger, { "data-testid": `${id}-model`, className: "pointer-coarse:min-h-11", children: /* @__PURE__ */ jsxRuntime.jsx(ui.SelectValue, {}) }),
3436
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.SelectContent, { children: [
3437
+ /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "__auto__", children: l.modelAuto }),
3438
+ models.map((m) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: m, children: m }, m))
3439
+ ] })
3440
+ ]
3441
+ }
3442
+ )
3443
+ ] }),
3444
+ typeof advanced === "function" ? advanced(values) : advanced
3445
+ ] })
3446
+ }
3447
+ ),
3448
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end gap-2 border-t border-border pt-3", children: [
3449
+ /* @__PURE__ */ jsxRuntime.jsx(
3450
+ ui.Button,
3451
+ {
3452
+ type: "button",
3453
+ variant: "ghost",
3454
+ onClick: () => onOpenChange(false),
3455
+ "data-testid": `${id}-cancel`,
3456
+ className: "pointer-coarse:min-h-11",
3457
+ children: l.cancel
3458
+ }
3459
+ ),
3460
+ /* @__PURE__ */ jsxRuntime.jsxs(
3461
+ ui.Button,
3462
+ {
3463
+ type: "submit",
3464
+ disabled: !canSubmit,
3465
+ "data-testid": `${id}-submit`,
3466
+ className: "gap-1.5 pointer-coarse:min-h-11",
3467
+ children: [
3468
+ isSaving ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "size-4" }),
3469
+ isSaving ? l.saving : isEdit ? l.save : l.create
3470
+ ]
3471
+ }
3472
+ )
3473
+ ] })
3474
+ ]
3475
+ }
3476
+ )
3477
+ ]
3478
+ }
3479
+ ) });
3480
+ }
3481
+
3482
+ // src/agents/definitions/persona.ts
3483
+ function composePersona(name, description) {
3484
+ const body = description.trim();
3485
+ const preamble = `You are ${name}, an AI agent.`;
3486
+ return body ? `${preamble} ${body}` : preamble;
3487
+ }
3488
+ function stripPersonaPreamble(persona) {
3489
+ return persona.replace(/^You are .+?, an AI agent\.\s*/, "").trim();
3490
+ }
3491
+ function agentCreatorToConfigSection(values, capabilityKeys) {
3492
+ return {
3493
+ PERSONA: composePersona(values.name, values.persona),
3494
+ ...values.modelName ? { AGENT_MODEL_NAME: values.modelName } : {},
3495
+ ...Object.fromEntries(capabilityKeys.map((k) => [k, !!values.capabilities[k]]))
3496
+ };
3497
+ }
3498
+ function agentConfigSectionToValues(section, capabilityKeys) {
3499
+ const s = section ?? {};
3500
+ return {
3501
+ persona: stripPersonaPreamble(String(s.PERSONA ?? "")),
3502
+ modelName: String(s.AGENT_MODEL_NAME ?? ""),
3503
+ capabilities: Object.fromEntries(capabilityKeys.map((k) => [k, Boolean(s[k])]))
3504
+ };
3505
+ }
3506
+ var DEFAULT_AGENT_CAPABILITIES = [
3507
+ {
3508
+ key: "WEB_SEARCH_ENABLED",
3509
+ label: "Web search",
3510
+ description: "Current facts, cited sources",
3511
+ icon: lucideReact.Globe
3512
+ },
3513
+ {
3514
+ key: "RUN_CODE_ENABLED",
3515
+ label: "Run code",
3516
+ description: "Exact numbers, real computation",
3517
+ icon: lucideReact.Terminal
3518
+ },
3519
+ {
3520
+ key: "DEEP_RESEARCH_ENABLED",
3521
+ label: "Deep research",
3522
+ description: "Multi-source investigations",
3523
+ icon: lucideReact.Telescope
3524
+ },
3525
+ {
3526
+ key: "PLANNING_ENABLED",
3527
+ label: "Planning",
3528
+ description: "Plans complex work first",
3529
+ icon: lucideReact.ListChecks
3530
+ },
3531
+ {
3532
+ key: "ARTIFACTS_ENABLED",
3533
+ label: "Documents",
3534
+ description: "Drafts and edits documents",
3535
+ icon: lucideReact.FileText
3536
+ },
3537
+ {
3538
+ key: "IMAGE_ENABLED",
3539
+ label: "Images",
3540
+ description: "Generates and edits images",
3541
+ icon: lucideReact.ImageIcon
3542
+ },
3543
+ { key: "MEMORY_ENABLED", label: "Memory", description: "Remembers across sessions", icon: lucideReact.Brain },
3544
+ { key: "SKILLS_ENABLED", label: "Skills", description: "May follow your skills", icon: lucideReact.Wand2 }
3545
+ ];
3546
+ var DEFAULT_AGENT_TEMPLATES = [
3547
+ {
3548
+ id: "researcher",
3549
+ title: "Researcher",
3550
+ description: "Looks things up and cites its sources",
3551
+ persona: "Researches a question thoroughly, reads the best sources, and cites every claim. Says plainly when something could not be confirmed.",
3552
+ capabilities: ["WEB_SEARCH_ENABLED", "DEEP_RESEARCH_ENABLED", "PLANNING_ENABLED"]
3553
+ },
3554
+ {
3555
+ id: "analyst",
3556
+ title: "Analyst",
3557
+ description: "Works through numbers and data",
3558
+ persona: "Works through data carefully, checks its arithmetic by running code, and explains how it reached each figure.",
3559
+ capabilities: ["RUN_CODE_ENABLED", "PLANNING_ENABLED", "ARTIFACTS_ENABLED"]
3560
+ },
3561
+ {
3562
+ id: "note-taker",
3563
+ title: "Note taker",
3564
+ description: "Keeps notes and remembers context",
3565
+ persona: "Keeps concise notes, remembers what matters between sessions, and drafts clean summaries on request.",
3566
+ capabilities: ["MEMORY_ENABLED", "ARTIFACTS_ENABLED"]
3567
+ },
3568
+ { id: "blank", title: "Blank", description: "Start from nothing", persona: "", capabilities: [] }
3569
+ ];
3570
+ var DEFAULT_AGENT_TYPES = [
3571
+ {
3572
+ value: "builtin",
3573
+ title: "Built-in",
3574
+ description: "Runs on ARBI\u2019s servers \u2014 woken by tasks and messages."
3575
+ },
3576
+ {
3577
+ value: "external",
3578
+ title: "External",
3579
+ description: "Connect a Claude or OpenClaw runtime from your machine."
3580
+ }
3581
+ ];
3582
+ function AgentConnectInstructions({ email, signingKey }) {
3583
+ const { notify, runtimeConfig } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
3584
+ const [agentBackend, setAgentBackend] = react.useState("claude");
3585
+ const [copied, setCopied] = react.useState(false);
3586
+ const setupScript = react.useMemo(
3587
+ () => [
3588
+ "npm install -g @arbidocs/cli",
3589
+ `arbi config set-url https://${runtimeConfig.deploymentDomain}`,
3590
+ `arbi login --email ${email} --signing-key ${signingKey}`,
3591
+ `arbi listen --agent ${agentBackend}`
3592
+ ].join("\n"),
3593
+ [email, signingKey, agentBackend, runtimeConfig.deploymentDomain]
3594
+ );
3595
+ const handleCopy = react.useCallback(async () => {
3596
+ try {
3597
+ await navigator.clipboard.writeText(setupScript);
3598
+ setCopied(true);
3599
+ notify("Setup commands copied", "success");
3600
+ setTimeout(() => setCopied(false), 2e3);
3601
+ } catch {
3602
+ notify("Failed to copy", "error");
3603
+ }
3604
+ }, [setupScript, notify]);
3605
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3606
+ "div",
3607
+ {
3608
+ className: "space-y-2 rounded-lg border border-yellow-border bg-yellow-bg/60 p-3",
3609
+ "data-testid": "agent-connect-instructions",
3610
+ children: [
3611
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
3612
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: "Connect it \u2014 run on the agent machine:" }),
3613
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3614
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "agent-backend", className: "text-xs text-muted-foreground", children: "Runtime" }),
3615
+ /* @__PURE__ */ jsxRuntime.jsxs(
3616
+ "select",
3617
+ {
3618
+ id: "agent-backend",
3619
+ value: agentBackend,
3620
+ onChange: (e) => setAgentBackend(e.target.value),
3621
+ className: "h-7 rounded-md border border-input bg-background px-2 text-xs",
3622
+ "data-testid": "agent-backend-select",
3623
+ children: [
3624
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "claude", children: "claude" }),
3625
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "openclaw", children: "openclaw" })
3626
+ ]
3627
+ }
3628
+ )
3629
+ ] })
3630
+ ] }),
3631
+ /* @__PURE__ */ jsxRuntime.jsx(
3632
+ "pre",
3633
+ {
3634
+ className: "select-all whitespace-pre-wrap break-all rounded-md bg-muted p-3 text-xs font-mono leading-relaxed",
3635
+ "data-testid": "agent-setup-script",
3636
+ children: setupScript
3637
+ }
3638
+ ),
3639
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
3640
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "The signing key is shown only once \u2014 copy it now. It cannot be recovered." }),
3641
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "outline", size: "sm", onClick: handleCopy, className: "shrink-0", children: [
3642
+ copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "mr-2 h-4 w-4" }),
3643
+ "Copy"
3644
+ ] })
3645
+ ] })
3646
+ ]
3647
+ }
3648
+ );
3649
+ }
3650
+ function SkillTypeBadge({ type, className }) {
3651
+ return /* @__PURE__ */ jsxRuntime.jsx(
3652
+ "span",
3653
+ {
3654
+ className: ui.cn(
3655
+ "shrink-0 rounded bg-background px-1.5 py-0.5 text-xs uppercase tracking-wide text-muted-foreground",
3656
+ className
3657
+ ),
3658
+ "data-slot": "skill-type-badge",
3659
+ children: type
3660
+ }
3661
+ );
3662
+ }
3663
+ var DEFAULT_SKILL_GLOBAL_BADGE_LABELS = {
3664
+ global: "Global",
3665
+ globalTitle: "Shared with everyone in the marketplace"
3666
+ };
3667
+ function SkillGlobalBadge({
3668
+ className,
3669
+ labels
3670
+ }) {
3671
+ const l = { ...DEFAULT_SKILL_GLOBAL_BADGE_LABELS, ...labels };
3672
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3673
+ "span",
3674
+ {
3675
+ className: ui.cn(
3676
+ "inline-flex shrink-0 items-center gap-1 rounded bg-accent px-1.5 py-0.5 text-xs uppercase tracking-wide text-accent-foreground",
3677
+ className
3678
+ ),
3679
+ title: l.globalTitle,
3680
+ "data-slot": "skill-global-badge",
3681
+ children: [
3682
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "size-3" }),
3683
+ l.global
3684
+ ]
3685
+ }
3686
+ );
3687
+ }
3688
+ function SkillActionButton({
3689
+ label,
3690
+ tooltip,
3691
+ onClick,
3692
+ children,
3693
+ testId
3694
+ }) {
3695
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
3696
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, onFocusCapture: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(
3697
+ ui.Button,
3698
+ {
3699
+ variant: "ghost",
3700
+ size: "icon",
3701
+ className: "size-7 shrink-0 pointer-coarse:size-11",
3702
+ onClick: (e) => {
3703
+ e.stopPropagation();
3704
+ onClick(e);
3705
+ },
3706
+ "aria-label": label,
3707
+ "data-testid": testId,
3708
+ children
3709
+ }
3710
+ ) }),
3711
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: tooltip ?? label }) })
3712
+ ] });
3713
+ }
3714
+ function activateOnKey(handler) {
3715
+ return (e) => {
3716
+ if (e.target !== e.currentTarget) return;
3717
+ if (e.key === "Enter" || e.key === " ") {
3718
+ e.preventDefault();
3719
+ handler();
3720
+ }
3721
+ };
3722
+ }
3723
+ var DEFAULT_SKILL_GENERATE_FORM_LABELS = {
3724
+ title: "Generate with AI",
3725
+ hint: "Describe what the skill should do. The assistant drafts it in chat, then you can edit it here.",
3726
+ placeholder: "e.g. Summarize a contract into key obligations, dates, and parties",
3727
+ generate: "Generate with AI",
3728
+ writeManually: "\u2026or write it manually"
3729
+ };
3730
+ function SkillGenerateForm({
3731
+ onGenerate,
3732
+ onManual,
3733
+ icon,
3734
+ labels,
3735
+ testIds
3736
+ }) {
3737
+ const l = { ...DEFAULT_SKILL_GENERATE_FORM_LABELS, ...labels };
3738
+ const [desc, setDesc] = react.useState("");
3739
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", "data-slot": "skill-generate-form", children: [
3740
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-muted p-4", children: [
3741
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1 flex items-center gap-2", children: [
3742
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wand2, { className: "size-4 text-primary" }),
3743
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: l.title })
3744
+ ] }),
3745
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-3 text-xs text-muted-foreground", children: l.hint }),
3746
+ /* @__PURE__ */ jsxRuntime.jsx(
3747
+ ui.Textarea,
3748
+ {
3749
+ value: desc,
3750
+ onChange: (e) => setDesc(e.target.value),
3751
+ rows: 4,
3752
+ placeholder: l.placeholder,
3753
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.description, { testId: "skills-panel-ai-desc" })
3754
+ }
3755
+ ),
3756
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs(
3757
+ ui.Button,
3758
+ {
3759
+ size: "sm",
3760
+ disabled: !desc.trim(),
3761
+ onClick: () => onGenerate(desc.trim()),
3762
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.generate, { testId: "skills-panel-ai-generate" }),
3763
+ children: [
3764
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 [&>svg]:size-4", children: icon }),
3765
+ l.generate
3766
+ ]
3767
+ }
3768
+ ) })
3769
+ ] }),
3770
+ /* @__PURE__ */ jsxRuntime.jsx(
3771
+ "button",
3772
+ {
3773
+ type: "button",
3774
+ className: "self-start text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline pointer-coarse:min-h-11",
3775
+ onClick: onManual,
3776
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.writeManually, { testId: "skills-panel-write-manually" }),
3777
+ children: l.writeManually
3778
+ }
3779
+ )
3780
+ ] });
3781
+ }
3782
+ var DEFAULT_SKILL_EDIT_FORM_LABELS = {
3783
+ name: "Name",
3784
+ namePlaceholder: "contract-summary",
3785
+ invokedAs: (name) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3786
+ "Invoked as ",
3787
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono", children: [
3788
+ "/",
3789
+ name || "skill-name"
3790
+ ] })
3791
+ ] }),
3792
+ description: "Description",
3793
+ descriptionPlaceholder: "What it does and when to use it",
3794
+ instructions: "Instructions",
3795
+ cancel: "Cancel",
3796
+ saving: "Saving\u2026",
3797
+ saveChanges: "Save changes",
3798
+ create: "Create skill"
3799
+ };
3800
+ var FIELD_LABEL = "text-xs font-semibold uppercase tracking-wide text-muted-foreground";
3801
+ function SkillEditForm({
3802
+ name,
3803
+ onNameChange,
3804
+ isNameLocked,
3805
+ nameError,
3806
+ description,
3807
+ onDescriptionChange,
3808
+ editor,
3809
+ isSaving,
3810
+ isEditing,
3811
+ onSave,
3812
+ onCancel,
3813
+ labels,
3814
+ testIds
3815
+ }) {
3816
+ const l = { ...DEFAULT_SKILL_EDIT_FORM_LABELS, ...labels };
3817
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col", "data-slot": "skill-edit-form", children: [
3818
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4", children: [
3819
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3820
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "sp-name", className: FIELD_LABEL, children: l.name }),
3821
+ /* @__PURE__ */ jsxRuntime.jsx(
3822
+ ui.Input,
3823
+ {
3824
+ id: "sp-name",
3825
+ value: name,
3826
+ disabled: isNameLocked,
3827
+ placeholder: l.namePlaceholder,
3828
+ onChange: (e) => onNameChange(e.target.value),
3829
+ className: "mt-1",
3830
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.name, { testId: "skills-panel-edit-name" })
3831
+ }
3832
+ ),
3833
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: l.invokedAs(name) }),
3834
+ nameError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-destructive", children: nameError })
3835
+ ] }),
3836
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3837
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "sp-desc", className: FIELD_LABEL, children: l.description }),
3838
+ /* @__PURE__ */ jsxRuntime.jsx(
3839
+ ui.Input,
3840
+ {
3841
+ id: "sp-desc",
3842
+ value: description,
3843
+ placeholder: l.descriptionPlaceholder,
3844
+ onChange: (e) => onDescriptionChange(e.target.value),
3845
+ className: "mt-1",
3846
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.description, { testId: "skills-panel-edit-desc" })
3847
+ }
3848
+ )
3849
+ ] }),
3850
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [
3851
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: `${FIELD_LABEL} mb-1`, children: l.instructions }),
3852
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-[240px] flex-1 overflow-hidden rounded-md border border-border", children: editor })
3853
+ ] })
3854
+ ] }),
3855
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end gap-2 border-t border-border px-4 py-3", children: [
3856
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", size: "sm", onClick: onCancel, children: l.cancel }),
3857
+ /* @__PURE__ */ jsxRuntime.jsx(
3858
+ ui.Button,
3859
+ {
3860
+ size: "sm",
3861
+ onClick: onSave,
3862
+ disabled: isSaving,
3863
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.save, { testId: "skills-panel-edit-save" }),
3864
+ children: isSaving ? l.saving : isEditing ? l.saveChanges : l.create
3865
+ }
3866
+ )
3867
+ ] })
3868
+ ] });
3869
+ }
3870
+ function SkillFilterChips({
3871
+ options,
3872
+ value,
3873
+ onChange,
3874
+ label,
3875
+ testIdPrefix = "skills-filter",
3876
+ className
3877
+ }) {
3878
+ return /* @__PURE__ */ jsxRuntime.jsx(
3879
+ "div",
3880
+ {
3881
+ role: "radiogroup",
3882
+ "aria-label": label,
3883
+ className: ui.cn("flex flex-wrap gap-2", className),
3884
+ "data-slot": "skill-filter-chips",
3885
+ children: options.map((option) => {
3886
+ const selected = option.id === value;
3887
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3888
+ "button",
3889
+ {
3890
+ type: "button",
3891
+ role: "radio",
3892
+ "aria-checked": selected,
3893
+ onClick: () => onChange(option.id),
3894
+ "data-testid": `${testIdPrefix}-${option.id}`,
3895
+ className: ui.cn(
3896
+ "inline-flex min-h-8 items-center gap-1.5 rounded-full border px-3 text-sm transition-colors pointer-coarse:min-h-11 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3897
+ selected ? "border-primary bg-primary/10 text-foreground" : "border-border bg-background text-muted-foreground [&:hover]:bg-muted"
3898
+ ),
3899
+ children: [
3900
+ option.label,
3901
+ option.count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: option.count })
3902
+ ]
3903
+ },
3904
+ option.id
3905
+ );
3906
+ })
3907
+ }
3908
+ );
3909
+ }
3910
+ var DEFAULT_SKILL_VIEW_TOGGLE_LABELS = {
3911
+ group: "View",
3912
+ gallery: "Gallery",
3913
+ list: "List"
3914
+ };
3915
+ function SkillViewToggle({ value, onChange, labels, testId }) {
3916
+ const l = { ...DEFAULT_SKILL_VIEW_TOGGLE_LABELS, ...labels };
3917
+ const item = (view, label, icon) => /* @__PURE__ */ jsxRuntime.jsx(
3918
+ "button",
3919
+ {
3920
+ type: "button",
3921
+ role: "radio",
3922
+ "aria-checked": value === view,
3923
+ "aria-label": label,
3924
+ title: label,
3925
+ onClick: () => onChange(view),
3926
+ "data-testid": `${testId ?? "skills-view-toggle"}-${view}`,
3927
+ className: ui.cn(
3928
+ "flex size-8 items-center justify-center rounded-md pointer-coarse:size-11 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3929
+ value === view ? "bg-background text-foreground shadow-sm" : "text-muted-foreground"
3930
+ ),
3931
+ children: icon
3932
+ }
3933
+ );
3934
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3935
+ "div",
3936
+ {
3937
+ role: "radiogroup",
3938
+ "aria-label": l.group,
3939
+ className: "inline-flex shrink-0 gap-0.5 rounded-lg bg-muted p-0.5",
3940
+ "data-testid": testId ?? "skills-view-toggle",
3941
+ children: [
3942
+ item("gallery", l.gallery, /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutGrid, { className: "size-4" })),
3943
+ item("list", l.list, /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "size-4" }))
3944
+ ]
3945
+ }
3946
+ );
3947
+ }
3948
+ function SkillTile({
3949
+ name,
3950
+ description,
3951
+ sourceLabel,
3952
+ type,
3953
+ icon,
3954
+ layout,
3955
+ selected,
3956
+ onSelect,
3957
+ testId
3958
+ }) {
3959
+ const isRow = layout === "list";
3960
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3961
+ "div",
3962
+ {
3963
+ role: "button",
3964
+ tabIndex: 0,
3965
+ "aria-pressed": selected,
3966
+ onClick: onSelect,
3967
+ onKeyDown: activateOnKey(onSelect),
3968
+ "data-testid": testId ?? `skill-tile-${name}`,
3969
+ "data-skill-name": name,
3970
+ "data-slot": "skill-tile",
3971
+ className: ui.cn(
3972
+ "flex cursor-pointer rounded-lg border p-3 text-left transition-colors pointer-coarse:min-h-11 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3973
+ isRow ? "items-center gap-3" : "h-full flex-col gap-2",
3974
+ selected ? "border-primary bg-primary/5" : "border-transparent bg-muted [&:hover]:bg-accent"
3975
+ ),
3976
+ children: [
3977
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
3978
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-ai-ink [&>svg]:size-5", children: icon }),
3979
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-sm font-semibold text-foreground", children: name })
3980
+ ] }),
3981
+ /* @__PURE__ */ jsxRuntime.jsx(
3982
+ "p",
3983
+ {
3984
+ className: ui.cn(
3985
+ "min-w-0 text-sm text-muted-foreground",
3986
+ isRow ? "flex-1 truncate max-sm:hidden" : "line-clamp-3"
3987
+ ),
3988
+ children: description
3989
+ }
3990
+ ),
3991
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex shrink-0 items-center gap-1.5", isRow && "ml-auto"), children: [
3992
+ type && type !== "markdown" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-background px-1.5 py-0.5 text-xs uppercase tracking-wide text-muted-foreground", children: type }),
3993
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-background px-1.5 py-0.5 text-xs text-muted-foreground", children: sourceLabel })
3994
+ ] })
3995
+ ]
3996
+ }
3997
+ );
3998
+ }
3999
+ function SkillDetail({
4000
+ title,
4001
+ sourceLabel,
4002
+ description,
4003
+ icon,
4004
+ notice,
4005
+ children,
4006
+ actions,
4007
+ testId
4008
+ }) {
4009
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4010
+ "section",
4011
+ {
4012
+ className: "flex min-h-0 flex-1 flex-col",
4013
+ "data-testid": testId ?? "skill-detail",
4014
+ "data-slot": "skill-detail",
4015
+ "aria-label": title,
4016
+ children: [
4017
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto p-4", children: [
4018
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "space-y-1", children: [
4019
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
4020
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ai-ink [&>svg]:size-5", children: icon }),
4021
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-foreground", children: title }),
4022
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground", children: sourceLabel })
4023
+ ] }),
4024
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description }),
4025
+ notice && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: notice })
4026
+ ] }),
4027
+ children
4028
+ ] }),
4029
+ actions && /* @__PURE__ */ jsxRuntime.jsx(
4030
+ "div",
4031
+ {
4032
+ className: "flex flex-wrap gap-2 border-t border-border bg-background p-3",
4033
+ "data-slot": "skill-detail-actions",
4034
+ children: actions
4035
+ }
4036
+ )
4037
+ ]
4038
+ }
4039
+ );
4040
+ }
4041
+ function SkillDetailSection({
4042
+ title,
4043
+ children,
4044
+ testId
4045
+ }) {
4046
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", "data-testid": testId, children: [
4047
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: title }),
4048
+ children
4049
+ ] });
4050
+ }
2977
4051
 
2978
4052
  // src/agents/skills/skillFiles.ts
2979
4053
  var SKILL_TYPES = ["markdown", "python", "shell", "javascript", "typescript"];
@@ -3176,6 +4250,201 @@ async function importSkillFromUrl(url) {
3176
4250
  const last = parsed.pathname.split("/").filter(Boolean).pop() ?? "skill";
3177
4251
  return importMarkdownSkill(last.includes(".") ? last : `${last}.md`, text);
3178
4252
  }
4253
+
4254
+ // src/agents/skills/skillLibrary.ts
4255
+ var SKILL_SOURCE_LABELS = {
4256
+ builtin: "Built in",
4257
+ mine: "Yours",
4258
+ shared: "Shared"
4259
+ };
4260
+ var SKILL_TYPE_LABELS = {
4261
+ markdown: "Instructions",
4262
+ python: "Python",
4263
+ shell: "Shell",
4264
+ javascript: "JavaScript",
4265
+ typescript: "TypeScript"
4266
+ };
4267
+ var SKILL_FIELD_TYPE_LABELS = {
4268
+ text: "Short answer",
4269
+ longtext: "Free text",
4270
+ boolean: "Yes or no",
4271
+ select: "A choice",
4272
+ number: "A number",
4273
+ date: "A date",
4274
+ scope: "Which files",
4275
+ documents: "Pick files",
4276
+ person: "A person"
4277
+ };
4278
+ function buildLibrarySkills(builtins, listings) {
4279
+ const { host, skills } = chunkOWCEQKAR_cjs.mergeSkillWorkflows(builtins, listings);
4280
+ const builtinIds = new Set(builtins.map((w) => w.id));
4281
+ const stored = new Map(listings.filter((s) => s.doc_ext_id).map((s) => [s.slug, s]));
4282
+ return [...host, ...skills].flatMap((workflow) => {
4283
+ if (workflow.run.kind !== "prompt") return [];
4284
+ const listing = stored.get(workflow.id);
4285
+ if (!listing?.doc_ext_id) {
4286
+ if (!builtinIds.has(workflow.id)) return [];
4287
+ return [
4288
+ {
4289
+ slug: workflow.id,
4290
+ title: workflow.title,
4291
+ description: workflow.description,
4292
+ source: "builtin",
4293
+ type: "markdown",
4294
+ isShared: false,
4295
+ replacesBuiltin: false,
4296
+ workflow
4297
+ }
4298
+ ];
4299
+ }
4300
+ const mine = listing.is_owner ?? true;
4301
+ return [
4302
+ {
4303
+ slug: workflow.id,
4304
+ title: workflow.title,
4305
+ description: listing.description || workflow.description,
4306
+ source: mine ? "mine" : "shared",
4307
+ type: listing.skill_type ?? "markdown",
4308
+ isShared: mine && listing.visibility === "global",
4309
+ replacesBuiltin: mine && builtinIds.has(listing.slug),
4310
+ workflow,
4311
+ docExtId: listing.doc_ext_id
4312
+ }
4313
+ ];
4314
+ });
4315
+ }
4316
+ function filterLibrarySkills(skills, f) {
4317
+ const q = f.query.trim().toLowerCase();
4318
+ return skills.filter((s) => f.source === "all" || s.source === f.source).filter((s) => f.type === "all" || s.type === f.type).filter(
4319
+ (s) => !q || s.title.toLowerCase().includes(q) || s.slug.toLowerCase().includes(q) || s.description.toLowerCase().includes(q)
4320
+ );
4321
+ }
4322
+ var ACTION = "pointer-coarse:min-h-11";
4323
+ function SkillLibraryDetail({
4324
+ skill,
4325
+ instructions,
4326
+ isLoading,
4327
+ actions,
4328
+ icon
4329
+ }) {
4330
+ const fields = skill.workflow.inputs;
4331
+ const isOwner = skill.source === "mine";
4332
+ const canCopy = skill.source !== "mine";
4333
+ const notice = skill.replacesBuiltin ? "Your copy is used instead of the original; delete it to go back." : skill.isShared ? "Shared with everyone." : void 0;
4334
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4335
+ SkillDetail,
4336
+ {
4337
+ title: skill.title,
4338
+ sourceLabel: SKILL_SOURCE_LABELS[skill.source],
4339
+ description: skill.description,
4340
+ icon,
4341
+ notice,
4342
+ testId: "skill-detail",
4343
+ actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4344
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: actions.onRun, className: ACTION, "data-testid": "skill-run", children: [
4345
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "mr-1.5 size-4" }),
4346
+ "Run"
4347
+ ] }),
4348
+ canCopy && /* @__PURE__ */ jsxRuntime.jsxs(
4349
+ ui.Button,
4350
+ {
4351
+ variant: "outline",
4352
+ onClick: actions.onCopy,
4353
+ disabled: actions.isBusy,
4354
+ className: ACTION,
4355
+ "data-testid": "skill-copy",
4356
+ children: [
4357
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "mr-1.5 size-4" }),
4358
+ "Make a copy"
4359
+ ]
4360
+ }
4361
+ ),
4362
+ isOwner && /* @__PURE__ */ jsxRuntime.jsxs(
4363
+ ui.Button,
4364
+ {
4365
+ variant: "outline",
4366
+ onClick: actions.onEdit,
4367
+ className: ACTION,
4368
+ "data-testid": "skill-edit",
4369
+ children: [
4370
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "mr-1.5 size-4" }),
4371
+ "Edit"
4372
+ ]
4373
+ }
4374
+ ),
4375
+ isOwner && /* @__PURE__ */ jsxRuntime.jsxs(
4376
+ ui.Button,
4377
+ {
4378
+ variant: "outline",
4379
+ onClick: actions.onToggleShare,
4380
+ disabled: actions.isBusy,
4381
+ className: ACTION,
4382
+ "data-testid": "skill-share",
4383
+ children: [
4384
+ skill.isShared ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Lock, { className: "mr-1.5 size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "mr-1.5 size-4" }),
4385
+ skill.isShared ? "Make private" : "Share with everyone"
4386
+ ]
4387
+ }
4388
+ ),
4389
+ /* @__PURE__ */ jsxRuntime.jsxs(
4390
+ ui.Button,
4391
+ {
4392
+ variant: "outline",
4393
+ onClick: actions.onExport,
4394
+ className: ACTION,
4395
+ "data-testid": "skill-export",
4396
+ children: [
4397
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "mr-1.5 size-4" }),
4398
+ "Export"
4399
+ ]
4400
+ }
4401
+ ),
4402
+ isOwner && /* @__PURE__ */ jsxRuntime.jsxs(
4403
+ ui.Button,
4404
+ {
4405
+ variant: "ghost",
4406
+ onClick: actions.onDelete,
4407
+ disabled: actions.isBusy,
4408
+ className: `${ACTION} ml-auto text-destructive`,
4409
+ "data-testid": "skill-delete",
4410
+ children: [
4411
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "mr-1.5 size-4" }),
4412
+ "Delete"
4413
+ ]
4414
+ }
4415
+ )
4416
+ ] }),
4417
+ children: [
4418
+ /* @__PURE__ */ jsxRuntime.jsx(SkillDetailSection, { title: "What it asks you", testId: "skill-inputs", children: fields.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Nothing: it starts right away." }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-1 text-sm", children: fields.map((field) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex flex-wrap items-baseline gap-x-2", children: [
4419
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: field.label }),
4420
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
4421
+ SKILL_FIELD_TYPE_LABELS[field.type],
4422
+ field.required ? "" : ", optional"
4423
+ ] })
4424
+ ] }, field.name)) }) }),
4425
+ /* @__PURE__ */ jsxRuntime.jsxs(
4426
+ SkillDetailSection,
4427
+ {
4428
+ title: skill.type === "markdown" ? "Instructions" : `Instructions (${SKILL_TYPE_LABELS[skill.type] ?? skill.type})`,
4429
+ children: [
4430
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Loading\u2026" }) : /* @__PURE__ */ jsxRuntime.jsx(
4431
+ "pre",
4432
+ {
4433
+ className: "max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs",
4434
+ tabIndex: 0,
4435
+ "aria-label": "Instructions",
4436
+ "data-testid": "skill-instructions",
4437
+ children: instructions || "No instructions."
4438
+ }
4439
+ ),
4440
+ !isOwner && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "You can read these. Make a copy to change them." })
4441
+ ]
4442
+ }
4443
+ )
4444
+ ]
4445
+ }
4446
+ );
4447
+ }
3179
4448
  function PersonPill({ person, size = "sm", testId }) {
3180
4449
  return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": testId, className: "inline-flex min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3181
4450
  ui.UserEntity,
@@ -3747,7 +5016,7 @@ function WorkflowsTable(props) {
3747
5016
  ariaLabel: l.searchLabel,
3748
5017
  testIds: { input: "workflow-search" },
3749
5018
  filter: /* @__PURE__ */ jsxRuntime.jsx(
3750
- chunkRQ2Y7USX_cjs.TriStateFilterMenu,
5019
+ chunkMIDXCYZB_cjs.TriStateFilterMenu,
3751
5020
  {
3752
5021
  testId: "automations-filter-button",
3753
5022
  open: filterOpen,
@@ -3944,12 +5213,12 @@ function taskActivityHeadline(e, labels = DEFAULT_TASK_ACTIVITY_LABELS, agentNam
3944
5213
  case "step_skipped":
3945
5214
  return "Step skipped";
3946
5215
  case "step_waiting": {
3947
- const documents = chunk6F7SZCVL_cjs.eventWaitingDocuments(detail);
3948
- return documents ? chunk6F7SZCVL_cjs.waitingForDocumentsText(documents.length) : "Waiting on people";
5216
+ const documents = chunkOWCEQKAR_cjs.eventWaitingDocuments(detail);
5217
+ return documents ? chunkOWCEQKAR_cjs.waitingForDocumentsText(documents.length) : "Waiting on people";
3949
5218
  }
3950
5219
  case "step_progress": {
3951
- const documents = chunk6F7SZCVL_cjs.eventWaitingDocuments(detail);
3952
- return documents ? chunk6F7SZCVL_cjs.waitingForDocumentsText(documents.length) : detail.signed ? "Signed" : "Step moved on";
5220
+ const documents = chunkOWCEQKAR_cjs.eventWaitingDocuments(detail);
5221
+ return documents ? chunkOWCEQKAR_cjs.waitingForDocumentsText(documents.length) : detail.signed ? "Signed" : "Step moved on";
3953
5222
  }
3954
5223
  case "step_sent_back":
3955
5224
  return "Sent the work back";
@@ -4049,15 +5318,197 @@ function TaskActivityTimeline({
4049
5318
  );
4050
5319
  }) });
4051
5320
  }
5321
+ function TaskActivityDialog({
5322
+ open,
5323
+ onOpenChange,
5324
+ taskName,
5325
+ events,
5326
+ isLoading,
5327
+ isError,
5328
+ labels,
5329
+ testId,
5330
+ ...timeline
5331
+ }) {
5332
+ const l = { ...DEFAULT_TASK_ACTIVITY_LABELS, ...labels };
5333
+ const id = chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "task-activity" });
5334
+ const count = events?.length ?? 0;
5335
+ const scrollToEnd = react.useCallback(
5336
+ (el) => {
5337
+ if (count >= 0) el?.scrollIntoView?.({ block: "end" });
5338
+ },
5339
+ [count]
5340
+ );
5341
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { presentation: "sheet", className: "max-h-[80dvh] sm:max-w-lg", "data-testid": id, children: [
5342
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
5343
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: l.title }),
5344
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { className: "truncate", children: taskName })
5345
+ ] }),
5346
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-[55dvh] overflow-y-auto pr-1", "data-testid": `${id}-scroll`, children: [
5347
+ 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(TaskActivityTimeline, { events: events ?? [], labels, testId: id, ...timeline }),
5348
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: scrollToEnd })
5349
+ ] })
5350
+ ] }) });
5351
+ }
5352
+ var DEFAULT_TASK_RUNS_DIALOG_LABELS = {
5353
+ title: (taskName) => `Run history \u2014 ${taskName}`,
5354
+ description: "Every time this task ran. Open a run to read or watch it in its conversation.",
5355
+ loading: "Loading runs\u2026",
5356
+ empty: "This task hasn\u2019t run yet.",
5357
+ open: "Open"
5358
+ };
5359
+ var STATUS_STYLE = {
5360
+ running: "bg-ai-soft text-ai-ink",
5361
+ success: "bg-green-bg text-green-text",
5362
+ completed: "bg-green-bg text-green-text",
5363
+ failed: "bg-red-bg text-red-text"
5364
+ };
5365
+ function TaskRunsDialog({
5366
+ inline = false,
5367
+ renderErrorReport,
5368
+ hideHeader = false,
5369
+ open,
5370
+ onOpenChange,
5371
+ taskName,
5372
+ runs,
5373
+ isLoading,
5374
+ onOpenRun,
5375
+ onOpenResult,
5376
+ getRunHref,
5377
+ testIds,
5378
+ labels
5379
+ }) {
5380
+ const l = { ...DEFAULT_TASK_RUNS_DIALOG_LABELS, ...labels };
5381
+ const columns = react.useMemo(
5382
+ () => [
5383
+ {
5384
+ colId: "status",
5385
+ field: "status",
5386
+ headerName: "Status",
5387
+ width: 160,
5388
+ minWidth: 140,
5389
+ cellRenderer: ({ data }) => data && /* @__PURE__ */ jsxRuntime.jsx(
5390
+ "span",
5391
+ {
5392
+ className: ui.cn(
5393
+ "rounded-full px-2 py-0.5 text-xs font-medium capitalize",
5394
+ STATUS_STYLE[data.status] ?? "text-muted-foreground"
5395
+ ),
5396
+ children: workflowRunStatusLabel(data.status)
5397
+ }
5398
+ )
5399
+ },
5400
+ { colId: "when", field: "when", headerName: "Run", flex: 2, minWidth: 240 },
5401
+ {
5402
+ colId: "result",
5403
+ headerName: "",
5404
+ width: 280,
5405
+ minWidth: 220,
5406
+ sortable: false,
5407
+ cellRenderer: ({ data: run }) => {
5408
+ if (!run) return null;
5409
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full items-center gap-2", children: [
5410
+ run.error && renderErrorReport?.(run),
5411
+ (run.conversationId || run.resultId && onOpenResult) && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { asChild: true, variant: "ghost", size: "sm", className: "h-7 gap-1.5", children: /* @__PURE__ */ jsxRuntime.jsxs(
5412
+ chunkR26BK7YL_cjs.ActionLink,
5413
+ {
5414
+ href: getRunHref?.(run),
5415
+ onSelect: () => {
5416
+ if (run.conversationId) onOpenRun(run.conversationId);
5417
+ else if (run.resultId) onOpenResult?.(run.resultId);
5418
+ onOpenChange(false);
5419
+ },
5420
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.open, { testId: "task-run-open" }),
5421
+ children: [
5422
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { size: 13 }),
5423
+ " ",
5424
+ l.open
5425
+ ]
5426
+ }
5427
+ ) })
5428
+ ] });
5429
+ }
5430
+ }
5431
+ ],
5432
+ [onOpenRun, onOpenResult, getRunHref, onOpenChange, testIds?.open, l.open, renderErrorReport]
5433
+ );
5434
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5435
+ hideHeader ? null : inline ? /* @__PURE__ */ jsxRuntime.jsx(
5436
+ chunk7RGLTF76_cjs.TabHeader,
5437
+ {
5438
+ tabs: [
5439
+ {
5440
+ id: "history",
5441
+ label: l.title(taskName),
5442
+ count: runs.length,
5443
+ countIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { size: 14 }),
5444
+ presentation: "count",
5445
+ onClose: () => onOpenChange(false)
5446
+ }
5447
+ ],
5448
+ activeTabId: "history",
5449
+ onTabChange: () => {
5450
+ }
5451
+ }
5452
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
5453
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogTitle, { className: "flex items-center gap-2", children: [
5454
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { size: 16 }),
5455
+ " ",
5456
+ l.title(taskName)
5457
+ ] }),
5458
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: l.description })
5459
+ ] }),
5460
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
5461
+ chunkC2CWWEHO_cjs.GridView,
5462
+ {
5463
+ testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.list, { testId: "task-runs-list" }),
5464
+ gridId: "workflow-runs",
5465
+ items: runs,
5466
+ columnDefs: columns,
5467
+ getItemId: (run) => run.id,
5468
+ getRowTestId: () => chunkMHVNT4J3_cjs.testIdOr(testIds?.row, { testId: "task-run-row" }),
5469
+ isLoading,
5470
+ loadingMessage: l.loading,
5471
+ emptyState: { title: l.empty },
5472
+ height: "100%"
5473
+ }
5474
+ ) })
5475
+ ] });
5476
+ return inline ? /* @__PURE__ */ jsxRuntime.jsx("section", { className: "flex min-h-0 flex-1 flex-col", "data-testid": "automation-history", children: content }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsx(
5477
+ ui.DialogContent,
5478
+ {
5479
+ presentation: "sheet",
5480
+ className: "flex h-[min(32rem,calc(100dvh-2rem))] min-h-0 max-w-3xl flex-col",
5481
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.modal, { testId: "task-runs-modal" }),
5482
+ children: content
5483
+ }
5484
+ ) });
5485
+ }
4052
5486
 
4053
5487
  exports.ActionStepBody = ActionStepBody;
5488
+ exports.AgentAvatarField = AgentAvatarField;
5489
+ exports.AgentConnectInstructions = AgentConnectInstructions;
5490
+ exports.AgentCreator = AgentCreator;
4054
5491
  exports.AgentSelect = AgentSelect;
5492
+ exports.AgentTypeSelector = AgentTypeSelector;
4055
5493
  exports.ApprovalEvidence = ApprovalEvidence;
4056
5494
  exports.AssigneeLine = AssigneeLine;
5495
+ exports.CapabilityGrid = CapabilityGrid;
5496
+ exports.CapabilityTile = CapabilityTile;
5497
+ exports.DEFAULT_AGENT_AVATAR_FIELD_LABELS = DEFAULT_AGENT_AVATAR_FIELD_LABELS;
5498
+ exports.DEFAULT_AGENT_CAPABILITIES = DEFAULT_AGENT_CAPABILITIES;
5499
+ exports.DEFAULT_AGENT_CREATOR_LABELS = DEFAULT_AGENT_CREATOR_LABELS;
4057
5500
  exports.DEFAULT_AGENT_SELECT_LABELS = DEFAULT_AGENT_SELECT_LABELS;
5501
+ exports.DEFAULT_AGENT_TEMPLATES = DEFAULT_AGENT_TEMPLATES;
5502
+ exports.DEFAULT_AGENT_TYPES = DEFAULT_AGENT_TYPES;
5503
+ exports.DEFAULT_AGENT_TYPE_SELECTOR_LABELS = DEFAULT_AGENT_TYPE_SELECTOR_LABELS;
4058
5504
  exports.DEFAULT_SCHEMA_FORM_LABELS = DEFAULT_SCHEMA_FORM_LABELS;
5505
+ exports.DEFAULT_SKILL_EDIT_FORM_LABELS = DEFAULT_SKILL_EDIT_FORM_LABELS;
5506
+ exports.DEFAULT_SKILL_GENERATE_FORM_LABELS = DEFAULT_SKILL_GENERATE_FORM_LABELS;
5507
+ exports.DEFAULT_SKILL_GLOBAL_BADGE_LABELS = DEFAULT_SKILL_GLOBAL_BADGE_LABELS;
5508
+ exports.DEFAULT_SKILL_VIEW_TOGGLE_LABELS = DEFAULT_SKILL_VIEW_TOGGLE_LABELS;
4059
5509
  exports.DEFAULT_STEP_BAR_LABELS = DEFAULT_STEP_BAR_LABELS;
4060
5510
  exports.DEFAULT_TASK_ACTIVITY_LABELS = DEFAULT_TASK_ACTIVITY_LABELS;
5511
+ exports.DEFAULT_TASK_RUNS_DIALOG_LABELS = DEFAULT_TASK_RUNS_DIALOG_LABELS;
4061
5512
  exports.DEFAULT_TASK_TRIGGER_CHIP_LABELS = DEFAULT_TASK_TRIGGER_CHIP_LABELS;
4062
5513
  exports.DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS = DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS;
4063
5514
  exports.DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS = DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS;
@@ -4065,15 +5516,31 @@ exports.DEFAULT_WORKFLOW_LIST_LABELS = DEFAULT_WORKFLOW_LIST_LABELS;
4065
5516
  exports.DEFAULT_WORKFLOW_RUNNER_LABELS = DEFAULT_WORKFLOW_RUNNER_LABELS;
4066
5517
  exports.DEFAULT_WORKFLOW_STEP_PARTS_LABELS = DEFAULT_WORKFLOW_STEP_PARTS_LABELS;
4067
5518
  exports.PersonPill = PersonPill;
5519
+ exports.SKILL_FIELD_TYPE_LABELS = SKILL_FIELD_TYPE_LABELS;
4068
5520
  exports.SKILL_MAIN_FILENAME = SKILL_MAIN_FILENAME;
5521
+ exports.SKILL_SOURCE_LABELS = SKILL_SOURCE_LABELS;
4069
5522
  exports.SKILL_TYPES = SKILL_TYPES;
5523
+ exports.SKILL_TYPE_LABELS = SKILL_TYPE_LABELS;
4070
5524
  exports.STEP_LABEL = STEP_LABEL;
4071
5525
  exports.STEP_LABEL_CURRENT = STEP_LABEL_CURRENT;
4072
5526
  exports.STEP_LABEL_MAX = STEP_LABEL_MAX;
4073
5527
  exports.SchemaForm = SchemaForm;
4074
5528
  exports.SendBackControl = SendBackControl;
5529
+ exports.SkillActionButton = SkillActionButton;
5530
+ exports.SkillDetail = SkillDetail;
5531
+ exports.SkillDetailSection = SkillDetailSection;
5532
+ exports.SkillEditForm = SkillEditForm;
5533
+ exports.SkillFilterChips = SkillFilterChips;
5534
+ exports.SkillGenerateForm = SkillGenerateForm;
5535
+ exports.SkillGlobalBadge = SkillGlobalBadge;
5536
+ exports.SkillLibraryDetail = SkillLibraryDetail;
5537
+ exports.SkillTile = SkillTile;
5538
+ exports.SkillTypeBadge = SkillTypeBadge;
5539
+ exports.SkillViewToggle = SkillViewToggle;
4075
5540
  exports.StepBarFrame = StepBarFrame;
5541
+ exports.TaskActivityDialog = TaskActivityDialog;
4076
5542
  exports.TaskActivityTimeline = TaskActivityTimeline;
5543
+ exports.TaskRunsDialog = TaskRunsDialog;
4077
5544
  exports.TaskTriggerChip = TaskTriggerChip;
4078
5545
  exports.WORKFLOW_COLUMN_ORDER = WORKFLOW_COLUMN_ORDER;
4079
5546
  exports.WorkflowConfigDialog = WorkflowConfigDialog;
@@ -4082,11 +5549,18 @@ exports.WorkflowLauncher = WorkflowLauncher;
4082
5549
  exports.WorkflowRunner = WorkflowRunner;
4083
5550
  exports.WorkflowStepBar = WorkflowStepBar;
4084
5551
  exports.WorkflowsTable = WorkflowsTable;
5552
+ exports.activateOnKey = activateOnKey;
4085
5553
  exports.activeStepId = activeStepId;
5554
+ exports.agentConfigSectionToValues = agentConfigSectionToValues;
5555
+ exports.agentCreatorToConfigSection = agentCreatorToConfigSection;
5556
+ exports.buildLibrarySkills = buildLibrarySkills;
4086
5557
  exports.buildWorkflowScopeSource = buildWorkflowScopeSource;
4087
5558
  exports.buildZipSkillImport = buildZipSkillImport;
5559
+ exports.composePersona = composePersona;
4088
5560
  exports.createWorkflowColumns = createWorkflowColumns;
5561
+ exports.deriveAgentName = deriveAgentName;
4089
5562
  exports.documentScopeLabels = documentScopeLabels;
5563
+ exports.filterLibrarySkills = filterLibrarySkills;
4090
5564
  exports.fromPlanAssignee = fromPlanAssignee;
4091
5565
  exports.fromPlanDocumentRef = fromPlanDocumentRef;
4092
5566
  exports.fromPlanSteps = fromPlanSteps;
@@ -4097,6 +5571,7 @@ exports.importSkillFromUrl = importSkillFromUrl;
4097
5571
  exports.isIncompleteSignal = isIncompleteSignal;
4098
5572
  exports.isMainSkillFile = isMainSkillFile;
4099
5573
  exports.isSkillRow = isSkillRow;
5574
+ exports.isValidAgentName = isValidAgentName;
4100
5575
  exports.layoutFromPlanSteps = layoutFromPlanSteps;
4101
5576
  exports.matchWorkflowScope = matchWorkflowScope;
4102
5577
  exports.parseSkillFrontmatter = parseSkillFrontmatter;
@@ -4104,6 +5579,9 @@ exports.readSkillArchive = readSkillArchive;
4104
5579
  exports.serializeSkill = serializeSkill;
4105
5580
  exports.skillSlug = skillSlug;
4106
5581
  exports.stepWindow = stepWindow;
5582
+ exports.stripPersonaPreamble = stripPersonaPreamble;
5583
+ exports.summarizeAgent = summarizeAgent;
5584
+ exports.summarizeCapabilities = summarizeCapabilities;
4107
5585
  exports.taskActivityHeadline = taskActivityHeadline;
4108
5586
  exports.toPlanAssignee = toPlanAssignee;
4109
5587
  exports.toPlanDocumentRef = toPlanDocumentRef;
@@ -4111,9 +5589,8 @@ exports.toPlanSteps = toPlanSteps;
4111
5589
  exports.useControllableState = useControllableState;
4112
5590
  exports.useWorkflowView = useWorkflowView;
4113
5591
  exports.workflowFromSkillMarkdown = workflowFromSkillMarkdown;
4114
- exports.workflowRunStatusLabel = workflowRunStatusLabel;
4115
5592
  exports.workflowStatus = workflowStatus;
4116
5593
  exports.workflowToSkillMarkdown = workflowToSkillMarkdown;
4117
5594
  exports.workflowTriggerType = workflowTriggerType;
4118
- //# sourceMappingURL=chunk-CHVCTKF4.cjs.map
4119
- //# sourceMappingURL=chunk-CHVCTKF4.cjs.map
5595
+ //# sourceMappingURL=chunk-ULEDHANM.cjs.map
5596
+ //# sourceMappingURL=chunk-ULEDHANM.cjs.map