@fizzyflow/wdoublesync_cli 1.0.5 → 1.0.7
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/README.md +7 -0
- package/SKILL.md +64 -81
- package/bin/wdoublesync.js +4 -0
- package/lib/commands/push.js +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ The `[path]` argument is optional — if omitted, the current working directory
|
|
|
40
40
|
| `--version <n>` | Version to restore (`pull` only, default: latest) |
|
|
41
41
|
| `--exclude <p1,p2>` | Extra exclude patterns (comma-separated) |
|
|
42
42
|
| `--no-compress` | Disable gzip compression |
|
|
43
|
+
| `--no-seal` | Create a new vector public (no Seal encryption). Only applies when creating; ignored for existing vectors |
|
|
43
44
|
| `--manifest` | Write/use `.wdoublesync` manifest for faster change detection |
|
|
44
45
|
| `--force-snapshot` | Push a full snapshot regardless of prior history (repairs a corrupt vector) |
|
|
45
46
|
| `--poll-interval <s>` | `watch`: seconds between remote version checks (default: `2`) |
|
|
@@ -74,6 +75,12 @@ wdoublesync push ~/my-project --chain testnet --key suiprivkey1...
|
|
|
74
75
|
# version 1 pushed (full snapshot, gzip compressed)
|
|
75
76
|
```
|
|
76
77
|
|
|
78
|
+
By default a new vector is Seal-encrypted. To create a public (unencrypted) vector that anyone can pull without a key:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
wdoublesync push --chain testnet --key suiprivkey1... --no-seal
|
|
82
|
+
```
|
|
83
|
+
|
|
77
84
|
### Push an update
|
|
78
85
|
|
|
79
86
|
```bash
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wdoublesync
|
|
3
|
-
version: 0.1.
|
|
3
|
+
version: 0.1.8
|
|
4
4
|
description: Claude agent skill for decentralized file storage, versioning, and sync on Sui + Walrus + Seal. Enables agents to push local folders as on-chain vectors, pull versions, manage Walrus storage, and watch for changes.
|
|
5
5
|
keywords: [walrus, sui, storage, versioning, sync, seal-encryption, blockchain, defi]
|
|
6
6
|
---
|
|
@@ -22,7 +22,7 @@ An abstract virtual filesystem that synchronizes folder state on-chain via Sui +
|
|
|
22
22
|
|
|
23
23
|
## When NOT to Use
|
|
24
24
|
|
|
25
|
-
- For **semantic/vector search over text** — if you need to index and search text by meaning, use [MemWal](https://raw.githubusercontent.com/MystenLabs/MemWal/refs/heads/dev/SKILL.md) instead (vector database with embeddings)
|
|
25
|
+
- For **semantic/vector search over text** — if you need to index and search text by meaning, use [MemWal](https://raw.githubusercontent.com/MystenLabs/MemWal/refs/heads/dev/SKILL.md) instead (vector database with embeddings). You'd better use 'default' workspace for MemWal, no need to try to create one based on the current directory or doublesync state.
|
|
26
26
|
|
|
27
27
|
## MemWal + WDoubleSync
|
|
28
28
|
|
|
@@ -44,7 +44,9 @@ npm install -g @fizzyflow/wdoublesync_cli
|
|
|
44
44
|
# Now use: wdoublesync <command> (installed from npm)
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
After you have access to `wdoublesync`, you can run `wdoublesync --help` to see the available commands and options. Use `wdoublesync info` to check your currently connected wallet (`your wallet` field), if there's no
|
|
47
|
+
After you have access to `wdoublesync`, you can run `wdoublesync --help` to see the available commands and options. Use `wdoublesync info` to check your currently connected wallet (`your wallet` field), if there's no wallet, you can set one with `--key` or `--phrase` flags, or by exporting `WDOUBLESYNC_KEY` environment variable. Feel free to ask user to set up a wallet if they haven't done so yet, as it's required for push operations and pull encrypted vectors.
|
|
48
|
+
|
|
49
|
+
After wdoublesync is installed, ask the user to set up MemWal if they want.
|
|
48
50
|
|
|
49
51
|
### Set up your key (required for push and pull of encrypted vectors)
|
|
50
52
|
|
|
@@ -56,23 +58,21 @@ For **read-only public vectors**, the key is not required.
|
|
|
56
58
|
|
|
57
59
|
### Push a folder (creates new vector if no ID provided)
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Pass the path explicitly — no need to `cd` first:
|
|
60
62
|
|
|
61
63
|
```bash
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
# Creates new vector + syncs current folder
|
|
64
|
+
wdoublesync push ~/my-folder
|
|
65
|
+
# Creates new vector + syncs folder
|
|
65
66
|
# Output: created: 0x1234... / syncing ./ → 0x1234...
|
|
66
67
|
```
|
|
67
68
|
|
|
68
|
-
This creates a new EndlessVector on-chain and pushes the
|
|
69
|
+
This creates a new EndlessVector on-chain and pushes the folder as a snapshot encrypted by Seal. To create a **public** vector instead — unencrypted, pullable without a key and browsable from the dApp — add `--no-seal` (only effective on creation). The output will show the vector ID (e.g., `0x1234...`) which you can use for future pulls or pushes. It's a good idea to save this ID to MemWal, with addition to the path info, so you can easily find it later when you want to pull or view the vector state. Ask a user if they want to set up MemWal if it's not available and you are going to push new vector.
|
|
69
70
|
|
|
70
71
|
### Pull a vector to restore it
|
|
71
72
|
|
|
72
73
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
# Restores vector to current directory
|
|
74
|
+
wdoublesync pull 0x1234... ~/restored-folder
|
|
75
|
+
# Restores vector to the specified folder
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
### View vector metadata
|
|
@@ -85,104 +85,92 @@ wdoublesync info 0x1234...
|
|
|
85
85
|
### Watch for changes (bi-directional sync)
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
# Monitors local folder, auto-pushes changes
|
|
88
|
+
wdoublesync watch 0x1234... ~/my-data --poll-interval 5
|
|
89
|
+
# Monitors folder, auto-pushes changes
|
|
91
90
|
# Checks remote every 5 seconds, auto-pulls updates
|
|
92
91
|
```
|
|
93
92
|
|
|
94
93
|
## API Surface
|
|
95
94
|
|
|
96
|
-
All commands operate on the **current working directory** — `cd` into your folder first.
|
|
97
|
-
|
|
98
95
|
| Command | Arguments | Use Case |
|
|
99
96
|
|---------|-----------|----------|
|
|
100
|
-
| **push** | `[vectorId]` `[options]` | Sync
|
|
101
|
-
| **pull** | `vectorId` `[options]` | Restore vector (default: latest version) into
|
|
102
|
-
| **info** | `[vectorId]` | No ID: show chain + wallet. With ID: full vector details |
|
|
103
|
-
| **watch** | `vectorId` `[options]` | Bi-directional sync: auto-push local changes, auto-pull remote updates |
|
|
104
|
-
| **rebate** | `vectorId` | Burn archive patches, push
|
|
97
|
+
| **push** | `[vectorId]` `[path]` `[options]` | Sync folder to vector; creates new vector if no ID given |
|
|
98
|
+
| **pull** | `vectorId` `[path]` `[options]` | Restore vector (default: latest version) into folder |
|
|
99
|
+
| **info** | `[vectorId]` `[path]` | No ID: show chain + wallet. With ID: full vector details |
|
|
100
|
+
| **watch** | `vectorId` `[path]` `[options]` | Bi-directional sync: auto-push local changes, auto-pull remote updates |
|
|
101
|
+
| **rebate** | `vectorId` `[path]` | Burn archive patches, push folder as fresh single snapshot |
|
|
105
102
|
|
|
106
103
|
### Command Examples
|
|
107
104
|
|
|
108
105
|
#### push (create new vector)
|
|
109
106
|
|
|
110
107
|
```bash
|
|
111
|
-
|
|
112
|
-
wdoublesync push
|
|
113
|
-
# Syncs current folder as new vector
|
|
108
|
+
wdoublesync push ~/my-data
|
|
114
109
|
# Output: creating new EndlessVector on testnet...
|
|
115
110
|
# created: 0xabc123...
|
|
116
111
|
# syncing ./ → 0xabc123...
|
|
117
112
|
```
|
|
118
113
|
|
|
114
|
+
#### push (create public, unencrypted vector)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
wdoublesync push ~/my-data --no-seal
|
|
118
|
+
# Creates a public vector — anyone can pull it without a key, or browse it from the dApp.
|
|
119
|
+
# Only effective on creation; ignored when pushing to an existing vector.
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### push (to existing vector)
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
wdoublesync push 0x1234... ~/my-data
|
|
126
|
+
```
|
|
127
|
+
|
|
119
128
|
#### push (with manifest for faster change detection)
|
|
120
129
|
|
|
121
130
|
```bash
|
|
122
|
-
|
|
123
|
-
wdoublesync push 0x1234... --manifest
|
|
124
|
-
# Writes .wdoublesync manifest; faster change detection on future pushes
|
|
131
|
+
wdoublesync push 0x1234... ~/my-data --manifest
|
|
125
132
|
```
|
|
126
133
|
|
|
127
134
|
#### push (full snapshot, not incremental)
|
|
128
135
|
|
|
129
136
|
```bash
|
|
130
|
-
|
|
131
|
-
wdoublesync push 0x1234... --force-snapshot
|
|
137
|
+
wdoublesync push 0x1234... ~/my-data --force-snapshot
|
|
132
138
|
# Uploads entire snapshot, useful if history is corrupted
|
|
133
139
|
```
|
|
134
140
|
|
|
135
141
|
#### pull (latest version)
|
|
136
142
|
|
|
137
143
|
```bash
|
|
138
|
-
|
|
139
|
-
wdoublesync pull 0x1234...
|
|
140
|
-
# Restores latest version to current directory
|
|
144
|
+
wdoublesync pull 0x1234... ~/restored
|
|
141
145
|
```
|
|
142
146
|
|
|
143
147
|
#### pull (specific version)
|
|
144
148
|
|
|
145
149
|
```bash
|
|
146
|
-
|
|
147
|
-
wdoublesync pull 0x1234... --version 10
|
|
148
|
-
# Restores version 10 instead of latest
|
|
150
|
+
wdoublesync pull 0x1234... ~/restored --version 10
|
|
149
151
|
```
|
|
150
152
|
|
|
151
153
|
#### watch (bi-directional)
|
|
152
154
|
|
|
153
155
|
```bash
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
# Monitors current folder, auto-pushes on change (debounce: 1000ms default)
|
|
156
|
+
wdoublesync watch 0x1234... ~/my-data --poll-interval 5
|
|
157
|
+
# Auto-pushes on change (debounce: 1000ms default)
|
|
157
158
|
# Checks remote every 5 seconds, auto-pulls new versions
|
|
158
159
|
# Runs indefinitely; stop with Ctrl+C
|
|
159
160
|
```
|
|
160
161
|
|
|
161
|
-
#### watch (push-only)
|
|
162
|
+
#### watch (push-only or pull-only)
|
|
162
163
|
|
|
163
164
|
```bash
|
|
164
|
-
|
|
165
|
-
wdoublesync watch 0x1234... --
|
|
166
|
-
# Only auto-push on local changes, don't pull remote updates
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
#### watch (pull-only)
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
cd ~/my-data
|
|
173
|
-
wdoublesync watch 0x1234... --pull-only
|
|
174
|
-
# Only pull remote updates, don't auto-push local changes
|
|
165
|
+
wdoublesync watch 0x1234... ~/my-data --push-only
|
|
166
|
+
wdoublesync watch 0x1234... ~/my-data --pull-only
|
|
175
167
|
```
|
|
176
168
|
|
|
177
169
|
#### rebate
|
|
178
170
|
|
|
179
|
-
When user asks to rebate, you can explain that this command is useful after many incremental syncs to reclaim on-chain storage. It burns the archive history and pushes the current folder as a fresh single snapshot. Make sure user understands that after rebate, only the latest snapshot is available, and old patches will be burned.
|
|
180
|
-
|
|
181
171
|
```bash
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
# Burns archive history, pushes current folder as fresh single snapshot
|
|
185
|
-
# Useful after many incremental syncs to reclaim on-chain storage
|
|
172
|
+
wdoublesync rebate 0x1234... ~/my-data
|
|
173
|
+
# Burns archive history, pushes folder as fresh single snapshot
|
|
186
174
|
```
|
|
187
175
|
|
|
188
176
|
|
|
@@ -196,6 +184,7 @@ wdoublesync rebate 0x1234...
|
|
|
196
184
|
| `--key` | Sui private key (`suiprivkey1...`) | — | Sign transactions (or use env vars) |
|
|
197
185
|
| `--phrase` | Mnemonic phrase | — | Alternative: derive key from mnemonic |
|
|
198
186
|
| `--no-compress` | — | — | Push: disable gzip compression |
|
|
187
|
+
| `--no-seal` | — | — | Push: create a new vector public (no Seal encryption). Only applies when creating a vector; ignored for existing ones |
|
|
199
188
|
| `--manifest` | — | — | Push: write/use `.wdoublesync` file for faster change detection |
|
|
200
189
|
| `--force-snapshot` | — | — | Push: full snapshot (repairs corrupt vectors) |
|
|
201
190
|
| `--version` | Number | `latest` | Pull: restore specific version instead of latest |
|
|
@@ -217,14 +206,12 @@ wdoublesync rebate 0x1234...
|
|
|
217
206
|
|
|
218
207
|
```bash
|
|
219
208
|
# 1. Push a folder (creates new vector on first push)
|
|
220
|
-
|
|
221
|
-
wdoublesync push
|
|
209
|
+
wdoublesync push ~/important-data
|
|
222
210
|
# Output: creating new EndlessVector on testnet...
|
|
223
211
|
# created: 0xabc123...
|
|
224
212
|
|
|
225
213
|
# 2. Verify by pulling to a fresh folder
|
|
226
|
-
|
|
227
|
-
wdoublesync pull 0xabc123...
|
|
214
|
+
wdoublesync pull 0xabc123... ~/verify-tmp
|
|
228
215
|
|
|
229
216
|
# 3. Check file counts match
|
|
230
217
|
ls ~/important-data | wc -l
|
|
@@ -234,21 +221,18 @@ ls ~/verify-tmp | wc -l
|
|
|
234
221
|
### Workflow 2: Multi-version history and rollback
|
|
235
222
|
|
|
236
223
|
```bash
|
|
237
|
-
cd ~/data
|
|
238
224
|
# Push version 1
|
|
239
|
-
wdoublesync push 0xabc123...
|
|
225
|
+
wdoublesync push 0xabc123... ~/data
|
|
240
226
|
|
|
241
227
|
# Make changes, push version 2
|
|
242
|
-
echo "new file" > new.txt
|
|
243
|
-
wdoublesync push 0xabc123...
|
|
228
|
+
echo "new file" > ~/data/new.txt
|
|
229
|
+
wdoublesync push 0xabc123... ~/data
|
|
244
230
|
|
|
245
231
|
# List all versions
|
|
246
232
|
wdoublesync info 0xabc123...
|
|
247
233
|
|
|
248
234
|
# Rollback to version 1
|
|
249
|
-
|
|
250
|
-
wdoublesync pull 0xabc123... --version 1
|
|
251
|
-
# Folder now matches state from version 1
|
|
235
|
+
wdoublesync pull 0xabc123... ~/data-v1 --version 1
|
|
252
236
|
```
|
|
253
237
|
|
|
254
238
|
### Workflow 3: Rebate to compact archive
|
|
@@ -256,28 +240,19 @@ wdoublesync pull 0xabc123... --version 1
|
|
|
256
240
|
After many incremental syncs, archive grows with lots of patches. Rebate burns old data and rebuilds as single snapshot:
|
|
257
241
|
|
|
258
242
|
```bash
|
|
259
|
-
# Before rebate: many small patches
|
|
260
243
|
wdoublesync info 0xabc123...
|
|
261
244
|
# Output: version 87, total size 45 MB (many patches)
|
|
262
245
|
|
|
263
|
-
|
|
264
|
-
cd ~/data
|
|
265
|
-
wdoublesync rebate 0xabc123...
|
|
246
|
+
wdoublesync rebate 0xabc123... ~/data
|
|
266
247
|
# Output: Burned 86 items, pushed version 88 (3.2 MB)
|
|
267
|
-
|
|
268
|
-
# After rebate: single snapshot instead of 87 patches
|
|
269
|
-
# Much more efficient for Walrus storage
|
|
248
|
+
# Single snapshot instead of 87 patches — much more efficient
|
|
270
249
|
```
|
|
271
250
|
|
|
272
251
|
### Workflow 4: Watch for external changes
|
|
273
252
|
|
|
274
253
|
```bash
|
|
275
|
-
|
|
276
|
-
#
|
|
277
|
-
|
|
278
|
-
cd ~/data
|
|
279
|
-
wdoublesync watch 0xabc123... --poll-interval 5
|
|
280
|
-
# Monitors local folder for changes, auto-pushes them
|
|
254
|
+
wdoublesync watch 0xabc123... ~/data --poll-interval 5
|
|
255
|
+
# Monitors folder for changes, auto-pushes them
|
|
281
256
|
# Also checks remote every 5 seconds for updates, auto-pulls
|
|
282
257
|
# Press Ctrl+C to stop
|
|
283
258
|
```
|
|
@@ -290,8 +265,16 @@ wdoublesync watch 0xabc123... --poll-interval 5
|
|
|
290
265
|
| **"vector-id is required"** | Command needs a vector ID but none provided | Pass the vector ID as the first argument: `wdoublesync pull 0x...` |
|
|
291
266
|
| **"This vector is Seal-encrypted"** | Vector is encrypted but no key provided | Provide `--key` or `--phrase`, or export `WDOUBLESYNC_KEY` |
|
|
292
267
|
| **"at() is out of range, this part of archive has been burned"** | Trying to restore a version whose archive was burned by rebate | Only the latest snapshot is available after rebate; pull without `--version` |
|
|
293
|
-
| **Connection errors** | RPC endpoint unreachable or wrong chain |
|
|
268
|
+
| **Connection errors** | RPC endpoint unreachable or wrong chain | Check `--chain` flag; try again in a moment if the RPC is temporarily down |
|
|
269
|
+
|
|
294
270
|
|
|
295
271
|
## Links
|
|
296
272
|
|
|
297
273
|
- **Repository**: https://github.com/FizzyFlow/wdoublesync_cli
|
|
274
|
+
|
|
275
|
+
## Agent Guidelines
|
|
276
|
+
|
|
277
|
+
- **Always run `wdoublesync` commands as standalone Bash calls** — never chain them with `&&`, `;`, or combine with file creation commands in the same shell invocation. Create files first in a separate tool call, then push in a dedicated call.
|
|
278
|
+
- **Keep user posted**, After a successful push to an endless_vector, inform the user about the vector ID and the version that was just pushed. Also propose they view the current state in the browser by providing a link to the explorer, e.g. https://doublesync.wal.app/vector#testnet:0xafe7ab81339c9c4e5750f20708ef982ef553d9b20b17a85342e4af055661a852
|
|
279
|
+
- **MemWal vector ID logging is critical on first push** — when a new vector is created, immediately propose saving the vector ID + local path to MemWal. Phrase it as: "Want me to save the vector ID and path to MemWal so we can find it later?" This is the most important MemWal step — without it the vector ID can be lost. Only skip if the user explicitly says no.
|
|
280
|
+
- **MemWal version logging is mandatory after every push** — after every successful push, always propose saving a version description to MemWal. Phrase it as: "Want me to save a description of this version to MemWal?" and wait for the user response. Only skip if the user explicitly says no. Do not silently skip this step.
|
package/bin/wdoublesync.js
CHANGED
|
@@ -29,6 +29,7 @@ Options:
|
|
|
29
29
|
--version <n> Version to restore (pull only, default: latest)
|
|
30
30
|
--exclude <p1,p2> Extra exclude patterns (comma-separated)
|
|
31
31
|
--no-compress Disable gzip compression
|
|
32
|
+
--no-seal Create a new vector public (no Seal encryption); only applies on creation
|
|
32
33
|
--manifest Write/use .wdoublesync manifest for faster change detection
|
|
33
34
|
--force-snapshot Push a full snapshot regardless of prior history (repairs corrupt vectors)
|
|
34
35
|
--poll-interval <s> Watch: seconds between remote checks (default: 2)
|
|
@@ -49,6 +50,7 @@ function parseArgs(argv) {
|
|
|
49
50
|
version: null,
|
|
50
51
|
exclude: null,
|
|
51
52
|
compress: 'gzip',
|
|
53
|
+
seal: true,
|
|
52
54
|
manifest: false,
|
|
53
55
|
forceSnapshot: false,
|
|
54
56
|
pollInterval: 2,
|
|
@@ -100,6 +102,8 @@ function parseArgs(argv) {
|
|
|
100
102
|
args.exclude = raw[++i];
|
|
101
103
|
} else if (flag === '--no-compress') {
|
|
102
104
|
args.compress = false;
|
|
105
|
+
} else if (flag === '--no-seal') {
|
|
106
|
+
args.seal = false;
|
|
103
107
|
} else if (flag === '--manifest') {
|
|
104
108
|
args.manifest = true;
|
|
105
109
|
} else if (flag === '--force-snapshot') {
|
package/lib/commands/push.js
CHANGED
|
@@ -48,10 +48,15 @@ export async function push(args) {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
if (!vectorId) {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// Seal encryption is decided at creation time, solely by whether a sealClient
|
|
52
|
+
// is passed to create(). Omit it for a public (unencrypted) vector.
|
|
53
|
+
const createParams = args.seal === false ? { ...evParams, sealClient: undefined } : evParams;
|
|
54
|
+
console.log('creating new EndlessVector on', chain, args.seal === false ? '(public, no Seal)' : '(Seal-encrypted)', '...');
|
|
55
|
+
const ev = await EndlessVector.create(createParams);
|
|
53
56
|
vectorId = ev.id;
|
|
54
57
|
console.log(' created:', vectorId);
|
|
58
|
+
} else if (args.seal === false) {
|
|
59
|
+
console.log(' note: --no-seal only applies when creating a new vector; pushing to an existing vector keeps its current encryption');
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
console.log('syncing ./ →', vectorId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fizzyflow/wdoublesync_cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tool built on the wdoublesync library to sync local folders to Walrus decentralised storage on the Sui network. Stores versioned gzip-compressed snapshots and diffs inside an EndlessVector on-chain object. Supports Seal encryption, manifest-based fast change detection, and full version history with point-in-time restore.",
|
|
6
6
|
"bin": {
|