@arbidocs/react 0.5.137 → 0.5.139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4161,6 +4161,11 @@ interface ArbiWsState {
4161
4161
  * document was dismissed a moment ago. Resolves whether it was taken.
4162
4162
  */
4163
4163
  applyTaskUpdate: (msg: WsTaskUpdateMessage) => boolean;
4164
+ /**
4165
+ * Take several `task_update`s in one write (one notification of the store's subscribers), each
4166
+ * as {@link applyTaskUpdate} would. Resolves the ones taken, in order.
4167
+ */
4168
+ applyTaskUpdates: (messages: WsTaskUpdateMessage[]) => WsTaskUpdateMessage[];
4164
4169
  /** Set a document's live processing directly (an optimistic status, or an undo). */
4165
4170
  putTask: (task: LiveTask) => void;
4166
4171
  /** Drop a document's processing row, and ignore its late updates for a while. */
@@ -15227,19 +15232,25 @@ declare function subscribeDocumentReads(qc: QueryClient, onRows: (rows: Workspac
15227
15232
  * A workspace's documents in processing, live: what every site's file views show while uploads
15228
15233
  * and re-processing run.
15229
15234
  *
15230
- * - `applyTaskEvent` (the provider runs it on each taken `task_update`): an upload appears as a
15231
- * row the moment it is queued (a light placeholder, so the table and the gallery show it with
15232
- * its live progress), and a finished document replaces its row with the one read afresh.
15235
+ * - `applyTaskEvents` (the provider runs it on the `task_update`s it took, a few times a second):
15236
+ * an upload appears as a row the moment it is queued (a light placeholder, so the table and the
15237
+ * gallery show it with its live progress), and a finished document replaces its row with the one
15238
+ * read afresh. A burst is one write to each list and one read of the finished documents.
15233
15239
  * - `useWorkspaceProcessing(workspaceId)`: the workspace's processing rows and their counts
15234
15240
  * (a snapshot every half second, so a batch upload does not re-render on every event), kept
15235
15241
  * honest: stale or orphaned rows are dropped when the workspace opens, rows a document read says
15236
15242
  * finished are settled, and the in-flight ones are re-checked when the connection comes back.
15237
15243
  */
15238
15244
 
15239
- /** Apply one taken `task_update` to the documents list (`me`: who uploads, i.e. this user). */
15240
- declare function applyTaskEvent(queryClient: QueryClient, arbi: Arbi, message: WsTaskUpdateMessage & {
15245
+ type TaskEvent = WsTaskUpdateMessage & {
15241
15246
  folder?: string | null;
15242
- }, me: string | null | undefined): void;
15247
+ };
15248
+ /**
15249
+ * Apply taken `task_update`s to the documents lists (`me`: who uploads, i.e. this user): the
15250
+ * finished documents are re-read (together, see `queueDocumentReads`), the others not yet listed
15251
+ * join their list as placeholder rows, in one write per list.
15252
+ */
15253
+ declare function applyTaskEvents(queryClient: QueryClient, arbi: Arbi, messages: TaskEvent[], me: string | null | undefined): void;
15243
15254
  /** The workspace's processing rows (in the order of their document ids) and their counts. */
15244
15255
  interface WorkspaceProcessing {
15245
15256
  tasks: Record<string, LiveTask>;
@@ -15920,13 +15931,6 @@ declare function VideoCapture({ onSave, onDiscard, onError, isSaving }: VideoCap
15920
15931
  */
15921
15932
  declare function hasVideoTrack(blob: Blob): Promise<boolean>;
15922
15933
 
15923
- /**
15924
- * Upload chosen files to the open workspace, with progress. Files go in batches (one per folder
15925
- * they land in, at most 100 files each, four at a time); each file keeps the folder it sat in below
15926
- * where the upload started. With direct upload on in the user's settings, and the workspace key
15927
- * held here, files are encrypted here and sent straight to storage; otherwise through the server.
15928
- * The new documents join their list in their folder; the labels asked for fill their AI fields.
15929
- */
15930
15934
  interface UploadFilesInput {
15931
15935
  files: File[];
15932
15936
  /** Upload to this member workspace instead of the currently open workspace. */
@@ -15956,6 +15960,11 @@ interface UploadFilesResult {
15956
15960
  file_name: string;
15957
15961
  reason: string;
15958
15962
  }[];
15963
+ /**
15964
+ * The follow-up after the files were sent: the new rows re-read into their lists, the workspace
15965
+ * counts refreshed and the AI fields started. Never rejects.
15966
+ */
15967
+ settled: Promise<void>;
15959
15968
  }
15960
15969
  /** The folder an upload put `docId` in, while its row has not been read yet. */
15961
15970
  declare function uploadedDocumentFolder(workspaceId: string, docId: string): string | null | undefined;
@@ -16310,4 +16319,4 @@ declare function useRateSupportTicket(): _tanstack_react_query.UseMutationResult
16310
16319
  rating: SupportRating;
16311
16320
  }, unknown>;
16312
16321
 
16313
- export { AGENT_CONTROL_COMMANDS, AGGREGATE_FIELDS, ALLOWED_PORTAL_ORIGINS, ANALYTICS_CHART_VIEW, ARCHIVE_POLL_MS, ASSISTANT_MENTION_LABEL, AUDIO_MIME_PREFERENCE, AUTO_CHAT_MODEL, AUTO_SYNC_EVERY_MS, type AccessRequestPayload, type AccessRequestRecipient, type AccountClient, type AccountClientContextValue, type AccountHost, type AccountSession, type AccountSignOutOptions, ActiveCall, type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type ActivitySourceLabels, type AddWorkspaceMembersRequest, type AgentAccessMode, type AgentConfigSections, type AgentControlMaps, AgentDmStatus, type AgentQuestionRef, type AgentRunControlState, type AggregateOp, AiAnswer, type AiRunOptions, type AiTaskStatus, type AnalyticsChartRequest, AppNotification, AppleIcon, type ApplyCallEventOptions, ArbiBotHeadIcon, type ArbiChatActions, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatHost, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatState, type ArbiChatStore, type ArbiChatStoreOptions, type ArbiChatThread, type ArbiConversation, type ArbiConversationDocument, type ArbiConversationGeneration, type ArbiDmTab, type ArbiDocumentCommentTarget, type ArbiDocumentSessionActions, type ArbiDocumentSessionState, type ArbiDocumentSessionStore, type ArbiDocumentSessionStoreOptions, type ArbiDocumentViewerState, type ArbiDocumentsPersist, type ArbiDraftDocument, type ArbiDraftKind, type ArbiDraftStorage, type ArbiFeature, type ArbiFeatures, type ArbiGridLayoutState, ArbiHost, type ArbiHostConfig, ArbiHostConnection, ArbiHostProps, type ArbiKeyValueStorage, type ArbiLayoutActions, type ArbiLayoutState, type ArbiLayoutStore, type ArbiLayoutStoreOptions, type ArbiMessageTimer, type ArbiPanelMode, type ArbiPanelsState, type ArbiPassageCitationState, type ArbiPickedPassage, type ArbiQueryClient, type ArbiQueryClientOptions, type ArbiQueryPersistOptions, type ArbiSavedChat, type ArbiSavedDocuments, type ArbiSavedLayout, type ArbiSessionParts, type ArbiSessionPersist, type ArbiSessionState, type ArbiSessionStatus, type ArbiSessionStore, type ArbiSessionStoreOptions, type ArbiShellState, type ArbiSidebarState, type ArbiSignedInSession, type ArbiTabsState, type ArbiThreadComposer, type ArbiThreadTab, type ArbiThreadTabShow, type ArbiThreadTabView, type ArbiThreadTabsController, type ArbiThreadTabsState, type ArbiThreadView, type ArbiViewerTab, type ArbiViewingDocument, type ArbiViewingDocumentInput, type ArbiViewsState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWorkspaceState, type ArbiWorkspaceStatus, type ArbiWorkspaceStorage, type ArbiWorkspaceStore, type ArbiWorkspaceStoreOptions, type ArbiWsHandlers, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AskAgain, type AspectOption, type AssignDocTagsInput, type AssistantMode, AudIcon, type AudioPiece, type AvatarCrop, type AvatarFileProblem, BOOT_GATE_TIMEOUT_MS, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, BUILTIN_DATA_SOURCES, type BranchNavigation, type BranchPoint, type BrowserWorkspaceStorageOptions, type BuildArchiveInput, type BuiltArchive, CALL_MODERATION_TOPIC, CONVERSATION_SWITCH_MEASURE, type CalendarConnectorSupport, type CalendarNotificationMeta, type CalendarOfflineSupport, type CalendarPendingWrite, type CalendarSupport, type CalendarWriteOp, type CallInviteContact, type CallMutedNotice, type CallRoomEvents, type CallSlotMode, type CallsHost, type ChartSpec, type ChartType, type ChatArrival, ChatBubble, type ChatBubbleProps, ChatMemberKey, type ChatPost, ChatResponse, type ChatSummary, ChatThreadMessage, type Chunk, type ChunkActivation, type ChunkedRecorder, type ChunkedRecorderOptions, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, type ConfigUpdate, type ControllingAgent, type ConversationActionsInput, type ConversationEvent, ConversationList, type ConversationListProps, ConversationScope, type ConversationScopeProps, type ConversationsSourceLabels, type CreateProjectVars, type CreateSkillPackOptions, type CreateTagInput, type CreateWorkspaceVars, type CreatedProject, type CropArea, type CropOutput, type CropResult, type CurrentWorkspace, DATABASE_RELATION_PICK_LIMIT, DATABASE_ROWS_PAGE, DEFAULT_ACTIVITY_SOURCE_LABELS, DEFAULT_ASPECT_OPTIONS, DEFAULT_CONVERSATIONS_SOURCE_LABELS, DEFAULT_DATABASE_SOURCE_LABELS, DEFAULT_DOCUMENTS_SOURCE_LABELS, DEFAULT_DOCUMENT_VIEWER_STATE, DEFAULT_FACTS_SOURCE_LABELS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_PROJECTS_SOURCE_LABELS, DEFAULT_TAGS_SOURCE_LABELS, DEFAULT_USAGE_BREAKDOWN_SOURCE_LABELS, DEFAULT_USAGE_SOURCE_LABELS, DEFAULT_WORKFLOWS_SOURCE_LABELS, DEFAULT_WORKSPACES_SOURCE_LABELS, DISMISSED_TASK_TTL_MS, DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, DOCUMENT_VIEWER_PANEL, type DashboardSpec, type DashboardStore, type DashboardsHost, type DataSource, type DataSourceFieldsState, type DataSourceOption, type DataSourceParam, type DataSourceParams, type DataSourceRef, type DataSourceRegistry, type DatabaseAggregateRequest, type DatabaseAggregateResult, type DatabaseDashboardStoreOptions, type DatabaseSourceLabels, type Dataset, type DatasetField, type DatasetFieldType, type DatasetFilter, type DatasetOrder, type DatasetQuery, type DatasetRow, type DatasetSort, type DatasetState, type DatasetValue, DateSeparator, type DateSeparatorProps, type DebouncedWriter, type DebouncedWriterOptions, type DefineSkillPackOptions, type DefinedSkillPack, type DeleteAccountBlocker, type DeleteAccountFlow, type DeletedDocument, type DeletedDocumentsPage, type DescribeCalendarNotificationOptions, type DescribeServerNotificationOptions, DictateContextValue, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmUser, DocIcon, type DocumentHostActions, type DocumentPerson, DocumentReview, type DocumentReviewProps, type DocumentRowChange, type DocumentStartItem, type DocumentsSourceLabels, type DocumentsSupport, type DraftKeyValueStore, DraftTitleControls, type DraftTitleControlsProps, EMPTY_CHAT_STATE, EMPTY_DOCUMENT_STATE, EMPTY_GROUP_LABEL, EMPTY_SESSION_STATE, EXPORT_SAMPLE_RATE, type EmailChange, type EmailPreferences, EmlIcon, type EnableDriveSyncVars, type EnableMailboxSyncVars, type EntitledFeature, EntityIconComponent, EntitySize, EntityVocabulary, type ExportDownloadRequest, type ExportFileKind, type ExtractedZip, FACTS_SEARCH_VIEW, FILE_TYPE_COLORS, FINISHED_DOCUMENT_STATUSES, FIRST_TOKEN_MEASURE, type FactListFilter, type FactSearchHit, type FactsSearch, type FactsSearchState, type FactsSourceLabels, type FeatureEntitlements, type FeatureRefusal, type FeatureSource, type FeatureSwitch, type FilterOp, FireworksIcon, type FollowSaveCallbacks, GeminiIcon, type GenerateDocTagsInput, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, type GuidedStep, HostConfigRecord, HtmlIcon, IN_FLIGHT_DOCUMENT_STATUSES, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, IncomingCall, InlineMicButton, type InlineMicButtonProps, type InstallSkillPackVariables, JoinChoices, LIVE_UPDATE_TYPES, LinkedInIcon, type LiveTask, type LocalDraft, type LocalFeatureStore, type LocalFeatureStoreOptions, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MAX_DASHBOARD_SPEC_CHARS, MAX_SERIES, MAX_THREAD_TABS, MIN_NARRATION_DWELL_MS, MIN_QUEUED_MESSAGE_VISIBILITY_MS, MODEL_GROUP_LABELS, MUTED_DEDUPE_MS, type MailAccount, type MailAddress, type MailAttachment, type MailChange, type MailClient, type MailClientContextValue, type MailCompose, type MailConversation, type MailConversationPage, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailDraftEditorRequest, type MailDraftEditorSession, type MailFetch, type MailFileRequest, type MailFiled, type MailFilingRule, type MailFilingState, type MailFolder, type MailHost, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MailProject, type MailThread, MeetingChatRef, MeetingChatTarget, MentionCandidate, type MessageArtifact, MessageArtifactCard, MessageMentionRef, type MessageTimerResult, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type ModeratedTrack, type MountDiditOptions, type NameEditor, type NativeMailFiling, type NotificationPreferencesModel, type NotificationTarget, type NotificationTypeMeta, NotifyVariant, OUTBOX_FOLDER, type OfflineDocumentRecord, type OfflineMailReadsOptions, type OfflineMailRuntimeOptions, type OfflineMailScope, type OfflineMailSettings, type OfflineMailStatus, OpenAIIcon, type OpenedRecording, type OptimisticDocumentEdit, type OrderResolver, type OutboxItem, PENDING_SYNC_PREDICATE, PLAYBACK_LOOKAHEAD_MS, POLL_EVERY_MS, PROJECT_CREATION_DENIED_REASON, type PanelDatasetState, type PanelSpec, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PassageResolvers, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, type PendingMailChange, type PendingSyncItem, type PeopleDirectory, type Person, PhotoCapture, type PhotoCaptureProps, PresIcon, type ProcessingTask, type ProfileView, type ProjectCreationRefusal, type ProjectsSourceLabels, type ProjectsSourceOptions, type QueuedCalendarWrite, type QueuedMessage, type QueuedMessages, type QuoteResolver, RECORDING_SEGMENTER, REMOTE_CONTROL_VIEW, RUN_WINDOW_MS, type RawPending, type ReconnectOutcome, type RecordedChunk, type RecordingWindow, type RefusedUploadFile, type RelatedDocs, type RelatedDocsMap, type RelevancePatch, type RemoteControlMessage, type RemoteControlRequest, type RemoteControlSession, type RemoteControlState, type RemoveDocTagsInput, type RenderMarkdown, type RequestAccessOptions, type RowsSourceDefinition, type RowsState, SEGMENT_FRAME_MS, SEGMENT_PRE_ROLL_MS, SHORT_PIECE_MERGE_GAP_MS, SIGNATURE_NOTIFICATION_TYPES, SIMILARITY_THRESHOLD, SLOW_AFTER_MS, STILL_WORKING, type SaveAgentConfigVars, type SavedDashboard, type SealedDraftStorageOptions, type SearchMode, SearchSession, SearchStatus, SegmenterConfig, type SemanticSearch, type SemanticSearchOptions, type SendMessageOptions, type SequencedRow, type SequencedTask, type ServerNotificationBellOptions, type ServerNotificationDescription, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, type SignatureNotificationType, type SkillPack, type SkillPackEntry, type SkillPackField, type SkillPackSkill, type SkillPackSkillDefinition, type StartTaskQuery, StorageActionError, type StorageActions, type StorageDeploymentUsage, type StorageItem, type StorageItemKind, type StorageItemState, type StorageItemsQuery, type StorageKindUsage, type StoragePersistOptions, type StorageProjectUsage, type StorageScope, type StorageSnapshot, type StreamHandlerContext, type StreamHandlerParams, type StreamHandlers, type StreamState, type SwitchWorkspaceTarget, TRANSFER_POLL_MS, type TableView, type TableViewTable, type TagsSourceLabels, TaskThreadPendingError, type ThreadAccessors, ThreadBinding, type ThreadItem, type TimeBucket, type TimelinePart, type ToolResponses, type TrackCutter, type TrackPiece, type TranscriptExportLine, type TranscriptLineRef, type TranscriptSegmentMarker, type TransferConflictPolicy, type TransferKind, type TransferMode, type TransferPlan, type TransferScope, type TransferStatus, type TurnTarget, type TurnTools, TxtIcon, TypingIndicator, UPLOAD_ACCEPT, UPLOAD_MAX_FILE_SIZE, type UiStateStorage, type UnarchiveEstimate, type UpdateDocTagInput, type UpdateDocumentsInput, type UpdateProfileVars, type UploadDocumentsInput, type UploadFilesInput, type UploadFilesProgress, type UploadFilesResult, type UploadFromUrlsInput, type UploadFromUrlsResult, type UploadRefusal, type UploadUrlsInput, type UsageBreakdownBy, type UsageBreakdownKey, type UsageBreakdownSourceLabels, type UsageSourceLabels, type UsageTotals, type UseAskAgainOptions, type UseAvatarCropOptions, type UseCameraStreamResult, type UseConversationOptions, type UseDeleteAccountFlowOptions, type UseDownloadDocumentsOptions, type UseEmailChangeOptions, type UseFactsSearchOptions, type UseIdentityVerificationFlowOptions, type UseMessageTimerOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseSwitchWorkspaceResult, type UseVideoRecorderResult, type UserResponse, type UserSettingFlag, type UserSettingsPatch, VIDEO_MIME_PREFERENCE, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, WORKSPACE_LAST_OPENED_KEY, WORKSPACE_STORAGE_KEY, WORK_NOTIFICATION_LABELS, WORK_OFFLINE_VIEW, type WorkflowsSourceLabels, type WorkspaceArchive, type WorkspaceArchiveState, type WorkspaceDocument, type WorkspaceExport, type WorkspaceMember, type WorkspaceNotificationLevel, type WorkspaceProcessing, type WorkspaceRole, type WorkspaceSwitchContext, type WorkspaceUpdate, type WorkspacesSourceLabels, XlsIcon, type ZipExtractor, __resetPendingFinalCommitsForTests, __resetStreamingTokenBufferForTests, acceptRing, accountPath, addAssistantMessageToCache, addConversationToList, addUserMessageToCache, adjustTagCounts, adoptNewChatDocument, agentControl, aggregateDataset, aliasTakenMessage, allConversationThreads, annotateThread, announceMailDraftReplaced, appendTokenToMessage, applyCallEvent, applyConversationEvent, applyFinalContextToMessage, applyLiveUpdate, applyNotificationRow, applyOptimisticDocumentEdit, applyOutputItemToMessage, applyTaskEvent, arbiAccountClient, arbiMailClient, archiveName, archivedWorkspaceMessage, assistantLabels, bindThreadDocument, boundDocumentOf, browserWorkspaceStorage, bucketOf, bucketRange, buildDocumentMetadataRows, buildMentionCandidates, buildPendingFirstTurn, buildPendingSyncItem, buildWorkspaceArchive, cacheThreadBinding, cachedAssistantMode, cachedMentionCandidates, cachedQuotaUsedUp, calendarNotificationMeta, calendarOfflineSupport, callLink, callNotificationMeta, captureFrameAsBlob, chatTranscriptRef, claimOfflineQueue, classifyMediaError, clearLoadingState, clearSealedDrafts, clearUserInputRequest, clockTime, closePanelIn, commitFinalMessage, completeQueuedUserMessageByContent, composeArbiSessionStore, compositeFiles, compositeTrack, computeOnline, confirmLosingOfflineMail, connectOAuthCalendarAccount, connectorErrorStatus, connectorReturnTo, conversationKey, conversationsPath, createActivitySource, createArbiChatStore, createArbiDocumentSessionStore, createArbiLayoutStore, createArbiQueryClient, createArbiSessionStore, createArbiWorkspaceStore, createBrowserStateStorage, createChunkedRecorder, createConversationsSource, createDataSourceRegistry, createDatabaseSource, createDebouncedWriter, createDocumentsSource, createFactsSource, createLocalFeatureStore, createMailClient, createMemoryDashboardStore, createMutedNotifier, createProjectsSource, createSealedDraftStorage, createSkillPack, createStoragePersist, createStreamHandlers, createTagsSource, createTrackCutter, createUiStateStorage, createUsageBreakdownSource, createUsageSource, createWorkflowsSource, createWorkspaceSwitch, createWorkspacesSource, cropImage, cutAtPauses, dayKey, declineRing, decodeMono16k, defaultLayoutState, defaultMailAlias, defineRowsSource, defineSkillPack, deleteLocalDraft, deleteOutboxItem, deploymentUserMeta, describeActivity, describeCalendarNotification, describeServerNotification, discardStreamingTokensForMessage, disconnectAttachedRun, dmTabId, documentActivityMeta, documentActivityPhrase, documentDisplayName, documentMailAttachment, docxMentionMeta, downloadRecoveryFile, dropTagFromCachedDocuments, encodeWav, enqueueOutbox, ensureAssistantMessageLoading, entitlementRefusal, extensionFor, extractZipFile, fallbackFileName, fetchPart, fileAttachment, fileSafe, filesFromDrop, fillTimeGaps, filterRows, findConversation, finishEntityExtraction, floatToWav, flushDocumentForTurn, flushOnPageExit, flushStreamingTokens, forgetDocuments, forgetUploadedDocumentFolder, formatConfigValidationError, formatElapsed, formatIdentityPrice, formatTranscriptMarkdown, getCachedDocuments, getInterjectionText, getNotificationTypeMeta, getOfflineDocument, getOrphanedLastMessage, getRelatedLabels, getRelatedTotal, getRunStartedAt, getThreadsQueryKey, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, groupMailConversations, hasPendingFinalCommit, hasPendingMailChange, hasRecordingTranscript, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars, invalidateCall, invalidateConversationActivity, invalidateConversationDetails, invalidateConversationLists, invalidateTagData, invalidateTagTables, isActivityKey, isAliasTakenError, isArchiveMoving, isCommentToPeople, isConversationListKey, isConversationShared, isDeploymentAdmin, isDeploymentUserNotification, isDocumentsLoading, isFullConfig, isMessageRunning, isNetworkFailure, isNotificationRow, isOrphanedUserMessage, isPanelOpen, isQueuedCalendarWrite, isRecordingSegmentId, isReplayableArbiMutation, isRowNewer, isSignatureNotificationType, isStaleTaskUpdate, isTableViewOf, isTransferFinished, isTransferResumable, isUsageMetered, isWorkingOffline, isWorkspaceArchivedError, isWorkspaceGuestOf, isWorkspaceNotificationType, isZipFile, joinFromPreJoin, layoutActionsOf, loadOfflineDocument, loadAttachment as loadOfflineMailAttachment, mailConversationKey, mailDraftIdFromContent, mailJson, mailThreadRoot, markMessageAsFailed, markNarrationSettled, mergeHostConfig, migrateLegacyThreadDocuments, mountDiditVerification, mutedNoticeFromEvent, mutedNoticeFromPacket, mutedNoticeText, nativeThreadKeys, nextAliasSuggestion, nextViewingDocument, notificationUserName, offlineMailReads, onCallEvent, openAccessRequest, openCall, openPanelIn, openRecording, panelPlace, parseActivityContent, parseDashboardSpec, parseDeleteAccountBlockers, parseSavedChat, parseSavedDocuments, parseSavedLayout, partKey, partsDue, patchCachedDocument, patchConversation, patchConversationList, patchDocuments, patchWorkspaceTags, pendingChatModelSave, peopleDirectory, personOfUser, pickRecentWorkspaces, pickRecorderMimeType, playheadAt, postRecordingDocsToThread, postTranscriptToThread, prepareUploadFiles, queryOfChart, queueMailChange, queuedMessages, readLocalFeature, readWorkspaceLastOpened, recordingFiles, recordingWindowsOf, recordsOf, redlineStats, refreshDocuments, refuseChatWhenOffline, registerArbiMutationDefaults, registerAttachedRun, registerDocumentTurnFlush, remoteControlActions, remoteControlStateOf, removeConversationFromLists, removeSettledNarration, requestPersistentStorage, resetCalendarAccountSyncState, resetMessageContent, resolveActiveWorkspace, resolveConfigModel, resolveDocumentStatus, resolveReplyTarget, restoreLayout, restoreSavedDocuments, retryOutboxItem, rollbackOptimisticDocumentEdit, safePortalUrl, saveLocalDraft, saveRecordingFilesToThread, savedChatOf, savedDocumentsOf, savedLayoutOf, schedulePart, selectDraft, selectIsGenerating, selectViewingDocumentId, sendMailFile, serializeDashboardSpec, serverCallsExperimental, serverNotificationBellEntry, setCachedDocument, setMessageContent, setUserInputRequest, setWorkOfflineIn, settledByRows, signatureNotificationPhrase, signatureRequestMeta, skillPackPrompt, sortTranscriptMessages, sortedParts, speakerTracks, speakerWav, splitIntoFiles, standalone, startChatCall, startContactsCall, startDmCall, startEntityExtraction, startThreadCall, startsMediaFile, stopDocumentsLoading, stripSpeakerPrefix, subscribeDocumentReads, subscribeDocumentRows, supersedeLiveTranscript, supersededTranscriptLines, supportsHouseTemplates, textToArtifact, threadBinding, threadEndingAtContains, threadPath, threadTabId, threadTranscriptLines, threadTranscriptRef, timelineDurationMs, timelineOf, titleFromQuestion, toChatCitations, toMailConversation, toNotificationPreferences, toProfileView, toRedlineMarkdown, toRemoteControlRequest, toShellWorkspace, transcribeRecording, transcriptSegmentOf, updateMessageWithMetadata, updateUserMessageInCache, updateUserMessageStateInCache, uploadFolderOf, uploadedDocumentFolder, upsertDocuments, useAccountClient, useActOnStep, useActiveConfigId, useActivity, useAddChatMembers, useAddDatabaseRows, useAddHolidayCalendar, useAddProjectAddonBlock, useAddWorkspaceMembers, useAddonQuote, useAgentChats, useAgentConfig, useAgentDmStatus, useAgentModels, useAgentRunControl, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useAnswerAgentQuestion, useApplyChatModel, useArbi, useArbiHost, useArbiSession, useArbiSessionState, useArbiSessionStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArchiveProgressPolling, useArchiveWorkspace, useAskAgain, useAssignDocTags, useAssistantArrivals, useAssistantBrief, useAssistantQuery, useAssistantStatus, useAuthorizeLimits, useAutoSendDraft, useAvailableModels, useAvatarCrop, useBookingPages, useBootTimeout, useBoxRole, useBranchNavigation, useBuiltinCommands, useCalDavProfiles, useCalendarAccounts, useCalendarEvent, useCalendarEventByUid, useCalendarEvents, useCalendarInvitations, useCalendarOfflineRuntime, useCalendarOutbox, useCalendarOverlays, useCalendarSettings, useCalendarShares, useCalendarSupport, useCalendars, useCall, useCallInviteLinks, useCallRecording, useCallRecordings, useCallTranscriptionAvailable, useCallsConfig, useCallsEnabled, useCameraStream, useCanCreateProjects, useCanCreateWorkspaces, useCanEditShared, useCanHostCalls, useCancelDriveSync, useCancelMailboxSync, useCancelManyPendingSync, useCancelProjectSubscription, useCancelWorkspaceTransfer, useChangeProjectPlan, useChargeWatch, useChatArrivals, useChatPost, useChatSummaries, useChatThread, useChatUnreadTotal, useChats, useClaimNativeAlias, useClaimSecureMail, useCloseAgentSession, useConfig, useConfigSchema, useConfigs, useConfirmEmailChange, useConfirmProjectSpendLimits, useConnectCalDavAccount, useConnectMailAccount, useConnectOAuthAccount, useConnectRunStream, useConnectedMailFiling, useConnectorAutoSync, useConnectorCatalog, useConnectorVendorVisibility, useContacts, useConversation, useConversationActions, useConversationActivity, useConversationData, useConversationDocuments, useConversationIsShared, useConversationItems, useConversationPendingAuth, useConversationSearch, useConversationSettings, useConversationThreads, useConversationTurn, useConversationWorkspace, useConversations, useCreateAgent, useCreateCalendar, useCreateContact, useCreateDatabase, useCreateEvent, useCreateFact, useCreateFacts, useCreateGroupChat, useCreateProject, useCreateProjectCheckout, useCreateRoom, useCreateTag, useCreateWork, useCreateWorkflow, useCreateWorkspace, useCurrentSessionId, useCurrentUser, useCurrentWorkspace, useDashboardStore, useDataSources, useDatabase, useDatabaseAggregate, useDatabaseDashboardStore, useDatabaseRows, useDatabases, useDecideCounter, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteBookingPage, useDeleteCalendar, useDeleteChatMessage, useDeleteConfig, useDeleteContact, useDeleteConversation, useDeleteDashboard, useDeleteDatabase, useDeleteDatabaseRows, useDeleteDocuments, useDeleteEvent, useDeleteFact, useDeleteMessage, useDeleteNotifications, useDeleteProject, useDeleteSkill, useDeleteTag, useDeleteWorkflow, useDeleteWorkspaces, useDeploymentDomain, useDirectModelUsage, useDisconnectCalendarAccount, useDisconnectConnector, useDisconnectMailAccount, useDisconnectSlack, useDismissedTips, useDocument, useDocumentAutoAdd, useDocumentHostActions, useDocumentPendingSync, useDocumentThumbnails, useDocumentVersionList, useDocuments, useDocumentsLoading, useDocumentsSupport, useDownloadDocuments, useDriveFolderChildren, useDriveFolderDocCount, useDriveFolders, useDriveSyncEstimate, useDriveSyncProgress, useEmailChange, useEnableDriveSync, useEnableMailboxSync, useEntitlements, useEntityExtractionDocIds, useExportDatabase, useExtractEntities, useFacts, useFactsSearch, useFeature, useFeatureCheck, useFeatureSwitch, useFetchCalendarEvent, useFileWaitingNativeMail, useFinaliseTranslation, useFindTime, useFlushOutbox, useFollowThread, useFreeBusy, useGenerateAgentAvatar, useGenerateDocTags, useGrantAgentAccess, useHealth, useHolidayCountries, useHouseTemplateCandidates, useIdentityVerification, useIdentityVerificationFlow, useImportCalendar, useImportContacts, useImportDatabase, useImportDatabaseRows, useInstallSkillPack, useInvalidateAfterTransfer, useInvalidateAssistant, useInvalidateEntitlements, useInvalidateProjects, useInvalidateStorage, useInvalidateTagData, useInvalidateWorkflows, useInviteContacts, useIsCreatingTag, useIsEntitled, useIsSlow, useIsWorkspaceOwner, useKeepDocumentsOffline, useLinkContact, useLinkMentions, useLocalDrafts, useMailAccounts, useMailAttachmentText, useMailCache, useMailClient, useMailConversations, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFiling, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailThread, useMailUnlock, useMailWorkspacePrimer, useMailboxFolders, useMailboxSyncProgress, useMarkArrivalWrong, useMarkChatRead, useMarkDocumentShared, useMarkMessageDraftSent, useMarkNotificationsRead, useMcpTools, useMeetingReadOnly, useMessageDetails, useMessageTimer, useModelConnections, useMoveEvent, useMoveWorkspaceToProject, useMyConnectors, useNameEditor, useNativeMailFiling, useNativeThreadKeys, useNotificationPreferences, useNotifications, useOfflineDocumentIds, useOfflineMailActive, useOfflineMailRuntime, useOfflineMailSettings, useOfflineMailStatus, useOpenCallMeetingChat, useOpenSelectedWorkspace, useOpenViewerDocumentId, useOutbox, usePanelDataset, useParsedDocument, usePassageQuotes, usePasswordChange, usePasswordChangeForm, usePendingMailChanges, usePendingSyncCounts, usePendingSyncItems, usePeople, usePeopleSearch, usePlanQuote, usePlanWork, usePlanWorkspaceTransfer, usePreviewProjectPlanChange, useProcessingTask, useProcessingTasks, useProducts, useProfile, useProjectBillingCache, useProjectBillingPortal, useProjectConversationUsage, useProjectCreationDenial, useProjectInvoices, useProjectUsage, useProjects, usePublishCalendar, useRateSupportTicket, useReadMailMessage, useReconnect, useRecordingActions, useRecordingWindows, useReferralSummary, useRefreshCalendar, useRefreshConnectorsOnRunEnd, useRefreshDocuments, useRefreshProject, useRelatedDocuments, useRemoteControl, useRemoveChatMember, useRemoveDocTags, useRemoveDocumentsOffline, useRemoveModelConnection, useRemoveWorkspaceMembers, useRenameChat, useRenameFolder, useRequestEmailChange, useRequestWorkspaceAccess, useRespondToEvent, useResumeCalendarAccountConnect, useResumeWorkspaceTransfer, useRevokeAgentAccess, useRevokeCallInviteLink, useRooms, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveBookingPage, useSaveCalendarSettings, useSaveConfig, useSaveConfigField, useSaveDashboard, useSaveMailDraft, useSaveModelConnection, useSaveSkill, useSaveToThread, useSavedDashboards, useSearchContacts, useSearchDatabaseRows, useSearchFacts, useSemanticSearch, useSendMail, useServerCallsEnabled, useServerCallsExperimental, useSessionPageTab, useSessionView, useSessions, useSetDeploymentHouseTemplate, useSetNativeMailFiling, useSetSkillVisibility, useSetTagValues, useSetWorkspaceHouseTemplate, useSetWorkspaceMemberRoles, useShareCalendar, useShellWorkspaces, useSignOut, useSignedInSession, useSimilarDocuments, useSkillSource, useSkills, useSlackConnection, useStartAgentSession, useStartCalendarAccountOAuth, useStartTaskQuery, useStartWorkspaceTransfer, useStopMailFilingRule, useStorageActions, useStorageItemNames, useStorageItems, useStorageProjects, useStorageSnapshots, useStreamHandlers, useSubscribeCalendar, useSupportTicket, useSupportTickets, useSwitchWorkspace, useSyncAccountsOnOpen, useSyncCalendarAccount, useSyncOfflineMailbox, useTagKindSchema, useTags, useTerminateSession, useThinkingContent, useThreadDocument, useThumbnails, useTransientView, useTriggerDriveSync, useTriggerMailboxSync, useUnarchiveWorkspace, useUnlockModelConnections, useUnreadByPeer, useUnshareCalendar, useUpdateAssistantBrief, useUpdateCalendar, useUpdateCalendarAccount, useUpdateContact, useUpdateConversation, useUpdateDatabase, useUpdateDatabaseRow, useUpdateDocTag, useUpdateDocuments, useUpdateEvent, useUpdateFact, useUpdateProfile, useUpdateProjectAddonSettings, useUpdateProjectFields, useUpdateProjectNextPeriodAddons, useUpdateTag, useUpdateTagKindSchema, useUpdateUserSettings, useUpdateWorkflow, useUpdateWorkspace, useUploadDocuments, useUploadFiles, useUploadFromUrls, useUploadSkillFiles, useUploadUrls, useUserDashboardStore, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkItems, useWorkOffline, useWorkflowRuns, useWorkflows, useWorkspaceActivity, useWorkspaceArchive, useWorkspaceDocs, useWorkspaceExportDownload, useWorkspaceNotificationLevel, useWorkspaceProcessing, useWorkspaceRole, useWorkspaceTransfer, useWorkspaceTransfers, useWorkspaceTrash, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, viewsOfTable, waitForResponseId, wipeCalendarOffline, wipeOfflineDocuments, wipeOfflineMail, withRelativePath, workflowRunTitle, workflowStepOf, workspaceHouseTemplateId, writeSamples };
16322
+ export { AGENT_CONTROL_COMMANDS, AGGREGATE_FIELDS, ALLOWED_PORTAL_ORIGINS, ANALYTICS_CHART_VIEW, ARCHIVE_POLL_MS, ASSISTANT_MENTION_LABEL, AUDIO_MIME_PREFERENCE, AUTO_CHAT_MODEL, AUTO_SYNC_EVERY_MS, type AccessRequestPayload, type AccessRequestRecipient, type AccountClient, type AccountClientContextValue, type AccountHost, type AccountSession, type AccountSignOutOptions, ActiveCall, type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type ActivitySourceLabels, type AddWorkspaceMembersRequest, type AgentAccessMode, type AgentConfigSections, type AgentControlMaps, AgentDmStatus, type AgentQuestionRef, type AgentRunControlState, type AggregateOp, AiAnswer, type AiRunOptions, type AiTaskStatus, type AnalyticsChartRequest, AppNotification, AppleIcon, type ApplyCallEventOptions, ArbiBotHeadIcon, type ArbiChatActions, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatHost, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatState, type ArbiChatStore, type ArbiChatStoreOptions, type ArbiChatThread, type ArbiConversation, type ArbiConversationDocument, type ArbiConversationGeneration, type ArbiDmTab, type ArbiDocumentCommentTarget, type ArbiDocumentSessionActions, type ArbiDocumentSessionState, type ArbiDocumentSessionStore, type ArbiDocumentSessionStoreOptions, type ArbiDocumentViewerState, type ArbiDocumentsPersist, type ArbiDraftDocument, type ArbiDraftKind, type ArbiDraftStorage, type ArbiFeature, type ArbiFeatures, type ArbiGridLayoutState, ArbiHost, type ArbiHostConfig, ArbiHostConnection, ArbiHostProps, type ArbiKeyValueStorage, type ArbiLayoutActions, type ArbiLayoutState, type ArbiLayoutStore, type ArbiLayoutStoreOptions, type ArbiMessageTimer, type ArbiPanelMode, type ArbiPanelsState, type ArbiPassageCitationState, type ArbiPickedPassage, type ArbiQueryClient, type ArbiQueryClientOptions, type ArbiQueryPersistOptions, type ArbiSavedChat, type ArbiSavedDocuments, type ArbiSavedLayout, type ArbiSessionParts, type ArbiSessionPersist, type ArbiSessionState, type ArbiSessionStatus, type ArbiSessionStore, type ArbiSessionStoreOptions, type ArbiShellState, type ArbiSidebarState, type ArbiSignedInSession, type ArbiTabsState, type ArbiThreadComposer, type ArbiThreadTab, type ArbiThreadTabShow, type ArbiThreadTabView, type ArbiThreadTabsController, type ArbiThreadTabsState, type ArbiThreadView, type ArbiViewerTab, type ArbiViewingDocument, type ArbiViewingDocumentInput, type ArbiViewsState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWorkspaceState, type ArbiWorkspaceStatus, type ArbiWorkspaceStorage, type ArbiWorkspaceStore, type ArbiWorkspaceStoreOptions, type ArbiWsHandlers, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AskAgain, type AspectOption, type AssignDocTagsInput, type AssistantMode, AudIcon, type AudioPiece, type AvatarCrop, type AvatarFileProblem, BOOT_GATE_TIMEOUT_MS, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, BUILTIN_DATA_SOURCES, type BranchNavigation, type BranchPoint, type BrowserWorkspaceStorageOptions, type BuildArchiveInput, type BuiltArchive, CALL_MODERATION_TOPIC, CONVERSATION_SWITCH_MEASURE, type CalendarConnectorSupport, type CalendarNotificationMeta, type CalendarOfflineSupport, type CalendarPendingWrite, type CalendarSupport, type CalendarWriteOp, type CallInviteContact, type CallMutedNotice, type CallRoomEvents, type CallSlotMode, type CallsHost, type ChartSpec, type ChartType, type ChatArrival, ChatBubble, type ChatBubbleProps, ChatMemberKey, type ChatPost, ChatResponse, type ChatSummary, ChatThreadMessage, type Chunk, type ChunkActivation, type ChunkedRecorder, type ChunkedRecorderOptions, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, type ConfigUpdate, type ControllingAgent, type ConversationActionsInput, type ConversationEvent, ConversationList, type ConversationListProps, ConversationScope, type ConversationScopeProps, type ConversationsSourceLabels, type CreateProjectVars, type CreateSkillPackOptions, type CreateTagInput, type CreateWorkspaceVars, type CreatedProject, type CropArea, type CropOutput, type CropResult, type CurrentWorkspace, DATABASE_RELATION_PICK_LIMIT, DATABASE_ROWS_PAGE, DEFAULT_ACTIVITY_SOURCE_LABELS, DEFAULT_ASPECT_OPTIONS, DEFAULT_CONVERSATIONS_SOURCE_LABELS, DEFAULT_DATABASE_SOURCE_LABELS, DEFAULT_DOCUMENTS_SOURCE_LABELS, DEFAULT_DOCUMENT_VIEWER_STATE, DEFAULT_FACTS_SOURCE_LABELS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_PROJECTS_SOURCE_LABELS, DEFAULT_TAGS_SOURCE_LABELS, DEFAULT_USAGE_BREAKDOWN_SOURCE_LABELS, DEFAULT_USAGE_SOURCE_LABELS, DEFAULT_WORKFLOWS_SOURCE_LABELS, DEFAULT_WORKSPACES_SOURCE_LABELS, DISMISSED_TASK_TTL_MS, DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, DOCUMENT_VIEWER_PANEL, type DashboardSpec, type DashboardStore, type DashboardsHost, type DataSource, type DataSourceFieldsState, type DataSourceOption, type DataSourceParam, type DataSourceParams, type DataSourceRef, type DataSourceRegistry, type DatabaseAggregateRequest, type DatabaseAggregateResult, type DatabaseDashboardStoreOptions, type DatabaseSourceLabels, type Dataset, type DatasetField, type DatasetFieldType, type DatasetFilter, type DatasetOrder, type DatasetQuery, type DatasetRow, type DatasetSort, type DatasetState, type DatasetValue, DateSeparator, type DateSeparatorProps, type DebouncedWriter, type DebouncedWriterOptions, type DefineSkillPackOptions, type DefinedSkillPack, type DeleteAccountBlocker, type DeleteAccountFlow, type DeletedDocument, type DeletedDocumentsPage, type DescribeCalendarNotificationOptions, type DescribeServerNotificationOptions, DictateContextValue, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmUser, DocIcon, type DocumentHostActions, type DocumentPerson, DocumentReview, type DocumentReviewProps, type DocumentRowChange, type DocumentStartItem, type DocumentsSourceLabels, type DocumentsSupport, type DraftKeyValueStore, DraftTitleControls, type DraftTitleControlsProps, EMPTY_CHAT_STATE, EMPTY_DOCUMENT_STATE, EMPTY_GROUP_LABEL, EMPTY_SESSION_STATE, EXPORT_SAMPLE_RATE, type EmailChange, type EmailPreferences, EmlIcon, type EnableDriveSyncVars, type EnableMailboxSyncVars, type EntitledFeature, EntityIconComponent, EntitySize, EntityVocabulary, type ExportDownloadRequest, type ExportFileKind, type ExtractedZip, FACTS_SEARCH_VIEW, FILE_TYPE_COLORS, FINISHED_DOCUMENT_STATUSES, FIRST_TOKEN_MEASURE, type FactListFilter, type FactSearchHit, type FactsSearch, type FactsSearchState, type FactsSourceLabels, type FeatureEntitlements, type FeatureRefusal, type FeatureSource, type FeatureSwitch, type FilterOp, FireworksIcon, type FollowSaveCallbacks, GeminiIcon, type GenerateDocTagsInput, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, type GuidedStep, HostConfigRecord, HtmlIcon, IN_FLIGHT_DOCUMENT_STATUSES, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, IncomingCall, InlineMicButton, type InlineMicButtonProps, type InstallSkillPackVariables, JoinChoices, LIVE_UPDATE_TYPES, LinkedInIcon, type LiveTask, type LocalDraft, type LocalFeatureStore, type LocalFeatureStoreOptions, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MAX_DASHBOARD_SPEC_CHARS, MAX_SERIES, MAX_THREAD_TABS, MIN_NARRATION_DWELL_MS, MIN_QUEUED_MESSAGE_VISIBILITY_MS, MODEL_GROUP_LABELS, MUTED_DEDUPE_MS, type MailAccount, type MailAddress, type MailAttachment, type MailChange, type MailClient, type MailClientContextValue, type MailCompose, type MailConversation, type MailConversationPage, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailDraftEditorRequest, type MailDraftEditorSession, type MailFetch, type MailFileRequest, type MailFiled, type MailFilingRule, type MailFilingState, type MailFolder, type MailHost, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MailProject, type MailThread, MeetingChatRef, MeetingChatTarget, MentionCandidate, type MessageArtifact, MessageArtifactCard, MessageMentionRef, type MessageTimerResult, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type ModeratedTrack, type MountDiditOptions, type NameEditor, type NativeMailFiling, type NotificationPreferencesModel, type NotificationTarget, type NotificationTypeMeta, NotifyVariant, OUTBOX_FOLDER, type OfflineDocumentRecord, type OfflineMailReadsOptions, type OfflineMailRuntimeOptions, type OfflineMailScope, type OfflineMailSettings, type OfflineMailStatus, OpenAIIcon, type OpenedRecording, type OptimisticDocumentEdit, type OrderResolver, type OutboxItem, PENDING_SYNC_PREDICATE, PLAYBACK_LOOKAHEAD_MS, POLL_EVERY_MS, PROJECT_CREATION_DENIED_REASON, type PanelDatasetState, type PanelSpec, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PassageResolvers, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, type PendingMailChange, type PendingSyncItem, type PeopleDirectory, type Person, PhotoCapture, type PhotoCaptureProps, PresIcon, type ProcessingTask, type ProfileView, type ProjectCreationRefusal, type ProjectsSourceLabels, type ProjectsSourceOptions, type QueuedCalendarWrite, type QueuedMessage, type QueuedMessages, type QuoteResolver, RECORDING_SEGMENTER, REMOTE_CONTROL_VIEW, RUN_WINDOW_MS, type RawPending, type ReconnectOutcome, type RecordedChunk, type RecordingWindow, type RefusedUploadFile, type RelatedDocs, type RelatedDocsMap, type RelevancePatch, type RemoteControlMessage, type RemoteControlRequest, type RemoteControlSession, type RemoteControlState, type RemoveDocTagsInput, type RenderMarkdown, type RequestAccessOptions, type RowsSourceDefinition, type RowsState, SEGMENT_FRAME_MS, SEGMENT_PRE_ROLL_MS, SHORT_PIECE_MERGE_GAP_MS, SIGNATURE_NOTIFICATION_TYPES, SIMILARITY_THRESHOLD, SLOW_AFTER_MS, STILL_WORKING, type SaveAgentConfigVars, type SavedDashboard, type SealedDraftStorageOptions, type SearchMode, SearchSession, SearchStatus, SegmenterConfig, type SemanticSearch, type SemanticSearchOptions, type SendMessageOptions, type SequencedRow, type SequencedTask, type ServerNotificationBellOptions, type ServerNotificationDescription, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, type SignatureNotificationType, type SkillPack, type SkillPackEntry, type SkillPackField, type SkillPackSkill, type SkillPackSkillDefinition, type StartTaskQuery, StorageActionError, type StorageActions, type StorageDeploymentUsage, type StorageItem, type StorageItemKind, type StorageItemState, type StorageItemsQuery, type StorageKindUsage, type StoragePersistOptions, type StorageProjectUsage, type StorageScope, type StorageSnapshot, type StreamHandlerContext, type StreamHandlerParams, type StreamHandlers, type StreamState, type SwitchWorkspaceTarget, TRANSFER_POLL_MS, type TableView, type TableViewTable, type TagsSourceLabels, TaskThreadPendingError, type ThreadAccessors, ThreadBinding, type ThreadItem, type TimeBucket, type TimelinePart, type ToolResponses, type TrackCutter, type TrackPiece, type TranscriptExportLine, type TranscriptLineRef, type TranscriptSegmentMarker, type TransferConflictPolicy, type TransferKind, type TransferMode, type TransferPlan, type TransferScope, type TransferStatus, type TurnTarget, type TurnTools, TxtIcon, TypingIndicator, UPLOAD_ACCEPT, UPLOAD_MAX_FILE_SIZE, type UiStateStorage, type UnarchiveEstimate, type UpdateDocTagInput, type UpdateDocumentsInput, type UpdateProfileVars, type UploadDocumentsInput, type UploadFilesInput, type UploadFilesProgress, type UploadFilesResult, type UploadFromUrlsInput, type UploadFromUrlsResult, type UploadRefusal, type UploadUrlsInput, type UsageBreakdownBy, type UsageBreakdownKey, type UsageBreakdownSourceLabels, type UsageSourceLabels, type UsageTotals, type UseAskAgainOptions, type UseAvatarCropOptions, type UseCameraStreamResult, type UseConversationOptions, type UseDeleteAccountFlowOptions, type UseDownloadDocumentsOptions, type UseEmailChangeOptions, type UseFactsSearchOptions, type UseIdentityVerificationFlowOptions, type UseMessageTimerOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseSwitchWorkspaceResult, type UseVideoRecorderResult, type UserResponse, type UserSettingFlag, type UserSettingsPatch, VIDEO_MIME_PREFERENCE, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, WORKSPACE_LAST_OPENED_KEY, WORKSPACE_STORAGE_KEY, WORK_NOTIFICATION_LABELS, WORK_OFFLINE_VIEW, type WorkflowsSourceLabels, type WorkspaceArchive, type WorkspaceArchiveState, type WorkspaceDocument, type WorkspaceExport, type WorkspaceMember, type WorkspaceNotificationLevel, type WorkspaceProcessing, type WorkspaceRole, type WorkspaceSwitchContext, type WorkspaceUpdate, type WorkspacesSourceLabels, XlsIcon, type ZipExtractor, __resetPendingFinalCommitsForTests, __resetStreamingTokenBufferForTests, acceptRing, accountPath, addAssistantMessageToCache, addConversationToList, addUserMessageToCache, adjustTagCounts, adoptNewChatDocument, agentControl, aggregateDataset, aliasTakenMessage, allConversationThreads, annotateThread, announceMailDraftReplaced, appendTokenToMessage, applyCallEvent, applyConversationEvent, applyFinalContextToMessage, applyLiveUpdate, applyNotificationRow, applyOptimisticDocumentEdit, applyOutputItemToMessage, applyTaskEvents, arbiAccountClient, arbiMailClient, archiveName, archivedWorkspaceMessage, assistantLabels, bindThreadDocument, boundDocumentOf, browserWorkspaceStorage, bucketOf, bucketRange, buildDocumentMetadataRows, buildMentionCandidates, buildPendingFirstTurn, buildPendingSyncItem, buildWorkspaceArchive, cacheThreadBinding, cachedAssistantMode, cachedMentionCandidates, cachedQuotaUsedUp, calendarNotificationMeta, calendarOfflineSupport, callLink, callNotificationMeta, captureFrameAsBlob, chatTranscriptRef, claimOfflineQueue, classifyMediaError, clearLoadingState, clearSealedDrafts, clearUserInputRequest, clockTime, closePanelIn, commitFinalMessage, completeQueuedUserMessageByContent, composeArbiSessionStore, compositeFiles, compositeTrack, computeOnline, confirmLosingOfflineMail, connectOAuthCalendarAccount, connectorErrorStatus, connectorReturnTo, conversationKey, conversationsPath, createActivitySource, createArbiChatStore, createArbiDocumentSessionStore, createArbiLayoutStore, createArbiQueryClient, createArbiSessionStore, createArbiWorkspaceStore, createBrowserStateStorage, createChunkedRecorder, createConversationsSource, createDataSourceRegistry, createDatabaseSource, createDebouncedWriter, createDocumentsSource, createFactsSource, createLocalFeatureStore, createMailClient, createMemoryDashboardStore, createMutedNotifier, createProjectsSource, createSealedDraftStorage, createSkillPack, createStoragePersist, createStreamHandlers, createTagsSource, createTrackCutter, createUiStateStorage, createUsageBreakdownSource, createUsageSource, createWorkflowsSource, createWorkspaceSwitch, createWorkspacesSource, cropImage, cutAtPauses, dayKey, declineRing, decodeMono16k, defaultLayoutState, defaultMailAlias, defineRowsSource, defineSkillPack, deleteLocalDraft, deleteOutboxItem, deploymentUserMeta, describeActivity, describeCalendarNotification, describeServerNotification, discardStreamingTokensForMessage, disconnectAttachedRun, dmTabId, documentActivityMeta, documentActivityPhrase, documentDisplayName, documentMailAttachment, docxMentionMeta, downloadRecoveryFile, dropTagFromCachedDocuments, encodeWav, enqueueOutbox, ensureAssistantMessageLoading, entitlementRefusal, extensionFor, extractZipFile, fallbackFileName, fetchPart, fileAttachment, fileSafe, filesFromDrop, fillTimeGaps, filterRows, findConversation, finishEntityExtraction, floatToWav, flushDocumentForTurn, flushOnPageExit, flushStreamingTokens, forgetDocuments, forgetUploadedDocumentFolder, formatConfigValidationError, formatElapsed, formatIdentityPrice, formatTranscriptMarkdown, getCachedDocuments, getInterjectionText, getNotificationTypeMeta, getOfflineDocument, getOrphanedLastMessage, getRelatedLabels, getRelatedTotal, getRunStartedAt, getThreadsQueryKey, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, groupMailConversations, hasPendingFinalCommit, hasPendingMailChange, hasRecordingTranscript, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars, invalidateCall, invalidateConversationActivity, invalidateConversationDetails, invalidateConversationLists, invalidateTagData, invalidateTagTables, isActivityKey, isAliasTakenError, isArchiveMoving, isCommentToPeople, isConversationListKey, isConversationShared, isDeploymentAdmin, isDeploymentUserNotification, isDocumentsLoading, isFullConfig, isMessageRunning, isNetworkFailure, isNotificationRow, isOrphanedUserMessage, isPanelOpen, isQueuedCalendarWrite, isRecordingSegmentId, isReplayableArbiMutation, isRowNewer, isSignatureNotificationType, isStaleTaskUpdate, isTableViewOf, isTransferFinished, isTransferResumable, isUsageMetered, isWorkingOffline, isWorkspaceArchivedError, isWorkspaceGuestOf, isWorkspaceNotificationType, isZipFile, joinFromPreJoin, layoutActionsOf, loadOfflineDocument, loadAttachment as loadOfflineMailAttachment, mailConversationKey, mailDraftIdFromContent, mailJson, mailThreadRoot, markMessageAsFailed, markNarrationSettled, mergeHostConfig, migrateLegacyThreadDocuments, mountDiditVerification, mutedNoticeFromEvent, mutedNoticeFromPacket, mutedNoticeText, nativeThreadKeys, nextAliasSuggestion, nextViewingDocument, notificationUserName, offlineMailReads, onCallEvent, openAccessRequest, openCall, openPanelIn, openRecording, panelPlace, parseActivityContent, parseDashboardSpec, parseDeleteAccountBlockers, parseSavedChat, parseSavedDocuments, parseSavedLayout, partKey, partsDue, patchCachedDocument, patchConversation, patchConversationList, patchDocuments, patchWorkspaceTags, pendingChatModelSave, peopleDirectory, personOfUser, pickRecentWorkspaces, pickRecorderMimeType, playheadAt, postRecordingDocsToThread, postTranscriptToThread, prepareUploadFiles, queryOfChart, queueMailChange, queuedMessages, readLocalFeature, readWorkspaceLastOpened, recordingFiles, recordingWindowsOf, recordsOf, redlineStats, refreshDocuments, refuseChatWhenOffline, registerArbiMutationDefaults, registerAttachedRun, registerDocumentTurnFlush, remoteControlActions, remoteControlStateOf, removeConversationFromLists, removeSettledNarration, requestPersistentStorage, resetCalendarAccountSyncState, resetMessageContent, resolveActiveWorkspace, resolveConfigModel, resolveDocumentStatus, resolveReplyTarget, restoreLayout, restoreSavedDocuments, retryOutboxItem, rollbackOptimisticDocumentEdit, safePortalUrl, saveLocalDraft, saveRecordingFilesToThread, savedChatOf, savedDocumentsOf, savedLayoutOf, schedulePart, selectDraft, selectIsGenerating, selectViewingDocumentId, sendMailFile, serializeDashboardSpec, serverCallsExperimental, serverNotificationBellEntry, setCachedDocument, setMessageContent, setUserInputRequest, setWorkOfflineIn, settledByRows, signatureNotificationPhrase, signatureRequestMeta, skillPackPrompt, sortTranscriptMessages, sortedParts, speakerTracks, speakerWav, splitIntoFiles, standalone, startChatCall, startContactsCall, startDmCall, startEntityExtraction, startThreadCall, startsMediaFile, stopDocumentsLoading, stripSpeakerPrefix, subscribeDocumentReads, subscribeDocumentRows, supersedeLiveTranscript, supersededTranscriptLines, supportsHouseTemplates, textToArtifact, threadBinding, threadEndingAtContains, threadPath, threadTabId, threadTranscriptLines, threadTranscriptRef, timelineDurationMs, timelineOf, titleFromQuestion, toChatCitations, toMailConversation, toNotificationPreferences, toProfileView, toRedlineMarkdown, toRemoteControlRequest, toShellWorkspace, transcribeRecording, transcriptSegmentOf, updateMessageWithMetadata, updateUserMessageInCache, updateUserMessageStateInCache, uploadFolderOf, uploadedDocumentFolder, upsertDocuments, useAccountClient, useActOnStep, useActiveConfigId, useActivity, useAddChatMembers, useAddDatabaseRows, useAddHolidayCalendar, useAddProjectAddonBlock, useAddWorkspaceMembers, useAddonQuote, useAgentChats, useAgentConfig, useAgentDmStatus, useAgentModels, useAgentRunControl, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useAnswerAgentQuestion, useApplyChatModel, useArbi, useArbiHost, useArbiSession, useArbiSessionState, useArbiSessionStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArchiveProgressPolling, useArchiveWorkspace, useAskAgain, useAssignDocTags, useAssistantArrivals, useAssistantBrief, useAssistantQuery, useAssistantStatus, useAuthorizeLimits, useAutoSendDraft, useAvailableModels, useAvatarCrop, useBookingPages, useBootTimeout, useBoxRole, useBranchNavigation, useBuiltinCommands, useCalDavProfiles, useCalendarAccounts, useCalendarEvent, useCalendarEventByUid, useCalendarEvents, useCalendarInvitations, useCalendarOfflineRuntime, useCalendarOutbox, useCalendarOverlays, useCalendarSettings, useCalendarShares, useCalendarSupport, useCalendars, useCall, useCallInviteLinks, useCallRecording, useCallRecordings, useCallTranscriptionAvailable, useCallsConfig, useCallsEnabled, useCameraStream, useCanCreateProjects, useCanCreateWorkspaces, useCanEditShared, useCanHostCalls, useCancelDriveSync, useCancelMailboxSync, useCancelManyPendingSync, useCancelProjectSubscription, useCancelWorkspaceTransfer, useChangeProjectPlan, useChargeWatch, useChatArrivals, useChatPost, useChatSummaries, useChatThread, useChatUnreadTotal, useChats, useClaimNativeAlias, useClaimSecureMail, useCloseAgentSession, useConfig, useConfigSchema, useConfigs, useConfirmEmailChange, useConfirmProjectSpendLimits, useConnectCalDavAccount, useConnectMailAccount, useConnectOAuthAccount, useConnectRunStream, useConnectedMailFiling, useConnectorAutoSync, useConnectorCatalog, useConnectorVendorVisibility, useContacts, useConversation, useConversationActions, useConversationActivity, useConversationData, useConversationDocuments, useConversationIsShared, useConversationItems, useConversationPendingAuth, useConversationSearch, useConversationSettings, useConversationThreads, useConversationTurn, useConversationWorkspace, useConversations, useCreateAgent, useCreateCalendar, useCreateContact, useCreateDatabase, useCreateEvent, useCreateFact, useCreateFacts, useCreateGroupChat, useCreateProject, useCreateProjectCheckout, useCreateRoom, useCreateTag, useCreateWork, useCreateWorkflow, useCreateWorkspace, useCurrentSessionId, useCurrentUser, useCurrentWorkspace, useDashboardStore, useDataSources, useDatabase, useDatabaseAggregate, useDatabaseDashboardStore, useDatabaseRows, useDatabases, useDecideCounter, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteBookingPage, useDeleteCalendar, useDeleteChatMessage, useDeleteConfig, useDeleteContact, useDeleteConversation, useDeleteDashboard, useDeleteDatabase, useDeleteDatabaseRows, useDeleteDocuments, useDeleteEvent, useDeleteFact, useDeleteMessage, useDeleteNotifications, useDeleteProject, useDeleteSkill, useDeleteTag, useDeleteWorkflow, useDeleteWorkspaces, useDeploymentDomain, useDirectModelUsage, useDisconnectCalendarAccount, useDisconnectConnector, useDisconnectMailAccount, useDisconnectSlack, useDismissedTips, useDocument, useDocumentAutoAdd, useDocumentHostActions, useDocumentPendingSync, useDocumentThumbnails, useDocumentVersionList, useDocuments, useDocumentsLoading, useDocumentsSupport, useDownloadDocuments, useDriveFolderChildren, useDriveFolderDocCount, useDriveFolders, useDriveSyncEstimate, useDriveSyncProgress, useEmailChange, useEnableDriveSync, useEnableMailboxSync, useEntitlements, useEntityExtractionDocIds, useExportDatabase, useExtractEntities, useFacts, useFactsSearch, useFeature, useFeatureCheck, useFeatureSwitch, useFetchCalendarEvent, useFileWaitingNativeMail, useFinaliseTranslation, useFindTime, useFlushOutbox, useFollowThread, useFreeBusy, useGenerateAgentAvatar, useGenerateDocTags, useGrantAgentAccess, useHealth, useHolidayCountries, useHouseTemplateCandidates, useIdentityVerification, useIdentityVerificationFlow, useImportCalendar, useImportContacts, useImportDatabase, useImportDatabaseRows, useInstallSkillPack, useInvalidateAfterTransfer, useInvalidateAssistant, useInvalidateEntitlements, useInvalidateProjects, useInvalidateStorage, useInvalidateTagData, useInvalidateWorkflows, useInviteContacts, useIsCreatingTag, useIsEntitled, useIsSlow, useIsWorkspaceOwner, useKeepDocumentsOffline, useLinkContact, useLinkMentions, useLocalDrafts, useMailAccounts, useMailAttachmentText, useMailCache, useMailClient, useMailConversations, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFiling, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailThread, useMailUnlock, useMailWorkspacePrimer, useMailboxFolders, useMailboxSyncProgress, useMarkArrivalWrong, useMarkChatRead, useMarkDocumentShared, useMarkMessageDraftSent, useMarkNotificationsRead, useMcpTools, useMeetingReadOnly, useMessageDetails, useMessageTimer, useModelConnections, useMoveEvent, useMoveWorkspaceToProject, useMyConnectors, useNameEditor, useNativeMailFiling, useNativeThreadKeys, useNotificationPreferences, useNotifications, useOfflineDocumentIds, useOfflineMailActive, useOfflineMailRuntime, useOfflineMailSettings, useOfflineMailStatus, useOpenCallMeetingChat, useOpenSelectedWorkspace, useOpenViewerDocumentId, useOutbox, usePanelDataset, useParsedDocument, usePassageQuotes, usePasswordChange, usePasswordChangeForm, usePendingMailChanges, usePendingSyncCounts, usePendingSyncItems, usePeople, usePeopleSearch, usePlanQuote, usePlanWork, usePlanWorkspaceTransfer, usePreviewProjectPlanChange, useProcessingTask, useProcessingTasks, useProducts, useProfile, useProjectBillingCache, useProjectBillingPortal, useProjectConversationUsage, useProjectCreationDenial, useProjectInvoices, useProjectUsage, useProjects, usePublishCalendar, useRateSupportTicket, useReadMailMessage, useReconnect, useRecordingActions, useRecordingWindows, useReferralSummary, useRefreshCalendar, useRefreshConnectorsOnRunEnd, useRefreshDocuments, useRefreshProject, useRelatedDocuments, useRemoteControl, useRemoveChatMember, useRemoveDocTags, useRemoveDocumentsOffline, useRemoveModelConnection, useRemoveWorkspaceMembers, useRenameChat, useRenameFolder, useRequestEmailChange, useRequestWorkspaceAccess, useRespondToEvent, useResumeCalendarAccountConnect, useResumeWorkspaceTransfer, useRevokeAgentAccess, useRevokeCallInviteLink, useRooms, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveBookingPage, useSaveCalendarSettings, useSaveConfig, useSaveConfigField, useSaveDashboard, useSaveMailDraft, useSaveModelConnection, useSaveSkill, useSaveToThread, useSavedDashboards, useSearchContacts, useSearchDatabaseRows, useSearchFacts, useSemanticSearch, useSendMail, useServerCallsEnabled, useServerCallsExperimental, useSessionPageTab, useSessionView, useSessions, useSetDeploymentHouseTemplate, useSetNativeMailFiling, useSetSkillVisibility, useSetTagValues, useSetWorkspaceHouseTemplate, useSetWorkspaceMemberRoles, useShareCalendar, useShellWorkspaces, useSignOut, useSignedInSession, useSimilarDocuments, useSkillSource, useSkills, useSlackConnection, useStartAgentSession, useStartCalendarAccountOAuth, useStartTaskQuery, useStartWorkspaceTransfer, useStopMailFilingRule, useStorageActions, useStorageItemNames, useStorageItems, useStorageProjects, useStorageSnapshots, useStreamHandlers, useSubscribeCalendar, useSupportTicket, useSupportTickets, useSwitchWorkspace, useSyncAccountsOnOpen, useSyncCalendarAccount, useSyncOfflineMailbox, useTagKindSchema, useTags, useTerminateSession, useThinkingContent, useThreadDocument, useThumbnails, useTransientView, useTriggerDriveSync, useTriggerMailboxSync, useUnarchiveWorkspace, useUnlockModelConnections, useUnreadByPeer, useUnshareCalendar, useUpdateAssistantBrief, useUpdateCalendar, useUpdateCalendarAccount, useUpdateContact, useUpdateConversation, useUpdateDatabase, useUpdateDatabaseRow, useUpdateDocTag, useUpdateDocuments, useUpdateEvent, useUpdateFact, useUpdateProfile, useUpdateProjectAddonSettings, useUpdateProjectFields, useUpdateProjectNextPeriodAddons, useUpdateTag, useUpdateTagKindSchema, useUpdateUserSettings, useUpdateWorkflow, useUpdateWorkspace, useUploadDocuments, useUploadFiles, useUploadFromUrls, useUploadSkillFiles, useUploadUrls, useUserDashboardStore, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkItems, useWorkOffline, useWorkflowRuns, useWorkflows, useWorkspaceActivity, useWorkspaceArchive, useWorkspaceDocs, useWorkspaceExportDownload, useWorkspaceNotificationLevel, useWorkspaceProcessing, useWorkspaceRole, useWorkspaceTransfer, useWorkspaceTransfers, useWorkspaceTrash, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, viewsOfTable, waitForResponseId, wipeCalendarOffline, wipeOfflineDocuments, wipeOfflineMail, withRelativePath, workflowRunTitle, workflowStepOf, workspaceHouseTemplateId, writeSamples };
@@ -0,0 +1,43 @@
1
+ function throttle(fn, intervalMs) {
2
+ let last = -Infinity;
3
+ let pending = null;
4
+ let timer = null;
5
+ const run = (args) => {
6
+ last = Date.now();
7
+ pending = null;
8
+ fn(...args);
9
+ };
10
+ const clear = () => {
11
+ if (timer) clearTimeout(timer);
12
+ timer = null;
13
+ };
14
+ const throttled = ((...args) => {
15
+ const wait = last + intervalMs - Date.now();
16
+ if (wait <= 0 && !timer) {
17
+ run(args);
18
+ return;
19
+ }
20
+ pending = args;
21
+ if (!timer)
22
+ timer = setTimeout(
23
+ () => {
24
+ timer = null;
25
+ if (pending) run(pending);
26
+ },
27
+ Math.max(0, wait)
28
+ );
29
+ });
30
+ throttled.flush = () => {
31
+ clear();
32
+ if (pending) run(pending);
33
+ };
34
+ throttled.cancel = () => {
35
+ clear();
36
+ pending = null;
37
+ };
38
+ return throttled;
39
+ }
40
+ export {
41
+ throttle
42
+ };
43
+ //# sourceMappingURL=throttle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/lib/throttle.ts"],
4
+ "sourcesContent": ["/**\n * A throttled callback: the first call runs at once, later calls within `intervalMs` collapse into\n * one trailing call with the latest arguments. `flush()` runs a pending call now (a final value\n * must not wait for the timer), `cancel()` drops it.\n *\n * For callbacks that fire far faster than a person can see (upload progress per XHR event), so a\n * React state update happens a few times a second instead of hundreds.\n */\n\nexport interface Throttled<A extends unknown[]> {\n (...args: A): void\n flush(): void\n cancel(): void\n}\n\nexport function throttle<A extends unknown[]>(\n fn: (...args: A) => void,\n intervalMs: number\n): Throttled<A> {\n let last = -Infinity\n let pending: A | null = null\n let timer: ReturnType<typeof setTimeout> | null = null\n\n const run = (args: A) => {\n last = Date.now()\n pending = null\n fn(...args)\n }\n const clear = () => {\n if (timer) clearTimeout(timer)\n timer = null\n }\n\n const throttled = ((...args: A) => {\n const wait = last + intervalMs - Date.now()\n if (wait <= 0 && !timer) {\n run(args)\n return\n }\n pending = args\n if (!timer)\n timer = setTimeout(\n () => {\n timer = null\n if (pending) run(pending)\n },\n Math.max(0, wait)\n )\n }) as Throttled<A>\n throttled.flush = () => {\n clear()\n if (pending) run(pending)\n }\n throttled.cancel = () => {\n clear()\n pending = null\n }\n return throttled\n}\n"],
5
+ "mappings": "AAeO,SAAS,SACd,IACA,YACc;AACd,MAAI,OAAO;AACX,MAAI,UAAoB;AACxB,MAAI,QAA8C;AAElD,QAAM,MAAM,CAAC,SAAY;AACvB,WAAO,KAAK,IAAI;AAChB,cAAU;AACV,OAAG,GAAG,IAAI;AAAA,EACZ;AACA,QAAM,QAAQ,MAAM;AAClB,QAAI,MAAO,cAAa,KAAK;AAC7B,YAAQ;AAAA,EACV;AAEA,QAAM,aAAa,IAAI,SAAY;AACjC,UAAM,OAAO,OAAO,aAAa,KAAK,IAAI;AAC1C,QAAI,QAAQ,KAAK,CAAC,OAAO;AACvB,UAAI,IAAI;AACR;AAAA,IACF;AACA,cAAU;AACV,QAAI,CAAC;AACH,cAAQ;AAAA,QACN,MAAM;AACJ,kBAAQ;AACR,cAAI,QAAS,KAAI,OAAO;AAAA,QAC1B;AAAA,QACA,KAAK,IAAI,GAAG,IAAI;AAAA,MAClB;AAAA,EACJ;AACA,YAAU,QAAQ,MAAM;AACtB,UAAM;AACN,QAAI,QAAS,KAAI,OAAO;AAAA,EAC1B;AACA,YAAU,SAAS,MAAM;AACvB,UAAM;AACN,cAAU;AAAA,EACZ;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -13,6 +13,35 @@ function parse(content) {
13
13
  return null;
14
14
  }
15
15
  }
16
+ function uploadSetMeta(content) {
17
+ const meta = parse(content) ?? {};
18
+ const count = (key) => {
19
+ const value = meta[key];
20
+ return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : 0;
21
+ };
22
+ const ids = Array.isArray(meta.failed_doc_ext_ids) ? meta.failed_doc_ext_ids : [];
23
+ return {
24
+ total: count("total"),
25
+ completed: count("completed"),
26
+ failed: count("failed"),
27
+ failedDocumentIds: ids.filter(
28
+ (id) => typeof id === "string" && DOCUMENT_ID.test(id)
29
+ ),
30
+ refused: count("refused"),
31
+ notUploaded: count("not_uploaded")
32
+ };
33
+ }
34
+ const documents = (n) => `${n} document${n === 1 ? "" : "s"}`;
35
+ function uploadSetTitle(content) {
36
+ const { total, completed, failed, refused, notUploaded } = uploadSetMeta(content);
37
+ const parts = [
38
+ completed === total || total === 0 ? `${documents(completed)} indexed` : `${completed} of ${documents(total)} indexed`
39
+ ];
40
+ if (failed) parts.push(`${failed} failed`);
41
+ if (refused) parts.push(`${refused} skipped`);
42
+ if (notUploaded) parts.push(`${notUploaded} not uploaded`);
43
+ return parts.join(" \xB7 ");
44
+ }
16
45
  function inputRequestTitle(content) {
17
46
  const metadata = parse(content);
18
47
  if (!metadata) return "ARBI needs your input \u2014 open the thread to reply";
@@ -201,6 +230,25 @@ function describeServerNotification(n, options = {}) {
201
230
  target: { kind: "url", url: `/shared-files/${id}` }
202
231
  };
203
232
  }
233
+ // One upload action finished (however many batches it was sent and processed in). A failed
234
+ // document is where it leads when there is one; otherwise the workspace.
235
+ case "upload_set_complete": {
236
+ const meta = uploadSetMeta(n.content);
237
+ const problems = meta.failed + meta.notUploaded;
238
+ const failed = meta.failedDocumentIds;
239
+ return {
240
+ title: uploadSetTitle(n.content),
241
+ variant: problems ? "warning" : "success",
242
+ ...failed.length === 1 ? {
243
+ actionLabel: "Open failed document",
244
+ target: {
245
+ kind: "document",
246
+ workspaceId: n.workspace_ext_id ?? void 0,
247
+ documentId: failed[0]
248
+ }
249
+ } : { target: workspace }
250
+ };
251
+ }
204
252
  case "call_missed":
205
253
  return {
206
254
  title: `Missed call from ${senderName}`,
@@ -447,6 +495,8 @@ export {
447
495
  notificationUserName,
448
496
  safePortalUrl,
449
497
  signatureNotificationPhrase,
450
- signatureRequestMeta
498
+ signatureRequestMeta,
499
+ uploadSetMeta,
500
+ uploadSetTitle
451
501
  };
452
502
  //# sourceMappingURL=server-notifications.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/notifications/server-notifications.ts"],
4
- "sourcesContent": ["/**\n * What a server-persisted notification (`NotificationResponse`) says and where it leads \u2014 the one\n * type\u2192presentation mapping every surface reads (the arrival toast, the bell entry, the\n * notification centre), so wording cannot drift between them or between hosts.\n *\n * Titles derive from `type`, the sender and plaintext routing metadata only: the E2E-encrypted\n * content is never needed. Where an entry leads is data ({@link NotificationTarget}); the host\n * owns navigation and turns a target into its own route.\n */\n\nimport type { components } from '@arbidocs/client'\nimport { mailDraftIdFromContent } from '../mail/client'\nimport type { NotifyVariant } from './notify-store'\n\ntype NotificationResponse = components['schemas']['NotificationResponse']\ntype NotificationUser = NotificationResponse['sender']\n\n/** Where a notification leads. The host maps each kind onto its routes. */\nexport type NotificationTarget =\n /** A workspace's own page (a membership change). */\n | { kind: 'workspace'; workspaceId: string }\n /** A thread, scrolled to a message when given. */\n | { kind: 'conversation'; workspaceId?: string; conversationId: string; messageId?: string }\n /** A document: at a version, on a comment, or on a viewer tab when given. */\n | {\n kind: 'document'\n workspaceId?: string\n documentId: string\n version?: number\n commentId?: string\n tab?: 'pdf'\n }\n /** The mailbox, on a draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The workflows page, on a workflow (in its workspace) when given. */\n | { kind: 'workflows'; workflowId?: string; workspaceId?: string }\n /** Projects and their AI usage. */\n | { kind: 'projects' }\n | { kind: 'support'; ticketId: number }\n /** Storage settings. */\n | { kind: 'storage' }\n /** Where seats are added (the Box's licence page). */\n | { kind: 'seats' }\n /** Review a workspace access request (choose a workspace and a role). */\n | { kind: 'access-request'; notification: NotificationResponse }\n /** Call the sender back. */\n | { kind: 'call-back'; user: NotificationUser }\n /** An external page, opened in a new tab. */\n | { kind: 'url'; url: string }\n /** The calendar, on an event when given; `join`: join the event's online meeting. */\n | { kind: 'calendar'; eventId?: string; recurrenceId?: string | null; join?: boolean }\n\n/** A server notification's presentation: its sentence, severity, and where it leads. */\nexport interface ServerNotificationDescription {\n title: string\n variant: NotifyVariant\n /** The label of the action that opens {@link target} (\"Review and sign\"); default \"View\". */\n actionLabel?: string\n target?: NotificationTarget\n}\n\nexport interface DescribeServerNotificationOptions {\n /** The sender's display name; default their given and family name, else their email. */\n senderName?: string\n /** The name of a document the notification is about, when the host knows it (names are\n * encrypted, so a notification carries only the id). */\n documentName?: (workspaceId: string | null | undefined, documentId: string) => string | undefined\n /** The portal origins a deployment-user notice may link to. */\n portalOrigins?: readonly string[]\n}\n\n/** A person's display name: given and family name, else their email. */\nexport function notificationUserName(user: NotificationUser): string {\n return [user.given_name, user.family_name].filter(Boolean).join(' ') || user.email\n}\n\nconst CONVERSATION_ID = /^con-[a-zA-Z0-9]+$/\nconst WORKFLOW_ID = /^wfl-[a-zA-Z0-9]+$/\nconst DOCUMENT_ID = /^doc-[a-zA-Z0-9]+$/\n\nfunction parse(content: string | null | undefined): Record<string, unknown> | null {\n try {\n const value = JSON.parse(content || '{}') as unknown\n return value && typeof value === 'object' ? (value as Record<string, unknown>) : null\n } catch {\n return null\n }\n}\n\n/** Deadline metadata is intentionally plaintext; the confidential question stays in the thread. */\nexport function inputRequestTitle(content: string | null | undefined): string {\n const metadata = parse(content)\n if (!metadata) return 'ARBI needs your input \u2014 open the thread to reply'\n const timeout = typeof metadata.timeout_seconds === 'number' ? metadata.timeout_seconds : 300\n const minutes = Math.ceil(timeout / 60)\n const deadline = typeof metadata.expires_at === 'string' ? new Date(metadata.expires_at) : null\n if (deadline && Number.isFinite(deadline.getTime())) {\n return `ARBI needs your input \u2014 ${minutes} min to reply (until ${deadline.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })})`\n }\n return `ARBI needs your input \u2014 ${minutes} min to reply`\n}\n\n/**\n * The plaintext routing content of a `document_activity` notification: `{doc_ext_id, event,\n * reason, version}`. Opaque ids and a closed vocabulary only; never the file name.\n */\nexport function documentActivityMeta(content: string | null | undefined): {\n documentId?: string\n reason?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.doc_ext_id === 'string' && DOCUMENT_ID.test(meta.doc_ext_id)\n ? meta.doc_ext_id\n : undefined\n const version =\n typeof meta.version === 'number' && Number.isInteger(meta.version) && meta.version > 0\n ? meta.version\n : undefined\n const reason = typeof meta.reason === 'string' ? meta.reason : undefined\n return { documentId, reason, version }\n}\n\n/** What a `document_activity` says after its sender: \"signed a document\", \"saved version 3 of a document\". */\nexport function documentActivityPhrase(content: string | null | undefined): string {\n const { reason, version } = documentActivityMeta(content)\n if (reason === 'signed') return 'signed a document'\n return version ? `saved version ${version} of a document` : 'saved a new version of a document'\n}\n\n/** The document and comment a `docx_mention` points at (routing ids only). */\nexport function docxMentionMeta(content: string | null | undefined): {\n documentId?: string\n commentId?: string\n} {\n const meta = parse(content)\n if (!meta || typeof meta.document_id !== 'string' || !DOCUMENT_ID.test(meta.document_id))\n return {}\n return {\n documentId: meta.document_id,\n commentId: typeof meta.comment_id === 'string' && meta.comment_id ? meta.comment_id : undefined,\n }\n}\n\n/**\n * The plaintext routing content of a signature-request notification: `{request_id, document_id,\n * signed_version?}`. Opaque ids only: the document's name is encrypted, so it is never in a\n * notification.\n */\nexport function signatureRequestMeta(content: string | null | undefined): {\n documentId?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.document_id === 'string' && DOCUMENT_ID.test(meta.document_id)\n ? meta.document_id\n : undefined\n const version =\n typeof meta.signed_version === 'number' && Number.isInteger(meta.signed_version)\n ? meta.signed_version\n : undefined\n return { documentId, version }\n}\n\n/** The notification types of a signature request. */\nexport const SIGNATURE_NOTIFICATION_TYPES = [\n 'signature_requested',\n 'signature_completed',\n 'signature_declined',\n] as const\nexport type SignatureNotificationType = (typeof SIGNATURE_NOTIFICATION_TYPES)[number]\n\nexport function isSignatureNotificationType(\n type: string | null | undefined\n): type is SignatureNotificationType {\n return (SIGNATURE_NOTIFICATION_TYPES as readonly string[]).includes(type ?? '')\n}\n\n/**\n * What a signature notification says, around the person's name and the document's:\n * `{lead} [person] {verb} [document]{tail}`. The recipient reads it about the sender\n * (\"Priya Shah asked you to sign NDA.pdf\"); the sender, in their own activity, about what they did\n * (\"You asked Sam Lee to sign NDA.pdf\"), with the person left out when the sentence needs none.\n */\nexport function signatureNotificationPhrase(\n type: SignatureNotificationType,\n incoming: boolean\n): { lead: string; showPerson: boolean; verb: string; tail: string } {\n if (incoming) {\n switch (type) {\n case 'signature_requested':\n return { lead: '', showPerson: true, verb: 'asked you to sign', tail: '' }\n case 'signature_completed':\n return { lead: '', showPerson: true, verb: 'signed', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: '', showPerson: true, verb: 'declined to sign', tail: '' }\n }\n }\n switch (type) {\n case 'signature_requested':\n return { lead: 'You asked', showPerson: true, verb: 'to sign', tail: '' }\n case 'signature_completed':\n return { lead: 'You signed', showPerson: false, verb: '', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: 'You declined to sign', showPerson: false, verb: '', tail: '' }\n }\n}\n\n/**\n * Plaintext routing metadata on call notifications (`call_missed`): `{call_ext_id}`. Never a\n * title \u2014 titles are encrypted under the call's key.\n */\nexport function callNotificationMeta(content: string | null | undefined): { callExtId?: string } {\n const meta = parse(content)\n return {\n callExtId:\n typeof meta?.call_ext_id === 'string' && /^call-[a-zA-Z0-9]{8}$/.test(meta.call_ext_id)\n ? meta.call_ext_id\n : undefined,\n }\n}\n\n/** A Box had no seat for a new internal user: the inviter's invitation was not sent. Central\n * emails the inviter and the Box admins; this is the inviter's own notice. */\nexport const BOX_SEAT_REFUSED = 'box_seat_refused'\nexport const BOX_SEAT_REFUSED_TITLE =\n 'Invitation not sent: your Box has no seat left. Your Box admins have been notified and can add users in the ARBI portal.'\nexport const BOX_SEAT_REFUSED_ACTION = 'Open the ARBI portal'\n\n/** A deployment admin's notice about the Box's users (`deployment_user_invited` / `_registered`):\n * an invitation sent (sender = the inviter) or an account created (sender = the new user). */\nexport function isDeploymentUserNotification(type: string | null | undefined): boolean {\n return type === 'deployment_user_invited' || type === 'deployment_user_registered'\n}\n\n/** The portal origins a \"Manage users\" link may open by default. Anything else gets no button. */\nexport const ALLOWED_PORTAL_ORIGINS: readonly string[] = ['https://portal.arbicity.com']\n\n/** The portal link, only when it is https on an allowed portal origin. */\nexport function safePortalUrl(\n value: unknown,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): string | undefined {\n if (typeof value !== 'string') return undefined\n try {\n const url = new URL(value)\n if (url.protocol !== 'https:' || !origins.includes(url.origin)) return undefined\n return url.href\n } catch {\n return undefined\n }\n}\n\n/** Plaintext content of a deployment-user notification: `{email, user_type, portal_url}`. */\nexport function deploymentUserMeta(\n content: string | null | undefined,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): { email?: string; external: boolean; portalUrl?: string } {\n const meta = parse(content)\n if (!meta) return { external: false }\n const email = typeof meta.email === 'string' && meta.email.trim() ? meta.email.trim() : undefined\n return {\n email,\n external: meta.user_type === 'external',\n portalUrl: safePortalUrl(meta.portal_url, origins),\n }\n}\n\n/** A document's display name, as a document list shows it (its title, else its file name). */\nexport function documentDisplayName(\n doc:\n | { file_name?: string | null; doc_metadata?: { title?: string | null } | null }\n | null\n | undefined\n): string | undefined {\n return doc?.doc_metadata?.title || doc?.file_name || undefined\n}\n\n/** What the work notifications say in a list, where the sender has a column of their own. */\nexport const WORK_NOTIFICATION_LABELS: Readonly<Record<string, string>> = {\n conversation_ready: 'A task is ready',\n conversation_done: 'A task was marked done',\n conversation_notified: 'You were notified in a thread',\n workflow_failed: 'A workflow failed to run',\n}\n\nfunction conversationTarget(n: NotificationResponse): NotificationTarget | undefined {\n if (!n.conversation_ext_id || !CONVERSATION_ID.test(n.conversation_ext_id)) return undefined\n return {\n kind: 'conversation',\n workspaceId: n.workspace_ext_id ?? undefined,\n conversationId: n.conversation_ext_id,\n ...(n.message_ext_id ? { messageId: n.message_ext_id } : {}),\n }\n}\n\n/** The workflows page on the notification's workflow (`{workflow_ext_id}` in its content). */\nfunction workflowTarget(n: NotificationResponse): NotificationTarget {\n const workflowId = parse(n.content)?.workflow_ext_id\n return {\n kind: 'workflows',\n ...(typeof workflowId === 'string' && WORKFLOW_ID.test(workflowId) ? { workflowId } : {}),\n ...(n.workspace_ext_id ? { workspaceId: n.workspace_ext_id } : {}),\n }\n}\n\nfunction signatureTitle(\n n: NotificationResponse,\n senderName: string,\n documentName: DescribeServerNotificationOptions['documentName']\n): string {\n const type = n.type as SignatureNotificationType\n const { documentId } = signatureRequestMeta(n.content)\n const name = documentId ? documentName?.(n.workspace_ext_id, documentId) : undefined\n const fallback = type === 'signature_requested' ? 'a document' : 'your document'\n const { verb, tail } = signatureNotificationPhrase(type, true)\n return `${senderName} ${verb} ${name ?? fallback}${tail}`\n}\n\nfunction quotaPercent(type: string): number | null {\n if (type === 'quota_threshold_100') return 100\n if (type === 'quota_threshold_90') return 90\n if (type === 'quota_threshold_50') return 50\n return null\n}\n\n/**\n * One server notification \u2192 what it says to its recipient and where it leads, or null for\n * types without a sentence here (calendar events, sync completions: they have their own\n * surfaces).\n */\nexport function describeServerNotification(\n n: NotificationResponse,\n options: DescribeServerNotificationOptions = {}\n): ServerNotificationDescription | null {\n const senderName = options.senderName ?? notificationUserName(n.sender)\n const workspace: NotificationTarget | undefined = n.workspace_ext_id\n ? { kind: 'workspace', workspaceId: n.workspace_ext_id }\n : undefined\n const type = n.type as string\n\n if (type === BOX_SEAT_REFUSED) {\n return {\n title: BOX_SEAT_REFUSED_TITLE,\n variant: 'warning',\n actionLabel: BOX_SEAT_REFUSED_ACTION,\n target: { kind: 'seats' },\n }\n }\n const pct = quotaPercent(type)\n if (pct !== null) {\n return {\n title: `You have used ${pct}% of your daily AI limit for this project.`,\n variant: pct === 100 ? 'error' : pct === 90 ? 'warning' : 'info',\n target: { kind: 'projects' },\n }\n }\n\n switch (type) {\n case 'support_ticket_received':\n case 'support_ticket_reviewed':\n case 'support_ticket_resolved': {\n const ticketId = parse(n.content)?.ticket_id\n if (typeof ticketId !== 'number' || !Number.isSafeInteger(ticketId) || ticketId < 1)\n return null\n const suppliedReference = parse(n.content)?.ticket_reference\n const reference =\n typeof suppliedReference === 'string' &&\n /^[a-z0-9-]+-[0-9]+$/.test(suppliedReference) &&\n suppliedReference.endsWith(`-${ticketId}`)\n ? suppliedReference\n : `#${ticketId}`\n return {\n title:\n type === 'support_ticket_received'\n ? `We received support request ${reference}`\n : type === 'support_ticket_reviewed'\n ? `We have reviewed support request ${reference}`\n : `Support request ${reference} is resolved`,\n variant: 'success',\n actionLabel: type === 'support_ticket_resolved' ? 'View outcome' : 'View request',\n target: { kind: 'support', ticketId },\n }\n }\n case 'file_shared': {\n const meta = parse(n.content)\n const id = meta?.file_share_id\n if (typeof id !== 'string' || !/^fsh-[0-9a-f]{32}$/.test(id)) return null\n return {\n title: meta?.declined\n ? `${senderName} declined to sign a file`\n : meta?.completed\n ? 'Everyone has signed. Your PDF is ready.'\n : meta?.signature\n ? `${senderName} asked you to sign a file`\n : `${senderName} shared a file with you`,\n variant: meta?.declined ? 'warning' : meta?.completed ? 'success' : 'info',\n actionLabel: meta?.signature && !meta?.completed ? 'Review and sign' : 'Open file',\n target: { kind: 'url', url: `/shared-files/${id}` },\n }\n }\n case 'call_missed':\n return {\n title: `Missed call from ${senderName}`,\n variant: 'warning',\n actionLabel: 'Call back',\n target: { kind: 'call-back', user: n.sender },\n }\n case 'native_mail_received':\n return {\n title: 'New email in your encrypted inbox',\n variant: 'info',\n target: { kind: 'mail' },\n }\n case 'mail_draft_ready': {\n const draftId = mailDraftIdFromContent(n.content)\n return {\n title: `${senderName} left a draft email for you to review`,\n variant: 'info',\n target: { kind: 'mail', ...(draftId ? { draftId } : {}) },\n }\n }\n case 'workspaceuser_added_owner':\n return { title: `${senderName} added you as owner`, variant: 'info', target: workspace }\n case 'workspaceuser_added_collaborator':\n return {\n title: `${senderName} added you as collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_added_guest':\n return { title: `${senderName} added you as a viewer`, variant: 'info', target: workspace }\n case 'workspaceuser_removed':\n return { title: `${senderName} removed you from a workspace`, variant: 'warning' }\n case 'workspaceuser_updated_owner':\n return {\n title: `${senderName} changed your role to owner`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_collaborator':\n return {\n title: `${senderName} changed your role to collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_guest':\n return {\n title: `${senderName} changed your role to viewer`,\n variant: 'info',\n target: workspace,\n }\n case 'signature_requested':\n case 'signature_completed':\n case 'signature_declined': {\n const { documentId, version } = signatureRequestMeta(n.content)\n return {\n title: signatureTitle(n, senderName, options.documentName),\n variant:\n type === 'signature_completed'\n ? 'success'\n : type === 'signature_declined'\n ? 'warning'\n : 'info',\n actionLabel: type === 'signature_requested' ? 'Review and sign' : 'Open',\n // A request opens the current version on its PDF, where the banner offers \"Review and\n // sign\"; a completed request opens the signed copy.\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n tab: 'pdf',\n }\n : undefined,\n }\n }\n case 'docx_mention': {\n const { documentId, commentId } = docxMentionMeta(n.content)\n return {\n title: `${senderName} mentioned you in a document comment`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(commentId ? { commentId } : {}),\n }\n : undefined,\n }\n }\n case 'agent_input_requested':\n return { title: inputRequestTitle(n.content), variant: 'info', target: conversationTarget(n) }\n case 'mention':\n return {\n title: `${senderName} mentioned you in a conversation`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'thread_reply':\n return {\n title: `${senderName} replied in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'document_activity': {\n const { documentId, version } = documentActivityMeta(n.content)\n return {\n title: `${senderName} ${documentActivityPhrase(n.content)}`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n }\n : undefined,\n }\n }\n // Each of these opens the thread, so the person it is for finds it. One about your own thread\n // (you started the work) says so.\n case 'conversation_ready':\n return {\n title:\n n.sender.external_id === n.recipient.external_id\n ? 'Your thread is ready'\n : `${senderName}\u2019s thread is ready`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_notified':\n return {\n title: `${senderName} notified you in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_done':\n return {\n title: `${senderName} marked a thread done`,\n variant: 'success',\n target: conversationTarget(n),\n }\n case 'workflow_completed':\n return { title: 'A workflow completed', variant: 'success', target: workflowTarget(n) }\n // The failed run's thread when it has one (its error is there), else the workflow.\n case 'workflow_failed':\n return {\n title: 'A workflow failed to start',\n variant: 'error',\n target: conversationTarget(n) ?? workflowTarget(n),\n }\n case 'deployment_user_invited':\n case 'deployment_user_registered': {\n const { email, external, portalUrl } = deploymentUserMeta(n.content, options.portalOrigins)\n const suffix = external ? ' \u00B7 External' : ''\n return {\n title:\n type === 'deployment_user_invited'\n ? `${senderName} invited ${email ?? 'a new user'}${suffix}`\n : `${email ?? senderName} joined${suffix}`,\n variant: 'info',\n ...(portalUrl && {\n actionLabel: 'Manage users',\n target: { kind: 'url' as const, url: portalUrl },\n }),\n }\n }\n case 'contact_accepted':\n return { title: `${senderName} joined the platform`, variant: 'success', target: workspace }\n case 'workspace_access_request':\n return {\n title: `${senderName} asked for workspace access`,\n variant: 'info',\n // Straight into the review \u2014 granting needs a workspace choice and a role, so a bare\n // \"grant\" action could never be right here.\n target: { kind: 'access-request', notification: n },\n }\n case 'project_quota_warning': {\n let resource = 'usage'\n let percentage: number | null = null\n let upgrade = ''\n let impending = false\n try {\n const data = JSON.parse(n.content ?? '{}')\n resource = data.resource === 'storage_gb' ? 'storage' : 'AI credits'\n if (data.limit > 0) percentage = Math.round((data.used / data.limit) * 100)\n if (data.stage === 'before_upgrade') {\n impending = true\n const charge = new Intl.NumberFormat('en-GB', {\n style: 'currency',\n currency: data.currency || 'GBP',\n }).format(data.charge_ex_vat_pence / 100)\n upgrade = `An automatic ${resource} upgrade will now be attempted: ${charge} ex VAT.`\n } else if (data.automatic_upgrade === true) {\n upgrade =\n ' An automatic upgrade is available within your limit and will be attempted when needed, subject to payment.'\n } else if (data.automatic_upgrade === false) {\n upgrade =\n data.upgrade_reason === 'limit'\n ? ' No automatic upgrade fits your remaining limit. Increase it or add allowances to keep working.'\n : data.upgrade_reason === 'payment'\n ? ' Automatic upgrades are paused. Resolve your payment issue to keep working.'\n : ' Automatic upgrades are unavailable. Upgrade your plan or reduce usage to keep working.'\n }\n } catch {\n /* An old or malformed notice still opens project usage. */\n }\n return {\n title: impending\n ? upgrade\n : `Your project is approaching its ${resource} limit${percentage != null ? ` (${percentage}% used)` : ''}.${upgrade}`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'project_retention': {\n let deadline = ''\n try {\n const data = JSON.parse(n.content ?? '{}')\n if (data.deletion_at) deadline = new Date(data.deletion_at).toLocaleDateString('en-GB')\n } catch {\n /* display the recovery notice without a date */\n }\n return {\n title: `Your project subscription has ended. Export or resubscribe${deadline ? ` before ${deadline}` : ''} to keep its data.`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'storage_quota_exceeded':\n return {\n title:\n 'Your storage is full. Mail still arrives, but new uploads and attachments are paused until you free space or add storage.',\n variant: 'error',\n target: { kind: 'storage' },\n }\n case 'signup_reward':\n return {\n title: n.content ? `\uD83C\uDF89 Signup bonus \u2014 ${n.content}` : '\uD83C\uDF89 You earned a signup bonus!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n case 'referral_reward':\n return {\n title: n.content ? `\uD83C\uDF81 Reward \u2014 ${n.content}` : '\uD83C\uDF81 You earned a reward!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n default: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AmB,YACtB,gFACA;AAAA,QACV;AAAA,MACF,QAAQ;AAAA,MAER;AACA,aAAO;AAAA,QACL,OAAO,YACH,UACA,mCAAmC,QAAQ,SAAS,cAAc,OAAO,KAAK,UAAU,YAAY,EAAE,IAAI,OAAO;AAAA,QACrH,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,KAAK,qBAAqB;AACxB,UAAI,WAAW;AACf,UAAI;AACF,cAAM,OAAO,KAAK,MAAM,EAAE,WAAW,IAAI;AACzC,YAAI,KAAK,YAAa,YAAW,IAAI,KAAK,KAAK,WAAW,EAAE,mBAAmB,OAAO;AAAA,MACxF,QAAQ;AAAA,MAER;AACA,aAAO;AAAA,QACL,OAAO,6DAA6D,WAAW,WAAW,QAAQ,KAAK,EAAE;AAAA,QACzG,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,KAAK;AACH,aAAO;AAAA,QACL,OACE;AAAA,QACF,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,UAAU;AAAA,MAC5B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,iCAAqB,EAAE,OAAO,KAAK;AAAA,QACtD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,2BAAe,EAAE,OAAO,KAAK;AAAA,QAChD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AACE,aAAO;AAAA,EACX;AACF;",
4
+ "sourcesContent": ["/**\n * What a server-persisted notification (`NotificationResponse`) says and where it leads \u2014 the one\n * type\u2192presentation mapping every surface reads (the arrival toast, the bell entry, the\n * notification centre), so wording cannot drift between them or between hosts.\n *\n * Titles derive from `type`, the sender and plaintext routing metadata only: the E2E-encrypted\n * content is never needed. Where an entry leads is data ({@link NotificationTarget}); the host\n * owns navigation and turns a target into its own route.\n */\n\nimport type { components } from '@arbidocs/client'\nimport { mailDraftIdFromContent } from '../mail/client'\nimport type { NotifyVariant } from './notify-store'\n\ntype NotificationResponse = components['schemas']['NotificationResponse']\ntype NotificationUser = NotificationResponse['sender']\n\n/** Where a notification leads. The host maps each kind onto its routes. */\nexport type NotificationTarget =\n /** A workspace's own page (a membership change). */\n | { kind: 'workspace'; workspaceId: string }\n /** A thread, scrolled to a message when given. */\n | { kind: 'conversation'; workspaceId?: string; conversationId: string; messageId?: string }\n /** A document: at a version, on a comment, or on a viewer tab when given. */\n | {\n kind: 'document'\n workspaceId?: string\n documentId: string\n version?: number\n commentId?: string\n tab?: 'pdf'\n }\n /** The mailbox, on a draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The workflows page, on a workflow (in its workspace) when given. */\n | { kind: 'workflows'; workflowId?: string; workspaceId?: string }\n /** Projects and their AI usage. */\n | { kind: 'projects' }\n | { kind: 'support'; ticketId: number }\n /** Storage settings. */\n | { kind: 'storage' }\n /** Where seats are added (the Box's licence page). */\n | { kind: 'seats' }\n /** Review a workspace access request (choose a workspace and a role). */\n | { kind: 'access-request'; notification: NotificationResponse }\n /** Call the sender back. */\n | { kind: 'call-back'; user: NotificationUser }\n /** An external page, opened in a new tab. */\n | { kind: 'url'; url: string }\n /** The calendar, on an event when given; `join`: join the event's online meeting. */\n | { kind: 'calendar'; eventId?: string; recurrenceId?: string | null; join?: boolean }\n\n/** A server notification's presentation: its sentence, severity, and where it leads. */\nexport interface ServerNotificationDescription {\n title: string\n variant: NotifyVariant\n /** The label of the action that opens {@link target} (\"Review and sign\"); default \"View\". */\n actionLabel?: string\n target?: NotificationTarget\n}\n\nexport interface DescribeServerNotificationOptions {\n /** The sender's display name; default their given and family name, else their email. */\n senderName?: string\n /** The name of a document the notification is about, when the host knows it (names are\n * encrypted, so a notification carries only the id). */\n documentName?: (workspaceId: string | null | undefined, documentId: string) => string | undefined\n /** The portal origins a deployment-user notice may link to. */\n portalOrigins?: readonly string[]\n}\n\n/** A person's display name: given and family name, else their email. */\nexport function notificationUserName(user: NotificationUser): string {\n return [user.given_name, user.family_name].filter(Boolean).join(' ') || user.email\n}\n\nconst CONVERSATION_ID = /^con-[a-zA-Z0-9]+$/\nconst WORKFLOW_ID = /^wfl-[a-zA-Z0-9]+$/\nconst DOCUMENT_ID = /^doc-[a-zA-Z0-9]+$/\n\nfunction parse(content: string | null | undefined): Record<string, unknown> | null {\n try {\n const value = JSON.parse(content || '{}') as unknown\n return value && typeof value === 'object' ? (value as Record<string, unknown>) : null\n } catch {\n return null\n }\n}\n\n/**\n * The plaintext totals of an `upload_set_complete` notification (one upload action finished: every\n * document of it is processed or failed). Counts and opaque ids only; never a file name.\n */\nexport function uploadSetMeta(content: string | null | undefined): {\n total: number\n completed: number\n failed: number\n failedDocumentIds: string[]\n refused: number\n notUploaded: number\n} {\n const meta = parse(content) ?? {}\n const count = (key: string) => {\n const value = meta[key]\n return typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : 0\n }\n const ids = Array.isArray(meta.failed_doc_ext_ids) ? meta.failed_doc_ext_ids : []\n return {\n total: count('total'),\n completed: count('completed'),\n failed: count('failed'),\n failedDocumentIds: ids.filter(\n (id): id is string => typeof id === 'string' && DOCUMENT_ID.test(id)\n ),\n refused: count('refused'),\n notUploaded: count('not_uploaded'),\n }\n}\n\nconst documents = (n: number) => `${n} document${n === 1 ? '' : 's'}`\n\n/** \"250 documents indexed\", or \"247 of 250 documents indexed \u00B7 3 failed \u00B7 1 skipped\". */\nexport function uploadSetTitle(content: string | null | undefined): string {\n const { total, completed, failed, refused, notUploaded } = uploadSetMeta(content)\n const parts = [\n completed === total || total === 0\n ? `${documents(completed)} indexed`\n : `${completed} of ${documents(total)} indexed`,\n ]\n if (failed) parts.push(`${failed} failed`)\n if (refused) parts.push(`${refused} skipped`)\n if (notUploaded) parts.push(`${notUploaded} not uploaded`)\n return parts.join(' \u00B7 ')\n}\n\n/** Deadline metadata is intentionally plaintext; the confidential question stays in the thread. */\nexport function inputRequestTitle(content: string | null | undefined): string {\n const metadata = parse(content)\n if (!metadata) return 'ARBI needs your input \u2014 open the thread to reply'\n const timeout = typeof metadata.timeout_seconds === 'number' ? metadata.timeout_seconds : 300\n const minutes = Math.ceil(timeout / 60)\n const deadline = typeof metadata.expires_at === 'string' ? new Date(metadata.expires_at) : null\n if (deadline && Number.isFinite(deadline.getTime())) {\n return `ARBI needs your input \u2014 ${minutes} min to reply (until ${deadline.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })})`\n }\n return `ARBI needs your input \u2014 ${minutes} min to reply`\n}\n\n/**\n * The plaintext routing content of a `document_activity` notification: `{doc_ext_id, event,\n * reason, version}`. Opaque ids and a closed vocabulary only; never the file name.\n */\nexport function documentActivityMeta(content: string | null | undefined): {\n documentId?: string\n reason?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.doc_ext_id === 'string' && DOCUMENT_ID.test(meta.doc_ext_id)\n ? meta.doc_ext_id\n : undefined\n const version =\n typeof meta.version === 'number' && Number.isInteger(meta.version) && meta.version > 0\n ? meta.version\n : undefined\n const reason = typeof meta.reason === 'string' ? meta.reason : undefined\n return { documentId, reason, version }\n}\n\n/** What a `document_activity` says after its sender: \"signed a document\", \"saved version 3 of a document\". */\nexport function documentActivityPhrase(content: string | null | undefined): string {\n const { reason, version } = documentActivityMeta(content)\n if (reason === 'signed') return 'signed a document'\n return version ? `saved version ${version} of a document` : 'saved a new version of a document'\n}\n\n/** The document and comment a `docx_mention` points at (routing ids only). */\nexport function docxMentionMeta(content: string | null | undefined): {\n documentId?: string\n commentId?: string\n} {\n const meta = parse(content)\n if (!meta || typeof meta.document_id !== 'string' || !DOCUMENT_ID.test(meta.document_id))\n return {}\n return {\n documentId: meta.document_id,\n commentId: typeof meta.comment_id === 'string' && meta.comment_id ? meta.comment_id : undefined,\n }\n}\n\n/**\n * The plaintext routing content of a signature-request notification: `{request_id, document_id,\n * signed_version?}`. Opaque ids only: the document's name is encrypted, so it is never in a\n * notification.\n */\nexport function signatureRequestMeta(content: string | null | undefined): {\n documentId?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.document_id === 'string' && DOCUMENT_ID.test(meta.document_id)\n ? meta.document_id\n : undefined\n const version =\n typeof meta.signed_version === 'number' && Number.isInteger(meta.signed_version)\n ? meta.signed_version\n : undefined\n return { documentId, version }\n}\n\n/** The notification types of a signature request. */\nexport const SIGNATURE_NOTIFICATION_TYPES = [\n 'signature_requested',\n 'signature_completed',\n 'signature_declined',\n] as const\nexport type SignatureNotificationType = (typeof SIGNATURE_NOTIFICATION_TYPES)[number]\n\nexport function isSignatureNotificationType(\n type: string | null | undefined\n): type is SignatureNotificationType {\n return (SIGNATURE_NOTIFICATION_TYPES as readonly string[]).includes(type ?? '')\n}\n\n/**\n * What a signature notification says, around the person's name and the document's:\n * `{lead} [person] {verb} [document]{tail}`. The recipient reads it about the sender\n * (\"Priya Shah asked you to sign NDA.pdf\"); the sender, in their own activity, about what they did\n * (\"You asked Sam Lee to sign NDA.pdf\"), with the person left out when the sentence needs none.\n */\nexport function signatureNotificationPhrase(\n type: SignatureNotificationType,\n incoming: boolean\n): { lead: string; showPerson: boolean; verb: string; tail: string } {\n if (incoming) {\n switch (type) {\n case 'signature_requested':\n return { lead: '', showPerson: true, verb: 'asked you to sign', tail: '' }\n case 'signature_completed':\n return { lead: '', showPerson: true, verb: 'signed', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: '', showPerson: true, verb: 'declined to sign', tail: '' }\n }\n }\n switch (type) {\n case 'signature_requested':\n return { lead: 'You asked', showPerson: true, verb: 'to sign', tail: '' }\n case 'signature_completed':\n return { lead: 'You signed', showPerson: false, verb: '', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: 'You declined to sign', showPerson: false, verb: '', tail: '' }\n }\n}\n\n/**\n * Plaintext routing metadata on call notifications (`call_missed`): `{call_ext_id}`. Never a\n * title \u2014 titles are encrypted under the call's key.\n */\nexport function callNotificationMeta(content: string | null | undefined): { callExtId?: string } {\n const meta = parse(content)\n return {\n callExtId:\n typeof meta?.call_ext_id === 'string' && /^call-[a-zA-Z0-9]{8}$/.test(meta.call_ext_id)\n ? meta.call_ext_id\n : undefined,\n }\n}\n\n/** A Box had no seat for a new internal user: the inviter's invitation was not sent. Central\n * emails the inviter and the Box admins; this is the inviter's own notice. */\nexport const BOX_SEAT_REFUSED = 'box_seat_refused'\nexport const BOX_SEAT_REFUSED_TITLE =\n 'Invitation not sent: your Box has no seat left. Your Box admins have been notified and can add users in the ARBI portal.'\nexport const BOX_SEAT_REFUSED_ACTION = 'Open the ARBI portal'\n\n/** A deployment admin's notice about the Box's users (`deployment_user_invited` / `_registered`):\n * an invitation sent (sender = the inviter) or an account created (sender = the new user). */\nexport function isDeploymentUserNotification(type: string | null | undefined): boolean {\n return type === 'deployment_user_invited' || type === 'deployment_user_registered'\n}\n\n/** The portal origins a \"Manage users\" link may open by default. Anything else gets no button. */\nexport const ALLOWED_PORTAL_ORIGINS: readonly string[] = ['https://portal.arbicity.com']\n\n/** The portal link, only when it is https on an allowed portal origin. */\nexport function safePortalUrl(\n value: unknown,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): string | undefined {\n if (typeof value !== 'string') return undefined\n try {\n const url = new URL(value)\n if (url.protocol !== 'https:' || !origins.includes(url.origin)) return undefined\n return url.href\n } catch {\n return undefined\n }\n}\n\n/** Plaintext content of a deployment-user notification: `{email, user_type, portal_url}`. */\nexport function deploymentUserMeta(\n content: string | null | undefined,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): { email?: string; external: boolean; portalUrl?: string } {\n const meta = parse(content)\n if (!meta) return { external: false }\n const email = typeof meta.email === 'string' && meta.email.trim() ? meta.email.trim() : undefined\n return {\n email,\n external: meta.user_type === 'external',\n portalUrl: safePortalUrl(meta.portal_url, origins),\n }\n}\n\n/** A document's display name, as a document list shows it (its title, else its file name). */\nexport function documentDisplayName(\n doc:\n | { file_name?: string | null; doc_metadata?: { title?: string | null } | null }\n | null\n | undefined\n): string | undefined {\n return doc?.doc_metadata?.title || doc?.file_name || undefined\n}\n\n/** What the work notifications say in a list, where the sender has a column of their own. */\nexport const WORK_NOTIFICATION_LABELS: Readonly<Record<string, string>> = {\n conversation_ready: 'A task is ready',\n conversation_done: 'A task was marked done',\n conversation_notified: 'You were notified in a thread',\n workflow_failed: 'A workflow failed to run',\n}\n\nfunction conversationTarget(n: NotificationResponse): NotificationTarget | undefined {\n if (!n.conversation_ext_id || !CONVERSATION_ID.test(n.conversation_ext_id)) return undefined\n return {\n kind: 'conversation',\n workspaceId: n.workspace_ext_id ?? undefined,\n conversationId: n.conversation_ext_id,\n ...(n.message_ext_id ? { messageId: n.message_ext_id } : {}),\n }\n}\n\n/** The workflows page on the notification's workflow (`{workflow_ext_id}` in its content). */\nfunction workflowTarget(n: NotificationResponse): NotificationTarget {\n const workflowId = parse(n.content)?.workflow_ext_id\n return {\n kind: 'workflows',\n ...(typeof workflowId === 'string' && WORKFLOW_ID.test(workflowId) ? { workflowId } : {}),\n ...(n.workspace_ext_id ? { workspaceId: n.workspace_ext_id } : {}),\n }\n}\n\nfunction signatureTitle(\n n: NotificationResponse,\n senderName: string,\n documentName: DescribeServerNotificationOptions['documentName']\n): string {\n const type = n.type as SignatureNotificationType\n const { documentId } = signatureRequestMeta(n.content)\n const name = documentId ? documentName?.(n.workspace_ext_id, documentId) : undefined\n const fallback = type === 'signature_requested' ? 'a document' : 'your document'\n const { verb, tail } = signatureNotificationPhrase(type, true)\n return `${senderName} ${verb} ${name ?? fallback}${tail}`\n}\n\nfunction quotaPercent(type: string): number | null {\n if (type === 'quota_threshold_100') return 100\n if (type === 'quota_threshold_90') return 90\n if (type === 'quota_threshold_50') return 50\n return null\n}\n\n/**\n * One server notification \u2192 what it says to its recipient and where it leads, or null for\n * types without a sentence here (calendar events, sync completions: they have their own\n * surfaces).\n */\nexport function describeServerNotification(\n n: NotificationResponse,\n options: DescribeServerNotificationOptions = {}\n): ServerNotificationDescription | null {\n const senderName = options.senderName ?? notificationUserName(n.sender)\n const workspace: NotificationTarget | undefined = n.workspace_ext_id\n ? { kind: 'workspace', workspaceId: n.workspace_ext_id }\n : undefined\n const type = n.type as string\n\n if (type === BOX_SEAT_REFUSED) {\n return {\n title: BOX_SEAT_REFUSED_TITLE,\n variant: 'warning',\n actionLabel: BOX_SEAT_REFUSED_ACTION,\n target: { kind: 'seats' },\n }\n }\n const pct = quotaPercent(type)\n if (pct !== null) {\n return {\n title: `You have used ${pct}% of your daily AI limit for this project.`,\n variant: pct === 100 ? 'error' : pct === 90 ? 'warning' : 'info',\n target: { kind: 'projects' },\n }\n }\n\n switch (type) {\n case 'support_ticket_received':\n case 'support_ticket_reviewed':\n case 'support_ticket_resolved': {\n const ticketId = parse(n.content)?.ticket_id\n if (typeof ticketId !== 'number' || !Number.isSafeInteger(ticketId) || ticketId < 1)\n return null\n const suppliedReference = parse(n.content)?.ticket_reference\n const reference =\n typeof suppliedReference === 'string' &&\n /^[a-z0-9-]+-[0-9]+$/.test(suppliedReference) &&\n suppliedReference.endsWith(`-${ticketId}`)\n ? suppliedReference\n : `#${ticketId}`\n return {\n title:\n type === 'support_ticket_received'\n ? `We received support request ${reference}`\n : type === 'support_ticket_reviewed'\n ? `We have reviewed support request ${reference}`\n : `Support request ${reference} is resolved`,\n variant: 'success',\n actionLabel: type === 'support_ticket_resolved' ? 'View outcome' : 'View request',\n target: { kind: 'support', ticketId },\n }\n }\n case 'file_shared': {\n const meta = parse(n.content)\n const id = meta?.file_share_id\n if (typeof id !== 'string' || !/^fsh-[0-9a-f]{32}$/.test(id)) return null\n return {\n title: meta?.declined\n ? `${senderName} declined to sign a file`\n : meta?.completed\n ? 'Everyone has signed. Your PDF is ready.'\n : meta?.signature\n ? `${senderName} asked you to sign a file`\n : `${senderName} shared a file with you`,\n variant: meta?.declined ? 'warning' : meta?.completed ? 'success' : 'info',\n actionLabel: meta?.signature && !meta?.completed ? 'Review and sign' : 'Open file',\n target: { kind: 'url', url: `/shared-files/${id}` },\n }\n }\n // One upload action finished (however many batches it was sent and processed in). A failed\n // document is where it leads when there is one; otherwise the workspace.\n case 'upload_set_complete': {\n const meta = uploadSetMeta(n.content)\n const problems = meta.failed + meta.notUploaded\n const failed = meta.failedDocumentIds\n return {\n title: uploadSetTitle(n.content),\n variant: problems ? 'warning' : 'success',\n ...(failed.length === 1\n ? {\n actionLabel: 'Open failed document',\n target: {\n kind: 'document' as const,\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId: failed[0],\n },\n }\n : { target: workspace }),\n }\n }\n case 'call_missed':\n return {\n title: `Missed call from ${senderName}`,\n variant: 'warning',\n actionLabel: 'Call back',\n target: { kind: 'call-back', user: n.sender },\n }\n case 'native_mail_received':\n return {\n title: 'New email in your encrypted inbox',\n variant: 'info',\n target: { kind: 'mail' },\n }\n case 'mail_draft_ready': {\n const draftId = mailDraftIdFromContent(n.content)\n return {\n title: `${senderName} left a draft email for you to review`,\n variant: 'info',\n target: { kind: 'mail', ...(draftId ? { draftId } : {}) },\n }\n }\n case 'workspaceuser_added_owner':\n return { title: `${senderName} added you as owner`, variant: 'info', target: workspace }\n case 'workspaceuser_added_collaborator':\n return {\n title: `${senderName} added you as collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_added_guest':\n return { title: `${senderName} added you as a viewer`, variant: 'info', target: workspace }\n case 'workspaceuser_removed':\n return { title: `${senderName} removed you from a workspace`, variant: 'warning' }\n case 'workspaceuser_updated_owner':\n return {\n title: `${senderName} changed your role to owner`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_collaborator':\n return {\n title: `${senderName} changed your role to collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_guest':\n return {\n title: `${senderName} changed your role to viewer`,\n variant: 'info',\n target: workspace,\n }\n case 'signature_requested':\n case 'signature_completed':\n case 'signature_declined': {\n const { documentId, version } = signatureRequestMeta(n.content)\n return {\n title: signatureTitle(n, senderName, options.documentName),\n variant:\n type === 'signature_completed'\n ? 'success'\n : type === 'signature_declined'\n ? 'warning'\n : 'info',\n actionLabel: type === 'signature_requested' ? 'Review and sign' : 'Open',\n // A request opens the current version on its PDF, where the banner offers \"Review and\n // sign\"; a completed request opens the signed copy.\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n tab: 'pdf',\n }\n : undefined,\n }\n }\n case 'docx_mention': {\n const { documentId, commentId } = docxMentionMeta(n.content)\n return {\n title: `${senderName} mentioned you in a document comment`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(commentId ? { commentId } : {}),\n }\n : undefined,\n }\n }\n case 'agent_input_requested':\n return { title: inputRequestTitle(n.content), variant: 'info', target: conversationTarget(n) }\n case 'mention':\n return {\n title: `${senderName} mentioned you in a conversation`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'thread_reply':\n return {\n title: `${senderName} replied in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'document_activity': {\n const { documentId, version } = documentActivityMeta(n.content)\n return {\n title: `${senderName} ${documentActivityPhrase(n.content)}`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n }\n : undefined,\n }\n }\n // Each of these opens the thread, so the person it is for finds it. One about your own thread\n // (you started the work) says so.\n case 'conversation_ready':\n return {\n title:\n n.sender.external_id === n.recipient.external_id\n ? 'Your thread is ready'\n : `${senderName}\u2019s thread is ready`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_notified':\n return {\n title: `${senderName} notified you in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_done':\n return {\n title: `${senderName} marked a thread done`,\n variant: 'success',\n target: conversationTarget(n),\n }\n case 'workflow_completed':\n return { title: 'A workflow completed', variant: 'success', target: workflowTarget(n) }\n // The failed run's thread when it has one (its error is there), else the workflow.\n case 'workflow_failed':\n return {\n title: 'A workflow failed to start',\n variant: 'error',\n target: conversationTarget(n) ?? workflowTarget(n),\n }\n case 'deployment_user_invited':\n case 'deployment_user_registered': {\n const { email, external, portalUrl } = deploymentUserMeta(n.content, options.portalOrigins)\n const suffix = external ? ' \u00B7 External' : ''\n return {\n title:\n type === 'deployment_user_invited'\n ? `${senderName} invited ${email ?? 'a new user'}${suffix}`\n : `${email ?? senderName} joined${suffix}`,\n variant: 'info',\n ...(portalUrl && {\n actionLabel: 'Manage users',\n target: { kind: 'url' as const, url: portalUrl },\n }),\n }\n }\n case 'contact_accepted':\n return { title: `${senderName} joined the platform`, variant: 'success', target: workspace }\n case 'workspace_access_request':\n return {\n title: `${senderName} asked for workspace access`,\n variant: 'info',\n // Straight into the review \u2014 granting needs a workspace choice and a role, so a bare\n // \"grant\" action could never be right here.\n target: { kind: 'access-request', notification: n },\n }\n case 'project_quota_warning': {\n let resource = 'usage'\n let percentage: number | null = null\n let upgrade = ''\n let impending = false\n try {\n const data = JSON.parse(n.content ?? '{}')\n resource = data.resource === 'storage_gb' ? 'storage' : 'AI credits'\n if (data.limit > 0) percentage = Math.round((data.used / data.limit) * 100)\n if (data.stage === 'before_upgrade') {\n impending = true\n const charge = new Intl.NumberFormat('en-GB', {\n style: 'currency',\n currency: data.currency || 'GBP',\n }).format(data.charge_ex_vat_pence / 100)\n upgrade = `An automatic ${resource} upgrade will now be attempted: ${charge} ex VAT.`\n } else if (data.automatic_upgrade === true) {\n upgrade =\n ' An automatic upgrade is available within your limit and will be attempted when needed, subject to payment.'\n } else if (data.automatic_upgrade === false) {\n upgrade =\n data.upgrade_reason === 'limit'\n ? ' No automatic upgrade fits your remaining limit. Increase it or add allowances to keep working.'\n : data.upgrade_reason === 'payment'\n ? ' Automatic upgrades are paused. Resolve your payment issue to keep working.'\n : ' Automatic upgrades are unavailable. Upgrade your plan or reduce usage to keep working.'\n }\n } catch {\n /* An old or malformed notice still opens project usage. */\n }\n return {\n title: impending\n ? upgrade\n : `Your project is approaching its ${resource} limit${percentage != null ? ` (${percentage}% used)` : ''}.${upgrade}`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'project_retention': {\n let deadline = ''\n try {\n const data = JSON.parse(n.content ?? '{}')\n if (data.deletion_at) deadline = new Date(data.deletion_at).toLocaleDateString('en-GB')\n } catch {\n /* display the recovery notice without a date */\n }\n return {\n title: `Your project subscription has ended. Export or resubscribe${deadline ? ` before ${deadline}` : ''} to keep its data.`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'storage_quota_exceeded':\n return {\n title:\n 'Your storage is full. Mail still arrives, but new uploads and attachments are paused until you free space or add storage.',\n variant: 'error',\n target: { kind: 'storage' },\n }\n case 'signup_reward':\n return {\n title: n.content ? `\uD83C\uDF89 Signup bonus \u2014 ${n.content}` : '\uD83C\uDF89 You earned a signup bonus!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n case 'referral_reward':\n return {\n title: n.content ? `\uD83C\uDF81 Reward \u2014 ${n.content}` : '\uD83C\uDF81 You earned a reward!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n default:\n return null\n }\n}\n"],
5
+ "mappings": "AAWA,SAAS,8BAA8B;AA6DhC,SAAS,qBAAqB,MAAgC;AACnE,SAAO,CAAC,KAAK,YAAY,KAAK,WAAW,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK,KAAK;AAC/E;AAEA,MAAM,kBAAkB;AACxB,MAAM,cAAc;AACpB,MAAM,cAAc;AAEpB,SAAS,MAAM,SAAoE;AACjF,MAAI;AACF,UAAM,QAAQ,KAAK,MAAM,WAAW,IAAI;AACxC,WAAO,SAAS,OAAO,UAAU,WAAY,QAAoC;AAAA,EACnF,QAAQ;AACN,WAAO;AAAA,EACT;A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EAAE,IAAI,OAAO;AAAA,QACrH,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,KAAK,qBAAqB;AACxB,UAAI,WAAW;AACf,UAAI;AACF,cAAM,OAAO,KAAK,MAAM,EAAE,WAAW,IAAI;AACzC,YAAI,KAAK,YAAa,YAAW,IAAI,KAAK,KAAK,WAAW,EAAE,mBAAmB,OAAO;AAAA,MACxF,QAAQ;AAAA,MAER;AACA,aAAO;AAAA,QACL,OAAO,6DAA6D,WAAW,WAAW,QAAQ,KAAK,EAAE;AAAA,QACzG,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,KAAK;AACH,aAAO;AAAA,QACL,OACE;AAAA,QACF,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,UAAU;AAAA,MAC5B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,iCAAqB,EAAE,OAAO,KAAK;AAAA,QACtD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,2BAAe,EAAE,OAAO,KAAK;AAAA,QAChD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AACE,aAAO;AAAA,EACX;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,5 @@
1
1
  import { get, set, del } from "idb-keyval";
2
+ import { throttle } from "./lib/throttle.js";
2
3
  import {
3
4
  isOfflineReadableArbiQuery,
4
5
  isReplayableArbiMutation,
@@ -19,9 +20,16 @@ const IDB_KEY = "arbi-react-query-cache";
19
20
  const OWNER_KEY = "arbi-react-query-cache-owner";
20
21
  const CACHE_BUSTER = "arbi-rq-v2";
21
22
  const MAX_AGE = 1e3 * 60 * 60 * 24 * 7;
23
+ const PERSIST_THROTTLE_MS = 1e3;
22
24
  function createIDBPersister() {
25
+ const write = throttle((client) => {
26
+ void withStorage(() => set(IDB_KEY, client));
27
+ }, PERSIST_THROTTLE_MS);
28
+ if (typeof window !== "undefined") window.addEventListener("pagehide", () => write.flush());
23
29
  return {
24
- persistClient: (client) => withStorage(() => set(IDB_KEY, client)),
30
+ persistClient: async (client) => {
31
+ write(client);
32
+ },
25
33
  // The offline persister must be INERT when online. Because the documents
26
34
  // list never auto-refetches, a rehydrated copy would be trusted
27
35
  // indefinitely and surface stale statuses across a reload — e.g. a document
@@ -43,7 +51,10 @@ function createIDBPersister() {
43
51
  );
44
52
  return persisted;
45
53
  },
46
- removeClient: () => withStorage(() => del(IDB_KEY))
54
+ removeClient: () => {
55
+ write.cancel();
56
+ return withStorage(() => del(IDB_KEY));
57
+ }
47
58
  };
48
59
  }
49
60
  async function claimOfflineQueue(userExtId) {
@@ -73,6 +84,7 @@ function createArbiQueryPersistOptions() {
73
84
  };
74
85
  }
75
86
  export {
87
+ PERSIST_THROTTLE_MS,
76
88
  claimOfflineQueue,
77
89
  createArbiQueryPersistOptions
78
90
  };