Repository navigation
Add trusted-agent login recovery and direct conversation links - #5
Merged
Merged
Conversation
Forgotten owner tokens can no longer be read back, so add an explicit, default-off per-Agent delegation that lets one trusted Agent help the owner sign in with short-lived single-use links. Backend - migrations/0009: principals.can_help_owner_login (0/1, default 0) and owner_login_grants (hashed 256-bit code, issuer id + issuer access-key id, owner id, optional thread, expiry, redeem mark, session binding); tokens gain a nullable owner_login_grant_id. - POST /owner-login-links (Agent access key only, issuer-thread membership check, quota 10 unresolved, permission/key/quota rechecked inside the insert), GET for the issuer's own links (no codes), and public same-origin POST /owner-login/redeem: one atomic use under concurrency, 24h HttpOnly session, no access key, GET never signs in. - authenticate dynamically rechecks delegation, issuer liveness and the minting key for grant-bound sessions; withdrawing the permission, disabling the issuer or revoking the minting key deletes unresolved links and revokes their sessions in the same transaction — a re-grant never revives an old session. Ordinary owner keys/sessions are unaffected. Expired rows and their dead sessions are cleaned up on every write (FK-safe). CLI (web) - agentpeerchat web [THREAD_ID] prints a stable secret-free link; web --login [THREAD_ID] mints a one-use link from the validated private profile base (origin + subpath), with clear guidance to the Contact grant when permission is missing. No token on the command line or in output. Web app - Mobile Contact switch "Allow helping me sign in" with a high-privilege confirmation; withdrawal without ceremony. - #owner-login=…&thread=… deep links: fragment cleared before the same-origin POST, understandable expired/used errors, deliberate confirm when already signed in; #thread=… targets survive manual login and navigate on hash change. Honest forgotten-key help on the login page. All new strings bilingual. Docs/version - Skill 1.1.2, bilingual agent guides, protocol + OpenAPI (3 new operations), README/README.zh-CN, CHANGELOG, package 0.1.15, regenerated public artifacts and lockfile. Tests: 180 passing (Miniflare + real SQLite backends, including the new owner-login suite, frontend regressions, and CLI web HTTP tests). Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owners who forget their access key currently cannot ask a connected agent for a usable login path, and agents cannot provide direct links to a conversation. Add
agentpeerchat web [THREAD_ID]for stable chat links andweb --login [THREAD_ID]for one-use owner sign-in links, plus bilingual recovery help and agent instructions.The owner must explicitly enable the separate, default-off “Allow helping me sign in” Contact permission for a trusted agent. The UI explains that this grants owner-account access. Links expire after ten minutes, redeem atomically once via a same-origin POST, and create a browser session for at most 24 hours without exposing a persistent owner key. Withdrawal, issuer disablement, and issuer-key revocation invalidate links and their sessions; regranting cannot revive an old session. Migration 0009 is additive. Existing keys and ordinary sessions remain valid.
Validation: Node 24 full suite passes (130 tests plus 45 SQLite checks), typecheck and app build pass. Independent HTTP checks verified an eight-way redemption race and permanent revocation. Actual 390px browser acceptance verified a signed-out owner can open a CLI-generated link and reach the requested chat without entering a token, used-link rejection, manual-login target preservation, and language switching. Source and packaged CLI HTTP tests cover subdirectory deployments, private key handling, and invalid instance overrides.
CLI 0.1.15 and bundled skill 1.1.2; README, guides, OpenAPI and generated assets updated. Hosted Dots/Muse runtimes still need the updated CLI/skill and their own tool execution support.