@tuttiai/types 0.3.0 → 0.5.0
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.ts +31 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -47,8 +47,23 @@ interface TokenUsage {
|
|
|
47
47
|
input_tokens: number;
|
|
48
48
|
output_tokens: number;
|
|
49
49
|
}
|
|
50
|
+
interface StreamChunk {
|
|
51
|
+
type: "text" | "tool_use" | "usage";
|
|
52
|
+
text?: string;
|
|
53
|
+
tool?: {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
input: unknown;
|
|
57
|
+
};
|
|
58
|
+
usage?: {
|
|
59
|
+
input_tokens: number;
|
|
60
|
+
output_tokens: number;
|
|
61
|
+
};
|
|
62
|
+
stop_reason?: StopReason;
|
|
63
|
+
}
|
|
50
64
|
interface LLMProvider {
|
|
51
65
|
chat(request: ChatRequest): Promise<ChatResponse>;
|
|
66
|
+
stream(request: ChatRequest): AsyncIterable<StreamChunk>;
|
|
52
67
|
}
|
|
53
68
|
|
|
54
69
|
/** Voice — a pluggable module that gives agents tools and capabilities. */
|
|
@@ -123,6 +138,8 @@ interface AgentConfig {
|
|
|
123
138
|
budget?: BudgetConfig;
|
|
124
139
|
/** Semantic (long-term) memory configuration. */
|
|
125
140
|
semantic_memory?: AgentMemoryConfig;
|
|
141
|
+
/** Enable token-by-token streaming (default: false). */
|
|
142
|
+
streaming?: boolean;
|
|
126
143
|
/** Agent IDs this agent can delegate to via the orchestrator. */
|
|
127
144
|
delegates?: string[];
|
|
128
145
|
/** Role in the orchestration — orchestrator receives input first. */
|
|
@@ -143,6 +160,13 @@ interface MemoryConfig {
|
|
|
143
160
|
/** Connection URL (e.g. DATABASE_URL for postgres). */
|
|
144
161
|
url?: string;
|
|
145
162
|
}
|
|
163
|
+
interface TelemetryConfig {
|
|
164
|
+
enabled: boolean;
|
|
165
|
+
/** OTLP HTTP endpoint (default: http://localhost:4318). */
|
|
166
|
+
endpoint?: string;
|
|
167
|
+
/** Extra headers sent with OTLP requests (e.g. auth tokens). */
|
|
168
|
+
headers?: Record<string, string>;
|
|
169
|
+
}
|
|
146
170
|
interface ScoreConfig {
|
|
147
171
|
name?: string;
|
|
148
172
|
description?: string;
|
|
@@ -153,6 +177,8 @@ interface ScoreConfig {
|
|
|
153
177
|
entry?: string;
|
|
154
178
|
/** Session storage configuration (default: in-memory). */
|
|
155
179
|
memory?: MemoryConfig;
|
|
180
|
+
/** OpenTelemetry tracing configuration. */
|
|
181
|
+
telemetry?: TelemetryConfig;
|
|
156
182
|
}
|
|
157
183
|
|
|
158
184
|
/** Session types for conversation state management. */
|
|
@@ -238,10 +264,14 @@ type TuttiEvent = {
|
|
|
238
264
|
agent_name: string;
|
|
239
265
|
tokens: number;
|
|
240
266
|
cost_usd: number;
|
|
267
|
+
} | {
|
|
268
|
+
type: "token:stream";
|
|
269
|
+
agent_name: string;
|
|
270
|
+
text: string;
|
|
241
271
|
};
|
|
242
272
|
type TuttiEventType = TuttiEvent["type"];
|
|
243
273
|
type TuttiEventHandler<T extends TuttiEventType = TuttiEventType> = (event: Extract<TuttiEvent, {
|
|
244
274
|
type: T;
|
|
245
275
|
}>) => void;
|
|
246
276
|
|
|
247
|
-
export type { AgentConfig, AgentMemoryConfig, AgentResult, BudgetConfig, ChatMessage, ChatRequest, ChatResponse, ContentBlock, LLMProvider, MemoryConfig, Permission, ScoreConfig, Session, SessionStore, StopReason, TextBlock, TokenUsage, Tool, ToolContext, ToolDefinition, ToolMemoryHelpers, ToolResult, ToolResultBlock, ToolUseBlock, TuttiEvent, TuttiEventHandler, TuttiEventType, Voice, VoiceContext };
|
|
277
|
+
export type { AgentConfig, AgentMemoryConfig, AgentResult, BudgetConfig, ChatMessage, ChatRequest, ChatResponse, ContentBlock, LLMProvider, MemoryConfig, Permission, ScoreConfig, Session, SessionStore, StopReason, StreamChunk, TelemetryConfig, TextBlock, TokenUsage, Tool, ToolContext, ToolDefinition, ToolMemoryHelpers, ToolResult, ToolResultBlock, ToolUseBlock, TuttiEvent, TuttiEventHandler, TuttiEventType, Voice, VoiceContext };
|