@arbidocs/react 0.4.84 → 0.4.86

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-…`). */
@@ -3587,28 +3605,21 @@ interface EmailChange {
3587
3605
  declare function useEmailChange({ requestCode, confirm, cooldownSeconds: cooldownLength, }: UseEmailChangeOptions): EmailChange;
3588
3606
 
3589
3607
  /**
3590
- * Password change: re-key the account under a new master password.
3608
+ * Password change: a new master password for the same account identity.
3591
3609
  *
3592
- * `usePasswordChange` is the SDK-bound mutation (re-wraps every workspace key and re-encrypts
3593
- * direct messages, see `Arbi.account.changePassword`). `usePasswordChangeForm` is the controller
3594
- * behind `PasswordChangeDialog`: fields, validation, error wording, the success state that hands
3595
- * over the new recovery key. It takes the submit as a function, so an app without an
3596
- * `ArbiProvider` binds the same dialog.
3610
+ * The password only wraps the identity keypair, so a change is one request that re-encrypts nothing
3611
+ * and leaves the recovery key as it was (see `Arbi.account.changePassword`). `usePasswordChange` is
3612
+ * the SDK-bound mutation. `usePasswordChangeForm` is the controller behind `PasswordChangeDialog`:
3613
+ * fields, validation, error wording and the success state. It takes the submit as a function, so an
3614
+ * app without an `ArbiProvider` binds the same dialog.
3597
3615
  */
3598
- /** What a finished password change reports. */
3599
- interface PasswordChangeResult {
3600
- /** The new Ed25519 signing key: its recovery file is what the user should save now. */
3601
- newSigningPrivateKey: Uint8Array;
3602
- workspacesUpdated: number;
3603
- messagesReEncrypted: number;
3604
- }
3605
3616
  interface PasswordChangeVars {
3606
3617
  newPassword: string;
3607
3618
  /** Omit in recovery mode (after signing in with a recovery key). */
3608
3619
  currentPassword?: string;
3609
3620
  }
3610
3621
  /** Change (or, in recovery mode, set) the master password. Needs an `ArbiProvider`. */
3611
- declare function usePasswordChange(): _tanstack_react_query.UseMutationResult<PasswordChangeResult, Error, PasswordChangeVars, unknown>;
3622
+ declare function usePasswordChange(): _tanstack_react_query.UseMutationResult<void, Error, PasswordChangeVars, unknown>;
3612
3623
  interface PasswordChangeFormMessages {
3613
3624
  required: string;
3614
3625
  mismatch: string;
@@ -3617,20 +3628,20 @@ interface PasswordChangeFormMessages {
3617
3628
  wrongRecoveryKey: string;
3618
3629
  }
3619
3630
  declare const DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES: PasswordChangeFormMessages;
3620
- interface UsePasswordChangeFormOptions<R> {
3631
+ interface UsePasswordChangeFormOptions {
3621
3632
  /** After recovery with a key: no current password is asked for. */
3622
3633
  recoveryMode?: boolean;
3623
3634
  /** The host's password policy: the first unmet requirement, or `null` when the password is fine. */
3624
3635
  getUnmetRequirement: (password: string) => string | null;
3625
- /** Do the change. Resolve with whatever the success state needs (the new signing key). */
3626
- submit: (vars: PasswordChangeVars) => Promise<R>;
3636
+ /** Do the change. */
3637
+ submit: (vars: PasswordChangeVars) => Promise<void>;
3627
3638
  /** The dialog should close (cancel, or done). */
3628
3639
  onClose: () => void;
3629
3640
  /** Recovery finished: continue into the app. Recovery closes itself, with no success screen. */
3630
3641
  onRecoveryComplete?: () => void;
3631
3642
  messages?: Partial<PasswordChangeFormMessages>;
3632
3643
  }
3633
- interface PasswordChangeForm<R> {
3644
+ interface PasswordChangeForm {
3634
3645
  currentPassword: string;
3635
3646
  onCurrentPasswordChange: (value: string) => void;
3636
3647
  newPassword: string;
@@ -3641,15 +3652,15 @@ interface PasswordChangeForm<R> {
3641
3652
  isProcessing: boolean;
3642
3653
  isSubmitDisabled: boolean;
3643
3654
  onSubmit: () => void;
3644
- /** The outcome once the change went through (normal mode); render the recovery key from it. */
3645
- result: R | null;
3655
+ /** The change went through (normal mode): the dialog shows its success state. */
3656
+ isChanged: boolean;
3646
3657
  /** Cancel and clear the form. */
3647
3658
  onCancel: () => void;
3648
3659
  /** Leave the success screen. */
3649
3660
  onDone: () => void;
3650
3661
  }
3651
3662
  /** The state machine of `PasswordChangeDialog`; spread it into the dialog's props. */
3652
- declare function usePasswordChangeForm<R>({ recoveryMode, getUnmetRequirement, submit, onClose, onRecoveryComplete, messages, }: UsePasswordChangeFormOptions<R>): PasswordChangeForm<R>;
3663
+ declare function usePasswordChangeForm({ recoveryMode, getUnmetRequirement, submit, onClose, onRecoveryComplete, messages, }: UsePasswordChangeFormOptions): PasswordChangeForm;
3653
3664
 
3654
3665
  /**
3655
3666
  * Notification preferences: which email categories the user wants (the `email_notifications`
@@ -3718,6 +3729,9 @@ declare function useUserSettings(options?: {
3718
3729
  use_s3_direct_upload: boolean;
3719
3730
  hide_online_status: boolean;
3720
3731
  muted_users: string[];
3732
+ muted_workspaces: string[];
3733
+ followed_workspaces: string[];
3734
+ followed_threads: string[];
3721
3735
  email_notifications?: {
3722
3736
  messages: boolean;
3723
3737
  workspace_added: boolean;
@@ -3873,6 +3887,285 @@ interface MountDiditOptions {
3873
3887
  /** Start the embedded verification. Resolves with a teardown; rejects if the SDK can't load. */
3874
3888
  declare function mountDiditVerification({ url, containerId, onResult, }: MountDiditOptions): Promise<() => void>;
3875
3889
 
3890
+ /**
3891
+ * The mail shapes the hooks and the mail blocks work with: what `/v1/mail` returns, with the
3892
+ * fields the server always fills required and arrays never missing.
3893
+ */
3894
+ interface MailPolicy {
3895
+ native_enabled: boolean;
3896
+ native_domain: string;
3897
+ enabled: boolean;
3898
+ enabled_providers: string[];
3899
+ oauth_providers: string[];
3900
+ server_profiles: {
3901
+ id: string;
3902
+ name: string;
3903
+ provider: string;
3904
+ }[];
3905
+ max_attachment_bytes: number;
3906
+ }
3907
+ interface MailAccount {
3908
+ id: string;
3909
+ provider: string;
3910
+ email: string;
3911
+ display_name: string;
3912
+ profile_id?: string;
3913
+ needs_reconsent: boolean;
3914
+ }
3915
+ interface MailFolder {
3916
+ id: string;
3917
+ name: string;
3918
+ role?: string;
3919
+ unread: number;
3920
+ }
3921
+ interface MailAddress {
3922
+ email: string;
3923
+ name?: string;
3924
+ }
3925
+ interface MailAttachment {
3926
+ id: string;
3927
+ name: string;
3928
+ content_type: string;
3929
+ size: number;
3930
+ content_base64?: string | null;
3931
+ }
3932
+ type MailDeliveryStatus = 'sent' | 'delivered' | 'delayed' | 'partially_bounced' | 'bounced';
3933
+ interface MailDeliveryRecipient {
3934
+ email: string;
3935
+ status: 'accepted' | 'rejected' | 'delayed' | 'failed' | 'delivered' | 'relayed' | 'expanded';
3936
+ code?: string | null;
3937
+ /** Plain words from the server, e.g. "The address doesn't exist". */
3938
+ description: string;
3939
+ updated_at: string;
3940
+ }
3941
+ interface MailMessage {
3942
+ secure_delivery?: boolean;
3943
+ id: string;
3944
+ subject: string;
3945
+ sender: MailAddress[];
3946
+ to: MailAddress[];
3947
+ cc: MailAddress[];
3948
+ bcc: MailAddress[];
3949
+ received_at?: string;
3950
+ preview: string;
3951
+ unread: boolean;
3952
+ text: string;
3953
+ html?: string;
3954
+ message_id?: string;
3955
+ references: string[];
3956
+ attachments: MailAttachment[];
3957
+ /** Native sent mail only: delivery across all recipients. */
3958
+ delivery_status?: MailDeliveryStatus | null;
3959
+ /** Native sent mail, opened message only: each recipient's latest delivery state. */
3960
+ delivery?: MailDeliveryRecipient[];
3961
+ }
3962
+ /** One page of a folder. */
3963
+ interface MailPage {
3964
+ messages: MailMessage[];
3965
+ next_cursor?: string;
3966
+ /** Answered from this device (offline), when the host keeps mail offline. */
3967
+ fromDevice?: boolean;
3968
+ }
3969
+ /** A message being written: new, a reply or forward, or a saved draft (`draft_id`). */
3970
+ interface MailCompose {
3971
+ html?: string;
3972
+ secure_delivery?: boolean;
3973
+ to: MailAddress[];
3974
+ cc: MailAddress[];
3975
+ bcc: MailAddress[];
3976
+ subject: string;
3977
+ text: string;
3978
+ attachments: MailAttachment[];
3979
+ draft_id?: string;
3980
+ in_reply_to?: string;
3981
+ references?: string[];
3982
+ }
3983
+ /** Mark read or unread, move to a folder, or send to Trash. */
3984
+ interface MailMessageUpdate {
3985
+ unread?: boolean;
3986
+ folder_id?: string;
3987
+ action?: string;
3988
+ }
3989
+
3990
+ /**
3991
+ * The mail client the hooks and the mail blocks talk to.
3992
+ *
3993
+ * A {@link MailClient} is a transport (`fetch` under `/v1/mail`) plus the reads the screens make.
3994
+ * {@link createMailClient} builds one from any transport; {@link arbiMailClient} builds the default
3995
+ * one from an `Arbi` (used when no `MailClientProvider` is above). A host that keeps mail offline,
3996
+ * bridges connector tokens or sends secure mail passes its own reads and extras as overrides.
3997
+ */
3998
+
3999
+ /** Fetch a path under `/v1/mail` with authentication; rejects a non-2xx response (`status` set). */
4000
+ type MailFetch = (path: string, init?: RequestInit) => Promise<Response>;
4001
+ interface MailClient {
4002
+ fetch: MailFetch;
4003
+ getPolicy(): Promise<MailPolicy>;
4004
+ listAccounts(): Promise<MailAccount[]>;
4005
+ listFolders(account: MailAccount): Promise<MailFolder[]>;
4006
+ listMessages(account: MailAccount, folderId: string, query: string, cursor: string | null): Promise<MailPage>;
4007
+ getMessage(account: MailAccount, messageId: string): Promise<MailMessage>;
4008
+ /** Hand this session what the server needs to read the account (keys, credentials). */
4009
+ unlock(account: MailAccount): Promise<void>;
4010
+ /**
4011
+ * The encrypted payload for `/secure/send` (native mail only). Absent: secure delivery is not
4012
+ * offered.
4013
+ */
4014
+ prepareSecureMail?(compose: MailCompose, account: MailAccount, requestId: string): Promise<unknown>;
4015
+ /** The URL that connects an OAuth mail provider, returning to `returnPath`. Absent: not offered. */
4016
+ authorizeOAuth?(vendor: string, returnPath: string): Promise<string>;
4017
+ }
4018
+ /** A read that needs the network and has no copy on this device (shown as a notice, not an error). */
4019
+ declare class MailOfflineUnavailableError extends Error {
4020
+ constructor(message: string);
4021
+ }
4022
+ declare function accountPath(id: string): string;
4023
+ /** A JSON mail call: the parsed body, or `undefined` for 204. */
4024
+ declare function mailJson<T>(fetch: MailFetch, path: string, init?: RequestInit): Promise<T>;
4025
+ /** A client over `fetch`; `overrides` replace any of its reads or add the optional extras. */
4026
+ declare function createMailClient(fetch: MailFetch, overrides?: Partial<MailClient>): MailClient;
4027
+ /**
4028
+ * The default client: the `Arbi` session's mail transport. The native inbox is unlocked with the
4029
+ * signed-in user's keys before each read (so mail that arrived since is readable too); a connected
4030
+ * account needs no unlock from here.
4031
+ */
4032
+ declare function arbiMailClient(arbi: Arbi): MailClient;
4033
+ /** A picked file as an attachment (its content base64-encoded). */
4034
+ declare function fileAttachment(file: File): Promise<MailAttachment>;
4035
+ /** The address suggested for a user's native inbox: given name and family name, lowercase ASCII, dot-joined. */
4036
+ declare function defaultMailAlias(user?: {
4037
+ given_name?: string | null;
4038
+ family_name?: string | null;
4039
+ } | null): string;
4040
+ /**
4041
+ * The alias to try after `alias` is taken: `grace.okoye` → `grace.okoye2`, `grace.okoye2` → `grace.okoye3`.
4042
+ * The server is the only judge of availability, so this is a guess to offer, not a promise.
4043
+ */
4044
+ declare function nextAliasSuggestion(alias: string): string;
4045
+ /** True when the claim failed because the address is already in use (HTTP 409). */
4046
+ declare function isAliasTakenError(err: Error): boolean;
4047
+ /**
4048
+ * Shown after `alias` is taken. The suggestion is unverified, so the copy must not say it is free:
4049
+ * the server only checks availability when the user confirms the claim.
4050
+ */
4051
+ declare function aliasTakenMessage(alias: string, suggestion: string, domain: string): string;
4052
+ /** The draft a `mail_draft_ready` notification is about (its content is `{"mail_id": …}`). */
4053
+ declare function mailDraftIdFromContent(content: string | null | undefined): string | undefined;
4054
+
4055
+ interface MailClientContextValue {
4056
+ client: MailClient;
4057
+ /** Mail reads run only while this is true (signed in). */
4058
+ enabled: boolean;
4059
+ /**
4060
+ * Identifies the server session the mailbox is unlocked for: unlocking runs again when it
4061
+ * changes. `null`: no session yet, so nothing is unlocked.
4062
+ */
4063
+ sessionKey: string | null;
4064
+ }
4065
+ interface MailClientProviderProps extends Partial<Omit<MailClientContextValue, 'client'>> {
4066
+ client: MailClient;
4067
+ children: ReactNode;
4068
+ }
4069
+ /**
4070
+ * The mail client for the mail hooks and blocks below. Without one, they use the nearest
4071
+ * `ArbiProvider`'s session (`arbiMailClient`).
4072
+ */
4073
+ declare function MailClientProvider({ client, enabled, sessionKey, children, }: MailClientProviderProps): React$1.JSX.Element;
4074
+ /** The mail client in scope: a `MailClientProvider`'s, else the `ArbiProvider` session's. */
4075
+ declare function useMailClient(): MailClientContextValue;
4076
+
4077
+ declare const mailQueryKeys: {
4078
+ all: () => readonly ["mail"];
4079
+ policy: () => readonly ["mail", "policy"];
4080
+ accounts: () => readonly ["mail", "accounts"];
4081
+ unlock: (accountId: string | undefined, sessionKey: string | null) => readonly ["mail", "unlock", string | undefined, string];
4082
+ allFolders: () => readonly ["mail", "folders"];
4083
+ folders: (accountId: string | undefined) => readonly ["mail", "folders", string | undefined];
4084
+ allMessages: () => readonly ["mail", "messages"];
4085
+ messages: (accountId: string | undefined, folderId: string | undefined, query: string, cursor: string | null) => readonly ["mail", "messages", string | undefined, string | undefined, string, string | null];
4086
+ message: (accountId: string | undefined, messageId: string | null | undefined) => readonly ["mail", "message", string | undefined, string | null | undefined];
4087
+ };
4088
+ /** Whether the app is online (React Query's `onlineManager`). */
4089
+ declare function useMailOnline(): boolean;
4090
+ /** What the deployment allows: native mail, OAuth providers, mail servers, the attachment limit. */
4091
+ declare function useMailPolicy(): _tanstack_react_query.UseQueryResult<NoInfer<MailPolicy>, Error>;
4092
+ declare function useMailAccounts(options?: {
4093
+ enabled?: boolean;
4094
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailAccount[]>, Error>;
4095
+ /**
4096
+ * Unlock `account` for this session. It waits for a connection (offline, a host that keeps mail on
4097
+ * the device reads from there and queues sends), then runs once per session.
4098
+ */
4099
+ declare function useMailUnlock(account: MailAccount | undefined): _tanstack_react_query.UseQueryResult<boolean, Error>;
4100
+ declare function useMailFolders(account: MailAccount | undefined, options: {
4101
+ enabled?: boolean;
4102
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailFolder[]>, Error>;
4103
+ /** One page of a folder, filtered by `query`, from `cursor` (`null`: the first page). */
4104
+ declare function useMailMessages(account: MailAccount | undefined, folderId: string | undefined, query: string, cursor: string | null, options?: {
4105
+ enabled?: boolean;
4106
+ refetchInterval?: number;
4107
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailPage>, Error>;
4108
+ declare function useMailMessage(account: MailAccount | undefined, messageId: string | null | undefined, options?: {
4109
+ enabled?: boolean;
4110
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailMessage>, Error>;
4111
+ /** Claim `alias@<deployment domain>` as the user's native inbox, then refresh everything mail. */
4112
+ declare function useClaimNativeAlias(onClaimed?: (alias: string) => void): _tanstack_react_query.UseMutationResult<unknown, Error, string, unknown>;
4113
+ /** Connect a mailbox on one of the deployment's approved mail servers. */
4114
+ declare function useConnectMailAccount(): _tanstack_react_query.UseMutationResult<unknown, Error, {
4115
+ profileId: string;
4116
+ email: string;
4117
+ username: string;
4118
+ password: string;
4119
+ }, unknown>;
4120
+ declare function useDisconnectMailAccount(): _tanstack_react_query.UseMutationResult<unknown, Error, string, unknown>;
4121
+ /** Refresh mail reads after a write the hooks below don't cover. */
4122
+ declare function useMailCache(): {
4123
+ refreshAll: () => Promise<void>;
4124
+ refreshFolders: () => Promise<void>;
4125
+ /** After a write to one message: drop a read of it still in flight (it may carry the old state), then refresh. */
4126
+ settleMessage: (accountId: string, messageId: string) => Promise<void>;
4127
+ };
4128
+ /** Mark a message read or unread, move it, or send it to Trash. The caller refreshes (`useMailCache`). */
4129
+ declare function useUpdateMailMessage(): _tanstack_react_query.UseMutationResult<unknown, Error, {
4130
+ accountId: string;
4131
+ messageId: string;
4132
+ update: MailMessageUpdate;
4133
+ }, unknown>;
4134
+ /** Where a message goes when the server can't be reached: kept on the device (a host option). */
4135
+ interface MailDeviceFallback {
4136
+ /** Keep it on the device; called offline, or when the request got no answer. */
4137
+ keep: (compose: MailCompose) => Promise<void>;
4138
+ /** The request got no answer (no connection), as opposed to the server refusing it. */
4139
+ isNetworkFailure: (error: unknown) => boolean;
4140
+ }
4141
+ /**
4142
+ * Save a draft to the account's Drafts. With `fallback`, offline (or with no answer) it is kept on
4143
+ * the device instead (`{ onDevice: true }`).
4144
+ */
4145
+ declare function useSaveMailDraft(fallback?: MailDeviceFallback): _tanstack_react_query.UseMutationResult<{
4146
+ onDevice: true;
4147
+ } | {
4148
+ id: string;
4149
+ }, Error, {
4150
+ accountId: string;
4151
+ compose: MailCompose;
4152
+ }, unknown>;
4153
+ /**
4154
+ * Send a message. `requestId` makes it idempotent: sending the same request again never sends twice.
4155
+ * `secure` sends it by secure delivery instead (resolves with the prepared payload). With
4156
+ * `fallback`, offline (or with no answer) it waits on the device (`{ onDevice: true }`).
4157
+ */
4158
+ declare function useSendMail(fallback?: MailDeviceFallback): _tanstack_react_query.UseMutationResult<unknown, Error, {
4159
+ accountId: string;
4160
+ compose: MailCompose;
4161
+ requestId: string;
4162
+ secure?: () => Promise<unknown>;
4163
+ }, unknown>;
4164
+ /** A saved draft prepared for editing by `prepare` (e.g. with its attachments' content). */
4165
+ declare function useMailDraftCompose(account: MailAccount | undefined, draftId: string | undefined, prepare: (account: MailAccount, draftId: string) => Promise<MailCompose>, options?: {
4166
+ enabled?: boolean;
4167
+ }): _tanstack_react_query.UseQueryResult<NoInfer<MailCompose>, Error>;
4168
+
3876
4169
  /**
3877
4170
  * Credits: the unit the ARBI backend reports AI usage in.
3878
4171
  *
@@ -6290,4 +6583,4 @@ interface ArbiUiState {
6290
6583
  }
6291
6584
  declare const useArbiUiStore: zustand.UseBoundStore<zustand.StoreApi<ArbiUiState>>;
6292
6585
 
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 };
6586
+ 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 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 };