mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-15 09:57:23 +02:00
42694be80d663c98be6ab1cb4e8117f470fa1b85
Implements full NIP-28 public chat channel support alongside existing NIP-29 relay groups and NIP-53 live activity chat. ## Implementation **Adapter** (src/lib/chat/adapters/nip-28-adapter.ts): - Multi-relay channel coordination (no single authority) - Parses note1/nevent1 identifiers (kind 40 creation events) - Resolves channel metadata from kind 41 events - Loads kind 42 messages with NIP-10 threading - Supports reply threading via marked e-tags (root/reply) - Publishes messages with proper NIP-10 tag structure **Feed Renderers**: - Kind40Renderer (ChannelCreationRenderer) - Channel creation events with "Open Channel" button - Kind41Renderer (ChannelMetadataRenderer) - Channel metadata updates - Kind42Renderer (ChannelMessageRenderer) - Channel messages with threading and channel context **Detail Renderers**: - Kind40DetailRenderer (ChannelCreationDetailRenderer) - Full channel info with metadata, relays, and open button - Kind42DetailRenderer (ChannelMessageDetailRenderer) - Message with thread context and channel info **Integration**: - Updated renderer registry (src/components/nostr/kinds/index.tsx) - Enabled Nip28Adapter in chat-parser.ts (Phase 3 priority) - Added kind 42 to CHAT_KINDS constant - Updated chat command documentation with NIP-28 examples **Tests**: - Comprehensive unit tests for Nip28Adapter identifier parsing - Protocol and capability verification ## Usage ```bash chat note1xyz... # Open channel by event ID chat nevent1xyz... # Open channel with relay hints ``` ## Architecture Notes NIP-28 vs NIP-29: - NIP-28: Multi-relay, open participation, client-side moderation - NIP-29: Single relay authority, membership enforcement, server-side moderation - Both coexist - users choose based on censorship resistance vs moderation needs Threading: - Uses NIP-10 marked e-tags (root → kind 40, reply → parent message) - Different from NIP-29's simpler q-tag replies - Fully integrated with ChatViewer's reply preview system
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%