@arbidocs/sdk 0.3.37 → 0.3.39

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.
@@ -572,6 +572,68 @@ declare function stripCitationMarkdown(text: string): string;
572
572
  */
573
573
 
574
574
  type DocUpdateRequest$1 = components['schemas']['DocUpdateRequest'];
575
+ type DocResponse = components['schemas']['DocResponse'];
576
+ /**
577
+ * Ordering for paginated document listing.
578
+ *
579
+ * - `id_asc` — walk by primary key (default). Stable, matches legacy behavior.
580
+ * - `created_desc` — newest-first. Uses a warm index; preferred for progressive
581
+ * loaders that want the most-recently-added docs in the first page.
582
+ *
583
+ * These values are derived from the backend schema docs for the `order` query
584
+ * param on `GET /v1/document/list`. The schema types the param as `string` to
585
+ * allow future additions without a breaking schema change, so we define the
586
+ * narrow union here in the SDK.
587
+ */
588
+ type DocumentListOrder = 'id_asc' | 'created_desc';
589
+ /**
590
+ * Response shape for paginated document listing.
591
+ *
592
+ * - `full` (default) — returns full `DocResponse` with decrypted `doc_metadata`
593
+ * and joined `doctags`. Same as the legacy single-shot endpoint.
594
+ * - `lite` — skips the doctags JOIN and `doc_metadata` decrypt. Returned docs
595
+ * will have `doctags: []` and `doc_metadata: null`. Use this for listing
596
+ * large workspaces and fetch full per-doc data on demand via
597
+ * `GET /v1/document/` when a specific doc is opened.
598
+ *
599
+ * These values are derived from the backend schema docs for the `fields` query
600
+ * param on `GET /v1/document/list`. The schema types the param as `string`.
601
+ */
602
+ type DocumentListFields = 'full' | 'lite';
603
+ /**
604
+ * Options for paginated document listing.
605
+ */
606
+ interface ListPaginatedOptions {
607
+ /**
608
+ * Number of documents per page.
609
+ * @default 5000
610
+ */
611
+ pageSize?: number;
612
+ /**
613
+ * Sort order for pagination.
614
+ * @default 'id_asc'
615
+ */
616
+ order?: DocumentListOrder;
617
+ /**
618
+ * Response shape. Use `'lite'` to skip doctags and doc_metadata decrypt.
619
+ * When `fields: 'lite'`, returned docs have `doctags: []` and `doc_metadata: null`.
620
+ * Fetch full per-doc data on demand when a specific doc is opened.
621
+ * @default 'full'
622
+ */
623
+ fields?: DocumentListFields;
624
+ /**
625
+ * AbortSignal to cancel iteration mid-stream.
626
+ */
627
+ signal?: AbortSignal;
628
+ }
629
+ /**
630
+ * Options for `listAll` — collects all pages into a single array.
631
+ */
632
+ interface ListAllOptions extends Omit<ListPaginatedOptions, 'signal'> {
633
+ signal?: AbortSignal;
634
+ }
635
+ /** Hard cap on pages to guard against runaway loops on misbehaving backends. */
636
+ declare const MAX_PAGES = 400;
575
637
  /** File extensions supported for document upload. */
576
638
  declare const SUPPORTED_EXTENSIONS: Set<string>;
577
639
  /**
@@ -655,6 +717,40 @@ declare function listDocuments(arbi: ArbiClient): Promise<{
655
717
  title?: string | null | undefined;
656
718
  } | null | undefined;
657
719
  }[]>;
720
+ /**
721
+ * Async iterator that yields pages of documents sequentially.
722
+ *
723
+ * Fetches pages one at a time using `limit`/`offset` pagination. Sequential
724
+ * (not parallel) because the backend decrypt step is CPU-bound on a shared
725
+ * thread pool — parallel requests contend and don't finish meaningfully faster.
726
+ *
727
+ * @example
728
+ * ```ts
729
+ * for await (const page of listPaginated(arbi, { pageSize: 5000, order: 'created_desc', fields: 'lite' })) {
730
+ * // page: DocResponse[] — render incrementally as pages arrive
731
+ * }
732
+ * ```
733
+ *
734
+ * @param arbi - Authenticated ArbiClient
735
+ * @param options - Pagination options (pageSize, order, fields, signal)
736
+ * @yields Pages of documents until the backend returns a short page or signal is aborted
737
+ */
738
+ declare function listPaginated(arbi: ArbiClient, options?: ListPaginatedOptions): AsyncGenerator<DocResponse[]>;
739
+ /**
740
+ * Collect all workspace documents into a single array using sequential pagination.
741
+ *
742
+ * Uses `listPaginated` internally. Warns if `MAX_PAGES` is hit.
743
+ *
744
+ * **Note:** When `fields: 'lite'` is passed, returned docs have `doctags: []`
745
+ * and `doc_metadata: null`. Fetch full per-doc data on demand when a specific
746
+ * doc is opened.
747
+ *
748
+ * @example
749
+ * ```ts
750
+ * const docs = await listAll(arbi, { fields: 'lite', order: 'created_desc' })
751
+ * ```
752
+ */
753
+ declare function listAll(arbi: ArbiClient, options?: ListAllOptions): Promise<DocResponse[]>;
658
754
  declare function getDocuments(arbi: ArbiClient, externalIds: string[]): Promise<{
659
755
  external_id: string;
660
756
  workspace_ext_id: string;
@@ -839,6 +935,11 @@ interface UploadDirectResult {
839
935
  declare function uploadDocumentsDirect(arbi: ArbiClient, workspaceKey: Uint8Array, files: DirectUploadFile[], options?: UploadDirectOptions): Promise<UploadDirectResult>;
840
936
 
841
937
  type documents_DirectUploadFile = DirectUploadFile;
938
+ type documents_DocumentListFields = DocumentListFields;
939
+ type documents_DocumentListOrder = DocumentListOrder;
940
+ type documents_ListAllOptions = ListAllOptions;
941
+ type documents_ListPaginatedOptions = ListPaginatedOptions;
942
+ declare const documents_MAX_PAGES: typeof MAX_PAGES;
842
943
  declare const documents_SUPPORTED_EXTENSIONS: typeof SUPPORTED_EXTENSIONS;
843
944
  type documents_SkippedFile = SkippedFile;
844
945
  type documents_UploadBatchResult = UploadBatchResult;
@@ -850,14 +951,16 @@ declare const documents_deleteDocuments: typeof deleteDocuments;
850
951
  declare const documents_downloadDocument: typeof downloadDocument;
851
952
  declare const documents_getDocuments: typeof getDocuments;
852
953
  declare const documents_getParsedContent: typeof getParsedContent;
954
+ declare const documents_listAll: typeof listAll;
853
955
  declare const documents_listDocuments: typeof listDocuments;
956
+ declare const documents_listPaginated: typeof listPaginated;
854
957
  declare const documents_sanitizeFolderPath: typeof sanitizeFolderPath;
855
958
  declare const documents_updateDocuments: typeof updateDocuments;
856
959
  declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
857
960
  declare const documents_uploadFiles: typeof uploadFiles;
858
961
  declare const documents_uploadUrl: typeof uploadUrl;
859
962
  declare namespace documents {
860
- export { type documents_DirectUploadFile as DirectUploadFile, 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_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listDocuments as listDocuments, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
963
+ export { type documents_DirectUploadFile as DirectUploadFile, 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_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
861
964
  }
862
965
 
863
966
  /**
@@ -1499,6 +1602,78 @@ declare class Arbi {
1499
1602
  title?: string | null | undefined;
1500
1603
  } | null | undefined;
1501
1604
  }[]>;
1605
+ /**
1606
+ * Async iterator that yields pages of documents sequentially.
1607
+ * Use this for large workspaces to stream output as pages arrive.
1608
+ *
1609
+ * @example
1610
+ * ```ts
1611
+ * for await (const page of arbi.documents.listPaginated({ pageSize: 5000, order: 'created_desc', fields: 'lite' })) {
1612
+ * // page: DocResponse[] — render incrementally
1613
+ * }
1614
+ * ```
1615
+ */
1616
+ listPaginated: (options?: ListPaginatedOptions) => AsyncGenerator<{
1617
+ external_id: string;
1618
+ workspace_ext_id: string;
1619
+ file_name?: string | null;
1620
+ status?: string | null;
1621
+ error_message?: string | null;
1622
+ n_pages?: number | null;
1623
+ n_chunks?: number | null;
1624
+ tokens?: number | null;
1625
+ file_type?: string | null;
1626
+ file_size?: number | null;
1627
+ storage_type?: string | null;
1628
+ storage_uri?: string | null;
1629
+ content_hash?: string | null;
1630
+ shared?: boolean | null;
1631
+ re_ocred?: boolean | null;
1632
+ config_ext_id?: string | null;
1633
+ parent_ext_id?: string | null;
1634
+ created_by_ext_id: string;
1635
+ updated_by_ext_id?: string | null;
1636
+ created_at: string;
1637
+ updated_at: string;
1638
+ wp_type?: string | null;
1639
+ folder?: string | null;
1640
+ doctags: components["schemas"]["DocTagResponse"][];
1641
+ doc_metadata?: components["schemas"]["DocMetadata"] | null;
1642
+ }[], any, any>;
1643
+ /**
1644
+ * Collect all workspace documents into a single array using sequential pagination.
1645
+ *
1646
+ * **Note:** When `fields: 'lite'` is passed, returned docs have `doctags: []`
1647
+ * and `doc_metadata: null`. Fetch full per-doc data on demand when a specific
1648
+ * doc is opened.
1649
+ */
1650
+ listAll: (options?: ListAllOptions) => Promise<{
1651
+ external_id: string;
1652
+ workspace_ext_id: string;
1653
+ file_name?: string | null;
1654
+ status?: string | null;
1655
+ error_message?: string | null;
1656
+ n_pages?: number | null;
1657
+ n_chunks?: number | null;
1658
+ tokens?: number | null;
1659
+ file_type?: string | null;
1660
+ file_size?: number | null;
1661
+ storage_type?: string | null;
1662
+ storage_uri?: string | null;
1663
+ content_hash?: string | null;
1664
+ shared?: boolean | null;
1665
+ re_ocred?: boolean | null;
1666
+ config_ext_id?: string | null;
1667
+ parent_ext_id?: string | null;
1668
+ created_by_ext_id: string;
1669
+ updated_by_ext_id?: string | null;
1670
+ created_at: string;
1671
+ updated_at: string;
1672
+ wp_type?: string | null;
1673
+ folder?: string | null;
1674
+ doctags: components["schemas"]["DocTagResponse"][];
1675
+ doc_metadata?: components["schemas"]["DocMetadata"] | null;
1676
+ }[]>;
1502
1677
  get: (externalIds: string[]) => Promise<{
1503
1678
  external_id: string;
1504
1679
  workspace_ext_id: string;
@@ -3860,4 +4035,4 @@ declare namespace responses {
3860
4035
  export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
3861
4036
  }
3862
4037
 
3863
- export { agentconfig as $, type AuthHeaders as A, type ResponseContentPartAddedEvent as B, type ConfigStore as C, type DmCryptoContext as D, type ResponseCreatedEvent as E, type FormattedWsMessage as F, type ResponseFailedEvent as G, type ResponseOutputItemAddedEvent as H, type ResponseOutputItemDoneEvent as I, type ResponseOutputTextDeltaEvent as J, type ResponseOutputTextDoneEvent as K, type ResponseUsage as L, type MessageLevel as M, type SSEEvent as N, type OutputTokensDetails as O, type SSEStreamCallbacks as P, type QueryOptions as Q, type ReconnectOptions as R, type SkippedFile as S, type SSEStreamResult as T, type UploadResult as U, type SSEStreamStartData as V, type UserInfo as W, type UserInputRequestEvent as X, type UserMessageEvent as Y, type WorkspaceContext as Z, type WsConnection as _, type CliConfig as a, assistant as a0, authenticatedFetch as a1, buildRetrievalChunkTool as a2, buildRetrievalFullContextTool as a3, buildRetrievalTocTool as a4, connectWebSocket as a5, connectWithReconnect as a6, consumeSSEStream as a7, contacts as a8, conversations as a9, resolveCitations as aA, resolveWorkspace as aB, responses as aC, selectWorkspace as aD, selectWorkspaceById as aE, settings as aF, streamSSE as aG, stripCitationMarkdown as aH, summarizeCitations as aI, tags as aJ, workspaces as aK, countCitations as aa, createAuthenticatedClient as ab, createDocumentWaiter as ac, dm as ad, doctags as ae, documents as af, files as ag, formatAgentStepLabel as ah, formatFileSize as ai, formatStreamSummary as aj, formatUserName as ak, formatWorkspaceChoices as al, formatWsMessage as am, generateEncryptedWorkspaceKey as an, generateNewWorkspaceKey as ao, getErrorCode as ap, getErrorMessage as aq, getRawWorkspaceKey as ar, health as as, parseSSEEvents as at, performPasswordLogin as au, performSigningKeyLogin as av, performSsoDeviceFlowLogin as aw, requireData as ax, requireOk as ay, resolveAuth 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 DocumentWaiter as t, type DocumentWaiterOptions as u, type MessageMetadataPayload$1 as v, type MessageQueuedEvent as w, type ReconnectableWsConnection as x, type ResolvedCitation as y, type ResponseCompletedEvent as z };
4038
+ 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 };
@@ -572,6 +572,68 @@ declare function stripCitationMarkdown(text: string): string;
572
572
  */
573
573
 
574
574
  type DocUpdateRequest$1 = components['schemas']['DocUpdateRequest'];
575
+ type DocResponse = components['schemas']['DocResponse'];
576
+ /**
577
+ * Ordering for paginated document listing.
578
+ *
579
+ * - `id_asc` — walk by primary key (default). Stable, matches legacy behavior.
580
+ * - `created_desc` — newest-first. Uses a warm index; preferred for progressive
581
+ * loaders that want the most-recently-added docs in the first page.
582
+ *
583
+ * These values are derived from the backend schema docs for the `order` query
584
+ * param on `GET /v1/document/list`. The schema types the param as `string` to
585
+ * allow future additions without a breaking schema change, so we define the
586
+ * narrow union here in the SDK.
587
+ */
588
+ type DocumentListOrder = 'id_asc' | 'created_desc';
589
+ /**
590
+ * Response shape for paginated document listing.
591
+ *
592
+ * - `full` (default) — returns full `DocResponse` with decrypted `doc_metadata`
593
+ * and joined `doctags`. Same as the legacy single-shot endpoint.
594
+ * - `lite` — skips the doctags JOIN and `doc_metadata` decrypt. Returned docs
595
+ * will have `doctags: []` and `doc_metadata: null`. Use this for listing
596
+ * large workspaces and fetch full per-doc data on demand via
597
+ * `GET /v1/document/` when a specific doc is opened.
598
+ *
599
+ * These values are derived from the backend schema docs for the `fields` query
600
+ * param on `GET /v1/document/list`. The schema types the param as `string`.
601
+ */
602
+ type DocumentListFields = 'full' | 'lite';
603
+ /**
604
+ * Options for paginated document listing.
605
+ */
606
+ interface ListPaginatedOptions {
607
+ /**
608
+ * Number of documents per page.
609
+ * @default 5000
610
+ */
611
+ pageSize?: number;
612
+ /**
613
+ * Sort order for pagination.
614
+ * @default 'id_asc'
615
+ */
616
+ order?: DocumentListOrder;
617
+ /**
618
+ * Response shape. Use `'lite'` to skip doctags and doc_metadata decrypt.
619
+ * When `fields: 'lite'`, returned docs have `doctags: []` and `doc_metadata: null`.
620
+ * Fetch full per-doc data on demand when a specific doc is opened.
621
+ * @default 'full'
622
+ */
623
+ fields?: DocumentListFields;
624
+ /**
625
+ * AbortSignal to cancel iteration mid-stream.
626
+ */
627
+ signal?: AbortSignal;
628
+ }
629
+ /**
630
+ * Options for `listAll` — collects all pages into a single array.
631
+ */
632
+ interface ListAllOptions extends Omit<ListPaginatedOptions, 'signal'> {
633
+ signal?: AbortSignal;
634
+ }
635
+ /** Hard cap on pages to guard against runaway loops on misbehaving backends. */
636
+ declare const MAX_PAGES = 400;
575
637
  /** File extensions supported for document upload. */
576
638
  declare const SUPPORTED_EXTENSIONS: Set<string>;
577
639
  /**
@@ -655,6 +717,40 @@ declare function listDocuments(arbi: ArbiClient): Promise<{
655
717
  title?: string | null | undefined;
656
718
  } | null | undefined;
657
719
  }[]>;
720
+ /**
721
+ * Async iterator that yields pages of documents sequentially.
722
+ *
723
+ * Fetches pages one at a time using `limit`/`offset` pagination. Sequential
724
+ * (not parallel) because the backend decrypt step is CPU-bound on a shared
725
+ * thread pool — parallel requests contend and don't finish meaningfully faster.
726
+ *
727
+ * @example
728
+ * ```ts
729
+ * for await (const page of listPaginated(arbi, { pageSize: 5000, order: 'created_desc', fields: 'lite' })) {
730
+ * // page: DocResponse[] — render incrementally as pages arrive
731
+ * }
732
+ * ```
733
+ *
734
+ * @param arbi - Authenticated ArbiClient
735
+ * @param options - Pagination options (pageSize, order, fields, signal)
736
+ * @yields Pages of documents until the backend returns a short page or signal is aborted
737
+ */
738
+ declare function listPaginated(arbi: ArbiClient, options?: ListPaginatedOptions): AsyncGenerator<DocResponse[]>;
739
+ /**
740
+ * Collect all workspace documents into a single array using sequential pagination.
741
+ *
742
+ * Uses `listPaginated` internally. Warns if `MAX_PAGES` is hit.
743
+ *
744
+ * **Note:** When `fields: 'lite'` is passed, returned docs have `doctags: []`
745
+ * and `doc_metadata: null`. Fetch full per-doc data on demand when a specific
746
+ * doc is opened.
747
+ *
748
+ * @example
749
+ * ```ts
750
+ * const docs = await listAll(arbi, { fields: 'lite', order: 'created_desc' })
751
+ * ```
752
+ */
753
+ declare function listAll(arbi: ArbiClient, options?: ListAllOptions): Promise<DocResponse[]>;
658
754
  declare function getDocuments(arbi: ArbiClient, externalIds: string[]): Promise<{
659
755
  external_id: string;
660
756
  workspace_ext_id: string;
@@ -839,6 +935,11 @@ interface UploadDirectResult {
839
935
  declare function uploadDocumentsDirect(arbi: ArbiClient, workspaceKey: Uint8Array, files: DirectUploadFile[], options?: UploadDirectOptions): Promise<UploadDirectResult>;
840
936
 
841
937
  type documents_DirectUploadFile = DirectUploadFile;
938
+ type documents_DocumentListFields = DocumentListFields;
939
+ type documents_DocumentListOrder = DocumentListOrder;
940
+ type documents_ListAllOptions = ListAllOptions;
941
+ type documents_ListPaginatedOptions = ListPaginatedOptions;
942
+ declare const documents_MAX_PAGES: typeof MAX_PAGES;
842
943
  declare const documents_SUPPORTED_EXTENSIONS: typeof SUPPORTED_EXTENSIONS;
843
944
  type documents_SkippedFile = SkippedFile;
844
945
  type documents_UploadBatchResult = UploadBatchResult;
@@ -850,14 +951,16 @@ declare const documents_deleteDocuments: typeof deleteDocuments;
850
951
  declare const documents_downloadDocument: typeof downloadDocument;
851
952
  declare const documents_getDocuments: typeof getDocuments;
852
953
  declare const documents_getParsedContent: typeof getParsedContent;
954
+ declare const documents_listAll: typeof listAll;
853
955
  declare const documents_listDocuments: typeof listDocuments;
956
+ declare const documents_listPaginated: typeof listPaginated;
854
957
  declare const documents_sanitizeFolderPath: typeof sanitizeFolderPath;
855
958
  declare const documents_updateDocuments: typeof updateDocuments;
856
959
  declare const documents_uploadDocumentsDirect: typeof uploadDocumentsDirect;
857
960
  declare const documents_uploadFiles: typeof uploadFiles;
858
961
  declare const documents_uploadUrl: typeof uploadUrl;
859
962
  declare namespace documents {
860
- export { type documents_DirectUploadFile as DirectUploadFile, 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_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listDocuments as listDocuments, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
963
+ export { type documents_DirectUploadFile as DirectUploadFile, 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_getDocuments as getDocuments, documents_getParsedContent as getParsedContent, documents_listAll as listAll, documents_listDocuments as listDocuments, documents_listPaginated as listPaginated, documents_sanitizeFolderPath as sanitizeFolderPath, documents_updateDocuments as updateDocuments, documents_uploadDocumentsDirect as uploadDocumentsDirect, uploadFile$1 as uploadFile, documents_uploadFiles as uploadFiles, documents_uploadUrl as uploadUrl };
861
964
  }
862
965
 
863
966
  /**
@@ -1499,6 +1602,78 @@ declare class Arbi {
1499
1602
  title?: string | null | undefined;
1500
1603
  } | null | undefined;
1501
1604
  }[]>;
1605
+ /**
1606
+ * Async iterator that yields pages of documents sequentially.
1607
+ * Use this for large workspaces to stream output as pages arrive.
1608
+ *
1609
+ * @example
1610
+ * ```ts
1611
+ * for await (const page of arbi.documents.listPaginated({ pageSize: 5000, order: 'created_desc', fields: 'lite' })) {
1612
+ * // page: DocResponse[] — render incrementally
1613
+ * }
1614
+ * ```
1615
+ */
1616
+ listPaginated: (options?: ListPaginatedOptions) => AsyncGenerator<{
1617
+ external_id: string;
1618
+ workspace_ext_id: string;
1619
+ file_name?: string | null;
1620
+ status?: string | null;
1621
+ error_message?: string | null;
1622
+ n_pages?: number | null;
1623
+ n_chunks?: number | null;
1624
+ tokens?: number | null;
1625
+ file_type?: string | null;
1626
+ file_size?: number | null;
1627
+ storage_type?: string | null;
1628
+ storage_uri?: string | null;
1629
+ content_hash?: string | null;
1630
+ shared?: boolean | null;
1631
+ re_ocred?: boolean | null;
1632
+ config_ext_id?: string | null;
1633
+ parent_ext_id?: string | null;
1634
+ created_by_ext_id: string;
1635
+ updated_by_ext_id?: string | null;
1636
+ created_at: string;
1637
+ updated_at: string;
1638
+ wp_type?: string | null;
1639
+ folder?: string | null;
1640
+ doctags: components["schemas"]["DocTagResponse"][];
1641
+ doc_metadata?: components["schemas"]["DocMetadata"] | null;
1642
+ }[], any, any>;
1643
+ /**
1644
+ * Collect all workspace documents into a single array using sequential pagination.
1645
+ *
1646
+ * **Note:** When `fields: 'lite'` is passed, returned docs have `doctags: []`
1647
+ * and `doc_metadata: null`. Fetch full per-doc data on demand when a specific
1648
+ * doc is opened.
1649
+ */
1650
+ listAll: (options?: ListAllOptions) => Promise<{
1651
+ external_id: string;
1652
+ workspace_ext_id: string;
1653
+ file_name?: string | null;
1654
+ status?: string | null;
1655
+ error_message?: string | null;
1656
+ n_pages?: number | null;
1657
+ n_chunks?: number | null;
1658
+ tokens?: number | null;
1659
+ file_type?: string | null;
1660
+ file_size?: number | null;
1661
+ storage_type?: string | null;
1662
+ storage_uri?: string | null;
1663
+ content_hash?: string | null;
1664
+ shared?: boolean | null;
1665
+ re_ocred?: boolean | null;
1666
+ config_ext_id?: string | null;
1667
+ parent_ext_id?: string | null;
1668
+ created_by_ext_id: string;
1669
+ updated_by_ext_id?: string | null;
1670
+ created_at: string;
1671
+ updated_at: string;
1672
+ wp_type?: string | null;
1673
+ folder?: string | null;
1674
+ doctags: components["schemas"]["DocTagResponse"][];
1675
+ doc_metadata?: components["schemas"]["DocMetadata"] | null;
1676
+ }[]>;
1502
1677
  get: (externalIds: string[]) => Promise<{
1503
1678
  external_id: string;
1504
1679
  workspace_ext_id: string;
@@ -3860,4 +4035,4 @@ declare namespace responses {
3860
4035
  export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
3861
4036
  }
3862
4037
 
3863
- export { agentconfig as $, type AuthHeaders as A, type ResponseContentPartAddedEvent as B, type ConfigStore as C, type DmCryptoContext as D, type ResponseCreatedEvent as E, type FormattedWsMessage as F, type ResponseFailedEvent as G, type ResponseOutputItemAddedEvent as H, type ResponseOutputItemDoneEvent as I, type ResponseOutputTextDeltaEvent as J, type ResponseOutputTextDoneEvent as K, type ResponseUsage as L, type MessageLevel as M, type SSEEvent as N, type OutputTokensDetails as O, type SSEStreamCallbacks as P, type QueryOptions as Q, type ReconnectOptions as R, type SkippedFile as S, type SSEStreamResult as T, type UploadResult as U, type SSEStreamStartData as V, type UserInfo as W, type UserInputRequestEvent as X, type UserMessageEvent as Y, type WorkspaceContext as Z, type WsConnection as _, type CliConfig as a, assistant as a0, authenticatedFetch as a1, buildRetrievalChunkTool as a2, buildRetrievalFullContextTool as a3, buildRetrievalTocTool as a4, connectWebSocket as a5, connectWithReconnect as a6, consumeSSEStream as a7, contacts as a8, conversations as a9, resolveCitations as aA, resolveWorkspace as aB, responses as aC, selectWorkspace as aD, selectWorkspaceById as aE, settings as aF, streamSSE as aG, stripCitationMarkdown as aH, summarizeCitations as aI, tags as aJ, workspaces as aK, countCitations as aa, createAuthenticatedClient as ab, createDocumentWaiter as ac, dm as ad, doctags as ae, documents as af, files as ag, formatAgentStepLabel as ah, formatFileSize as ai, formatStreamSummary as aj, formatUserName as ak, formatWorkspaceChoices as al, formatWsMessage as am, generateEncryptedWorkspaceKey as an, generateNewWorkspaceKey as ao, getErrorCode as ap, getErrorMessage as aq, getRawWorkspaceKey as ar, health as as, parseSSEEvents as at, performPasswordLogin as au, performSigningKeyLogin as av, performSsoDeviceFlowLogin as aw, requireData as ax, requireOk as ay, resolveAuth 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 DocumentWaiter as t, type DocumentWaiterOptions as u, type MessageMetadataPayload$1 as v, type MessageQueuedEvent as w, type ReconnectableWsConnection as x, type ResolvedCitation as y, type ResponseCompletedEvent as z };
4038
+ 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 };