@arbidocs/sdk 0.5.60 → 0.5.62

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.
@@ -43,6 +43,28 @@ declare class ArbiWorkspaceChangedError extends ArbiError {
43
43
  readonly workspaceId: string;
44
44
  constructor(workspaceId: string, doing?: string);
45
45
  }
46
+ /**
47
+ * A workspace a request needs could not be made usable on this session: its key could not be
48
+ * deposited (`/prime-key`), e.g. access to it was removed or nobody is signed in yet. Nothing was
49
+ * sent, so nothing was written anywhere else.
50
+ */
51
+ declare class ArbiWorkspaceUnavailableError extends ArbiError {
52
+ readonly workspaceId: string;
53
+ constructor(workspaceId: string, cause?: unknown, message?: string);
54
+ }
55
+ /**
56
+ * A 409 that names the workspace a request needs:
57
+ * - `workspace_key_required`: that workspace's key is not on this session (deposit it with
58
+ * `/prime-key`, then send the request again: nothing was written);
59
+ * - `workspace_mismatch`: a chat follow-up named a workspace other than its thread's, which the
60
+ * 409 names (nothing was written).
61
+ */
62
+ interface WorkspaceConflict {
63
+ code: 'workspace_key_required' | 'workspace_mismatch';
64
+ workspaceId: string;
65
+ }
66
+ /** The {@link WorkspaceConflict} an error (or an error response body) carries, else null. */
67
+ declare function workspaceConflictOf(error: unknown): WorkspaceConflict | null;
46
68
  declare class ArbiApiError extends ArbiError {
47
69
  readonly status?: number;
48
70
  readonly apiError?: unknown;
@@ -870,6 +892,72 @@ type ResponseStart = {
870
892
  outcome: SSEStreamOutcome;
871
893
  };
872
894
 
895
+ type JsonSchemaOutputFormat = components['schemas']['JsonSchemaFormat'];
896
+ type StructuredResponse = components['schemas']['ResponsesAPIResponse'];
897
+ interface ParsedStructuredResponse<T> {
898
+ data: T;
899
+ /** Original Responses envelope, including output, metadata, usage and extensions. */
900
+ response: StructuredResponse;
901
+ }
902
+ declare class ArbiStructuredOutputError extends ArbiError {
903
+ readonly response: unknown;
904
+ constructor(message: string, response: unknown, options: ArbiErrorOptions);
905
+ }
906
+ /** Validate the stored/final response of a background or streaming request against its schema. */
907
+ declare function parseStructuredResponse<T = unknown>(response: StructuredResponse, format: JsonSchemaOutputFormat): Promise<ParsedStructuredResponse<T>>;
908
+
909
+ /** Standard Responses conveniences over the existing message observer. */
910
+
911
+ type ResponseCreateRequest = Omit<components['schemas']['MessageInput'], 'workspace_ext_id' | 'stream' | 'background' | 'store'> & {
912
+ workspace_ext_id?: string;
913
+ stream?: boolean;
914
+ background?: boolean;
915
+ store?: boolean;
916
+ };
917
+ type Response$1 = StructuredResponse & {
918
+ output_text: string;
919
+ _request_id?: string;
920
+ };
921
+ type ParsedResponse<T> = Response$1 & {
922
+ output_parsed: T;
923
+ };
924
+ type ResponseCreateResult<Streaming extends boolean | undefined> = Streaming extends true ? ResponseStream : Response$1;
925
+ type Schema = components['schemas'];
926
+ type ResponseStreamEvent = ({
927
+ type: 'response.created';
928
+ } & Schema['ResponseCreatedEvent']) | ({
929
+ type: 'response.output_text.delta';
930
+ } & Schema['ResponseOutputTextDeltaEvent']) | ({
931
+ type: 'response.output_text.done';
932
+ } & Schema['ResponseOutputTextDoneEvent']) | ({
933
+ type: 'response.output_item.added';
934
+ } & Schema['ResponseOutputItemAddedEvent']) | ({
935
+ type: 'response.output_item.done';
936
+ } & Schema['ResponseOutputItemDoneEvent']) | ({
937
+ type: 'response.content_part.added';
938
+ } & Schema['ResponseContentPartAddedEvent']) | ({
939
+ type: 'response.completed';
940
+ } & Schema['ResponseCompletedEvent']) | ({
941
+ type: 'response.failed';
942
+ } & Schema['ResponseFailedEvent']) | {
943
+ type: 'response.in_progress' | 'response.queued' | 'response.cancelled' | 'response.incomplete';
944
+ response: StructuredResponse;
945
+ [key: string]: unknown;
946
+ } | {
947
+ type: 'response.function_call_arguments.delta';
948
+ delta: string;
949
+ [key: string]: unknown;
950
+ } | {
951
+ type: `arbi.${string}` | 'error';
952
+ [key: string]: unknown;
953
+ };
954
+ /** Async iteration is the default; handle is the opt-in ARBI lifecycle extension. */
955
+ declare class ResponseStream implements AsyncIterable<ResponseStreamEvent> {
956
+ readonly handle: ResponseHandle;
957
+ constructor(handle: ResponseHandle);
958
+ [Symbol.asyncIterator](): AsyncIterator<ResponseStreamEvent>;
959
+ }
960
+
873
961
  /**
874
962
  * Document operations — browser-safe functions.
875
963
  *
@@ -1459,6 +1547,13 @@ interface UploadDirectOptions {
1459
1547
  * - `loaded` / `total` are bytes of the *ciphertext* (= raw + 40).
1460
1548
  */
1461
1549
  onBytesProgress?: (progress: DirectUploadProgress) => void;
1550
+ /**
1551
+ * Runs each of the two server requests (init, commit). `upload-init` and `upload-commit` name no
1552
+ * workspace yet (they act on the session's open one), so a caller that encrypts with a workspace's
1553
+ * key passes a guard that refuses to send, or to keep the answer, unless that workspace is the
1554
+ * one open (`Arbi.documents.uploadDirect` does: `readInWorkspace`).
1555
+ */
1556
+ inWorkspace?: <T>(send: () => Promise<T>) => Promise<T>;
1462
1557
  }
1463
1558
  interface DirectUploadProgress {
1464
1559
  fileIndex: number;
@@ -3319,6 +3414,8 @@ interface TurnRequest {
3319
3414
  agentId?: string;
3320
3415
  /** The config (model) to answer with. */
3321
3416
  model?: string | null;
3417
+ /** Responses output configuration, scoped to this turn. */
3418
+ text?: MessageInput$2['text'];
3322
3419
  /** Structured @mentions in the question. */
3323
3420
  mentions?: MessageInput$2['mentions'];
3324
3421
  /** The mode a NEW conversation starts in. */
@@ -3474,6 +3571,12 @@ declare const SESSION_EXPIRED_MESSAGE = "Token has expired. Please log in again.
3474
3571
  declare function quotaExceededFrom(detail: unknown): QuotaExceeded | null;
3475
3572
  /** A stream error that is LiteLLM's ExceededBudget, read as {@link QuotaExceeded} (in £). */
3476
3573
  declare function quotaFromStreamError(error: unknown): QuotaExceeded | null;
3574
+ /** Why the server refused a turn, retaining its structured reason and request ID. */
3575
+ /** What a turn refused for its workspace says (nothing was written either way). */
3576
+ declare const WORKSPACE_CONFLICT_MESSAGES: {
3577
+ readonly workspace_mismatch: "This conversation belongs to another workspace, so the reply was not sent. Open that workspace to continue it.";
3578
+ readonly workspace_key_required: "This chat's workspace isn't open in this session, so the message was not sent. Open the workspace and try again.";
3579
+ };
3477
3580
  /**
3478
3581
  * Open a turn's stream (`POST /v1/responses` with a built body). A 401 throws the
3479
3582
  * `ArbiApiError` the session recovery renews the token on; any other refusal throws
@@ -3620,6 +3723,7 @@ type assistant_RetrieveResult = RetrieveResult;
3620
3723
  declare const assistant_SESSION_EXPIRED_MESSAGE: typeof SESSION_EXPIRED_MESSAGE;
3621
3724
  type assistant_SearchChunk = SearchChunk;
3622
3725
  type assistant_SkillSummary = SkillSummary;
3726
+ declare const assistant_WORKSPACE_CONFLICT_MESSAGES: typeof WORKSPACE_CONFLICT_MESSAGES;
3623
3727
  declare const assistant_cancelRun: typeof cancelRun;
3624
3728
  declare const assistant_filterSkills: typeof filterSkills;
3625
3729
  declare const assistant_interject: typeof interject;
@@ -3638,7 +3742,7 @@ declare const assistant_searchChunks: typeof searchChunks;
3638
3742
  declare const assistant_transcribe: typeof transcribe;
3639
3743
  declare const assistant_uploadSkill: typeof uploadSkill;
3640
3744
  declare namespace assistant {
3641
- export { type assistant_AssistantQueryOptions as AssistantQueryOptions, assistant_AssistantTurnRefused as AssistantTurnRefused, 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_QuotaExceeded as QuotaExceeded, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, assistant_SESSION_EXPIRED_MESSAGE as SESSION_EXPIRED_MESSAGE, type assistant_SearchChunk as SearchChunk, type assistant_SkillSummary as SkillSummary, assistant_cancelRun as cancelRun, assistant_filterSkills as filterSkills, assistant_interject as interject, assistant_isSharedSkill as isSharedSkill, assistant_listCommands as listCommands, assistant_listSkills as listSkills, assistant_openRunStream as openRunStream, assistant_openTurnStream as openTurnStream, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_quotaExceededFrom as quotaExceededFrom, assistant_quotaFromStreamError as quotaFromStreamError, assistant_retrieve as retrieve, assistant_searchChunks as searchChunks, assistant_transcribe as transcribe, assistant_uploadSkill as uploadSkill };
3745
+ export { type assistant_AssistantQueryOptions as AssistantQueryOptions, assistant_AssistantTurnRefused as AssistantTurnRefused, 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_QuotaExceeded as QuotaExceeded, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, assistant_SESSION_EXPIRED_MESSAGE as SESSION_EXPIRED_MESSAGE, type assistant_SearchChunk as SearchChunk, type assistant_SkillSummary as SkillSummary, assistant_WORKSPACE_CONFLICT_MESSAGES as WORKSPACE_CONFLICT_MESSAGES, assistant_cancelRun as cancelRun, assistant_filterSkills as filterSkills, assistant_interject as interject, assistant_isSharedSkill as isSharedSkill, assistant_listCommands as listCommands, assistant_listSkills as listSkills, assistant_openRunStream as openRunStream, assistant_openTurnStream as openTurnStream, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_quotaExceededFrom as quotaExceededFrom, assistant_quotaFromStreamError as quotaFromStreamError, assistant_retrieve as retrieve, assistant_searchChunks as searchChunks, assistant_transcribe as transcribe, assistant_uploadSkill as uploadSkill };
3642
3746
  }
3643
3747
 
3644
3748
  /**
@@ -3657,6 +3761,7 @@ interface SubmitBackgroundQueryOptions extends AuthHeaders {
3657
3761
  docIds: string[];
3658
3762
  previousResponseId?: string | null;
3659
3763
  model?: string;
3764
+ text?: MessageInput['text'];
3660
3765
  task?: MessageInput['task'];
3661
3766
  conversationId?: string;
3662
3767
  mentions?: MessageInput['mentions'];
@@ -8008,6 +8113,11 @@ interface AskHandlers extends Omit<SSEStreamCallbacks, 'onError' | 'onArbiError'
8008
8113
  onError?: (error: string | Error) => void;
8009
8114
  /** The project's AI usage is used up (refused with a 402, or cut off mid-stream). */
8010
8115
  onQuotaExceeded?: (quota: QuotaExceeded) => void;
8116
+ /**
8117
+ * The workspace the turn was accepted in: the one it named, or, for a follow-up refused because
8118
+ * its thread is in another workspace, the thread's (the turn is sent once more there).
8119
+ */
8120
+ onWorkspace?: (workspaceId: string) => void;
8011
8121
  }
8012
8122
  declare class Arbi {
8013
8123
  private client;
@@ -8127,8 +8237,25 @@ declare class Arbi {
8127
8237
  * Make a workspace usable for requests that name it, WITHOUT changing the current workspace (on
8128
8238
  * the server or here): its key, sealed to this server session, is deposited with `/prime-key`
8129
8239
  * (the client's `workspaceKeys.prime`: once per server session). The current workspace is open.
8240
+ * A workspace the user holds no key for (a public one, or a temporary grant whose key the server
8241
+ * session already holds) has nothing to deposit: the server answers for it as it is.
8130
8242
  */
8131
8243
  private openWorkspace;
8244
+ /**
8245
+ * {@link openWorkspace} (or, with `force`, deposit the key again even for the current workspace:
8246
+ * the server said it lacks it), failing with {@link ArbiWorkspaceUnavailableError} when the key
8247
+ * cannot be deposited. Then nothing is sent, so nothing can land in another workspace.
8248
+ */
8249
+ private primeOrFail;
8250
+ /**
8251
+ * Open a chat turn's stream in `workspaceId` (captured by the caller when the turn started): the
8252
+ * workspace is opened for this session first if it is not the current one, and the body names
8253
+ * it, so a switch meanwhile cannot move the turn. A follow-up refused with 409
8254
+ * `workspace_mismatch` (its thread is in another workspace: nothing was written) is sent once
8255
+ * more in the thread's workspace, which is where the server stores a follow-up anyway.
8256
+ * `onWorkspace` hears the workspace the turn was accepted in.
8257
+ */
8258
+ private openTurn;
8132
8259
  /**
8133
8260
  * Create a tag in `workspaceId`, named on the request: a switch while it is sent cannot move it to the workspace
8134
8261
  * opened next, and a workspace other than the current one is opened for this session first.
@@ -10738,6 +10865,16 @@ declare class Arbi {
10738
10865
  * (`ArbiWorkspaceChangedError`) instead of sending it to the new one.
10739
10866
  */
10740
10867
  uploadFile: (fileData: Blob, fileName: string, options?: UploadOptions) => Promise<UploadResult>;
10868
+ /**
10869
+ * Upload files straight to storage, encrypted here with `workspaceKey` (`uploadDocumentsDirect`),
10870
+ * into `workspaceId`, which must be the workspace open NOW. `upload-init` and `upload-commit`
10871
+ * name no workspace yet (they act on the session's open one), so each runs under
10872
+ * `readInWorkspace`: it is not sent, or its answer not kept, unless `workspaceId` is open when
10873
+ * it is sent and still when it returns. A switch refuses the upload
10874
+ * (`ArbiWorkspaceChangedError`) instead of storing files encrypted with one workspace's key in
10875
+ * another. For any other workspace use `upload` with `workspaceExtId`, which names it.
10876
+ */
10877
+ uploadDirect: (workspaceId: string, workspaceKey: Uint8Array, files: DirectUploadFile[], options?: Omit<UploadDirectOptions, "inWorkspace">) => Promise<UploadDirectResult>;
10741
10878
  /** Download a document's original file — its current version, or `version`. */
10742
10879
  download: (docId: string, version?: number) => Promise<Response>;
10743
10880
  getParsedContent: (docId: string, stage: string, version?: number) => Promise<Record<string, unknown>>;
@@ -12004,9 +12141,43 @@ declare class Arbi {
12004
12141
  unlockNative: () => Promise<void>;
12005
12142
  };
12006
12143
  private openResponseHandle;
12144
+ /** Canonical Responses-shaped requests; existing assistant convenience helpers remain supported. */
12145
+ readonly responses: {
12146
+ create: <Streaming extends boolean | undefined = false>(request: Omit<ResponseCreateRequest, "stream"> & {
12147
+ stream?: Streaming;
12148
+ }, options?: {
12149
+ signal?: AbortSignal;
12150
+ }) => Promise<ResponseCreateResult<Streaming>>;
12151
+ parse: <T = unknown>(request: Omit<ResponseCreateRequest, "stream" | "background" | "text"> & {
12152
+ stream?: false;
12153
+ background?: false;
12154
+ text: {
12155
+ format: JsonSchemaOutputFormat;
12156
+ };
12157
+ }, options?: {
12158
+ signal?: AbortSignal;
12159
+ }) => Promise<ParsedResponse<T>>;
12160
+ stream: (request: Omit<components["schemas"]["MessageInput"], "workspace_ext_id" | "stream" | "background" | "store"> & {
12161
+ workspace_ext_id?: string;
12162
+ store?: boolean;
12163
+ }, options?: ResponseStartOptions) => Promise<ResponseStart>;
12164
+ retrieve: (id: string) => Promise<Response$1>;
12165
+ cancel: (id: string) => Promise<void>;
12166
+ attach: (id: string, options?: ResponseStartOptions) => Promise<ResponseHandle>;
12167
+ };
12007
12168
  readonly assistant: {
12169
+ /** Create one synchronous Responses result and return validated JSON alongside the raw response. */
12170
+ parseResponse: <T = unknown>(request: AskRequest & {
12171
+ text: {
12172
+ format: JsonSchemaOutputFormat;
12173
+ };
12174
+ }, options?: {
12175
+ signal?: AbortSignal;
12176
+ }) => Promise<ParsedStructuredResponse<T>>;
12008
12177
  /** Start one response with a composable observer; existing ask callbacks remain unchanged. */
12009
- startResponse: (request: AskRequest, options?: ResponseStartOptions) => Promise<ResponseStart>;
12178
+ startResponse: (request: AskRequest, options?: ResponseStartOptions & {
12179
+ onWorkspace?: (workspaceId: string) => void;
12180
+ }) => Promise<ResponseStart>;
12010
12181
  /** Attach to retained replay/live events for an existing msg; never resubmits a turn. */
12011
12182
  attachResponse: (id: string, options?: ResponseStartOptions) => Promise<ResponseHandle>;
12012
12183
  /**
@@ -12044,7 +12215,10 @@ declare class Arbi {
12044
12215
  /** Transcribe a voice recording to text (empty when no speech was found). */
12045
12216
  transcribe: (audio: Blob) => Promise<string>;
12046
12217
  /** Start a durable background turn; task options make its thread a work item. */
12047
- submit: (question: string, options: Omit<SubmitBackgroundQueryOptions, keyof AuthHeaders | "workspaceId" | "question">) => Promise<{
12218
+ submit: (question: string, options: Omit<SubmitBackgroundQueryOptions, keyof AuthHeaders | "workspaceId" | "question"> & {
12219
+ /** The workspace it runs in (default: the current one); opened for this session first. */
12220
+ workspaceId?: string;
12221
+ }) => Promise<{
12048
12222
  id: string;
12049
12223
  object: "response";
12050
12224
  status: "completed" | "in_progress" | "queued" | "cancelled" | "failed" | "incomplete";
@@ -12056,6 +12230,9 @@ declare class Arbi {
12056
12230
  error?: {
12057
12231
  [key: string]: unknown;
12058
12232
  } | null;
12233
+ incomplete_details?: {
12234
+ [key: string]: unknown;
12235
+ } | null;
12059
12236
  metadata?: {
12060
12237
  [key: string]: unknown;
12061
12238
  } | null;
@@ -12074,6 +12251,9 @@ declare class Arbi {
12074
12251
  error?: {
12075
12252
  [key: string]: unknown;
12076
12253
  } | null;
12254
+ incomplete_details?: {
12255
+ [key: string]: unknown;
12256
+ } | null;
12077
12257
  metadata?: {
12078
12258
  [key: string]: unknown;
12079
12259
  } | null;
@@ -12114,6 +12294,8 @@ declare class Arbi {
12114
12294
  model?: string;
12115
12295
  /** Keep the response server-side (default true). */
12116
12296
  store?: boolean;
12297
+ /** The workspace searched (default: the current one); opened for this session first. */
12298
+ workspaceId?: string;
12117
12299
  }) => Promise<RetrieveResult>;
12118
12300
  };
12119
12301
  readonly tags: {
@@ -17222,4 +17404,35 @@ declare function getAttachableRunId(messages: readonly RunMessage[]): string | n
17222
17404
  */
17223
17405
  declare function getRunToAttach(localGeneration: LocalGeneration | undefined, messages: readonly RunMessage[]): string | null;
17224
17406
 
17225
- export { type CliCredentials as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalendarAccountKind as D, type CalendarCreateBody as E, type CalendarEvent as F, type CalendarKeys as G, type CalendarRead as H, type CalendarSettings as I, type CalendarSettingsBody as J, type CalendarUpdate as K, type CalendarWindow as L, CallApiError 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 ChatMessage as U, type ChatMessageResponse as V, type ChatResponse as W, type ChatSession as X, type CitationSummary as Y, type CitationToolSources as Z, type CliConfig as _, type AccountSyncResult as a, type IdentityState as a$, type CommandDescriptor as a0, type ConfigStore as a1, type ConnectOptions as a2, type ConnectorCatalogEntry as a3, type ConnectorFolder as a4, type ConnectorSyncProgress as a5, type ConnectorSyncStatus as a6, type ConnectorVendorKey as a7, type ConnectorVisibilitySettings as a8, type ContextUsage as a9, type DocumentListFields as aA, type DocumentListOrder as aB, type DocumentSelector as aC, type DocumentWaiter as aD, type DocumentWaiterOptions as aE, type DriveSyncProgress as aF, type DriveSyncSummary as aG, DuplicateContactError as aH, ENTITY_KINDS as aI, type EditScope as aJ, type EntityKind as aK, type EventCreateBody as aL, type EventPatchBody as aM, FLAT_TAG_KINDS as aN, type FactResponse as aO, type FactSearchRequest as aP, type FactSearchResponse as aQ, type FindTimeParams as aR, type FormattedWsMessage as aS, type FreeBusyEntry as aT, type FullContextSelection as aU, GOOGLE_VENDORS as aV, type HolidayCountry as aW, type HouseTemplateCandidate as aX, IMANAGE_VENDORS as aY, type IdentityErrorCode as aZ, type IdentityPurchase as a_, type ConversationResponse as aa, type ConversationUsageResponse as ab, type CreateFactRequest as ac, type CreateFactsRequest as ad, type CreateWorkRequest as ae, type CreateWorkflowRequest as af, DEFAULT_AI_USD_PER_GBP as ag, DOC_TERMINAL_STATUSES as ah, DRIVE_SYNC_VENDORS as ai, type Database as aj, type DatabaseAggregateRequest as ak, type DatabaseAggregateResult as al, type DatabaseColumn as am, type DatabaseColumnWrite as an, type DatabaseImportResult as ao, type DatabaseRow as ap, type DatabaseRowPage as aq, type DatabaseRowsQuery as ar, type DateTimeSpec as as, type DecryptedChat as at, type DecryptedChatMessage as au, type DeploymentHouseTemplate as av, type DocInfo as aw, type DocInfoMap as ax, type DocNameMap as ay, type DocumentAutomationAction as az, type ActivityKind as b, SHAREPOINT_VENDORS as b$, type IdentityStatus as b0, type ImportResult as b1, type InvitationRead as b2, type LinkedRun as b3, type ListAllOptions as b4, type ListEventsParams as b5, type ListFactsOptions as b6, type ListPaginatedOptions as b7, MAILBOX_SYNC_VENDORS as b8, MAX_RETRIEVE_DOC_IDS as b9, type ProjectPlanChangeRequest as bA, type ProjectQuoteRequest as bB, type ProjectResponse as bC, type ProjectUpdateRequest as bD, type ProjectUsageResponse as bE, PublicBookingError as bF, type PublicBookingPage as bG, type QuotaExceeded as bH, type RaisedSignal as bI, type RawResponseEvent as bJ, type ReconnectOptions as bK, type ReconnectableWsConnection as bL, type ResolvedCitation as bM, type ResolvedRecipient as bN, type RespondParams as bO, type RespondPartstat as bP, type ResponseHandle as bQ, type ResponseSnapshot as bR, type ResponseStart as bS, type ResponseStartOptions as bT, type RoomCreateBody as bU, type RoomQuery as bV, type RoomRead as bW, type RunProgress as bX, type RunStats as bY, type RunStep as bZ, type RunWaitingOn as b_, MICROSOFT_VENDORS as ba, type MailAttachment as bb, type MessageLevel as bc, type OAuthAccountKind as bd, type OutputItemDone as be, type OverlayItem as bf, type OverlayLayerName as bg, PRESENCE_KINDS as bh, PROMPT_CONTEXT_CHARS as bi, type ParsedSlashCommand as bj, type PendingAuthResponse as bk, type PersonKey as bl, PlanStepsError as bm, type PlanWorkRequest as bn, type ProductResponse as bo, type ProjectAddonKind as bp, type ProjectAddonSettingsRequest as bq, type ProjectBudget as br, type ProjectCheckoutRequest as bs, type ProjectConversationUsageResponse as bt, type ProjectCreateOptions as bu, type ProjectDetails as bv, type ProjectEventKind as bw, type ProjectEventResponse as bx, type ProjectInvoicesResponse as by, type ProjectNextPeriodAddonsRequest as bz, type ActivityResponse as c, type UploadProgressListener as c$, type SSEEvent as c0, type SSEStreamCallbacks as c1, type SSEStreamOutcome as c2, type SSEStreamResult as c3, STEP_FIELD_OPTION_TONES as c4, STOP_ID_WAIT_MS as c5, STOP_REPEAT_WINDOW_MS as c6, SUPPORTED_EXTENSIONS as c7, type ScopedTarget as c8, type SearchChunk as c9, type TagChange as cA, type TagFieldDefinition as cB, type TagGroup as cC, type TagKind as cD, type TagKindField as cE, type TagKindSchema as cF, type TagLinks as cG, type TagListQuery as cH, type TagNode as cI, type TagResponse as cJ, type TagScope as cK, type TagTreeRow as cL, type TaskPlan as cM, type TaskPlanStep as cN, type TaxQuoteResponse as cO, type Thread as cP, type ThreadsResponse as cQ, type TimeSuggestion as cR, type TurnRequest as cS, type UpdateConversationRequest as cT, type UpdateFactRequest as cU, type UpdateWorkflowRequest as cV, type UploadBatchResult as cW, type UploadDirectOptions as cX, type UploadDirectResult as cY, type UploadDocumentsOptions as cZ, type UploadOptions as c_, type SendBack as ca, type ShareRead as cb, type ShareRole as cc, type SkillSummary as cd, type SkippedFile as ce, type SlackConnectionStatus as cf, type StepActionRequest as cg, type StepActivityEvent as ch, type StepAssignee as ci, type StepDisplay as cj, type StepField as ck, type StepFieldOption as cl, type StepFieldOptionTone as cm, type StepKind as cn, type StepPhase as co, type StepSignal as cp, type StepSignalWhen as cq, type StepState as cr, type StepStatus as cs, type SubagentBranchRecord as ct, type SubagentLaneInfo as cu, type SubmitBackgroundQueryOptions as cv, type SubscribeParams as cw, type SyncTriggerResult as cx, TAG_KINDS as cy, TAG_NESTING_MAX_DEPTH as cz, Arbi as d, findReplyTarget as d$, type UploadResult as d0, type UsageBreakdown as d1, type UserConnectorEntry as d2, type UserDailyUsageResponse as d3, type UserInfo as d4, WebSocketAuthError as d5, type WeeklyHoursSpec as d6, type WorkStatus as d7, type WorkflowAuthMode as d8, type WorkflowResponse as d9, chats as dA, computeRunStats as dB, connectErrorMessage as dC, connectWebSocket as dD, connectWithReconnect as dE, connectors as dF, contacts as dG, continuityPrompt as dH, conversations as dI, countCitations as dJ, createAuthenticatedClient as dK, createDocumentWaiter as dL, createIndexAssigner as dM, databases as dN, defaultKindForFormat as dO, doctags as dP, documents as dQ, estimateDraftTokens as dR, extractDocumentIdsFromMessages as dS, extractFactIdsFromMessages as dT, extractSubagentLanes as dU, facts as dV, files as dW, filterDocumentTags as dX, filterSkills as dY, findLeafForTaskMessage as dZ, findMainSiblingLeaf as d_, type WorkflowRunHistoryResponse as da, type WorkflowRunResponse as db, type WorkspaceContext as dc, type WorkspaceOpenResponse as dd, type WorkspaceResponse as de, type WsConnection as df, account as dg, agentconfig as dh, agents as di, appendTranscriptionHints as dj, assistant as dk, authenticatedFetch as dl, bookPublicSlot as dm, buildCitationChunkData as dn, buildDocNameMap as dp, buildDocumentTools as dq, buildFactsContextTool as dr, buildRetrievalChunkTool as ds, buildRetrievalFullContextTool as dt, buildRetrievalTocTool as du, buildTurnRequest as dv, calendar as dw, calls as dx, canTagHaveParent as dy, cancelPublicBooking as dz, ArbiApiError as e, quotaFromStreamError as e$, findSubagentRunId as e0, flattenTagTree as e1, formatAgentStepLabel as e2, formatFileSize as e3, formatGbp as e4, formatGbpPerMillionTokens as e5, formatItemLabel as e6, formatStreamSummary as e7, formatTokens as e8, formatUserName as e9, identityErrorCode as eA, isAnnotationTag as eB, isConnectorVendorVisible as eC, isDriveSyncVendor as eD, isEntityTag as eE, isFlatKind as eF, isLabelTag as eG, isMailboxSyncVendor as eH, isNearAiUsageBudget as eI, isPresenceTag as eJ, isSharePointVendor as eK, isSharedSkill as eL, isTraceItem as eM, mail as eN, mergeAgentSteps as eO, notifications as eP, parseSSEEvents as eQ, parseSlashCommand as eR, parseSlashTokenInProgress as eS, performPasswordLogin as eT, performSigningKeyLogin as eU, performSsoDeviceFlowLogin as eV, pickMainThread as eW, profile as eX, progressFetch as eY, projects as eZ, quotaExceededFrom as e_, formatWorkspaceChoices as ea, formatWsMessage as eb, generateEncryptedWorkspaceKey as ec, generateNewWorkspaceKey as ed, getAgentStepLabel as ee, getAttachableRunId as ef, getChildTags as eg, getContextRemainingPercent as eh, getContextUsedPercent as ei, getContextUsedTokens as ej, getCurrentStep as ek, getEligibleParentTags as el, getErrorCode as em, getErrorMessage as en, getPublicBookingPage as eo, getRawWorkspaceKey as ep, getRunToAttach as eq, getRunToCancel as er, getStepDisplay as es, getStepTool as et, getSubagentBranchRecord as eu, getTagDescendantIds as ev, health as ew, houseTemplate as ex, hydrateAgentSteps as ey, identity as ez, ArbiError as f, reduceOutputItem as f0, refusalReason as f1, requireData as f2, requireOk as f3, resolveAuth as f4, resolveCitations as f5, resolveSummary as f6, resolveWorkspace as f7, responses as f8, searchChunks as f9, selectFullContextDocument as fa, selectWorkspace as fb, selectWorkspaceById as fc, sessions as fd, settings as fe, signatureRequests as ff, sliceToSubagentThread as fg, streamSSE as fh, stripCitationMarkdown as fi, subagentJobLabel as fj, summarizeCitations as fk, tagUseCount as fl, tags as fm, tagsForScope as fn, tagsOfGroup as fo, topLevelAgentSteps as fp, uploadSkill as fq, usdToGbp as fr, work as fs, workflowSteps as ft, workflows as fu, workspaces as fv, wouldCreateTagCycle as fw, type ArbiErrorOptions as g, type ArbiHostSession as h, type ArbiOptions as i, ArbiSessionExpiredError as j, ArbiTransportError as k, ArbiWorkspaceChangedError as l, ArbiWorkspaceSupersededError as m, type AskHandlers as n, type AskRequest as o, type AttendeeRead as p, type AuthContext as q, type AuthHeaders as r, type AuthMode as s, type AuthenticatedClient as t, type BookingPage as u, type BookingPageWriteBody as v, type BookingRequestBody as w, type BridgeTokensOptions as x, type CalDavProfile as y, type CalendarAccount as z };
17407
+ /** Pure composition over the existing cfg contract. Never creates an agt identity or grants access. */
17408
+
17409
+ type Configuration = components['schemas']['ConfigUpdateData'];
17410
+ type ConfigurationPatch = {
17411
+ [K in keyof Configuration]?: NonNullable<Configuration[K]> extends object ? Partial<NonNullable<Configuration[K]>> | null : Configuration[K];
17412
+ };
17413
+ type ResponseTools = NonNullable<components['schemas']['MessageInput']['tools']>;
17414
+ /** Later fields win. Sections merge one level; arrays replace; explicit null clears a section. */
17415
+ declare function composeConfiguration(base: Configuration, ...patches: ConfigurationPatch[]): Configuration;
17416
+ /** Both ordinary answers and the built-in agent loop receive the same developer instructions. */
17417
+ declare function instructions(text: string): ConfigurationPatch;
17418
+ interface Capabilities {
17419
+ webSearch?: boolean;
17420
+ codeExecution?: boolean;
17421
+ planning?: boolean;
17422
+ deepResearch?: boolean;
17423
+ subagents?: boolean;
17424
+ humanInput?: boolean;
17425
+ }
17426
+ /** Feature selection only: workspace membership, consent and tool authorisation still apply. */
17427
+ declare function capabilities(options: Capabilities): ConfigurationPatch;
17428
+ /** Pass an existing configuration to add; replacement intentionally drops the previous list. */
17429
+ declare function mcpTools(base: Configuration, names: string[], mode: 'add' | 'replace'): ConfigurationPatch;
17430
+ declare function documentTools(options: {
17431
+ search?: string[];
17432
+ fullContext?: string[];
17433
+ tableOfContents?: string[];
17434
+ }): ResponseTools;
17435
+ /** Add replaces matching tool names; replace discards all previous tools. No mutation of inputs. */
17436
+ declare function composeTools(base: ResponseTools, next: ResponseTools, mode: 'add' | 'replace'): ResponseTools;
17437
+
17438
+ export { type CitationSummary as $, ACCOUNT_VENDOR as A, type BookingConfirmation as B, type CalDavConnectBody as C, type CalDavProfile as D, type CalendarAccount as E, type CalendarAccountKind as F, type CalendarCreateBody as G, type CalendarEvent as H, type CalendarKeys as I, type CalendarRead as J, type CalendarSettings as K, type CalendarSettingsBody as L, type CalendarUpdate as M, type CalendarWindow as N, CallApiError as O, type Capabilities as P, type ChatAttachmentFile as Q, type ChatAttachmentInput as R, type ChatCryptoContext as S, type ChatKeyRing as T, type ChatKind as U, type ChatMemberKey as V, type ChatMemberResponse as W, type ChatMessage as X, type ChatMessageResponse as Y, type ChatResponse as Z, type ChatSession as _, type AccountSyncResult as a, type HolidayCountry as a$, type CitationToolSources as a0, type CliConfig as a1, type CliCredentials as a2, type CommandDescriptor as a3, type ConfigStore as a4, type Configuration as a5, type ConfigurationPatch as a6, type ConnectOptions as a7, type ConnectorCatalogEntry as a8, type ConnectorFolder as a9, type DeploymentHouseTemplate as aA, type DocInfo as aB, type DocInfoMap as aC, type DocNameMap as aD, type DocumentAutomationAction as aE, type DocumentListFields as aF, type DocumentListOrder as aG, type DocumentSelector as aH, type DocumentWaiter as aI, type DocumentWaiterOptions as aJ, type DriveSyncProgress as aK, type DriveSyncSummary as aL, DuplicateContactError as aM, ENTITY_KINDS as aN, type EditScope as aO, type EntityKind as aP, type EventCreateBody as aQ, type EventPatchBody as aR, FLAT_TAG_KINDS as aS, type FactResponse as aT, type FactSearchRequest as aU, type FactSearchResponse as aV, type FindTimeParams as aW, type FormattedWsMessage as aX, type FreeBusyEntry as aY, type FullContextSelection as aZ, GOOGLE_VENDORS as a_, type ConnectorSyncProgress as aa, type ConnectorSyncStatus as ab, type ConnectorVendorKey as ac, type ConnectorVisibilitySettings as ad, type ContextUsage as ae, type ConversationResponse as af, type ConversationUsageResponse as ag, type CreateFactRequest as ah, type CreateFactsRequest as ai, type CreateWorkRequest as aj, type CreateWorkflowRequest as ak, DEFAULT_AI_USD_PER_GBP as al, DOC_TERMINAL_STATUSES as am, DRIVE_SYNC_VENDORS as an, type Database as ao, type DatabaseAggregateRequest as ap, type DatabaseAggregateResult as aq, type DatabaseColumn as ar, type DatabaseColumnWrite as as, type DatabaseImportResult as at, type DatabaseRow as au, type DatabaseRowPage as av, type DatabaseRowsQuery as aw, type DateTimeSpec as ax, type DecryptedChat as ay, type DecryptedChatMessage as az, type ActivityKind as b, type ResponseHandle as b$, type HouseTemplateCandidate as b0, IMANAGE_VENDORS as b1, type IdentityErrorCode as b2, type IdentityPurchase as b3, type IdentityState as b4, type IdentityStatus as b5, type ImportResult as b6, type InvitationRead as b7, type JsonSchemaOutputFormat as b8, type LinkedRun as b9, type ProjectCheckoutRequest as bA, type ProjectConversationUsageResponse as bB, type ProjectCreateOptions as bC, type ProjectDetails as bD, type ProjectEventKind as bE, type ProjectEventResponse as bF, type ProjectInvoicesResponse as bG, type ProjectNextPeriodAddonsRequest as bH, type ProjectPlanChangeRequest as bI, type ProjectQuoteRequest as bJ, type ProjectResponse as bK, type ProjectUpdateRequest as bL, type ProjectUsageResponse as bM, PublicBookingError as bN, type PublicBookingPage as bO, type QuotaExceeded as bP, type RaisedSignal as bQ, type RawResponseEvent as bR, type ReconnectOptions as bS, type ReconnectableWsConnection as bT, type ResolvedCitation as bU, type ResolvedRecipient as bV, type RespondParams as bW, type RespondPartstat as bX, type Response$1 as bY, type ResponseCreateRequest as bZ, type ResponseCreateResult as b_, type ListAllOptions as ba, type ListEventsParams as bb, type ListFactsOptions as bc, type ListPaginatedOptions as bd, MAILBOX_SYNC_VENDORS as be, MAX_RETRIEVE_DOC_IDS as bf, MICROSOFT_VENDORS as bg, type MailAttachment as bh, type MessageLevel as bi, type OAuthAccountKind as bj, type OutputItemDone as bk, type OverlayItem as bl, type OverlayLayerName as bm, PRESENCE_KINDS as bn, PROMPT_CONTEXT_CHARS as bo, type ParsedResponse as bp, type ParsedSlashCommand as bq, type ParsedStructuredResponse as br, type PendingAuthResponse as bs, type PersonKey as bt, PlanStepsError as bu, type PlanWorkRequest as bv, type ProductResponse as bw, type ProjectAddonKind as bx, type ProjectAddonSettingsRequest as by, type ProjectBudget as bz, type ActivityResponse as c, type TaskPlanStep as c$, type ResponseSnapshot as c0, type ResponseStart as c1, type ResponseStartOptions as c2, ResponseStream as c3, type ResponseStreamEvent as c4, type ResponseTools as c5, type RoomCreateBody as c6, type RoomQuery as c7, type RoomRead as c8, type RunProgress as c9, type StepFieldOptionTone as cA, type StepKind as cB, type StepPhase as cC, type StepSignal as cD, type StepSignalWhen as cE, type StepState as cF, type StepStatus as cG, type SubagentBranchRecord as cH, type SubagentLaneInfo as cI, type SubmitBackgroundQueryOptions as cJ, type SubscribeParams as cK, type SyncTriggerResult as cL, TAG_KINDS as cM, TAG_NESTING_MAX_DEPTH as cN, type TagChange as cO, type TagFieldDefinition as cP, type TagGroup as cQ, type TagKind as cR, type TagKindField as cS, type TagKindSchema as cT, type TagLinks as cU, type TagListQuery as cV, type TagNode as cW, type TagResponse as cX, type TagScope as cY, type TagTreeRow as cZ, type TaskPlan as c_, type RunStats as ca, type RunStep as cb, type RunWaitingOn as cc, SHAREPOINT_VENDORS as cd, type SSEEvent as ce, type SSEStreamCallbacks as cf, type SSEStreamOutcome as cg, type SSEStreamResult as ch, STEP_FIELD_OPTION_TONES as ci, STOP_ID_WAIT_MS as cj, STOP_REPEAT_WINDOW_MS as ck, SUPPORTED_EXTENSIONS as cl, type ScopedTarget as cm, type SearchChunk as cn, type SendBack as co, type ShareRead as cp, type ShareRole as cq, type SkillSummary as cr, type SkippedFile as cs, type SlackConnectionStatus as ct, type StepActionRequest as cu, type StepActivityEvent as cv, type StepAssignee as cw, type StepDisplay as cx, type StepField as cy, type StepFieldOption as cz, Arbi as d, countCitations as d$, type TaxQuoteResponse as d0, type Thread as d1, type ThreadsResponse as d2, type TimeSuggestion as d3, type TurnRequest as d4, type UpdateConversationRequest as d5, type UpdateFactRequest as d6, type UpdateWorkflowRequest as d7, type UploadBatchResult as d8, type UploadDirectOptions as d9, assistant as dA, authenticatedFetch as dB, bookPublicSlot as dC, buildCitationChunkData as dD, buildDocNameMap as dE, buildDocumentTools as dF, buildFactsContextTool as dG, buildRetrievalChunkTool as dH, buildRetrievalFullContextTool as dI, buildRetrievalTocTool as dJ, buildTurnRequest as dK, calendar as dL, calls as dM, canTagHaveParent as dN, cancelPublicBooking as dO, capabilities as dP, chats as dQ, composeConfiguration as dR, composeTools as dS, computeRunStats as dT, connectErrorMessage as dU, connectWebSocket as dV, connectWithReconnect as dW, connectors as dX, contacts as dY, continuityPrompt as dZ, conversations as d_, type UploadDirectResult as da, type UploadDocumentsOptions as db, type UploadOptions as dc, type UploadProgressListener as dd, type UploadResult as de, type UsageBreakdown as df, type UserConnectorEntry as dg, type UserDailyUsageResponse as dh, type UserInfo as di, WebSocketAuthError as dj, type WeeklyHoursSpec as dk, type WorkStatus as dl, type WorkflowAuthMode as dm, type WorkflowResponse as dn, type WorkflowRunHistoryResponse as dp, type WorkflowRunResponse as dq, type WorkspaceConflict as dr, type WorkspaceContext as ds, type WorkspaceOpenResponse as dt, type WorkspaceResponse as du, type WsConnection as dv, account as dw, agentconfig as dx, agents as dy, appendTranscriptionHints as dz, ArbiApiError as e, isMailboxSyncVendor as e$, createAuthenticatedClient as e0, createDocumentWaiter as e1, createIndexAssigner as e2, databases as e3, defaultKindForFormat as e4, doctags as e5, documentTools as e6, documents as e7, estimateDraftTokens as e8, extractDocumentIdsFromMessages as e9, getContextRemainingPercent as eA, getContextUsedPercent as eB, getContextUsedTokens as eC, getCurrentStep as eD, getEligibleParentTags as eE, getErrorCode as eF, getErrorMessage as eG, getPublicBookingPage as eH, getRawWorkspaceKey as eI, getRunToAttach as eJ, getRunToCancel as eK, getStepDisplay as eL, getStepTool as eM, getSubagentBranchRecord as eN, getTagDescendantIds as eO, health as eP, houseTemplate as eQ, hydrateAgentSteps as eR, identity as eS, identityErrorCode as eT, instructions as eU, isAnnotationTag as eV, isConnectorVendorVisible as eW, isDriveSyncVendor as eX, isEntityTag as eY, isFlatKind as eZ, isLabelTag as e_, extractFactIdsFromMessages as ea, extractSubagentLanes as eb, facts as ec, files as ed, filterDocumentTags as ee, filterSkills as ef, findLeafForTaskMessage as eg, findMainSiblingLeaf as eh, findReplyTarget as ei, findSubagentRunId as ej, flattenTagTree as ek, formatAgentStepLabel as el, formatFileSize as em, formatGbp as en, formatGbpPerMillionTokens as eo, formatItemLabel as ep, formatStreamSummary as eq, formatTokens as er, formatUserName as es, formatWorkspaceChoices as et, formatWsMessage as eu, generateEncryptedWorkspaceKey as ev, generateNewWorkspaceKey as ew, getAgentStepLabel as ex, getAttachableRunId as ey, getChildTags as ez, ArbiError as f, isNearAiUsageBudget as f0, isPresenceTag as f1, isSharePointVendor as f2, isSharedSkill as f3, isTraceItem as f4, mail as f5, mcpTools as f6, mergeAgentSteps as f7, notifications as f8, parseSSEEvents as f9, settings as fA, signatureRequests as fB, sliceToSubagentThread as fC, streamSSE as fD, stripCitationMarkdown as fE, subagentJobLabel as fF, summarizeCitations as fG, tagUseCount as fH, tags as fI, tagsForScope as fJ, tagsOfGroup as fK, topLevelAgentSteps as fL, uploadSkill as fM, usdToGbp as fN, work as fO, workflowSteps as fP, workflows as fQ, workspaceConflictOf as fR, workspaces as fS, wouldCreateTagCycle as fT, parseSlashCommand as fa, parseSlashTokenInProgress as fb, parseStructuredResponse as fc, performPasswordLogin as fd, performSigningKeyLogin as fe, performSsoDeviceFlowLogin as ff, pickMainThread as fg, profile as fh, progressFetch as fi, projects as fj, quotaExceededFrom as fk, quotaFromStreamError as fl, reduceOutputItem as fm, refusalReason as fn, requireData as fo, requireOk as fp, resolveAuth as fq, resolveCitations as fr, resolveSummary as fs, resolveWorkspace as ft, responses as fu, searchChunks as fv, selectFullContextDocument as fw, selectWorkspace as fx, selectWorkspaceById as fy, sessions as fz, type ArbiErrorOptions as g, type ArbiHostSession as h, type ArbiOptions as i, ArbiSessionExpiredError as j, ArbiStructuredOutputError as k, ArbiTransportError as l, ArbiWorkspaceChangedError as m, ArbiWorkspaceSupersededError as n, ArbiWorkspaceUnavailableError as o, type AskHandlers as p, type AskRequest 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 BridgeTokensOptions as z };