@arbidocs/react 0.4.159 → 0.4.161
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/README.md +13 -6
- package/dist/{ProductionDialog-Dhf9MXH-.d.cts → ProductionDialog.d-BD1osHeq.d.cts} +1 -1
- package/dist/{ProductionDialog-BvRVGdvH.d.ts → ProductionDialog.d-CttHqQAh.d.ts} +1 -1
- package/dist/annotations/freeze/index.d.cts +3 -3
- package/dist/annotations/freeze/index.d.ts +3 -3
- package/dist/annotations/index.d.cts +4 -4
- package/dist/annotations/index.d.ts +4 -4
- package/dist/artifacts/index.cjs +12 -11
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.cts +4 -4
- package/dist/artifacts/index.d.ts +4 -4
- package/dist/artifacts/index.js +3 -2
- package/dist/artifacts/index.js.map +1 -1
- package/dist/{chunk-RDLAOB55.cjs → chunk-3LMX6GXR.cjs} +150 -14
- package/dist/chunk-3LMX6GXR.cjs.map +1 -0
- package/dist/{chunk-37TQBT7Y.cjs → chunk-6MTKKT2O.cjs} +188 -126
- package/dist/chunk-6MTKKT2O.cjs.map +1 -0
- package/dist/{chunk-HKIR456G.js → chunk-CEZCFQ47.js} +149 -92
- package/dist/chunk-CEZCFQ47.js.map +1 -0
- package/dist/chunk-CPZ36AQS.js +11 -0
- package/dist/chunk-CPZ36AQS.js.map +1 -0
- package/dist/{chunk-JFKWH6EP.cjs → chunk-EUC2BTNS.cjs} +35 -4
- package/dist/chunk-EUC2BTNS.cjs.map +1 -0
- package/dist/chunk-GTJ667CP.cjs +26 -0
- package/dist/chunk-GTJ667CP.cjs.map +1 -0
- package/dist/{chunk-3XYIQZTH.js → chunk-I5ZBQ63Y.js} +33 -5
- package/dist/chunk-I5ZBQ63Y.js.map +1 -0
- package/dist/chunk-JSSKEXRR.js +22 -0
- package/dist/chunk-JSSKEXRR.js.map +1 -0
- package/dist/{chunk-QKNJ6FRD.cjs → chunk-ON4PL6DQ.cjs} +4 -4
- package/dist/chunk-ON4PL6DQ.cjs.map +1 -0
- package/dist/chunk-RCKA7BEF.cjs +14 -0
- package/dist/chunk-RCKA7BEF.cjs.map +1 -0
- package/dist/{chunk-2HNEVAXO.js → chunk-SVHGCX25.js} +3 -3
- package/dist/chunk-SVHGCX25.js.map +1 -0
- package/dist/{chunk-CNGWJDMG.js → chunk-WOXITGVS.js} +139 -15
- package/dist/chunk-WOXITGVS.js.map +1 -0
- package/dist/document-tools/index.cjs +35 -34
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +4 -4
- package/dist/document-tools/index.d.ts +4 -4
- package/dist/document-tools/index.js +4 -3
- package/dist/document-tools/index.js.map +1 -1
- package/dist/index.cjs +1694 -1432
- package/dist/index.cjs.map +1 -1
- package/dist/{index-DyFzmDZ2.d.ts → index.d-DfCFKora.d.cts} +49 -5
- package/dist/{index-DyFzmDZ2.d.cts → index.d-DfCFKora.d.ts} +49 -5
- package/dist/{index-CDTwtUr9.d.cts → index.d-eRbU1qpQ.d.cts} +333 -196
- package/dist/{index-CDTwtUr9.d.ts → index.d-eRbU1qpQ.d.ts} +333 -196
- package/dist/index.d.cts +1797 -1504
- package/dist/index.d.ts +1797 -1504
- package/dist/index.js +928 -765
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +24 -15
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +2 -1
- package/dist/ui/index.cjs +191 -142
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +2 -1
- package/dist/viewers/index.cjs +3 -2
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +2 -2
- package/dist/viewers/index.d.ts +2 -2
- package/dist/viewers/index.js +2 -1
- package/dist/viewers/index.js.map +1 -1
- package/package.json +4 -6
- package/dist/chunk-2HNEVAXO.js.map +0 -1
- package/dist/chunk-37TQBT7Y.cjs.map +0 -1
- package/dist/chunk-3XYIQZTH.js.map +0 -1
- package/dist/chunk-CNGWJDMG.js.map +0 -1
- package/dist/chunk-CPPBN2JB.js +0 -31
- package/dist/chunk-CPPBN2JB.js.map +0 -1
- package/dist/chunk-HKIR456G.js.map +0 -1
- package/dist/chunk-JFKWH6EP.cjs.map +0 -1
- package/dist/chunk-QKNJ6FRD.cjs.map +0 -1
- package/dist/chunk-R2MF7YCW.cjs +0 -36
- package/dist/chunk-R2MF7YCW.cjs.map +0 -1
- package/dist/chunk-RDLAOB55.cjs.map +0 -1
- /package/dist/{PdfViewer-bQH9yxFg.d.cts → PdfViewer.d-bQH9yxFg.d.cts} +0 -0
- /package/dist/{PdfViewer-bQH9yxFg.d.ts → PdfViewer.d-bQH9yxFg.d.ts} +0 -0
- /package/dist/{bundle-BnCSbHy2.d.cts → bundle.d-BnCSbHy2.d.cts} +0 -0
- /package/dist/{bundle-BnCSbHy2.d.ts → bundle.d-BnCSbHy2.d.ts} +0 -0
- /package/dist/{model-D63gedpb.d.cts → model.d-D63gedpb.d.cts} +0 -0
- /package/dist/{model-D63gedpb.d.ts → model.d-D63gedpb.d.ts} +0 -0
- /package/dist/{stored-markdown-Bp18vrbr.d.cts → stored-markdown.d-Bp18vrbr.d.cts} +0 -0
- /package/dist/{stored-markdown-Bp18vrbr.d.ts → stored-markdown.d-Bp18vrbr.d.ts} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { b as ArbiHostConnection, H as HostConfigRecord, c as ArbiHostProps, j as SearchStatus, S as SearchSession, h as NotifyVariant } from './index.d-DfCFKora.cjs';
|
|
2
|
+
export { A as AppNotification, D as DEFAULT_NOTIFY_TONE, M as MAX_SESSION_NOTIFICATIONS, N as NotificationBell, d as NotificationBellProps, e as NotificationBellTriggerState, f as NotifyConfig, g as NotifyOptions, i as SearchSessionState, T as Toaster, k as clearSearchSession, l as configureNotify, m as createSearchSession, n as notify, p as persistNotifyHistory, o as persistSearchSession, r as requestSearch, s as seedNotifications, q as selectUnread, t as sharedSearchSession, u as takePendingSearch, v as useHostConfigRecord, w as useNotify } from './index.d-DfCFKora.cjs';
|
|
3
3
|
import * as _arbidocs_sdk_browser from '@arbidocs/sdk/browser';
|
|
4
|
-
import { Arbi,
|
|
4
|
+
import { LoginProfile, Arbi, EventCreateBody, ScopedTarget, EventPatchBody, RespondParams, QueryOptions, SSEStreamResult, SSEStreamStartData, UserMessageEvent, MessageMetadataPayload, ResponseOutputItemDoneEvent, ArtifactEvent, TagListQuery, ListFactsOptions, UpdateFactRequest, StepActionRequest, UpdateConversationRequest, UpdateWorkflowRequest, tags, TagResponse, TagKind, TagKindSchema, TagChange, TagFieldDefinition, ProjectEventKind, ProjectUpdateRequest, ProjectResponse, ProjectCreateOptions, ProjectAddonKind, ProjectPlanChangeRequest, ProjectCheckoutRequest, ProjectQuoteRequest, ProjectAddonSettingsRequest, ProjectNextPeriodAddonsRequest, contacts, settings, account, ListEventsParams, RoomQuery, CalendarWindow, OverlayLayerName, RoomCreateBody, CalendarEvent, FindTimeParams, ShareRole, CalendarUpdate, OAuthAccountKind, CalendarAccount, CalDavConnectBody, SearchChunk, DecryptedChatMessage as DecryptedChatMessage$1, chats, UploadDocumentsOptions, UploadResult } from '@arbidocs/sdk/browser';
|
|
5
5
|
export { ACCOUNT_VENDOR, AccountSyncResult, ActivityKind, ActivityResponse, AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, AttendeeRead, AuthMode, BookingConfirmation, BookingPage, BookingPageWriteBody, BookingRequestBody, BridgeTokensOptions, CalDavConnectBody, CalDavProfile, CalendarAccount, CalendarAccountKind, CalendarCreateBody, CalendarEvent, CalendarRead, CalendarSettings, CalendarSettingsBody, CalendarUpdate, CalendarWindow, ConnectorCatalogEntry, ConnectorFolder, ConnectorSyncProgress, ConnectorSyncStatus, ConnectorVendorKey, ConnectorVisibilitySettings, ConversationResponse, CreateFactRequest, CreateWorkRequest, CreateWorkflowRequest, DEFAULT_AI_USD_PER_GBP, DRIVE_SYNC_VENDORS, DateTimeSpec, DriveSyncProgress, DriveSyncSummary, EditScope, EventCreateBody, EventPatchBody, FactResponse, FactSearchRequest, FactSearchResponse, FindTimeParams, FreeBusyEntry, GOOGLE_VENDORS, HolidayCountry, IMANAGE_VENDORS, ImportResult, InvitationRead, ListEventsParams, LoginProfile, MAILBOX_SYNC_VENDORS, MAX_RETRIEVE_DOC_IDS, MICROSOFT_VENDORS, MessageMetadataPayload, OAuthAccountKind, OutputTokensDetails, OverlayItem, OverlayLayerName, PendingAuthResponse, PersonKey, PlanWorkRequest, ProductResponse, ProjectAddonKind, ProjectCheckoutRequest, ProjectInvoicesResponse, ProjectPlanChangeRequest, ProjectQuoteRequest, ProjectResponse, ProjectUsageResponse, PublicBookingError, PublicBookingPage, QueryOptions, RespondParams, RespondPartstat, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, RoomCreateBody, RoomQuery, RoomRead, SHAREPOINT_VENDORS, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, ScopedTarget, SearchChunk, ShareRead, ShareRole, SkillSummary, SlackConnectionStatus, SubscribeParams, SyncTriggerResult, TaskPlan, TaxQuoteResponse, TimeSuggestion, UpdateConversationRequest, UpdateWorkflowRequest, UserConnectorEntry, UserDailyUsageResponse, UserInputRequestEvent, UserMessageEvent, WeeklyHoursSpec, WorkStatus, WorkflowAuthMode, WorkflowResponse, WorkflowRunResponse, bookPublicSlot, cancelPublicBooking, connectErrorMessage, formatGbp, formatGbpPerMillionTokens, getPublicBookingPage, isConnectorVendorVisible, isDriveSyncVendor, isMailboxSyncVendor, isSharePointVendor, usdToGbp } from '@arbidocs/sdk/browser';
|
|
6
6
|
import * as _arbidocs_client from '@arbidocs/client';
|
|
7
|
-
import { WebSocketServerMessage, WsTaskUpdateMessage, WsPresenceUpdateMessage,
|
|
7
|
+
import { components, WebSocketServerMessage, WsTaskUpdateMessage, WsPresenceUpdateMessage, ArbiClient, RecoveryKeyParams, WsAgentDmStatusMessage } from '@arbidocs/client';
|
|
8
8
|
export { WebSocketServerMessage, WsBatchCompleteMessage, WsConversationMessagePostedMessage, WsNotificationResponse, WsPresenceUpdateMessage, WsResponseCompleteMessage, WsTaskUpdateMessage, isMessageType } from '@arbidocs/client';
|
|
9
|
-
import
|
|
9
|
+
import { au as IdentityStatus, as as IdentityPurchase, av as IdentityStep, aw as IdentityVerificationFlow, U as DictateContextValue, af as EntityIconComponent } from './index.d-eRbU1qpQ.cjs';
|
|
10
|
+
export { A as AgentBadge, a as AiMarkdown, b as ArbiIcon, c as Avatar, d as AvatarFallback, e as AvatarImage, B as BASE_COLORS, f as Badge, g as BadgeProps, h as Button, i as ButtonProps, C as COLUMN_LABEL_FALLBACKS, j as Card, k as CardContent, l as CardDescription, m as CardFooter, n as CardHeader, o as CardProps, p as CardTitle, q as Checkbox, r as Collapsible, s as CollapsibleContent, t as CollapsibleTrigger, u as Command, v as CommandDialog, w as CommandEmpty, x as CommandGroup, y as CommandInput, z as CommandItem, D as CommandList, E as CommandSeparator, F as CommandShortcut, G as DEFAULT_METADATA_TAGS, H as DebouncedInput, I as DebouncedInputProps, J as Dialog, K as DialogClose, L as DialogContent, M as DialogDescription, N as DialogFooter, O as DialogHeader, P as DialogOverlay, Q as DialogPortal, R as DialogPresentation, S as DialogTitle, T as DialogTrigger, V as DocumentCard, W as DocumentCardProps, X as DocumentEntity, Y as DocumentEntityProps, Z as DocumentLike, _ as DropdownMenu, $ as DropdownMenuCheckboxItem, a0 as DropdownMenuContent, a1 as DropdownMenuGroup, a2 as DropdownMenuItem, a3 as DropdownMenuLabel, a4 as DropdownMenuPortal, a5 as DropdownMenuRadioGroup, a6 as DropdownMenuRadioItem, a7 as DropdownMenuSeparator, a8 as DropdownMenuShortcut, a9 as DropdownMenuSub, aa as DropdownMenuSubContent, ab as DropdownMenuSubTrigger, ac as DropdownMenuTrigger, ad as ENTITY_MAPPINGS, ae as EntityIcon, ag as EntityPill, ah as EntityRegistryOverride, ai as EntityType, aj as FileTypeIcon, ak as FolderTreeNode, al as HoverCard, am as HoverCardContent, an as HoverCardTrigger, ao as IconToggle, ap as IconToggleProps, aq as IdentityBusy, ar as IdentityProblem, at as IdentityState, ax as Input, ay as InputProps, az as Label, aA as MarkMenu, aB as MarkMenuItem, aC as MarkMenuProps, aD as MarkdownCode, aE as MarkdownLink, aF as MarkdownRenderer, aG as MarkdownRendererProps, aH as MarkdownStreamingContext, aI as NEUTRAL_GRAY, aJ as PLACEHOLDER_COLOR, aK as PassageCard, aL as PassageCardProps, aM as Popover, aN as PopoverAnchor, aO as PopoverClose, aP as PopoverContent, aQ as PopoverTrigger, aR as PortalContainerProvider, aS as PresenceDisplayStatus, aT as PresenceLabel, aU as Progress, aV as ProjectEntity, aW as ProjectEntityProps, aX as ProjectRelation, aY as RadioGroup, aZ as RadioGroupItem, a_ as Rag, a$ as RagDot, b0 as RelevanceDot, b1 as ScrollArea, b2 as ScrollBar, b3 as Select, b4 as SelectContent, b5 as SelectGroup, b6 as SelectItem, b7 as SelectLabel, b8 as SelectScrollDownButton, b9 as SelectScrollUpButton, ba as SelectSeparator, bb as SelectTrigger, bc as SelectValue, bd as Separator, be as ShieldIcon, bf as ShieldIconProps, bg as Slider, bh as StatusBadgeComponent, bi as StatusBadgeProps, bj as StatusPill, bk as StatusPillProps, bl as StatusVariant, bm as Switch, bn as TAG_TYPE_ICONS, bo as TAG_TYPE_LABELS, bp as Table, bq as TableBody, br as TableCaption, bs as TableCell, bt as TableFooter, bu as TableHead, bv as TableHeader, bw as TableRow, bx as Tabs, by as TabsContent, bz as TabsList, bA as TabsTrigger, bB as TagEntity, bC as TagEntityProps, bD as TagLike, bE as Textarea, bF as TextareaProps, bG as ThreadVisibilityIcon, bH as Toggle, bI as ToggleGroup, bJ as ToggleGroupItem, bK as Tooltip, bL as TooltipContent, bM as TooltipProvider, bN as TooltipTrigger, bO as UserEntity, bP as UserEntityProps, bQ as UserMenu, bR as UserMenuItem, bS as UserMenuProps, bT as UserMenuStatus, bU as VISIBILITY_ICONS, bV as VerifiedBadge, bW as VerifiedBadgeProps, bX as VerifiedToggle, bY as VisibilityIcon, bZ as VisibilityToggle, b_ as VisibilityToggleProps, b$ as agentAvatarColors, c0 as badgeVariants, c1 as buildFolderTree, c2 as buttonVariants, c3 as canonicalFolderPath, c4 as cardVariants, c5 as closeOpenEmphasis, c6 as cn, c7 as configureEntityRegistry, c8 as configureRagLabels, c9 as configureStatusRegistry, ca as createUserAvatarIcon, cb as extensionFromMime, cc as formatDocDate, cd as formatFolderLabel, ce as formatFriendlyDate, cf as friendlyFileType, cg as getDocIcon, ch as getDocumentAuthor, ci as getDocumentDate, cj as getDocumentNature, ck as getDocumentSubject, cl as getDocumentTitle, cm as getEntityColor, cn as getEntityColorStyles, co as getEntityIcon, cp as getEntityLabel, cq as getFileExtension, cr as getFileTypeIcon, cs as getStatusVariant, ct as getTagTypeIcon, cu as getTagTypeLabel, cv as getUserAvatarColor, cw as getUserDisplayName, cx as getUserInitials, cy as getWorkspaceColor, cz as isAgent, cA as isAudioFile, cB as isDocumentAddableToConversation, cC as isDownloadOnlyFile, cD as isImageDocument, cE as isImageFile, cF as isMediaFile, cG as isVideoFile, cH as markdownBaseComponents, cI as markdownSanitizeSchema, cJ as markdownToPlainText, cK as markdownToPlainTextBlocks, cL as normalizeCitationMarkup, cM as splitMarkdownBlocks, cN as tagKindNouns, cO as tagKindTitle, cP as toggleVariants, cQ as trimOpenCitation, cR as useDictateContext, cS as usePortalContainer, cT as usesOriginalBytesForViewer } from './index.d-eRbU1qpQ.cjs';
|
|
10
11
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
11
12
|
import { QueryClient, QueryKey, MutationKey } from '@tanstack/react-query';
|
|
13
|
+
import * as React$1 from 'react';
|
|
14
|
+
import React__default, { ReactNode, ComponentType } from 'react';
|
|
15
|
+
import * as zustand from 'zustand';
|
|
12
16
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
13
|
-
import { as as IdentityStatus, aq as IdentityPurchase, at as IdentityStep, au as IdentityVerificationFlow, ae as EntityIconComponent } from './index-CDTwtUr9.cjs';
|
|
14
|
-
export { A as AgentBadge, a as AiMarkdown, b as ArbiIcon, c as Avatar, d as AvatarFallback, e as AvatarImage, B as BASE_COLORS, f as Badge, g as BadgeProps, h as Button, i as ButtonProps, C as Card, j as CardContent, k as CardDescription, l as CardFooter, m as CardHeader, n as CardProps, o as CardTitle, p as Checkbox, q as Collapsible, r as CollapsibleContent, s as CollapsibleTrigger, t as Command, u as CommandDialog, v as CommandEmpty, w as CommandGroup, x as CommandInput, y as CommandItem, z as CommandList, D as CommandSeparator, E as CommandShortcut, F as DebouncedInput, G as DebouncedInputProps, H as Dialog, I as DialogClose, J as DialogContent, K as DialogDescription, L as DialogFooter, M as DialogHeader, N as DialogOverlay, O as DialogPortal, P as DialogPresentation, Q as DialogTitle, R as DialogTrigger, S as DictateContextValue, T as DictateProvider, U as DocumentCard, V as DocumentCardProps, W as DocumentEntity, X as DocumentEntityProps, Y as DocumentLike, Z as DropdownMenu, _ as DropdownMenuCheckboxItem, $ as DropdownMenuContent, a0 as DropdownMenuGroup, a1 as DropdownMenuItem, a2 as DropdownMenuLabel, a3 as DropdownMenuPortal, a4 as DropdownMenuRadioGroup, a5 as DropdownMenuRadioItem, a6 as DropdownMenuSeparator, a7 as DropdownMenuShortcut, a8 as DropdownMenuSub, a9 as DropdownMenuSubContent, aa as DropdownMenuSubTrigger, ab as DropdownMenuTrigger, ac as ENTITY_MAPPINGS, ad as EntityIcon, af as EntityPill, ag as EntityRegistryOverride, ah as EntityType, ai as FileTypeIcon, aj as HoverCard, ak as HoverCardContent, al as HoverCardTrigger, am as IconToggle, an as IconToggleProps, ao as IdentityBusy, ap as IdentityProblem, ar as IdentityState, av as Input, aw as InputProps, ax as Label, ay as MarkMenu, az as MarkMenuItem, aA as MarkMenuProps, aB as MarkdownCode, aC as MarkdownLink, aD as MarkdownRenderer, aE as MarkdownRendererProps, aF as MarkdownStreamingContext, aG as NEUTRAL_GRAY, aH as PLACEHOLDER_COLOR, aI as PassageCard, aJ as PassageCardProps, aK as Popover, aL as PopoverAnchor, aM as PopoverClose, aN as PopoverContent, aO as PopoverTrigger, aP as PortalContainerProvider, aQ as PresenceDisplayStatus, aR as PresenceLabel, aS as Progress, aT as ProjectEntity, aU as ProjectEntityProps, aV as ProjectRelation, aW as RadioGroup, aX as RadioGroupItem, aY as Rag, aZ as RagDot, a_ as RelevanceDot, a$ as ScrollArea, b0 as ScrollBar, b1 as Select, b2 as SelectContent, b3 as SelectGroup, b4 as SelectItem, b5 as SelectLabel, b6 as SelectScrollDownButton, b7 as SelectScrollUpButton, b8 as SelectSeparator, b9 as SelectTrigger, ba as SelectValue, bb as Separator, bc as ShieldIcon, bd as ShieldIconProps, be as Slider, bf as StatusBadgeComponent, bg as StatusBadgeProps, bh as StatusPill, bi as StatusPillProps, bj as StatusVariant, bk as Switch, bl as TAG_TYPE_ICONS, bm as TAG_TYPE_LABELS, bn as Table, bo as TableBody, bp as TableCaption, bq as TableCell, br as TableFooter, bs as TableHead, bt as TableHeader, bu as TableRow, bv as Tabs, bw as TabsContent, bx as TabsList, by as TabsTrigger, bz as TagEntity, bA as TagEntityProps, bB as TagLike, bC as Textarea, bD as TextareaProps, bE as ThreadVisibilityIcon, bF as Toggle, bG as ToggleGroup, bH as ToggleGroupItem, bI as Tooltip, bJ as TooltipContent, bK as TooltipProvider, bL as TooltipTrigger, bM as UserEntity, bN as UserEntityProps, bO as UserMenu, bP as UserMenuItem, bQ as UserMenuProps, bR as UserMenuStatus, bS as VISIBILITY_ICONS, bT as VerifiedBadge, bU as VerifiedBadgeProps, bV as VerifiedToggle, bW as VisibilityIcon, bX as VisibilityToggle, bY as VisibilityToggleProps, bZ as agentAvatarColors, b_ as badgeVariants, b$ as buttonVariants, c0 as cardVariants, c1 as closeOpenEmphasis, c2 as cn, c3 as configureEntityRegistry, c4 as configureRagLabels, c5 as configureStatusRegistry, c6 as createUserAvatarIcon, c7 as extensionFromMime, c8 as formatFriendlyDate, c9 as friendlyFileType, ca as getDocIcon, cb as getDocumentTitle, cc as getEntityColor, cd as getEntityColorStyles, ce as getEntityIcon, cf as getEntityLabel, cg as getFileExtension, ch as getFileTypeIcon, ci as getStatusVariant, cj as getTagTypeIcon, ck as getTagTypeLabel, cl as getUserAvatarColor, cm as getUserDisplayName, cn as getUserInitials, co as getWorkspaceColor, cp as isAgent, cq as isAudioFile, cr as isDownloadOnlyFile, cs as isImageDocument, ct as isImageFile, cu as isMediaFile, cv as isVideoFile, cw as markdownBaseComponents, cx as markdownSanitizeSchema, cy as normalizeCitationMarkup, cz as splitMarkdownBlocks, cA as tagKindNouns, cB as tagKindTitle, cC as toggleVariants, cD as trimOpenCitation, cE as useDictateContext, cF as usePortalContainer, cG as usesOriginalBytesForViewer } from './index-CDTwtUr9.cjs';
|
|
15
17
|
import { VerificationResult } from '@didit-protocol/sdk-web';
|
|
16
18
|
import { LucideIcon } from 'lucide-react';
|
|
17
19
|
import { Components } from 'react-markdown';
|
|
18
|
-
export { D as DraftCleanReport, a as DraftCleanStage, c as cleanDraftMarkdown, b as cleanDraftWithReport, p as promoteBoldTitle, r as repairParsedStructure, d as repairParsedTitle, s as stripAgentPreamble, u as unescapeMarkdown, e as unwrapCitationLinks } from './stored-markdown-Bp18vrbr.cjs';
|
|
19
|
-
import { g as SearchStatus, S as SearchSession, e as NotifyVariant } from './index-DyFzmDZ2.cjs';
|
|
20
|
-
export { A as AppNotification, D as DEFAULT_NOTIFY_TONE, M as MAX_SESSION_NOTIFICATIONS, N as NotificationBell, a as NotificationBellProps, b as NotificationBellTriggerState, c as NotifyConfig, d as NotifyOptions, f as SearchSessionState, T as Toaster, h as clearSearchSession, i as configureNotify, j as createSearchSession, n as notify, p as persistNotifyHistory, k as persistSearchSession, r as requestSearch, s as seedNotifications, l as selectUnread, m as sharedSearchSession, t as takePendingSearch, u as useNotify } from './index-DyFzmDZ2.cjs';
|
|
21
|
-
import { ColDef } from 'ag-grid-community';
|
|
20
|
+
export { D as DraftCleanReport, a as DraftCleanStage, c as cleanDraftMarkdown, b as cleanDraftWithReport, p as promoteBoldTitle, r as repairParsedStructure, d as repairParsedTitle, s as stripAgentPreamble, u as unescapeMarkdown, e as unwrapCitationLinks } from './stored-markdown.d-Bp18vrbr.cjs';
|
|
22
21
|
export { ToasterProps, toast } from 'sonner';
|
|
22
|
+
import 'zustand/vanilla';
|
|
23
23
|
import 'clsx';
|
|
24
24
|
import '@radix-ui/react-avatar';
|
|
25
25
|
import 'class-variance-authority/types';
|
|
@@ -41,343 +41,1243 @@ import '@radix-ui/react-tabs';
|
|
|
41
41
|
import '@radix-ui/react-toggle';
|
|
42
42
|
import '@radix-ui/react-toggle-group';
|
|
43
43
|
import 'rehype-sanitize';
|
|
44
|
-
import 'zustand/vanilla';
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Identity verification: the optional, paid ID check behind the verified tick (Pro plans only).
|
|
47
|
+
*
|
|
48
|
+
* Two layers, like `profile.ts`. `useIdentityVerificationFlow` owns the dialog's state and takes
|
|
49
|
+
* the backend calls as functions, so an app with its own API layer (ARBI-frontend) binds the same
|
|
50
|
+
* `IdentityVerificationCard` / `IdentityVerificationDialog` blocks without a provider.
|
|
51
|
+
* `useIdentityVerification` binds it to the SDK (`arbi.identity`).
|
|
52
|
+
*
|
|
53
|
+
* Steps: pay the one-time fee (charged to the user's Pro project card) → verify inside Didit's
|
|
54
|
+
* embedded frame → result (verified, declined, in review, or the name on the document differs from
|
|
55
|
+
* the account name, offered as the new name). No webhooks: completing Didit's flow calls `refresh`.
|
|
56
|
+
*/
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
/** The backend calls of the flow, as functions (see the module comment). */
|
|
59
|
+
interface IdentityVerificationApi {
|
|
60
|
+
status: () => Promise<IdentityStatus>;
|
|
61
|
+
purchase: () => Promise<IdentityPurchase>;
|
|
62
|
+
/** The Didit session URL. */
|
|
63
|
+
startSession: () => Promise<string>;
|
|
64
|
+
refresh: () => Promise<IdentityStatus>;
|
|
65
|
+
acceptName: () => Promise<IdentityStatus>;
|
|
66
|
+
remove: () => Promise<IdentityStatus>;
|
|
60
67
|
}
|
|
61
|
-
interface
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
/** The
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
interface UseIdentityVerificationFlowOptions {
|
|
69
|
+
/** Load the status (default true; e.g. false while signed out). */
|
|
70
|
+
enabled?: boolean;
|
|
71
|
+
/** The tick changed (granted, renamed away, removed): update the host's copy of the user. */
|
|
72
|
+
onVerifiedChange?: (verified: boolean) => void;
|
|
73
|
+
/** The account name became the name on the document. */
|
|
74
|
+
onNameAccepted?: (name: {
|
|
75
|
+
givenName: string;
|
|
76
|
+
familyName: string | null;
|
|
77
|
+
}) => void;
|
|
78
|
+
/** The host's price format (e.g. its billing helpers); default `formatIdentityPrice`. */
|
|
79
|
+
formatPrice?: (status: IdentityStatus) => string;
|
|
71
80
|
}
|
|
72
|
-
/**
|
|
73
|
-
declare function
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
/** Which step the dialog opens on for a status. */
|
|
82
|
+
declare function identityStepFor(status: IdentityStatus | undefined): IdentityStep;
|
|
83
|
+
/** "£5.00 incl. VAT": the fee is quoted including UK VAT. */
|
|
84
|
+
declare function formatIdentityPrice(status: IdentityStatus): string;
|
|
85
|
+
/** The identity verification dialog's state, bound to the backend calls in `api`. */
|
|
86
|
+
declare function useIdentityVerificationFlow(api: IdentityVerificationApi, { enabled, onVerifiedChange, onNameAccepted, formatPrice, }?: UseIdentityVerificationFlowOptions): IdentityVerificationFlow;
|
|
87
|
+
/**
|
|
88
|
+
* The identity verification flow over the account client in scope; the profile query follows the
|
|
89
|
+
* tick and name.
|
|
90
|
+
*/
|
|
91
|
+
declare function useIdentityVerification(options?: Omit<UseIdentityVerificationFlowOptions, 'enabled'>): IdentityVerificationFlow;
|
|
76
92
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
stepCount?: number;
|
|
91
|
-
/** The sources behind `[statement](#cite-N)` marks in `content`. */
|
|
92
|
-
citations?: ArbiChatCitation[];
|
|
93
|
-
/** The reader stopped the answer; `content` is what had streamed. */
|
|
94
|
-
stopped?: boolean;
|
|
95
|
-
/** The backend id of a finished assistant answer: what a follow-up chains from. */
|
|
96
|
-
responseId?: string;
|
|
97
|
-
/**
|
|
98
|
-
* A user message the server sent to start a workflow's step (its `tools.workflow_step`): the
|
|
99
|
-
* step's id. A chat shows it as that step, not as the raw instruction.
|
|
100
|
-
*/
|
|
101
|
-
workflowStep?: string;
|
|
102
|
-
}
|
|
103
|
-
/** The workflow step a stored message starts (its `tools.workflow_step` marker), if any. */
|
|
104
|
-
declare function workflowStepOf(tools: object | null | undefined): string | undefined;
|
|
105
|
-
interface ArbiChatThread {
|
|
106
|
-
id: string;
|
|
107
|
-
/** The backend title, else the first question; empty until there is one. */
|
|
108
|
-
title: string;
|
|
93
|
+
/**
|
|
94
|
+
* Password change: a new master password for the same account identity.
|
|
95
|
+
*
|
|
96
|
+
* The password only wraps the identity keypair, so a change is one request that re-encrypts nothing
|
|
97
|
+
* and leaves the recovery key as it was (see `Arbi.account.changePassword`). `usePasswordChange` is
|
|
98
|
+
* the SDK-bound mutation. `usePasswordChangeForm` is the controller behind `PasswordChangeDialog`:
|
|
99
|
+
* fields, validation, error wording and the success state. It takes the submit as a function, so an
|
|
100
|
+
* app without an `arbi` in its host binds the same dialog.
|
|
101
|
+
*/
|
|
102
|
+
interface PasswordChangeVars {
|
|
103
|
+
newPassword: string;
|
|
104
|
+
/** Omit in recovery mode (after signing in with a recovery key). */
|
|
105
|
+
currentPassword?: string;
|
|
109
106
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
/** Change (or, in recovery mode, set) the master password through the account client in scope. */
|
|
108
|
+
declare function usePasswordChange(): _tanstack_react_query.UseMutationResult<void, Error, PasswordChangeVars, unknown>;
|
|
109
|
+
interface PasswordChangeFormMessages {
|
|
110
|
+
required: string;
|
|
111
|
+
mismatch: string;
|
|
112
|
+
sameAsCurrent: string;
|
|
113
|
+
wrongCurrent: string;
|
|
114
|
+
wrongRecoveryKey: string;
|
|
114
115
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
activeArtifact?: () => string | null | undefined;
|
|
129
|
-
/** Longest auto-title in characters (used until the backend has titled the conversation). Default 48. */
|
|
130
|
-
titleLength?: number;
|
|
131
|
-
/**
|
|
132
|
-
* When the answer stream ends without the terminal `response.completed` event (a dropped
|
|
133
|
-
* connection, a stalled run), the stored message is polled this often (ms) and for at most
|
|
134
|
-
* `timeoutMs` before the turn is shown as failed with a Retry. Default 3000 / 120000.
|
|
135
|
-
*/
|
|
136
|
-
streamRecovery?: {
|
|
137
|
-
intervalMs?: number;
|
|
138
|
-
timeoutMs?: number;
|
|
139
|
-
};
|
|
116
|
+
declare const DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES: PasswordChangeFormMessages;
|
|
117
|
+
interface UsePasswordChangeFormOptions {
|
|
118
|
+
/** After recovery with a key: no current password is asked for. */
|
|
119
|
+
recoveryMode?: boolean;
|
|
120
|
+
/** The host's password policy: the first unmet requirement, or `null` when the password is fine. */
|
|
121
|
+
getUnmetRequirement: (password: string) => string | null;
|
|
122
|
+
/** Do the change. */
|
|
123
|
+
submit: (vars: PasswordChangeVars) => Promise<void>;
|
|
124
|
+
/** The dialog should close (cancel, or done). */
|
|
125
|
+
onClose: () => void;
|
|
126
|
+
/** Recovery finished: continue into the app. Recovery closes itself, with no success screen. */
|
|
127
|
+
onRecoveryComplete?: () => void;
|
|
128
|
+
messages?: Partial<PasswordChangeFormMessages>;
|
|
140
129
|
}
|
|
141
|
-
interface
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
messages: ArbiChatMessage[];
|
|
149
|
-
/** An answer is streaming. */
|
|
150
|
-
isRunning: boolean;
|
|
151
|
-
/** The last turn failed (the message list also carries the failed message). */
|
|
130
|
+
interface PasswordChangeForm {
|
|
131
|
+
currentPassword: string;
|
|
132
|
+
onCurrentPasswordChange: (value: string) => void;
|
|
133
|
+
newPassword: string;
|
|
134
|
+
onNewPasswordChange: (value: string) => void;
|
|
135
|
+
confirmPassword: string;
|
|
136
|
+
onConfirmPasswordChange: (value: string) => void;
|
|
152
137
|
error: string | null;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
uploadError: string | null;
|
|
163
|
-
send: (text: string, options?: {
|
|
164
|
-
mentions?: QueryOptions['mentions'];
|
|
165
|
-
}) => Promise<void>;
|
|
166
|
-
/** Re-ask the question whose answer failed. */
|
|
167
|
-
retry: () => Promise<void>;
|
|
168
|
-
/** Abort the running answer; what streamed so far stays, marked stopped. */
|
|
169
|
-
stop: () => void;
|
|
170
|
-
selectThread: (id: string) => void;
|
|
171
|
-
newThread: () => void;
|
|
172
|
-
/** Deletes the conversation on the backend too. */
|
|
173
|
-
deleteThread: (id: string) => void;
|
|
174
|
-
toggleDocument: (id: string) => void;
|
|
175
|
-
selectAllDocuments: () => void;
|
|
176
|
-
upload: (files: File[]) => Promise<void>;
|
|
138
|
+
isProcessing: boolean;
|
|
139
|
+
isSubmitDisabled: boolean;
|
|
140
|
+
onSubmit: () => void;
|
|
141
|
+
/** The change went through (normal mode): the dialog shows its success state. */
|
|
142
|
+
isChanged: boolean;
|
|
143
|
+
/** Cancel and clear the form. */
|
|
144
|
+
onCancel: () => void;
|
|
145
|
+
/** Leave the success screen. */
|
|
146
|
+
onDone: () => void;
|
|
177
147
|
}
|
|
178
|
-
/**
|
|
179
|
-
declare function
|
|
180
|
-
declare function useArbiChat(options?: UseArbiChatOptions): ArbiChat;
|
|
148
|
+
/** The state machine of `PasswordChangeDialog`; spread it into the dialog's props. */
|
|
149
|
+
declare function usePasswordChangeForm({ recoveryMode, getUnmetRequirement, submit, onClose, onRecoveryComplete, messages, }: UsePasswordChangeFormOptions): PasswordChangeForm;
|
|
181
150
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
|
|
206
|
-
* thread that needs attribution (a group, or a rail-less list where the peer
|
|
207
|
-
* isn't in a header) gets it without a row per message.
|
|
208
|
-
*/
|
|
209
|
-
senderName?: string;
|
|
210
|
-
/** Per-slot brand overrides, so a consumer pins its accent in one place. */
|
|
211
|
-
classNames?: {
|
|
212
|
-
/** The current user's own bubble. */
|
|
213
|
-
ownBubble?: string;
|
|
214
|
-
/** The peer's bubble. */
|
|
215
|
-
peerBubble?: string;
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* Render the message body. Injected by the host so the light package doesn't
|
|
219
|
-
* depend on the app's markdown renderer. Defaults to plain text.
|
|
220
|
-
*/
|
|
221
|
-
renderMessage?: (message: string) => ReactNode;
|
|
222
|
-
/**
|
|
223
|
-
* Format the timestamp shown on the last bubble of a run. Defaults to the
|
|
224
|
-
* raw string.
|
|
225
|
-
*/
|
|
226
|
-
formatTimestamp?: (timestamp: string) => string;
|
|
227
|
-
/**
|
|
228
|
-
* Rendered inside the bubble under the text — e.g. a message's attached
|
|
229
|
-
* files. The host owns fetching and decrypting them. A message with
|
|
230
|
-
* attachments and no text shows only these.
|
|
231
|
-
*/
|
|
232
|
-
attachments?: ReactNode;
|
|
233
|
-
/** Marks the message row, including the deleted tombstone. */
|
|
234
|
-
'data-testid'?: string;
|
|
151
|
+
interface ProfileView {
|
|
152
|
+
givenName: string;
|
|
153
|
+
familyName: string | null;
|
|
154
|
+
picture: string | null;
|
|
155
|
+
email: string;
|
|
156
|
+
/** The sign-in provider manages the email (it cannot be changed here). */
|
|
157
|
+
isSso: boolean;
|
|
158
|
+
/** Verified tick: passed an ID check under this name, not expired. */
|
|
159
|
+
isIdentityVerified?: boolean;
|
|
160
|
+
/** Given and family name joined; empty while the profile has no name. */
|
|
161
|
+
fullName: string;
|
|
162
|
+
}
|
|
163
|
+
/** The profile as the UI reads it. `fullName` is the profile name, never the email. */
|
|
164
|
+
declare function toProfileView(profile: LoginProfile): ProfileView;
|
|
165
|
+
/** The signed-in user's profile; `null` when the session has none (restored without a login). */
|
|
166
|
+
declare function useProfile(options?: {
|
|
167
|
+
enabled?: boolean;
|
|
168
|
+
}): _tanstack_react_query.UseQueryResult<NoInfer<ProfileView | null>, Error>;
|
|
169
|
+
interface UpdateProfileVars {
|
|
170
|
+
givenName?: string;
|
|
171
|
+
/** `''` clears it. */
|
|
172
|
+
familyName?: string;
|
|
173
|
+
/** A data URL or URL; `''` clears it (the backend caps it at 100 KB). */
|
|
174
|
+
picture?: string;
|
|
235
175
|
}
|
|
236
|
-
declare const ChatBubble: React$1.NamedExoticComponent<ChatBubbleProps>;
|
|
237
|
-
|
|
238
176
|
/**
|
|
239
|
-
*
|
|
177
|
+
* Save the name and/or picture (PATCH /v1/user/profile). The profile query is updated in place and
|
|
178
|
+
* the workspace list (member rows carry the name) is refreshed, so every surface follows.
|
|
240
179
|
*/
|
|
241
|
-
|
|
242
|
-
|
|
180
|
+
declare function useUpdateProfile(): _tanstack_react_query.UseMutationResult<ProfileView | null, Error, UpdateProfileVars, unknown>;
|
|
181
|
+
interface UseNameEditorOptions {
|
|
182
|
+
givenName: string | null | undefined;
|
|
183
|
+
familyName: string | null | undefined;
|
|
184
|
+
/** Persist the new name. Reject to keep the editor open (see `error`). */
|
|
185
|
+
save: (name: {
|
|
186
|
+
givenName: string;
|
|
187
|
+
familyName: string;
|
|
188
|
+
}) => Promise<unknown> | unknown;
|
|
189
|
+
}
|
|
190
|
+
interface NameEditor {
|
|
191
|
+
isEditing: boolean;
|
|
192
|
+
givenName: string;
|
|
193
|
+
familyName: string;
|
|
194
|
+
onGivenNameChange: (value: string) => void;
|
|
195
|
+
onFamilyNameChange: (value: string) => void;
|
|
196
|
+
onStartEdit: () => void;
|
|
197
|
+
onSave: () => void;
|
|
198
|
+
onCancel: () => void;
|
|
199
|
+
isSaving: boolean;
|
|
200
|
+
/** The last failed save. */
|
|
201
|
+
error: unknown;
|
|
202
|
+
}
|
|
243
203
|
/**
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
204
|
+
* State of the inline name editor of `ProfileCard`: start edit (seeded from the current name),
|
|
205
|
+
* save (trimmed; a blank given name is not saved), cancel. Spread it into `ProfileCard`'s `name`
|
|
206
|
+
* with `display`.
|
|
247
207
|
*/
|
|
248
|
-
declare function
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
declare function ArbiWebSocketProvider({ enabled, children }: ArbiWebSocketProviderProps): React$1.JSX.Element;
|
|
260
|
-
|
|
261
|
-
type ArbiWsSubscriber = (msg: WebSocketServerMessage) => void;
|
|
262
|
-
interface ArbiWsContextValue {
|
|
263
|
-
subscribe: (fn: ArbiWsSubscriber) => () => void;
|
|
208
|
+
declare function useNameEditor({ givenName, familyName, save }: UseNameEditorOptions): NameEditor;
|
|
209
|
+
/** Largest picture file accepted before cropping. */
|
|
210
|
+
declare const MAX_AVATAR_FILE_BYTES: number;
|
|
211
|
+
type AvatarFileProblem = 'not-image' | 'too-large' | 'unreadable';
|
|
212
|
+
interface UseAvatarCropOptions {
|
|
213
|
+
/** Persist the cropped picture (a data URL). */
|
|
214
|
+
upload: (dataUrl: string) => Promise<unknown> | unknown;
|
|
215
|
+
/** Report a rejected file or a failed read; default is silent (the picker just does not open). */
|
|
216
|
+
onProblem?: (problem: AvatarFileProblem) => void;
|
|
217
|
+
maxBytes?: number;
|
|
264
218
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
presence: Record<string, string>;
|
|
277
|
-
setStatus: (status: ArbiWsStatus) => void;
|
|
278
|
-
applyTaskUpdate: (msg: WsTaskUpdateMessage) => void;
|
|
279
|
-
applyPresence: (msg: WsPresenceUpdateMessage) => void;
|
|
280
|
-
reset: () => void;
|
|
219
|
+
interface AvatarCrop {
|
|
220
|
+
/** Pass to `AvatarPicker.onFileChosen`. */
|
|
221
|
+
onFileChosen: (file: File) => void;
|
|
222
|
+
/** The chosen image awaiting a crop (a data URL), else `null`. */
|
|
223
|
+
pendingImage: string | null;
|
|
224
|
+
/** Pass to the crop dialog's `onComplete`. */
|
|
225
|
+
onCropComplete: (result: {
|
|
226
|
+
dataUrl: string;
|
|
227
|
+
}) => void;
|
|
228
|
+
onCropCancel: () => void;
|
|
229
|
+
isUploading: boolean;
|
|
281
230
|
}
|
|
282
|
-
declare const useArbiWsStore: zustand.UseBoundStore<zustand.StoreApi<ArbiWsState>>;
|
|
283
|
-
|
|
284
231
|
/**
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* All message typing flows from the OpenAPI-derived `WebSocketServerMessage`
|
|
288
|
-
* union — handlers are narrowed by the discriminant `type`, exactly like the
|
|
289
|
-
* rest of the SDK.
|
|
232
|
+
* The choose, validate, crop, upload sequence behind `AvatarPicker`: the picker hands over a file,
|
|
233
|
+
* this checks it (image, size) and reads it for the crop dialog, then uploads the cropped data URL.
|
|
290
234
|
*/
|
|
235
|
+
declare function useAvatarCrop({ upload, onProblem, maxBytes, }: UseAvatarCropOptions): AvatarCrop;
|
|
291
236
|
|
|
292
237
|
/**
|
|
293
|
-
*
|
|
294
|
-
* new inline function each render does not resubscribe.
|
|
295
|
-
*/
|
|
296
|
-
declare function useArbiWebSocket(onMessage: (msg: WebSocketServerMessage) => void): void;
|
|
297
|
-
/**
|
|
298
|
-
* Subscribe to a single message type, fully narrowed to that variant.
|
|
238
|
+
* The account client the account hooks and the settings blocks talk to.
|
|
299
239
|
*
|
|
300
|
-
* @
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
240
|
+
* An {@link AccountClient} is the signed-in user's account: profile, email, password, sessions,
|
|
241
|
+
* sign-out, deletion and the ID check. {@link arbiAccountClient} builds the default one from an
|
|
242
|
+
* `Arbi` (used when the host configuration has no `account`). A host with its own session and API
|
|
243
|
+
* client (ARBI-frontend) gives its own as the host configuration's `account`, as it does for `mail`.
|
|
304
244
|
*/
|
|
305
|
-
declare function useArbiWsMessage<T extends WebSocketServerMessage>(type: T['type'], handler: (msg: T) => void): void;
|
|
306
|
-
/** Live connection status of the shared socket. */
|
|
307
|
-
declare function useArbiWsStatus(): ArbiWsStatus;
|
|
308
|
-
/** `true` once the shared socket is authenticated and connected. */
|
|
309
|
-
declare function useArbiConnected(): boolean;
|
|
310
|
-
/** The latest processing status per document id (the `task_update` stream). */
|
|
311
|
-
declare function useArbiWsTasks(): Record<string, {
|
|
312
|
-
type: "task_update";
|
|
313
|
-
doc_ext_id: string;
|
|
314
|
-
version: number;
|
|
315
|
-
workspace_ext_id: string;
|
|
316
|
-
file_name: string;
|
|
317
|
-
status: "uploading" | "queued" | "parsing" | "encrypting" | "indexing" | "analysing" | "completed" | "failed" | "skipped" | "empty" | "low-content";
|
|
318
|
-
progress: number;
|
|
319
|
-
failed_stage?: string | null;
|
|
320
|
-
folder?: string | null;
|
|
321
|
-
}>;
|
|
322
|
-
/** The latest processing status for a single document, if any. */
|
|
323
|
-
declare function useArbiWsTask(docId: string): {
|
|
324
|
-
type: "task_update";
|
|
325
|
-
doc_ext_id: string;
|
|
326
|
-
version: number;
|
|
327
|
-
workspace_ext_id: string;
|
|
328
|
-
file_name: string;
|
|
329
|
-
status: "uploading" | "queued" | "parsing" | "encrypting" | "indexing" | "analysing" | "completed" | "failed" | "skipped" | "empty" | "low-content";
|
|
330
|
-
progress: number;
|
|
331
|
-
failed_stage?: string | null;
|
|
332
|
-
folder?: string | null;
|
|
333
|
-
};
|
|
334
245
|
|
|
246
|
+
type AccountSession = components['schemas']['SessionInfoResponse'];
|
|
247
|
+
interface AccountSignOutOptions {
|
|
248
|
+
/** End every session on the server first, this device's included. */
|
|
249
|
+
everywhere?: boolean;
|
|
250
|
+
/** Why: a person's choice, or the account was just closed. */
|
|
251
|
+
reason?: 'manual' | 'account-deleted';
|
|
252
|
+
}
|
|
253
|
+
interface AccountClient {
|
|
254
|
+
/** The signed-in user's profile; `null` when there is none. */
|
|
255
|
+
profile(): ProfileView | null;
|
|
256
|
+
/** Be told when {@link profile} changes. Returns the unsubscribe. */
|
|
257
|
+
onProfileChange(listener: () => void): () => void;
|
|
258
|
+
/** Save the name and/or picture; the profile follows. */
|
|
259
|
+
updateProfile(vars: UpdateProfileVars): Promise<void>;
|
|
260
|
+
/** Send the verification code to the new address (not for SSO accounts). */
|
|
261
|
+
requestEmailChange(newEmail: string): Promise<void>;
|
|
262
|
+
/** Confirm the new address with the emailed code; the profile follows. */
|
|
263
|
+
confirmEmailChange(newEmail: string, code: string): Promise<void>;
|
|
264
|
+
/** Change (or, in recovery mode, set) the master password. */
|
|
265
|
+
changePassword(vars: PasswordChangeVars): Promise<void>;
|
|
266
|
+
listSessions(): Promise<AccountSession[]>;
|
|
267
|
+
/** The id this device's session is listed under, or `null`. */
|
|
268
|
+
currentSessionId(): string | null;
|
|
269
|
+
/** End one of the user's sessions at once (not this device's: that is {@link signOut}). */
|
|
270
|
+
terminateSession(sessionId: string): Promise<void>;
|
|
271
|
+
/** Sign this device out of the host (and, `everywhere`, every other session first). */
|
|
272
|
+
signOut(options?: AccountSignOutOptions): Promise<void>;
|
|
273
|
+
/** Close the account. Rejects with the backend's refusal when something blocks it. */
|
|
274
|
+
requestDeletion(): Promise<unknown>;
|
|
275
|
+
/** The ID check behind the verified tick. */
|
|
276
|
+
identity: IdentityVerificationApi;
|
|
277
|
+
}
|
|
278
|
+
interface AccountClientContextValue {
|
|
279
|
+
client: AccountClient;
|
|
280
|
+
/** Account reads run only while this is true (signed in). */
|
|
281
|
+
enabled: boolean;
|
|
282
|
+
}
|
|
335
283
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* Mount `useArbiDocumentSync(workspaceId)` once wherever the document list matters. It re-reads
|
|
340
|
-
* just the documents an event names and patches them into the list (`refreshDocuments`):
|
|
341
|
-
* - `batch_complete` (upload, AI fields, extraction) for this workspace: its documents, and the
|
|
342
|
-
* tag list (a batch may create tags);
|
|
343
|
-
* - a finished `task_update` for a document (processing over).
|
|
344
|
-
* so freshly uploaded, freshly coded or freshly processed documents appear without anyone
|
|
345
|
-
* polling or re-reading the whole list.
|
|
284
|
+
* The account client over an `Arbi`. `overrides` replace any of its calls: a host that keeps its
|
|
285
|
+
* own signed-in state passes `signOut` (and `profile`) so the SDK and the host stay in step.
|
|
346
286
|
*/
|
|
347
|
-
declare function
|
|
348
|
-
|
|
287
|
+
declare function arbiAccountClient(arbi: Arbi, overrides?: Partial<AccountClient>): AccountClient;
|
|
349
288
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
* does not mount an `<ArbiProvider>` can use them too.
|
|
289
|
+
* The account client in scope: the host configuration's `account`, else one on its `arbi` session
|
|
290
|
+
* (`arbiAccountClient`).
|
|
353
291
|
*/
|
|
292
|
+
declare function useAccountClient(): AccountClientContextValue;
|
|
354
293
|
|
|
355
|
-
/** Workspace visibility: public = common, several members = shared, else private. */
|
|
356
|
-
type ShellWorkspaceKind = 'private' | 'shared' | 'common';
|
|
357
|
-
/** One face on a workspace card. */
|
|
358
|
-
interface ShellWorkspaceMember {
|
|
359
|
-
name: string;
|
|
360
|
-
picture?: string | null;
|
|
361
|
-
}
|
|
362
294
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
295
|
+
* What a host adds to the calendar hooks (the host configuration's `calendar`), all optional:
|
|
296
|
+
* keeping the calendar on this device (offline reads and a write outbox), and where the OAuth of a
|
|
297
|
+
* Google or Microsoft account comes back to. Without it the hooks read and write online only.
|
|
298
|
+
* Accounts connect through the user's connectors (`arbi.connectors`) unless the host supplies its
|
|
299
|
+
* own.
|
|
365
300
|
*/
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
301
|
+
|
|
302
|
+
/** A write the outbox can hold while offline. */
|
|
303
|
+
type CalendarWriteOp = {
|
|
304
|
+
kind: 'create';
|
|
305
|
+
body: EventCreateBody;
|
|
306
|
+
} | {
|
|
307
|
+
kind: 'update';
|
|
308
|
+
target: ScopedTarget;
|
|
309
|
+
body: EventPatchBody;
|
|
310
|
+
} | {
|
|
311
|
+
kind: 'delete';
|
|
312
|
+
target: ScopedTarget & {
|
|
313
|
+
notify?: boolean;
|
|
314
|
+
};
|
|
315
|
+
} | {
|
|
316
|
+
kind: 'respond';
|
|
317
|
+
params: RespondParams;
|
|
318
|
+
};
|
|
319
|
+
/** A write made offline: queued on this device and sent exactly once when back online. */
|
|
320
|
+
interface QueuedCalendarWrite {
|
|
321
|
+
queued: true;
|
|
322
|
+
requestId: string;
|
|
323
|
+
}
|
|
324
|
+
declare function isQueuedCalendarWrite(value: unknown): value is QueuedCalendarWrite;
|
|
325
|
+
/** A write waiting in the outbox (a queued create is drawn on the grid as pending). */
|
|
326
|
+
interface CalendarPendingWrite {
|
|
327
|
+
requestId: string;
|
|
328
|
+
op: CalendarWriteOp;
|
|
329
|
+
state: string;
|
|
330
|
+
inDoubt?: boolean;
|
|
331
|
+
error?: string;
|
|
332
|
+
}
|
|
333
|
+
interface CalendarOfflineSupport {
|
|
334
|
+
/**
|
|
335
|
+
* Run a read online and keep the result on this device; when the network is down, answer from
|
|
336
|
+
* that copy. `key` identifies the read (its query key).
|
|
337
|
+
*/
|
|
338
|
+
read<T>(key: readonly unknown[], fetch: () => Promise<T>): Promise<T>;
|
|
339
|
+
/** Send a write, or, offline, queue it and answer {@link QueuedCalendarWrite}. */
|
|
340
|
+
write<T>(op: CalendarWriteOp, send: () => Promise<T>): Promise<T | QueuedCalendarWrite>;
|
|
341
|
+
/** The writes waiting in the outbox. */
|
|
342
|
+
pending(): Promise<CalendarPendingWrite[]>;
|
|
343
|
+
/** Be told when the outbox changes. Returns the unsubscribe. */
|
|
344
|
+
subscribe(listener: () => void): () => void;
|
|
345
|
+
}
|
|
346
|
+
interface CalendarConnectorSupport {
|
|
347
|
+
/** The URL that starts a connector's OAuth consent and comes back to `returnPath`. */
|
|
348
|
+
authorize(vendor: string, returnPath: string): Promise<string>;
|
|
349
|
+
/** Hand this server session the connector's sealed grant (the server answered 401 without it). */
|
|
350
|
+
bridge(vendor: string): Promise<void>;
|
|
351
|
+
/** The vendor keys of the user's connected connectors. */
|
|
352
|
+
connectedVendors(): Promise<string[]>;
|
|
353
|
+
}
|
|
354
|
+
interface CalendarSupport {
|
|
355
|
+
offline?: CalendarOfflineSupport;
|
|
356
|
+
connectors?: CalendarConnectorSupport;
|
|
357
|
+
/** Where the OAuth consent returns to (default: the current page). */
|
|
358
|
+
oauthReturnPath?: string;
|
|
359
|
+
}
|
|
360
|
+
declare function useCalendarSupport(): CalendarSupport;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Choosing files to upload: what the picker accepts, which files are refused and why, folders
|
|
364
|
+
* dropped whole (each file keeps its path below the dropped folder), zip archives opened into
|
|
365
|
+
* their files, and the folder a file goes to.
|
|
366
|
+
*/
|
|
367
|
+
/** The file picker's `accept`: every type an upload takes, zip archives included. */
|
|
368
|
+
declare const UPLOAD_ACCEPT = ".pdf,.txt,.md,.html,.doc,.docx,.rtf,.ppt,.pptx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.mp4,.mpeg,.mpg,.webm,.mov,.avi,.mkv,.mp3,.wav,.m4a,.aac,.ogg,.flac,.eml,.msg,.mbox,.pst,.ost,.zip,application/pdf,text/plain,text/markdown,text/html,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/rtf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,image/jpeg,image/png,image/gif,image/bmp,image/tiff,image/webp,video/mp4,video/mpeg,video/webm,video/quicktime,video/x-msvideo,video/x-matroska,audio/mpeg,audio/wav,audio/mp4,audio/aac,audio/ogg,audio/flac,message/rfc822,application/vnd.ms-outlook,application/mbox,application/zip,application/x-zip-compressed";
|
|
369
|
+
/** The largest file a browser upload takes. */
|
|
370
|
+
declare const UPLOAD_MAX_FILE_SIZE: number;
|
|
371
|
+
/** Why a chosen file is not uploaded. */
|
|
372
|
+
type UploadRefusal = 'empty' | 'too_large' | 'no_extension' | 'unsupported' | 'empty_zip' | 'zip_error';
|
|
373
|
+
interface RefusedUploadFile {
|
|
374
|
+
name: string;
|
|
375
|
+
reason: UploadRefusal;
|
|
376
|
+
}
|
|
377
|
+
/** A zip archive's files, and the names of those too large to take. */
|
|
378
|
+
interface ExtractedZip {
|
|
379
|
+
extractedFiles: File[];
|
|
380
|
+
skippedLargeFiles: string[];
|
|
381
|
+
}
|
|
382
|
+
/** Opens a zip archive into its files (each with its path in `webkitRelativePath`). */
|
|
383
|
+
type ZipExtractor = (zip: File, maxFileSize: number) => Promise<ExtractedZip>;
|
|
384
|
+
/** A file with its path below a dropped or picked folder (as the browser's folder picker sets). */
|
|
385
|
+
declare function withRelativePath(file: File, relativePath: string): File;
|
|
386
|
+
declare function isZipFile(file: Pick<File, 'name' | 'type'>): boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Open a zip archive into the files an upload takes. An archive whose files all sit in one folder
|
|
389
|
+
* keeps that folder; otherwise they go under a folder named after the archive.
|
|
390
|
+
*/
|
|
391
|
+
declare const extractZipFile: ZipExtractor;
|
|
392
|
+
/**
|
|
393
|
+
* The chosen files an upload takes (zip archives opened into theirs), sorted by path, and those it
|
|
394
|
+
* refuses with why.
|
|
395
|
+
*/
|
|
396
|
+
declare function prepareUploadFiles(chosen: ArrayLike<File>, options?: {
|
|
397
|
+
maxFileSize?: number;
|
|
398
|
+
extractZip?: ZipExtractor;
|
|
399
|
+
}): Promise<{
|
|
400
|
+
accepted: File[];
|
|
401
|
+
refused: RefusedUploadFile[];
|
|
402
|
+
}>;
|
|
403
|
+
/** The files of a drop: dropped folders are read whole, each file keeping its path. */
|
|
404
|
+
declare function filesFromDrop(transfer: DataTransfer): Promise<File[]>;
|
|
405
|
+
/**
|
|
406
|
+
* The folder a file goes to: `base` (where the upload was started), then the folders the file sat
|
|
407
|
+
* in below what was dropped or picked. Null at the workspace root.
|
|
408
|
+
*/
|
|
409
|
+
declare function uploadFolderOf(file: File, base?: string | null): string | null;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* The workspace documents list in the query cache: one entry per workspace
|
|
413
|
+
* (`arbiQueryKeys.documents(workspaceId)`), read once (progressively, see `documents-loader.ts`)
|
|
414
|
+
* and then kept current in place. Every write goes through {@link patchDocuments}, which also
|
|
415
|
+
* tells row listeners (a grid that applies row transactions instead of re-diffing the whole list)
|
|
416
|
+
* exactly which rows were added, changed or removed.
|
|
417
|
+
*
|
|
418
|
+
* A single document's own entry (`arbiQueryKeys.document(id)`, read by a viewer) is patched next to
|
|
419
|
+
* the list by {@link setCachedDocument}, so a viewer never blanks while a write settles.
|
|
420
|
+
*/
|
|
421
|
+
|
|
422
|
+
/** A document as the server lists it. */
|
|
423
|
+
type WorkspaceDocument = components['schemas']['DocResponse'];
|
|
424
|
+
/** The rows one write added, changed and removed (removed: by id). */
|
|
425
|
+
interface DocumentRowChange {
|
|
426
|
+
workspaceId: string;
|
|
427
|
+
add: WorkspaceDocument[];
|
|
428
|
+
update: WorkspaceDocument[];
|
|
429
|
+
remove: string[];
|
|
430
|
+
}
|
|
431
|
+
type RowListener = (change: DocumentRowChange) => void;
|
|
432
|
+
/**
|
|
433
|
+
* Follow the row-level changes of every write to a workspace documents list (a grid applying them
|
|
434
|
+
* as transactions). Returns the unsubscribe.
|
|
435
|
+
*/
|
|
436
|
+
declare function subscribeDocumentRows(listener: RowListener): () => void;
|
|
437
|
+
/** The cached documents of a workspace (`undefined` before its list has been read). */
|
|
438
|
+
declare function getCachedDocuments(qc: QueryClient, workspaceId: string | null | undefined): WorkspaceDocument[] | undefined;
|
|
439
|
+
/**
|
|
440
|
+
* Apply `reducer` to a workspace's documents list, or (no `workspaceId`) to every cached one: the
|
|
441
|
+
* one place a list is written after it was read. Returning the same array is a no-op. Row
|
|
442
|
+
* listeners get the diff; a document that moved to a new version makes the open version lists
|
|
443
|
+
* re-read. A workspace whose list has not been read is left alone (its first read brings it).
|
|
444
|
+
*/
|
|
445
|
+
declare function patchDocuments(qc: QueryClient, reducer: (documents: WorkspaceDocument[]) => WorkspaceDocument[], workspaceId?: string | null): void;
|
|
446
|
+
/** Put `doc` in its list in place, or at the end when the list does not hold it yet. */
|
|
447
|
+
declare function upsertDocuments(qc: QueryClient, documents: WorkspaceDocument[], workspaceId?: string | null): void;
|
|
448
|
+
/** Write a document's own entry (what `useDocument` reads), keeping a viewer current. */
|
|
449
|
+
declare function setCachedDocument(qc: QueryClient, doc: WorkspaceDocument): void;
|
|
450
|
+
/** Apply `reducer` to a document's own entry, when one is cached. */
|
|
451
|
+
declare function patchCachedDocument(qc: QueryClient, docId: string, reducer: (doc: WorkspaceDocument) => WorkspaceDocument): void;
|
|
452
|
+
/** A deleted tag leaves every cached document that carried it: the lists' rows and their entries. */
|
|
453
|
+
declare function dropTagFromCachedDocuments(qc: QueryClient, tagId: string): void;
|
|
454
|
+
/** Forget everything cached about deleted documents, so nothing re-reads them into a 404. */
|
|
455
|
+
declare function forgetDocuments(qc: QueryClient, docIds: string[]): void;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* What a host adds to the document hooks and the document kits, opt in (the host configuration's
|
|
459
|
+
* `documents`): the live processing state it keeps (from its own live connection), what happens on
|
|
460
|
+
* its side when documents are deleted or queued for processing, how it uploads (workspace key, zip
|
|
461
|
+
* archives), and what it does with documents beyond the package (its workflows, chat, mail, offline
|
|
462
|
+
* copies, viewer). Without it the hooks work on their own, and the kits offer less, never something
|
|
463
|
+
* that does nothing.
|
|
464
|
+
*/
|
|
465
|
+
|
|
466
|
+
/** Something the host can start on documents or a folder (a workflow, a skill). */
|
|
467
|
+
interface DocumentStartItem {
|
|
468
|
+
id: string;
|
|
469
|
+
title: string;
|
|
470
|
+
run: () => void;
|
|
471
|
+
}
|
|
472
|
+
/** What the host does with documents beyond the package. Each absent one is not offered. */
|
|
473
|
+
interface DocumentHostActions {
|
|
474
|
+
/** What can be started on one file. */
|
|
475
|
+
startItemsForFile?: (document: WorkspaceDocument) => DocumentStartItem[];
|
|
476
|
+
/** What can be started on everything in a folder. */
|
|
477
|
+
startItemsForFolder?: (folderPath: string) => DocumentStartItem[];
|
|
478
|
+
/** Start a chat about one document. */
|
|
479
|
+
openDocumentChat?: (docId: string) => void;
|
|
480
|
+
/** Start a chat about several documents. */
|
|
481
|
+
openDocumentsChat?: (docIds: string[]) => void;
|
|
482
|
+
/** Keep documents on this device for offline use. */
|
|
483
|
+
keepOffline?: (documents: WorkspaceDocument[]) => Promise<void>;
|
|
484
|
+
/** Stop keeping documents on this device. */
|
|
485
|
+
stopKeepingOffline?: (docIds: string[]) => Promise<void>;
|
|
486
|
+
/** Hand a document to the host's mail composer as an attachment (offered while mail is on). */
|
|
487
|
+
emailDocument?: (document: WorkspaceDocument) => Promise<void>;
|
|
488
|
+
/** Show how to raise the plan's limits (an upload was refused for them). */
|
|
489
|
+
openUpgrade?: () => void;
|
|
490
|
+
/** Show the AI budget a document's processing ran into, and what can be done. */
|
|
491
|
+
openQuota?: (quota: {
|
|
492
|
+
spend: number;
|
|
493
|
+
budget: number;
|
|
494
|
+
projectExtId: string | null;
|
|
495
|
+
}) => void;
|
|
496
|
+
/** Show the edits made offline that are waiting to sync. */
|
|
497
|
+
openPendingChanges?: () => void;
|
|
498
|
+
/** Open a person (yourself: your settings; someone else: a direct message). */
|
|
499
|
+
openUser?: (userId: string) => void;
|
|
500
|
+
/** Open a document beside another, to compare them. */
|
|
501
|
+
compareDocuments?: (docId: string, otherDocId: string) => void;
|
|
502
|
+
/** Open the fields manager (labels or AI fields), on its form for a new one with `create`. */
|
|
503
|
+
openFieldsManager?: (kind?: 'label' | 'annotation', options?: {
|
|
504
|
+
create?: boolean;
|
|
505
|
+
}) => void;
|
|
506
|
+
}
|
|
507
|
+
/** A person as the document kits show them (who made a document, a field, a value). */
|
|
508
|
+
type DocumentPerson = components['schemas']['UserResponse'];
|
|
509
|
+
/** A document a write here sent back into processing (AI fields being filled). */
|
|
510
|
+
interface QueuedDocument {
|
|
511
|
+
docId: string;
|
|
512
|
+
workspaceId: string;
|
|
513
|
+
fileName: string;
|
|
514
|
+
version: number;
|
|
515
|
+
}
|
|
516
|
+
/** A document's live processing, as the host follows it (a `task_update` and what it adds). */
|
|
517
|
+
interface ProcessingTask {
|
|
518
|
+
doc_ext_id: string;
|
|
519
|
+
status: string;
|
|
520
|
+
progress?: number | null;
|
|
521
|
+
workspace_ext_id?: string | null;
|
|
522
|
+
file_name?: string | null;
|
|
523
|
+
failed_stage?: string | null;
|
|
524
|
+
}
|
|
525
|
+
interface DocumentsSupport {
|
|
526
|
+
/**
|
|
527
|
+
* Every document's live processing, as a hook (a stable function for the provider's life).
|
|
528
|
+
* Without one, the package's own WebSocket store (`ArbiWebSocketProvider`) is read.
|
|
529
|
+
*/
|
|
530
|
+
useProcessingTasks?: () => Readonly<Record<string, ProcessingTask>>;
|
|
531
|
+
/** One document's live processing, as a hook: re-renders only when that document's changes. */
|
|
532
|
+
useProcessingTask?: (docId: string) => ProcessingTask | undefined;
|
|
533
|
+
/**
|
|
534
|
+
* A document's processing status as the host last heard it live. A finished status heard live is
|
|
535
|
+
* kept over an older one a re-read returns (the server may not have committed it yet).
|
|
536
|
+
*/
|
|
537
|
+
processingStatus?: (docId: string) => string | undefined;
|
|
538
|
+
/** Documents went back into processing: show them as queued. Returns the undo (refused write). */
|
|
539
|
+
onProcessingQueued?: (documents: QueuedDocument[]) => () => void;
|
|
540
|
+
/** Documents were deleted: drop what the host keeps about them (processing rows, open tabs). */
|
|
541
|
+
onDocumentsDeleted?: (docIds: string[]) => void;
|
|
542
|
+
/**
|
|
543
|
+
* The workspace's raw key, for the direct upload (encrypted here, sent straight to storage) that
|
|
544
|
+
* the user's settings can turn on. Throws when the key is not held here (a public workspace, a
|
|
545
|
+
* temporary grant): the upload then goes through the server. Absent: always through the server.
|
|
546
|
+
*/
|
|
547
|
+
resolveWorkspaceKey?: (workspaceId: string) => Promise<Uint8Array>;
|
|
548
|
+
/** Opens a zip archive into its files (e.g. off the main thread). Default: on the main thread. */
|
|
549
|
+
extractZip?: ZipExtractor;
|
|
550
|
+
/** The host's actions on documents, as a hook (a kit reads it once per view). */
|
|
551
|
+
useHostActions?: () => DocumentHostActions;
|
|
552
|
+
/** The documents kept on this device for offline use, as a hook. */
|
|
553
|
+
useOfflineDocumentIds?: () => ReadonlySet<string>;
|
|
554
|
+
/** The document open in the host's viewer while it is open (null when closed), as a hook. */
|
|
555
|
+
useOpenViewerDocumentId?: () => string | null;
|
|
556
|
+
/** Whether a document has an edit made offline that is waiting to sync, as a hook. */
|
|
557
|
+
useDocumentPendingSync?: (docId: string | null | undefined) => boolean;
|
|
558
|
+
/**
|
|
559
|
+
* How the host shows a person by a document or a field (its presence, its card), small.
|
|
560
|
+
* `tooltip`: whether hovering shows their card. Absent: the kits' own avatar.
|
|
561
|
+
*/
|
|
562
|
+
renderUser?: (user: DocumentPerson, options: {
|
|
563
|
+
tooltip: boolean;
|
|
564
|
+
}) => ReactNode;
|
|
565
|
+
}
|
|
566
|
+
/** The host's document support (the host configuration's `documents`; empty without one). */
|
|
567
|
+
declare function useDocumentsSupport(): DocumentsSupport;
|
|
568
|
+
/** Every document's live processing (the host's, else the package WebSocket store's). */
|
|
569
|
+
declare function useProcessingTasks(): Readonly<Record<string, ProcessingTask>>;
|
|
570
|
+
/** One document's live processing (the host's, else the package WebSocket store's). */
|
|
571
|
+
declare function useProcessingTask(docId: string): ProcessingTask | undefined;
|
|
572
|
+
/** The host's actions on documents (none without host support). */
|
|
573
|
+
declare function useDocumentHostActions(): DocumentHostActions;
|
|
574
|
+
/** The documents kept on this device for offline use (none without host support). */
|
|
575
|
+
declare function useOfflineDocumentIds(): ReadonlySet<string>;
|
|
576
|
+
/** The document open in the host's viewer, while it is open (none without host support). */
|
|
577
|
+
declare function useOpenViewerDocumentId(): string | null;
|
|
578
|
+
/** Whether a document has an edit made offline waiting to sync (never without host support). */
|
|
579
|
+
declare function useDocumentPendingSync(docId: string | null | undefined): boolean;
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* The mail shapes the hooks and the mail blocks work with: what `/v1/mail` returns, with the
|
|
583
|
+
* fields the server always fills required and arrays never missing.
|
|
584
|
+
*/
|
|
585
|
+
interface MailPolicy {
|
|
586
|
+
native_enabled: boolean;
|
|
587
|
+
native_domain: string;
|
|
588
|
+
enabled: boolean;
|
|
589
|
+
enabled_providers: string[];
|
|
590
|
+
oauth_providers: string[];
|
|
591
|
+
server_profiles: {
|
|
592
|
+
id: string;
|
|
593
|
+
name: string;
|
|
594
|
+
provider: string;
|
|
595
|
+
}[];
|
|
596
|
+
max_attachment_bytes: number;
|
|
597
|
+
}
|
|
598
|
+
interface MailAccount {
|
|
599
|
+
id: string;
|
|
600
|
+
provider: string;
|
|
601
|
+
email: string;
|
|
602
|
+
display_name: string;
|
|
603
|
+
profile_id?: string;
|
|
604
|
+
needs_reconsent: boolean;
|
|
605
|
+
}
|
|
606
|
+
interface MailFolder {
|
|
607
|
+
id: string;
|
|
608
|
+
name: string;
|
|
609
|
+
role?: string;
|
|
610
|
+
unread: number;
|
|
611
|
+
}
|
|
612
|
+
interface MailAddress {
|
|
613
|
+
email: string;
|
|
614
|
+
name?: string;
|
|
615
|
+
}
|
|
616
|
+
interface MailAttachment {
|
|
617
|
+
id: string;
|
|
618
|
+
name: string;
|
|
619
|
+
content_type: string;
|
|
620
|
+
size: number;
|
|
621
|
+
content_base64?: string | null;
|
|
622
|
+
}
|
|
623
|
+
type MailDeliveryStatus = 'sent' | 'delivered' | 'delayed' | 'partially_bounced' | 'bounced';
|
|
624
|
+
interface MailDeliveryRecipient {
|
|
625
|
+
email: string;
|
|
626
|
+
status: 'accepted' | 'rejected' | 'delayed' | 'failed' | 'delivered' | 'relayed' | 'expanded';
|
|
627
|
+
code?: string | null;
|
|
628
|
+
/** Plain words from the server, e.g. "The address doesn't exist". */
|
|
629
|
+
description: string;
|
|
630
|
+
updated_at: string;
|
|
631
|
+
}
|
|
632
|
+
interface MailMessage {
|
|
633
|
+
secure_delivery?: boolean;
|
|
634
|
+
id: string;
|
|
635
|
+
subject: string;
|
|
636
|
+
sender: MailAddress[];
|
|
637
|
+
to: MailAddress[];
|
|
638
|
+
cc: MailAddress[];
|
|
639
|
+
bcc: MailAddress[];
|
|
640
|
+
received_at?: string;
|
|
641
|
+
preview: string;
|
|
642
|
+
unread: boolean;
|
|
643
|
+
text: string;
|
|
644
|
+
html?: string;
|
|
645
|
+
message_id?: string;
|
|
646
|
+
references: string[];
|
|
647
|
+
attachments: MailAttachment[];
|
|
648
|
+
/** Native mail: the folder it is in (`drafts` for a draft). */
|
|
649
|
+
folder?: string | null;
|
|
650
|
+
/** Native sent mail only: delivery across all recipients. */
|
|
651
|
+
delivery_status?: MailDeliveryStatus | null;
|
|
652
|
+
/** Native sent mail, opened message only: each recipient's latest delivery state. */
|
|
653
|
+
delivery?: MailDeliveryRecipient[];
|
|
654
|
+
}
|
|
655
|
+
/** One page of a folder. */
|
|
656
|
+
interface MailPage {
|
|
657
|
+
messages: MailMessage[];
|
|
658
|
+
next_cursor?: string;
|
|
659
|
+
/** Answered from this device (offline), when the host keeps mail offline. */
|
|
660
|
+
fromDevice?: boolean;
|
|
661
|
+
}
|
|
662
|
+
/** A message being written: new, a reply or forward, or a saved draft (`draft_id`). */
|
|
663
|
+
interface MailCompose {
|
|
664
|
+
html?: string;
|
|
665
|
+
secure_delivery?: boolean;
|
|
666
|
+
to: MailAddress[];
|
|
667
|
+
cc: MailAddress[];
|
|
668
|
+
bcc: MailAddress[];
|
|
669
|
+
subject: string;
|
|
670
|
+
text: string;
|
|
671
|
+
attachments: MailAttachment[];
|
|
672
|
+
draft_id?: string;
|
|
673
|
+
in_reply_to?: string;
|
|
674
|
+
references?: string[];
|
|
675
|
+
}
|
|
676
|
+
/** Mark read or unread, move to a folder, or send to Trash. */
|
|
677
|
+
interface MailMessageUpdate {
|
|
678
|
+
unread?: boolean;
|
|
679
|
+
folder_id?: string;
|
|
680
|
+
action?: string;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* The mail client the hooks and the mail blocks talk to.
|
|
685
|
+
*
|
|
686
|
+
* A {@link MailClient} is a transport (`fetch` under `/v1/mail`) plus the reads the screens make.
|
|
687
|
+
* {@link createMailClient} builds one from any transport; {@link arbiMailClient} builds the default
|
|
688
|
+
* one from an `Arbi` (used when the host configuration has no `mail`). A host that keeps mail offline,
|
|
689
|
+
* bridges connector tokens or sends secure mail passes its own reads and extras as overrides.
|
|
690
|
+
*/
|
|
691
|
+
|
|
692
|
+
/** Fetch a path under `/v1/mail` with authentication; rejects a non-2xx response (`status` set). */
|
|
693
|
+
type MailFetch = (path: string, init?: RequestInit) => Promise<Response>;
|
|
694
|
+
/** Which draft body to open in the Word editor (`POST /drafts/editor`). */
|
|
695
|
+
interface MailDraftEditorRequest {
|
|
696
|
+
/** A saved draft (its room, or a new one seeded from it). */
|
|
697
|
+
draftId?: string;
|
|
698
|
+
/** A room this person already has open: a reconnect, or a new message not saved yet. */
|
|
699
|
+
roomId?: string;
|
|
700
|
+
/** What a new message's room starts from (a reply's quote). */
|
|
701
|
+
text?: string;
|
|
702
|
+
html?: string | null;
|
|
703
|
+
/** The workspace open in the app: a new draft bills its project when the person may. */
|
|
704
|
+
workspaceExtId?: string | null;
|
|
705
|
+
}
|
|
706
|
+
/** A project an email's AI work is billed to: the person's own, or a matter they own or collaborate in. */
|
|
707
|
+
interface MailProject {
|
|
708
|
+
external_id: string;
|
|
709
|
+
name: string;
|
|
710
|
+
personal: boolean;
|
|
711
|
+
}
|
|
712
|
+
/** A collaboration session on a draft's body: a document session's fields plus the draft. */
|
|
713
|
+
interface MailDraftEditorSession {
|
|
714
|
+
room_id: string;
|
|
715
|
+
token: string;
|
|
716
|
+
expires_in: number;
|
|
717
|
+
websocket_path: string;
|
|
718
|
+
can_edit: boolean;
|
|
719
|
+
identity: {
|
|
720
|
+
actorId: string;
|
|
721
|
+
name: string;
|
|
722
|
+
role: 'human' | 'agent';
|
|
723
|
+
};
|
|
724
|
+
filename: string;
|
|
725
|
+
draft_id?: string | null;
|
|
726
|
+
/** The project ARBI's work on this email is billed to. */
|
|
727
|
+
project?: MailProject | null;
|
|
728
|
+
}
|
|
729
|
+
interface MailClient {
|
|
730
|
+
fetch: MailFetch;
|
|
731
|
+
getPolicy(): Promise<MailPolicy>;
|
|
732
|
+
listAccounts(): Promise<MailAccount[]>;
|
|
733
|
+
listFolders(account: MailAccount): Promise<MailFolder[]>;
|
|
734
|
+
listMessages(account: MailAccount, folderId: string, query: string, cursor: string | null): Promise<MailPage>;
|
|
735
|
+
getMessage(account: MailAccount, messageId: string): Promise<MailMessage>;
|
|
736
|
+
/** Hand this session what the server needs to read the account (keys, credentials). */
|
|
737
|
+
unlock(account: MailAccount): Promise<void>;
|
|
738
|
+
/**
|
|
739
|
+
* The encrypted payload for `/secure/send` (native mail only). Absent: secure delivery is not
|
|
740
|
+
* offered.
|
|
741
|
+
*/
|
|
742
|
+
prepareSecureMail?(compose: MailCompose, account: MailAccount, requestId: string): Promise<unknown>;
|
|
743
|
+
/** The URL that connects an OAuth mail provider, returning to `returnPath`. Absent: not offered. */
|
|
744
|
+
authorizeOAuth?(vendor: string, returnPath: string): Promise<string>;
|
|
745
|
+
/**
|
|
746
|
+
* Open a native draft's body in the Word editor, unlocking its room for this session with the
|
|
747
|
+
* person's key when the server asks (423). Absent: the composer keeps its plain rich-text body.
|
|
748
|
+
*/
|
|
749
|
+
openDraftEditor?(request: MailDraftEditorRequest): Promise<MailDraftEditorSession>;
|
|
750
|
+
}
|
|
751
|
+
/** A read that needs the network and has no copy on this device (shown as a notice, not an error). */
|
|
752
|
+
declare class MailOfflineUnavailableError extends Error {
|
|
753
|
+
constructor(message: string);
|
|
754
|
+
}
|
|
755
|
+
declare function accountPath(id: string): string;
|
|
756
|
+
/** A JSON mail call: the parsed body, or `undefined` for 204. */
|
|
757
|
+
declare function mailJson<T>(fetch: MailFetch, path: string, init?: RequestInit): Promise<T>;
|
|
758
|
+
/** A client over `fetch`; `overrides` replace any of its reads or add the optional extras. */
|
|
759
|
+
declare function createMailClient(fetch: MailFetch, overrides?: Partial<MailClient>): MailClient;
|
|
760
|
+
/**
|
|
761
|
+
* The default client: the `Arbi` session's mail transport. The native inbox is unlocked with the
|
|
762
|
+
* signed-in user's keys before each read (so mail that arrived since is readable too); a connected
|
|
763
|
+
* account needs no unlock from here.
|
|
764
|
+
*/
|
|
765
|
+
declare function arbiMailClient(arbi: Arbi): MailClient;
|
|
766
|
+
/** A picked file as an attachment (its content base64-encoded). */
|
|
767
|
+
declare function fileAttachment(file: File): Promise<MailAttachment>;
|
|
768
|
+
/** The address suggested for a user's native inbox: given name and family name, lowercase ASCII, dot-joined. */
|
|
769
|
+
declare function defaultMailAlias(user?: {
|
|
770
|
+
given_name?: string | null;
|
|
771
|
+
family_name?: string | null;
|
|
772
|
+
} | null): string;
|
|
773
|
+
/**
|
|
774
|
+
* The alias to try after `alias` is taken: `grace.okoye` → `grace.okoye2`, `grace.okoye2` → `grace.okoye3`.
|
|
775
|
+
* The server is the only judge of availability, so this is a guess to offer, not a promise.
|
|
776
|
+
*/
|
|
777
|
+
declare function nextAliasSuggestion(alias: string): string;
|
|
778
|
+
/** True when the claim failed because the address is already in use (HTTP 409). */
|
|
779
|
+
declare function isAliasTakenError(err: Error): boolean;
|
|
780
|
+
/**
|
|
781
|
+
* Shown after `alias` is taken. The suggestion is unverified, so the copy must not say it is free:
|
|
782
|
+
* the server only checks availability when the user confirms the claim.
|
|
783
|
+
*/
|
|
784
|
+
declare function aliasTakenMessage(alias: string, suggestion: string, domain: string): string;
|
|
785
|
+
/** The draft a `mail_draft_ready` notification is about (its content is `{"mail_id": …}`). */
|
|
786
|
+
declare function mailDraftIdFromContent(content: string | null | undefined): string | undefined;
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* The session state every block reads and writes: the selected workspace, the current conversation,
|
|
790
|
+
* the document being viewed, the document selection, generation per conversation, Personal
|
|
791
|
+
* Assistant mode and the documents in each conversation.
|
|
792
|
+
*
|
|
793
|
+
* An {@link ArbiSessionStore} is the adapter a host gives as its configuration's `session`:
|
|
794
|
+
* a host with its own state (ARBI-frontend's zustand store) maps its fields onto
|
|
795
|
+
* {@link ArbiSessionState} and its actions onto the setters, so there is one source of truth.
|
|
796
|
+
* Other hosts use {@link createArbiSessionStore}, an in-memory store.
|
|
797
|
+
*/
|
|
798
|
+
/** The document being viewed. */
|
|
799
|
+
interface ArbiViewingDocument {
|
|
800
|
+
/** The document (`doc-…`), or a version reference (`doc-…@v2`) while an earlier version shows. */
|
|
801
|
+
id: string;
|
|
802
|
+
/** The page being read, when known. */
|
|
803
|
+
page: number | null;
|
|
804
|
+
/** The passage being read, when one is. */
|
|
805
|
+
passageId: string | null;
|
|
806
|
+
}
|
|
807
|
+
/** A tab of the document viewer. */
|
|
808
|
+
type ArbiViewerTab = 'pdf' | 'edit' | 'html' | 'docx' | 'xlsx' | 'versions' | 'preview';
|
|
809
|
+
/**
|
|
810
|
+
* The document viewer's own state, shared with whatever opens documents (a citation opens the text
|
|
811
|
+
* view, Compare from a documents list opens the redline): the open tab, the document compared with
|
|
812
|
+
* the one viewed, and a tab asked for when a document was opened (applied once it has loaded).
|
|
813
|
+
*/
|
|
814
|
+
interface ArbiDocumentViewerState {
|
|
815
|
+
tab: ArbiViewerTab;
|
|
816
|
+
/** The document (or version reference) compared with the viewed one, or null. */
|
|
817
|
+
compareId: string | null;
|
|
818
|
+
/** A tab to show once `documentId` has loaded (a signature request opens on the PDF). */
|
|
819
|
+
tabRequest: {
|
|
820
|
+
documentId: string;
|
|
821
|
+
tab: ArbiViewerTab;
|
|
822
|
+
} | null;
|
|
823
|
+
/** The text view's size, a multiplier of the normal size: a reading preference. */
|
|
824
|
+
textScale: number;
|
|
825
|
+
/** A phone user picked the PDF by hand: documents stop opening on the text view. */
|
|
826
|
+
phonePdfChosen: boolean;
|
|
827
|
+
}
|
|
828
|
+
/** Generation in one conversation. */
|
|
829
|
+
interface ArbiConversationGeneration {
|
|
830
|
+
isGenerating: boolean;
|
|
831
|
+
error: string | null;
|
|
832
|
+
/** When the running turn started (epoch ms). */
|
|
833
|
+
startTime: number | null;
|
|
834
|
+
}
|
|
835
|
+
/** A document in a conversation's context; a pinned one stays there across turns. */
|
|
836
|
+
interface ArbiConversationDocument {
|
|
837
|
+
docId: string;
|
|
838
|
+
isPinned: boolean;
|
|
839
|
+
}
|
|
840
|
+
interface ArbiSessionState {
|
|
841
|
+
/** The selected workspace (`wrk-…`). */
|
|
842
|
+
workspaceId: string | null;
|
|
843
|
+
/** The open conversation, or null for a new one / none. */
|
|
844
|
+
conversationId: string | null;
|
|
845
|
+
viewingDocument: ArbiViewingDocument | null;
|
|
846
|
+
documentViewer: ArbiDocumentViewerState;
|
|
847
|
+
/** The documents selected in document lists. */
|
|
848
|
+
selectedDocumentIds: readonly string[];
|
|
849
|
+
/** Generation state per conversation id. */
|
|
850
|
+
generating: Readonly<Record<string, ArbiConversationGeneration>>;
|
|
851
|
+
/** Personal Assistant mode for new conversations. */
|
|
852
|
+
paMode: boolean;
|
|
853
|
+
/** The documents in each conversation's context, per conversation id. */
|
|
854
|
+
conversationDocuments: Readonly<Record<string, readonly ArbiConversationDocument[]>>;
|
|
855
|
+
}
|
|
856
|
+
/** What to view: page and passage are left unchanged when omitted. */
|
|
857
|
+
interface ArbiViewingDocumentInput {
|
|
858
|
+
id: string;
|
|
859
|
+
page?: number | null;
|
|
860
|
+
passageId?: string | null;
|
|
861
|
+
}
|
|
862
|
+
interface ArbiSessionStore {
|
|
863
|
+
/** The current state. The same object until something in it changes. */
|
|
864
|
+
getState(): ArbiSessionState;
|
|
865
|
+
/** Be told when the state may have changed. Returns the unsubscribe. */
|
|
866
|
+
subscribe(listener: () => void): () => void;
|
|
867
|
+
setWorkspaceId(id: string | null): void;
|
|
868
|
+
setConversationId(id: string | null): void;
|
|
869
|
+
/**
|
|
870
|
+
* View a document, or none. Viewing another document resets the page; `page` and `passageId`
|
|
871
|
+
* set them when given.
|
|
872
|
+
*/
|
|
873
|
+
setViewingDocument(document: ArbiViewingDocumentInput | null): void;
|
|
874
|
+
/** Change the document viewer's state; fields not given stay. */
|
|
875
|
+
setDocumentViewer(change: Partial<ArbiDocumentViewerState>): void;
|
|
876
|
+
setSelectedDocumentIds(ids: string[]): void;
|
|
877
|
+
setConversationGenerating(conversationId: string, isGenerating: boolean): void;
|
|
878
|
+
setPaMode(enabled: boolean): void;
|
|
879
|
+
setConversationDocuments(conversationId: string, documents: ArbiConversationDocument[]): void;
|
|
880
|
+
}
|
|
881
|
+
declare const DEFAULT_DOCUMENT_VIEWER_STATE: ArbiDocumentViewerState;
|
|
882
|
+
declare const EMPTY_SESSION_STATE: ArbiSessionState;
|
|
883
|
+
/** The viewed document itself (`doc-…`), also while one of its earlier versions is on screen. */
|
|
884
|
+
declare const selectViewingDocumentId: (state: ArbiSessionState) => string | null;
|
|
885
|
+
/** Whether `conversationId` is generating. */
|
|
886
|
+
declare const selectIsGenerating: (conversationId: string | null | undefined) => (state: ArbiSessionState) => boolean;
|
|
887
|
+
/** The next viewing document, given the current one (shared by every store implementation). */
|
|
888
|
+
declare function nextViewingDocument(current: ArbiViewingDocument | null, input: ArbiViewingDocumentInput | null): ArbiViewingDocument | null;
|
|
889
|
+
/** An in-memory session store: the default for hosts without state of their own. */
|
|
890
|
+
declare function createArbiSessionStore(initial?: Partial<ArbiSessionState>): ArbiSessionStore;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* What a host hands the `@arbidocs/react` hooks, as one configuration (`<ArbiHost config>`). Every
|
|
894
|
+
* field is optional: without one the hooks use their own default. `@arbidocs/blocks` extends it
|
|
895
|
+
* with the blocks domains (environment, billing, viewer, …).
|
|
896
|
+
*
|
|
897
|
+
* A field whose value lives in the host's state is a hook (`use…`), called by the hooks and kits
|
|
898
|
+
* that need it, so the configuration itself stays one stable object for the host's life.
|
|
899
|
+
*/
|
|
900
|
+
|
|
901
|
+
/** The mail client, and whether mail is on for the signed-in user. */
|
|
902
|
+
interface MailHost {
|
|
903
|
+
client: MailClient;
|
|
904
|
+
/**
|
|
905
|
+
* Whether mail reads run (signed in and entitled), and the server session the mailbox is
|
|
906
|
+
* unlocked for: unlocking runs again when it changes (`null`: none yet, nothing is unlocked).
|
|
907
|
+
* Absent: on, for one session.
|
|
908
|
+
*/
|
|
909
|
+
useStatus?: () => {
|
|
910
|
+
enabled: boolean;
|
|
911
|
+
sessionKey: string | null;
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
/** The account client of the settings kits, and whether account reads run (signed in). */
|
|
915
|
+
interface AccountHost {
|
|
916
|
+
client: AccountClient;
|
|
917
|
+
/** Absent: always. */
|
|
918
|
+
useEnabled?: () => boolean;
|
|
919
|
+
}
|
|
920
|
+
interface ArbiHostConfig {
|
|
921
|
+
/**
|
|
922
|
+
* The SDK on the signed-in session. A host with its own login passes one on its session
|
|
923
|
+
* (`new Arbi({ url, session })`); a blocks-only site gets one from `defaultHost`. A new instance (a
|
|
924
|
+
* new session, a newly opened workspace) re-renders every hook.
|
|
925
|
+
*/
|
|
926
|
+
arbi?: Arbi;
|
|
927
|
+
/** The session state the kits share. Absent: an in-memory one per top-level host. */
|
|
928
|
+
session?: ArbiSessionStore;
|
|
929
|
+
/** Live processing, uploads and the host's document actions. Absent: the package's own. */
|
|
930
|
+
documents?: DocumentsSupport;
|
|
931
|
+
/** The calendar kept on this device and account OAuth. Absent: online only, the user's connectors. */
|
|
932
|
+
calendar?: CalendarSupport;
|
|
933
|
+
/** Absent: mail on the `arbi` session. */
|
|
934
|
+
mail?: MailHost;
|
|
935
|
+
/** Absent: the account on the `arbi` session. */
|
|
936
|
+
account?: AccountHost;
|
|
937
|
+
/** Dictation for every `dictate` field. Absent: no mic button. */
|
|
938
|
+
dictate?: DictateContextValue;
|
|
939
|
+
/** The sign-in layer of a blocks-only site (`defaultHost` in `@arbidocs/blocks/connect`). */
|
|
940
|
+
connection?: ArbiHostConnection;
|
|
941
|
+
}
|
|
942
|
+
/** The host configuration in scope (`{}` outside an `<ArbiHost>`). */
|
|
943
|
+
declare function useArbiHost(): ArbiHostConfig;
|
|
944
|
+
|
|
945
|
+
/** How a nested `<ArbiHost>` combines its config with the enclosing one's. */
|
|
946
|
+
|
|
947
|
+
/** The nested config over the enclosing one: given fields replace, `environment` merges. */
|
|
948
|
+
declare function mergeHostConfig(parent: HostConfigRecord, config: object): HostConfigRecord;
|
|
949
|
+
|
|
950
|
+
/** `<ArbiHost config>` with the `@arbidocs/react` domains (see ./ArbiHost.tsx). */
|
|
951
|
+
declare const ArbiHost: (props: ArbiHostProps<ArbiHostConfig>) => React.ReactElement;
|
|
952
|
+
|
|
953
|
+
interface ArbiChatPassage {
|
|
954
|
+
id: string;
|
|
955
|
+
/** The source document's id, when the backend reports it (what "open document" needs). */
|
|
956
|
+
documentId: string | null;
|
|
957
|
+
documentTitle: string;
|
|
958
|
+
page: number | null;
|
|
959
|
+
text: string;
|
|
960
|
+
}
|
|
961
|
+
interface ArbiChatCitation {
|
|
962
|
+
/** The number in `(#cite-N)`. */
|
|
963
|
+
num: string;
|
|
964
|
+
/** The statement the model cited. */
|
|
965
|
+
statement: string;
|
|
966
|
+
/** Title of the first source document. */
|
|
967
|
+
documentTitle: string;
|
|
968
|
+
/** Page of the first passage. */
|
|
969
|
+
page: number | null;
|
|
970
|
+
passages: ArbiChatPassage[];
|
|
971
|
+
}
|
|
972
|
+
/** The citations of a message's `tools` (stored history) or of streamed metadata. */
|
|
973
|
+
declare function toChatCitations(source: {
|
|
974
|
+
tools?: object | null;
|
|
975
|
+
} | null | undefined): ArbiChatCitation[];
|
|
976
|
+
|
|
977
|
+
type ArbiChatRole = 'user' | 'assistant';
|
|
978
|
+
type ArbiChatMessageStatus = 'streaming' | 'complete' | 'error';
|
|
979
|
+
interface ArbiChatMessage {
|
|
980
|
+
mentions?: QueryOptions['mentions'];
|
|
981
|
+
authorId?: string;
|
|
982
|
+
id: string;
|
|
983
|
+
role: ArbiChatRole;
|
|
984
|
+
/** Markdown for an assistant message, plain text for a user message. */
|
|
985
|
+
content: string;
|
|
986
|
+
status: ArbiChatMessageStatus;
|
|
987
|
+
/** Why an assistant message failed. */
|
|
988
|
+
error?: string;
|
|
989
|
+
/** Agent steps (tool calls, reasoning) the answer took. */
|
|
990
|
+
stepCount?: number;
|
|
991
|
+
/** The sources behind `[statement](#cite-N)` marks in `content`. */
|
|
992
|
+
citations?: ArbiChatCitation[];
|
|
993
|
+
/** The reader stopped the answer; `content` is what had streamed. */
|
|
994
|
+
stopped?: boolean;
|
|
995
|
+
/** The backend id of a finished assistant answer: what a follow-up chains from. */
|
|
996
|
+
responseId?: string;
|
|
997
|
+
/**
|
|
998
|
+
* A user message the server sent to start a workflow's step (its `tools.workflow_step`): the
|
|
999
|
+
* step's id. A chat shows it as that step, not as the raw instruction.
|
|
1000
|
+
*/
|
|
1001
|
+
workflowStep?: string;
|
|
1002
|
+
}
|
|
1003
|
+
/** The workflow step a stored message starts (its `tools.workflow_step` marker), if any. */
|
|
1004
|
+
declare function workflowStepOf(tools: object | null | undefined): string | undefined;
|
|
1005
|
+
interface ArbiChatThread {
|
|
1006
|
+
id: string;
|
|
1007
|
+
/** The backend title, else the first question; empty until there is one. */
|
|
1008
|
+
title: string;
|
|
1009
|
+
}
|
|
1010
|
+
interface ArbiChatDocument {
|
|
1011
|
+
id: string;
|
|
1012
|
+
name: string;
|
|
1013
|
+
isSelected: boolean;
|
|
1014
|
+
}
|
|
1015
|
+
interface UseArbiChatOptions {
|
|
1016
|
+
/** Use an owned agent's independent session, history and sandbox files. */
|
|
1017
|
+
agentId?: string;
|
|
1018
|
+
/** The workspace to chat in. Threads and the document selection reset when it changes. */
|
|
1019
|
+
workspaceId?: string;
|
|
1020
|
+
/** Assistant configuration or model id passed to every query. */
|
|
1021
|
+
model?: string;
|
|
1022
|
+
/**
|
|
1023
|
+
* Drafting mode: the saved document the turn is about, read once as each question is sent (not
|
|
1024
|
+
* for a comment that does not call the assistant). The request names it
|
|
1025
|
+
* (`active_artifact_ext_id`), so the assistant works in that document. Return nothing when no
|
|
1026
|
+
* document is open. `@arbidocs/blocks` binds it to the open document.
|
|
1027
|
+
*/
|
|
1028
|
+
activeArtifact?: () => string | null | undefined;
|
|
1029
|
+
/** Longest auto-title in characters (used until the backend has titled the conversation). Default 48. */
|
|
1030
|
+
titleLength?: number;
|
|
1031
|
+
/**
|
|
1032
|
+
* When the answer stream ends without the terminal `response.completed` event (a dropped
|
|
1033
|
+
* connection, a stalled run), the stored message is polled this often (ms) and for at most
|
|
1034
|
+
* `timeoutMs` before the turn is shown as failed with a Retry. Default 3000 / 120000.
|
|
1035
|
+
*/
|
|
1036
|
+
streamRecovery?: {
|
|
1037
|
+
intervalMs?: number;
|
|
1038
|
+
timeoutMs?: number;
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
interface ArbiChat {
|
|
1042
|
+
assistantMode: 'always' | 'mentioned';
|
|
1043
|
+
isUpdatingAssistantMode: boolean;
|
|
1044
|
+
isPostingComment: boolean;
|
|
1045
|
+
setAssistantMode: (mode: 'always' | 'mentioned') => Promise<void>;
|
|
1046
|
+
threads: ArbiChatThread[];
|
|
1047
|
+
activeThreadId: string;
|
|
1048
|
+
messages: ArbiChatMessage[];
|
|
1049
|
+
/** An answer is streaming. */
|
|
1050
|
+
isRunning: boolean;
|
|
1051
|
+
/** The last turn failed (the message list also carries the failed message). */
|
|
1052
|
+
error: string | null;
|
|
1053
|
+
/** A stored conversation's messages are loading. */
|
|
1054
|
+
isLoadingThread: boolean;
|
|
1055
|
+
/** The conversation list is loading. */
|
|
1056
|
+
isLoadingThreads: boolean;
|
|
1057
|
+
/** Loading or deleting a stored conversation failed. */
|
|
1058
|
+
historyError: string | null;
|
|
1059
|
+
documents: ArbiChatDocument[];
|
|
1060
|
+
isLoadingDocuments: boolean;
|
|
1061
|
+
isUploading: boolean;
|
|
1062
|
+
uploadError: string | null;
|
|
1063
|
+
send: (text: string, options?: {
|
|
1064
|
+
mentions?: QueryOptions['mentions'];
|
|
1065
|
+
}) => Promise<void>;
|
|
1066
|
+
/** Re-ask the question whose answer failed. */
|
|
1067
|
+
retry: () => Promise<void>;
|
|
1068
|
+
/** Abort the running answer; what streamed so far stays, marked stopped. */
|
|
1069
|
+
stop: () => void;
|
|
1070
|
+
selectThread: (id: string) => void;
|
|
1071
|
+
newThread: () => void;
|
|
1072
|
+
/** Deletes the conversation on the backend too. */
|
|
1073
|
+
deleteThread: (id: string) => void;
|
|
1074
|
+
toggleDocument: (id: string) => void;
|
|
1075
|
+
selectAllDocuments: () => void;
|
|
1076
|
+
upload: (files: File[]) => Promise<void>;
|
|
1077
|
+
}
|
|
1078
|
+
/** First words of a question as a title: whole words, no trailing punctuation, ellipsis when cut. */
|
|
1079
|
+
declare function titleFromQuestion(question: string, maxLength?: number): string;
|
|
1080
|
+
declare function useArbiChat(options?: UseArbiChatOptions): ArbiChat;
|
|
1081
|
+
|
|
1082
|
+
/** Animated typing indicator (three bouncing dots) */
|
|
1083
|
+
declare const TypingIndicator: React$1.MemoExoticComponent<() => React$1.JSX.Element>;
|
|
1084
|
+
interface ChatBubbleProps {
|
|
1085
|
+
message: string;
|
|
1086
|
+
timestamp: string;
|
|
1087
|
+
isSent: boolean;
|
|
1088
|
+
deleted?: boolean;
|
|
1089
|
+
read?: boolean;
|
|
1090
|
+
onDelete?: () => void;
|
|
1091
|
+
/**
|
|
1092
|
+
* Copy a shareable deep link to this exact message. Optional — the host
|
|
1093
|
+
* builds the URL (it knows the workspace/deployment domain, the light
|
|
1094
|
+
* package doesn't), this just renders the affordance and calls back.
|
|
1095
|
+
*/
|
|
1096
|
+
onCopyLink?: () => void;
|
|
1097
|
+
/** Stable DOM anchor for scroll-to-message (a notification deep link, a
|
|
1098
|
+
* "jump to this message" action). Typically the message's external id. */
|
|
1099
|
+
id?: string;
|
|
1100
|
+
/** Brief highlight flash — set true right after scrolling into view. */
|
|
1101
|
+
highlighted?: boolean;
|
|
1102
|
+
/** Last bubble in a same-sender run; shows the timestamp and read receipt. */
|
|
1103
|
+
isLastOfRun?: boolean;
|
|
1104
|
+
/**
|
|
1105
|
+
* Who sent it. Rendered in the meta row on the last bubble of a run, so a
|
|
1106
|
+
* thread that needs attribution (a group, or a rail-less list where the peer
|
|
1107
|
+
* isn't in a header) gets it without a row per message.
|
|
1108
|
+
*/
|
|
1109
|
+
senderName?: string;
|
|
1110
|
+
/** Per-slot brand overrides, so a consumer pins its accent in one place. */
|
|
1111
|
+
classNames?: {
|
|
1112
|
+
/** The current user's own bubble. */
|
|
1113
|
+
ownBubble?: string;
|
|
1114
|
+
/** The peer's bubble. */
|
|
1115
|
+
peerBubble?: string;
|
|
1116
|
+
};
|
|
1117
|
+
/**
|
|
1118
|
+
* Render the message body. Injected by the host so the light package doesn't
|
|
1119
|
+
* depend on the app's markdown renderer. Defaults to plain text.
|
|
1120
|
+
*/
|
|
1121
|
+
renderMessage?: (message: string) => ReactNode;
|
|
1122
|
+
/**
|
|
1123
|
+
* Format the timestamp shown on the last bubble of a run. Defaults to the
|
|
1124
|
+
* raw string.
|
|
1125
|
+
*/
|
|
1126
|
+
formatTimestamp?: (timestamp: string) => string;
|
|
1127
|
+
/**
|
|
1128
|
+
* Rendered inside the bubble under the text — e.g. a message's attached
|
|
1129
|
+
* files. The host owns fetching and decrypting them. A message with
|
|
1130
|
+
* attachments and no text shows only these.
|
|
1131
|
+
*/
|
|
1132
|
+
attachments?: ReactNode;
|
|
1133
|
+
/** Marks the message row, including the deleted tombstone. */
|
|
1134
|
+
'data-testid'?: string;
|
|
1135
|
+
}
|
|
1136
|
+
declare const ChatBubble: React$1.MemoExoticComponent<({ message, timestamp, isSent, deleted, read, onDelete, onCopyLink, id, highlighted, isLastOfRun, senderName, classNames, renderMessage, formatTimestamp, attachments, "data-testid": testId, }: ChatBubbleProps) => React$1.JSX.Element>;
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* The `Arbi` of the host configuration (`<ArbiHost config={{ arbi }}>`).
|
|
1140
|
+
*/
|
|
1141
|
+
|
|
1142
|
+
declare function useArbi(): Arbi;
|
|
1143
|
+
/**
|
|
1144
|
+
* The deployment domain the user's keys are derived for, as the host's `Arbi` computes it
|
|
1145
|
+
* (`deploymentDomain`, else the API URL's hostname). `undefined` without one. The document tools
|
|
1146
|
+
* default their `deploymentDomain` (needed for e-signing) to it.
|
|
1147
|
+
*/
|
|
1148
|
+
declare function useDeploymentDomain(): string | undefined;
|
|
1149
|
+
|
|
1150
|
+
interface ArbiWebSocketProviderProps {
|
|
1151
|
+
/**
|
|
1152
|
+
* Open the socket only when the app is authenticated against a live backend.
|
|
1153
|
+
* Defaults to `true`; pass the connection status so demo/logged-out sessions
|
|
1154
|
+
* don't try to connect.
|
|
1155
|
+
*/
|
|
1156
|
+
enabled?: boolean;
|
|
1157
|
+
children: ReactNode;
|
|
1158
|
+
}
|
|
1159
|
+
declare function ArbiWebSocketProvider({ enabled, children }: ArbiWebSocketProviderProps): React$1.JSX.Element;
|
|
1160
|
+
|
|
1161
|
+
type ArbiWsSubscriber = (msg: WebSocketServerMessage) => void;
|
|
1162
|
+
interface ArbiWsContextValue {
|
|
1163
|
+
subscribe: (fn: ArbiWsSubscriber) => () => void;
|
|
1164
|
+
}
|
|
1165
|
+
declare function useArbiWsContext(): ArbiWsContextValue;
|
|
1166
|
+
|
|
1167
|
+
type ArbiWsStatus = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
|
|
1168
|
+
interface ArbiWsState {
|
|
1169
|
+
/** Live connection status of the shared socket. */
|
|
1170
|
+
status: ArbiWsStatus;
|
|
1171
|
+
/** Latest processing status per document id (the `task_update` stream). */
|
|
1172
|
+
tasks: Record<string, WsTaskUpdateMessage>;
|
|
1173
|
+
/** The most recent `task_update` — a convenient single-value change trigger. */
|
|
1174
|
+
lastTaskUpdate: WsTaskUpdateMessage | null;
|
|
1175
|
+
/** Online status keyed by user id (the `presence_update` stream). */
|
|
1176
|
+
presence: Record<string, string>;
|
|
1177
|
+
setStatus: (status: ArbiWsStatus) => void;
|
|
1178
|
+
applyTaskUpdate: (msg: WsTaskUpdateMessage) => void;
|
|
1179
|
+
applyPresence: (msg: WsPresenceUpdateMessage) => void;
|
|
1180
|
+
reset: () => void;
|
|
1181
|
+
}
|
|
1182
|
+
declare const useArbiWsStore: zustand.UseBoundStore<zustand.StoreApi<ArbiWsState>>;
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Typed subscription + selector hooks for the shared WebSocket.
|
|
1186
|
+
*
|
|
1187
|
+
* All message typing flows from the OpenAPI-derived `WebSocketServerMessage`
|
|
1188
|
+
* union — handlers are narrowed by the discriminant `type`, exactly like the
|
|
1189
|
+
* rest of the SDK.
|
|
1190
|
+
*/
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Subscribe to every server message. The handler is kept in a ref, so passing a
|
|
1194
|
+
* new inline function each render does not resubscribe.
|
|
1195
|
+
*/
|
|
1196
|
+
declare function useArbiWebSocket(onMessage: (msg: WebSocketServerMessage) => void): void;
|
|
1197
|
+
/**
|
|
1198
|
+
* Subscribe to a single message type, fully narrowed to that variant.
|
|
1199
|
+
*
|
|
1200
|
+
* @example
|
|
1201
|
+
* useArbiWsMessage<WsBatchCompleteMessage>('batch_complete', (msg) => {
|
|
1202
|
+
* // msg.batch_type, msg.doc_ext_ids are typed
|
|
1203
|
+
* })
|
|
1204
|
+
*/
|
|
1205
|
+
declare function useArbiWsMessage<T extends WebSocketServerMessage>(type: T['type'], handler: (msg: T) => void): void;
|
|
1206
|
+
/** Live connection status of the shared socket. */
|
|
1207
|
+
declare function useArbiWsStatus(): ArbiWsStatus;
|
|
1208
|
+
/** `true` once the shared socket is authenticated and connected. */
|
|
1209
|
+
declare function useArbiConnected(): boolean;
|
|
1210
|
+
/** The latest processing status per document id (the `task_update` stream). */
|
|
1211
|
+
declare function useArbiWsTasks(): Record<string, {
|
|
1212
|
+
type: "task_update";
|
|
1213
|
+
doc_ext_id: string;
|
|
1214
|
+
version: number;
|
|
1215
|
+
workspace_ext_id: string;
|
|
1216
|
+
file_name: string;
|
|
1217
|
+
status: "uploading" | "queued" | "parsing" | "encrypting" | "indexing" | "analysing" | "completed" | "failed" | "skipped" | "empty" | "low-content";
|
|
1218
|
+
progress: number;
|
|
1219
|
+
failed_stage?: string | null;
|
|
1220
|
+
folder?: string | null;
|
|
1221
|
+
}>;
|
|
1222
|
+
/** The latest processing status for a single document, if any. */
|
|
1223
|
+
declare function useArbiWsTask(docId: string): {
|
|
1224
|
+
type: "task_update";
|
|
1225
|
+
doc_ext_id: string;
|
|
1226
|
+
version: number;
|
|
1227
|
+
workspace_ext_id: string;
|
|
1228
|
+
file_name: string;
|
|
1229
|
+
status: "uploading" | "queued" | "parsing" | "encrypting" | "indexing" | "analysing" | "completed" | "failed" | "skipped" | "empty" | "low-content";
|
|
1230
|
+
progress: number;
|
|
1231
|
+
failed_stage?: string | null;
|
|
1232
|
+
folder?: string | null;
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Keep a workspace's documents (and tags) current from WebSocket events — the shared, no-polling
|
|
1237
|
+
* replacement for refetch loops.
|
|
1238
|
+
*
|
|
1239
|
+
* Mount `useArbiDocumentSync(workspaceId)` once wherever the document list matters. It re-reads
|
|
1240
|
+
* just the documents an event names and patches them into the list (`refreshDocuments`):
|
|
1241
|
+
* - `batch_complete` (upload, AI fields, extraction) for this workspace: its documents, and the
|
|
1242
|
+
* tag list (a batch may create tags);
|
|
1243
|
+
* - a finished `task_update` for a document (processing over).
|
|
1244
|
+
* so freshly uploaded, freshly coded or freshly processed documents appear without anyone
|
|
1245
|
+
* polling or re-reading the whole list.
|
|
1246
|
+
*/
|
|
1247
|
+
declare function useArbiDocumentSync(workspaceId: string | undefined): void;
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* Pure workspace adapters: an SDK `WorkspaceResponse` (or the host's own copy of it) to the view
|
|
1251
|
+
* models the shell and the workspaces gallery show. No React state, no SDK calls, so a host that
|
|
1252
|
+
* has no `arbi` in its host can use them too.
|
|
1253
|
+
*/
|
|
1254
|
+
|
|
1255
|
+
/** Workspace visibility: public = common, several members = shared, else private. */
|
|
1256
|
+
type ShellWorkspaceKind = 'private' | 'shared' | 'common';
|
|
1257
|
+
/** One face on a workspace card. */
|
|
1258
|
+
interface ShellWorkspaceMember {
|
|
1259
|
+
name: string;
|
|
1260
|
+
picture?: string | null;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* The fields of an SDK workspace the adapters read. Every field but the id and the name is
|
|
1264
|
+
* optional, so the SDK's `WorkspaceResponse` and a host's own copy of it are both assignable.
|
|
1265
|
+
*/
|
|
1266
|
+
interface ShellWorkspaceSource {
|
|
1267
|
+
external_id: string;
|
|
1268
|
+
name: string;
|
|
1269
|
+
description?: string | null;
|
|
1270
|
+
is_public?: boolean;
|
|
1271
|
+
project_name?: string | null;
|
|
1272
|
+
updated_at?: string;
|
|
1273
|
+
shared_document_count?: number;
|
|
1274
|
+
private_document_count?: number;
|
|
1275
|
+
users?: ReadonlyArray<{
|
|
1276
|
+
user?: {
|
|
1277
|
+
given_name?: string | null;
|
|
1278
|
+
family_name?: string | null;
|
|
1279
|
+
email?: string | null;
|
|
1280
|
+
picture?: string | null;
|
|
381
1281
|
};
|
|
382
1282
|
/** Set when the member is an agent: agents are not people and are left off the faces. */
|
|
383
1283
|
agent_ext_id?: string | null;
|
|
@@ -434,7 +1334,7 @@ declare function pickRecentWorkspaces(items: readonly ShellWorkspaceItem[], acti
|
|
|
434
1334
|
* Source-agnostic on purpose: the host hands in the list and the selection mechanism it already
|
|
435
1335
|
* has (ARBI-frontend its React Query hook and workspace store, a connected app `useWorkspaces`
|
|
436
1336
|
* plus the connection's `setWorkspace`). `useArbiShellWorkspaces` is the same hook wired to an
|
|
437
|
-
* `<
|
|
1337
|
+
* `<ArbiHost>`.
|
|
438
1338
|
*/
|
|
439
1339
|
|
|
440
1340
|
/** Workspaces to show while the account has none (a demo); the host owns the data. */
|
|
@@ -492,13 +1392,17 @@ interface UseShellWorkspacesResult {
|
|
|
492
1392
|
declare function useShellWorkspaces<S extends ShellWorkspaceSource = ShellWorkspaceSource>(options: UseShellWorkspacesOptions<S>): UseShellWorkspacesResult;
|
|
493
1393
|
interface UseArbiShellWorkspacesOptions extends Omit<UseShellWorkspacesOptions, 'workspaces' | 'isLoading' | 'loadError' | 'select'> {
|
|
494
1394
|
/**
|
|
495
|
-
* Override how a workspace is made current. Default:
|
|
496
|
-
*
|
|
497
|
-
*
|
|
1395
|
+
* Override how a workspace is made current. Default: the session's workspace switch (open it on
|
|
1396
|
+
* the server with `arbi.selectWorkspace`, then record it as the session's `workspaceId`, so the
|
|
1397
|
+
* host and the server agree). A host with its own switch (the connection layer's `setWorkspace`,
|
|
1398
|
+
* the app's workspace switch) passes it here.
|
|
498
1399
|
*/
|
|
499
1400
|
select?: UseShellWorkspacesOptions['select'];
|
|
500
1401
|
}
|
|
501
|
-
/**
|
|
1402
|
+
/**
|
|
1403
|
+
* `useShellWorkspaces` over the host `Arbi`'s workspace list and the session's workspace. Opening
|
|
1404
|
+
* one is navigation: it switches the session's workspace (see `select`).
|
|
1405
|
+
*/
|
|
502
1406
|
declare function useArbiShellWorkspaces(options?: UseArbiShellWorkspacesOptions): UseShellWorkspacesResult;
|
|
503
1407
|
|
|
504
1408
|
type WorkspaceUpdate = components['schemas']['WorkspaceUpdateRequest'];
|
|
@@ -746,6 +1650,16 @@ declare const arbiQueryKeys: {
|
|
|
746
1650
|
currentUser: () => readonly ["arbi", "currentUser"];
|
|
747
1651
|
firmPool: () => readonly ["arbi", "firmPool"];
|
|
748
1652
|
contacts: () => readonly ["arbi", "contacts"];
|
|
1653
|
+
/** Every chat query (the list and each open thread). */
|
|
1654
|
+
chats: () => readonly ["arbi", "chats"];
|
|
1655
|
+
/** My chats, raw (titles and last messages are ciphertext), most recently active first. */
|
|
1656
|
+
chatList: () => readonly ["arbi", "chats", "list"];
|
|
1657
|
+
/** One thread's loaded messages, decrypted, oldest first (`ChatThreadData`). */
|
|
1658
|
+
chatThread: (chatExtId: string) => readonly ["arbi", "chats", "thread", string];
|
|
1659
|
+
/** My own agent's progress on my last message to it (`agent_dm_status`), per agent. */
|
|
1660
|
+
agentDmStatus: (agentExtId: string) => readonly ["arbi", "chats", "agentStatus", string];
|
|
1661
|
+
/** The paid features this person may use (`/v1/user/entitlements`). */
|
|
1662
|
+
entitlements: () => readonly ["arbi", "entitlements"];
|
|
749
1663
|
skills: () => readonly ["arbi", "skills"];
|
|
750
1664
|
/** A skill's main file (SKILL.md), as text. */
|
|
751
1665
|
skillSource: (docExtId: string) => readonly ["arbi", "skills", "source", string];
|
|
@@ -2975,7 +3889,10 @@ declare function useGrantAgentAccess(): _tanstack_react_query.UseMutationResult<
|
|
|
2975
3889
|
agent_ext_id?: string | null | undefined;
|
|
2976
3890
|
is_temporary: boolean;
|
|
2977
3891
|
}[], Error, GrantAgentAccessVars, unknown>;
|
|
2978
|
-
/**
|
|
3892
|
+
/**
|
|
3893
|
+
* Take an agent out of a workspace (owner only). The workspace is named on the request (opened for
|
|
3894
|
+
* the session, not switched to), so the app's current workspace never changes.
|
|
3895
|
+
*/
|
|
2979
3896
|
declare function useRevokeAgentAccess(): _tanstack_react_query.UseMutationResult<void, Error, {
|
|
2980
3897
|
agentExtId: string;
|
|
2981
3898
|
workspaceId: string;
|
|
@@ -3015,6 +3932,18 @@ declare function useUploadSkillFiles(): _tanstack_react_query.UseMutationResult<
|
|
|
3015
3932
|
content: Blob;
|
|
3016
3933
|
shared?: boolean;
|
|
3017
3934
|
}[], unknown>;
|
|
3935
|
+
/**
|
|
3936
|
+
* Save a SKILL.md as the user's own skill `slug` (`arbi.assistant.uploadSkill`): private unless
|
|
3937
|
+
* `shared`. Pass `shared: isSharedSkill(skill)` from `@arbidocs/sdk` when changing an existing
|
|
3938
|
+
* skill, so a shared one stays shared and nothing else is ever published by saving.
|
|
3939
|
+
*/
|
|
3940
|
+
declare function useSaveSkill(): _tanstack_react_query.UseMutationResult<{
|
|
3941
|
+
doc_ext_ids?: string[];
|
|
3942
|
+
}, Error, {
|
|
3943
|
+
slug: string;
|
|
3944
|
+
markdown: string;
|
|
3945
|
+
shared?: boolean;
|
|
3946
|
+
}, unknown>;
|
|
3018
3947
|
/**
|
|
3019
3948
|
* A skill's main file (SKILL.md) as text, read on demand (a skill's detail or its editor), never
|
|
3020
3949
|
* for the whole list.
|
|
@@ -3188,6 +4117,11 @@ declare function useCreateTag(): _tanstack_react_query.UseMutationResult<{
|
|
|
3188
4117
|
created_at: string;
|
|
3189
4118
|
updated_at: string;
|
|
3190
4119
|
}, Error, CreateTagInput, unknown>;
|
|
4120
|
+
/**
|
|
4121
|
+
* Whether a tag of this name (any case) is being created right now: a second create of the same
|
|
4122
|
+
* name (a double Enter) is skipped instead of making a duplicate.
|
|
4123
|
+
*/
|
|
4124
|
+
declare function useIsCreatingTag(): (name: string) => boolean;
|
|
3191
4125
|
/** Change a tag (name, format, instruction, parent, sharing, values): patched in the list. */
|
|
3192
4126
|
declare function useUpdateTag(): _tanstack_react_query.UseMutationResult<{
|
|
3193
4127
|
external_id: string;
|
|
@@ -3248,9 +4182,8 @@ declare function useDeleteTag(): _tanstack_react_query.UseMutationResult<{
|
|
|
3248
4182
|
}, Error, string, unknown>;
|
|
3249
4183
|
/**
|
|
3250
4184
|
* Find the people and organisations documents name and link each to its entity tag. Accepted at
|
|
3251
|
-
* once with the documents' ids
|
|
3252
|
-
*
|
|
3253
|
-
* until then).
|
|
4185
|
+
* once with the documents' ids, which show as running (`useEntityExtractionDocIds`) until a
|
|
4186
|
+
* `batch_complete` (`entity_extract`) WebSocket message says they are done.
|
|
3254
4187
|
*/
|
|
3255
4188
|
declare function useExtractEntities(): _tanstack_react_query.UseMutationResult<{
|
|
3256
4189
|
doc_ext_ids: string[];
|
|
@@ -3317,14 +4250,16 @@ declare function registerArbiMutationDefaults(queryClient: QueryClient, client:
|
|
|
3317
4250
|
/**
|
|
3318
4251
|
* Whether a package query is worth persisting for an offline start (a host's
|
|
3319
4252
|
* `shouldDehydrateQuery`): the documents lists, documents, their versions and near-duplicate
|
|
3320
|
-
* pairs
|
|
4253
|
+
* pairs (metadata, never a document's content), the workspace list (its keys stay wrapped) and
|
|
4254
|
+
* the user settings.
|
|
3321
4255
|
*/
|
|
3322
4256
|
declare function isOfflineReadableArbiQuery(queryKey: QueryKey): boolean;
|
|
3323
4257
|
/**
|
|
3324
4258
|
* Whether a persisted package query may be restored when the app starts online. Not a documents
|
|
3325
4259
|
* list (it is never re-read on its own, so a stale copy would be trusted all session: it loads
|
|
3326
4260
|
* fresh instead), nor a document saved while still processing (its saved freshness would keep it
|
|
3327
|
-
* "processing" with no re-read).
|
|
4261
|
+
* "processing" with no re-read). The other families (the workspace list, the settings) always.
|
|
4262
|
+
* Offline, everything persisted is restored.
|
|
3328
4263
|
*/
|
|
3329
4264
|
declare function isRestorableArbiQueryOnline(queryKey: QueryKey, data: unknown): boolean;
|
|
3330
4265
|
|
|
@@ -5023,9 +5958,37 @@ declare function useUpdateContact(): _tanstack_react_query.UseMutationResult<{
|
|
|
5023
5958
|
outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null;
|
|
5024
5959
|
outcome_detail?: string | null;
|
|
5025
5960
|
}, Error, {
|
|
5026
|
-
id: string;
|
|
5961
|
+
id: string;
|
|
5962
|
+
card: contacts.ContactCardWrite;
|
|
5963
|
+
}, unknown>;
|
|
5964
|
+
/**
|
|
5965
|
+
* Invite a contact to ARBI by `email`: a card-only contact is linked in place (its row and card kept);
|
|
5966
|
+
* without an id a new card is created and invited. Rejects with `DuplicateContactError` when `email`
|
|
5967
|
+
* already belongs to another contact. The list refreshes either way.
|
|
5968
|
+
*/
|
|
5969
|
+
declare function useLinkContact(): _tanstack_react_query.UseMutationResult<{
|
|
5970
|
+
external_id?: string | null;
|
|
5971
|
+
email?: string | null;
|
|
5972
|
+
user?: _arbidocs_client.components["schemas"]["UserResponse"] | null;
|
|
5973
|
+
status: ("registered" | "invited" | "expired" | "card") | "failed";
|
|
5974
|
+
card?: _arbidocs_client.components["schemas"]["ContactCard"] | null;
|
|
5975
|
+
address_book_ext_id?: string | null;
|
|
5976
|
+
created_at: string;
|
|
5977
|
+
shared_workspace_ext_id?: string | null;
|
|
5978
|
+
outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null;
|
|
5979
|
+
outcome_detail?: string | null;
|
|
5980
|
+
}, Error, {
|
|
5981
|
+
contact: Pick<contacts.Contact, "external_id">;
|
|
5982
|
+
email: string;
|
|
5027
5983
|
card: contacts.ContactCardWrite;
|
|
5028
5984
|
}, unknown>;
|
|
5985
|
+
/** Import one .vcf file (Pro: 403 `pro_required` otherwise); the list refreshes after each file. */
|
|
5986
|
+
declare function useImportContacts(): _tanstack_react_query.UseMutationResult<{
|
|
5987
|
+
added: number;
|
|
5988
|
+
matched: number;
|
|
5989
|
+
skipped: _arbidocs_client.components["schemas"]["ContactImportSkipped"][];
|
|
5990
|
+
total: number;
|
|
5991
|
+
}, Error, Blob, unknown>;
|
|
5029
5992
|
/** Delete a contact, or withdraw its invitation, by contact id. */
|
|
5030
5993
|
declare function useDeleteContact(): _tanstack_react_query.UseMutationResult<void, Error, string, unknown>;
|
|
5031
5994
|
/**
|
|
@@ -5067,92 +6030,6 @@ declare const workspaceHouseTemplateId: (workspace: object | null | undefined) =
|
|
|
5067
6030
|
/** Whether the signed-in user may set the deployment default. */
|
|
5068
6031
|
declare const isDeploymentAdmin: (user: object | null | undefined) => boolean;
|
|
5069
6032
|
|
|
5070
|
-
interface ProfileView {
|
|
5071
|
-
givenName: string;
|
|
5072
|
-
familyName: string | null;
|
|
5073
|
-
picture: string | null;
|
|
5074
|
-
email: string;
|
|
5075
|
-
/** The sign-in provider manages the email (it cannot be changed here). */
|
|
5076
|
-
isSso: boolean;
|
|
5077
|
-
/** Verified tick: passed an ID check under this name, not expired. */
|
|
5078
|
-
isIdentityVerified?: boolean;
|
|
5079
|
-
/** Given and family name joined; empty while the profile has no name. */
|
|
5080
|
-
fullName: string;
|
|
5081
|
-
}
|
|
5082
|
-
/** The profile as the UI reads it. `fullName` is the profile name, never the email. */
|
|
5083
|
-
declare function toProfileView(profile: LoginProfile): ProfileView;
|
|
5084
|
-
/** The signed-in user's profile; `null` when the session has none (restored without a login). */
|
|
5085
|
-
declare function useProfile(options?: {
|
|
5086
|
-
enabled?: boolean;
|
|
5087
|
-
}): _tanstack_react_query.UseQueryResult<NoInfer<ProfileView | null>, Error>;
|
|
5088
|
-
interface UpdateProfileVars {
|
|
5089
|
-
givenName?: string;
|
|
5090
|
-
/** `''` clears it. */
|
|
5091
|
-
familyName?: string;
|
|
5092
|
-
/** A data URL or URL; `''` clears it (the backend caps it at 100 KB). */
|
|
5093
|
-
picture?: string;
|
|
5094
|
-
}
|
|
5095
|
-
/**
|
|
5096
|
-
* Save the name and/or picture (PATCH /v1/user/profile). The profile query is updated in place and
|
|
5097
|
-
* the workspace list (member rows carry the name) is refreshed, so every surface follows.
|
|
5098
|
-
*/
|
|
5099
|
-
declare function useUpdateProfile(): _tanstack_react_query.UseMutationResult<ProfileView | null, Error, UpdateProfileVars, unknown>;
|
|
5100
|
-
interface UseNameEditorOptions {
|
|
5101
|
-
givenName: string | null | undefined;
|
|
5102
|
-
familyName: string | null | undefined;
|
|
5103
|
-
/** Persist the new name. Reject to keep the editor open (see `error`). */
|
|
5104
|
-
save: (name: {
|
|
5105
|
-
givenName: string;
|
|
5106
|
-
familyName: string;
|
|
5107
|
-
}) => Promise<unknown> | unknown;
|
|
5108
|
-
}
|
|
5109
|
-
interface NameEditor {
|
|
5110
|
-
isEditing: boolean;
|
|
5111
|
-
givenName: string;
|
|
5112
|
-
familyName: string;
|
|
5113
|
-
onGivenNameChange: (value: string) => void;
|
|
5114
|
-
onFamilyNameChange: (value: string) => void;
|
|
5115
|
-
onStartEdit: () => void;
|
|
5116
|
-
onSave: () => void;
|
|
5117
|
-
onCancel: () => void;
|
|
5118
|
-
isSaving: boolean;
|
|
5119
|
-
/** The last failed save. */
|
|
5120
|
-
error: unknown;
|
|
5121
|
-
}
|
|
5122
|
-
/**
|
|
5123
|
-
* State of the inline name editor of `ProfileCard`: start edit (seeded from the current name),
|
|
5124
|
-
* save (trimmed; a blank given name is not saved), cancel. Spread it into `ProfileCard`'s `name`
|
|
5125
|
-
* with `display`.
|
|
5126
|
-
*/
|
|
5127
|
-
declare function useNameEditor({ givenName, familyName, save }: UseNameEditorOptions): NameEditor;
|
|
5128
|
-
/** Largest picture file accepted before cropping. */
|
|
5129
|
-
declare const MAX_AVATAR_FILE_BYTES: number;
|
|
5130
|
-
type AvatarFileProblem = 'not-image' | 'too-large' | 'unreadable';
|
|
5131
|
-
interface UseAvatarCropOptions {
|
|
5132
|
-
/** Persist the cropped picture (a data URL). */
|
|
5133
|
-
upload: (dataUrl: string) => Promise<unknown> | unknown;
|
|
5134
|
-
/** Report a rejected file or a failed read; default is silent (the picker just does not open). */
|
|
5135
|
-
onProblem?: (problem: AvatarFileProblem) => void;
|
|
5136
|
-
maxBytes?: number;
|
|
5137
|
-
}
|
|
5138
|
-
interface AvatarCrop {
|
|
5139
|
-
/** Pass to `AvatarPicker.onFileChosen`. */
|
|
5140
|
-
onFileChosen: (file: File) => void;
|
|
5141
|
-
/** The chosen image awaiting a crop (a data URL), else `null`. */
|
|
5142
|
-
pendingImage: string | null;
|
|
5143
|
-
/** Pass to the crop dialog's `onComplete`. */
|
|
5144
|
-
onCropComplete: (result: {
|
|
5145
|
-
dataUrl: string;
|
|
5146
|
-
}) => void;
|
|
5147
|
-
onCropCancel: () => void;
|
|
5148
|
-
isUploading: boolean;
|
|
5149
|
-
}
|
|
5150
|
-
/**
|
|
5151
|
-
* The choose, validate, crop, upload sequence behind `AvatarPicker`: the picker hands over a file,
|
|
5152
|
-
* this checks it (image, size) and reads it for the crop dialog, then uploads the cropped data URL.
|
|
5153
|
-
*/
|
|
5154
|
-
declare function useAvatarCrop({ upload, onProblem, maxBytes, }: UseAvatarCropOptions): AvatarCrop;
|
|
5155
|
-
|
|
5156
6033
|
/**
|
|
5157
6034
|
* Email change: ask for a code at the new address, confirm it. The SDK-bound mutations and the
|
|
5158
6035
|
* `ProfileCard` flow controller (cooldown on re-sending the code) are separate, as in `profile.ts`.
|
|
@@ -5196,64 +6073,6 @@ interface EmailChange {
|
|
|
5196
6073
|
/** The two-step email-change flow of `ProfileCard`: enter address, verify code. */
|
|
5197
6074
|
declare function useEmailChange({ requestCode, confirm, cooldownSeconds: cooldownLength, }: UseEmailChangeOptions): EmailChange;
|
|
5198
6075
|
|
|
5199
|
-
/**
|
|
5200
|
-
* Password change: a new master password for the same account identity.
|
|
5201
|
-
*
|
|
5202
|
-
* The password only wraps the identity keypair, so a change is one request that re-encrypts nothing
|
|
5203
|
-
* and leaves the recovery key as it was (see `Arbi.account.changePassword`). `usePasswordChange` is
|
|
5204
|
-
* the SDK-bound mutation. `usePasswordChangeForm` is the controller behind `PasswordChangeDialog`:
|
|
5205
|
-
* fields, validation, error wording and the success state. It takes the submit as a function, so an
|
|
5206
|
-
* app without an `ArbiProvider` binds the same dialog.
|
|
5207
|
-
*/
|
|
5208
|
-
interface PasswordChangeVars {
|
|
5209
|
-
newPassword: string;
|
|
5210
|
-
/** Omit in recovery mode (after signing in with a recovery key). */
|
|
5211
|
-
currentPassword?: string;
|
|
5212
|
-
}
|
|
5213
|
-
/** Change (or, in recovery mode, set) the master password through the account client in scope. */
|
|
5214
|
-
declare function usePasswordChange(): _tanstack_react_query.UseMutationResult<void, Error, PasswordChangeVars, unknown>;
|
|
5215
|
-
interface PasswordChangeFormMessages {
|
|
5216
|
-
required: string;
|
|
5217
|
-
mismatch: string;
|
|
5218
|
-
sameAsCurrent: string;
|
|
5219
|
-
wrongCurrent: string;
|
|
5220
|
-
wrongRecoveryKey: string;
|
|
5221
|
-
}
|
|
5222
|
-
declare const DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES: PasswordChangeFormMessages;
|
|
5223
|
-
interface UsePasswordChangeFormOptions {
|
|
5224
|
-
/** After recovery with a key: no current password is asked for. */
|
|
5225
|
-
recoveryMode?: boolean;
|
|
5226
|
-
/** The host's password policy: the first unmet requirement, or `null` when the password is fine. */
|
|
5227
|
-
getUnmetRequirement: (password: string) => string | null;
|
|
5228
|
-
/** Do the change. */
|
|
5229
|
-
submit: (vars: PasswordChangeVars) => Promise<void>;
|
|
5230
|
-
/** The dialog should close (cancel, or done). */
|
|
5231
|
-
onClose: () => void;
|
|
5232
|
-
/** Recovery finished: continue into the app. Recovery closes itself, with no success screen. */
|
|
5233
|
-
onRecoveryComplete?: () => void;
|
|
5234
|
-
messages?: Partial<PasswordChangeFormMessages>;
|
|
5235
|
-
}
|
|
5236
|
-
interface PasswordChangeForm {
|
|
5237
|
-
currentPassword: string;
|
|
5238
|
-
onCurrentPasswordChange: (value: string) => void;
|
|
5239
|
-
newPassword: string;
|
|
5240
|
-
onNewPasswordChange: (value: string) => void;
|
|
5241
|
-
confirmPassword: string;
|
|
5242
|
-
onConfirmPasswordChange: (value: string) => void;
|
|
5243
|
-
error: string | null;
|
|
5244
|
-
isProcessing: boolean;
|
|
5245
|
-
isSubmitDisabled: boolean;
|
|
5246
|
-
onSubmit: () => void;
|
|
5247
|
-
/** The change went through (normal mode): the dialog shows its success state. */
|
|
5248
|
-
isChanged: boolean;
|
|
5249
|
-
/** Cancel and clear the form. */
|
|
5250
|
-
onCancel: () => void;
|
|
5251
|
-
/** Leave the success screen. */
|
|
5252
|
-
onDone: () => void;
|
|
5253
|
-
}
|
|
5254
|
-
/** The state machine of `PasswordChangeDialog`; spread it into the dialog's props. */
|
|
5255
|
-
declare function usePasswordChangeForm({ recoveryMode, getUnmetRequirement, submit, onClose, onRecoveryComplete, messages, }: UsePasswordChangeFormOptions): PasswordChangeForm;
|
|
5256
|
-
|
|
5257
6076
|
/** A PATCH of the user settings: only the fields given change (lists are sent whole). */
|
|
5258
6077
|
type UserSettingsPatch = components['schemas']['UserSettingsUpdate'];
|
|
5259
6078
|
/** The user's settings record (flags, pins, notification preferences). */
|
|
@@ -5449,118 +6268,14 @@ interface FollowSaveCallbacks {
|
|
|
5449
6268
|
}
|
|
5450
6269
|
/** Whether the user follows a thread (pushed everything in it), and the switch. */
|
|
5451
6270
|
declare function useFollowThread(conversationId: string | null | undefined, options?: {
|
|
5452
|
-
enabled?: boolean;
|
|
5453
|
-
}): {
|
|
5454
|
-
following: boolean;
|
|
5455
|
-
setFollowing: (on: boolean, callbacks?: FollowSaveCallbacks) => void;
|
|
5456
|
-
isLoading: boolean;
|
|
5457
|
-
isSaving: boolean;
|
|
5458
|
-
error: Error | null;
|
|
5459
|
-
};
|
|
5460
|
-
|
|
5461
|
-
/**
|
|
5462
|
-
* Identity verification: the optional, paid ID check behind the verified tick (Pro plans only).
|
|
5463
|
-
*
|
|
5464
|
-
* Two layers, like `profile.ts`. `useIdentityVerificationFlow` owns the dialog's state and takes
|
|
5465
|
-
* the backend calls as functions, so an app with its own API layer (ARBI-frontend) binds the same
|
|
5466
|
-
* `IdentityVerificationCard` / `IdentityVerificationDialog` blocks without a provider.
|
|
5467
|
-
* `useIdentityVerification` binds it to the SDK (`arbi.identity`).
|
|
5468
|
-
*
|
|
5469
|
-
* Steps: pay the one-time fee (charged to the user's Pro project card) → verify inside Didit's
|
|
5470
|
-
* embedded frame → result (verified, declined, in review, or the name on the document differs from
|
|
5471
|
-
* the account name, offered as the new name). No webhooks: completing Didit's flow calls `refresh`.
|
|
5472
|
-
*/
|
|
5473
|
-
|
|
5474
|
-
/** The backend calls of the flow, as functions (see the module comment). */
|
|
5475
|
-
interface IdentityVerificationApi {
|
|
5476
|
-
status: () => Promise<IdentityStatus>;
|
|
5477
|
-
purchase: () => Promise<IdentityPurchase>;
|
|
5478
|
-
/** The Didit session URL. */
|
|
5479
|
-
startSession: () => Promise<string>;
|
|
5480
|
-
refresh: () => Promise<IdentityStatus>;
|
|
5481
|
-
acceptName: () => Promise<IdentityStatus>;
|
|
5482
|
-
remove: () => Promise<IdentityStatus>;
|
|
5483
|
-
}
|
|
5484
|
-
interface UseIdentityVerificationFlowOptions {
|
|
5485
|
-
/** Load the status (default true; e.g. false while signed out). */
|
|
5486
|
-
enabled?: boolean;
|
|
5487
|
-
/** The tick changed (granted, renamed away, removed): update the host's copy of the user. */
|
|
5488
|
-
onVerifiedChange?: (verified: boolean) => void;
|
|
5489
|
-
/** The account name became the name on the document. */
|
|
5490
|
-
onNameAccepted?: (name: {
|
|
5491
|
-
givenName: string;
|
|
5492
|
-
familyName: string | null;
|
|
5493
|
-
}) => void;
|
|
5494
|
-
/** The host's price format (e.g. its billing helpers); default `formatIdentityPrice`. */
|
|
5495
|
-
formatPrice?: (status: IdentityStatus) => string;
|
|
5496
|
-
}
|
|
5497
|
-
/** Which step the dialog opens on for a status. */
|
|
5498
|
-
declare function identityStepFor(status: IdentityStatus | undefined): IdentityStep;
|
|
5499
|
-
/** "£5.00 incl. VAT": the fee is quoted including UK VAT. */
|
|
5500
|
-
declare function formatIdentityPrice(status: IdentityStatus): string;
|
|
5501
|
-
/** The identity verification dialog's state, bound to the backend calls in `api`. */
|
|
5502
|
-
declare function useIdentityVerificationFlow(api: IdentityVerificationApi, { enabled, onVerifiedChange, onNameAccepted, formatPrice, }?: UseIdentityVerificationFlowOptions): IdentityVerificationFlow;
|
|
5503
|
-
/**
|
|
5504
|
-
* The identity verification flow over the account client in scope; the profile query follows the
|
|
5505
|
-
* tick and name.
|
|
5506
|
-
*/
|
|
5507
|
-
declare function useIdentityVerification(options?: Omit<UseIdentityVerificationFlowOptions, 'enabled'>): IdentityVerificationFlow;
|
|
5508
|
-
|
|
5509
|
-
type AccountSession = components['schemas']['SessionInfoResponse'];
|
|
5510
|
-
interface AccountSignOutOptions {
|
|
5511
|
-
/** End every session on the server first, this device's included. */
|
|
5512
|
-
everywhere?: boolean;
|
|
5513
|
-
/** Why: a person's choice, or the account was just closed. */
|
|
5514
|
-
reason?: 'manual' | 'account-deleted';
|
|
5515
|
-
}
|
|
5516
|
-
interface AccountClient {
|
|
5517
|
-
/** The signed-in user's profile; `null` when there is none. */
|
|
5518
|
-
profile(): ProfileView | null;
|
|
5519
|
-
/** Be told when {@link profile} changes. Returns the unsubscribe. */
|
|
5520
|
-
onProfileChange(listener: () => void): () => void;
|
|
5521
|
-
/** Save the name and/or picture; the profile follows. */
|
|
5522
|
-
updateProfile(vars: UpdateProfileVars): Promise<void>;
|
|
5523
|
-
/** Send the verification code to the new address (not for SSO accounts). */
|
|
5524
|
-
requestEmailChange(newEmail: string): Promise<void>;
|
|
5525
|
-
/** Confirm the new address with the emailed code; the profile follows. */
|
|
5526
|
-
confirmEmailChange(newEmail: string, code: string): Promise<void>;
|
|
5527
|
-
/** Change (or, in recovery mode, set) the master password. */
|
|
5528
|
-
changePassword(vars: PasswordChangeVars): Promise<void>;
|
|
5529
|
-
listSessions(): Promise<AccountSession[]>;
|
|
5530
|
-
/** The id this device's session is listed under, or `null`. */
|
|
5531
|
-
currentSessionId(): string | null;
|
|
5532
|
-
/** End one of the user's sessions at once (not this device's: that is {@link signOut}). */
|
|
5533
|
-
terminateSession(sessionId: string): Promise<void>;
|
|
5534
|
-
/** Sign this device out of the host (and, `everywhere`, every other session first). */
|
|
5535
|
-
signOut(options?: AccountSignOutOptions): Promise<void>;
|
|
5536
|
-
/** Close the account. Rejects with the backend's refusal when something blocks it. */
|
|
5537
|
-
requestDeletion(): Promise<unknown>;
|
|
5538
|
-
/** The ID check behind the verified tick. */
|
|
5539
|
-
identity: IdentityVerificationApi;
|
|
5540
|
-
}
|
|
5541
|
-
interface AccountClientContextValue {
|
|
5542
|
-
client: AccountClient;
|
|
5543
|
-
/** Account reads run only while this is true (signed in). */
|
|
5544
|
-
enabled: boolean;
|
|
5545
|
-
}
|
|
5546
|
-
/**
|
|
5547
|
-
* The account client over an `Arbi`. `overrides` replace any of its calls: a host that keeps its
|
|
5548
|
-
* own signed-in state passes `signOut` (and `profile`) so the SDK and the host stay in step.
|
|
5549
|
-
*/
|
|
5550
|
-
declare function arbiAccountClient(arbi: Arbi, overrides?: Partial<AccountClient>): AccountClient;
|
|
5551
|
-
interface AccountClientProviderProps {
|
|
5552
|
-
client: AccountClient;
|
|
5553
|
-
/** Account reads run only while this is true; default true. */
|
|
5554
|
-
enabled?: boolean;
|
|
5555
|
-
children: ReactNode;
|
|
5556
|
-
}
|
|
5557
|
-
/**
|
|
5558
|
-
* The account client for the account hooks and settings blocks below. Without one, they use the
|
|
5559
|
-
* nearest `ArbiProvider`'s session (`arbiAccountClient`).
|
|
5560
|
-
*/
|
|
5561
|
-
declare function AccountClientProvider({ client, enabled, children, }: AccountClientProviderProps): React$1.JSX.Element;
|
|
5562
|
-
/** The account client in scope: an `AccountClientProvider`'s, else the `ArbiProvider` session's. */
|
|
5563
|
-
declare function useAccountClient(): AccountClientContextValue;
|
|
6271
|
+
enabled?: boolean;
|
|
6272
|
+
}): {
|
|
6273
|
+
following: boolean;
|
|
6274
|
+
setFollowing: (on: boolean, callbacks?: FollowSaveCallbacks) => void;
|
|
6275
|
+
isLoading: boolean;
|
|
6276
|
+
isSaving: boolean;
|
|
6277
|
+
error: Error | null;
|
|
6278
|
+
};
|
|
5564
6279
|
|
|
5565
6280
|
/** The user's active sessions (devices and agents). */
|
|
5566
6281
|
declare function useSessions(options?: {
|
|
@@ -5579,282 +6294,93 @@ declare function useSessions(options?: {
|
|
|
5579
6294
|
declare function useTerminateSession(): _tanstack_react_query.UseMutationResult<void, Error, string, unknown>;
|
|
5580
6295
|
/** Sign out of this device, or (`everywhere`) of every device, this one included. */
|
|
5581
6296
|
declare function useSignOut(): _tanstack_react_query.UseMutationResult<void, Error, AccountSignOutOptions, unknown>;
|
|
5582
|
-
/** The id this device's session carries in the `useSessions` list, or `null`. */
|
|
5583
|
-
declare function useCurrentSessionId(): string | null;
|
|
5584
|
-
|
|
5585
|
-
/**
|
|
5586
|
-
* Delete account: the two-step flow behind `DeleteAccountDialog` and the backend's refusals.
|
|
5587
|
-
* The backend closes the account (soft delete) unless the user still has an active subscription
|
|
5588
|
-
* or is the sole admin of a workspace with other members; the refusal names which.
|
|
5589
|
-
*/
|
|
5590
|
-
/** Why an account cannot be closed yet. */
|
|
5591
|
-
type DeleteAccountBlocker = {
|
|
5592
|
-
type: 'active_subscription';
|
|
5593
|
-
} | {
|
|
5594
|
-
type: 'workspace_members';
|
|
5595
|
-
workspaces: string[];
|
|
5596
|
-
};
|
|
5597
|
-
/** Read the blockers out of a failed deletion; an empty list means it failed for another reason. */
|
|
5598
|
-
declare function parseDeleteAccountBlockers(error: unknown): DeleteAccountBlocker[];
|
|
5599
|
-
/** Close the account (the account client in scope). The caller signs out afterwards. */
|
|
5600
|
-
declare function useDeleteAccount(): _tanstack_react_query.UseMutationResult<unknown, Error, void, unknown>;
|
|
5601
|
-
interface UseDeleteAccountFlowOptions {
|
|
5602
|
-
userEmail: string;
|
|
5603
|
-
/** Close the account. Reject with the backend's error to surface blockers. */
|
|
5604
|
-
remove: () => Promise<unknown> | unknown;
|
|
5605
|
-
/** The dialog should close. */
|
|
5606
|
-
onClose: () => void;
|
|
5607
|
-
/** The account is closed (sign the user out of the app). */
|
|
5608
|
-
onDeleted: () => void;
|
|
5609
|
-
/** A failure that is not a blocker. */
|
|
5610
|
-
onError?: (error: unknown) => void;
|
|
5611
|
-
}
|
|
5612
|
-
interface DeleteAccountFlow {
|
|
5613
|
-
step: 'warning' | 'confirm';
|
|
5614
|
-
blockers: DeleteAccountBlocker[];
|
|
5615
|
-
confirmEmail: string;
|
|
5616
|
-
onConfirmEmailChange: (value: string) => void;
|
|
5617
|
-
onContinue: () => void;
|
|
5618
|
-
onBack: () => void;
|
|
5619
|
-
isDeleting: boolean;
|
|
5620
|
-
onSubmit: () => void;
|
|
5621
|
-
onClose: () => void;
|
|
5622
|
-
}
|
|
5623
|
-
/** Step, typed-email confirmation and blockers of `DeleteAccountDialog`. */
|
|
5624
|
-
declare function useDeleteAccountFlow({ userEmail, remove, onClose, onDeleted, onError, }: UseDeleteAccountFlowOptions): DeleteAccountFlow;
|
|
5625
|
-
|
|
5626
|
-
/**
|
|
5627
|
-
* Didit's web SDK, loaded only when a verification starts (like the app loads Stripe), and run
|
|
5628
|
-
* embedded in a host element. ID capture, liveness and face match all happen inside Didit's frame.
|
|
5629
|
-
*/
|
|
5630
|
-
|
|
5631
|
-
interface MountDiditOptions {
|
|
5632
|
-
/** The Didit session URL from the backend. */
|
|
5633
|
-
url: string;
|
|
5634
|
-
/** Id of the element the verification renders into; it must have a height. */
|
|
5635
|
-
containerId: string;
|
|
5636
|
-
/** The user finished, cancelled or the flow failed (`cameraAccessDenied`, `sessionExpired`, …). */
|
|
5637
|
-
onResult: (result: VerificationResult) => void;
|
|
5638
|
-
}
|
|
5639
|
-
/** Start the embedded verification. Resolves with a teardown; rejects if the SDK can't load. */
|
|
5640
|
-
declare function mountDiditVerification({ url, containerId, onResult, }: MountDiditOptions): Promise<() => void>;
|
|
5641
|
-
|
|
5642
|
-
/**
|
|
5643
|
-
* Saving the account's recovery key in the browser: the recovery file (`createRecoveryFile` of
|
|
5644
|
-
* `@arbidocs/client`, a one-link HTML page) downloaded for the current origin.
|
|
5645
|
-
*/
|
|
5646
|
-
|
|
5647
|
-
/** Download the recovery file. `origin` defaults to the page's own; `auth0Sub` SSO-wraps the key. */
|
|
5648
|
-
declare function downloadRecoveryFile(params: Omit<RecoveryKeyParams, 'origin'> & {
|
|
5649
|
-
origin?: string;
|
|
5650
|
-
}): Promise<void>;
|
|
5651
|
-
|
|
5652
|
-
/**
|
|
5653
|
-
* The mail shapes the hooks and the mail blocks work with: what `/v1/mail` returns, with the
|
|
5654
|
-
* fields the server always fills required and arrays never missing.
|
|
5655
|
-
*/
|
|
5656
|
-
interface MailPolicy {
|
|
5657
|
-
native_enabled: boolean;
|
|
5658
|
-
native_domain: string;
|
|
5659
|
-
enabled: boolean;
|
|
5660
|
-
enabled_providers: string[];
|
|
5661
|
-
oauth_providers: string[];
|
|
5662
|
-
server_profiles: {
|
|
5663
|
-
id: string;
|
|
5664
|
-
name: string;
|
|
5665
|
-
provider: string;
|
|
5666
|
-
}[];
|
|
5667
|
-
max_attachment_bytes: number;
|
|
5668
|
-
}
|
|
5669
|
-
interface MailAccount {
|
|
5670
|
-
id: string;
|
|
5671
|
-
provider: string;
|
|
5672
|
-
email: string;
|
|
5673
|
-
display_name: string;
|
|
5674
|
-
profile_id?: string;
|
|
5675
|
-
needs_reconsent: boolean;
|
|
5676
|
-
}
|
|
5677
|
-
interface MailFolder {
|
|
5678
|
-
id: string;
|
|
5679
|
-
name: string;
|
|
5680
|
-
role?: string;
|
|
5681
|
-
unread: number;
|
|
5682
|
-
}
|
|
5683
|
-
interface MailAddress {
|
|
5684
|
-
email: string;
|
|
5685
|
-
name?: string;
|
|
5686
|
-
}
|
|
5687
|
-
interface MailAttachment {
|
|
5688
|
-
id: string;
|
|
5689
|
-
name: string;
|
|
5690
|
-
content_type: string;
|
|
5691
|
-
size: number;
|
|
5692
|
-
content_base64?: string | null;
|
|
5693
|
-
}
|
|
5694
|
-
type MailDeliveryStatus = 'sent' | 'delivered' | 'delayed' | 'partially_bounced' | 'bounced';
|
|
5695
|
-
interface MailDeliveryRecipient {
|
|
5696
|
-
email: string;
|
|
5697
|
-
status: 'accepted' | 'rejected' | 'delayed' | 'failed' | 'delivered' | 'relayed' | 'expanded';
|
|
5698
|
-
code?: string | null;
|
|
5699
|
-
/** Plain words from the server, e.g. "The address doesn't exist". */
|
|
5700
|
-
description: string;
|
|
5701
|
-
updated_at: string;
|
|
5702
|
-
}
|
|
5703
|
-
interface MailMessage {
|
|
5704
|
-
secure_delivery?: boolean;
|
|
5705
|
-
id: string;
|
|
5706
|
-
subject: string;
|
|
5707
|
-
sender: MailAddress[];
|
|
5708
|
-
to: MailAddress[];
|
|
5709
|
-
cc: MailAddress[];
|
|
5710
|
-
bcc: MailAddress[];
|
|
5711
|
-
received_at?: string;
|
|
5712
|
-
preview: string;
|
|
5713
|
-
unread: boolean;
|
|
5714
|
-
text: string;
|
|
5715
|
-
html?: string;
|
|
5716
|
-
message_id?: string;
|
|
5717
|
-
references: string[];
|
|
5718
|
-
attachments: MailAttachment[];
|
|
5719
|
-
/** Native mail: the folder it is in (`drafts` for a draft). */
|
|
5720
|
-
folder?: string | null;
|
|
5721
|
-
/** Native sent mail only: delivery across all recipients. */
|
|
5722
|
-
delivery_status?: MailDeliveryStatus | null;
|
|
5723
|
-
/** Native sent mail, opened message only: each recipient's latest delivery state. */
|
|
5724
|
-
delivery?: MailDeliveryRecipient[];
|
|
5725
|
-
}
|
|
5726
|
-
/** One page of a folder. */
|
|
5727
|
-
interface MailPage {
|
|
5728
|
-
messages: MailMessage[];
|
|
5729
|
-
next_cursor?: string;
|
|
5730
|
-
/** Answered from this device (offline), when the host keeps mail offline. */
|
|
5731
|
-
fromDevice?: boolean;
|
|
5732
|
-
}
|
|
5733
|
-
/** A message being written: new, a reply or forward, or a saved draft (`draft_id`). */
|
|
5734
|
-
interface MailCompose {
|
|
5735
|
-
html?: string;
|
|
5736
|
-
secure_delivery?: boolean;
|
|
5737
|
-
to: MailAddress[];
|
|
5738
|
-
cc: MailAddress[];
|
|
5739
|
-
bcc: MailAddress[];
|
|
5740
|
-
subject: string;
|
|
5741
|
-
text: string;
|
|
5742
|
-
attachments: MailAttachment[];
|
|
5743
|
-
draft_id?: string;
|
|
5744
|
-
in_reply_to?: string;
|
|
5745
|
-
references?: string[];
|
|
5746
|
-
}
|
|
5747
|
-
/** Mark read or unread, move to a folder, or send to Trash. */
|
|
5748
|
-
interface MailMessageUpdate {
|
|
5749
|
-
unread?: boolean;
|
|
5750
|
-
folder_id?: string;
|
|
5751
|
-
action?: string;
|
|
5752
|
-
}
|
|
5753
|
-
|
|
5754
|
-
/**
|
|
5755
|
-
* The mail client the hooks and the mail blocks talk to.
|
|
5756
|
-
*
|
|
5757
|
-
* A {@link MailClient} is a transport (`fetch` under `/v1/mail`) plus the reads the screens make.
|
|
5758
|
-
* {@link createMailClient} builds one from any transport; {@link arbiMailClient} builds the default
|
|
5759
|
-
* one from an `Arbi` (used when no `MailClientProvider` is above). A host that keeps mail offline,
|
|
5760
|
-
* bridges connector tokens or sends secure mail passes its own reads and extras as overrides.
|
|
5761
|
-
*/
|
|
5762
|
-
|
|
5763
|
-
/** Fetch a path under `/v1/mail` with authentication; rejects a non-2xx response (`status` set). */
|
|
5764
|
-
type MailFetch = (path: string, init?: RequestInit) => Promise<Response>;
|
|
5765
|
-
/** Which draft body to open in the Word editor (`POST /drafts/editor`). */
|
|
5766
|
-
interface MailDraftEditorRequest {
|
|
5767
|
-
/** A saved draft (its room, or a new one seeded from it). */
|
|
5768
|
-
draftId?: string;
|
|
5769
|
-
/** A room this person already has open: a reconnect, or a new message not saved yet. */
|
|
5770
|
-
roomId?: string;
|
|
5771
|
-
/** What a new message's room starts from (a reply's quote). */
|
|
5772
|
-
text?: string;
|
|
5773
|
-
html?: string | null;
|
|
5774
|
-
/** The workspace open in the app: a new draft bills its project when the person may. */
|
|
5775
|
-
workspaceExtId?: string | null;
|
|
5776
|
-
}
|
|
5777
|
-
/** A project an email's AI work is billed to: the person's own, or a matter they own or collaborate in. */
|
|
5778
|
-
interface MailProject {
|
|
5779
|
-
external_id: string;
|
|
5780
|
-
name: string;
|
|
5781
|
-
personal: boolean;
|
|
5782
|
-
}
|
|
5783
|
-
/** A collaboration session on a draft's body: a document session's fields plus the draft. */
|
|
5784
|
-
interface MailDraftEditorSession {
|
|
5785
|
-
room_id: string;
|
|
5786
|
-
token: string;
|
|
5787
|
-
expires_in: number;
|
|
5788
|
-
websocket_path: string;
|
|
5789
|
-
can_edit: boolean;
|
|
5790
|
-
identity: {
|
|
5791
|
-
actorId: string;
|
|
5792
|
-
name: string;
|
|
5793
|
-
role: 'human' | 'agent';
|
|
5794
|
-
};
|
|
5795
|
-
filename: string;
|
|
5796
|
-
draft_id?: string | null;
|
|
5797
|
-
/** The project ARBI's work on this email is billed to. */
|
|
5798
|
-
project?: MailProject | null;
|
|
5799
|
-
}
|
|
5800
|
-
interface MailClient {
|
|
5801
|
-
fetch: MailFetch;
|
|
5802
|
-
getPolicy(): Promise<MailPolicy>;
|
|
5803
|
-
listAccounts(): Promise<MailAccount[]>;
|
|
5804
|
-
listFolders(account: MailAccount): Promise<MailFolder[]>;
|
|
5805
|
-
listMessages(account: MailAccount, folderId: string, query: string, cursor: string | null): Promise<MailPage>;
|
|
5806
|
-
getMessage(account: MailAccount, messageId: string): Promise<MailMessage>;
|
|
5807
|
-
/** Hand this session what the server needs to read the account (keys, credentials). */
|
|
5808
|
-
unlock(account: MailAccount): Promise<void>;
|
|
5809
|
-
/**
|
|
5810
|
-
* The encrypted payload for `/secure/send` (native mail only). Absent: secure delivery is not
|
|
5811
|
-
* offered.
|
|
5812
|
-
*/
|
|
5813
|
-
prepareSecureMail?(compose: MailCompose, account: MailAccount, requestId: string): Promise<unknown>;
|
|
5814
|
-
/** The URL that connects an OAuth mail provider, returning to `returnPath`. Absent: not offered. */
|
|
5815
|
-
authorizeOAuth?(vendor: string, returnPath: string): Promise<string>;
|
|
5816
|
-
/**
|
|
5817
|
-
* Open a native draft's body in the Word editor, unlocking its room for this session with the
|
|
5818
|
-
* person's key when the server asks (423). Absent: the composer keeps its plain rich-text body.
|
|
5819
|
-
*/
|
|
5820
|
-
openDraftEditor?(request: MailDraftEditorRequest): Promise<MailDraftEditorSession>;
|
|
5821
|
-
}
|
|
5822
|
-
/** A read that needs the network and has no copy on this device (shown as a notice, not an error). */
|
|
5823
|
-
declare class MailOfflineUnavailableError extends Error {
|
|
5824
|
-
constructor(message: string);
|
|
5825
|
-
}
|
|
5826
|
-
declare function accountPath(id: string): string;
|
|
5827
|
-
/** A JSON mail call: the parsed body, or `undefined` for 204. */
|
|
5828
|
-
declare function mailJson<T>(fetch: MailFetch, path: string, init?: RequestInit): Promise<T>;
|
|
5829
|
-
/** A client over `fetch`; `overrides` replace any of its reads or add the optional extras. */
|
|
5830
|
-
declare function createMailClient(fetch: MailFetch, overrides?: Partial<MailClient>): MailClient;
|
|
6297
|
+
/** The id this device's session carries in the `useSessions` list, or `null`. */
|
|
6298
|
+
declare function useCurrentSessionId(): string | null;
|
|
6299
|
+
|
|
5831
6300
|
/**
|
|
5832
|
-
*
|
|
5833
|
-
*
|
|
5834
|
-
*
|
|
6301
|
+
* Delete account: the two-step flow behind `DeleteAccountDialog` and the backend's refusals.
|
|
6302
|
+
* The backend closes the account (soft delete) unless the user still has an active subscription
|
|
6303
|
+
* or is the sole admin of a workspace with other members; the refusal names which.
|
|
5835
6304
|
*/
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
6305
|
+
/** Why an account cannot be closed yet. */
|
|
6306
|
+
type DeleteAccountBlocker = {
|
|
6307
|
+
type: 'active_subscription';
|
|
6308
|
+
} | {
|
|
6309
|
+
type: 'workspace_members';
|
|
6310
|
+
workspaces: string[];
|
|
6311
|
+
};
|
|
6312
|
+
/** Read the blockers out of a failed deletion; an empty list means it failed for another reason. */
|
|
6313
|
+
declare function parseDeleteAccountBlockers(error: unknown): DeleteAccountBlocker[];
|
|
6314
|
+
/** Close the account (the account client in scope). The caller signs out afterwards. */
|
|
6315
|
+
declare function useDeleteAccount(): _tanstack_react_query.UseMutationResult<unknown, Error, void, unknown>;
|
|
6316
|
+
interface UseDeleteAccountFlowOptions {
|
|
6317
|
+
userEmail: string;
|
|
6318
|
+
/** Close the account. Reject with the backend's error to surface blockers. */
|
|
6319
|
+
remove: () => Promise<unknown> | unknown;
|
|
6320
|
+
/** The dialog should close. */
|
|
6321
|
+
onClose: () => void;
|
|
6322
|
+
/** The account is closed (sign the user out of the app). */
|
|
6323
|
+
onDeleted: () => void;
|
|
6324
|
+
/** A failure that is not a blocker. */
|
|
6325
|
+
onError?: (error: unknown) => void;
|
|
6326
|
+
}
|
|
6327
|
+
interface DeleteAccountFlow {
|
|
6328
|
+
step: 'warning' | 'confirm';
|
|
6329
|
+
blockers: DeleteAccountBlocker[];
|
|
6330
|
+
confirmEmail: string;
|
|
6331
|
+
onConfirmEmailChange: (value: string) => void;
|
|
6332
|
+
onContinue: () => void;
|
|
6333
|
+
onBack: () => void;
|
|
6334
|
+
isDeleting: boolean;
|
|
6335
|
+
onSubmit: () => void;
|
|
6336
|
+
onClose: () => void;
|
|
6337
|
+
}
|
|
6338
|
+
/** Step, typed-email confirmation and blockers of `DeleteAccountDialog`. */
|
|
6339
|
+
declare function useDeleteAccountFlow({ userEmail, remove, onClose, onDeleted, onError, }: UseDeleteAccountFlowOptions): DeleteAccountFlow;
|
|
6340
|
+
|
|
5844
6341
|
/**
|
|
5845
|
-
*
|
|
5846
|
-
*
|
|
6342
|
+
* Didit's web SDK, loaded only when a verification starts (like the app loads Stripe), and run
|
|
6343
|
+
* embedded in a host element. ID capture, liveness and face match all happen inside Didit's frame.
|
|
5847
6344
|
*/
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
6345
|
+
|
|
6346
|
+
interface MountDiditOptions {
|
|
6347
|
+
/** The Didit session URL from the backend. */
|
|
6348
|
+
url: string;
|
|
6349
|
+
/** Id of the element the verification renders into; it must have a height. */
|
|
6350
|
+
containerId: string;
|
|
6351
|
+
/** The user finished, cancelled or the flow failed (`cameraAccessDenied`, `sessionExpired`, …). */
|
|
6352
|
+
onResult: (result: VerificationResult) => void;
|
|
6353
|
+
}
|
|
6354
|
+
/** Start the embedded verification. Resolves with a teardown; rejects if the SDK can't load. */
|
|
6355
|
+
declare function mountDiditVerification({ url, containerId, onResult, }: MountDiditOptions): Promise<() => void>;
|
|
6356
|
+
|
|
5851
6357
|
/**
|
|
5852
|
-
*
|
|
5853
|
-
*
|
|
6358
|
+
* Saving the account's recovery key in the browser: the recovery file (`createRecoveryFile` of
|
|
6359
|
+
* `@arbidocs/client`, a one-link HTML page) downloaded for the current origin.
|
|
5854
6360
|
*/
|
|
5855
|
-
|
|
5856
|
-
/**
|
|
5857
|
-
declare function
|
|
6361
|
+
|
|
6362
|
+
/** Download the recovery file. `origin` defaults to the page's own; `auth0Sub` SSO-wraps the key. */
|
|
6363
|
+
declare function downloadRecoveryFile(params: Omit<RecoveryKeyParams, 'origin'> & {
|
|
6364
|
+
origin?: string;
|
|
6365
|
+
}): Promise<void>;
|
|
6366
|
+
|
|
6367
|
+
type FeatureEntitlements = account.FeatureEntitlements;
|
|
6368
|
+
type EntitledFeature = account.EntitledFeature;
|
|
6369
|
+
type FeatureRefusal = account.FeatureRefusal;
|
|
6370
|
+
/** The person's entitlements; `data` is undefined until known (treat that as not entitled). */
|
|
6371
|
+
declare function useEntitlements(): _tanstack_react_query.UseQueryResult<NoInfer<{
|
|
6372
|
+
mail: boolean;
|
|
6373
|
+
calendar: boolean;
|
|
6374
|
+
host_calls: boolean;
|
|
6375
|
+
reason?: ("pro_required" | "external_user" | "not_entitled") | null;
|
|
6376
|
+
}>, Error>;
|
|
6377
|
+
/** Whether the person may use `feature` (false while unknown, so nothing the API would refuse flashes up). */
|
|
6378
|
+
declare function useIsEntitled(feature: EntitledFeature): boolean;
|
|
6379
|
+
/** Why the paid features are off, in the words a UI shows. */
|
|
6380
|
+
declare function entitlementRefusal(reason: FeatureRefusal | null | undefined): {
|
|
6381
|
+
title: string;
|
|
6382
|
+
description: string;
|
|
6383
|
+
};
|
|
5858
6384
|
|
|
5859
6385
|
interface MailClientContextValue {
|
|
5860
6386
|
client: MailClient;
|
|
@@ -5866,16 +6392,10 @@ interface MailClientContextValue {
|
|
|
5866
6392
|
*/
|
|
5867
6393
|
sessionKey: string | null;
|
|
5868
6394
|
}
|
|
5869
|
-
interface MailClientProviderProps extends Partial<Omit<MailClientContextValue, 'client'>> {
|
|
5870
|
-
client: MailClient;
|
|
5871
|
-
children: ReactNode;
|
|
5872
|
-
}
|
|
5873
6395
|
/**
|
|
5874
|
-
* The mail client
|
|
5875
|
-
*
|
|
6396
|
+
* The mail client in scope: the host configuration's `mail`, else one on its `arbi` session
|
|
6397
|
+
* (`arbiMailClient`).
|
|
5876
6398
|
*/
|
|
5877
|
-
declare function MailClientProvider({ client, enabled, sessionKey, children, }: MailClientProviderProps): React$1.JSX.Element;
|
|
5878
|
-
/** The mail client in scope: a `MailClientProvider`'s, else the `ArbiProvider` session's. */
|
|
5879
6399
|
declare function useMailClient(): MailClientContextValue;
|
|
5880
6400
|
|
|
5881
6401
|
declare const mailQueryKeys: {
|
|
@@ -6052,71 +6572,6 @@ declare const calendarQueryKeys: {
|
|
|
6052
6572
|
outbox: () => readonly ["arbi", "calendar", "outbox"];
|
|
6053
6573
|
};
|
|
6054
6574
|
|
|
6055
|
-
/** A write the outbox can hold while offline. */
|
|
6056
|
-
type CalendarWriteOp = {
|
|
6057
|
-
kind: 'create';
|
|
6058
|
-
body: EventCreateBody;
|
|
6059
|
-
} | {
|
|
6060
|
-
kind: 'update';
|
|
6061
|
-
target: ScopedTarget;
|
|
6062
|
-
body: EventPatchBody;
|
|
6063
|
-
} | {
|
|
6064
|
-
kind: 'delete';
|
|
6065
|
-
target: ScopedTarget & {
|
|
6066
|
-
notify?: boolean;
|
|
6067
|
-
};
|
|
6068
|
-
} | {
|
|
6069
|
-
kind: 'respond';
|
|
6070
|
-
params: RespondParams;
|
|
6071
|
-
};
|
|
6072
|
-
/** A write made offline: queued on this device and sent exactly once when back online. */
|
|
6073
|
-
interface QueuedCalendarWrite {
|
|
6074
|
-
queued: true;
|
|
6075
|
-
requestId: string;
|
|
6076
|
-
}
|
|
6077
|
-
declare function isQueuedCalendarWrite(value: unknown): value is QueuedCalendarWrite;
|
|
6078
|
-
/** A write waiting in the outbox (a queued create is drawn on the grid as pending). */
|
|
6079
|
-
interface CalendarPendingWrite {
|
|
6080
|
-
requestId: string;
|
|
6081
|
-
op: CalendarWriteOp;
|
|
6082
|
-
state: string;
|
|
6083
|
-
inDoubt?: boolean;
|
|
6084
|
-
error?: string;
|
|
6085
|
-
}
|
|
6086
|
-
interface CalendarOfflineSupport {
|
|
6087
|
-
/**
|
|
6088
|
-
* Run a read online and keep the result on this device; when the network is down, answer from
|
|
6089
|
-
* that copy. `key` identifies the read (its query key).
|
|
6090
|
-
*/
|
|
6091
|
-
read<T>(key: readonly unknown[], fetch: () => Promise<T>): Promise<T>;
|
|
6092
|
-
/** Send a write, or, offline, queue it and answer {@link QueuedCalendarWrite}. */
|
|
6093
|
-
write<T>(op: CalendarWriteOp, send: () => Promise<T>): Promise<T | QueuedCalendarWrite>;
|
|
6094
|
-
/** The writes waiting in the outbox. */
|
|
6095
|
-
pending(): Promise<CalendarPendingWrite[]>;
|
|
6096
|
-
/** Be told when the outbox changes. Returns the unsubscribe. */
|
|
6097
|
-
subscribe(listener: () => void): () => void;
|
|
6098
|
-
}
|
|
6099
|
-
interface CalendarConnectorSupport {
|
|
6100
|
-
/** The URL that starts a connector's OAuth consent and comes back to `returnPath`. */
|
|
6101
|
-
authorize(vendor: string, returnPath: string): Promise<string>;
|
|
6102
|
-
/** Hand this server session the connector's sealed grant (the server answered 401 without it). */
|
|
6103
|
-
bridge(vendor: string): Promise<void>;
|
|
6104
|
-
/** The vendor keys of the user's connected connectors. */
|
|
6105
|
-
connectedVendors(): Promise<string[]>;
|
|
6106
|
-
}
|
|
6107
|
-
interface CalendarSupport {
|
|
6108
|
-
offline?: CalendarOfflineSupport;
|
|
6109
|
-
connectors?: CalendarConnectorSupport;
|
|
6110
|
-
/** Where the OAuth consent returns to (default: the current page). */
|
|
6111
|
-
oauthReturnPath?: string;
|
|
6112
|
-
}
|
|
6113
|
-
/** Offline storage and account OAuth for the calendar hooks and blocks below. */
|
|
6114
|
-
declare function CalendarSupportProvider({ value, children, }: {
|
|
6115
|
-
value: CalendarSupport;
|
|
6116
|
-
children: ReactNode;
|
|
6117
|
-
}): React$1.JSX.Element;
|
|
6118
|
-
declare function useCalendarSupport(): CalendarSupport;
|
|
6119
|
-
|
|
6120
6575
|
/** Refresh every event read (lists, single events, invitations, invitation lookups). */
|
|
6121
6576
|
declare function invalidateCalendarEvents(qc: QueryClient): Promise<[void, void, void, void]>;
|
|
6122
6577
|
/** Refresh the calendar list and the events drawn from it. */
|
|
@@ -8924,15 +9379,13 @@ interface DmAvatarProps {
|
|
|
8924
9379
|
declare function DmAvatar({ user, className, size }: DmAvatarProps): React$1.JSX.Element;
|
|
8925
9380
|
|
|
8926
9381
|
/**
|
|
8927
|
-
* useDirectMessages — the
|
|
9382
|
+
* useDirectMessages — the per-peer view of my direct chats for the turnkey DM block.
|
|
8928
9383
|
*
|
|
8929
|
-
*
|
|
8930
|
-
*
|
|
8931
|
-
*
|
|
8932
|
-
*
|
|
8933
|
-
*
|
|
8934
|
-
* Requires an <ArbiWebSocketProvider> above it for live updates (standard in
|
|
8935
|
-
* the ARBI provider stack).
|
|
9384
|
+
* It reads the one chat cache (`useChats` / each thread under `arbiQueryKeys.chatThread`), so
|
|
9385
|
+
* every messenger, badge and WebSocket event shares it. It maps each direct chat to a
|
|
9386
|
+
* conversation with its peer, merges in contacts I have not messaged yet, and sends through the
|
|
9387
|
+
* same optimistic post the app's messenger uses. Live under an `<ArbiWebSocketProvider>`
|
|
9388
|
+
* (`useChatLiveUpdates`); a host with its own socket feeds `applyChatEvent`.
|
|
8936
9389
|
*/
|
|
8937
9390
|
|
|
8938
9391
|
interface UseDirectMessagesResult {
|
|
@@ -8948,9 +9401,9 @@ interface UseDirectMessagesResult {
|
|
|
8948
9401
|
* Send a message to a known peer. The public key is no longer needed (the SDK
|
|
8949
9402
|
* opens the direct chat and derives the pair key) but the signature is kept.
|
|
8950
9403
|
*/
|
|
8951
|
-
sendMessage: (recipientExtId: string, recipientPublicKey: string | null | undefined, text: string) => Promise<DecryptedChatMessage>;
|
|
9404
|
+
sendMessage: (recipientExtId: string, recipientPublicKey: string | null | undefined, text: string) => Promise<DecryptedChatMessage$1>;
|
|
8952
9405
|
/** Send by email / external_id, resolving the recipient internally. */
|
|
8953
|
-
sendMessageTo: (recipient: string, text: string) => Promise<DecryptedChatMessage>;
|
|
9406
|
+
sendMessageTo: (recipient: string, text: string) => Promise<DecryptedChatMessage$1>;
|
|
8954
9407
|
isSending: boolean;
|
|
8955
9408
|
/** The last send failure, or null. A failed send must never pass silently. */
|
|
8956
9409
|
sendError: Error | null;
|
|
@@ -8961,6 +9414,222 @@ declare function useDirectMessages(options?: {
|
|
|
8961
9414
|
enabled?: boolean;
|
|
8962
9415
|
}): UseDirectMessagesResult;
|
|
8963
9416
|
|
|
9417
|
+
/**
|
|
9418
|
+
* The one chat cache: my chat list (`arbiQueryKeys.chatList()`, raw — titles and last messages
|
|
9419
|
+
* stay ciphertext) and each open thread (`arbiQueryKeys.chatThread(id)`, decrypted). Every reader
|
|
9420
|
+
* (the messenger, unread badges, the DM kit, a call's chat) and every writer (a send, a delete,
|
|
9421
|
+
* a WebSocket event) goes through here, so one change shows everywhere at once.
|
|
9422
|
+
*
|
|
9423
|
+
* Live events: a host that has the shared `<ArbiWebSocketProvider>` gets them through
|
|
9424
|
+
* `useChatLiveUpdates`; a host with its own socket passes each chat event to `applyChatEvent`.
|
|
9425
|
+
*/
|
|
9426
|
+
|
|
9427
|
+
type ChatResponse = chats.ChatResponse;
|
|
9428
|
+
type ChatMessageResponse = chats.ChatMessageResponse;
|
|
9429
|
+
type DecryptedChatMessage = chats.DecryptedChatMessage;
|
|
9430
|
+
type ChatAttachmentFile = chats.ChatAttachmentFile;
|
|
9431
|
+
type ChatMemberKey = chats.ChatMemberKey;
|
|
9432
|
+
/** A message in an open thread; an optimistic row carries a local id until the server echoes it. */
|
|
9433
|
+
type ChatThreadMessage = DecryptedChatMessage & {
|
|
9434
|
+
optimistic?: boolean;
|
|
9435
|
+
};
|
|
9436
|
+
/** An open thread's cache entry: decrypted messages, oldest first. */
|
|
9437
|
+
interface ChatThreadData {
|
|
9438
|
+
messages: ChatThreadMessage[];
|
|
9439
|
+
/** False once the oldest page has been loaded. */
|
|
9440
|
+
hasMore: boolean;
|
|
9441
|
+
}
|
|
9442
|
+
/** The signed-in user's external id, or null when signed out. */
|
|
9443
|
+
declare function myChatId(arbi: Arbi): string | null;
|
|
9444
|
+
declare function setOpenChat(chatExtId: string | null): void;
|
|
9445
|
+
declare function getOpenChat(): string | null;
|
|
9446
|
+
/** My chats as the cache holds them (empty until the list has loaded). */
|
|
9447
|
+
declare function cachedChats(queryClient: QueryClient): ChatResponse[];
|
|
9448
|
+
/** One of my chats from the cache, if the list has it. */
|
|
9449
|
+
declare function cachedChat(queryClient: QueryClient, chatExtId: string): ChatResponse | undefined;
|
|
9450
|
+
/** Put a chat (new or updated) into the list, keeping the list newest first. */
|
|
9451
|
+
declare function upsertChat(queryClient: QueryClient, chat: ChatResponse): void;
|
|
9452
|
+
/** Drop a chat I left or lost, with its thread. */
|
|
9453
|
+
declare function removeChat(queryClient: QueryClient, chatExtId: string): void;
|
|
9454
|
+
/** Append a message to a loaded thread (deduplicated, replacing its optimistic copy). */
|
|
9455
|
+
declare function appendToThread(queryClient: QueryClient, chatExtId: string, message: ChatThreadMessage, replaceOptimisticId?: string): void;
|
|
9456
|
+
/** `chat.message`: a new message in one of my chats. */
|
|
9457
|
+
declare function applyChatMessage(arbi: Arbi, queryClient: QueryClient, chatExtId: string, message: ChatMessageResponse): Promise<void>;
|
|
9458
|
+
/** `chat.read`: a member's watermark moved (a read receipt). */
|
|
9459
|
+
declare function applyChatRead(arbi: Arbi, queryClient: QueryClient, chatExtId: string, userExtId: string, lastReadAt: string): void;
|
|
9460
|
+
/**
|
|
9461
|
+
* `chat.updated`: members, keys, title or a deleted message changed. Refetch the chat; when it now
|
|
9462
|
+
* needs a new epoch and I am still in it, seal one. A changed `message` (a deleted message's
|
|
9463
|
+
* tombstone) is applied in place; without one the open thread is reloaded.
|
|
9464
|
+
*/
|
|
9465
|
+
declare function applyChatUpdated(arbi: Arbi, queryClient: QueryClient, chatExtId: string, message?: ChatMessageResponse | null): Promise<void>;
|
|
9466
|
+
/** My own agent's progress on a message I sent it (`agent_dm_status`). */
|
|
9467
|
+
type AgentDmStatus = WsAgentDmStatusMessage;
|
|
9468
|
+
/** `agent_dm_status`: remember my agent's latest progress (read by `useAgentDmStatus`). */
|
|
9469
|
+
declare function applyAgentDmStatus(queryClient: QueryClient, status: AgentDmStatus): void;
|
|
9470
|
+
/** The chat events of the server's WebSocket, as `applyChatEvent` takes them. */
|
|
9471
|
+
type ChatEvent = {
|
|
9472
|
+
type: 'chat.message';
|
|
9473
|
+
chat_ext_id: string;
|
|
9474
|
+
message: ChatMessageResponse;
|
|
9475
|
+
} | {
|
|
9476
|
+
type: 'chat.read';
|
|
9477
|
+
chat_ext_id: string;
|
|
9478
|
+
user_ext_id: string;
|
|
9479
|
+
last_read_at: string;
|
|
9480
|
+
} | {
|
|
9481
|
+
type: 'chat.updated';
|
|
9482
|
+
chat_ext_id: string;
|
|
9483
|
+
message?: ChatMessageResponse | null;
|
|
9484
|
+
} | AgentDmStatus;
|
|
9485
|
+
/** Apply one chat event of the server's WebSocket to the cache. Other messages are ignored. */
|
|
9486
|
+
declare function applyChatEvent(arbi: Arbi, queryClient: QueryClient, event: {
|
|
9487
|
+
type: string;
|
|
9488
|
+
}): Promise<void>;
|
|
9489
|
+
|
|
9490
|
+
/** My chats (raw), most recently active first. */
|
|
9491
|
+
declare function useChats(options?: {
|
|
9492
|
+
enabled?: boolean;
|
|
9493
|
+
}): _tanstack_react_query.UseQueryResult<NoInfer<{
|
|
9494
|
+
external_id: string;
|
|
9495
|
+
kind: "direct" | "group" | "meeting";
|
|
9496
|
+
title?: string | null;
|
|
9497
|
+
key_version: number;
|
|
9498
|
+
rotation_required: boolean;
|
|
9499
|
+
last_message_at?: string | null;
|
|
9500
|
+
created_at: string;
|
|
9501
|
+
members: _arbidocs_client.components["schemas"]["ChatMemberResponse"][];
|
|
9502
|
+
my_keys?: _arbidocs_client.components["schemas"]["ChatKeyResponse"][];
|
|
9503
|
+
unread_count: number;
|
|
9504
|
+
last_message?: _arbidocs_client.components["schemas"]["ChatMessageResponse"] | null;
|
|
9505
|
+
call_ext_id?: string | null;
|
|
9506
|
+
}[]>, Error>;
|
|
9507
|
+
/**
|
|
9508
|
+
* Keep the chat cache live from the shared `<ArbiWebSocketProvider>`, when there is one. A host
|
|
9509
|
+
* with its own socket passes chat events to `applyChatEvent` instead.
|
|
9510
|
+
*/
|
|
9511
|
+
declare function useChatLiveUpdates(): void;
|
|
9512
|
+
/** My own agent's latest progress on a message I sent it, live from the chat events. */
|
|
9513
|
+
declare function useAgentDmStatus(agentExtId: string | null | undefined): AgentDmStatus | undefined;
|
|
9514
|
+
/** Unread messages across all my chats (the badge on the messages entry points). */
|
|
9515
|
+
declare function useChatUnreadTotal(): number;
|
|
9516
|
+
/** Unread count per direct-chat peer (`usr-`/`agt-` id), for per-person badges and filters. */
|
|
9517
|
+
declare function useUnreadByPeer(): Map<string, number>;
|
|
9518
|
+
interface ChatSummary {
|
|
9519
|
+
/** Decrypted group title (null for direct chats or one that does not open). */
|
|
9520
|
+
title: string | null;
|
|
9521
|
+
/** Decrypted last message, one line. */
|
|
9522
|
+
preview: string | null;
|
|
9523
|
+
}
|
|
9524
|
+
/**
|
|
9525
|
+
* Decrypted titles and last-message previews for a list of chats. Only the newest message of
|
|
9526
|
+
* each chat is decrypted — a thread decrypts in full when it is opened.
|
|
9527
|
+
*/
|
|
9528
|
+
declare function useChatSummaries(chats: ChatResponse[]): Record<string, ChatSummary>;
|
|
9529
|
+
/**
|
|
9530
|
+
* One open thread: the newest page decrypted (oldest first), kept live by the chat events, with
|
|
9531
|
+
* `loadOlder` paging backwards.
|
|
9532
|
+
*/
|
|
9533
|
+
declare function useChatThread(chat: ChatResponse | null): {
|
|
9534
|
+
messages: ChatThreadMessage[];
|
|
9535
|
+
hasMore: boolean;
|
|
9536
|
+
isLoading: boolean;
|
|
9537
|
+
loadOlder: () => Promise<void>;
|
|
9538
|
+
loadingOlder: boolean;
|
|
9539
|
+
};
|
|
9540
|
+
/** What to post: text, files and (PA chat only) the agent's workspace or a context note. */
|
|
9541
|
+
interface ChatPost {
|
|
9542
|
+
text: string;
|
|
9543
|
+
files?: File[];
|
|
9544
|
+
/** PA chat only: the workspace my agent acts in. */
|
|
9545
|
+
workspaceExtId?: string;
|
|
9546
|
+
/** PA chat only: a note the agent records without replying. */
|
|
9547
|
+
contextOnly?: boolean;
|
|
9548
|
+
}
|
|
9549
|
+
/**
|
|
9550
|
+
* Post to a chat, rendering an optimistic copy at once and swapping in the server's row. With no
|
|
9551
|
+
* chat yet, `peerExtId`'s direct chat is opened (created) first. Files are encrypted with their
|
|
9552
|
+
* own keys and travel in a manifest under the chat key. A failure drops the optimistic row,
|
|
9553
|
+
* refreshes the list (a stale epoch re-keys on the next try) and rethrows.
|
|
9554
|
+
*/
|
|
9555
|
+
declare function useChatPost(): (target: {
|
|
9556
|
+
chat: ChatResponse | null;
|
|
9557
|
+
peerExtId?: string | null;
|
|
9558
|
+
}, post: ChatPost) => Promise<{
|
|
9559
|
+
chat: ChatResponse;
|
|
9560
|
+
message: chats.DecryptedChatMessage;
|
|
9561
|
+
}>;
|
|
9562
|
+
/** Delete one of my messages: a tombstone in place at once, rolled back if the delete fails. */
|
|
9563
|
+
declare function useDeleteChatMessage(): (chatExtId: string, messageExtId: string) => Promise<void>;
|
|
9564
|
+
/**
|
|
9565
|
+
* Move my read watermark in a chat to a message (or to now). The list shows it read at once; a
|
|
9566
|
+
* failure is ignored (the next open tries again).
|
|
9567
|
+
*/
|
|
9568
|
+
declare function useMarkChatRead(): (chat: ChatResponse, messageExtId?: string) => Promise<undefined>;
|
|
9569
|
+
/** Create a group (members need encryption keys; agents are refused) and add it to the list. */
|
|
9570
|
+
declare function useCreateGroupChat(): _tanstack_react_query.UseMutationResult<{
|
|
9571
|
+
external_id: string;
|
|
9572
|
+
kind: "direct" | "group" | "meeting";
|
|
9573
|
+
title?: string | null;
|
|
9574
|
+
key_version: number;
|
|
9575
|
+
rotation_required: boolean;
|
|
9576
|
+
last_message_at?: string | null;
|
|
9577
|
+
created_at: string;
|
|
9578
|
+
members: _arbidocs_client.components["schemas"]["ChatMemberResponse"][];
|
|
9579
|
+
my_keys?: _arbidocs_client.components["schemas"]["ChatKeyResponse"][];
|
|
9580
|
+
unread_count: number;
|
|
9581
|
+
last_message?: _arbidocs_client.components["schemas"]["ChatMessageResponse"] | null;
|
|
9582
|
+
call_ext_id?: string | null;
|
|
9583
|
+
}, Error, {
|
|
9584
|
+
title?: string | null;
|
|
9585
|
+
members: ChatMemberKey[];
|
|
9586
|
+
}, unknown>;
|
|
9587
|
+
/** Rename a group (the title is encrypted under the current epoch). */
|
|
9588
|
+
declare function useRenameChat(): _tanstack_react_query.UseMutationResult<{
|
|
9589
|
+
external_id: string;
|
|
9590
|
+
kind: "direct" | "group" | "meeting";
|
|
9591
|
+
title?: string | null;
|
|
9592
|
+
key_version: number;
|
|
9593
|
+
rotation_required: boolean;
|
|
9594
|
+
last_message_at?: string | null;
|
|
9595
|
+
created_at: string;
|
|
9596
|
+
members: _arbidocs_client.components["schemas"]["ChatMemberResponse"][];
|
|
9597
|
+
my_keys?: _arbidocs_client.components["schemas"]["ChatKeyResponse"][];
|
|
9598
|
+
unread_count: number;
|
|
9599
|
+
last_message?: _arbidocs_client.components["schemas"]["ChatMessageResponse"] | null;
|
|
9600
|
+
call_ext_id?: string | null;
|
|
9601
|
+
}, Error, {
|
|
9602
|
+
chat: ChatResponse;
|
|
9603
|
+
title: string | null;
|
|
9604
|
+
}, unknown>;
|
|
9605
|
+
/** Add people to a group, or to a meeting chat with its call key (`callKey`). */
|
|
9606
|
+
declare function useAddChatMembers(): _tanstack_react_query.UseMutationResult<{
|
|
9607
|
+
external_id: string;
|
|
9608
|
+
kind: "direct" | "group" | "meeting";
|
|
9609
|
+
title?: string | null;
|
|
9610
|
+
key_version: number;
|
|
9611
|
+
rotation_required: boolean;
|
|
9612
|
+
last_message_at?: string | null;
|
|
9613
|
+
created_at: string;
|
|
9614
|
+
members: _arbidocs_client.components["schemas"]["ChatMemberResponse"][];
|
|
9615
|
+
my_keys?: _arbidocs_client.components["schemas"]["ChatKeyResponse"][];
|
|
9616
|
+
unread_count: number;
|
|
9617
|
+
last_message?: _arbidocs_client.components["schemas"]["ChatMessageResponse"] | null;
|
|
9618
|
+
call_ext_id?: string | null;
|
|
9619
|
+
}, Error, {
|
|
9620
|
+
chat: ChatResponse;
|
|
9621
|
+
members: ChatMemberKey[];
|
|
9622
|
+
callKey?: Uint8Array | null;
|
|
9623
|
+
}, unknown>;
|
|
9624
|
+
/**
|
|
9625
|
+
* Remove someone from a group (owner) or leave it (my own id). Leaving drops the chat at once;
|
|
9626
|
+
* a removal refreshes the list (the chat now has a new epoch).
|
|
9627
|
+
*/
|
|
9628
|
+
declare function useRemoveChatMember(): _tanstack_react_query.UseMutationResult<void, Error, {
|
|
9629
|
+
chat: ChatResponse;
|
|
9630
|
+
userExtId: string;
|
|
9631
|
+
}, unknown>;
|
|
9632
|
+
|
|
8964
9633
|
/** Relative-time formatting shared by the notification bell, the DM kit and the app's thread lists
|
|
8965
9634
|
* (no type imports, so the SDK-free `/shell` entry can use it). */
|
|
8966
9635
|
interface FormatRelativeTimeOptions {
|
|
@@ -9169,59 +9838,15 @@ declare function CommandPaletteProvider({ children, hotkey, ...paletteProps }: C
|
|
|
9169
9838
|
/** Imperative handle to the command palette, exposed to any descendant. */
|
|
9170
9839
|
interface CommandPaletteValue {
|
|
9171
9840
|
open: () => void;
|
|
9172
|
-
close: () => void;
|
|
9173
|
-
toggle: () => void;
|
|
9174
|
-
isOpen: boolean;
|
|
9175
|
-
}
|
|
9176
|
-
/**
|
|
9177
|
-
* Access the palette from anywhere under {@link CommandPaletteProvider} — e.g. a
|
|
9178
|
-
* topbar search button calls `useCommandPalette().open()`.
|
|
9179
|
-
*/
|
|
9180
|
-
declare function useCommandPalette(): CommandPaletteValue;
|
|
9181
|
-
|
|
9182
|
-
/**
|
|
9183
|
-
* The workspace documents list in the query cache: one entry per workspace
|
|
9184
|
-
* (`arbiQueryKeys.documents(workspaceId)`), read once (progressively, see `documents-loader.ts`)
|
|
9185
|
-
* and then kept current in place. Every write goes through {@link patchDocuments}, which also
|
|
9186
|
-
* tells row listeners (a grid that applies row transactions instead of re-diffing the whole list)
|
|
9187
|
-
* exactly which rows were added, changed or removed.
|
|
9188
|
-
*
|
|
9189
|
-
* A single document's own entry (`arbiQueryKeys.document(id)`, read by a viewer) is patched next to
|
|
9190
|
-
* the list by {@link setCachedDocument}, so a viewer never blanks while a write settles.
|
|
9191
|
-
*/
|
|
9192
|
-
|
|
9193
|
-
/** A document as the server lists it. */
|
|
9194
|
-
type WorkspaceDocument = components['schemas']['DocResponse'];
|
|
9195
|
-
/** The rows one write added, changed and removed (removed: by id). */
|
|
9196
|
-
interface DocumentRowChange {
|
|
9197
|
-
workspaceId: string;
|
|
9198
|
-
add: WorkspaceDocument[];
|
|
9199
|
-
update: WorkspaceDocument[];
|
|
9200
|
-
remove: string[];
|
|
9201
|
-
}
|
|
9202
|
-
type RowListener = (change: DocumentRowChange) => void;
|
|
9203
|
-
/**
|
|
9204
|
-
* Follow the row-level changes of every write to a workspace documents list (a grid applying them
|
|
9205
|
-
* as transactions). Returns the unsubscribe.
|
|
9206
|
-
*/
|
|
9207
|
-
declare function subscribeDocumentRows(listener: RowListener): () => void;
|
|
9208
|
-
/** The cached documents of a workspace (`undefined` before its list has been read). */
|
|
9209
|
-
declare function getCachedDocuments(qc: QueryClient, workspaceId: string | null | undefined): WorkspaceDocument[] | undefined;
|
|
9210
|
-
/**
|
|
9211
|
-
* Apply `reducer` to a workspace's documents list, or (no `workspaceId`) to every cached one: the
|
|
9212
|
-
* one place a list is written after it was read. Returning the same array is a no-op. Row
|
|
9213
|
-
* listeners get the diff; a document that moved to a new version makes the open version lists
|
|
9214
|
-
* re-read. A workspace whose list has not been read is left alone (its first read brings it).
|
|
9215
|
-
*/
|
|
9216
|
-
declare function patchDocuments(qc: QueryClient, reducer: (documents: WorkspaceDocument[]) => WorkspaceDocument[], workspaceId?: string | null): void;
|
|
9217
|
-
/** Put `doc` in its list in place, or at the end when the list does not hold it yet. */
|
|
9218
|
-
declare function upsertDocuments(qc: QueryClient, documents: WorkspaceDocument[], workspaceId?: string | null): void;
|
|
9219
|
-
/** Write a document's own entry (what `useDocument` reads), keeping a viewer current. */
|
|
9220
|
-
declare function setCachedDocument(qc: QueryClient, doc: WorkspaceDocument): void;
|
|
9221
|
-
/** Apply `reducer` to a document's own entry, when one is cached. */
|
|
9222
|
-
declare function patchCachedDocument(qc: QueryClient, docId: string, reducer: (doc: WorkspaceDocument) => WorkspaceDocument): void;
|
|
9223
|
-
/** Forget everything cached about deleted documents, so nothing re-reads them into a 404. */
|
|
9224
|
-
declare function forgetDocuments(qc: QueryClient, docIds: string[]): void;
|
|
9841
|
+
close: () => void;
|
|
9842
|
+
toggle: () => void;
|
|
9843
|
+
isOpen: boolean;
|
|
9844
|
+
}
|
|
9845
|
+
/**
|
|
9846
|
+
* Access the palette from anywhere under {@link CommandPaletteProvider} — e.g. a
|
|
9847
|
+
* topbar search button calls `useCommandPalette().open()`.
|
|
9848
|
+
*/
|
|
9849
|
+
declare function useCommandPalette(): CommandPaletteValue;
|
|
9225
9850
|
|
|
9226
9851
|
/** Statuses after which a document's processing is over (`low-content`: indexed, little text). */
|
|
9227
9852
|
declare const FINISHED_DOCUMENT_STATUSES: ReadonlySet<string>;
|
|
@@ -9490,353 +10115,143 @@ interface OptimisticDocumentEdit {
|
|
|
9490
10115
|
}
|
|
9491
10116
|
/**
|
|
9492
10117
|
* Show a queued field edit in the caches at once (offline only: online, the server's answer is the
|
|
9493
|
-
* one source). A second edit of the same document layers on the first, so undoing the later one
|
|
9494
|
-
* restores the earlier one.
|
|
9495
|
-
*/
|
|
9496
|
-
declare function applyOptimisticDocumentEdit(qc: QueryClient, updates: DocUpdate[]): OptimisticDocumentEdit;
|
|
9497
|
-
/** Undo {@link applyOptimisticDocumentEdit} from its snapshot (anything else: nothing to undo). */
|
|
9498
|
-
declare function rollbackOptimisticDocumentEdit(qc: QueryClient, context: unknown): void;
|
|
9499
|
-
/**
|
|
9500
|
-
* Edit documents' fields (folder, sharing, title and other metadata, status). The answer replaces
|
|
9501
|
-
* the cached documents; offline the edit shows at once and is sent on reconnect.
|
|
9502
|
-
*/
|
|
9503
|
-
declare function useUpdateDocuments(): _tanstack_react_query.UseMutationResult<{
|
|
9504
|
-
external_id: string;
|
|
9505
|
-
workspace_ext_id: string;
|
|
9506
|
-
file_name?: string | null;
|
|
9507
|
-
status?: string | null;
|
|
9508
|
-
error_message?: string | null;
|
|
9509
|
-
failed_stage?: string | null;
|
|
9510
|
-
n_pages?: number | null;
|
|
9511
|
-
n_chunks?: number | null;
|
|
9512
|
-
tokens?: number | null;
|
|
9513
|
-
file_type?: string | null;
|
|
9514
|
-
file_size?: number | null;
|
|
9515
|
-
storage_type?: string | null;
|
|
9516
|
-
storage_uri?: string | null;
|
|
9517
|
-
content_hash?: string | null;
|
|
9518
|
-
shared?: boolean | null;
|
|
9519
|
-
re_ocred?: boolean | null;
|
|
9520
|
-
config_ext_id?: string | null;
|
|
9521
|
-
parent_ext_id?: string | null;
|
|
9522
|
-
current_version: number;
|
|
9523
|
-
versions: components["schemas"]["DocVersion"][];
|
|
9524
|
-
thread_id?: string | null;
|
|
9525
|
-
derived_from: components["schemas"]["DerivedFrom"][];
|
|
9526
|
-
source_message_ext_id?: string | null;
|
|
9527
|
-
conversation_ext_id?: string | null;
|
|
9528
|
-
created_by_ext_id: string;
|
|
9529
|
-
updated_by_ext_id?: string | null;
|
|
9530
|
-
created_at: string;
|
|
9531
|
-
updated_at: string;
|
|
9532
|
-
wp_type?: string | null;
|
|
9533
|
-
folder?: string | null;
|
|
9534
|
-
sender?: string | null;
|
|
9535
|
-
doctags: components["schemas"]["DocTagResponse"][];
|
|
9536
|
-
doc_metadata?: components["schemas"]["DocMetadata"] | null;
|
|
9537
|
-
}[], Error, UpdateDocumentsInput, OptimisticDocumentEdit | undefined>;
|
|
9538
|
-
/**
|
|
9539
|
-
* Rename or move a folder: each of `documents` beneath `from` moves under `to`, keeping the
|
|
9540
|
-
* structure below it. The batch write does not return an email's attachments, so every cached row
|
|
9541
|
-
* beneath `from` moves too. Resolves to how many documents were written.
|
|
9542
|
-
*/
|
|
9543
|
-
declare function useRenameFolder(): (documents: WorkspaceDocument[], from: string[], to: string[]) => Promise<number>;
|
|
9544
|
-
/**
|
|
9545
|
-
* Delete documents (each with all its versions; an email with its attachments). They leave every
|
|
9546
|
-
* list, what was cached about them is forgotten, and the workspaces' file counts re-read.
|
|
9547
|
-
*/
|
|
9548
|
-
declare function useDeleteDocuments(): _tanstack_react_query.UseMutationResult<void, Error, string[], unknown>;
|
|
9549
|
-
/** Files to upload and where they go. */
|
|
9550
|
-
interface UploadDocumentsInput {
|
|
9551
|
-
files: Array<Blob | File>;
|
|
9552
|
-
options?: UploadDocumentsOptions;
|
|
9553
|
-
}
|
|
9554
|
-
/**
|
|
9555
|
-
* Upload files (to the open workspace, or `options.workspaceExtId`): resolves with the new
|
|
9556
|
-
* documents' ids (and the files the server skipped). The new documents join their list.
|
|
9557
|
-
*/
|
|
9558
|
-
declare function useUploadDocuments(): _tanstack_react_query.UseMutationResult<UploadResult, Error, UploadDocumentsInput, unknown>;
|
|
9559
|
-
/** Web pages or files to fetch into the open workspace. */
|
|
9560
|
-
interface UploadUrlsInput {
|
|
9561
|
-
urls: string[];
|
|
9562
|
-
shared?: boolean;
|
|
9563
|
-
configExtId?: string | null;
|
|
9564
|
-
}
|
|
9565
|
-
/** Add documents from URLs to the open workspace; the new documents join the list. */
|
|
9566
|
-
declare function useUploadUrls(): _tanstack_react_query.UseMutationResult<{
|
|
9567
|
-
doc_ext_ids?: string[] | undefined;
|
|
9568
|
-
version?: number | null | undefined;
|
|
9569
|
-
batch_id?: string | null | undefined;
|
|
9570
|
-
skipped?: {
|
|
9571
|
-
file_name: string;
|
|
9572
|
-
reason: string;
|
|
9573
|
-
}[] | undefined;
|
|
9574
|
-
}, Error, UploadUrlsInput, unknown>;
|
|
9575
|
-
/** Apply a tag to documents: they show it at once, its count rises. Queued offline. */
|
|
9576
|
-
declare function useAssignDocTags(): _tanstack_react_query.UseMutationResult<{
|
|
9577
|
-
note?: string | null;
|
|
9578
|
-
citations?: components["schemas"]["CitationSources"] | null;
|
|
9579
|
-
external_id: string;
|
|
9580
|
-
doc_ext_id: string;
|
|
9581
|
-
tag_ext_id: string;
|
|
9582
|
-
created_by_ext_id: string;
|
|
9583
|
-
updated_by_ext_id?: string | null;
|
|
9584
|
-
created_at: string;
|
|
9585
|
-
updated_at: string;
|
|
9586
|
-
}[], Error, AssignDocTagsInput, unknown>;
|
|
9587
|
-
/** Remove a tag from documents: they lose it, its count drops. Queued offline. */
|
|
9588
|
-
declare function useRemoveDocTags(): _tanstack_react_query.UseMutationResult<void, Error, RemoveDocTagsInput, unknown>;
|
|
9589
|
-
/** Change a tag's note (or its cited passages) on a document. Queued offline. */
|
|
9590
|
-
declare function useUpdateDocTag(): _tanstack_react_query.UseMutationResult<{
|
|
9591
|
-
note?: string | null;
|
|
9592
|
-
citations?: components["schemas"]["CitationSources"] | null;
|
|
9593
|
-
external_id: string;
|
|
9594
|
-
doc_ext_id: string;
|
|
9595
|
-
tag_ext_id: string;
|
|
9596
|
-
created_by_ext_id: string;
|
|
9597
|
-
updated_by_ext_id?: string | null;
|
|
9598
|
-
created_at: string;
|
|
9599
|
-
updated_at: string;
|
|
9600
|
-
}, Error, UpdateDocTagInput, unknown>;
|
|
9601
|
-
/** Tags whose values AI fills on documents. */
|
|
9602
|
-
interface GenerateDocTagsInput {
|
|
9603
|
-
tagIds: string[];
|
|
9604
|
-
docIds: string[];
|
|
9605
|
-
/** Also where a document already has a value (default: only where it has none). */
|
|
9606
|
-
overwrite?: boolean;
|
|
9607
|
-
}
|
|
9608
|
-
/**
|
|
9609
|
-
* Fill tags' values on documents with AI. Accepted at once; the work runs in the background and a
|
|
9610
|
-
* `batch_complete` (`doctag_generate`) event names the documents when it is done
|
|
9611
|
-
* (`refreshDocuments` then brings their values). Meanwhile the documents show as queued for
|
|
9612
|
-
* processing (`DocumentsSupport.onProcessingQueued`), undone if the request is refused.
|
|
9613
|
-
*/
|
|
9614
|
-
declare function useGenerateDocTags(): _tanstack_react_query.UseMutationResult<{
|
|
9615
|
-
doc_ext_ids: string[];
|
|
9616
|
-
tag_ext_ids: string[];
|
|
9617
|
-
}, Error, GenerateDocTagsInput, {
|
|
9618
|
-
undo: () => void;
|
|
9619
|
-
} | undefined>;
|
|
9620
|
-
/**
|
|
9621
|
-
* Finalise a translation: its current version is saved as a new PDF document, labelled
|
|
9622
|
-
* "Translation" and linked to the original. Resolves with the new document's id; the new document
|
|
9623
|
-
* joins the list with its links, so the original's translations show it at once.
|
|
9624
|
-
*/
|
|
9625
|
-
declare function useFinaliseTranslation(): _tanstack_react_query.UseMutationResult<{
|
|
9626
|
-
document_ext_id: string;
|
|
9627
|
-
translation_ref: string;
|
|
9628
|
-
source_ref?: string | null | undefined;
|
|
9629
|
-
}, Error, string, unknown>;
|
|
9630
|
-
|
|
9631
|
-
/**
|
|
9632
|
-
* Choosing files to upload: what the picker accepts, which files are refused and why, folders
|
|
9633
|
-
* dropped whole (each file keeps its path below the dropped folder), zip archives opened into
|
|
9634
|
-
* their files, and the folder a file goes to.
|
|
9635
|
-
*/
|
|
9636
|
-
/** The file picker's `accept`: every type an upload takes, zip archives included. */
|
|
9637
|
-
declare const UPLOAD_ACCEPT = ".pdf,.txt,.md,.html,.doc,.docx,.rtf,.ppt,.pptx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.mp4,.mpeg,.mpg,.webm,.mov,.avi,.mkv,.mp3,.wav,.m4a,.aac,.ogg,.flac,.eml,.msg,.mbox,.pst,.ost,.zip,application/pdf,text/plain,text/markdown,text/html,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/rtf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,image/jpeg,image/png,image/gif,image/bmp,image/tiff,image/webp,video/mp4,video/mpeg,video/webm,video/quicktime,video/x-msvideo,video/x-matroska,audio/mpeg,audio/wav,audio/mp4,audio/aac,audio/ogg,audio/flac,message/rfc822,application/vnd.ms-outlook,application/mbox,application/zip,application/x-zip-compressed";
|
|
9638
|
-
/** The largest file a browser upload takes. */
|
|
9639
|
-
declare const UPLOAD_MAX_FILE_SIZE: number;
|
|
9640
|
-
/** Why a chosen file is not uploaded. */
|
|
9641
|
-
type UploadRefusal = 'empty' | 'too_large' | 'no_extension' | 'unsupported' | 'empty_zip' | 'zip_error';
|
|
9642
|
-
interface RefusedUploadFile {
|
|
9643
|
-
name: string;
|
|
9644
|
-
reason: UploadRefusal;
|
|
9645
|
-
}
|
|
9646
|
-
/** A zip archive's files, and the names of those too large to take. */
|
|
9647
|
-
interface ExtractedZip {
|
|
9648
|
-
extractedFiles: File[];
|
|
9649
|
-
skippedLargeFiles: string[];
|
|
9650
|
-
}
|
|
9651
|
-
/** Opens a zip archive into its files (each with its path in `webkitRelativePath`). */
|
|
9652
|
-
type ZipExtractor = (zip: File, maxFileSize: number) => Promise<ExtractedZip>;
|
|
9653
|
-
/** A file with its path below a dropped or picked folder (as the browser's folder picker sets). */
|
|
9654
|
-
declare function withRelativePath(file: File, relativePath: string): File;
|
|
9655
|
-
declare function isZipFile(file: Pick<File, 'name' | 'type'>): boolean;
|
|
9656
|
-
/**
|
|
9657
|
-
* Open a zip archive into the files an upload takes. An archive whose files all sit in one folder
|
|
9658
|
-
* keeps that folder; otherwise they go under a folder named after the archive.
|
|
9659
|
-
*/
|
|
9660
|
-
declare const extractZipFile: ZipExtractor;
|
|
9661
|
-
/**
|
|
9662
|
-
* The chosen files an upload takes (zip archives opened into theirs), sorted by path, and those it
|
|
9663
|
-
* refuses with why.
|
|
9664
|
-
*/
|
|
9665
|
-
declare function prepareUploadFiles(chosen: ArrayLike<File>, options?: {
|
|
9666
|
-
maxFileSize?: number;
|
|
9667
|
-
extractZip?: ZipExtractor;
|
|
9668
|
-
}): Promise<{
|
|
9669
|
-
accepted: File[];
|
|
9670
|
-
refused: RefusedUploadFile[];
|
|
9671
|
-
}>;
|
|
9672
|
-
/** The files of a drop: dropped folders are read whole, each file keeping its path. */
|
|
9673
|
-
declare function filesFromDrop(transfer: DataTransfer): Promise<File[]>;
|
|
9674
|
-
/**
|
|
9675
|
-
* The folder a file goes to: `base` (where the upload was started), then the folders the file sat
|
|
9676
|
-
* in below what was dropped or picked. Null at the workspace root.
|
|
9677
|
-
*/
|
|
9678
|
-
declare function uploadFolderOf(file: File, base?: string | null): string | null;
|
|
9679
|
-
|
|
9680
|
-
/** A document a write here sent back into processing (AI fields being filled). */
|
|
9681
|
-
interface QueuedDocument {
|
|
9682
|
-
docId: string;
|
|
9683
|
-
workspaceId: string;
|
|
9684
|
-
fileName: string;
|
|
9685
|
-
version: number;
|
|
9686
|
-
}
|
|
9687
|
-
/** A document's live processing, as the host follows it (a `task_update` and what it adds). */
|
|
9688
|
-
interface ProcessingTask {
|
|
9689
|
-
doc_ext_id: string;
|
|
9690
|
-
status: string;
|
|
9691
|
-
progress?: number | null;
|
|
9692
|
-
workspace_ext_id?: string | null;
|
|
9693
|
-
file_name?: string | null;
|
|
9694
|
-
failed_stage?: string | null;
|
|
9695
|
-
}
|
|
9696
|
-
interface DocumentsSupport {
|
|
9697
|
-
/**
|
|
9698
|
-
* Every document's live processing, as a hook (a stable function for the provider's life).
|
|
9699
|
-
* Without one, the package's own WebSocket store (`ArbiWebSocketProvider`) is read.
|
|
9700
|
-
*/
|
|
9701
|
-
useProcessingTasks?: () => Readonly<Record<string, ProcessingTask>>;
|
|
9702
|
-
/** One document's live processing, as a hook: re-renders only when that document's changes. */
|
|
9703
|
-
useProcessingTask?: (docId: string) => ProcessingTask | undefined;
|
|
9704
|
-
/**
|
|
9705
|
-
* A document's processing status as the host last heard it live. A finished status heard live is
|
|
9706
|
-
* kept over an older one a re-read returns (the server may not have committed it yet).
|
|
9707
|
-
*/
|
|
9708
|
-
processingStatus?: (docId: string) => string | undefined;
|
|
9709
|
-
/** Documents went back into processing: show them as queued. Returns the undo (refused write). */
|
|
9710
|
-
onProcessingQueued?: (documents: QueuedDocument[]) => () => void;
|
|
9711
|
-
/** Documents were deleted: drop what the host keeps about them (processing rows, open tabs). */
|
|
9712
|
-
onDocumentsDeleted?: (docIds: string[]) => void;
|
|
9713
|
-
/**
|
|
9714
|
-
* The workspace's raw key, for the direct upload (encrypted here, sent straight to storage) that
|
|
9715
|
-
* the user's settings can turn on. Throws when the key is not held here (a public workspace, a
|
|
9716
|
-
* temporary grant): the upload then goes through the server. Absent: always through the server.
|
|
9717
|
-
*/
|
|
9718
|
-
resolveWorkspaceKey?: (workspaceId: string) => Promise<Uint8Array>;
|
|
9719
|
-
/** Opens a zip archive into its files (e.g. off the main thread). Default: on the main thread. */
|
|
9720
|
-
extractZip?: ZipExtractor;
|
|
9721
|
-
}
|
|
9722
|
-
declare function DocumentsSupportProvider({ support, children, }: {
|
|
9723
|
-
support: DocumentsSupport;
|
|
9724
|
-
children: ReactNode;
|
|
9725
|
-
}): React$1.JSX.Element;
|
|
9726
|
-
/** The host's document support (empty without a provider). */
|
|
9727
|
-
declare function useDocumentsSupport(): DocumentsSupport;
|
|
9728
|
-
/** Every document's live processing (the host's, else the package WebSocket store's). */
|
|
9729
|
-
declare function useProcessingTasks(): Readonly<Record<string, ProcessingTask>>;
|
|
9730
|
-
/** One document's live processing (the host's, else the package WebSocket store's). */
|
|
9731
|
-
declare function useProcessingTask(docId: string): ProcessingTask | undefined;
|
|
9732
|
-
|
|
9733
|
-
/**
|
|
9734
|
-
* A document's fields as the lists show them: the metadata the pipeline extracts (date, type,
|
|
9735
|
-
* author, abstract), whether it can join a conversation, and its folder path in canonical form
|
|
9736
|
-
* (the form folder filters and the explorer navigate by).
|
|
9737
|
-
*/
|
|
9738
|
-
|
|
9739
|
-
/**
|
|
9740
|
-
* Whether a document can be added to a conversation. This is the single source
|
|
9741
|
-
* of truth shared by the add flow (`useAddToConversation`) and any UI that
|
|
9742
|
-
* counts/enables an "Add" affordance — so a badge never advertises a document
|
|
9743
|
-
* that the add flow will silently refuse (e.g. a 'skipped' document).
|
|
9744
|
-
*/
|
|
9745
|
-
declare const isDocumentAddableToConversation: (document: WorkspaceDocument | null | undefined) => boolean;
|
|
9746
|
-
/**
|
|
9747
|
-
* Gets the date of a document from doc_metadata.
|
|
9748
|
-
* @param document Document to get date from
|
|
9749
|
-
* @returns Document date string or undefined
|
|
9750
|
-
*/
|
|
9751
|
-
declare const getDocumentDate: (document: WorkspaceDocument | null | undefined) => string | null | undefined;
|
|
9752
|
-
/**
|
|
9753
|
-
* Format a doc_date for display. Date-only values ("YYYY-MM-DD") are shown as-is;
|
|
9754
|
-
* full datetimes (e.g. emails, "...T14:30:00Z") are shown as "YYYY-MM-DD HH:MM"
|
|
9755
|
-
* in local time. Invalid/empty values return an empty string.
|
|
9756
|
-
*/
|
|
9757
|
-
declare const formatDocDate: (value?: string | null) => string;
|
|
9758
|
-
/**
|
|
9759
|
-
* Gets the document nature (type) from doc_metadata.
|
|
9760
|
-
* @param document Document to get nature from
|
|
9761
|
-
* @returns Document nature (e.g., email, contract, memorandum) or undefined
|
|
10118
|
+
* one source). A second edit of the same document layers on the first, so undoing the later one
|
|
10119
|
+
* restores the earlier one.
|
|
9762
10120
|
*/
|
|
9763
|
-
declare
|
|
10121
|
+
declare function applyOptimisticDocumentEdit(qc: QueryClient, updates: DocUpdate[]): OptimisticDocumentEdit;
|
|
10122
|
+
/** Undo {@link applyOptimisticDocumentEdit} from its snapshot (anything else: nothing to undo). */
|
|
10123
|
+
declare function rollbackOptimisticDocumentEdit(qc: QueryClient, context: unknown): void;
|
|
9764
10124
|
/**
|
|
9765
|
-
*
|
|
9766
|
-
*
|
|
9767
|
-
* @returns Document author or undefined
|
|
10125
|
+
* Edit documents' fields (folder, sharing, title and other metadata, status). The answer replaces
|
|
10126
|
+
* the cached documents; offline the edit shows at once and is sent on reconnect.
|
|
9768
10127
|
*/
|
|
9769
|
-
declare
|
|
10128
|
+
declare function useUpdateDocuments(): _tanstack_react_query.UseMutationResult<{
|
|
10129
|
+
external_id: string;
|
|
10130
|
+
workspace_ext_id: string;
|
|
10131
|
+
file_name?: string | null;
|
|
10132
|
+
status?: string | null;
|
|
10133
|
+
error_message?: string | null;
|
|
10134
|
+
failed_stage?: string | null;
|
|
10135
|
+
n_pages?: number | null;
|
|
10136
|
+
n_chunks?: number | null;
|
|
10137
|
+
tokens?: number | null;
|
|
10138
|
+
file_type?: string | null;
|
|
10139
|
+
file_size?: number | null;
|
|
10140
|
+
storage_type?: string | null;
|
|
10141
|
+
storage_uri?: string | null;
|
|
10142
|
+
content_hash?: string | null;
|
|
10143
|
+
shared?: boolean | null;
|
|
10144
|
+
re_ocred?: boolean | null;
|
|
10145
|
+
config_ext_id?: string | null;
|
|
10146
|
+
parent_ext_id?: string | null;
|
|
10147
|
+
current_version: number;
|
|
10148
|
+
versions: components["schemas"]["DocVersion"][];
|
|
10149
|
+
thread_id?: string | null;
|
|
10150
|
+
derived_from: components["schemas"]["DerivedFrom"][];
|
|
10151
|
+
source_message_ext_id?: string | null;
|
|
10152
|
+
conversation_ext_id?: string | null;
|
|
10153
|
+
created_by_ext_id: string;
|
|
10154
|
+
updated_by_ext_id?: string | null;
|
|
10155
|
+
created_at: string;
|
|
10156
|
+
updated_at: string;
|
|
10157
|
+
wp_type?: string | null;
|
|
10158
|
+
folder?: string | null;
|
|
10159
|
+
sender?: string | null;
|
|
10160
|
+
doctags: components["schemas"]["DocTagResponse"][];
|
|
10161
|
+
doc_metadata?: components["schemas"]["DocMetadata"] | null;
|
|
10162
|
+
}[], Error, UpdateDocumentsInput, OptimisticDocumentEdit | undefined>;
|
|
9770
10163
|
/**
|
|
9771
|
-
*
|
|
9772
|
-
*
|
|
9773
|
-
*
|
|
10164
|
+
* Rename or move a folder: each of `documents` beneath `from` moves under `to`, keeping the
|
|
10165
|
+
* structure below it. The batch write does not return an email's attachments, so every cached row
|
|
10166
|
+
* beneath `from` moves too. Resolves to how many documents were written.
|
|
9774
10167
|
*/
|
|
9775
|
-
declare
|
|
10168
|
+
declare function useRenameFolder(): (documents: WorkspaceDocument[], from: string[], to: string[]) => Promise<number>;
|
|
9776
10169
|
/**
|
|
9777
|
-
*
|
|
9778
|
-
*
|
|
9779
|
-
* Keep in sync with backend DocTagLLMConfig.DEFAULT_METADATA_TAGS
|
|
10170
|
+
* Delete documents (each with all its versions; an email with its attachments). They leave every
|
|
10171
|
+
* list, what was cached about them is forgotten, and the workspaces' file counts re-read.
|
|
9780
10172
|
*/
|
|
9781
|
-
declare
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
readonly label: "Type";
|
|
9787
|
-
}, {
|
|
9788
|
-
readonly name: "doc_author";
|
|
9789
|
-
readonly label: "Author";
|
|
9790
|
-
}, {
|
|
9791
|
-
readonly name: "doc_subject";
|
|
9792
|
-
readonly label: "Abstract";
|
|
9793
|
-
}];
|
|
9794
|
-
/**
|
|
9795
|
-
* Canonicalizes a `Doc.folder` path: trims each segment and drops empty ones,
|
|
9796
|
-
* returning null for a blank path. Drive-synced folders use provider names
|
|
9797
|
-
* verbatim, which can carry stray whitespace ("Google Drive (u)/Reports ");
|
|
9798
|
-
* the explorer navigates via trimmed segments, so folder filter IDs and
|
|
9799
|
-
* navigation keys must agree on this canonical form.
|
|
9800
|
-
*/
|
|
9801
|
-
declare const canonicalFolderPath: (folder: string | null | undefined) => string | null;
|
|
9802
|
-
/** One row of a folder picker: the folder itself plus every ancestor above it. */
|
|
9803
|
-
interface FolderTreeNode {
|
|
9804
|
-
/** Canonical path — the same form folder filter IDs are built from. */
|
|
9805
|
-
path: string;
|
|
9806
|
-
/** Last segment, for display. */
|
|
9807
|
-
label: string;
|
|
9808
|
-
/** How far down the tree, for indentation. */
|
|
9809
|
-
depth: number;
|
|
9810
|
-
/** Documents at or below this folder. */
|
|
9811
|
-
count: number;
|
|
10173
|
+
declare function useDeleteDocuments(): _tanstack_react_query.UseMutationResult<void, Error, string[], unknown>;
|
|
10174
|
+
/** Files to upload and where they go. */
|
|
10175
|
+
interface UploadDocumentsInput {
|
|
10176
|
+
files: Array<Blob | File>;
|
|
10177
|
+
options?: UploadDocumentsOptions;
|
|
9812
10178
|
}
|
|
9813
10179
|
/**
|
|
9814
|
-
*
|
|
9815
|
-
*
|
|
9816
|
-
* Every path here is canonical, and that is the point: a folder filter ID is
|
|
9817
|
-
* `folder:${canonicalFolderPath(doc.folder)}`, and an ID outside that set is
|
|
9818
|
-
* dropped as invalid — so a picker that emitted the raw path (" Reports / Q1 ",
|
|
9819
|
-
* or "/Inbox" with its phantom blank root) would send the view back to "All"
|
|
9820
|
-
* instead of into the folder the user clicked.
|
|
10180
|
+
* Upload files (to the open workspace, or `options.workspaceExtId`): resolves with the new
|
|
10181
|
+
* documents' ids (and the files the server skipped). The new documents join their list.
|
|
9821
10182
|
*/
|
|
9822
|
-
declare
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
10183
|
+
declare function useUploadDocuments(): _tanstack_react_query.UseMutationResult<UploadResult, Error, UploadDocumentsInput, unknown>;
|
|
10184
|
+
/** Web pages or files to fetch into the open workspace. */
|
|
10185
|
+
interface UploadUrlsInput {
|
|
10186
|
+
urls: string[];
|
|
10187
|
+
shared?: boolean;
|
|
10188
|
+
configExtId?: string | null;
|
|
10189
|
+
}
|
|
10190
|
+
/** Add documents from URLs to the open workspace; the new documents join the list. */
|
|
10191
|
+
declare function useUploadUrls(): _tanstack_react_query.UseMutationResult<{
|
|
10192
|
+
doc_ext_ids?: string[] | undefined;
|
|
10193
|
+
version?: number | null | undefined;
|
|
10194
|
+
batch_id?: string | null | undefined;
|
|
10195
|
+
skipped?: {
|
|
10196
|
+
file_name: string;
|
|
10197
|
+
reason: string;
|
|
10198
|
+
}[] | undefined;
|
|
10199
|
+
}, Error, UploadUrlsInput, unknown>;
|
|
10200
|
+
/** Apply a tag to documents: they show it at once, its count rises. Queued offline. */
|
|
10201
|
+
declare function useAssignDocTags(): _tanstack_react_query.UseMutationResult<{
|
|
10202
|
+
note?: string | null;
|
|
10203
|
+
citations?: components["schemas"]["CitationSources"] | null;
|
|
10204
|
+
external_id: string;
|
|
10205
|
+
doc_ext_id: string;
|
|
10206
|
+
tag_ext_id: string;
|
|
10207
|
+
created_by_ext_id: string;
|
|
10208
|
+
updated_by_ext_id?: string | null;
|
|
10209
|
+
created_at: string;
|
|
10210
|
+
updated_at: string;
|
|
10211
|
+
}[], Error, AssignDocTagsInput, unknown>;
|
|
10212
|
+
/** Remove a tag from documents: they lose it, its count drops. Queued offline. */
|
|
10213
|
+
declare function useRemoveDocTags(): _tanstack_react_query.UseMutationResult<void, Error, RemoveDocTagsInput, unknown>;
|
|
10214
|
+
/** Change a tag's note (or its cited passages) on a document. Queued offline. */
|
|
10215
|
+
declare function useUpdateDocTag(): _tanstack_react_query.UseMutationResult<{
|
|
10216
|
+
note?: string | null;
|
|
10217
|
+
citations?: components["schemas"]["CitationSources"] | null;
|
|
10218
|
+
external_id: string;
|
|
10219
|
+
doc_ext_id: string;
|
|
10220
|
+
tag_ext_id: string;
|
|
10221
|
+
created_by_ext_id: string;
|
|
10222
|
+
updated_by_ext_id?: string | null;
|
|
10223
|
+
created_at: string;
|
|
10224
|
+
updated_at: string;
|
|
10225
|
+
}, Error, UpdateDocTagInput, unknown>;
|
|
10226
|
+
/** Tags whose values AI fills on documents. */
|
|
10227
|
+
interface GenerateDocTagsInput {
|
|
10228
|
+
tagIds: string[];
|
|
10229
|
+
docIds: string[];
|
|
10230
|
+
/** Also where a document already has a value (default: only where it has none). */
|
|
10231
|
+
overwrite?: boolean;
|
|
10232
|
+
}
|
|
9828
10233
|
/**
|
|
9829
|
-
*
|
|
9830
|
-
*
|
|
9831
|
-
*
|
|
9832
|
-
*
|
|
10234
|
+
* Fill tags' values on documents with AI. Accepted at once; the work runs in the background and a
|
|
10235
|
+
* `batch_complete` (`doctag_generate`) event names the documents when it is done
|
|
10236
|
+
* (`refreshDocuments` then brings their values). Meanwhile the documents show as queued for
|
|
10237
|
+
* processing (`DocumentsSupport.onProcessingQueued`), undone if the request is refused.
|
|
9833
10238
|
*/
|
|
9834
|
-
declare
|
|
10239
|
+
declare function useGenerateDocTags(): _tanstack_react_query.UseMutationResult<{
|
|
10240
|
+
doc_ext_ids: string[];
|
|
10241
|
+
tag_ext_ids: string[];
|
|
10242
|
+
}, Error, GenerateDocTagsInput, {
|
|
10243
|
+
undo: () => void;
|
|
10244
|
+
} | undefined>;
|
|
9835
10245
|
/**
|
|
9836
|
-
*
|
|
9837
|
-
*
|
|
10246
|
+
* Finalise a translation: its current version is saved as a new PDF document, labelled
|
|
10247
|
+
* "Translation" and linked to the original. Resolves with the new document's id; the new document
|
|
10248
|
+
* joins the list with its links, so the original's translations show it at once.
|
|
9838
10249
|
*/
|
|
9839
|
-
declare
|
|
10250
|
+
declare function useFinaliseTranslation(): _tanstack_react_query.UseMutationResult<{
|
|
10251
|
+
document_ext_id: string;
|
|
10252
|
+
translation_ref: string;
|
|
10253
|
+
source_ref?: string | null | undefined;
|
|
10254
|
+
}, Error, string, unknown>;
|
|
9840
10255
|
|
|
9841
10256
|
/**
|
|
9842
10257
|
* Document download building blocks shared by the documents ZIP (`useDownloadDocuments`) and a
|
|
@@ -9888,51 +10303,6 @@ declare function useDownloadDocuments({ workspaceName }?: UseDownloadDocumentsOp
|
|
|
9888
10303
|
/** A `Map<docId, dataUri>` of thumbnails for the visible documents, growing as they scroll. */
|
|
9889
10304
|
declare function useDocumentThumbnails(visibleIds: string[]): Map<string, string>;
|
|
9890
10305
|
|
|
9891
|
-
/**
|
|
9892
|
-
* DocumentTable — a reusable AG Grid (community) block that renders a
|
|
9893
|
-
* workspace's documents using the promoted entity pills.
|
|
9894
|
-
*
|
|
9895
|
-
* REUSE-FIRST: this composes AG Grid + `DocumentEntity`/`TagEntity` + the shadcn
|
|
9896
|
-
* `Badge`; it is not a bespoke table. Data comes from the SDK `useDocuments`
|
|
9897
|
-
* hook (or an explicit `documents` prop). Selection is controlled via
|
|
9898
|
-
* `selectedIds`/`onSelectionChange`, falling back to
|
|
9899
|
-
* the session state (`useArbiSessionState`) when those props are omitted.
|
|
9900
|
-
*/
|
|
9901
|
-
|
|
9902
|
-
type DocResponse$2 = components['schemas']['DocResponse'];
|
|
9903
|
-
interface DocumentTableProps {
|
|
9904
|
-
/** Workspace to load documents from (used when `documents` is not supplied). */
|
|
9905
|
-
workspaceId?: string;
|
|
9906
|
-
/** Explicit rows. When provided, `useDocuments` is not called. */
|
|
9907
|
-
documents?: DocResponse$2[];
|
|
9908
|
-
/** Called when a row (document) is opened — row click or name-pill click. */
|
|
9909
|
-
onOpenDocument?: (id: string) => void;
|
|
9910
|
-
/**
|
|
9911
|
-
* Whether clicking anywhere in a row opens the document. Default true.
|
|
9912
|
-
*
|
|
9913
|
-
* Set false when the grid is used for bulk work: a reviewer building a
|
|
9914
|
-
* selection to code together will inevitably click a row, and navigating away
|
|
9915
|
-
* mid-selection loses it. With this off, the name pill stays the way to open
|
|
9916
|
-
* a document and the row is purely a selection target.
|
|
9917
|
-
*/
|
|
9918
|
-
openOnRowClick?: boolean;
|
|
9919
|
-
/** Controlled selection (external ids). Falls back to the SDK ui store. */
|
|
9920
|
-
selectedIds?: string[];
|
|
9921
|
-
/** Called with the new selection (external ids). Falls back to the SDK ui store. */
|
|
9922
|
-
onSelectionChange?: (ids: string[]) => void;
|
|
9923
|
-
/** Grid height. Number → pixels; string passed through. Default 480. */
|
|
9924
|
-
height?: number | string;
|
|
9925
|
-
/**
|
|
9926
|
-
* Extra columns appended after the built-ins — e.g. one per coding field in a
|
|
9927
|
-
* review protocol, so a grid can be coded across rather than document by
|
|
9928
|
-
* document. Standard AG Grid `ColDef`s; give each an explicit `colId`, since
|
|
9929
|
-
* AG Grid persists column state and auto-generated ids reorder unexpectedly.
|
|
9930
|
-
*/
|
|
9931
|
-
extraColumns?: ColDef<DocResponse$2>[];
|
|
9932
|
-
className?: string;
|
|
9933
|
-
}
|
|
9934
|
-
declare function DocumentTable({ workspaceId, documents, onOpenDocument, openOnRowClick, selectedIds, onSelectionChange, height, extraColumns, className, }: DocumentTableProps): React__default.JSX.Element;
|
|
9935
|
-
|
|
9936
10306
|
/**
|
|
9937
10307
|
* The ⋯ actions menu that sits in a document tile's top-right corner.
|
|
9938
10308
|
*
|
|
@@ -9954,33 +10324,6 @@ interface DocumentCardMenuProps {
|
|
|
9954
10324
|
}
|
|
9955
10325
|
declare function DocumentCardMenu({ docId, fileName, onOpen, onRename, canDelete, testId, }: DocumentCardMenuProps): React__default.JSX.Element;
|
|
9956
10326
|
|
|
9957
|
-
/**
|
|
9958
|
-
* DocumentGallery — a reusable thumbnail-grid view of a workspace's documents.
|
|
9959
|
-
*
|
|
9960
|
-
* REUSE-FIRST: a sibling of `DocumentTable` sharing the exact same data sources
|
|
9961
|
-
* (`useDocuments` + `useTags` + the session state's selection).
|
|
9962
|
-
* The only extra dependency is `useThumbnails`, which batch-loads real first-page
|
|
9963
|
-
* previews. Each tile is a `DocumentCard`; this component only binds it to data.
|
|
9964
|
-
*/
|
|
9965
|
-
|
|
9966
|
-
type DocResponse$1 = components['schemas']['DocResponse'];
|
|
9967
|
-
interface DocumentGalleryProps {
|
|
9968
|
-
/** Workspace to load documents from (used when `documents` is not supplied). */
|
|
9969
|
-
workspaceId?: string;
|
|
9970
|
-
/** Explicit rows. When provided, `useDocuments` is not called. */
|
|
9971
|
-
documents?: DocResponse$1[];
|
|
9972
|
-
/** Called when a card (document) is opened. */
|
|
9973
|
-
onOpenDocument?: (id: string) => void;
|
|
9974
|
-
/** Controlled selection (external ids). Falls back to the SDK ui store. */
|
|
9975
|
-
selectedIds?: string[];
|
|
9976
|
-
/** Called with the new selection (external ids). Falls back to the SDK ui store. */
|
|
9977
|
-
onSelectionChange?: (ids: string[]) => void;
|
|
9978
|
-
/** Min tile width in px — the grid auto-fills as many columns as fit. Default 148. */
|
|
9979
|
-
minTileWidth?: number;
|
|
9980
|
-
className?: string;
|
|
9981
|
-
}
|
|
9982
|
-
declare function DocumentGallery({ workspaceId, documents, onOpenDocument, selectedIds, onSelectionChange, minTileWidth, className, }: DocumentGalleryProps): React__default.JSX.Element;
|
|
9983
|
-
|
|
9984
10327
|
/**
|
|
9985
10328
|
* DocumentReview — a reusable, decoupled "review mode" viewer for a single
|
|
9986
10329
|
* document. It renders the parsed content (chunks grouped by page, as markdown)
|
|
@@ -10617,123 +10960,60 @@ interface UploadFromUrlsResult {
|
|
|
10617
10960
|
declare function useUploadFromUrls(): ({ urls, shared, configExtId }: UploadFromUrlsInput) => Promise<UploadFromUrlsResult>;
|
|
10618
10961
|
|
|
10619
10962
|
/**
|
|
10620
|
-
* The
|
|
10621
|
-
*
|
|
10622
|
-
*
|
|
10963
|
+
* The documents related to each document of a workspace. It computes a map of related documents for each document in the workspace.
|
|
10964
|
+
* Relationships include:
|
|
10965
|
+
* - Email family: parent/child via parent_ext_id (an attachment and its email, a message and its
|
|
10966
|
+
* mailbox archive). Versions are NOT relations: they live inside their document.
|
|
10967
|
+
* - Made from: derivations (a crop's source image, a redline's inputs, a redacted copy's original,
|
|
10968
|
+
* a production's documents) from `derived_from`, with the source version when it is not the
|
|
10969
|
+
* current one; and the other way round, the copies made from a document
|
|
10970
|
+
* - Exact duplicates (same content_hash / fingerprint)
|
|
10971
|
+
* - Near-duplicates (from similarity API)
|
|
10623
10972
|
*
|
|
10624
|
-
*
|
|
10625
|
-
*
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
/** The document
|
|
10630
|
-
|
|
10631
|
-
/**
|
|
10632
|
-
|
|
10633
|
-
/**
|
|
10634
|
-
|
|
10635
|
-
/**
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
type ArbiViewerTab = 'pdf' | 'edit' | 'html' | 'docx' | 'xlsx' | 'versions' | 'preview';
|
|
10640
|
-
/**
|
|
10641
|
-
* The document viewer's own state, shared with whatever opens documents (a citation opens the text
|
|
10642
|
-
* view, Compare from a documents list opens the redline): the open tab, the document compared with
|
|
10643
|
-
* the one viewed, and a tab asked for when a document was opened (applied once it has loaded).
|
|
10644
|
-
*/
|
|
10645
|
-
interface ArbiDocumentViewerState {
|
|
10646
|
-
tab: ArbiViewerTab;
|
|
10647
|
-
/** The document (or version reference) compared with the viewed one, or null. */
|
|
10648
|
-
compareId: string | null;
|
|
10649
|
-
/** A tab to show once `documentId` has loaded (a signature request opens on the PDF). */
|
|
10650
|
-
tabRequest: {
|
|
10651
|
-
documentId: string;
|
|
10652
|
-
tab: ArbiViewerTab;
|
|
10653
|
-
} | null;
|
|
10654
|
-
/** The text view's size, a multiplier of the normal size: a reading preference. */
|
|
10655
|
-
textScale: number;
|
|
10656
|
-
/** A phone user picked the PDF by hand: documents stop opening on the text view. */
|
|
10657
|
-
phonePdfChosen: boolean;
|
|
10658
|
-
}
|
|
10659
|
-
/** Generation in one conversation. */
|
|
10660
|
-
interface ArbiConversationGeneration {
|
|
10661
|
-
isGenerating: boolean;
|
|
10662
|
-
error: string | null;
|
|
10663
|
-
/** When the running turn started (epoch ms). */
|
|
10664
|
-
startTime: number | null;
|
|
10665
|
-
}
|
|
10666
|
-
/** A document in a conversation's context; a pinned one stays there across turns. */
|
|
10667
|
-
interface ArbiConversationDocument {
|
|
10668
|
-
docId: string;
|
|
10669
|
-
isPinned: boolean;
|
|
10670
|
-
}
|
|
10671
|
-
interface ArbiSessionState {
|
|
10672
|
-
/** The selected workspace (`wrk-…`). */
|
|
10673
|
-
workspaceId: string | null;
|
|
10674
|
-
/** The open conversation, or null for a new one / none. */
|
|
10675
|
-
conversationId: string | null;
|
|
10676
|
-
viewingDocument: ArbiViewingDocument | null;
|
|
10677
|
-
documentViewer: ArbiDocumentViewerState;
|
|
10678
|
-
/** The documents selected in document lists. */
|
|
10679
|
-
selectedDocumentIds: readonly string[];
|
|
10680
|
-
/** Generation state per conversation id. */
|
|
10681
|
-
generating: Readonly<Record<string, ArbiConversationGeneration>>;
|
|
10682
|
-
/** Personal Assistant mode for new conversations. */
|
|
10683
|
-
paMode: boolean;
|
|
10684
|
-
/** The documents in each conversation's context, per conversation id. */
|
|
10685
|
-
conversationDocuments: Readonly<Record<string, readonly ArbiConversationDocument[]>>;
|
|
10686
|
-
}
|
|
10687
|
-
/** What to view: page and passage are left unchanged when omitted. */
|
|
10688
|
-
interface ArbiViewingDocumentInput {
|
|
10689
|
-
id: string;
|
|
10690
|
-
page?: number | null;
|
|
10691
|
-
passageId?: string | null;
|
|
10692
|
-
}
|
|
10693
|
-
interface ArbiSessionStore {
|
|
10694
|
-
/** The current state. The same object until something in it changes. */
|
|
10695
|
-
getState(): ArbiSessionState;
|
|
10696
|
-
/** Be told when the state may have changed. Returns the unsubscribe. */
|
|
10697
|
-
subscribe(listener: () => void): () => void;
|
|
10698
|
-
setWorkspaceId(id: string | null): void;
|
|
10699
|
-
setConversationId(id: string | null): void;
|
|
10973
|
+
* Returns a stable Map<docExtId, RelatedDocs> recomputed only when
|
|
10974
|
+
* the documents array or similarity data changes.
|
|
10975
|
+
*/
|
|
10976
|
+
|
|
10977
|
+
interface RelatedDocs<D extends WorkspaceDocument = WorkspaceDocument> {
|
|
10978
|
+
/** The email / mailbox archive this document was extracted from. */
|
|
10979
|
+
parent?: D;
|
|
10980
|
+
/** Attachments: documents extracted from this one. */
|
|
10981
|
+
children: D[];
|
|
10982
|
+
/** Documents this one was made from (crop, redline, redacted copy); not the previous version. */
|
|
10983
|
+
madeFrom: D[];
|
|
10984
|
+
/** Documents made from this one (a redacted or annotated copy, a production, a crop). */
|
|
10985
|
+
copies: D[];
|
|
10986
|
+
/** How each made-from / copy document is related, by its id (a `derived_from` role). */
|
|
10987
|
+
roles: Record<string, string>;
|
|
10700
10988
|
/**
|
|
10701
|
-
*
|
|
10702
|
-
*
|
|
10989
|
+
* The version of a made-from document this one was made from, by its id — only when that is
|
|
10990
|
+
* not the source's current version (the copy was made from an older version).
|
|
10703
10991
|
*/
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
setConversationDocuments(conversationId: string, documents: ArbiConversationDocument[]): void;
|
|
10992
|
+
versions?: Record<string, number>;
|
|
10993
|
+
duplicates: D[];
|
|
10994
|
+
similar: Array<{
|
|
10995
|
+
doc: D;
|
|
10996
|
+
similarity: number;
|
|
10997
|
+
}>;
|
|
10711
10998
|
}
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
declare function
|
|
10999
|
+
type RelatedDocsMap<D extends WorkspaceDocument = WorkspaceDocument> = Map<string, RelatedDocs<D>>;
|
|
11000
|
+
/** Count total related documents for a given entry */
|
|
11001
|
+
declare function getRelatedTotal(related: RelatedDocs<WorkspaceDocument>): number;
|
|
11002
|
+
/** Build human-readable count labels per relationship type */
|
|
11003
|
+
declare function getRelatedLabels(related: RelatedDocs<WorkspaceDocument>): string[];
|
|
11004
|
+
/**
|
|
11005
|
+
* Computes related documents map from workspace documents and similarity API.
|
|
11006
|
+
* Call this in a component that has access to the documents array.
|
|
11007
|
+
*/
|
|
11008
|
+
declare function useRelatedDocuments<D extends WorkspaceDocument>(documents: D[]): RelatedDocsMap<D>;
|
|
10722
11009
|
|
|
10723
11010
|
/**
|
|
10724
|
-
* The session state the blocks
|
|
10725
|
-
*
|
|
10726
|
-
*
|
|
10727
|
-
* always mount one and still share the host's. Blocks rendered with no provider above share a
|
|
11011
|
+
* The session state the blocks share (see `./store`). A host passes its own {@link ArbiSessionStore}
|
|
11012
|
+
* as the host configuration's `session` (ARBI-frontend backs it with its zustand store). Without
|
|
11013
|
+
* one, each top-level `<ArbiHost>` keeps an in-memory one, and blocks rendered with no host share a
|
|
10728
11014
|
* module default, so a standalone block still coordinates with its siblings.
|
|
10729
11015
|
*/
|
|
10730
11016
|
|
|
10731
|
-
interface ArbiSessionStateProviderProps {
|
|
10732
|
-
/** The host's session state. Omitted: the enclosing provider's, else an in-memory one. */
|
|
10733
|
-
store?: ArbiSessionStore;
|
|
10734
|
-
children: ReactNode;
|
|
10735
|
-
}
|
|
10736
|
-
declare function ArbiSessionStateProvider({ store, children, }: ArbiSessionStateProviderProps): React.ReactElement;
|
|
10737
11017
|
/** The session store: its setters, and `getState()` for the state as of now (in callbacks). */
|
|
10738
11018
|
declare function useArbiSessionStore(): ArbiSessionStore;
|
|
10739
11019
|
/**
|
|
@@ -10742,4 +11022,17 @@ declare function useArbiSessionStore(): ArbiSessionStore;
|
|
|
10742
11022
|
*/
|
|
10743
11023
|
declare function useArbiSessionState<T>(selector: (state: ArbiSessionState) => T): T;
|
|
10744
11024
|
|
|
10745
|
-
export { ALLOWED_PORTAL_ORIGINS, AUDIO_MIME_PREFERENCE, type AccountClient, type AccountClientContextValue, AccountClientProvider, type AccountClientProviderProps, type AccountSession, type AccountSignOutOptions, type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AddWorkspaceMembersRequest, type AgentAccessMode, type AgentConfigSections, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, type ArbiConversationDocument, type ArbiConversationGeneration, type ArbiDocumentViewerState, ArbiProvider, type ArbiProviderProps, type ArbiSessionState, ArbiSessionStateProvider, type ArbiSessionStateProviderProps, type ArbiSessionStore, type ArbiViewerTab, type ArbiViewingDocument, type ArbiViewingDocumentInput, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, type AssignDocTagsInput, AudIcon, type AudioRecorderState, type AudioSegment, type AvatarCrop, type AvatarFileProblem, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, COLUMN_LABEL_FALLBACKS, type CalendarConnectorSupport, type CalendarOfflineSupport, type CalendarPendingWrite, type CalendarSupport, CalendarSupportProvider, type CalendarWriteOp, ChatBubble, type ChatBubbleProps, type Chunk, type ChunkActivation, type ChunkedRecorder, type ChunkedRecorderOptions, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CreateProjectVars, type CreateTagInput, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_DOCUMENT_VIEWER_STATE, DEFAULT_METADATA_TAGS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_SEGMENTER_CONFIG, DEFAULT_START_BY_EMAIL_LABELS, DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, DateSeparator, type DateSeparatorProps, type DeleteAccountBlocker, type DeleteAccountFlow, type DescribeServerNotificationOptions, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, DocumentGallery, type DocumentGalleryProps, DocumentReview, type DocumentReviewProps, type DocumentRowChange, DocumentTable, type DocumentTableProps, type DocumentsSupport, DocumentsSupportProvider, DraftTitleControls, type DraftTitleControlsProps, EMPTY_SESSION_STATE, type EmailChange, type EmailPreferences, EmlIcon, type EnableDriveSyncVars, type EnableMailboxSyncVars, EntityIconComponent, type ExtractedZip, FILE_TYPE_COLORS, FINISHED_DOCUMENT_STATUSES, type FactListFilter, FileIcon, FireworksIcon, type FolderTreeNode, type FollowSaveCallbacks, GeminiIcon, type GenerateDocTagsInput, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HtmlIcon, INITIAL_SEGMENTER_STATE, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, type MailAccount, type MailAddress, type MailAttachment, type MailClient, type MailClientContextValue, MailClientProvider, type MailClientProviderProps, type MailCompose, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailDraftEditorRequest, type MailDraftEditorSession, type MailFetch, type MailFolder, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MailProject, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTarget, type NotificationTypeMeta, NotifyVariant, OpenAIIcon, type OptimisticDocumentEdit, type OrderResolver, POLL_EVERY_MS, PROJECT_CREATION_DENIED_REASON, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PassageResolvers, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProcessingTask, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, type QueuedCalendarWrite, type QueuedDocument, type QuoteResolver, RUN_WINDOW_MS, type RecordedChunk, type RefreshDocumentsOptions, type RefusedUploadFile, type RelevancePatch, type RemoveDocTagsInput, type RenderMarkdown, SIGNATURE_NOTIFICATION_TYPES, SIMILARITY_THRESHOLD, SLOW_AFTER_MS, STILL_WORKING, type SaveAgentConfigVars, type SearchMode, SearchSession, SearchStatus, type SegmenterConfig, type SegmenterEvent, type SegmenterState, type SemanticSearch, type SemanticSearchOptions, type ServerNotificationDescription, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, type SignatureNotificationType, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, UPLOAD_ACCEPT, UPLOAD_MAX_FILE_SIZE, type UpdateDocTagInput, type UpdateDocumentsInput, type UpdateProfileVars, type UploadDocumentsInput, type UploadFilesInput, type UploadFilesProgress, type UploadFilesResult, type UploadFromUrlsInput, type UploadFromUrlsResult, type UploadRefusal, type UploadUrlsInput, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseDownloadDocumentsOptions, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, type UserSettingsPatch, VIDEO_MIME_PREFERENCE, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, WORK_NOTIFICATION_LABELS, type WorkspaceDocument, type WorkspaceMember, type WorkspaceNotificationLevel, type WorkspaceRole, type WorkspaceUpdate, XlsIcon, type ZipExtractor, accountPath, adjustTagCounts, aliasTakenMessage, annotateThread, announceMailDraftReplaced, applyOptimisticDocumentEdit, arbiAccountClient, arbiMailClient, arbiMutationKeys, arbiQueryKeys, archiveName, buildDocumentMetadataRows, buildFolderTree, calendarQueryKeys, callNotificationMeta, canonicalFolderPath, captureFrameAsBlob, classifyMediaError, connectOAuthCalendarAccount, connectorErrorStatus, connectorQueryKeys, connectorReturnTo, createArbiSessionStore, createChunkedRecorder, createMailClient, cropImage, dayKey, defaultMailAlias, deploymentUserMeta, describeActivity, describeServerNotification, documentActivityMeta, documentActivityPhrase, documentDisplayName, docxMentionMeta, downloadRecoveryFile, extractZipFile, fallbackFileName, fileAttachment, filesFromDrop, flushSegmenter, forgetDocuments, forgetUploadedDocumentFolder, formatDocDate, formatElapsed, formatFolderLabel, formatIdentityPrice, formatRelativeTime, getCachedDocuments, getDocumentAuthor, getDocumentDate, getDocumentNature, getDocumentSubject, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars, invalidateTagData, invalidateTagTables, isAliasTakenError, isDeploymentAdmin, isDeploymentUserNotification, isDocumentAddableToConversation, isDocumentsLoading, isOfflineReadableArbiQuery, isQueuedCalendarWrite, isReplayableArbiMutation, isRestorableArbiQueryOnline, isSignatureNotificationType, isUsageMetered, isWorkspaceNotificationType, isZipFile, levelFromRms, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, nextViewingDocument, notificationUserName, parseActivityContent, parseDeleteAccountBlockers, patchCachedDocument, patchDocuments, patchWorkspaceTags, pickRecentWorkspaces, pickRecorderMimeType, prepareUploadFiles, redlineStats, refreshDocuments, registerArbiMutationDefaults, resetCalendarAccountSyncState, resolveActiveWorkspace, rollbackOptimisticDocumentEdit, safePortalUrl, selectIsGenerating, selectViewingDocumentId, setCachedDocument, signatureNotificationPhrase, signatureRequestMeta, stepSegmenter, stopDocumentsLoading, subscribeDocumentRows, supportsHouseTemplates, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, uploadFolderOf, uploadedDocumentFolder, upsertDocuments, useAccountClient, useActOnStep, useActivity, useAddHolidayCalendar, useAddProjectAddonBlock, useAddWorkspaceMembers, useAddonQuote, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiSessionState, useArbiSessionStore, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssignDocTags, useAssistantQuery, useAudioRecorder, useAuthorizeLimits, useAvailableModels, useAvatarCrop, useBookingPages, useCalDavProfiles, useCalendarAccounts, useCalendarEvent, useCalendarEventByUid, useCalendarEvents, useCalendarInvitations, useCalendarOutbox, useCalendarOverlays, useCalendarSettings, useCalendarShares, useCalendarSupport, useCalendars, useCameraStream, useCanCreateProjects, useCancelDriveSync, useCancelMailboxSync, useCancelProjectSubscription, useChangeProjectPlan, useChargeWatch, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useConnectCalDavAccount, useConnectMailAccount, useConnectOAuthAccount, useConnectorAutoSync, useConnectorCatalog, useConnectorVendorVisibility, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateCalendar, useCreateContact, useCreateEvent, useCreateFact, useCreateFacts, useCreateProject, useCreateProjectCheckout, useCreateRoom, useCreateTag, useCreateWork, useCreateWorkflow, useCurrentSessionId, useCurrentUser, useDecideCounter, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteBookingPage, useDeleteCalendar, useDeleteContact, useDeleteDocuments, useDeleteEvent, useDeleteFact, useDeleteNotifications, useDeleteProject, useDeleteSkill, useDeleteTag, useDeleteWorkflow, useDeleteWorkspaces, useDeploymentDomain, useDirectMessages, useDisconnectCalendarAccount, useDisconnectConnector, useDisconnectMailAccount, useDisconnectSlack, useDocument, useDocumentThumbnails, useDocumentVersionList, useDocuments, useDocumentsById, useDocumentsLoading, useDocumentsSupport, useDownloadDocuments, useDriveFolderChildren, useDriveFolderDocCount, useDriveFolders, useDriveSyncEstimate, useDriveSyncProgress, useEmailChange, useEnableDriveSync, useEnableMailboxSync, useExtractEntities, useFacts, useFetchCalendarEvent, useFilteredProjects, useFinaliseTranslation, useFindTime, useFirmPool, useFollowThread, useFreeBusy, useGenerateAgentAvatar, useGenerateDocTags, useGrantAgentAccess, useHealth, useHolidayCountries, useHouseTemplateCandidates, useIdentityVerification, useIdentityVerificationFlow, useImportCalendar, useInvalidateProjects, useInvalidateTagData, useInviteContacts, useIsSlow, useMailAccounts, useMailAttachmentText, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useMailboxFolders, useMailboxSyncProgress, useMarkNotificationsRead, useMcpTools, useMoveEvent, useMyConnectors, useNameEditor, useNotificationPreferences, useNotifications, useParsedDocument, usePassageQuotes, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanQuote, usePlanWork, usePreviewProjectPlanChange, useProcessingTask, useProcessingTasks, useProducts, useProfile, useProjectBillingPortal, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, usePublishCalendar, useRefreshCalendar, useRefreshConnectorsOnRunEnd, useRefreshProject, useRemoveDocTags, useRemoveWorkspaceMembers, useRenameFolder, useRequestEmailChange, useRespondToEvent, useResumeCalendarAccountConnect, useRevokeAgentAccess, useRooms, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveBookingPage, useSaveCalendarSettings, useSaveMailDraft, useSearchContacts, useSearchFacts, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetSkillVisibility, useSetTagValues, useSetWorkspaceHouseTemplate, useSetWorkspaceMemberRoles, useShareCalendar, useShellWorkspaces, useSignOut, useSimilarDocuments, useSkillSource, useSkills, useSlackConnection, useStartAgentSession, useStartCalendarAccountOAuth, useStartWorkQuery, useSubscribeCalendar, useSyncAccountsOnOpen, useSyncCalendarAccount, useTagKindSchema, useTags, useTerminateSession, useThumbnails, useTopUpFirmPool, useTriggerDriveSync, useTriggerMailboxSync, useUnshareCalendar, useUpdateCalendar, useUpdateCalendarAccount, useUpdateContact, useUpdateConversation, useUpdateDocTag, useUpdateDocuments, useUpdateEvent, useUpdateFact, useUpdateMailMessage, useUpdateProfile, useUpdateProjectAddonSettings, useUpdateProjectFields, useUpdateProjectNextPeriodAddons, useUpdateTag, useUpdateTagKindSchema, useUpdateUserSettings, useUpdateWorkflow, useUpdateWorkspace, useUploadDocuments, useUploadFiles, useUploadFromUrls, useUploadSkillFiles, useUploadUrls, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflowRuns, useWorkflows, useWorkspaceActivity, useWorkspaceDocs, useWorkspaceNotificationLevel, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, withRelativePath, workflowStepOf, workspaceHouseTemplateId };
|
|
11025
|
+
/**
|
|
11026
|
+
* The documents whose people and organisations are being found (`useExtractEntities`), from the
|
|
11027
|
+
* request until the live connection says the batch is done (`batch_complete`, `entity_extract`):
|
|
11028
|
+
* the package's WebSocket (`ArbiWebSocketProvider`) ends it, and a host on its own connection calls
|
|
11029
|
+
* `finishEntityExtraction` from its handler.
|
|
11030
|
+
*/
|
|
11031
|
+
/** The documents an extraction was started on are running. */
|
|
11032
|
+
declare function startEntityExtraction(docIds: readonly string[]): void;
|
|
11033
|
+
/** The extraction of these documents is done. */
|
|
11034
|
+
declare function finishEntityExtraction(docIds: readonly string[]): void;
|
|
11035
|
+
/** The documents being extracted now. */
|
|
11036
|
+
declare function useEntityExtractionDocIds(): readonly string[];
|
|
11037
|
+
|
|
11038
|
+
export { ALLOWED_PORTAL_ORIGINS, AUDIO_MIME_PREFERENCE, type AccountClient, type AccountClientContextValue, type AccountHost, type AccountSession, type AccountSignOutOptions, type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AddWorkspaceMembersRequest, type AgentAccessMode, type AgentConfigSections, type AgentDmStatus, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, type ArbiConversationDocument, type ArbiConversationGeneration, type ArbiDocumentViewerState, ArbiHost, type ArbiHostConfig, ArbiHostConnection, ArbiHostProps, type ArbiSessionState, type ArbiSessionStore, type ArbiViewerTab, type ArbiViewingDocument, type ArbiViewingDocumentInput, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, type AssignDocTagsInput, AudIcon, type AudioRecorderState, type AudioSegment, type AvatarCrop, type AvatarFileProblem, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_ACTION, BOX_SEAT_REFUSED_TITLE, type CalendarConnectorSupport, type CalendarOfflineSupport, type CalendarPendingWrite, type CalendarSupport, type CalendarWriteOp, type ChatAttachmentFile, ChatBubble, type ChatBubbleProps, type ChatEvent, type ChatMemberKey, type ChatMessageResponse, type ChatPost, type ChatResponse, type ChatSummary, type ChatThreadData, type ChatThreadMessage, type Chunk, type ChunkActivation, type ChunkedRecorder, type ChunkedRecorderOptions, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CreateProjectVars, type CreateTagInput, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_DOCUMENT_VIEWER_STATE, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_SEGMENTER_CONFIG, DEFAULT_START_BY_EMAIL_LABELS, DOCUMENTS_FIRST_PAGE_MEASURE, DOCUMENTS_FIRST_PAGE_SIZE, DOCUMENTS_PAGE_SIZE, DateSeparator, type DateSeparatorProps, type DecryptedChatMessage, type DeleteAccountBlocker, type DeleteAccountFlow, type DescribeServerNotificationOptions, DictateContextValue, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, type DocumentHostActions, type DocumentPerson, DocumentReview, type DocumentReviewProps, type DocumentRowChange, type DocumentStartItem, type DocumentsSupport, DraftTitleControls, type DraftTitleControlsProps, EMPTY_SESSION_STATE, type EmailChange, type EmailPreferences, EmlIcon, type EnableDriveSyncVars, type EnableMailboxSyncVars, type EntitledFeature, EntityIconComponent, type ExtractedZip, FILE_TYPE_COLORS, FINISHED_DOCUMENT_STATUSES, type FactListFilter, type FeatureEntitlements, type FeatureRefusal, FileIcon, FireworksIcon, type FollowSaveCallbacks, GeminiIcon, type GenerateDocTagsInput, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HostConfigRecord, HtmlIcon, INITIAL_SEGMENTER_STATE, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, type MailAccount, type MailAddress, type MailAttachment, type MailClient, type MailClientContextValue, type MailCompose, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailDraftEditorRequest, type MailDraftEditorSession, type MailFetch, type MailFolder, type MailHost, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MailProject, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTarget, type NotificationTypeMeta, NotifyVariant, OpenAIIcon, type OptimisticDocumentEdit, type OrderResolver, POLL_EVERY_MS, PROJECT_CREATION_DENIED_REASON, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PassageResolvers, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProcessingTask, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, type QueuedCalendarWrite, type QueuedDocument, type QuoteResolver, RUN_WINDOW_MS, type RecordedChunk, type RefreshDocumentsOptions, type RefusedUploadFile, type RelatedDocs, type RelatedDocsMap, type RelevancePatch, type RemoveDocTagsInput, type RenderMarkdown, SIGNATURE_NOTIFICATION_TYPES, SIMILARITY_THRESHOLD, SLOW_AFTER_MS, STILL_WORKING, type SaveAgentConfigVars, type SearchMode, SearchSession, SearchStatus, type SegmenterConfig, type SegmenterEvent, type SegmenterState, type SemanticSearch, type SemanticSearchOptions, type ServerNotificationDescription, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, type SignatureNotificationType, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, UPLOAD_ACCEPT, UPLOAD_MAX_FILE_SIZE, type UpdateDocTagInput, type UpdateDocumentsInput, type UpdateProfileVars, type UploadDocumentsInput, type UploadFilesInput, type UploadFilesProgress, type UploadFilesResult, type UploadFromUrlsInput, type UploadFromUrlsResult, type UploadRefusal, type UploadUrlsInput, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseDownloadDocumentsOptions, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, type UserSettingsPatch, VIDEO_MIME_PREFERENCE, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, WORK_NOTIFICATION_LABELS, type WorkspaceDocument, type WorkspaceMember, type WorkspaceNotificationLevel, type WorkspaceRole, type WorkspaceUpdate, XlsIcon, type ZipExtractor, accountPath, adjustTagCounts, aliasTakenMessage, annotateThread, announceMailDraftReplaced, appendToThread, applyAgentDmStatus, applyChatEvent, applyChatMessage, applyChatRead, applyChatUpdated, applyOptimisticDocumentEdit, arbiAccountClient, arbiMailClient, arbiMutationKeys, arbiQueryKeys, archiveName, buildDocumentMetadataRows, cachedChat, cachedChats, calendarQueryKeys, callNotificationMeta, captureFrameAsBlob, classifyMediaError, connectOAuthCalendarAccount, connectorErrorStatus, connectorQueryKeys, connectorReturnTo, createArbiSessionStore, createChunkedRecorder, createMailClient, cropImage, dayKey, defaultMailAlias, deploymentUserMeta, describeActivity, describeServerNotification, documentActivityMeta, documentActivityPhrase, documentDisplayName, docxMentionMeta, downloadRecoveryFile, dropTagFromCachedDocuments, entitlementRefusal, extractZipFile, fallbackFileName, fileAttachment, filesFromDrop, finishEntityExtraction, flushSegmenter, forgetDocuments, forgetUploadedDocumentFolder, formatElapsed, formatIdentityPrice, formatRelativeTime, getCachedDocuments, getNotificationTypeMeta, getOpenChat, getRelatedLabels, getRelatedTotal, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, inputRequestTitle, invalidateCalendarEvents, invalidateCalendars, invalidateTagData, invalidateTagTables, isAliasTakenError, isDeploymentAdmin, isDeploymentUserNotification, isDocumentsLoading, isOfflineReadableArbiQuery, isQueuedCalendarWrite, isReplayableArbiMutation, isRestorableArbiQueryOnline, isSignatureNotificationType, isUsageMetered, isWorkspaceNotificationType, isZipFile, levelFromRms, mailDraftIdFromContent, mailJson, mailQueryKeys, mergeHostConfig, mountDiditVerification, myChatId, nextAliasSuggestion, nextViewingDocument, notificationUserName, parseActivityContent, parseDeleteAccountBlockers, patchCachedDocument, patchDocuments, patchWorkspaceTags, pickRecentWorkspaces, pickRecorderMimeType, prepareUploadFiles, redlineStats, refreshDocuments, registerArbiMutationDefaults, removeChat, resetCalendarAccountSyncState, resolveActiveWorkspace, rollbackOptimisticDocumentEdit, safePortalUrl, selectIsGenerating, selectViewingDocumentId, setCachedDocument, setOpenChat, signatureNotificationPhrase, signatureRequestMeta, startEntityExtraction, stepSegmenter, stopDocumentsLoading, subscribeDocumentRows, supportsHouseTemplates, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, uploadFolderOf, uploadedDocumentFolder, upsertChat, upsertDocuments, useAccountClient, useActOnStep, useActivity, useAddChatMembers, useAddHolidayCalendar, useAddProjectAddonBlock, useAddWorkspaceMembers, useAddonQuote, useAgentChats, useAgentConfig, useAgentDmStatus, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiHost, useArbiSessionState, useArbiSessionStore, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssignDocTags, useAssistantQuery, useAudioRecorder, useAuthorizeLimits, useAvailableModels, useAvatarCrop, useBookingPages, useCalDavProfiles, useCalendarAccounts, useCalendarEvent, useCalendarEventByUid, useCalendarEvents, useCalendarInvitations, useCalendarOutbox, useCalendarOverlays, useCalendarSettings, useCalendarShares, useCalendarSupport, useCalendars, useCameraStream, useCanCreateProjects, useCancelDriveSync, useCancelMailboxSync, useCancelProjectSubscription, useChangeProjectPlan, useChargeWatch, useChatLiveUpdates, useChatPost, useChatSummaries, useChatThread, useChatUnreadTotal, useChats, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useConnectCalDavAccount, useConnectMailAccount, useConnectOAuthAccount, useConnectorAutoSync, useConnectorCatalog, useConnectorVendorVisibility, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateCalendar, useCreateContact, useCreateEvent, useCreateFact, useCreateFacts, useCreateGroupChat, useCreateProject, useCreateProjectCheckout, useCreateRoom, useCreateTag, useCreateWork, useCreateWorkflow, useCurrentSessionId, useCurrentUser, useDecideCounter, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteBookingPage, useDeleteCalendar, useDeleteChatMessage, useDeleteContact, useDeleteDocuments, useDeleteEvent, useDeleteFact, useDeleteNotifications, useDeleteProject, useDeleteSkill, useDeleteTag, useDeleteWorkflow, useDeleteWorkspaces, useDeploymentDomain, useDirectMessages, useDisconnectCalendarAccount, useDisconnectConnector, useDisconnectMailAccount, useDisconnectSlack, useDocument, useDocumentHostActions, useDocumentPendingSync, useDocumentThumbnails, useDocumentVersionList, useDocuments, useDocumentsById, useDocumentsLoading, useDocumentsSupport, useDownloadDocuments, useDriveFolderChildren, useDriveFolderDocCount, useDriveFolders, useDriveSyncEstimate, useDriveSyncProgress, useEmailChange, useEnableDriveSync, useEnableMailboxSync, useEntitlements, useEntityExtractionDocIds, useExtractEntities, useFacts, useFetchCalendarEvent, useFilteredProjects, useFinaliseTranslation, useFindTime, useFirmPool, useFollowThread, useFreeBusy, useGenerateAgentAvatar, useGenerateDocTags, useGrantAgentAccess, useHealth, useHolidayCountries, useHouseTemplateCandidates, useIdentityVerification, useIdentityVerificationFlow, useImportCalendar, useImportContacts, useInvalidateProjects, useInvalidateTagData, useInviteContacts, useIsCreatingTag, useIsEntitled, useIsSlow, useLinkContact, useMailAccounts, useMailAttachmentText, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useMailboxFolders, useMailboxSyncProgress, useMarkChatRead, useMarkNotificationsRead, useMcpTools, useMoveEvent, useMyConnectors, useNameEditor, useNotificationPreferences, useNotifications, useOfflineDocumentIds, useOpenViewerDocumentId, useParsedDocument, usePassageQuotes, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanQuote, usePlanWork, usePreviewProjectPlanChange, useProcessingTask, useProcessingTasks, useProducts, useProfile, useProjectBillingPortal, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, usePublishCalendar, useRefreshCalendar, useRefreshConnectorsOnRunEnd, useRefreshProject, useRelatedDocuments, useRemoveChatMember, useRemoveDocTags, useRemoveWorkspaceMembers, useRenameChat, useRenameFolder, useRequestEmailChange, useRespondToEvent, useResumeCalendarAccountConnect, useRevokeAgentAccess, useRooms, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveBookingPage, useSaveCalendarSettings, useSaveMailDraft, useSaveSkill, useSearchContacts, useSearchFacts, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetSkillVisibility, useSetTagValues, useSetWorkspaceHouseTemplate, useSetWorkspaceMemberRoles, useShareCalendar, useShellWorkspaces, useSignOut, useSimilarDocuments, useSkillSource, useSkills, useSlackConnection, useStartAgentSession, useStartCalendarAccountOAuth, useStartWorkQuery, useSubscribeCalendar, useSyncAccountsOnOpen, useSyncCalendarAccount, useTagKindSchema, useTags, useTerminateSession, useThumbnails, useTopUpFirmPool, useTriggerDriveSync, useTriggerMailboxSync, useUnreadByPeer, useUnshareCalendar, useUpdateCalendar, useUpdateCalendarAccount, useUpdateContact, useUpdateConversation, useUpdateDocTag, useUpdateDocuments, useUpdateEvent, useUpdateFact, useUpdateMailMessage, useUpdateProfile, useUpdateProjectAddonSettings, useUpdateProjectFields, useUpdateProjectNextPeriodAddons, useUpdateTag, useUpdateTagKindSchema, useUpdateUserSettings, useUpdateWorkflow, useUpdateWorkspace, useUploadDocuments, useUploadFiles, useUploadFromUrls, useUploadSkillFiles, useUploadUrls, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflowRuns, useWorkflows, useWorkspaceActivity, useWorkspaceDocs, useWorkspaceNotificationLevel, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, withRelativePath, workflowStepOf, workspaceHouseTemplateId };
|