@arbidocs/sdk 0.3.54 → 0.3.56

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.
@@ -320,6 +320,18 @@ declare function parseSSEEvents(chunk: string, buffer: string): {
320
320
  * Callbacks for streaming SSE events. All callbacks are optional —
321
321
  * omitted callbacks simply ignore that event type.
322
322
  */
323
+ /** Structured ARBI error event (e.g. quota exceeded mid-stream). */
324
+ interface ArbiErrorEvent {
325
+ code: string;
326
+ message: string;
327
+ /** Present for QUOTA_EXCEEDED — current spend in USD. */
328
+ spend?: number;
329
+ /** Present for QUOTA_EXCEEDED — budget cap in USD. */
330
+ budget?: number;
331
+ /** Present for QUOTA_EXCEEDED — affected project external id. */
332
+ project_ext_id?: string | null;
333
+ [key: string]: unknown;
334
+ }
323
335
  interface SSEStreamCallbacks {
324
336
  onStreamStart?: (data: SSEStreamStartData) => void;
325
337
  onToken?: (content: string) => void;
@@ -329,6 +341,12 @@ interface SSEStreamCallbacks {
329
341
  onContentPartAdded?: (data: ResponseContentPartAddedEvent) => void;
330
342
  onAgentStep?: (data: AgentStepEvent) => void;
331
343
  onError?: (message: string) => void;
344
+ /**
345
+ * Fired when the server emits a structured `arbi.error` event mid-stream.
346
+ * Backend uses this for quota-exceeded errors so clients can render an
347
+ * upgrade modal without losing the surrounding stream context.
348
+ */
349
+ onArbiError?: (event: ArbiErrorEvent) => void;
332
350
  onMessageQueued?: (data: MessageQueuedEvent) => void;
333
351
  onUserMessage?: (data: UserMessageEvent) => void;
334
352
  onMetadata?: (data: MessageMetadataPayload$1) => void;
@@ -1361,6 +1379,7 @@ declare class Arbi {
1361
1379
  list: () => Promise<{
1362
1380
  external_id: string;
1363
1381
  name: string;
1382
+ created_by: string;
1364
1383
  packs: number;
1365
1384
  subscription: string;
1366
1385
  created_at: string;
@@ -1379,6 +1398,7 @@ declare class Arbi {
1379
1398
  };
1380
1399
  budget_reset_at?: number | null | undefined;
1381
1400
  };
1401
+ daily_cap_per_user?: number | null | undefined;
1382
1402
  price_id?: string | null | undefined;
1383
1403
  plan?: string | null | undefined;
1384
1404
  amount?: number | null | undefined;
@@ -1390,6 +1410,7 @@ declare class Arbi {
1390
1410
  create: (name: string) => Promise<{
1391
1411
  external_id: string;
1392
1412
  name: string;
1413
+ created_by: string;
1393
1414
  packs: number;
1394
1415
  subscription: string;
1395
1416
  created_at: string;
@@ -1408,6 +1429,7 @@ declare class Arbi {
1408
1429
  };
1409
1430
  budget_reset_at?: number | null | undefined;
1410
1431
  };
1432
+ daily_cap_per_user?: number | null | undefined;
1411
1433
  price_id?: string | null | undefined;
1412
1434
  plan?: string | null | undefined;
1413
1435
  amount?: number | null | undefined;
@@ -1419,6 +1441,7 @@ declare class Arbi {
1419
1441
  refresh: (projectExtId: string) => Promise<{
1420
1442
  external_id: string;
1421
1443
  name: string;
1444
+ created_by: string;
1422
1445
  packs: number;
1423
1446
  subscription: string;
1424
1447
  created_at: string;
@@ -1437,6 +1460,7 @@ declare class Arbi {
1437
1460
  };
1438
1461
  budget_reset_at?: number | null | undefined;
1439
1462
  };
1463
+ daily_cap_per_user?: number | null | undefined;
1440
1464
  price_id?: string | null | undefined;
1441
1465
  plan?: string | null | undefined;
1442
1466
  amount?: number | null | undefined;
@@ -2659,6 +2683,8 @@ declare class Arbi {
2659
2683
  BM25_K1: number;
2660
2684
  BM25_B: number;
2661
2685
  BM25_AVGDL: number;
2686
+ CJK_NGRAM_SIZE: number;
2687
+ NORMALIZE_TRADITIONAL_TO_SIMPLIFIED: boolean;
2662
2688
  };
2663
2689
  } | {
2664
2690
  Agents: {
@@ -3973,6 +3999,8 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
3973
3999
  BM25_K1: number;
3974
4000
  BM25_B: number;
3975
4001
  BM25_AVGDL: number;
4002
+ CJK_NGRAM_SIZE: number;
4003
+ NORMALIZE_TRADITIONAL_TO_SIMPLIFIED: boolean;
3976
4004
  };
3977
4005
  } | {
3978
4006
  Agents: {
@@ -4141,4 +4169,4 @@ declare namespace responses {
4141
4169
  export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
4142
4170
  }
4143
4171
 
4144
- export { type UserInputRequestEvent as $, type AuthHeaders as A, type ReconnectableWsConnection as B, type ConfigStore as C, type DmCryptoContext as D, type ResolvedCitation as E, type FormattedWsMessage as F, type ResponseCompletedEvent as G, type ResponseContentPartAddedEvent as H, type ResponseCreatedEvent as I, type ResponseFailedEvent as J, type ResponseOutputItemAddedEvent as K, type ListAllOptions as L, type MessageLevel as M, type ResponseOutputItemDoneEvent as N, type OutputTokensDetails as O, type ResponseOutputTextDeltaEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SkippedFile as S, type ResponseOutputTextDoneEvent as T, type UploadResult as U, type ResponseUsage as V, type SSEEvent as W, type SSEStreamCallbacks as X, type SSEStreamResult as Y, type SSEStreamStartData as Z, type UserInfo as _, type CliConfig as a, type UserMessageEvent as a0, type WorkspaceContext as a1, type WsConnection as a2, agentconfig as a3, assistant as a4, authenticatedFetch as a5, buildRetrievalChunkTool as a6, buildRetrievalFullContextTool as a7, buildRetrievalTocTool as a8, connectWebSocket as a9, performSsoDeviceFlowLogin as aA, requireData as aB, requireOk as aC, resolveAuth as aD, resolveCitations as aE, resolveWorkspace as aF, responses as aG, selectWorkspace as aH, selectWorkspaceById as aI, settings as aJ, streamSSE as aK, stripCitationMarkdown as aL, summarizeCitations as aM, tags as aN, workspaces as aO, connectWithReconnect as aa, consumeSSEStream as ab, contacts as ac, conversations as ad, countCitations as ae, createAuthenticatedClient as af, createDocumentWaiter as ag, dm as ah, doctags as ai, documents as aj, files as ak, formatAgentStepLabel as al, formatFileSize as am, formatStreamSummary as an, formatUserName as ao, formatWorkspaceChoices as ap, formatWsMessage as aq, generateEncryptedWorkspaceKey as ar, generateNewWorkspaceKey as as, getErrorCode as at, getErrorMessage as au, getRawWorkspaceKey as av, health as aw, parseSSEEvents as ax, performPasswordLogin as ay, performSigningKeyLogin as az, type CliCredentials as b, type ChatSession as c, type UploadBatchResult as d, type UploadOptions as e, type UploadDirectOptions as f, type UploadDirectResult as g, SUPPORTED_EXTENSIONS as h, type AgentStepEvent as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiOptions as m, type ArtifactEvent as n, type AuthContext as o, type AuthenticatedClient as p, type CitationSummary as q, type ConnectOptions as r, DOC_TERMINAL_STATUSES as s, type DocumentListFields as t, type DocumentListOrder as u, type DocumentWaiter as v, type DocumentWaiterOptions as w, type ListPaginatedOptions as x, type MessageMetadataPayload$1 as y, type MessageQueuedEvent as z };
4172
+ export { type UserInputRequestEvent as $, type AuthHeaders as A, type ReconnectableWsConnection as B, type ConfigStore as C, type DmCryptoContext as D, type ResolvedCitation as E, type FormattedWsMessage as F, type ResponseCompletedEvent as G, type ResponseContentPartAddedEvent as H, type ResponseCreatedEvent as I, type ResponseFailedEvent as J, type ResponseOutputItemAddedEvent as K, type ListAllOptions as L, type MessageLevel as M, type ResponseOutputItemDoneEvent as N, type OutputTokensDetails as O, type ResponseOutputTextDeltaEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SkippedFile as S, type ResponseOutputTextDoneEvent as T, type UploadResult as U, type ResponseUsage as V, type SSEEvent as W, type SSEStreamCallbacks as X, type SSEStreamResult as Y, type SSEStreamStartData as Z, type UserInfo as _, type CliConfig as a, type UserMessageEvent as a0, type WorkspaceContext as a1, type WsConnection as a2, agentconfig as a3, assistant as a4, authenticatedFetch as a5, buildRetrievalChunkTool as a6, buildRetrievalFullContextTool as a7, buildRetrievalTocTool as a8, connectWebSocket as a9, performSsoDeviceFlowLogin as aA, requireData as aB, requireOk as aC, resolveAuth as aD, resolveCitations as aE, resolveWorkspace as aF, responses as aG, selectWorkspace as aH, selectWorkspaceById as aI, settings as aJ, streamSSE as aK, stripCitationMarkdown as aL, summarizeCitations as aM, tags as aN, workspaces as aO, type ArbiErrorEvent as aP, connectWithReconnect as aa, consumeSSEStream as ab, contacts as ac, conversations as ad, countCitations as ae, createAuthenticatedClient as af, createDocumentWaiter as ag, dm as ah, doctags as ai, documents as aj, files as ak, formatAgentStepLabel as al, formatFileSize as am, formatStreamSummary as an, formatUserName as ao, formatWorkspaceChoices as ap, formatWsMessage as aq, generateEncryptedWorkspaceKey as ar, generateNewWorkspaceKey as as, getErrorCode as at, getErrorMessage as au, getRawWorkspaceKey as av, health as aw, parseSSEEvents as ax, performPasswordLogin as ay, performSigningKeyLogin as az, type CliCredentials as b, type ChatSession as c, type UploadBatchResult as d, type UploadOptions as e, type UploadDirectOptions as f, type UploadDirectResult as g, SUPPORTED_EXTENSIONS as h, type AgentStepEvent as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiOptions as m, type ArtifactEvent as n, type AuthContext as o, type AuthenticatedClient as p, type CitationSummary as q, type ConnectOptions as r, DOC_TERMINAL_STATUSES as s, type DocumentListFields as t, type DocumentListOrder as u, type DocumentWaiter as v, type DocumentWaiterOptions as w, type ListPaginatedOptions as x, type MessageMetadataPayload$1 as y, type MessageQueuedEvent as z };
@@ -320,6 +320,18 @@ declare function parseSSEEvents(chunk: string, buffer: string): {
320
320
  * Callbacks for streaming SSE events. All callbacks are optional —
321
321
  * omitted callbacks simply ignore that event type.
322
322
  */
323
+ /** Structured ARBI error event (e.g. quota exceeded mid-stream). */
324
+ interface ArbiErrorEvent {
325
+ code: string;
326
+ message: string;
327
+ /** Present for QUOTA_EXCEEDED — current spend in USD. */
328
+ spend?: number;
329
+ /** Present for QUOTA_EXCEEDED — budget cap in USD. */
330
+ budget?: number;
331
+ /** Present for QUOTA_EXCEEDED — affected project external id. */
332
+ project_ext_id?: string | null;
333
+ [key: string]: unknown;
334
+ }
323
335
  interface SSEStreamCallbacks {
324
336
  onStreamStart?: (data: SSEStreamStartData) => void;
325
337
  onToken?: (content: string) => void;
@@ -329,6 +341,12 @@ interface SSEStreamCallbacks {
329
341
  onContentPartAdded?: (data: ResponseContentPartAddedEvent) => void;
330
342
  onAgentStep?: (data: AgentStepEvent) => void;
331
343
  onError?: (message: string) => void;
344
+ /**
345
+ * Fired when the server emits a structured `arbi.error` event mid-stream.
346
+ * Backend uses this for quota-exceeded errors so clients can render an
347
+ * upgrade modal without losing the surrounding stream context.
348
+ */
349
+ onArbiError?: (event: ArbiErrorEvent) => void;
332
350
  onMessageQueued?: (data: MessageQueuedEvent) => void;
333
351
  onUserMessage?: (data: UserMessageEvent) => void;
334
352
  onMetadata?: (data: MessageMetadataPayload$1) => void;
@@ -1361,6 +1379,7 @@ declare class Arbi {
1361
1379
  list: () => Promise<{
1362
1380
  external_id: string;
1363
1381
  name: string;
1382
+ created_by: string;
1364
1383
  packs: number;
1365
1384
  subscription: string;
1366
1385
  created_at: string;
@@ -1379,6 +1398,7 @@ declare class Arbi {
1379
1398
  };
1380
1399
  budget_reset_at?: number | null | undefined;
1381
1400
  };
1401
+ daily_cap_per_user?: number | null | undefined;
1382
1402
  price_id?: string | null | undefined;
1383
1403
  plan?: string | null | undefined;
1384
1404
  amount?: number | null | undefined;
@@ -1390,6 +1410,7 @@ declare class Arbi {
1390
1410
  create: (name: string) => Promise<{
1391
1411
  external_id: string;
1392
1412
  name: string;
1413
+ created_by: string;
1393
1414
  packs: number;
1394
1415
  subscription: string;
1395
1416
  created_at: string;
@@ -1408,6 +1429,7 @@ declare class Arbi {
1408
1429
  };
1409
1430
  budget_reset_at?: number | null | undefined;
1410
1431
  };
1432
+ daily_cap_per_user?: number | null | undefined;
1411
1433
  price_id?: string | null | undefined;
1412
1434
  plan?: string | null | undefined;
1413
1435
  amount?: number | null | undefined;
@@ -1419,6 +1441,7 @@ declare class Arbi {
1419
1441
  refresh: (projectExtId: string) => Promise<{
1420
1442
  external_id: string;
1421
1443
  name: string;
1444
+ created_by: string;
1422
1445
  packs: number;
1423
1446
  subscription: string;
1424
1447
  created_at: string;
@@ -1437,6 +1460,7 @@ declare class Arbi {
1437
1460
  };
1438
1461
  budget_reset_at?: number | null | undefined;
1439
1462
  };
1463
+ daily_cap_per_user?: number | null | undefined;
1440
1464
  price_id?: string | null | undefined;
1441
1465
  plan?: string | null | undefined;
1442
1466
  amount?: number | null | undefined;
@@ -2659,6 +2683,8 @@ declare class Arbi {
2659
2683
  BM25_K1: number;
2660
2684
  BM25_B: number;
2661
2685
  BM25_AVGDL: number;
2686
+ CJK_NGRAM_SIZE: number;
2687
+ NORMALIZE_TRADITIONAL_TO_SIMPLIFIED: boolean;
2662
2688
  };
2663
2689
  } | {
2664
2690
  Agents: {
@@ -3973,6 +3999,8 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
3973
3999
  BM25_K1: number;
3974
4000
  BM25_B: number;
3975
4001
  BM25_AVGDL: number;
4002
+ CJK_NGRAM_SIZE: number;
4003
+ NORMALIZE_TRADITIONAL_TO_SIMPLIFIED: boolean;
3976
4004
  };
3977
4005
  } | {
3978
4006
  Agents: {
@@ -4141,4 +4169,4 @@ declare namespace responses {
4141
4169
  export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
4142
4170
  }
4143
4171
 
4144
- export { type UserInputRequestEvent as $, type AuthHeaders as A, type ReconnectableWsConnection as B, type ConfigStore as C, type DmCryptoContext as D, type ResolvedCitation as E, type FormattedWsMessage as F, type ResponseCompletedEvent as G, type ResponseContentPartAddedEvent as H, type ResponseCreatedEvent as I, type ResponseFailedEvent as J, type ResponseOutputItemAddedEvent as K, type ListAllOptions as L, type MessageLevel as M, type ResponseOutputItemDoneEvent as N, type OutputTokensDetails as O, type ResponseOutputTextDeltaEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SkippedFile as S, type ResponseOutputTextDoneEvent as T, type UploadResult as U, type ResponseUsage as V, type SSEEvent as W, type SSEStreamCallbacks as X, type SSEStreamResult as Y, type SSEStreamStartData as Z, type UserInfo as _, type CliConfig as a, type UserMessageEvent as a0, type WorkspaceContext as a1, type WsConnection as a2, agentconfig as a3, assistant as a4, authenticatedFetch as a5, buildRetrievalChunkTool as a6, buildRetrievalFullContextTool as a7, buildRetrievalTocTool as a8, connectWebSocket as a9, performSsoDeviceFlowLogin as aA, requireData as aB, requireOk as aC, resolveAuth as aD, resolveCitations as aE, resolveWorkspace as aF, responses as aG, selectWorkspace as aH, selectWorkspaceById as aI, settings as aJ, streamSSE as aK, stripCitationMarkdown as aL, summarizeCitations as aM, tags as aN, workspaces as aO, connectWithReconnect as aa, consumeSSEStream as ab, contacts as ac, conversations as ad, countCitations as ae, createAuthenticatedClient as af, createDocumentWaiter as ag, dm as ah, doctags as ai, documents as aj, files as ak, formatAgentStepLabel as al, formatFileSize as am, formatStreamSummary as an, formatUserName as ao, formatWorkspaceChoices as ap, formatWsMessage as aq, generateEncryptedWorkspaceKey as ar, generateNewWorkspaceKey as as, getErrorCode as at, getErrorMessage as au, getRawWorkspaceKey as av, health as aw, parseSSEEvents as ax, performPasswordLogin as ay, performSigningKeyLogin as az, type CliCredentials as b, type ChatSession as c, type UploadBatchResult as d, type UploadOptions as e, type UploadDirectOptions as f, type UploadDirectResult as g, SUPPORTED_EXTENSIONS as h, type AgentStepEvent as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiOptions as m, type ArtifactEvent as n, type AuthContext as o, type AuthenticatedClient as p, type CitationSummary as q, type ConnectOptions as r, DOC_TERMINAL_STATUSES as s, type DocumentListFields as t, type DocumentListOrder as u, type DocumentWaiter as v, type DocumentWaiterOptions as w, type ListPaginatedOptions as x, type MessageMetadataPayload$1 as y, type MessageQueuedEvent as z };
4172
+ export { type UserInputRequestEvent as $, type AuthHeaders as A, type ReconnectableWsConnection as B, type ConfigStore as C, type DmCryptoContext as D, type ResolvedCitation as E, type FormattedWsMessage as F, type ResponseCompletedEvent as G, type ResponseContentPartAddedEvent as H, type ResponseCreatedEvent as I, type ResponseFailedEvent as J, type ResponseOutputItemAddedEvent as K, type ListAllOptions as L, type MessageLevel as M, type ResponseOutputItemDoneEvent as N, type OutputTokensDetails as O, type ResponseOutputTextDeltaEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SkippedFile as S, type ResponseOutputTextDoneEvent as T, type UploadResult as U, type ResponseUsage as V, type SSEEvent as W, type SSEStreamCallbacks as X, type SSEStreamResult as Y, type SSEStreamStartData as Z, type UserInfo as _, type CliConfig as a, type UserMessageEvent as a0, type WorkspaceContext as a1, type WsConnection as a2, agentconfig as a3, assistant as a4, authenticatedFetch as a5, buildRetrievalChunkTool as a6, buildRetrievalFullContextTool as a7, buildRetrievalTocTool as a8, connectWebSocket as a9, performSsoDeviceFlowLogin as aA, requireData as aB, requireOk as aC, resolveAuth as aD, resolveCitations as aE, resolveWorkspace as aF, responses as aG, selectWorkspace as aH, selectWorkspaceById as aI, settings as aJ, streamSSE as aK, stripCitationMarkdown as aL, summarizeCitations as aM, tags as aN, workspaces as aO, type ArbiErrorEvent as aP, connectWithReconnect as aa, consumeSSEStream as ab, contacts as ac, conversations as ad, countCitations as ae, createAuthenticatedClient as af, createDocumentWaiter as ag, dm as ah, doctags as ai, documents as aj, files as ak, formatAgentStepLabel as al, formatFileSize as am, formatStreamSummary as an, formatUserName as ao, formatWorkspaceChoices as ap, formatWsMessage as aq, generateEncryptedWorkspaceKey as ar, generateNewWorkspaceKey as as, getErrorCode as at, getErrorMessage as au, getRawWorkspaceKey as av, health as aw, parseSSEEvents as ax, performPasswordLogin as ay, performSigningKeyLogin as az, type CliCredentials as b, type ChatSession as c, type UploadBatchResult as d, type UploadOptions as e, type UploadDirectOptions as f, type UploadDirectResult as g, SUPPORTED_EXTENSIONS as h, type AgentStepEvent as i, Arbi as j, ArbiApiError as k, ArbiError as l, type ArbiOptions as m, type ArtifactEvent as n, type AuthContext as o, type AuthenticatedClient as p, type CitationSummary as q, type ConnectOptions as r, DOC_TERMINAL_STATUSES as s, type DocumentListFields as t, type DocumentListOrder as u, type DocumentWaiter as v, type DocumentWaiterOptions as w, type ListPaginatedOptions as x, type MessageMetadataPayload$1 as y, type MessageQueuedEvent as z };