@erdoai/types 0.1.13 → 0.1.14
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 +58 -38
- package/dist/index.d.ts +58 -38
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -53,7 +53,7 @@ interface ContentItem {
|
|
|
53
53
|
tableData?: unknown[];
|
|
54
54
|
[key: string]: unknown;
|
|
55
55
|
}
|
|
56
|
-
type ContentType = 'text' | 'json' | 'code' | 'table' | 'image' | 'error';
|
|
56
|
+
type ContentType = 'text' | 'json' | 'code' | 'table' | 'image' | 'error' | 'agent_invocation' | 'tool_invocation' | 'tool_result';
|
|
57
57
|
type UIContentType = 'chart' | 'bar_chart' | 'line_chart' | 'pie_chart' | 'scatter_chart' | 'heatmap' | 'table' | 'markdown' | string;
|
|
58
58
|
interface InvokeResult {
|
|
59
59
|
/** Whether the invocation succeeded */
|
|
@@ -266,53 +266,73 @@ interface ListThreadMessagesResponse {
|
|
|
266
266
|
}
|
|
267
267
|
/** Step types: agent, LLM call, or tool call */
|
|
268
268
|
type StepType = 'agent' | 'llm_call' | 'tool_call';
|
|
269
|
-
/**
|
|
270
|
-
interface
|
|
269
|
+
/** The container — one per agent invocation */
|
|
270
|
+
interface AgentStreamState {
|
|
271
|
+
/** All nodes ordered by event arrival — render from this */
|
|
272
|
+
nodes: AgentContent[];
|
|
273
|
+
/** Fast lookup for step nodes by step ID */
|
|
274
|
+
byStepId: Record<string, AgentStepNode>;
|
|
275
|
+
/** Fast lookup for content nodes by content ID */
|
|
276
|
+
byContentId: Record<string, AgentContentNode>;
|
|
277
|
+
/** Step tree structure: parent step ID → child step IDs */
|
|
278
|
+
childrenByParentId: Record<string, string[]>;
|
|
279
|
+
/** The first parentless step */
|
|
280
|
+
rootStepId: string | null;
|
|
281
|
+
/** Assistant message ID from `message created` event — used for anchoring */
|
|
282
|
+
messageId: string | null;
|
|
283
|
+
/** Whether the stream is still active */
|
|
284
|
+
isStreaming: boolean;
|
|
285
|
+
}
|
|
286
|
+
/** Union of all node types in the flat content model */
|
|
287
|
+
type AgentContent = AgentStepNode | AgentContentNode | AgentStatusNode;
|
|
288
|
+
/** Structural node — steps form the hierarchy, NO content on them */
|
|
289
|
+
interface AgentStepNode {
|
|
290
|
+
kind: 'step';
|
|
271
291
|
id: string;
|
|
272
|
-
|
|
292
|
+
parentId: string | null;
|
|
273
293
|
type: StepType;
|
|
274
294
|
name: string;
|
|
275
|
-
/** For agent steps: the agent key (e.g., "erdo.data-analyst")
|
|
295
|
+
/** For agent steps: the agent key (e.g., "erdo.data-analyst") */
|
|
276
296
|
key?: string;
|
|
277
297
|
status: 'running' | 'completed' | 'error';
|
|
278
|
-
content: StepContentItem[];
|
|
279
298
|
error?: string;
|
|
280
|
-
/**
|
|
281
|
-
|
|
282
|
-
/** Human-readable label while step is running
|
|
283
|
-
|
|
284
|
-
/** Human-readable label when step completes
|
|
285
|
-
|
|
286
|
-
/** If true, step should not be rendered in the UI
|
|
299
|
+
/** Response format hint: 'json' | 'text' */
|
|
300
|
+
contentType?: string;
|
|
301
|
+
/** Human-readable label while step is running */
|
|
302
|
+
runningStatus?: string;
|
|
303
|
+
/** Human-readable label when step completes */
|
|
304
|
+
finishedStatus?: string;
|
|
305
|
+
/** If true, step should not be rendered in the UI */
|
|
287
306
|
hidden?: boolean;
|
|
288
|
-
/** Pre-parsed content chunks from parseMixedJson. Updated as text_delta accumulates. */
|
|
289
|
-
parsed_content?: Array<{
|
|
290
|
-
content: string | Record<string, unknown>;
|
|
291
|
-
type: 'json' | 'text';
|
|
292
|
-
}>;
|
|
293
|
-
/** Active content streams created by content_start events, keyed by content_id */
|
|
294
|
-
content_streams?: Record<string, ContentStream>;
|
|
295
307
|
}
|
|
296
|
-
/**
|
|
297
|
-
interface
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
/** Content node — flat, with optional stepId for location */
|
|
309
|
+
interface AgentContentNode {
|
|
310
|
+
kind: 'content';
|
|
311
|
+
/** Unique content ID (from message_content_id) */
|
|
312
|
+
id: string;
|
|
313
|
+
/** Location — null means root level */
|
|
314
|
+
stepId: string | null;
|
|
315
|
+
/** e.g. 'text', 'json', 'tool_invocation', 'tool_result' */
|
|
316
|
+
contentType: string;
|
|
317
|
+
/** e.g. 'markdown', 'codegen_json', 'ui_generation' */
|
|
318
|
+
uiContentType: string;
|
|
319
|
+
/** Accumulated text from deltas */
|
|
307
320
|
text: string;
|
|
308
|
-
/** Final result
|
|
321
|
+
/** Final result from message content result */
|
|
309
322
|
result?: unknown;
|
|
323
|
+
state: 'streaming' | 'completed';
|
|
324
|
+
/** For incremental JSON parsing (reuses existing parser infrastructure) */
|
|
325
|
+
parsedContent?: Array<{
|
|
326
|
+
content: string | Record<string, unknown>;
|
|
327
|
+
type: 'json' | 'text';
|
|
328
|
+
}>;
|
|
310
329
|
}
|
|
311
|
-
/**
|
|
312
|
-
interface
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
330
|
+
/** Status update node */
|
|
331
|
+
interface AgentStatusNode {
|
|
332
|
+
kind: 'status';
|
|
333
|
+
/** Step this status belongs to (null = root level) */
|
|
334
|
+
stepId: string | null;
|
|
335
|
+
message: string;
|
|
316
336
|
}
|
|
317
337
|
|
|
318
|
-
export type { AxisConfig, BotInvocationInfo, ChartConfig, ChartContent, ChartSeriesConfig, ChartType, CodeExecOutputItem, ContentItem,
|
|
338
|
+
export type { AgentContent, AgentContentNode, AgentStatusNode, AgentStepNode, AgentStreamState, AxisConfig, BotInvocationInfo, ChartConfig, ChartContent, ChartSeriesConfig, ChartType, CodeExecOutputItem, ContentItem, ContentType, CreateThreadParams, CreateTokenParams, ErdoClient, ErdoClientConfig, InvocationMode, InvocationStatus, InvokeParams, InvokeResult, ListThreadMessagesResponse, ListThreadsResponse, LogEntry, LogLevel, Message, MessageContent, Result, ResultOutput, SSEEvent, SSEEventMetadata, SendMessageParams, SeriesConfig, StepInfo, StepType, Thread, ThreadMessage, ThreadMessageContent, TokenResponse, ToolGroup, ToolInvocation, ToolResult, UIContentType, WebParseOutput, WebSearchOutput, WebSearchResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ interface ContentItem {
|
|
|
53
53
|
tableData?: unknown[];
|
|
54
54
|
[key: string]: unknown;
|
|
55
55
|
}
|
|
56
|
-
type ContentType = 'text' | 'json' | 'code' | 'table' | 'image' | 'error';
|
|
56
|
+
type ContentType = 'text' | 'json' | 'code' | 'table' | 'image' | 'error' | 'agent_invocation' | 'tool_invocation' | 'tool_result';
|
|
57
57
|
type UIContentType = 'chart' | 'bar_chart' | 'line_chart' | 'pie_chart' | 'scatter_chart' | 'heatmap' | 'table' | 'markdown' | string;
|
|
58
58
|
interface InvokeResult {
|
|
59
59
|
/** Whether the invocation succeeded */
|
|
@@ -266,53 +266,73 @@ interface ListThreadMessagesResponse {
|
|
|
266
266
|
}
|
|
267
267
|
/** Step types: agent, LLM call, or tool call */
|
|
268
268
|
type StepType = 'agent' | 'llm_call' | 'tool_call';
|
|
269
|
-
/**
|
|
270
|
-
interface
|
|
269
|
+
/** The container — one per agent invocation */
|
|
270
|
+
interface AgentStreamState {
|
|
271
|
+
/** All nodes ordered by event arrival — render from this */
|
|
272
|
+
nodes: AgentContent[];
|
|
273
|
+
/** Fast lookup for step nodes by step ID */
|
|
274
|
+
byStepId: Record<string, AgentStepNode>;
|
|
275
|
+
/** Fast lookup for content nodes by content ID */
|
|
276
|
+
byContentId: Record<string, AgentContentNode>;
|
|
277
|
+
/** Step tree structure: parent step ID → child step IDs */
|
|
278
|
+
childrenByParentId: Record<string, string[]>;
|
|
279
|
+
/** The first parentless step */
|
|
280
|
+
rootStepId: string | null;
|
|
281
|
+
/** Assistant message ID from `message created` event — used for anchoring */
|
|
282
|
+
messageId: string | null;
|
|
283
|
+
/** Whether the stream is still active */
|
|
284
|
+
isStreaming: boolean;
|
|
285
|
+
}
|
|
286
|
+
/** Union of all node types in the flat content model */
|
|
287
|
+
type AgentContent = AgentStepNode | AgentContentNode | AgentStatusNode;
|
|
288
|
+
/** Structural node — steps form the hierarchy, NO content on them */
|
|
289
|
+
interface AgentStepNode {
|
|
290
|
+
kind: 'step';
|
|
271
291
|
id: string;
|
|
272
|
-
|
|
292
|
+
parentId: string | null;
|
|
273
293
|
type: StepType;
|
|
274
294
|
name: string;
|
|
275
|
-
/** For agent steps: the agent key (e.g., "erdo.data-analyst")
|
|
295
|
+
/** For agent steps: the agent key (e.g., "erdo.data-analyst") */
|
|
276
296
|
key?: string;
|
|
277
297
|
status: 'running' | 'completed' | 'error';
|
|
278
|
-
content: StepContentItem[];
|
|
279
298
|
error?: string;
|
|
280
|
-
/**
|
|
281
|
-
|
|
282
|
-
/** Human-readable label while step is running
|
|
283
|
-
|
|
284
|
-
/** Human-readable label when step completes
|
|
285
|
-
|
|
286
|
-
/** If true, step should not be rendered in the UI
|
|
299
|
+
/** Response format hint: 'json' | 'text' */
|
|
300
|
+
contentType?: string;
|
|
301
|
+
/** Human-readable label while step is running */
|
|
302
|
+
runningStatus?: string;
|
|
303
|
+
/** Human-readable label when step completes */
|
|
304
|
+
finishedStatus?: string;
|
|
305
|
+
/** If true, step should not be rendered in the UI */
|
|
287
306
|
hidden?: boolean;
|
|
288
|
-
/** Pre-parsed content chunks from parseMixedJson. Updated as text_delta accumulates. */
|
|
289
|
-
parsed_content?: Array<{
|
|
290
|
-
content: string | Record<string, unknown>;
|
|
291
|
-
type: 'json' | 'text';
|
|
292
|
-
}>;
|
|
293
|
-
/** Active content streams created by content_start events, keyed by content_id */
|
|
294
|
-
content_streams?: Record<string, ContentStream>;
|
|
295
307
|
}
|
|
296
|
-
/**
|
|
297
|
-
interface
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
/** Content node — flat, with optional stepId for location */
|
|
309
|
+
interface AgentContentNode {
|
|
310
|
+
kind: 'content';
|
|
311
|
+
/** Unique content ID (from message_content_id) */
|
|
312
|
+
id: string;
|
|
313
|
+
/** Location — null means root level */
|
|
314
|
+
stepId: string | null;
|
|
315
|
+
/** e.g. 'text', 'json', 'tool_invocation', 'tool_result' */
|
|
316
|
+
contentType: string;
|
|
317
|
+
/** e.g. 'markdown', 'codegen_json', 'ui_generation' */
|
|
318
|
+
uiContentType: string;
|
|
319
|
+
/** Accumulated text from deltas */
|
|
307
320
|
text: string;
|
|
308
|
-
/** Final result
|
|
321
|
+
/** Final result from message content result */
|
|
309
322
|
result?: unknown;
|
|
323
|
+
state: 'streaming' | 'completed';
|
|
324
|
+
/** For incremental JSON parsing (reuses existing parser infrastructure) */
|
|
325
|
+
parsedContent?: Array<{
|
|
326
|
+
content: string | Record<string, unknown>;
|
|
327
|
+
type: 'json' | 'text';
|
|
328
|
+
}>;
|
|
310
329
|
}
|
|
311
|
-
/**
|
|
312
|
-
interface
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
330
|
+
/** Status update node */
|
|
331
|
+
interface AgentStatusNode {
|
|
332
|
+
kind: 'status';
|
|
333
|
+
/** Step this status belongs to (null = root level) */
|
|
334
|
+
stepId: string | null;
|
|
335
|
+
message: string;
|
|
316
336
|
}
|
|
317
337
|
|
|
318
|
-
export type { AxisConfig, BotInvocationInfo, ChartConfig, ChartContent, ChartSeriesConfig, ChartType, CodeExecOutputItem, ContentItem,
|
|
338
|
+
export type { AgentContent, AgentContentNode, AgentStatusNode, AgentStepNode, AgentStreamState, AxisConfig, BotInvocationInfo, ChartConfig, ChartContent, ChartSeriesConfig, ChartType, CodeExecOutputItem, ContentItem, ContentType, CreateThreadParams, CreateTokenParams, ErdoClient, ErdoClientConfig, InvocationMode, InvocationStatus, InvokeParams, InvokeResult, ListThreadMessagesResponse, ListThreadsResponse, LogEntry, LogLevel, Message, MessageContent, Result, ResultOutput, SSEEvent, SSEEventMetadata, SendMessageParams, SeriesConfig, StepInfo, StepType, Thread, ThreadMessage, ThreadMessageContent, TokenResponse, ToolGroup, ToolInvocation, ToolResult, UIContentType, WebParseOutput, WebSearchOutput, WebSearchResult };
|