mirror of
https://github.com/sotashimozono/obsidian-remote-ssh.git
synced 2026-07-22 06:52:07 +00:00
Closes #216. WsRpcClient (#mobile/src/transport/WsRpcClient.ts) - JSON-RPC 2.0 over WsChannel with id-correlated pending map - 30 s configurable call timeout; pending calls reject on close - onNotification() for server-push messages; onClose() disposers - No Node.js deps — TextEncoder/TextDecoder throughout WsRpcConnection (mobile/src/transport/WsRpcConnection.ts) - Static connect() factory: WsChannel + auth RPC + server.info RPC - queueBeforeOpen:true so frames queued while socket is still opening - waitForOpen() races open/error/close events; short-circuits if OPEN - Exposes .rpc (WsRpcClient) and .serverInfo (ServerInfo) as readonly WsRemoteFsClient (mobile/src/adapter/WsRemoteFsClient.ts) - Mirrors desktop RpcRemoteFsClient with Uint8Array instead of Buffer - btoa/atob base64 helpers (browser-native, no Node.js) - All fs.* methods: stat, exists, list, readBinary, readBinaryRange, writeBinary, mkdirp, remove, rmdir, rename, copy - isAlive() / onClose() delegate to WsRpcClient Tests: 24 passing across 3 test files. |
||
|---|---|---|
| .. | ||
| WsRemoteFsClient.test.ts | ||
| WsRpcClient.test.ts | ||
| WsRpcConnection.test.ts | ||