simplex-chat / simplexmq-js

🚧 SimpleXMQ - JavaScript SMP protocol client and agent 🏗
https://simplex.chat
GNU Affero General Public License v3.0
11 stars 3 forks source link

State of this repo? #5

Open wbobeirne opened 1 year ago

wbobeirne commented 1 year ago

Hey there, sorry for opening an issue for what's more of a discussion, but what is the current state of this repo vs the CLI-driven JS package at https://github.com/simplex-chat/simplex-chat/tree/stable/packages/simplex-chat-client/typescript?

As far as I can tell, that library is just a TypeScript wrapper around the CLI, and is meant to run in a server-side environment. But it looks like the goal of this library was to have a full JS client that could work in a client-side environment, e.g. a web-based chat application.

Is there any interest in continuing development on this client? Is it currently compatible and capable of everything that's going on in the native app clients? Is enabling the development of alternative SimpleX chat clients that aren't the main SimpleX app something that aligns with the long-term vision of the SimpleX team?

Thanks!

epoberezkin commented 1 year ago

No, there was never a goal to have a full client written in typescript - we will eventually compile Haskell code to JS or WASM for the purposes of running in the browser, but it's probably more like 2025-6 objective.

TypeScript SDK is for chatbots that use CLI as a local websocket service, not over the Internet, when CLI itself connects to the relays and does everything – similar to the approach in mobile apps..

wbobeirne commented 1 year ago

Got it, thanks for the clarifications. So what's the difference between the library in the simplex-chat repository, and the one in this repository?

epoberezkin commented 1 year ago

I mean we looked at some point in the past to create a full JavaScript client, but it never went further than low level SMP protocol implementation, that was done here (although not for the current protocol version). It's probably ~5% of implementing the full chat client.

wbobeirne commented 1 year ago

Honestly that's most of what I was looking for to get off the ground with a web client, it seems pretty straightforward to fill out the rest of the chat protocol with JSON messages. The part I was most concerned with getting my hands dirty with (and quite frankly, getting the implementation wrong) was the cryptography and byte-level protocol messaging. So with that in mind, a few questions:

  1. How different is the implementation here from the current protocol version? What would be the level of effort to bring it up to speed?
  2. Would the SimpleX team be interested in a full typescript client that attempts to maintain parity with the haskell implementation? Is that something y'all would want to be maintained from within your org, or would you prefer an external implementation that just uses this library under the hood?
  3. Would you be open to a more permissive license than AGPL 3 for the npm package only? I totally understand why the SimpleX app would be licensed that way, but copyleft may be too restrictive for something that's only meant to be a low level library.
wbobeirne commented 1 year ago

To provide more context, we're looking at privacy-focused chat protocols for use in https://www.fedi.xyz/. We currently use XMPP and have looked at Matrix, but the central home servers that these require aren't great for our goals of decentralization. The SMP / SimpleX chat protocol looks perfect, but we want to make sure y'all are open to and interested in other people using the protocol for their own applications.

Our app is a PWA as well as a React Native application, so we're interested in a JS client implementation of the SimpleX Chat API. We're happy to build and maintain a library for it. The SimpleX chat part looks simple, just defining a ton of interfaces, and implementing a bunch of methods that serialize and deserialize correctly. The hard part was going to be making sure the SMP protocol was implemented correctly, but it looks like y'all got a great start here.

The license concern was only because our application is not open source right now, but we'd absolutely want to make the client library open source (e.g. MIT license) for others who want to build on SimpleX for the JS ecosystem.

I'd love to chat more about this to get a better sense of if these goals align. We'd love to build on and contribute more to SimpleX. Feel free to hit me up on SimpleX (click for invite) if you want to discuss more and to avoid spamming the issue queue / simplex-devs channel.