@arbidocs/react 0.3.137 → 0.3.139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ import { createContext, useMemo, useContext } from 'react';
2
+ import { Arbi } from '@arbidocs/sdk/browser';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/ArbiProvider.tsx
6
+ var ArbiContext = createContext(null);
7
+ function ArbiProvider({ children, ...options }) {
8
+ const arbi = useMemo(
9
+ () => new Arbi(options),
10
+ // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
11
+ // eslint-disable-next-line react-hooks/exhaustive-deps
12
+ [options.url, options.deploymentDomain, options.credentials]
13
+ );
14
+ return /* @__PURE__ */ jsx(ArbiContext.Provider, { value: arbi, children });
15
+ }
16
+ function useArbi() {
17
+ const arbi = useContext(ArbiContext);
18
+ if (!arbi) {
19
+ throw new Error("useArbi() must be used within an <ArbiProvider>");
20
+ }
21
+ return arbi;
22
+ }
23
+
24
+ export { ArbiProvider, useArbi };
25
+ //# sourceMappingURL=chunk-J4MX2W4H.js.map
26
+ //# sourceMappingURL=chunk-J4MX2W4H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ArbiProvider.tsx","../src/useArbi.ts"],"names":[],"mappings":";;;;;AAYO,IAAM,WAAA,GAAc,cAA2B,IAAI,CAAA;AAMnD,SAAS,YAAA,CAAa,EAAE,QAAA,EAAU,GAAG,SAAQ,EAAsB;AACxE,EAAA,MAAM,IAAA,GAAO,OAAA;AAAA,IACX,MAAM,IAAI,IAAA,CAAK,OAAO,CAAA;AAAA;AAAA;AAAA,IAGtB,CAAC,OAAA,CAAQ,GAAA,EAAK,OAAA,CAAQ,gBAAA,EAAkB,QAAQ,WAAW;AAAA,GAC7D;AAEA,EAAA,2BAAQ,WAAA,CAAY,QAAA,EAAZ,EAAqB,KAAA,EAAO,MAAO,QAAA,EAAS,CAAA;AACtD;ACnBO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,IAAA,GAAO,WAAW,WAAW,CAAA;AACnC,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,iDAAiD,CAAA;AAAA,EACnE;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-J4MX2W4H.js","sourcesContent":["/**\n * ArbiProvider — React context that holds an Arbi instance.\n *\n * Usage:\n * <ArbiProvider url=\"https://arbi.mycompany.com\">\n * <App />\n * </ArbiProvider>\n */\n\nimport { createContext, useMemo, type ReactNode } from 'react'\nimport { Arbi, type ArbiOptions } from '@arbidocs/sdk/browser'\n\nexport const ArbiContext = createContext<Arbi | null>(null)\n\nexport interface ArbiProviderProps extends ArbiOptions {\n children: ReactNode\n}\n\nexport function ArbiProvider({ children, ...options }: ArbiProviderProps) {\n const arbi = useMemo(\n () => new Arbi(options),\n // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.url, options.deploymentDomain, options.credentials]\n )\n\n return <ArbiContext.Provider value={arbi}>{children}</ArbiContext.Provider>\n}\n","/**\n * Hook to access the Arbi instance from the nearest ArbiProvider.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { ArbiContext } from './ArbiProvider'\n\nexport function useArbi(): Arbi {\n const arbi = useContext(ArbiContext)\n if (!arbi) {\n throw new Error('useArbi() must be used within an <ArbiProvider>')\n }\n return arbi\n}\n"]}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var browser = require('@arbidocs/sdk/browser');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ // src/ArbiProvider.tsx
8
+ var ArbiContext = react.createContext(null);
9
+ function ArbiProvider({ children, ...options }) {
10
+ const arbi = react.useMemo(
11
+ () => new browser.Arbi(options),
12
+ // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
13
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14
+ [options.url, options.deploymentDomain, options.credentials]
15
+ );
16
+ return /* @__PURE__ */ jsxRuntime.jsx(ArbiContext.Provider, { value: arbi, children });
17
+ }
18
+ function useArbi() {
19
+ const arbi = react.useContext(ArbiContext);
20
+ if (!arbi) {
21
+ throw new Error("useArbi() must be used within an <ArbiProvider>");
22
+ }
23
+ return arbi;
24
+ }
25
+
26
+ exports.ArbiProvider = ArbiProvider;
27
+ exports.useArbi = useArbi;
28
+ //# sourceMappingURL=chunk-ZMTLGO3K.cjs.map
29
+ //# sourceMappingURL=chunk-ZMTLGO3K.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ArbiProvider.tsx","../src/useArbi.ts"],"names":["createContext","useMemo","Arbi","useContext"],"mappings":";;;;;;;AAYO,IAAM,WAAA,GAAcA,oBAA2B,IAAI,CAAA;AAMnD,SAAS,YAAA,CAAa,EAAE,QAAA,EAAU,GAAG,SAAQ,EAAsB;AACxE,EAAA,MAAM,IAAA,GAAOC,aAAA;AAAA,IACX,MAAM,IAAIC,YAAA,CAAK,OAAO,CAAA;AAAA;AAAA;AAAA,IAGtB,CAAC,OAAA,CAAQ,GAAA,EAAK,OAAA,CAAQ,gBAAA,EAAkB,QAAQ,WAAW;AAAA,GAC7D;AAEA,EAAA,sCAAQ,WAAA,CAAY,QAAA,EAAZ,EAAqB,KAAA,EAAO,MAAO,QAAA,EAAS,CAAA;AACtD;ACnBO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,IAAA,GAAOC,iBAAW,WAAW,CAAA;AACnC,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,iDAAiD,CAAA;AAAA,EACnE;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-ZMTLGO3K.cjs","sourcesContent":["/**\n * ArbiProvider — React context that holds an Arbi instance.\n *\n * Usage:\n * <ArbiProvider url=\"https://arbi.mycompany.com\">\n * <App />\n * </ArbiProvider>\n */\n\nimport { createContext, useMemo, type ReactNode } from 'react'\nimport { Arbi, type ArbiOptions } from '@arbidocs/sdk/browser'\n\nexport const ArbiContext = createContext<Arbi | null>(null)\n\nexport interface ArbiProviderProps extends ArbiOptions {\n children: ReactNode\n}\n\nexport function ArbiProvider({ children, ...options }: ArbiProviderProps) {\n const arbi = useMemo(\n () => new Arbi(options),\n // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.url, options.deploymentDomain, options.credentials]\n )\n\n return <ArbiContext.Provider value={arbi}>{children}</ArbiContext.Provider>\n}\n","/**\n * Hook to access the Arbi instance from the nearest ArbiProvider.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { ArbiContext } from './ArbiProvider'\n\nexport function useArbi(): Arbi {\n const arbi = useContext(ArbiContext)\n if (!arbi) {\n throw new Error('useArbi() must be used within an <ArbiProvider>')\n }\n return arbi\n}\n"]}
package/dist/index.cjs CHANGED
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkZBZKHBDS_cjs = require('./chunk-ZBZKHBDS.cjs');
4
+ var chunkZMTLGO3K_cjs = require('./chunk-ZMTLGO3K.cjs');
4
5
  var React2 = require('react');
5
- var browser = require('@arbidocs/sdk/browser');
6
- var jsxRuntime = require('react/jsx-runtime');
7
6
  var reactQuery = require('@tanstack/react-query');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var browser = require('@arbidocs/sdk/browser');
8
9
  var lucideReact = require('lucide-react');
9
10
  var client = require('@arbidocs/client');
10
11
  var zustand = require('zustand');
@@ -22,17 +23,6 @@ var React2__default = /*#__PURE__*/_interopDefault(React2);
22
23
  var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
23
24
  var Cropper__default = /*#__PURE__*/_interopDefault(Cropper);
24
25
 
25
- var ArbiContext = React2.createContext(null);
26
- function ArbiProvider({ children, ...options }) {
27
- const arbi = React2.useMemo(
28
- () => new browser.Arbi(options),
29
- // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
30
- // eslint-disable-next-line react-hooks/exhaustive-deps
31
- [options.url, options.deploymentDomain, options.credentials]
32
- );
33
- return /* @__PURE__ */ jsxRuntime.jsx(ArbiContext.Provider, { value: arbi, children });
34
- }
35
-
36
26
  // src/chat/styles.ts
37
27
  var DEFAULT_THEME = {
38
28
  primaryColor: "#00adef",
@@ -355,15 +345,8 @@ function agentStatusStyle(theme) {
355
345
  alignSelf: "flex-start"
356
346
  };
357
347
  }
358
- function useArbi() {
359
- const arbi = React2.useContext(ArbiContext);
360
- if (!arbi) {
361
- throw new Error("useArbi() must be used within an <ArbiProvider>");
362
- }
363
- return arbi;
364
- }
365
348
  function AuthScreen({ theme, labels, onLogin }) {
366
- const arbi = useArbi();
349
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
367
350
  const [mode, setMode] = React2.useState("login");
368
351
  const [step, setStep] = React2.useState("email");
369
352
  const [email, setEmail] = React2.useState("");
@@ -611,7 +594,7 @@ var arbiQueryKeys = {
611
594
  sessions: () => ["arbi", "sessions"],
612
595
  health: () => ["arbi", "health"],
613
596
  tasks: () => ["arbi", "tasks"],
614
- memories: (workspaceId) => ["arbi", "memories", workspaceId],
597
+ notes: (workspaceId) => ["arbi", "notes", workspaceId],
615
598
  configs: () => ["arbi", "configs"],
616
599
  activity: () => ["arbi", "activity"],
617
600
  projects: () => ["arbi", "projects"],
@@ -621,7 +604,7 @@ var arbiQueryKeys = {
621
604
  workspaceChronology: (workspaceId) => ["arbi", "workspaceChronology", workspaceId]
622
605
  };
623
606
  function useWorkspaces(options) {
624
- const arbi = useArbi();
607
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
625
608
  return reactQuery.useQuery({
626
609
  queryKey: arbiQueryKeys.workspaces(),
627
610
  queryFn: () => arbi.workspaces.list(),
@@ -629,7 +612,7 @@ function useWorkspaces(options) {
629
612
  });
630
613
  }
631
614
  function useDocuments(workspaceId, options) {
632
- const arbi = useArbi();
615
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
633
616
  return reactQuery.useQuery({
634
617
  queryKey: arbiQueryKeys.documents(workspaceId ?? ""),
635
618
  queryFn: () => arbi.documents.list(),
@@ -637,7 +620,7 @@ function useDocuments(workspaceId, options) {
637
620
  });
638
621
  }
639
622
  function useConversations(workspaceId, options) {
640
- const arbi = useArbi();
623
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
641
624
  return reactQuery.useQuery({
642
625
  queryKey: arbiQueryKeys.conversations(workspaceId ?? ""),
643
626
  queryFn: () => arbi.conversations.list(),
@@ -645,7 +628,7 @@ function useConversations(workspaceId, options) {
645
628
  });
646
629
  }
647
630
  function useTags(workspaceId, options) {
648
- const arbi = useArbi();
631
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
649
632
  return reactQuery.useQuery({
650
633
  queryKey: arbiQueryKeys.tags(workspaceId ?? ""),
651
634
  queryFn: () => arbi.tags.list(),
@@ -653,7 +636,7 @@ function useTags(workspaceId, options) {
653
636
  });
654
637
  }
655
638
  function useThumbnails(docIds, options) {
656
- const arbi = useArbi();
639
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
657
640
  return reactQuery.useQuery({
658
641
  queryKey: arbiQueryKeys.thumbnails(docIds),
659
642
  queryFn: () => arbi.documents.getThumbnails(docIds),
@@ -662,7 +645,7 @@ function useThumbnails(docIds, options) {
662
645
  });
663
646
  }
664
647
  function useParsedDocument(docId, stage = "final", options) {
665
- const arbi = useArbi();
648
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
666
649
  return reactQuery.useQuery({
667
650
  queryKey: arbiQueryKeys.parsedDoc(docId ?? "", stage),
668
651
  queryFn: () => arbi.documents.getParsedContent(docId, stage),
@@ -670,13 +653,13 @@ function useParsedDocument(docId, stage = "final", options) {
670
653
  });
671
654
  }
672
655
  function useAssistantQuery() {
673
- const arbi = useArbi();
656
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
674
657
  return reactQuery.useMutation({
675
658
  mutationFn: ({ question, ...options }) => arbi.assistant.query(question, options)
676
659
  });
677
660
  }
678
661
  function useAgents(options) {
679
- const arbi = useArbi();
662
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
680
663
  return reactQuery.useQuery({
681
664
  queryKey: arbiQueryKeys.agents(),
682
665
  queryFn: () => arbi.agents.list(),
@@ -684,13 +667,13 @@ function useAgents(options) {
684
667
  });
685
668
  }
686
669
  function useDeleteAgents() {
687
- const arbi = useArbi();
670
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
688
671
  return reactQuery.useMutation({
689
672
  mutationFn: ({ agentExtIds }) => arbi.agents.delete(agentExtIds)
690
673
  });
691
674
  }
692
675
  function useSessions(options) {
693
- const arbi = useArbi();
676
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
694
677
  return reactQuery.useQuery({
695
678
  queryKey: arbiQueryKeys.sessions(),
696
679
  queryFn: () => arbi.sessions.list(),
@@ -698,7 +681,7 @@ function useSessions(options) {
698
681
  });
699
682
  }
700
683
  function useHealth(options) {
701
- const arbi = useArbi();
684
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
702
685
  return reactQuery.useQuery({
703
686
  queryKey: arbiQueryKeys.health(),
704
687
  queryFn: () => arbi.health.check(),
@@ -706,7 +689,7 @@ function useHealth(options) {
706
689
  });
707
690
  }
708
691
  function useTasks(options) {
709
- const arbi = useArbi();
692
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
710
693
  return reactQuery.useQuery({
711
694
  queryKey: arbiQueryKeys.tasks(),
712
695
  queryFn: () => arbi.tasks.list(),
@@ -714,15 +697,15 @@ function useTasks(options) {
714
697
  });
715
698
  }
716
699
  function useMemories(workspaceId, options) {
717
- const arbi = useArbi();
700
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
718
701
  return reactQuery.useQuery({
719
- queryKey: arbiQueryKeys.memories(workspaceId ?? ""),
720
- queryFn: () => arbi.memory.list({ pinnedOnly: options?.pinnedOnly }),
702
+ queryKey: arbiQueryKeys.notes(workspaceId ?? ""),
703
+ queryFn: () => arbi.notes.list({ pinnedOnly: options?.pinnedOnly }),
721
704
  enabled: (options?.enabled ?? true) && !!workspaceId && arbi.hasWorkspace
722
705
  });
723
706
  }
724
707
  function useConfigs(options) {
725
- const arbi = useArbi();
708
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
726
709
  return reactQuery.useQuery({
727
710
  queryKey: arbiQueryKeys.configs(),
728
711
  queryFn: () => arbi.agentConfig.list(),
@@ -730,7 +713,7 @@ function useConfigs(options) {
730
713
  });
731
714
  }
732
715
  function useActivity(options) {
733
- const arbi = useArbi();
716
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
734
717
  return reactQuery.useQuery({
735
718
  queryKey: arbiQueryKeys.activity(),
736
719
  queryFn: () => arbi.dm.listActivity({ limit: options?.limit, offset: options?.offset }),
@@ -738,7 +721,7 @@ function useActivity(options) {
738
721
  });
739
722
  }
740
723
  function useProjects(options) {
741
- const arbi = useArbi();
724
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
742
725
  return reactQuery.useQuery({
743
726
  queryKey: arbiQueryKeys.projects(),
744
727
  queryFn: () => arbi.projects.list(),
@@ -746,7 +729,7 @@ function useProjects(options) {
746
729
  });
747
730
  }
748
731
  function useProjectUsage(projectExtId, monthsBack = 0, options) {
749
- const arbi = useArbi();
732
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
750
733
  return reactQuery.useQuery({
751
734
  queryKey: arbiQueryKeys.projectUsage(projectExtId ?? "", monthsBack),
752
735
  queryFn: () => arbi.projects.usage(projectExtId, monthsBack),
@@ -754,7 +737,7 @@ function useProjectUsage(projectExtId, monthsBack = 0, options) {
754
737
  });
755
738
  }
756
739
  function useProjectsUsage(projectExtIds, monthsBack = 0, options) {
757
- const arbi = useArbi();
740
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
758
741
  const enabled = (options?.enabled ?? true) && arbi.isLoggedIn;
759
742
  const results = reactQuery.useQueries({
760
743
  queries: projectExtIds.map((id) => ({
@@ -819,7 +802,7 @@ function useProjectsUsage(projectExtIds, monthsBack = 0, options) {
819
802
  }, [signature]);
820
803
  }
821
804
  function useProjectInvoices(projectExtId, options) {
822
- const arbi = useArbi();
805
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
823
806
  return reactQuery.useQuery({
824
807
  queryKey: arbiQueryKeys.projectInvoices(projectExtId ?? ""),
825
808
  queryFn: () => arbi.projects.invoices(projectExtId),
@@ -827,7 +810,7 @@ function useProjectInvoices(projectExtId, options) {
827
810
  });
828
811
  }
829
812
  function useUserUsageToday(options) {
830
- const arbi = useArbi();
813
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
831
814
  return reactQuery.useQuery({
832
815
  queryKey: arbiQueryKeys.userUsageToday(),
833
816
  queryFn: () => arbi.user.usageToday(),
@@ -835,7 +818,7 @@ function useUserUsageToday(options) {
835
818
  });
836
819
  }
837
820
  function useWorkspaceChronology(workspaceId, options) {
838
- const arbi = useArbi();
821
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
839
822
  return reactQuery.useQuery({
840
823
  queryKey: arbiQueryKeys.workspaceChronology(workspaceId ?? ""),
841
824
  queryFn: () => arbi.workspaces.chronology(workspaceId),
@@ -843,7 +826,7 @@ function useWorkspaceChronology(workspaceId, options) {
843
826
  });
844
827
  }
845
828
  function WorkspaceScreen({ theme, labels, onSelect }) {
846
- const arbi = useArbi();
829
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
847
830
  const { data: workspaces, isLoading } = useWorkspaces();
848
831
  const [mode, setMode] = React2.useState("select");
849
832
  const [selected, setSelected] = React2.useState("");
@@ -1080,7 +1063,7 @@ function citeChunkStyle(theme) {
1080
1063
  };
1081
1064
  }
1082
1065
  function ChatView({ workspaceId, theme, labels }) {
1083
- const arbi = useArbi();
1066
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
1084
1067
  const { data: docs, refetch: refetchDocs } = useDocuments(workspaceId);
1085
1068
  const mutation = useAssistantQuery();
1086
1069
  const [messages, setMessages] = React2.useState([]);
@@ -1260,7 +1243,7 @@ function ChatView({ workspaceId, theme, labels }) {
1260
1243
  ] });
1261
1244
  }
1262
1245
  function ChatWidget({ theme, labels, initialWorkspaceId, width, height }) {
1263
- const arbi = useArbi();
1246
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
1264
1247
  const [screen, setScreen] = React2.useState("auth");
1265
1248
  const [workspaceId, setWorkspaceId] = React2.useState(initialWorkspaceId);
1266
1249
  const resolveWorkspace = React2.useCallback(async () => {
@@ -1350,7 +1333,7 @@ function ArbiChat({
1350
1333
  }),
1351
1334
  []
1352
1335
  );
1353
- return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(ArbiProvider, { url, children: /* @__PURE__ */ jsxRuntime.jsx(
1336
+ return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(chunkZMTLGO3K_cjs.ArbiProvider, { url, children: /* @__PURE__ */ jsxRuntime.jsx(
1354
1337
  ArbiChatPanel,
1355
1338
  {
1356
1339
  workspaceId,
@@ -1487,7 +1470,7 @@ function useArbiWsContext() {
1487
1470
  return ctx;
1488
1471
  }
1489
1472
  function ArbiWebSocketProvider({ enabled = true, children }) {
1490
- const arbi = useArbi();
1473
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
1491
1474
  const subscribersRef = React2.useRef(/* @__PURE__ */ new Set());
1492
1475
  const setStatus = useArbiWsStore((s) => s.setStatus);
1493
1476
  const applyTaskUpdate = useArbiWsStore((s) => s.applyTaskUpdate);
@@ -1709,7 +1692,7 @@ function useAiTask() {
1709
1692
  };
1710
1693
  }
1711
1694
  function useSemanticSearch(docIds) {
1712
- const arbi = useArbi();
1695
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
1713
1696
  const [query, setQuery] = React2.useState("");
1714
1697
  const mutation = reactQuery.useMutation({
1715
1698
  mutationFn: async ({ query: q, mode }) => {
@@ -2570,18 +2553,15 @@ function DocumentReview({
2570
2553
  const list = [];
2571
2554
  const chunkTag = /* @__PURE__ */ new Map();
2572
2555
  for (const dt of doc?.doctags ?? []) {
2573
- const citations = dt.citations ?? {};
2574
- for (const [citId, cit] of Object.entries(citations)) {
2575
- const chunkIds = cit?.chunk_ids ?? [];
2576
- if (chunkIds.length === 0) continue;
2577
- list.push({
2578
- key: `${dt.tag_ext_id}:${citId}`,
2579
- tagExtId: dt.tag_ext_id,
2580
- statement: cit.statement,
2581
- chunkIds
2582
- });
2583
- for (const cid of chunkIds) if (!chunkTag.has(cid)) chunkTag.set(cid, dt.tag_ext_id);
2584
- }
2556
+ const chunkIds = dt.citations?.passages?.map((p) => p.chunk_id) ?? [];
2557
+ if (chunkIds.length === 0) continue;
2558
+ list.push({
2559
+ key: dt.tag_ext_id,
2560
+ tagExtId: dt.tag_ext_id,
2561
+ statement: dt.note ?? "",
2562
+ chunkIds
2563
+ });
2564
+ for (const cid of chunkIds) if (!chunkTag.has(cid)) chunkTag.set(cid, dt.tag_ext_id);
2585
2565
  }
2586
2566
  return { findings: list, chunkToTag: chunkTag };
2587
2567
  }, [doc?.doctags]);
@@ -2951,8 +2931,8 @@ Question: ${question}`,
2951
2931
  `Suggest 3-6 concise, reusable labels for the document "${docName ?? docId}" \u2014 covering document type, the key issues it touches, and any key parties. Return them as a short comma-separated list with a one-line rationale for each.`,
2952
2932
  [docId]
2953
2933
  );
2954
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", "data-testid": "doc-qa", children: [
2955
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2934
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-3", "data-testid": "doc-qa", children: [
2935
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
2956
2936
  /* @__PURE__ */ jsxRuntime.jsx(
2957
2937
  chunkZBZKHBDS_cjs.Input,
2958
2938
  {
@@ -2960,7 +2940,7 @@ Question: ${question}`,
2960
2940
  onChange: (e) => setQ(e.target.value),
2961
2941
  onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), ask()),
2962
2942
  placeholder: "Ask about this document\u2026",
2963
- className: "bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
2943
+ className: "min-w-0 flex-1 bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
2964
2944
  "data-testid": "doc-qa-input"
2965
2945
  }
2966
2946
  ),
@@ -2971,6 +2951,7 @@ Question: ${question}`,
2971
2951
  size: "icon",
2972
2952
  onClick: ask,
2973
2953
  disabled: task.isRunning || !q.trim(),
2954
+ className: "shrink-0",
2974
2955
  "data-testid": "doc-qa-send",
2975
2956
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "size-4" })
2976
2957
  }
@@ -2982,6 +2963,7 @@ Question: ${question}`,
2982
2963
  size: "sm",
2983
2964
  onClick: suggestTags,
2984
2965
  disabled: task.isRunning,
2966
+ className: "shrink-0",
2985
2967
  "data-testid": "doc-qa-tags",
2986
2968
  children: [
2987
2969
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Tags, { className: "size-4" }),
@@ -4658,6 +4640,20 @@ var ENTITY_MAPPINGS = {
4658
4640
  NEW: lucideReact.StickyNote
4659
4641
  }
4660
4642
  },
4643
+ // Workspace knowledge the assistant retains and recalls — durable free text,
4644
+ // optionally grounded in source passages. Distinct from ANNOTATION, which is
4645
+ // attached TO a document field; a NOTE is workspace-scoped and stands alone.
4646
+ // Stored server-side as `memories` (mem-*); "Note" is the user-facing name.
4647
+ NOTE: {
4648
+ NAMES: {
4649
+ SINGULAR: "Note",
4650
+ PLURAL: "Notes"
4651
+ },
4652
+ ICONS: {
4653
+ DEFAULT: lucideReact.NotebookText,
4654
+ NEW: lucideReact.NotebookPen
4655
+ }
4656
+ },
4661
4657
  USER: {
4662
4658
  NAMES: {
4663
4659
  SINGULAR: "User",
@@ -5316,7 +5312,7 @@ function groupConversations(notifications, myExtId) {
5316
5312
  return conversations;
5317
5313
  }
5318
5314
  function useDirectMessages(options) {
5319
- const arbi = useArbi();
5315
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
5320
5316
  const queryClient = reactQuery.useQueryClient();
5321
5317
  const enabled = options?.enabled ?? arbi.isLoggedIn;
5322
5318
  const query = reactQuery.useQuery({
@@ -6124,9 +6120,11 @@ function DocumentTable({
6124
6120
  workspaceId,
6125
6121
  documents,
6126
6122
  onOpenDocument,
6123
+ openOnRowClick = true,
6127
6124
  selectedIds,
6128
6125
  onSelectionChange,
6129
6126
  height = 480,
6127
+ extraColumns,
6130
6128
  className
6131
6129
  }) {
6132
6130
  const query = useDocuments(workspaceId, { enabled: !documents });
@@ -6258,9 +6256,10 @@ function DocumentTable({
6258
6256
  sortable: true,
6259
6257
  field: "folder",
6260
6258
  valueFormatter: (p) => p.value || "\u2014"
6261
- }
6259
+ },
6260
+ ...extraColumns ?? []
6262
6261
  ],
6263
- [openDocument, viewingDocId, tagNameById]
6262
+ [openDocument, viewingDocId, tagNameById, extraColumns]
6264
6263
  );
6265
6264
  const handleGridReady = (e) => {
6266
6265
  gridApiRef.current = e.api;
@@ -6271,6 +6270,7 @@ function DocumentTable({
6271
6270
  emitSelection(ids);
6272
6271
  };
6273
6272
  const handleRowClicked = (e) => {
6273
+ if (!openOnRowClick) return;
6274
6274
  const id = e.data?.external_id;
6275
6275
  if (id) openDocument(id);
6276
6276
  };
@@ -6520,7 +6520,7 @@ function DocumentCardMenu({
6520
6520
  canDelete = true,
6521
6521
  testId = "document-card-menu"
6522
6522
  }) {
6523
- const arbi = useArbi();
6523
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
6524
6524
  const queryClient = reactQuery.useQueryClient();
6525
6525
  const invalidateDocuments = () => {
6526
6526
  const workspaceId = arbi.getWorkspaceId();
@@ -6664,7 +6664,7 @@ function DocumentGallery({
6664
6664
  },
6665
6665
  [onOpenDocument, setViewingDocId]
6666
6666
  );
6667
- const arbi = useArbi();
6667
+ const arbi = chunkZMTLGO3K_cjs.useArbi();
6668
6668
  const queryClient = reactQuery.useQueryClient();
6669
6669
  const [renamingId, setRenamingId] = React2__default.default.useState(null);
6670
6670
  const rename = reactQuery.useMutation({
@@ -7171,6 +7171,14 @@ Object.defineProperty(exports, "toggleVariants", {
7171
7171
  enumerable: true,
7172
7172
  get: function () { return chunkZBZKHBDS_cjs.toggleVariants; }
7173
7173
  });
7174
+ Object.defineProperty(exports, "ArbiProvider", {
7175
+ enumerable: true,
7176
+ get: function () { return chunkZMTLGO3K_cjs.ArbiProvider; }
7177
+ });
7178
+ Object.defineProperty(exports, "useArbi", {
7179
+ enumerable: true,
7180
+ get: function () { return chunkZMTLGO3K_cjs.useArbi; }
7181
+ });
7174
7182
  Object.defineProperty(exports, "Arbi", {
7175
7183
  enumerable: true,
7176
7184
  get: function () { return browser.Arbi; }
@@ -7196,7 +7204,6 @@ exports.ArbiBotIcon = ArbiBotIcon;
7196
7204
  exports.ArbiChat = ArbiChat;
7197
7205
  exports.ArbiChatPanel = ArbiChatPanel;
7198
7206
  exports.ArbiIcon = ArbiIcon;
7199
- exports.ArbiProvider = ArbiProvider;
7200
7207
  exports.ArbiWebSocketProvider = ArbiWebSocketProvider;
7201
7208
  exports.ArtifactCanvas = ArtifactCanvas;
7202
7209
  exports.AudIcon = AudIcon;
@@ -7290,7 +7297,6 @@ exports.toRedlineMarkdown = toRedlineMarkdown;
7290
7297
  exports.useActivity = useActivity;
7291
7298
  exports.useAgents = useAgents;
7292
7299
  exports.useAiTask = useAiTask;
7293
- exports.useArbi = useArbi;
7294
7300
  exports.useArbiConnected = useArbiConnected;
7295
7301
  exports.useArbiDocumentSync = useArbiDocumentSync;
7296
7302
  exports.useArbiUiStore = useArbiUiStore;