@arbidocs/blocks 0.4.141 → 0.4.143

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/agents/index.cjs +440 -436
  2. package/dist/agents/index.js +12 -8
  3. package/dist/chat/index.cjs +139 -138
  4. package/dist/chat/index.js +4 -3
  5. package/dist/{chunk-S24XEVPS.cjs → chunk-464YPRAE.cjs} +33 -2
  6. package/dist/chunk-464YPRAE.cjs.map +1 -0
  7. package/dist/{chunk-7YLJHTDC.cjs → chunk-5A2QQAF5.cjs} +11 -11
  8. package/dist/{chunk-7YLJHTDC.cjs.map → chunk-5A2QQAF5.cjs.map} +1 -1
  9. package/dist/{chunk-ON3TKY5Y.js → chunk-5YHEHEJT.js} +242 -4
  10. package/dist/chunk-5YHEHEJT.js.map +1 -0
  11. package/dist/chunk-76L6LOP3.cjs +308 -0
  12. package/dist/chunk-76L6LOP3.cjs.map +1 -0
  13. package/dist/chunk-AHDJXIUB.cjs +25 -0
  14. package/dist/chunk-AHDJXIUB.cjs.map +1 -0
  15. package/dist/chunk-AOSUHWIL.js +98 -0
  16. package/dist/chunk-AOSUHWIL.js.map +1 -0
  17. package/dist/{chunk-YFF3GTJQ.js → chunk-C44TDH54.js} +14 -1613
  18. package/dist/chunk-C44TDH54.js.map +1 -0
  19. package/dist/{chunk-GFRQG36Y.cjs → chunk-COCGRJLA.cjs} +213 -57
  20. package/dist/chunk-COCGRJLA.cjs.map +1 -0
  21. package/dist/chunk-CQCC7LE7.js +210 -0
  22. package/dist/chunk-CQCC7LE7.js.map +1 -0
  23. package/dist/{chunk-UGCKUXRV.js → chunk-CSI2B2H5.js} +3 -3
  24. package/dist/{chunk-UGCKUXRV.js.map → chunk-CSI2B2H5.js.map} +1 -1
  25. package/dist/{chunk-R26BK7YL.cjs → chunk-DTROMMDX.cjs} +4 -4
  26. package/dist/{chunk-R26BK7YL.cjs.map → chunk-DTROMMDX.cjs.map} +1 -1
  27. package/dist/{chunk-65THHQVB.cjs → chunk-ECW2R2KF.cjs} +27 -27
  28. package/dist/{chunk-65THHQVB.cjs.map → chunk-ECW2R2KF.cjs.map} +1 -1
  29. package/dist/{chunk-RI6DZA5X.js → chunk-EF4ZLKRM.js} +3 -3
  30. package/dist/{chunk-RI6DZA5X.js.map → chunk-EF4ZLKRM.js.map} +1 -1
  31. package/dist/{chunk-WS5EX7DN.cjs → chunk-EYKISBDO.cjs} +5 -5
  32. package/dist/{chunk-WS5EX7DN.cjs.map → chunk-EYKISBDO.cjs.map} +1 -1
  33. package/dist/chunk-FJETR2AS.js +561 -0
  34. package/dist/chunk-FJETR2AS.js.map +1 -0
  35. package/dist/{chunk-JO3EMZ4X.js → chunk-GWSGIZQ5.js} +3 -3
  36. package/dist/{chunk-JO3EMZ4X.js.map → chunk-GWSGIZQ5.js.map} +1 -1
  37. package/dist/{chunk-O6W6RW3B.js → chunk-H4D7WKDY.js} +207 -54
  38. package/dist/chunk-H4D7WKDY.js.map +1 -0
  39. package/dist/{chunk-OAQEUTNJ.cjs → chunk-HAOKT4LC.cjs} +5 -5
  40. package/dist/{chunk-OAQEUTNJ.cjs.map → chunk-HAOKT4LC.cjs.map} +1 -1
  41. package/dist/{chunk-YWY2KIX2.js → chunk-IJST4EBM.js} +13 -9
  42. package/dist/chunk-IJST4EBM.js.map +1 -0
  43. package/dist/{chunk-3RJN2VTL.js → chunk-IXWJGOM2.js} +3 -3
  44. package/dist/{chunk-3RJN2VTL.js.map → chunk-IXWJGOM2.js.map} +1 -1
  45. package/dist/{chunk-CYNF5PZI.js → chunk-J5CWKFSC.js} +3 -3
  46. package/dist/{chunk-CYNF5PZI.js.map → chunk-J5CWKFSC.js.map} +1 -1
  47. package/dist/{chunk-OWCEQKAR.cjs → chunk-JSTKEZBS.cjs} +21 -318
  48. package/dist/chunk-JSTKEZBS.cjs.map +1 -0
  49. package/dist/{chunk-TP6PLDNM.cjs → chunk-KMZWKSKO.cjs} +8 -8
  50. package/dist/{chunk-TP6PLDNM.cjs.map → chunk-KMZWKSKO.cjs.map} +1 -1
  51. package/dist/{chunk-C4WSHRR6.cjs → chunk-KPZZ5FHE.cjs} +32 -12
  52. package/dist/chunk-KPZZ5FHE.cjs.map +1 -0
  53. package/dist/{chunk-CKCBBYTA.js → chunk-KSHKTOY2.js} +5 -205
  54. package/dist/chunk-KSHKTOY2.js.map +1 -0
  55. package/dist/chunk-LJJJ6CYH.cjs +62 -0
  56. package/dist/chunk-LJJJ6CYH.cjs.map +1 -0
  57. package/dist/chunk-LPYEUD2D.cjs +1627 -0
  58. package/dist/chunk-LPYEUD2D.cjs.map +1 -0
  59. package/dist/chunk-MHFF5N65.cjs +101 -0
  60. package/dist/chunk-MHFF5N65.cjs.map +1 -0
  61. package/dist/{chunk-GYAUJ4KT.js → chunk-MTSKK3BN.js} +32 -3
  62. package/dist/chunk-MTSKK3BN.js.map +1 -0
  63. package/dist/chunk-NHZK64TQ.js +75 -0
  64. package/dist/chunk-NHZK64TQ.js.map +1 -0
  65. package/dist/{chunk-BPBSSMRB.js → chunk-NRFAWUVD.js} +3 -3
  66. package/dist/{chunk-BPBSSMRB.js.map → chunk-NRFAWUVD.js.map} +1 -1
  67. package/dist/chunk-NWNVWO6L.cjs +80 -0
  68. package/dist/chunk-NWNVWO6L.cjs.map +1 -0
  69. package/dist/{chunk-CQ4MFKFC.cjs → chunk-O2GW5IY6.cjs} +90 -86
  70. package/dist/chunk-O2GW5IY6.cjs.map +1 -0
  71. package/dist/{chunk-3BFGL2JL.cjs → chunk-ODRHHWHY.cjs} +4 -4
  72. package/dist/{chunk-3BFGL2JL.cjs.map → chunk-ODRHHWHY.cjs.map} +1 -1
  73. package/dist/{chunk-Y3KA6X7B.js → chunk-OVR3XMYL.js} +4 -4
  74. package/dist/{chunk-Y3KA6X7B.js.map → chunk-OVR3XMYL.js.map} +1 -1
  75. package/dist/{chunk-Y5KTM3V5.js → chunk-PDKM27DF.js} +17 -295
  76. package/dist/chunk-PDKM27DF.js.map +1 -0
  77. package/dist/{chunk-OAL3B2ZU.cjs → chunk-PLJ7PHWU.cjs} +5 -5
  78. package/dist/{chunk-OAL3B2ZU.cjs.map → chunk-PLJ7PHWU.cjs.map} +1 -1
  79. package/dist/{chunk-2UUNSHDI.cjs → chunk-RB7GX2VT.cjs} +59 -1682
  80. package/dist/chunk-RB7GX2VT.cjs.map +1 -0
  81. package/dist/chunk-RFIBUWLF.cjs +232 -0
  82. package/dist/chunk-RFIBUWLF.cjs.map +1 -0
  83. package/dist/chunk-RLWIUUQ5.js +23 -0
  84. package/dist/chunk-RLWIUUQ5.js.map +1 -0
  85. package/dist/{chunk-MIDXCYZB.cjs → chunk-RQ2Y7USX.cjs} +15 -235
  86. package/dist/chunk-RQ2Y7USX.cjs.map +1 -0
  87. package/dist/chunk-SV65E4QW.js +58 -0
  88. package/dist/chunk-SV65E4QW.js.map +1 -0
  89. package/dist/{chunk-LYUO3E6V.js → chunk-SZOFGU7W.js} +3 -3
  90. package/dist/{chunk-LYUO3E6V.js.map → chunk-SZOFGU7W.js.map} +1 -1
  91. package/dist/chunk-T5B7FM7S.js +1602 -0
  92. package/dist/chunk-T5B7FM7S.js.map +1 -0
  93. package/dist/{chunk-YNIBUKV5.js → chunk-TBEVGWY3.js} +32 -14
  94. package/dist/chunk-TBEVGWY3.js.map +1 -0
  95. package/dist/{chunk-MJCCBMM5.cjs → chunk-TC3RQNEX.cjs} +6 -80
  96. package/dist/chunk-TC3RQNEX.cjs.map +1 -0
  97. package/dist/chunk-TZGBRLPK.js +288 -0
  98. package/dist/chunk-TZGBRLPK.js.map +1 -0
  99. package/dist/chunk-U6YVZDOV.cjs +574 -0
  100. package/dist/chunk-U6YVZDOV.cjs.map +1 -0
  101. package/dist/{chunk-QIMVTGKS.cjs → chunk-U73KPFYH.cjs} +255 -2
  102. package/dist/chunk-U73KPFYH.cjs.map +1 -0
  103. package/dist/{chunk-HFGXA5CL.cjs → chunk-UTTTJSQU.cjs} +4 -4
  104. package/dist/{chunk-HFGXA5CL.cjs.map → chunk-UTTTJSQU.cjs.map} +1 -1
  105. package/dist/{chunk-DLBUFHLY.js → chunk-VTTZZ4FN.js} +4 -74
  106. package/dist/chunk-VTTZZ4FN.js.map +1 -0
  107. package/dist/{chunk-5FTIHRZH.cjs → chunk-XVUOMWMD.cjs} +4 -4
  108. package/dist/{chunk-5FTIHRZH.cjs.map → chunk-XVUOMWMD.cjs.map} +1 -1
  109. package/dist/{chunk-3ZYOASAX.js → chunk-Y4ATWQGV.js} +3 -3
  110. package/dist/{chunk-3ZYOASAX.js.map → chunk-Y4ATWQGV.js.map} +1 -1
  111. package/dist/{chunk-444XKG46.js → chunk-YKQ2DPIP.js} +3 -3
  112. package/dist/{chunk-444XKG46.js.map → chunk-YKQ2DPIP.js.map} +1 -1
  113. package/dist/{chunk-HEMU73OP.cjs → chunk-YSHIC4NJ.cjs} +4 -4
  114. package/dist/{chunk-HEMU73OP.cjs.map → chunk-YSHIC4NJ.cjs.map} +1 -1
  115. package/dist/{chunk-5BXEYYH6.js → chunk-ZM26YEOT.js} +3 -3
  116. package/dist/{chunk-5BXEYYH6.js.map → chunk-ZM26YEOT.js.map} +1 -1
  117. package/dist/citations/index.cjs +12 -12
  118. package/dist/citations/index.js +3 -3
  119. package/dist/connect/docx.cjs +36 -7
  120. package/dist/connect/docx.cjs.map +1 -1
  121. package/dist/connect/docx.d.ts +9 -2
  122. package/dist/connect/docx.js +30 -6
  123. package/dist/connect/docx.js.map +1 -1
  124. package/dist/connect/index.cjs +805 -630
  125. package/dist/connect/index.cjs.map +1 -1
  126. package/dist/connect/index.d.ts +2 -0
  127. package/dist/connect/index.js +639 -509
  128. package/dist/connect/index.js.map +1 -1
  129. package/dist/connection/ConnectedSettings.d.ts +3 -2
  130. package/dist/connection/docx/ConnectedNativeDocxComparison.d.ts +5 -0
  131. package/dist/connection/docx/ConnectedNativeDocxEditor.d.ts +16 -0
  132. package/dist/connection/{ConnectedStreamedWordArtifact.d.ts → docx/ConnectedStreamedWordArtifact.d.ts} +1 -1
  133. package/dist/connection/docx/support.d.ts +27 -0
  134. package/dist/connection/docx/useConnectedDocxReferences.d.ts +2 -0
  135. package/dist/connection/docx/useConnectedHouseTemplate.d.ts +2 -0
  136. package/dist/connection/settings-page/ConnectedAccountSettings.d.ts +35 -0
  137. package/dist/connection/settings-page/ConnectedMailSettings.d.ts +13 -0
  138. package/dist/connection/settings-page/ConnectedPremiumModels.d.ts +1 -0
  139. package/dist/connection/settings-page/ConnectedPrivacySettings.d.ts +12 -0
  140. package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +29 -0
  141. package/dist/connection/settings-page/SessionStatusIcon.d.ts +7 -0
  142. package/dist/connection/settings-page/index.d.ts +6 -0
  143. package/dist/docx/index.cjs +17 -63
  144. package/dist/docx/index.cjs.map +1 -1
  145. package/dist/docx/index.d.ts +1 -0
  146. package/dist/docx/index.js +2 -64
  147. package/dist/docx/index.js.map +1 -1
  148. package/dist/docx/template/candidates.d.ts +16 -0
  149. package/dist/facts/index.cjs +4 -4
  150. package/dist/facts/index.js +3 -3
  151. package/dist/files/index.cjs +3 -3
  152. package/dist/files/index.js +2 -2
  153. package/dist/home/index.cjs +20 -20
  154. package/dist/home/index.js +4 -4
  155. package/dist/index.cjs +793 -755
  156. package/dist/index.cjs.map +1 -1
  157. package/dist/index.d.ts +2 -0
  158. package/dist/index.js +25 -19
  159. package/dist/index.js.map +1 -1
  160. package/dist/lib/deep-link.d.ts +46 -0
  161. package/dist/lib/sidebar-mode.d.ts +1 -3
  162. package/dist/lib/use-close-on-escape.d.ts +6 -0
  163. package/dist/provider/BlocksProvider.d.ts +5 -1
  164. package/dist/provider/settings-section.d.ts +9 -0
  165. package/dist/retrieval/index.cjs +4 -4
  166. package/dist/retrieval/index.js +2 -2
  167. package/dist/settings/AppearanceSettings.d.ts +18 -0
  168. package/dist/settings/ServerConnectionControls.d.ts +16 -0
  169. package/dist/settings/SettingsPage.d.ts +31 -0
  170. package/dist/settings/index.cjs +189 -251
  171. package/dist/settings/index.cjs.map +1 -1
  172. package/dist/settings/index.d.ts +3 -1
  173. package/dist/settings/index.js +89 -200
  174. package/dist/settings/index.js.map +1 -1
  175. package/dist/shell/ShellSidebar.d.ts +37 -0
  176. package/dist/shell/Sidebar.d.ts +6 -6
  177. package/dist/shell/index.cjs +63 -50
  178. package/dist/shell/index.d.ts +4 -1
  179. package/dist/shell/index.js +5 -4
  180. package/dist/shell/types.d.ts +18 -0
  181. package/dist/shell/use-sidebar-controller.d.ts +59 -0
  182. package/dist/site/index.cjs +74 -73
  183. package/dist/site/index.js +3 -2
  184. package/dist/studio/index.cjs +80 -78
  185. package/dist/studio/index.cjs.map +1 -1
  186. package/dist/studio/index.js +10 -8
  187. package/dist/studio/index.js.map +1 -1
  188. package/dist/workflow-canvas/index.cjs +64 -60
  189. package/dist/workflow-canvas/index.cjs.map +1 -1
  190. package/dist/workflow-canvas/index.js +12 -8
  191. package/dist/workflow-canvas/index.js.map +1 -1
  192. package/dist/workspaces/index.cjs +3 -3
  193. package/dist/workspaces/index.js +2 -2
  194. package/node_modules/@arbidocs/coedit/package.json +1 -1
  195. package/package.json +4 -4
  196. package/dist/chunk-2UUNSHDI.cjs.map +0 -1
  197. package/dist/chunk-4TR5QCCX.cjs +0 -43
  198. package/dist/chunk-4TR5QCCX.cjs.map +0 -1
  199. package/dist/chunk-7NDW4KF4.cjs +0 -112
  200. package/dist/chunk-7NDW4KF4.cjs.map +0 -1
  201. package/dist/chunk-C4WSHRR6.cjs.map +0 -1
  202. package/dist/chunk-CKCBBYTA.js.map +0 -1
  203. package/dist/chunk-CQ4MFKFC.cjs.map +0 -1
  204. package/dist/chunk-DLBUFHLY.js.map +0 -1
  205. package/dist/chunk-ETXYVO6E.js +0 -109
  206. package/dist/chunk-ETXYVO6E.js.map +0 -1
  207. package/dist/chunk-GFRQG36Y.cjs.map +0 -1
  208. package/dist/chunk-GYAUJ4KT.js.map +0 -1
  209. package/dist/chunk-MCKOZACC.js +0 -41
  210. package/dist/chunk-MCKOZACC.js.map +0 -1
  211. package/dist/chunk-MIDXCYZB.cjs.map +0 -1
  212. package/dist/chunk-MJCCBMM5.cjs.map +0 -1
  213. package/dist/chunk-O6W6RW3B.js.map +0 -1
  214. package/dist/chunk-ON3TKY5Y.js.map +0 -1
  215. package/dist/chunk-OWCEQKAR.cjs.map +0 -1
  216. package/dist/chunk-QIMVTGKS.cjs.map +0 -1
  217. package/dist/chunk-S24XEVPS.cjs.map +0 -1
  218. package/dist/chunk-Y5KTM3V5.js.map +0 -1
  219. package/dist/chunk-YFF3GTJQ.js.map +0 -1
  220. package/dist/chunk-YNIBUKV5.js.map +0 -1
  221. package/dist/chunk-YWY2KIX2.js.map +0 -1
  222. package/dist/connection/ConnectedNativeDocxEditor.d.ts +0 -6
@@ -1,940 +1,23 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkWS5EX7DN_cjs = require('./chunk-WS5EX7DN.cjs');
5
- var chunkMIDXCYZB_cjs = require('./chunk-MIDXCYZB.cjs');
6
- var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
4
+ var chunkLPYEUD2D_cjs = require('./chunk-LPYEUD2D.cjs');
5
+ var chunkEYKISBDO_cjs = require('./chunk-EYKISBDO.cjs');
6
+ var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
7
7
  var chunkDETZZBG2_cjs = require('./chunk-DETZZBG2.cjs');
8
- var chunkR26BK7YL_cjs = require('./chunk-R26BK7YL.cjs');
9
- var chunkV4ISCZJ7_cjs = require('./chunk-V4ISCZJ7.cjs');
10
- var chunk2EI7NCUA_cjs = require('./chunk-2EI7NCUA.cjs');
8
+ var chunkDTROMMDX_cjs = require('./chunk-DTROMMDX.cjs');
11
9
  var chunkC2CWWEHO_cjs = require('./chunk-C2CWWEHO.cjs');
12
- var chunkOWCEQKAR_cjs = require('./chunk-OWCEQKAR.cjs');
13
- var chunk32HW2Q33_cjs = require('./chunk-32HW2Q33.cjs');
14
10
  var chunk7RGLTF76_cjs = require('./chunk-7RGLTF76.cjs');
11
+ var chunkJSTKEZBS_cjs = require('./chunk-JSTKEZBS.cjs');
12
+ var chunk76L6LOP3_cjs = require('./chunk-76L6LOP3.cjs');
15
13
  var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
16
- var chunkC4WSHRR6_cjs = require('./chunk-C4WSHRR6.cjs');
17
- var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
14
+ var chunkKPZZ5FHE_cjs = require('./chunk-KPZZ5FHE.cjs');
18
15
  var react = require('react');
19
16
  var lucideReact = require('lucide-react');
20
17
  var ui = require('@arbidocs/react/ui');
21
18
  var jsxRuntime = require('react/jsx-runtime');
22
19
  var fflate = require('fflate');
23
20
 
24
- var DEFAULT_SCHEMA_FORM_LABELS = {
25
- optional: "(optional)",
26
- advanced: "More options",
27
- errors: {
28
- required: "This is needed to continue",
29
- min: "Too small",
30
- max: "Too large",
31
- number: "Enter a number"
32
- }
33
- };
34
- var TILE_MAX = 4;
35
- function FieldControl({
36
- field,
37
- value,
38
- error,
39
- onChange,
40
- l,
41
- idFor,
42
- renderScope,
43
- renderDocuments,
44
- renderIcon,
45
- onEnterSubmit,
46
- people
47
- }) {
48
- const id = `${idFor()}-control`;
49
- const testId = idFor();
50
- switch (field.type) {
51
- case "text":
52
- return /* @__PURE__ */ jsxRuntime.jsx(
53
- ui.Input,
54
- {
55
- id,
56
- "data-testid": testId,
57
- value: String(value ?? ""),
58
- placeholder: field.placeholder,
59
- "aria-required": field.required || void 0,
60
- "aria-invalid": error ? true : void 0,
61
- "aria-describedby": error ? idFor("error") : void 0,
62
- onChange: (e) => onChange(e.target.value)
63
- }
64
- );
65
- case "longtext":
66
- return /* @__PURE__ */ jsxRuntime.jsx(
67
- ui.Textarea,
68
- {
69
- id,
70
- "data-testid": testId,
71
- value: String(value ?? ""),
72
- placeholder: field.placeholder,
73
- "aria-required": field.required || void 0,
74
- "aria-invalid": error ? true : void 0,
75
- "aria-describedby": error ? idFor("error") : void 0,
76
- className: "min-h-[96px]",
77
- onChange: (e) => onChange(e.target.value),
78
- onKeyDown: (e) => {
79
- if (onEnterSubmit && e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
80
- e.preventDefault();
81
- onEnterSubmit();
82
- }
83
- }
84
- }
85
- );
86
- case "number":
87
- return /* @__PURE__ */ jsxRuntime.jsx(
88
- ui.Input,
89
- {
90
- id,
91
- "data-testid": testId,
92
- type: "number",
93
- inputMode: "decimal",
94
- min: field.min,
95
- max: field.max,
96
- value: value === void 0 ? "" : String(value),
97
- placeholder: field.placeholder,
98
- "aria-invalid": error ? true : void 0,
99
- "aria-describedby": error ? idFor("error") : void 0,
100
- onChange: (e) => onChange(e.target.value === "" ? "" : Number(e.target.value))
101
- }
102
- );
103
- case "date":
104
- return /* @__PURE__ */ jsxRuntime.jsx(
105
- ui.Input,
106
- {
107
- id,
108
- "data-testid": testId,
109
- type: "date",
110
- value: String(value ?? ""),
111
- "aria-invalid": error ? true : void 0,
112
- "aria-describedby": error ? idFor("error") : void 0,
113
- onChange: (e) => onChange(e.target.value)
114
- }
115
- );
116
- case "boolean":
117
- return /* @__PURE__ */ jsxRuntime.jsx(
118
- ui.Switch,
119
- {
120
- id,
121
- "data-testid": testId,
122
- checked: Boolean(value),
123
- onCheckedChange: (checked) => onChange(checked)
124
- }
125
- );
126
- case "select": {
127
- const options = field.options ?? [];
128
- if (options.length > 0 && options.length <= TILE_MAX) {
129
- const compact2 = options.every((o) => !o.icon && !o.description);
130
- return /* @__PURE__ */ jsxRuntime.jsx(
131
- "div",
132
- {
133
- role: "radiogroup",
134
- "aria-label": field.label,
135
- className: "flex flex-wrap gap-2",
136
- "data-testid": testId,
137
- children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
138
- ChoiceTile,
139
- {
140
- option,
141
- selected: value === option.value,
142
- compact: compact2,
143
- renderIcon,
144
- testId: chunkMHVNT4J3_cjs.prefixedTestId(testId, option.value, {
145
- testId: `workflow-field-${field.name}-${option.value}`
146
- }),
147
- onSelect: () => onChange(option.value)
148
- },
149
- option.value
150
- ))
151
- }
152
- );
153
- }
154
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { value: String(value ?? ""), onValueChange: (v) => onChange(v), children: [
155
- /* @__PURE__ */ jsxRuntime.jsx(ui.SelectTrigger, { id, "data-testid": testId, className: "pointer-coarse:min-h-11", children: /* @__PURE__ */ jsxRuntime.jsx(ui.SelectValue, { placeholder: field.placeholder }) }),
156
- /* @__PURE__ */ jsxRuntime.jsx(ui.SelectContent, { children: options.map((o) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: o.value, children: o.label }, o.value)) })
157
- ] });
158
- }
159
- case "scope": {
160
- const scope = chunkOWCEQKAR_cjs.isWorkflowScope(value) ? value : { folders: [], labels: [] };
161
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": testId, children: renderScope?.(field, scope, onChange) });
162
- }
163
- case "documents": {
164
- const picked = chunkOWCEQKAR_cjs.isWorkflowScope(value) ? value : { folders: [], labels: [], documents: [] };
165
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": testId, children: renderDocuments?.(field, picked, onChange) });
166
- }
167
- case "person":
168
- return people?.length ? /* @__PURE__ */ jsxRuntime.jsxs(
169
- "select",
170
- {
171
- id,
172
- "data-testid": testId,
173
- value: String(value ?? ""),
174
- "aria-required": field.required || void 0,
175
- "aria-invalid": error ? true : void 0,
176
- onChange: (e) => onChange(e.target.value),
177
- className: "flex h-9 w-full rounded-md border border-input bg-background px-2 text-sm shadow-sm",
178
- children: [
179
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: field.placeholder ?? "" }),
180
- people.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.value, children: p.label }, p.value))
181
- ]
182
- }
183
- ) : /* @__PURE__ */ jsxRuntime.jsx(
184
- ui.Input,
185
- {
186
- id,
187
- "data-testid": testId,
188
- value: String(value ?? ""),
189
- placeholder: field.placeholder ?? "usr-\u2026",
190
- "aria-required": field.required || void 0,
191
- "aria-invalid": error ? true : void 0,
192
- onChange: (e) => onChange(e.target.value)
193
- }
194
- );
195
- }
196
- }
197
- function ChoiceTile({
198
- option,
199
- selected,
200
- compact: compact2,
201
- renderIcon,
202
- testId,
203
- onSelect
204
- }) {
205
- const tone = option.tone;
206
- return /* @__PURE__ */ jsxRuntime.jsxs(
207
- "button",
208
- {
209
- type: "button",
210
- role: "radio",
211
- "aria-checked": selected,
212
- "data-testid": testId,
213
- "data-tone": tone,
214
- onClick: onSelect,
215
- className: ui.cn(
216
- // Sized to its label (flex-basis auto), growing to share the row, never wider than it.
217
- "flex max-w-full min-w-[min(4rem,100%)] flex-auto flex-col items-center justify-center gap-1.5 rounded-lg border text-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
218
- compact2 ? "min-h-9 px-3 py-1.5 pointer-coarse:min-h-11" : "min-h-24 p-3 pointer-coarse:min-h-28",
219
- tone ? selected ? ui.cn(chunk32HW2Q33_cjs.TONE_SURFACE[tone], chunk32HW2Q33_cjs.TONE_SOLID_BORDER[tone]) : ui.cn(chunk32HW2Q33_cjs.TONE_BORDER[tone], "bg-card [&:hover]:bg-muted") : selected ? "border-primary bg-primary/10" : "border-border bg-card [&:hover]:border-primary [&:hover]:bg-muted"
220
- ),
221
- children: [
222
- option.icon && renderIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: renderIcon(option.icon) }),
223
- /* @__PURE__ */ jsxRuntime.jsxs(
224
- "span",
225
- {
226
- className: ui.cn(
227
- "flex max-w-full items-center gap-1.5 text-sm font-medium",
228
- tone && selected ? void 0 : "text-foreground"
229
- ),
230
- children: [
231
- selected ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 shrink-0", "aria-hidden": true }) : tone && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: ui.cn("size-2 shrink-0 rounded-full", chunk32HW2Q33_cjs.TONE_DOT[tone]) }),
232
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 break-words", children: option.label })
233
- ]
234
- }
235
- ),
236
- option.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-full text-xs break-words text-muted-foreground", children: option.description })
237
- ]
238
- }
239
- );
240
- }
241
- function FormField(props) {
242
- const { field, error, l, idFor } = props;
243
- const isBoolean = field.type === "boolean";
244
- const showOptional = !field.required && field.type !== "boolean" && field.type !== "scope";
245
- const label = /* @__PURE__ */ jsxRuntime.jsxs(
246
- ui.Label,
247
- {
248
- htmlFor: `${idFor()}-control`,
249
- className: isBoolean ? "cursor-pointer font-normal" : void 0,
250
- children: [
251
- field.label,
252
- showOptional && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
253
- " ",
254
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-normal text-muted-foreground", children: l.optional })
255
- ] })
256
- ]
257
- }
258
- );
259
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", "data-slot": "schema-field", "data-field": field.name, children: [
260
- isBoolean ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5 pointer-coarse:min-h-11", children: [
261
- /* @__PURE__ */ jsxRuntime.jsx(FieldControl, { ...props }),
262
- label
263
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
264
- field.type !== "scope" && label,
265
- /* @__PURE__ */ jsxRuntime.jsx(FieldControl, { ...props })
266
- ] }),
267
- field.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: field.description }),
268
- error && /* @__PURE__ */ jsxRuntime.jsx(
269
- "p",
270
- {
271
- id: idFor("error"),
272
- role: "alert",
273
- className: "text-xs text-destructive",
274
- "data-testid": idFor("error"),
275
- children: l.errors[error]
276
- }
277
- )
278
- ] });
279
- }
280
- function SchemaForm({
281
- fields,
282
- values,
283
- onChange,
284
- errors,
285
- renderScope,
286
- renderDocuments,
287
- renderIcon,
288
- onEnterSubmit,
289
- people,
290
- testIdPrefix,
291
- labels,
292
- className
293
- }) {
294
- const l = {
295
- ...DEFAULT_SCHEMA_FORM_LABELS,
296
- ...labels,
297
- errors: { ...DEFAULT_SCHEMA_FORM_LABELS.errors, ...labels?.errors }
298
- };
299
- const [advancedOpen, setAdvancedOpen] = react.useState(false);
300
- const common = fields.filter((f) => !f.advanced);
301
- const advanced = fields.filter((f) => f.advanced);
302
- const render = (field) => /* @__PURE__ */ jsxRuntime.jsx(
303
- FormField,
304
- {
305
- field,
306
- value: values[field.name],
307
- error: errors?.[field.name],
308
- onChange: (v) => onChange(field.name, v),
309
- l,
310
- idFor: (suffix) => suffix ? `${chunkMHVNT4J3_cjs.testIdOr(testIdPrefix, { testId: "workflow-field" })}-${field.name}-${suffix}` : `${chunkMHVNT4J3_cjs.testIdOr(testIdPrefix, { testId: "workflow-field" })}-${field.name}`,
311
- renderScope,
312
- renderDocuments,
313
- renderIcon,
314
- onEnterSubmit,
315
- people
316
- },
317
- field.name
318
- );
319
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex flex-col gap-4", className), "data-slot": "schema-form", children: [
320
- common.map(render),
321
- advanced.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
322
- chunkWS5EX7DN_cjs.FoldSection,
323
- {
324
- label: l.advanced,
325
- open: advancedOpen,
326
- onOpenChange: setAdvancedOpen,
327
- testId: `${chunkMHVNT4J3_cjs.testIdOr(testIdPrefix, { testId: "workflow-field" })}-advanced-toggle`,
328
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4", children: advanced.map(render) })
329
- }
330
- )
331
- ] });
332
- }
333
- function useControllableState(value, defaultValue, onChange) {
334
- const [inner, setInner] = react.useState(defaultValue);
335
- const isControlled = value !== void 0;
336
- const current = isControlled ? value : inner;
337
- const onChangeRef = react.useRef(onChange);
338
- onChangeRef.current = onChange;
339
- const set = react.useCallback(
340
- (next) => {
341
- if (!isControlled) setInner(next);
342
- onChangeRef.current?.(next);
343
- },
344
- [isControlled]
345
- );
346
- return [current, set];
347
- }
348
- var DEFAULT_AGENT_SELECT_LABELS = {
349
- label: "Run as",
350
- myAssistant: "My assistant"
351
- };
352
- var ME = "__me__";
353
- function AgentSelect({
354
- agents,
355
- value,
356
- defaultValue = "",
357
- onValueChange,
358
- hideLabel,
359
- disabled,
360
- className,
361
- labels,
362
- testId,
363
- optionTestId
364
- }) {
365
- const l = { ...DEFAULT_AGENT_SELECT_LABELS, ...labels };
366
- const triggerId = react.useId();
367
- const [current, setCurrent] = useControllableState(value, defaultValue, onValueChange);
368
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex flex-col gap-1.5", className), "data-slot": "agent-select", children: [
369
- /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: triggerId, className: hideLabel ? "sr-only" : void 0, children: l.label }),
370
- /* @__PURE__ */ jsxRuntime.jsxs(
371
- ui.Select,
372
- {
373
- value: current === "" ? ME : current,
374
- onValueChange: (v) => setCurrent(v === ME ? "" : v),
375
- disabled,
376
- children: [
377
- /* @__PURE__ */ jsxRuntime.jsx(
378
- ui.SelectTrigger,
379
- {
380
- id: triggerId,
381
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "agent-select" }),
382
- className: "pointer-coarse:min-h-11",
383
- children: /* @__PURE__ */ jsxRuntime.jsx(ui.SelectValue, {})
384
- }
385
- ),
386
- /* @__PURE__ */ jsxRuntime.jsxs(ui.SelectContent, { children: [
387
- /* @__PURE__ */ jsxRuntime.jsx(
388
- ui.SelectItem,
389
- {
390
- value: ME,
391
- "data-testid": chunkMHVNT4J3_cjs.prefixedTestId(optionTestId, "me", {
392
- testId: "agent-select-option-me"
393
- }),
394
- children: l.myAssistant
395
- }
396
- ),
397
- agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(
398
- ui.SelectItem,
399
- {
400
- value: agent.id,
401
- "data-testid": chunkMHVNT4J3_cjs.prefixedTestId(optionTestId, agent.id, {
402
- testId: `agent-select-option-${agent.id}`
403
- }),
404
- children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
405
- agent.avatar,
406
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: agent.label }),
407
- agent.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: agent.description })
408
- ] })
409
- },
410
- agent.id
411
- ))
412
- ] })
413
- ]
414
- }
415
- )
416
- ] });
417
- }
418
- var DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS = {
419
- start: "Start",
420
- starting: "Starting\u2026",
421
- addFilesReason: "This reads your files, and there is nothing to read yet.",
422
- agentLabel: "Run as"
423
- };
424
- function WorkflowConfigDialog({
425
- workflow,
426
- open,
427
- onOpenChange,
428
- onLaunch,
429
- initialInputs,
430
- inputs: inputsProp,
431
- onInputsChange,
432
- scopeSource,
433
- renderScope,
434
- renderDocuments,
435
- renderIcon,
436
- addFilesAction,
437
- agents,
438
- agentId: agentIdProp,
439
- onAgentChange,
440
- isLaunching,
441
- submitLabel,
442
- fieldPlaceholder,
443
- renderNotice,
444
- labels,
445
- formLabels,
446
- agentLabels,
447
- testId,
448
- startTestId,
449
- className
450
- }) {
451
- const l = { ...DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, ...labels };
452
- const initialKey = JSON.stringify(initialInputs ?? {});
453
- const seedKey = JSON.stringify({ ...chunkOWCEQKAR_cjs.defaultInputs(workflow), ...JSON.parse(initialKey) });
454
- const seed = react.useMemo(() => JSON.parse(seedKey), [seedKey]);
455
- const [inputs, setInputs] = useControllableState(inputsProp, seed, onInputsChange);
456
- const [agentId, setAgentId] = useControllableState(
457
- agentIdProp,
458
- workflow.defaultAgentId ?? "",
459
- onAgentChange
460
- );
461
- react.useEffect(() => {
462
- if (open && inputsProp === void 0) setInputs(seed);
463
- }, [open, seed]);
464
- const setField = (name, value) => setInputs({ ...inputs, [name]: value });
465
- const errors = chunkOWCEQKAR_cjs.validateInputs(workflow, inputs);
466
- const valid = Object.keys(errors).length === 0;
467
- const visibleErrors = Object.fromEntries(
468
- Object.entries(errors).filter(([, e]) => e !== "required")
469
- );
470
- const scopeField = workflow.inputs.find((f) => f.type === "scope");
471
- const rawScope = scopeField ? inputs[scopeField.name] : void 0;
472
- const scopeValue = rawScope && typeof rawScope === "object" ? rawScope : { folders: [], labels: [] };
473
- const matchedCount = scopeSource && scopeField ? scopeSource.countMatching(scopeValue) : null;
474
- const noFiles = Boolean(workflow.requiresFiles && scopeSource && scopeSource.totalCount === 0);
475
- const blockedByScope = matchedCount !== null && matchedCount === 0 && Boolean(workflow.requiresFiles);
476
- const showAgent = workflow.run.kind === "prompt" && workflow.options?.agent !== false && agents !== void 0 && agents.length > 0;
477
- const launch = (values) => {
478
- Promise.resolve(onLaunch(chunkOWCEQKAR_cjs.buildLaunch(workflow, values, agentId))).catch(() => {
479
- });
480
- };
481
- const submit = () => {
482
- if (!valid || noFiles || blockedByScope || isLaunching) return;
483
- launch(inputs);
484
- };
485
- const fields = react.useMemo(
486
- () => workflow.inputs.map((f) => {
487
- const placeholder = fieldPlaceholder?.(f, inputs, workflow);
488
- return placeholder === void 0 ? f : { ...f, placeholder };
489
- }),
490
- [workflow, fieldPlaceholder, inputs]
491
- );
492
- const id = chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "workflow-dialog" });
493
- const formRef = react.useRef(null);
494
- const firstField = workflow.inputs.find((f) => !f.advanced);
495
- const focusPromptFirst = firstField?.type === "text" || firstField?.type === "longtext";
496
- const defaultScopeRender = scopeSource ? (_field, value, onChange) => /* @__PURE__ */ jsxRuntime.jsx(
497
- chunkWS5EX7DN_cjs.ScopePicker,
498
- {
499
- folders: scopeSource.folders,
500
- unfiledCount: scopeSource.unfiledCount,
501
- labels: scopeSource.labels,
502
- totalCount: scopeSource.totalCount,
503
- matchedCount: scopeSource.countMatching(value),
504
- scope: value,
505
- onScopeChange: onChange
506
- }
507
- ) : void 0;
508
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
509
- ui.DialogContent,
510
- {
511
- presentation: "sheet",
512
- className: `max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-xl ${className ?? ""}`,
513
- "data-testid": id,
514
- "data-workflow": workflow.id,
515
- onOpenAutoFocus: (event) => {
516
- if (!focusPromptFirst || !firstField) return;
517
- const control = formRef.current?.querySelector(
518
- `[data-testid="${id}-field-${firstField.name}"]`
519
- );
520
- if (!control) return;
521
- event.preventDefault();
522
- control.focus();
523
- if (control instanceof HTMLInputElement || control instanceof HTMLTextAreaElement) {
524
- const end = control.value.length;
525
- control.setSelectionRange(end, end);
526
- }
527
- },
528
- children: [
529
- /* @__PURE__ */ jsxRuntime.jsx(
530
- chunkWS5EX7DN_cjs.QuickActionDialogHeader,
531
- {
532
- icon: workflow.icon && renderIcon ? renderIcon(workflow.icon) : null,
533
- title: workflow.title,
534
- description: workflow.details ?? workflow.description,
535
- descriptionTestId: `${id}-description`
536
- }
537
- ),
538
- /* @__PURE__ */ jsxRuntime.jsx(
539
- "form",
540
- {
541
- ref: formRef,
542
- className: "mt-2 flex flex-col gap-4",
543
- onSubmit: (event) => {
544
- event.preventDefault();
545
- submit();
546
- },
547
- children: noFiles ? /* @__PURE__ */ jsxRuntime.jsx(
548
- chunkWS5EX7DN_cjs.AddFilesFirst,
549
- {
550
- reason: l.addFilesReason,
551
- action: addFilesAction,
552
- testId: `${id}-empty-state`
553
- }
554
- ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
555
- /* @__PURE__ */ jsxRuntime.jsx(
556
- SchemaForm,
557
- {
558
- fields,
559
- values: inputs,
560
- onChange: setField,
561
- errors: visibleErrors,
562
- renderScope: renderScope ?? defaultScopeRender,
563
- renderDocuments,
564
- renderIcon,
565
- labels: formLabels,
566
- onEnterSubmit: submit,
567
- testIdPrefix: `${id}-field`
568
- }
569
- ),
570
- renderNotice?.({ workflow, inputs }),
571
- /* @__PURE__ */ jsxRuntime.jsxs(
572
- "div",
573
- {
574
- className: "flex flex-col gap-3 border-t border-border pt-3 sm:flex-row sm:items-end sm:justify-between",
575
- "data-slot": "workflow-footer",
576
- children: [
577
- showAgent ? /* @__PURE__ */ jsxRuntime.jsx(
578
- AgentSelect,
579
- {
580
- agents: agents ?? [],
581
- value: agentId,
582
- onValueChange: setAgentId,
583
- labels: { label: l.agentLabel, ...agentLabels },
584
- testId: `${id}-agent`,
585
- className: "sm:w-56"
586
- }
587
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
588
- /* @__PURE__ */ jsxRuntime.jsxs(
589
- ui.Button,
590
- {
591
- type: "submit",
592
- className: "gap-1.5 px-5 pointer-coarse:min-h-11",
593
- disabled: !valid || blockedByScope || isLaunching,
594
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(startTestId, { testId: "workflow-start-button" }),
595
- children: [
596
- isLaunching ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-4" }),
597
- isLaunching ? l.starting : submitLabel?.({ workflow, inputs, matchedCount }) ?? workflow.startLabel ?? l.start
598
- ]
599
- }
600
- )
601
- ]
602
- }
603
- )
604
- ] })
605
- }
606
- )
607
- ]
608
- }
609
- ) });
610
- }
611
- function WorkflowLauncher({
612
- workflows,
613
- tileWorkflows,
614
- onLaunch,
615
- showTiles = true,
616
- caption,
617
- captionTestId,
618
- tileTestId,
619
- disabledReason,
620
- activeId: activeIdProp,
621
- onActiveIdChange,
622
- initialInputsFor,
623
- testId,
624
- extraTiles = [],
625
- className,
626
- children,
627
- renderIcon,
628
- ...dialog
629
- }) {
630
- const [activeId, setActiveId] = useControllableState(
631
- activeIdProp,
632
- null,
633
- onActiveIdChange
634
- );
635
- const [isLaunching, setIsLaunching] = react.useState(false);
636
- const active = workflows.find((w) => w.id === activeId) ?? null;
637
- const run = async (launch) => {
638
- setIsLaunching(true);
639
- try {
640
- await onLaunch(launch);
641
- setActiveId(null);
642
- } finally {
643
- setIsLaunching(false);
644
- }
645
- };
646
- const select = (workflow) => {
647
- if (workflow.run.kind === "operation" && workflow.inputs.length === 0) {
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(() => {
651
- });
652
- return;
653
- }
654
- }
655
- setActiveId(workflow.id);
656
- };
657
- const tiles = (tileWorkflows ?? workflows).map((workflow) => {
658
- const reason = disabledReason?.(workflow);
659
- return {
660
- id: workflow.id,
661
- iconNode: workflow.icon && renderIcon ? renderIcon(workflow.icon) : void 0,
662
- title: workflow.title,
663
- description: workflow.description,
664
- onSelect: () => select(workflow),
665
- disabled: reason !== void 0,
666
- disabledReason: reason,
667
- testId: tileTestId?.(workflow) ?? `workflow-tile-${workflow.id}`
668
- };
669
- });
670
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-slot": "workflow-launcher", children: [
671
- showTiles && /* @__PURE__ */ jsxRuntime.jsx(
672
- chunkWS5EX7DN_cjs.StartTiles,
673
- {
674
- items: [...tiles, ...extraTiles],
675
- caption,
676
- captionTestId,
677
- testId
678
- }
679
- ),
680
- children,
681
- active && /* @__PURE__ */ jsxRuntime.jsx(
682
- WorkflowConfigDialog,
683
- {
684
- ...dialog,
685
- renderIcon,
686
- workflow: active,
687
- open: true,
688
- onOpenChange: (open) => !open && setActiveId(null),
689
- onLaunch: run,
690
- isLaunching,
691
- initialInputs: initialInputsFor?.(active)
692
- }
693
- )
694
- ] });
695
- }
696
- function documentScopeLabels(tags) {
697
- return tags.filter((tag) => {
698
- if (tag.kind === "search") return false;
699
- const onDocs = (tag.doctag_count ?? 0) > 0;
700
- const onFacts = (tag.facttag_count ?? 0) > 0;
701
- return onDocs || !onFacts;
702
- });
703
- }
704
- var canonical = (path) => (path ?? "").split("/").map((part) => part.trim()).filter(Boolean).join("/");
705
- function matchWorkflowScope(docs, scope) {
706
- if (scope.documents?.length) {
707
- const ids = new Set(scope.documents);
708
- return docs.filter((doc) => ids.has(doc.external_id));
709
- }
710
- if (!scope.folders.length && !scope.labels.length) return docs;
711
- const folders = scope.folders.map(canonical);
712
- const labels = new Set(scope.labels);
713
- return docs.filter((doc) => {
714
- const folder = canonical(doc.folder);
715
- return folders.some(
716
- (path) => path === "" ? folder === "" : folder === path || folder.startsWith(`${path}/`)
717
- ) || doc.doctags?.some((tag) => labels.has(tag.tag_ext_id));
718
- });
719
- }
720
- function buildWorkflowScopeSource(docs, labels = []) {
721
- const counts = /* @__PURE__ */ new Map();
722
- for (const doc of docs) {
723
- const parts = canonical(doc.folder).split("/").filter(Boolean);
724
- for (let i = 1; i <= parts.length; i++) {
725
- const path = parts.slice(0, i).join("/");
726
- counts.set(path, (counts.get(path) ?? 0) + 1);
727
- }
728
- }
729
- return {
730
- folders: [...counts].sort(([a], [b]) => a.localeCompare(b)).map(([path, count]) => ({
731
- path,
732
- count,
733
- label: path.split("/").at(-1),
734
- depth: path.split("/").length - 1
735
- })),
736
- unfiledCount: docs.filter((doc) => !canonical(doc.folder)).length,
737
- labels: labels.map((label) => ({
738
- id: label.external_id,
739
- name: label.name,
740
- color: label.color ?? ui.getEntityColor(label.external_id, "medium"),
741
- count: docs.filter((doc) => doc.doctags?.some((tag) => tag.tag_ext_id === label.external_id)).length
742
- })),
743
- totalCount: docs.length,
744
- countMatching: (scope) => matchWorkflowScope(docs, scope).length,
745
- resolveDocuments: (scope) => matchWorkflowScope(docs, scope).map((doc) => doc.external_id)
746
- };
747
- }
748
- var DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS = {
749
- pickOne: "Pick a file",
750
- pickMany: "Pick files",
751
- allDocuments: "All documents",
752
- addFiles: "Add files",
753
- adding: "Adding\u2026",
754
- empty: "No files in this workspace yet. Drop one here, or add it.",
755
- remove: (name) => `Remove ${name}`,
756
- pending: (name, status) => `${name}: ${status}. You can still pick it.`,
757
- status: {
758
- queued: "Queued",
759
- uploading: "Uploading",
760
- encrypting: "Encrypting",
761
- processing: "Processing",
762
- parsing: "Processing",
763
- indexing: "Indexing",
764
- analysing: "Analysing"
765
- }
766
- };
767
- var isReady = (status) => !status || ["completed", "done", "ready", "success"].includes(status.toLowerCase());
768
- var byTitle = (a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase());
769
- function WorkflowDocumentsField({
770
- field,
771
- value,
772
- onChange,
773
- documents,
774
- loaded = true,
775
- thumbnailOf,
776
- onAddFiles,
777
- adding,
778
- labels
779
- }) {
780
- const l = { ...DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS, ...labels };
781
- const ids = value.documents ?? [];
782
- const max = field.max ?? 1;
783
- const multiple = max > 1;
784
- const [isOver, setIsOver] = react.useState(false);
785
- const docOf = (id) => documents.find((d) => d.id === id);
786
- const nameOf = (id) => docOf(id)?.title || id;
787
- const set = (next) => onChange({ ...value, documents: next });
788
- const toggle = (id) => set(ids.includes(id) ? ids.filter((d) => d !== id) : [...ids, id].slice(-max));
789
- const offered = react.useMemo(
790
- () => field.accept === "image" ? documents.filter((d) => d.isImage) : documents,
791
- [documents, field.accept]
792
- );
793
- const awaitingAdd = react.useRef(false);
794
- const known = react.useRef(null);
795
- const latest = react.useRef({ ids, set });
796
- latest.current = { ids, set };
797
- react.useEffect(() => {
798
- if (!loaded) return;
799
- const current = new Set(documents.map((d) => d.id));
800
- const before = known.current;
801
- known.current = current;
802
- if (!before || !awaitingAdd.current) return;
803
- const fresh = [...current].filter((id) => !before.has(id));
804
- if (fresh.length === 0) return;
805
- awaitingAdd.current = false;
806
- latest.current.set([...latest.current.ids, ...fresh].slice(-max));
807
- }, [documents, loaded, max]);
808
- const addFiles = (files) => {
809
- if (!onAddFiles) return;
810
- awaitingAdd.current = true;
811
- onAddFiles(files?.length ? files : void 0);
812
- };
813
- const dropProps = onAddFiles ? {
814
- onDragOver: (e) => {
815
- e.preventDefault();
816
- setIsOver(true);
817
- },
818
- onDragLeave: () => setIsOver(false),
819
- onDrop: (e) => {
820
- e.preventDefault();
821
- setIsOver(false);
822
- const files = Array.from(e.dataTransfer?.files ?? []);
823
- if (files.length) addFiles(files);
824
- }
825
- } : {};
826
- const dropClass = isOver ? "ring-2 ring-primary" : "";
827
- const addButton = (className, variant = "outline") => onAddFiles && /* @__PURE__ */ jsxRuntime.jsx(
828
- ui.Button,
829
- {
830
- type: "button",
831
- size: "sm",
832
- variant,
833
- className,
834
- disabled: adding,
835
- onClick: () => addFiles(),
836
- "data-testid": "workflow-add-files",
837
- children: adding ? l.adding : l.addFiles
838
- }
839
- );
840
- if (loaded && documents.length === 0) {
841
- return /* @__PURE__ */ jsxRuntime.jsxs(
842
- "div",
843
- {
844
- className: ui.cn(
845
- "flex flex-col items-center gap-2 rounded-lg border border-dashed border-border bg-muted/40 px-4 py-6 text-center",
846
- dropClass
847
- ),
848
- "data-testid": "workflow-documents-empty",
849
- ...dropProps,
850
- children: [
851
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderPlus, { className: "size-5 text-muted-foreground", "aria-hidden": true }),
852
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.empty }),
853
- addButton(void 0, "default")
854
- ]
855
- }
856
- );
857
- }
858
- const pending = ids.flatMap((id) => {
859
- const status = docOf(id)?.status;
860
- return isReady(status) ? [] : [{ id, label: l.status[String(status).toLowerCase()] ?? String(status) }];
861
- });
862
- const selected = multiple ? void 0 : docOf(ids[0] ?? "");
863
- return /* @__PURE__ */ jsxRuntime.jsxs(
864
- "div",
865
- {
866
- className: ui.cn("flex flex-col gap-3 rounded-lg", dropClass),
867
- "data-testid": `workflow-documents-${field.name}`,
868
- ...dropProps,
869
- children: [
870
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
871
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
872
- chunkMIDXCYZB_cjs.DocumentPicker,
873
- {
874
- groups: [{ id: "all", heading: l.allDocuments, docs: [...offered].sort(byTitle) }],
875
- value: multiple ? "" : ids[0] ?? "",
876
- onValueChange: (id) => multiple ? toggle(id) : set([id]),
877
- selected,
878
- selectedIds: multiple ? ids : void 0,
879
- labels: { placeholder: field.placeholder ?? (multiple ? l.pickMany : l.pickOne) }
880
- }
881
- ) }),
882
- addButton("shrink-0 pointer-coarse:h-11")
883
- ] }),
884
- pending.map((p) => /* @__PURE__ */ jsxRuntime.jsx(
885
- "p",
886
- {
887
- className: "text-xs text-muted-foreground",
888
- "data-testid": `workflow-document-status-${p.id}`,
889
- children: l.pending(nameOf(p.id), p.label)
890
- },
891
- p.id
892
- )),
893
- multiple && ids.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
894
- "div",
895
- {
896
- className: "grid grid-cols-2 gap-3 sm:grid-cols-3",
897
- "data-testid": "workflow-documents-gallery",
898
- children: ids.map((id) => {
899
- const thumbnail = thumbnailOf?.(id);
900
- return /* @__PURE__ */ jsxRuntime.jsxs(
901
- "figure",
902
- {
903
- className: "relative overflow-hidden rounded-lg border border-border bg-muted/40",
904
- "data-testid": `workflow-document-${id}`,
905
- children: [
906
- thumbnail ? /* @__PURE__ */ jsxRuntime.jsx(
907
- "img",
908
- {
909
- src: thumbnail,
910
- alt: nameOf(id),
911
- className: "aspect-square w-full object-cover"
912
- }
913
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex aspect-square w-full items-center justify-center text-muted-foreground/50", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ImageIcon, { className: "size-8" }) }),
914
- /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: "truncate bg-background/90 px-2 py-1 text-xs text-muted-foreground", children: nameOf(id) }),
915
- /* @__PURE__ */ jsxRuntime.jsx(
916
- "button",
917
- {
918
- type: "button",
919
- onClick: () => toggle(id),
920
- "aria-label": l.remove(nameOf(id)),
921
- className: "absolute right-1 top-1 flex size-6 items-center justify-center rounded-full bg-background/80 text-muted-foreground hover:text-foreground pointer-coarse:size-11",
922
- "data-testid": `workflow-document-remove-${id}`,
923
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5" })
924
- }
925
- )
926
- ]
927
- },
928
- id
929
- );
930
- })
931
- }
932
- )
933
- ]
934
- }
935
- );
936
- }
937
-
938
21
  // src/agents/workflows/planSteps.ts
939
22
  function toPlanAssignee(a) {
940
23
  if ("user" in a) return { user: a.user };
@@ -1043,7 +126,7 @@ function toStepField(f) {
1043
126
  }
1044
127
  var compact = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0 && v !== ""));
1045
128
  function placeholders(workflow) {
1046
- return Object.fromEntries(chunkOWCEQKAR_cjs.runFields(workflow).map((f) => [f.name, `{{${f.name}}}`]));
129
+ return Object.fromEntries(chunkJSTKEZBS_cjs.runFields(workflow).map((f) => [f.name, `{{${f.name}}}`]));
1047
130
  }
1048
131
  function agentStep(workflow, step, options) {
1049
132
  const target = step.workflow ? options.resolveWorkflow?.(step.workflow) : void 0;
@@ -1052,11 +135,11 @@ function agentStep(workflow, step, options) {
1052
135
  ([, v]) => v !== void 0 && v !== null && v !== ""
1053
136
  );
1054
137
  const inputs = { ...placeholders(workflow), ...Object.fromEntries(given) };
1055
- return { skill: null, inputs: null, prompt: chunkOWCEQKAR_cjs.composeStepPrompt(workflow, step, inputs, options) };
138
+ return { skill: null, inputs: null, prompt: chunkJSTKEZBS_cjs.composeStepPrompt(workflow, step, inputs, options) };
1056
139
  }
1057
140
  function toPlanSteps(workflow, options = {}) {
1058
141
  const layout = workflow.run.kind === "steps" ? workflow.run.layout : void 0;
1059
- return chunkOWCEQKAR_cjs.workflowSteps(workflow).map((step) => {
142
+ return chunkJSTKEZBS_cjs.workflowSteps(workflow).map((step) => {
1060
143
  const ui = compact({
1061
144
  description: step.description,
1062
145
  icon: step.icon,
@@ -1083,8 +166,8 @@ function toPlanSteps(workflow, options = {}) {
1083
166
  ui,
1084
167
  // An unfinished signal (still being typed) is not saved: the server would refuse it.
1085
168
  ...step.signals?.some((s) => !isIncompleteSignal(s)) ? { signals: step.signals.filter((s) => !isIncompleteSignal(s)).map(toPlanSignal) } : {},
1086
- ...step.assignee && chunkOWCEQKAR_cjs.canAssign(step) ? { assignee: toPlanAssignee(step.assignee) } : {},
1087
- ...step.remindAfterHours && chunkOWCEQKAR_cjs.canAssign(step) ? { remind_after_hours: step.remindAfterHours } : {},
169
+ ...step.assignee && chunkJSTKEZBS_cjs.canAssign(step) ? { assignee: toPlanAssignee(step.assignee) } : {},
170
+ ...step.remindAfterHours && chunkJSTKEZBS_cjs.canAssign(step) ? { remind_after_hours: step.remindAfterHours } : {},
1088
171
  // A review's fields are what approving it is checked against (the server's `fields`).
1089
172
  ...step.kind === "review" && step.fields?.length ? { fields: step.fields.map(toStepField) } : {},
1090
173
  ...step.kind === "action" ? { action: toPlanAction(step.action) } : {},
@@ -1202,7 +285,7 @@ function workflowToSkillMarkdown(workflow) {
1202
285
  if (workflow.landing !== "chat") lines.push(`landing: ${workflow.landing}`);
1203
286
  if (workflow.requiresFiles) lines.push("requires_files: true");
1204
287
  if (workflow.inputs.length > 0) {
1205
- lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(chunkOWCEQKAR_cjs.fieldToFrontmatter))}`);
288
+ lines.push(`inputs: ${JSON.stringify(workflow.inputs.map(chunk76L6LOP3_cjs.fieldToFrontmatter))}`);
1206
289
  }
1207
290
  lines.push("---", "", run.promptTemplate.trim(), "");
1208
291
  return lines.join("\n");
@@ -1224,12 +307,12 @@ function workflowFromSkillMarkdown(id, text) {
1224
307
  } else if (value === "true" || value === "false") frontmatter[key] = value === "true";
1225
308
  else frontmatter[key] = value;
1226
309
  }
1227
- return chunkOWCEQKAR_cjs.workflowFromFrontmatter(id, frontmatter, body);
310
+ return chunk76L6LOP3_cjs.workflowFromFrontmatter(id, frontmatter, body);
1228
311
  }
1229
312
  var errorMessage = (e) => e instanceof Error ? e.message : typeof e === "string" ? e : "Something went wrong.";
1230
313
  function firstOpen(steps, states) {
1231
314
  const open = steps.find((s) => !["done", "skipped"].includes(states[s.id]?.status ?? "pending"));
1232
- return open?.id ?? (steps.length && chunkOWCEQKAR_cjs.isRunFinished(steps, states) ? null : steps[0]?.id ?? null);
315
+ return open?.id ?? (steps.length && chunkJSTKEZBS_cjs.isRunFinished(steps, states) ? null : steps[0]?.id ?? null);
1233
316
  }
1234
317
  function useWorkflowView(options) {
1235
318
  const { steps, states, inputs, setInput, loaded = true } = options;
@@ -1269,11 +352,11 @@ function useWorkflowView(options) {
1269
352
  }),
1270
353
  []
1271
354
  );
1272
- const action = busy ? "wait" : chunkOWCEQKAR_cjs.nextAction(steps, states, current, actionOptions(options));
355
+ const action = busy ? "wait" : chunkJSTKEZBS_cjs.nextAction(steps, states, current, actionOptions(options));
1273
356
  const next = react.useCallback(async () => {
1274
357
  const { steps: s, states: st, inputs: values } = optionsRef.current;
1275
358
  const at = s.find((x) => x.id === current);
1276
- const act2 = chunkOWCEQKAR_cjs.nextAction(s, st, current, actionOptions(optionsRef.current));
359
+ const act2 = chunkJSTKEZBS_cjs.nextAction(s, st, current, actionOptions(optionsRef.current));
1277
360
  if (!at || act2 === "wait" || busy) return;
1278
361
  setActionError(null);
1279
362
  if (act2 === "finish") return setCurrent(null);
@@ -1284,7 +367,7 @@ function useWorkflowView(options) {
1284
367
  await (act2 === "start" ? optionsRef.current.start?.() : optionsRef.current.retry?.(at.id));
1285
368
  return;
1286
369
  }
1287
- if (Object.keys(chunkOWCEQKAR_cjs.validateStep(at, values)).length > 0) {
370
+ if (Object.keys(chunkJSTKEZBS_cjs.validateStep(at, values)).length > 0) {
1288
371
  setShowErrors(true);
1289
372
  return;
1290
373
  }
@@ -1385,10 +468,10 @@ function useWorkflowView(options) {
1385
468
  inputs,
1386
469
  setInput,
1387
470
  stateOf: (id) => states[id],
1388
- phaseOf: (id) => chunkOWCEQKAR_cjs.stepPhase(steps, states, id),
1389
- failedUpstreamOf: (id) => chunkOWCEQKAR_cjs.failedUpstream(steps, states, id),
471
+ phaseOf: (id) => chunkJSTKEZBS_cjs.stepPhase(steps, states, id),
472
+ failedUpstreamOf: (id) => chunkJSTKEZBS_cjs.failedUpstream(steps, states, id),
1390
473
  isLocked,
1391
- errors: showErrors && step && !isLocked(step.id) ? chunkOWCEQKAR_cjs.validateStep(step, inputs) : {},
474
+ errors: showErrors && step && !isLocked(step.id) ? chunkJSTKEZBS_cjs.validateStep(step, inputs) : {},
1392
475
  busy,
1393
476
  actionError,
1394
477
  isRunning: Object.values(states).some((s) => s.status === "running"),
@@ -1406,11 +489,11 @@ function useWorkflowView(options) {
1406
489
  nameOf: options.nameOf,
1407
490
  assigneeOf: (id) => {
1408
491
  const s = steps.find((x) => x.id === id);
1409
- if (!s || !chunkOWCEQKAR_cjs.canAssign(s)) return void 0;
1410
- return chunkOWCEQKAR_cjs.assigneeName(s.assignee, {
492
+ if (!s || !chunkJSTKEZBS_cjs.canAssign(s)) return void 0;
493
+ return chunkJSTKEZBS_cjs.assigneeName(s.assignee, {
1411
494
  nameOf: options.nameOf,
1412
495
  inputs,
1413
- fields: chunkOWCEQKAR_cjs.runFieldsOf(steps),
496
+ fields: chunkJSTKEZBS_cjs.runFieldsOf(steps),
1414
497
  announcedTo: states[id]?.announcedTo
1415
498
  });
1416
499
  },
@@ -1544,7 +627,7 @@ function StepBarFrame({
1544
627
  }) {
1545
628
  const l = { ...DEFAULT_STEP_BAR_LABELS, ...labels };
1546
629
  const box = react.useRef(null);
1547
- const { width } = chunkOWCEQKAR_cjs.useElementSize(box);
630
+ const { width } = chunkJSTKEZBS_cjs.useElementSize(box);
1548
631
  const narrow = width > 0 && width < NARROW_PX;
1549
632
  const [start, setStart] = react.useState(null);
1550
633
  react.useEffect(() => setStart(null), [current]);
@@ -1611,7 +694,7 @@ function StepBarFrame({
1611
694
  phase === "blocked" && "opacity-60"
1612
695
  ),
1613
696
  "aria-hidden": true,
1614
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkOWCEQKAR_cjs.StepBadgeMark, { phase, icon: icon?.(s) })
697
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkJSTKEZBS_cjs.StepBadgeMark, { phase, icon: icon?.(s) })
1615
698
  }
1616
699
  ),
1617
700
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", title: s.title, children: s.title }),
@@ -1719,7 +802,7 @@ function StepBarFrame({
1719
802
  };
1720
803
  const running = win.runningHidden;
1721
804
  const outOfViewChip = (s, kind) => /* @__PURE__ */ jsxRuntime.jsx(
1722
- chunkOWCEQKAR_cjs.StepChip,
805
+ chunkJSTKEZBS_cjs.StepChip,
1723
806
  {
1724
807
  kind: kindOf(s),
1725
808
  phase: kind === "working" ? "running" : "failed",
@@ -1892,7 +975,7 @@ var DEFAULT_WORKFLOW_STEP_PARTS_LABELS = {
1892
975
  someone: "someone"
1893
976
  };
1894
977
  var docName = (ref, nameOfDoc) => {
1895
- const { id, version } = chunkOWCEQKAR_cjs.splitDocRef(ref);
978
+ const { id, version } = chunkJSTKEZBS_cjs.splitDocRef(ref);
1896
979
  const name = nameOfDoc?.(id) ?? id;
1897
980
  return version ? `${name} \xB7 v${version}` : name;
1898
981
  };
@@ -1974,7 +1057,7 @@ function SendBackControl({
1974
1057
  const states = Object.fromEntries(
1975
1058
  run.steps.map((s) => [s.id, run.stateOf(s.id) ?? { status: "pending" }])
1976
1059
  );
1977
- const targets = chunkOWCEQKAR_cjs.sendBackTargets(run.steps, states, step.id);
1060
+ const targets = chunkJSTKEZBS_cjs.sendBackTargets(run.steps, states, step.id);
1978
1061
  const [open, setOpen] = react.useState(false);
1979
1062
  const [to, setTo] = react.useState(targets[0]?.id ?? "");
1980
1063
  const [note, setNote] = react.useState("");
@@ -2064,7 +1147,7 @@ function ApprovalEvidence({
2064
1147
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex flex-wrap items-center gap-1.5 text-sm font-medium", children: [
2065
1148
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "size-4 text-primary" }),
2066
1149
  approver ? l.approvedBy.replace("{name}", approver) : null,
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)) })
1150
+ state.at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-normal text-muted-foreground", children: l.approvedAt.replace("{date}", chunkJSTKEZBS_cjs.formatDate(state.at)) })
2068
1151
  ] }),
2069
1152
  evidence.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
2070
1153
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: l.approvedWhat }),
@@ -2097,7 +1180,7 @@ function ApprovalEvidence({
2097
1180
  ] }),
2098
1181
  (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: [
2099
1182
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
2100
- /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-testid": `${testId}-evidence-field-${f.name}`, children: chunkOWCEQKAR_cjs.shownValue(run.inputs[f.name], f, run.nameOf) })
1183
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-testid": `${testId}-evidence-field-${f.name}`, children: chunkJSTKEZBS_cjs.shownValue(run.inputs[f.name], f, run.nameOf) })
2101
1184
  ] }, f.name)) })
2102
1185
  ] });
2103
1186
  }
@@ -2193,7 +1276,7 @@ function ActionStepBody({
2193
1276
  waiting?.expires_at && phase === "waiting" && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
2194
1277
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "size-3.5" }),
2195
1278
  " ",
2196
- l.expires.replace("{date}", chunkOWCEQKAR_cjs.formatDate(waiting.expires_at))
1279
+ l.expires.replace("{date}", chunkJSTKEZBS_cjs.formatDate(waiting.expires_at))
2197
1280
  ] }),
2198
1281
  phase === "waiting" && mine && !declining && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2", children: [
2199
1282
  actions?.sign && state && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2351,7 +1434,7 @@ function WorkflowStepBar({
2351
1434
  const name = `${title} (${l.phases[phase]})`;
2352
1435
  if (s.id === DONE)
2353
1436
  return /* @__PURE__ */ jsxRuntime.jsx(
2354
- chunkOWCEQKAR_cjs.StepChip,
1437
+ chunkJSTKEZBS_cjs.StepChip,
2355
1438
  {
2356
1439
  inert: true,
2357
1440
  kind: "start",
@@ -2365,17 +1448,17 @@ function WorkflowStepBar({
2365
1448
  "data-testid": tid("step-done")
2366
1449
  }
2367
1450
  );
2368
- const kind = chunkOWCEQKAR_cjs.stepKindOf(s);
2369
- const KindIcon = chunkOWCEQKAR_cjs.STEP_KIND_ICONS[kind];
1451
+ const kind = chunkJSTKEZBS_cjs.stepKindOf(s);
1452
+ const KindIcon = chunkJSTKEZBS_cjs.STEP_KIND_ICONS[kind];
2370
1453
  return /* @__PURE__ */ jsxRuntime.jsx(
2371
- chunkOWCEQKAR_cjs.StepChip,
1454
+ chunkJSTKEZBS_cjs.StepChip,
2372
1455
  {
2373
1456
  kind,
2374
1457
  phase,
2375
1458
  icon: icon(s.icon) ?? /* @__PURE__ */ jsxRuntime.jsx(KindIcon, {}),
2376
1459
  label: s.title,
2377
1460
  current: isCurrent,
2378
- heading: chunkOWCEQKAR_cjs.DEFAULT_STEP_KIND_LABELS[kind],
1461
+ heading: chunkJSTKEZBS_cjs.DEFAULT_STEP_KIND_LABELS[kind],
2379
1462
  labelClassName: isCurrent ? STEP_LABEL_CURRENT : ui.cn(STEP_LABEL, STEP_LABEL_MAX),
2380
1463
  labelTestId: tid(`step-${s.id}-label`),
2381
1464
  onClick: () => run.goTo(s.id),
@@ -2408,7 +1491,7 @@ function WorkflowStepBar({
2408
1491
  isSelectable: (id) => id !== DONE,
2409
1492
  renderStep: (s) => pill(s),
2410
1493
  icon: (s) => s.id === DONE ? doneIcon : icon(s.icon),
2411
- kindOf: (s) => s.id === DONE ? "start" : chunkOWCEQKAR_cjs.stepKindOf(s),
1494
+ kindOf: (s) => s.id === DONE ? "start" : chunkJSTKEZBS_cjs.stepKindOf(s),
2412
1495
  disabled: run.busy,
2413
1496
  labels,
2414
1497
  tid,
@@ -2491,7 +1574,7 @@ function WorkflowRunner({
2491
1574
  const { steps, step, isComplete, action } = run;
2492
1575
  const completion = workflow.run.kind === "steps" ? workflow.run.completion : void 0;
2493
1576
  const tid = (suffix) => `${testIdPrefix}-${suffix}`;
2494
- const levels = chunkOWCEQKAR_cjs.stepLevels(steps);
1577
+ const levels = chunkJSTKEZBS_cjs.stepLevels(steps);
2495
1578
  const icon = (key) => key && renderIcon ? renderIcon(key) : void 0;
2496
1579
  const added = step?.kind === "upload" ? (files ?? []).filter((f) => f.addedFor === step.id) : [];
2497
1580
  const unread = added.filter((f) => f.status === "processing").length;
@@ -2499,7 +1582,7 @@ function WorkflowRunner({
2499
1582
  const sending = added.filter((f) => f.status === "uploading").length;
2500
1583
  const unsent = added.filter((f) => f.status === "upload-failed").length;
2501
1584
  const uploadHold = step?.kind === "upload" && (sending > 0 || uploading || unsent > 0);
2502
- const docsWait = !!step && chunkOWCEQKAR_cjs.waitingDocuments(run.stateOf(step.id)).length > 0;
1585
+ const docsWait = !!step && chunkJSTKEZBS_cjs.waitingDocuments(run.stateOf(step.id)).length > 0;
2503
1586
  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;
2504
1587
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn(compact2 ? "space-y-3" : "space-y-6", className), "data-testid": testIdPrefix, children: [
2505
1588
  !hideStepBar && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2531,13 +1614,13 @@ function WorkflowRunner({
2531
1614
  /* @__PURE__ */ jsxRuntime.jsx(StepNotices, { run, step, l, tid }),
2532
1615
  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(
2533
1616
  "{steps}",
2534
- chunkOWCEQKAR_cjs.stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
1617
+ chunkJSTKEZBS_cjs.stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
2535
1618
  ) }) }) : step.kind === "form" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2536
1619
  /* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon), testId: tid(`${step.id}-title`) }),
2537
1620
  /* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2538
1621
  /* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2539
1622
  /* @__PURE__ */ jsxRuntime.jsx("fieldset", { disabled: run.isLocked(step.id), className: "contents", children: /* @__PURE__ */ jsxRuntime.jsx(
2540
- SchemaForm,
1623
+ chunkLPYEUD2D_cjs.SchemaForm,
2541
1624
  {
2542
1625
  fields: step.inputs,
2543
1626
  values: run.inputs,
@@ -2587,11 +1670,11 @@ function WorkflowRunner({
2587
1670
  ] }) : step.kind === "review" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2588
1671
  /* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon) }),
2589
1672
  /* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2590
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: chunkOWCEQKAR_cjs.reviewInstructions(step, run.inputs) }),
1673
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: chunkJSTKEZBS_cjs.reviewInstructions(step, run.inputs) }),
2591
1674
  /* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2592
1675
  !(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 }),
2593
1676
  (step.fields ?? []).length > 0 && run.phaseOf(step.id) === "ready" && /* @__PURE__ */ jsxRuntime.jsx(
2594
- SchemaForm,
1677
+ chunkLPYEUD2D_cjs.SchemaForm,
2595
1678
  {
2596
1679
  fields: step.fields ?? [],
2597
1680
  values: run.inputs,
@@ -2854,8 +1937,8 @@ function AgentStepBody({
2854
1937
  }) {
2855
1938
  const state = run.stateOf(step.id);
2856
1939
  const phase = run.phaseOf(step.id);
2857
- const pending = chunkOWCEQKAR_cjs.waitingDocuments(state);
2858
- const pendingNames = pending.flatMap((ref) => nameOfDoc?.(chunkOWCEQKAR_cjs.splitDocRef(ref).id) ?? []);
1940
+ const pending = chunkJSTKEZBS_cjs.waitingDocuments(state);
1941
+ const pendingNames = pending.flatMap((ref) => nameOfDoc?.(chunkJSTKEZBS_cjs.splitDocRef(ref).id) ?? []);
2859
1942
  const header = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
2860
1943
  /* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon }),
2861
1944
  phase === "failed" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: run.retry && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2940,7 +2023,7 @@ function StepNotices({
2940
2023
  l,
2941
2024
  tid
2942
2025
  }) {
2943
- const notStarted = !chunkOWCEQKAR_cjs.isPersonStep(step) && run.needsStart && run.phaseOf(step.id) === "ready";
2026
+ const notStarted = !chunkJSTKEZBS_cjs.isPersonStep(step) && run.needsStart && run.phaseOf(step.id) === "ready";
2944
2027
  const failed = run.failedUpstreamOf(step.id);
2945
2028
  if (!notStarted && failed.length === 0) return null;
2946
2029
  const why = (error) => error ? `: ${error}` : "";
@@ -3216,7 +2299,7 @@ function AgentCreator({
3216
2299
  // eslint-disable-next-line react-hooks/exhaustive-deps
3217
2300
  [open]
3218
2301
  );
3219
- const [values, setValues] = useControllableState(
2302
+ const [values, setValues] = chunkAHDJXIUB_cjs.useControllableState(
3220
2303
  valuesProp,
3221
2304
  seed,
3222
2305
  onValuesChange
@@ -3344,7 +2427,7 @@ function AgentCreator({
3344
2427
  ] })
3345
2428
  ] }),
3346
2429
  /* @__PURE__ */ jsxRuntime.jsx(
3347
- chunkWS5EX7DN_cjs.FoldSection,
2430
+ chunkEYKISBDO_cjs.FoldSection,
3348
2431
  {
3349
2432
  label: l.advanced,
3350
2433
  open: advancedOpen,
@@ -3580,7 +2663,7 @@ var DEFAULT_AGENT_TYPES = [
3580
2663
  }
3581
2664
  ];
3582
2665
  function AgentConnectInstructions({ email, signingKey }) {
3583
- const { notify, runtimeConfig } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
2666
+ const { notify, runtimeConfig } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
3584
2667
  const [agentBackend, setAgentBackend] = react.useState("claude");
3585
2668
  const [copied, setCopied] = react.useState(false);
3586
2669
  const setupScript = react.useMemo(
@@ -4276,7 +3359,7 @@ var SKILL_FIELD_TYPE_LABELS = {
4276
3359
  person: "A person"
4277
3360
  };
4278
3361
  function buildLibrarySkills(builtins, listings) {
4279
- const { host, skills } = chunkOWCEQKAR_cjs.mergeSkillWorkflows(builtins, listings);
3362
+ const { host, skills } = chunk76L6LOP3_cjs.mergeSkillWorkflows(builtins, listings);
4280
3363
  const builtinIds = new Set(builtins.map((w) => w.id));
4281
3364
  const stored = new Map(listings.filter((s) => s.doc_ext_id).map((s) => [s.slug, s]));
4282
3365
  return [...host, ...skills].flatMap((workflow) => {
@@ -4445,688 +3528,6 @@ function SkillLibraryDetail({
4445
3528
  }
4446
3529
  );
4447
3530
  }
4448
- function PersonPill({ person, size = "sm", testId }) {
4449
- return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": testId, className: "inline-flex min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
4450
- ui.UserEntity,
4451
- {
4452
- variant: "pill",
4453
- size,
4454
- interactive: false,
4455
- showTooltip: false,
4456
- initials: chunkKDG6FER6_cjs.initials(person.label),
4457
- displayName: person.label,
4458
- avatarStyle: person.id ? ui.getEntityColorStyles(person.id) : void 0,
4459
- isAgent: person.isAgent,
4460
- isMe: person.isMe
4461
- }
4462
- ) });
4463
- }
4464
- var DEFAULT_TASK_TRIGGER_CHIP_LABELS = {
4465
- after: (name) => `After \u201C${name}\u201D is done`,
4466
- afterUnknown: "After another task is done",
4467
- onDemand: "Manual"
4468
- };
4469
- function TriggerIcon({ type, chained }) {
4470
- const cls = "size-3.5 shrink-0 text-muted-foreground";
4471
- if (chained) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2, { className: cls, "aria-hidden": true });
4472
- switch (type) {
4473
- case "on_demand":
4474
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MousePointerClick, { className: cls, "aria-hidden": true });
4475
- case "recurring":
4476
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: cls, "aria-hidden": true });
4477
- case "event":
4478
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, { className: cls, "aria-hidden": true });
4479
- default:
4480
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: cls, "aria-hidden": true });
4481
- }
4482
- }
4483
- function TaskTriggerChip({
4484
- id,
4485
- triggerType,
4486
- summary,
4487
- afterTaskId,
4488
- afterTaskName,
4489
- testId,
4490
- labels
4491
- }) {
4492
- const l = { ...DEFAULT_TASK_TRIGGER_CHIP_LABELS, ...labels };
4493
- const chained = Boolean(afterTaskId);
4494
- const text = chained ? afterTaskName ? l.after(afterTaskName) : l.afterUnknown : triggerType === "on_demand" ? l.onDemand : summary;
4495
- return /* @__PURE__ */ jsxRuntime.jsxs(
4496
- "span",
4497
- {
4498
- className: "inline-flex min-w-0 max-w-full items-center gap-1.5 text-sm font-normal text-foreground",
4499
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: `task-trigger-${id}` }),
4500
- "data-trigger": chained ? "task" : triggerType,
4501
- children: [
4502
- /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { type: triggerType, chained }),
4503
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: text })
4504
- ]
4505
- }
4506
- );
4507
- }
4508
-
4509
- // src/agents/tasks/workflowRows.ts
4510
- var isSkillRow = (row) => row.kind === "skill";
4511
- var hasTrigger = (row) => !row.on_demand && Boolean(row.rrule || row.run_at || row.event_kind || row.after_conversation_ext_id);
4512
- function workflowStatus(row) {
4513
- if (isSkillRow(row) || !hasTrigger(row)) return "on_demand";
4514
- return row.active ? "active" : "paused";
4515
- }
4516
- function workflowTriggerType(workflow) {
4517
- if (workflow.on_demand) return "on_demand";
4518
- if (workflow.after_conversation_ext_id) return "after";
4519
- if (workflow.event_kind) return "event";
4520
- if (workflow.rrule) return "recurring";
4521
- if (workflow.run_at) return "one_time";
4522
- return "on_demand";
4523
- }
4524
- function workflowRunStatusLabel(status) {
4525
- if (!status) return "None";
4526
- const labels = {
4527
- completed: "Success",
4528
- success: "Success",
4529
- failed: "Failed",
4530
- running: "In progress",
4531
- awaiting_authorization: "Awaiting access"
4532
- };
4533
- return labels[status] ?? status.replaceAll("_", " ");
4534
- }
4535
- function listedRunStatus(status, threadStatus) {
4536
- if (threadStatus === "done" && status === "running") return "completed";
4537
- return status;
4538
- }
4539
-
4540
- // src/agents/tasks/workflowColumns.tsx
4541
- var WORKFLOW_COLUMN_ORDER = [
4542
- "name",
4543
- "trigger",
4544
- "last_run",
4545
- "result",
4546
- "status",
4547
- "shared",
4548
- "actions"
4549
- ];
4550
- function cell(render) {
4551
- return (params) => params.data ? render(params.data) : null;
4552
- }
4553
- var time = (iso) => iso ? Date.parse(iso) : Number.POSITIVE_INFINITY;
4554
- function createWorkflowColumns(o) {
4555
- const l = o.labels;
4556
- const base = {
4557
- sortable: false,
4558
- cellStyle: { display: "flex", alignItems: "center" }
4559
- };
4560
- return [
4561
- {
4562
- ...base,
4563
- colId: "name",
4564
- sortable: true,
4565
- headerName: l.colName,
4566
- flex: 3,
4567
- minWidth: 210,
4568
- valueGetter: (p) => p.data?.name.toLowerCase() ?? "",
4569
- cellRenderer: cell(o.renderName)
4570
- },
4571
- {
4572
- ...base,
4573
- colId: "trigger",
4574
- headerName: l.colTrigger,
4575
- flex: 2.4,
4576
- minWidth: 185,
4577
- valueGetter: (p) => p.data ? o.getTriggerText(p.data) : "",
4578
- cellRenderer: cell(o.renderTrigger)
4579
- },
4580
- {
4581
- ...base,
4582
- colId: "last_run",
4583
- sortable: true,
4584
- headerName: l.colLastRun,
4585
- flex: 1.4,
4586
- minWidth: 140,
4587
- cellStyle: { display: "flex", alignItems: "center", padding: 0 },
4588
- valueGetter: (p) => time(p.data?.last_fired_at),
4589
- cellRenderer: cell(o.renderLastRun)
4590
- },
4591
- {
4592
- ...base,
4593
- colId: "result",
4594
- headerName: "Result",
4595
- width: 130,
4596
- valueGetter: (p) => p.data?.last_run_status ?? "",
4597
- cellStyle: { display: "flex", alignItems: "center", padding: 0 },
4598
- cellRenderer: cell(o.renderResult)
4599
- },
4600
- {
4601
- ...base,
4602
- colId: "status",
4603
- sortable: true,
4604
- headerName: l.colStatus,
4605
- width: 120,
4606
- valueGetter: (p) => p.data ? workflowStatus(p.data) : "",
4607
- cellRenderer: cell(o.renderStatus)
4608
- },
4609
- {
4610
- ...base,
4611
- colId: "shared",
4612
- headerName: l.colShared,
4613
- headerTooltip: l.shared,
4614
- width: 96,
4615
- cellStyle: { display: "flex", alignItems: "center", justifyContent: "center" },
4616
- valueGetter: (p) => p.data?.shared ?? false,
4617
- cellRenderer: cell(o.renderShared)
4618
- },
4619
- {
4620
- ...base,
4621
- colId: "actions",
4622
- headerName: "",
4623
- width: 180,
4624
- minWidth: 180,
4625
- cellStyle: { display: "flex", alignItems: "center", justifyContent: "flex-end" },
4626
- cellRenderer: cell(o.renderActions)
4627
- }
4628
- ];
4629
- }
4630
-
4631
- // src/agents/tasks/workflowTableLabels.ts
4632
- var DEFAULT_WORKFLOW_LIST_LABELS = {
4633
- colName: "Name",
4634
- colType: "Type",
4635
- colTrigger: "When",
4636
- colAction: "What it does",
4637
- colAgent: "Agent",
4638
- colStatus: "Active",
4639
- colShared: "Shared",
4640
- colLastRun: "Last run",
4641
- colNextRun: "Next run",
4642
- shared: "Shared with the workspace",
4643
- sharedOwnerOnly: "Only the creator can change who can see this",
4644
- deleteOwnerOnly: "Only the creator or workspace owner can delete this",
4645
- typeSkill: "Skill",
4646
- typeWorkflow: "Workflow",
4647
- statusActive: "Active",
4648
- statusPaused: "Inactive",
4649
- statusOnDemand: "On demand",
4650
- activeSwitch: (name) => `Active: \u201C${name}\u201D`,
4651
- agent: "Agent",
4652
- myAssistant: "My assistant",
4653
- me: "Me",
4654
- someone: "Someone",
4655
- never: "Never",
4656
- none: "\u2014",
4657
- reminder: "Reminder",
4658
- failed: "Failed",
4659
- lastRunFailed: "Last run failed",
4660
- openLastRun: "Open the task this run created",
4661
- editWorkflow: "Edit",
4662
- run: "Run",
4663
- runLater: "Run later",
4664
- runNow: "Run now",
4665
- runs: "Runs",
4666
- delete: "Delete",
4667
- moreActions: "More actions",
4668
- searchLabel: "Search workflows",
4669
- searchPlaceholder: "Search workflows and skills\u2026",
4670
- emptyTitle: "Nothing to run yet",
4671
- emptyMessage: "Skills and workflows you can run will appear here.",
4672
- firstRun: "Run a skill now, or choose Run later to save it as a workflow that runs on its own.",
4673
- noMatches: "Nothing in this view.",
4674
- filterAll: "All",
4675
- filterSkills: "Skills",
4676
- filterWorkflows: "Workflows",
4677
- filterActive: "Active",
4678
- filterPaused: "Inactive",
4679
- makeActive: "Make active",
4680
- makePaused: "Deactivate",
4681
- selectAll: "Select all",
4682
- selectWorkflow: (name) => `Select ${name}`
4683
- };
4684
- var ROW_HEIGHT = 40;
4685
- function WorkflowsTable(props) {
4686
- const { workflows, isLoading, busyId, header, testId } = props;
4687
- const l = { ...DEFAULT_WORKFLOW_LIST_LABELS, ...props.labels };
4688
- const [filterStates, setFilterStates] = react.useState(/* @__PURE__ */ new Map());
4689
- const [filterOpen, setFilterOpen] = react.useState(false);
4690
- const [query, setQuery] = react.useState("");
4691
- const [selected, setSelected] = react.useState([]);
4692
- const apiRef = react.useRef(null);
4693
- const q = query.trim().toLowerCase();
4694
- const matches = (w) => !q || `${w.name} ${w.description ?? ""} ${w.prompt ?? ""} ${w.skill_ref ?? ""}`.toLowerCase().includes(q);
4695
- const inFilter = (w, f) => f === "all" || f === "skills" && isSkillRow(w) || f === "workflows" && !isSkillRow(w) || f === "active" && workflowStatus(w) === "active" || f === "paused" && workflowStatus(w) === "paused";
4696
- const counts = react.useMemo(() => {
4697
- const out = { all: 0, skills: 0, workflows: 0, active: 0, paused: 0 };
4698
- for (const w of workflows) {
4699
- if (!matches(w)) continue;
4700
- for (const f of Object.keys(out)) if (inFilter(w, f)) out[f] += 1;
4701
- }
4702
- return out;
4703
- }, [workflows, q]);
4704
- const shown = react.useMemo(
4705
- () => workflows.filter((w) => {
4706
- if (!matches(w)) return false;
4707
- for (const group of [
4708
- ["skills", "workflows"],
4709
- ["active", "paused"]
4710
- ]) {
4711
- const included = group.filter((f) => filterStates.get(f) === "include");
4712
- if (included.length && !included.some((f) => inFilter(w, f))) return false;
4713
- if (group.some((f) => filterStates.get(f) === "exclude" && inFilter(w, f))) return false;
4714
- }
4715
- return true;
4716
- }),
4717
- [workflows, filterStates, q]
4718
- );
4719
- const renderPerson = props.renderPerson ?? ((p) => /* @__PURE__ */ jsxRuntime.jsx(PersonPill, { person: p }));
4720
- const actionText = (w) => {
4721
- if (w.action)
4722
- return w.action.type === "email_documents" ? "Email latest documents" : "AI Review";
4723
- if (isSkillRow(w))
4724
- return w.description || w.skill_ref && props.skillNames?.[w.skill_ref] || w.name;
4725
- return w.skill_ref ? props.skillNames?.[w.skill_ref] ?? w.skill_ref : w.prompt?.trim() || l.reminder;
4726
- };
4727
- const latest = react.useRef({ props, l, renderPerson, actionText });
4728
- latest.current = { props, l, renderPerson, actionText };
4729
- const columnDefs = react.useMemo(
4730
- () => createWorkflowColumns({
4731
- labels: l,
4732
- getTriggerText: (w) => isSkillRow(w) ? l.statusOnDemand : latest.current.props.describeTrigger(w),
4733
- renderName: (w) => {
4734
- const { l: lb } = latest.current;
4735
- const skill = isSkillRow(w);
4736
- const text = skill ? latest.current.actionText(w) : w.description || latest.current.actionText(w);
4737
- const stem = w.name.replace(/…$/, "").trim();
4738
- const about = text && text.trim() !== w.name.trim() && text.trim() !== stem ? text : "";
4739
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 leading-tight", children: [
4740
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
4741
- /* @__PURE__ */ jsxRuntime.jsx(
4742
- "span",
4743
- {
4744
- className: ui.cn(
4745
- "truncate text-sm font-normal",
4746
- workflowStatus(w) === "paused" && "text-muted-foreground"
4747
- ),
4748
- "data-testid": `workflow-name-${w.external_id}`,
4749
- children: w.name
4750
- }
4751
- ),
4752
- skill && /* @__PURE__ */ jsxRuntime.jsx(
4753
- "span",
4754
- {
4755
- className: "shrink-0 rounded-full border border-border px-1.5 text-[11px] text-muted-foreground",
4756
- "data-testid": `workflow-type-${w.external_id}`,
4757
- children: lb.typeSkill
4758
- }
4759
- )
4760
- ] }),
4761
- about && !latest.current.props.automationsOnly && /* @__PURE__ */ jsxRuntime.jsx(
4762
- "p",
4763
- {
4764
- className: "truncate text-xs text-muted-foreground",
4765
- "data-testid": `workflow-action-${w.external_id}`,
4766
- children: about
4767
- }
4768
- )
4769
- ] });
4770
- },
4771
- renderTrigger: (w) => {
4772
- const { props: p } = latest.current;
4773
- const after = w.after_conversation_ext_id;
4774
- const skill = isSkillRow(w);
4775
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 leading-tight", children: /* @__PURE__ */ jsxRuntime.jsx(
4776
- TaskTriggerChip,
4777
- {
4778
- id: w.external_id,
4779
- testId: `workflow-trigger-${w.external_id}`,
4780
- triggerType: workflowTriggerType(w),
4781
- summary: skill ? "" : p.describeTrigger(w),
4782
- afterTaskId: after,
4783
- afterTaskName: after ? p.taskNames?.[after] : void 0,
4784
- labels: p.triggerChipLabels
4785
- }
4786
- ) });
4787
- },
4788
- renderStatus: (w) => {
4789
- const { props: p, l: lb } = latest.current;
4790
- const canEdit = w.is_owner !== false || Boolean(p.canEditShared);
4791
- return /* @__PURE__ */ jsxRuntime.jsx(
4792
- ui.Switch,
4793
- {
4794
- checked: hasTrigger(w) && !isSkillRow(w) && Boolean(w.active),
4795
- disabled: !hasTrigger(w) || isSkillRow(w) || !canEdit || p.busyId === w.external_id,
4796
- onCheckedChange: (next) => p.onToggleActive(w, next),
4797
- className: "disabled:data-[state=unchecked]:bg-muted dark:disabled:data-[state=unchecked]:bg-muted",
4798
- "aria-label": lb.activeSwitch(w.name),
4799
- "data-testid": `workflow-active-${w.external_id}`
4800
- }
4801
- );
4802
- },
4803
- renderShared: (w) => {
4804
- const { props: p, l: lb } = latest.current;
4805
- if (!p.onToggleShared || isSkillRow(w)) return null;
4806
- const isCreator = w.is_owner !== false;
4807
- return /* @__PURE__ */ jsxRuntime.jsx(
4808
- ui.VisibilityToggle,
4809
- {
4810
- items: { shared: w.shared ?? false },
4811
- onToggle: (share) => latest.current.props.onToggleShared?.(w, share),
4812
- disabled: !isCreator || p.busyId === w.external_id,
4813
- disabledTooltip: lb.sharedOwnerOnly,
4814
- showLabel: false,
4815
- "data-testid": `workflow-shared-${w.external_id}`
4816
- }
4817
- );
4818
- },
4819
- renderLastRun: (w) => {
4820
- const { props: p, l: lb } = latest.current;
4821
- const at = w.last_fired_at ?? p.lastRuns?.[w.external_id]?.at;
4822
- return /* @__PURE__ */ jsxRuntime.jsx(
4823
- "button",
4824
- {
4825
- type: "button",
4826
- className: "h-full w-full truncate px-4 text-left text-sm hover:text-primary",
4827
- onClick: () => p.onViewRuns?.(w),
4828
- title: "View run history",
4829
- "data-testid": `workflow-last-run-${w.external_id}`,
4830
- children: at ? p.formatDate(at) : lb.never
4831
- }
4832
- );
4833
- },
4834
- renderResult: (w) => {
4835
- const status = listedRunStatus(
4836
- w.last_run_status,
4837
- latest.current.props.lastRuns?.[w.external_id]?.threadStatus
4838
- );
4839
- const label = workflowRunStatusLabel(status);
4840
- return /* @__PURE__ */ jsxRuntime.jsx(
4841
- "button",
4842
- {
4843
- type: "button",
4844
- onClick: () => latest.current.props.onViewRuns?.(w),
4845
- title: "View run history",
4846
- className: ui.cn(
4847
- ui.badgeVariants({ variant: "outline" }),
4848
- "mx-4 cursor-pointer text-xs font-medium",
4849
- status === "failed" ? "border-red-border bg-red-bg text-red-text hover:bg-red-bg/80" : status === "completed" || status === "success" ? "border-green-border bg-green-bg text-green-text hover:bg-green-bg/80" : status ? "border-primary/20 bg-primary/10 text-primary hover:bg-primary/15" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"
4850
- ),
4851
- "data-testid": `workflow-result-${w.external_id}`,
4852
- children: label
4853
- }
4854
- );
4855
- },
4856
- renderActions: (w) => {
4857
- const { props: p, l: lb } = latest.current;
4858
- const id = w.external_id;
4859
- const skill = isSkillRow(w);
4860
- const busy = p.busyId === id;
4861
- const isOwner = w.is_owner !== false;
4862
- const canEdit = isOwner || Boolean(p.canEditShared);
4863
- const canAdmin = isOwner || Boolean(p.isWorkspaceOwner);
4864
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-1", children: [
4865
- (skill || canEdit) && /* @__PURE__ */ jsxRuntime.jsxs(
4866
- ui.Button,
4867
- {
4868
- size: "sm",
4869
- variant: "outline",
4870
- className: "h-8 gap-1.5 pointer-coarse:h-11",
4871
- disabled: busy,
4872
- onClick: () => p.onRun(w),
4873
- "data-testid": `workflow-run-btn-${id}`,
4874
- children: [
4875
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-3.5", "aria-hidden": true }),
4876
- lb.run
4877
- ]
4878
- }
4879
- ),
4880
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
4881
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4882
- ui.Button,
4883
- {
4884
- variant: "ghost",
4885
- size: "icon",
4886
- className: "size-8 pointer-coarse:size-11",
4887
- "aria-label": lb.moreActions,
4888
- "data-testid": `workflow-menu-${id}`,
4889
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "size-4", "aria-hidden": true })
4890
- }
4891
- ) }),
4892
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", children: [
4893
- skill && p.onRunLater && /* @__PURE__ */ jsxRuntime.jsxs(
4894
- ui.DropdownMenuItem,
4895
- {
4896
- onSelect: () => p.onRunLater?.(w),
4897
- "data-testid": `workflow-run-later-${id}`,
4898
- children: [
4899
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "mr-2 size-4", "aria-hidden": true }),
4900
- lb.runLater
4901
- ]
4902
- }
4903
- ),
4904
- !skill && canEdit && /* @__PURE__ */ jsxRuntime.jsxs(
4905
- ui.DropdownMenuItem,
4906
- {
4907
- onSelect: () => p.onEdit(w),
4908
- "data-testid": `workflow-edit-${id}`,
4909
- children: [
4910
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "mr-2 size-4", "aria-hidden": true }),
4911
- lb.editWorkflow
4912
- ]
4913
- }
4914
- ),
4915
- !skill && p.onViewRuns && /* @__PURE__ */ jsxRuntime.jsxs(
4916
- ui.DropdownMenuItem,
4917
- {
4918
- onSelect: () => p.onViewRuns?.(w),
4919
- "data-testid": `workflow-runs-${id}`,
4920
- children: [
4921
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "mr-2 size-4", "aria-hidden": true }),
4922
- lb.runs
4923
- ]
4924
- }
4925
- ),
4926
- !skill && canEdit && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4927
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuSeparator, {}),
4928
- /* @__PURE__ */ jsxRuntime.jsxs(
4929
- ui.DropdownMenuItem,
4930
- {
4931
- disabled: busy || !canAdmin,
4932
- onSelect: () => p.onDelete(w),
4933
- title: canAdmin ? void 0 : lb.deleteOwnerOnly,
4934
- className: "text-destructive focus:text-destructive",
4935
- "data-testid": `workflow-delete-${id}`,
4936
- children: [
4937
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "mr-2 size-4", "aria-hidden": true }),
4938
- lb.delete
4939
- ]
4940
- }
4941
- )
4942
- ] })
4943
- ] })
4944
- ] })
4945
- ] });
4946
- }
4947
- }),
4948
- // Stable on purpose: only the header texts rebuild the columns (see `latest`).
4949
- // eslint-disable-next-line react-hooks/exhaustive-deps
4950
- [
4951
- l.colName,
4952
- l.colType,
4953
- l.colTrigger,
4954
- l.colAction,
4955
- l.colAgent,
4956
- l.colStatus,
4957
- l.colShared,
4958
- l.shared,
4959
- l.colLastRun,
4960
- l.colNextRun
4961
- ]
4962
- );
4963
- react.useEffect(() => {
4964
- apiRef.current?.refreshCells({ force: true });
4965
- }, [
4966
- busyId,
4967
- props.agentNames,
4968
- props.skillNames,
4969
- props.taskNames,
4970
- props.lastRuns,
4971
- props.renderPerson,
4972
- props.labels,
4973
- props.canEditShared,
4974
- props.isWorkspaceOwner
4975
- ]);
4976
- const mine = selected.filter((w) => !isSkillRow(w));
4977
- const adminSelected = mine.filter((w) => w.is_owner !== false || props.isWorkspaceOwner);
4978
- const editableSelected = mine.filter(
4979
- (w) => hasTrigger(w) && (w.is_owner !== false || props.canEditShared)
4980
- );
4981
- const clearSelection = () => setSelected([]);
4982
- return /* @__PURE__ */ jsxRuntime.jsxs(
4983
- "div",
4984
- {
4985
- className: "flex min-h-0 flex-1 flex-col",
4986
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "workflow-list" }),
4987
- children: [
4988
- /* @__PURE__ */ jsxRuntime.jsx(
4989
- chunk7RGLTF76_cjs.TabHeader,
4990
- {
4991
- testId: "automations-tab-header",
4992
- tabs: [
4993
- {
4994
- id: "automations",
4995
- label: "",
4996
- count: shown.length,
4997
- countIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Workflow, { className: "size-3.5" }),
4998
- countPlacement: "leading",
4999
- presentation: "count",
5000
- hasActiveFilters: !!q || [...filterStates.values()].some(Boolean)
5001
- },
5002
- ...props.tabs ?? []
5003
- ],
5004
- activeTabId: props.activeTabId ?? "automations",
5005
- onTabChange: props.onTabChange ?? (() => {
5006
- }),
5007
- firstTabContent: /* @__PURE__ */ jsxRuntime.jsx(
5008
- chunk2EI7NCUA_cjs.FilterInput,
5009
- {
5010
- value: query,
5011
- onChange: setQuery,
5012
- fields: ["text"],
5013
- onFieldsChange: () => {
5014
- },
5015
- hideFieldPicker: true,
5016
- ariaLabel: l.searchLabel,
5017
- testIds: { input: "workflow-search" },
5018
- filter: /* @__PURE__ */ jsxRuntime.jsx(
5019
- chunkMIDXCYZB_cjs.TriStateFilterMenu,
5020
- {
5021
- testId: "automations-filter-button",
5022
- open: filterOpen,
5023
- onOpenChange: setFilterOpen,
5024
- filterStates,
5025
- onFiltersChange: setFilterStates,
5026
- triggerClassName: "flex h-5 items-center gap-0.5 rounded px-1 text-muted-foreground hover:text-foreground pointer-coarse:h-11! pointer-coarse:min-w-11 pointer-coarse:justify-center",
5027
- renderChevron: true,
5028
- disableHoverOpen: true,
5029
- options: [
5030
- ...!props.automationsOnly ? [
5031
- { id: "skills", label: l.filterSkills, count: counts.skills },
5032
- {
5033
- id: "workflows",
5034
- label: l.filterWorkflows,
5035
- count: counts.workflows
5036
- }
5037
- ] : [],
5038
- { id: "active", label: l.filterActive, count: counts.active },
5039
- { id: "paused", label: l.filterPaused, count: counts.paused }
5040
- ]
5041
- }
5042
- )
5043
- }
5044
- ),
5045
- rightContent: header
5046
- }
5047
- ),
5048
- props.content ? props.content : workflows.length === 0 && !isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
5049
- chunkZW6FPIFC_cjs.EmptyState,
5050
- {
5051
- icon: lucideReact.Workflow,
5052
- title: l.emptyTitle,
5053
- description: l.emptyMessage,
5054
- testId: "workflow-list-empty"
5055
- }
5056
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
5057
- chunkC2CWWEHO_cjs.GridView,
5058
- {
5059
- testId: "workflow-grid",
5060
- gridId: props.gridId ?? "workflows-grid-v2",
5061
- items: shown,
5062
- columnDefs,
5063
- getItemId: (w) => w.external_id,
5064
- getRowTestId: (w) => `workflow-row-${w.external_id}`,
5065
- isLoading,
5066
- showEmpty: shown.length === 0,
5067
- emptyState: { title: l.noMatches },
5068
- rowHeight: ROW_HEIGHT,
5069
- height: "100%",
5070
- onGridReady: ({ api }) => {
5071
- apiRef.current = api;
5072
- },
5073
- onRowClick: (row) => props.onOpenRow?.(row),
5074
- selection: { mode: "multiple", selected, onSelectionChange: setSelected },
5075
- gridOptions: GRID_OPTIONS
5076
- }
5077
- ) }),
5078
- !props.content && /* @__PURE__ */ jsxRuntime.jsx(chunkV4ISCZJ7_cjs.SelectionBar, { count: selected.length, onClear: clearSelection, children: (isCompact) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5079
- props.onToggleActiveMany && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5080
- /* @__PURE__ */ jsxRuntime.jsx(
5081
- chunkV4ISCZJ7_cjs.SelectionBarAction,
5082
- {
5083
- icon: lucideReact.Play,
5084
- label: l.makeActive,
5085
- onClick: () => {
5086
- props.onToggleActiveMany?.(editableSelected, true);
5087
- clearSelection();
5088
- },
5089
- disabled: editableSelected.length === 0,
5090
- isCompact,
5091
- testId: "workflow-bulk-activate"
5092
- }
5093
- ),
5094
- /* @__PURE__ */ jsxRuntime.jsx(
5095
- chunkV4ISCZJ7_cjs.SelectionBarAction,
5096
- {
5097
- icon: lucideReact.Workflow,
5098
- label: l.makePaused,
5099
- onClick: () => {
5100
- props.onToggleActiveMany?.(editableSelected, false);
5101
- clearSelection();
5102
- },
5103
- disabled: editableSelected.length === 0,
5104
- isCompact,
5105
- testId: "workflow-bulk-pause"
5106
- }
5107
- )
5108
- ] }),
5109
- props.onDeleteMany && /* @__PURE__ */ jsxRuntime.jsx(
5110
- chunkV4ISCZJ7_cjs.SelectionBarAction,
5111
- {
5112
- icon: lucideReact.Trash2,
5113
- label: l.delete,
5114
- onClick: () => {
5115
- props.onDeleteMany?.(adminSelected);
5116
- clearSelection();
5117
- },
5118
- disabled: adminSelected.length === 0,
5119
- isCompact,
5120
- className: "border-red-border text-red-text hover:bg-red-bg hover:text-red-text",
5121
- testId: "workflow-bulk-delete"
5122
- }
5123
- )
5124
- ] }) })
5125
- ]
5126
- }
5127
- );
5128
- }
5129
- var GRID_OPTIONS = { suppressClickEdit: true };
5130
3531
  var DEFAULT_TASK_ACTIVITY_LABELS = {
5131
3532
  title: "Activity",
5132
3533
  empty: "Nothing has happened yet.",
@@ -5213,12 +3614,12 @@ function taskActivityHeadline(e, labels = DEFAULT_TASK_ACTIVITY_LABELS, agentNam
5213
3614
  case "step_skipped":
5214
3615
  return "Step skipped";
5215
3616
  case "step_waiting": {
5216
- const documents = chunkOWCEQKAR_cjs.eventWaitingDocuments(detail);
5217
- return documents ? chunkOWCEQKAR_cjs.waitingForDocumentsText(documents.length) : "Waiting on people";
3617
+ const documents = chunkJSTKEZBS_cjs.eventWaitingDocuments(detail);
3618
+ return documents ? chunkJSTKEZBS_cjs.waitingForDocumentsText(documents.length) : "Waiting on people";
5218
3619
  }
5219
3620
  case "step_progress": {
5220
- const documents = chunkOWCEQKAR_cjs.eventWaitingDocuments(detail);
5221
- return documents ? chunkOWCEQKAR_cjs.waitingForDocumentsText(documents.length) : detail.signed ? "Signed" : "Step moved on";
3621
+ const documents = chunkJSTKEZBS_cjs.eventWaitingDocuments(detail);
3622
+ return documents ? chunkJSTKEZBS_cjs.waitingForDocumentsText(documents.length) : detail.signed ? "Signed" : "Step moved on";
5222
3623
  }
5223
3624
  case "step_sent_back":
5224
3625
  return "Sent the work back";
@@ -5393,7 +3794,7 @@ function TaskRunsDialog({
5393
3794
  "rounded-full px-2 py-0.5 text-xs font-medium capitalize",
5394
3795
  STATUS_STYLE[data.status] ?? "text-muted-foreground"
5395
3796
  ),
5396
- children: workflowRunStatusLabel(data.status)
3797
+ children: chunkLPYEUD2D_cjs.workflowRunStatusLabel(data.status)
5397
3798
  }
5398
3799
  )
5399
3800
  },
@@ -5409,7 +3810,7 @@ function TaskRunsDialog({
5409
3810
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full items-center gap-2", children: [
5410
3811
  run.error && renderErrorReport?.(run),
5411
3812
  (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,
3813
+ chunkDTROMMDX_cjs.ActionLink,
5413
3814
  {
5414
3815
  href: getRunHref?.(run),
5415
3816
  onSelect: () => {
@@ -5488,7 +3889,6 @@ exports.ActionStepBody = ActionStepBody;
5488
3889
  exports.AgentAvatarField = AgentAvatarField;
5489
3890
  exports.AgentConnectInstructions = AgentConnectInstructions;
5490
3891
  exports.AgentCreator = AgentCreator;
5491
- exports.AgentSelect = AgentSelect;
5492
3892
  exports.AgentTypeSelector = AgentTypeSelector;
5493
3893
  exports.ApprovalEvidence = ApprovalEvidence;
5494
3894
  exports.AssigneeLine = AssigneeLine;
@@ -5497,11 +3897,9 @@ exports.CapabilityTile = CapabilityTile;
5497
3897
  exports.DEFAULT_AGENT_AVATAR_FIELD_LABELS = DEFAULT_AGENT_AVATAR_FIELD_LABELS;
5498
3898
  exports.DEFAULT_AGENT_CAPABILITIES = DEFAULT_AGENT_CAPABILITIES;
5499
3899
  exports.DEFAULT_AGENT_CREATOR_LABELS = DEFAULT_AGENT_CREATOR_LABELS;
5500
- exports.DEFAULT_AGENT_SELECT_LABELS = DEFAULT_AGENT_SELECT_LABELS;
5501
3900
  exports.DEFAULT_AGENT_TEMPLATES = DEFAULT_AGENT_TEMPLATES;
5502
3901
  exports.DEFAULT_AGENT_TYPES = DEFAULT_AGENT_TYPES;
5503
3902
  exports.DEFAULT_AGENT_TYPE_SELECTOR_LABELS = DEFAULT_AGENT_TYPE_SELECTOR_LABELS;
5504
- exports.DEFAULT_SCHEMA_FORM_LABELS = DEFAULT_SCHEMA_FORM_LABELS;
5505
3903
  exports.DEFAULT_SKILL_EDIT_FORM_LABELS = DEFAULT_SKILL_EDIT_FORM_LABELS;
5506
3904
  exports.DEFAULT_SKILL_GENERATE_FORM_LABELS = DEFAULT_SKILL_GENERATE_FORM_LABELS;
5507
3905
  exports.DEFAULT_SKILL_GLOBAL_BADGE_LABELS = DEFAULT_SKILL_GLOBAL_BADGE_LABELS;
@@ -5509,13 +3907,8 @@ exports.DEFAULT_SKILL_VIEW_TOGGLE_LABELS = DEFAULT_SKILL_VIEW_TOGGLE_LABELS;
5509
3907
  exports.DEFAULT_STEP_BAR_LABELS = DEFAULT_STEP_BAR_LABELS;
5510
3908
  exports.DEFAULT_TASK_ACTIVITY_LABELS = DEFAULT_TASK_ACTIVITY_LABELS;
5511
3909
  exports.DEFAULT_TASK_RUNS_DIALOG_LABELS = DEFAULT_TASK_RUNS_DIALOG_LABELS;
5512
- exports.DEFAULT_TASK_TRIGGER_CHIP_LABELS = DEFAULT_TASK_TRIGGER_CHIP_LABELS;
5513
- exports.DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS = DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS;
5514
- exports.DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS = DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS;
5515
- exports.DEFAULT_WORKFLOW_LIST_LABELS = DEFAULT_WORKFLOW_LIST_LABELS;
5516
3910
  exports.DEFAULT_WORKFLOW_RUNNER_LABELS = DEFAULT_WORKFLOW_RUNNER_LABELS;
5517
3911
  exports.DEFAULT_WORKFLOW_STEP_PARTS_LABELS = DEFAULT_WORKFLOW_STEP_PARTS_LABELS;
5518
- exports.PersonPill = PersonPill;
5519
3912
  exports.SKILL_FIELD_TYPE_LABELS = SKILL_FIELD_TYPE_LABELS;
5520
3913
  exports.SKILL_MAIN_FILENAME = SKILL_MAIN_FILENAME;
5521
3914
  exports.SKILL_SOURCE_LABELS = SKILL_SOURCE_LABELS;
@@ -5524,7 +3917,6 @@ exports.SKILL_TYPE_LABELS = SKILL_TYPE_LABELS;
5524
3917
  exports.STEP_LABEL = STEP_LABEL;
5525
3918
  exports.STEP_LABEL_CURRENT = STEP_LABEL_CURRENT;
5526
3919
  exports.STEP_LABEL_MAX = STEP_LABEL_MAX;
5527
- exports.SchemaForm = SchemaForm;
5528
3920
  exports.SendBackControl = SendBackControl;
5529
3921
  exports.SkillActionButton = SkillActionButton;
5530
3922
  exports.SkillDetail = SkillDetail;
@@ -5541,39 +3933,27 @@ exports.StepBarFrame = StepBarFrame;
5541
3933
  exports.TaskActivityDialog = TaskActivityDialog;
5542
3934
  exports.TaskActivityTimeline = TaskActivityTimeline;
5543
3935
  exports.TaskRunsDialog = TaskRunsDialog;
5544
- exports.TaskTriggerChip = TaskTriggerChip;
5545
- exports.WORKFLOW_COLUMN_ORDER = WORKFLOW_COLUMN_ORDER;
5546
- exports.WorkflowConfigDialog = WorkflowConfigDialog;
5547
- exports.WorkflowDocumentsField = WorkflowDocumentsField;
5548
- exports.WorkflowLauncher = WorkflowLauncher;
5549
3936
  exports.WorkflowRunner = WorkflowRunner;
5550
3937
  exports.WorkflowStepBar = WorkflowStepBar;
5551
- exports.WorkflowsTable = WorkflowsTable;
5552
3938
  exports.activateOnKey = activateOnKey;
5553
3939
  exports.activeStepId = activeStepId;
5554
3940
  exports.agentConfigSectionToValues = agentConfigSectionToValues;
5555
3941
  exports.agentCreatorToConfigSection = agentCreatorToConfigSection;
5556
3942
  exports.buildLibrarySkills = buildLibrarySkills;
5557
- exports.buildWorkflowScopeSource = buildWorkflowScopeSource;
5558
3943
  exports.buildZipSkillImport = buildZipSkillImport;
5559
3944
  exports.composePersona = composePersona;
5560
- exports.createWorkflowColumns = createWorkflowColumns;
5561
3945
  exports.deriveAgentName = deriveAgentName;
5562
- exports.documentScopeLabels = documentScopeLabels;
5563
3946
  exports.filterLibrarySkills = filterLibrarySkills;
5564
3947
  exports.fromPlanAssignee = fromPlanAssignee;
5565
3948
  exports.fromPlanDocumentRef = fromPlanDocumentRef;
5566
3949
  exports.fromPlanSteps = fromPlanSteps;
5567
- exports.hasTrigger = hasTrigger;
5568
3950
  exports.importMarkdownSkill = importMarkdownSkill;
5569
3951
  exports.importSkillFile = importSkillFile;
5570
3952
  exports.importSkillFromUrl = importSkillFromUrl;
5571
3953
  exports.isIncompleteSignal = isIncompleteSignal;
5572
3954
  exports.isMainSkillFile = isMainSkillFile;
5573
- exports.isSkillRow = isSkillRow;
5574
3955
  exports.isValidAgentName = isValidAgentName;
5575
3956
  exports.layoutFromPlanSteps = layoutFromPlanSteps;
5576
- exports.matchWorkflowScope = matchWorkflowScope;
5577
3957
  exports.parseSkillFrontmatter = parseSkillFrontmatter;
5578
3958
  exports.readSkillArchive = readSkillArchive;
5579
3959
  exports.serializeSkill = serializeSkill;
@@ -5586,11 +3966,8 @@ exports.taskActivityHeadline = taskActivityHeadline;
5586
3966
  exports.toPlanAssignee = toPlanAssignee;
5587
3967
  exports.toPlanDocumentRef = toPlanDocumentRef;
5588
3968
  exports.toPlanSteps = toPlanSteps;
5589
- exports.useControllableState = useControllableState;
5590
3969
  exports.useWorkflowView = useWorkflowView;
5591
3970
  exports.workflowFromSkillMarkdown = workflowFromSkillMarkdown;
5592
- exports.workflowStatus = workflowStatus;
5593
3971
  exports.workflowToSkillMarkdown = workflowToSkillMarkdown;
5594
- exports.workflowTriggerType = workflowTriggerType;
5595
- //# sourceMappingURL=chunk-2UUNSHDI.cjs.map
5596
- //# sourceMappingURL=chunk-2UUNSHDI.cjs.map
3972
+ //# sourceMappingURL=chunk-RB7GX2VT.cjs.map
3973
+ //# sourceMappingURL=chunk-RB7GX2VT.cjs.map