@arbidocs/blocks 0.4.77 → 0.4.79

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 (85) hide show
  1. package/dist/agents/index.cjs +287 -275
  2. package/dist/agents/index.js +3 -3
  3. package/dist/agents/tasks/WorkflowThreadStrip.d.ts +9 -4
  4. package/dist/agents/workflows/StepBarFrame.d.ts +75 -0
  5. package/dist/agents/workflows/WorkflowRunner.d.ts +5 -1
  6. package/dist/agents/workflows/WorkflowStepBar.d.ts +9 -11
  7. package/dist/agents/workflows/index.d.ts +2 -0
  8. package/dist/agents/workflows/stepWindow.d.ts +59 -0
  9. package/dist/chat/ChatPage.d.ts +1 -1
  10. package/dist/chat/chat-page-types.d.ts +5 -0
  11. package/dist/chat/index.cjs +124 -124
  12. package/dist/chat/index.js +2 -2
  13. package/dist/{chunk-JFUN4D7D.cjs → chunk-3YET6D5E.cjs} +150 -146
  14. package/dist/chunk-3YET6D5E.cjs.map +1 -0
  15. package/dist/{chunk-B3WCKBJ7.cjs → chunk-5XVWGJ2H.cjs} +3 -3
  16. package/dist/{chunk-B3WCKBJ7.cjs.map → chunk-5XVWGJ2H.cjs.map} +1 -1
  17. package/dist/{chunk-34UW6XUQ.js → chunk-6GXF62XN.js} +566 -171
  18. package/dist/chunk-6GXF62XN.js.map +1 -0
  19. package/dist/{chunk-HEVVT6IT.js → chunk-BMOL5DN6.js} +126 -122
  20. package/dist/chunk-BMOL5DN6.js.map +1 -0
  21. package/dist/chunk-CWAZNXC5.js +441 -0
  22. package/dist/chunk-CWAZNXC5.js.map +1 -0
  23. package/dist/{chunk-NIP5BOP7.js → chunk-EWSEQEPL.js} +5 -4
  24. package/dist/chunk-EWSEQEPL.js.map +1 -0
  25. package/dist/{chunk-UEU23PTW.js → chunk-ICBAFX5B.js} +3 -3
  26. package/dist/{chunk-UEU23PTW.js.map → chunk-ICBAFX5B.js.map} +1 -1
  27. package/dist/{chunk-EKIUMNCN.cjs → chunk-IF6VAYIA.cjs} +5 -5
  28. package/dist/{chunk-EKIUMNCN.cjs.map → chunk-IF6VAYIA.cjs.map} +1 -1
  29. package/dist/chunk-MLAHDAN5.cjs +450 -0
  30. package/dist/chunk-MLAHDAN5.cjs.map +1 -0
  31. package/dist/{chunk-HOD6OM7L.cjs → chunk-MP6FK43E.cjs} +5 -4
  32. package/dist/chunk-MP6FK43E.cjs.map +1 -0
  33. package/dist/{chunk-GJV2G4FC.js → chunk-O35LRB3P.js} +3 -3
  34. package/dist/{chunk-GJV2G4FC.js.map → chunk-O35LRB3P.js.map} +1 -1
  35. package/dist/{chunk-GTXOV7IJ.cjs → chunk-XMBYDLZQ.cjs} +4 -4
  36. package/dist/{chunk-GTXOV7IJ.cjs.map → chunk-XMBYDLZQ.cjs.map} +1 -1
  37. package/dist/{chunk-OEM5ARVM.js → chunk-XQDM6T6C.js} +3 -3
  38. package/dist/{chunk-OEM5ARVM.js.map → chunk-XQDM6T6C.js.map} +1 -1
  39. package/dist/{chunk-3XR3IEGU.cjs → chunk-YGUKTFKW.cjs} +572 -167
  40. package/dist/chunk-YGUKTFKW.cjs.map +1 -0
  41. package/dist/connect/index.cjs +233 -77
  42. package/dist/connect/index.cjs.map +1 -1
  43. package/dist/connect/index.d.ts +2 -0
  44. package/dist/connect/index.js +191 -37
  45. package/dist/connect/index.js.map +1 -1
  46. package/dist/connection/ConnectedTagMatrix.d.ts +20 -0
  47. package/dist/connection/ConnectedWorkflowRunner.d.ts +13 -1
  48. package/dist/connection/WorkflowRunThread.d.ts +21 -0
  49. package/dist/databases/ColumnConfigFields.d.ts +68 -0
  50. package/dist/databases/DatabaseColumnDialog.d.ts +27 -2
  51. package/dist/databases/DatabaseTable.d.ts +8 -1
  52. package/dist/databases/PickCellEditor.d.ts +21 -0
  53. package/dist/databases/column-types.d.ts +73 -9
  54. package/dist/databases/databaseColumns.d.ts +4 -0
  55. package/dist/databases/index.cjs +758 -27
  56. package/dist/databases/index.cjs.map +1 -1
  57. package/dist/databases/index.d.ts +4 -1
  58. package/dist/databases/index.js +745 -31
  59. package/dist/databases/index.js.map +1 -1
  60. package/dist/databases/linkCells.d.ts +48 -0
  61. package/dist/files/index.cjs +2 -2
  62. package/dist/files/index.js +2 -2
  63. package/dist/index.cjs +624 -579
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.js +9 -8
  67. package/dist/index.js.map +1 -1
  68. package/dist/settings/index.cjs +35 -35
  69. package/dist/settings/index.js +3 -3
  70. package/dist/studio/index.cjs +3 -3
  71. package/dist/studio/index.js +2 -2
  72. package/dist/tags/TagMatrix.d.ts +64 -0
  73. package/dist/tags/index.d.ts +3 -0
  74. package/dist/tags/tagMatrixModel.d.ts +39 -0
  75. package/dist/workflow-canvas/index.cjs +46 -46
  76. package/dist/workflow-canvas/index.js +3 -3
  77. package/dist/workspaces/index.cjs +1 -1
  78. package/dist/workspaces/index.js +1 -1
  79. package/package.json +4 -4
  80. package/dist/chunk-34UW6XUQ.js.map +0 -1
  81. package/dist/chunk-3XR3IEGU.cjs.map +0 -1
  82. package/dist/chunk-HEVVT6IT.js.map +0 -1
  83. package/dist/chunk-HOD6OM7L.cjs.map +0 -1
  84. package/dist/chunk-JFUN4D7D.cjs.map +0 -1
  85. package/dist/chunk-NIP5BOP7.js.map +0 -1
@@ -1,24 +1,25 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkB3WCKBJ7_cjs = require('../chunk-B3WCKBJ7.cjs');
5
- var chunkGTXOV7IJ_cjs = require('../chunk-GTXOV7IJ.cjs');
4
+ var chunk5XVWGJ2H_cjs = require('../chunk-5XVWGJ2H.cjs');
5
+ var chunkXMBYDLZQ_cjs = require('../chunk-XMBYDLZQ.cjs');
6
6
  var chunkTZR36PPP_cjs = require('../chunk-TZR36PPP.cjs');
7
7
  var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
8
8
  var chunkZVBPRMHJ_cjs = require('../chunk-ZVBPRMHJ.cjs');
9
9
  require('../chunk-7YUFMNFW.cjs');
10
- var chunk3XR3IEGU_cjs = require('../chunk-3XR3IEGU.cjs');
10
+ var chunkMLAHDAN5_cjs = require('../chunk-MLAHDAN5.cjs');
11
+ var chunkYGUKTFKW_cjs = require('../chunk-YGUKTFKW.cjs');
11
12
  require('../chunk-DETZZBG2.cjs');
12
13
  require('../chunk-7D737FLE.cjs');
13
14
  var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
14
15
  require('../chunk-ADOKTJHV.cjs');
15
- var chunkHOD6OM7L_cjs = require('../chunk-HOD6OM7L.cjs');
16
+ var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
17
+ var chunkMP6FK43E_cjs = require('../chunk-MP6FK43E.cjs');
16
18
  require('../chunk-VGOFFCMT.cjs');
17
19
  require('../chunk-B4SRYJLM.cjs');
18
20
  require('../chunk-7UTB4PHM.cjs');
19
21
  require('../chunk-PPCATBOY.cjs');
20
22
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
21
- var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
22
23
  require('../chunk-MHVNT4J3.cjs');
23
24
  require('../chunk-DES3K4SD.cjs');
24
25
  var react = require('react');
@@ -189,7 +190,7 @@ function StreamedArtifact({
189
190
  }
190
191
  var STARTING = /* @__PURE__ */ new Set(["pending", "running"]);
191
192
  function formValues(step, inputs) {
192
- const fields = chunk3XR3IEGU_cjs.stepFields(step);
193
+ const fields = chunkYGUKTFKW_cjs.stepFields(step);
193
194
  if (!fields.length) return void 0;
194
195
  if (step.kind === "form")
195
196
  return Object.fromEntries(fields.map((f) => [f.name, inputs[f.name] ?? ""]));
@@ -224,10 +225,10 @@ function useAnswerRetry(missing, refetch) {
224
225
  function useWorkflowThread(workflow, options = {}) {
225
226
  const arbi = react$1.useArbi();
226
227
  const { ensureWorkspaceOpen, status } = chunkMUMH3Z6K_cjs.useConnection();
227
- const { wsId } = chunkGTXOV7IJ_cjs.useWorkspaceDocs();
228
+ const { wsId } = chunkXMBYDLZQ_cjs.useWorkspaceDocs();
228
229
  const [threadId, setThreadId] = react.useState(options.conversationId);
229
230
  const [localInputs, setLocalInputs] = react.useState(
230
- () => chunk3XR3IEGU_cjs.initialRunInputs(workflow, options.initialInputs)
231
+ () => chunkYGUKTFKW_cjs.initialRunInputs(workflow, options.initialInputs)
231
232
  );
232
233
  const [edits, setEdits] = react.useState({});
233
234
  const [localStates, setLocalStates] = react.useState({});
@@ -247,12 +248,12 @@ function useWorkflowThread(workflow, options = {}) {
247
248
  );
248
249
  const conversation = conversations.data?.find((c) => c.external_id === threadId);
249
250
  const steps = react.useMemo(
250
- () => chunk3XR3IEGU_cjs.workflowSteps(workflow).length > 0 ? chunk3XR3IEGU_cjs.workflowSteps(workflow) : chunk3XR3IEGU_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
251
+ () => chunkYGUKTFKW_cjs.workflowSteps(workflow).length > 0 ? chunkYGUKTFKW_cjs.workflowSteps(workflow) : chunkYGUKTFKW_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
251
252
  [workflow, conversation?.plan?.steps]
252
253
  );
253
254
  const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
254
255
  const serverStates = react.useMemo(
255
- () => chunk3XR3IEGU_cjs.stepStatesFromActivity(activity.data ?? []),
256
+ () => chunkYGUKTFKW_cjs.stepStatesFromActivity(activity.data ?? []),
256
257
  [activity.data]
257
258
  );
258
259
  const working = steps.some(
@@ -304,7 +305,7 @@ function useWorkflowThread(workflow, options = {}) {
304
305
  if (!id) {
305
306
  await ensureWorkspaceOpen();
306
307
  const created = await createWork.mutateAsync({
307
- title: chunk3XR3IEGU_cjs.runThreadTitle(workflow, values).slice(0, 60),
308
+ title: chunkYGUKTFKW_cjs.runThreadTitle(workflow, values).slice(0, 60),
308
309
  description: workflow.description || null,
309
310
  prompt: null,
310
311
  skill_ref: null,
@@ -316,7 +317,7 @@ function useWorkflowThread(workflow, options = {}) {
316
317
  criteria: [],
317
318
  max_passes: 3,
318
319
  documents: [],
319
- steps: chunk3XR3IEGU_cjs.toPlanSteps(workflow, {
320
+ steps: chunkYGUKTFKW_cjs.toPlanSteps(workflow, {
320
321
  inputs: values,
321
322
  resolveWorkflow: options.resolveWorkflow,
322
323
  compose: options.compose
@@ -371,7 +372,7 @@ function useWorkflowThread(workflow, options = {}) {
371
372
  [threadId, act]
372
373
  );
373
374
  const loaded = !options.conversationId || activity.isSuccess || activity.isError;
374
- const view = chunk3XR3IEGU_cjs.useWorkflowView({
375
+ const view = chunkYGUKTFKW_cjs.useWorkflowView({
375
376
  steps,
376
377
  states,
377
378
  inputs,
@@ -394,6 +395,38 @@ function useWorkflowThread(workflow, options = {}) {
394
395
  );
395
396
  return { view, conversationId: threadId, conversation, nameOf, people };
396
397
  }
398
+ function WorkflowRunThread({
399
+ conversationId,
400
+ workspaceId,
401
+ aside,
402
+ stepTitle,
403
+ targetMessageId,
404
+ onOpenCitation,
405
+ labels,
406
+ className
407
+ }) {
408
+ const chat = react$1.useArbiChat({ workspaceId });
409
+ const listed = chat.threads.some((t) => t.id === conversationId);
410
+ const { selectThread, activeThreadId } = chat;
411
+ react.useEffect(() => {
412
+ if (listed && activeThreadId !== conversationId) selectThread(conversationId);
413
+ }, [listed, activeThreadId, conversationId, selectThread]);
414
+ return /* @__PURE__ */ jsxRuntime.jsx(
415
+ chunkMP6FK43E_cjs.ChatPage,
416
+ {
417
+ chat: { ...chat, threads: chat.threads.filter((t) => t.id === conversationId) },
418
+ singleThread: true,
419
+ documentsRequired: false,
420
+ aside,
421
+ asideBreakpoint: 52,
422
+ workflowStepTitle: stepTitle,
423
+ targetMessageId,
424
+ onOpenCitation,
425
+ labels,
426
+ className: className ?? "h-[min(78dvh,860px)] min-h-[480px] rounded-xl border border-border"
427
+ }
428
+ );
429
+ }
397
430
  var DEFAULT_WORKFLOW_RUNNER_DIALOG_LABELS = {
398
431
  loadingDocument: "Opening the document\u2026",
399
432
  documentFailed: "The document could not be opened.",
@@ -411,7 +444,7 @@ function WorkflowSignDialog({
411
444
  const arbi = react$1.useArbi();
412
445
  const { user, ensureWorkspaceOpen } = chunkMUMH3Z6K_cjs.useConnection();
413
446
  const tools = documentTools.useOptionalDocumentTools();
414
- const { id, version } = chunk3XR3IEGU_cjs.splitDocRef(docRef);
447
+ const { id, version } = chunkYGUKTFKW_cjs.splitDocRef(docRef);
415
448
  const [pdf, setPdf] = react.useState(null);
416
449
  const [failed, setFailed] = react.useState(false);
417
450
  react.useEffect(() => {
@@ -463,7 +496,7 @@ function WorkflowWordDialog({
463
496
  onClose,
464
497
  labels
465
498
  }) {
466
- const { id } = chunk3XR3IEGU_cjs.splitDocRef(docRef);
499
+ const { id } = chunkYGUKTFKW_cjs.splitDocRef(docRef);
467
500
  return /* @__PURE__ */ jsxRuntime.jsx(
468
501
  chunkULWRNGGE_cjs.ModalScaffold,
469
502
  {
@@ -547,6 +580,8 @@ function Cell({ onClick, children }) {
547
580
  }
548
581
  var DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS = {
549
582
  notify: "Ask to approve",
583
+ showInThread: "Show in the thread",
584
+ currentStep: "Current step",
550
585
  notified: "Notified.",
551
586
  openThread: "Open the thread",
552
587
  loadingAnswer: "Fetching the answer\u2026"
@@ -562,6 +597,7 @@ function ConnectedWorkflowRunner({
562
597
  onOpenMessage,
563
598
  actions: hostActions,
564
599
  dialogLabels,
600
+ layout = "thread",
565
601
  testIdPrefix = "workflow-run",
566
602
  ...runnerProps
567
603
  }) {
@@ -569,7 +605,7 @@ function ConnectedWorkflowRunner({
569
605
  const dl = { ...DEFAULT_WORKFLOW_RUNNER_DIALOG_LABELS, ...dialogLabels };
570
606
  const arbi = react$1.useArbi();
571
607
  const { ensureWorkspaceOpen, user } = chunkMUMH3Z6K_cjs.useConnection();
572
- const { wsId } = chunkGTXOV7IJ_cjs.useWorkspaceDocs();
608
+ const { wsId } = chunkXMBYDLZQ_cjs.useWorkspaceDocs();
573
609
  const { data: docs = [], refetch } = react$1.useDocuments(wsId);
574
610
  const [uploading, setUploading] = react.useState(false);
575
611
  const [added, setAdded] = react.useState({});
@@ -581,6 +617,8 @@ function ConnectedWorkflowRunner({
581
617
  documentsFor: options?.documentsFor ?? ((stepId) => Object.entries(addedRef.current).flatMap(([doc, step]) => step === stepId ? [doc] : []))
582
618
  });
583
619
  const [dialog, setDialog] = react.useState(null);
620
+ const inThread = layout === "thread" && !!conversationId;
621
+ const [target, setTarget] = react.useState(void 0);
584
622
  const nameOfDoc = react.useCallback(
585
623
  (id) => docs.find((d) => d.external_id === id)?.file_name ?? void 0,
586
624
  [docs]
@@ -589,19 +627,20 @@ function ConnectedWorkflowRunner({
589
627
  () => ({
590
628
  me: user?.externalId,
591
629
  openDocument: onOpenDocument && ((ref) => {
592
- const { id, version } = chunk3XR3IEGU_cjs.splitDocRef(ref);
630
+ const { id, version } = chunkYGUKTFKW_cjs.splitDocRef(ref);
593
631
  onOpenDocument(id, version);
594
632
  }),
595
633
  openDraft: onOpenDraft && ((draftId) => onOpenDraft(draftId)),
596
- openMessage: onOpenMessage,
634
+ // In the thread layout an answer is right there: scroll to it.
635
+ openMessage: inThread ? setTarget : onOpenMessage,
597
636
  sign: hostActions?.sign ?? ((_step, state) => {
598
637
  const w = state.waiting;
599
638
  if (w?.doc_ext_id) setDialog({ kind: "sign", docRef: w.doc_ext_id });
600
639
  }),
601
- openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(chunk3XR3IEGU_cjs.splitDocRef(ref).id) ?? "" })),
640
+ openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(chunkYGUKTFKW_cjs.splitDocRef(ref).id) ?? "" })),
602
641
  openReview: hostActions?.openReview ?? ((tags, documents) => setDialog({ kind: "review", tags, documents }))
603
642
  }),
604
- [user?.externalId, onOpenDocument, onOpenDraft, onOpenMessage, hostActions, nameOfDoc]
643
+ [user?.externalId, onOpenDocument, onOpenDraft, onOpenMessage, hostActions, nameOfDoc, inThread]
605
644
  );
606
645
  const onUpload = react.useCallback(
607
646
  async (files2, step) => {
@@ -634,6 +673,23 @@ function ConnectedWorkflowRunner({
634
673
  }, [reading, refetch]);
635
674
  const renderAgentOutput = (step, state) => {
636
675
  const status = state?.status;
676
+ if (inThread) {
677
+ const id = state?.responseId;
678
+ return id && status === "done" ? /* @__PURE__ */ jsxRuntime.jsxs(
679
+ ui.Button,
680
+ {
681
+ variant: "outline",
682
+ size: "sm",
683
+ onClick: () => setTarget(id),
684
+ "data-testid": `${testIdPrefix}-${step.id}-show-in-thread`,
685
+ children: [
686
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "size-4" }),
687
+ " ",
688
+ l.showInThread
689
+ ]
690
+ }
691
+ ) : null;
692
+ }
637
693
  if (!state?.text && status !== "done") return null;
638
694
  if (!state?.text && state?.responseId) {
639
695
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -659,6 +715,34 @@ function ConnectedWorkflowRunner({
659
715
  }
660
716
  );
661
717
  };
718
+ const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
719
+ chunkYGUKTFKW_cjs.WorkflowRunner,
720
+ {
721
+ people,
722
+ ...runnerProps,
723
+ workflow,
724
+ run: view,
725
+ renderAgentOutput,
726
+ renderReview: (step) => conversationId ? /* @__PURE__ */ jsxRuntime.jsx(
727
+ ReviewNotify,
728
+ {
729
+ conversationId,
730
+ workspaceId: wsId,
731
+ labels: l,
732
+ testId: `${testIdPrefix}-${step.id}`
733
+ }
734
+ ) : null,
735
+ onUpload,
736
+ uploading,
737
+ files,
738
+ actions,
739
+ nameOfDoc,
740
+ testIdPrefix,
741
+ hideStepBar: compact,
742
+ compact,
743
+ className: compact ? void 0 : runnerProps.className
744
+ }
745
+ );
662
746
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
663
747
  conversationId && onOpenConversation && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs(
664
748
  ui.Button,
@@ -674,31 +758,29 @@ function ConnectedWorkflowRunner({
674
758
  ]
675
759
  }
676
760
  ) }),
677
- /* @__PURE__ */ jsxRuntime.jsx(
678
- chunk3XR3IEGU_cjs.WorkflowRunner,
679
- {
680
- people,
681
- ...runnerProps,
682
- workflow,
683
- run: view,
684
- renderAgentOutput,
685
- renderReview: (step) => conversationId ? /* @__PURE__ */ jsxRuntime.jsx(
686
- ReviewNotify,
687
- {
688
- conversationId,
689
- workspaceId: wsId,
690
- labels: l,
691
- testId: `${testIdPrefix}-${step.id}`
692
- }
693
- ) : null,
694
- onUpload,
695
- uploading,
696
- files,
697
- actions,
698
- nameOfDoc,
699
- testIdPrefix
700
- }
701
- ),
761
+ inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
762
+ /* @__PURE__ */ jsxRuntime.jsx(
763
+ chunkYGUKTFKW_cjs.WorkflowStepBar,
764
+ {
765
+ run: view,
766
+ levels: chunkYGUKTFKW_cjs.stepLevels(view.steps),
767
+ doneTitle: (workflow.run.kind === "steps" ? workflow.run.completion?.title : void 0) ?? runnerProps.labels?.complete ?? "Done",
768
+ icon: (key) => key && runnerProps.renderIcon ? runnerProps.renderIcon(key) : void 0,
769
+ tid: (suffix) => `${testIdPrefix}-${suffix}`
770
+ }
771
+ ),
772
+ /* @__PURE__ */ jsxRuntime.jsx(
773
+ WorkflowRunThread,
774
+ {
775
+ conversationId,
776
+ workspaceId: wsId,
777
+ stepTitle: (id) => view.steps.find((s) => s.id === id)?.title,
778
+ targetMessageId: target,
779
+ labels: { workflows: l.currentStep },
780
+ aside: runner(true)
781
+ }
782
+ )
783
+ ] }) : runner(false),
702
784
  dialog?.kind === "sign" && /* @__PURE__ */ jsxRuntime.jsx(WorkflowSignDialog, { docRef: dialog.docRef, onClose: () => setDialog(null), labels: dl }),
703
785
  dialog?.kind === "word" && /* @__PURE__ */ jsxRuntime.jsx(
704
786
  WorkflowWordDialog,
@@ -793,6 +875,78 @@ function ReviewNotify({
793
875
  ] })
794
876
  ] });
795
877
  }
878
+ function ConnectedTagMatrix({
879
+ parentId,
880
+ linksLimit = 3,
881
+ exportTitle,
882
+ onExported,
883
+ readOnly,
884
+ ...props
885
+ }) {
886
+ const arbi = react$1.useArbi();
887
+ const { workspaceId, status, ensureWorkspaceOpen } = chunkMUMH3Z6K_cjs.useConnection();
888
+ const matrix = react$1.useTagMatrix({ parentId }, { linksLimit });
889
+ const update = react$1.useUpdateTagFields();
890
+ const invalidate = react$1.useInvalidateTagData();
891
+ const members = react$1.useWorkspaceUsers(workspaceId ?? void 0, {
892
+ enabled: status === "authenticated" && !!workspaceId,
893
+ beforeFetch: ensureWorkspaceOpen
894
+ });
895
+ const [error, setError] = react.useState(null);
896
+ const people = (members.data ?? []).map((m) => ({
897
+ value: m.user.external_id,
898
+ label: [m.user.given_name, m.user.family_name].filter(Boolean).join(" ") || m.user.email
899
+ }));
900
+ const fail = (e) => setError(e instanceof Error ? e.message : String(e));
901
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
902
+ /* @__PURE__ */ jsxRuntime.jsx(
903
+ chunkMLAHDAN5_cjs.TagMatrix,
904
+ {
905
+ ...props,
906
+ matrix: matrix.data,
907
+ isLoading: matrix.isLoading,
908
+ people,
909
+ onChangeValue: readOnly ? void 0 : async (tagId, fieldId, value) => {
910
+ setError(null);
911
+ await update.mutateAsync({ tagId, values: { [fieldId]: value } }).catch(fail);
912
+ },
913
+ onAddRow: readOnly ? void 0 : async (name) => {
914
+ setError(null);
915
+ try {
916
+ await ensureWorkspaceOpen();
917
+ await arbi.tags.create({ name, parentId });
918
+ await invalidate();
919
+ } catch (e) {
920
+ fail(e);
921
+ }
922
+ },
923
+ onExport: onExported && matrix.data ? async () => {
924
+ setError(null);
925
+ try {
926
+ const data = matrix.data;
927
+ if (!data) return;
928
+ const title = exportTitle ?? data.parent?.name ?? "Matrix";
929
+ const markdown = chunkMLAHDAN5_cjs.tagMatrixMarkdown(data, {
930
+ title,
931
+ nameOf: (id2) => people.find((p) => p.value === id2)?.label
932
+ });
933
+ await ensureWorkspaceOpen();
934
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
935
+ const uploaded = await arbi.documents.uploadFile(
936
+ new Blob([markdown], { type: "text/markdown" }),
937
+ `${title} (${stamp}).md`
938
+ );
939
+ const id = uploaded?.doc_ext_ids?.[0];
940
+ if (id) onExported(id);
941
+ } catch (e) {
942
+ fail(e);
943
+ }
944
+ } : void 0
945
+ }
946
+ ),
947
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive", children: error })
948
+ ] });
949
+ }
796
950
  function useConnectedShellWorkspaces(options = {}) {
797
951
  const { workspaceId, setWorkspace } = chunkMUMH3Z6K_cjs.useConnection();
798
952
  const query = react$1.useWorkspaces();
@@ -866,12 +1020,12 @@ function ConnectedProfileCard({ notify: notify3, title = "Profile" }) {
866
1020
  }
867
1021
  });
868
1022
  const display = profile?.fullName || user?.name || "Unnamed";
869
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: /* @__PURE__ */ jsxRuntime.jsx(
870
- chunkB3WCKBJ7_cjs.ProfileCard,
1023
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: /* @__PURE__ */ jsxRuntime.jsx(
1024
+ chunk5XVWGJ2H_cjs.ProfileCard,
871
1025
  {
872
1026
  avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
873
1027
  /* @__PURE__ */ jsxRuntime.jsx(
874
- chunkB3WCKBJ7_cjs.AvatarPicker,
1028
+ chunk5XVWGJ2H_cjs.AvatarPicker,
875
1029
  {
876
1030
  pictureUrl: profile?.picture ?? user?.picture,
877
1031
  initials: chunkKDG6FER6_cjs.initials(display),
@@ -913,9 +1067,9 @@ function ConnectedIdentityVerification({
913
1067
  onNameAccepted: () => notify3?.("Name updated to match your ID", "success")
914
1068
  });
915
1069
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
916
- /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.IdentityVerificationCard, { flow, labels }),
1070
+ /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.IdentityVerificationCard, { flow, labels }),
917
1071
  /* @__PURE__ */ jsxRuntime.jsx(
918
- chunkB3WCKBJ7_cjs.IdentityVerificationDialog,
1072
+ chunk5XVWGJ2H_cjs.IdentityVerificationDialog,
919
1073
  {
920
1074
  flow,
921
1075
  accountName: profile?.fullName ?? "",
@@ -927,7 +1081,7 @@ function ConnectedIdentityVerification({
927
1081
  function ConnectedRequireVerified({ children, labels }) {
928
1082
  const { data: profile } = react$1.useProfile();
929
1083
  const flow = react$1.useIdentityVerification();
930
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
1084
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
931
1085
  }
932
1086
  function defaultUnmetPasswordRequirement(password) {
933
1087
  if (password.length < 8) return "Minimum 8 characters";
@@ -956,10 +1110,10 @@ function ConnectedSecuritySection({
956
1110
  },
957
1111
  onClose: () => setOpen(false)
958
1112
  });
959
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkB3WCKBJ7_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
960
- /* @__PURE__ */ jsxRuntime.jsxs(chunkB3WCKBJ7_cjs.SettingsCard, { padding: "sm", children: [
1113
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunk5XVWGJ2H_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
1114
+ /* @__PURE__ */ jsxRuntime.jsxs(chunk5XVWGJ2H_cjs.SettingsCard, { padding: "sm", children: [
961
1115
  /* @__PURE__ */ jsxRuntime.jsx(
962
- chunkB3WCKBJ7_cjs.SettingsActionRow,
1116
+ chunk5XVWGJ2H_cjs.SettingsActionRow,
963
1117
  {
964
1118
  title: "Change password",
965
1119
  description: "Used to sign in and to encrypt your data. Changing it re-encrypts everything in your account.",
@@ -970,7 +1124,7 @@ function ConnectedSecuritySection({
970
1124
  children
971
1125
  ] }),
972
1126
  /* @__PURE__ */ jsxRuntime.jsx(
973
- chunkB3WCKBJ7_cjs.PasswordChangeDialog,
1127
+ chunk5XVWGJ2H_cjs.PasswordChangeDialog,
974
1128
  {
975
1129
  open,
976
1130
  onClose: form.onCancel,
@@ -994,23 +1148,23 @@ function ConnectedSecuritySection({
994
1148
  ] });
995
1149
  }
996
1150
  function ConnectedNotificationPreferences({
997
- categories = chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_CATEGORIES,
1151
+ categories = chunk5XVWGJ2H_cjs.EMAIL_NOTIFICATION_CATEGORIES,
998
1152
  title = "Notifications"
999
1153
  }) {
1000
1154
  const keys = react.useMemo(
1001
- () => categories === chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
1155
+ () => categories === chunk5XVWGJ2H_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunk5XVWGJ2H_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
1002
1156
  [categories]
1003
1157
  );
1004
1158
  const prefs = react$1.useNotificationPreferences(keys);
1005
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
1006
- chunkB3WCKBJ7_cjs.NotificationCategoryList,
1159
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
1160
+ chunk5XVWGJ2H_cjs.NotificationCategoryList,
1007
1161
  {
1008
1162
  masterId: "emailNotifications",
1009
1163
  masterTitle: "Email Notifications",
1010
1164
  masterDescription: "Email me about activity when I\u2019m away",
1011
1165
  masterChecked: prefs.masterChecked,
1012
1166
  onMasterChange: prefs.setAll,
1013
- categories: chunkB3WCKBJ7_cjs.toNotificationCategories(prefs.checked, categories),
1167
+ categories: chunk5XVWGJ2H_cjs.toNotificationCategories(prefs.checked, categories),
1014
1168
  onCategoryChange: prefs.setCategory
1015
1169
  }
1016
1170
  ) }) });
@@ -1024,14 +1178,14 @@ function ConnectedSessionsRow({
1024
1178
  const sessions = react$1.useSessions({ enabled: open });
1025
1179
  const currentSessionId = react$1.useCurrentSessionId();
1026
1180
  const terminate = react$1.useTerminateSession();
1027
- const views = chunkB3WCKBJ7_cjs.toActiveSessionViews(sessions.data ?? [], {
1181
+ const views = chunk5XVWGJ2H_cjs.toActiveSessionViews(sessions.data ?? [], {
1028
1182
  currentSessionId,
1029
1183
  terminatingId: terminate.isPending ? terminate.variables : null,
1030
1184
  renderIcon: renderSessionIcon
1031
1185
  });
1032
1186
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1033
1187
  /* @__PURE__ */ jsxRuntime.jsx(
1034
- chunkB3WCKBJ7_cjs.SettingsRow,
1188
+ chunk5XVWGJ2H_cjs.SettingsRow,
1035
1189
  {
1036
1190
  label: "Active sessions",
1037
1191
  description: "Devices and agents currently signed in to your account.",
@@ -1053,7 +1207,7 @@ function ConnectedSessionsRow({
1053
1207
  }
1054
1208
  ),
1055
1209
  /* @__PURE__ */ jsxRuntime.jsx(
1056
- chunkB3WCKBJ7_cjs.ActiveSessionsDialog,
1210
+ chunk5XVWGJ2H_cjs.ActiveSessionsDialog,
1057
1211
  {
1058
1212
  open,
1059
1213
  onOpenChange: setOpen,
@@ -1088,7 +1242,7 @@ function ConnectedLogoutDialog({
1088
1242
  const sessions = react$1.useSessions({ enabled: open });
1089
1243
  const logoutAll = react$1.useLogoutAllSessions();
1090
1244
  return /* @__PURE__ */ jsxRuntime.jsx(
1091
- chunkB3WCKBJ7_cjs.LogoutDialog,
1245
+ chunk5XVWGJ2H_cjs.LogoutDialog,
1092
1246
  {
1093
1247
  open,
1094
1248
  onClose,
@@ -1102,7 +1256,7 @@ function ConnectedLogoutDialog({
1102
1256
  },
1103
1257
  canLogoutAll: true,
1104
1258
  isOnline,
1105
- sessions: chunkB3WCKBJ7_cjs.toLogoutSessionViews(sessions.data ?? []),
1259
+ sessions: chunk5XVWGJ2H_cjs.toLogoutSessionViews(sessions.data ?? []),
1106
1260
  renderSessionIcon
1107
1261
  }
1108
1262
  );
@@ -1121,7 +1275,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
1121
1275
  });
1122
1276
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1123
1277
  /* @__PURE__ */ jsxRuntime.jsx(
1124
- chunkB3WCKBJ7_cjs.SettingsDangerZone,
1278
+ chunk5XVWGJ2H_cjs.SettingsDangerZone,
1125
1279
  {
1126
1280
  isOpen: zoneOpen,
1127
1281
  onToggle: () => setZoneOpen((o) => !o),
@@ -1141,12 +1295,12 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
1141
1295
  }
1142
1296
  ),
1143
1297
  /* @__PURE__ */ jsxRuntime.jsx(
1144
- chunkB3WCKBJ7_cjs.DeleteAccountDialog,
1298
+ chunk5XVWGJ2H_cjs.DeleteAccountDialog,
1145
1299
  {
1146
1300
  open: dialogOpen,
1147
1301
  onClose: flow.onClose,
1148
1302
  step: flow.step,
1149
- blockers: chunkB3WCKBJ7_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
1303
+ blockers: chunk5XVWGJ2H_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
1150
1304
  onContinue: flow.onContinue,
1151
1305
  onBack: flow.onBack,
1152
1306
  userEmail: user?.email ?? "",
@@ -1331,7 +1485,7 @@ function mapWorkNotification(note) {
1331
1485
  function ActiveChat({ agentId, workspaceId }) {
1332
1486
  const chat = react$1.useArbiChat({ agentId, workspaceId });
1333
1487
  return /* @__PURE__ */ jsxRuntime.jsx(
1334
- chunkHOD6OM7L_cjs.ChatPage,
1488
+ chunkMP6FK43E_cjs.ChatPage,
1335
1489
  {
1336
1490
  chat: { ...chat, assistantMode: void 0, setAssistantMode: void 0 },
1337
1491
  documentsRequired: false,
@@ -1393,35 +1547,35 @@ function ConnectedAgentChatPanel({
1393
1547
 
1394
1548
  Object.defineProperty(exports, "ConnectedAssistantDock", {
1395
1549
  enumerable: true,
1396
- get: function () { return chunkGTXOV7IJ_cjs.ConnectedAssistantDock; }
1550
+ get: function () { return chunkXMBYDLZQ_cjs.ConnectedAssistantDock; }
1397
1551
  });
1398
1552
  Object.defineProperty(exports, "redlineStats", {
1399
1553
  enumerable: true,
1400
- get: function () { return chunkGTXOV7IJ_cjs.redlineStats; }
1554
+ get: function () { return chunkXMBYDLZQ_cjs.redlineStats; }
1401
1555
  });
1402
1556
  Object.defineProperty(exports, "textToArtifact", {
1403
1557
  enumerable: true,
1404
- get: function () { return chunkGTXOV7IJ_cjs.textToArtifact; }
1558
+ get: function () { return chunkXMBYDLZQ_cjs.textToArtifact; }
1405
1559
  });
1406
1560
  Object.defineProperty(exports, "toRedlineMarkdown", {
1407
1561
  enumerable: true,
1408
- get: function () { return chunkGTXOV7IJ_cjs.toRedlineMarkdown; }
1562
+ get: function () { return chunkXMBYDLZQ_cjs.toRedlineMarkdown; }
1409
1563
  });
1410
1564
  Object.defineProperty(exports, "useConnectedAiTask", {
1411
1565
  enumerable: true,
1412
- get: function () { return chunkGTXOV7IJ_cjs.useConnectedAiTask; }
1566
+ get: function () { return chunkXMBYDLZQ_cjs.useConnectedAiTask; }
1413
1567
  });
1414
1568
  Object.defineProperty(exports, "useConnectedChat", {
1415
1569
  enumerable: true,
1416
- get: function () { return chunkGTXOV7IJ_cjs.useConnectedChat; }
1570
+ get: function () { return chunkXMBYDLZQ_cjs.useConnectedChat; }
1417
1571
  });
1418
1572
  Object.defineProperty(exports, "useSemanticSearch", {
1419
1573
  enumerable: true,
1420
- get: function () { return chunkGTXOV7IJ_cjs.useSemanticSearch; }
1574
+ get: function () { return chunkXMBYDLZQ_cjs.useSemanticSearch; }
1421
1575
  });
1422
1576
  Object.defineProperty(exports, "useWorkspaceDocs", {
1423
1577
  enumerable: true,
1424
- get: function () { return chunkGTXOV7IJ_cjs.useWorkspaceDocs; }
1578
+ get: function () { return chunkXMBYDLZQ_cjs.useWorkspaceDocs; }
1425
1579
  });
1426
1580
  Object.defineProperty(exports, "ConnectionProvider", {
1427
1581
  enumerable: true,
@@ -1450,10 +1604,12 @@ exports.ConnectedRequireVerified = ConnectedRequireVerified;
1450
1604
  exports.ConnectedSecuritySection = ConnectedSecuritySection;
1451
1605
  exports.ConnectedSessionsRow = ConnectedSessionsRow;
1452
1606
  exports.ConnectedSkillUpload = ConnectedSkillUpload;
1607
+ exports.ConnectedTagMatrix = ConnectedTagMatrix;
1453
1608
  exports.ConnectedTaskAccessRequest = ConnectedTaskAccessRequest;
1454
1609
  exports.ConnectedWorkflowRunner = ConnectedWorkflowRunner;
1455
1610
  exports.DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS = DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS;
1456
1611
  exports.StreamedArtifact = StreamedArtifact;
1612
+ exports.WorkflowRunThread = WorkflowRunThread;
1457
1613
  exports.defaultUnmetPasswordRequirement = defaultUnmetPasswordRequirement;
1458
1614
  exports.useConnectedDocxNotifications = useConnectedDocxNotifications;
1459
1615
  exports.useConnectedShellWorkspaces = useConnectedShellWorkspaces;