@aeye/core 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.
@@ -0,0 +1,327 @@
1
+ import z from 'zod';
2
+ import { Fn, Resolved } from "./common";
3
+ import { AnyTool, Tool, ToolCompatible } from "./tool";
4
+ import { Component, Context, Events, Names, OptionalParams, Request, Tuple, Usage } from "./types";
5
+ /**
6
+ * Input provided to the prompt reconfiguration function.
7
+ *
8
+ * This allows the prompt to adjust its configuration based on runtime statistics.
9
+ */
10
+ export interface PromptReconfigInput {
11
+ iteration: number;
12
+ maxIterations: number;
13
+ toolParseErrors: number;
14
+ toolCallErrors: number;
15
+ tools: string[];
16
+ toolSuccesses: number;
17
+ toolRetries: number;
18
+ outputRetries: number;
19
+ forgetRetries: number;
20
+ }
21
+ /**
22
+ * Reconfiguration options for a prompt during execution.
23
+ */
24
+ export interface PromptReconfig {
25
+ config?: Partial<Request>;
26
+ maxIterations?: number;
27
+ toolRetries?: number;
28
+ outputRetries?: number;
29
+ forgetRetries?: number;
30
+ }
31
+ /**
32
+ * Input structure for defining a prompt.
33
+ *
34
+ * @template TContext - The context type needed for the prompt's operation.
35
+ * @template TMetadata - The metadata type needed during execution/streaming.
36
+ * @template TName - The name of the prompt, typed for inference in parent components.
37
+ * @template TInput - The input type for the prompt.
38
+ * @template TOutput - The output type for the prompt.
39
+ * @template TTools - The tools available to the prompt.
40
+ */
41
+ export interface PromptInput<TContext = {}, TMetadata = {}, TName extends string = string, TInput extends object = {}, TOutput extends object | string = string, TTools extends Tuple<ToolCompatible<TContext, TMetadata>> = []> {
42
+ name: TName;
43
+ description: string;
44
+ content: string;
45
+ input?: Fn<Record<string, any>, [TInput | undefined, Context<TContext, TMetadata>]>;
46
+ schema?: Fn<z.ZodType<TOutput> | false, [TInput | undefined, Context<TContext, TMetadata>]>;
47
+ config?: Fn<Partial<Request> | false, [TInput | undefined, Context<TContext, TMetadata>]>;
48
+ reconfig?: (stats: PromptReconfigInput, ctx: Context<TContext, TMetadata>) => PromptReconfig | Promise<PromptReconfig>;
49
+ tools?: TTools;
50
+ toolExecution?: 'sequential' | 'parallel' | 'immediate';
51
+ toolRetries?: number;
52
+ outputRetries?: number;
53
+ forgetRetries?: number;
54
+ toolsOnly?: boolean;
55
+ toolIterations?: number;
56
+ toolsMax?: number;
57
+ retool?: Fn<Names<TTools>[] | false, [TInput | undefined, Context<TContext, TMetadata>]>;
58
+ dynamic?: boolean;
59
+ metadata?: TMetadata;
60
+ metadataFn?: (input: TInput, ctx: Context<TContext, TMetadata>) => TMetadata | Promise<TMetadata>;
61
+ excludeMessages?: boolean;
62
+ validate?: (output: TOutput, ctx: Context<TContext, TMetadata>) => void | Promise<void>;
63
+ applicable?: (ctx: Context<TContext, TMetadata>) => boolean | Promise<boolean>;
64
+ types?: {
65
+ input?: TInput;
66
+ output?: TOutput;
67
+ context?: TContext;
68
+ metadata?: TMetadata;
69
+ };
70
+ }
71
+ /**
72
+ * Converts TTools into:
73
+ *
74
+ * { tool: 'name1', result: Result1 } | { tool: 'name2', result: Result2 } | ...
75
+ */
76
+ export type PromptToolOutput<TTools extends AnyTool[]> = TTools extends Array<infer TI> ? TI extends Tool<any, any, infer TName, any, infer TO, any> ? {
77
+ tool: TName;
78
+ result: Resolved<TO>;
79
+ } : never : never;
80
+ /**
81
+ * Converts TTools into a union of their names:
82
+ *
83
+ * 'name1' | 'name2' | ...
84
+ */
85
+ export type PromptToolNames<TTools extends AnyTool[]> = TTools extends Tool<any, any, infer TName, any, any, any>[] ? TName : never;
86
+ /**
87
+ * Convers TTools (tuple [T1, T2, ...]) into a single tool type (union T1 | T2 | ...)
88
+ */
89
+ export type PromptTools<TTools extends AnyTool[]> = TTools extends (infer TTool)[] ? TTool : never;
90
+ /**
91
+ * Converts TTools into tool-related events:
92
+ *
93
+ * { type: 'toolStart', tool: TTool, args: any } |
94
+ * { type: 'toolOutput', tool: TTool, args: any, result: TOutput } |
95
+ * { type: 'toolError', tool: TTool, args: any, error: string }
96
+ */
97
+ export type PromptToolEvents<TTools extends Tuple<AnyTool>> = TTools extends Array<infer TTool> ? TTool extends Tool<infer t0, infer t1, infer t2, infer t3, infer TOutput, infer t4> ? {
98
+ type: 'toolStart';
99
+ tool: TTool;
100
+ args: any;
101
+ request: Request;
102
+ } | {
103
+ type: 'toolOutput';
104
+ tool: TTool;
105
+ args: any;
106
+ result: Resolved<TOutput>;
107
+ request: Request;
108
+ } | {
109
+ type: 'toolError';
110
+ tool: TTool;
111
+ args: any;
112
+ error: string;
113
+ request: Request;
114
+ } : never : never;
115
+ /**
116
+ * The events emitted during prompt execution/streaming.
117
+ */
118
+ export type PromptEvent<TOutput, TTools extends Tuple<AnyTool>> = {
119
+ type: 'textPartial';
120
+ content: string;
121
+ request: Request;
122
+ } | {
123
+ type: 'text';
124
+ content: string;
125
+ request: Request;
126
+ } | {
127
+ type: 'refusal';
128
+ content: string;
129
+ request: Request;
130
+ } | {
131
+ type: 'reason';
132
+ content: string;
133
+ request: Request;
134
+ } | {
135
+ type: 'reasonPartial';
136
+ content: string;
137
+ request: Request;
138
+ } | {
139
+ type: 'toolParseName';
140
+ tool: PromptTools<TTools>;
141
+ request: Request;
142
+ } | {
143
+ type: 'toolParseArguments';
144
+ tool: PromptTools<TTools>;
145
+ args: string;
146
+ request: Request;
147
+ } | PromptToolEvents<TTools> | {
148
+ type: 'textComplete';
149
+ content: string;
150
+ request: Request;
151
+ } | {
152
+ type: 'complete';
153
+ output: TOutput;
154
+ request: Request;
155
+ } | {
156
+ type: 'textReset';
157
+ reason?: string;
158
+ request: Request;
159
+ } | {
160
+ type: 'requestUsage';
161
+ usage: Usage;
162
+ request: Request;
163
+ } | {
164
+ type: 'responseTokens';
165
+ tokens: number;
166
+ request: Request;
167
+ } | {
168
+ type: 'usage';
169
+ usage: Usage;
170
+ request: Request;
171
+ };
172
+ /**
173
+ * A type representing any prompt component.
174
+ */
175
+ export type AnyPrompt = Prompt<any, any, any, any, any, any>;
176
+ /**
177
+ * The different modes for retrieving prompt output from the convenience get() method.
178
+ */
179
+ export type PromptGetType = 'result' | 'tools' | 'stream' | 'streamTools' | 'streamContent';
180
+ /**
181
+ * The result type of the prompt get() method based on the selected mode.
182
+ */
183
+ export type PromptGet<TGetType extends PromptGetType, TOutput, TTools extends Tuple<AnyTool>> = {
184
+ result: Promise<TOutput | undefined>;
185
+ tools: Promise<PromptToolOutput<TTools>[] | undefined>;
186
+ stream: AsyncGenerator<PromptEvent<TOutput, TTools>, TOutput | undefined, unknown>;
187
+ streamTools: AsyncGenerator<PromptToolOutput<TTools>, TOutput | undefined, unknown>;
188
+ streamContent: AsyncGenerator<string, TOutput | undefined, unknown>;
189
+ }[TGetType];
190
+ /**
191
+ * A Prompt component that generates AI responses based on input, context, and available tools.
192
+ * Prompts orchestrate interactions with AI models, handle tool calls, and manage streaming responses.
193
+ *
194
+ * @template TContext - The context type needed for the prompt's operation.
195
+ * @template TMetadata - The metadata type needed during execution/streaming.
196
+ * @template TName - The name of the prompt, typed for inference in parent components.
197
+ * @template TInput - The input type for the prompt.
198
+ * @template TOutput - The output type for the prompt.
199
+ * @template TTools - The tools available to the prompt.
200
+ *
201
+ * @example
202
+ * const summarizer = new Prompt({
203
+ * name: 'summarize',
204
+ * description: 'Summarizes text',
205
+ * content: 'Summarize the following text:\n\n{{text}}',
206
+ * input: (input) => ({ text: input.text }),
207
+ * schema: z.object({ summary: z.string() }),
208
+ * });
209
+ *
210
+ * const result = await summarizer.get({ text: 'Long text here...' });
211
+ */
212
+ export declare class Prompt<TContext = {}, TMetadata = {}, TName extends string = string, TInput extends object = {}, TOutput extends object | string = string, TTools extends Tuple<ToolCompatible<TContext, TMetadata>> = []> implements Component<TContext, TMetadata, TName, TInput, AsyncGenerator<PromptEvent<TOutput, TTools>, TOutput | undefined, unknown>, TTools> {
213
+ input: PromptInput<TContext, TMetadata, TName, TInput, TOutput, TTools>;
214
+ private retool;
215
+ private schema;
216
+ private config;
217
+ private translate;
218
+ private content;
219
+ private metadata;
220
+ /**
221
+ * Compiles the prompt content template.
222
+ * Automatically appends tool instructions section if tools are available.
223
+ *
224
+ * @param content - The prompt content template string.
225
+ * @param hasTools - Whether tools are available.
226
+ * @returns A compiled Handlebars template function.
227
+ */
228
+ static compileContent(content: string, hasTools: boolean): HandlebarsTemplateDelegate<any>;
229
+ constructor(input: PromptInput<TContext, TMetadata, TName, TInput, TOutput, TTools>, retool?: (args_0: TInput | undefined, args_1: Context<TContext, TMetadata>) => Promise<false | Names<TTools>[] | undefined>, schema?: (args_0: TInput | undefined, args_1: Context<TContext, TMetadata>) => Promise<false | z.ZodType<TOutput, unknown, z.core.$ZodTypeInternals<TOutput, unknown>> | undefined>, config?: (args_0: TInput | undefined, args_1: Context<TContext, TMetadata>) => Promise<false | Partial<Request> | undefined>, translate?: (args_0: TInput | undefined, args_1: Context<TContext, TMetadata>) => Promise<Record<string, any> | undefined>, content?: HandlebarsTemplateDelegate<any>, metadata?: (input: TInput, ctx: Context<TContext, TMetadata>) => Promise<TMetadata | undefined>);
230
+ get kind(): 'prompt';
231
+ get name(): TName;
232
+ get description(): string;
233
+ get refs(): TTools;
234
+ /**
235
+ * Retrieves the prompt output in various modes.
236
+ *
237
+ * - `result`: Returns the final output only
238
+ * - `tools`: Returns all tool outputs only
239
+ * - `stream`: Streams all prompt events
240
+ * - `streamTools`: Streams only tool output events
241
+ * - `streamContent`: Streams only text content events
242
+ *
243
+ * @param mode - The mode of output to retrieve. Defaults to 'result'.
244
+ * @param input - The input parameters for the prompt.
245
+ * @param ctx - The context for the prompt's operation.
246
+ * @returns The prompt output based on the specified mode.
247
+ * @example
248
+ * // Get final result
249
+ * const result = await prompt.get();
250
+ *
251
+ * // Stream content
252
+ * for await (const chunk of prompt.get('streamContent', { text: 'hello' })) {
253
+ * console.log(chunk);
254
+ * }
255
+ */
256
+ get<TGetType extends PromptGetType, TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata, TCoreContext extends Context<TRuntimeContext, TRuntimeMetadata>>(mode?: TGetType, ...[inputMaybe, contextMaybe]: OptionalParams<[TInput, TCoreContext]>): PromptGet<TGetType, TOutput, TTools>;
257
+ /**
258
+ * Runs the prompt with the given context and input.
259
+ *
260
+ * @param ctx - The context for the prompt's operation.
261
+ * @param input - The input parameters for the prompt.
262
+ * @returns An async generator yielding prompt events and ultimately the final output.
263
+ */
264
+ run<TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata, TCoreContext extends Context<TRuntimeContext, TRuntimeMetadata>>(...[inputMaybe, contextMaybe]: OptionalParams<[TInput, TCoreContext]>): AsyncGenerator<PromptEvent<TOutput, TTools>, TOutput | undefined, unknown>;
265
+ /**
266
+ * Determines if the prompt is applicable in the given context.
267
+ * By default, checks retool, schema, and config functions if provided.
268
+ *
269
+ * @param ctx - The context to check applicability against.
270
+ * @returns Whether the prompt is applicable.
271
+ */
272
+ applicable<TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata, TCoreContext extends Context<TRuntimeContext, TRuntimeMetadata>>(...[contextMaybe]: OptionalParams<[TCoreContext]>): Promise<boolean>;
273
+ /**
274
+ * Streams the prompt execution, yielding events as they occur.
275
+ * This is the core execution method that handles AI interaction, tool calling, and response parsing.
276
+ *
277
+ * @param input - The input parameters for the prompt.
278
+ * @param preferStream - Whether to prefer streaming execution over batch execution.
279
+ * @param events - Optional event handlers for prompt events.
280
+ * @param ctx - The context for the prompt's operation.
281
+ * @returns An async generator yielding prompt events and ultimately the final output.
282
+ */
283
+ stream<TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata, TCoreContext extends Context<TRuntimeContext, TRuntimeMetadata>>(...[inputMaybe, preferStream, toolsOnly, eventsMaybe, contextMaybe]: OptionalParams<[
284
+ TInput,
285
+ boolean,
286
+ boolean,
287
+ Events<Component<TRuntimeContext, TRuntimeMetadata, TName, TInput, AsyncGenerator<PromptEvent<TOutput, TTools>, TOutput | undefined, unknown>, TTools>> | undefined,
288
+ TCoreContext
289
+ ]>): AsyncGenerator<PromptEvent<TOutput, TTools>, TOutput | undefined, unknown>;
290
+ /**
291
+ * Prepares the prompt for execution by resolving all configuration, tools, and templates.
292
+ * Returns undefined if the prompt is not compatible with the given context.
293
+ *
294
+ * @param ctx - The context to prepare against.
295
+ * @param input - The input to the prompt.
296
+ * @returns The resolved prompt components or undefined if not compatible.
297
+ */
298
+ private resolve;
299
+ /**
300
+ * Converts a non-streaming executor into a streamer by yielding response parts.
301
+ * This allows uniform handling of streaming and non-streaming AI providers.
302
+ *
303
+ * @param execute - The executor function to convert.
304
+ * @returns A streamer function that yields parts of the executor's response.
305
+ */
306
+ private streamify;
307
+ /**
308
+ * Trims messages from the request to fit within token limits.
309
+ *
310
+ * This is called:
311
+ * - Before a request is made to ensure the prompt fits within the model's context window if it's specified
312
+ * - After a response with a 'length' finish reason to allow retrying with trimmed context
313
+ * - After a provider catches an early context window error and emits amn artificial length event.
314
+ *
315
+ * Scenarios that support trimming:
316
+ * 1. Token usage is provided from a previous request (we can use this to infer token counts)
317
+ * 2. A token estimation function is provided in the context (we can estimate token counts)
318
+ * 3. Messages already have token counts assigned (we can use these directly)
319
+ *
320
+ * @param request - The original request with messages.
321
+ * @param ctx - The context containing message history and token estimation.
322
+ * @param usage - The current token usage.
323
+ * @returns The trimmed array of messages.
324
+ */
325
+ private forget;
326
+ }
327
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAmB,EAAE,EAA6F,QAAQ,EAAuB,MAAM,UAAU,CAAC;AACzK,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAmC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAoE,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,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