@arbidocs/sdk 0.3.46 → 0.3.48
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-HVCa8Ph5.d.cts → browser-EMgd4bP4.d.cts} +72 -18
- package/dist/{browser-HVCa8Ph5.d.ts → browser-EMgd4bP4.d.ts} +72 -18
- package/dist/browser.cjs +148 -38
- 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 +148 -39
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +146 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.js +146 -84
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, A as AuthHeaders, p as AuthenticatedClient, c as ChatSession, q as CitationSummary, a as CliConfig, b as CliCredentials, C as ConfigStore, r as ConnectOptions, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, ao as formatUserName, ap as formatWorkspaceChoices, au as getErrorMessage, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-
|
|
1
|
+
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, A as AuthHeaders, p as AuthenticatedClient, c as ChatSession, q as CitationSummary, a as CliConfig, b as CliCredentials, C as ConfigStore, r as ConnectOptions, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, ao as formatUserName, ap as formatWorkspaceChoices, au as getErrorMessage, av as getRawWorkspaceKey, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-EMgd4bP4.cjs';
|
|
2
2
|
import '@arbidocs/client';
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, A as AuthHeaders, p as AuthenticatedClient, c as ChatSession, q as CitationSummary, a as CliConfig, b as CliCredentials, C as ConfigStore, r as ConnectOptions, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, ao as formatUserName, ap as formatWorkspaceChoices, au as getErrorMessage, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-
|
|
1
|
+
export { i as AgentStepEvent, j as Arbi, k as ArbiApiError, l as ArbiError, m as ArbiOptions, n as ArtifactEvent, o as AuthContext, A as AuthHeaders, p as AuthenticatedClient, c as ChatSession, q as CitationSummary, a as CliConfig, b as CliCredentials, C as ConfigStore, r as ConnectOptions, y as MessageMetadataPayload, z as MessageQueuedEvent, O as OutputTokensDetails, Q as QueryOptions, R as ReconnectOptions, B as ReconnectableWsConnection, E as ResolvedCitation, G as ResponseCompletedEvent, H as ResponseContentPartAddedEvent, I as ResponseCreatedEvent, J as ResponseFailedEvent, K as ResponseOutputItemAddedEvent, N as ResponseOutputItemDoneEvent, P as ResponseOutputTextDeltaEvent, T as ResponseOutputTextDoneEvent, V as ResponseUsage, W as SSEEvent, X as SSEStreamCallbacks, Y as SSEStreamResult, Z as SSEStreamStartData, _ as UserInfo, $ as UserInputRequestEvent, a0 as UserMessageEvent, a1 as WorkspaceContext, a2 as WsConnection, a3 as agentconfig, a4 as assistant, a5 as authenticatedFetch, a6 as buildRetrievalChunkTool, a7 as buildRetrievalFullContextTool, a8 as buildRetrievalTocTool, a9 as connectWebSocket, aa as connectWithReconnect, ab as consumeSSEStream, ac as contacts, ad as conversations, ae as countCitations, af as createAuthenticatedClient, ah as dm, ai as doctags, aj as documents, ak as files, al as formatAgentStepLabel, am as formatFileSize, ao as formatUserName, ap as formatWorkspaceChoices, au as getErrorMessage, av as getRawWorkspaceKey, aw as health, ax as parseSSEEvents, ay as performPasswordLogin, aB as requireData, aC as requireOk, aD as resolveAuth, aE as resolveCitations, aF as resolveWorkspace, aG as responses, aH as selectWorkspace, aI as selectWorkspaceById, aJ as settings, aK as streamSSE, aL as stripCitationMarkdown, aM as summarizeCitations, aN as tags, aO as workspaces } from './browser-EMgd4bP4.js';
|
|
2
2
|
import '@arbidocs/client';
|
package/dist/browser.js
CHANGED
|
@@ -3634,6 +3634,23 @@ async function generateEncryptedWorkspaceKey(arbi, wrappedKey, serverSessionKey,
|
|
|
3634
3634
|
const workspaceKey = sealedBoxDecrypt(wrappedKey, encryptionKeyPair.secretKey);
|
|
3635
3635
|
return sealKeyForSession(workspaceKey, serverSessionKey);
|
|
3636
3636
|
}
|
|
3637
|
+
async function getRawWorkspaceKey(arbi, workspaceId, signingPrivateKeyBase64) {
|
|
3638
|
+
const { data: workspaces, error } = await arbi.fetch.GET("/v1/user/workspaces");
|
|
3639
|
+
if (error || !workspaces) {
|
|
3640
|
+
throw new ArbiError("Failed to fetch workspaces");
|
|
3641
|
+
}
|
|
3642
|
+
const ws = workspaces.find((w2) => w2.external_id === workspaceId);
|
|
3643
|
+
if (!ws || !ws.wrapped_key) {
|
|
3644
|
+
throw new ArbiError(`Workspace ${workspaceId} not found or has no encryption key`);
|
|
3645
|
+
}
|
|
3646
|
+
const signingPrivateKey = base64ToBytes(signingPrivateKeyBase64);
|
|
3647
|
+
const ed25519PublicKey = signingPrivateKey.slice(32, 64);
|
|
3648
|
+
const encryptionKeyPair = deriveEncryptionKeypairFromSigning({
|
|
3649
|
+
publicKey: ed25519PublicKey,
|
|
3650
|
+
secretKey: signingPrivateKey
|
|
3651
|
+
});
|
|
3652
|
+
return sealedBoxDecrypt(ws.wrapped_key, encryptionKeyPair.secretKey);
|
|
3653
|
+
}
|
|
3637
3654
|
async function selectWorkspaceById(arbi, workspaceId, serverSessionKey, signingPrivateKeyBase64) {
|
|
3638
3655
|
const { data: workspaces, error } = await arbi.fetch.GET("/v1/user/workspaces");
|
|
3639
3656
|
if (error || !workspaces) {
|
|
@@ -4103,6 +4120,7 @@ __export(documents_exports, {
|
|
|
4103
4120
|
listAll: () => listAll,
|
|
4104
4121
|
listDocuments: () => listDocuments,
|
|
4105
4122
|
listPaginated: () => listPaginated,
|
|
4123
|
+
mimeFromName: () => mimeFromName,
|
|
4106
4124
|
sanitizeFolderPath: () => sanitizeFolderPath,
|
|
4107
4125
|
updateDocuments: () => updateDocuments,
|
|
4108
4126
|
uploadDocumentsDirect: () => uploadDocumentsDirect,
|
|
@@ -4157,10 +4175,17 @@ async function listDocuments(arbi) {
|
|
|
4157
4175
|
return requireData(await arbi.fetch.GET("/v1/document/list"), "Failed to fetch documents");
|
|
4158
4176
|
}
|
|
4159
4177
|
async function* listPaginated(arbi, options = {}) {
|
|
4160
|
-
const {
|
|
4161
|
-
|
|
4178
|
+
const {
|
|
4179
|
+
pageSize = 5e3,
|
|
4180
|
+
firstPageSize,
|
|
4181
|
+
order = "id_asc",
|
|
4182
|
+
fields,
|
|
4183
|
+
signal,
|
|
4184
|
+
lookahead = 1
|
|
4185
|
+
} = options;
|
|
4186
|
+
const fetchPage = async (pageOffset, limit) => {
|
|
4162
4187
|
const query = {
|
|
4163
|
-
limit
|
|
4188
|
+
limit,
|
|
4164
4189
|
offset: pageOffset,
|
|
4165
4190
|
order
|
|
4166
4191
|
};
|
|
@@ -4183,19 +4208,21 @@ async function* listPaginated(arbi, options = {}) {
|
|
|
4183
4208
|
const queue = [];
|
|
4184
4209
|
const tryEnqueue = () => {
|
|
4185
4210
|
while (!done && queue.length < depth && issued < MAX_PAGES) {
|
|
4186
|
-
const
|
|
4187
|
-
|
|
4211
|
+
const limit = issued === 0 && firstPageSize !== void 0 ? firstPageSize : pageSize;
|
|
4212
|
+
const promise = fetchPage(nextOffsetToIssue, limit);
|
|
4213
|
+
promise.catch(() => {
|
|
4188
4214
|
});
|
|
4189
|
-
queue.push(
|
|
4190
|
-
nextOffsetToIssue +=
|
|
4215
|
+
queue.push({ limit, promise });
|
|
4216
|
+
nextOffsetToIssue += limit;
|
|
4191
4217
|
issued++;
|
|
4192
4218
|
}
|
|
4193
4219
|
};
|
|
4194
4220
|
tryEnqueue();
|
|
4195
4221
|
while (queue.length > 0 && !signal?.aborted) {
|
|
4196
|
-
const
|
|
4222
|
+
const { limit, promise } = queue.shift();
|
|
4223
|
+
const page = await promise;
|
|
4197
4224
|
if (signal?.aborted) return;
|
|
4198
|
-
const isShort = page.length <
|
|
4225
|
+
const isShort = page.length < limit;
|
|
4199
4226
|
if (isShort) done = true;
|
|
4200
4227
|
tryEnqueue();
|
|
4201
4228
|
if (page.length > 0) {
|
|
@@ -4243,11 +4270,11 @@ async function updateDocuments(arbi, documents) {
|
|
|
4243
4270
|
"Failed to update documents"
|
|
4244
4271
|
);
|
|
4245
4272
|
}
|
|
4246
|
-
async function uploadUrl(arbi, urls,
|
|
4273
|
+
async function uploadUrl(arbi, urls, shared = false) {
|
|
4247
4274
|
return requireData(
|
|
4248
4275
|
await arbi.fetch.POST("/v1/document/upload-url", {
|
|
4249
4276
|
params: {
|
|
4250
|
-
query: { urls,
|
|
4277
|
+
query: { urls, shared }
|
|
4251
4278
|
}
|
|
4252
4279
|
}),
|
|
4253
4280
|
"Failed to upload from URLs"
|
|
@@ -4260,29 +4287,31 @@ async function getParsedContent(auth, docId, stage) {
|
|
|
4260
4287
|
});
|
|
4261
4288
|
return res.json();
|
|
4262
4289
|
}
|
|
4263
|
-
async function uploadFile(auth,
|
|
4290
|
+
async function uploadFile(auth, fileData, fileName, options) {
|
|
4264
4291
|
const formData = new FormData();
|
|
4265
4292
|
formData.append("files", fileData, fileName);
|
|
4266
|
-
const params = new URLSearchParams(
|
|
4293
|
+
const params = new URLSearchParams();
|
|
4267
4294
|
if (options?.folder) params.set("folder", sanitizeFolderPath(options.folder));
|
|
4268
4295
|
if (options?.configExtId) params.set("config_ext_id", options.configExtId);
|
|
4296
|
+
const qs = params.toString();
|
|
4269
4297
|
const res = await authenticatedFetch({
|
|
4270
4298
|
...auth,
|
|
4271
|
-
path: `/v1/document/upload?${
|
|
4299
|
+
path: qs ? `/v1/document/upload?${qs}` : `/v1/document/upload`,
|
|
4272
4300
|
method: "POST",
|
|
4273
4301
|
body: formData
|
|
4274
4302
|
});
|
|
4275
4303
|
return res.json();
|
|
4276
4304
|
}
|
|
4277
|
-
async function uploadFiles(auth,
|
|
4305
|
+
async function uploadFiles(auth, files, options) {
|
|
4278
4306
|
const formData = new FormData();
|
|
4279
4307
|
for (const f2 of files) formData.append("files", f2.data, f2.name);
|
|
4280
|
-
const params = new URLSearchParams(
|
|
4308
|
+
const params = new URLSearchParams();
|
|
4281
4309
|
if (options?.folder) params.set("folder", sanitizeFolderPath(options.folder));
|
|
4282
4310
|
if (options?.configExtId) params.set("config_ext_id", options.configExtId);
|
|
4311
|
+
const qs = params.toString();
|
|
4283
4312
|
const res = await authenticatedFetch({
|
|
4284
4313
|
...auth,
|
|
4285
|
-
path: `/v1/document/upload?${
|
|
4314
|
+
path: qs ? `/v1/document/upload?${qs}` : `/v1/document/upload`,
|
|
4286
4315
|
method: "POST",
|
|
4287
4316
|
body: formData
|
|
4288
4317
|
});
|
|
@@ -4294,6 +4323,68 @@ async function downloadDocument(auth, docId) {
|
|
|
4294
4323
|
path: `/v1/document/${docId}/download`
|
|
4295
4324
|
});
|
|
4296
4325
|
}
|
|
4326
|
+
function mimeFromName(name) {
|
|
4327
|
+
const dot = name.lastIndexOf(".");
|
|
4328
|
+
const ext = dot === -1 ? "" : name.slice(dot).toLowerCase();
|
|
4329
|
+
switch (ext) {
|
|
4330
|
+
case ".pdf":
|
|
4331
|
+
return "application/pdf";
|
|
4332
|
+
case ".txt":
|
|
4333
|
+
return "text/plain";
|
|
4334
|
+
case ".md":
|
|
4335
|
+
return "text/markdown";
|
|
4336
|
+
case ".html":
|
|
4337
|
+
case ".htm":
|
|
4338
|
+
return "text/html";
|
|
4339
|
+
case ".doc":
|
|
4340
|
+
return "application/msword";
|
|
4341
|
+
case ".docx":
|
|
4342
|
+
return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
4343
|
+
case ".xls":
|
|
4344
|
+
return "application/vnd.ms-excel";
|
|
4345
|
+
case ".xlsx":
|
|
4346
|
+
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
4347
|
+
case ".ppt":
|
|
4348
|
+
return "application/vnd.ms-powerpoint";
|
|
4349
|
+
case ".pptx":
|
|
4350
|
+
return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
4351
|
+
case ".eml":
|
|
4352
|
+
return "message/rfc822";
|
|
4353
|
+
default:
|
|
4354
|
+
return void 0;
|
|
4355
|
+
}
|
|
4356
|
+
}
|
|
4357
|
+
async function presignedPut(url, body, onProgress) {
|
|
4358
|
+
const XhrGlobal = globalThis.XMLHttpRequest;
|
|
4359
|
+
if (XhrGlobal) {
|
|
4360
|
+
await new Promise((resolve, reject) => {
|
|
4361
|
+
const xhr = new XhrGlobal();
|
|
4362
|
+
xhr.open("PUT", url);
|
|
4363
|
+
if (onProgress) {
|
|
4364
|
+
xhr.upload.addEventListener("progress", (e) => {
|
|
4365
|
+
if (e.lengthComputable) onProgress(e.loaded, e.total);
|
|
4366
|
+
});
|
|
4367
|
+
}
|
|
4368
|
+
xhr.addEventListener("load", () => {
|
|
4369
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
4370
|
+
resolve();
|
|
4371
|
+
} else {
|
|
4372
|
+
const snippet = (xhr.responseText || "").slice(0, 200);
|
|
4373
|
+
reject(new Error(`Presigned PUT failed: ${xhr.status} ${snippet}`));
|
|
4374
|
+
}
|
|
4375
|
+
});
|
|
4376
|
+
xhr.addEventListener("error", () => reject(new Error("Presigned PUT network error")));
|
|
4377
|
+
xhr.addEventListener("abort", () => reject(new Error("Presigned PUT aborted")));
|
|
4378
|
+
xhr.send(body);
|
|
4379
|
+
});
|
|
4380
|
+
return;
|
|
4381
|
+
}
|
|
4382
|
+
const putRes = await fetch(url, { method: "PUT", body });
|
|
4383
|
+
if (!putRes.ok) {
|
|
4384
|
+
const snippet = await putRes.text().catch(() => "");
|
|
4385
|
+
throw new Error(`Presigned PUT failed: ${putRes.status} ${snippet.slice(0, 200)}`);
|
|
4386
|
+
}
|
|
4387
|
+
}
|
|
4297
4388
|
async function uploadDocumentsDirect(arbi, workspaceKey, files, options) {
|
|
4298
4389
|
if (files.length === 0) return { doc_ext_ids: [], skipped: [] };
|
|
4299
4390
|
const SECRETBOX_ENVELOPE_OVERHEAD = 40;
|
|
@@ -4326,6 +4417,11 @@ async function uploadDocumentsDirect(arbi, workspaceKey, files, options) {
|
|
|
4326
4417
|
}
|
|
4327
4418
|
const skipped = [];
|
|
4328
4419
|
const toCommit = [];
|
|
4420
|
+
const indexByName = /* @__PURE__ */ new Map();
|
|
4421
|
+
files.forEach((f2, i2) => {
|
|
4422
|
+
if (!indexByName.has(f2.name)) indexByName.set(f2.name, []);
|
|
4423
|
+
indexByName.get(f2.name).push(i2);
|
|
4424
|
+
});
|
|
4329
4425
|
for (const item of items) {
|
|
4330
4426
|
if (item.status !== "uploading" || !item.upload_url || !item.doc_ext_id) {
|
|
4331
4427
|
skipped.push({
|
|
@@ -4335,21 +4431,34 @@ async function uploadDocumentsDirect(arbi, workspaceKey, files, options) {
|
|
|
4335
4431
|
continue;
|
|
4336
4432
|
}
|
|
4337
4433
|
const queue = bytesByName.get(item.file_name);
|
|
4338
|
-
|
|
4434
|
+
const idxQueue = indexByName.get(item.file_name);
|
|
4435
|
+
if (!queue || queue.length === 0 || !idxQueue || idxQueue.length === 0) {
|
|
4339
4436
|
throw new Error(`upload-init returned slot for unknown file: ${item.file_name}`);
|
|
4340
4437
|
}
|
|
4341
4438
|
const raw = queue.shift();
|
|
4439
|
+
const fileIndex = idxQueue.shift();
|
|
4342
4440
|
const ciphertext = encryptFile(raw, workspaceKey);
|
|
4343
|
-
const
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4441
|
+
const total = ciphertext.length;
|
|
4442
|
+
try {
|
|
4443
|
+
await presignedPut(item.upload_url, ciphertext, (loaded, putTotal) => {
|
|
4444
|
+
options?.onBytesProgress?.({
|
|
4445
|
+
fileIndex,
|
|
4446
|
+
fileName: item.file_name,
|
|
4447
|
+
loaded,
|
|
4448
|
+
total: putTotal
|
|
4449
|
+
});
|
|
4450
|
+
});
|
|
4451
|
+
} catch (err) {
|
|
4349
4452
|
throw new Error(
|
|
4350
|
-
`Presigned PUT for ${item.doc_ext_id} failed: ${
|
|
4453
|
+
`Presigned PUT for ${item.doc_ext_id} failed: ${err instanceof Error ? err.message : String(err)}`
|
|
4351
4454
|
);
|
|
4352
4455
|
}
|
|
4456
|
+
options?.onBytesProgress?.({
|
|
4457
|
+
fileIndex,
|
|
4458
|
+
fileName: item.file_name,
|
|
4459
|
+
loaded: total,
|
|
4460
|
+
total
|
|
4461
|
+
});
|
|
4353
4462
|
toCommit.push(item.doc_ext_id);
|
|
4354
4463
|
}
|
|
4355
4464
|
if (toCommit.length === 0) {
|
|
@@ -5190,19 +5299,19 @@ var Arbi = class {
|
|
|
5190
5299
|
get: (externalIds) => getDocuments(this.requireClient(), externalIds),
|
|
5191
5300
|
delete: (externalIds) => deleteDocuments(this.requireClient(), externalIds),
|
|
5192
5301
|
update: (documents) => updateDocuments(this.requireClient(), documents),
|
|
5193
|
-
uploadUrl: (urls, shared
|
|
5194
|
-
this.
|
|
5195
|
-
urls,
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5302
|
+
uploadUrl: (urls, shared) => {
|
|
5303
|
+
this.requireWorkspace();
|
|
5304
|
+
return uploadUrl(this.requireClient(), urls, shared);
|
|
5305
|
+
},
|
|
5306
|
+
uploadFile: (fileData, fileName, options) => {
|
|
5307
|
+
this.requireWorkspace();
|
|
5308
|
+
return uploadFile(
|
|
5309
|
+
this.getAuthHeaders(),
|
|
5310
|
+
fileData,
|
|
5311
|
+
fileName,
|
|
5312
|
+
options?.folder ? { folder: options.folder } : void 0
|
|
5313
|
+
);
|
|
5314
|
+
},
|
|
5206
5315
|
download: (docId) => downloadDocument(this.getAuthHeaders(), docId),
|
|
5207
5316
|
getParsedContent: (docId, stage) => getParsedContent(this.getAuthHeaders(), docId, stage)
|
|
5208
5317
|
};
|
|
@@ -5415,6 +5524,6 @@ function extractResponseText(response) {
|
|
|
5415
5524
|
return parts.join("");
|
|
5416
5525
|
}
|
|
5417
5526
|
|
|
5418
|
-
export { Arbi, ArbiApiError, ArbiError, agentconfig_exports as agentconfig, assistant_exports as assistant, authenticatedFetch, 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, files_exports as files, formatAgentStepLabel, formatFileSize, formatUserName, formatWorkspaceChoices, getErrorMessage, health_exports as health, parseSSEEvents, performPasswordLogin, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, settings_exports as settings, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, workspaces_exports as workspaces };
|
|
5527
|
+
export { Arbi, ArbiApiError, ArbiError, agentconfig_exports as agentconfig, assistant_exports as assistant, authenticatedFetch, 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, files_exports as files, formatAgentStepLabel, formatFileSize, formatUserName, formatWorkspaceChoices, getErrorMessage, getRawWorkspaceKey, health_exports as health, parseSSEEvents, performPasswordLogin, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, settings_exports as settings, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, workspaces_exports as workspaces };
|
|
5419
5528
|
//# sourceMappingURL=browser.js.map
|
|
5420
5529
|
//# sourceMappingURL=browser.js.map
|