@aigne/afs 1.4.0-beta.6 → 1.4.0-beta.8
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 +26 -0
- package/lib/cjs/afs.d.ts +3 -0
- package/lib/cjs/afs.js +26 -0
- package/lib/cjs/type.d.ts +4 -0
- package/lib/dts/afs.d.ts +3 -0
- package/lib/dts/type.d.ts +4 -0
- package/lib/esm/afs.d.ts +3 -0
- package/lib/esm/afs.js +26 -0
- package/lib/esm/type.d.ts +4 -0
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.0-beta.8](https://github.com/AIGNE-io/aigne-framework/compare/afs-v1.4.0-beta.7...afs-v1.4.0-beta.8) (2026-01-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **afs:** show gitignored files with marker instead of filtering ([c2bdea1](https://github.com/AIGNE-io/aigne-framework/commit/c2bdea155f47c9420f2fe810cdfed79ef70ef899))
|
|
9
|
+
|
|
10
|
+
## [1.4.0-beta.7](https://github.com/AIGNE-io/aigne-framework/compare/afs-v1.4.0-beta.6...afs-v1.4.0-beta.7) (2026-01-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **afs,bash:** add physical path mapping for AFS modules in bash execution ([#881](https://github.com/AIGNE-io/aigne-framework/issues/881)) ([50dbda2](https://github.com/AIGNE-io/aigne-framework/commit/50dbda224bd666d951494d2449779830d8db57fc))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* bump version ([696560f](https://github.com/AIGNE-io/aigne-framework/commit/696560fa2673eddcb4d00ac0523fbbbde7273cb3))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Dependencies
|
|
24
|
+
|
|
25
|
+
* The following workspace dependencies were updated
|
|
26
|
+
* dependencies
|
|
27
|
+
* @aigne/platform-helpers bumped to 0.6.7-beta.1
|
|
28
|
+
|
|
3
29
|
## [1.4.0-beta.6](https://github.com/AIGNE-io/aigne-framework/compare/afs-v1.4.0-beta.5...afs-v1.4.0-beta.6) (2026-01-06)
|
|
4
30
|
|
|
5
31
|
|
package/lib/cjs/afs.d.ts
CHANGED
|
@@ -31,4 +31,7 @@ export declare class AFS extends Emitter<AFSRootEvents> implements AFSRoot {
|
|
|
31
31
|
private buildSimpleListView;
|
|
32
32
|
private buildTreeView;
|
|
33
33
|
private buildMetadataSuffix;
|
|
34
|
+
private physicalPath?;
|
|
35
|
+
initializePhysicalPath(): Promise<string>;
|
|
36
|
+
cleanupPhysicalPath(): Promise<void>;
|
|
34
37
|
}
|
package/lib/cjs/afs.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AFS = void 0;
|
|
4
|
+
const index_js_1 = require("@aigne/platform-helpers/nodejs/index.js");
|
|
5
|
+
const uuid_1 = require("@aigne/uuid");
|
|
4
6
|
const strict_event_emitter_1 = require("strict-event-emitter");
|
|
5
7
|
const ufo_1 = require("ufo");
|
|
6
8
|
const zod_1 = require("zod");
|
|
@@ -279,6 +281,10 @@ class AFS extends strict_event_emitter_1.Emitter {
|
|
|
279
281
|
if (entry?.metadata?.childrenTruncated) {
|
|
280
282
|
metadataParts.push("truncated");
|
|
281
283
|
}
|
|
284
|
+
// Gitignored
|
|
285
|
+
if (entry?.metadata?.gitignored) {
|
|
286
|
+
metadataParts.push("gitignored");
|
|
287
|
+
}
|
|
282
288
|
// Executable
|
|
283
289
|
if (entry?.metadata?.execute) {
|
|
284
290
|
metadataParts.push("executable");
|
|
@@ -286,5 +292,25 @@ class AFS extends strict_event_emitter_1.Emitter {
|
|
|
286
292
|
const metadataSuffix = metadataParts.length > 0 ? ` [${metadataParts.join(", ")}]` : "";
|
|
287
293
|
return metadataSuffix;
|
|
288
294
|
}
|
|
295
|
+
physicalPath;
|
|
296
|
+
async initializePhysicalPath() {
|
|
297
|
+
this.physicalPath ??= (async () => {
|
|
298
|
+
const rootDir = index_js_1.nodejs.path.join(index_js_1.nodejs.os.tmpdir(), (0, uuid_1.v7)());
|
|
299
|
+
await index_js_1.nodejs.fs.mkdir(rootDir, { recursive: true });
|
|
300
|
+
for (const [modulePath, module] of this.modules) {
|
|
301
|
+
const physicalModulePath = index_js_1.nodejs.path.join(rootDir, modulePath);
|
|
302
|
+
await index_js_1.nodejs.fs.mkdir(index_js_1.nodejs.path.dirname(physicalModulePath), { recursive: true });
|
|
303
|
+
await module.symlinkToPhysical?.(physicalModulePath);
|
|
304
|
+
}
|
|
305
|
+
return rootDir;
|
|
306
|
+
})();
|
|
307
|
+
return this.physicalPath;
|
|
308
|
+
}
|
|
309
|
+
async cleanupPhysicalPath() {
|
|
310
|
+
if (this.physicalPath) {
|
|
311
|
+
await index_js_1.nodejs.fs.rm(await this.physicalPath, { recursive: true, force: true });
|
|
312
|
+
this.physicalPath = undefined;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
289
315
|
}
|
|
290
316
|
exports.AFS = AFS;
|
package/lib/cjs/type.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export interface AFSModule {
|
|
|
82
82
|
readonly name: string;
|
|
83
83
|
readonly description?: string;
|
|
84
84
|
onMount?(root: AFSRoot): void;
|
|
85
|
+
symlinkToPhysical?(path: string): Promise<void>;
|
|
85
86
|
list?(path: string, options?: AFSListOptions): Promise<AFSListResult>;
|
|
86
87
|
read?(path: string, options?: AFSReadOptions): Promise<AFSReadResult>;
|
|
87
88
|
write?(path: string, content: AFSWriteEntryPayload, options?: AFSWriteOptions): Promise<AFSWriteResult>;
|
|
@@ -120,6 +121,8 @@ export interface AFSRootSearchResult extends Omit<AFSSearchResult, "data"> {
|
|
|
120
121
|
export interface AFSRoot extends Emitter<AFSRootEvents>, AFSModule {
|
|
121
122
|
list(path: string, options?: AFSRootListOptions): Promise<AFSRootListResult>;
|
|
122
123
|
search(path: string, query: string, options: AFSRootSearchOptions): Promise<AFSRootSearchResult>;
|
|
124
|
+
initializePhysicalPath(): Promise<string>;
|
|
125
|
+
cleanupPhysicalPath(): Promise<void>;
|
|
123
126
|
}
|
|
124
127
|
export interface AFSEntryMetadata extends Record<string, any> {
|
|
125
128
|
execute?: {
|
|
@@ -130,6 +133,7 @@ export interface AFSEntryMetadata extends Record<string, any> {
|
|
|
130
133
|
};
|
|
131
134
|
childrenCount?: number;
|
|
132
135
|
childrenTruncated?: boolean;
|
|
136
|
+
gitignored?: boolean;
|
|
133
137
|
}
|
|
134
138
|
export interface AFSEntry<T = any> {
|
|
135
139
|
id: string;
|
package/lib/dts/afs.d.ts
CHANGED
|
@@ -31,4 +31,7 @@ export declare class AFS extends Emitter<AFSRootEvents> implements AFSRoot {
|
|
|
31
31
|
private buildSimpleListView;
|
|
32
32
|
private buildTreeView;
|
|
33
33
|
private buildMetadataSuffix;
|
|
34
|
+
private physicalPath?;
|
|
35
|
+
initializePhysicalPath(): Promise<string>;
|
|
36
|
+
cleanupPhysicalPath(): Promise<void>;
|
|
34
37
|
}
|
package/lib/dts/type.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export interface AFSModule {
|
|
|
82
82
|
readonly name: string;
|
|
83
83
|
readonly description?: string;
|
|
84
84
|
onMount?(root: AFSRoot): void;
|
|
85
|
+
symlinkToPhysical?(path: string): Promise<void>;
|
|
85
86
|
list?(path: string, options?: AFSListOptions): Promise<AFSListResult>;
|
|
86
87
|
read?(path: string, options?: AFSReadOptions): Promise<AFSReadResult>;
|
|
87
88
|
write?(path: string, content: AFSWriteEntryPayload, options?: AFSWriteOptions): Promise<AFSWriteResult>;
|
|
@@ -120,6 +121,8 @@ export interface AFSRootSearchResult extends Omit<AFSSearchResult, "data"> {
|
|
|
120
121
|
export interface AFSRoot extends Emitter<AFSRootEvents>, AFSModule {
|
|
121
122
|
list(path: string, options?: AFSRootListOptions): Promise<AFSRootListResult>;
|
|
122
123
|
search(path: string, query: string, options: AFSRootSearchOptions): Promise<AFSRootSearchResult>;
|
|
124
|
+
initializePhysicalPath(): Promise<string>;
|
|
125
|
+
cleanupPhysicalPath(): Promise<void>;
|
|
123
126
|
}
|
|
124
127
|
export interface AFSEntryMetadata extends Record<string, any> {
|
|
125
128
|
execute?: {
|
|
@@ -130,6 +133,7 @@ export interface AFSEntryMetadata extends Record<string, any> {
|
|
|
130
133
|
};
|
|
131
134
|
childrenCount?: number;
|
|
132
135
|
childrenTruncated?: boolean;
|
|
136
|
+
gitignored?: boolean;
|
|
133
137
|
}
|
|
134
138
|
export interface AFSEntry<T = any> {
|
|
135
139
|
id: string;
|
package/lib/esm/afs.d.ts
CHANGED
|
@@ -31,4 +31,7 @@ export declare class AFS extends Emitter<AFSRootEvents> implements AFSRoot {
|
|
|
31
31
|
private buildSimpleListView;
|
|
32
32
|
private buildTreeView;
|
|
33
33
|
private buildMetadataSuffix;
|
|
34
|
+
private physicalPath?;
|
|
35
|
+
initializePhysicalPath(): Promise<string>;
|
|
36
|
+
cleanupPhysicalPath(): Promise<void>;
|
|
34
37
|
}
|
package/lib/esm/afs.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { nodejs } from "@aigne/platform-helpers/nodejs/index.js";
|
|
2
|
+
import { v7 } from "@aigne/uuid";
|
|
1
3
|
import { Emitter } from "strict-event-emitter";
|
|
2
4
|
import { joinURL } from "ufo";
|
|
3
5
|
import { z } from "zod";
|
|
@@ -276,6 +278,10 @@ export class AFS extends Emitter {
|
|
|
276
278
|
if (entry?.metadata?.childrenTruncated) {
|
|
277
279
|
metadataParts.push("truncated");
|
|
278
280
|
}
|
|
281
|
+
// Gitignored
|
|
282
|
+
if (entry?.metadata?.gitignored) {
|
|
283
|
+
metadataParts.push("gitignored");
|
|
284
|
+
}
|
|
279
285
|
// Executable
|
|
280
286
|
if (entry?.metadata?.execute) {
|
|
281
287
|
metadataParts.push("executable");
|
|
@@ -283,4 +289,24 @@ export class AFS extends Emitter {
|
|
|
283
289
|
const metadataSuffix = metadataParts.length > 0 ? ` [${metadataParts.join(", ")}]` : "";
|
|
284
290
|
return metadataSuffix;
|
|
285
291
|
}
|
|
292
|
+
physicalPath;
|
|
293
|
+
async initializePhysicalPath() {
|
|
294
|
+
this.physicalPath ??= (async () => {
|
|
295
|
+
const rootDir = nodejs.path.join(nodejs.os.tmpdir(), v7());
|
|
296
|
+
await nodejs.fs.mkdir(rootDir, { recursive: true });
|
|
297
|
+
for (const [modulePath, module] of this.modules) {
|
|
298
|
+
const physicalModulePath = nodejs.path.join(rootDir, modulePath);
|
|
299
|
+
await nodejs.fs.mkdir(nodejs.path.dirname(physicalModulePath), { recursive: true });
|
|
300
|
+
await module.symlinkToPhysical?.(physicalModulePath);
|
|
301
|
+
}
|
|
302
|
+
return rootDir;
|
|
303
|
+
})();
|
|
304
|
+
return this.physicalPath;
|
|
305
|
+
}
|
|
306
|
+
async cleanupPhysicalPath() {
|
|
307
|
+
if (this.physicalPath) {
|
|
308
|
+
await nodejs.fs.rm(await this.physicalPath, { recursive: true, force: true });
|
|
309
|
+
this.physicalPath = undefined;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
286
312
|
}
|
package/lib/esm/type.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export interface AFSModule {
|
|
|
82
82
|
readonly name: string;
|
|
83
83
|
readonly description?: string;
|
|
84
84
|
onMount?(root: AFSRoot): void;
|
|
85
|
+
symlinkToPhysical?(path: string): Promise<void>;
|
|
85
86
|
list?(path: string, options?: AFSListOptions): Promise<AFSListResult>;
|
|
86
87
|
read?(path: string, options?: AFSReadOptions): Promise<AFSReadResult>;
|
|
87
88
|
write?(path: string, content: AFSWriteEntryPayload, options?: AFSWriteOptions): Promise<AFSWriteResult>;
|
|
@@ -120,6 +121,8 @@ export interface AFSRootSearchResult extends Omit<AFSSearchResult, "data"> {
|
|
|
120
121
|
export interface AFSRoot extends Emitter<AFSRootEvents>, AFSModule {
|
|
121
122
|
list(path: string, options?: AFSRootListOptions): Promise<AFSRootListResult>;
|
|
122
123
|
search(path: string, query: string, options: AFSRootSearchOptions): Promise<AFSRootSearchResult>;
|
|
124
|
+
initializePhysicalPath(): Promise<string>;
|
|
125
|
+
cleanupPhysicalPath(): Promise<void>;
|
|
123
126
|
}
|
|
124
127
|
export interface AFSEntryMetadata extends Record<string, any> {
|
|
125
128
|
execute?: {
|
|
@@ -130,6 +133,7 @@ export interface AFSEntryMetadata extends Record<string, any> {
|
|
|
130
133
|
};
|
|
131
134
|
childrenCount?: number;
|
|
132
135
|
childrenTruncated?: boolean;
|
|
136
|
+
gitignored?: boolean;
|
|
133
137
|
}
|
|
134
138
|
export interface AFSEntry<T = any> {
|
|
135
139
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/afs",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.8",
|
|
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"
|
|
@@ -47,9 +47,11 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
+
"@aigne/uuid": "^13.0.1",
|
|
50
51
|
"strict-event-emitter": "^0.5.1",
|
|
51
52
|
"ufo": "^1.6.1",
|
|
52
|
-
"zod": "^3.25.67"
|
|
53
|
+
"zod": "^3.25.67",
|
|
54
|
+
"@aigne/platform-helpers": "^0.6.7-beta.1"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
55
57
|
"@types/bun": "^1.2.22",
|