@arbidocs/sdk 0.4.5 → 0.4.6
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-5spRium9.d.cts → browser-B43Cvo9W.d.cts} +139 -2
- package/dist/{browser-5spRium9.d.ts → browser-B43Cvo9W.d.ts} +139 -2
- package/dist/browser.cjs +167 -6
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +166 -8
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +162 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -41
- package/dist/index.d.ts +4 -41
- package/dist/index.js +163 -21
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _arbidocs_client from '@arbidocs/client';
|
|
2
|
+
import { SessionStorageProvider, ArbiClient, LoginResult, components, WebSocketServerMessage, WsAuthResultMessage, WsTaskUpdateMessage, KeyPair, LoginProfile } from '@arbidocs/client';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Core error types and throwing error utilities.
|
|
@@ -60,6 +61,8 @@ interface AuthFetchOptions extends AuthHeaders {
|
|
|
60
61
|
body?: string | FormData | ArrayBuffer | ReadableStream | Blob | null;
|
|
61
62
|
/** Extra headers to merge in. */
|
|
62
63
|
headers?: Record<string, string>;
|
|
64
|
+
/** Aborts the request, and the body stream of a streaming response. */
|
|
65
|
+
signal?: AbortSignal;
|
|
63
66
|
}
|
|
64
67
|
/**
|
|
65
68
|
* Make an authenticated fetch request with standard error handling.
|
|
@@ -1289,6 +1292,8 @@ interface AssistantQueryOptions extends AuthHeaders {
|
|
|
1289
1292
|
docIds: string[];
|
|
1290
1293
|
previousResponseId?: string | null;
|
|
1291
1294
|
model?: string;
|
|
1295
|
+
/** Aborts the request and the stream (stop generating). */
|
|
1296
|
+
signal?: AbortSignal;
|
|
1292
1297
|
}
|
|
1293
1298
|
/**
|
|
1294
1299
|
* Send a query to the RAG assistant. Returns the raw Response
|
|
@@ -1874,6 +1879,28 @@ declare namespace files {
|
|
|
1874
1879
|
export { type files_FileDeleteResponse as FileDeleteResponse, type files_FileListResponse as FileListResponse, type files_FileObject as FileObject, type files_ListFilesOptions as ListFilesOptions, files_deleteFile as deleteFile, files_getFile as getFile, files_getFileContent as getFileContent, files_listFiles as listFiles, files_uploadFile as uploadFile };
|
|
1875
1880
|
}
|
|
1876
1881
|
|
|
1882
|
+
/**
|
|
1883
|
+
* User profile operations — the current user's display identity.
|
|
1884
|
+
*/
|
|
1885
|
+
|
|
1886
|
+
type UpdateProfileRequest = components['schemas']['UpdateProfileRequest'];
|
|
1887
|
+
/**
|
|
1888
|
+
* Update the signed-in user's profile. Fields are optional — pass only what
|
|
1889
|
+
* changes (e.g. `given_name`, `family_name`, `picture`).
|
|
1890
|
+
*/
|
|
1891
|
+
declare function updateProfile(arbi: ArbiClient, body: UpdateProfileRequest): Promise<{
|
|
1892
|
+
given_name: string;
|
|
1893
|
+
family_name?: string | null | undefined;
|
|
1894
|
+
email: string;
|
|
1895
|
+
picture?: string | null | undefined;
|
|
1896
|
+
}>;
|
|
1897
|
+
|
|
1898
|
+
type profile_UpdateProfileRequest = UpdateProfileRequest;
|
|
1899
|
+
declare const profile_updateProfile: typeof updateProfile;
|
|
1900
|
+
declare namespace profile {
|
|
1901
|
+
export { type profile_UpdateProfileRequest as UpdateProfileRequest, profile_updateProfile as updateProfile };
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1877
1904
|
/**
|
|
1878
1905
|
* Scheduled agent tasks — one-time, recurring (RFC-5545 rrule) or event-triggered
|
|
1879
1906
|
* jobs whose action is a reminder, an agent prompt, or a skill run.
|
|
@@ -2019,6 +2046,8 @@ interface QueryOptions {
|
|
|
2019
2046
|
previousResponseId?: string | null;
|
|
2020
2047
|
/** Model to use for generation */
|
|
2021
2048
|
model?: string;
|
|
2049
|
+
/** Aborts the request and the stream; the returned promise rejects with an `AbortError`. */
|
|
2050
|
+
signal?: AbortSignal;
|
|
2022
2051
|
/** Called for each streaming token */
|
|
2023
2052
|
onToken?: (content: string) => void;
|
|
2024
2053
|
/** Called when stream starts */
|
|
@@ -2043,6 +2072,8 @@ interface QueryOptions {
|
|
|
2043
2072
|
declare class Arbi {
|
|
2044
2073
|
private client;
|
|
2045
2074
|
private loginResult;
|
|
2075
|
+
private userProfile;
|
|
2076
|
+
private readonly profileListeners;
|
|
2046
2077
|
private currentWorkspaceId;
|
|
2047
2078
|
private dmCryptoContext;
|
|
2048
2079
|
private readonly sessionExpiredListeners;
|
|
@@ -2096,6 +2127,7 @@ declare class Arbi {
|
|
|
2096
2127
|
* `run` must read the auth headers itself so the retry carries the fresh token.
|
|
2097
2128
|
*/
|
|
2098
2129
|
private recovering;
|
|
2130
|
+
private setUserProfile;
|
|
2099
2131
|
/** Log out and clear internal state. */
|
|
2100
2132
|
logout(): Promise<void>;
|
|
2101
2133
|
/** Get the underlying ArbiClient (throws if not initialized). */
|
|
@@ -2259,11 +2291,51 @@ declare class Arbi {
|
|
|
2259
2291
|
externalId: string;
|
|
2260
2292
|
email: string | null;
|
|
2261
2293
|
} | null;
|
|
2294
|
+
/**
|
|
2295
|
+
* The signed-in user's profile (name, picture, email, SSO flag) as the login response
|
|
2296
|
+
* carried it, kept current by `profile.update` and `account.confirmEmailChange`. `null` when
|
|
2297
|
+
* not logged in or when the session was restored without a login (then read the workspace
|
|
2298
|
+
* roster instead).
|
|
2299
|
+
*/
|
|
2300
|
+
profile: () => LoginProfile | null;
|
|
2301
|
+
/** Be told when the profile changes (name, picture or email saved). Returns the unsubscribe. */
|
|
2302
|
+
onProfileChange: (listener: (profile: LoginProfile) => void) => (() => void);
|
|
2262
2303
|
/** Today's deployment-wide credit spend for the current user. */
|
|
2263
2304
|
usageToday: () => Promise<{
|
|
2264
2305
|
credits_used: number;
|
|
2265
2306
|
}>;
|
|
2266
2307
|
};
|
|
2308
|
+
readonly profile: {
|
|
2309
|
+
/** Update the display profile; pass only what changes (`''` clears family name or picture). */
|
|
2310
|
+
update: (body: UpdateProfileRequest) => Promise<{
|
|
2311
|
+
given_name: string;
|
|
2312
|
+
family_name?: string | null | undefined;
|
|
2313
|
+
email: string;
|
|
2314
|
+
picture?: string | null | undefined;
|
|
2315
|
+
}>;
|
|
2316
|
+
};
|
|
2317
|
+
readonly account: {
|
|
2318
|
+
/** Send a verification code to the new address (not for SSO accounts). */
|
|
2319
|
+
requestEmailChange: (newEmail: string) => Promise<void>;
|
|
2320
|
+
/** Confirm the email change with the emailed code; the session and profile follow. */
|
|
2321
|
+
confirmEmailChange: (newEmail: string, verificationCode: string) => Promise<{
|
|
2322
|
+
detail: string;
|
|
2323
|
+
email: string;
|
|
2324
|
+
}>;
|
|
2325
|
+
/**
|
|
2326
|
+
* Change (or, after recovery, set) the master password: re-keys the workspaces and direct
|
|
2327
|
+
* messages. Omit `currentPassword` in recovery mode. Resolves with the new signing key, whose
|
|
2328
|
+
* recovery file the user should save.
|
|
2329
|
+
*/
|
|
2330
|
+
changePassword: (params: {
|
|
2331
|
+
newPassword: string;
|
|
2332
|
+
currentPassword?: string;
|
|
2333
|
+
}) => Promise<_arbidocs_client.RekeyedPasswordChangeResult>;
|
|
2334
|
+
/** Close the account (soft delete) and sign out. Refused while a subscription is active. */
|
|
2335
|
+
requestDeletion: () => Promise<{
|
|
2336
|
+
detail: string;
|
|
2337
|
+
}>;
|
|
2338
|
+
};
|
|
2267
2339
|
readonly workspaces: {
|
|
2268
2340
|
list: () => Promise<{
|
|
2269
2341
|
external_id: string;
|
|
@@ -4674,6 +4746,12 @@ declare class Arbi {
|
|
|
4674
4746
|
status: string;
|
|
4675
4747
|
ttl: number;
|
|
4676
4748
|
}[]>;
|
|
4749
|
+
/** The id this device's session is listed under in `list()`; `null` when unknown. */
|
|
4750
|
+
currentId: () => string | null;
|
|
4751
|
+
/** End one of your own sessions now (not the one this device is on: that is `logout`). */
|
|
4752
|
+
terminate: (sessionId: string) => Promise<void>;
|
|
4753
|
+
/** Sign out of every device on the server, then clear this instance. */
|
|
4754
|
+
logoutAll: () => Promise<void>;
|
|
4677
4755
|
};
|
|
4678
4756
|
private requireClient;
|
|
4679
4757
|
private requireLogin;
|
|
@@ -6186,4 +6264,63 @@ declare namespace projects {
|
|
|
6186
6264
|
export { type projects_ProjectInvoicesResponse as ProjectInvoicesResponse, type projects_ProjectUpdateRequest as ProjectUpdateRequest, type projects_ProjectUsageResponse as ProjectUsageResponse, type projects_UserDailyUsageResponse as UserDailyUsageResponse, projects_createProject as createProject, projects_deleteProject as deleteProject, projects_getProjectInvoices as getProjectInvoices, projects_getProjectUsage as getProjectUsage, projects_getUserUsageToday as getUserUsageToday, projects_listProjects as listProjects, projects_refreshProject as refreshProject, projects_renameProject as renameProject, projects_updateProject as updateProject };
|
|
6187
6265
|
}
|
|
6188
6266
|
|
|
6189
|
-
|
|
6267
|
+
/**
|
|
6268
|
+
* Session operations — list, end one, sign out of all.
|
|
6269
|
+
*/
|
|
6270
|
+
|
|
6271
|
+
type SessionInfoResponse = components['schemas']['SessionInfoResponse'];
|
|
6272
|
+
/**
|
|
6273
|
+
* List all active sessions for the current user.
|
|
6274
|
+
* Agents see only their own session.
|
|
6275
|
+
*/
|
|
6276
|
+
declare function listSessions(arbi: ArbiClient): Promise<SessionInfoResponse[]>;
|
|
6277
|
+
/**
|
|
6278
|
+
* End one of the caller's own sessions at once (TTL 0). Ending the session this device is on is
|
|
6279
|
+
* the logout flow's job, not this one's.
|
|
6280
|
+
*/
|
|
6281
|
+
declare function terminateSession(arbi: ArbiClient, sessionId: string): Promise<void>;
|
|
6282
|
+
/** Sign the user out of every device (all sessions, this one included) on the server. */
|
|
6283
|
+
declare function logoutAllSessions(arbi: ArbiClient): Promise<void>;
|
|
6284
|
+
/**
|
|
6285
|
+
* The short id (first 12 characters of the token's `sk` claim) this session is listed under in
|
|
6286
|
+
* `GET /v1/user/sessions`, so a session list can mark "this device". Unverified decode: used to
|
|
6287
|
+
* recognise our own row, never for authorization. `null` for a missing or unreadable token.
|
|
6288
|
+
*/
|
|
6289
|
+
declare function currentSessionId(accessToken: string | null | undefined): string | null;
|
|
6290
|
+
|
|
6291
|
+
declare const sessions_currentSessionId: typeof currentSessionId;
|
|
6292
|
+
declare const sessions_listSessions: typeof listSessions;
|
|
6293
|
+
declare const sessions_logoutAllSessions: typeof logoutAllSessions;
|
|
6294
|
+
declare const sessions_terminateSession: typeof terminateSession;
|
|
6295
|
+
declare namespace sessions {
|
|
6296
|
+
export { sessions_currentSessionId as currentSessionId, sessions_listSessions as listSessions, sessions_logoutAllSessions as logoutAllSessions, sessions_terminateSession as terminateSession };
|
|
6297
|
+
}
|
|
6298
|
+
|
|
6299
|
+
/**
|
|
6300
|
+
* Account operations — change the sign-in email, close the account.
|
|
6301
|
+
*/
|
|
6302
|
+
|
|
6303
|
+
/** Send a verification code to `newEmail`. SSO accounts are refused (their email lives at the IdP). */
|
|
6304
|
+
declare function requestEmailChange(arbi: ArbiClient, newEmail: string): Promise<void>;
|
|
6305
|
+
/** Confirm the change with the 3-word code from the email. Resolves with the new email. */
|
|
6306
|
+
declare function confirmEmailChange(arbi: ArbiClient, newEmail: string, verificationCode: string): Promise<{
|
|
6307
|
+
detail: string;
|
|
6308
|
+
email: string;
|
|
6309
|
+
}>;
|
|
6310
|
+
/**
|
|
6311
|
+
* Close the account (soft delete): the user is signed out everywhere. The backend refuses while
|
|
6312
|
+
* the user has an active subscription or is the sole admin of a shared workspace; the refusal
|
|
6313
|
+
* carries the reason in `detail` (see `ArbiApiError`).
|
|
6314
|
+
*/
|
|
6315
|
+
declare function requestDeletion(arbi: ArbiClient): Promise<{
|
|
6316
|
+
detail: string;
|
|
6317
|
+
}>;
|
|
6318
|
+
|
|
6319
|
+
declare const account_confirmEmailChange: typeof confirmEmailChange;
|
|
6320
|
+
declare const account_requestDeletion: typeof requestDeletion;
|
|
6321
|
+
declare const account_requestEmailChange: typeof requestEmailChange;
|
|
6322
|
+
declare namespace account {
|
|
6323
|
+
export { account_confirmEmailChange as confirmEmailChange, account_requestDeletion as requestDeletion, account_requestEmailChange as requestEmailChange };
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6326
|
+
export { type ResponseCreatedEvent as $, type AgentControlStateEvent as A, type DocumentWaiter as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type DocumentWaiterOptions as E, type FactResponse as F, type FactSearchRequest as G, type FactSearchResponse as H, type FormattedWsMessage as I, type ListFactsOptions as J, type ListPaginatedOptions as K, type ListAllOptions as L, type MessageLevel as M, type MessageMetadataPayload$1 as N, type MessageQueuedEvent as O, type OutputTokensDetails as P, type ParsedSlashCommand as Q, type ProbeAnswerEvent as R, type ProjectInvoicesResponse as S, type ProjectUsageResponse as T, type QueryOptions as U, type ReconnectOptions as V, type ReconnectableWsConnection as W, type ResolvedCitation as X, type ResolvedRecipient as Y, type ResponseCompletedEvent as Z, type ResponseContentPartAddedEvent as _, type AgentStepDeltaEvent as a, health as a$, type ResponseFailedEvent as a0, type ResponseOutputItemAddedEvent as a1, type ResponseOutputItemDoneEvent as a2, type ResponseOutputTextDeltaEvent as a3, type ResponseOutputTextDoneEvent as a4, type ResponseUsage as a5, type SSEEvent as a6, type SSEStreamCallbacks as a7, type SSEStreamResult as a8, type SSEStreamStartData as a9, buildRetrievalTocTool as aA, connectWebSocket as aB, connectWithReconnect as aC, consumeSSEStream as aD, contacts as aE, conversations as aF, countCitations as aG, createAuthenticatedClient as aH, createDocumentWaiter as aI, dm as aJ, doctags as aK, documents as aL, facts as aM, files as aN, filterSkills as aO, formatAgentStepLabel as aP, formatFileSize as aQ, formatItemLabel as aR, formatStreamSummary as aS, formatUserName as aT, formatWorkspaceChoices as aU, formatWsMessage as aV, generateEncryptedWorkspaceKey as aW, generateNewWorkspaceKey as aX, getErrorCode as aY, getErrorMessage as aZ, getRawWorkspaceKey as a_, SUPPORTED_EXTENSIONS as aa, type SkillSummary as ab, type SkippedFile as ac, type TaskResponse as ad, type TokenBudgetContext as ae, type UpdateFactRequest as af, type UpdateTaskRequest as ag, type UploadBatchResult as ah, type UploadDirectOptions as ai, type UploadDirectResult as aj, type UploadOptions as ak, type UploadResult as al, type UserDailyUsageResponse as am, type UserInfo as an, type UserInputRequestEvent as ao, type UserMessageEvent as ap, WebSocketAuthError as aq, type WorkspaceContext as ar, type WsConnection as as, account as at, agentconfig as au, assistant as av, authenticatedFetch as aw, buildDocNameMap as ax, buildRetrievalChunkTool as ay, buildRetrievalFullContextTool as az, type AgentStepEvent as b, parseSSEEvents as b0, parseSlashCommand as b1, parseSlashTokenInProgress as b2, performPasswordLogin as b3, performSigningKeyLogin as b4, performSsoDeviceFlowLogin as b5, profile as b6, projects as b7, requireData as b8, requireOk as b9, resolveAuth as ba, resolveCitations as bb, resolveWorkspace as bc, responses as bd, selectWorkspace as be, selectWorkspaceById as bf, sessions as bg, settings as bh, streamSSE as bi, stripCitationMarkdown as bj, summarizeCitations as bk, tags as bl, tasks as bm, workspaces as bn, Arbi as c, ArbiApiError as d, ArbiError as e, type ArbiErrorEvent as f, type ArbiOptions as g, ArbiSessionExpiredError as h, type ArtifactEvent as i, type AuthContext as j, type AuthHeaders as k, type AuthenticatedClient as l, type CitationSummary as m, type CliConfig as n, type CliCredentials as o, type CommandDescriptor as p, type ConfigStore as q, type ConnectOptions as r, type CreateFactRequest as s, type CreateFactsRequest as t, type CreateTaskRequest as u, type DeferredInterjectionEvent as v, type DmCryptoContext as w, type DocNameMap as x, type DocumentListFields as y, type DocumentListOrder as z };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _arbidocs_client from '@arbidocs/client';
|
|
2
|
+
import { SessionStorageProvider, ArbiClient, LoginResult, components, WebSocketServerMessage, WsAuthResultMessage, WsTaskUpdateMessage, KeyPair, LoginProfile } from '@arbidocs/client';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Core error types and throwing error utilities.
|
|
@@ -60,6 +61,8 @@ interface AuthFetchOptions extends AuthHeaders {
|
|
|
60
61
|
body?: string | FormData | ArrayBuffer | ReadableStream | Blob | null;
|
|
61
62
|
/** Extra headers to merge in. */
|
|
62
63
|
headers?: Record<string, string>;
|
|
64
|
+
/** Aborts the request, and the body stream of a streaming response. */
|
|
65
|
+
signal?: AbortSignal;
|
|
63
66
|
}
|
|
64
67
|
/**
|
|
65
68
|
* Make an authenticated fetch request with standard error handling.
|
|
@@ -1289,6 +1292,8 @@ interface AssistantQueryOptions extends AuthHeaders {
|
|
|
1289
1292
|
docIds: string[];
|
|
1290
1293
|
previousResponseId?: string | null;
|
|
1291
1294
|
model?: string;
|
|
1295
|
+
/** Aborts the request and the stream (stop generating). */
|
|
1296
|
+
signal?: AbortSignal;
|
|
1292
1297
|
}
|
|
1293
1298
|
/**
|
|
1294
1299
|
* Send a query to the RAG assistant. Returns the raw Response
|
|
@@ -1874,6 +1879,28 @@ declare namespace files {
|
|
|
1874
1879
|
export { type files_FileDeleteResponse as FileDeleteResponse, type files_FileListResponse as FileListResponse, type files_FileObject as FileObject, type files_ListFilesOptions as ListFilesOptions, files_deleteFile as deleteFile, files_getFile as getFile, files_getFileContent as getFileContent, files_listFiles as listFiles, files_uploadFile as uploadFile };
|
|
1875
1880
|
}
|
|
1876
1881
|
|
|
1882
|
+
/**
|
|
1883
|
+
* User profile operations — the current user's display identity.
|
|
1884
|
+
*/
|
|
1885
|
+
|
|
1886
|
+
type UpdateProfileRequest = components['schemas']['UpdateProfileRequest'];
|
|
1887
|
+
/**
|
|
1888
|
+
* Update the signed-in user's profile. Fields are optional — pass only what
|
|
1889
|
+
* changes (e.g. `given_name`, `family_name`, `picture`).
|
|
1890
|
+
*/
|
|
1891
|
+
declare function updateProfile(arbi: ArbiClient, body: UpdateProfileRequest): Promise<{
|
|
1892
|
+
given_name: string;
|
|
1893
|
+
family_name?: string | null | undefined;
|
|
1894
|
+
email: string;
|
|
1895
|
+
picture?: string | null | undefined;
|
|
1896
|
+
}>;
|
|
1897
|
+
|
|
1898
|
+
type profile_UpdateProfileRequest = UpdateProfileRequest;
|
|
1899
|
+
declare const profile_updateProfile: typeof updateProfile;
|
|
1900
|
+
declare namespace profile {
|
|
1901
|
+
export { type profile_UpdateProfileRequest as UpdateProfileRequest, profile_updateProfile as updateProfile };
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1877
1904
|
/**
|
|
1878
1905
|
* Scheduled agent tasks — one-time, recurring (RFC-5545 rrule) or event-triggered
|
|
1879
1906
|
* jobs whose action is a reminder, an agent prompt, or a skill run.
|
|
@@ -2019,6 +2046,8 @@ interface QueryOptions {
|
|
|
2019
2046
|
previousResponseId?: string | null;
|
|
2020
2047
|
/** Model to use for generation */
|
|
2021
2048
|
model?: string;
|
|
2049
|
+
/** Aborts the request and the stream; the returned promise rejects with an `AbortError`. */
|
|
2050
|
+
signal?: AbortSignal;
|
|
2022
2051
|
/** Called for each streaming token */
|
|
2023
2052
|
onToken?: (content: string) => void;
|
|
2024
2053
|
/** Called when stream starts */
|
|
@@ -2043,6 +2072,8 @@ interface QueryOptions {
|
|
|
2043
2072
|
declare class Arbi {
|
|
2044
2073
|
private client;
|
|
2045
2074
|
private loginResult;
|
|
2075
|
+
private userProfile;
|
|
2076
|
+
private readonly profileListeners;
|
|
2046
2077
|
private currentWorkspaceId;
|
|
2047
2078
|
private dmCryptoContext;
|
|
2048
2079
|
private readonly sessionExpiredListeners;
|
|
@@ -2096,6 +2127,7 @@ declare class Arbi {
|
|
|
2096
2127
|
* `run` must read the auth headers itself so the retry carries the fresh token.
|
|
2097
2128
|
*/
|
|
2098
2129
|
private recovering;
|
|
2130
|
+
private setUserProfile;
|
|
2099
2131
|
/** Log out and clear internal state. */
|
|
2100
2132
|
logout(): Promise<void>;
|
|
2101
2133
|
/** Get the underlying ArbiClient (throws if not initialized). */
|
|
@@ -2259,11 +2291,51 @@ declare class Arbi {
|
|
|
2259
2291
|
externalId: string;
|
|
2260
2292
|
email: string | null;
|
|
2261
2293
|
} | null;
|
|
2294
|
+
/**
|
|
2295
|
+
* The signed-in user's profile (name, picture, email, SSO flag) as the login response
|
|
2296
|
+
* carried it, kept current by `profile.update` and `account.confirmEmailChange`. `null` when
|
|
2297
|
+
* not logged in or when the session was restored without a login (then read the workspace
|
|
2298
|
+
* roster instead).
|
|
2299
|
+
*/
|
|
2300
|
+
profile: () => LoginProfile | null;
|
|
2301
|
+
/** Be told when the profile changes (name, picture or email saved). Returns the unsubscribe. */
|
|
2302
|
+
onProfileChange: (listener: (profile: LoginProfile) => void) => (() => void);
|
|
2262
2303
|
/** Today's deployment-wide credit spend for the current user. */
|
|
2263
2304
|
usageToday: () => Promise<{
|
|
2264
2305
|
credits_used: number;
|
|
2265
2306
|
}>;
|
|
2266
2307
|
};
|
|
2308
|
+
readonly profile: {
|
|
2309
|
+
/** Update the display profile; pass only what changes (`''` clears family name or picture). */
|
|
2310
|
+
update: (body: UpdateProfileRequest) => Promise<{
|
|
2311
|
+
given_name: string;
|
|
2312
|
+
family_name?: string | null | undefined;
|
|
2313
|
+
email: string;
|
|
2314
|
+
picture?: string | null | undefined;
|
|
2315
|
+
}>;
|
|
2316
|
+
};
|
|
2317
|
+
readonly account: {
|
|
2318
|
+
/** Send a verification code to the new address (not for SSO accounts). */
|
|
2319
|
+
requestEmailChange: (newEmail: string) => Promise<void>;
|
|
2320
|
+
/** Confirm the email change with the emailed code; the session and profile follow. */
|
|
2321
|
+
confirmEmailChange: (newEmail: string, verificationCode: string) => Promise<{
|
|
2322
|
+
detail: string;
|
|
2323
|
+
email: string;
|
|
2324
|
+
}>;
|
|
2325
|
+
/**
|
|
2326
|
+
* Change (or, after recovery, set) the master password: re-keys the workspaces and direct
|
|
2327
|
+
* messages. Omit `currentPassword` in recovery mode. Resolves with the new signing key, whose
|
|
2328
|
+
* recovery file the user should save.
|
|
2329
|
+
*/
|
|
2330
|
+
changePassword: (params: {
|
|
2331
|
+
newPassword: string;
|
|
2332
|
+
currentPassword?: string;
|
|
2333
|
+
}) => Promise<_arbidocs_client.RekeyedPasswordChangeResult>;
|
|
2334
|
+
/** Close the account (soft delete) and sign out. Refused while a subscription is active. */
|
|
2335
|
+
requestDeletion: () => Promise<{
|
|
2336
|
+
detail: string;
|
|
2337
|
+
}>;
|
|
2338
|
+
};
|
|
2267
2339
|
readonly workspaces: {
|
|
2268
2340
|
list: () => Promise<{
|
|
2269
2341
|
external_id: string;
|
|
@@ -4674,6 +4746,12 @@ declare class Arbi {
|
|
|
4674
4746
|
status: string;
|
|
4675
4747
|
ttl: number;
|
|
4676
4748
|
}[]>;
|
|
4749
|
+
/** The id this device's session is listed under in `list()`; `null` when unknown. */
|
|
4750
|
+
currentId: () => string | null;
|
|
4751
|
+
/** End one of your own sessions now (not the one this device is on: that is `logout`). */
|
|
4752
|
+
terminate: (sessionId: string) => Promise<void>;
|
|
4753
|
+
/** Sign out of every device on the server, then clear this instance. */
|
|
4754
|
+
logoutAll: () => Promise<void>;
|
|
4677
4755
|
};
|
|
4678
4756
|
private requireClient;
|
|
4679
4757
|
private requireLogin;
|
|
@@ -6186,4 +6264,63 @@ declare namespace projects {
|
|
|
6186
6264
|
export { type projects_ProjectInvoicesResponse as ProjectInvoicesResponse, type projects_ProjectUpdateRequest as ProjectUpdateRequest, type projects_ProjectUsageResponse as ProjectUsageResponse, type projects_UserDailyUsageResponse as UserDailyUsageResponse, projects_createProject as createProject, projects_deleteProject as deleteProject, projects_getProjectInvoices as getProjectInvoices, projects_getProjectUsage as getProjectUsage, projects_getUserUsageToday as getUserUsageToday, projects_listProjects as listProjects, projects_refreshProject as refreshProject, projects_renameProject as renameProject, projects_updateProject as updateProject };
|
|
6187
6265
|
}
|
|
6188
6266
|
|
|
6189
|
-
|
|
6267
|
+
/**
|
|
6268
|
+
* Session operations — list, end one, sign out of all.
|
|
6269
|
+
*/
|
|
6270
|
+
|
|
6271
|
+
type SessionInfoResponse = components['schemas']['SessionInfoResponse'];
|
|
6272
|
+
/**
|
|
6273
|
+
* List all active sessions for the current user.
|
|
6274
|
+
* Agents see only their own session.
|
|
6275
|
+
*/
|
|
6276
|
+
declare function listSessions(arbi: ArbiClient): Promise<SessionInfoResponse[]>;
|
|
6277
|
+
/**
|
|
6278
|
+
* End one of the caller's own sessions at once (TTL 0). Ending the session this device is on is
|
|
6279
|
+
* the logout flow's job, not this one's.
|
|
6280
|
+
*/
|
|
6281
|
+
declare function terminateSession(arbi: ArbiClient, sessionId: string): Promise<void>;
|
|
6282
|
+
/** Sign the user out of every device (all sessions, this one included) on the server. */
|
|
6283
|
+
declare function logoutAllSessions(arbi: ArbiClient): Promise<void>;
|
|
6284
|
+
/**
|
|
6285
|
+
* The short id (first 12 characters of the token's `sk` claim) this session is listed under in
|
|
6286
|
+
* `GET /v1/user/sessions`, so a session list can mark "this device". Unverified decode: used to
|
|
6287
|
+
* recognise our own row, never for authorization. `null` for a missing or unreadable token.
|
|
6288
|
+
*/
|
|
6289
|
+
declare function currentSessionId(accessToken: string | null | undefined): string | null;
|
|
6290
|
+
|
|
6291
|
+
declare const sessions_currentSessionId: typeof currentSessionId;
|
|
6292
|
+
declare const sessions_listSessions: typeof listSessions;
|
|
6293
|
+
declare const sessions_logoutAllSessions: typeof logoutAllSessions;
|
|
6294
|
+
declare const sessions_terminateSession: typeof terminateSession;
|
|
6295
|
+
declare namespace sessions {
|
|
6296
|
+
export { sessions_currentSessionId as currentSessionId, sessions_listSessions as listSessions, sessions_logoutAllSessions as logoutAllSessions, sessions_terminateSession as terminateSession };
|
|
6297
|
+
}
|
|
6298
|
+
|
|
6299
|
+
/**
|
|
6300
|
+
* Account operations — change the sign-in email, close the account.
|
|
6301
|
+
*/
|
|
6302
|
+
|
|
6303
|
+
/** Send a verification code to `newEmail`. SSO accounts are refused (their email lives at the IdP). */
|
|
6304
|
+
declare function requestEmailChange(arbi: ArbiClient, newEmail: string): Promise<void>;
|
|
6305
|
+
/** Confirm the change with the 3-word code from the email. Resolves with the new email. */
|
|
6306
|
+
declare function confirmEmailChange(arbi: ArbiClient, newEmail: string, verificationCode: string): Promise<{
|
|
6307
|
+
detail: string;
|
|
6308
|
+
email: string;
|
|
6309
|
+
}>;
|
|
6310
|
+
/**
|
|
6311
|
+
* Close the account (soft delete): the user is signed out everywhere. The backend refuses while
|
|
6312
|
+
* the user has an active subscription or is the sole admin of a shared workspace; the refusal
|
|
6313
|
+
* carries the reason in `detail` (see `ArbiApiError`).
|
|
6314
|
+
*/
|
|
6315
|
+
declare function requestDeletion(arbi: ArbiClient): Promise<{
|
|
6316
|
+
detail: string;
|
|
6317
|
+
}>;
|
|
6318
|
+
|
|
6319
|
+
declare const account_confirmEmailChange: typeof confirmEmailChange;
|
|
6320
|
+
declare const account_requestDeletion: typeof requestDeletion;
|
|
6321
|
+
declare const account_requestEmailChange: typeof requestEmailChange;
|
|
6322
|
+
declare namespace account {
|
|
6323
|
+
export { account_confirmEmailChange as confirmEmailChange, account_requestDeletion as requestDeletion, account_requestEmailChange as requestEmailChange };
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6326
|
+
export { type ResponseCreatedEvent as $, type AgentControlStateEvent as A, type DocumentWaiter as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type DocumentWaiterOptions as E, type FactResponse as F, type FactSearchRequest as G, type FactSearchResponse as H, type FormattedWsMessage as I, type ListFactsOptions as J, type ListPaginatedOptions as K, type ListAllOptions as L, type MessageLevel as M, type MessageMetadataPayload$1 as N, type MessageQueuedEvent as O, type OutputTokensDetails as P, type ParsedSlashCommand as Q, type ProbeAnswerEvent as R, type ProjectInvoicesResponse as S, type ProjectUsageResponse as T, type QueryOptions as U, type ReconnectOptions as V, type ReconnectableWsConnection as W, type ResolvedCitation as X, type ResolvedRecipient as Y, type ResponseCompletedEvent as Z, type ResponseContentPartAddedEvent as _, type AgentStepDeltaEvent as a, health as a$, type ResponseFailedEvent as a0, type ResponseOutputItemAddedEvent as a1, type ResponseOutputItemDoneEvent as a2, type ResponseOutputTextDeltaEvent as a3, type ResponseOutputTextDoneEvent as a4, type ResponseUsage as a5, type SSEEvent as a6, type SSEStreamCallbacks as a7, type SSEStreamResult as a8, type SSEStreamStartData as a9, buildRetrievalTocTool as aA, connectWebSocket as aB, connectWithReconnect as aC, consumeSSEStream as aD, contacts as aE, conversations as aF, countCitations as aG, createAuthenticatedClient as aH, createDocumentWaiter as aI, dm as aJ, doctags as aK, documents as aL, facts as aM, files as aN, filterSkills as aO, formatAgentStepLabel as aP, formatFileSize as aQ, formatItemLabel as aR, formatStreamSummary as aS, formatUserName as aT, formatWorkspaceChoices as aU, formatWsMessage as aV, generateEncryptedWorkspaceKey as aW, generateNewWorkspaceKey as aX, getErrorCode as aY, getErrorMessage as aZ, getRawWorkspaceKey as a_, SUPPORTED_EXTENSIONS as aa, type SkillSummary as ab, type SkippedFile as ac, type TaskResponse as ad, type TokenBudgetContext as ae, type UpdateFactRequest as af, type UpdateTaskRequest as ag, type UploadBatchResult as ah, type UploadDirectOptions as ai, type UploadDirectResult as aj, type UploadOptions as ak, type UploadResult as al, type UserDailyUsageResponse as am, type UserInfo as an, type UserInputRequestEvent as ao, type UserMessageEvent as ap, WebSocketAuthError as aq, type WorkspaceContext as ar, type WsConnection as as, account as at, agentconfig as au, assistant as av, authenticatedFetch as aw, buildDocNameMap as ax, buildRetrievalChunkTool as ay, buildRetrievalFullContextTool as az, type AgentStepEvent as b, parseSSEEvents as b0, parseSlashCommand as b1, parseSlashTokenInProgress as b2, performPasswordLogin as b3, performSigningKeyLogin as b4, performSsoDeviceFlowLogin as b5, profile as b6, projects as b7, requireData as b8, requireOk as b9, resolveAuth as ba, resolveCitations as bb, resolveWorkspace as bc, responses as bd, selectWorkspace as be, selectWorkspaceById as bf, sessions as bg, settings as bh, streamSSE as bi, stripCitationMarkdown as bj, summarizeCitations as bk, tags as bl, tasks as bm, workspaces as bn, Arbi as c, ArbiApiError as d, ArbiError as e, type ArbiErrorEvent as f, type ArbiOptions as g, ArbiSessionExpiredError as h, type ArtifactEvent as i, type AuthContext as j, type AuthHeaders as k, type AuthenticatedClient as l, type CitationSummary as m, type CliConfig as n, type CliCredentials as o, type CommandDescriptor as p, type ConfigStore as q, type ConnectOptions as r, type CreateFactRequest as s, type CreateFactsRequest as t, type CreateTaskRequest as u, type DeferredInterjectionEvent as v, type DmCryptoContext as w, type DocNameMap as x, type DocumentListFields as y, type DocumentListOrder as z };
|