@erdoai/types 0.1.4 → 0.1.5

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.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/index.ts
17
+ var index_exports = {};
18
+ module.exports = __toCommonJS(index_exports);
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Erdo TypeScript SDK Types
3
+ *
4
+ * TODO: Auto-generate from Go types via `erdo gen-ts-client`
5
+ * These types mirror erdo-python-sdk/erdo/_generated/types.py
6
+ */
7
+ interface Message {
8
+ role: 'user' | 'assistant' | 'system';
9
+ content: string;
10
+ }
11
+ interface InvokeParams {
12
+ /** Messages to send to the agent */
13
+ messages?: Message[];
14
+ /** Parameters to pass to the agent */
15
+ parameters?: Record<string, unknown>;
16
+ /** Dataset slugs to include (e.g. ["my-dataset"] or ["org.my-dataset"]) */
17
+ datasets?: string[];
18
+ /** Invocation mode */
19
+ mode?: InvocationMode;
20
+ /** Manual mock responses for mode="manual" */
21
+ manualMocks?: Record<string, unknown>;
22
+ }
23
+ type InvocationMode = 'live' | 'replay' | 'manual' | {
24
+ mode: 'replay';
25
+ refresh?: boolean;
26
+ };
27
+ interface Result {
28
+ status?: string;
29
+ parameters?: Record<string, unknown>;
30
+ output?: ResultOutput;
31
+ message?: string;
32
+ error?: string;
33
+ }
34
+ interface ResultOutput {
35
+ content?: ContentItem[];
36
+ [key: string]: unknown;
37
+ }
38
+ interface ContentItem {
39
+ id?: string;
40
+ content_type: ContentType | string;
41
+ ui_content_type?: UIContentType | {
42
+ Valid: boolean;
43
+ String: string;
44
+ };
45
+ content: unknown;
46
+ data?: unknown;
47
+ chartConfig?: unknown;
48
+ chartData?: unknown[];
49
+ tableColumns?: Array<{
50
+ column_name: string;
51
+ key: string;
52
+ format?: string;
53
+ value_type?: 'number' | 'category' | 'date';
54
+ }>;
55
+ tableData?: unknown[];
56
+ [key: string]: unknown;
57
+ }
58
+ type ContentType = 'text' | 'json' | 'code' | 'table' | 'image' | 'error';
59
+ type UIContentType = 'chart' | 'bar_chart' | 'line_chart' | 'pie_chart' | 'scatter_chart' | 'heatmap' | 'table' | 'markdown' | string;
60
+ interface InvokeResult {
61
+ /** Whether the invocation succeeded */
62
+ success: boolean;
63
+ /** Bot identifier */
64
+ botId?: string;
65
+ /** Unique invocation ID */
66
+ invocationId?: string;
67
+ /** The actual bot result */
68
+ result?: Result;
69
+ /** Messages from the invocation */
70
+ messages: MessageContent[];
71
+ /** All raw SSE events (for debugging/analysis) */
72
+ events: SSEEvent[];
73
+ /** Step execution info */
74
+ steps: StepInfo[];
75
+ /** Error message if failed */
76
+ error?: string;
77
+ }
78
+ interface MessageContent {
79
+ role: 'user' | 'assistant' | 'system';
80
+ content: string;
81
+ }
82
+ interface StepInfo {
83
+ key: string;
84
+ action: string;
85
+ status: 'pending' | 'running' | 'completed' | 'failed';
86
+ }
87
+ interface SSEEvent {
88
+ type?: string;
89
+ payload?: unknown;
90
+ metadata?: SSEEventMetadata;
91
+ [key: string]: unknown;
92
+ }
93
+ interface SSEEventMetadata {
94
+ user_visibility?: 'visible' | 'hidden';
95
+ bot_visibility?: 'visible' | 'hidden';
96
+ content_type?: ContentType;
97
+ ui_content_type?: UIContentType;
98
+ message_content_id?: string;
99
+ [key: string]: unknown;
100
+ }
101
+ interface ChartConfig {
102
+ type: ChartType;
103
+ title?: string;
104
+ xAxis?: AxisConfig;
105
+ yAxis?: AxisConfig;
106
+ series?: SeriesConfig[];
107
+ chartConfig?: Record<string, ChartSeriesConfig>;
108
+ }
109
+ type ChartType = 'bar' | 'line' | 'pie' | 'scatter' | 'area' | 'heatmap';
110
+ interface AxisConfig {
111
+ label?: string;
112
+ dataKey?: string;
113
+ type?: 'category' | 'number' | 'time';
114
+ }
115
+ interface SeriesConfig {
116
+ dataKey: string;
117
+ name?: string;
118
+ color?: string;
119
+ }
120
+ interface ChartSeriesConfig {
121
+ label: string;
122
+ color?: string;
123
+ }
124
+ interface ChartContent extends ContentItem {
125
+ ui_content_type: 'chart' | 'bar_chart' | 'line_chart' | 'pie_chart' | 'scatter_chart';
126
+ data: unknown[];
127
+ config?: ChartConfig;
128
+ }
129
+ interface ErdoClientConfig {
130
+ /** API endpoint URL */
131
+ endpoint?: string;
132
+ /** Authentication token (API key) */
133
+ authToken?: string;
134
+ }
135
+ /** Interface for ErdoClient - implemented by @erdoai/server */
136
+ interface ErdoClient {
137
+ invoke(botKey: string, params?: InvokeParams): Promise<InvokeResult>;
138
+ invokeStream(botKey: string, params?: InvokeParams): AsyncGenerator<SSEEvent, void, unknown>;
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
+ }
189
+
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.4",
3
+ "version": "0.1.5",
4
4
  "description": "Erdo SDK shared types",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -9,7 +9,8 @@
9
9
  "exports": {
10
10
  ".": {
11
11
  "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js"
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
13
14
  }
14
15
  },
15
16
  "files": [