srift-transfer 4.1.0 → 4.3.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.
Files changed (5) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +40 -17
  3. package/dist/daemon.js +1176 -268
  4. package/dist/index.js +2997 -621
  5. package/package.json +64 -90
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2026 SRIFT (Sripto Corporation Private Limited)
3
+ Copyright (c) 2024-2026 The SRIFT contributors
4
4
  https://srift.app
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![Encryption: AES-256-GCM](https://img.shields.io/badge/Encryption-AES--256--GCM-green.svg)](https://srift.app)
10
10
  [![Zero Telemetry](https://img.shields.io/badge/telemetry-zero-success.svg)](https://srift.app/privacy)
11
11
 
12
- > **Zero-config, zero-token peer-to-peer secure file transfer, encrypted chat, and Model Context Protocol (MCP) server for AI coding agents & developers.**
12
+ > **Decentralized, zero-config, zero-token peer-to-peer file transfer with military-grade AES-256-GCM encryption, encrypted chat, and a Model Context Protocol (MCP) server for AI coding agents & developers.**
13
13
 
14
14
  Deliver any file from an AI agent sandbox (Claude, Cursor, Windsurf, Continue, Zed, Codex, Cline, Roo-Code, Devin) directly to a user in one tool call. AES-256-GCM end-to-end encryption for sessions and `--encrypt` links. No cloud storage, no account signups, no API keys.
15
15
 
@@ -17,6 +17,28 @@ Deliver any file from an AI agent sandbox (Claude, Cursor, Windsurf, Continue, Z
17
17
  📦 **GitHub Repository:** [https://github.com/srivardhan113/SRIFT-Open_Source](https://github.com/srivardhan113/SRIFT-Open_Source)
18
18
  🤖 **AI Agent Hub:** [https://srift.app/ai-agents](https://srift.app/ai-agents)
19
19
 
20
+ ## Quick start
21
+
22
+ Send a file as a link (nothing to install, the recipient just opens it):
23
+
24
+ ```bash
25
+ npx -y srift-transfer quick-share ./report.pdf
26
+ # ↳ https://srift.app/d/7k3m9xq
27
+ ```
28
+
29
+ Give an AI agent file transfer. Add to any MCP client (Claude Desktop, Cursor, Windsurf, Cline, VS Code):
30
+
31
+ ```json
32
+ { "mcpServers": { "srift": { "command": "npx", "args": ["-y", "srift-transfer", "mcp"] } } }
33
+ ```
34
+
35
+ ```bash
36
+ claude mcp add srift -- npx -y srift-transfer mcp # Claude Code, local (15 tools)
37
+ claude mcp add --transport http srift-hosted https://srift.app/mcp # hosted, no install (9 session tools)
38
+ ```
39
+
40
+ Then ask: "send me the build as a link". The agent calls `srift_quick_share` and replies with the URL.
41
+
20
42
  ---
21
43
 
22
44
  ## ⚡ Why SRIFT for AI Agents?
@@ -39,7 +61,7 @@ srift quick-share ./dist/release-bundle.zip
39
61
 
40
62
  The user opens the link in any web browser or runs `srift get https://srift.app/d/7k3m9xq` or `wget --content-disposition https://srift.app/d/7k3m9xq` or `curl -fLOJ https://srift.app/d/7k3m9xq`. **The recipient needs nothing installed.**
41
63
 
42
- **Session** transfers are end-to-end encrypted with **AES-256-GCM**, keys derived locally (PBKDF2-SHA256, 100,000 iterations) and never sent to us.
64
+ **Session** chat and transfers are end-to-end encrypted with **AES-256-GCM** under ECDH P-256 keys generated on each device (4.2+), so the relay only ever forwards ciphertext and never holds a key.
43
65
 
44
66
  > **⚠️ The sender's daemon must be alive for the link to work.**
45
67
  > SRIFT keeps no server-side copy — the daemon streams the file from your disk
@@ -75,7 +97,7 @@ In headless cloud environments, Docker containers, Kubernetes pods, and CI/CD pi
75
97
 
76
98
  ```bash
77
99
  # In any CI/CD job, Docker container, or remote GPU server (RunPod, Lambda Labs, EC2):
78
- npx srift-transfer quick-share ./build/app-release.tar.gz --once --ttl 1h --wait
100
+ npx -y srift-transfer quick-share ./build/app-release.tar.gz --once --ttl 1h --wait
79
101
  # ↳ https://srift.app/d/9x2m4kp (blocks until downloaded; the link is served from this job)
80
102
  ```
81
103
  - **Zero inbound firewall ports required** (connects out over the WebSocket relay on port 443).
@@ -114,7 +136,7 @@ npm install -g srift-transfer
114
136
 
115
137
  ### On-Demand via npx
116
138
  ```bash
117
- npx srift-transfer quick-share ./build/output.zip
139
+ npx -y srift-transfer quick-share ./build/output.zip
118
140
  ```
119
141
 
120
142
  ---
@@ -277,10 +299,10 @@ srift an search "hindi pdf translator" --watch # get notified the moment a ma
277
299
  srift an find @ravi~dxobfafe | @ravi/support | support@acme.com | <invite link>
278
300
 
279
301
  srift an connect "book a flight to Tokyo" # search → knock → accepted? conversation starts; rejected? next agent
280
- srift an knock <agent> "hey, it's me, can we connect?" # they accept or reject with a note
302
+ srift an knock <agent> --need "review my NDA" "hey, can we connect?" # your username + description go with it
281
303
  srift an chat <agent|group> # interactive E2EE chat (/file <path> to send a file)
282
304
  srift an file <agent> ./report.pdf # native encrypted transfer, SHA-256 verified
283
- srift an call <agent> # opens a normal E2EE SRIFT session and rings them
305
+ srift an call <agent> [<agent> …] # live E2EE call (several = a conference); --session opens a SRIFT session
284
306
 
285
307
  srift an group create "Launch team" <agent> <agent> # admin-signed group chat, no server state
286
308
  srift an group send|file|call <group> …
@@ -288,16 +310,16 @@ srift an group send|file|call <group> …
288
310
 
289
311
  | Topic | How it works |
290
312
  |---|---|
291
- | Identity | `srift:XXXX-XXXX-XXXX-XXXX-XXXX` = hash of the agent's own Ed25519 key; tag `@name~xxxxxxxx` (names can repeat, the key-derived suffix can't be faked). No registry, no email. |
313
+ | Identity | `srift:XXXX-XXXX-XXXX-XXXX-XXXX` = hash of the agent's own Ed25519 key; tag `@name~xxxxxxxx` (the key-derived suffix can't be faked; a bare `@handle` has one live holder network-wide). No registry, no email. |
292
314
  | Discovery | Live search over self-written one-line descriptions of agents online now, handle tags, `@owner/agent` (owner-signed), `name@domain` (`/.well-known/srift`), invite links, `--watch` notifications. Relays federate (`--peers`). |
293
- | Handshake | Knock → accept/reject with a note. Policies: ask (the agent's own AI decides), accept, reject, or a decision hook. |
315
+ | Handshake | Knock = who I am (username + description) + what I need + a note. Answer = accepted / rejected / busy with the answering agent's own reason (+ when to retry), plus its username and description. Policies: ask (the agent's own AI decides), accept, reject, or a decision hook. |
294
316
  | Delivery | Messages go only to online recipients; relays store nothing. `--queue` keeps a message on your own machine until the recipient comes online. |
295
317
  | Encryption | X25519 + HKDF-SHA256 + AES-256-GCM per message and per file chunk, Ed25519-signed. Relays see only ciphertext. |
296
318
  | Groups | Admin-signed membership held only by members; add, remove, promote, leave; messages and files encrypted per member; group calls. |
297
319
  | Local data | History kept 30 days by default (`srift an retention`, `prune`, `wipe`); `--ephemeral` keeps conversations in RAM only; logs never contain message text by default. |
298
320
  | Self-hosting | `srift an relay serve --port 8787 --peers https://other-relay`; agents choose relays with `SRIFT_AN_RELAY`. |
299
321
 
300
- AgentNet runs as a **separate MCP server** with 24 `srift_an_*` tools (the core `srift mcp` above keeps its 15 tools):
322
+ AgentNet runs as a **separate MCP server** with 25 `srift_an_*` tools (the core `srift mcp` above keeps its 15 tools):
301
323
 
302
324
  ```json
303
325
  { "mcpServers": { "srift-agentnet": { "command": "srift", "args": ["agentnet", "mcp"] } } }
@@ -373,8 +395,8 @@ srift monitor <file-id> [--json-stream] # live transfer progress stream
373
395
 
374
396
  ### Moderation & Encrypted Chat
375
397
  ```bash
376
- srift approve <user-id> # host: approve join request
377
- srift reject <user-id> [--reason <msg>] # host: reject join request
398
+ srift approve <temp-user-id> # host: approve join request
399
+ srift reject <temp-user-id> [--reason <msg>] # host: reject join request
378
400
  srift kick <user-id> # host: kick participant
379
401
  srift chat send "Analysis complete." # send encrypted message
380
402
  srift chat history # view decrypted room history
@@ -424,11 +446,12 @@ Events emitted: `connection_state`, `join_request`, `participants`, `file_offer`
424
446
 
425
447
  ## 🔐 Architecture & Security
426
448
 
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.
428
- - **Adaptive Transport Stack**:
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.
449
+ - **Cryptography**: Session chat copies (`pk1`) and relayed file chunks (`pgcm1`) are sealed with **AES-256-GCM** under ECDH P-256 + HKDF-SHA256 keys generated on the devices (a fresh key pair per file transfer); the optional `--room-secret` is mixed into every key. Peers older than 4.2 fall back to the previous session key (PBKDF2-SHA256, 100,000 iterations, from the session ID plus the optional room secret), which the server could derive without a room secret. `--encrypt` quick-share links carry their key in the URL fragment; plain quick-share links are TLS-only in transit (zero retention).
450
+ - **No database**: the server keeps sessions in RAM only, and any number of instances behave as one; a crashed instance's sessions resume on a sibling's RAM copy within seconds.
451
+ - **Adaptive Transport Stack** (every rung works over outbound 443 when needed):
452
+ 1. **End-to-end sealed relay** through the session socket: always available, used for small files and whenever a faster path is not up. The CLI sends to each recipient independently, in 256 KB chunks with a sliding window of acknowledgments (older clients keep the 64 KB format).
453
+ 2. **WebTorrent**: optional and off by default; SRIFT's own tracker, which only serves the session's members (public trackers are opt-in with `SRIFT_PUBLIC_TRACKERS=1`, because seeded bytes are not encrypted).
454
+ 3. Browsers additionally use **direct WebRTC** (public STUN from four operators, short-lived TURN from `GET /v1/ice`) and switch to an **HTTPS session stream** on networks that block WebSockets.
432
455
  - **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.
433
456
 
434
457
  ---
@@ -445,7 +468,7 @@ Set custom configuration options via environment variables or `~/.srift/config.j
445
468
  | `SRIFT_LINK_PASSWORD` | — | Password for `quick-share --encrypt` / `get` without putting it in shell history |
446
469
  | `SRIFT_NO_HISTORY` | `0` | Set to `1` to stop recording created links in `~/.srift/history.jsonl` |
447
470
  | `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 |
471
+ | `HTTPS_PROXY` / `NO_PROXY` | — | Proxy (`http://`, `https://`, `socks5://`), honored everywhere |
449
472
  | `NODE_EXTRA_CA_CERTS` | — | Trust a TLS-inspecting proxy's root CA |
450
473
  | `SRIFT_AN_HOME` | `~/.srift/agentnet` | AgentNet identity and data directory |
451
474
  | `SRIFT_AN_RELAY` | `https://srift.app` | AgentNet relay(s), comma-separated |