@arbidocs/react 0.4.67 → 0.4.68

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.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkVH5ITITV_cjs = require('./chunk-VH5ITITV.cjs');
3
+ var chunkZ3RRZ3KV_cjs = require('./chunk-Z3RRZ3KV.cjs');
4
4
  var chunkF7KQVVD2_cjs = require('./chunk-F7KQVVD2.cjs');
5
5
  var chunkBWVIAATD_cjs = require('./chunk-BWVIAATD.cjs');
6
6
  var chunkLQ5YHB7W_cjs = require('./chunk-LQ5YHB7W.cjs');
@@ -39,7 +39,7 @@ function useUpdateConversation() {
39
39
  conversationId,
40
40
  patch
41
41
  }) => arbi.conversations.update(conversationId, patch),
42
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.allConversations() })
42
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.allConversations() })
43
43
  });
44
44
  }
45
45
  function useCreateWork() {
@@ -47,7 +47,7 @@ function useCreateWork() {
47
47
  const qc = reactQuery.useQueryClient();
48
48
  return reactQuery.useMutation({
49
49
  mutationFn: (body) => arbi.conversations.createWork(body),
50
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.allConversations() })
50
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.allConversations() })
51
51
  });
52
52
  }
53
53
  function useRunConversation() {
@@ -55,7 +55,7 @@ function useRunConversation() {
55
55
  const qc = reactQuery.useQueryClient();
56
56
  return reactQuery.useMutation({
57
57
  mutationFn: (conversationId) => arbi.conversations.runWithAuth(conversationId),
58
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.allConversations() })
58
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.allConversations() })
59
59
  });
60
60
  }
61
61
  function usePlanWork() {
@@ -67,7 +67,7 @@ function usePlanWork() {
67
67
  function useConversationPendingAuth(conversationId, options) {
68
68
  const arbi = chunkZMTLGO3K_cjs.useArbi();
69
69
  return reactQuery.useQuery({
70
- queryKey: [...chunkVH5ITITV_cjs.arbiQueryKeys.allConversations(), conversationId ?? "", "pending-auth"],
70
+ queryKey: [...chunkZ3RRZ3KV_cjs.arbiQueryKeys.allConversations(), conversationId ?? "", "pending-auth"],
71
71
  queryFn: () => arbi.conversations.pendingAuth(conversationId),
72
72
  enabled: (options?.enabled ?? true) && !!conversationId && arbi.isLoggedIn,
73
73
  retry: false
@@ -76,7 +76,7 @@ function useConversationPendingAuth(conversationId, options) {
76
76
  function useConversationActivity(conversationId, options) {
77
77
  const arbi = chunkZMTLGO3K_cjs.useArbi();
78
78
  return reactQuery.useQuery({
79
- queryKey: [...chunkVH5ITITV_cjs.arbiQueryKeys.allConversations(), conversationId ?? "", "activity"],
79
+ queryKey: [...chunkZ3RRZ3KV_cjs.arbiQueryKeys.allConversations(), conversationId ?? "", "activity"],
80
80
  queryFn: () => arbi.conversations.activity(conversationId),
81
81
  enabled: (options?.enabled ?? true) && !!conversationId && arbi.isLoggedIn,
82
82
  refetchInterval: options?.live ? 2500 : false
@@ -85,7 +85,7 @@ function useConversationActivity(conversationId, options) {
85
85
  function useWorkflows(options) {
86
86
  const arbi = chunkZMTLGO3K_cjs.useArbi();
87
87
  return reactQuery.useQuery({
88
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.workflows(),
88
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.workflows(),
89
89
  queryFn: () => arbi.workflows.list(),
90
90
  refetchInterval: options?.live ? 15e3 : false,
91
91
  enabled: options?.enabled ?? arbi.isLoggedIn
@@ -96,7 +96,7 @@ function useCreateWorkflow() {
96
96
  const qc = reactQuery.useQueryClient();
97
97
  return reactQuery.useMutation({
98
98
  mutationFn: (body) => arbi.workflows.create(body),
99
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.workflows() })
99
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.workflows() })
100
100
  });
101
101
  }
102
102
  function useUpdateWorkflow() {
@@ -107,7 +107,7 @@ function useUpdateWorkflow() {
107
107
  workflowId,
108
108
  patch
109
109
  }) => arbi.workflows.update(workflowId, patch),
110
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.workflows() })
110
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.workflows() })
111
111
  });
112
112
  }
113
113
  function useDeleteWorkflow() {
@@ -115,7 +115,7 @@ function useDeleteWorkflow() {
115
115
  const qc = reactQuery.useQueryClient();
116
116
  return reactQuery.useMutation({
117
117
  mutationFn: (workflowId) => arbi.workflows.delete(workflowId),
118
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.workflows() })
118
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.workflows() })
119
119
  });
120
120
  }
121
121
  function useRunWorkflow() {
@@ -124,8 +124,8 @@ function useRunWorkflow() {
124
124
  return reactQuery.useMutation({
125
125
  mutationFn: (workflowId) => arbi.workflows.run(workflowId),
126
126
  onSuccess: () => Promise.all([
127
- qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.workflows() }),
128
- qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.allConversations() })
127
+ qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.workflows() }),
128
+ qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.allConversations() })
129
129
  ])
130
130
  });
131
131
  }
@@ -134,13 +134,13 @@ function useCreateAgent() {
134
134
  const qc = reactQuery.useQueryClient();
135
135
  return reactQuery.useMutation({
136
136
  mutationFn: (name) => arbi.agents.create(name),
137
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.agents() })
137
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.agents() })
138
138
  });
139
139
  }
140
140
  function useAgentConfig(agentExtId, options) {
141
141
  const arbi = chunkZMTLGO3K_cjs.useArbi();
142
142
  return reactQuery.useQuery({
143
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.agentConfig(agentExtId),
143
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.agentConfig(agentExtId),
144
144
  queryFn: async () => agentExtId ? await arbi.agents.getConfig(agentExtId) : await arbi.agentConfig.get("default"),
145
145
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
146
146
  });
@@ -148,7 +148,7 @@ function useAgentConfig(agentExtId, options) {
148
148
  function useAgentModels(options) {
149
149
  const arbi = chunkZMTLGO3K_cjs.useArbi();
150
150
  return reactQuery.useQuery({
151
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.models(),
151
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.models(),
152
152
  queryFn: async () => (await arbi.agentConfig.getModels()).models.map((m) => m.model_name),
153
153
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
154
154
  });
@@ -171,17 +171,17 @@ function useSaveAgentConfig() {
171
171
  });
172
172
  },
173
173
  onSuccess: (_saved, { agentExtId }) => Promise.all([
174
- qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.configs() }),
175
- qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.agentConfig(agentExtId) }),
174
+ qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.configs() }),
175
+ qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.agentConfig(agentExtId) }),
176
176
  // The agent list shows the pinned persona/model, so it refreshes too.
177
- qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.agents() })
177
+ qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.agents() })
178
178
  ])
179
179
  });
180
180
  }
181
181
  function useAgentWorkspaces(agentExtId, options) {
182
182
  const arbi = chunkZMTLGO3K_cjs.useArbi();
183
183
  return reactQuery.useQuery({
184
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.agentWorkspaces(agentExtId ?? ""),
184
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.agentWorkspaces(agentExtId ?? ""),
185
185
  queryFn: () => arbi.agents.listWorkspaces(agentExtId),
186
186
  enabled: (options?.enabled ?? true) && !!agentExtId && arbi.isLoggedIn
187
187
  });
@@ -202,7 +202,7 @@ function useGrantAgentAccess() {
202
202
  if (!agent?.email) throw new Error("The agent's address is unknown.");
203
203
  return arbi.workspaces.grantAccess({ workspaceId, emails: [agent.email] });
204
204
  },
205
- onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
205
+ onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
206
206
  });
207
207
  }
208
208
  function useRevokeAgentAccess() {
@@ -221,13 +221,13 @@ function useRevokeAgentAccess() {
221
221
  if (previous && previous !== workspaceId) await arbi.selectWorkspace(previous);
222
222
  }
223
223
  },
224
- onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
224
+ onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
225
225
  });
226
226
  }
227
227
  function useSkills(options) {
228
228
  const arbi = chunkZMTLGO3K_cjs.useArbi();
229
229
  return reactQuery.useQuery({
230
- queryKey: [...chunkVH5ITITV_cjs.arbiQueryKeys.skills(), options?.includeHidden ?? false],
230
+ queryKey: [...chunkZ3RRZ3KV_cjs.arbiQueryKeys.skills(), options?.includeHidden ?? false],
231
231
  queryFn: () => arbi.assistant.listSkills({ includeHidden: options?.includeHidden }),
232
232
  refetchInterval: options?.live ? 5e3 : false,
233
233
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn,
@@ -258,7 +258,7 @@ function useUploadSkillFiles() {
258
258
  }
259
259
  return results;
260
260
  },
261
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.skills() })
261
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.skills() })
262
262
  });
263
263
  }
264
264
  function useStartWorkQuery() {
@@ -285,7 +285,7 @@ function useStartWorkQuery() {
285
285
  `The run ${response.id} started, but its thread is not available yet. Do not submit it again.`
286
286
  );
287
287
  },
288
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.allConversations() })
288
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.allConversations() })
289
289
  });
290
290
  }
291
291
  function useAgentSession(agentId, options) {
@@ -439,8 +439,8 @@ function useArbiChat(options = {}) {
439
439
  const recoveryIntervalMs = streamRecovery?.intervalMs ?? 3e3;
440
440
  const recoveryTimeoutMs = streamRecovery?.timeoutMs ?? 12e4;
441
441
  const arbi = chunkZMTLGO3K_cjs.useArbi();
442
- const { data: docs = [], isLoading: isLoadingDocuments, refetch } = chunkVH5ITITV_cjs.useDocuments(workspaceId);
443
- const ordinaryHistory = chunkVH5ITITV_cjs.useConversations(workspaceId, { enabled: !agentId, live: true });
442
+ const { data: docs = [], isLoading: isLoadingDocuments, refetch } = chunkZ3RRZ3KV_cjs.useDocuments(workspaceId);
443
+ const ordinaryHistory = chunkZ3RRZ3KV_cjs.useConversations(workspaceId, { enabled: !agentId, live: true });
444
444
  const agentHistory = useAgentChats(agentId);
445
445
  const stored = React.useMemo(
446
446
  () => agentId ? (agentHistory.data ?? []).filter((chat) => chat.workspace_ext_id === workspaceId).map((chat) => ({
@@ -455,7 +455,7 @@ function useArbiChat(options = {}) {
455
455
  );
456
456
  const isLoadingThreads = agentId ? agentHistory.isLoading : ordinaryHistory.isLoading;
457
457
  const refetchConversations = agentId ? agentHistory.refetch : ordinaryHistory.refetch;
458
- const query = chunkVH5ITITV_cjs.useAssistantQuery();
458
+ const query = chunkZ3RRZ3KV_cjs.useAssistantQuery();
459
459
  const { mutateAsync } = query;
460
460
  const [stagedFiles, setStagedFiles] = React.useState([]);
461
461
  const [threads, setThreads] = React.useState(() => [emptyThread()]);
@@ -515,7 +515,7 @@ function useArbiChat(options = {}) {
515
515
  (conversation) => conversation.external_id === active.conversationId && conversation.status === "generating"
516
516
  ) || active.messages.some((message) => message.status === "streaming");
517
517
  const needsLoad = !!active.conversationId && !active.isLoaded;
518
- const loaded = chunkVH5ITITV_cjs.useConversationThreads(workspaceId, active.conversationId ?? void 0, {
518
+ const loaded = chunkZ3RRZ3KV_cjs.useConversationThreads(workspaceId, active.conversationId ?? void 0, {
519
519
  enabled: needsLoad || liveHistory && !isRunning && !isPostingComment,
520
520
  live: liveHistory
521
521
  });
@@ -1294,14 +1294,14 @@ function useArbiDocumentSync(workspaceId) {
1294
1294
  if (!workspaceId) return;
1295
1295
  if (client.isMessageType(msg, "batch_complete")) {
1296
1296
  if (msg.workspace_ext_id !== workspaceId) return;
1297
- void queryClient.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.documents(workspaceId) });
1298
- void queryClient.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.tags(workspaceId) });
1297
+ void queryClient.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.documents(workspaceId) });
1298
+ void queryClient.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.tags(workspaceId) });
1299
1299
  return;
1300
1300
  }
1301
1301
  if (client.isMessageType(msg, "task_update")) {
1302
1302
  if (msg.workspace_ext_id !== workspaceId) return;
1303
1303
  if (TERMINAL_STATUSES.has(msg.status)) {
1304
- void queryClient.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.documents(workspaceId) });
1304
+ void queryClient.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.documents(workspaceId) });
1305
1305
  }
1306
1306
  }
1307
1307
  });
@@ -1430,7 +1430,7 @@ function useShellWorkspaces(options) {
1430
1430
  }
1431
1431
  function useArbiShellWorkspaces(options = {}) {
1432
1432
  const arbi = chunkZMTLGO3K_cjs.useArbi();
1433
- const query = chunkVH5ITITV_cjs.useWorkspaces();
1433
+ const query = chunkZ3RRZ3KV_cjs.useWorkspaces();
1434
1434
  const { select, ...rest } = options;
1435
1435
  const defaultSelect = React.useCallback(
1436
1436
  (workspace) => arbi.selectWorkspace(workspace.id),
@@ -1447,7 +1447,7 @@ function useArbiShellWorkspaces(options = {}) {
1447
1447
  function useContacts(options) {
1448
1448
  const arbi = chunkZMTLGO3K_cjs.useArbi();
1449
1449
  return reactQuery.useQuery({
1450
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.contacts(),
1450
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.contacts(),
1451
1451
  queryFn: () => arbi.contacts.list(),
1452
1452
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
1453
1453
  });
@@ -1467,7 +1467,7 @@ function useAddContacts() {
1467
1467
  const qc = reactQuery.useQueryClient();
1468
1468
  return reactQuery.useMutation({
1469
1469
  mutationFn: (emails) => arbi.contacts.add(emails),
1470
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.contacts() })
1470
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.contacts() })
1471
1471
  });
1472
1472
  }
1473
1473
  function useRemoveContacts() {
@@ -1475,7 +1475,7 @@ function useRemoveContacts() {
1475
1475
  const qc = reactQuery.useQueryClient();
1476
1476
  return reactQuery.useMutation({
1477
1477
  mutationFn: (contactIds) => arbi.contacts.remove(contactIds),
1478
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.contacts() })
1478
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.contacts() })
1479
1479
  });
1480
1480
  }
1481
1481
  function toProfileView(profile) {
@@ -1487,7 +1487,7 @@ function toProfileView(profile) {
1487
1487
  function useProfile(options) {
1488
1488
  const arbi = chunkZMTLGO3K_cjs.useArbi();
1489
1489
  return reactQuery.useQuery({
1490
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.profile(),
1490
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.profile(),
1491
1491
  queryFn: () => {
1492
1492
  const profile = arbi.user.profile();
1493
1493
  return profile ? toProfileView(profile) : null;
@@ -1510,8 +1510,8 @@ function useUpdateProfile() {
1510
1510
  return profile ? toProfileView(profile) : null;
1511
1511
  },
1512
1512
  onSuccess: (profile) => {
1513
- qc.setQueryData(chunkVH5ITITV_cjs.arbiQueryKeys.profile(), profile);
1514
- return qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.workspaces() });
1513
+ qc.setQueryData(chunkZ3RRZ3KV_cjs.arbiQueryKeys.profile(), profile);
1514
+ return qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.workspaces() });
1515
1515
  }
1516
1516
  });
1517
1517
  }
@@ -1596,7 +1596,7 @@ function useConfirmEmailChange() {
1596
1596
  mutationFn: ({ newEmail, code }) => arbi.account.confirmEmailChange(newEmail, code),
1597
1597
  onSuccess: () => {
1598
1598
  const profile = arbi.user.profile();
1599
- qc.setQueryData(chunkVH5ITITV_cjs.arbiQueryKeys.profile(), profile ? toProfileView(profile) : null);
1599
+ qc.setQueryData(chunkZ3RRZ3KV_cjs.arbiQueryKeys.profile(), profile ? toProfileView(profile) : null);
1600
1600
  }
1601
1601
  });
1602
1602
  }
@@ -1765,7 +1765,7 @@ function toNotificationPreferences(stored, keys) {
1765
1765
  function useUserSettings(options) {
1766
1766
  const arbi = chunkZMTLGO3K_cjs.useArbi();
1767
1767
  return reactQuery.useQuery({
1768
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.userSettings(),
1768
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.userSettings(),
1769
1769
  queryFn: () => arbi.settings.get(),
1770
1770
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
1771
1771
  });
@@ -1778,18 +1778,18 @@ function useNotificationPreferences(keys, options) {
1778
1778
  const save = reactQuery.useMutation({
1779
1779
  mutationFn: (patch) => arbi.settings.update({ email_notifications: patch }),
1780
1780
  onMutate: async (patch) => {
1781
- await qc.cancelQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.userSettings() });
1782
- const previous = qc.getQueryData(chunkVH5ITITV_cjs.arbiQueryKeys.userSettings());
1781
+ await qc.cancelQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.userSettings() });
1782
+ const previous = qc.getQueryData(chunkZ3RRZ3KV_cjs.arbiQueryKeys.userSettings());
1783
1783
  qc.setQueryData(
1784
- chunkVH5ITITV_cjs.arbiQueryKeys.userSettings(),
1784
+ chunkZ3RRZ3KV_cjs.arbiQueryKeys.userSettings(),
1785
1785
  (old) => old ? { ...old, email_notifications: { ...old.email_notifications, ...patch } } : old
1786
1786
  );
1787
1787
  return { previous };
1788
1788
  },
1789
1789
  onError: (_err, _patch, context) => {
1790
- qc.setQueryData(chunkVH5ITITV_cjs.arbiQueryKeys.userSettings(), context?.previous);
1790
+ qc.setQueryData(chunkZ3RRZ3KV_cjs.arbiQueryKeys.userSettings(), context?.previous);
1791
1791
  },
1792
- onSettled: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.userSettings() })
1792
+ onSettled: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.userSettings() })
1793
1793
  });
1794
1794
  const model = React.useMemo(() => toNotificationPreferences(stored, keys), [stored, keys]);
1795
1795
  const setAll = React.useCallback(
@@ -1815,7 +1815,7 @@ function useTerminateSession() {
1815
1815
  const qc = reactQuery.useQueryClient();
1816
1816
  return reactQuery.useMutation({
1817
1817
  mutationFn: (sessionId) => arbi.sessions.terminate(sessionId),
1818
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.sessions() })
1818
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.sessions() })
1819
1819
  });
1820
1820
  }
1821
1821
  function useLogoutAllSessions() {
@@ -1891,7 +1891,7 @@ function useDeleteAccountFlow({
1891
1891
  };
1892
1892
  }
1893
1893
  function useWorkspaceDocs(workspaceId) {
1894
- const { data: docs = [], isLoading, isError } = chunkVH5ITITV_cjs.useDocuments(workspaceId);
1894
+ const { data: docs = [], isLoading, isError } = chunkZ3RRZ3KV_cjs.useDocuments(workspaceId);
1895
1895
  const docIds = React.useMemo(
1896
1896
  () => docs.map((d) => d.external_id).filter((id) => !!id),
1897
1897
  [docs]
@@ -1899,7 +1899,7 @@ function useWorkspaceDocs(workspaceId) {
1899
1899
  return { wsId: workspaceId, docs, docIds, isLoading, isError, ready: docIds.length > 0 };
1900
1900
  }
1901
1901
  function useAiTask() {
1902
- const mutation = chunkVH5ITITV_cjs.useAssistantQuery();
1902
+ const mutation = chunkZ3RRZ3KV_cjs.useAssistantQuery();
1903
1903
  const [status, setStatus] = React.useState("idle");
1904
1904
  const [text, setText] = React.useState("");
1905
1905
  const [stepCount, setStepCount] = React.useState(0);
@@ -2492,8 +2492,8 @@ function DocumentReview({
2492
2492
  onClose,
2493
2493
  className
2494
2494
  }) {
2495
- const parsedQuery = chunkVH5ITITV_cjs.useParsedDocument(docId, stage);
2496
- const tagsQuery = chunkVH5ITITV_cjs.useTags(workspaceId);
2495
+ const parsedQuery = chunkZ3RRZ3KV_cjs.useParsedDocument(docId, stage);
2496
+ const tagsQuery = chunkZ3RRZ3KV_cjs.useTags(workspaceId);
2497
2497
  const tagNameById = React__default.default.useMemo(() => {
2498
2498
  const map = /* @__PURE__ */ new Map();
2499
2499
  for (const t of tagsQuery.data ?? []) {
@@ -2724,7 +2724,7 @@ function SemanticSearch({
2724
2724
  const { results, status, error, search, isRunning, query } = useSemanticSearch(docIds);
2725
2725
  const [value, setValue] = React.useState("");
2726
2726
  const [selected, setSelected] = React.useState(null);
2727
- const { data: docs = [] } = chunkVH5ITITV_cjs.useDocuments(workspaceId, { enabled: !!workspaceId });
2727
+ const { data: docs = [] } = chunkZ3RRZ3KV_cjs.useDocuments(workspaceId, { enabled: !!workspaceId });
2728
2728
  const docMap = React.useMemo(() => {
2729
2729
  const map = /* @__PURE__ */ new Map();
2730
2730
  for (const d of docs) if (d.external_id) map.set(d.external_id, d);
@@ -3828,7 +3828,7 @@ function ActivityFeed({
3828
3828
  enabled,
3829
3829
  "data-testid": testId = "activity-feed"
3830
3830
  }) {
3831
- const { data, isLoading, isError } = chunkVH5ITITV_cjs.useActivity({ limit, enabled });
3831
+ const { data, isLoading, isError } = chunkZ3RRZ3KV_cjs.useActivity({ limit, enabled });
3832
3832
  if (isLoading) {
3833
3833
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkS6A6FSG7_cjs.cn("space-y-2", className), "data-testid": testId, "aria-busy": "true", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 py-1.5", children: [
3834
3834
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4 shrink-0 animate-pulse rounded-full bg-muted" }),
@@ -3979,7 +3979,7 @@ function useDirectMessages(options) {
3979
3979
  enabled
3980
3980
  });
3981
3981
  const contactsQuery = reactQuery.useQuery({
3982
- queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.contacts(),
3982
+ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.contacts(),
3983
3983
  queryFn: () => arbi.contacts.list(),
3984
3984
  enabled
3985
3985
  });
@@ -5150,10 +5150,10 @@ function DocumentTable({
5150
5150
  extraColumns,
5151
5151
  className
5152
5152
  }) {
5153
- const query = chunkVH5ITITV_cjs.useDocuments(workspaceId, { enabled: !documents });
5153
+ const query = chunkZ3RRZ3KV_cjs.useDocuments(workspaceId, { enabled: !documents });
5154
5154
  const rows = documents ?? query.data ?? [];
5155
5155
  const isLoading = !documents && query.isLoading;
5156
- const tagsQuery = chunkVH5ITITV_cjs.useTags(workspaceId);
5156
+ const tagsQuery = chunkZ3RRZ3KV_cjs.useTags(workspaceId);
5157
5157
  const tagNameById = React__default.default.useMemo(() => {
5158
5158
  const map = /* @__PURE__ */ new Map();
5159
5159
  for (const t of tagsQuery.data ?? []) {
@@ -5334,7 +5334,7 @@ function DocumentCardMenu({
5334
5334
  const invalidateDocuments = () => {
5335
5335
  const workspaceId = arbi.getWorkspaceId();
5336
5336
  if (workspaceId) {
5337
- void queryClient.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.documents(workspaceId) });
5337
+ void queryClient.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.documents(workspaceId) });
5338
5338
  }
5339
5339
  };
5340
5340
  const download = reactQuery.useMutation({
@@ -5433,10 +5433,10 @@ function DocumentGallery({
5433
5433
  minTileWidth = 148,
5434
5434
  className
5435
5435
  }) {
5436
- const query = chunkVH5ITITV_cjs.useDocuments(workspaceId, { enabled: !documents });
5436
+ const query = chunkZ3RRZ3KV_cjs.useDocuments(workspaceId, { enabled: !documents });
5437
5437
  const rows = documents ?? query.data ?? [];
5438
5438
  const isLoading = !documents && query.isLoading;
5439
- const tagsQuery = chunkVH5ITITV_cjs.useTags(workspaceId);
5439
+ const tagsQuery = chunkZ3RRZ3KV_cjs.useTags(workspaceId);
5440
5440
  const tagNameById = React__default.default.useMemo(() => {
5441
5441
  const map = /* @__PURE__ */ new Map();
5442
5442
  for (const t of tagsQuery.data ?? []) {
@@ -5448,7 +5448,7 @@ function DocumentGallery({
5448
5448
  () => rows.map((d) => d.external_id).filter((id) => !!id),
5449
5449
  [rows]
5450
5450
  );
5451
- const thumbsQuery = chunkVH5ITITV_cjs.useThumbnails(docIds);
5451
+ const thumbsQuery = chunkZ3RRZ3KV_cjs.useThumbnails(docIds);
5452
5452
  const thumbs = thumbsQuery.data ?? {};
5453
5453
  const storeSelected = useArbiUiStore((s) => s.selectedDocIds);
5454
5454
  const storeSetSelected = useArbiUiStore((s) => s.setSelectedDocIds);
@@ -5484,7 +5484,7 @@ function DocumentGallery({
5484
5484
  setRenamingId(null);
5485
5485
  const activeWorkspace = workspaceId ?? arbi.getWorkspaceId();
5486
5486
  if (activeWorkspace) {
5487
- void queryClient.invalidateQueries({ queryKey: chunkVH5ITITV_cjs.arbiQueryKeys.documents(activeWorkspace) });
5487
+ void queryClient.invalidateQueries({ queryKey: chunkZ3RRZ3KV_cjs.arbiQueryKeys.documents(activeWorkspace) });
5488
5488
  }
5489
5489
  }
5490
5490
  });
@@ -6102,139 +6102,139 @@ function hasVideoTrack(blob) {
6102
6102
 
6103
6103
  Object.defineProperty(exports, "DEFAULT_USD_PER_CREDIT", {
6104
6104
  enumerable: true,
6105
- get: function () { return chunkVH5ITITV_cjs.DEFAULT_USD_PER_CREDIT; }
6105
+ get: function () { return chunkZ3RRZ3KV_cjs.DEFAULT_USD_PER_CREDIT; }
6106
6106
  });
6107
6107
  Object.defineProperty(exports, "arbiQueryKeys", {
6108
6108
  enumerable: true,
6109
- get: function () { return chunkVH5ITITV_cjs.arbiQueryKeys; }
6109
+ get: function () { return chunkZ3RRZ3KV_cjs.arbiQueryKeys; }
6110
6110
  });
6111
6111
  Object.defineProperty(exports, "cleanDraftMarkdown", {
6112
6112
  enumerable: true,
6113
- get: function () { return chunkVH5ITITV_cjs.cleanDraftMarkdown; }
6113
+ get: function () { return chunkZ3RRZ3KV_cjs.cleanDraftMarkdown; }
6114
6114
  });
6115
6115
  Object.defineProperty(exports, "cleanDraftWithReport", {
6116
6116
  enumerable: true,
6117
- get: function () { return chunkVH5ITITV_cjs.cleanDraftWithReport; }
6117
+ get: function () { return chunkZ3RRZ3KV_cjs.cleanDraftWithReport; }
6118
6118
  });
6119
6119
  Object.defineProperty(exports, "creditsToUsd", {
6120
6120
  enumerable: true,
6121
- get: function () { return chunkVH5ITITV_cjs.creditsToUsd; }
6121
+ get: function () { return chunkZ3RRZ3KV_cjs.creditsToUsd; }
6122
6122
  });
6123
6123
  Object.defineProperty(exports, "formatCredits", {
6124
6124
  enumerable: true,
6125
- get: function () { return chunkVH5ITITV_cjs.formatCredits; }
6125
+ get: function () { return chunkZ3RRZ3KV_cjs.formatCredits; }
6126
6126
  });
6127
6127
  Object.defineProperty(exports, "isUsageMetered", {
6128
6128
  enumerable: true,
6129
- get: function () { return chunkVH5ITITV_cjs.isUsageMetered; }
6129
+ get: function () { return chunkZ3RRZ3KV_cjs.isUsageMetered; }
6130
6130
  });
6131
6131
  Object.defineProperty(exports, "promoteBoldTitle", {
6132
6132
  enumerable: true,
6133
- get: function () { return chunkVH5ITITV_cjs.promoteBoldTitle; }
6133
+ get: function () { return chunkZ3RRZ3KV_cjs.promoteBoldTitle; }
6134
6134
  });
6135
6135
  Object.defineProperty(exports, "repairParsedStructure", {
6136
6136
  enumerable: true,
6137
- get: function () { return chunkVH5ITITV_cjs.repairParsedStructure; }
6137
+ get: function () { return chunkZ3RRZ3KV_cjs.repairParsedStructure; }
6138
6138
  });
6139
6139
  Object.defineProperty(exports, "repairParsedTitle", {
6140
6140
  enumerable: true,
6141
- get: function () { return chunkVH5ITITV_cjs.repairParsedTitle; }
6141
+ get: function () { return chunkZ3RRZ3KV_cjs.repairParsedTitle; }
6142
6142
  });
6143
6143
  Object.defineProperty(exports, "stripAgentPreamble", {
6144
6144
  enumerable: true,
6145
- get: function () { return chunkVH5ITITV_cjs.stripAgentPreamble; }
6145
+ get: function () { return chunkZ3RRZ3KV_cjs.stripAgentPreamble; }
6146
6146
  });
6147
6147
  Object.defineProperty(exports, "unescapeMarkdown", {
6148
6148
  enumerable: true,
6149
- get: function () { return chunkVH5ITITV_cjs.unescapeMarkdown; }
6149
+ get: function () { return chunkZ3RRZ3KV_cjs.unescapeMarkdown; }
6150
6150
  });
6151
6151
  Object.defineProperty(exports, "unwrapCitationLinks", {
6152
6152
  enumerable: true,
6153
- get: function () { return chunkVH5ITITV_cjs.unwrapCitationLinks; }
6153
+ get: function () { return chunkZ3RRZ3KV_cjs.unwrapCitationLinks; }
6154
6154
  });
6155
6155
  Object.defineProperty(exports, "useActivity", {
6156
6156
  enumerable: true,
6157
- get: function () { return chunkVH5ITITV_cjs.useActivity; }
6157
+ get: function () { return chunkZ3RRZ3KV_cjs.useActivity; }
6158
6158
  });
6159
6159
  Object.defineProperty(exports, "useAgents", {
6160
6160
  enumerable: true,
6161
- get: function () { return chunkVH5ITITV_cjs.useAgents; }
6161
+ get: function () { return chunkZ3RRZ3KV_cjs.useAgents; }
6162
6162
  });
6163
6163
  Object.defineProperty(exports, "useAssistantQuery", {
6164
6164
  enumerable: true,
6165
- get: function () { return chunkVH5ITITV_cjs.useAssistantQuery; }
6165
+ get: function () { return chunkZ3RRZ3KV_cjs.useAssistantQuery; }
6166
6166
  });
6167
6167
  Object.defineProperty(exports, "useConfigs", {
6168
6168
  enumerable: true,
6169
- get: function () { return chunkVH5ITITV_cjs.useConfigs; }
6169
+ get: function () { return chunkZ3RRZ3KV_cjs.useConfigs; }
6170
6170
  });
6171
6171
  Object.defineProperty(exports, "useConversationThreads", {
6172
6172
  enumerable: true,
6173
- get: function () { return chunkVH5ITITV_cjs.useConversationThreads; }
6173
+ get: function () { return chunkZ3RRZ3KV_cjs.useConversationThreads; }
6174
6174
  });
6175
6175
  Object.defineProperty(exports, "useConversations", {
6176
6176
  enumerable: true,
6177
- get: function () { return chunkVH5ITITV_cjs.useConversations; }
6177
+ get: function () { return chunkZ3RRZ3KV_cjs.useConversations; }
6178
6178
  });
6179
6179
  Object.defineProperty(exports, "useDeleteAgents", {
6180
6180
  enumerable: true,
6181
- get: function () { return chunkVH5ITITV_cjs.useDeleteAgents; }
6181
+ get: function () { return chunkZ3RRZ3KV_cjs.useDeleteAgents; }
6182
6182
  });
6183
6183
  Object.defineProperty(exports, "useDocuments", {
6184
6184
  enumerable: true,
6185
- get: function () { return chunkVH5ITITV_cjs.useDocuments; }
6185
+ get: function () { return chunkZ3RRZ3KV_cjs.useDocuments; }
6186
6186
  });
6187
6187
  Object.defineProperty(exports, "useFacts", {
6188
6188
  enumerable: true,
6189
- get: function () { return chunkVH5ITITV_cjs.useFacts; }
6189
+ get: function () { return chunkZ3RRZ3KV_cjs.useFacts; }
6190
6190
  });
6191
6191
  Object.defineProperty(exports, "useHealth", {
6192
6192
  enumerable: true,
6193
- get: function () { return chunkVH5ITITV_cjs.useHealth; }
6193
+ get: function () { return chunkZ3RRZ3KV_cjs.useHealth; }
6194
6194
  });
6195
6195
  Object.defineProperty(exports, "useParsedDocument", {
6196
6196
  enumerable: true,
6197
- get: function () { return chunkVH5ITITV_cjs.useParsedDocument; }
6197
+ get: function () { return chunkZ3RRZ3KV_cjs.useParsedDocument; }
6198
6198
  });
6199
6199
  Object.defineProperty(exports, "useProjectInvoices", {
6200
6200
  enumerable: true,
6201
- get: function () { return chunkVH5ITITV_cjs.useProjectInvoices; }
6201
+ get: function () { return chunkZ3RRZ3KV_cjs.useProjectInvoices; }
6202
6202
  });
6203
6203
  Object.defineProperty(exports, "useProjectUsage", {
6204
6204
  enumerable: true,
6205
- get: function () { return chunkVH5ITITV_cjs.useProjectUsage; }
6205
+ get: function () { return chunkZ3RRZ3KV_cjs.useProjectUsage; }
6206
6206
  });
6207
6207
  Object.defineProperty(exports, "useProjects", {
6208
6208
  enumerable: true,
6209
- get: function () { return chunkVH5ITITV_cjs.useProjects; }
6209
+ get: function () { return chunkZ3RRZ3KV_cjs.useProjects; }
6210
6210
  });
6211
6211
  Object.defineProperty(exports, "useProjectsUsage", {
6212
6212
  enumerable: true,
6213
- get: function () { return chunkVH5ITITV_cjs.useProjectsUsage; }
6213
+ get: function () { return chunkZ3RRZ3KV_cjs.useProjectsUsage; }
6214
6214
  });
6215
6215
  Object.defineProperty(exports, "useSessions", {
6216
6216
  enumerable: true,
6217
- get: function () { return chunkVH5ITITV_cjs.useSessions; }
6217
+ get: function () { return chunkZ3RRZ3KV_cjs.useSessions; }
6218
6218
  });
6219
6219
  Object.defineProperty(exports, "useTags", {
6220
6220
  enumerable: true,
6221
- get: function () { return chunkVH5ITITV_cjs.useTags; }
6221
+ get: function () { return chunkZ3RRZ3KV_cjs.useTags; }
6222
6222
  });
6223
6223
  Object.defineProperty(exports, "useThumbnails", {
6224
6224
  enumerable: true,
6225
- get: function () { return chunkVH5ITITV_cjs.useThumbnails; }
6225
+ get: function () { return chunkZ3RRZ3KV_cjs.useThumbnails; }
6226
6226
  });
6227
6227
  Object.defineProperty(exports, "useUserUsageToday", {
6228
6228
  enumerable: true,
6229
- get: function () { return chunkVH5ITITV_cjs.useUserUsageToday; }
6229
+ get: function () { return chunkZ3RRZ3KV_cjs.useUserUsageToday; }
6230
6230
  });
6231
6231
  Object.defineProperty(exports, "useWorkspaceUsers", {
6232
6232
  enumerable: true,
6233
- get: function () { return chunkVH5ITITV_cjs.useWorkspaceUsers; }
6233
+ get: function () { return chunkZ3RRZ3KV_cjs.useWorkspaceUsers; }
6234
6234
  });
6235
6235
  Object.defineProperty(exports, "useWorkspaces", {
6236
6236
  enumerable: true,
6237
- get: function () { return chunkVH5ITITV_cjs.useWorkspaces; }
6237
+ get: function () { return chunkZ3RRZ3KV_cjs.useWorkspaces; }
6238
6238
  });
6239
6239
  Object.defineProperty(exports, "DEFAULT_NOTIFY_TONE", {
6240
6240
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -902,6 +902,12 @@ declare function useConversationThreads(workspaceId: string | undefined, convers
902
902
  record: {
903
903
  [x: string]: unknown;
904
904
  };
905
+ } | {
906
+ name: "facts_context";
907
+ description: string;
908
+ tool_args: {
909
+ fact_ext_ids: string[];
910
+ };
905
911
  } | {
906
912
  name: "image_generation";
907
913
  description: string;
@@ -1060,13 +1066,11 @@ declare function useHealth(options?: {
1060
1066
  /** List the open workspace's facts. */
1061
1067
  declare function useFacts(workspaceId: string | undefined, options?: {
1062
1068
  enabled?: boolean;
1063
- pinnedOnly?: boolean;
1064
1069
  }): _tanstack_react_query.UseQueryResult<NoInfer<{
1065
1070
  text: string;
1066
1071
  citations?: _arbidocs_client.components["schemas"]["CitationSources"] | null;
1067
1072
  external_id: string;
1068
1073
  workspace_ext_id: string;
1069
- pinned: boolean;
1070
1074
  shared: boolean;
1071
1075
  confirmed: boolean;
1072
1076
  date_start?: string | null;
package/dist/index.d.ts CHANGED
@@ -902,6 +902,12 @@ declare function useConversationThreads(workspaceId: string | undefined, convers
902
902
  record: {
903
903
  [x: string]: unknown;
904
904
  };
905
+ } | {
906
+ name: "facts_context";
907
+ description: string;
908
+ tool_args: {
909
+ fact_ext_ids: string[];
910
+ };
905
911
  } | {
906
912
  name: "image_generation";
907
913
  description: string;
@@ -1060,13 +1066,11 @@ declare function useHealth(options?: {
1060
1066
  /** List the open workspace's facts. */
1061
1067
  declare function useFacts(workspaceId: string | undefined, options?: {
1062
1068
  enabled?: boolean;
1063
- pinnedOnly?: boolean;
1064
1069
  }): _tanstack_react_query.UseQueryResult<NoInfer<{
1065
1070
  text: string;
1066
1071
  citations?: _arbidocs_client.components["schemas"]["CitationSources"] | null;
1067
1072
  external_id: string;
1068
1073
  workspace_ext_id: string;
1069
- pinned: boolean;
1070
1074
  shared: boolean;
1071
1075
  confirmed: boolean;
1072
1076
  date_start?: string | null;