nostr-bray 1.16.0 → 1.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -216,7 +216,15 @@ const pool = new RelayPool({
216
216
  defaultRelays: config.relays,
217
217
  });
218
218
  const nip65 = new Nip65Manager(pool, config.relays);
219
- const ctx = new IdentityContext(config.secretKey, config.secretFormat);
219
+ let ctx;
220
+ if (config.bunkerUri) {
221
+ const { BunkerContext } = await import('./bunker-context.js');
222
+ ctx = await BunkerContext.connect(config.bunkerUri);
223
+ console.error(`Connected to bunker — signing as ${ctx.activeNpub}`);
224
+ }
225
+ else {
226
+ ctx = new IdentityContext(config.secretKey, config.secretFormat);
227
+ }
220
228
  const nwcUri = config.nwcUri;
221
229
  config.secretKey = '';
222
230
  config.nwcUri = undefined;
package/dist/config.js CHANGED
@@ -36,9 +36,13 @@ export function loadConfig() {
36
36
  const keyFilePath = process.env.NOSTR_SECRET_KEY_FILE;
37
37
  const keyEnvVar = process.env.NOSTR_SECRET_KEY;
38
38
  let secretKey;
39
- const bunkerUri = process.env.BUNKER_URI ?? process.env.BUNKER_URI_FILE
40
- ? (process.env.BUNKER_URI_FILE ? readSecretFile(process.env.BUNKER_URI_FILE) : process.env.BUNKER_URI)
41
- : undefined;
39
+ let bunkerUri;
40
+ if (process.env.BUNKER_URI_FILE) {
41
+ bunkerUri = readSecretFile(process.env.BUNKER_URI_FILE);
42
+ }
43
+ else if (process.env.BUNKER_URI) {
44
+ bunkerUri = process.env.BUNKER_URI;
45
+ }
42
46
  if (keyFilePath) {
43
47
  secretKey = readSecretFile(keyFilePath);
44
48
  }
@@ -52,7 +56,7 @@ export function loadConfig() {
52
56
  else {
53
57
  throw new Error('No secret key provided: set NOSTR_SECRET_KEY, NOSTR_SECRET_KEY_FILE, or BUNKER_URI');
54
58
  }
55
- const secretFormat = detectKeyFormat(secretKey);
59
+ const secretFormat = secretKey ? detectKeyFormat(secretKey) : 'nsec';
56
60
  // --- NWC URI ---
57
61
  const nwcFilePath = process.env.NWC_URI_FILE;
58
62
  let nwcUri;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nostr-bray",
3
- "version": "1.16.0",
3
+ "version": "1.16.2",
4
4
  "description": "MCP server giving AI agents sovereign Nostr identities — key derivation, personas, attestations, duress detection, zaps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",