@arbidocs/react 0.4.106 → 0.4.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1051,6 +1051,13 @@ declare function useConversationThreads(workspaceId: string | undefined, convers
1051
1051
  name: "workflow_step";
1052
1052
  description: string;
1053
1053
  workflow_step: string;
1054
+ } | {
1055
+ name: "mail_context";
1056
+ description: string;
1057
+ tool_args: {
1058
+ mail_ext_id: string;
1059
+ reply: boolean;
1060
+ };
1054
1061
  };
1055
1062
  } | undefined;
1056
1063
  config_ext_id?: string | null | undefined;
@@ -4069,6 +4076,8 @@ interface MailMessage {
4069
4076
  message_id?: string;
4070
4077
  references: string[];
4071
4078
  attachments: MailAttachment[];
4079
+ /** Native mail: the folder it is in (`drafts` for a draft). */
4080
+ folder?: string | null;
4072
4081
  /** Native sent mail only: delivery across all recipients. */
4073
4082
  delivery_status?: MailDeliveryStatus | null;
4074
4083
  /** Native sent mail, opened message only: each recipient's latest delivery state. */
@@ -4113,6 +4122,41 @@ interface MailMessageUpdate {
4113
4122
 
4114
4123
  /** Fetch a path under `/v1/mail` with authentication; rejects a non-2xx response (`status` set). */
4115
4124
  type MailFetch = (path: string, init?: RequestInit) => Promise<Response>;
4125
+ /** Which draft body to open in the Word editor (`POST /drafts/editor`). */
4126
+ interface MailDraftEditorRequest {
4127
+ /** A saved draft (its room, or a new one seeded from it). */
4128
+ draftId?: string;
4129
+ /** A room this person already has open: a reconnect, or a new message not saved yet. */
4130
+ roomId?: string;
4131
+ /** What a new message's room starts from (a reply's quote). */
4132
+ text?: string;
4133
+ html?: string | null;
4134
+ /** The workspace open in the app: a new draft bills its project when the person may. */
4135
+ workspaceExtId?: string | null;
4136
+ }
4137
+ /** A project an email's AI work is billed to: the person's own, or a matter they own or collaborate in. */
4138
+ interface MailProject {
4139
+ external_id: string;
4140
+ name: string;
4141
+ personal: boolean;
4142
+ }
4143
+ /** A collaboration session on a draft's body: a document session's fields plus the draft. */
4144
+ interface MailDraftEditorSession {
4145
+ room_id: string;
4146
+ token: string;
4147
+ expires_in: number;
4148
+ websocket_path: string;
4149
+ can_edit: boolean;
4150
+ identity: {
4151
+ actorId: string;
4152
+ name: string;
4153
+ role: 'human' | 'agent';
4154
+ };
4155
+ filename: string;
4156
+ draft_id?: string | null;
4157
+ /** The project ARBI's work on this email is billed to. */
4158
+ project?: MailProject | null;
4159
+ }
4116
4160
  interface MailClient {
4117
4161
  fetch: MailFetch;
4118
4162
  getPolicy(): Promise<MailPolicy>;
@@ -4129,6 +4173,11 @@ interface MailClient {
4129
4173
  prepareSecureMail?(compose: MailCompose, account: MailAccount, requestId: string): Promise<unknown>;
4130
4174
  /** The URL that connects an OAuth mail provider, returning to `returnPath`. Absent: not offered. */
4131
4175
  authorizeOAuth?(vendor: string, returnPath: string): Promise<string>;
4176
+ /**
4177
+ * Open a native draft's body in the Word editor, unlocking its room for this session with the
4178
+ * person's key when the server asks (423). Absent: the composer keeps its plain rich-text body.
4179
+ */
4180
+ openDraftEditor?(request: MailDraftEditorRequest): Promise<MailDraftEditorSession>;
4132
4181
  }
4133
4182
  /** A read that needs the network and has no copy on this device (shown as a notice, not an error). */
4134
4183
  declare class MailOfflineUnavailableError extends Error {
@@ -4276,10 +4325,45 @@ declare function useSendMail(fallback?: MailDeviceFallback): _tanstack_react_que
4276
4325
  requestId: string;
4277
4326
  secure?: () => Promise<unknown>;
4278
4327
  }, unknown>;
4328
+ /**
4329
+ * A native draft's Word room (opened with `MailClient.openDraftEditor`): save it as the draft, send
4330
+ * it, or read its body. The server makes the draft's text and HTML from the room; `state` is the
4331
+ * editor's latest state, so the last keystrokes are included.
4332
+ */
4333
+ declare function useMailDraftEditor(): {
4334
+ /** Save as the draft: suggestions still waiting stay out of it. */
4335
+ save: (roomId: string, compose: MailCompose, state?: string | null) => Promise<{
4336
+ id: string;
4337
+ }>;
4338
+ /** Send (refused, `status` 409, while suggestions wait). */
4339
+ send: (roomId: string, compose: MailCompose & {
4340
+ request_id: string;
4341
+ }, state?: string | null) => Promise<{
4342
+ id: string;
4343
+ status: string;
4344
+ }>;
4345
+ /** The body as text and HTML (`final`: refused while suggestions wait). */
4346
+ body: (roomId: string, final: boolean, state?: string | null) => Promise<{
4347
+ text: string;
4348
+ html: string;
4349
+ }>;
4350
+ /** Bill ARBI's work on this email to another project the person may bill (null: their own). */
4351
+ setProject: (roomId: string, projectExtId: string | null) => Promise<MailProject>;
4352
+ };
4353
+ /** The projects an email's AI work can be billed to: the person's own first, then their matters. */
4354
+ declare function useMailProjects(options?: {
4355
+ enabled?: boolean;
4356
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailProject[]>, Error>;
4279
4357
  /** A saved draft prepared for editing by `prepare` (e.g. with its attachments' content). */
4280
4358
  declare function useMailDraftCompose(account: MailAccount | undefined, draftId: string | undefined, prepare: (account: MailAccount, draftId: string) => Promise<MailCompose>, options?: {
4281
4359
  enabled?: boolean;
4282
4360
  }): _tanstack_react_query.UseQueryResult<NoInfer<MailCompose>, Error>;
4361
+ /** Fired on `window` when a saved draft now lives under a new id (saving a native draft replaces it). */
4362
+ declare const MAIL_DRAFT_REPLACED_EVENT = "arbi:mail-draft-replaced";
4363
+ /** Announce that draft `oldId` is now `newId`: the host calls it on the server's `mail.draft_replaced`. */
4364
+ declare function announceMailDraftReplaced(oldId: string, newId: string): void;
4365
+ /** Call `onReplaced(newId)` when draft `draftId` is saved again elsewhere (by ARBI, or in another tab). */
4366
+ declare function useMailDraftReplaced(draftId: string | null | undefined, onReplaced: (newId: string) => void): void;
4283
4367
 
4284
4368
  /**
4285
4369
  * AI usage is reported in pounds (ex VAT).
@@ -6683,4 +6767,4 @@ interface ArbiUiState {
6683
6767
  }
6684
6768
  declare const useArbiUiStore: zustand.UseBoundStore<zustand.StoreApi<ArbiUiState>>;
6685
6769
 
6686
- export { type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AgentAccessMode, type AgentConfigSections, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, ArbiIcon, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, AudIcon, type AudioRecorderState, type AvatarCrop, type AvatarFileProblem, ChatBubble, type ChatBubbleProps, type Chunk, type ChunkActivation, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, type DateSeparatorProps, type DeleteAccountBlocker, type DeleteAccountFlow, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmNotification, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, DocumentGallery, type DocumentGalleryProps, DocumentReview, type DocumentReviewProps, DocumentTable, type DocumentTableProps, DraftTitleControls, type DraftTitleControlsProps, type EmailChange, type EmailPreferences, EmlIcon, EntityIconComponent, FILE_TYPE_COLORS, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HtmlIcon, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAX_AVATAR_FILE_BYTES, type MailAccount, type MailAddress, type MailAttachment, type MailClient, type MailClientContextValue, MailClientProvider, type MailClientProviderProps, type MailCompose, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailFetch, type MailFolder, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTypeMeta, OpenAIIcon, PROJECT_CREATION_DENIED_REASON, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, type RelevancePatch, type RenderMarkdown, type SaveAgentConfigVars, type SearchChunk, SemanticSearch, type SemanticSearchProps, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, type UpdateProfileVars, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, type WorkspaceNotificationLevel, XlsIcon, accountPath, aliasTakenMessage, annotateThread, arbiMailClient, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, fileAttachment, formatElapsed, formatIdentityPrice, formatRelativeTime, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isUsageMetered, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useActivity, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useAudioRecorder, useAvatarCrop, useCameraStream, useCanCreateProjects, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useCurrentUser, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDisconnectMailAccount, useDocuments, useEmailChange, useFacts, useFilteredProjects, useFollowThread, useGrantAgentAccess, useHealth, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailUnlock, useNameEditor, useNotificationPreferences, useParsedDocument, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetTagValues, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTags, useTerminateSession, useThumbnails, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceActivity, useWorkspaceDocs, useWorkspaceNotificationLevel, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, workflowStepOf };
6770
+ export { type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AgentAccessMode, type AgentConfigSections, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, ArbiIcon, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, AudIcon, type AudioRecorderState, type AvatarCrop, type AvatarFileProblem, ChatBubble, type ChatBubbleProps, type Chunk, type ChunkActivation, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, type DateSeparatorProps, type DeleteAccountBlocker, type DeleteAccountFlow, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmNotification, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, DocumentGallery, type DocumentGalleryProps, DocumentReview, type DocumentReviewProps, DocumentTable, type DocumentTableProps, DraftTitleControls, type DraftTitleControlsProps, type EmailChange, type EmailPreferences, EmlIcon, EntityIconComponent, FILE_TYPE_COLORS, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HtmlIcon, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, type MailAccount, type MailAddress, type MailAttachment, type MailClient, type MailClientContextValue, MailClientProvider, type MailClientProviderProps, type MailCompose, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailDraftEditorRequest, type MailDraftEditorSession, type MailFetch, type MailFolder, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MailProject, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTypeMeta, OpenAIIcon, PROJECT_CREATION_DENIED_REASON, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, type RelevancePatch, type RenderMarkdown, type SaveAgentConfigVars, type SearchChunk, SemanticSearch, type SemanticSearchProps, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, type UpdateProfileVars, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, type WorkspaceNotificationLevel, XlsIcon, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiMailClient, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, fileAttachment, formatElapsed, formatIdentityPrice, formatRelativeTime, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isUsageMetered, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useActivity, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useAudioRecorder, useAvatarCrop, useCameraStream, useCanCreateProjects, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useCurrentUser, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDisconnectMailAccount, useDocuments, useEmailChange, useFacts, useFilteredProjects, useFollowThread, useGrantAgentAccess, useHealth, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useNameEditor, useNotificationPreferences, useParsedDocument, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetTagValues, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTags, useTerminateSession, useThumbnails, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceActivity, useWorkspaceDocs, useWorkspaceNotificationLevel, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, workflowStepOf };
package/dist/index.d.ts CHANGED
@@ -1051,6 +1051,13 @@ declare function useConversationThreads(workspaceId: string | undefined, convers
1051
1051
  name: "workflow_step";
1052
1052
  description: string;
1053
1053
  workflow_step: string;
1054
+ } | {
1055
+ name: "mail_context";
1056
+ description: string;
1057
+ tool_args: {
1058
+ mail_ext_id: string;
1059
+ reply: boolean;
1060
+ };
1054
1061
  };
1055
1062
  } | undefined;
1056
1063
  config_ext_id?: string | null | undefined;
@@ -4069,6 +4076,8 @@ interface MailMessage {
4069
4076
  message_id?: string;
4070
4077
  references: string[];
4071
4078
  attachments: MailAttachment[];
4079
+ /** Native mail: the folder it is in (`drafts` for a draft). */
4080
+ folder?: string | null;
4072
4081
  /** Native sent mail only: delivery across all recipients. */
4073
4082
  delivery_status?: MailDeliveryStatus | null;
4074
4083
  /** Native sent mail, opened message only: each recipient's latest delivery state. */
@@ -4113,6 +4122,41 @@ interface MailMessageUpdate {
4113
4122
 
4114
4123
  /** Fetch a path under `/v1/mail` with authentication; rejects a non-2xx response (`status` set). */
4115
4124
  type MailFetch = (path: string, init?: RequestInit) => Promise<Response>;
4125
+ /** Which draft body to open in the Word editor (`POST /drafts/editor`). */
4126
+ interface MailDraftEditorRequest {
4127
+ /** A saved draft (its room, or a new one seeded from it). */
4128
+ draftId?: string;
4129
+ /** A room this person already has open: a reconnect, or a new message not saved yet. */
4130
+ roomId?: string;
4131
+ /** What a new message's room starts from (a reply's quote). */
4132
+ text?: string;
4133
+ html?: string | null;
4134
+ /** The workspace open in the app: a new draft bills its project when the person may. */
4135
+ workspaceExtId?: string | null;
4136
+ }
4137
+ /** A project an email's AI work is billed to: the person's own, or a matter they own or collaborate in. */
4138
+ interface MailProject {
4139
+ external_id: string;
4140
+ name: string;
4141
+ personal: boolean;
4142
+ }
4143
+ /** A collaboration session on a draft's body: a document session's fields plus the draft. */
4144
+ interface MailDraftEditorSession {
4145
+ room_id: string;
4146
+ token: string;
4147
+ expires_in: number;
4148
+ websocket_path: string;
4149
+ can_edit: boolean;
4150
+ identity: {
4151
+ actorId: string;
4152
+ name: string;
4153
+ role: 'human' | 'agent';
4154
+ };
4155
+ filename: string;
4156
+ draft_id?: string | null;
4157
+ /** The project ARBI's work on this email is billed to. */
4158
+ project?: MailProject | null;
4159
+ }
4116
4160
  interface MailClient {
4117
4161
  fetch: MailFetch;
4118
4162
  getPolicy(): Promise<MailPolicy>;
@@ -4129,6 +4173,11 @@ interface MailClient {
4129
4173
  prepareSecureMail?(compose: MailCompose, account: MailAccount, requestId: string): Promise<unknown>;
4130
4174
  /** The URL that connects an OAuth mail provider, returning to `returnPath`. Absent: not offered. */
4131
4175
  authorizeOAuth?(vendor: string, returnPath: string): Promise<string>;
4176
+ /**
4177
+ * Open a native draft's body in the Word editor, unlocking its room for this session with the
4178
+ * person's key when the server asks (423). Absent: the composer keeps its plain rich-text body.
4179
+ */
4180
+ openDraftEditor?(request: MailDraftEditorRequest): Promise<MailDraftEditorSession>;
4132
4181
  }
4133
4182
  /** A read that needs the network and has no copy on this device (shown as a notice, not an error). */
4134
4183
  declare class MailOfflineUnavailableError extends Error {
@@ -4276,10 +4325,45 @@ declare function useSendMail(fallback?: MailDeviceFallback): _tanstack_react_que
4276
4325
  requestId: string;
4277
4326
  secure?: () => Promise<unknown>;
4278
4327
  }, unknown>;
4328
+ /**
4329
+ * A native draft's Word room (opened with `MailClient.openDraftEditor`): save it as the draft, send
4330
+ * it, or read its body. The server makes the draft's text and HTML from the room; `state` is the
4331
+ * editor's latest state, so the last keystrokes are included.
4332
+ */
4333
+ declare function useMailDraftEditor(): {
4334
+ /** Save as the draft: suggestions still waiting stay out of it. */
4335
+ save: (roomId: string, compose: MailCompose, state?: string | null) => Promise<{
4336
+ id: string;
4337
+ }>;
4338
+ /** Send (refused, `status` 409, while suggestions wait). */
4339
+ send: (roomId: string, compose: MailCompose & {
4340
+ request_id: string;
4341
+ }, state?: string | null) => Promise<{
4342
+ id: string;
4343
+ status: string;
4344
+ }>;
4345
+ /** The body as text and HTML (`final`: refused while suggestions wait). */
4346
+ body: (roomId: string, final: boolean, state?: string | null) => Promise<{
4347
+ text: string;
4348
+ html: string;
4349
+ }>;
4350
+ /** Bill ARBI's work on this email to another project the person may bill (null: their own). */
4351
+ setProject: (roomId: string, projectExtId: string | null) => Promise<MailProject>;
4352
+ };
4353
+ /** The projects an email's AI work can be billed to: the person's own first, then their matters. */
4354
+ declare function useMailProjects(options?: {
4355
+ enabled?: boolean;
4356
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailProject[]>, Error>;
4279
4357
  /** A saved draft prepared for editing by `prepare` (e.g. with its attachments' content). */
4280
4358
  declare function useMailDraftCompose(account: MailAccount | undefined, draftId: string | undefined, prepare: (account: MailAccount, draftId: string) => Promise<MailCompose>, options?: {
4281
4359
  enabled?: boolean;
4282
4360
  }): _tanstack_react_query.UseQueryResult<NoInfer<MailCompose>, Error>;
4361
+ /** Fired on `window` when a saved draft now lives under a new id (saving a native draft replaces it). */
4362
+ declare const MAIL_DRAFT_REPLACED_EVENT = "arbi:mail-draft-replaced";
4363
+ /** Announce that draft `oldId` is now `newId`: the host calls it on the server's `mail.draft_replaced`. */
4364
+ declare function announceMailDraftReplaced(oldId: string, newId: string): void;
4365
+ /** Call `onReplaced(newId)` when draft `draftId` is saved again elsewhere (by ARBI, or in another tab). */
4366
+ declare function useMailDraftReplaced(draftId: string | null | undefined, onReplaced: (newId: string) => void): void;
4283
4367
 
4284
4368
  /**
4285
4369
  * AI usage is reported in pounds (ex VAT).
@@ -6683,4 +6767,4 @@ interface ArbiUiState {
6683
6767
  }
6684
6768
  declare const useArbiUiStore: zustand.UseBoundStore<zustand.StoreApi<ArbiUiState>>;
6685
6769
 
6686
- export { type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AgentAccessMode, type AgentConfigSections, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, ArbiIcon, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, AudIcon, type AudioRecorderState, type AvatarCrop, type AvatarFileProblem, ChatBubble, type ChatBubbleProps, type Chunk, type ChunkActivation, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, type DateSeparatorProps, type DeleteAccountBlocker, type DeleteAccountFlow, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmNotification, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, DocumentGallery, type DocumentGalleryProps, DocumentReview, type DocumentReviewProps, DocumentTable, type DocumentTableProps, DraftTitleControls, type DraftTitleControlsProps, type EmailChange, type EmailPreferences, EmlIcon, EntityIconComponent, FILE_TYPE_COLORS, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HtmlIcon, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAX_AVATAR_FILE_BYTES, type MailAccount, type MailAddress, type MailAttachment, type MailClient, type MailClientContextValue, MailClientProvider, type MailClientProviderProps, type MailCompose, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailFetch, type MailFolder, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTypeMeta, OpenAIIcon, PROJECT_CREATION_DENIED_REASON, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, type RelevancePatch, type RenderMarkdown, type SaveAgentConfigVars, type SearchChunk, SemanticSearch, type SemanticSearchProps, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, type UpdateProfileVars, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, type WorkspaceNotificationLevel, XlsIcon, accountPath, aliasTakenMessage, annotateThread, arbiMailClient, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, fileAttachment, formatElapsed, formatIdentityPrice, formatRelativeTime, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isUsageMetered, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useActivity, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useAudioRecorder, useAvatarCrop, useCameraStream, useCanCreateProjects, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useCurrentUser, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDisconnectMailAccount, useDocuments, useEmailChange, useFacts, useFilteredProjects, useFollowThread, useGrantAgentAccess, useHealth, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailUnlock, useNameEditor, useNotificationPreferences, useParsedDocument, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetTagValues, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTags, useTerminateSession, useThumbnails, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceActivity, useWorkspaceDocs, useWorkspaceNotificationLevel, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, workflowStepOf };
6770
+ export { type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AgentAccessMode, type AgentConfigSections, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, ArbiIcon, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, AudIcon, type AudioRecorderState, type AvatarCrop, type AvatarFileProblem, ChatBubble, type ChatBubbleProps, type Chunk, type ChunkActivation, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, type DateSeparatorProps, type DeleteAccountBlocker, type DeleteAccountFlow, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmNotification, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, DocumentGallery, type DocumentGalleryProps, DocumentReview, type DocumentReviewProps, DocumentTable, type DocumentTableProps, DraftTitleControls, type DraftTitleControlsProps, type EmailChange, type EmailPreferences, EmlIcon, EntityIconComponent, FILE_TYPE_COLORS, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HtmlIcon, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAIL_DRAFT_REPLACED_EVENT, MAX_AVATAR_FILE_BYTES, type MailAccount, type MailAddress, type MailAttachment, type MailClient, type MailClientContextValue, MailClientProvider, type MailClientProviderProps, type MailCompose, type MailDeliveryRecipient, type MailDeliveryStatus, type MailDeviceFallback, type MailDraftEditorRequest, type MailDraftEditorSession, type MailFetch, type MailFolder, type MailMessage, type MailMessageUpdate, MailOfflineUnavailableError, type MailPage, type MailPolicy, type MailProject, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTypeMeta, OpenAIIcon, PROJECT_CREATION_DENIED_REASON, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, type RelevancePatch, type RenderMarkdown, type SaveAgentConfigVars, type SearchChunk, SemanticSearch, type SemanticSearchProps, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, type UpdateProfileVars, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, type WorkspaceNotificationLevel, XlsIcon, accountPath, aliasTakenMessage, annotateThread, announceMailDraftReplaced, arbiMailClient, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, createMailClient, cropImage, dayKey, defaultMailAlias, describeActivity, fileAttachment, formatElapsed, formatIdentityPrice, formatRelativeTime, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isAliasTakenError, isUsageMetered, isWorkspaceNotificationType, mailDraftIdFromContent, mailJson, mailQueryKeys, mountDiditVerification, nextAliasSuggestion, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useActivity, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useAudioRecorder, useAvatarCrop, useCameraStream, useCanCreateProjects, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useCurrentUser, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDisconnectMailAccount, useDocuments, useEmailChange, useFacts, useFilteredProjects, useFollowThread, useGrantAgentAccess, useHealth, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useNameEditor, useNotificationPreferences, useParsedDocument, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSessions, useSetTagValues, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTags, useTerminateSession, useThumbnails, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceActivity, useWorkspaceDocs, useWorkspaceNotificationLevel, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, workflowStepOf };
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-IXRNX5QB.js';
2
2
  export { PROJECT_CREATION_DENIED_REASON, arbiQueryKeys, isUsageMetered, useActivity, useAgents, useAssistantQuery, useCanCreateProjects, useConfigs, useConversationThreads, useConversations, useCurrentUser, useDeleteAgents, useDocuments, useFacts, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSessions, useTags, useThumbnails, useUserUsageToday, useWorkspaceActivity, useWorkspaceUsers, useWorkspaces } from './chunk-IXRNX5QB.js';
3
3
  export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from './chunk-G6FHNURH.js';
4
+ import { formatRelativeTime } from './chunk-ECOSGMTW.js';
5
+ export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-ECOSGMTW.js';
4
6
  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-LICEKTGA.js';
5
7
  export { AgentBadge, AiMarkdown, ArbiBotHeadIcon, 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, DictateProvider, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, IconToggle, ImgIcon, InlineMicButton, Input, Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, 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, VISIBILITY_ICONS, VerifiedBadge, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, badgeVariants, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, formatElapsed, getDocIcon, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, toggleVariants, useAudioRecorder } from './chunk-LICEKTGA.js';
6
8
  import { MarkdownRenderer } from './chunk-EKRRORFO.js';
@@ -9,8 +11,6 @@ import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter
9
11
  export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, buttonVariants } from './chunk-YNNAJJ5Z.js';
10
12
  import { normalizeCitationMarkup } from './chunk-QRCMKEE6.js';
11
13
  export { closeOpenEmphasis, normalizeCitationMarkup, trimOpenCitation } from './chunk-QRCMKEE6.js';
12
- import { formatRelativeTime } from './chunk-ECOSGMTW.js';
13
- export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-ECOSGMTW.js';
14
14
  import { ScrollArea } from './chunk-W4H6XAIU.js';
15
15
  export { ScrollArea, ScrollBar } from './chunk-W4H6XAIU.js';
16
16
  import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from './chunk-47CCGUWR.js';
@@ -2723,6 +2723,47 @@ function useSendMail(fallback) {
2723
2723
  }
2724
2724
  });
2725
2725
  }
2726
+ function useMailDraftEditor() {
2727
+ const { client } = useMailClient();
2728
+ const queryClient = useQueryClient();
2729
+ return useMemo(() => {
2730
+ const call = (roomId, path, payload) => mailJson(client.fetch, `/drafts/editor/${encodeURIComponent(roomId)}${path}`, {
2731
+ method: "POST",
2732
+ body: JSON.stringify(payload)
2733
+ });
2734
+ return {
2735
+ /** Save as the draft: suggestions still waiting stay out of it. */
2736
+ save: async (roomId, compose, state) => {
2737
+ const saved = await call(roomId, "/save", { compose, state });
2738
+ void queryClient.invalidateQueries({ queryKey: mailQueryKeys.allMessages() });
2739
+ return saved;
2740
+ },
2741
+ /** Send (refused, `status` 409, while suggestions wait). */
2742
+ send: async (roomId, compose, state) => {
2743
+ const sent = await call(roomId, "/send", { compose, state });
2744
+ void queryClient.invalidateQueries({ queryKey: mailQueryKeys.all() });
2745
+ return sent;
2746
+ },
2747
+ /** The body as text and HTML (`final`: refused while suggestions wait). */
2748
+ body: (roomId, final, state) => call(roomId, "/body", { final, state }),
2749
+ /** Bill ARBI's work on this email to another project the person may bill (null: their own). */
2750
+ setProject: (roomId, projectExtId) => mailJson(
2751
+ client.fetch,
2752
+ `/drafts/editor/${encodeURIComponent(roomId)}/project`,
2753
+ { method: "PUT", body: JSON.stringify({ project_ext_id: projectExtId }) }
2754
+ )
2755
+ };
2756
+ }, [client, queryClient]);
2757
+ }
2758
+ function useMailProjects(options = {}) {
2759
+ const { client } = useMailClient();
2760
+ return useQuery({
2761
+ queryKey: ["mail", "projects"],
2762
+ queryFn: () => mailJson(client.fetch, "/drafts/editor/projects"),
2763
+ enabled: options.enabled ?? true,
2764
+ staleTime: 6e4
2765
+ });
2766
+ }
2726
2767
  function useMailDraftCompose(account, draftId, prepare, options = {}) {
2727
2768
  return useQuery({
2728
2769
  queryKey: ["mail", "draft-compose", account?.id, draftId],
@@ -2733,6 +2774,27 @@ function useMailDraftCompose(account, draftId, prepare, options = {}) {
2733
2774
  staleTime: Infinity
2734
2775
  });
2735
2776
  }
2777
+ var MAIL_DRAFT_REPLACED_EVENT = "arbi:mail-draft-replaced";
2778
+ function announceMailDraftReplaced(oldId, newId) {
2779
+ window.dispatchEvent(
2780
+ new CustomEvent(MAIL_DRAFT_REPLACED_EVENT, { detail: { oldId, newId } })
2781
+ );
2782
+ }
2783
+ function useMailDraftReplaced(draftId, onReplaced) {
2784
+ const latest = useRef(onReplaced);
2785
+ useEffect(() => {
2786
+ latest.current = onReplaced;
2787
+ });
2788
+ useEffect(() => {
2789
+ if (!draftId) return;
2790
+ const listener = (event) => {
2791
+ const { oldId, newId } = event.detail;
2792
+ if (oldId === draftId) latest.current(newId);
2793
+ };
2794
+ window.addEventListener(MAIL_DRAFT_REPLACED_EVENT, listener);
2795
+ return () => window.removeEventListener(MAIL_DRAFT_REPLACED_EVENT, listener);
2796
+ }, [draftId]);
2797
+ }
2736
2798
  function useWorkspaceDocs(workspaceId) {
2737
2799
  const { data: docs = [], isLoading, isError } = useDocuments(workspaceId);
2738
2800
  const docIds = useMemo(
@@ -6981,6 +7043,6 @@ function hasVideoTrack(blob) {
6981
7043
  });
6982
7044
  }
6983
7045
 
6984
- export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiIcon, 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, MAX_AVATAR_FILE_BYTES, MailClientProvider, MailOfflineUnavailableError, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, accountPath, aliasTakenMessage, annotateThread, 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, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAvatarCrop, useCameraStream, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationUsage, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteWorkflow, useDirectMessages, useDisconnectMailAccount, useEmailChange, useFilteredProjects, useFollowThread, useGrantAgentAccess, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailUnlock, useNameEditor, useNotificationPreferences, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSetTagValues, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTerminateSession, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, useWorkspaceNotificationLevel, userDisplayName, userInitials, workflowStepOf };
7046
+ export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiIcon, 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, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAvatarCrop, useCameraStream, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationUsage, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteWorkflow, useDirectMessages, useDisconnectMailAccount, useEmailChange, useFilteredProjects, useFollowThread, useGrantAgentAccess, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useMailAccounts, useMailCache, useMailClient, useMailDraftCompose, useMailDraftEditor, useMailDraftReplaced, useMailFolders, useMailMessage, useMailMessages, useMailOnline, useMailPolicy, useMailProjects, useMailUnlock, useNameEditor, useNotificationPreferences, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSaveMailDraft, useSemanticSearch, useSendBackStep, useSendMail, useSetTagValues, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagKindSchema, useTerminateSession, useUpdateConversation, useUpdateMailMessage, useUpdateProfile, useUpdateProjectFields, useUpdateTagKindSchema, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, useWorkspaceNotificationLevel, userDisplayName, userInitials, workflowStepOf };
6985
7047
  //# sourceMappingURL=index.js.map
6986
7048
  //# sourceMappingURL=index.js.map