From 4133153f328997215cff5104d9e39562c06f8c50 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Wed, 21 Oct 2026 12:32:59 +0300 Subject: [PATCH] hermes: three-form handle parser, hermes: scheme display, save-forever signin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Panel + standalone window now accept all three handle forms as synonyms, and the UI defaults to the hermes:alice scheme form. Signin is persistent across restarts via safeStorage-sealed identity; the ⋯ menu adds Sign out. - lib/hermes.js: parseHandle(input) → {kind, value} canonicalises any of hermes:alice, alice.erm, alice.bch, alice@parent.tld, npub1…, or raw hex. renderHandle(name, mode) formats a .erm name as hermes:alice (default), alice.erm (dotted), or alice@hermes.tel (email). Non-.erm names always render dotted so a .bch handle can't masquerade as a sub-identity. - main.js: hermesResolveTo() unifies contacts-add + send + their panel-API twins behind one path. Sub-identity (alice@parent.tld) resolution returns a crisp "not available yet" until the mainnet mint of the parent name's signed-records manifest lands — the parser accepts the form today so UI copy and placeholders can show it. - main.js: safeStorage-sealed identity at /hermes-identity/, auto-restored on app ready. New _hermesAPI.signOut wipes it. init() takes { remember: false } for a one-shot session (default: persist). A hermes-restored event fires on auto-restore so the panel skips the signin screen. - panel.html: renderHandle() mirror client-side; ⋯ menu with "Signed in as hermes:alice" header + Sign out; placeholders show all three forms; the signin hint tells users they stay signed in. On-chain `.erm` and `hermes.tel` mints are deliberately deferred to mainnet per user direction — the parser and display paths are tld-agnostic, so a mainnet switch is one constant change in lib/hermes.js (HERMES_TLD / HERMES_EMAIL_PARENT) plus the panel's mirror of them. --- bundled-addons/hermes/index.js | 2 +- bundled-addons/hermes/panel.html | 83 +++++++++-- lib/hermes.js | 86 +++++++++++ main.js | 240 +++++++++++++++++++++++-------- 4 files changed, 340 insertions(+), 71 deletions(-) diff --git a/bundled-addons/hermes/index.js b/bundled-addons/hermes/index.js index 16b736ed..c8c1629e 100644 --- a/bundled-addons/hermes/index.js +++ b/bundled-addons/hermes/index.js @@ -18,7 +18,7 @@ const { ipcMain } = require("electron"); const PANEL_METHODS = [ - "status", "canUseVault", "close", "init", "inbox", "send", + "status", "canUseVault", "close", "init", "signOut", "inbox", "send", "markThreadRead", "contactsList", "contactsAdd", "contactsUpdate", "contactsRemove", ]; diff --git a/bundled-addons/hermes/panel.html b/bundled-addons/hermes/panel.html index 30dd0e4d..f931a86b 100644 --- a/bundled-addons/hermes/panel.html +++ b/bundled-addons/hermes/panel.html @@ -174,9 +174,17 @@
Hermes
—
+ + + +
+
You'll stay signed in. Sign out from the ⋯ menu.
@@ -209,7 +218,7 @@
- +
@@ -236,7 +245,7 @@