@aigne/core 1.65.1-beta.2 → 1.66.0-beta.3

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/cjs/agents/agent.d.ts +2 -6
  3. package/lib/cjs/agents/agent.js +5 -1
  4. package/lib/cjs/agents/ai-agent.js +1 -0
  5. package/lib/cjs/agents/chat-model.d.ts +6 -4
  6. package/lib/cjs/agents/chat-model.js +30 -11
  7. package/lib/cjs/agents/image-model.d.ts +2 -1
  8. package/lib/cjs/agents/types.d.ts +14 -1
  9. package/lib/cjs/agents/types.js +14 -0
  10. package/lib/cjs/agents/video-model.d.ts +2 -1
  11. package/lib/cjs/aigne/context.js +4 -1
  12. package/lib/cjs/loader/agent-js.js +2 -1
  13. package/lib/cjs/loader/error.d.ts +2 -0
  14. package/lib/cjs/loader/error.js +6 -0
  15. package/lib/cjs/loader/index.d.ts +140 -28
  16. package/lib/cjs/loader/index.js +8 -4
  17. package/lib/cjs/loader/schema.d.ts +107 -23
  18. package/lib/cjs/loader/schema.js +9 -14
  19. package/lib/dts/agents/agent.d.ts +2 -6
  20. package/lib/dts/agents/chat-model.d.ts +6 -4
  21. package/lib/dts/agents/image-model.d.ts +2 -1
  22. package/lib/dts/agents/types.d.ts +14 -1
  23. package/lib/dts/agents/video-model.d.ts +2 -1
  24. package/lib/dts/loader/error.d.ts +2 -0
  25. package/lib/dts/loader/index.d.ts +140 -28
  26. package/lib/dts/loader/schema.d.ts +107 -23
  27. package/lib/esm/agents/agent.d.ts +2 -6
  28. package/lib/esm/agents/agent.js +5 -1
  29. package/lib/esm/agents/ai-agent.js +1 -0
  30. package/lib/esm/agents/chat-model.d.ts +6 -4
  31. package/lib/esm/agents/chat-model.js +31 -12
  32. package/lib/esm/agents/image-model.d.ts +2 -1
  33. package/lib/esm/agents/types.d.ts +14 -1
  34. package/lib/esm/agents/types.js +10 -0
  35. package/lib/esm/agents/video-model.d.ts +2 -1
  36. package/lib/esm/aigne/context.js +4 -1
  37. package/lib/esm/loader/agent-js.js +2 -1
  38. package/lib/esm/loader/error.d.ts +2 -0
  39. package/lib/esm/loader/error.js +2 -0
  40. package/lib/esm/loader/index.d.ts +140 -28
  41. package/lib/esm/loader/index.js +8 -4
  42. package/lib/esm/loader/schema.d.ts +107 -23
  43. package/lib/esm/loader/schema.js +10 -15
  44. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.66.0-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.65.1-beta.3...core-v1.66.0-beta.3) (2025-11-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * add dynamic model options resolution with getter pattern ([#708](https://github.com/AIGNE-io/aigne-framework/issues/708)) ([5ed5085](https://github.com/AIGNE-io/aigne-framework/commit/5ed5085203763c70194853c56edc13acf56d81c6))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **core:** change skills loading from Promise.all to sequential for loop ([#704](https://github.com/AIGNE-io/aigne-framework/issues/704)) ([08ac827](https://github.com/AIGNE-io/aigne-framework/commit/08ac8270285bdbafe171705f43ac32654430b745))
14
+
15
+ ## [1.65.1-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.65.1-beta.2...core-v1.65.1-beta.3) (2025-11-05)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add taskTitle to observability traces and fix GPT-5/o1 model parameters ([#700](https://github.com/AIGNE-io/aigne-framework/issues/700)) ([30b513b](https://github.com/AIGNE-io/aigne-framework/commit/30b513b46ab5edb58a37f29e566e311bbb389f44))
21
+ * **cli:** only auto-reinstall on agent loading errors ([#702](https://github.com/AIGNE-io/aigne-framework/issues/702)) ([52f61a4](https://github.com/AIGNE-io/aigne-framework/commit/52f61a47537f2be8763f7bd45b8baea94cf43e60))
22
+
23
+
24
+ ### Dependencies
25
+
26
+ * The following workspace dependencies were updated
27
+ * dependencies
28
+ * @aigne/observability-api bumped to 0.11.5-beta.2
29
+
3
30
  ## [1.65.1-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.65.1-beta.1...core-v1.65.1-beta.2) (2025-11-04)
4
31
 
5
32
 
@@ -12,7 +12,7 @@ import { type Nullish, type PromiseOrValue, type XOr } from "../utils/type-utils
12
12
  import type { ChatModel } from "./chat-model.js";
13
13
  import type { GuideRailAgent, GuideRailAgentOutput } from "./guide-rail-agent.js";
14
14
  import type { ImageModel } from "./image-model.js";
15
- import { type TransferAgentOutput } from "./types.js";
15
+ import { type GetterSchema, type TransferAgentOutput } from "./types.js";
16
16
  export * from "./types.js";
17
17
  export declare const DEFAULT_INPUT_ACTION_GET = "$get";
18
18
  /**
@@ -293,11 +293,7 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
293
293
  renderTaskTitle(input: I): Promise<string | undefined>;
294
294
  taskRenderMode?: TaskRenderMode;
295
295
  private readonly _inputSchema?;
296
- defaultInput?: Partial<{
297
- [key in keyof I]: {
298
- [DEFAULT_INPUT_ACTION_GET]: string;
299
- } | I[key];
300
- }>;
296
+ defaultInput?: GetterSchema<I>;
301
297
  private readonly _outputSchema?;
302
298
  /**
303
299
  * Get the input data schema for this agent
@@ -411,7 +411,11 @@ class Agent {
411
411
  input = this.mergeDefaultInput(input);
412
412
  logger_js_1.logger.debug("Invoke agent %s started with input: %O", this.name, input);
413
413
  if (!this.disableEvents)
414
- opts.context.emit("agentStarted", { agent: this, input });
414
+ opts.context.emit("agentStarted", {
415
+ agent: this,
416
+ input,
417
+ taskTitle: await this.renderTaskTitle(input),
418
+ });
415
419
  try {
416
420
  const s = await this.callHooks("onStart", { input }, opts);
417
421
  if (s?.input)
@@ -309,6 +309,7 @@ class AIAgent extends agent_js_1.Agent {
309
309
  input,
310
310
  model,
311
311
  });
312
+ modelInput.modelOptions = await model.getModelOptions(input, options);
312
313
  const toolsMap = new Map(toolAgents?.map((i) => [i.name, i]));
313
314
  if (this.toolChoice === "router") {
314
315
  return yield* this._processRouter(input, model, modelInput, options, toolsMap);
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { type PromiseOrValue } from "../utils/type-utils.js";
3
- import { type AgentInvokeOptions, type AgentOptions, type AgentProcessResult, type AgentResponse, type AgentResponseStream, type Message } from "./agent.js";
3
+ import { type AgentInvokeOptions, type AgentOptions, type AgentProcessResult, type AgentResponse, type AgentResponseStream, type GetterSchema, type Message } from "./agent.js";
4
4
  import { type FileType, type FileUnionContent, Model } from "./model.js";
5
5
  export declare class StructuredOutputError extends Error {
6
6
  }
7
7
  export interface ChatModelOptions extends Omit<AgentOptions<ChatModelInput, ChatModelOutput>, "model" | "inputSchema" | "outputSchema"> {
8
8
  model?: string;
9
- modelOptions?: Omit<ChatModelInputOptions, "model">;
9
+ modelOptions?: ChatModelInputOptionsWithGetter;
10
10
  }
11
11
  /**
12
12
  * ChatModel is an abstract base class for interacting with Large Language Models (LLMs).
@@ -40,6 +40,7 @@ export declare abstract class ChatModel extends Model<ChatModelInput, ChatModelO
40
40
  apiKey?: string;
41
41
  model?: string;
42
42
  }>;
43
+ getModelOptions(input: Message, options: AgentInvokeOptions): Promise<ChatModelInputOptions>;
43
44
  /**
44
45
  * Indicates whether the model supports parallel tool calls
45
46
  *
@@ -156,7 +157,7 @@ export interface ChatModelInput extends Message {
156
157
  /**
157
158
  * Model-specific configuration options
158
159
  */
159
- modelOptions?: ChatModelInputOptions;
160
+ modelOptions?: ChatModelInputOptionsWithGetter;
160
161
  }
161
162
  /**
162
163
  * Message role types
@@ -361,7 +362,7 @@ export type Modality = "text" | "image" | "audio";
361
362
  *
362
363
  * Contains various parameters for controlling model behavior, such as model name, temperature, etc.
363
364
  */
364
- export interface ChatModelInputOptions {
365
+ export interface ChatModelInputOptions extends Record<string, unknown> {
365
366
  /**
366
367
  * Model name or version
367
368
  */
@@ -390,6 +391,7 @@ export interface ChatModelInputOptions {
390
391
  preferInputFileType?: "file" | "url";
391
392
  reasoningEffort?: number | "minimal" | "low" | "medium" | "high";
392
393
  }
394
+ export type ChatModelInputOptionsWithGetter = GetterSchema<ChatModelInputOptions>;
393
395
  /**
394
396
  * Output message format for ChatModel
395
397
  *
@@ -98,6 +98,27 @@ class ChatModel extends model_js_1.Model {
98
98
  get credential() {
99
99
  return {};
100
100
  }
101
+ async getModelOptions(input, options) {
102
+ const result = {};
103
+ for (const [key, val] of Object.entries({
104
+ ...this.options?.modelOptions,
105
+ ...("modelOptions" in input ? input.modelOptions : {}),
106
+ })) {
107
+ if (val &&
108
+ typeof val === "object" &&
109
+ agent_js_1.DEFAULT_INPUT_ACTION_GET in val &&
110
+ typeof val[agent_js_1.DEFAULT_INPUT_ACTION_GET] === "string") {
111
+ const getterPath = val[agent_js_1.DEFAULT_INPUT_ACTION_GET];
112
+ const value = input[getterPath] ?? options.context.userContext[getterPath];
113
+ if (!(0, type_utils_js_1.isNil)(value))
114
+ Object.assign(result, { [key]: value });
115
+ }
116
+ else {
117
+ Object.assign(result, { [key]: val });
118
+ }
119
+ }
120
+ return result;
121
+ }
101
122
  /**
102
123
  * Indicates whether the model supports parallel tool calls
103
124
  *
@@ -330,22 +351,20 @@ const chatModelInputToolChoiceSchema = zod_1.z.union([
330
351
  chatModelInputToolSchema,
331
352
  ]);
332
353
  const modelOptionsSchema = zod_1.z.object({
333
- model: zod_1.z.string().optional(),
334
- temperature: zod_1.z.number().optional(),
335
- topP: zod_1.z.number().optional(),
336
- frequencyPenalty: zod_1.z.number().optional(),
337
- presencePenalty: zod_1.z.number().optional(),
338
- parallelToolCalls: zod_1.z.boolean().optional().default(true),
339
- modalities: zod_1.z.array(zod_1.z.enum(["text", "image", "audio"])).optional(),
340
- reasoningEffort: zod_1.z
341
- .union([
354
+ model: (0, agent_js_1.getterSchema)(zod_1.z.string()).optional(),
355
+ temperature: (0, agent_js_1.getterSchema)(zod_1.z.number()).optional(),
356
+ topP: (0, agent_js_1.getterSchema)(zod_1.z.number()).optional(),
357
+ frequencyPenalty: (0, agent_js_1.getterSchema)(zod_1.z.number()).optional(),
358
+ presencePenalty: (0, agent_js_1.getterSchema)(zod_1.z.number()).optional(),
359
+ parallelToolCalls: (0, agent_js_1.getterSchema)(zod_1.z.boolean()).optional().default(true),
360
+ modalities: (0, agent_js_1.getterSchema)(zod_1.z.array(zod_1.z.enum(["text", "image", "audio"]))).optional(),
361
+ reasoningEffort: (0, agent_js_1.getterSchema)(zod_1.z.union([
342
362
  zod_1.z.number(),
343
363
  zod_1.z.literal("minimal"),
344
364
  zod_1.z.literal("low"),
345
365
  zod_1.z.literal("medium"),
346
366
  zod_1.z.literal("high"),
347
- ])
348
- .optional(),
367
+ ])).optional(),
349
368
  });
350
369
  const chatModelOptionsSchema = agent_js_1.agentOptionsSchema.extend({
351
370
  model: zod_1.z.string().optional(),
@@ -1,6 +1,6 @@
1
1
  import { type ZodType, z } from "zod";
2
2
  import type { PromiseOrValue } from "../utils/type-utils.js";
3
- import type { AgentInvokeOptions, AgentOptions, AgentProcessResult, AgentResponse, AgentResponseStream, Message } from "./agent.js";
3
+ import type { AgentInvokeOptions, AgentOptions, AgentProcessResult, AgentResponse, AgentResponseStream, GetterSchema, Message } from "./agent.js";
4
4
  import { type ChatModelOutputUsage } from "./chat-model.js";
5
5
  import { type FileType, type FileUnionContent, Model } from "./model.js";
6
6
  export interface ImageModelOptions<I extends ImageModelInput = ImageModelInput, O extends ImageModelOutput = ImageModelOutput> extends Omit<AgentOptions<I, O>, "model"> {
@@ -33,6 +33,7 @@ export interface ImageModelInputOptions extends Record<string, unknown> {
33
33
  model?: string;
34
34
  preferInputFileType?: "file" | "url";
35
35
  }
36
+ export type ImageModelInputOptionsWithGetter = GetterSchema<ImageModelInputOptions>;
36
37
  export declare const imageModelInputSchema: z.ZodObject<{
37
38
  prompt: z.ZodString;
38
39
  image: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -1,4 +1,5 @@
1
- import type { Agent, Message } from "./agent.js";
1
+ import z, { type ZodType } from "zod";
2
+ import { type Agent, DEFAULT_INPUT_ACTION_GET, type Message } from "./agent.js";
2
3
  export declare const transferAgentOutputKey = "$transferAgentTo";
3
4
  export interface TransferAgentOutput extends Message {
4
5
  [transferAgentOutputKey]: {
@@ -8,3 +9,15 @@ export interface TransferAgentOutput extends Message {
8
9
  export declare function transferToAgentOutput(agent: Agent): TransferAgentOutput;
9
10
  export declare function isTransferAgentOutput(output: Message): output is TransferAgentOutput;
10
11
  export declare function replaceTransferAgentToName(output: Message): Message;
12
+ export type GetterSchema<I extends Record<string, unknown>> = Partial<{
13
+ [key in keyof I]: {
14
+ [DEFAULT_INPUT_ACTION_GET]: string;
15
+ } | I[key];
16
+ }>;
17
+ export declare function getterSchema<T extends ZodType>(schema: T): z.ZodUnion<[T, z.ZodObject<{
18
+ $get: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ $get: string;
21
+ }, {
22
+ $get: string;
23
+ }>]>;
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.transferAgentOutputKey = void 0;
4
7
  exports.transferToAgentOutput = transferToAgentOutput;
5
8
  exports.isTransferAgentOutput = isTransferAgentOutput;
6
9
  exports.replaceTransferAgentToName = replaceTransferAgentToName;
10
+ exports.getterSchema = getterSchema;
11
+ const zod_1 = __importDefault(require("zod"));
12
+ const agent_js_1 = require("./agent.js");
7
13
  exports.transferAgentOutputKey = "$transferAgentTo";
8
14
  function transferToAgentOutput(agent) {
9
15
  return {
@@ -24,3 +30,11 @@ function replaceTransferAgentToName(output) {
24
30
  }
25
31
  return output;
26
32
  }
33
+ function getterSchema(schema) {
34
+ return zod_1.default.union([
35
+ schema,
36
+ zod_1.default.object({
37
+ [agent_js_1.DEFAULT_INPUT_ACTION_GET]: zod_1.default.string(),
38
+ }),
39
+ ]);
40
+ }
@@ -1,6 +1,6 @@
1
1
  import { type ZodType, z } from "zod";
2
2
  import type { PromiseOrValue } from "../utils/type-utils.js";
3
- import type { AgentInvokeOptions, AgentOptions, AgentProcessResult, AgentResponse, AgentResponseStream, Message } from "./agent.js";
3
+ import type { AgentInvokeOptions, AgentOptions, AgentProcessResult, AgentResponse, AgentResponseStream, GetterSchema, Message } from "./agent.js";
4
4
  import { type ChatModelOutputUsage } from "./chat-model.js";
5
5
  import { type FileType, type FileUnionContent, Model } from "./model.js";
6
6
  export interface VideoModelOptions<I extends VideoModelInput = VideoModelInput, O extends VideoModelOutput = VideoModelOutput> extends Omit<AgentOptions<I, O>, "model"> {
@@ -33,6 +33,7 @@ export interface VideoModelInput extends Message {
33
33
  export interface VideoModelInputOptions extends Record<string, unknown> {
34
34
  model?: string;
35
35
  }
36
+ export type VideoModelInputOptionsWithGetter = GetterSchema<VideoModelInputOptions>;
36
37
  export declare const videoModelInputSchema: z.ZodObject<{
37
38
  prompt: z.ZodString;
38
39
  model: z.ZodOptional<z.ZodString>;
@@ -210,7 +210,7 @@ class AIGNEContext {
210
210
  try {
211
211
  switch (eventName) {
212
212
  case "agentStarted": {
213
- const { agent, input } = args[0];
213
+ const { agent, input, taskTitle } = args[0];
214
214
  span.updateName(agent.name);
215
215
  span.setAttribute("custom.trace_id", this.rootId);
216
216
  span.setAttribute("custom.span_id", this.id);
@@ -221,6 +221,9 @@ class AIGNEContext {
221
221
  span.setAttribute("custom.started_at", b.timestamp);
222
222
  span.setAttribute("input", JSON.stringify(input));
223
223
  span.setAttribute("agentTag", agent.tag ?? "UnknownAgent");
224
+ if (taskTitle) {
225
+ span.setAttribute("taskTitle", taskTitle);
226
+ }
224
227
  try {
225
228
  span.setAttribute("userContext", JSON.stringify(this.userContext));
226
229
  }
@@ -5,11 +5,12 @@ const index_js_1 = require("@aigne/platform-helpers/nodejs/index.js");
5
5
  const agent_js_1 = require("../agents/agent.js");
6
6
  const type_utils_js_1 = require("../utils/type-utils.js");
7
7
  const agent_yaml_js_1 = require("./agent-yaml.js");
8
+ const error_js_1 = require("./error.js");
8
9
  const importFn = new Function("path", "return import(path)");
9
10
  async function loadAgentFromJsFile(path) {
10
11
  if (index_js_1.nodejs.path.isAbsolute(path))
11
12
  path = index_js_1.nodejs.url.pathToFileURL(path).toString();
12
- const { default: agent } = await (0, type_utils_js_1.tryOrThrow)(() => importFn(path), (error) => new Error(`Failed to load agent definition from ${path}: ${error.message}`));
13
+ const { default: agent } = await (0, type_utils_js_1.tryOrThrow)(() => importFn(path), (error) => new error_js_1.LoadJsAgentError(`Failed to load agent definition from ${path}: ${error.message}`));
13
14
  if (agent instanceof agent_js_1.Agent)
14
15
  return agent;
15
16
  if (typeof agent !== "function") {
@@ -0,0 +1,2 @@
1
+ export declare class LoadJsAgentError extends Error {
2
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadJsAgentError = void 0;
4
+ class LoadJsAgentError extends Error {
5
+ }
6
+ exports.LoadJsAgentError = LoadJsAgentError;
@@ -33,24 +33,80 @@ declare const aigneFileSchema: z.ZodObject<{
33
33
  name: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
34
34
  description: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
35
35
  model: ZodType<z.objectInputType<{
36
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
37
- temperature: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
38
- topP: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
39
- frequencyPenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
40
- presencePenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
41
- thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | undefined>;
36
+ model: ZodType<string | {
37
+ $get: string;
38
+ } | undefined, z.ZodTypeDef, string | {
39
+ $get: string;
40
+ } | undefined>;
41
+ temperature: ZodType<number | {
42
+ $get: string;
43
+ } | undefined, z.ZodTypeDef, number | {
44
+ $get: string;
45
+ } | undefined>;
46
+ topP: ZodType<number | {
47
+ $get: string;
48
+ } | undefined, z.ZodTypeDef, number | {
49
+ $get: string;
50
+ } | undefined>;
51
+ frequencyPenalty: ZodType<number | {
52
+ $get: string;
53
+ } | undefined, z.ZodTypeDef, number | {
54
+ $get: string;
55
+ } | undefined>;
56
+ presencePenalty: ZodType<number | {
57
+ $get: string;
58
+ } | undefined, z.ZodTypeDef, number | {
59
+ $get: string;
60
+ } | undefined>;
61
+ thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | {
62
+ $get: string;
63
+ } | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | {
64
+ $get: string;
65
+ } | undefined>;
42
66
  }, z.ZodTypeAny, "passthrough"> | undefined, z.ZodTypeDef, z.objectInputType<{
43
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
44
- temperature: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
45
- topP: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
46
- frequencyPenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
47
- presencePenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
48
- thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | undefined>;
67
+ model: ZodType<string | {
68
+ $get: string;
69
+ } | undefined, z.ZodTypeDef, string | {
70
+ $get: string;
71
+ } | undefined>;
72
+ temperature: ZodType<number | {
73
+ $get: string;
74
+ } | undefined, z.ZodTypeDef, number | {
75
+ $get: string;
76
+ } | undefined>;
77
+ topP: ZodType<number | {
78
+ $get: string;
79
+ } | undefined, z.ZodTypeDef, number | {
80
+ $get: string;
81
+ } | undefined>;
82
+ frequencyPenalty: ZodType<number | {
83
+ $get: string;
84
+ } | undefined, z.ZodTypeDef, number | {
85
+ $get: string;
86
+ } | undefined>;
87
+ presencePenalty: ZodType<number | {
88
+ $get: string;
89
+ } | undefined, z.ZodTypeDef, number | {
90
+ $get: string;
91
+ } | undefined>;
92
+ thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | {
93
+ $get: string;
94
+ } | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | {
95
+ $get: string;
96
+ } | undefined>;
49
97
  }, z.ZodTypeAny, "passthrough"> | undefined>;
50
98
  imageModel: ZodType<z.objectInputType<{
51
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
99
+ model: ZodType<string | {
100
+ $get: string;
101
+ } | undefined, z.ZodTypeDef, string | {
102
+ $get: string;
103
+ } | undefined>;
52
104
  }, z.ZodTypeAny, "passthrough"> | undefined, z.ZodTypeDef, z.objectInputType<{
53
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
105
+ model: ZodType<string | {
106
+ $get: string;
107
+ } | undefined, z.ZodTypeDef, string | {
108
+ $get: string;
109
+ } | undefined>;
54
110
  }, z.ZodTypeAny, "passthrough"> | undefined>;
55
111
  agents: ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
56
112
  skills: ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
@@ -68,17 +124,45 @@ declare const aigneFileSchema: z.ZodObject<{
68
124
  } | undefined>;
69
125
  }, "strip", z.ZodTypeAny, {
70
126
  model?: z.objectInputType<{
71
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
72
- temperature: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
73
- topP: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
74
- frequencyPenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
75
- presencePenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
76
- thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | undefined>;
127
+ model: ZodType<string | {
128
+ $get: string;
129
+ } | undefined, z.ZodTypeDef, string | {
130
+ $get: string;
131
+ } | undefined>;
132
+ temperature: ZodType<number | {
133
+ $get: string;
134
+ } | undefined, z.ZodTypeDef, number | {
135
+ $get: string;
136
+ } | undefined>;
137
+ topP: ZodType<number | {
138
+ $get: string;
139
+ } | undefined, z.ZodTypeDef, number | {
140
+ $get: string;
141
+ } | undefined>;
142
+ frequencyPenalty: ZodType<number | {
143
+ $get: string;
144
+ } | undefined, z.ZodTypeDef, number | {
145
+ $get: string;
146
+ } | undefined>;
147
+ presencePenalty: ZodType<number | {
148
+ $get: string;
149
+ } | undefined, z.ZodTypeDef, number | {
150
+ $get: string;
151
+ } | undefined>;
152
+ thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | {
153
+ $get: string;
154
+ } | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | {
155
+ $get: string;
156
+ } | undefined>;
77
157
  }, z.ZodTypeAny, "passthrough"> | undefined;
78
158
  name?: string | undefined;
79
159
  description?: string | undefined;
80
160
  imageModel?: z.objectInputType<{
81
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
161
+ model: ZodType<string | {
162
+ $get: string;
163
+ } | undefined, z.ZodTypeDef, string | {
164
+ $get: string;
165
+ } | undefined>;
82
166
  }, z.ZodTypeAny, "passthrough"> | undefined;
83
167
  skills?: string[] | undefined;
84
168
  agents?: string[] | undefined;
@@ -91,17 +175,45 @@ declare const aigneFileSchema: z.ZodObject<{
91
175
  } | undefined;
92
176
  }, {
93
177
  model?: z.objectInputType<{
94
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
95
- temperature: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
96
- topP: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
97
- frequencyPenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
98
- presencePenalty: ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
99
- thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | undefined>;
178
+ model: ZodType<string | {
179
+ $get: string;
180
+ } | undefined, z.ZodTypeDef, string | {
181
+ $get: string;
182
+ } | undefined>;
183
+ temperature: ZodType<number | {
184
+ $get: string;
185
+ } | undefined, z.ZodTypeDef, number | {
186
+ $get: string;
187
+ } | undefined>;
188
+ topP: ZodType<number | {
189
+ $get: string;
190
+ } | undefined, z.ZodTypeDef, number | {
191
+ $get: string;
192
+ } | undefined>;
193
+ frequencyPenalty: ZodType<number | {
194
+ $get: string;
195
+ } | undefined, z.ZodTypeDef, number | {
196
+ $get: string;
197
+ } | undefined>;
198
+ presencePenalty: ZodType<number | {
199
+ $get: string;
200
+ } | undefined, z.ZodTypeDef, number | {
201
+ $get: string;
202
+ } | undefined>;
203
+ thinkingEffort: ZodType<number | "high" | "medium" | "low" | "minimal" | {
204
+ $get: string;
205
+ } | undefined, z.ZodTypeDef, number | "high" | "medium" | "low" | "minimal" | {
206
+ $get: string;
207
+ } | undefined>;
100
208
  }, z.ZodTypeAny, "passthrough"> | undefined;
101
209
  name?: string | undefined;
102
210
  description?: string | undefined;
103
211
  imageModel?: z.objectInputType<{
104
- model: ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
212
+ model: ZodType<string | {
213
+ $get: string;
214
+ } | undefined, z.ZodTypeDef, string | {
215
+ $get: string;
216
+ } | undefined>;
105
217
  }, z.ZodTypeAny, "passthrough"> | undefined;
106
218
  skills?: string[] | undefined;
107
219
  agents?: string[] | undefined;
@@ -105,11 +105,15 @@ async function parseHooks(path, hooks, options) {
105
105
  onHandoff: hook.onHandoff ? await loadNestAgent(path, hook.onHandoff, options) : undefined,
106
106
  })));
107
107
  }
108
+ async function loadSkills(path, skills, options) {
109
+ const loadedSkills = [];
110
+ for (const skill of skills) {
111
+ loadedSkills.push(await loadNestAgent(path, skill, options));
112
+ }
113
+ return loadedSkills;
114
+ }
108
115
  async function parseAgent(path, agent, options, agentOptions) {
109
- const skills = "skills" in agent
110
- ? agent.skills &&
111
- (await Promise.all(agent.skills.map((skill) => loadNestAgent(path, skill, options))))
112
- : undefined;
116
+ const skills = "skills" in agent && agent.skills ? await loadSkills(path, agent.skills, options) : undefined;
113
117
  const memory = "memory" in agent && options?.memories?.length
114
118
  ? await loadMemory(options.memories, typeof agent.memory === "object" ? agent.memory.provider : undefined, typeof agent.memory === "object" ? agent.memory : {})
115
119
  : undefined;