@tuttiai/types 0.2.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 +58 -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,40 @@ 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;
|
|
91
126
|
/** Agent IDs this agent can delegate to via the orchestrator. */
|
|
92
127
|
delegates?: string[];
|
|
93
128
|
/** Role in the orchestration — orchestrator receives input first. */
|
|
@@ -103,6 +138,11 @@ interface AgentResult {
|
|
|
103
138
|
|
|
104
139
|
/** Score — the top-level configuration file (tutti.score.ts). */
|
|
105
140
|
|
|
141
|
+
interface MemoryConfig {
|
|
142
|
+
provider: "in-memory" | "postgres" | "redis";
|
|
143
|
+
/** Connection URL (e.g. DATABASE_URL for postgres). */
|
|
144
|
+
url?: string;
|
|
145
|
+
}
|
|
106
146
|
interface ScoreConfig {
|
|
107
147
|
name?: string;
|
|
108
148
|
description?: string;
|
|
@@ -111,6 +151,8 @@ interface ScoreConfig {
|
|
|
111
151
|
default_model?: string;
|
|
112
152
|
/** Which agent is the entry point (default: "orchestrator"). */
|
|
113
153
|
entry?: string;
|
|
154
|
+
/** Session storage configuration (default: in-memory). */
|
|
155
|
+
memory?: MemoryConfig;
|
|
114
156
|
}
|
|
115
157
|
|
|
116
158
|
/** Session types for conversation state management. */
|
|
@@ -181,10 +223,25 @@ type TuttiEvent = {
|
|
|
181
223
|
from: string;
|
|
182
224
|
to: string;
|
|
183
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;
|
|
184
241
|
};
|
|
185
242
|
type TuttiEventType = TuttiEvent["type"];
|
|
186
243
|
type TuttiEventHandler<T extends TuttiEventType = TuttiEventType> = (event: Extract<TuttiEvent, {
|
|
187
244
|
type: T;
|
|
188
245
|
}>) => void;
|
|
189
246
|
|
|
190
|
-
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",
|