zz_

55e9576b ยท zzmq.dev@gmail.com/zz

Commit

55e9576bf594b86a1335d610f9c23c5437ca3302

--as mints a fresh token on start and revokes it on exit -- no saved registry needed Per direct follow-up: even the local ~/.zz/agents.json registry from the previous pass was unnecessary bureaucracy -- "couldn't you just create a token on the fly for that session, use that, and then revoke the token as soon as the process ends? I just do that every time." Yes. Replaces the registry entirely. lib/identity.ts's --as path now: mints a fresh token right now via your own `zz login` session's existing mint authority (requireTokenMintAuthority on the server -- you, or an agent you created), uses it for the whole session, and the caller revokes it on every exit path. Nothing long-lived ever touches disk for this case. ZZ_ID/ZZ_ID_FILE/no-flag paths are untouched (those are real standing credentials someone else manages; releaseIdentity is a no-op for all three, since ResolvedIdentity.ephemeral is only true for a --as mint). New server endpoint, POST /api/me/revoke (webApp.ts): revokes whichever token authenticated the request -- no token id needed client-side, which is the actual point: a session that minted a token for itself can clean up using nothing but the token already in hand. Authority is implicit (the bearer token IS the identity being revoked), unlike the existing id-based revoke form which needs an owner-or-creator check. Wiring the revoke into every real exit path took two different mechanisms, not one: - `zz review` and `zz repo submit`: plain process.on("SIGINT"/ "SIGTERM") handlers work fine -- neither uses ink raw-mode, so a real SIGINT reaches them on Ctrl+C. - `zz work`'s TUI (not --stdio): ink's raw mode intercepts Ctrl+C as a keypress, never delivering an OS-level SIGINT at all -- a process-level handler would just never fire. TabView.tsx gained an optional `onExit` prop, awaited before its own q/Ctrl+C handler calls process.exit(), threaded through WorkApp. zz top's own use of TabView is unaffected (prop omitted, no-op). - zz work --stdio has no TUI, so its own process.on("SIGINT",...) (registered unconditionally, so it's also a backup for an external `kill -INT` sent to the TUI mode's process, which --- unlike a keypress --- isn't swallowed by raw mode) covers it. - All three also wrap their main logic in try/finally, so a thrown error cleans up too, not just an explicit interrupt. agent.ts simplified back down to just mint-and-print (dropped the registry-saving behavior from the previous pass entirely) -- `zz agent create`/`zz agent token` remain useful standalone for the one case --as doesn't cover: a real standing credential for somewhere that isn't your own logged-in session (ZZ_ID, a separate machine). Updated the web app's token-reveal page copy to match (no more "saved locally" claim, since nothing saves locally now).

Troy Howard <thoward37@gmail.com> -- 2026-10-12T14:07:39.000Z

Tree at this commit