@arbidocs/sdk 0.3.79 → 0.3.81
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-a0r4Y6dE.d.cts → browser-CV7TVakj.d.cts} +33 -8
- package/dist/{browser-a0r4Y6dE.d.ts → browser-CV7TVakj.d.ts} +33 -8
- package/dist/browser.cjs +57 -6
- 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 +57 -6
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +57 -6
- 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 +57 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession,
|
|
2
|
-
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, q as
|
|
1
|
+
import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, Z as SkippedFile, a2 as UploadResult, i as AuthHeaders, _ as UploadBatchResult, a1 as UploadOptions, $ as UploadDirectOptions, a0 as UploadDirectResult, X as SUPPORTED_EXTENSIONS, p as DmCryptoContext } from './browser-CV7TVakj.cjs';
|
|
2
|
+
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, q as DocNameMap, r as DocumentListFields, s as DocumentListOrder, t as DocumentWaiter, u as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, v as ListPaginatedOptions, M as MessageLevel, 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, am as createDocumentWaiter, an as dm, ao as doctags, ap as documents, aq as files, ar as filterSkills, as as formatAgentStepLabel, at as formatFileSize, au as formatStreamSummary, av as formatUserName, aw as formatWorkspaceChoices, ax as formatWsMessage, ay as generateEncryptedWorkspaceKey, az as generateNewWorkspaceKey, aA as getErrorCode, aB as getErrorMessage, aC as getRawWorkspaceKey, aD as health, aE as parseSSEEvents, aF as parseSlashCommand, aG as parseSlashTokenInProgress, aH as performPasswordLogin, aI as performSigningKeyLogin, aJ as performSsoDeviceFlowLogin, 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-CV7TVakj.cjs';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession,
|
|
2
|
-
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, q as
|
|
1
|
+
import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, Z as SkippedFile, a2 as UploadResult, i as AuthHeaders, _ as UploadBatchResult, a1 as UploadOptions, $ as UploadDirectOptions, a0 as UploadDirectResult, X as SUPPORTED_EXTENSIONS, p as DmCryptoContext } from './browser-CV7TVakj.js';
|
|
2
|
+
export { a as AgentStepEvent, b as Arbi, c as ArbiApiError, d as ArbiError, f as ArbiOptions, g as ArtifactEvent, h as AuthContext, j as AuthenticatedClient, k as CitationSummary, o as ConnectOptions, D as DOC_TERMINAL_STATUSES, q as DocNameMap, r as DocumentListFields, s as DocumentListOrder, t as DocumentWaiter, u as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, v as ListPaginatedOptions, M as MessageLevel, 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, am as createDocumentWaiter, an as dm, ao as doctags, ap as documents, aq as files, ar as filterSkills, as as formatAgentStepLabel, at as formatFileSize, au as formatStreamSummary, av as formatUserName, aw as formatWorkspaceChoices, ax as formatWsMessage, ay as generateEncryptedWorkspaceKey, az as generateNewWorkspaceKey, aA as getErrorCode, aB as getErrorMessage, aC as getRawWorkspaceKey, aD as health, aE as parseSSEEvents, aF as parseSlashCommand, aG as parseSlashTokenInProgress, aH as performPasswordLogin, aI as performSigningKeyLogin, aJ as performSsoDeviceFlowLogin, 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-CV7TVakj.js';
|
|
3
3
|
import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4179,26 +4179,65 @@ async function resolveWorkspace(store, workspaceOpt) {
|
|
|
4179
4179
|
|
|
4180
4180
|
// src/sse.ts
|
|
4181
4181
|
var LIFECYCLE_LABELS_FALLBACK = {
|
|
4182
|
+
goal: "Thinking\u2026",
|
|
4182
4183
|
evaluation: "Evaluating results",
|
|
4183
4184
|
answering: "Answered",
|
|
4184
|
-
reviewing: "Reviewing answer",
|
|
4185
4185
|
planning: "Planning",
|
|
4186
4186
|
tool_progress: "Working"
|
|
4187
4187
|
};
|
|
4188
|
-
function
|
|
4189
|
-
if (
|
|
4190
|
-
|
|
4188
|
+
function resolveDocRefs(text, docNames) {
|
|
4189
|
+
if (!docNames) return text;
|
|
4190
|
+
return text.replace(/\{(doc-[^}]+)\}/g, (_match, id) => docNames[id] ?? id);
|
|
4191
|
+
}
|
|
4192
|
+
function resolveStepDocName(step, docNames) {
|
|
4193
|
+
if (!docNames) return void 0;
|
|
4194
|
+
const detail = step.detail;
|
|
4195
|
+
if (!detail || detail.length === 0) return void 0;
|
|
4196
|
+
for (const d2 of detail) {
|
|
4197
|
+
const id = d2.doc_ext_id ?? d2.document_ext_id;
|
|
4198
|
+
if (typeof id === "string") return docNames[id] ?? id;
|
|
4199
|
+
}
|
|
4200
|
+
return void 0;
|
|
4201
|
+
}
|
|
4202
|
+
function extractPageRange(step) {
|
|
4203
|
+
const detail = step.detail;
|
|
4204
|
+
if (!detail || detail.length === 0) return void 0;
|
|
4205
|
+
for (const d2 of detail) {
|
|
4206
|
+
const summary = typeof d2.summary === "string" ? d2.summary : void 0;
|
|
4207
|
+
if (!summary) continue;
|
|
4208
|
+
const match = summary.match(/\bpp?\.\s*(\d[\d.,\s–—-]*)/);
|
|
4209
|
+
if (!match) continue;
|
|
4210
|
+
const floored = match[1].replace(/\d+(?:\.\d+)?/g, (n2) => String(Math.floor(parseFloat(n2)))).replace(/(\d+)\s*[–—-]\s*\1(?!\d)/g, "$1");
|
|
4211
|
+
const items = [];
|
|
4212
|
+
for (const raw of floored.split(",")) {
|
|
4213
|
+
const item = raw.trim();
|
|
4214
|
+
if (item && !items.includes(item)) items.push(item);
|
|
4215
|
+
}
|
|
4216
|
+
if (items.length > 0) return `pp. ${items.join(", ")}`;
|
|
4217
|
+
}
|
|
4218
|
+
return void 0;
|
|
4219
|
+
}
|
|
4220
|
+
function formatAgentStepLabel(step, docNames) {
|
|
4221
|
+
if (step.step === "goal") {
|
|
4222
|
+
return step.label && step.label !== "Goal" ? step.label : "Thinking\u2026";
|
|
4223
|
+
}
|
|
4224
|
+
if (step.focus) return resolveDocRefs(step.focus, docNames);
|
|
4225
|
+
const docName = resolveStepDocName(step, docNames);
|
|
4226
|
+
const pages = docName ? extractPageRange(step) : void 0;
|
|
4227
|
+
const suffix = docName ? ` \u2014 ${docName}${pages ? ` \xB7 ${pages}` : ""}` : "";
|
|
4228
|
+
if (step.label) return `${step.label}${suffix}`;
|
|
4191
4229
|
const detail = step.detail;
|
|
4192
4230
|
if (step.step === "tool_progress" && detail && detail.length > 0) {
|
|
4193
4231
|
const label = detail[0].label || LIFECYCLE_LABELS_FALLBACK.tool_progress;
|
|
4232
|
+
if (suffix) return `${label}${suffix}`;
|
|
4194
4233
|
const message = detail[0].message;
|
|
4195
|
-
return message ? `${label}: ${message}` : label;
|
|
4234
|
+
return message ? `${label}: ${resolveDocRefs(message, docNames)}` : label;
|
|
4196
4235
|
}
|
|
4197
4236
|
if (step.step) {
|
|
4198
4237
|
return LIFECYCLE_LABELS_FALLBACK[step.step] || step.step;
|
|
4199
4238
|
}
|
|
4200
4239
|
if (detail && detail.length > 0) {
|
|
4201
|
-
if (detail[0].label) return detail[0].label
|
|
4240
|
+
if (detail[0].label) return `${detail[0].label}${suffix}`;
|
|
4202
4241
|
if (detail[0].tool) return detail[0].tool;
|
|
4203
4242
|
}
|
|
4204
4243
|
return "";
|
|
@@ -5191,6 +5230,7 @@ __export(conversations_exports, {
|
|
|
5191
5230
|
deleteMessage: () => deleteMessage,
|
|
5192
5231
|
getConversationThreads: () => getConversationThreads,
|
|
5193
5232
|
getMessage: () => getMessage,
|
|
5233
|
+
importConversations: () => importConversations,
|
|
5194
5234
|
listConversations: () => listConversations,
|
|
5195
5235
|
shareConversation: () => shareConversation,
|
|
5196
5236
|
updateConversationTitle: () => updateConversationTitle
|
|
@@ -5198,6 +5238,17 @@ __export(conversations_exports, {
|
|
|
5198
5238
|
async function listConversations(arbi) {
|
|
5199
5239
|
return requireData(await arbi.fetch.GET("/v1/conversation/list"), "Failed to fetch conversations");
|
|
5200
5240
|
}
|
|
5241
|
+
async function importConversations(auth, fileData, fileName, source = "auto") {
|
|
5242
|
+
const formData = new FormData();
|
|
5243
|
+
formData.append("file", fileData, fileName);
|
|
5244
|
+
const res = await authenticatedFetch({
|
|
5245
|
+
...auth,
|
|
5246
|
+
path: `/v1/conversation/import?source=${encodeURIComponent(source)}`,
|
|
5247
|
+
method: "POST",
|
|
5248
|
+
body: formData
|
|
5249
|
+
});
|
|
5250
|
+
return res.json();
|
|
5251
|
+
}
|
|
5201
5252
|
async function getConversationThreads(arbi, conversationId) {
|
|
5202
5253
|
return requireData(
|
|
5203
5254
|
await arbi.fetch.GET("/v1/conversation/{conversation_ext_id}/threads", {
|