@arbidocs/sdk 0.3.132 → 0.3.134

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.
@@ -1,2 +1,2 @@
1
- export { A as AgentControlStateEvent, a as AgentStepDeltaEvent, b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, f as ArbiErrorEvent, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, j as AuthHeaders, k as AuthenticatedClient, C as ChatSession, l as CitationSummary, m as CliConfig, n as CliCredentials, o as CommandDescriptor, p as ConfigStore, q as ConnectOptions, r as CreateMemoryRequest, s as CreateTaskRequest, t as DeferredInterjectionEvent, M as MemoryResponse, E as MemorySearchRequest, G as MemorySearchResponse, I as MessageMetadataPayload, J as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, K as ProbeAnswerEvent, N as ProjectInvoicesResponse, Q as ProjectUsageResponse, R as QueryOptions, S as ReconnectOptions, T as ReconnectableWsConnection, U as ResolvedCitation, W as ResponseCompletedEvent, X as ResponseContentPartAddedEvent, Y as ResponseCreatedEvent, Z as ResponseFailedEvent, _ as ResponseOutputItemAddedEvent, $ as ResponseOutputItemDoneEvent, a0 as ResponseOutputTextDeltaEvent, a1 as ResponseOutputTextDoneEvent, a2 as ResponseUsage, a3 as SSEEvent, a4 as SSEStreamCallbacks, a5 as SSEStreamResult, a6 as SSEStreamStartData, a8 as SkillSummary, aa as TaskResponse, ab as UpdateMemoryRequest, ac as UpdateTaskRequest, ai as UserDailyUsageResponse, aj as UserInfo, ak as UserInputRequestEvent, al as UserMessageEvent, am as WebSocketAuthError, an as WorkspaceChronologyOut, ao as WorkspaceContext, ap as WsConnection, aq as agentconfig, ar as assistant, as as authenticatedFetch, au as buildRetrievalChunkTool, av as buildRetrievalFullContextTool, aw as buildRetrievalTocTool, ax as connectWebSocket, ay as connectWithReconnect, az as consumeSSEStream, aA as contacts, aB as conversations, aC as countCitations, aD as createAuthenticatedClient, aF as dm, aG as doctags, aH as documents, aI as files, aJ as filterSkills, aK as formatAgentStepLabel, aL as formatFileSize, aN as formatUserName, aO as formatWorkspaceChoices, aT as getErrorMessage, aU as getRawWorkspaceKey, aV as health, aW as memory, aX as parseSSEEvents, aY as parseSlashCommand, aZ as parseSlashTokenInProgress, a_ as performPasswordLogin, b1 as projects, b2 as requireData, b3 as requireOk, b4 as resolveAuth, b5 as resolveCitations, b6 as resolveWorkspace, b7 as responses, b8 as selectWorkspace, b9 as selectWorkspaceById, ba as settings, bb as streamSSE, bc as stripCitationMarkdown, bd as summarizeCitations, be as tags, bf as tasks, bg as workspaces } from './browser-B1XvwSa9.cjs';
1
+ export { A as AgentControlStateEvent, a as AgentStepDeltaEvent, b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, f as ArbiErrorEvent, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, j as AuthHeaders, k as AuthenticatedClient, C as ChatSession, l as CitationSummary, m as CliConfig, n as CliCredentials, o as CommandDescriptor, p as ConfigStore, q as ConnectOptions, r as CreateMemoryRequest, s as CreateTaskRequest, t as DeferredInterjectionEvent, M as MemoryResponse, E as MemorySearchRequest, G as MemorySearchResponse, I as MessageMetadataPayload, J as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, K as ProbeAnswerEvent, N as ProjectInvoicesResponse, Q as ProjectUsageResponse, R as QueryOptions, S as ReconnectOptions, T as ReconnectableWsConnection, U as ResolvedCitation, W as ResponseCompletedEvent, X as ResponseContentPartAddedEvent, Y as ResponseCreatedEvent, Z as ResponseFailedEvent, _ as ResponseOutputItemAddedEvent, $ as ResponseOutputItemDoneEvent, a0 as ResponseOutputTextDeltaEvent, a1 as ResponseOutputTextDoneEvent, a2 as ResponseUsage, a3 as SSEEvent, a4 as SSEStreamCallbacks, a5 as SSEStreamResult, a6 as SSEStreamStartData, a8 as SkillSummary, aa as TaskResponse, ab as UpdateMemoryRequest, ac as UpdateTaskRequest, ai as UserDailyUsageResponse, aj as UserInfo, ak as UserInputRequestEvent, al as UserMessageEvent, am as WebSocketAuthError, an as WorkspaceChronologyOut, ao as WorkspaceContext, ap as WsConnection, aq as agentconfig, ar as assistant, as as authenticatedFetch, au as buildRetrievalChunkTool, av as buildRetrievalFullContextTool, aw as buildRetrievalTocTool, ax as connectWebSocket, ay as connectWithReconnect, az as consumeSSEStream, aA as contacts, aB as conversations, aC as countCitations, aD as createAuthenticatedClient, aF as dm, aG as doctags, aH as documents, aI as files, aJ as filterSkills, aK as formatAgentStepLabel, aL as formatFileSize, aN as formatUserName, aO as formatWorkspaceChoices, aT as getErrorMessage, aU as getRawWorkspaceKey, aV as health, aW as memory, aX as parseSSEEvents, aY as parseSlashCommand, aZ as parseSlashTokenInProgress, a_ as performPasswordLogin, b1 as projects, b2 as requireData, b3 as requireOk, b4 as resolveAuth, b5 as resolveCitations, b6 as resolveWorkspace, b7 as responses, b8 as selectWorkspace, b9 as selectWorkspaceById, ba as settings, bb as streamSSE, bc as stripCitationMarkdown, bd as summarizeCitations, be as tags, bf as tasks, bg as workspaces } from './browser-BSWvYcjS.cjs';
2
2
  import '@arbidocs/client';
package/dist/browser.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { A as AgentControlStateEvent, a as AgentStepDeltaEvent, b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, f as ArbiErrorEvent, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, j as AuthHeaders, k as AuthenticatedClient, C as ChatSession, l as CitationSummary, m as CliConfig, n as CliCredentials, o as CommandDescriptor, p as ConfigStore, q as ConnectOptions, r as CreateMemoryRequest, s as CreateTaskRequest, t as DeferredInterjectionEvent, M as MemoryResponse, E as MemorySearchRequest, G as MemorySearchResponse, I as MessageMetadataPayload, J as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, K as ProbeAnswerEvent, N as ProjectInvoicesResponse, Q as ProjectUsageResponse, R as QueryOptions, S as ReconnectOptions, T as ReconnectableWsConnection, U as ResolvedCitation, W as ResponseCompletedEvent, X as ResponseContentPartAddedEvent, Y as ResponseCreatedEvent, Z as ResponseFailedEvent, _ as ResponseOutputItemAddedEvent, $ as ResponseOutputItemDoneEvent, a0 as ResponseOutputTextDeltaEvent, a1 as ResponseOutputTextDoneEvent, a2 as ResponseUsage, a3 as SSEEvent, a4 as SSEStreamCallbacks, a5 as SSEStreamResult, a6 as SSEStreamStartData, a8 as SkillSummary, aa as TaskResponse, ab as UpdateMemoryRequest, ac as UpdateTaskRequest, ai as UserDailyUsageResponse, aj as UserInfo, ak as UserInputRequestEvent, al as UserMessageEvent, am as WebSocketAuthError, an as WorkspaceChronologyOut, ao as WorkspaceContext, ap as WsConnection, aq as agentconfig, ar as assistant, as as authenticatedFetch, au as buildRetrievalChunkTool, av as buildRetrievalFullContextTool, aw as buildRetrievalTocTool, ax as connectWebSocket, ay as connectWithReconnect, az as consumeSSEStream, aA as contacts, aB as conversations, aC as countCitations, aD as createAuthenticatedClient, aF as dm, aG as doctags, aH as documents, aI as files, aJ as filterSkills, aK as formatAgentStepLabel, aL as formatFileSize, aN as formatUserName, aO as formatWorkspaceChoices, aT as getErrorMessage, aU as getRawWorkspaceKey, aV as health, aW as memory, aX as parseSSEEvents, aY as parseSlashCommand, aZ as parseSlashTokenInProgress, a_ as performPasswordLogin, b1 as projects, b2 as requireData, b3 as requireOk, b4 as resolveAuth, b5 as resolveCitations, b6 as resolveWorkspace, b7 as responses, b8 as selectWorkspace, b9 as selectWorkspaceById, ba as settings, bb as streamSSE, bc as stripCitationMarkdown, bd as summarizeCitations, be as tags, bf as tasks, bg as workspaces } from './browser-B1XvwSa9.js';
1
+ export { A as AgentControlStateEvent, a as AgentStepDeltaEvent, b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, f as ArbiErrorEvent, g as ArbiOptions, h as ArtifactEvent, i as AuthContext, j as AuthHeaders, k as AuthenticatedClient, C as ChatSession, l as CitationSummary, m as CliConfig, n as CliCredentials, o as CommandDescriptor, p as ConfigStore, q as ConnectOptions, r as CreateMemoryRequest, s as CreateTaskRequest, t as DeferredInterjectionEvent, M as MemoryResponse, E as MemorySearchRequest, G as MemorySearchResponse, I as MessageMetadataPayload, J as MessageQueuedEvent, O as OutputTokensDetails, P as ParsedSlashCommand, K as ProbeAnswerEvent, N as ProjectInvoicesResponse, Q as ProjectUsageResponse, R as QueryOptions, S as ReconnectOptions, T as ReconnectableWsConnection, U as ResolvedCitation, W as ResponseCompletedEvent, X as ResponseContentPartAddedEvent, Y as ResponseCreatedEvent, Z as ResponseFailedEvent, _ as ResponseOutputItemAddedEvent, $ as ResponseOutputItemDoneEvent, a0 as ResponseOutputTextDeltaEvent, a1 as ResponseOutputTextDoneEvent, a2 as ResponseUsage, a3 as SSEEvent, a4 as SSEStreamCallbacks, a5 as SSEStreamResult, a6 as SSEStreamStartData, a8 as SkillSummary, aa as TaskResponse, ab as UpdateMemoryRequest, ac as UpdateTaskRequest, ai as UserDailyUsageResponse, aj as UserInfo, ak as UserInputRequestEvent, al as UserMessageEvent, am as WebSocketAuthError, an as WorkspaceChronologyOut, ao as WorkspaceContext, ap as WsConnection, aq as agentconfig, ar as assistant, as as authenticatedFetch, au as buildRetrievalChunkTool, av as buildRetrievalFullContextTool, aw as buildRetrievalTocTool, ax as connectWebSocket, ay as connectWithReconnect, az as consumeSSEStream, aA as contacts, aB as conversations, aC as countCitations, aD as createAuthenticatedClient, aF as dm, aG as doctags, aH as documents, aI as files, aJ as filterSkills, aK as formatAgentStepLabel, aL as formatFileSize, aN as formatUserName, aO as formatWorkspaceChoices, aT as getErrorMessage, aU as getRawWorkspaceKey, aV as health, aW as memory, aX as parseSSEEvents, aY as parseSlashCommand, aZ as parseSlashTokenInProgress, a_ as performPasswordLogin, b1 as projects, b2 as requireData, b3 as requireOk, b4 as resolveAuth, b5 as resolveCitations, b6 as resolveWorkspace, b7 as responses, b8 as selectWorkspace, b9 as selectWorkspaceById, ba as settings, bb as streamSSE, bc as stripCitationMarkdown, bd as summarizeCitations, be as tags, bf as tasks, bg as workspaces } from './browser-BSWvYcjS.js';
2
2
  import '@arbidocs/client';
package/dist/browser.js CHANGED
@@ -3783,14 +3783,10 @@ async function resolveWorkspace(store, workspaceOpt) {
3783
3783
  }
3784
3784
 
3785
3785
  // src/sse.ts
3786
- var LIFECYCLE_LABELS_FALLBACK = {
3787
- goal: "Thinking\u2026",
3788
- evaluation: "Evaluating results",
3789
- answering: "Answered",
3790
- interjection: "Your message",
3791
- planning: "Planning",
3792
- tool_progress: "Working"
3793
- };
3786
+ function humanizeStep(identifier) {
3787
+ const spaced = identifier.replace(/[_-]+/g, " ").trim();
3788
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1);
3789
+ }
3794
3790
  function resolveDocRefs(text, docNames) {
3795
3791
  if (!docNames) return text;
3796
3792
  return text.replace(/\{(doc-[^}]+)\}/g, (_match, id) => docNames[id] ?? id);
@@ -3834,13 +3830,13 @@ function formatAgentStepLabel(step, docNames) {
3834
3830
  if (step.label) return `${step.label}${suffix}`;
3835
3831
  const detail = step.detail;
3836
3832
  if (step.step === "tool_progress" && detail && detail.length > 0) {
3837
- const label = detail[0].label || LIFECYCLE_LABELS_FALLBACK.tool_progress;
3833
+ const label = detail[0].label || detail[0].tool && humanizeStep(detail[0].tool) || humanizeStep(step.step);
3838
3834
  if (suffix) return `${label}${suffix}`;
3839
3835
  const message = detail[0].message;
3840
3836
  return message ? `${label}: ${resolveDocRefs(message, docNames)}` : label;
3841
3837
  }
3842
3838
  if (step.step) {
3843
- return LIFECYCLE_LABELS_FALLBACK[step.step] || step.step;
3839
+ return humanizeStep(step.step);
3844
3840
  }
3845
3841
  if (detail && detail.length > 0) {
3846
3842
  if (detail[0].label) return `${detail[0].label}${suffix}`;
@@ -3963,6 +3959,11 @@ async function streamSSE(response, callbacks = {}) {
3963
3959
  callbacks.onAgentStep?.(data);
3964
3960
  if (data.t != null) callbacks.onElapsedTime?.(data.t);
3965
3961
  },
3962
+ "arbi.generating": (raw) => {
3963
+ const data = JSON.parse(raw);
3964
+ callbacks.onGenerating?.(data);
3965
+ if (data.t != null) callbacks.onElapsedTime?.(data.t);
3966
+ },
3966
3967
  "arbi.agent_step_delta": (raw) => {
3967
3968
  const data = JSON.parse(raw);
3968
3969
  callbacks.onAgentStepDelta?.(data);