@arbidocs/client 0.4.84 → 0.4.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -639,14 +639,13 @@ interface paths {
639
639
  * @description Login with Ed25519 signature verification (local or SSO).
640
640
  *
641
641
  * Authentication flow:
642
- * 1. Client derives Ed25519 keypair from password
643
- * 2. Client signs "email|timestamp" with Ed25519 private key
644
- * 3. Server verifies signature using stored Ed25519 public key
645
- * 4. Server encrypts response with stored X25519 public key
642
+ * 1. Client derives the password key (Ed25519) from the password, or holds the identity key
643
+ * (recovery key, session re-login)
644
+ * 2. Client signs "email|timestamp" with it
645
+ * 3. Server verifies the signature against the stored password key or identity key
646
+ * 4. The response carries ``wrapped_identity_key``, which only the password key opens
646
647
  *
647
648
  * For SSO users: Also validates SSO token before proceeding.
648
- *
649
- * Returns encrypted login response that only the correct password can decrypt.
650
649
  */
651
650
  post: operations['login_user'];
652
651
  delete?: never;
@@ -730,17 +729,13 @@ interface paths {
730
729
  put?: never;
731
730
  /**
732
731
  * Change Password
733
- * @description Change user's master password by re-keying all workspace keys.
734
- *
735
- * Self re-key (agent_ext_id omitted):
736
- * 1. Sign "email|timestamp" with current Ed25519 key (proves current password)
737
- * 2. Provide new Ed25519 signing key (derived from new password)
738
- * 3. Re-wrap all workspace keys with new X25519 public key
732
+ * @description Change the master password (or set a new one after signing in with the recovery key).
739
733
  *
740
- * Agent re-key (agent_ext_id provided):
741
- * 1. Parent signs "agent_ext_id|timestamp" with their own Ed25519 key (proves authority)
742
- * 2. Provide new Ed25519 signing key for the agent
743
- * 3. Re-wrap the agent's workspace keys with the agent's new X25519 public key
734
+ * The password only protects the identity keypair; it never encrypts content. The client signs
735
+ * "email|timestamp" with the current password key (or with the identity key, in recovery), derives the
736
+ * new password key, and wraps the identity's secret key under it. The server swaps the two values: the
737
+ * identity — and every workspace key, mailbox key, direct message and directory entry bound to it —
738
+ * is untouched, so nothing is re-encrypted and nothing can be left behind.
744
739
  */
745
740
  post: operations['change_password'];
746
741
  delete?: never;
@@ -1558,6 +1553,30 @@ interface paths {
1558
1553
  patch?: never;
1559
1554
  trace?: never;
1560
1555
  };
1556
+ '/v1/workspace/{workspace_ext_id}/activity': {
1557
+ parameters: {
1558
+ query?: never;
1559
+ header?: never;
1560
+ path?: never;
1561
+ cookie?: never;
1562
+ };
1563
+ /**
1564
+ * Get Workspace Activity
1565
+ * @description What happened in the workspace, newest first: thread history, people posting, documents uploaded, new
1566
+ * versions and signatures, and workflow runs.
1567
+ *
1568
+ * Only what the caller can already see is listed: private threads (their events and messages), documents and
1569
+ * workflows of others are left out. Nothing here is pushed; notifications tell a person what needs them.
1570
+ */
1571
+ get: operations['get_workspace_activity'];
1572
+ put?: never;
1573
+ post?: never;
1574
+ delete?: never;
1575
+ options?: never;
1576
+ head?: never;
1577
+ patch?: never;
1578
+ trace?: never;
1579
+ };
1561
1580
  '/v1/editor/{document_id}/mentions': {
1562
1581
  parameters: {
1563
1582
  query?: never;
@@ -3104,7 +3123,7 @@ interface paths {
3104
3123
  patch?: never;
3105
3124
  trace?: never;
3106
3125
  };
3107
- '/v1/tag/list': {
3126
+ '/v1/tag/': {
3108
3127
  parameters: {
3109
3128
  query?: never;
3110
3129
  header?: never;
@@ -3113,18 +3132,32 @@ interface paths {
3113
3132
  };
3114
3133
  /**
3115
3134
  * List Tags
3116
- * @description List all tags in the current workspace.
3135
+ * @description The workspace's tags, filtered: of a ``kind``, children of a ``parent``, or the ``ids`` given (filters
3136
+ * combine). Oldest first, or in the order of ``ids``.
3137
+ *
3138
+ * A table of tags is this list: ``?kind=issue&include=links`` is every issue with its values (``field_values``,
3139
+ * for the columns ``GET /v1/tag/kinds/issue`` defines) and its evidence. With ``include=links`` each tag lists up
3140
+ * to ``links_limit`` documents (the doctag's note, how many passages it cites), facts and threads, newest first;
3141
+ * the counts are the totals, so a tag with none is a gap.
3117
3142
  */
3118
3143
  get: operations['list_tags'];
3119
3144
  put?: never;
3120
- post?: never;
3145
+ /**
3146
+ * Create Tag
3147
+ * @description Create a new tag for a given workspace.
3148
+ *
3149
+ * If 'shared' is provided, the tag will be set to shared or private accordingly.
3150
+ * If 'shared' is not provided, it defaults to True (shared). ``kind`` defaults from the format. Issues, people
3151
+ * and organisations are flat (no parent). ``field_values`` are for the kind's fields.
3152
+ */
3153
+ post: operations['create_tag'];
3121
3154
  delete?: never;
3122
3155
  options?: never;
3123
3156
  head?: never;
3124
3157
  patch?: never;
3125
3158
  trace?: never;
3126
3159
  };
3127
- '/v1/tag/matrix': {
3160
+ '/v1/tag/kinds': {
3128
3161
  parameters: {
3129
3162
  query?: never;
3130
3163
  header?: never;
@@ -3132,15 +3165,10 @@ interface paths {
3132
3165
  cookie?: never;
3133
3166
  };
3134
3167
  /**
3135
- * Get Tag Matrix
3136
- * @description A set of tags with their fields and values, plus the documents and facts linked to each.
3137
- *
3138
- * Select the rows with ``parent_ext_id`` (its children; the parent comes back too, its fields being the
3139
- * shared columns), with ``kind`` (e.g. every person, or every issue) or with ``tag_ext_id``. Each row lists up
3140
- * to ``links_limit`` documents (with the doctag's note and how many passages it cites) and facts, newest
3141
- * first; ``doc_count``/``fact_count`` are the totals.
3168
+ * List Tag Kinds
3169
+ * @description Every tag kind's fields in this workspace (the built-in ones where the workspace has not set its own).
3142
3170
  */
3143
- get: operations['get_tag_matrix'];
3171
+ get: operations['list_tag_kinds'];
3144
3172
  put?: never;
3145
3173
  post?: never;
3146
3174
  delete?: never;
@@ -3149,30 +3177,33 @@ interface paths {
3149
3177
  patch?: never;
3150
3178
  trace?: never;
3151
3179
  };
3152
- '/v1/tag/entities/extract': {
3180
+ '/v1/tag/kinds/{kind}': {
3153
3181
  parameters: {
3154
3182
  query?: never;
3155
3183
  header?: never;
3156
3184
  path?: never;
3157
3185
  cookie?: never;
3158
3186
  };
3159
- get?: never;
3160
- put?: never;
3161
3187
  /**
3162
- * Extract Entities
3163
- * @description Find the people and organisations these documents name, and link each to its entity tag (on demand).
3164
- *
3165
- * Returns 202 at once; a ``batch_complete`` (``entity_extract``) WebSocket message follows when every document
3166
- * is done. Reuses entities already in the workspace by name or "Also known as"; only ever adds links.
3188
+ * Get Tag Kind
3189
+ * @description A kind's fields in this workspace — the columns of a table of its tags (e.g. the workspace's issue fields).
3190
+ * Each tag of the kind holds its own values (``field_values``).
3167
3191
  */
3168
- post: operations['extract_entities'];
3192
+ get: operations['get_tag_kind'];
3193
+ /**
3194
+ * Update Tag Kind
3195
+ * @description Set a kind's fields in this workspace, in full and in order: a field given with its ``id`` is kept (its
3196
+ * type cannot change; its name and options can), one without is added, one left out is removed.
3197
+ */
3198
+ put: operations['update_tag_kind'];
3199
+ post?: never;
3169
3200
  delete?: never;
3170
3201
  options?: never;
3171
3202
  head?: never;
3172
3203
  patch?: never;
3173
3204
  trace?: never;
3174
3205
  };
3175
- '/v1/tag/': {
3206
+ '/v1/tag/entities/extract': {
3176
3207
  parameters: {
3177
3208
  query?: never;
3178
3209
  header?: never;
@@ -3182,14 +3213,13 @@ interface paths {
3182
3213
  get?: never;
3183
3214
  put?: never;
3184
3215
  /**
3185
- * Create Tag
3186
- * @description Create a new tag for a given workspace.
3216
+ * Extract Entities
3217
+ * @description Find the people and organisations these documents name, and link each to its entity tag (on demand).
3187
3218
  *
3188
- * If 'shared' is provided, the tag will be set to shared or private accordingly.
3189
- * If 'shared' is not provided, it defaults to True (shared). ``kind`` defaults from the format; a person or
3190
- * organisation gets that kind's default fields unless ``fields`` are given.
3219
+ * Returns 202 at once; a ``batch_complete`` (``entity_extract``) WebSocket message follows when every document
3220
+ * is done. Reuses entities already in the workspace by name (a person also by title and surname); only ever adds.
3191
3221
  */
3192
- post: operations['create_tag'];
3222
+ post: operations['extract_entities'];
3193
3223
  delete?: never;
3194
3224
  options?: never;
3195
3225
  head?: never;
@@ -6156,23 +6186,6 @@ interface paths {
6156
6186
  patch?: never;
6157
6187
  trace?: never;
6158
6188
  };
6159
- '/v1/mail/native/rotation-credentials': {
6160
- parameters: {
6161
- query?: never;
6162
- header?: never;
6163
- path?: never;
6164
- cookie?: never;
6165
- };
6166
- /** Rotation Credentials */
6167
- get: operations['rotation_credentials_v1_mail_native_rotation_credentials_get'];
6168
- put?: never;
6169
- post?: never;
6170
- delete?: never;
6171
- options?: never;
6172
- head?: never;
6173
- patch?: never;
6174
- trace?: never;
6175
- };
6176
6189
  '/v1/mail/accounts/{account_id}/drafts': {
6177
6190
  parameters: {
6178
6191
  query?: never;
@@ -6967,7 +6980,7 @@ interface components {
6967
6980
  WORKSPACE_SETUP: boolean;
6968
6981
  /**
6969
6982
  * Workspace Tools Enabled
6970
- * @description Enable native user-action tools so the agent can act as an ARBI user within its active workspace: list_workspaces, upload_document, list_tags, create_tag and tag_documents. In-process and RLS-native — bounded by the agent's workspace memberships. Off by default.
6983
+ * @description Enable native user-action tools so the agent can act as an ARBI user within its active workspace: list_workspaces, upload_document, list_tags, create_tag, set_tag_fields and tag_documents. In-process and RLS-native — bounded by the agent's workspace memberships. Off by default.
6971
6984
  * @default false
6972
6985
  */
6973
6986
  WORKSPACE_TOOLS_ENABLED: boolean;
@@ -7234,7 +7247,7 @@ interface components {
7234
7247
  SKILLS_ENABLED: boolean;
7235
7248
  /**
7236
7249
  * Workspace Tools Enabled
7237
- * @description Enable native user-action tools so the agent can act as an ARBI user within its active workspace: list_workspaces, upload_document, list_tags, create_tag and tag_documents. In-process and RLS-native — bounded by the agent's workspace memberships. Off by default.
7250
+ * @description Enable native user-action tools so the agent can act as an ARBI user within its active workspace: list_workspaces, upload_document, list_tags, create_tag, set_tag_fields and tag_documents. In-process and RLS-native — bounded by the agent's workspace memberships. Off by default.
7238
7251
  * @default false
7239
7252
  */
7240
7253
  WORKSPACE_TOOLS_ENABLED: boolean;
@@ -7932,19 +7945,19 @@ interface components {
7932
7945
  title: string;
7933
7946
  /**
7934
7947
  * Mode
7935
- * @description Rendering mode: markdown (default, supports redlines), html (single-file page, rendered in a sandboxed preview), react (single-file JSX component, rendered in a sandboxed preview), plain text, or image (a generated image artifact — render the doc via the image viewer)
7948
+ * @description What the model wrote: markdown (default) or plain text — a document draft, stored as a Word document (DOCX) and opened in the Word editor; html (single-file page, rendered in a sandboxed preview); react (single-file JSX component, rendered in a sandboxed preview); or image (a generated image artifact — render the doc via the image viewer)
7936
7949
  * @default markdown
7937
7950
  * @enum {string}
7938
7951
  */
7939
7952
  mode: 'markdown' | 'html' | 'text' | 'react' | 'image';
7940
7953
  /**
7941
7954
  * Content
7942
- * @description The artifact content (markdown/html/text; empty for image mode)
7955
+ * @description What the model wrote: the Markdown/text of a document draft (a preview: the document is the stored DOCX), or the html/jsx source; empty for image mode
7943
7956
  */
7944
7957
  content: string;
7945
7958
  /**
7946
7959
  * File Type
7947
- * @description Bare file extension for image-mode artifacts (e.g. 'png'); empty for text modes
7960
+ * @description Bare extension of the stored file: 'docx' for a document draft (markdown/text), 'html' or 'jsx' for a UI artifact, the image's (e.g. 'png') for image mode
7948
7961
  * @default
7949
7962
  */
7950
7963
  file_type: string;
@@ -9103,50 +9116,25 @@ interface components {
9103
9116
  };
9104
9117
  /**
9105
9118
  * ChangePasswordRequest
9106
- * @description Password change request with signature-based auth.
9119
+ * @description Change the master password: replace the password key and the wrapped identity key, nothing else.
9107
9120
  *
9108
- * Self re-key (agent_ext_id omitted):
9109
- * Client proves knowledge of current password by signing "email|timestamp"
9110
- * with their own Ed25519 key.
9111
- *
9112
- * Agent re-key (agent_ext_id provided):
9113
- * Parent re-keys an agent's signing/encryption keys. Parent proves authority
9114
- * by signing "agent_ext_id|timestamp" with their own Ed25519 key.
9115
- * rewrapped_workspace_keys must contain entries for the agent's workspaces,
9116
- * each wrapped with the agent's new X25519 public key.
9121
+ * Everything the user can read (workspace keys, mailbox keys, direct messages, call keys) is encrypted
9122
+ * to the identity keypair, which a password change keeps, so the change is O(1) and re-encrypts nothing.
9117
9123
  */
9118
9124
  ChangePasswordRequest: {
9119
9125
  /** Signature */
9120
9126
  signature: string;
9121
9127
  /** Timestamp */
9122
9128
  timestamp: number;
9123
- /** New Signing Key */
9124
- new_signing_key: string;
9125
- /** Rewrapped Workspace Keys */
9126
- rewrapped_workspace_keys: {
9127
- [key: string]: string;
9128
- };
9129
- /** Agent Ext Id */
9130
- agent_ext_id?: string | null;
9131
- /** Rewrapped Agent Recovery Keys */
9132
- rewrapped_agent_recovery_keys?: {
9133
- [key: string]: string;
9134
- } | null;
9135
- /** Rewrapped Mail Keys */
9136
- rewrapped_mail_keys?: {
9137
- [key: string]: string;
9138
- } | null;
9139
- /** Rewrapped Mail Credentials */
9140
- rewrapped_mail_credentials?: {
9141
- [key: string]: string;
9142
- } | null;
9129
+ /** New Login Key */
9130
+ new_login_key: string;
9131
+ /** Wrapped Identity Key */
9132
+ wrapped_identity_key: string;
9143
9133
  };
9144
9134
  /** ChangePasswordResponse */
9145
9135
  ChangePasswordResponse: {
9146
9136
  /** Detail */
9147
9137
  detail: string;
9148
- /** Workspaces Updated */
9149
- workspaces_updated: number;
9150
9138
  };
9151
9139
  /**
9152
9140
  * ChatCompletionRequest
@@ -10514,9 +10502,9 @@ interface components {
10514
10502
  * CreateTagRequest
10515
10503
  * @description Request to create a new tag in a workspace.
10516
10504
  *
10517
- * ``kind`` defaults to the parent's when the parent is an issue, person or organisation (so a matrix's new row
10518
- * is one too), else from the format (checkbox → label, search → search, any other → annotation). A person or
10519
- * organisation is created with that kind's default fields unless ``fields`` are given.
10505
+ * ``kind`` defaults from the format (checkbox → label, search → search, any other → annotation), never from the
10506
+ * parent. Issues, people and organisations are flat: they take no parent. ``field_values`` are for the kind's
10507
+ * fields (``GET /v1/tag/kinds/{kind}``).
10520
10508
  */
10521
10509
  CreateTagRequest: {
10522
10510
  /** Name */
@@ -10530,8 +10518,6 @@ interface components {
10530
10518
  shared?: boolean | null;
10531
10519
  /** Parent Ext Id */
10532
10520
  parent_ext_id?: string | null;
10533
- /** Fields */
10534
- fields?: components['schemas']['FieldDefinitionWrite'][] | null;
10535
10521
  /** Field Values */
10536
10522
  field_values?: {
10537
10523
  [key: string]: unknown;
@@ -12111,9 +12097,11 @@ interface components {
12111
12097
  * ExtractEntitiesRequest
12112
12098
  * @description Find the people and organisations these documents name and link each to its entity tag.
12113
12099
  *
12114
- * An entity already in the workspace (same kind, same name or one of its "Also known as" names) is reused;
12115
- * a new one is created with that kind's default fields. Each document gets a link (a doctag citing the
12116
- * passages that name the entity), and facts drawn from the document that mention the entity get it too.
12100
+ * An entity already in the workspace (same kind and name — for a person also "Mr Grant" for an only Grant)
12101
+ * is reused, its empty fields filled; a new one is created. Values go into the fields of that name the
12102
+ * workspace's person / organisation fields have. Each document
12103
+ * gets a link (a doctag citing the passages that name the entity), and facts drawn from the document that
12104
+ * mention the entity get it too.
12117
12105
  * Existing links are kept; ``overwrite`` refreshes their citations (e.g. after a new version).
12118
12106
  */
12119
12107
  ExtractEntitiesRequest: {
@@ -12299,6 +12287,23 @@ interface components {
12299
12287
  */
12300
12288
  label: string;
12301
12289
  };
12290
+ /**
12291
+ * FieldDefinition
12292
+ * @description A field as the API returns it — decrypted.
12293
+ */
12294
+ FieldDefinition: {
12295
+ /** Id */
12296
+ id: string;
12297
+ /** Name */
12298
+ name: string;
12299
+ /**
12300
+ * Type
12301
+ * @enum {string}
12302
+ */
12303
+ type: 'text' | 'number' | 'date' | 'checkbox' | 'select' | 'person' | 'document' | 'relation' | 'lookup' | 'rollup';
12304
+ /** Options */
12305
+ options?: string[] | null;
12306
+ };
12302
12307
  /**
12303
12308
  * FieldDefinitionWrite
12304
12309
  * @description A field in a write. Give ``id`` to keep an existing field (its type cannot change); omit it to add one.
@@ -13169,6 +13174,8 @@ interface components {
13169
13174
  /** Session Key */
13170
13175
  session_key: string;
13171
13176
  user: components['schemas']['UserResponse'];
13177
+ /** Wrapped Identity Key */
13178
+ wrapped_identity_key?: string | null;
13172
13179
  /**
13173
13180
  * Workspaces
13174
13181
  * @default []
@@ -14217,7 +14224,7 @@ interface components {
14217
14224
  * Type is self-descriptive, no need to parse content field.
14218
14225
  * @enum {string}
14219
14226
  */
14220
- NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'signup_reward' | 'referral_reward' | 'native_mail_received' | 'mail_draft_ready' | 'email_reply' | 'quota_threshold_50' | 'quota_threshold_90' | 'quota_threshold_100' | 'doc_shared' | 'docx_mention' | 'workspace_access_request' | 'conversation_ready' | 'conversation_done' | 'conversation_notified' | 'workflow_failed' | 'agent_input_requested' | 'workflow_completed' | 'workflow_signal' | 'step_ready' | 'task_started' | 'task_completed' | 'mailbox_sync_complete' | 'drive_sync_complete' | 'activity' | 'mention' | 'call_missed' | 'calendar_invite' | 'calendar_update' | 'calendar_cancel' | 'calendar_reply' | 'calendar_counter' | 'calendar_reminder' | 'calendar_share';
14227
+ NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'signup_reward' | 'referral_reward' | 'native_mail_received' | 'mail_draft_ready' | 'email_reply' | 'quota_threshold_50' | 'quota_threshold_90' | 'quota_threshold_100' | 'doc_shared' | 'docx_mention' | 'workspace_access_request' | 'conversation_ready' | 'conversation_done' | 'conversation_notified' | 'workflow_failed' | 'agent_input_requested' | 'workflow_completed' | 'workflow_signal' | 'step_ready' | 'task_started' | 'task_completed' | 'mailbox_sync_complete' | 'drive_sync_complete' | 'activity' | 'mention' | 'thread_reply' | 'document_activity' | 'call_missed' | 'calendar_invite' | 'calendar_update' | 'calendar_cancel' | 'calendar_reply' | 'calendar_counter' | 'calendar_reminder' | 'calendar_share';
14221
14228
  /**
14222
14229
  * NotificationUpdate
14223
14230
  * @description Single notification update for bulk PATCH.
@@ -15763,10 +15770,15 @@ interface components {
15763
15770
  * For local users: given_name and family_name are required
15764
15771
  * For SSO users: given_name and family_name are optional (extracted from JWT if not provided)
15765
15772
  *
15766
- * Key derivation:
15767
- * 1. Client derives Ed25519 keypair from password using Argon2id
15768
- * 2. Client sends Ed25519 public key (signing_key)
15769
- * 3. Backend derives X25519 encryption key from Ed25519 signing key
15773
+ * Keys:
15774
+ * 1. Client generates a random Ed25519 identity keypair and sends its public key (signing_key);
15775
+ * the backend derives the X25519 encryption key from it
15776
+ * 2. Client derives the password key from the password (Argon2id) and sends its public key (login_key)
15777
+ * with the identity's secret key wrapped under it (wrapped_identity_key)
15778
+ *
15779
+ * Omitting both login_key and wrapped_identity_key makes the password-derived key the identity itself
15780
+ * (``signing_key`` is then the password key). Scripts and service accounts use this; a password change
15781
+ * later keeps that identity, so its original password keeps opening it.
15770
15782
  */
15771
15783
  RegisterRequest: {
15772
15784
  /**
@@ -15776,6 +15788,10 @@ interface components {
15776
15788
  email: string;
15777
15789
  /** Signing Key */
15778
15790
  signing_key: string;
15791
+ /** Login Key */
15792
+ login_key?: string | null;
15793
+ /** Wrapped Identity Key */
15794
+ wrapped_identity_key?: string | null;
15779
15795
  /** Verification Credential */
15780
15796
  verification_credential: string;
15781
15797
  /** Given Name */
@@ -18112,51 +18128,10 @@ interface components {
18112
18128
  requests: number;
18113
18129
  };
18114
18130
  /**
18115
- * TagField
18116
- * @description A field a tag has — its own, or inherited from an ancestor (``tag_ext_id`` says which tag defines it).
18117
- */
18118
- TagField: {
18119
- /** Id */
18120
- id: string;
18121
- /** Name */
18122
- name: string;
18123
- /**
18124
- * Type
18125
- * @enum {string}
18126
- */
18127
- type: 'text' | 'number' | 'date' | 'checkbox' | 'select' | 'person' | 'document' | 'relation' | 'lookup' | 'rollup';
18128
- /** Options */
18129
- options?: string[] | null;
18130
- /** Tag Ext Id */
18131
- tag_ext_id: string;
18132
- };
18133
- /**
18134
- * TagFormat
18135
- * @description Tag format configuration stored as JSONB.
18136
- *
18137
- * Type-specific fields:
18138
- * - select: options (list of choices, can be single or multi-select)
18139
- * - search: tag name is the query, chunks include relevance scores
18140
- * - checkbox, text, number: type only
18141
- */
18142
- TagFormat: {
18143
- /**
18144
- * Type
18145
- * @default checkbox
18146
- * @enum {string}
18147
- */
18148
- type: 'checkbox' | 'text' | 'number' | 'select' | 'search' | 'date';
18149
- /**
18150
- * Options
18151
- * @default []
18152
- */
18153
- options: string[];
18154
- };
18155
- /**
18156
- * TagMatrixDocLink
18157
- * @description A document a matrix tag is applied to: the doctag's note is the link's value.
18131
+ * TagDocLink
18132
+ * @description A document the tag is applied to: the doctag's note is the link's value.
18158
18133
  */
18159
- TagMatrixDocLink: {
18134
+ TagDocLink: {
18160
18135
  /** Doc Ext Id */
18161
18136
  doc_ext_id: string;
18162
18137
  /** File Name */
@@ -18175,10 +18150,10 @@ interface components {
18175
18150
  updated_at: string;
18176
18151
  };
18177
18152
  /**
18178
- * TagMatrixFactLink
18179
- * @description A fact carrying a matrix tag. A plain link: the fact is relevant to the tag's category.
18153
+ * TagFactLink
18154
+ * @description A fact carrying the tag. A plain link: the fact is relevant to the tag.
18180
18155
  */
18181
- TagMatrixFactLink: {
18156
+ TagFactLink: {
18182
18157
  /** Fact Ext Id */
18183
18158
  fact_ext_id: string;
18184
18159
  /** Text */
@@ -18191,27 +18166,62 @@ interface components {
18191
18166
  */
18192
18167
  updated_at: string;
18193
18168
  };
18194
- /** TagMatrixResponse */
18195
- TagMatrixResponse: {
18196
- /** Rows */
18197
- rows?: components['schemas']['TagMatrixRow'][];
18198
- parent?: components['schemas']['TagResponse'] | null;
18199
- /** Links Limit */
18200
- links_limit: number;
18169
+ /**
18170
+ * TagFormat
18171
+ * @description Tag format configuration stored as JSONB.
18172
+ *
18173
+ * Type-specific fields:
18174
+ * - select: options (list of choices, can be single or multi-select)
18175
+ * - search: tag name is the query, chunks include relevance scores
18176
+ * - checkbox, text, number: type only
18177
+ */
18178
+ TagFormat: {
18179
+ /**
18180
+ * Type
18181
+ * @default checkbox
18182
+ * @enum {string}
18183
+ */
18184
+ type: 'checkbox' | 'text' | 'number' | 'select' | 'search' | 'date';
18185
+ /**
18186
+ * Options
18187
+ * @default []
18188
+ */
18189
+ options: string[];
18201
18190
  };
18202
18191
  /**
18203
- * TagMatrixRow
18204
- * @description One tag of the matrix with its evidence. ``docs``/``facts``/``threads`` are capped; the counts are the
18205
- * totals.
18192
+ * TagKindSchema
18193
+ * @description A kind's fields in a workspace: the columns of a table of that kind's tags. Each tag holds its own values.
18194
+ *
18195
+ * ``is_default`` until the workspace sets its own (the kind's built-in fields, whose ids are stable).
18206
18196
  */
18207
- TagMatrixRow: {
18208
- tag: components['schemas']['TagResponse'];
18197
+ TagKindSchema: {
18198
+ /**
18199
+ * Kind
18200
+ * @enum {string}
18201
+ */
18202
+ kind: 'label' | 'annotation' | 'search' | 'issue' | 'person' | 'organisation';
18203
+ /** Fields */
18204
+ fields?: components['schemas']['FieldDefinition'][];
18205
+ /**
18206
+ * Is Default
18207
+ * @default false
18208
+ */
18209
+ is_default: boolean;
18210
+ /** Updated At */
18211
+ updated_at?: string | null;
18212
+ };
18213
+ /**
18214
+ * TagLinks
18215
+ * @description A tag's evidence: ``docs``/``facts``/``threads`` newest first, at most the list's ``links_limit`` of each;
18216
+ * the counts are the totals (a tag with no documents and no facts is a gap).
18217
+ */
18218
+ TagLinks: {
18209
18219
  /** Docs */
18210
- docs?: components['schemas']['TagMatrixDocLink'][];
18220
+ docs?: components['schemas']['TagDocLink'][];
18211
18221
  /** Facts */
18212
- facts?: components['schemas']['TagMatrixFactLink'][];
18222
+ facts?: components['schemas']['TagFactLink'][];
18213
18223
  /** Threads */
18214
- threads?: components['schemas']['TagMatrixThreadLink'][];
18224
+ threads?: components['schemas']['TagThreadLink'][];
18215
18225
  /**
18216
18226
  * Doc Count
18217
18227
  * @default 0
@@ -18228,21 +18238,6 @@ interface components {
18228
18238
  */
18229
18239
  thread_count: number;
18230
18240
  };
18231
- /**
18232
- * TagMatrixThreadLink
18233
- * @description A thread (conversation) carrying a matrix tag.
18234
- */
18235
- TagMatrixThreadLink: {
18236
- /** Conversation Ext Id */
18237
- conversation_ext_id: string;
18238
- /** Title */
18239
- title?: string | null;
18240
- /**
18241
- * Updated At
18242
- * Format: date-time
18243
- */
18244
- updated_at: string;
18245
- };
18246
18241
  /** TagResponse */
18247
18242
  TagResponse: {
18248
18243
  /** External Id */
@@ -18276,12 +18271,11 @@ interface components {
18276
18271
  * @default 0
18277
18272
  */
18278
18273
  convotag_count: number;
18279
- /** Fields */
18280
- fields?: components['schemas']['TagField'][];
18281
18274
  /** Field Values */
18282
18275
  field_values?: {
18283
18276
  [key: string]: unknown;
18284
18277
  };
18278
+ links?: components['schemas']['TagLinks'] | null;
18285
18279
  /** Created By Ext Id */
18286
18280
  created_by_ext_id: string;
18287
18281
  /** Updated By Ext Id */
@@ -18308,6 +18302,21 @@ interface components {
18308
18302
  instruction?: string | null;
18309
18303
  tag_type?: components['schemas']['TagFormat'];
18310
18304
  };
18305
+ /**
18306
+ * TagThreadLink
18307
+ * @description A thread (conversation) carrying the tag.
18308
+ */
18309
+ TagThreadLink: {
18310
+ /** Conversation Ext Id */
18311
+ conversation_ext_id: string;
18312
+ /** Title */
18313
+ title?: string | null;
18314
+ /**
18315
+ * Updated At
18316
+ * Format: date-time
18317
+ */
18318
+ updated_at: string;
18319
+ };
18311
18320
  /**
18312
18321
  * TaskOptions
18313
18322
  * @description Make the conversation an assistant query starts a task: ``POST /v1/assistant/query`` with ``task`` set.
@@ -19062,6 +19071,16 @@ interface components {
19062
19071
  */
19063
19072
  is_identity_verified: boolean;
19064
19073
  };
19074
+ /**
19075
+ * UpdateTagKindRequest
19076
+ * @description The kind's fields, in full and in order: give a field's id to keep it (its type cannot change; its name and
19077
+ * options can), omit the id to add one. A field left out is removed: the tags' values for it are hidden, and
19078
+ * come back only with that field (its id), never by adding another of the same name.
19079
+ */
19080
+ UpdateTagKindRequest: {
19081
+ /** Fields */
19082
+ fields: components['schemas']['FieldDefinitionWrite'][];
19083
+ };
19065
19084
  /**
19066
19085
  * UpdateTagRequest
19067
19086
  * @description Partial update. Omitted fields are left unchanged.
@@ -19079,30 +19098,19 @@ interface components {
19079
19098
  tag_type?: components['schemas']['TagFormat'] | null;
19080
19099
  /**
19081
19100
  * Kind
19082
- * @description New kind. A label can become an issue, person or organisation and back (all presence tags); a format change alone re-derives label/annotation/search.
19101
+ * @description New kind. A label can become an issue, person or organisation and back (all presence tags); a format change alone re-derives label/annotation/search. Issues, people and organisations are flat: a tag becoming one must have no parent and no children.
19083
19102
  */
19084
19103
  kind?: ('label' | 'annotation' | 'search' | 'issue' | 'person' | 'organisation') | null;
19085
- /**
19086
- * Kind To Children
19087
- * @description With kind: also give it to this tag's children whose format allows it (e.g. mark an existing issue list and its issues in one call).
19088
- * @default false
19089
- */
19090
- kind_to_children: boolean;
19091
19104
  /** Shared */
19092
19105
  shared?: boolean | null;
19093
19106
  /**
19094
19107
  * Parent Ext Id
19095
- * @description Parent tag external ID. Send null to un-nest the tag; omit to leave the parent unchanged.
19108
+ * @description Parent tag external ID (not for issues, people or organisations, which are flat). Send null to un-nest the tag; omit to leave the parent unchanged.
19096
19109
  */
19097
19110
  parent_ext_id?: string | null;
19098
- /**
19099
- * Fields
19100
- * @description The tag's own fields, in full: give a field's id to keep it (its type cannot change), omit the id to add one; fields left out are dropped. Inherited fields are changed on the tag that defines them.
19101
- */
19102
- fields?: components['schemas']['FieldDefinitionWrite'][] | null;
19103
19111
  /**
19104
19112
  * Field Values
19105
- * @description Merged into the current values, keyed by field id or name; null clears a field.
19113
+ * @description Merged into the current values of the kind's fields, keyed by field id or name; null clears one.
19106
19114
  */
19107
19115
  field_values?: {
19108
19116
  [key: string]: unknown;
@@ -19609,6 +19617,21 @@ interface components {
19609
19617
  * @default []
19610
19618
  */
19611
19619
  muted_users: string[];
19620
+ /**
19621
+ * Muted Workspaces
19622
+ * @default []
19623
+ */
19624
+ muted_workspaces: string[];
19625
+ /**
19626
+ * Followed Workspaces
19627
+ * @default []
19628
+ */
19629
+ followed_workspaces: string[];
19630
+ /**
19631
+ * Followed Threads
19632
+ * @default []
19633
+ */
19634
+ followed_threads: string[];
19612
19635
  email_notifications?: components['schemas']['EmailNotificationSettings'];
19613
19636
  /** Premium Model */
19614
19637
  premium_model?: string | null;
@@ -19688,6 +19711,12 @@ interface components {
19688
19711
  hide_online_status?: boolean | null;
19689
19712
  /** Muted Users */
19690
19713
  muted_users?: string[] | null;
19714
+ /** Muted Workspaces */
19715
+ muted_workspaces?: string[] | null;
19716
+ /** Followed Workspaces */
19717
+ followed_workspaces?: string[] | null;
19718
+ /** Followed Threads */
19719
+ followed_threads?: string[] | null;
19691
19720
  email_notifications?: components['schemas']['EmailNotificationSettingsUpdate'] | null;
19692
19721
  /** Premium Model */
19693
19722
  premium_model?: string | null;
@@ -20094,6 +20123,64 @@ interface components {
20094
20123
  /** Location */
20095
20124
  location?: ('office' | 'home' | 'other') | null;
20096
20125
  };
20126
+ /**
20127
+ * WorkspaceActivityEntry
20128
+ * @description One thing that happened in a workspace that the reader can see.
20129
+ *
20130
+ * Titles and names are decrypted when the caller's session has the workspace open, and ``None`` otherwise.
20131
+ */
20132
+ WorkspaceActivityEntry: {
20133
+ /** External Id */
20134
+ external_id: string;
20135
+ source: components['schemas']['WorkspaceActivitySource'];
20136
+ /** Kind */
20137
+ kind: string;
20138
+ /** Actor Ext Id */
20139
+ actor_ext_id?: string | null;
20140
+ /** Conversation Ext Id */
20141
+ conversation_ext_id?: string | null;
20142
+ /** Conversation Title */
20143
+ conversation_title?: string | null;
20144
+ /** Message Ext Id */
20145
+ message_ext_id?: string | null;
20146
+ /** Document Ext Id */
20147
+ document_ext_id?: string | null;
20148
+ /** Document Name */
20149
+ document_name?: string | null;
20150
+ /** Version */
20151
+ version?: number | null;
20152
+ /** Workflow Ext Id */
20153
+ workflow_ext_id?: string | null;
20154
+ /** Workflow Name */
20155
+ workflow_name?: string | null;
20156
+ /** Status */
20157
+ status?: string | null;
20158
+ /** Detail */
20159
+ detail?: {
20160
+ [key: string]: unknown;
20161
+ } | null;
20162
+ /**
20163
+ * Created At
20164
+ * Format: date-time
20165
+ */
20166
+ created_at: string;
20167
+ };
20168
+ /**
20169
+ * WorkspaceActivityPage
20170
+ * @description A page of the feed, newest first. Pass ``next_cursor`` back as ``cursor`` for the next one (None: the end).
20171
+ */
20172
+ WorkspaceActivityPage: {
20173
+ /** Items */
20174
+ items: components['schemas']['WorkspaceActivityEntry'][];
20175
+ /** Next Cursor */
20176
+ next_cursor?: string | null;
20177
+ };
20178
+ /**
20179
+ * WorkspaceActivitySource
20180
+ * @description Where a feed entry comes from.
20181
+ * @enum {string}
20182
+ */
20183
+ WorkspaceActivitySource: 'thread' | 'message' | 'document' | 'workflow';
20097
20184
  /** WorkspaceCreateRequest */
20098
20185
  WorkspaceCreateRequest: {
20099
20186
  /** Name */
@@ -22627,6 +22714,41 @@ interface operations {
22627
22714
  };
22628
22715
  };
22629
22716
  };
22717
+ get_workspace_activity: {
22718
+ parameters: {
22719
+ query?: {
22720
+ /** @description ``next_cursor`` of the previous page */
22721
+ cursor?: string | null;
22722
+ limit?: number;
22723
+ };
22724
+ header?: never;
22725
+ path: {
22726
+ workspace_ext_id: string;
22727
+ };
22728
+ cookie?: never;
22729
+ };
22730
+ requestBody?: never;
22731
+ responses: {
22732
+ /** @description Successful Response */
22733
+ 200: {
22734
+ headers: {
22735
+ [name: string]: unknown;
22736
+ };
22737
+ content: {
22738
+ 'application/json': components['schemas']['WorkspaceActivityPage'];
22739
+ };
22740
+ };
22741
+ /** @description Validation Error */
22742
+ 422: {
22743
+ headers: {
22744
+ [name: string]: unknown;
22745
+ };
22746
+ content: {
22747
+ 'application/json': components['schemas']['HTTPValidationError'];
22748
+ };
22749
+ };
22750
+ };
22751
+ };
22630
22752
  request_docx_agent_v1_editor__document_id__mentions_post: {
22631
22753
  parameters: {
22632
22754
  query?: never;
@@ -24867,7 +24989,18 @@ interface operations {
24867
24989
  };
24868
24990
  list_tags: {
24869
24991
  parameters: {
24870
- query?: never;
24992
+ query?: {
24993
+ /** @description Only tags of this kind (e.g. every issue) */
24994
+ kind?: ('label' | 'annotation' | 'search' | 'issue' | 'person' | 'organisation') | null;
24995
+ /** @description Only this tag's children (a label hierarchy) */
24996
+ parent?: string | null;
24997
+ /** @description Only these tags, in this order (repeat the parameter) */
24998
+ ids?: string[] | null;
24999
+ /** @description links: each tag's documents (with the doctag's note), facts and threads, and their counts */
25000
+ include?: 'links'[] | null;
25001
+ /** @description With include=links: most documents, facts and threads per tag (newest first) */
25002
+ links_limit?: number;
25003
+ };
24871
25004
  header?: never;
24872
25005
  path?: never;
24873
25006
  cookie?: never;
@@ -24883,20 +25016,53 @@ interface operations {
24883
25016
  'application/json': components['schemas']['TagResponse'][];
24884
25017
  };
24885
25018
  };
25019
+ /** @description Validation Error */
25020
+ 422: {
25021
+ headers: {
25022
+ [name: string]: unknown;
25023
+ };
25024
+ content: {
25025
+ 'application/json': components['schemas']['HTTPValidationError'];
25026
+ };
25027
+ };
24886
25028
  };
24887
25029
  };
24888
- get_tag_matrix: {
25030
+ create_tag: {
24889
25031
  parameters: {
24890
- query?: {
24891
- /** @description Rows are this tag's children, oldest first */
24892
- parent_ext_id?: string | null;
24893
- /** @description Rows are these tags, in this order (repeatable) */
24894
- tag_ext_id?: string[] | null;
24895
- /** @description Rows are every tag of this kind, oldest first */
24896
- kind?: ('label' | 'annotation' | 'search' | 'issue' | 'person' | 'organisation') | null;
24897
- /** @description Most documents and facts per row */
24898
- links_limit?: number;
25032
+ query?: never;
25033
+ header?: never;
25034
+ path?: never;
25035
+ cookie?: never;
25036
+ };
25037
+ requestBody: {
25038
+ content: {
25039
+ 'application/json': components['schemas']['CreateTagRequest'];
24899
25040
  };
25041
+ };
25042
+ responses: {
25043
+ /** @description Successful Response */
25044
+ 201: {
25045
+ headers: {
25046
+ [name: string]: unknown;
25047
+ };
25048
+ content: {
25049
+ 'application/json': components['schemas']['TagResponse'];
25050
+ };
25051
+ };
25052
+ /** @description Validation Error */
25053
+ 422: {
25054
+ headers: {
25055
+ [name: string]: unknown;
25056
+ };
25057
+ content: {
25058
+ 'application/json': components['schemas']['HTTPValidationError'];
25059
+ };
25060
+ };
25061
+ };
25062
+ };
25063
+ list_tag_kinds: {
25064
+ parameters: {
25065
+ query?: never;
24900
25066
  header?: never;
24901
25067
  path?: never;
24902
25068
  cookie?: never;
@@ -24909,7 +25075,29 @@ interface operations {
24909
25075
  [name: string]: unknown;
24910
25076
  };
24911
25077
  content: {
24912
- 'application/json': components['schemas']['TagMatrixResponse'];
25078
+ 'application/json': components['schemas']['TagKindSchema'][];
25079
+ };
25080
+ };
25081
+ };
25082
+ };
25083
+ get_tag_kind: {
25084
+ parameters: {
25085
+ query?: never;
25086
+ header?: never;
25087
+ path: {
25088
+ kind: 'label' | 'annotation' | 'search' | 'issue' | 'person' | 'organisation';
25089
+ };
25090
+ cookie?: never;
25091
+ };
25092
+ requestBody?: never;
25093
+ responses: {
25094
+ /** @description Successful Response */
25095
+ 200: {
25096
+ headers: {
25097
+ [name: string]: unknown;
25098
+ };
25099
+ content: {
25100
+ 'application/json': components['schemas']['TagKindSchema'];
24913
25101
  };
24914
25102
  };
24915
25103
  /** @description Validation Error */
@@ -24923,29 +25111,28 @@ interface operations {
24923
25111
  };
24924
25112
  };
24925
25113
  };
24926
- extract_entities: {
25114
+ update_tag_kind: {
24927
25115
  parameters: {
24928
- query?: {
24929
- /** @description Configuration to use for the LLM */
24930
- config_ext_id?: string | null;
24931
- };
25116
+ query?: never;
24932
25117
  header?: never;
24933
- path?: never;
25118
+ path: {
25119
+ kind: 'label' | 'annotation' | 'search' | 'issue' | 'person' | 'organisation';
25120
+ };
24934
25121
  cookie?: never;
24935
25122
  };
24936
25123
  requestBody: {
24937
25124
  content: {
24938
- 'application/json': components['schemas']['ExtractEntitiesRequest'];
25125
+ 'application/json': components['schemas']['UpdateTagKindRequest'];
24939
25126
  };
24940
25127
  };
24941
25128
  responses: {
24942
25129
  /** @description Successful Response */
24943
- 202: {
25130
+ 200: {
24944
25131
  headers: {
24945
25132
  [name: string]: unknown;
24946
25133
  };
24947
25134
  content: {
24948
- 'application/json': components['schemas']['ExtractEntitiesResponse'];
25135
+ 'application/json': components['schemas']['TagKindSchema'];
24949
25136
  };
24950
25137
  };
24951
25138
  /** @description Validation Error */
@@ -24959,26 +25146,29 @@ interface operations {
24959
25146
  };
24960
25147
  };
24961
25148
  };
24962
- create_tag: {
25149
+ extract_entities: {
24963
25150
  parameters: {
24964
- query?: never;
25151
+ query?: {
25152
+ /** @description Configuration to use for the LLM */
25153
+ config_ext_id?: string | null;
25154
+ };
24965
25155
  header?: never;
24966
25156
  path?: never;
24967
25157
  cookie?: never;
24968
25158
  };
24969
25159
  requestBody: {
24970
25160
  content: {
24971
- 'application/json': components['schemas']['CreateTagRequest'];
25161
+ 'application/json': components['schemas']['ExtractEntitiesRequest'];
24972
25162
  };
24973
25163
  };
24974
25164
  responses: {
24975
25165
  /** @description Successful Response */
24976
- 201: {
25166
+ 202: {
24977
25167
  headers: {
24978
25168
  [name: string]: unknown;
24979
25169
  };
24980
25170
  content: {
24981
- 'application/json': components['schemas']['TagResponse'];
25171
+ 'application/json': components['schemas']['ExtractEntitiesResponse'];
24982
25172
  };
24983
25173
  };
24984
25174
  /** @description Validation Error */
@@ -30541,28 +30731,6 @@ interface operations {
30541
30731
  };
30542
30732
  };
30543
30733
  };
30544
- rotation_credentials_v1_mail_native_rotation_credentials_get: {
30545
- parameters: {
30546
- query?: never;
30547
- header?: never;
30548
- path?: never;
30549
- cookie?: never;
30550
- };
30551
- requestBody?: never;
30552
- responses: {
30553
- /** @description Successful Response */
30554
- 200: {
30555
- headers: {
30556
- [name: string]: unknown;
30557
- };
30558
- content: {
30559
- 'application/json': {
30560
- [key: string]: string;
30561
- };
30562
- };
30563
- };
30564
- };
30565
- };
30566
30734
  save_draft_v1_mail_accounts__account_id__drafts_post: {
30567
30735
  parameters: {
30568
30736
  query?: never;
@@ -30946,6 +31114,8 @@ interface CryptoProvider {
30946
31114
  interface SessionKeys {
30947
31115
  signingPrivateKey: Uint8Array;
30948
31116
  serverSessionKey?: Uint8Array;
31117
+ /** The identity wrapped under the password key (see SessionData.wrappedIdentityKey). */
31118
+ wrappedIdentityKey?: string | null;
30949
31119
  }
30950
31120
  interface SessionStorageProvider {
30951
31121
  getSession(): Promise<SessionKeys | null>;
@@ -30971,6 +31141,8 @@ interface LoginResult$1 {
30971
31141
  accessToken: string;
30972
31142
  sessionKey: Uint8Array;
30973
31143
  userExtId?: string;
31144
+ /** The login response's `wrapped_identity_key`, saved with the session. */
31145
+ wrappedIdentityKey?: string | null;
30974
31146
  }
30975
31147
  /** Performs the login API call. Transport details are the consumer's concern. */
30976
31148
  interface LoginProvider {
@@ -31283,10 +31455,15 @@ declare function generateUserKeypairs(username: string, password: string, deploy
31283
31455
  * Generates registration, login, and password-change credentials.
31284
31456
  * Uses inline type definitions (structurally identical to OpenAPI schema types)
31285
31457
  * to avoid coupling the crypto module to the schema file.
31458
+ *
31459
+ * Two keys are in play (see ./identity.ts): the account identity, a fixed random Ed25519 keypair, and the
31460
+ * password key, derived from email + password, which signs password logins and wraps the identity.
31286
31461
  */
31287
31462
  interface RegisterRequest {
31288
31463
  email: string;
31289
31464
  signing_key: string;
31465
+ login_key?: string | null;
31466
+ wrapped_identity_key?: string | null;
31290
31467
  verification_credential: string;
31291
31468
  given_name?: string | null;
31292
31469
  family_name?: string | null;
@@ -31301,8 +31478,8 @@ interface LoginRequest {
31301
31478
  interface ChangePasswordRequest {
31302
31479
  signature: string;
31303
31480
  timestamp: number;
31304
- new_signing_key: string;
31305
- rewrapped_workspace_keys: Record<string, string>;
31481
+ new_login_key: string;
31482
+ wrapped_identity_key: string;
31306
31483
  }
31307
31484
  /**
31308
31485
  * Credentials returned by generate functions.
@@ -31311,76 +31488,77 @@ interface ChangePasswordRequest {
31311
31488
  */
31312
31489
  interface RegistrationCredentials {
31313
31490
  request: RegisterRequest;
31491
+ /** The new account's identity secret key (what the session keeps, and the recovery key). */
31314
31492
  signingPrivateKey: Uint8Array;
31315
31493
  }
31316
31494
  interface LoginCredentials {
31317
31495
  request: LoginRequest;
31496
+ /**
31497
+ * The password key that signed the request. Not the identity: open it from the response with
31498
+ * `unwrapIdentityKey(response.wrapped_identity_key, passwordPrivateKey)`.
31499
+ */
31500
+ passwordPrivateKey: Uint8Array;
31501
+ }
31502
+ interface KeyLoginCredentials {
31503
+ request: LoginRequest;
31504
+ /** The identity secret key that signed the request (recovery key, session re-login). */
31318
31505
  signingPrivateKey: Uint8Array;
31319
31506
  }
31320
31507
  interface PasswordChangeCredentials {
31321
- request: Omit<ChangePasswordRequest, 'rewrapped_workspace_keys'>;
31322
- newSigningPrivateKey: Uint8Array;
31508
+ request: ChangePasswordRequest;
31323
31509
  }
31324
31510
  /**
31325
- * Generate registration credentials with Ed25519 signing key.
31511
+ * Generate registration credentials: a random identity, wrapped under the password key.
31326
31512
  *
31327
- * Creates Ed25519 keypair deterministically from email + password.
31328
- * Server receives the Ed25519 public key (signing_key) and derives X25519 from it.
31329
- *
31330
- * @param registrationData - Registration fields (signing_key will be generated)
31331
- * @param password - User's password (to generate keypair)
31332
- * @param deploymentDomain - Deployment domain for salt derivation
31333
- * @returns RegistrationCredentials with request body and private key (kept separate)
31513
+ * The server stores the identity public key (signing_key, and the X25519 key it derives from it), the password
31514
+ * key (login_key) and the wrapped identity.
31334
31515
  */
31335
- declare function generateRegistrationCredentials(registrationData: Omit<RegisterRequest, 'signing_key'>, password: string, deploymentDomain: string): Promise<RegistrationCredentials>;
31516
+ declare function generateRegistrationCredentials(registrationData: Omit<RegisterRequest, 'signing_key' | 'login_key' | 'wrapped_identity_key'>, password: string, deploymentDomain: string): Promise<RegistrationCredentials>;
31336
31517
  /**
31337
- * Generate login credentials with Ed25519 signature authentication.
31338
- *
31339
- * Derives Ed25519 keypair from email + password and signs "email|timestamp".
31340
- * Server verifies signature using stored Ed25519 public key.
31341
- *
31342
- * @param loginData - Login fields (signature and timestamp will be generated)
31343
- * @param password - User's password (to regenerate keypair)
31344
- * @param deploymentDomain - Deployment domain for salt derivation
31345
- * @returns LoginCredentials with request body and private key (kept separate)
31518
+ * Generate password-login credentials: derive the password key and sign "email|timestamp" with it.
31346
31519
  */
31347
31520
  declare function generateLoginCredentials(loginData: Omit<LoginRequest, 'signature' | 'timestamp'>, password: string, deploymentDomain: string): Promise<LoginCredentials>;
31348
31521
  /**
31349
- * Generate login credentials using an existing signing key (for password recovery).
31350
- *
31351
- * Bypasses password derivation and uses the provided key directly.
31352
- *
31353
- * @param loginData - Login fields (signature and timestamp will be generated)
31354
- * @param signingPrivateKey - The Ed25519 signing private key (64 bytes)
31355
- * @returns LoginCredentials with request body and private key
31522
+ * Generate login credentials signed by the identity key itself (recovery key, session re-login).
31356
31523
  */
31357
- declare function generateLoginCredentialsFromKey(loginData: Omit<LoginRequest, 'signature' | 'timestamp'>, signingPrivateKey: Uint8Array): LoginCredentials;
31524
+ declare function generateLoginCredentialsFromKey(loginData: Omit<LoginRequest, 'signature' | 'timestamp'>, signingPrivateKey: Uint8Array): KeyLoginCredentials;
31358
31525
  /**
31359
- * Generate change password credentials with Ed25519 signature authentication.
31526
+ * Generate a password change: the identity is kept, re-wrapped under the new password key.
31360
31527
  *
31361
- * Signs "email|timestamp" with current Ed25519 key to prove knowledge of current password.
31362
- * Provides new Ed25519 public key derived from new password.
31363
- *
31364
- * @param email - User's email address
31365
- * @param currentPassword - Current password (to sign with current key)
31366
- * @param newPassword - New password (to generate new key)
31367
- * @param deploymentDomain - Deployment domain for salt derivation
31368
- * @returns PasswordChangeCredentials with request body and new private key (kept separate)
31528
+ * Signed with the current password key when `currentPassword` is given (proves it), else with the identity key
31529
+ * (recovery: the user signed in with the recovery key and no longer knows the password).
31369
31530
  */
31370
- declare function generatePasswordChangeCredentials(email: string, currentPassword: string, newPassword: string, deploymentDomain: string): Promise<PasswordChangeCredentials>;
31531
+ declare function generatePasswordChangeCredentials(params: {
31532
+ email: string;
31533
+ identitySecretKey: Uint8Array;
31534
+ newPassword: string;
31535
+ currentPassword?: string;
31536
+ }, deploymentDomain: string): Promise<PasswordChangeCredentials>;
31537
+
31371
31538
  /**
31372
- * Generate password change credentials for recovery mode.
31539
+ * The account identity and the password key that wraps it.
31373
31540
  *
31374
- * Used when the user is recovering their account with a recovery key.
31375
- * Signs with the existing signing key (from recovery) instead of deriving from password.
31541
+ * The identity is a fixed Ed25519 keypair (its X25519 form is what workspace keys, mailbox keys and direct
31542
+ * messages are encrypted to). The password derives a separate "password key" (Argon2id, `generateUserKeypairs`)
31543
+ * that signs password logins and wraps the identity's secret key. Changing the password re-wraps the identity
31544
+ * and re-encrypts nothing.
31376
31545
  *
31377
- * @param email - User's email address
31378
- * @param currentSigningKey - Current signing key (from recovery)
31379
- * @param newPassword - New password (to generate new key)
31380
- * @param deploymentDomain - Deployment domain for salt derivation
31381
- * @returns PasswordChangeCredentials with request body and new private key
31546
+ * Accounts registered before this existed have no wrap: their password key IS the identity
31547
+ * (`wrapped_identity_key` is null in the login response).
31548
+ *
31549
+ * Same scheme as the Python SDK (`arbi_client.sdk.crypto`): BLAKE2b-256 keyed by the password key's seed over
31550
+ * a fixed context gives a SecretBox key; the wrap is base64 of `nonce(24) ‖ secretbox(identity secret key)`.
31551
+ */
31552
+
31553
+ /** A fresh random identity (Ed25519; secretKey is the 64-byte form). */
31554
+ declare function generateIdentityKeypair(): KeyPair;
31555
+ /** Wrap the identity's 64-byte Ed25519 secret key under a password key. */
31556
+ declare function wrapIdentityKey(identitySecretKey: Uint8Array, passwordSecretKey: Uint8Array): string;
31557
+ /**
31558
+ * The identity's 64-byte Ed25519 secret key a password key opens: unwrapped from `wrapped`, or the password key
31559
+ * itself when nothing is wrapped. Throws when the password key does not open the wrap (a wrong password).
31382
31560
  */
31383
- declare function generateRecoveryPasswordChangeCredentials(email: string, currentSigningKey: Uint8Array, newPassword: string, deploymentDomain: string): Promise<PasswordChangeCredentials>;
31561
+ declare function unwrapIdentityKey(wrapped: string | null | undefined, passwordSecretKey: Uint8Array): Uint8Array;
31384
31562
 
31385
31563
  /**
31386
31564
  * storage.ts - IndexedDB Storage Module
@@ -31417,9 +31595,16 @@ declare function canPersistSession(): boolean;
31417
31595
  * Note: accessToken is stored in Zustand (persisted separately), not here.
31418
31596
  */
31419
31597
  interface SessionData {
31598
+ /** The account identity's Ed25519 secret key (64 bytes) - X25519 derived from this */
31420
31599
  signingPrivateKey: Uint8Array;
31421
31600
  serverSessionKey?: Uint8Array;
31422
31601
  userExtId?: string;
31602
+ /**
31603
+ * The identity wrapped under the password key, as the last login returned it (null: the password key is
31604
+ * the identity). Lets a typed password be checked, and the identity opened, without the server (offline
31605
+ * unlock, step-up confirmations). Ciphertext under the password key, so it is stored as is.
31606
+ */
31607
+ wrappedIdentityKey?: string | null;
31423
31608
  }
31424
31609
  /**
31425
31610
  * Initialize IndexedDB database.
@@ -31449,12 +31634,11 @@ declare function saveSession(sessionData: SessionData): Promise<void>;
31449
31634
  */
31450
31635
  declare function getSession(): Promise<SessionData | null>;
31451
31636
  /**
31452
- * Update the signing private key in IndexedDB (used when changing password).
31453
- * This re-encrypts the new key while preserving other session data.
31637
+ * Replace the stored wrapped identity (after a password change), keeping the rest of the session.
31454
31638
  *
31455
- * @param newSigningPrivateKey - New Ed25519 private key to store
31639
+ * @param wrappedIdentityKey - The identity wrapped under the new password key
31456
31640
  */
31457
- declare function updateSigningPrivateKey(newSigningPrivateKey: Uint8Array): Promise<void>;
31641
+ declare function updateWrappedIdentityKey(wrappedIdentityKey: string): Promise<void>;
31458
31642
  /**
31459
31643
  * Clear session data from IndexedDB.
31460
31644
  */
@@ -31500,7 +31684,8 @@ interface RegisterResult {
31500
31684
  /**
31501
31685
  * Login flow
31502
31686
  *
31503
- * Generates Ed25519 signature → posts to /v1/user/login → saves session
31687
+ * Signs "email|timestamp" (password key, or the identity key itself) → posts to /v1/user/login → opens the
31688
+ * identity → saves session
31504
31689
  */
31505
31690
 
31506
31691
  interface LoginParams {
@@ -31532,6 +31717,7 @@ interface LoginResult {
31532
31717
  parentExtId?: string | null;
31533
31718
  /** The profile from the login response, so hosts need no second request for the name. */
31534
31719
  profile?: LoginProfile;
31720
+ /** The account identity's secret key (the session key material, and the recovery key). */
31535
31721
  signingPrivateKey: Uint8Array;
31536
31722
  serverSessionKey: Uint8Array;
31537
31723
  }
@@ -31539,46 +31725,57 @@ interface LoginResult {
31539
31725
  /**
31540
31726
  * Change password flow
31541
31727
  *
31542
- * Generates old + new credentials → posts to /v1/user/change_password → updates stored key
31728
+ * The password only wraps the account identity (see ../crypto/identity.ts). Changing it derives the new password
31729
+ * key, re-wraps the session's identity under it and posts both to /v1/user/change_password: one request, O(1).
31730
+ * Workspace keys, mailbox keys and direct messages stay encrypted to the unchanged identity, so nothing is
31731
+ * re-encrypted, nothing can be missed and the other party of a conversation is unaffected. The recovery key
31732
+ * (the identity secret key) is unchanged too.
31543
31733
  */
31544
31734
 
31545
31735
  interface ChangePasswordParams {
31546
31736
  email: string;
31547
- currentPassword: string;
31548
31737
  newPassword: string;
31549
- rewrappedWorkspaceKeys?: Record<string, string>;
31550
- }
31551
- interface ChangePasswordResult {
31552
- newSigningPrivateKey: Uint8Array;
31553
- }
31554
- interface RekeyedPasswordChangeParams {
31555
- email: string;
31556
- newPassword: string;
31557
- /** The current password. Omit in recovery mode: the session's own signing key proves identity. */
31738
+ /** The current password. Omit in recovery mode: the session's identity key signs instead. */
31558
31739
  currentPassword?: string;
31559
- /** The caller's `usr-` id; needed to tell sent from received direct messages. */
31560
- userExtId?: string;
31740
+ /**
31741
+ * The account identity's secret key. Omitted: read from the browser session store, which is then
31742
+ * updated with the new wrap (hosts with their own key store pass it and keep `wrappedIdentityKey`).
31743
+ */
31744
+ identitySecretKey?: Uint8Array;
31561
31745
  }
31562
- interface RekeyedPasswordChangeResult {
31563
- newSigningPrivateKey: Uint8Array;
31564
- /** Workspaces the server re-keyed. */
31565
- workspacesUpdated: number;
31566
- /** Direct messages re-encrypted for the new key. */
31567
- messagesReEncrypted: number;
31746
+ interface ChangePasswordResult {
31747
+ /** The identity wrapped under the new password key (what a password login now returns). */
31748
+ wrappedIdentityKey: string;
31568
31749
  }
31569
- type FetchClient = ReturnType<typeof createFetchClient<paths>>;
31570
31750
  /** Pull a readable message out of whatever shape a failed call carried (`{ detail }`, `Error`). */
31571
31751
  declare function passwordChangeErrorMessage(err: unknown): string;
31572
31752
  /**
31573
- * Change (or, in recovery mode, set) the master password: derive the new keys, re-wrap the key of
31574
- * every workspace the user is a member of for them, re-encrypt direct messages, post it all to
31575
- * `/v1/user/change_password`, then store the new signing key. The caller shows the recovery key
31576
- * for `newSigningPrivateKey` afterwards.
31753
+ * Change (or, in recovery mode, set) the master password of the signed-in account.
31577
31754
  */
31578
- declare function changePasswordWithRekey(params: RekeyedPasswordChangeParams, deps: {
31579
- fetchClient: FetchClient;
31755
+ declare function changePassword(params: ChangePasswordParams, deps: {
31756
+ fetchClient: ReturnType<typeof createFetchClient<paths>>;
31580
31757
  deploymentDomain: string;
31581
- }): Promise<RekeyedPasswordChangeResult>;
31758
+ }): Promise<ChangePasswordResult>;
31759
+
31760
+ /**
31761
+ * Opening the account identity with a password (see ../crypto/identity.ts).
31762
+ */
31763
+ /**
31764
+ * The identity a password login opened: unwrapped from the response with the password key that signed it (or
31765
+ * the password key itself for an account whose password key is its identity). Refuses an identity that is not
31766
+ * the account's, so a wrong wrap cannot become the session's key.
31767
+ */
31768
+ declare function identityFromLoginResponse(passwordPrivateKey: Uint8Array, response: {
31769
+ wrapped_identity_key?: string | null;
31770
+ user: {
31771
+ encryption_public_key: string;
31772
+ };
31773
+ }): Uint8Array;
31774
+ /**
31775
+ * Check a typed password against the signed-in session and return the identity it opens (step-up
31776
+ * confirmations, offline unlock). Uses the wrap saved at the last login; throws "Incorrect password".
31777
+ */
31778
+ declare function unlockIdentityWithPassword(email: string, password: string, deploymentDomain: string): Promise<Uint8Array>;
31582
31779
 
31583
31780
  /**
31584
31781
  * createArbiClient() — SDK entry point
@@ -31802,4 +31999,4 @@ interface ReopenDeps {
31802
31999
  */
31803
32000
  declare function createWorkspaceReopener(deps: ReopenDeps): () => Promise<boolean>;
31804
32001
 
31805
- export { type $defs, API_PREFIX, type ArbiClient, type ArbiClientOptions, type AuthStateProvider, type AutoReloginMiddlewareConfig, type BearerAuthMiddlewareConfig, CALL_KEY_BYTES, type ChangePasswordParams, type ChangePasswordRequest, type ChangePasswordResult, type CryptoProvider, type KeyPair, type LoginCredentials, type LoginParams, type LoginProfile, type LoginProvider, type LoginRequest, type LoginResult, type LoginWithKeyParams, type OnReloginSuccess, type PasswordChangeCredentials, type RegisterParams, type RegisterRequest, type RegisterResult, type RegistrationCredentials, type RekeyedPasswordChangeParams, type RekeyedPasswordChangeResult, type ReloginDeps, type ReloginHandler, type ReopenDeps, type SessionData, type SessionKeys, type SessionManager, type SessionState, type SessionStorageProvider, type SsoTokenProvider, type TokenProvider, type UserKeypairs, type WebSocketClientMessage, type WebSocketServerMessage, type WorkspaceKeyRefreshProvider, type WorkspaceOpenProvider, type WsAuthMessage, type WsAuthResultMessage, type WsBatchCompleteMessage, type WsConnectionClosedMessage, type WsConversationMessagePostedMessage, type WsErrorMessage, type WsNotificationResponse, type WsPresenceUpdateMessage, type WsResponseCompleteMessage, type WsTaskUpdateMessage, base64Decode, base64Encode, base64ToBytes, buildCallFragment, buildWebSocketUrl, bytesToBase64, canPersistSession, changePasswordWithRekey, clearAllData, clearSession, type components, computeSharedSecret, createArbiClient, createAuthMessage, createAutoReloginMiddleware, createBearerAuthMiddleware, createContentHash, createReloginHandler, createSessionManager, createWorkspaceReopener, decodeCallKey, decryptCallTitle, decryptFile, decryptMessage, decryptMessageWithSharedSecret, deriveEncryptionKeypairFromSigning, derivePublicKey, encodeCallKey, encryptCallTitle, encryptFile, encryptMessage, encryptMessageWithSharedSecret, generateCallKey, generateKeyPairs, generateLoginCredentials, generateLoginCredentialsFromKey, generatePasswordChangeCredentials, generateRandomSigningKeypair, generateRecoveryPasswordChangeCredentials, generateRegistrationCredentials, generateUserKeypairs, getSession, getUserEncryptionKeypair, hasSession, initSodium, initializeDatabase, isMessageType, openSealedCallKey, type operations, parseCallFragment, parseServerMessage, passwordChangeErrorMessage, type paths, prewarmKeyPairs, saveSession, sealCallKey, sealKeyForSession, sealedBoxDecrypt, sealedBoxEncrypt, signMessage, updateSigningPrivateKey, type webhooks };
32002
+ export { type $defs, API_PREFIX, type ArbiClient, type ArbiClientOptions, type AuthStateProvider, type AutoReloginMiddlewareConfig, type BearerAuthMiddlewareConfig, CALL_KEY_BYTES, type ChangePasswordParams, type ChangePasswordRequest, type ChangePasswordResult, type CryptoProvider, type KeyLoginCredentials, type KeyPair, type LoginCredentials, type LoginParams, type LoginProfile, type LoginProvider, type LoginRequest, type LoginResult, type LoginWithKeyParams, type OnReloginSuccess, type PasswordChangeCredentials, type RegisterParams, type RegisterRequest, type RegisterResult, type RegistrationCredentials, type ReloginDeps, type ReloginHandler, type ReopenDeps, type SessionData, type SessionKeys, type SessionManager, type SessionState, type SessionStorageProvider, type SsoTokenProvider, type TokenProvider, type UserKeypairs, type WebSocketClientMessage, type WebSocketServerMessage, type WorkspaceKeyRefreshProvider, type WorkspaceOpenProvider, type WsAuthMessage, type WsAuthResultMessage, type WsBatchCompleteMessage, type WsConnectionClosedMessage, type WsConversationMessagePostedMessage, type WsErrorMessage, type WsNotificationResponse, type WsPresenceUpdateMessage, type WsResponseCompleteMessage, type WsTaskUpdateMessage, base64Decode, base64Encode, base64ToBytes, buildCallFragment, buildWebSocketUrl, bytesToBase64, canPersistSession, changePassword, clearAllData, clearSession, type components, computeSharedSecret, createArbiClient, createAuthMessage, createAutoReloginMiddleware, createBearerAuthMiddleware, createContentHash, createReloginHandler, createSessionManager, createWorkspaceReopener, decodeCallKey, decryptCallTitle, decryptFile, decryptMessage, decryptMessageWithSharedSecret, deriveEncryptionKeypairFromSigning, derivePublicKey, encodeCallKey, encryptCallTitle, encryptFile, encryptMessage, encryptMessageWithSharedSecret, generateCallKey, generateIdentityKeypair, generateKeyPairs, generateLoginCredentials, generateLoginCredentialsFromKey, generatePasswordChangeCredentials, generateRandomSigningKeypair, generateRegistrationCredentials, generateUserKeypairs, getSession, getUserEncryptionKeypair, hasSession, identityFromLoginResponse, initSodium, initializeDatabase, isMessageType, openSealedCallKey, type operations, parseCallFragment, parseServerMessage, passwordChangeErrorMessage, type paths, prewarmKeyPairs, saveSession, sealCallKey, sealKeyForSession, sealedBoxDecrypt, sealedBoxEncrypt, signMessage, unlockIdentityWithPassword, unwrapIdentityKey, updateWrappedIdentityKey, type webhooks, wrapIdentityKey };