@aigne/agent-library 1.3.1 → 1.3.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 +7 -0
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +0 -15
- package/lib/cjs/orchestrator/index.js +7 -0
- package/lib/cjs/orchestrator/orchestrator-prompts.d.ts +1 -1
- package/lib/cjs/orchestrator/orchestrator-prompts.js +2 -2
- package/lib/dts/index.d.ts +1 -1
- package/lib/dts/orchestrator/orchestrator-prompts.d.ts +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/orchestrator/index.js +7 -0
- package/lib/esm/orchestrator/orchestrator-prompts.d.ts +1 -1
- package/lib/esm/orchestrator/orchestrator-prompts.js +1 -1
- package/package.json +14 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
- chore: release 1.2.0
|
|
4
4
|
|
|
5
|
+
## [1.3.2](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.3.1...agent-library-v1.3.2) (2025-03-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **dx:** export models/utils in submodules ([#43](https://github.com/AIGNE-io/aigne-framework/issues/43)) ([bd561b3](https://github.com/AIGNE-io/aigne-framework/commit/bd561b397de816f04c2d63d58538e81fba82fc7f))
|
|
11
|
+
|
|
5
12
|
## [1.3.1](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.3.0...agent-library-v1.3.1) (2025-03-26)
|
|
6
13
|
|
|
7
14
|
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./orchestrator/index.js"), exports);
|
|
@@ -19,7 +19,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.OrchestratorAgent = void 0;
|
|
21
21
|
const core_1 = require("@aigne/core");
|
|
22
|
+
const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
|
|
22
23
|
const fastq_1 = __importDefault(require("fastq"));
|
|
24
|
+
const zod_1 = require("zod");
|
|
23
25
|
const orchestrator_prompts_js_1 = require("./orchestrator-prompts.js");
|
|
24
26
|
const DEFAULT_MAX_ITERATIONS = 30;
|
|
25
27
|
const DEFAULT_TASK_CONCURRENCY = 5;
|
|
@@ -29,6 +31,7 @@ class OrchestratorAgent extends core_1.Agent {
|
|
|
29
31
|
return new OrchestratorAgent(options);
|
|
30
32
|
}
|
|
31
33
|
constructor(options) {
|
|
34
|
+
(0, type_utils_js_1.checkArguments)("OrchestratorAgent", orchestratorAgentOptionsSchema, options);
|
|
32
35
|
super({ ...options });
|
|
33
36
|
this.maxIterations = options.maxIterations;
|
|
34
37
|
this.tasksConcurrency = options.tasksConcurrency;
|
|
@@ -156,3 +159,7 @@ function getMessageOrJsonString(output) {
|
|
|
156
159
|
}
|
|
157
160
|
return JSON.stringify(output);
|
|
158
161
|
}
|
|
162
|
+
const orchestratorAgentOptionsSchema = zod_1.z.object({
|
|
163
|
+
maxIterations: zod_1.z.number().optional(),
|
|
164
|
+
tasksConcurrency: zod_1.z.number().optional(),
|
|
165
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Agent, Message } from "@aigne/core";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = "Synthesize the results of executing all steps in the plan into a cohesive result\n";
|
|
4
4
|
export declare function getFullPlanSchema(agents: Agent[]): z.ZodObject<{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SYNTHESIZE_STEP_PROMPT_TEMPLATE = exports.TASK_PROMPT_TEMPLATE = exports.FULL_PLAN_PROMPT_TEMPLATE = exports.SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = void 0;
|
|
4
4
|
exports.getFullPlanSchema = getFullPlanSchema;
|
|
5
|
-
const
|
|
5
|
+
const json_schema_js_1 = require("@aigne/core/utils/json-schema.js");
|
|
6
6
|
const lodash_es_1 = require("lodash-es");
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
exports.SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = `\
|
|
@@ -17,7 +17,7 @@ function getFullPlanSchema(agents) {
|
|
|
17
17
|
const TaskSchema = zod_1.z.object({
|
|
18
18
|
description: zod_1.z.string().describe("Detailed description of the task"),
|
|
19
19
|
agent: zod_1.z
|
|
20
|
-
.union((0,
|
|
20
|
+
.union((0, json_schema_js_1.ensureZodUnionArray)(agents.map((i) => zod_1.z.literal(i.name))))
|
|
21
21
|
.describe("Name of the agent to execute the task"),
|
|
22
22
|
});
|
|
23
23
|
const StepSchema = zod_1.z.object({
|
package/lib/dts/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Agent, Message } from "@aigne/core";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = "Synthesize the results of executing all steps in the plan into a cohesive result\n";
|
|
4
4
|
export declare function getFullPlanSchema(agents: Agent[]): z.ZodObject<{
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AIAgent, Agent, PromptTemplate, createMessage, getMessage, } from "@aigne/core";
|
|
2
|
+
import { checkArguments } from "@aigne/core/utils/type-utils.js";
|
|
2
3
|
import fastq from "fastq";
|
|
4
|
+
import { z } from "zod";
|
|
3
5
|
import { FULL_PLAN_PROMPT_TEMPLATE, SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE, SYNTHESIZE_STEP_PROMPT_TEMPLATE, TASK_PROMPT_TEMPLATE, getFullPlanSchema, } from "./orchestrator-prompts.js";
|
|
4
6
|
const DEFAULT_MAX_ITERATIONS = 30;
|
|
5
7
|
const DEFAULT_TASK_CONCURRENCY = 5;
|
|
@@ -9,6 +11,7 @@ export class OrchestratorAgent extends Agent {
|
|
|
9
11
|
return new OrchestratorAgent(options);
|
|
10
12
|
}
|
|
11
13
|
constructor(options) {
|
|
14
|
+
checkArguments("OrchestratorAgent", orchestratorAgentOptionsSchema, options);
|
|
12
15
|
super({ ...options });
|
|
13
16
|
this.maxIterations = options.maxIterations;
|
|
14
17
|
this.tasksConcurrency = options.tasksConcurrency;
|
|
@@ -135,3 +138,7 @@ function getMessageOrJsonString(output) {
|
|
|
135
138
|
}
|
|
136
139
|
return JSON.stringify(output);
|
|
137
140
|
}
|
|
141
|
+
const orchestratorAgentOptionsSchema = z.object({
|
|
142
|
+
maxIterations: z.number().optional(),
|
|
143
|
+
tasksConcurrency: z.number().optional(),
|
|
144
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Agent, Message } from "@aigne/core";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = "Synthesize the results of executing all steps in the plan into a cohesive result\n";
|
|
4
4
|
export declare function getFullPlanSchema(agents: Agent[]): z.ZodObject<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/agent-library",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Collection of agent libraries for AIGNE framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,20 +25,27 @@
|
|
|
25
25
|
"module": "./lib/esm/index.js",
|
|
26
26
|
"types": "./lib/dts/index.d.ts",
|
|
27
27
|
"exports": {
|
|
28
|
-
"
|
|
29
|
-
"import": "./lib/esm
|
|
30
|
-
"require": "./lib/cjs
|
|
31
|
-
"types": "./lib/dts
|
|
28
|
+
"./*": {
|
|
29
|
+
"import": "./lib/esm/*",
|
|
30
|
+
"require": "./lib/cjs/*",
|
|
31
|
+
"types": "./lib/dts/*"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"typesVersions": {
|
|
35
|
+
"*": {
|
|
36
|
+
"*": [
|
|
37
|
+
"./lib/dts/*"
|
|
38
|
+
]
|
|
32
39
|
}
|
|
33
40
|
},
|
|
34
41
|
"dependencies": {
|
|
35
42
|
"fastq": "^1.19.1",
|
|
36
43
|
"lodash-es": "^4.17.21",
|
|
37
44
|
"zod": "^3.24.2",
|
|
38
|
-
"@aigne/core": "^1.
|
|
45
|
+
"@aigne/core": "^1.5.0"
|
|
39
46
|
},
|
|
40
47
|
"devDependencies": {
|
|
41
|
-
"@types/bun": "^1.2.
|
|
48
|
+
"@types/bun": "^1.2.6",
|
|
42
49
|
"npm-run-all": "^4.1.5",
|
|
43
50
|
"rimraf": "^6.0.1",
|
|
44
51
|
"typescript": "^5.8.2"
|