@aigne/core 1.62.0-beta → 1.62.0-beta.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.62.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.62.0-beta.1...core-v1.62.0-beta.2) (2025-10-01)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **core:** add `include_input_in_output` option for agent definition ([#575](https://github.com/AIGNE-io/aigne-framework/issues/575)) ([9e28b72](https://github.com/AIGNE-io/aigne-framework/commit/9e28b729963faa8bea90ee42fde855868889396d))
9
+
10
+ ## [1.62.0-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.62.0-beta...core-v1.62.0-beta.1) (2025-10-01)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * prevent template rendering for agent and tool messages ([#572](https://github.com/AIGNE-io/aigne-framework/issues/572)) ([859687e](https://github.com/AIGNE-io/aigne-framework/commit/859687e499b07ffebced8b2cd89d4af676f6a462))
16
+
3
17
  ## [1.62.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.61.1-beta...core-v1.62.0-beta) (2025-09-30)
4
18
 
5
19
 
@@ -29,6 +29,7 @@ export interface BaseAgentSchema {
29
29
  inputSchema?: ZodType<Record<string, any>>;
30
30
  defaultInput?: Record<string, any>;
31
31
  outputSchema?: ZodType<Record<string, any>>;
32
+ includeInputInOutput?: boolean;
32
33
  skills?: NestAgentSchema[];
33
34
  hooks?: HooksSchema | HooksSchema[];
34
35
  memory?: boolean | {
@@ -43,6 +43,7 @@ async function parseAgentFile(path, data) {
43
43
  inputSchema: (0, schema_js_1.optionalize)((0, schema_js_1.inputOutputSchema)({ path })).transform((v) => v ? (0, json_schema_to_zod_1.jsonSchemaToZod)(v) : undefined),
44
44
  defaultInput: (0, schema_js_1.optionalize)(schema_js_1.defaultInputSchema),
45
45
  outputSchema: (0, schema_js_1.optionalize)((0, schema_js_1.inputOutputSchema)({ path })).transform((v) => v ? (0, json_schema_to_zod_1.jsonSchemaToZod)(v) : undefined),
46
+ includeInputInOutput: (0, schema_js_1.optionalize)(zod_1.z.boolean()),
46
47
  hooks: (0, schema_js_1.optionalize)(zod_1.z.union([hooksSchema, zod_1.z.array(hooksSchema)])),
47
48
  skills: (0, schema_js_1.optionalize)(zod_1.z.array(nestAgentSchema)),
48
49
  memory: (0, schema_js_1.optionalize)(zod_1.z.union([
@@ -40,31 +40,22 @@ export declare class AgentMessageTemplate extends ChatMessageTemplate {
40
40
  toolCalls?: ChatModelOutputToolCall[] | undefined;
41
41
  static from(template?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[], name?: string, options?: FormatOptions): AgentMessageTemplate;
42
42
  constructor(content?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[] | undefined, name?: string, options?: FormatOptions);
43
- format(variables?: Record<string, unknown>, options?: FormatOptions): Promise<{
43
+ format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
44
+ role: "agent" | "system" | "user" | "tool";
45
+ name: string | undefined;
46
+ content: ChatModelInputMessageContent | undefined;
44
47
  toolCalls: ChatModelOutputToolCall[] | undefined;
45
- role: import("../agents/chat-model.js").Role;
46
- content?: ChatModelInputMessageContent;
47
- toolCallId?: string;
48
- name?: string;
49
48
  }>;
50
49
  }
51
50
  export declare class ToolMessageTemplate extends ChatMessageTemplate {
52
51
  toolCallId: string;
53
52
  static from(content: object | string, toolCallId: string, name?: string, options?: FormatOptions): ToolMessageTemplate;
54
53
  constructor(content: object | string, toolCallId: string, name?: string, options?: FormatOptions);
55
- format(variables?: Record<string, unknown>, options?: FormatOptions): Promise<{
54
+ format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
55
+ role: "agent" | "system" | "user" | "tool";
56
+ name: string | undefined;
57
+ content: ChatModelInputMessageContent | undefined;
56
58
  toolCallId: string;
57
- role: import("../agents/chat-model.js").Role;
58
- content?: ChatModelInputMessageContent;
59
- toolCalls?: {
60
- id: string;
61
- type: "function";
62
- function: {
63
- name: string;
64
- arguments: import("../index.js").Message;
65
- };
66
- }[];
67
- name?: string;
68
59
  }>;
69
60
  }
70
61
  export declare class ChatMessagesTemplate {
@@ -125,9 +125,12 @@ class AgentMessageTemplate extends ChatMessageTemplate {
125
125
  super("agent", content, name, options);
126
126
  this.toolCalls = toolCalls;
127
127
  }
128
- async format(variables, options) {
128
+ async format(_variables, _options) {
129
129
  return {
130
- ...(await super.format(variables, options)),
130
+ role: this.role,
131
+ name: this.name,
132
+ // NOTE: agent message should not rendered by template
133
+ content: this.content,
131
134
  toolCalls: this.toolCalls,
132
135
  };
133
136
  }
@@ -144,9 +147,12 @@ class ToolMessageTemplate extends ChatMessageTemplate {
144
147
  : JSON.stringify(content, (_, value) => typeof value === "bigint" ? value.toString() : value), name, options);
145
148
  this.toolCallId = toolCallId;
146
149
  }
147
- async format(variables, options) {
150
+ async format(_variables, _options) {
148
151
  return {
149
- ...(await super.format(variables, options)),
152
+ role: this.role,
153
+ name: this.name,
154
+ // NOTE: tool result should not rendered by template
155
+ content: this.content,
150
156
  toolCallId: this.toolCallId,
151
157
  };
152
158
  }
@@ -29,6 +29,7 @@ export interface BaseAgentSchema {
29
29
  inputSchema?: ZodType<Record<string, any>>;
30
30
  defaultInput?: Record<string, any>;
31
31
  outputSchema?: ZodType<Record<string, any>>;
32
+ includeInputInOutput?: boolean;
32
33
  skills?: NestAgentSchema[];
33
34
  hooks?: HooksSchema | HooksSchema[];
34
35
  memory?: boolean | {
@@ -40,31 +40,22 @@ export declare class AgentMessageTemplate extends ChatMessageTemplate {
40
40
  toolCalls?: ChatModelOutputToolCall[] | undefined;
41
41
  static from(template?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[], name?: string, options?: FormatOptions): AgentMessageTemplate;
42
42
  constructor(content?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[] | undefined, name?: string, options?: FormatOptions);
43
- format(variables?: Record<string, unknown>, options?: FormatOptions): Promise<{
43
+ format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
44
+ role: "agent" | "system" | "user" | "tool";
45
+ name: string | undefined;
46
+ content: ChatModelInputMessageContent | undefined;
44
47
  toolCalls: ChatModelOutputToolCall[] | undefined;
45
- role: import("../agents/chat-model.js").Role;
46
- content?: ChatModelInputMessageContent;
47
- toolCallId?: string;
48
- name?: string;
49
48
  }>;
50
49
  }
51
50
  export declare class ToolMessageTemplate extends ChatMessageTemplate {
52
51
  toolCallId: string;
53
52
  static from(content: object | string, toolCallId: string, name?: string, options?: FormatOptions): ToolMessageTemplate;
54
53
  constructor(content: object | string, toolCallId: string, name?: string, options?: FormatOptions);
55
- format(variables?: Record<string, unknown>, options?: FormatOptions): Promise<{
54
+ format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
55
+ role: "agent" | "system" | "user" | "tool";
56
+ name: string | undefined;
57
+ content: ChatModelInputMessageContent | undefined;
56
58
  toolCallId: string;
57
- role: import("../agents/chat-model.js").Role;
58
- content?: ChatModelInputMessageContent;
59
- toolCalls?: {
60
- id: string;
61
- type: "function";
62
- function: {
63
- name: string;
64
- arguments: import("../index.js").Message;
65
- };
66
- }[];
67
- name?: string;
68
59
  }>;
69
60
  }
70
61
  export declare class ChatMessagesTemplate {
@@ -29,6 +29,7 @@ export interface BaseAgentSchema {
29
29
  inputSchema?: ZodType<Record<string, any>>;
30
30
  defaultInput?: Record<string, any>;
31
31
  outputSchema?: ZodType<Record<string, any>>;
32
+ includeInputInOutput?: boolean;
32
33
  skills?: NestAgentSchema[];
33
34
  hooks?: HooksSchema | HooksSchema[];
34
35
  memory?: boolean | {
@@ -39,6 +39,7 @@ export async function parseAgentFile(path, data) {
39
39
  inputSchema: optionalize(inputOutputSchema({ path })).transform((v) => v ? jsonSchemaToZod(v) : undefined),
40
40
  defaultInput: optionalize(defaultInputSchema),
41
41
  outputSchema: optionalize(inputOutputSchema({ path })).transform((v) => v ? jsonSchemaToZod(v) : undefined),
42
+ includeInputInOutput: optionalize(z.boolean()),
42
43
  hooks: optionalize(z.union([hooksSchema, z.array(hooksSchema)])),
43
44
  skills: optionalize(z.array(nestAgentSchema)),
44
45
  memory: optionalize(z.union([
@@ -40,31 +40,22 @@ export declare class AgentMessageTemplate extends ChatMessageTemplate {
40
40
  toolCalls?: ChatModelOutputToolCall[] | undefined;
41
41
  static from(template?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[], name?: string, options?: FormatOptions): AgentMessageTemplate;
42
42
  constructor(content?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[] | undefined, name?: string, options?: FormatOptions);
43
- format(variables?: Record<string, unknown>, options?: FormatOptions): Promise<{
43
+ format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
44
+ role: "agent" | "system" | "user" | "tool";
45
+ name: string | undefined;
46
+ content: ChatModelInputMessageContent | undefined;
44
47
  toolCalls: ChatModelOutputToolCall[] | undefined;
45
- role: import("../agents/chat-model.js").Role;
46
- content?: ChatModelInputMessageContent;
47
- toolCallId?: string;
48
- name?: string;
49
48
  }>;
50
49
  }
51
50
  export declare class ToolMessageTemplate extends ChatMessageTemplate {
52
51
  toolCallId: string;
53
52
  static from(content: object | string, toolCallId: string, name?: string, options?: FormatOptions): ToolMessageTemplate;
54
53
  constructor(content: object | string, toolCallId: string, name?: string, options?: FormatOptions);
55
- format(variables?: Record<string, unknown>, options?: FormatOptions): Promise<{
54
+ format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
55
+ role: "agent" | "system" | "user" | "tool";
56
+ name: string | undefined;
57
+ content: ChatModelInputMessageContent | undefined;
56
58
  toolCallId: string;
57
- role: import("../agents/chat-model.js").Role;
58
- content?: ChatModelInputMessageContent;
59
- toolCalls?: {
60
- id: string;
61
- type: "function";
62
- function: {
63
- name: string;
64
- arguments: import("../index.js").Message;
65
- };
66
- }[];
67
- name?: string;
68
59
  }>;
69
60
  }
70
61
  export declare class ChatMessagesTemplate {
@@ -112,9 +112,12 @@ export class AgentMessageTemplate extends ChatMessageTemplate {
112
112
  super("agent", content, name, options);
113
113
  this.toolCalls = toolCalls;
114
114
  }
115
- async format(variables, options) {
115
+ async format(_variables, _options) {
116
116
  return {
117
- ...(await super.format(variables, options)),
117
+ role: this.role,
118
+ name: this.name,
119
+ // NOTE: agent message should not rendered by template
120
+ content: this.content,
118
121
  toolCalls: this.toolCalls,
119
122
  };
120
123
  }
@@ -130,9 +133,12 @@ export class ToolMessageTemplate extends ChatMessageTemplate {
130
133
  : JSON.stringify(content, (_, value) => typeof value === "bigint" ? value.toString() : value), name, options);
131
134
  this.toolCallId = toolCallId;
132
135
  }
133
- async format(variables, options) {
136
+ async format(_variables, _options) {
134
137
  return {
135
- ...(await super.format(variables, options)),
138
+ role: this.role,
139
+ name: this.name,
140
+ // NOTE: tool result should not rendered by template
141
+ content: this.content,
136
142
  toolCallId: this.toolCallId,
137
143
  };
138
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/core",
3
- "version": "1.62.0-beta",
3
+ "version": "1.62.0-beta.2",
4
4
  "description": "The functional core of agentic AI",
5
5
  "publishConfig": {
6
6
  "access": "public"