Skip to content

xftp: add npm library#1712

Closed
shumvgolove wants to merge 19 commits intoep/xftp-webfrom
sh/xftp-npm
Closed

xftp: add npm library#1712
shumvgolove wants to merge 19 commits intoep/xftp-webfrom
sh/xftp-npm

Conversation

@shumvgolove
Copy link
Collaborator

@shumvgolove shumvgolove commented Feb 18, 2026

npm publishing & API improvements for xftp-web

Public API

  • sendFile — streaming encrypt→upload pipeline in constant memory (64KB + 1 chunk), supports Uint8Array and AsyncIterable<Uint8Array> sources
  • receiveFile — convenience function: URI string → download + decrypt
  • deleteFile — delete uploaded file using sender description
  • XFTPAgent class replacing newXFTPAgent/closeXFTPAgent free functions
  • XFTPAgent.closeServer — per-server disconnect
  • Clean up dead exports from public API surface

Protocol

  • Multi-server parallel uploads with chunk distribution
  • Multi-recipient support with FADD batching
  • FACK protocol command — acknowledge chunks on download
  • BLOCKED error parsing into structured BlockingInfo
  • Auth passthrough for auth-required servers

Internals

  • uploadSingleChunk extraction deduplicating upload logic across 3 call sites
  • prepareEncryption helper for worker-based encryption flows
  • Async non-blocking encryptFileForUpload with onSlice streaming callback

Packaging

  • Prepare for npm publishing (package.json, tsconfig, index.ts exports)
  • README with usage examples, streaming uploads, error handling

Tests

  • Crypto equivalence tests (async, sync, streaming)

- upload chunks in parallel across server groups (matching Haskell)
- send FACK after each chunk download
- support numRecipients option for multi-recipient uploads
- pass auth option through to createXFTPChunk
- remove dead concurrency option from DownloadRawOptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments