@arbidocs/sdk 0.3.79 → 0.3.80
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-DIO4_N2g.d.cts} +17 -4
- package/dist/{browser-a0r4Y6dE.d.ts → browser-DIO4_N2g.d.ts} +17 -4
- package/dist/browser.cjs +45 -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 +45 -5
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +45 -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 +45 -5
- 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,
|
|
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-DIO4_N2g.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,
|
|
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-DIO4_N2g.js';
|
|
2
2
|
import '@arbidocs/client';
|
package/dist/browser.js
CHANGED
|
@@ -3784,26 +3784,66 @@ async function resolveWorkspace(store, workspaceOpt) {
|
|
|
3784
3784
|
|
|
3785
3785
|
// src/sse.ts
|
|
3786
3786
|
var LIFECYCLE_LABELS_FALLBACK = {
|
|
3787
|
+
goal: "Thinking\u2026",
|
|
3787
3788
|
evaluation: "Evaluating results",
|
|
3788
3789
|
answering: "Answered",
|
|
3789
3790
|
reviewing: "Reviewing answer",
|
|
3790
3791
|
planning: "Planning",
|
|
3791
3792
|
tool_progress: "Working"
|
|
3792
3793
|
};
|
|
3793
|
-
function
|
|
3794
|
-
if (
|
|
3795
|
-
|
|
3794
|
+
function resolveDocRefs(text, docNames) {
|
|
3795
|
+
if (!docNames) return text;
|
|
3796
|
+
return text.replace(/\{(doc-[^}]+)\}/g, (_match, id) => docNames[id] ?? id);
|
|
3797
|
+
}
|
|
3798
|
+
function resolveStepDocName(step, docNames) {
|
|
3799
|
+
if (!docNames) return void 0;
|
|
3800
|
+
const detail = step.detail;
|
|
3801
|
+
if (!detail || detail.length === 0) return void 0;
|
|
3802
|
+
for (const d2 of detail) {
|
|
3803
|
+
const id = d2.doc_ext_id ?? d2.document_ext_id;
|
|
3804
|
+
if (typeof id === "string") return docNames[id] ?? id;
|
|
3805
|
+
}
|
|
3806
|
+
return void 0;
|
|
3807
|
+
}
|
|
3808
|
+
function extractPageRange(step) {
|
|
3809
|
+
const detail = step.detail;
|
|
3810
|
+
if (!detail || detail.length === 0) return void 0;
|
|
3811
|
+
for (const d2 of detail) {
|
|
3812
|
+
const summary = typeof d2.summary === "string" ? d2.summary : void 0;
|
|
3813
|
+
if (!summary) continue;
|
|
3814
|
+
const match = summary.match(/\bpp?\.\s*(\d[\d.,\s–—-]*)/);
|
|
3815
|
+
if (!match) continue;
|
|
3816
|
+
const floored = match[1].replace(/\d+(?:\.\d+)?/g, (n2) => String(Math.floor(parseFloat(n2)))).replace(/(\d+)\s*[–—-]\s*\1(?!\d)/g, "$1");
|
|
3817
|
+
const items = [];
|
|
3818
|
+
for (const raw of floored.split(",")) {
|
|
3819
|
+
const item = raw.trim();
|
|
3820
|
+
if (item && !items.includes(item)) items.push(item);
|
|
3821
|
+
}
|
|
3822
|
+
if (items.length > 0) return `pp. ${items.join(", ")}`;
|
|
3823
|
+
}
|
|
3824
|
+
return void 0;
|
|
3825
|
+
}
|
|
3826
|
+
function formatAgentStepLabel(step, docNames) {
|
|
3827
|
+
if (step.step === "goal") {
|
|
3828
|
+
return step.label && step.label !== "Goal" ? step.label : "Thinking\u2026";
|
|
3829
|
+
}
|
|
3830
|
+
if (step.focus) return resolveDocRefs(step.focus, docNames);
|
|
3831
|
+
const docName = resolveStepDocName(step, docNames);
|
|
3832
|
+
const pages = docName ? extractPageRange(step) : void 0;
|
|
3833
|
+
const suffix = docName ? ` \u2014 ${docName}${pages ? ` \xB7 ${pages}` : ""}` : "";
|
|
3834
|
+
if (step.label) return `${step.label}${suffix}`;
|
|
3796
3835
|
const detail = step.detail;
|
|
3797
3836
|
if (step.step === "tool_progress" && detail && detail.length > 0) {
|
|
3798
3837
|
const label = detail[0].label || LIFECYCLE_LABELS_FALLBACK.tool_progress;
|
|
3838
|
+
if (suffix) return `${label}${suffix}`;
|
|
3799
3839
|
const message = detail[0].message;
|
|
3800
|
-
return message ? `${label}: ${message}` : label;
|
|
3840
|
+
return message ? `${label}: ${resolveDocRefs(message, docNames)}` : label;
|
|
3801
3841
|
}
|
|
3802
3842
|
if (step.step) {
|
|
3803
3843
|
return LIFECYCLE_LABELS_FALLBACK[step.step] || step.step;
|
|
3804
3844
|
}
|
|
3805
3845
|
if (detail && detail.length > 0) {
|
|
3806
|
-
if (detail[0].label) return detail[0].label
|
|
3846
|
+
if (detail[0].label) return `${detail[0].label}${suffix}`;
|
|
3807
3847
|
if (detail[0].tool) return detail[0].tool;
|
|
3808
3848
|
}
|
|
3809
3849
|
return "";
|