@arbidocs/sdk 0.3.46 → 0.3.47
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.
- package/dist/{browser-HVCa8Ph5.d.cts → browser-CtYFcHNd.d.cts} +19 -7
- package/dist/{browser-HVCa8Ph5.d.ts → browser-CtYFcHNd.d.ts} +19 -7
- package/dist/browser.cjs +18 -9
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +18 -9
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +18 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ConfigStore, a as CliConfig, b as CliCredentials, c as ChatSession, S as SkippedFile, U as UploadResult, A as AuthHeaders, d as UploadBatchResult, e as UploadOptions, f as UploadDirectOptions, g as UploadDirectResult, h as SUPPORTED_EXTENSIONS, D as DmCryptoContext } from './browser-
|
|
2
|
-
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, p as AuthenticatedClient, q as CitationSummary, r as ConnectOptions, s as DOC_TERMINAL_STATUSES, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, M as MessageLevel, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ag as createDocumentWaiter, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, an as formatStreamSummary, ao as formatUserName, ap as formatWorkspaceChoices, aq as formatWsMessage, ar as generateEncryptedWorkspaceKey, as as generateNewWorkspaceKey, at as getErrorCode, au as getErrorMessage, av as getRawWorkspaceKey, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, az as performSigningKeyLogin, aA as performSsoDeviceFlowLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-
|
|
1
|
+
import { C as ConfigStore, a as CliConfig, b as CliCredentials, c as ChatSession, S as SkippedFile, U as UploadResult, A as AuthHeaders, d as UploadBatchResult, e as UploadOptions, f as UploadDirectOptions, g as UploadDirectResult, h as SUPPORTED_EXTENSIONS, D as DmCryptoContext } from './browser-CtYFcHNd.cjs';
|
|
2
|
+
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, p as AuthenticatedClient, q as CitationSummary, r as ConnectOptions, s as DOC_TERMINAL_STATUSES, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, M as MessageLevel, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ag as createDocumentWaiter, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, an as formatStreamSummary, ao as formatUserName, ap as formatWorkspaceChoices, aq as formatWsMessage, ar as generateEncryptedWorkspaceKey, as as generateNewWorkspaceKey, at as getErrorCode, au as getErrorMessage, av as getRawWorkspaceKey, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, az as performSigningKeyLogin, aA as performSsoDeviceFlowLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-CtYFcHNd.cjs';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ConfigStore, a as CliConfig, b as CliCredentials, c as ChatSession, S as SkippedFile, U as UploadResult, A as AuthHeaders, d as UploadBatchResult, e as UploadOptions, f as UploadDirectOptions, g as UploadDirectResult, h as SUPPORTED_EXTENSIONS, D as DmCryptoContext } from './browser-
|
|
2
|
-
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, p as AuthenticatedClient, q as CitationSummary, r as ConnectOptions, s as DOC_TERMINAL_STATUSES, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, M as MessageLevel, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ag as createDocumentWaiter, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, an as formatStreamSummary, ao as formatUserName, ap as formatWorkspaceChoices, aq as formatWsMessage, ar as generateEncryptedWorkspaceKey, as as generateNewWorkspaceKey, at as getErrorCode, au as getErrorMessage, av as getRawWorkspaceKey, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, az as performSigningKeyLogin, aA as performSsoDeviceFlowLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-
|
|
1
|
+
import { C as ConfigStore, a as CliConfig, b as CliCredentials, c as ChatSession, S as SkippedFile, U as UploadResult, A as AuthHeaders, d as UploadBatchResult, e as UploadOptions, f as UploadDirectOptions, g as UploadDirectResult, h as SUPPORTED_EXTENSIONS, D as DmCryptoContext } from './browser-CtYFcHNd.js';
|
|
2
|
+
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, p as AuthenticatedClient, q as CitationSummary, r as ConnectOptions, s as DOC_TERMINAL_STATUSES, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, M as MessageLevel, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ag as createDocumentWaiter, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, an as formatStreamSummary, ao as formatUserName, ap as formatWorkspaceChoices, aq as formatWsMessage, ar as generateEncryptedWorkspaceKey, as as generateNewWorkspaceKey, at as getErrorCode, au as getErrorMessage, av as getRawWorkspaceKey, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, az as performSigningKeyLogin, aA as performSsoDeviceFlowLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-CtYFcHNd.js';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4700,10 +4700,17 @@ async function listDocuments(arbi) {
|
|
|
4700
4700
|
return requireData(await arbi.fetch.GET("/v1/document/list"), "Failed to fetch documents");
|
|
4701
4701
|
}
|
|
4702
4702
|
async function* listPaginated(arbi, options = {}) {
|
|
4703
|
-
const {
|
|
4704
|
-
|
|
4703
|
+
const {
|
|
4704
|
+
pageSize = 5e3,
|
|
4705
|
+
firstPageSize,
|
|
4706
|
+
order = "id_asc",
|
|
4707
|
+
fields,
|
|
4708
|
+
signal,
|
|
4709
|
+
lookahead = 1
|
|
4710
|
+
} = options;
|
|
4711
|
+
const fetchPage = async (pageOffset, limit) => {
|
|
4705
4712
|
const query = {
|
|
4706
|
-
limit
|
|
4713
|
+
limit,
|
|
4707
4714
|
offset: pageOffset,
|
|
4708
4715
|
order
|
|
4709
4716
|
};
|
|
@@ -4726,19 +4733,21 @@ async function* listPaginated(arbi, options = {}) {
|
|
|
4726
4733
|
const queue = [];
|
|
4727
4734
|
const tryEnqueue = () => {
|
|
4728
4735
|
while (!done && queue.length < depth && issued < MAX_PAGES) {
|
|
4729
|
-
const
|
|
4730
|
-
|
|
4736
|
+
const limit = issued === 0 && firstPageSize !== void 0 ? firstPageSize : pageSize;
|
|
4737
|
+
const promise = fetchPage(nextOffsetToIssue, limit);
|
|
4738
|
+
promise.catch(() => {
|
|
4731
4739
|
});
|
|
4732
|
-
queue.push(
|
|
4733
|
-
nextOffsetToIssue +=
|
|
4740
|
+
queue.push({ limit, promise });
|
|
4741
|
+
nextOffsetToIssue += limit;
|
|
4734
4742
|
issued++;
|
|
4735
4743
|
}
|
|
4736
4744
|
};
|
|
4737
4745
|
tryEnqueue();
|
|
4738
4746
|
while (queue.length > 0 && !signal?.aborted) {
|
|
4739
|
-
const
|
|
4747
|
+
const { limit, promise } = queue.shift();
|
|
4748
|
+
const page = await promise;
|
|
4740
4749
|
if (signal?.aborted) return;
|
|
4741
|
-
const isShort = page.length <
|
|
4750
|
+
const isShort = page.length < limit;
|
|
4742
4751
|
if (isShort) done = true;
|
|
4743
4752
|
tryEnqueue();
|
|
4744
4753
|
if (page.length > 0) {
|