@aigne/agent-library 1.20.0 → 1.20.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 +25 -0
- package/lib/cjs/data-mapper/index.d.ts +1 -1
- package/lib/cjs/data-mapper/index.js +2 -7
- package/lib/cjs/data-mapper/tools.d.ts +0 -6
- package/lib/cjs/data-mapper/tools.js +0 -12
- package/lib/dts/data-mapper/index.d.ts +1 -1
- package/lib/dts/data-mapper/tools.d.ts +0 -6
- package/lib/esm/data-mapper/index.d.ts +1 -1
- package/lib/esm/data-mapper/index.js +0 -5
- package/lib/esm/data-mapper/tools.d.ts +0 -6
- package/lib/esm/data-mapper/tools.js +0 -11
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,31 @@
|
|
|
13
13
|
* @aigne/core bumped to 1.22.0
|
|
14
14
|
* @aigne/openai bumped to 0.3.4
|
|
15
15
|
|
|
16
|
+
## [1.20.2](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.20.1...agent-library-v1.20.2) (2025-07-09)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* resolve warning caused by dependencies. ([#237](https://github.com/AIGNE-io/aigne-framework/issues/237)) ([3ad7cc6](https://github.com/AIGNE-io/aigne-framework/commit/3ad7cc66b0c1ab425879176849af97c88c01b5a2))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Dependencies
|
|
25
|
+
|
|
26
|
+
* The following workspace dependencies were updated
|
|
27
|
+
* dependencies
|
|
28
|
+
* @aigne/core bumped to 1.32.2
|
|
29
|
+
* @aigne/openai bumped to 0.8.2
|
|
30
|
+
|
|
31
|
+
## [1.20.1](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.20.0...agent-library-v1.20.1) (2025-07-09)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
* The following workspace dependencies were updated
|
|
37
|
+
* dependencies
|
|
38
|
+
* @aigne/core bumped to 1.32.1
|
|
39
|
+
* @aigne/openai bumped to 0.8.1
|
|
40
|
+
|
|
16
41
|
## [1.20.0](https://github.com/AIGNE-io/aigne-framework/compare/agent-library-v1.19.0...agent-library-v1.20.0) (2025-07-08)
|
|
17
42
|
|
|
18
43
|
|
|
@@ -8,14 +8,9 @@ exports.generateMapping = generateMapping;
|
|
|
8
8
|
const core_1 = require("@aigne/core");
|
|
9
9
|
const mapper_js_1 = __importDefault(require("./agents/mapper.js"));
|
|
10
10
|
const reviewer_js_1 = __importDefault(require("./agents/reviewer.js"));
|
|
11
|
-
const tools_js_1 = require("./tools.js");
|
|
12
11
|
async function generateMapping({ input, model, }) {
|
|
13
12
|
if (!model)
|
|
14
13
|
throw new Error("model is required to run data mapper");
|
|
15
|
-
// if sourceSchema is not provided, generate it from sourceData
|
|
16
|
-
if (!input.sourceSchema && input.sourceData) {
|
|
17
|
-
input.sourceSchema = JSON.stringify((0, tools_js_1.getSchemaFromData)(JSON.parse(input.sourceData)));
|
|
18
|
-
}
|
|
19
14
|
const aigne = new core_1.AIGNE({ model, agents: [mapper_js_1.default, reviewer_js_1.default] });
|
|
20
15
|
aigne.publish(core_1.UserInputTopic, input);
|
|
21
16
|
const { message } = await aigne.subscribe(core_1.UserOutputTopic);
|
|
@@ -25,5 +20,5 @@ async function generateMapping({ input, model, }) {
|
|
|
25
20
|
confidenceReasoning: message.confidenceReasoning || "",
|
|
26
21
|
};
|
|
27
22
|
}
|
|
28
|
-
var
|
|
29
|
-
Object.defineProperty(exports, "applyJsonata", { enumerable: true, get: function () { return
|
|
23
|
+
var tools_js_1 = require("./tools.js");
|
|
24
|
+
Object.defineProperty(exports, "applyJsonata", { enumerable: true, get: function () { return tools_js_1.applyJsonata; } });
|
|
@@ -5,12 +5,6 @@ export interface TransformResult {
|
|
|
5
5
|
data?: unknown;
|
|
6
6
|
error?: string;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Extract JSON Schema from data
|
|
10
|
-
* @param data Any data
|
|
11
|
-
* @returns JSON Schema or null
|
|
12
|
-
*/
|
|
13
|
-
export declare function getSchemaFromData(data: unknown): unknown;
|
|
14
8
|
export declare function applyJsonataWithValidation(data: unknown, expr: string, schema: unknown): Promise<TransformResult>;
|
|
15
9
|
export declare function applyJsonata(data: unknown, expr: string): Promise<unknown>;
|
|
16
10
|
export declare function extendJsonata(expr: string): jsonata.Expression;
|
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getSchemaFromData = getSchemaFromData;
|
|
7
6
|
exports.applyJsonataWithValidation = applyJsonataWithValidation;
|
|
8
7
|
exports.applyJsonata = applyJsonata;
|
|
9
8
|
exports.extendJsonata = extendJsonata;
|
|
@@ -11,17 +10,6 @@ exports.addNullableToOptional = addNullableToOptional;
|
|
|
11
10
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
11
|
const jsonata_1 = __importDefault(require("jsonata"));
|
|
13
12
|
const jsonschema_1 = require("jsonschema");
|
|
14
|
-
const to_json_schema_1 = __importDefault(require("to-json-schema"));
|
|
15
|
-
/**
|
|
16
|
-
* Extract JSON Schema from data
|
|
17
|
-
* @param data Any data
|
|
18
|
-
* @returns JSON Schema or null
|
|
19
|
-
*/
|
|
20
|
-
function getSchemaFromData(data) {
|
|
21
|
-
if (!data)
|
|
22
|
-
return null;
|
|
23
|
-
return (0, to_json_schema_1.default)(data);
|
|
24
|
-
}
|
|
25
13
|
async function applyJsonataWithValidation(data, expr, schema) {
|
|
26
14
|
try {
|
|
27
15
|
const result = await applyJsonata(data, expr);
|
|
@@ -5,12 +5,6 @@ export interface TransformResult {
|
|
|
5
5
|
data?: unknown;
|
|
6
6
|
error?: string;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Extract JSON Schema from data
|
|
10
|
-
* @param data Any data
|
|
11
|
-
* @returns JSON Schema or null
|
|
12
|
-
*/
|
|
13
|
-
export declare function getSchemaFromData(data: unknown): unknown;
|
|
14
8
|
export declare function applyJsonataWithValidation(data: unknown, expr: string, schema: unknown): Promise<TransformResult>;
|
|
15
9
|
export declare function applyJsonata(data: unknown, expr: string): Promise<unknown>;
|
|
16
10
|
export declare function extendJsonata(expr: string): jsonata.Expression;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { AIGNE, UserInputTopic, UserOutputTopic } from "@aigne/core";
|
|
2
2
|
import mapper from "./agents/mapper.js";
|
|
3
3
|
import reviewer from "./agents/reviewer.js";
|
|
4
|
-
import { getSchemaFromData } from "./tools.js";
|
|
5
4
|
export async function generateMapping({ input, model, }) {
|
|
6
5
|
if (!model)
|
|
7
6
|
throw new Error("model is required to run data mapper");
|
|
8
|
-
// if sourceSchema is not provided, generate it from sourceData
|
|
9
|
-
if (!input.sourceSchema && input.sourceData) {
|
|
10
|
-
input.sourceSchema = JSON.stringify(getSchemaFromData(JSON.parse(input.sourceData)));
|
|
11
|
-
}
|
|
12
7
|
const aigne = new AIGNE({ model, agents: [mapper, reviewer] });
|
|
13
8
|
aigne.publish(UserInputTopic, input);
|
|
14
9
|
const { message } = await aigne.subscribe(UserOutputTopic);
|
|
@@ -5,12 +5,6 @@ export interface TransformResult {
|
|
|
5
5
|
data?: unknown;
|
|
6
6
|
error?: string;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Extract JSON Schema from data
|
|
10
|
-
* @param data Any data
|
|
11
|
-
* @returns JSON Schema or null
|
|
12
|
-
*/
|
|
13
|
-
export declare function getSchemaFromData(data: unknown): unknown;
|
|
14
8
|
export declare function applyJsonataWithValidation(data: unknown, expr: string, schema: unknown): Promise<TransformResult>;
|
|
15
9
|
export declare function applyJsonata(data: unknown, expr: string): Promise<unknown>;
|
|
16
10
|
export declare function extendJsonata(expr: string): jsonata.Expression;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import jsonata from "jsonata";
|
|
3
3
|
import { Validator } from "jsonschema";
|
|
4
|
-
import toJsonSchema from "to-json-schema";
|
|
5
|
-
/**
|
|
6
|
-
* Extract JSON Schema from data
|
|
7
|
-
* @param data Any data
|
|
8
|
-
* @returns JSON Schema or null
|
|
9
|
-
*/
|
|
10
|
-
export function getSchemaFromData(data) {
|
|
11
|
-
if (!data)
|
|
12
|
-
return null;
|
|
13
|
-
return toJsonSchema(data);
|
|
14
|
-
}
|
|
15
4
|
export async function applyJsonataWithValidation(data, expr, schema) {
|
|
16
5
|
try {
|
|
17
6
|
const result = await applyJsonata(data, expr);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/agent-library",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.2",
|
|
4
4
|
"description": "Collection of agent libraries for AIGNE framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -43,17 +43,15 @@
|
|
|
43
43
|
"fastq": "^1.19.1",
|
|
44
44
|
"jsonata": "^2.0.6",
|
|
45
45
|
"jsonschema": "^1.5.0",
|
|
46
|
-
"to-json-schema": "^0.2.5",
|
|
47
46
|
"uuid": "^11.1.0",
|
|
48
47
|
"yaml": "^2.8.0",
|
|
49
48
|
"zod": "^3.25.67",
|
|
50
|
-
"@aigne/
|
|
51
|
-
"@aigne/
|
|
52
|
-
"@aigne/
|
|
49
|
+
"@aigne/core": "^1.32.2",
|
|
50
|
+
"@aigne/openai": "^0.8.2",
|
|
51
|
+
"@aigne/sqlite": "^0.3.0"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"@types/bun": "^1.2.17",
|
|
56
|
-
"@types/to-json-schema": "^0.2.4",
|
|
57
55
|
"npm-run-all": "^4.1.5",
|
|
58
56
|
"rimraf": "^6.0.1",
|
|
59
57
|
"typescript": "^5.8.3"
|