@arbidocs/sdk 0.4.107 → 0.4.110

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.
@@ -1,3 +1,4 @@
1
+ import * as _arbidocs_client from '@arbidocs/client';
1
2
  import { SessionStorageProvider, ArbiClient, LoginResult, components, WebSocketServerMessage, WsAuthResultMessage, WsTaskUpdateMessage, KeyPair, LoginProfile } from '@arbidocs/client';
2
3
 
3
4
  /**
@@ -1326,6 +1327,16 @@ type DirectUploadClient = Pick<ArbiClient, 'fetch'>;
1326
1327
  * lives in one place.
1327
1328
  */
1328
1329
  declare function mimeFromName(name: string): string | undefined;
1330
+ /**
1331
+ * PUT a body to a presigned URL. Uses XMLHttpRequest in the browser so that
1332
+ * `upload.progress` events are available; falls back to fetch elsewhere.
1333
+ * `onProgress` is only guaranteed to fire in the XHR path — Node callers get
1334
+ * a single synthetic 100 % tick from the direct-upload driver instead.
1335
+ * `headers` are any the presign requires (sent as given).
1336
+ *
1337
+ * Exported for the other presign-then-PUT uploads (call recording parts).
1338
+ */
1339
+ declare function presignedPut(url: string, body: Uint8Array, onProgress?: (loaded: number, total: number) => void, headers?: Record<string, string>): Promise<void>;
1329
1340
  /**
1330
1341
  * Upload files via the direct-to-MinIO flow (SecretBox on the client,
1331
1342
  * presigned PUT to nginx→MinIO, then commit).
@@ -1373,13 +1384,14 @@ declare const documents_listDocuments: typeof listDocuments;
1373
1384
  declare const documents_listPaginated: typeof listPaginated;
1374
1385
  declare const documents_listVersions: typeof listVersions;
1375
1386
  declare const documents_mimeFromName: typeof mimeFromName;
1387
+ declare const documents_presignedPut: typeof presignedPut;
1376
1388
  declare const documents_sanitizeFolderPath: typeof sanitizeFolderPath;
1377
1389
  declare const documents_updateDocuments: typeof updateDocuments;
1378
1390
  declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
1379
1391
  declare const documents_uploadFiles: typeof uploadFiles;
1380
1392
  declare const documents_uploadUrl: typeof uploadUrl;
1381
1393
  declare namespace documents {
1382
- export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_getThumbnails as getThumbnails, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_listVersions as listVersions, documents_mimeFromName as mimeFromName, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
1394
+ export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_getThumbnails as getThumbnails, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_listVersions as listVersions, documents_mimeFromName as mimeFromName, documents_presignedPut as presignedPut, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
1383
1395
  }
1384
1396
 
1385
1397
  /**
@@ -2018,6 +2030,7 @@ declare function listConversations(arbi: ArbiClient): Promise<{
2018
2030
  last_message_updated_at?: string | null | undefined;
2019
2031
  last_message_status?: string | null | undefined;
2020
2032
  assistant_mode: components["schemas"]["AssistantMode"];
2033
+ meeting_call_ext_id?: string | null | undefined;
2021
2034
  status?: (components["schemas"]["WorkStatus"] | null) | undefined;
2022
2035
  description?: string | null | undefined;
2023
2036
  due_at?: string | null | undefined;
@@ -2317,6 +2330,12 @@ declare function getConversationThreads(arbi: ArbiClient, conversationId: string
2317
2330
  name: "workflow_step";
2318
2331
  description: string;
2319
2332
  workflow_step: string;
2333
+ } | {
2334
+ name: "transcript_segment";
2335
+ description: string;
2336
+ segment_id: string;
2337
+ speaker_ext_id: string;
2338
+ started_at?: string | null | undefined;
2320
2339
  } | {
2321
2340
  name: "mail_context";
2322
2341
  description: string;
@@ -2513,6 +2532,12 @@ declare function getMessage$1(arbi: ArbiClient, messageId: string): Promise<{
2513
2532
  name: "workflow_step";
2514
2533
  description: string;
2515
2534
  workflow_step: string;
2535
+ } | {
2536
+ name: "transcript_segment";
2537
+ description: string;
2538
+ segment_id: string;
2539
+ speaker_ext_id: string;
2540
+ started_at?: string | null | undefined;
2516
2541
  } | {
2517
2542
  name: "mail_context";
2518
2543
  description: string;
@@ -2716,6 +2741,12 @@ declare function postConversationMessage(arbi: ArbiClient, body: PostMessageRequ
2716
2741
  name: "workflow_step";
2717
2742
  description: string;
2718
2743
  workflow_step: string;
2744
+ } | {
2745
+ name: "transcript_segment";
2746
+ description: string;
2747
+ segment_id: string;
2748
+ speaker_ext_id: string;
2749
+ started_at?: string | null | undefined;
2719
2750
  } | {
2720
2751
  name: "mail_context";
2721
2752
  description: string;
@@ -3271,86 +3302,67 @@ declare namespace tags {
3271
3302
  }
3272
3303
 
3273
3304
  /**
3274
- * Contact operations — list, add, remove.
3305
+ * Contact operations (`/v1/contacts`) — one address book: registered people, pending invitations and plain
3306
+ * cards. A card's details are encrypted under its address book's key; a session without that key bridged
3307
+ * (the web app bridges it, the CLI does not yet) gets `card: null` for stored cards and cannot write them.
3275
3308
  */
3276
3309
 
3277
- declare function listContacts(arbi: ArbiClient): Promise<{
3278
- external_id?: string | null | undefined;
3279
- email: string;
3280
- user?: {
3281
- external_id: string;
3282
- parent_ext_id?: string | null | undefined;
3283
- email: string;
3284
- given_name: string;
3285
- family_name?: string | null | undefined;
3286
- picture?: string | null | undefined;
3287
- encryption_public_key: string;
3288
- is_sso: boolean;
3289
- is_identity_verified: boolean;
3290
- } | null | undefined;
3291
- status: "invitation_pending" | "invitation_expired" | "registered" | "failed";
3292
- created_at: string;
3293
- shared_workspace_ext_id?: string | null | undefined;
3294
- outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null | undefined;
3295
- outcome_detail?: string | null | undefined;
3296
- }[]>;
3297
- declare function addContacts(arbi: ArbiClient, emails: string[]): Promise<{
3298
- external_id?: string | null | undefined;
3299
- email: string;
3300
- user?: {
3301
- external_id: string;
3302
- parent_ext_id?: string | null | undefined;
3303
- email: string;
3304
- given_name: string;
3305
- family_name?: string | null | undefined;
3306
- picture?: string | null | undefined;
3307
- encryption_public_key: string;
3308
- is_sso: boolean;
3309
- is_identity_verified: boolean;
3310
- } | null | undefined;
3311
- status: "invitation_pending" | "invitation_expired" | "registered" | "failed";
3312
- created_at: string;
3313
- shared_workspace_ext_id?: string | null | undefined;
3314
- outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null | undefined;
3315
- outcome_detail?: string | null | undefined;
3316
- }[]>;
3317
- declare function removeContacts(arbi: ArbiClient, contactIds: string[]): Promise<void>;
3318
- /**
3319
- * Group contacts by registration status.
3320
- * Returns registered contacts and pending (not yet registered) contacts.
3310
+ type Contact = components['schemas']['ContactResponse'];
3311
+ type ContactCardWrite = components['schemas']['ContactCardWrite'];
3312
+ type ContactCreate = components['schemas']['ContactCreate'];
3313
+ type PersonSuggestion = components['schemas']['PersonSuggestion'];
3314
+ declare function listContacts(arbi: ArbiClient): Promise<Contact[]>;
3315
+ /** Invite or link people by e-mail (max 100); one row per address with its `outcome`. */
3316
+ declare function inviteContacts(arbi: ArbiClient, emails: string[]): Promise<Contact[]>;
3317
+ /** Create a card, optionally linking `email` and inviting it (`invite: true`). */
3318
+ declare function createContact(arbi: ArbiClient, body: ContactCreate): Promise<Contact>;
3319
+ declare function updateContact(arbi: ArbiClient, contactId: string, card: ContactCardWrite): Promise<Contact>;
3320
+ /** Delete a contact (or withdraw its invitation). */
3321
+ declare function deleteContact(arbi: ArbiClient, contactId: string): Promise<void>;
3322
+ /** People matching `q`: your contacts and registered people who share a workspace with you. */
3323
+ declare function searchContacts(arbi: ArbiClient, q: string): Promise<PersonSuggestion[]>;
3324
+ /**
3325
+ * Group contacts by status: people on ARBI, invitations still out (sent or expired), and plain cards.
3321
3326
  */
3322
3327
  declare function groupContactsByStatus<T extends {
3323
3328
  status: string;
3324
3329
  }>(contactList: T[]): {
3325
3330
  registered: T[];
3326
3331
  pending: T[];
3332
+ cards: T[];
3327
3333
  };
3328
3334
 
3329
- declare const contacts_addContacts: typeof addContacts;
3335
+ type contacts_Contact = Contact;
3336
+ type contacts_ContactCardWrite = ContactCardWrite;
3337
+ type contacts_ContactCreate = ContactCreate;
3338
+ type contacts_PersonSuggestion = PersonSuggestion;
3339
+ declare const contacts_createContact: typeof createContact;
3340
+ declare const contacts_deleteContact: typeof deleteContact;
3330
3341
  declare const contacts_groupContactsByStatus: typeof groupContactsByStatus;
3342
+ declare const contacts_inviteContacts: typeof inviteContacts;
3331
3343
  declare const contacts_listContacts: typeof listContacts;
3332
- declare const contacts_removeContacts: typeof removeContacts;
3344
+ declare const contacts_searchContacts: typeof searchContacts;
3345
+ declare const contacts_updateContact: typeof updateContact;
3333
3346
  declare namespace contacts {
3334
- export { contacts_addContacts as addContacts, contacts_groupContactsByStatus as groupContactsByStatus, contacts_listContacts as listContacts, contacts_removeContacts as removeContacts };
3347
+ export { type contacts_Contact as Contact, type contacts_ContactCardWrite as ContactCardWrite, type contacts_ContactCreate as ContactCreate, type contacts_PersonSuggestion as PersonSuggestion, contacts_createContact as createContact, contacts_deleteContact as deleteContact, contacts_groupContactsByStatus as groupContactsByStatus, contacts_inviteContacts as inviteContacts, contacts_listContacts as listContacts, contacts_searchContacts as searchContacts, contacts_updateContact as updateContact };
3335
3348
  }
3336
3349
 
3337
3350
  /**
3338
- * End-to-end encrypted DM attachments.
3351
+ * End-to-end encrypted chat attachments.
3339
3352
  *
3340
3353
  * Each file is sealed with its own random 32-byte key (SecretBox, 24-byte nonce prepended — the
3341
3354
  * same wire format as workspace files) and uploaded as opaque ciphertext. The keys travel in a
3342
- * small manifest, `{"v":1,"files":[{id,name,type,size,key}]}`, which is encrypted per recipient
3343
- * exactly like the DM's `content` (the sender↔recipient pair key). The server stores ciphertext
3344
- * and ids only: it never sees a file's bytes, name, type or key.
3355
+ * small manifest, `{"v":1,"files":[{id,name,type,size,key}]}`, which is encrypted exactly like the
3356
+ * message `content`: under the chat key of the message's epoch. The server stores ciphertext and
3357
+ * ids only: it never sees a file's bytes, name, type or key.
3345
3358
  */
3346
3359
 
3347
- type NotificationResponse$1 = components['schemas']['NotificationResponse'];
3348
- /** Largest file a DM can carry, in plaintext bytes (the server caps the ciphertext at this + 40). */
3349
- declare const DM_ATTACHMENT_MAX_BYTES: number;
3350
- /** Most files one DM can carry. */
3351
- declare const DM_ATTACHMENT_MAX_FILES = 10;
3360
+ /** Largest file a chat message can carry, in plaintext bytes (the server caps the ciphertext at this + 40). */
3361
+ declare const CHAT_ATTACHMENT_MAX_BYTES: number;
3362
+ /** Most files one chat message can carry. */
3363
+ declare const CHAT_ATTACHMENT_MAX_FILES = 10;
3352
3364
  /** One attached file as the manifest describes it. `key` is the base64 per-file SecretBox key. */
3353
- interface DmAttachmentFile {
3365
+ interface ChatAttachmentFile {
3354
3366
  id: string;
3355
3367
  name: string;
3356
3368
  type: string;
@@ -3358,403 +3370,236 @@ interface DmAttachmentFile {
3358
3370
  key: string;
3359
3371
  }
3360
3372
  /** A file to attach: its name, MIME type and plaintext bytes. */
3361
- interface DmAttachmentInput {
3373
+ interface ChatAttachmentInput {
3362
3374
  name: string;
3363
3375
  type?: string;
3364
3376
  bytes: Uint8Array;
3365
3377
  }
3366
- /** A DM row after decryption: `content` is plaintext and the manifest's files are listed. */
3367
- type DecryptedDmNotification = NotificationResponse$1 & {
3368
- /** The files this message carries (empty when it has none or the manifest could not be read). */
3369
- attachmentFiles?: DmAttachmentFile[];
3370
- /** Set when the message has attachments but its manifest could not be decrypted. */
3371
- attachmentsError?: string;
3372
- };
3373
3378
  /**
3374
- * Throw a readable error when a set of files breaks the DM limits: more than
3375
- * {@link DM_ATTACHMENT_MAX_FILES} files, or any one over {@link DM_ATTACHMENT_MAX_BYTES}.
3379
+ * Throw a readable error when a set of files breaks the chat attachment limits: more than
3380
+ * {@link CHAT_ATTACHMENT_MAX_FILES} files, or any one over {@link CHAT_ATTACHMENT_MAX_BYTES}.
3376
3381
  */
3377
- declare function checkDmAttachmentLimits(files: ReadonlyArray<{
3382
+ declare function checkChatAttachmentLimits(files: ReadonlyArray<{
3378
3383
  name: string;
3379
3384
  size: number;
3380
3385
  }>): void;
3381
3386
  /**
3382
3387
  * Encrypt one file with a fresh key and upload the ciphertext. Returns the manifest entry the
3383
- * recipients need to fetch and open it. Upload just before sending: an upload no DM links is
3388
+ * members need to fetch and open it. Upload just before sending: an upload no message links is
3384
3389
  * removed after 24 hours.
3385
3390
  */
3386
- declare function uploadDmAttachment(arbi: ArbiClient, input: DmAttachmentInput): Promise<DmAttachmentFile>;
3391
+ declare function uploadChatAttachment(arbi: ArbiClient, input: ChatAttachmentInput): Promise<ChatAttachmentFile>;
3387
3392
  /** Check the limits for the whole set first, then upload each file. Nothing is uploaded if any file is refused. */
3388
- declare function uploadDmAttachments(arbi: ArbiClient, inputs: DmAttachmentInput[]): Promise<DmAttachmentFile[]>;
3393
+ declare function uploadChatAttachments(arbi: ArbiClient, inputs: ChatAttachmentInput[]): Promise<ChatAttachmentFile[]>;
3389
3394
  /** The manifest's plaintext JSON. */
3390
- declare function serializeDmAttachmentManifest(files: DmAttachmentFile[]): string;
3395
+ declare function serializeChatAttachmentManifest(files: ChatAttachmentFile[]): string;
3391
3396
  /** Parse and validate a decrypted manifest. Throws on an unknown version or a malformed entry. */
3392
- declare function parseDmAttachmentManifest(json: string): DmAttachmentFile[];
3393
- /** Encrypt a manifest for one recipient with the pair key — the same scheme as DM `content`. */
3394
- declare function encryptDmAttachmentManifest(arbi: ArbiClient, files: DmAttachmentFile[], recipientEncryptionPubKeyBase64: string, senderEncryptionSecretKey: Uint8Array): Promise<string>;
3395
- /**
3396
- * Decrypt a notification's attachment manifest. Returns `[]` when it has none; throws when the
3397
- * manifest cannot be opened or is malformed.
3398
- */
3399
- declare function decryptDmAttachments(arbi: ArbiClient, notification: NotificationResponse$1, crypto: DmCryptoContext): Promise<DmAttachmentFile[]>;
3397
+ declare function parseChatAttachmentManifest(json: string): ChatAttachmentFile[];
3398
+ /** Encrypt a manifest under the chat key of the message's epoch (the same key as `content`). */
3399
+ declare function encryptChatAttachmentManifest(files: ChatAttachmentFile[], chatKey: Uint8Array): Promise<string>;
3400
+ /** Decrypt a message's attachment manifest. Throws when it cannot be opened or is malformed. */
3401
+ declare function decryptChatAttachmentManifest(manifest: string, chatKey: Uint8Array): Promise<ChatAttachmentFile[]>;
3400
3402
  /**
3401
3403
  * Fetch an attachment's ciphertext, decrypt it with the manifest key and check its size.
3402
3404
  * Throws when it is gone, has been altered, or does not match the manifest.
3403
3405
  */
3404
- declare function downloadDmAttachment(arbi: ArbiClient, file: DmAttachmentFile): Promise<Uint8Array>;
3406
+ declare function downloadChatAttachment(arbi: ArbiClient, file: ChatAttachmentFile): Promise<Uint8Array>;
3405
3407
 
3406
3408
  /**
3407
- * Direct message / notification operations — list, send, mark read, delete.
3409
+ * Chats (`/v1/chats`) — direct (1:1, incl. a self-chat and the owner↔own-agent PA chat) and group
3410
+ * conversations outside workspaces. Spec: ARBI `docs/meeting-chats-plan.md` §2.
3411
+ *
3412
+ * Every message, title and attachment manifest is `base64(nonce ‖ secretbox(plaintext, chat key))`:
3413
+ *
3414
+ * - **direct**: the chat key is the X25519 pair key `crypto_box_beforenm(peer_pk, my_sk)`,
3415
+ * `key_version` 0. That is byte-for-byte the old DM scheme, so migrated history opens as is.
3416
+ * - **group/meeting**: a random key per epoch, sealed to each member. `my_keys` holds every
3417
+ * epoch sealed to me; each message names its `key_version`. Removing a member sets
3418
+ * `rotation_required` and a remaining member's client seals epoch v+1 to exactly the
3419
+ * remaining members ({@link ensureChatKeyCurrent}).
3408
3420
  *
3409
- * All message content is E2E encrypted using ECDH (X25519 + XSalsa20-Poly1305).
3410
- * Encryption keys are derived from the user's Ed25519 signing keypair.
3421
+ * Personal agents (`agt-`) may only ever be in a direct chat with their owner; group pickers
3422
+ * must hide them and the server refuses them (`422 agent_not_allowed`).
3411
3423
  */
3412
3424
 
3413
- type NotificationResponse = components['schemas']['NotificationResponse'];
3414
- /** A resolved DM recipient: their external_id + curve25519 public key. */
3425
+ type ChatResponse = components['schemas']['ChatResponse'];
3426
+ type ChatMessageResponse = components['schemas']['ChatMessageResponse'];
3427
+ type ChatMemberResponse = components['schemas']['ChatMemberResponse'];
3428
+ type ChatKind = ChatResponse['kind'];
3429
+ type UserResponse$1 = components['schemas']['UserResponse'];
3430
+ /** A resolved chat peer: their external_id + X25519 public key. */
3415
3431
  interface ResolvedRecipient {
3416
3432
  extId: string;
3417
3433
  pubKey: string;
3418
3434
  }
3419
- /**
3420
- * Everything needed to encrypt/decrypt DMs.
3421
- * Derive once per session, pass to all DM operations.
3422
- */
3423
- interface DmCryptoContext {
3424
- /** User's X25519 encryption keypair (derived from Ed25519 signing key) */
3435
+ /** My X25519 keypair and external id. Derive once per session, pass to every chat operation. */
3436
+ interface ChatCryptoContext {
3425
3437
  encryptionKeypair: KeyPair;
3426
- /** User's own external_id (to determine send vs receive direction) */
3427
3438
  userExtId: string;
3428
3439
  }
3429
- /**
3430
- * Create a DM crypto context from a signing private key.
3431
- *
3432
- * @param arbi - ArbiClient instance (provides crypto utilities)
3433
- * @param signingPrivateKeyBytes - Ed25519 signing private key (64 bytes)
3434
- * @param userExtId - Current user's external_id
3435
- */
3436
- declare function createDmCryptoContext(arbi: ArbiClient, signingPrivateKeyBytes: Uint8Array, userExtId: string): DmCryptoContext;
3437
- /**
3438
- * Encrypt a plaintext message for a recipient.
3439
- *
3440
- * @param arbi - ArbiClient instance
3441
- * @param plaintext - Message content to encrypt
3442
- * @param recipientEncryptionPubKeyBase64 - Recipient's X25519 public key (base64)
3443
- * @param senderEncryptionSecretKey - Sender's X25519 secret key (Uint8Array)
3444
- * @returns Base64-encoded ciphertext (nonce prepended)
3445
- */
3446
- declare function encryptDmContent(arbi: ArbiClient, plaintext: string, recipientEncryptionPubKeyBase64: string, senderEncryptionSecretKey: Uint8Array): Promise<string>;
3447
- /**
3448
- * Decrypt an encrypted notification message.
3449
- *
3450
- * Uses the sender/recipient public keys embedded in NotificationResponse
3451
- * to determine the "other party" for ECDH decryption.
3452
- *
3453
- * @param arbi - ArbiClient instance
3454
- * @param notification - The notification with encrypted content
3455
- * @param crypto - DM crypto context for the current user
3456
- * @returns Decrypted plaintext, or null if content is empty
3457
- * @throws Error if decryption fails (wrong keys or tampered message)
3458
- */
3459
- declare function decryptDmContent(arbi: ArbiClient, notification: NotificationResponse, crypto: DmCryptoContext): Promise<string | null>;
3460
- /**
3461
- * Decrypt a batch of notifications, replacing content in-place and listing each message's
3462
- * attachments in `attachmentFiles`.
3463
- * Failed decryptions get content set to '[Decryption failed]'; a manifest that cannot be opened
3464
- * leaves `attachmentFiles` empty and sets `attachmentsError`.
3465
- *
3466
- * @returns New array with decrypted content
3467
- */
3468
- declare function decryptDmBatch(arbi: ArbiClient, notifications: NotificationResponse[], crypto: DmCryptoContext): Promise<DecryptedDmNotification[]>;
3469
- /**
3470
- * List DMs (raw — content is encrypted ciphertext).
3471
- */
3472
- declare function listDMs(arbi: ArbiClient): Promise<{
3473
- type: components["schemas"]["NotificationType"];
3440
+ /** Build a chat crypto context from the Ed25519 signing private key (64 bytes). */
3441
+ declare function createChatCryptoContext(signingPrivateKeyBytes: Uint8Array, userExtId: string): ChatCryptoContext;
3442
+ /** `agt-` ids are personal agents: only ever in a direct chat with their owner. */
3443
+ declare function isAgentExtId(extId: string | null | undefined): boolean;
3444
+ /** The keys of one chat that I hold, by epoch. */
3445
+ interface ChatKeyRing {
3446
+ chatExtId: string;
3447
+ kind: ChatKind;
3448
+ /** The epoch new messages are encrypted under. */
3449
+ currentVersion: number;
3450
+ keys: Map<number, Uint8Array>;
3451
+ }
3452
+ /** The other member of a direct chat, or `undefined` for a self-chat. */
3453
+ declare function directPeer(chat: ChatResponse, myExtId: string): UserResponse$1 | undefined;
3454
+ /**
3455
+ * Open every key of a chat I can: the pair key of a direct chat, or each epoch sealed to me in
3456
+ * a group. An epoch that does not open is simply absent (its messages show as undecryptable).
3457
+ */
3458
+ declare function openChatKeyRing(chat: ChatResponse, crypto: ChatCryptoContext): Promise<ChatKeyRing>;
3459
+ declare const DECRYPTION_FAILED = "[Decryption failed]";
3460
+ /** A chat message after decryption: `content` is plaintext. */
3461
+ type DecryptedChatMessage = ChatMessageResponse & {
3462
+ /** True when `content` could not be opened (it then reads {@link DECRYPTION_FAILED}). */
3463
+ decryptFailed?: boolean;
3464
+ /** The files this message carries (empty when it has none or the manifest could not be read). */
3465
+ attachmentFiles?: ChatAttachmentFile[];
3466
+ /** Set when the message has attachments but its manifest could not be decrypted. */
3467
+ attachmentsError?: string;
3468
+ };
3469
+ /** Decrypt one message with the key of its own epoch. Never throws. */
3470
+ declare function decryptChatMessage(ring: ChatKeyRing, message: ChatMessageResponse): Promise<DecryptedChatMessage>;
3471
+ declare function decryptChatMessages(ring: ChatKeyRing, messages: ChatMessageResponse[]): Promise<DecryptedChatMessage[]>;
3472
+ /** A group's title in plaintext; null when it has none or it does not open. */
3473
+ declare function decryptChatTitle(ring: ChatKeyRing, chat: Pick<ChatResponse, 'title' | 'key_version'>): Promise<string | null>;
3474
+ /** My chats, most recently active first (raw: titles and last messages are ciphertext). */
3475
+ declare function listChats(arbi: ArbiClient, kind?: ChatKind): Promise<ChatResponse[]>;
3476
+ declare function getChat(arbi: ArbiClient, chatExtId: string): Promise<ChatResponse>;
3477
+ /** Get-or-create the direct chat with a peer (`usr-`/`agt-`; my own id for a self-chat). */
3478
+ declare function openDirectChat(arbi: ArbiClient, peerExtId: string): Promise<ChatResponse>;
3479
+ /** A member to seal a key to: their id and X25519 public key. */
3480
+ interface ChatMemberKey {
3474
3481
  external_id: string;
3475
- sender: {
3476
- external_id: string;
3477
- parent_ext_id?: string | null | undefined;
3478
- email: string;
3479
- given_name: string;
3480
- family_name?: string | null | undefined;
3481
- picture?: string | null | undefined;
3482
- encryption_public_key: string;
3483
- is_sso: boolean;
3484
- is_identity_verified: boolean;
3485
- };
3486
- recipient: {
3487
- external_id: string;
3488
- parent_ext_id?: string | null | undefined;
3489
- email: string;
3490
- given_name: string;
3491
- family_name?: string | null | undefined;
3492
- picture?: string | null | undefined;
3493
- encryption_public_key: string;
3494
- is_sso: boolean;
3495
- is_identity_verified: boolean;
3496
- };
3497
- workspace_ext_id?: string | null | undefined;
3498
- dm_context_only: boolean;
3499
- content?: string | null | undefined;
3500
- attachments?: string | null | undefined;
3501
- conversation_ext_id?: string | null | undefined;
3502
- message_ext_id?: string | null | undefined;
3503
- read: boolean;
3504
- created_at: string;
3505
- updated_at: string;
3506
- }[]>;
3482
+ encryption_public_key: string;
3483
+ }
3507
3484
  /**
3508
- * List and decrypt DMs in one call.
3485
+ * Create a group at epoch 1: a fresh key sealed to each member and to me, and the title encrypted
3486
+ * under it. Agents are refused here (and by the server): a personal agent never joins a group.
3509
3487
  */
3510
- declare function listDecryptedDMs(arbi: ArbiClient, crypto: DmCryptoContext): Promise<DecryptedDmNotification[]>;
3488
+ declare function createGroupChat(arbi: ArbiClient, crypto: ChatCryptoContext, params: {
3489
+ title?: string | null;
3490
+ members: ChatMemberKey[];
3491
+ }): Promise<ChatResponse>;
3492
+ /** Set (or clear) a group's title, encrypted under the current epoch. */
3493
+ declare function renameChat(arbi: ArbiClient, ring: ChatKeyRing, title: string | null): Promise<ChatResponse>;
3511
3494
  /**
3512
- * List the current user's durable activity feed, newest first.
3513
- *
3514
- * Activity notifications are backend-originated, to-self log lines (recipient ==
3515
- * sender == the acting user) that are always read — they never appear in the
3516
- * normal DM/notification feed or the unread badge. Reading them requires the
3517
- * explicit `type=activity` filter, which this helper always sets.
3495
+ * Add people to a group: the current epoch is sealed to each, so they read this epoch's history.
3496
+ * A direct chat never grows (the server answers 409) — create a new group instead.
3518
3497
  */
3519
- declare function listActivity(arbi: ArbiClient, options?: {
3520
- limit?: number;
3521
- offset?: number;
3522
- }): Promise<{
3523
- type: components["schemas"]["NotificationType"];
3524
- external_id: string;
3525
- sender: {
3526
- external_id: string;
3527
- parent_ext_id?: string | null | undefined;
3528
- email: string;
3529
- given_name: string;
3530
- family_name?: string | null | undefined;
3531
- picture?: string | null | undefined;
3532
- encryption_public_key: string;
3533
- is_sso: boolean;
3534
- is_identity_verified: boolean;
3535
- };
3536
- recipient: {
3537
- external_id: string;
3538
- parent_ext_id?: string | null | undefined;
3539
- email: string;
3540
- given_name: string;
3541
- family_name?: string | null | undefined;
3542
- picture?: string | null | undefined;
3543
- encryption_public_key: string;
3544
- is_sso: boolean;
3545
- is_identity_verified: boolean;
3546
- };
3547
- workspace_ext_id?: string | null | undefined;
3548
- dm_context_only: boolean;
3549
- content?: string | null | undefined;
3550
- attachments?: string | null | undefined;
3551
- conversation_ext_id?: string | null | undefined;
3552
- message_ext_id?: string | null | undefined;
3553
- read: boolean;
3554
- created_at: string;
3555
- updated_at: string;
3556
- }[]>;
3498
+ declare function addChatMembers(arbi: ArbiClient, ring: ChatKeyRing, members: ChatMemberKey[]): Promise<ChatResponse>;
3499
+ /** Remove a member (owners) or leave (my own id). The chat then needs a new epoch. */
3500
+ declare function removeChatMember(arbi: ArbiClient, chatExtId: string, userExtId: string): Promise<void>;
3557
3501
  /**
3558
- * Resolve a recipient reference (email OR `usr-`/`agt-` external_id) into the
3559
- * `{ extId, pubKey }` an encrypted send needs. Walks three directories in order
3560
- * — contacts, parent-owned agents, current-workspace members — and stops at the
3561
- * first hit with a usable curve25519 public key. Returns `null` when nothing
3562
- * matches so callers can surface a recovery hint.
3563
- *
3564
- * This is the single resolution path shared by the app, the CLI and seeding —
3565
- * no consumer should re-implement directory lookups.
3502
+ * Start epoch `key_version + 1`: a fresh key sealed to exactly the current members, the title
3503
+ * re-encrypted under it. Needs the current epoch's key only when the chat has a title.
3566
3504
  */
3567
- declare function resolveRecipient(arbi: ArbiClient, ref: string): Promise<ResolvedRecipient | null>;
3505
+ declare function rotateChatKey(arbi: ArbiClient, chat: ChatResponse, ring: ChatKeyRing): Promise<ChatResponse>;
3568
3506
  /**
3569
- * Send an E2E encrypted DM.
3570
- *
3571
- * Encrypts plaintext content for each recipient using their public key.
3572
- * Requires recipient public keys — fetch via contacts or user lookup first.
3573
- *
3574
- * Attachments are uploaded first with `uploadDmAttachments`; pass the returned files as
3575
- * `options.attachments`. Their manifest (which carries the per-file keys) is encrypted for each
3576
- * recipient with the same pair key as the content, and the server links the uploads to every
3577
- * notification created.
3578
- *
3579
- * Returns the created notifications with their content as **plaintext**, not
3580
- * ciphertext — matching what `listDecryptedDMs` returns. The sender supplied the
3581
- * text, so it is handed straight back: a caller must never have to re-fetch and
3582
- * re-decrypt its own ciphertext just to render the message it has just sent.
3583
- *
3584
- * @param arbi - ArbiClient instance
3585
- * @param messages - Array of { recipient_ext_id, content (plaintext), recipient_encryption_public_key }
3586
- * @param crypto - DM crypto context for the sender
3507
+ * Make sure a chat can be posted to: when it is `rotation_required` and I am a member, seal the
3508
+ * next epoch. Another member may win the race (409); then the fresh chat is fetched instead.
3587
3509
  */
3588
- declare function sendEncryptedDM(arbi: ArbiClient, messages: Array<{
3589
- recipient_ext_id: string;
3590
- content: string;
3591
- recipient_encryption_public_key: string;
3592
- }>, crypto: DmCryptoContext, options?: {
3593
- attachments?: DmAttachmentFile[];
3594
- }): Promise<DecryptedDmNotification[]>;
3510
+ declare function ensureChatKeyCurrent(arbi: ArbiClient, chat: ChatResponse, crypto: ChatCryptoContext): Promise<ChatResponse>;
3511
+ /** One page of messages, newest first. Page backwards with `before` = the oldest id you have. */
3512
+ declare function listChatMessages(arbi: ArbiClient, chatExtId: string, options?: {
3513
+ before?: string;
3514
+ limit?: number;
3515
+ }): Promise<ChatMessageResponse[]>;
3516
+ interface SendChatMessageOptions {
3517
+ /** Already uploaded with `uploadChatAttachments`. */
3518
+ attachments?: ChatAttachmentFile[];
3519
+ /** PA chat only: the workspace my agent acts in. */
3520
+ workspaceExtId?: string;
3521
+ /** PA chat only: a context note the agent records without replying. */
3522
+ contextOnly?: boolean;
3523
+ }
3595
3524
  /**
3596
- * Ask another user to grant you workspace access.
3597
- *
3598
- * Creates a `workspace_access_request` notification. The `content` is an
3599
- * opaque base64 blob, E2E-encrypted with the requester↔recipient shared key
3600
- * (same scheme as a DM), carrying the requester's live session public key
3601
- * (`sessionPubkeyB64`) so the recipient can mint a temporary, session-scoped
3602
- * grant, plus an optional note.
3603
- *
3604
- * `workspaceExtId` is optional and only meaningful for API/SDK/CLI callers who
3605
- * already know a workspace id (obtained out-of-band); omit it and the recipient
3606
- * picks the workspace.
3525
+ * Post a message under the current epoch. Returns it with `content` as the **plaintext** sent —
3526
+ * a caller never re-decrypts its own message to render it.
3607
3527
  */
3608
- declare function requestWorkspaceAccess(arbi: ArbiClient, params: {
3609
- recipientExtId: string;
3610
- recipientEncryptionPublicKey: string;
3611
- sessionPubkeyB64: string;
3612
- note?: string;
3613
- workspaceExtId?: string;
3614
- }, crypto: DmCryptoContext): Promise<{
3615
- type: components["schemas"]["NotificationType"];
3616
- external_id: string;
3617
- sender: {
3618
- external_id: string;
3619
- parent_ext_id?: string | null | undefined;
3620
- email: string;
3621
- given_name: string;
3622
- family_name?: string | null | undefined;
3623
- picture?: string | null | undefined;
3624
- encryption_public_key: string;
3625
- is_sso: boolean;
3626
- is_identity_verified: boolean;
3627
- };
3628
- recipient: {
3629
- external_id: string;
3630
- parent_ext_id?: string | null | undefined;
3631
- email: string;
3632
- given_name: string;
3633
- family_name?: string | null | undefined;
3634
- picture?: string | null | undefined;
3635
- encryption_public_key: string;
3636
- is_sso: boolean;
3637
- is_identity_verified: boolean;
3638
- };
3639
- workspace_ext_id?: string | null | undefined;
3640
- dm_context_only: boolean;
3641
- content?: string | null | undefined;
3642
- attachments?: string | null | undefined;
3643
- conversation_ext_id?: string | null | undefined;
3644
- message_ext_id?: string | null | undefined;
3645
- read: boolean;
3646
- created_at: string;
3647
- updated_at: string;
3648
- }>;
3528
+ declare function sendChatMessage(arbi: ArbiClient, ring: ChatKeyRing, text: string, options?: SendChatMessageOptions): Promise<DecryptedChatMessage>;
3529
+ declare function deleteChatMessage(arbi: ArbiClient, chatExtId: string, messageExtId: string): Promise<void>;
3530
+ /** Move my read watermark to a message (or to now). */
3531
+ declare function markChatRead(arbi: ArbiClient, chatExtId: string, messageExtId?: string): Promise<components['schemas']['ChatReadResponse']>;
3532
+ /** True when `member` has read `message` (by their watermark). */
3533
+ declare function hasRead(member: Pick<ChatMemberResponse, 'last_read_at'> | undefined, message: Pick<ChatMessageResponse, 'created_at'>): boolean;
3649
3534
  /**
3650
- * Send a plaintext DM (no encryption).
3651
- * @deprecated Use sendEncryptedDM instead.
3535
+ * Resolve a peer reference (email OR `usr-`/`agt-` external_id) to `{ extId, pubKey }`. Walks
3536
+ * contacts, my agents, then current-workspace members; null when nothing matches.
3652
3537
  */
3653
- declare function sendDM(arbi: ArbiClient, messages: Array<{
3654
- recipient_ext_id: string;
3655
- content: string;
3656
- }>): Promise<{
3657
- type: components["schemas"]["NotificationType"];
3658
- external_id: string;
3659
- sender: {
3660
- external_id: string;
3661
- parent_ext_id?: string | null | undefined;
3662
- email: string;
3663
- given_name: string;
3664
- family_name?: string | null | undefined;
3665
- picture?: string | null | undefined;
3666
- encryption_public_key: string;
3667
- is_sso: boolean;
3668
- is_identity_verified: boolean;
3669
- };
3670
- recipient: {
3671
- external_id: string;
3672
- parent_ext_id?: string | null | undefined;
3673
- email: string;
3674
- given_name: string;
3675
- family_name?: string | null | undefined;
3676
- picture?: string | null | undefined;
3677
- encryption_public_key: string;
3678
- is_sso: boolean;
3679
- is_identity_verified: boolean;
3680
- };
3681
- workspace_ext_id?: string | null | undefined;
3682
- dm_context_only: boolean;
3683
- content?: string | null | undefined;
3684
- attachments?: string | null | undefined;
3685
- conversation_ext_id?: string | null | undefined;
3686
- message_ext_id?: string | null | undefined;
3687
- read: boolean;
3688
- created_at: string;
3689
- updated_at: string;
3690
- }[]>;
3691
- declare function markRead(arbi: ArbiClient, messageIds: string[]): Promise<{
3692
- type: components["schemas"]["NotificationType"];
3693
- external_id: string;
3694
- sender: {
3695
- external_id: string;
3696
- parent_ext_id?: string | null | undefined;
3697
- email: string;
3698
- given_name: string;
3699
- family_name?: string | null | undefined;
3700
- picture?: string | null | undefined;
3701
- encryption_public_key: string;
3702
- is_sso: boolean;
3703
- is_identity_verified: boolean;
3704
- };
3705
- recipient: {
3706
- external_id: string;
3707
- parent_ext_id?: string | null | undefined;
3708
- email: string;
3709
- given_name: string;
3710
- family_name?: string | null | undefined;
3711
- picture?: string | null | undefined;
3712
- encryption_public_key: string;
3713
- is_sso: boolean;
3714
- is_identity_verified: boolean;
3715
- };
3716
- workspace_ext_id?: string | null | undefined;
3717
- dm_context_only: boolean;
3718
- content?: string | null | undefined;
3719
- attachments?: string | null | undefined;
3720
- conversation_ext_id?: string | null | undefined;
3721
- message_ext_id?: string | null | undefined;
3722
- read: boolean;
3723
- created_at: string;
3724
- updated_at: string;
3725
- }[]>;
3726
- declare function deleteDMs(arbi: ArbiClient, messageIds: string[]): Promise<void>;
3538
+ declare function resolveRecipient(arbi: ArbiClient, ref: string): Promise<ResolvedRecipient | null>;
3539
+ /** Open (get-or-create) the direct chat with a peer and send one message to it. */
3540
+ declare function sendDirectMessage(arbi: ArbiClient, crypto: ChatCryptoContext, peerExtId: string, text: string, options?: SendChatMessageOptions): Promise<DecryptedChatMessage>;
3541
+ /** A chat with its keys opened and its messages decrypted (oldest first). */
3542
+ interface DecryptedChat {
3543
+ chat: ChatResponse;
3544
+ ring: ChatKeyRing;
3545
+ title: string | null;
3546
+ messages: DecryptedChatMessage[];
3547
+ }
3548
+ /** Load and decrypt the newest `limit` messages of a chat, returned oldest first. */
3549
+ declare function loadDecryptedChat(arbi: ArbiClient, crypto: ChatCryptoContext, chat: ChatResponse, options?: {
3550
+ limit?: number;
3551
+ }): Promise<DecryptedChat>;
3727
3552
 
3728
- declare const dm_DM_ATTACHMENT_MAX_BYTES: typeof DM_ATTACHMENT_MAX_BYTES;
3729
- declare const dm_DM_ATTACHMENT_MAX_FILES: typeof DM_ATTACHMENT_MAX_FILES;
3730
- type dm_DecryptedDmNotification = DecryptedDmNotification;
3731
- type dm_DmAttachmentFile = DmAttachmentFile;
3732
- type dm_DmAttachmentInput = DmAttachmentInput;
3733
- type dm_DmCryptoContext = DmCryptoContext;
3734
- type dm_ResolvedRecipient = ResolvedRecipient;
3735
- declare const dm_checkDmAttachmentLimits: typeof checkDmAttachmentLimits;
3736
- declare const dm_createDmCryptoContext: typeof createDmCryptoContext;
3737
- declare const dm_decryptDmAttachments: typeof decryptDmAttachments;
3738
- declare const dm_decryptDmBatch: typeof decryptDmBatch;
3739
- declare const dm_decryptDmContent: typeof decryptDmContent;
3740
- declare const dm_deleteDMs: typeof deleteDMs;
3741
- declare const dm_downloadDmAttachment: typeof downloadDmAttachment;
3742
- declare const dm_encryptDmAttachmentManifest: typeof encryptDmAttachmentManifest;
3743
- declare const dm_encryptDmContent: typeof encryptDmContent;
3744
- declare const dm_listActivity: typeof listActivity;
3745
- declare const dm_listDMs: typeof listDMs;
3746
- declare const dm_listDecryptedDMs: typeof listDecryptedDMs;
3747
- declare const dm_markRead: typeof markRead;
3748
- declare const dm_parseDmAttachmentManifest: typeof parseDmAttachmentManifest;
3749
- declare const dm_requestWorkspaceAccess: typeof requestWorkspaceAccess;
3750
- declare const dm_resolveRecipient: typeof resolveRecipient;
3751
- declare const dm_sendDM: typeof sendDM;
3752
- declare const dm_sendEncryptedDM: typeof sendEncryptedDM;
3753
- declare const dm_serializeDmAttachmentManifest: typeof serializeDmAttachmentManifest;
3754
- declare const dm_uploadDmAttachment: typeof uploadDmAttachment;
3755
- declare const dm_uploadDmAttachments: typeof uploadDmAttachments;
3756
- declare namespace dm {
3757
- export { dm_DM_ATTACHMENT_MAX_BYTES as DM_ATTACHMENT_MAX_BYTES, dm_DM_ATTACHMENT_MAX_FILES as DM_ATTACHMENT_MAX_FILES, type dm_DecryptedDmNotification as DecryptedDmNotification, type dm_DmAttachmentFile as DmAttachmentFile, type dm_DmAttachmentInput as DmAttachmentInput, type dm_DmCryptoContext as DmCryptoContext, type dm_ResolvedRecipient as ResolvedRecipient, dm_checkDmAttachmentLimits as checkDmAttachmentLimits, dm_createDmCryptoContext as createDmCryptoContext, dm_decryptDmAttachments as decryptDmAttachments, dm_decryptDmBatch as decryptDmBatch, dm_decryptDmContent as decryptDmContent, dm_deleteDMs as deleteDMs, dm_downloadDmAttachment as downloadDmAttachment, dm_encryptDmAttachmentManifest as encryptDmAttachmentManifest, dm_encryptDmContent as encryptDmContent, dm_listActivity as listActivity, dm_listDMs as listDMs, dm_listDecryptedDMs as listDecryptedDMs, dm_markRead as markRead, dm_parseDmAttachmentManifest as parseDmAttachmentManifest, dm_requestWorkspaceAccess as requestWorkspaceAccess, dm_resolveRecipient as resolveRecipient, dm_sendDM as sendDM, dm_sendEncryptedDM as sendEncryptedDM, dm_serializeDmAttachmentManifest as serializeDmAttachmentManifest, dm_uploadDmAttachment as uploadDmAttachment, dm_uploadDmAttachments as uploadDmAttachments };
3553
+ declare const chats_CHAT_ATTACHMENT_MAX_BYTES: typeof CHAT_ATTACHMENT_MAX_BYTES;
3554
+ declare const chats_CHAT_ATTACHMENT_MAX_FILES: typeof CHAT_ATTACHMENT_MAX_FILES;
3555
+ type chats_ChatAttachmentFile = ChatAttachmentFile;
3556
+ type chats_ChatAttachmentInput = ChatAttachmentInput;
3557
+ type chats_ChatCryptoContext = ChatCryptoContext;
3558
+ type chats_ChatKeyRing = ChatKeyRing;
3559
+ type chats_ChatKind = ChatKind;
3560
+ type chats_ChatMemberKey = ChatMemberKey;
3561
+ type chats_ChatMemberResponse = ChatMemberResponse;
3562
+ type chats_ChatMessageResponse = ChatMessageResponse;
3563
+ type chats_ChatResponse = ChatResponse;
3564
+ declare const chats_DECRYPTION_FAILED: typeof DECRYPTION_FAILED;
3565
+ type chats_DecryptedChat = DecryptedChat;
3566
+ type chats_DecryptedChatMessage = DecryptedChatMessage;
3567
+ type chats_ResolvedRecipient = ResolvedRecipient;
3568
+ type chats_SendChatMessageOptions = SendChatMessageOptions;
3569
+ declare const chats_addChatMembers: typeof addChatMembers;
3570
+ declare const chats_checkChatAttachmentLimits: typeof checkChatAttachmentLimits;
3571
+ declare const chats_createChatCryptoContext: typeof createChatCryptoContext;
3572
+ declare const chats_createGroupChat: typeof createGroupChat;
3573
+ declare const chats_decryptChatAttachmentManifest: typeof decryptChatAttachmentManifest;
3574
+ declare const chats_decryptChatMessage: typeof decryptChatMessage;
3575
+ declare const chats_decryptChatMessages: typeof decryptChatMessages;
3576
+ declare const chats_decryptChatTitle: typeof decryptChatTitle;
3577
+ declare const chats_deleteChatMessage: typeof deleteChatMessage;
3578
+ declare const chats_directPeer: typeof directPeer;
3579
+ declare const chats_downloadChatAttachment: typeof downloadChatAttachment;
3580
+ declare const chats_encryptChatAttachmentManifest: typeof encryptChatAttachmentManifest;
3581
+ declare const chats_ensureChatKeyCurrent: typeof ensureChatKeyCurrent;
3582
+ declare const chats_getChat: typeof getChat;
3583
+ declare const chats_hasRead: typeof hasRead;
3584
+ declare const chats_isAgentExtId: typeof isAgentExtId;
3585
+ declare const chats_listChatMessages: typeof listChatMessages;
3586
+ declare const chats_listChats: typeof listChats;
3587
+ declare const chats_loadDecryptedChat: typeof loadDecryptedChat;
3588
+ declare const chats_markChatRead: typeof markChatRead;
3589
+ declare const chats_openChatKeyRing: typeof openChatKeyRing;
3590
+ declare const chats_openDirectChat: typeof openDirectChat;
3591
+ declare const chats_parseChatAttachmentManifest: typeof parseChatAttachmentManifest;
3592
+ declare const chats_removeChatMember: typeof removeChatMember;
3593
+ declare const chats_renameChat: typeof renameChat;
3594
+ declare const chats_resolveRecipient: typeof resolveRecipient;
3595
+ declare const chats_rotateChatKey: typeof rotateChatKey;
3596
+ declare const chats_sendChatMessage: typeof sendChatMessage;
3597
+ declare const chats_sendDirectMessage: typeof sendDirectMessage;
3598
+ declare const chats_serializeChatAttachmentManifest: typeof serializeChatAttachmentManifest;
3599
+ declare const chats_uploadChatAttachment: typeof uploadChatAttachment;
3600
+ declare const chats_uploadChatAttachments: typeof uploadChatAttachments;
3601
+ declare namespace chats {
3602
+ export { chats_CHAT_ATTACHMENT_MAX_BYTES as CHAT_ATTACHMENT_MAX_BYTES, chats_CHAT_ATTACHMENT_MAX_FILES as CHAT_ATTACHMENT_MAX_FILES, type chats_ChatAttachmentFile as ChatAttachmentFile, type chats_ChatAttachmentInput as ChatAttachmentInput, type chats_ChatCryptoContext as ChatCryptoContext, type chats_ChatKeyRing as ChatKeyRing, type chats_ChatKind as ChatKind, type chats_ChatMemberKey as ChatMemberKey, type chats_ChatMemberResponse as ChatMemberResponse, type chats_ChatMessageResponse as ChatMessageResponse, type chats_ChatResponse as ChatResponse, chats_DECRYPTION_FAILED as DECRYPTION_FAILED, type chats_DecryptedChat as DecryptedChat, type chats_DecryptedChatMessage as DecryptedChatMessage, type chats_ResolvedRecipient as ResolvedRecipient, type chats_SendChatMessageOptions as SendChatMessageOptions, chats_addChatMembers as addChatMembers, chats_checkChatAttachmentLimits as checkChatAttachmentLimits, chats_createChatCryptoContext as createChatCryptoContext, chats_createGroupChat as createGroupChat, chats_decryptChatAttachmentManifest as decryptChatAttachmentManifest, chats_decryptChatMessage as decryptChatMessage, chats_decryptChatMessages as decryptChatMessages, chats_decryptChatTitle as decryptChatTitle, chats_deleteChatMessage as deleteChatMessage, chats_directPeer as directPeer, chats_downloadChatAttachment as downloadChatAttachment, chats_encryptChatAttachmentManifest as encryptChatAttachmentManifest, chats_ensureChatKeyCurrent as ensureChatKeyCurrent, chats_getChat as getChat, chats_hasRead as hasRead, chats_isAgentExtId as isAgentExtId, chats_listChatMessages as listChatMessages, chats_listChats as listChats, chats_loadDecryptedChat as loadDecryptedChat, chats_markChatRead as markChatRead, chats_openChatKeyRing as openChatKeyRing, chats_openDirectChat as openDirectChat, chats_parseChatAttachmentManifest as parseChatAttachmentManifest, chats_removeChatMember as removeChatMember, chats_renameChat as renameChat, chats_resolveRecipient as resolveRecipient, chats_rotateChatKey as rotateChatKey, chats_sendChatMessage as sendChatMessage, chats_sendDirectMessage as sendDirectMessage, chats_serializeChatAttachmentManifest as serializeChatAttachmentManifest, chats_uploadChatAttachment as uploadChatAttachment, chats_uploadChatAttachments as uploadChatAttachments };
3758
3603
  }
3759
3604
 
3760
3605
  /**
@@ -5599,7 +5444,7 @@ declare class Arbi {
5599
5444
  private currentWorkspaceId;
5600
5445
  /** Wrapped workspace keys seen in the last list/create, so selecting needs no re-fetch. */
5601
5446
  private readonly wrappedKeys;
5602
- private dmCryptoContext;
5447
+ private chatCryptoContext;
5603
5448
  private readonly sessionExpiredListeners;
5604
5449
  private readonly options;
5605
5450
  constructor(options: ArbiOptions);
@@ -6269,6 +6114,67 @@ declare class Arbi {
6269
6114
  is_deployment_admin: boolean;
6270
6115
  }>;
6271
6116
  };
6117
+ readonly firm: {
6118
+ /** The firm's pooled monthly £ of AI usage (`has_pool` false where there is none). */
6119
+ pool: () => Promise<{
6120
+ has_pool: boolean;
6121
+ month?: string | null;
6122
+ resets_at?: string | null;
6123
+ licence_status?: string | null;
6124
+ expires_at?: string | null;
6125
+ premium_only: boolean;
6126
+ box_seats?: number | null;
6127
+ plus_seats?: number | null;
6128
+ ai_addons?: number | null;
6129
+ addon_gbp?: number | null;
6130
+ base_gbp?: number | null;
6131
+ auto_addons?: number | null;
6132
+ auto_addon_gbp?: number | null;
6133
+ auto_addon_price_pence?: number | null;
6134
+ auto_addon_spent_pence?: number | null;
6135
+ auto_addon_limit_pence?: number | null;
6136
+ total_gbp?: number | null;
6137
+ used_gbp?: number | null;
6138
+ remaining_gbp?: number | null;
6139
+ people_this_month?: number | null;
6140
+ report_computed_at?: string | null;
6141
+ subscription_status?: string | null;
6142
+ cancel_at_period_end?: boolean | null;
6143
+ period_end?: string | null;
6144
+ can_top_up: boolean;
6145
+ }>;
6146
+ /** Buy `aiAddons` renewing add-ons (+£10 of AI usage a month each) for the firm. Box admins only. */
6147
+ topUp: (aiAddons: number) => Promise<{
6148
+ pool: {
6149
+ has_pool: boolean;
6150
+ month?: string | null | undefined;
6151
+ resets_at?: string | null | undefined;
6152
+ licence_status?: string | null | undefined;
6153
+ expires_at?: string | null | undefined;
6154
+ premium_only: boolean;
6155
+ box_seats?: number | null | undefined;
6156
+ plus_seats?: number | null | undefined;
6157
+ ai_addons?: number | null | undefined;
6158
+ addon_gbp?: number | null | undefined;
6159
+ base_gbp?: number | null | undefined;
6160
+ auto_addons?: number | null | undefined;
6161
+ auto_addon_gbp?: number | null | undefined;
6162
+ auto_addon_price_pence?: number | null | undefined;
6163
+ auto_addon_spent_pence?: number | null | undefined;
6164
+ auto_addon_limit_pence?: number | null | undefined;
6165
+ total_gbp?: number | null | undefined;
6166
+ used_gbp?: number | null | undefined;
6167
+ remaining_gbp?: number | null | undefined;
6168
+ people_this_month?: number | null | undefined;
6169
+ report_computed_at?: string | null | undefined;
6170
+ subscription_status?: string | null | undefined;
6171
+ cancel_at_period_end?: boolean | null | undefined;
6172
+ period_end?: string | null | undefined;
6173
+ can_top_up: boolean;
6174
+ };
6175
+ invoice_url?: string | null | undefined;
6176
+ }>;
6177
+ };
6272
6178
  readonly profile: {
6273
6179
  /** Update the display profile; pass only what changes (`''` clears family name or picture). */
6274
6180
  update: (body: UpdateProfileRequest) => Promise<{
@@ -6686,9 +6592,7 @@ declare class Arbi {
6686
6592
  is_identity_verified: boolean;
6687
6593
  };
6688
6594
  workspace_ext_id?: string | null | undefined;
6689
- dm_context_only: boolean;
6690
6595
  content?: string | null | undefined;
6691
- attachments?: string | null | undefined;
6692
6596
  conversation_ext_id?: string | null | undefined;
6693
6597
  message_ext_id?: string | null | undefined;
6694
6598
  read: boolean;
@@ -7093,6 +6997,7 @@ declare class Arbi {
7093
6997
  last_message_updated_at?: string | null | undefined;
7094
6998
  last_message_status?: string | null | undefined;
7095
6999
  assistant_mode: components["schemas"]["AssistantMode"];
7000
+ meeting_call_ext_id?: string | null | undefined;
7096
7001
  status?: (components["schemas"]["WorkStatus"] | null) | undefined;
7097
7002
  description?: string | null | undefined;
7098
7003
  due_at?: string | null | undefined;
@@ -7382,6 +7287,12 @@ declare class Arbi {
7382
7287
  name: "workflow_step";
7383
7288
  description: string;
7384
7289
  workflow_step: string;
7290
+ } | {
7291
+ name: "transcript_segment";
7292
+ description: string;
7293
+ segment_id: string;
7294
+ speaker_ext_id: string;
7295
+ started_at?: string | null | undefined;
7385
7296
  } | {
7386
7297
  name: "mail_context";
7387
7298
  description: string;
@@ -7432,6 +7343,7 @@ declare class Arbi {
7432
7343
  last_message_updated_at?: string | null;
7433
7344
  last_message_status?: string | null;
7434
7345
  assistant_mode: components["schemas"]["AssistantMode"];
7346
+ meeting_call_ext_id?: string | null;
7435
7347
  status?: components["schemas"]["WorkStatus"] | null;
7436
7348
  description?: string | null;
7437
7349
  due_at?: string | null;
@@ -7475,6 +7387,7 @@ declare class Arbi {
7475
7387
  last_message_updated_at?: string | null;
7476
7388
  last_message_status?: string | null;
7477
7389
  assistant_mode: components["schemas"]["AssistantMode"];
7390
+ meeting_call_ext_id?: string | null;
7478
7391
  status?: components["schemas"]["WorkStatus"] | null;
7479
7392
  description?: string | null;
7480
7393
  due_at?: string | null;
@@ -7518,6 +7431,7 @@ declare class Arbi {
7518
7431
  last_message_updated_at?: string | null;
7519
7432
  last_message_status?: string | null;
7520
7433
  assistant_mode: components["schemas"]["AssistantMode"];
7434
+ meeting_call_ext_id?: string | null;
7521
7435
  status?: components["schemas"]["WorkStatus"] | null;
7522
7436
  description?: string | null;
7523
7437
  due_at?: string | null;
@@ -7578,6 +7492,7 @@ declare class Arbi {
7578
7492
  last_message_updated_at?: string | null;
7579
7493
  last_message_status?: string | null;
7580
7494
  assistant_mode: components["schemas"]["AssistantMode"];
7495
+ meeting_call_ext_id?: string | null;
7581
7496
  status?: components["schemas"]["WorkStatus"] | null;
7582
7497
  description?: string | null;
7583
7498
  due_at?: string | null;
@@ -7621,6 +7536,7 @@ declare class Arbi {
7621
7536
  last_message_updated_at?: string | null;
7622
7537
  last_message_status?: string | null;
7623
7538
  assistant_mode: components["schemas"]["AssistantMode"];
7539
+ meeting_call_ext_id?: string | null;
7624
7540
  status?: components["schemas"]["WorkStatus"] | null;
7625
7541
  description?: string | null;
7626
7542
  due_at?: string | null;
@@ -7664,6 +7580,7 @@ declare class Arbi {
7664
7580
  last_message_updated_at?: string | null;
7665
7581
  last_message_status?: string | null;
7666
7582
  assistant_mode: components["schemas"]["AssistantMode"];
7583
+ meeting_call_ext_id?: string | null;
7667
7584
  status?: components["schemas"]["WorkStatus"] | null;
7668
7585
  description?: string | null;
7669
7586
  due_at?: string | null;
@@ -7710,6 +7627,7 @@ declare class Arbi {
7710
7627
  last_message_updated_at?: string | null;
7711
7628
  last_message_status?: string | null;
7712
7629
  assistant_mode: components["schemas"]["AssistantMode"];
7630
+ meeting_call_ext_id?: string | null;
7713
7631
  status?: components["schemas"]["WorkStatus"] | null;
7714
7632
  description?: string | null;
7715
7633
  due_at?: string | null;
@@ -7794,6 +7712,7 @@ declare class Arbi {
7794
7712
  last_message_updated_at?: string | null;
7795
7713
  last_message_status?: string | null;
7796
7714
  assistant_mode: components["schemas"]["AssistantMode"];
7715
+ meeting_call_ext_id?: string | null;
7797
7716
  status?: components["schemas"]["WorkStatus"] | null;
7798
7717
  description?: string | null;
7799
7718
  due_at?: string | null;
@@ -7987,6 +7906,12 @@ declare class Arbi {
7987
7906
  name: "workflow_step";
7988
7907
  description: string;
7989
7908
  workflow_step: string;
7909
+ } | {
7910
+ name: "transcript_segment";
7911
+ description: string;
7912
+ segment_id: string;
7913
+ speaker_ext_id: string;
7914
+ started_at?: string | null | undefined;
7990
7915
  } | {
7991
7916
  name: "mail_context";
7992
7917
  description: string;
@@ -8181,6 +8106,12 @@ declare class Arbi {
8181
8106
  name: "workflow_step";
8182
8107
  description: string;
8183
8108
  workflow_step: string;
8109
+ } | {
8110
+ name: "transcript_segment";
8111
+ description: string;
8112
+ segment_id: string;
8113
+ speaker_ext_id: string;
8114
+ started_at?: string | null | undefined;
8184
8115
  } | {
8185
8116
  name: "mail_context";
8186
8117
  description: string;
@@ -8237,9 +8168,7 @@ declare class Arbi {
8237
8168
  is_identity_verified: boolean;
8238
8169
  };
8239
8170
  workspace_ext_id?: string | null | undefined;
8240
- dm_context_only: boolean;
8241
8171
  content?: string | null | undefined;
8242
- attachments?: string | null | undefined;
8243
8172
  conversation_ext_id?: string | null | undefined;
8244
8173
  message_ext_id?: string | null | undefined;
8245
8174
  read: boolean;
@@ -8570,121 +8499,191 @@ declare class Arbi {
8570
8499
  };
8571
8500
  readonly contacts: {
8572
8501
  list: () => Promise<{
8573
- external_id?: string | null | undefined;
8574
- email: string;
8575
- user?: {
8576
- external_id: string;
8577
- parent_ext_id?: string | null | undefined;
8578
- email: string;
8579
- given_name: string;
8580
- family_name?: string | null | undefined;
8581
- picture?: string | null | undefined;
8582
- encryption_public_key: string;
8583
- is_sso: boolean;
8584
- is_identity_verified: boolean;
8585
- } | null | undefined;
8586
- status: "invitation_pending" | "invitation_expired" | "registered" | "failed";
8502
+ external_id?: string | null;
8503
+ email?: string | null;
8504
+ user?: components["schemas"]["UserResponse"] | null;
8505
+ status: ("registered" | "invited" | "expired" | "card") | "failed";
8506
+ card?: components["schemas"]["ContactCard"] | null;
8507
+ address_book_ext_id?: string | null;
8587
8508
  created_at: string;
8588
- shared_workspace_ext_id?: string | null | undefined;
8589
- outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null | undefined;
8590
- outcome_detail?: string | null | undefined;
8509
+ shared_workspace_ext_id?: string | null;
8510
+ outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null;
8511
+ outcome_detail?: string | null;
8591
8512
  }[]>;
8592
- add: (emails: string[]) => Promise<{
8593
- external_id?: string | null | undefined;
8594
- email: string;
8595
- user?: {
8596
- external_id: string;
8597
- parent_ext_id?: string | null | undefined;
8598
- email: string;
8599
- given_name: string;
8600
- family_name?: string | null | undefined;
8601
- picture?: string | null | undefined;
8602
- encryption_public_key: string;
8603
- is_sso: boolean;
8604
- is_identity_verified: boolean;
8605
- } | null | undefined;
8606
- status: "invitation_pending" | "invitation_expired" | "registered" | "failed";
8513
+ invite: (emails: string[]) => Promise<{
8514
+ external_id?: string | null;
8515
+ email?: string | null;
8516
+ user?: components["schemas"]["UserResponse"] | null;
8517
+ status: ("registered" | "invited" | "expired" | "card") | "failed";
8518
+ card?: components["schemas"]["ContactCard"] | null;
8519
+ address_book_ext_id?: string | null;
8520
+ created_at: string;
8521
+ shared_workspace_ext_id?: string | null;
8522
+ outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null;
8523
+ outcome_detail?: string | null;
8524
+ }[]>;
8525
+ create: (body: ContactCreate) => Promise<{
8526
+ external_id?: string | null;
8527
+ email?: string | null;
8528
+ user?: components["schemas"]["UserResponse"] | null;
8529
+ status: ("registered" | "invited" | "expired" | "card") | "failed";
8530
+ card?: components["schemas"]["ContactCard"] | null;
8531
+ address_book_ext_id?: string | null;
8532
+ created_at: string;
8533
+ shared_workspace_ext_id?: string | null;
8534
+ outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null;
8535
+ outcome_detail?: string | null;
8536
+ }>;
8537
+ update: (contactId: string, card: ContactCardWrite) => Promise<{
8538
+ external_id?: string | null;
8539
+ email?: string | null;
8540
+ user?: components["schemas"]["UserResponse"] | null;
8541
+ status: ("registered" | "invited" | "expired" | "card") | "failed";
8542
+ card?: components["schemas"]["ContactCard"] | null;
8543
+ address_book_ext_id?: string | null;
8607
8544
  created_at: string;
8608
- shared_workspace_ext_id?: string | null | undefined;
8609
- outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null | undefined;
8610
- outcome_detail?: string | null | undefined;
8545
+ shared_workspace_ext_id?: string | null;
8546
+ outcome?: ("invited" | "reinvited" | "not_resent_still_pending" | "contact_added" | "already_contact" | "failed") | null;
8547
+ outcome_detail?: string | null;
8548
+ }>;
8549
+ delete: (contactId: string) => Promise<void>;
8550
+ search: (q: string) => Promise<{
8551
+ email: string;
8552
+ name?: string | null;
8553
+ user_id?: string | null;
8554
+ contact_id?: string | null;
8555
+ source: "contacts" | "arbi";
8611
8556
  }[]>;
8612
- remove: (contactIds: string[]) => Promise<void>;
8613
8557
  groupByStatus: typeof groupContactsByStatus;
8614
8558
  };
8615
8559
  /**
8616
- * Build (and cache) the DM crypto context for the current session.
8560
+ * Build (and cache) the chat crypto context for the current session: my X25519 keypair
8561
+ * (derived from the signing key) and external id. Cleared on logout.
8617
8562
  *
8618
- * Derives the user's curve25519 keypair from their signing key and pairs it
8619
- * with their external_id — everything `list()`/`send()` need to encrypt and
8620
- * decrypt. Cached for the session and cleared on logout. Consumers never touch
8621
- * this: it's an internal of the `dm` surface.
8622
- *
8623
- * The key comes from the live login result first, exactly as `selectWorkspace`
8624
- * sources it, and only then from persisted storage (which is what restores a
8625
- * session on reload). Reading storage first would make DMs the one feature that
8626
- * breaks whenever persistence is unavailable — `saveSession` deliberately
8627
- * no-ops without Web Crypto (a non-secure origin, tracking prevention, an
8628
- * embedded widget), so a perfectly authenticated user with a working workspace
8629
- * would be told they are "not authenticated" the moment they opened Messages.
8563
+ * The key comes from the live login result first, exactly as `selectWorkspace` sources it, and
8564
+ * only then from persisted storage (which is what restores a session on reload) — persistence
8565
+ * deliberately no-ops without Web Crypto, and chats must not be the one feature that breaks then.
8630
8566
  */
8631
- private requireDmCrypto;
8567
+ private requireChatCrypto;
8568
+ /** Fetch a chat, sealing a new epoch first when it is `rotation_required`. */
8569
+ private readyChat;
8570
+ readonly chats: {
8571
+ /** My chats, most recently active first (raw: titles/last messages are ciphertext). */
8572
+ list: (kind?: ChatKind) => Promise<{
8573
+ external_id: string;
8574
+ kind: "direct" | "group" | "meeting";
8575
+ title?: string | null;
8576
+ key_version: number;
8577
+ rotation_required: boolean;
8578
+ last_message_at?: string | null;
8579
+ created_at: string;
8580
+ members: components["schemas"]["ChatMemberResponse"][];
8581
+ my_keys?: components["schemas"]["ChatKeyResponse"][];
8582
+ unread_count: number;
8583
+ last_message?: components["schemas"]["ChatMessageResponse"] | null;
8584
+ call_ext_id?: string | null;
8585
+ }[]>;
8586
+ get: (chatExtId: string) => Promise<{
8587
+ external_id: string;
8588
+ kind: "direct" | "group" | "meeting";
8589
+ title?: string | null;
8590
+ key_version: number;
8591
+ rotation_required: boolean;
8592
+ last_message_at?: string | null;
8593
+ created_at: string;
8594
+ members: components["schemas"]["ChatMemberResponse"][];
8595
+ my_keys?: components["schemas"]["ChatKeyResponse"][];
8596
+ unread_count: number;
8597
+ last_message?: components["schemas"]["ChatMessageResponse"] | null;
8598
+ call_ext_id?: string | null;
8599
+ }>;
8600
+ /** Get-or-create the direct chat with a peer. */
8601
+ openDirect: (peerExtId: string) => Promise<{
8602
+ external_id: string;
8603
+ kind: "direct" | "group" | "meeting";
8604
+ title?: string | null;
8605
+ key_version: number;
8606
+ rotation_required: boolean;
8607
+ last_message_at?: string | null;
8608
+ created_at: string;
8609
+ members: components["schemas"]["ChatMemberResponse"][];
8610
+ my_keys?: components["schemas"]["ChatKeyResponse"][];
8611
+ unread_count: number;
8612
+ last_message?: components["schemas"]["ChatMessageResponse"] | null;
8613
+ call_ext_id?: string | null;
8614
+ }>;
8615
+ /** Create a group (epoch 1 sealed to every member). Agents are refused. */
8616
+ createGroup: (params: {
8617
+ title?: string | null;
8618
+ members: ChatMemberKey[];
8619
+ }) => Promise<{
8620
+ external_id: string;
8621
+ kind: "direct" | "group" | "meeting";
8622
+ title?: string | null;
8623
+ key_version: number;
8624
+ rotation_required: boolean;
8625
+ last_message_at?: string | null;
8626
+ created_at: string;
8627
+ members: components["schemas"]["ChatMemberResponse"][];
8628
+ my_keys?: components["schemas"]["ChatKeyResponse"][];
8629
+ unread_count: number;
8630
+ last_message?: components["schemas"]["ChatMessageResponse"] | null;
8631
+ call_ext_id?: string | null;
8632
+ }>;
8633
+ /** A chat with its keys opened, title and newest messages decrypted (oldest first). */
8634
+ load: (chatExtId: string, options?: {
8635
+ limit?: number;
8636
+ }) => Promise<DecryptedChat>;
8637
+ /** Post plaintext to a chat (encrypted under its current epoch). */
8638
+ send: (chatExtId: string, text: string, options?: SendChatMessageOptions) => Promise<DecryptedChatMessage>;
8639
+ rename: (chatExtId: string, title: string | null) => Promise<{
8640
+ external_id: string;
8641
+ kind: "direct" | "group" | "meeting";
8642
+ title?: string | null;
8643
+ key_version: number;
8644
+ rotation_required: boolean;
8645
+ last_message_at?: string | null;
8646
+ created_at: string;
8647
+ members: components["schemas"]["ChatMemberResponse"][];
8648
+ my_keys?: components["schemas"]["ChatKeyResponse"][];
8649
+ unread_count: number;
8650
+ last_message?: components["schemas"]["ChatMessageResponse"] | null;
8651
+ call_ext_id?: string | null;
8652
+ }>;
8653
+ addMembers: (chatExtId: string, members: ChatMemberKey[]) => Promise<{
8654
+ external_id: string;
8655
+ kind: "direct" | "group" | "meeting";
8656
+ title?: string | null;
8657
+ key_version: number;
8658
+ rotation_required: boolean;
8659
+ last_message_at?: string | null;
8660
+ created_at: string;
8661
+ members: components["schemas"]["ChatMemberResponse"][];
8662
+ my_keys?: components["schemas"]["ChatKeyResponse"][];
8663
+ unread_count: number;
8664
+ last_message?: components["schemas"]["ChatMessageResponse"] | null;
8665
+ call_ext_id?: string | null;
8666
+ }>;
8667
+ /** Remove a member (owner) or leave (own id); a remaining member seals the next epoch. */
8668
+ removeMember: (chatExtId: string, userExtId: string) => Promise<void>;
8669
+ markRead: (chatExtId: string, messageExtId?: string) => Promise<{
8670
+ chat_ext_id: string;
8671
+ last_read_at?: string | null;
8672
+ }>;
8673
+ deleteMessage: (chatExtId: string, messageExtId: string) => Promise<void>;
8674
+ };
8675
+ /** Direct-chat conveniences addressed by peer (email or `usr-`/`agt-` id). */
8632
8676
  readonly dm: {
8633
8677
  /**
8634
- * List direct messages, newest first, with content already **decrypted**.
8635
- * (A message that can't be decrypted comes back as `[Decryption failed]`.)
8636
- */
8637
- list: () => Promise<DecryptedDmNotification[]>;
8638
- /**
8639
- * Send an E2E-encrypted DM to a recipient (email or `usr-`/`agt-` id).
8640
- * Resolves the recipient's public key and encrypts internally — the caller
8641
- * passes plaintext and never handles keys or ciphertext.
8642
- */
8643
- send: (recipient: string, text: string) => Promise<DecryptedDmNotification[]>;
8644
- /**
8645
- * Send to a recipient whose external_id + public key are already known
8646
- * (e.g. from a message's `sender`), skipping directory resolution.
8678
+ * Send an E2E-encrypted direct message: resolves the peer, opens (get-or-create) the direct
8679
+ * chat and posts under the pair key. The caller passes plaintext and never handles keys.
8647
8680
  */
8648
- sendTo: (recipientExtId: string, recipientPublicKey: string, text: string) => Promise<DecryptedDmNotification[]>;
8681
+ send: (recipient: string, text: string) => Promise<DecryptedChatMessage>;
8682
+ /** Send to a peer whose external id is already known, skipping directory resolution. */
8683
+ sendTo: (peerExtId: string, text: string) => Promise<DecryptedChatMessage>;
8649
8684
  /** Resolve a recipient reference to `{ extId, pubKey }` (contacts → agents → workspace). */
8650
8685
  resolveRecipient: (recipient: string) => Promise<ResolvedRecipient | null>;
8651
- markRead: (messageIds: string[]) => Promise<{
8652
- type: components["schemas"]["NotificationType"];
8653
- external_id: string;
8654
- sender: {
8655
- external_id: string;
8656
- parent_ext_id?: string | null | undefined;
8657
- email: string;
8658
- given_name: string;
8659
- family_name?: string | null | undefined;
8660
- picture?: string | null | undefined;
8661
- encryption_public_key: string;
8662
- is_sso: boolean;
8663
- is_identity_verified: boolean;
8664
- };
8665
- recipient: {
8666
- external_id: string;
8667
- parent_ext_id?: string | null | undefined;
8668
- email: string;
8669
- given_name: string;
8670
- family_name?: string | null | undefined;
8671
- picture?: string | null | undefined;
8672
- encryption_public_key: string;
8673
- is_sso: boolean;
8674
- is_identity_verified: boolean;
8675
- };
8676
- workspace_ext_id?: string | null | undefined;
8677
- dm_context_only: boolean;
8678
- content?: string | null | undefined;
8679
- attachments?: string | null | undefined;
8680
- conversation_ext_id?: string | null | undefined;
8681
- message_ext_id?: string | null | undefined;
8682
- read: boolean;
8683
- created_at: string;
8684
- updated_at: string;
8685
- }[]>;
8686
- delete: (messageIds: string[]) => Promise<void>;
8687
- /** List the current user's durable activity feed (never unread; excluded from DMs). */
8686
+ /** List the current user's durable activity feed. */
8688
8687
  listActivity: (options?: {
8689
8688
  limit?: number;
8690
8689
  offset?: number;
@@ -8714,9 +8713,7 @@ declare class Arbi {
8714
8713
  is_identity_verified: boolean;
8715
8714
  };
8716
8715
  workspace_ext_id?: string | null | undefined;
8717
- dm_context_only: boolean;
8718
8716
  content?: string | null | undefined;
8719
- attachments?: string | null | undefined;
8720
8717
  conversation_ext_id?: string | null | undefined;
8721
8718
  message_ext_id?: string | null | undefined;
8722
8719
  read: boolean;
@@ -10133,6 +10130,177 @@ declare namespace doctags {
10133
10130
  export { doctags_assignDocTags as assignDocTags, doctags_generateDocTags as generateDocTags, doctags_removeDocTags as removeDocTags, doctags_updateDocTag as updateDocTag };
10134
10131
  }
10135
10132
 
10133
+ /** The notification feed, newest first (excludes `activity`). */
10134
+ declare function listNotifications(arbi: ArbiClient): Promise<{
10135
+ type: _arbidocs_client.components["schemas"]["NotificationType"];
10136
+ external_id: string;
10137
+ sender: {
10138
+ external_id: string;
10139
+ parent_ext_id?: string | null | undefined;
10140
+ email: string;
10141
+ given_name: string;
10142
+ family_name?: string | null | undefined;
10143
+ picture?: string | null | undefined;
10144
+ encryption_public_key: string;
10145
+ is_sso: boolean;
10146
+ is_identity_verified: boolean;
10147
+ };
10148
+ recipient: {
10149
+ external_id: string;
10150
+ parent_ext_id?: string | null | undefined;
10151
+ email: string;
10152
+ given_name: string;
10153
+ family_name?: string | null | undefined;
10154
+ picture?: string | null | undefined;
10155
+ encryption_public_key: string;
10156
+ is_sso: boolean;
10157
+ is_identity_verified: boolean;
10158
+ };
10159
+ workspace_ext_id?: string | null | undefined;
10160
+ content?: string | null | undefined;
10161
+ conversation_ext_id?: string | null | undefined;
10162
+ message_ext_id?: string | null | undefined;
10163
+ read: boolean;
10164
+ created_at: string;
10165
+ updated_at: string;
10166
+ }[]>;
10167
+ /**
10168
+ * List the current user's durable activity feed, newest first.
10169
+ *
10170
+ * Activity notifications are backend-originated, to-self log lines that are always read — they
10171
+ * never appear in the normal feed or the unread badge. Reading them requires the explicit
10172
+ * `type=activity` filter, which this helper always sets.
10173
+ */
10174
+ declare function listActivity(arbi: ArbiClient, options?: {
10175
+ limit?: number;
10176
+ offset?: number;
10177
+ }): Promise<{
10178
+ type: _arbidocs_client.components["schemas"]["NotificationType"];
10179
+ external_id: string;
10180
+ sender: {
10181
+ external_id: string;
10182
+ parent_ext_id?: string | null | undefined;
10183
+ email: string;
10184
+ given_name: string;
10185
+ family_name?: string | null | undefined;
10186
+ picture?: string | null | undefined;
10187
+ encryption_public_key: string;
10188
+ is_sso: boolean;
10189
+ is_identity_verified: boolean;
10190
+ };
10191
+ recipient: {
10192
+ external_id: string;
10193
+ parent_ext_id?: string | null | undefined;
10194
+ email: string;
10195
+ given_name: string;
10196
+ family_name?: string | null | undefined;
10197
+ picture?: string | null | undefined;
10198
+ encryption_public_key: string;
10199
+ is_sso: boolean;
10200
+ is_identity_verified: boolean;
10201
+ };
10202
+ workspace_ext_id?: string | null | undefined;
10203
+ content?: string | null | undefined;
10204
+ conversation_ext_id?: string | null | undefined;
10205
+ message_ext_id?: string | null | undefined;
10206
+ read: boolean;
10207
+ created_at: string;
10208
+ updated_at: string;
10209
+ }[]>;
10210
+ declare function markNotificationsRead(arbi: ArbiClient, ids: string[]): Promise<{
10211
+ type: _arbidocs_client.components["schemas"]["NotificationType"];
10212
+ external_id: string;
10213
+ sender: {
10214
+ external_id: string;
10215
+ parent_ext_id?: string | null | undefined;
10216
+ email: string;
10217
+ given_name: string;
10218
+ family_name?: string | null | undefined;
10219
+ picture?: string | null | undefined;
10220
+ encryption_public_key: string;
10221
+ is_sso: boolean;
10222
+ is_identity_verified: boolean;
10223
+ };
10224
+ recipient: {
10225
+ external_id: string;
10226
+ parent_ext_id?: string | null | undefined;
10227
+ email: string;
10228
+ given_name: string;
10229
+ family_name?: string | null | undefined;
10230
+ picture?: string | null | undefined;
10231
+ encryption_public_key: string;
10232
+ is_sso: boolean;
10233
+ is_identity_verified: boolean;
10234
+ };
10235
+ workspace_ext_id?: string | null | undefined;
10236
+ content?: string | null | undefined;
10237
+ conversation_ext_id?: string | null | undefined;
10238
+ message_ext_id?: string | null | undefined;
10239
+ read: boolean;
10240
+ created_at: string;
10241
+ updated_at: string;
10242
+ }[]>;
10243
+ declare function deleteNotifications(arbi: ArbiClient, ids: string[]): Promise<void>;
10244
+ /**
10245
+ * Ask another user to grant you workspace access.
10246
+ *
10247
+ * Creates a `workspace_access_request` notification. The `content` is an opaque base64 blob,
10248
+ * E2E-encrypted with the requester↔recipient pair key (the direct-chat scheme), carrying the
10249
+ * requester's live session public key (`sessionPubkeyB64`) so the recipient can mint a temporary,
10250
+ * session-scoped grant, plus an optional note.
10251
+ *
10252
+ * `workspaceExtId` is optional and only meaningful for callers who already know a workspace id
10253
+ * (obtained out-of-band); omit it and the recipient picks the workspace.
10254
+ */
10255
+ declare function requestWorkspaceAccess(arbi: ArbiClient, params: {
10256
+ recipientExtId: string;
10257
+ recipientEncryptionPublicKey: string;
10258
+ sessionPubkeyB64: string;
10259
+ note?: string;
10260
+ workspaceExtId?: string;
10261
+ }, crypto: ChatCryptoContext): Promise<{
10262
+ type: _arbidocs_client.components["schemas"]["NotificationType"];
10263
+ external_id: string;
10264
+ sender: {
10265
+ external_id: string;
10266
+ parent_ext_id?: string | null | undefined;
10267
+ email: string;
10268
+ given_name: string;
10269
+ family_name?: string | null | undefined;
10270
+ picture?: string | null | undefined;
10271
+ encryption_public_key: string;
10272
+ is_sso: boolean;
10273
+ is_identity_verified: boolean;
10274
+ };
10275
+ recipient: {
10276
+ external_id: string;
10277
+ parent_ext_id?: string | null | undefined;
10278
+ email: string;
10279
+ given_name: string;
10280
+ family_name?: string | null | undefined;
10281
+ picture?: string | null | undefined;
10282
+ encryption_public_key: string;
10283
+ is_sso: boolean;
10284
+ is_identity_verified: boolean;
10285
+ };
10286
+ workspace_ext_id?: string | null | undefined;
10287
+ content?: string | null | undefined;
10288
+ conversation_ext_id?: string | null | undefined;
10289
+ message_ext_id?: string | null | undefined;
10290
+ read: boolean;
10291
+ created_at: string;
10292
+ updated_at: string;
10293
+ }>;
10294
+
10295
+ declare const notifications_deleteNotifications: typeof deleteNotifications;
10296
+ declare const notifications_listActivity: typeof listActivity;
10297
+ declare const notifications_listNotifications: typeof listNotifications;
10298
+ declare const notifications_markNotificationsRead: typeof markNotificationsRead;
10299
+ declare const notifications_requestWorkspaceAccess: typeof requestWorkspaceAccess;
10300
+ declare namespace notifications {
10301
+ export { notifications_deleteNotifications as deleteNotifications, notifications_listActivity as listActivity, notifications_listNotifications as listNotifications, notifications_markNotificationsRead as markNotificationsRead, notifications_requestWorkspaceAccess as requestWorkspaceAccess };
10302
+ }
10303
+
10136
10304
  /**
10137
10305
  * Agent configuration operations — list, get, save, delete, schema, models.
10138
10306
  */
@@ -10761,4 +10929,4 @@ declare namespace identity {
10761
10929
  export { type identity_IdentityErrorCode as IdentityErrorCode, type identity_IdentityPurchase as IdentityPurchase, type identity_IdentityState as IdentityState, type identity_IdentityStatus as IdentityStatus, identity_acceptName as acceptName, identity_getStatus as getStatus, identity_identityErrorCode as identityErrorCode, identity_purchase as purchase, identity_refresh as refresh, identity_remove as remove, identity_startSession as startSession };
10762
10930
  }
10763
10931
 
10764
- export { type ListFactsOptions as $, type ActivityKind as A, type CreateWorkflowRequest as B, type ChatSession as C, DEFAULT_AI_USD_PER_GBP as D, DOC_TERMINAL_STATUSES as E, type DecryptedDmNotification as F, type DeferredInterjectionEvent as G, type DmAttachmentFile as H, type DmAttachmentInput as I, type DmCryptoContext as J, type DocNameMap as K, type DocumentAutomationAction as L, type DocumentListFields as M, type DocumentListOrder as N, type DocumentSelector as O, type DocumentWaiter as P, type DocumentWaiterOptions as Q, type FactResponse as R, type FactSearchRequest as S, type FactSearchResponse as T, type FormattedWsMessage as U, type IdentityErrorCode as V, type IdentityPurchase as W, type IdentityState as X, type IdentityStatus as Y, type LinkedRun as Z, type ListAllOptions as _, type ActivityResponse as a, type TagKind as a$, type ListPaginatedOptions as a0, type MailAttachment as a1, type MailDraftSSEEvent as a2, type MessageLevel as a3, type MessageMetadataPayload$1 as a4, type MessageQueuedEvent as a5, type OutputTokensDetails as a6, type ParsedSlashCommand as a7, type PendingAuthResponse as a8, PlanStepsError as a9, type RunProgress as aA, type RunStep as aB, type RunWaitingOn as aC, type SSEEvent as aD, type SSEStreamCallbacks as aE, type SSEStreamResult as aF, type SSEStreamStartData as aG, STEP_FIELD_OPTION_TONES as aH, SUPPORTED_EXTENSIONS as aI, type SendBack as aJ, type SkillSummary as aK, type SkippedFile as aL, type StepActionRequest as aM, type StepActivityEvent as aN, type StepAssignee as aO, type StepField as aP, type StepFieldOption as aQ, type StepFieldOptionTone as aR, type StepKind as aS, type StepPhase as aT, type StepSignal as aU, type StepSignalWhen as aV, type StepState as aW, type StepStatus as aX, type SubmitBackgroundQueryOptions as aY, type TagChange as aZ, type TagFieldDefinition as a_, type PlanWorkRequest as aa, type ProbeAnswerEvent as ab, type ProjectBudget as ac, type ProjectConversationUsageResponse as ad, type ProjectDetails as ae, type ProjectEventKind as af, type ProjectEventResponse as ag, type ProjectInvoicesResponse as ah, type ProjectResponse as ai, type ProjectUpdateRequest as aj, type ProjectUsageResponse as ak, type QueryOptions as al, type RaisedSignal as am, type ReconnectOptions as an, type ReconnectableWsConnection as ao, type ResolvedCitation as ap, type ResolvedRecipient as aq, type ResponseCompletedEvent as ar, type ResponseContentPartAddedEvent as as, type ResponseCreatedEvent as at, type ResponseFailedEvent as au, type ResponseOutputItemAddedEvent as av, type ResponseOutputItemDoneEvent as aw, type ResponseOutputTextDeltaEvent as ax, type ResponseOutputTextDoneEvent as ay, type ResponseUsage as az, type AgentControlStateEvent as b, generateNewWorkspaceKey as b$, type TagKindField as b0, type TagKindSchema as b1, type TagLinks as b2, type TagListQuery as b3, type TagResponse as b4, type TaskPlan as b5, type TaskPlanStep as b6, type TokenBudgetContext as b7, type UpdateConversationRequest as b8, type UpdateFactRequest as b9, buildRetrievalChunkTool as bA, buildRetrievalFullContextTool as bB, buildRetrievalTocTool as bC, connectWebSocket as bD, connectWithReconnect as bE, consumeSSEStream as bF, contacts as bG, conversations as bH, countCitations as bI, createAuthenticatedClient as bJ, createDocumentWaiter as bK, dm as bL, doctags as bM, documents as bN, facts as bO, files as bP, filterSkills as bQ, formatAgentStepLabel as bR, formatFileSize as bS, formatGbp as bT, formatGbpPerMillionTokens as bU, formatItemLabel as bV, formatStreamSummary as bW, formatUserName as bX, formatWorkspaceChoices as bY, formatWsMessage as bZ, generateEncryptedWorkspaceKey as b_, type UpdateWorkflowRequest as ba, type UploadBatchResult as bb, type UploadDirectOptions as bc, type UploadDirectResult as bd, type UploadOptions as be, type UploadResult as bf, type UsageBreakdown as bg, type UserDailyUsageResponse as bh, type UserInfo as bi, type UserInputRequestEvent as bj, type UserMessageEvent as bk, WebSocketAuthError as bl, type WorkStatus as bm, type WorkflowAuthMode as bn, type WorkflowResponse as bo, type WorkflowRunHistoryResponse as bp, type WorkflowRunResponse as bq, type WorkspaceContext as br, type WsConnection as bs, account as bt, agentconfig as bu, agents as bv, assistant as bw, authenticatedFetch as bx, buildDocNameMap as by, buildFactsContextTool as bz, type AgentStepDeltaEvent as c, getErrorCode as c0, getErrorMessage as c1, getRawWorkspaceKey as c2, health as c3, identity as c4, identityErrorCode as c5, mail as c6, parseSSEEvents as c7, parseSlashCommand as c8, parseSlashTokenInProgress as c9, performPasswordLogin as ca, performSigningKeyLogin as cb, performSsoDeviceFlowLogin as cc, profile as cd, projects as ce, requireData as cf, requireOk as cg, resolveAuth as ch, resolveCitations as ci, resolveWorkspace as cj, responses as ck, selectWorkspace as cl, selectWorkspaceById as cm, sessions as cn, settings as co, signatureRequests as cp, streamSSE as cq, stripCitationMarkdown as cr, summarizeCitations as cs, tags as ct, usdToGbp as cu, work as cv, workflowSteps as cw, workflows as cx, workspaces as cy, type AgentStepEvent as d, Arbi as e, ArbiApiError as f, ArbiError as g, type ArbiErrorEvent as h, type ArbiOptions as i, ArbiSessionExpiredError as j, type ArtifactEvent as k, type AuthContext as l, type AuthHeaders as m, type AuthMode as n, type AuthenticatedClient as o, type CitationSummary as p, type CliConfig as q, type CliCredentials as r, type CommandDescriptor as s, type ConfigStore as t, type ConnectOptions as u, type ConversationResponse as v, type ConversationUsageResponse as w, type CreateFactRequest as x, type CreateFactsRequest as y, type CreateWorkRequest as z };
10932
+ export { type FormattedWsMessage as $, type ActivityKind as A, type CliCredentials as B, type ChatAttachmentFile as C, type CommandDescriptor as D, type ConfigStore as E, type ConnectOptions as F, type ConversationResponse as G, type ConversationUsageResponse as H, type CreateFactRequest as I, type CreateFactsRequest as J, type CreateWorkRequest as K, type CreateWorkflowRequest as L, DEFAULT_AI_USD_PER_GBP as M, DOC_TERMINAL_STATUSES as N, type DecryptedChat as O, type DecryptedChatMessage as P, type DeferredInterjectionEvent as Q, type DocNameMap as R, type DocumentAutomationAction as S, type DocumentListFields as T, type DocumentListOrder as U, type DocumentSelector as V, type DocumentWaiter as W, type DocumentWaiterOptions as X, type FactResponse as Y, type FactSearchRequest as Z, type FactSearchResponse as _, type ActivityResponse as a, type StepSignal as a$, type IdentityErrorCode as a0, type IdentityPurchase as a1, type IdentityState as a2, type IdentityStatus as a3, type LinkedRun as a4, type ListAllOptions as a5, type ListFactsOptions as a6, type ListPaginatedOptions as a7, type MailAttachment as a8, type MailDraftSSEEvent as a9, type ResponseCreatedEvent as aA, type ResponseFailedEvent as aB, type ResponseOutputItemAddedEvent as aC, type ResponseOutputItemDoneEvent as aD, type ResponseOutputTextDeltaEvent as aE, type ResponseOutputTextDoneEvent as aF, type ResponseUsage as aG, type RunProgress as aH, type RunStep as aI, type RunWaitingOn as aJ, type SSEEvent as aK, type SSEStreamCallbacks as aL, type SSEStreamResult as aM, type SSEStreamStartData as aN, STEP_FIELD_OPTION_TONES as aO, SUPPORTED_EXTENSIONS as aP, type SendBack as aQ, type SkillSummary as aR, type SkippedFile as aS, type StepActionRequest as aT, type StepActivityEvent as aU, type StepAssignee as aV, type StepField as aW, type StepFieldOption as aX, type StepFieldOptionTone as aY, type StepKind as aZ, type StepPhase as a_, type MessageLevel as aa, type MessageMetadataPayload$1 as ab, type MessageQueuedEvent as ac, type OutputTokensDetails as ad, type ParsedSlashCommand as ae, type PendingAuthResponse as af, PlanStepsError as ag, type PlanWorkRequest as ah, type ProbeAnswerEvent as ai, type ProjectBudget as aj, type ProjectConversationUsageResponse as ak, type ProjectDetails as al, type ProjectEventKind as am, type ProjectEventResponse as an, type ProjectInvoicesResponse as ao, type ProjectResponse as ap, type ProjectUpdateRequest as aq, type ProjectUsageResponse as ar, type QueryOptions as as, type RaisedSignal as at, type ReconnectOptions as au, type ReconnectableWsConnection as av, type ResolvedCitation as aw, type ResolvedRecipient as ax, type ResponseCompletedEvent as ay, type ResponseContentPartAddedEvent as az, type AgentControlStateEvent as b, formatGbpPerMillionTokens as b$, type StepSignalWhen as b0, type StepState as b1, type StepStatus as b2, type SubmitBackgroundQueryOptions as b3, type TagChange as b4, type TagFieldDefinition as b5, type TagKind as b6, type TagKindField as b7, type TagKindSchema as b8, type TagLinks as b9, account as bA, agentconfig as bB, agents as bC, assistant as bD, authenticatedFetch as bE, buildDocNameMap as bF, buildFactsContextTool as bG, buildRetrievalChunkTool as bH, buildRetrievalFullContextTool as bI, buildRetrievalTocTool as bJ, chats as bK, connectWebSocket as bL, connectWithReconnect as bM, consumeSSEStream as bN, contacts as bO, conversations as bP, countCitations as bQ, createAuthenticatedClient as bR, createDocumentWaiter as bS, doctags as bT, documents as bU, facts as bV, files as bW, filterSkills as bX, formatAgentStepLabel as bY, formatFileSize as bZ, formatGbp as b_, type TagListQuery as ba, type TagResponse as bb, type TaskPlan as bc, type TaskPlanStep as bd, type TokenBudgetContext as be, type UpdateConversationRequest as bf, type UpdateFactRequest as bg, type UpdateWorkflowRequest as bh, type UploadBatchResult as bi, type UploadDirectOptions as bj, type UploadDirectResult as bk, type UploadOptions as bl, type UploadResult as bm, type UsageBreakdown as bn, type UserDailyUsageResponse as bo, type UserInfo as bp, type UserInputRequestEvent as bq, type UserMessageEvent as br, WebSocketAuthError as bs, type WorkStatus as bt, type WorkflowAuthMode as bu, type WorkflowResponse as bv, type WorkflowRunHistoryResponse as bw, type WorkflowRunResponse as bx, type WorkspaceContext as by, type WsConnection as bz, type AgentStepDeltaEvent as c, formatItemLabel as c0, formatStreamSummary as c1, formatUserName as c2, formatWorkspaceChoices as c3, formatWsMessage as c4, generateEncryptedWorkspaceKey as c5, generateNewWorkspaceKey as c6, getErrorCode as c7, getErrorMessage as c8, getRawWorkspaceKey as c9, summarizeCitations as cA, tags as cB, usdToGbp as cC, work as cD, workflowSteps as cE, workflows as cF, workspaces as cG, health as ca, identity as cb, identityErrorCode as cc, mail as cd, notifications as ce, parseSSEEvents as cf, parseSlashCommand as cg, parseSlashTokenInProgress as ch, performPasswordLogin as ci, performSigningKeyLogin as cj, performSsoDeviceFlowLogin as ck, profile as cl, projects as cm, requireData as cn, requireOk as co, resolveAuth as cp, resolveCitations as cq, resolveWorkspace as cr, responses as cs, selectWorkspace as ct, selectWorkspaceById as cu, sessions as cv, settings as cw, signatureRequests as cx, streamSSE as cy, stripCitationMarkdown as cz, type AgentStepEvent as d, Arbi as e, ArbiApiError as f, ArbiError as g, type ArbiErrorEvent as h, type ArbiOptions as i, ArbiSessionExpiredError as j, type ArtifactEvent as k, type AuthContext as l, type AuthHeaders as m, type AuthMode as n, type AuthenticatedClient as o, type ChatAttachmentInput as p, type ChatCryptoContext as q, type ChatKeyRing as r, type ChatKind as s, type ChatMemberKey as t, type ChatMemberResponse as u, type ChatMessageResponse as v, type ChatResponse as w, type ChatSession as x, type CitationSummary as y, type CliConfig as z };