@songsid/agend 2.3.5-alpha.10 → 2.3.5-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/dist/accounts-view.d.ts +17 -0
  2. package/dist/accounts-view.js +24 -8
  3. package/dist/accounts-view.js.map +1 -1
  4. package/dist/agent-cli-instructions.md +2 -2
  5. package/dist/auth-api.d.ts +48 -16
  6. package/dist/auth-api.js +83 -32
  7. package/dist/auth-api.js.map +1 -1
  8. package/dist/authority/settings-role.d.ts +56 -0
  9. package/dist/authority/settings-role.js +48 -0
  10. package/dist/authority/settings-role.js.map +1 -0
  11. package/dist/backend/claude-code.d.ts +2 -0
  12. package/dist/backend/claude-code.js +32 -6
  13. package/dist/backend/claude-code.js.map +1 -1
  14. package/dist/backend/cli-env-probe.js +6 -2
  15. package/dist/backend/cli-env-probe.js.map +1 -1
  16. package/dist/backend/codex.d.ts +5 -3
  17. package/dist/backend/codex.js +31 -13
  18. package/dist/backend/codex.js.map +1 -1
  19. package/dist/backend/credential-profile.d.ts +18 -0
  20. package/dist/backend/credential-profile.js +46 -0
  21. package/dist/backend/credential-profile.js.map +1 -1
  22. package/dist/backend/kiro.js +1 -1
  23. package/dist/backend/kiro.js.map +1 -1
  24. package/dist/backend/muse.d.ts +3 -1
  25. package/dist/backend/muse.js +31 -1
  26. package/dist/backend/muse.js.map +1 -1
  27. package/dist/backend/types.d.ts +17 -1
  28. package/dist/backend/types.js.map +1 -1
  29. package/dist/backend-availability.d.ts +15 -0
  30. package/dist/backend-availability.js +37 -1
  31. package/dist/backend-availability.js.map +1 -1
  32. package/dist/build-provenance.json +1 -1
  33. package/dist/bundled-tmux-guard.d.ts +4 -0
  34. package/dist/bundled-tmux-guard.js +7 -0
  35. package/dist/bundled-tmux-guard.js.map +1 -1
  36. package/dist/claude-auth-status.d.ts +20 -8
  37. package/dist/claude-auth-status.js +38 -22
  38. package/dist/claude-auth-status.js.map +1 -1
  39. package/dist/cli-audited.d.ts +60 -0
  40. package/dist/cli-audited.js +84 -0
  41. package/dist/cli-audited.js.map +1 -0
  42. package/dist/cli-capability.d.ts +36 -5
  43. package/dist/cli-capability.js +2 -2
  44. package/dist/cli-capability.js.map +1 -1
  45. package/dist/cli-caps-module.d.ts +5 -1
  46. package/dist/cli-caps-module.js +4 -2
  47. package/dist/cli-caps-module.js.map +1 -1
  48. package/dist/cli-registry-check.js +16 -2
  49. package/dist/cli-registry-check.js.map +1 -1
  50. package/dist/cli-registry.d.ts +56 -4
  51. package/dist/cli-registry.js +1 -1
  52. package/dist/cli-registry.js.map +1 -1
  53. package/dist/cli-spec-antigravity.d.ts +12 -1
  54. package/dist/cli-spec-antigravity.js +13 -1
  55. package/dist/cli-spec-antigravity.js.map +1 -1
  56. package/dist/cli-spec-claude-code.d.ts +9 -0
  57. package/dist/cli-spec-claude-code.js +4 -2
  58. package/dist/cli-spec-claude-code.js.map +1 -1
  59. package/dist/cli-spec-codex.d.ts +10 -1
  60. package/dist/cli-spec-codex.js +5 -3
  61. package/dist/cli-spec-codex.js.map +1 -1
  62. package/dist/cli-spec-grok.d.ts +5 -0
  63. package/dist/cli-spec-grok.js +6 -1
  64. package/dist/cli-spec-grok.js.map +1 -1
  65. package/dist/cli-spec-kiro-cli.d.ts +7 -1
  66. package/dist/cli-spec-kiro-cli.js +7 -3
  67. package/dist/cli-spec-kiro-cli.js.map +1 -1
  68. package/dist/cli-spec-muse.d.ts +2 -0
  69. package/dist/cli-spec-muse.js +3 -1
  70. package/dist/cli-spec-muse.js.map +1 -1
  71. package/dist/cli-spec-opencode.d.ts +11 -1
  72. package/dist/cli-spec-opencode.js +7 -2
  73. package/dist/cli-spec-opencode.js.map +1 -1
  74. package/dist/cli.js +28 -1
  75. package/dist/cli.js.map +1 -1
  76. package/dist/create-host-account.d.ts +17 -0
  77. package/dist/create-host-account.js +47 -0
  78. package/dist/create-host-account.js.map +1 -0
  79. package/dist/daemon.d.ts +26 -0
  80. package/dist/daemon.js +131 -10
  81. package/dist/daemon.js.map +1 -1
  82. package/dist/delivery-outbox.js +7 -0
  83. package/dist/delivery-outbox.js.map +1 -1
  84. package/dist/fleet-context.d.ts +5 -1
  85. package/dist/fleet-manager.d.ts +363 -71
  86. package/dist/fleet-manager.js +1374 -367
  87. package/dist/fleet-manager.js.map +1 -1
  88. package/dist/fleet-process-handlers.d.ts +1 -1
  89. package/dist/fleet-process-handlers.js +3 -2
  90. package/dist/fleet-process-handlers.js.map +1 -1
  91. package/dist/general-knowledge/skills/concepts/SKILL.md +21 -14
  92. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +9 -8
  93. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +9 -1
  94. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +1 -1
  95. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +27 -20
  96. package/dist/instance-lifecycle.js +33 -3
  97. package/dist/instance-lifecycle.js.map +1 -1
  98. package/dist/instructions.js +29 -6
  99. package/dist/instructions.js.map +1 -1
  100. package/dist/locale.js +125 -81
  101. package/dist/locale.js.map +1 -1
  102. package/dist/login-manager.d.ts +2 -2
  103. package/dist/login-manager.js +3 -2
  104. package/dist/login-manager.js.map +1 -1
  105. package/dist/native-model-catalog.d.ts +20 -0
  106. package/dist/native-model-catalog.js +107 -2
  107. package/dist/native-model-catalog.js.map +1 -1
  108. package/dist/public-web-gateway.js +1 -1
  109. package/dist/public-web-gateway.js.map +1 -1
  110. package/dist/public-web-link.d.ts +5 -0
  111. package/dist/public-web-link.js +8 -0
  112. package/dist/public-web-link.js.map +1 -1
  113. package/dist/runtime-api.d.ts +1 -1
  114. package/dist/runtime-api.js +104 -12
  115. package/dist/runtime-api.js.map +1 -1
  116. package/dist/runtime-autostart.d.ts +61 -0
  117. package/dist/runtime-autostart.js +161 -0
  118. package/dist/runtime-autostart.js.map +1 -0
  119. package/dist/runtime-background.d.ts +200 -0
  120. package/dist/runtime-background.js +480 -0
  121. package/dist/runtime-background.js.map +1 -0
  122. package/dist/runtime-build-info.js +5 -5
  123. package/dist/runtime-build-info.js.map +1 -1
  124. package/dist/runtime-cli-background.d.ts +92 -0
  125. package/dist/runtime-cli-background.js +336 -0
  126. package/dist/runtime-cli-background.js.map +1 -0
  127. package/dist/runtime-cli-install.d.ts +148 -8
  128. package/dist/runtime-cli-install.js +253 -59
  129. package/dist/runtime-cli-install.js.map +1 -1
  130. package/dist/runtime-cli.d.ts +8 -1
  131. package/dist/runtime-cli.js +206 -44
  132. package/dist/runtime-cli.js.map +1 -1
  133. package/dist/runtime-client-store.d.ts +11 -0
  134. package/dist/runtime-client-store.js +20 -5
  135. package/dist/runtime-client-store.js.map +1 -1
  136. package/dist/runtime-client.d.ts +23 -1
  137. package/dist/runtime-client.js +92 -6
  138. package/dist/runtime-client.js.map +1 -1
  139. package/dist/runtime-connection.d.ts +1 -1
  140. package/dist/runtime-connection.js +1 -1
  141. package/dist/runtime-connection.js.map +1 -1
  142. package/dist/runtime-coordinator.d.ts +95 -1
  143. package/dist/runtime-coordinator.js +344 -10
  144. package/dist/runtime-coordinator.js.map +1 -1
  145. package/dist/runtime-enroll-notice.d.ts +4 -0
  146. package/dist/runtime-enroll-notice.js +21 -0
  147. package/dist/runtime-enroll-notice.js.map +1 -0
  148. package/dist/runtime-enrollment.d.ts +21 -0
  149. package/dist/runtime-enrollment.js +52 -0
  150. package/dist/runtime-enrollment.js.map +1 -0
  151. package/dist/runtime-pane-native.js +4 -4
  152. package/dist/runtime-pane-native.js.map +1 -1
  153. package/dist/runtime-protocol.d.ts +78 -1
  154. package/dist/runtime-protocol.js +95 -5
  155. package/dist/runtime-protocol.js.map +1 -1
  156. package/dist/runtime-remote-accounts.d.ts +12 -0
  157. package/dist/runtime-remote-accounts.js +56 -5
  158. package/dist/runtime-remote-accounts.js.map +1 -1
  159. package/dist/runtime-remote-setup.d.ts +4 -1
  160. package/dist/runtime-remote-setup.js +4 -1
  161. package/dist/runtime-remote-setup.js.map +1 -1
  162. package/dist/runtime-update-controller.d.ts +11 -0
  163. package/dist/runtime-update-controller.js +56 -4
  164. package/dist/runtime-update-controller.js.map +1 -1
  165. package/dist/settings-api.d.ts +13 -1
  166. package/dist/settings-api.js +44 -20
  167. package/dist/settings-api.js.map +1 -1
  168. package/dist/settings-change.d.ts +5 -13
  169. package/dist/settings-change.js.map +1 -1
  170. package/dist/settings-confirmation.d.ts +11 -13
  171. package/dist/settings-confirmation.js +2 -6
  172. package/dist/settings-confirmation.js.map +1 -1
  173. package/dist/settings-effect.d.ts +5 -0
  174. package/dist/settings-effect.js +76 -10
  175. package/dist/settings-effect.js.map +1 -1
  176. package/dist/settings-http-confirmation.d.ts +8 -1
  177. package/dist/settings-http-confirmation.js +39 -13
  178. package/dist/settings-http-confirmation.js.map +1 -1
  179. package/dist/settings-request-capability.d.ts +7 -0
  180. package/dist/settings-request-capability.js +3 -1
  181. package/dist/settings-request-capability.js.map +1 -1
  182. package/dist/setup-i18n.js +4 -4
  183. package/dist/setup-i18n.js.map +1 -1
  184. package/dist/signin-keepalive.d.ts +25 -1
  185. package/dist/signin-keepalive.js +44 -1
  186. package/dist/signin-keepalive.js.map +1 -1
  187. package/dist/subagent-records.d.ts +45 -0
  188. package/dist/subagent-records.js +214 -0
  189. package/dist/subagent-records.js.map +1 -0
  190. package/dist/subagent-service.d.ts +27 -0
  191. package/dist/subagent-service.js +199 -0
  192. package/dist/subagent-service.js.map +1 -0
  193. package/dist/tmux-manager.d.ts +2 -2
  194. package/dist/tmux-manager.js +5 -3
  195. package/dist/tmux-manager.js.map +1 -1
  196. package/dist/ui/account-identity.js +7 -5
  197. package/dist/ui/accounts-keepalive.js +17 -17
  198. package/dist/ui/accounts-manage.js +34 -34
  199. package/dist/ui/accounts-view.js +68 -24
  200. package/dist/ui/agent-runtime-settings.js +1 -1
  201. package/dist/ui/backend-signin.js +67 -67
  202. package/dist/ui/chat-msg-actions.js +50 -4
  203. package/dist/ui/chat-quote.js +256 -0
  204. package/dist/ui/chat-store.js +9 -4
  205. package/dist/ui/cli-caps.js +7 -7
  206. package/dist/ui/credential-profile-select.js +4 -4
  207. package/dist/ui/general-location.js +1 -1
  208. package/dist/ui/host-install.js +290 -0
  209. package/dist/ui/hub-company-join-strings.js +3 -0
  210. package/dist/ui/hub-company-join.js +20 -2
  211. package/dist/ui/hub-owner-strings.js +5 -4
  212. package/dist/ui/hub-pairing-progress-strings.js +1 -1
  213. package/dist/ui/hub-quick-strings.js +4 -4
  214. package/dist/ui/hub-strings.js +6 -6
  215. package/dist/ui/machine-signin.js +4 -4
  216. package/dist/ui/model-picker.js +68 -0
  217. package/dist/ui/panel-chat.js +74 -13
  218. package/dist/ui/panel-fleet.js +8 -2
  219. package/dist/ui/panel-hub.js +8 -4
  220. package/dist/ui/panel-needs.js +2 -2
  221. package/dist/ui/panel-runtimes.js +232 -33
  222. package/dist/ui/panel-settings.js +7 -1
  223. package/dist/ui/panel-windows-cli.js +1 -1
  224. package/dist/ui/runtime-cli-install.js +99 -20
  225. package/dist/ui/runtime-commands.d.ts +2 -0
  226. package/dist/ui/runtime-commands.js +34 -1
  227. package/dist/ui/runtime-update-status.js +2 -2
  228. package/dist/ui/search-dialog.js +1 -0
  229. package/dist/ui/settings-access-overview.js +167 -0
  230. package/dist/ui/settings-access-strings.js +1 -1
  231. package/dist/ui/settings-catalog.js +19 -3
  232. package/dist/ui/settings-confirm.js +2 -2
  233. package/dist/ui/settings-devices.js +59 -25
  234. package/dist/ui/settings-dialogs.js +12 -13
  235. package/dist/ui/settings-guests.js +1 -1
  236. package/dist/ui/settings-hub-company-join.js +10 -7
  237. package/dist/ui/settings-hub-connection.js +121 -0
  238. package/dist/ui/settings-hub-membership.js +1 -1
  239. package/dist/ui/settings-hub-run.js +5 -6
  240. package/dist/ui/settings-hub-section.js +3 -6
  241. package/dist/ui/settings-hub.js +12 -7
  242. package/dist/ui/settings-layout.js +9 -7
  243. package/dist/ui/settings-outside.js +87 -19
  244. package/dist/ui/settings-registry.js +2 -1
  245. package/dist/ui/settings-revoke-strings.js +28 -0
  246. package/dist/ui/settings-strings.js +25 -25
  247. package/dist/ui/settings-web-authority.js +11 -4
  248. package/dist/ui/shared/accounts.css +11 -1
  249. package/dist/ui/shared/agend-auth.js +8 -1
  250. package/dist/ui/shared/app-i18n.js +10 -12
  251. package/dist/ui/shared/app-session.js +13 -16
  252. package/dist/ui/shared/app-shell.js +37 -37
  253. package/dist/ui/shared/app-store.js +2 -0
  254. package/dist/ui/shared/app.css +85 -14
  255. package/dist/ui/shared/chat-render.js +17 -5
  256. package/dist/ui/shared/chat-strings.js +4 -4
  257. package/dist/ui/shared/device-roles.js +27 -0
  258. package/dist/ui/shared/host-install.css +10 -0
  259. package/dist/ui/shared/hub-owner.css +6 -0
  260. package/dist/ui/shared/model-picker.css +21 -0
  261. package/dist/ui/shared/runtime-install.css +26 -1
  262. package/dist/ui/shared/setup-host-text.js +4 -4
  263. package/dist/ui/shared/signin.js +171 -64
  264. package/dist/ui/shared/subagent-row.css +15 -0
  265. package/dist/ui/shared/usage-dialog.js +28 -16
  266. package/dist/ui/shared/view-strings.js +7 -7
  267. package/dist/ui/shared/web-authorize.js +54 -4
  268. package/dist/ui/signin.html +19 -8
  269. package/dist/ui/structured-signin.js +30 -30
  270. package/dist/ui/subagent-row.js +72 -0
  271. package/dist/ui/web-terminal/terminal.js +9 -9
  272. package/dist/update-launch.js +4 -1
  273. package/dist/update-launch.js.map +1 -1
  274. package/dist/update-npm-env.d.ts +70 -0
  275. package/dist/update-npm-env.js +128 -0
  276. package/dist/update-npm-env.js.map +1 -0
  277. package/dist/usage/format-rich.js +1 -1
  278. package/dist/usage/format-rich.js.map +1 -1
  279. package/dist/usage/providers.js +2 -2
  280. package/dist/usage/providers.js.map +1 -1
  281. package/dist/usage/usage-api.d.ts +8 -2
  282. package/dist/usage/usage-api.js +12 -5
  283. package/dist/usage/usage-api.js.map +1 -1
  284. package/dist/web-api.d.ts +38 -4
  285. package/dist/web-api.js +370 -18
  286. package/dist/web-api.js.map +1 -1
  287. package/dist/web-auth.js +1 -1
  288. package/dist/web-auth.js.map +1 -1
  289. package/dist/web-backend-login.d.ts +2 -0
  290. package/dist/web-backend-login.js.map +1 -1
  291. package/dist/web-channel-echo.js +3 -1
  292. package/dist/web-channel-echo.js.map +1 -1
  293. package/dist/web-commands.d.ts +9 -1
  294. package/dist/web-commands.js +7 -1
  295. package/dist/web-commands.js.map +1 -1
  296. package/dist/web-host-install.d.ts +127 -0
  297. package/dist/web-host-install.js +165 -0
  298. package/dist/web-host-install.js.map +1 -0
  299. package/dist/web-remote-access.d.ts +194 -11
  300. package/dist/web-remote-access.js +458 -34
  301. package/dist/web-remote-access.js.map +1 -1
  302. package/dist/web-session.d.ts +11 -3
  303. package/dist/web-session.js.map +1 -1
  304. package/dist/web-signin-device.d.ts +16 -0
  305. package/dist/web-signin-device.js +81 -0
  306. package/dist/web-signin-device.js.map +1 -0
  307. package/dist/web-update.js +3 -1
  308. package/dist/web-update.js.map +1 -1
  309. package/dist/windows-cli-api.js +2 -1
  310. package/dist/windows-cli-api.js.map +1 -1
  311. package/dist/windows-cli-worker.d.ts +14 -0
  312. package/dist/windows-cli-worker.js +145 -1
  313. package/dist/windows-cli-worker.js.map +1 -1
  314. package/dist/windows-cli.d.ts +4 -0
  315. package/dist/windows-cli.js +9 -1
  316. package/dist/windows-cli.js.map +1 -1
  317. package/launcher/agend-install.cjs +16 -3
  318. package/package.json +1 -1
  319. package/templates/runtime-install/install.ps1 +219 -12
@@ -30,7 +30,7 @@ register("chat", {
30
30
  you: "You", sending: "Sending…", uploadingFile: "Uploading {0}", uploadWaiting: "waiting", uploadFailed: "failed",
31
31
  uploadNoConnection: "the upload was cut off — check the connection", sendNoConnection: "it did not reach AgEnD — check the connection", notSentBecause: "Not sent: {0}", deleteUnsent: "Delete",
32
32
  sendFailure_wake_capacity: "No slot is free to wake this instance. Retry when another instance is idle.",
33
- sendFailure_wake_credentials: "The instance could not sign in. Sign it in from Settings → Agents → AI sign-ins and API keys → Accounts, or send /login in chat, then retry.",
33
+ sendFailure_wake_credentials: "The instance could not sign in. Connect its AI account in Settings → Agents → AI accounts and API keys → Accounts, or send /login in chat, then retry.",
34
34
  sendFailure_wake_timeout: "The instance did not become ready in time. Retry, or check its status in Fleet.",
35
35
  sendFailure_instance_stopped: "This instance was stopped or removed. Start it from the agent's chat menu → Start instance, then retry.",
36
36
  sendFailure_delivery_unavailable: "The instance could not receive this message. Check its status in Fleet, then retry.",
@@ -46,7 +46,7 @@ register("chat", {
46
46
  compactTimeout: "No sign that compaction finished within {0} minutes — check the agent's own chat.",
47
47
  compactLost: "Can't follow this compaction: the command did not reach the agent, or the agent stopped or changed backend.",
48
48
  compactNotCompacted: "kiro did not compact the conversation: it was too short, or the compaction was stopped.",
49
- cmdChoose: "Choose", cmdCurrent: "current", cmdSignIn: "Sign in", cmdSignInTo: "Sign in to {0}", chipCompact: "Compact", chipClear: "Clear…", chipContext: "Context {0}% used",
49
+ cmdChoose: "Choose", cmdCurrent: "current", cmdSignIn: "Connect account", cmdSignInTo: "Connect your {0} account", chipCompact: "Compact", chipClear: "Clear…", chipContext: "Context {0}% used",
50
50
  chipModel: "Model: {0} — choose another", chipEffort: "Effort: {0} — choose another",
51
51
  cmd_ctx: "Context use, model and effort", cmd_compact: "Compact the conversation", cmd_clear: "Clear the conversation (asks first)",
52
52
  cmd_model: "Show or switch the model", cmd_backend: "Switch the CLI backend, then model and effort (restarts)", cmd_effort: "Show or set the reasoning effort", cmd_cancel: "Stop the current reply",
@@ -197,7 +197,7 @@ register("chat", {
197
197
  you: "你", sending: "傳送中…", uploadingFile: "正在上傳 {0}", uploadWaiting: "等待中", uploadFailed: "失敗",
198
198
  uploadNoConnection: "上傳中斷了,請檢查網路連線", sendNoConnection: "沒有送到 AgEnD,請檢查網路連線", notSentBecause: "沒有送出:{0}", deleteUnsent: "刪除",
199
199
  sendFailure_wake_capacity: "目前沒有空位可喚醒這個 Agent。請等其他 Agent 閒置後重試。",
200
- sendFailure_wake_credentials: "Agent 無法登入。請到設定 → Agents →「AI 登入與 API 金鑰」→「帳號」登入,或在聊天傳 /login,再重試。",
200
+ sendFailure_wake_credentials: "Agent 無法登入。請到設定 → Agents →「AI 帳號與 API 金鑰」→「帳號」連接 AI 帳號,或在聊天傳 /login,再重試。",
201
201
  sendFailure_wake_timeout: "Agent 未能及時就緒。請重試,或到 Fleet 查看它的狀態。",
202
202
  sendFailure_instance_stopped: "這個 Agent 已停止或移除。請先從該 agent 的聊天選單按「啟動 Agent」,再重試。",
203
203
  sendFailure_delivery_unavailable: "Agent 目前無法接收這則訊息。請到 Fleet 查看它的狀態,再重試。",
@@ -213,7 +213,7 @@ register("chat", {
213
213
  compactTimeout: "{0} 分鐘內沒有看到壓縮完成的紀錄,請到 Agent 自己的對話確認。",
214
214
  compactLost: "無法再追蹤這次壓縮:指令沒有送到 Agent,或 Agent 已停止、換了後端。",
215
215
  compactNotCompacted: "kiro 沒有壓縮對話:對話太短,或壓縮被中止了。",
216
- cmdChoose: "選擇", cmdCurrent: "目前", cmdSignIn: "登入", cmdSignInTo: "登入 {0}", chipCompact: "壓縮", chipClear: "清空…", chipContext: "已用 {0}% 的 context",
216
+ cmdChoose: "選擇", cmdCurrent: "目前", cmdSignIn: "連接帳號", cmdSignInTo: "連接 {0} 帳號", chipCompact: "壓縮", chipClear: "清空…", chipContext: "已用 {0}% 的 context",
217
217
  chipModel: "模型:{0}——選擇其他", chipEffort: "推理強度:{0}——選擇其他",
218
218
  cmd_ctx: "context 用量、模型與推理強度", cmd_compact: "壓縮對話", cmd_clear: "清空對話(會先確認)",
219
219
  cmd_model: "查看或切換模型", cmd_backend: "切換 CLI backend,再選模型和推理強度(會重新啟動)", cmd_effort: "查看或設定推理強度", cmd_cancel: "停止目前的回覆",
@@ -0,0 +1,27 @@
1
+ // AGEND-138 (PR #3553 review): the four roles a sign-in can have, and the session menu's "Manage devices" word — in a module of
2
+ // their own on purpose. The session menu (app-session.js, statically imported by the shell) and Settings → Devices read them; a
3
+ // tab that still holds the previous web-authorize.js / app-i18n.js must not be linked against a NEW named export or a missing
4
+ // key (an ESM `import { roleName }` from the old file is a SyntaxError that stops the whole shell). This file's URL is new, so
5
+ // no tab holds an older copy of it; web-authorize.js and app-i18n.js no longer carry these words (a key lives in one file).
6
+ // The pattern is settings-shared-strings.js / settings-access-strings.js (#3087, #3061).
7
+ import { register, t } from "./app-i18n.js";
8
+
9
+ register("webauth", {
10
+ en: { role: "Role", roleOwner: "Owner ✓", roleAdminUnverified: "Admin · not verified", roleGuest: "Guest", roleRead: "Read-only" },
11
+ "zh-TW": { role: "角色", roleOwner: "擁有者 ✓", roleAdminUnverified: "管理員 · 未驗證", roleGuest: "訪客", roleRead: "唯讀" },
12
+ });
13
+ register("app", {
14
+ en: { manageDevices: "Manage devices" },
15
+ "zh-TW": { manageDevices: "管理裝置" },
16
+ });
17
+
18
+ /**
19
+ * A sign-in's role as one of four words — the session menu's and Settings → Devices' alike. `tier` is the session's (admin /
20
+ * read / guest); `verified`: its owner authorization is valid now (this computer's code sign-in or a chat account's confirm).
21
+ * Only an admin can be an owner; an admin without that is "Admin · not verified".
22
+ */
23
+ export function roleName(tier, verified) {
24
+ if (tier === "guest") return t("webauth.roleGuest");
25
+ if (tier === "read") return t("webauth.roleRead");
26
+ return verified ? t("webauth.roleOwner") : t("webauth.roleAdminUnverified");
27
+ }
@@ -0,0 +1,10 @@
1
+ /* Feature-owned support for the existing confirmation card, including a cached shell/stylesheet. */
2
+ @media (max-width: 899px), (pointer: coarse) {
3
+ .pending-stack .pending-code-input,
4
+ .pending-stack .pending-code .btn,
5
+ .pending-stack .pending-actions .btn {
6
+ min-height: var(--tap);
7
+ min-width: var(--tap);
8
+ }
9
+ .pending-stack .pending-code-input { font-size: var(--fs-lg); }
10
+ }
@@ -49,3 +49,9 @@
49
49
  .hub-page-lead { margin: 0; }
50
50
  /* A phone's page-level controls are tap targets (--tap): the chats home's New chat row and a sub-page's crumb. */
51
51
  @media (max-width: 600px) { .hub-home-list .side-new, .hub-crumb { min-height: var(--tap); } .hub-crumb { min-width: var(--tap); } }
52
+
53
+ /* S-119: the existing group/invitation authority is discoverable before the manual pairing flow. */
54
+ .hub-admin-access { display: flex; flex-direction: column; gap: var(--s-3); }
55
+ .hub-admin-access .field-row { flex-wrap: wrap; }
56
+ .hub-admin-access h4 { margin: 0; }
57
+ .hub-admin-manual > .card { border: 0; }
@@ -0,0 +1,21 @@
1
+ /* Feature stylesheet: an upgraded lazy panel remains usable with cached app.css. */
2
+ .model-refresh { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); }
3
+ .model-refresh > .btn { width: auto; gap: var(--s-2); }
4
+ .model-refresh .error-state { align-self: stretch; }
5
+ .cmd-head-actions, .model-entry-row { display: flex; align-items: center; gap: var(--s-2); }
6
+ .cmd-model-more { display: flex; justify-content: flex-start; }
7
+ .cmd-card .cmd-choices .btn:disabled { text-decoration: none; opacity: 0.5; }
8
+ .cmd-card .cmd-choices .btn.current { border-color: var(--accent); color: var(--accent); }
9
+ .cmd-card.cmd-model .cmd-choices .btn.current::before { content: "✓"; }
10
+ .model-entry-row { display: none; }
11
+ @media (max-width: 899px) {
12
+ .model-refresh .btn, .cmd-card .btn, .cmd-card .icon-btn { min-height: var(--tap); min-width: var(--tap); }
13
+ .chat-model-entry { display: none; }
14
+ .model-entry-row { display: flex; flex-wrap: wrap; padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--border); }
15
+ .p-chat .composer-box { border: 1px solid var(--border); }
16
+ .model-entry-row .btn { border-radius: var(--r-full); min-height: var(--tap); min-width: var(--tap); max-width: 100%; overflow-wrap: anywhere; }
17
+ /* The latest button lives in a dedicated dock row, clear of message text and the command/composer content. */
18
+ .p-chat .jump-dock { position: static; height: auto; display: flex; justify-content: center; padding: var(--s-1); }
19
+ .p-chat .jump-dock:empty { display: none; }
20
+ .p-chat .jump-latest { position: static; transform: none; min-height: var(--tap); }
21
+ }
@@ -8,7 +8,9 @@
8
8
  .runtime-command-label { display: block; margin: 0 0 6px; font-size: var(--fs-sm); color: var(--text-2); }
9
9
  .runtime-command-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
10
10
  .runtime-command-row .btn { flex: none; }
11
- .runtime-command-text { flex: 1; min-width: 0; margin: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.5; white-space: pre-wrap; overflow-wrap: normal; word-break: normal; overflow-x: auto; user-select: all; }
11
+ .runtime-command-text { flex: 1; min-width: 0; max-height: 4.8em; margin: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; overflow-y: auto; user-select: all; }
12
+ .runtime-more-details { margin: 4px 0 8px; }
13
+ .runtime-more-details summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-xs); }
12
14
  .runtime-command-text code { font: inherit; }
13
15
  @media (max-width: 600px) { .runtime-command-row { flex-direction: column; align-items: stretch; } .runtime-command-row .btn { align-self: flex-start; } }
14
16
  .runtime-installer-hash code { overflow-wrap: anywhere; font-family: var(--font-mono); }
@@ -28,3 +30,26 @@
28
30
  .runtime-update-notice { margin-block: .75rem; padding: .6rem .8rem; border-inline-start: 3px solid var(--border, #777); }
29
31
  .runtime-update-notice p { margin-block: .25rem; overflow-wrap: anywhere; }
30
32
  .runtime-update-notice[role="alert"] { border-inline-start-color: var(--warning, #b87218); }
33
+ /* the one-time install command's card, and the notice that a computer joined with it. */
34
+ .runtime-enroll-card h4 { margin: 0 0 var(--s-3); font-size: var(--fs-md); }
35
+ .runtime-enroll-card.is-used .runtime-pair-status { color: var(--ok); }
36
+ .runtime-enroll-card.is-expired .runtime-pair-status, .runtime-enroll-card.is-revoked .runtime-pair-status { color: var(--warn); }
37
+ .runtime-enroll-clock { font-variant-numeric: tabular-nums; }
38
+ /* the shared straight bar (.lbar in app.css), with the 3px it takes added to the padding */
39
+ .runtime-enroll-warning { --lbar-color: var(--warn); padding: var(--s-2) var(--s-3) var(--s-2) calc(var(--s-3) + 3px); background: var(--warn-bg); }
40
+ .runtime-enroll-ended { margin: 0 0 var(--s-2); padding: var(--s-3); border: 1px solid var(--warn); border-radius: var(--r-sm); background: var(--warn-bg); }
41
+ .runtime-joined { display: flex; align-items: flex-start; gap: var(--s-3); margin: 0 0 var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--warn); border-radius: var(--r-md); background: var(--warn-bg); }
42
+ .runtime-joined-text { flex: 1; min-width: 0; }
43
+ .runtime-joined h4 { margin: 0 0 var(--s-1); font-size: var(--fs-md); }
44
+ .runtime-joined .note { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
45
+ .runtime-joined-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); flex: none; }
46
+ @media (max-width: 600px) { .runtime-joined { flex-wrap: wrap; } .runtime-joined-actions { width: 100%; } }
47
+ /* the approval dialog's large pairing fingerprint, the "N computers are waiting" bar and the same-name hint. Tokens only; the bar and the
48
+ hint are the shared straight left bar (.lbar). */
49
+ .runtime-approve-fingerprint { margin: 0; padding: var(--s-3) 0; font-family: var(--font-mono); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-semibold); letter-spacing: .08em; color: var(--text); overflow-wrap: anywhere; }
50
+ .runtime-pending-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); margin: 0 0 var(--s-4); padding: var(--s-2) 0 var(--s-2) var(--s-3); --lbar-color: var(--warn); --lbar-inset: 0; font-size: var(--fs-sm); color: var(--text); }
51
+ .runtime-same-name { --lbar-color: var(--warn); --lbar-inset: 0; padding-left: var(--s-3); color: var(--text-2); }
52
+ @media (max-width: 600px) { .runtime-open-policy { min-height: var(--tap); } }
53
+ /* AGEND-154 (Prism P2-3 on #3552): the Install / Update buttons of a paired computer's CLI list (.btn.btn-sm = 30px) are phone tap targets — 44px high and wide (the house --tap), on the same
54
+ breakpoints as the shared phone rules. Here, not only in app.css, so a tab that kept an older app.css still gets them (this file is linked by panel-runtimes.js itself). Tokens only: no inline style. */
55
+ @media (max-width: 899px), (pointer: coarse) { .runtime-cli-install-list li .btn { min-height: var(--tap, 44px); min-width: var(--tap, 44px); } }
@@ -10,11 +10,11 @@
10
10
  */
11
11
  export const HOST_MESSAGES = [
12
12
  // The code page (setup-host.ts redeem / afterFailure / the cookie gate).
13
- ["incorrect — {0} attempts left", "代碼不正確 —— 還可以再試 {0} 次"],
14
- ["incorrect — {0} attempt left", "代碼不正確 —— 還可以再試 {0} 次"],
13
+ ["incorrect — {0} attempts left", "設定碼不正確 —— 還可以再試 {0} 次"],
14
+ ["incorrect — {0} attempt left", "設定碼不正確 —— 還可以再試 {0} 次"],
15
15
  ["too many failed attempts — run `agend setup` again on the host", "錯誤次數太多 —— 請在主機上再執行一次 `agend setup`"],
16
- ["enter the setup code", "請輸入設定代碼"],
17
- ["enter the setup code first", "請先輸入設定代碼"],
16
+ ["enter the setup code", "請輸入設定碼"],
17
+ ["enter the setup code first", "請先輸入設定碼"],
18
18
  ["cross-site request rejected", "已拒絕跨站請求"],
19
19
  ["not found", "找不到"],
20
20
  // Finishing (setup-host.ts finishSetup / status).
@@ -12,14 +12,14 @@
12
12
  const T = {
13
13
  en: {
14
14
  signout_unsaved: "Signed out for now, but the change could not be saved: a restart may bring the session back. This page cannot repair session storage.",
15
- checking: "Checking your session…", title: "Sign in to AgEnD", lead: "Enter your sign-in code.",
16
- label: "One-time code", submit: "Sign in", working: "Signing in…",
17
- hint: "No code? Send /web in General, then press a sign-in button to get one.",
15
+ checking: "Checking your session…", title: "Sign in to AgEnD", lead: "Enter your authenticator app’s 6-digit code to sign in automatically.",
16
+ label: "Authenticator or device sign-in code", submit: "Sign in", working: "Signing in…",
17
+ hint: "Paste an 8-character device sign-in code",
18
18
  nobot: "No chat bot?", nobot_body: "Ask the operator to run agend web --code on the AgEnD computer.",
19
19
  safe: "Page looks wrong after signing in?", safe_body: "Your custom CSS may be hiding something. Add ?safe=1 to the end of the address to load the page without it, then fix it or turn it off in Settings → Look.",
20
20
  refused: "The code is invalid or no longer works. Send /web in General, then press a sign-in button for a new code.",
21
21
  // #3270: the code in the opened link did not work (expired, used, or the fleet restarted). It is never put back in the box.
22
- autofail: "The automatic sign-in did not work — its code has expired or was already used. Run agend web on the AgEnD computer for a new one.",
22
+ autofail: "The automatic sign-in did not work — its code has expired or was already used. To sign in again on this computer, run agend web in a terminal: it opens a new sign-in link.",
23
23
  unconfirmed: "Sign-in could not be confirmed. Get a new code and try again; if it keeps failing, contact the operator.",
24
24
  paused: "Too many wrong codes — sign-in is paused for a few minutes.",
25
25
  network: "Could not reach AgEnD. Check the connection and try again.",
@@ -30,11 +30,26 @@
30
30
  hint_web: "On the AgEnD computer, run agend web --code to get a sign-in code.",
31
31
  refused_web: "The code is invalid or no longer works. Run agend web --code on the AgEnD computer for a new one.",
32
32
  resend_refused_web: "A new code could not be sent. Run agend web --code on the AgEnD computer for one.",
33
+ // S-117 story 1: on this computer (a loopback address) — sign in again here, never "send /web" (no chat may be
34
+ // connected yet). A Windows browser here is a WSL install's: its desktop shortcut opens the page with a new code.
35
+ hint_local: "On this computer, run agend web in a terminal: it opens the sign-in page and shows a new device sign-in code.",
36
+ hint_local_win: "On this computer, open the \u201cAgEnD 儀表板\u201d shortcut on the desktop: it opens the sign-in page with a new device sign-in code. Or run agend web in a WSL terminal.",
37
+ refused_local: "The code is invalid or no longer works. On this computer, run agend web in a terminal for a new one.",
38
+ refused_local_win: "The code is invalid or no longer works. On this computer, open the \u201cAgEnD 儀表板\u201d shortcut on the desktop for a new one.",
39
+ autofail_local_win: "The automatic sign-in did not work — its code has expired or was already used. To sign in again on this computer, open the \u201cAgEnD 儀表板\u201d shortcut on the desktop, or run agend web in a WSL terminal.",
33
40
  // #3008: through the link "Allow connections from outside" opened — the authenticator app's code (the leader's wording).
34
41
  label_outside: "Authenticator code", lead_outside: "Open your authenticator app and enter the 6-digit code for AgEnD.",
35
42
  hint_outside: "Lost your phone? On the AgEnD computer, choose \u201cSet up again\u201d.",
36
43
  refused_outside: "That code didn't work. Check that your phone's clock is right and try the newest code.",
37
44
  paused_outside: "Too many wrong codes. Try again in {duration}.",
45
+ totp_refused: "Code not accepted. Try the next code.",
46
+ totp_help: "Sign-in may be limited. If the code is right, use an 8-character code or a signed-in device.",
47
+ unavailable: "Authenticator sign-in is not available here. Paste an 8-character device sign-in code, or use a device you have signed in from before.",
48
+ invalid: "Enter a 6-digit authenticator code or an 8-character device sign-in code.",
49
+ pause_for: "Sign-in is paused. Please wait {duration}, then try again.", pause_button: "Sign-in paused", ready_again: "You can try signing in again.",
50
+ reach_title: "How does my phone reach AgEnD?", reach_lead: "Open the AgEnD address in your phone’s browser:",
51
+ reach_wifi: "Same Wi-Fi: use the computer’s local network address.", reach_private: "Private network, such as Tailscale: connect both devices to that network first.",
52
+ reach_outside: "Outside connection: use the address your admin provides.",
38
53
  minutes: "{0} minutes", minute: "1 minute", hours: "{0} hours", hour: "1 hour",
39
54
  // #3061: sign in with another device — an 8-character code shown here, approved on a device that is already signed in.
40
55
  another: "Sign in with another device", dev_title: "Sign in with another device",
@@ -48,35 +63,48 @@
48
63
  },
49
64
  "zh-TW": {
50
65
  signout_unsaved: "暫時登出了,但變更沒能儲存:重新啟動後這個工作階段可能會回來。這個頁面無法修復工作階段的儲存問題。",
51
- checking: "正在確認登入狀態…", title: "登入 AgEnD", lead: "輸入登入碼。",
52
- label: "一次性登入碼", submit: "登入", working: "登入中…",
53
- hint: "沒收到?在 General 傳 /web,再按登入按鈕取碼。",
66
+ checking: "正在確認登入狀態…", title: "登入 AgEnD", lead: "填入驗證器 App 的 6 位數驗證碼,即可自動登入。",
67
+ label: "驗證碼或裝置登入碼", submit: "登入", working: "登入中…",
68
+ hint: "也可以貼上 8 字元裝置登入碼",
54
69
  nobot: "沒有聊天 bot?", nobot_body: "請管理員在 AgEnD 電腦執行 agend web --code。",
55
70
  safe: "登入後畫面不對勁?", safe_body: "可能是你的自訂 CSS 把東西藏起來了。在網址最後加上 ?safe=1,就會不套用它地載入;再到「設定 → 外觀」修正或關閉。",
56
- refused: "登入碼無效或已失效。請在 General 傳 /web,再按登入按鈕取新碼。",
57
- autofail: "自動登入沒有成功:登入碼已過期或已使用過。請在 AgEnD 電腦上執行 agend web 取得新的登入碼。",
71
+ refused: "裝置登入碼無效或已失效。請在 General 傳 /web,再按登入按鈕取新碼。",
72
+ autofail: "自動登入沒有成功:這個連結的裝置登入碼已過期或已用過。在這台電腦重新登入:在終端機執行 agend web,它會開啟新的登入連結。",
58
73
  unconfirmed: "登入暫時無法確認。請重新取碼再試;若仍失敗,請聯絡管理員。",
59
74
  paused: "錯誤次數過多,登入暫停幾分鐘。",
60
75
  network: "連不上 AgEnD,請檢查連線後再試。",
61
- resend: "傳一組新的登入碼給我", resent: "新的登入碼已私訊給你,請在上方輸入。",
62
- resend_wait: "剛剛才要過登入碼,請稍候再試。",
63
- resend_refused: "無法傳送新的登入碼。請用 /web 再要一個。",
64
- hint_web: "在 AgEnD 電腦上執行 agend web --code 取得登入碼。",
65
- refused_web: "登入碼無效或已失效。請在 AgEnD 電腦上執行 agend web --code 取得新碼。",
66
- resend_refused_web: "無法傳送新的登入碼。請在 AgEnD 電腦上執行 agend web --code 取得。",
67
- label_outside: "驗證器代碼", lead_outside: "打開驗證器 App,輸入 AgEnD 的 6 位數代碼。",
76
+ resend: "傳一組新的裝置登入碼給我", resent: "新的裝置登入碼已私訊給你,請在上方輸入。",
77
+ resend_wait: "剛剛才要過裝置登入碼,請稍候再試。",
78
+ resend_refused: "無法傳送新的裝置登入碼。請用 /web 再要一個。",
79
+ hint_web: "在 AgEnD 電腦上執行 agend web --code 取得裝置登入碼。",
80
+ refused_web: "裝置登入碼無效或已失效。請在 AgEnD 電腦上執行 agend web --code 取得新碼。",
81
+ resend_refused_web: "無法傳送新的裝置登入碼。請在 AgEnD 電腦上執行 agend web --code 取得。",
82
+ hint_local: "在這台電腦重新登入:在終端機執行 agend web,它會開啟登入頁並顯示新的裝置登入碼。",
83
+ hint_local_win: "在這台電腦重新登入:點桌面上的「AgEnD 儀表板」捷徑,它會開啟登入頁並帶上新的裝置登入碼;或在 WSL 終端機執行 agend web。",
84
+ refused_local: "裝置登入碼無效或已失效。請在這台電腦的終端機執行 agend web 取得新的裝置登入碼。",
85
+ refused_local_win: "裝置登入碼無效或已失效。請點桌面上的「AgEnD 儀表板」捷徑取得新的裝置登入碼。",
86
+ autofail_local_win: "自動登入沒有成功:這個連結的裝置登入碼已過期或已用過。在這台電腦重新登入:點桌面上的「AgEnD 儀表板」捷徑;或在 WSL 終端機執行 agend web。",
87
+ label_outside: "6 位數驗證碼(驗證器 App)", lead_outside: "打開驗證器 App,輸入 AgEnD 的 6 位數驗證碼。",
68
88
  hint_outside: "手機遺失?請在 AgEnD 電腦上選「重新設定」。",
69
- refused_outside: "代碼不對。請確認手機時間正確,並輸入最新的代碼。",
89
+ refused_outside: "驗證碼不對。請確認手機時間正確,並輸入最新的驗證碼。",
70
90
  paused_outside: "錯誤次數太多,請 {duration} 後再試。",
91
+ totp_refused: "驗證碼未通過;若剛換碼,請等下一組再試。",
92
+ totp_help: "驗證碼正確也可能暫時受限。請改貼 8 字元裝置登入碼,或使用先前登入過的裝置。",
93
+ unavailable: "這裡無法使用驗證器 App 登入。請貼上 8 字元裝置登入碼,或使用先前登入過的裝置。",
94
+ invalid: "請輸入 6 位數驗證碼或 8 字元裝置登入碼。",
95
+ pause_for: "登入已暫停,請等 {duration}後再試。", pause_button: "暫時無法登入", ready_again: "可以再次嘗試登入。",
96
+ reach_title: "如何在手機開啟 AgEnD?", reach_lead: "在手機瀏覽器開啟 AgEnD 網址:",
97
+ reach_wifi: "同一個 Wi-Fi:使用電腦的區網網址。", reach_private: "私人網路(如 Tailscale):兩台裝置先連上同一個網路。",
98
+ reach_outside: "外部連線:使用管理員提供的網址。",
71
99
  minutes: "{0} 分鐘", minute: "1 分鐘", hours: "{0} 小時", hour: "1 小時",
72
100
  another: "使用其他裝置登入", dev_title: "使用其他裝置登入",
73
- dev_lead: "在已登入且已驗證擁有者的裝置上,開啟「設定 → 存取與安全」,在「裝置與登入」選「新增裝置」,輸入這組代碼。",
101
+ dev_lead: "在已登入且已驗證擁有者的裝置上,開啟「設定 → 存取與安全」,在「裝置與登入」選「新增裝置」,輸入這組裝置登入碼。",
74
102
  dev_waiting: "等待核准中… {time} 後失效。", dev_approved: "已核准,登入中…",
75
- dev_expired: "這組代碼已失效。", dev_denied: "這個請求已被拒絕。", dev_new: "取得新代碼", dev_back: "返回",
76
- dev_busy: "目前等待核准的裝置太多,請稍後再試。", dev_limited: "要求代碼的次數太多,請 {duration} 後再試。",
77
- dev_unavailable: "這裡無法使用其他裝置登入。", dev_failed: "無法取得代碼。請檢查連線後再試。",
103
+ dev_expired: "這組裝置登入碼已失效。", dev_denied: "這個請求已被拒絕。", dev_new: "取得新的裝置登入碼", dev_back: "返回",
104
+ dev_busy: "目前等待核准的裝置太多,請稍後再試。", dev_limited: "要求裝置登入碼的次數太多,請 {duration} 後再試。",
105
+ dev_unavailable: "這裡無法使用其他裝置登入。", dev_failed: "無法取得裝置登入碼。請檢查連線後再試。",
78
106
  dev_lost: "連不上 AgEnD,仍在重試…",
79
- dev_qr: "也可以用已登入且已驗證擁有者的裝置掃描這個 QR Code。裡面只有這個頁面的網址和上面的代碼,沒有其他東西。",
107
+ dev_qr: "也可以用已登入且已驗證擁有者的裝置掃描這個 QR Code。裡面只有這個頁面的網址和上面的裝置登入碼,沒有其他東西。",
80
108
  },
81
109
  };
82
110
  const lang = /^zh/i.test(navigator.language || "") ? "zh-TW" : "en";
@@ -92,7 +120,28 @@
92
120
  const loginQr = deviceLogin && document.body.getAttribute("data-login-qr") === "1";
93
121
  // Reserve the gated action while the form is still hidden, so ending the session read does not resize the card.
94
122
  if (deviceLogin) $("another").hidden = false;
95
- const t = (k) => (outside && (T[lang][`${k}_outside`] || T.en[`${k}_outside`])) || (webOnly && (T[lang][`${k}_web`] || T.en[`${k}_web`])) || T[lang][k] || T.en[k] || k;
123
+ // S-117 story 1: a chat fleet whose chat is not connected yet (<body data-no-chat="1">) has the web-only words too —
124
+ // never "send /web" — and nothing else of a web-only fleet's (no authenticator or other-device sign-in from that).
125
+ const noChat = webOnly || (!!document.body && document.body.getAttribute("data-no-chat") === "1");
126
+ // S-117 story 1: this computer (a loopback address) has its own words first — sign in again here; a Windows browser
127
+ // here (a WSL install) is pointed at its desktop shortcut. Only words change: the page issues nothing itself (D3).
128
+ const local = !outside && /^(localhost|127(\.\d{1,3}){3}|\[?::1\]?)$/i.test((typeof location !== "undefined" && location.hostname) || "");
129
+ const win = local && /Windows/i.test((typeof navigator !== "undefined" && navigator.userAgent) || "");
130
+ const deviceText = (k) => (win && (T[lang][`${k}_local_win`] || T.en[`${k}_local_win`]))
131
+ || (local && (T[lang][`${k}_local`] || T.en[`${k}_local`])) || (noChat && (T[lang][`${k}_web`] || T.en[`${k}_web`])) || T[lang][k] || T.en[k] || k;
132
+ // Input routing is by the complete code, on every surface; device-code recovery retains its existing local/chat words.
133
+ const t = (k) => ["lead", "label", "hint"].includes(k) ? T[lang][k] : (outside && (T[lang][`${k}_outside`] || T.en[`${k}_outside`])) || deviceText(k);
134
+ function paint(node, text) {
135
+ if (!node) return;
136
+ if (typeof node.replaceChildren !== "function") { node.textContent = text; return; }
137
+ const terms = lang === "zh-TW" ? /(8 字元裝置登入碼|使用先前登入過的裝置|驗證器 App|驗證器|驗證碼|同一個網路|自動登入|每組|立即|直接|核准)/g : /(8-character)/g;
138
+ const parts = text.split(terms);
139
+ if (parts.length === 1) { node.textContent = text; return; }
140
+ node.replaceChildren(...parts.map((part, i) => {
141
+ if (i % 2 === 0) return part;
142
+ const span = document.createElement("span"); span.className = "signin-term"; span.textContent = part; return span;
143
+ }));
144
+ }
96
145
  /** A wait as words: "15 minutes" / 「15 分鐘」, "2 hours" / 「2 小時」 (rounded up). */
97
146
  const duration = (ms) => {
98
147
  const minutes = Math.max(1, Math.ceil(ms / 60000));
@@ -101,14 +150,12 @@
101
150
  return hours === 1 ? t("hour") : t("hours").replace("{0}", String(hours));
102
151
  };
103
152
  // …and no "No chat bot?" help: the hint above already is it.
104
- if (webOnly) document.querySelectorAll("details.help").forEach((d) => { if (d.querySelector && d.querySelector('[data-i18n="nobot"]')) d.hidden = true; });
153
+ if (noChat || local) document.querySelectorAll("details.help").forEach((d) => { if (d.querySelector && d.querySelector('[data-i18n="nobot"]')) d.hidden = true; });
105
154
  document.documentElement.lang = lang === "zh-TW" ? "zh-Hant" : "en";
106
155
  $("checking").setAttribute?.("aria-label", t("checking"));
107
- if (outside) {
108
- const input = $("code");
109
- input.setAttribute("inputmode", "numeric"); input.setAttribute("maxlength", "7"); input.setAttribute("placeholder", "123456");
110
- input.setAttribute("pattern", "[0-9 ]*");
111
- }
156
+ // Also repairs an old cached HTML shell’s numeric/short field constraints.
157
+ $("code").setAttribute("inputmode", "text"); $("code").setAttribute("maxlength", "32"); $("code").setAttribute("placeholder", "");
158
+ $("code").removeAttribute?.("pattern");
112
159
 
113
160
  // #3270: `agend web` opens this page on this computer as /signin#code=XXXX-XXXX. A fragment is never sent to the server, a
114
161
  // log or a Referer; it is read here and taken out of the address bar and the history entry BEFORE anything else runs —
@@ -146,16 +193,22 @@
146
193
  } catch { /* nothing to clean */ }
147
194
  // The command in the "No chat bot?" help is a <code> that never breaks across lines (a break inside "--code" reads as
148
195
  // two dashes and a word, alpha.2 sweep); the text around it is text.
149
- const CMD = "agend web --code";
196
+ const CMD = /agend web(?: --code)?/;
150
197
  document.querySelectorAll("[data-i18n]").forEach((el) => {
151
198
  const text = t(el.getAttribute("data-i18n"));
152
- const at = text.indexOf(CMD);
153
- if (at < 0) { el.textContent = text; return; }
199
+ const m = CMD.exec(text);
200
+ if (!m) { paint(el, text); return; }
154
201
  const code = document.createElement("code");
155
- code.textContent = CMD;
156
- el.replaceChildren(text.slice(0, at), code, text.slice(at + CMD.length));
202
+ code.textContent = m[0];
203
+ el.replaceChildren(text.slice(0, m.index), code, text.slice(m.index + m[0].length));
157
204
  });
158
205
 
206
+ // New help is optional: new JS still works with cached HTML, and old JS leaves it hidden.
207
+ if ($("reachHelp")) {
208
+ for (const [id, key] of [["reachTitle", "reach_title"], ["reachLead", "reach_lead"], ["reachWifi", "reach_wifi"], ["reachPrivate", "reach_private"], ["reachOutside", "reach_outside"]]) paint($(id), t(key));
209
+ $("reachHelp").hidden = false;
210
+ }
211
+
159
212
  // An old deep link, /ui#instance=<name> (#1408 §3): the fragment never reaches the server, and the sign-in page is
160
213
  // served at the URL that was asked for, so it is still in location.hash here. Exactly that one form becomes the new
161
214
  // path /ui/chat/<name>; any other fragment is dropped. The name is held to the same rule as the server's.
@@ -317,6 +370,7 @@
317
370
  $("devQr").hidden = false;
318
371
  }
319
372
  async function devStart() {
373
+ retireEntries();
320
374
  devStop();
321
375
  $("form").hidden = true; $("device").hidden = false; $("devNew").hidden = true;
322
376
  hideQr();
@@ -399,7 +453,7 @@
399
453
  }
400
454
 
401
455
  // What a refused POST /auth/login says (the form's and the fragment's exchange alike): 429 and 5xx are not a wrong code.
402
- const failureText = (status) => (status === 429 ? t("paused") : status >= 500 ? t("unconfirmed") : t("refused"));
456
+ const failureText = (status) => (status === 429 ? deviceText("paused") : status >= 500 ? deviceText("unconfirmed") : deviceText("refused"));
403
457
 
404
458
  // #3270: the exchange of the code `agend web` put in the fragment. Resolves null once the browser is on its way into the
405
459
  // app, else the words for why not — the form then shows them, so an expired or used code never leaves a blank page. The
@@ -420,38 +474,91 @@
420
474
  }
421
475
  }
422
476
 
423
- $("form").addEventListener("submit", async (event) => {
424
- event.preventDefault();
425
- const button = $("go");
426
- const msg = $("msg");
427
- msg.textContent = "";
428
- msg.classList?.remove("ok");
429
- button.disabled = true;
430
- button.textContent = t("working");
477
+ // S-118: one complete value chooses one existing route. Never strip a letter/dash into a TOTP.
478
+ function codeValue() {
479
+ const raw = $("code").value.trim();
480
+ if (/^[0-9]{6}$/.test(raw)) return { path: "/auth/totp", code: raw, wait: /^[2-7]{6}$/.test(raw) };
481
+ if (/^(?:[A-Z2-7]{8}|[A-Z2-7]{4}-[A-Z2-7]{4})$/i.test(raw)) return { path: "/auth/login", code: raw.replace("-", "").toUpperCase(), wait: false };
482
+ return null;
483
+ }
484
+ const autoAttempts = new Set(), activeEntries = new Map();
485
+ let entryTimer = 0, pauseTimer = 0, pausedUntil = 0, entryVersion = 0, latestEntry = null;
486
+ let composing = false, pasteInput = false, entryStopped = false, signedIn = false, observedValue = "";
487
+ const entryKey = (value) => value ? `${value.path}:${value.code}` : `invalid:${$("code").value}`;
488
+ function cancelEntryTimer() { clearTimeout(entryTimer); entryTimer = 0; }
489
+ function retireEntries() {
490
+ cancelEntryTimer(); entryVersion++; latestEntry = null;
491
+ for (const attempt of activeEntries.values()) attempt.controller?.abort();
492
+ activeEntries.clear();
493
+ }
494
+ function entryCurrent(mine) {
495
+ return !entryStopped && !signedIn && !$("form").hidden && mine === latestEntry && mine.version === entryVersion && entryKey(codeValue()) === mine.key;
496
+ }
497
+ function entryMessage(text, hint = "") {
498
+ paint($("msg"), text); $("msg").classList?.remove("ok");
499
+ if ($("authHint")) { paint($("authHint"), hint); $("authHint").hidden = !hint; }
500
+ else if (hint) paint($("msg"), `${text} ${hint}`); // cached HTML still gets the complete recovery guidance
501
+ }
502
+ function entryButton() {
503
+ const paused = pausedUntil > Date.now();
504
+ $("go").disabled = paused || !!(latestEntry && activeEntries.get(latestEntry.key) === latestEntry);
505
+ $("go").textContent = paused ? t("pause_button") : $("go").disabled ? t("working") : t("submit");
506
+ }
507
+ async function submitEntry(manual = false) {
508
+ cancelEntryTimer();
509
+ if (entryStopped || signedIn || $("form").hidden || composing || pausedUntil > Date.now()) return;
510
+ const value = codeValue();
511
+ if (!value) { if (manual) entryMessage(t("invalid")); return; }
512
+ const key = entryKey(value);
513
+ if (activeEntries.has(key) || (!manual && autoAttempts.has(key))) return;
514
+ // Explicit submit may be the first observation of the value (autofill or an old HTML form).
515
+ if (observedValue !== key) { retireEntries(); observedValue = key; }
516
+ autoAttempts.add(key);
517
+ const mine = { key, version: entryVersion, controller: typeof AbortController === "function" ? new AbortController() : null };
518
+ latestEntry = mine; activeEntries.set(key, mine); entryMessage(""); entryButton();
431
519
  try {
432
- const r = await fetch(outside ? "/auth/totp" : "/auth/login", {
433
- method: "POST",
434
- credentials: "same-origin",
435
- headers: { "Content-Type": "application/json" },
436
- body: JSON.stringify({ code: $("code").value }),
437
- });
438
- if (r.ok) { clearBounce(); location.replace(nextTarget()); return; }
439
- if (outside && r.status === 429) {
520
+ const r = await fetch(value.path, { method: "POST", credentials: "same-origin", headers: { "Content-Type": "application/json" },
521
+ body: JSON.stringify({ code: value.code }), ...(mine.controller ? { signal: mine.controller.signal } : {}) });
522
+ if (!entryCurrent(mine)) return;
523
+ if (r.ok) { signedIn = true; cancelEntryTimer(); clearTimeout(pauseTimer); clearBounce(); location.replace(nextTarget()); return; }
524
+ if (r.status === 429) {
440
525
  let wait = Number(r.headers.get("Retry-After")) * 1000;
441
- try { const body = await r.json(); if (Number.isFinite(body && body.retryAfterMs)) wait = body.retryAfterMs; } catch { /* the header's */ }
442
- msg.textContent = t("paused").replace("{duration}", duration(Number.isFinite(wait) && wait > 0 ? wait : 60000));
443
- throw "shown";
444
- }
445
- // #1854: a 5xx is the server failing to confirm the sign-in (503: a public link's notice did not go out), not a
446
- // wrong code — say so. The code is spent either way: the way on is a new one.
447
- msg.textContent = failureText(r.status);
448
- } catch (err) {
449
- if (err !== "shown") msg.textContent = t("network");
526
+ try { const body = await r.json(); if (Number.isFinite(body?.retryAfterMs) && body.retryAfterMs > 0) wait = body.retryAfterMs; } catch { /* use the header */ }
527
+ if (!entryCurrent(mine)) return;
528
+ wait = Number.isFinite(wait) && wait > 0 ? wait : 60000;
529
+ pausedUntil = Date.now() + wait;
530
+ entryMessage(t("pause_for").replace("{duration}", duration(wait))); $("msg").classList?.add("ok");
531
+ clearTimeout(pauseTimer);
532
+ pauseTimer = setTimeout(() => {
533
+ if (entryStopped || signedIn) return;
534
+ pausedUntil = 0; entryMessage(t("ready_again")); $("msg").classList?.add("ok"); entryButton();
535
+ }, wait);
536
+ } else if (value.path === "/auth/totp" && r.status === 404) entryMessage(t("unavailable"));
537
+ else if (value.path === "/auth/totp" && r.status === 401) entryMessage(t("totp_refused"), t("totp_help"));
538
+ else entryMessage(failureText(r.status));
539
+ } catch {
540
+ if (entryCurrent(mine)) entryMessage(t("network"));
541
+ } finally {
542
+ if (activeEntries.get(key) === mine) activeEntries.delete(key);
543
+ if (entryCurrent(mine)) { entryButton(); if (!(pausedUntil > Date.now())) $("code").select(); }
450
544
  }
451
- button.disabled = false;
452
- button.textContent = t("submit");
453
- $("code").select();
454
- });
545
+ }
546
+ function entryInput(event = {}) {
547
+ cancelEntryTimer();
548
+ const value = codeValue(), key = entryKey(value);
549
+ if (key !== observedValue) { retireEntries(); observedValue = key; if (!(pausedUntil > Date.now())) entryMessage(""); entryButton(); }
550
+ const pasted = pasteInput || event.inputType === "insertFromPaste"; pasteInput = false;
551
+ if (entryStopped || signedIn || $("form").hidden || composing || event.isComposing || pausedUntil > Date.now() || !value) return;
552
+ if (!pasted && value.wait) entryTimer = setTimeout(() => { submitEntry(); }, 800);
553
+ else void submitEntry();
554
+ }
555
+ $("code").addEventListener("keydown", cancelEntryTimer);
556
+ $("code").addEventListener("paste", () => { cancelEntryTimer(); pasteInput = true; Promise.resolve().then(() => { pasteInput = false; }); });
557
+ $("code").addEventListener("input", entryInput);
558
+ $("code").addEventListener("compositionstart", () => { composing = true; cancelEntryTimer(); });
559
+ $("code").addEventListener("compositionend", () => { composing = false; entryInput(); });
560
+ $("form").addEventListener("submit", (event) => { event.preventDefault(); return submitEntry(true); });
561
+ globalThis.addEventListener?.("pagehide", () => { entryStopped = true; retireEntries(); clearTimeout(pauseTimer); });
455
562
 
456
563
  (async () => {
457
564
  // Someone who already has a session is simply let in: the code in the link is not exchanged over it (it stays unspent
@@ -0,0 +1,15 @@
1
+ /* Optional chat progress disclosure; its own lazy stylesheet survives an older cached app.css. */
2
+ .subagent-progress { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-block: var(--s-2); }
3
+ .subagent-progress > summary { min-height: var(--tap); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); cursor: pointer; font-weight: var(--fw-medium); }
4
+ .subagent-progress > summary .note { margin-inline-start: auto; font-weight: var(--fw-regular); }
5
+ .subagent-scroll { max-height: 32vh; overflow: auto; padding: 0 var(--s-3) var(--s-3); overscroll-behavior: contain; }
6
+ .subagent-group + .subagent-group, .subagent-item + .subagent-item { border-block-start: 1px solid var(--border); margin-block-start: var(--s-3); padding-block-start: var(--s-3); }
7
+ .subagent-parent { overflow-wrap: anywhere; margin-block: var(--s-2); }
8
+ .subagent-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-2); }
9
+ .subagent-head strong { overflow-wrap: anywhere; }
10
+ .subagent-item p { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: var(--s-2); }
11
+ .subagent-report { color: var(--text-2); }
12
+
13
+ .subagent-progress > summary::before { content: "▸"; flex: none; }
14
+ .subagent-progress[open] > summary::before { transform: rotate(90deg); }
15
+ .subagent-scroll-hint { margin: 0 var(--s-3) var(--s-2); }