nostr-bray 1.40.0 → 1.41.0

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.
Files changed (2) hide show
  1. package/dist/config.js +12 -2
  2. package/package.json +1 -1
package/dist/config.js CHANGED
@@ -70,6 +70,15 @@ export async function loadConfig() {
70
70
  const keyFilePath = process.env.NOSTR_SECRET_KEY_FILE ?? file.secretKeyFile;
71
71
  const keyEnvVar = process.env.NOSTR_SECRET_KEY;
72
72
  let secretKey;
73
+ // A local key source is an explicit choice to sign locally. A bunker URI
74
+ // saved by `bunker connect` is only a fallback and must not override that
75
+ // choice in the CLI, MCP server or SDK, all of which prefer bunkerUri when
76
+ // it is present. Explicit bunker configuration still takes precedence.
77
+ const hasLocalKeySource = !!(keyFilePath
78
+ || keyEnvVar
79
+ || process.env.NOSTR_NCRYPTSEC_FILE
80
+ || process.env.NOSTR_NCRYPTSEC
81
+ || file.ncryptsecFile);
73
82
  let bunkerUri;
74
83
  if (process.env.BUNKER_URI_FILE) {
75
84
  bunkerUri = readSecretFile(process.env.BUNKER_URI_FILE);
@@ -80,8 +89,9 @@ export async function loadConfig() {
80
89
  else if (file.bunkerUriFile) {
81
90
  bunkerUri = readSecretFile(file.bunkerUriFile);
82
91
  }
83
- else {
84
- // Fall back to URI saved by `bunker connect`
92
+ else if (!hasLocalKeySource) {
93
+ // Fall back to the URI saved by `bunker connect` only when the caller has
94
+ // not selected local signing for this invocation.
85
95
  const { readStateFile } = await import('./state.js');
86
96
  const saved = readStateFile('bunker-uri');
87
97
  if (saved.uri)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nostr-bray",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "mcpName": "dev.forgesworn/bray",
5
5
  "description": "Trust-aware Nostr for AI and humans. Three dimensions of trust -- verification, proximity, and access -- woven into every interaction.",
6
6
  "type": "module",