@arbidocs/blocks 0.5.129 → 0.5.131

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 (249) hide show
  1. package/dist/{ConnectedCallDock-XJOYVVAH.cjs → ConnectedCallDock-GJ4LO7I3.cjs} +27 -27
  2. package/dist/{ConnectedCallDock-XJOYVVAH.cjs.map → ConnectedCallDock-GJ4LO7I3.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-CUDYAPQK.cjs → ConnectedCallRoom-SL3GMHO7.cjs} +20 -20
  4. package/dist/{ConnectedCallRoom-CUDYAPQK.cjs.map → ConnectedCallRoom-SL3GMHO7.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxComparison-7KTAOUE3.cjs → ConnectedNativeDocxComparison-OY4RTJKA.cjs} +17 -17
  6. package/dist/{ConnectedNativeDocxComparison-7KTAOUE3.cjs.map → ConnectedNativeDocxComparison-OY4RTJKA.cjs.map} +1 -1
  7. package/dist/{ConnectedPresentation-SI3L77J4.cjs → ConnectedPresentation-5W26JTH6.cjs} +18 -18
  8. package/dist/{ConnectedPresentation-SI3L77J4.cjs.map → ConnectedPresentation-5W26JTH6.cjs.map} +1 -1
  9. package/dist/{ConnectedSlidesTab-E76OVY34.cjs → ConnectedSlidesTab-YS2XRWUC.cjs} +16 -16
  10. package/dist/{ConnectedSlidesTab-E76OVY34.cjs.map → ConnectedSlidesTab-YS2XRWUC.cjs.map} +1 -1
  11. package/dist/{ConnectedStreamedWordArtifact-J4MYBABA.cjs → ConnectedStreamedWordArtifact-6Y24NJON.cjs} +17 -17
  12. package/dist/{ConnectedStreamedWordArtifact-J4MYBABA.cjs.map → ConnectedStreamedWordArtifact-6Y24NJON.cjs.map} +1 -1
  13. package/dist/{DocumentReviewCard-M53XFLI2.cjs → DocumentReviewCard-DIUHU76E.cjs} +16 -16
  14. package/dist/{DocumentReviewCard-M53XFLI2.cjs.map → DocumentReviewCard-DIUHU76E.cjs.map} +1 -1
  15. package/dist/{FilesViewerDialog-GGF4WMU4.cjs → FilesViewerDialog-H6ZXLUO3.cjs} +46 -46
  16. package/dist/{FilesViewerDialog-GGF4WMU4.cjs.map → FilesViewerDialog-H6ZXLUO3.cjs.map} +1 -1
  17. package/dist/{StreamedArtifactEditor-7KJ2HLLU.cjs → StreamedArtifactEditor-RSPUSZ2B.cjs} +5 -5
  18. package/dist/{StreamedArtifactEditor-7KJ2HLLU.cjs.map → StreamedArtifactEditor-RSPUSZ2B.cjs.map} +1 -1
  19. package/dist/{WorkspaceTableView-CUCTCA2O.cjs → WorkspaceTableView-44555T3K.cjs} +9 -9
  20. package/dist/{WorkspaceTableView-CUCTCA2O.cjs.map → WorkspaceTableView-44555T3K.cjs.map} +1 -1
  21. package/dist/agents/index.cjs +377 -377
  22. package/dist/agents/workflows/StepParts.d.ts +3 -0
  23. package/dist/agents/workflows/StepParts.js +20 -3
  24. package/dist/agents/workflows/StepParts.js.map +2 -2
  25. package/dist/agents/workflows/WorkflowStepAction.js +14 -3
  26. package/dist/agents/workflows/WorkflowStepAction.js.map +2 -2
  27. package/dist/agents/workflows/planSteps.js +6 -1
  28. package/dist/agents/workflows/planSteps.js.map +2 -2
  29. package/dist/agents/workflows/workflow.d.ts +11 -2
  30. package/dist/agents/workflows/workflow.js +16 -1
  31. package/dist/agents/workflows/workflow.js.map +2 -2
  32. package/dist/{ai-IEIR7SC2.cjs → ai-V4X2E6Y4.cjs} +31 -31
  33. package/dist/ai-V4X2E6Y4.cjs.map +1 -0
  34. package/dist/artifacts/VersionTimeline.d.ts +5 -1
  35. package/dist/artifacts/VersionTimeline.js +15 -0
  36. package/dist/artifacts/VersionTimeline.js.map +2 -2
  37. package/dist/artifacts/index.cjs +24 -24
  38. package/dist/calls/index.cjs +120 -120
  39. package/dist/chat/index.cjs +58 -58
  40. package/dist/{chunk-SGYSDABK.cjs → chunk-2W5E62EY.cjs} +6 -6
  41. package/dist/{chunk-SGYSDABK.cjs.map → chunk-2W5E62EY.cjs.map} +1 -1
  42. package/dist/{chunk-NY3YUCOW.cjs → chunk-4NPCDS2X.cjs} +3 -3
  43. package/dist/{chunk-NY3YUCOW.cjs.map → chunk-4NPCDS2X.cjs.map} +1 -1
  44. package/dist/{chunk-MLA2BJ2Y.cjs → chunk-4RBQ44RY.cjs} +28 -28
  45. package/dist/{chunk-MLA2BJ2Y.cjs.map → chunk-4RBQ44RY.cjs.map} +1 -1
  46. package/dist/{chunk-BQ5RIWWT.cjs → chunk-4VZZWYEC.cjs} +3 -3
  47. package/dist/{chunk-BQ5RIWWT.cjs.map → chunk-4VZZWYEC.cjs.map} +1 -1
  48. package/dist/{chunk-7JLJH5CW.cjs → chunk-5A6T4W46.cjs} +7 -7
  49. package/dist/{chunk-7JLJH5CW.cjs.map → chunk-5A6T4W46.cjs.map} +1 -1
  50. package/dist/{chunk-WXUU3COI.cjs → chunk-6NT377PS.cjs} +12 -12
  51. package/dist/{chunk-WXUU3COI.cjs.map → chunk-6NT377PS.cjs.map} +1 -1
  52. package/dist/{chunk-ADDQKZ5I.cjs → chunk-734NPQNR.cjs} +4 -4
  53. package/dist/{chunk-ADDQKZ5I.cjs.map → chunk-734NPQNR.cjs.map} +1 -1
  54. package/dist/{chunk-XF355M7O.cjs → chunk-A2YUBDCO.cjs} +17 -17
  55. package/dist/{chunk-XF355M7O.cjs.map → chunk-A2YUBDCO.cjs.map} +1 -1
  56. package/dist/{chunk-IDCD5TEZ.cjs → chunk-A6GBPE5E.cjs} +18 -18
  57. package/dist/{chunk-IDCD5TEZ.cjs.map → chunk-A6GBPE5E.cjs.map} +1 -1
  58. package/dist/{chunk-HH5RDNO5.cjs → chunk-AFG7YCCJ.cjs} +82 -82
  59. package/dist/{chunk-HH5RDNO5.cjs.map → chunk-AFG7YCCJ.cjs.map} +1 -1
  60. package/dist/{chunk-KNGZZC4O.cjs → chunk-B3BZ6MNI.cjs} +6 -6
  61. package/dist/{chunk-KNGZZC4O.cjs.map → chunk-B3BZ6MNI.cjs.map} +1 -1
  62. package/dist/{chunk-I3A6KKWY.cjs → chunk-BAA44UEC.cjs} +114 -104
  63. package/dist/chunk-BAA44UEC.cjs.map +1 -0
  64. package/dist/{chunk-5QERK4PK.cjs → chunk-BVAT4EVC.cjs} +35 -35
  65. package/dist/{chunk-5QERK4PK.cjs.map → chunk-BVAT4EVC.cjs.map} +1 -1
  66. package/dist/{chunk-QGVOT7E4.cjs → chunk-EQTZQD66.cjs} +8 -8
  67. package/dist/{chunk-QGVOT7E4.cjs.map → chunk-EQTZQD66.cjs.map} +1 -1
  68. package/dist/{chunk-M2FOXGJU.cjs → chunk-F6CEPWIF.cjs} +7 -7
  69. package/dist/{chunk-M2FOXGJU.cjs.map → chunk-F6CEPWIF.cjs.map} +1 -1
  70. package/dist/{chunk-VWBYE3XY.cjs → chunk-GKMUXI4V.cjs} +6 -6
  71. package/dist/{chunk-VWBYE3XY.cjs.map → chunk-GKMUXI4V.cjs.map} +1 -1
  72. package/dist/{chunk-XCKHOXRP.cjs → chunk-H4ID6S4P.cjs} +6 -6
  73. package/dist/{chunk-XCKHOXRP.cjs.map → chunk-H4ID6S4P.cjs.map} +1 -1
  74. package/dist/{chunk-7OPOPYV6.cjs → chunk-H5OLHP2U.cjs} +3 -3
  75. package/dist/{chunk-7OPOPYV6.cjs.map → chunk-H5OLHP2U.cjs.map} +1 -1
  76. package/dist/{chunk-L4CIFLCU.cjs → chunk-IIYG542W.cjs} +9 -9
  77. package/dist/{chunk-L4CIFLCU.cjs.map → chunk-IIYG542W.cjs.map} +1 -1
  78. package/dist/{chunk-3IH55CDE.cjs → chunk-IZBAWZTB.cjs} +16 -2
  79. package/dist/chunk-IZBAWZTB.cjs.map +1 -0
  80. package/dist/{chunk-QRAQZTJE.cjs → chunk-JN5YMHGI.cjs} +18 -3
  81. package/dist/chunk-JN5YMHGI.cjs.map +1 -0
  82. package/dist/{chunk-ALK3PUUB.cjs → chunk-JQLWKNJO.cjs} +4 -4
  83. package/dist/{chunk-ALK3PUUB.cjs.map → chunk-JQLWKNJO.cjs.map} +1 -1
  84. package/dist/{chunk-I7J3ED6P.cjs → chunk-KAR326FU.cjs} +4 -4
  85. package/dist/{chunk-I7J3ED6P.cjs.map → chunk-KAR326FU.cjs.map} +1 -1
  86. package/dist/{chunk-GEZB3OEC.cjs → chunk-KUVGR5KE.cjs} +18 -17
  87. package/dist/chunk-KUVGR5KE.cjs.map +1 -0
  88. package/dist/{chunk-ZCU72Q76.cjs → chunk-MEZ7WSW3.cjs} +10 -10
  89. package/dist/{chunk-ZCU72Q76.cjs.map → chunk-MEZ7WSW3.cjs.map} +1 -1
  90. package/dist/{chunk-EG7EJFUE.cjs → chunk-MHIG6GGS.cjs} +17 -2
  91. package/dist/chunk-MHIG6GGS.cjs.map +1 -0
  92. package/dist/{chunk-ENOPKX7E.cjs → chunk-MXBXZXXQ.cjs} +3 -3
  93. package/dist/{chunk-ENOPKX7E.cjs.map → chunk-MXBXZXXQ.cjs.map} +1 -1
  94. package/dist/{chunk-IWHP7FAB.cjs → chunk-NZN7SK4W.cjs} +11 -11
  95. package/dist/{chunk-IWHP7FAB.cjs.map → chunk-NZN7SK4W.cjs.map} +1 -1
  96. package/dist/{chunk-U7D6ZDR2.cjs → chunk-PASJI6JZ.cjs} +140 -80
  97. package/dist/chunk-PASJI6JZ.cjs.map +1 -0
  98. package/dist/{chunk-UFT22LAB.cjs → chunk-PD23GDT7.cjs} +16 -16
  99. package/dist/{chunk-UFT22LAB.cjs.map → chunk-PD23GDT7.cjs.map} +1 -1
  100. package/dist/{chunk-325GVZE6.cjs → chunk-Q6DQGGP4.cjs} +3 -3
  101. package/dist/{chunk-325GVZE6.cjs.map → chunk-Q6DQGGP4.cjs.map} +1 -1
  102. package/dist/{chunk-TP5PGWIO.cjs → chunk-QFXOTJ6G.cjs} +20 -15
  103. package/dist/chunk-QFXOTJ6G.cjs.map +1 -0
  104. package/dist/{chunk-7L4X6QN2.cjs → chunk-QYX2U7TI.cjs} +8 -8
  105. package/dist/{chunk-7L4X6QN2.cjs.map → chunk-QYX2U7TI.cjs.map} +1 -1
  106. package/dist/{chunk-WAV762GP.cjs → chunk-R7IA2F2G.cjs} +6 -6
  107. package/dist/{chunk-WAV762GP.cjs.map → chunk-R7IA2F2G.cjs.map} +1 -1
  108. package/dist/{chunk-JJZOL5MG.cjs → chunk-RYVZDFVO.cjs} +3 -3
  109. package/dist/{chunk-JJZOL5MG.cjs.map → chunk-RYVZDFVO.cjs.map} +1 -1
  110. package/dist/{chunk-XGTMC54Q.cjs → chunk-SHPETTGW.cjs} +4 -4
  111. package/dist/{chunk-XGTMC54Q.cjs.map → chunk-SHPETTGW.cjs.map} +1 -1
  112. package/dist/{chunk-2F57IO7S.cjs → chunk-SZCDYKS4.cjs} +27 -27
  113. package/dist/{chunk-2F57IO7S.cjs.map → chunk-SZCDYKS4.cjs.map} +1 -1
  114. package/dist/{chunk-NQML7IUC.cjs → chunk-TW4RV3QK.cjs} +139 -112
  115. package/dist/chunk-TW4RV3QK.cjs.map +1 -0
  116. package/dist/{chunk-NG2EE7HR.cjs → chunk-UXBFXF26.cjs} +54 -54
  117. package/dist/{chunk-NG2EE7HR.cjs.map → chunk-UXBFXF26.cjs.map} +1 -1
  118. package/dist/{chunk-HSLPFBK2.cjs → chunk-VL7ZX4KQ.cjs} +6 -6
  119. package/dist/{chunk-HSLPFBK2.cjs.map → chunk-VL7ZX4KQ.cjs.map} +1 -1
  120. package/dist/{chunk-7PN3YENO.cjs → chunk-W6B3RYTX.cjs} +4 -4
  121. package/dist/{chunk-7PN3YENO.cjs.map → chunk-W6B3RYTX.cjs.map} +1 -1
  122. package/dist/{chunk-T73BHNQX.cjs → chunk-XKCIDXMP.cjs} +239 -89
  123. package/dist/chunk-XKCIDXMP.cjs.map +1 -0
  124. package/dist/{chunk-5GA65VBW.cjs → chunk-XX5SH4WE.cjs} +11 -11
  125. package/dist/{chunk-5GA65VBW.cjs.map → chunk-XX5SH4WE.cjs.map} +1 -1
  126. package/dist/{chunk-LXFCED4Z.cjs → chunk-Z4O324CO.cjs} +9 -9
  127. package/dist/{chunk-LXFCED4Z.cjs.map → chunk-Z4O324CO.cjs.map} +1 -1
  128. package/dist/{chunk-7NLO7ASW.cjs → chunk-ZEQE4I46.cjs} +18 -18
  129. package/dist/{chunk-7NLO7ASW.cjs.map → chunk-ZEQE4I46.cjs.map} +1 -1
  130. package/dist/connect/docx.cjs +20 -20
  131. package/dist/connect/index.cjs +2729 -1230
  132. package/dist/connect/index.cjs.map +1 -1
  133. package/dist/connect/index.d.ts +2 -0
  134. package/dist/connect/index.js +12 -0
  135. package/dist/connect/index.js.map +2 -2
  136. package/dist/connect/viewer.cjs +33 -33
  137. package/dist/connection/ConnectedWorkflowBuilder.d.ts +12 -0
  138. package/dist/connection/ConnectedWorkflowBuilder.js +6 -1
  139. package/dist/connection/ConnectedWorkflowBuilder.js.map +2 -2
  140. package/dist/connection/assistant/AssistantDrafts.d.ts +21 -0
  141. package/dist/connection/assistant/AssistantDrafts.js +158 -0
  142. package/dist/connection/assistant/AssistantDrafts.js.map +7 -0
  143. package/dist/connection/assistant/AssistantPlan.d.ts +16 -0
  144. package/dist/connection/assistant/AssistantPlan.js +72 -0
  145. package/dist/connection/assistant/AssistantPlan.js.map +7 -0
  146. package/dist/connection/assistant/AssistantStatusPanel.d.ts +28 -0
  147. package/dist/connection/assistant/AssistantStatusPanel.js +206 -0
  148. package/dist/connection/assistant/AssistantStatusPanel.js.map +7 -0
  149. package/dist/connection/assistant/ConnectedAssistantPage.d.ts +39 -0
  150. package/dist/connection/assistant/ConnectedAssistantPage.js +377 -0
  151. package/dist/connection/assistant/ConnectedAssistantPage.js.map +7 -0
  152. package/dist/connection/billing/ChangePlanDialog.d.ts +2 -1
  153. package/dist/connection/billing/ChangePlanDialog.js +8 -3
  154. package/dist/connection/billing/ChangePlanDialog.js.map +2 -2
  155. package/dist/connection/billing/ChangeProPlan.js +4 -4
  156. package/dist/connection/billing/ChangeProPlan.js.map +2 -2
  157. package/dist/connection/billing/CollaboratorPlan.js +5 -3
  158. package/dist/connection/billing/CollaboratorPlan.js.map +2 -2
  159. package/dist/connection/billing/ConnectedWelcomeDialog.d.ts +5 -13
  160. package/dist/connection/billing/ConnectedWelcomeDialog.js +38 -19
  161. package/dist/connection/billing/ConnectedWelcomeDialog.js.map +2 -2
  162. package/dist/connection/billing/MonthlySpendCap.d.ts +10 -3
  163. package/dist/connection/billing/MonthlySpendCap.js +103 -11
  164. package/dist/connection/billing/MonthlySpendCap.js.map +2 -2
  165. package/dist/connection/billing/NewProjectFlow.js +20 -7
  166. package/dist/connection/billing/NewProjectFlow.js.map +2 -2
  167. package/dist/connection/billing/ProjectDetail.js +1 -1
  168. package/dist/connection/billing/ProjectDetail.js.map +2 -2
  169. package/dist/connection/billing/ProjectPurchaseOptions.d.ts +14 -3
  170. package/dist/connection/billing/ProjectPurchaseOptions.js +472 -139
  171. package/dist/connection/billing/ProjectPurchaseOptions.js.map +2 -2
  172. package/dist/connection/billing/ProjectUsageCard.js +4 -4
  173. package/dist/connection/billing/ProjectUsageCard.js.map +2 -2
  174. package/dist/connection/billing/ReduceAddonDialog.js +2 -2
  175. package/dist/connection/billing/ReduceAddonDialog.js.map +2 -2
  176. package/dist/connection/billing/StripeCheckoutModal.js +3 -2
  177. package/dist/connection/billing/StripeCheckoutModal.js.map +2 -2
  178. package/dist/connection/billing/SubscriptionPlans.d.ts +5 -1
  179. package/dist/connection/billing/SubscriptionPlans.js +89 -6
  180. package/dist/connection/billing/SubscriptionPlans.js.map +2 -2
  181. package/dist/connection/billing/index.d.ts +1 -1
  182. package/dist/connection/billing/index.js +2 -2
  183. package/dist/connection/billing/index.js.map +2 -2
  184. package/dist/connection/billing/referral-reward.d.ts +2 -3
  185. package/dist/connection/billing/referral-reward.js +8 -3
  186. package/dist/connection/billing/referral-reward.js.map +2 -2
  187. package/dist/connection/billing/tax-quote.d.ts +2 -2
  188. package/dist/connection/billing/tax-quote.js +1 -0
  189. package/dist/connection/billing/tax-quote.js.map +2 -2
  190. package/dist/connection/contacts/ConnectedAddContacts.d.ts +7 -1
  191. package/dist/connection/contacts/ConnectedAddContacts.js +33 -17
  192. package/dist/connection/contacts/ConnectedAddContacts.js.map +2 -2
  193. package/dist/connection/contacts/ConnectedInviteContactsDialog.js +3 -2
  194. package/dist/connection/contacts/ConnectedInviteContactsDialog.js.map +2 -2
  195. package/dist/connection/contacts/ConnectedWelcomeInvitations.d.ts +6 -0
  196. package/dist/connection/contacts/ConnectedWelcomeInvitations.js +198 -0
  197. package/dist/connection/contacts/ConnectedWelcomeInvitations.js.map +7 -0
  198. package/dist/connection/conversation/AgentSteps.js +19 -2
  199. package/dist/connection/conversation/AgentSteps.js.map +2 -2
  200. package/dist/connection/viewer/ConnectedDocumentViewer.js +22 -2
  201. package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
  202. package/dist/connection/viewer/useDocumentVersionRestore.d.ts +14 -0
  203. package/dist/connection/viewer/useDocumentVersionRestore.js +48 -0
  204. package/dist/connection/viewer/useDocumentVersionRestore.js.map +7 -0
  205. package/dist/connection/viewer/useViewerTabs.d.ts +1 -1
  206. package/dist/connection/viewer/useViewerTabs.js +6 -3
  207. package/dist/connection/viewer/useViewerTabs.js.map +2 -2
  208. package/dist/dashboards/index.cjs +1 -1
  209. package/dist/document-tools/VersionSnapshotBar.d.ts +4 -1
  210. package/dist/document-tools/VersionSnapshotBar.js +14 -0
  211. package/dist/document-tools/VersionSnapshotBar.js.map +2 -2
  212. package/dist/document-tools/index.cjs +13 -13
  213. package/dist/embed/index.cjs +39 -39
  214. package/dist/facts/index.cjs +43 -43
  215. package/dist/files/index.cjs +224 -224
  216. package/dist/index.cjs +1409 -1409
  217. package/dist/office/index.cjs +5 -5
  218. package/dist/settings/Billing.d.ts +2 -2
  219. package/dist/settings/Billing.js +4 -3
  220. package/dist/settings/Billing.js.map +2 -2
  221. package/dist/settings/SubscriptionParts.d.ts +4 -2
  222. package/dist/settings/SubscriptionParts.js +22 -3
  223. package/dist/settings/SubscriptionParts.js.map +2 -2
  224. package/dist/settings/WelcomeDialog.d.ts +31 -4
  225. package/dist/settings/WelcomeDialog.js +221 -82
  226. package/dist/settings/WelcomeDialog.js.map +2 -2
  227. package/dist/settings/index.cjs +147 -147
  228. package/dist/shell/index.cjs +78 -78
  229. package/dist/site/index.cjs +5 -5
  230. package/dist/studio/index.cjs +31 -31
  231. package/dist/styles.css +1 -1
  232. package/dist/workflow-canvas/TriggerInspector.d.ts +7 -0
  233. package/dist/workflow-canvas/TriggerInspector.js +56 -0
  234. package/dist/workflow-canvas/TriggerInspector.js.map +2 -2
  235. package/dist/workflow-canvas/index.cjs +159 -98
  236. package/dist/workflow-canvas/index.cjs.map +1 -1
  237. package/node_modules/@arbidocs/coedit/package.json +1 -1
  238. package/package.json +5 -5
  239. package/src/connection/billing/project-purchase.css +518 -39
  240. package/dist/ai-IEIR7SC2.cjs.map +0 -1
  241. package/dist/chunk-3IH55CDE.cjs.map +0 -1
  242. package/dist/chunk-EG7EJFUE.cjs.map +0 -1
  243. package/dist/chunk-GEZB3OEC.cjs.map +0 -1
  244. package/dist/chunk-I3A6KKWY.cjs.map +0 -1
  245. package/dist/chunk-NQML7IUC.cjs.map +0 -1
  246. package/dist/chunk-QRAQZTJE.cjs.map +0 -1
  247. package/dist/chunk-T73BHNQX.cjs.map +0 -1
  248. package/dist/chunk-TP5PGWIO.cjs.map +0 -1
  249. package/dist/chunk-U7D6ZDR2.cjs.map +0 -1
@@ -32,6 +32,8 @@ export { StreamedArtifact, type StreamedArtifactProps } from '../connection/Stre
32
32
  export { ConnectedWorkflowRunner, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, type ConnectedWorkflowRunnerProps, type ConnectedWorkflowRunnerLabels, type WorkflowRunnerDocument, } from '../connection/ConnectedWorkflowRunner';
33
33
  export { WorkflowRunThread, type WorkflowRunThreadProps } from '../connection/WorkflowRunThread';
34
34
  export { ConnectedTagTable, type ConnectedTagTableProps, type TagTableFilter, type TagTableFilterField, } from '../connection/tags/ConnectedTagTable';
35
+ export { ConnectedAssistantPage, DEFAULT_ASSISTANT_LABELS, type ConnectedAssistantPageLabels, type ConnectedAssistantPageProps, } from '../connection/assistant/ConnectedAssistantPage';
36
+ export { AssistantStatusPanel, DEFAULT_ASSISTANT_STATUS_LABELS, type AssistantStatusLabels, } from '../connection/assistant/AssistantStatusPanel';
35
37
  export { ConnectedTagsPage, type TagsReviewKind } from '../connection/tags/ConnectedTagsPage';
36
38
  export { FACTS_COMPOSE_VIEW, FACTS_FILTER_KEY, FACTS_FOCUS_VIEW, FACTS_GRID_ID, } from '../connection/facts/view-keys';
37
39
  export { ConnectedFactsPage } from '../connection/facts/ConnectedFactsPage';
@@ -97,6 +97,14 @@ import { WorkflowRunThread } from "../connection/WorkflowRunThread.js";
97
97
  import {
98
98
  ConnectedTagTable
99
99
  } from "../connection/tags/ConnectedTagTable.js";
100
+ import {
101
+ ConnectedAssistantPage,
102
+ DEFAULT_ASSISTANT_LABELS
103
+ } from "../connection/assistant/ConnectedAssistantPage.js";
104
+ import {
105
+ AssistantStatusPanel,
106
+ DEFAULT_ASSISTANT_STATUS_LABELS
107
+ } from "../connection/assistant/AssistantStatusPanel.js";
100
108
  import { ConnectedTagsPage } from "../connection/tags/ConnectedTagsPage.js";
101
109
  import {
102
110
  FACTS_COMPOSE_VIEW,
@@ -256,6 +264,7 @@ import {
256
264
  import { useOpenTaggedContent } from "../connection/tags/tagged-content.js";
257
265
  export {
258
266
  ArbiChat,
267
+ AssistantStatusPanel,
259
268
  ChromeInstallDialog,
260
269
  ConnectedAccountAccessBadge,
261
270
  ConnectedAgentChatPanel,
@@ -267,6 +276,7 @@ export {
267
276
  ConnectedAgentsSectionHeading,
268
277
  ConnectedAppShell,
269
278
  ConnectedAssistantDock,
279
+ ConnectedAssistantPage,
270
280
  ConnectedDangerZone,
271
281
  ConnectedDocumentToolsProvider,
272
282
  ConnectedEmbeddedChat,
@@ -312,6 +322,8 @@ export {
312
322
  DEFAULT_AGENTS_PAGE_SECTIONS,
313
323
  DEFAULT_AGENT_CHAT_CARD_LABELS,
314
324
  DEFAULT_ASK_SUGGESTIONS,
325
+ DEFAULT_ASSISTANT_LABELS,
326
+ DEFAULT_ASSISTANT_STATUS_LABELS,
315
327
  DEFAULT_CONNECTED_AGENTS_PAGE_LABELS,
316
328
  DEFAULT_CONNECTED_SKILLS_BROWSER_LABELS,
317
329
  DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/connect/index.ts"],
4
- "sourcesContent": ["/**\n * @arbidocs/blocks/connect: the demo/live connection layer (auth, workspace selection, agent\n * hooks; `defaultHost` for a blocks-only site) and the connected kits. Kept off the root barrel\n * because it needs React Query and the SDK.\n */\nexport {\n type ArbiMode,\n type ConnectionStatus,\n type ArbiUser,\n type AssistantStep,\n type AssistantCitation,\n type AssistantMessage,\n type ArbiConnectionConfig,\n} from '../connection/types'\nexport {\n SESSION_EXPIRED_MESSAGE,\n useConnection,\n useConnectedWorkspace,\n type ConnectedWorkspace,\n isAuthenticated,\n} from '../connection/ConnectionProvider'\nexport { defaultHost, type DefaultHostOptions } from '../connection/defaultHost'\n// The sidebar as the session keeps it, for `useSidebarController`.\nexport { useSessionSidebar } from '../connection/useSessionSidebar'\nexport { ConnectedTaskAccessRequest } from '../connection/ConnectedTaskAccessRequest'\nexport {\n ConnectedWorkspaceActivity,\n type ConnectedWorkspaceActivityProps,\n} from '../connection/ConnectedWorkspaceActivity'\nexport {\n ConnectedWorkspaceActivityPanel,\n DEFAULT_WORKSPACE_ACTIVITY_PANEL_LABELS,\n type ConnectedWorkspaceActivityPanelProps,\n type WorkspaceActivityPanelLabels,\n} from '../connection/ConnectedWorkspaceActivityPanel'\nexport { useOpenWorkspaceActivityTarget } from '../connection/useOpenWorkspaceActivityTarget'\n// The notification centre page (persisted notifications + the session log) and its parts.\nexport * from '../connection/notification-center'\n// Changes made offline that wait to sync\nexport * from '../connection/offline'\nexport {\n ConnectedWorkspaceNotificationMenu,\n ConnectedThreadFollow,\n type ConnectedWorkspaceNotificationMenuProps,\n type ConnectedThreadFollowProps,\n} from '../connection/ConnectedNotificationRelevance'\nexport {\n useConnectedDocuments,\n useListedDocuments,\n useDocumentFilter,\n isListedDocument,\n useConnectedTags,\n useConnectedConversations,\n type ConnectedConversationRow,\n type ConnectedWorkspaceData,\n type ConnectedList,\n type ConnectedListResult,\n type ConnectedDocument,\n type ConnectedTag,\n} from '../connection/workspaceData'\nexport {\n ConnectedWorkflowsTable,\n DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS,\n useConnectedWorkspaceRole,\n type ConnectedWorkflowsTableProps,\n type ConnectedWorkflowsTableLabels,\n} from '../connection/ConnectedWorkflowsTable'\nexport {\n ConnectedWorkflowLauncher,\n ConnectedWorkflowDocumentsField,\n useConnectedWorkflowScopeSource,\n toWorkflowFieldDocument,\n type ConnectedWorkflowLauncherProps,\n type ConnectedWorkflowDocumentsFieldProps,\n} from '../connection/ConnectedWorkflowLauncher'\nexport {\n ConnectedSkillsLibrary,\n type ConnectedSkillsLibraryProps,\n} from '../connection/ConnectedSkillsLibrary'\nexport {\n ConnectedSkillsBrowser,\n DEFAULT_CONNECTED_SKILLS_BROWSER_LABELS,\n type ConnectedSkillsBrowserProps,\n type ConnectedSkillsBrowserLabels,\n} from '../connection/ConnectedSkillsBrowser'\nexport {\n useInstallSkillPackOnSignIn,\n type InstallSkillPackOnSignInOptions,\n} from '../connection/useInstallSkillPackOnSignIn'\nexport { useIsExternalAccount } from '../connection/useIsExternalAccount'\nexport {\n ConnectedAgentCreator,\n type ConnectedAgentCreatorProps,\n type ConnectedAgentCreatorAgent,\n} from '../connection/ConnectedAgentCreator'\nexport {\n useConnectedAgentManagement,\n type AgentManagementLabels,\n type ConnectedAgentManagementOptions,\n} from '../connection/agents/useConnectedAgentManagement'\nexport {\n ConnectedAgentsPage,\n ConnectedAgentsPageScope,\n ConnectedAgentsSection,\n ConnectedAgentsSectionHeading,\n ConnectedAgentsNewTask,\n DEFAULT_AGENTS_PAGE_SECTIONS,\n type ConnectedAgentsPageProps,\n type ConnectedAgentsPageScopeProps,\n type ConnectedAgentsSectionProps,\n type AgentsPageSection,\n type AgentCardDetail,\n type AgentsPageAgentOptions,\n type AgentsPageLauncherOptions,\n type AgentsPageStatAccents,\n type AgentsPageTestIdKey,\n} from '../connection/agents/ConnectedAgentsPage'\nexport {\n DEFAULT_CONNECTED_AGENTS_PAGE_LABELS,\n type ConnectedAgentsPageLabels,\n} from '../connection/agents/agentsPageLabels'\nexport {\n ConnectedWorkflowHistory,\n ConnectedTaskActivityDialog,\n workflowRunView,\n type ConnectedWorkflowHistoryProps,\n type ConnectedTaskActivityDialogProps,\n} from '../connection/ConnectedWorkflowHistory'\nexport {\n ConnectedSkillUpload,\n DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS,\n type ConnectedSkillUploadProps,\n type ConnectedSkillUploadLabels,\n} from '../connection/ConnectedSkillUpload'\nexport {\n useConnectedAiTask,\n useConnectedChat,\n ConnectedAssistantDock,\n useWorkspaceDocs,\n useSemanticSearch,\n toRedlineMarkdown,\n redlineStats,\n textToArtifact,\n type AiTaskStatus,\n type AiRunOptions,\n type SearchChunk,\n type ArtifactEvent,\n} from '../connection/ai'\nexport { StreamedArtifact, type StreamedArtifactProps } from '../connection/StreamedArtifact'\nexport {\n ConnectedWorkflowRunner,\n DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS,\n type ConnectedWorkflowRunnerProps,\n type ConnectedWorkflowRunnerLabels,\n type WorkflowRunnerDocument,\n} from '../connection/ConnectedWorkflowRunner'\nexport { WorkflowRunThread, type WorkflowRunThreadProps } from '../connection/WorkflowRunThread'\nexport {\n ConnectedTagTable,\n type ConnectedTagTableProps,\n type TagTableFilter,\n type TagTableFilterField,\n} from '../connection/tags/ConnectedTagTable'\nexport { ConnectedTagsPage, type TagsReviewKind } from '../connection/tags/ConnectedTagsPage'\nexport {\n FACTS_COMPOSE_VIEW,\n FACTS_FILTER_KEY,\n FACTS_FOCUS_VIEW,\n FACTS_GRID_ID,\n} from '../connection/facts/view-keys'\nexport { ConnectedFactsPage } from '../connection/facts/ConnectedFactsPage'\nexport {\n ConnectedFactsSmartSearch,\n type ConnectedFactsSmartSearchProps,\n} from '../connection/facts/ConnectedFactsSmartSearch'\nexport {\n useConnectedShellWorkspaces,\n type UseConnectedShellWorkspacesOptions,\n} from '../connection/useConnectedShellWorkspaces'\nexport {\n ConnectedProfileCard,\n ConnectedSecuritySection,\n ConnectedPasswordChangeDialog,\n ConnectedNotificationPreferences,\n ConnectedSessionsRow,\n ConnectedLogoutDialog,\n ConnectedDangerZone,\n ConnectedIdentityVerification,\n type ConnectedProfileCardProps,\n type ConnectedSecuritySectionProps,\n type ConnectedPasswordChangeDialogProps,\n type ConnectedNotificationPreferencesProps,\n type ConnectedSessionsRowProps,\n type ConnectedLogoutDialogProps,\n type ConnectedDangerZoneProps,\n type ConnectedIdentityVerificationProps,\n} from '../connection/ConnectedSettings'\n// The settings page: addressable sections (`openSettings(section)`), the connected ones bound to the account\nexport * from '../connection/settings-page'\nexport * from '../connection/storage'\n// A workspace's own settings page (identity, visibility, members, leave)\nexport * from '../connection/workspace-settings'\n// Archiving a workspace and bringing it back: the Archive button, the unarchive dialog, the list's status line\nexport * from '../connection/workspace-archive'\nexport * from '../connection/workspace-form'\n// Connectors: connected apps, mailbox and drive sync settings\nexport * from '../connection/connectors'\n// Billing: projects, plans, usage, add-ons and checkout (Stripe from the host)\nexport * from '../connection/billing'\n// The user's workspaces grouped by project, as cards or a table; the Projects panel\nexport * from '../connection/workspace-list'\nexport * from '../connection/projects'\n// The address book: directory, card editor, .vcf import, add by e-mail, the contact star.\nexport * from '../connection/contacts'\n// The open workspace's home: Start, recent files and threads, facts, the agenda\nexport * from '../connection/workspace-dashboard'\n// The workspace's ask field (ask a new chat, or search the files) and what asking means\nexport * from '../connection/ask'\n// The \u2318K command palette: pages, the built-in actions and the host's, ask and search\nexport * from '../connection/command'\n// Remote control: the consent prompt, the pill, the settings switch and the socket's handler\nexport * from '../connection/remote-control'\n\n// Smart Search: the whole search page\nexport * from '../connection/search'\n\n// Mail: the whole mailbox, and the composer on its own\nexport * from '../connection/mail'\n\n// Secure mail: the page a secure-mail link opens, and the capture of the link's key\nexport * from '../connection/secure-mail'\n\n// Calendar: the whole calendar, its upcoming list, the mail invitation card and the public booking page\nexport * from '../connection/calendar'\n\n// Files: the explorer, and what a host adds to the Files kits\nexport * from '../connection/files'\nexport * from '../connection/databases'\n\n// Export, copy or move: the dialog any list opens, and the watcher that follows a copy or move\nexport * from '../connection/export'\n\n// Chats: the messenger (direct, group and meeting chats), one thread, group members, attachments\nexport * from '../connection/messenger'\n\n// Assistant configuration: the model picker, config forms and the developer's config editor\nexport * from '../connection/config'\n\n// Workspace access requests: the owner's grant dialog (a task's run resumes on a grant)\nexport * from '../connection/workspace-access'\nexport * from '../connection/entities'\nexport * from '../connection/account-cluster'\nexport * from '../connection/runtime'\n// The address bar and the session kept in step through the route codec (`hrefFor` / `parseHref`).\nexport { useDeepLinkSync, type DeepLinkSyncOptions } from '../connection/routes/useDeepLinkSync'\nexport * from '../connection/report-problem'\n// The global dialogs (the dialog registry's kinds), mounted once in the shell.\nexport * from '../connection/dialogs'\n\n// The Threads page's tabs (decision 1), a thread's chip, status and switcher\nexport * from '../connection/threads'\n\n// A thread's tasks: its top bar (a run's steps, its activity, its options) and its activity\nexport * from '../connection/tasks'\n\n// Workflows: definitions, the one launch handler, the launch host and the launcher wired to run\nexport * from '../connection/workflows'\n\n// A conversation's agent steps, live turn bar, sub-agent roster and run stats\nexport * from '../connection/conversation'\n// The chat's context: the composer's documents-and-facts control and its add paths\nexport * from '../connection/chat-context'\n\nexport {\n ConnectedAgentChatPanel,\n DEFAULT_AGENT_CHAT_CARD_LABELS,\n type ConnectedAgentChatPanelProps,\n type AgentChatCardLabels,\n} from '../connection/ConnectedAgentChatPanel'\nexport {\n useDocxCommentTarget,\n useNativeDocxSupport,\n type NativeDocxSupport,\n} from '../connection/docx/support'\n// The PDF document tools on the signed-in session (and the host's binding of them), for a dialog\n// that needs them outside the viewer (a production set).\nexport {\n ConnectedDocumentToolsProvider,\n type DocumentToolsHost,\n} from '../connection/viewer/ConnectedDocumentToolsProvider'\n// The public certificate a signed PDF's signature links to (no sign-in).\nexport {\n ConnectedSignatureVerifyPage,\n type ConnectedSignatureVerifyPageProps,\n} from '../connection/viewer/ConnectedSignatureVerifyPage'\nexport {\n useDocumentViewerSupport,\n useViewerIsDetached,\n useViewerPassageCitation,\n useViewerStreamingDocument,\n type DocumentViewerSupport,\n type PassageCitation,\n type PickedPassage,\n type ViewerDocumentRecord,\n type ViewerStreamingDocument,\n} from '../connection/viewer/support'\nexport { compareDocumentsIn } from '../connection/viewer/compareDocuments'\nexport * from '../connection/auth'\n\nexport { ConnectedSharedFilesPage } from '../connection/viewer/ConnectedSharedFilesPage'\n// Where a link opens a document (a passage, a page) and the one rule every way in uses; the views\n// of the files page's document dialog (`DocumentViewerDialog`).\nexport {\n dialogTabForPlace,\n documentPlaceKey,\n showDocumentPlace,\n type DocumentPlace,\n} from '../connection/viewer/documentPlace'\nexport {\n DEFAULT_ASK_SUGGESTIONS,\n DEFAULT_DOCUMENT_VIEWER_LABELS,\n DEFAULT_DOCUMENT_VIEWER_TABS,\n type DocumentViewerDialogLabels,\n type DocumentViewerTab,\n} from '../connection/viewer/documentViewerTabs'\n\nexport { ConnectedAccountAccessBadge } from '../connection/ConnectedAccountAccessBadge'\nexport {\n ConnectedEntitlementGate,\n type ConnectedEntitlementGateProps,\n} from '../connection/ConnectedEntitlementGate'\n\nexport {\n ConnectedThreadsPage,\n type ConnectedThreadsPageProps,\n} from '../connection/threads-page/ConnectedThreadsPage'\nexport {\n ConnectedPanelHost,\n type ConnectedPanelHostProps,\n} from '../connection/panels/ConnectedPanelHost'\nexport { useSessionPanelMode } from '../connection/panels/useSessionPanelMode'\nexport {\n ConnectedPanelRegistry,\n type ConnectedPanelRegistryProps,\n type PanelRegistration,\n} from '../connection/panels/ConnectedPanelRegistry'\nexport { useMainAreaPanel } from '../connection/panels/useMainAreaPanel'\nexport { useTogglePanel } from '../connection/panels/useTogglePanel'\nexport { usePanelDmTabs, type UsePanelDmTabsOptions } from '../connection/panels/usePanelDmTabs'\n\nexport { ConnectedFilterDropdown } from '../connection/ConnectedFilterDropdown'\nexport * from '../connection/sharing'\nexport * from '../connection/people'\nexport {\n ConnectedAppShell,\n type ConnectedAppShellProps,\n type RoutedShellProps,\n} from '../connection/shell/ConnectedAppShell'\nexport { useAppShell, type AppShellController } from '../connection/shell/app-shell-controller'\nexport {\n ConnectedShellSidebar,\n type ConnectedShellSidebarProps,\n} from '../connection/shell/ConnectedShellSidebar'\nexport {\n ConnectedShellTopbar,\n type ConnectedShellTopbarProps,\n} from '../connection/shell/ConnectedShellTopbar'\nexport { ConnectedShellTabBar } from '../connection/shell/ConnectedShellTabBar'\nexport {\n ConnectedPageRegistry,\n type ConnectedPageRegistryProps,\n type PageRegistration,\n} from '../connection/shell/ConnectedPageRegistry'\nexport type { ShellAccountConfig } from '../connection/shell/ShellAccount'\nexport {\n useShellNavigation,\n type ResolvedShellNavigation,\n type ShellBrand,\n type ShellBrandPlacement,\n type ShellNavigation,\n} from '../connection/shell/shell-navigation'\nexport type {\n RoutedShellChromeProps,\n ShellAskConfig,\n ShellDockConfig,\n ShellToolConfig,\n} from '../connection/shell/RoutedShellChrome'\nexport {\n ConnectedWorkspaceSwitcher,\n type ConnectedWorkspaceSwitcherProps,\n} from '../connection/shell/ConnectedWorkspaceSwitcher'\nexport { workspaceProjectLine } from '../connection/shell/workspace-project-line'\nexport { useContextualHints } from '../connection/tips/useContextualHints'\nexport {\n ConnectedTipBar,\n DEFAULT_TIPS_OFF_LABEL,\n type ConnectedTipBarLabels,\n type ConnectedTipBarProps,\n type TipEditorRenderProps,\n type TipSituation,\n} from '../connection/tips/ConnectedTipBar'\nexport {\n ConnectedGettingStarted,\n type ConnectedGettingStartedProps,\n} from '../connection/tips/ConnectedGettingStarted'\nexport {\n useGettingStarted,\n DEFAULT_GETTING_STARTED_STEPS,\n GETTING_STARTED_DONE_TIP,\n type GettingStartedOptions,\n type GettingStartedState,\n type GettingStartedStep,\n type GettingStartedStepCopy,\n type GettingStartedStepId,\n} from '../connection/tips/useGettingStarted'\n\nexport {\n ArbiChat,\n ConnectedEmbeddedChat,\n EmbeddedChatPanel,\n type ArbiChatProps,\n type ConnectedEmbeddedChatProps,\n type EmbeddedChatPanelProps,\n} from '../connection/embedded/EmbeddedChatPanel'\n// Where an embedded panel keeps its workspace and documents, for the host's own commands to read\n// (the Word add-in's ribbon commands, `@arbidocs/blocks/office`, run in another frame).\nexport { EMBEDDED_SELECTED_DOCS_KEY, SELECTED_WORKSPACE_KEY } from '../connection/embedded/keys'\n\nexport { ChromeInstallDialog } from '../connection/auth/ChromeInstallDialog'\n\nexport {\n THREAD_TAG_FILTER_VIEW,\n type ThreadTagFilter,\n} from '../connection/threads/useThreadTagFilter'\n\nexport { useOpenTaggedContent } from '../connection/tags/tagged-content'\n"],
5
- "mappings": ";AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,mBAA4C;AAErD,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,sCAAsC;AAE/C,cAAc;AAEd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAA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AA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAGP;AAAA,EACE;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,0BAA0B;AACnC,cAAc;AAEd,SAAS,gCAAgC;AAGzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,mCAAmC;AAC5C;AAAA,EACE;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,OAGK;AACP,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,sBAAkD;AAE3D,SAAS,+BAA+B;AACxC,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,OAGK;AACP,SAAS,mBAA4C;AACrD;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,OAKK;AAOP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAGP,SAAS,4BAA4B,8BAA8B;AAEnE,SAAS,2BAA2B;AAEpC;AAAA,EACE;AAAA,OAEK;AAEP,SAAS,4BAA4B;",
4
+ "sourcesContent": ["/**\n * @arbidocs/blocks/connect: the demo/live connection layer (auth, workspace selection, agent\n * hooks; `defaultHost` for a blocks-only site) and the connected kits. Kept off the root barrel\n * because it needs React Query and the SDK.\n */\nexport {\n type ArbiMode,\n type ConnectionStatus,\n type ArbiUser,\n type AssistantStep,\n type AssistantCitation,\n type AssistantMessage,\n type ArbiConnectionConfig,\n} from '../connection/types'\nexport {\n SESSION_EXPIRED_MESSAGE,\n useConnection,\n useConnectedWorkspace,\n type ConnectedWorkspace,\n isAuthenticated,\n} from '../connection/ConnectionProvider'\nexport { defaultHost, type DefaultHostOptions } from '../connection/defaultHost'\n// The sidebar as the session keeps it, for `useSidebarController`.\nexport { useSessionSidebar } from '../connection/useSessionSidebar'\nexport { ConnectedTaskAccessRequest } from '../connection/ConnectedTaskAccessRequest'\nexport {\n ConnectedWorkspaceActivity,\n type ConnectedWorkspaceActivityProps,\n} from '../connection/ConnectedWorkspaceActivity'\nexport {\n ConnectedWorkspaceActivityPanel,\n DEFAULT_WORKSPACE_ACTIVITY_PANEL_LABELS,\n type ConnectedWorkspaceActivityPanelProps,\n type WorkspaceActivityPanelLabels,\n} from '../connection/ConnectedWorkspaceActivityPanel'\nexport { useOpenWorkspaceActivityTarget } from '../connection/useOpenWorkspaceActivityTarget'\n// The notification centre page (persisted notifications + the session log) and its parts.\nexport * from '../connection/notification-center'\n// Changes made offline that wait to sync\nexport * from '../connection/offline'\nexport {\n ConnectedWorkspaceNotificationMenu,\n ConnectedThreadFollow,\n type ConnectedWorkspaceNotificationMenuProps,\n type ConnectedThreadFollowProps,\n} from '../connection/ConnectedNotificationRelevance'\nexport {\n useConnectedDocuments,\n useListedDocuments,\n useDocumentFilter,\n isListedDocument,\n useConnectedTags,\n useConnectedConversations,\n type ConnectedConversationRow,\n type ConnectedWorkspaceData,\n type ConnectedList,\n type ConnectedListResult,\n type ConnectedDocument,\n type ConnectedTag,\n} from '../connection/workspaceData'\nexport {\n ConnectedWorkflowsTable,\n DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS,\n useConnectedWorkspaceRole,\n type ConnectedWorkflowsTableProps,\n type ConnectedWorkflowsTableLabels,\n} from '../connection/ConnectedWorkflowsTable'\nexport {\n ConnectedWorkflowLauncher,\n ConnectedWorkflowDocumentsField,\n useConnectedWorkflowScopeSource,\n toWorkflowFieldDocument,\n type ConnectedWorkflowLauncherProps,\n type ConnectedWorkflowDocumentsFieldProps,\n} from '../connection/ConnectedWorkflowLauncher'\nexport {\n ConnectedSkillsLibrary,\n type ConnectedSkillsLibraryProps,\n} from '../connection/ConnectedSkillsLibrary'\nexport {\n ConnectedSkillsBrowser,\n DEFAULT_CONNECTED_SKILLS_BROWSER_LABELS,\n type ConnectedSkillsBrowserProps,\n type ConnectedSkillsBrowserLabels,\n} from '../connection/ConnectedSkillsBrowser'\nexport {\n useInstallSkillPackOnSignIn,\n type InstallSkillPackOnSignInOptions,\n} from '../connection/useInstallSkillPackOnSignIn'\nexport { useIsExternalAccount } from '../connection/useIsExternalAccount'\nexport {\n ConnectedAgentCreator,\n type ConnectedAgentCreatorProps,\n type ConnectedAgentCreatorAgent,\n} from '../connection/ConnectedAgentCreator'\nexport {\n useConnectedAgentManagement,\n type AgentManagementLabels,\n type ConnectedAgentManagementOptions,\n} from '../connection/agents/useConnectedAgentManagement'\nexport {\n ConnectedAgentsPage,\n ConnectedAgentsPageScope,\n ConnectedAgentsSection,\n ConnectedAgentsSectionHeading,\n ConnectedAgentsNewTask,\n DEFAULT_AGENTS_PAGE_SECTIONS,\n type ConnectedAgentsPageProps,\n type ConnectedAgentsPageScopeProps,\n type ConnectedAgentsSectionProps,\n type AgentsPageSection,\n type AgentCardDetail,\n type AgentsPageAgentOptions,\n type AgentsPageLauncherOptions,\n type AgentsPageStatAccents,\n type AgentsPageTestIdKey,\n} from '../connection/agents/ConnectedAgentsPage'\nexport {\n DEFAULT_CONNECTED_AGENTS_PAGE_LABELS,\n type ConnectedAgentsPageLabels,\n} from '../connection/agents/agentsPageLabels'\nexport {\n ConnectedWorkflowHistory,\n ConnectedTaskActivityDialog,\n workflowRunView,\n type ConnectedWorkflowHistoryProps,\n type ConnectedTaskActivityDialogProps,\n} from '../connection/ConnectedWorkflowHistory'\nexport {\n ConnectedSkillUpload,\n DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS,\n type ConnectedSkillUploadProps,\n type ConnectedSkillUploadLabels,\n} from '../connection/ConnectedSkillUpload'\nexport {\n useConnectedAiTask,\n useConnectedChat,\n ConnectedAssistantDock,\n useWorkspaceDocs,\n useSemanticSearch,\n toRedlineMarkdown,\n redlineStats,\n textToArtifact,\n type AiTaskStatus,\n type AiRunOptions,\n type SearchChunk,\n type ArtifactEvent,\n} from '../connection/ai'\nexport { StreamedArtifact, type StreamedArtifactProps } from '../connection/StreamedArtifact'\nexport {\n ConnectedWorkflowRunner,\n DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS,\n type ConnectedWorkflowRunnerProps,\n type ConnectedWorkflowRunnerLabels,\n type WorkflowRunnerDocument,\n} from '../connection/ConnectedWorkflowRunner'\nexport { WorkflowRunThread, type WorkflowRunThreadProps } from '../connection/WorkflowRunThread'\nexport {\n ConnectedTagTable,\n type ConnectedTagTableProps,\n type TagTableFilter,\n type TagTableFilterField,\n} from '../connection/tags/ConnectedTagTable'\nexport {\n ConnectedAssistantPage,\n DEFAULT_ASSISTANT_LABELS,\n type ConnectedAssistantPageLabels,\n type ConnectedAssistantPageProps,\n} from '../connection/assistant/ConnectedAssistantPage'\nexport {\n AssistantStatusPanel,\n DEFAULT_ASSISTANT_STATUS_LABELS,\n type AssistantStatusLabels,\n} from '../connection/assistant/AssistantStatusPanel'\nexport { ConnectedTagsPage, type TagsReviewKind } from '../connection/tags/ConnectedTagsPage'\nexport {\n FACTS_COMPOSE_VIEW,\n FACTS_FILTER_KEY,\n FACTS_FOCUS_VIEW,\n FACTS_GRID_ID,\n} from '../connection/facts/view-keys'\nexport { ConnectedFactsPage } from '../connection/facts/ConnectedFactsPage'\nexport {\n ConnectedFactsSmartSearch,\n type ConnectedFactsSmartSearchProps,\n} from '../connection/facts/ConnectedFactsSmartSearch'\nexport {\n useConnectedShellWorkspaces,\n type UseConnectedShellWorkspacesOptions,\n} from '../connection/useConnectedShellWorkspaces'\nexport {\n ConnectedProfileCard,\n ConnectedSecuritySection,\n ConnectedPasswordChangeDialog,\n ConnectedNotificationPreferences,\n ConnectedSessionsRow,\n ConnectedLogoutDialog,\n ConnectedDangerZone,\n ConnectedIdentityVerification,\n type ConnectedProfileCardProps,\n type ConnectedSecuritySectionProps,\n type ConnectedPasswordChangeDialogProps,\n type ConnectedNotificationPreferencesProps,\n type ConnectedSessionsRowProps,\n type ConnectedLogoutDialogProps,\n type ConnectedDangerZoneProps,\n type ConnectedIdentityVerificationProps,\n} from '../connection/ConnectedSettings'\n// The settings page: addressable sections (`openSettings(section)`), the connected ones bound to the account\nexport * from '../connection/settings-page'\nexport * from '../connection/storage'\n// A workspace's own settings page (identity, visibility, members, leave)\nexport * from '../connection/workspace-settings'\n// Archiving a workspace and bringing it back: the Archive button, the unarchive dialog, the list's status line\nexport * from '../connection/workspace-archive'\nexport * from '../connection/workspace-form'\n// Connectors: connected apps, mailbox and drive sync settings\nexport * from '../connection/connectors'\n// Billing: projects, plans, usage, add-ons and checkout (Stripe from the host)\nexport * from '../connection/billing'\n// The user's workspaces grouped by project, as cards or a table; the Projects panel\nexport * from '../connection/workspace-list'\nexport * from '../connection/projects'\n// The address book: directory, card editor, .vcf import, add by e-mail, the contact star.\nexport * from '../connection/contacts'\n// The open workspace's home: Start, recent files and threads, facts, the agenda\nexport * from '../connection/workspace-dashboard'\n// The workspace's ask field (ask a new chat, or search the files) and what asking means\nexport * from '../connection/ask'\n// The \u2318K command palette: pages, the built-in actions and the host's, ask and search\nexport * from '../connection/command'\n// Remote control: the consent prompt, the pill, the settings switch and the socket's handler\nexport * from '../connection/remote-control'\n\n// Smart Search: the whole search page\nexport * from '../connection/search'\n\n// Mail: the whole mailbox, and the composer on its own\nexport * from '../connection/mail'\n\n// Secure mail: the page a secure-mail link opens, and the capture of the link's key\nexport * from '../connection/secure-mail'\n\n// Calendar: the whole calendar, its upcoming list, the mail invitation card and the public booking page\nexport * from '../connection/calendar'\n\n// Files: the explorer, and what a host adds to the Files kits\nexport * from '../connection/files'\nexport * from '../connection/databases'\n\n// Export, copy or move: the dialog any list opens, and the watcher that follows a copy or move\nexport * from '../connection/export'\n\n// Chats: the messenger (direct, group and meeting chats), one thread, group members, attachments\nexport * from '../connection/messenger'\n\n// Assistant configuration: the model picker, config forms and the developer's config editor\nexport * from '../connection/config'\n\n// Workspace access requests: the owner's grant dialog (a task's run resumes on a grant)\nexport * from '../connection/workspace-access'\nexport * from '../connection/entities'\nexport * from '../connection/account-cluster'\nexport * from '../connection/runtime'\n// The address bar and the session kept in step through the route codec (`hrefFor` / `parseHref`).\nexport { useDeepLinkSync, type DeepLinkSyncOptions } from '../connection/routes/useDeepLinkSync'\nexport * from '../connection/report-problem'\n// The global dialogs (the dialog registry's kinds), mounted once in the shell.\nexport * from '../connection/dialogs'\n\n// The Threads page's tabs (decision 1), a thread's chip, status and switcher\nexport * from '../connection/threads'\n\n// A thread's tasks: its top bar (a run's steps, its activity, its options) and its activity\nexport * from '../connection/tasks'\n\n// Workflows: definitions, the one launch handler, the launch host and the launcher wired to run\nexport * from '../connection/workflows'\n\n// A conversation's agent steps, live turn bar, sub-agent roster and run stats\nexport * from '../connection/conversation'\n// The chat's context: the composer's documents-and-facts control and its add paths\nexport * from '../connection/chat-context'\n\nexport {\n ConnectedAgentChatPanel,\n DEFAULT_AGENT_CHAT_CARD_LABELS,\n type ConnectedAgentChatPanelProps,\n type AgentChatCardLabels,\n} from '../connection/ConnectedAgentChatPanel'\nexport {\n useDocxCommentTarget,\n useNativeDocxSupport,\n type NativeDocxSupport,\n} from '../connection/docx/support'\n// The PDF document tools on the signed-in session (and the host's binding of them), for a dialog\n// that needs them outside the viewer (a production set).\nexport {\n ConnectedDocumentToolsProvider,\n type DocumentToolsHost,\n} from '../connection/viewer/ConnectedDocumentToolsProvider'\n// The public certificate a signed PDF's signature links to (no sign-in).\nexport {\n ConnectedSignatureVerifyPage,\n type ConnectedSignatureVerifyPageProps,\n} from '../connection/viewer/ConnectedSignatureVerifyPage'\nexport {\n useDocumentViewerSupport,\n useViewerIsDetached,\n useViewerPassageCitation,\n useViewerStreamingDocument,\n type DocumentViewerSupport,\n type PassageCitation,\n type PickedPassage,\n type ViewerDocumentRecord,\n type ViewerStreamingDocument,\n} from '../connection/viewer/support'\nexport { compareDocumentsIn } from '../connection/viewer/compareDocuments'\nexport * from '../connection/auth'\n\nexport { ConnectedSharedFilesPage } from '../connection/viewer/ConnectedSharedFilesPage'\n// Where a link opens a document (a passage, a page) and the one rule every way in uses; the views\n// of the files page's document dialog (`DocumentViewerDialog`).\nexport {\n dialogTabForPlace,\n documentPlaceKey,\n showDocumentPlace,\n type DocumentPlace,\n} from '../connection/viewer/documentPlace'\nexport {\n DEFAULT_ASK_SUGGESTIONS,\n DEFAULT_DOCUMENT_VIEWER_LABELS,\n DEFAULT_DOCUMENT_VIEWER_TABS,\n type DocumentViewerDialogLabels,\n type DocumentViewerTab,\n} from '../connection/viewer/documentViewerTabs'\n\nexport { ConnectedAccountAccessBadge } from '../connection/ConnectedAccountAccessBadge'\nexport {\n ConnectedEntitlementGate,\n type ConnectedEntitlementGateProps,\n} from '../connection/ConnectedEntitlementGate'\n\nexport {\n ConnectedThreadsPage,\n type ConnectedThreadsPageProps,\n} from '../connection/threads-page/ConnectedThreadsPage'\nexport {\n ConnectedPanelHost,\n type ConnectedPanelHostProps,\n} from '../connection/panels/ConnectedPanelHost'\nexport { useSessionPanelMode } from '../connection/panels/useSessionPanelMode'\nexport {\n ConnectedPanelRegistry,\n type ConnectedPanelRegistryProps,\n type PanelRegistration,\n} from '../connection/panels/ConnectedPanelRegistry'\nexport { useMainAreaPanel } from '../connection/panels/useMainAreaPanel'\nexport { useTogglePanel } from '../connection/panels/useTogglePanel'\nexport { usePanelDmTabs, type UsePanelDmTabsOptions } from '../connection/panels/usePanelDmTabs'\n\nexport { ConnectedFilterDropdown } from '../connection/ConnectedFilterDropdown'\nexport * from '../connection/sharing'\nexport * from '../connection/people'\nexport {\n ConnectedAppShell,\n type ConnectedAppShellProps,\n type RoutedShellProps,\n} from '../connection/shell/ConnectedAppShell'\nexport { useAppShell, type AppShellController } from '../connection/shell/app-shell-controller'\nexport {\n ConnectedShellSidebar,\n type ConnectedShellSidebarProps,\n} from '../connection/shell/ConnectedShellSidebar'\nexport {\n ConnectedShellTopbar,\n type ConnectedShellTopbarProps,\n} from '../connection/shell/ConnectedShellTopbar'\nexport { ConnectedShellTabBar } from '../connection/shell/ConnectedShellTabBar'\nexport {\n ConnectedPageRegistry,\n type ConnectedPageRegistryProps,\n type PageRegistration,\n} from '../connection/shell/ConnectedPageRegistry'\nexport type { ShellAccountConfig } from '../connection/shell/ShellAccount'\nexport {\n useShellNavigation,\n type ResolvedShellNavigation,\n type ShellBrand,\n type ShellBrandPlacement,\n type ShellNavigation,\n} from '../connection/shell/shell-navigation'\nexport type {\n RoutedShellChromeProps,\n ShellAskConfig,\n ShellDockConfig,\n ShellToolConfig,\n} from '../connection/shell/RoutedShellChrome'\nexport {\n ConnectedWorkspaceSwitcher,\n type ConnectedWorkspaceSwitcherProps,\n} from '../connection/shell/ConnectedWorkspaceSwitcher'\nexport { workspaceProjectLine } from '../connection/shell/workspace-project-line'\nexport { useContextualHints } from '../connection/tips/useContextualHints'\nexport {\n ConnectedTipBar,\n DEFAULT_TIPS_OFF_LABEL,\n type ConnectedTipBarLabels,\n type ConnectedTipBarProps,\n type TipEditorRenderProps,\n type TipSituation,\n} from '../connection/tips/ConnectedTipBar'\nexport {\n ConnectedGettingStarted,\n type ConnectedGettingStartedProps,\n} from '../connection/tips/ConnectedGettingStarted'\nexport {\n useGettingStarted,\n DEFAULT_GETTING_STARTED_STEPS,\n GETTING_STARTED_DONE_TIP,\n type GettingStartedOptions,\n type GettingStartedState,\n type GettingStartedStep,\n type GettingStartedStepCopy,\n type GettingStartedStepId,\n} from '../connection/tips/useGettingStarted'\n\nexport {\n ArbiChat,\n ConnectedEmbeddedChat,\n EmbeddedChatPanel,\n type ArbiChatProps,\n type ConnectedEmbeddedChatProps,\n type EmbeddedChatPanelProps,\n} from '../connection/embedded/EmbeddedChatPanel'\n// Where an embedded panel keeps its workspace and documents, for the host's own commands to read\n// (the Word add-in's ribbon commands, `@arbidocs/blocks/office`, run in another frame).\nexport { EMBEDDED_SELECTED_DOCS_KEY, SELECTED_WORKSPACE_KEY } from '../connection/embedded/keys'\n\nexport { ChromeInstallDialog } from '../connection/auth/ChromeInstallDialog'\n\nexport {\n THREAD_TAG_FILTER_VIEW,\n type ThreadTagFilter,\n} from '../connection/threads/useThreadTagFilter'\n\nexport { useOpenTaggedContent } from '../connection/tags/tagged-content'\n"],
5
+ "mappings": ";AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,mBAA4C;AAErD,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,sCAAsC;AAE/C,cAAc;AAEd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAUK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAC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AA0B;AACnC,cAAc;AAEd,SAAS,gCAAgC;AAGzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,mCAAmC;AAC5C;AAAA,EACE;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,OAGK;AACP,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,sBAAkD;AAE3D,SAAS,+BAA+B;AACxC,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,OAGK;AACP,SAAS,mBAA4C;AACrD;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,OAKK;AAOP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAGP,SAAS,4BAA4B,8BAA8B;AAEnE,SAAS,2BAA2B;AAEpC;AAAA,EACE;AAAA,OAEK;AAEP,SAAS,4BAA4B;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkU7D6ZDR2_cjs = require('../chunk-U7D6ZDR2.cjs');
4
+ var chunkPASJI6JZ_cjs = require('../chunk-PASJI6JZ.cjs');
5
5
  require('../chunk-JITYC4OS.cjs');
6
6
  require('../chunk-WVZLAAIZ.cjs');
7
7
  require('../chunk-X7ALF4MP.cjs');
@@ -9,20 +9,20 @@ require('../chunk-4CIVQWAX.cjs');
9
9
  var chunkPL7HUTM3_cjs = require('../chunk-PL7HUTM3.cjs');
10
10
  require('../chunk-QWVUBTW3.cjs');
11
11
  require('../chunk-JVEDKKNO.cjs');
12
- require('../chunk-ADDQKZ5I.cjs');
12
+ require('../chunk-734NPQNR.cjs');
13
13
  require('../chunk-CNLIXB6S.cjs');
14
- require('../chunk-5QERK4PK.cjs');
15
- require('../chunk-T73BHNQX.cjs');
14
+ require('../chunk-BVAT4EVC.cjs');
15
+ require('../chunk-XKCIDXMP.cjs');
16
16
  require('../chunk-HYUKPHCT.cjs');
17
- require('../chunk-ALK3PUUB.cjs');
17
+ require('../chunk-JQLWKNJO.cjs');
18
18
  require('../chunk-223D4727.cjs');
19
19
  require('../chunk-SNUBQMIS.cjs');
20
- require('../chunk-5GA65VBW.cjs');
21
- require('../chunk-P5AQYC4D.cjs');
22
- require('../chunk-WAV762GP.cjs');
20
+ require('../chunk-XX5SH4WE.cjs');
23
21
  require('../chunk-4ONPEVTP.cjs');
24
22
  require('../chunk-V3KLUWQQ.cjs');
25
- require('../chunk-3IH55CDE.cjs');
23
+ require('../chunk-P5AQYC4D.cjs');
24
+ require('../chunk-R7IA2F2G.cjs');
25
+ require('../chunk-IZBAWZTB.cjs');
26
26
  require('../chunk-GNZAH6UI.cjs');
27
27
  require('../chunk-JH6JTI76.cjs');
28
28
  require('../chunk-QQMMCXBP.cjs');
@@ -30,58 +30,58 @@ require('../chunk-DTMBAFIL.cjs');
30
30
  require('../chunk-ZESMRGDV.cjs');
31
31
  require('../chunk-VCEX7COE.cjs');
32
32
  require('../chunk-34HQO4ZQ.cjs');
33
- require('../chunk-IWHP7FAB.cjs');
33
+ require('../chunk-NZN7SK4W.cjs');
34
34
  require('../chunk-K4763GD5.cjs');
35
35
  require('../chunk-2RLA6QO2.cjs');
36
36
  require('../chunk-MZZ3SBQL.cjs');
37
- require('../chunk-NY3YUCOW.cjs');
38
- require('../chunk-325GVZE6.cjs');
37
+ require('../chunk-4NPCDS2X.cjs');
38
+ require('../chunk-Q6DQGGP4.cjs');
39
39
  require('../chunk-WQMR3O2D.cjs');
40
40
  require('../chunk-ORELHENJ.cjs');
41
41
  require('../chunk-NWNVWO6L.cjs');
42
42
  require('../chunk-SK6HQ46Q.cjs');
43
43
  require('../chunk-TG2GM7WJ.cjs');
44
44
  require('../chunk-ZYGAXD3N.cjs');
45
+ require('../chunk-CT3SLXB7.cjs');
46
+ require('../chunk-DEXUL3T6.cjs');
47
+ require('../chunk-AFQTQC7A.cjs');
48
+ require('../chunk-XJEXFEWG.cjs');
49
+ require('../chunk-Z2XZ2D4N.cjs');
50
+ require('../chunk-YZSQ7F5K.cjs');
51
+ require('../chunk-MCXS6X37.cjs');
52
+ require('../chunk-KQF7POTG.cjs');
53
+ require('../chunk-75BNMCUX.cjs');
45
54
  require('../chunk-OEJQFPWO.cjs');
46
55
  require('../chunk-OYXWQTHF.cjs');
47
56
  require('../chunk-S237ORM3.cjs');
48
57
  require('../chunk-II2OEXHW.cjs');
49
- require('../chunk-JJZOL5MG.cjs');
58
+ require('../chunk-RYVZDFVO.cjs');
50
59
  require('../chunk-3YEXZX4H.cjs');
51
60
  require('../chunk-4PA6VCCR.cjs');
52
- require('../chunk-WXUU3COI.cjs');
61
+ require('../chunk-6NT377PS.cjs');
53
62
  require('../chunk-AHDJXIUB.cjs');
54
- require('../chunk-YVCOQHCE.cjs');
55
63
  require('../chunk-RL2HI6NP.cjs');
56
64
  require('../chunk-6UZC4XVV.cjs');
57
- require('../chunk-VZOOGA47.cjs');
65
+ require('../chunk-YVCOQHCE.cjs');
66
+ require('../chunk-FX3K6LNZ.cjs');
67
+ require('../chunk-EQTZQD66.cjs');
68
+ require('../chunk-JN5YMHGI.cjs');
69
+ require('../chunk-UDSHVNU3.cjs');
58
70
  require('../chunk-JV5TVUOU.cjs');
71
+ require('../chunk-IPSHAMO2.cjs');
59
72
  require('../chunk-ZVEW3JBT.cjs');
60
- require('../chunk-EG7EJFUE.cjs');
73
+ require('../chunk-MHIG6GGS.cjs');
61
74
  require('../chunk-VG24E4JJ.cjs');
62
75
  require('../chunk-U2FFG2B3.cjs');
63
76
  require('../chunk-KKYNTWDU.cjs');
64
77
  require('../chunk-M74FWYNL.cjs');
78
+ require('../chunk-VZOOGA47.cjs');
65
79
  require('../chunk-HQDR43JC.cjs');
66
80
  require('../chunk-JR2YSBD5.cjs');
67
81
  require('../chunk-3YZKDCWY.cjs');
68
82
  require('../chunk-SJSGSHIT.cjs');
69
- require('../chunk-ZW6FPIFC.cjs');
70
- require('../chunk-CT3SLXB7.cjs');
71
- require('../chunk-DEXUL3T6.cjs');
72
- require('../chunk-AFQTQC7A.cjs');
73
- require('../chunk-XJEXFEWG.cjs');
74
- require('../chunk-Z2XZ2D4N.cjs');
75
- require('../chunk-YZSQ7F5K.cjs');
76
- require('../chunk-MCXS6X37.cjs');
77
- require('../chunk-KQF7POTG.cjs');
78
- require('../chunk-75BNMCUX.cjs');
79
- require('../chunk-FX3K6LNZ.cjs');
80
- require('../chunk-QGVOT7E4.cjs');
81
- require('../chunk-QRAQZTJE.cjs');
82
- require('../chunk-UDSHVNU3.cjs');
83
- require('../chunk-IPSHAMO2.cjs');
84
83
  require('../chunk-PPCATBOY.cjs');
84
+ require('../chunk-ZW6FPIFC.cjs');
85
85
  require('../chunk-LJJJ6CYH.cjs');
86
86
  require('../chunk-MNIQDXM6.cjs');
87
87
  require('../chunk-E3Y7RI3J.cjs');
@@ -94,7 +94,7 @@ require('../chunk-PLIF5CUV.cjs');
94
94
 
95
95
  Object.defineProperty(exports, "ConnectedDocumentViewer", {
96
96
  enumerable: true,
97
- get: function () { return chunkU7D6ZDR2_cjs.ConnectedDocumentViewer; }
97
+ get: function () { return chunkPASJI6JZ_cjs.ConnectedDocumentViewer; }
98
98
  });
99
99
  Object.defineProperty(exports, "ConnectedDocumentToolsProvider", {
100
100
  enumerable: true,
@@ -7,6 +7,7 @@
7
7
  * Saved and failed are told through the environment's `notify`. Exported from
8
8
  * `@arbidocs/blocks/workflow-canvas` (it brings the graph library).
9
9
  */
10
+ import type { components } from '@arbidocs/client';
10
11
  import { type StepComposeOptions, type WorkflowDefinition } from '../agents';
11
12
  import { type WorkflowBuilderProps } from '../workflow-canvas/WorkflowBuilder';
12
13
  import { type WorkflowBuilderValue } from '../workflow-canvas/trigger';
@@ -39,6 +40,11 @@ export declare function scheduledTaskBuilderValue(): WorkflowBuilderValue;
39
40
  * so scheduled tasks don't all share one name. Others are returned as they are.
40
41
  */
41
42
  export declare function withTitleFromPrompt(value: WorkflowBuilderValue): WorkflowBuilderValue;
43
+ /**
44
+ * A workspace event a workflow can start on: a notification type (what the API's `event_kind` check
45
+ * accepts), except those the workflow engine emits itself, which the API refuses as a trigger (422).
46
+ */
47
+ export type WorkflowEventKind = Exclude<components['schemas']['NotificationType'], 'workflow_failed'> | 'document_activity' | 'mail_document_received';
42
48
  /** Workspace events a workflow can start on (notification types), in plain words. */
43
49
  export declare const DEFAULT_WORKFLOW_EVENT_KINDS: ({
44
50
  value: "conversation_done";
@@ -58,6 +64,12 @@ export declare const DEFAULT_WORKFLOW_EVENT_KINDS: ({
58
64
  } | {
59
65
  value: "document_processed";
60
66
  label: string;
67
+ } | {
68
+ value: "document_activity";
69
+ label: string;
70
+ } | {
71
+ value: "mail_document_received";
72
+ label: string;
61
73
  })[];
62
74
  export interface ConnectedWorkflowBuilderProps extends Pick<StepComposeOptions, 'compose'>, Pick<WorkflowBuilderProps, 'renderIcon' | 'labels' | 'canvasLabels' | 'inspectorLabels' | 'triggerLabels' | 'testId' | 'className'> {
63
75
  /** A saved workflow to edit (`wfl-…`). */
@@ -105,7 +105,12 @@ const DEFAULT_WORKFLOW_EVENT_KINDS = [
105
105
  { value: "workflow_completed", label: "Another workflow finishes" },
106
106
  { value: "workflow_signal", label: "When a step signals" },
107
107
  // Filter on {"language": "other", "wp_type": "source"} to act on every non-English upload (e.g. Translate).
108
- { value: "document_processed", label: "A document finishes processing" }
108
+ { value: "document_processed", label: "A document finishes processing" },
109
+ {
110
+ value: "document_activity",
111
+ label: "Someone else saves a new version of your document"
112
+ },
113
+ { value: "mail_document_received", label: "An email arrives from a sender" }
109
114
  ];
110
115
  function ConnectedWorkflowBuilder({
111
116
  workflowId,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/connection/ConnectedWorkflowBuilder.tsx"],
4
- "sourcesContent": ["/**\n * The workflow builder bound to the connection: it loads a saved workflow (or starts from the\n * host's value), offers the host's workflows and the user's skills as steps an agent can run, its\n * agents, the people, labels, documents, events and tasks a workflow can use, and saves the\n * workflow (its trigger and its steps) or runs it now. An unattended workflow that keeps standing\n * access gives its agent the workspace once saved. Every run is a work thread that runs the steps.\n * Saved and failed are told through the environment's `notify`. Exported from\n * `@arbidocs/blocks/workflow-canvas` (it brings the graph library).\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useWorkspaceUsers,\n useSkills,\n useUpdateWorkflow,\n useWorkflows,\n} from '@arbidocs/react'\nimport type { components } from '@arbidocs/client'\nimport { Button } from '@arbidocs/react/ui'\nimport { Loader2, Play, Save } from 'lucide-react'\nimport { mergeSkillWorkflows, type StepComposeOptions, type WorkflowDefinition } from '../agents'\nimport { DEFAULT_RECURRENCE, buildRRule } from '../agents/tasks/rrule'\nimport { stepConfigProblems, validateWorkflowGraph, workflowSteps } from '../agents/workflows/run'\nimport { WorkflowBuilder, type WorkflowBuilderProps } from '../workflow-canvas/WorkflowBuilder'\nimport {\n DEFAULT_WORKFLOW_TRIGGER,\n builderToWorkflowRequest,\n builderToWorkflowUpdate,\n declaredSignals,\n triggerProblem,\n workflowRecordToBuilder,\n type WorkflowBuilderValue,\n} from '../workflow-canvas/trigger'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations, useConnectedTags, useListedDocuments } from './workspaceData'\n\nconst NO_WORKFLOWS: WorkflowDefinition[] = []\n\nexport interface ConnectedWorkflowBuilderLabels {\n save: string\n saving: string\n runNow: string\n /** The notification once saved. */\n saved: string\n needTrigger: string\n running: string\n /** Notified when saving (or the after-save step) fails without a message. */\n saveFailed: string\n /** Notified when \"Run now\" fails without a message. */\n runFailed: string\n /** A task (to start after) without a title. */\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS: ConnectedWorkflowBuilderLabels = {\n save: 'Save',\n saving: 'Saving\u2026',\n runNow: 'Run now',\n saved: 'Workflow saved',\n needTrigger: 'Finish setting when it starts.',\n running: 'Starting\u2026',\n saveFailed: 'Could not save the workflow',\n runFailed: 'Could not run the workflow',\n untitledTask: 'Untitled thread',\n}\n\n/** Where a new workflow starts: started by hand, one agent step to fill in. */\nexport function newWorkflowBuilderValue(): WorkflowBuilderValue {\n return {\n workflow: {\n id: 'new',\n title: 'New workflow',\n description: '',\n inputs: [],\n landing: 'chat',\n schedulable: false,\n run: {\n kind: 'steps',\n steps: [\n {\n id: 'work',\n kind: 'agent',\n title: 'Do the work',\n run: { kind: 'prompt', promptTemplate: '' },\n },\n ],\n },\n },\n trigger: DEFAULT_WORKFLOW_TRIGGER,\n }\n}\n\n/**\n * Where \"Schedule a task\" starts: a workflow that repeats on a schedule, with one agent step whose\n * prompt is the task, on the default recurrence (changed in the builder). It has no title: saved,\n * it is named from the task's first words (`withTitleFromPrompt`). Every run is a thread.\n */\nexport function scheduledTaskBuilderValue(): WorkflowBuilderValue {\n const value = newWorkflowBuilderValue()\n return {\n workflow: {\n ...value.workflow,\n title: '',\n run: {\n kind: 'steps',\n steps: [\n {\n id: 'work',\n kind: 'agent',\n title: 'The task',\n run: { kind: 'prompt', promptTemplate: '' },\n },\n ],\n },\n },\n trigger: { ...value.trigger, start: 'repeat', rrule: buildRRule(DEFAULT_RECURRENCE) },\n }\n}\n\n/** Words of the task a workflow without a title is named after. */\nconst TITLE_WORDS = 6\n\n/**\n * A workflow left without a title is named from its first agent step's prompt (its first words),\n * so scheduled tasks don't all share one name. Others are returned as they are.\n */\nexport function withTitleFromPrompt(value: WorkflowBuilderValue): WorkflowBuilderValue {\n if (value.workflow.title.trim()) return value\n const steps = value.workflow.run.kind === 'steps' ? value.workflow.run.steps : []\n const prompt = steps.flatMap((s) => {\n if (s.kind !== 'agent') return []\n const { run } = s\n return run && 'promptTemplate' in run ? [run.promptTemplate] : []\n })[0]\n const words = (prompt ?? '').trim().split(/\\s+/).filter(Boolean)\n const title = words.slice(0, TITLE_WORDS).join(' ') + (words.length > TITLE_WORDS ? '\u2026' : '')\n return { ...value, workflow: { ...value.workflow, title: title || 'Scheduled task' } }\n}\n\n/**\n * A workspace event a workflow can start on: a notification type (what the API's `event_kind` check\n * accepts), except those the workflow engine emits itself, which the API refuses as a trigger (422).\n */\ntype WorkflowEventKind = Exclude<components['schemas']['NotificationType'], 'workflow_failed'>\n\n/** Workspace events a workflow can start on (notification types), in plain words. */\nexport const DEFAULT_WORKFLOW_EVENT_KINDS = [\n { value: 'conversation_done', label: 'A task is marked done' },\n { value: 'conversation_ready', label: 'Work is ready for me' },\n { value: 'mention', label: 'Someone mentions me' },\n { value: 'workflow_completed', label: 'Another workflow finishes' },\n { value: 'workflow_signal', label: 'When a step signals' },\n // Filter on {\"language\": \"other\", \"wp_type\": \"source\"} to act on every non-English upload (e.g. Translate).\n { value: 'document_processed', label: 'A document finishes processing' },\n] satisfies Array<{ value: WorkflowEventKind; label: string }>\n\nexport interface ConnectedWorkflowBuilderProps\n extends\n Pick<StepComposeOptions, 'compose'>,\n Pick<\n WorkflowBuilderProps,\n | 'renderIcon'\n | 'labels'\n | 'canvasLabels'\n | 'inspectorLabels'\n | 'triggerLabels'\n | 'testId'\n | 'className'\n > {\n /** A saved workflow to edit (`wfl-\u2026`). */\n workflowId?: string\n /** Where a new workflow starts (e.g. a built-in journey). Default: one agent step. */\n initial?: WorkflowBuilderValue\n /**\n * Host workflows agent steps can run besides the user's skills (e.g. its built-ins with their own\n * forms); an uploaded skill of the same id is used instead (`mergeSkillWorkflows`).\n */\n workflows?: WorkflowDefinition[]\n eventKinds?: Array<{ value: string; label: string }>\n /**\n * Saved (created or updated, the agent's standing access granted): its id and the value saved.\n * It may return a promise for host setup that must finish first: \"Save\" waits for it before\n * telling saved, and \"Run now\" waits for it before running, and does not run if it rejects.\n */\n onSaved?: (workflowId: string, value: WorkflowBuilderValue) => void | Promise<void>\n /** A run started: its thread. Default: open it (the environment's `openConversation`). */\n onRun?: (conversationId: string | undefined) => void\n connectedLabels?: Partial<ConnectedWorkflowBuilderLabels>\n}\n\nexport function ConnectedWorkflowBuilder({\n workflowId,\n initial = newWorkflowBuilderValue(),\n workflows: hostWorkflows = NO_WORKFLOWS,\n eventKinds = DEFAULT_WORKFLOW_EVENT_KINDS,\n compose,\n onSaved,\n onRun,\n connectedLabels,\n testId = 'workflow-builder',\n ...builderProps\n}: ConnectedWorkflowBuilderProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS, ...connectedLabels }\n const { notify, openConversation } = useBlocksEnvironment()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const members = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const { data: tagList } = useConnectedTags()\n const { data: docList } = useListedDocuments()\n const people = (members.data ?? []).map((m) => ({\n value: m.user.external_id,\n label: [m.user.given_name, m.user.family_name].filter(Boolean).join(' ') || m.user.email,\n }))\n const tagOptions = tagList.map((t) => ({ value: t.external_id, label: t.name }))\n const documentOptions = docList.map((d) => ({\n value: d.external_id,\n label: d.file_name ?? d.external_id,\n }))\n const saved = useWorkflows()\n const skills = useSkills()\n const agentsQuery = useAgents()\n const { data: conversations } = useConnectedConversations()\n const create = useCreateWorkflow()\n const update = useUpdateWorkflow()\n const run = useRunWorkflow()\n const grantAccess = useGrantAgentAccess()\n const [id, setId] = useState(workflowId)\n const [value, setValue] = useState<WorkflowBuilderValue>(initial)\n // Which button is working, and where it is: saving covers the host's after-save step too.\n const [pending, setPending] = useState<{ action: 'save' | 'run'; phase: 'saving' | 'running' }>()\n\n // A saved workflow opens as it was saved.\n const record = saved.data?.find((w) => w.external_id === id)\n const [loaded, setLoaded] = useState<string | undefined>(undefined)\n useEffect(() => {\n if (record && loaded !== record.external_id) {\n setValue(workflowRecordToBuilder(record))\n setLoaded(record.external_id)\n }\n }, [record, loaded])\n\n const workflows = useMemo(() => {\n const merged = mergeSkillWorkflows(hostWorkflows, skills.data ?? [])\n return [...merged.host, ...merged.skills]\n }, [hostWorkflows, skills.data])\n const agents = (agentsQuery.data ?? []).map((a) => ({\n id: a.external_id,\n label: a.given_name || a.email,\n }))\n const tasks = conversations\n .filter((c) => c.status && c.status !== 'done')\n .map((c) => ({ value: c.external_id, label: c.title || l.untitledTask }))\n const options = { resolveWorkflow: (wid: string) => workflows.find((w) => w.id === wid), compose }\n\n const problem =\n triggerProblem(value.trigger) ??\n (validateWorkflowGraph(workflowSteps(value.workflow)).length ||\n stepConfigProblems(workflowSteps(value.workflow)).length\n ? 'graph'\n : null)\n const busy = !!pending || create.isPending || update.isPending || run.isPending\n\n /**\n * Save; then, when unattended starts keep standing access, give the agent (the one picked, else\n * the one the server assigned) the workspace, so a run started next already has it; then the\n * host's after-save step. Throws if any of them fails.\n */\n const save = async (): Promise<string | undefined> => {\n if (!workspaceId) return undefined\n const named = withTitleFromPrompt(value)\n const result = id\n ? await update.mutateAsync({ workflowId: id, patch: builderToWorkflowUpdate(named, options) })\n : await create.mutateAsync(builderToWorkflowRequest(named, workspaceId, options))\n if (named !== value) setValue(named)\n setId(result.external_id)\n setLoaded(result.external_id)\n const { trigger } = value\n const agentId = trigger.agentId || result.agent_ext_id\n // Standing access only: an expiring membership (an earlier \"Allow access\") is not, and a run\n // relying on it would park asking for access again. Granting upgrades it to standing.\n const hasStanding = (members.data ?? []).some(\n (m) => m.user.external_id === agentId && !m.is_temporary\n )\n if (trigger.start !== 'manual' && trigger.access === 'standing' && agentId && !hasStanding) {\n await ensureWorkspaceOpen()\n await grantAccess.mutateAsync({ agentExtId: agentId, workspaceId })\n }\n await onSaved?.(result.external_id, named)\n return result.external_id\n }\n\n const attempt = async (andRun: boolean) => {\n setPending({ action: andRun ? 'run' : 'save', phase: 'saving' })\n try {\n const savedId = await save()\n if (!savedId) return\n if (!andRun) {\n notify(l.saved, 'success')\n return\n }\n setPending({ action: 'run', phase: 'running' })\n const started = await run.mutateAsync(savedId)\n if (started.error) throw new Error(started.error)\n const conversationId = started.conversation_ext_id ?? undefined\n if (onRun) onRun(conversationId)\n else if (conversationId) openConversation(conversationId)\n } catch (e) {\n notify(\n e instanceof Error && e.message ? e.message : andRun ? l.runFailed : l.saveFailed,\n 'error'\n )\n } finally {\n setPending(undefined)\n }\n }\n\n return (\n <WorkflowBuilder\n {...builderProps}\n value={value}\n onChange={setValue}\n workflows={workflows}\n agents={agents}\n eventKinds={eventKinds}\n tasks={tasks}\n people={people}\n tags={tagOptions}\n documents={documentOptions}\n signals={declaredSignals(saved.data ?? [])}\n compose={compose}\n testId={testId}\n actions={\n <>\n {problem && problem !== 'graph' && (\n <span className=\"text-xs text-destructive\">{l.needTrigger}</span>\n )}\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!!problem || busy || !workspaceId}\n onClick={() => void attempt(true)}\n data-testid={`${testId}-run`}\n >\n {pending?.action === 'run' ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Play className=\"size-4\" />\n )}\n {pending?.action === 'run'\n ? pending.phase === 'saving'\n ? l.saving\n : l.running\n : l.runNow}\n </Button>\n <Button\n size=\"sm\"\n disabled={!!problem || busy || !workspaceId}\n onClick={() => void attempt(false)}\n data-testid={`${testId}-save`}\n >\n {pending?.action === 'save' ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n {pending?.action === 'save' ? l.saving : l.save}\n </Button>\n </>\n }\n />\n )\n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AAAA,QAC7C;AAAA,SACF;AAAA;AAAA,EAEJ;AAEJ;",
4
+ "sourcesContent": ["/**\n * The workflow builder bound to the connection: it loads a saved workflow (or starts from the\n * host's value), offers the host's workflows and the user's skills as steps an agent can run, its\n * agents, the people, labels, documents, events and tasks a workflow can use, and saves the\n * workflow (its trigger and its steps) or runs it now. An unattended workflow that keeps standing\n * access gives its agent the workspace once saved. Every run is a work thread that runs the steps.\n * Saved and failed are told through the environment's `notify`. Exported from\n * `@arbidocs/blocks/workflow-canvas` (it brings the graph library).\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useWorkspaceUsers,\n useSkills,\n useUpdateWorkflow,\n useWorkflows,\n} from '@arbidocs/react'\nimport type { components } from '@arbidocs/client'\nimport { Button } from '@arbidocs/react/ui'\nimport { Loader2, Play, Save } from 'lucide-react'\nimport { mergeSkillWorkflows, type StepComposeOptions, type WorkflowDefinition } from '../agents'\nimport { DEFAULT_RECURRENCE, buildRRule } from '../agents/tasks/rrule'\nimport { stepConfigProblems, validateWorkflowGraph, workflowSteps } from '../agents/workflows/run'\nimport { WorkflowBuilder, type WorkflowBuilderProps } from '../workflow-canvas/WorkflowBuilder'\nimport {\n DEFAULT_WORKFLOW_TRIGGER,\n builderToWorkflowRequest,\n builderToWorkflowUpdate,\n declaredSignals,\n triggerProblem,\n workflowRecordToBuilder,\n type WorkflowBuilderValue,\n} from '../workflow-canvas/trigger'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations, useConnectedTags, useListedDocuments } from './workspaceData'\n\nconst NO_WORKFLOWS: WorkflowDefinition[] = []\n\nexport interface ConnectedWorkflowBuilderLabels {\n save: string\n saving: string\n runNow: string\n /** The notification once saved. */\n saved: string\n needTrigger: string\n running: string\n /** Notified when saving (or the after-save step) fails without a message. */\n saveFailed: string\n /** Notified when \"Run now\" fails without a message. */\n runFailed: string\n /** A task (to start after) without a title. */\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS: ConnectedWorkflowBuilderLabels = {\n save: 'Save',\n saving: 'Saving\u2026',\n runNow: 'Run now',\n saved: 'Workflow saved',\n needTrigger: 'Finish setting when it starts.',\n running: 'Starting\u2026',\n saveFailed: 'Could not save the workflow',\n runFailed: 'Could not run the workflow',\n untitledTask: 'Untitled thread',\n}\n\n/** Where a new workflow starts: started by hand, one agent step to fill in. */\nexport function newWorkflowBuilderValue(): WorkflowBuilderValue {\n return {\n workflow: {\n id: 'new',\n title: 'New workflow',\n description: '',\n inputs: [],\n landing: 'chat',\n schedulable: false,\n run: {\n kind: 'steps',\n steps: [\n {\n id: 'work',\n kind: 'agent',\n title: 'Do the work',\n run: { kind: 'prompt', promptTemplate: '' },\n },\n ],\n },\n },\n trigger: DEFAULT_WORKFLOW_TRIGGER,\n }\n}\n\n/**\n * Where \"Schedule a task\" starts: a workflow that repeats on a schedule, with one agent step whose\n * prompt is the task, on the default recurrence (changed in the builder). It has no title: saved,\n * it is named from the task's first words (`withTitleFromPrompt`). Every run is a thread.\n */\nexport function scheduledTaskBuilderValue(): WorkflowBuilderValue {\n const value = newWorkflowBuilderValue()\n return {\n workflow: {\n ...value.workflow,\n title: '',\n run: {\n kind: 'steps',\n steps: [\n {\n id: 'work',\n kind: 'agent',\n title: 'The task',\n run: { kind: 'prompt', promptTemplate: '' },\n },\n ],\n },\n },\n trigger: { ...value.trigger, start: 'repeat', rrule: buildRRule(DEFAULT_RECURRENCE) },\n }\n}\n\n/** Words of the task a workflow without a title is named after. */\nconst TITLE_WORDS = 6\n\n/**\n * A workflow left without a title is named from its first agent step's prompt (its first words),\n * so scheduled tasks don't all share one name. Others are returned as they are.\n */\nexport function withTitleFromPrompt(value: WorkflowBuilderValue): WorkflowBuilderValue {\n if (value.workflow.title.trim()) return value\n const steps = value.workflow.run.kind === 'steps' ? value.workflow.run.steps : []\n const prompt = steps.flatMap((s) => {\n if (s.kind !== 'agent') return []\n const { run } = s\n return run && 'promptTemplate' in run ? [run.promptTemplate] : []\n })[0]\n const words = (prompt ?? '').trim().split(/\\s+/).filter(Boolean)\n const title = words.slice(0, TITLE_WORDS).join(' ') + (words.length > TITLE_WORDS ? '\u2026' : '')\n return { ...value, workflow: { ...value.workflow, title: title || 'Scheduled task' } }\n}\n\n/**\n * A workspace event a workflow can start on: a notification type (what the API's `event_kind` check\n * accepts), except those the workflow engine emits itself, which the API refuses as a trigger (422).\n */\nexport type WorkflowEventKind =\n | Exclude<components['schemas']['NotificationType'], 'workflow_failed'>\n // Accepted by the API since the mail-arrival trigger; the generated schema catches up on the next regeneration.\n | 'document_activity'\n | 'mail_document_received'\n\n/** Workspace events a workflow can start on (notification types), in plain words. */\nexport const DEFAULT_WORKFLOW_EVENT_KINDS = [\n { value: 'conversation_done', label: 'A task is marked done' },\n { value: 'conversation_ready', label: 'Work is ready for me' },\n { value: 'mention', label: 'Someone mentions me' },\n { value: 'workflow_completed', label: 'Another workflow finishes' },\n { value: 'workflow_signal', label: 'When a step signals' },\n // Filter on {\"language\": \"other\", \"wp_type\": \"source\"} to act on every non-English upload (e.g. Translate).\n { value: 'document_processed', label: 'A document finishes processing' },\n {\n value: 'document_activity',\n label: 'Someone else saves a new version of your document',\n },\n { value: 'mail_document_received', label: 'An email arrives from a sender' },\n] satisfies Array<{ value: WorkflowEventKind; label: string }>\n\nexport interface ConnectedWorkflowBuilderProps\n extends\n Pick<StepComposeOptions, 'compose'>,\n Pick<\n WorkflowBuilderProps,\n | 'renderIcon'\n | 'labels'\n | 'canvasLabels'\n | 'inspectorLabels'\n | 'triggerLabels'\n | 'testId'\n | 'className'\n > {\n /** A saved workflow to edit (`wfl-\u2026`). */\n workflowId?: string\n /** Where a new workflow starts (e.g. a built-in journey). Default: one agent step. */\n initial?: WorkflowBuilderValue\n /**\n * Host workflows agent steps can run besides the user's skills (e.g. its built-ins with their own\n * forms); an uploaded skill of the same id is used instead (`mergeSkillWorkflows`).\n */\n workflows?: WorkflowDefinition[]\n eventKinds?: Array<{ value: string; label: string }>\n /**\n * Saved (created or updated, the agent's standing access granted): its id and the value saved.\n * It may return a promise for host setup that must finish first: \"Save\" waits for it before\n * telling saved, and \"Run now\" waits for it before running, and does not run if it rejects.\n */\n onSaved?: (workflowId: string, value: WorkflowBuilderValue) => void | Promise<void>\n /** A run started: its thread. Default: open it (the environment's `openConversation`). */\n onRun?: (conversationId: string | undefined) => void\n connectedLabels?: Partial<ConnectedWorkflowBuilderLabels>\n}\n\nexport function ConnectedWorkflowBuilder({\n workflowId,\n initial = newWorkflowBuilderValue(),\n workflows: hostWorkflows = NO_WORKFLOWS,\n eventKinds = DEFAULT_WORKFLOW_EVENT_KINDS,\n compose,\n onSaved,\n onRun,\n connectedLabels,\n testId = 'workflow-builder',\n ...builderProps\n}: ConnectedWorkflowBuilderProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS, ...connectedLabels }\n const { notify, openConversation } = useBlocksEnvironment()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const members = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const { data: tagList } = useConnectedTags()\n const { data: docList } = useListedDocuments()\n const people = (members.data ?? []).map((m) => ({\n value: m.user.external_id,\n label: [m.user.given_name, m.user.family_name].filter(Boolean).join(' ') || m.user.email,\n }))\n const tagOptions = tagList.map((t) => ({ value: t.external_id, label: t.name }))\n const documentOptions = docList.map((d) => ({\n value: d.external_id,\n label: d.file_name ?? d.external_id,\n }))\n const saved = useWorkflows()\n const skills = useSkills()\n const agentsQuery = useAgents()\n const { data: conversations } = useConnectedConversations()\n const create = useCreateWorkflow()\n const update = useUpdateWorkflow()\n const run = useRunWorkflow()\n const grantAccess = useGrantAgentAccess()\n const [id, setId] = useState(workflowId)\n const [value, setValue] = useState<WorkflowBuilderValue>(initial)\n // Which button is working, and where it is: saving covers the host's after-save step too.\n const [pending, setPending] = useState<{ action: 'save' | 'run'; phase: 'saving' | 'running' }>()\n\n // A saved workflow opens as it was saved.\n const record = saved.data?.find((w) => w.external_id === id)\n const [loaded, setLoaded] = useState<string | undefined>(undefined)\n useEffect(() => {\n if (record && loaded !== record.external_id) {\n setValue(workflowRecordToBuilder(record))\n setLoaded(record.external_id)\n }\n }, [record, loaded])\n\n const workflows = useMemo(() => {\n const merged = mergeSkillWorkflows(hostWorkflows, skills.data ?? [])\n return [...merged.host, ...merged.skills]\n }, [hostWorkflows, skills.data])\n const agents = (agentsQuery.data ?? []).map((a) => ({\n id: a.external_id,\n label: a.given_name || a.email,\n }))\n const tasks = conversations\n .filter((c) => c.status && c.status !== 'done')\n .map((c) => ({ value: c.external_id, label: c.title || l.untitledTask }))\n const options = { resolveWorkflow: (wid: string) => workflows.find((w) => w.id === wid), compose }\n\n const problem =\n triggerProblem(value.trigger) ??\n (validateWorkflowGraph(workflowSteps(value.workflow)).length ||\n stepConfigProblems(workflowSteps(value.workflow)).length\n ? 'graph'\n : null)\n const busy = !!pending || create.isPending || update.isPending || run.isPending\n\n /**\n * Save; then, when unattended starts keep standing access, give the agent (the one picked, else\n * the one the server assigned) the workspace, so a run started next already has it; then the\n * host's after-save step. Throws if any of them fails.\n */\n const save = async (): Promise<string | undefined> => {\n if (!workspaceId) return undefined\n const named = withTitleFromPrompt(value)\n const result = id\n ? await update.mutateAsync({ workflowId: id, patch: builderToWorkflowUpdate(named, options) })\n : await create.mutateAsync(builderToWorkflowRequest(named, workspaceId, options))\n if (named !== value) setValue(named)\n setId(result.external_id)\n setLoaded(result.external_id)\n const { trigger } = value\n const agentId = trigger.agentId || result.agent_ext_id\n // Standing access only: an expiring membership (an earlier \"Allow access\") is not, and a run\n // relying on it would park asking for access again. Granting upgrades it to standing.\n const hasStanding = (members.data ?? []).some(\n (m) => m.user.external_id === agentId && !m.is_temporary\n )\n if (trigger.start !== 'manual' && trigger.access === 'standing' && agentId && !hasStanding) {\n await ensureWorkspaceOpen()\n await grantAccess.mutateAsync({ agentExtId: agentId, workspaceId })\n }\n await onSaved?.(result.external_id, named)\n return result.external_id\n }\n\n const attempt = async (andRun: boolean) => {\n setPending({ action: andRun ? 'run' : 'save', phase: 'saving' })\n try {\n const savedId = await save()\n if (!savedId) return\n if (!andRun) {\n notify(l.saved, 'success')\n return\n }\n setPending({ action: 'run', phase: 'running' })\n const started = await run.mutateAsync(savedId)\n if (started.error) throw new Error(started.error)\n const conversationId = started.conversation_ext_id ?? undefined\n if (onRun) onRun(conversationId)\n else if (conversationId) openConversation(conversationId)\n } catch (e) {\n notify(\n e instanceof Error && e.message ? e.message : andRun ? l.runFailed : l.saveFailed,\n 'error'\n )\n } finally {\n setPending(undefined)\n }\n }\n\n return (\n <WorkflowBuilder\n {...builderProps}\n value={value}\n onChange={setValue}\n workflows={workflows}\n agents={agents}\n eventKinds={eventKinds}\n tasks={tasks}\n people={people}\n tags={tagOptions}\n documents={documentOptions}\n signals={declaredSignals(saved.data ?? [])}\n compose={compose}\n testId={testId}\n actions={\n <>\n {problem && problem !== 'graph' && (\n <span className=\"text-xs text-destructive\">{l.needTrigger}</span>\n )}\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!!problem || busy || !workspaceId}\n onClick={() => void attempt(true)}\n data-testid={`${testId}-run`}\n >\n {pending?.action === 'run' ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Play className=\"size-4\" />\n )}\n {pending?.action === 'run'\n ? pending.phase === 'saving'\n ? l.saving\n : l.running\n : l.runNow}\n </Button>\n <Button\n size=\"sm\"\n disabled={!!problem || busy || !workspaceId}\n onClick={() => void attempt(false)}\n data-testid={`${testId}-save`}\n >\n {pending?.action === 'save' ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n {pending?.action === 'save' ? l.saving : l.save}\n </Button>\n </>\n }\n />\n )\n}\n"],
5
+ "mapp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zC,oBAAC,QAAK,WAAU,UAAS;AAAA,cAE1B,SAAS,WAAW,SAAS,EAAE,SAAS,EAAE;AAAA;AAAA;AAAA,QAC7C;AAAA,SACF;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,21 @@
1
+ import type { AssistantArrival } from '@arbidocs/sdk/browser';
2
+ export interface AssistantDraftLabels {
3
+ draftInGmail: string;
4
+ draftInArbiMail: string;
5
+ openDraft: string;
6
+ noSubject: string;
7
+ messageTo: (name: string) => string;
8
+ send: string;
9
+ sent: string;
10
+ openChat: string;
11
+ sendFailed: string;
12
+ /** The message went out but could not be recorded as sent. */
13
+ sentNotRecorded: string;
14
+ }
15
+ export declare const DEFAULT_ASSISTANT_DRAFT_LABELS: AssistantDraftLabels;
16
+ export declare function AssistantDrafts({ arrival, labels, workspaceId, }: {
17
+ arrival: AssistantArrival;
18
+ labels: AssistantDraftLabels;
19
+ /** The workspace whose activity list shows the arrival (refreshed when a message is sent). */
20
+ workspaceId: string | null | undefined;
21
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,158 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { refusalReason } from "@arbidocs/sdk/browser";
5
+ import { useChatPost, useMarkMessageDraftSent } from "@arbidocs/react";
6
+ import { Button, Textarea } from "@arbidocs/react/ui";
7
+ import { useBlocksEnvironment } from "../../provider/environment.js";
8
+ import { gmailLink } from "../../agents/workflows/workflow.js";
9
+ const DEFAULT_ASSISTANT_DRAFT_LABELS = {
10
+ draftInGmail: "Draft in Gmail",
11
+ draftInArbiMail: "Draft in ARBI Mail",
12
+ openDraft: "Open draft",
13
+ noSubject: "(no subject)",
14
+ messageTo: (name) => `Message to ${name}`,
15
+ send: "Send",
16
+ sent: "Sent",
17
+ openChat: "Open chat",
18
+ sendFailed: "Could not send the message",
19
+ sentNotRecorded: "The message was sent, but it may be offered again"
20
+ };
21
+ function MessageDraftRow({
22
+ workspaceId,
23
+ arrivalId,
24
+ index,
25
+ draft,
26
+ labels
27
+ }) {
28
+ const { notify, openDirectChat } = useBlocksEnvironment();
29
+ const post = useChatPost();
30
+ const markSent = useMarkMessageDraftSent(workspaceId);
31
+ const [text, setText] = useState(draft.text);
32
+ const [state, setState] = useState("idle");
33
+ const sent = state === "sent" || !!draft.sent_at;
34
+ const key = `${arrivalId}-${index}`;
35
+ const send = async () => {
36
+ setState("sending");
37
+ try {
38
+ await post({ chat: null, peerExtId: draft.to_user_ext_id }, { text: text.trim() });
39
+ } catch (err) {
40
+ setState("idle");
41
+ notify(refusalReason(err, labels.sendFailed), "error");
42
+ return;
43
+ }
44
+ setState("sent");
45
+ markSent.mutate(
46
+ { arrivalExtId: arrivalId, index },
47
+ { onError: () => notify(labels.sentNotRecorded, "error") }
48
+ );
49
+ };
50
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-2", "data-testid": `assistant-message-draft-${key}`, children: [
51
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: labels.messageTo(draft.to_name || draft.to_user_ext_id) }),
52
+ /* @__PURE__ */ jsx(
53
+ Textarea,
54
+ {
55
+ rows: 3,
56
+ value: text,
57
+ disabled: sent || state !== "idle",
58
+ onChange: (e) => setText(e.target.value),
59
+ "data-testid": `assistant-message-text-${key}`
60
+ }
61
+ ),
62
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
63
+ sent ? /* @__PURE__ */ jsx(
64
+ "span",
65
+ {
66
+ className: "text-sm text-muted-foreground",
67
+ "data-testid": `assistant-message-sent-${key}`,
68
+ children: labels.sent
69
+ }
70
+ ) : /* @__PURE__ */ jsx(
71
+ Button,
72
+ {
73
+ size: "sm",
74
+ disabled: state === "sending" || !text.trim(),
75
+ onClick: send,
76
+ "data-testid": `assistant-message-send-${key}`,
77
+ children: labels.send
78
+ }
79
+ ),
80
+ openDirectChat && /* @__PURE__ */ jsx(
81
+ Button,
82
+ {
83
+ variant: "ghost",
84
+ size: "sm",
85
+ onClick: () => openDirectChat(draft.to_user_ext_id),
86
+ "data-testid": `assistant-message-open-chat-${key}`,
87
+ children: labels.openChat
88
+ }
89
+ )
90
+ ] })
91
+ ] });
92
+ }
93
+ function AssistantDrafts({
94
+ arrival,
95
+ labels,
96
+ workspaceId
97
+ }) {
98
+ const { openMail } = useBlocksEnvironment();
99
+ const emails = arrival.email_drafts ?? [];
100
+ const messages = arrival.message_drafts ?? [];
101
+ if (!emails.length && !messages.length) return null;
102
+ const id = arrival.external_id;
103
+ return /* @__PURE__ */ jsxs("div", { className: "mt-2 space-y-3 border-t pt-2", "data-testid": `assistant-drafts-${id}`, children: [
104
+ emails.map((email, i) => {
105
+ const gmail = email.provider === "gmail";
106
+ const link = gmail ? gmailLink(email.url) : void 0;
107
+ const subject = email.subject || labels.noSubject;
108
+ return /* @__PURE__ */ jsxs(
109
+ "div",
110
+ {
111
+ className: "flex flex-wrap items-center gap-2 text-sm",
112
+ "data-testid": `assistant-email-draft-${id}-${i}`,
113
+ children: [
114
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: gmail ? labels.draftInGmail : labels.draftInArbiMail }),
115
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-muted-foreground", children: subject }),
116
+ link ? /* @__PURE__ */ jsx(
117
+ "a",
118
+ {
119
+ href: link,
120
+ target: "_blank",
121
+ rel: "noopener noreferrer",
122
+ className: "text-primary underline",
123
+ "data-testid": `assistant-email-link-${id}-${i}`,
124
+ children: labels.openDraft
125
+ }
126
+ ) : !gmail && openMail && /* @__PURE__ */ jsx(
127
+ Button,
128
+ {
129
+ variant: "outline",
130
+ size: "sm",
131
+ onClick: () => openMail({ draftId: email.draft_id }),
132
+ "data-testid": `assistant-email-open-${id}-${i}`,
133
+ children: labels.openDraft
134
+ }
135
+ )
136
+ ]
137
+ },
138
+ `${email.draft_id}-${i}`
139
+ );
140
+ }),
141
+ messages.map((draft, i) => /* @__PURE__ */ jsx(
142
+ MessageDraftRow,
143
+ {
144
+ workspaceId,
145
+ arrivalId: id,
146
+ index: i,
147
+ draft,
148
+ labels
149
+ },
150
+ `${draft.to_user_ext_id}-${i}`
151
+ ))
152
+ ] });
153
+ }
154
+ export {
155
+ AssistantDrafts,
156
+ DEFAULT_ASSISTANT_DRAFT_LABELS
157
+ };
158
+ //# sourceMappingURL=AssistantDrafts.js.map