mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 23:47:12 +02:00
60bf3ead827de6660625100acf9192170fa768ae
Implements smart relay selection strategy for publishing thread replies that ensures maximum visibility: **New Relay Selection Logic:** 1. Author's write/outbox relays (so followers see the reply) 2. Participants' read/inbox relays (so they see mentions/replies) 3. Relays where root event was seen (where thread is active) 4. Deduplication, health filtering, and configurable limits **New Function: `selectRelaysForThreadReply`** - Located in src/services/relay-selection.ts - Intelligently combines relay hints from multiple sources - Prioritizes author's outbox relays when limiting - Limits participant processing to avoid excessive connections - Filters unhealthy/dead relays using liveness service - Configurable maxRelays (default 8) and maxParticipantRelays (default 5) **ThreadComposer Integration:** - Replaces empty relay array with smart selection - Passes active user pubkey, thread participants, and root event - Ensures replies reach both author's followers and thread participants **Comprehensive Test Coverage:** - 7 new tests covering all relay selection scenarios - Tests for author outbox, participant inbox, seen-at relays - Tests for limits, prioritization, and edge cases - All 936 tests passing This ensures thread replies are published to the right relays for maximum discoverability while respecting the NIP-65 outbox/inbox model.
Grimoire
A Nostr protocol explorer and developer tool with a tiling window manager interface.
Features
- Tiling Windows - Each window is a Nostr "app" (profile viewer, event feed, NIP docs, etc.)
- Command Palette - Unix-style commands via
Cmd+Kto open apps and navigate - Multi-workspace - Virtual desktops with independent layouts
- Real-time - Reactive event subscriptions with automatic updates
Stack
React 19, TypeScript, Vite, TailwindCSS, Jotai, Dexie, Applesauce
Getting Started
npm install
npm run dev
Scripts
| Command | Description |
|---|---|
npm run dev |
Start dev server |
npm run build |
Build for production |
npm test |
Run tests in watch mode |
npm run lint |
Lint code |
npm run format |
Format code |
License
MIT
Languages
TypeScript
98.9%
CSS
0.8%
JavaScript
0.3%