@arbidocs/sdk 0.3.133 → 0.3.135

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.
@@ -309,7 +309,6 @@ type ResponseOutputItemDoneEvent = components['schemas']['ResponseOutputItemDone
309
309
  type ResponseContentPartAddedEvent = components['schemas']['ResponseContentPartAddedEvent'];
310
310
  type AgentStepEvent = components['schemas']['AgentStepEvent'];
311
311
  type AgentStepDeltaEvent = components['schemas']['AgentStepDeltaEvent'];
312
- type GeneratingEvent = components['schemas']['GeneratingEvent'];
313
312
  type UserInputRequestEvent = components['schemas']['UserInputRequestEvent'];
314
313
  type ProbeAnswerEvent = components['schemas']['ProbeAnswerEvent'];
315
314
  type DeferredInterjectionEvent = components['schemas']['DeferredInterjectionEvent'];
@@ -378,6 +377,19 @@ declare function buildDocNameMap(docs: ReadonlyArray<{
378
377
  * The `goal` step's backend label is "Thinking…" (the bare "Goal" told
379
378
  * a user nothing); the fallback map covers older events that omit it.
380
379
  */
380
+ /**
381
+ * Human label for a Responses output_item (function_call / reasoning / message).
382
+ * Reads the backend-owned arbi extension: the agent's focus when present, else
383
+ * the label. The backend owns all wording — the SDK never invents it.
384
+ */
385
+ declare function formatItemLabel(item: {
386
+ type?: string;
387
+ name?: string;
388
+ arbi?: {
389
+ label?: string;
390
+ focus?: string;
391
+ };
392
+ }, docNames?: DocNameMap): string;
381
393
  declare function formatAgentStepLabel(step: AgentStepEvent, docNames?: DocNameMap): string;
382
394
  /**
383
395
  * Parse SSE events from a chunk of text, combining with a buffer
@@ -396,22 +408,23 @@ declare function parseSSEEvents(chunk: string, buffer: string): {
396
408
  interface SSEStreamCallbacks {
397
409
  onStreamStart?: (data: SSEStreamStartData) => void;
398
410
  onToken?: (content: string) => void;
411
+ /** Answer/narration text delta with its message item id, so the client can
412
+ * attribute each burst to the right message (narration vs the answer). */
413
+ onOutputTextDelta?: (data: {
414
+ item_id: string;
415
+ delta: string;
416
+ }) => void;
399
417
  /** Live reasoning/thinking-token deltas (raw channel). Usually surfaced only in message details. */
400
418
  onReasoningDelta?: (delta: string) => void;
401
419
  onTextDone?: (text: string) => void;
402
420
  onOutputItemAdded?: (data: ResponseOutputItemAddedEvent) => void;
403
421
  onOutputItemDone?: (data: ResponseOutputItemDoneEvent) => void;
422
+ /** A function_call item's JSON arguments streaming in. */
423
+ onFunctionCallArgumentsDelta?: (data: {
424
+ item_id: string;
425
+ delta: string;
426
+ }) => void;
404
427
  onContentPartAdded?: (data: ResponseContentPartAddedEvent) => void;
405
- onAgentStep?: (data: AgentStepEvent) => void;
406
- /** Live narration delta — append `delta` to the focus of the step with the matching `index`. */
407
- onAgentStepDelta?: (data: AgentStepDeltaEvent) => void;
408
- /**
409
- * The model has started generating free text. Open the token channel here.
410
- * It does NOT mean the text is the answer — a preamble before a tool call
411
- * looks identical at this point. Only the absence of a tool call proves it
412
- * was the answer, which is not known until the turn resolves.
413
- */
414
- onGenerating?: (data: GeneratingEvent) => void;
415
428
  onError?: (message: string) => void;
416
429
  /**
417
430
  * Fired when the server emits a structured `arbi.error` event mid-stream.
@@ -1913,20 +1926,6 @@ declare namespace memory {
1913
1926
  export { type memory_CreateMemoryRequest as CreateMemoryRequest, type memory_MemoryResponse as MemoryResponse, type memory_MemorySearchRequest as MemorySearchRequest, type memory_MemorySearchResponse as MemorySearchResponse, type memory_UpdateMemoryRequest as UpdateMemoryRequest, memory_createMemory as createMemory, memory_deleteMemory as deleteMemory, memory_listMemories as listMemories, memory_searchMemories as searchMemories, memory_updateMemory as updateMemory };
1914
1927
  }
1915
1928
 
1916
- /**
1917
- * High-level convenience class that wraps the full ARBI stack into a simple API.
1918
- *
1919
- * Handles SDK client creation, sodium initialization, authentication,
1920
- * workspace key decryption, and delegates to all operations modules.
1921
- *
1922
- * Usage:
1923
- * const arbi = new Arbi({ url: 'https://arbi.mycompany.com' })
1924
- * await arbi.login('user@example.com', 'password')
1925
- * const workspaces = await arbi.workspaces.list()
1926
- * await arbi.selectWorkspace(workspaces[0].external_id)
1927
- * const docs = await arbi.documents.list()
1928
- */
1929
-
1930
1929
  type DocUpdateRequest = components['schemas']['DocUpdateRequest'];
1931
1930
  type WorkspaceUpdateRequest$1 = components['schemas']['WorkspaceUpdateRequest'];
1932
1931
  type UpdateTagRequest$1 = components['schemas']['UpdateTagRequest'];
@@ -1955,7 +1954,7 @@ interface QueryOptions {
1955
1954
  /** Called when stream starts */
1956
1955
  onStreamStart?: (data: SSEStreamStartData) => void;
1957
1956
  /** Called for each agent step */
1958
- onAgentStep?: (data: AgentStepEvent) => void;
1957
+ onOutputItemDone?: (data: ResponseOutputItemDoneEvent) => void;
1959
1958
  /** Called on stream error */
1960
1959
  onError?: (message: string) => void;
1961
1960
  /** Called when a user message event is received */
@@ -5771,4 +5770,4 @@ declare namespace projects {
5771
5770
  export { type projects_ProjectInvoicesResponse as ProjectInvoicesResponse, type projects_ProjectUpdateRequest as ProjectUpdateRequest, type projects_ProjectUsageResponse as ProjectUsageResponse, type projects_UserDailyUsageResponse as UserDailyUsageResponse, projects_createProject as createProject, projects_deleteProject as deleteProject, projects_getProjectInvoices as getProjectInvoices, projects_getProjectUsage as getProjectUsage, projects_getUserUsageToday as getUserUsageToday, projects_listProjects as listProjects, projects_refreshProject as refreshProject, projects_renameProject as renameProject, projects_updateProject as updateProject };
5772
5771
  }
5773
5772
 
5774
- export { type ResponseOutputItemDoneEvent as $, type AgentControlStateEvent as A, type ListPaginatedOptions as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type MemorySearchRequest as E, type FormattedWsMessage as F, type MemorySearchResponse as G, type MessageLevel as H, type MessageMetadataPayload$1 as I, type MessageQueuedEvent as J, type ProbeAnswerEvent as K, type ListAllOptions as L, type MemoryResponse as M, type ProjectInvoicesResponse as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type ProjectUsageResponse as Q, type QueryOptions as R, type ReconnectOptions as S, type ReconnectableWsConnection as T, type ResolvedCitation as U, type ResolvedRecipient as V, type ResponseCompletedEvent as W, type ResponseContentPartAddedEvent as X, type ResponseCreatedEvent as Y, type ResponseFailedEvent as Z, type ResponseOutputItemAddedEvent as _, type AgentStepDeltaEvent as a, performSigningKeyLogin as a$, type ResponseOutputTextDeltaEvent as a0, type ResponseOutputTextDoneEvent as a1, type ResponseUsage as a2, type SSEEvent as a3, type SSEStreamCallbacks as a4, type SSEStreamResult as a5, type SSEStreamStartData as a6, SUPPORTED_EXTENSIONS as a7, type SkillSummary as a8, type SkippedFile as a9, contacts as aA, conversations as aB, countCitations as aC, createAuthenticatedClient as aD, createDocumentWaiter as aE, dm as aF, doctags as aG, documents as aH, files as aI, filterSkills as aJ, formatAgentStepLabel as aK, formatFileSize as aL, formatStreamSummary as aM, formatUserName as aN, formatWorkspaceChoices as aO, formatWsMessage as aP, generateEncryptedWorkspaceKey as aQ, generateNewWorkspaceKey as aR, getErrorCode as aS, getErrorMessage as aT, getRawWorkspaceKey as aU, health as aV, memory as aW, parseSSEEvents as aX, parseSlashCommand as aY, parseSlashTokenInProgress as aZ, performPasswordLogin as a_, type TaskResponse as aa, type UpdateMemoryRequest as ab, type UpdateTaskRequest as ac, type UploadBatchResult as ad, type UploadDirectOptions as ae, type UploadDirectResult as af, type UploadOptions as ag, type UploadResult as ah, type UserDailyUsageResponse as ai, type UserInfo as aj, type UserInputRequestEvent as ak, type UserMessageEvent as al, WebSocketAuthError as am, type WorkspaceChronologyOut as an, type WorkspaceContext as ao, type WsConnection as ap, agentconfig as aq, assistant as ar, authenticatedFetch as as, buildDocNameMap as at, buildRetrievalChunkTool as au, buildRetrievalFullContextTool as av, buildRetrievalTocTool as aw, connectWebSocket as ax, connectWithReconnect as ay, consumeSSEStream as az, type AgentStepEvent as b, performSsoDeviceFlowLogin as b0, projects as b1, requireData as b2, requireOk as b3, resolveAuth as b4, resolveCitations as b5, resolveWorkspace as b6, responses as b7, selectWorkspace as b8, selectWorkspaceById as b9, settings as ba, streamSSE as bb, stripCitationMarkdown as bc, summarizeCitations as bd, tags as be, tasks as bf, workspaces as bg, Arbi as c, ArbiApiError as d, ArbiError as e, type ArbiErrorEvent as f, type ArbiOptions as g, type ArtifactEvent as h, type AuthContext as i, type AuthHeaders as j, type AuthenticatedClient as k, type CitationSummary as l, type CliConfig as m, type CliCredentials as n, type CommandDescriptor as o, type ConfigStore as p, type ConnectOptions as q, type CreateMemoryRequest as r, type CreateTaskRequest as s, type DeferredInterjectionEvent as t, type DmCryptoContext as u, type DocNameMap as v, type DocumentListFields as w, type DocumentListOrder as x, type DocumentWaiter as y, type DocumentWaiterOptions as z };
5773
+ export { type ResponseOutputItemDoneEvent as $, type AgentControlStateEvent as A, type ListPaginatedOptions as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type MemorySearchRequest as E, type FormattedWsMessage as F, type MemorySearchResponse as G, type MessageLevel as H, type MessageMetadataPayload$1 as I, type MessageQueuedEvent as J, type ProbeAnswerEvent as K, type ListAllOptions as L, type MemoryResponse as M, type ProjectInvoicesResponse as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type ProjectUsageResponse as Q, type QueryOptions as R, type ReconnectOptions as S, type ReconnectableWsConnection as T, type ResolvedCitation as U, type ResolvedRecipient as V, type ResponseCompletedEvent as W, type ResponseContentPartAddedEvent as X, type ResponseCreatedEvent as Y, type ResponseFailedEvent as Z, type ResponseOutputItemAddedEvent as _, type AgentStepDeltaEvent as a, performPasswordLogin as a$, type ResponseOutputTextDeltaEvent as a0, type ResponseOutputTextDoneEvent as a1, type ResponseUsage as a2, type SSEEvent as a3, type SSEStreamCallbacks as a4, type SSEStreamResult as a5, type SSEStreamStartData as a6, SUPPORTED_EXTENSIONS as a7, type SkillSummary as a8, type SkippedFile as a9, contacts as aA, conversations as aB, countCitations as aC, createAuthenticatedClient as aD, createDocumentWaiter as aE, dm as aF, doctags as aG, documents as aH, files as aI, filterSkills as aJ, formatAgentStepLabel as aK, formatFileSize as aL, formatItemLabel as aM, formatStreamSummary as aN, formatUserName as aO, formatWorkspaceChoices as aP, formatWsMessage as aQ, generateEncryptedWorkspaceKey as aR, generateNewWorkspaceKey as aS, getErrorCode as aT, getErrorMessage as aU, getRawWorkspaceKey as aV, health as aW, memory as aX, parseSSEEvents as aY, parseSlashCommand as aZ, parseSlashTokenInProgress as a_, type TaskResponse as aa, type UpdateMemoryRequest as ab, type UpdateTaskRequest as ac, type UploadBatchResult as ad, type UploadDirectOptions as ae, type UploadDirectResult as af, type UploadOptions as ag, type UploadResult as ah, type UserDailyUsageResponse as ai, type UserInfo as aj, type UserInputRequestEvent as ak, type UserMessageEvent as al, WebSocketAuthError as am, type WorkspaceChronologyOut as an, type WorkspaceContext as ao, type WsConnection as ap, agentconfig as aq, assistant as ar, authenticatedFetch as as, buildDocNameMap as at, buildRetrievalChunkTool as au, buildRetrievalFullContextTool as av, buildRetrievalTocTool as aw, connectWebSocket as ax, connectWithReconnect as ay, consumeSSEStream as az, type AgentStepEvent as b, performSigningKeyLogin as b0, performSsoDeviceFlowLogin as b1, projects as b2, requireData as b3, requireOk as b4, resolveAuth as b5, resolveCitations as b6, resolveWorkspace as b7, responses as b8, selectWorkspace as b9, selectWorkspaceById as ba, settings as bb, streamSSE as bc, stripCitationMarkdown as bd, summarizeCitations as be, tags as bf, tasks as bg, workspaces as bh, Arbi as c, ArbiApiError as d, ArbiError as e, type ArbiErrorEvent as f, type ArbiOptions as g, type ArtifactEvent as h, type AuthContext as i, type AuthHeaders as j, type AuthenticatedClient as k, type CitationSummary as l, type CliConfig as m, type CliCredentials as n, type CommandDescriptor as o, type ConfigStore as p, type ConnectOptions as q, type CreateMemoryRequest as r, type CreateTaskRequest as s, type DeferredInterjectionEvent as t, type DmCryptoContext as u, type DocNameMap as v, type DocumentListFields as w, type DocumentListOrder as x, type DocumentWaiter as y, type DocumentWaiterOptions as z };
@@ -309,7 +309,6 @@ type ResponseOutputItemDoneEvent = components['schemas']['ResponseOutputItemDone
309
309
  type ResponseContentPartAddedEvent = components['schemas']['ResponseContentPartAddedEvent'];
310
310
  type AgentStepEvent = components['schemas']['AgentStepEvent'];
311
311
  type AgentStepDeltaEvent = components['schemas']['AgentStepDeltaEvent'];
312
- type GeneratingEvent = components['schemas']['GeneratingEvent'];
313
312
  type UserInputRequestEvent = components['schemas']['UserInputRequestEvent'];
314
313
  type ProbeAnswerEvent = components['schemas']['ProbeAnswerEvent'];
315
314
  type DeferredInterjectionEvent = components['schemas']['DeferredInterjectionEvent'];
@@ -378,6 +377,19 @@ declare function buildDocNameMap(docs: ReadonlyArray<{
378
377
  * The `goal` step's backend label is "Thinking…" (the bare "Goal" told
379
378
  * a user nothing); the fallback map covers older events that omit it.
380
379
  */
380
+ /**
381
+ * Human label for a Responses output_item (function_call / reasoning / message).
382
+ * Reads the backend-owned arbi extension: the agent's focus when present, else
383
+ * the label. The backend owns all wording — the SDK never invents it.
384
+ */
385
+ declare function formatItemLabel(item: {
386
+ type?: string;
387
+ name?: string;
388
+ arbi?: {
389
+ label?: string;
390
+ focus?: string;
391
+ };
392
+ }, docNames?: DocNameMap): string;
381
393
  declare function formatAgentStepLabel(step: AgentStepEvent, docNames?: DocNameMap): string;
382
394
  /**
383
395
  * Parse SSE events from a chunk of text, combining with a buffer
@@ -396,22 +408,23 @@ declare function parseSSEEvents(chunk: string, buffer: string): {
396
408
  interface SSEStreamCallbacks {
397
409
  onStreamStart?: (data: SSEStreamStartData) => void;
398
410
  onToken?: (content: string) => void;
411
+ /** Answer/narration text delta with its message item id, so the client can
412
+ * attribute each burst to the right message (narration vs the answer). */
413
+ onOutputTextDelta?: (data: {
414
+ item_id: string;
415
+ delta: string;
416
+ }) => void;
399
417
  /** Live reasoning/thinking-token deltas (raw channel). Usually surfaced only in message details. */
400
418
  onReasoningDelta?: (delta: string) => void;
401
419
  onTextDone?: (text: string) => void;
402
420
  onOutputItemAdded?: (data: ResponseOutputItemAddedEvent) => void;
403
421
  onOutputItemDone?: (data: ResponseOutputItemDoneEvent) => void;
422
+ /** A function_call item's JSON arguments streaming in. */
423
+ onFunctionCallArgumentsDelta?: (data: {
424
+ item_id: string;
425
+ delta: string;
426
+ }) => void;
404
427
  onContentPartAdded?: (data: ResponseContentPartAddedEvent) => void;
405
- onAgentStep?: (data: AgentStepEvent) => void;
406
- /** Live narration delta — append `delta` to the focus of the step with the matching `index`. */
407
- onAgentStepDelta?: (data: AgentStepDeltaEvent) => void;
408
- /**
409
- * The model has started generating free text. Open the token channel here.
410
- * It does NOT mean the text is the answer — a preamble before a tool call
411
- * looks identical at this point. Only the absence of a tool call proves it
412
- * was the answer, which is not known until the turn resolves.
413
- */
414
- onGenerating?: (data: GeneratingEvent) => void;
415
428
  onError?: (message: string) => void;
416
429
  /**
417
430
  * Fired when the server emits a structured `arbi.error` event mid-stream.
@@ -1913,20 +1926,6 @@ declare namespace memory {
1913
1926
  export { type memory_CreateMemoryRequest as CreateMemoryRequest, type memory_MemoryResponse as MemoryResponse, type memory_MemorySearchRequest as MemorySearchRequest, type memory_MemorySearchResponse as MemorySearchResponse, type memory_UpdateMemoryRequest as UpdateMemoryRequest, memory_createMemory as createMemory, memory_deleteMemory as deleteMemory, memory_listMemories as listMemories, memory_searchMemories as searchMemories, memory_updateMemory as updateMemory };
1914
1927
  }
1915
1928
 
1916
- /**
1917
- * High-level convenience class that wraps the full ARBI stack into a simple API.
1918
- *
1919
- * Handles SDK client creation, sodium initialization, authentication,
1920
- * workspace key decryption, and delegates to all operations modules.
1921
- *
1922
- * Usage:
1923
- * const arbi = new Arbi({ url: 'https://arbi.mycompany.com' })
1924
- * await arbi.login('user@example.com', 'password')
1925
- * const workspaces = await arbi.workspaces.list()
1926
- * await arbi.selectWorkspace(workspaces[0].external_id)
1927
- * const docs = await arbi.documents.list()
1928
- */
1929
-
1930
1929
  type DocUpdateRequest = components['schemas']['DocUpdateRequest'];
1931
1930
  type WorkspaceUpdateRequest$1 = components['schemas']['WorkspaceUpdateRequest'];
1932
1931
  type UpdateTagRequest$1 = components['schemas']['UpdateTagRequest'];
@@ -1955,7 +1954,7 @@ interface QueryOptions {
1955
1954
  /** Called when stream starts */
1956
1955
  onStreamStart?: (data: SSEStreamStartData) => void;
1957
1956
  /** Called for each agent step */
1958
- onAgentStep?: (data: AgentStepEvent) => void;
1957
+ onOutputItemDone?: (data: ResponseOutputItemDoneEvent) => void;
1959
1958
  /** Called on stream error */
1960
1959
  onError?: (message: string) => void;
1961
1960
  /** Called when a user message event is received */
@@ -5771,4 +5770,4 @@ declare namespace projects {
5771
5770
  export { type projects_ProjectInvoicesResponse as ProjectInvoicesResponse, type projects_ProjectUpdateRequest as ProjectUpdateRequest, type projects_ProjectUsageResponse as ProjectUsageResponse, type projects_UserDailyUsageResponse as UserDailyUsageResponse, projects_createProject as createProject, projects_deleteProject as deleteProject, projects_getProjectInvoices as getProjectInvoices, projects_getProjectUsage as getProjectUsage, projects_getUserUsageToday as getUserUsageToday, projects_listProjects as listProjects, projects_refreshProject as refreshProject, projects_renameProject as renameProject, projects_updateProject as updateProject };
5772
5771
  }
5773
5772
 
5774
- export { type ResponseOutputItemDoneEvent as $, type AgentControlStateEvent as A, type ListPaginatedOptions as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type MemorySearchRequest as E, type FormattedWsMessage as F, type MemorySearchResponse as G, type MessageLevel as H, type MessageMetadataPayload$1 as I, type MessageQueuedEvent as J, type ProbeAnswerEvent as K, type ListAllOptions as L, type MemoryResponse as M, type ProjectInvoicesResponse as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type ProjectUsageResponse as Q, type QueryOptions as R, type ReconnectOptions as S, type ReconnectableWsConnection as T, type ResolvedCitation as U, type ResolvedRecipient as V, type ResponseCompletedEvent as W, type ResponseContentPartAddedEvent as X, type ResponseCreatedEvent as Y, type ResponseFailedEvent as Z, type ResponseOutputItemAddedEvent as _, type AgentStepDeltaEvent as a, performSigningKeyLogin as a$, type ResponseOutputTextDeltaEvent as a0, type ResponseOutputTextDoneEvent as a1, type ResponseUsage as a2, type SSEEvent as a3, type SSEStreamCallbacks as a4, type SSEStreamResult as a5, type SSEStreamStartData as a6, SUPPORTED_EXTENSIONS as a7, type SkillSummary as a8, type SkippedFile as a9, contacts as aA, conversations as aB, countCitations as aC, createAuthenticatedClient as aD, createDocumentWaiter as aE, dm as aF, doctags as aG, documents as aH, files as aI, filterSkills as aJ, formatAgentStepLabel as aK, formatFileSize as aL, formatStreamSummary as aM, formatUserName as aN, formatWorkspaceChoices as aO, formatWsMessage as aP, generateEncryptedWorkspaceKey as aQ, generateNewWorkspaceKey as aR, getErrorCode as aS, getErrorMessage as aT, getRawWorkspaceKey as aU, health as aV, memory as aW, parseSSEEvents as aX, parseSlashCommand as aY, parseSlashTokenInProgress as aZ, performPasswordLogin as a_, type TaskResponse as aa, type UpdateMemoryRequest as ab, type UpdateTaskRequest as ac, type UploadBatchResult as ad, type UploadDirectOptions as ae, type UploadDirectResult as af, type UploadOptions as ag, type UploadResult as ah, type UserDailyUsageResponse as ai, type UserInfo as aj, type UserInputRequestEvent as ak, type UserMessageEvent as al, WebSocketAuthError as am, type WorkspaceChronologyOut as an, type WorkspaceContext as ao, type WsConnection as ap, agentconfig as aq, assistant as ar, authenticatedFetch as as, buildDocNameMap as at, buildRetrievalChunkTool as au, buildRetrievalFullContextTool as av, buildRetrievalTocTool as aw, connectWebSocket as ax, connectWithReconnect as ay, consumeSSEStream as az, type AgentStepEvent as b, performSsoDeviceFlowLogin as b0, projects as b1, requireData as b2, requireOk as b3, resolveAuth as b4, resolveCitations as b5, resolveWorkspace as b6, responses as b7, selectWorkspace as b8, selectWorkspaceById as b9, settings as ba, streamSSE as bb, stripCitationMarkdown as bc, summarizeCitations as bd, tags as be, tasks as bf, workspaces as bg, Arbi as c, ArbiApiError as d, ArbiError as e, type ArbiErrorEvent as f, type ArbiOptions as g, type ArtifactEvent as h, type AuthContext as i, type AuthHeaders as j, type AuthenticatedClient as k, type CitationSummary as l, type CliConfig as m, type CliCredentials as n, type CommandDescriptor as o, type ConfigStore as p, type ConnectOptions as q, type CreateMemoryRequest as r, type CreateTaskRequest as s, type DeferredInterjectionEvent as t, type DmCryptoContext as u, type DocNameMap as v, type DocumentListFields as w, type DocumentListOrder as x, type DocumentWaiter as y, type DocumentWaiterOptions as z };
5773
+ export { type ResponseOutputItemDoneEvent as $, type AgentControlStateEvent as A, type ListPaginatedOptions as B, type ChatSession as C, DOC_TERMINAL_STATUSES as D, type MemorySearchRequest as E, type FormattedWsMessage as F, type MemorySearchResponse as G, type MessageLevel as H, type MessageMetadataPayload$1 as I, type MessageQueuedEvent as J, type ProbeAnswerEvent as K, type ListAllOptions as L, type MemoryResponse as M, type ProjectInvoicesResponse as N, type OutputTokensDetails as O, type ParsedSlashCommand as P, type ProjectUsageResponse as Q, type QueryOptions as R, type ReconnectOptions as S, type ReconnectableWsConnection as T, type ResolvedCitation as U, type ResolvedRecipient as V, type ResponseCompletedEvent as W, type ResponseContentPartAddedEvent as X, type ResponseCreatedEvent as Y, type ResponseFailedEvent as Z, type ResponseOutputItemAddedEvent as _, type AgentStepDeltaEvent as a, performPasswordLogin as a$, type ResponseOutputTextDeltaEvent as a0, type ResponseOutputTextDoneEvent as a1, type ResponseUsage as a2, type SSEEvent as a3, type SSEStreamCallbacks as a4, type SSEStreamResult as a5, type SSEStreamStartData as a6, SUPPORTED_EXTENSIONS as a7, type SkillSummary as a8, type SkippedFile as a9, contacts as aA, conversations as aB, countCitations as aC, createAuthenticatedClient as aD, createDocumentWaiter as aE, dm as aF, doctags as aG, documents as aH, files as aI, filterSkills as aJ, formatAgentStepLabel as aK, formatFileSize as aL, formatItemLabel as aM, formatStreamSummary as aN, formatUserName as aO, formatWorkspaceChoices as aP, formatWsMessage as aQ, generateEncryptedWorkspaceKey as aR, generateNewWorkspaceKey as aS, getErrorCode as aT, getErrorMessage as aU, getRawWorkspaceKey as aV, health as aW, memory as aX, parseSSEEvents as aY, parseSlashCommand as aZ, parseSlashTokenInProgress as a_, type TaskResponse as aa, type UpdateMemoryRequest as ab, type UpdateTaskRequest as ac, type UploadBatchResult as ad, type UploadDirectOptions as ae, type UploadDirectResult as af, type UploadOptions as ag, type UploadResult as ah, type UserDailyUsageResponse as ai, type UserInfo as aj, type UserInputRequestEvent as ak, type UserMessageEvent as al, WebSocketAuthError as am, type WorkspaceChronologyOut as an, type WorkspaceContext as ao, type WsConnection as ap, agentconfig as aq, assistant as ar, authenticatedFetch as as, buildDocNameMap as at, buildRetrievalChunkTool as au, buildRetrievalFullContextTool as av, buildRetrievalTocTool as aw, connectWebSocket as ax, connectWithReconnect as ay, consumeSSEStream as az, type AgentStepEvent as b, performSigningKeyLogin as b0, performSsoDeviceFlowLogin as b1, projects as b2, requireData as b3, requireOk as b4, resolveAuth as b5, resolveCitations as b6, resolveWorkspace as b7, responses as b8, selectWorkspace as b9, selectWorkspaceById as ba, settings as bb, streamSSE as bc, stripCitationMarkdown as bd, summarizeCitations as be, tags as bf, tasks as bg, workspaces as bh, Arbi as c, ArbiApiError as d, ArbiError as e, type ArbiErrorEvent as f, type ArbiOptions as g, type ArtifactEvent as h, type AuthContext as i, type AuthHeaders as j, type AuthenticatedClient as k, type CitationSummary as l, type CliConfig as m, type CliCredentials as n, type CommandDescriptor as o, type ConfigStore as p, type ConnectOptions as q, type CreateMemoryRequest as r, type CreateTaskRequest as s, type DeferredInterjectionEvent as t, type DmCryptoContext as u, type DocNameMap as v, type DocumentListFields as w, type DocumentListOrder as x, type DocumentWaiter as y, type DocumentWaiterOptions as z };
package/dist/browser.cjs CHANGED
@@ -3822,6 +3822,12 @@ function extractPageRange(step) {
3822
3822
  }
3823
3823
  return void 0;
3824
3824
  }
3825
+ function formatItemLabel(item, docNames) {
3826
+ const arbi = item.arbi;
3827
+ if (arbi?.focus) return resolveDocRefs(arbi.focus, docNames);
3828
+ if (arbi?.label) return arbi.label;
3829
+ return item.name ?? "";
3830
+ }
3825
3831
  function formatAgentStepLabel(step, docNames) {
3826
3832
  if (step.step === "goal") {
3827
3833
  return step.label && step.label !== "Goal" ? step.label : "Thinking\u2026";
@@ -3833,7 +3839,7 @@ function formatAgentStepLabel(step, docNames) {
3833
3839
  if (step.label) return `${step.label}${suffix}`;
3834
3840
  const detail = step.detail;
3835
3841
  if (step.step === "tool_progress" && detail && detail.length > 0) {
3836
- const label = detail[0].label || humanizeStep(step.step);
3842
+ const label = detail[0].label || detail[0].tool && humanizeStep(detail[0].tool) || humanizeStep(step.step);
3837
3843
  if (suffix) return `${label}${suffix}`;
3838
3844
  const message = detail[0].message;
3839
3845
  return message ? `${label}: ${resolveDocRefs(message, docNames)}` : label;
@@ -3902,7 +3908,11 @@ async function streamSSE(response, callbacks = {}) {
3902
3908
  const data = JSON.parse(raw);
3903
3909
  if (data.delta) {
3904
3910
  text += data.delta;
3905
- callbacks.onToken?.(data.delta);
3911
+ if (callbacks.onOutputTextDelta) {
3912
+ callbacks.onOutputTextDelta({ item_id: data.item_id ?? "", delta: data.delta });
3913
+ } else {
3914
+ callbacks.onToken?.(data.delta);
3915
+ }
3906
3916
  }
3907
3917
  },
3908
3918
  "response.output_text.done": (raw) => {
@@ -3910,9 +3920,20 @@ async function streamSSE(response, callbacks = {}) {
3910
3920
  text = data.text;
3911
3921
  callbacks.onTextDone?.(data.text);
3912
3922
  },
3923
+ "response.function_call_arguments.delta": (raw) => {
3924
+ const data = JSON.parse(raw);
3925
+ callbacks.onFunctionCallArgumentsDelta?.(data);
3926
+ },
3913
3927
  "response.output_item.done": (raw) => {
3914
3928
  const data = JSON.parse(raw);
3929
+ const item = data.item;
3930
+ if (item?.type === "function_call" || item?.type === "reasoning") {
3931
+ const label = formatItemLabel(item);
3932
+ if (label) agentSteps.push(label);
3933
+ if (item.type === "function_call") toolCallCount += 1;
3934
+ }
3915
3935
  callbacks.onOutputItemDone?.(data);
3936
+ if (data.t != null) callbacks.onElapsedTime?.(data.t);
3916
3937
  },
3917
3938
  "response.completed": (raw) => {
3918
3939
  const data = JSON.parse(raw);
@@ -3951,27 +3972,6 @@ async function streamSSE(response, callbacks = {}) {
3951
3972
  }
3952
3973
  callbacks.onMessageQueued?.(data);
3953
3974
  },
3954
- "arbi.agent_step": (raw) => {
3955
- const data = JSON.parse(raw);
3956
- const label = formatAgentStepLabel(data);
3957
- if (label) agentSteps.push(label);
3958
- const detail = data.detail;
3959
- if (detail && Array.isArray(detail)) {
3960
- toolCallCount += detail.filter((d2) => d2.tool).length;
3961
- }
3962
- callbacks.onAgentStep?.(data);
3963
- if (data.t != null) callbacks.onElapsedTime?.(data.t);
3964
- },
3965
- "arbi.generating": (raw) => {
3966
- const data = JSON.parse(raw);
3967
- callbacks.onGenerating?.(data);
3968
- if (data.t != null) callbacks.onElapsedTime?.(data.t);
3969
- },
3970
- "arbi.agent_step_delta": (raw) => {
3971
- const data = JSON.parse(raw);
3972
- callbacks.onAgentStepDelta?.(data);
3973
- if (data.t != null) callbacks.onElapsedTime?.(data.t);
3974
- },
3975
3975
  "arbi.user_message": (raw) => {
3976
3976
  const data = JSON.parse(raw);
3977
3977
  userMessage = data;
@@ -5898,7 +5898,7 @@ var Arbi = class {
5898
5898
  const callbacks = {
5899
5899
  onToken: options.onToken,
5900
5900
  onStreamStart: options.onStreamStart,
5901
- onAgentStep: options.onAgentStep,
5901
+ onOutputItemDone: options.onOutputItemDone,
5902
5902
  onError: options.onError,
5903
5903
  onUserMessage: options.onUserMessage,
5904
5904
  onMetadata: options.onMetadata,
@@ -6198,6 +6198,7 @@ exports.files = files_exports;
6198
6198
  exports.filterSkills = filterSkills;
6199
6199
  exports.formatAgentStepLabel = formatAgentStepLabel;
6200
6200
  exports.formatFileSize = formatFileSize;
6201
+ exports.formatItemLabel = formatItemLabel;
6201
6202
  exports.formatUserName = formatUserName;
6202
6203
  exports.formatWorkspaceChoices = formatWorkspaceChoices;
6203
6204
  exports.getErrorMessage = getErrorMessage;