nostr-bray 1.29.4 → 1.30.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/context.js +9 -15
  2. package/package.json +1 -1
package/dist/context.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { fromNsec, fromMnemonic, derive, zeroise } from 'nsec-tree';
2
- import { derivePersona } from 'nsec-tree/persona';
3
2
  import { createBlindProof, createFullProof } from 'nsec-tree/proof';
4
3
  import { finalizeEvent, getPublicKey } from 'nostr-tools/pure';
5
4
  import { decode, npubEncode, nsecEncode } from 'nostr-tools/nip19';
@@ -88,21 +87,17 @@ export class IdentityContext {
88
87
  return { npub, purpose: entry.purpose, index: entry.index, personaName: name };
89
88
  }
90
89
  }
91
- const persona = derivePersona(this.root, name, index);
90
+ const purpose = `persona/${name}`;
91
+ const identity = derive(this.root, purpose, index);
92
92
  const entry = {
93
- identity: persona.identity,
94
- purpose: persona.identity.purpose,
95
- index: persona.index,
93
+ identity,
94
+ purpose,
95
+ index,
96
96
  personaName: name,
97
97
  lastUsed: Date.now(),
98
98
  };
99
- this.putCache(persona.identity.npub, entry);
100
- return {
101
- npub: persona.identity.npub,
102
- purpose: persona.identity.purpose,
103
- index: persona.index,
104
- personaName: name,
105
- };
99
+ this.putCache(identity.npub, entry);
100
+ return { npub: identity.npub, purpose, index, personaName: name };
106
101
  }
107
102
  /** Switch active identity by purpose+index, persona name, or "master" */
108
103
  async switch(purposeOrName, index) {
@@ -128,9 +123,8 @@ export class IdentityContext {
128
123
  let purpose;
129
124
  let personaName;
130
125
  if (isPersonaName) {
131
- const persona = derivePersona(this.root, purposeOrName, index ?? 0);
132
- identity = persona.identity;
133
- purpose = persona.identity.purpose;
126
+ purpose = `persona/${purposeOrName}`;
127
+ identity = derive(this.root, purpose, index ?? 0);
134
128
  personaName = purposeOrName;
135
129
  }
136
130
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nostr-bray",
3
- "version": "1.29.4",
3
+ "version": "1.30.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",