@tuttiai/types 0.4.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 +22 -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. */
|
|
@@ -247,10 +264,14 @@ type TuttiEvent = {
|
|
|
247
264
|
agent_name: string;
|
|
248
265
|
tokens: number;
|
|
249
266
|
cost_usd: number;
|
|
267
|
+
} | {
|
|
268
|
+
type: "token:stream";
|
|
269
|
+
agent_name: string;
|
|
270
|
+
text: string;
|
|
250
271
|
};
|
|
251
272
|
type TuttiEventType = TuttiEvent["type"];
|
|
252
273
|
type TuttiEventHandler<T extends TuttiEventType = TuttiEventType> = (event: Extract<TuttiEvent, {
|
|
253
274
|
type: T;
|
|
254
275
|
}>) => void;
|
|
255
276
|
|
|
256
|
-
export type { AgentConfig, AgentMemoryConfig, AgentResult, BudgetConfig, ChatMessage, ChatRequest, ChatResponse, ContentBlock, LLMProvider, MemoryConfig, Permission, ScoreConfig, Session, SessionStore, StopReason, TelemetryConfig, 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 };
|