srift-transfer 4.0.0 → 4.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.
- package/README.md +33 -20
- package/dist/daemon.js +349 -158
- package/dist/index.js +650 -426
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/srift-transfer)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
|
-
[](https://modelcontextprotocol.io)
|
|
7
7
|
[](https://smithery.ai/servers/srift/srift)
|
|
8
8
|
[](https://glama.ai/mcp/connectors/app.srift/srift)
|
|
9
9
|
[](https://srift.app)
|
|
@@ -46,7 +46,8 @@ The user opens the link in any web browser or runs `srift get https://srift.app/
|
|
|
46
46
|
> through the srift.app relay on demand (pass-through, nothing stored). It runs
|
|
47
47
|
> in the background and survives your command exiting, so the link stays live
|
|
48
48
|
> afterwards. But if the daemon stops (machine sleeps or reboots, or
|
|
49
|
-
> `srift daemon stop`) the link returns `503 sender is offline
|
|
49
|
+
> `srift daemon stop`) the link returns `503 sender is offline` for ~15 s, then
|
|
50
|
+
> `404` once the link is released. In CI, keep
|
|
50
51
|
> the job alive until the recipient has downloaded (`--wait` blocks until then).
|
|
51
52
|
> If you need a link that outlives your machine, use storage — SRIFT is a relay.
|
|
52
53
|
>
|
|
@@ -66,7 +67,7 @@ AI agents can communicate directly among themselves without human intervention.
|
|
|
66
67
|
- Agent 1 initializes a secure room: `srift session start --name "Swarm-Sync"`
|
|
67
68
|
- Agent 2 joins the room: `srift session join <sessionId>`
|
|
68
69
|
- Agents exchange end-to-end encrypted messages and state updates: `srift chat send "{\"task\":\"analysis_complete\",\"status\":\"ready\"}"`
|
|
69
|
-
- Agents transfer intermediate state files, memory checkpoints, or embeddings
|
|
70
|
+
- Agents transfer intermediate state files, memory checkpoints, or embeddings over the encrypted relay: `srift send ./agent_state.bin`
|
|
70
71
|
|
|
71
72
|
### 🖥️ Headless Server & Cloud Container File Delivery via npm / npx
|
|
72
73
|
|
|
@@ -77,7 +78,7 @@ In headless cloud environments, Docker containers, Kubernetes pods, and CI/CD pi
|
|
|
77
78
|
npx srift-transfer quick-share ./build/app-release.tar.gz --once --ttl 1h --wait
|
|
78
79
|
# ↳ https://srift.app/d/9x2m4kp (blocks until downloaded; the link is served from this job)
|
|
79
80
|
```
|
|
80
|
-
- **Zero inbound firewall ports required** (connects
|
|
81
|
+
- **Zero inbound firewall ports required** (connects out over the WebSocket relay on port 443).
|
|
81
82
|
- **Zero cloud storage costs** (streams live from disk with zero server retention).
|
|
82
83
|
- **Supports auto-expiry** (`--ttl 1h`) and single-use self-destruct (`--once`).
|
|
83
84
|
|
|
@@ -87,7 +88,7 @@ SRIFT runs across all server operating systems and deployment targets:
|
|
|
87
88
|
- **Local & Server Environments (Linux, macOS, Windows, Docker, Kubernetes)**:
|
|
88
89
|
Install via npm (`npm install -g srift-transfer` or `npx`) or standalone binary (`curl -fsSL https://srift.app/install.sh | sh`). Exposes all 15 MCP tools, CLI commands, and local HTTP REST daemon.
|
|
89
90
|
- **Serverless & Browser Environments (Cloudflare Workers, Vercel Edge, AWS Lambda, Claude.ai, ChatGPT)**:
|
|
90
|
-
Use the hosted zero-install MCP endpoint: `POST https://srift.app/mcp` (Streamable HTTP, MCP
|
|
91
|
+
Use the hosted zero-install MCP endpoint: `POST https://srift.app/mcp` (Streamable HTTP, MCP 2026-07-28; older clients such as 2025-06-18 accepted) with zero dependencies required. It exposes 9 session/control tools.
|
|
91
92
|
|
|
92
93
|
|
|
93
94
|
## 🚀 Installation
|
|
@@ -120,7 +121,7 @@ npx srift-transfer quick-share ./build/output.zip
|
|
|
120
121
|
|
|
121
122
|
## 🛠 Model Context Protocol (MCP) Setup
|
|
122
123
|
|
|
123
|
-
SRIFT ships a native Model Context Protocol server exposing **
|
|
124
|
+
SRIFT ships a native Model Context Protocol server exposing **15 agent tools**, resources, and prompt templates over the local stdio/HTTP transports. The hosted endpoint exposes 9 of them (see below).
|
|
124
125
|
|
|
125
126
|
### Automatic One-Command Setup
|
|
126
127
|
Run the auto-installer to print or register config into supported IDEs:
|
|
@@ -220,7 +221,7 @@ For web-based agents (ChatGPT, Claude.ai, Gemini, Perplexity) that cannot run lo
|
|
|
220
221
|
|
|
221
222
|
> **The hosted endpoint exposes 9 of the 15 tools** — session and peer orchestration only
|
|
222
223
|
> (`start_session`, `join_session`, `session_status`, `close_session`, `approve_join`,
|
|
223
|
-
> `reject_join`, `kick_user`, `list_transfers`).
|
|
224
|
+
> `reject_join`, `kick_user`, `list_transfers`, `net_diagnose`).
|
|
224
225
|
> `quick_share`, `send_file`, `accept_transfer`, `send_chat`, `chat_history` and `read_state`
|
|
225
226
|
> are **local-only**: the first three need access to your disk, and the chat tools would
|
|
226
227
|
> require deriving session keys server-side. Install the CLI if you need those.
|
|
@@ -249,13 +250,13 @@ For web-based agents (ChatGPT, Claude.ai, Gemini, Perplexity) that cannot run lo
|
|
|
249
250
|
| `srift_approve_join` | `tempUserId` (string) | Host control: approves a pending user join request. |
|
|
250
251
|
| `srift_reject_join` | `tempUserId` (string), `reason?` (string) | Host control: rejects a pending user join request. |
|
|
251
252
|
| `srift_kick_user` | `userId` (string) | Host control: kicks an active user from the session room. |
|
|
252
|
-
| `srift_send_file` | `filePath` (string)
|
|
253
|
+
| `srift_send_file` | `filePath` (string) | Offers a file to the peers in the session (end-to-end encrypted relay, or WebRTC between browsers). |
|
|
253
254
|
| `srift_accept_transfer` | `fileId` (string), `saveDir?` (string) | Accepts an inbound file offer and streams it to local disk. |
|
|
254
255
|
| `srift_list_transfers` | _none_ | Lists active transfers with progress percentage, speed (KB/s), and ETA. |
|
|
255
256
|
| `srift_send_chat` | `message` (string) | Sends an end-to-end encrypted chat message to the active session. |
|
|
256
257
|
| `srift_chat_history` | _none_ | Returns decrypted chat message history for the active session. |
|
|
257
258
|
| `srift_read_state` | _none_ | Returns atomic snapshot of `.srift-state.json` (transfers, session, peers). |
|
|
258
|
-
| `srift_net_diagnose` |
|
|
259
|
+
| `srift_net_diagnose` | `fresh?`, `deep?` | Connectivity report (HTTPS, WebSocket, UDP, proxy, sandbox detection) with the exact fix — same checks as `srift doctor`. |
|
|
259
260
|
|
|
260
261
|
### MCP Resources & Prompts
|
|
261
262
|
- **Resources**: `srift://session/status`, `srift://transfers/active`, `srift://chat/messages`, `srift://workspace/state`, `srift://docs/quickstart`
|
|
@@ -334,8 +335,8 @@ srift quick-share ./dist.zip --foreground # serve from this proce
|
|
|
334
335
|
srift get "https://srift.app/d/<token>" -o ./downloads/
|
|
335
336
|
|
|
336
337
|
# Manage active links
|
|
337
|
-
srift
|
|
338
|
-
srift
|
|
338
|
+
srift links list # list all active public links and counters
|
|
339
|
+
srift links revoke <token> # immediately revoke an active link
|
|
339
340
|
```
|
|
340
341
|
|
|
341
342
|
#### Sharing Several Files at Once
|
|
@@ -384,7 +385,7 @@ srift chat history # view decrypted room history
|
|
|
384
385
|
srift daemon start # run daemon in foreground
|
|
385
386
|
srift daemon status # daemon status and port
|
|
386
387
|
srift daemon restart # restart daemon process
|
|
387
|
-
srift doctor [--json]
|
|
388
|
+
srift doctor [--deep] [--json] [--fresh] # connectivity diagnosis with exact fixes
|
|
388
389
|
srift logs [--tail 100] # inspect daemon activity logs
|
|
389
390
|
srift reset # flush session state & keys
|
|
390
391
|
srift self-update # update to latest version
|
|
@@ -417,18 +418,18 @@ Subscribe to real-time events without polling:
|
|
|
417
418
|
```bash
|
|
418
419
|
curl -N http://127.0.0.1:3822/api/v1/monitor/events
|
|
419
420
|
```
|
|
420
|
-
Events emitted: `connection_state`, `join_request`, `file_offer`, `transfer_progress`, `chat_received`.
|
|
421
|
+
Events emitted: `connection_state`, `join_request`, `participants`, `file_offer`, `transfer_progress`, `chat_received`, `pubshare_download`, `session_terminated`.
|
|
421
422
|
|
|
422
423
|
---
|
|
423
424
|
|
|
424
425
|
## 🔐 Architecture & Security
|
|
425
426
|
|
|
426
|
-
- **
|
|
427
|
+
- **Cryptography**: Session transfers and `--encrypt` links are encrypted client-side with **AES-256-GCM** (distinct 12-byte IV per block); plain quick-share links are TLS-only in transit (zero retention). Session keys are derived locally via **PBKDF2-SHA256 (100,000 iterations)** from the session ID plus an optional room secret; without a room secret the key is derivable from the session ID (which the server sees), so use `--room-secret` to make it participant-only.
|
|
427
428
|
- **Adaptive Transport Stack**:
|
|
428
|
-
1. **WebRTC
|
|
429
|
-
2. **
|
|
430
|
-
3. **
|
|
431
|
-
- **Privacy First**: The daemon binds to `127.0.0.1` only. The relay stores nothing; for sessions and `--encrypt` links it only ever forwards ciphertext and never
|
|
429
|
+
1. **WebRTC**: browser↔browser, files >5 MB.
|
|
430
|
+
2. **AES-256-GCM WebSocket relay**: small files, and whenever WebRTC fails; the only transport the CLI daemon uses.
|
|
431
|
+
3. **WebTorrent**: optional, browser only.
|
|
432
|
+
- **Privacy First**: The daemon binds to `127.0.0.1` only. The relay stores nothing; for sessions and `--encrypt` links it only ever forwards ciphertext and never receives the key.
|
|
432
433
|
|
|
433
434
|
---
|
|
434
435
|
|
|
@@ -441,6 +442,16 @@ Set custom configuration options via environment variables or `~/.srift/config.j
|
|
|
441
442
|
| `SRIFT_DAEMON_PORT` | `3822` | Port for the local background daemon |
|
|
442
443
|
| `SRIFT_BASE_URL` | `http://127.0.0.1:3822` | Base URL used by SDK clients to reach daemon |
|
|
443
444
|
| `SRIFT_NO_UPDATE_CHECK` | `0` | Set to `1` to disable automatic update checks |
|
|
445
|
+
| `SRIFT_LINK_PASSWORD` | — | Password for `quick-share --encrypt` / `get` without putting it in shell history |
|
|
446
|
+
| `SRIFT_NO_HISTORY` | `0` | Set to `1` to stop recording created links in `~/.srift/history.jsonl` |
|
|
447
|
+
| `SRIFT_NO_EMBEDDED` | `0` | Set to `1` to disable the in-process daemon fallback (sandboxes) |
|
|
448
|
+
| `HTTPS_PROXY` / `NO_PROXY` | — | Proxy (`http://`, `https://`, `socks5://`), honoured everywhere |
|
|
449
|
+
| `NODE_EXTRA_CA_CERTS` | — | Trust a TLS-inspecting proxy's root CA |
|
|
450
|
+
| `SRIFT_AN_HOME` | `~/.srift/agentnet` | AgentNet identity and data directory |
|
|
451
|
+
| `SRIFT_AN_RELAY` | `https://srift.app` | AgentNet relay(s), comma-separated |
|
|
452
|
+
| `SRIFT_AN_EPHEMERAL` | `0` | `1` keeps AgentNet conversations in RAM only |
|
|
453
|
+
| `SRIFT_AN_PASSPHRASE` | — | Encrypts the AgentNet identity file (PBKDF2-SHA256 + AES-256-GCM) |
|
|
454
|
+
| `SRIFT_AN_TRANSPORT` | `ws` | `poll` forces HTTP long-poll (networks that block WebSockets) |
|
|
444
455
|
|
|
445
456
|
---
|
|
446
457
|
|
|
@@ -448,12 +459,14 @@ Set custom configuration options via environment variables or `~/.srift/config.j
|
|
|
448
459
|
|
|
449
460
|
First-party, zero-dependency SDKs for accessing SRIFT from any programming language:
|
|
450
461
|
|
|
451
|
-
- **Node.js**: [`sdk/node`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/node) (`
|
|
452
|
-
- **Python**: [`sdk/python`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/python) (CPython 3.8
|
|
462
|
+
- **Node.js**: [`sdk/node`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/node) (`curl -O https://srift.app/sdk/node/srift.mjs` — not on npm yet)
|
|
463
|
+
- **Python**: `pip install srift` (includes the CLI) — [`sdk/python`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/python) (`pip install srift` needs Python 3.9+; the single-file `srift.py` works on CPython 3.8+ and PyPy)
|
|
453
464
|
- **Go**: [`sdk/go`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/go) (Go 1.21+)
|
|
454
465
|
- **Rust**: [`sdk/rust`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/rust) (sync/async)
|
|
455
466
|
- **Java**: [`sdk/java`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/java) (Java 11+)
|
|
456
467
|
- **C# / .NET**: [`sdk/dotnet`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/dotnet) (.NET 6+)
|
|
468
|
+
- **PHP**: [`sdk/php`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/php) (PHP 7.4+)
|
|
469
|
+
- **Ruby**: [`sdk/ruby`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/ruby) (Ruby 2.7+)
|
|
457
470
|
- **Shell / Bash / PowerShell**: [`sdk/shell`](https://github.com/srivardhan113/SRIFT-Open_Source/tree/main/sdk/shell)
|
|
458
471
|
|
|
459
472
|
---
|