@arbidocs/react 0.5.31 → 0.5.32

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.js CHANGED
@@ -1,10 +1,10 @@
1
- import { invalidateConversationLists, patchConversation, invalidateConversationDetails, removeConversationFromLists, addConversationToList, findConversation, isConversationShared, isKnownSoloConversation, patchConversationList, useAccountClient, myChatId, upsertChat, appendToThread, dropFromThread, deleteChatMessage, removeChat, applyChatEvent, applyCallEvent } from './chunk-WYGX24QO.js';
2
- export { AUDIENCE_CHOICES, CALL_CAPTION_TOPIC, CALL_CHAT_MAX_CHARS, CALL_CHAT_TOPIC, CALL_MODERATION_TOPIC, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, CALL_WEBINAR_TOPIC, CAPTION_MAX_CHARS, COMPOSITE_AUDIO_BITS_PER_SECOND, COMPOSITE_VIDEO_BITS_PER_SECOND, DEFAULT_JOIN_CHOICES, EMPTY_CALL_SESSION, EXPORT_SAMPLE_RATE, HISTORY_LIMIT, LIVE_SEGMENTER, MAX_AVATAR_FILE_BYTES, MUTED_DEDUPE_MS, PLAYBACK_LOOKAHEAD_MS, READ_ONLY_MEETING_TEXT, RECORDING_CHUNK_MS, RECORDING_SEGMENTER, SEGMENT_FRAME_MS, SEGMENT_ID_PATTERN, SEGMENT_PRE_ROLL_MS, SHORT_PIECE_MERGE_GAP_MS, SPEAKER_AUDIO_BITS_PER_SECOND, TrackUploader, UPLOAD_ATTEMPTS, UPLOAD_BACKOFF_MS, acceptRing, addConversationToList, appendToThread, applyAgentDmStatus, applyCallEvent, applyChatEvent, applyChatMessage, applyChatRead, applyChatUpdated, arbiAccountClient, buildMeetingChatBody, cachedChat, cachedChats, callLink, callMemberKeys, callSession, chatByExtId, chatHasLiveCall, chatLiveCallId, chatTranscriptRef, clearMeetingChatCache, clearTrackUploaders, clockTime, compositeFiles, compositeTrack, conversationKeyForCall, createMutedNotifier, createTrackCutter, cutAtPauses, declineRing, decodeCallChatPacket, decodeCaptionPacket, decodeMono16k, decryptPart, encodeCallChatPacket, encodeCaptionPacket, encodeWav, encryptPart, ensureMeetingChat, entitlementRefusal, extensionFor, fetchPart, fileSafe, findConversation, floatToWav, formatTranscriptMarkdown, getOpenChat, hasRecordingTranscript, invalidateCall, invalidateConversationDetails, invalidateConversationLists, isConversationListKey, isConversationShared, isKnownSoloConversation, isRecordingOver, isRecordingSegmentId, isRetryable, isWorkspaceGuestOf, joinFromPreJoin, knownMeetingChat, loadMeetingHistory, markRejoining, meetingChatRefFrom, meetingRefForCall, mergeChatLines, mutedNoticeFromEvent, mutedNoticeFromPacket, mutedNoticeText, myChatId, newPacketId, newSegmentId, newTrackKey, nextSeqAfter, onCallEvent, openCall, openQuestion, openRecording, parseWebinarPacket, partKey, partOffsetMs, partsDue, patchConversation, patchConversationList, persistMeetingMessage, persistTranscriptSegment, playheadAt, postRecordingDocsToThread, postTranscriptToThread, recordingFiles, recordingWindowsOf, rejoinAsAudience, removeChat, removeConversationFromLists, resetCallSession, resolveMeetingChat, saveRecordingFilesToThread, schedulePart, sealQuestionText, serverCallsExperimental, setOpenChat, sortTranscriptMessages, sortedParts, speakerTracks, speakerWav, splitIntoFiles, standalone, startChatCall, startContactsCall, startDmCall, startThreadCall, startsMediaFile, storeTranscriptSegment, stripSpeakerPrefix, supersedeLiveTranscript, supersededTranscriptLines, threadHasLiveCall, threadLiveCallId, threadTranscriptLines, threadTranscriptRef, threadTranscriptText, timelineDurationMs, timelineOf, toProfileView, trackUploaderFor, transcribeRecording, transcriptPersistRole, transcriptSegmentOf, unwrapTrackKey, upsertChat, useAccountClient, useAvatarCrop, useCall, useCallInviteLinks, useCallRecording, useCallRecordings, useCallSession, useCallTranscriptionAvailable, useCallsConfig, useCallsEnabled, useCanHostCalls, useEntitlements, useIsEntitled, useMeetingReadOnly, useNameEditor, useOpenCallMeetingChat, useProfile, useRecordingActions, useRecordingWindows, useRevokeCallInviteLink, useSaveToThread, useServerCallsEnabled, useServerCallsExperimental, useUpdateProfile, wrapTrackKey, writeSamples } from './chunk-WYGX24QO.js';
3
- import { settledByRows, isStaleTaskUpdate, replayableTagMutations, patchDocuments, setCachedDocument, adjustTagCounts, patchCachedDocument, forgetDocuments, getCachedDocuments, refreshDocuments, FINISHED_DOCUMENT_STATUSES, useSimilarDocuments, SIMILARITY_THRESHOLD, useDocuments, finishEntityExtraction } from './chunk-VHGJG32Q.js';
4
- export { DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, FINISHED_DOCUMENT_STATUSES, IN_FLIGHT_DOCUMENT_STATUSES, SIMILARITY_THRESHOLD, adjustTagCounts, dropTagFromCachedDocuments, finishEntityExtraction, forgetDocuments, getCachedDocuments, invalidateTagData, invalidateTagTables, isDocumentsLoading, isRowNewer, isStaleTaskUpdate, patchCachedDocument, patchDocuments, patchWorkspaceTags, refreshDocuments, resolveDocumentStatus, setCachedDocument, settledByRows, startEntityExtraction, stopDocumentsLoading, subscribeDocumentRows, upsertDocuments, useCreateTag, useDeleteTag, useDocument, useDocuments, useDocumentsById, useDocumentsLoading, useEntityExtractionDocIds, useExtractEntities, useInvalidateTagData, useIsCreatingTag, useSetTagValues, useSimilarDocuments, useTagKindSchema, useUpdateTag, useUpdateTagKindSchema } from './chunk-VHGJG32Q.js';
5
- import { useArbiSessionState, useConversations, useArbiSession, useWorkspaces, useConfig, useArbiSessionStore, useAvailableModels, useParsedDocument, useTags, selectDraft, useConversationThreads, createArbiSessionStore, useAgents, useAssistantQuery, useActivity, queuedMessages, MIN_QUEUED_MESSAGE_VISIBILITY_MS } from './chunk-CIWI5UFT.js';
6
- export { DEFAULT_DOCUMENT_VIEWER_STATE, EMPTY_SESSION_STATE, MAX_THREAD_TABS, MIN_QUEUED_MESSAGE_VISIBILITY_MS, PROJECT_CREATION_DENIED_REASON, agentControl, clearSealedDrafts, conversationKey, createArbiSessionStore, createSealedDraftStorage, isUsageMetered, nextViewingDocument, queuedMessages, selectDraft, selectIsGenerating, selectViewingDocumentId, threadTabId, useActivity, useAgents, useArbiSession, useArbiSessionState, useArbiSessionStore, useAssistantQuery, useAvailableModels, useBoxRole, useBuiltinCommands, useCanCreateProjects, useConfig, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocumentVersionList, useFirmPool, useHealth, useMessageDetails, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSignedInSession, useTags, useThumbnails, useTopUpFirmPool, useUserUsageToday, useWorkspaceActivity, useWorkspaces } from './chunk-CIWI5UFT.js';
7
- import { fetchDocumentFile, downloadBlob, fetchMarkupPdf } from './chunk-KOLCL4KV.js';
1
+ import { invalidateConversationLists, patchConversation, invalidateConversationDetails, removeConversationFromLists, addConversationToList, findConversation, isConversationShared, isKnownSoloConversation, patchConversationList, useAccountClient, myChatId, upsertChat, appendToThread, dropFromThread, deleteChatMessage, removeChat, getOpenChat, cachedChat, applyChatEvent, applyCallEvent } from './chunk-R4YLLLCT.js';
2
+ export { AUDIENCE_CHOICES, CALL_CAPTION_TOPIC, CALL_CHAT_MAX_CHARS, CALL_CHAT_TOPIC, CALL_MODERATION_TOPIC, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, CALL_WEBINAR_TOPIC, CAPTION_MAX_CHARS, COMPOSITE_AUDIO_BITS_PER_SECOND, COMPOSITE_VIDEO_BITS_PER_SECOND, DEFAULT_JOIN_CHOICES, EMPTY_CALL_SESSION, EXPORT_SAMPLE_RATE, HISTORY_LIMIT, LIVE_SEGMENTER, MAX_AVATAR_FILE_BYTES, MUTED_DEDUPE_MS, PLAYBACK_LOOKAHEAD_MS, READ_ONLY_MEETING_TEXT, RECORDING_CHUNK_MS, RECORDING_SEGMENTER, SEGMENT_FRAME_MS, SEGMENT_ID_PATTERN, SEGMENT_PRE_ROLL_MS, SHORT_PIECE_MERGE_GAP_MS, SPEAKER_AUDIO_BITS_PER_SECOND, TrackUploader, UPLOAD_ATTEMPTS, UPLOAD_BACKOFF_MS, acceptRing, addConversationToList, appendToThread, applyAgentDmStatus, applyCallEvent, applyChatEvent, applyChatMessage, applyChatRead, applyChatUpdated, arbiAccountClient, buildMeetingChatBody, cachedChat, cachedChats, callLink, callMemberKeys, callSession, chatByExtId, chatHasLiveCall, chatLiveCallId, chatTranscriptRef, clearMeetingChatCache, clearTrackUploaders, clockTime, compositeFiles, compositeTrack, conversationKeyForCall, createMutedNotifier, createTrackCutter, cutAtPauses, declineRing, decodeCallChatPacket, decodeCaptionPacket, decodeMono16k, decryptPart, encodeCallChatPacket, encodeCaptionPacket, encodeWav, encryptPart, ensureMeetingChat, entitlementRefusal, extensionFor, fetchPart, fileSafe, findConversation, floatToWav, formatTranscriptMarkdown, getOpenChat, hasRecordingTranscript, invalidateCall, invalidateConversationDetails, invalidateConversationLists, isConversationListKey, isConversationShared, isKnownSoloConversation, isRecordingOver, isRecordingSegmentId, isRetryable, isWorkspaceGuestOf, joinFromPreJoin, knownMeetingChat, loadMeetingHistory, markRejoining, meetingChatRefFrom, meetingRefForCall, mergeChatLines, mutedNoticeFromEvent, mutedNoticeFromPacket, mutedNoticeText, myChatId, newPacketId, newSegmentId, newTrackKey, nextSeqAfter, onCallEvent, openCall, openQuestion, openRecording, parseWebinarPacket, partKey, partOffsetMs, partsDue, patchConversation, patchConversationList, persistMeetingMessage, persistTranscriptSegment, playheadAt, postRecordingDocsToThread, postTranscriptToThread, recordingFiles, recordingWindowsOf, rejoinAsAudience, removeChat, removeConversationFromLists, resetCallSession, resolveMeetingChat, saveRecordingFilesToThread, schedulePart, sealQuestionText, serverCallsExperimental, setOpenChat, sortTranscriptMessages, sortedParts, speakerTracks, speakerWav, splitIntoFiles, standalone, startChatCall, startContactsCall, startDmCall, startThreadCall, startsMediaFile, storeTranscriptSegment, stripSpeakerPrefix, supersedeLiveTranscript, supersededTranscriptLines, threadHasLiveCall, threadLiveCallId, threadTranscriptLines, threadTranscriptRef, threadTranscriptText, timelineDurationMs, timelineOf, toProfileView, trackUploaderFor, transcribeRecording, transcriptPersistRole, transcriptSegmentOf, unwrapTrackKey, upsertChat, useAccountClient, useAvatarCrop, useCall, useCallInviteLinks, useCallRecording, useCallRecordings, useCallSession, useCallTranscriptionAvailable, useCallsConfig, useCallsEnabled, useCanHostCalls, useEntitlements, useIsEntitled, useMeetingReadOnly, useNameEditor, useOpenCallMeetingChat, useProfile, useRecordingActions, useRecordingWindows, useRevokeCallInviteLink, useSaveToThread, useServerCallsEnabled, useServerCallsExperimental, useUpdateProfile, wrapTrackKey, writeSamples } from './chunk-R4YLLLCT.js';
3
+ import { replayableTagMutations, patchDocuments, setCachedDocument, adjustTagCounts, patchCachedDocument, FINISHED_DOCUMENT_STATUSES, refreshDocuments, getCachedDocuments, useArbiWsStore, IN_FLIGHT_DOCUMENT_STATUSES, forgetDocuments, useSimilarDocuments, SIMILARITY_THRESHOLD, useDocuments, finishEntityExtraction } from './chunk-MJWUUDYT.js';
4
+ export { DISMISSED_TASK_TTL_MS, DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, FINISHED_DOCUMENT_STATUSES, IN_FLIGHT_DOCUMENT_STATUSES, SIMILARITY_THRESHOLD, adjustTagCounts, dropTagFromCachedDocuments, finishEntityExtraction, forgetDocuments, getCachedDocuments, invalidateTagData, invalidateTagTables, isDocumentsLoading, isRowNewer, isStaleTaskUpdate, patchCachedDocument, patchDocuments, patchWorkspaceTags, refreshDocuments, resolveDocumentStatus, setCachedDocument, settledByRows, startEntityExtraction, stopDocumentsLoading, subscribeDocumentRows, upsertDocuments, useArbiWsStore, useCreateTag, useDeleteTag, useDocument, useDocuments, useDocumentsById, useDocumentsLoading, useEntityExtractionDocIds, useExtractEntities, useInvalidateTagData, useIsCreatingTag, useRefreshDocuments, useSetTagValues, useSimilarDocuments, useTagKindSchema, useUpdateTag, useUpdateTagKindSchema } from './chunk-MJWUUDYT.js';
5
+ import { useArbiSessionState, useConversations, useArbiSession, useWorkspaces, useConfig, useArbiSessionStore, useAvailableModels, useParsedDocument, useTags, selectDraft, useConversationThreads, createArbiSessionStore, useAgents, useAssistantQuery, useActivity, queuedMessages, MIN_QUEUED_MESSAGE_VISIBILITY_MS } from './chunk-VTNFF7P6.js';
6
+ export { DEFAULT_DOCUMENT_VIEWER_STATE, EMPTY_SESSION_STATE, MAX_THREAD_TABS, MIN_QUEUED_MESSAGE_VISIBILITY_MS, PROJECT_CREATION_DENIED_REASON, agentControl, clearSealedDrafts, closePanelIn, conversationKey, createArbiLayoutStore, createArbiSessionStore, createDebouncedWriter, createSealedDraftStorage, createStoragePersist, defaultLayoutState, dmTabId, flushOnPageExit, isPanelOpen, isUsageMetered, layoutActionsOf, nextViewingDocument, openPanelIn, panelPlace, parseSavedLayout, queuedMessages, restoreLayout, savedLayoutOf, selectDraft, selectIsGenerating, selectViewingDocumentId, threadTabId, useActivity, useAgents, useArbiSession, useArbiSessionState, useArbiSessionStore, useAssistantQuery, useAvailableModels, useBoxRole, useBuiltinCommands, useCanCreateProjects, useConfig, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocumentVersionList, useFirmPool, useHealth, useMessageDetails, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSessionView, useSignedInSession, useTags, useThumbnails, useTopUpFirmPool, useTransientView, useUserUsageToday, useWorkspaceActivity, useWorkspaces } from './chunk-VTNFF7P6.js';
7
+ import { fetchDocumentFile, downloadBlob, fetchMarkupPdf, fetchDocumentPdf } from './chunk-KOLCL4KV.js';
8
8
  import { arbiMutationKeys, arbiQueryKeys, mailQueryKeys, connectorQueryKeys, calendarQueryKeys } from './chunk-PBXJFMES.js';
9
9
  export { arbiMutationKeys, arbiQueryKeys, calendarQueryKeys, callQueryKeys, connectorQueryKeys, isUnderQueryKey, mailQueryKeys } from './chunk-PBXJFMES.js';
10
10
  import { ArbiHost, extractMentions, UNBOUND, bindingOfRow, readLegacyThreadDocuments, forgetLegacyThreadDocuments, toMessageMentions, takeDocumentForTurn, hasMessageBody, createSearchSession, clearSearchSession } from './chunk-CMNZI4WQ.js';
@@ -14,10 +14,7 @@ export { DEFAULT_NOTIFY_TONE, MAX_SESSION_NOTIFICATIONS, configureNotify, notify
14
14
  export { mergeHostConfig } from './chunk-DPYBZDJB.js';
15
15
  export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from './chunk-NNWMHMEC.js';
16
16
  import './chunk-WUTL62MC.js';
17
- import { AudioViewer, ImageViewer, VideoViewer } from './chunk-HDCRPPBW.js';
18
- import { useArbi, useArbiHost } from './chunk-MB34NKBZ.js';
19
- export { useArbi, useArbiHost, useDeploymentDomain } from './chunk-MB34NKBZ.js';
20
- import { returnFocusToMark, MarkMenu, getDocumentTitle, Badge, TagEntity, useAudioRecorder, MicWaveformIndicator, IconToggle, classifyMediaError, formatElapsed, AiMarkdown, Card, Input, FILE_TYPE_COLORS, getEntityIcon, UserEntity, getEntityColorStyles, AgentBadge, Textarea, Slider, getEntityLabel, getDocumentDate } from './chunk-KUGZXI7V.js';
17
+ import { returnFocusToMark, MarkMenu, getDocumentTitle, Badge, TagEntity, useAudioRecorder, MicWaveformIndicator, IconToggle, classifyMediaError, formatElapsed, AiMarkdown, Card, Input, FILE_TYPE_COLORS, getEntityIcon, UserEntity, getEntityColorStyles, AgentBadge, Textarea, Slider, getEntityLabel, getDocumentDate, usesOriginalBytesForViewer } from './chunk-KUGZXI7V.js';
21
18
  export { ARBI_MARK_SRC, AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, BASE_COLORS, Badge, COLUMN_LABEL_FALLBACKS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ClaudeIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_METADATA_TAGS, DebouncedInput, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, FireworksIcon, GeminiIcon, GoogleIcon, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, IconToggle, ImgIcon, InlineMicButton, Input, Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY, OpenAIIcon, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, ProviderIcon, 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, VerifiedToggle, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, agentAvatarColors, badgeVariants, buildFolderTree, canonicalFolderPath, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, entityNoun, extensionFromMime, formatDocDate, formatElapsed, formatFolderLabel, formatFriendlyDate, friendlyFileType, getDocIcon, getDocumentAuthor, getDocumentDate, getDocumentNature, getDocumentSubject, getDocumentTitle, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getFileExtension, getFileTypeIcon, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, isAudioFile, isDocumentAddableToConversation, isDownloadOnlyFile, isImageDocument, isImageFile, isMediaFile, isVideoFile, markdownToPlainText, markdownToPlainTextBlocks, pickRecorderMimeType, tagKindNouns, tagKindTitle, toggleVariants, useAudioRecorder, useDictateContext, usesOriginalBytesForViewer } from './chunk-KUGZXI7V.js';
22
19
  import { getUserDisplayName, isAgent } from './chunk-APZZQZ6P.js';
23
20
  export { Avatar, AvatarFallback, AvatarImage, DEFAULT_SEGMENTER_CONFIG, INITIAL_SEGMENTER_STATE, createUserAvatarIcon, flushSegmenter, getUserAvatarColor, getUserDisplayName, getUserInitials, isAgent, levelFromRms, stepSegmenter } from './chunk-APZZQZ6P.js';
@@ -33,15 +30,18 @@ import { normalizeCitationMarkup } from './chunk-QRCMKEE6.js';
33
30
  export { closeOpenEmphasis, normalizeCitationMarkup, trimOpenCitation } from './chunk-QRCMKEE6.js';
34
31
  import { cn } from './chunk-SN5YV6FF.js';
35
32
  export { cn } from './chunk-SN5YV6FF.js';
33
+ import { AudioViewer, ImageViewer, VideoViewer } from './chunk-HDCRPPBW.js';
34
+ import { useArbi, useArbiHost } from './chunk-MB34NKBZ.js';
35
+ export { useArbi, useArbiHost, useDeploymentDomain } from './chunk-MB34NKBZ.js';
36
36
  export { useHostConfigRecord } from './chunk-CPZ36AQS.js';
37
37
  import React, { memo, useState, createContext, useMemo, useCallback, useEffect, useRef, useLayoutEffect, useSyncExternalStore, useContext, useId } from 'react';
38
38
  import { useQueryClient, useMutation, useQuery, onlineManager, partialMatchKey, useMutationState, keepPreviousData, useQueries } from '@tanstack/react-query';
39
39
  import { documents, doctags, houseTemplates, STOP_ID_WAIT_MS, resolveCitations, summarizeCitations, createIndexAssigner, reduceOutputItem, findReplyTarget, ArbiApiError, quotaFromStreamError, STOP_REPEAT_WINDOW_MS, getRunToCancel, pickMainThread, extractDocumentIdsFromMessages, extractFactIdsFromMessages, hydrateAgentSteps, getSubagentBranchRecord, getRunToAttach, settings, isConnectorVendorVisible, ACCOUNT_VENDOR, searchChunks, formatFileSize, chats, connectWithReconnect, ArbiWorkspaceSupersededError, identityErrorCode } from '@arbidocs/sdk/browser';
40
40
  export { ACCOUNT_VENDOR, Arbi, ArbiError, DEFAULT_AI_USD_PER_GBP, DRIVE_SYNC_VENDORS, GOOGLE_VENDORS, IMANAGE_VENDORS, MAILBOX_SYNC_VENDORS, MAX_RETRIEVE_DOC_IDS, MICROSOFT_VENDORS, PublicBookingError, SHAREPOINT_VENDORS, bookPublicSlot, cancelPublicBooking, connectErrorMessage, formatGbp, formatGbpPerMillionTokens, getPublicBookingPage, isConnectorVendorVisible, isDriveSyncVendor, isMailboxSyncVendor, isSharePointVendor, usdToGbp } from '@arbidocs/sdk/browser';
41
- import { create } from 'zustand';
42
41
  import { Link, Trash2, CheckCheck, Check, MoreHorizontal, SquarePen, Pencil, Download, X, Mic, Pause, Play, Square, Loader2, RotateCcw, Sparkles, Camera, Circle, AlertTriangle, ShieldCheck, Copy, FileText, GitCompareArrows, Search, CornerDownLeft, Send, Tags, Info, Activity, HardDrive, Gauge, Gift, PartyPopper, UserPlus, UserCheck, Reply, PenLine, AtSign, MessageCircleMore, FileX2, FileCheck2, FolderPlus, SquareArrowOutUpRight, Paperclip, ArrowRight, Image as Image$1, AppWindow } from 'lucide-react';
43
42
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
44
- import { isMessageType, getUserEncryptionKeypair, decryptMessage, passwordChangeErrorMessage, createRecoveryFile, isAbortError } from '@arbidocs/client';
43
+ import { create } from 'zustand';
44
+ import { getUserEncryptionKeypair, sealedBoxDecrypt, bytesToBase64, isMessageType, decryptMessage, passwordChangeErrorMessage, createRecoveryFile, isAbortError, base64ToBytes, sealedBoxEncrypt } from '@arbidocs/client';
45
45
  export { isMessageType } from '@arbidocs/client';
46
46
  import { diffWords } from 'diff';
47
47
  import { AnimatePresence, motion } from 'framer-motion';
@@ -1609,61 +1609,115 @@ function subscribeDocumentReads(qc, onRows) {
1609
1609
  onRows([data]);
1610
1610
  });
1611
1611
  }
1612
- var useArbiWsStore = create((set) => ({
1613
- status: "disconnected",
1614
- tasks: {},
1615
- lastTaskUpdate: null,
1616
- presence: {},
1617
- evicted: false,
1618
- setStatus: (status) => set({ status }),
1619
- setEvicted: (evicted) => set({ evicted }),
1620
- applyTaskUpdate: (msg) => set(
1621
- (s) => isStaleTaskUpdate(s.tasks[msg.doc_ext_id], msg) ? s : { tasks: { ...s.tasks, [msg.doc_ext_id]: msg }, lastTaskUpdate: msg }
1622
- ),
1623
- settleTasks: (rows) => set((s) => {
1624
- const settled = settledByRows(s.tasks, rows);
1625
- if (!settled.length) return s;
1626
- const tasks = { ...s.tasks };
1627
- for (const task of settled) tasks[task.doc_ext_id] = task;
1628
- return { tasks };
1629
- }),
1630
- applyPresence: (msg) => set((s) => ({ presence: { ...s.presence, [msg.user_id]: msg.status } })),
1631
- reset: () => set({ status: "disconnected", tasks: {}, lastTaskUpdate: null, presence: {} })
1632
- }));
1633
-
1634
- // src/documents/support.tsx
1635
- var NO_SUPPORT = {};
1636
- function useDocumentsSupport() {
1637
- return useArbiHost().documents ?? NO_SUPPORT;
1638
- }
1639
- function useProcessingTasks() {
1640
- const { useProcessingTasks: useHostTasks } = useDocumentsSupport();
1641
- const own = useArbiWsStore((state) => state.tasks);
1642
- const host = useHostTasks?.();
1643
- return host ?? own;
1644
- }
1645
- function useProcessingTask(docId) {
1646
- const { useProcessingTask: useHostTask } = useDocumentsSupport();
1647
- const own = useArbiWsStore((state) => state.tasks[docId]);
1648
- const host = useHostTask?.(docId);
1649
- return useHostTask ? host : own;
1650
- }
1651
- var NO_ACTIONS = {};
1652
- var NO_IDS = /* @__PURE__ */ new Set();
1653
- function useDocumentHostActions() {
1654
- const { useHostActions } = useDocumentsSupport();
1655
- return useHostActions?.() ?? NO_ACTIONS;
1656
- }
1657
- function useOfflineDocumentIds() {
1658
- const { useOfflineDocumentIds: useHostIds } = useDocumentsSupport();
1659
- return useHostIds?.() ?? NO_IDS;
1612
+ var STALE_TASK_MS = 6 * 60 * 60 * 1e3;
1613
+ var ORPHAN_TASK_MS = 15 * 60 * 1e3;
1614
+ var SNAPSHOT_MS = 500;
1615
+ function applyTaskEvent(queryClient, arbi, message, me) {
1616
+ const workspaceId = message.workspace_ext_id;
1617
+ if (!workspaceId) return;
1618
+ if (FINISHED_DOCUMENT_STATUSES.has(message.status)) {
1619
+ void refreshDocuments(queryClient, arbi, [message.doc_ext_id]);
1620
+ return;
1621
+ }
1622
+ const cached = getCachedDocuments(queryClient, workspaceId);
1623
+ if (!cached || cached.some((d) => d.external_id === message.doc_ext_id)) return;
1624
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1625
+ const placeholder = {
1626
+ external_id: message.doc_ext_id,
1627
+ workspace_ext_id: workspaceId,
1628
+ file_name: message.file_name ?? "Uploading\u2026",
1629
+ status: message.status,
1630
+ folder: message.folder ?? null,
1631
+ wp_type: "source",
1632
+ shared: false,
1633
+ created_by_ext_id: me ?? void 0,
1634
+ doc_metadata: {},
1635
+ doctags: [],
1636
+ created_at: now,
1637
+ updated_at: now
1638
+ };
1639
+ patchDocuments(
1640
+ queryClient,
1641
+ (old) => old.some((d) => d.external_id === message.doc_ext_id) ? old : [...old, placeholder],
1642
+ workspaceId
1643
+ );
1660
1644
  }
1661
- function useOpenViewerDocumentId() {
1662
- const { useOpenViewerDocumentId: useHostViewing } = useDocumentsSupport();
1663
- return useHostViewing?.() ?? null;
1645
+ function useWorkspaceProcessing(workspaceId) {
1646
+ const queryClient = useQueryClient();
1647
+ const arbi = useArbi();
1648
+ const [snapshot, setSnapshot] = useState(() => useArbiWsStore.getState().tasks);
1649
+ useEffect(() => {
1650
+ let timer = null;
1651
+ const unsubscribe = useArbiWsStore.subscribe((state, previous) => {
1652
+ if (state.tasks === previous.tasks || timer) return;
1653
+ timer = setTimeout(() => {
1654
+ timer = null;
1655
+ setSnapshot(useArbiWsStore.getState().tasks);
1656
+ }, SNAPSHOT_MS);
1657
+ });
1658
+ return () => {
1659
+ unsubscribe();
1660
+ if (timer) clearTimeout(timer);
1661
+ };
1662
+ }, []);
1663
+ useEffect(() => {
1664
+ if (!workspaceId) return;
1665
+ const store = useArbiWsStore.getState();
1666
+ const documents2 = getCachedDocuments(queryClient, workspaceId) ?? [];
1667
+ store.settleTasks(documents2);
1668
+ const listed = new Set(documents2.map((d) => d.external_id));
1669
+ const now = Date.now();
1670
+ for (const task of Object.values(useArbiWsStore.getState().tasks)) {
1671
+ if (task.workspace_ext_id !== workspaceId || !IN_FLIGHT_DOCUMENT_STATUSES.has(task.status))
1672
+ continue;
1673
+ const since = task.startTime ?? task.endTime;
1674
+ const age = since == null ? null : now - since;
1675
+ const stale = age != null && age > STALE_TASK_MS;
1676
+ const orphan = documents2.length > 0 && !listed.has(task.doc_ext_id) && age != null && age > ORPHAN_TASK_MS;
1677
+ if (stale || orphan) store.clearTask(task.doc_ext_id);
1678
+ }
1679
+ }, [workspaceId, queryClient]);
1680
+ useEffect(() => {
1681
+ if (!workspaceId) return;
1682
+ const unsubscribeReads = subscribeDocumentReads(
1683
+ queryClient,
1684
+ (rows) => useArbiWsStore.getState().settleTasks(rows)
1685
+ );
1686
+ const recheck = async () => {
1687
+ const ids = Object.values(useArbiWsStore.getState().tasks).filter(
1688
+ (t) => t.workspace_ext_id === workspaceId && IN_FLIGHT_DOCUMENT_STATUSES.has(t.status)
1689
+ ).map((t) => t.doc_ext_id);
1690
+ if (ids.length) await refreshDocuments(queryClient, arbi, ids);
1691
+ };
1692
+ let wasConnected = useArbiWsStore.getState().status === "connected";
1693
+ const unsubscribeStatus = useArbiWsStore.subscribe((state) => {
1694
+ const connected = state.status === "connected";
1695
+ if (connected && !wasConnected) void recheck();
1696
+ wasConnected = connected;
1697
+ });
1698
+ return () => {
1699
+ unsubscribeReads();
1700
+ unsubscribeStatus();
1701
+ };
1702
+ }, [workspaceId, queryClient, arbi]);
1703
+ return useMemo(() => {
1704
+ const allTasks = workspaceId ? Object.values(snapshot).filter((t) => t.workspace_ext_id === workspaceId).sort((a, b) => a.doc_ext_id.localeCompare(b.doc_ext_id)) : [];
1705
+ const count = (statuses) => allTasks.filter(
1706
+ (t) => Array.isArray(statuses) ? statuses.includes(t.status) : statuses.has(t.status)
1707
+ ).length;
1708
+ const { clearTask, clearFinishedTasks } = useArbiWsStore.getState();
1709
+ return {
1710
+ tasks: Object.fromEntries(allTasks.map((t) => [t.doc_ext_id, t])),
1711
+ allTasks,
1712
+ processingCount: count(IN_FLIGHT_DOCUMENT_STATUSES),
1713
+ completedCount: count(["completed", "low-content"]),
1714
+ failedCount: count(["failed"]),
1715
+ skippedCount: count(["skipped"]),
1716
+ clearTask,
1717
+ clearFinishedTasks
1718
+ };
1719
+ }, [workspaceId, snapshot]);
1664
1720
  }
1665
-
1666
- // src/documents/documents-writes.ts
1667
1721
  function applyOptimisticDocumentEdit(qc, updates) {
1668
1722
  const byId = new Map(updates.map((update) => [update.external_id, update]));
1669
1723
  const previous = [];
@@ -1857,7 +1911,6 @@ function useRenameFolder() {
1857
1911
  function useDeleteDocuments() {
1858
1912
  const arbi = useArbi();
1859
1913
  const qc = useQueryClient();
1860
- const { onDocumentsDeleted } = useDocumentsSupport();
1861
1914
  return useMutation({
1862
1915
  mutationKey: arbiMutationKeys.deleteDocuments(),
1863
1916
  mutationFn: (docIds) => arbi.documents.delete(docIds),
@@ -1868,33 +1921,32 @@ function useDeleteDocuments() {
1868
1921
  (old) => old.some((doc) => gone.has(doc.external_id)) ? old.filter((doc) => !gone.has(doc.external_id)) : old
1869
1922
  );
1870
1923
  forgetDocuments(qc, docIds);
1871
- onDocumentsDeleted?.(docIds);
1924
+ const { clearTask } = useArbiWsStore.getState();
1925
+ for (const id of docIds) clearTask(id);
1872
1926
  return qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
1873
1927
  }
1874
1928
  });
1875
1929
  }
1876
- async function settleUpload(qc, arbi, docIds, processingTask) {
1877
- if (docIds?.length) await refreshDocuments(qc, arbi, docIds, { processingTask });
1930
+ async function settleUpload(qc, arbi, docIds) {
1931
+ if (docIds?.length) await refreshDocuments(qc, arbi, docIds);
1878
1932
  await qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
1879
1933
  }
1880
1934
  function useUploadDocuments() {
1881
1935
  const arbi = useArbi();
1882
1936
  const qc = useQueryClient();
1883
- const { processingTask } = useDocumentsSupport();
1884
1937
  return useMutation({
1885
1938
  mutationKey: arbiMutationKeys.uploadDocuments(),
1886
1939
  mutationFn: ({ files, options }) => arbi.documents.upload(files, options),
1887
- onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids, processingTask)
1940
+ onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids)
1888
1941
  });
1889
1942
  }
1890
1943
  function useUploadUrls() {
1891
1944
  const arbi = useArbi();
1892
1945
  const qc = useQueryClient();
1893
- const { processingTask } = useDocumentsSupport();
1894
1946
  return useMutation({
1895
1947
  mutationKey: arbiMutationKeys.uploadUrls(),
1896
1948
  mutationFn: ({ urls, shared, configExtId }) => arbi.documents.uploadUrl(urls, { shared, configExtId }),
1897
- onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids, processingTask)
1949
+ onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids)
1898
1950
  });
1899
1951
  }
1900
1952
  function useAssignDocTags() {
@@ -1930,21 +1982,43 @@ function useUpdateDocTag() {
1930
1982
  })
1931
1983
  );
1932
1984
  }
1985
+ function queueProcessing(documents2) {
1986
+ const store = useArbiWsStore.getState();
1987
+ const previous = documents2.map(({ docId }) => [docId, store.tasks[docId]]);
1988
+ const now = Date.now();
1989
+ for (const doc of documents2)
1990
+ store.putTask({
1991
+ doc_ext_id: doc.docId,
1992
+ workspace_ext_id: doc.workspaceId,
1993
+ file_name: doc.fileName,
1994
+ version: doc.version,
1995
+ status: "queued",
1996
+ progress: 0,
1997
+ startTime: now
1998
+ });
1999
+ return () => useArbiWsStore.setState((state) => {
2000
+ const tasks = { ...state.tasks };
2001
+ for (const [docId, task] of previous) {
2002
+ if (task) tasks[docId] = task;
2003
+ else delete tasks[docId];
2004
+ }
2005
+ return { tasks };
2006
+ });
2007
+ }
1933
2008
  function useGenerateDocTags() {
1934
2009
  const arbi = useArbi();
1935
2010
  const qc = useQueryClient();
1936
- const { onProcessingQueued } = useDocumentsSupport();
1937
2011
  return useMutation({
1938
2012
  mutationKey: arbiMutationKeys.generateDocTags(),
1939
2013
  mutationFn: ({ tagIds, docIds, overwrite }) => arbi.doctags.generate(tagIds, docIds, { overwrite }),
1940
2014
  onMutate: ({ docIds }) => {
1941
- if (!onProcessingQueued || !docIds.length) return void 0;
2015
+ if (!docIds.length) return void 0;
1942
2016
  const workspaceId = arbi.hasWorkspace ? arbi.getWorkspaceId() : "";
1943
2017
  const listed = new Map(
1944
2018
  (getCachedDocuments(qc, workspaceId) ?? []).map((doc) => [doc.external_id, doc])
1945
2019
  );
1946
2020
  return {
1947
- undo: onProcessingQueued(
2021
+ undo: queueProcessing(
1948
2022
  docIds.map((docId) => ({
1949
2023
  docId,
1950
2024
  workspaceId,
@@ -1960,13 +2034,33 @@ function useGenerateDocTags() {
1960
2034
  function useFinaliseTranslation() {
1961
2035
  const arbi = useArbi();
1962
2036
  const qc = useQueryClient();
1963
- const { processingTask } = useDocumentsSupport();
1964
2037
  return useMutation({
1965
2038
  mutationFn: (docId) => arbi.documents.finaliseTranslation(docId),
1966
- onSuccess: (result) => void refreshDocuments(qc, arbi, [result.document_ext_id], { processingTask })
2039
+ onSuccess: (result) => void refreshDocuments(qc, arbi, [result.document_ext_id])
1967
2040
  });
1968
2041
  }
1969
2042
 
2043
+ // src/documents/support.tsx
2044
+ var NO_SUPPORT = {};
2045
+ function useDocumentsSupport() {
2046
+ return useArbiHost().documents ?? NO_SUPPORT;
2047
+ }
2048
+ function useProcessingTasks() {
2049
+ return useArbiWsStore((state) => state.tasks);
2050
+ }
2051
+ function useProcessingTask(docId) {
2052
+ return useArbiWsStore((state) => state.tasks[docId]);
2053
+ }
2054
+ var NO_ACTIONS = {};
2055
+ function useDocumentHostActions() {
2056
+ const { useHostActions } = useDocumentsSupport();
2057
+ return useHostActions?.() ?? NO_ACTIONS;
2058
+ }
2059
+ function useOpenViewerDocumentId() {
2060
+ const { useOpenViewerDocumentId: useHostViewing } = useDocumentsSupport();
2061
+ return useHostViewing?.() ?? null;
2062
+ }
2063
+
1970
2064
  // src/documents/document-download.ts
1971
2065
  function fallbackFileName(doc) {
1972
2066
  if (doc.file_name) return doc.file_name;
@@ -3139,7 +3233,7 @@ async function runLimited(tasks, limit) {
3139
3233
  function useUploadFiles() {
3140
3234
  const arbi = useArbi();
3141
3235
  const qc = useQueryClient();
3142
- const { resolveWorkspaceKey, processingTask } = useDocumentsSupport();
3236
+ const { resolveWorkspaceKey } = useDocumentsSupport();
3143
3237
  const { data: settings } = useUserSettings();
3144
3238
  const { mutateAsync: generateDocTags } = useGenerateDocTags();
3145
3239
  const direct = settings?.use_s3_direct_upload === true;
@@ -3230,7 +3324,7 @@ function useUploadFiles() {
3230
3324
  const docIds = results.flatMap((result) => result.doc_ext_ids ?? []);
3231
3325
  const skipped = results.flatMap((result) => result.skipped ?? []);
3232
3326
  if (docIds.length > 0) {
3233
- const read = await refreshDocuments(qc, arbi, docIds, { processingTask });
3327
+ const read = await refreshDocuments(qc, arbi, docIds);
3234
3328
  for (const doc of read) forgetUploadedDocumentFolder(doc.external_id);
3235
3329
  }
3236
3330
  await qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
@@ -3241,7 +3335,7 @@ function useUploadFiles() {
3241
3335
  }
3242
3336
  return { docIds, skipped };
3243
3337
  },
3244
- [arbi, qc, direct, resolveWorkspaceKey, processingTask, generateDocTags]
3338
+ [arbi, qc, direct, resolveWorkspaceKey, generateDocTags]
3245
3339
  );
3246
3340
  }
3247
3341
  function isZipUrl(url) {
@@ -3636,6 +3730,140 @@ function useDocumentPendingSync(docId) {
3636
3730
  useState(() => watchPendingDocIds(queryClient));
3637
3731
  return usePendingDocIds((s) => docId ? s.ids.has(docId) : false);
3638
3732
  }
3733
+ var DB_NAME = "arbi-offline-docs";
3734
+ var DB_VERSION = 1;
3735
+ var STORE = "documents";
3736
+ var dbInstance = null;
3737
+ async function openDB() {
3738
+ if (dbInstance) return dbInstance;
3739
+ return new Promise((resolve, reject) => {
3740
+ const request = indexedDB.open(DB_NAME, DB_VERSION);
3741
+ request.onerror = () => reject(request.error);
3742
+ request.onsuccess = () => {
3743
+ const db = request.result;
3744
+ db.onversionchange = () => {
3745
+ db.close();
3746
+ if (dbInstance === db) dbInstance = null;
3747
+ };
3748
+ dbInstance = db;
3749
+ resolve(db);
3750
+ };
3751
+ request.onupgradeneeded = (event) => {
3752
+ const db = event.target.result;
3753
+ if (!db.objectStoreNames.contains(STORE)) {
3754
+ db.createObjectStore(STORE, { keyPath: "docExtId" });
3755
+ }
3756
+ };
3757
+ });
3758
+ }
3759
+ function promisify(request) {
3760
+ return new Promise((resolve, reject) => {
3761
+ request.onsuccess = () => resolve(request.result);
3762
+ request.onerror = () => reject(request.error);
3763
+ });
3764
+ }
3765
+ async function withStore(mode, run) {
3766
+ const db = await openDB();
3767
+ const store = db.transaction(STORE, mode).objectStore(STORE);
3768
+ return promisify(run(store));
3769
+ }
3770
+ async function putOfflineDocument(record) {
3771
+ await withStore("readwrite", (store) => store.put(record));
3772
+ }
3773
+ async function getOfflineDocument(docExtId) {
3774
+ const record = await withStore("readonly", (store) => store.get(docExtId));
3775
+ return record;
3776
+ }
3777
+ async function deleteOfflineDocument(docExtId) {
3778
+ await withStore("readwrite", (store) => store.delete(docExtId));
3779
+ }
3780
+ async function listOfflineDocumentIds() {
3781
+ const keys = await withStore("readonly", (store) => store.getAllKeys());
3782
+ return keys;
3783
+ }
3784
+ async function requestPersistentStorage() {
3785
+ try {
3786
+ if (!navigator.storage?.persist || !navigator.storage.persisted) return false;
3787
+ if (await navigator.storage.persisted()) return true;
3788
+ return await navigator.storage.persist();
3789
+ } catch {
3790
+ return false;
3791
+ }
3792
+ }
3793
+ async function wipeOfflineDocuments() {
3794
+ dbInstance?.close();
3795
+ dbInstance = null;
3796
+ await new Promise((resolve) => {
3797
+ const request = indexedDB.deleteDatabase(DB_NAME);
3798
+ request.onsuccess = request.onerror = request.onblocked = () => resolve();
3799
+ });
3800
+ }
3801
+ async function loadOfflineDocument(docId) {
3802
+ const record = await getOfflineDocument(docId);
3803
+ if (!record) return void 0;
3804
+ const keypair = await getUserEncryptionKeypair();
3805
+ if (!keypair) throw new Error("Cannot open the offline copy: no personal key in this session");
3806
+ const bytes = sealedBoxDecrypt(bytesToBase64(record.data), keypair.secretKey);
3807
+ return new Blob([bytes], { type: record.contentType });
3808
+ }
3809
+ async function keepDocumentsOffline(client, docs) {
3810
+ await requestPersistentStorage();
3811
+ const keypair = await getUserEncryptionKeypair();
3812
+ if (!keypair) throw new Error("Could not derive an encryption key for the offline copy.");
3813
+ for (const doc of docs) {
3814
+ const original = usesOriginalBytesForViewer(doc.file_name);
3815
+ const blob = original ? await fetchDocumentFile(client, doc.external_id) : await fetchDocumentPdf(client, doc.external_id);
3816
+ const plain = new Uint8Array(await blob.arrayBuffer());
3817
+ await putOfflineDocument({
3818
+ docExtId: doc.external_id,
3819
+ fileName: getDocumentTitle(doc, "document"),
3820
+ kind: original ? "original" : "pdf",
3821
+ data: base64ToBytes(sealedBoxEncrypt(plain, keypair.publicKey)),
3822
+ contentType: blob.type,
3823
+ savedAt: Date.now()
3824
+ });
3825
+ }
3826
+ }
3827
+ function useOfflineDocumentIds() {
3828
+ const { data } = useQuery({
3829
+ queryKey: arbiQueryKeys.offlineDocuments(),
3830
+ queryFn: async () => new Set(await listOfflineDocumentIds()),
3831
+ staleTime: Infinity,
3832
+ // Offline the default network mode would hold this local read back, and a cold start
3833
+ // offline would lose every "available offline" badge.
3834
+ networkMode: "always"
3835
+ });
3836
+ return data ?? EMPTY;
3837
+ }
3838
+ var EMPTY = /* @__PURE__ */ new Set();
3839
+ function useKeepDocumentsOffline() {
3840
+ const queryClient = useQueryClient();
3841
+ const arbi = useArbi();
3842
+ const { onKeptOffline } = useDocumentsSupport();
3843
+ return useMutation({
3844
+ mutationFn: async (docs) => {
3845
+ await keepDocumentsOffline(arbi.getClient().fetch, docs);
3846
+ for (const doc of docs) setCachedDocument(queryClient, doc);
3847
+ await onKeptOffline?.();
3848
+ return docs.length;
3849
+ },
3850
+ onSettled: () => queryClient.invalidateQueries({ queryKey: arbiQueryKeys.offlineDocuments() }),
3851
+ onSuccess: (count) => notify.success(`${count} document${count === 1 ? "" : "s"} available offline`),
3852
+ onError: () => notify.error("Could not save documents for offline use")
3853
+ });
3854
+ }
3855
+ function useRemoveDocumentsOffline() {
3856
+ const queryClient = useQueryClient();
3857
+ return useMutation({
3858
+ mutationFn: async (docIds) => {
3859
+ for (const id of docIds) await deleteOfflineDocument(id);
3860
+ return docIds.length;
3861
+ },
3862
+ onSettled: () => queryClient.invalidateQueries({ queryKey: arbiQueryKeys.offlineDocuments() }),
3863
+ onSuccess: (count) => notify.success(`Removed ${count} offline ${count === 1 ? "copy" : "copies"}`),
3864
+ onError: () => notify.error("Could not remove offline copy")
3865
+ });
3866
+ }
3639
3867
 
3640
3868
  // src/chat/stream-handlers.ts
3641
3869
  var MIN_NARRATION_DWELL_MS = 4e3;
@@ -4007,7 +4235,7 @@ function useStreamHandlers() {
4007
4235
  return "";
4008
4236
  }
4009
4237
  },
4010
- refreshDocuments: (ids) => refreshDocuments(queryClient, arbi, ids, config.documents)
4238
+ refreshDocuments: (ids) => refreshDocuments(queryClient, arbi, ids)
4011
4239
  },
4012
4240
  params
4013
4241
  ),
@@ -6033,6 +6261,16 @@ var ChatBubble = memo(function ChatBubble2({
6033
6261
  );
6034
6262
  });
6035
6263
 
6264
+ // src/websocket/reconnect.ts
6265
+ var INITIAL_RECONNECT_DELAY_MS = 1e3;
6266
+ var MAX_RECONNECT_DELAY_MS = 3e4;
6267
+ function nextReconnectDelay(attempt) {
6268
+ return Math.min(INITIAL_RECONNECT_DELAY_MS * 2 ** Math.max(0, attempt), MAX_RECONNECT_DELAY_MS);
6269
+ }
6270
+ function resolveSocketBaseUrl(configured, origin) {
6271
+ return /^https?:\/\//.test(configured) || !origin ? configured : origin;
6272
+ }
6273
+
6036
6274
  // src/mail/client.ts
6037
6275
  var MailOfflineUnavailableError = class extends Error {
6038
6276
  constructor(message) {
@@ -6476,6 +6714,30 @@ async function applyLiveUpdate(queryClient, message) {
6476
6714
  return false;
6477
6715
  }
6478
6716
  }
6717
+
6718
+ // src/notifications/live.ts
6719
+ function isNotificationRow(message) {
6720
+ const m = message;
6721
+ return typeof m?.external_id === "string" && typeof m.recipient === "object" && m.recipient !== null;
6722
+ }
6723
+ var MAIL_TYPES = /* @__PURE__ */ new Set(["native_mail_received", "mail_draft_ready"]);
6724
+ function applyNotificationRow(queryClient, row, me) {
6725
+ if (MAIL_TYPES.has(row.type) && row.recipient.external_id === me)
6726
+ void queryClient.invalidateQueries({ queryKey: mailQueryKeys.all() });
6727
+ queryClient.setQueriesData(
6728
+ { queryKey: arbiQueryKeys.allNotifications() },
6729
+ (old) => {
6730
+ if (!Array.isArray(old)) return old;
6731
+ const index = old.findIndex((n) => n.external_id === row.external_id);
6732
+ if (index < 0) return [row, ...old];
6733
+ if (!row.read || old[index].read) return old;
6734
+ const next = [...old];
6735
+ next[index] = { ...old[index], read: true };
6736
+ return next;
6737
+ }
6738
+ );
6739
+ void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.allNotifications() });
6740
+ }
6479
6741
  var ArbiWsContext = createContext(null);
6480
6742
  function useArbiWsContext() {
6481
6743
  const ctx = useContext(ArbiWsContext);
@@ -6484,14 +6746,6 @@ function useArbiWsContext() {
6484
6746
  }
6485
6747
  return ctx;
6486
6748
  }
6487
- var INITIAL_RECONNECT_DELAY_MS = 1e3;
6488
- var MAX_RECONNECT_DELAY_MS = 3e4;
6489
- function nextReconnectDelay(attempt) {
6490
- return Math.min(INITIAL_RECONNECT_DELAY_MS * 2 ** Math.max(0, attempt), MAX_RECONNECT_DELAY_MS);
6491
- }
6492
- function resolveSocketBaseUrl(configured, origin) {
6493
- return /^https?:\/\//.test(configured) || !origin ? configured : origin;
6494
- }
6495
6749
  var EVICTED_CLOSE_CODE = 1008;
6496
6750
  function ArbiWebSocketProvider({
6497
6751
  enabled = true,
@@ -6531,22 +6785,32 @@ function ArbiWebSocketProvider({
6531
6785
  }
6532
6786
  let conn = null;
6533
6787
  let cancelled = false;
6788
+ let evicted = false;
6789
+ const me = () => arbiRef.current.isLoggedIn ? arbiRef.current.user.identity()?.externalId ?? null : null;
6534
6790
  const onMessage = (msg) => {
6535
- if (isMessageType(msg, "task_update")) applyTaskUpdate(msg);
6536
- else if (isMessageType(msg, "presence_update")) applyPresence(msg);
6537
- else if (isMessageType(msg, "batch_complete") && msg.batch_type === "entity_extract")
6538
- finishEntityExtraction(msg.doc_ext_ids ?? []);
6539
- else {
6540
- const type = msg.type;
6541
- if (type.startsWith("chat.") || type === "agent_dm_status")
6542
- void applyChatEvent(arbiRef.current, queryClient, msg);
6543
- else if (type.startsWith("call."))
6544
- applyCallEvent(queryClient, msg, {
6545
- me: arbiRef.current.isLoggedIn ? arbiRef.current.user.identity()?.externalId ?? null : null,
6546
- acceptRings: acceptRingsRef.current
6547
- });
6548
- else void applyLiveUpdate(queryClient, msg);
6549
- }
6791
+ const type = msg.type;
6792
+ if (type === "connection_closed") {
6793
+ evicted = true;
6794
+ setEvicted(true);
6795
+ } else if (isMessageType(msg, "task_update")) {
6796
+ if (applyTaskUpdate(msg)) applyTaskEvent(queryClient, arbiRef.current, msg, me());
6797
+ } else if (isMessageType(msg, "presence_update")) applyPresence(msg);
6798
+ else if (isMessageType(msg, "batch_complete")) {
6799
+ if (msg.batch_type === "entity_extract") {
6800
+ finishEntityExtraction(msg.doc_ext_ids ?? []);
6801
+ void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.allFacts() });
6802
+ }
6803
+ if (msg.batch_type === "upload" || msg.batch_type === "entity_extract") {
6804
+ if (msg.doc_ext_ids?.length)
6805
+ void refreshDocuments(queryClient, arbiRef.current, msg.doc_ext_ids);
6806
+ void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.allTags() });
6807
+ }
6808
+ } else if (type.startsWith("chat.") || type === "agent_dm_status")
6809
+ void applyChatEvent(arbiRef.current, queryClient, msg);
6810
+ else if (type.startsWith("call."))
6811
+ applyCallEvent(queryClient, msg, { me: me(), acceptRings: acceptRingsRef.current });
6812
+ else if (isNotificationRow(msg)) applyNotificationRow(queryClient, msg, me());
6813
+ else void applyLiveUpdate(queryClient, msg);
6550
6814
  for (const fn of subscribersRef.current) {
6551
6815
  try {
6552
6816
  fn(msg);
@@ -6557,7 +6821,7 @@ function ArbiWebSocketProvider({
6557
6821
  let retryTimer = null;
6558
6822
  let attempt = 0;
6559
6823
  const scheduleRestart = () => {
6560
- if (cancelled || retryTimer) return;
6824
+ if (cancelled || evicted || retryTimer) return;
6561
6825
  setStatus("disconnected");
6562
6826
  const delay = nextReconnectDelay(attempt);
6563
6827
  attempt += 1;
@@ -6596,16 +6860,18 @@ function ArbiWebSocketProvider({
6596
6860
  attempt = 0;
6597
6861
  setStatus("connected");
6598
6862
  },
6599
- // Evicted for a newer session of the same user: reconnecting would be evicted again.
6863
+ // Evicted (a newer session of the same user, or the server took this connection over for a
6864
+ // newer one of this session): reconnecting would be evicted again, or evict that one.
6600
6865
  shouldReconnect: (code) => {
6601
- if (code !== EVICTED_CLOSE_CODE) return true;
6866
+ if (code !== EVICTED_CLOSE_CODE && !evicted) return true;
6867
+ evicted = true;
6602
6868
  setEvicted(true);
6603
6869
  setStatus("disconnected");
6604
6870
  return false;
6605
6871
  },
6606
6872
  onReconnectFailed: scheduleRestart,
6607
6873
  onClose: () => {
6608
- if (!cancelled) setStatus("reconnecting");
6874
+ if (!cancelled) setStatus(evicted ? "disconnected" : "reconnecting");
6609
6875
  }
6610
6876
  });
6611
6877
  if (cancelled) {
@@ -6653,34 +6919,6 @@ function useArbiWsStatus() {
6653
6919
  function useArbiConnected() {
6654
6920
  return useArbiWsStore((s) => s.status === "connected");
6655
6921
  }
6656
- function useArbiWsTasks() {
6657
- return useArbiWsStore((s) => s.tasks);
6658
- }
6659
- function useArbiWsTask(docId) {
6660
- return useArbiWsStore((s) => s.tasks[docId]);
6661
- }
6662
- function useArbiDocumentSync(workspaceId) {
6663
- const queryClient = useQueryClient();
6664
- const arbi = useArbi();
6665
- useEffect(
6666
- () => subscribeDocumentReads(queryClient, (rows) => useArbiWsStore.getState().settleTasks(rows)),
6667
- [queryClient]
6668
- );
6669
- useArbiWebSocket((msg) => {
6670
- if (!workspaceId) return;
6671
- if (isMessageType(msg, "batch_complete")) {
6672
- if (msg.workspace_ext_id !== workspaceId) return;
6673
- if (msg.doc_ext_ids?.length) void refreshDocuments(queryClient, arbi, msg.doc_ext_ids);
6674
- void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.tags(workspaceId) });
6675
- return;
6676
- }
6677
- if (isMessageType(msg, "task_update")) {
6678
- if (msg.workspace_ext_id !== workspaceId) return;
6679
- if (FINISHED_DOCUMENT_STATUSES.has(msg.status))
6680
- void refreshDocuments(queryClient, arbi, [msg.doc_ext_id]);
6681
- }
6682
- });
6683
- }
6684
6922
  var WORKSPACE_SCOPED_PACKAGE_KEYS = [
6685
6923
  arbiQueryKeys.allDocuments(),
6686
6924
  arbiQueryKeys.allSimilarDocuments(),
@@ -11177,16 +11415,7 @@ function useWorkNotifications(options) {
11177
11415
  }
11178
11416
  function useNotifications(options = {}) {
11179
11417
  const arbi = useArbi();
11180
- const queries = useQueryClient();
11181
11418
  const limit = options.limit ?? 100;
11182
- const ws = useContext(ArbiWsContext);
11183
- useEffect(
11184
- () => ws?.subscribe((message) => {
11185
- if ("sender" in message && "recipient" in message)
11186
- void queries.invalidateQueries({ queryKey: arbiQueryKeys.allNotifications() });
11187
- }),
11188
- [ws, queries]
11189
- );
11190
11419
  return useQuery({
11191
11420
  queryKey: arbiQueryKeys.notifications(limit),
11192
11421
  queryFn: () => arbi.notifications.list({ limit }),
@@ -12275,6 +12504,26 @@ function useRemoveChatMember() {
12275
12504
  }
12276
12505
  });
12277
12506
  }
12507
+ function useChatArrivals(onArrival) {
12508
+ const arbi = useArbi();
12509
+ const queryClient = useQueryClient();
12510
+ useArbiWsMessage("chat.message", (message) => {
12511
+ const senderId = message.message.sender_ext_id;
12512
+ if (!senderId || senderId === myChatId(arbi)) return;
12513
+ if (message.message.kind !== "text" || getOpenChat() === message.chat_ext_id) return;
12514
+ const muted = queryClient.getQueriesData({ queryKey: arbiQueryKeys.userSettings() }).map(([, data]) => data).find(Boolean)?.muted_users;
12515
+ if (muted?.includes(senderId)) return;
12516
+ const chat = cachedChat(queryClient, message.chat_ext_id);
12517
+ const sender = chat?.members.find((m) => m.user.external_id === senderId)?.user;
12518
+ onArrival({
12519
+ chatId: message.chat_ext_id,
12520
+ chat,
12521
+ sender,
12522
+ senderId,
12523
+ replyTo: chat?.kind === "direct" ? senderId : message.chat_ext_id
12524
+ });
12525
+ });
12526
+ }
12278
12527
  function DateSeparator({ children }) {
12279
12528
  return /* @__PURE__ */ jsx("div", { className: "my-3 flex justify-center", "data-testid": "dm-date-separator", children: /* @__PURE__ */ jsx("span", { className: "rounded-full bg-background/80 px-2 py-0.5 text-xs text-muted-foreground", children }) });
12280
12529
  }
@@ -12712,6 +12961,6 @@ function CommandPaletteProvider({
12712
12961
  ] });
12713
12962
  }
12714
12963
 
12715
- export { AGENT_CONTROL_COMMANDS, ALLOWED_PORTAL_ORIGINS, ARCHIVE_POLL_MS, ASSISTANT_MENTION_LABEL, AUTO_CHAT_MODEL, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiHost2 as ArbiHost, ArbiWebSocketProvider, ArtifactCanvas, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, CONVERSATION_SWITCH_MEASURE, ChatBubble, CitationRenderer, CommandPalette, CommandPaletteProvider, ConversationList, ConversationScope, DATABASE_RELATION_PICK_LIMIT, DATABASE_ROWS_PAGE, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DateSeparator, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentReview, DraftTitleControls, FIRST_TOKEN_MEASURE, FileIcon, GitHubIcon, ImageCropModal, ImageCropper, LIVE_UPDATE_TYPES, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MIN_NARRATION_DWELL_MS, MailOfflineUnavailableError, MessageArtifactCard, PENDING_SYNC_PREDICATE, POLL_EVERY_MS, PhotoCapture, RUN_WINDOW_MS, SIGNATURE_NOTIFICATION_TYPES, SLOW_AFTER_MS, STILL_WORKING, StorageActionError, TRANSFER_POLL_MS, TaskThreadPendingError, TypingIndicator, UPLOAD_ACCEPT, UPLOAD_MAX_FILE_SIZE, VideoCapture, VoiceNoteRecorder, WORK_NOTIFICATION_LABELS, __resetPendingFinalCommitsForTests, __resetStreamingTokenBufferForTests, accountPath, addAssistantMessageToCache, addUserMessageToCache, adoptNewChatDocument, aliasTakenMessage, allConversationThreads, annotateThread, announceMailDraftReplaced, appendTokenToMessage, applyConversationEvent, applyFinalContextToMessage, applyLiveUpdate, applyOptimisticDocumentEdit, applyOutputItemToMessage, arbiMailClient, archiveName, archivedWorkspaceMessage, bindThreadDocument, boundDocumentOf, buildDocumentMetadataRows, buildMentionCandidates, buildPendingFirstTurn, buildPendingSyncItem, buildWorkspaceArchive, cacheThreadBinding, cachedAssistantMode, cachedMentionCandidates, cachedQuotaUsedUp, calendarNotificationMeta, callNotificationMeta, captureFrameAsBlob, clearLoadingState, clearUserInputRequest, commitFinalMessage, completeQueuedUserMessageByContent, connectOAuthCalendarAccount, connectorErrorStatus, connectorReturnTo, createMailClient, createStreamHandlers, createWorkspaceSwitch, cropImage, dayKey, defaultMailAlias, deploymentUserMeta, describeActivity, describeCalendarNotification, describeServerNotification, discardStreamingTokensForMessage, disconnectAttachedRun, documentActivityMeta, documentActivityPhrase, documentDisplayName, docxMentionMeta, downloadRecoveryFile, ensureAssistantMessageLoading, extractZipFile, fallbackFileName, fileAttachment, filesFromDrop, flushStreamingTokens, forgetUploadedDocumentFolder, formatConfigValidationError, formatIdentityPrice, getInterjectionText, getNotificationTypeMeta, getOrphanedLastMessage, getRelatedLabels, getRelatedTotal, getRunStartedAt, getThreadsQueryKey, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasPendingFinalCommit, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars, invalidateConversationActivity, invalidateRelatedRows, isActivityKey, isAliasTakenError, isArchiveMoving, isCommentToPeople, isDeploymentAdmin, isDeploymentUserNotification, isFullConfig, isMessageRunning, isOfflineReadableArbiQuery, isOrphanedUserMessage, isQueuedCalendarWrite, isReplayableArbiMutation, isRestorableArbiQueryOnline, isSignatureNotificationType, isTransferFinished, isTransferResumable, isWorkspaceArchivedError, isWorkspaceNotificationType, isZipFile, mailDraftIdFromContent, mailJson, markMessageAsFailed, markNarrationSettled, migrateLegacyThreadDocuments, mountDiditVerification, nextAliasSuggestion, notificationUserName, openAccessRequest, parseActivityContent, parseDeleteAccountBlockers, pendingChatModelSave, peopleDirectory, personOfUser, pickRecentWorkspaces, prepareUploadFiles, redlineStats, refuseChatWhenOffline, registerArbiMutationDefaults, registerAttachedRun, removeSettledNarration, resetCalendarAccountSyncState, resetMessageContent, resolveActiveWorkspace, resolveConfigModel, resolveReplyTarget, rollbackOptimisticDocumentEdit, safePortalUrl, serverNotificationBellEntry, setMessageContent, setUserInputRequest, signatureNotificationPhrase, signatureRequestMeta, subscribeDocumentReads, supportsHouseTemplates, textToArtifact, threadBinding, threadEndingAtContains, titleFromQuestion, toChatCitations, toNotificationPreferences, toRedlineMarkdown, toShellWorkspace, updateMessageWithMetadata, updateUserMessageInCache, updateUserMessageStateInCache, uploadFolderOf, uploadedDocumentFolder, useActOnStep, useAddChatMembers, useAddDatabaseRows, useAddHolidayCalendar, useAddProjectAddonBlock, useAddWorkspaceMembers, useAddonQuote, useAgentChats, useAgentConfig, useAgentDmStatus, useAgentModels, useAgentRunControl, useAgentSession, useAgentWorkspaces, useAiTask, useAnswerAgentQuestion, useApplyChatModel, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useArchiveProgressPolling, useArchiveWorkspace, useAskAgain, useAssignDocTags, useAuthorizeLimits, useAutoSendDraft, useBookingPages, useBranchNavigation, useCalDavProfiles, useCalendarAccounts, useCalendarEvent, useCalendarEventByUid, useCalendarEvents, useCalendarInvitations, useCalendarOutbox, useCalendarOverlays, useCalendarSettings, useCalendarShares, useCalendarSupport, useCalendars, useCameraStream, useCanEditShared, useCancelDriveSync, useCancelMailboxSync, useCancelManyPendingSync, useCancelProjectSubscription, useCancelWorkspaceTransfer, useChangeProjectPlan, useChargeWatch, useChatPost, useChatSummaries, useChatThread, useChatUnreadTotal, useChats, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigSchema, useConfirmEmailChange, useConnectCalDavAccount, useConnectMailAccount, useConnectOAuthAccount, useConnectRunStream, useConnectorAutoSync, useConnectorCatalog, useConnectorVendorVisibility, useContacts, useConversation, useConversationActions, useConversationActivity, useConversationData, useConversationDocuments, useConversationIsShared, useConversationItems, useConversationPendingAuth, useConversationSearch, useConversationTurn, useConversationUsage, useCreateAgent, useCreateCalendar, useCreateContact, useCreateDatabase, useCreateEvent, useCreateFact, useCreateFacts, useCreateGroupChat, useCreateProject, useCreateProjectCheckout, useCreateRoom, useCreateWork, useCreateWorkflow, useCreateWorkspace, useCurrentSessionId, useDatabase, useDatabaseRows, useDatabases, useDecideCounter, useDeleteAccount, useDeleteAccountFlow, useDeleteBookingPage, useDeleteCalendar, useDeleteChatMessage, useDeleteConfig, useDeleteContact, useDeleteConversation, useDeleteDatabase, useDeleteDatabaseRows, useDeleteDocuments, useDeleteEvent, useDeleteFact, useDeleteMessage, useDeleteNotifications, useDeleteProject, useDeleteSkill, useDeleteWorkflow, useDeleteWorkspaces, useDisconnectCalendarAccount, useDisconnectConnector, useDisconnectMailAccount, useDisconnectSlack, useDismissedTips, useDocumentAutoAdd, useDocumentHostActions, useDocumentPendingSync, useDocumentThumbnails, useDocumentsSupport, useDownloadDocuments, useDriveFolderChildren, useDriveFolderDocCount, useDriveFolders, useDriveSyncEstimate, useDriveSyncProgress, useEmailChange, useEnableDriveSync, useEnableMailboxSync, useExportDatabase, useFacts, useFetchCalendarEvent, useFilteredProjects, useFinaliseTranslation, useFindTime, useFollowThread, useFreeBusy, useGenerateAgentAvatar, useGenerateDocTags, useGrantAgentAccess, useHolidayCountries, useHouseTemplateCandidates, useIdentityVerification, useIdentityVerificationFlow, useImportCalendar, useImportContacts, useImportDatabase, useImportDatabaseRows, useInvalidateAfterTransfer, useInvalidateProjects, useInvalidateStorage, useInviteContacts, useIsSlow, useIsWorkspaceOwner, useLinkContact, useMailAccounts, useMailAttachmentText, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useMailboxFolders, useMailboxSyncProgress, useMarkChatRead, useMarkNotificationsRead, useMcpTools, useMentionCandidates, useMessageTimer, useMoveEvent, useMoveWorkspaceToProject, useMyConnectors, useNotificationPreferences, useNotifications, useNotifyConversation, useOfflineDocumentIds, useOpenSelectedWorkspace, useOpenViewerDocumentId, usePassageQuotes, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePendingSyncCounts, usePendingSyncItems, usePeople, usePeopleSearch, usePlanQuote, usePlanWork, usePlanWorkspaceTransfer, usePreviewProjectPlanChange, useProcessingTask, useProcessingTasks, useProducts, useProjectBillingPortal, useProjectConversationUsage, useProjectEvents, usePublishCalendar, useRefreshCalendar, useRefreshConnectorsOnRunEnd, useRefreshProject, useRelatedDocuments, useRemoveChatMember, useRemoveDocTags, useRemoveWorkspaceMembers, useRenameChat, useRenameFolder, useRequestEmailChange, useRequestWorkspaceAccess, useRespondToEvent, useResumeCalendarAccountConnect, useResumeWorkspaceTransfer, useRevokeAgentAccess, useRooms, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveBookingPage, useSaveCalendarSettings, useSaveConfig, useSaveConfigField, useSaveMailDraft, useSaveSkill, useSearchContacts, useSearchDatabaseRows, useSearchFacts, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetSkillVisibility, useSetWorkspaceHouseTemplate, useSetWorkspaceMemberRoles, useShareCalendar, useShellWorkspaces, useSignOut, useSkillSource, useSkills, useSlackConnection, useStartAgentSession, useStartCalendarAccountOAuth, useStartTaskQuery, useStartWorkspaceTransfer, useStorageActions, useStorageItemNames, useStorageItems, useStorageProjects, useStorageSnapshots, useStreamHandlers, useSubscribeCalendar, useSwitchWorkspace, useSyncAccountsOnOpen, useSyncCalendarAccount, useTerminateSession, useThinkingContent, useThreadDocument, useTriggerDriveSync, useTriggerMailboxSync, useUnarchiveWorkspace, useUnreadByPeer, useUnshareCalendar, useUpdateCalendar, useUpdateCalendarAccount, useUpdateContact, useUpdateConversation, useUpdateDatabase, useUpdateDatabaseRow, useUpdateDocTag, useUpdateDocuments, useUpdateEvent, useUpdateFact, useUpdateMailMessage, useUpdateProjectAddonSettings, useUpdateProjectFields, useUpdateProjectNextPeriodAddons, useUpdateUserSettings, useUpdateWorkflow, useUpdateWorkspace, useUploadDocuments, useUploadFiles, useUploadFromUrls, useUploadSkillFiles, useUploadUrls, useUserSettings, useVideoRecorder, useWorkItems, useWorkNotifications, useWorkflowRuns, useWorkflows, useWorkspaceArchive, useWorkspaceDocs, useWorkspaceExportDownload, useWorkspaceNotificationLevel, useWorkspaceRole, useWorkspaceTransfer, useWorkspaceTransfers, useWorkspaceTrash, useWorkspaceUsers, userDisplayName, userInitials, waitForResponseId, withRelativePath, workflowStepOf, workspaceHouseTemplateId };
12964
+ export { AGENT_CONTROL_COMMANDS, ALLOWED_PORTAL_ORIGINS, ARCHIVE_POLL_MS, ASSISTANT_MENTION_LABEL, AUTO_CHAT_MODEL, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiHost2 as ArbiHost, ArbiWebSocketProvider, ArtifactCanvas, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, CONVERSATION_SWITCH_MEASURE, ChatBubble, CitationRenderer, CommandPalette, CommandPaletteProvider, ConversationList, ConversationScope, DATABASE_RELATION_PICK_LIMIT, DATABASE_ROWS_PAGE, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DateSeparator, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentReview, DraftTitleControls, FIRST_TOKEN_MEASURE, FileIcon, GitHubIcon, ImageCropModal, ImageCropper, LIVE_UPDATE_TYPES, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MIN_NARRATION_DWELL_MS, MailOfflineUnavailableError, MessageArtifactCard, PENDING_SYNC_PREDICATE, POLL_EVERY_MS, PhotoCapture, RUN_WINDOW_MS, SIGNATURE_NOTIFICATION_TYPES, SLOW_AFTER_MS, STILL_WORKING, StorageActionError, TRANSFER_POLL_MS, TaskThreadPendingError, TypingIndicator, UPLOAD_ACCEPT, UPLOAD_MAX_FILE_SIZE, VideoCapture, VoiceNoteRecorder, WORK_NOTIFICATION_LABELS, __resetPendingFinalCommitsForTests, __resetStreamingTokenBufferForTests, accountPath, addAssistantMessageToCache, addUserMessageToCache, adoptNewChatDocument, aliasTakenMessage, allConversationThreads, annotateThread, announceMailDraftReplaced, appendTokenToMessage, applyConversationEvent, applyFinalContextToMessage, applyLiveUpdate, applyNotificationRow, applyOptimisticDocumentEdit, applyOutputItemToMessage, applyTaskEvent, arbiMailClient, archiveName, archivedWorkspaceMessage, bindThreadDocument, boundDocumentOf, buildDocumentMetadataRows, buildMentionCandidates, buildPendingFirstTurn, buildPendingSyncItem, buildWorkspaceArchive, cacheThreadBinding, cachedAssistantMode, cachedMentionCandidates, cachedQuotaUsedUp, calendarNotificationMeta, callNotificationMeta, captureFrameAsBlob, clearLoadingState, clearUserInputRequest, commitFinalMessage, completeQueuedUserMessageByContent, connectOAuthCalendarAccount, connectorErrorStatus, connectorReturnTo, createMailClient, createStreamHandlers, createWorkspaceSwitch, cropImage, dayKey, defaultMailAlias, deploymentUserMeta, describeActivity, describeCalendarNotification, describeServerNotification, discardStreamingTokensForMessage, disconnectAttachedRun, documentActivityMeta, documentActivityPhrase, documentDisplayName, docxMentionMeta, downloadRecoveryFile, ensureAssistantMessageLoading, extractZipFile, fallbackFileName, fileAttachment, filesFromDrop, flushStreamingTokens, forgetUploadedDocumentFolder, formatConfigValidationError, formatIdentityPrice, getInterjectionText, getNotificationTypeMeta, getOfflineDocument, getOrphanedLastMessage, getRelatedLabels, getRelatedTotal, getRunStartedAt, getThreadsQueryKey, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasPendingFinalCommit, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars, invalidateConversationActivity, invalidateRelatedRows, isActivityKey, isAliasTakenError, isArchiveMoving, isCommentToPeople, isDeploymentAdmin, isDeploymentUserNotification, isFullConfig, isMessageRunning, isNotificationRow, isOfflineReadableArbiQuery, isOrphanedUserMessage, isQueuedCalendarWrite, isReplayableArbiMutation, isRestorableArbiQueryOnline, isSignatureNotificationType, isTransferFinished, isTransferResumable, isWorkspaceArchivedError, isWorkspaceNotificationType, isZipFile, loadOfflineDocument, mailDraftIdFromContent, mailJson, markMessageAsFailed, markNarrationSettled, migrateLegacyThreadDocuments, mountDiditVerification, nextAliasSuggestion, notificationUserName, openAccessRequest, parseActivityContent, parseDeleteAccountBlockers, pendingChatModelSave, peopleDirectory, personOfUser, pickRecentWorkspaces, prepareUploadFiles, redlineStats, refuseChatWhenOffline, registerArbiMutationDefaults, registerAttachedRun, removeSettledNarration, requestPersistentStorage, resetCalendarAccountSyncState, resetMessageContent, resolveActiveWorkspace, resolveConfigModel, resolveReplyTarget, rollbackOptimisticDocumentEdit, safePortalUrl, serverNotificationBellEntry, setMessageContent, setUserInputRequest, signatureNotificationPhrase, signatureRequestMeta, subscribeDocumentReads, supportsHouseTemplates, textToArtifact, threadBinding, threadEndingAtContains, titleFromQuestion, toChatCitations, toNotificationPreferences, toRedlineMarkdown, toShellWorkspace, updateMessageWithMetadata, updateUserMessageInCache, updateUserMessageStateInCache, uploadFolderOf, uploadedDocumentFolder, useActOnStep, useAddChatMembers, useAddDatabaseRows, useAddHolidayCalendar, useAddProjectAddonBlock, useAddWorkspaceMembers, useAddonQuote, useAgentChats, useAgentConfig, useAgentDmStatus, useAgentModels, useAgentRunControl, useAgentSession, useAgentWorkspaces, useAiTask, useAnswerAgentQuestion, useApplyChatModel, useArbiConnected, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArchiveProgressPolling, useArchiveWorkspace, useAskAgain, useAssignDocTags, useAuthorizeLimits, useAutoSendDraft, useBookingPages, useBranchNavigation, useCalDavProfiles, useCalendarAccounts, useCalendarEvent, useCalendarEventByUid, useCalendarEvents, useCalendarInvitations, useCalendarOutbox, useCalendarOverlays, useCalendarSettings, useCalendarShares, useCalendarSupport, useCalendars, useCameraStream, useCanEditShared, useCancelDriveSync, useCancelMailboxSync, useCancelManyPendingSync, useCancelProjectSubscription, useCancelWorkspaceTransfer, useChangeProjectPlan, useChargeWatch, useChatArrivals, useChatPost, useChatSummaries, useChatThread, useChatUnreadTotal, useChats, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigSchema, useConfirmEmailChange, useConnectCalDavAccount, useConnectMailAccount, useConnectOAuthAccount, useConnectRunStream, useConnectorAutoSync, useConnectorCatalog, useConnectorVendorVisibility, useContacts, useConversation, useConversationActions, useConversationActivity, useConversationData, useConversationDocuments, useConversationIsShared, useConversationItems, useConversationPendingAuth, useConversationSearch, useConversationTurn, useConversationUsage, useCreateAgent, useCreateCalendar, useCreateContact, useCreateDatabase, useCreateEvent, useCreateFact, useCreateFacts, useCreateGroupChat, useCreateProject, useCreateProjectCheckout, useCreateRoom, useCreateWork, useCreateWorkflow, useCreateWorkspace, useCurrentSessionId, useDatabase, useDatabaseRows, useDatabases, useDecideCounter, useDeleteAccount, useDeleteAccountFlow, useDeleteBookingPage, useDeleteCalendar, useDeleteChatMessage, useDeleteConfig, useDeleteContact, useDeleteConversation, useDeleteDatabase, useDeleteDatabaseRows, useDeleteDocuments, useDeleteEvent, useDeleteFact, useDeleteMessage, useDeleteNotifications, useDeleteProject, useDeleteSkill, useDeleteWorkflow, useDeleteWorkspaces, useDisconnectCalendarAccount, useDisconnectConnector, useDisconnectMailAccount, useDisconnectSlack, useDismissedTips, useDocumentAutoAdd, useDocumentHostActions, useDocumentPendingSync, useDocumentThumbnails, useDocumentsSupport, useDownloadDocuments, useDriveFolderChildren, useDriveFolderDocCount, useDriveFolders, useDriveSyncEstimate, useDriveSyncProgress, useEmailChange, useEnableDriveSync, useEnableMailboxSync, useExportDatabase, useFacts, useFetchCalendarEvent, useFilteredProjects, useFinaliseTranslation, useFindTime, useFollowThread, useFreeBusy, useGenerateAgentAvatar, useGenerateDocTags, useGrantAgentAccess, useHolidayCountries, useHouseTemplateCandidates, useIdentityVerification, useIdentityVerificationFlow, useImportCalendar, useImportContacts, useImportDatabase, useImportDatabaseRows, useInvalidateAfterTransfer, useInvalidateProjects, useInvalidateStorage, useInviteContacts, useIsSlow, useIsWorkspaceOwner, useKeepDocumentsOffline, useLinkContact, useMailAccounts, useMailAttachmentText, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useMailboxFolders, useMailboxSyncProgress, useMarkChatRead, useMarkNotificationsRead, useMcpTools, useMentionCandidates, useMessageTimer, useMoveEvent, useMoveWorkspaceToProject, useMyConnectors, useNotificationPreferences, useNotifications, useNotifyConversation, useOfflineDocumentIds, useOpenSelectedWorkspace, useOpenViewerDocumentId, usePassageQuotes, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePendingSyncCounts, usePendingSyncItems, usePeople, usePeopleSearch, usePlanQuote, usePlanWork, usePlanWorkspaceTransfer, usePreviewProjectPlanChange, useProcessingTask, useProcessingTasks, useProducts, useProjectBillingPortal, useProjectConversationUsage, useProjectEvents, usePublishCalendar, useRefreshCalendar, useRefreshConnectorsOnRunEnd, useRefreshProject, useRelatedDocuments, useRemoveChatMember, useRemoveDocTags, useRemoveDocumentsOffline, useRemoveWorkspaceMembers, useRenameChat, useRenameFolder, useRequestEmailChange, useRequestWorkspaceAccess, useRespondToEvent, useResumeCalendarAccountConnect, useResumeWorkspaceTransfer, useRevokeAgentAccess, useRooms, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveBookingPage, useSaveCalendarSettings, useSaveConfig, useSaveConfigField, useSaveMailDraft, useSaveSkill, useSearchContacts, useSearchDatabaseRows, useSearchFacts, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetSkillVisibility, useSetWorkspaceHouseTemplate, useSetWorkspaceMemberRoles, useShareCalendar, useShellWorkspaces, useSignOut, useSkillSource, useSkills, useSlackConnection, useStartAgentSession, useStartCalendarAccountOAuth, useStartTaskQuery, useStartWorkspaceTransfer, useStorageActions, useStorageItemNames, useStorageItems, useStorageProjects, useStorageSnapshots, useStreamHandlers, useSubscribeCalendar, useSwitchWorkspace, useSyncAccountsOnOpen, useSyncCalendarAccount, useTerminateSession, useThinkingContent, useThreadDocument, useTriggerDriveSync, useTriggerMailboxSync, useUnarchiveWorkspace, useUnreadByPeer, useUnshareCalendar, useUpdateCalendar, useUpdateCalendarAccount, useUpdateContact, useUpdateConversation, useUpdateDatabase, useUpdateDatabaseRow, useUpdateDocTag, useUpdateDocuments, useUpdateEvent, useUpdateFact, useUpdateMailMessage, useUpdateProjectAddonSettings, useUpdateProjectFields, useUpdateProjectNextPeriodAddons, useUpdateUserSettings, useUpdateWorkflow, useUpdateWorkspace, useUploadDocuments, useUploadFiles, useUploadFromUrls, useUploadSkillFiles, useUploadUrls, useUserSettings, useVideoRecorder, useWorkItems, useWorkNotifications, useWorkflowRuns, useWorkflows, useWorkspaceArchive, useWorkspaceDocs, useWorkspaceExportDownload, useWorkspaceNotificationLevel, useWorkspaceProcessing, useWorkspaceRole, useWorkspaceTransfer, useWorkspaceTransfers, useWorkspaceTrash, useWorkspaceUsers, userDisplayName, userInitials, waitForResponseId, wipeOfflineDocuments, withRelativePath, workflowStepOf, workspaceHouseTemplateId };
12716
12965
  //# sourceMappingURL=index.js.map
12717
12966
  //# sourceMappingURL=index.js.map