feat(tui): M0A.5b TUI 登录#84
Draft
wangjk9527 wants to merge 2 commits into
Draft
Conversation
实现 password 模式会话/CSRF/注册策略,并修复 HITL 事件桥、cookie Path 与缺失注册策略静默 open 等确定性缺陷。
wangjk9527
force-pushed
the
feat/m0a5b-tui-login
branch
from
July 23, 2026 16:49
0636a15 to
114eba5
Compare
Collaborator
Author
静态审查逐条结论(已落地)
验证
Commit相对 5a( |
- 接入 password 登录、本地 Session 恢复与账号切换 - AuthenticatedTransport 统一 REST/AG-UI/preflight,401 粘性通知 onAuthRequired - API 不可达时支持重试 / 使用其他地址 / 退出 - 删除 offline demo,补充认证接线与恢复路径测试
wangjk9527
force-pushed
the
feat/m0a5b-tui-login
branch
from
July 23, 2026 16:58
114eba5 to
04a9a1c
Compare
Collaborator
Author
复审结论(对照 tip
|
| # | 条目 | 判定 | 现状(04a9a1c) |
|---|---|---|---|
| 1 | --no-auto-login 不注销旧 Session |
成立 → 已修 | 仍读缓存为 previousSession(不恢复 cookies / 不调 /me);新登录成功后 best-effort logout 旧 Session |
| 2 | 真实终端密码可能回显 | 成立 → 已修 | createSecurePrompt 同一时间只挂一个 readline;密码走 muted stdout |
| 3 | Session 失效不回登录界面 | 成立 → 已修 | onAuthRequired + Ink unmount;runTui 以 auth-required 重进登录;CSRF refresh 失败同路径 |
| 4 | browser opener 命令不存在可崩溃 | 成立 → 已修 | spawn 后挂 error listener;调用方始终打印可复制 URL |
| 5 | API 不可达缺恢复入口 | 成立 → 已修 | [r]etry / [o]ther address / [q]uit;runtimeUrl/configBaseUrl 可在循环内更新 |
第二轮(2 项)
| # | 条目 | 判定 | 现状(04a9a1c) |
|---|---|---|---|
| R1 | preflight 401 后 onAuthRequired 事件永久丢失 |
成立 → 已修 | 粘性 sessionInvalidNotified;订阅时若已失效立即 replay;有「先 401、后订阅」单测 |
| R2 | 恢复菜单缺「使用其他地址」 | 成立 → 已修 | 见上第 5 项;有 switches runtime URL from recovery menu 测试 |
验证
apps/tui:npm test→ 71 passnpm run test:auth-foundation→ 跑通
Commit
相对 5a(0989386)仍为单实现 commit:04a9a1c(无 docs/superpowers)。此前评论中的 114eba5 /「仅 retry-quit」已过时。
本轮无新增代码改动(tip 已覆盖上述条目)。
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.
Summary
/logoutrun-defaults)共用AuthenticatedTransport;身份探测走GET /api/v1/meDepends on
Depends on #83(
feat/m0a5a-formal-auth-foundation)。本分支从 5a stacked 叠出;upstream 无 5a 分支作 base,故暂以main开 Draft。请先合并 #83,再审/合本 PR(或改 base 到已合入的 main)。Test plan
npm --workspace @datafoundry/tui test(62 passed)npm run typechecknpm run test:auth-foundationnpm run smoke:authnpm run smoke:tui-auth-sharing