@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SessionStorageProvider, ArbiClient, LoginResult, components, WebSocketServerMessage, WsTaskUpdateMessage, KeyPair } from '@arbidocs/client';
|
|
1
|
+
import { SessionStorageProvider, ArbiClient, LoginResult, components, WebSocketServerMessage, WsAuthResultMessage, WsTaskUpdateMessage, KeyPair } from '@arbidocs/client';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Core error types and throwing error utilities.
|
|
@@ -470,6 +470,12 @@ interface ConnectOptions {
|
|
|
470
470
|
accessToken: string;
|
|
471
471
|
onMessage: (msg: WebSocketServerMessage) => void;
|
|
472
472
|
onClose?: (code: number, reason: string) => void;
|
|
473
|
+
/**
|
|
474
|
+
* Called once the server accepts auth (`auth_result { success: true }`). The
|
|
475
|
+
* full message is passed so callers can read fields like `new_messages`. The
|
|
476
|
+
* auth handshake itself is owned by the transport — this is a notification.
|
|
477
|
+
*/
|
|
478
|
+
onAuthenticated?: (msg: WsAuthResultMessage) => void;
|
|
473
479
|
}
|
|
474
480
|
interface ReconnectOptions extends ConnectOptions {
|
|
475
481
|
/**
|
|
@@ -497,6 +503,12 @@ interface ReconnectOptions extends ConnectOptions {
|
|
|
497
503
|
onReconnecting?: (attempt: number, maxRetries: number) => void;
|
|
498
504
|
onReconnected?: () => void;
|
|
499
505
|
onReconnectFailed?: () => void;
|
|
506
|
+
/**
|
|
507
|
+
* Decide whether to reconnect after a given close. Return `false` to stop —
|
|
508
|
+
* e.g. a server-initiated single-session eviction (code 1008), where
|
|
509
|
+
* reconnecting would just get kicked again. Default: always reconnect.
|
|
510
|
+
*/
|
|
511
|
+
shouldReconnect?: (code: number, reason: string) => boolean;
|
|
500
512
|
}
|
|
501
513
|
interface ReconnectableWsConnection {
|
|
502
514
|
close: () => void;
|
|
@@ -511,7 +523,10 @@ declare function connectWebSocket(options: ConnectOptions): Promise<WsConnection
|
|
|
511
523
|
/**
|
|
512
524
|
* Connect WebSocket with automatic reconnection on disconnect.
|
|
513
525
|
*
|
|
514
|
-
*
|
|
526
|
+
* The initial connection is auth-symmetric with the reconnect loop: if the first
|
|
527
|
+
* attempt is rejected for auth reasons and `refreshAuth` is provided, it re-logs
|
|
528
|
+
* in and retries once with the fresh token before throwing. Any other failure —
|
|
529
|
+
* or a still-failing retry — throws to the caller.
|
|
515
530
|
* After successful auth, disconnects trigger exponential backoff reconnection:
|
|
516
531
|
* - a fresh token is resolved before every attempt (see `getAccessToken`), so a
|
|
517
532
|
* token rotated elsewhere is picked up rather than reusing a stale one;
|
|
@@ -1256,6 +1271,21 @@ type SkillSummary = components['schemas']['SkillSummaryResponse'];
|
|
|
1256
1271
|
declare function listSkills(arbi: ArbiClient, options?: {
|
|
1257
1272
|
includeHidden?: boolean;
|
|
1258
1273
|
}): Promise<SkillSummary[]>;
|
|
1274
|
+
/** A built-in slash command as exposed by ``GET /v1/assistant/commands``.
|
|
1275
|
+
* These are shipped commands (``/image``, ``/compact``, …) from the backend
|
|
1276
|
+
* command registry — distinct from dynamic user-authored skills. */
|
|
1277
|
+
type CommandDescriptor = components['schemas']['CommandDescriptorResponse'];
|
|
1278
|
+
/**
|
|
1279
|
+
* List the built-in slash commands the caller can invoke (``/image``,
|
|
1280
|
+
* ``/compact``, ``/goal``, ``/pa``, …), respecting per-user gates
|
|
1281
|
+
* (``show_pa_mode`` / ``GOALS_ENABLED``).
|
|
1282
|
+
*
|
|
1283
|
+
* These come from the backend command registry — the single source of truth
|
|
1284
|
+
* shared with the dispatcher — so clients no longer hardcode the list. Merge
|
|
1285
|
+
* with {@link listSkills} to build a complete slash menu (built-ins + dynamic
|
|
1286
|
+
* user-authored skills).
|
|
1287
|
+
*/
|
|
1288
|
+
declare function listCommands(arbi: ArbiClient): Promise<CommandDescriptor[]>;
|
|
1259
1289
|
/** Parsed slash-command shape, regardless of frontend. */
|
|
1260
1290
|
interface ParsedSlashCommand {
|
|
1261
1291
|
/** The lowercased token immediately after ``/``. */
|
|
@@ -1310,6 +1340,7 @@ declare function filterSkills<T extends {
|
|
|
1310
1340
|
type assistant_AssistantQueryOptions = AssistantQueryOptions;
|
|
1311
1341
|
type assistant_Chunk = Chunk;
|
|
1312
1342
|
type assistant_ChunkMetadata = ChunkMetadata;
|
|
1343
|
+
type assistant_CommandDescriptor = CommandDescriptor;
|
|
1313
1344
|
type assistant_ParsedSlashCommand = ParsedSlashCommand;
|
|
1314
1345
|
type assistant_RetrieveOptions = RetrieveOptions;
|
|
1315
1346
|
type assistant_RetrieveResult = RetrieveResult;
|
|
@@ -1318,6 +1349,7 @@ declare const assistant_buildRetrievalChunkTool: typeof buildRetrievalChunkTool;
|
|
|
1318
1349
|
declare const assistant_buildRetrievalFullContextTool: typeof buildRetrievalFullContextTool;
|
|
1319
1350
|
declare const assistant_buildRetrievalTocTool: typeof buildRetrievalTocTool;
|
|
1320
1351
|
declare const assistant_filterSkills: typeof filterSkills;
|
|
1352
|
+
declare const assistant_listCommands: typeof listCommands;
|
|
1321
1353
|
declare const assistant_listSkills: typeof listSkills;
|
|
1322
1354
|
declare const assistant_parseSlashCommand: typeof parseSlashCommand;
|
|
1323
1355
|
declare const assistant_parseSlashTokenInProgress: typeof parseSlashTokenInProgress;
|
|
@@ -1325,7 +1357,7 @@ declare const assistant_queryAssistant: typeof queryAssistant;
|
|
|
1325
1357
|
declare const assistant_respondToAgent: typeof respondToAgent;
|
|
1326
1358
|
declare const assistant_retrieve: typeof retrieve;
|
|
1327
1359
|
declare namespace assistant {
|
|
1328
|
-
export { type assistant_AssistantQueryOptions as AssistantQueryOptions, type assistant_Chunk as Chunk, type assistant_ChunkMetadata as ChunkMetadata, type assistant_ParsedSlashCommand as ParsedSlashCommand, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, type assistant_SkillSummary as SkillSummary, assistant_buildRetrievalChunkTool as buildRetrievalChunkTool, assistant_buildRetrievalFullContextTool as buildRetrievalFullContextTool, assistant_buildRetrievalTocTool as buildRetrievalTocTool, assistant_filterSkills as filterSkills, assistant_listSkills as listSkills, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_respondToAgent as respondToAgent, assistant_retrieve as retrieve };
|
|
1360
|
+
export { type assistant_AssistantQueryOptions as AssistantQueryOptions, type assistant_Chunk as Chunk, type assistant_ChunkMetadata as ChunkMetadata, type assistant_CommandDescriptor as CommandDescriptor, type assistant_ParsedSlashCommand as ParsedSlashCommand, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, type assistant_SkillSummary as SkillSummary, assistant_buildRetrievalChunkTool as buildRetrievalChunkTool, assistant_buildRetrievalFullContextTool as buildRetrievalFullContextTool, assistant_buildRetrievalTocTool as buildRetrievalTocTool, assistant_filterSkills as filterSkills, assistant_listCommands as listCommands, assistant_listSkills as listSkills, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_respondToAgent as respondToAgent, assistant_retrieve as retrieve };
|
|
1329
1361
|
}
|
|
1330
1362
|
|
|
1331
1363
|
/**
|
|
@@ -1630,6 +1662,18 @@ declare class Arbi {
|
|
|
1630
1662
|
get isLoggedIn(): boolean;
|
|
1631
1663
|
/** Check if a workspace is selected. */
|
|
1632
1664
|
get hasWorkspace(): boolean;
|
|
1665
|
+
/**
|
|
1666
|
+
* Live connection info for opening a raw transport (e.g. a WebSocket).
|
|
1667
|
+
*
|
|
1668
|
+
* Reads the access token from the session on each call, so a token refreshed
|
|
1669
|
+
* elsewhere is reflected on the next (re)connect. Returns `null` when there is
|
|
1670
|
+
* no client/token yet (not logged in) rather than throwing, so callers can
|
|
1671
|
+
* poll for readiness instead of guarding against exceptions.
|
|
1672
|
+
*/
|
|
1673
|
+
getConnectionInfo(): {
|
|
1674
|
+
baseUrl: string;
|
|
1675
|
+
accessToken: string;
|
|
1676
|
+
} | null;
|
|
1633
1677
|
private getAuthHeaders;
|
|
1634
1678
|
readonly projects: {
|
|
1635
1679
|
list: () => Promise<{
|
|
@@ -2908,6 +2952,9 @@ declare class Arbi {
|
|
|
2908
2952
|
TEMPERATURE: number;
|
|
2909
2953
|
MAX_TOKENS: number;
|
|
2910
2954
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
2955
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
2956
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
2957
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
2911
2958
|
};
|
|
2912
2959
|
TitleLLM: {
|
|
2913
2960
|
API_TYPE: "local" | "remote";
|
|
@@ -3334,6 +3381,9 @@ declare class Arbi {
|
|
|
3334
3381
|
TEMPERATURE: number;
|
|
3335
3382
|
MAX_TOKENS: number;
|
|
3336
3383
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
3384
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
3385
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
3386
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
3337
3387
|
};
|
|
3338
3388
|
TitleLLM: {
|
|
3339
3389
|
API_TYPE: "local" | "remote";
|
|
@@ -4871,6 +4921,9 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
|
|
|
4871
4921
|
TEMPERATURE: number;
|
|
4872
4922
|
MAX_TOKENS: number;
|
|
4873
4923
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
4924
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
4925
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
4926
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
4874
4927
|
};
|
|
4875
4928
|
TitleLLM: {
|
|
4876
4929
|
API_TYPE: "local" | "remote";
|
|
@@ -5227,4 +5280,4 @@ declare namespace responses {
|
|
|
5227
5280
|
export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
|
|
5228
5281
|
}
|
|
5229
5282
|
|
|
5230
|
-
export { type
|
|
5283
|
+
export { type SSEStreamResult as $, type AgentStepDeltaEvent as A, type MemorySearchResponse as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type MessageLevel as E, type FormattedWsMessage as F, type MessageMetadataPayload$1 as G, type MessageQueuedEvent as H, type ReconnectableWsConnection as I, type ResolvedCitation as J, type ResponseCompletedEvent as K, type ListAllOptions as L, type MemoryResponse as M, type ResponseContentPartAddedEvent as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type QueryOptions as Q, type ReconnectOptions as R, type ResponseCreatedEvent as S, type ResponseFailedEvent as T, type ResponseOutputItemAddedEvent as U, type ResponseOutputItemDoneEvent as V, type ResponseOutputTextDeltaEvent as W, type ResponseOutputTextDoneEvent as X, type ResponseUsage as Y, type SSEEvent as Z, type SSEStreamCallbacks as _, type AgentStepEvent as a, selectWorkspaceById as a$, type SSEStreamStartData as a0, SUPPORTED_EXTENSIONS as a1, type SkillSummary as a2, type SkippedFile as a3, type TaskResponse as a4, type UpdateMemoryRequest as a5, type UpdateTaskRequest as a6, type UploadBatchResult as a7, type UploadDirectOptions as a8, type UploadDirectResult as a9, filterSkills as aA, formatAgentStepLabel as aB, formatFileSize as aC, formatStreamSummary as aD, formatUserName as aE, formatWorkspaceChoices as aF, formatWsMessage as aG, generateEncryptedWorkspaceKey as aH, generateNewWorkspaceKey as aI, getErrorCode as aJ, getErrorMessage as aK, getRawWorkspaceKey as aL, health as aM, memory as aN, parseSSEEvents as aO, parseSlashCommand as aP, parseSlashTokenInProgress as aQ, performPasswordLogin as aR, performSigningKeyLogin as aS, performSsoDeviceFlowLogin as aT, requireData as aU, requireOk as aV, resolveAuth as aW, resolveCitations as aX, resolveWorkspace as aY, responses as aZ, selectWorkspace as a_, type UploadOptions as aa, type UploadResult as ab, type UserInfo as ac, type UserInputRequestEvent as ad, type UserMessageEvent as ae, WebSocketAuthError as af, type WorkspaceContext as ag, type WsConnection as ah, agentconfig as ai, assistant as aj, authenticatedFetch as ak, buildRetrievalChunkTool as al, buildRetrievalFullContextTool as am, buildRetrievalTocTool as an, connectWebSocket as ao, connectWithReconnect as ap, consumeSSEStream as aq, contacts as ar, conversations as as, countCitations as at, createAuthenticatedClient as au, createDocumentWaiter as av, dm as aw, doctags as ax, documents as ay, files as az, Arbi as b, settings as b0, streamSSE as b1, stripCitationMarkdown as b2, summarizeCitations as b3, tags as b4, tasks as b5, workspaces as b6, ArbiApiError as c, ArbiError as d, type ArbiErrorEvent as e, type ArbiOptions as f, type ArtifactEvent as g, type AuthContext as h, type AuthHeaders as i, type AuthenticatedClient as j, type CitationSummary as k, type CliConfig as l, type CliCredentials as m, type CommandDescriptor as n, type ConfigStore as o, type ConnectOptions as p, type CreateMemoryRequest as q, type CreateTaskRequest as r, type DmCryptoContext as s, type DocNameMap as t, type DocumentListFields as u, type DocumentListOrder as v, type DocumentWaiter as w, type DocumentWaiterOptions as x, type ListPaginatedOptions as y, type MemorySearchRequest as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SessionStorageProvider, ArbiClient, LoginResult, components, WebSocketServerMessage, WsTaskUpdateMessage, KeyPair } from '@arbidocs/client';
|
|
1
|
+
import { SessionStorageProvider, ArbiClient, LoginResult, components, WebSocketServerMessage, WsAuthResultMessage, WsTaskUpdateMessage, KeyPair } from '@arbidocs/client';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Core error types and throwing error utilities.
|
|
@@ -470,6 +470,12 @@ interface ConnectOptions {
|
|
|
470
470
|
accessToken: string;
|
|
471
471
|
onMessage: (msg: WebSocketServerMessage) => void;
|
|
472
472
|
onClose?: (code: number, reason: string) => void;
|
|
473
|
+
/**
|
|
474
|
+
* Called once the server accepts auth (`auth_result { success: true }`). The
|
|
475
|
+
* full message is passed so callers can read fields like `new_messages`. The
|
|
476
|
+
* auth handshake itself is owned by the transport — this is a notification.
|
|
477
|
+
*/
|
|
478
|
+
onAuthenticated?: (msg: WsAuthResultMessage) => void;
|
|
473
479
|
}
|
|
474
480
|
interface ReconnectOptions extends ConnectOptions {
|
|
475
481
|
/**
|
|
@@ -497,6 +503,12 @@ interface ReconnectOptions extends ConnectOptions {
|
|
|
497
503
|
onReconnecting?: (attempt: number, maxRetries: number) => void;
|
|
498
504
|
onReconnected?: () => void;
|
|
499
505
|
onReconnectFailed?: () => void;
|
|
506
|
+
/**
|
|
507
|
+
* Decide whether to reconnect after a given close. Return `false` to stop —
|
|
508
|
+
* e.g. a server-initiated single-session eviction (code 1008), where
|
|
509
|
+
* reconnecting would just get kicked again. Default: always reconnect.
|
|
510
|
+
*/
|
|
511
|
+
shouldReconnect?: (code: number, reason: string) => boolean;
|
|
500
512
|
}
|
|
501
513
|
interface ReconnectableWsConnection {
|
|
502
514
|
close: () => void;
|
|
@@ -511,7 +523,10 @@ declare function connectWebSocket(options: ConnectOptions): Promise<WsConnection
|
|
|
511
523
|
/**
|
|
512
524
|
* Connect WebSocket with automatic reconnection on disconnect.
|
|
513
525
|
*
|
|
514
|
-
*
|
|
526
|
+
* The initial connection is auth-symmetric with the reconnect loop: if the first
|
|
527
|
+
* attempt is rejected for auth reasons and `refreshAuth` is provided, it re-logs
|
|
528
|
+
* in and retries once with the fresh token before throwing. Any other failure —
|
|
529
|
+
* or a still-failing retry — throws to the caller.
|
|
515
530
|
* After successful auth, disconnects trigger exponential backoff reconnection:
|
|
516
531
|
* - a fresh token is resolved before every attempt (see `getAccessToken`), so a
|
|
517
532
|
* token rotated elsewhere is picked up rather than reusing a stale one;
|
|
@@ -1256,6 +1271,21 @@ type SkillSummary = components['schemas']['SkillSummaryResponse'];
|
|
|
1256
1271
|
declare function listSkills(arbi: ArbiClient, options?: {
|
|
1257
1272
|
includeHidden?: boolean;
|
|
1258
1273
|
}): Promise<SkillSummary[]>;
|
|
1274
|
+
/** A built-in slash command as exposed by ``GET /v1/assistant/commands``.
|
|
1275
|
+
* These are shipped commands (``/image``, ``/compact``, …) from the backend
|
|
1276
|
+
* command registry — distinct from dynamic user-authored skills. */
|
|
1277
|
+
type CommandDescriptor = components['schemas']['CommandDescriptorResponse'];
|
|
1278
|
+
/**
|
|
1279
|
+
* List the built-in slash commands the caller can invoke (``/image``,
|
|
1280
|
+
* ``/compact``, ``/goal``, ``/pa``, …), respecting per-user gates
|
|
1281
|
+
* (``show_pa_mode`` / ``GOALS_ENABLED``).
|
|
1282
|
+
*
|
|
1283
|
+
* These come from the backend command registry — the single source of truth
|
|
1284
|
+
* shared with the dispatcher — so clients no longer hardcode the list. Merge
|
|
1285
|
+
* with {@link listSkills} to build a complete slash menu (built-ins + dynamic
|
|
1286
|
+
* user-authored skills).
|
|
1287
|
+
*/
|
|
1288
|
+
declare function listCommands(arbi: ArbiClient): Promise<CommandDescriptor[]>;
|
|
1259
1289
|
/** Parsed slash-command shape, regardless of frontend. */
|
|
1260
1290
|
interface ParsedSlashCommand {
|
|
1261
1291
|
/** The lowercased token immediately after ``/``. */
|
|
@@ -1310,6 +1340,7 @@ declare function filterSkills<T extends {
|
|
|
1310
1340
|
type assistant_AssistantQueryOptions = AssistantQueryOptions;
|
|
1311
1341
|
type assistant_Chunk = Chunk;
|
|
1312
1342
|
type assistant_ChunkMetadata = ChunkMetadata;
|
|
1343
|
+
type assistant_CommandDescriptor = CommandDescriptor;
|
|
1313
1344
|
type assistant_ParsedSlashCommand = ParsedSlashCommand;
|
|
1314
1345
|
type assistant_RetrieveOptions = RetrieveOptions;
|
|
1315
1346
|
type assistant_RetrieveResult = RetrieveResult;
|
|
@@ -1318,6 +1349,7 @@ declare const assistant_buildRetrievalChunkTool: typeof buildRetrievalChunkTool;
|
|
|
1318
1349
|
declare const assistant_buildRetrievalFullContextTool: typeof buildRetrievalFullContextTool;
|
|
1319
1350
|
declare const assistant_buildRetrievalTocTool: typeof buildRetrievalTocTool;
|
|
1320
1351
|
declare const assistant_filterSkills: typeof filterSkills;
|
|
1352
|
+
declare const assistant_listCommands: typeof listCommands;
|
|
1321
1353
|
declare const assistant_listSkills: typeof listSkills;
|
|
1322
1354
|
declare const assistant_parseSlashCommand: typeof parseSlashCommand;
|
|
1323
1355
|
declare const assistant_parseSlashTokenInProgress: typeof parseSlashTokenInProgress;
|
|
@@ -1325,7 +1357,7 @@ declare const assistant_queryAssistant: typeof queryAssistant;
|
|
|
1325
1357
|
declare const assistant_respondToAgent: typeof respondToAgent;
|
|
1326
1358
|
declare const assistant_retrieve: typeof retrieve;
|
|
1327
1359
|
declare namespace assistant {
|
|
1328
|
-
export { type assistant_AssistantQueryOptions as AssistantQueryOptions, type assistant_Chunk as Chunk, type assistant_ChunkMetadata as ChunkMetadata, type assistant_ParsedSlashCommand as ParsedSlashCommand, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, type assistant_SkillSummary as SkillSummary, assistant_buildRetrievalChunkTool as buildRetrievalChunkTool, assistant_buildRetrievalFullContextTool as buildRetrievalFullContextTool, assistant_buildRetrievalTocTool as buildRetrievalTocTool, assistant_filterSkills as filterSkills, assistant_listSkills as listSkills, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_respondToAgent as respondToAgent, assistant_retrieve as retrieve };
|
|
1360
|
+
export { type assistant_AssistantQueryOptions as AssistantQueryOptions, type assistant_Chunk as Chunk, type assistant_ChunkMetadata as ChunkMetadata, type assistant_CommandDescriptor as CommandDescriptor, type assistant_ParsedSlashCommand as ParsedSlashCommand, type assistant_RetrieveOptions as RetrieveOptions, type assistant_RetrieveResult as RetrieveResult, type assistant_SkillSummary as SkillSummary, assistant_buildRetrievalChunkTool as buildRetrievalChunkTool, assistant_buildRetrievalFullContextTool as buildRetrievalFullContextTool, assistant_buildRetrievalTocTool as buildRetrievalTocTool, assistant_filterSkills as filterSkills, assistant_listCommands as listCommands, assistant_listSkills as listSkills, assistant_parseSlashCommand as parseSlashCommand, assistant_parseSlashTokenInProgress as parseSlashTokenInProgress, assistant_queryAssistant as queryAssistant, assistant_respondToAgent as respondToAgent, assistant_retrieve as retrieve };
|
|
1329
1361
|
}
|
|
1330
1362
|
|
|
1331
1363
|
/**
|
|
@@ -1630,6 +1662,18 @@ declare class Arbi {
|
|
|
1630
1662
|
get isLoggedIn(): boolean;
|
|
1631
1663
|
/** Check if a workspace is selected. */
|
|
1632
1664
|
get hasWorkspace(): boolean;
|
|
1665
|
+
/**
|
|
1666
|
+
* Live connection info for opening a raw transport (e.g. a WebSocket).
|
|
1667
|
+
*
|
|
1668
|
+
* Reads the access token from the session on each call, so a token refreshed
|
|
1669
|
+
* elsewhere is reflected on the next (re)connect. Returns `null` when there is
|
|
1670
|
+
* no client/token yet (not logged in) rather than throwing, so callers can
|
|
1671
|
+
* poll for readiness instead of guarding against exceptions.
|
|
1672
|
+
*/
|
|
1673
|
+
getConnectionInfo(): {
|
|
1674
|
+
baseUrl: string;
|
|
1675
|
+
accessToken: string;
|
|
1676
|
+
} | null;
|
|
1633
1677
|
private getAuthHeaders;
|
|
1634
1678
|
readonly projects: {
|
|
1635
1679
|
list: () => Promise<{
|
|
@@ -2908,6 +2952,9 @@ declare class Arbi {
|
|
|
2908
2952
|
TEMPERATURE: number;
|
|
2909
2953
|
MAX_TOKENS: number;
|
|
2910
2954
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
2955
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
2956
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
2957
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
2911
2958
|
};
|
|
2912
2959
|
TitleLLM: {
|
|
2913
2960
|
API_TYPE: "local" | "remote";
|
|
@@ -3334,6 +3381,9 @@ declare class Arbi {
|
|
|
3334
3381
|
TEMPERATURE: number;
|
|
3335
3382
|
MAX_TOKENS: number;
|
|
3336
3383
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
3384
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
3385
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
3386
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
3337
3387
|
};
|
|
3338
3388
|
TitleLLM: {
|
|
3339
3389
|
API_TYPE: "local" | "remote";
|
|
@@ -4871,6 +4921,9 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
|
|
|
4871
4921
|
TEMPERATURE: number;
|
|
4872
4922
|
MAX_TOKENS: number;
|
|
4873
4923
|
MAX_TOKEN_SIZE_TO_ANSWER: number;
|
|
4924
|
+
MAX_CHUNKS_PER_EVAL_CALL: number;
|
|
4925
|
+
MAX_CONCURRENT_EVAL_BATCHES: number;
|
|
4926
|
+
EVAL_BATCH_TIMEOUT_S: number;
|
|
4874
4927
|
};
|
|
4875
4928
|
TitleLLM: {
|
|
4876
4929
|
API_TYPE: "local" | "remote";
|
|
@@ -5227,4 +5280,4 @@ declare namespace responses {
|
|
|
5227
5280
|
export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
|
|
5228
5281
|
}
|
|
5229
5282
|
|
|
5230
|
-
export { type
|
|
5283
|
+
export { type SSEStreamResult as $, type AgentStepDeltaEvent as A, type MemorySearchResponse as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type MessageLevel as E, type FormattedWsMessage as F, type MessageMetadataPayload$1 as G, type MessageQueuedEvent as H, type ReconnectableWsConnection as I, type ResolvedCitation as J, type ResponseCompletedEvent as K, type ListAllOptions as L, type MemoryResponse as M, type ResponseContentPartAddedEvent as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type QueryOptions as Q, type ReconnectOptions as R, type ResponseCreatedEvent as S, type ResponseFailedEvent as T, type ResponseOutputItemAddedEvent as U, type ResponseOutputItemDoneEvent as V, type ResponseOutputTextDeltaEvent as W, type ResponseOutputTextDoneEvent as X, type ResponseUsage as Y, type SSEEvent as Z, type SSEStreamCallbacks as _, type AgentStepEvent as a, selectWorkspaceById as a$, type SSEStreamStartData as a0, SUPPORTED_EXTENSIONS as a1, type SkillSummary as a2, type SkippedFile as a3, type TaskResponse as a4, type UpdateMemoryRequest as a5, type UpdateTaskRequest as a6, type UploadBatchResult as a7, type UploadDirectOptions as a8, type UploadDirectResult as a9, filterSkills as aA, formatAgentStepLabel as aB, formatFileSize as aC, formatStreamSummary as aD, formatUserName as aE, formatWorkspaceChoices as aF, formatWsMessage as aG, generateEncryptedWorkspaceKey as aH, generateNewWorkspaceKey as aI, getErrorCode as aJ, getErrorMessage as aK, getRawWorkspaceKey as aL, health as aM, memory as aN, parseSSEEvents as aO, parseSlashCommand as aP, parseSlashTokenInProgress as aQ, performPasswordLogin as aR, performSigningKeyLogin as aS, performSsoDeviceFlowLogin as aT, requireData as aU, requireOk as aV, resolveAuth as aW, resolveCitations as aX, resolveWorkspace as aY, responses as aZ, selectWorkspace as a_, type UploadOptions as aa, type UploadResult as ab, type UserInfo as ac, type UserInputRequestEvent as ad, type UserMessageEvent as ae, WebSocketAuthError as af, type WorkspaceContext as ag, type WsConnection as ah, agentconfig as ai, assistant as aj, authenticatedFetch as ak, buildRetrievalChunkTool as al, buildRetrievalFullContextTool as am, buildRetrievalTocTool as an, connectWebSocket as ao, connectWithReconnect as ap, consumeSSEStream as aq, contacts as ar, conversations as as, countCitations as at, createAuthenticatedClient as au, createDocumentWaiter as av, dm as aw, doctags as ax, documents as ay, files as az, Arbi as b, settings as b0, streamSSE as b1, stripCitationMarkdown as b2, summarizeCitations as b3, tags as b4, tasks as b5, workspaces as b6, ArbiApiError as c, ArbiError as d, type ArbiErrorEvent as e, type ArbiOptions as f, type ArtifactEvent as g, type AuthContext as h, type AuthHeaders as i, type AuthenticatedClient as j, type CitationSummary as k, type CliConfig as l, type CliCredentials as m, type CommandDescriptor as n, type ConfigStore as o, type ConnectOptions as p, type CreateMemoryRequest as q, type CreateTaskRequest as r, type DmCryptoContext as s, type DocNameMap as t, type DocumentListFields as u, type DocumentListOrder as v, type DocumentWaiter as w, type DocumentWaiterOptions as x, type ListPaginatedOptions as y, type MemorySearchRequest as z };
|
package/dist/browser.cjs
CHANGED
|
@@ -4043,7 +4043,7 @@ var WebSocketAuthError = class extends Error {
|
|
|
4043
4043
|
}
|
|
4044
4044
|
};
|
|
4045
4045
|
function connectWebSocket(options) {
|
|
4046
|
-
const { baseUrl, accessToken, onMessage, onClose } = options;
|
|
4046
|
+
const { baseUrl, accessToken, onMessage, onClose, onAuthenticated } = options;
|
|
4047
4047
|
const url = client.buildWebSocketUrl(baseUrl);
|
|
4048
4048
|
return new Promise((resolve, reject) => {
|
|
4049
4049
|
const ws = new WebSocket(url);
|
|
@@ -4066,6 +4066,7 @@ function connectWebSocket(options) {
|
|
|
4066
4066
|
clearTimeout(timeout);
|
|
4067
4067
|
if (msg.success) {
|
|
4068
4068
|
authenticated = true;
|
|
4069
|
+
onAuthenticated?.(msg);
|
|
4069
4070
|
resolve({ close: () => ws.close() });
|
|
4070
4071
|
} else {
|
|
4071
4072
|
ws.close();
|
|
@@ -4099,6 +4100,8 @@ async function connectWithReconnect(options) {
|
|
|
4099
4100
|
onReconnectFailed,
|
|
4100
4101
|
onClose,
|
|
4101
4102
|
onMessage,
|
|
4103
|
+
onAuthenticated,
|
|
4104
|
+
shouldReconnect,
|
|
4102
4105
|
baseUrl,
|
|
4103
4106
|
accessToken
|
|
4104
4107
|
} = options;
|
|
@@ -4113,10 +4116,11 @@ async function connectWithReconnect(options) {
|
|
|
4113
4116
|
baseUrl,
|
|
4114
4117
|
accessToken: token,
|
|
4115
4118
|
onMessage,
|
|
4119
|
+
onAuthenticated,
|
|
4116
4120
|
onClose: (code, reason) => {
|
|
4117
4121
|
currentConnection = null;
|
|
4118
4122
|
onClose?.(code, reason);
|
|
4119
|
-
if (!closed) void scheduleReconnect();
|
|
4123
|
+
if (!closed && (shouldReconnect?.(code, reason) ?? true)) void scheduleReconnect();
|
|
4120
4124
|
}
|
|
4121
4125
|
});
|
|
4122
4126
|
};
|
|
@@ -4147,7 +4151,14 @@ async function connectWithReconnect(options) {
|
|
|
4147
4151
|
}
|
|
4148
4152
|
if (!closed) onReconnectFailed?.();
|
|
4149
4153
|
};
|
|
4150
|
-
|
|
4154
|
+
try {
|
|
4155
|
+
currentConnection = await connectOnce();
|
|
4156
|
+
} catch (err) {
|
|
4157
|
+
if (!(err instanceof WebSocketAuthError) || !refreshAuth) throw err;
|
|
4158
|
+
await refreshAuth().catch(() => {
|
|
4159
|
+
});
|
|
4160
|
+
currentConnection = await connectOnce();
|
|
4161
|
+
}
|
|
4151
4162
|
return {
|
|
4152
4163
|
close: () => {
|
|
4153
4164
|
closed = true;
|
|
@@ -4791,6 +4802,7 @@ __export(assistant_exports, {
|
|
|
4791
4802
|
buildRetrievalFullContextTool: () => buildRetrievalFullContextTool,
|
|
4792
4803
|
buildRetrievalTocTool: () => buildRetrievalTocTool,
|
|
4793
4804
|
filterSkills: () => filterSkills,
|
|
4805
|
+
listCommands: () => listCommands,
|
|
4794
4806
|
listSkills: () => listSkills,
|
|
4795
4807
|
parseSlashCommand: () => parseSlashCommand,
|
|
4796
4808
|
parseSlashTokenInProgress: () => parseSlashTokenInProgress,
|
|
@@ -4898,6 +4910,13 @@ async function listSkills(arbi, options) {
|
|
|
4898
4910
|
);
|
|
4899
4911
|
return result.skills;
|
|
4900
4912
|
}
|
|
4913
|
+
async function listCommands(arbi) {
|
|
4914
|
+
const result = requireData(
|
|
4915
|
+
await arbi.fetch.GET("/v1/assistant/commands", {}),
|
|
4916
|
+
"Failed to list commands"
|
|
4917
|
+
);
|
|
4918
|
+
return result.commands;
|
|
4919
|
+
}
|
|
4901
4920
|
function parseSlashCommand(input) {
|
|
4902
4921
|
const m2 = /^\s*\/([a-zA-Z0-9_-]+)(?:\s+([\s\S]*))?$/.exec(input);
|
|
4903
4922
|
if (!m2) return null;
|
|
@@ -5556,6 +5575,19 @@ var Arbi = class {
|
|
|
5556
5575
|
get hasWorkspace() {
|
|
5557
5576
|
return this.currentWorkspaceId !== null;
|
|
5558
5577
|
}
|
|
5578
|
+
/**
|
|
5579
|
+
* Live connection info for opening a raw transport (e.g. a WebSocket).
|
|
5580
|
+
*
|
|
5581
|
+
* Reads the access token from the session on each call, so a token refreshed
|
|
5582
|
+
* elsewhere is reflected on the next (re)connect. Returns `null` when there is
|
|
5583
|
+
* no client/token yet (not logged in) rather than throwing, so callers can
|
|
5584
|
+
* poll for readiness instead of guarding against exceptions.
|
|
5585
|
+
*/
|
|
5586
|
+
getConnectionInfo() {
|
|
5587
|
+
const accessToken = this.client?.session.getState().accessToken;
|
|
5588
|
+
if (!accessToken) return null;
|
|
5589
|
+
return { baseUrl: this.options.url, accessToken };
|
|
5590
|
+
}
|
|
5559
5591
|
// ── Auth headers (for raw fetch operations) ───────────────────────────
|
|
5560
5592
|
getAuthHeaders() {
|
|
5561
5593
|
const client = this.requireClient();
|