@erdoai/types 0.1.1 → 0.1.4

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/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # @erdoai/types
2
+
3
+ Shared TypeScript types for Erdo SDK packages.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @erdoai/types
9
+ # or
10
+ yarn add @erdoai/types
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import type {
17
+ ContentItem,
18
+ SSEEvent,
19
+ InvokeResult,
20
+ InvokeParams,
21
+ UIContentType,
22
+ } from '@erdoai/types';
23
+ ```
24
+
25
+ ## Types
26
+
27
+ ### Core Types
28
+
29
+ - **`ContentItem`** - Typed content with `content_type` and optional `ui_content_type`
30
+ - **`SSEEvent`** - Raw server-sent event with `type`, `payload`, `metadata`
31
+ - **`InvokeResult`** - Processed result with `messages`, `steps`, `events`, `result`
32
+ - **`InvokeParams`** - Parameters for invoking an Erdo agent
33
+
34
+ ### UI Types
35
+
36
+ - **`UIContentType`** - Content type hints for UI rendering (charts, tables, etc.)
37
+ - **`ChartData`** - Data structure for chart components
38
+ - **`TableData`** - Data structure for table components
39
+
40
+ ## Related Packages
41
+
42
+ - [`@erdoai/server`](https://www.npmjs.com/package/@erdoai/server) - Server-side client for invoking Erdo agents
43
+ - [`@erdoai/ui`](https://www.npmjs.com/package/@erdoai/ui) - React components for rendering agent results
44
+
45
+ ## License
46
+
47
+ MIT
package/dist/index.d.ts CHANGED
@@ -42,7 +42,7 @@ interface ContentItem {
42
42
  Valid: boolean;
43
43
  String: string;
44
44
  };
45
- content: string | object;
45
+ content: unknown;
46
46
  data?: unknown;
47
47
  chartConfig?: unknown;
48
48
  chartData?: unknown[];
@@ -137,5 +137,54 @@ interface ErdoClient {
137
137
  invoke(botKey: string, params?: InvokeParams): Promise<InvokeResult>;
138
138
  invokeStream(botKey: string, params?: InvokeParams): AsyncGenerator<SSEEvent, void, unknown>;
139
139
  }
140
+ interface ToolInvocation {
141
+ invocation_id: string;
142
+ action: string;
143
+ params: Record<string, unknown>;
144
+ }
145
+ interface ToolResult {
146
+ invocation_id: string;
147
+ result: unknown;
148
+ }
149
+ interface ToolGroup {
150
+ invocation: ToolInvocation;
151
+ result?: ToolResult;
152
+ }
153
+ type LogLevel = 'info' | 'error' | 'requires_info';
154
+ interface LogEntry {
155
+ level: LogLevel;
156
+ message: string;
157
+ timestamp?: string;
158
+ }
159
+ interface WebSearchResult {
160
+ title: string;
161
+ description: string;
162
+ url: string;
163
+ }
164
+ interface WebSearchOutput {
165
+ results: WebSearchResult[];
166
+ }
167
+ interface WebParseOutput {
168
+ title: string;
169
+ description: string;
170
+ content: string;
171
+ url: string;
172
+ }
173
+ interface CodeExecOutputItem {
174
+ index: number;
175
+ level: 'output' | 'error' | 'warning';
176
+ message: string;
177
+ timestamp?: string;
178
+ }
179
+ type InvocationStatus = 'pending' | 'running' | 'success' | 'error' | 'requires info' | 'go to step' | 'skipped' | 'break' | 'cancelled';
180
+ interface BotInvocationInfo {
181
+ id: string;
182
+ bot_id: string;
183
+ bot_key: string;
184
+ bot_name?: string;
185
+ status: InvocationStatus;
186
+ started_at?: string;
187
+ completed_at?: string;
188
+ }
140
189
 
141
- export type { AxisConfig, ChartConfig, ChartContent, ChartSeriesConfig, ChartType, ContentItem, ContentType, ErdoClient, ErdoClientConfig, InvocationMode, InvokeParams, InvokeResult, Message, MessageContent, Result, ResultOutput, SSEEvent, SSEEventMetadata, SeriesConfig, StepInfo, UIContentType };
190
+ export type { AxisConfig, BotInvocationInfo, ChartConfig, ChartContent, ChartSeriesConfig, ChartType, CodeExecOutputItem, ContentItem, ContentType, ErdoClient, ErdoClientConfig, InvocationMode, InvocationStatus, InvokeParams, InvokeResult, LogEntry, LogLevel, Message, MessageContent, Result, ResultOutput, SSEEvent, SSEEventMetadata, SeriesConfig, StepInfo, ToolGroup, ToolInvocation, ToolResult, UIContentType, WebParseOutput, WebSearchOutput, WebSearchResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/types",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "Erdo SDK shared types",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",