@songsid/agend 2.4.0-alpha.1 → 2.4.0-alpha.3

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 (529) hide show
  1. package/README.md +1 -1
  2. package/README.zh-TW.md +1 -1
  3. package/dist/account-isolation.d.ts +6 -0
  4. package/dist/account-isolation.js +40 -0
  5. package/dist/account-isolation.js.map +1 -0
  6. package/dist/accounts-signout.d.ts +15 -2
  7. package/dist/accounts-signout.js +52 -4
  8. package/dist/accounts-signout.js.map +1 -1
  9. package/dist/accounts-view.d.ts +114 -27
  10. package/dist/accounts-view.js +123 -60
  11. package/dist/accounts-view.js.map +1 -1
  12. package/dist/agent-cli-instructions.md +9 -7
  13. package/dist/agent-cli.js +47 -20
  14. package/dist/agent-cli.js.map +1 -1
  15. package/dist/agent-endpoint.js +23 -8
  16. package/dist/agent-endpoint.js.map +1 -1
  17. package/dist/agent-list-output.d.ts +23 -0
  18. package/dist/agent-list-output.js +53 -0
  19. package/dist/agent-list-output.js.map +1 -0
  20. package/dist/agent-runtime-change.js +4 -4
  21. package/dist/agent-runtime-change.js.map +1 -1
  22. package/dist/agent-whats-new.js +4 -0
  23. package/dist/agent-whats-new.js.map +1 -1
  24. package/dist/antigravity-first-run.d.ts +4 -0
  25. package/dist/antigravity-first-run.js +57 -0
  26. package/dist/antigravity-first-run.js.map +1 -0
  27. package/dist/antigravity-identity.d.ts +6 -0
  28. package/dist/antigravity-identity.js +27 -0
  29. package/dist/antigravity-identity.js.map +1 -0
  30. package/dist/antigravity-store.d.ts +22 -0
  31. package/dist/antigravity-store.js +79 -0
  32. package/dist/antigravity-store.js.map +1 -0
  33. package/dist/auth-api.js +7 -1
  34. package/dist/auth-api.js.map +1 -1
  35. package/dist/backend/agy-onboarding.d.ts +14 -0
  36. package/dist/backend/agy-onboarding.js +114 -0
  37. package/dist/backend/agy-onboarding.js.map +1 -0
  38. package/dist/backend/antigravity.d.ts +15 -0
  39. package/dist/backend/antigravity.js +44 -4
  40. package/dist/backend/antigravity.js.map +1 -1
  41. package/dist/backend/claude-code.js +4 -0
  42. package/dist/backend/claude-code.js.map +1 -1
  43. package/dist/backend/credential-profile.d.ts +22 -3
  44. package/dist/backend/credential-profile.js +61 -9
  45. package/dist/backend/credential-profile.js.map +1 -1
  46. package/dist/backend/types.d.ts +6 -0
  47. package/dist/backend/types.js.map +1 -1
  48. package/dist/backend-availability.d.ts +7 -1
  49. package/dist/backend-availability.js +39 -1
  50. package/dist/backend-availability.js.map +1 -1
  51. package/dist/browser-backend-signins.d.ts +16 -2
  52. package/dist/browser-backend-signins.js +17 -9
  53. package/dist/browser-backend-signins.js.map +1 -1
  54. package/dist/build-provenance.json +1 -1
  55. package/dist/channel/mcp-tools.js +10 -10
  56. package/dist/channel/mcp-tools.js.map +1 -1
  57. package/dist/claude-auth-status.d.ts +1 -0
  58. package/dist/claude-auth-status.js +25 -0
  59. package/dist/claude-auth-status.js.map +1 -1
  60. package/dist/cli-capability.d.ts +104 -19
  61. package/dist/cli-capability.js +3 -1
  62. package/dist/cli-capability.js.map +1 -1
  63. package/dist/cli-caps-module.d.ts +14 -0
  64. package/dist/cli-caps-module.js +8 -1
  65. package/dist/cli-caps-module.js.map +1 -1
  66. package/dist/cli-registry-check.js +114 -18
  67. package/dist/cli-registry-check.js.map +1 -1
  68. package/dist/cli-registry.d.ts +116 -12
  69. package/dist/cli-registry.js +16 -1
  70. package/dist/cli-registry.js.map +1 -1
  71. package/dist/cli-spec-antigravity.d.ts +53 -11
  72. package/dist/cli-spec-antigravity.js +44 -13
  73. package/dist/cli-spec-antigravity.js.map +1 -1
  74. package/dist/cli-spec-claude-code.d.ts +14 -1
  75. package/dist/cli-spec-claude-code.js +5 -4
  76. package/dist/cli-spec-claude-code.js.map +1 -1
  77. package/dist/cli-spec-codex.d.ts +8 -0
  78. package/dist/cli-spec-codex.js +4 -3
  79. package/dist/cli-spec-codex.js.map +1 -1
  80. package/dist/cli-spec-grok.d.ts +4 -0
  81. package/dist/cli-spec-grok.js +2 -1
  82. package/dist/cli-spec-grok.js.map +1 -1
  83. package/dist/cli-spec-kiro-cli.d.ts +7 -0
  84. package/dist/cli-spec-kiro-cli.js +3 -2
  85. package/dist/cli-spec-kiro-cli.js.map +1 -1
  86. package/dist/cli-spec-muse.d.ts +4 -0
  87. package/dist/cli-spec-muse.js +2 -1
  88. package/dist/cli-spec-muse.js.map +1 -1
  89. package/dist/cli-spec-opencode.d.ts +1 -0
  90. package/dist/cli-spec-opencode.js +1 -0
  91. package/dist/cli-spec-opencode.js.map +1 -1
  92. package/dist/config-validator.js +47 -7
  93. package/dist/config-validator.js.map +1 -1
  94. package/dist/credential-store-proof.d.ts +6 -0
  95. package/dist/credential-store-proof.js +30 -0
  96. package/dist/credential-store-proof.js.map +1 -0
  97. package/dist/daemon.d.ts +3 -0
  98. package/dist/daemon.js +6 -2
  99. package/dist/daemon.js.map +1 -1
  100. package/dist/decision-list.d.ts +5 -4
  101. package/dist/decision-list.js +22 -8
  102. package/dist/decision-list.js.map +1 -1
  103. package/dist/fleet-manager.d.ts +53 -5
  104. package/dist/fleet-manager.js +301 -115
  105. package/dist/fleet-manager.js.map +1 -1
  106. package/dist/fleet-windows-runtime.js +6 -6
  107. package/dist/fleet-windows-runtime.js.map +1 -1
  108. package/dist/general-knowledge/skills/concepts/SKILL.md +32 -4
  109. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +42 -6
  110. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +14 -6
  111. package/dist/general-knowledge/skills/fleet-health/SKILL.md +16 -0
  112. package/dist/general-knowledge/skills/hub/SKILL.md +361 -0
  113. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -1
  114. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +184 -36
  115. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +5 -1
  116. package/dist/general-role.d.ts +1 -1
  117. package/dist/general-role.js +1 -0
  118. package/dist/general-role.js.map +1 -1
  119. package/dist/hub/audit/index.js +12 -5
  120. package/dist/hub/audit/index.js.map +1 -1
  121. package/dist/hub/buttons.d.ts +3 -0
  122. package/dist/hub/buttons.js +11 -11
  123. package/dist/hub/buttons.js.map +1 -1
  124. package/dist/hub/catalog.d.ts +18 -5
  125. package/dist/hub/catalog.js +119 -36
  126. package/dist/hub/catalog.js.map +1 -1
  127. package/dist/hub/client.d.ts +6 -0
  128. package/dist/hub/client.js +6 -1
  129. package/dist/hub/client.js.map +1 -1
  130. package/dist/hub/compose/member.d.ts +2 -0
  131. package/dist/hub/compose/member.js +26 -2
  132. package/dist/hub/compose/member.js.map +1 -1
  133. package/dist/hub/compose/server.d.ts +6 -0
  134. package/dist/hub/compose/server.js +11 -4
  135. package/dist/hub/compose/server.js.map +1 -1
  136. package/dist/hub/directory/directory.d.ts +1 -1
  137. package/dist/hub/directory/directory.js +51 -0
  138. package/dist/hub/directory/directory.js.map +1 -1
  139. package/dist/hub/directory/types.d.ts +14 -0
  140. package/dist/hub/directory/types.js.map +1 -1
  141. package/dist/hub/enrolment-code.d.ts +126 -0
  142. package/dist/hub/enrolment-code.js +266 -0
  143. package/dist/hub/enrolment-code.js.map +1 -0
  144. package/dist/hub/grant-access.d.ts +11 -0
  145. package/dist/hub/grant-access.js +113 -0
  146. package/dist/hub/grant-access.js.map +1 -0
  147. package/dist/hub/grant-search.d.ts +9 -0
  148. package/dist/hub/grant-search.js +92 -0
  149. package/dist/hub/grant-search.js.map +1 -0
  150. package/dist/hub/group-policy/admin-impact.d.ts +2 -0
  151. package/dist/hub/group-policy/admin-impact.js +14 -4
  152. package/dist/hub/group-policy/admin-impact.js.map +1 -1
  153. package/dist/hub/group-policy/admin-inventory.js +7 -7
  154. package/dist/hub/group-policy/admin-inventory.js.map +1 -1
  155. package/dist/hub/group-policy/authorization.d.ts +20 -3
  156. package/dist/hub/group-policy/authorization.js +132 -27
  157. package/dist/hub/group-policy/authorization.js.map +1 -1
  158. package/dist/hub/group-policy/impact-inventory.js +23 -7
  159. package/dist/hub/group-policy/impact-inventory.js.map +1 -1
  160. package/dist/hub/group-policy/resources.d.ts +44 -6
  161. package/dist/hub/group-policy/resources.js +75 -30
  162. package/dist/hub/group-policy/resources.js.map +1 -1
  163. package/dist/hub/group-policy/store.d.ts +24 -3
  164. package/dist/hub/group-policy/store.js +136 -77
  165. package/dist/hub/group-policy/store.js.map +1 -1
  166. package/dist/hub/group-policy/welcome.js.map +1 -1
  167. package/dist/hub/http/compose.js +68 -16
  168. package/dist/hub/http/compose.js.map +1 -1
  169. package/dist/hub/http/core.d.ts +18 -0
  170. package/dist/hub/http/core.js +108 -7
  171. package/dist/hub/http/core.js.map +1 -1
  172. package/dist/hub/http/deps.d.ts +8 -0
  173. package/dist/hub/http/schema.js +11 -0
  174. package/dist/hub/http/schema.js.map +1 -1
  175. package/dist/hub/init/text.js +2 -2
  176. package/dist/hub/init/text.js.map +1 -1
  177. package/dist/hub/init/web.d.ts +7 -0
  178. package/dist/hub/init/web.js +6 -1
  179. package/dist/hub/init/web.js.map +1 -1
  180. package/dist/hub/join/local.d.ts +32 -0
  181. package/dist/hub/join/local.js +98 -10
  182. package/dist/hub/join/local.js.map +1 -1
  183. package/dist/hub/join/receipt.d.ts +1 -0
  184. package/dist/hub/join/receipt.js +1 -1
  185. package/dist/hub/join/receipt.js.map +1 -1
  186. package/dist/hub/join/service.d.ts +94 -6
  187. package/dist/hub/join/service.js +214 -44
  188. package/dist/hub/join/service.js.map +1 -1
  189. package/dist/hub/join/store.d.ts +2 -1
  190. package/dist/hub/join/store.js +7 -7
  191. package/dist/hub/join/store.js.map +1 -1
  192. package/dist/hub/member/exposure-api.d.ts +2 -0
  193. package/dist/hub/member/exposure-api.js +3 -2
  194. package/dist/hub/member/exposure-api.js.map +1 -1
  195. package/dist/hub/member/exposures.d.ts +4 -0
  196. package/dist/hub/member/exposures.js +12 -2
  197. package/dist/hub/member/exposures.js.map +1 -1
  198. package/dist/hub/member/pairing-api.js +4 -1
  199. package/dist/hub/member/pairing-api.js.map +1 -1
  200. package/dist/hub/member/pairing-notices.js +8 -6
  201. package/dist/hub/member/pairing-notices.js.map +1 -1
  202. package/dist/hub/pairing-notices.d.ts +5 -2
  203. package/dist/hub/pairing-notices.js +38 -13
  204. package/dist/hub/pairing-notices.js.map +1 -1
  205. package/dist/hub/pairing.d.ts +10 -2
  206. package/dist/hub/pairing.js +37 -16
  207. package/dist/hub/pairing.js.map +1 -1
  208. package/dist/hub/policy.d.ts +1 -1
  209. package/dist/hub/policy.js +19 -6
  210. package/dist/hub/policy.js.map +1 -1
  211. package/dist/hub/protocol.d.ts +60 -0
  212. package/dist/hub/protocol.js +9 -2
  213. package/dist/hub/protocol.js.map +1 -1
  214. package/dist/hub/quota.d.ts +2 -1
  215. package/dist/hub/quota.js +2 -2
  216. package/dist/hub/quota.js.map +1 -1
  217. package/dist/hub/roles/authority.d.ts +45 -0
  218. package/dist/hub/roles/authority.js +199 -0
  219. package/dist/hub/roles/authority.js.map +1 -0
  220. package/dist/hub/roles/change.d.ts +18 -0
  221. package/dist/hub/roles/change.js +76 -0
  222. package/dist/hub/roles/change.js.map +1 -0
  223. package/dist/hub/roles/convert.d.ts +11 -0
  224. package/dist/hub/roles/convert.js +27 -0
  225. package/dist/hub/roles/convert.js.map +1 -0
  226. package/dist/hub/roles/cutover-inventory.d.ts +14 -0
  227. package/dist/hub/roles/cutover-inventory.js +42 -0
  228. package/dist/hub/roles/cutover-inventory.js.map +1 -0
  229. package/dist/hub/roles/cutover.d.ts +32 -0
  230. package/dist/hub/roles/cutover.js +184 -0
  231. package/dist/hub/roles/cutover.js.map +1 -0
  232. package/dist/hub/roles/delegation.d.ts +24 -0
  233. package/dist/hub/roles/delegation.js +111 -0
  234. package/dist/hub/roles/delegation.js.map +1 -0
  235. package/dist/hub/roles/evaluate.d.ts +50 -0
  236. package/dist/hub/roles/evaluate.js +96 -0
  237. package/dist/hub/roles/evaluate.js.map +1 -0
  238. package/dist/hub/roles/expiry.d.ts +46 -0
  239. package/dist/hub/roles/expiry.js +180 -0
  240. package/dist/hub/roles/expiry.js.map +1 -0
  241. package/dist/hub/roles/mode-effects.d.ts +5 -0
  242. package/dist/hub/roles/mode-effects.js +21 -0
  243. package/dist/hub/roles/mode-effects.js.map +1 -0
  244. package/dist/hub/roles/model.d.ts +171 -0
  245. package/dist/hub/roles/model.js +79 -0
  246. package/dist/hub/roles/model.js.map +1 -0
  247. package/dist/hub/roles/read.d.ts +29 -0
  248. package/dist/hub/roles/read.js +47 -0
  249. package/dist/hub/roles/read.js.map +1 -0
  250. package/dist/hub/roles/writer.d.ts +80 -0
  251. package/dist/hub/roles/writer.js +427 -0
  252. package/dist/hub/roles/writer.js.map +1 -0
  253. package/dist/hub/rooms.d.ts +8 -0
  254. package/dist/hub/rooms.js +47 -27
  255. package/dist/hub/rooms.js.map +1 -1
  256. package/dist/hub/server.d.ts +3 -0
  257. package/dist/hub/server.js +18 -2
  258. package/dist/hub/server.js.map +1 -1
  259. package/dist/hub/sessions.js +5 -1
  260. package/dist/hub/sessions.js.map +1 -1
  261. package/dist/hub/settings-directory-decision.d.ts +2 -2
  262. package/dist/hub/settings-directory-decision.js +7 -5
  263. package/dist/hub/settings-directory-decision.js.map +1 -1
  264. package/dist/hub/settings-directory-proof.js +3 -1
  265. package/dist/hub/settings-directory-proof.js.map +1 -1
  266. package/dist/hub/settings-directory-recovery.js +3 -3
  267. package/dist/hub/settings-directory-recovery.js.map +1 -1
  268. package/dist/hub/sharing.d.ts +10 -0
  269. package/dist/hub/sharing.js +74 -0
  270. package/dist/hub/sharing.js.map +1 -0
  271. package/dist/hub/store.js +6 -2
  272. package/dist/hub/store.js.map +1 -1
  273. package/dist/hub/types.d.ts +29 -5
  274. package/dist/hub/web-origin.d.ts +80 -0
  275. package/dist/hub/web-origin.js +163 -0
  276. package/dist/hub/web-origin.js.map +1 -0
  277. package/dist/hub-pairing-summary.js +1 -1
  278. package/dist/hub-pairing-summary.js.map +1 -1
  279. package/dist/human-delivery-receipts.js +2 -2
  280. package/dist/human-delivery-receipts.js.map +1 -1
  281. package/dist/instance-config-impact.js +4 -0
  282. package/dist/instance-config-impact.js.map +1 -1
  283. package/dist/instance-lifecycle.d.ts +13 -1
  284. package/dist/instance-lifecycle.js +36 -10
  285. package/dist/instance-lifecycle.js.map +1 -1
  286. package/dist/instructions.d.ts +8 -2
  287. package/dist/instructions.js +28 -6
  288. package/dist/instructions.js.map +1 -1
  289. package/dist/locale.js +12 -8
  290. package/dist/locale.js.map +1 -1
  291. package/dist/log-service.d.ts +62 -6
  292. package/dist/log-service.js +135 -28
  293. package/dist/log-service.js.map +1 -1
  294. package/dist/log-steps-agy-grok.d.ts +74 -0
  295. package/dist/log-steps-agy-grok.js +440 -0
  296. package/dist/log-steps-agy-grok.js.map +1 -0
  297. package/dist/log-steps.d.ts +62 -3
  298. package/dist/log-steps.js +188 -22
  299. package/dist/log-steps.js.map +1 -1
  300. package/dist/log-transcript-paths.d.ts +29 -0
  301. package/dist/log-transcript-paths.js +109 -0
  302. package/dist/log-transcript-paths.js.map +1 -0
  303. package/dist/login-controller.d.ts +17 -3
  304. package/dist/login-controller.js +57 -5
  305. package/dist/login-controller.js.map +1 -1
  306. package/dist/login-flows.d.ts +24 -2
  307. package/dist/login-flows.js +53 -22
  308. package/dist/login-flows.js.map +1 -1
  309. package/dist/login-url.js +3 -0
  310. package/dist/login-url.js.map +1 -1
  311. package/dist/login-window-lock.d.ts +20 -8
  312. package/dist/login-window-lock.js +35 -16
  313. package/dist/login-window-lock.js.map +1 -1
  314. package/dist/machine-accounts.d.ts +42 -12
  315. package/dist/machine-accounts.js +144 -46
  316. package/dist/machine-accounts.js.map +1 -1
  317. package/dist/machine-signins.d.ts +35 -13
  318. package/dist/machine-signins.js +57 -27
  319. package/dist/machine-signins.js.map +1 -1
  320. package/dist/native-instance-input.js +4 -4
  321. package/dist/native-instance-input.js.map +1 -1
  322. package/dist/native-instance-registry.d.ts +3 -3
  323. package/dist/native-instance-registry.js +11 -10
  324. package/dist/native-instance-registry.js.map +1 -1
  325. package/dist/outbound-handlers.d.ts +14 -0
  326. package/dist/outbound-handlers.js +68 -20
  327. package/dist/outbound-handlers.js.map +1 -1
  328. package/dist/outbound-schemas.d.ts +18 -0
  329. package/dist/outbound-schemas.js +22 -4
  330. package/dist/outbound-schemas.js.map +1 -1
  331. package/dist/profile-signins.d.ts +7 -0
  332. package/dist/profile-signins.js +2 -1
  333. package/dist/profile-signins.js.map +1 -1
  334. package/dist/runtime-build-info.js +6 -2
  335. package/dist/runtime-build-info.js.map +1 -1
  336. package/dist/runtime-cli.js +33 -11
  337. package/dist/runtime-cli.js.map +1 -1
  338. package/dist/runtime-client.d.ts +18 -2
  339. package/dist/runtime-client.js +84 -21
  340. package/dist/runtime-client.js.map +1 -1
  341. package/dist/runtime-credential-profiles.d.ts +36 -4
  342. package/dist/runtime-credential-profiles.js +82 -16
  343. package/dist/runtime-credential-profiles.js.map +1 -1
  344. package/dist/runtime-profile-ownership.d.ts +2 -2
  345. package/dist/runtime-profile-ownership.js +3 -3
  346. package/dist/runtime-profile-ownership.js.map +1 -1
  347. package/dist/runtime-protocol.d.ts +5 -3
  348. package/dist/runtime-protocol.js +4 -0
  349. package/dist/runtime-protocol.js.map +1 -1
  350. package/dist/runtime-remote-accounts.d.ts +72 -5
  351. package/dist/runtime-remote-accounts.js +293 -52
  352. package/dist/runtime-remote-accounts.js.map +1 -1
  353. package/dist/runtime-remote-setup.d.ts +2 -2
  354. package/dist/runtime-remote-setup.js +2 -2
  355. package/dist/runtime-remote-setup.js.map +1 -1
  356. package/dist/runtime-signin-transport.d.ts +22 -4
  357. package/dist/runtime-signin-transport.js +50 -12
  358. package/dist/runtime-signin-transport.js.map +1 -1
  359. package/dist/runtime-signin.d.ts +42 -0
  360. package/dist/runtime-signin.js +105 -9
  361. package/dist/runtime-signin.js.map +1 -1
  362. package/dist/runtime-windows-bridge.js +6 -1
  363. package/dist/runtime-windows-bridge.js.map +1 -1
  364. package/dist/scheduler/task-board.d.ts +1 -0
  365. package/dist/scheduler/task-board.js +10 -1
  366. package/dist/scheduler/task-board.js.map +1 -1
  367. package/dist/settings-api.d.ts +34 -0
  368. package/dist/settings-api.js +184 -6
  369. package/dist/settings-api.js.map +1 -1
  370. package/dist/settings-change.js +38 -1
  371. package/dist/settings-change.js.map +1 -1
  372. package/dist/settings-effect.js +14 -0
  373. package/dist/settings-effect.js.map +1 -1
  374. package/dist/signin-keepalive.d.ts +31 -2
  375. package/dist/signin-keepalive.js +123 -12
  376. package/dist/signin-keepalive.js.map +1 -1
  377. package/dist/structured-signin-transport.d.ts +2 -2
  378. package/dist/structured-signin-transport.js +27 -6
  379. package/dist/structured-signin-transport.js.map +1 -1
  380. package/dist/structured-signin.d.ts +16 -2
  381. package/dist/structured-signin.js +59 -4
  382. package/dist/structured-signin.js.map +1 -1
  383. package/dist/task-board-tool.d.ts +0 -13
  384. package/dist/task-board-tool.js +42 -6
  385. package/dist/task-board-tool.js.map +1 -1
  386. package/dist/tool-progress.d.ts +7 -0
  387. package/dist/tool-progress.js +21 -9
  388. package/dist/tool-progress.js.map +1 -1
  389. package/dist/tool-receipt-output.d.ts +151 -0
  390. package/dist/tool-receipt-output.js +50 -0
  391. package/dist/tool-receipt-output.js.map +1 -0
  392. package/dist/types.d.ts +13 -0
  393. package/dist/ui/accounts-keepalive.js +15 -6
  394. package/dist/ui/accounts-manage.js +25 -5
  395. package/dist/ui/accounts-view.js +40 -26
  396. package/dist/ui/agent-details-settings.js +2 -2
  397. package/dist/ui/agent-page-strings.js +2 -2
  398. package/dist/ui/agent-proposals.js +22 -2
  399. package/dist/ui/agent-runtime-settings.js +3 -3
  400. package/dist/ui/backend-signin.js +49 -16
  401. package/dist/ui/chat-activity-groups.js +225 -0
  402. package/dist/ui/chat-activity.js +355 -0
  403. package/dist/ui/chat-popout-header.js +35 -0
  404. package/dist/ui/chat-popout-transport.js +80 -0
  405. package/dist/ui/chat-popout.js +63 -0
  406. package/dist/ui/chat-quote.js +3 -1
  407. package/dist/ui/chat-store.js +45 -4
  408. package/dist/ui/chat-workspace-gestures.js +177 -0
  409. package/dist/ui/chat-workspace-navigation.js +34 -10
  410. package/dist/ui/chat-workspace.js +96 -32
  411. package/dist/ui/cli-caps.js +7 -7
  412. package/dist/ui/credential-profile-select.js +32 -19
  413. package/dist/ui/host-install.js +2 -2
  414. package/dist/ui/hub-agent-copy.js +7 -7
  415. package/dist/ui/hub-chat-store.js +8 -4
  416. package/dist/ui/hub-chat-strings.js +3 -3
  417. package/dist/ui/hub-client.js +113 -18
  418. package/dist/ui/hub-company-join-strings.js +12 -10
  419. package/dist/ui/hub-company-join.js +52 -39
  420. package/dist/ui/hub-confirm-place.js +44 -0
  421. package/dist/ui/hub-directory-editor-strings.js +3 -3
  422. package/dist/ui/hub-directory-notice-strings.js +1 -1
  423. package/dist/ui/hub-enrolment-code-strings.js +44 -0
  424. package/dist/ui/hub-enrolment-code.js +159 -0
  425. package/dist/ui/hub-grant-picker.js +100 -0
  426. package/dist/ui/hub-group-search.js +82 -0
  427. package/dist/ui/hub-group-strings.js +8 -8
  428. package/dist/ui/hub-join-approval.js +31 -0
  429. package/dist/ui/hub-join-code-input.js +66 -0
  430. package/dist/ui/hub-join-one-strings.js +2 -2
  431. package/dist/ui/hub-join-queue.js +62 -0
  432. package/dist/ui/hub-join-steps.js +234 -0
  433. package/dist/ui/hub-joincode-flow-strings.js +22 -0
  434. package/dist/ui/hub-owner-strings.js +9 -9
  435. package/dist/ui/hub-pairing-progress-strings.js +1 -1
  436. package/dist/ui/hub-quick-pairing.js +8 -4
  437. package/dist/ui/hub-quick-strings.js +11 -11
  438. package/dist/ui/hub-share-refused.js +17 -0
  439. package/dist/ui/hub-strings.js +61 -61
  440. package/dist/ui/hub-this-hub.js +2 -2
  441. package/dist/ui/hub-welcome.js +26 -5
  442. package/dist/ui/image-annotate.js +283 -0
  443. package/dist/ui/image-lightbox.js +26 -6
  444. package/dist/ui/log-row.js +327 -0
  445. package/dist/ui/machine-signin.js +47 -14
  446. package/dist/ui/panel-chat.js +151 -12
  447. package/dist/ui/panel-details.js +14 -6
  448. package/dist/ui/panel-fleet.js +2 -2
  449. package/dist/ui/panel-hub.js +94 -21
  450. package/dist/ui/panel-log.js +9 -154
  451. package/dist/ui/panel-settings.js +50 -13
  452. package/dist/ui/search-dialog.js +1 -0
  453. package/dist/ui/settings-access-overview.js +1 -1
  454. package/dist/ui/settings-hub-browser-certificate.js +3 -3
  455. package/dist/ui/settings-hub-company-join.js +42 -30
  456. package/dist/ui/settings-hub-connection.js +8 -5
  457. package/dist/ui/settings-hub-membership.js +3 -3
  458. package/dist/ui/settings-hub-section.js +3 -1
  459. package/dist/ui/settings-hub-setup-strings.js +6 -6
  460. package/dist/ui/settings-hub-setup.js +44 -6
  461. package/dist/ui/settings-hub-web-address.js +233 -0
  462. package/dist/ui/settings-hub.js +41 -10
  463. package/dist/ui/settings-layout.js +6 -4
  464. package/dist/ui/settings-public-session-strings.js +37 -0
  465. package/dist/ui/settings-registry.js +4 -0
  466. package/dist/ui/settings-strings.js +2 -2
  467. package/dist/ui/shared/accounts-keepalive.css +8 -0
  468. package/dist/ui/shared/accounts-usage-pool.css +10 -0
  469. package/dist/ui/shared/accounts.css +9 -0
  470. package/dist/ui/shared/app-shell.js +16 -10
  471. package/dist/ui/shared/app.css +233 -35
  472. package/dist/ui/shared/app.js +8 -1
  473. package/dist/ui/shared/chat-render.js +11 -2
  474. package/dist/ui/shared/chat-thread.js +20 -3
  475. package/dist/ui/shared/chat-work-bar.css +7 -0
  476. package/dist/ui/shared/chat-workspace-model.js +39 -9
  477. package/dist/ui/shared/hub-grant-picker.css +4 -0
  478. package/dist/ui/shared/hub-owner.css +8 -0
  479. package/dist/ui/shared/hub-sharing.css +4 -0
  480. package/dist/ui/shared/identity-color.js +9 -3
  481. package/dist/ui/shared/image-annotate.css +45 -0
  482. package/dist/ui/shared/instance-nav.js +59 -22
  483. package/dist/ui/shared/pane-geometry.js +29 -0
  484. package/dist/ui/shared/signin.js +2 -2
  485. package/dist/ui/shared/tokens.css +14 -0
  486. package/dist/ui/shared/ui-menu.js +22 -7
  487. package/dist/ui/shared/view-strings.js +2 -2
  488. package/dist/ui/signin.html +1 -1
  489. package/dist/ui/structured-signin.js +29 -9
  490. package/dist/ui/usage-pool.js +76 -0
  491. package/dist/usage/agent-output.d.ts +144 -0
  492. package/dist/usage/agent-output.js +75 -0
  493. package/dist/usage/agent-output.js.map +1 -0
  494. package/dist/usage/provider-alerts.d.ts +6 -0
  495. package/dist/usage/provider-alerts.js +6 -0
  496. package/dist/usage/provider-alerts.js.map +1 -1
  497. package/dist/usage/providers.d.ts +2 -2
  498. package/dist/usage/providers.js +60 -18
  499. package/dist/usage/providers.js.map +1 -1
  500. package/dist/usage/usage-api.d.ts +12 -0
  501. package/dist/usage/usage-api.js +39 -0
  502. package/dist/usage/usage-api.js.map +1 -1
  503. package/dist/web-api.d.ts +3 -0
  504. package/dist/web-api.js +61 -16
  505. package/dist/web-api.js.map +1 -1
  506. package/dist/web-backend-login.d.ts +13 -4
  507. package/dist/web-backend-login.js +7 -4
  508. package/dist/web-backend-login.js.map +1 -1
  509. package/dist/web-chat-history.d.ts +11 -0
  510. package/dist/web-chat-history.js +9 -1
  511. package/dist/web-chat-history.js.map +1 -1
  512. package/dist/web-guest-access.js +2 -2
  513. package/dist/web-guest-access.js.map +1 -1
  514. package/dist/web-session.d.ts +31 -3
  515. package/dist/web-session.js +25 -4
  516. package/dist/web-session.js.map +1 -1
  517. package/dist/web-settings-patch.d.ts +8 -2
  518. package/dist/web-settings-patch.js +22 -10
  519. package/dist/web-settings-patch.js.map +1 -1
  520. package/dist/windows-cli-providers.js +5 -1
  521. package/dist/windows-cli-providers.js.map +1 -1
  522. package/dist/windows-cli-worker.d.ts +33 -1
  523. package/dist/windows-cli-worker.js +150 -10
  524. package/dist/windows-cli-worker.js.map +1 -1
  525. package/dist/windows-cli.d.ts +7 -1
  526. package/dist/windows-cli.js +19 -2
  527. package/dist/windows-cli.js.map +1 -1
  528. package/dist/workflow-templates/default.md +2 -2
  529. package/package.json +1 -1
@@ -755,7 +755,7 @@ export function createThread(list, scroller, opts) {
755
755
  const stick = pinned || nearBottom();
756
756
  msgs = next || [];
757
757
  if (!msgs.length) {
758
- for (const v of nodes.values()) stopIn(v.node);
758
+ for (const v of nodes.values()) { stopIn(v.node); v.handle?.unmount(); }
759
759
  nodes.clear();
760
760
  firstKey = null;
761
761
  armDay();
@@ -778,13 +778,29 @@ export function createThread(list, scroller, opts) {
778
778
  }
779
779
  /** Put the messages from startIndex() on in the list (nodes reused when unchanged). Returns how many are new. */
780
780
  function draw(drawOpts) {
781
- const shown = msgs.slice(startIndex());
781
+ // AGEND-181: activity rows (a turn's thinking and tool steps above its reply) are drawn only when the page gave a
782
+ // way to (opts.activity) — never part of a message: not copied, replied to, counted as unread or reached by ↑/↓.
783
+ const shown = msgs.slice(startIndex()).filter((x) => x.role !== "activity" || opts.activity);
782
784
  const keep = new Set(shown.map(msgKey));
783
- for (const [k, v] of nodes) if (!keep.has(k)) { stopIn(v.node); v.node.remove(); nodes.delete(k); }
785
+ for (const [k, v] of nodes) if (!keep.has(k)) { stopIn(v.node); v.handle?.unmount(); v.node.remove(); nodes.delete(k); }
784
786
  let prev = null, added = 0;
785
787
  for (const x of shown) {
786
788
  const key = msgKey(x);
787
789
  let have = nodes.get(key);
790
+ if (x.role === "activity") {
791
+ // One node for the life of the group (a live turn, then the reply it becomes): its island is updated in place,
792
+ // so what the reader opened stays open and nothing remounts or jumps.
793
+ if (!have) {
794
+ const node = list.ownerDocument.createElement("div");
795
+ node.className = "activity-row";
796
+ have = { html: "activity", node, x, handle: opts.activity.mount(node, x.group) };
797
+ nodes.set(key, have);
798
+ } else if (have.x !== x) { have.x = x; have.handle.update(x.group); }
799
+ const want = prev ? prev.nextSibling : list.firstChild;
800
+ if (have.node !== want) list.insertBefore(have.node, want);
801
+ prev = have.node;
802
+ continue;
803
+ }
788
804
  // Filling in older messages: a node drawn from this very message object is current — not drawn again.
789
805
  if (drawOpts.older && have && have.x === x) { prev = have.node; continue; }
790
806
  const html = msgHtml(x);
@@ -960,6 +976,7 @@ export function createThread(list, scroller, opts) {
960
976
  if (!parked) watchReader(scroller, false);
961
977
  if (ro) ro.disconnect();
962
978
  if (P()) { if (own) P().stopIn(list); else P().stopAll("leave"); }
979
+ for (const v of nodes.values()) v.handle?.unmount();
963
980
  nodes.clear();
964
981
  armDay();
965
982
  armPolls();
@@ -3,3 +3,10 @@
3
3
  app.css, which has no rule for it — on a phone that Stop was 40×30, under the 44 px tap target. */
4
4
  .work-bar .btn-stop { flex: none; margin-left: auto; }
5
5
  @media (max-width: 899px), (pointer: coarse) { .work-bar .btn-stop { min-height: var(--tap, 44px); min-width: var(--tap, 44px); } }
6
+ /* #3724: one height in every state (idle included: the strip stays, empty), so the thread and the composer never move when the
7
+ agent starts, stops or waits. The height is the Stop button's (desktop: btn-sm's 30 px; phone / touch: the 44 px tap target).
8
+ The status text keeps to one line, cut with an ellipsis; the timer and Stop never shrink. */
9
+ .work-bar { box-sizing: border-box; block-size: 30px; min-block-size: 30px; max-block-size: 30px; overflow: hidden; }
10
+ .work-bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
11
+ .work-bar .elapsed, .work-bar .pulse { flex: none; }
12
+ @media (max-width: 899px), (pointer: coarse) { .work-bar { block-size: var(--tap, 44px); min-block-size: var(--tap, 44px); max-block-size: var(--tap, 44px); } }
@@ -3,13 +3,17 @@ import { isSafeInstanceName, parseRoute, routePath } from "./app-route.js";
3
3
 
4
4
  export const PANE_VIEWS = Object.freeze(["chat", "view", "log", "details"]);
5
5
  const categories = new Set(["overview", "basic", "runtime", "work", "channel", "adv"]);
6
- const keys = ["compare", "paneA", "paneB", "layout", "focus", "ratio", "swap", "catA", "catB", "messageA", "messageB"];
6
+ const keys = ["compare", "paneA", "paneB", "layout", "focus", "ratio", "swap", "catA", "catB", "messageA", "messageB", "floatPane", "floatX", "floatY", "floatW", "floatH"];
7
7
  export const agentRoute = route => !!route && PANE_VIEWS.includes(route.panel) && isSafeInstanceName(route.instance);
8
8
  const category = (route, search) => route.panel === "details" && categories.has(new URLSearchParams(search).get("cat"))
9
9
  ? new URLSearchParams(search).get("cat") : "";
10
10
  const cleanSearch = (route, search) => { const cat = category(route, search); return cat ? `?cat=${cat}` : ""; };
11
11
  const cleanHash = hash => /^#m=[0-9a-f]{1,32}-\d{1,15}$/.test(hash || "") ? hash : "";
12
- const boundedRatio = value => Number.isFinite(Number(value)) ? Math.max(.1, Math.min(.9, Number(value))) : .5;
12
+ // Physical pane minimums live in pane-geometry; a second percentage minimum breaks ultra-wide displays.
13
+ const boundedRatio = value => Number.isFinite(Number(value)) ? Math.max(0, Math.min(1, Number(value))) : .5;
14
+ const layouts = ["right", "stack", "float"];
15
+ const cleanRect = value => value && ["x", "y", "width", "height"].every(key => typeof value[key] === "number" && Number.isFinite(value[key]) && value[key] >= 0 && value[key] <= 100000)
16
+ && value.width >= 420 && value.height >= 360 ? { x: value.x, y: value.y, width: value.width, height: value.height } : null;
13
17
  function pane(route, search = "", hash = "", prior) {
14
18
  search = cleanSearch(route, search); hash = cleanHash(hash);
15
19
  if (prior && prior.route.panel === route.panel && prior.route.instance === route.instance && prior.search === search && prior.hash === hash) return prior;
@@ -17,23 +21,33 @@ function pane(route, search = "", hash = "", prior) {
17
21
  }
18
22
 
19
23
  /** An explicit compare link is the only URL that restores two panes. An ordinary deep link stays single. */
20
- export function readWorkspace(url, previous = null) {
24
+ export function readWorkspace(url, previous = null, allowFloat = false) {
21
25
  const route = parseRoute(url.pathname), q = url.searchParams;
22
26
  if (!agentRoute(route) || !q.has("compare") || keys.some(key => q.getAll(key).length > 1)) return null;
23
27
  const second = q.get("compare"), aView = q.get("paneA") || route.panel, bView = q.get("paneB") || "chat";
24
28
  if (!isSafeInstanceName(second) || second === route.instance || !PANE_VIEWS.includes(aView) || !PANE_VIEWS.includes(bView)) return null;
25
- if (q.has("layout") && !["right", "stack"].includes(q.get("layout"))) return null;
29
+ if (q.has("layout") && !layouts.includes(q.get("layout"))) return null;
30
+ if (q.get("layout") === "float" && !allowFloat) return null; // retained adapters/hosts have no floating geometry
26
31
  if (q.has("focus") && !["a", "b"].includes(q.get("focus"))) return null;
32
+ if (q.has("floatPane") && !["a", "b"].includes(q.get("floatPane"))) return null;
33
+ const boxKeys = ["floatX", "floatY", "floatW", "floatH"];
34
+ const rect = boxKeys.some(key => q.has(key)) ? cleanRect(Object.fromEntries(["x", "y", "width", "height"].map((key, i) => [key, q.has(boxKeys[i]) ? Number(q.get(boxKeys[i])) : NaN]))) : null;
35
+ if (boxKeys.some(key => q.has(key)) && !rect) return null;
27
36
  const a = { panel: aView, instance: route.instance }, b = { panel: bView, instance: second };
28
37
  return { a: pane(a, q.has("catA") ? `?cat=${q.get("catA")}` : url.search, q.get("messageA") ? `#m=${q.get("messageA")}` : url.hash, previous?.a),
29
38
  b: pane(b, q.has("catB") ? `?cat=${q.get("catB")}` : "", q.get("messageB") ? `#m=${q.get("messageB")}` : "", previous?.b),
30
39
  focus: q.get("focus") || "b", layout: q.get("layout") || "right", ratio: q.has("ratio") ? boundedRatio(q.get("ratio")) : .5,
31
- flipped: q.get("swap") === "1" };
40
+ flipped: q.get("swap") === "1", ...(q.get("layout") === "float" ? { floating: q.get("floatPane") || "b", rect } : {}) };
32
41
  }
33
42
  export function workspacePath(w) {
34
43
  const q = new URLSearchParams({ compare: w.b.route.instance, paneB: w.b.route.panel, layout: w.layout, focus: w.focus });
35
44
  if (w.ratio !== .5) q.set("ratio", String(w.ratio));
36
45
  if (w.flipped) q.set("swap", "1");
46
+ if (w.layout === "float") {
47
+ q.set("floatPane", w.floating === "a" ? "a" : "b");
48
+ const rect = cleanRect(w.rect);
49
+ if (rect) for (const [key, value] of Object.entries(rect)) q.set({ x: "floatX", y: "floatY", width: "floatW", height: "floatH" }[key], String(value));
50
+ }
37
51
  for (const id of ["a", "b"]) {
38
52
  const suffix = id.toUpperCase(), p = w[id], cat = category(p.route, p.search);
39
53
  if (cat) q.set(`cat${suffix}`, cat);
@@ -60,17 +74,33 @@ export function navigatePane(w, id, url) {
60
74
  return { ...w, [id]: pane(route, url.search, url.hash, w[id]), focus: id };
61
75
  }
62
76
  export function twoPaneFits(viewport, width, height, layout) {
63
- return viewport >= 1200 && width >= 760 && (layout !== "stack" || height >= 648);
77
+ return viewport >= 1200 && width >= 760 && (layout !== "stack" || height >= 648) && (layout !== "float" || height >= 368);
64
78
  }
65
79
  /** This schema intentionally cannot carry credentials, request bodies, drafts, anchors or arbitrary query strings. */
66
80
  export function saveWorkspace(w) {
67
81
  const saved = id => ({ instance: w[id].route.instance, panel: w[id].route.panel, category: category(w[id].route, w[id].search) });
68
- return { v: 1, a: saved("a"), b: saved("b"), focus: w.focus, layout: w.layout, ratio: w.ratio, flipped: w.flipped };
82
+ return { v: 1, a: saved("a"), b: saved("b"), focus: w.focus, layout: w.layout, ratio: w.ratio, flipped: w.flipped,
83
+ ...(w.layout === "float" ? { floating: w.floating === "a" ? "a" : "b", rect: cleanRect(w.rect) } : {}) };
69
84
  }
70
85
  export function restoreWorkspace(saved) {
71
86
  if (!saved || saved.v !== 1 || !agentRoute(saved.a) || !agentRoute(saved.b) || saved.a.instance === saved.b.instance
72
- || !["a", "b"].includes(saved.focus) || !["right", "stack"].includes(saved.layout)) return null;
87
+ || !["a", "b"].includes(saved.focus) || !layouts.includes(saved.layout)) return null;
73
88
  const from = p => pane(p, categories.has(p.category) ? `?cat=${p.category}` : "");
74
89
  return { a: from(saved.a), b: from(saved.b), focus: saved.focus, layout: saved.layout,
75
- ratio: boundedRatio(saved.ratio), flipped: saved.flipped === true };
90
+ ratio: boundedRatio(saved.ratio), flipped: saved.flipped === true,
91
+ ...(saved.layout === "float" ? { floating: saved.floating === "a" ? "a" : "b", rect: cleanRect(saved.rect) } : {}) };
92
+ }
93
+
94
+ /** A drop changes topology through the same router/guards; never duplicates an existing agent or changes its pane lease. */
95
+ export function dockWorkspace(w, target, zone, name) {
96
+ if (!w || !["a", "b"].includes(target) || !["left", "right", "top", "bottom", "center"].includes(zone) || !isSafeInstanceName(name)) return w;
97
+ const source = ["a", "b"].find(id => w[id].route.instance === name);
98
+ if (zone === "center" && source) return source === target ? w : { ...w, focus: source,
99
+ ...(w.layout === "float" ? { floating: w.floating === "a" ? "b" : "a" } : { flipped: !w.flipped }) };
100
+ const id = source || target;
101
+ const next = source ? w : { ...w, [id]: pane({ panel: "chat", instance: name }, "", "", w[id]) };
102
+ if (zone === "center") return { ...next, focus: id };
103
+ const { floating, rect, ...docked } = next;
104
+ return { ...docked, focus: id, layout: ["left", "right"].includes(zone) ? "right" : "stack", ratio: .5,
105
+ flipped: ["left", "top"].includes(zone) ? id === "b" : id === "a" };
76
106
  }
@@ -0,0 +1,4 @@
1
+ /* Loaded by the lazy picker, including tabs retaining an older app.css. */
2
+ @media (max-width: 899px), (pointer: coarse) {
3
+ .hub-grant[data-grant-picker] :is(input, select) { min-width: var(--tap); min-height: var(--tap); font-size: var(--fs-md); }
4
+ }
@@ -28,6 +28,14 @@
28
28
  .hub-steps > li.done::before { content: "✓"; background: var(--ok-bg, var(--surface)); color: var(--ok); }
29
29
  .hub-steps > li.now::before { background: var(--text); color: var(--bg); }
30
30
  .hub-step-body > span { display: flex; flex-direction: column; gap: 2px; }
31
+ /* Hub UX U2 (M-2932): 「讓同仁加入」 — the done mark beside its step's title; each group's row (its Fleet limit inline); the search hits. */
32
+ .hub-join-steps .hub-step-body > span > b .tag { margin-inline-start: var(--s-2); vertical-align: middle; }
33
+ .hub-join-step2, .hub-join-groups, .hub-group-search, .hub-group-hits { width: 100%; }
34
+ .hub-join-groups, .hub-group-hits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
35
+ .hub-join-groups > .s-row, .hub-group-hits > .s-row { flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
36
+ .hub-join-groups .hub-row-text, .hub-group-hits .hub-row-text { flex: 1 1 12em; min-width: 0; }
37
+ .hub-join-fleets { flex-direction: row; align-items: center; gap: var(--s-2); margin: 0; }
38
+ .hub-join-fleets input { width: 4.5em; }
31
39
  .hub-step-form { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; width: 100%; }
32
40
  .hub-step-form .field { margin: 0; flex: 1 1 14em; min-width: 14em; } /* a phone: the button wraps under the field, never squeezing it */
33
41
  .hub-steps .hub-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; margin: 0; padding: 0; }
@@ -0,0 +1,4 @@
1
+ /* Loaded with the resumable-sharing renderer, including tabs retaining an older shell stylesheet. */
2
+ @media (max-width: 899px), (pointer: coarse) {
3
+ .hub-owner .btn, .hub-owner .icon-btn { min-height: 44px; min-width: 44px; }
4
+ }
@@ -67,8 +67,8 @@ export function contrast(a, b) {
67
67
  * The shade of `hex` name text uses: itself if readable, else the nearest step toward black (light) or white (dark).
68
68
  * `page` (#2196): an agent's colours on the page now — names must read on its background and sidebar instead.
69
69
  */
70
- export function readableShade(hex, mode, page = null) {
71
- const backgrounds = page ? [page.bg, page.sidebar] : BG[mode], text = page ? page.text : TEXT[mode];
70
+ export function readableShade(hex, mode, page = null, extra = []) {
71
+ const backgrounds = [...(page ? [page.bg, page.sidebar] : BG[mode]), ...extra], text = page ? page.text : TEXT[mode];
72
72
  if (!HEX.test(hex)) return text;
73
73
  const toward = mode === "light" ? 0 : 255;
74
74
  const ch = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16));
@@ -137,9 +137,15 @@ export function identityOf(it, opts = {}) {
137
137
  const c = resolveColor(it && it.color, showThemes);
138
138
  const p = resolvePlaces(it && it.color_show, showThemes, opts.hostDefault ?? defaultPlaces());
139
139
  const light = colorValue(c.color, "light"), dark = colorValue(c.color, "dark");
140
+ const page = pageNow("light");
141
+ // Sidebar text also sits on selected/hovered rows and the strongest fresh-reply tint. Keep the existing dark
142
+ // shades and non-sidebar consumers unchanged. Mixing toward black changes brightness without changing hue.
143
+ const mix = (a, b, amount) => `#${[1, 3, 5].map(i => Math.round(parseInt(a.slice(i, i + 2), 16) * (1 - amount) + parseInt(b.slice(i, i + 2), 16) * amount).toString(16).padStart(2, "0")).join("")}`;
144
+ const rowBackgrounds = opts.sidebar ? [page ? mix(page.surface, page.text, .08) : "#ececec",
145
+ mix(page?.sidebar || "#f9f9f9", page?.accent || "#0a62c2", .22)] : [];
140
146
  return {
141
147
  color: c.color, source: c.source, show: p.show, showSource: p.source, off: opts.off ?? colorsOff(),
142
- light, dark, nameLight: readableShade(light, "light", pageNow("light")), nameDark: readableShade(dark, "dark", pageNow("dark")),
148
+ light, dark, nameLight: readableShade(light, "light", page, rowBackgrounds), nameDark: readableShade(dark, "dark", pageNow("dark")),
143
149
  };
144
150
  }
145
151
  /** The row's classes for its identity colour ("" when colours are off or shown nowhere). */
@@ -0,0 +1,45 @@
1
+ /* #3727 (M-2973): the image viewer's annotation editor (image-annotate.js), inside the viewer's dark dialog. Linked by its
2
+ module (an older app.css lacks it). Classes only (#1300). */
3
+ .lb .an { position: absolute; inset: 0; display: flex; flex-direction: column; color: var(--media-ink); }
4
+ .lb .an-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); background: var(--media-bar); }
5
+ .lb .an-name { flex: 1 1 8em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
6
+ .lb .an-tools, .lb .an-colours, .lb .an-history { display: inline-flex; align-items: center; gap: 4px; }
7
+ .lb .an .btn { color: var(--media-ink); background: var(--media-btn); border-color: var(--media-line); min-width: 36px; min-height: 36px; justify-content: center; }
8
+ .lb .an .btn:disabled { opacity: 0.45; }
9
+ .lb .an .btn:not(.btn-primary):hover, .lb .an .btn:not(.btn-primary):focus-visible { color: var(--media-ink); background: var(--media-btn-on); }
10
+ .lb .an .an-tool.on { background: var(--media-btn-on); border-color: var(--media-ink); }
11
+ .lb .an .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
12
+ .lb .an-glyph { font-size: 1.1em; line-height: 1; }
13
+ /* A swatch: a button (36 px; 44 px on touch) holding its colour disc. */
14
+ .lb .an-colour { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%;
15
+ background: transparent; cursor: pointer; }
16
+ .lb .an-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--media-line); box-sizing: border-box; }
17
+ .lb .an-colour.on .an-dot { border-color: var(--media-ink); outline: 2px solid var(--media-ink); outline-offset: 2px; }
18
+ .lb .an-colour:focus-visible { outline: 2px solid var(--media-ink); outline-offset: 1px; }
19
+ .lb .an-colour-red { background: var(--mark-red); }
20
+ .lb .an-colour-yellow { background: var(--mark-yellow); }
21
+ .lb .an-colour-blue { background: var(--mark-blue); }
22
+ .lb .an-colour-white { background: var(--mark-white); }
23
+ .lb .an-close { margin-left: auto; }
24
+ .lb .an-text { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); background: var(--media-panel); }
25
+ .lb .an-text-label { flex: 1; display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); }
26
+ .lb .an-text input { flex: 1; min-width: 0; color: var(--media-ink); background: var(--media-btn); border: 1px solid var(--media-line); border-radius: 6px; padding: 6px 8px; font: inherit; }
27
+ .lb .an-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: var(--s-3); box-sizing: border-box; overflow: hidden; }
28
+ /* The canvas keeps its own pixel size and is shown fitted; drawing maps the pointer back to canvas pixels. */
29
+ .lb .an-canvas { max-width: 100%; max-height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
30
+ .lb .an-cursor-pen, .lb .an-cursor-box, .lb .an-cursor-arrow { cursor: crosshair; }
31
+ .lb .an-cursor-text { cursor: text; }
32
+ .lb .an-note { opacity: 0.85; }
33
+ .lb .an-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom, 0px)); background: var(--media-bar); }
34
+ @media (max-width: 480px) {
35
+ /* The title and ✕ on the first row; the tools wrap below. */
36
+ .lb .an-name { order: -2; flex: 1 1 0; }
37
+ .lb .an-close { order: -1; margin-left: 0; }
38
+ .lb .an-bar > :not(.an-name):not(.an-close) { order: 0; }
39
+ .lb .an-tools { flex-basis: 100%; }
40
+ .lb .an-actions .btn { flex: 1; }
41
+ }
42
+ @media (pointer: coarse) {
43
+ .lb .an .btn, .lb .an .icon-btn { min-width: 44px; min-height: 44px; }
44
+ .lb .an-colour { width: 44px; height: 44px; }
45
+ }
@@ -8,11 +8,12 @@
8
8
  // - the list is never remounted on navigation, and only its own scrollTop follows the active row (#1515).
9
9
  // Public (/assets/): an anonymous View reader gets the same list, fed by View's roster read instead of status frames.
10
10
  import { html, useLayoutEffect, useRef, useState } from "./app-html.js";
11
- import { t } from "./app-i18n.js";
11
+ import { register, t } from "./app-i18n.js";
12
12
  import { recordEdit } from "./text-undo.js";
13
13
  import { appStore, createStore, guestPage, useStore } from "./app-store.js";
14
14
  import { Menu } from "./ui-menu.js";
15
15
  import { chatPath, detailsPath, logPath, viewPath } from "./app-route.js";
16
+ import { navigate } from "./app-nav.js";
16
17
  import { Icon } from "./ui-icons.js";
17
18
  import { Skeleton } from "./ui-states.js";
18
19
  import { viewStore } from "./view-roster-store.js";
@@ -22,6 +23,12 @@ import { themesShown, themesStore } from "./app-themes.js";
22
23
  import { machineName } from "./machine-name.js";
23
24
  import { identityClasses, identityOf, paintIdentity, useIdentityColors } from "./identity-color.js";
24
25
 
26
+ // Keep new copy beside its caller: a retained view-strings.js still links and renders the menu.
27
+ register("agentRow", {
28
+ en: { actions: "Actions for {0}", add: "Add to favorites", remove: "Remove from favorites" },
29
+ "zh-TW": { actions: "{0} 的操作", add: "加入最愛", remove: "移出最愛" },
30
+ });
31
+
25
32
  /** view.* text with named values. */
26
33
  function tn(key, values = {}) {
27
34
  let s = t(`view.${key}`);
@@ -490,11 +497,20 @@ function SortMenu({ sort }) {
490
497
  export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting = {}, viewOnly = false, onPick }) {
491
498
  const nav = useStore(navStore);
492
499
  const workspace = useStore(appStore).chatWorkspace;
500
+ const styledMenus = typeof getComputedStyle === "function" && getComputedStyle(document.documentElement).getPropertyValue?.("--agent-menu-version")?.trim() === "1";
493
501
  const names = useStore(namesStore); // #1722: which name leads
494
502
  useIdentityColors(); // #1958: repaint when the host's colour settings or the themes switch change
495
503
  const filterRef = useRef(null);
496
504
  const list = useRef(null);
497
505
  const drag = useRef(null);
506
+ const focusRow = useRef(null);
507
+ useLayoutEffect(() => {
508
+ if (!focusRow.current) return;
509
+ const row = [...(list.current?.querySelectorAll("[data-agent-row]") || [])].find(el => el.getAttribute("data-agent-row") === focusRow.current);
510
+ focusRow.current = null;
511
+ // Starring moves a row into another group. Return keyboard focus to its new slot, or Edit if its group is folded.
512
+ (row?.querySelector(".inst-row-menu > button") || list.current?.querySelector(".fav-edit"))?.focus({ preventScroll: true });
513
+ }, [nav.favorites]);
498
514
  // #2179: the reply times and their highlight move on by themselves — the list is drawn again every 30 s.
499
515
  const [, setTick] = useState(0);
500
516
  useLayoutEffect(() => { const id = setInterval(() => setTick((n) => n + 1), 30000); return () => clearInterval(id); }, []);
@@ -509,9 +525,10 @@ export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting =
509
525
  const panelPath = viewOnly || (route && route.panel === "view") ? viewPath
510
526
  : route && route.panel === "log" ? logPath // #1218: Log → Log
511
527
  : route && route.panel === "details" ? detailsPath : chatPath;
512
- const rowPath = (name) => byName.get(name)?.runtime === "windows" && ["view", "log", "details"].includes(route?.panel)
513
- ? chatPath(name) : panelPath(name);
514
528
  const active = route && (route.panel === "chat" || route.panel === "view" || route.panel === "log" || route.panel === "details") ? route.instance : null;
529
+ // A selected row returns to Chat; a different row keeps the current view. Real hrefs give Enter the same action.
530
+ const rowPath = (name) => !viewOnly && name === active ? chatPath(name)
531
+ : byName.get(name)?.runtime === "windows" && ["view", "log", "details"].includes(route?.panel) ? chatPath(name) : panelPath(name);
515
532
  const own = (map, name) => Object.prototype.hasOwnProperty.call(map, name);
516
533
  const byName = new Map(items.map((it) => [nameOf(it), it]));
517
534
  const facetOf = (name) => statusFacet(byName.get(name), own(exec, name) ? exec[name] : null, own(awaiting, name) ? awaiting[name] : null);
@@ -565,10 +582,19 @@ export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting =
565
582
  const flip = (key, value) => { const cur = new Set(navStore.get().filter[key]); if (cur.has(value)) cur.delete(value); else cur.add(value); setNavFilter({ [key]: [...cur] }); };
566
583
  // Drag to reorder: only the full list (a filtered subset would be ambiguous), groups among groups, instances within
567
584
  // their group.
568
- const dragProps = (item) => shown.active || guest || recent ? {} : { // #2179: not while sorted by reply
585
+ const dragProps = (item, allowOrder = true) => {
586
+ const reorder = allowOrder && !shown.active && !guest && !recent; // #2179: not while sorted by reply
587
+ const dock = item.type === "instance" && !guest && workspace?.dragStart;
588
+ if (!reorder && !dock) return {};
589
+ return {
569
590
  draggable: true,
570
- onDragStart: (e) => { drag.current = item; e.currentTarget.classList.add("dragging"); try { e.dataTransfer.effectAllowed = "move"; e.dataTransfer.setData("text/plain", item.name); } catch { /* Firefox needs data */ } },
571
- onDragEnd: (e) => { e.currentTarget.classList.remove("dragging"); drag.current = null; },
591
+ onDragStart: (e) => {
592
+ const docking = dock && workspace.dragStart(item.name, e);
593
+ if (!reorder && !docking) { e.preventDefault(); return; }
594
+ drag.current = reorder ? item : null; e.currentTarget.classList.add("dragging");
595
+ try { e.dataTransfer.effectAllowed = "move"; e.dataTransfer.setData("text/plain", item.name); } catch { /* Firefox needs data */ }
596
+ },
597
+ onDragEnd: (e) => { workspace?.dragEnd?.(); e.currentTarget.classList.remove("dragging"); drag.current = null; },
572
598
  onDragOver: (e) => {
573
599
  const d = drag.current;
574
600
  if (!d || d.type !== item.type || d.name === item.name || (item.type === "instance" && d.group !== item.group)) return;
@@ -591,6 +617,7 @@ export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting =
591
617
  else return;
592
618
  persistOrder(names, insts);
593
619
  },
620
+ };
594
621
  };
595
622
  // #1700: a facet group (Status, CLI) folds under a real header button. Folded with a filter set, the header says so:
596
623
  // one or two choices by name, more as "N selected" — a filter is never out of sight.
@@ -620,15 +647,34 @@ export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting =
620
647
  const on = name === active;
621
648
  const fav = g === FAV_GROUP, starred = favSet.has(name);
622
649
  // #1958: its identity colour — the ring, a left bar and/or the name, as resolved; painted through the CSSOM.
623
- const id = identityOf(it);
650
+ const id = identityOf(it, { sidebar: true });
624
651
  const full = !starred && favs.length >= MAX_FAVORITES;
625
652
  // #2179 (B5, the user's pick): the % (and the ★ beside the row) on the name's line; the time of the last reply at the
626
653
  // end of the second line, highlighted for REPLY_FRESH_MIN minutes, fading by itself (a reply under a minute pulses once).
627
654
  const mins = ageOf(name), fade = replyFade(mins);
628
655
  const two = !!secondary || mins != null;
629
- return html`<li key=${name} class=${`v-li${two ? " two-line" : ""}`}><a class=${`inst v-inst${on ? " active" : ""}${fade > 0 ? " replied" : ""}${mins != null && mins < 1 ? " just" : ""} ${identityClasses(id)}`}
656
+ const menuItems = [
657
+ canStar ? { key: "favorite", label: t(`agentRow.${starred ? "remove" : "add"}`), icon: "star", disabled: full,
658
+ iconClass: starred ? "menu-starred" : undefined,
659
+ title: full ? tn("favFull", { max: MAX_FAVORITES }) : undefined,
660
+ onSelect: () => { focusRow.current = name; toggleFavorite(name, known); } } : null,
661
+ workspace && !viewOnly && route?.instance ? { key: "beside", label: workspace.label(name), icon: "sidebar", onSelect: () => workspace.open(name) } : null,
662
+ canConfigure && supportsInstanceFeature(it, "details") ? { key: "settings", label: t("app.details"), icon: "settings", onSelect: () => {
663
+ if (workspace && route?.instance) workspace.settings(name);
664
+ else { navigate(`${detailsPath(name)}?cat=basic`); onPick?.(); }
665
+ } } : null,
666
+ ...(fav && editing && canStar ? [
667
+ { key: "up", label: tn("favUp", { name: label }), icon: "up", disabled: shown.active || favsSorted || i === 0,
668
+ title: shown.active ? tn("favFiltered") : favsSorted ? tn("favSorted") : tn("favUp", { name: label }),
669
+ onSelect: () => { if (!shown.active && !favsSorted) { focusRow.current = name; moveFavorite(name, -1, known); } } },
670
+ { key: "down", label: tn("favDown", { name: label }), icon: "down", disabled: shown.active || favsSorted || i === count - 1,
671
+ title: shown.active ? tn("favFiltered") : favsSorted ? tn("favSorted") : tn("favDown", { name: label }),
672
+ onSelect: () => { if (!shown.active && !favsSorted) { focusRow.current = name; moveFavorite(name, 1, known); } } },
673
+ ] : []),
674
+ ].filter(Boolean);
675
+ return html`<li key=${name} data-agent-row=${name} class=${`v-li${two ? " two-line" : ""}`}><a class=${`inst v-inst${on ? " active" : ""}${starred ? " inst-favorite" : ""}${fade > 0 ? " replied" : ""}${mins != null && mins < 1 ? " just" : ""} ${identityClasses(id)}`}
630
676
  ref=${(el) => { paintIdentity(el, id); paintReply(el, fade); }} href=${rowPath(name)} title=${instanceTooltip(it)}
631
- aria-current=${on ? "page" : undefined} onClick=${onPick} ...${fav ? {} : dragProps({ type: "instance", name, group: g })}>
677
+ aria-current=${on ? "page" : undefined} onClick=${onPick} ...${dragProps({ type: "instance", name, group: g }, !fav)}>
632
678
  <${InstanceAvatar} it=${it} state=${dotState(it, own(exec, name) ? exec[name] : null, waiting)} cli=${true} />
633
679
  <span class="inst-text"><span class="inst-line"><span class="inst-name" title=${label}>${label}</span>
634
680
  <span class="v-meta">${it.runtime === "windows" ? "Windows" : it.context_pct != null ? `${Math.round(it.context_pct)}%` : ""}</span></span>
@@ -637,19 +683,10 @@ export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting =
637
683
  ${it.machine_id ? html`<span class=${`inst-machine${it.machine_status !== "online" ? " offline" : ""}`} title=${tn("tooltipMachine",{value:machineName(it.machine_id,it.machine_name)})}><span class="inst-machine-name">${machineName(it.machine_id,it.machine_name)}</span>${it.machine_status !== "online" ? html`<span class="inst-machine-status">${tn(it.machine_status === "revoked" ? "machineRevoked" : "machineOffline")}</span>` : null}</span>` : null}
638
684
  ${facet === "needs" ? html`<span class="inst-sub"><span class="badge-await" title=${waiting || t("app.approxNote")}>${t("app.needsYou")}</span></span>` : null}
639
685
  <span class="sr-only">${tn("tooltipBackend", { value: backendLabel(it.backend) })}</span></span>
640
- </a>${fav && editing && canStar ? html`<button type="button" class="icon-btn inst-move" aria-label=${tn("favUp", { name: label })}
641
- title=${shown.active ? tn("favFiltered") : favsSorted ? tn("favSorted") : tn("favUp", { name: label })} disabled=${shown.active || favsSorted || i === 0} onClick=${() => { if (!shown.active && !favsSorted) moveFavorite(name, -1, known); }}><${Icon} name="up" size=${14} /></button><button type="button" class="icon-btn inst-move"
642
- aria-label=${tn("favDown", { name: label })} title=${shown.active ? tn("favFiltered") : favsSorted ? tn("favSorted") : tn("favDown", { name: label })} disabled=${shown.active || favsSorted || i === count - 1}
643
- onClick=${() => { if (!shown.active && !favsSorted) moveFavorite(name, 1, known); }}><${Icon} name="down" size=${14} /></button>` : null}${canStar
644
- ? html`<button type="button" class=${`icon-btn inst-star${starred ? " on" : ""}`} aria-pressed=${starred ? "true" : "false"} disabled=${full}
645
- aria-label=${tn(starred ? "favRemove" : "favAdd", { name: label })} title=${full ? tn("favFull", { max: MAX_FAVORITES }) : tn(starred ? "favRemove" : "favAdd", { name: label })}
646
- onClick=${() => toggleFavorite(name, known)}><${Icon} name="star" size=${14} /></button>` : null}${canConfigure && supportsInstanceFeature(it, "details")
647
- // one step to this agent's settings (its Details & settings page, Basic info; a kind with no Basic info — a ClassicBot room — starts at its first category); the row itself still opens the chat.
648
- ? html`<a class="icon-btn inst-gear" href=${`${detailsPath(name)}?cat=basic`} aria-label=${tn("gearOpen", { name: label })} title=${tn("gearOpen", { name: label })}
649
- onClick=${onPick}><${Icon} name="settings" size=${14} /></a>` : null}
650
- ${workspace && !viewOnly && route?.instance ? html`<${Menu} cls="inst-workspace" label=${t("app.more")} items=${[
651
- { key: "beside", label: workspace.label(name), onSelect: () => workspace.open(name) },
652
- canConfigure && supportsInstanceFeature(it, "details") ? { key: "settings", label: t("app.details"), icon: "settings", onSelect: () => workspace.settings(name) } : null]} />` : null}</li>`;
686
+ </a>${menuItems.length ? html`<${Menu} cls=${`inst-workspace inst-row-menu agent-menu${starred ? " is-favorite" : ""}`} fit=${true} topLayer=${true}
687
+ ownerKey=${name} label=${t("agentRow.actions", label)} items=${menuItems}
688
+ trigger=${styledMenus ? html`<span class="inst-menu-star" aria-hidden="true">${starred ? html`<${Icon} name="star" size=${14} />` : null}</span><span class="inst-menu-more" aria-hidden="true"><${Icon} name="more" size=${16} /></span>` : undefined} />`
689
+ : starred ? html`<span class="inst-favorite-mark" aria-hidden="true"><${Icon} name="star" size=${14} /></span>` : null}</li>`;
653
690
  };
654
691
  // #2401: an open list of two or more lines leaves room under the count for "shown" and Clear (stacked); otherwise compact.
655
692
  const facetSet = f.status.length > 0 || f.cli.length > 0;
@@ -0,0 +1,29 @@
1
+ // #3637: display geometry shared by the split sash, docking preview and in-page float.
2
+ export const SASH = 8;
3
+ const finite = (value, fallback) => Number.isFinite(Number(value)) ? Number(value) : fallback;
4
+ const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
5
+ export function splitSize(width, height, layout, ratio = .5) {
6
+ const total = Math.max(0, finite(layout === "stack" ? height : width, 0) - SASH);
7
+ const min = Math.min(layout === "stack" ? 320 : 360, total / 2);
8
+ const first = clamp(total * finite(ratio, .5), min, total - min);
9
+ return { first, second: total - first, ratio: total ? first / total : .5, min, max: total - min };
10
+ }
11
+ export function floatBox(width, height, box) {
12
+ width = Math.max(0, finite(width, 0)); height = Math.max(0, finite(height, 0));
13
+ const w = clamp(finite(box?.width, 560), Math.min(420, width), width);
14
+ const h = clamp(finite(box?.height, 460), Math.min(360, height), height);
15
+ return { x: clamp(finite(box?.x, width - w - 16), 0, width - w), y: clamp(finite(box?.y, height - h - 96), 0, height - h), width: w, height: h };
16
+ }
17
+ export function dropZone(rect, x, y) {
18
+ const dx = x - rect.left, dy = y - rect.top;
19
+ if (![dx, dy, rect.width, rect.height].every(Number.isFinite) || rect.width <= 0 || rect.height <= 0 || dx < 0 || dy < 0 || dx > rect.width || dy > rect.height) return null;
20
+ const edges = [["left", dx / Math.min(72, rect.width * .22)], ["right", (rect.width - dx) / Math.min(72, rect.width * .22)],
21
+ ["top", dy / Math.min(72, rect.height * .22)], ["bottom", (rect.height - dy) / Math.min(72, rect.height * .22)]];
22
+ edges.sort((a, b) => a[1] - b[1]);
23
+ return edges[0][1] <= 1 ? edges[0][0] : "center";
24
+ }
25
+ export function dropBox(rect, zone) {
26
+ const { left, top, width, height } = rect;
27
+ return { left: left + (zone === "right" ? width / 2 : 0), top: top + (zone === "bottom" ? height / 2 : 0),
28
+ width: ["left", "right"].includes(zone) ? width / 2 : width, height: ["top", "bottom"].includes(zone) ? height / 2 : height };
29
+ }
@@ -12,7 +12,7 @@
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 authenticator app’s 6-digit code to sign in automatically.",
15
+ checking: "Checking your session…", title: "Sign in to AgEnD", lead: "Enter the 6-digit code from your authenticator app, or an 8-character device sign-in code, to sign in.",
16
16
  label: "Authenticator or device sign-in code", submit: "Sign in", working: "Signing in…",
17
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.",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "zh-TW": {
65
65
  signout_unsaved: "暫時登出了,但變更沒能儲存:重新啟動後這個工作階段可能會回來。這個頁面無法修復工作階段的儲存問題。",
66
- checking: "正在確認登入狀態…", title: "登入 AgEnD", lead: "填入驗證器 App 的 6 位數驗證碼,即可自動登入。",
66
+ checking: "正在確認登入狀態…", title: "登入 AgEnD", lead: "填入驗證器 App 的 6 位數驗證碼,或 8 字元的裝置登入碼,即可登入。",
67
67
  label: "驗證碼或裝置登入碼", submit: "登入", working: "登入中…",
68
68
  hint: "也可以貼上 8 字元裝置登入碼",
69
69
  nobot: "沒有聊天 bot?", nobot_body: "請管理員在 AgEnD 電腦執行 agend web --code。",
@@ -155,6 +155,20 @@
155
155
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.12);
156
156
  }
157
157
 
158
+ /* #3727: theme-INDEPENDENT tokens, in a block of their own after the themes. The image viewer's chrome is dark in either
159
+ theme (its picture sits on black), so these are not dark-theme tokens and no theme redefines them: the annotation
160
+ editor's text, bars, buttons and fields, and its four marker colours (the same values the editor draws with on the
161
+ canvas, image-annotate.js COLOURS). */
162
+ :root {
163
+ --media-ink: #ffffff;
164
+ --media-bar: rgba(0, 0, 0, 0.75);
165
+ --media-panel: rgba(0, 0, 0, 0.6);
166
+ --media-btn: rgba(255, 255, 255, 0.12);
167
+ --media-btn-on: rgba(255, 255, 255, 0.32);
168
+ --media-line: rgba(255, 255, 255, 0.35);
169
+ --mark-red: #e5484d; --mark-yellow: #ffc53d; --mark-blue: #3e8eff; --mark-white: #ffffff;
170
+ }
171
+
158
172
  @media (prefers-reduced-motion: reduce) {
159
173
  :root { --t-fast: 0ms; --t-med: 0ms; }
160
174
  }
@@ -10,15 +10,18 @@ import { t } from "./app-i18n.js";
10
10
  * open. `active`: the button shows a pressed look (what it controls is on), without changing its role.
11
11
  * Optional `trigger` and `triggerClass` customize the button content and styling; `label` remains its accessible name.
12
12
  */
13
- export function Menu({ items, label, icon = "more", cls = "", active = false, trigger, triggerClass = "icon-btn", disabled = false, fit = false, ownerKey, inactive = false, onOpen, leading }) {
13
+ export function Menu({ items, label, icon = "more", cls = "", active = false, trigger, triggerClass = "icon-btn", disabled = false, fit = false, topLayer = false, ownerKey, inactive = false, onOpen, leading }) {
14
14
  const [open, setOpen] = useState(false);
15
15
  const [placement,setPlacement] = useState("");
16
16
  const btn = useRef(null), list = useRef(null);
17
17
  const shown = (items || []).filter(Boolean);
18
+ const anchored = topLayer && open && typeof getComputedStyle === "function" && getComputedStyle(document.documentElement).getPropertyValue?.("--agent-menu-version")?.trim() === "1";
18
19
  useLayoutEffect(() => { setOpen(false); }, [ownerKey]);
19
20
  useLayoutEffect(() => { if (inactive) setOpen(false); }, [inactive]);
20
21
  useLayoutEffect(() => {
21
22
  if (!open || !fit || !btn.current?.getBoundingClientRect || !list.current) return;
23
+ const menu = list.current;
24
+ if (anchored) menu.showPopover?.(); // escape the sidebar's scrolling clip; the same Menu keeps focus/ownership
22
25
  const place = () => {
23
26
  if (!btn.current || !list.current) return;
24
27
  const rect = btn.current.getBoundingClientRect();
@@ -28,11 +31,23 @@ export function Menu({ items, label, icon = "more", cls = "", active = false, tr
28
31
  const up = below < Math.min(list.current.scrollHeight || 280,280) && above > below;
29
32
  const available = up ? above : below;
30
33
  setPlacement(`${up ? " menu-up" : ""}${available < 180 ? " menu-short" : available < 280 ? " menu-compact" : ""}`);
34
+ if (anchored) {
35
+ menu.style.setProperty("--menu-available", `${Math.max(44, available)}px`);
36
+ const popup = menu.getBoundingClientRect();
37
+ menu.style.setProperty("--menu-x", `${Math.max(8, Math.min(rect.right - popup.width, window.innerWidth - popup.width - 8))}px`);
38
+ menu.style.setProperty("--menu-y", `${Math.max(8, up ? rect.top - popup.height - 4 : rect.bottom + 4)}px`);
39
+ return;
40
+ }
41
+ list.current.style.setProperty("--menu-shift", "0px");
42
+ const popup = list.current.getBoundingClientRect();
43
+ const shift = Math.max(8 - popup.left, Math.min(0, window.innerWidth - 8 - popup.right));
44
+ list.current.style.setProperty("--menu-shift", `${shift}px`);
31
45
  };
32
46
  place();
33
47
  window.addEventListener("resize",place);
34
- return () => window.removeEventListener("resize",place);
35
- },[open,fit]);
48
+ if (anchored) window.addEventListener("scroll",place,true);
49
+ return () => { window.removeEventListener("resize",place); if (anchored) { window.removeEventListener("scroll",place,true); if (menu.isConnected) menu.hidePopover?.(); } };
50
+ },[open,fit,anchored]);
36
51
  useEffect(() => {
37
52
  if (!open || disabled) { if (open && disabled) setOpen(false); return undefined; }
38
53
  const first = list.current && list.current.querySelector("[role=menuitem]:not([disabled]), [role=menuitemradio]:not([disabled]), [role=menuitemcheckbox]:not([disabled])");
@@ -59,19 +74,19 @@ export function Menu({ items, label, icon = "more", cls = "", active = false, tr
59
74
  <button ref=${btn} type="button" class=${`${triggerClass}${active ? " active" : ""}`} aria-haspopup="menu" aria-expanded=${open ? "true" : "false"} disabled=${disabled}
60
75
  aria-label=${label || t("app.more")} title=${label || t("app.more")} onClick=${() => { if (!disabled) { if (!open) onOpen?.(); setOpen(!open); } }}
61
76
  onKeyDown=${(e) => { if (!disabled && (e.key === "ArrowDown" || e.key === "ArrowUp")) { e.preventDefault(); onOpen?.(); setOpen(true); } }}>${trigger === undefined ? html`<${Icon} name=${icon} />` : trigger}</button>
62
- ${open && !disabled ? html`<div data-trust="menu" ref=${list} class=${`menu-list${fit ? placement : ""}`} role="menu" aria-label=${label || t("app.more")} onKeyDown=${onKey}>
77
+ ${open && !disabled ? html`<div data-trust="menu" ref=${list} popover=${anchored ? "manual" : undefined} class=${`menu-list${anchored ? " menu-anchored" : ""}${fit ? placement : ""}`} role="menu" aria-label=${label || t("app.more")} onKeyDown=${onKey}>
63
78
  ${leading || null}
64
79
  ${shown.map(item => item.heading
65
80
  ? html`<div key=${item.key} class="menu-heading" role="presentation">${item.label}</div>`
66
81
  : item.checkbox
67
82
  ? html`<button key=${item.key} type="button" role="menuitemcheckbox" aria-checked=${item.checked ? "true" : "false"} class="menu-item menu-radio"
68
- disabled=${!!item.disabled} onClick=${() => item.onSelect()}><span class="menu-tick" aria-hidden="true">${item.checked ? html`<${Icon} name="check" size=${16} />` : null}</span><span>${item.label}</span></button>`
83
+ title=${item.title} disabled=${!!item.disabled} onClick=${() => item.onSelect()}><span class="menu-tick" aria-hidden="true">${item.icon ? html`<${Icon} name=${item.icon} size=${16} />` : item.checked ? html`<${Icon} name="check" size=${16} />` : null}</span><span>${item.label}</span>${item.icon && item.checked ? html`<span class="menu-state" aria-hidden="true"><${Icon} name="check" size=${14} /></span>` : null}</button>`
69
84
  : item.checked !== undefined
70
85
  // #2196: one of a group of choices (Page colours): a radio item, the chosen one ticked.
71
86
  ? html`<button key=${item.key} type="button" role="menuitemradio" aria-checked=${item.checked ? "true" : "false"} class="menu-item menu-radio"
72
- disabled=${!!item.disabled} onClick=${() => choose(item)}><span class="menu-tick" aria-hidden="true">${item.checked ? html`<${Icon} name="check" size=${16} />` : null}</span><span>${item.label}</span></button>`
87
+ title=${item.title} disabled=${!!item.disabled} onClick=${() => choose(item)}><span class="menu-tick" aria-hidden="true">${item.icon ? html`<${Icon} name=${item.icon} size=${16} />` : item.checked ? html`<${Icon} name="check" size=${16} />` : null}</span><span>${item.label}</span>${item.icon && item.checked ? html`<span class="menu-state" aria-hidden="true"><${Icon} name="check" size=${14} /></span>` : null}</button>`
73
88
  : html`<button key=${item.key} type="button" role="menuitem" class=${`menu-item${item.danger ? " danger" : ""}`}
74
- disabled=${!!item.disabled} onClick=${() => choose(item)}>${item.icon ? html`<${Icon} name=${item.icon} size=${16} />` : null}<span>${item.label}</span></button>`)}
89
+ title=${item.title} disabled=${!!item.disabled} onClick=${() => choose(item)}>${item.icon ? html`<${Icon} name=${item.icon} cls=${item.iconClass || ""} size=${16} />` : null}<span>${item.label}</span></button>`)}
75
90
  </div>` : null}
76
91
  </div>`;
77
92
  }
@@ -176,7 +176,7 @@ register("view", {
176
176
  "usage.error.grok_response_changed": "Grok billing response changed.",
177
177
  "usage.error.agy_cap": "Individual cap reached — CLI is rate limited (resets in ~{0}). The per-model pool quotas are separate and may still read 0% used.",
178
178
  "usage.error.agy_no_refresh": "Access token expired and no refresh token is stored. Run `agy` once.",
179
- "usage.error.agy_token_expired": "Access token expired. Run `agy` once to refresh it (or set AGY_OAUTH_CLIENT_ID/SECRET to refresh automatically).",
179
+ "usage.error.agy_token_expired": "Access token expired. Turn on Keep connection alive for this account (Settings → Accounts) to renew it every hour, or run `agy` once.",
180
180
  "usage.error.agy_login_expired": "Google sign-in expired. Run `agy` once to log in again.",
181
181
  "usage.error.agy_refresh_empty": "Google token refresh returned no token.",
182
182
  "usage.error.grok_auth_readonly": "Token expired and auth.json is read-only. Run `grok` once to refresh it.",
@@ -449,7 +449,7 @@ register("view", {
449
449
  "usage.error.grok_response_changed": "Grok 計費回應格式已變更。",
450
450
  "usage.error.agy_cap": "個人上限已用完,CLI 正受到速率限制(約 {0} 後重置)。各模型的額度池是另一組計數,因此仍可能顯示 0% 已使用。",
451
451
  "usage.error.agy_no_refresh": "Access token 已過期,且未儲存 refresh token。請執行一次 `agy`。",
452
- "usage.error.agy_token_expired": "Access token 已過期。請執行一次 `agy` 重新整理,或設定 AGY_OAUTH_CLIENT_ID/SECRET 以自動更新。",
452
+ "usage.error.agy_token_expired": "Access token 已過期。請在「設定 → 帳號」打開這個帳號的「保持連接」,每小時自動更新;或執行一次 `agy`。",
453
453
  "usage.error.agy_login_expired": "Google 登入已過期。請執行一次 `agy` 重新登入。",
454
454
  "usage.error.agy_refresh_empty": "Google token 更新回應沒有 access token。",
455
455
  "usage.error.grok_auth_readonly": "Token 已過期且 auth.json 為唯讀。請執行一次 `grok` 重新整理。",
@@ -70,7 +70,7 @@
70
70
  </div>
71
71
  <form id="form" hidden autocomplete="off">
72
72
  <h1 data-i18n="title">Sign in to AgEnD</h1>
73
- <p data-i18n="lead">Enter your authenticator app’s 6-digit code to sign in automatically.</p>
73
+ <p data-i18n="lead">Enter the 6-digit code from your authenticator app, or an 8-character device sign-in code, to sign in.</p>
74
74
  <label for="code" data-i18n="label">Authenticator or device sign-in code</label>
75
75
  <input id="code" name="code" inputmode="text" autocomplete="one-time-code" autocapitalize="characters"
76
76
  autocorrect="off" spellcheck="false" maxlength="32" placeholder="" aria-describedby="codeHint" required>