@arbidocs/react 0.5.131 → 0.5.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts/index.cjs +2 -2
- package/dist/billing.js +34 -0
- package/dist/billing.js.map +2 -2
- package/dist/calls/in-call-chat.js +1 -1
- package/dist/calls/in-call-chat.js.map +1 -1
- package/dist/calls/livekit/index.cjs +41 -41
- package/dist/calls/livekit/index.d.ts +1 -1
- package/dist/{chunk-NT3SMYRP.cjs → chunk-HE4AQEWB.cjs} +6 -6
- package/dist/{chunk-NT3SMYRP.cjs.map → chunk-HE4AQEWB.cjs.map} +1 -1
- package/dist/{chunk-PH3RGDYE.cjs → chunk-MDSWUCCL.cjs} +28 -4
- package/dist/chunk-MDSWUCCL.cjs.map +1 -0
- package/dist/hooks.js +26 -2
- package/dist/hooks.js.map +2 -2
- package/dist/index.cjs +615 -573
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +309 -93
- package/dist/index.js +4 -0
- package/dist/index.js.map +2 -2
- package/dist/notifications/notification-types.js +4 -4
- package/dist/notifications/notification-types.js.map +2 -2
- package/dist/notifications/server-notifications.js +2 -2
- package/dist/notifications/server-notifications.js.map +2 -2
- package/dist/{useAudioRecorder.d-B9rlMI_E.d.ts → useAudioRecorder.d-DYVIWxKQ.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-PH3RGDYE.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -122,6 +122,8 @@ import {
|
|
|
122
122
|
useUserUsageToday,
|
|
123
123
|
useCurrentUser,
|
|
124
124
|
useCanCreateProjects,
|
|
125
|
+
useCanCreateWorkspaces,
|
|
126
|
+
useProjectCreationDenial,
|
|
125
127
|
useBoxRole,
|
|
126
128
|
PROJECT_CREATION_DENIED_REASON
|
|
127
129
|
} from "./hooks.js";
|
|
@@ -601,6 +603,7 @@ export {
|
|
|
601
603
|
useBoxRole,
|
|
602
604
|
useBuiltinCommands,
|
|
603
605
|
useCanCreateProjects,
|
|
606
|
+
useCanCreateWorkspaces,
|
|
604
607
|
useCanEditShared,
|
|
605
608
|
useCloseAgentSession,
|
|
606
609
|
useConfig,
|
|
@@ -673,6 +676,7 @@ export {
|
|
|
673
676
|
usePlanWork,
|
|
674
677
|
usePortalContainer,
|
|
675
678
|
useProjectConversationUsage,
|
|
679
|
+
useProjectCreationDenial,
|
|
676
680
|
useProjectInvoices,
|
|
677
681
|
useProjectUsage,
|
|
678
682
|
useProjects,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @arbidocs/react \u2014 React hooks and provider for the ARBI SDK.\n *\n * Usage:\n * import { ArbiHost, useArbi, useWorkspaces, useDocuments } from '@arbidocs/react'\n * <ArbiHost config={{ arbi }}><App /></ArbiHost>\n *\n * Chat page controller (UI in @arbidocs/blocks/chat):\n * const chat = useConversation({ workspaceId })\n */\n\n// The host configuration: one `<ArbiHost config>` for every hook and kit\nexport {\n ArbiHost,\n mergeHostConfig,\n useArbiHost,\n type ArbiHostConfig,\n type ArbiHostConnection,\n type ArbiHostProps,\n type AccountHost,\n type MailHost,\n type CallsHost,\n type CallSlotMode,\n} from './host'\n// Features the user switches on or off (the user's settings, or this device): `useFeature(name)`\nexport {\n createLocalFeatureStore,\n readLocalFeature,\n useFeature,\n useFeatureCheck,\n useFeatureSwitch,\n type ArbiFeature,\n type ArbiFeatures,\n type FeatureSource,\n type FeatureSwitch,\n type LocalFeatureStore,\n type LocalFeatureStoreOptions,\n type UserSettingFlag,\n} from './host/features'\nexport { useHostConfigRecord, type HostConfigRecord } from './host/context'\nexport * from './host/assistant-copy'\n\n// The chat engine as one hook: threads, messages, grounding documents (UI: `ChatPage` in\n// @arbidocs/blocks/chat), and the scope a surface keeps its own open conversation in\nexport {\n useConversation,\n workflowStepOf,\n titleFromQuestion,\n type ArbiConversation,\n type ArbiChatCitation,\n type ArbiChatDocument,\n type ArbiChatMessage,\n type ArbiChatMessageStatus,\n type ArbiChatPassage,\n type ArbiChatRole,\n type ArbiChatThread,\n type UseConversationOptions,\n} from './chat/useConversation'\nexport { ConversationScope, type ConversationScopeProps } from './chat/ConversationScope'\n// An untitled saved-workflow run's name (its workflow and day), as every thread list shows it\nexport { workflowRunTitle } from './chat/workflow-run-titles'\n// The workspace a conversation is in (a fact saved from its answer goes there)\nexport { useConversationWorkspace } from './chat/useConversationWorkspace'\nexport { toChatCitations } from './chat/citations'\n// A conversation's threads in the cache, and their writers (the chat engine's and the events')\nexport * from './chat/conversation-cache'\nexport * from './chat/conversation-events'\nexport * from './chat/run-state'\nexport * from './chat/stream-handlers'\nexport * from './chat/mentions'\nexport * from './chat/open-document'\nexport * from './chat/chat-artifacts'\nexport * from './chat/thread-document'\nexport * from './chat/turn-flush'\nexport * from './chat/thread-binding'\nexport * from './chat/useThreadDocument'\nexport * from './chat/conversation-mentions'\nexport { resolveConfigModel } from './chat/config-model'\nexport { useDeleteMessage } from './chat/useDeleteMessage'\nexport {\n formatConfigValidationError,\n isFullConfig,\n useApplyChatModel,\n pendingChatModelSave,\n AUTO_CHAT_MODEL,\n useConfigSchema,\n useDeleteConfig,\n useSaveConfig,\n useSaveConfigField,\n type ConfigUpdate,\n} from './config/config-hooks'\nexport { useConversationTurn } from './chat/useConversationTurn'\nexport { useActiveConfigId } from './chat/active-config'\nexport { useConversationDocuments } from './chat/useConversationDocuments'\nexport { useDocumentAutoAdd } from './chat/useDocumentAutoAdd'\nexport { useAutoSendDraft } from './chat/useAutoSendDraft'\nexport { getOrphanedLastMessage, isOrphanedUserMessage } from './chat/orphaned'\nexport { buildPendingFirstTurn } from './chat/pendingFirstTurn'\nexport { useAnswerAgentQuestion, type AgentQuestionRef } from './chat/useAnswerAgentQuestion'\nexport * from './chat/turn-control'\nexport * from './chat/reply-target'\nexport * from './chat/useConversationActions'\nexport * from './chat/useConnectRunStream'\nexport * from './chat/useConversationData'\nexport * from './chat/useConversationSettings'\nexport * from './chat/useBranchNavigation'\nexport * from './chat/useAskAgain'\nexport * from './chat/useThinkingContent'\nexport * from './chat/useMessageTimer'\nexport * from './chat/useAgentRunControl'\nexport type { ArbiChatHost, ArbiThreadView } from './chat/host'\n\n// Chat message bubble (props-in; host injects markdown renderer + timestamp fmt)\nexport { ChatBubble, TypingIndicator, type ChatBubbleProps } from './chat/ChatBubble'\n\n// Context hook\nexport { useArbi, useDeploymentDomain } from './useArbi'\nexport { BOOT_GATE_TIMEOUT_MS, useBootTimeout } from './boot-timeout'\nexport {\n useInstallSkillPack,\n createSkillPack,\n type CreateSkillPackOptions,\n type SkillPack,\n type SkillPackEntry,\n type InstallSkillPackVariables,\n} from './useInstallSkillPack'\nexport {\n defineSkillPack,\n skillPackPrompt,\n type DefineSkillPackOptions,\n type DefinedSkillPack,\n type SkillPackField,\n type SkillPackSkill,\n type SkillPackSkillDefinition,\n} from './skill-pack'\n\n// Online or not: the network, the live connection and \"Work offline\" (run by the provider)\nexport {\n computeOnline,\n isWorkingOffline,\n setWorkOfflineIn,\n useReconnect,\n useWorkOffline,\n WORK_OFFLINE_VIEW,\n type ReconnectOutcome,\n} from './connectivity'\n\n// Shared WebSocket layer (one reconnecting socket, canonical store, typed\n// subscriptions, drop-in document sync \u2014 the real-time layer both apps share)\nexport {\n ArbiWebSocketProvider,\n useArbiWsContext,\n type ArbiWebSocketProviderProps,\n type ArbiWsHandlers,\n useArbiWebSocket,\n useArbiWsMessage,\n useArbiWsStatus,\n applyLiveUpdate,\n LIVE_UPDATE_TYPES,\n useArbiWsStore,\n DISMISSED_TASK_TTL_MS,\n type LiveTask,\n type ArbiWsState,\n type ArbiWsStatus,\n} from './websocket'\n\n// Schema-typed WebSocket messages + the discriminant type guard (so consumers\n// narrow handlers exactly like the rest of the SDK).\nexport { isMessageType } from '@arbidocs/client'\nexport type {\n WebSocketServerMessage,\n WsTaskUpdateMessage,\n WsBatchCompleteMessage,\n WsPresenceUpdateMessage,\n WsResponseCompleteMessage,\n WsConversationMessagePostedMessage,\n WsNotificationResponse,\n} from '@arbidocs/client'\n\n// Workspaces as the shell and the gallery show them (adapters, active workspace, open)\nexport * from './workspaces'\n\n// React Query hooks\nexport {\n useWorkspaces,\n useDocumentVersionList,\n useThumbnails,\n useParsedDocument,\n useConversations,\n useConversationThreads,\n useMessageDetails,\n useBuiltinCommands,\n useTags,\n useAgents,\n useDeleteAgents,\n useAssistantQuery,\n useHealth,\n useAvailableModels,\n useConfigs,\n useConfig,\n useActivity,\n useWorkspaceActivity,\n useProjects,\n useProjectUsage,\n useProjectInvoices,\n useUserUsageToday,\n useCurrentUser,\n useCanCreateProjects,\n useBoxRole,\n PROJECT_CREATION_DENIED_REASON,\n} from './hooks'\n// The one query-key factory (and its prefix match): every key the packages and hosts use.\nexport { arbiQueryKeys, arbiMutationKeys, isUnderQueryKey } from './query-keys'\n\n// Workspace facts\nexport {\n useFacts,\n useCreateFact,\n useCreateFacts,\n useUpdateFact,\n useDeleteFact,\n useSearchFacts,\n type FactListFilter,\n} from './facts'\nexport {\n useFactsSearch,\n FACTS_SEARCH_VIEW,\n type FactSearchHit,\n type FactsSearch,\n type FactsSearchState,\n type UseFactsSearchOptions,\n} from './facts-search'\n\n// Work (conversations with a status), workflows, agents, skills (mutations invalidate through arbiQueryKeys)\nexport {\n useUpdateConversation,\n useCreateWork,\n useRunConversation,\n usePlanWork,\n useActOnStep,\n useConversationPendingAuth,\n useWorkflows,\n useWorkflowRuns,\n useCreateWorkflow,\n useInvalidateWorkflows,\n useUpdateWorkflow,\n useDeleteWorkflow,\n useRunWorkflow,\n useCreateAgent,\n useGenerateAgentAvatar,\n useAuthorizeLimits,\n useMcpTools,\n useAgentConfig,\n useAgentModels,\n useSaveAgentConfig,\n useAgentWorkspaces,\n useGrantAgentAccess,\n useRevokeAgentAccess,\n useSkills,\n useSkillSource,\n useDeleteSkill,\n useSaveSkill,\n useSetSkillVisibility,\n useUploadSkillFiles,\n useConversationActivity,\n useConversationItems,\n useConversationIsShared,\n useWorkItems,\n useWorkspaceRole,\n useCanEditShared,\n useIsWorkspaceOwner,\n useStartTaskQuery,\n useDeleteConversation,\n useConversationSearch,\n TaskThreadPendingError,\n isActivityKey,\n invalidateConversationActivity,\n type StartTaskQuery,\n type AgentConfigSections,\n type SaveAgentConfigVars,\n type AgentAccessMode,\n type GrantAgentAccessVars,\n} from './workforce'\n\n// The workspace's conversation list in the cache: its writers (patch, add, remove) and readers\nexport * from './conversation-list'\n\n// Databases: user-defined tables of the open workspace (reads, writes, imports, export)\nexport * from './databases'\n// Saved table views (user settings `tableviews`): a grid's columns, read by charts too\nexport {\n isTableViewOf,\n viewsOfTable,\n type TableView,\n type TableViewTable,\n} from './account/table-views'\n// Datasets: data source adapters (usage, documents, threads, projects, databases) returning one\n// normalized dataset, the chart / panel / dashboard specs, and saved dashboards\nexport * from './datasets'\n\n// Tags: the writes (patching the workspace's list), and kinds' fields (a table's columns)\nexport {\n useCreateTag,\n useIsCreatingTag,\n useUpdateTag,\n useDeleteTag,\n useExtractEntities,\n useTagKindSchema,\n useUpdateTagKindSchema,\n useSetTagValues,\n useInvalidateTagData,\n invalidateTagData,\n invalidateTagTables,\n patchWorkspaceTags,\n type CreateTagInput,\n} from './tags'\n\n// Cited passages' text, read live from their documents' parsed content\nexport {\n usePassageQuotes,\n type PassageResolvers,\n type QuoteResolver,\n type OrderResolver,\n} from './documents/usePassageQuotes'\n\n// The shared React Query client, and the offline cache it may keep on this device (opt in)\nexport {\n createArbiQueryClient,\n type ArbiQueryClient,\n type ArbiQueryClientOptions,\n} from './query-client'\nexport { claimOfflineQueue, type ArbiQueryPersistOptions } from './query-persist'\n// Offline writes kept across a reload (opt in: a host with a persisted query cache)\nexport { registerArbiMutationDefaults, isReplayableArbiMutation } from './offline'\n// Telling \"no connection\" from a server's answer (a request that never reached the server)\nexport { isNetworkFailure } from './offline-store/network'\n\n// Project details, their events, and spend by conversation and step\nexport { useUpdateProjectFields, useProjectConversationUsage } from './projects'\nexport * from './billing'\n// Storage: usage by project, kind and workspace, the largest items, Recently deleted, trash actions\nexport * from './storage'\n\n// Contacts\nexport {\n useContacts,\n useReferralSummary,\n useInviteContacts,\n useCreateContact,\n useUpdateContact,\n useLinkContact,\n useImportContacts,\n useDeleteContact,\n useSearchContacts,\n} from './contacts'\n// The people directory: who an account id or an address is (contacts, workspace members, agents)\nexport {\n peopleDirectory,\n personOfUser,\n usePeople,\n usePeopleSearch,\n type PeopleDirectory,\n type Person,\n type UserResponse,\n} from './people'\n\n// The Word house template a workspace may choose\nexport {\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useSetDeploymentHouseTemplate,\n supportsHouseTemplates,\n workspaceHouseTemplateId,\n isDeploymentAdmin,\n} from './house-template'\n\n// The main agent's model connections (box and personal) and the direct model usage\nexport {\n useModelConnections,\n useDirectModelUsage,\n useSaveModelConnection,\n useRemoveModelConnection,\n useUnlockModelConnections,\n} from './model-connections'\nexport type {\n ConnectionModel,\n DirectModelUsage,\n ModelConnection,\n PersonalConnectionInput,\n} from '@arbidocs/sdk/browser'\n\n// The workspace Assistant: its brief and what it did with each arrival\nexport {\n useAssistantBrief,\n useUpdateAssistantBrief,\n useAssistantArrivals,\n useAssistantStatus,\n useMarkArrivalWrong,\n useMarkMessageDraftSent,\n useInvalidateAssistant,\n} from './workspace-assistant'\nexport type { AssistantArrival, AssistantBrief, AssistantBriefInput } from '@arbidocs/sdk/browser'\n\n// Account and settings: profile, email, password, notification preferences, sessions, deletion\nexport * from './account'\n\n// Mail: the native inbox and connected accounts (client, provider, hooks)\nexport * from './mail'\n\n// Calendar: hooks over arbi.calendar, and the host's offline storage and connector OAuth\nexport * from './calendar'\n// Calls without LiveKit: data, the call session and events, actions, meeting chats, recordings\nexport * from './calls'\n\n// AI usage is reported in \u00A3 (ex VAT): one formatter for every amount\nexport {\n formatGbp,\n formatGbpPerMillionTokens,\n usdToGbp,\n DEFAULT_AI_USD_PER_GBP,\n} from '@arbidocs/sdk/browser'\nexport { isUsageMetered, type UsageTotals } from './usage-metered'\n\n// Re-export key types from core (browser-safe)\nexport { Arbi, type ArbiOptions, type AskRequest, type AskHandlers } from '@arbidocs/sdk/browser'\nexport type {\n ActivityKind,\n ActivityResponse,\n AuthMode,\n ConversationResponse,\n CreateWorkRequest,\n CreateWorkflowRequest,\n PendingAuthResponse,\n PlanWorkRequest,\n TaskPlan,\n UpdateConversationRequest,\n UpdateWorkflowRequest,\n WorkStatus,\n WorkflowAuthMode,\n WorkflowResponse,\n WorkflowRunResponse,\n SkillSummary,\n FactResponse,\n CreateFactRequest,\n FactSearchRequest,\n FactSearchResponse,\n ProjectUsageResponse,\n ProjectInvoicesResponse,\n UserDailyUsageResponse,\n LoginProfile,\n} from '@arbidocs/sdk/browser'\nexport type { SSEStreamResult, SSEStreamCallbacks } from '@arbidocs/sdk/browser'\nexport type {\n ResponseCreatedEvent,\n ResponseCompletedEvent,\n ResponseFailedEvent,\n ResponseOutputTextDeltaEvent,\n ResponseOutputTextDoneEvent,\n ResponseOutputItemAddedEvent,\n ResponseOutputItemDoneEvent,\n ResponseContentPartAddedEvent,\n ResponseUsage,\n OutputTokensDetails,\n AgentStepEvent,\n UserInputRequestEvent,\n ArtifactEvent,\n UserMessageEvent,\n MessageMetadataPayload,\n SSEStreamStartData,\n} from '@arbidocs/sdk/browser'\nexport { ArbiError } from '@arbidocs/sdk/browser'\n\n// \u2500\u2500 UI \"lego\" (promoted from the ARBI app; consumer supplies Tailwind + tokens) \u2500\u2500\n\n// shadcn UI primitives\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './ui/tooltip'\nexport { IconToggle, type IconToggleProps } from './ui/IconToggle'\nexport { VisibilityToggle, type VisibilityToggleProps } from './ui/VisibilityToggle'\nexport { VerifiedToggle } from './ui/VerifiedToggle'\nexport { formatFriendlyDate, formatCompactLastSeen } from './lib/format-friendly-date'\nexport { markdownToPlainText, markdownToPlainTextBlocks } from './lib/markdown-to-text'\nexport { DebouncedInput, type DebouncedInputProps } from './ui/DebouncedInput'\nexport { useDictateContext, type DictateContextValue } from './ui/DictateContext'\nexport { PortalContainerProvider, usePortalContainer } from './ui/portal-container'\nexport { Avatar, AvatarImage, AvatarFallback } from './ui/avatar'\nexport { Badge, badgeVariants, type BadgeProps } from './ui/badge'\nexport { Button, buttonVariants, type ButtonProps } from './ui/button'\nexport { HoverCard, HoverCardTrigger, HoverCardContent } from './ui/hover-card'\nexport {\n Card,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n cardVariants,\n} from './ui/card'\nexport type { CardProps } from './ui/card'\nexport { Input, type InputProps } from './ui/input'\nexport { Label } from './ui/label'\nexport { Separator } from './ui/separator'\nexport { Textarea, type TextareaProps } from './ui/textarea'\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from './ui/collapsible'\nexport { Progress } from './ui/progress'\nexport { ScrollArea, ScrollBar } from './ui/scroll-area'\nexport { RadioGroup, RadioGroupItem } from './ui/radio-group'\nexport { Checkbox } from './ui/checkbox'\nexport { Switch } from './ui/switch'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './ui/tabs'\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from './ui/table'\nexport { Slider } from './ui/slider'\nexport { Toggle, toggleVariants } from './ui/toggle'\nexport { ToggleGroup, ToggleGroupItem } from './ui/toggle-group'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogPresentation,\n} from './ui/dialog'\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverClose } from './ui/popover'\nexport { MarkMenu, type MarkMenuItem, type MarkMenuProps } from './ui/mark-menu'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './ui/dropdown-menu'\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n} from './ui/select'\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from './ui/command'\n\n// \u2500\u2500 AI kit: mid-level, token-neutral building blocks for AI-native apps \u2500\u2500\n// (streaming answers, artifact canvas, redline, doc Q&A)\nexport * from './ai'\n\n// Document search: the one search hook, its session and the label-the-results write.\nexport * from './search'\n\n// File-type icons\nexport * from './icons'\n\n// Decoupled entity pills + canonical entity registry\nexport * from './entities'\n\n// Shared notification & activity presentation layer\nexport * from './notifications'\nexport * from './connectors'\n\n// Direct-message block kit (real E2E-encrypted messenger)\nexport * from './directmessages'\n\n// Image crop kit (frame any uploaded/generated image; avatar is a preset)\nexport * from './imagecrop'\n\n// User menu kit (topbar account avatar dropdown)\nexport * from './usermenu'\n\n// Documents: the list, its writes, uploads, and what a host adds\nexport * from './documents'\n\n// People: display name, initials, avatar colour\nexport * from './users'\n\n// Session state shared by every block (workspace, conversation, viewing document, \u2026)\nexport * from './session'\n\n// Remote control: its session-only consent state and the `remote_control` websocket message\nexport * from './remote-control'\n\n// Class-name helper\nexport { cn } from './lib/utils'\n\nexport {\n useAgentSession,\n useAgentChats,\n useStartAgentSession,\n useCloseAgentSession,\n} from './workforce'\n\n// The documents an entity extraction is running on, until the live connection says it is done\nexport {\n finishEntityExtraction,\n startEntityExtraction,\n useEntityExtractionDocIds,\n} from './entity-extraction'\n\nexport * from './support'\n\n// Heavy components in their own chunk, loaded the first time one renders.\nexport { lazyChunk, lazyComponent, preloadChunks, type LazyChunk } from './lazy-chunk'\n"],
|
|
5
|
-
"mappings": "AAYA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AACP,SAAS,2BAAkD;AAC3D,cAAc;AAId;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAUK;AACP,SAAS,yBAAsD;AAE/D,SAAS,wBAAwB;AAEjC,SAAS,gCAAgC;AACzC,SAAS,uBAAuB;AAEhC,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB,6BAA6B;AAC9D,SAAS,6BAA6B;AACtC,SAAS,8BAAqD;AAC9D,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,SAAS,YAAY,uBAA6C;AAGlE,SAAS,SAAS,2BAA2B;AAC7C,SAAS,sBAAsB,sBAAsB;AACrD;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAIP;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAIP,SAAS,qBAAqB;AAY9B,cAAc;AAGd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["/**\n * @arbidocs/react \u2014 React hooks and provider for the ARBI SDK.\n *\n * Usage:\n * import { ArbiHost, useArbi, useWorkspaces, useDocuments } from '@arbidocs/react'\n * <ArbiHost config={{ arbi }}><App /></ArbiHost>\n *\n * Chat page controller (UI in @arbidocs/blocks/chat):\n * const chat = useConversation({ workspaceId })\n */\n\n// The host configuration: one `<ArbiHost config>` for every hook and kit\nexport {\n ArbiHost,\n mergeHostConfig,\n useArbiHost,\n type ArbiHostConfig,\n type ArbiHostConnection,\n type ArbiHostProps,\n type AccountHost,\n type MailHost,\n type CallsHost,\n type CallSlotMode,\n} from './host'\n// Features the user switches on or off (the user's settings, or this device): `useFeature(name)`\nexport {\n createLocalFeatureStore,\n readLocalFeature,\n useFeature,\n useFeatureCheck,\n useFeatureSwitch,\n type ArbiFeature,\n type ArbiFeatures,\n type FeatureSource,\n type FeatureSwitch,\n type LocalFeatureStore,\n type LocalFeatureStoreOptions,\n type UserSettingFlag,\n} from './host/features'\nexport { useHostConfigRecord, type HostConfigRecord } from './host/context'\nexport * from './host/assistant-copy'\n\n// The chat engine as one hook: threads, messages, grounding documents (UI: `ChatPage` in\n// @arbidocs/blocks/chat), and the scope a surface keeps its own open conversation in\nexport {\n useConversation,\n workflowStepOf,\n titleFromQuestion,\n type ArbiConversation,\n type ArbiChatCitation,\n type ArbiChatDocument,\n type ArbiChatMessage,\n type ArbiChatMessageStatus,\n type ArbiChatPassage,\n type ArbiChatRole,\n type ArbiChatThread,\n type UseConversationOptions,\n} from './chat/useConversation'\nexport { ConversationScope, type ConversationScopeProps } from './chat/ConversationScope'\n// An untitled saved-workflow run's name (its workflow and day), as every thread list shows it\nexport { workflowRunTitle } from './chat/workflow-run-titles'\n// The workspace a conversation is in (a fact saved from its answer goes there)\nexport { useConversationWorkspace } from './chat/useConversationWorkspace'\nexport { toChatCitations } from './chat/citations'\n// A conversation's threads in the cache, and their writers (the chat engine's and the events')\nexport * from './chat/conversation-cache'\nexport * from './chat/conversation-events'\nexport * from './chat/run-state'\nexport * from './chat/stream-handlers'\nexport * from './chat/mentions'\nexport * from './chat/open-document'\nexport * from './chat/chat-artifacts'\nexport * from './chat/thread-document'\nexport * from './chat/turn-flush'\nexport * from './chat/thread-binding'\nexport * from './chat/useThreadDocument'\nexport * from './chat/conversation-mentions'\nexport { resolveConfigModel } from './chat/config-model'\nexport { useDeleteMessage } from './chat/useDeleteMessage'\nexport {\n formatConfigValidationError,\n isFullConfig,\n useApplyChatModel,\n pendingChatModelSave,\n AUTO_CHAT_MODEL,\n useConfigSchema,\n useDeleteConfig,\n useSaveConfig,\n useSaveConfigField,\n type ConfigUpdate,\n} from './config/config-hooks'\nexport { useConversationTurn } from './chat/useConversationTurn'\nexport { useActiveConfigId } from './chat/active-config'\nexport { useConversationDocuments } from './chat/useConversationDocuments'\nexport { useDocumentAutoAdd } from './chat/useDocumentAutoAdd'\nexport { useAutoSendDraft } from './chat/useAutoSendDraft'\nexport { getOrphanedLastMessage, isOrphanedUserMessage } from './chat/orphaned'\nexport { buildPendingFirstTurn } from './chat/pendingFirstTurn'\nexport { useAnswerAgentQuestion, type AgentQuestionRef } from './chat/useAnswerAgentQuestion'\nexport * from './chat/turn-control'\nexport * from './chat/reply-target'\nexport * from './chat/useConversationActions'\nexport * from './chat/useConnectRunStream'\nexport * from './chat/useConversationData'\nexport * from './chat/useConversationSettings'\nexport * from './chat/useBranchNavigation'\nexport * from './chat/useAskAgain'\nexport * from './chat/useThinkingContent'\nexport * from './chat/useMessageTimer'\nexport * from './chat/useAgentRunControl'\nexport type { ArbiChatHost, ArbiThreadView } from './chat/host'\n\n// Chat message bubble (props-in; host injects markdown renderer + timestamp fmt)\nexport { ChatBubble, TypingIndicator, type ChatBubbleProps } from './chat/ChatBubble'\n\n// Context hook\nexport { useArbi, useDeploymentDomain } from './useArbi'\nexport { BOOT_GATE_TIMEOUT_MS, useBootTimeout } from './boot-timeout'\nexport {\n useInstallSkillPack,\n createSkillPack,\n type CreateSkillPackOptions,\n type SkillPack,\n type SkillPackEntry,\n type InstallSkillPackVariables,\n} from './useInstallSkillPack'\nexport {\n defineSkillPack,\n skillPackPrompt,\n type DefineSkillPackOptions,\n type DefinedSkillPack,\n type SkillPackField,\n type SkillPackSkill,\n type SkillPackSkillDefinition,\n} from './skill-pack'\n\n// Online or not: the network, the live connection and \"Work offline\" (run by the provider)\nexport {\n computeOnline,\n isWorkingOffline,\n setWorkOfflineIn,\n useReconnect,\n useWorkOffline,\n WORK_OFFLINE_VIEW,\n type ReconnectOutcome,\n} from './connectivity'\n\n// Shared WebSocket layer (one reconnecting socket, canonical store, typed\n// subscriptions, drop-in document sync \u2014 the real-time layer both apps share)\nexport {\n ArbiWebSocketProvider,\n useArbiWsContext,\n type ArbiWebSocketProviderProps,\n type ArbiWsHandlers,\n useArbiWebSocket,\n useArbiWsMessage,\n useArbiWsStatus,\n applyLiveUpdate,\n LIVE_UPDATE_TYPES,\n useArbiWsStore,\n DISMISSED_TASK_TTL_MS,\n type LiveTask,\n type ArbiWsState,\n type ArbiWsStatus,\n} from './websocket'\n\n// Schema-typed WebSocket messages + the discriminant type guard (so consumers\n// narrow handlers exactly like the rest of the SDK).\nexport { isMessageType } from '@arbidocs/client'\nexport type {\n WebSocketServerMessage,\n WsTaskUpdateMessage,\n WsBatchCompleteMessage,\n WsPresenceUpdateMessage,\n WsResponseCompleteMessage,\n WsConversationMessagePostedMessage,\n WsNotificationResponse,\n} from '@arbidocs/client'\n\n// Workspaces as the shell and the gallery show them (adapters, active workspace, open)\nexport * from './workspaces'\n\n// React Query hooks\nexport {\n useWorkspaces,\n useDocumentVersionList,\n useThumbnails,\n useParsedDocument,\n useConversations,\n useConversationThreads,\n useMessageDetails,\n useBuiltinCommands,\n useTags,\n useAgents,\n useDeleteAgents,\n useAssistantQuery,\n useHealth,\n useAvailableModels,\n useConfigs,\n useConfig,\n useActivity,\n useWorkspaceActivity,\n useProjects,\n useProjectUsage,\n useProjectInvoices,\n useUserUsageToday,\n useCurrentUser,\n useCanCreateProjects,\n useCanCreateWorkspaces,\n useProjectCreationDenial,\n useBoxRole,\n PROJECT_CREATION_DENIED_REASON,\n} from './hooks'\nexport type { ProjectCreationRefusal } from './hooks'\n// The one query-key factory (and its prefix match): every key the packages and hosts use.\nexport { arbiQueryKeys, arbiMutationKeys, isUnderQueryKey } from './query-keys'\n\n// Workspace facts\nexport {\n useFacts,\n useCreateFact,\n useCreateFacts,\n useUpdateFact,\n useDeleteFact,\n useSearchFacts,\n type FactListFilter,\n} from './facts'\nexport {\n useFactsSearch,\n FACTS_SEARCH_VIEW,\n type FactSearchHit,\n type FactsSearch,\n type FactsSearchState,\n type UseFactsSearchOptions,\n} from './facts-search'\n\n// Work (conversations with a status), workflows, agents, skills (mutations invalidate through arbiQueryKeys)\nexport {\n useUpdateConversation,\n useCreateWork,\n useRunConversation,\n usePlanWork,\n useActOnStep,\n useConversationPendingAuth,\n useWorkflows,\n useWorkflowRuns,\n useCreateWorkflow,\n useInvalidateWorkflows,\n useUpdateWorkflow,\n useDeleteWorkflow,\n useRunWorkflow,\n useCreateAgent,\n useGenerateAgentAvatar,\n useAuthorizeLimits,\n useMcpTools,\n useAgentConfig,\n useAgentModels,\n useSaveAgentConfig,\n useAgentWorkspaces,\n useGrantAgentAccess,\n useRevokeAgentAccess,\n useSkills,\n useSkillSource,\n useDeleteSkill,\n useSaveSkill,\n useSetSkillVisibility,\n useUploadSkillFiles,\n useConversationActivity,\n useConversationItems,\n useConversationIsShared,\n useWorkItems,\n useWorkspaceRole,\n useCanEditShared,\n useIsWorkspaceOwner,\n useStartTaskQuery,\n useDeleteConversation,\n useConversationSearch,\n TaskThreadPendingError,\n isActivityKey,\n invalidateConversationActivity,\n type StartTaskQuery,\n type AgentConfigSections,\n type SaveAgentConfigVars,\n type AgentAccessMode,\n type GrantAgentAccessVars,\n} from './workforce'\n\n// The workspace's conversation list in the cache: its writers (patch, add, remove) and readers\nexport * from './conversation-list'\n\n// Databases: user-defined tables of the open workspace (reads, writes, imports, export)\nexport * from './databases'\n// Saved table views (user settings `tableviews`): a grid's columns, read by charts too\nexport {\n isTableViewOf,\n viewsOfTable,\n type TableView,\n type TableViewTable,\n} from './account/table-views'\n// Datasets: data source adapters (usage, documents, threads, projects, databases) returning one\n// normalized dataset, the chart / panel / dashboard specs, and saved dashboards\nexport * from './datasets'\n\n// Tags: the writes (patching the workspace's list), and kinds' fields (a table's columns)\nexport {\n useCreateTag,\n useIsCreatingTag,\n useUpdateTag,\n useDeleteTag,\n useExtractEntities,\n useTagKindSchema,\n useUpdateTagKindSchema,\n useSetTagValues,\n useInvalidateTagData,\n invalidateTagData,\n invalidateTagTables,\n patchWorkspaceTags,\n type CreateTagInput,\n} from './tags'\n\n// Cited passages' text, read live from their documents' parsed content\nexport {\n usePassageQuotes,\n type PassageResolvers,\n type QuoteResolver,\n type OrderResolver,\n} from './documents/usePassageQuotes'\n\n// The shared React Query client, and the offline cache it may keep on this device (opt in)\nexport {\n createArbiQueryClient,\n type ArbiQueryClient,\n type ArbiQueryClientOptions,\n} from './query-client'\nexport { claimOfflineQueue, type ArbiQueryPersistOptions } from './query-persist'\n// Offline writes kept across a reload (opt in: a host with a persisted query cache)\nexport { registerArbiMutationDefaults, isReplayableArbiMutation } from './offline'\n// Telling \"no connection\" from a server's answer (a request that never reached the server)\nexport { isNetworkFailure } from './offline-store/network'\n\n// Project details, their events, and spend by conversation and step\nexport { useUpdateProjectFields, useProjectConversationUsage } from './projects'\nexport * from './billing'\n// Storage: usage by project, kind and workspace, the largest items, Recently deleted, trash actions\nexport * from './storage'\n\n// Contacts\nexport {\n useContacts,\n useReferralSummary,\n useInviteContacts,\n useCreateContact,\n useUpdateContact,\n useLinkContact,\n useImportContacts,\n useDeleteContact,\n useSearchContacts,\n} from './contacts'\n// The people directory: who an account id or an address is (contacts, workspace members, agents)\nexport {\n peopleDirectory,\n personOfUser,\n usePeople,\n usePeopleSearch,\n type PeopleDirectory,\n type Person,\n type UserResponse,\n} from './people'\n\n// The Word house template a workspace may choose\nexport {\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useSetDeploymentHouseTemplate,\n supportsHouseTemplates,\n workspaceHouseTemplateId,\n isDeploymentAdmin,\n} from './house-template'\n\n// The main agent's model connections (box and personal) and the direct model usage\nexport {\n useModelConnections,\n useDirectModelUsage,\n useSaveModelConnection,\n useRemoveModelConnection,\n useUnlockModelConnections,\n} from './model-connections'\nexport type {\n ConnectionModel,\n DirectModelUsage,\n ModelConnection,\n PersonalConnectionInput,\n} from '@arbidocs/sdk/browser'\n\n// The workspace Assistant: its brief and what it did with each arrival\nexport {\n useAssistantBrief,\n useUpdateAssistantBrief,\n useAssistantArrivals,\n useAssistantStatus,\n useMarkArrivalWrong,\n useMarkMessageDraftSent,\n useInvalidateAssistant,\n} from './workspace-assistant'\nexport type { AssistantArrival, AssistantBrief, AssistantBriefInput } from '@arbidocs/sdk/browser'\n\n// Account and settings: profile, email, password, notification preferences, sessions, deletion\nexport * from './account'\n\n// Mail: the native inbox and connected accounts (client, provider, hooks)\nexport * from './mail'\n\n// Calendar: hooks over arbi.calendar, and the host's offline storage and connector OAuth\nexport * from './calendar'\n// Calls without LiveKit: data, the call session and events, actions, meeting chats, recordings\nexport * from './calls'\n\n// AI usage is reported in \u00A3 (ex VAT): one formatter for every amount\nexport {\n formatGbp,\n formatGbpPerMillionTokens,\n usdToGbp,\n DEFAULT_AI_USD_PER_GBP,\n} from '@arbidocs/sdk/browser'\nexport { isUsageMetered, type UsageTotals } from './usage-metered'\n\n// Re-export key types from core (browser-safe)\nexport { Arbi, type ArbiOptions, type AskRequest, type AskHandlers } from '@arbidocs/sdk/browser'\nexport type {\n ActivityKind,\n ActivityResponse,\n AuthMode,\n ConversationResponse,\n CreateWorkRequest,\n CreateWorkflowRequest,\n PendingAuthResponse,\n PlanWorkRequest,\n TaskPlan,\n UpdateConversationRequest,\n UpdateWorkflowRequest,\n WorkStatus,\n WorkflowAuthMode,\n WorkflowResponse,\n WorkflowRunResponse,\n SkillSummary,\n FactResponse,\n CreateFactRequest,\n FactSearchRequest,\n FactSearchResponse,\n ProjectUsageResponse,\n ProjectInvoicesResponse,\n UserDailyUsageResponse,\n LoginProfile,\n} from '@arbidocs/sdk/browser'\nexport type { SSEStreamResult, SSEStreamCallbacks } from '@arbidocs/sdk/browser'\nexport type {\n ResponseCreatedEvent,\n ResponseCompletedEvent,\n ResponseFailedEvent,\n ResponseOutputTextDeltaEvent,\n ResponseOutputTextDoneEvent,\n ResponseOutputItemAddedEvent,\n ResponseOutputItemDoneEvent,\n ResponseContentPartAddedEvent,\n ResponseUsage,\n OutputTokensDetails,\n AgentStepEvent,\n UserInputRequestEvent,\n ArtifactEvent,\n UserMessageEvent,\n MessageMetadataPayload,\n SSEStreamStartData,\n} from '@arbidocs/sdk/browser'\nexport { ArbiError } from '@arbidocs/sdk/browser'\n\n// \u2500\u2500 UI \"lego\" (promoted from the ARBI app; consumer supplies Tailwind + tokens) \u2500\u2500\n\n// shadcn UI primitives\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './ui/tooltip'\nexport { IconToggle, type IconToggleProps } from './ui/IconToggle'\nexport { VisibilityToggle, type VisibilityToggleProps } from './ui/VisibilityToggle'\nexport { VerifiedToggle } from './ui/VerifiedToggle'\nexport { formatFriendlyDate, formatCompactLastSeen } from './lib/format-friendly-date'\nexport { markdownToPlainText, markdownToPlainTextBlocks } from './lib/markdown-to-text'\nexport { DebouncedInput, type DebouncedInputProps } from './ui/DebouncedInput'\nexport { useDictateContext, type DictateContextValue } from './ui/DictateContext'\nexport { PortalContainerProvider, usePortalContainer } from './ui/portal-container'\nexport { Avatar, AvatarImage, AvatarFallback } from './ui/avatar'\nexport { Badge, badgeVariants, type BadgeProps } from './ui/badge'\nexport { Button, buttonVariants, type ButtonProps } from './ui/button'\nexport { HoverCard, HoverCardTrigger, HoverCardContent } from './ui/hover-card'\nexport {\n Card,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n cardVariants,\n} from './ui/card'\nexport type { CardProps } from './ui/card'\nexport { Input, type InputProps } from './ui/input'\nexport { Label } from './ui/label'\nexport { Separator } from './ui/separator'\nexport { Textarea, type TextareaProps } from './ui/textarea'\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from './ui/collapsible'\nexport { Progress } from './ui/progress'\nexport { ScrollArea, ScrollBar } from './ui/scroll-area'\nexport { RadioGroup, RadioGroupItem } from './ui/radio-group'\nexport { Checkbox } from './ui/checkbox'\nexport { Switch } from './ui/switch'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './ui/tabs'\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from './ui/table'\nexport { Slider } from './ui/slider'\nexport { Toggle, toggleVariants } from './ui/toggle'\nexport { ToggleGroup, ToggleGroupItem } from './ui/toggle-group'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogPresentation,\n} from './ui/dialog'\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverClose } from './ui/popover'\nexport { MarkMenu, type MarkMenuItem, type MarkMenuProps } from './ui/mark-menu'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './ui/dropdown-menu'\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n} from './ui/select'\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from './ui/command'\n\n// \u2500\u2500 AI kit: mid-level, token-neutral building blocks for AI-native apps \u2500\u2500\n// (streaming answers, artifact canvas, redline, doc Q&A)\nexport * from './ai'\n\n// Document search: the one search hook, its session and the label-the-results write.\nexport * from './search'\n\n// File-type icons\nexport * from './icons'\n\n// Decoupled entity pills + canonical entity registry\nexport * from './entities'\n\n// Shared notification & activity presentation layer\nexport * from './notifications'\nexport * from './connectors'\n\n// Direct-message block kit (real E2E-encrypted messenger)\nexport * from './directmessages'\n\n// Image crop kit (frame any uploaded/generated image; avatar is a preset)\nexport * from './imagecrop'\n\n// User menu kit (topbar account avatar dropdown)\nexport * from './usermenu'\n\n// Documents: the list, its writes, uploads, and what a host adds\nexport * from './documents'\n\n// People: display name, initials, avatar colour\nexport * from './users'\n\n// Session state shared by every block (workspace, conversation, viewing document, \u2026)\nexport * from './session'\n\n// Remote control: its session-only consent state and the `remote_control` websocket message\nexport * from './remote-control'\n\n// Class-name helper\nexport { cn } from './lib/utils'\n\nexport {\n useAgentSession,\n useAgentChats,\n useStartAgentSession,\n useCloseAgentSession,\n} from './workforce'\n\n// The documents an entity extraction is running on, until the live connection says it is done\nexport {\n finishEntityExtraction,\n startEntityExtraction,\n useEntityExtractionDocIds,\n} from './entity-extraction'\n\nexport * from './support'\n\n// Heavy components in their own chunk, loaded the first time one renders.\nexport { lazyChunk, lazyComponent, preloadChunks, type LazyChunk } from './lazy-chunk'\n"],
|
|
5
|
+
"mappings": "AAYA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AACP,SAAS,2BAAkD;AAC3D,cAAc;AAId;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAUK;AACP,SAAS,yBAAsD;AAE/D,SAAS,wBAAwB;AAEjC,SAAS,gCAAgC;AACzC,SAAS,uBAAuB;AAEhC,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB,6BAA6B;AAC9D,SAAS,6BAA6B;AACtC,SAAS,8BAAqD;AAC9D,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,SAAS,YAAY,uBAA6C;AAGlE,SAAS,SAAS,2BAA2B;AAC7C,SAAS,sBAAsB,sBAAsB;AACrD;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAMK;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P,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,SAAS,UAAU;AAEnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,cAAc;AAGd,SAAS,WAAW,eAAe,qBAAqC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -85,7 +85,7 @@ function getWorkspaceActionText(type) {
|
|
|
85
85
|
case "workspaceuser_added_collaborator":
|
|
86
86
|
return "added you as collaborator";
|
|
87
87
|
case "workspaceuser_added_guest":
|
|
88
|
-
return "added you as
|
|
88
|
+
return "added you as a viewer";
|
|
89
89
|
case "workspaceuser_removed":
|
|
90
90
|
return "removed you";
|
|
91
91
|
case "workspaceuser_updated_owner":
|
|
@@ -93,7 +93,7 @@ function getWorkspaceActionText(type) {
|
|
|
93
93
|
case "workspaceuser_updated_collaborator":
|
|
94
94
|
return "changed your role to collaborator";
|
|
95
95
|
case "workspaceuser_updated_guest":
|
|
96
|
-
return "changed your role to
|
|
96
|
+
return "changed your role to viewer";
|
|
97
97
|
default:
|
|
98
98
|
return "updated your access";
|
|
99
99
|
}
|
|
@@ -105,7 +105,7 @@ function getWorkspaceSentPhrase(type) {
|
|
|
105
105
|
case "workspaceuser_added_collaborator":
|
|
106
106
|
return { before: "You added", after: "as collaborator" };
|
|
107
107
|
case "workspaceuser_added_guest":
|
|
108
|
-
return { before: "You added", after: "as
|
|
108
|
+
return { before: "You added", after: "as a viewer" };
|
|
109
109
|
case "workspaceuser_removed":
|
|
110
110
|
return { before: "You removed", after: "" };
|
|
111
111
|
case "workspaceuser_updated_owner":
|
|
@@ -113,7 +113,7 @@ function getWorkspaceSentPhrase(type) {
|
|
|
113
113
|
case "workspaceuser_updated_collaborator":
|
|
114
114
|
return { before: "You set", after: "as collaborator" };
|
|
115
115
|
case "workspaceuser_updated_guest":
|
|
116
|
-
return { before: "You set", after: "as
|
|
116
|
+
return { before: "You set", after: "as a viewer" };
|
|
117
117
|
default:
|
|
118
118
|
return { before: "You updated access for", after: "" };
|
|
119
119
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/notifications/notification-types.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Notification-type presentation primitives \u2014 the brand-neutral icon, colour and\n * label maps for every `NotificationType`, plus the workspace-membership phrasing\n * helpers. Kept in their own module (not a component file) so both the monolith's\n * AG-Grid notification centre and lightweight consumers (e.g. clarum's activity\n * feed) share one source of truth for \"what does this notification type mean\",\n * and so component files stay fast-refresh friendly.\n *\n * Deliberately decoupled: no store, no app `@/` imports \u2014 just lucide icon\n * components + semantic Tailwind token class names. Callers render the icon\n * themselves (`<Icon className={iconClassName} />`).\n */\n\nimport {\n Activity,\n AtSign,\n FileText,\n Gauge,\n Gift,\n HardDrive,\n Info,\n MessageCircleMore,\n PartyPopper,\n PenLine,\n Reply,\n UserCheck,\n UserPlus,\n} from 'lucide-react'\nimport { getEntityIcon, type EntityIconComponent } from '../entities/registry'\n\n/** Icon component, its colour class, and a short human label for a notification type. */\nexport interface NotificationTypeMeta {\n Icon: EntityIconComponent\n /** Semantic Tailwind colour class for the glyph. */\n iconClassName: string\n /** Short category label (e.g. \"Added\", \"Usage 90%\"). */\n label: string\n}\n\n/**\n * Resolve the icon + colour + short label for a notification type.\n *\n * Workspace-membership events all share the workspace glyph \u2014 the specific role\n * lives in the Event sentence (see {@link getWorkspaceSentPhrase}), so the label\n * stays short (\"Added\", not \"Added as collaborator\"). Unknown types fall back to\n * an info glyph and the raw type string.\n */\nexport function getNotificationTypeMeta(type: string | null | undefined): NotificationTypeMeta {\n // Resolve the workspace glyph live (not at module load) so a deployment's\n // configureEntityRegistry() injection is always reflected, regardless of import order.\n const WorkspaceIcon = getEntityIcon('WORKSPACE') as EntityIconComponent\n switch (type) {\n case 'support_ticket_received':\n case 'support_ticket_reviewed':\n case 'support_ticket_resolved':\n return { Icon: MessageCircleMore, iconClassName: 'text-primary', label: 'Support' }\n case 'agent_input_requested':\n return { Icon: MessageCircleMore, iconClassName: 'text-primary', label: 'Input needed' }\n case 'workspaceuser_added_owner':\n case 'workspaceuser_added_collaborator':\n case 'workspaceuser_added_guest':\n return { Icon: WorkspaceIcon, iconClassName: 'text-primary', label: 'Added' }\n case 'workspaceuser_removed':\n return { Icon: WorkspaceIcon, iconClassName: 'text-primary', label: 'Removed' }\n case 'workspaceuser_updated_owner':\n case 'workspaceuser_updated_collaborator':\n case 'workspaceuser_updated_guest':\n return { Icon: WorkspaceIcon, iconClassName: 'text-primary', label: 'Role changed' }\n case 'docx_mention':\n case 'mention':\n return { Icon: AtSign, iconClassName: 'text-primary', label: 'Mention' }\n case 'file_shared':\n return { Icon: FileText, iconClassName: 'text-primary', label: 'Shared file' }\n case 'signature_requested':\n return { Icon: PenLine, iconClassName: 'text-primary', label: 'Signature' }\n case 'signature_completed':\n return { Icon: PenLine, iconClassName: 'text-green-600', label: 'Signed' }\n case 'signature_declined':\n return { Icon: PenLine, iconClassName: 'text-orange-500', label: 'Declined' }\n case 'thread_reply':\n return { Icon: Reply, iconClassName: 'text-primary', label: 'Reply' }\n case 'document_activity':\n return { Icon: FileText, iconClassName: 'text-primary', label: 'Document' }\n case 'contact_accepted':\n return { Icon: UserCheck, iconClassName: 'text-green-500', label: 'Invitation' }\n case 'deployment_user_invited':\n case 'deployment_user_registered':\n return { Icon: UserPlus, iconClassName: 'text-primary', label: 'Users' }\n case 'signup_reward':\n return { Icon: PartyPopper, iconClassName: 'text-green-600', label: 'Signup bonus' }\n case 'referral_reward':\n return { Icon: Gift, iconClassName: 'text-green-600', label: 'Reward earned' }\n case 'project_quota_warning':\n return { Icon: Gauge, iconClassName: 'text-orange-500', label: 'Usage warning' }\n case 'project_retention':\n return { Icon: Gauge, iconClassName: 'text-orange-500', label: 'Project retention' }\n case 'quota_threshold_50':\n return { Icon: Gauge, iconClassName: 'text-blue-500', label: 'Usage 50%' }\n case 'quota_threshold_90':\n return { Icon: Gauge, iconClassName: 'text-orange-500', label: 'Usage 90%' }\n case 'quota_threshold_100':\n return { Icon: Gauge, iconClassName: 'text-red-500', label: 'Usage limit' }\n case 'storage_quota_exceeded':\n return { Icon: HardDrive, iconClassName: 'text-red-500', label: 'Storage full' }\n case 'activity':\n // Durable to-self activity line \u2014 the specific event lives in `content`.\n // Callers that have the content should prefer describeActivity() for a\n // precise glyph/label; this is the type-only fallback.\n return { Icon: Activity, iconClassName: 'text-muted-foreground', label: 'Activity' }\n default:\n return { Icon: Info, iconClassName: 'text-blue-500', label: type || 'Notification' }\n }\n}\n\n/** Whether a notification type is a workspace-membership event. */\nexport function isWorkspaceNotificationType(type: string): boolean {\n return type.startsWith('workspaceuser_')\n}\n\n/**\n * Recipient-perspective action text (\"you received\"). Renders after the sender\n * pill: \"[sender] added you as collaborator\". The workspace renders in its own\n * column, so there's no trailing preposition.\n */\nexport function getWorkspaceActionText(type: string): string {\n switch (type) {\n case 'workspaceuser_added_owner':\n return 'added you as owner'\n case 'workspaceuser_added_collaborator':\n return 'added you as collaborator'\n case 'workspaceuser_added_guest':\n return 'added you as
|
|
5
|
-
"mappings": "AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAA+C;AAmBjD,SAAS,wBAAwB,MAAuD;AAG7F,QAAM,gBAAgB,cAAc,WAAW;AAC/C,UAAQ,MAAM;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,EAAE,MAAM,mBAAmB,eAAe,gBAAgB,OAAO,U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-neutral icon, colour and\n * label maps for every `NotificationType`, plus the workspace-membership phrasing\n * helpers. Kept in their own module (not a component file) so both the monolith's\n * AG-Grid notification centre and lightweight consumers (e.g. clarum's activity\n * feed) share one source of truth for \"what does this notification type mean\",\n * and so component files stay fast-refresh friendly.\n *\n * Deliberately decoupled: no store, no app `@/` imports \u2014 just lucide icon\n * components + semantic Tailwind token class names. Callers render the icon\n * themselves (`<Icon className={iconClassName} />`).\n */\n\nimport {\n Activity,\n AtSign,\n FileText,\n Gauge,\n Gift,\n HardDrive,\n Info,\n MessageCircleMore,\n PartyPopper,\n PenLine,\n Reply,\n UserCheck,\n UserPlus,\n} from 'lucide-react'\nimport { getEntityIcon, type EntityIconComponent } from '../entities/registry'\n\n/** Icon component, its colour class, and a short human label for a notification type. */\nexport interface NotificationTypeMeta {\n Icon: EntityIconComponent\n /** Semantic Tailwind colour class for the glyph. */\n iconClassName: string\n /** Short category label (e.g. \"Added\", \"Usage 90%\"). */\n label: string\n}\n\n/**\n * Resolve the icon + colour + short label for a notification type.\n *\n * Workspace-membership events all share the workspace glyph \u2014 the specific role\n * lives in the Event sentence (see {@link getWorkspaceSentPhrase}), so the label\n * stays short (\"Added\", not \"Added as collaborator\"). Unknown types fall back to\n * an info glyph and the raw type string.\n */\nexport function getNotificationTypeMeta(type: string | null | undefined): NotificationTypeMeta {\n // Resolve the workspace glyph live (not at module load) so a deployment's\n // configureEntityRegistry() injection is always reflected, regardless of import order.\n const WorkspaceIcon = getEntityIcon('WORKSPACE') as EntityIconComponent\n switch (type) {\n case 'support_ticket_received':\n case 'support_ticket_reviewed':\n case 'support_ticket_resolved':\n return { Icon: MessageCircleMore, iconClassName: 'text-primary', label: 'Support' }\n case 'agent_input_requested':\n return { Icon: MessageCircleMore, iconClassName: 'text-primary', label: 'Input needed' }\n case 'workspaceuser_added_owner':\n case 'workspaceuser_added_collaborator':\n case 'workspaceuser_added_guest':\n return { Icon: WorkspaceIcon, iconClassName: 'text-primary', label: 'Added' }\n case 'workspaceuser_removed':\n return { Icon: WorkspaceIcon, iconClassName: 'text-primary', label: 'Removed' }\n case 'workspaceuser_updated_owner':\n case 'workspaceuser_updated_collaborator':\n case 'workspaceuser_updated_guest':\n return { Icon: WorkspaceIcon, iconClassName: 'text-primary', label: 'Role changed' }\n case 'docx_mention':\n case 'mention':\n return { Icon: AtSign, iconClassName: 'text-primary', label: 'Mention' }\n case 'file_shared':\n return { Icon: FileText, iconClassName: 'text-primary', label: 'Shared file' }\n case 'signature_requested':\n return { Icon: PenLine, iconClassName: 'text-primary', label: 'Signature' }\n case 'signature_completed':\n return { Icon: PenLine, iconClassName: 'text-green-600', label: 'Signed' }\n case 'signature_declined':\n return { Icon: PenLine, iconClassName: 'text-orange-500', label: 'Declined' }\n case 'thread_reply':\n return { Icon: Reply, iconClassName: 'text-primary', label: 'Reply' }\n case 'document_activity':\n return { Icon: FileText, iconClassName: 'text-primary', label: 'Document' }\n case 'contact_accepted':\n return { Icon: UserCheck, iconClassName: 'text-green-500', label: 'Invitation' }\n case 'deployment_user_invited':\n case 'deployment_user_registered':\n return { Icon: UserPlus, iconClassName: 'text-primary', label: 'Users' }\n case 'signup_reward':\n return { Icon: PartyPopper, iconClassName: 'text-green-600', label: 'Signup bonus' }\n case 'referral_reward':\n return { Icon: Gift, iconClassName: 'text-green-600', label: 'Reward earned' }\n case 'project_quota_warning':\n return { Icon: Gauge, iconClassName: 'text-orange-500', label: 'Usage warning' }\n case 'project_retention':\n return { Icon: Gauge, iconClassName: 'text-orange-500', label: 'Project retention' }\n case 'quota_threshold_50':\n return { Icon: Gauge, iconClassName: 'text-blue-500', label: 'Usage 50%' }\n case 'quota_threshold_90':\n return { Icon: Gauge, iconClassName: 'text-orange-500', label: 'Usage 90%' }\n case 'quota_threshold_100':\n return { Icon: Gauge, iconClassName: 'text-red-500', label: 'Usage limit' }\n case 'storage_quota_exceeded':\n return { Icon: HardDrive, iconClassName: 'text-red-500', label: 'Storage full' }\n case 'activity':\n // Durable to-self activity line \u2014 the specific event lives in `content`.\n // Callers that have the content should prefer describeActivity() for a\n // precise glyph/label; this is the type-only fallback.\n return { Icon: Activity, iconClassName: 'text-muted-foreground', label: 'Activity' }\n default:\n return { Icon: Info, iconClassName: 'text-blue-500', label: type || 'Notification' }\n }\n}\n\n/** Whether a notification type is a workspace-membership event. */\nexport function isWorkspaceNotificationType(type: string): boolean {\n return type.startsWith('workspaceuser_')\n}\n\n/**\n * Recipient-perspective action text (\"you received\"). Renders after the sender\n * pill: \"[sender] added you as collaborator\". The workspace renders in its own\n * column, so there's no trailing preposition.\n */\nexport function getWorkspaceActionText(type: string): string {\n switch (type) {\n case 'workspaceuser_added_owner':\n return 'added you as owner'\n case 'workspaceuser_added_collaborator':\n return 'added you as collaborator'\n case 'workspaceuser_added_guest':\n return 'added you as a viewer'\n case 'workspaceuser_removed':\n return 'removed you'\n case 'workspaceuser_updated_owner':\n return 'changed your role to owner'\n case 'workspaceuser_updated_collaborator':\n return 'changed your role to collaborator'\n case 'workspaceuser_updated_guest':\n return 'changed your role to viewer'\n default:\n return 'updated your access'\n }\n}\n\n/**\n * Sender-perspective phrasing (\"you did this\"). Renders around the affected\n * member pill \u2014 `{before} [member] {after}` \u2014 so it reads as an active sentence:\n * \"You added [Jane] as collaborator\" rather than the ambiguous \"Added as\n * collaborator: Jane\".\n */\nexport function getWorkspaceSentPhrase(type: string): { before: string; after: string } {\n switch (type) {\n case 'workspaceuser_added_owner':\n return { before: 'You added', after: 'as owner' }\n case 'workspaceuser_added_collaborator':\n return { before: 'You added', after: 'as collaborator' }\n case 'workspaceuser_added_guest':\n return { before: 'You added', after: 'as a viewer' }\n case 'workspaceuser_removed':\n return { before: 'You removed', after: '' }\n case 'workspaceuser_updated_owner':\n return { before: 'You set', after: 'as owner' }\n case 'workspaceuser_updated_collaborator':\n return { before: 'You set', after: 'as collaborator' }\n case 'workspaceuser_updated_guest':\n return { before: 'You set', after: 'as a viewer' }\n default:\n return { before: 'You updated access for', after: '' }\n }\n}\n"],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AAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAQO,SAAS,uBAAuB,MAAiD;AACtF,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO,EAAE,QAAQ,aAAa,OAAO,WAAW;AAAA,IAClD,KAAK;AACH,aAAO,EAAE,QAAQ,aAAa,OAAO,kBAAkB;AAAA,IACzD,KAAK;AACH,aAAO,EAAE,QAAQ,aAAa,OAAO,cAAc;AAAA,IACrD,KAAK;AACH,aAAO,EAAE,QAAQ,eAAe,OAAO,GAAG;AAAA,IAC5C,KAAK;AACH,aAAO,EAAE,QAAQ,WAAW,OAAO,WAAW;AAAA,IAChD,KAAK;AACH,aAAO,EAAE,QAAQ,WAAW,OAAO,kBAAkB;AAAA,IACvD,KAAK;AACH,aAAO,EAAE,QAAQ,WAAW,OAAO,cAAc;AAAA,IACnD;AACE,aAAO,EAAE,QAAQ,0BAA0B,OAAO,GAAG;AAAA,EACzD;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -231,7 +231,7 @@ function describeServerNotification(n, options = {}) {
|
|
|
231
231
|
target: workspace
|
|
232
232
|
};
|
|
233
233
|
case "workspaceuser_added_guest":
|
|
234
|
-
return { title: `${senderName} added you as
|
|
234
|
+
return { title: `${senderName} added you as a viewer`, variant: "info", target: workspace };
|
|
235
235
|
case "workspaceuser_removed":
|
|
236
236
|
return { title: `${senderName} removed you from a workspace`, variant: "warning" };
|
|
237
237
|
case "workspaceuser_updated_owner":
|
|
@@ -248,7 +248,7 @@ function describeServerNotification(n, options = {}) {
|
|
|
248
248
|
};
|
|
249
249
|
case "workspaceuser_updated_guest":
|
|
250
250
|
return {
|
|
251
|
-
title: `${senderName} changed your role to
|
|
251
|
+
title: `${senderName} changed your role to viewer`,
|
|
252
252
|
variant: "info",
|
|
253
253
|
target: workspace
|
|
254
254
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/notifications/server-notifications.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * What a server-persisted notification (`NotificationResponse`) says and where it leads \u2014 the one\n * type\u2192presentation mapping every surface reads (the arrival toast, the bell entry, the\n * notification centre), so wording cannot drift between them or between hosts.\n *\n * Titles derive from `type`, the sender and plaintext routing metadata only: the E2E-encrypted\n * content is never needed. Where an entry leads is data ({@link NotificationTarget}); the host\n * owns navigation and turns a target into its own route.\n */\n\nimport type { components } from '@arbidocs/client'\nimport { mailDraftIdFromContent } from '../mail/client'\nimport type { NotifyVariant } from './notify-store'\n\ntype NotificationResponse = components['schemas']['NotificationResponse']\ntype NotificationUser = NotificationResponse['sender']\n\n/** Where a notification leads. The host maps each kind onto its routes. */\nexport type NotificationTarget =\n /** A workspace's own page (a membership change). */\n | { kind: 'workspace'; workspaceId: string }\n /** A thread, scrolled to a message when given. */\n | { kind: 'conversation'; workspaceId?: string; conversationId: string; messageId?: string }\n /** A document: at a version, on a comment, or on a viewer tab when given. */\n | {\n kind: 'document'\n workspaceId?: string\n documentId: string\n version?: number\n commentId?: string\n tab?: 'pdf'\n }\n /** The mailbox, on a draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The workflows page, on a workflow (in its workspace) when given. */\n | { kind: 'workflows'; workflowId?: string; workspaceId?: string }\n /** Projects and their AI usage. */\n | { kind: 'projects' }\n | { kind: 'support'; ticketId: number }\n /** Storage settings. */\n | { kind: 'storage' }\n /** Where seats are added (the Box's licence page). */\n | { kind: 'seats' }\n /** Review a workspace access request (choose a workspace and a role). */\n | { kind: 'access-request'; notification: NotificationResponse }\n /** Call the sender back. */\n | { kind: 'call-back'; user: NotificationUser }\n /** An external page, opened in a new tab. */\n | { kind: 'url'; url: string }\n /** The calendar, on an event when given; `join`: join the event's online meeting. */\n | { kind: 'calendar'; eventId?: string; recurrenceId?: string | null; join?: boolean }\n\n/** A server notification's presentation: its sentence, severity, and where it leads. */\nexport interface ServerNotificationDescription {\n title: string\n variant: NotifyVariant\n /** The label of the action that opens {@link target} (\"Review and sign\"); default \"View\". */\n actionLabel?: string\n target?: NotificationTarget\n}\n\nexport interface DescribeServerNotificationOptions {\n /** The sender's display name; default their given and family name, else their email. */\n senderName?: string\n /** The name of a document the notification is about, when the host knows it (names are\n * encrypted, so a notification carries only the id). */\n documentName?: (workspaceId: string | null | undefined, documentId: string) => string | undefined\n /** The portal origins a deployment-user notice may link to. */\n portalOrigins?: readonly string[]\n}\n\n/** A person's display name: given and family name, else their email. */\nexport function notificationUserName(user: NotificationUser): string {\n return [user.given_name, user.family_name].filter(Boolean).join(' ') || user.email\n}\n\nconst CONVERSATION_ID = /^con-[a-zA-Z0-9]+$/\nconst WORKFLOW_ID = /^wfl-[a-zA-Z0-9]+$/\nconst DOCUMENT_ID = /^doc-[a-zA-Z0-9]+$/\n\nfunction parse(content: string | null | undefined): Record<string, unknown> | null {\n try {\n const value = JSON.parse(content || '{}') as unknown\n return value && typeof value === 'object' ? (value as Record<string, unknown>) : null\n } catch {\n return null\n }\n}\n\n/** Deadline metadata is intentionally plaintext; the confidential question stays in the thread. */\nexport function inputRequestTitle(content: string | null | undefined): string {\n const metadata = parse(content)\n if (!metadata) return 'ARBI needs your input \u2014 open the thread to reply'\n const timeout = typeof metadata.timeout_seconds === 'number' ? metadata.timeout_seconds : 300\n const minutes = Math.ceil(timeout / 60)\n const deadline = typeof metadata.expires_at === 'string' ? new Date(metadata.expires_at) : null\n if (deadline && Number.isFinite(deadline.getTime())) {\n return `ARBI needs your input \u2014 ${minutes} min to reply (until ${deadline.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })})`\n }\n return `ARBI needs your input \u2014 ${minutes} min to reply`\n}\n\n/**\n * The plaintext routing content of a `document_activity` notification: `{doc_ext_id, event,\n * reason, version}`. Opaque ids and a closed vocabulary only; never the file name.\n */\nexport function documentActivityMeta(content: string | null | undefined): {\n documentId?: string\n reason?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.doc_ext_id === 'string' && DOCUMENT_ID.test(meta.doc_ext_id)\n ? meta.doc_ext_id\n : undefined\n const version =\n typeof meta.version === 'number' && Number.isInteger(meta.version) && meta.version > 0\n ? meta.version\n : undefined\n const reason = typeof meta.reason === 'string' ? meta.reason : undefined\n return { documentId, reason, version }\n}\n\n/** What a `document_activity` says after its sender: \"signed a document\", \"saved version 3 of a document\". */\nexport function documentActivityPhrase(content: string | null | undefined): string {\n const { reason, version } = documentActivityMeta(content)\n if (reason === 'signed') return 'signed a document'\n return version ? `saved version ${version} of a document` : 'saved a new version of a document'\n}\n\n/** The document and comment a `docx_mention` points at (routing ids only). */\nexport function docxMentionMeta(content: string | null | undefined): {\n documentId?: string\n commentId?: string\n} {\n const meta = parse(content)\n if (!meta || typeof meta.document_id !== 'string' || !DOCUMENT_ID.test(meta.document_id))\n return {}\n return {\n documentId: meta.document_id,\n commentId: typeof meta.comment_id === 'string' && meta.comment_id ? meta.comment_id : undefined,\n }\n}\n\n/**\n * The plaintext routing content of a signature-request notification: `{request_id, document_id,\n * signed_version?}`. Opaque ids only: the document's name is encrypted, so it is never in a\n * notification.\n */\nexport function signatureRequestMeta(content: string | null | undefined): {\n documentId?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.document_id === 'string' && DOCUMENT_ID.test(meta.document_id)\n ? meta.document_id\n : undefined\n const version =\n typeof meta.signed_version === 'number' && Number.isInteger(meta.signed_version)\n ? meta.signed_version\n : undefined\n return { documentId, version }\n}\n\n/** The notification types of a signature request. */\nexport const SIGNATURE_NOTIFICATION_TYPES = [\n 'signature_requested',\n 'signature_completed',\n 'signature_declined',\n] as const\nexport type SignatureNotificationType = (typeof SIGNATURE_NOTIFICATION_TYPES)[number]\n\nexport function isSignatureNotificationType(\n type: string | null | undefined\n): type is SignatureNotificationType {\n return (SIGNATURE_NOTIFICATION_TYPES as readonly string[]).includes(type ?? '')\n}\n\n/**\n * What a signature notification says, around the person's name and the document's:\n * `{lead} [person] {verb} [document]{tail}`. The recipient reads it about the sender\n * (\"Priya Shah asked you to sign NDA.pdf\"); the sender, in their own activity, about what they did\n * (\"You asked Sam Lee to sign NDA.pdf\"), with the person left out when the sentence needs none.\n */\nexport function signatureNotificationPhrase(\n type: SignatureNotificationType,\n incoming: boolean\n): { lead: string; showPerson: boolean; verb: string; tail: string } {\n if (incoming) {\n switch (type) {\n case 'signature_requested':\n return { lead: '', showPerson: true, verb: 'asked you to sign', tail: '' }\n case 'signature_completed':\n return { lead: '', showPerson: true, verb: 'signed', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: '', showPerson: true, verb: 'declined to sign', tail: '' }\n }\n }\n switch (type) {\n case 'signature_requested':\n return { lead: 'You asked', showPerson: true, verb: 'to sign', tail: '' }\n case 'signature_completed':\n return { lead: 'You signed', showPerson: false, verb: '', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: 'You declined to sign', showPerson: false, verb: '', tail: '' }\n }\n}\n\n/**\n * Plaintext routing metadata on call notifications (`call_missed`): `{call_ext_id}`. Never a\n * title \u2014 titles are encrypted under the call's key.\n */\nexport function callNotificationMeta(content: string | null | undefined): { callExtId?: string } {\n const meta = parse(content)\n return {\n callExtId:\n typeof meta?.call_ext_id === 'string' && /^call-[a-zA-Z0-9]{8}$/.test(meta.call_ext_id)\n ? meta.call_ext_id\n : undefined,\n }\n}\n\n/** A Box had no seat for a new internal user: the inviter's invitation was not sent. Central\n * emails the inviter and the Box admins; this is the inviter's own notice. */\nexport const BOX_SEAT_REFUSED = 'box_seat_refused'\nexport const BOX_SEAT_REFUSED_TITLE =\n 'Invitation not sent: your Box has no seat left. Your Box admins have been notified and can add users in the ARBI portal.'\nexport const BOX_SEAT_REFUSED_ACTION = 'Open the ARBI portal'\n\n/** A deployment admin's notice about the Box's users (`deployment_user_invited` / `_registered`):\n * an invitation sent (sender = the inviter) or an account created (sender = the new user). */\nexport function isDeploymentUserNotification(type: string | null | undefined): boolean {\n return type === 'deployment_user_invited' || type === 'deployment_user_registered'\n}\n\n/** The portal origins a \"Manage users\" link may open by default. Anything else gets no button. */\nexport const ALLOWED_PORTAL_ORIGINS: readonly string[] = ['https://portal.arbicity.com']\n\n/** The portal link, only when it is https on an allowed portal origin. */\nexport function safePortalUrl(\n value: unknown,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): string | undefined {\n if (typeof value !== 'string') return undefined\n try {\n const url = new URL(value)\n if (url.protocol !== 'https:' || !origins.includes(url.origin)) return undefined\n return url.href\n } catch {\n return undefined\n }\n}\n\n/** Plaintext content of a deployment-user notification: `{email, user_type, portal_url}`. */\nexport function deploymentUserMeta(\n content: string | null | undefined,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): { email?: string; external: boolean; portalUrl?: string } {\n const meta = parse(content)\n if (!meta) return { external: false }\n const email = typeof meta.email === 'string' && meta.email.trim() ? meta.email.trim() : undefined\n return {\n email,\n external: meta.user_type === 'external',\n portalUrl: safePortalUrl(meta.portal_url, origins),\n }\n}\n\n/** A document's display name, as a document list shows it (its title, else its file name). */\nexport function documentDisplayName(\n doc:\n | { file_name?: string | null; doc_metadata?: { title?: string | null } | null }\n | null\n | undefined\n): string | undefined {\n return doc?.doc_metadata?.title || doc?.file_name || undefined\n}\n\n/** What the work notifications say in a list, where the sender has a column of their own. */\nexport const WORK_NOTIFICATION_LABELS: Readonly<Record<string, string>> = {\n conversation_ready: 'A task is ready',\n conversation_done: 'A task was marked done',\n conversation_notified: 'You were notified in a thread',\n workflow_failed: 'A workflow failed to run',\n}\n\nfunction conversationTarget(n: NotificationResponse): NotificationTarget | undefined {\n if (!n.conversation_ext_id || !CONVERSATION_ID.test(n.conversation_ext_id)) return undefined\n return {\n kind: 'conversation',\n workspaceId: n.workspace_ext_id ?? undefined,\n conversationId: n.conversation_ext_id,\n ...(n.message_ext_id ? { messageId: n.message_ext_id } : {}),\n }\n}\n\n/** The workflows page on the notification's workflow (`{workflow_ext_id}` in its content). */\nfunction workflowTarget(n: NotificationResponse): NotificationTarget {\n const workflowId = parse(n.content)?.workflow_ext_id\n return {\n kind: 'workflows',\n ...(typeof workflowId === 'string' && WORKFLOW_ID.test(workflowId) ? { workflowId } : {}),\n ...(n.workspace_ext_id ? { workspaceId: n.workspace_ext_id } : {}),\n }\n}\n\nfunction signatureTitle(\n n: NotificationResponse,\n senderName: string,\n documentName: DescribeServerNotificationOptions['documentName']\n): string {\n const type = n.type as SignatureNotificationType\n const { documentId } = signatureRequestMeta(n.content)\n const name = documentId ? documentName?.(n.workspace_ext_id, documentId) : undefined\n const fallback = type === 'signature_requested' ? 'a document' : 'your document'\n const { verb, tail } = signatureNotificationPhrase(type, true)\n return `${senderName} ${verb} ${name ?? fallback}${tail}`\n}\n\nfunction quotaPercent(type: string): number | null {\n if (type === 'quota_threshold_100') return 100\n if (type === 'quota_threshold_90') return 90\n if (type === 'quota_threshold_50') return 50\n return null\n}\n\n/**\n * One server notification \u2192 what it says to its recipient and where it leads, or null for\n * types without a sentence here (calendar events, sync completions: they have their own\n * surfaces).\n */\nexport function describeServerNotification(\n n: NotificationResponse,\n options: DescribeServerNotificationOptions = {}\n): ServerNotificationDescription | null {\n const senderName = options.senderName ?? notificationUserName(n.sender)\n const workspace: NotificationTarget | undefined = n.workspace_ext_id\n ? { kind: 'workspace', workspaceId: n.workspace_ext_id }\n : undefined\n const type = n.type as string\n\n if (type === BOX_SEAT_REFUSED) {\n return {\n title: BOX_SEAT_REFUSED_TITLE,\n variant: 'warning',\n actionLabel: BOX_SEAT_REFUSED_ACTION,\n target: { kind: 'seats' },\n }\n }\n const pct = quotaPercent(type)\n if (pct !== null) {\n return {\n title: `You have used ${pct}% of your daily AI limit for this project.`,\n variant: pct === 100 ? 'error' : pct === 90 ? 'warning' : 'info',\n target: { kind: 'projects' },\n }\n }\n\n switch (type) {\n case 'support_ticket_received':\n case 'support_ticket_reviewed':\n case 'support_ticket_resolved': {\n const ticketId = parse(n.content)?.ticket_id\n if (typeof ticketId !== 'number' || !Number.isSafeInteger(ticketId) || ticketId < 1)\n return null\n const suppliedReference = parse(n.content)?.ticket_reference\n const reference =\n typeof suppliedReference === 'string' &&\n /^[a-z0-9-]+-[0-9]+$/.test(suppliedReference) &&\n suppliedReference.endsWith(`-${ticketId}`)\n ? suppliedReference\n : `#${ticketId}`\n return {\n title:\n type === 'support_ticket_received'\n ? `We received support request ${reference}`\n : type === 'support_ticket_reviewed'\n ? `We have reviewed support request ${reference}`\n : `Support request ${reference} is resolved`,\n variant: 'success',\n actionLabel: type === 'support_ticket_resolved' ? 'View outcome' : 'View request',\n target: { kind: 'support', ticketId },\n }\n }\n case 'file_shared': {\n const meta = parse(n.content)\n const id = meta?.file_share_id\n if (typeof id !== 'string' || !/^fsh-[0-9a-f]{32}$/.test(id)) return null\n return {\n title: meta?.declined\n ? `${senderName} declined to sign a file`\n : meta?.completed\n ? 'Everyone has signed. Your PDF is ready.'\n : meta?.signature\n ? `${senderName} asked you to sign a file`\n : `${senderName} shared a file with you`,\n variant: meta?.declined ? 'warning' : meta?.completed ? 'success' : 'info',\n actionLabel: meta?.signature && !meta?.completed ? 'Review and sign' : 'Open file',\n target: { kind: 'url', url: `/shared-files/${id}` },\n }\n }\n case 'call_missed':\n return {\n title: `Missed call from ${senderName}`,\n variant: 'warning',\n actionLabel: 'Call back',\n target: { kind: 'call-back', user: n.sender },\n }\n case 'native_mail_received':\n return {\n title: 'New email in your encrypted inbox',\n variant: 'info',\n target: { kind: 'mail' },\n }\n case 'mail_draft_ready': {\n const draftId = mailDraftIdFromContent(n.content)\n return {\n title: `${senderName} left a draft email for you to review`,\n variant: 'info',\n target: { kind: 'mail', ...(draftId ? { draftId } : {}) },\n }\n }\n case 'workspaceuser_added_owner':\n return { title: `${senderName} added you as owner`, variant: 'info', target: workspace }\n case 'workspaceuser_added_collaborator':\n return {\n title: `${senderName} added you as collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_added_guest':\n return { title: `${senderName} added you as read only`, variant: 'info', target: workspace }\n case 'workspaceuser_removed':\n return { title: `${senderName} removed you from a workspace`, variant: 'warning' }\n case 'workspaceuser_updated_owner':\n return {\n title: `${senderName} changed your role to owner`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_collaborator':\n return {\n title: `${senderName} changed your role to collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_guest':\n return {\n title: `${senderName} changed your role to read only`,\n variant: 'info',\n target: workspace,\n }\n case 'signature_requested':\n case 'signature_completed':\n case 'signature_declined': {\n const { documentId, version } = signatureRequestMeta(n.content)\n return {\n title: signatureTitle(n, senderName, options.documentName),\n variant:\n type === 'signature_completed'\n ? 'success'\n : type === 'signature_declined'\n ? 'warning'\n : 'info',\n actionLabel: type === 'signature_requested' ? 'Review and sign' : 'Open',\n // A request opens the current version on its PDF, where the banner offers \"Review and\n // sign\"; a completed request opens the signed copy.\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n tab: 'pdf',\n }\n : undefined,\n }\n }\n case 'docx_mention': {\n const { documentId, commentId } = docxMentionMeta(n.content)\n return {\n title: `${senderName} mentioned you in a document comment`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(commentId ? { commentId } : {}),\n }\n : undefined,\n }\n }\n case 'agent_input_requested':\n return { title: inputRequestTitle(n.content), variant: 'info', target: conversationTarget(n) }\n case 'mention':\n return {\n title: `${senderName} mentioned you in a conversation`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'thread_reply':\n return {\n title: `${senderName} replied in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'document_activity': {\n const { documentId, version } = documentActivityMeta(n.content)\n return {\n title: `${senderName} ${documentActivityPhrase(n.content)}`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n }\n : undefined,\n }\n }\n // Each of these opens the thread, so the person it is for finds it. One about your own thread\n // (you started the work) says so.\n case 'conversation_ready':\n return {\n title:\n n.sender.external_id === n.recipient.external_id\n ? 'Your thread is ready'\n : `${senderName}\u2019s thread is ready`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_notified':\n return {\n title: `${senderName} notified you in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_done':\n return {\n title: `${senderName} marked a thread done`,\n variant: 'success',\n target: conversationTarget(n),\n }\n case 'workflow_completed':\n return { title: 'A workflow completed', variant: 'success', target: workflowTarget(n) }\n // The failed run's thread when it has one (its error is there), else the workflow.\n case 'workflow_failed':\n return {\n title: 'A workflow failed to start',\n variant: 'error',\n target: conversationTarget(n) ?? workflowTarget(n),\n }\n case 'deployment_user_invited':\n case 'deployment_user_registered': {\n const { email, external, portalUrl } = deploymentUserMeta(n.content, options.portalOrigins)\n const suffix = external ? ' \u00B7 External' : ''\n return {\n title:\n type === 'deployment_user_invited'\n ? `${senderName} invited ${email ?? 'a new user'}${suffix}`\n : `${email ?? senderName} joined${suffix}`,\n variant: 'info',\n ...(portalUrl && {\n actionLabel: 'Manage users',\n target: { kind: 'url' as const, url: portalUrl },\n }),\n }\n }\n case 'contact_accepted':\n return { title: `${senderName} joined the platform`, variant: 'success', target: workspace }\n case 'workspace_access_request':\n return {\n title: `${senderName} asked for workspace access`,\n variant: 'info',\n // Straight into the review \u2014 granting needs a workspace choice and a role, so a bare\n // \"grant\" action could never be right here.\n target: { kind: 'access-request', notification: n },\n }\n case 'project_quota_warning': {\n let resource = 'usage'\n let percentage: number | null = null\n let upgrade = ''\n let impending = false\n try {\n const data = JSON.parse(n.content ?? '{}')\n resource = data.resource === 'storage_gb' ? 'storage' : 'AI credits'\n if (data.limit > 0) percentage = Math.round((data.used / data.limit) * 100)\n if (data.stage === 'before_upgrade') {\n impending = true\n const charge = new Intl.NumberFormat('en-GB', {\n style: 'currency',\n currency: data.currency || 'GBP',\n }).format(data.charge_ex_vat_pence / 100)\n upgrade = `An automatic ${resource} upgrade will now be attempted: ${charge} ex VAT.`\n } else if (data.automatic_upgrade === true) {\n upgrade =\n ' An automatic upgrade is available within your limit and will be attempted when needed, subject to payment.'\n } else if (data.automatic_upgrade === false) {\n upgrade =\n data.upgrade_reason === 'limit'\n ? ' No automatic upgrade fits your remaining limit. Increase it or add allowances to keep working.'\n : data.upgrade_reason === 'payment'\n ? ' Automatic upgrades are paused. Resolve your payment issue to keep working.'\n : ' Automatic upgrades are unavailable. Upgrade your plan or reduce usage to keep working.'\n }\n } catch {\n /* An old or malformed notice still opens project usage. */\n }\n return {\n title: impending\n ? upgrade\n : `Your project is approaching its ${resource} limit${percentage != null ? ` (${percentage}% used)` : ''}.${upgrade}`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'project_retention': {\n let deadline = ''\n try {\n const data = JSON.parse(n.content ?? '{}')\n if (data.deletion_at) deadline = new Date(data.deletion_at).toLocaleDateString('en-GB')\n } catch {\n /* display the recovery notice without a date */\n }\n return {\n title: `Your project subscription has ended. Export or resubscribe${deadline ? ` before ${deadline}` : ''} to keep its data.`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'storage_quota_exceeded':\n return {\n title:\n 'Your storage is full. Mail still arrives, but new uploads and attachments are paused until you free space or add storage.',\n variant: 'error',\n target: { kind: 'storage' },\n }\n case 'signup_reward':\n return {\n title: n.content ? `\uD83C\uDF89 Signup bonus \u2014 ${n.content}` : '\uD83C\uDF89 You earned a signup bonus!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n case 'referral_reward':\n return {\n title: n.content ? `\uD83C\uDF81 Reward \u2014 ${n.content}` : '\uD83C\uDF81 You earned a reward!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n default:\n return null\n }\n}\n"],
|
|
5
|
-
"mappings": "AAWA,SAAS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AAQ;AAAA,MAER;AACA,aAAO;AAAA,QACL,OAAO,YACH,UACA,mCAAmC,QAAQ,SAAS,cAAc,OAAO,KAAK,UAAU,YAAY,EAAE,IAAI,OAAO;AAAA,QACrH,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,KAAK,qBAAqB;AACxB,UAAI,WAAW;AACf,UAAI;AACF,cAAM,OAAO,KAAK,MAAM,EAAE,WAAW,IAAI;AACzC,YAAI,KAAK,YAAa,YAAW,IAAI,KAAK,KAAK,WAAW,EAAE,mBAAmB,OAAO;AAAA,MACxF,QAAQ;AAAA,MAER;AACA,aAAO;AAAA,QACL,OAAO,6DAA6D,WAAW,WAAW,QAAQ,KAAK,EAAE;AAAA,QACzG,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,KAAK;AACH,aAAO;AAAA,QACL,OACE;AAAA,QACF,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,UAAU;AAAA,MAC5B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,iCAAqB,EAAE,OAAO,KAAK;AAAA,QACtD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,2BAAe,EAAE,OAAO,KAAK;AAAA,QAChD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AACE,aAAO;AAAA,EACX;AACF;",
|
|
4
|
+
"sourcesContent": ["/**\n * What a server-persisted notification (`NotificationResponse`) says and where it leads \u2014 the one\n * type\u2192presentation mapping every surface reads (the arrival toast, the bell entry, the\n * notification centre), so wording cannot drift between them or between hosts.\n *\n * Titles derive from `type`, the sender and plaintext routing metadata only: the E2E-encrypted\n * content is never needed. Where an entry leads is data ({@link NotificationTarget}); the host\n * owns navigation and turns a target into its own route.\n */\n\nimport type { components } from '@arbidocs/client'\nimport { mailDraftIdFromContent } from '../mail/client'\nimport type { NotifyVariant } from './notify-store'\n\ntype NotificationResponse = components['schemas']['NotificationResponse']\ntype NotificationUser = NotificationResponse['sender']\n\n/** Where a notification leads. The host maps each kind onto its routes. */\nexport type NotificationTarget =\n /** A workspace's own page (a membership change). */\n | { kind: 'workspace'; workspaceId: string }\n /** A thread, scrolled to a message when given. */\n | { kind: 'conversation'; workspaceId?: string; conversationId: string; messageId?: string }\n /** A document: at a version, on a comment, or on a viewer tab when given. */\n | {\n kind: 'document'\n workspaceId?: string\n documentId: string\n version?: number\n commentId?: string\n tab?: 'pdf'\n }\n /** The mailbox, on a draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The workflows page, on a workflow (in its workspace) when given. */\n | { kind: 'workflows'; workflowId?: string; workspaceId?: string }\n /** Projects and their AI usage. */\n | { kind: 'projects' }\n | { kind: 'support'; ticketId: number }\n /** Storage settings. */\n | { kind: 'storage' }\n /** Where seats are added (the Box's licence page). */\n | { kind: 'seats' }\n /** Review a workspace access request (choose a workspace and a role). */\n | { kind: 'access-request'; notification: NotificationResponse }\n /** Call the sender back. */\n | { kind: 'call-back'; user: NotificationUser }\n /** An external page, opened in a new tab. */\n | { kind: 'url'; url: string }\n /** The calendar, on an event when given; `join`: join the event's online meeting. */\n | { kind: 'calendar'; eventId?: string; recurrenceId?: string | null; join?: boolean }\n\n/** A server notification's presentation: its sentence, severity, and where it leads. */\nexport interface ServerNotificationDescription {\n title: string\n variant: NotifyVariant\n /** The label of the action that opens {@link target} (\"Review and sign\"); default \"View\". */\n actionLabel?: string\n target?: NotificationTarget\n}\n\nexport interface DescribeServerNotificationOptions {\n /** The sender's display name; default their given and family name, else their email. */\n senderName?: string\n /** The name of a document the notification is about, when the host knows it (names are\n * encrypted, so a notification carries only the id). */\n documentName?: (workspaceId: string | null | undefined, documentId: string) => string | undefined\n /** The portal origins a deployment-user notice may link to. */\n portalOrigins?: readonly string[]\n}\n\n/** A person's display name: given and family name, else their email. */\nexport function notificationUserName(user: NotificationUser): string {\n return [user.given_name, user.family_name].filter(Boolean).join(' ') || user.email\n}\n\nconst CONVERSATION_ID = /^con-[a-zA-Z0-9]+$/\nconst WORKFLOW_ID = /^wfl-[a-zA-Z0-9]+$/\nconst DOCUMENT_ID = /^doc-[a-zA-Z0-9]+$/\n\nfunction parse(content: string | null | undefined): Record<string, unknown> | null {\n try {\n const value = JSON.parse(content || '{}') as unknown\n return value && typeof value === 'object' ? (value as Record<string, unknown>) : null\n } catch {\n return null\n }\n}\n\n/** Deadline metadata is intentionally plaintext; the confidential question stays in the thread. */\nexport function inputRequestTitle(content: string | null | undefined): string {\n const metadata = parse(content)\n if (!metadata) return 'ARBI needs your input \u2014 open the thread to reply'\n const timeout = typeof metadata.timeout_seconds === 'number' ? metadata.timeout_seconds : 300\n const minutes = Math.ceil(timeout / 60)\n const deadline = typeof metadata.expires_at === 'string' ? new Date(metadata.expires_at) : null\n if (deadline && Number.isFinite(deadline.getTime())) {\n return `ARBI needs your input \u2014 ${minutes} min to reply (until ${deadline.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })})`\n }\n return `ARBI needs your input \u2014 ${minutes} min to reply`\n}\n\n/**\n * The plaintext routing content of a `document_activity` notification: `{doc_ext_id, event,\n * reason, version}`. Opaque ids and a closed vocabulary only; never the file name.\n */\nexport function documentActivityMeta(content: string | null | undefined): {\n documentId?: string\n reason?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.doc_ext_id === 'string' && DOCUMENT_ID.test(meta.doc_ext_id)\n ? meta.doc_ext_id\n : undefined\n const version =\n typeof meta.version === 'number' && Number.isInteger(meta.version) && meta.version > 0\n ? meta.version\n : undefined\n const reason = typeof meta.reason === 'string' ? meta.reason : undefined\n return { documentId, reason, version }\n}\n\n/** What a `document_activity` says after its sender: \"signed a document\", \"saved version 3 of a document\". */\nexport function documentActivityPhrase(content: string | null | undefined): string {\n const { reason, version } = documentActivityMeta(content)\n if (reason === 'signed') return 'signed a document'\n return version ? `saved version ${version} of a document` : 'saved a new version of a document'\n}\n\n/** The document and comment a `docx_mention` points at (routing ids only). */\nexport function docxMentionMeta(content: string | null | undefined): {\n documentId?: string\n commentId?: string\n} {\n const meta = parse(content)\n if (!meta || typeof meta.document_id !== 'string' || !DOCUMENT_ID.test(meta.document_id))\n return {}\n return {\n documentId: meta.document_id,\n commentId: typeof meta.comment_id === 'string' && meta.comment_id ? meta.comment_id : undefined,\n }\n}\n\n/**\n * The plaintext routing content of a signature-request notification: `{request_id, document_id,\n * signed_version?}`. Opaque ids only: the document's name is encrypted, so it is never in a\n * notification.\n */\nexport function signatureRequestMeta(content: string | null | undefined): {\n documentId?: string\n version?: number\n} {\n const meta = parse(content)\n if (!meta) return {}\n const documentId =\n typeof meta.document_id === 'string' && DOCUMENT_ID.test(meta.document_id)\n ? meta.document_id\n : undefined\n const version =\n typeof meta.signed_version === 'number' && Number.isInteger(meta.signed_version)\n ? meta.signed_version\n : undefined\n return { documentId, version }\n}\n\n/** The notification types of a signature request. */\nexport const SIGNATURE_NOTIFICATION_TYPES = [\n 'signature_requested',\n 'signature_completed',\n 'signature_declined',\n] as const\nexport type SignatureNotificationType = (typeof SIGNATURE_NOTIFICATION_TYPES)[number]\n\nexport function isSignatureNotificationType(\n type: string | null | undefined\n): type is SignatureNotificationType {\n return (SIGNATURE_NOTIFICATION_TYPES as readonly string[]).includes(type ?? '')\n}\n\n/**\n * What a signature notification says, around the person's name and the document's:\n * `{lead} [person] {verb} [document]{tail}`. The recipient reads it about the sender\n * (\"Priya Shah asked you to sign NDA.pdf\"); the sender, in their own activity, about what they did\n * (\"You asked Sam Lee to sign NDA.pdf\"), with the person left out when the sentence needs none.\n */\nexport function signatureNotificationPhrase(\n type: SignatureNotificationType,\n incoming: boolean\n): { lead: string; showPerson: boolean; verb: string; tail: string } {\n if (incoming) {\n switch (type) {\n case 'signature_requested':\n return { lead: '', showPerson: true, verb: 'asked you to sign', tail: '' }\n case 'signature_completed':\n return { lead: '', showPerson: true, verb: 'signed', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: '', showPerson: true, verb: 'declined to sign', tail: '' }\n }\n }\n switch (type) {\n case 'signature_requested':\n return { lead: 'You asked', showPerson: true, verb: 'to sign', tail: '' }\n case 'signature_completed':\n return { lead: 'You signed', showPerson: false, verb: '', tail: ' \u2014 everyone has now signed' }\n case 'signature_declined':\n return { lead: 'You declined to sign', showPerson: false, verb: '', tail: '' }\n }\n}\n\n/**\n * Plaintext routing metadata on call notifications (`call_missed`): `{call_ext_id}`. Never a\n * title \u2014 titles are encrypted under the call's key.\n */\nexport function callNotificationMeta(content: string | null | undefined): { callExtId?: string } {\n const meta = parse(content)\n return {\n callExtId:\n typeof meta?.call_ext_id === 'string' && /^call-[a-zA-Z0-9]{8}$/.test(meta.call_ext_id)\n ? meta.call_ext_id\n : undefined,\n }\n}\n\n/** A Box had no seat for a new internal user: the inviter's invitation was not sent. Central\n * emails the inviter and the Box admins; this is the inviter's own notice. */\nexport const BOX_SEAT_REFUSED = 'box_seat_refused'\nexport const BOX_SEAT_REFUSED_TITLE =\n 'Invitation not sent: your Box has no seat left. Your Box admins have been notified and can add users in the ARBI portal.'\nexport const BOX_SEAT_REFUSED_ACTION = 'Open the ARBI portal'\n\n/** A deployment admin's notice about the Box's users (`deployment_user_invited` / `_registered`):\n * an invitation sent (sender = the inviter) or an account created (sender = the new user). */\nexport function isDeploymentUserNotification(type: string | null | undefined): boolean {\n return type === 'deployment_user_invited' || type === 'deployment_user_registered'\n}\n\n/** The portal origins a \"Manage users\" link may open by default. Anything else gets no button. */\nexport const ALLOWED_PORTAL_ORIGINS: readonly string[] = ['https://portal.arbicity.com']\n\n/** The portal link, only when it is https on an allowed portal origin. */\nexport function safePortalUrl(\n value: unknown,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): string | undefined {\n if (typeof value !== 'string') return undefined\n try {\n const url = new URL(value)\n if (url.protocol !== 'https:' || !origins.includes(url.origin)) return undefined\n return url.href\n } catch {\n return undefined\n }\n}\n\n/** Plaintext content of a deployment-user notification: `{email, user_type, portal_url}`. */\nexport function deploymentUserMeta(\n content: string | null | undefined,\n origins: readonly string[] = ALLOWED_PORTAL_ORIGINS\n): { email?: string; external: boolean; portalUrl?: string } {\n const meta = parse(content)\n if (!meta) return { external: false }\n const email = typeof meta.email === 'string' && meta.email.trim() ? meta.email.trim() : undefined\n return {\n email,\n external: meta.user_type === 'external',\n portalUrl: safePortalUrl(meta.portal_url, origins),\n }\n}\n\n/** A document's display name, as a document list shows it (its title, else its file name). */\nexport function documentDisplayName(\n doc:\n | { file_name?: string | null; doc_metadata?: { title?: string | null } | null }\n | null\n | undefined\n): string | undefined {\n return doc?.doc_metadata?.title || doc?.file_name || undefined\n}\n\n/** What the work notifications say in a list, where the sender has a column of their own. */\nexport const WORK_NOTIFICATION_LABELS: Readonly<Record<string, string>> = {\n conversation_ready: 'A task is ready',\n conversation_done: 'A task was marked done',\n conversation_notified: 'You were notified in a thread',\n workflow_failed: 'A workflow failed to run',\n}\n\nfunction conversationTarget(n: NotificationResponse): NotificationTarget | undefined {\n if (!n.conversation_ext_id || !CONVERSATION_ID.test(n.conversation_ext_id)) return undefined\n return {\n kind: 'conversation',\n workspaceId: n.workspace_ext_id ?? undefined,\n conversationId: n.conversation_ext_id,\n ...(n.message_ext_id ? { messageId: n.message_ext_id } : {}),\n }\n}\n\n/** The workflows page on the notification's workflow (`{workflow_ext_id}` in its content). */\nfunction workflowTarget(n: NotificationResponse): NotificationTarget {\n const workflowId = parse(n.content)?.workflow_ext_id\n return {\n kind: 'workflows',\n ...(typeof workflowId === 'string' && WORKFLOW_ID.test(workflowId) ? { workflowId } : {}),\n ...(n.workspace_ext_id ? { workspaceId: n.workspace_ext_id } : {}),\n }\n}\n\nfunction signatureTitle(\n n: NotificationResponse,\n senderName: string,\n documentName: DescribeServerNotificationOptions['documentName']\n): string {\n const type = n.type as SignatureNotificationType\n const { documentId } = signatureRequestMeta(n.content)\n const name = documentId ? documentName?.(n.workspace_ext_id, documentId) : undefined\n const fallback = type === 'signature_requested' ? 'a document' : 'your document'\n const { verb, tail } = signatureNotificationPhrase(type, true)\n return `${senderName} ${verb} ${name ?? fallback}${tail}`\n}\n\nfunction quotaPercent(type: string): number | null {\n if (type === 'quota_threshold_100') return 100\n if (type === 'quota_threshold_90') return 90\n if (type === 'quota_threshold_50') return 50\n return null\n}\n\n/**\n * One server notification \u2192 what it says to its recipient and where it leads, or null for\n * types without a sentence here (calendar events, sync completions: they have their own\n * surfaces).\n */\nexport function describeServerNotification(\n n: NotificationResponse,\n options: DescribeServerNotificationOptions = {}\n): ServerNotificationDescription | null {\n const senderName = options.senderName ?? notificationUserName(n.sender)\n const workspace: NotificationTarget | undefined = n.workspace_ext_id\n ? { kind: 'workspace', workspaceId: n.workspace_ext_id }\n : undefined\n const type = n.type as string\n\n if (type === BOX_SEAT_REFUSED) {\n return {\n title: BOX_SEAT_REFUSED_TITLE,\n variant: 'warning',\n actionLabel: BOX_SEAT_REFUSED_ACTION,\n target: { kind: 'seats' },\n }\n }\n const pct = quotaPercent(type)\n if (pct !== null) {\n return {\n title: `You have used ${pct}% of your daily AI limit for this project.`,\n variant: pct === 100 ? 'error' : pct === 90 ? 'warning' : 'info',\n target: { kind: 'projects' },\n }\n }\n\n switch (type) {\n case 'support_ticket_received':\n case 'support_ticket_reviewed':\n case 'support_ticket_resolved': {\n const ticketId = parse(n.content)?.ticket_id\n if (typeof ticketId !== 'number' || !Number.isSafeInteger(ticketId) || ticketId < 1)\n return null\n const suppliedReference = parse(n.content)?.ticket_reference\n const reference =\n typeof suppliedReference === 'string' &&\n /^[a-z0-9-]+-[0-9]+$/.test(suppliedReference) &&\n suppliedReference.endsWith(`-${ticketId}`)\n ? suppliedReference\n : `#${ticketId}`\n return {\n title:\n type === 'support_ticket_received'\n ? `We received support request ${reference}`\n : type === 'support_ticket_reviewed'\n ? `We have reviewed support request ${reference}`\n : `Support request ${reference} is resolved`,\n variant: 'success',\n actionLabel: type === 'support_ticket_resolved' ? 'View outcome' : 'View request',\n target: { kind: 'support', ticketId },\n }\n }\n case 'file_shared': {\n const meta = parse(n.content)\n const id = meta?.file_share_id\n if (typeof id !== 'string' || !/^fsh-[0-9a-f]{32}$/.test(id)) return null\n return {\n title: meta?.declined\n ? `${senderName} declined to sign a file`\n : meta?.completed\n ? 'Everyone has signed. Your PDF is ready.'\n : meta?.signature\n ? `${senderName} asked you to sign a file`\n : `${senderName} shared a file with you`,\n variant: meta?.declined ? 'warning' : meta?.completed ? 'success' : 'info',\n actionLabel: meta?.signature && !meta?.completed ? 'Review and sign' : 'Open file',\n target: { kind: 'url', url: `/shared-files/${id}` },\n }\n }\n case 'call_missed':\n return {\n title: `Missed call from ${senderName}`,\n variant: 'warning',\n actionLabel: 'Call back',\n target: { kind: 'call-back', user: n.sender },\n }\n case 'native_mail_received':\n return {\n title: 'New email in your encrypted inbox',\n variant: 'info',\n target: { kind: 'mail' },\n }\n case 'mail_draft_ready': {\n const draftId = mailDraftIdFromContent(n.content)\n return {\n title: `${senderName} left a draft email for you to review`,\n variant: 'info',\n target: { kind: 'mail', ...(draftId ? { draftId } : {}) },\n }\n }\n case 'workspaceuser_added_owner':\n return { title: `${senderName} added you as owner`, variant: 'info', target: workspace }\n case 'workspaceuser_added_collaborator':\n return {\n title: `${senderName} added you as collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_added_guest':\n return { title: `${senderName} added you as a viewer`, variant: 'info', target: workspace }\n case 'workspaceuser_removed':\n return { title: `${senderName} removed you from a workspace`, variant: 'warning' }\n case 'workspaceuser_updated_owner':\n return {\n title: `${senderName} changed your role to owner`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_collaborator':\n return {\n title: `${senderName} changed your role to collaborator`,\n variant: 'info',\n target: workspace,\n }\n case 'workspaceuser_updated_guest':\n return {\n title: `${senderName} changed your role to viewer`,\n variant: 'info',\n target: workspace,\n }\n case 'signature_requested':\n case 'signature_completed':\n case 'signature_declined': {\n const { documentId, version } = signatureRequestMeta(n.content)\n return {\n title: signatureTitle(n, senderName, options.documentName),\n variant:\n type === 'signature_completed'\n ? 'success'\n : type === 'signature_declined'\n ? 'warning'\n : 'info',\n actionLabel: type === 'signature_requested' ? 'Review and sign' : 'Open',\n // A request opens the current version on its PDF, where the banner offers \"Review and\n // sign\"; a completed request opens the signed copy.\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n tab: 'pdf',\n }\n : undefined,\n }\n }\n case 'docx_mention': {\n const { documentId, commentId } = docxMentionMeta(n.content)\n return {\n title: `${senderName} mentioned you in a document comment`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(commentId ? { commentId } : {}),\n }\n : undefined,\n }\n }\n case 'agent_input_requested':\n return { title: inputRequestTitle(n.content), variant: 'info', target: conversationTarget(n) }\n case 'mention':\n return {\n title: `${senderName} mentioned you in a conversation`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'thread_reply':\n return {\n title: `${senderName} replied in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'document_activity': {\n const { documentId, version } = documentActivityMeta(n.content)\n return {\n title: `${senderName} ${documentActivityPhrase(n.content)}`,\n variant: 'info',\n target: documentId\n ? {\n kind: 'document',\n workspaceId: n.workspace_ext_id ?? undefined,\n documentId,\n ...(version ? { version } : {}),\n }\n : undefined,\n }\n }\n // Each of these opens the thread, so the person it is for finds it. One about your own thread\n // (you started the work) says so.\n case 'conversation_ready':\n return {\n title:\n n.sender.external_id === n.recipient.external_id\n ? 'Your thread is ready'\n : `${senderName}\u2019s thread is ready`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_notified':\n return {\n title: `${senderName} notified you in a thread`,\n variant: 'info',\n target: conversationTarget(n),\n }\n case 'conversation_done':\n return {\n title: `${senderName} marked a thread done`,\n variant: 'success',\n target: conversationTarget(n),\n }\n case 'workflow_completed':\n return { title: 'A workflow completed', variant: 'success', target: workflowTarget(n) }\n // The failed run's thread when it has one (its error is there), else the workflow.\n case 'workflow_failed':\n return {\n title: 'A workflow failed to start',\n variant: 'error',\n target: conversationTarget(n) ?? workflowTarget(n),\n }\n case 'deployment_user_invited':\n case 'deployment_user_registered': {\n const { email, external, portalUrl } = deploymentUserMeta(n.content, options.portalOrigins)\n const suffix = external ? ' \u00B7 External' : ''\n return {\n title:\n type === 'deployment_user_invited'\n ? `${senderName} invited ${email ?? 'a new user'}${suffix}`\n : `${email ?? senderName} joined${suffix}`,\n variant: 'info',\n ...(portalUrl && {\n actionLabel: 'Manage users',\n target: { kind: 'url' as const, url: portalUrl },\n }),\n }\n }\n case 'contact_accepted':\n return { title: `${senderName} joined the platform`, variant: 'success', target: workspace }\n case 'workspace_access_request':\n return {\n title: `${senderName} asked for workspace access`,\n variant: 'info',\n // Straight into the review \u2014 granting needs a workspace choice and a role, so a bare\n // \"grant\" action could never be right here.\n target: { kind: 'access-request', notification: n },\n }\n case 'project_quota_warning': {\n let resource = 'usage'\n let percentage: number | null = null\n let upgrade = ''\n let impending = false\n try {\n const data = JSON.parse(n.content ?? '{}')\n resource = data.resource === 'storage_gb' ? 'storage' : 'AI credits'\n if (data.limit > 0) percentage = Math.round((data.used / data.limit) * 100)\n if (data.stage === 'before_upgrade') {\n impending = true\n const charge = new Intl.NumberFormat('en-GB', {\n style: 'currency',\n currency: data.currency || 'GBP',\n }).format(data.charge_ex_vat_pence / 100)\n upgrade = `An automatic ${resource} upgrade will now be attempted: ${charge} ex VAT.`\n } else if (data.automatic_upgrade === true) {\n upgrade =\n ' An automatic upgrade is available within your limit and will be attempted when needed, subject to payment.'\n } else if (data.automatic_upgrade === false) {\n upgrade =\n data.upgrade_reason === 'limit'\n ? ' No automatic upgrade fits your remaining limit. Increase it or add allowances to keep working.'\n : data.upgrade_reason === 'payment'\n ? ' Automatic upgrades are paused. Resolve your payment issue to keep working.'\n : ' Automatic upgrades are unavailable. Upgrade your plan or reduce usage to keep working.'\n }\n } catch {\n /* An old or malformed notice still opens project usage. */\n }\n return {\n title: impending\n ? upgrade\n : `Your project is approaching its ${resource} limit${percentage != null ? ` (${percentage}% used)` : ''}.${upgrade}`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'project_retention': {\n let deadline = ''\n try {\n const data = JSON.parse(n.content ?? '{}')\n if (data.deletion_at) deadline = new Date(data.deletion_at).toLocaleDateString('en-GB')\n } catch {\n /* display the recovery notice without a date */\n }\n return {\n title: `Your project subscription has ended. Export or resubscribe${deadline ? ` before ${deadline}` : ''} to keep its data.`,\n variant: 'warning',\n target: { kind: 'projects' },\n }\n }\n case 'storage_quota_exceeded':\n return {\n title:\n 'Your storage is full. Mail still arrives, but new uploads and attachments are paused until you free space or add storage.',\n variant: 'error',\n target: { kind: 'storage' },\n }\n case 'signup_reward':\n return {\n title: n.content ? `\uD83C\uDF89 Signup bonus \u2014 ${n.content}` : '\uD83C\uDF89 You earned a signup bonus!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n case 'referral_reward':\n return {\n title: n.content ? `\uD83C\uDF81 Reward \u2014 ${n.content}` : '\uD83C\uDF81 You earned a reward!',\n variant: 'success',\n target: { kind: 'projects' },\n }\n default:\n return null\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA,SAAS,8BAA8B;AA6DhC,SAAS,qBAAqB,MAAgC;AACnE,SAAO,CAAC,KAAK,YAAY,KAAK,WAAW,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK,KAAK;AAC/E;AAEA,MAAM,kBAAkB;AACxB,MAAM,cAAc;AACpB,MAAM,cAAc;AAEpB,SAAS,MAAM,SAAoE;AACjF,MAAI;AACF,UAAM,QAAQ,KAAK,MAAM,WAAW,IAAI;AACxC,WAAO,SAAS,OAAO,UAAU,WAAY,QA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I,KAAK,YAAa,YAAW,IAAI,KAAK,KAAK,WAAW,EAAE,mBAAmB,OAAO;AAAA,MACxF,QAAQ;AAAA,MAER;AACA,aAAO;AAAA,QACL,OAAO,6DAA6D,WAAW,WAAW,QAAQ,KAAK,EAAE;AAAA,QACzG,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,KAAK;AACH,aAAO;AAAA,QACL,OACE;AAAA,QACF,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,UAAU;AAAA,MAC5B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,iCAAqB,EAAE,OAAO,KAAK;AAAA,QACtD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO,EAAE,UAAU,2BAAe,EAAE,OAAO,KAAK;AAAA,QAChD,SAAS;AAAA,QACT,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC7B;AAAA,IACF;AACE,aAAO;AAAA,EACX;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -268,7 +268,7 @@ declare function applyChatEvent(arbi: Arbi, queryClient: QueryClient, event: {
|
|
|
268
268
|
|
|
269
269
|
declare const CALL_CHAT_TOPIC = "arbi.chat";
|
|
270
270
|
/** What a workspace guest sees instead of a composer in a thread call's meeting chat. */
|
|
271
|
-
declare const READ_ONLY_MEETING_TEXT = "
|
|
271
|
+
declare const READ_ONLY_MEETING_TEXT = "Viewer: you can\u2019t post in this meeting chat";
|
|
272
272
|
/** Longest message accepted over the data channel (well under LiveKit's reliable-packet limit). */
|
|
273
273
|
declare const CALL_CHAT_MAX_CHARS = 4000;
|
|
274
274
|
/** What one data packet carries, encrypted under K. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.133",
|
|
4
4
|
"description": "React hooks and provider for the ARBI SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"build-storybook": "storybook build"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@arbidocs/client": "0.5.
|
|
121
|
-
"@arbidocs/sdk": "0.5.
|
|
120
|
+
"@arbidocs/client": "0.5.133",
|
|
121
|
+
"@arbidocs/sdk": "0.5.133",
|
|
122
122
|
"@didit-protocol/sdk-web": "0.4.0",
|
|
123
123
|
"@livekit/components-react": "2.9.24",
|
|
124
124
|
"@radix-ui/react-avatar": "^1.2.0",
|