@aigne/core 1.40.0 → 1.41.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/CHANGELOG.md +7 -0
- package/lib/cjs/agents/agent.d.ts +8 -0
- package/lib/cjs/agents/agent.js +5 -0
- package/lib/cjs/loader/agent-yaml.js +1 -0
- package/lib/dts/agents/agent.d.ts +8 -0
- package/lib/esm/agents/agent.d.ts +8 -0
- package/lib/esm/agents/agent.js +5 -0
- package/lib/esm/loader/agent-yaml.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
* dependencies
|
|
13
13
|
* @aigne/observability bumped to 0.1.0
|
|
14
14
|
|
|
15
|
+
## [1.41.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.40.0...core-v1.41.0) (2025-07-31)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **cli:** add alias support for agent ([#297](https://github.com/AIGNE-io/aigne-framework/issues/297)) ([fa166ab](https://github.com/AIGNE-io/aigne-framework/commit/fa166ab66d19e89ddd32c34e1470450eb4fbdbbd))
|
|
21
|
+
|
|
15
22
|
## [1.40.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.39.0...core-v1.40.0) (2025-07-31)
|
|
16
23
|
|
|
17
24
|
|
|
@@ -61,6 +61,10 @@ export interface AgentOptions<I extends Message = Message, O extends Message = M
|
|
|
61
61
|
* if not specified
|
|
62
62
|
*/
|
|
63
63
|
name?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
66
|
+
*/
|
|
67
|
+
alias?: string[];
|
|
64
68
|
/**
|
|
65
69
|
* Description of the agent
|
|
66
70
|
*
|
|
@@ -232,6 +236,10 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
|
|
|
232
236
|
* Defaults to the class constructor name if not specified in options
|
|
233
237
|
*/
|
|
234
238
|
readonly name: string;
|
|
239
|
+
/**
|
|
240
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
241
|
+
*/
|
|
242
|
+
readonly alias?: string[];
|
|
235
243
|
/**
|
|
236
244
|
* Default topic this agent subscribes to
|
|
237
245
|
*
|
package/lib/cjs/agents/agent.js
CHANGED
|
@@ -102,6 +102,7 @@ class Agent {
|
|
|
102
102
|
constructor(options = {}) {
|
|
103
103
|
const { inputSchema, outputSchema } = options;
|
|
104
104
|
this.name = options.name || this.constructor.name;
|
|
105
|
+
this.alias = options.alias;
|
|
105
106
|
this.description = options.description;
|
|
106
107
|
if (inputSchema)
|
|
107
108
|
checkAgentInputOutputSchema(inputSchema);
|
|
@@ -170,6 +171,10 @@ class Agent {
|
|
|
170
171
|
* Defaults to the class constructor name if not specified in options
|
|
171
172
|
*/
|
|
172
173
|
name;
|
|
174
|
+
/**
|
|
175
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
176
|
+
*/
|
|
177
|
+
alias;
|
|
173
178
|
/**
|
|
174
179
|
* Default topic this agent subscribes to
|
|
175
180
|
*
|
|
@@ -32,6 +32,7 @@ async function parseAgentFile(path, data) {
|
|
|
32
32
|
}));
|
|
33
33
|
const baseAgentSchema = zod_1.z.object({
|
|
34
34
|
name: (0, schema_js_1.optionalize)(zod_1.z.string()),
|
|
35
|
+
alias: (0, schema_js_1.optionalize)(zod_1.z.array(zod_1.z.string())),
|
|
35
36
|
description: (0, schema_js_1.optionalize)(zod_1.z.string()),
|
|
36
37
|
inputSchema: (0, schema_js_1.optionalize)((0, schema_js_1.inputOutputSchema)({ path })).transform((v) => v ? (0, json_schema_to_zod_1.jsonSchemaToZod)(v) : undefined),
|
|
37
38
|
defaultInput: (0, schema_js_1.optionalize)(schema_js_1.defaultInputSchema),
|
|
@@ -61,6 +61,10 @@ export interface AgentOptions<I extends Message = Message, O extends Message = M
|
|
|
61
61
|
* if not specified
|
|
62
62
|
*/
|
|
63
63
|
name?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
66
|
+
*/
|
|
67
|
+
alias?: string[];
|
|
64
68
|
/**
|
|
65
69
|
* Description of the agent
|
|
66
70
|
*
|
|
@@ -232,6 +236,10 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
|
|
|
232
236
|
* Defaults to the class constructor name if not specified in options
|
|
233
237
|
*/
|
|
234
238
|
readonly name: string;
|
|
239
|
+
/**
|
|
240
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
241
|
+
*/
|
|
242
|
+
readonly alias?: string[];
|
|
235
243
|
/**
|
|
236
244
|
* Default topic this agent subscribes to
|
|
237
245
|
*
|
|
@@ -61,6 +61,10 @@ export interface AgentOptions<I extends Message = Message, O extends Message = M
|
|
|
61
61
|
* if not specified
|
|
62
62
|
*/
|
|
63
63
|
name?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
66
|
+
*/
|
|
67
|
+
alias?: string[];
|
|
64
68
|
/**
|
|
65
69
|
* Description of the agent
|
|
66
70
|
*
|
|
@@ -232,6 +236,10 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
|
|
|
232
236
|
* Defaults to the class constructor name if not specified in options
|
|
233
237
|
*/
|
|
234
238
|
readonly name: string;
|
|
239
|
+
/**
|
|
240
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
241
|
+
*/
|
|
242
|
+
readonly alias?: string[];
|
|
235
243
|
/**
|
|
236
244
|
* Default topic this agent subscribes to
|
|
237
245
|
*
|
package/lib/esm/agents/agent.js
CHANGED
|
@@ -57,6 +57,7 @@ export class Agent {
|
|
|
57
57
|
constructor(options = {}) {
|
|
58
58
|
const { inputSchema, outputSchema } = options;
|
|
59
59
|
this.name = options.name || this.constructor.name;
|
|
60
|
+
this.alias = options.alias;
|
|
60
61
|
this.description = options.description;
|
|
61
62
|
if (inputSchema)
|
|
62
63
|
checkAgentInputOutputSchema(inputSchema);
|
|
@@ -125,6 +126,10 @@ export class Agent {
|
|
|
125
126
|
* Defaults to the class constructor name if not specified in options
|
|
126
127
|
*/
|
|
127
128
|
name;
|
|
129
|
+
/**
|
|
130
|
+
* Alias for the agent, can be used to refer to the agent by multiple names, especially in AIGNE CLI
|
|
131
|
+
*/
|
|
132
|
+
alias;
|
|
128
133
|
/**
|
|
129
134
|
* Default topic this agent subscribes to
|
|
130
135
|
*
|
|
@@ -28,6 +28,7 @@ export async function parseAgentFile(path, data) {
|
|
|
28
28
|
}));
|
|
29
29
|
const baseAgentSchema = z.object({
|
|
30
30
|
name: optionalize(z.string()),
|
|
31
|
+
alias: optionalize(z.array(z.string())),
|
|
31
32
|
description: optionalize(z.string()),
|
|
32
33
|
inputSchema: optionalize(inputOutputSchema({ path })).transform((v) => v ? jsonSchemaToZod(v) : undefined),
|
|
33
34
|
defaultInput: optionalize(defaultInputSchema),
|