@arbidocs/sdk 0.4.144 → 0.4.146

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.
@@ -1251,7 +1251,7 @@ declare function updateDocuments(arbi: ArbiClient, documents: DocUpdateRequest$1
1251
1251
  * server-side from the open session — there is no ``workspace_ext_id`` query
1252
1252
  * param on this endpoint.
1253
1253
  */
1254
- declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean): Promise<{
1254
+ declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean, configExtId?: string | null): Promise<{
1255
1255
  doc_ext_ids?: string[] | undefined;
1256
1256
  version?: number | null | undefined;
1257
1257
  batch_id?: string | null | undefined;
@@ -1260,6 +1260,39 @@ declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean):
1260
1260
  reason: string;
1261
1261
  }[] | undefined;
1262
1262
  }>;
1263
+ /** Where an upload goes and what it is: {@link UploadOptions}, plus a tag and a target workspace. */
1264
+ interface UploadDocumentsOptions extends UploadOptions {
1265
+ /** Apply this tag to the uploaded documents. */
1266
+ tagExtId?: string | null;
1267
+ /** Save into this workspace instead of the open one (its key must be on the session). */
1268
+ workspaceExtId?: string | null;
1269
+ }
1270
+ /**
1271
+ * Upload files in one multipart request over the client's own fetch (its auth, re-login and
1272
+ * payment handling apply). The open workspace receives them unless `workspaceExtId` is given.
1273
+ */
1274
+ declare function uploadDocuments(arbi: ArbiClient, files: Array<Blob | File>, options?: UploadDocumentsOptions): Promise<UploadResult>;
1275
+ /**
1276
+ * Near-duplicate document pairs in the open workspace, at or above `threshold` (or the pairs of
1277
+ * one document, `docId`).
1278
+ */
1279
+ declare function similarDocuments(arbi: ArbiClient, options?: {
1280
+ threshold?: number;
1281
+ docId?: string;
1282
+ }): Promise<{
1283
+ workspace_ext_id: string;
1284
+ pairs: {
1285
+ doc_a: {
1286
+ external_id: string;
1287
+ file_name?: string | null | undefined;
1288
+ };
1289
+ doc_b: {
1290
+ external_id: string;
1291
+ file_name?: string | null | undefined;
1292
+ };
1293
+ similarity: number;
1294
+ }[];
1295
+ }>;
1263
1296
  /**
1264
1297
  * Get parsed document content.
1265
1298
  */
@@ -1407,6 +1440,7 @@ type documents_SkippedFile = SkippedFile;
1407
1440
  type documents_UploadBatchResult = UploadBatchResult;
1408
1441
  type documents_UploadDirectOptions = UploadDirectOptions;
1409
1442
  type documents_UploadDirectResult = UploadDirectResult;
1443
+ type documents_UploadDocumentsOptions = UploadDocumentsOptions;
1410
1444
  type documents_UploadOptions = UploadOptions;
1411
1445
  type documents_UploadResult = UploadResult;
1412
1446
  declare const documents_deleteDocuments: typeof deleteDocuments;
@@ -1422,12 +1456,14 @@ declare const documents_listVersions: typeof listVersions;
1422
1456
  declare const documents_mimeFromName: typeof mimeFromName;
1423
1457
  declare const documents_presignedPut: typeof presignedPut;
1424
1458
  declare const documents_sanitizeFolderPath: typeof sanitizeFolderPath;
1459
+ declare const documents_similarDocuments: typeof similarDocuments;
1425
1460
  declare const documents_updateDocuments: typeof updateDocuments;
1461
+ declare const documents_uploadDocuments: typeof uploadDocuments;
1426
1462
  declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
1427
1463
  declare const documents_uploadFiles: typeof uploadFiles;
1428
1464
  declare const documents_uploadUrl: typeof uploadUrl;
1429
1465
  declare namespace documents {
1430
- export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_finaliseTranslation as finaliseTranslation, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_getThumbnails as getThumbnails, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_listVersions as listVersions, documents_mimeFromName as mimeFromName, documents_presignedPut as presignedPut, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
1466
+ export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadDocumentsOptions as UploadDocumentsOptions, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_finaliseTranslation as finaliseTranslation, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_getThumbnails as getThumbnails, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_listVersions as listVersions, documents_mimeFromName as mimeFromName, documents_presignedPut as presignedPut, documents_sanitizeFolderPath as sanitizeFolderPath, documents_similarDocuments as similarDocuments, documents_updateDocuments as updateDocuments, documents_uploadDocuments as uploadDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
1431
1467
  }
1432
1468
 
1433
1469
  /**
@@ -1941,7 +1977,9 @@ declare function addWorkspaceUsers(arbi: ArbiClient, emails: string[], role?: 'o
1941
1977
  target?: {
1942
1978
  workspaceExtId: string;
1943
1979
  workspaceKey: string;
1944
- }): Promise<{
1980
+ },
1981
+ /** Invite an email that is not a user yet (they get access once they sign up). */
1982
+ confirmInvite?: boolean): Promise<{
1945
1983
  user: {
1946
1984
  external_id: string;
1947
1985
  parent_ext_id?: string | null | undefined;
@@ -7033,7 +7071,10 @@ declare class Arbi {
7033
7071
  }[];
7034
7072
  next_cursor?: string | null | undefined;
7035
7073
  }>;
7036
- addUsers: (emails: string[], role?: "owner" | "collaborator" | "guest") => Promise<{
7074
+ /** Add users to the open workspace; `confirmInvite` also invites emails not on ARBI yet. */
7075
+ addUsers: (emails: string[], role?: "owner" | "collaborator" | "guest", options?: {
7076
+ confirmInvite?: boolean;
7077
+ }) => Promise<{
7037
7078
  user: {
7038
7079
  external_id: string;
7039
7080
  parent_ext_id?: string | null | undefined;
@@ -7464,6 +7505,12 @@ declare class Arbi {
7464
7505
  source_message_ext_id?: string | null | undefined;
7465
7506
  conversation_ext_id?: string | null | undefined;
7466
7507
  }[]>;
7508
+ /** Save a translation's current version as a new PDF document linked to its original. */
7509
+ finaliseTranslation: (docId: string) => Promise<{
7510
+ document_ext_id: string;
7511
+ translation_ref: string;
7512
+ source_ref?: string | null | undefined;
7513
+ }>;
7467
7514
  delete: (externalIds: string[]) => Promise<void>;
7468
7515
  update: (documents: DocUpdateRequest[]) => Promise<{
7469
7516
  external_id: string;
@@ -7545,7 +7592,10 @@ declare class Arbi {
7545
7592
  title?: string | null | undefined;
7546
7593
  } | null | undefined;
7547
7594
  }[]>;
7548
- uploadUrl: (urls: string[], shared?: boolean) => Promise<{
7595
+ uploadUrl: (urls: string[], options?: {
7596
+ shared?: boolean;
7597
+ configExtId?: string | null;
7598
+ }) => Promise<{
7549
7599
  doc_ext_ids?: string[] | undefined;
7550
7600
  version?: number | null | undefined;
7551
7601
  batch_id?: string | null | undefined;
@@ -7554,6 +7604,29 @@ declare class Arbi {
7554
7604
  reason: string;
7555
7605
  }[] | undefined;
7556
7606
  }>;
7607
+ /**
7608
+ * Upload files in one request (the open workspace, or `options.workspaceExtId`): folder, tag,
7609
+ * sharing, config, a new version of a document.
7610
+ */
7611
+ upload: (files: Array<Blob | File>, options?: UploadDocumentsOptions) => Promise<UploadResult>;
7612
+ /** Near-duplicate pairs at or above `threshold` (or one document's, `docId`). */
7613
+ similar: (options?: {
7614
+ threshold?: number;
7615
+ docId?: string;
7616
+ }) => Promise<{
7617
+ workspace_ext_id: string;
7618
+ pairs: {
7619
+ doc_a: {
7620
+ external_id: string;
7621
+ file_name?: string | null | undefined;
7622
+ };
7623
+ doc_b: {
7624
+ external_id: string;
7625
+ file_name?: string | null | undefined;
7626
+ };
7627
+ similarity: number;
7628
+ }[];
7629
+ }>;
7557
7630
  uploadFile: (fileData: Blob, fileName: string, options?: UploadOptions) => Promise<UploadResult>;
7558
7631
  /** Download a document's original file — its current version, or `version`. */
7559
7632
  download: (docId: string, version?: number) => Promise<Response>;
@@ -9057,7 +9130,8 @@ declare class Arbi {
9057
9130
  update: (kind: TagKind, fields: TagFieldDefinition[]) => Promise<TagKindSchema>;
9058
9131
  };
9059
9132
  readonly doctags: {
9060
- assign: (tagId: string, docIds: string[], note?: string | null) => Promise<{
9133
+ /** Apply a tag to documents, with a note (a field's value) and the passages it cites. */
9134
+ assign: (tagId: string, docIds: string[], note?: string | null, citations?: CitationSources$1 | null) => Promise<{
9061
9135
  note?: string | null | undefined;
9062
9136
  citations?: {
9063
9137
  doc_ext_id: string;
@@ -9097,7 +9171,10 @@ declare class Arbi {
9097
9171
  created_at: string;
9098
9172
  updated_at: string;
9099
9173
  }>;
9100
- generate: (tagIds: string[], docIds: string[]) => Promise<{
9174
+ /** Fill the tags' values on the documents with AI (`overwrite`: also where already set). */
9175
+ generate: (tagIds: string[], docIds: string[], options?: {
9176
+ overwrite?: boolean;
9177
+ }) => Promise<{
9101
9178
  doc_ext_ids: string[];
9102
9179
  tag_ext_ids: string[];
9103
9180
  }>;
@@ -11526,7 +11603,7 @@ declare class Arbi {
11526
11603
  */
11527
11604
 
11528
11605
  type CitationSources = components['schemas']['CitationSources'];
11529
- declare function assignDocTags(arbi: ArbiClient, tagId: string, docIds: string[], note?: string | null): Promise<{
11606
+ declare function assignDocTags(arbi: ArbiClient, tagId: string, docIds: string[], note?: string | null, citations?: CitationSources | null): Promise<{
11530
11607
  note?: string | null | undefined;
11531
11608
  citations?: {
11532
11609
  doc_ext_id: string;
@@ -12402,4 +12479,4 @@ declare namespace identity {
12402
12479
  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 };
12403
12480
  }
12404
12481
 
12405
- 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, formatUserName 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, buildDocNameMap as cA, buildFactsContextTool as cB, buildRetrievalChunkTool as cC, buildRetrievalFullContextTool as cD, buildRetrievalTocTool as cE, calendar as cF, cancelPublicBooking as cG, chats as cH, connectWebSocket as cI, connectWithReconnect as cJ, consumeSSEStream as cK, contacts as cL, conversations as cM, countCitations as cN, createAuthenticatedClient as cO, createDocumentWaiter as cP, doctags as cQ, documents as cR, facts as cS, files as cT, filterSkills as cU, formatAgentStepLabel as cV, formatFileSize as cW, formatGbp as cX, formatGbpPerMillionTokens as cY, formatItemLabel as cZ, formatStreamSummary as c_, type UploadBatchResult as ca, type UploadDirectOptions as cb, type UploadDirectResult as cc, type UploadOptions as cd, type UploadResult as ce, type UsageBreakdown as cf, type UserDailyUsageResponse as cg, type UserInfo as ch, type UserInputRequestEvent as ci, type UserMessageEvent as cj, WebSocketAuthError as ck, type WeeklyHoursSpec as cl, type WorkStatus as cm, type WorkflowAuthMode as cn, type WorkflowResponse as co, type WorkflowRunHistoryResponse as cp, type WorkflowRunResponse as cq, type WorkspaceContext as cr, type WsConnection as cs, account as ct, agentconfig as cu, agents as cv, assistant as cw, authenticatedFetch as cx, bookPublicSlot as cy, buildCitationChunkData as cz, type AgentControlStateEvent as d, formatWorkspaceChoices as d0, formatWsMessage as d1, generateEncryptedWorkspaceKey as d2, generateNewWorkspaceKey as d3, getErrorCode as d4, getErrorMessage as d5, getPublicBookingPage as d6, getRawWorkspaceKey as d7, health as d8, houseTemplate as d9, streamSSE as dA, stripCitationMarkdown as dB, summarizeCitations as dC, tags as dD, uploadSkill as dE, usdToGbp as dF, work as dG, workflowSteps as dH, workflows as dI, workspaces as dJ, identity as da, identityErrorCode as db, isSharedSkill as dc, mail as dd, notifications as de, parseSSEEvents as df, parseSlashCommand as dg, parseSlashTokenInProgress as dh, performPasswordLogin as di, performSigningKeyLogin as dj, performSsoDeviceFlowLogin as dk, profile as dl, projects as dm, requireData as dn, requireOk as dp, resolveAuth as dq, resolveCitations as dr, resolveWorkspace as ds, responses as dt, selectWorkspace as du, selectWorkspaceById as dv, sessions as dw, settings as dx, signatureRequests as dy, splitAppPasswords 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 };
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 };
@@ -1251,7 +1251,7 @@ declare function updateDocuments(arbi: ArbiClient, documents: DocUpdateRequest$1
1251
1251
  * server-side from the open session — there is no ``workspace_ext_id`` query
1252
1252
  * param on this endpoint.
1253
1253
  */
1254
- declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean): Promise<{
1254
+ declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean, configExtId?: string | null): Promise<{
1255
1255
  doc_ext_ids?: string[] | undefined;
1256
1256
  version?: number | null | undefined;
1257
1257
  batch_id?: string | null | undefined;
@@ -1260,6 +1260,39 @@ declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean):
1260
1260
  reason: string;
1261
1261
  }[] | undefined;
1262
1262
  }>;
1263
+ /** Where an upload goes and what it is: {@link UploadOptions}, plus a tag and a target workspace. */
1264
+ interface UploadDocumentsOptions extends UploadOptions {
1265
+ /** Apply this tag to the uploaded documents. */
1266
+ tagExtId?: string | null;
1267
+ /** Save into this workspace instead of the open one (its key must be on the session). */
1268
+ workspaceExtId?: string | null;
1269
+ }
1270
+ /**
1271
+ * Upload files in one multipart request over the client's own fetch (its auth, re-login and
1272
+ * payment handling apply). The open workspace receives them unless `workspaceExtId` is given.
1273
+ */
1274
+ declare function uploadDocuments(arbi: ArbiClient, files: Array<Blob | File>, options?: UploadDocumentsOptions): Promise<UploadResult>;
1275
+ /**
1276
+ * Near-duplicate document pairs in the open workspace, at or above `threshold` (or the pairs of
1277
+ * one document, `docId`).
1278
+ */
1279
+ declare function similarDocuments(arbi: ArbiClient, options?: {
1280
+ threshold?: number;
1281
+ docId?: string;
1282
+ }): Promise<{
1283
+ workspace_ext_id: string;
1284
+ pairs: {
1285
+ doc_a: {
1286
+ external_id: string;
1287
+ file_name?: string | null | undefined;
1288
+ };
1289
+ doc_b: {
1290
+ external_id: string;
1291
+ file_name?: string | null | undefined;
1292
+ };
1293
+ similarity: number;
1294
+ }[];
1295
+ }>;
1263
1296
  /**
1264
1297
  * Get parsed document content.
1265
1298
  */
@@ -1407,6 +1440,7 @@ type documents_SkippedFile = SkippedFile;
1407
1440
  type documents_UploadBatchResult = UploadBatchResult;
1408
1441
  type documents_UploadDirectOptions = UploadDirectOptions;
1409
1442
  type documents_UploadDirectResult = UploadDirectResult;
1443
+ type documents_UploadDocumentsOptions = UploadDocumentsOptions;
1410
1444
  type documents_UploadOptions = UploadOptions;
1411
1445
  type documents_UploadResult = UploadResult;
1412
1446
  declare const documents_deleteDocuments: typeof deleteDocuments;
@@ -1422,12 +1456,14 @@ declare const documents_listVersions: typeof listVersions;
1422
1456
  declare const documents_mimeFromName: typeof mimeFromName;
1423
1457
  declare const documents_presignedPut: typeof presignedPut;
1424
1458
  declare const documents_sanitizeFolderPath: typeof sanitizeFolderPath;
1459
+ declare const documents_similarDocuments: typeof similarDocuments;
1425
1460
  declare const documents_updateDocuments: typeof updateDocuments;
1461
+ declare const documents_uploadDocuments: typeof uploadDocuments;
1426
1462
  declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
1427
1463
  declare const documents_uploadFiles: typeof uploadFiles;
1428
1464
  declare const documents_uploadUrl: typeof uploadUrl;
1429
1465
  declare namespace documents {
1430
- export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_finaliseTranslation as finaliseTranslation, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_getThumbnails as getThumbnails, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_listVersions as listVersions, documents_mimeFromName as mimeFromName, documents_presignedPut as presignedPut, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
1466
+ export { type documents_DirectUploadClient as DirectUploadClient, type documents_DirectUploadFile as DirectUploadFile, type documents_DirectUploadProgress as DirectUploadProgress, type documents_DocumentListFields as DocumentListFields, type documents_DocumentListOrder as DocumentListOrder, type documents_ListAllOptions as ListAllOptions, type documents_ListPaginatedOptions as ListPaginatedOptions, documents_MAX_PAGES as MAX_PAGES, documents_SUPPORTED_EXTENSIONS as SUPPORTED_EXTENSIONS, type documents_SkippedFile as SkippedFile, type documents_UploadBatchResult as UploadBatchResult, type documents_UploadDirectOptions as UploadDirectOptions, type documents_UploadDirectResult as UploadDirectResult, type documents_UploadDocumentsOptions as UploadDocumentsOptions, type documents_UploadOptions as UploadOptions, type documents_UploadResult as UploadResult, documents_deleteDocuments as deleteDocuments, documents_downloadDocument as downloadDocument, documents_finaliseTranslation as finaliseTranslation, documents_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_getThumbnails as getThumbnails, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_listVersions as listVersions, documents_mimeFromName as mimeFromName, documents_presignedPut as presignedPut, documents_sanitizeFolderPath as sanitizeFolderPath, documents_similarDocuments as similarDocuments, documents_updateDocuments as updateDocuments, documents_uploadDocuments as uploadDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
1431
1467
  }
1432
1468
 
1433
1469
  /**
@@ -1941,7 +1977,9 @@ declare function addWorkspaceUsers(arbi: ArbiClient, emails: string[], role?: 'o
1941
1977
  target?: {
1942
1978
  workspaceExtId: string;
1943
1979
  workspaceKey: string;
1944
- }): Promise<{
1980
+ },
1981
+ /** Invite an email that is not a user yet (they get access once they sign up). */
1982
+ confirmInvite?: boolean): Promise<{
1945
1983
  user: {
1946
1984
  external_id: string;
1947
1985
  parent_ext_id?: string | null | undefined;
@@ -7033,7 +7071,10 @@ declare class Arbi {
7033
7071
  }[];
7034
7072
  next_cursor?: string | null | undefined;
7035
7073
  }>;
7036
- addUsers: (emails: string[], role?: "owner" | "collaborator" | "guest") => Promise<{
7074
+ /** Add users to the open workspace; `confirmInvite` also invites emails not on ARBI yet. */
7075
+ addUsers: (emails: string[], role?: "owner" | "collaborator" | "guest", options?: {
7076
+ confirmInvite?: boolean;
7077
+ }) => Promise<{
7037
7078
  user: {
7038
7079
  external_id: string;
7039
7080
  parent_ext_id?: string | null | undefined;
@@ -7464,6 +7505,12 @@ declare class Arbi {
7464
7505
  source_message_ext_id?: string | null | undefined;
7465
7506
  conversation_ext_id?: string | null | undefined;
7466
7507
  }[]>;
7508
+ /** Save a translation's current version as a new PDF document linked to its original. */
7509
+ finaliseTranslation: (docId: string) => Promise<{
7510
+ document_ext_id: string;
7511
+ translation_ref: string;
7512
+ source_ref?: string | null | undefined;
7513
+ }>;
7467
7514
  delete: (externalIds: string[]) => Promise<void>;
7468
7515
  update: (documents: DocUpdateRequest[]) => Promise<{
7469
7516
  external_id: string;
@@ -7545,7 +7592,10 @@ declare class Arbi {
7545
7592
  title?: string | null | undefined;
7546
7593
  } | null | undefined;
7547
7594
  }[]>;
7548
- uploadUrl: (urls: string[], shared?: boolean) => Promise<{
7595
+ uploadUrl: (urls: string[], options?: {
7596
+ shared?: boolean;
7597
+ configExtId?: string | null;
7598
+ }) => Promise<{
7549
7599
  doc_ext_ids?: string[] | undefined;
7550
7600
  version?: number | null | undefined;
7551
7601
  batch_id?: string | null | undefined;
@@ -7554,6 +7604,29 @@ declare class Arbi {
7554
7604
  reason: string;
7555
7605
  }[] | undefined;
7556
7606
  }>;
7607
+ /**
7608
+ * Upload files in one request (the open workspace, or `options.workspaceExtId`): folder, tag,
7609
+ * sharing, config, a new version of a document.
7610
+ */
7611
+ upload: (files: Array<Blob | File>, options?: UploadDocumentsOptions) => Promise<UploadResult>;
7612
+ /** Near-duplicate pairs at or above `threshold` (or one document's, `docId`). */
7613
+ similar: (options?: {
7614
+ threshold?: number;
7615
+ docId?: string;
7616
+ }) => Promise<{
7617
+ workspace_ext_id: string;
7618
+ pairs: {
7619
+ doc_a: {
7620
+ external_id: string;
7621
+ file_name?: string | null | undefined;
7622
+ };
7623
+ doc_b: {
7624
+ external_id: string;
7625
+ file_name?: string | null | undefined;
7626
+ };
7627
+ similarity: number;
7628
+ }[];
7629
+ }>;
7557
7630
  uploadFile: (fileData: Blob, fileName: string, options?: UploadOptions) => Promise<UploadResult>;
7558
7631
  /** Download a document's original file — its current version, or `version`. */
7559
7632
  download: (docId: string, version?: number) => Promise<Response>;
@@ -9057,7 +9130,8 @@ declare class Arbi {
9057
9130
  update: (kind: TagKind, fields: TagFieldDefinition[]) => Promise<TagKindSchema>;
9058
9131
  };
9059
9132
  readonly doctags: {
9060
- assign: (tagId: string, docIds: string[], note?: string | null) => Promise<{
9133
+ /** Apply a tag to documents, with a note (a field's value) and the passages it cites. */
9134
+ assign: (tagId: string, docIds: string[], note?: string | null, citations?: CitationSources$1 | null) => Promise<{
9061
9135
  note?: string | null | undefined;
9062
9136
  citations?: {
9063
9137
  doc_ext_id: string;
@@ -9097,7 +9171,10 @@ declare class Arbi {
9097
9171
  created_at: string;
9098
9172
  updated_at: string;
9099
9173
  }>;
9100
- generate: (tagIds: string[], docIds: string[]) => Promise<{
9174
+ /** Fill the tags' values on the documents with AI (`overwrite`: also where already set). */
9175
+ generate: (tagIds: string[], docIds: string[], options?: {
9176
+ overwrite?: boolean;
9177
+ }) => Promise<{
9101
9178
  doc_ext_ids: string[];
9102
9179
  tag_ext_ids: string[];
9103
9180
  }>;
@@ -11526,7 +11603,7 @@ declare class Arbi {
11526
11603
  */
11527
11604
 
11528
11605
  type CitationSources = components['schemas']['CitationSources'];
11529
- declare function assignDocTags(arbi: ArbiClient, tagId: string, docIds: string[], note?: string | null): Promise<{
11606
+ declare function assignDocTags(arbi: ArbiClient, tagId: string, docIds: string[], note?: string | null, citations?: CitationSources | null): Promise<{
11530
11607
  note?: string | null | undefined;
11531
11608
  citations?: {
11532
11609
  doc_ext_id: string;
@@ -12402,4 +12479,4 @@ declare namespace identity {
12402
12479
  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 };
12403
12480
  }
12404
12481
 
12405
- 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, formatUserName 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, buildDocNameMap as cA, buildFactsContextTool as cB, buildRetrievalChunkTool as cC, buildRetrievalFullContextTool as cD, buildRetrievalTocTool as cE, calendar as cF, cancelPublicBooking as cG, chats as cH, connectWebSocket as cI, connectWithReconnect as cJ, consumeSSEStream as cK, contacts as cL, conversations as cM, countCitations as cN, createAuthenticatedClient as cO, createDocumentWaiter as cP, doctags as cQ, documents as cR, facts as cS, files as cT, filterSkills as cU, formatAgentStepLabel as cV, formatFileSize as cW, formatGbp as cX, formatGbpPerMillionTokens as cY, formatItemLabel as cZ, formatStreamSummary as c_, type UploadBatchResult as ca, type UploadDirectOptions as cb, type UploadDirectResult as cc, type UploadOptions as cd, type UploadResult as ce, type UsageBreakdown as cf, type UserDailyUsageResponse as cg, type UserInfo as ch, type UserInputRequestEvent as ci, type UserMessageEvent as cj, WebSocketAuthError as ck, type WeeklyHoursSpec as cl, type WorkStatus as cm, type WorkflowAuthMode as cn, type WorkflowResponse as co, type WorkflowRunHistoryResponse as cp, type WorkflowRunResponse as cq, type WorkspaceContext as cr, type WsConnection as cs, account as ct, agentconfig as cu, agents as cv, assistant as cw, authenticatedFetch as cx, bookPublicSlot as cy, buildCitationChunkData as cz, type AgentControlStateEvent as d, formatWorkspaceChoices as d0, formatWsMessage as d1, generateEncryptedWorkspaceKey as d2, generateNewWorkspaceKey as d3, getErrorCode as d4, getErrorMessage as d5, getPublicBookingPage as d6, getRawWorkspaceKey as d7, health as d8, houseTemplate as d9, streamSSE as dA, stripCitationMarkdown as dB, summarizeCitations as dC, tags as dD, uploadSkill as dE, usdToGbp as dF, work as dG, workflowSteps as dH, workflows as dI, workspaces as dJ, identity as da, identityErrorCode as db, isSharedSkill as dc, mail as dd, notifications as de, parseSSEEvents as df, parseSlashCommand as dg, parseSlashTokenInProgress as dh, performPasswordLogin as di, performSigningKeyLogin as dj, performSsoDeviceFlowLogin as dk, profile as dl, projects as dm, requireData as dn, requireOk as dp, resolveAuth as dq, resolveCitations as dr, resolveWorkspace as ds, responses as dt, selectWorkspace as du, selectWorkspaceById as dv, sessions as dw, settings as dx, signatureRequests as dy, splitAppPasswords 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 };
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 };
package/dist/browser.cjs CHANGED
@@ -4368,7 +4368,9 @@ __export(documents_exports, {
4368
4368
  mimeFromName: () => mimeFromName,
4369
4369
  presignedPut: () => presignedPut,
4370
4370
  sanitizeFolderPath: () => sanitizeFolderPath,
4371
+ similarDocuments: () => similarDocuments,
4371
4372
  updateDocuments: () => updateDocuments,
4373
+ uploadDocuments: () => uploadDocuments,
4372
4374
  uploadDocumentsDirect: () => uploadDocumentsDirect,
4373
4375
  uploadFile: () => uploadFile,
4374
4376
  uploadFiles: () => uploadFiles,
@@ -4536,16 +4538,54 @@ async function updateDocuments(arbi, documents) {
4536
4538
  "Failed to update documents"
4537
4539
  );
4538
4540
  }
4539
- async function uploadUrl(arbi, urls, shared = false) {
4541
+ async function uploadUrl(arbi, urls, shared = false, configExtId) {
4540
4542
  return requireData(
4541
4543
  await arbi.fetch.POST("/v1/document/upload-url", {
4542
4544
  params: {
4543
- query: { urls, shared }
4545
+ query: { urls, shared, ...configExtId ? { config_ext_id: configExtId } : {} }
4544
4546
  }
4545
4547
  }),
4546
4548
  "Failed to upload from URLs"
4547
4549
  );
4548
4550
  }
4551
+ async function uploadDocuments(arbi, files, options = {}) {
4552
+ const query = {};
4553
+ if (options.shared !== void 0) query.shared = options.shared;
4554
+ if (options.folder) query.folder = sanitizeFolderPath(options.folder);
4555
+ if (options.configExtId) query.config_ext_id = options.configExtId;
4556
+ if (options.wpType) query.wp_type = options.wpType;
4557
+ if (options.versionOf) query.version_of = options.versionOf;
4558
+ if (options.tagExtId) query.tag_ext_id = options.tagExtId;
4559
+ if (options.workspaceExtId) query.workspace_ext_id = options.workspaceExtId;
4560
+ if (options.derivedFrom) {
4561
+ query.derived_from = options.derivedFrom.docId;
4562
+ query.derived_role = options.derivedFrom.role;
4563
+ }
4564
+ const result = await arbi.fetch.POST("/v1/document/upload", {
4565
+ params: { query },
4566
+ // The schema types the files as strings; they go as multipart parts.
4567
+ body: { files },
4568
+ bodySerializer: () => {
4569
+ const form = new FormData();
4570
+ for (const file of files) form.append("files", file);
4571
+ return form;
4572
+ }
4573
+ });
4574
+ return requireData(result, "Failed to upload documents");
4575
+ }
4576
+ async function similarDocuments(arbi, options = {}) {
4577
+ return requireData(
4578
+ await arbi.fetch.GET("/v1/document/similar", {
4579
+ params: {
4580
+ query: {
4581
+ ...options.threshold !== void 0 ? { threshold: options.threshold } : {},
4582
+ ...options.docId ? { doc_ext_id: options.docId } : {}
4583
+ }
4584
+ }
4585
+ }),
4586
+ "Failed to fetch similar documents"
4587
+ );
4588
+ }
4549
4589
  async function getParsedContent(auth, docId, stage, version) {
4550
4590
  const res = await authenticatedFetch({
4551
4591
  ...auth,
@@ -4970,15 +5010,17 @@ async function updateWorkspace(arbi, body) {
4970
5010
  async function listWorkspaceUsers(arbi) {
4971
5011
  return requireData(await arbi.fetch.GET("/v1/workspace/users"), "Failed to fetch workspace users");
4972
5012
  }
4973
- async function addWorkspaceUsers(arbi, emails, role = "collaborator", target) {
5013
+ async function addWorkspaceUsers(arbi, emails, role = "collaborator", target, confirmInvite = false) {
5014
+ const invite = confirmInvite ? { confirm_invite: true } : {};
4974
5015
  return requireData(
4975
5016
  await arbi.fetch.POST("/v1/workspace/users", {
4976
5017
  body: target ? {
4977
5018
  emails,
4978
5019
  role,
4979
5020
  workspace_ext_id: target.workspaceExtId,
4980
- workspace_key: target.workspaceKey
4981
- } : { emails, role }
5021
+ workspace_key: target.workspaceKey,
5022
+ ...invite
5023
+ } : { emails, role, ...invite }
4982
5024
  }),
4983
5025
  "Failed to add users"
4984
5026
  );
@@ -5587,10 +5629,15 @@ __export(doctags_exports, {
5587
5629
  removeDocTags: () => removeDocTags,
5588
5630
  updateDocTag: () => updateDocTag
5589
5631
  });
5590
- async function assignDocTags(arbi, tagId, docIds, note) {
5632
+ async function assignDocTags(arbi, tagId, docIds, note, citations) {
5591
5633
  return requireData(
5592
5634
  await arbi.fetch.POST("/v1/document/doctag", {
5593
- body: { tag_ext_id: tagId, doc_ext_ids: docIds, note: note ?? null }
5635
+ body: {
5636
+ tag_ext_id: tagId,
5637
+ doc_ext_ids: docIds,
5638
+ note: note ?? null,
5639
+ ...citations ? { citations } : {}
5640
+ }
5594
5641
  }),
5595
5642
  "Failed to create doctags"
5596
5643
  );
@@ -8832,7 +8879,14 @@ var Arbi = class {
8832
8879
  listUsers: () => listWorkspaceUsers(this.requireClient()),
8833
8880
  /** One page of a workspace's activity feed, newest first (see `getWorkspaceActivity`). */
8834
8881
  activity: (workspaceId, options) => getWorkspaceActivity(this.requireClient(), workspaceId, options),
8835
- addUsers: (emails, role) => addWorkspaceUsers(this.requireClient(), emails, role),
8882
+ /** Add users to the open workspace; `confirmInvite` also invites emails not on ARBI yet. */
8883
+ addUsers: (emails, role, options) => addWorkspaceUsers(
8884
+ this.requireClient(),
8885
+ emails,
8886
+ role,
8887
+ void 0,
8888
+ options?.confirmInvite
8889
+ ),
8836
8890
  /**
8837
8891
  * Grant users a temporary key scoped to ONE session (identified by its public key), for
8838
8892
  * example an agent's run session minted by `agents.authorize()`. Nothing standing is created:
@@ -8911,12 +8965,26 @@ var Arbi = class {
8911
8965
  get: (externalIds) => getDocuments(this.requireClient(), externalIds),
8912
8966
  /** Every version of a document, oldest first; `is_current` marks the current one. */
8913
8967
  versions: (docId) => listVersions(this.requireClient(), docId),
8968
+ /** Save a translation's current version as a new PDF document linked to its original. */
8969
+ finaliseTranslation: (docId) => finaliseTranslation(this.requireClient(), docId),
8914
8970
  delete: (externalIds) => deleteDocuments(this.requireClient(), externalIds),
8915
8971
  update: (documents) => updateDocuments(this.requireClient(), documents),
8916
- uploadUrl: (urls, shared) => {
8972
+ uploadUrl: (urls, options) => {
8917
8973
  this.requireWorkspace();
8918
- return uploadUrl(this.requireClient(), urls, shared);
8974
+ return uploadUrl(
8975
+ this.requireClient(),
8976
+ urls,
8977
+ options?.shared,
8978
+ options?.configExtId
8979
+ );
8919
8980
  },
8981
+ /**
8982
+ * Upload files in one request (the open workspace, or `options.workspaceExtId`): folder, tag,
8983
+ * sharing, config, a new version of a document.
8984
+ */
8985
+ upload: (files, options) => uploadDocuments(this.requireClient(), files, options),
8986
+ /** Near-duplicate pairs at or above `threshold` (or one document's, `docId`). */
8987
+ similar: (options) => similarDocuments(this.requireClient(), options),
8920
8988
  uploadFile: (fileData, fileName, options) => {
8921
8989
  this.requireWorkspace();
8922
8990
  return this.recovering(
@@ -9167,10 +9235,12 @@ var Arbi = class {
9167
9235
  };
9168
9236
  // ── Document Tags ─────────────────────────────────────────────────────
9169
9237
  doctags = {
9170
- assign: (tagId, docIds, note) => assignDocTags(this.requireClient(), tagId, docIds, note),
9238
+ /** Apply a tag to documents, with a note (a field's value) and the passages it cites. */
9239
+ assign: (tagId, docIds, note, citations) => assignDocTags(this.requireClient(), tagId, docIds, note, citations),
9171
9240
  remove: (tagId, docIds) => removeDocTags(this.requireClient(), tagId, docIds),
9172
9241
  update: (tagId, docId, updates) => updateDocTag(this.requireClient(), tagId, docId, updates),
9173
- generate: (tagIds, docIds) => generateDocTags(this.requireClient(), tagIds, docIds)
9242
+ /** Fill the tags' values on the documents with AI (`overwrite`: also where already set). */
9243
+ generate: (tagIds, docIds, options) => generateDocTags(this.requireClient(), tagIds, docIds, options)
9174
9244
  };
9175
9245
  // ── Contacts ──────────────────────────────────────────────────────────
9176
9246
  // A card is sealed under its address book's key, which the calendar key bridge carries: without