@tuttiai/types 0.2.0 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +67 -1
  2. 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,18 @@ 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
+ }
146
+ interface TelemetryConfig {
147
+ enabled: boolean;
148
+ /** OTLP HTTP endpoint (default: http://localhost:4318). */
149
+ endpoint?: string;
150
+ /** Extra headers sent with OTLP requests (e.g. auth tokens). */
151
+ headers?: Record<string, string>;
152
+ }
106
153
  interface ScoreConfig {
107
154
  name?: string;
108
155
  description?: string;
@@ -111,6 +158,10 @@ interface ScoreConfig {
111
158
  default_model?: string;
112
159
  /** Which agent is the entry point (default: "orchestrator"). */
113
160
  entry?: string;
161
+ /** Session storage configuration (default: in-memory). */
162
+ memory?: MemoryConfig;
163
+ /** OpenTelemetry tracing configuration. */
164
+ telemetry?: TelemetryConfig;
114
165
  }
115
166
 
116
167
  /** Session types for conversation state management. */
@@ -181,10 +232,25 @@ type TuttiEvent = {
181
232
  from: string;
182
233
  to: string;
183
234
  output: string;
235
+ } | {
236
+ type: "security:injection_detected";
237
+ agent_name: string;
238
+ tool_name: string;
239
+ patterns: string[];
240
+ } | {
241
+ type: "budget:warning";
242
+ agent_name: string;
243
+ tokens: number;
244
+ cost_usd: number;
245
+ } | {
246
+ type: "budget:exceeded";
247
+ agent_name: string;
248
+ tokens: number;
249
+ cost_usd: number;
184
250
  };
185
251
  type TuttiEventType = TuttiEvent["type"];
186
252
  type TuttiEventHandler<T extends TuttiEventType = TuttiEventType> = (event: Extract<TuttiEvent, {
187
253
  type: T;
188
254
  }>) => void;
189
255
 
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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuttiai/types",
3
- "version": "0.2.0",
3
+ "version": "0.4.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": "^3.24.0"
21
+ "zod": "3.25.76"
22
22
  },
23
23
  "keywords": ["tutti", "ai", "agents", "orchestration", "types", "typescript"],
24
24
  "license": "MIT",