@tuttiai/types 0.1.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/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tutti AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @tuttiai/types
|
|
2
|
+
|
|
3
|
+
Type definitions for the [Tutti](https://tutti-ai.com) multi-agent orchestration framework.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @tuttiai/types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What's included
|
|
12
|
+
|
|
13
|
+
All core interfaces for building on Tutti:
|
|
14
|
+
|
|
15
|
+
- **LLM** — `LLMProvider`, `ChatRequest`, `ChatResponse`, `ContentBlock`, `ChatMessage`
|
|
16
|
+
- **Voice** — `Voice`, `Tool<T>`, `ToolResult`, `ToolContext`
|
|
17
|
+
- **Agent** — `AgentConfig`, `AgentResult`
|
|
18
|
+
- **Score** — `ScoreConfig`
|
|
19
|
+
- **Session** — `Session`, `SessionStore`
|
|
20
|
+
- **Events** — `TuttiEvent`, `TuttiEventType`, `TuttiEventHandler`
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import type { Voice, Tool, LLMProvider } from "@tuttiai/types";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Most users should install `@tuttiai/core` instead — it re-exports all types from this package along with the runtime implementation.
|
|
29
|
+
|
|
30
|
+
## Links
|
|
31
|
+
|
|
32
|
+
- [Tutti](https://tutti-ai.com)
|
|
33
|
+
- [GitHub](https://github.com/tuttiai/tutti/tree/main/packages/types)
|
|
34
|
+
- [Docs](https://tutti-ai.com/docs)
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Model-agnostic LLM provider interface. */
|
|
4
|
+
interface TextBlock {
|
|
5
|
+
type: "text";
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
interface ToolUseBlock {
|
|
9
|
+
type: "tool_use";
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
input: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface ToolResultBlock {
|
|
15
|
+
type: "tool_result";
|
|
16
|
+
tool_use_id: string;
|
|
17
|
+
content: string;
|
|
18
|
+
is_error?: boolean;
|
|
19
|
+
}
|
|
20
|
+
type ContentBlock = TextBlock | ToolUseBlock | ToolResultBlock;
|
|
21
|
+
interface ChatMessage {
|
|
22
|
+
role: "user" | "assistant";
|
|
23
|
+
content: string | ContentBlock[];
|
|
24
|
+
}
|
|
25
|
+
type StopReason = "end_turn" | "tool_use" | "max_tokens" | "stop_sequence";
|
|
26
|
+
interface ToolDefinition {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
input_schema: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
interface ChatRequest {
|
|
32
|
+
model?: string;
|
|
33
|
+
messages: ChatMessage[];
|
|
34
|
+
system?: string;
|
|
35
|
+
tools?: ToolDefinition[];
|
|
36
|
+
max_tokens?: number;
|
|
37
|
+
temperature?: number;
|
|
38
|
+
stop_sequences?: string[];
|
|
39
|
+
}
|
|
40
|
+
interface ChatResponse {
|
|
41
|
+
id: string;
|
|
42
|
+
content: ContentBlock[];
|
|
43
|
+
stop_reason: StopReason;
|
|
44
|
+
usage: TokenUsage;
|
|
45
|
+
}
|
|
46
|
+
interface TokenUsage {
|
|
47
|
+
input_tokens: number;
|
|
48
|
+
output_tokens: number;
|
|
49
|
+
}
|
|
50
|
+
interface LLMProvider {
|
|
51
|
+
chat(request: ChatRequest): Promise<ChatResponse>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Voice — a pluggable module that gives agents tools and capabilities. */
|
|
55
|
+
|
|
56
|
+
interface ToolResult {
|
|
57
|
+
content: string;
|
|
58
|
+
is_error?: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface ToolContext {
|
|
61
|
+
session_id: string;
|
|
62
|
+
agent_name: string;
|
|
63
|
+
}
|
|
64
|
+
interface Tool<T = unknown> {
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
parameters: ZodType<T, any, any>;
|
|
68
|
+
execute(input: T, context: ToolContext): Promise<ToolResult>;
|
|
69
|
+
}
|
|
70
|
+
interface VoiceContext {
|
|
71
|
+
session_id: string;
|
|
72
|
+
agent_name: string;
|
|
73
|
+
}
|
|
74
|
+
interface Voice {
|
|
75
|
+
name: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
tools: Tool[];
|
|
78
|
+
setup?(context: VoiceContext): Promise<void>;
|
|
79
|
+
teardown?(): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Agent configuration and result types. */
|
|
83
|
+
|
|
84
|
+
interface AgentConfig {
|
|
85
|
+
name: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
model?: string;
|
|
88
|
+
system_prompt: string;
|
|
89
|
+
voices: Voice[];
|
|
90
|
+
max_turns?: number;
|
|
91
|
+
}
|
|
92
|
+
interface AgentResult {
|
|
93
|
+
session_id: string;
|
|
94
|
+
output: string;
|
|
95
|
+
messages: ChatMessage[];
|
|
96
|
+
turns: number;
|
|
97
|
+
usage: TokenUsage;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Score — the top-level configuration file (tutti.score.ts). */
|
|
101
|
+
|
|
102
|
+
interface ScoreConfig {
|
|
103
|
+
name?: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
agents: Record<string, AgentConfig>;
|
|
106
|
+
provider: LLMProvider;
|
|
107
|
+
default_model?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Session types for conversation state management. */
|
|
111
|
+
|
|
112
|
+
interface Session {
|
|
113
|
+
id: string;
|
|
114
|
+
agent_name: string;
|
|
115
|
+
messages: ChatMessage[];
|
|
116
|
+
created_at: Date;
|
|
117
|
+
updated_at: Date;
|
|
118
|
+
}
|
|
119
|
+
interface SessionStore {
|
|
120
|
+
create(agent_name: string): Session;
|
|
121
|
+
get(id: string): Session | undefined;
|
|
122
|
+
update(id: string, messages: ChatMessage[]): void;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Event types for the observability EventBus. */
|
|
126
|
+
|
|
127
|
+
type TuttiEvent = {
|
|
128
|
+
type: "agent:start";
|
|
129
|
+
agent_name: string;
|
|
130
|
+
session_id: string;
|
|
131
|
+
} | {
|
|
132
|
+
type: "agent:end";
|
|
133
|
+
agent_name: string;
|
|
134
|
+
session_id: string;
|
|
135
|
+
} | {
|
|
136
|
+
type: "llm:request";
|
|
137
|
+
agent_name: string;
|
|
138
|
+
request: ChatRequest;
|
|
139
|
+
} | {
|
|
140
|
+
type: "llm:response";
|
|
141
|
+
agent_name: string;
|
|
142
|
+
response: ChatResponse;
|
|
143
|
+
} | {
|
|
144
|
+
type: "tool:start";
|
|
145
|
+
agent_name: string;
|
|
146
|
+
tool_name: string;
|
|
147
|
+
input: unknown;
|
|
148
|
+
} | {
|
|
149
|
+
type: "tool:end";
|
|
150
|
+
agent_name: string;
|
|
151
|
+
tool_name: string;
|
|
152
|
+
result: ToolResult;
|
|
153
|
+
} | {
|
|
154
|
+
type: "tool:error";
|
|
155
|
+
agent_name: string;
|
|
156
|
+
tool_name: string;
|
|
157
|
+
error: Error;
|
|
158
|
+
} | {
|
|
159
|
+
type: "turn:start";
|
|
160
|
+
agent_name: string;
|
|
161
|
+
session_id: string;
|
|
162
|
+
turn: number;
|
|
163
|
+
} | {
|
|
164
|
+
type: "turn:end";
|
|
165
|
+
agent_name: string;
|
|
166
|
+
session_id: string;
|
|
167
|
+
turn: number;
|
|
168
|
+
};
|
|
169
|
+
type TuttiEventType = TuttiEvent["type"];
|
|
170
|
+
type TuttiEventHandler<T extends TuttiEventType = TuttiEventType> = (event: Extract<TuttiEvent, {
|
|
171
|
+
type: T;
|
|
172
|
+
}>) => void;
|
|
173
|
+
|
|
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 };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tuttiai/types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Type definitions for the Tutti multi-agent orchestration framework",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsup",
|
|
17
|
+
"dev": "tsup --watch",
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"zod": "^3.24.0"
|
|
22
|
+
},
|
|
23
|
+
"keywords": ["tutti", "ai", "agents", "orchestration", "types", "typescript"],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/tuttiai/tutti",
|
|
28
|
+
"directory": "packages/types"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://tutti-ai.com"
|
|
31
|
+
}
|