{"_id":"@apilium/mayros-nostr","name":"@apilium/mayros-nostr","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@apilium/mayros-nostr","version":"0.1.1","description":"Mayros Nostr channel plugin for NIP-04 encrypted DMs","license":"MIT","type":"module","publishConfig":{"access":"public"},"dependencies":{"nostr-tools":"^2.23.1","zod":"^4.3.6"},"peerDependencies":{"@apilium/mayros":">=0.1.0"},"mayros":{"extensions":["./index.ts"],"channel":{"id":"nostr","label":"Nostr","selectionLabel":"Nostr (NIP-04 DMs)","docsPath":"/channels/nostr","docsLabel":"nostr","blurb":"Decentralized protocol; encrypted DMs via NIP-04.","order":55,"quickstartAllowFrom":true},"install":{"npmSpec":"@apilium/mayros-nostr","localPath":"extensions/nostr","defaultChoice":"npm"}},"_id":"@apilium/mayros-nostr@0.1.1","_integrity":"sha512-teSDLcZAlUVzGVB1x2pJsCFCf42igOQkEYmp9CMZSDrF1ykRQbWPU+qnxp8Ta2lnMk8pENE6RnXoPcpqBwIoMA==","_resolved":"/private/var/folders/_y/k11qcrj94k32_yl6486p9bsc0000gn/T/554737071de9b297cc93807881835487/apilium-mayros-nostr-0.1.1.tgz","_from":"file:apilium-mayros-nostr-0.1.1.tgz","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-teSDLcZAlUVzGVB1x2pJsCFCf42igOQkEYmp9CMZSDrF1ykRQbWPU+qnxp8Ta2lnMk8pENE6RnXoPcpqBwIoMA==","shasum":"26ab8e81d874314549b9a9dfcd0f425d9918ac51","tarball":"https://registry.npmjs.org/@apilium/mayros-nostr/-/mayros-nostr-0.1.1.tgz","fileCount":28,"unpackedSize":202931,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHUUvwkA/nG/Cgl2K9IPX91MuY7030VjYDCeuWE5OusNAiBgN72jk7mph+rvVENRLnJDNl3FjiGhmNfc8vLCkGMPRg=="}]},"_npmUser":{"name":"apilium-ai","email":"it@apilium.com"},"directories":{},"maintainers":[{"name":"apilium-ai","email":"it@apilium.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mayros-nostr_0.1.1_1772217453742_0.903265732131046"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-27T18:37:33.667Z","0.1.1":"2026-02-27T18:37:33.870Z","modified":"2026-02-27T18:37:34.069Z"},"maintainers":[{"name":"apilium-ai","email":"it@apilium.com"}],"description":"Mayros Nostr channel plugin for NIP-04 encrypted DMs","license":"MIT","readme":"# @apilium/mayros-nostr\n\nNostr DM channel plugin for Mayros using NIP-04 encrypted direct messages.\n\n## Overview\n\nThis extension adds Nostr as a messaging channel to Mayros. It enables your bot to:\n\n- Receive encrypted DMs from Nostr users\n- Send encrypted responses back\n- Work with any NIP-04 compatible Nostr client (Damus, Amethyst, etc.)\n\n## Installation\n\n```bash\nmayros plugins install @apilium/mayros-nostr\n```\n\n## Quick Setup\n\n1. Generate a Nostr keypair (if you don't have one):\n\n   ```bash\n   # Using nak CLI\n   nak key generate\n\n   # Or use any Nostr key generator\n   ```\n\n2. Add to your config:\n\n   ```json\n   {\n     \"channels\": {\n       \"nostr\": {\n         \"privateKey\": \"${NOSTR_PRIVATE_KEY}\",\n         \"relays\": [\"wss://relay.damus.io\", \"wss://nos.lol\"]\n       }\n     }\n   }\n   ```\n\n3. Set the environment variable:\n\n   ```bash\n   export NOSTR_PRIVATE_KEY=\"nsec1...\"  # or hex format\n   ```\n\n4. Restart the gateway\n\n## Configuration\n\n| Key          | Type     | Default                                     | Description                                                |\n| ------------ | -------- | ------------------------------------------- | ---------------------------------------------------------- |\n| `privateKey` | string   | required                                    | Bot's private key (nsec or hex format)                     |\n| `relays`     | string[] | `[\"wss://relay.damus.io\", \"wss://nos.lol\"]` | WebSocket relay URLs                                       |\n| `dmPolicy`   | string   | `\"pairing\"`                                 | Access control: `pairing`, `allowlist`, `open`, `disabled` |\n| `allowFrom`  | string[] | `[]`                                        | Allowed sender pubkeys (npub or hex)                       |\n| `enabled`    | boolean  | `true`                                      | Enable/disable the channel                                 |\n| `name`       | string   | -                                           | Display name for the account                               |\n\n## Access Control\n\n### DM Policies\n\n- **pairing** (default): Unknown senders receive a pairing code to request access\n- **allowlist**: Only pubkeys in `allowFrom` can message the bot\n- **open**: Anyone can message the bot (use with caution)\n- **disabled**: DMs are disabled\n\n### Example: Allowlist Mode\n\n```json\n{\n  \"channels\": {\n    \"nostr\": {\n      \"privateKey\": \"${NOSTR_PRIVATE_KEY}\",\n      \"dmPolicy\": \"allowlist\",\n      \"allowFrom\": [\"npub1abc...\", \"0123456789abcdef...\"]\n    }\n  }\n}\n```\n\n## Testing\n\n### Local Relay (Recommended)\n\n```bash\n# Using strfry\ndocker run -p 7777:7777 ghcr.io/hoytech/strfry\n\n# Configure mayros to use local relay\n\"relays\": [\"ws://localhost:7777\"]\n```\n\n### Manual Test\n\n1. Start the gateway with Nostr configured\n2. Open Damus, Amethyst, or another Nostr client\n3. Send a DM to your bot's npub\n4. Verify the bot responds\n\n## Protocol Support\n\n| NIP    | Status    | Notes                  |\n| ------ | --------- | ---------------------- |\n| NIP-01 | Supported | Basic event structure  |\n| NIP-04 | Supported | Encrypted DMs (kind:4) |\n| NIP-17 | Planned   | Gift-wrapped DMs (v2)  |\n\n## Security Notes\n\n- Private keys are never logged\n- Event signatures are verified before processing\n- Use environment variables for keys, never commit to config files\n- Consider using `allowlist` mode in production\n\n## Troubleshooting\n\n### Bot not receiving messages\n\n1. Verify private key is correctly configured\n2. Check relay connectivity\n3. Ensure `enabled` is not set to `false`\n4. Check the bot's public key matches what you're sending to\n\n### Messages not being delivered\n\n1. Check relay URLs are correct (must use `wss://`)\n2. Verify relays are online and accepting connections\n3. Check for rate limiting (reduce message frequency)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-10c84c92116749b561eb097619cc6004"}