@arbidocs/sdk 0.3.78 → 0.3.79

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.
@@ -308,11 +308,13 @@ type ResponseOutputItemAddedEvent = components['schemas']['ResponseOutputItemAdd
308
308
  type ResponseOutputItemDoneEvent = components['schemas']['ResponseOutputItemDoneEvent'];
309
309
  type ResponseContentPartAddedEvent = components['schemas']['ResponseContentPartAddedEvent'];
310
310
  type AgentStepEvent = components['schemas']['AgentStepEvent'];
311
+ type AgentStepDeltaEvent = components['schemas']['AgentStepDeltaEvent'];
311
312
  type UserInputRequestEvent = components['schemas']['UserInputRequestEvent'];
312
313
  type ArtifactEvent = components['schemas']['ArtifactEvent'];
313
314
  type UserMessageEvent = components['schemas']['UserMessageEvent'];
314
315
  type MessageQueuedEvent = components['schemas']['MessageQueuedEvent'];
315
316
  type MessageMetadataPayload$1 = components['schemas']['MessageMetadataPayload'];
317
+ type ArbiErrorEvent = components['schemas']['ArbiErrorEvent'];
316
318
  type ResponseUsage = components['schemas']['ResponseUsage'];
317
319
  type OutputTokensDetails = components['schemas']['OutputTokensDetails'];
318
320
  type TokenBudgetContext = components['schemas']['TokenBudgetContext'];
@@ -360,26 +362,18 @@ declare function parseSSEEvents(chunk: string, buffer: string): {
360
362
  * Callbacks for streaming SSE events. All callbacks are optional —
361
363
  * omitted callbacks simply ignore that event type.
362
364
  */
363
- /** Structured ARBI error event (e.g. quota exceeded mid-stream). */
364
- interface ArbiErrorEvent {
365
- code: string;
366
- message: string;
367
- /** Present for QUOTA_EXCEEDED — current spend in USD. */
368
- spend?: number;
369
- /** Present for QUOTA_EXCEEDED — budget cap in USD. */
370
- budget?: number;
371
- /** Present for QUOTA_EXCEEDED — affected project external id. */
372
- project_ext_id?: string | null;
373
- [key: string]: unknown;
374
- }
375
365
  interface SSEStreamCallbacks {
376
366
  onStreamStart?: (data: SSEStreamStartData) => void;
377
367
  onToken?: (content: string) => void;
368
+ /** Live reasoning/thinking-token deltas (raw channel). Usually surfaced only in message details. */
369
+ onReasoningDelta?: (delta: string) => void;
378
370
  onTextDone?: (text: string) => void;
379
371
  onOutputItemAdded?: (data: ResponseOutputItemAddedEvent) => void;
380
372
  onOutputItemDone?: (data: ResponseOutputItemDoneEvent) => void;
381
373
  onContentPartAdded?: (data: ResponseContentPartAddedEvent) => void;
382
374
  onAgentStep?: (data: AgentStepEvent) => void;
375
+ /** Live narration delta — append `delta` to the focus of the step with the matching `index`. */
376
+ onAgentStepDelta?: (data: AgentStepDeltaEvent) => void;
383
377
  onError?: (message: string) => void;
384
378
  /**
385
379
  * Fired when the server emits a structured `arbi.error` event mid-stream.
@@ -2687,6 +2681,7 @@ declare class Arbi {
2687
2681
  } | undefined;
2688
2682
  MCP_TOOLS: string[];
2689
2683
  PLANNING_ENABLED: boolean;
2684
+ DEEP_RESEARCH_ENABLED: boolean;
2690
2685
  SUGGESTED_QUERIES: boolean;
2691
2686
  ARTIFACTS_ENABLED: boolean;
2692
2687
  VISION_ENABLED: boolean;
@@ -2696,8 +2691,6 @@ declare class Arbi {
2696
2691
  SKILL_CREATION: boolean;
2697
2692
  MEMORY_CREATION: boolean;
2698
2693
  GOALS_ENABLED: boolean;
2699
- GOAL_LOOP: boolean;
2700
- GOAL_TEXT: string;
2701
2694
  GOAL_MAX_OUTER_LOOPS: number;
2702
2695
  REVIEW_ENABLED: boolean;
2703
2696
  PERSONA: string;
@@ -4034,6 +4027,7 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4034
4027
  } | undefined;
4035
4028
  MCP_TOOLS: string[];
4036
4029
  PLANNING_ENABLED: boolean;
4030
+ DEEP_RESEARCH_ENABLED: boolean;
4037
4031
  SUGGESTED_QUERIES: boolean;
4038
4032
  ARTIFACTS_ENABLED: boolean;
4039
4033
  VISION_ENABLED: boolean;
@@ -4043,8 +4037,6 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4043
4037
  SKILL_CREATION: boolean;
4044
4038
  MEMORY_CREATION: boolean;
4045
4039
  GOALS_ENABLED: boolean;
4046
- GOAL_LOOP: boolean;
4047
- GOAL_TEXT: string;
4048
4040
  GOAL_MAX_OUTER_LOOPS: number;
4049
4041
  REVIEW_ENABLED: boolean;
4050
4042
  PERSONA: string;
@@ -4404,4 +4396,4 @@ declare namespace responses {
4404
4396
  export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
4405
4397
  }
4406
4398
 
4407
- export { type UploadOptions as $, type AgentStepEvent as A, type ResponseCreatedEvent as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type ResponseFailedEvent as E, type FormattedWsMessage as F, type ResponseOutputItemAddedEvent as G, type ResponseOutputItemDoneEvent as H, type ResponseOutputTextDeltaEvent as I, type ResponseOutputTextDoneEvent as J, type ResponseUsage as K, type ListAllOptions as L, type MessageLevel as M, type SSEStreamCallbacks as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, type SSEStreamResult as T, type SSEStreamStartData as U, SUPPORTED_EXTENSIONS as V, type SkillSummary as W, type SkippedFile as X, type UploadBatchResult as Y, type UploadDirectOptions as Z, type UploadDirectResult as _, Arbi as a, type UploadResult as a0, type UserInfo as a1, type UserInputRequestEvent as a2, type UserMessageEvent as a3, WebSocketAuthError as a4, type WorkspaceContext as a5, type WsConnection as a6, agentconfig as a7, assistant as a8, authenticatedFetch as a9, getRawWorkspaceKey as aA, health as aB, parseSSEEvents as aC, parseSlashCommand as aD, parseSlashTokenInProgress as aE, performPasswordLogin as aF, performSigningKeyLogin as aG, performSsoDeviceFlowLogin as aH, requireData as aI, requireOk as aJ, resolveAuth as aK, resolveCitations as aL, resolveWorkspace as aM, responses as aN, selectWorkspace as aO, selectWorkspaceById as aP, settings as aQ, streamSSE as aR, stripCitationMarkdown as aS, summarizeCitations as aT, tags as aU, workspaces as aV, buildRetrievalChunkTool as aa, buildRetrievalFullContextTool as ab, buildRetrievalTocTool as ac, connectWebSocket as ad, connectWithReconnect as ae, consumeSSEStream as af, contacts as ag, conversations as ah, countCitations as ai, createAuthenticatedClient as aj, createDocumentWaiter as ak, dm as al, doctags as am, documents as an, files as ao, filterSkills as ap, formatAgentStepLabel as aq, formatFileSize as ar, formatStreamSummary as as, formatUserName as at, formatWorkspaceChoices as au, formatWsMessage as av, generateEncryptedWorkspaceKey as aw, generateNewWorkspaceKey as ax, getErrorCode as ay, getErrorMessage as az, ArbiApiError as b, ArbiError as c, type ArbiErrorEvent as d, type ArbiOptions as e, type ArtifactEvent as f, type AuthContext as g, type AuthHeaders as h, type AuthenticatedClient as i, type CitationSummary as j, type CliConfig as k, type CliCredentials as l, type ConfigStore as m, type ConnectOptions as n, type DmCryptoContext as o, type DocumentListFields as p, type DocumentListOrder as q, type DocumentWaiter as r, type DocumentWaiterOptions as s, type ListPaginatedOptions as t, type MessageMetadataPayload$1 as u, type MessageQueuedEvent as v, type ReconnectableWsConnection as w, type ResolvedCitation as x, type ResponseCompletedEvent as y, type ResponseContentPartAddedEvent as z };
4399
+ export { type UploadDirectResult as $, type AgentStepDeltaEvent as A, type ResponseContentPartAddedEvent as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type ResponseCreatedEvent as E, type FormattedWsMessage as F, type ResponseFailedEvent as G, type ResponseOutputItemAddedEvent as H, type ResponseOutputItemDoneEvent as I, type ResponseOutputTextDeltaEvent as J, type ResponseOutputTextDoneEvent as K, type ListAllOptions as L, type MessageLevel as M, type ResponseUsage as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, type SSEStreamCallbacks as T, type SSEStreamResult as U, type SSEStreamStartData as V, SUPPORTED_EXTENSIONS as W, type SkillSummary as X, type SkippedFile as Y, type UploadBatchResult as Z, type UploadDirectOptions as _, type AgentStepEvent as a, type UploadOptions as a0, type UploadResult as a1, type UserInfo as a2, type UserInputRequestEvent as a3, type UserMessageEvent as a4, WebSocketAuthError as a5, type WorkspaceContext as a6, type WsConnection as a7, agentconfig as a8, assistant as a9, getErrorMessage as aA, getRawWorkspaceKey as aB, health as aC, parseSSEEvents as aD, parseSlashCommand as aE, parseSlashTokenInProgress as aF, performPasswordLogin as aG, performSigningKeyLogin as aH, performSsoDeviceFlowLogin as aI, requireData as aJ, requireOk as aK, resolveAuth as aL, resolveCitations as aM, resolveWorkspace as aN, responses as aO, selectWorkspace as aP, selectWorkspaceById as aQ, settings as aR, streamSSE as aS, stripCitationMarkdown as aT, summarizeCitations as aU, tags as aV, workspaces as aW, authenticatedFetch as aa, buildRetrievalChunkTool as ab, buildRetrievalFullContextTool as ac, buildRetrievalTocTool as ad, connectWebSocket as ae, connectWithReconnect as af, consumeSSEStream as ag, contacts as ah, conversations as ai, countCitations as aj, createAuthenticatedClient as ak, createDocumentWaiter as al, dm as am, doctags as an, documents as ao, files as ap, filterSkills as aq, formatAgentStepLabel as ar, formatFileSize as as, formatStreamSummary as at, formatUserName as au, formatWorkspaceChoices as av, formatWsMessage as aw, generateEncryptedWorkspaceKey as ax, generateNewWorkspaceKey as ay, getErrorCode as az, Arbi as b, ArbiApiError as c, ArbiError as d, type ArbiErrorEvent as e, type ArbiOptions as f, type ArtifactEvent as g, type AuthContext as h, type AuthHeaders as i, type AuthenticatedClient as j, type CitationSummary as k, type CliConfig as l, type CliCredentials as m, type ConfigStore as n, type ConnectOptions as o, type DmCryptoContext as p, type DocumentListFields as q, type DocumentListOrder as r, type DocumentWaiter as s, type DocumentWaiterOptions as t, type ListPaginatedOptions as u, type MessageMetadataPayload$1 as v, type MessageQueuedEvent as w, type ReconnectableWsConnection as x, type ResolvedCitation as y, type ResponseCompletedEvent as z };
@@ -308,11 +308,13 @@ type ResponseOutputItemAddedEvent = components['schemas']['ResponseOutputItemAdd
308
308
  type ResponseOutputItemDoneEvent = components['schemas']['ResponseOutputItemDoneEvent'];
309
309
  type ResponseContentPartAddedEvent = components['schemas']['ResponseContentPartAddedEvent'];
310
310
  type AgentStepEvent = components['schemas']['AgentStepEvent'];
311
+ type AgentStepDeltaEvent = components['schemas']['AgentStepDeltaEvent'];
311
312
  type UserInputRequestEvent = components['schemas']['UserInputRequestEvent'];
312
313
  type ArtifactEvent = components['schemas']['ArtifactEvent'];
313
314
  type UserMessageEvent = components['schemas']['UserMessageEvent'];
314
315
  type MessageQueuedEvent = components['schemas']['MessageQueuedEvent'];
315
316
  type MessageMetadataPayload$1 = components['schemas']['MessageMetadataPayload'];
317
+ type ArbiErrorEvent = components['schemas']['ArbiErrorEvent'];
316
318
  type ResponseUsage = components['schemas']['ResponseUsage'];
317
319
  type OutputTokensDetails = components['schemas']['OutputTokensDetails'];
318
320
  type TokenBudgetContext = components['schemas']['TokenBudgetContext'];
@@ -360,26 +362,18 @@ declare function parseSSEEvents(chunk: string, buffer: string): {
360
362
  * Callbacks for streaming SSE events. All callbacks are optional —
361
363
  * omitted callbacks simply ignore that event type.
362
364
  */
363
- /** Structured ARBI error event (e.g. quota exceeded mid-stream). */
364
- interface ArbiErrorEvent {
365
- code: string;
366
- message: string;
367
- /** Present for QUOTA_EXCEEDED — current spend in USD. */
368
- spend?: number;
369
- /** Present for QUOTA_EXCEEDED — budget cap in USD. */
370
- budget?: number;
371
- /** Present for QUOTA_EXCEEDED — affected project external id. */
372
- project_ext_id?: string | null;
373
- [key: string]: unknown;
374
- }
375
365
  interface SSEStreamCallbacks {
376
366
  onStreamStart?: (data: SSEStreamStartData) => void;
377
367
  onToken?: (content: string) => void;
368
+ /** Live reasoning/thinking-token deltas (raw channel). Usually surfaced only in message details. */
369
+ onReasoningDelta?: (delta: string) => void;
378
370
  onTextDone?: (text: string) => void;
379
371
  onOutputItemAdded?: (data: ResponseOutputItemAddedEvent) => void;
380
372
  onOutputItemDone?: (data: ResponseOutputItemDoneEvent) => void;
381
373
  onContentPartAdded?: (data: ResponseContentPartAddedEvent) => void;
382
374
  onAgentStep?: (data: AgentStepEvent) => void;
375
+ /** Live narration delta — append `delta` to the focus of the step with the matching `index`. */
376
+ onAgentStepDelta?: (data: AgentStepDeltaEvent) => void;
383
377
  onError?: (message: string) => void;
384
378
  /**
385
379
  * Fired when the server emits a structured `arbi.error` event mid-stream.
@@ -2687,6 +2681,7 @@ declare class Arbi {
2687
2681
  } | undefined;
2688
2682
  MCP_TOOLS: string[];
2689
2683
  PLANNING_ENABLED: boolean;
2684
+ DEEP_RESEARCH_ENABLED: boolean;
2690
2685
  SUGGESTED_QUERIES: boolean;
2691
2686
  ARTIFACTS_ENABLED: boolean;
2692
2687
  VISION_ENABLED: boolean;
@@ -2696,8 +2691,6 @@ declare class Arbi {
2696
2691
  SKILL_CREATION: boolean;
2697
2692
  MEMORY_CREATION: boolean;
2698
2693
  GOALS_ENABLED: boolean;
2699
- GOAL_LOOP: boolean;
2700
- GOAL_TEXT: string;
2701
2694
  GOAL_MAX_OUTER_LOOPS: number;
2702
2695
  REVIEW_ENABLED: boolean;
2703
2696
  PERSONA: string;
@@ -4034,6 +4027,7 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4034
4027
  } | undefined;
4035
4028
  MCP_TOOLS: string[];
4036
4029
  PLANNING_ENABLED: boolean;
4030
+ DEEP_RESEARCH_ENABLED: boolean;
4037
4031
  SUGGESTED_QUERIES: boolean;
4038
4032
  ARTIFACTS_ENABLED: boolean;
4039
4033
  VISION_ENABLED: boolean;
@@ -4043,8 +4037,6 @@ declare function getConfig(arbi: ArbiClient, configId: string): Promise<{
4043
4037
  SKILL_CREATION: boolean;
4044
4038
  MEMORY_CREATION: boolean;
4045
4039
  GOALS_ENABLED: boolean;
4046
- GOAL_LOOP: boolean;
4047
- GOAL_TEXT: string;
4048
4040
  GOAL_MAX_OUTER_LOOPS: number;
4049
4041
  REVIEW_ENABLED: boolean;
4050
4042
  PERSONA: string;
@@ -4404,4 +4396,4 @@ declare namespace responses {
4404
4396
  export { type responses_SubmitBackgroundQueryOptions as SubmitBackgroundQueryOptions, responses_extractResponseText as extractResponseText, responses_getResponse as getResponse, responses_submitBackgroundQuery as submitBackgroundQuery };
4405
4397
  }
4406
4398
 
4407
- export { type UploadOptions as $, type AgentStepEvent as A, type ResponseCreatedEvent as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type ResponseFailedEvent as E, type FormattedWsMessage as F, type ResponseOutputItemAddedEvent as G, type ResponseOutputItemDoneEvent as H, type ResponseOutputTextDeltaEvent as I, type ResponseOutputTextDoneEvent as J, type ResponseUsage as K, type ListAllOptions as L, type MessageLevel as M, type SSEStreamCallbacks as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, type SSEStreamResult as T, type SSEStreamStartData as U, SUPPORTED_EXTENSIONS as V, type SkillSummary as W, type SkippedFile as X, type UploadBatchResult as Y, type UploadDirectOptions as Z, type UploadDirectResult as _, Arbi as a, type UploadResult as a0, type UserInfo as a1, type UserInputRequestEvent as a2, type UserMessageEvent as a3, WebSocketAuthError as a4, type WorkspaceContext as a5, type WsConnection as a6, agentconfig as a7, assistant as a8, authenticatedFetch as a9, getRawWorkspaceKey as aA, health as aB, parseSSEEvents as aC, parseSlashCommand as aD, parseSlashTokenInProgress as aE, performPasswordLogin as aF, performSigningKeyLogin as aG, performSsoDeviceFlowLogin as aH, requireData as aI, requireOk as aJ, resolveAuth as aK, resolveCitations as aL, resolveWorkspace as aM, responses as aN, selectWorkspace as aO, selectWorkspaceById as aP, settings as aQ, streamSSE as aR, stripCitationMarkdown as aS, summarizeCitations as aT, tags as aU, workspaces as aV, buildRetrievalChunkTool as aa, buildRetrievalFullContextTool as ab, buildRetrievalTocTool as ac, connectWebSocket as ad, connectWithReconnect as ae, consumeSSEStream as af, contacts as ag, conversations as ah, countCitations as ai, createAuthenticatedClient as aj, createDocumentWaiter as ak, dm as al, doctags as am, documents as an, files as ao, filterSkills as ap, formatAgentStepLabel as aq, formatFileSize as ar, formatStreamSummary as as, formatUserName as at, formatWorkspaceChoices as au, formatWsMessage as av, generateEncryptedWorkspaceKey as aw, generateNewWorkspaceKey as ax, getErrorCode as ay, getErrorMessage as az, ArbiApiError as b, ArbiError as c, type ArbiErrorEvent as d, type ArbiOptions as e, type ArtifactEvent as f, type AuthContext as g, type AuthHeaders as h, type AuthenticatedClient as i, type CitationSummary as j, type CliConfig as k, type CliCredentials as l, type ConfigStore as m, type ConnectOptions as n, type DmCryptoContext as o, type DocumentListFields as p, type DocumentListOrder as q, type DocumentWaiter as r, type DocumentWaiterOptions as s, type ListPaginatedOptions as t, type MessageMetadataPayload$1 as u, type MessageQueuedEvent as v, type ReconnectableWsConnection as w, type ResolvedCitation as x, type ResponseCompletedEvent as y, type ResponseContentPartAddedEvent as z };
4399
+ export { type UploadDirectResult as $, type AgentStepDeltaEvent as A, type ResponseContentPartAddedEvent as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type ResponseCreatedEvent as E, type FormattedWsMessage as F, type ResponseFailedEvent as G, type ResponseOutputItemAddedEvent as H, type ResponseOutputItemDoneEvent as I, type ResponseOutputTextDeltaEvent as J, type ResponseOutputTextDoneEvent as K, type ListAllOptions as L, type MessageLevel as M, type ResponseUsage as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type QueryOptions as Q, type ReconnectOptions as R, type SSEEvent as S, type SSEStreamCallbacks as T, type SSEStreamResult as U, type SSEStreamStartData as V, SUPPORTED_EXTENSIONS as W, type SkillSummary as X, type SkippedFile as Y, type UploadBatchResult as Z, type UploadDirectOptions as _, type AgentStepEvent as a, type UploadOptions as a0, type UploadResult as a1, type UserInfo as a2, type UserInputRequestEvent as a3, type UserMessageEvent as a4, WebSocketAuthError as a5, type WorkspaceContext as a6, type WsConnection as a7, agentconfig as a8, assistant as a9, getErrorMessage as aA, getRawWorkspaceKey as aB, health as aC, parseSSEEvents as aD, parseSlashCommand as aE, parseSlashTokenInProgress as aF, performPasswordLogin as aG, performSigningKeyLogin as aH, performSsoDeviceFlowLogin as aI, requireData as aJ, requireOk as aK, resolveAuth as aL, resolveCitations as aM, resolveWorkspace as aN, responses as aO, selectWorkspace as aP, selectWorkspaceById as aQ, settings as aR, streamSSE as aS, stripCitationMarkdown as aT, summarizeCitations as aU, tags as aV, workspaces as aW, authenticatedFetch as aa, buildRetrievalChunkTool as ab, buildRetrievalFullContextTool as ac, buildRetrievalTocTool as ad, connectWebSocket as ae, connectWithReconnect as af, consumeSSEStream as ag, contacts as ah, conversations as ai, countCitations as aj, createAuthenticatedClient as ak, createDocumentWaiter as al, dm as am, doctags as an, documents as ao, files as ap, filterSkills as aq, formatAgentStepLabel as ar, formatFileSize as as, formatStreamSummary as at, formatUserName as au, formatWorkspaceChoices as av, formatWsMessage as aw, generateEncryptedWorkspaceKey as ax, generateNewWorkspaceKey as ay, getErrorCode as az, Arbi as b, ArbiApiError as c, ArbiError as d, type ArbiErrorEvent as e, type ArbiOptions as f, type ArtifactEvent as g, type AuthContext as h, type AuthHeaders as i, type AuthenticatedClient as j, type CitationSummary as k, type CliConfig as l, type CliCredentials as m, type ConfigStore as n, type ConnectOptions as o, type DmCryptoContext as p, type DocumentListFields as q, type DocumentListOrder as r, type DocumentWaiter as s, type DocumentWaiterOptions as t, type ListPaginatedOptions as u, type MessageMetadataPayload$1 as v, type MessageQueuedEvent as w, type ReconnectableWsConnection as x, type ResolvedCitation as y, type ResponseCompletedEvent as z };
package/dist/browser.cjs CHANGED
@@ -3788,7 +3788,7 @@ async function resolveWorkspace(store, workspaceOpt) {
3788
3788
  // src/sse.ts
3789
3789
  var LIFECYCLE_LABELS_FALLBACK = {
3790
3790
  evaluation: "Evaluating results",
3791
- answering: "Writing answer",
3791
+ answering: "Answered",
3792
3792
  reviewing: "Reviewing answer",
3793
3793
  planning: "Planning",
3794
3794
  tool_progress: "Working"
@@ -3920,6 +3920,11 @@ async function streamSSE(response, callbacks = {}) {
3920
3920
  callbacks.onAgentStep?.(data);
3921
3921
  if (data.t != null) callbacks.onElapsedTime?.(data.t);
3922
3922
  },
3923
+ "arbi.agent_step_delta": (raw) => {
3924
+ const data = JSON.parse(raw);
3925
+ callbacks.onAgentStepDelta?.(data);
3926
+ if (data.t != null) callbacks.onElapsedTime?.(data.t);
3927
+ },
3923
3928
  "arbi.user_message": (raw) => {
3924
3929
  const data = JSON.parse(raw);
3925
3930
  userMessage = data;
@@ -3945,16 +3950,21 @@ async function streamSSE(response, callbacks = {}) {
3945
3950
  errors.push(message);
3946
3951
  callbacks.onArbiError?.(data);
3947
3952
  callbacks.onError?.(message);
3948
- },
3949
- "response.complete": () => {
3950
- callbacks.onComplete?.();
3951
3953
  }
3952
3954
  };
3953
3955
  const processEvents = (events) => {
3954
3956
  for (const { event, data } of events) {
3955
3957
  try {
3958
+ if (event === "reasoning") {
3959
+ callbacks.onReasoningDelta?.(data);
3960
+ continue;
3961
+ }
3956
3962
  const handler = eventHandlers[event];
3957
- if (handler) handler(data);
3963
+ if (handler) {
3964
+ handler(data);
3965
+ } else {
3966
+ console.warn(`[arbi-sse] unhandled SSE event: ${event}`);
3967
+ }
3958
3968
  } catch {
3959
3969
  }
3960
3970
  }