{"_id":"@actagent/nostr","_rev":"4-5300d9c308d8cc662ab1a346d7027c9d","name":"@actagent/nostr","dist-tags":{"latest":"2026.6.5"},"versions":{"2026.6.2":{"name":"@actagent/nostr","version":"2026.6.2","_id":"@actagent/nostr@2026.6.2","maintainers":[{"name":"nidaye0525","email":"nidaye0525@gmail.com"}],"homepage":"https://github.com/actagent/actagent#readme","bugs":{"url":"https://github.com/actagent/actagent/issues"},"dist":{"shasum":"5e0a584fcf7a870f22d4db1c8f21754953ccdd99","tarball":"https://registry.npmjs.org/@actagent/nostr/-/nostr-2026.6.2.tgz","fileCount":53,"integrity":"sha512-vmwP2LTgHMSiTTqITm/Xw/BHisr301M5VhzUZdY2Z3zrShaC5XlAteDNE/K+S8Hxlm91Lva6hnydjla+WjCtbg==","signatures":[{"sig":"MEQCIHPx7xzrH9firxjwYicBMeIgo63GLS5MoC3YyoD8NGyCAiA7Jas+ILyirnxqMpUbK8QcrS4eG05sCXxMNPVU3fRlUA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296827},"type":"module","gitHead":"77bc85eae49cb350c8baa74e34ec3e5c3efeacb4","_npmUser":{"name":"nidaye0525","email":"nidaye0525@gmail.com"},"actagent":{"build":{"actagentVersion":"2026.6.2"},"compat":{"pluginApi":">=2026.6.2"},"channel":{"id":"nostr","blurb":"Decentralized protocol; encrypted DMs via NIP-04.","label":"Nostr","order":55,"docsPath":"/channels/nostr","docsLabel":"nostr","cliAddOptions":[{"flags":"--private-key <key>","description":"Nostr private key (nsec... or hex)"},{"flags":"--relay-urls <list>","description":"Nostr relay URLs (comma-separated)"}],"selectionLabel":"Nostr (NIP-04 DMs)","quickstartAllowFrom":true},"install":{"npmSpec":"@actagent/nostr","defaultChoice":"npm","minHostVersion":">=2026.4.10"},"release":{"publishToNpm":true,"publishToACTAgentHub":true},"extensions":["./index.ts"],"setupEntry":"./setup-entry.ts"},"repository":{"url":"git+https://github.com/actagent/actagent.git","type":"git"},"_npmVersion":"10.9.4","description":"ACTAgent Nostr channel plugin for NIP-04 encrypted direct messages.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"zod":"4.4.3","nostr-tools":"2.23.5"},"_hasShrinkwrap":true,"devDependencies":{"actagent":"workspace:*","@actagent/plugin-sdk":"workspace:*"},"peerDependencies":{"actagent":"workspace:*"},"peerDependenciesMeta":{"actagent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nostr_2026.6.2_1780815106062_0.7759520731132059","host":"s3://npm-registry-packages-npm-production"}},"2026.6.3":{"name":"@actagent/nostr","version":"2026.6.3","_id":"@actagent/nostr@2026.6.3","maintainers":[{"name":"nidaye0525","email":"nidaye0525@gmail.com"}],"homepage":"https://github.com/actagent/actagent#readme","bugs":{"url":"https://github.com/actagent/actagent/issues"},"dist":{"shasum":"0492c56d115edb6223510283f89790194db2661a","tarball":"https://registry.npmjs.org/@actagent/nostr/-/nostr-2026.6.3.tgz","fileCount":53,"integrity":"sha512-bB2zEu2yCJcGv3l3bFO0bLmeeHtzjsCw1wffW0p8g2BLgCPOJi66vyZCGhh8fQ89SYVCxYwoqksXfwgMyHKwCA==","signatures":[{"sig":"MEUCIQCakVJTiot/Di5hW+dGZTjO79k2SEiZZX/GnA9dp1Mu2QIgGjlj25sIYsPu7b2ZuEIJWvXqbcC3/EhH8REYAv7wdJ8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296827},"type":"module","gitHead":"fb880b12fab8027ca8617032ad806f913da48b9d","_npmUser":{"name":"nidaye0525","email":"nidaye0525@gmail.com"},"actagent":{"build":{"actagentVersion":"2026.6.2"},"compat":{"pluginApi":">=2026.6.2"},"channel":{"id":"nostr","blurb":"Decentralized protocol; encrypted DMs via NIP-04.","label":"Nostr","order":55,"docsPath":"/channels/nostr","docsLabel":"nostr","cliAddOptions":[{"flags":"--private-key <key>","description":"Nostr private key (nsec... or hex)"},{"flags":"--relay-urls <list>","description":"Nostr relay URLs (comma-separated)"}],"selectionLabel":"Nostr (NIP-04 DMs)","quickstartAllowFrom":true},"install":{"npmSpec":"@actagent/nostr","defaultChoice":"npm","minHostVersion":">=2026.4.10"},"release":{"publishToNpm":true,"publishToACTAgentHub":true},"extensions":["./index.ts"],"setupEntry":"./setup-entry.ts"},"repository":{"url":"git+https://github.com/actagent/actagent.git","type":"git"},"_npmVersion":"10.9.4","description":"ACTAgent Nostr channel plugin for NIP-04 encrypted direct messages.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"zod":"4.4.3","nostr-tools":"2.23.5"},"_hasShrinkwrap":true,"devDependencies":{"actagent":"workspace:*","@actagent/plugin-sdk":"workspace:*"},"peerDependencies":{"actagent":"workspace:*"},"peerDependenciesMeta":{"actagent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nostr_2026.6.3_1780855961068_0.5077264468692482","host":"s3://npm-registry-packages-npm-production"}},"2026.6.4":{"name":"@actagent/nostr","version":"2026.6.4","_id":"@actagent/nostr@2026.6.4","maintainers":[{"name":"nidaye0525","email":"nidaye0525@gmail.com"}],"homepage":"https://github.com/actagent/actagent#readme","bugs":{"url":"https://github.com/actagent/actagent/issues"},"dist":{"shasum":"af2e555a9b28ee991d123f14a1df8eb0b1d70ddf","tarball":"https://registry.npmjs.org/@actagent/nostr/-/nostr-2026.6.4.tgz","fileCount":53,"integrity":"sha512-lVCM8C6RxceIJeIOLRtHbcJwRb5n3nWJ7WnnFG/dbQ3gTrFNrZIAdnGniwoJ0JLQgLHumGrmfn/uj1ZYbSmJ6Q==","signatures":[{"sig":"MEUCIQCGeEVEFee1Sp8+EGT2tvTHtKDyWaSFVlOgbT1cPtO3uQIgWy+V2kjrdToF5v47S3cFUfXyWIUkUqzAcoNIxCO7XY4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296827},"type":"module","gitHead":"4ff5dd5cd323035f94eb4e3fb35483eb03da74ca","_npmUser":{"name":"nidaye0525","email":"nidaye0525@gmail.com"},"actagent":{"build":{"actagentVersion":"2026.6.2"},"compat":{"pluginApi":">=2026.6.2"},"channel":{"id":"nostr","blurb":"Decentralized protocol; encrypted DMs via NIP-04.","label":"Nostr","order":55,"docsPath":"/channels/nostr","docsLabel":"nostr","cliAddOptions":[{"flags":"--private-key <key>","description":"Nostr private key (nsec... or hex)"},{"flags":"--relay-urls <list>","description":"Nostr relay URLs (comma-separated)"}],"selectionLabel":"Nostr (NIP-04 DMs)","quickstartAllowFrom":true},"install":{"npmSpec":"@actagent/nostr","defaultChoice":"npm","minHostVersion":">=2026.4.10"},"release":{"publishToNpm":true,"publishToACTAgentHub":true},"extensions":["./index.ts"],"setupEntry":"./setup-entry.ts"},"repository":{"url":"git+https://github.com/actagent/actagent.git","type":"git"},"_npmVersion":"10.9.4","description":"ACTAgent Nostr channel plugin for NIP-04 encrypted direct messages.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"zod":"4.4.3","nostr-tools":"2.23.5"},"_hasShrinkwrap":true,"devDependencies":{"actagent":"workspace:*","@actagent/plugin-sdk":"workspace:*"},"peerDependencies":{"actagent":"workspace:*"},"peerDependenciesMeta":{"actagent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nostr_2026.6.4_1780860044479_0.5097397152239433","host":"s3://npm-registry-packages-npm-production"}},"2026.6.5":{"name":"@actagent/nostr","version":"2026.6.5","description":"ACTAgent Nostr channel plugin for NIP-04 encrypted direct messages.","repository":{"type":"git","url":"git+https://github.com/actagent/actagent.git"},"type":"module","dependencies":{"nostr-tools":"2.23.5","zod":"4.4.3"},"devDependencies":{"@actagent/plugin-sdk":"workspace:*","actagent":"workspace:*"},"peerDependencies":{"actagent":"workspace:*"},"peerDependenciesMeta":{"actagent":{"optional":true}},"actagent":{"extensions":["./index.ts"],"setupEntry":"./setup-entry.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,"cliAddOptions":[{"flags":"--private-key <key>","description":"Nostr private key (nsec... or hex)"},{"flags":"--relay-urls <list>","description":"Nostr relay URLs (comma-separated)"}]},"install":{"npmSpec":"@actagent/nostr","defaultChoice":"npm","minHostVersion":">=2026.4.10"},"compat":{"pluginApi":">=2026.6.2"},"build":{"actagentVersion":"2026.6.2"},"release":{"publishToACTAgentHub":true,"publishToNpm":true}},"_id":"@actagent/nostr@2026.6.5","gitHead":"ededc059e0bb8427ebbe8c766f3fbc49d190d1ac","bugs":{"url":"https://github.com/actagent/actagent/issues"},"homepage":"https://github.com/actagent/actagent#readme","_nodeVersion":"22.22.2","_npmVersion":"10.9.4","dist":{"integrity":"sha512-TudJBTYoPOjFFUwYlUShtUdHLzMZok0i8rTMShkUF+tNiCOthodvyVT8mr5lzZcw+9hdPygZhflSSCuZFp/h7Q==","shasum":"473e567d8a0a317f3ed7c1b63d95eb2b239be38a","tarball":"https://registry.npmjs.org/@actagent/nostr/-/nostr-2026.6.5.tgz","fileCount":53,"unpackedSize":296827,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD5BjGXQ1Zgfsl7z2xct1DJqN8H3xrwFi/UvXoDolUrNAIgQfmzuhUELjXfF4WwBBMyT2xEvYDr0lbTNqOy9Km7XVw="}]},"_npmUser":{"name":"nidaye0525","email":"nidaye0525@gmail.com"},"directories":{},"maintainers":[{"name":"nidaye0525","email":"nidaye0525@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nostr_2026.6.5_1780866284922_0.8586720581467044"},"_hasShrinkwrap":true}},"time":{"created":"2026-06-07T06:51:45.919Z","modified":"2026-06-07T21:04:45.204Z","2026.6.2":"2026-06-07T06:51:46.236Z","2026.6.3":"2026-06-07T18:12:41.205Z","2026.6.4":"2026-06-07T19:20:44.655Z","2026.6.5":"2026-06-07T21:04:45.075Z"},"bugs":{"url":"https://github.com/actagent/actagent/issues"},"homepage":"https://github.com/actagent/actagent#readme","repository":{"type":"git","url":"git+https://github.com/actagent/actagent.git"},"description":"ACTAgent Nostr channel plugin for NIP-04 encrypted direct messages.","maintainers":[{"name":"nidaye0525","email":"nidaye0525@gmail.com"}],"readme":"# @actagent/nostr\n\nNostr DM channel plugin for ACTAgent using NIP-04 encrypted direct messages.\n\n## Overview\n\nThis extension adds Nostr as a messaging channel to ACTAgent. 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\nactagent plugins install @actagent/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\nInbound event signatures are verified before policy enforcement and NIP-04 decryption.\nUnknown senders in `pairing` mode can receive a pairing reply, but their original DM body is not\nprocessed unless approved.\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 actagent 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- Sender policy is checked before expensive crypto work\n- Inbound DMs are rate-limited and oversized payloads are dropped before decrypt\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"}