@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.
- package/README.md +568 -0
- package/dist/agent.d.ts +85 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +81 -0
- package/dist/agent.js.map +1 -0
- package/dist/common.d.ts +161 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +456 -0
- package/dist/common.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/prompt.d.ts +327 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +947 -0
- package/dist/prompt.js.map +1 -0
- package/dist/tool.d.ts +139 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +162 -0
- package/dist/tool.js.map +1 -0
- package/dist/types.d.ts +545 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { Resolved } from "./common";
|
|
3
|
+
import { AnyPrompt, PromptEvent } from "./prompt";
|
|
4
|
+
/**
|
|
5
|
+
* Utility type for representing tuples (arrays with at least zero elements).
|
|
6
|
+
*
|
|
7
|
+
* @template T - The element type of the tuple.
|
|
8
|
+
*/
|
|
9
|
+
export type Tuple<T> = [] | [T, ...T[]];
|
|
10
|
+
/**
|
|
11
|
+
* Simplifies complex intersection types into a flat, readable type.
|
|
12
|
+
* Useful for improving TypeScript hints and error messages.
|
|
13
|
+
*
|
|
14
|
+
* @template T - The type to simplify
|
|
15
|
+
*/
|
|
16
|
+
export type Simplify<T> = {
|
|
17
|
+
[K in keyof T]: T[K];
|
|
18
|
+
} & {};
|
|
19
|
+
/**
|
|
20
|
+
* Overrides properties in TBase with those from TOverride.
|
|
21
|
+
*
|
|
22
|
+
* @template TBase - The base type.
|
|
23
|
+
* @template TOverride - The type with properties to override.
|
|
24
|
+
*/
|
|
25
|
+
export type Extend<TBase, TOverride> = TBase & TOverride;
|
|
26
|
+
/**
|
|
27
|
+
* T plus any extra properties.
|
|
28
|
+
*/
|
|
29
|
+
export type Plus<T> = T & {
|
|
30
|
+
[P in PropertyKey]: P extends keyof T ? T[P] : any;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Extracts the required keys from an object type.
|
|
34
|
+
*
|
|
35
|
+
* @template T - The object type to extract required keys from.
|
|
36
|
+
*/
|
|
37
|
+
export type RequiredKeys<T> = {
|
|
38
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
|
39
|
+
}[keyof T];
|
|
40
|
+
/**
|
|
41
|
+
* Converts function parameters into optional arguments if they have no required keys.
|
|
42
|
+
* This allows methods to accept optional parameters elegantly.
|
|
43
|
+
*
|
|
44
|
+
* @template P - The parameter tuple type.
|
|
45
|
+
* @example
|
|
46
|
+
* function<A, B, C>(...[a, b, c]: OptionalParams<[A, B, C]>): void
|
|
47
|
+
*/
|
|
48
|
+
export type OptionalParams<P> = P extends [] ? [] : P extends [infer F] ? RequiredKeys<F> extends never ? [param?: F] : [param: F] : P extends [...infer F, infer R] ? RequiredKeys<R> extends never ? [...OptionalParams<F>, param?: R] : [...F, R] : never;
|
|
49
|
+
/**
|
|
50
|
+
* The base interface for AI components.
|
|
51
|
+
*
|
|
52
|
+
* @template TName - The name of the component, typed for inference in parent components.
|
|
53
|
+
* @template TInput - The input type for the component.
|
|
54
|
+
* @template TOutput - The output type for the component.
|
|
55
|
+
* @template TContext - The context type needed for the component's operation.
|
|
56
|
+
* @template TMetadata - The metadata type needed during execution/streaming.
|
|
57
|
+
*/
|
|
58
|
+
export interface Component<TContext = {}, TMetadata = {}, TName extends string = string, TInput extends object = {}, TOutput = string, TRefs extends Tuple<ComponentCompatible<TContext, TMetadata>> = []> {
|
|
59
|
+
/**
|
|
60
|
+
* The component kind/type. Base kinds are prompt, tool, and agent.
|
|
61
|
+
*/
|
|
62
|
+
kind: string;
|
|
63
|
+
/**
|
|
64
|
+
* The name of the component. Typed so parent components can infer child component names.
|
|
65
|
+
*/
|
|
66
|
+
name: TName;
|
|
67
|
+
/**
|
|
68
|
+
* A brief description of the component.
|
|
69
|
+
*
|
|
70
|
+
* This may or may not be used directly by the component or its parents, but is useful for documentation and understanding the component's purpose.
|
|
71
|
+
*/
|
|
72
|
+
description: string;
|
|
73
|
+
/**
|
|
74
|
+
* References to other components that this component depends on.
|
|
75
|
+
*
|
|
76
|
+
* Useful for understanding the potential hierarchy or graph of components.
|
|
77
|
+
*/
|
|
78
|
+
refs: TRefs;
|
|
79
|
+
/**
|
|
80
|
+
* Executes the component with the given context and input.
|
|
81
|
+
*
|
|
82
|
+
* @param ctx - The context for the component's operation.
|
|
83
|
+
* @param input - The input for the component.
|
|
84
|
+
* @returns A promise that resolves to the output of the component.
|
|
85
|
+
*/
|
|
86
|
+
run<TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata, TCoreContext extends Context<TRuntimeContext, TRuntimeMetadata>>(...[input, ctx]: OptionalParams<[TInput, TCoreContext]>): TOutput;
|
|
87
|
+
/**
|
|
88
|
+
* Determines if the component is applicable in the given context.
|
|
89
|
+
*
|
|
90
|
+
* @param ctx - The context to check applicability against.
|
|
91
|
+
*/
|
|
92
|
+
applicable<TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata, TCoreContext extends Context<TRuntimeContext, TRuntimeMetadata>>(...[ctx]: OptionalParams<[TCoreContext]>): Promise<boolean>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A type representing a tuple of AI components that are all compatible with the given context and metadata.
|
|
96
|
+
*/
|
|
97
|
+
export type ComponentTuple<TContext, TMetadata, TComponents extends Tuple<AnyComponent>> = TComponents & {
|
|
98
|
+
[K in keyof TComponents]: TComponents[K] extends Component<infer U, infer V, any, any, any, any> ? TContext extends U ? TMetadata extends V ? TComponents[K] : never : never : never;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* A type representing any AI component that is compatible with the given context and metadata.
|
|
102
|
+
*/
|
|
103
|
+
export type ComponentCompatible<TContext, TMetadata> = AnyComponent extends infer R ? R extends Component<infer U extends TContext, infer V extends TMetadata, any, any, any, any> ? Component<U, V, any, any, any, any> : never : never;
|
|
104
|
+
/**
|
|
105
|
+
* A type representing any AI component.
|
|
106
|
+
*/
|
|
107
|
+
export type AnyComponent = Component<any, any, any, any, any, any>;
|
|
108
|
+
/**
|
|
109
|
+
* Extracts contact type from a given AI component.
|
|
110
|
+
*/
|
|
111
|
+
export type ComponentContext<C extends AnyComponent> = C extends Component<infer TContext, infer t0, infer t1, infer t2, infer t3, infer t4> ? TContext : {};
|
|
112
|
+
/**
|
|
113
|
+
* Extracts metadata type from a given AI component.
|
|
114
|
+
*/
|
|
115
|
+
export type ComponentMetadata<C extends AnyComponent> = C extends Component<infer t0, infer TMetadata, infer t1, infer t2, infer t3, infer t4> ? TMetadata : {};
|
|
116
|
+
/**
|
|
117
|
+
* Extracts input type from a given AI component.
|
|
118
|
+
*/
|
|
119
|
+
export type ComponentInput<C extends AnyComponent> = C extends Component<infer t0, infer t1, infer t2, infer TInput, infer t3, infer t4> ? TInput : never;
|
|
120
|
+
/**
|
|
121
|
+
* Extracts output type from a given AI component.
|
|
122
|
+
*/
|
|
123
|
+
export type ComponentOutput<C extends AnyComponent> = C extends Component<infer t0, infer t1, infer t2, infer t3, infer TOutput, infer t4> ? TOutput : never;
|
|
124
|
+
/**
|
|
125
|
+
* Extracts refs type from a given AI component.
|
|
126
|
+
*/
|
|
127
|
+
export type ComponentRefs<C extends AnyComponent> = C extends Component<infer t0, infer t1, infer t2, infer t3, infer t4, infer TRefs> ? TRefs : never;
|
|
128
|
+
/**
|
|
129
|
+
* All components referenced directly or indirectly by a given component.
|
|
130
|
+
*/
|
|
131
|
+
export type ComponentsAll<C extends AnyComponent> = C extends Component<infer t0, infer t1, infer t2, infer t3, infer t4, infer TRefs> ? C | TRefs[number] | ComponentsAll<TRefs[number]> : never;
|
|
132
|
+
/**
|
|
133
|
+
* Extracts the names of a tuple of components.
|
|
134
|
+
*/
|
|
135
|
+
export type Names<T extends Tuple<AnyComponent>> = T extends Tuple<infer C extends Component<infer t0, infer t1, infer TName, infer t2, infer t3, infer t4>> ? TName : never;
|
|
136
|
+
/**
|
|
137
|
+
* Function type for executing AI requests synchronously (non-streaming).
|
|
138
|
+
*
|
|
139
|
+
* @template TContext - The context type for the request.
|
|
140
|
+
* @template TMetadata - The metadata type for the request.
|
|
141
|
+
* @param request - The AI request parameters.
|
|
142
|
+
* @param context - The context for the request.
|
|
143
|
+
* @param metadata - Optional metadata for the request.
|
|
144
|
+
* @param signal - Optional abort signal for cancellation.
|
|
145
|
+
* @returns A promise resolving to the complete AI response.
|
|
146
|
+
*/
|
|
147
|
+
export type Executor<TContext, TMetadata> = <TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata>(request: Request, context: TRuntimeContext, metadata?: TRuntimeMetadata, signal?: AbortSignal) => Promise<Response>;
|
|
148
|
+
/**
|
|
149
|
+
* Function type for executing AI requests with streaming support.
|
|
150
|
+
*
|
|
151
|
+
* @template TContext - The context type for the request.
|
|
152
|
+
* @template TMetadata - The metadata type for the request.
|
|
153
|
+
* @param request - The AI request parameters.
|
|
154
|
+
* @param context - The context for the request.
|
|
155
|
+
* @param metadata - Optional metadata for the request.
|
|
156
|
+
* @param signal - Optional abort signal for cancellation.
|
|
157
|
+
* @returns An async generator yielding response chunks and returning the final response.
|
|
158
|
+
*/
|
|
159
|
+
export type Streamer<TContext, TMetadata> = <TRuntimeContext extends TContext, TRuntimeMetadata extends TMetadata>(request: Request, context: TRuntimeContext, metadata?: TRuntimeMetadata, signal?: AbortSignal) => AsyncGenerator<Chunk, Response>;
|
|
160
|
+
/**
|
|
161
|
+
* The context type for AI components, combining TContext and the inputs this AI system requires to operate.
|
|
162
|
+
*/
|
|
163
|
+
export type Context<TContext, TMetadata> = TContext & {
|
|
164
|
+
/**
|
|
165
|
+
* Messages in the context
|
|
166
|
+
*/
|
|
167
|
+
messages?: Message[];
|
|
168
|
+
/**
|
|
169
|
+
* Executor and Streamer for this context
|
|
170
|
+
*/
|
|
171
|
+
execute?: Executor<TContext, TMetadata>;
|
|
172
|
+
/**
|
|
173
|
+
* Streamer for this context
|
|
174
|
+
*/
|
|
175
|
+
stream?: Streamer<TContext, TMetadata>;
|
|
176
|
+
/**
|
|
177
|
+
* An optional AbortSignal to cancel operations.
|
|
178
|
+
*/
|
|
179
|
+
signal?: AbortSignal;
|
|
180
|
+
/**
|
|
181
|
+
* An optional function to estimate usage for a message.
|
|
182
|
+
*
|
|
183
|
+
* This handles non-text data types (images, audio, files) more accurately than just token counting.
|
|
184
|
+
* If this is not provided, and the message has no tokens - it will use the average available tokens per message.
|
|
185
|
+
*
|
|
186
|
+
* @param message - The message to estimate usage for.
|
|
187
|
+
* @returns The estimated usage statistics.
|
|
188
|
+
*/
|
|
189
|
+
estimateUsage?: (message: Message) => Usage | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* The default number of completion tokens to reserve when calculating available prompt tokens.
|
|
192
|
+
*/
|
|
193
|
+
maxOutputTokens?: number;
|
|
194
|
+
/**
|
|
195
|
+
* The context window size restriction to impose, if any.
|
|
196
|
+
*/
|
|
197
|
+
contextWindow?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Number of attempts to get the output in the right format and to pass validation. Defaults to 2.
|
|
200
|
+
*/
|
|
201
|
+
outputRetries?: number;
|
|
202
|
+
/**
|
|
203
|
+
* Number of attempts that will be made to forget context messages of the past in order to complete the request. Defaults to 1.
|
|
204
|
+
*/
|
|
205
|
+
forgetRetries?: number;
|
|
206
|
+
/**
|
|
207
|
+
* Number of attempts to retry tool calls upon failure. Defaults to 2.
|
|
208
|
+
*/
|
|
209
|
+
toolRetries?: number;
|
|
210
|
+
/**
|
|
211
|
+
* The current instance of the component being executed, if any.
|
|
212
|
+
*/
|
|
213
|
+
instance?: Instance<any>;
|
|
214
|
+
/**
|
|
215
|
+
* A custom component runner that can override how components are executed.
|
|
216
|
+
*/
|
|
217
|
+
runner?: Runner;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* A custom component runner that can override how components are executed.
|
|
221
|
+
*
|
|
222
|
+
* @param component - The component to run.
|
|
223
|
+
* @param ctx - The context for the component's operation.
|
|
224
|
+
* @param input - The input for the component.
|
|
225
|
+
* @param getOutput - A function that returns the output of the component.
|
|
226
|
+
* @returns
|
|
227
|
+
*/
|
|
228
|
+
export type Runner = <TComponent extends AnyComponent, TContext extends ComponentContext<TComponent>, TMetadata extends ComponentMetadata<TComponent>, TCoreContext extends Context<TContext, TMetadata>>(component: TComponent, input: ComponentInput<TComponent>, ctx: TCoreContext, getOutput: (ctx: TCoreContext, events?: Events<TComponent>) => ComponentOutput<TComponent>) => ComponentOutput<TComponent>;
|
|
229
|
+
/**
|
|
230
|
+
* The role of a message in a conversation with an AI system.
|
|
231
|
+
*/
|
|
232
|
+
export type MessageRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
233
|
+
/**
|
|
234
|
+
* Represents a message in a conversation with an AI system.
|
|
235
|
+
* Messages can come from different roles and contain various types of content.
|
|
236
|
+
*/
|
|
237
|
+
export interface Message {
|
|
238
|
+
/** The role of the message sender */
|
|
239
|
+
role: MessageRole;
|
|
240
|
+
/** Content can be a simple string or an array of structured content parts */
|
|
241
|
+
content: string | MessageContent[];
|
|
242
|
+
/** Number of tokens in the content, if known. Used for automatic trimming when token limits are exceeded. */
|
|
243
|
+
tokens?: number;
|
|
244
|
+
/** Optional name of the sender for the given role */
|
|
245
|
+
name?: string;
|
|
246
|
+
/** Used for tool call results (when role='tool') */
|
|
247
|
+
toolCallId?: string;
|
|
248
|
+
/** Used to acknowledge an assistant is running tools (when role='assistant') */
|
|
249
|
+
toolCalls?: ToolCall[];
|
|
250
|
+
/** Used for refusals (when role='assistant') */
|
|
251
|
+
refusal?: string;
|
|
252
|
+
/** Used to pass cache data along with the message */
|
|
253
|
+
cache?: Record<string, any>;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* The type of content within a message.
|
|
257
|
+
*/
|
|
258
|
+
export type MessageContentType = 'text' | 'image' | 'file' | 'audio';
|
|
259
|
+
/**
|
|
260
|
+
* Structured content part within a message.
|
|
261
|
+
* Supports multiple content types including text, images, files, and audio.
|
|
262
|
+
*/
|
|
263
|
+
export interface MessageContent {
|
|
264
|
+
/** The type of content */
|
|
265
|
+
type: MessageContentType;
|
|
266
|
+
/** The actual content data */
|
|
267
|
+
content: string | Buffer | URL | ReadableStream<Uint8Array | string>;
|
|
268
|
+
/** Format of the content if known (e.g., 'png', 'mp3', 'pdf') */
|
|
269
|
+
format?: string;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Defines a tool that can be called by the AI system.
|
|
273
|
+
* Tools extend the AI's capabilities by allowing it to interact with external systems.
|
|
274
|
+
*/
|
|
275
|
+
export interface ToolDefinition {
|
|
276
|
+
/** Tool name, must be unique within the request */
|
|
277
|
+
name: string;
|
|
278
|
+
/** Description of what the tool does */
|
|
279
|
+
description?: string;
|
|
280
|
+
/** Zod schema defining the tool's input parameters */
|
|
281
|
+
parameters: z.ZodType<object>;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Represents a tool invocation by the AI system.
|
|
285
|
+
* The AI provides the tool name and arguments, which are then executed and results returned.
|
|
286
|
+
*/
|
|
287
|
+
export interface ToolCall {
|
|
288
|
+
/** Unique identifier for this tool call, used to match results back to the request */
|
|
289
|
+
id: string;
|
|
290
|
+
/** Name of the tool to call */
|
|
291
|
+
name: string;
|
|
292
|
+
/** The arguments for the tool call as a JSON string */
|
|
293
|
+
arguments: string;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Tool choice options.
|
|
297
|
+
*
|
|
298
|
+
* - `auto`: Let the model decide whether to use a tool or not.
|
|
299
|
+
* - `none`: Do not use any tools.
|
|
300
|
+
* - `required`: Use a tool for this request.
|
|
301
|
+
* - `{ tool: 'name' }`: Specify a particular tool to use by name.
|
|
302
|
+
*/
|
|
303
|
+
export type ToolChoice = 'auto' | 'none' | 'required' | {
|
|
304
|
+
tool: string;
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Response format options.
|
|
308
|
+
*
|
|
309
|
+
* - `text`: Plain text response.
|
|
310
|
+
* - `json`: JSON formatted response.
|
|
311
|
+
* - `z.ZodType<object, object>`: A Zod schema defining the expected response structure.
|
|
312
|
+
*/
|
|
313
|
+
export type ResponseFormat = 'text' | 'json' | z.ZodType<object, object>;
|
|
314
|
+
/**
|
|
315
|
+
* Statistics about usage for an AI request.
|
|
316
|
+
* Structured to match ModelPricing for accurate cost calculation and usage tracking.
|
|
317
|
+
* All token counts are specified per modality (text, audio, image, reasoning, embeddings).
|
|
318
|
+
*/
|
|
319
|
+
export interface Usage {
|
|
320
|
+
/** Text token usage (chat, completion, etc.) */
|
|
321
|
+
text?: {
|
|
322
|
+
/** Input tokens used (prompt) */
|
|
323
|
+
input?: number;
|
|
324
|
+
/** Output tokens used (completion) */
|
|
325
|
+
output?: number;
|
|
326
|
+
/** Cached tokens used, if applicable */
|
|
327
|
+
cached?: number;
|
|
328
|
+
};
|
|
329
|
+
/** Audio usage */
|
|
330
|
+
audio?: {
|
|
331
|
+
/** Input tokens used (for audio processing) */
|
|
332
|
+
input?: number;
|
|
333
|
+
/** Output tokens used (for audio generation) */
|
|
334
|
+
output?: number;
|
|
335
|
+
/** Duration in seconds (for time-based pricing) */
|
|
336
|
+
seconds?: number;
|
|
337
|
+
};
|
|
338
|
+
/** Image usage */
|
|
339
|
+
image?: {
|
|
340
|
+
/** Input tokens/images used (for image analysis) */
|
|
341
|
+
input?: number;
|
|
342
|
+
/** Output images generated */
|
|
343
|
+
output?: {
|
|
344
|
+
/** Quality level (e.g., 'low', 'medium', 'high', 'hd', 'standard') */
|
|
345
|
+
quality: string;
|
|
346
|
+
/** Image dimensions */
|
|
347
|
+
size: {
|
|
348
|
+
width: number;
|
|
349
|
+
height: number;
|
|
350
|
+
};
|
|
351
|
+
/** Number of images at this quality/size */
|
|
352
|
+
count: number;
|
|
353
|
+
}[];
|
|
354
|
+
};
|
|
355
|
+
/** Reasoning token usage (for models with extended reasoning like o1) */
|
|
356
|
+
reasoning?: {
|
|
357
|
+
/** Input tokens used for reasoning */
|
|
358
|
+
input?: number;
|
|
359
|
+
/** Output reasoning tokens used */
|
|
360
|
+
output?: number;
|
|
361
|
+
/** Cached reasoning tokens, if applicable */
|
|
362
|
+
cached?: number;
|
|
363
|
+
};
|
|
364
|
+
/** Embeddings usage */
|
|
365
|
+
embeddings?: {
|
|
366
|
+
/** Number of embeddings generated */
|
|
367
|
+
count?: number;
|
|
368
|
+
/** Total tokens processed for embeddings */
|
|
369
|
+
tokens?: number;
|
|
370
|
+
};
|
|
371
|
+
/** Total cost of the request in dollars, if calculated */
|
|
372
|
+
cost?: number;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Effort level for reasoning-capable AI models.
|
|
376
|
+
* Higher effort may produce better results but takes longer and uses more tokens.
|
|
377
|
+
*/
|
|
378
|
+
export type ReasoningEffort = 'low' | 'medium' | 'high';
|
|
379
|
+
/**
|
|
380
|
+
* Parameters for an AI request.
|
|
381
|
+
* Configures the model's behavior, available tools, and output format.
|
|
382
|
+
*/
|
|
383
|
+
export interface Request extends BaseRequest {
|
|
384
|
+
/** Optional name to identify the request. Could be the component name. */
|
|
385
|
+
name?: string;
|
|
386
|
+
/** Messages in the conversation history */
|
|
387
|
+
messages: Message[];
|
|
388
|
+
/** Temperature setting for response generation (0.0 to 2.0, higher = more random) */
|
|
389
|
+
temperature?: number;
|
|
390
|
+
/** Maximum tokens for the output */
|
|
391
|
+
maxTokens?: number;
|
|
392
|
+
/** Nucleus sampling parameter (0.0 to 1.0) */
|
|
393
|
+
topP?: number;
|
|
394
|
+
/** Frequency penalty to reduce repetition (-2.0 to 2.0) */
|
|
395
|
+
frequencyPenalty?: number;
|
|
396
|
+
/** Presence penalty to encourage new topics (-2.0 to 2.0) */
|
|
397
|
+
presencePenalty?: number;
|
|
398
|
+
/** Stop sequences to end the response */
|
|
399
|
+
stop?: string | string[];
|
|
400
|
+
/** Whether to return log probabilities of the output tokens or not */
|
|
401
|
+
logProbabilities?: boolean;
|
|
402
|
+
/** Modify the likelihood of specified tokens appearing in the completion. */
|
|
403
|
+
logitBias?: Record<string, number>;
|
|
404
|
+
/** Tools available for this request */
|
|
405
|
+
tools?: ToolDefinition[];
|
|
406
|
+
/** Use tools one at a time instead of parallel execution */
|
|
407
|
+
toolsOneAtATime?: boolean;
|
|
408
|
+
/** Tool choice strategy for this request */
|
|
409
|
+
toolChoice?: ToolChoice;
|
|
410
|
+
/** The expected response format. Defaults to text. */
|
|
411
|
+
responseFormat?: ResponseFormat;
|
|
412
|
+
/** Reasoning configuration for reasoning-capable models */
|
|
413
|
+
reason?: {
|
|
414
|
+
effort?: ReasoningEffort;
|
|
415
|
+
maxTokens?: number;
|
|
416
|
+
};
|
|
417
|
+
/** A key that can help optimize cache hit rates */
|
|
418
|
+
cacheKey?: string;
|
|
419
|
+
/** Uniquely identifies the user */
|
|
420
|
+
userKey?: string;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Indicates why an AI response finished generating.
|
|
424
|
+
*
|
|
425
|
+
* - `stop`: Natural completion of the response
|
|
426
|
+
* - `length`: Maximum token limit reached
|
|
427
|
+
* - `tool_calls`: Model wants to call tools
|
|
428
|
+
* - `content_filter`: Content was filtered by safety systems
|
|
429
|
+
* - `refusal`: Model refused to respond
|
|
430
|
+
*/
|
|
431
|
+
export type FinishReason = 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'refusal';
|
|
432
|
+
/**
|
|
433
|
+
* Information about an AI model.
|
|
434
|
+
*/
|
|
435
|
+
export interface Model {
|
|
436
|
+
id: string;
|
|
437
|
+
contextWindow?: number;
|
|
438
|
+
maxOutputTokens?: number;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Input type for specifying a model, either by ID or full Model object.
|
|
442
|
+
*/
|
|
443
|
+
export type ModelInput = string | Model;
|
|
444
|
+
/**
|
|
445
|
+
* Base request for an AI operation.
|
|
446
|
+
*/
|
|
447
|
+
export interface BaseRequest {
|
|
448
|
+
model?: ModelInput;
|
|
449
|
+
extra?: Record<string, any>;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Base response from an AI request.
|
|
453
|
+
*/
|
|
454
|
+
export interface BaseResponse {
|
|
455
|
+
/** Usage statistics for this request **/
|
|
456
|
+
usage?: Usage;
|
|
457
|
+
/** Model used for this response **/
|
|
458
|
+
model: ModelInput;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Base chunk of a streaming AI response.
|
|
462
|
+
*/
|
|
463
|
+
export interface BaseChunk {
|
|
464
|
+
/** Usage statistics (sent at the end) */
|
|
465
|
+
usage?: Usage;
|
|
466
|
+
/** Model used for this chunk **/
|
|
467
|
+
model?: ModelInput;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Complete response from an AI request.
|
|
471
|
+
* Contains the generated content, any tool calls, and metadata about the response.
|
|
472
|
+
*/
|
|
473
|
+
export interface Response extends BaseResponse {
|
|
474
|
+
/** The main text content of the response */
|
|
475
|
+
content: string;
|
|
476
|
+
/** Any tool calls requested by the model */
|
|
477
|
+
toolCalls?: ToolCall[];
|
|
478
|
+
/** Why the response finished generating */
|
|
479
|
+
finishReason: FinishReason;
|
|
480
|
+
/** Refusal reason if the model declined to respond */
|
|
481
|
+
refusal?: string;
|
|
482
|
+
/** Reasoning trace for reasoning-capable models */
|
|
483
|
+
reasoning?: string;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* A chunk of a streaming AI response.
|
|
487
|
+
* Chunks are sent incrementally as the model generates the response.
|
|
488
|
+
*
|
|
489
|
+
* Most fields are partial updates, except:
|
|
490
|
+
* - `finishReason` is sent when the response is complete
|
|
491
|
+
* - `toolCallNamed` is sent when a tool call name is fully received
|
|
492
|
+
* - `toolCall` is sent when a tool call is fully received
|
|
493
|
+
*/
|
|
494
|
+
export interface Chunk extends BaseChunk {
|
|
495
|
+
/** Partial text content received */
|
|
496
|
+
content?: string;
|
|
497
|
+
/** Sent when a tool call name is fully received */
|
|
498
|
+
toolCallNamed?: ToolCall;
|
|
499
|
+
/** Sent as tool call arguments are being streamed */
|
|
500
|
+
toolCallArguments?: ToolCall;
|
|
501
|
+
/** Sent when a tool call is fully received */
|
|
502
|
+
toolCall?: ToolCall;
|
|
503
|
+
/** Sent when the response is finished */
|
|
504
|
+
finishReason?: FinishReason;
|
|
505
|
+
/** Partial refusal reason */
|
|
506
|
+
refusal?: string;
|
|
507
|
+
/** Partial reasoning trace */
|
|
508
|
+
reasoning?: string;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* A status of an instance of a component.
|
|
512
|
+
*
|
|
513
|
+
* - `pending` is the first status emitted immediately
|
|
514
|
+
* - `running` is the status emitted once input has been evaluated and actual component execution is about to be ran. started is set at this time.
|
|
515
|
+
* - `completed` is the status emitted on success, completed & output are set here.
|
|
516
|
+
* - `failed` is the status emitted on complete failure, completed & error are set here.
|
|
517
|
+
* - `interuppted` is the status emitted while it was running and an interrupt signal was sent, completed & error are set here.
|
|
518
|
+
*/
|
|
519
|
+
export type InstanceStatus = 'pending' | 'running' | 'completed' | 'failed' | 'interrupted';
|
|
520
|
+
/**
|
|
521
|
+
* An instance of a component execution.
|
|
522
|
+
*/
|
|
523
|
+
export interface Instance<C extends AnyComponent> {
|
|
524
|
+
parent?: Instance<AnyComponent>;
|
|
525
|
+
id: string;
|
|
526
|
+
component: C;
|
|
527
|
+
context: ComponentContext<C>;
|
|
528
|
+
input: ComponentInput<C>;
|
|
529
|
+
status: InstanceStatus;
|
|
530
|
+
started?: number;
|
|
531
|
+
running?: number;
|
|
532
|
+
completed?: number;
|
|
533
|
+
error?: any;
|
|
534
|
+
output?: Resolved<ComponentOutput<C>>;
|
|
535
|
+
children?: Instance<ComponentRefs<C>>[];
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Events related to component instances.
|
|
539
|
+
*/
|
|
540
|
+
export interface Events<TRoot extends AnyComponent, TNodes extends ComponentsAll<TRoot> = ComponentsAll<TRoot>> {
|
|
541
|
+
onStatus?: (node: Instance<TNodes>) => void;
|
|
542
|
+
onChild?: <N extends TNodes>(node: Instance<N>, child: Instance<ComponentRefs<N>>) => void;
|
|
543
|
+
onPromptEvent?: <N extends Extract<TNodes, AnyPrompt>>(instance: Instance<N>, event: PromptEvent<ComponentOutput<N>, ComponentRefs<N>>) => void;
|
|
544
|
+
}
|
|
545
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGlD;;;;GAIG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAExC;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,EAAE,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,MAAM,CAAC,KAAK,EAAE,SAAS,IAAI,KAAK,GAAG,SAAS,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,WAAW,GAAG,CAAC,SAAS,MAAM,CAAC,GA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,CAAC,CAAC,EAAE,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM,CACrB,KAAK,SAAS,YAAY,EAC1B,MAAM,SAAS,aAAa,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC;IAG1D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAE5C,OAAO,CAAC,EAAE,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE3F,aAAa,CAAC,EAAE,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACjJ"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aeye/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "@aeye Core - Core primitives for AI components (agents, tools, prompts)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"test:coverage": "jest --coverage",
|
|
12
|
+
"test:watch": "jest --watch",
|
|
13
|
+
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
14
|
+
"typecheck": "tsc --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai",
|
|
18
|
+
"typescript",
|
|
19
|
+
"core",
|
|
20
|
+
"primitives"
|
|
21
|
+
],
|
|
22
|
+
"author": "ClickerMonkey",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/ClickerMonkey/aeye.git",
|
|
27
|
+
"directory": "packages/core"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"handlebars": "^4.7.0",
|
|
36
|
+
"zod": "^4.1.12"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/jest": "^30.0.0",
|
|
40
|
+
"jest": "^30.2.0",
|
|
41
|
+
"ts-jest": "^29.4.5",
|
|
42
|
+
"typescript": "^5.9.3"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=16.0.0"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/ClickerMonkey/aeye#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/ClickerMonkey/aeye/issues"
|
|
53
|
+
}
|
|
54
|
+
}
|