@arbidocs/sdk 0.3.17 → 0.3.18
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-BtAHbiq_.d.cts → browser-DUQ3Eyvd.d.cts} +14 -1
- package/dist/{browser-BtAHbiq_.d.ts → browser-DUQ3Eyvd.d.ts} +14 -1
- package/dist/browser.cjs +4 -1
- 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 +4 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +139 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -3
- package/dist/index.d.ts +63 -3
- package/dist/index.js +138 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -92,6 +92,8 @@ interface CliCredentials {
|
|
|
92
92
|
workspaceId?: string;
|
|
93
93
|
/** ISO timestamp when the token was cached */
|
|
94
94
|
tokenTimestamp?: string;
|
|
95
|
+
/** Auth0 SSO token — needed for session recovery of SSO users */
|
|
96
|
+
ssoToken?: string;
|
|
95
97
|
}
|
|
96
98
|
interface ChatSession {
|
|
97
99
|
/** Last assistant message ID — used as previous_response_id for follow-ups */
|
|
@@ -173,6 +175,17 @@ declare function createAuthenticatedClient(config: CliConfig, creds: CliCredenti
|
|
|
173
175
|
* use createAuthenticatedClient() instead.
|
|
174
176
|
*/
|
|
175
177
|
declare function performPasswordLogin(config: CliConfig, email: string, password: string, store: ConfigStore): Promise<AuthContext>;
|
|
178
|
+
/**
|
|
179
|
+
* SSO device-flow login (RFC 8628).
|
|
180
|
+
*
|
|
181
|
+
* Fetches SSO config from the deployment, initiates the device authorization
|
|
182
|
+
* flow with Auth0, waits for the user to authorize in a browser, then logs
|
|
183
|
+
* in to the ARBI deployment using the Auth0 JWT.
|
|
184
|
+
*/
|
|
185
|
+
declare function performSsoDeviceFlowLogin(config: CliConfig, email: string, password: string, store: ConfigStore, callbacks?: {
|
|
186
|
+
onUserCode?: (userCode: string, verificationUri: string) => void;
|
|
187
|
+
onPoll?: (elapsedMs: number) => void;
|
|
188
|
+
}): Promise<AuthContext>;
|
|
176
189
|
/**
|
|
177
190
|
* Decrypt wrapped workspace key and set it as the active workspace header.
|
|
178
191
|
*/
|
|
@@ -3306,4 +3319,4 @@ declare namespace responses {
|
|
|
3306
3319
|
export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
|
|
3307
3320
|
}
|
|
3308
3321
|
|
|
3309
|
-
export { buildRetrievalFullContextTool as $, type AuthHeaders as A, type ResponseOutputTextDeltaEvent as B, type ConfigStore as C, type DocumentWaiter as D, type ResponseOutputTextDoneEvent as E, type FormattedWsMessage as F, type ResponseUsage as G, type SSEStreamCallbacks as H, type SSEStreamResult as I, type SSEStreamStartData as J, type UserInfo as K, LIFECYCLE_LABELS as L, type MessageLevel as M, type UserInputRequestEvent as N, type OutputTokensDetails as O, type UserMessageEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, TOOL_LABELS as T, type UploadBatchResult as U, type WsConnection as V, type WorkspaceContext as W, agentconfig as X, assistant as Y, authenticatedFetch as Z, buildRetrievalChunkTool as _, type CliConfig as a, buildRetrievalTocTool as a0, connectWebSocket as a1, connectWithReconnect as a2, consumeSSEStream as a3, contacts as a4, conversations as a5, countCitations as a6, createAuthenticatedClient as a7, createDocumentWaiter as a8, dm as a9,
|
|
3322
|
+
export { buildRetrievalFullContextTool as $, type AuthHeaders as A, type ResponseOutputTextDeltaEvent as B, type ConfigStore as C, type DocumentWaiter as D, type ResponseOutputTextDoneEvent as E, type FormattedWsMessage as F, type ResponseUsage as G, type SSEStreamCallbacks as H, type SSEStreamResult as I, type SSEStreamStartData as J, type UserInfo as K, LIFECYCLE_LABELS as L, type MessageLevel as M, type UserInputRequestEvent as N, type OutputTokensDetails as O, type UserMessageEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, TOOL_LABELS as T, type UploadBatchResult as U, type WsConnection as V, type WorkspaceContext as W, agentconfig as X, assistant as Y, authenticatedFetch as Z, buildRetrievalChunkTool as _, type CliConfig as a, buildRetrievalTocTool as a0, connectWebSocket as a1, connectWithReconnect as a2, consumeSSEStream as a3, contacts as a4, conversations as a5, countCitations as a6, createAuthenticatedClient as a7, createDocumentWaiter as a8, dm as a9, stripCitationMarkdown as aA, summarizeCitations as aB, tags as aC, workspaces as aD, doctags as aa, documents as ab, files as ac, formatAgentStepLabel as ad, formatFileSize as ae, formatStreamSummary as af, formatUserName as ag, formatWorkspaceChoices as ah, formatWsMessage as ai, generateEncryptedWorkspaceKey as aj, getErrorCode as ak, getErrorMessage as al, health as am, parseSSEEvents as an, performPasswordLogin as ao, performSsoDeviceFlowLogin as ap, requireData as aq, requireOk as ar, resolveAuth as as, resolveCitations as at, resolveWorkspace as au, responses as av, selectWorkspace as aw, selectWorkspaceById as ax, settings as ay, streamSSE as az, type CliCredentials as b, type ChatSession as c, type UploadOptions as d, type UploadResult as e, type AgentStepEvent as f, Arbi as g, ArbiApiError as h, ArbiError as i, type ArbiOptions as j, type ArtifactEvent as k, type AuthContext as l, type AuthenticatedClient as m, type CitationSummary as n, type ConnectOptions as o, type DocumentWaiterOptions as p, type MessageMetadataPayload$1 as q, type MessageQueuedEvent as r, type ReconnectableWsConnection as s, type ResolvedCitation as t, type ResponseCompletedEvent as u, type ResponseContentPartAddedEvent as v, type ResponseCreatedEvent as w, type ResponseFailedEvent as x, type ResponseOutputItemAddedEvent as y, type ResponseOutputItemDoneEvent as z };
|
|
@@ -92,6 +92,8 @@ interface CliCredentials {
|
|
|
92
92
|
workspaceId?: string;
|
|
93
93
|
/** ISO timestamp when the token was cached */
|
|
94
94
|
tokenTimestamp?: string;
|
|
95
|
+
/** Auth0 SSO token — needed for session recovery of SSO users */
|
|
96
|
+
ssoToken?: string;
|
|
95
97
|
}
|
|
96
98
|
interface ChatSession {
|
|
97
99
|
/** Last assistant message ID — used as previous_response_id for follow-ups */
|
|
@@ -173,6 +175,17 @@ declare function createAuthenticatedClient(config: CliConfig, creds: CliCredenti
|
|
|
173
175
|
* use createAuthenticatedClient() instead.
|
|
174
176
|
*/
|
|
175
177
|
declare function performPasswordLogin(config: CliConfig, email: string, password: string, store: ConfigStore): Promise<AuthContext>;
|
|
178
|
+
/**
|
|
179
|
+
* SSO device-flow login (RFC 8628).
|
|
180
|
+
*
|
|
181
|
+
* Fetches SSO config from the deployment, initiates the device authorization
|
|
182
|
+
* flow with Auth0, waits for the user to authorize in a browser, then logs
|
|
183
|
+
* in to the ARBI deployment using the Auth0 JWT.
|
|
184
|
+
*/
|
|
185
|
+
declare function performSsoDeviceFlowLogin(config: CliConfig, email: string, password: string, store: ConfigStore, callbacks?: {
|
|
186
|
+
onUserCode?: (userCode: string, verificationUri: string) => void;
|
|
187
|
+
onPoll?: (elapsedMs: number) => void;
|
|
188
|
+
}): Promise<AuthContext>;
|
|
176
189
|
/**
|
|
177
190
|
* Decrypt wrapped workspace key and set it as the active workspace header.
|
|
178
191
|
*/
|
|
@@ -3306,4 +3319,4 @@ declare namespace responses {
|
|
|
3306
3319
|
export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
|
|
3307
3320
|
}
|
|
3308
3321
|
|
|
3309
|
-
export { buildRetrievalFullContextTool as $, type AuthHeaders as A, type ResponseOutputTextDeltaEvent as B, type ConfigStore as C, type DocumentWaiter as D, type ResponseOutputTextDoneEvent as E, type FormattedWsMessage as F, type ResponseUsage as G, type SSEStreamCallbacks as H, type SSEStreamResult as I, type SSEStreamStartData as J, type UserInfo as K, LIFECYCLE_LABELS as L, type MessageLevel as M, type UserInputRequestEvent as N, type OutputTokensDetails as O, type UserMessageEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, TOOL_LABELS as T, type UploadBatchResult as U, type WsConnection as V, type WorkspaceContext as W, agentconfig as X, assistant as Y, authenticatedFetch as Z, buildRetrievalChunkTool as _, type CliConfig as a, buildRetrievalTocTool as a0, connectWebSocket as a1, connectWithReconnect as a2, consumeSSEStream as a3, contacts as a4, conversations as a5, countCitations as a6, createAuthenticatedClient as a7, createDocumentWaiter as a8, dm as a9,
|
|
3322
|
+
export { buildRetrievalFullContextTool as $, type AuthHeaders as A, type ResponseOutputTextDeltaEvent as B, type ConfigStore as C, type DocumentWaiter as D, type ResponseOutputTextDoneEvent as E, type FormattedWsMessage as F, type ResponseUsage as G, type SSEStreamCallbacks as H, type SSEStreamResult as I, type SSEStreamStartData as J, type UserInfo as K, LIFECYCLE_LABELS as L, type MessageLevel as M, type UserInputRequestEvent as N, type OutputTokensDetails as O, type UserMessageEvent as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, TOOL_LABELS as T, type UploadBatchResult as U, type WsConnection as V, type WorkspaceContext as W, agentconfig as X, assistant as Y, authenticatedFetch as Z, buildRetrievalChunkTool as _, type CliConfig as a, buildRetrievalTocTool as a0, connectWebSocket as a1, connectWithReconnect as a2, consumeSSEStream as a3, contacts as a4, conversations as a5, countCitations as a6, createAuthenticatedClient as a7, createDocumentWaiter as a8, dm as a9, stripCitationMarkdown as aA, summarizeCitations as aB, tags as aC, workspaces as aD, doctags as aa, documents as ab, files as ac, formatAgentStepLabel as ad, formatFileSize as ae, formatStreamSummary as af, formatUserName as ag, formatWorkspaceChoices as ah, formatWsMessage as ai, generateEncryptedWorkspaceKey as aj, getErrorCode as ak, getErrorMessage as al, health as am, parseSSEEvents as an, performPasswordLogin as ao, performSsoDeviceFlowLogin as ap, requireData as aq, requireOk as ar, resolveAuth as as, resolveCitations as at, resolveWorkspace as au, responses as av, selectWorkspace as aw, selectWorkspaceById as ax, settings as ay, streamSSE as az, type CliCredentials as b, type ChatSession as c, type UploadOptions as d, type UploadResult as e, type AgentStepEvent as f, Arbi as g, ArbiApiError as h, ArbiError as i, type ArbiOptions as j, type ArtifactEvent as k, type AuthContext as l, type AuthenticatedClient as m, type CitationSummary as n, type ConnectOptions as o, type DocumentWaiterOptions as p, type MessageMetadataPayload$1 as q, type MessageQueuedEvent as r, type ReconnectableWsConnection as s, type ResolvedCitation as t, type ResponseCompletedEvent as u, type ResponseContentPartAddedEvent as v, type ResponseCreatedEvent as w, type ResponseFailedEvent as x, type ResponseOutputItemAddedEvent as y, type ResponseOutputItemDoneEvent as z };
|
package/dist/browser.cjs
CHANGED
|
@@ -98,6 +98,8 @@ async function authenticatedFetch(options) {
|
|
|
98
98
|
}
|
|
99
99
|
return res;
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
// src/auth.ts
|
|
101
103
|
function formatWorkspaceChoices(wsList) {
|
|
102
104
|
return wsList.map((ws) => {
|
|
103
105
|
const totalDocs = ws.shared_document_count + ws.private_document_count;
|
|
@@ -118,7 +120,8 @@ async function createAuthenticatedClient(config, creds, store) {
|
|
|
118
120
|
const signingPrivateKey = client.base64ToBytes(creds.signingPrivateKeyBase64);
|
|
119
121
|
const loginResult = await arbi.auth.loginWithKey({
|
|
120
122
|
email: creds.email,
|
|
121
|
-
signingPrivateKey
|
|
123
|
+
signingPrivateKey,
|
|
124
|
+
ssoToken: creds.ssoToken
|
|
122
125
|
});
|
|
123
126
|
store.saveCredentials({
|
|
124
127
|
...creds,
|