@arbidocs/sdk 0.4.146 → 0.4.148

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.
@@ -36,6 +36,9 @@ declare function requireData<T>(result: {
36
36
  */
37
37
  declare function requireOk(result: {
38
38
  error?: unknown;
39
+ response?: {
40
+ status: number;
41
+ };
39
42
  }, message: string): void;
40
43
  /**
41
44
  * Extract a human-readable message from an unknown error value.
@@ -1857,6 +1860,12 @@ declare function listWorkspaces(arbi: ArbiClient): Promise<{
1857
1860
  project_subscription?: string | null | undefined;
1858
1861
  project_owner_ext_id?: string | null | undefined;
1859
1862
  house_template_ext_id?: string | null | undefined;
1863
+ archive?: {
1864
+ status: "archiving" | "archived" | "restoring";
1865
+ archived_at: string;
1866
+ documents_done: number;
1867
+ documents_total: number;
1868
+ } | null | undefined;
1860
1869
  }[]>;
1861
1870
  /**
1862
1871
  * Create a workspace with a pre-encrypted workspace key.
@@ -1907,6 +1916,12 @@ declare function createWorkspace(arbi: ArbiClient, name: string, encryptedWorksp
1907
1916
  project_subscription?: string | null | undefined;
1908
1917
  project_owner_ext_id?: string | null | undefined;
1909
1918
  house_template_ext_id?: string | null | undefined;
1919
+ archive?: {
1920
+ status: "archiving" | "archived" | "restoring";
1921
+ archived_at: string;
1922
+ documents_done: number;
1923
+ documents_total: number;
1924
+ } | null | undefined;
1910
1925
  }>;
1911
1926
  declare function deleteWorkspaces(arbi: ArbiClient, workspaceIds: string[]): Promise<void>;
1912
1927
  declare function updateWorkspace(arbi: ArbiClient, body: WorkspaceUpdateRequest$1): Promise<{
@@ -1951,6 +1966,12 @@ declare function updateWorkspace(arbi: ArbiClient, body: WorkspaceUpdateRequest$
1951
1966
  project_subscription?: string | null | undefined;
1952
1967
  project_owner_ext_id?: string | null | undefined;
1953
1968
  house_template_ext_id?: string | null | undefined;
1969
+ archive?: {
1970
+ status: "archiving" | "archived" | "restoring";
1971
+ archived_at: string;
1972
+ documents_done: number;
1973
+ documents_total: number;
1974
+ } | null | undefined;
1954
1975
  }>;
1955
1976
  declare function listWorkspaceUsers(arbi: ArbiClient): Promise<{
1956
1977
  user: {
@@ -2105,6 +2126,11 @@ declare function getWorkspaceActivity(arbi: ArbiClient, workspaceExtId: string,
2105
2126
  }[];
2106
2127
  next_cursor?: string | null | undefined;
2107
2128
  }>;
2129
+ /**
2130
+ * Hand the server session a workspace's key (sealed to the session) without opening the workspace,
2131
+ * e.g. so a sync into it can read it.
2132
+ */
2133
+ declare function primeWorkspaceKey(arbi: ArbiClient, workspaceExtId: string, sessionSealedKey: string): Promise<void>;
2108
2134
 
2109
2135
  type workspaces_WorkspaceActivityOptions = WorkspaceActivityOptions;
2110
2136
  declare const workspaces_addWorkspaceUsers: typeof addWorkspaceUsers;
@@ -2115,11 +2141,12 @@ declare const workspaces_getWorkspaceActivity: typeof getWorkspaceActivity;
2115
2141
  declare const workspaces_grantTemporaryWorkspaceAccess: typeof grantTemporaryWorkspaceAccess;
2116
2142
  declare const workspaces_listWorkspaceUsers: typeof listWorkspaceUsers;
2117
2143
  declare const workspaces_listWorkspaces: typeof listWorkspaces;
2144
+ declare const workspaces_primeWorkspaceKey: typeof primeWorkspaceKey;
2118
2145
  declare const workspaces_removeWorkspaceUsers: typeof removeWorkspaceUsers;
2119
2146
  declare const workspaces_setUserRole: typeof setUserRole;
2120
2147
  declare const workspaces_updateWorkspace: typeof updateWorkspace;
2121
2148
  declare namespace workspaces {
2122
- export { type workspaces_WorkspaceActivityOptions as WorkspaceActivityOptions, workspaces_addWorkspaceUsers as addWorkspaceUsers, workspaces_copyDocuments as copyDocuments, workspaces_createWorkspace as createWorkspace, workspaces_deleteWorkspaces as deleteWorkspaces, workspaces_getWorkspaceActivity as getWorkspaceActivity, workspaces_grantTemporaryWorkspaceAccess as grantTemporaryWorkspaceAccess, workspaces_listWorkspaceUsers as listWorkspaceUsers, workspaces_listWorkspaces as listWorkspaces, workspaces_removeWorkspaceUsers as removeWorkspaceUsers, workspaces_setUserRole as setUserRole, workspaces_updateWorkspace as updateWorkspace };
2149
+ export { type workspaces_WorkspaceActivityOptions as WorkspaceActivityOptions, workspaces_addWorkspaceUsers as addWorkspaceUsers, workspaces_copyDocuments as copyDocuments, workspaces_createWorkspace as createWorkspace, workspaces_deleteWorkspaces as deleteWorkspaces, workspaces_getWorkspaceActivity as getWorkspaceActivity, workspaces_grantTemporaryWorkspaceAccess as grantTemporaryWorkspaceAccess, workspaces_listWorkspaceUsers as listWorkspaceUsers, workspaces_listWorkspaces as listWorkspaces, workspaces_primeWorkspaceKey as primeWorkspaceKey, workspaces_removeWorkspaceUsers as removeWorkspaceUsers, workspaces_setUserRole as setUserRole, workspaces_updateWorkspace as updateWorkspace };
2123
2150
  }
2124
2151
 
2125
2152
  /**
@@ -2935,6 +2962,12 @@ declare function buildRetrievalFullContextTool(docIds: string[]): components['sc
2935
2962
  */
2936
2963
  declare function buildFactsContextTool(factIds: string[]): components['schemas']['FactsContextTool'];
2937
2964
  declare function buildRetrievalTocTool(docIds: string[]): components['schemas']['RetrievalTOCTool'];
2965
+ /**
2966
+ * The most document ids one retrieve sends. An empty list searches the whole workspace (the
2967
+ * server resolves it), so a caller sends ids only for a narrowed scope, and a scope above this
2968
+ * should be narrowed further or cleared.
2969
+ */
2970
+ declare const MAX_RETRIEVE_DOC_IDS = 5000;
2938
2971
  interface RetrieveOptions {
2939
2972
  arbi: ArbiClient;
2940
2973
  workspaceId: string;
@@ -2944,6 +2977,8 @@ interface RetrieveOptions {
2944
2977
  fullContextDocIds?: string[];
2945
2978
  tocDocIds?: string[];
2946
2979
  model?: string;
2980
+ /** Keep the response server-side (default true); a plain search keeps nothing. */
2981
+ store?: boolean;
2947
2982
  }
2948
2983
  interface ChunkMetadata {
2949
2984
  doc_ext_id?: string | null;
@@ -2978,6 +3013,29 @@ interface RetrieveResult {
2978
3013
  * Uses the typed SDK route POST /v1/assistant/retrieve.
2979
3014
  */
2980
3015
  declare function retrieve(options: RetrieveOptions): Promise<RetrieveResult>;
3016
+ /** One passage a search found, ranked by {@link searchChunks}. */
3017
+ interface SearchChunk {
3018
+ /** Stable key: the chunk id, else the document and the passage's position in its results. */
3019
+ id: string;
3020
+ /**
3021
+ * The chunk id: the join key to the passage's place in the document viewer
3022
+ * (`data-chunk-id`). Absent on legacy chunks.
3023
+ */
3024
+ chunkExtId?: string;
3025
+ docId: string;
3026
+ docTitle: string;
3027
+ page?: number;
3028
+ /** The rerank score when there is one, else the retrieval score. */
3029
+ score: number;
3030
+ /** Position among its document's results. */
3031
+ index: number;
3032
+ content: string;
3033
+ }
3034
+ /**
3035
+ * A retrieve's passages, best first: unreadable fragments dropped, one per chunk, each with its
3036
+ * best score (a rerank score that is not positive does not count).
3037
+ */
3038
+ declare function searchChunks(result: RetrieveResult | null | undefined): SearchChunk[];
2981
3039
  interface AssistantQueryOptions extends AuthHeaders {
2982
3040
  agentId?: string;
2983
3041
  activeArtifactExtId?: string;
@@ -3122,9 +3180,11 @@ type assistant_AssistantQueryOptions = AssistantQueryOptions;
3122
3180
  type assistant_Chunk = Chunk;
3123
3181
  type assistant_ChunkMetadata = ChunkMetadata;
3124
3182
  type assistant_CommandDescriptor = CommandDescriptor;
3183
+ declare const assistant_MAX_RETRIEVE_DOC_IDS: typeof MAX_RETRIEVE_DOC_IDS;
3125
3184
  type assistant_ParsedSlashCommand = ParsedSlashCommand;
3126
3185
  type assistant_RetrieveOptions = RetrieveOptions;
3127
3186
  type assistant_RetrieveResult = RetrieveResult;
3187
+ type assistant_SearchChunk = SearchChunk;
3128
3188
  type assistant_SkillSummary = SkillSummary;
3129
3189
  declare const assistant_buildFactsContextTool: typeof buildFactsContextTool;
3130
3190
  declare const assistant_buildRetrievalChunkTool: typeof buildRetrievalChunkTool;
@@ -3140,9 +3200,10 @@ declare const assistant_parseSlashTokenInProgress: typeof parseSlashTokenInProgr
3140
3200
  declare const assistant_queryAssistant: typeof queryAssistant;
3141
3201
  declare const assistant_respondToAgent: typeof respondToAgent;
3142
3202
  declare const assistant_retrieve: typeof retrieve;
3203
+ declare const assistant_searchChunks: typeof searchChunks;
3143
3204
  declare const assistant_uploadSkill: typeof uploadSkill;
3144
3205
  declare namespace assistant {
3145
- export { type assistant_AssistantQueryOptions as AssistantQueryOptions, type assistant_Chunk as Chunk, type assistant_ChunkMetadata as ChunkMetadata, type assistant_CommandDescriptor as CommandDescriptor, type assistant_ParsedSlashCommand as ParsedSlashCommand, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, type assistant_SkillSummary as SkillSummary, assistant_buildFactsContextTool as buildFactsContextTool, assistant_buildRetrievalChunkTool as buildRetrievalChunkTool, assistant_buildRetrievalFullContextTool as buildRetrievalFullContextTool, assistant_buildRetrievalTocTool as buildRetrievalTocTool, assistant_cancelAssistantRun as cancelAssistantRun, assistant_filterSkills as filterSkills, assistant_isSharedSkill as isSharedSkill, assistant_listCommands as listCommands, assistant_listSkills as listSkills, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_respondToAgent as respondToAgent, assistant_retrieve as retrieve, assistant_uploadSkill as uploadSkill };
3206
+ export { type assistant_AssistantQueryOptions as AssistantQueryOptions, type assistant_Chunk as Chunk, type assistant_ChunkMetadata as ChunkMetadata, type assistant_CommandDescriptor as CommandDescriptor, assistant_MAX_RETRIEVE_DOC_IDS as MAX_RETRIEVE_DOC_IDS, type assistant_ParsedSlashCommand as ParsedSlashCommand, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, type assistant_SearchChunk as SearchChunk, type assistant_SkillSummary as SkillSummary, assistant_buildFactsContextTool as buildFactsContextTool, assistant_buildRetrievalChunkTool as buildRetrievalChunkTool, assistant_buildRetrievalFullContextTool as buildRetrievalFullContextTool, assistant_buildRetrievalTocTool as buildRetrievalTocTool, assistant_cancelAssistantRun as cancelAssistantRun, assistant_filterSkills as filterSkills, assistant_isSharedSkill as isSharedSkill, assistant_listCommands as listCommands, assistant_listSkills as listSkills, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_respondToAgent as respondToAgent, assistant_retrieve as retrieve, assistant_searchChunks as searchChunks, assistant_uploadSkill as uploadSkill };
3146
3207
  }
3147
3208
 
3148
3209
  /**
@@ -3881,6 +3942,286 @@ declare namespace settings {
3881
3942
  export { type settings_RelevanceList as RelevanceList, type settings_WorkspaceNotificationLevel as WorkspaceNotificationLevel, type settings_WorkspaceRelevanceLists as WorkspaceRelevanceLists, settings_getSettings as getSettings, settings_setListMembership as setListMembership, settings_setWorkspaceNotificationLevel as setWorkspaceNotificationLevel, settings_updateSettings as updateSettings, settings_withMembership as withMembership, settings_workspaceLevelPatch as workspaceLevelPatch, settings_workspaceNotificationLevel as workspaceNotificationLevel };
3882
3943
  }
3883
3944
 
3945
+ /**
3946
+ * Connectors (`/v1/connectors`, `/v1/slack`): the catalog, the user's connections and their
3947
+ * OAuth, mailbox and drive sync into a workspace, and the session token bridge.
3948
+ *
3949
+ * A connector's OAuth tokens are stored sealed to the user's key; a live session can use them only
3950
+ * after the client re-seals them to the session key (`bridgeConnectorTokens`, see `Arbi`). Mailbox
3951
+ * sync pulls mail into a workspace per (vendor, workspace); drive sync is one target per vendor.
3952
+ */
3953
+
3954
+ type ConnectorVendorKey = components['schemas']['VendorKey'];
3955
+ type ConnectorCatalogEntry = components['schemas']['ConnectorCatalogRead'];
3956
+ type UserConnectorEntry = components['schemas']['UserConnectorRead'];
3957
+ type ConnectorSyncStatus = components['schemas']['ConnectorSyncStatus'];
3958
+ /** A mailbox folder (Outlook) or label (Gmail), or a drive folder; `selectable: false` is a grouping row (a SharePoint site). */
3959
+ type ConnectorFolder = components['schemas']['FolderRead'];
3960
+ type ConnectorSyncProgress = components['schemas']['SyncProgressResponse'];
3961
+ type DriveSyncProgress = components['schemas']['DriveSyncProgressResponse'];
3962
+ type DriveSyncSummary = components['schemas']['DriveSyncSummary'];
3963
+ type SyncTriggerResult = components['schemas']['SyncTriggerResponse'];
3964
+ type SealedConnectorToken = components['schemas']['SealedConnectorToken'];
3965
+ type SessionTokenBridgeBody = components['schemas']['SessionTokenBridge'];
3966
+ type EnableMailboxSyncBody = components['schemas']['EnableSyncRequest'];
3967
+ type EnableDriveSyncBody = components['schemas']['EnableDriveSyncRequest'];
3968
+ interface SlackConnectionStatus {
3969
+ connected: boolean;
3970
+ configured: boolean;
3971
+ agent_ext_id: string | null;
3972
+ agent_name: string | null;
3973
+ }
3974
+ /** The connectors this deployment offers (public). */
3975
+ declare function listCatalog(arbi: ArbiClient): Promise<{
3976
+ id: string;
3977
+ vendor_key: components["schemas"]["VendorKey"];
3978
+ display_name: string;
3979
+ description: string;
3980
+ icon_url: string | null;
3981
+ mcp_server_alias: string;
3982
+ requires_per_user_auth: boolean;
3983
+ }[]>;
3984
+ /** The signed-in user's connections, with their sync settings. */
3985
+ declare function listMine(arbi: ArbiClient): Promise<{
3986
+ id: string;
3987
+ vendor_key: components["schemas"]["VendorKey"];
3988
+ display_name: string;
3989
+ icon_url: string | null;
3990
+ connected_at: string;
3991
+ vendor_user_identity: string | null;
3992
+ is_connected: boolean;
3993
+ token_scheme: string;
3994
+ syncs: {
3995
+ workspace_ext_id: string;
3996
+ status: string;
3997
+ enabled: boolean;
3998
+ last_sync_at?: string | null | undefined;
3999
+ backfill_window?: number | null | undefined;
4000
+ backfill_since?: string | null | undefined;
4001
+ folders: string[];
4002
+ skip_duplicates: boolean;
4003
+ auto_rename: boolean;
4004
+ shared: boolean;
4005
+ auto_sync: boolean;
4006
+ synced_count: number;
4007
+ }[];
4008
+ sync_status?: string | null | undefined;
4009
+ last_sync_at?: string | null | undefined;
4010
+ backfill_window?: number | null | undefined;
4011
+ backfill_since?: string | null | undefined;
4012
+ sync_workspace_ext_id?: string | null | undefined;
4013
+ sync_folders?: string[] | null | undefined;
4014
+ skip_duplicates?: boolean | null | undefined;
4015
+ auto_rename?: boolean | null | undefined;
4016
+ shared?: boolean | null | undefined;
4017
+ auto_sync?: boolean | null | undefined;
4018
+ drive_sync_status?: string | null | undefined;
4019
+ drive_last_sync_at?: string | null | undefined;
4020
+ drive_sync_workspace_ext_id?: string | null | undefined;
4021
+ drive_sync_folders?: string[] | null | undefined;
4022
+ drive_skip_duplicates?: boolean | null | undefined;
4023
+ drive_auto_rename?: boolean | null | undefined;
4024
+ drive_shared?: boolean | null | undefined;
4025
+ drive_auto_sync?: boolean | null | undefined;
4026
+ drive_needs_reconsent?: boolean | null | undefined;
4027
+ }[]>;
4028
+ declare function disconnect(arbi: ArbiClient, vendor: string): Promise<void>;
4029
+ /** The provider consent URL that connects `vendor` and comes back to `returnTo` (a path). */
4030
+ declare function authorize(arbi: ArbiClient, vendor: string, returnTo?: string): Promise<string>;
4031
+ /** The user's connector tokens, sealed to the user's key. */
4032
+ declare function getSealedTokens(arbi: ArbiClient): Promise<{
4033
+ vendor_key: string;
4034
+ access_token: string;
4035
+ refresh_token?: string | null | undefined;
4036
+ }[]>;
4037
+ /** Deposit tokens re-sealed to the session key on this session. */
4038
+ declare function depositSessionTokens(arbi: ArbiClient, body: SessionTokenBridgeBody): Promise<void>;
4039
+ declare function listMailboxFolders(arbi: ArbiClient, vendor: string): Promise<{
4040
+ id: string;
4041
+ name: string;
4042
+ count?: number | null | undefined;
4043
+ selectable: boolean;
4044
+ }[]>;
4045
+ declare function enableMailboxSync(arbi: ArbiClient, vendor: string, body: EnableMailboxSyncBody): Promise<{
4046
+ id: string;
4047
+ vendor_key: string;
4048
+ target_workspace_id: number;
4049
+ backfill_window: number;
4050
+ backfill_since?: string | null | undefined;
4051
+ backfill_state: string;
4052
+ enabled: boolean;
4053
+ status: string;
4054
+ folders: string[];
4055
+ skip_duplicates: boolean;
4056
+ auto_rename: boolean;
4057
+ shared: boolean;
4058
+ auto_sync: boolean;
4059
+ last_sync_at?: string | null | undefined;
4060
+ }>;
4061
+ /** Sync now; `workspaceExtId` picks which of the vendor's syncs runs. */
4062
+ declare function triggerMailboxSync(arbi: ArbiClient, vendor: string, workspaceExtId?: string | null): Promise<{
4063
+ status: string;
4064
+ estimated_count?: number | null | undefined;
4065
+ }>;
4066
+ declare function mailboxSyncProgress(arbi: ArbiClient, vendor: string, workspaceExtId: string): Promise<{
4067
+ running: boolean;
4068
+ phase?: string | null | undefined;
4069
+ processed: number;
4070
+ total?: number | null | undefined;
4071
+ }>;
4072
+ declare function cancelMailboxSync(arbi: ArbiClient, vendor: string, workspaceExtId: string): Promise<void>;
4073
+ declare function listDriveFolders(arbi: ArbiClient, vendor: string): Promise<{
4074
+ id: string;
4075
+ name: string;
4076
+ count?: number | null | undefined;
4077
+ selectable: boolean;
4078
+ }[]>;
4079
+ /** The subfolders of one drive folder (`root` or an item id), fetched as the user drills in. */
4080
+ declare function listDriveFolderChildren(arbi: ArbiClient, vendor: string, itemId: string): Promise<{
4081
+ id: string;
4082
+ name: string;
4083
+ count?: number | null | undefined;
4084
+ selectable: boolean;
4085
+ }[]>;
4086
+ /** How many importable documents are under a drive folder (recursively). */
4087
+ declare function driveFolderDocCount(arbi: ArbiClient, vendor: string, itemId: string): Promise<number>;
4088
+ declare function enableDriveSync(arbi: ArbiClient, vendor: string, body: EnableDriveSyncBody): Promise<void>;
4089
+ declare function triggerDriveSync(arbi: ArbiClient, vendor: string): Promise<{
4090
+ status: string;
4091
+ estimated_count?: number | null | undefined;
4092
+ }>;
4093
+ /** How many documents the next drive Sync now would import (`null` when unknown). */
4094
+ declare function driveSyncEstimate(arbi: ArbiClient, vendor: string): Promise<{
4095
+ estimated_count?: number | null | undefined;
4096
+ }>;
4097
+ declare function driveSyncProgress(arbi: ArbiClient, vendor: string): Promise<{
4098
+ running: boolean;
4099
+ phase?: string | null | undefined;
4100
+ processed: number;
4101
+ total?: number | null | undefined;
4102
+ summary?: {
4103
+ finished_at: string;
4104
+ ingested: number;
4105
+ attempted: number;
4106
+ skipped: {
4107
+ name: string;
4108
+ reason: string;
4109
+ }[];
4110
+ } | null | undefined;
4111
+ }>;
4112
+ declare function cancelDriveSync(arbi: ArbiClient, vendor: string): Promise<void>;
4113
+ declare function slackStatus(arbi: ArbiClient): Promise<SlackConnectionStatus>;
4114
+ /** The Slack consent URL that connects Slack to the agent `agentExtId`. */
4115
+ declare function authorizeSlack(arbi: ArbiClient, agentExtId: string): Promise<string>;
4116
+ declare function disconnectSlack(arbi: ArbiClient): Promise<void>;
4117
+ /** Vendors whose mail syncs into a workspace. */
4118
+ declare const MAILBOX_SYNC_VENDORS: readonly ["microsoft", "gmail"];
4119
+ /**
4120
+ * Vendors whose documents sync into a workspace. "Drive" is loose: Clio's containers are matters,
4121
+ * OneNote's are notebook sections, Dropbox addresses by path; all share one sync contract.
4122
+ */
4123
+ declare const DRIVE_SYNC_VENDORS: readonly ["microsoft", "gmail", "microsoft_sharepoint", "clio", "box", "dropbox", "onenote"];
4124
+ /** The vendor groups behind the per-provider visibility switches (user settings). */
4125
+ declare const MICROSOFT_VENDORS: readonly ["microsoft", "ms365_mail"];
4126
+ declare const GOOGLE_VENDORS: readonly ["gmail", "gdrive"];
4127
+ declare const IMANAGE_VENDORS: readonly ["imanage"];
4128
+ declare const SHAREPOINT_VENDORS: readonly ["microsoft_sharepoint"];
4129
+ declare const isMailboxSyncVendor: (vendor: string) => boolean;
4130
+ declare const isDriveSyncVendor: (vendor: string) => boolean;
4131
+ /** SharePoint has no card of its own: it lives under the Microsoft family. */
4132
+ declare const isSharePointVendor: (vendor: string) => boolean;
4133
+ /** The per-provider visibility switches of the user settings. */
4134
+ interface ConnectorVisibilitySettings {
4135
+ show_connector_microsoft?: boolean | null;
4136
+ show_connector_google?: boolean | null;
4137
+ show_connector_imanage?: boolean | null;
4138
+ show_connector_sharepoint?: boolean | null;
4139
+ }
4140
+ /**
4141
+ * Whether a vendor shows under the user's per-provider switches: Microsoft and Google on by
4142
+ * default, iManage and SharePoint off; vendors outside those groups always show.
4143
+ */
4144
+ declare function isConnectorVendorVisible(settings: ConnectorVisibilitySettings | null | undefined, vendor: string): boolean;
4145
+ /**
4146
+ * The message for a cancelled or refused OAuth return (`?connect_error={vendor}`). The vendor comes
4147
+ * from the URL, so an unknown one reads "the account" and is never echoed back.
4148
+ */
4149
+ declare function connectErrorMessage(vendor: string | undefined | null): string;
4150
+ /** What the bridge needs: the user's identity key and the server session's key. */
4151
+ interface ConnectorBridgeKeys {
4152
+ signingPrivateKey: Uint8Array;
4153
+ serverSessionKey: Uint8Array;
4154
+ }
4155
+ interface BridgeTokensOptions {
4156
+ /** Only this vendor (e.g. right after connecting it). */
4157
+ vendor?: string;
4158
+ /**
4159
+ * Also start the due auto-syncs into this workspace. Only where the user is looking at the
4160
+ * workspace; the settings dialogs and the manual-sync pre-bridge leave it out.
4161
+ */
4162
+ autoSyncWorkspaceExtId?: string;
4163
+ }
4164
+ /**
4165
+ * Let this server session use the user's connector grants: unseal each token with the user's key,
4166
+ * reseal it to the session key and deposit it. One vendor failing does not stop the others.
4167
+ */
4168
+ declare function bridgeConnectorTokens(arbi: ArbiClient, keys: ConnectorBridgeKeys, { vendor, autoSyncWorkspaceExtId }?: BridgeTokensOptions): Promise<void>;
4169
+
4170
+ type connectors_BridgeTokensOptions = BridgeTokensOptions;
4171
+ type connectors_ConnectorBridgeKeys = ConnectorBridgeKeys;
4172
+ type connectors_ConnectorCatalogEntry = ConnectorCatalogEntry;
4173
+ type connectors_ConnectorFolder = ConnectorFolder;
4174
+ type connectors_ConnectorSyncProgress = ConnectorSyncProgress;
4175
+ type connectors_ConnectorSyncStatus = ConnectorSyncStatus;
4176
+ type connectors_ConnectorVendorKey = ConnectorVendorKey;
4177
+ type connectors_ConnectorVisibilitySettings = ConnectorVisibilitySettings;
4178
+ declare const connectors_DRIVE_SYNC_VENDORS: typeof DRIVE_SYNC_VENDORS;
4179
+ type connectors_DriveSyncProgress = DriveSyncProgress;
4180
+ type connectors_DriveSyncSummary = DriveSyncSummary;
4181
+ type connectors_EnableDriveSyncBody = EnableDriveSyncBody;
4182
+ type connectors_EnableMailboxSyncBody = EnableMailboxSyncBody;
4183
+ declare const connectors_GOOGLE_VENDORS: typeof GOOGLE_VENDORS;
4184
+ declare const connectors_IMANAGE_VENDORS: typeof IMANAGE_VENDORS;
4185
+ declare const connectors_MAILBOX_SYNC_VENDORS: typeof MAILBOX_SYNC_VENDORS;
4186
+ declare const connectors_MICROSOFT_VENDORS: typeof MICROSOFT_VENDORS;
4187
+ declare const connectors_SHAREPOINT_VENDORS: typeof SHAREPOINT_VENDORS;
4188
+ type connectors_SealedConnectorToken = SealedConnectorToken;
4189
+ type connectors_SessionTokenBridgeBody = SessionTokenBridgeBody;
4190
+ type connectors_SlackConnectionStatus = SlackConnectionStatus;
4191
+ type connectors_SyncTriggerResult = SyncTriggerResult;
4192
+ type connectors_UserConnectorEntry = UserConnectorEntry;
4193
+ declare const connectors_authorize: typeof authorize;
4194
+ declare const connectors_authorizeSlack: typeof authorizeSlack;
4195
+ declare const connectors_bridgeConnectorTokens: typeof bridgeConnectorTokens;
4196
+ declare const connectors_cancelDriveSync: typeof cancelDriveSync;
4197
+ declare const connectors_cancelMailboxSync: typeof cancelMailboxSync;
4198
+ declare const connectors_connectErrorMessage: typeof connectErrorMessage;
4199
+ declare const connectors_depositSessionTokens: typeof depositSessionTokens;
4200
+ declare const connectors_disconnect: typeof disconnect;
4201
+ declare const connectors_disconnectSlack: typeof disconnectSlack;
4202
+ declare const connectors_driveFolderDocCount: typeof driveFolderDocCount;
4203
+ declare const connectors_driveSyncEstimate: typeof driveSyncEstimate;
4204
+ declare const connectors_driveSyncProgress: typeof driveSyncProgress;
4205
+ declare const connectors_enableDriveSync: typeof enableDriveSync;
4206
+ declare const connectors_enableMailboxSync: typeof enableMailboxSync;
4207
+ declare const connectors_getSealedTokens: typeof getSealedTokens;
4208
+ declare const connectors_isConnectorVendorVisible: typeof isConnectorVendorVisible;
4209
+ declare const connectors_isDriveSyncVendor: typeof isDriveSyncVendor;
4210
+ declare const connectors_isMailboxSyncVendor: typeof isMailboxSyncVendor;
4211
+ declare const connectors_isSharePointVendor: typeof isSharePointVendor;
4212
+ declare const connectors_listCatalog: typeof listCatalog;
4213
+ declare const connectors_listDriveFolderChildren: typeof listDriveFolderChildren;
4214
+ declare const connectors_listDriveFolders: typeof listDriveFolders;
4215
+ declare const connectors_listMailboxFolders: typeof listMailboxFolders;
4216
+ declare const connectors_listMine: typeof listMine;
4217
+ declare const connectors_mailboxSyncProgress: typeof mailboxSyncProgress;
4218
+ declare const connectors_slackStatus: typeof slackStatus;
4219
+ declare const connectors_triggerDriveSync: typeof triggerDriveSync;
4220
+ declare const connectors_triggerMailboxSync: typeof triggerMailboxSync;
4221
+ declare namespace connectors {
4222
+ export { type connectors_BridgeTokensOptions as BridgeTokensOptions, type connectors_ConnectorBridgeKeys as ConnectorBridgeKeys, type connectors_ConnectorCatalogEntry as ConnectorCatalogEntry, type connectors_ConnectorFolder as ConnectorFolder, type connectors_ConnectorSyncProgress as ConnectorSyncProgress, type connectors_ConnectorSyncStatus as ConnectorSyncStatus, type connectors_ConnectorVendorKey as ConnectorVendorKey, type connectors_ConnectorVisibilitySettings as ConnectorVisibilitySettings, connectors_DRIVE_SYNC_VENDORS as DRIVE_SYNC_VENDORS, type connectors_DriveSyncProgress as DriveSyncProgress, type connectors_DriveSyncSummary as DriveSyncSummary, type connectors_EnableDriveSyncBody as EnableDriveSyncBody, type connectors_EnableMailboxSyncBody as EnableMailboxSyncBody, connectors_GOOGLE_VENDORS as GOOGLE_VENDORS, connectors_IMANAGE_VENDORS as IMANAGE_VENDORS, connectors_MAILBOX_SYNC_VENDORS as MAILBOX_SYNC_VENDORS, connectors_MICROSOFT_VENDORS as MICROSOFT_VENDORS, connectors_SHAREPOINT_VENDORS as SHAREPOINT_VENDORS, type connectors_SealedConnectorToken as SealedConnectorToken, type connectors_SessionTokenBridgeBody as SessionTokenBridgeBody, type connectors_SlackConnectionStatus as SlackConnectionStatus, type connectors_SyncTriggerResult as SyncTriggerResult, type connectors_UserConnectorEntry as UserConnectorEntry, connectors_authorize as authorize, connectors_authorizeSlack as authorizeSlack, connectors_bridgeConnectorTokens as bridgeConnectorTokens, connectors_cancelDriveSync as cancelDriveSync, connectors_cancelMailboxSync as cancelMailboxSync, connectors_connectErrorMessage as connectErrorMessage, connectors_depositSessionTokens as depositSessionTokens, connectors_disconnect as disconnect, connectors_disconnectSlack as disconnectSlack, connectors_driveFolderDocCount as driveFolderDocCount, connectors_driveSyncEstimate as driveSyncEstimate, connectors_driveSyncProgress as driveSyncProgress, connectors_enableDriveSync as enableDriveSync, connectors_enableMailboxSync as enableMailboxSync, connectors_getSealedTokens as getSealedTokens, connectors_isConnectorVendorVisible as isConnectorVendorVisible, connectors_isDriveSyncVendor as isDriveSyncVendor, connectors_isMailboxSyncVendor as isMailboxSyncVendor, connectors_isSharePointVendor as isSharePointVendor, connectors_listCatalog as listCatalog, connectors_listDriveFolderChildren as listDriveFolderChildren, connectors_listDriveFolders as listDriveFolders, connectors_listMailboxFolders as listMailboxFolders, connectors_listMine as listMine, connectors_mailboxSyncProgress as mailboxSyncProgress, connectors_slackStatus as slackStatus, connectors_triggerDriveSync as triggerDriveSync, connectors_triggerMailboxSync as triggerMailboxSync };
4223
+ }
4224
+
3884
4225
  /**
3885
4226
  * File operations — OpenAI-compatible Files API (list, get, delete, upload, content).
3886
4227
  */
@@ -4385,6 +4726,8 @@ type ProjectEventKind = ProjectEventResponse['kind'];
4385
4726
  type ProjectConversationUsageResponse = components['schemas']['ProjectConversationUsageResponse'];
4386
4727
  /** The project details a host sets on create and update (budget, client, stage, lead, fields). */
4387
4728
  type ProjectDetails = Pick<ProjectUpdateRequest, 'budget' | 'client' | 'client_ref' | 'stage' | 'lead_user' | 'fields' | 'field_schema'>;
4729
+ /** What a new project starts with besides its name and plan (details, a per-collaborator cap). */
4730
+ type ProjectCreateOptions = Omit<components['schemas']['ProjectCreateRequest'], 'name' | 'plan'>;
4388
4731
  /** The caller's projects; only those at `stage` and/or led by `leadUser` (`usr-…`) when given. */
4389
4732
  declare function listProjects(arbi: ArbiClient, filters?: {
4390
4733
  stage?: string;
@@ -4512,7 +4855,7 @@ declare function listProjects(arbi: ArbiClient, filters?: {
4512
4855
  * is created pending and only becomes usable after Stripe checkout (done in the web app).
4513
4856
  * `details` sets its budget, client, stage, lead and fields from the start.
4514
4857
  */
4515
- declare function createProject(arbi: ArbiClient, name: string, plan?: 'free' | 'pro', details?: ProjectDetails): Promise<{
4858
+ declare function createProject(arbi: ArbiClient, name: string, plan?: 'free' | 'pro', details?: ProjectCreateOptions): Promise<{
4516
4859
  external_id: string;
4517
4860
  name: string;
4518
4861
  created_by: string;
@@ -5017,318 +5360,1057 @@ declare function getProjectInvoices(arbi: ArbiClient, projectExtId: string): Pro
5017
5360
  * `daily_cap_per_user` to render a "£ used today" indicator.
5018
5361
  */
5019
5362
  declare function getUserUsageToday(arbi: ArbiClient): Promise<UserDailyUsageResponse>;
5020
-
5021
- type projects_ProjectBudget = ProjectBudget;
5022
- type projects_ProjectConversationUsageResponse = ProjectConversationUsageResponse;
5023
- type projects_ProjectDetails = ProjectDetails;
5024
- type projects_ProjectEventKind = ProjectEventKind;
5025
- type projects_ProjectEventResponse = ProjectEventResponse;
5026
- type projects_ProjectInvoicesResponse = ProjectInvoicesResponse;
5027
- type projects_ProjectResponse = ProjectResponse;
5028
- type projects_ProjectUpdateRequest = ProjectUpdateRequest;
5029
- type projects_ProjectUsageResponse = ProjectUsageResponse;
5030
- type projects_UserDailyUsageResponse = UserDailyUsageResponse;
5031
- declare const projects_createProject: typeof createProject;
5032
- declare const projects_deleteProject: typeof deleteProject;
5033
- declare const projects_formatBudget: typeof formatBudget;
5034
- declare const projects_getProjectConversationUsage: typeof getProjectConversationUsage;
5035
- declare const projects_getProjectInvoices: typeof getProjectInvoices;
5036
- declare const projects_getProjectUsage: typeof getProjectUsage;
5037
- declare const projects_getUserUsageToday: typeof getUserUsageToday;
5038
- declare const projects_listProjectEvents: typeof listProjectEvents;
5039
- declare const projects_listProjects: typeof listProjects;
5040
- declare const projects_parseBudget: typeof parseBudget;
5041
- declare const projects_refreshProject: typeof refreshProject;
5042
- declare const projects_renameProject: typeof renameProject;
5043
- declare const projects_updateProject: typeof updateProject;
5044
- declare namespace projects {
5045
- export { type projects_ProjectBudget as ProjectBudget, type projects_ProjectConversationUsageResponse as ProjectConversationUsageResponse, type projects_ProjectDetails as ProjectDetails, type projects_ProjectEventKind as ProjectEventKind, type projects_ProjectEventResponse as ProjectEventResponse, type projects_ProjectInvoicesResponse as ProjectInvoicesResponse, type projects_ProjectResponse as ProjectResponse, type projects_ProjectUpdateRequest as ProjectUpdateRequest, type projects_ProjectUsageResponse as ProjectUsageResponse, type projects_UserDailyUsageResponse as UserDailyUsageResponse, projects_createProject as createProject, projects_deleteProject as deleteProject, projects_formatBudget as formatBudget, projects_getProjectConversationUsage as getProjectConversationUsage, projects_getProjectInvoices as getProjectInvoices, projects_getProjectUsage as getProjectUsage, projects_getUserUsageToday as getUserUsageToday, projects_listProjectEvents as listProjectEvents, projects_listProjects as listProjects, projects_parseBudget as parseBudget, projects_refreshProject as refreshProject, projects_renameProject as renameProject, projects_updateProject as updateProject };
5046
- }
5047
-
5048
- /**
5049
- * Stepped workflows: a run is a work conversation whose plan has named steps (`TaskPlan.steps`).
5050
- * Form, upload and review steps wait for a person (`work.actOnStep`); an agent step is a turn the
5051
- * assistant takes in the thread. Where a run is lives in the conversation's activity log: each
5052
- * step's `step_started` / `step_done` / `step_skipped` / `step_failed` event, the latest winning. A
5053
- * `step_sent_back` reopens the step it names and every step after it (pending again); `step_ready`
5054
- * records that a ready person step's assignee was told; `step_signal` is a signal a done step raised,
5055
- * and `linked_run` the thread a linked workflow started on it. An agent step whose `step_waiting`
5056
- * (then `step_progress`, as the set shrinks) carries `waiting.documents` waits for those documents
5057
- * to finish processing before its turn starts.
5058
- *
5059
- * Pure functions over the API's own types (`TaskPlanStep`, `ActivityResponse`), for any client: the
5060
- * CLI's `arbi run steps`, scripts and agents. They mirror the server (`src/core/workflow_steps.py`).
5061
- *
5062
- * NOTE: `@arbidocs/blocks` has the same model over its UI step type (`agents/workflows/run.ts`:
5063
- * `stepDependencies`, `stepStatesFromActivity`, `stepPhase`, `validateWorkflowGraph`). Blocks is
5064
- * deliberately SDK-free (it depends on `@arbidocs/client` only), so it cannot import this module;
5065
- * the few lines both need are duplicated. Change them together.
5066
- */
5067
-
5068
- type TaskPlanStep = components['schemas']['TaskPlanStep'];
5069
- type StepKind = TaskPlanStep['kind'];
5070
- /** A signal a step raises when it is done and its condition holds. */
5071
- type StepSignal = components['schemas']['StepSignal'];
5072
- type StepSignalWhen = components['schemas']['StepSignalWhen'];
5073
- /** Who a step is for: one of `user`, `run_owner`, `input` or `project_lead`. */
5074
- type StepAssignee = components['schemas']['StepAssignee'];
5075
- /** What the activity log says about a step: nothing yet (`pending`), or its latest event. */
5076
- type StepStatus = 'pending' | 'running' | 'done' | 'skipped' | 'failed';
5363
+ type ProductResponse = components['schemas']['ProductResponse'];
5364
+ type ProjectQuoteRequest = components['schemas']['ProjectQuoteRequest'];
5365
+ type ProjectCheckoutRequest = components['schemas']['ProjectCheckoutRequest'];
5366
+ type ProjectPlanChangeRequest = components['schemas']['ProjectPlanChangeRequest'];
5367
+ type ProjectNextPeriodAddonsRequest = components['schemas']['ProjectNextPeriodAddonsRequest'];
5368
+ type ProjectAddonSettingsRequest = components['schemas']['ProjectAddonSettingsRequest'];
5369
+ type TaxQuoteResponse = components['schemas']['TaxQuoteResponse'];
5370
+ /** A purchasable add-on block. */
5371
+ type ProjectAddonKind = 'ai_usage' | 'storage';
5372
+ /** The plans and add-ons on sale, with their prices. */
5373
+ declare function listProducts(arbi: ArbiClient): Promise<{
5374
+ product_id: string;
5375
+ name: string;
5376
+ description?: string | null | undefined;
5377
+ prices: {
5378
+ price_id: string;
5379
+ amount?: number | null | undefined;
5380
+ amount_ex_vat?: number | null | undefined;
5381
+ currency: string;
5382
+ interval: string;
5383
+ interval_count: number;
5384
+ default_price: boolean;
5385
+ pack_prices: {
5386
+ packs: number;
5387
+ amount: number;
5388
+ amount_ex_vat: number;
5389
+ }[];
5390
+ addon_prices: {
5391
+ kind: "ai_usage" | "storage";
5392
+ ai_gbp: number;
5393
+ storage_gb: number;
5394
+ amount_ex_vat: number;
5395
+ amount: number;
5396
+ monthly_ex_vat: number;
5397
+ monthly: number;
5398
+ }[];
5399
+ }[];
5400
+ }[]>;
5077
5401
  /**
5078
- * Where a step stands in a run: `pending` while something it waits for is unfinished, `ready`
5079
- * once everything it waits for is done or skipped, then its own status.
5080
- */
5081
- /** `waiting`: an action step started and now waits for people (signers to sign, a draft to be sent). */
5082
- type StepPhase = 'pending' | 'ready' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed';
5083
- interface StepState {
5084
- status: StepStatus;
5085
- /** The step's answer in the thread (an agent step: a message id), or what a branch delivered. */
5086
- responseId: string | null;
5087
- error: string | null;
5088
- /** Reopened by a send-back to this very step, and not touched since. */
5089
- sentBack: boolean;
5090
- /** The send-back came with a note (encrypted in the log; an agent step runs again with it). */
5091
- hasNote: boolean;
5092
- /** Who was told the step is ready (`usr-` / `agt-`), since it last changed. */
5093
- announcedTo: string | null;
5094
- /**
5095
- * The documents (ids) an agent step waits on to finish processing before its turn starts, as
5096
- * its latest `step_waiting` / `step_progress` says; empty once it starts (or never waited).
5097
- */
5098
- waitingDocuments: string[];
5099
- /**
5100
- * What a started action step waits for (`sign`, `email_draft`), as its latest `step_waiting` says,
5101
- * and the document it is about (a signature request's document); null when it waits on nothing.
5102
- */
5103
- waitingAction: string | null;
5104
- waitingDocument: string | null;
5105
- }
5106
- /** One entry of a conversation's activity log, as far as steps are concerned. */
5107
- interface StepActivityEvent {
5108
- kind: string;
5109
- detail?: Record<string, unknown> | null;
5110
- actor_ext_id?: string | null;
5111
- created_at?: string;
5112
- }
5113
- declare const STEP_KINDS: readonly StepKind[];
5114
- /** What an `action` step does with a platform feature (`src/core/workflow_actions.py`). */
5115
- declare const STEP_ACTION_TYPES: readonly ["sign", "email_draft", "tabular_review"];
5116
- declare const PERSON_STEP_KINDS: readonly StepKind[];
5117
- /** The server's step id rule. */
5118
- declare const STEP_ID_PATTERN: RegExp;
5119
- declare const isPersonStep: (step: Pick<TaskPlanStep, "kind">) => boolean;
5120
- /** What a step waits for: its `after`, else the step before it in the list (a sequence). */
5121
- declare function stepDependencies(steps: Pick<TaskPlanStep, 'id' | 'after'>[], id: string): string[];
5122
- /** "Waiting for 3 documents to finish processing" (one: "1 document"). */
5123
- declare function waitingForDocumentsText(count: number): string;
5402
+ * The tax-inclusive total of a Pro purchase for a billing address (Stripe Tax; nothing is
5403
+ * created): for a new project when `projectExtId` is null, else for that (Free) project. A 422
5404
+ * `TAX_LOCATION_INVALID` asks for a ZIP / postcode.
5405
+ */
5406
+ declare function quotePlan(arbi: ArbiClient, projectExtId: string | null, body: ProjectQuoteRequest): Promise<{
5407
+ subtotal_pence: number;
5408
+ tax_pence: number;
5409
+ total_pence: number;
5410
+ tax_label?: string | null | undefined;
5411
+ reverse_charge: boolean;
5412
+ country?: string | null | undefined;
5413
+ taxability_reason?: string | null | undefined;
5414
+ lines: {
5415
+ reference: string;
5416
+ subtotal_pence: number;
5417
+ tax_pence: number;
5418
+ }[];
5419
+ }>;
5420
+ /** Start an embedded Stripe checkout for a project; returns its `client_secret`. */
5421
+ declare function createCheckout(arbi: ArbiClient, projectExtId: string, body: ProjectCheckoutRequest): Promise<{
5422
+ client_secret: string;
5423
+ }>;
5124
5424
  /**
5125
- * Each step's state from the activity log (oldest first): its latest step event wins. A send-back
5126
- * reopens the steps it lists as pending (only the one it went `to` is `sentBack`); a `step_ready`
5127
- * records who was told, and a `step_waiting` / `step_progress` the documents an agent step waits
5128
- * on, until the step's next change.
5425
+ * Switch a Pro project between monthly and annual billing at the end of the period (the current
5426
+ * interval clears a pending switch, and resumes a project set to cancel). Returns the project.
5129
5427
  */
5130
- declare function stepStatesFromActivity(events: StepActivityEvent[]): Record<string, StepState>;
5131
- /** A signal a done step raised (`step_signal`). */
5132
- interface RaisedSignal {
5133
- step: string;
5134
- signal: string;
5135
- at: string | null;
5136
- }
5137
- /** A thread a linked workflow started on a signal raised in this run (`linked_run`). */
5138
- interface LinkedRun {
5139
- step: string | null;
5140
- signal: string | null;
5141
- /** The new thread (`con-…`). */
5142
- conversationId: string;
5143
- /** The workflow that started it (`wfl-…`). */
5144
- workflowId: string | null;
5145
- at: string | null;
5146
- }
5147
- /** A person sent the work back from `step` to `to` (`step_sent_back`). */
5148
- interface SendBack {
5149
- step: string;
5150
- to: string;
5151
- /** `to` and every step after it: pending again. */
5152
- reopened: string[];
5153
- hasNote: boolean;
5154
- by: string | null;
5155
- at: string | null;
5156
- }
5157
- /** The signals the run's steps raised, oldest first. */
5158
- declare function raisedSignals(events: StepActivityEvent[]): RaisedSignal[];
5159
- /** The threads linked workflows started from this run's signals, oldest first. */
5160
- declare function linkedRuns(events: StepActivityEvent[]): LinkedRun[];
5161
- /** Every send-back in the run, oldest first. */
5162
- declare function sendBacks(events: StepActivityEvent[]): SendBack[];
5163
- /** Where one step stands: its own status once it has one, else `ready` or `pending`. */
5164
- declare function stepPhase(steps: Pick<TaskPlanStep, 'id' | 'after'>[], states: Record<string, StepState>, id: string): StepPhase;
5165
- interface RunStep {
5166
- id: string;
5167
- title: string;
5168
- kind: StepKind;
5169
- phase: StepPhase;
5170
- /** What it waits for (its `after`, or the step before it). */
5171
- after: string[];
5172
- /** A done agent step's answer: the assistant message id in the thread. */
5173
- responseId: string | null;
5174
- error: string | null;
5175
- /** Who the step is for (from the plan), or null: the run's owner hears of it. */
5176
- assignee: StepAssignee | null;
5177
- /** Who was told it is ready, since it last changed (`usr-` / `agt-`). */
5178
- announcedTo: string | null;
5179
- /** Reopened by a send-back to it and not touched since (`hasNote`: with a note). */
5180
- sentBack: boolean;
5181
- hasNote: boolean;
5182
- /** How many times work was sent back to this step. */
5183
- timesSentBack: number;
5184
- /** The signals this step raised (each name once, first raised first). */
5185
- signals: string[];
5186
- /** The threads linked workflows started on this step's signals. */
5187
- linkedRuns: LinkedRun[];
5188
- /** The documents (ids) it waits on to finish processing before its turn starts. */
5189
- waitingDocuments: string[];
5190
- /** A started action step waiting for people: what for (`sign`, `email_draft`), and its document. */
5191
- waitingAction: string | null;
5192
- waitingDocument: string | null;
5193
- }
5194
- /** A run's steps with where each stands, in plan order. */
5195
- declare function runSteps(steps: TaskPlanStep[], events: StepActivityEvent[]): RunStep[];
5196
- /** Who a step is for, in words: `run owner`, `project lead`, `input:<field>` or the user id. */
5197
- declare function describeAssignee(assignee: StepAssignee | null | undefined): string;
5198
- /** The step a server-sent message starts (its `tools.workflow_step` marker), or null. */
5199
- declare function messageWorkflowStep(message: {
5200
- tools?: Record<string, unknown> | null;
5201
- }): string | null;
5202
- /**
5203
- * What a run waits for now:
5204
- * - `agent`: a step is running, or an agent step is ready (the server starts it next);
5205
- * - `person`: a form, upload or review is ready for someone to complete or skip;
5206
- * - `finished`: every step is done or skipped;
5207
- * - `stuck`: nothing can move (a failed step that others wait for): skip it to go on.
5208
- */
5209
- type RunWaitingOn = 'agent' | 'person' | 'finished' | 'stuck';
5210
- declare function runWaitingOn(run: RunStep[]): RunWaitingOn;
5211
- /**
5212
- * A field a step asks for: a step's `fields` (what completing it is checked against, e.g. a rating
5213
- * at a review), or a form's `ui.fields` (what the app's form renders).
5214
- */
5215
- interface StepField {
5428
+ declare function changePlan(arbi: ArbiClient, projectExtId: string, body: ProjectPlanChangeRequest): Promise<{
5429
+ external_id: string;
5216
5430
  name: string;
5217
- type: string;
5218
- label?: string | null;
5219
- required?: boolean;
5220
- options?: StepFieldOption[] | null;
5221
- min?: number | null;
5222
- max?: number | null;
5223
- [key: string]: unknown;
5224
- }
5225
- /**
5226
- * The tones a choice can be shown in (the blocks' `Tone`): e.g. a risk rating's low `success`,
5227
- * medium `warning`, high `danger`. Display only: the server passes it through.
5228
- */
5229
- declare const STEP_FIELD_OPTION_TONES: readonly ["neutral", "info", "success", "warning", "danger", "accent", "ai"];
5230
- type StepFieldOptionTone = (typeof STEP_FIELD_OPTION_TONES)[number];
5231
- /** One choice of a `select` field. */
5232
- interface StepFieldOption {
5233
- value: string;
5234
- label?: string | null;
5235
- /** How the choice is coloured where it is picked, chosen or not. */
5236
- tone?: StepFieldOptionTone | null;
5237
- [key: string]: unknown;
5238
- }
5239
- /** The types a step's `fields` can have (the server's `StepField.type`). */
5240
- declare const STEP_FIELD_TYPES: readonly ["text", "longtext", "boolean", "select", "number", "date", "scope", "documents", "person"];
5241
- /**
5242
- * The fields a step asks for: its `fields` when it declares them (any person step), else a form
5243
- * step's `ui.fields`; none for an agent step.
5244
- */
5245
- declare function stepFields(step: Pick<TaskPlanStep, 'kind' | 'ui' | 'fields'>): StepField[];
5246
- /** The required fields of a step still blank in `inputs` (the run's plus the new ones). */
5247
- declare function missingRequiredFields(step: Pick<TaskPlanStep, 'kind' | 'ui' | 'fields'>, inputs: Record<string, unknown>): string[];
5248
- /**
5249
- * What the server would say about completing a step with `inputs` (`{name: problem}`, empty when
5250
- * they fit), for a step that declares `fields`: `required`, `number`, `min`, `max`, `option`,
5251
- * `type`, or `unknown` (a name the step does not ask for). A step without `fields` takes any inputs.
5252
- */
5253
- declare function checkStepInputs(step: Pick<TaskPlanStep, 'fields'>, inputs: Record<string, unknown> | null | undefined): Record<string, string>;
5254
- /** A `checkStepInputs` result as one line: `rating: must be one of low, high; note: required`. */
5255
- declare function describeInputProblems(step: Pick<TaskPlanStep, 'fields'>, problems: Record<string, string>): string;
5256
- /**
5257
- * `name=value` pairs (as typed on a command line) to inputs. A value is text unless the step's
5258
- * field says otherwise: `number` fields become numbers, `boolean` fields `true` / `false`.
5259
- */
5260
- declare function parseInputPairs(pairs: string[], fields?: Pick<StepField, 'name' | 'type'>[]): Record<string, unknown>;
5261
- /** The server's signal name rule. */
5262
- declare const SIGNAL_NAME_PATTERN: RegExp;
5263
- /** A list of what is wrong with a steps definition, each naming where (`steps[1].kind`). */
5264
- declare class PlanStepsError extends Error {
5265
- readonly problems: string[];
5266
- constructor(problems: string[]);
5267
- }
5268
- /**
5269
- * Check a steps definition and return it as the API's `TaskPlanStep[]`. Accepts a list of steps,
5270
- * or an object with `steps` (e.g. a whole plan). Throws `PlanStepsError` listing every problem:
5271
- * shape, ids, kinds, an agent step without a prompt or skill, and the graph (a duplicate id, an
5272
- * `after` naming no step, a cycle, a step listed before one it waits for).
5273
- */
5274
- declare function parsePlanSteps(value: unknown): TaskPlanStep[];
5275
- /** A plan holding only steps (what `createWork` and workflows take as `plan`). */
5276
- declare function stepsPlan(steps: TaskPlanStep[]): components['schemas']['TaskPlan'];
5277
-
5278
- type workflowSteps_LinkedRun = LinkedRun;
5279
- declare const workflowSteps_PERSON_STEP_KINDS: typeof PERSON_STEP_KINDS;
5280
- type workflowSteps_PlanStepsError = PlanStepsError;
5281
- declare const workflowSteps_PlanStepsError: typeof PlanStepsError;
5282
- type workflowSteps_RaisedSignal = RaisedSignal;
5283
- type workflowSteps_RunStep = RunStep;
5284
- type workflowSteps_RunWaitingOn = RunWaitingOn;
5285
- declare const workflowSteps_SIGNAL_NAME_PATTERN: typeof SIGNAL_NAME_PATTERN;
5286
- declare const workflowSteps_STEP_ACTION_TYPES: typeof STEP_ACTION_TYPES;
5287
- declare const workflowSteps_STEP_FIELD_OPTION_TONES: typeof STEP_FIELD_OPTION_TONES;
5288
- declare const workflowSteps_STEP_FIELD_TYPES: typeof STEP_FIELD_TYPES;
5289
- declare const workflowSteps_STEP_ID_PATTERN: typeof STEP_ID_PATTERN;
5290
- declare const workflowSteps_STEP_KINDS: typeof STEP_KINDS;
5291
- type workflowSteps_SendBack = SendBack;
5292
- type workflowSteps_StepActivityEvent = StepActivityEvent;
5293
- type workflowSteps_StepAssignee = StepAssignee;
5294
- type workflowSteps_StepField = StepField;
5295
- type workflowSteps_StepFieldOption = StepFieldOption;
5296
- type workflowSteps_StepFieldOptionTone = StepFieldOptionTone;
5297
- type workflowSteps_StepKind = StepKind;
5298
- type workflowSteps_StepPhase = StepPhase;
5299
- type workflowSteps_StepSignal = StepSignal;
5300
- type workflowSteps_StepSignalWhen = StepSignalWhen;
5301
- type workflowSteps_StepState = StepState;
5302
- type workflowSteps_StepStatus = StepStatus;
5303
- type workflowSteps_TaskPlanStep = TaskPlanStep;
5304
- declare const workflowSteps_checkStepInputs: typeof checkStepInputs;
5305
- declare const workflowSteps_describeAssignee: typeof describeAssignee;
5306
- declare const workflowSteps_describeInputProblems: typeof describeInputProblems;
5307
- declare const workflowSteps_isPersonStep: typeof isPersonStep;
5308
- declare const workflowSteps_linkedRuns: typeof linkedRuns;
5309
- declare const workflowSteps_messageWorkflowStep: typeof messageWorkflowStep;
5310
- declare const workflowSteps_missingRequiredFields: typeof missingRequiredFields;
5311
- declare const workflowSteps_parseInputPairs: typeof parseInputPairs;
5312
- declare const workflowSteps_parsePlanSteps: typeof parsePlanSteps;
5313
- declare const workflowSteps_raisedSignals: typeof raisedSignals;
5314
- declare const workflowSteps_runSteps: typeof runSteps;
5315
- declare const workflowSteps_runWaitingOn: typeof runWaitingOn;
5316
- declare const workflowSteps_sendBacks: typeof sendBacks;
5317
- declare const workflowSteps_stepDependencies: typeof stepDependencies;
5318
- declare const workflowSteps_stepFields: typeof stepFields;
5319
- declare const workflowSteps_stepPhase: typeof stepPhase;
5320
- declare const workflowSteps_stepStatesFromActivity: typeof stepStatesFromActivity;
5321
- declare const workflowSteps_stepsPlan: typeof stepsPlan;
5322
- declare const workflowSteps_waitingForDocumentsText: typeof waitingForDocumentsText;
5323
- declare namespace workflowSteps {
5324
- export { type workflowSteps_LinkedRun as LinkedRun, workflowSteps_PERSON_STEP_KINDS as PERSON_STEP_KINDS, workflowSteps_PlanStepsError as PlanStepsError, type workflowSteps_RaisedSignal as RaisedSignal, type workflowSteps_RunStep as RunStep, type workflowSteps_RunWaitingOn as RunWaitingOn, workflowSteps_SIGNAL_NAME_PATTERN as SIGNAL_NAME_PATTERN, workflowSteps_STEP_ACTION_TYPES as STEP_ACTION_TYPES, workflowSteps_STEP_FIELD_OPTION_TONES as STEP_FIELD_OPTION_TONES, workflowSteps_STEP_FIELD_TYPES as STEP_FIELD_TYPES, workflowSteps_STEP_ID_PATTERN as STEP_ID_PATTERN, workflowSteps_STEP_KINDS as STEP_KINDS, type workflowSteps_SendBack as SendBack, type workflowSteps_StepActivityEvent as StepActivityEvent, type workflowSteps_StepAssignee as StepAssignee, type workflowSteps_StepField as StepField, type workflowSteps_StepFieldOption as StepFieldOption, type workflowSteps_StepFieldOptionTone as StepFieldOptionTone, type workflowSteps_StepKind as StepKind, type workflowSteps_StepPhase as StepPhase, type workflowSteps_StepSignal as StepSignal, type workflowSteps_StepSignalWhen as StepSignalWhen, type workflowSteps_StepState as StepState, type workflowSteps_StepStatus as StepStatus, type workflowSteps_TaskPlanStep as TaskPlanStep, workflowSteps_checkStepInputs as checkStepInputs, workflowSteps_describeAssignee as describeAssignee, workflowSteps_describeInputProblems as describeInputProblems, workflowSteps_isPersonStep as isPersonStep, workflowSteps_linkedRuns as linkedRuns, workflowSteps_messageWorkflowStep as messageWorkflowStep, workflowSteps_missingRequiredFields as missingRequiredFields, workflowSteps_parseInputPairs as parseInputPairs, workflowSteps_parsePlanSteps as parsePlanSteps, workflowSteps_raisedSignals as raisedSignals, workflowSteps_runSteps as runSteps, workflowSteps_runWaitingOn as runWaitingOn, workflowSteps_sendBacks as sendBacks, workflowSteps_stepDependencies as stepDependencies, workflowSteps_stepFields as stepFields, workflowSteps_stepPhase as stepPhase, workflowSteps_stepStatesFromActivity as stepStatesFromActivity, workflowSteps_stepsPlan as stepsPlan, workflowSteps_waitingForDocumentsText as waitingForDocumentsText };
5325
- }
5326
-
5431
+ created_by: string;
5432
+ subscription: string;
5433
+ created_at: string;
5434
+ quotas: {
5435
+ storage_gb: {
5436
+ used: number;
5437
+ limit: number;
5438
+ };
5439
+ ai_usage: {
5440
+ used: number;
5441
+ limit: number;
5442
+ };
5443
+ collaborators: {
5444
+ used: number;
5445
+ limit: number;
5446
+ };
5447
+ budget_reset_at?: number | null | undefined;
5448
+ };
5449
+ daily_cap_per_user?: number | null | undefined;
5450
+ budget?: {
5451
+ amount: number;
5452
+ currency: string;
5453
+ } | null | undefined;
5454
+ client?: string | null | undefined;
5455
+ client_ref?: string | null | undefined;
5456
+ stage?: string | null | undefined;
5457
+ stage_changed_at?: string | null | undefined;
5458
+ lead_user?: string | null | undefined;
5459
+ fields?: {
5460
+ [x: string]: unknown;
5461
+ } | undefined;
5462
+ field_schema?: {
5463
+ key: string;
5464
+ label?: string | null | undefined;
5465
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
5466
+ options?: string[] | null | undefined;
5467
+ }[] | null | undefined;
5468
+ plan_interval?: ("month" | "year") | null | undefined;
5469
+ packs: number;
5470
+ plan_change?: {
5471
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
5472
+ charged_pence: number;
5473
+ charged_ex_vat_pence: number;
5474
+ confirm_url?: string | null | undefined;
5475
+ } | null | undefined;
5476
+ addons?: {
5477
+ packs: number;
5478
+ packs_next?: number | null | undefined;
5479
+ plan_name: string;
5480
+ plan_ai_gbp: number;
5481
+ plan_storage_gb: number;
5482
+ block_ai_gbp: number;
5483
+ block_storage_gb: number;
5484
+ ai_blocks: number;
5485
+ storage_blocks: number;
5486
+ legacy_ai_blocks: number;
5487
+ legacy_storage_blocks: number;
5488
+ legacy_block_ai_gbp: number;
5489
+ legacy_block_storage_gb: number;
5490
+ blocks_ai_gbp: number;
5491
+ blocks_storage_gb: number;
5492
+ ai_blocks_next?: number | null | undefined;
5493
+ storage_blocks_next?: number | null | undefined;
5494
+ storage_blocks_min: number;
5495
+ auto_topup_threshold_gbp: number;
5496
+ min_auto_topup_threshold_gbp: number;
5497
+ spend_cap_pence?: number | null | undefined;
5498
+ addon_spend_pence: number;
5499
+ auto_spent_pence: number;
5500
+ addon_spend_window_end?: number | null | undefined;
5501
+ manual_spent_pence: number;
5502
+ cap_left_pence?: number | null | undefined;
5503
+ ai_used_gbp: number;
5504
+ ai_allowance_gbp: number;
5505
+ ai_allowance_next_gbp: number;
5506
+ storage_used_gb: number;
5507
+ storage_allowance_gb: number;
5508
+ storage_allowance_next_gb: number;
5509
+ ai_block_monthly_pence: number;
5510
+ ai_block_monthly_ex_vat_pence: number;
5511
+ storage_block_monthly_pence: number;
5512
+ storage_block_monthly_ex_vat_pence: number;
5513
+ ai_block_period_pence: number;
5514
+ ai_block_period_ex_vat_pence: number;
5515
+ storage_block_period_pence: number;
5516
+ storage_block_period_ex_vat_pence: number;
5517
+ ai_block_price_pence: number;
5518
+ ai_block_price_ex_vat_pence: number;
5519
+ storage_block_price_pence: number;
5520
+ storage_block_price_ex_vat_pence: number;
5521
+ cap_reached: boolean;
5522
+ period_end?: number | null | undefined;
5523
+ ai_usage_reset_at?: number | null | undefined;
5524
+ pending_interval?: ("month" | "year") | null | undefined;
5525
+ billing_error?: string | null | undefined;
5526
+ confirm_url?: string | null | undefined;
5527
+ payment?: {
5528
+ status: "pending" | "paid";
5529
+ kind?: ("ai_usage" | "storage") | null | undefined;
5530
+ amount_pence?: number | null | undefined;
5531
+ amount_ex_vat_pence?: number | null | undefined;
5532
+ tax_pence?: number | null | undefined;
5533
+ at?: number | null | undefined;
5534
+ confirm_url?: string | null | undefined;
5535
+ } | null | undefined;
5536
+ } | null | undefined;
5537
+ price_id?: string | null | undefined;
5538
+ plan?: string | null | undefined;
5539
+ amount?: number | null | undefined;
5540
+ amount_ex_vat?: number | null | undefined;
5541
+ currency?: string | null | undefined;
5542
+ current_period_end?: number | null | undefined;
5543
+ cancel_at_period_end?: boolean | null | undefined;
5544
+ portal_url?: string | null | undefined;
5545
+ }>;
5546
+ /** What a plan change would charge now and at the first renewal; nothing changes. */
5547
+ declare function previewPlanChange(arbi: ArbiClient, projectExtId: string, body: ProjectPlanChangeRequest): Promise<{
5548
+ packs: number;
5549
+ plan_name: string;
5550
+ interval: "month" | "year";
5551
+ effective_now: boolean;
5552
+ unchanged: boolean;
5553
+ awaiting_confirmation: boolean;
5554
+ due_now_pence: number;
5555
+ due_now_ex_vat_pence: number;
5556
+ due_now_tax_pence: number;
5557
+ next_renewal_pence: number;
5558
+ next_renewal_ex_vat_pence: number;
5559
+ next_renewal_tax_pence: number;
5560
+ tax_label?: string | null | undefined;
5561
+ next_renewal_at?: number | null | undefined;
5562
+ }>;
5563
+ /** What one more add-on block costs now and at renewal, taxed for the saved address. */
5564
+ declare function quoteAddon(arbi: ArbiClient, projectExtId: string, kind: ProjectAddonKind): Promise<{
5565
+ kind: "ai_usage" | "storage";
5566
+ now: {
5567
+ subtotal_pence: number;
5568
+ tax_pence: number;
5569
+ total_pence: number;
5570
+ tax_label?: string | null | undefined;
5571
+ reverse_charge: boolean;
5572
+ country?: string | null | undefined;
5573
+ taxability_reason?: string | null | undefined;
5574
+ lines: {
5575
+ reference: string;
5576
+ subtotal_pence: number;
5577
+ tax_pence: number;
5578
+ }[];
5579
+ };
5580
+ renewal: {
5581
+ subtotal_pence: number;
5582
+ tax_pence: number;
5583
+ total_pence: number;
5584
+ tax_label?: string | null | undefined;
5585
+ reverse_charge: boolean;
5586
+ country?: string | null | undefined;
5587
+ taxability_reason?: string | null | undefined;
5588
+ lines: {
5589
+ reference: string;
5590
+ subtotal_pence: number;
5591
+ tax_pence: number;
5592
+ }[];
5593
+ };
5594
+ }>;
5595
+ /** A fresh, short-lived Stripe customer-portal link (card, address, receipts). */
5596
+ declare function billingPortal(arbi: ArbiClient, projectExtId: string): Promise<{
5597
+ url: string;
5598
+ }>;
5327
5599
  /**
5328
- * Work: a conversation with a `status` is a task. Create one, run it, mark it done, or plan it. Backend: `/v1/conversation/...` (docs/design/work-model.md).
5600
+ * Buy one add-on block, charged now and renewed every period until reduced. `requires_action`
5601
+ * comes with a `confirm_url` when the bank wants 3-D Secure; 402 `{code, message}` is a refusal.
5329
5602
  */
5330
-
5331
- type ConversationResponse = components['schemas']['ConversationResponse'];
5603
+ declare function addAddonBlock(arbi: ArbiClient, projectExtId: string, kind: ProjectAddonKind): Promise<{
5604
+ status: "paid" | "requires_action";
5605
+ confirm_url?: string | null | undefined;
5606
+ project: {
5607
+ external_id: string;
5608
+ name: string;
5609
+ created_by: string;
5610
+ subscription: string;
5611
+ created_at: string;
5612
+ quotas: {
5613
+ storage_gb: {
5614
+ used: number;
5615
+ limit: number;
5616
+ };
5617
+ ai_usage: {
5618
+ used: number;
5619
+ limit: number;
5620
+ };
5621
+ collaborators: {
5622
+ used: number;
5623
+ limit: number;
5624
+ };
5625
+ budget_reset_at?: number | null | undefined;
5626
+ };
5627
+ daily_cap_per_user?: number | null | undefined;
5628
+ budget?: {
5629
+ amount: number;
5630
+ currency: string;
5631
+ } | null | undefined;
5632
+ client?: string | null | undefined;
5633
+ client_ref?: string | null | undefined;
5634
+ stage?: string | null | undefined;
5635
+ stage_changed_at?: string | null | undefined;
5636
+ lead_user?: string | null | undefined;
5637
+ fields?: {
5638
+ [x: string]: unknown;
5639
+ } | undefined;
5640
+ field_schema?: {
5641
+ key: string;
5642
+ label?: string | null | undefined;
5643
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
5644
+ options?: string[] | null | undefined;
5645
+ }[] | null | undefined;
5646
+ plan_interval?: ("month" | "year") | null | undefined;
5647
+ packs: number;
5648
+ plan_change?: {
5649
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
5650
+ charged_pence: number;
5651
+ charged_ex_vat_pence: number;
5652
+ confirm_url?: string | null | undefined;
5653
+ } | null | undefined;
5654
+ addons?: {
5655
+ packs: number;
5656
+ packs_next?: number | null | undefined;
5657
+ plan_name: string;
5658
+ plan_ai_gbp: number;
5659
+ plan_storage_gb: number;
5660
+ block_ai_gbp: number;
5661
+ block_storage_gb: number;
5662
+ ai_blocks: number;
5663
+ storage_blocks: number;
5664
+ legacy_ai_blocks: number;
5665
+ legacy_storage_blocks: number;
5666
+ legacy_block_ai_gbp: number;
5667
+ legacy_block_storage_gb: number;
5668
+ blocks_ai_gbp: number;
5669
+ blocks_storage_gb: number;
5670
+ ai_blocks_next?: number | null | undefined;
5671
+ storage_blocks_next?: number | null | undefined;
5672
+ storage_blocks_min: number;
5673
+ auto_topup_threshold_gbp: number;
5674
+ min_auto_topup_threshold_gbp: number;
5675
+ spend_cap_pence?: number | null | undefined;
5676
+ addon_spend_pence: number;
5677
+ auto_spent_pence: number;
5678
+ addon_spend_window_end?: number | null | undefined;
5679
+ manual_spent_pence: number;
5680
+ cap_left_pence?: number | null | undefined;
5681
+ ai_used_gbp: number;
5682
+ ai_allowance_gbp: number;
5683
+ ai_allowance_next_gbp: number;
5684
+ storage_used_gb: number;
5685
+ storage_allowance_gb: number;
5686
+ storage_allowance_next_gb: number;
5687
+ ai_block_monthly_pence: number;
5688
+ ai_block_monthly_ex_vat_pence: number;
5689
+ storage_block_monthly_pence: number;
5690
+ storage_block_monthly_ex_vat_pence: number;
5691
+ ai_block_period_pence: number;
5692
+ ai_block_period_ex_vat_pence: number;
5693
+ storage_block_period_pence: number;
5694
+ storage_block_period_ex_vat_pence: number;
5695
+ ai_block_price_pence: number;
5696
+ ai_block_price_ex_vat_pence: number;
5697
+ storage_block_price_pence: number;
5698
+ storage_block_price_ex_vat_pence: number;
5699
+ cap_reached: boolean;
5700
+ period_end?: number | null | undefined;
5701
+ ai_usage_reset_at?: number | null | undefined;
5702
+ pending_interval?: ("month" | "year") | null | undefined;
5703
+ billing_error?: string | null | undefined;
5704
+ confirm_url?: string | null | undefined;
5705
+ payment?: {
5706
+ status: "pending" | "paid";
5707
+ kind?: ("ai_usage" | "storage") | null | undefined;
5708
+ amount_pence?: number | null | undefined;
5709
+ amount_ex_vat_pence?: number | null | undefined;
5710
+ tax_pence?: number | null | undefined;
5711
+ at?: number | null | undefined;
5712
+ confirm_url?: string | null | undefined;
5713
+ } | null | undefined;
5714
+ } | null | undefined;
5715
+ price_id?: string | null | undefined;
5716
+ plan?: string | null | undefined;
5717
+ amount?: number | null | undefined;
5718
+ amount_ex_vat?: number | null | undefined;
5719
+ currency?: string | null | undefined;
5720
+ current_period_end?: number | null | undefined;
5721
+ cancel_at_period_end?: boolean | null | undefined;
5722
+ portal_url?: string | null | undefined;
5723
+ };
5724
+ }>;
5725
+ /** How many add-on blocks to keep from the next period (reductions only; no refunds). */
5726
+ declare function setNextPeriodAddons(arbi: ArbiClient, projectExtId: string, body: ProjectNextPeriodAddonsRequest): Promise<{
5727
+ external_id: string;
5728
+ name: string;
5729
+ created_by: string;
5730
+ subscription: string;
5731
+ created_at: string;
5732
+ quotas: {
5733
+ storage_gb: {
5734
+ used: number;
5735
+ limit: number;
5736
+ };
5737
+ ai_usage: {
5738
+ used: number;
5739
+ limit: number;
5740
+ };
5741
+ collaborators: {
5742
+ used: number;
5743
+ limit: number;
5744
+ };
5745
+ budget_reset_at?: number | null | undefined;
5746
+ };
5747
+ daily_cap_per_user?: number | null | undefined;
5748
+ budget?: {
5749
+ amount: number;
5750
+ currency: string;
5751
+ } | null | undefined;
5752
+ client?: string | null | undefined;
5753
+ client_ref?: string | null | undefined;
5754
+ stage?: string | null | undefined;
5755
+ stage_changed_at?: string | null | undefined;
5756
+ lead_user?: string | null | undefined;
5757
+ fields?: {
5758
+ [x: string]: unknown;
5759
+ } | undefined;
5760
+ field_schema?: {
5761
+ key: string;
5762
+ label?: string | null | undefined;
5763
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
5764
+ options?: string[] | null | undefined;
5765
+ }[] | null | undefined;
5766
+ plan_interval?: ("month" | "year") | null | undefined;
5767
+ packs: number;
5768
+ plan_change?: {
5769
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
5770
+ charged_pence: number;
5771
+ charged_ex_vat_pence: number;
5772
+ confirm_url?: string | null | undefined;
5773
+ } | null | undefined;
5774
+ addons?: {
5775
+ packs: number;
5776
+ packs_next?: number | null | undefined;
5777
+ plan_name: string;
5778
+ plan_ai_gbp: number;
5779
+ plan_storage_gb: number;
5780
+ block_ai_gbp: number;
5781
+ block_storage_gb: number;
5782
+ ai_blocks: number;
5783
+ storage_blocks: number;
5784
+ legacy_ai_blocks: number;
5785
+ legacy_storage_blocks: number;
5786
+ legacy_block_ai_gbp: number;
5787
+ legacy_block_storage_gb: number;
5788
+ blocks_ai_gbp: number;
5789
+ blocks_storage_gb: number;
5790
+ ai_blocks_next?: number | null | undefined;
5791
+ storage_blocks_next?: number | null | undefined;
5792
+ storage_blocks_min: number;
5793
+ auto_topup_threshold_gbp: number;
5794
+ min_auto_topup_threshold_gbp: number;
5795
+ spend_cap_pence?: number | null | undefined;
5796
+ addon_spend_pence: number;
5797
+ auto_spent_pence: number;
5798
+ addon_spend_window_end?: number | null | undefined;
5799
+ manual_spent_pence: number;
5800
+ cap_left_pence?: number | null | undefined;
5801
+ ai_used_gbp: number;
5802
+ ai_allowance_gbp: number;
5803
+ ai_allowance_next_gbp: number;
5804
+ storage_used_gb: number;
5805
+ storage_allowance_gb: number;
5806
+ storage_allowance_next_gb: number;
5807
+ ai_block_monthly_pence: number;
5808
+ ai_block_monthly_ex_vat_pence: number;
5809
+ storage_block_monthly_pence: number;
5810
+ storage_block_monthly_ex_vat_pence: number;
5811
+ ai_block_period_pence: number;
5812
+ ai_block_period_ex_vat_pence: number;
5813
+ storage_block_period_pence: number;
5814
+ storage_block_period_ex_vat_pence: number;
5815
+ ai_block_price_pence: number;
5816
+ ai_block_price_ex_vat_pence: number;
5817
+ storage_block_price_pence: number;
5818
+ storage_block_price_ex_vat_pence: number;
5819
+ cap_reached: boolean;
5820
+ period_end?: number | null | undefined;
5821
+ ai_usage_reset_at?: number | null | undefined;
5822
+ pending_interval?: ("month" | "year") | null | undefined;
5823
+ billing_error?: string | null | undefined;
5824
+ confirm_url?: string | null | undefined;
5825
+ payment?: {
5826
+ status: "pending" | "paid";
5827
+ kind?: ("ai_usage" | "storage") | null | undefined;
5828
+ amount_pence?: number | null | undefined;
5829
+ amount_ex_vat_pence?: number | null | undefined;
5830
+ tax_pence?: number | null | undefined;
5831
+ at?: number | null | undefined;
5832
+ confirm_url?: string | null | undefined;
5833
+ } | null | undefined;
5834
+ } | null | undefined;
5835
+ price_id?: string | null | undefined;
5836
+ plan?: string | null | undefined;
5837
+ amount?: number | null | undefined;
5838
+ amount_ex_vat?: number | null | undefined;
5839
+ currency?: string | null | undefined;
5840
+ current_period_end?: number | null | undefined;
5841
+ cancel_at_period_end?: boolean | null | undefined;
5842
+ portal_url?: string | null | undefined;
5843
+ }>;
5844
+ /** A Pro project's add-on settings: the auto top-up threshold and the monthly usage cap. */
5845
+ declare function updateAddonSettings(arbi: ArbiClient, projectExtId: string, body: ProjectAddonSettingsRequest): Promise<{
5846
+ external_id: string;
5847
+ name: string;
5848
+ created_by: string;
5849
+ subscription: string;
5850
+ created_at: string;
5851
+ quotas: {
5852
+ storage_gb: {
5853
+ used: number;
5854
+ limit: number;
5855
+ };
5856
+ ai_usage: {
5857
+ used: number;
5858
+ limit: number;
5859
+ };
5860
+ collaborators: {
5861
+ used: number;
5862
+ limit: number;
5863
+ };
5864
+ budget_reset_at?: number | null | undefined;
5865
+ };
5866
+ daily_cap_per_user?: number | null | undefined;
5867
+ budget?: {
5868
+ amount: number;
5869
+ currency: string;
5870
+ } | null | undefined;
5871
+ client?: string | null | undefined;
5872
+ client_ref?: string | null | undefined;
5873
+ stage?: string | null | undefined;
5874
+ stage_changed_at?: string | null | undefined;
5875
+ lead_user?: string | null | undefined;
5876
+ fields?: {
5877
+ [x: string]: unknown;
5878
+ } | undefined;
5879
+ field_schema?: {
5880
+ key: string;
5881
+ label?: string | null | undefined;
5882
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
5883
+ options?: string[] | null | undefined;
5884
+ }[] | null | undefined;
5885
+ plan_interval?: ("month" | "year") | null | undefined;
5886
+ packs: number;
5887
+ plan_change?: {
5888
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
5889
+ charged_pence: number;
5890
+ charged_ex_vat_pence: number;
5891
+ confirm_url?: string | null | undefined;
5892
+ } | null | undefined;
5893
+ addons?: {
5894
+ packs: number;
5895
+ packs_next?: number | null | undefined;
5896
+ plan_name: string;
5897
+ plan_ai_gbp: number;
5898
+ plan_storage_gb: number;
5899
+ block_ai_gbp: number;
5900
+ block_storage_gb: number;
5901
+ ai_blocks: number;
5902
+ storage_blocks: number;
5903
+ legacy_ai_blocks: number;
5904
+ legacy_storage_blocks: number;
5905
+ legacy_block_ai_gbp: number;
5906
+ legacy_block_storage_gb: number;
5907
+ blocks_ai_gbp: number;
5908
+ blocks_storage_gb: number;
5909
+ ai_blocks_next?: number | null | undefined;
5910
+ storage_blocks_next?: number | null | undefined;
5911
+ storage_blocks_min: number;
5912
+ auto_topup_threshold_gbp: number;
5913
+ min_auto_topup_threshold_gbp: number;
5914
+ spend_cap_pence?: number | null | undefined;
5915
+ addon_spend_pence: number;
5916
+ auto_spent_pence: number;
5917
+ addon_spend_window_end?: number | null | undefined;
5918
+ manual_spent_pence: number;
5919
+ cap_left_pence?: number | null | undefined;
5920
+ ai_used_gbp: number;
5921
+ ai_allowance_gbp: number;
5922
+ ai_allowance_next_gbp: number;
5923
+ storage_used_gb: number;
5924
+ storage_allowance_gb: number;
5925
+ storage_allowance_next_gb: number;
5926
+ ai_block_monthly_pence: number;
5927
+ ai_block_monthly_ex_vat_pence: number;
5928
+ storage_block_monthly_pence: number;
5929
+ storage_block_monthly_ex_vat_pence: number;
5930
+ ai_block_period_pence: number;
5931
+ ai_block_period_ex_vat_pence: number;
5932
+ storage_block_period_pence: number;
5933
+ storage_block_period_ex_vat_pence: number;
5934
+ ai_block_price_pence: number;
5935
+ ai_block_price_ex_vat_pence: number;
5936
+ storage_block_price_pence: number;
5937
+ storage_block_price_ex_vat_pence: number;
5938
+ cap_reached: boolean;
5939
+ period_end?: number | null | undefined;
5940
+ ai_usage_reset_at?: number | null | undefined;
5941
+ pending_interval?: ("month" | "year") | null | undefined;
5942
+ billing_error?: string | null | undefined;
5943
+ confirm_url?: string | null | undefined;
5944
+ payment?: {
5945
+ status: "pending" | "paid";
5946
+ kind?: ("ai_usage" | "storage") | null | undefined;
5947
+ amount_pence?: number | null | undefined;
5948
+ amount_ex_vat_pence?: number | null | undefined;
5949
+ tax_pence?: number | null | undefined;
5950
+ at?: number | null | undefined;
5951
+ confirm_url?: string | null | undefined;
5952
+ } | null | undefined;
5953
+ } | null | undefined;
5954
+ price_id?: string | null | undefined;
5955
+ plan?: string | null | undefined;
5956
+ amount?: number | null | undefined;
5957
+ amount_ex_vat?: number | null | undefined;
5958
+ currency?: string | null | undefined;
5959
+ current_period_end?: number | null | undefined;
5960
+ cancel_at_period_end?: boolean | null | undefined;
5961
+ portal_url?: string | null | undefined;
5962
+ }>;
5963
+ /** Move a Pro project to Free at the end of the period (no refunds). */
5964
+ declare function cancelSubscription(arbi: ArbiClient, projectExtId: string): Promise<{
5965
+ external_id: string;
5966
+ name: string;
5967
+ created_by: string;
5968
+ subscription: string;
5969
+ created_at: string;
5970
+ quotas: {
5971
+ storage_gb: {
5972
+ used: number;
5973
+ limit: number;
5974
+ };
5975
+ ai_usage: {
5976
+ used: number;
5977
+ limit: number;
5978
+ };
5979
+ collaborators: {
5980
+ used: number;
5981
+ limit: number;
5982
+ };
5983
+ budget_reset_at?: number | null | undefined;
5984
+ };
5985
+ daily_cap_per_user?: number | null | undefined;
5986
+ budget?: {
5987
+ amount: number;
5988
+ currency: string;
5989
+ } | null | undefined;
5990
+ client?: string | null | undefined;
5991
+ client_ref?: string | null | undefined;
5992
+ stage?: string | null | undefined;
5993
+ stage_changed_at?: string | null | undefined;
5994
+ lead_user?: string | null | undefined;
5995
+ fields?: {
5996
+ [x: string]: unknown;
5997
+ } | undefined;
5998
+ field_schema?: {
5999
+ key: string;
6000
+ label?: string | null | undefined;
6001
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
6002
+ options?: string[] | null | undefined;
6003
+ }[] | null | undefined;
6004
+ plan_interval?: ("month" | "year") | null | undefined;
6005
+ packs: number;
6006
+ plan_change?: {
6007
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
6008
+ charged_pence: number;
6009
+ charged_ex_vat_pence: number;
6010
+ confirm_url?: string | null | undefined;
6011
+ } | null | undefined;
6012
+ addons?: {
6013
+ packs: number;
6014
+ packs_next?: number | null | undefined;
6015
+ plan_name: string;
6016
+ plan_ai_gbp: number;
6017
+ plan_storage_gb: number;
6018
+ block_ai_gbp: number;
6019
+ block_storage_gb: number;
6020
+ ai_blocks: number;
6021
+ storage_blocks: number;
6022
+ legacy_ai_blocks: number;
6023
+ legacy_storage_blocks: number;
6024
+ legacy_block_ai_gbp: number;
6025
+ legacy_block_storage_gb: number;
6026
+ blocks_ai_gbp: number;
6027
+ blocks_storage_gb: number;
6028
+ ai_blocks_next?: number | null | undefined;
6029
+ storage_blocks_next?: number | null | undefined;
6030
+ storage_blocks_min: number;
6031
+ auto_topup_threshold_gbp: number;
6032
+ min_auto_topup_threshold_gbp: number;
6033
+ spend_cap_pence?: number | null | undefined;
6034
+ addon_spend_pence: number;
6035
+ auto_spent_pence: number;
6036
+ addon_spend_window_end?: number | null | undefined;
6037
+ manual_spent_pence: number;
6038
+ cap_left_pence?: number | null | undefined;
6039
+ ai_used_gbp: number;
6040
+ ai_allowance_gbp: number;
6041
+ ai_allowance_next_gbp: number;
6042
+ storage_used_gb: number;
6043
+ storage_allowance_gb: number;
6044
+ storage_allowance_next_gb: number;
6045
+ ai_block_monthly_pence: number;
6046
+ ai_block_monthly_ex_vat_pence: number;
6047
+ storage_block_monthly_pence: number;
6048
+ storage_block_monthly_ex_vat_pence: number;
6049
+ ai_block_period_pence: number;
6050
+ ai_block_period_ex_vat_pence: number;
6051
+ storage_block_period_pence: number;
6052
+ storage_block_period_ex_vat_pence: number;
6053
+ ai_block_price_pence: number;
6054
+ ai_block_price_ex_vat_pence: number;
6055
+ storage_block_price_pence: number;
6056
+ storage_block_price_ex_vat_pence: number;
6057
+ cap_reached: boolean;
6058
+ period_end?: number | null | undefined;
6059
+ ai_usage_reset_at?: number | null | undefined;
6060
+ pending_interval?: ("month" | "year") | null | undefined;
6061
+ billing_error?: string | null | undefined;
6062
+ confirm_url?: string | null | undefined;
6063
+ payment?: {
6064
+ status: "pending" | "paid";
6065
+ kind?: ("ai_usage" | "storage") | null | undefined;
6066
+ amount_pence?: number | null | undefined;
6067
+ amount_ex_vat_pence?: number | null | undefined;
6068
+ tax_pence?: number | null | undefined;
6069
+ at?: number | null | undefined;
6070
+ confirm_url?: string | null | undefined;
6071
+ } | null | undefined;
6072
+ } | null | undefined;
6073
+ price_id?: string | null | undefined;
6074
+ plan?: string | null | undefined;
6075
+ amount?: number | null | undefined;
6076
+ amount_ex_vat?: number | null | undefined;
6077
+ currency?: string | null | undefined;
6078
+ current_period_end?: number | null | undefined;
6079
+ cancel_at_period_end?: boolean | null | undefined;
6080
+ portal_url?: string | null | undefined;
6081
+ }>;
6082
+
6083
+ type projects_ProductResponse = ProductResponse;
6084
+ type projects_ProjectAddonKind = ProjectAddonKind;
6085
+ type projects_ProjectAddonSettingsRequest = ProjectAddonSettingsRequest;
6086
+ type projects_ProjectBudget = ProjectBudget;
6087
+ type projects_ProjectCheckoutRequest = ProjectCheckoutRequest;
6088
+ type projects_ProjectConversationUsageResponse = ProjectConversationUsageResponse;
6089
+ type projects_ProjectCreateOptions = ProjectCreateOptions;
6090
+ type projects_ProjectDetails = ProjectDetails;
6091
+ type projects_ProjectEventKind = ProjectEventKind;
6092
+ type projects_ProjectEventResponse = ProjectEventResponse;
6093
+ type projects_ProjectInvoicesResponse = ProjectInvoicesResponse;
6094
+ type projects_ProjectNextPeriodAddonsRequest = ProjectNextPeriodAddonsRequest;
6095
+ type projects_ProjectPlanChangeRequest = ProjectPlanChangeRequest;
6096
+ type projects_ProjectQuoteRequest = ProjectQuoteRequest;
6097
+ type projects_ProjectResponse = ProjectResponse;
6098
+ type projects_ProjectUpdateRequest = ProjectUpdateRequest;
6099
+ type projects_ProjectUsageResponse = ProjectUsageResponse;
6100
+ type projects_TaxQuoteResponse = TaxQuoteResponse;
6101
+ type projects_UserDailyUsageResponse = UserDailyUsageResponse;
6102
+ declare const projects_addAddonBlock: typeof addAddonBlock;
6103
+ declare const projects_billingPortal: typeof billingPortal;
6104
+ declare const projects_cancelSubscription: typeof cancelSubscription;
6105
+ declare const projects_changePlan: typeof changePlan;
6106
+ declare const projects_createCheckout: typeof createCheckout;
6107
+ declare const projects_createProject: typeof createProject;
6108
+ declare const projects_deleteProject: typeof deleteProject;
6109
+ declare const projects_formatBudget: typeof formatBudget;
6110
+ declare const projects_getProjectConversationUsage: typeof getProjectConversationUsage;
6111
+ declare const projects_getProjectInvoices: typeof getProjectInvoices;
6112
+ declare const projects_getProjectUsage: typeof getProjectUsage;
6113
+ declare const projects_getUserUsageToday: typeof getUserUsageToday;
6114
+ declare const projects_listProducts: typeof listProducts;
6115
+ declare const projects_listProjectEvents: typeof listProjectEvents;
6116
+ declare const projects_listProjects: typeof listProjects;
6117
+ declare const projects_parseBudget: typeof parseBudget;
6118
+ declare const projects_previewPlanChange: typeof previewPlanChange;
6119
+ declare const projects_quoteAddon: typeof quoteAddon;
6120
+ declare const projects_quotePlan: typeof quotePlan;
6121
+ declare const projects_refreshProject: typeof refreshProject;
6122
+ declare const projects_renameProject: typeof renameProject;
6123
+ declare const projects_setNextPeriodAddons: typeof setNextPeriodAddons;
6124
+ declare const projects_updateAddonSettings: typeof updateAddonSettings;
6125
+ declare const projects_updateProject: typeof updateProject;
6126
+ declare namespace projects {
6127
+ export { type projects_ProductResponse as ProductResponse, type projects_ProjectAddonKind as ProjectAddonKind, type projects_ProjectAddonSettingsRequest as ProjectAddonSettingsRequest, type projects_ProjectBudget as ProjectBudget, type projects_ProjectCheckoutRequest as ProjectCheckoutRequest, type projects_ProjectConversationUsageResponse as ProjectConversationUsageResponse, type projects_ProjectCreateOptions as ProjectCreateOptions, type projects_ProjectDetails as ProjectDetails, type projects_ProjectEventKind as ProjectEventKind, type projects_ProjectEventResponse as ProjectEventResponse, type projects_ProjectInvoicesResponse as ProjectInvoicesResponse, type projects_ProjectNextPeriodAddonsRequest as ProjectNextPeriodAddonsRequest, type projects_ProjectPlanChangeRequest as ProjectPlanChangeRequest, type projects_ProjectQuoteRequest as ProjectQuoteRequest, type projects_ProjectResponse as ProjectResponse, type projects_ProjectUpdateRequest as ProjectUpdateRequest, type projects_ProjectUsageResponse as ProjectUsageResponse, type projects_TaxQuoteResponse as TaxQuoteResponse, type projects_UserDailyUsageResponse as UserDailyUsageResponse, projects_addAddonBlock as addAddonBlock, projects_billingPortal as billingPortal, projects_cancelSubscription as cancelSubscription, projects_changePlan as changePlan, projects_createCheckout as createCheckout, projects_createProject as createProject, projects_deleteProject as deleteProject, projects_formatBudget as formatBudget, projects_getProjectConversationUsage as getProjectConversationUsage, projects_getProjectInvoices as getProjectInvoices, projects_getProjectUsage as getProjectUsage, projects_getUserUsageToday as getUserUsageToday, projects_listProducts as listProducts, projects_listProjectEvents as listProjectEvents, projects_listProjects as listProjects, projects_parseBudget as parseBudget, projects_previewPlanChange as previewPlanChange, projects_quoteAddon as quoteAddon, projects_quotePlan as quotePlan, projects_refreshProject as refreshProject, projects_renameProject as renameProject, projects_setNextPeriodAddons as setNextPeriodAddons, projects_updateAddonSettings as updateAddonSettings, projects_updateProject as updateProject };
6128
+ }
6129
+
6130
+ /**
6131
+ * Stepped workflows: a run is a work conversation whose plan has named steps (`TaskPlan.steps`).
6132
+ * Form, upload and review steps wait for a person (`work.actOnStep`); an agent step is a turn the
6133
+ * assistant takes in the thread. Where a run is lives in the conversation's activity log: each
6134
+ * step's `step_started` / `step_done` / `step_skipped` / `step_failed` event, the latest winning. A
6135
+ * `step_sent_back` reopens the step it names and every step after it (pending again); `step_ready`
6136
+ * records that a ready person step's assignee was told; `step_signal` is a signal a done step raised,
6137
+ * and `linked_run` the thread a linked workflow started on it. An agent step whose `step_waiting`
6138
+ * (then `step_progress`, as the set shrinks) carries `waiting.documents` waits for those documents
6139
+ * to finish processing before its turn starts.
6140
+ *
6141
+ * Pure functions over the API's own types (`TaskPlanStep`, `ActivityResponse`), for any client: the
6142
+ * CLI's `arbi run steps`, scripts and agents. They mirror the server (`src/core/workflow_steps.py`).
6143
+ *
6144
+ * NOTE: `@arbidocs/blocks` has the same model over its UI step type (`agents/workflows/run.ts`:
6145
+ * `stepDependencies`, `stepStatesFromActivity`, `stepPhase`, `validateWorkflowGraph`). Blocks is
6146
+ * deliberately SDK-free (it depends on `@arbidocs/client` only), so it cannot import this module;
6147
+ * the few lines both need are duplicated. Change them together.
6148
+ */
6149
+
6150
+ type TaskPlanStep = components['schemas']['TaskPlanStep'];
6151
+ type StepKind = TaskPlanStep['kind'];
6152
+ /** A signal a step raises when it is done and its condition holds. */
6153
+ type StepSignal = components['schemas']['StepSignal'];
6154
+ type StepSignalWhen = components['schemas']['StepSignalWhen'];
6155
+ /** Who a step is for: one of `user`, `run_owner`, `input` or `project_lead`. */
6156
+ type StepAssignee = components['schemas']['StepAssignee'];
6157
+ /** What the activity log says about a step: nothing yet (`pending`), or its latest event. */
6158
+ type StepStatus = 'pending' | 'running' | 'done' | 'skipped' | 'failed';
6159
+ /**
6160
+ * Where a step stands in a run: `pending` while something it waits for is unfinished, `ready`
6161
+ * once everything it waits for is done or skipped, then its own status.
6162
+ */
6163
+ /** `waiting`: an action step started and now waits for people (signers to sign, a draft to be sent). */
6164
+ type StepPhase = 'pending' | 'ready' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed';
6165
+ interface StepState {
6166
+ status: StepStatus;
6167
+ /** The step's answer in the thread (an agent step: a message id), or what a branch delivered. */
6168
+ responseId: string | null;
6169
+ error: string | null;
6170
+ /** Reopened by a send-back to this very step, and not touched since. */
6171
+ sentBack: boolean;
6172
+ /** The send-back came with a note (encrypted in the log; an agent step runs again with it). */
6173
+ hasNote: boolean;
6174
+ /** Who was told the step is ready (`usr-` / `agt-`), since it last changed. */
6175
+ announcedTo: string | null;
6176
+ /**
6177
+ * The documents (ids) an agent step waits on to finish processing before its turn starts, as
6178
+ * its latest `step_waiting` / `step_progress` says; empty once it starts (or never waited).
6179
+ */
6180
+ waitingDocuments: string[];
6181
+ /**
6182
+ * What a started action step waits for (`sign`, `email_draft`), as its latest `step_waiting` says,
6183
+ * and the document it is about (a signature request's document); null when it waits on nothing.
6184
+ */
6185
+ waitingAction: string | null;
6186
+ waitingDocument: string | null;
6187
+ }
6188
+ /** One entry of a conversation's activity log, as far as steps are concerned. */
6189
+ interface StepActivityEvent {
6190
+ kind: string;
6191
+ detail?: Record<string, unknown> | null;
6192
+ actor_ext_id?: string | null;
6193
+ created_at?: string;
6194
+ }
6195
+ declare const STEP_KINDS: readonly StepKind[];
6196
+ /** What an `action` step does with a platform feature (`src/core/workflow_actions.py`). */
6197
+ declare const STEP_ACTION_TYPES: readonly ["sign", "email_draft", "tabular_review"];
6198
+ declare const PERSON_STEP_KINDS: readonly StepKind[];
6199
+ /** The server's step id rule. */
6200
+ declare const STEP_ID_PATTERN: RegExp;
6201
+ declare const isPersonStep: (step: Pick<TaskPlanStep, "kind">) => boolean;
6202
+ /** What a step waits for: its `after`, else the step before it in the list (a sequence). */
6203
+ declare function stepDependencies(steps: Pick<TaskPlanStep, 'id' | 'after'>[], id: string): string[];
6204
+ /** "Waiting for 3 documents to finish processing" (one: "1 document"). */
6205
+ declare function waitingForDocumentsText(count: number): string;
6206
+ /**
6207
+ * Each step's state from the activity log (oldest first): its latest step event wins. A send-back
6208
+ * reopens the steps it lists as pending (only the one it went `to` is `sentBack`); a `step_ready`
6209
+ * records who was told, and a `step_waiting` / `step_progress` the documents an agent step waits
6210
+ * on, until the step's next change.
6211
+ */
6212
+ declare function stepStatesFromActivity(events: StepActivityEvent[]): Record<string, StepState>;
6213
+ /** A signal a done step raised (`step_signal`). */
6214
+ interface RaisedSignal {
6215
+ step: string;
6216
+ signal: string;
6217
+ at: string | null;
6218
+ }
6219
+ /** A thread a linked workflow started on a signal raised in this run (`linked_run`). */
6220
+ interface LinkedRun {
6221
+ step: string | null;
6222
+ signal: string | null;
6223
+ /** The new thread (`con-…`). */
6224
+ conversationId: string;
6225
+ /** The workflow that started it (`wfl-…`). */
6226
+ workflowId: string | null;
6227
+ at: string | null;
6228
+ }
6229
+ /** A person sent the work back from `step` to `to` (`step_sent_back`). */
6230
+ interface SendBack {
6231
+ step: string;
6232
+ to: string;
6233
+ /** `to` and every step after it: pending again. */
6234
+ reopened: string[];
6235
+ hasNote: boolean;
6236
+ by: string | null;
6237
+ at: string | null;
6238
+ }
6239
+ /** The signals the run's steps raised, oldest first. */
6240
+ declare function raisedSignals(events: StepActivityEvent[]): RaisedSignal[];
6241
+ /** The threads linked workflows started from this run's signals, oldest first. */
6242
+ declare function linkedRuns(events: StepActivityEvent[]): LinkedRun[];
6243
+ /** Every send-back in the run, oldest first. */
6244
+ declare function sendBacks(events: StepActivityEvent[]): SendBack[];
6245
+ /** Where one step stands: its own status once it has one, else `ready` or `pending`. */
6246
+ declare function stepPhase(steps: Pick<TaskPlanStep, 'id' | 'after'>[], states: Record<string, StepState>, id: string): StepPhase;
6247
+ interface RunStep {
6248
+ id: string;
6249
+ title: string;
6250
+ kind: StepKind;
6251
+ phase: StepPhase;
6252
+ /** What it waits for (its `after`, or the step before it). */
6253
+ after: string[];
6254
+ /** A done agent step's answer: the assistant message id in the thread. */
6255
+ responseId: string | null;
6256
+ error: string | null;
6257
+ /** Who the step is for (from the plan), or null: the run's owner hears of it. */
6258
+ assignee: StepAssignee | null;
6259
+ /** Who was told it is ready, since it last changed (`usr-` / `agt-`). */
6260
+ announcedTo: string | null;
6261
+ /** Reopened by a send-back to it and not touched since (`hasNote`: with a note). */
6262
+ sentBack: boolean;
6263
+ hasNote: boolean;
6264
+ /** How many times work was sent back to this step. */
6265
+ timesSentBack: number;
6266
+ /** The signals this step raised (each name once, first raised first). */
6267
+ signals: string[];
6268
+ /** The threads linked workflows started on this step's signals. */
6269
+ linkedRuns: LinkedRun[];
6270
+ /** The documents (ids) it waits on to finish processing before its turn starts. */
6271
+ waitingDocuments: string[];
6272
+ /** A started action step waiting for people: what for (`sign`, `email_draft`), and its document. */
6273
+ waitingAction: string | null;
6274
+ waitingDocument: string | null;
6275
+ }
6276
+ /** A run's steps with where each stands, in plan order. */
6277
+ declare function runSteps(steps: TaskPlanStep[], events: StepActivityEvent[]): RunStep[];
6278
+ /** Who a step is for, in words: `run owner`, `project lead`, `input:<field>` or the user id. */
6279
+ declare function describeAssignee(assignee: StepAssignee | null | undefined): string;
6280
+ /** The step a server-sent message starts (its `tools.workflow_step` marker), or null. */
6281
+ declare function messageWorkflowStep(message: {
6282
+ tools?: Record<string, unknown> | null;
6283
+ }): string | null;
6284
+ /**
6285
+ * What a run waits for now:
6286
+ * - `agent`: a step is running, or an agent step is ready (the server starts it next);
6287
+ * - `person`: a form, upload or review is ready for someone to complete or skip;
6288
+ * - `finished`: every step is done or skipped;
6289
+ * - `stuck`: nothing can move (a failed step that others wait for): skip it to go on.
6290
+ */
6291
+ type RunWaitingOn = 'agent' | 'person' | 'finished' | 'stuck';
6292
+ declare function runWaitingOn(run: RunStep[]): RunWaitingOn;
6293
+ /**
6294
+ * A field a step asks for: a step's `fields` (what completing it is checked against, e.g. a rating
6295
+ * at a review), or a form's `ui.fields` (what the app's form renders).
6296
+ */
6297
+ interface StepField {
6298
+ name: string;
6299
+ type: string;
6300
+ label?: string | null;
6301
+ required?: boolean;
6302
+ options?: StepFieldOption[] | null;
6303
+ min?: number | null;
6304
+ max?: number | null;
6305
+ [key: string]: unknown;
6306
+ }
6307
+ /**
6308
+ * The tones a choice can be shown in (the blocks' `Tone`): e.g. a risk rating's low `success`,
6309
+ * medium `warning`, high `danger`. Display only: the server passes it through.
6310
+ */
6311
+ declare const STEP_FIELD_OPTION_TONES: readonly ["neutral", "info", "success", "warning", "danger", "accent", "ai"];
6312
+ type StepFieldOptionTone = (typeof STEP_FIELD_OPTION_TONES)[number];
6313
+ /** One choice of a `select` field. */
6314
+ interface StepFieldOption {
6315
+ value: string;
6316
+ label?: string | null;
6317
+ /** How the choice is coloured where it is picked, chosen or not. */
6318
+ tone?: StepFieldOptionTone | null;
6319
+ [key: string]: unknown;
6320
+ }
6321
+ /** The types a step's `fields` can have (the server's `StepField.type`). */
6322
+ declare const STEP_FIELD_TYPES: readonly ["text", "longtext", "boolean", "select", "number", "date", "scope", "documents", "person"];
6323
+ /**
6324
+ * The fields a step asks for: its `fields` when it declares them (any person step), else a form
6325
+ * step's `ui.fields`; none for an agent step.
6326
+ */
6327
+ declare function stepFields(step: Pick<TaskPlanStep, 'kind' | 'ui' | 'fields'>): StepField[];
6328
+ /** The required fields of a step still blank in `inputs` (the run's plus the new ones). */
6329
+ declare function missingRequiredFields(step: Pick<TaskPlanStep, 'kind' | 'ui' | 'fields'>, inputs: Record<string, unknown>): string[];
6330
+ /**
6331
+ * What the server would say about completing a step with `inputs` (`{name: problem}`, empty when
6332
+ * they fit), for a step that declares `fields`: `required`, `number`, `min`, `max`, `option`,
6333
+ * `type`, or `unknown` (a name the step does not ask for). A step without `fields` takes any inputs.
6334
+ */
6335
+ declare function checkStepInputs(step: Pick<TaskPlanStep, 'fields'>, inputs: Record<string, unknown> | null | undefined): Record<string, string>;
6336
+ /** A `checkStepInputs` result as one line: `rating: must be one of low, high; note: required`. */
6337
+ declare function describeInputProblems(step: Pick<TaskPlanStep, 'fields'>, problems: Record<string, string>): string;
6338
+ /**
6339
+ * `name=value` pairs (as typed on a command line) to inputs. A value is text unless the step's
6340
+ * field says otherwise: `number` fields become numbers, `boolean` fields `true` / `false`.
6341
+ */
6342
+ declare function parseInputPairs(pairs: string[], fields?: Pick<StepField, 'name' | 'type'>[]): Record<string, unknown>;
6343
+ /** The server's signal name rule. */
6344
+ declare const SIGNAL_NAME_PATTERN: RegExp;
6345
+ /** A list of what is wrong with a steps definition, each naming where (`steps[1].kind`). */
6346
+ declare class PlanStepsError extends Error {
6347
+ readonly problems: string[];
6348
+ constructor(problems: string[]);
6349
+ }
6350
+ /**
6351
+ * Check a steps definition and return it as the API's `TaskPlanStep[]`. Accepts a list of steps,
6352
+ * or an object with `steps` (e.g. a whole plan). Throws `PlanStepsError` listing every problem:
6353
+ * shape, ids, kinds, an agent step without a prompt or skill, and the graph (a duplicate id, an
6354
+ * `after` naming no step, a cycle, a step listed before one it waits for).
6355
+ */
6356
+ declare function parsePlanSteps(value: unknown): TaskPlanStep[];
6357
+ /** A plan holding only steps (what `createWork` and workflows take as `plan`). */
6358
+ declare function stepsPlan(steps: TaskPlanStep[]): components['schemas']['TaskPlan'];
6359
+
6360
+ type workflowSteps_LinkedRun = LinkedRun;
6361
+ declare const workflowSteps_PERSON_STEP_KINDS: typeof PERSON_STEP_KINDS;
6362
+ type workflowSteps_PlanStepsError = PlanStepsError;
6363
+ declare const workflowSteps_PlanStepsError: typeof PlanStepsError;
6364
+ type workflowSteps_RaisedSignal = RaisedSignal;
6365
+ type workflowSteps_RunStep = RunStep;
6366
+ type workflowSteps_RunWaitingOn = RunWaitingOn;
6367
+ declare const workflowSteps_SIGNAL_NAME_PATTERN: typeof SIGNAL_NAME_PATTERN;
6368
+ declare const workflowSteps_STEP_ACTION_TYPES: typeof STEP_ACTION_TYPES;
6369
+ declare const workflowSteps_STEP_FIELD_OPTION_TONES: typeof STEP_FIELD_OPTION_TONES;
6370
+ declare const workflowSteps_STEP_FIELD_TYPES: typeof STEP_FIELD_TYPES;
6371
+ declare const workflowSteps_STEP_ID_PATTERN: typeof STEP_ID_PATTERN;
6372
+ declare const workflowSteps_STEP_KINDS: typeof STEP_KINDS;
6373
+ type workflowSteps_SendBack = SendBack;
6374
+ type workflowSteps_StepActivityEvent = StepActivityEvent;
6375
+ type workflowSteps_StepAssignee = StepAssignee;
6376
+ type workflowSteps_StepField = StepField;
6377
+ type workflowSteps_StepFieldOption = StepFieldOption;
6378
+ type workflowSteps_StepFieldOptionTone = StepFieldOptionTone;
6379
+ type workflowSteps_StepKind = StepKind;
6380
+ type workflowSteps_StepPhase = StepPhase;
6381
+ type workflowSteps_StepSignal = StepSignal;
6382
+ type workflowSteps_StepSignalWhen = StepSignalWhen;
6383
+ type workflowSteps_StepState = StepState;
6384
+ type workflowSteps_StepStatus = StepStatus;
6385
+ type workflowSteps_TaskPlanStep = TaskPlanStep;
6386
+ declare const workflowSteps_checkStepInputs: typeof checkStepInputs;
6387
+ declare const workflowSteps_describeAssignee: typeof describeAssignee;
6388
+ declare const workflowSteps_describeInputProblems: typeof describeInputProblems;
6389
+ declare const workflowSteps_isPersonStep: typeof isPersonStep;
6390
+ declare const workflowSteps_linkedRuns: typeof linkedRuns;
6391
+ declare const workflowSteps_messageWorkflowStep: typeof messageWorkflowStep;
6392
+ declare const workflowSteps_missingRequiredFields: typeof missingRequiredFields;
6393
+ declare const workflowSteps_parseInputPairs: typeof parseInputPairs;
6394
+ declare const workflowSteps_parsePlanSteps: typeof parsePlanSteps;
6395
+ declare const workflowSteps_raisedSignals: typeof raisedSignals;
6396
+ declare const workflowSteps_runSteps: typeof runSteps;
6397
+ declare const workflowSteps_runWaitingOn: typeof runWaitingOn;
6398
+ declare const workflowSteps_sendBacks: typeof sendBacks;
6399
+ declare const workflowSteps_stepDependencies: typeof stepDependencies;
6400
+ declare const workflowSteps_stepFields: typeof stepFields;
6401
+ declare const workflowSteps_stepPhase: typeof stepPhase;
6402
+ declare const workflowSteps_stepStatesFromActivity: typeof stepStatesFromActivity;
6403
+ declare const workflowSteps_stepsPlan: typeof stepsPlan;
6404
+ declare const workflowSteps_waitingForDocumentsText: typeof waitingForDocumentsText;
6405
+ declare namespace workflowSteps {
6406
+ export { type workflowSteps_LinkedRun as LinkedRun, workflowSteps_PERSON_STEP_KINDS as PERSON_STEP_KINDS, workflowSteps_PlanStepsError as PlanStepsError, type workflowSteps_RaisedSignal as RaisedSignal, type workflowSteps_RunStep as RunStep, type workflowSteps_RunWaitingOn as RunWaitingOn, workflowSteps_SIGNAL_NAME_PATTERN as SIGNAL_NAME_PATTERN, workflowSteps_STEP_ACTION_TYPES as STEP_ACTION_TYPES, workflowSteps_STEP_FIELD_OPTION_TONES as STEP_FIELD_OPTION_TONES, workflowSteps_STEP_FIELD_TYPES as STEP_FIELD_TYPES, workflowSteps_STEP_ID_PATTERN as STEP_ID_PATTERN, workflowSteps_STEP_KINDS as STEP_KINDS, type workflowSteps_SendBack as SendBack, type workflowSteps_StepActivityEvent as StepActivityEvent, type workflowSteps_StepAssignee as StepAssignee, type workflowSteps_StepField as StepField, type workflowSteps_StepFieldOption as StepFieldOption, type workflowSteps_StepFieldOptionTone as StepFieldOptionTone, type workflowSteps_StepKind as StepKind, type workflowSteps_StepPhase as StepPhase, type workflowSteps_StepSignal as StepSignal, type workflowSteps_StepSignalWhen as StepSignalWhen, type workflowSteps_StepState as StepState, type workflowSteps_StepStatus as StepStatus, type workflowSteps_TaskPlanStep as TaskPlanStep, workflowSteps_checkStepInputs as checkStepInputs, workflowSteps_describeAssignee as describeAssignee, workflowSteps_describeInputProblems as describeInputProblems, workflowSteps_isPersonStep as isPersonStep, workflowSteps_linkedRuns as linkedRuns, workflowSteps_messageWorkflowStep as messageWorkflowStep, workflowSteps_missingRequiredFields as missingRequiredFields, workflowSteps_parseInputPairs as parseInputPairs, workflowSteps_parsePlanSteps as parsePlanSteps, workflowSteps_raisedSignals as raisedSignals, workflowSteps_runSteps as runSteps, workflowSteps_runWaitingOn as runWaitingOn, workflowSteps_sendBacks as sendBacks, workflowSteps_stepDependencies as stepDependencies, workflowSteps_stepFields as stepFields, workflowSteps_stepPhase as stepPhase, workflowSteps_stepStatesFromActivity as stepStatesFromActivity, workflowSteps_stepsPlan as stepsPlan, workflowSteps_waitingForDocumentsText as waitingForDocumentsText };
6407
+ }
6408
+
6409
+ /**
6410
+ * Work: a conversation with a `status` is a task. Create one, run it, mark it done, or plan it. Backend: `/v1/conversation/...` (docs/design/work-model.md).
6411
+ */
6412
+
6413
+ type ConversationResponse = components['schemas']['ConversationResponse'];
5332
6414
  type UpdateConversationRequest = components['schemas']['UpdateConversationRequest'];
5333
6415
  type CreateWorkRequest = components['schemas']['CreateWorkRequest'];
5334
6416
  type PendingAuthResponse = components['schemas']['PendingAuthResponse'];
@@ -5596,8 +6678,8 @@ declare namespace facts {
5596
6678
 
5597
6679
  /**
5598
6680
  * Native calendar operations over `/v1/calendar`: settings, calendars, events, invitations,
5599
- * sharing, subscriptions, holidays, rooms, scheduling, connected accounts, app passwords and feeds,
5600
- * booking pages, and the public booking endpoints.
6681
+ * sharing, subscriptions, holidays, rooms, scheduling, connected accounts, booking pages,
6682
+ * and the public booking endpoints.
5601
6683
  *
5602
6684
  * Calendar content is sealed under per-calendar keys, themselves sealed to the user. A server
5603
6685
  * session reads it only once those keys are bridged to it ({@link unlockCalendarKeys}:
@@ -5636,8 +6718,6 @@ type PersonKey = S['PersonKey'];
5636
6718
  type CalendarAccount = S['AccountRead'];
5637
6719
  type CalendarAccountKind = CalendarAccount['kind'];
5638
6720
  type CalDavProfile = S['CalDavProfileRead'];
5639
- type AppPassword = S['AppPasswordRead'];
5640
- type AppPasswordCreated = S['AppPasswordCreated'];
5641
6721
  type BookingPage = S['BookingPageRead'];
5642
6722
  type WeeklyHoursSpec = S['WeeklyHours'];
5643
6723
  type PublicBookingPage = S['PublicBookingPage'];
@@ -5654,11 +6734,6 @@ type RoomCreateBody = Partial<ResourceCreate> & Pick<ResourceCreate, 'name'>;
5654
6734
  type CalDavConnectBody = Omit<S['CalDavConnect'], 'background_sync'> & {
5655
6735
  background_sync?: boolean;
5656
6736
  };
5657
- type AppPasswordCreateBody = S['AppPasswordCreate'];
5658
- type FeedLevel = S['FeedCreate']['level'];
5659
- type FeedCreateBody = Omit<S['FeedCreate'], 'label'> & {
5660
- label?: string;
5661
- };
5662
6737
  type BookingPageWriteBody = S['BookingPageWrite'];
5663
6738
  type BookingRequestBody = S['BookingRequest'];
5664
6739
  /** A time window for list queries: ISO instants with an offset. */
@@ -5804,15 +6879,6 @@ declare function syncAccount(client: ArbiClient, accId: string): Promise<Account
5804
6879
  declare function disconnectAccount(client: ArbiClient, accId: string): Promise<void>;
5805
6880
  /** Publish an own calendar into a connected account; it then mirrors both ways. */
5806
6881
  declare function publishCalendarToAccount(client: ArbiClient, accId: string, calendarId: string): Promise<CalendarRead>;
5807
- declare function listAppPasswords(client: ArbiClient): Promise<AppPassword[]>;
5808
- declare function createAppPassword(client: ArbiClient, body: AppPasswordCreateBody): Promise<AppPasswordCreated>;
5809
- declare function createFeed(client: ArbiClient, body: FeedCreateBody): Promise<AppPasswordCreated>;
5810
- declare function revokeAppPassword(client: ArbiClient, apwId: string): Promise<void>;
5811
- /** Split the app-password list into device passwords and feed URLs. */
5812
- declare function splitAppPasswords(rows: AppPassword[]): {
5813
- devices: AppPassword[];
5814
- feeds: AppPassword[];
5815
- };
5816
6882
  declare function listBookingPages(client: ArbiClient): Promise<BookingPage[]>;
5817
6883
  declare function putBookingPage(client: ArbiClient, body: BookingPageWriteBody): Promise<BookingPage>;
5818
6884
  declare function deleteBookingPage(client: ArbiClient, slug: string): Promise<void>;
@@ -5834,9 +6900,6 @@ declare function cancelPublicBooking(baseUrl: string, slug: string, token: strin
5834
6900
 
5835
6901
  declare const calendar_ACCOUNT_VENDOR: typeof ACCOUNT_VENDOR;
5836
6902
  type calendar_AccountSyncResult = AccountSyncResult;
5837
- type calendar_AppPassword = AppPassword;
5838
- type calendar_AppPasswordCreateBody = AppPasswordCreateBody;
5839
- type calendar_AppPasswordCreated = AppPasswordCreated;
5840
6903
  type calendar_AttendeeRead = AttendeeRead;
5841
6904
  type calendar_BookingConfirmation = BookingConfirmation;
5842
6905
  type calendar_BookingPage = BookingPage;
@@ -5861,8 +6924,6 @@ type calendar_EventCreate = EventCreate;
5861
6924
  type calendar_EventCreateBody = EventCreateBody;
5862
6925
  type calendar_EventPatchBody = EventPatchBody;
5863
6926
  type calendar_EventWrite = EventWrite;
5864
- type calendar_FeedCreateBody = FeedCreateBody;
5865
- type calendar_FeedLevel = FeedLevel;
5866
6927
  type calendar_FindTimeParams = FindTimeParams;
5867
6928
  type calendar_FreeBusyEntry = FreeBusyEntry;
5868
6929
  type calendar_HolidayCountry = HolidayCountry;
@@ -5893,10 +6954,8 @@ declare const calendar_bookPublicSlot: typeof bookPublicSlot;
5893
6954
  declare const calendar_cancelPublicBooking: typeof cancelPublicBooking;
5894
6955
  declare const calendar_connectCalDavAccount: typeof connectCalDavAccount;
5895
6956
  declare const calendar_connectOAuthAccount: typeof connectOAuthAccount;
5896
- declare const calendar_createAppPassword: typeof createAppPassword;
5897
6957
  declare const calendar_createCalendar: typeof createCalendar;
5898
6958
  declare const calendar_createEvent: typeof createEvent;
5899
- declare const calendar_createFeed: typeof createFeed;
5900
6959
  declare const calendar_createRoom: typeof createRoom;
5901
6960
  declare const calendar_decideCounter: typeof decideCounter;
5902
6961
  declare const calendar_deleteBookingPage: typeof deleteBookingPage;
@@ -5913,7 +6972,6 @@ declare const calendar_getFreeBusy: typeof getFreeBusy;
5913
6972
  declare const calendar_getPublicBookingPage: typeof getPublicBookingPage;
5914
6973
  declare const calendar_importCalendarIcs: typeof importCalendarIcs;
5915
6974
  declare const calendar_listAccounts: typeof listAccounts;
5916
- declare const calendar_listAppPasswords: typeof listAppPasswords;
5917
6975
  declare const calendar_listBookingPages: typeof listBookingPages;
5918
6976
  declare const calendar_listCalDavProfiles: typeof listCalDavProfiles;
5919
6977
  declare const calendar_listCalendars: typeof listCalendars;
@@ -5931,9 +6989,7 @@ declare const calendar_putBookingPage: typeof putBookingPage;
5931
6989
  declare const calendar_putCalendarSettings: typeof putCalendarSettings;
5932
6990
  declare const calendar_refreshCalendar: typeof refreshCalendar;
5933
6991
  declare const calendar_respondToEvent: typeof respondToEvent;
5934
- declare const calendar_revokeAppPassword: typeof revokeAppPassword;
5935
6992
  declare const calendar_shareCalendar: typeof shareCalendar;
5936
- declare const calendar_splitAppPasswords: typeof splitAppPasswords;
5937
6993
  declare const calendar_subscribeCalendar: typeof subscribeCalendar;
5938
6994
  declare const calendar_syncAccount: typeof syncAccount;
5939
6995
  declare const calendar_unlockCalendarKeys: typeof unlockCalendarKeys;
@@ -5942,7 +6998,7 @@ declare const calendar_updateAccount: typeof updateAccount;
5942
6998
  declare const calendar_updateCalendar: typeof updateCalendar;
5943
6999
  declare const calendar_updateEvent: typeof updateEvent;
5944
7000
  declare namespace calendar {
5945
- export { calendar_ACCOUNT_VENDOR as ACCOUNT_VENDOR, type calendar_AccountSyncResult as AccountSyncResult, type calendar_AppPassword as AppPassword, type calendar_AppPasswordCreateBody as AppPasswordCreateBody, type calendar_AppPasswordCreated as AppPasswordCreated, type calendar_AttendeeRead as AttendeeRead, type calendar_BookingConfirmation as BookingConfirmation, type calendar_BookingPage as BookingPage, type calendar_BookingPageWriteBody as BookingPageWriteBody, type calendar_BookingRequestBody as BookingRequestBody, type calendar_CalDavConnectBody as CalDavConnectBody, type calendar_CalDavProfile as CalDavProfile, type calendar_CalendarAccount as CalendarAccount, type calendar_CalendarAccountKind as CalendarAccountKind, type calendar_CalendarCreate as CalendarCreate, type calendar_CalendarCreateBody as CalendarCreateBody, type calendar_CalendarEvent as CalendarEvent, type calendar_CalendarKeys as CalendarKeys, type calendar_CalendarRead as CalendarRead, type calendar_CalendarSettings as CalendarSettings, type calendar_CalendarSettingsBody as CalendarSettingsBody, type calendar_CalendarUpdate as CalendarUpdate, type calendar_CalendarWindow as CalendarWindow, type calendar_DateTimeSpec as DateTimeSpec, type calendar_EditScope as EditScope, type calendar_EventCreate as EventCreate, type calendar_EventCreateBody as EventCreateBody, type calendar_EventPatchBody as EventPatchBody, type calendar_EventWrite as EventWrite, type calendar_FeedCreateBody as FeedCreateBody, type calendar_FeedLevel as FeedLevel, type calendar_FindTimeParams as FindTimeParams, type calendar_FreeBusyEntry as FreeBusyEntry, type calendar_HolidayCountry as HolidayCountry, type calendar_ImportResult as ImportResult, type calendar_InvitationRead as InvitationRead, type calendar_ListEventsParams as ListEventsParams, type calendar_OAuthAccountKind as OAuthAccountKind, type calendar_OverlayItem as OverlayItem, type calendar_OverlayLayerName as OverlayLayerName, type calendar_PersonKey as PersonKey, calendar_PublicBookingError as PublicBookingError, type calendar_PublicBookingPage as PublicBookingPage, type calendar_ResourceCreate as ResourceCreate, type calendar_RespondParams as RespondParams, type calendar_RespondPartstat as RespondPartstat, type calendar_RoomCreateBody as RoomCreateBody, type calendar_RoomQuery as RoomQuery, type calendar_RoomRead as RoomRead, type calendar_ScopedTarget as ScopedTarget, type calendar_ShareRead as ShareRead, type calendar_ShareRole as ShareRole, type calendar_SubscribeParams as SubscribeParams, type calendar_TimeSuggestion as TimeSuggestion, type calendar_WeeklyHoursSpec as WeeklyHoursSpec, calendar_addHolidayCalendar as addHolidayCalendar, calendar_bookPublicSlot as bookPublicSlot, calendar_cancelPublicBooking as cancelPublicBooking, calendar_connectCalDavAccount as connectCalDavAccount, calendar_connectOAuthAccount as connectOAuthAccount, calendar_createAppPassword as createAppPassword, calendar_createCalendar as createCalendar, calendar_createEvent as createEvent, calendar_createFeed as createFeed, calendar_createRoom as createRoom, calendar_decideCounter as decideCounter, calendar_deleteBookingPage as deleteBookingPage, calendar_deleteCalendar as deleteCalendar, calendar_deleteEvent as deleteEvent, calendar_disconnectAccount as disconnectAccount, calendar_ensureCalendarUnlocked as ensureCalendarUnlocked, calendar_eventIcs as eventIcs, calendar_exportCalendarIcs as exportCalendarIcs, calendar_findTime as findTime, calendar_getCalendarSettings as getCalendarSettings, calendar_getEvent as getEvent, calendar_getFreeBusy as getFreeBusy, calendar_getPublicBookingPage as getPublicBookingPage, calendar_importCalendarIcs as importCalendarIcs, calendar_listAccounts as listAccounts, calendar_listAppPasswords as listAppPasswords, calendar_listBookingPages as listBookingPages, calendar_listCalDavProfiles as listCalDavProfiles, calendar_listCalendars as listCalendars, calendar_listEvents as listEvents, calendar_listHolidayCountries as listHolidayCountries, calendar_listInvitations as listInvitations, calendar_listOverlays as listOverlays, calendar_listRooms as listRooms, calendar_listShares as listShares, calendar_lookupEventByUid as lookupEventByUid, calendar_lookupPeopleKeys as lookupPeopleKeys, calendar_moveEvent as moveEvent, calendar_publishCalendarToAccount as publishCalendarToAccount, calendar_putBookingPage as putBookingPage, calendar_putCalendarSettings as putCalendarSettings, calendar_refreshCalendar as refreshCalendar, calendar_respondToEvent as respondToEvent, calendar_revokeAppPassword as revokeAppPassword, calendar_shareCalendar as shareCalendar, calendar_splitAppPasswords as splitAppPasswords, calendar_subscribeCalendar as subscribeCalendar, calendar_syncAccount as syncAccount, calendar_unlockCalendarKeys as unlockCalendarKeys, calendar_unshareCalendar as unshareCalendar, calendar_updateAccount as updateAccount, calendar_updateCalendar as updateCalendar, calendar_updateEvent as updateEvent };
7001
+ export { calendar_ACCOUNT_VENDOR as ACCOUNT_VENDOR, type calendar_AccountSyncResult as AccountSyncResult, type calendar_AttendeeRead as AttendeeRead, type calendar_BookingConfirmation as BookingConfirmation, type calendar_BookingPage as BookingPage, type calendar_BookingPageWriteBody as BookingPageWriteBody, type calendar_BookingRequestBody as BookingRequestBody, type calendar_CalDavConnectBody as CalDavConnectBody, type calendar_CalDavProfile as CalDavProfile, type calendar_CalendarAccount as CalendarAccount, type calendar_CalendarAccountKind as CalendarAccountKind, type calendar_CalendarCreate as CalendarCreate, type calendar_CalendarCreateBody as CalendarCreateBody, type calendar_CalendarEvent as CalendarEvent, type calendar_CalendarKeys as CalendarKeys, type calendar_CalendarRead as CalendarRead, type calendar_CalendarSettings as CalendarSettings, type calendar_CalendarSettingsBody as CalendarSettingsBody, type calendar_CalendarUpdate as CalendarUpdate, type calendar_CalendarWindow as CalendarWindow, type calendar_DateTimeSpec as DateTimeSpec, type calendar_EditScope as EditScope, type calendar_EventCreate as EventCreate, type calendar_EventCreateBody as EventCreateBody, type calendar_EventPatchBody as EventPatchBody, type calendar_EventWrite as EventWrite, type calendar_FindTimeParams as FindTimeParams, type calendar_FreeBusyEntry as FreeBusyEntry, type calendar_HolidayCountry as HolidayCountry, type calendar_ImportResult as ImportResult, type calendar_InvitationRead as InvitationRead, type calendar_ListEventsParams as ListEventsParams, type calendar_OAuthAccountKind as OAuthAccountKind, type calendar_OverlayItem as OverlayItem, type calendar_OverlayLayerName as OverlayLayerName, type calendar_PersonKey as PersonKey, calendar_PublicBookingError as PublicBookingError, type calendar_PublicBookingPage as PublicBookingPage, type calendar_ResourceCreate as ResourceCreate, type calendar_RespondParams as RespondParams, type calendar_RespondPartstat as RespondPartstat, type calendar_RoomCreateBody as RoomCreateBody, type calendar_RoomQuery as RoomQuery, type calendar_RoomRead as RoomRead, type calendar_ScopedTarget as ScopedTarget, type calendar_ShareRead as ShareRead, type calendar_ShareRole as ShareRole, type calendar_SubscribeParams as SubscribeParams, type calendar_TimeSuggestion as TimeSuggestion, type calendar_WeeklyHoursSpec as WeeklyHoursSpec, calendar_addHolidayCalendar as addHolidayCalendar, calendar_bookPublicSlot as bookPublicSlot, calendar_cancelPublicBooking as cancelPublicBooking, calendar_connectCalDavAccount as connectCalDavAccount, calendar_connectOAuthAccount as connectOAuthAccount, calendar_createCalendar as createCalendar, calendar_createEvent as createEvent, calendar_createRoom as createRoom, calendar_decideCounter as decideCounter, calendar_deleteBookingPage as deleteBookingPage, calendar_deleteCalendar as deleteCalendar, calendar_deleteEvent as deleteEvent, calendar_disconnectAccount as disconnectAccount, calendar_ensureCalendarUnlocked as ensureCalendarUnlocked, calendar_eventIcs as eventIcs, calendar_exportCalendarIcs as exportCalendarIcs, calendar_findTime as findTime, calendar_getCalendarSettings as getCalendarSettings, calendar_getEvent as getEvent, calendar_getFreeBusy as getFreeBusy, calendar_getPublicBookingPage as getPublicBookingPage, calendar_importCalendarIcs as importCalendarIcs, calendar_listAccounts as listAccounts, calendar_listBookingPages as listBookingPages, calendar_listCalDavProfiles as listCalDavProfiles, calendar_listCalendars as listCalendars, calendar_listEvents as listEvents, calendar_listHolidayCountries as listHolidayCountries, calendar_listInvitations as listInvitations, calendar_listOverlays as listOverlays, calendar_listRooms as listRooms, calendar_listShares as listShares, calendar_lookupEventByUid as lookupEventByUid, calendar_lookupPeopleKeys as lookupPeopleKeys, calendar_moveEvent as moveEvent, calendar_publishCalendarToAccount as publishCalendarToAccount, calendar_putBookingPage as putBookingPage, calendar_putCalendarSettings as putCalendarSettings, calendar_refreshCalendar as refreshCalendar, calendar_respondToEvent as respondToEvent, calendar_shareCalendar as shareCalendar, calendar_subscribeCalendar as subscribeCalendar, calendar_syncAccount as syncAccount, calendar_unlockCalendarKeys as unlockCalendarKeys, calendar_unshareCalendar as unshareCalendar, calendar_updateAccount as updateAccount, calendar_updateCalendar as updateCalendar, calendar_updateEvent as updateEvent };
5946
7002
  }
5947
7003
 
5948
7004
  type DocUpdateRequest = components['schemas']['DocUpdateRequest'];
@@ -6246,8 +7302,757 @@ declare class Arbi {
6246
7302
  current_period_end?: number | null | undefined;
6247
7303
  cancel_at_period_end?: boolean | null | undefined;
6248
7304
  portal_url?: string | null | undefined;
6249
- }[]>;
6250
- create: (name: string, plan?: "free" | "pro", details?: ProjectDetails) => Promise<{
7305
+ }[]>;
7306
+ create: (name: string, plan?: "free" | "pro", details?: ProjectCreateOptions) => Promise<{
7307
+ external_id: string;
7308
+ name: string;
7309
+ created_by: string;
7310
+ subscription: string;
7311
+ created_at: string;
7312
+ quotas: {
7313
+ storage_gb: {
7314
+ used: number;
7315
+ limit: number;
7316
+ };
7317
+ ai_usage: {
7318
+ used: number;
7319
+ limit: number;
7320
+ };
7321
+ collaborators: {
7322
+ used: number;
7323
+ limit: number;
7324
+ };
7325
+ budget_reset_at?: number | null | undefined;
7326
+ };
7327
+ daily_cap_per_user?: number | null | undefined;
7328
+ budget?: {
7329
+ amount: number;
7330
+ currency: string;
7331
+ } | null | undefined;
7332
+ client?: string | null | undefined;
7333
+ client_ref?: string | null | undefined;
7334
+ stage?: string | null | undefined;
7335
+ stage_changed_at?: string | null | undefined;
7336
+ lead_user?: string | null | undefined;
7337
+ fields?: {
7338
+ [x: string]: unknown;
7339
+ } | undefined;
7340
+ field_schema?: {
7341
+ key: string;
7342
+ label?: string | null | undefined;
7343
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
7344
+ options?: string[] | null | undefined;
7345
+ }[] | null | undefined;
7346
+ plan_interval?: ("month" | "year") | null | undefined;
7347
+ packs: number;
7348
+ plan_change?: {
7349
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
7350
+ charged_pence: number;
7351
+ charged_ex_vat_pence: number;
7352
+ confirm_url?: string | null | undefined;
7353
+ } | null | undefined;
7354
+ addons?: {
7355
+ packs: number;
7356
+ packs_next?: number | null | undefined;
7357
+ plan_name: string;
7358
+ plan_ai_gbp: number;
7359
+ plan_storage_gb: number;
7360
+ block_ai_gbp: number;
7361
+ block_storage_gb: number;
7362
+ ai_blocks: number;
7363
+ storage_blocks: number;
7364
+ legacy_ai_blocks: number;
7365
+ legacy_storage_blocks: number;
7366
+ legacy_block_ai_gbp: number;
7367
+ legacy_block_storage_gb: number;
7368
+ blocks_ai_gbp: number;
7369
+ blocks_storage_gb: number;
7370
+ ai_blocks_next?: number | null | undefined;
7371
+ storage_blocks_next?: number | null | undefined;
7372
+ storage_blocks_min: number;
7373
+ auto_topup_threshold_gbp: number;
7374
+ min_auto_topup_threshold_gbp: number;
7375
+ spend_cap_pence?: number | null | undefined;
7376
+ addon_spend_pence: number;
7377
+ auto_spent_pence: number;
7378
+ addon_spend_window_end?: number | null | undefined;
7379
+ manual_spent_pence: number;
7380
+ cap_left_pence?: number | null | undefined;
7381
+ ai_used_gbp: number;
7382
+ ai_allowance_gbp: number;
7383
+ ai_allowance_next_gbp: number;
7384
+ storage_used_gb: number;
7385
+ storage_allowance_gb: number;
7386
+ storage_allowance_next_gb: number;
7387
+ ai_block_monthly_pence: number;
7388
+ ai_block_monthly_ex_vat_pence: number;
7389
+ storage_block_monthly_pence: number;
7390
+ storage_block_monthly_ex_vat_pence: number;
7391
+ ai_block_period_pence: number;
7392
+ ai_block_period_ex_vat_pence: number;
7393
+ storage_block_period_pence: number;
7394
+ storage_block_period_ex_vat_pence: number;
7395
+ ai_block_price_pence: number;
7396
+ ai_block_price_ex_vat_pence: number;
7397
+ storage_block_price_pence: number;
7398
+ storage_block_price_ex_vat_pence: number;
7399
+ cap_reached: boolean;
7400
+ period_end?: number | null | undefined;
7401
+ ai_usage_reset_at?: number | null | undefined;
7402
+ pending_interval?: ("month" | "year") | null | undefined;
7403
+ billing_error?: string | null | undefined;
7404
+ confirm_url?: string | null | undefined;
7405
+ payment?: {
7406
+ status: "pending" | "paid";
7407
+ kind?: ("ai_usage" | "storage") | null | undefined;
7408
+ amount_pence?: number | null | undefined;
7409
+ amount_ex_vat_pence?: number | null | undefined;
7410
+ tax_pence?: number | null | undefined;
7411
+ at?: number | null | undefined;
7412
+ confirm_url?: string | null | undefined;
7413
+ } | null | undefined;
7414
+ } | null | undefined;
7415
+ price_id?: string | null | undefined;
7416
+ plan?: string | null | undefined;
7417
+ amount?: number | null | undefined;
7418
+ amount_ex_vat?: number | null | undefined;
7419
+ currency?: string | null | undefined;
7420
+ current_period_end?: number | null | undefined;
7421
+ cancel_at_period_end?: boolean | null | undefined;
7422
+ portal_url?: string | null | undefined;
7423
+ }>;
7424
+ /** Patch a project: name, daily cap, budget, client, stage, lead, fields (merged key by key). */
7425
+ update: (projectExtId: string, body: ProjectUpdateRequest) => Promise<{
7426
+ external_id: string;
7427
+ name: string;
7428
+ created_by: string;
7429
+ subscription: string;
7430
+ created_at: string;
7431
+ quotas: {
7432
+ storage_gb: {
7433
+ used: number;
7434
+ limit: number;
7435
+ };
7436
+ ai_usage: {
7437
+ used: number;
7438
+ limit: number;
7439
+ };
7440
+ collaborators: {
7441
+ used: number;
7442
+ limit: number;
7443
+ };
7444
+ budget_reset_at?: number | null | undefined;
7445
+ };
7446
+ daily_cap_per_user?: number | null | undefined;
7447
+ budget?: {
7448
+ amount: number;
7449
+ currency: string;
7450
+ } | null | undefined;
7451
+ client?: string | null | undefined;
7452
+ client_ref?: string | null | undefined;
7453
+ stage?: string | null | undefined;
7454
+ stage_changed_at?: string | null | undefined;
7455
+ lead_user?: string | null | undefined;
7456
+ fields?: {
7457
+ [x: string]: unknown;
7458
+ } | undefined;
7459
+ field_schema?: {
7460
+ key: string;
7461
+ label?: string | null | undefined;
7462
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
7463
+ options?: string[] | null | undefined;
7464
+ }[] | null | undefined;
7465
+ plan_interval?: ("month" | "year") | null | undefined;
7466
+ packs: number;
7467
+ plan_change?: {
7468
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
7469
+ charged_pence: number;
7470
+ charged_ex_vat_pence: number;
7471
+ confirm_url?: string | null | undefined;
7472
+ } | null | undefined;
7473
+ addons?: {
7474
+ packs: number;
7475
+ packs_next?: number | null | undefined;
7476
+ plan_name: string;
7477
+ plan_ai_gbp: number;
7478
+ plan_storage_gb: number;
7479
+ block_ai_gbp: number;
7480
+ block_storage_gb: number;
7481
+ ai_blocks: number;
7482
+ storage_blocks: number;
7483
+ legacy_ai_blocks: number;
7484
+ legacy_storage_blocks: number;
7485
+ legacy_block_ai_gbp: number;
7486
+ legacy_block_storage_gb: number;
7487
+ blocks_ai_gbp: number;
7488
+ blocks_storage_gb: number;
7489
+ ai_blocks_next?: number | null | undefined;
7490
+ storage_blocks_next?: number | null | undefined;
7491
+ storage_blocks_min: number;
7492
+ auto_topup_threshold_gbp: number;
7493
+ min_auto_topup_threshold_gbp: number;
7494
+ spend_cap_pence?: number | null | undefined;
7495
+ addon_spend_pence: number;
7496
+ auto_spent_pence: number;
7497
+ addon_spend_window_end?: number | null | undefined;
7498
+ manual_spent_pence: number;
7499
+ cap_left_pence?: number | null | undefined;
7500
+ ai_used_gbp: number;
7501
+ ai_allowance_gbp: number;
7502
+ ai_allowance_next_gbp: number;
7503
+ storage_used_gb: number;
7504
+ storage_allowance_gb: number;
7505
+ storage_allowance_next_gb: number;
7506
+ ai_block_monthly_pence: number;
7507
+ ai_block_monthly_ex_vat_pence: number;
7508
+ storage_block_monthly_pence: number;
7509
+ storage_block_monthly_ex_vat_pence: number;
7510
+ ai_block_period_pence: number;
7511
+ ai_block_period_ex_vat_pence: number;
7512
+ storage_block_period_pence: number;
7513
+ storage_block_period_ex_vat_pence: number;
7514
+ ai_block_price_pence: number;
7515
+ ai_block_price_ex_vat_pence: number;
7516
+ storage_block_price_pence: number;
7517
+ storage_block_price_ex_vat_pence: number;
7518
+ cap_reached: boolean;
7519
+ period_end?: number | null | undefined;
7520
+ ai_usage_reset_at?: number | null | undefined;
7521
+ pending_interval?: ("month" | "year") | null | undefined;
7522
+ billing_error?: string | null | undefined;
7523
+ confirm_url?: string | null | undefined;
7524
+ payment?: {
7525
+ status: "pending" | "paid";
7526
+ kind?: ("ai_usage" | "storage") | null | undefined;
7527
+ amount_pence?: number | null | undefined;
7528
+ amount_ex_vat_pence?: number | null | undefined;
7529
+ tax_pence?: number | null | undefined;
7530
+ at?: number | null | undefined;
7531
+ confirm_url?: string | null | undefined;
7532
+ } | null | undefined;
7533
+ } | null | undefined;
7534
+ price_id?: string | null | undefined;
7535
+ plan?: string | null | undefined;
7536
+ amount?: number | null | undefined;
7537
+ amount_ex_vat?: number | null | undefined;
7538
+ currency?: string | null | undefined;
7539
+ current_period_end?: number | null | undefined;
7540
+ cancel_at_period_end?: boolean | null | undefined;
7541
+ portal_url?: string | null | undefined;
7542
+ }>;
7543
+ /** The project's stage and budget changes, newest first. */
7544
+ events: (projectExtId: string, options?: {
7545
+ kind?: ProjectEventKind;
7546
+ limit?: number;
7547
+ }) => Promise<{
7548
+ external_id: string;
7549
+ kind: "stage_changed" | "budget_changed";
7550
+ actor?: string | null;
7551
+ detail: {
7552
+ [key: string]: unknown;
7553
+ };
7554
+ created_at: string;
7555
+ }[]>;
7556
+ /** The project's spend by conversation in a billing period (£). */
7557
+ usageByConversation: (projectExtId: string, monthsBack?: number) => Promise<{
7558
+ project_ext_id: string;
7559
+ period_start: string;
7560
+ period_end: string;
7561
+ total_spend: number;
7562
+ total_tokens: number;
7563
+ total_requests: number;
7564
+ by_conversation: {
7565
+ [key: string]: components["schemas"]["TagBreakdown"];
7566
+ };
7567
+ unattributed: components["schemas"]["TagBreakdown"];
7568
+ }>;
7569
+ refresh: (projectExtId: string) => Promise<{
7570
+ external_id: string;
7571
+ name: string;
7572
+ created_by: string;
7573
+ subscription: string;
7574
+ created_at: string;
7575
+ quotas: {
7576
+ storage_gb: {
7577
+ used: number;
7578
+ limit: number;
7579
+ };
7580
+ ai_usage: {
7581
+ used: number;
7582
+ limit: number;
7583
+ };
7584
+ collaborators: {
7585
+ used: number;
7586
+ limit: number;
7587
+ };
7588
+ budget_reset_at?: number | null | undefined;
7589
+ };
7590
+ daily_cap_per_user?: number | null | undefined;
7591
+ budget?: {
7592
+ amount: number;
7593
+ currency: string;
7594
+ } | null | undefined;
7595
+ client?: string | null | undefined;
7596
+ client_ref?: string | null | undefined;
7597
+ stage?: string | null | undefined;
7598
+ stage_changed_at?: string | null | undefined;
7599
+ lead_user?: string | null | undefined;
7600
+ fields?: {
7601
+ [x: string]: unknown;
7602
+ } | undefined;
7603
+ field_schema?: {
7604
+ key: string;
7605
+ label?: string | null | undefined;
7606
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
7607
+ options?: string[] | null | undefined;
7608
+ }[] | null | undefined;
7609
+ plan_interval?: ("month" | "year") | null | undefined;
7610
+ packs: number;
7611
+ plan_change?: {
7612
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
7613
+ charged_pence: number;
7614
+ charged_ex_vat_pence: number;
7615
+ confirm_url?: string | null | undefined;
7616
+ } | null | undefined;
7617
+ addons?: {
7618
+ packs: number;
7619
+ packs_next?: number | null | undefined;
7620
+ plan_name: string;
7621
+ plan_ai_gbp: number;
7622
+ plan_storage_gb: number;
7623
+ block_ai_gbp: number;
7624
+ block_storage_gb: number;
7625
+ ai_blocks: number;
7626
+ storage_blocks: number;
7627
+ legacy_ai_blocks: number;
7628
+ legacy_storage_blocks: number;
7629
+ legacy_block_ai_gbp: number;
7630
+ legacy_block_storage_gb: number;
7631
+ blocks_ai_gbp: number;
7632
+ blocks_storage_gb: number;
7633
+ ai_blocks_next?: number | null | undefined;
7634
+ storage_blocks_next?: number | null | undefined;
7635
+ storage_blocks_min: number;
7636
+ auto_topup_threshold_gbp: number;
7637
+ min_auto_topup_threshold_gbp: number;
7638
+ spend_cap_pence?: number | null | undefined;
7639
+ addon_spend_pence: number;
7640
+ auto_spent_pence: number;
7641
+ addon_spend_window_end?: number | null | undefined;
7642
+ manual_spent_pence: number;
7643
+ cap_left_pence?: number | null | undefined;
7644
+ ai_used_gbp: number;
7645
+ ai_allowance_gbp: number;
7646
+ ai_allowance_next_gbp: number;
7647
+ storage_used_gb: number;
7648
+ storage_allowance_gb: number;
7649
+ storage_allowance_next_gb: number;
7650
+ ai_block_monthly_pence: number;
7651
+ ai_block_monthly_ex_vat_pence: number;
7652
+ storage_block_monthly_pence: number;
7653
+ storage_block_monthly_ex_vat_pence: number;
7654
+ ai_block_period_pence: number;
7655
+ ai_block_period_ex_vat_pence: number;
7656
+ storage_block_period_pence: number;
7657
+ storage_block_period_ex_vat_pence: number;
7658
+ ai_block_price_pence: number;
7659
+ ai_block_price_ex_vat_pence: number;
7660
+ storage_block_price_pence: number;
7661
+ storage_block_price_ex_vat_pence: number;
7662
+ cap_reached: boolean;
7663
+ period_end?: number | null | undefined;
7664
+ ai_usage_reset_at?: number | null | undefined;
7665
+ pending_interval?: ("month" | "year") | null | undefined;
7666
+ billing_error?: string | null | undefined;
7667
+ confirm_url?: string | null | undefined;
7668
+ payment?: {
7669
+ status: "pending" | "paid";
7670
+ kind?: ("ai_usage" | "storage") | null | undefined;
7671
+ amount_pence?: number | null | undefined;
7672
+ amount_ex_vat_pence?: number | null | undefined;
7673
+ tax_pence?: number | null | undefined;
7674
+ at?: number | null | undefined;
7675
+ confirm_url?: string | null | undefined;
7676
+ } | null | undefined;
7677
+ } | null | undefined;
7678
+ price_id?: string | null | undefined;
7679
+ plan?: string | null | undefined;
7680
+ amount?: number | null | undefined;
7681
+ amount_ex_vat?: number | null | undefined;
7682
+ currency?: string | null | undefined;
7683
+ current_period_end?: number | null | undefined;
7684
+ cancel_at_period_end?: boolean | null | undefined;
7685
+ portal_url?: string | null | undefined;
7686
+ }>;
7687
+ /** AI usage + spend breakdown for a project's billing period. */
7688
+ usage: (projectExtId: string, monthsBack?: number) => Promise<{
7689
+ project_ext_id: string;
7690
+ period_start: string;
7691
+ period_end: string;
7692
+ total_spend: number;
7693
+ total_tokens: number;
7694
+ total_requests: number;
7695
+ daily: components["schemas"]["DailyUsage"][];
7696
+ model_groups: {
7697
+ [key: string]: components["schemas"]["ModelGroupUsage"];
7698
+ };
7699
+ by_workspace: {
7700
+ [key: string]: components["schemas"]["TagBreakdown"];
7701
+ };
7702
+ by_user: {
7703
+ [key: string]: components["schemas"]["TagBreakdown"];
7704
+ };
7705
+ by_feature: {
7706
+ [key: string]: components["schemas"]["TagBreakdown"];
7707
+ };
7708
+ invoice_pdf?: string | null;
7709
+ }>;
7710
+ /** Stripe invoices for a project's subscription. */
7711
+ invoices: (projectExtId: string) => Promise<{
7712
+ project_ext_id: string;
7713
+ invoices: components["schemas"]["ProjectInvoice"][];
7714
+ }>;
7715
+ /** Delete a project (only when empty: no workspaces, no subscription). */
7716
+ delete: (projectExtId: string) => Promise<void>;
7717
+ /** The plans and add-ons on sale. */
7718
+ products: () => Promise<{
7719
+ product_id: string;
7720
+ name: string;
7721
+ description?: string | null | undefined;
7722
+ prices: {
7723
+ price_id: string;
7724
+ amount?: number | null | undefined;
7725
+ amount_ex_vat?: number | null | undefined;
7726
+ currency: string;
7727
+ interval: string;
7728
+ interval_count: number;
7729
+ default_price: boolean;
7730
+ pack_prices: {
7731
+ packs: number;
7732
+ amount: number;
7733
+ amount_ex_vat: number;
7734
+ }[];
7735
+ addon_prices: {
7736
+ kind: "ai_usage" | "storage";
7737
+ ai_gbp: number;
7738
+ storage_gb: number;
7739
+ amount_ex_vat: number;
7740
+ amount: number;
7741
+ monthly_ex_vat: number;
7742
+ monthly: number;
7743
+ }[];
7744
+ }[];
7745
+ }[]>;
7746
+ /** The taxed total of a Pro purchase (a new project when `projectExtId` is null). */
7747
+ quotePlan: (projectExtId: string | null, body: ProjectQuoteRequest) => Promise<{
7748
+ subtotal_pence: number;
7749
+ tax_pence: number;
7750
+ total_pence: number;
7751
+ tax_label?: string | null | undefined;
7752
+ reverse_charge: boolean;
7753
+ country?: string | null | undefined;
7754
+ taxability_reason?: string | null | undefined;
7755
+ lines: {
7756
+ reference: string;
7757
+ subtotal_pence: number;
7758
+ tax_pence: number;
7759
+ }[];
7760
+ }>;
7761
+ /** Start an embedded Stripe checkout; returns its `client_secret`. */
7762
+ checkout: (projectExtId: string, body: ProjectCheckoutRequest) => Promise<{
7763
+ client_secret: string;
7764
+ }>;
7765
+ changePlan: (projectExtId: string, body: ProjectPlanChangeRequest) => Promise<{
7766
+ external_id: string;
7767
+ name: string;
7768
+ created_by: string;
7769
+ subscription: string;
7770
+ created_at: string;
7771
+ quotas: {
7772
+ storage_gb: {
7773
+ used: number;
7774
+ limit: number;
7775
+ };
7776
+ ai_usage: {
7777
+ used: number;
7778
+ limit: number;
7779
+ };
7780
+ collaborators: {
7781
+ used: number;
7782
+ limit: number;
7783
+ };
7784
+ budget_reset_at?: number | null | undefined;
7785
+ };
7786
+ daily_cap_per_user?: number | null | undefined;
7787
+ budget?: {
7788
+ amount: number;
7789
+ currency: string;
7790
+ } | null | undefined;
7791
+ client?: string | null | undefined;
7792
+ client_ref?: string | null | undefined;
7793
+ stage?: string | null | undefined;
7794
+ stage_changed_at?: string | null | undefined;
7795
+ lead_user?: string | null | undefined;
7796
+ fields?: {
7797
+ [x: string]: unknown;
7798
+ } | undefined;
7799
+ field_schema?: {
7800
+ key: string;
7801
+ label?: string | null | undefined;
7802
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
7803
+ options?: string[] | null | undefined;
7804
+ }[] | null | undefined;
7805
+ plan_interval?: ("month" | "year") | null | undefined;
7806
+ packs: number;
7807
+ plan_change?: {
7808
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
7809
+ charged_pence: number;
7810
+ charged_ex_vat_pence: number;
7811
+ confirm_url?: string | null | undefined;
7812
+ } | null | undefined;
7813
+ addons?: {
7814
+ packs: number;
7815
+ packs_next?: number | null | undefined;
7816
+ plan_name: string;
7817
+ plan_ai_gbp: number;
7818
+ plan_storage_gb: number;
7819
+ block_ai_gbp: number;
7820
+ block_storage_gb: number;
7821
+ ai_blocks: number;
7822
+ storage_blocks: number;
7823
+ legacy_ai_blocks: number;
7824
+ legacy_storage_blocks: number;
7825
+ legacy_block_ai_gbp: number;
7826
+ legacy_block_storage_gb: number;
7827
+ blocks_ai_gbp: number;
7828
+ blocks_storage_gb: number;
7829
+ ai_blocks_next?: number | null | undefined;
7830
+ storage_blocks_next?: number | null | undefined;
7831
+ storage_blocks_min: number;
7832
+ auto_topup_threshold_gbp: number;
7833
+ min_auto_topup_threshold_gbp: number;
7834
+ spend_cap_pence?: number | null | undefined;
7835
+ addon_spend_pence: number;
7836
+ auto_spent_pence: number;
7837
+ addon_spend_window_end?: number | null | undefined;
7838
+ manual_spent_pence: number;
7839
+ cap_left_pence?: number | null | undefined;
7840
+ ai_used_gbp: number;
7841
+ ai_allowance_gbp: number;
7842
+ ai_allowance_next_gbp: number;
7843
+ storage_used_gb: number;
7844
+ storage_allowance_gb: number;
7845
+ storage_allowance_next_gb: number;
7846
+ ai_block_monthly_pence: number;
7847
+ ai_block_monthly_ex_vat_pence: number;
7848
+ storage_block_monthly_pence: number;
7849
+ storage_block_monthly_ex_vat_pence: number;
7850
+ ai_block_period_pence: number;
7851
+ ai_block_period_ex_vat_pence: number;
7852
+ storage_block_period_pence: number;
7853
+ storage_block_period_ex_vat_pence: number;
7854
+ ai_block_price_pence: number;
7855
+ ai_block_price_ex_vat_pence: number;
7856
+ storage_block_price_pence: number;
7857
+ storage_block_price_ex_vat_pence: number;
7858
+ cap_reached: boolean;
7859
+ period_end?: number | null | undefined;
7860
+ ai_usage_reset_at?: number | null | undefined;
7861
+ pending_interval?: ("month" | "year") | null | undefined;
7862
+ billing_error?: string | null | undefined;
7863
+ confirm_url?: string | null | undefined;
7864
+ payment?: {
7865
+ status: "pending" | "paid";
7866
+ kind?: ("ai_usage" | "storage") | null | undefined;
7867
+ amount_pence?: number | null | undefined;
7868
+ amount_ex_vat_pence?: number | null | undefined;
7869
+ tax_pence?: number | null | undefined;
7870
+ at?: number | null | undefined;
7871
+ confirm_url?: string | null | undefined;
7872
+ } | null | undefined;
7873
+ } | null | undefined;
7874
+ price_id?: string | null | undefined;
7875
+ plan?: string | null | undefined;
7876
+ amount?: number | null | undefined;
7877
+ amount_ex_vat?: number | null | undefined;
7878
+ currency?: string | null | undefined;
7879
+ current_period_end?: number | null | undefined;
7880
+ cancel_at_period_end?: boolean | null | undefined;
7881
+ portal_url?: string | null | undefined;
7882
+ }>;
7883
+ previewPlanChange: (projectExtId: string, body: ProjectPlanChangeRequest) => Promise<{
7884
+ packs: number;
7885
+ plan_name: string;
7886
+ interval: "month" | "year";
7887
+ effective_now: boolean;
7888
+ unchanged: boolean;
7889
+ awaiting_confirmation: boolean;
7890
+ due_now_pence: number;
7891
+ due_now_ex_vat_pence: number;
7892
+ due_now_tax_pence: number;
7893
+ next_renewal_pence: number;
7894
+ next_renewal_ex_vat_pence: number;
7895
+ next_renewal_tax_pence: number;
7896
+ tax_label?: string | null | undefined;
7897
+ next_renewal_at?: number | null | undefined;
7898
+ }>;
7899
+ quoteAddon: (projectExtId: string, kind: ProjectAddonKind) => Promise<{
7900
+ kind: "ai_usage" | "storage";
7901
+ now: {
7902
+ subtotal_pence: number;
7903
+ tax_pence: number;
7904
+ total_pence: number;
7905
+ tax_label?: string | null | undefined;
7906
+ reverse_charge: boolean;
7907
+ country?: string | null | undefined;
7908
+ taxability_reason?: string | null | undefined;
7909
+ lines: {
7910
+ reference: string;
7911
+ subtotal_pence: number;
7912
+ tax_pence: number;
7913
+ }[];
7914
+ };
7915
+ renewal: {
7916
+ subtotal_pence: number;
7917
+ tax_pence: number;
7918
+ total_pence: number;
7919
+ tax_label?: string | null | undefined;
7920
+ reverse_charge: boolean;
7921
+ country?: string | null | undefined;
7922
+ taxability_reason?: string | null | undefined;
7923
+ lines: {
7924
+ reference: string;
7925
+ subtotal_pence: number;
7926
+ tax_pence: number;
7927
+ }[];
7928
+ };
7929
+ }>;
7930
+ billingPortal: (projectExtId: string) => Promise<{
7931
+ url: string;
7932
+ }>;
7933
+ addAddonBlock: (projectExtId: string, kind: ProjectAddonKind) => Promise<{
7934
+ status: "paid" | "requires_action";
7935
+ confirm_url?: string | null | undefined;
7936
+ project: {
7937
+ external_id: string;
7938
+ name: string;
7939
+ created_by: string;
7940
+ subscription: string;
7941
+ created_at: string;
7942
+ quotas: {
7943
+ storage_gb: {
7944
+ used: number;
7945
+ limit: number;
7946
+ };
7947
+ ai_usage: {
7948
+ used: number;
7949
+ limit: number;
7950
+ };
7951
+ collaborators: {
7952
+ used: number;
7953
+ limit: number;
7954
+ };
7955
+ budget_reset_at?: number | null | undefined;
7956
+ };
7957
+ daily_cap_per_user?: number | null | undefined;
7958
+ budget?: {
7959
+ amount: number;
7960
+ currency: string;
7961
+ } | null | undefined;
7962
+ client?: string | null | undefined;
7963
+ client_ref?: string | null | undefined;
7964
+ stage?: string | null | undefined;
7965
+ stage_changed_at?: string | null | undefined;
7966
+ lead_user?: string | null | undefined;
7967
+ fields?: {
7968
+ [x: string]: unknown;
7969
+ } | undefined;
7970
+ field_schema?: {
7971
+ key: string;
7972
+ label?: string | null | undefined;
7973
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
7974
+ options?: string[] | null | undefined;
7975
+ }[] | null | undefined;
7976
+ plan_interval?: ("month" | "year") | null | undefined;
7977
+ packs: number;
7978
+ plan_change?: {
7979
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
7980
+ charged_pence: number;
7981
+ charged_ex_vat_pence: number;
7982
+ confirm_url?: string | null | undefined;
7983
+ } | null | undefined;
7984
+ addons?: {
7985
+ packs: number;
7986
+ packs_next?: number | null | undefined;
7987
+ plan_name: string;
7988
+ plan_ai_gbp: number;
7989
+ plan_storage_gb: number;
7990
+ block_ai_gbp: number;
7991
+ block_storage_gb: number;
7992
+ ai_blocks: number;
7993
+ storage_blocks: number;
7994
+ legacy_ai_blocks: number;
7995
+ legacy_storage_blocks: number;
7996
+ legacy_block_ai_gbp: number;
7997
+ legacy_block_storage_gb: number;
7998
+ blocks_ai_gbp: number;
7999
+ blocks_storage_gb: number;
8000
+ ai_blocks_next?: number | null | undefined;
8001
+ storage_blocks_next?: number | null | undefined;
8002
+ storage_blocks_min: number;
8003
+ auto_topup_threshold_gbp: number;
8004
+ min_auto_topup_threshold_gbp: number;
8005
+ spend_cap_pence?: number | null | undefined;
8006
+ addon_spend_pence: number;
8007
+ auto_spent_pence: number;
8008
+ addon_spend_window_end?: number | null | undefined;
8009
+ manual_spent_pence: number;
8010
+ cap_left_pence?: number | null | undefined;
8011
+ ai_used_gbp: number;
8012
+ ai_allowance_gbp: number;
8013
+ ai_allowance_next_gbp: number;
8014
+ storage_used_gb: number;
8015
+ storage_allowance_gb: number;
8016
+ storage_allowance_next_gb: number;
8017
+ ai_block_monthly_pence: number;
8018
+ ai_block_monthly_ex_vat_pence: number;
8019
+ storage_block_monthly_pence: number;
8020
+ storage_block_monthly_ex_vat_pence: number;
8021
+ ai_block_period_pence: number;
8022
+ ai_block_period_ex_vat_pence: number;
8023
+ storage_block_period_pence: number;
8024
+ storage_block_period_ex_vat_pence: number;
8025
+ ai_block_price_pence: number;
8026
+ ai_block_price_ex_vat_pence: number;
8027
+ storage_block_price_pence: number;
8028
+ storage_block_price_ex_vat_pence: number;
8029
+ cap_reached: boolean;
8030
+ period_end?: number | null | undefined;
8031
+ ai_usage_reset_at?: number | null | undefined;
8032
+ pending_interval?: ("month" | "year") | null | undefined;
8033
+ billing_error?: string | null | undefined;
8034
+ confirm_url?: string | null | undefined;
8035
+ payment?: {
8036
+ status: "pending" | "paid";
8037
+ kind?: ("ai_usage" | "storage") | null | undefined;
8038
+ amount_pence?: number | null | undefined;
8039
+ amount_ex_vat_pence?: number | null | undefined;
8040
+ tax_pence?: number | null | undefined;
8041
+ at?: number | null | undefined;
8042
+ confirm_url?: string | null | undefined;
8043
+ } | null | undefined;
8044
+ } | null | undefined;
8045
+ price_id?: string | null | undefined;
8046
+ plan?: string | null | undefined;
8047
+ amount?: number | null | undefined;
8048
+ amount_ex_vat?: number | null | undefined;
8049
+ currency?: string | null | undefined;
8050
+ current_period_end?: number | null | undefined;
8051
+ cancel_at_period_end?: boolean | null | undefined;
8052
+ portal_url?: string | null | undefined;
8053
+ };
8054
+ }>;
8055
+ setNextPeriodAddons: (projectExtId: string, body: ProjectNextPeriodAddonsRequest) => Promise<{
6251
8056
  external_id: string;
6252
8057
  name: string;
6253
8058
  created_by: string;
@@ -6365,8 +8170,7 @@ declare class Arbi {
6365
8170
  cancel_at_period_end?: boolean | null | undefined;
6366
8171
  portal_url?: string | null | undefined;
6367
8172
  }>;
6368
- /** Patch a project: name, daily cap, budget, client, stage, lead, fields (merged key by key). */
6369
- update: (projectExtId: string, body: ProjectUpdateRequest) => Promise<{
8173
+ updateAddonSettings: (projectExtId: string, body: ProjectAddonSettingsRequest) => Promise<{
6370
8174
  external_id: string;
6371
8175
  name: string;
6372
8176
  created_by: string;
@@ -6484,33 +8288,7 @@ declare class Arbi {
6484
8288
  cancel_at_period_end?: boolean | null | undefined;
6485
8289
  portal_url?: string | null | undefined;
6486
8290
  }>;
6487
- /** The project's stage and budget changes, newest first. */
6488
- events: (projectExtId: string, options?: {
6489
- kind?: ProjectEventKind;
6490
- limit?: number;
6491
- }) => Promise<{
6492
- external_id: string;
6493
- kind: "stage_changed" | "budget_changed";
6494
- actor?: string | null;
6495
- detail: {
6496
- [key: string]: unknown;
6497
- };
6498
- created_at: string;
6499
- }[]>;
6500
- /** The project's spend by conversation in a billing period (£). */
6501
- usageByConversation: (projectExtId: string, monthsBack?: number) => Promise<{
6502
- project_ext_id: string;
6503
- period_start: string;
6504
- period_end: string;
6505
- total_spend: number;
6506
- total_tokens: number;
6507
- total_requests: number;
6508
- by_conversation: {
6509
- [key: string]: components["schemas"]["TagBreakdown"];
6510
- };
6511
- unattributed: components["schemas"]["TagBreakdown"];
6512
- }>;
6513
- refresh: (projectExtId: string) => Promise<{
8291
+ cancelSubscription: (projectExtId: string) => Promise<{
6514
8292
  external_id: string;
6515
8293
  name: string;
6516
8294
  created_by: string;
@@ -6628,34 +8406,6 @@ declare class Arbi {
6628
8406
  cancel_at_period_end?: boolean | null | undefined;
6629
8407
  portal_url?: string | null | undefined;
6630
8408
  }>;
6631
- /** AI usage + spend breakdown for a project's billing period. */
6632
- usage: (projectExtId: string, monthsBack?: number) => Promise<{
6633
- project_ext_id: string;
6634
- period_start: string;
6635
- period_end: string;
6636
- total_spend: number;
6637
- total_tokens: number;
6638
- total_requests: number;
6639
- daily: components["schemas"]["DailyUsage"][];
6640
- model_groups: {
6641
- [key: string]: components["schemas"]["ModelGroupUsage"];
6642
- };
6643
- by_workspace: {
6644
- [key: string]: components["schemas"]["TagBreakdown"];
6645
- };
6646
- by_user: {
6647
- [key: string]: components["schemas"]["TagBreakdown"];
6648
- };
6649
- by_feature: {
6650
- [key: string]: components["schemas"]["TagBreakdown"];
6651
- };
6652
- invoice_pdf?: string | null;
6653
- }>;
6654
- /** Stripe invoices for a project's subscription. */
6655
- invoices: (projectExtId: string) => Promise<{
6656
- project_ext_id: string;
6657
- invoices: components["schemas"]["ProjectInvoice"][];
6658
- }>;
6659
8409
  };
6660
8410
  readonly user: {
6661
8411
  /**
@@ -6898,6 +8648,8 @@ declare class Arbi {
6898
8648
  };
6899
8649
  private syncIdentity;
6900
8650
  readonly workspaces: {
8651
+ /** Hand this server session a workspace's key (sealed to the session) without opening it. */
8652
+ primeKey: (workspaceExtId: string, sessionSealedKey: string) => Promise<void>;
6901
8653
  list: () => Promise<{
6902
8654
  external_id: string;
6903
8655
  name: string;
@@ -6940,6 +8692,12 @@ declare class Arbi {
6940
8692
  project_subscription?: string | null | undefined;
6941
8693
  project_owner_ext_id?: string | null | undefined;
6942
8694
  house_template_ext_id?: string | null | undefined;
8695
+ archive?: {
8696
+ status: "archiving" | "archived" | "restoring";
8697
+ archived_at: string;
8698
+ documents_done: number;
8699
+ documents_total: number;
8700
+ } | null | undefined;
6943
8701
  }[]>;
6944
8702
  create: (name: string, projectExtId: string, description?: string | null, isPublic?: boolean) => Promise<{
6945
8703
  external_id: string;
@@ -6983,6 +8741,12 @@ declare class Arbi {
6983
8741
  project_subscription?: string | null | undefined;
6984
8742
  project_owner_ext_id?: string | null | undefined;
6985
8743
  house_template_ext_id?: string | null | undefined;
8744
+ archive?: {
8745
+ status: "archiving" | "archived" | "restoring";
8746
+ archived_at: string;
8747
+ documents_done: number;
8748
+ documents_total: number;
8749
+ } | null | undefined;
6986
8750
  }>;
6987
8751
  delete: (workspaceIds: string[]) => Promise<void>;
6988
8752
  update: (body: WorkspaceUpdateRequest) => Promise<{
@@ -7027,6 +8791,12 @@ declare class Arbi {
7027
8791
  project_subscription?: string | null | undefined;
7028
8792
  project_owner_ext_id?: string | null | undefined;
7029
8793
  house_template_ext_id?: string | null | undefined;
8794
+ archive?: {
8795
+ status: "archiving" | "archived" | "restoring";
8796
+ archived_at: string;
8797
+ documents_done: number;
8798
+ documents_total: number;
8799
+ } | null | undefined;
7030
8800
  }>;
7031
8801
  listUsers: () => Promise<{
7032
8802
  user: {
@@ -8923,13 +10693,16 @@ declare class Arbi {
8923
10693
  content?: string | null;
8924
10694
  }[]>;
8925
10695
  /**
8926
- * Search documents without LLM generation (retrieval only).
10696
+ * Search documents without LLM generation (retrieval only). No `docIds` searches the whole
10697
+ * workspace; `searchChunks(result)` ranks the passages found.
8927
10698
  */
8928
10699
  retrieve: (query: string, docIds: string[], options?: {
8929
10700
  searchMode?: "semantic" | "keyword" | "hybrid";
8930
10701
  fullContextDocIds?: string[];
8931
10702
  tocDocIds?: string[];
8932
10703
  model?: string;
10704
+ /** Keep the response server-side (default true). */
10705
+ store?: boolean;
8933
10706
  }) => Promise<RetrieveResult>;
8934
10707
  };
8935
10708
  readonly tags: {
@@ -9234,6 +11007,8 @@ declare class Arbi {
9234
11007
  name?: string | null;
9235
11008
  user_id?: string | null;
9236
11009
  contact_id?: string | null;
11010
+ address_book_ext_id?: string | null;
11011
+ registered: boolean;
9237
11012
  source: "contacts" | "arbi";
9238
11013
  }[]>;
9239
11014
  groupByStatus: typeof groupContactsByStatus;
@@ -9283,7 +11058,7 @@ declare class Arbi {
9283
11058
  description?: string | null;
9284
11059
  color: string;
9285
11060
  timezone: string;
9286
- kind: "calendar" | "resource" | "subscription" | "holidays" | "birthdays" | "addressbook";
11061
+ kind: "calendar" | "resource" | "subscription" | "holidays" | "addressbook";
9287
11062
  role: "owner" | "delegate" | "write" | "read" | "read_basic" | "freebusy";
9288
11063
  is_default: boolean;
9289
11064
  hidden: boolean;
@@ -9308,7 +11083,7 @@ declare class Arbi {
9308
11083
  description?: string | null;
9309
11084
  color: string;
9310
11085
  timezone: string;
9311
- kind: "calendar" | "resource" | "subscription" | "holidays" | "birthdays" | "addressbook";
11086
+ kind: "calendar" | "resource" | "subscription" | "holidays" | "addressbook";
9312
11087
  role: "owner" | "delegate" | "write" | "read" | "read_basic" | "freebusy";
9313
11088
  is_default: boolean;
9314
11089
  hidden: boolean;
@@ -9333,7 +11108,7 @@ declare class Arbi {
9333
11108
  description?: string | null;
9334
11109
  color: string;
9335
11110
  timezone: string;
9336
- kind: "calendar" | "resource" | "subscription" | "holidays" | "birthdays" | "addressbook";
11111
+ kind: "calendar" | "resource" | "subscription" | "holidays" | "addressbook";
9337
11112
  role: "owner" | "delegate" | "write" | "read" | "read_basic" | "freebusy";
9338
11113
  is_default: boolean;
9339
11114
  hidden: boolean;
@@ -9700,7 +11475,7 @@ declare class Arbi {
9700
11475
  description?: string | null;
9701
11476
  color: string;
9702
11477
  timezone: string;
9703
- kind: "calendar" | "resource" | "subscription" | "holidays" | "birthdays" | "addressbook";
11478
+ kind: "calendar" | "resource" | "subscription" | "holidays" | "addressbook";
9704
11479
  role: "owner" | "delegate" | "write" | "read" | "read_basic" | "freebusy";
9705
11480
  is_default: boolean;
9706
11481
  hidden: boolean;
@@ -9735,7 +11510,7 @@ declare class Arbi {
9735
11510
  description?: string | null;
9736
11511
  color: string;
9737
11512
  timezone: string;
9738
- kind: "calendar" | "resource" | "subscription" | "holidays" | "birthdays" | "addressbook";
11513
+ kind: "calendar" | "resource" | "subscription" | "holidays" | "addressbook";
9739
11514
  role: "owner" | "delegate" | "write" | "read" | "read_basic" | "freebusy";
9740
11515
  is_default: boolean;
9741
11516
  hidden: boolean;
@@ -9927,7 +11702,7 @@ declare class Arbi {
9927
11702
  description?: string | null;
9928
11703
  color: string;
9929
11704
  timezone: string;
9930
- kind: "calendar" | "resource" | "subscription" | "holidays" | "birthdays" | "addressbook";
11705
+ kind: "calendar" | "resource" | "subscription" | "holidays" | "addressbook";
9931
11706
  role: "owner" | "delegate" | "write" | "read" | "read_basic" | "freebusy";
9932
11707
  is_default: boolean;
9933
11708
  hidden: boolean;
@@ -9946,42 +11721,6 @@ declare class Arbi {
9946
11721
  can_write: boolean;
9947
11722
  ctag: string;
9948
11723
  }>;
9949
- listAppPasswords: () => Promise<{
9950
- id: string;
9951
- kind: "dav" | "feed" | "freebusy";
9952
- label: string;
9953
- calendar_ids?: string[];
9954
- feed_level?: string | null;
9955
- created_at: string;
9956
- last_used_at?: string | null;
9957
- }[]>;
9958
- createAppPassword: (body: AppPasswordCreateBody) => Promise<{
9959
- id: string;
9960
- kind: "dav" | "feed" | "freebusy";
9961
- label: string;
9962
- calendar_ids?: string[];
9963
- feed_level?: string | null;
9964
- created_at: string;
9965
- last_used_at?: string | null;
9966
- password?: string | null;
9967
- username?: string | null;
9968
- server_url?: string | null;
9969
- feed_url?: string | null;
9970
- }>;
9971
- createFeed: (body: FeedCreateBody) => Promise<{
9972
- id: string;
9973
- kind: "dav" | "feed" | "freebusy";
9974
- label: string;
9975
- calendar_ids?: string[];
9976
- feed_level?: string | null;
9977
- created_at: string;
9978
- last_used_at?: string | null;
9979
- password?: string | null;
9980
- username?: string | null;
9981
- server_url?: string | null;
9982
- feed_url?: string | null;
9983
- }>;
9984
- revokeAppPassword: (apwId: string) => Promise<void>;
9985
11724
  listBookingPages: () => Promise<{
9986
11725
  id: string;
9987
11726
  slug: string;
@@ -10187,6 +11926,147 @@ declare class Arbi {
10187
11926
  updated_at: string;
10188
11927
  }[]>;
10189
11928
  };
11929
+ /**
11930
+ * Connectors: the catalog, the user's connections and their OAuth, mailbox and drive sync,
11931
+ * Slack. A vendor is its `vendor_key` (e.g. `microsoft`, `gmail`).
11932
+ */
11933
+ readonly connectors: {
11934
+ catalog: () => Promise<{
11935
+ id: string;
11936
+ vendor_key: components["schemas"]["VendorKey"];
11937
+ display_name: string;
11938
+ description: string;
11939
+ icon_url: string | null;
11940
+ mcp_server_alias: string;
11941
+ requires_per_user_auth: boolean;
11942
+ }[]>;
11943
+ mine: () => Promise<{
11944
+ id: string;
11945
+ vendor_key: components["schemas"]["VendorKey"];
11946
+ display_name: string;
11947
+ icon_url: string | null;
11948
+ connected_at: string;
11949
+ vendor_user_identity: string | null;
11950
+ is_connected: boolean;
11951
+ token_scheme: string;
11952
+ syncs: {
11953
+ workspace_ext_id: string;
11954
+ status: string;
11955
+ enabled: boolean;
11956
+ last_sync_at?: string | null | undefined;
11957
+ backfill_window?: number | null | undefined;
11958
+ backfill_since?: string | null | undefined;
11959
+ folders: string[];
11960
+ skip_duplicates: boolean;
11961
+ auto_rename: boolean;
11962
+ shared: boolean;
11963
+ auto_sync: boolean;
11964
+ synced_count: number;
11965
+ }[];
11966
+ sync_status?: string | null | undefined;
11967
+ last_sync_at?: string | null | undefined;
11968
+ backfill_window?: number | null | undefined;
11969
+ backfill_since?: string | null | undefined;
11970
+ sync_workspace_ext_id?: string | null | undefined;
11971
+ sync_folders?: string[] | null | undefined;
11972
+ skip_duplicates?: boolean | null | undefined;
11973
+ auto_rename?: boolean | null | undefined;
11974
+ shared?: boolean | null | undefined;
11975
+ auto_sync?: boolean | null | undefined;
11976
+ drive_sync_status?: string | null | undefined;
11977
+ drive_last_sync_at?: string | null | undefined;
11978
+ drive_sync_workspace_ext_id?: string | null | undefined;
11979
+ drive_sync_folders?: string[] | null | undefined;
11980
+ drive_skip_duplicates?: boolean | null | undefined;
11981
+ drive_auto_rename?: boolean | null | undefined;
11982
+ drive_shared?: boolean | null | undefined;
11983
+ drive_auto_sync?: boolean | null | undefined;
11984
+ drive_needs_reconsent?: boolean | null | undefined;
11985
+ }[]>;
11986
+ disconnect: (vendor: string) => Promise<void>;
11987
+ /** The provider consent URL; the OAuth comes back to `returnTo` (a path of this app). */
11988
+ authorize: (vendor: string, returnTo?: string) => Promise<string>;
11989
+ /**
11990
+ * Let this server session use the user's connector grants (best effort: a failure is logged,
11991
+ * never thrown, so it cannot break a sign-in or a connect). Signed out: nothing to bridge.
11992
+ */
11993
+ bridgeTokens: (options?: BridgeTokensOptions) => Promise<void>;
11994
+ mailboxFolders: (vendor: string) => Promise<{
11995
+ id: string;
11996
+ name: string;
11997
+ count?: number | null | undefined;
11998
+ selectable: boolean;
11999
+ }[]>;
12000
+ enableMailboxSync: (vendor: string, body: EnableMailboxSyncBody) => Promise<{
12001
+ id: string;
12002
+ vendor_key: string;
12003
+ target_workspace_id: number;
12004
+ backfill_window: number;
12005
+ backfill_since?: string | null | undefined;
12006
+ backfill_state: string;
12007
+ enabled: boolean;
12008
+ status: string;
12009
+ folders: string[];
12010
+ skip_duplicates: boolean;
12011
+ auto_rename: boolean;
12012
+ shared: boolean;
12013
+ auto_sync: boolean;
12014
+ last_sync_at?: string | null | undefined;
12015
+ }>;
12016
+ syncMailbox: (vendor: string, workspaceExtId?: string | null) => Promise<{
12017
+ status: string;
12018
+ estimated_count?: number | null | undefined;
12019
+ }>;
12020
+ mailboxSyncProgress: (vendor: string, workspaceExtId: string) => Promise<{
12021
+ running: boolean;
12022
+ phase?: string | null | undefined;
12023
+ processed: number;
12024
+ total?: number | null | undefined;
12025
+ }>;
12026
+ cancelMailboxSync: (vendor: string, workspaceExtId: string) => Promise<void>;
12027
+ driveFolders: (vendor: string) => Promise<{
12028
+ id: string;
12029
+ name: string;
12030
+ count?: number | null | undefined;
12031
+ selectable: boolean;
12032
+ }[]>;
12033
+ driveFolderChildren: (vendor: string, itemId: string) => Promise<{
12034
+ id: string;
12035
+ name: string;
12036
+ count?: number | null | undefined;
12037
+ selectable: boolean;
12038
+ }[]>;
12039
+ driveFolderDocCount: (vendor: string, itemId: string) => Promise<number>;
12040
+ enableDriveSync: (vendor: string, body: EnableDriveSyncBody) => Promise<void>;
12041
+ syncDrive: (vendor: string) => Promise<{
12042
+ status: string;
12043
+ estimated_count?: number | null | undefined;
12044
+ }>;
12045
+ driveSyncEstimate: (vendor: string) => Promise<{
12046
+ estimated_count?: number | null | undefined;
12047
+ }>;
12048
+ driveSyncProgress: (vendor: string) => Promise<{
12049
+ running: boolean;
12050
+ phase?: string | null | undefined;
12051
+ processed: number;
12052
+ total?: number | null | undefined;
12053
+ summary?: {
12054
+ finished_at: string;
12055
+ ingested: number;
12056
+ attempted: number;
12057
+ skipped: {
12058
+ name: string;
12059
+ reason: string;
12060
+ }[];
12061
+ } | null | undefined;
12062
+ }>;
12063
+ cancelDriveSync: (vendor: string) => Promise<void>;
12064
+ slack: {
12065
+ status: () => Promise<SlackConnectionStatus>;
12066
+ authorize: (agentExtId: string) => Promise<string>;
12067
+ disconnect: () => Promise<void>;
12068
+ };
12069
+ };
10190
12070
  readonly settings: {
10191
12071
  get: () => Promise<{
10192
12072
  [x: string]: unknown;
@@ -12479,4 +14359,4 @@ declare namespace identity {
12479
14359
  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 };
12480
14360
  }
12481
14361
 
12482
- export { type CommandDescriptor as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalendarAccount as D, type CalendarAccountKind as E, type CalendarCreateBody as F, type CalendarEvent as G, type CalendarKeys as H, type CalendarRead as I, type CalendarSettings as J, type CalendarSettingsBody as K, type CalendarUpdate as L, type CalendarWindow as M, type ChatAttachmentFile as N, type ChatAttachmentInput as O, type ChatCryptoContext as P, type ChatKeyRing as Q, type ChatKind as R, type ChatMemberKey as S, type ChatMemberResponse as T, type ChatMessageResponse as U, type ChatResponse as V, type ChatSession as W, type CitationSummary as X, type CitationToolSources as Y, type CliConfig as Z, type CliCredentials as _, type AccountSyncResult as a, type ProjectConversationUsageResponse as a$, type ConfigStore as a0, type ConnectOptions as a1, type ConversationResponse as a2, type ConversationUsageResponse as a3, type CreateFactRequest as a4, type CreateFactsRequest as a5, type CreateWorkRequest as a6, type CreateWorkflowRequest as a7, DEFAULT_AI_USD_PER_GBP as a8, DOC_TERMINAL_STATUSES as a9, type IdentityErrorCode as aA, type IdentityPurchase as aB, type IdentityState as aC, type IdentityStatus as aD, type ImportResult as aE, type InvitationRead as aF, type LinkedRun as aG, type ListAllOptions as aH, type ListEventsParams as aI, type ListFactsOptions as aJ, type ListPaginatedOptions as aK, type MailAttachment as aL, type MailDraftSSEEvent as aM, type MessageLevel as aN, type MessageMetadataPayload$1 as aO, type MessageQueuedEvent as aP, type OAuthAccountKind as aQ, type OutputTokensDetails as aR, type OverlayItem as aS, type OverlayLayerName as aT, type ParsedSlashCommand as aU, type PendingAuthResponse as aV, type PersonKey as aW, PlanStepsError as aX, type PlanWorkRequest as aY, type ProbeAnswerEvent as aZ, type ProjectBudget as a_, type DateTimeSpec as aa, type DecryptedChat as ab, type DecryptedChatMessage as ac, type DeferredInterjectionEvent as ad, type DeploymentHouseTemplate as ae, type DocNameMap as af, type DocumentAutomationAction as ag, type DocumentListFields as ah, type DocumentListOrder as ai, type DocumentSelector as aj, type DocumentWaiter as ak, type DocumentWaiterOptions as al, type EditScope as am, type EventCreateBody as an, type EventPatchBody as ao, FLAT_TAG_KINDS as ap, type FactResponse as aq, type FactSearchRequest as ar, type FactSearchResponse as as, type FeedCreateBody as at, type FeedLevel as au, type FindTimeParams as av, type FormattedWsMessage as aw, type FreeBusyEntry as ax, type HolidayCountry as ay, type HouseTemplateCandidate as az, type ActivityKind as b, type TagKindSchema as b$, type ProjectDetails as b0, type ProjectEventKind as b1, type ProjectEventResponse as b2, type ProjectInvoicesResponse as b3, type ProjectResponse as b4, type ProjectUpdateRequest as b5, type ProjectUsageResponse as b6, PublicBookingError as b7, type PublicBookingPage as b8, type QueryOptions as b9, STEP_FIELD_OPTION_TONES as bA, SUPPORTED_EXTENSIONS as bB, type ScopedTarget as bC, type SendBack as bD, type ShareRead as bE, type ShareRole as bF, type SkillSummary as bG, type SkippedFile as bH, type StepActionRequest as bI, type StepActivityEvent as bJ, type StepAssignee as bK, type StepField as bL, type StepFieldOption as bM, type StepFieldOptionTone as bN, type StepKind as bO, type StepPhase as bP, type StepSignal as bQ, type StepSignalWhen as bR, type StepState as bS, type StepStatus as bT, type SubmitBackgroundQueryOptions as bU, type SubscribeParams as bV, TAG_KINDS as bW, type TagChange as bX, type TagFieldDefinition as bY, type TagKind as bZ, type TagKindField as b_, type RaisedSignal as ba, type ReconnectOptions as bb, type ReconnectableWsConnection as bc, type ResolvedCitation as bd, type ResolvedRecipient as be, type RespondParams as bf, type RespondPartstat as bg, type ResponseCompletedEvent as bh, type ResponseContentPartAddedEvent as bi, type ResponseCreatedEvent as bj, type ResponseFailedEvent as bk, type ResponseOutputItemAddedEvent as bl, type ResponseOutputItemDoneEvent as bm, type ResponseOutputTextDeltaEvent as bn, type ResponseOutputTextDoneEvent as bo, type ResponseUsage as bp, type RoomCreateBody as bq, type RoomQuery as br, type RoomRead as bs, type RunProgress as bt, type RunStep as bu, type RunWaitingOn as bv, type SSEEvent as bw, type SSEStreamCallbacks as bx, type SSEStreamResult as by, type SSEStreamStartData as bz, type ActivityResponse as c, formatStreamSummary as c$, type TagLinks as c0, type TagListQuery as c1, type TagResponse as c2, type TaskPlan as c3, type TaskPlanStep as c4, type TimeSuggestion as c5, type TokenBudgetContext as c6, type UpdateConversationRequest as c7, type UpdateFactRequest as c8, type UpdateWorkflowRequest as c9, buildCitationChunkData as cA, buildDocNameMap as cB, buildFactsContextTool as cC, buildRetrievalChunkTool as cD, buildRetrievalFullContextTool as cE, buildRetrievalTocTool as cF, calendar as cG, cancelPublicBooking as cH, chats as cI, connectWebSocket as cJ, connectWithReconnect as cK, consumeSSEStream as cL, contacts as cM, conversations as cN, countCitations as cO, createAuthenticatedClient as cP, createDocumentWaiter as cQ, doctags as cR, documents as cS, facts as cT, files as cU, filterSkills as cV, formatAgentStepLabel as cW, formatFileSize as cX, formatGbp as cY, formatGbpPerMillionTokens as cZ, formatItemLabel as c_, type UploadBatchResult as ca, type UploadDirectOptions as cb, type UploadDirectResult as cc, type UploadDocumentsOptions as cd, type UploadOptions as ce, type UploadResult as cf, type UsageBreakdown as cg, type UserDailyUsageResponse as ch, type UserInfo as ci, type UserInputRequestEvent as cj, type UserMessageEvent as ck, WebSocketAuthError as cl, type WeeklyHoursSpec as cm, type WorkStatus as cn, type WorkflowAuthMode as co, type WorkflowResponse as cp, type WorkflowRunHistoryResponse as cq, type WorkflowRunResponse as cr, type WorkspaceContext as cs, type WsConnection as ct, account as cu, agentconfig as cv, agents as cw, assistant as cx, authenticatedFetch as cy, bookPublicSlot as cz, type AgentControlStateEvent as d, formatUserName as d0, formatWorkspaceChoices as d1, formatWsMessage as d2, generateEncryptedWorkspaceKey as d3, generateNewWorkspaceKey as d4, getErrorCode as d5, getErrorMessage as d6, getPublicBookingPage as d7, getRawWorkspaceKey as d8, health as d9, splitAppPasswords as dA, streamSSE as dB, stripCitationMarkdown as dC, summarizeCitations as dD, tags as dE, uploadSkill as dF, usdToGbp as dG, work as dH, workflowSteps as dI, workflows as dJ, workspaces as dK, houseTemplate as da, identity as db, identityErrorCode as dc, isSharedSkill as dd, mail as de, notifications as df, parseSSEEvents as dg, parseSlashCommand as dh, parseSlashTokenInProgress as di, performPasswordLogin as dj, performSigningKeyLogin as dk, performSsoDeviceFlowLogin as dl, profile as dm, projects as dn, requireData as dp, requireOk as dq, resolveAuth as dr, resolveCitations as ds, resolveWorkspace as dt, responses as du, selectWorkspace as dv, selectWorkspaceById as dw, sessions as dx, settings as dy, signatureRequests as dz, type AgentStepDeltaEvent as e, type AgentStepEvent as f, type AppPassword as g, type AppPasswordCreateBody as h, type AppPasswordCreated as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiErrorEvent as m, type ArbiHostSession as n, type ArbiOptions as o, ArbiSessionExpiredError as p, type ArtifactEvent as q, type AttendeeRead as r, type AuthContext as s, type AuthHeaders as t, type AuthMode as u, type AuthenticatedClient as v, type BookingPage as w, type BookingPageWriteBody as x, type BookingRequestBody as y, type CalDavProfile as z };
14362
+ export { type ConnectOptions as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalendarCreateBody as D, type CalendarEvent as E, type CalendarKeys as F, type CalendarRead as G, type CalendarSettings as H, type CalendarSettingsBody as I, type CalendarUpdate as J, type CalendarWindow as K, type ChatAttachmentFile as L, type ChatAttachmentInput as M, type ChatCryptoContext as N, type ChatKeyRing as O, type ChatKind as P, type ChatMemberKey as Q, type ChatMemberResponse as R, type ChatMessageResponse as S, type ChatResponse as T, type ChatSession as U, type CitationSummary as V, type CitationToolSources as W, type CliConfig as X, type CliCredentials as Y, type CommandDescriptor as Z, type ConfigStore as _, type AccountSyncResult as a, type OutputTokensDetails as a$, type ConnectorCatalogEntry as a0, type ConnectorFolder as a1, type ConnectorSyncProgress as a2, type ConnectorSyncStatus as a3, type ConnectorVendorKey as a4, type ConnectorVisibilitySettings as a5, type ConversationResponse as a6, type ConversationUsageResponse as a7, type CreateFactRequest as a8, type CreateFactsRequest as a9, type FindTimeParams as aA, type FormattedWsMessage as aB, type FreeBusyEntry as aC, GOOGLE_VENDORS as aD, type HolidayCountry as aE, type HouseTemplateCandidate as aF, IMANAGE_VENDORS as aG, type IdentityErrorCode as aH, type IdentityPurchase as aI, type IdentityState as aJ, type IdentityStatus as aK, type ImportResult as aL, type InvitationRead as aM, type LinkedRun as aN, type ListAllOptions as aO, type ListEventsParams as aP, type ListFactsOptions as aQ, type ListPaginatedOptions as aR, MAILBOX_SYNC_VENDORS as aS, MAX_RETRIEVE_DOC_IDS as aT, MICROSOFT_VENDORS as aU, type MailAttachment as aV, type MailDraftSSEEvent as aW, type MessageLevel as aX, type MessageMetadataPayload$1 as aY, type MessageQueuedEvent as aZ, type OAuthAccountKind as a_, type CreateWorkRequest as aa, type CreateWorkflowRequest as ab, DEFAULT_AI_USD_PER_GBP as ac, DOC_TERMINAL_STATUSES as ad, DRIVE_SYNC_VENDORS as ae, type DateTimeSpec as af, type DecryptedChat as ag, type DecryptedChatMessage as ah, type DeferredInterjectionEvent as ai, type DeploymentHouseTemplate as aj, type DocNameMap as ak, type DocumentAutomationAction as al, type DocumentListFields as am, type DocumentListOrder as an, type DocumentSelector as ao, type DocumentWaiter as ap, type DocumentWaiterOptions as aq, type DriveSyncProgress as ar, type DriveSyncSummary as as, type EditScope as at, type EventCreateBody as au, type EventPatchBody as av, FLAT_TAG_KINDS as aw, type FactResponse as ax, type FactSearchRequest as ay, type FactSearchResponse as az, type ActivityKind as b, type SkippedFile as b$, type OverlayItem as b0, type OverlayLayerName as b1, type ParsedSlashCommand as b2, type PendingAuthResponse as b3, type PersonKey as b4, PlanStepsError as b5, type PlanWorkRequest as b6, type ProbeAnswerEvent as b7, type ProductResponse as b8, type ProjectAddonKind as b9, type ResponseContentPartAddedEvent as bA, type ResponseCreatedEvent as bB, type ResponseFailedEvent as bC, type ResponseOutputItemAddedEvent as bD, type ResponseOutputItemDoneEvent as bE, type ResponseOutputTextDeltaEvent as bF, type ResponseOutputTextDoneEvent as bG, type ResponseUsage as bH, type RoomCreateBody as bI, type RoomQuery as bJ, type RoomRead as bK, type RunProgress as bL, type RunStep as bM, type RunWaitingOn as bN, SHAREPOINT_VENDORS as bO, type SSEEvent as bP, type SSEStreamCallbacks as bQ, type SSEStreamResult as bR, type SSEStreamStartData as bS, STEP_FIELD_OPTION_TONES as bT, SUPPORTED_EXTENSIONS as bU, type ScopedTarget as bV, type SearchChunk as bW, type SendBack as bX, type ShareRead as bY, type ShareRole as bZ, type SkillSummary as b_, type ProjectAddonSettingsRequest as ba, type ProjectBudget as bb, type ProjectCheckoutRequest as bc, type ProjectConversationUsageResponse as bd, type ProjectCreateOptions as be, type ProjectDetails as bf, type ProjectEventKind as bg, type ProjectEventResponse as bh, type ProjectInvoicesResponse as bi, type ProjectNextPeriodAddonsRequest as bj, type ProjectPlanChangeRequest as bk, type ProjectQuoteRequest as bl, type ProjectResponse as bm, type ProjectUpdateRequest as bn, type ProjectUsageResponse as bo, PublicBookingError as bp, type PublicBookingPage as bq, type QueryOptions as br, type RaisedSignal as bs, type ReconnectOptions as bt, type ReconnectableWsConnection as bu, type ResolvedCitation as bv, type ResolvedRecipient as bw, type RespondParams as bx, type RespondPartstat as by, type ResponseCompletedEvent as bz, type ActivityResponse as c, buildRetrievalChunkTool as c$, type SlackConnectionStatus as c0, type StepActionRequest as c1, type StepActivityEvent as c2, type StepAssignee as c3, type StepField as c4, type StepFieldOption as c5, type StepFieldOptionTone as c6, type StepKind as c7, type StepPhase as c8, type StepSignal as c9, type UploadDocumentsOptions as cA, type UploadOptions as cB, type UploadResult as cC, type UsageBreakdown as cD, type UserConnectorEntry as cE, type UserDailyUsageResponse as cF, type UserInfo as cG, type UserInputRequestEvent as cH, type UserMessageEvent as cI, WebSocketAuthError as cJ, type WeeklyHoursSpec as cK, type WorkStatus as cL, type WorkflowAuthMode as cM, type WorkflowResponse as cN, type WorkflowRunHistoryResponse as cO, type WorkflowRunResponse as cP, type WorkspaceContext as cQ, type WsConnection as cR, account as cS, agentconfig as cT, agents as cU, assistant as cV, authenticatedFetch as cW, bookPublicSlot as cX, buildCitationChunkData as cY, buildDocNameMap as cZ, buildFactsContextTool as c_, type StepSignalWhen as ca, type StepState as cb, type StepStatus as cc, type SubmitBackgroundQueryOptions as cd, type SubscribeParams as ce, type SyncTriggerResult as cf, TAG_KINDS as cg, type TagChange as ch, type TagFieldDefinition as ci, type TagKind as cj, type TagKindField as ck, type TagKindSchema as cl, type TagLinks as cm, type TagListQuery as cn, type TagResponse as co, type TaskPlan as cp, type TaskPlanStep as cq, type TaxQuoteResponse as cr, type TimeSuggestion as cs, type TokenBudgetContext as ct, type UpdateConversationRequest as cu, type UpdateFactRequest as cv, type UpdateWorkflowRequest as cw, type UploadBatchResult as cx, type UploadDirectOptions as cy, type UploadDirectResult as cz, type AgentControlStateEvent as d, selectWorkspaceById as d$, buildRetrievalFullContextTool as d0, buildRetrievalTocTool as d1, calendar as d2, cancelPublicBooking as d3, chats as d4, connectErrorMessage as d5, connectWebSocket as d6, connectWithReconnect as d7, connectors as d8, consumeSSEStream as d9, health as dA, houseTemplate as dB, identity as dC, identityErrorCode as dD, isConnectorVendorVisible as dE, isDriveSyncVendor as dF, isMailboxSyncVendor as dG, isSharePointVendor as dH, isSharedSkill as dI, mail as dJ, notifications as dK, parseSSEEvents as dL, parseSlashCommand as dM, parseSlashTokenInProgress as dN, performPasswordLogin as dO, performSigningKeyLogin as dP, performSsoDeviceFlowLogin as dQ, profile as dR, projects as dS, requireData as dT, requireOk as dU, resolveAuth as dV, resolveCitations as dW, resolveWorkspace as dX, responses as dY, searchChunks as dZ, selectWorkspace as d_, contacts as da, conversations as db, countCitations as dc, createAuthenticatedClient as dd, createDocumentWaiter as de, doctags as df, documents as dg, facts as dh, files as di, filterSkills as dj, formatAgentStepLabel as dk, formatFileSize as dl, formatGbp as dm, formatGbpPerMillionTokens as dn, formatItemLabel as dp, formatStreamSummary as dq, formatUserName as dr, formatWorkspaceChoices as ds, formatWsMessage as dt, generateEncryptedWorkspaceKey as du, generateNewWorkspaceKey as dv, getErrorCode as dw, getErrorMessage as dx, getPublicBookingPage as dy, getRawWorkspaceKey as dz, type AgentStepDeltaEvent as e, sessions as e0, settings as e1, signatureRequests as e2, streamSSE as e3, stripCitationMarkdown as e4, summarizeCitations as e5, tags as e6, uploadSkill as e7, usdToGbp as e8, work as e9, workflowSteps as ea, workflows as eb, workspaces as ec, type AgentStepEvent as f, Arbi as g, ArbiApiError as h, ArbiError as i, type ArbiErrorEvent as j, type ArbiHostSession as k, type ArbiOptions as l, ArbiSessionExpiredError as m, type ArtifactEvent as n, type AttendeeRead as o, type AuthContext as p, type AuthHeaders as q, type AuthMode as r, type AuthenticatedClient as s, type BookingPage as t, type BookingPageWriteBody as u, type BookingRequestBody as v, type BridgeTokensOptions as w, type CalDavProfile as x, type CalendarAccount as y, type CalendarAccountKind as z };