@openharness/provider-vfs 0.1.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.
Files changed (2) hide show
  1. package/README.md +66 -0
  2. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # @openharness/provider-vfs
2
+
3
+ Virtual filesystem provider for [@openharness/core](../core). Gives your agents sandboxed, in-memory, or persistent file access instead of hitting the real filesystem.
4
+
5
+ Built on [@platformatic/vfs](https://github.com/platformatic/vfs) (a userland shim for the upcoming `node:vfs`). When Node.js ships native VFS support, the provider will use it automatically — no code changes needed.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @openharness/provider-vfs @platformatic/vfs
11
+ ```
12
+
13
+ Requires Node.js >= 22.
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ import { createFsTools } from "@openharness/core";
19
+ import { VfsFsProvider } from "@openharness/provider-vfs";
20
+
21
+ // In-memory VFS (default) — fully ephemeral, no disk access
22
+ const fsTools = createFsTools(new VfsFsProvider());
23
+ ```
24
+
25
+ ### Backends
26
+
27
+ ```typescript
28
+ import { MemoryProvider, SqliteProvider, RealFSProvider } from "@platformatic/vfs";
29
+
30
+ // SQLite-backed — persistent across restarts
31
+ const fsTools = createFsTools(new VfsFsProvider({
32
+ provider: new SqliteProvider("/path/to/db.sqlite"),
33
+ }));
34
+
35
+ // Sandboxed real FS — real files, but the agent can't escape the root
36
+ const fsTools = createFsTools(new VfsFsProvider({
37
+ provider: new RealFSProvider("/safe/workspace"),
38
+ }));
39
+ ```
40
+
41
+ ### Pre-configured VFS
42
+
43
+ If you need full control (overlay mode, custom mount point, etc.), create the VFS yourself:
44
+
45
+ ```typescript
46
+ import { create, MemoryProvider } from "@platformatic/vfs";
47
+
48
+ const vfs = create(new MemoryProvider(), { overlay: true, virtualCwd: true });
49
+ vfs.mount("/workspace");
50
+
51
+ const fsTools = createFsTools(new VfsFsProvider({ vfs }));
52
+ ```
53
+
54
+ ## Options
55
+
56
+ | Option | Default | Description |
57
+ | --- | --- | --- |
58
+ | `vfs` | — | Pre-created `VirtualFileSystem` instance. Skips auto-creation. |
59
+ | `provider` | `MemoryProvider` | VFS backend (`MemoryProvider`, `SqliteProvider`, `RealFSProvider`). |
60
+ | `vfsOptions` | `{ moduleHooks: false, virtualCwd: true }` | Options passed to `create()`. |
61
+ | `mountPoint` | `"/workspace"` | VFS mount point. |
62
+ | `maxFileSize` | `10 MB` | Reject reads for files larger than this. |
63
+
64
+ ## License
65
+
66
+ ISC
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@openharness/provider-vfs",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Virtual filesystem provider for @openharness/core — sandboxed, in-memory, or SQLite-backed file access for AI agents",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ }
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md"
15
+ ],
16
+ "keywords": [
17
+ "agent",
18
+ "ai",
19
+ "vfs",
20
+ "virtual-filesystem",
21
+ "sandbox",
22
+ "openharness"
23
+ ],
24
+ "license": "ISC",
25
+ "dependencies": {
26
+ "@openharness/core": "0.4.5"
27
+ },
28
+ "peerDependencies": {
29
+ "@platformatic/vfs": ">=0.3.0"
30
+ },
31
+ "peerDependenciesMeta": {
32
+ "@platformatic/vfs": {
33
+ "optional": true
34
+ }
35
+ },
36
+ "devDependencies": {
37
+ "@platformatic/vfs": "^0.3.0",
38
+ "@types/node": "^25.3.0",
39
+ "typescript": "^5.9.3"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "typecheck": "tsc --noEmit"
44
+ }
45
+ }