@arbidocs/react 0.4.131 → 0.4.133
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/artifacts/index.cjs +55 -56
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.js +4 -6
- package/dist/artifacts/index.js.map +1 -1
- package/dist/{chunk-BOJHNPNJ.cjs → chunk-6PPWZILQ.cjs} +16 -11
- package/dist/chunk-6PPWZILQ.cjs.map +1 -0
- package/dist/{chunk-BUFDJCDS.js → chunk-CPPBN2JB.js} +9 -7
- package/dist/chunk-CPPBN2JB.js.map +1 -0
- package/dist/{chunk-UN3AZUXX.cjs → chunk-E5XFVK4I.cjs} +42 -29
- package/dist/chunk-E5XFVK4I.cjs.map +1 -0
- package/dist/{chunk-G6FHNURH.js → chunk-NNWMHMEC.js} +60 -3
- package/dist/chunk-NNWMHMEC.js.map +1 -0
- package/dist/{chunk-6AWF4HFU.js → chunk-PPRKQK4P.js} +16 -11
- package/dist/chunk-PPRKQK4P.js.map +1 -0
- package/dist/{chunk-XIDDXD5Y.cjs → chunk-R2MF7YCW.cjs} +9 -7
- package/dist/chunk-R2MF7YCW.cjs.map +1 -0
- package/dist/{chunk-XV7EOUQM.js → chunk-T253I7XC.js} +17 -5
- package/dist/chunk-T253I7XC.js.map +1 -0
- package/dist/{chunk-S7J5SCTZ.cjs → chunk-TYUQFRHF.cjs} +4 -4
- package/dist/{chunk-S7J5SCTZ.cjs.map → chunk-TYUQFRHF.cjs.map} +1 -1
- package/dist/{chunk-6JSXDLIQ.js → chunk-ZJ6NQ4M4.js} +3 -3
- package/dist/{chunk-6JSXDLIQ.js.map → chunk-ZJ6NQ4M4.js.map} +1 -1
- package/dist/{chunk-5DCRIWCA.cjs → chunk-ZWFMFOGP.cjs} +68 -2
- package/dist/chunk-ZWFMFOGP.cjs.map +1 -0
- package/dist/document-tools/index.cjs +26 -27
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.js +4 -5
- package/dist/document-tools/index.js.map +1 -1
- package/dist/{index-C7OqcKY3.d.cts → index-D8NvRj3J.d.cts} +16 -7
- package/dist/{index-C7OqcKY3.d.ts → index-D8NvRj3J.d.ts} +16 -7
- package/dist/index.cjs +372 -225
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +174 -23
- package/dist/index.d.ts +174 -23
- package/dist/index.js +173 -40
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +10 -6
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/viewers/index.cjs +2 -2
- package/dist/viewers/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-5DCRIWCA.cjs.map +0 -1
- package/dist/chunk-6AWF4HFU.js.map +0 -1
- package/dist/chunk-74UTKIWQ.js +0 -62
- package/dist/chunk-74UTKIWQ.js.map +0 -1
- package/dist/chunk-BOJHNPNJ.cjs.map +0 -1
- package/dist/chunk-BUFDJCDS.js.map +0 -1
- package/dist/chunk-G6FHNURH.js.map +0 -1
- package/dist/chunk-NUFEZBA5.cjs +0 -72
- package/dist/chunk-NUFEZBA5.cjs.map +0 -1
- package/dist/chunk-UN3AZUXX.cjs.map +0 -1
- package/dist/chunk-XIDDXD5Y.cjs.map +0 -1
- package/dist/chunk-XV7EOUQM.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-
|
|
2
|
-
export { PROJECT_CREATION_DENIED_REASON, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFacts, useFirmPool, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useTags, useThumbnails, useTopUpFirmPool, useUserUsageToday, useWorkspaceActivity, useWorkspaceUsers, useWorkspaces } from './chunk-
|
|
3
|
-
import { downloadBlob } from './chunk-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { arbiQueryKeys, arbiMutationKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-T253I7XC.js';
|
|
2
|
+
export { PROJECT_CREATION_DENIED_REASON, arbiMutationKeys, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFacts, useFirmPool, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useTags, useThumbnails, useTopUpFirmPool, useUserUsageToday, useWorkspaceActivity, useWorkspaceUsers, useWorkspaces } from './chunk-T253I7XC.js';
|
|
3
|
+
import { downloadBlob } from './chunk-ZJ6NQ4M4.js';
|
|
4
|
+
import { parseVersionRef } from './chunk-NNWMHMEC.js';
|
|
5
|
+
export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from './chunk-NNWMHMEC.js';
|
|
6
|
+
import './chunk-WUTL62MC.js';
|
|
7
|
+
import { formatRelativeTime } from './chunk-PPRKQK4P.js';
|
|
8
|
+
export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-PPRKQK4P.js';
|
|
7
9
|
import { returnFocusToMark, MarkMenu, AiMarkdown, Card, Badge, TagEntity, Input, FILE_TYPE_COLORS, getEntityIcon, UserEntity, getEntityColorStyles, AgentBadge, Textarea, Label, Slider, DocumentEntity, DocumentCard, useAudioRecorder, MicWaveformIndicator, IconToggle, classifyMediaError, formatElapsed, PassageCard } from './chunk-J3BYHBKW.js';
|
|
8
10
|
export { AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS, Badge, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_SEGMENTER_CONFIG, DebouncedInput, DictateProvider, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, INITIAL_SEGMENTER_STATE, IconToggle, ImgIcon, InlineMicButton, Input, Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ShieldIcon, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TxtIcon, UserEntity, UserMenu, VIDEO_MIME_PREFERENCE, VISIBILITY_ICONS, VerifiedBadge, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, agentAvatarColors, badgeVariants, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, flushSegmenter, formatElapsed, getDocIcon, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, levelFromRms, pickRecorderMimeType, stepSegmenter, toggleVariants, useAudioRecorder } from './chunk-J3BYHBKW.js';
|
|
9
11
|
import { MarkdownRenderer } from './chunk-C44GO33B.js';
|
|
@@ -19,8 +21,8 @@ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMe
|
|
|
19
21
|
import { cn } from './chunk-SN5YV6FF.js';
|
|
20
22
|
export { cn } from './chunk-SN5YV6FF.js';
|
|
21
23
|
import { AudioViewer, ImageViewer, VideoViewer } from './chunk-HDCRPPBW.js';
|
|
22
|
-
import { useArbi, ArbiContext } from './chunk-
|
|
23
|
-
export { ArbiProvider, useArbi, useDeploymentDomain } from './chunk-
|
|
24
|
+
import { useArbi, ArbiContext } from './chunk-CPPBN2JB.js';
|
|
25
|
+
export { ArbiProvider, useArbi, useDeploymentDomain } from './chunk-CPPBN2JB.js';
|
|
24
26
|
import React, { memo, useState, createContext, useMemo, useCallback, useEffect, useRef, useLayoutEffect, useContext, useId, useSyncExternalStore, Fragment as Fragment$1 } from 'react';
|
|
25
27
|
import { useQueryClient, useMutation, useQuery, onlineManager } from '@tanstack/react-query';
|
|
26
28
|
import { resolveCitations, summarizeCitations, settings, formatFileSize, connectWithReconnect, chats, identityErrorCode } from '@arbidocs/sdk/browser';
|
|
@@ -107,7 +109,7 @@ function useConversationPendingAuth(conversationId, options) {
|
|
|
107
109
|
function useConversationActivity(conversationId, options) {
|
|
108
110
|
const arbi = useArbi();
|
|
109
111
|
return useQuery({
|
|
110
|
-
queryKey:
|
|
112
|
+
queryKey: arbiQueryKeys.conversationActivity(conversationId ?? ""),
|
|
111
113
|
queryFn: () => arbi.conversations.activity(conversationId),
|
|
112
114
|
enabled: (options?.enabled ?? true) && !!conversationId && arbi.isLoggedIn,
|
|
113
115
|
refetchInterval: options?.live ? 2500 : false
|
|
@@ -118,8 +120,20 @@ function useWorkflows(options) {
|
|
|
118
120
|
return useQuery({
|
|
119
121
|
queryKey: arbiQueryKeys.workflows(),
|
|
120
122
|
queryFn: () => arbi.workflows.list(),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
// A clock or event can fire while the list is open, without a write here.
|
|
124
|
+
refetchInterval: options?.live ? 1e4 : false,
|
|
125
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function useWorkflowRuns(workflowId) {
|
|
129
|
+
const arbi = useArbi();
|
|
130
|
+
return useQuery({
|
|
131
|
+
queryKey: arbiQueryKeys.workflowRuns(workflowId ?? ""),
|
|
132
|
+
queryFn: () => arbi.workflows.runs(workflowId),
|
|
133
|
+
enabled: !!workflowId && arbi.isLoggedIn,
|
|
134
|
+
refetchInterval: 3e3,
|
|
135
|
+
staleTime: 0,
|
|
136
|
+
refetchOnMount: "always"
|
|
123
137
|
});
|
|
124
138
|
}
|
|
125
139
|
function useCreateWorkflow() {
|
|
@@ -153,6 +167,7 @@ function useRunWorkflow() {
|
|
|
153
167
|
const arbi = useArbi();
|
|
154
168
|
const qc = useQueryClient();
|
|
155
169
|
return useMutation({
|
|
170
|
+
mutationKey: arbiMutationKeys.runWorkflow(),
|
|
156
171
|
mutationFn: (workflowId) => arbi.workflows.run(workflowId),
|
|
157
172
|
onSuccess: () => Promise.all([
|
|
158
173
|
qc.invalidateQueries({ queryKey: arbiQueryKeys.workflows() }),
|
|
@@ -168,6 +183,30 @@ function useCreateAgent() {
|
|
|
168
183
|
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.agents() })
|
|
169
184
|
});
|
|
170
185
|
}
|
|
186
|
+
function useGenerateAgentAvatar() {
|
|
187
|
+
const arbi = useArbi();
|
|
188
|
+
const qc = useQueryClient();
|
|
189
|
+
return useMutation({
|
|
190
|
+
mutationFn: ({ agentExtId, prompt }) => arbi.agents.generateAvatar(agentExtId, prompt),
|
|
191
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.agents() })
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function useAuthorizeLimits(options) {
|
|
195
|
+
const arbi = useArbi();
|
|
196
|
+
return useQuery({
|
|
197
|
+
queryKey: arbiQueryKeys.authorizeLimits(),
|
|
198
|
+
queryFn: () => arbi.agents.authorizeLimits(),
|
|
199
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function useMcpTools(options) {
|
|
203
|
+
const arbi = useArbi();
|
|
204
|
+
return useQuery({
|
|
205
|
+
queryKey: arbiQueryKeys.mcpTools(),
|
|
206
|
+
queryFn: () => arbi.health.mcpTools(),
|
|
207
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
208
|
+
});
|
|
209
|
+
}
|
|
171
210
|
function useAgentConfig(agentExtId, options) {
|
|
172
211
|
const arbi = useArbi();
|
|
173
212
|
return useQuery({
|
|
@@ -322,7 +361,7 @@ function useStartWorkQuery() {
|
|
|
322
361
|
function useAgentSession(agentId, options) {
|
|
323
362
|
const arbi = useArbi();
|
|
324
363
|
return useQuery({
|
|
325
|
-
queryKey:
|
|
364
|
+
queryKey: arbiQueryKeys.agentSession(agentId ?? ""),
|
|
326
365
|
queryFn: () => arbi.agents.getSession(agentId),
|
|
327
366
|
enabled: !!agentId && arbi.isLoggedIn && (options?.enabled ?? true),
|
|
328
367
|
refetchInterval: 5e3
|
|
@@ -331,26 +370,36 @@ function useAgentSession(agentId, options) {
|
|
|
331
370
|
function useAgentChats(agentId) {
|
|
332
371
|
const arbi = useArbi();
|
|
333
372
|
return useQuery({
|
|
334
|
-
queryKey:
|
|
373
|
+
queryKey: arbiQueryKeys.agentChats(agentId ?? ""),
|
|
335
374
|
queryFn: () => arbi.agents.listChats(agentId),
|
|
336
375
|
enabled: !!agentId && arbi.isLoggedIn,
|
|
337
376
|
refetchInterval: 5e3
|
|
338
377
|
});
|
|
339
378
|
}
|
|
379
|
+
function refreshAgentSession(qc, agentId) {
|
|
380
|
+
return Promise.all(
|
|
381
|
+
[
|
|
382
|
+
arbiQueryKeys.agentSession(agentId),
|
|
383
|
+
arbiQueryKeys.agentWorkspaces(agentId),
|
|
384
|
+
arbiQueryKeys.agentChats(agentId),
|
|
385
|
+
arbiQueryKeys.sessions()
|
|
386
|
+
].map((queryKey) => qc.invalidateQueries({ queryKey }))
|
|
387
|
+
);
|
|
388
|
+
}
|
|
340
389
|
function useStartAgentSession() {
|
|
341
390
|
const arbi = useArbi();
|
|
342
|
-
const
|
|
391
|
+
const qc = useQueryClient();
|
|
343
392
|
return useMutation({
|
|
344
393
|
mutationFn: ({ agentId, workspaceId }) => arbi.agents.startSession(agentId, workspaceId),
|
|
345
|
-
onSuccess: () =>
|
|
394
|
+
onSuccess: (_session, { agentId }) => refreshAgentSession(qc, agentId)
|
|
346
395
|
});
|
|
347
396
|
}
|
|
348
397
|
function useCloseAgentSession() {
|
|
349
398
|
const arbi = useArbi();
|
|
350
|
-
const
|
|
399
|
+
const qc = useQueryClient();
|
|
351
400
|
return useMutation({
|
|
352
401
|
mutationFn: (agentId) => arbi.agents.closeSession(agentId),
|
|
353
|
-
onSuccess: () =>
|
|
402
|
+
onSuccess: (_result, agentId) => refreshAgentSession(qc, agentId)
|
|
354
403
|
});
|
|
355
404
|
}
|
|
356
405
|
function previewText(content) {
|
|
@@ -2096,12 +2145,19 @@ function useFollowThread(conversationId, options) {
|
|
|
2096
2145
|
const save = useRelevanceSave();
|
|
2097
2146
|
const following = !!conversationId && !!settings$1.data?.followed_threads?.includes(conversationId);
|
|
2098
2147
|
const setFollowing = useCallback(
|
|
2099
|
-
(on) => {
|
|
2148
|
+
(on, callbacks) => {
|
|
2100
2149
|
if (!conversationId) return;
|
|
2101
2150
|
const current = qc.getQueryData(arbiQueryKeys.userSettings()) ?? settings$1.data;
|
|
2102
|
-
save.mutate(
|
|
2103
|
-
|
|
2104
|
-
|
|
2151
|
+
save.mutate(
|
|
2152
|
+
{
|
|
2153
|
+
followed_threads: settings.withMembership(
|
|
2154
|
+
current?.followed_threads,
|
|
2155
|
+
conversationId,
|
|
2156
|
+
on
|
|
2157
|
+
)
|
|
2158
|
+
},
|
|
2159
|
+
callbacks
|
|
2160
|
+
);
|
|
2105
2161
|
},
|
|
2106
2162
|
[qc, save, settings$1.data, conversationId]
|
|
2107
2163
|
);
|
|
@@ -6178,12 +6234,89 @@ function CommandPaletteProvider({
|
|
|
6178
6234
|
/* @__PURE__ */ jsx(CommandPalette, { open: isOpen, onOpenChange: setIsOpen, ...paletteProps })
|
|
6179
6235
|
] });
|
|
6180
6236
|
}
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6237
|
+
|
|
6238
|
+
// src/session/store.ts
|
|
6239
|
+
var EMPTY_SESSION_STATE = {
|
|
6240
|
+
workspaceId: null,
|
|
6241
|
+
conversationId: null,
|
|
6242
|
+
viewingDocument: null,
|
|
6243
|
+
selectedDocumentIds: [],
|
|
6244
|
+
generating: {},
|
|
6245
|
+
paMode: false,
|
|
6246
|
+
conversationDocuments: {}
|
|
6247
|
+
};
|
|
6248
|
+
var selectViewingDocumentId = (state) => state.viewingDocument ? parseVersionRef(state.viewingDocument.id).docId : null;
|
|
6249
|
+
var selectIsGenerating = (conversationId) => (state) => !!conversationId && !!state.generating[conversationId]?.isGenerating;
|
|
6250
|
+
function nextViewingDocument(current, input) {
|
|
6251
|
+
if (!input) return null;
|
|
6252
|
+
const same = current?.id === input.id;
|
|
6253
|
+
return {
|
|
6254
|
+
id: input.id,
|
|
6255
|
+
page: input.page !== void 0 ? input.page : same ? current?.page ?? null : null,
|
|
6256
|
+
passageId: input.passageId !== void 0 ? input.passageId : current?.passageId ?? null
|
|
6257
|
+
};
|
|
6258
|
+
}
|
|
6259
|
+
function createArbiSessionStore(initial = {}) {
|
|
6260
|
+
let state = { ...EMPTY_SESSION_STATE, ...initial };
|
|
6261
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
6262
|
+
const update = (patch) => {
|
|
6263
|
+
state = { ...state, ...patch };
|
|
6264
|
+
listeners.forEach((listener) => listener());
|
|
6265
|
+
};
|
|
6266
|
+
return {
|
|
6267
|
+
getState: () => state,
|
|
6268
|
+
subscribe: (listener) => {
|
|
6269
|
+
listeners.add(listener);
|
|
6270
|
+
return () => listeners.delete(listener);
|
|
6271
|
+
},
|
|
6272
|
+
setWorkspaceId: (workspaceId) => {
|
|
6273
|
+
if (state.workspaceId !== workspaceId) update({ workspaceId });
|
|
6274
|
+
},
|
|
6275
|
+
setConversationId: (conversationId) => {
|
|
6276
|
+
if (state.conversationId !== conversationId) update({ conversationId });
|
|
6277
|
+
},
|
|
6278
|
+
setViewingDocument: (input) => update({ viewingDocument: nextViewingDocument(state.viewingDocument, input) }),
|
|
6279
|
+
setSelectedDocumentIds: (ids) => update({ selectedDocumentIds: ids }),
|
|
6280
|
+
setConversationGenerating: (conversationId, isGenerating) => {
|
|
6281
|
+
const current = state.generating[conversationId];
|
|
6282
|
+
update({
|
|
6283
|
+
generating: {
|
|
6284
|
+
...state.generating,
|
|
6285
|
+
[conversationId]: {
|
|
6286
|
+
isGenerating,
|
|
6287
|
+
error: isGenerating ? null : current?.error ?? null,
|
|
6288
|
+
startTime: isGenerating ? Date.now() : null
|
|
6289
|
+
}
|
|
6290
|
+
}
|
|
6291
|
+
});
|
|
6292
|
+
},
|
|
6293
|
+
setPaMode: (paMode) => {
|
|
6294
|
+
if (state.paMode !== paMode) update({ paMode });
|
|
6295
|
+
},
|
|
6296
|
+
setConversationDocuments: (conversationId, documents) => update({
|
|
6297
|
+
conversationDocuments: { ...state.conversationDocuments, [conversationId]: documents }
|
|
6298
|
+
})
|
|
6299
|
+
};
|
|
6300
|
+
}
|
|
6301
|
+
var ArbiSessionStoreContext = createContext(null);
|
|
6302
|
+
var moduleDefault = null;
|
|
6303
|
+
var defaultStore = () => moduleDefault ??= createArbiSessionStore();
|
|
6304
|
+
function ArbiSessionStateProvider({
|
|
6305
|
+
store,
|
|
6306
|
+
children
|
|
6307
|
+
}) {
|
|
6308
|
+
const enclosing = useContext(ArbiSessionStoreContext);
|
|
6309
|
+
const [own] = useState(createArbiSessionStore);
|
|
6310
|
+
return /* @__PURE__ */ jsx(ArbiSessionStoreContext.Provider, { value: store ?? enclosing ?? own, children });
|
|
6311
|
+
}
|
|
6312
|
+
function useArbiSessionStore() {
|
|
6313
|
+
return useContext(ArbiSessionStoreContext) ?? defaultStore();
|
|
6314
|
+
}
|
|
6315
|
+
function useArbiSessionState(selector) {
|
|
6316
|
+
const store = useArbiSessionStore();
|
|
6317
|
+
const select = () => selector(store.getState());
|
|
6318
|
+
return useSyncExternalStore(store.subscribe, select, select);
|
|
6319
|
+
}
|
|
6187
6320
|
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
6188
6321
|
function formatBytes(bytes) {
|
|
6189
6322
|
if (bytes == null || Number.isNaN(bytes)) return "\u2014";
|
|
@@ -6228,19 +6361,19 @@ function DocumentTable({
|
|
|
6228
6361
|
}
|
|
6229
6362
|
return map;
|
|
6230
6363
|
}, [tagsQuery.data]);
|
|
6231
|
-
const
|
|
6232
|
-
const
|
|
6233
|
-
const
|
|
6234
|
-
const
|
|
6364
|
+
const session = useArbiSessionStore();
|
|
6365
|
+
const storeSelected = useArbiSessionState((s) => s.selectedDocumentIds);
|
|
6366
|
+
const storeSetSelected = session.setSelectedDocumentIds;
|
|
6367
|
+
const viewingDocId = useArbiSessionState(selectViewingDocumentId);
|
|
6235
6368
|
const effectiveSelected = selectedIds ?? storeSelected;
|
|
6236
6369
|
const emitSelection = onSelectionChange ?? storeSetSelected;
|
|
6237
6370
|
const gridApiRef = React.useRef(null);
|
|
6238
6371
|
const openDocument = React.useCallback(
|
|
6239
6372
|
(id) => {
|
|
6240
|
-
|
|
6373
|
+
session.setViewingDocument({ id });
|
|
6241
6374
|
onOpenDocument?.(id);
|
|
6242
6375
|
},
|
|
6243
|
-
[onOpenDocument,
|
|
6376
|
+
[onOpenDocument, session]
|
|
6244
6377
|
);
|
|
6245
6378
|
const applySelection = React.useCallback(() => {
|
|
6246
6379
|
const api = gridApiRef.current;
|
|
@@ -6517,10 +6650,10 @@ function DocumentGallery({
|
|
|
6517
6650
|
);
|
|
6518
6651
|
const thumbsQuery = useThumbnails(docIds);
|
|
6519
6652
|
const thumbs = thumbsQuery.data ?? {};
|
|
6520
|
-
const
|
|
6521
|
-
const
|
|
6522
|
-
const
|
|
6523
|
-
const
|
|
6653
|
+
const session = useArbiSessionStore();
|
|
6654
|
+
const storeSelected = useArbiSessionState((s) => s.selectedDocumentIds);
|
|
6655
|
+
const storeSetSelected = session.setSelectedDocumentIds;
|
|
6656
|
+
const viewingDocId = useArbiSessionState(selectViewingDocumentId);
|
|
6524
6657
|
const effectiveSelected = selectedIds ?? storeSelected;
|
|
6525
6658
|
const emitSelection = onSelectionChange ?? storeSetSelected;
|
|
6526
6659
|
const selectedSet = React.useMemo(() => new Set(effectiveSelected), [effectiveSelected]);
|
|
@@ -6535,10 +6668,10 @@ function DocumentGallery({
|
|
|
6535
6668
|
);
|
|
6536
6669
|
const openDocument = React.useCallback(
|
|
6537
6670
|
(id) => {
|
|
6538
|
-
|
|
6671
|
+
session.setViewingDocument({ id });
|
|
6539
6672
|
onOpenDocument?.(id);
|
|
6540
6673
|
},
|
|
6541
|
-
[onOpenDocument,
|
|
6674
|
+
[onOpenDocument, session]
|
|
6542
6675
|
);
|
|
6543
6676
|
const arbi = useArbi();
|
|
6544
6677
|
const queryClient = useQueryClient();
|
|
@@ -7167,6 +7300,6 @@ function hasVideoTrack(blob) {
|
|
|
7167
7300
|
});
|
|
7168
7301
|
}
|
|
7169
7302
|
|
|
7170
|
-
export { AccountClientProvider, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiWebSocketProvider, ArtifactCanvas, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DraftTitleControls, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MailClientProvider, MailOfflineUnavailableError, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiAccountClient, arbiMailClient, captureFrameAsBlob, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, downloadRecoveryFile, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useAccountClient, useActOnStep, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync,
|
|
7303
|
+
export { AccountClientProvider, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiSessionStateProvider, ArbiWebSocketProvider, ArtifactCanvas, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DraftTitleControls, EMPTY_SESSION_STATE, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MailClientProvider, MailOfflineUnavailableError, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiAccountClient, arbiMailClient, captureFrameAsBlob, createArbiSessionStore, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, downloadRecoveryFile, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, nextViewingDocument, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, selectIsGenerating, selectViewingDocumentId, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useAccountClient, useActOnStep, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiSessionState, useArbiSessionStore, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAuthorizeLimits, useAvatarCrop, useCameraStream, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationUsage, useCreateAgent, useCreateContact, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteContact, useDeleteWorkflow, useDirectMessages, useDisconnectMailAccount, useEmailChange, useFilteredProjects, useFollowThread, useGenerateAgentAvatar, useGrantAgentAccess, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useInviteContacts, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useMcpTools, useNameEditor, useNotificationPreferences, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetTagValues, useShellWorkspaces, useSignOut, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTerminateSession, useUpdateContact, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflowRuns, useWorkflows, useWorkspaceDocs, useWorkspaceNotificationLevel, userDisplayName, userInitials, workflowStepOf };
|
|
7171
7304
|
//# sourceMappingURL=index.js.map
|
|
7172
7305
|
//# sourceMappingURL=index.js.map
|