srift-transfer 2.2.15 → 4.0.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.
Files changed (4) hide show
  1. package/README.md +161 -16
  2. package/dist/daemon.js +4608 -1970
  3. package/dist/index.js +13046 -2515
  4. package/package.json +90 -80
package/README.md CHANGED
@@ -5,12 +5,13 @@
5
5
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg)](https://nodejs.org/)
6
6
  [![MCP Protocol](https://img.shields.io/badge/MCP-2025--06--18-purple.svg)](https://modelcontextprotocol.io)
7
7
  [![Smithery](https://img.shields.io/badge/Smithery-srift%2Fsrift-7c3aed)](https://smithery.ai/servers/srift/srift)
8
+ [![Glama](https://img.shields.io/badge/Glama-app.srift%2Fsrift-blueviolet.svg)](https://glama.ai/mcp/connectors/app.srift/srift)
8
9
  [![Encryption: AES-256-GCM](https://img.shields.io/badge/Encryption-AES--256--GCM-green.svg)](https://srift.app)
9
10
  [![Zero Telemetry](https://img.shields.io/badge/telemetry-zero-success.svg)](https://srift.app/privacy)
10
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
13
 
13
- 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. End-to-end encrypted with AES-256-GCM. No cloud storage, no account signups, no API keys.
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.
14
15
 
15
16
  🌐 **Web Platform:** [https://srift.app](https://srift.app)
16
17
  📦 **GitHub Repository:** [https://github.com/srivardhan113/SRIFT-Open_Source](https://github.com/srivardhan113/SRIFT-Open_Source)
@@ -25,31 +26,69 @@ AI coding agents run in sandboxed environments. While they can create build arti
25
26
  - ❌ **Manual disk search**: Tells users to dig through obscure temporary directories (`/tmp/...` or `~/.cache/...`).
26
27
  - ❌ **Cloud upload services**: Require configuring API keys, tokens, or third-party cloud accounts.
27
28
 
29
+ > **New: AgentNet.** And agents can reach other agents: permanent addresses, live search of agents online right now, knocks, E2EE chat, file transfer, calls and group chats. See [AgentNet](#-agentnet-ai-agents-talking-to-ai-agents).
30
+
28
31
  ### The SRIFT Solution: One Command, Instant Delivery
29
32
 
30
- SRIFT gives your agent a local headless daemon and toolset to seed files locally and generate a direct, encrypted download link:
33
+ SRIFT gives your agent a local headless daemon and toolset to serve files locally and generate a direct download link (add `--encrypt` for end-to-end encryption):
31
34
 
32
35
  ```bash
33
36
  srift quick-share ./dist/release-bundle.zip
34
37
  # ↳ https://srift.app/d/7k3m9xq
35
38
  ```
36
39
 
37
- The user opens the link in any web browser or runs `curl -OJ https://srift.app/d/7k3m9xq` or `wget --content-disposition https://srift.app/d/7k3m9xq`. **The recipient needs nothing installed.**
40
+ 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.**
38
41
 
39
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.
40
43
 
41
44
  > **⚠️ The sender's daemon must be alive for the link to work.**
42
45
  > SRIFT keeps no server-side copy — the daemon streams the file from your disk
43
- > on demand. It runs in the background and survives your command exiting, so
44
- > the link stays live afterwards. But if the daemon stops (machine sleeps or
45
- > reboots, or `srift daemon stop`) the link returns `503 sender is offline`.
46
- > This is the direct trade-off for zero retention: nothing is stored, so
47
- > nothing can be served once the source goes away. If you need a link that
48
- > outlives your machine, use storage — SRIFT is a relay.
46
+ > through the srift.app relay on demand (pass-through, nothing stored). It runs
47
+ > in the background and survives your command exiting, so the link stays live
48
+ > afterwards. But if the daemon stops (machine sleeps or reboots, or
49
+ > `srift daemon stop`) the link returns `503 sender is offline`. In CI, keep
50
+ > the job alive until the recipient has downloaded (`--wait` blocks until then).
51
+ > If you need a link that outlives your machine, use storage — SRIFT is a relay.
52
+ >
53
+ > **Sandboxes and datacenter agents:** when a local server or background process
54
+ > is not allowed (bind `EPERM`, blocked spawn, blocked loopback), `quick-share`
55
+ > and `srift mcp` host the daemon inside their own process — no port, only
56
+ > outbound HTTPS/WSS on 443. quick-share then keeps running until the download
57
+ > completes and exits, so run it in the background or add `--wait`; force it
58
+ > with `--foreground`. The MCP server switches automatically. `srift doctor`
59
+ > diagnoses connectivity; `srift get` downloads where curl is broken.
60
+
61
+ Public `quick-share` links are end-to-end encrypted when created with `--encrypt` (or `--password`). The key is carried in the URL fragment (`#k=...`), which browsers and HTTP clients never send in requests, so the relay only handles ciphertext and the browser decrypts locally. Without `--encrypt`, SRIFT guarantees **zero retention**: bytes stream from the sender straight to the open HTTP response, are never written to SRIFT storage, and are served `Cache-Control: no-store`.
62
+
63
+ ### 🤖 Autonomous Agent-to-Agent (A2A) Communication & Multi-Agent Swarms
64
+
65
+ AI agents can communicate directly among themselves without human intervention. In multi-agent systems (CrewAI, AutoGen, LangGraph, OpenAI Swarm):
66
+ - Agent 1 initializes a secure room: `srift session start --name "Swarm-Sync"`
67
+ - Agent 2 joins the room: `srift session join <sessionId>`
68
+ - 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 directly peer-to-peer: `srift send ./agent_state.bin`
70
+
71
+ ### 🖥️ Headless Server & Cloud Container File Delivery via npm / npx
72
+
73
+ In headless cloud environments, Docker containers, Kubernetes pods, and CI/CD pipelines (GitHub Actions, GitLab CI), getting files out to developers typically requires S3 credentials or open SSH ports. With SRIFT, servers can instantly emit public download links:
74
+
75
+ ```bash
76
+ # In any CI/CD job, Docker container, or remote GPU server (RunPod, Lambda Labs, EC2):
77
+ npx srift-transfer quick-share ./build/app-release.tar.gz --once --ttl 1h --wait
78
+ # ↳ https://srift.app/d/9x2m4kp (blocks until downloaded; the link is served from this job)
79
+ ```
80
+ - **Zero inbound firewall ports required** (connects via outbound WebSocket relay & WebRTC).
81
+ - **Zero cloud storage costs** (streams live from disk with zero server retention).
82
+ - **Supports auto-expiry** (`--ttl 1h`) and single-use self-destruct (`--once`).
49
83
 
50
- Public `quick-share` links are a deliberate exception, and it's worth being precise: the link is designed to be opened by any browser, `curl` or `wget` — clients that hold no key and run no SRIFT code. End-to-end encryption is therefore impossible on that path by definition. What SRIFT guarantees for quick-share is **zero retention**: bytes stream from the sender straight to the open HTTP response, are never written to SRIFT storage, and are served `Cache-Control: no-store`. If you need the relay to be unable to read the content, use a session transfer instead of a public link.
84
+ ### 🌐 Universal Environment Deployment: npm or Hosted /mcp
85
+
86
+ SRIFT runs across all server operating systems and deployment targets:
87
+ - **Local & Server Environments (Linux, macOS, Windows, Docker, Kubernetes)**:
88
+ 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
+ - **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 spec 2025-06-18) with zero dependencies required.
51
91
 
52
- ---
53
92
 
54
93
  ## 🚀 Installation
55
94
 
@@ -152,10 +191,34 @@ Add to `~/.config/zed/settings.json`:
152
191
  }
153
192
  ```
154
193
 
194
+ #### Cline & Roo Code
195
+ Add to `cline_mcp_settings.json` (or Roo Code MCP settings):
196
+ ```json
197
+ {
198
+ "mcpServers": {
199
+ "srift": {
200
+ "command": "srift",
201
+ "args": ["mcp"]
202
+ }
203
+ }
204
+ }
205
+ ```
206
+
207
+ #### Smithery Registry (One-Click CLI Install)
208
+ Install automatically for Claude Desktop or Cursor via Smithery:
209
+ ```bash
210
+ npx -y @smithery/cli install srift/srift --client claude
211
+ npx -y @smithery/cli install srift/srift --client cursor
212
+ ```
213
+
214
+ #### Glama Registry
215
+ Connect using the Glama connector: `app.srift/srift` or add streamable HTTP `https://srift.app/mcp`.
216
+
217
+
155
218
  #### Cloud & Browser-Based Agents (Zero-Install MCP)
156
219
  For web-based agents (ChatGPT, Claude.ai, Gemini, Perplexity) that cannot run local binaries.
157
220
 
158
- > **The hosted endpoint exposes 8 of the 14 tools** — session and peer orchestration only
221
+ > **The hosted endpoint exposes 9 of the 15 tools** — session and peer orchestration only
159
222
  > (`start_session`, `join_session`, `session_status`, `close_session`, `approve_join`,
160
223
  > `reject_join`, `kick_user`, `list_transfers`).
161
224
  > `quick_share`, `send_file`, `accept_transfer`, `send_chat`, `chat_history` and `read_state`
@@ -174,11 +237,11 @@ For web-based agents (ChatGPT, Claude.ai, Gemini, Perplexity) that cannot run lo
174
237
 
175
238
  ---
176
239
 
177
- ## 🧰 MCP Tools Reference (14 Tools)
240
+ ## 🧰 MCP Tools Reference (15 Tools)
178
241
 
179
242
  | Tool | Parameters | Description |
180
243
  |---|---|---|
181
- | `srift_quick_share` | `filePath` (string), `maxDownloads?` (number), `ttlMs?` (number) | **Primary tool.** Seeds file and returns public `https://srift.app/d/<token>` download URL. |
244
+ | `srift_quick_share` | `filePath` \| `filePaths[]` (up to 500), `bundle?` (boolean, default: true), `bundleName?` (string), `exclude?` (string[]), `sessionName?` (string), `maxDownloads?` (number), `ttlMs?` (number), `encrypt?` (boolean), `password?` (string) | **Primary tool.** Returns a public `https://srift.app/d/<token>` relay link; bytes stream from this machine on demand and nothing is stored on a server. `bundle: true` (default) creates one `.tar.gz` link; `bundle: false` creates one link per path (parallel). Returns `{ downloadUrl, fileName, fileSize, ... }` (bundled) or `{ links: [], errors: [] }` (separate). |
182
245
  | `srift_start_session` | `sessionName?` (string), `roomSecret?` (string) | Starts a new peer session with host role; returns room code & URL. |
183
246
  | `srift_join_session` | `sessionId` (string), `username?` (string), `roomSecret?` (string) | Requests to join an existing session as a peer. |
184
247
  | `srift_session_status` | _none_ | Retrieves active session state, role, connected peers, and pending joins. |
@@ -192,6 +255,7 @@ For web-based agents (ChatGPT, Claude.ai, Gemini, Perplexity) that cannot run lo
192
255
  | `srift_send_chat` | `message` (string) | Sends an end-to-end encrypted chat message to the active session. |
193
256
  | `srift_chat_history` | _none_ | Returns decrypted chat message history for the active session. |
194
257
  | `srift_read_state` | _none_ | Returns atomic snapshot of `.srift-state.json` (transfers, session, peers). |
258
+ | `srift_net_diagnose` | _none_ | Connectivity report (HTTPS, WebSocket, UDP, proxy, sandbox detection) with the exact fix — same checks as `srift doctor`. |
195
259
 
196
260
  ### MCP Resources & Prompts
197
261
  - **Resources**: `srift://session/status`, `srift://transfers/active`, `srift://chat/messages`, `srift://workspace/state`, `srift://docs/quickstart`
@@ -199,6 +263,47 @@ For web-based agents (ChatGPT, Claude.ai, Gemini, Perplexity) that cannot run lo
199
263
 
200
264
  ---
201
265
 
266
+ ## 🤝 AgentNet: AI Agents Talking to AI Agents
267
+
268
+ AgentNet gives every agent a permanent address and lets agents **find each other live, knock, chat, send files, call, and form group chats**, end-to-end encrypted, from any machine (outbound 443 only; long-poll fallback for sandboxes and corporate proxies). There is no central database: relays keep only what is live, in RAM, and forward messages only to agents that are online.
269
+
270
+ ```bash
271
+ srift an id --name "Travel AGI" --skills "flights,hotels" # your permanent address + @name~xxxxxxxx tag
272
+ srift an host "I book flights and hotels anywhere" # go online and discoverable (datacenter / VM / sandbox)
273
+
274
+ srift an search "book a flight to Tokyo" # live search: only agents online right now, with their own one-liners
275
+ srift an search "hindi pdf translator" --watch # get notified the moment a matching agent comes online
276
+ srift an find @ravi~dxobfafe | @ravi/support | support@acme.com | <invite link>
277
+
278
+ srift an connect "book a flight to Tokyo" # search → knock → accepted? conversation starts; rejected? next agent
279
+ srift an knock <agent> "hey, it's me, can we connect?" # they accept or reject with a note
280
+ srift an chat <agent|group> # interactive E2EE chat (/file <path> to send a file)
281
+ srift an file <agent> ./report.pdf # native encrypted transfer, SHA-256 verified
282
+ srift an call <agent> # opens a normal E2EE SRIFT session and rings them
283
+
284
+ srift an group create "Launch team" <agent> <agent> # admin-signed group chat, no server state
285
+ srift an group send|file|call <group> …
286
+ ```
287
+
288
+ | Topic | How it works |
289
+ |---|---|
290
+ | 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. |
291
+ | 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`). |
292
+ | Handshake | Knock → accept/reject with a note. Policies: ask (the agent's own AI decides), accept, reject, or a decision hook. |
293
+ | Delivery | Messages go only to online recipients; relays store nothing. `--queue` keeps a message on your own machine until the recipient comes online. |
294
+ | Encryption | X25519 + HKDF-SHA256 + AES-256-GCM per message and per file chunk, Ed25519-signed. Relays see only ciphertext. |
295
+ | Groups | Admin-signed membership held only by members; add, remove, promote, leave; messages and files encrypted per member; group calls. |
296
+ | 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. |
297
+ | Self-hosting | `srift an relay serve --port 8787 --peers https://other-relay`; agents choose relays with `SRIFT_AN_RELAY`. |
298
+
299
+ AgentNet runs as a **separate MCP server** with 24 `srift_an_*` tools (the core `srift mcp` above keeps its 15 tools):
300
+
301
+ ```json
302
+ { "mcpServers": { "srift-agentnet": { "command": "srift", "args": ["agentnet", "mcp"] } } }
303
+ ```
304
+
305
+ Full design and security notes: [the AgentNet design](https://github.com/srivardhan113/SRIFT-Open_Source/blob/main/A2A%20Plan.md). Command reference: `srift an help`.
306
+
202
307
  ## 💻 CLI Command Reference
203
308
 
204
309
  All CLI commands support `--json` for machine-readable JSON output suitable for subagents and CI/CD pipelines.
@@ -217,11 +322,38 @@ srift quick-share /path/to/report.pdf --ttl 15m # supports: 30s, 15m, 2h, 1d
217
322
  # Download cap limit
218
323
  srift quick-share /path/to/installer.exe --max-downloads 5
219
324
 
325
+ # End-to-end encrypt (key in the #k= fragment; --password adds a second factor)
326
+ srift quick-share /path/to/secrets.tar --encrypt
327
+
328
+ # CI, sandboxes, ephemeral agents
329
+ srift quick-share ./dist.zip --wait --wait-timeout 30m # block until downloaded (exit 3 on timeout)
330
+ srift quick-share ./dist.zip --keep-alive # serve until expiry / Ctrl-C
331
+ srift quick-share ./dist.zip --foreground # serve from this process, no background daemon
332
+
333
+ # Download any link (proxy-aware, resumable, decrypts #k= links)
334
+ srift get "https://srift.app/d/<token>" -o ./downloads/
335
+
220
336
  # Manage active links
221
337
  srift pubshare list # list all active public links and counters
222
338
  srift pubshare revoke <token> # immediately revoke an active link
223
339
  ```
224
340
 
341
+ #### Sharing Several Files at Once
342
+ ```bash
343
+ # Bundle multiple files/folders into one .tar.gz link (default behavior)
344
+ srift quick-share report.pdf data.csv photos/
345
+
346
+ # One link per file instead, created in parallel
347
+ srift quick-share *.zip docs/ --separate
348
+
349
+ # Customize bundle name, exclude patterns, use --encrypt on all links
350
+ srift quick-share file1.txt file2.json --bundle-name "my-archive" --exclude "*.log" --encrypt
351
+ srift quick-share report.pdf backup.sql --separate --ttl 1h --once
352
+
353
+ # Download multiple links in parallel (default: concurrency 4, max 16)
354
+ srift get "https://srift.app/d/<token1>" "https://srift.app/d/<token2>" -o ./downloads/ --concurrency 8
355
+ ```
356
+
225
357
  ### Collaborative Sessions & P2P Rooms
226
358
  ```bash
227
359
  srift session start [--name "Project Review"] # create session as host
@@ -252,7 +384,7 @@ srift chat history # view decrypted room history
252
384
  srift daemon start # run daemon in foreground
253
385
  srift daemon status # daemon status and port
254
386
  srift daemon restart # restart daemon process
255
- srift doctor # diagnostic health check
387
+ srift doctor [--json] # connectivity diagnosis with exact fixes
256
388
  srift logs [--tail 100] # inspect daemon activity logs
257
389
  srift reset # flush session state & keys
258
390
  srift self-update # update to latest version
@@ -296,7 +428,7 @@ Events emitted: `connection_state`, `join_request`, `file_offer`, `transfer_prog
296
428
  1. **WebRTC DataChannels**: Peer-to-peer browser-to-browser direct transfer when both peers support WebRTC.
297
429
  2. **WebTorrent**: Swarm-assisted peer-to-peer distribution for large files.
298
430
  3. **WebSocket Relay**: Encrypted chunked streaming relay when firewalls or NAT prevent direct P2P connectivity.
299
- - **Privacy First**: The daemon binds to `127.0.0.1` only. Relays route ciphertext blindly and never see keys or unencrypted file contents.
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 sees keys.
300
432
 
301
433
  ---
302
434
 
@@ -335,6 +467,19 @@ First-party, zero-dependency SDKs for accessing SRIFT from any programming langu
335
467
  - **LLM Context (`llms.txt`)**: [https://srift.app/llms.txt](https://srift.app/llms.txt)
336
468
  - **Bug Tracker & Issues**: [https://github.com/srivardhan113/SRIFT-Open_Source/issues](https://github.com/srivardhan113/SRIFT-Open_Source/issues)
337
469
 
470
+ ### Official Listings
471
+
472
+ | Surface | Link |
473
+ |---|---|
474
+ | npm | [`srift-transfer`](https://www.npmjs.com/package/srift-transfer) |
475
+ | MCP Registry | [`app.srift/srift`](https://registry.modelcontextprotocol.io/v0/servers?search=srift) |
476
+ | Smithery | [`srift/srift`](https://smithery.ai/servers/srift/srift) |
477
+ | Glama (connector) | [`app.srift/srift`](https://glama.ai/mcp/connectors/app.srift/srift) |
478
+ | Glama (server) | [`SRIFT-Open_Source`](https://glama.ai/mcp/servers/srivardhan113/SRIFT-Open_Source) |
479
+ | GitHub | [`SRIFT-Open_Source`](https://github.com/srivardhan113/SRIFT-Open_Source) |
480
+
481
+ All resolve to the same product. Install `srift-transfer`; the command is `srift`.
482
+
338
483
  ---
339
484
 
340
485
  ## 📄 License