@arbidocs/sdk 0.4.70 → 0.4.72
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/README.md +1 -0
- package/dist/{browser-Dhk899kq.d.cts → browser-BWUCi_v2.d.cts} +682 -10
- package/dist/{browser-Dhk899kq.d.ts → browser-BWUCi_v2.d.ts} +682 -10
- package/dist/browser.cjs +129 -5
- 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 +128 -6
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +129 -5
- 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 +128 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as ActivityKind, a as ActivityResponse, b as AgentControlStateEvent, c as AgentStepDeltaEvent, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, h as ArbiErrorEvent, i as ArbiOptions, k as ArtifactEvent, l as AuthContext, m as AuthHeaders, n as AuthMode, o as AuthenticatedClient, C as ChatSession, p as CitationSummary, q as CliConfig, r as CliCredentials, s as CommandDescriptor, t as ConfigStore, u as ConnectOptions, v as ConversationResponse, w as CreateFactRequest, x as CreateFactsRequest, y as CreateWorkRequest, z as CreateWorkflowRequest, B as DecryptedDmNotification, E as DeferredInterjectionEvent, F as DmAttachmentFile, G as DmAttachmentInput, J as DocumentAutomationAction, M as DocumentSelector, P as FactResponse, Q as FactSearchRequest, R as FactSearchResponse, U as
|
|
1
|
+
export { A as ActivityKind, a as ActivityResponse, b as AgentControlStateEvent, c as AgentStepDeltaEvent, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, h as ArbiErrorEvent, i as ArbiOptions, k as ArtifactEvent, l as AuthContext, m as AuthHeaders, n as AuthMode, o as AuthenticatedClient, C as ChatSession, p as CitationSummary, q as CliConfig, r as CliCredentials, s as CommandDescriptor, t as ConfigStore, u as ConnectOptions, v as ConversationResponse, w as CreateFactRequest, x as CreateFactsRequest, y as CreateWorkRequest, z as CreateWorkflowRequest, B as DecryptedDmNotification, E as DeferredInterjectionEvent, F as DmAttachmentFile, G as DmAttachmentInput, J as DocumentAutomationAction, M as DocumentSelector, P as FactResponse, Q as FactSearchRequest, R as FactSearchResponse, T as IdentityErrorCode, U as IdentityPurchase, V as IdentityState, W as IdentityStatus, Y as ListFactsOptions, a0 as MessageMetadataPayload, a1 as MessageQueuedEvent, a2 as OutputTokensDetails, a3 as ParsedSlashCommand, a4 as PendingAuthResponse, a5 as PlanWorkRequest, a6 as ProbeAnswerEvent, a7 as ProjectInvoicesResponse, a8 as ProjectUsageResponse, a9 as QueryOptions, aa as ReconnectOptions, ab as ReconnectableWsConnection, ac as ResolvedCitation, ae as ResponseCompletedEvent, af as ResponseContentPartAddedEvent, ag as ResponseCreatedEvent, ah as ResponseFailedEvent, ai as ResponseOutputItemAddedEvent, aj as ResponseOutputItemDoneEvent, ak as ResponseOutputTextDeltaEvent, al as ResponseOutputTextDoneEvent, am as ResponseUsage, an as SSEEvent, ao as SSEStreamCallbacks, ap as SSEStreamResult, aq as SSEStreamStartData, as as SkillSummary, au as SubmitBackgroundQueryOptions, av as TaskPlan, aw as TokenBudgetContext, ax as UpdateConversationRequest, ay as UpdateFactRequest, az as UpdateWorkflowRequest, aF as UserDailyUsageResponse, aG as UserInfo, aH as UserInputRequestEvent, aI as UserMessageEvent, aJ as WebSocketAuthError, aK as WorkStatus, aL as WorkflowAuthMode, aM as WorkflowResponse, aN as WorkflowRunHistoryResponse, aO as WorkflowRunResponse, aP as WorkspaceContext, aQ as WsConnection, aR as account, aS as agentconfig, aU as assistant, aV as authenticatedFetch, aX as buildFactsContextTool, aY as buildRetrievalChunkTool, aZ as buildRetrievalFullContextTool, a_ as buildRetrievalTocTool, a$ as connectWebSocket, b0 as connectWithReconnect, b1 as consumeSSEStream, b2 as contacts, b3 as conversations, b4 as countCitations, b5 as createAuthenticatedClient, b7 as dm, b8 as doctags, b9 as documents, ba as facts, bb as files, bc as filterSkills, bd as formatAgentStepLabel, be as formatFileSize, bf as formatItemLabel, bh as formatUserName, bi as formatWorkspaceChoices, bn as getErrorMessage, bo as getRawWorkspaceKey, bp as health, br as identityErrorCode, bq as identityVerification, bs as mail, bt as parseSSEEvents, bu as parseSlashCommand, bv as parseSlashTokenInProgress, bw as performPasswordLogin, bz as profile, bA as projects, bB as requireData, bC as requireOk, bD as resolveAuth, bE as resolveCitations, bF as resolveWorkspace, bG as responses, bH as selectWorkspace, bI as selectWorkspaceById, bJ as sessions, bK as settings, bL as streamSSE, bM as stripCitationMarkdown, bN as summarizeCitations, bO as tags, bP as work, bQ as workflows, bR as workspaces } from './browser-BWUCi_v2.cjs';
|
|
2
2
|
export { LoginProfile } from '@arbidocs/client';
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as ActivityKind, a as ActivityResponse, b as AgentControlStateEvent, c as AgentStepDeltaEvent, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, h as ArbiErrorEvent, i as ArbiOptions, k as ArtifactEvent, l as AuthContext, m as AuthHeaders, n as AuthMode, o as AuthenticatedClient, C as ChatSession, p as CitationSummary, q as CliConfig, r as CliCredentials, s as CommandDescriptor, t as ConfigStore, u as ConnectOptions, v as ConversationResponse, w as CreateFactRequest, x as CreateFactsRequest, y as CreateWorkRequest, z as CreateWorkflowRequest, B as DecryptedDmNotification, E as DeferredInterjectionEvent, F as DmAttachmentFile, G as DmAttachmentInput, J as DocumentAutomationAction, M as DocumentSelector, P as FactResponse, Q as FactSearchRequest, R as FactSearchResponse, U as
|
|
1
|
+
export { A as ActivityKind, a as ActivityResponse, b as AgentControlStateEvent, c as AgentStepDeltaEvent, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, h as ArbiErrorEvent, i as ArbiOptions, k as ArtifactEvent, l as AuthContext, m as AuthHeaders, n as AuthMode, o as AuthenticatedClient, C as ChatSession, p as CitationSummary, q as CliConfig, r as CliCredentials, s as CommandDescriptor, t as ConfigStore, u as ConnectOptions, v as ConversationResponse, w as CreateFactRequest, x as CreateFactsRequest, y as CreateWorkRequest, z as CreateWorkflowRequest, B as DecryptedDmNotification, E as DeferredInterjectionEvent, F as DmAttachmentFile, G as DmAttachmentInput, J as DocumentAutomationAction, M as DocumentSelector, P as FactResponse, Q as FactSearchRequest, R as FactSearchResponse, T as IdentityErrorCode, U as IdentityPurchase, V as IdentityState, W as IdentityStatus, Y as ListFactsOptions, a0 as MessageMetadataPayload, a1 as MessageQueuedEvent, a2 as OutputTokensDetails, a3 as ParsedSlashCommand, a4 as PendingAuthResponse, a5 as PlanWorkRequest, a6 as ProbeAnswerEvent, a7 as ProjectInvoicesResponse, a8 as ProjectUsageResponse, a9 as QueryOptions, aa as ReconnectOptions, ab as ReconnectableWsConnection, ac as ResolvedCitation, ae as ResponseCompletedEvent, af as ResponseContentPartAddedEvent, ag as ResponseCreatedEvent, ah as ResponseFailedEvent, ai as ResponseOutputItemAddedEvent, aj as ResponseOutputItemDoneEvent, ak as ResponseOutputTextDeltaEvent, al as ResponseOutputTextDoneEvent, am as ResponseUsage, an as SSEEvent, ao as SSEStreamCallbacks, ap as SSEStreamResult, aq as SSEStreamStartData, as as SkillSummary, au as SubmitBackgroundQueryOptions, av as TaskPlan, aw as TokenBudgetContext, ax as UpdateConversationRequest, ay as UpdateFactRequest, az as UpdateWorkflowRequest, aF as UserDailyUsageResponse, aG as UserInfo, aH as UserInputRequestEvent, aI as UserMessageEvent, aJ as WebSocketAuthError, aK as WorkStatus, aL as WorkflowAuthMode, aM as WorkflowResponse, aN as WorkflowRunHistoryResponse, aO as WorkflowRunResponse, aP as WorkspaceContext, aQ as WsConnection, aR as account, aS as agentconfig, aU as assistant, aV as authenticatedFetch, aX as buildFactsContextTool, aY as buildRetrievalChunkTool, aZ as buildRetrievalFullContextTool, a_ as buildRetrievalTocTool, a$ as connectWebSocket, b0 as connectWithReconnect, b1 as consumeSSEStream, b2 as contacts, b3 as conversations, b4 as countCitations, b5 as createAuthenticatedClient, b7 as dm, b8 as doctags, b9 as documents, ba as facts, bb as files, bc as filterSkills, bd as formatAgentStepLabel, be as formatFileSize, bf as formatItemLabel, bh as formatUserName, bi as formatWorkspaceChoices, bn as getErrorMessage, bo as getRawWorkspaceKey, bp as health, br as identityErrorCode, bq as identityVerification, bs as mail, bt as parseSSEEvents, bu as parseSlashCommand, bv as parseSlashTokenInProgress, bw as performPasswordLogin, bz as profile, bA as projects, bB as requireData, bC as requireOk, bD as resolveAuth, bE as resolveCitations, bF as resolveWorkspace, bG as responses, bH as selectWorkspace, bI as selectWorkspaceById, bJ as sessions, bK as settings, bL as streamSSE, bM as stripCitationMarkdown, bN as summarizeCitations, bO as tags, bP as work, bQ as workflows, bR as workspaces } from './browser-BWUCi_v2.js';
|
|
2
2
|
export { LoginProfile } from '@arbidocs/client';
|
package/dist/browser.js
CHANGED
|
@@ -5912,6 +5912,76 @@ async function requestDeletion(arbi) {
|
|
|
5912
5912
|
return requireData(await arbi.fetch.POST("/v1/user/request-deletion"), "Failed to delete account");
|
|
5913
5913
|
}
|
|
5914
5914
|
|
|
5915
|
+
// src/operations/identity.ts
|
|
5916
|
+
var identity_exports = {};
|
|
5917
|
+
__export(identity_exports, {
|
|
5918
|
+
acceptName: () => acceptName,
|
|
5919
|
+
getStatus: () => getStatus,
|
|
5920
|
+
identityErrorCode: () => identityErrorCode,
|
|
5921
|
+
purchase: () => purchase,
|
|
5922
|
+
refresh: () => refresh,
|
|
5923
|
+
remove: () => remove,
|
|
5924
|
+
startSession: () => startSession
|
|
5925
|
+
});
|
|
5926
|
+
function refusal(apiError) {
|
|
5927
|
+
const detail = apiError?.detail;
|
|
5928
|
+
if (typeof detail === "string") return { message: detail };
|
|
5929
|
+
if (detail && typeof detail === "object" && !Array.isArray(detail)) {
|
|
5930
|
+
const { code, message } = detail;
|
|
5931
|
+
return {
|
|
5932
|
+
code: typeof code === "string" ? code : void 0,
|
|
5933
|
+
message: typeof message === "string" ? message : void 0
|
|
5934
|
+
};
|
|
5935
|
+
}
|
|
5936
|
+
return {};
|
|
5937
|
+
}
|
|
5938
|
+
function identityErrorCode(error) {
|
|
5939
|
+
return error instanceof ArbiApiError ? refusal(error.apiError).code : void 0;
|
|
5940
|
+
}
|
|
5941
|
+
function unwrap(result, fallback) {
|
|
5942
|
+
if (result.error || result.data === void 0) {
|
|
5943
|
+
throw new ArbiApiError(
|
|
5944
|
+
refusal(result.error).message ?? fallback,
|
|
5945
|
+
result.error,
|
|
5946
|
+
result.response?.status
|
|
5947
|
+
);
|
|
5948
|
+
}
|
|
5949
|
+
return result.data;
|
|
5950
|
+
}
|
|
5951
|
+
async function getStatus(arbi) {
|
|
5952
|
+
return unwrap(await arbi.fetch.GET("/v1/user/identity"), "Failed to load identity verification");
|
|
5953
|
+
}
|
|
5954
|
+
async function purchase(arbi, projectExtId) {
|
|
5955
|
+
return unwrap(
|
|
5956
|
+
await arbi.fetch.POST("/v1/user/identity/purchase", {
|
|
5957
|
+
body: projectExtId ? { project_ext_id: projectExtId } : {}
|
|
5958
|
+
}),
|
|
5959
|
+
"Payment could not be completed"
|
|
5960
|
+
);
|
|
5961
|
+
}
|
|
5962
|
+
async function startSession(arbi) {
|
|
5963
|
+
const data = unwrap(
|
|
5964
|
+
await arbi.fetch.POST("/v1/user/identity/session"),
|
|
5965
|
+
"Could not start identity verification"
|
|
5966
|
+
);
|
|
5967
|
+
return data.url;
|
|
5968
|
+
}
|
|
5969
|
+
async function refresh(arbi) {
|
|
5970
|
+
return unwrap(
|
|
5971
|
+
await arbi.fetch.POST("/v1/user/identity/refresh"),
|
|
5972
|
+
"Could not read the verification result"
|
|
5973
|
+
);
|
|
5974
|
+
}
|
|
5975
|
+
async function acceptName(arbi) {
|
|
5976
|
+
return unwrap(
|
|
5977
|
+
await arbi.fetch.POST("/v1/user/identity/accept-name"),
|
|
5978
|
+
"Could not change your name"
|
|
5979
|
+
);
|
|
5980
|
+
}
|
|
5981
|
+
async function remove(arbi) {
|
|
5982
|
+
return unwrap(await arbi.fetch.DELETE("/v1/user/identity"), "Could not remove the verification");
|
|
5983
|
+
}
|
|
5984
|
+
|
|
5915
5985
|
// src/operations/projects.ts
|
|
5916
5986
|
var projects_exports = {};
|
|
5917
5987
|
__export(projects_exports, {
|
|
@@ -5928,10 +5998,10 @@ __export(projects_exports, {
|
|
|
5928
5998
|
async function listProjects(arbi) {
|
|
5929
5999
|
return requireData(await arbi.fetch.GET("/v1/user/projects/"), "Failed to fetch projects");
|
|
5930
6000
|
}
|
|
5931
|
-
async function createProject(arbi, name) {
|
|
6001
|
+
async function createProject(arbi, name, plan = "free") {
|
|
5932
6002
|
return requireData(
|
|
5933
6003
|
await arbi.fetch.POST("/v1/user/projects/", {
|
|
5934
|
-
body: { name }
|
|
6004
|
+
body: { name, plan }
|
|
5935
6005
|
}),
|
|
5936
6006
|
"Failed to create project"
|
|
5937
6007
|
);
|
|
@@ -6183,10 +6253,18 @@ var Arbi = class {
|
|
|
6183
6253
|
this.options = options;
|
|
6184
6254
|
}
|
|
6185
6255
|
// ── Lifecycle ───────────────────────────────────────────────────────────
|
|
6256
|
+
/**
|
|
6257
|
+
* The deployment domain the user's keys are derived for: `deploymentDomain` when given,
|
|
6258
|
+
* otherwise the hostname of `url`. Signing and password changes re-derive keys with it, so a
|
|
6259
|
+
* host that needs it (the document tools' e-signing) reads it here rather than recomputing it.
|
|
6260
|
+
*/
|
|
6261
|
+
getDeploymentDomain() {
|
|
6262
|
+
return this.options.deploymentDomain ?? new URL(this.options.url).hostname;
|
|
6263
|
+
}
|
|
6186
6264
|
/** Initialize the SDK client and sodium crypto. Called automatically by login(). */
|
|
6187
6265
|
async init() {
|
|
6188
6266
|
if (this.client) return this.client;
|
|
6189
|
-
const domain = this.
|
|
6267
|
+
const domain = this.getDeploymentDomain();
|
|
6190
6268
|
this.client = createArbiClient({
|
|
6191
6269
|
baseUrl: this.options.url,
|
|
6192
6270
|
deploymentDomain: domain,
|
|
@@ -6449,7 +6527,8 @@ var Arbi = class {
|
|
|
6449
6527
|
...this.userProfile,
|
|
6450
6528
|
givenName: updated.given_name ?? this.userProfile.givenName,
|
|
6451
6529
|
familyName: updated.family_name ?? null,
|
|
6452
|
-
picture: updated.picture ?? null
|
|
6530
|
+
picture: updated.picture ?? null,
|
|
6531
|
+
isIdentityVerified: updated.is_identity_verified ?? false
|
|
6453
6532
|
});
|
|
6454
6533
|
}
|
|
6455
6534
|
return updated;
|
|
@@ -6481,7 +6560,7 @@ var Arbi = class {
|
|
|
6481
6560
|
{ ...params, email, userExtId: lr2.userExtId },
|
|
6482
6561
|
{
|
|
6483
6562
|
fetchClient: client.fetch,
|
|
6484
|
-
deploymentDomain: this.
|
|
6563
|
+
deploymentDomain: this.getDeploymentDomain()
|
|
6485
6564
|
}
|
|
6486
6565
|
);
|
|
6487
6566
|
this.loginResult = { ...lr2, signingPrivateKey: result.newSigningPrivateKey };
|
|
@@ -6494,6 +6573,49 @@ var Arbi = class {
|
|
|
6494
6573
|
return result;
|
|
6495
6574
|
}
|
|
6496
6575
|
};
|
|
6576
|
+
// ── Identity verification ─────────────────────────────────────────────
|
|
6577
|
+
identity = {
|
|
6578
|
+
/** Whether the ID check is offered (Pro plans), its price, and where the user's check stands. */
|
|
6579
|
+
status: () => getStatus(this.requireClient()),
|
|
6580
|
+
/** Charge the one-time fee to an own Pro project; `requires_action` carries a payment URL. */
|
|
6581
|
+
purchase: (projectExtId) => purchase(this.requireClient(), projectExtId),
|
|
6582
|
+
/** The Didit session URL to run the web SDK on. */
|
|
6583
|
+
startSession: () => startSession(this.requireClient()),
|
|
6584
|
+
/** Read the decision of the open check; the profile follows a granted tick. */
|
|
6585
|
+
refresh: async () => {
|
|
6586
|
+
const status = await refresh(this.requireClient());
|
|
6587
|
+
this.syncIdentity(status);
|
|
6588
|
+
return status;
|
|
6589
|
+
},
|
|
6590
|
+
/** Take the name on the document as the account name; the profile follows. */
|
|
6591
|
+
acceptName: async () => {
|
|
6592
|
+
const client = this.requireClient();
|
|
6593
|
+
const offered = await getStatus(client);
|
|
6594
|
+
const status = await acceptName(client);
|
|
6595
|
+
if (this.userProfile && offered.document_given_name) {
|
|
6596
|
+
this.setUserProfile({
|
|
6597
|
+
...this.userProfile,
|
|
6598
|
+
givenName: offered.document_given_name,
|
|
6599
|
+
familyName: offered.document_family_name ?? null,
|
|
6600
|
+
isIdentityVerified: status.verified
|
|
6601
|
+
});
|
|
6602
|
+
} else {
|
|
6603
|
+
this.syncIdentity(status);
|
|
6604
|
+
}
|
|
6605
|
+
return status;
|
|
6606
|
+
},
|
|
6607
|
+
/** Remove the tick and erase any open check. */
|
|
6608
|
+
remove: async () => {
|
|
6609
|
+
const status = await remove(this.requireClient());
|
|
6610
|
+
this.syncIdentity(status);
|
|
6611
|
+
return status;
|
|
6612
|
+
}
|
|
6613
|
+
};
|
|
6614
|
+
syncIdentity(status) {
|
|
6615
|
+
if (this.userProfile && this.userProfile.isIdentityVerified !== status.verified) {
|
|
6616
|
+
this.setUserProfile({ ...this.userProfile, isIdentityVerified: status.verified });
|
|
6617
|
+
}
|
|
6618
|
+
}
|
|
6497
6619
|
// ── Workspaces ────────────────────────────────────────────────────────
|
|
6498
6620
|
workspaces = {
|
|
6499
6621
|
list: () => listWorkspaces(this.requireClient()),
|
|
@@ -7126,6 +7248,6 @@ function bytesToBase642(bytes) {
|
|
|
7126
7248
|
return btoa(binary);
|
|
7127
7249
|
}
|
|
7128
7250
|
|
|
7129
|
-
export { Arbi, ArbiApiError, ArbiError, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, assistant_exports as assistant, authenticatedFetch, buildFactsContextTool, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, connectWebSocket, connectWithReconnect, consumeSSEStream, contacts_exports as contacts, conversations_exports as conversations, countCitations, createAuthenticatedClient, dm_exports as dm, doctags_exports as doctags, documents_exports as documents, facts_exports as facts, files_exports as files, filterSkills, formatAgentStepLabel, formatFileSize, formatItemLabel, formatUserName, formatWorkspaceChoices, getErrorMessage, getRawWorkspaceKey, health_exports as health, mail_exports as mail, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, performPasswordLogin, profile_exports as profile, projects_exports as projects, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, work_exports as work, workflows_exports as workflows, workspaces_exports as workspaces };
|
|
7251
|
+
export { Arbi, ArbiApiError, ArbiError, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, assistant_exports as assistant, authenticatedFetch, buildFactsContextTool, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, connectWebSocket, connectWithReconnect, consumeSSEStream, contacts_exports as contacts, conversations_exports as conversations, countCitations, createAuthenticatedClient, dm_exports as dm, doctags_exports as doctags, documents_exports as documents, facts_exports as facts, files_exports as files, filterSkills, formatAgentStepLabel, formatFileSize, formatItemLabel, formatUserName, formatWorkspaceChoices, getErrorMessage, getRawWorkspaceKey, health_exports as health, identityErrorCode, identity_exports as identityVerification, mail_exports as mail, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, performPasswordLogin, profile_exports as profile, projects_exports as projects, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, work_exports as work, workflows_exports as workflows, workspaces_exports as workspaces };
|
|
7130
7252
|
//# sourceMappingURL=browser.js.map
|
|
7131
7253
|
//# sourceMappingURL=browser.js.map
|