Added a settings modal to the dashboard (index.html) to allow configuration of hashtag, namespace, and relays via URL query parameters and localStorage. This enables the dashboard to be hosted as a static site and used by any project. Also added `docs/architecture/distribution-plan.md` outlining the strategy for NPM, Binary, and Hosted Dashboard distribution. Co-authored-by: PR0M3TH3AN <[email protected]>
2.5 KiB
TORCH Distribution Strategy: Hybrid "Drop-in"
Goal
To make TORCH the universal "operating system for AI agents" across all languages and environments, we must remove the dependency on Node.js/NPM for end users while maintaining a robust development experience for contributors.
The Problem
Currently, TORCH is distributed as a tarball that requires npm install. This assumes:
- The user has Node.js installed.
- The user is comfortable with
package.jsonandnode_modules. - The project is a JavaScript/TypeScript project.
For Python, Go, or Rust developers, this is friction. A "drop-in" tool should work without language-specific prerequisites.
The Solution: Hybrid Distribution
We will support three primary distribution methods to cover all use cases:
1. The Official NPM Package (Current)
Target Audience: Node.js / TypeScript developers.
Experience: npm install torch-lock (or similar).
Pros: seamless integration with existing JS toolchains, easy updates via dependabot/renovate.
2. Standalone Binary CLI (New)
Target Audience: Python, Rust, Go, and non-Node developers.
Experience: Download a single binary (torch) from GitHub Releases and add it to $PATH.
Implementation:
- Use Node.js Single Executable Applications (SEA) or
pkgto compile the JS source into binaries for Linux, macOS, and Windows. - Zero Dependencies: No
npm, nonode_modules. - Fast: Instant startup, no install process.
3. Hosted Dashboard (New)
Target Audience: All users (especially those using the binary).
Experience: A static web app hosted at a public URL (e.g., dashboard.torch.sh or GitHub Pages).
Workflow:
- User runs
torch lock ...locally. - CLI prints:
View active locks: https://dashboard.torch.sh/?hashtag=my-project-hash - User clicks the link to see the dashboard. Features:
- Stateless: The dashboard is a static HTML/JS file.
- Client-side Logic: It connects directly to Nostr relays from the browser.
- URL Configuration: Configuration (hashtag, namespace, relays) is passed via URL query parameters, making links shareable.
- Local Persistence: Settings are saved to
localStoragefor returning visitors.
Benefits
- Universal Access: Removes the Node.js barrier to entry.
- True "Drop-in": The binary + hosted dashboard requires zero local setup beyond downloading one file.
- Maintainability: The core logic remains in JavaScript/Node.js, shared across all three distribution methods.