@aigne/core 1.70.0-beta → 1.70.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 +17 -0
- package/lib/cjs/prompt/skills/afs.js +30 -6
- package/lib/esm/prompt/skills/afs.js +30 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.70.0](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.70.0-beta.1...core-v1.70.0) (2025-12-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @aigne/afs bumped to 1.2.3
|
|
11
|
+
* @aigne/afs-history bumped to 1.1.2
|
|
12
|
+
|
|
13
|
+
## [1.70.0-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.70.0-beta...core-v1.70.0-beta.1) (2025-12-05)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* return tree view instead of list for afs_list ([#774](https://github.com/AIGNE-io/aigne-framework/issues/774)) ([8ec2f93](https://github.com/AIGNE-io/aigne-framework/commit/8ec2f93fb5870f6404d886ad0197cc21c61dfd74))
|
|
19
|
+
|
|
3
20
|
## [1.70.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.69.2...core-v1.70.0-beta) (2025-12-02)
|
|
4
21
|
|
|
5
22
|
|
|
@@ -7,24 +7,24 @@ async function getAFSSkills(afs) {
|
|
|
7
7
|
return [
|
|
8
8
|
agent_js_1.FunctionAgent.from({
|
|
9
9
|
name: "afs_list",
|
|
10
|
-
description: "
|
|
10
|
+
description: "Get a tree view of directory contents in the AFS - shows hierarchical structure of files and folders",
|
|
11
11
|
inputSchema: zod_1.z.object({
|
|
12
12
|
path: zod_1.z.string().describe("The directory path to browse (e.g., '/', '/docs', '/src')"),
|
|
13
13
|
options: zod_1.z
|
|
14
14
|
.object({
|
|
15
|
-
|
|
16
|
-
maxDepth: zod_1.z.number().optional().describe("Maximum depth to list files"),
|
|
17
|
-
limit: zod_1.z.number().optional().describe("Maximum number of entries to return"),
|
|
15
|
+
maxDepth: zod_1.z.number().optional().describe("Maximum depth to display in the tree view"),
|
|
18
16
|
})
|
|
19
17
|
.optional(),
|
|
20
18
|
}),
|
|
21
19
|
process: async (input) => {
|
|
22
|
-
const
|
|
20
|
+
const { list, message } = await afs.list(input.path, input.options);
|
|
21
|
+
const result = buildTreeView(list);
|
|
23
22
|
return {
|
|
24
23
|
status: "success",
|
|
25
24
|
tool: "afs_list",
|
|
26
25
|
options: input.options,
|
|
27
|
-
|
|
26
|
+
message,
|
|
27
|
+
result,
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
}),
|
|
@@ -107,3 +107,27 @@ async function getAFSSkills(afs) {
|
|
|
107
107
|
}),
|
|
108
108
|
];
|
|
109
109
|
}
|
|
110
|
+
function buildTreeView(entries) {
|
|
111
|
+
const tree = {};
|
|
112
|
+
for (const entry of entries) {
|
|
113
|
+
const parts = entry.path.split("/").filter(Boolean);
|
|
114
|
+
let current = tree;
|
|
115
|
+
for (const part of parts) {
|
|
116
|
+
if (!current[part]) {
|
|
117
|
+
current[part] = {};
|
|
118
|
+
}
|
|
119
|
+
current = current[part];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function renderTree(node, prefix = "") {
|
|
123
|
+
let result = "";
|
|
124
|
+
const keys = Object.keys(node);
|
|
125
|
+
keys.forEach((key, index) => {
|
|
126
|
+
const isLast = index === keys.length - 1;
|
|
127
|
+
result += `${prefix}${isLast ? "└── " : "├── "}${key}\n`;
|
|
128
|
+
result += renderTree(node[key], `${prefix}${isLast ? " " : "│ "}`);
|
|
129
|
+
});
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
return renderTree(tree);
|
|
133
|
+
}
|
|
@@ -4,24 +4,24 @@ export async function getAFSSkills(afs) {
|
|
|
4
4
|
return [
|
|
5
5
|
FunctionAgent.from({
|
|
6
6
|
name: "afs_list",
|
|
7
|
-
description: "
|
|
7
|
+
description: "Get a tree view of directory contents in the AFS - shows hierarchical structure of files and folders",
|
|
8
8
|
inputSchema: z.object({
|
|
9
9
|
path: z.string().describe("The directory path to browse (e.g., '/', '/docs', '/src')"),
|
|
10
10
|
options: z
|
|
11
11
|
.object({
|
|
12
|
-
|
|
13
|
-
maxDepth: z.number().optional().describe("Maximum depth to list files"),
|
|
14
|
-
limit: z.number().optional().describe("Maximum number of entries to return"),
|
|
12
|
+
maxDepth: z.number().optional().describe("Maximum depth to display in the tree view"),
|
|
15
13
|
})
|
|
16
14
|
.optional(),
|
|
17
15
|
}),
|
|
18
16
|
process: async (input) => {
|
|
19
|
-
const
|
|
17
|
+
const { list, message } = await afs.list(input.path, input.options);
|
|
18
|
+
const result = buildTreeView(list);
|
|
20
19
|
return {
|
|
21
20
|
status: "success",
|
|
22
21
|
tool: "afs_list",
|
|
23
22
|
options: input.options,
|
|
24
|
-
|
|
23
|
+
message,
|
|
24
|
+
result,
|
|
25
25
|
};
|
|
26
26
|
},
|
|
27
27
|
}),
|
|
@@ -104,3 +104,27 @@ export async function getAFSSkills(afs) {
|
|
|
104
104
|
}),
|
|
105
105
|
];
|
|
106
106
|
}
|
|
107
|
+
function buildTreeView(entries) {
|
|
108
|
+
const tree = {};
|
|
109
|
+
for (const entry of entries) {
|
|
110
|
+
const parts = entry.path.split("/").filter(Boolean);
|
|
111
|
+
let current = tree;
|
|
112
|
+
for (const part of parts) {
|
|
113
|
+
if (!current[part]) {
|
|
114
|
+
current[part] = {};
|
|
115
|
+
}
|
|
116
|
+
current = current[part];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function renderTree(node, prefix = "") {
|
|
120
|
+
let result = "";
|
|
121
|
+
const keys = Object.keys(node);
|
|
122
|
+
keys.forEach((key, index) => {
|
|
123
|
+
const isLast = index === keys.length - 1;
|
|
124
|
+
result += `${prefix}${isLast ? "└── " : "├── "}${key}\n`;
|
|
125
|
+
result += renderTree(node[key], `${prefix}${isLast ? " " : "│ "}`);
|
|
126
|
+
});
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
return renderTree(tree);
|
|
130
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/core",
|
|
3
|
-
"version": "1.70.0
|
|
3
|
+
"version": "1.70.0",
|
|
4
4
|
"description": "The functional core of agentic AI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"zod": "^3.25.67",
|
|
93
93
|
"zod-from-json-schema": "^0.0.5",
|
|
94
94
|
"zod-to-json-schema": "^3.24.6",
|
|
95
|
-
"@aigne/afs": "^1.2
|
|
96
|
-
"@aigne/afs
|
|
95
|
+
"@aigne/afs-history": "^1.1.2",
|
|
96
|
+
"@aigne/afs": "^1.2.3",
|
|
97
97
|
"@aigne/observability-api": "^0.11.11",
|
|
98
98
|
"@aigne/platform-helpers": "^0.6.5"
|
|
99
99
|
},
|