@arbidocs/sdk 0.3.109 → 0.3.111
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-B5b3SDW6.d.cts} +57 -4
- package/dist/{browser-C4gqnXaX.d.ts → browser-B5b3SDW6.d.ts} +57 -4
- package/dist/browser.cjs +35 -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 +35 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +35 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +35 -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 {
|
|
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,
|
|
1
|
+
import { o as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a3 as SkippedFile, ab as UploadResult, i as AuthHeaders, a7 as UploadBatchResult, aa as UploadOptions, a8 as UploadDirectOptions, a9 as UploadDirectResult, a1 as SUPPORTED_EXTENSIONS, s as DmCryptoContext } from './browser-B5b3SDW6.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, n as CommandDescriptor, p as ConnectOptions, D as DOC_TERMINAL_STATUSES, t as DocNameMap, u as DocumentListFields, v as DocumentListOrder, w as DocumentWaiter, x as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, y as ListPaginatedOptions, E as MessageLevel, G as MessageMetadataPayload, H as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, I as ReconnectableWsConnection, J as ResolvedCitation, K as ResponseCompletedEvent, N as ResponseContentPartAddedEvent, S as ResponseCreatedEvent, T as ResponseFailedEvent, U as ResponseOutputItemAddedEvent, V as ResponseOutputItemDoneEvent, W as ResponseOutputTextDeltaEvent, X as ResponseOutputTextDoneEvent, Y as ResponseUsage, Z as SSEEvent, _ as SSEStreamCallbacks, $ as SSEStreamResult, a0 as SSEStreamStartData, a2 as SkillSummary, ac as UserInfo, ad as UserInputRequestEvent, ae as UserMessageEvent, af as WebSocketAuthError, ag as WorkspaceContext, ah as WsConnection, ai as agentconfig, aj as assistant, ak as authenticatedFetch, al as buildRetrievalChunkTool, am as buildRetrievalFullContextTool, an as buildRetrievalTocTool, ao as connectWebSocket, ap as connectWithReconnect, aq as consumeSSEStream, ar as contacts, as as conversations, at as countCitations, au as createAuthenticatedClient, av as createDocumentWaiter, aw as dm, ax as doctags, ay as documents, az as files, aA as filterSkills, aB as formatAgentStepLabel, aC as formatFileSize, aD as formatStreamSummary, aE as formatUserName, aF as formatWorkspaceChoices, aG as formatWsMessage, aH as generateEncryptedWorkspaceKey, aI as generateNewWorkspaceKey, aJ as getErrorCode, aK as getErrorMessage, aL as getRawWorkspaceKey, aM as health, aO as parseSSEEvents, aP as parseSlashCommand, aQ as parseSlashTokenInProgress, aR as performPasswordLogin, aS as performSigningKeyLogin, aT as performSsoDeviceFlowLogin, aU as requireData, aV as requireOk, aW as resolveAuth, aX as resolveCitations, aY as resolveWorkspace, aZ as responses, a_ as selectWorkspace, a$ as selectWorkspaceById, b0 as settings, b1 as streamSSE, b2 as stripCitationMarkdown, b3 as summarizeCitations, b4 as tags, b6 as workspaces } from './browser-B5b3SDW6.cjs';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -450,6 +450,9 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
450
450
|
TEMPERATURE: number;
|
|
451
451
|
MAX_TOKENS: number;
|
|
452
452
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
453
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
454
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
455
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
453
456
|
};
|
|
454
457
|
TitleLLM: {
|
|
455
458
|
API_TYPE: "local" | "remote";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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,
|
|
1
|
+
import { o as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, a3 as SkippedFile, ab as UploadResult, i as AuthHeaders, a7 as UploadBatchResult, aa as UploadOptions, a8 as UploadDirectOptions, a9 as UploadDirectResult, a1 as SUPPORTED_EXTENSIONS, s as DmCryptoContext } from './browser-B5b3SDW6.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, n as CommandDescriptor, p as ConnectOptions, D as DOC_TERMINAL_STATUSES, t as DocNameMap, u as DocumentListFields, v as DocumentListOrder, w as DocumentWaiter, x as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, y as ListPaginatedOptions, E as MessageLevel, G as MessageMetadataPayload, H as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, I as ReconnectableWsConnection, J as ResolvedCitation, K as ResponseCompletedEvent, N as ResponseContentPartAddedEvent, S as ResponseCreatedEvent, T as ResponseFailedEvent, U as ResponseOutputItemAddedEvent, V as ResponseOutputItemDoneEvent, W as ResponseOutputTextDeltaEvent, X as ResponseOutputTextDoneEvent, Y as ResponseUsage, Z as SSEEvent, _ as SSEStreamCallbacks, $ as SSEStreamResult, a0 as SSEStreamStartData, a2 as SkillSummary, ac as UserInfo, ad as UserInputRequestEvent, ae as UserMessageEvent, af as WebSocketAuthError, ag as WorkspaceContext, ah as WsConnection, ai as agentconfig, aj as assistant, ak as authenticatedFetch, al as buildRetrievalChunkTool, am as buildRetrievalFullContextTool, an as buildRetrievalTocTool, ao as connectWebSocket, ap as connectWithReconnect, aq as consumeSSEStream, ar as contacts, as as conversations, at as countCitations, au as createAuthenticatedClient, av as createDocumentWaiter, aw as dm, ax as doctags, ay as documents, az as files, aA as filterSkills, aB as formatAgentStepLabel, aC as formatFileSize, aD as formatStreamSummary, aE as formatUserName, aF as formatWorkspaceChoices, aG as formatWsMessage, aH as generateEncryptedWorkspaceKey, aI as generateNewWorkspaceKey, aJ as getErrorCode, aK as getErrorMessage, aL as getRawWorkspaceKey, aM as health, aO as parseSSEEvents, aP as parseSlashCommand, aQ as parseSlashTokenInProgress, aR as performPasswordLogin, aS as performSigningKeyLogin, aT as performSsoDeviceFlowLogin, aU as requireData, aV as requireOk, aW as resolveAuth, aX as resolveCitations, aY as resolveWorkspace, aZ as responses, a_ as selectWorkspace, a$ as selectWorkspaceById, b0 as settings, b1 as streamSSE, b2 as stripCitationMarkdown, b3 as summarizeCitations, b4 as tags, b6 as workspaces } from './browser-B5b3SDW6.js';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -450,6 +450,9 @@ declare function getAgentConfig(arbi: ArbiClient, agentExtId: string): Promise<{
|
|
|
450
450
|
TEMPERATURE: number;
|
|
451
451
|
MAX_TOKENS: number;
|
|
452
452
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
453
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
454
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
455
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
453
456
|
};
|
|
454
457
|
TitleLLM: {
|
|
455
458
|
API_TYPE: "local" | "remote";
|
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;
|
|
@@ -5327,6 +5338,7 @@ __export(assistant_exports, {
|
|
|
5327
5338
|
buildRetrievalFullContextTool: () => buildRetrievalFullContextTool,
|
|
5328
5339
|
buildRetrievalTocTool: () => buildRetrievalTocTool,
|
|
5329
5340
|
filterSkills: () => filterSkills,
|
|
5341
|
+
listCommands: () => listCommands,
|
|
5330
5342
|
listSkills: () => listSkills,
|
|
5331
5343
|
parseSlashCommand: () => parseSlashCommand,
|
|
5332
5344
|
parseSlashTokenInProgress: () => parseSlashTokenInProgress,
|
|
@@ -5434,6 +5446,13 @@ async function listSkills(arbi, options) {
|
|
|
5434
5446
|
);
|
|
5435
5447
|
return result.skills;
|
|
5436
5448
|
}
|
|
5449
|
+
async function listCommands(arbi) {
|
|
5450
|
+
const result = requireData(
|
|
5451
|
+
await arbi.fetch.GET("/v1/assistant/commands", {}),
|
|
5452
|
+
"Failed to list commands"
|
|
5453
|
+
);
|
|
5454
|
+
return result.commands;
|
|
5455
|
+
}
|
|
5437
5456
|
function parseSlashCommand(input) {
|
|
5438
5457
|
const m2 = /^\s*\/([a-zA-Z0-9_-]+)(?:\s+([\s\S]*))?$/.exec(input);
|
|
5439
5458
|
if (!m2) return null;
|
|
@@ -6093,6 +6112,19 @@ var Arbi = class {
|
|
|
6093
6112
|
get hasWorkspace() {
|
|
6094
6113
|
return this.currentWorkspaceId !== null;
|
|
6095
6114
|
}
|
|
6115
|
+
/**
|
|
6116
|
+
* Live connection info for opening a raw transport (e.g. a WebSocket).
|
|
6117
|
+
*
|
|
6118
|
+
* Reads the access token from the session on each call, so a token refreshed
|
|
6119
|
+
* elsewhere is reflected on the next (re)connect. Returns `null` when there is
|
|
6120
|
+
* no client/token yet (not logged in) rather than throwing, so callers can
|
|
6121
|
+
* poll for readiness instead of guarding against exceptions.
|
|
6122
|
+
*/
|
|
6123
|
+
getConnectionInfo() {
|
|
6124
|
+
const accessToken = this.client?.session.getState().accessToken;
|
|
6125
|
+
if (!accessToken) return null;
|
|
6126
|
+
return { baseUrl: this.options.url, accessToken };
|
|
6127
|
+
}
|
|
6096
6128
|
// ── Auth headers (for raw fetch operations) ───────────────────────────
|
|
6097
6129
|
getAuthHeaders() {
|
|
6098
6130
|
const client = this.requireClient();
|