@arbidocs/sdk 0.3.108 → 0.3.110
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-C4gqnXaX.d.cts → browser-DgApY8QV.d.cts} +29 -2
- package/dist/{browser-C4gqnXaX.d.ts → browser-DgApY8QV.d.ts} +29 -2
- package/dist/browser.cjs +27 -3
- 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 +27 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +27 -3
- 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 +27 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a2 as SkippedFile, aa as UploadResult, i as AuthHeaders, a6 as UploadBatchResult, a9 as UploadOptions, a7 as UploadDirectOptions, a8 as UploadDirectResult, a0 as SUPPORTED_EXTENSIONS, r as DmCryptoContext } from './browser-
|
|
2
|
-
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, s as DocNameMap, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, B as MessageLevel, E as MessageMetadataPayload, G as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, H as ReconnectableWsConnection, I as ResolvedCitation, J as ResponseCompletedEvent, K as ResponseContentPartAddedEvent, N as ResponseCreatedEvent, S as ResponseFailedEvent, T as ResponseOutputItemAddedEvent, U as ResponseOutputItemDoneEvent, V as ResponseOutputTextDeltaEvent, W as ResponseOutputTextDoneEvent, X as ResponseUsage, Y as SSEEvent, Z as SSEStreamCallbacks, _ as SSEStreamResult, $ as SSEStreamStartData, a1 as SkillSummary, ab as UserInfo, ac as UserInputRequestEvent, ad as UserMessageEvent, ae as WebSocketAuthError, af as WorkspaceContext, ag as WsConnection, ah as agentconfig, ai as assistant, aj as authenticatedFetch, ak as buildRetrievalChunkTool, al as buildRetrievalFullContextTool, am as buildRetrievalTocTool, an as connectWebSocket, ao as connectWithReconnect, ap as consumeSSEStream, aq as contacts, ar as conversations, as as countCitations, at as createAuthenticatedClient, au as createDocumentWaiter, av as dm, aw as doctags, ax as documents, ay as files, az as filterSkills, aA as formatAgentStepLabel, aB as formatFileSize, aC as formatStreamSummary, aD as formatUserName, aE as formatWorkspaceChoices, aF as formatWsMessage, aG as generateEncryptedWorkspaceKey, aH as generateNewWorkspaceKey, aI as getErrorCode, aJ as getErrorMessage, aK as getRawWorkspaceKey, aL as health, aN as parseSSEEvents, aO as parseSlashCommand, aP as parseSlashTokenInProgress, aQ as performPasswordLogin, aR as performSigningKeyLogin, aS as performSsoDeviceFlowLogin, aT as requireData, aU as requireOk, aV as resolveAuth, aW as resolveCitations, aX as resolveWorkspace, aY as responses, aZ as selectWorkspace, a_ as selectWorkspaceById, a$ as settings, b0 as streamSSE, b1 as stripCitationMarkdown, b2 as summarizeCitations, b3 as tags, b5 as workspaces } from './browser-
|
|
1
|
+
import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a2 as SkippedFile, aa as UploadResult, i as AuthHeaders, a6 as UploadBatchResult, a9 as UploadOptions, a7 as UploadDirectOptions, a8 as UploadDirectResult, a0 as SUPPORTED_EXTENSIONS, r as DmCryptoContext } from './browser-DgApY8QV.cjs';
|
|
2
|
+
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, s as DocNameMap, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, B as MessageLevel, E as MessageMetadataPayload, G as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, H as ReconnectableWsConnection, I as ResolvedCitation, J as ResponseCompletedEvent, K as ResponseContentPartAddedEvent, N as ResponseCreatedEvent, S as ResponseFailedEvent, T as ResponseOutputItemAddedEvent, U as ResponseOutputItemDoneEvent, V as ResponseOutputTextDeltaEvent, W as ResponseOutputTextDoneEvent, X as ResponseUsage, Y as SSEEvent, Z as SSEStreamCallbacks, _ as SSEStreamResult, $ as SSEStreamStartData, a1 as SkillSummary, ab as UserInfo, ac as UserInputRequestEvent, ad as UserMessageEvent, ae as WebSocketAuthError, af as WorkspaceContext, ag as WsConnection, ah as agentconfig, ai as assistant, aj as authenticatedFetch, ak as buildRetrievalChunkTool, al as buildRetrievalFullContextTool, am as buildRetrievalTocTool, an as connectWebSocket, ao as connectWithReconnect, ap as consumeSSEStream, aq as contacts, ar as conversations, as as countCitations, at as createAuthenticatedClient, au as createDocumentWaiter, av as dm, aw as doctags, ax as documents, ay as files, az as filterSkills, aA as formatAgentStepLabel, aB as formatFileSize, aC as formatStreamSummary, aD as formatUserName, aE as formatWorkspaceChoices, aF as formatWsMessage, aG as generateEncryptedWorkspaceKey, aH as generateNewWorkspaceKey, aI as getErrorCode, aJ as getErrorMessage, aK as getRawWorkspaceKey, aL as health, aN as parseSSEEvents, aO as parseSlashCommand, aP as parseSlashTokenInProgress, aQ as performPasswordLogin, aR as performSigningKeyLogin, aS as performSsoDeviceFlowLogin, aT as requireData, aU as requireOk, aV as resolveAuth, aW as resolveCitations, aX as resolveWorkspace, aY as responses, aZ as selectWorkspace, a_ as selectWorkspaceById, a$ as settings, b0 as streamSSE, b1 as stripCitationMarkdown, b2 as summarizeCitations, b3 as tags, b5 as workspaces } from './browser-DgApY8QV.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 { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a2 as SkippedFile, aa as UploadResult, i as AuthHeaders, a6 as UploadBatchResult, a9 as UploadOptions, a7 as UploadDirectOptions, a8 as UploadDirectResult, a0 as SUPPORTED_EXTENSIONS, r as DmCryptoContext } from './browser-
|
|
2
|
-
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, s as DocNameMap, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, B as MessageLevel, E as MessageMetadataPayload, G as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, H as ReconnectableWsConnection, I as ResolvedCitation, J as ResponseCompletedEvent, K as ResponseContentPartAddedEvent, N as ResponseCreatedEvent, S as ResponseFailedEvent, T as ResponseOutputItemAddedEvent, U as ResponseOutputItemDoneEvent, V as ResponseOutputTextDeltaEvent, W as ResponseOutputTextDoneEvent, X as ResponseUsage, Y as SSEEvent, Z as SSEStreamCallbacks, _ as SSEStreamResult, $ as SSEStreamStartData, a1 as SkillSummary, ab as UserInfo, ac as UserInputRequestEvent, ad as UserMessageEvent, ae as WebSocketAuthError, af as WorkspaceContext, ag as WsConnection, ah as agentconfig, ai as assistant, aj as authenticatedFetch, ak as buildRetrievalChunkTool, al as buildRetrievalFullContextTool, am as buildRetrievalTocTool, an as connectWebSocket, ao as connectWithReconnect, ap as consumeSSEStream, aq as contacts, ar as conversations, as as countCitations, at as createAuthenticatedClient, au as createDocumentWaiter, av as dm, aw as doctags, ax as documents, ay as files, az as filterSkills, aA as formatAgentStepLabel, aB as formatFileSize, aC as formatStreamSummary, aD as formatUserName, aE as formatWorkspaceChoices, aF as formatWsMessage, aG as generateEncryptedWorkspaceKey, aH as generateNewWorkspaceKey, aI as getErrorCode, aJ as getErrorMessage, aK as getRawWorkspaceKey, aL as health, aN as parseSSEEvents, aO as parseSlashCommand, aP as parseSlashTokenInProgress, aQ as performPasswordLogin, aR as performSigningKeyLogin, aS as performSsoDeviceFlowLogin, aT as requireData, aU as requireOk, aV as resolveAuth, aW as resolveCitations, aX as resolveWorkspace, aY as responses, aZ as selectWorkspace, a_ as selectWorkspaceById, a$ as settings, b0 as streamSSE, b1 as stripCitationMarkdown, b2 as summarizeCitations, b3 as tags, b5 as workspaces } from './browser-
|
|
1
|
+
import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a2 as SkippedFile, aa as UploadResult, i as AuthHeaders, a6 as UploadBatchResult, a9 as UploadOptions, a7 as UploadDirectOptions, a8 as UploadDirectResult, a0 as SUPPORTED_EXTENSIONS, r as DmCryptoContext } from './browser-DgApY8QV.js';
|
|
2
|
+
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, s as DocNameMap, t as DocumentListFields, u as DocumentListOrder, v as DocumentWaiter, w as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, x as ListPaginatedOptions, B as MessageLevel, E as MessageMetadataPayload, G as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, H as ReconnectableWsConnection, I as ResolvedCitation, J as ResponseCompletedEvent, K as ResponseContentPartAddedEvent, N as ResponseCreatedEvent, S as ResponseFailedEvent, T as ResponseOutputItemAddedEvent, U as ResponseOutputItemDoneEvent, V as ResponseOutputTextDeltaEvent, W as ResponseOutputTextDoneEvent, X as ResponseUsage, Y as SSEEvent, Z as SSEStreamCallbacks, _ as SSEStreamResult, $ as SSEStreamStartData, a1 as SkillSummary, ab as UserInfo, ac as UserInputRequestEvent, ad as UserMessageEvent, ae as WebSocketAuthError, af as WorkspaceContext, ag as WsConnection, ah as agentconfig, ai as assistant, aj as authenticatedFetch, ak as buildRetrievalChunkTool, al as buildRetrievalFullContextTool, am as buildRetrievalTocTool, an as connectWebSocket, ao as connectWithReconnect, ap as consumeSSEStream, aq as contacts, ar as conversations, as as countCitations, at as createAuthenticatedClient, au as createDocumentWaiter, av as dm, aw as doctags, ax as documents, ay as files, az as filterSkills, aA as formatAgentStepLabel, aB as formatFileSize, aC as formatStreamSummary, aD as formatUserName, aE as formatWorkspaceChoices, aF as formatWsMessage, aG as generateEncryptedWorkspaceKey, aH as generateNewWorkspaceKey, aI as getErrorCode, aJ as getErrorMessage, aK as getRawWorkspaceKey, aL as health, aN as parseSSEEvents, aO as parseSlashCommand, aP as parseSlashTokenInProgress, aQ as performPasswordLogin, aR as performSigningKeyLogin, aS as performSsoDeviceFlowLogin, aT as requireData, aU as requireOk, aV as resolveAuth, aW as resolveCitations, aX as resolveWorkspace, aY as responses, aZ as selectWorkspace, a_ as selectWorkspaceById, a$ as settings, b0 as streamSSE, b1 as stripCitationMarkdown, b2 as summarizeCitations, b3 as tags, b5 as workspaces } from './browser-DgApY8QV.js';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4456,7 +4456,7 @@ var WebSocketAuthError = class extends Error {
|
|
|
4456
4456
|
}
|
|
4457
4457
|
};
|
|
4458
4458
|
function connectWebSocket(options) {
|
|
4459
|
-
const { baseUrl, accessToken, onMessage, onClose } = options;
|
|
4459
|
+
const { baseUrl, accessToken, onMessage, onClose, onAuthenticated } = options;
|
|
4460
4460
|
const url = buildWebSocketUrl(baseUrl);
|
|
4461
4461
|
return new Promise((resolve2, reject) => {
|
|
4462
4462
|
const ws = new WebSocket(url);
|
|
@@ -4479,6 +4479,7 @@ function connectWebSocket(options) {
|
|
|
4479
4479
|
clearTimeout(timeout);
|
|
4480
4480
|
if (msg.success) {
|
|
4481
4481
|
authenticated = true;
|
|
4482
|
+
onAuthenticated?.(msg);
|
|
4482
4483
|
resolve2({ close: () => ws.close() });
|
|
4483
4484
|
} else {
|
|
4484
4485
|
ws.close();
|
|
@@ -4512,6 +4513,8 @@ async function connectWithReconnect(options) {
|
|
|
4512
4513
|
onReconnectFailed,
|
|
4513
4514
|
onClose,
|
|
4514
4515
|
onMessage,
|
|
4516
|
+
onAuthenticated,
|
|
4517
|
+
shouldReconnect,
|
|
4515
4518
|
baseUrl,
|
|
4516
4519
|
accessToken
|
|
4517
4520
|
} = options;
|
|
@@ -4526,10 +4529,11 @@ async function connectWithReconnect(options) {
|
|
|
4526
4529
|
baseUrl,
|
|
4527
4530
|
accessToken: token,
|
|
4528
4531
|
onMessage,
|
|
4532
|
+
onAuthenticated,
|
|
4529
4533
|
onClose: (code, reason) => {
|
|
4530
4534
|
currentConnection = null;
|
|
4531
4535
|
onClose?.(code, reason);
|
|
4532
|
-
if (!closed) void scheduleReconnect();
|
|
4536
|
+
if (!closed && (shouldReconnect?.(code, reason) ?? true)) void scheduleReconnect();
|
|
4533
4537
|
}
|
|
4534
4538
|
});
|
|
4535
4539
|
};
|
|
@@ -4560,7 +4564,14 @@ async function connectWithReconnect(options) {
|
|
|
4560
4564
|
}
|
|
4561
4565
|
if (!closed) onReconnectFailed?.();
|
|
4562
4566
|
};
|
|
4563
|
-
|
|
4567
|
+
try {
|
|
4568
|
+
currentConnection = await connectOnce();
|
|
4569
|
+
} catch (err) {
|
|
4570
|
+
if (!(err instanceof WebSocketAuthError) || !refreshAuth) throw err;
|
|
4571
|
+
await refreshAuth().catch(() => {
|
|
4572
|
+
});
|
|
4573
|
+
currentConnection = await connectOnce();
|
|
4574
|
+
}
|
|
4564
4575
|
return {
|
|
4565
4576
|
close: () => {
|
|
4566
4577
|
closed = true;
|
|
@@ -6093,6 +6104,19 @@ var Arbi = class {
|
|
|
6093
6104
|
get hasWorkspace() {
|
|
6094
6105
|
return this.currentWorkspaceId !== null;
|
|
6095
6106
|
}
|
|
6107
|
+
/**
|
|
6108
|
+
* Live connection info for opening a raw transport (e.g. a WebSocket).
|
|
6109
|
+
*
|
|
6110
|
+
* Reads the access token from the session on each call, so a token refreshed
|
|
6111
|
+
* elsewhere is reflected on the next (re)connect. Returns `null` when there is
|
|
6112
|
+
* no client/token yet (not logged in) rather than throwing, so callers can
|
|
6113
|
+
* poll for readiness instead of guarding against exceptions.
|
|
6114
|
+
*/
|
|
6115
|
+
getConnectionInfo() {
|
|
6116
|
+
const accessToken = this.client?.session.getState().accessToken;
|
|
6117
|
+
if (!accessToken) return null;
|
|
6118
|
+
return { baseUrl: this.options.url, accessToken };
|
|
6119
|
+
}
|
|
6096
6120
|
// ── Auth headers (for raw fetch operations) ───────────────────────────
|
|
6097
6121
|
getAuthHeaders() {
|
|
6098
6122
|
const client = this.requireClient();
|