@arbidocs/react 0.4.84 → 0.4.85

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
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, ComponentType } from 'react';
3
3
  import * as _arbidocs_sdk_browser from '@arbidocs/sdk/browser';
4
- import { ArbiOptions, QueryOptions, Arbi, SSEStreamResult, SSEStreamStartData, UserMessageEvent, MessageMetadataPayload, ResponseOutputItemDoneEvent, ArtifactEvent, StepActionRequest, UpdateConversationRequest, UpdateWorkflowRequest, TagMatrixSelection, TagFieldDefinition, ProjectEventKind, ProjectUpdateRequest, LoginProfile } from '@arbidocs/sdk/browser';
4
+ import { ArbiOptions, QueryOptions, Arbi, SSEStreamResult, SSEStreamStartData, UserMessageEvent, MessageMetadataPayload, ResponseOutputItemDoneEvent, ArtifactEvent, TagListQuery, StepActionRequest, UpdateConversationRequest, UpdateWorkflowRequest, TagKind, TagKindSchema, TagFieldDefinition, ProjectEventKind, ProjectUpdateRequest, LoginProfile } from '@arbidocs/sdk/browser';
5
5
  export { ActivityKind, ActivityResponse, AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, AuthMode, ConversationResponse, CreateFactRequest, CreateWorkRequest, CreateWorkflowRequest, FactResponse, FactSearchRequest, FactSearchResponse, LoginProfile, MessageMetadataPayload, OutputTokensDetails, PendingAuthResponse, PlanWorkRequest, ProjectInvoicesResponse, ProjectUsageResponse, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, SkillSummary, TaskPlan, UpdateConversationRequest, UpdateWorkflowRequest, UserDailyUsageResponse, UserInputRequestEvent, UserMessageEvent, WorkStatus, WorkflowAuthMode, WorkflowResponse, WorkflowRunResponse } from '@arbidocs/sdk/browser';
6
6
  import * as _arbidocs_client from '@arbidocs/client';
7
7
  import { WebSocketServerMessage, WsTaskUpdateMessage, WsPresenceUpdateMessage, components } from '@arbidocs/client';
@@ -538,7 +538,9 @@ declare const arbiQueryKeys: {
538
538
  conversationThreads: (workspaceId: string, conversationId: string) => readonly ["arbi", "conversations", string, "threads", string];
539
539
  tags: (workspaceId: string) => readonly ["arbi", "tags", string];
540
540
  /** Under the workspace's tags: a tag, doctag or fact write that invalidates `tags` refreshes it. */
541
- tagMatrix: (workspaceId: string, selection: string, linksLimit: number | undefined) => readonly ["arbi", "tags", string, "matrix", string, number | "default"];
541
+ tagList: (workspaceId: string, query: string) => readonly ["arbi", "tags", string, "list", string];
542
+ /** A kind's fields, under the workspace's tags. */
543
+ tagKind: (workspaceId: string, kind: string) => readonly ["arbi", "tags", string, "kind", string];
542
544
  /** Under the conversations prefix: every step action or conversation write refreshes it. */
543
545
  conversationUsage: (conversationId: string) => readonly ["arbi", "conversations", string, "usage"];
544
546
  thumbnails: (docIds: string[]) => readonly ["arbi", "thumbnails", string];
@@ -1062,8 +1064,12 @@ declare function useConversationThreads(workspaceId: string | undefined, convers
1062
1064
  }[];
1063
1065
  assistant_mode: _arbidocs_client.components["schemas"]["AssistantMode"];
1064
1066
  }>, Error>;
1065
- /** List tags in a workspace. */
1066
- declare function useTags(workspaceId: string | undefined, options?: {
1067
+ /**
1068
+ * List tags in a workspace — all of them, or filtered: `{ kind: 'issue', include: ['links'] }` is
1069
+ * every issue with its documents, facts and threads (a table's rows; its columns come from
1070
+ * `useTagKindSchema`). `ids: []` asks for nothing.
1071
+ */
1072
+ declare function useTags(workspaceId: string | undefined, options?: TagListQuery & {
1067
1073
  enabled?: boolean;
1068
1074
  }): _tanstack_react_query.UseQueryResult<NoInfer<{
1069
1075
  external_id: string;
@@ -1080,16 +1086,32 @@ declare function useTags(workspaceId: string | undefined, options?: {
1080
1086
  doctag_count: number;
1081
1087
  facttag_count: number;
1082
1088
  convotag_count: number;
1083
- fields?: {
1084
- id: string;
1085
- name: string;
1086
- type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup";
1087
- options?: string[] | null | undefined;
1088
- tag_ext_id: string;
1089
- }[] | undefined;
1090
1089
  field_values?: {
1091
1090
  [x: string]: unknown;
1092
1091
  } | undefined;
1092
+ links?: {
1093
+ docs?: {
1094
+ doc_ext_id: string;
1095
+ file_name: string;
1096
+ note?: string | null | undefined;
1097
+ citations_count: number;
1098
+ updated_at: string;
1099
+ }[] | undefined;
1100
+ facts?: {
1101
+ fact_ext_id: string;
1102
+ text: string;
1103
+ confirmed: boolean;
1104
+ updated_at: string;
1105
+ }[] | undefined;
1106
+ threads?: {
1107
+ conversation_ext_id: string;
1108
+ title?: string | null | undefined;
1109
+ updated_at: string;
1110
+ }[] | undefined;
1111
+ doc_count: number;
1112
+ fact_count: number;
1113
+ thread_count: number;
1114
+ } | null | undefined;
1093
1115
  created_by_ext_id: string;
1094
1116
  updated_by_ext_id?: string | null | undefined;
1095
1117
  created_at: string;
@@ -2559,30 +2581,27 @@ declare function useStartAgentSession(): _tanstack_react_query.UseMutationResult
2559
2581
  }, unknown>;
2560
2582
  declare function useCloseAgentSession(): _tanstack_react_query.UseMutationResult<void, Error, string, unknown>;
2561
2583
 
2562
- /** Refresh what a tag, doctag or fact change affects: the workspace's tags, matrix and facts. */
2584
+ /** Refresh what a tag, doctag or fact change affects: the workspace's tags, tables and facts. */
2563
2585
  declare function invalidateTagData(qc: QueryClient, workspaceId: string): Promise<unknown>;
2564
2586
  /** {@link invalidateTagData} for the open workspace: call it after a doctag or fact write. */
2565
2587
  declare function useInvalidateTagData(): () => Promise<unknown>;
2566
2588
  /**
2567
- * The tag matrix of the open workspace: a parent's children (`{parentId}`) or the given tags
2568
- * (`{tagIds}`), each row with its field values, up to `linksLimit` documents and facts, and their
2569
- * counts. With a parent, `data.parent.fields` are the shared columns (see the SDK's
2570
- * `tags.tagMatrixColumns`). Disabled while `selection` is empty.
2589
+ * A kind's fields in the open workspace (`'issue'`: its issue fields): the columns of a table of
2590
+ * that kind's tags. The built-in ones (`is_default`) until the workspace sets its own.
2571
2591
  */
2572
- declare function useTagMatrix(selection: TagMatrixSelection | null | undefined, options?: {
2573
- linksLimit?: number;
2592
+ declare function useTagKindSchema(kind: TagKind | null | undefined, options?: {
2574
2593
  enabled?: boolean;
2575
- }): _tanstack_react_query.UseQueryResult<NoInfer<{
2576
- rows?: _arbidocs_client.components["schemas"]["TagMatrixRow"][];
2577
- parent?: _arbidocs_client.components["schemas"]["TagResponse"] | null;
2578
- links_limit: number;
2579
- }>, Error>;
2594
+ }): _tanstack_react_query.UseQueryResult<NoInfer<TagKindSchema>, Error>;
2580
2595
  /**
2581
- * Change a tag's fields: `fields` replaces its own field definitions (keep a field's `id` to keep
2582
- * its values), `values` merge-patches its values (`null` clears one). The workspace's tags and
2583
- * every matrix refresh.
2596
+ * Set a kind's fields in full (a field with its `id` keeps its values; one without is new; one
2597
+ * left out is removed). The kind's schema and the workspace's tags refresh.
2584
2598
  */
2585
- declare function useUpdateTagFields(): _tanstack_react_query.UseMutationResult<{
2599
+ declare function useUpdateTagKindSchema(): _tanstack_react_query.UseMutationResult<TagKindSchema, Error, {
2600
+ kind: TagKind;
2601
+ fields: TagFieldDefinition[];
2602
+ }, unknown>;
2603
+ /** Merge-patch a tag's values for its kind's fields (`null` clears one); its tables refresh. */
2604
+ declare function useSetTagValues(): _tanstack_react_query.UseMutationResult<{
2586
2605
  external_id: string;
2587
2606
  workspace_ext_id: string;
2588
2607
  name: string;
@@ -2594,18 +2613,17 @@ declare function useUpdateTagFields(): _tanstack_react_query.UseMutationResult<{
2594
2613
  doctag_count: number;
2595
2614
  facttag_count: number;
2596
2615
  convotag_count: number;
2597
- fields?: _arbidocs_client.components["schemas"]["TagField"][];
2598
2616
  field_values?: {
2599
2617
  [key: string]: unknown;
2600
2618
  };
2619
+ links?: _arbidocs_client.components["schemas"]["TagLinks"] | null;
2601
2620
  created_by_ext_id: string;
2602
2621
  updated_by_ext_id?: string | null;
2603
2622
  created_at: string;
2604
2623
  updated_at: string;
2605
2624
  }, Error, {
2606
2625
  tagId: string;
2607
- fields?: TagFieldDefinition[];
2608
- values?: Record<string, unknown>;
2626
+ values: Record<string, unknown>;
2609
2627
  }, unknown>;
2610
2628
 
2611
2629
  /** The caller's projects at `stage` and/or led by `leadUser` (`usr-…`). */
@@ -3718,6 +3736,9 @@ declare function useUserSettings(options?: {
3718
3736
  use_s3_direct_upload: boolean;
3719
3737
  hide_online_status: boolean;
3720
3738
  muted_users: string[];
3739
+ muted_workspaces: string[];
3740
+ followed_workspaces: string[];
3741
+ followed_threads: string[];
3721
3742
  email_notifications?: {
3722
3743
  messages: boolean;
3723
3744
  workspace_added: boolean;
@@ -3873,6 +3894,285 @@ interface MountDiditOptions {
3873
3894
  /** Start the embedded verification. Resolves with a teardown; rejects if the SDK can't load. */
3874
3895
  declare function mountDiditVerification({ url, containerId, onResult, }: MountDiditOptions): Promise<() => void>;
3875
3896
 
3897
+ /**
3898
+ * The mail shapes the hooks and the mail blocks work with: what `/v1/mail` returns, with the
3899
+ * fields the server always fills required and arrays never missing.
3900
+ */
3901
+ interface MailPolicy {
3902
+ native_enabled: boolean;
3903
+ native_domain: string;
3904
+ enabled: boolean;
3905
+ enabled_providers: string[];
3906
+ oauth_providers: string[];
3907
+ server_profiles: {
3908
+ id: string;
3909
+ name: string;
3910
+ provider: string;
3911
+ }[];
3912
+ max_attachment_bytes: number;
3913
+ }
3914
+ interface MailAccount {
3915
+ id: string;
3916
+ provider: string;
3917
+ email: string;
3918
+ display_name: string;
3919
+ profile_id?: string;
3920
+ needs_reconsent: boolean;
3921
+ }
3922
+ interface MailFolder {
3923
+ id: string;
3924
+ name: string;
3925
+ role?: string;
3926
+ unread: number;
3927
+ }
3928
+ interface MailAddress {
3929
+ email: string;
3930
+ name?: string;
3931
+ }
3932
+ interface MailAttachment {
3933
+ id: string;
3934
+ name: string;
3935
+ content_type: string;
3936
+ size: number;
3937
+ content_base64?: string | null;
3938
+ }
3939
+ type MailDeliveryStatus = 'sent' | 'delivered' | 'delayed' | 'partially_bounced' | 'bounced';
3940
+ interface MailDeliveryRecipient {
3941
+ email: string;
3942
+ status: 'accepted' | 'rejected' | 'delayed' | 'failed' | 'delivered' | 'relayed' | 'expanded';
3943
+ code?: string | null;
3944
+ /** Plain words from the server, e.g. "The address doesn't exist". */
3945
+ description: string;
3946
+ updated_at: string;
3947
+ }
3948
+ interface MailMessage {
3949
+ secure_delivery?: boolean;
3950
+ id: string;
3951
+ subject: string;
3952
+ sender: MailAddress[];
3953
+ to: MailAddress[];
3954
+ cc: MailAddress[];
3955
+ bcc: MailAddress[];
3956
+ received_at?: string;
3957
+ preview: string;
3958
+ unread: boolean;
3959
+ text: string;
3960
+ html?: string;
3961
+ message_id?: string;
3962
+ references: string[];
3963
+ attachments: MailAttachment[];
3964
+ /** Native sent mail only: delivery across all recipients. */
3965
+ delivery_status?: MailDeliveryStatus | null;
3966
+ /** Native sent mail, opened message only: each recipient's latest delivery state. */
3967
+ delivery?: MailDeliveryRecipient[];
3968
+ }
3969
+ /** One page of a folder. */
3970
+ interface MailPage {
3971
+ messages: MailMessage[];
3972
+ next_cursor?: string;
3973
+ /** Answered from this device (offline), when the host keeps mail offline. */
3974
+ fromDevice?: boolean;
3975
+ }
3976
+ /** A message being written: new, a reply or forward, or a saved draft (`draft_id`). */
3977
+ interface MailCompose {
3978
+ html?: string;
3979
+ secure_delivery?: boolean;
3980
+ to: MailAddress[];
3981
+ cc: MailAddress[];
3982
+ bcc: MailAddress[];
3983
+ subject: string;
3984
+ text: string;
3985
+ attachments: MailAttachment[];
3986
+ draft_id?: string;
3987
+ in_reply_to?: string;
3988
+ references?: string[];
3989
+ }
3990
+ /** Mark read or unread, move to a folder, or send to Trash. */
3991
+ interface MailMessageUpdate {
3992
+ unread?: boolean;
3993
+ folder_id?: string;
3994
+ action?: string;
3995
+ }
3996
+
3997
+ /**
3998
+ * The mail client the hooks and the mail blocks talk to.
3999
+ *
4000
+ * A {@link MailClient} is a transport (`fetch` under `/v1/mail`) plus the reads the screens make.
4001
+ * {@link createMailClient} builds one from any transport; {@link arbiMailClient} builds the default
4002
+ * one from an `Arbi` (used when no `MailClientProvider` is above). A host that keeps mail offline,
4003
+ * bridges connector tokens or sends secure mail passes its own reads and extras as overrides.
4004
+ */
4005
+
4006
+ /** Fetch a path under `/v1/mail` with authentication; rejects a non-2xx response (`status` set). */
4007
+ type MailFetch = (path: string, init?: RequestInit) => Promise<Response>;
4008
+ interface MailClient {
4009
+ fetch: MailFetch;
4010
+ getPolicy(): Promise<MailPolicy>;
4011
+ listAccounts(): Promise<MailAccount[]>;
4012
+ listFolders(account: MailAccount): Promise<MailFolder[]>;
4013
+ listMessages(account: MailAccount, folderId: string, query: string, cursor: string | null): Promise<MailPage>;
4014
+ getMessage(account: MailAccount, messageId: string): Promise<MailMessage>;
4015
+ /** Hand this session what the server needs to read the account (keys, credentials). */
4016
+ unlock(account: MailAccount): Promise<void>;
4017
+ /**
4018
+ * The encrypted payload for `/secure/send` (native mail only). Absent: secure delivery is not
4019
+ * offered.
4020
+ */
4021
+ prepareSecureMail?(compose: MailCompose, account: MailAccount, requestId: string): Promise<unknown>;
4022
+ /** The URL that connects an OAuth mail provider, returning to `returnPath`. Absent: not offered. */
4023
+ authorizeOAuth?(vendor: string, returnPath: string): Promise<string>;
4024
+ }
4025
+ /** A read that needs the network and has no copy on this device (shown as a notice, not an error). */
4026
+ declare class MailOfflineUnavailableError extends Error {
4027
+ constructor(message: string);
4028
+ }
4029
+ declare function accountPath(id: string): string;
4030
+ /** A JSON mail call: the parsed body, or `undefined` for 204. */
4031
+ declare function mailJson<T>(fetch: MailFetch, path: string, init?: RequestInit): Promise<T>;
4032
+ /** A client over `fetch`; `overrides` replace any of its reads or add the optional extras. */
4033
+ declare function createMailClient(fetch: MailFetch, overrides?: Partial<MailClient>): MailClient;
4034
+ /**
4035
+ * The default client: the `Arbi` session's mail transport. The native inbox is unlocked with the
4036
+ * signed-in user's keys before each read (so mail that arrived since is readable too); a connected
4037
+ * account needs no unlock from here.
4038
+ */
4039
+ declare function arbiMailClient(arbi: Arbi): MailClient;
4040
+ /** A picked file as an attachment (its content base64-encoded). */
4041
+ declare function fileAttachment(file: File): Promise<MailAttachment>;
4042
+ /** The address suggested for a user's native inbox: given name and family name, lowercase ASCII, dot-joined. */
4043
+ declare function defaultMailAlias(user?: {
4044
+ given_name?: string | null;
4045
+ family_name?: string | null;
4046
+ } | null): string;
4047
+ /**
4048
+ * The alias to try after `alias` is taken: `grace.okoye` → `grace.okoye2`, `grace.okoye2` → `grace.okoye3`.
4049
+ * The server is the only judge of availability, so this is a guess to offer, not a promise.
4050
+ */
4051
+ declare function nextAliasSuggestion(alias: string): string;
4052
+ /** True when the claim failed because the address is already in use (HTTP 409). */
4053
+ declare function isAliasTakenError(err: Error): boolean;
4054
+ /**
4055
+ * Shown after `alias` is taken. The suggestion is unverified, so the copy must not say it is free:
4056
+ * the server only checks availability when the user confirms the claim.
4057
+ */
4058
+ declare function aliasTakenMessage(alias: string, suggestion: string, domain: string): string;
4059
+ /** The draft a `mail_draft_ready` notification is about (its content is `{"mail_id": …}`). */
4060
+ declare function mailDraftIdFromContent(content: string | null | undefined): string | undefined;
4061
+
4062
+ interface MailClientContextValue {
4063
+ client: MailClient;
4064
+ /** Mail reads run only while this is true (signed in). */
4065
+ enabled: boolean;
4066
+ /**
4067
+ * Identifies the server session the mailbox is unlocked for: unlocking runs again when it
4068
+ * changes. `null`: no session yet, so nothing is unlocked.
4069
+ */
4070
+ sessionKey: string | null;
4071
+ }
4072
+ interface MailClientProviderProps extends Partial<Omit<MailClientContextValue, 'client'>> {
4073
+ client: MailClient;
4074
+ children: ReactNode;
4075
+ }
4076
+ /**
4077
+ * The mail client for the mail hooks and blocks below. Without one, they use the nearest
4078
+ * `ArbiProvider`'s session (`arbiMailClient`).
4079
+ */
4080
+ declare function MailClientProvider({ client, enabled, sessionKey, children, }: MailClientProviderProps): React$1.JSX.Element;
4081
+ /** The mail client in scope: a `MailClientProvider`'s, else the `ArbiProvider` session's. */
4082
+ declare function useMailClient(): MailClientContextValue;
4083
+
4084
+ declare const mailQueryKeys: {
4085
+ all: () => readonly ["mail"];
4086
+ policy: () => readonly ["mail", "policy"];
4087
+ accounts: () => readonly ["mail", "accounts"];
4088
+ unlock: (accountId: string | undefined, sessionKey: string | null) => readonly ["mail", "unlock", string | undefined, string];
4089
+ allFolders: () => readonly ["mail", "folders"];
4090
+ folders: (accountId: string | undefined) => readonly ["mail", "folders", string | undefined];
4091
+ allMessages: () => readonly ["mail", "messages"];
4092
+ messages: (accountId: string | undefined, folderId: string | undefined, query: string, cursor: string | null) => readonly ["mail", "messages", string | undefined, string | undefined, string, string | null];
4093
+ message: (accountId: string | undefined, messageId: string | null | undefined) => readonly ["mail", "message", string | undefined, string | null | undefined];
4094
+ };
4095
+ /** Whether the app is online (React Query's `onlineManager`). */
4096
+ declare function useMailOnline(): boolean;
4097
+ /** What the deployment allows: native mail, OAuth providers, mail servers, the attachment limit. */
4098
+ declare function useMailPolicy(): _tanstack_react_query.UseQueryResult<NoInfer<MailPolicy>, Error>;
4099
+ declare function useMailAccounts(options?: {
4100
+ enabled?: boolean;
4101
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailAccount[]>, Error>;
4102
+ /**
4103
+ * Unlock `account` for this session. It waits for a connection (offline, a host that keeps mail on
4104
+ * the device reads from there and queues sends), then runs once per session.
4105
+ */
4106
+ declare function useMailUnlock(account: MailAccount | undefined): _tanstack_react_query.UseQueryResult<boolean, Error>;
4107
+ declare function useMailFolders(account: MailAccount | undefined, options: {
4108
+ enabled?: boolean;
4109
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailFolder[]>, Error>;
4110
+ /** One page of a folder, filtered by `query`, from `cursor` (`null`: the first page). */
4111
+ declare function useMailMessages(account: MailAccount | undefined, folderId: string | undefined, query: string, cursor: string | null, options?: {
4112
+ enabled?: boolean;
4113
+ refetchInterval?: number;
4114
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailPage>, Error>;
4115
+ declare function useMailMessage(account: MailAccount | undefined, messageId: string | null | undefined, options?: {
4116
+ enabled?: boolean;
4117
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailMessage>, Error>;
4118
+ /** Claim `alias@<deployment domain>` as the user's native inbox, then refresh everything mail. */
4119
+ declare function useClaimNativeAlias(onClaimed?: (alias: string) => void): _tanstack_react_query.UseMutationResult<unknown, Error, string, unknown>;
4120
+ /** Connect a mailbox on one of the deployment's approved mail servers. */
4121
+ declare function useConnectMailAccount(): _tanstack_react_query.UseMutationResult<unknown, Error, {
4122
+ profileId: string;
4123
+ email: string;
4124
+ username: string;
4125
+ password: string;
4126
+ }, unknown>;
4127
+ declare function useDisconnectMailAccount(): _tanstack_react_query.UseMutationResult<unknown, Error, string, unknown>;
4128
+ /** Refresh mail reads after a write the hooks below don't cover. */
4129
+ declare function useMailCache(): {
4130
+ refreshAll: () => Promise<void>;
4131
+ refreshFolders: () => Promise<void>;
4132
+ /** After a write to one message: drop a read of it still in flight (it may carry the old state), then refresh. */
4133
+ settleMessage: (accountId: string, messageId: string) => Promise<void>;
4134
+ };
4135
+ /** Mark a message read or unread, move it, or send it to Trash. The caller refreshes (`useMailCache`). */
4136
+ declare function useUpdateMailMessage(): _tanstack_react_query.UseMutationResult<unknown, Error, {
4137
+ accountId: string;
4138
+ messageId: string;
4139
+ update: MailMessageUpdate;
4140
+ }, unknown>;
4141
+ /** Where a message goes when the server can't be reached: kept on the device (a host option). */
4142
+ interface MailDeviceFallback {
4143
+ /** Keep it on the device; called offline, or when the request got no answer. */
4144
+ keep: (compose: MailCompose) => Promise<void>;
4145
+ /** The request got no answer (no connection), as opposed to the server refusing it. */
4146
+ isNetworkFailure: (error: unknown) => boolean;
4147
+ }
4148
+ /**
4149
+ * Save a draft to the account's Drafts. With `fallback`, offline (or with no answer) it is kept on
4150
+ * the device instead (`{ onDevice: true }`).
4151
+ */
4152
+ declare function useSaveMailDraft(fallback?: MailDeviceFallback): _tanstack_react_query.UseMutationResult<{
4153
+ onDevice: true;
4154
+ } | {
4155
+ id: string;
4156
+ }, Error, {
4157
+ accountId: string;
4158
+ compose: MailCompose;
4159
+ }, unknown>;
4160
+ /**
4161
+ * Send a message. `requestId` makes it idempotent: sending the same request again never sends twice.
4162
+ * `secure` sends it by secure delivery instead (resolves with the prepared payload). With
4163
+ * `fallback`, offline (or with no answer) it waits on the device (`{ onDevice: true }`).
4164
+ */
4165
+ declare function useSendMail(fallback?: MailDeviceFallback): _tanstack_react_query.UseMutationResult<unknown, Error, {
4166
+ accountId: string;
4167
+ compose: MailCompose;
4168
+ requestId: string;
4169
+ secure?: () => Promise<unknown>;
4170
+ }, unknown>;
4171
+ /** A saved draft prepared for editing by `prepare` (e.g. with its attachments' content). */
4172
+ declare function useMailDraftCompose(account: MailAccount | undefined, draftId: string | undefined, prepare: (account: MailAccount, draftId: string) => Promise<MailCompose>, options?: {
4173
+ enabled?: boolean;
4174
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailCompose>, Error>;
4175
+
3876
4176
  /**
3877
4177
  * Credits: the unit the ARBI backend reports AI usage in.
3878
4178
  *
@@ -6290,4 +6590,4 @@ interface ArbiUiState {
6290
6590
  }
6291
6591
  declare const useArbiUiStore: zustand.UseBoundStore<zustand.StoreApi<ArbiUiState>>;
6292
6592
 
6293
- 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, DEFAULT_USD_PER_CREDIT, 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, type FormatCreditsOptions, 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 MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTypeMeta, OpenAIIcon, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeResult, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, 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, XlsIcon, annotateThread, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, creditsToUsd, cropImage, dayKey, describeActivity, formatCredits, formatElapsed, formatIdentityPrice, formatRelativeTime, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isUsageMetered, isWorkspaceNotificationType, mountDiditVerification, 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, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDocuments, useEmailChange, useFacts, useFilteredProjects, useGrantAgentAccess, useHealth, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useNameEditor, useNotificationPreferences, useParsedDocument, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSemanticSearch, useSendBackStep, useSessions, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagMatrix, useTags, useTerminateSession, useThumbnails, useUpdateConversation, useUpdateProfile, useUpdateProjectFields, useUpdateTagFields, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, workflowStepOf };
6593
+ 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, DEFAULT_USD_PER_CREDIT, 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, type FormatCreditsOptions, 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, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeResult, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, 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, XlsIcon, accountPath, aliasTakenMessage, annotateThread, arbiMailClient, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, createMailClient, creditsToUsd, cropImage, dayKey, defaultMailAlias, describeActivity, fileAttachment, formatCredits, 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, useClaimNativeAlias, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useConnectMailAccount, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDisconnectMailAccount, useDocuments, useEmailChange, useFacts, useFilteredProjects, 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, useWorkspaceDocs, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, workflowStepOf };