@arbidocs/sdk 0.3.88 → 0.3.90
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-qGcHaBIG.d.cts → browser-1eU3ZnIX.d.cts} +92 -1
- package/dist/{browser-qGcHaBIG.d.ts → browser-1eU3ZnIX.d.ts} +92 -1
- package/dist/browser.cjs +38 -0
- 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 +38 -0
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +38 -0
- 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 +38 -0
- 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 AgentStepDeltaEvent, a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, e as ArbiErrorEvent, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, i as AuthHeaders, j as AuthenticatedClient, C as ChatSession, k as CitationSummary, l as CliConfig, m as CliCredentials, n as ConfigStore, o as ConnectOptions, w as MessageMetadataPayload, x as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, y as ReconnectableWsConnection, z as ResolvedCitation, B as ResponseCompletedEvent, E as ResponseContentPartAddedEvent, G as ResponseCreatedEvent, H as ResponseFailedEvent, I as ResponseOutputItemAddedEvent, J as ResponseOutputItemDoneEvent, K as ResponseOutputTextDeltaEvent, N as ResponseOutputTextDoneEvent, S as ResponseUsage, T as SSEEvent, U as SSEStreamCallbacks, V as SSEStreamResult, W as SSEStreamStartData, Y as SkillSummary, a3 as UserInfo, a4 as UserInputRequestEvent, a5 as UserMessageEvent, a6 as WebSocketAuthError, a7 as WorkspaceContext, a8 as WsConnection, a9 as agentconfig, aa as assistant, ab as authenticatedFetch, ac as buildRetrievalChunkTool, ad as buildRetrievalFullContextTool, ae as buildRetrievalTocTool, af as connectWebSocket, ag as connectWithReconnect, ah as consumeSSEStream, ai as contacts, aj as conversations, ak as countCitations, al as createAuthenticatedClient, an as dm, ao as doctags, ap as documents, aq as files, ar as filterSkills, as as formatAgentStepLabel, at as formatFileSize, av as formatUserName, aw as formatWorkspaceChoices, aB as getErrorMessage, aC as getRawWorkspaceKey, aD as health, aE as parseSSEEvents, aF as parseSlashCommand, aG as parseSlashTokenInProgress, aH as performPasswordLogin, aK as requireData, aL as requireOk, aM as resolveAuth, aN as resolveCitations, aO as resolveWorkspace, aP as responses, aQ as selectWorkspace, aR as selectWorkspaceById, aS as settings, aT as streamSSE, aU as stripCitationMarkdown, aV as summarizeCitations, aW as tags, aX as workspaces } from './browser-
|
|
1
|
+
export { A as AgentStepDeltaEvent, a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, e as ArbiErrorEvent, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, i as AuthHeaders, j as AuthenticatedClient, C as ChatSession, k as CitationSummary, l as CliConfig, m as CliCredentials, n as ConfigStore, o as ConnectOptions, w as MessageMetadataPayload, x as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, y as ReconnectableWsConnection, z as ResolvedCitation, B as ResponseCompletedEvent, E as ResponseContentPartAddedEvent, G as ResponseCreatedEvent, H as ResponseFailedEvent, I as ResponseOutputItemAddedEvent, J as ResponseOutputItemDoneEvent, K as ResponseOutputTextDeltaEvent, N as ResponseOutputTextDoneEvent, S as ResponseUsage, T as SSEEvent, U as SSEStreamCallbacks, V as SSEStreamResult, W as SSEStreamStartData, Y as SkillSummary, a3 as UserInfo, a4 as UserInputRequestEvent, a5 as UserMessageEvent, a6 as WebSocketAuthError, a7 as WorkspaceContext, a8 as WsConnection, a9 as agentconfig, aa as assistant, ab as authenticatedFetch, ac as buildRetrievalChunkTool, ad as buildRetrievalFullContextTool, ae as buildRetrievalTocTool, af as connectWebSocket, ag as connectWithReconnect, ah as consumeSSEStream, ai as contacts, aj as conversations, ak as countCitations, al as createAuthenticatedClient, an as dm, ao as doctags, ap as documents, aq as files, ar as filterSkills, as as formatAgentStepLabel, at as formatFileSize, av as formatUserName, aw as formatWorkspaceChoices, aB as getErrorMessage, aC as getRawWorkspaceKey, aD as health, aE as parseSSEEvents, aF as parseSlashCommand, aG as parseSlashTokenInProgress, aH as performPasswordLogin, aK as requireData, aL as requireOk, aM as resolveAuth, aN as resolveCitations, aO as resolveWorkspace, aP as responses, aQ as selectWorkspace, aR as selectWorkspaceById, aS as settings, aT as streamSSE, aU as stripCitationMarkdown, aV as summarizeCitations, aW as tags, aX as workspaces } from './browser-1eU3ZnIX.cjs';
|
|
2
2
|
import '@arbidocs/client';
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AgentStepDeltaEvent, a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, e as ArbiErrorEvent, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, i as AuthHeaders, j as AuthenticatedClient, C as ChatSession, k as CitationSummary, l as CliConfig, m as CliCredentials, n as ConfigStore, o as ConnectOptions, w as MessageMetadataPayload, x as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, y as ReconnectableWsConnection, z as ResolvedCitation, B as ResponseCompletedEvent, E as ResponseContentPartAddedEvent, G as ResponseCreatedEvent, H as ResponseFailedEvent, I as ResponseOutputItemAddedEvent, J as ResponseOutputItemDoneEvent, K as ResponseOutputTextDeltaEvent, N as ResponseOutputTextDoneEvent, S as ResponseUsage, T as SSEEvent, U as SSEStreamCallbacks, V as SSEStreamResult, W as SSEStreamStartData, Y as SkillSummary, a3 as UserInfo, a4 as UserInputRequestEvent, a5 as UserMessageEvent, a6 as WebSocketAuthError, a7 as WorkspaceContext, a8 as WsConnection, a9 as agentconfig, aa as assistant, ab as authenticatedFetch, ac as buildRetrievalChunkTool, ad as buildRetrievalFullContextTool, ae as buildRetrievalTocTool, af as connectWebSocket, ag as connectWithReconnect, ah as consumeSSEStream, ai as contacts, aj as conversations, ak as countCitations, al as createAuthenticatedClient, an as dm, ao as doctags, ap as documents, aq as files, ar as filterSkills, as as formatAgentStepLabel, at as formatFileSize, av as formatUserName, aw as formatWorkspaceChoices, aB as getErrorMessage, aC as getRawWorkspaceKey, aD as health, aE as parseSSEEvents, aF as parseSlashCommand, aG as parseSlashTokenInProgress, aH as performPasswordLogin, aK as requireData, aL as requireOk, aM as resolveAuth, aN as resolveCitations, aO as resolveWorkspace, aP as responses, aQ as selectWorkspace, aR as selectWorkspaceById, aS as settings, aT as streamSSE, aU as stripCitationMarkdown, aV as summarizeCitations, aW as tags, aX as workspaces } from './browser-
|
|
1
|
+
export { A as AgentStepDeltaEvent, a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, e as ArbiErrorEvent, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, i as AuthHeaders, j as AuthenticatedClient, C as ChatSession, k as CitationSummary, l as CliConfig, m as CliCredentials, n as ConfigStore, o as ConnectOptions, w as MessageMetadataPayload, x as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, y as ReconnectableWsConnection, z as ResolvedCitation, B as ResponseCompletedEvent, E as ResponseContentPartAddedEvent, G as ResponseCreatedEvent, H as ResponseFailedEvent, I as ResponseOutputItemAddedEvent, J as ResponseOutputItemDoneEvent, K as ResponseOutputTextDeltaEvent, N as ResponseOutputTextDoneEvent, S as ResponseUsage, T as SSEEvent, U as SSEStreamCallbacks, V as SSEStreamResult, W as SSEStreamStartData, Y as SkillSummary, a3 as UserInfo, a4 as UserInputRequestEvent, a5 as UserMessageEvent, a6 as WebSocketAuthError, a7 as WorkspaceContext, a8 as WsConnection, a9 as agentconfig, aa as assistant, ab as authenticatedFetch, ac as buildRetrievalChunkTool, ad as buildRetrievalFullContextTool, ae as buildRetrievalTocTool, af as connectWebSocket, ag as connectWithReconnect, ah as consumeSSEStream, ai as contacts, aj as conversations, ak as countCitations, al as createAuthenticatedClient, an as dm, ao as doctags, ap as documents, aq as files, ar as filterSkills, as as formatAgentStepLabel, at as formatFileSize, av as formatUserName, aw as formatWorkspaceChoices, aB as getErrorMessage, aC as getRawWorkspaceKey, aD as health, aE as parseSSEEvents, aF as parseSlashCommand, aG as parseSlashTokenInProgress, aH as performPasswordLogin, aK as requireData, aL as requireOk, aM as resolveAuth, aN as resolveCitations, aO as resolveWorkspace, aP as responses, aQ as selectWorkspace, aR as selectWorkspaceById, aS as settings, aT as streamSSE, aU as stripCitationMarkdown, aV as summarizeCitations, aW as tags, aX as workspaces } from './browser-1eU3ZnIX.js';
|
|
2
2
|
import '@arbidocs/client';
|
package/dist/browser.js
CHANGED
|
@@ -5032,6 +5032,7 @@ __export(dm_exports, {
|
|
|
5032
5032
|
listDMs: () => listDMs,
|
|
5033
5033
|
listDecryptedDMs: () => listDecryptedDMs,
|
|
5034
5034
|
markRead: () => markRead,
|
|
5035
|
+
requestWorkspaceAccess: () => requestWorkspaceAccess,
|
|
5035
5036
|
sendDM: () => sendDM,
|
|
5036
5037
|
sendEncryptedDM: () => sendEncryptedDM
|
|
5037
5038
|
});
|
|
@@ -5100,6 +5101,28 @@ async function sendEncryptedDM(arbi, messages, crypto) {
|
|
|
5100
5101
|
"Failed to send message"
|
|
5101
5102
|
);
|
|
5102
5103
|
}
|
|
5104
|
+
async function requestWorkspaceAccess(arbi, params, crypto) {
|
|
5105
|
+
const payload = JSON.stringify({
|
|
5106
|
+
session_pubkey_b64: params.sessionPubkeyB64,
|
|
5107
|
+
note: params.note?.trim() || void 0
|
|
5108
|
+
});
|
|
5109
|
+
const content = await encryptDmContent(
|
|
5110
|
+
arbi,
|
|
5111
|
+
payload,
|
|
5112
|
+
params.recipientEncryptionPublicKey,
|
|
5113
|
+
crypto.encryptionKeypair.secretKey
|
|
5114
|
+
);
|
|
5115
|
+
return requireData(
|
|
5116
|
+
await arbi.fetch.POST("/v1/notifications/access-request", {
|
|
5117
|
+
body: {
|
|
5118
|
+
recipient_ext_id: params.recipientExtId,
|
|
5119
|
+
content,
|
|
5120
|
+
...params.workspaceExtId ? { workspace_ext_id: params.workspaceExtId } : {}
|
|
5121
|
+
}
|
|
5122
|
+
}),
|
|
5123
|
+
"Failed to request workspace access"
|
|
5124
|
+
);
|
|
5125
|
+
}
|
|
5103
5126
|
async function sendDM(arbi, messages) {
|
|
5104
5127
|
return requireData(
|
|
5105
5128
|
await arbi.fetch.POST("/v1/notifications/", {
|
|
@@ -5449,6 +5472,21 @@ var Arbi = class {
|
|
|
5449
5472
|
addUsers: (emails, role) => addWorkspaceUsers(this.requireClient(), emails, role),
|
|
5450
5473
|
removeUsers: (userIds) => removeWorkspaceUsers(this.requireClient(), userIds),
|
|
5451
5474
|
setUserRole: (userIds, role) => setUserRole(this.requireClient(), userIds, role),
|
|
5475
|
+
/**
|
|
5476
|
+
* Ask another user to grant you workspace access. Builds the E2E-encrypted
|
|
5477
|
+
* request `content` (carrying this session's public key for a temporary
|
|
5478
|
+
* grant) and posts it. `workspaceExtId` is optional — pass it only when you
|
|
5479
|
+
* already know the target workspace id (obtained out-of-band).
|
|
5480
|
+
*/
|
|
5481
|
+
requestAccess: (params) => {
|
|
5482
|
+
const client = this.requireClient();
|
|
5483
|
+
const lr2 = this.requireLogin();
|
|
5484
|
+
const userExtId = lr2.userExtId ?? client.session.getState().userExtId;
|
|
5485
|
+
if (!userExtId) throw new ArbiError("No user id in session \u2014 cannot request access");
|
|
5486
|
+
const crypto = createDmCryptoContext(client, lr2.signingPrivateKey, userExtId);
|
|
5487
|
+
const sessionPubkeyB64 = client.crypto.bytesToBase64(lr2.serverSessionKey);
|
|
5488
|
+
return requestWorkspaceAccess(client, { ...params, sessionPubkeyB64 }, crypto);
|
|
5489
|
+
},
|
|
5452
5490
|
copyDocuments: (targetWorkspaceId, docIds, targetWorkspaceKey) => copyDocuments(
|
|
5453
5491
|
this.requireClient(),
|
|
5454
5492
|
targetWorkspaceId,
|