@lov3kaizen/agentsea-core 0.3.1 → 0.5.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 +184 -35
- package/dist/index.d.ts +184 -35
- package/dist/index.js +376 -88
- package/dist/index.mjs +371 -83
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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';
|
|
1
|
+
import { Tool, ToolCall, ToolContext, AgentConfig, LLMProvider, MemoryStore, AgentContext, AgentResponse, StreamEvent, RetryConfig, Message, ProviderConfig, LLMResponse, LLMStreamChunk, ProviderModelConfig, ModelInfo, ModelCapabilities, AnthropicModel, AnthropicConfig, OpenAIModel, OpenAIConfig, GeminiModel, GeminiConfig, OllamaConfig as OllamaConfig$1, AnthropicModelCapabilities, OpenAIModelCapabilities, GeminiModelCapabilities, 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
2
|
export * from '@lov3kaizen/agentsea-types';
|
|
3
3
|
export { AudioFormat, STTConfig, STTProvider, STTResult, TTSConfig, TTSProvider, TTSResult, Tenant, TenantApiKey, TenantContext, TenantQuota, TenantResolver, TenantSettings, TenantStatus, TenantStorage, VoiceAgentConfig, VoiceMessage, VoiceType } from '@lov3kaizen/agentsea-types';
|
|
4
|
-
import { EventEmitter } from 'events';
|
|
5
4
|
import { z } from 'zod';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
6
|
|
|
7
7
|
declare class ToolRegistry {
|
|
8
8
|
private tools;
|
|
@@ -13,7 +13,7 @@ declare class ToolRegistry {
|
|
|
13
13
|
has(name: string): boolean;
|
|
14
14
|
unregister(name: string): boolean;
|
|
15
15
|
clear(): void;
|
|
16
|
-
execute(toolCall: ToolCall, context: ToolContext): Promise<
|
|
16
|
+
execute(toolCall: ToolCall, context: ToolContext): Promise<unknown>;
|
|
17
17
|
private executeWithRetry;
|
|
18
18
|
private calculateDelay;
|
|
19
19
|
private sleep;
|
|
@@ -59,6 +59,122 @@ declare const n8nListWorkflowsTool: Tool;
|
|
|
59
59
|
declare const n8nTriggerWebhookTool: Tool;
|
|
60
60
|
declare const n8nGetWorkflowTool: Tool;
|
|
61
61
|
|
|
62
|
+
interface ToolDefinitionOptions<TInput extends z.ZodSchema, TOutput extends z.ZodSchema = z.ZodUnknown> {
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
inputSchema: TInput;
|
|
66
|
+
outputSchema?: TOutput;
|
|
67
|
+
needsApproval?: boolean;
|
|
68
|
+
retryConfig?: RetryConfig;
|
|
69
|
+
}
|
|
70
|
+
type ServerExecuteFn<TInput, TOutput> = (input: TInput, context: ToolContext) => Promise<TOutput>;
|
|
71
|
+
type ClientExecuteFn<TInput, TOutput> = (input: TInput, context: ToolContext) => TOutput | Promise<TOutput>;
|
|
72
|
+
interface ToolDefinition<TInput extends z.ZodSchema, TOutput extends z.ZodSchema> {
|
|
73
|
+
readonly name: string;
|
|
74
|
+
readonly description: string;
|
|
75
|
+
readonly inputSchema: TInput;
|
|
76
|
+
readonly outputSchema: TOutput;
|
|
77
|
+
readonly needsApproval: boolean;
|
|
78
|
+
readonly retryConfig?: RetryConfig;
|
|
79
|
+
server(execute: ServerExecuteFn<z.infer<TInput>, z.infer<TOutput>>): ServerTool<TInput, TOutput>;
|
|
80
|
+
client(execute: ClientExecuteFn<z.infer<TInput>, z.infer<TOutput>>): ClientTool<TInput, TOutput>;
|
|
81
|
+
toTool(execute: ServerExecuteFn<z.infer<TInput>, z.infer<TOutput>>): Tool;
|
|
82
|
+
}
|
|
83
|
+
interface ServerTool<TInput extends z.ZodSchema, TOutput extends z.ZodSchema> extends Omit<ToolDefinition<TInput, TOutput>, 'server' | 'client' | 'toTool'> {
|
|
84
|
+
readonly environment: 'server';
|
|
85
|
+
execute(input: z.infer<TInput>, context: ToolContext): Promise<z.infer<TOutput>>;
|
|
86
|
+
toTool(): Tool;
|
|
87
|
+
}
|
|
88
|
+
interface ClientTool<TInput extends z.ZodSchema, TOutput extends z.ZodSchema> extends Omit<ToolDefinition<TInput, TOutput>, 'server' | 'client' | 'toTool'> {
|
|
89
|
+
readonly environment: 'client';
|
|
90
|
+
execute(input: z.infer<TInput>, context: ToolContext): z.infer<TOutput> | Promise<z.infer<TOutput>>;
|
|
91
|
+
toTool(): Tool;
|
|
92
|
+
}
|
|
93
|
+
interface HybridTool<TInput extends z.ZodSchema, TOutput extends z.ZodSchema> {
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly description: string;
|
|
96
|
+
readonly inputSchema: TInput;
|
|
97
|
+
readonly outputSchema: TOutput;
|
|
98
|
+
readonly needsApproval: boolean;
|
|
99
|
+
readonly retryConfig?: RetryConfig;
|
|
100
|
+
readonly server: ServerTool<TInput, TOutput>;
|
|
101
|
+
readonly client: ClientTool<TInput, TOutput>;
|
|
102
|
+
toTool(): Tool;
|
|
103
|
+
}
|
|
104
|
+
declare function toolDefinition<TInput extends z.ZodSchema, TOutput extends z.ZodSchema = z.ZodUnknown>(options: ToolDefinitionOptions<TInput, TOutput>): ToolDefinition<TInput, TOutput>;
|
|
105
|
+
declare function hybridTool<TInput extends z.ZodSchema, TOutput extends z.ZodSchema = z.ZodUnknown>(options: ToolDefinitionOptions<TInput, TOutput> & {
|
|
106
|
+
server: ServerExecuteFn<z.infer<TInput>, z.infer<TOutput>>;
|
|
107
|
+
client: ClientExecuteFn<z.infer<TInput>, z.infer<TOutput>>;
|
|
108
|
+
}): HybridTool<TInput, TOutput>;
|
|
109
|
+
declare function serverTool<TInput extends z.ZodSchema, TOutput extends z.ZodSchema = z.ZodUnknown>(options: ToolDefinitionOptions<TInput, TOutput> & {
|
|
110
|
+
execute: ServerExecuteFn<z.infer<TInput>, z.infer<TOutput>>;
|
|
111
|
+
}): ServerTool<TInput, TOutput>;
|
|
112
|
+
declare function clientTool<TInput extends z.ZodSchema, TOutput extends z.ZodSchema = z.ZodUnknown>(options: ToolDefinitionOptions<TInput, TOutput> & {
|
|
113
|
+
execute: ClientExecuteFn<z.infer<TInput>, z.infer<TOutput>>;
|
|
114
|
+
}): ClientTool<TInput, TOutput>;
|
|
115
|
+
type ToolInput<T> = T extends ToolDefinition<infer TInput, any> ? z.infer<TInput> : T extends ServerTool<infer TInput, any> ? z.infer<TInput> : T extends ClientTool<infer TInput, any> ? z.infer<TInput> : never;
|
|
116
|
+
type ToolOutput<T> = T extends ToolDefinition<any, infer TOutput> ? z.infer<TOutput> : T extends ServerTool<any, infer TOutput> ? z.infer<TOutput> : T extends ClientTool<any, infer TOutput> ? z.infer<TOutput> : never;
|
|
117
|
+
declare function toLegacyTool(tool: ServerTool<any, any> | ClientTool<any, any> | HybridTool<any, any>): Tool;
|
|
118
|
+
declare function toLegacyTools(tools: Array<ServerTool<any, any> | ClientTool<any, any> | HybridTool<any, any>>): Tool[];
|
|
119
|
+
|
|
120
|
+
declare const calculatorDef: ToolDefinition<z.ZodObject<{
|
|
121
|
+
operation: z.ZodEnum<["add", "subtract", "multiply", "divide"]>;
|
|
122
|
+
a: z.ZodNumber;
|
|
123
|
+
b: z.ZodNumber;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
operation: "add" | "subtract" | "multiply" | "divide";
|
|
126
|
+
a: number;
|
|
127
|
+
b: number;
|
|
128
|
+
}, {
|
|
129
|
+
operation: "add" | "subtract" | "multiply" | "divide";
|
|
130
|
+
a: number;
|
|
131
|
+
b: number;
|
|
132
|
+
}>, z.ZodObject<{
|
|
133
|
+
result: z.ZodNumber;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
result: number;
|
|
136
|
+
}, {
|
|
137
|
+
result: number;
|
|
138
|
+
}>>;
|
|
139
|
+
declare const calculatorServer: ServerTool<z.ZodObject<{
|
|
140
|
+
operation: z.ZodEnum<["add", "subtract", "multiply", "divide"]>;
|
|
141
|
+
a: z.ZodNumber;
|
|
142
|
+
b: z.ZodNumber;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
operation: "add" | "subtract" | "multiply" | "divide";
|
|
145
|
+
a: number;
|
|
146
|
+
b: number;
|
|
147
|
+
}, {
|
|
148
|
+
operation: "add" | "subtract" | "multiply" | "divide";
|
|
149
|
+
a: number;
|
|
150
|
+
b: number;
|
|
151
|
+
}>, z.ZodObject<{
|
|
152
|
+
result: z.ZodNumber;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
result: number;
|
|
155
|
+
}, {
|
|
156
|
+
result: number;
|
|
157
|
+
}>>;
|
|
158
|
+
declare const calculatorClient: ClientTool<z.ZodObject<{
|
|
159
|
+
operation: z.ZodEnum<["add", "subtract", "multiply", "divide"]>;
|
|
160
|
+
a: z.ZodNumber;
|
|
161
|
+
b: z.ZodNumber;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
operation: "add" | "subtract" | "multiply" | "divide";
|
|
164
|
+
a: number;
|
|
165
|
+
b: number;
|
|
166
|
+
}, {
|
|
167
|
+
operation: "add" | "subtract" | "multiply" | "divide";
|
|
168
|
+
a: number;
|
|
169
|
+
b: number;
|
|
170
|
+
}>, z.ZodObject<{
|
|
171
|
+
result: z.ZodNumber;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
result: number;
|
|
174
|
+
}, {
|
|
175
|
+
result: number;
|
|
176
|
+
}>>;
|
|
177
|
+
|
|
62
178
|
declare class AnthropicProvider implements LLMProvider {
|
|
63
179
|
private client;
|
|
64
180
|
constructor(apiKey?: string);
|
|
@@ -137,6 +253,39 @@ declare class VLLMProvider extends OpenAICompatibleProvider {
|
|
|
137
253
|
constructor(config?: Partial<OpenAICompatibleConfig>);
|
|
138
254
|
}
|
|
139
255
|
|
|
256
|
+
interface TypeSafeProvider<TConfig extends ProviderModelConfig> {
|
|
257
|
+
readonly config: TConfig;
|
|
258
|
+
readonly provider: AnthropicProvider | OpenAIProvider | GeminiProvider | OllamaProvider;
|
|
259
|
+
getModelInfo(): ModelInfo | undefined;
|
|
260
|
+
supportsCapability(capability: keyof ModelCapabilities): boolean;
|
|
261
|
+
}
|
|
262
|
+
declare function createProvider<TConfig extends ProviderModelConfig>(config: TConfig): TypeSafeProvider<TConfig>;
|
|
263
|
+
declare function createAnthropicProvider<TModel extends AnthropicModel>(config: AnthropicConfig<TModel>, options?: {
|
|
264
|
+
apiKey?: string;
|
|
265
|
+
}): TypeSafeProvider<AnthropicConfig<TModel>> & {
|
|
266
|
+
provider: AnthropicProvider;
|
|
267
|
+
};
|
|
268
|
+
declare function createOpenAIProvider<TModel extends OpenAIModel>(config: OpenAIConfig<TModel>, options?: {
|
|
269
|
+
apiKey?: string;
|
|
270
|
+
}): TypeSafeProvider<OpenAIConfig<TModel>> & {
|
|
271
|
+
provider: OpenAIProvider;
|
|
272
|
+
};
|
|
273
|
+
declare function createGeminiProvider<TModel extends GeminiModel>(config: GeminiConfig<TModel>, options?: {
|
|
274
|
+
apiKey?: string;
|
|
275
|
+
}): TypeSafeProvider<GeminiConfig<TModel>> & {
|
|
276
|
+
provider: GeminiProvider;
|
|
277
|
+
};
|
|
278
|
+
declare function createOllamaProvider(config: OllamaConfig$1, options?: {
|
|
279
|
+
baseUrl?: string;
|
|
280
|
+
timeout?: number;
|
|
281
|
+
}): TypeSafeProvider<OllamaConfig$1> & {
|
|
282
|
+
provider: OllamaProvider;
|
|
283
|
+
};
|
|
284
|
+
type ExtractModel<T extends ProviderModelConfig> = T['model'];
|
|
285
|
+
type ExtractProviderName<T extends ProviderModelConfig> = T['provider'];
|
|
286
|
+
type ConfigSupports<T extends ProviderModelConfig, TCapability extends keyof ModelCapabilities> = T extends AnthropicConfig<infer M> ? M extends keyof AnthropicModelCapabilities ? AnthropicModelCapabilities[M][TCapability] extends true ? true : false : false : T extends OpenAIConfig<infer M> ? M extends keyof OpenAIModelCapabilities ? OpenAIModelCapabilities[M][TCapability] extends true ? true : false : false : T extends GeminiConfig<infer M> ? M extends keyof GeminiModelCapabilities ? GeminiModelCapabilities[M][TCapability] extends true ? true : false : false : false;
|
|
287
|
+
type RequireCapability<T extends ProviderModelConfig, TCapability extends keyof ModelCapabilities> = ConfigSupports<T, TCapability> extends true ? T : never;
|
|
288
|
+
|
|
140
289
|
declare class BufferMemory implements MemoryStore {
|
|
141
290
|
private maxMessages?;
|
|
142
291
|
private store;
|
|
@@ -242,11 +391,11 @@ interface LoggerConfig {
|
|
|
242
391
|
declare class Logger {
|
|
243
392
|
private logger;
|
|
244
393
|
constructor(config?: LoggerConfig);
|
|
245
|
-
error(message: string, meta?:
|
|
246
|
-
warn(message: string, meta?:
|
|
247
|
-
info(message: string, meta?:
|
|
248
|
-
debug(message: string, meta?:
|
|
249
|
-
child(context: Record<string,
|
|
394
|
+
error(message: string, meta?: Record<string, unknown>): void;
|
|
395
|
+
warn(message: string, meta?: Record<string, unknown>): void;
|
|
396
|
+
info(message: string, meta?: Record<string, unknown>): void;
|
|
397
|
+
debug(message: string, meta?: Record<string, unknown>): void;
|
|
398
|
+
child(context: Record<string, unknown>): Logger;
|
|
250
399
|
}
|
|
251
400
|
declare const defaultLogger: Logger;
|
|
252
401
|
|
|
@@ -277,11 +426,11 @@ interface Span {
|
|
|
277
426
|
name: string;
|
|
278
427
|
startTime: Date;
|
|
279
428
|
endTime?: Date;
|
|
280
|
-
attributes: Record<string,
|
|
429
|
+
attributes: Record<string, unknown>;
|
|
281
430
|
events: Array<{
|
|
282
431
|
timestamp: Date;
|
|
283
432
|
name: string;
|
|
284
|
-
attributes?:
|
|
433
|
+
attributes?: Record<string, unknown>;
|
|
285
434
|
}>;
|
|
286
435
|
status: 'ok' | 'error';
|
|
287
436
|
error?: Error;
|
|
@@ -294,8 +443,8 @@ declare class Tracer {
|
|
|
294
443
|
context: SpanContext;
|
|
295
444
|
};
|
|
296
445
|
endSpan(spanId: string, error?: Error): void;
|
|
297
|
-
setAttributes(spanId: string, attributes: Record<string,
|
|
298
|
-
addEvent(spanId: string, name: string, attributes?: Record<string,
|
|
446
|
+
setAttributes(spanId: string, attributes: Record<string, unknown>): void;
|
|
447
|
+
addEvent(spanId: string, name: string, attributes?: Record<string, unknown>): void;
|
|
299
448
|
getSpan(spanId: string): Span | undefined;
|
|
300
449
|
getTrace(traceId: string): Span[];
|
|
301
450
|
getSpanDuration(spanId: string): number | undefined;
|
|
@@ -385,7 +534,7 @@ interface MCPTool {
|
|
|
385
534
|
description: string;
|
|
386
535
|
inputSchema: {
|
|
387
536
|
type: 'object';
|
|
388
|
-
properties: Record<string,
|
|
537
|
+
properties: Record<string, unknown>;
|
|
389
538
|
required?: string[];
|
|
390
539
|
};
|
|
391
540
|
}
|
|
@@ -427,7 +576,7 @@ interface MCPCallToolRequest {
|
|
|
427
576
|
method: 'tools/call';
|
|
428
577
|
params: {
|
|
429
578
|
name: string;
|
|
430
|
-
arguments?: Record<string,
|
|
579
|
+
arguments?: Record<string, unknown>;
|
|
431
580
|
};
|
|
432
581
|
}
|
|
433
582
|
interface MCPCallToolResponse {
|
|
@@ -467,12 +616,12 @@ interface MCPMessage {
|
|
|
467
616
|
jsonrpc: '2.0';
|
|
468
617
|
id?: string | number;
|
|
469
618
|
method?: string;
|
|
470
|
-
params?:
|
|
471
|
-
result?:
|
|
619
|
+
params?: unknown;
|
|
620
|
+
result?: unknown;
|
|
472
621
|
error?: {
|
|
473
622
|
code: number;
|
|
474
623
|
message: string;
|
|
475
|
-
data?:
|
|
624
|
+
data?: unknown;
|
|
476
625
|
};
|
|
477
626
|
}
|
|
478
627
|
|
|
@@ -486,11 +635,11 @@ declare class MCPClient extends EventEmitter {
|
|
|
486
635
|
connect(): Promise<void>;
|
|
487
636
|
private initialize;
|
|
488
637
|
listTools(): Promise<MCPTool[]>;
|
|
489
|
-
callTool(name: string, args?: Record<string,
|
|
638
|
+
callTool(name: string, args?: Record<string, unknown>): Promise<MCPCallToolResponse>;
|
|
490
639
|
listResources(): Promise<MCPResource[]>;
|
|
491
640
|
readResource(uri: string): Promise<MCPReadResourceResponse>;
|
|
492
641
|
listPrompts(): Promise<MCPPrompt[]>;
|
|
493
|
-
getPrompt(name: string, args?: Record<string, string>): Promise<
|
|
642
|
+
getPrompt(name: string, args?: Record<string, string>): Promise<unknown>;
|
|
494
643
|
getServerInfo(): MCPServerInfo | null;
|
|
495
644
|
disconnect(): void;
|
|
496
645
|
isConnected(): boolean;
|
|
@@ -559,7 +708,7 @@ interface ACPProduct {
|
|
|
559
708
|
};
|
|
560
709
|
images?: string[];
|
|
561
710
|
variants?: ACPProductVariant[];
|
|
562
|
-
metadata?: Record<string,
|
|
711
|
+
metadata?: Record<string, unknown>;
|
|
563
712
|
}
|
|
564
713
|
interface ACPProductVariant {
|
|
565
714
|
id: string;
|
|
@@ -590,7 +739,7 @@ interface ACPCart {
|
|
|
590
739
|
amount: number;
|
|
591
740
|
currency: string;
|
|
592
741
|
};
|
|
593
|
-
metadata?: Record<string,
|
|
742
|
+
metadata?: Record<string, unknown>;
|
|
594
743
|
}
|
|
595
744
|
interface ACPCheckoutSession {
|
|
596
745
|
id: string;
|
|
@@ -606,14 +755,14 @@ interface ACPCheckoutSession {
|
|
|
606
755
|
};
|
|
607
756
|
createdAt: string;
|
|
608
757
|
updatedAt: string;
|
|
609
|
-
metadata?: Record<string,
|
|
758
|
+
metadata?: Record<string, unknown>;
|
|
610
759
|
}
|
|
611
760
|
interface ACPCustomer {
|
|
612
761
|
id?: string;
|
|
613
762
|
email: string;
|
|
614
763
|
name?: string;
|
|
615
764
|
phone?: string;
|
|
616
|
-
metadata?: Record<string,
|
|
765
|
+
metadata?: Record<string, unknown>;
|
|
617
766
|
}
|
|
618
767
|
interface ACPAddress {
|
|
619
768
|
line1: string;
|
|
@@ -627,7 +776,7 @@ interface ACPPaymentMethod {
|
|
|
627
776
|
type: 'card' | 'delegated' | 'wallet' | 'bank_transfer';
|
|
628
777
|
token?: string;
|
|
629
778
|
delegatedProvider?: string;
|
|
630
|
-
metadata?: Record<string,
|
|
779
|
+
metadata?: Record<string, unknown>;
|
|
631
780
|
}
|
|
632
781
|
interface ACPPaymentIntent {
|
|
633
782
|
id: string;
|
|
@@ -637,7 +786,7 @@ interface ACPPaymentIntent {
|
|
|
637
786
|
};
|
|
638
787
|
status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'cancelled';
|
|
639
788
|
paymentMethod?: ACPPaymentMethod;
|
|
640
|
-
metadata?: Record<string,
|
|
789
|
+
metadata?: Record<string, unknown>;
|
|
641
790
|
}
|
|
642
791
|
interface ACPOrder {
|
|
643
792
|
id: string;
|
|
@@ -655,7 +804,7 @@ interface ACPOrder {
|
|
|
655
804
|
trackingNumber?: string;
|
|
656
805
|
createdAt: string;
|
|
657
806
|
updatedAt: string;
|
|
658
|
-
metadata?: Record<string,
|
|
807
|
+
metadata?: Record<string, unknown>;
|
|
659
808
|
}
|
|
660
809
|
interface ACPProductSearchQuery {
|
|
661
810
|
query?: string;
|
|
@@ -684,7 +833,7 @@ interface ACPDelegatedPaymentConfig {
|
|
|
684
833
|
merchantAccountId: string;
|
|
685
834
|
returnUrl?: string;
|
|
686
835
|
cancelUrl?: string;
|
|
687
|
-
metadata?: Record<string,
|
|
836
|
+
metadata?: Record<string, unknown>;
|
|
688
837
|
}
|
|
689
838
|
interface ACPWebhookEvent {
|
|
690
839
|
id: string;
|
|
@@ -697,7 +846,7 @@ interface ACPResponse<T> {
|
|
|
697
846
|
error?: {
|
|
698
847
|
code: string;
|
|
699
848
|
message: string;
|
|
700
|
-
details?:
|
|
849
|
+
details?: unknown;
|
|
701
850
|
};
|
|
702
851
|
}
|
|
703
852
|
interface ACPPaginationMeta {
|
|
@@ -744,22 +893,22 @@ declare function createACPTools(client: ACPClient): Tool[];
|
|
|
744
893
|
interface ConversationTurn {
|
|
745
894
|
role: 'user' | 'assistant' | 'system';
|
|
746
895
|
content: string;
|
|
747
|
-
metadata?: Record<string,
|
|
896
|
+
metadata?: Record<string, unknown>;
|
|
748
897
|
timestamp?: Date;
|
|
749
898
|
}
|
|
750
899
|
interface ConversationState {
|
|
751
900
|
currentStep: string;
|
|
752
|
-
data: Record<string,
|
|
901
|
+
data: Record<string, unknown>;
|
|
753
902
|
history: ConversationTurn[];
|
|
754
|
-
metadata: Record<string,
|
|
903
|
+
metadata: Record<string, unknown>;
|
|
755
904
|
}
|
|
756
905
|
interface ConversationStep {
|
|
757
906
|
id: string;
|
|
758
907
|
prompt: string;
|
|
759
908
|
schema?: z.ZodSchema;
|
|
760
|
-
next?: string | ((response:
|
|
761
|
-
onComplete?: (response:
|
|
762
|
-
validation?: (response:
|
|
909
|
+
next?: string | ((response: unknown, state: ConversationState) => string);
|
|
910
|
+
onComplete?: (response: unknown, state: ConversationState) => void | Promise<void>;
|
|
911
|
+
validation?: (response: unknown) => boolean | Promise<boolean>;
|
|
763
912
|
errorMessage?: string;
|
|
764
913
|
maxRetries?: number;
|
|
765
914
|
}
|
|
@@ -1039,4 +1188,4 @@ declare class MemoryTenantStorage implements TenantStorage {
|
|
|
1039
1188
|
clear(): void;
|
|
1040
1189
|
}
|
|
1041
1190
|
|
|
1042
|
-
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, LemonFoxSTTProvider, LemonFoxTTSProvider, 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, type OpenAITTSConfig, OpenAITTSProvider, type OpenAIWhisperConfig, 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 };
|
|
1191
|
+
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, type ClientExecuteFn, type ClientTool, type ConfigSupports, ContentFormatter, ConversationManager, ConversationSchema, ConversationSchemaBuilder, type ConversationSchemaConfig, type ConversationState, type ConversationStep, type ConversationTurn, ElevenLabsTTSProvider, type ExtractModel, type ExtractProviderName, GeminiProvider, type HybridTool, LMStudioProvider, LRUCache, LemonFoxSTTProvider, LemonFoxTTSProvider, 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, type OpenAITTSConfig, OpenAITTSProvider, type OpenAIWhisperConfig, OpenAIWhisperProvider, ParallelWorkflow, PiperTTSProvider, RateLimiter, RedisMemory, type RequireCapability, SSETransport, SequentialWorkflow, type ServerExecuteFn, type ServerTool, SlidingWindowRateLimiter, type Span, StdioTransport, SummaryMemory, SupervisorWorkflow, TenantBufferMemory, TenantManager, type TenantManagerConfig, TextGenerationWebUIProvider, type ToolDefinition, type ToolDefinitionOptions, type ToolInput, type ToolOutput, ToolRegistry, Tracer, type TypeSafeProvider, VLLMProvider, VoiceAgent, Workflow, WorkflowFactory, calculatorClient, calculatorDef, calculatorServer, calculatorTool, clientTool, createACPTools, createAnthropicProvider, createGeminiProvider, createOllamaProvider, createOpenAIProvider, createProvider, defaultLogger, figmaGetCommentsTool, figmaGetFileTool, figmaGetImagesTool, figmaGetNodesTool, figmaPostCommentTool, fileListTool, fileReadTool, fileWriteTool, globalMetrics, globalTracer, httpRequestTool, hybridTool, mcpToolToAgenticTool, n8nExecuteWorkflowTool, n8nGetExecutionTool, n8nGetWorkflowTool, n8nListWorkflowsTool, n8nTriggerWebhookTool, serverTool, stringTransformTool, textSummaryTool, toLegacyTool, toLegacyTools, toolDefinition };
|