@aigne/afs 1.4.0-beta.1 → 1.4.0-beta.3

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
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/afs-v1.4.0-beta.2...afs-v1.4.0-beta.3) (2025-12-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * add Agent Skill support ([#787](https://github.com/AIGNE-io/aigne-framework/issues/787)) ([f04fbe7](https://github.com/AIGNE-io/aigne-framework/commit/f04fbe76ec24cf3c59c74adf92d87b0c3784a8f7))
9
+
10
+ ## [1.4.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/afs-v1.4.0-beta.1...afs-v1.4.0-beta.2) (2025-12-19)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **afs:** use simple-list instead of tree as default type ([#839](https://github.com/AIGNE-io/aigne-framework/issues/839)) ([65a9a40](https://github.com/AIGNE-io/aigne-framework/commit/65a9a4054b3bdad6f7e40357299ef3dc48f7c3e4))
16
+
3
17
  ## [1.4.0-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/afs-v1.4.0-beta...afs-v1.4.0-beta.1) (2025-12-17)
4
18
 
5
19
 
package/lib/cjs/afs.d.ts CHANGED
@@ -28,5 +28,7 @@ export declare class AFS extends Emitter<AFSRootEvents> implements AFSRoot {
28
28
  private _search;
29
29
  private findModules;
30
30
  exec(path: string, args: Record<string, any>, options: AFSExecOptions): Promise<AFSExecResult>;
31
+ private buildSimpleListView;
31
32
  private buildTreeView;
33
+ private buildMetadataSuffix;
32
34
  }
package/lib/cjs/afs.js CHANGED
@@ -161,12 +161,14 @@ class AFS extends strict_event_emitter_1.Emitter {
161
161
  ? await dedupe.invoke({ data: mapped }, options).then((res) => res.data)
162
162
  : mapped;
163
163
  let formatted = deduped;
164
- if (format === "tree") {
164
+ if (format === "simple-list" || format === "tree") {
165
165
  const valid = zod_1.z.array(type_js_1.afsEntrySchema).safeParse(deduped);
166
- if (valid.data)
167
- formatted = this.buildTreeView(valid.data);
168
- else
166
+ if (!valid.data)
169
167
  throw new Error("Tree format requires entries to be AFSEntry objects");
168
+ if (format === "tree")
169
+ formatted = this.buildTreeView(valid.data);
170
+ else if (format === "simple-list")
171
+ formatted = this.buildSimpleListView(valid.data);
170
172
  }
171
173
  else if (typeof format === "object" && typeof format.invoke === "function") {
172
174
  formatted = await format.invoke({ data: deduped }, options).then((res) => res.data);
@@ -233,6 +235,9 @@ class AFS extends strict_event_emitter_1.Emitter {
233
235
  throw new Error(`No module found for path: ${path}`);
234
236
  return await module.module.exec(module.subpath, args, options);
235
237
  }
238
+ buildSimpleListView(entries) {
239
+ return entries.map((entry) => `${entry.path}${this.buildMetadataSuffix(entry)}`);
240
+ }
236
241
  buildTreeView(entries) {
237
242
  const tree = {};
238
243
  const entryMap = new Map();
@@ -254,23 +259,7 @@ class AFS extends strict_event_emitter_1.Emitter {
254
259
  const isLast = index === keys.length - 1;
255
260
  const fullPath = currentPath ? `${currentPath}/${key}` : `/${key}`;
256
261
  const entry = entryMap.get(fullPath);
257
- // Build metadata suffix
258
- const metadataParts = [];
259
- // Children count
260
- const childrenCount = entry?.metadata?.childrenCount;
261
- if (typeof childrenCount === "number") {
262
- metadataParts.push(`${childrenCount} items`);
263
- }
264
- // Children truncated
265
- if (entry?.metadata?.childrenTruncated) {
266
- metadataParts.push("truncated");
267
- }
268
- // Executable
269
- if (entry?.metadata?.execute) {
270
- metadataParts.push("executable");
271
- }
272
- const metadataSuffix = metadataParts.length > 0 ? ` [${metadataParts.join(", ")}]` : "";
273
- result += `${prefix}${isLast ? "└── " : "├── "}${key}${metadataSuffix}`;
262
+ result += `${prefix}${isLast ? "└── " : "├── "}${key}${entry ? this.buildMetadataSuffix(entry) : ""}`;
274
263
  result += `\n`;
275
264
  result += renderTree(node[key], `${prefix}${isLast ? " " : "│ "}`, fullPath);
276
265
  });
@@ -278,5 +267,24 @@ class AFS extends strict_event_emitter_1.Emitter {
278
267
  };
279
268
  return renderTree(tree);
280
269
  }
270
+ buildMetadataSuffix(entry) {
271
+ // Build metadata suffix
272
+ const metadataParts = [];
273
+ // Children count
274
+ const childrenCount = entry?.metadata?.childrenCount;
275
+ if (typeof childrenCount === "number") {
276
+ metadataParts.push(`${childrenCount} items`);
277
+ }
278
+ // Children truncated
279
+ if (entry?.metadata?.childrenTruncated) {
280
+ metadataParts.push("truncated");
281
+ }
282
+ // Executable
283
+ if (entry?.metadata?.execute) {
284
+ metadataParts.push("executable");
285
+ }
286
+ const metadataSuffix = metadataParts.length > 0 ? ` [${metadataParts.join(", ")}]` : "";
287
+ return metadataSuffix;
288
+ }
281
289
  }
282
290
  exports.AFS = AFS;
package/lib/cjs/type.d.ts CHANGED
@@ -15,6 +15,11 @@ export interface AFSListOptions {
15
15
  * @default false
16
16
  */
17
17
  disableGitignore?: boolean;
18
+ /**
19
+ * Glob pattern to filter entries by path.
20
+ * Examples: "*.ts", "**\/*.js", "src/**\/*.{ts,tsx}"
21
+ */
22
+ pattern?: string;
18
23
  context?: any;
19
24
  }
20
25
  export interface AFSListResult {
@@ -151,7 +156,7 @@ export interface AFSContextPreset {
151
156
  }, {
152
157
  data: unknown;
153
158
  }>;
154
- format?: "default" | "tree" | AFSContextPresetOptionAgent<{
159
+ format?: "default" | "simple-list" | "tree" | AFSContextPresetOptionAgent<{
155
160
  data: unknown;
156
161
  }, {
157
162
  data: unknown;
package/lib/dts/afs.d.ts CHANGED
@@ -28,5 +28,7 @@ export declare class AFS extends Emitter<AFSRootEvents> implements AFSRoot {
28
28
  private _search;
29
29
  private findModules;
30
30
  exec(path: string, args: Record<string, any>, options: AFSExecOptions): Promise<AFSExecResult>;
31
+ private buildSimpleListView;
31
32
  private buildTreeView;
33
+ private buildMetadataSuffix;
32
34
  }
package/lib/dts/type.d.ts CHANGED
@@ -15,6 +15,11 @@ export interface AFSListOptions {
15
15
  * @default false
16
16
  */
17
17
  disableGitignore?: boolean;
18
+ /**
19
+ * Glob pattern to filter entries by path.
20
+ * Examples: "*.ts", "**\/*.js", "src/**\/*.{ts,tsx}"
21
+ */
22
+ pattern?: string;
18
23
  context?: any;
19
24
  }
20
25
  export interface AFSListResult {
@@ -151,7 +156,7 @@ export interface AFSContextPreset {
151
156
  }, {
152
157
  data: unknown;
153
158
  }>;
154
- format?: "default" | "tree" | AFSContextPresetOptionAgent<{
159
+ format?: "default" | "simple-list" | "tree" | AFSContextPresetOptionAgent<{
155
160
  data: unknown;
156
161
  }, {
157
162
  data: unknown;
package/lib/esm/afs.d.ts CHANGED
@@ -28,5 +28,7 @@ export declare class AFS extends Emitter<AFSRootEvents> implements AFSRoot {
28
28
  private _search;
29
29
  private findModules;
30
30
  exec(path: string, args: Record<string, any>, options: AFSExecOptions): Promise<AFSExecResult>;
31
+ private buildSimpleListView;
31
32
  private buildTreeView;
33
+ private buildMetadataSuffix;
32
34
  }
package/lib/esm/afs.js CHANGED
@@ -158,12 +158,14 @@ export class AFS extends Emitter {
158
158
  ? await dedupe.invoke({ data: mapped }, options).then((res) => res.data)
159
159
  : mapped;
160
160
  let formatted = deduped;
161
- if (format === "tree") {
161
+ if (format === "simple-list" || format === "tree") {
162
162
  const valid = z.array(afsEntrySchema).safeParse(deduped);
163
- if (valid.data)
164
- formatted = this.buildTreeView(valid.data);
165
- else
163
+ if (!valid.data)
166
164
  throw new Error("Tree format requires entries to be AFSEntry objects");
165
+ if (format === "tree")
166
+ formatted = this.buildTreeView(valid.data);
167
+ else if (format === "simple-list")
168
+ formatted = this.buildSimpleListView(valid.data);
167
169
  }
168
170
  else if (typeof format === "object" && typeof format.invoke === "function") {
169
171
  formatted = await format.invoke({ data: deduped }, options).then((res) => res.data);
@@ -230,6 +232,9 @@ export class AFS extends Emitter {
230
232
  throw new Error(`No module found for path: ${path}`);
231
233
  return await module.module.exec(module.subpath, args, options);
232
234
  }
235
+ buildSimpleListView(entries) {
236
+ return entries.map((entry) => `${entry.path}${this.buildMetadataSuffix(entry)}`);
237
+ }
233
238
  buildTreeView(entries) {
234
239
  const tree = {};
235
240
  const entryMap = new Map();
@@ -251,23 +256,7 @@ export class AFS extends Emitter {
251
256
  const isLast = index === keys.length - 1;
252
257
  const fullPath = currentPath ? `${currentPath}/${key}` : `/${key}`;
253
258
  const entry = entryMap.get(fullPath);
254
- // Build metadata suffix
255
- const metadataParts = [];
256
- // Children count
257
- const childrenCount = entry?.metadata?.childrenCount;
258
- if (typeof childrenCount === "number") {
259
- metadataParts.push(`${childrenCount} items`);
260
- }
261
- // Children truncated
262
- if (entry?.metadata?.childrenTruncated) {
263
- metadataParts.push("truncated");
264
- }
265
- // Executable
266
- if (entry?.metadata?.execute) {
267
- metadataParts.push("executable");
268
- }
269
- const metadataSuffix = metadataParts.length > 0 ? ` [${metadataParts.join(", ")}]` : "";
270
- result += `${prefix}${isLast ? "└── " : "├── "}${key}${metadataSuffix}`;
259
+ result += `${prefix}${isLast ? "└── " : "├── "}${key}${entry ? this.buildMetadataSuffix(entry) : ""}`;
271
260
  result += `\n`;
272
261
  result += renderTree(node[key], `${prefix}${isLast ? " " : "│ "}`, fullPath);
273
262
  });
@@ -275,4 +264,23 @@ export class AFS extends Emitter {
275
264
  };
276
265
  return renderTree(tree);
277
266
  }
267
+ buildMetadataSuffix(entry) {
268
+ // Build metadata suffix
269
+ const metadataParts = [];
270
+ // Children count
271
+ const childrenCount = entry?.metadata?.childrenCount;
272
+ if (typeof childrenCount === "number") {
273
+ metadataParts.push(`${childrenCount} items`);
274
+ }
275
+ // Children truncated
276
+ if (entry?.metadata?.childrenTruncated) {
277
+ metadataParts.push("truncated");
278
+ }
279
+ // Executable
280
+ if (entry?.metadata?.execute) {
281
+ metadataParts.push("executable");
282
+ }
283
+ const metadataSuffix = metadataParts.length > 0 ? ` [${metadataParts.join(", ")}]` : "";
284
+ return metadataSuffix;
285
+ }
278
286
  }
package/lib/esm/type.d.ts CHANGED
@@ -15,6 +15,11 @@ export interface AFSListOptions {
15
15
  * @default false
16
16
  */
17
17
  disableGitignore?: boolean;
18
+ /**
19
+ * Glob pattern to filter entries by path.
20
+ * Examples: "*.ts", "**\/*.js", "src/**\/*.{ts,tsx}"
21
+ */
22
+ pattern?: string;
18
23
  context?: any;
19
24
  }
20
25
  export interface AFSListResult {
@@ -151,7 +156,7 @@ export interface AFSContextPreset {
151
156
  }, {
152
157
  data: unknown;
153
158
  }>;
154
- format?: "default" | "tree" | AFSContextPresetOptionAgent<{
159
+ format?: "default" | "simple-list" | "tree" | AFSContextPresetOptionAgent<{
155
160
  data: unknown;
156
161
  }, {
157
162
  data: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/afs",
3
- "version": "1.4.0-beta.1",
3
+ "version": "1.4.0-beta.3",
4
4
  "description": "Agentic File System (AFS) is a virtual file system that supports various storage backends and provides a unified API for file operations.",
5
5
  "publishConfig": {
6
6
  "access": "public"