@arbidocs/react 0.5.101 → 0.5.103
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 +13 -13
- package/dist/artifacts/index.js +3 -3
- package/dist/calls/livekit/index.cjs +48 -48
- package/dist/calls/livekit/index.d.cts +1 -1
- package/dist/calls/livekit/index.d.ts +1 -1
- package/dist/calls/livekit/index.js +3 -3
- package/dist/{chunk-5X3JANHT.js → chunk-4UUZ67JL.js} +3 -3
- package/dist/{chunk-5X3JANHT.js.map → chunk-4UUZ67JL.js.map} +1 -1
- package/dist/{chunk-GTF4WZRS.js → chunk-AXKIOI2U.js} +3 -3
- package/dist/{chunk-GTF4WZRS.js.map → chunk-AXKIOI2U.js.map} +1 -1
- package/dist/{chunk-HEVPIVF2.cjs → chunk-C72FSQUE.cjs} +52 -3
- package/dist/chunk-C72FSQUE.cjs.map +1 -0
- package/dist/{chunk-RSJTYRLH.js → chunk-DPR7LVZO.js} +4 -4
- package/dist/{chunk-RSJTYRLH.js.map → chunk-DPR7LVZO.js.map} +1 -1
- package/dist/{chunk-OL3THGBG.cjs → chunk-FQVNZCTD.cjs} +4 -4
- package/dist/{chunk-OL3THGBG.cjs.map → chunk-FQVNZCTD.cjs.map} +1 -1
- package/dist/{chunk-VIOW22Q4.cjs → chunk-IXE7HCCA.cjs} +44 -44
- package/dist/{chunk-VIOW22Q4.cjs.map → chunk-IXE7HCCA.cjs.map} +1 -1
- package/dist/{chunk-ORBUPHMV.cjs → chunk-KKRDM5RZ.cjs} +38 -38
- package/dist/{chunk-ORBUPHMV.cjs.map → chunk-KKRDM5RZ.cjs.map} +1 -1
- package/dist/{chunk-6SG2OGDR.js → chunk-M74JCOXW.js} +7 -2
- package/dist/chunk-M74JCOXW.js.map +1 -0
- package/dist/{chunk-YIZH5RVW.js → chunk-MAUZSNQY.js} +3 -3
- package/dist/{chunk-YIZH5RVW.js.map → chunk-MAUZSNQY.js.map} +1 -1
- package/dist/{chunk-4SH5INC3.js → chunk-NJEXFOA2.js} +4 -4
- package/dist/{chunk-4SH5INC3.js.map → chunk-NJEXFOA2.js.map} +1 -1
- package/dist/{chunk-MS43RNXM.js → chunk-OSFKAJT2.js} +49 -4
- package/dist/chunk-OSFKAJT2.js.map +1 -0
- package/dist/{chunk-PKGRTL3E.js → chunk-PJMCBB6E.js} +5 -5
- package/dist/{chunk-PKGRTL3E.js.map → chunk-PJMCBB6E.js.map} +1 -1
- package/dist/{chunk-HAGC67GL.cjs → chunk-Q2GNEVG2.cjs} +7 -2
- package/dist/chunk-Q2GNEVG2.cjs.map +1 -0
- package/dist/{chunk-TDFAUVFM.cjs → chunk-TV4QQVZM.cjs} +67 -67
- package/dist/{chunk-TDFAUVFM.cjs.map → chunk-TV4QQVZM.cjs.map} +1 -1
- package/dist/{chunk-5EELSW26.cjs → chunk-XBYVYPU5.cjs} +4 -4
- package/dist/{chunk-5EELSW26.cjs.map → chunk-XBYVYPU5.cjs.map} +1 -1
- package/dist/{chunk-4BDHKG7O.cjs → chunk-XOS7ISIR.cjs} +57 -57
- package/dist/{chunk-4BDHKG7O.cjs.map → chunk-XOS7ISIR.cjs.map} +1 -1
- package/dist/document-tools/core.cjs +99 -99
- package/dist/document-tools/core.d.cts +2 -2
- package/dist/document-tools/core.d.ts +2 -2
- package/dist/document-tools/core.js +4 -4
- package/dist/document-tools/index.cjs +101 -101
- package/dist/document-tools/index.d.cts +1 -1
- package/dist/document-tools/index.d.ts +1 -1
- package/dist/document-tools/index.js +5 -5
- package/dist/index.cjs +1798 -1642
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-ChaR6kMc.d.ts → index.d-oR5FKZpJ.d.cts} +69 -1
- package/dist/{index.d-ChaR6kMc.d.cts → index.d-oR5FKZpJ.d.ts} +69 -1
- package/dist/index.d.cts +139 -31
- package/dist/index.d.ts +139 -31
- package/dist/index.js +174 -41
- package/dist/index.js.map +1 -1
- package/dist/{query-keys.d-O3lHn6rp.d.cts → query-keys.d-Bpb7R_lB.d.cts} +5 -0
- package/dist/{query-keys.d-O3lHn6rp.d.ts → query-keys.d-Bpb7R_lB.d.ts} +5 -0
- package/dist/shell/index.cjs +49 -33
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +2 -2
- package/dist/ui/index.cjs +171 -171
- package/dist/ui/index.js +3 -3
- package/dist/{useAudioRecorder.d-DpDeeeAZ.d.cts → useAudioRecorder.d-B9rlMI_E.d.cts} +1 -1
- package/dist/{useAudioRecorder.d-DpDeeeAZ.d.ts → useAudioRecorder.d-B9rlMI_E.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-6SG2OGDR.js.map +0 -1
- package/dist/chunk-HAGC67GL.cjs.map +0 -1
- package/dist/chunk-HEVPIVF2.cjs.map +0 -1
- package/dist/chunk-MS43RNXM.js.map +0 -1
package/dist/ui/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { ARBI_MARK_SRC, AgentBadge, AiMarkdown, ArbiIcon, BASE_COLORS, Badge, COLUMN_LABEL_FALLBACKS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_METADATA_TAGS, DebouncedInput, DocumentEntity, ENTITY_MAPPINGS, EntityIcon, EntityPill, HoverCard, HoverCardContent, HoverCardTrigger, IconToggle, Input, Label, MarkMenu, NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, ProviderIcon, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ShieldIcon, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserEntity, UserMenu, VISIBILITY_ICONS, VerifiedBadge, VerifiedToggle, VisibilityIcon, VisibilityToggle, agentAvatarColors, badgeVariants, buildFolderTree, canonicalFolderPath, cardVariants, configureEntityRegistry, configureRagLabels, configureStatusRegistry, entityNoun, extensionFromMime, formatCompactLastSeen, formatDocDate, formatFolderLabel, formatFriendlyDate, friendlyFileType, getDocIcon, getDocumentAuthor, getDocumentDate, getDocumentNature, getDocumentSubject, getDocumentTitle, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getFileExtension, getFileTypeIcon, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, isAudioFile, isDocumentAddableToConversation, isDownloadOnlyFile, isImageDocument, isImageFile, isMediaFile, isVideoFile, markdownToPlainText, markdownToPlainTextBlocks, tagKindNouns, tagKindTitle, toggleVariants, useDictateContext, usesOriginalBytesForViewer } from '../chunk-
|
|
1
|
+
export { ARBI_MARK_SRC, AgentBadge, AiMarkdown, ArbiIcon, BASE_COLORS, Badge, COLUMN_LABEL_FALLBACKS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_METADATA_TAGS, DebouncedInput, DocumentEntity, ENTITY_MAPPINGS, EntityIcon, EntityPill, HoverCard, HoverCardContent, HoverCardTrigger, IconToggle, Input, Label, MarkMenu, NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, ProviderIcon, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, ShieldIcon, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserEntity, UserMenu, VISIBILITY_ICONS, VerifiedBadge, VerifiedToggle, VisibilityIcon, VisibilityToggle, agentAvatarColors, badgeVariants, buildFolderTree, canonicalFolderPath, cardVariants, configureEntityRegistry, configureRagLabels, configureStatusRegistry, entityNoun, extensionFromMime, formatCompactLastSeen, formatDocDate, formatFolderLabel, formatFriendlyDate, friendlyFileType, getDocIcon, getDocumentAuthor, getDocumentDate, getDocumentNature, getDocumentSubject, getDocumentTitle, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getFileExtension, getFileTypeIcon, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, isAudioFile, isDocumentAddableToConversation, isDownloadOnlyFile, isImageDocument, isImageFile, isMediaFile, isVideoFile, markdownToPlainText, markdownToPlainTextBlocks, tagKindNouns, tagKindTitle, toggleVariants, useDictateContext, usesOriginalBytesForViewer } from '../chunk-DPR7LVZO.js';
|
|
2
2
|
export { Avatar, AvatarFallback, AvatarImage, createUserAvatarIcon, getUserAvatarColor, getUserDisplayName, getUserInitials, isAgent } from '../chunk-APZZQZ6P.js';
|
|
3
3
|
export { MarkdownCode, MarkdownLink, MarkdownRenderer, MarkdownStreamingContext, markdownBaseComponents, markdownSanitizeSchema, splitMarkdownBlocks } from '../chunk-WL2Y2T47.js';
|
|
4
|
-
export { ScrollArea, ScrollBar, configureEntityVocabulary, formatRelativeTime } from '../chunk-Y3MTRA7D.js';
|
|
5
4
|
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, buttonVariants } from '../chunk-YNNAJJ5Z.js';
|
|
6
|
-
export {
|
|
5
|
+
export { ScrollArea, ScrollBar, configureEntityVocabulary, formatRelativeTime } from '../chunk-Y3MTRA7D.js';
|
|
7
6
|
export { closeOpenEmphasis, trimOpenCitation } from '../chunk-VSCU7K4V.js';
|
|
7
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, PortalContainerProvider, usePortalContainer } from '../chunk-47CCGUWR.js';
|
|
8
8
|
export { cn } from '../chunk-SN5YV6FF.js';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -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 = "Read
|
|
271
|
+
declare const READ_ONLY_MEETING_TEXT = "Read only: 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. */
|
|
@@ -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 = "Read
|
|
271
|
+
declare const READ_ONLY_MEETING_TEXT = "Read only: 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.103",
|
|
4
4
|
"description": "React hooks and provider for the ARBI SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"build-storybook": "storybook build"
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"@arbidocs/client": "0.5.
|
|
113
|
-
"@arbidocs/sdk": "0.5.
|
|
112
|
+
"@arbidocs/client": "0.5.103",
|
|
113
|
+
"@arbidocs/sdk": "0.5.103",
|
|
114
114
|
"@didit-protocol/sdk-web": "0.4.0",
|
|
115
115
|
"@livekit/components-react": "2.9.24",
|
|
116
116
|
"@radix-ui/react-avatar": "^1.2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/host/config.ts","../src/useArbi.ts","../src/query-keys.ts"],"names":[],"mappings":";;;AA4HO,SAAS,WAAA,GAA8B;AAC5C,EAAA,OAAO,WAAW,eAAe,CAAA;AACnC;;;ACvHO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,WAAA,EAAY;AAC7B,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,0DAA0D,CAAA;AAAA,EAC5E;AACA,EAAA,OAAO,IAAA;AACT;AAOO,SAAS,mBAAA,GAA0C;AACxD,EAAA,OAAO,W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SAAS,eAAA,CAAgB,UAA8B,MAAA,EAAqC;AACjG,EAAA,OAAO,MAAA,CAAO,MAAM,CAAC,IAAA,EAAM,MAAM,QAAA,CAAS,CAAC,MAAM,IAAI,CAAA;AACvD","file":"chunk-6SG2OGDR.js","sourcesContent":["/**\n * What a host hands the `@arbidocs/react` hooks, as one configuration (`<ArbiHost config>`). Every\n * field is optional: without one the hooks use their own default. `@arbidocs/blocks` extends it\n * with the blocks domains (environment, billing, viewer, …).\n *\n * A field whose value lives in the host's state is a hook (`use…`), called by the hooks and kits\n * that need it, so the configuration itself stays one stable object for the host's life.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport type { AccountClient } from '../account/client'\nimport type { CalendarSupport } from '../calendar/support'\nimport type { MeetingChatRef } from '../calls/meeting-chat'\nimport type { ActiveCall } from '../calls/session'\nimport type { ArbiChatHost } from '../chat/host'\nimport type { DocumentsSupport } from '../documents/support'\nimport type { MailClient } from '../mail/client'\nimport type { ArbiSessionStore } from '../session/store'\nimport type { DictateContextValue } from '../ui/DictateContext'\nimport type { EntityVocabulary } from '../entities/vocabulary'\nimport type { ArbiHostConnection } from './ArbiHost'\nimport type { ArbiFeatures } from './features'\nimport { ArbiHostContext } from './context'\nimport type { DashboardsHost } from '../datasets/registry'\n\n/** The mail client, and whether mail is on for the signed-in user. */\nexport interface MailHost {\n client: MailClient\n /**\n * Whether mail reads run (signed in and entitled), and the server session the mailbox is\n * unlocked for: unlocking runs again when it changes (`null`: none yet, nothing is unlocked).\n * Absent: on, for one session.\n */\n useStatus?: () => { enabled: boolean; sessionKey: string | null }\n /**\n * The mail waiting in this device's Outbox (written offline), by status, while `enabled` (Mail\n * switched on); the offline status counts it as waiting work. Absent: no Outbox.\n */\n useOutbox?: (enabled: boolean) => ReadonlyArray<{ status: string }>\n /** The Outbox's folder, opened through `openMail({ folder })`. */\n outboxFolder?: string\n}\n\n/** The account client of the settings kits, and whether account reads run (signed in). */\nexport interface AccountHost {\n client: AccountClient\n /** Absent: always. */\n useEnabled?: () => boolean\n}\n\n/** Where the call panel goes in the host's layout. */\nexport type CallSlotMode = 'docked' | 'main'\n\n/** What the calls need from the host: navigation and layout are the host's. */\nexport interface CallsHost {\n /**\n * Show a call's meeting chat: an end-to-end chat, or a workspace meeting thread. Absent: the\n * in-call \"Open meeting chat\" does nothing.\n */\n openMeetingChat?: (ref: MeetingChatRef) => void\n /**\n * Once connected, show the call's conversation (its chat and live transcript) beside the call.\n * Absent: nothing is shown.\n */\n showConversation?: (call: ActiveCall) => void | Promise<void>\n /**\n * The element whose box the shown call fills: the right-hand dock, or (a webinar's audience) the\n * main area. The host claims its slot while `shown` and calls `onLost` when another panel takes\n * it (the call then minimises). Absent: the call floats at the right edge.\n */\n useSlot?: (mode: CallSlotMode, shown: boolean, onLost: () => void) => HTMLElement | null\n}\n\nexport interface ArbiHostConfig {\n /**\n * The SDK on the signed-in session. A host with its own login passes one on its session\n * (`new Arbi({ url, session })`); a blocks-only site gets one from `defaultHost`. A new instance (a\n * new session, a newly opened workspace) re-renders every hook.\n */\n arbi?: Arbi\n /** The session state the kits share. Absent: an in-memory one per top-level host. */\n session?: ArbiSessionStore\n /** Live processing, uploads and the host's document actions. Absent: the package's own. */\n documents?: DocumentsSupport\n /** The calendar kept on this device and account OAuth. Absent: online only, the user's connectors. */\n calendar?: CalendarSupport\n /** Absent: mail on the `arbi` session. */\n mail?: MailHost\n /** Absent: the account on the `arbi` session. */\n account?: AccountHost\n /** Absent: calls open no meeting chat from the room. */\n calls?: CallsHost\n /**\n * The parts of the product the user switches on or off, and where each switch is kept (the user's\n * settings, or this device), read with `useFeature(name)`. The call UI also follows the `calls`\n * feature, on top of the server's calls config. Absent, or a feature not listed: on.\n */\n features?: ArbiFeatures\n /** Dictation for every `dictate` field. Absent: no mic button. */\n dictate?: DictateContextValue\n /** The sign-in layer of a blocks-only site (`defaultHost` in `@arbidocs/blocks/connect`). */\n connection?: ArbiHostConnection\n /** Where the chat engine's side effects go (documents shown, mail drafts, used-up quota). */\n chat?: ArbiChatHost\n /**\n * The site's words for the entities (`{ PROJECT: 'Matter' }`), read by every kit through\n * `getEntityLabel`. Absent: the registry's (\"Project\", \"Workspace\", \"Thread\", …).\n */\n vocabulary?: EntityVocabulary\n /**\n * What the site calls its assistant where people address it: the `@<name>` offered in a chat's\n * mention menu, the draft a shared thread starts with, and the name a message is routed to the\n * assistant on. Absent: \"ARBI\".\n */\n assistantName?: string\n /**\n * Charts and dashboards: more data sources (an external feed, a source relabelled in the site's\n * words) and where saved dashboards are kept. Absent: the built-in sources, saved in a database.\n */\n dashboards?: DashboardsHost\n}\n\n/** The host configuration in scope (`{}` outside an `<ArbiHost>`). */\nexport function useArbiHost(): ArbiHostConfig {\n return useContext(ArbiHostContext) as ArbiHostConfig\n}\n","/**\n * The `Arbi` of the host configuration (`<ArbiHost config={{ arbi }}>`).\n */\n\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { useArbiHost } from './host/config'\n\nexport function useArbi(): Arbi {\n const { arbi } = useArbiHost()\n if (!arbi) {\n throw new Error('useArbi() needs an <ArbiHost> whose config has an `arbi`')\n }\n return arbi\n}\n\n/**\n * The deployment domain the user's keys are derived for, as the host's `Arbi` computes it\n * (`deploymentDomain`, else the API URL's hostname). `undefined` without one. The document tools\n * default their `deploymentDomain` (needed for e-signing) to it.\n */\nexport function useDeploymentDomain(): string | undefined {\n return useArbiHost().arbi?.getDeploymentDomain()\n}\n","/**\n * The one query-key factory of the ARBI front end: every React Query key and mutation key the\n * packages and the app use is built here, under `['arbi', …]`. Literal key arrays anywhere else\n * fail the `arbi/query-keys-from-factory` lint rule and `query-keys.guard.test.ts`, so a key can't\n * drift from the queries it names (a stale literal reads or invalidates nothing, silently).\n *\n * Dependency-free on purpose (types only): e2e helpers import it and pass keys into the page.\n */\n\nimport type {\n CalendarWindow,\n ListEventsParams,\n OverlayLayerName,\n RoomQuery,\n} from '@arbidocs/sdk/browser'\n\nexport const arbiQueryKeys = {\n fileShares: () => ['arbi', 'fileShares'] as const,\n fileShare: (id: string) => ['arbi', 'fileShare', id] as const,\n fileSharePdf: (id: string, status?: string) => ['arbi', 'fileSharePdf', id, status] as const,\n workspaces: () => ['arbi', 'workspaces'] as const,\n /** Every workspace's member list: what a workspace switch drops. */\n allWorkspaceUsers: () => ['arbi', 'workspaceUsers'] as const,\n workspaceUsers: (workspaceId: string) => ['arbi', 'workspaceUsers', workspaceId] as const,\n /** Every workspace's documents list: the prefix a write patches when it does not know the workspace. */\n allDocuments: () => ['arbi', 'documents'] as const,\n documents: (workspaceId: string) => ['arbi', 'documents', workspaceId] as const,\n /** One document (a viewer's); writes keep it current next to the list. */\n document: (docId: string) => ['arbi', 'document', docId] as const,\n documentsById: (docIds: string[]) =>\n ['arbi', 'documentsById', [...docIds].sort().join(',')] as const,\n /** Every workspace's near-duplicate pairs. */\n allSimilarDocuments: () => ['arbi', 'similarDocuments'] as const,\n similarDocuments: (workspaceId: string, threshold: number) =>\n ['arbi', 'similarDocuments', workspaceId, threshold] as const,\n /** Every version list: the prefix a new version invalidates. */\n allDocumentVersions: () => ['arbi', 'documentVersions'] as const,\n documentVersions: (docId: string) => ['arbi', 'documentVersions', docId] as const,\n conversations: (workspaceId: string) => ['arbi', 'conversations', workspaceId] as const,\n /** Every workspace's conversation list (and threads): the prefix a conversation write invalidates. */\n allConversations: () => ['arbi', 'conversations'] as const,\n /** A conversation's threads, under the conversations prefix (ids are unique across workspaces). */\n conversationThreads: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'threads'] as const,\n /** One stored message with everything the server keeps on it (its trace and metadata). */\n messageDetails: (messageId: string) => ['arbi', 'messageDetails', messageId] as const,\n /** The backend's built-in slash commands. */\n assistantCommands: () => ['arbi', 'assistantCommands'] as const,\n /** Every workspace's tags (lists, tables and kinds): what a cross-workspace change refreshes. */\n allTags: () => ['arbi', 'tags'] as const,\n tags: (workspaceId: string) => ['arbi', 'tags', workspaceId] as const,\n /** Under the workspace's tags: the kinds' fields (refreshed with the tags). */\n tagKinds: (workspaceId: string) => ['arbi', 'tags', workspaceId, 'kinds'] as const,\n /** Every filtered list (a table of tags): what a tag write refreshes, the whole list aside. */\n tagLists: (workspaceId: string) => ['arbi', 'tags', workspaceId, 'list'] as const,\n /** Under the workspace's tags: a tag, doctag or fact write that invalidates `tags` refreshes it. */\n tagList: (workspaceId: string, query: string) =>\n ['arbi', 'tags', workspaceId, 'list', query] as const,\n /** A kind's fields, under the workspace's tags. */\n tagKind: (workspaceId: string, kind: string) =>\n ['arbi', 'tags', workspaceId, 'kind', kind] as const,\n /** A task's history, under the conversations prefix: every conversation write refreshes it. */\n conversationActivity: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'activity'] as const,\n thumbnails: (docIds: string[]) => ['arbi', 'thumbnails', [...docIds].sort().join(',')] as const,\n /** Every stage of a document's parsed content. */\n parsedDocument: (docId: string) => ['arbi', 'parsedDoc', docId] as const,\n parsedDoc: (docId: string, stage: string) => ['arbi', 'parsedDoc', docId, stage] as const,\n agents: () => ['arbi', 'agents'] as const,\n sessions: () => ['arbi', 'sessions'] as const,\n health: () => ['arbi', 'health'] as const,\n workflows: () => ['arbi', 'workflows'] as const,\n /** Under `workflows()`: a workflow write or run refreshes its runs too. */\n workflowRuns: (workflowId: string) => ['arbi', 'workflows', workflowId, 'runs'] as const,\n /** Every workspace's facts: the prefix a fact write invalidates. */\n allFacts: () => ['arbi', 'facts'] as const,\n facts: (workspaceId: string) => ['arbi', 'facts', workspaceId] as const,\n configs: () => ['arbi', 'configs'] as const,\n activity: () => ['arbi', 'activity'] as const,\n /** Every transfer query (jobs, lists, plans): what a finished job refreshes. */\n allWorkspaceTransfers: () => ['arbi', 'workspaceTransfers'] as const,\n /** The caller's recent transfer jobs out of a workspace. */\n workspaceTransfers: (workspaceId: string) =>\n ['arbi', 'workspaceTransfers', 'list', workspaceId] as const,\n /** One transfer job's progress. */\n workspaceTransfer: (transferId: string) =>\n ['arbi', 'workspaceTransfers', 'job', transferId] as const,\n /** What a scope (serialised) would take in a workspace, for a mode. */\n workspaceTransferPlan: (workspaceId: string, scope: string, mode: string) =>\n ['arbi', 'workspaceTransfers', 'plan', workspaceId, scope, mode] as const,\n /** A workspace's activity feed (all its pages). */\n workspaceActivity: (workspaceId: string) => ['arbi', 'workspaceActivity', workspaceId] as const,\n projects: () => ['arbi', 'projects'] as const,\n projectUsage: (projectExtId: string, monthsBack: number) =>\n ['arbi', 'projectUsage', projectExtId, monthsBack] as const,\n projectConversationUsage: (projectExtId: string, monthsBack: number) =>\n ['arbi', 'projectUsage', projectExtId, 'byConversation', monthsBack] as const,\n projectInvoices: (projectExtId: string) => ['arbi', 'projectInvoices', projectExtId] as const,\n /** The plans and add-ons on sale. */\n products: () => ['arbi', 'products'] as const,\n /** Prices of a purchase or a change (quotes, previews); nothing is bought. */\n billingQuotes: () => ['arbi', 'billingQuote'] as const,\n userUsageToday: () => ['arbi', 'userUsageToday'] as const,\n currentUser: () => ['arbi', 'currentUser'] as const,\n firmPool: () => ['arbi', 'firmPool'] as const,\n contacts: () => ['arbi', 'contacts'] as const,\n /** Every chat query (the list and each open thread). */\n chats: () => ['arbi', 'chats'] as const,\n /** My chats, raw (titles and last messages are ciphertext), most recently active first. */\n chatList: () => ['arbi', 'chats', 'list'] as const,\n /** One thread's loaded messages, decrypted, oldest first (`ChatThreadData`). */\n chatThread: (chatExtId: string) => ['arbi', 'chats', 'thread', chatExtId] as const,\n /** My own agent's progress on my last message to it (`agent_dm_status`), per agent. */\n agentDmStatus: (agentExtId: string) => ['arbi', 'chats', 'agentStatus', agentExtId] as const,\n /** The paid features this person may use (`/v1/user/entitlements`). */\n entitlements: () => ['arbi', 'entitlements'] as const,\n skills: () => ['arbi', 'skills'] as const,\n /** A skill's main file (SKILL.md), as text. */\n skillSource: (docExtId: string) => ['arbi', 'skills', 'source', docExtId] as const,\n /** An agent's pinned config; `undefined` = the library default config. */\n agentConfig: (agentExtId?: string) => ['arbi', 'agentConfig', agentExtId ?? 'default'] as const,\n agentWorkspaces: (agentExtId: string) => ['arbi', 'agentWorkspaces', agentExtId] as const,\n /** An agent's own login, polled while its controls are open. */\n agentSession: (agentExtId: string) => ['arbi', 'agentSession', agentExtId] as const,\n agentChats: (agentExtId: string) => ['arbi', 'agentChats', agentExtId] as const,\n authorizeLimits: () => ['arbi', 'authorizeLimits'] as const,\n mcpTools: () => ['arbi', 'mcpTools'] as const,\n models: () => ['arbi', 'models'] as const,\n availableModels: () => ['arbi', 'availableModels'] as const,\n modelConnections: (userId?: string) => ['arbi', 'modelConnections', userId] as const,\n directModelUsage: (userId?: string) => ['arbi', 'directModelUsage', userId] as const,\n /** The signed-in user's own profile (name, picture, email). */\n profile: () => ['arbi', 'profile'] as const,\n identity: () => ['arbi', 'identity'] as const,\n /** The signed-in user's settings record (notification preferences, flags). */\n userSettings: () => ['arbi', 'userSettings'] as const,\n /** Every notification list: the prefix a delete, a read receipt or an arrival invalidates. */\n allSupportTickets: () => ['arbi', 'support'] as const,\n supportTickets: () => ['arbi', 'support', 'tickets'] as const,\n supportTicket: (id: number) => ['arbi', 'support', 'tickets', id] as const,\n allNotifications: () => ['arbi', 'notifications'] as const,\n /** The newest `limit` notifications, received and sent. */\n notifications: (limit: number) => ['arbi', 'notifications', limit] as const,\n /** The documents a workspace may use as its Word house template. */\n houseTemplateCandidates: (workspaceId: string) =>\n ['arbi', 'houseTemplateCandidates', workspaceId] as const,\n // ── Storage, archive ────────────────────────────────────────────────────────────────────────\n /** Every storage view (projects, items, names, Recently deleted): what a restore or delete refreshes. */\n storage: () => ['arbi', 'storage'] as const,\n /** What each project stores; no params: every such list. */\n storageProjects: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'projects'] as const)\n : (['arbi', 'storage', 'projects', params] as const),\n /** The largest items stored; no params: every such list. */\n storageItems: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'items'] as const)\n : (['arbi', 'storage', 'items', params] as const),\n /** Decrypted document names of storage items. */\n storageItemNames: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'names'] as const)\n : (['arbi', 'storage', 'names', params] as const),\n /** The deployment's storage day by day. */\n storageSnapshots: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'snapshots'] as const)\n : (['arbi', 'storage', 'snapshots', params] as const),\n /** A workspace's Recently deleted documents; no id: every workspace's. */\n workspaceTrash: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'storage', 'workspaceTrash'] as const)\n : (['arbi', 'storage', 'workspaceTrash', workspaceId] as const),\n /** A workspace's archive state; no id: every workspace's. */\n workspaceArchive: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'workspaceArchive'] as const)\n : (['arbi', 'workspaceArchive', workspaceId] as const),\n // ── Databases ───────────────────────────────────────────────────────────────────────────────\n // Every key below names its workspace right after its kind: a list read in one workspace is never\n // served, or overwritten, in another (the list is the session's open workspace on the server).\n /** Every database query of every workspace (what a write or a switch refreshes). */\n databases: () => ['arbi', 'databases'] as const,\n /** A workspace's databases; no id: every workspace's. */\n databaseList: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'list'] as const)\n : (['arbi', 'databases', 'list', workspaceId] as const),\n /** One database of a workspace; no workspace: every one read. */\n database: (workspaceId?: string, databaseId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'one'] as const)\n : (['arbi', 'databases', 'one', workspaceId, databaseId ?? ''] as const),\n /**\n * A database's rows (a search); no workspace: every database's, no params: every search of one.\n * `['arbi', 'databases', 'rows', workspaceId, databaseId, params]`.\n */\n databaseRows: (workspaceId?: string, databaseId?: string, params?: object) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'rows'] as const)\n : params === undefined\n ? (['arbi', 'databases', 'rows', workspaceId, databaseId ?? ''] as const)\n : (['arbi', 'databases', 'rows', workspaceId, databaseId ?? '', params] as const),\n /** The saved dashboards of a store's scope (a workspace). */\n dashboards: (scope: string) => ['arbi', 'dashboards', scope] as const,\n /** A database's rows grouped and measured (a chart); no workspace: every database's. */\n databaseAggregate: (workspaceId?: string, databaseId?: string, request?: object) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'aggregate'] as const)\n : (['arbi', 'databases', 'aggregate', workspaceId, databaseId ?? '', request ?? {}] as const),\n // ── Configs, health ─────────────────────────────────────────────────────────────────────────\n /** Under `configs()`: the saved configuration versions. */\n configVersions: () => ['arbi', 'configs', 'versions'] as const,\n /** Under `configs()`: the JSON schema of every config model. */\n configSchema: () => ['arbi', 'configs', 'schema'] as const,\n /** Under `configs()`: one configuration. */\n config: (configId: string) => ['arbi', 'configs', 'one', configId] as const,\n /** The remote model providers' health. */\n remoteModels: () => ['arbi', 'remoteModels'] as const,\n // ── Conversations ───────────────────────────────────────────────────────────────────────────\n /** Under the conversations prefix: what a parked run waits for the owner to allow. */\n conversationPendingAuth: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'pending-auth'] as const,\n // ── Document tools ──────────────────────────────────────────────────────────────────────────\n /** Signatures on a document (a version); no id: every document's. */\n documentSignatures: (docId?: string, version?: number | null) =>\n docId === undefined\n ? (['arbi', 'documentSignatures'] as const)\n : (['arbi', 'documentSignatures', docId, version ?? null] as const),\n /** The certificate of a signature reference. */\n signatureVerification: (reference: string) =>\n ['arbi', 'signatureVerification', reference] as const,\n /** Every signature request list: what a request write refreshes. */\n signatureRequests: () => ['arbi', 'signatureRequests'] as const,\n signatureRequestsForDocument: (docId: string) =>\n ['arbi', 'signatureRequests', 'document', docId] as const,\n /** Who may sign in a workspace; no id: every workspace's. */\n signatureCandidates: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'signatureRequests', 'candidates'] as const)\n : (['arbi', 'signatureRequests', 'candidates', workspaceId] as const),\n /** The user's saved (informal) signature. */\n savedSignature: () => ['arbi', 'savedSignature'] as const,\n /** An html/react artifact's source. */\n artifactSource: (docId: string) => ['arbi', 'artifactSource', docId] as const,\n /** An artifact's text, under its parsed content (refreshed with it). */\n artifactText: (docId: string) => ['arbi', 'parsedDoc', docId, 'marker', 'artifact-text'] as const,\n /** An image document's bytes as an object URL. */\n assetImage: (docId: string) => ['arbi', 'assetImage', docId] as const,\n // ── Misc ────────────────────────────────────────────────────────────────────────────────────\n /** An agent config's model tier (the builder's badge). */\n agentConfigModel: (configId: string) => ['arbi', 'agentConfigModel', configId] as const,\n /** Under `billingQuotes()`: the price of a plan change. */\n billingPreview: (projectExtId: string, change: unknown) =>\n ['arbi', 'billingQuote', 'preview', projectExtId, change] as const,\n billingPlanQuote: (projectExtId: string | null, body: unknown) =>\n ['arbi', 'billingQuote', 'plan', projectExtId, body] as const,\n billingAddonQuote: (projectExtId: string, kind: string) =>\n ['arbi', 'billingQuote', 'addon', projectExtId, kind] as const,\n /** Under `contacts()`: a search of the people one can reach. */\n contactSearch: (term: string) => ['arbi', 'contacts', 'search', term] as const,\n /** Under the workspace's facts: a filtered list. */\n factList: (workspaceId: string, filter: unknown) =>\n ['arbi', 'facts', workspaceId, filter] as const,\n /**\n * Under `skills()`: a workspace's list, hidden ones included or not. Without a marketplace the\n * server lists the open workspace's skills, so the list is kept per workspace.\n */\n skillList: (workspaceId: string, includeHidden: boolean) =>\n ['arbi', 'skills', 'list', workspaceId, includeHidden] as const,\n /** Under the project's events: one kind, one page size. */\n projectEventList: (projectExtId: string, kind: string, limit: number | 'default') =>\n ['arbi', 'projects', projectExtId, 'events', kind, limit] as const,\n /** The documents pinned for offline reading on this device. */\n offlineDocuments: () => ['arbi', 'offlineDocuments'] as const,\n /** Notifications of one kind for a deployment's user (polled). */\n typedNotifications: (kind: string, apiUrl: string, userId: string | undefined) =>\n ['arbi', 'typedNotifications', kind, apiUrl, userId ?? ''] as const,\n}\n\n/**\n * Keys of the mutations a host may need to follow (its own caches outside these hooks), e.g. with\n * a `MutationCache` subscription: a workflow run creates a task in the host's own task list.\n */\nexport const arbiMutationKeys = {\n /** A member's role changed. */\n setWorkspaceMemberRoles: () => ['arbi', 'workspaces', 'roles'] as const,\n runWorkflow: () => ['arbi', 'workflows', 'run'] as const,\n updateTagKindSchema: () => ['arbi', 'tags', 'kinds', 'update'] as const,\n createTag: () => ['arbi', 'tags', 'create'] as const,\n updateTag: () => ['arbi', 'tags', 'update'] as const,\n deleteTag: () => ['arbi', 'tags', 'delete'] as const,\n extractEntities: () => ['arbi', 'tags', 'entities', 'extract'] as const,\n updateDocuments: () => ['arbi', 'documents', 'update'] as const,\n deleteDocuments: () => ['arbi', 'documents', 'delete'] as const,\n uploadDocuments: () => ['arbi', 'documents', 'upload'] as const,\n uploadUrls: () => ['arbi', 'documents', 'uploadUrls'] as const,\n assignDocTags: () => ['arbi', 'doctags', 'assign'] as const,\n removeDocTags: () => ['arbi', 'doctags', 'remove'] as const,\n updateDocTag: () => ['arbi', 'doctags', 'update'] as const,\n generateDocTags: () => ['arbi', 'doctags', 'generate'] as const,\n /** Members added to or removed from a workspace (leaving included). */\n workspaceMembership: () => ['arbi', 'workspaces', 'members'] as const,\n /** A chat turn being sent (the app's send pipeline). */\n sendMessage: () => ['arbi', 'conversations', 'send'] as const,\n}\n\n/**\n * Query keys of the calendar hooks, all under `['arbi', 'calendar']`. The calendar is the user's,\n * not a workspace's; only the overlays carry the open workspace.\n */\nexport const calendarQueryKeys = {\n all: () => ['arbi', 'calendar'] as const,\n settings: () => ['arbi', 'calendar', 'settings'] as const,\n calendars: () => ['arbi', 'calendar', 'calendars'] as const,\n /** Every event list: the prefix an event write invalidates. */\n events: () => ['arbi', 'calendar', 'events'] as const,\n eventList: (p: ListEventsParams) =>\n [\n 'arbi',\n 'calendar',\n 'events',\n { start: p.start, end: p.end, calendars: p.calendars?.join(',') ?? null },\n ] as const,\n /** Every single event read. */\n eventDetails: () => ['arbi', 'calendar', 'event'] as const,\n event: (id: string, recurrenceId?: string | null) =>\n ['arbi', 'calendar', 'event', id, recurrenceId ?? null] as const,\n shares: (calId: string) => ['arbi', 'calendar', 'shares', calId] as const,\n invitations: () => ['arbi', 'calendar', 'invitations'] as const,\n holidayCountries: () => ['arbi', 'calendar', 'holiday-countries'] as const,\n allRooms: () => ['arbi', 'calendar', 'rooms'] as const,\n rooms: (q: RoomQuery) => ['arbi', 'calendar', 'rooms', q] as const,\n freebusy: (attendees: string[], start: string, end: string) =>\n ['arbi', 'calendar', 'freebusy', attendees.join(','), start, end] as const,\n allLookups: () => ['arbi', 'calendar', 'lookup'] as const,\n lookup: (uid: string) => ['arbi', 'calendar', 'lookup', uid] as const,\n overlays: (workspaceId: string | null, w?: CalendarWindow, layers?: OverlayLayerName[]) =>\n [\n 'arbi',\n 'calendar',\n 'overlays',\n workspaceId,\n w ? { start: w.start, end: w.end, layers: layers?.join(',') } : null,\n ] as const,\n accounts: () => ['arbi', 'calendar', 'accounts'] as const,\n caldavProfiles: () => ['arbi', 'calendar', 'caldav-profiles'] as const,\n bookingPages: () => ['arbi', 'calendar', 'booking-pages'] as const,\n /** The offline outbox (writes made offline, not yet sent). */\n outbox: () => ['arbi', 'calendar', 'outbox'] as const,\n}\n\n/** Query keys of the call hooks, all under `['arbi', 'calls']`. Calls are the user's, not a workspace's. */\nexport const callQueryKeys = {\n all: () => ['arbi', 'calls'] as const,\n config: () => ['arbi', 'calls', 'config'] as const,\n call: (callExtId: string) => ['arbi', 'calls', 'call', callExtId] as const,\n /** Everything about a call's recordings: the prefix a recording event invalidates. */\n recordingsOf: (callExtId: string) => ['arbi', 'calls', 'recordings', callExtId] as const,\n recordings: (callExtId: string) => ['arbi', 'calls', 'recordings', callExtId, 'list'] as const,\n recording: (callExtId: string, recordingExtId: string) =>\n ['arbi', 'calls', 'recordings', callExtId, 'one', recordingExtId] as const,\n inviteLinks: (callExtId: string) => ['arbi', 'calls', 'invite-links', callExtId] as const,\n}\n\nexport const connectorQueryKeys = {\n all: () => ['arbi', 'connectors'] as const,\n catalog: () => ['arbi', 'connectors', 'catalog'] as const,\n mine: () => ['arbi', 'connectors', 'mine'] as const,\n mailboxFolders: (vendor: string) => ['arbi', 'connectors', 'folders', vendor] as const,\n mailboxSyncProgress: (vendor: string, workspaceExtId: string) =>\n ['arbi', 'connectors', 'sync-progress', vendor, workspaceExtId] as const,\n allMailboxSyncProgress: () => ['arbi', 'connectors', 'sync-progress'] as const,\n driveFolders: (vendor: string) => ['arbi', 'connectors', 'drive-folders', vendor] as const,\n driveFolderChildren: (vendor: string, itemId: string) =>\n ['arbi', 'connectors', 'drive-folder-children', vendor, itemId] as const,\n driveFolderDocCount: (vendor: string, itemId: string) =>\n ['arbi', 'connectors', 'drive-folder-doc-count', vendor, itemId] as const,\n driveSyncEstimate: (vendor: string) =>\n ['arbi', 'connectors', 'drive-sync-estimate', vendor] as const,\n driveSyncProgress: (vendor: string) =>\n ['arbi', 'connectors', 'drive-sync-progress', vendor] as const,\n allDriveSyncProgress: () => ['arbi', 'connectors', 'drive-sync-progress'] as const,\n slack: () => ['arbi', 'connectors', 'slack'] as const,\n}\n\nexport const mailQueryKeys = {\n all: () => ['arbi', 'mail'] as const,\n policy: () => ['arbi', 'mail', 'policy'] as const,\n accounts: () => ['arbi', 'mail', 'accounts'] as const,\n unlock: (accountId: string | undefined, sessionKey: string | null) =>\n ['arbi', 'mail', 'unlock', accountId, sessionKey ?? ''] as const,\n allFolders: () => ['arbi', 'mail', 'folders'] as const,\n folders: (accountId: string | undefined) => ['arbi', 'mail', 'folders', accountId] as const,\n allMessages: () => ['arbi', 'mail', 'messages'] as const,\n messages: (\n accountId: string | undefined,\n folderId: string | undefined,\n query: string,\n cursor: string | null\n ) => ['arbi', 'mail', 'messages', accountId, folderId, query, cursor] as const,\n message: (accountId: string | undefined, messageId: string | null | undefined) =>\n ['arbi', 'mail', 'message', accountId, messageId] as const,\n /** Every conversation list: the prefix a flag or move patches or refreshes. */\n allConversations: () => ['arbi', 'mail', 'conversations'] as const,\n conversations: (\n accountId: string | undefined,\n folderId: string | undefined,\n query: string,\n cursor: string | null\n ) => ['arbi', 'mail', 'conversations', accountId, folderId, query, cursor] as const,\n /** Every thread read of an account. */\n accountThreads: (accountId: string) => ['arbi', 'mail', 'thread', accountId] as const,\n thread: (\n accountId: string | undefined,\n threadId: string | null | undefined,\n folderId: string | undefined\n ) => ['arbi', 'mail', 'thread', accountId, threadId, folderId] as const,\n /** The key the user's client keys older native mail with: outside the `['arbi', 'mail']` prefix, so\n * refreshing mail never fetches it again. */\n threadSecret: () => ['arbi', 'mail-thread-secret'] as const,\n /** The projects an email's AI work can be billed to. */\n projects: () => ['arbi', 'mail', 'projects'] as const,\n /** A saved draft prepared for editing. */\n draftCompose: (accountId: string | undefined, draftId: string | undefined) =>\n ['arbi', 'mail', 'draft-compose', accountId, draftId] as const,\n attachmentText: (accountId: string, messageId: string, attachmentId: string) =>\n ['arbi', 'mail', 'attachment-text', accountId, messageId, attachmentId] as const,\n}\n\n/** `pdf`: the document as a PDF; `original`: the stored file (an image, a recording, a sheet). */\nexport type DocumentBytesKind = 'pdf' | 'original'\n\n/** Every version and kind of a document's bytes: the prefix a new version invalidates. */\nexport const documentBytesKey = (\n documentRef: string,\n version?: number | null,\n kind?: DocumentBytesKind\n) =>\n version === undefined\n ? (['arbi', 'documentBytes', documentRef] as const)\n : (['arbi', 'documentBytes', documentRef, version, kind ?? 'pdf'] as const)\n\n/** Whether `queryKey` lies under `prefix` (a factory key): React Query's own prefix match. */\nexport function isUnderQueryKey(queryKey: readonly unknown[], prefix: readonly unknown[]): boolean {\n return prefix.every((part, i) => queryKey[i] === part)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/host/config.ts","../src/useArbi.ts","../src/query-keys.ts"],"names":["useContext","ArbiHostContext"],"mappings":";;;;;AA4HO,SAAS,WAAA,GAA8B;AAC5C,EAAA,OAAOA,iBAAWC,iCAAe,CAAA;AACnC;;;ACvHO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,WAAA,EAAY;AAC7B,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,0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,eAAA,EAAiB,WAAW,IACrC,CAAC,MAAA,EAAQ,iBAAiB,WAAA,EAAa,OAAA,EAAS,QAAQ,KAAK;AAG7D,SAAS,eAAA,CAAgB,UAA8B,MAAA,EAAqC;AACjG,EAAA,OAAO,MAAA,CAAO,MAAM,CAAC,IAAA,EAAM,MAAM,QAAA,CAAS,CAAC,MAAM,IAAI,CAAA;AACvD","file":"chunk-HAGC67GL.cjs","sourcesContent":["/**\n * What a host hands the `@arbidocs/react` hooks, as one configuration (`<ArbiHost config>`). Every\n * field is optional: without one the hooks use their own default. `@arbidocs/blocks` extends it\n * with the blocks domains (environment, billing, viewer, …).\n *\n * A field whose value lives in the host's state is a hook (`use…`), called by the hooks and kits\n * that need it, so the configuration itself stays one stable object for the host's life.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport type { AccountClient } from '../account/client'\nimport type { CalendarSupport } from '../calendar/support'\nimport type { MeetingChatRef } from '../calls/meeting-chat'\nimport type { ActiveCall } from '../calls/session'\nimport type { ArbiChatHost } from '../chat/host'\nimport type { DocumentsSupport } from '../documents/support'\nimport type { MailClient } from '../mail/client'\nimport type { ArbiSessionStore } from '../session/store'\nimport type { DictateContextValue } from '../ui/DictateContext'\nimport type { EntityVocabulary } from '../entities/vocabulary'\nimport type { ArbiHostConnection } from './ArbiHost'\nimport type { ArbiFeatures } from './features'\nimport { ArbiHostContext } from './context'\nimport type { DashboardsHost } from '../datasets/registry'\n\n/** The mail client, and whether mail is on for the signed-in user. */\nexport interface MailHost {\n client: MailClient\n /**\n * Whether mail reads run (signed in and entitled), and the server session the mailbox is\n * unlocked for: unlocking runs again when it changes (`null`: none yet, nothing is unlocked).\n * Absent: on, for one session.\n */\n useStatus?: () => { enabled: boolean; sessionKey: string | null }\n /**\n * The mail waiting in this device's Outbox (written offline), by status, while `enabled` (Mail\n * switched on); the offline status counts it as waiting work. Absent: no Outbox.\n */\n useOutbox?: (enabled: boolean) => ReadonlyArray<{ status: string }>\n /** The Outbox's folder, opened through `openMail({ folder })`. */\n outboxFolder?: string\n}\n\n/** The account client of the settings kits, and whether account reads run (signed in). */\nexport interface AccountHost {\n client: AccountClient\n /** Absent: always. */\n useEnabled?: () => boolean\n}\n\n/** Where the call panel goes in the host's layout. */\nexport type CallSlotMode = 'docked' | 'main'\n\n/** What the calls need from the host: navigation and layout are the host's. */\nexport interface CallsHost {\n /**\n * Show a call's meeting chat: an end-to-end chat, or a workspace meeting thread. Absent: the\n * in-call \"Open meeting chat\" does nothing.\n */\n openMeetingChat?: (ref: MeetingChatRef) => void\n /**\n * Once connected, show the call's conversation (its chat and live transcript) beside the call.\n * Absent: nothing is shown.\n */\n showConversation?: (call: ActiveCall) => void | Promise<void>\n /**\n * The element whose box the shown call fills: the right-hand dock, or (a webinar's audience) the\n * main area. The host claims its slot while `shown` and calls `onLost` when another panel takes\n * it (the call then minimises). Absent: the call floats at the right edge.\n */\n useSlot?: (mode: CallSlotMode, shown: boolean, onLost: () => void) => HTMLElement | null\n}\n\nexport interface ArbiHostConfig {\n /**\n * The SDK on the signed-in session. A host with its own login passes one on its session\n * (`new Arbi({ url, session })`); a blocks-only site gets one from `defaultHost`. A new instance (a\n * new session, a newly opened workspace) re-renders every hook.\n */\n arbi?: Arbi\n /** The session state the kits share. Absent: an in-memory one per top-level host. */\n session?: ArbiSessionStore\n /** Live processing, uploads and the host's document actions. Absent: the package's own. */\n documents?: DocumentsSupport\n /** The calendar kept on this device and account OAuth. Absent: online only, the user's connectors. */\n calendar?: CalendarSupport\n /** Absent: mail on the `arbi` session. */\n mail?: MailHost\n /** Absent: the account on the `arbi` session. */\n account?: AccountHost\n /** Absent: calls open no meeting chat from the room. */\n calls?: CallsHost\n /**\n * The parts of the product the user switches on or off, and where each switch is kept (the user's\n * settings, or this device), read with `useFeature(name)`. The call UI also follows the `calls`\n * feature, on top of the server's calls config. Absent, or a feature not listed: on.\n */\n features?: ArbiFeatures\n /** Dictation for every `dictate` field. Absent: no mic button. */\n dictate?: DictateContextValue\n /** The sign-in layer of a blocks-only site (`defaultHost` in `@arbidocs/blocks/connect`). */\n connection?: ArbiHostConnection\n /** Where the chat engine's side effects go (documents shown, mail drafts, used-up quota). */\n chat?: ArbiChatHost\n /**\n * The site's words for the entities (`{ PROJECT: 'Matter' }`), read by every kit through\n * `getEntityLabel`. Absent: the registry's (\"Project\", \"Workspace\", \"Thread\", …).\n */\n vocabulary?: EntityVocabulary\n /**\n * What the site calls its assistant where people address it: the `@<name>` offered in a chat's\n * mention menu, the draft a shared thread starts with, and the name a message is routed to the\n * assistant on. Absent: \"ARBI\".\n */\n assistantName?: string\n /**\n * Charts and dashboards: more data sources (an external feed, a source relabelled in the site's\n * words) and where saved dashboards are kept. Absent: the built-in sources, saved in a database.\n */\n dashboards?: DashboardsHost\n}\n\n/** The host configuration in scope (`{}` outside an `<ArbiHost>`). */\nexport function useArbiHost(): ArbiHostConfig {\n return useContext(ArbiHostContext) as ArbiHostConfig\n}\n","/**\n * The `Arbi` of the host configuration (`<ArbiHost config={{ arbi }}>`).\n */\n\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { useArbiHost } from './host/config'\n\nexport function useArbi(): Arbi {\n const { arbi } = useArbiHost()\n if (!arbi) {\n throw new Error('useArbi() needs an <ArbiHost> whose config has an `arbi`')\n }\n return arbi\n}\n\n/**\n * The deployment domain the user's keys are derived for, as the host's `Arbi` computes it\n * (`deploymentDomain`, else the API URL's hostname). `undefined` without one. The document tools\n * default their `deploymentDomain` (needed for e-signing) to it.\n */\nexport function useDeploymentDomain(): string | undefined {\n return useArbiHost().arbi?.getDeploymentDomain()\n}\n","/**\n * The one query-key factory of the ARBI front end: every React Query key and mutation key the\n * packages and the app use is built here, under `['arbi', …]`. Literal key arrays anywhere else\n * fail the `arbi/query-keys-from-factory` lint rule and `query-keys.guard.test.ts`, so a key can't\n * drift from the queries it names (a stale literal reads or invalidates nothing, silently).\n *\n * Dependency-free on purpose (types only): e2e helpers import it and pass keys into the page.\n */\n\nimport type {\n CalendarWindow,\n ListEventsParams,\n OverlayLayerName,\n RoomQuery,\n} from '@arbidocs/sdk/browser'\n\nexport const arbiQueryKeys = {\n fileShares: () => ['arbi', 'fileShares'] as const,\n fileShare: (id: string) => ['arbi', 'fileShare', id] as const,\n fileSharePdf: (id: string, status?: string) => ['arbi', 'fileSharePdf', id, status] as const,\n workspaces: () => ['arbi', 'workspaces'] as const,\n /** Every workspace's member list: what a workspace switch drops. */\n allWorkspaceUsers: () => ['arbi', 'workspaceUsers'] as const,\n workspaceUsers: (workspaceId: string) => ['arbi', 'workspaceUsers', workspaceId] as const,\n /** Every workspace's documents list: the prefix a write patches when it does not know the workspace. */\n allDocuments: () => ['arbi', 'documents'] as const,\n documents: (workspaceId: string) => ['arbi', 'documents', workspaceId] as const,\n /** One document (a viewer's); writes keep it current next to the list. */\n document: (docId: string) => ['arbi', 'document', docId] as const,\n documentsById: (docIds: string[]) =>\n ['arbi', 'documentsById', [...docIds].sort().join(',')] as const,\n /** Every workspace's near-duplicate pairs. */\n allSimilarDocuments: () => ['arbi', 'similarDocuments'] as const,\n similarDocuments: (workspaceId: string, threshold: number) =>\n ['arbi', 'similarDocuments', workspaceId, threshold] as const,\n /** Every version list: the prefix a new version invalidates. */\n allDocumentVersions: () => ['arbi', 'documentVersions'] as const,\n documentVersions: (docId: string) => ['arbi', 'documentVersions', docId] as const,\n conversations: (workspaceId: string) => ['arbi', 'conversations', workspaceId] as const,\n /** Every workspace's conversation list (and threads): the prefix a conversation write invalidates. */\n allConversations: () => ['arbi', 'conversations'] as const,\n /** A conversation's threads, under the conversations prefix (ids are unique across workspaces). */\n conversationThreads: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'threads'] as const,\n /** One stored message with everything the server keeps on it (its trace and metadata). */\n messageDetails: (messageId: string) => ['arbi', 'messageDetails', messageId] as const,\n /** The backend's built-in slash commands. */\n assistantCommands: () => ['arbi', 'assistantCommands'] as const,\n /** Every workspace's tags (lists, tables and kinds): what a cross-workspace change refreshes. */\n allTags: () => ['arbi', 'tags'] as const,\n tags: (workspaceId: string) => ['arbi', 'tags', workspaceId] as const,\n /** Under the workspace's tags: the kinds' fields (refreshed with the tags). */\n tagKinds: (workspaceId: string) => ['arbi', 'tags', workspaceId, 'kinds'] as const,\n /** Every filtered list (a table of tags): what a tag write refreshes, the whole list aside. */\n tagLists: (workspaceId: string) => ['arbi', 'tags', workspaceId, 'list'] as const,\n /** Under the workspace's tags: a tag, doctag or fact write that invalidates `tags` refreshes it. */\n tagList: (workspaceId: string, query: string) =>\n ['arbi', 'tags', workspaceId, 'list', query] as const,\n /** A kind's fields, under the workspace's tags. */\n tagKind: (workspaceId: string, kind: string) =>\n ['arbi', 'tags', workspaceId, 'kind', kind] as const,\n /** A task's history, under the conversations prefix: every conversation write refreshes it. */\n conversationActivity: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'activity'] as const,\n thumbnails: (docIds: string[]) => ['arbi', 'thumbnails', [...docIds].sort().join(',')] as const,\n /** Every stage of a document's parsed content. */\n parsedDocument: (docId: string) => ['arbi', 'parsedDoc', docId] as const,\n parsedDoc: (docId: string, stage: string) => ['arbi', 'parsedDoc', docId, stage] as const,\n agents: () => ['arbi', 'agents'] as const,\n sessions: () => ['arbi', 'sessions'] as const,\n health: () => ['arbi', 'health'] as const,\n workflows: () => ['arbi', 'workflows'] as const,\n /** Under `workflows()`: a workflow write or run refreshes its runs too. */\n workflowRuns: (workflowId: string) => ['arbi', 'workflows', workflowId, 'runs'] as const,\n /** Every workspace's facts: the prefix a fact write invalidates. */\n allFacts: () => ['arbi', 'facts'] as const,\n facts: (workspaceId: string) => ['arbi', 'facts', workspaceId] as const,\n configs: () => ['arbi', 'configs'] as const,\n activity: () => ['arbi', 'activity'] as const,\n /** Every transfer query (jobs, lists, plans): what a finished job refreshes. */\n allWorkspaceTransfers: () => ['arbi', 'workspaceTransfers'] as const,\n /** The caller's recent transfer jobs out of a workspace. */\n workspaceTransfers: (workspaceId: string) =>\n ['arbi', 'workspaceTransfers', 'list', workspaceId] as const,\n /** One transfer job's progress. */\n workspaceTransfer: (transferId: string) =>\n ['arbi', 'workspaceTransfers', 'job', transferId] as const,\n /** What a scope (serialised) would take in a workspace, for a mode. */\n workspaceTransferPlan: (workspaceId: string, scope: string, mode: string) =>\n ['arbi', 'workspaceTransfers', 'plan', workspaceId, scope, mode] as const,\n /** A workspace's activity feed (all its pages). */\n workspaceActivity: (workspaceId: string) => ['arbi', 'workspaceActivity', workspaceId] as const,\n projects: () => ['arbi', 'projects'] as const,\n projectUsage: (projectExtId: string, monthsBack: number) =>\n ['arbi', 'projectUsage', projectExtId, monthsBack] as const,\n projectConversationUsage: (projectExtId: string, monthsBack: number) =>\n ['arbi', 'projectUsage', projectExtId, 'byConversation', monthsBack] as const,\n projectInvoices: (projectExtId: string) => ['arbi', 'projectInvoices', projectExtId] as const,\n /** The plans and add-ons on sale. */\n products: () => ['arbi', 'products'] as const,\n /** Prices of a purchase or a change (quotes, previews); nothing is bought. */\n billingQuotes: () => ['arbi', 'billingQuote'] as const,\n userUsageToday: () => ['arbi', 'userUsageToday'] as const,\n currentUser: () => ['arbi', 'currentUser'] as const,\n firmPool: () => ['arbi', 'firmPool'] as const,\n contacts: () => ['arbi', 'contacts'] as const,\n /** Every chat query (the list and each open thread). */\n chats: () => ['arbi', 'chats'] as const,\n /** My chats, raw (titles and last messages are ciphertext), most recently active first. */\n chatList: () => ['arbi', 'chats', 'list'] as const,\n /** One thread's loaded messages, decrypted, oldest first (`ChatThreadData`). */\n chatThread: (chatExtId: string) => ['arbi', 'chats', 'thread', chatExtId] as const,\n /** My own agent's progress on my last message to it (`agent_dm_status`), per agent. */\n agentDmStatus: (agentExtId: string) => ['arbi', 'chats', 'agentStatus', agentExtId] as const,\n /** The paid features this person may use (`/v1/user/entitlements`). */\n entitlements: () => ['arbi', 'entitlements'] as const,\n skills: () => ['arbi', 'skills'] as const,\n /** A skill's main file (SKILL.md), as text. */\n skillSource: (docExtId: string) => ['arbi', 'skills', 'source', docExtId] as const,\n /** An agent's pinned config; `undefined` = the library default config. */\n agentConfig: (agentExtId?: string) => ['arbi', 'agentConfig', agentExtId ?? 'default'] as const,\n agentWorkspaces: (agentExtId: string) => ['arbi', 'agentWorkspaces', agentExtId] as const,\n /** An agent's own login, polled while its controls are open. */\n agentSession: (agentExtId: string) => ['arbi', 'agentSession', agentExtId] as const,\n agentChats: (agentExtId: string) => ['arbi', 'agentChats', agentExtId] as const,\n authorizeLimits: () => ['arbi', 'authorizeLimits'] as const,\n mcpTools: () => ['arbi', 'mcpTools'] as const,\n models: () => ['arbi', 'models'] as const,\n availableModels: () => ['arbi', 'availableModels'] as const,\n modelConnections: (userId?: string) => ['arbi', 'modelConnections', userId] as const,\n directModelUsage: (userId?: string) => ['arbi', 'directModelUsage', userId] as const,\n /** The signed-in user's own profile (name, picture, email). */\n profile: () => ['arbi', 'profile'] as const,\n identity: () => ['arbi', 'identity'] as const,\n /** The signed-in user's settings record (notification preferences, flags). */\n userSettings: () => ['arbi', 'userSettings'] as const,\n /** Every notification list: the prefix a delete, a read receipt or an arrival invalidates. */\n allSupportTickets: () => ['arbi', 'support'] as const,\n supportTickets: () => ['arbi', 'support', 'tickets'] as const,\n supportTicket: (id: number) => ['arbi', 'support', 'tickets', id] as const,\n allNotifications: () => ['arbi', 'notifications'] as const,\n /** The newest `limit` notifications, received and sent. */\n notifications: (limit: number) => ['arbi', 'notifications', limit] as const,\n /** The documents a workspace may use as its Word house template. */\n houseTemplateCandidates: (workspaceId: string) =>\n ['arbi', 'houseTemplateCandidates', workspaceId] as const,\n // ── Storage, archive ────────────────────────────────────────────────────────────────────────\n /** Every storage view (projects, items, names, Recently deleted): what a restore or delete refreshes. */\n storage: () => ['arbi', 'storage'] as const,\n /** What each project stores; no params: every such list. */\n storageProjects: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'projects'] as const)\n : (['arbi', 'storage', 'projects', params] as const),\n /** The largest items stored; no params: every such list. */\n storageItems: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'items'] as const)\n : (['arbi', 'storage', 'items', params] as const),\n /** Decrypted document names of storage items. */\n storageItemNames: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'names'] as const)\n : (['arbi', 'storage', 'names', params] as const),\n /** The deployment's storage day by day. */\n storageSnapshots: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'snapshots'] as const)\n : (['arbi', 'storage', 'snapshots', params] as const),\n /** A workspace's Recently deleted documents; no id: every workspace's. */\n workspaceTrash: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'storage', 'workspaceTrash'] as const)\n : (['arbi', 'storage', 'workspaceTrash', workspaceId] as const),\n /** A workspace's archive state; no id: every workspace's. */\n workspaceArchive: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'workspaceArchive'] as const)\n : (['arbi', 'workspaceArchive', workspaceId] as const),\n // ── Databases ───────────────────────────────────────────────────────────────────────────────\n // Every key below names its workspace right after its kind: a list read in one workspace is never\n // served, or overwritten, in another (the list is the session's open workspace on the server).\n /** Every database query of every workspace (what a write or a switch refreshes). */\n databases: () => ['arbi', 'databases'] as const,\n /** A workspace's databases; no id: every workspace's. */\n databaseList: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'list'] as const)\n : (['arbi', 'databases', 'list', workspaceId] as const),\n /** One database of a workspace; no workspace: every one read. */\n database: (workspaceId?: string, databaseId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'one'] as const)\n : (['arbi', 'databases', 'one', workspaceId, databaseId ?? ''] as const),\n /**\n * A database's rows (a search); no workspace: every database's, no params: every search of one.\n * `['arbi', 'databases', 'rows', workspaceId, databaseId, params]`.\n */\n databaseRows: (workspaceId?: string, databaseId?: string, params?: object) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'rows'] as const)\n : params === undefined\n ? (['arbi', 'databases', 'rows', workspaceId, databaseId ?? ''] as const)\n : (['arbi', 'databases', 'rows', workspaceId, databaseId ?? '', params] as const),\n /** The saved dashboards of a store's scope (a workspace). */\n dashboards: (scope: string) => ['arbi', 'dashboards', scope] as const,\n /** A database's rows grouped and measured (a chart); no workspace: every database's. */\n databaseAggregate: (workspaceId?: string, databaseId?: string, request?: object) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'aggregate'] as const)\n : (['arbi', 'databases', 'aggregate', workspaceId, databaseId ?? '', request ?? {}] as const),\n // ── Configs, health ─────────────────────────────────────────────────────────────────────────\n /** Under `configs()`: the saved configuration versions. */\n configVersions: () => ['arbi', 'configs', 'versions'] as const,\n /** Under `configs()`: the JSON schema of every config model. */\n configSchema: () => ['arbi', 'configs', 'schema'] as const,\n /** Under `configs()`: one configuration. */\n config: (configId: string) => ['arbi', 'configs', 'one', configId] as const,\n /** The remote model providers' health. */\n remoteModels: () => ['arbi', 'remoteModels'] as const,\n // ── Conversations ───────────────────────────────────────────────────────────────────────────\n /** Under the conversations prefix: what a parked run waits for the owner to allow. */\n conversationPendingAuth: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'pending-auth'] as const,\n // ── Document tools ──────────────────────────────────────────────────────────────────────────\n /** Signatures on a document (a version); no id: every document's. */\n documentSignatures: (docId?: string, version?: number | null) =>\n docId === undefined\n ? (['arbi', 'documentSignatures'] as const)\n : (['arbi', 'documentSignatures', docId, version ?? null] as const),\n /** The certificate of a signature reference. */\n signatureVerification: (reference: string) =>\n ['arbi', 'signatureVerification', reference] as const,\n /** Every signature request list: what a request write refreshes. */\n signatureRequests: () => ['arbi', 'signatureRequests'] as const,\n signatureRequestsForDocument: (docId: string) =>\n ['arbi', 'signatureRequests', 'document', docId] as const,\n /** Who may sign in a workspace; no id: every workspace's. */\n signatureCandidates: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'signatureRequests', 'candidates'] as const)\n : (['arbi', 'signatureRequests', 'candidates', workspaceId] as const),\n /** The user's saved (informal) signature. */\n savedSignature: () => ['arbi', 'savedSignature'] as const,\n /** An html/react artifact's source. */\n artifactSource: (docId: string) => ['arbi', 'artifactSource', docId] as const,\n /** An artifact's text, under its parsed content (refreshed with it). */\n artifactText: (docId: string) => ['arbi', 'parsedDoc', docId, 'marker', 'artifact-text'] as const,\n /** An image document's bytes as an object URL. */\n assetImage: (docId: string) => ['arbi', 'assetImage', docId] as const,\n // ── Misc ────────────────────────────────────────────────────────────────────────────────────\n /** An agent config's model tier (the builder's badge). */\n agentConfigModel: (configId: string) => ['arbi', 'agentConfigModel', configId] as const,\n /** Under `billingQuotes()`: the price of a plan change. */\n billingPreview: (projectExtId: string, change: unknown) =>\n ['arbi', 'billingQuote', 'preview', projectExtId, change] as const,\n billingPlanQuote: (projectExtId: string | null, body: unknown) =>\n ['arbi', 'billingQuote', 'plan', projectExtId, body] as const,\n billingAddonQuote: (projectExtId: string, kind: string) =>\n ['arbi', 'billingQuote', 'addon', projectExtId, kind] as const,\n /** Under `contacts()`: a search of the people one can reach. */\n contactSearch: (term: string) => ['arbi', 'contacts', 'search', term] as const,\n /** Under the workspace's facts: a filtered list. */\n factList: (workspaceId: string, filter: unknown) =>\n ['arbi', 'facts', workspaceId, filter] as const,\n /**\n * Under `skills()`: a workspace's list, hidden ones included or not. Without a marketplace the\n * server lists the open workspace's skills, so the list is kept per workspace.\n */\n skillList: (workspaceId: string, includeHidden: boolean) =>\n ['arbi', 'skills', 'list', workspaceId, includeHidden] as const,\n /** Under the project's events: one kind, one page size. */\n projectEventList: (projectExtId: string, kind: string, limit: number | 'default') =>\n ['arbi', 'projects', projectExtId, 'events', kind, limit] as const,\n /** The documents pinned for offline reading on this device. */\n offlineDocuments: () => ['arbi', 'offlineDocuments'] as const,\n /** Notifications of one kind for a deployment's user (polled). */\n typedNotifications: (kind: string, apiUrl: string, userId: string | undefined) =>\n ['arbi', 'typedNotifications', kind, apiUrl, userId ?? ''] as const,\n}\n\n/**\n * Keys of the mutations a host may need to follow (its own caches outside these hooks), e.g. with\n * a `MutationCache` subscription: a workflow run creates a task in the host's own task list.\n */\nexport const arbiMutationKeys = {\n /** A member's role changed. */\n setWorkspaceMemberRoles: () => ['arbi', 'workspaces', 'roles'] as const,\n runWorkflow: () => ['arbi', 'workflows', 'run'] as const,\n updateTagKindSchema: () => ['arbi', 'tags', 'kinds', 'update'] as const,\n createTag: () => ['arbi', 'tags', 'create'] as const,\n updateTag: () => ['arbi', 'tags', 'update'] as const,\n deleteTag: () => ['arbi', 'tags', 'delete'] as const,\n extractEntities: () => ['arbi', 'tags', 'entities', 'extract'] as const,\n updateDocuments: () => ['arbi', 'documents', 'update'] as const,\n deleteDocuments: () => ['arbi', 'documents', 'delete'] as const,\n uploadDocuments: () => ['arbi', 'documents', 'upload'] as const,\n uploadUrls: () => ['arbi', 'documents', 'uploadUrls'] as const,\n assignDocTags: () => ['arbi', 'doctags', 'assign'] as const,\n removeDocTags: () => ['arbi', 'doctags', 'remove'] as const,\n updateDocTag: () => ['arbi', 'doctags', 'update'] as const,\n generateDocTags: () => ['arbi', 'doctags', 'generate'] as const,\n /** Members added to or removed from a workspace (leaving included). */\n workspaceMembership: () => ['arbi', 'workspaces', 'members'] as const,\n /** A chat turn being sent (the app's send pipeline). */\n sendMessage: () => ['arbi', 'conversations', 'send'] as const,\n}\n\n/**\n * Query keys of the calendar hooks, all under `['arbi', 'calendar']`. The calendar is the user's,\n * not a workspace's; only the overlays carry the open workspace.\n */\nexport const calendarQueryKeys = {\n all: () => ['arbi', 'calendar'] as const,\n settings: () => ['arbi', 'calendar', 'settings'] as const,\n calendars: () => ['arbi', 'calendar', 'calendars'] as const,\n /** Every event list: the prefix an event write invalidates. */\n events: () => ['arbi', 'calendar', 'events'] as const,\n eventList: (p: ListEventsParams) =>\n [\n 'arbi',\n 'calendar',\n 'events',\n { start: p.start, end: p.end, calendars: p.calendars?.join(',') ?? null },\n ] as const,\n /** Every single event read. */\n eventDetails: () => ['arbi', 'calendar', 'event'] as const,\n event: (id: string, recurrenceId?: string | null) =>\n ['arbi', 'calendar', 'event', id, recurrenceId ?? null] as const,\n shares: (calId: string) => ['arbi', 'calendar', 'shares', calId] as const,\n invitations: () => ['arbi', 'calendar', 'invitations'] as const,\n holidayCountries: () => ['arbi', 'calendar', 'holiday-countries'] as const,\n allRooms: () => ['arbi', 'calendar', 'rooms'] as const,\n rooms: (q: RoomQuery) => ['arbi', 'calendar', 'rooms', q] as const,\n freebusy: (attendees: string[], start: string, end: string) =>\n ['arbi', 'calendar', 'freebusy', attendees.join(','), start, end] as const,\n allLookups: () => ['arbi', 'calendar', 'lookup'] as const,\n lookup: (uid: string) => ['arbi', 'calendar', 'lookup', uid] as const,\n overlays: (workspaceId: string | null, w?: CalendarWindow, layers?: OverlayLayerName[]) =>\n [\n 'arbi',\n 'calendar',\n 'overlays',\n workspaceId,\n w ? { start: w.start, end: w.end, layers: layers?.join(',') } : null,\n ] as const,\n accounts: () => ['arbi', 'calendar', 'accounts'] as const,\n caldavProfiles: () => ['arbi', 'calendar', 'caldav-profiles'] as const,\n bookingPages: () => ['arbi', 'calendar', 'booking-pages'] as const,\n /** The offline outbox (writes made offline, not yet sent). */\n outbox: () => ['arbi', 'calendar', 'outbox'] as const,\n}\n\n/** Query keys of the call hooks, all under `['arbi', 'calls']`. Calls are the user's, not a workspace's. */\nexport const callQueryKeys = {\n all: () => ['arbi', 'calls'] as const,\n config: () => ['arbi', 'calls', 'config'] as const,\n call: (callExtId: string) => ['arbi', 'calls', 'call', callExtId] as const,\n /** Everything about a call's recordings: the prefix a recording event invalidates. */\n recordingsOf: (callExtId: string) => ['arbi', 'calls', 'recordings', callExtId] as const,\n recordings: (callExtId: string) => ['arbi', 'calls', 'recordings', callExtId, 'list'] as const,\n recording: (callExtId: string, recordingExtId: string) =>\n ['arbi', 'calls', 'recordings', callExtId, 'one', recordingExtId] as const,\n inviteLinks: (callExtId: string) => ['arbi', 'calls', 'invite-links', callExtId] as const,\n}\n\nexport const connectorQueryKeys = {\n all: () => ['arbi', 'connectors'] as const,\n catalog: () => ['arbi', 'connectors', 'catalog'] as const,\n mine: () => ['arbi', 'connectors', 'mine'] as const,\n mailboxFolders: (vendor: string) => ['arbi', 'connectors', 'folders', vendor] as const,\n mailboxSyncProgress: (vendor: string, workspaceExtId: string) =>\n ['arbi', 'connectors', 'sync-progress', vendor, workspaceExtId] as const,\n allMailboxSyncProgress: () => ['arbi', 'connectors', 'sync-progress'] as const,\n driveFolders: (vendor: string) => ['arbi', 'connectors', 'drive-folders', vendor] as const,\n driveFolderChildren: (vendor: string, itemId: string) =>\n ['arbi', 'connectors', 'drive-folder-children', vendor, itemId] as const,\n driveFolderDocCount: (vendor: string, itemId: string) =>\n ['arbi', 'connectors', 'drive-folder-doc-count', vendor, itemId] as const,\n driveSyncEstimate: (vendor: string) =>\n ['arbi', 'connectors', 'drive-sync-estimate', vendor] as const,\n driveSyncProgress: (vendor: string) =>\n ['arbi', 'connectors', 'drive-sync-progress', vendor] as const,\n allDriveSyncProgress: () => ['arbi', 'connectors', 'drive-sync-progress'] as const,\n slack: () => ['arbi', 'connectors', 'slack'] as const,\n}\n\nexport const mailQueryKeys = {\n all: () => ['arbi', 'mail'] as const,\n policy: () => ['arbi', 'mail', 'policy'] as const,\n accounts: () => ['arbi', 'mail', 'accounts'] as const,\n unlock: (accountId: string | undefined, sessionKey: string | null) =>\n ['arbi', 'mail', 'unlock', accountId, sessionKey ?? ''] as const,\n allFolders: () => ['arbi', 'mail', 'folders'] as const,\n folders: (accountId: string | undefined) => ['arbi', 'mail', 'folders', accountId] as const,\n allMessages: () => ['arbi', 'mail', 'messages'] as const,\n messages: (\n accountId: string | undefined,\n folderId: string | undefined,\n query: string,\n cursor: string | null\n ) => ['arbi', 'mail', 'messages', accountId, folderId, query, cursor] as const,\n message: (accountId: string | undefined, messageId: string | null | undefined) =>\n ['arbi', 'mail', 'message', accountId, messageId] as const,\n /** Every conversation list: the prefix a flag or move patches or refreshes. */\n allConversations: () => ['arbi', 'mail', 'conversations'] as const,\n conversations: (\n accountId: string | undefined,\n folderId: string | undefined,\n query: string,\n cursor: string | null\n ) => ['arbi', 'mail', 'conversations', accountId, folderId, query, cursor] as const,\n /** Every thread read of an account. */\n accountThreads: (accountId: string) => ['arbi', 'mail', 'thread', accountId] as const,\n thread: (\n accountId: string | undefined,\n threadId: string | null | undefined,\n folderId: string | undefined\n ) => ['arbi', 'mail', 'thread', accountId, threadId, folderId] as const,\n /** The key the user's client keys older native mail with: outside the `['arbi', 'mail']` prefix, so\n * refreshing mail never fetches it again. */\n threadSecret: () => ['arbi', 'mail-thread-secret'] as const,\n /** The projects an email's AI work can be billed to. */\n projects: () => ['arbi', 'mail', 'projects'] as const,\n /** A saved draft prepared for editing. */\n draftCompose: (accountId: string | undefined, draftId: string | undefined) =>\n ['arbi', 'mail', 'draft-compose', accountId, draftId] as const,\n attachmentText: (accountId: string, messageId: string, attachmentId: string) =>\n ['arbi', 'mail', 'attachment-text', accountId, messageId, attachmentId] as const,\n}\n\n/** `pdf`: the document as a PDF; `original`: the stored file (an image, a recording, a sheet). */\nexport type DocumentBytesKind = 'pdf' | 'original'\n\n/** Every version and kind of a document's bytes: the prefix a new version invalidates. */\nexport const documentBytesKey = (\n documentRef: string,\n version?: number | null,\n kind?: DocumentBytesKind\n) =>\n version === undefined\n ? (['arbi', 'documentBytes', documentRef] as const)\n : (['arbi', 'documentBytes', documentRef, version, kind ?? 'pdf'] as const)\n\n/** Whether `queryKey` lies under `prefix` (a factory key): React Query's own prefix match. */\nexport function isUnderQueryKey(queryKey: readonly unknown[], prefix: readonly unknown[]): boolean {\n return prefix.every((part, i) => queryKey[i] === part)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/search/session.ts","../src/notifications/Toaster.tsx","../src/notifications/NotificationBell.tsx","../src/host/ArbiHost.tsx","../src/chat/mentions.ts","../src/chat/open-document.ts","../src/chat/thread-document.ts"],"names":["createStore","storage","jsx","Sonner","CheckCircle2","XCircle","AlertTriangle","Info","useState","useNotify","selectUnread","DEFAULT_NOTIFY_TONE","jsxs","DropdownMenu","DropdownMenuTrigger","Bell","DropdownMenuContent","CheckCheck","cn","BellOff","DropdownMenuItem","X","ScrollArea","formatRelativeTime","useContext","ArbiHostContext","useMemo","mergeHostConfig","OWN_SESSION_SLOT","useRef","useEffect","useSyncExternalStore","parseVersionRef"],"mappings":";;;;;;;;;;;;;;;AA8BA,IAAM,KAAA,GAAyD;AAAA,EAC7D,KAAA,EAAO,EAAA;AAAA,EACP,SAAS,EAAC;AAAA,EACV,QAAA,EAAU,KAAA;AAAA,EACV,MAAA,EAAQ,MAAA;AAAA,EACR,KAAA,EAAO,IAAA;AAAA,EACP,OAAA,EAAS;AACX,CAAA;AAEO,SAAS,mBAAA,GAAqC;AACnD,EAAA,OAAOA,mBAAA,CAAgC,OAAO,EAAE,GAAG,OAAO,WAAA,EAAa,IAAA,EAAM,GAAA,EAAK,CAAA,EAAE,CAAE,CAAA;AACxF;AAGO,IAAM,sBAAqC,mBAAA;AAG3C,SAAS,kBAAA,CACd,WAAA,EACA,OAAA,GAAyB,mBAAA,EACnB;AACN,EAAA,OAAA,CAAQ,QAAA,CAAS,CAAC,CAAA,MAAO;AAAA,IACvB,GAAG,KAAA;AAAA,IACH,WAAA,EAAa,WAAA,KAAgB,MAAA,GAAY,CAAA,CAAE,WAAA,GAAc,WAAA;AAAA,IACzD,GAAA,EAAK,EAAE,GAAA,GAAM;AAAA,GACf,CAAE,CAAA;AACJ;AAMO,SAAS,aAAA,CACd,KAAA,EACA,WAAA,EACA,OAAA,GAAyB,mBAAA,EACnB;AACN,EAAA,kBAAA,CAAmB,aAAa,OAAO,CAAA;AACvC,EAAA,OAAA,CAAQ,QAAA,CAAS,EAAE,KAAA,EAAO,OAAA,EAAS,OAAO,CAAA;AAC5C;AAGO,SAAS,iBAAA,CAAkB,UAAyB,mBAAA,EAAoC;AAC7F,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,OAAA,CAAQ,QAAA,EAAS;AACrC,EAAA,IAAI,YAAY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G;AAClC,EAAA,MAAM,OAAO,yBAAA,EAA0B;AACvC,EAAA,eAAA,CAAgB,QAAQ,CAAC,EAAA,KAAO,OAAO,IAAA,CAAK,EAAE,CAAC,CAAA;AAC/C,EAAA,IAAI;AACF,IAAA,IAAI,MAAA,CAAO,KAAK,IAAI,CAAA,CAAE,WAAW,CAAA,EAAG,OAAA,EAAQ,EAAG,UAAA,CAAW,2BAA2B,CAAA;AAAA,kBACxE,EAAG,OAAA,CAAQ,6BAA6B,IAAA,CAAK,SAAA,CAAU,IAAI,CAAC,CAAA;AAAA,EAC3E,CAAA,CAAA,MAAQ;AAAA,EAER;AACF","file":"chunk-HEVPIVF2.cjs","sourcesContent":["/**\n * A search's state outside any component: the query last searched, its passages, and whether it\n * is running. A page that shows the shared session (`sharedSearchSession`) keeps its results when\n * it is left and opened again, another surface can hand it a query to run on arrival\n * ({@link requestSearch}), and {@link persistSearchSession} keeps the last query across reloads.\n */\nimport { createStore, type StoreApi } from 'zustand/vanilla'\nimport type { SearchChunk } from '@arbidocs/sdk/browser'\n\nexport type SearchStatus = 'idle' | 'running' | 'done' | 'error'\n\nexport interface SearchSessionState {\n /** The workspace the query and results belong to. */\n workspaceId: string | null\n /** The query last searched, or handed over to run. */\n query: string\n /** The last search's passages, best first. */\n results: SearchChunk[]\n /** A search has finished with results to show (cleared by {@link clearSearchSession}). */\n searched: boolean\n status: SearchStatus\n error: string | null\n /** A query handed over by {@link requestSearch}, run once by the page that shows the session. */\n pending: string | null\n /** Counts searches, so the reply to an older one never overwrites a newer one. */\n run: number\n}\n\nexport type SearchSession = StoreApi<SearchSessionState>\n\nconst EMPTY: Omit<SearchSessionState, 'workspaceId' | 'run'> = {\n query: '',\n results: [],\n searched: false,\n status: 'idle',\n error: null,\n pending: null,\n}\n\nexport function createSearchSession(): SearchSession {\n return createStore<SearchSessionState>(() => ({ ...EMPTY, workspaceId: null, run: 0 }))\n}\n\n/** The session a host's search page shows. */\nexport const sharedSearchSession: SearchSession = createSearchSession()\n\n/** Back to nothing searched (in `workspaceId` when given); a running search's reply is dropped. */\nexport function clearSearchSession(\n workspaceId?: string | null,\n session: SearchSession = sharedSearchSession\n): void {\n session.setState((s) => ({\n ...EMPTY,\n workspaceId: workspaceId === undefined ? s.workspaceId : workspaceId,\n run: s.run + 1,\n }))\n}\n\n/**\n * Hand a query to the search page, which runs it when it shows the session (the user already\n * asked once; the page must not wait for a second Enter).\n */\nexport function requestSearch(\n query: string,\n workspaceId: string | null,\n session: SearchSession = sharedSearchSession\n): void {\n clearSearchSession(workspaceId, session)\n session.setState({ query, pending: query })\n}\n\n/** The handed-over query, once: the next call returns null. */\nexport function takePendingSearch(session: SearchSession = sharedSearchSession): string | null {\n const { pending } = session.getState()\n if (pending !== null) session.setState({ pending: null })\n return pending\n}\n\ninterface SavedSearch {\n query?: string\n workspaceId?: string | null\n}\n\n/**\n * Keep the last query (and its workspace) in `storage` under `key`, so the search box shows it\n * after a reload. Results are not kept. Returns the unsubscribe.\n */\nexport function persistSearchSession(\n key: string,\n storage: Pick<Storage, 'getItem' | 'setItem'> | undefined = globalThis.localStorage,\n session: SearchSession = sharedSearchSession\n): () => void {\n if (!storage) return () => {}\n try {\n const saved = JSON.parse(storage.getItem(key) ?? 'null') as SavedSearch | null\n if (saved && typeof saved.query === 'string' && !session.getState().query)\n session.setState({ query: saved.query, workspaceId: saved.workspaceId ?? null })\n } catch {\n // Unreadable: start empty.\n }\n let last = ''\n return session.subscribe(({ query, workspaceId }) => {\n const next = JSON.stringify({ query, workspaceId })\n if (next === last) return\n last = next\n try {\n storage.setItem(key, next)\n } catch {\n // Storage full or blocked: the query is simply not kept.\n }\n })\n}\n","/**\n * Toaster — the one shared toast surface, built on sonner (the mature engine:\n * stacking, swipe-to-dismiss, a11y, timing). Mount once near the app root; any\n * code then calls `notify.*(...)` (or the re-exported `toast`) from anywhere.\n *\n * Firm-agnostic: every sonner `ToasterProps` passes through, so a consumer sets\n * its own `position` / `theme` / `toastOptions`. The defaults give a neutral\n * shadcn-token card that both apps can override.\n */\nimport { Toaster as Sonner, type ToasterProps } from 'sonner'\n\nexport type { ToasterProps }\n\nconst DEFAULT_TOAST_OPTIONS: ToasterProps['toastOptions'] = {\n classNames: {\n toast:\n 'group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:rounded-lg',\n description: 'group-[.toast]:text-muted-foreground',\n actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',\n cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',\n },\n}\n\nexport function Toaster({ toastOptions, ...props }: ToasterProps) {\n return (\n <Sonner\n className=\"toaster group\"\n toastOptions={toastOptions ?? DEFAULT_TOAST_OPTIONS}\n {...props}\n />\n )\n}\n","/**\n * NotificationBell — the topbar notification centre: a bell with an unread badge\n * that opens a dropdown of recorded entries (newest first) with an unread dot,\n * relative time and optional deep-link. \"Mark all read\" clears the badge. Backed\n * by the shared {@link useNotify} store (the same one the <Toaster/> renders).\n *\n * Firm-agnostic: navigation is a callback (`onNavigate`), styling tracks semantic\n * tokens, and per-variant glyph colours are overridable via `toneClassNames`.\n */\nimport { useState, type ReactElement } from 'react'\nimport {\n Bell,\n BellOff,\n CheckCheck,\n CheckCircle2,\n AlertTriangle,\n XCircle,\n Info,\n X,\n} from 'lucide-react'\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n} from '../ui/dropdown-menu'\nimport { ScrollArea } from '../ui/scroll-area'\nimport { cn } from '../lib/utils'\nimport { formatRelativeTime } from '../lib/format-relative-time'\nimport {\n useNotify,\n selectUnread,\n DEFAULT_NOTIFY_TONE,\n type NotifyVariant,\n type AppNotification,\n} from './notify-store'\n\nconst GLYPH: Record<NotifyVariant, typeof Info> = {\n success: CheckCircle2,\n error: XCircle,\n warning: AlertTriangle,\n info: Info,\n}\n\n/** Entries the panel lists, newest first. */\nconst BELL_LIMIT = 100\n\n/** What a custom bell trigger needs to render itself. */\nexport interface NotificationBellTriggerState {\n /** Unread count (0 when none). */\n unread: number\n /** Accessible name, including the count: \"Notifications, 2 unread\". */\n ariaLabel: string\n testId: string\n}\n\nexport interface NotificationBellProps {\n /**\n * Replaces the default icon button with the host's own trigger (for example a labelled sidebar\n * row). It must forward its ref and rest props: it is mounted as the dropdown trigger.\n */\n renderTrigger?: (state: NotificationBellTriggerState) => ReactElement\n /** Called with an entry's `href` when it's clicked (e.g. router navigate). */\n onNavigate?: (href: string) => void\n /** Open this entry in the host notification centre instead of following its link. */\n onSelectNotification?: (notification: AppNotification) => void\n /** Called after an entry is locally marked read — the hook for a backend\n * bridge to propagate read state upstream (filter by the ids it owns). */\n onMarkRead?: (id: string) => void\n /** Called after \"Mark all read\" — same upstream-propagation hook. */\n onMarkAllRead?: () => void\n /** Show the store's toast mute switch in the header — the bell is where notification\n * behaviour is controlled. */\n showMuteToggle?: boolean\n /** Override per-variant glyph colours (e.g. brand emerald for success). */\n toneClassNames?: Partial<Record<NotifyVariant, string>>\n emptyText?: string\n /** Footer link to the app's full notification surface. Omit to hide. */\n onViewAll?: () => void\n viewAllLabel?: string\n testId?: string\n /** Where the panel opens relative to the bell (a sidebar-footer bell opens upward). */\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n}\n\nexport function NotificationBell({\n renderTrigger,\n onNavigate,\n onSelectNotification,\n onMarkRead,\n onMarkAllRead,\n showMuteToggle = false,\n toneClassNames,\n emptyText = \"You're all caught up.\",\n onViewAll,\n viewAllLabel = 'View all',\n testId = 'notifications',\n side = 'bottom',\n align = 'end',\n}: NotificationBellProps) {\n const [open, setOpen] = useState(false)\n const notifications = useNotify((s) => s.notifications)\n const unread = useNotify(selectUnread)\n const markAllRead = useNotify((s) => s.markAllRead)\n const markRead = useNotify((s) => s.markRead)\n const muted = useNotify((s) => s.muted)\n const setMuted = useNotify((s) => s.setMuted)\n const tone = (v: NotifyVariant) => toneClassNames?.[v] ?? DEFAULT_NOTIFY_TONE[v]\n\n // Ambient entries (routine session activity — \"Opening workspace…\") are kept\n // for the log but never surfaced in the bell panel: they never badge and are\n // always filtered out here. The panel is the recent history; a host's\n // notification page (`onViewAll`) holds the rest.\n const visible = notifications.filter((n) => !n.ambient).slice(0, BELL_LIMIT)\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger asChild>\n {renderTrigger ? (\n renderTrigger({\n unread,\n ariaLabel: `Notifications${unread ? `, ${unread} unread` : ''}`,\n testId,\n })\n ) : (\n <button\n className=\"relative flex size-9 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n data-testid={testId}\n aria-label={`Notifications${unread ? `, ${unread} unread` : ''}`}\n title=\"Notifications\"\n >\n <Bell className=\"size-5\" />\n {unread > 0 && (\n <span\n className=\"absolute -right-0.5 -top-0.5 flex min-w-4 items-center justify-center rounded-full bg-primary px-1 text-xs font-semibold leading-4 text-primary-foreground\"\n data-testid={`${testId}-badge`}\n >\n {unread > 9 ? '9+' : unread}\n </span>\n )}\n </button>\n )}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align={align}\n side={side}\n sideOffset={8}\n collisionPadding={12}\n className=\"w-60 rounded-lg border-border/60 p-0 shadow-lg pointer-coarse:w-88\"\n data-testid={`${testId}-panel`}\n data-topbar-popover=\"\"\n >\n <div className=\"flex items-center justify-between gap-3 border-b border-border px-3.5 py-2.5 pointer-coarse:py-0\">\n <p className=\"text-sm font-semibold text-foreground\">Notifications</p>\n <div className=\"flex items-center gap-3 pointer-coarse:gap-1\">\n {unread > 0 && (\n <button\n onClick={() => {\n markAllRead()\n onMarkAllRead?.()\n }}\n className=\"flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:opacity-80 pointer-coarse:min-h-11 pointer-coarse:px-2\"\n data-testid={`${testId}-mark-all`}\n >\n <CheckCheck className=\"size-3.5\" /> Mark all read\n </button>\n )}\n {showMuteToggle && (\n <button\n onClick={() => setMuted(!muted)}\n aria-pressed={muted}\n title={muted ? 'Unmute notifications' : 'Mute notifications'}\n aria-label={muted ? 'Unmute notifications' : 'Mute notifications'}\n className={cn(\n 'flex size-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-accent pointer-coarse:size-11',\n muted ? 'text-foreground' : 'text-muted-foreground hover:text-foreground'\n )}\n data-testid={`${testId}-mute`}\n >\n <BellOff className=\"size-3.5\" />\n </button>\n )}\n {/* Explicit close — the dropdown otherwise only dismisses via\n tap-outside/Escape, which isn't discoverable on touch and (at\n mobile width, see blocks.css) the panel covers most\n of the screen so there's nothing to tap outside of. Radix\n closes a DropdownMenu on any item select by default, so a\n plain item with no other effect doubles as a close button. */}\n <DropdownMenuItem\n className=\"flex size-6 shrink-0 items-center justify-center rounded-md p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:bg-accent pointer-coarse:size-11\"\n aria-label=\"Close notifications\"\n data-testid={`${testId}-close`}\n >\n <X className=\"size-3.5\" />\n </DropdownMenuItem>\n </div>\n </div>\n {muted && (\n <p\n className=\"border-b border-border/60 bg-amber-500/10 px-3.5 py-1.5 text-xs text-muted-foreground\"\n data-testid={`${testId}-muted-note`}\n >\n Toasts are muted — everything still lands here.\n </p>\n )}\n\n {visible.length === 0 ? (\n <div className=\"px-3.5 py-10 text-center text-sm text-muted-foreground\">{emptyText}</div>\n ) : (\n <ScrollArea className=\"max-h-[380px]\">\n <ul data-testid={`${testId}-list`}>\n {visible.map((n) => {\n const Glyph = GLYPH[n.variant]\n return (\n <li key={n.id}>\n <button\n onClick={() => {\n markRead(n.id)\n if (!n.read) onMarkRead?.(n.id)\n setOpen(false)\n if (onSelectNotification) {\n onSelectNotification(n)\n return\n }\n // The specific action wins over the generic deep link.\n if (n.onSelect) n.onSelect()\n else if (n.href) onNavigate?.(n.href)\n }}\n className={cn(\n 'flex w-full items-start gap-3 border-b border-border/60 px-3.5 py-3 text-left transition-colors hover:bg-accent',\n !n.read && 'bg-accent/40'\n )}\n data-testid={`${testId}-item`}\n data-notification-id={n.id}\n >\n <Glyph className={cn('mt-0.5 size-4 shrink-0', tone(n.variant))} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium leading-snug text-foreground\">\n {n.title}\n </p>\n {n.description && (\n <p className=\"mt-0.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground\">\n {n.description}\n </p>\n )}\n <p className=\"mt-1 text-xs text-muted-foreground/80\">\n {formatRelativeTime(new Date(n.ts).toISOString())}\n </p>\n </div>\n {(n.onSelect || n.href) && (\n <span className=\"shrink-0 self-center rounded-md bg-primary/10 px-2 py-1 text-xs font-medium text-primary\">\n {n.actionLabel ?? 'Open'}\n </span>\n )}\n {!n.read && (\n <span className=\"mt-1.5 size-2 shrink-0 rounded-full bg-primary\" />\n )}\n </button>\n </li>\n )\n })}\n </ul>\n </ScrollArea>\n )}\n {onViewAll && (\n // A real menu item, not a bare button: selecting it must CLOSE the\n // dropdown on its way to the full surface.\n <DropdownMenuItem\n onClick={onViewAll}\n className=\"justify-center rounded-none border-t border-border px-3.5 py-2.5 text-xs font-medium text-primary focus:text-primary pointer-coarse:min-h-11\"\n data-testid={`${testId}-view-all`}\n >\n {viewAllLabel}\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","/**\n * `<ArbiHost config>`: the one place a host app hands its configuration to every hook and kit.\n *\n * <ArbiHost config={{ arbi, session, documents, calendar, mail, account, … }}>\n * <App />\n * </ArbiHost>\n *\n * Every field is optional and has a default (see `ArbiHostConfig`); a kit reads its domain from\n * the config (`useArbiHost().documents`, `useHost().billing` in blocks). A nested `<ArbiHost>`\n * overrides only the fields it gives and inherits the rest (`environment` field by field), for a\n * subtree that opens projects in its own tabs, say. There is no other host provider: a new domain\n * is a new optional field, never a new provider.\n *\n * SDK-free (this module, ./context, ./merge and the entity vocabulary are all it reaches), so a\n * marketing site that only sets the blocks environment does not bundle the SDK.\n */\n\nimport { useContext, useMemo, useState, type ComponentType, type ReactNode } from 'react'\nimport { ArbiHostContext } from './context'\nimport { mergeHostConfig, OWN_SESSION_SLOT } from './merge'\nimport { configureEntityVocabulary, type EntityVocabulary } from '../entities/vocabulary'\n\n/** A sign-in layer mounted inside the host (`defaultHost` in `@arbidocs/blocks/connect`). */\nexport interface ArbiHostConnection {\n Provider: ComponentType<{ children: ReactNode }>\n}\n\nexport interface ArbiHostProps<Config extends object> {\n config: Config\n children?: ReactNode\n}\n\n/**\n * Provide the host configuration. Typed by the package it is imported from: `@arbidocs/react`'s\n * takes the react domains, `@arbidocs/blocks`' the blocks domains as well.\n */\nexport function ArbiHost<Config extends object>({\n config,\n children,\n}: ArbiHostProps<Config>): React.ReactElement {\n const parent = useContext(ArbiHostContext)\n // A top-level host without a session store gets its own, made on first use (useArbiSessionStore).\n const [ownSession] = useState(() => ({ current: null as unknown }))\n const value = useMemo(() => {\n const merged = mergeHostConfig(parent, config)\n return merged[OWN_SESSION_SLOT] ? merged : { ...merged, [OWN_SESSION_SLOT]: ownSession }\n }, [parent, config, ownSession])\n // The site's nouns are in place before any kit below renders a label.\n const { vocabulary } = config as { vocabulary?: EntityVocabulary }\n if (vocabulary) configureEntityVocabulary(vocabulary)\n const Connection = (config as { connection?: ArbiHostConnection }).connection?.Provider\n return (\n <ArbiHostContext.Provider value={value}>\n {Connection ? <Connection>{children}</Connection> : children}\n </ArbiHostContext.Provider>\n )\n}\n","/**\n * @mentions in chat text: pure helpers shared by the composer (autocomplete, extraction) and\n * the message renderer (chips). No React, no SDK.\n *\n * A mention lives in two places: the readable `@Label` text in the message content, and a\n * structured entry on the message (`{ type, user_ext_id, label }`) that the server reads to share\n * the conversation and notify. The composer only ever inserts `@<label>` for a known candidate,\n * so the structured list can be recovered from the text at send time ({@link extractMentions});\n * the renderer turns each stored mention back into a chip ({@link linkMentions}).\n */\n\n/** Who can be mentioned: a workspace member, or the assistant. */\nexport type MentionKind = 'user' | 'assistant'\n\n/** One entry of the mention autocomplete. */\nexport interface MentionCandidate {\n /** User external id (`usr-…`) for a person; any stable key (e.g. `assistant`) for the assistant. */\n id: string\n kind: MentionKind\n /** Inserted as `@<label>`. For people this must be the server's display name (given + family). */\n label: string\n /** Secondary line in the menu (email, role, …). */\n description?: string\n}\n\n/** The structured mention a message carries (the API's `MessageMention`). */\nexport interface MessageMentionRef {\n type: MentionKind\n user_ext_id?: string | null\n label?: string | null\n}\n\n/** Longest text after `@` that still counts as a query in progress. */\nconst MAX_QUERY_LENGTH = 40\n\n/**\n * The `@query` the caret is in, if any: the `@` must start the text or follow whitespace, and the\n * query may contain spaces (names do) but no newline. Returns the index of the `@` and the query.\n */\nexport function findMentionQuery(\n text: string,\n caret: number\n): { start: number; query: string } | null {\n const before = text.slice(0, caret)\n const at = before.lastIndexOf('@')\n if (at < 0) return null\n if (at > 0 && !/\\s/.test(before[at - 1])) return null\n const query = before.slice(at + 1)\n if (query.length > MAX_QUERY_LENGTH || query.includes('\\n') || query.startsWith(' ')) return null\n return { start: at, query }\n}\n\n/** Candidates matching a query: label prefix (or word-prefix) matches, prefix matches first. */\nexport function filterMentionCandidates(\n candidates: ReadonlyArray<MentionCandidate>,\n query: string\n): MentionCandidate[] {\n const q = query.trim().toLowerCase()\n if (!q) return candidates.slice()\n const scored: Array<{ c: MentionCandidate; score: number }> = []\n for (const c of candidates) {\n const label = c.label.toLowerCase()\n if (label.startsWith(q)) scored.push({ c, score: 0 })\n else if (label.split(/\\s+/).some((word) => word.startsWith(q))) scored.push({ c, score: 1 })\n else if (c.description?.toLowerCase().startsWith(q)) scored.push({ c, score: 2 })\n }\n return scored.sort((a, b) => a.score - b.score).map((s) => s.c)\n}\n\n/** Replace the `@query` at `start…caret` with `@<label> `; returns the new text and caret. */\nexport function insertMention(\n text: string,\n start: number,\n caret: number,\n label: string\n): { text: string; caret: number } {\n const inserted = `@${label} `\n return {\n text: text.slice(0, start) + inserted + text.slice(caret),\n caret: start + inserted.length,\n }\n}\n\n/** Every `[from, to)` range where `@<label>` occurs as a whole token. */\nfunction tokenRanges(text: string, label: string): Array<[number, number]> {\n const needle = `@${label}`\n const ranges: Array<[number, number]> = []\n let from = 0\n for (;;) {\n const i = text.indexOf(needle, from)\n if (i < 0) break\n const end = i + needle.length\n const startsToken = i === 0 || /\\s|\\(|\\[/.test(text[i - 1])\n const endsToken = end === text.length || !/[\\p{L}\\p{N}_]/u.test(text[end])\n if (startsToken && endsToken) ranges.push([i, end])\n from = end\n }\n return ranges\n}\n\n/**\n * The candidates mentioned in `text`, in order of first appearance. Longer labels win overlaps,\n * so `@Bob Smith` is Bob Smith, not a separate `@Bob`.\n */\nexport function extractMentions(\n text: string,\n candidates: ReadonlyArray<MentionCandidate>\n): MentionCandidate[] {\n const taken: Array<[number, number]> = []\n const found: Array<{ c: MentionCandidate; at: number }> = []\n const byLength = [...candidates].sort((a, b) => b.label.length - a.label.length)\n for (const c of byLength) {\n if (!c.label) continue\n for (const [from, to] of tokenRanges(text, c.label)) {\n if (taken.some(([a, b]) => from < b && to > a)) continue\n taken.push([from, to])\n if (!found.some((f) => f.c.id === c.id)) found.push({ c, at: from })\n }\n }\n return found.sort((a, b) => a.at - b.at).map((f) => f.c)\n}\n\n/** The API payload for mentioned candidates. */\nexport function toMessageMentions(mentioned: ReadonlyArray<MentionCandidate>): MessageMentionRef[] {\n return mentioned.map((c) =>\n c.kind === 'assistant' ? { type: 'assistant' } : { type: 'user', user_ext_id: c.id }\n )\n}\n\n/** Fragment prefix of the links {@link linkMentions} writes. */\nexport const MENTION_HREF_PREFIX = '#mention-'\n\n/** Escape the characters that would end a markdown link text early. */\nfunction escapeLinkText(label: string): string {\n return label.replace(/[[\\]\\\\]/g, (ch) => `\\\\${ch}`)\n}\n\n/**\n * Turn each stored mention's `@<label>` in `content` into a markdown link\n * `[@<label>](#mention-<id>)`, so a markdown renderer can draw it as a chip (see\n * {@link mentionFromHref}). Text that no longer matches (a renamed user) stays plain text.\n * `assistantLabels` lists other names the assistant may have been mentioned by.\n */\nexport function linkMentions(\n content: string,\n mentions: ReadonlyArray<MessageMentionRef> | null | undefined,\n assistantLabels: ReadonlyArray<string> = []\n): string {\n if (!mentions || mentions.length === 0 || !content) return content\n const targets: Array<{ label: string; id: string }> = []\n for (const m of mentions) {\n const id = m.type === 'assistant' ? 'assistant' : m.user_ext_id\n if (!id) continue\n const labels = m.type === 'assistant' ? [m.label ?? '', ...assistantLabels] : [m.label ?? '']\n for (const label of labels) if (label) targets.push({ label, id })\n }\n targets.sort((a, b) => b.label.length - a.label.length)\n const replacements: Array<{ from: number; to: number; text: string }> = []\n for (const { label, id } of targets) {\n for (const [from, to] of tokenRanges(content, label)) {\n if (replacements.some((r) => from < r.to && to > r.from)) continue\n replacements.push({\n from,\n to,\n text: `[@${escapeLinkText(label)}](${MENTION_HREF_PREFIX}${id})`,\n })\n }\n }\n replacements.sort((a, b) => b.from - a.from)\n let out = content\n for (const r of replacements) out = out.slice(0, r.from) + r.text + out.slice(r.to)\n return out\n}\n\n/** The mention a `#mention-…` href points at, or null for any other href. */\nexport function mentionFromHref(\n href: string | null | undefined\n): { kind: MentionKind; id: string } | null {\n if (!href?.startsWith(MENTION_HREF_PREFIX)) return null\n const id = href.slice(MENTION_HREF_PREFIX.length)\n if (!id) return null\n return { kind: id === 'assistant' ? 'assistant' : 'user', id }\n}\n\n/** A recipient alone (by any of its labels) is not a message. */\nexport function hasMessageBody(\n value: string,\n recipientLabel: string | ReadonlyArray<string> = 'ARBI'\n): boolean {\n const text = value.trim().toLowerCase()\n const labels = typeof recipientLabel === 'string' ? [recipientLabel] : recipientLabel\n return !!text && !labels.some((label) => text === `@${label}`.toLowerCase())\n}\n","import { useEffect, useRef, useSyncExternalStore } from 'react'\nimport { parseVersionRef } from '../artifacts/versions'\n\n/**\n * Drafting mode: the documents open beside the chat, and which one a chat turn drafts in.\n *\n * A viewer registers the document it shows (`useRegisterOpenDocument`). Being open binds nothing:\n * a turn names a document (`active_artifact_ext_id`, read with `takeDocumentForTurn` as the\n * question is sent) only when its thread is bound to it (`./thread-document`: started from the\n * document, or attached in that thread), when the document was made in that thread, or when the\n * open document is ambient (an email draft open in the composer). The server then binds the live\n * document to the turn: a Word document is read on demand and edited as tracked changes in the\n * open editor, and what the assistant saves becomes a child version of it. The request carries a\n * reference, never the content.\n *\n * The named document is always the subject, also while one of its earlier versions is on screen\n * read-only: a version still names its document. Sending a turn then returns the viewer to the live\n * document (`showLive`), where the assistant's edits appear as they are made. (Pinning a specific\n * version as a source is a separate feature: it does not go through here.)\n *\n * A module-level registry (not React context), like `useChatSurface`, so a viewer and a chat agree\n * wherever they sit in the tree; the most recently opened document is on top and closing it hands\n * back to the one before. It is not the session state's viewing document (`useArbiSessionState`):\n * it holds what mounted viewers can draft in (saved documents only, with the callback that shows\n * the live one again), and a turn reads it outside React. A viewer on the session's viewing\n * document passes that as `shownId` (it may be a version reference, resolved here the same way as\n * `selectViewingDocumentId` does).\n */\n\n/** What a viewer knows about the document it shows. */\nexport interface SavedDocumentInput {\n /** The document (`doc-…`), never a version reference. */\n documentId: string | null | undefined\n /** An unsaved draft (client-minted id, no backend record). */\n isDraft: boolean\n /** Still streaming: nothing is persisted yet. */\n isStreaming: boolean\n /** An image, audio or video artifact: there is no text to draft in. */\n isBlobArtifact: boolean\n /** The loaded document record. */\n documentData:\n | { external_id?: string | null; wp_type?: string | null; file_name?: string | null }\n | null\n | undefined\n}\n\n/** The fields that decide where a document opens. */\nexport interface WordDocumentKind {\n file_name?: string | null\n wp_type?: string | null\n}\n\n/**\n * A document edited in the Word editor: a `.docx`, or a document the assistant wrote (an\n * artifact). The one rule for where a document opens (`openWordEditor` or `openDocument`) and\n * which documents a chat drafts in.\n */\nexport function opensInWord(doc: WordDocumentKind | null | undefined): boolean {\n return !!doc && (doc.wp_type === 'artifact' || !!doc.file_name?.toLowerCase().endsWith('.docx'))\n}\n\n/**\n * The saved, content-backed document a chat can draft in, or null. Only a saved artifact or Word\n * document counts: drafts, an artifact still streaming and blob artifacts do not.\n */\nexport function savedDocumentIdFor(input: SavedDocumentInput): string | null {\n const { documentId, isDraft, isStreaming, isBlobArtifact, documentData } = input\n if (!documentId || isDraft || isStreaming || isBlobArtifact) return null\n if (!documentData || !opensInWord(documentData)) return null\n // A stale record of the previously viewed document is not this one.\n if (documentData.external_id !== documentId) return null\n return documentId\n}\n\nexport interface OpenDocumentRegistration {\n /** The saved document the viewer shows (`doc-…`); null or empty registers nothing. */\n documentId: string | null | undefined\n /** What is on screen: the document itself, or one of its earlier versions (`doc-…@v2`). */\n shownId?: string | null\n /** Show the live document again. Called when a turn starts while an earlier version is shown. */\n showLive?: () => void\n /** The workspace the document belongs to; a chat in another workspace does not draft in it. */\n workspaceId?: string | null\n /** The thread the document was made in: that thread drafts in it without being bound to it. */\n conversationId?: string | null\n /**\n * Drafted in by whichever chat is beside it, bound or not (an email draft open in the composer:\n * the composer is a drafting surface of its own).\n */\n ambient?: boolean\n}\n\ninterface Entry {\n documentId: string\n current: () => OpenDocumentRegistration\n}\n\nlet entries: Entry[] = []\nconst listeners = new Set<() => void>()\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\nfunction emit() {\n listeners.forEach((l) => l())\n}\n\nconst top = (): Entry | undefined => entries[entries.length - 1]\n\n/**\n * Registers the document a viewer shows as the open document while the caller is mounted and\n * `documentId` is set. Pass `savedDocumentIdFor(...)`, or the id of a document known to be saved.\n */\nexport function useRegisterOpenDocument(registration: OpenDocumentRegistration): void {\n const latest = useRef(registration)\n const { documentId, workspaceId, conversationId, ambient } = registration\n useEffect(() => {\n latest.current = registration\n })\n // What decides which chat drafts in it changed (its record loaded): readers re-render.\n useEffect(() => {\n if (documentId) emit()\n }, [documentId, workspaceId, conversationId, ambient])\n useEffect(() => {\n if (!documentId) return\n const entry: Entry = { documentId, current: () => latest.current }\n entries = [...entries, entry]\n emit()\n return () => {\n entries = entries.filter((e) => e !== entry)\n emit()\n }\n }, [documentId])\n}\n\n/** The open document's id (the most recently opened), or null. Re-renders when it changes. */\nexport function useOpenDocumentId(options?: { workspaceId?: string | null }): string | null {\n const workspaceId = options?.workspaceId ?? null\n return useSyncExternalStore(\n subscribe,\n () => openDocumentId({ workspaceId }),\n () => null\n )\n}\n\n/** The open document's id (the most recently opened); with `workspaceId`, only one of it. */\nexport function openDocumentId(options?: { workspaceId?: string | null }): string | null {\n const entry = top()\n if (!entry || !inWorkspace(entry, options?.workspaceId)) return null\n return entry.documentId\n}\n\nfunction inWorkspace(entry: Entry, workspaceId: string | null | undefined): boolean {\n const own = entry.current().workspaceId\n return !workspaceId || !own || own === workspaceId\n}\n\n/** What a turn is about to be sent in: its conversation and the document its thread is bound to. */\nexport interface TurnDocumentInput {\n /** The thread's bound document (`threadDocumentId` / the session's `newChatDocumentId`). */\n boundDocumentId: string | null | undefined\n /** The conversation (null: a new chat). */\n conversationId: string | null | undefined\n /** The chat's workspace: an open document of another workspace is never picked up. */\n workspaceId?: string | null\n}\n\n/** The document a turn drafts in, and the open viewer showing it (if one is). */\nfunction pickTurnDocument({\n boundDocumentId,\n conversationId,\n workspaceId,\n}: TurnDocumentInput): { documentId: string; entry: Entry | undefined } | null {\n // A bound thread names its document on every turn, open or not.\n if (boundDocumentId) {\n const entry = [...entries].reverse().find((e) => e.documentId === boundDocumentId)\n return { documentId: boundDocumentId, entry }\n }\n // Unbound: only a document made in this thread, or an ambient one (an email draft).\n for (let i = entries.length - 1; i >= 0; i--) {\n const entry = entries[i]\n if (!inWorkspace(entry, workspaceId)) continue\n const { ambient, conversationId: madeIn } = entry.current()\n if (ambient || (conversationId && madeIn === conversationId))\n return { documentId: entry.documentId, entry }\n }\n return null\n}\n\n/** The document a turn sent now would draft in, or null. Re-renders as documents open and close. */\nexport function useTurnDocumentId(input: TurnDocumentInput): string | null {\n const { boundDocumentId = null, conversationId = null, workspaceId = null } = input\n return useSyncExternalStore(\n subscribe,\n () => pickTurnDocument({ boundDocumentId, conversationId, workspaceId })?.documentId ?? null,\n () => null\n )\n}\n\n/**\n * The document an assistant turn about to be sent drafts in, or null. Call it once per turn as the\n * question is sent: when an earlier version of the document is on screen, the viewer returns to the\n * live document, where the assistant's edits appear.\n */\nexport function takeDocumentForTurn(input: TurnDocumentInput): string | null {\n const picked = pickTurnDocument(input)\n if (!picked) return null\n const { documentId, entry } = picked\n if (entry) {\n const { shownId, showLive } = entry.current()\n if (shownId && shownId !== documentId && parseVersionRef(shownId).docId === documentId)\n showLive?.()\n }\n return documentId\n}\n","/**\n * A thread's document: the one document a conversation drafts in, part of the conversation.\n *\n * A thread is bound to a document only when it was started from it (\"Chat about this document\" in\n * the viewer) or the person attached it in that thread. Only that thread names it on its turns\n * (`active_artifact_ext_id`), on every turn and after a reload. A document merely open or docked\n * beside the chat binds nothing: a new chat (the ask bar, the new-chat button, the thread\n * launcher, home) starts unbound, so a question there never becomes an edit of whatever is open.\n *\n * The binding is the server's: the conversation's `bound_document_ext_id`, set by the first turn\n * (`bound_document_ext_id` on the turn that starts it) or by a PATCH, and read under each reader's\n * access (`bound_document_unavailable`: bound to a document this reader cannot open). It follows\n * the person to every device, and a shared thread's members all see it. The query cache holds it\n * (`./thread-binding`); a new chat's binding is the session's `newChatDocumentId` until its first\n * turn creates the conversation.\n *\n * This module is the light half (no query client, no SDK), so the shell entry can carry it.\n */\n\n/** What a conversation row says about its binding. */\nexport interface ThreadBindingRow {\n external_id: string\n bound_document_ext_id?: string | null\n bound_document_unavailable?: boolean | null\n updated_at?: string | null\n}\n\n/** A conversation's binding as this reader sees it. */\nexport interface ThreadBinding {\n /** The bound document, or null (unbound, or bound to one this reader cannot open). */\n documentId: string | null\n /** Bound to a document this reader cannot open (another member's private document, or deleted). */\n unavailable: boolean\n}\n\nexport const UNBOUND: ThreadBinding = { documentId: null, unavailable: false }\n\n/** A row's binding. */\nexport function bindingOfRow(row: ThreadBindingRow | null | undefined): ThreadBinding {\n if (!row) return UNBOUND\n const documentId = row.bound_document_ext_id ?? null\n return { documentId, unavailable: !documentId && row.bound_document_unavailable === true }\n}\n\n/** The most recently active conversation bound to a document, among `conversations`, or null. */\nexport function latestThreadOfDocument(\n conversations: readonly ThreadBindingRow[] | null | undefined,\n documentId: string\n): string | null {\n let latest: ThreadBindingRow | null = null\n for (const row of conversations ?? []) {\n if (row.bound_document_ext_id !== documentId) continue\n if (!latest || (row.updated_at ?? '') > (latest.updated_at ?? '')) latest = row\n }\n return latest?.external_id ?? null\n}\n\n// --------------------------------------------------------------------------------------------- //\n// Bindings this browser kept before the server held them (`localStorage`), moved to the server\n// once (`migrateLegacyThreadDocuments` in `./thread-binding`) and then forgotten.\n// --------------------------------------------------------------------------------------------- //\n\nexport const LEGACY_THREAD_DOCUMENTS_KEY = 'arbi-thread-documents'\n\nfunction storage(): Storage | undefined {\n try {\n return typeof localStorage === 'undefined' ? undefined : localStorage\n } catch {\n return undefined\n }\n}\n\n/** The bindings this browser kept locally (conversation id → document id); empty when none. */\nexport function readLegacyThreadDocuments(): Record<string, string> {\n const out: Record<string, string> = {}\n try {\n const parsed = JSON.parse(storage()?.getItem(LEGACY_THREAD_DOCUMENTS_KEY) ?? 'null') as unknown\n if (parsed && typeof parsed === 'object')\n for (const [conversationId, documentId] of Object.entries(parsed))\n if (typeof documentId === 'string') out[conversationId] = documentId\n } catch {\n // Damaged or blocked: nothing to move.\n }\n return out\n}\n\n/** Forget locally kept bindings (moved to the server); the key goes with the last of them. */\nexport function forgetLegacyThreadDocuments(conversationIds: readonly string[]): void {\n if (conversationIds.length === 0) return\n const rest = readLegacyThreadDocuments()\n conversationIds.forEach((id) => delete rest[id])\n try {\n if (Object.keys(rest).length === 0) storage()?.removeItem(LEGACY_THREAD_DOCUMENTS_KEY)\n else storage()?.setItem(LEGACY_THREAD_DOCUMENTS_KEY, JSON.stringify(rest))\n } catch {\n // Blocked: nothing more to do.\n }\n}\n"]}
|