@arbidocs/sdk 0.3.77 → 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.
- package/dist/{browser-D70FwUTI.d.cts → browser-a0r4Y6dE.d.cts} +11 -19
- package/dist/{browser-D70FwUTI.d.ts → browser-a0r4Y6dE.d.ts} +11 -19
- package/dist/browser.cjs +15 -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 +15 -5
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +15 -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 +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -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.
|
|
@@ -2649,11 +2643,11 @@ declare class Arbi {
|
|
|
2649
2643
|
show_help_page: boolean;
|
|
2650
2644
|
show_templates: boolean;
|
|
2651
2645
|
show_skills: boolean;
|
|
2646
|
+
show_chronology: boolean;
|
|
2652
2647
|
show_pa_mode: boolean;
|
|
2653
2648
|
show_agent_sessions: boolean;
|
|
2654
2649
|
show_mcp_connectors: boolean;
|
|
2655
2650
|
show_hints: boolean;
|
|
2656
|
-
show_chronology: boolean;
|
|
2657
2651
|
use_s3_direct_upload: boolean;
|
|
2658
2652
|
hide_online_status: boolean;
|
|
2659
2653
|
muted_users: string[];
|
|
@@ -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;
|
|
@@ -3986,11 +3979,11 @@ declare function getSettings(arbi: ArbiClient): Promise<{
|
|
|
3986
3979
|
show_help_page: boolean;
|
|
3987
3980
|
show_templates: boolean;
|
|
3988
3981
|
show_skills: boolean;
|
|
3982
|
+
show_chronology: boolean;
|
|
3989
3983
|
show_pa_mode: boolean;
|
|
3990
3984
|
show_agent_sessions: boolean;
|
|
3991
3985
|
show_mcp_connectors: boolean;
|
|
3992
3986
|
show_hints: boolean;
|
|
3993
|
-
show_chronology: boolean;
|
|
3994
3987
|
use_s3_direct_upload: boolean;
|
|
3995
3988
|
hide_online_status: boolean;
|
|
3996
3989
|
muted_users: 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
|
|
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.
|
|
@@ -2649,11 +2643,11 @@ declare class Arbi {
|
|
|
2649
2643
|
show_help_page: boolean;
|
|
2650
2644
|
show_templates: boolean;
|
|
2651
2645
|
show_skills: boolean;
|
|
2646
|
+
show_chronology: boolean;
|
|
2652
2647
|
show_pa_mode: boolean;
|
|
2653
2648
|
show_agent_sessions: boolean;
|
|
2654
2649
|
show_mcp_connectors: boolean;
|
|
2655
2650
|
show_hints: boolean;
|
|
2656
|
-
show_chronology: boolean;
|
|
2657
2651
|
use_s3_direct_upload: boolean;
|
|
2658
2652
|
hide_online_status: boolean;
|
|
2659
2653
|
muted_users: string[];
|
|
@@ -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;
|
|
@@ -3986,11 +3979,11 @@ declare function getSettings(arbi: ArbiClient): Promise<{
|
|
|
3986
3979
|
show_help_page: boolean;
|
|
3987
3980
|
show_templates: boolean;
|
|
3988
3981
|
show_skills: boolean;
|
|
3982
|
+
show_chronology: boolean;
|
|
3989
3983
|
show_pa_mode: boolean;
|
|
3990
3984
|
show_agent_sessions: boolean;
|
|
3991
3985
|
show_mcp_connectors: boolean;
|
|
3992
3986
|
show_hints: boolean;
|
|
3993
|
-
show_chronology: boolean;
|
|
3994
3987
|
use_s3_direct_upload: boolean;
|
|
3995
3988
|
hide_online_status: boolean;
|
|
3996
3989
|
muted_users: 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
|
|
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: "
|
|
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)
|
|
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
|
}
|