@elizaos/plugin-device-filesystem 2.0.3-beta.2
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/LICENSE +21 -0
- package/README.md +61 -0
- package/package.json +91 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @elizaos/plugin-device-filesystem
|
|
2
|
+
|
|
3
|
+
Mobile-safe filesystem bridge for the elizaOS runtime.
|
|
4
|
+
|
|
5
|
+
Adds a single `DeviceFilesystemBridge` service. Planner-visible read, write, and
|
|
6
|
+
directory list operations are routed through the canonical `FILE` action with
|
|
7
|
+
`target=device`:
|
|
8
|
+
|
|
9
|
+
- `FILE` with `action=read`, `target=device` — read a file from the user's
|
|
10
|
+
device-files root.
|
|
11
|
+
- `FILE` with `action=write`, `target=device` — write a file to the user's
|
|
12
|
+
device-files root.
|
|
13
|
+
- `FILE` with `action=ls`, `target=device` — list a directory inside the user's
|
|
14
|
+
device-files root.
|
|
15
|
+
|
|
16
|
+
## Backends
|
|
17
|
+
|
|
18
|
+
The bridge picks one of two backends at startup:
|
|
19
|
+
|
|
20
|
+
- **Capacitor** — when `window.Capacitor.isNativePlatform()` is true (iOS,
|
|
21
|
+
Android). Uses `@capacitor/filesystem` with `Directory.Documents` as the root.
|
|
22
|
+
- **Node** — when not on Capacitor. Uses `fs/promises` rooted at
|
|
23
|
+
`resolveStateDir() + "/workspace"` (default
|
|
24
|
+
`~/.local/state/eliza/workspace` unless XDG or env overrides it).
|
|
25
|
+
|
|
26
|
+
Both backends reject absolute paths, `..` traversal, NUL bytes, and (on Node)
|
|
27
|
+
any resolution that escapes the workspace root.
|
|
28
|
+
|
|
29
|
+
## FILE integration
|
|
30
|
+
|
|
31
|
+
This package owns only the device filesystem bridge. It does not register
|
|
32
|
+
planner-facing file actions. The `@elizaos/plugin-coding-tools` `FILE` action
|
|
33
|
+
discovers the bridge by the `device_filesystem` service type and delegates
|
|
34
|
+
`target=device` operations to it.
|
|
35
|
+
|
|
36
|
+
## iOS Info.plist (apply in the host app)
|
|
37
|
+
|
|
38
|
+
For iOS users to see files written into `Directory.Documents`, the host app's
|
|
39
|
+
`Info.plist` needs the following keys added:
|
|
40
|
+
|
|
41
|
+
```xml
|
|
42
|
+
<key>UIFileSharingEnabled</key>
|
|
43
|
+
<true/>
|
|
44
|
+
<key>LSSupportsOpeningDocumentsInPlace</key>
|
|
45
|
+
<true/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Without those keys, files still write — they just aren't browsable from the
|
|
49
|
+
Files.app side. Add them in the host app's iOS shell, not in this package.
|
|
50
|
+
|
|
51
|
+
## Android
|
|
52
|
+
|
|
53
|
+
No special manifest changes are required for Capacitor `Directory.Documents`
|
|
54
|
+
(the Capacitor Filesystem plugin handles scoped storage and MediaStore on
|
|
55
|
+
Android 10+). Cross-app sharing through `MediaStore.Downloads` belongs in the
|
|
56
|
+
host app's AndroidManifest, not here.
|
|
57
|
+
|
|
58
|
+
## Service type
|
|
59
|
+
|
|
60
|
+
`DEVICE_FILESYSTEM_SERVICE_TYPE = "device_filesystem"`. Resolve programmatically
|
|
61
|
+
with `getDeviceFilesystemBridge(runtime)`.
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/plugin-device-filesystem",
|
|
3
|
+
"version": "2.0.3-beta.2",
|
|
4
|
+
"description": "Mobile-safe filesystem bridge for canonical FILE target=device operations on iOS/Android and desktop/AOSP.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/elizaos/eliza.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"eliza-source": {
|
|
19
|
+
"types": "./src/index.ts",
|
|
20
|
+
"import": "./src/index.ts",
|
|
21
|
+
"default": "./src/index.ts"
|
|
22
|
+
},
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"eliza",
|
|
32
|
+
"plugin",
|
|
33
|
+
"filesystem",
|
|
34
|
+
"capacitor",
|
|
35
|
+
"mobile",
|
|
36
|
+
"ios",
|
|
37
|
+
"android"
|
|
38
|
+
],
|
|
39
|
+
"author": "elizaOS",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@elizaos/core": "2.0.3-beta.2",
|
|
43
|
+
"zod": "^4.4.3"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@elizaos/core": "2.0.3-beta.2"
|
|
47
|
+
},
|
|
48
|
+
"optionalDependencies": {
|
|
49
|
+
"@capacitor/filesystem": "^8.1.2"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@biomejs/biome": "^2.4.14",
|
|
53
|
+
"@capacitor/filesystem": "^8.1.2",
|
|
54
|
+
"@types/node": "^25.0.3",
|
|
55
|
+
"typescript": "^6.0.3",
|
|
56
|
+
"vitest": "^4.0.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "bun run build.ts",
|
|
60
|
+
"dev": "bun --hot build.ts",
|
|
61
|
+
"clean": "rm -rf dist .turbo",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"typecheck": "tsgo --noEmit -p tsconfig.json",
|
|
64
|
+
"lint": "bunx @biomejs/biome check --write --unsafe .",
|
|
65
|
+
"lint:check": "bunx @biomejs/biome check .",
|
|
66
|
+
"format": "bunx @biomejs/biome format --write .",
|
|
67
|
+
"format:check": "bunx @biomejs/biome format .",
|
|
68
|
+
"check": "bun run typecheck && bun run test"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
73
|
+
"agentConfig": {
|
|
74
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
75
|
+
"pluginParameters": {}
|
|
76
|
+
},
|
|
77
|
+
"eliza": {
|
|
78
|
+
"platforms": [
|
|
79
|
+
"node",
|
|
80
|
+
"ios",
|
|
81
|
+
"android"
|
|
82
|
+
],
|
|
83
|
+
"runtime": "node",
|
|
84
|
+
"platformDetails": {
|
|
85
|
+
"node": "Filesystem rooted under resolveStateDir()/workspace",
|
|
86
|
+
"ios": "Capacitor Filesystem Directory.Documents",
|
|
87
|
+
"android": "Capacitor Filesystem Directory.Documents"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
|
|
91
|
+
}
|