@arbidocs/react 0.5.30 → 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/artifacts/index.cjs +5 -5
- package/dist/artifacts/index.js +2 -2
- package/dist/calls/livekit/index.cjs +41 -41
- package/dist/calls/livekit/index.js +2 -2
- package/dist/{chunk-NV5G5RR5.cjs → chunk-CWJAULV2.cjs} +420 -5
- package/dist/chunk-CWJAULV2.cjs.map +1 -0
- package/dist/{chunk-YMAZYYD5.cjs → chunk-FSPLYO52.cjs} +2264 -2264
- package/dist/chunk-FSPLYO52.cjs.map +1 -0
- package/dist/{chunk-2ERRXEOB.cjs → chunk-GAW2PLSL.cjs} +59 -4
- package/dist/chunk-GAW2PLSL.cjs.map +1 -0
- package/dist/{chunk-3ZLRZTKP.cjs → chunk-KHRCABUX.cjs} +5 -5
- package/dist/{chunk-3ZLRZTKP.cjs.map → chunk-KHRCABUX.cjs.map} +1 -1
- package/dist/{chunk-I4JYI6GY.js → chunk-KUGZXI7V.js} +2266 -2266
- package/dist/chunk-KUGZXI7V.js.map +1 -0
- package/dist/{chunk-VHGJG32Q.js → chunk-MJWUUDYT.js} +57 -5
- package/dist/chunk-MJWUUDYT.js.map +1 -0
- package/dist/{chunk-5X4RZ36M.js → chunk-R4YLLLCT.js} +3 -3
- package/dist/{chunk-5X4RZ36M.js.map → chunk-R4YLLLCT.js.map} +1 -1
- package/dist/{chunk-CIWI5UFT.js → chunk-VTNFF7P6.js} +406 -7
- package/dist/chunk-VTNFF7P6.js.map +1 -0
- package/dist/index.cjs +1337 -820
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +517 -98
- package/dist/index.d.ts +517 -98
- package/dist/index.js +616 -187
- package/dist/index.js.map +1 -1
- package/dist/ui/index.cjs +147 -147
- package/dist/ui/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-2ERRXEOB.cjs.map +0 -1
- package/dist/chunk-CIWI5UFT.js.map +0 -1
- package/dist/chunk-I4JYI6GY.js.map +0 -1
- package/dist/chunk-NV5G5RR5.cjs.map +0 -1
- package/dist/chunk-VHGJG32Q.js.map +0 -1
- package/dist/chunk-YMAZYYD5.cjs.map +0 -1
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-
|
|
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-
|
|
3
|
-
import {
|
|
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-
|
|
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-
|
|
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-
|
|
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,8 +14,8 @@ 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 { 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-
|
|
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-
|
|
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';
|
|
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';
|
|
19
19
|
import { getUserDisplayName, isAgent } from './chunk-APZZQZ6P.js';
|
|
20
20
|
export { Avatar, AvatarFallback, AvatarImage, DEFAULT_SEGMENTER_CONFIG, INITIAL_SEGMENTER_STATE, createUserAvatarIcon, flushSegmenter, getUserAvatarColor, getUserDisplayName, getUserInitials, isAgent, levelFromRms, stepSegmenter } from './chunk-APZZQZ6P.js';
|
|
21
21
|
import { MarkdownRenderer } from './chunk-C44GO33B.js';
|
|
@@ -35,13 +35,13 @@ import { useArbi, useArbiHost } from './chunk-MB34NKBZ.js';
|
|
|
35
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
|
-
import { useQueryClient, useMutation, useQuery, onlineManager, keepPreviousData, useQueries
|
|
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 {
|
|
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,65 +1609,115 @@ function subscribeDocumentReads(qc, onRows) {
|
|
|
1609
1609
|
onRows([data]);
|
|
1610
1610
|
});
|
|
1611
1611
|
}
|
|
1612
|
-
var
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
)
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
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;
|
|
1660
|
-
}
|
|
1661
|
-
function useOpenViewerDocumentId() {
|
|
1662
|
-
const { useOpenViewerDocumentId: useHostViewing } = useDocumentsSupport();
|
|
1663
|
-
return useHostViewing?.() ?? null;
|
|
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
|
+
);
|
|
1664
1644
|
}
|
|
1665
|
-
function
|
|
1666
|
-
const
|
|
1667
|
-
|
|
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]);
|
|
1668
1720
|
}
|
|
1669
|
-
|
|
1670
|
-
// src/documents/documents-writes.ts
|
|
1671
1721
|
function applyOptimisticDocumentEdit(qc, updates) {
|
|
1672
1722
|
const byId = new Map(updates.map((update) => [update.external_id, update]));
|
|
1673
1723
|
const previous = [];
|
|
@@ -1861,7 +1911,6 @@ function useRenameFolder() {
|
|
|
1861
1911
|
function useDeleteDocuments() {
|
|
1862
1912
|
const arbi = useArbi();
|
|
1863
1913
|
const qc = useQueryClient();
|
|
1864
|
-
const { onDocumentsDeleted } = useDocumentsSupport();
|
|
1865
1914
|
return useMutation({
|
|
1866
1915
|
mutationKey: arbiMutationKeys.deleteDocuments(),
|
|
1867
1916
|
mutationFn: (docIds) => arbi.documents.delete(docIds),
|
|
@@ -1872,33 +1921,32 @@ function useDeleteDocuments() {
|
|
|
1872
1921
|
(old) => old.some((doc) => gone.has(doc.external_id)) ? old.filter((doc) => !gone.has(doc.external_id)) : old
|
|
1873
1922
|
);
|
|
1874
1923
|
forgetDocuments(qc, docIds);
|
|
1875
|
-
|
|
1924
|
+
const { clearTask } = useArbiWsStore.getState();
|
|
1925
|
+
for (const id of docIds) clearTask(id);
|
|
1876
1926
|
return qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
|
|
1877
1927
|
}
|
|
1878
1928
|
});
|
|
1879
1929
|
}
|
|
1880
|
-
async function settleUpload(qc, arbi, docIds
|
|
1881
|
-
if (docIds?.length) await refreshDocuments(qc, arbi, docIds
|
|
1930
|
+
async function settleUpload(qc, arbi, docIds) {
|
|
1931
|
+
if (docIds?.length) await refreshDocuments(qc, arbi, docIds);
|
|
1882
1932
|
await qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
|
|
1883
1933
|
}
|
|
1884
1934
|
function useUploadDocuments() {
|
|
1885
1935
|
const arbi = useArbi();
|
|
1886
1936
|
const qc = useQueryClient();
|
|
1887
|
-
const { processingTask } = useDocumentsSupport();
|
|
1888
1937
|
return useMutation({
|
|
1889
1938
|
mutationKey: arbiMutationKeys.uploadDocuments(),
|
|
1890
1939
|
mutationFn: ({ files, options }) => arbi.documents.upload(files, options),
|
|
1891
|
-
onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids
|
|
1940
|
+
onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids)
|
|
1892
1941
|
});
|
|
1893
1942
|
}
|
|
1894
1943
|
function useUploadUrls() {
|
|
1895
1944
|
const arbi = useArbi();
|
|
1896
1945
|
const qc = useQueryClient();
|
|
1897
|
-
const { processingTask } = useDocumentsSupport();
|
|
1898
1946
|
return useMutation({
|
|
1899
1947
|
mutationKey: arbiMutationKeys.uploadUrls(),
|
|
1900
1948
|
mutationFn: ({ urls, shared, configExtId }) => arbi.documents.uploadUrl(urls, { shared, configExtId }),
|
|
1901
|
-
onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids
|
|
1949
|
+
onSuccess: (result) => settleUpload(qc, arbi, result.doc_ext_ids)
|
|
1902
1950
|
});
|
|
1903
1951
|
}
|
|
1904
1952
|
function useAssignDocTags() {
|
|
@@ -1934,21 +1982,43 @@ function useUpdateDocTag() {
|
|
|
1934
1982
|
})
|
|
1935
1983
|
);
|
|
1936
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
|
+
}
|
|
1937
2008
|
function useGenerateDocTags() {
|
|
1938
2009
|
const arbi = useArbi();
|
|
1939
2010
|
const qc = useQueryClient();
|
|
1940
|
-
const { onProcessingQueued } = useDocumentsSupport();
|
|
1941
2011
|
return useMutation({
|
|
1942
2012
|
mutationKey: arbiMutationKeys.generateDocTags(),
|
|
1943
2013
|
mutationFn: ({ tagIds, docIds, overwrite }) => arbi.doctags.generate(tagIds, docIds, { overwrite }),
|
|
1944
2014
|
onMutate: ({ docIds }) => {
|
|
1945
|
-
if (!
|
|
2015
|
+
if (!docIds.length) return void 0;
|
|
1946
2016
|
const workspaceId = arbi.hasWorkspace ? arbi.getWorkspaceId() : "";
|
|
1947
2017
|
const listed = new Map(
|
|
1948
2018
|
(getCachedDocuments(qc, workspaceId) ?? []).map((doc) => [doc.external_id, doc])
|
|
1949
2019
|
);
|
|
1950
2020
|
return {
|
|
1951
|
-
undo:
|
|
2021
|
+
undo: queueProcessing(
|
|
1952
2022
|
docIds.map((docId) => ({
|
|
1953
2023
|
docId,
|
|
1954
2024
|
workspaceId,
|
|
@@ -1964,13 +2034,33 @@ function useGenerateDocTags() {
|
|
|
1964
2034
|
function useFinaliseTranslation() {
|
|
1965
2035
|
const arbi = useArbi();
|
|
1966
2036
|
const qc = useQueryClient();
|
|
1967
|
-
const { processingTask } = useDocumentsSupport();
|
|
1968
2037
|
return useMutation({
|
|
1969
2038
|
mutationFn: (docId) => arbi.documents.finaliseTranslation(docId),
|
|
1970
|
-
onSuccess: (result) => void refreshDocuments(qc, arbi, [result.document_ext_id]
|
|
2039
|
+
onSuccess: (result) => void refreshDocuments(qc, arbi, [result.document_ext_id])
|
|
1971
2040
|
});
|
|
1972
2041
|
}
|
|
1973
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
|
+
|
|
1974
2064
|
// src/documents/document-download.ts
|
|
1975
2065
|
function fallbackFileName(doc) {
|
|
1976
2066
|
if (doc.file_name) return doc.file_name;
|
|
@@ -3143,7 +3233,7 @@ async function runLimited(tasks, limit) {
|
|
|
3143
3233
|
function useUploadFiles() {
|
|
3144
3234
|
const arbi = useArbi();
|
|
3145
3235
|
const qc = useQueryClient();
|
|
3146
|
-
const { resolveWorkspaceKey
|
|
3236
|
+
const { resolveWorkspaceKey } = useDocumentsSupport();
|
|
3147
3237
|
const { data: settings } = useUserSettings();
|
|
3148
3238
|
const { mutateAsync: generateDocTags } = useGenerateDocTags();
|
|
3149
3239
|
const direct = settings?.use_s3_direct_upload === true;
|
|
@@ -3234,7 +3324,7 @@ function useUploadFiles() {
|
|
|
3234
3324
|
const docIds = results.flatMap((result) => result.doc_ext_ids ?? []);
|
|
3235
3325
|
const skipped = results.flatMap((result) => result.skipped ?? []);
|
|
3236
3326
|
if (docIds.length > 0) {
|
|
3237
|
-
const read = await refreshDocuments(qc, arbi, docIds
|
|
3327
|
+
const read = await refreshDocuments(qc, arbi, docIds);
|
|
3238
3328
|
for (const doc of read) forgetUploadedDocumentFolder(doc.external_id);
|
|
3239
3329
|
}
|
|
3240
3330
|
await qc.invalidateQueries({ queryKey: arbiQueryKeys.workspaces() });
|
|
@@ -3245,7 +3335,7 @@ function useUploadFiles() {
|
|
|
3245
3335
|
}
|
|
3246
3336
|
return { docIds, skipped };
|
|
3247
3337
|
},
|
|
3248
|
-
[arbi, qc, direct, resolveWorkspaceKey,
|
|
3338
|
+
[arbi, qc, direct, resolveWorkspaceKey, generateDocTags]
|
|
3249
3339
|
);
|
|
3250
3340
|
}
|
|
3251
3341
|
function isZipUrl(url) {
|
|
@@ -3420,6 +3510,360 @@ function useRelatedDocuments(documents2) {
|
|
|
3420
3510
|
return map;
|
|
3421
3511
|
}, [documents2, similarData, structuralKey]);
|
|
3422
3512
|
}
|
|
3513
|
+
var REPLAYABLE = [
|
|
3514
|
+
...replayableTagMutations,
|
|
3515
|
+
...replayableDocumentMutations
|
|
3516
|
+
];
|
|
3517
|
+
function isReplayableArbiMutation(mutationKey) {
|
|
3518
|
+
return !!mutationKey && REPLAYABLE.some((m) => partialMatchKey(mutationKey, m.mutationKey));
|
|
3519
|
+
}
|
|
3520
|
+
function registerArbiMutationDefaults(queryClient, client) {
|
|
3521
|
+
for (const m of REPLAYABLE) {
|
|
3522
|
+
queryClient.setMutationDefaults(m.mutationKey, {
|
|
3523
|
+
mutationFn: (variables) => m.run(client(), variables),
|
|
3524
|
+
onSuccess: (data, variables) => m.settle(queryClient, data, variables)
|
|
3525
|
+
});
|
|
3526
|
+
}
|
|
3527
|
+
}
|
|
3528
|
+
var DOCUMENT_FAMILIES = [
|
|
3529
|
+
"documents",
|
|
3530
|
+
"document",
|
|
3531
|
+
"documentsById",
|
|
3532
|
+
"documentVersions",
|
|
3533
|
+
"similarDocuments"
|
|
3534
|
+
];
|
|
3535
|
+
var OFFLINE_READABLE = [...DOCUMENT_FAMILIES, "workspaces", "userSettings", "projects"];
|
|
3536
|
+
function isOfflineReadableArbiQuery(queryKey) {
|
|
3537
|
+
return queryKey[0] === "arbi" && OFFLINE_READABLE.includes(queryKey[1]);
|
|
3538
|
+
}
|
|
3539
|
+
function isRestorableArbiQueryOnline(queryKey, data) {
|
|
3540
|
+
if (queryKey[0] !== "arbi") return true;
|
|
3541
|
+
if (queryKey[1] === "documents") return false;
|
|
3542
|
+
if (!DOCUMENT_FAMILIES.includes(queryKey[1])) return true;
|
|
3543
|
+
const docs = Array.isArray(data) ? data : [data];
|
|
3544
|
+
return !docs.some((doc) => {
|
|
3545
|
+
const status = doc?.status;
|
|
3546
|
+
return !!status && !FINISHED_DOCUMENT_STATUSES.has(status);
|
|
3547
|
+
});
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3550
|
+
// src/documents/pending-sync.ts
|
|
3551
|
+
var META_LABELS = {
|
|
3552
|
+
title: "Title",
|
|
3553
|
+
doc_date: "Date",
|
|
3554
|
+
doc_nature: "Type",
|
|
3555
|
+
doc_author: "Author",
|
|
3556
|
+
doc_subject: "Abstract"
|
|
3557
|
+
};
|
|
3558
|
+
var KIND_BY_KEY = [
|
|
3559
|
+
[arbiMutationKeys.updateDocuments(), "fields"],
|
|
3560
|
+
[arbiMutationKeys.assignDocTags(), "assignTag"],
|
|
3561
|
+
[arbiMutationKeys.removeDocTags(), "removeTag"],
|
|
3562
|
+
[arbiMutationKeys.updateDocTag(), "noteTag"],
|
|
3563
|
+
[arbiMutationKeys.createTag(), "createTag"]
|
|
3564
|
+
];
|
|
3565
|
+
function kindOf(mutationKey) {
|
|
3566
|
+
return mutationKey ? KIND_BY_KEY.find(([key]) => partialMatchKey(mutationKey, key))?.[1] : void 0;
|
|
3567
|
+
}
|
|
3568
|
+
function statusOf(isPaused, status) {
|
|
3569
|
+
if (status === "error") return "error";
|
|
3570
|
+
return isPaused ? "queued" : "syncing";
|
|
3571
|
+
}
|
|
3572
|
+
function docIdsFromVariables(kind, variables) {
|
|
3573
|
+
if (kind === "fields")
|
|
3574
|
+
return (variables?.documents ?? []).map(
|
|
3575
|
+
(d) => d.external_id
|
|
3576
|
+
);
|
|
3577
|
+
if (kind === "assignTag" || kind === "removeTag")
|
|
3578
|
+
return variables?.docIds ?? [];
|
|
3579
|
+
if (kind === "noteTag") {
|
|
3580
|
+
const docId = variables?.docId;
|
|
3581
|
+
return docId ? [docId] : [];
|
|
3582
|
+
}
|
|
3583
|
+
return [];
|
|
3584
|
+
}
|
|
3585
|
+
function prevDocsFrom(context) {
|
|
3586
|
+
const edit = context;
|
|
3587
|
+
if (!edit?.optimistic) return /* @__PURE__ */ new Map();
|
|
3588
|
+
return new Map(edit.previous.map((doc) => [doc.external_id, doc]));
|
|
3589
|
+
}
|
|
3590
|
+
function describeDocEdit(variables, context) {
|
|
3591
|
+
const first = variables?.documents?.[0];
|
|
3592
|
+
if (!first) return "Edited document";
|
|
3593
|
+
const prevDocs = prevDocsFrom(context);
|
|
3594
|
+
if ("folder" in first) {
|
|
3595
|
+
const folder = first.folder ?? null;
|
|
3596
|
+
return folder ? `Moved to ${folder}` : "Removed from folder";
|
|
3597
|
+
}
|
|
3598
|
+
if ("shared" in first) return first.shared ? "Shared in chat" : "Removed from chat";
|
|
3599
|
+
if ("labels" in first) return "Changed labels";
|
|
3600
|
+
if ("doc_metadata" in first) {
|
|
3601
|
+
const nextMeta = first.doc_metadata ?? {};
|
|
3602
|
+
const prevMeta = prevDocs.get(first.external_id)?.doc_metadata ?? {};
|
|
3603
|
+
const changed = [];
|
|
3604
|
+
for (const [key, label] of Object.entries(META_LABELS)) {
|
|
3605
|
+
const next = nextMeta[key] ?? "";
|
|
3606
|
+
const prev = prevMeta[key] ?? "";
|
|
3607
|
+
if (String(next) === String(prev)) continue;
|
|
3608
|
+
changed.push(next ? `${label} \u2192 \u201C${String(next)}\u201D` : `${label} cleared`);
|
|
3609
|
+
}
|
|
3610
|
+
if (changed.length > 0) return changed.join(", ");
|
|
3611
|
+
return "Edited details";
|
|
3612
|
+
}
|
|
3613
|
+
return "Edited document";
|
|
3614
|
+
}
|
|
3615
|
+
var TAG_VERBS = {
|
|
3616
|
+
assignTag: "Applied",
|
|
3617
|
+
removeTag: "Removed",
|
|
3618
|
+
noteTag: "Edited the note on"
|
|
3619
|
+
};
|
|
3620
|
+
function describeChange(raw, tagNameById) {
|
|
3621
|
+
const { kind, variables, context } = raw;
|
|
3622
|
+
const verb = TAG_VERBS[kind];
|
|
3623
|
+
if (verb) {
|
|
3624
|
+
const tagId = variables?.tagId;
|
|
3625
|
+
const tagName = tagId ? tagNameById.get(tagId) : void 0;
|
|
3626
|
+
return tagName ? `${verb} tag \u201C${tagName}\u201D` : `${verb} a tag`;
|
|
3627
|
+
}
|
|
3628
|
+
if (kind === "createTag") {
|
|
3629
|
+
const name = variables?.name;
|
|
3630
|
+
return name ? `Created tag \u201C${name}\u201D` : "Created a tag";
|
|
3631
|
+
}
|
|
3632
|
+
return describeDocEdit(variables, context);
|
|
3633
|
+
}
|
|
3634
|
+
function buildPendingSyncItem(raw, docNameById, tagNameById) {
|
|
3635
|
+
const docIds = docIdsFromVariables(raw.kind, raw.variables);
|
|
3636
|
+
const names = docIds.map((id) => docNameById.get(id)).filter(Boolean);
|
|
3637
|
+
const document2 = raw.kind === "createTag" ? "Workspace labels" : names.length > 0 ? names.join(", ") : docIds.length > 1 ? `${docIds.length} documents` : "A document";
|
|
3638
|
+
return {
|
|
3639
|
+
mutationId: raw.mutationId,
|
|
3640
|
+
document: document2,
|
|
3641
|
+
change: describeChange(raw, tagNameById),
|
|
3642
|
+
status: raw.status,
|
|
3643
|
+
at: raw.at,
|
|
3644
|
+
docIds
|
|
3645
|
+
};
|
|
3646
|
+
}
|
|
3647
|
+
var PENDING_SYNC_PREDICATE = (m) => (
|
|
3648
|
+
// Only real offline EDITS belong in the queue. An incidental paused mutation
|
|
3649
|
+
// (e.g. POST /v1/workspace/{id}/open fired on an offline cold-boot) is not a
|
|
3650
|
+
// user "change" and must not show as a phantom pending item.
|
|
3651
|
+
//
|
|
3652
|
+
// Gated on offline: a mutation only `isPaused` when React Query holds it back
|
|
3653
|
+
// for being offline, so this is the natural "offline mode" gate. We
|
|
3654
|
+
// deliberately do NOT count a plain in-flight (`status === 'pending'`) edit —
|
|
3655
|
+
// that's just a normal ONLINE save mid-request, and counting it made rows
|
|
3656
|
+
// flash "pending/syncing" while fully online. `error` is kept so a failed
|
|
3657
|
+
// sync stays visible to review/undo.
|
|
3658
|
+
isReplayableArbiMutation(m.options.mutationKey) && (m.state.isPaused || m.state.status === "error")
|
|
3659
|
+
);
|
|
3660
|
+
function usePendingSyncItems() {
|
|
3661
|
+
const { data: documents2 } = useDocuments();
|
|
3662
|
+
const { data: tags } = useTags();
|
|
3663
|
+
const raw = useMutationState({
|
|
3664
|
+
filters: { predicate: PENDING_SYNC_PREDICATE },
|
|
3665
|
+
select: (m) => ({
|
|
3666
|
+
mutationId: m.mutationId,
|
|
3667
|
+
kind: kindOf(m.options.mutationKey) ?? "fields",
|
|
3668
|
+
variables: m.state.variables,
|
|
3669
|
+
context: m.state.context,
|
|
3670
|
+
status: statusOf(m.state.isPaused, m.state.status),
|
|
3671
|
+
at: m.state.submittedAt
|
|
3672
|
+
})
|
|
3673
|
+
});
|
|
3674
|
+
return useMemo(() => {
|
|
3675
|
+
const docNameById = /* @__PURE__ */ new Map();
|
|
3676
|
+
for (const doc of documents2 ?? [])
|
|
3677
|
+
docNameById.set(doc.external_id, getDocumentTitle(doc, doc.file_name ?? ""));
|
|
3678
|
+
const tagNameById = /* @__PURE__ */ new Map();
|
|
3679
|
+
for (const tag of tags ?? []) tagNameById.set(tag.external_id, tag.name);
|
|
3680
|
+
return raw.map((r) => buildPendingSyncItem(r, docNameById, tagNameById));
|
|
3681
|
+
}, [raw, documents2, tags]);
|
|
3682
|
+
}
|
|
3683
|
+
function usePendingSyncCounts() {
|
|
3684
|
+
const statuses = useMutationState({
|
|
3685
|
+
filters: { predicate: PENDING_SYNC_PREDICATE },
|
|
3686
|
+
select: (m) => m.state.status === "error" ? "error" : "pending"
|
|
3687
|
+
});
|
|
3688
|
+
return useMemo(
|
|
3689
|
+
() => ({ pending: statuses.length, failed: statuses.filter((s) => s === "error").length }),
|
|
3690
|
+
[statuses]
|
|
3691
|
+
);
|
|
3692
|
+
}
|
|
3693
|
+
function useCancelManyPendingSync() {
|
|
3694
|
+
const queryClient = useQueryClient();
|
|
3695
|
+
return useCallback(
|
|
3696
|
+
(mutationIds) => {
|
|
3697
|
+
const wanted = new Set(mutationIds);
|
|
3698
|
+
const cache = queryClient.getMutationCache();
|
|
3699
|
+
const undoable = cache.getAll().filter((m) => wanted.has(m.mutationId) && (m.state.isPaused || m.state.status === "error")).sort((a, b) => b.state.submittedAt - a.state.submittedAt);
|
|
3700
|
+
for (const mutation of undoable) {
|
|
3701
|
+
rollbackOptimisticDocumentEdit(queryClient, mutation.state.context);
|
|
3702
|
+
cache.remove(mutation);
|
|
3703
|
+
}
|
|
3704
|
+
},
|
|
3705
|
+
[queryClient]
|
|
3706
|
+
);
|
|
3707
|
+
}
|
|
3708
|
+
var usePendingDocIds = create(() => ({ ids: /* @__PURE__ */ new Set() }));
|
|
3709
|
+
var watched = /* @__PURE__ */ new WeakSet();
|
|
3710
|
+
function sameSet(a, b) {
|
|
3711
|
+
if (a.size !== b.size) return false;
|
|
3712
|
+
for (const v of a) if (!b.has(v)) return false;
|
|
3713
|
+
return true;
|
|
3714
|
+
}
|
|
3715
|
+
function watchPendingDocIds(queryClient) {
|
|
3716
|
+
if (watched.has(queryClient)) return;
|
|
3717
|
+
watched.add(queryClient);
|
|
3718
|
+
const cache = queryClient.getMutationCache();
|
|
3719
|
+
const update = () => {
|
|
3720
|
+
const ids = new Set(
|
|
3721
|
+
cache.findAll({ predicate: PENDING_SYNC_PREDICATE }).flatMap((m) => docIdsFromVariables(kindOf(m.options.mutationKey), m.state.variables))
|
|
3722
|
+
);
|
|
3723
|
+
if (!sameSet(usePendingDocIds.getState().ids, ids)) usePendingDocIds.setState({ ids });
|
|
3724
|
+
};
|
|
3725
|
+
update();
|
|
3726
|
+
cache.subscribe(update);
|
|
3727
|
+
}
|
|
3728
|
+
function useDocumentPendingSync(docId) {
|
|
3729
|
+
const queryClient = useQueryClient();
|
|
3730
|
+
useState(() => watchPendingDocIds(queryClient));
|
|
3731
|
+
return usePendingDocIds((s) => docId ? s.ids.has(docId) : false);
|
|
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
|
+
}
|
|
3423
3867
|
|
|
3424
3868
|
// src/chat/stream-handlers.ts
|
|
3425
3869
|
var MIN_NARRATION_DWELL_MS = 4e3;
|
|
@@ -3791,7 +4235,7 @@ function useStreamHandlers() {
|
|
|
3791
4235
|
return "";
|
|
3792
4236
|
}
|
|
3793
4237
|
},
|
|
3794
|
-
refreshDocuments: (ids) => refreshDocuments(queryClient, arbi, ids
|
|
4238
|
+
refreshDocuments: (ids) => refreshDocuments(queryClient, arbi, ids)
|
|
3795
4239
|
},
|
|
3796
4240
|
params
|
|
3797
4241
|
),
|
|
@@ -5817,6 +6261,16 @@ var ChatBubble = memo(function ChatBubble2({
|
|
|
5817
6261
|
);
|
|
5818
6262
|
});
|
|
5819
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
|
+
|
|
5820
6274
|
// src/mail/client.ts
|
|
5821
6275
|
var MailOfflineUnavailableError = class extends Error {
|
|
5822
6276
|
constructor(message) {
|
|
@@ -6260,6 +6714,30 @@ async function applyLiveUpdate(queryClient, message) {
|
|
|
6260
6714
|
return false;
|
|
6261
6715
|
}
|
|
6262
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
|
+
}
|
|
6263
6741
|
var ArbiWsContext = createContext(null);
|
|
6264
6742
|
function useArbiWsContext() {
|
|
6265
6743
|
const ctx = useContext(ArbiWsContext);
|
|
@@ -6268,14 +6746,6 @@ function useArbiWsContext() {
|
|
|
6268
6746
|
}
|
|
6269
6747
|
return ctx;
|
|
6270
6748
|
}
|
|
6271
|
-
var INITIAL_RECONNECT_DELAY_MS = 1e3;
|
|
6272
|
-
var MAX_RECONNECT_DELAY_MS = 3e4;
|
|
6273
|
-
function nextReconnectDelay(attempt) {
|
|
6274
|
-
return Math.min(INITIAL_RECONNECT_DELAY_MS * 2 ** Math.max(0, attempt), MAX_RECONNECT_DELAY_MS);
|
|
6275
|
-
}
|
|
6276
|
-
function resolveSocketBaseUrl(configured, origin) {
|
|
6277
|
-
return /^https?:\/\//.test(configured) || !origin ? configured : origin;
|
|
6278
|
-
}
|
|
6279
6749
|
var EVICTED_CLOSE_CODE = 1008;
|
|
6280
6750
|
function ArbiWebSocketProvider({
|
|
6281
6751
|
enabled = true,
|
|
@@ -6315,22 +6785,32 @@ function ArbiWebSocketProvider({
|
|
|
6315
6785
|
}
|
|
6316
6786
|
let conn = null;
|
|
6317
6787
|
let cancelled = false;
|
|
6788
|
+
let evicted = false;
|
|
6789
|
+
const me = () => arbiRef.current.isLoggedIn ? arbiRef.current.user.identity()?.externalId ?? null : null;
|
|
6318
6790
|
const onMessage = (msg) => {
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
else {
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
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);
|
|
6334
6814
|
for (const fn of subscribersRef.current) {
|
|
6335
6815
|
try {
|
|
6336
6816
|
fn(msg);
|
|
@@ -6341,7 +6821,7 @@ function ArbiWebSocketProvider({
|
|
|
6341
6821
|
let retryTimer = null;
|
|
6342
6822
|
let attempt = 0;
|
|
6343
6823
|
const scheduleRestart = () => {
|
|
6344
|
-
if (cancelled || retryTimer) return;
|
|
6824
|
+
if (cancelled || evicted || retryTimer) return;
|
|
6345
6825
|
setStatus("disconnected");
|
|
6346
6826
|
const delay = nextReconnectDelay(attempt);
|
|
6347
6827
|
attempt += 1;
|
|
@@ -6380,16 +6860,18 @@ function ArbiWebSocketProvider({
|
|
|
6380
6860
|
attempt = 0;
|
|
6381
6861
|
setStatus("connected");
|
|
6382
6862
|
},
|
|
6383
|
-
// Evicted
|
|
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.
|
|
6384
6865
|
shouldReconnect: (code) => {
|
|
6385
|
-
if (code !== EVICTED_CLOSE_CODE) return true;
|
|
6866
|
+
if (code !== EVICTED_CLOSE_CODE && !evicted) return true;
|
|
6867
|
+
evicted = true;
|
|
6386
6868
|
setEvicted(true);
|
|
6387
6869
|
setStatus("disconnected");
|
|
6388
6870
|
return false;
|
|
6389
6871
|
},
|
|
6390
6872
|
onReconnectFailed: scheduleRestart,
|
|
6391
6873
|
onClose: () => {
|
|
6392
|
-
if (!cancelled) setStatus("reconnecting");
|
|
6874
|
+
if (!cancelled) setStatus(evicted ? "disconnected" : "reconnecting");
|
|
6393
6875
|
}
|
|
6394
6876
|
});
|
|
6395
6877
|
if (cancelled) {
|
|
@@ -6437,34 +6919,6 @@ function useArbiWsStatus() {
|
|
|
6437
6919
|
function useArbiConnected() {
|
|
6438
6920
|
return useArbiWsStore((s) => s.status === "connected");
|
|
6439
6921
|
}
|
|
6440
|
-
function useArbiWsTasks() {
|
|
6441
|
-
return useArbiWsStore((s) => s.tasks);
|
|
6442
|
-
}
|
|
6443
|
-
function useArbiWsTask(docId) {
|
|
6444
|
-
return useArbiWsStore((s) => s.tasks[docId]);
|
|
6445
|
-
}
|
|
6446
|
-
function useArbiDocumentSync(workspaceId) {
|
|
6447
|
-
const queryClient = useQueryClient();
|
|
6448
|
-
const arbi = useArbi();
|
|
6449
|
-
useEffect(
|
|
6450
|
-
() => subscribeDocumentReads(queryClient, (rows) => useArbiWsStore.getState().settleTasks(rows)),
|
|
6451
|
-
[queryClient]
|
|
6452
|
-
);
|
|
6453
|
-
useArbiWebSocket((msg) => {
|
|
6454
|
-
if (!workspaceId) return;
|
|
6455
|
-
if (isMessageType(msg, "batch_complete")) {
|
|
6456
|
-
if (msg.workspace_ext_id !== workspaceId) return;
|
|
6457
|
-
if (msg.doc_ext_ids?.length) void refreshDocuments(queryClient, arbi, msg.doc_ext_ids);
|
|
6458
|
-
void queryClient.invalidateQueries({ queryKey: arbiQueryKeys.tags(workspaceId) });
|
|
6459
|
-
return;
|
|
6460
|
-
}
|
|
6461
|
-
if (isMessageType(msg, "task_update")) {
|
|
6462
|
-
if (msg.workspace_ext_id !== workspaceId) return;
|
|
6463
|
-
if (FINISHED_DOCUMENT_STATUSES.has(msg.status))
|
|
6464
|
-
void refreshDocuments(queryClient, arbi, [msg.doc_ext_id]);
|
|
6465
|
-
}
|
|
6466
|
-
});
|
|
6467
|
-
}
|
|
6468
6922
|
var WORKSPACE_SCOPED_PACKAGE_KEYS = [
|
|
6469
6923
|
arbiQueryKeys.allDocuments(),
|
|
6470
6924
|
arbiQueryKeys.allSimilarDocuments(),
|
|
@@ -7291,42 +7745,6 @@ function usePassageQuotes(docIds) {
|
|
|
7291
7745
|
[passages]
|
|
7292
7746
|
);
|
|
7293
7747
|
}
|
|
7294
|
-
var REPLAYABLE = [
|
|
7295
|
-
...replayableTagMutations,
|
|
7296
|
-
...replayableDocumentMutations
|
|
7297
|
-
];
|
|
7298
|
-
function isReplayableArbiMutation(mutationKey) {
|
|
7299
|
-
return !!mutationKey && REPLAYABLE.some((m) => partialMatchKey(mutationKey, m.mutationKey));
|
|
7300
|
-
}
|
|
7301
|
-
function registerArbiMutationDefaults(queryClient, client) {
|
|
7302
|
-
for (const m of REPLAYABLE) {
|
|
7303
|
-
queryClient.setMutationDefaults(m.mutationKey, {
|
|
7304
|
-
mutationFn: (variables) => m.run(client(), variables),
|
|
7305
|
-
onSuccess: (data, variables) => m.settle(queryClient, data, variables)
|
|
7306
|
-
});
|
|
7307
|
-
}
|
|
7308
|
-
}
|
|
7309
|
-
var DOCUMENT_FAMILIES = [
|
|
7310
|
-
"documents",
|
|
7311
|
-
"document",
|
|
7312
|
-
"documentsById",
|
|
7313
|
-
"documentVersions",
|
|
7314
|
-
"similarDocuments"
|
|
7315
|
-
];
|
|
7316
|
-
var OFFLINE_READABLE = [...DOCUMENT_FAMILIES, "workspaces", "userSettings", "projects"];
|
|
7317
|
-
function isOfflineReadableArbiQuery(queryKey) {
|
|
7318
|
-
return queryKey[0] === "arbi" && OFFLINE_READABLE.includes(queryKey[1]);
|
|
7319
|
-
}
|
|
7320
|
-
function isRestorableArbiQueryOnline(queryKey, data) {
|
|
7321
|
-
if (queryKey[0] !== "arbi") return true;
|
|
7322
|
-
if (queryKey[1] === "documents") return false;
|
|
7323
|
-
if (!DOCUMENT_FAMILIES.includes(queryKey[1])) return true;
|
|
7324
|
-
const docs = Array.isArray(data) ? data : [data];
|
|
7325
|
-
return !docs.some((doc) => {
|
|
7326
|
-
const status = doc?.status;
|
|
7327
|
-
return !!status && !FINISHED_DOCUMENT_STATUSES.has(status);
|
|
7328
|
-
});
|
|
7329
|
-
}
|
|
7330
7748
|
function useFilteredProjects(filters, options) {
|
|
7331
7749
|
const arbi = useArbi();
|
|
7332
7750
|
return useQuery({
|
|
@@ -10997,16 +11415,7 @@ function useWorkNotifications(options) {
|
|
|
10997
11415
|
}
|
|
10998
11416
|
function useNotifications(options = {}) {
|
|
10999
11417
|
const arbi = useArbi();
|
|
11000
|
-
const queries = useQueryClient();
|
|
11001
11418
|
const limit = options.limit ?? 100;
|
|
11002
|
-
const ws = useContext(ArbiWsContext);
|
|
11003
|
-
useEffect(
|
|
11004
|
-
() => ws?.subscribe((message) => {
|
|
11005
|
-
if ("sender" in message && "recipient" in message)
|
|
11006
|
-
void queries.invalidateQueries({ queryKey: arbiQueryKeys.allNotifications() });
|
|
11007
|
-
}),
|
|
11008
|
-
[ws, queries]
|
|
11009
|
-
);
|
|
11010
11419
|
return useQuery({
|
|
11011
11420
|
queryKey: arbiQueryKeys.notifications(limit),
|
|
11012
11421
|
queryFn: () => arbi.notifications.list({ limit }),
|
|
@@ -12095,6 +12504,26 @@ function useRemoveChatMember() {
|
|
|
12095
12504
|
}
|
|
12096
12505
|
});
|
|
12097
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
|
+
}
|
|
12098
12527
|
function DateSeparator({ children }) {
|
|
12099
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 }) });
|
|
12100
12529
|
}
|
|
@@ -12532,6 +12961,6 @@ function CommandPaletteProvider({
|
|
|
12532
12961
|
] });
|
|
12533
12962
|
}
|
|
12534
12963
|
|
|
12535
|
-
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, 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, 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, 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, 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 };
|
|
12536
12965
|
//# sourceMappingURL=index.js.map
|
|
12537
12966
|
//# sourceMappingURL=index.js.map
|