@arbidocs/react 0.5.72 → 0.5.73

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.cts CHANGED
@@ -3901,7 +3901,7 @@ declare function useConversations(workspaceId: string | undefined, options?: {
3901
3901
  } | {
3902
3902
  type: "tabular_review";
3903
3903
  tags: string[];
3904
- documents: "run_uploads" | "workspace" | (string | {
3904
+ documents: "workspace" | "run_uploads" | (string | {
3905
3905
  step?: string | null | undefined;
3906
3906
  input?: string | null | undefined;
3907
3907
  })[];
@@ -6699,7 +6699,7 @@ declare function useConversationItems(): {
6699
6699
  } | {
6700
6700
  type: "tabular_review";
6701
6701
  tags: string[];
6702
- documents: "run_uploads" | "workspace" | (string | {
6702
+ documents: "workspace" | "run_uploads" | (string | {
6703
6703
  step?: string | null | undefined;
6704
6704
  input?: string | null | undefined;
6705
6705
  })[];
@@ -6842,7 +6842,7 @@ declare function useConversationItems(): {
6842
6842
  } | {
6843
6843
  type: "tabular_review";
6844
6844
  tags: string[];
6845
- documents: "run_uploads" | "workspace" | (string | {
6845
+ documents: "workspace" | "run_uploads" | (string | {
6846
6846
  step?: string | null | undefined;
6847
6847
  input?: string | null | undefined;
6848
6848
  })[];
@@ -6986,7 +6986,7 @@ declare function useConversationItems(): {
6986
6986
  } | {
6987
6987
  type: "tabular_review";
6988
6988
  tags: string[];
6989
- documents: "run_uploads" | "workspace" | (string | {
6989
+ documents: "workspace" | "run_uploads" | (string | {
6990
6990
  step?: string | null | undefined;
6991
6991
  input?: string | null | undefined;
6992
6992
  })[];
@@ -7134,7 +7134,7 @@ declare function useWorkItems(): {
7134
7134
  } | {
7135
7135
  type: "tabular_review";
7136
7136
  tags: string[];
7137
- documents: "run_uploads" | "workspace" | (string | {
7137
+ documents: "workspace" | "run_uploads" | (string | {
7138
7138
  step?: string | null | undefined;
7139
7139
  input?: string | null | undefined;
7140
7140
  })[];
@@ -7278,7 +7278,7 @@ declare function useWorkItems(): {
7278
7278
  } | {
7279
7279
  type: "tabular_review";
7280
7280
  tags: string[];
7281
- documents: "run_uploads" | "workspace" | (string | {
7281
+ documents: "workspace" | "run_uploads" | (string | {
7282
7282
  step?: string | null | undefined;
7283
7283
  input?: string | null | undefined;
7284
7284
  })[];
package/dist/index.d.ts CHANGED
@@ -3901,7 +3901,7 @@ declare function useConversations(workspaceId: string | undefined, options?: {
3901
3901
  } | {
3902
3902
  type: "tabular_review";
3903
3903
  tags: string[];
3904
- documents: "run_uploads" | "workspace" | (string | {
3904
+ documents: "workspace" | "run_uploads" | (string | {
3905
3905
  step?: string | null | undefined;
3906
3906
  input?: string | null | undefined;
3907
3907
  })[];
@@ -6699,7 +6699,7 @@ declare function useConversationItems(): {
6699
6699
  } | {
6700
6700
  type: "tabular_review";
6701
6701
  tags: string[];
6702
- documents: "run_uploads" | "workspace" | (string | {
6702
+ documents: "workspace" | "run_uploads" | (string | {
6703
6703
  step?: string | null | undefined;
6704
6704
  input?: string | null | undefined;
6705
6705
  })[];
@@ -6842,7 +6842,7 @@ declare function useConversationItems(): {
6842
6842
  } | {
6843
6843
  type: "tabular_review";
6844
6844
  tags: string[];
6845
- documents: "run_uploads" | "workspace" | (string | {
6845
+ documents: "workspace" | "run_uploads" | (string | {
6846
6846
  step?: string | null | undefined;
6847
6847
  input?: string | null | undefined;
6848
6848
  })[];
@@ -6986,7 +6986,7 @@ declare function useConversationItems(): {
6986
6986
  } | {
6987
6987
  type: "tabular_review";
6988
6988
  tags: string[];
6989
- documents: "run_uploads" | "workspace" | (string | {
6989
+ documents: "workspace" | "run_uploads" | (string | {
6990
6990
  step?: string | null | undefined;
6991
6991
  input?: string | null | undefined;
6992
6992
  })[];
@@ -7134,7 +7134,7 @@ declare function useWorkItems(): {
7134
7134
  } | {
7135
7135
  type: "tabular_review";
7136
7136
  tags: string[];
7137
- documents: "run_uploads" | "workspace" | (string | {
7137
+ documents: "workspace" | "run_uploads" | (string | {
7138
7138
  step?: string | null | undefined;
7139
7139
  input?: string | null | undefined;
7140
7140
  })[];
@@ -7278,7 +7278,7 @@ declare function useWorkItems(): {
7278
7278
  } | {
7279
7279
  type: "tabular_review";
7280
7280
  tags: string[];
7281
- documents: "run_uploads" | "workspace" | (string | {
7281
+ documents: "workspace" | "run_uploads" | (string | {
7282
7282
  step?: string | null | undefined;
7283
7283
  input?: string | null | undefined;
7284
7284
  })[];
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AudioViewer, ImageViewer, VideoViewer } from './chunk-HDCRPPBW.js';
2
2
  import { useUserSettings, invalidateConversationLists, patchConversation, invalidateConversationDetails, removeConversationFromLists, addConversationToList, findConversation, isConversationShared, patchConversationList, useFeature, useAccountClient, useUpdateUserSettings, myChatId, upsertChat, appendToThread, dropFromThread, deleteChatMessage, removeChat, getOpenChat, cachedChat, applyChatEvent, applyCallEvent } from './chunk-M3SB5TZB.js';
3
3
  export { AUDIENCE_CHOICES, CALL_CAPTION_TOPIC, CALL_CHAT_MAX_CHARS, CALL_CHAT_TOPIC, CALL_MODERATION_TOPIC, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, CALL_WEBINAR_TOPIC, CAPTION_MAX_CHARS, COMPOSITE_AUDIO_BITS_PER_SECOND, COMPOSITE_VIDEO_BITS_PER_SECOND, DEFAULT_JOIN_CHOICES, EMPTY_CALL_SESSION, EXPORT_SAMPLE_RATE, HISTORY_LIMIT, LIVE_SEGMENTER, MAX_AVATAR_FILE_BYTES, MUTED_DEDUPE_MS, PLAYBACK_LOOKAHEAD_MS, READ_ONLY_MEETING_TEXT, RECORDING_CHUNK_MS, RECORDING_SEGMENTER, SEGMENT_FRAME_MS, SEGMENT_ID_PATTERN, SEGMENT_PRE_ROLL_MS, SHORT_PIECE_MERGE_GAP_MS, SPEAKER_AUDIO_BITS_PER_SECOND, TrackUploader, UPLOAD_ATTEMPTS, UPLOAD_BACKOFF_MS, acceptRing, addConversationToList, appendToThread, applyAgentDmStatus, applyCallEvent, applyChatEvent, applyChatMessage, applyChatRead, applyChatUpdated, arbiAccountClient, buildMeetingChatBody, cachedChat, cachedChats, callLink, callMemberKeys, callSession, chatByExtId, chatHasLiveCall, chatLiveCallId, chatTranscriptRef, clearMeetingChatCache, clearTrackUploaders, clockTime, compositeFiles, compositeTrack, conversationKeyForCall, createLocalFeatureStore, createMutedNotifier, createTrackCutter, cutAtPauses, declineRing, decodeCallChatPacket, decodeCaptionPacket, decodeMono16k, decryptPart, encodeCallChatPacket, encodeCaptionPacket, encodeWav, encryptPart, ensureMeetingChat, entitlementRefusal, extensionFor, fetchPart, fileSafe, findConversation, floatToWav, formatTranscriptMarkdown, getOpenChat, hasRecordingTranscript, invalidateCall, invalidateConversationDetails, invalidateConversationLists, isConversationListKey, isConversationShared, isRecordingOver, isRecordingSegmentId, isRetryable, isWorkspaceGuestOf, joinFromPreJoin, knownMeetingChat, loadMeetingHistory, markRejoining, meetingChatRefFrom, meetingRefForCall, mergeChatLines, mutedNoticeFromEvent, mutedNoticeFromPacket, mutedNoticeText, myChatId, newPacketId, newSegmentId, newTrackKey, nextSeqAfter, onCallEvent, openCall, openQuestion, openRecording, parseWebinarPacket, partKey, partOffsetMs, partsDue, patchConversation, patchConversationList, persistMeetingMessage, persistTranscriptSegment, playheadAt, postRecordingDocsToThread, postTranscriptToThread, readLocalFeature, recordingFiles, recordingWindowsOf, rejoinAsAudience, removeChat, removeConversationFromLists, resetCallSession, resolveMeetingChat, saveRecordingFilesToThread, schedulePart, sealQuestionText, serverCallsExperimental, setOpenChat, sortTranscriptMessages, sortedParts, speakerTracks, speakerWav, splitIntoFiles, standalone, startChatCall, startContactsCall, startDmCall, startThreadCall, startsMediaFile, storeTranscriptSegment, stripSpeakerPrefix, supersedeLiveTranscript, supersededTranscriptLines, threadHasLiveCall, threadLiveCallId, threadTranscriptLines, threadTranscriptRef, threadTranscriptText, timelineDurationMs, timelineOf, toProfileView, trackUploaderFor, transcribeRecording, transcriptPersistRole, transcriptSegmentOf, unwrapTrackKey, upsertChat, useAccountClient, useAvatarCrop, useCall, useCallInviteLinks, useCallRecording, useCallRecordings, useCallSession, useCallTranscriptionAvailable, useCallsConfig, useCallsEnabled, useCanHostCalls, useEntitlements, useFeature, useFeatureSwitch, useIsEntitled, useMeetingReadOnly, useNameEditor, useOpenCallMeetingChat, useProfile, useRecordingActions, useRecordingWindows, useRevokeCallInviteLink, useSaveToThread, useServerCallsEnabled, useServerCallsExperimental, useUpdateProfile, useUpdateUserSettings, useUserSettings, wrapTrackKey, writeSamples } from './chunk-M3SB5TZB.js';
4
- import { replayableTagMutations, inWorkspace, primeOnClient, patchDocuments, setCachedDocument, adjustTagCounts, patchCachedDocument, FINISHED_DOCUMENT_STATUSES, refreshDocuments, getCachedDocuments, useArbiWsStore, IN_FLIGHT_DOCUMENT_STATUSES, useCapturingWorkspace, QUEUED_WRITE_RETRY, isWorkspaceUnavailable, primeOnArbi, forgetDocuments, useSimilarDocuments, SIMILARITY_THRESHOLD, QUEUED_WRITE_BLOCKED_MESSAGE, isBlockedOnWorkspace, useDocuments, finishEntityExtraction } from './chunk-2LV53J46.js';
4
+ import { replayableTagMutations, inWorkspace, primeOnClient, patchDocuments, setCachedDocument, adjustTagCounts, patchCachedDocument, FINISHED_DOCUMENT_STATUSES, refreshDocuments, getCachedDocuments, useArbiWsStore, IN_FLIGHT_DOCUMENT_STATUSES, useCapturingWorkspace, QUEUED_WRITE_RETRY, isWorkspaceUnavailable, primeOnArbi, forgetDocuments, useDocument, useSimilarDocuments, SIMILARITY_THRESHOLD, QUEUED_WRITE_BLOCKED_MESSAGE, isBlockedOnWorkspace, useDocuments, finishEntityExtraction } from './chunk-2LV53J46.js';
5
5
  export { DISMISSED_TASK_TTL_MS, DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, FINISHED_DOCUMENT_STATUSES, IN_FLIGHT_DOCUMENT_STATUSES, SIMILARITY_THRESHOLD, adjustTagCounts, dropTagFromCachedDocuments, finishEntityExtraction, forgetDocuments, getCachedDocuments, invalidateTagData, invalidateTagTables, isDocumentsLoading, isRowNewer, isStaleTaskUpdate, patchCachedDocument, patchDocuments, patchWorkspaceTags, refreshDocuments, resolveDocumentStatus, setCachedDocument, settledByRows, startEntityExtraction, stopDocumentsLoading, subscribeDocumentRows, upsertDocuments, useArbiWsStore, useCreateTag, useDeleteTag, useDocument, useDocuments, useDocumentsById, useDocumentsLoading, useEntityExtractionDocIds, useExtractEntities, useInvalidateTagData, useIsCreatingTag, useRefreshDocuments, useSetTagValues, useSimilarDocuments, useTagKindSchema, useUpdateTag, useUpdateTagKindSchema } from './chunk-2LV53J46.js';
6
6
  import { useArbiSessionState, useArbiSession, useWorkspaces, useConversations, useConfig, useArbiSessionStore, useAvailableModels, useParsedDocument, useTags, selectDraft, useConversationThreads, createArbiSessionStore, useTransientView, useProjects, useAgents, useAssistantQuery, useActivity, queuedMessages, MIN_QUEUED_MESSAGE_VISIBILITY_MS } from './chunk-QGOYIYLI.js';
7
7
  export { DEFAULT_DOCUMENT_VIEWER_STATE, EMPTY_SESSION_STATE, MAX_THREAD_TABS, MIN_QUEUED_MESSAGE_VISIBILITY_MS, PROJECT_CREATION_DENIED_REASON, WORKSPACE_LAST_OPENED_KEY, WORKSPACE_STORAGE_KEY, agentControl, browserWorkspaceStorage, clearSealedDrafts, closePanelIn, conversationKey, createArbiLayoutStore, createArbiSessionStore, createArbiWorkspaceStore, createDebouncedWriter, createSealedDraftStorage, createStoragePersist, defaultLayoutState, dmTabId, flushOnPageExit, isPanelOpen, isUsageMetered, layoutActionsOf, nextViewingDocument, openPanelIn, panelPlace, parseSavedLayout, queuedMessages, readWorkspaceLastOpened, restoreLayout, savedLayoutOf, selectDraft, selectIsGenerating, selectViewingDocumentId, threadTabId, useActivity, useAgents, useArbiSession, useArbiSessionState, useArbiSessionStore, useAssistantQuery, useAvailableModels, useBoxRole, useBuiltinCommands, useCanCreateProjects, useConfig, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocumentVersionList, useFirmPool, useHealth, useMessageDetails, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSessionPageTab, useSessionView, useSignedInSession, useTags, useThumbnails, useTopUpFirmPool, useTransientView, useUserUsageToday, useWorkspaceActivity, useWorkspaces } from './chunk-QGOYIYLI.js';
@@ -2504,6 +2504,13 @@ function DocumentCardMenu({
2504
2504
  ] })
2505
2505
  ] });
2506
2506
  }
2507
+ var PARSED_STATUSES = /* @__PURE__ */ new Set(["completed", "low-content"]);
2508
+ function noTextMessage(status) {
2509
+ if (status === "failed")
2510
+ return "This document could not be processed, so it has no text to review.";
2511
+ if (status === "empty" || status === "skipped") return "No readable content.";
2512
+ return "Still processing. The text appears here when it is ready.";
2513
+ }
2507
2514
  function DocumentReview({
2508
2515
  docId,
2509
2516
  doc,
@@ -2513,7 +2520,19 @@ function DocumentReview({
2513
2520
  onClose,
2514
2521
  className
2515
2522
  }) {
2516
- const parsedQuery = useParsedDocument(docId, stage);
2523
+ const processingInProp = !!doc?.status && !FINISHED_DOCUMENT_STATUSES.has(doc.status);
2524
+ const { data: polled } = useDocument(docId, {
2525
+ enabled: processingInProp,
2526
+ pollWhileProcessing: true
2527
+ });
2528
+ const status = processingInProp ? polled?.status ?? doc?.status : doc?.status;
2529
+ const noTextYet = stage === "final" && !!status && !PARSED_STATUSES.has(status);
2530
+ const parsedQuery = useParsedDocument(docId, stage, { enabled: !noTextYet });
2531
+ const { isError: parsedFailed, refetch: refetchParsed } = parsedQuery;
2532
+ const readable = !!status && !noTextYet;
2533
+ React.useEffect(() => {
2534
+ if (readable && parsedFailed) void refetchParsed();
2535
+ }, [readable]);
2517
2536
  const tagsQuery = useTags(workspaceId);
2518
2537
  const tagNameById = React.useMemo(() => {
2519
2538
  const map = /* @__PURE__ */ new Map();
@@ -2577,11 +2596,11 @@ function DocumentReview({
2577
2596
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
2578
2597
  /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-semibold", title, children: title }),
2579
2598
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground", children: [
2580
- parsedQuery.data?.metadata?.total_number_of_pages ? `${parsedQuery.data.metadata.total_number_of_pages} pages` : `${pages.length} pages`,
2599
+ noTextYet ? "" : parsedQuery.data?.metadata?.total_number_of_pages ? `${parsedQuery.data.metadata.total_number_of_pages} pages` : `${pages.length} pages`,
2581
2600
  findings.length ? ` \xB7 ${findings.length} findings` : ""
2582
2601
  ] })
2583
2602
  ] }),
2584
- doc?.status ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: doc.status }) : null,
2603
+ status ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: status }) : null,
2585
2604
  onClose ? /* @__PURE__ */ jsx(
2586
2605
  "button",
2587
2606
  {
@@ -2634,7 +2653,14 @@ function DocumentReview({
2634
2653
  ]
2635
2654
  }
2636
2655
  ) : null,
2637
- /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "min-w-0 flex-1 overflow-y-auto px-6 py-4", children: parsedQuery.isLoading ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-sm text-muted-foreground", children: "Loading document\u2026" }) : parsedQuery.isError ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-sm text-muted-foreground", children: "Could not load this document\u2019s content." }) : pages.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-sm text-muted-foreground", children: "No readable content." }) : /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl space-y-8", children: pages.map(([pageNum, chunks]) => /* @__PURE__ */ jsxs("section", { children: [
2656
+ /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "min-w-0 flex-1 overflow-y-auto px-6 py-4", children: noTextYet ? /* @__PURE__ */ jsx(
2657
+ "div",
2658
+ {
2659
+ className: "flex h-full items-center justify-center text-sm text-muted-foreground",
2660
+ "data-testid": "document-review-no-text",
2661
+ children: noTextMessage(status)
2662
+ }
2663
+ ) : parsedQuery.isLoading ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-sm text-muted-foreground", children: "Loading document\u2026" }) : parsedQuery.isError ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-sm text-muted-foreground", children: "Could not load this document\u2019s content." }) : pages.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center text-sm text-muted-foreground", children: "No readable content." }) : /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl space-y-8", children: pages.map(([pageNum, chunks]) => /* @__PURE__ */ jsxs("section", { children: [
2638
2664
  /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center gap-3", children: [
2639
2665
  /* @__PURE__ */ jsxs("span", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: [
2640
2666
  "Page ",