@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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { n as ConfigStore, l as CliConfig, m as CliCredentials, C as ChatSession, Y as SkippedFile, a1 as UploadResult, i as AuthHeaders, Z as UploadBatchResult, a0 as UploadOptions, _ as UploadDirectOptions, $ as UploadDirectResult, W as SUPPORTED_EXTENSIONS, p as DmCryptoContext } from './browser-a0r4Y6dE.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 DocumentListFields, r as DocumentListOrder, s as DocumentWaiter, t as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, u as ListPaginatedOptions, M as MessageLevel, v as MessageMetadataPayload, w as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, x as ReconnectableWsConnection, y as ResolvedCitation, z as ResponseCompletedEvent, B as ResponseContentPartAddedEvent, E as ResponseCreatedEvent, G as ResponseFailedEvent, H as ResponseOutputItemAddedEvent, I as ResponseOutputItemDoneEvent, J as ResponseOutputTextDeltaEvent, K as ResponseOutputTextDoneEvent, N as ResponseUsage, S as SSEEvent, T as SSEStreamCallbacks, U as SSEStreamResult, V as SSEStreamStartData, X as SkillSummary, a2 as UserInfo, a3 as UserInputRequestEvent, a4 as UserMessageEvent, a5 as WebSocketAuthError, a6 as WorkspaceContext, a7 as WsConnection, a8 as agentconfig, a9 as assistant, aa as authenticatedFetch, ab as buildRetrievalChunkTool, ac as buildRetrievalFullContextTool, ad as buildRetrievalTocTool, ae as connectWebSocket, af as connectWithReconnect, ag as consumeSSEStream, ah as contacts, ai as conversations, aj as countCitations, ak as createAuthenticatedClient, al as createDocumentWaiter, am as dm, an as doctags, ao as documents, ap as files, aq as filterSkills, ar as formatAgentStepLabel, as as formatFileSize, at as formatStreamSummary, au as formatUserName, av as formatWorkspaceChoices, aw as formatWsMessage, ax as generateEncryptedWorkspaceKey, ay as generateNewWorkspaceKey, az as getErrorCode, aA as getErrorMessage, aB as getRawWorkspaceKey, aC as health, aD as parseSSEEvents, aE as parseSlashCommand, aF as parseSlashTokenInProgress, aG as performPasswordLogin, aH as performSigningKeyLogin, aI as performSsoDeviceFlowLogin, aJ as requireData, aK as requireOk, aL as resolveAuth, aM as resolveCitations, aN as resolveWorkspace, aO as responses, aP as selectWorkspace, aQ as selectWorkspaceById, aR as settings, aS as streamSSE, aT as stripCitationMarkdown, aU as summarizeCitations, aV as tags, aW as workspaces } from './browser-a0r4Y6dE.cjs';
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-DIO4_N2g.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-DIO4_N2g.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, Y as SkippedFile, a1 as UploadResult, i as AuthHeaders, Z as UploadBatchResult, a0 as UploadOptions, _ as UploadDirectOptions, $ as UploadDirectResult, W as SUPPORTED_EXTENSIONS, p as DmCryptoContext } from './browser-a0r4Y6dE.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 DocumentListFields, r as DocumentListOrder, s as DocumentWaiter, t as DocumentWaiterOptions, F as FormattedWsMessage, L as ListAllOptions, u as ListPaginatedOptions, M as MessageLevel, v as MessageMetadataPayload, w as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, Q as QueryOptions, R as ReconnectOptions, x as ReconnectableWsConnection, y as ResolvedCitation, z as ResponseCompletedEvent, B as ResponseContentPartAddedEvent, E as ResponseCreatedEvent, G as ResponseFailedEvent, H as ResponseOutputItemAddedEvent, I as ResponseOutputItemDoneEvent, J as ResponseOutputTextDeltaEvent, K as ResponseOutputTextDoneEvent, N as ResponseUsage, S as SSEEvent, T as SSEStreamCallbacks, U as SSEStreamResult, V as SSEStreamStartData, X as SkillSummary, a2 as UserInfo, a3 as UserInputRequestEvent, a4 as UserMessageEvent, a5 as WebSocketAuthError, a6 as WorkspaceContext, a7 as WsConnection, a8 as agentconfig, a9 as assistant, aa as authenticatedFetch, ab as buildRetrievalChunkTool, ac as buildRetrievalFullContextTool, ad as buildRetrievalTocTool, ae as connectWebSocket, af as connectWithReconnect, ag as consumeSSEStream, ah as contacts, ai as conversations, aj as countCitations, ak as createAuthenticatedClient, al as createDocumentWaiter, am as dm, an as doctags, ao as documents, ap as files, aq as filterSkills, ar as formatAgentStepLabel, as as formatFileSize, at as formatStreamSummary, au as formatUserName, av as formatWorkspaceChoices, aw as formatWsMessage, ax as generateEncryptedWorkspaceKey, ay as generateNewWorkspaceKey, az as getErrorCode, aA as getErrorMessage, aB as getRawWorkspaceKey, aC as health, aD as parseSSEEvents, aE as parseSlashCommand, aF as parseSlashTokenInProgress, aG as performPasswordLogin, aH as performSigningKeyLogin, aI as performSsoDeviceFlowLogin, aJ as requireData, aK as requireOk, aL as resolveAuth, aM as resolveCitations, aN as resolveWorkspace, aO as responses, aP as selectWorkspace, aQ as selectWorkspaceById, aR as settings, aS as streamSSE, aT as stripCitationMarkdown, aU as summarizeCitations, aV as tags, aW as workspaces } from './browser-a0r4Y6dE.js';
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-DIO4_N2g.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-DIO4_N2g.js';
3
3
  import { SessionStorageProvider, ArbiClient, components } from '@arbidocs/client';
4
4
 
5
5
  /**
package/dist/index.js CHANGED
@@ -4179,26 +4179,66 @@ 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
4185
  reviewing: "Reviewing answer",
4185
4186
  planning: "Planning",
4186
4187
  tool_progress: "Working"
4187
4188
  };
4188
- function formatAgentStepLabel(step) {
4189
- if (step.focus) return step.focus;
4190
- if (step.label) return step.label;
4189
+ function resolveDocRefs(text, docNames) {
4190
+ if (!docNames) return text;
4191
+ return text.replace(/\{(doc-[^}]+)\}/g, (_match, id) => docNames[id] ?? id);
4192
+ }
4193
+ function resolveStepDocName(step, docNames) {
4194
+ if (!docNames) return void 0;
4195
+ const detail = step.detail;
4196
+ if (!detail || detail.length === 0) return void 0;
4197
+ for (const d2 of detail) {
4198
+ const id = d2.doc_ext_id ?? d2.document_ext_id;
4199
+ if (typeof id === "string") return docNames[id] ?? id;
4200
+ }
4201
+ return void 0;
4202
+ }
4203
+ function extractPageRange(step) {
4204
+ const detail = step.detail;
4205
+ if (!detail || detail.length === 0) return void 0;
4206
+ for (const d2 of detail) {
4207
+ const summary = typeof d2.summary === "string" ? d2.summary : void 0;
4208
+ if (!summary) continue;
4209
+ const match = summary.match(/\bpp?\.\s*(\d[\d.,\s–—-]*)/);
4210
+ if (!match) continue;
4211
+ const floored = match[1].replace(/\d+(?:\.\d+)?/g, (n2) => String(Math.floor(parseFloat(n2)))).replace(/(\d+)\s*[–—-]\s*\1(?!\d)/g, "$1");
4212
+ const items = [];
4213
+ for (const raw of floored.split(",")) {
4214
+ const item = raw.trim();
4215
+ if (item && !items.includes(item)) items.push(item);
4216
+ }
4217
+ if (items.length > 0) return `pp. ${items.join(", ")}`;
4218
+ }
4219
+ return void 0;
4220
+ }
4221
+ function formatAgentStepLabel(step, docNames) {
4222
+ if (step.step === "goal") {
4223
+ return step.label && step.label !== "Goal" ? step.label : "Thinking\u2026";
4224
+ }
4225
+ if (step.focus) return resolveDocRefs(step.focus, docNames);
4226
+ const docName = resolveStepDocName(step, docNames);
4227
+ const pages = docName ? extractPageRange(step) : void 0;
4228
+ const suffix = docName ? ` \u2014 ${docName}${pages ? ` \xB7 ${pages}` : ""}` : "";
4229
+ if (step.label) return `${step.label}${suffix}`;
4191
4230
  const detail = step.detail;
4192
4231
  if (step.step === "tool_progress" && detail && detail.length > 0) {
4193
4232
  const label = detail[0].label || LIFECYCLE_LABELS_FALLBACK.tool_progress;
4233
+ if (suffix) return `${label}${suffix}`;
4194
4234
  const message = detail[0].message;
4195
- return message ? `${label}: ${message}` : label;
4235
+ return message ? `${label}: ${resolveDocRefs(message, docNames)}` : label;
4196
4236
  }
4197
4237
  if (step.step) {
4198
4238
  return LIFECYCLE_LABELS_FALLBACK[step.step] || step.step;
4199
4239
  }
4200
4240
  if (detail && detail.length > 0) {
4201
- if (detail[0].label) return detail[0].label;
4241
+ if (detail[0].label) return `${detail[0].label}${suffix}`;
4202
4242
  if (detail[0].tool) return detail[0].tool;
4203
4243
  }
4204
4244
  return "";