From e883309791c54bbcc0538cc16a339df973f6d1dd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 26 Apr 2026 23:21:54 -0500 Subject: [PATCH] Remove direct messaging feature and skill Deletes the DM implementation (DMProvider, DMContext, useDMContext, useConversationMessages, DMChatArea, DMConversationList, DMMessagingInterface, DMStatusInfo, dmMessageStore, dmUtils, dmConstants, the orphaned pages/Messages.tsx, and the nostr-direct-messages skill) and removes the corresponding wrapper from the provider tree in App.tsx. The feature was already disabled (dmConfig.enabled = false), so this removes no user-visible functionality -- only ~1,600 lines in DMProvider and the associated UI/context/hooks. The nip44/nip04 signer paths used by drafts, letters, mute lists, and encrypted settings are unrelated and remain. Kind 1222 voice messages are a public-feed feature and stay. Documentation cleanup: strip the three DM mentions from AGENTS.md (Project Structure, App.tsx provider list, Specialized Workflows skill pointer) and the Private Messaging bullet from README.md's feature list. Historical CHANGELOG entries are preserved. --- .agents/skills/nostr-direct-messages/SKILL.md | 478 ----- AGENTS.md | 7 +- README.md | 1 - src/App.tsx | 11 +- src/components/DMProvider.tsx | 1580 ----------------- src/components/dm/DMChatArea.tsx | 495 ------ src/components/dm/DMConversationList.tsx | 268 --- src/components/dm/DMMessagingInterface.tsx | 84 - src/components/dm/DMStatusInfo.tsx | 214 --- src/contexts/DMContext.ts | 138 -- src/hooks/useConversationMessages.ts | 87 - src/hooks/useDMContext.ts | 45 - src/lib/dmConstants.ts | 86 - src/lib/dmMessageStore.ts | 94 - src/lib/dmUtils.ts | 98 - src/pages/Messages.tsx | 27 - 16 files changed, 4 insertions(+), 3709 deletions(-) delete mode 100644 .agents/skills/nostr-direct-messages/SKILL.md delete mode 100644 src/components/DMProvider.tsx delete mode 100644 src/components/dm/DMChatArea.tsx delete mode 100644 src/components/dm/DMConversationList.tsx delete mode 100644 src/components/dm/DMMessagingInterface.tsx delete mode 100644 src/components/dm/DMStatusInfo.tsx delete mode 100644 src/contexts/DMContext.ts delete mode 100644 src/hooks/useConversationMessages.ts delete mode 100644 src/hooks/useDMContext.ts delete mode 100644 src/lib/dmConstants.ts delete mode 100644 src/lib/dmMessageStore.ts delete mode 100644 src/lib/dmUtils.ts delete mode 100644 src/pages/Messages.tsx diff --git a/.agents/skills/nostr-direct-messages/SKILL.md b/.agents/skills/nostr-direct-messages/SKILL.md deleted file mode 100644 index 26f3ef56..00000000 --- a/.agents/skills/nostr-direct-messages/SKILL.md +++ /dev/null @@ -1,478 +0,0 @@ ---- -name: nostr-direct-messages -description: Implement Nostr direct messaging features, build chat interfaces, or work with encrypted peer-to-peer communication (NIP-04 and NIP-17). ---- - -# Direct Messaging on Nostr - -This project includes a complete direct messaging system supporting both NIP-04 (legacy) and NIP-17 (modern, more private) encrypted messages with real-time subscriptions, optimistic updates, and a persistent cache-first local storage. - -**The DM system is not enabled by default** - follow the setup instructions below to add messaging functionality to your application. - -## Setup Instructions - -### 1. Add DMProvider to Your App - -First, add the `DMProvider` to your app's provider tree in `src/App.tsx`: - -```tsx -// Add these imports at the top of src/App.tsx -import { DMProvider, type DMConfig } from '@/components/DMProvider'; -import { PROTOCOL_MODE } from '@/lib/dmConstants'; - -// Add this configuration before your App component -const dmConfig: DMConfig = { - // Enable or disable DMs entirely - enabled: true, // Set to true to enable messaging functionality - - // Choose one protocol mode: - // PROTOCOL_MODE.NIP04_ONLY - Force NIP-04 (legacy) only - // PROTOCOL_MODE.NIP17_ONLY - Force NIP-17 (private) only - // PROTOCOL_MODE.NIP04_OR_NIP17 - Allow users to choose between NIP-04 and NIP-17 (defaults to NIP-17) - protocolMode: PROTOCOL_MODE.NIP17_ONLY, // Recommended for new apps -}; - -// Then wrap your app components with DMProvider: -export function App() { - return ( - - - - - - - - - - - - - - - - - - - - ); -} -``` - -### 2. Configure DM Settings - -The `DMConfig` object supports the following options: - -- `enabled` (boolean, default: `false`) - Enable/disable entire DM system. When false, no messages are loaded, stored, or processed. -- `protocolMode` (ProtocolMode, default: `PROTOCOL_MODE.NIP17_ONLY`) - Which protocols to support: - - `PROTOCOL_MODE.NIP04_ONLY` - Legacy encryption only - - `PROTOCOL_MODE.NIP17_ONLY` - Modern private messages (recommended) - - `PROTOCOL_MODE.NIP04_OR_NIP17` - Support both protocols (for backwards compatibility) - -**Note**: The DM system uses domain-based IndexedDB naming (`nostr-dm-store-${hostname}`) to prevent conflicts between multiple apps on the same domain. - -## Quick Start - -### 1. Send Messages - -```tsx -import { useDMContext } from '@/hooks/useDMContext'; -import { MESSAGE_PROTOCOL } from '@/lib/dmConstants'; - -function ComposeMessage({ recipientPubkey }: { recipientPubkey: string }) { - const { sendMessage } = useDMContext(); - const [content, setContent] = useState(''); - - const handleSend = async () => { - await sendMessage({ - recipientPubkey, - content, - protocol: MESSAGE_PROTOCOL.NIP17, // Uses NIP-44 encryption + gift wrapping - }); - setContent(''); - }; - - return ( -
{ e.preventDefault(); handleSend(); }}> -