Add JavaScript SDK (client + bindings + tests)#136
Merged
HarshaNalluru merged 2 commits intomainfrom Apr 8, 2026
Merged
Conversation
r4ghu
approved these changes
Apr 8, 2026
Atulsingh1155
pushed a commit
to Atulsingh1155/moss
that referenced
this pull request
Apr 30, 2026
This pull request introduces the initial structure and implementation for the Moss JavaScript SDK's native Rust bindings via N-API, enabling Node.js applications to use the Moss core engine. It adds project metadata, build configuration, documentation, and the main Rust and JavaScript binding code, supporting cross-platform prebuilt binaries and a full async API for index management and querying. Key changes are grouped below: **Project Initialization & Documentation** * Added `README.md`, `CONTRIBUTING.md`, and `CHANGELOG.md` files to document usage, contribution guidelines, and changelog for the Moss JavaScript SDK and its Rust bindings. * Created `.gitignore` and `.cargo/config.toml` for proper environment and build setup. **Rust Native Binding Implementation** * Added `Cargo.toml` for the Rust crate, specifying dependencies, build options, and metadata for the N-API binding. * Implemented the main Rust library in `src/lib.rs`, exposing constants and registering modules for N-API. * Developed the `JsIndexManager` in `src/indexmanager.rs`, providing async methods for loading, querying, and managing indexes from Node.js. * Added a simple `build.rs` script for N-API build setup. **Node.js Integration & Packaging** * Added `package.json` with build scripts, metadata, and configuration for cross-platform prebuilt binaries. * Implemented `index.js` to load the appropriate native binding per platform/architecture, with error handling and version checks. These changes establish the foundation for the Moss JavaScript SDK's native core, enabling efficient semantic search and index management in Node.js applications. <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/usemoss/moss/pull/136" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces the initial structure and implementation for the Moss JavaScript SDK's native Rust bindings via N-API, enabling Node.js applications to use the Moss core engine. It adds project metadata, build configuration, documentation, and the main Rust and JavaScript binding code, supporting cross-platform prebuilt binaries and a full async API for index management and querying.
Key changes are grouped below:
Project Initialization & Documentation
README.md,CONTRIBUTING.md, andCHANGELOG.mdfiles to document usage, contribution guidelines, and changelog for the Moss JavaScript SDK and its Rust bindings..gitignoreand.cargo/config.tomlfor proper environment and build setup.Rust Native Binding Implementation
Cargo.tomlfor the Rust crate, specifying dependencies, build options, and metadata for the N-API binding.src/lib.rs, exposing constants and registering modules for N-API.JsIndexManagerinsrc/indexmanager.rs, providing async methods for loading, querying, and managing indexes from Node.js.build.rsscript for N-API build setup.Node.js Integration & Packaging
package.jsonwith build scripts, metadata, and configuration for cross-platform prebuilt binaries.index.jsto load the appropriate native binding per platform/architecture, with error handling and version checks.These changes establish the foundation for the Moss JavaScript SDK's native core, enabling efficient semantic search and index management in Node.js applications.