父页面经 postMessage 推 token 进入应用 + 401 重签(原 main 1147–1209 + 顶层 _embedInitialTaskHandled 一次性标志)→ embed.js(75 行)。 - 导出 embedInit(boot 调)+ embedPostToParent / embedShowWaiting (auth 的 logout 在 embed 下通知父页面/显示等待态)—— 后两个从 main 迁出后,auth.js 对它们的 import 从 ./main.js 改指 ./embed.js (auth 仍从 main import enterApp)。 - 反向 import main glue enterApp / loadTaskList / selectTask。 main↔embed、auth↔embed 均运行时调用环,安全。 main.js 删至 1154 行(2719 起,已搬出约 58%)。node 全检过、 import/export 一致性过、静态测试 2 过。剩 main 内:enterApp glue + tasks(列表/选择/渲染消息)+ stream(发送/SSE)+ boot + Esc 关栈。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| js | ||
| vendor | ||
| dev.html | ||