@wspc/cli 0.1.1 → 0.1.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Official TypeScript SDK and CLI for [wspc.ai](https://wspc.ai).
4
4
 
5
- > Status: **v0 walking skeleton.** Covers todo commands plus the first manual Drive sync slice.
5
+ > Status: **v0 walking skeleton.** Covers todo commands plus the first Drive bind / sync / watch slice.
6
6
 
7
7
  ## Install
8
8
 
@@ -41,27 +41,44 @@ scopes todos per project. Run `wspc todo project ls` to discover ids.
41
41
  | `wspc todo rule ls` | List recurrence rules. |
42
42
  | `wspc drive bind --library <id> [path]` | Bind an existing Drive library to a local folder. |
43
43
  | `wspc drive sync once [path]` | Run one manual whole-file Drive sync pass. |
44
+ | `wspc drive watch [path]` | Keep a bound Drive folder in foreground watch mode. |
44
45
  | `wspc config` | Inspect / clear local config. |
45
46
 
46
47
  Pass `--help` to any subcommand for flags, aliases, and examples.
47
48
 
48
49
  ## Drive sync
49
50
 
50
- Bind a local folder to an existing Drive library, then run sync explicitly:
51
+ 把本機資料夾綁到既有 Drive library,然後先用一次性 sync 驗證狀態:
51
52
 
52
53
  ```bash
53
54
  wspc drive bind --library lib_xxx ./notes
54
55
  wspc drive sync once ./notes
55
56
  ```
56
57
 
57
- `bind` does not create a server library. It verifies the existing library, writes
58
- `.wspc-drive/state.json`, and waits for an explicit `sync once`.
58
+ `bind` 不會建立 server library。它只會驗證既有 library、寫入
59
+ `.wspc-drive/state.json`,然後等待明確的 `sync once` `watch`。
59
60
 
60
- `sync once` is the v1 safe manual sync path: it performs a full folder scan,
61
- compares local files with the remote manifest, uploads/downloads whole files,
62
- uses optimistic remote versions for updates/deletes, and records conflicts in
63
- local state instead of auto-merging them. It does not run a watcher, preserve
64
- empty directories, detect renames, or create remote libraries.
61
+ `sync once` 是安全的一次性 sync path:它會完整掃描資料夾、比對 remote
62
+ manifest、上傳 / 下載 whole files、用 optimistic remote versions update /
63
+ delete,並把 conflicts 記在本機 state,而不是自動 merge。它不會啟動 watcher、
64
+ 保留空目錄、偵測 rename,或建立 remote libraries。
65
+
66
+ 需要 foreground 監看時使用:
67
+
68
+ ```bash
69
+ wspc drive watch ./notes
70
+ ```
71
+
72
+ `watch` 會共用同一個 `sync once` correctness boundary。本機檔案事件與 Drive
73
+ realtime WebSocket event 都只是 sync hint:CLI 收到 event 後排程完整 sync pass,
74
+ 不會直接依 realtime payload 改檔案或宣稱檔案已同步。realtime connection 會沿用
75
+ 既有 CLI auth,token 只留在 memory,不寫入 `.wspc-drive/state.json` 或 output。
76
+
77
+ watch output 會顯示 `drive_watch_started`、`drive_sync_once`、
78
+ `drive_realtime_connected`、`drive_realtime_event`、
79
+ `drive_realtime_reconnecting`、`drive_realtime_warning` 或
80
+ `drive_realtime_auth_failed`。在 `--json` / pipe 模式下,這些 event 會以
81
+ newline-delimited JSON objects 輸出,方便 scripts 追蹤 foreground watch 狀態。
65
82
 
66
83
  ### Running a command as a specific account
67
84