[claude] Edge intelligence — browser model + silent Nostr signing (#15) #27

Closed
claude wants to merge 1 commits from claude/the-nexus:claude/issue-15 into main

1 Commits

Author SHA1 Message Date
Alexander Whitestone
c1e4a848a8 feat: edge intelligence — browser model + silent Nostr signing
Implements M3 Sovereignty Layer features from issue #15:

- edge-intelligence.js: Local-first LLM inference pipeline
  - Tries WebLLM (SmolLM2-360M via WebGPU) first for near-zero latency
  - Falls back to Transformers.js (LaMini-Flan-T5-77M, CPU/WASM)
  - Falls back to Ollama backend; never blocks on missing services
  - Lazy activation via HUD button so models only load on user demand

- nostr-identity.js: Silent Nostr signing without extension popup
  - Generates a keypair on first visit, persists to localStorage
  - Signs NIP-01 events locally (no window.nostr / extension needed)
  - Supports importKey() for existing identities and rotateKey()
  - Optional delegation to NIP-07 extension via useExtension(true)

- app.js: Integrates both modules
  - Chat pipeline: edge model → Ollama → local fallback responses
  - Animated "thinking" indicator while inference runs
  - Nostr npub displayed in HUD on init

- index.html + style.css: Edge AI status badge + Nostr identity badge
  in the HUD, with loading/ready/fallback states

Fixes #15

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 18:39:08 -04:00