@arbidocs/react 0.4.128 → 0.4.130
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 +72 -55
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.cts +17 -1
- package/dist/artifacts/index.d.ts +17 -1
- package/dist/artifacts/index.js +20 -7
- package/dist/artifacts/index.js.map +1 -1
- package/dist/{chunk-GX75JCPR.cjs → chunk-65WT5PHA.cjs} +361 -189
- package/dist/chunk-65WT5PHA.cjs.map +1 -0
- package/dist/chunk-6JSXDLIQ.js +101 -0
- package/dist/chunk-6JSXDLIQ.js.map +1 -0
- package/dist/{chunk-F7KQVVD2.cjs → chunk-6PPWZILQ.cjs} +28 -15
- package/dist/chunk-6PPWZILQ.cjs.map +1 -0
- package/dist/{chunk-EKRRORFO.js → chunk-C44GO33B.js} +105 -46
- package/dist/chunk-C44GO33B.js.map +1 -0
- package/dist/{chunk-5PQO46PE.js → chunk-J3BYHBKW.js} +358 -189
- package/dist/chunk-J3BYHBKW.js.map +1 -0
- package/dist/{chunk-G6FHNURH.js → chunk-NNWMHMEC.js} +60 -3
- package/dist/chunk-NNWMHMEC.js.map +1 -0
- package/dist/{chunk-TBELZWGV.cjs → chunk-OC7F5SNA.cjs} +108 -44
- package/dist/chunk-OC7F5SNA.cjs.map +1 -0
- package/dist/{chunk-ECOSGMTW.js → chunk-PPRKQK4P.js} +28 -15
- package/dist/chunk-PPRKQK4P.js.map +1 -0
- package/dist/chunk-S7J5SCTZ.cjs +110 -0
- package/dist/chunk-S7J5SCTZ.cjs.map +1 -0
- package/dist/{chunk-AFGE55RQ.cjs → chunk-UN3AZUXX.cjs} +2 -11
- package/dist/chunk-UN3AZUXX.cjs.map +1 -0
- package/dist/{chunk-5WXNTCI3.js → chunk-XV7EOUQM.js} +3 -11
- package/dist/chunk-XV7EOUQM.js.map +1 -0
- package/dist/{chunk-5DCRIWCA.cjs → chunk-ZWFMFOGP.cjs} +68 -2
- package/dist/chunk-ZWFMFOGP.cjs.map +1 -0
- package/dist/document-tools/index.cjs +73 -126
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +16 -4
- package/dist/document-tools/index.d.ts +16 -4
- package/dist/document-tools/index.js +28 -105
- package/dist/document-tools/index.js.map +1 -1
- package/dist/{index-B1O2cqOo.d.cts → index-2Y2MVegs.d.cts} +85 -6
- package/dist/{index-B1O2cqOo.d.ts → index-2Y2MVegs.d.ts} +85 -6
- package/dist/{index-C7OqcKY3.d.ts → index-D8NvRj3J.d.cts} +16 -7
- package/dist/{index-C7OqcKY3.d.cts → index-D8NvRj3J.d.ts} +16 -7
- package/dist/index.cjs +589 -391
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +248 -96
- package/dist/index.d.ts +248 -96
- package/dist/index.js +245 -78
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +10 -6
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/ui/index.cjs +144 -120
- package/dist/ui/index.d.cts +2 -1
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +2 -2
- package/dist/viewers/index.cjs +91 -0
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +62 -1
- package/dist/viewers/index.d.ts +62 -1
- package/dist/viewers/index.js +90 -1
- package/dist/viewers/index.js.map +1 -1
- package/package.json +8 -3
- package/dist/chunk-5DCRIWCA.cjs.map +0 -1
- package/dist/chunk-5PQO46PE.js.map +0 -1
- package/dist/chunk-5WXNTCI3.js.map +0 -1
- package/dist/chunk-74UTKIWQ.js +0 -62
- package/dist/chunk-74UTKIWQ.js.map +0 -1
- package/dist/chunk-AFGE55RQ.cjs.map +0 -1
- package/dist/chunk-ECOSGMTW.js.map +0 -1
- package/dist/chunk-EKRRORFO.js.map +0 -1
- package/dist/chunk-F7KQVVD2.cjs.map +0 -1
- package/dist/chunk-G6FHNURH.js.map +0 -1
- package/dist/chunk-GX75JCPR.cjs.map +0 -1
- package/dist/chunk-NUFEZBA5.cjs +0 -72
- package/dist/chunk-NUFEZBA5.cjs.map +0 -1
- package/dist/chunk-TBELZWGV.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-
|
|
2
|
-
export { PROJECT_CREATION_DENIED_REASON, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFacts, useFirmPool, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage,
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-XV7EOUQM.js';
|
|
2
|
+
export { PROJECT_CREATION_DENIED_REASON, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFacts, useFirmPool, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useTags, useThumbnails, useTopUpFirmPool, useUserUsageToday, useWorkspaceActivity, useWorkspaceUsers, useWorkspaces } from './chunk-XV7EOUQM.js';
|
|
3
|
+
import { downloadBlob } from './chunk-6JSXDLIQ.js';
|
|
4
|
+
import { parseVersionRef } from './chunk-NNWMHMEC.js';
|
|
5
|
+
export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from './chunk-NNWMHMEC.js';
|
|
6
|
+
import './chunk-WUTL62MC.js';
|
|
7
|
+
import { formatRelativeTime } from './chunk-PPRKQK4P.js';
|
|
8
|
+
export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-PPRKQK4P.js';
|
|
9
|
+
import { returnFocusToMark, MarkMenu, AiMarkdown, Card, Badge, TagEntity, Input, FILE_TYPE_COLORS, getEntityIcon, UserEntity, getEntityColorStyles, AgentBadge, Textarea, Label, Slider, DocumentEntity, DocumentCard, useAudioRecorder, MicWaveformIndicator, IconToggle, classifyMediaError, formatElapsed, PassageCard } from './chunk-J3BYHBKW.js';
|
|
10
|
+
export { AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS, Badge, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_SEGMENTER_CONFIG, DebouncedInput, DictateProvider, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, INITIAL_SEGMENTER_STATE, IconToggle, ImgIcon, InlineMicButton, Input, Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, 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, TxtIcon, UserEntity, UserMenu, VIDEO_MIME_PREFERENCE, VISIBILITY_ICONS, VerifiedBadge, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, agentAvatarColors, badgeVariants, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, flushSegmenter, formatElapsed, getDocIcon, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, levelFromRms, pickRecorderMimeType, stepSegmenter, toggleVariants, useAudioRecorder } from './chunk-J3BYHBKW.js';
|
|
11
|
+
import { MarkdownRenderer } from './chunk-C44GO33B.js';
|
|
12
|
+
export { MarkdownCode, MarkdownLink, MarkdownRenderer, MarkdownStreamingContext, markdownBaseComponents, markdownSanitizeSchema, splitMarkdownBlocks } from './chunk-C44GO33B.js';
|
|
10
13
|
import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from './chunk-YNNAJJ5Z.js';
|
|
11
14
|
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, buttonVariants } from './chunk-YNNAJJ5Z.js';
|
|
12
15
|
import { normalizeCitationMarkup } from './chunk-QRCMKEE6.js';
|
|
@@ -24,9 +27,9 @@ import React, { memo, useState, createContext, useMemo, useCallback, useEffect,
|
|
|
24
27
|
import { useQueryClient, useMutation, useQuery, onlineManager } from '@tanstack/react-query';
|
|
25
28
|
import { resolveCitations, summarizeCitations, settings, formatFileSize, connectWithReconnect, chats, identityErrorCode } from '@arbidocs/sdk/browser';
|
|
26
29
|
export { Arbi, ArbiError, DEFAULT_AI_USD_PER_GBP, formatGbp, formatGbpPerMillionTokens, usdToGbp } from '@arbidocs/sdk/browser';
|
|
27
|
-
import { Link, Trash2, CheckCheck, Check, Loader2, AlertTriangle, ShieldCheck, Copy, Sparkles, FileText, GitCompareArrows, Download, Search, CornerDownLeft, X, ArrowLeft, Send, Tags, Crown, Info, Activity, HardDrive, Gauge, Gift, PartyPopper, UserCheck, Reply, PenLine, AtSign, MessageCircleMore, FileX2, FileCheck2, Pencil, FolderPlus, SquareArrowOutUpRight, MessagesSquare, Paperclip, ArrowRight, MoreHorizontal, SquarePen, Mic, Pause, Play, Square, RotateCcw, Camera, Circle, Image as Image$1, AppWindow } from 'lucide-react';
|
|
30
|
+
import { Link, Trash2, CheckCheck, Check, Loader2, AlertTriangle, ShieldCheck, Copy, Sparkles, FileText, GitCompareArrows, Download, Search, CornerDownLeft, X, ArrowLeft, Send, Tags, Crown, Info, Activity, HardDrive, Gauge, Gift, PartyPopper, UserPlus, UserCheck, Reply, PenLine, AtSign, MessageCircleMore, FileX2, FileCheck2, Pencil, FolderPlus, SquareArrowOutUpRight, MessagesSquare, Paperclip, ArrowRight, MoreHorizontal, SquarePen, Mic, Pause, Play, Square, RotateCcw, Camera, Circle, Image as Image$1, AppWindow } from 'lucide-react';
|
|
28
31
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
29
|
-
import { isMessageType, passwordChangeErrorMessage } from '@arbidocs/client';
|
|
32
|
+
import { isMessageType, passwordChangeErrorMessage, createRecoveryFile } from '@arbidocs/client';
|
|
30
33
|
export { isMessageType } from '@arbidocs/client';
|
|
31
34
|
import { create } from 'zustand';
|
|
32
35
|
import { diffWords } from 'diff';
|
|
@@ -1636,6 +1639,91 @@ function useDeleteContact() {
|
|
|
1636
1639
|
onSuccess: () => invalidate()
|
|
1637
1640
|
});
|
|
1638
1641
|
}
|
|
1642
|
+
var AccountClientContext = createContext(null);
|
|
1643
|
+
function arbiProfile(arbi) {
|
|
1644
|
+
const profile = arbi.user.profile();
|
|
1645
|
+
return profile ? toProfileView(profile) : null;
|
|
1646
|
+
}
|
|
1647
|
+
function arbiAccountClient(arbi, overrides = {}) {
|
|
1648
|
+
return {
|
|
1649
|
+
profile: () => arbiProfile(arbi),
|
|
1650
|
+
onProfileChange: (listener) => arbi.user.onProfileChange(() => listener()),
|
|
1651
|
+
updateProfile: async (vars) => {
|
|
1652
|
+
await arbi.profile.update({
|
|
1653
|
+
...vars.givenName !== void 0 && { given_name: vars.givenName.trim() },
|
|
1654
|
+
...vars.familyName !== void 0 && { family_name: vars.familyName.trim() },
|
|
1655
|
+
...vars.picture !== void 0 && { picture: vars.picture }
|
|
1656
|
+
});
|
|
1657
|
+
},
|
|
1658
|
+
requestEmailChange: (newEmail) => arbi.account.requestEmailChange(newEmail),
|
|
1659
|
+
confirmEmailChange: async (newEmail, code) => {
|
|
1660
|
+
await arbi.account.confirmEmailChange(newEmail, code);
|
|
1661
|
+
},
|
|
1662
|
+
changePassword: (vars) => arbi.account.changePassword(vars),
|
|
1663
|
+
listSessions: () => arbi.sessions.list(),
|
|
1664
|
+
currentSessionId: () => arbi.sessions.currentId(),
|
|
1665
|
+
terminateSession: (sessionId) => arbi.sessions.terminate(sessionId),
|
|
1666
|
+
signOut: async ({ everywhere } = {}) => {
|
|
1667
|
+
if (everywhere) await arbi.sessions.logoutAll();
|
|
1668
|
+
else await arbi.logout();
|
|
1669
|
+
},
|
|
1670
|
+
requestDeletion: () => arbi.account.requestDeletion(),
|
|
1671
|
+
identity: {
|
|
1672
|
+
status: () => arbi.identity.status(),
|
|
1673
|
+
purchase: () => arbi.identity.purchase(),
|
|
1674
|
+
startSession: () => arbi.identity.startSession(),
|
|
1675
|
+
refresh: () => arbi.identity.refresh(),
|
|
1676
|
+
acceptName: () => arbi.identity.acceptName(),
|
|
1677
|
+
remove: () => arbi.identity.remove()
|
|
1678
|
+
},
|
|
1679
|
+
...overrides
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
var NO_ACCOUNT_ERROR = "The account needs an <AccountClientProvider> or an <ArbiProvider> above it";
|
|
1683
|
+
var refuse = () => Promise.reject(new Error(NO_ACCOUNT_ERROR));
|
|
1684
|
+
var NO_ACCOUNT = {
|
|
1685
|
+
client: {
|
|
1686
|
+
profile: () => null,
|
|
1687
|
+
onProfileChange: () => () => {
|
|
1688
|
+
},
|
|
1689
|
+
updateProfile: refuse,
|
|
1690
|
+
requestEmailChange: refuse,
|
|
1691
|
+
confirmEmailChange: refuse,
|
|
1692
|
+
changePassword: refuse,
|
|
1693
|
+
listSessions: refuse,
|
|
1694
|
+
currentSessionId: () => null,
|
|
1695
|
+
terminateSession: refuse,
|
|
1696
|
+
signOut: refuse,
|
|
1697
|
+
requestDeletion: refuse,
|
|
1698
|
+
identity: {
|
|
1699
|
+
status: refuse,
|
|
1700
|
+
purchase: refuse,
|
|
1701
|
+
startSession: refuse,
|
|
1702
|
+
refresh: refuse,
|
|
1703
|
+
acceptName: refuse,
|
|
1704
|
+
remove: refuse
|
|
1705
|
+
}
|
|
1706
|
+
},
|
|
1707
|
+
enabled: false
|
|
1708
|
+
};
|
|
1709
|
+
function AccountClientProvider({
|
|
1710
|
+
client,
|
|
1711
|
+
enabled = true,
|
|
1712
|
+
children
|
|
1713
|
+
}) {
|
|
1714
|
+
const value = useMemo(() => ({ client, enabled }), [client, enabled]);
|
|
1715
|
+
return /* @__PURE__ */ jsx(AccountClientContext.Provider, { value, children });
|
|
1716
|
+
}
|
|
1717
|
+
function useAccountClient() {
|
|
1718
|
+
const provided = useContext(AccountClientContext);
|
|
1719
|
+
const arbi = useContext(ArbiContext);
|
|
1720
|
+
const fallback = useMemo(() => arbi ? arbiAccountClient(arbi) : null, [arbi]);
|
|
1721
|
+
if (provided) return provided;
|
|
1722
|
+
if (!arbi || !fallback) return NO_ACCOUNT;
|
|
1723
|
+
return { client: fallback, enabled: arbi.isLoggedIn };
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
// src/account/profile.ts
|
|
1639
1727
|
function toProfileView(profile) {
|
|
1640
1728
|
return {
|
|
1641
1729
|
...profile,
|
|
@@ -1643,29 +1731,26 @@ function toProfileView(profile) {
|
|
|
1643
1731
|
};
|
|
1644
1732
|
}
|
|
1645
1733
|
function useProfile(options) {
|
|
1646
|
-
const
|
|
1734
|
+
const { client, enabled } = useAccountClient();
|
|
1735
|
+
const qc = useQueryClient();
|
|
1736
|
+
useEffect(
|
|
1737
|
+
() => client.onProfileChange(() => qc.setQueryData(arbiQueryKeys.profile(), client.profile())),
|
|
1738
|
+
[client, qc]
|
|
1739
|
+
);
|
|
1647
1740
|
return useQuery({
|
|
1648
1741
|
queryKey: arbiQueryKeys.profile(),
|
|
1649
|
-
queryFn: () =>
|
|
1650
|
-
|
|
1651
|
-
return profile ? toProfileView(profile) : null;
|
|
1652
|
-
},
|
|
1653
|
-
enabled: (options?.enabled ?? true) && arbi.isLoggedIn,
|
|
1742
|
+
queryFn: () => client.profile(),
|
|
1743
|
+
enabled: (options?.enabled ?? true) && enabled,
|
|
1654
1744
|
staleTime: Infinity
|
|
1655
1745
|
});
|
|
1656
1746
|
}
|
|
1657
1747
|
function useUpdateProfile() {
|
|
1658
|
-
const
|
|
1748
|
+
const { client } = useAccountClient();
|
|
1659
1749
|
const qc = useQueryClient();
|
|
1660
1750
|
return useMutation({
|
|
1661
1751
|
mutationFn: async (vars) => {
|
|
1662
|
-
await
|
|
1663
|
-
|
|
1664
|
-
...vars.familyName !== void 0 && { family_name: vars.familyName.trim() },
|
|
1665
|
-
...vars.picture !== void 0 && { picture: vars.picture }
|
|
1666
|
-
});
|
|
1667
|
-
const profile = arbi.user.profile();
|
|
1668
|
-
return profile ? toProfileView(profile) : null;
|
|
1752
|
+
await client.updateProfile(vars);
|
|
1753
|
+
return client.profile();
|
|
1669
1754
|
},
|
|
1670
1755
|
onSuccess: (profile) => {
|
|
1671
1756
|
qc.setQueryData(arbiQueryKeys.profile(), profile);
|
|
@@ -1743,20 +1828,17 @@ function useAvatarCrop({
|
|
|
1743
1828
|
};
|
|
1744
1829
|
}
|
|
1745
1830
|
function useRequestEmailChange() {
|
|
1746
|
-
const
|
|
1831
|
+
const { client } = useAccountClient();
|
|
1747
1832
|
return useMutation({
|
|
1748
|
-
mutationFn: (newEmail) =>
|
|
1833
|
+
mutationFn: (newEmail) => client.requestEmailChange(newEmail)
|
|
1749
1834
|
});
|
|
1750
1835
|
}
|
|
1751
1836
|
function useConfirmEmailChange() {
|
|
1752
|
-
const
|
|
1837
|
+
const { client } = useAccountClient();
|
|
1753
1838
|
const qc = useQueryClient();
|
|
1754
1839
|
return useMutation({
|
|
1755
|
-
mutationFn: ({ newEmail, code }) =>
|
|
1756
|
-
onSuccess: () =>
|
|
1757
|
-
const profile = arbi.user.profile();
|
|
1758
|
-
qc.setQueryData(arbiQueryKeys.profile(), profile ? toProfileView(profile) : null);
|
|
1759
|
-
}
|
|
1840
|
+
mutationFn: ({ newEmail, code }) => client.confirmEmailChange(newEmail, code),
|
|
1841
|
+
onSuccess: () => qc.setQueryData(arbiQueryKeys.profile(), client.profile())
|
|
1760
1842
|
});
|
|
1761
1843
|
}
|
|
1762
1844
|
function useEmailChange({
|
|
@@ -1820,9 +1902,9 @@ function useEmailChange({
|
|
|
1820
1902
|
};
|
|
1821
1903
|
}
|
|
1822
1904
|
function usePasswordChange() {
|
|
1823
|
-
const
|
|
1905
|
+
const { client } = useAccountClient();
|
|
1824
1906
|
return useMutation({
|
|
1825
|
-
mutationFn: (vars) =>
|
|
1907
|
+
mutationFn: (vars) => client.changePassword(vars)
|
|
1826
1908
|
});
|
|
1827
1909
|
}
|
|
1828
1910
|
var DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES = {
|
|
@@ -2033,24 +2115,32 @@ function useFollowThread(conversationId, options) {
|
|
|
2033
2115
|
error: save.error
|
|
2034
2116
|
};
|
|
2035
2117
|
}
|
|
2118
|
+
function useSessions(options) {
|
|
2119
|
+
const { client, enabled } = useAccountClient();
|
|
2120
|
+
return useQuery({
|
|
2121
|
+
queryKey: arbiQueryKeys.sessions(),
|
|
2122
|
+
queryFn: () => client.listSessions(),
|
|
2123
|
+
enabled: (options?.enabled ?? true) && enabled
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2036
2126
|
function useTerminateSession() {
|
|
2037
|
-
const
|
|
2127
|
+
const { client } = useAccountClient();
|
|
2038
2128
|
const qc = useQueryClient();
|
|
2039
2129
|
return useMutation({
|
|
2040
|
-
mutationFn: (sessionId) =>
|
|
2130
|
+
mutationFn: (sessionId) => client.terminateSession(sessionId),
|
|
2041
2131
|
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.sessions() })
|
|
2042
2132
|
});
|
|
2043
2133
|
}
|
|
2044
|
-
function
|
|
2045
|
-
const
|
|
2134
|
+
function useSignOut() {
|
|
2135
|
+
const { client } = useAccountClient();
|
|
2046
2136
|
const qc = useQueryClient();
|
|
2047
2137
|
return useMutation({
|
|
2048
|
-
mutationFn: () =>
|
|
2049
|
-
|
|
2138
|
+
mutationFn: (options = {}) => client.signOut(options),
|
|
2139
|
+
onSettled: () => qc.clear()
|
|
2050
2140
|
});
|
|
2051
2141
|
}
|
|
2052
2142
|
function useCurrentSessionId() {
|
|
2053
|
-
return
|
|
2143
|
+
return useAccountClient().client.currentSessionId();
|
|
2054
2144
|
}
|
|
2055
2145
|
function parseDeleteAccountBlockers(error) {
|
|
2056
2146
|
const body = error?.apiError ?? error;
|
|
@@ -2065,8 +2155,8 @@ function parseDeleteAccountBlockers(error) {
|
|
|
2065
2155
|
return [];
|
|
2066
2156
|
}
|
|
2067
2157
|
function useDeleteAccount() {
|
|
2068
|
-
const
|
|
2069
|
-
return useMutation({ mutationFn: () =>
|
|
2158
|
+
const { client } = useAccountClient();
|
|
2159
|
+
return useMutation({ mutationFn: () => client.requestDeletion() });
|
|
2070
2160
|
}
|
|
2071
2161
|
function useDeleteAccountFlow({
|
|
2072
2162
|
userEmail,
|
|
@@ -2387,22 +2477,12 @@ function useIdentityVerificationFlow(api, {
|
|
|
2387
2477
|
};
|
|
2388
2478
|
}
|
|
2389
2479
|
function useIdentityVerification(options = {}) {
|
|
2390
|
-
const
|
|
2480
|
+
const { client, enabled } = useAccountClient();
|
|
2391
2481
|
const qc = useQueryClient();
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
startSession: () => arbi.identity.startSession(),
|
|
2397
|
-
refresh: () => arbi.identity.refresh(),
|
|
2398
|
-
acceptName: () => arbi.identity.acceptName(),
|
|
2399
|
-
remove: () => arbi.identity.remove()
|
|
2400
|
-
}),
|
|
2401
|
-
[arbi]
|
|
2402
|
-
);
|
|
2403
|
-
const { onVerifiedChange, onNameAccepted } = options;
|
|
2404
|
-
return useIdentityVerificationFlow(api, {
|
|
2405
|
-
enabled: arbi.isLoggedIn,
|
|
2482
|
+
const { onVerifiedChange, onNameAccepted, formatPrice } = options;
|
|
2483
|
+
return useIdentityVerificationFlow(client.identity, {
|
|
2484
|
+
enabled,
|
|
2485
|
+
formatPrice,
|
|
2406
2486
|
onVerifiedChange: (verified) => {
|
|
2407
2487
|
void qc.invalidateQueries({ queryKey: arbiQueryKeys.profile() });
|
|
2408
2488
|
onVerifiedChange?.(verified);
|
|
@@ -2414,6 +2494,13 @@ function useIdentityVerification(options = {}) {
|
|
|
2414
2494
|
}
|
|
2415
2495
|
});
|
|
2416
2496
|
}
|
|
2497
|
+
async function downloadRecoveryFile(params) {
|
|
2498
|
+
const file = await createRecoveryFile({
|
|
2499
|
+
...params,
|
|
2500
|
+
origin: params.origin ?? window.location.origin
|
|
2501
|
+
});
|
|
2502
|
+
downloadBlob(new Blob([file.html], { type: "text/html" }), file.filename);
|
|
2503
|
+
}
|
|
2417
2504
|
|
|
2418
2505
|
// src/mail/client.ts
|
|
2419
2506
|
var MailOfflineUnavailableError = class extends Error {
|
|
@@ -4648,6 +4735,9 @@ function getNotificationTypeMeta(type) {
|
|
|
4648
4735
|
return { Icon: FileText, iconClassName: "text-primary", label: "Document" };
|
|
4649
4736
|
case "contact_accepted":
|
|
4650
4737
|
return { Icon: UserCheck, iconClassName: "text-green-500", label: "Invitation" };
|
|
4738
|
+
case "deployment_user_invited":
|
|
4739
|
+
case "deployment_user_registered":
|
|
4740
|
+
return { Icon: UserPlus, iconClassName: "text-primary", label: "Users" };
|
|
4651
4741
|
case "signup_reward":
|
|
4652
4742
|
return { Icon: PartyPopper, iconClassName: "text-green-600", label: "Signup bonus" };
|
|
4653
4743
|
case "referral_reward":
|
|
@@ -6090,12 +6180,89 @@ function CommandPaletteProvider({
|
|
|
6090
6180
|
/* @__PURE__ */ jsx(CommandPalette, { open: isOpen, onOpenChange: setIsOpen, ...paletteProps })
|
|
6091
6181
|
] });
|
|
6092
6182
|
}
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6183
|
+
|
|
6184
|
+
// src/session/store.ts
|
|
6185
|
+
var EMPTY_SESSION_STATE = {
|
|
6186
|
+
workspaceId: null,
|
|
6187
|
+
conversationId: null,
|
|
6188
|
+
viewingDocument: null,
|
|
6189
|
+
selectedDocumentIds: [],
|
|
6190
|
+
generating: {},
|
|
6191
|
+
paMode: false,
|
|
6192
|
+
conversationDocuments: {}
|
|
6193
|
+
};
|
|
6194
|
+
var selectViewingDocumentId = (state) => state.viewingDocument ? parseVersionRef(state.viewingDocument.id).docId : null;
|
|
6195
|
+
var selectIsGenerating = (conversationId) => (state) => !!conversationId && !!state.generating[conversationId]?.isGenerating;
|
|
6196
|
+
function nextViewingDocument(current, input) {
|
|
6197
|
+
if (!input) return null;
|
|
6198
|
+
const same = current?.id === input.id;
|
|
6199
|
+
return {
|
|
6200
|
+
id: input.id,
|
|
6201
|
+
page: input.page !== void 0 ? input.page : same ? current?.page ?? null : null,
|
|
6202
|
+
passageId: input.passageId !== void 0 ? input.passageId : current?.passageId ?? null
|
|
6203
|
+
};
|
|
6204
|
+
}
|
|
6205
|
+
function createArbiSessionStore(initial = {}) {
|
|
6206
|
+
let state = { ...EMPTY_SESSION_STATE, ...initial };
|
|
6207
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
6208
|
+
const update = (patch) => {
|
|
6209
|
+
state = { ...state, ...patch };
|
|
6210
|
+
listeners.forEach((listener) => listener());
|
|
6211
|
+
};
|
|
6212
|
+
return {
|
|
6213
|
+
getState: () => state,
|
|
6214
|
+
subscribe: (listener) => {
|
|
6215
|
+
listeners.add(listener);
|
|
6216
|
+
return () => listeners.delete(listener);
|
|
6217
|
+
},
|
|
6218
|
+
setWorkspaceId: (workspaceId) => {
|
|
6219
|
+
if (state.workspaceId !== workspaceId) update({ workspaceId });
|
|
6220
|
+
},
|
|
6221
|
+
setConversationId: (conversationId) => {
|
|
6222
|
+
if (state.conversationId !== conversationId) update({ conversationId });
|
|
6223
|
+
},
|
|
6224
|
+
setViewingDocument: (input) => update({ viewingDocument: nextViewingDocument(state.viewingDocument, input) }),
|
|
6225
|
+
setSelectedDocumentIds: (ids) => update({ selectedDocumentIds: ids }),
|
|
6226
|
+
setConversationGenerating: (conversationId, isGenerating) => {
|
|
6227
|
+
const current = state.generating[conversationId];
|
|
6228
|
+
update({
|
|
6229
|
+
generating: {
|
|
6230
|
+
...state.generating,
|
|
6231
|
+
[conversationId]: {
|
|
6232
|
+
isGenerating,
|
|
6233
|
+
error: isGenerating ? null : current?.error ?? null,
|
|
6234
|
+
startTime: isGenerating ? Date.now() : null
|
|
6235
|
+
}
|
|
6236
|
+
}
|
|
6237
|
+
});
|
|
6238
|
+
},
|
|
6239
|
+
setPaMode: (paMode) => {
|
|
6240
|
+
if (state.paMode !== paMode) update({ paMode });
|
|
6241
|
+
},
|
|
6242
|
+
setConversationDocuments: (conversationId, documents) => update({
|
|
6243
|
+
conversationDocuments: { ...state.conversationDocuments, [conversationId]: documents }
|
|
6244
|
+
})
|
|
6245
|
+
};
|
|
6246
|
+
}
|
|
6247
|
+
var ArbiSessionStoreContext = createContext(null);
|
|
6248
|
+
var moduleDefault = null;
|
|
6249
|
+
var defaultStore = () => moduleDefault ??= createArbiSessionStore();
|
|
6250
|
+
function ArbiSessionStateProvider({
|
|
6251
|
+
store,
|
|
6252
|
+
children
|
|
6253
|
+
}) {
|
|
6254
|
+
const enclosing = useContext(ArbiSessionStoreContext);
|
|
6255
|
+
const [own] = useState(createArbiSessionStore);
|
|
6256
|
+
return /* @__PURE__ */ jsx(ArbiSessionStoreContext.Provider, { value: store ?? enclosing ?? own, children });
|
|
6257
|
+
}
|
|
6258
|
+
function useArbiSessionStore() {
|
|
6259
|
+
return useContext(ArbiSessionStoreContext) ?? defaultStore();
|
|
6260
|
+
}
|
|
6261
|
+
function useArbiSessionState(selector) {
|
|
6262
|
+
const store = useArbiSessionStore();
|
|
6263
|
+
const select = () => selector(store.getState());
|
|
6264
|
+
return useSyncExternalStore(store.subscribe, select, select);
|
|
6265
|
+
}
|
|
6099
6266
|
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
6100
6267
|
function formatBytes(bytes) {
|
|
6101
6268
|
if (bytes == null || Number.isNaN(bytes)) return "\u2014";
|
|
@@ -6140,19 +6307,19 @@ function DocumentTable({
|
|
|
6140
6307
|
}
|
|
6141
6308
|
return map;
|
|
6142
6309
|
}, [tagsQuery.data]);
|
|
6143
|
-
const
|
|
6144
|
-
const
|
|
6145
|
-
const
|
|
6146
|
-
const
|
|
6310
|
+
const session = useArbiSessionStore();
|
|
6311
|
+
const storeSelected = useArbiSessionState((s) => s.selectedDocumentIds);
|
|
6312
|
+
const storeSetSelected = session.setSelectedDocumentIds;
|
|
6313
|
+
const viewingDocId = useArbiSessionState(selectViewingDocumentId);
|
|
6147
6314
|
const effectiveSelected = selectedIds ?? storeSelected;
|
|
6148
6315
|
const emitSelection = onSelectionChange ?? storeSetSelected;
|
|
6149
6316
|
const gridApiRef = React.useRef(null);
|
|
6150
6317
|
const openDocument = React.useCallback(
|
|
6151
6318
|
(id) => {
|
|
6152
|
-
|
|
6319
|
+
session.setViewingDocument({ id });
|
|
6153
6320
|
onOpenDocument?.(id);
|
|
6154
6321
|
},
|
|
6155
|
-
[onOpenDocument,
|
|
6322
|
+
[onOpenDocument, session]
|
|
6156
6323
|
);
|
|
6157
6324
|
const applySelection = React.useCallback(() => {
|
|
6158
6325
|
const api = gridApiRef.current;
|
|
@@ -6429,10 +6596,10 @@ function DocumentGallery({
|
|
|
6429
6596
|
);
|
|
6430
6597
|
const thumbsQuery = useThumbnails(docIds);
|
|
6431
6598
|
const thumbs = thumbsQuery.data ?? {};
|
|
6432
|
-
const
|
|
6433
|
-
const
|
|
6434
|
-
const
|
|
6435
|
-
const
|
|
6599
|
+
const session = useArbiSessionStore();
|
|
6600
|
+
const storeSelected = useArbiSessionState((s) => s.selectedDocumentIds);
|
|
6601
|
+
const storeSetSelected = session.setSelectedDocumentIds;
|
|
6602
|
+
const viewingDocId = useArbiSessionState(selectViewingDocumentId);
|
|
6436
6603
|
const effectiveSelected = selectedIds ?? storeSelected;
|
|
6437
6604
|
const emitSelection = onSelectionChange ?? storeSetSelected;
|
|
6438
6605
|
const selectedSet = React.useMemo(() => new Set(effectiveSelected), [effectiveSelected]);
|
|
@@ -6447,10 +6614,10 @@ function DocumentGallery({
|
|
|
6447
6614
|
);
|
|
6448
6615
|
const openDocument = React.useCallback(
|
|
6449
6616
|
(id) => {
|
|
6450
|
-
|
|
6617
|
+
session.setViewingDocument({ id });
|
|
6451
6618
|
onOpenDocument?.(id);
|
|
6452
6619
|
},
|
|
6453
|
-
[onOpenDocument,
|
|
6620
|
+
[onOpenDocument, session]
|
|
6454
6621
|
);
|
|
6455
6622
|
const arbi = useArbi();
|
|
6456
6623
|
const queryClient = useQueryClient();
|
|
@@ -7079,6 +7246,6 @@ function hasVideoTrack(blob) {
|
|
|
7079
7246
|
});
|
|
7080
7247
|
}
|
|
7081
7248
|
|
|
7082
|
-
export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiWebSocketProvider, ArtifactCanvas, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DraftTitleControls, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MailClientProvider, MailOfflineUnavailableError, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiMailClient, captureFrameAsBlob, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync,
|
|
7249
|
+
export { AccountClientProvider, ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiSessionStateProvider, ArbiWebSocketProvider, ArtifactCanvas, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DraftTitleControls, EMPTY_SESSION_STATE, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, MailClientProvider, MailOfflineUnavailableError, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiAccountClient, arbiMailClient, captureFrameAsBlob, createArbiSessionStore, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, downloadRecoveryFile, fileAttachment, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, nextViewingDocument, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, selectIsGenerating, selectViewingDocumentId, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useAccountClient, useActOnStep, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiSessionState, useArbiSessionStore, useArbiShellWorkspaces, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAvatarCrop, useCameraStream, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationUsage, useCreateAgent, useCreateContact, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteContact, useDeleteWorkflow, useDirectMessages, useDisconnectMailAccount, useEmailChange, useFilteredProjects, useFollowThread, useGrantAgentAccess, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useInviteContacts, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useNameEditor, useNotificationPreferences, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetTagValues, useShellWorkspaces, useSignOut, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTerminateSession, useUpdateContact, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, useWorkspaceNotificationLevel, userDisplayName, userInitials, workflowStepOf };
|
|
7083
7250
|
//# sourceMappingURL=index.js.map
|
|
7084
7251
|
//# sourceMappingURL=index.js.map
|