@tuttiai/types 0.1.0 → 0.3.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 +74 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -53,13 +53,27 @@ interface LLMProvider {
|
|
|
53
53
|
|
|
54
54
|
/** Voice — a pluggable module that gives agents tools and capabilities. */
|
|
55
55
|
|
|
56
|
+
type Permission = "network" | "filesystem" | "shell" | "browser";
|
|
56
57
|
interface ToolResult {
|
|
57
58
|
content: string;
|
|
58
59
|
is_error?: boolean;
|
|
59
60
|
}
|
|
61
|
+
interface ToolMemoryHelpers {
|
|
62
|
+
/** Store a fact the agent should remember across sessions. */
|
|
63
|
+
remember(content: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
64
|
+
/** Search for relevant memories. */
|
|
65
|
+
recall(query: string, limit?: number): Promise<{
|
|
66
|
+
id: string;
|
|
67
|
+
content: string;
|
|
68
|
+
}[]>;
|
|
69
|
+
/** Delete a specific memory by ID. */
|
|
70
|
+
forget(id: string): Promise<void>;
|
|
71
|
+
}
|
|
60
72
|
interface ToolContext {
|
|
61
73
|
session_id: string;
|
|
62
74
|
agent_name: string;
|
|
75
|
+
/** Semantic memory helpers — only available when agent.semantic_memory.enabled is true. */
|
|
76
|
+
memory?: ToolMemoryHelpers;
|
|
63
77
|
}
|
|
64
78
|
interface Tool<T = unknown> {
|
|
65
79
|
name: string;
|
|
@@ -75,19 +89,44 @@ interface Voice {
|
|
|
75
89
|
name: string;
|
|
76
90
|
description?: string;
|
|
77
91
|
tools: Tool[];
|
|
92
|
+
required_permissions: Permission[];
|
|
78
93
|
setup?(context: VoiceContext): Promise<void>;
|
|
79
94
|
teardown?(): Promise<void>;
|
|
80
95
|
}
|
|
81
96
|
|
|
82
97
|
/** Agent configuration and result types. */
|
|
83
98
|
|
|
99
|
+
interface BudgetConfig {
|
|
100
|
+
max_tokens?: number;
|
|
101
|
+
max_cost_usd?: number;
|
|
102
|
+
/** Percentage at which to emit a warning (default 80). */
|
|
103
|
+
warn_at_percent?: number;
|
|
104
|
+
}
|
|
105
|
+
interface AgentMemoryConfig {
|
|
106
|
+
/** Enable semantic memory for this agent. */
|
|
107
|
+
enabled: boolean;
|
|
108
|
+
/** Max memory entries to inject per LLM call (default 5). */
|
|
109
|
+
max_memories?: number;
|
|
110
|
+
/** Inject memories into the system prompt (default true). */
|
|
111
|
+
inject_system?: boolean;
|
|
112
|
+
}
|
|
84
113
|
interface AgentConfig {
|
|
85
114
|
name: string;
|
|
86
115
|
description?: string;
|
|
87
116
|
model?: string;
|
|
88
117
|
system_prompt: string;
|
|
89
118
|
voices: Voice[];
|
|
119
|
+
permissions?: Permission[];
|
|
90
120
|
max_turns?: number;
|
|
121
|
+
max_tool_calls?: number;
|
|
122
|
+
tool_timeout_ms?: number;
|
|
123
|
+
budget?: BudgetConfig;
|
|
124
|
+
/** Semantic (long-term) memory configuration. */
|
|
125
|
+
semantic_memory?: AgentMemoryConfig;
|
|
126
|
+
/** Agent IDs this agent can delegate to via the orchestrator. */
|
|
127
|
+
delegates?: string[];
|
|
128
|
+
/** Role in the orchestration — orchestrator receives input first. */
|
|
129
|
+
role?: "orchestrator" | "specialist";
|
|
91
130
|
}
|
|
92
131
|
interface AgentResult {
|
|
93
132
|
session_id: string;
|
|
@@ -99,12 +138,21 @@ interface AgentResult {
|
|
|
99
138
|
|
|
100
139
|
/** Score — the top-level configuration file (tutti.score.ts). */
|
|
101
140
|
|
|
141
|
+
interface MemoryConfig {
|
|
142
|
+
provider: "in-memory" | "postgres" | "redis";
|
|
143
|
+
/** Connection URL (e.g. DATABASE_URL for postgres). */
|
|
144
|
+
url?: string;
|
|
145
|
+
}
|
|
102
146
|
interface ScoreConfig {
|
|
103
147
|
name?: string;
|
|
104
148
|
description?: string;
|
|
105
149
|
agents: Record<string, AgentConfig>;
|
|
106
150
|
provider: LLMProvider;
|
|
107
151
|
default_model?: string;
|
|
152
|
+
/** Which agent is the entry point (default: "orchestrator"). */
|
|
153
|
+
entry?: string;
|
|
154
|
+
/** Session storage configuration (default: in-memory). */
|
|
155
|
+
memory?: MemoryConfig;
|
|
108
156
|
}
|
|
109
157
|
|
|
110
158
|
/** Session types for conversation state management. */
|
|
@@ -165,10 +213,35 @@ type TuttiEvent = {
|
|
|
165
213
|
agent_name: string;
|
|
166
214
|
session_id: string;
|
|
167
215
|
turn: number;
|
|
216
|
+
} | {
|
|
217
|
+
type: "delegate:start";
|
|
218
|
+
from: string;
|
|
219
|
+
to: string;
|
|
220
|
+
task: string;
|
|
221
|
+
} | {
|
|
222
|
+
type: "delegate:end";
|
|
223
|
+
from: string;
|
|
224
|
+
to: string;
|
|
225
|
+
output: string;
|
|
226
|
+
} | {
|
|
227
|
+
type: "security:injection_detected";
|
|
228
|
+
agent_name: string;
|
|
229
|
+
tool_name: string;
|
|
230
|
+
patterns: string[];
|
|
231
|
+
} | {
|
|
232
|
+
type: "budget:warning";
|
|
233
|
+
agent_name: string;
|
|
234
|
+
tokens: number;
|
|
235
|
+
cost_usd: number;
|
|
236
|
+
} | {
|
|
237
|
+
type: "budget:exceeded";
|
|
238
|
+
agent_name: string;
|
|
239
|
+
tokens: number;
|
|
240
|
+
cost_usd: number;
|
|
168
241
|
};
|
|
169
242
|
type TuttiEventType = TuttiEvent["type"];
|
|
170
243
|
type TuttiEventHandler<T extends TuttiEventType = TuttiEventType> = (event: Extract<TuttiEvent, {
|
|
171
244
|
type: T;
|
|
172
245
|
}>) => void;
|
|
173
246
|
|
|
174
|
-
export type { AgentConfig, AgentResult, ChatMessage, ChatRequest, ChatResponse, ContentBlock, LLMProvider, ScoreConfig, Session, SessionStore, StopReason, TextBlock, TokenUsage, Tool, ToolContext, ToolDefinition, ToolResult, ToolResultBlock, ToolUseBlock, TuttiEvent, TuttiEventHandler, TuttiEventType, Voice, VoiceContext };
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuttiai/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Type definitions for the Tutti multi-agent orchestration framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"typecheck": "tsc --noEmit"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"zod": "
|
|
21
|
+
"zod": "3.25.76"
|
|
22
22
|
},
|
|
23
23
|
"keywords": ["tutti", "ai", "agents", "orchestration", "types", "typescript"],
|
|
24
24
|
"license": "MIT",
|