@lov3kaizen/agentsea-core 0.1.1 → 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.mts +5 -333
- package/dist/index.d.ts +5 -333
- package/dist/index.js +51 -11
- package/dist/index.mjs +160 -10
- package/package.json +5 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,197 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tool, ToolCall, ToolContext, AgentConfig, LLMProvider, MemoryStore, AgentContext, AgentResponse, StreamEvent, Message, ProviderConfig, LLMResponse, LLMStreamChunk, WorkflowConfig, AgentMetrics, SpanContext, OutputFormat, FormatOptions, FormattedContent, VoiceAgentConfig, VoiceMessage, STTConfig, TTSConfig, STTProvider, STTResult, TTSProvider, TTSResult, AudioFormat, TenantStorage, Tenant, TenantStatus, TenantApiKey, TenantQuota } from '@lov3kaizen/agentsea-types';
|
|
2
|
+
export * from '@lov3kaizen/agentsea-types';
|
|
3
|
+
export { AudioFormat, STTConfig, STTProvider, STTResult, TTSConfig, TTSProvider, TTSResult, Tenant, TenantApiKey, TenantContext, TenantQuota, TenantResolver, TenantSettings, TenantStatus, TenantStorage, VoiceAgentConfig, VoiceMessage, VoiceType } from '@lov3kaizen/agentsea-types';
|
|
2
4
|
import { EventEmitter } from 'events';
|
|
3
|
-
|
|
4
|
-
interface Message {
|
|
5
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
6
|
-
content: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
toolCallId?: string;
|
|
9
|
-
}
|
|
10
|
-
type OutputFormat = 'text' | 'markdown' | 'html' | 'react';
|
|
11
|
-
interface FormatOptions {
|
|
12
|
-
includeMetadata?: boolean;
|
|
13
|
-
sanitizeHtml?: boolean;
|
|
14
|
-
highlightCode?: boolean;
|
|
15
|
-
theme?: 'light' | 'dark' | 'auto';
|
|
16
|
-
}
|
|
17
|
-
interface AgentConfig {
|
|
18
|
-
name: string;
|
|
19
|
-
description: string;
|
|
20
|
-
model: string;
|
|
21
|
-
provider: string;
|
|
22
|
-
systemPrompt?: string;
|
|
23
|
-
tools?: Tool[];
|
|
24
|
-
temperature?: number;
|
|
25
|
-
maxTokens?: number;
|
|
26
|
-
maxIterations?: number;
|
|
27
|
-
memory?: MemoryConfig;
|
|
28
|
-
providerConfig?: ProviderInstanceConfig;
|
|
29
|
-
outputFormat?: OutputFormat;
|
|
30
|
-
formatOptions?: FormatOptions;
|
|
31
|
-
}
|
|
32
|
-
interface ProviderInstanceConfig {
|
|
33
|
-
baseUrl?: string;
|
|
34
|
-
apiKey?: string;
|
|
35
|
-
timeout?: number;
|
|
36
|
-
defaultHeaders?: Record<string, string>;
|
|
37
|
-
organization?: string;
|
|
38
|
-
}
|
|
39
|
-
interface AgentContext {
|
|
40
|
-
conversationId: string;
|
|
41
|
-
userId?: string;
|
|
42
|
-
sessionData: Record<string, any>;
|
|
43
|
-
history: Message[];
|
|
44
|
-
metadata?: Record<string, any>;
|
|
45
|
-
}
|
|
46
|
-
interface FormattedContent {
|
|
47
|
-
raw: string;
|
|
48
|
-
format: OutputFormat;
|
|
49
|
-
rendered?: string;
|
|
50
|
-
metadata?: {
|
|
51
|
-
hasCodeBlocks?: boolean;
|
|
52
|
-
hasTables?: boolean;
|
|
53
|
-
hasLists?: boolean;
|
|
54
|
-
links?: Array<{
|
|
55
|
-
text: string;
|
|
56
|
-
url: string;
|
|
57
|
-
}>;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
interface AgentResponse {
|
|
61
|
-
content: string;
|
|
62
|
-
formatted?: FormattedContent;
|
|
63
|
-
toolCalls?: ToolCall[];
|
|
64
|
-
metadata: {
|
|
65
|
-
tokensUsed: number;
|
|
66
|
-
latencyMs: number;
|
|
67
|
-
iterations: number;
|
|
68
|
-
cost?: number;
|
|
69
|
-
};
|
|
70
|
-
nextAgent?: string;
|
|
71
|
-
finishReason?: 'stop' | 'length' | 'tool_calls' | 'error';
|
|
72
|
-
}
|
|
73
|
-
interface Tool {
|
|
74
|
-
name: string;
|
|
75
|
-
description: string;
|
|
76
|
-
parameters: z.ZodSchema;
|
|
77
|
-
execute: (params: any, context: ToolContext) => Promise<any>;
|
|
78
|
-
retryConfig?: RetryConfig;
|
|
79
|
-
}
|
|
80
|
-
interface ToolContext {
|
|
81
|
-
agentName: string;
|
|
82
|
-
conversationId: string;
|
|
83
|
-
metadata: Record<string, any>;
|
|
84
|
-
}
|
|
85
|
-
interface ToolCall {
|
|
86
|
-
id: string;
|
|
87
|
-
tool: string;
|
|
88
|
-
parameters: any;
|
|
89
|
-
result?: any;
|
|
90
|
-
error?: string;
|
|
91
|
-
}
|
|
92
|
-
interface RetryConfig {
|
|
93
|
-
maxAttempts: number;
|
|
94
|
-
backoff: 'linear' | 'exponential';
|
|
95
|
-
initialDelayMs?: number;
|
|
96
|
-
maxDelayMs?: number;
|
|
97
|
-
retryableErrors?: string[];
|
|
98
|
-
}
|
|
99
|
-
interface MemoryConfig {
|
|
100
|
-
type: 'buffer' | 'summary' | 'vector' | 'hybrid';
|
|
101
|
-
maxMessages?: number;
|
|
102
|
-
storage?: 'memory' | 'redis' | 'database';
|
|
103
|
-
ttl?: number;
|
|
104
|
-
summaryModel?: string;
|
|
105
|
-
}
|
|
106
|
-
interface MemoryStore {
|
|
107
|
-
save(conversationId: string, messages: Message[]): Promise<void>;
|
|
108
|
-
load(conversationId: string): Promise<Message[]>;
|
|
109
|
-
clear(conversationId: string): Promise<void>;
|
|
110
|
-
search?(query: string, limit?: number): Promise<Message[]>;
|
|
111
|
-
}
|
|
112
|
-
interface LLMProvider {
|
|
113
|
-
generateResponse(messages: Message[], config: ProviderConfig): Promise<LLMResponse>;
|
|
114
|
-
streamResponse?(messages: Message[], config: ProviderConfig): AsyncIterable<LLMStreamChunk>;
|
|
115
|
-
parseToolCalls(response: LLMResponse): ToolCall[];
|
|
116
|
-
}
|
|
117
|
-
interface ProviderConfig {
|
|
118
|
-
model: string;
|
|
119
|
-
temperature?: number;
|
|
120
|
-
maxTokens?: number;
|
|
121
|
-
tools?: Tool[];
|
|
122
|
-
systemPrompt?: string;
|
|
123
|
-
topP?: number;
|
|
124
|
-
stopSequences?: string[];
|
|
125
|
-
}
|
|
126
|
-
interface LLMResponse {
|
|
127
|
-
content: string;
|
|
128
|
-
stopReason: string;
|
|
129
|
-
usage: {
|
|
130
|
-
inputTokens: number;
|
|
131
|
-
outputTokens: number;
|
|
132
|
-
};
|
|
133
|
-
rawResponse: any;
|
|
134
|
-
}
|
|
135
|
-
interface LLMStreamChunk {
|
|
136
|
-
type: 'content' | 'tool_call' | 'done';
|
|
137
|
-
content?: string;
|
|
138
|
-
toolCall?: Partial<ToolCall>;
|
|
139
|
-
done?: boolean;
|
|
140
|
-
}
|
|
141
|
-
type StreamEvent = {
|
|
142
|
-
type: 'iteration';
|
|
143
|
-
iteration: number;
|
|
144
|
-
} | {
|
|
145
|
-
type: 'content';
|
|
146
|
-
content: string;
|
|
147
|
-
delta?: boolean;
|
|
148
|
-
} | {
|
|
149
|
-
type: 'tool_calls';
|
|
150
|
-
toolCalls: ToolCall[];
|
|
151
|
-
} | {
|
|
152
|
-
type: 'tool_result';
|
|
153
|
-
toolCall: ToolCall;
|
|
154
|
-
} | {
|
|
155
|
-
type: 'done';
|
|
156
|
-
metadata?: {
|
|
157
|
-
tokensUsed?: number;
|
|
158
|
-
latencyMs?: number;
|
|
159
|
-
iterations?: number;
|
|
160
|
-
};
|
|
161
|
-
} | {
|
|
162
|
-
type: 'error';
|
|
163
|
-
error: string;
|
|
164
|
-
};
|
|
165
|
-
type WorkflowType = 'sequential' | 'parallel' | 'supervisor' | 'custom';
|
|
166
|
-
interface WorkflowConfig {
|
|
167
|
-
name: string;
|
|
168
|
-
type: WorkflowType;
|
|
169
|
-
agents: AgentConfig[];
|
|
170
|
-
routing?: RoutingLogic;
|
|
171
|
-
errorHandling?: ErrorHandlingStrategy;
|
|
172
|
-
}
|
|
173
|
-
interface RoutingLogic {
|
|
174
|
-
strategy: 'conditional' | 'round-robin' | 'dynamic';
|
|
175
|
-
rules?: RoutingRule[];
|
|
176
|
-
}
|
|
177
|
-
interface RoutingRule {
|
|
178
|
-
condition: (context: AgentContext, response: AgentResponse) => boolean;
|
|
179
|
-
nextAgent: string;
|
|
180
|
-
}
|
|
181
|
-
type ErrorHandlingStrategy = 'fail-fast' | 'retry' | 'fallback' | 'continue';
|
|
182
|
-
interface AgentMetrics {
|
|
183
|
-
agentName: string;
|
|
184
|
-
latencyMs: number;
|
|
185
|
-
tokensUsed: number;
|
|
186
|
-
success: boolean;
|
|
187
|
-
error?: string;
|
|
188
|
-
timestamp: Date;
|
|
189
|
-
}
|
|
190
|
-
interface SpanContext {
|
|
191
|
-
traceId: string;
|
|
192
|
-
spanId: string;
|
|
193
|
-
parentSpanId?: string;
|
|
194
|
-
}
|
|
5
|
+
import { z } from 'zod';
|
|
195
6
|
|
|
196
7
|
declare class ToolRegistry {
|
|
197
8
|
private tools;
|
|
@@ -1013,73 +824,6 @@ declare class ConversationManager {
|
|
|
1013
824
|
import(stateJson: string): void;
|
|
1014
825
|
}
|
|
1015
826
|
|
|
1016
|
-
type AudioFormat = 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm';
|
|
1017
|
-
type VoiceType = string;
|
|
1018
|
-
interface STTConfig {
|
|
1019
|
-
model?: string;
|
|
1020
|
-
language?: string;
|
|
1021
|
-
temperature?: number;
|
|
1022
|
-
prompt?: string;
|
|
1023
|
-
responseFormat?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
|
|
1024
|
-
}
|
|
1025
|
-
interface TTSConfig {
|
|
1026
|
-
model?: string;
|
|
1027
|
-
voice?: VoiceType;
|
|
1028
|
-
speed?: number;
|
|
1029
|
-
format?: AudioFormat;
|
|
1030
|
-
}
|
|
1031
|
-
interface STTResult {
|
|
1032
|
-
text: string;
|
|
1033
|
-
language?: string;
|
|
1034
|
-
duration?: number;
|
|
1035
|
-
segments?: Array<{
|
|
1036
|
-
id: number;
|
|
1037
|
-
start: number;
|
|
1038
|
-
end: number;
|
|
1039
|
-
text: string;
|
|
1040
|
-
}>;
|
|
1041
|
-
words?: Array<{
|
|
1042
|
-
word: string;
|
|
1043
|
-
start: number;
|
|
1044
|
-
end: number;
|
|
1045
|
-
}>;
|
|
1046
|
-
}
|
|
1047
|
-
interface TTSResult {
|
|
1048
|
-
audio: Buffer;
|
|
1049
|
-
format: AudioFormat;
|
|
1050
|
-
duration?: number;
|
|
1051
|
-
byteLength: number;
|
|
1052
|
-
}
|
|
1053
|
-
interface STTProvider {
|
|
1054
|
-
transcribe(audio: Buffer | string, config?: STTConfig): Promise<STTResult>;
|
|
1055
|
-
transcribeStream?(audioStream: ReadableStream | NodeJS.ReadableStream, config?: STTConfig): AsyncIterable<Partial<STTResult>>;
|
|
1056
|
-
supportsStreaming(): boolean;
|
|
1057
|
-
}
|
|
1058
|
-
interface TTSProvider {
|
|
1059
|
-
synthesize(text: string, config?: TTSConfig): Promise<TTSResult>;
|
|
1060
|
-
synthesizeStream?(text: string, config?: TTSConfig): AsyncIterable<Buffer>;
|
|
1061
|
-
supportsStreaming(): boolean;
|
|
1062
|
-
getVoices?(): Promise<Array<{
|
|
1063
|
-
id: string;
|
|
1064
|
-
name: string;
|
|
1065
|
-
language?: string;
|
|
1066
|
-
gender?: 'male' | 'female' | 'neutral';
|
|
1067
|
-
}>>;
|
|
1068
|
-
}
|
|
1069
|
-
interface VoiceMessage {
|
|
1070
|
-
role: 'user' | 'assistant';
|
|
1071
|
-
text: string;
|
|
1072
|
-
audio?: Buffer;
|
|
1073
|
-
timestamp: Date;
|
|
1074
|
-
}
|
|
1075
|
-
interface VoiceAgentConfig {
|
|
1076
|
-
sttProvider: STTProvider;
|
|
1077
|
-
ttsProvider: TTSProvider;
|
|
1078
|
-
sttConfig?: STTConfig;
|
|
1079
|
-
ttsConfig?: TTSConfig;
|
|
1080
|
-
autoSpeak?: boolean;
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
827
|
declare class VoiceAgent {
|
|
1084
828
|
private agent;
|
|
1085
829
|
private sttProvider;
|
|
@@ -1195,78 +939,6 @@ declare class PiperTTSProvider implements TTSProvider {
|
|
|
1195
939
|
}>>;
|
|
1196
940
|
}
|
|
1197
941
|
|
|
1198
|
-
interface Tenant {
|
|
1199
|
-
id: string;
|
|
1200
|
-
name: string;
|
|
1201
|
-
slug: string;
|
|
1202
|
-
metadata?: Record<string, unknown>;
|
|
1203
|
-
settings?: TenantSettings;
|
|
1204
|
-
status: TenantStatus;
|
|
1205
|
-
createdAt: Date;
|
|
1206
|
-
updatedAt: Date;
|
|
1207
|
-
}
|
|
1208
|
-
declare enum TenantStatus {
|
|
1209
|
-
ACTIVE = "active",
|
|
1210
|
-
SUSPENDED = "suspended",
|
|
1211
|
-
INACTIVE = "inactive"
|
|
1212
|
-
}
|
|
1213
|
-
interface TenantSettings {
|
|
1214
|
-
maxAgents?: number;
|
|
1215
|
-
maxConversations?: number;
|
|
1216
|
-
rateLimit?: number;
|
|
1217
|
-
dataRetentionDays?: number;
|
|
1218
|
-
allowedProviders?: string[];
|
|
1219
|
-
custom?: Record<string, unknown>;
|
|
1220
|
-
}
|
|
1221
|
-
interface TenantContext {
|
|
1222
|
-
tenant: Tenant;
|
|
1223
|
-
userId?: string;
|
|
1224
|
-
metadata?: Record<string, unknown>;
|
|
1225
|
-
}
|
|
1226
|
-
interface TenantApiKey {
|
|
1227
|
-
id: string;
|
|
1228
|
-
tenantId: string;
|
|
1229
|
-
key: string;
|
|
1230
|
-
name: string;
|
|
1231
|
-
scopes: string[];
|
|
1232
|
-
expiresAt?: Date;
|
|
1233
|
-
createdAt: Date;
|
|
1234
|
-
lastUsedAt?: Date;
|
|
1235
|
-
isActive: boolean;
|
|
1236
|
-
}
|
|
1237
|
-
interface TenantQuota {
|
|
1238
|
-
tenantId: string;
|
|
1239
|
-
resource: string;
|
|
1240
|
-
used: number;
|
|
1241
|
-
limit: number;
|
|
1242
|
-
period: 'hourly' | 'daily' | 'monthly';
|
|
1243
|
-
periodStart: Date;
|
|
1244
|
-
periodEnd: Date;
|
|
1245
|
-
}
|
|
1246
|
-
interface TenantStorage {
|
|
1247
|
-
createTenant(tenant: Omit<Tenant, 'id' | 'createdAt' | 'updatedAt'>): Promise<Tenant>;
|
|
1248
|
-
getTenant(tenantId: string): Promise<Tenant | null>;
|
|
1249
|
-
getTenantBySlug(slug: string): Promise<Tenant | null>;
|
|
1250
|
-
updateTenant(tenantId: string, updates: Partial<Tenant>): Promise<Tenant>;
|
|
1251
|
-
deleteTenant(tenantId: string): Promise<void>;
|
|
1252
|
-
listTenants(options?: {
|
|
1253
|
-
limit?: number;
|
|
1254
|
-
offset?: number;
|
|
1255
|
-
status?: TenantStatus;
|
|
1256
|
-
}): Promise<{
|
|
1257
|
-
tenants: Tenant[];
|
|
1258
|
-
total: number;
|
|
1259
|
-
}>;
|
|
1260
|
-
createApiKey(apiKey: Omit<TenantApiKey, 'id' | 'createdAt'>): Promise<TenantApiKey>;
|
|
1261
|
-
getApiKeyByKey(key: string): Promise<TenantApiKey | null>;
|
|
1262
|
-
revokeApiKey(apiKeyId: string): Promise<void>;
|
|
1263
|
-
updateQuota(quota: TenantQuota): Promise<void>;
|
|
1264
|
-
getQuota(tenantId: string, resource: string, period: string): Promise<TenantQuota | null>;
|
|
1265
|
-
}
|
|
1266
|
-
interface TenantResolver {
|
|
1267
|
-
resolve(context: unknown): Promise<TenantContext | null>;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
942
|
interface TenantManagerConfig {
|
|
1271
943
|
storage: TenantStorage;
|
|
1272
944
|
defaultSettings?: Tenant['settings'];
|
|
@@ -1343,4 +1015,4 @@ declare class MemoryTenantStorage implements TenantStorage {
|
|
|
1343
1015
|
clear(): void;
|
|
1344
1016
|
}
|
|
1345
1017
|
|
|
1346
|
-
export { type ACPAddress, type ACPCart, type ACPCartItem, type ACPCheckoutSession, ACPClient, type ACPConfig, type ACPCustomer, type ACPDelegatedPaymentConfig, type ACPOrder, type ACPPaginationMeta, type ACPPaymentIntent, type ACPPaymentMethod, type ACPProduct, type ACPProductSearchQuery, type ACPProductSearchResult, type ACPProductVariant, type ACPResponse, type ACPWebhookEvent, Agent,
|
|
1018
|
+
export { type ACPAddress, type ACPCart, type ACPCartItem, type ACPCheckoutSession, ACPClient, type ACPConfig, type ACPCustomer, type ACPDelegatedPaymentConfig, type ACPOrder, type ACPPaginationMeta, type ACPPaymentIntent, type ACPPaymentMethod, type ACPProduct, type ACPProductSearchQuery, type ACPProductSearchResult, type ACPProductVariant, type ACPResponse, type ACPWebhookEvent, Agent, AnthropicProvider, BufferMemory, Cache, ContentFormatter, ConversationManager, ConversationSchema, ConversationSchemaBuilder, type ConversationSchemaConfig, type ConversationState, type ConversationStep, type ConversationTurn, ElevenLabsTTSProvider, GeminiProvider, LMStudioProvider, LRUCache, LocalAIProvider, LocalWhisperProvider, type LogLevel, Logger, type LoggerConfig, type MCPCallToolRequest, type MCPCallToolResponse, MCPClient, type MCPListToolsRequest, type MCPListToolsResponse, type MCPMessage, type MCPPrompt, type MCPReadResourceRequest, type MCPReadResourceResponse, MCPRegistry, type MCPResource, type MCPServerCapabilities, type MCPServerConfig, type MCPServerInfo, type MCPTool, type MCPTransport, MemoryTenantStorage, MetricsCollector, OllamaProvider, OpenAICompatibleProvider, OpenAIProvider, OpenAITTSProvider, OpenAIWhisperProvider, ParallelWorkflow, PiperTTSProvider, RateLimiter, RedisMemory, SSETransport, SequentialWorkflow, SlidingWindowRateLimiter, type Span, StdioTransport, SummaryMemory, SupervisorWorkflow, TenantBufferMemory, TenantManager, type TenantManagerConfig, TextGenerationWebUIProvider, ToolRegistry, Tracer, VLLMProvider, VoiceAgent, Workflow, WorkflowFactory, calculatorTool, createACPTools, defaultLogger, figmaGetCommentsTool, figmaGetFileTool, figmaGetImagesTool, figmaGetNodesTool, figmaPostCommentTool, fileListTool, fileReadTool, fileWriteTool, globalMetrics, globalTracer, httpRequestTool, mcpToolToAgenticTool, n8nExecuteWorkflowTool, n8nGetExecutionTool, n8nGetWorkflowTool, n8nListWorkflowsTool, n8nTriggerWebhookTool, stringTransformTool, textSummaryTool };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,197 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tool, ToolCall, ToolContext, AgentConfig, LLMProvider, MemoryStore, AgentContext, AgentResponse, StreamEvent, Message, ProviderConfig, LLMResponse, LLMStreamChunk, WorkflowConfig, AgentMetrics, SpanContext, OutputFormat, FormatOptions, FormattedContent, VoiceAgentConfig, VoiceMessage, STTConfig, TTSConfig, STTProvider, STTResult, TTSProvider, TTSResult, AudioFormat, TenantStorage, Tenant, TenantStatus, TenantApiKey, TenantQuota } from '@lov3kaizen/agentsea-types';
|
|
2
|
+
export * from '@lov3kaizen/agentsea-types';
|
|
3
|
+
export { AudioFormat, STTConfig, STTProvider, STTResult, TTSConfig, TTSProvider, TTSResult, Tenant, TenantApiKey, TenantContext, TenantQuota, TenantResolver, TenantSettings, TenantStatus, TenantStorage, VoiceAgentConfig, VoiceMessage, VoiceType } from '@lov3kaizen/agentsea-types';
|
|
2
4
|
import { EventEmitter } from 'events';
|
|
3
|
-
|
|
4
|
-
interface Message {
|
|
5
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
6
|
-
content: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
toolCallId?: string;
|
|
9
|
-
}
|
|
10
|
-
type OutputFormat = 'text' | 'markdown' | 'html' | 'react';
|
|
11
|
-
interface FormatOptions {
|
|
12
|
-
includeMetadata?: boolean;
|
|
13
|
-
sanitizeHtml?: boolean;
|
|
14
|
-
highlightCode?: boolean;
|
|
15
|
-
theme?: 'light' | 'dark' | 'auto';
|
|
16
|
-
}
|
|
17
|
-
interface AgentConfig {
|
|
18
|
-
name: string;
|
|
19
|
-
description: string;
|
|
20
|
-
model: string;
|
|
21
|
-
provider: string;
|
|
22
|
-
systemPrompt?: string;
|
|
23
|
-
tools?: Tool[];
|
|
24
|
-
temperature?: number;
|
|
25
|
-
maxTokens?: number;
|
|
26
|
-
maxIterations?: number;
|
|
27
|
-
memory?: MemoryConfig;
|
|
28
|
-
providerConfig?: ProviderInstanceConfig;
|
|
29
|
-
outputFormat?: OutputFormat;
|
|
30
|
-
formatOptions?: FormatOptions;
|
|
31
|
-
}
|
|
32
|
-
interface ProviderInstanceConfig {
|
|
33
|
-
baseUrl?: string;
|
|
34
|
-
apiKey?: string;
|
|
35
|
-
timeout?: number;
|
|
36
|
-
defaultHeaders?: Record<string, string>;
|
|
37
|
-
organization?: string;
|
|
38
|
-
}
|
|
39
|
-
interface AgentContext {
|
|
40
|
-
conversationId: string;
|
|
41
|
-
userId?: string;
|
|
42
|
-
sessionData: Record<string, any>;
|
|
43
|
-
history: Message[];
|
|
44
|
-
metadata?: Record<string, any>;
|
|
45
|
-
}
|
|
46
|
-
interface FormattedContent {
|
|
47
|
-
raw: string;
|
|
48
|
-
format: OutputFormat;
|
|
49
|
-
rendered?: string;
|
|
50
|
-
metadata?: {
|
|
51
|
-
hasCodeBlocks?: boolean;
|
|
52
|
-
hasTables?: boolean;
|
|
53
|
-
hasLists?: boolean;
|
|
54
|
-
links?: Array<{
|
|
55
|
-
text: string;
|
|
56
|
-
url: string;
|
|
57
|
-
}>;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
interface AgentResponse {
|
|
61
|
-
content: string;
|
|
62
|
-
formatted?: FormattedContent;
|
|
63
|
-
toolCalls?: ToolCall[];
|
|
64
|
-
metadata: {
|
|
65
|
-
tokensUsed: number;
|
|
66
|
-
latencyMs: number;
|
|
67
|
-
iterations: number;
|
|
68
|
-
cost?: number;
|
|
69
|
-
};
|
|
70
|
-
nextAgent?: string;
|
|
71
|
-
finishReason?: 'stop' | 'length' | 'tool_calls' | 'error';
|
|
72
|
-
}
|
|
73
|
-
interface Tool {
|
|
74
|
-
name: string;
|
|
75
|
-
description: string;
|
|
76
|
-
parameters: z.ZodSchema;
|
|
77
|
-
execute: (params: any, context: ToolContext) => Promise<any>;
|
|
78
|
-
retryConfig?: RetryConfig;
|
|
79
|
-
}
|
|
80
|
-
interface ToolContext {
|
|
81
|
-
agentName: string;
|
|
82
|
-
conversationId: string;
|
|
83
|
-
metadata: Record<string, any>;
|
|
84
|
-
}
|
|
85
|
-
interface ToolCall {
|
|
86
|
-
id: string;
|
|
87
|
-
tool: string;
|
|
88
|
-
parameters: any;
|
|
89
|
-
result?: any;
|
|
90
|
-
error?: string;
|
|
91
|
-
}
|
|
92
|
-
interface RetryConfig {
|
|
93
|
-
maxAttempts: number;
|
|
94
|
-
backoff: 'linear' | 'exponential';
|
|
95
|
-
initialDelayMs?: number;
|
|
96
|
-
maxDelayMs?: number;
|
|
97
|
-
retryableErrors?: string[];
|
|
98
|
-
}
|
|
99
|
-
interface MemoryConfig {
|
|
100
|
-
type: 'buffer' | 'summary' | 'vector' | 'hybrid';
|
|
101
|
-
maxMessages?: number;
|
|
102
|
-
storage?: 'memory' | 'redis' | 'database';
|
|
103
|
-
ttl?: number;
|
|
104
|
-
summaryModel?: string;
|
|
105
|
-
}
|
|
106
|
-
interface MemoryStore {
|
|
107
|
-
save(conversationId: string, messages: Message[]): Promise<void>;
|
|
108
|
-
load(conversationId: string): Promise<Message[]>;
|
|
109
|
-
clear(conversationId: string): Promise<void>;
|
|
110
|
-
search?(query: string, limit?: number): Promise<Message[]>;
|
|
111
|
-
}
|
|
112
|
-
interface LLMProvider {
|
|
113
|
-
generateResponse(messages: Message[], config: ProviderConfig): Promise<LLMResponse>;
|
|
114
|
-
streamResponse?(messages: Message[], config: ProviderConfig): AsyncIterable<LLMStreamChunk>;
|
|
115
|
-
parseToolCalls(response: LLMResponse): ToolCall[];
|
|
116
|
-
}
|
|
117
|
-
interface ProviderConfig {
|
|
118
|
-
model: string;
|
|
119
|
-
temperature?: number;
|
|
120
|
-
maxTokens?: number;
|
|
121
|
-
tools?: Tool[];
|
|
122
|
-
systemPrompt?: string;
|
|
123
|
-
topP?: number;
|
|
124
|
-
stopSequences?: string[];
|
|
125
|
-
}
|
|
126
|
-
interface LLMResponse {
|
|
127
|
-
content: string;
|
|
128
|
-
stopReason: string;
|
|
129
|
-
usage: {
|
|
130
|
-
inputTokens: number;
|
|
131
|
-
outputTokens: number;
|
|
132
|
-
};
|
|
133
|
-
rawResponse: any;
|
|
134
|
-
}
|
|
135
|
-
interface LLMStreamChunk {
|
|
136
|
-
type: 'content' | 'tool_call' | 'done';
|
|
137
|
-
content?: string;
|
|
138
|
-
toolCall?: Partial<ToolCall>;
|
|
139
|
-
done?: boolean;
|
|
140
|
-
}
|
|
141
|
-
type StreamEvent = {
|
|
142
|
-
type: 'iteration';
|
|
143
|
-
iteration: number;
|
|
144
|
-
} | {
|
|
145
|
-
type: 'content';
|
|
146
|
-
content: string;
|
|
147
|
-
delta?: boolean;
|
|
148
|
-
} | {
|
|
149
|
-
type: 'tool_calls';
|
|
150
|
-
toolCalls: ToolCall[];
|
|
151
|
-
} | {
|
|
152
|
-
type: 'tool_result';
|
|
153
|
-
toolCall: ToolCall;
|
|
154
|
-
} | {
|
|
155
|
-
type: 'done';
|
|
156
|
-
metadata?: {
|
|
157
|
-
tokensUsed?: number;
|
|
158
|
-
latencyMs?: number;
|
|
159
|
-
iterations?: number;
|
|
160
|
-
};
|
|
161
|
-
} | {
|
|
162
|
-
type: 'error';
|
|
163
|
-
error: string;
|
|
164
|
-
};
|
|
165
|
-
type WorkflowType = 'sequential' | 'parallel' | 'supervisor' | 'custom';
|
|
166
|
-
interface WorkflowConfig {
|
|
167
|
-
name: string;
|
|
168
|
-
type: WorkflowType;
|
|
169
|
-
agents: AgentConfig[];
|
|
170
|
-
routing?: RoutingLogic;
|
|
171
|
-
errorHandling?: ErrorHandlingStrategy;
|
|
172
|
-
}
|
|
173
|
-
interface RoutingLogic {
|
|
174
|
-
strategy: 'conditional' | 'round-robin' | 'dynamic';
|
|
175
|
-
rules?: RoutingRule[];
|
|
176
|
-
}
|
|
177
|
-
interface RoutingRule {
|
|
178
|
-
condition: (context: AgentContext, response: AgentResponse) => boolean;
|
|
179
|
-
nextAgent: string;
|
|
180
|
-
}
|
|
181
|
-
type ErrorHandlingStrategy = 'fail-fast' | 'retry' | 'fallback' | 'continue';
|
|
182
|
-
interface AgentMetrics {
|
|
183
|
-
agentName: string;
|
|
184
|
-
latencyMs: number;
|
|
185
|
-
tokensUsed: number;
|
|
186
|
-
success: boolean;
|
|
187
|
-
error?: string;
|
|
188
|
-
timestamp: Date;
|
|
189
|
-
}
|
|
190
|
-
interface SpanContext {
|
|
191
|
-
traceId: string;
|
|
192
|
-
spanId: string;
|
|
193
|
-
parentSpanId?: string;
|
|
194
|
-
}
|
|
5
|
+
import { z } from 'zod';
|
|
195
6
|
|
|
196
7
|
declare class ToolRegistry {
|
|
197
8
|
private tools;
|
|
@@ -1013,73 +824,6 @@ declare class ConversationManager {
|
|
|
1013
824
|
import(stateJson: string): void;
|
|
1014
825
|
}
|
|
1015
826
|
|
|
1016
|
-
type AudioFormat = 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm';
|
|
1017
|
-
type VoiceType = string;
|
|
1018
|
-
interface STTConfig {
|
|
1019
|
-
model?: string;
|
|
1020
|
-
language?: string;
|
|
1021
|
-
temperature?: number;
|
|
1022
|
-
prompt?: string;
|
|
1023
|
-
responseFormat?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
|
|
1024
|
-
}
|
|
1025
|
-
interface TTSConfig {
|
|
1026
|
-
model?: string;
|
|
1027
|
-
voice?: VoiceType;
|
|
1028
|
-
speed?: number;
|
|
1029
|
-
format?: AudioFormat;
|
|
1030
|
-
}
|
|
1031
|
-
interface STTResult {
|
|
1032
|
-
text: string;
|
|
1033
|
-
language?: string;
|
|
1034
|
-
duration?: number;
|
|
1035
|
-
segments?: Array<{
|
|
1036
|
-
id: number;
|
|
1037
|
-
start: number;
|
|
1038
|
-
end: number;
|
|
1039
|
-
text: string;
|
|
1040
|
-
}>;
|
|
1041
|
-
words?: Array<{
|
|
1042
|
-
word: string;
|
|
1043
|
-
start: number;
|
|
1044
|
-
end: number;
|
|
1045
|
-
}>;
|
|
1046
|
-
}
|
|
1047
|
-
interface TTSResult {
|
|
1048
|
-
audio: Buffer;
|
|
1049
|
-
format: AudioFormat;
|
|
1050
|
-
duration?: number;
|
|
1051
|
-
byteLength: number;
|
|
1052
|
-
}
|
|
1053
|
-
interface STTProvider {
|
|
1054
|
-
transcribe(audio: Buffer | string, config?: STTConfig): Promise<STTResult>;
|
|
1055
|
-
transcribeStream?(audioStream: ReadableStream | NodeJS.ReadableStream, config?: STTConfig): AsyncIterable<Partial<STTResult>>;
|
|
1056
|
-
supportsStreaming(): boolean;
|
|
1057
|
-
}
|
|
1058
|
-
interface TTSProvider {
|
|
1059
|
-
synthesize(text: string, config?: TTSConfig): Promise<TTSResult>;
|
|
1060
|
-
synthesizeStream?(text: string, config?: TTSConfig): AsyncIterable<Buffer>;
|
|
1061
|
-
supportsStreaming(): boolean;
|
|
1062
|
-
getVoices?(): Promise<Array<{
|
|
1063
|
-
id: string;
|
|
1064
|
-
name: string;
|
|
1065
|
-
language?: string;
|
|
1066
|
-
gender?: 'male' | 'female' | 'neutral';
|
|
1067
|
-
}>>;
|
|
1068
|
-
}
|
|
1069
|
-
interface VoiceMessage {
|
|
1070
|
-
role: 'user' | 'assistant';
|
|
1071
|
-
text: string;
|
|
1072
|
-
audio?: Buffer;
|
|
1073
|
-
timestamp: Date;
|
|
1074
|
-
}
|
|
1075
|
-
interface VoiceAgentConfig {
|
|
1076
|
-
sttProvider: STTProvider;
|
|
1077
|
-
ttsProvider: TTSProvider;
|
|
1078
|
-
sttConfig?: STTConfig;
|
|
1079
|
-
ttsConfig?: TTSConfig;
|
|
1080
|
-
autoSpeak?: boolean;
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
827
|
declare class VoiceAgent {
|
|
1084
828
|
private agent;
|
|
1085
829
|
private sttProvider;
|
|
@@ -1195,78 +939,6 @@ declare class PiperTTSProvider implements TTSProvider {
|
|
|
1195
939
|
}>>;
|
|
1196
940
|
}
|
|
1197
941
|
|
|
1198
|
-
interface Tenant {
|
|
1199
|
-
id: string;
|
|
1200
|
-
name: string;
|
|
1201
|
-
slug: string;
|
|
1202
|
-
metadata?: Record<string, unknown>;
|
|
1203
|
-
settings?: TenantSettings;
|
|
1204
|
-
status: TenantStatus;
|
|
1205
|
-
createdAt: Date;
|
|
1206
|
-
updatedAt: Date;
|
|
1207
|
-
}
|
|
1208
|
-
declare enum TenantStatus {
|
|
1209
|
-
ACTIVE = "active",
|
|
1210
|
-
SUSPENDED = "suspended",
|
|
1211
|
-
INACTIVE = "inactive"
|
|
1212
|
-
}
|
|
1213
|
-
interface TenantSettings {
|
|
1214
|
-
maxAgents?: number;
|
|
1215
|
-
maxConversations?: number;
|
|
1216
|
-
rateLimit?: number;
|
|
1217
|
-
dataRetentionDays?: number;
|
|
1218
|
-
allowedProviders?: string[];
|
|
1219
|
-
custom?: Record<string, unknown>;
|
|
1220
|
-
}
|
|
1221
|
-
interface TenantContext {
|
|
1222
|
-
tenant: Tenant;
|
|
1223
|
-
userId?: string;
|
|
1224
|
-
metadata?: Record<string, unknown>;
|
|
1225
|
-
}
|
|
1226
|
-
interface TenantApiKey {
|
|
1227
|
-
id: string;
|
|
1228
|
-
tenantId: string;
|
|
1229
|
-
key: string;
|
|
1230
|
-
name: string;
|
|
1231
|
-
scopes: string[];
|
|
1232
|
-
expiresAt?: Date;
|
|
1233
|
-
createdAt: Date;
|
|
1234
|
-
lastUsedAt?: Date;
|
|
1235
|
-
isActive: boolean;
|
|
1236
|
-
}
|
|
1237
|
-
interface TenantQuota {
|
|
1238
|
-
tenantId: string;
|
|
1239
|
-
resource: string;
|
|
1240
|
-
used: number;
|
|
1241
|
-
limit: number;
|
|
1242
|
-
period: 'hourly' | 'daily' | 'monthly';
|
|
1243
|
-
periodStart: Date;
|
|
1244
|
-
periodEnd: Date;
|
|
1245
|
-
}
|
|
1246
|
-
interface TenantStorage {
|
|
1247
|
-
createTenant(tenant: Omit<Tenant, 'id' | 'createdAt' | 'updatedAt'>): Promise<Tenant>;
|
|
1248
|
-
getTenant(tenantId: string): Promise<Tenant | null>;
|
|
1249
|
-
getTenantBySlug(slug: string): Promise<Tenant | null>;
|
|
1250
|
-
updateTenant(tenantId: string, updates: Partial<Tenant>): Promise<Tenant>;
|
|
1251
|
-
deleteTenant(tenantId: string): Promise<void>;
|
|
1252
|
-
listTenants(options?: {
|
|
1253
|
-
limit?: number;
|
|
1254
|
-
offset?: number;
|
|
1255
|
-
status?: TenantStatus;
|
|
1256
|
-
}): Promise<{
|
|
1257
|
-
tenants: Tenant[];
|
|
1258
|
-
total: number;
|
|
1259
|
-
}>;
|
|
1260
|
-
createApiKey(apiKey: Omit<TenantApiKey, 'id' | 'createdAt'>): Promise<TenantApiKey>;
|
|
1261
|
-
getApiKeyByKey(key: string): Promise<TenantApiKey | null>;
|
|
1262
|
-
revokeApiKey(apiKeyId: string): Promise<void>;
|
|
1263
|
-
updateQuota(quota: TenantQuota): Promise<void>;
|
|
1264
|
-
getQuota(tenantId: string, resource: string, period: string): Promise<TenantQuota | null>;
|
|
1265
|
-
}
|
|
1266
|
-
interface TenantResolver {
|
|
1267
|
-
resolve(context: unknown): Promise<TenantContext | null>;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
942
|
interface TenantManagerConfig {
|
|
1271
943
|
storage: TenantStorage;
|
|
1272
944
|
defaultSettings?: Tenant['settings'];
|
|
@@ -1343,4 +1015,4 @@ declare class MemoryTenantStorage implements TenantStorage {
|
|
|
1343
1015
|
clear(): void;
|
|
1344
1016
|
}
|
|
1345
1017
|
|
|
1346
|
-
export { type ACPAddress, type ACPCart, type ACPCartItem, type ACPCheckoutSession, ACPClient, type ACPConfig, type ACPCustomer, type ACPDelegatedPaymentConfig, type ACPOrder, type ACPPaginationMeta, type ACPPaymentIntent, type ACPPaymentMethod, type ACPProduct, type ACPProductSearchQuery, type ACPProductSearchResult, type ACPProductVariant, type ACPResponse, type ACPWebhookEvent, Agent,
|
|
1018
|
+
export { type ACPAddress, type ACPCart, type ACPCartItem, type ACPCheckoutSession, ACPClient, type ACPConfig, type ACPCustomer, type ACPDelegatedPaymentConfig, type ACPOrder, type ACPPaginationMeta, type ACPPaymentIntent, type ACPPaymentMethod, type ACPProduct, type ACPProductSearchQuery, type ACPProductSearchResult, type ACPProductVariant, type ACPResponse, type ACPWebhookEvent, Agent, AnthropicProvider, BufferMemory, Cache, ContentFormatter, ConversationManager, ConversationSchema, ConversationSchemaBuilder, type ConversationSchemaConfig, type ConversationState, type ConversationStep, type ConversationTurn, ElevenLabsTTSProvider, GeminiProvider, LMStudioProvider, LRUCache, LocalAIProvider, LocalWhisperProvider, type LogLevel, Logger, type LoggerConfig, type MCPCallToolRequest, type MCPCallToolResponse, MCPClient, type MCPListToolsRequest, type MCPListToolsResponse, type MCPMessage, type MCPPrompt, type MCPReadResourceRequest, type MCPReadResourceResponse, MCPRegistry, type MCPResource, type MCPServerCapabilities, type MCPServerConfig, type MCPServerInfo, type MCPTool, type MCPTransport, MemoryTenantStorage, MetricsCollector, OllamaProvider, OpenAICompatibleProvider, OpenAIProvider, OpenAITTSProvider, OpenAIWhisperProvider, ParallelWorkflow, PiperTTSProvider, RateLimiter, RedisMemory, SSETransport, SequentialWorkflow, SlidingWindowRateLimiter, type Span, StdioTransport, SummaryMemory, SupervisorWorkflow, TenantBufferMemory, TenantManager, type TenantManagerConfig, TextGenerationWebUIProvider, ToolRegistry, Tracer, VLLMProvider, VoiceAgent, Workflow, WorkflowFactory, calculatorTool, createACPTools, defaultLogger, figmaGetCommentsTool, figmaGetFileTool, figmaGetImagesTool, figmaGetNodesTool, figmaPostCommentTool, fileListTool, fileReadTool, fileWriteTool, globalMetrics, globalTracer, httpRequestTool, mcpToolToAgenticTool, n8nExecuteWorkflowTool, n8nGetExecutionTool, n8nGetWorkflowTool, n8nListWorkflowsTool, n8nTriggerWebhookTool, stringTransformTool, textSummaryTool };
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
22
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
23
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -33,6 +34,7 @@ __export(index_exports, {
|
|
|
33
34
|
ACPClient: () => ACPClient,
|
|
34
35
|
Agent: () => Agent,
|
|
35
36
|
AnthropicProvider: () => AnthropicProvider,
|
|
37
|
+
AudioFormat: () => import_agentsea_types.AudioFormat,
|
|
36
38
|
BufferMemory: () => BufferMemory,
|
|
37
39
|
Cache: () => Cache,
|
|
38
40
|
ContentFormatter: () => ContentFormatter,
|
|
@@ -60,19 +62,35 @@ __export(index_exports, {
|
|
|
60
62
|
RateLimiter: () => RateLimiter,
|
|
61
63
|
RedisMemory: () => RedisMemory,
|
|
62
64
|
SSETransport: () => SSETransport,
|
|
65
|
+
STTConfig: () => import_agentsea_types.STTConfig,
|
|
66
|
+
STTProvider: () => import_agentsea_types.STTProvider,
|
|
67
|
+
STTResult: () => import_agentsea_types.STTResult,
|
|
63
68
|
SequentialWorkflow: () => SequentialWorkflow,
|
|
64
69
|
SlidingWindowRateLimiter: () => SlidingWindowRateLimiter,
|
|
65
70
|
StdioTransport: () => StdioTransport,
|
|
66
71
|
SummaryMemory: () => SummaryMemory,
|
|
67
72
|
SupervisorWorkflow: () => SupervisorWorkflow,
|
|
73
|
+
TTSConfig: () => import_agentsea_types.TTSConfig,
|
|
74
|
+
TTSProvider: () => import_agentsea_types.TTSProvider,
|
|
75
|
+
TTSResult: () => import_agentsea_types.TTSResult,
|
|
76
|
+
Tenant: () => import_agentsea_types2.Tenant,
|
|
77
|
+
TenantApiKey: () => import_agentsea_types2.TenantApiKey,
|
|
68
78
|
TenantBufferMemory: () => TenantBufferMemory,
|
|
79
|
+
TenantContext: () => import_agentsea_types2.TenantContext,
|
|
69
80
|
TenantManager: () => TenantManager,
|
|
70
|
-
|
|
81
|
+
TenantQuota: () => import_agentsea_types2.TenantQuota,
|
|
82
|
+
TenantResolver: () => import_agentsea_types2.TenantResolver,
|
|
83
|
+
TenantSettings: () => import_agentsea_types2.TenantSettings,
|
|
84
|
+
TenantStatus: () => import_agentsea_types2.TenantStatus,
|
|
85
|
+
TenantStorage: () => import_agentsea_types2.TenantStorage,
|
|
71
86
|
TextGenerationWebUIProvider: () => TextGenerationWebUIProvider,
|
|
72
87
|
ToolRegistry: () => ToolRegistry,
|
|
73
88
|
Tracer: () => Tracer,
|
|
74
89
|
VLLMProvider: () => VLLMProvider,
|
|
75
90
|
VoiceAgent: () => VoiceAgent,
|
|
91
|
+
VoiceAgentConfig: () => import_agentsea_types.VoiceAgentConfig,
|
|
92
|
+
VoiceMessage: () => import_agentsea_types.VoiceMessage,
|
|
93
|
+
VoiceType: () => import_agentsea_types.VoiceType,
|
|
76
94
|
Workflow: () => Workflow,
|
|
77
95
|
WorkflowFactory: () => WorkflowFactory,
|
|
78
96
|
calculatorTool: () => calculatorTool,
|
|
@@ -100,6 +118,13 @@ __export(index_exports, {
|
|
|
100
118
|
});
|
|
101
119
|
module.exports = __toCommonJS(index_exports);
|
|
102
120
|
|
|
121
|
+
// src/types/index.ts
|
|
122
|
+
var types_exports = {};
|
|
123
|
+
__reExport(types_exports, require("@lov3kaizen/agentsea-types"));
|
|
124
|
+
|
|
125
|
+
// src/index.ts
|
|
126
|
+
__reExport(index_exports, types_exports, module.exports);
|
|
127
|
+
|
|
103
128
|
// src/formatters/content-formatter.ts
|
|
104
129
|
var import_marked = require("marked");
|
|
105
130
|
var ContentFormatter = class {
|
|
@@ -4887,6 +4912,9 @@ Respond naturally while ensuring you gather the required information.`;
|
|
|
4887
4912
|
}
|
|
4888
4913
|
};
|
|
4889
4914
|
|
|
4915
|
+
// src/types/voice.ts
|
|
4916
|
+
var import_agentsea_types = require("@lov3kaizen/agentsea-types");
|
|
4917
|
+
|
|
4890
4918
|
// src/voice/voice-agent.ts
|
|
4891
4919
|
var import_fs2 = require("fs");
|
|
4892
4920
|
var import_path2 = require("path");
|
|
@@ -5766,12 +5794,7 @@ Example:
|
|
|
5766
5794
|
var import_crypto2 = require("crypto");
|
|
5767
5795
|
|
|
5768
5796
|
// src/types/tenant.ts
|
|
5769
|
-
var
|
|
5770
|
-
TenantStatus2["ACTIVE"] = "active";
|
|
5771
|
-
TenantStatus2["SUSPENDED"] = "suspended";
|
|
5772
|
-
TenantStatus2["INACTIVE"] = "inactive";
|
|
5773
|
-
return TenantStatus2;
|
|
5774
|
-
})(TenantStatus || {});
|
|
5797
|
+
var import_agentsea_types2 = require("@lov3kaizen/agentsea-types");
|
|
5775
5798
|
|
|
5776
5799
|
// src/tenant/tenant-manager.ts
|
|
5777
5800
|
var TenantManager = class {
|
|
@@ -5800,7 +5823,7 @@ var TenantManager = class {
|
|
|
5800
5823
|
slug: data.slug,
|
|
5801
5824
|
metadata: data.metadata,
|
|
5802
5825
|
settings: { ...this.defaultSettings, ...data.settings },
|
|
5803
|
-
status:
|
|
5826
|
+
status: import_agentsea_types2.TenantStatus.ACTIVE
|
|
5804
5827
|
});
|
|
5805
5828
|
return tenant;
|
|
5806
5829
|
}
|
|
@@ -5830,13 +5853,13 @@ var TenantManager = class {
|
|
|
5830
5853
|
* Suspend tenant
|
|
5831
5854
|
*/
|
|
5832
5855
|
async suspendTenant(tenantId) {
|
|
5833
|
-
return this.updateTenant(tenantId, { status:
|
|
5856
|
+
return this.updateTenant(tenantId, { status: import_agentsea_types2.TenantStatus.SUSPENDED });
|
|
5834
5857
|
}
|
|
5835
5858
|
/**
|
|
5836
5859
|
* Activate tenant
|
|
5837
5860
|
*/
|
|
5838
5861
|
async activateTenant(tenantId) {
|
|
5839
|
-
return this.updateTenant(tenantId, { status:
|
|
5862
|
+
return this.updateTenant(tenantId, { status: import_agentsea_types2.TenantStatus.ACTIVE });
|
|
5840
5863
|
}
|
|
5841
5864
|
/**
|
|
5842
5865
|
* Delete tenant and all associated data
|
|
@@ -5886,7 +5909,7 @@ var TenantManager = class {
|
|
|
5886
5909
|
return null;
|
|
5887
5910
|
}
|
|
5888
5911
|
const tenant = await this.storage.getTenant(apiKey.tenantId);
|
|
5889
|
-
if (!tenant || tenant.status !==
|
|
5912
|
+
if (!tenant || tenant.status !== import_agentsea_types2.TenantStatus.ACTIVE) {
|
|
5890
5913
|
return null;
|
|
5891
5914
|
}
|
|
5892
5915
|
return tenant;
|
|
@@ -6100,6 +6123,7 @@ var MemoryTenantStorage = class {
|
|
|
6100
6123
|
ACPClient,
|
|
6101
6124
|
Agent,
|
|
6102
6125
|
AnthropicProvider,
|
|
6126
|
+
AudioFormat,
|
|
6103
6127
|
BufferMemory,
|
|
6104
6128
|
Cache,
|
|
6105
6129
|
ContentFormatter,
|
|
@@ -6127,19 +6151,35 @@ var MemoryTenantStorage = class {
|
|
|
6127
6151
|
RateLimiter,
|
|
6128
6152
|
RedisMemory,
|
|
6129
6153
|
SSETransport,
|
|
6154
|
+
STTConfig,
|
|
6155
|
+
STTProvider,
|
|
6156
|
+
STTResult,
|
|
6130
6157
|
SequentialWorkflow,
|
|
6131
6158
|
SlidingWindowRateLimiter,
|
|
6132
6159
|
StdioTransport,
|
|
6133
6160
|
SummaryMemory,
|
|
6134
6161
|
SupervisorWorkflow,
|
|
6162
|
+
TTSConfig,
|
|
6163
|
+
TTSProvider,
|
|
6164
|
+
TTSResult,
|
|
6165
|
+
Tenant,
|
|
6166
|
+
TenantApiKey,
|
|
6135
6167
|
TenantBufferMemory,
|
|
6168
|
+
TenantContext,
|
|
6136
6169
|
TenantManager,
|
|
6170
|
+
TenantQuota,
|
|
6171
|
+
TenantResolver,
|
|
6172
|
+
TenantSettings,
|
|
6137
6173
|
TenantStatus,
|
|
6174
|
+
TenantStorage,
|
|
6138
6175
|
TextGenerationWebUIProvider,
|
|
6139
6176
|
ToolRegistry,
|
|
6140
6177
|
Tracer,
|
|
6141
6178
|
VLLMProvider,
|
|
6142
6179
|
VoiceAgent,
|
|
6180
|
+
VoiceAgentConfig,
|
|
6181
|
+
VoiceMessage,
|
|
6182
|
+
VoiceType,
|
|
6143
6183
|
Workflow,
|
|
6144
6184
|
WorkflowFactory,
|
|
6145
6185
|
calculatorTool,
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,118 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
ACPClient: () => ACPClient,
|
|
23
|
+
Agent: () => Agent,
|
|
24
|
+
AnthropicProvider: () => AnthropicProvider,
|
|
25
|
+
AudioFormat: () => AudioFormat,
|
|
26
|
+
BufferMemory: () => BufferMemory,
|
|
27
|
+
Cache: () => Cache,
|
|
28
|
+
ContentFormatter: () => ContentFormatter,
|
|
29
|
+
ConversationManager: () => ConversationManager,
|
|
30
|
+
ConversationSchema: () => ConversationSchema,
|
|
31
|
+
ConversationSchemaBuilder: () => ConversationSchemaBuilder,
|
|
32
|
+
ElevenLabsTTSProvider: () => ElevenLabsTTSProvider,
|
|
33
|
+
GeminiProvider: () => GeminiProvider,
|
|
34
|
+
LMStudioProvider: () => LMStudioProvider,
|
|
35
|
+
LRUCache: () => LRUCache,
|
|
36
|
+
LocalAIProvider: () => LocalAIProvider,
|
|
37
|
+
LocalWhisperProvider: () => LocalWhisperProvider,
|
|
38
|
+
Logger: () => Logger,
|
|
39
|
+
MCPClient: () => MCPClient,
|
|
40
|
+
MCPRegistry: () => MCPRegistry,
|
|
41
|
+
MemoryTenantStorage: () => MemoryTenantStorage,
|
|
42
|
+
MetricsCollector: () => MetricsCollector,
|
|
43
|
+
OllamaProvider: () => OllamaProvider,
|
|
44
|
+
OpenAICompatibleProvider: () => OpenAICompatibleProvider,
|
|
45
|
+
OpenAIProvider: () => OpenAIProvider,
|
|
46
|
+
OpenAITTSProvider: () => OpenAITTSProvider,
|
|
47
|
+
OpenAIWhisperProvider: () => OpenAIWhisperProvider,
|
|
48
|
+
ParallelWorkflow: () => ParallelWorkflow,
|
|
49
|
+
PiperTTSProvider: () => PiperTTSProvider,
|
|
50
|
+
RateLimiter: () => RateLimiter,
|
|
51
|
+
RedisMemory: () => RedisMemory,
|
|
52
|
+
SSETransport: () => SSETransport,
|
|
53
|
+
STTConfig: () => STTConfig,
|
|
54
|
+
STTProvider: () => STTProvider,
|
|
55
|
+
STTResult: () => STTResult,
|
|
56
|
+
SequentialWorkflow: () => SequentialWorkflow,
|
|
57
|
+
SlidingWindowRateLimiter: () => SlidingWindowRateLimiter,
|
|
58
|
+
StdioTransport: () => StdioTransport,
|
|
59
|
+
SummaryMemory: () => SummaryMemory,
|
|
60
|
+
SupervisorWorkflow: () => SupervisorWorkflow,
|
|
61
|
+
TTSConfig: () => TTSConfig,
|
|
62
|
+
TTSProvider: () => TTSProvider,
|
|
63
|
+
TTSResult: () => TTSResult,
|
|
64
|
+
Tenant: () => Tenant,
|
|
65
|
+
TenantApiKey: () => TenantApiKey,
|
|
66
|
+
TenantBufferMemory: () => TenantBufferMemory,
|
|
67
|
+
TenantContext: () => TenantContext,
|
|
68
|
+
TenantManager: () => TenantManager,
|
|
69
|
+
TenantQuota: () => TenantQuota,
|
|
70
|
+
TenantResolver: () => TenantResolver,
|
|
71
|
+
TenantSettings: () => TenantSettings,
|
|
72
|
+
TenantStatus: () => TenantStatus,
|
|
73
|
+
TenantStorage: () => TenantStorage,
|
|
74
|
+
TextGenerationWebUIProvider: () => TextGenerationWebUIProvider,
|
|
75
|
+
ToolRegistry: () => ToolRegistry,
|
|
76
|
+
Tracer: () => Tracer,
|
|
77
|
+
VLLMProvider: () => VLLMProvider,
|
|
78
|
+
VoiceAgent: () => VoiceAgent,
|
|
79
|
+
VoiceAgentConfig: () => VoiceAgentConfig,
|
|
80
|
+
VoiceMessage: () => VoiceMessage,
|
|
81
|
+
VoiceType: () => VoiceType,
|
|
82
|
+
Workflow: () => Workflow,
|
|
83
|
+
WorkflowFactory: () => WorkflowFactory,
|
|
84
|
+
calculatorTool: () => calculatorTool,
|
|
85
|
+
createACPTools: () => createACPTools,
|
|
86
|
+
defaultLogger: () => defaultLogger,
|
|
87
|
+
figmaGetCommentsTool: () => figmaGetCommentsTool,
|
|
88
|
+
figmaGetFileTool: () => figmaGetFileTool,
|
|
89
|
+
figmaGetImagesTool: () => figmaGetImagesTool,
|
|
90
|
+
figmaGetNodesTool: () => figmaGetNodesTool,
|
|
91
|
+
figmaPostCommentTool: () => figmaPostCommentTool,
|
|
92
|
+
fileListTool: () => fileListTool,
|
|
93
|
+
fileReadTool: () => fileReadTool,
|
|
94
|
+
fileWriteTool: () => fileWriteTool,
|
|
95
|
+
globalMetrics: () => globalMetrics,
|
|
96
|
+
globalTracer: () => globalTracer,
|
|
97
|
+
httpRequestTool: () => httpRequestTool,
|
|
98
|
+
mcpToolToAgenticTool: () => mcpToolToAgenticTool,
|
|
99
|
+
n8nExecuteWorkflowTool: () => n8nExecuteWorkflowTool,
|
|
100
|
+
n8nGetExecutionTool: () => n8nGetExecutionTool,
|
|
101
|
+
n8nGetWorkflowTool: () => n8nGetWorkflowTool,
|
|
102
|
+
n8nListWorkflowsTool: () => n8nListWorkflowsTool,
|
|
103
|
+
n8nTriggerWebhookTool: () => n8nTriggerWebhookTool,
|
|
104
|
+
stringTransformTool: () => stringTransformTool,
|
|
105
|
+
textSummaryTool: () => textSummaryTool
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// src/types/index.ts
|
|
109
|
+
var types_exports = {};
|
|
110
|
+
__reExport(types_exports, agentsea_types_star);
|
|
111
|
+
import * as agentsea_types_star from "@lov3kaizen/agentsea-types";
|
|
112
|
+
|
|
113
|
+
// src/index.ts
|
|
114
|
+
__reExport(index_exports, types_exports);
|
|
115
|
+
|
|
1
116
|
// src/formatters/content-formatter.ts
|
|
2
117
|
import { marked } from "marked";
|
|
3
118
|
var ContentFormatter = class {
|
|
@@ -4787,6 +4902,20 @@ Respond naturally while ensuring you gather the required information.`;
|
|
|
4787
4902
|
}
|
|
4788
4903
|
};
|
|
4789
4904
|
|
|
4905
|
+
// src/types/voice.ts
|
|
4906
|
+
import {
|
|
4907
|
+
AudioFormat,
|
|
4908
|
+
VoiceType,
|
|
4909
|
+
STTConfig,
|
|
4910
|
+
TTSConfig,
|
|
4911
|
+
STTResult,
|
|
4912
|
+
TTSResult,
|
|
4913
|
+
STTProvider,
|
|
4914
|
+
TTSProvider,
|
|
4915
|
+
VoiceMessage,
|
|
4916
|
+
VoiceAgentConfig
|
|
4917
|
+
} from "@lov3kaizen/agentsea-types";
|
|
4918
|
+
|
|
4790
4919
|
// src/voice/voice-agent.ts
|
|
4791
4920
|
import { writeFileSync } from "fs";
|
|
4792
4921
|
import { join as join2 } from "path";
|
|
@@ -5666,12 +5795,16 @@ Example:
|
|
|
5666
5795
|
import { randomBytes, createHash } from "crypto";
|
|
5667
5796
|
|
|
5668
5797
|
// src/types/tenant.ts
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5798
|
+
import {
|
|
5799
|
+
Tenant,
|
|
5800
|
+
TenantStatus,
|
|
5801
|
+
TenantSettings,
|
|
5802
|
+
TenantContext,
|
|
5803
|
+
TenantApiKey,
|
|
5804
|
+
TenantQuota,
|
|
5805
|
+
TenantStorage,
|
|
5806
|
+
TenantResolver
|
|
5807
|
+
} from "@lov3kaizen/agentsea-types";
|
|
5675
5808
|
|
|
5676
5809
|
// src/tenant/tenant-manager.ts
|
|
5677
5810
|
var TenantManager = class {
|
|
@@ -5700,7 +5833,7 @@ var TenantManager = class {
|
|
|
5700
5833
|
slug: data.slug,
|
|
5701
5834
|
metadata: data.metadata,
|
|
5702
5835
|
settings: { ...this.defaultSettings, ...data.settings },
|
|
5703
|
-
status:
|
|
5836
|
+
status: TenantStatus.ACTIVE
|
|
5704
5837
|
});
|
|
5705
5838
|
return tenant;
|
|
5706
5839
|
}
|
|
@@ -5730,13 +5863,13 @@ var TenantManager = class {
|
|
|
5730
5863
|
* Suspend tenant
|
|
5731
5864
|
*/
|
|
5732
5865
|
async suspendTenant(tenantId) {
|
|
5733
|
-
return this.updateTenant(tenantId, { status:
|
|
5866
|
+
return this.updateTenant(tenantId, { status: TenantStatus.SUSPENDED });
|
|
5734
5867
|
}
|
|
5735
5868
|
/**
|
|
5736
5869
|
* Activate tenant
|
|
5737
5870
|
*/
|
|
5738
5871
|
async activateTenant(tenantId) {
|
|
5739
|
-
return this.updateTenant(tenantId, { status:
|
|
5872
|
+
return this.updateTenant(tenantId, { status: TenantStatus.ACTIVE });
|
|
5740
5873
|
}
|
|
5741
5874
|
/**
|
|
5742
5875
|
* Delete tenant and all associated data
|
|
@@ -5786,7 +5919,7 @@ var TenantManager = class {
|
|
|
5786
5919
|
return null;
|
|
5787
5920
|
}
|
|
5788
5921
|
const tenant = await this.storage.getTenant(apiKey.tenantId);
|
|
5789
|
-
if (!tenant || tenant.status !==
|
|
5922
|
+
if (!tenant || tenant.status !== TenantStatus.ACTIVE) {
|
|
5790
5923
|
return null;
|
|
5791
5924
|
}
|
|
5792
5925
|
return tenant;
|
|
@@ -5999,6 +6132,7 @@ export {
|
|
|
5999
6132
|
ACPClient,
|
|
6000
6133
|
Agent,
|
|
6001
6134
|
AnthropicProvider,
|
|
6135
|
+
AudioFormat,
|
|
6002
6136
|
BufferMemory,
|
|
6003
6137
|
Cache,
|
|
6004
6138
|
ContentFormatter,
|
|
@@ -6026,19 +6160,35 @@ export {
|
|
|
6026
6160
|
RateLimiter,
|
|
6027
6161
|
RedisMemory,
|
|
6028
6162
|
SSETransport,
|
|
6163
|
+
STTConfig,
|
|
6164
|
+
STTProvider,
|
|
6165
|
+
STTResult,
|
|
6029
6166
|
SequentialWorkflow,
|
|
6030
6167
|
SlidingWindowRateLimiter,
|
|
6031
6168
|
StdioTransport,
|
|
6032
6169
|
SummaryMemory,
|
|
6033
6170
|
SupervisorWorkflow,
|
|
6171
|
+
TTSConfig,
|
|
6172
|
+
TTSProvider,
|
|
6173
|
+
TTSResult,
|
|
6174
|
+
Tenant,
|
|
6175
|
+
TenantApiKey,
|
|
6034
6176
|
TenantBufferMemory,
|
|
6177
|
+
TenantContext,
|
|
6035
6178
|
TenantManager,
|
|
6179
|
+
TenantQuota,
|
|
6180
|
+
TenantResolver,
|
|
6181
|
+
TenantSettings,
|
|
6036
6182
|
TenantStatus,
|
|
6183
|
+
TenantStorage,
|
|
6037
6184
|
TextGenerationWebUIProvider,
|
|
6038
6185
|
ToolRegistry,
|
|
6039
6186
|
Tracer,
|
|
6040
6187
|
VLLMProvider,
|
|
6041
6188
|
VoiceAgent,
|
|
6189
|
+
VoiceAgentConfig,
|
|
6190
|
+
VoiceMessage,
|
|
6191
|
+
VoiceType,
|
|
6042
6192
|
Workflow,
|
|
6043
6193
|
WorkflowFactory,
|
|
6044
6194
|
calculatorTool,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lov3kaizen/agentsea-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "AgentSea - Unite and orchestrate AI agents. A production-ready ADK for building agentic AI applications with multi-provider support.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"zod-to-json-schema": "^3.22.4",
|
|
24
24
|
"winston": "^3.11.0",
|
|
25
25
|
"ioredis": "^5.3.2",
|
|
26
|
-
"marked": "^12.0.0"
|
|
26
|
+
"marked": "^12.0.0",
|
|
27
|
+
"@lov3kaizen/agentsea-types": "0.3.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@types/node": "^20.11.0",
|
|
@@ -76,12 +77,12 @@
|
|
|
76
77
|
"license": "MIT",
|
|
77
78
|
"repository": {
|
|
78
79
|
"type": "git",
|
|
79
|
-
"url": "https://github.com/
|
|
80
|
+
"url": "https://github.com/lovekaizen/agentsea.git",
|
|
80
81
|
"directory": "packages/core"
|
|
81
82
|
},
|
|
82
83
|
"homepage": "https://agentsea.dev",
|
|
83
84
|
"bugs": {
|
|
84
|
-
"url": "https://github.com/
|
|
85
|
+
"url": "https://github.com/lovekaizen/agentsea/issues"
|
|
85
86
|
},
|
|
86
87
|
"publishConfig": {
|
|
87
88
|
"access": "public"
|