@aigne/agent-library 1.3.2 → 1.5.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 CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  - chore: release 1.2.0
4
4
 
5
+ ## [1.5.0](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.4.0...agent-library-v1.5.0) (2025-04-15)
6
+
7
+
8
+ ### Features
9
+
10
+ * add TerminalTracer for better UX in terminal ([#56](https://github.com/AIGNE-io/aigne-framework/issues/56)) ([9875a5d](https://github.com/AIGNE-io/aigne-framework/commit/9875a5d46abb55073340ffae841fed6bd6b83ff4))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * remove usage of new Node.js exists API for compatibility ([#57](https://github.com/AIGNE-io/aigne-framework/issues/57)) ([c10cc08](https://github.com/AIGNE-io/aigne-framework/commit/c10cc086d8ecd0744f38cdb1367d4c8816b723b3))
16
+
17
+ ## [1.4.0](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.3.2...agent-library-v1.4.0) (2025-04-08)
18
+
19
+
20
+ ### Features
21
+
22
+ * add `serve` command for @aigne/cli ([#54](https://github.com/AIGNE-io/aigne-framework/issues/54)) ([1cca843](https://github.com/AIGNE-io/aigne-framework/commit/1cca843f1760abe832b6651108fa858130f47355))
23
+ * add agent library support ([#51](https://github.com/AIGNE-io/aigne-framework/issues/51)) ([1f0d34d](https://github.com/AIGNE-io/aigne-framework/commit/1f0d34ddda3154283a4bc958ddb9b68b4ac106b0))
24
+ * support token/call/time limits for ExecutionEngine ([#44](https://github.com/AIGNE-io/aigne-framework/issues/44)) ([5a2ca0a](https://github.com/AIGNE-io/aigne-framework/commit/5a2ca0a033267dd4765f574b53dca71e932e53d4))
25
+
5
26
  ## [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
27
 
7
28
 
@@ -19,7 +19,7 @@ export declare class OrchestratorAgent<I extends Message = Message, O extends Me
19
19
  private completer;
20
20
  maxIterations?: number;
21
21
  tasksConcurrency?: number;
22
- process(input: I, context?: Context): Promise<O>;
22
+ process(input: I, context: Context): Promise<O>;
23
23
  private getFullPlanInput;
24
24
  private getFullPlan;
25
25
  private synthesizePlanResult;
@@ -51,7 +51,7 @@ class OrchestratorAgent extends core_1.Agent {
51
51
  maxIterations;
52
52
  tasksConcurrency;
53
53
  async process(input, context) {
54
- const model = context?.model;
54
+ const { model } = context;
55
55
  if (!model)
56
56
  throw new Error("model is required to run OrchestratorAgent");
57
57
  const objective = (0, core_1.getMessage)(input);
@@ -102,7 +102,7 @@ class OrchestratorAgent extends core_1.Agent {
102
102
  }
103
103
  async executeStep(planResult, step, context) {
104
104
  const concurrency = this.tasksConcurrency ?? DEFAULT_TASK_CONCURRENCY;
105
- const model = context?.model;
105
+ const { model } = context;
106
106
  if (!model)
107
107
  throw new Error("model is required to run OrchestratorAgent");
108
108
  const queue = fastq_1.default.promise(async (task) => {
@@ -3,7 +3,7 @@ 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
5
  const json_schema_js_1 = require("@aigne/core/utils/json-schema.js");
6
- const lodash_es_1 = require("lodash-es");
6
+ const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
7
7
  const zod_1 = require("zod");
8
8
  exports.SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = `\
9
9
  Synthesize the results of executing all steps in the plan into a cohesive result
@@ -11,8 +11,8 @@ Synthesize the results of executing all steps in the plan into a cohesive result
11
11
  function getFullPlanSchema(agents) {
12
12
  const agentNames = agents.map((i) => i.name);
13
13
  if (new Set(agentNames).size !== agentNames.length) {
14
- const duplicates = (0, lodash_es_1.pickBy)((0, lodash_es_1.groupBy)(agentNames), (x) => x.length > 1);
15
- throw new Error(`Tools name must be unique for orchestrator: ${Object.keys(duplicates).join(",")}`);
14
+ const dup = (0, type_utils_js_1.duplicates)(agentNames);
15
+ throw new Error(`Duplicate agent names found in orchestrator: ${dup.join(",")}`);
16
16
  }
17
17
  const TaskSchema = zod_1.z.object({
18
18
  description: zod_1.z.string().describe("Detailed description of the task"),
@@ -19,7 +19,7 @@ export declare class OrchestratorAgent<I extends Message = Message, O extends Me
19
19
  private completer;
20
20
  maxIterations?: number;
21
21
  tasksConcurrency?: number;
22
- process(input: I, context?: Context): Promise<O>;
22
+ process(input: I, context: Context): Promise<O>;
23
23
  private getFullPlanInput;
24
24
  private getFullPlan;
25
25
  private synthesizePlanResult;
@@ -19,7 +19,7 @@ export declare class OrchestratorAgent<I extends Message = Message, O extends Me
19
19
  private completer;
20
20
  maxIterations?: number;
21
21
  tasksConcurrency?: number;
22
- process(input: I, context?: Context): Promise<O>;
22
+ process(input: I, context: Context): Promise<O>;
23
23
  private getFullPlanInput;
24
24
  private getFullPlan;
25
25
  private synthesizePlanResult;
@@ -31,7 +31,7 @@ export class OrchestratorAgent extends Agent {
31
31
  maxIterations;
32
32
  tasksConcurrency;
33
33
  async process(input, context) {
34
- const model = context?.model;
34
+ const { model } = context;
35
35
  if (!model)
36
36
  throw new Error("model is required to run OrchestratorAgent");
37
37
  const objective = getMessage(input);
@@ -82,7 +82,7 @@ export class OrchestratorAgent extends Agent {
82
82
  }
83
83
  async executeStep(planResult, step, context) {
84
84
  const concurrency = this.tasksConcurrency ?? DEFAULT_TASK_CONCURRENCY;
85
- const model = context?.model;
85
+ const { model } = context;
86
86
  if (!model)
87
87
  throw new Error("model is required to run OrchestratorAgent");
88
88
  const queue = fastq.promise(async (task) => {
@@ -1,5 +1,5 @@
1
1
  import { ensureZodUnionArray } from "@aigne/core/utils/json-schema.js";
2
- import { groupBy, pickBy } from "lodash-es";
2
+ import { duplicates } from "@aigne/core/utils/type-utils.js";
3
3
  import { z } from "zod";
4
4
  export const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = `\
5
5
  Synthesize the results of executing all steps in the plan into a cohesive result
@@ -7,8 +7,8 @@ Synthesize the results of executing all steps in the plan into a cohesive result
7
7
  export function getFullPlanSchema(agents) {
8
8
  const agentNames = agents.map((i) => i.name);
9
9
  if (new Set(agentNames).size !== agentNames.length) {
10
- const duplicates = pickBy(groupBy(agentNames), (x) => x.length > 1);
11
- throw new Error(`Tools name must be unique for orchestrator: ${Object.keys(duplicates).join(",")}`);
10
+ const dup = duplicates(agentNames);
11
+ throw new Error(`Duplicate agent names found in orchestrator: ${dup.join(",")}`);
12
12
  }
13
13
  const TaskSchema = z.object({
14
14
  description: z.string().describe("Detailed description of the task"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/agent-library",
3
- "version": "1.3.2",
3
+ "version": "1.5.0",
4
4
  "description": "Collection of agent libraries for AIGNE framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -40,22 +40,21 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "fastq": "^1.19.1",
43
- "lodash-es": "^4.17.21",
44
43
  "zod": "^3.24.2",
45
- "@aigne/core": "^1.5.0"
44
+ "@aigne/core": "^1.7.0"
46
45
  },
47
46
  "devDependencies": {
48
- "@types/bun": "^1.2.6",
47
+ "@types/bun": "^1.2.9",
49
48
  "npm-run-all": "^4.1.5",
50
49
  "rimraf": "^6.0.1",
51
- "typescript": "^5.8.2"
50
+ "typescript": "^5.8.3"
52
51
  },
53
52
  "scripts": {
54
53
  "lint": "tsc --noEmit",
55
54
  "build": "tsc --build scripts/tsconfig.build.json",
56
- "clean": "rimraf lib coverage",
57
- "test": "bun test",
58
- "test:coverage": "bun test --coverage --coverage-reporter=lcov --coverage-reporter=text",
55
+ "clean": "rimraf lib test/coverage",
56
+ "test": "bun --cwd test test",
57
+ "test:coverage": "bun --cwd test test --coverage --coverage-reporter=lcov --coverage-reporter=text",
59
58
  "postbuild": "echo '{\"type\": \"module\"}' > lib/esm/package.json && echo '{\"type\": \"commonjs\"}' > lib/cjs/package.json"
60
59
  }
61
60
  }