Files
buzz/crates
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger 3c6cd9c3f0 feat(desktop): add persona event kind with client publish/read/retain
Implements the foundation for personas-as-events architecture:

- Define KIND_PERSONA (30175) as NIP-33 parameterized replaceable,
  keyed by (pubkey, kind, d_tag) where d_tag is the plaintext persona
  slug. Relay allowlists the kind under UsersWrite scope and marks it
  global-only (never channel-scoped).

- Client-side serialization: PersonaRecord ↔ kind:30175 event with
  JSON content body. Publish and fetch functions via relay HTTP API.

- SQLite retention store: local durable storage for persona events
  enabling offline boot. INSERT OR REPLACE on (kind, pubkey, d_tag)
  for NIP-33 latest-wins semantics. Pending-sync queue for deferred
  relay publish.

- Migration: on first launch after upgrade, non-builtin personas from
  personas.json are serialized as events and written to the retention
  store with pending_sync=1. Idempotent via sentinel file. Runs after
  the packs→teams migration.

The existing load_personas path is unchanged — retention-based loading
is wired up as a helper for PR 2 (instantiation flow) to activate.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-10 00:17:51 -04:00
..