@aigne/afs-json 1.1.0 → 1.2.0-beta
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 +16 -0
- package/lib/cjs/index.d.ts +8 -2
- package/lib/cjs/index.js +7 -8
- package/lib/dts/index.d.ts +8 -2
- package/lib/esm/index.d.ts +8 -2
- package/lib/esm/index.js +3 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.2.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/afs-json-v1.1.0...afs-json-v1.2.0-beta) (2026-01-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **afs:** add @aigne/afs-utils package ([#927](https://github.com/AIGNE-io/aigne-framework/issues/927)) ([3922635](https://github.com/AIGNE-io/aigne-framework/commit/3922635981aab4578607c5bf1fb882c8e45725ce))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/afs-utils bumped to 1.0.0
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @aigne/test-utils bumped to 0.5.70-beta
|
|
18
|
+
|
|
3
19
|
## [1.1.0](https://github.com/AIGNE-io/aigne-framework/compare/afs-json-v1.1.0-beta...afs-json-v1.1.0) (2026-01-16)
|
|
4
20
|
|
|
5
21
|
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class AFSJSON implements AFSModule {
|
|
|
28
28
|
options: AFSJSONOptions & {
|
|
29
29
|
cwd?: string;
|
|
30
30
|
};
|
|
31
|
-
static schema(): z.ZodObject<{
|
|
31
|
+
static schema(): z.ZodEffects<z.ZodObject<{
|
|
32
32
|
name: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
33
33
|
jsonPath: z.ZodString;
|
|
34
34
|
description: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
@@ -46,7 +46,13 @@ export declare class AFSJSON implements AFSModule {
|
|
|
46
46
|
description?: string | undefined;
|
|
47
47
|
accessMode?: "readonly" | "readwrite" | undefined;
|
|
48
48
|
agentSkills?: boolean | undefined;
|
|
49
|
-
}
|
|
49
|
+
}>, {
|
|
50
|
+
jsonPath: string;
|
|
51
|
+
name?: string | undefined;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
accessMode?: "readonly" | "readwrite" | undefined;
|
|
54
|
+
agentSkills?: boolean | undefined;
|
|
55
|
+
}, any>;
|
|
50
56
|
static load({ filepath, parsed }: AFSModuleLoadParams): Promise<AFSJSON>;
|
|
51
57
|
private jsonData;
|
|
52
58
|
private fileStats;
|
package/lib/cjs/index.js
CHANGED
|
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AFSJSON = void 0;
|
|
4
4
|
const promises_1 = require("node:fs/promises");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
|
-
const
|
|
7
|
-
const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
|
|
6
|
+
const index_js_1 = require("@aigne/afs-utils/zod/index.js");
|
|
8
7
|
const yaml_1 = require("yaml");
|
|
9
8
|
const zod_1 = require("zod");
|
|
10
9
|
const LIST_MAX_LIMIT = 1000;
|
|
11
|
-
const afsJSONOptionsSchema = (0,
|
|
12
|
-
name: (0,
|
|
10
|
+
const afsJSONOptionsSchema = (0, index_js_1.camelize)(zod_1.z.object({
|
|
11
|
+
name: (0, index_js_1.optionalize)(zod_1.z.string()),
|
|
13
12
|
jsonPath: zod_1.z.string().describe("The path to the JSON/YAML file to mount"),
|
|
14
|
-
description: (0,
|
|
15
|
-
accessMode: (0,
|
|
16
|
-
agentSkills: (0,
|
|
13
|
+
description: (0, index_js_1.optionalize)(zod_1.z.string().describe("A description of the JSON module")),
|
|
14
|
+
accessMode: (0, index_js_1.optionalize)(zod_1.z.enum(["readonly", "readwrite"]).describe("Access mode for this module")),
|
|
15
|
+
agentSkills: (0, index_js_1.optionalize)(zod_1.z.boolean().describe("Enable automatic agent skill scanning for this module")),
|
|
17
16
|
}));
|
|
18
17
|
/**
|
|
19
18
|
* AFS module for mounting JSON/YAML files as virtual file systems.
|
|
@@ -35,7 +34,7 @@ class AFSJSON {
|
|
|
35
34
|
fileFormat = "json";
|
|
36
35
|
constructor(options) {
|
|
37
36
|
this.options = options;
|
|
38
|
-
(0,
|
|
37
|
+
(0, index_js_1.zodParse)(afsJSONOptionsSchema, options);
|
|
39
38
|
let jsonPath;
|
|
40
39
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: explicitly replace ${CWD}
|
|
41
40
|
jsonPath = options.jsonPath.replaceAll("${CWD}", process.cwd());
|
package/lib/dts/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class AFSJSON implements AFSModule {
|
|
|
28
28
|
options: AFSJSONOptions & {
|
|
29
29
|
cwd?: string;
|
|
30
30
|
};
|
|
31
|
-
static schema(): z.ZodObject<{
|
|
31
|
+
static schema(): z.ZodEffects<z.ZodObject<{
|
|
32
32
|
name: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
33
33
|
jsonPath: z.ZodString;
|
|
34
34
|
description: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
@@ -46,7 +46,13 @@ export declare class AFSJSON implements AFSModule {
|
|
|
46
46
|
description?: string | undefined;
|
|
47
47
|
accessMode?: "readonly" | "readwrite" | undefined;
|
|
48
48
|
agentSkills?: boolean | undefined;
|
|
49
|
-
}
|
|
49
|
+
}>, {
|
|
50
|
+
jsonPath: string;
|
|
51
|
+
name?: string | undefined;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
accessMode?: "readonly" | "readwrite" | undefined;
|
|
54
|
+
agentSkills?: boolean | undefined;
|
|
55
|
+
}, any>;
|
|
50
56
|
static load({ filepath, parsed }: AFSModuleLoadParams): Promise<AFSJSON>;
|
|
51
57
|
private jsonData;
|
|
52
58
|
private fileStats;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class AFSJSON implements AFSModule {
|
|
|
28
28
|
options: AFSJSONOptions & {
|
|
29
29
|
cwd?: string;
|
|
30
30
|
};
|
|
31
|
-
static schema(): z.ZodObject<{
|
|
31
|
+
static schema(): z.ZodEffects<z.ZodObject<{
|
|
32
32
|
name: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
33
33
|
jsonPath: z.ZodString;
|
|
34
34
|
description: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
@@ -46,7 +46,13 @@ export declare class AFSJSON implements AFSModule {
|
|
|
46
46
|
description?: string | undefined;
|
|
47
47
|
accessMode?: "readonly" | "readwrite" | undefined;
|
|
48
48
|
agentSkills?: boolean | undefined;
|
|
49
|
-
}
|
|
49
|
+
}>, {
|
|
50
|
+
jsonPath: string;
|
|
51
|
+
name?: string | undefined;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
accessMode?: "readonly" | "readwrite" | undefined;
|
|
54
|
+
agentSkills?: boolean | undefined;
|
|
55
|
+
}, any>;
|
|
50
56
|
static load({ filepath, parsed }: AFSModuleLoadParams): Promise<AFSJSON>;
|
|
51
57
|
private jsonData;
|
|
52
58
|
private fileStats;
|
package/lib/esm/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { readFile, stat, writeFile } from "node:fs/promises";
|
|
2
2
|
import { basename, dirname, extname, isAbsolute, join } from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { checkArguments } from "@aigne/core/utils/type-utils.js";
|
|
3
|
+
import { camelize, optionalize, zodParse } from "@aigne/afs-utils/zod/index.js";
|
|
5
4
|
import { parse as parseYAML, stringify as stringifyYAML } from "yaml";
|
|
6
5
|
import { z } from "zod";
|
|
7
6
|
const LIST_MAX_LIMIT = 1000;
|
|
8
|
-
const afsJSONOptionsSchema =
|
|
7
|
+
const afsJSONOptionsSchema = camelize(z.object({
|
|
9
8
|
name: optionalize(z.string()),
|
|
10
9
|
jsonPath: z.string().describe("The path to the JSON/YAML file to mount"),
|
|
11
10
|
description: optionalize(z.string().describe("A description of the JSON module")),
|
|
@@ -32,7 +31,7 @@ export class AFSJSON {
|
|
|
32
31
|
fileFormat = "json";
|
|
33
32
|
constructor(options) {
|
|
34
33
|
this.options = options;
|
|
35
|
-
|
|
34
|
+
zodParse(afsJSONOptionsSchema, options);
|
|
36
35
|
let jsonPath;
|
|
37
36
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: explicitly replace ${CWD}
|
|
38
37
|
jsonPath = options.jsonPath.replaceAll("${CWD}", process.cwd());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/afs-json",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-beta",
|
|
4
4
|
"description": "AIGNE AFS module for JSON and YAML file storage",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"yaml": "^2.8.1",
|
|
51
51
|
"zod": "^3.25.67",
|
|
52
52
|
"@aigne/afs": "^1.4.0",
|
|
53
|
-
"@aigne/
|
|
53
|
+
"@aigne/afs-utils": "^1.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/bun": "^1.2.22",
|
|
57
57
|
"npm-run-all": "^4.1.5",
|
|
58
58
|
"rimraf": "^6.0.1",
|
|
59
59
|
"typescript": "^5.9.2",
|
|
60
|
-
"@aigne/test-utils": "^0.5.
|
|
60
|
+
"@aigne/test-utils": "^0.5.70-beta"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"lint": "tsc --noEmit",
|