@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
@@ -1,6 +1,8 @@
1
1
  import * as ownerEntryWords from "./hub-owner-strings.js";
2
2
  import * as companyViews from "./hub-company-join.js";
3
3
  import { hj, joinError } from "./hub-company-join-strings.js";
4
+ import { useJoinApproval } from "./hub-join-approval.js";
5
+ import { queueMessage } from "./hub-joincode-flow-strings.js";
4
6
  import { joinRequest, companyInfoRequest, CompanyJoinInfoPage, useCompanyJoinContext, CompanyJoinLead, approveCompanyJoin, HubCompanyJoinPage, CompanyJoinAdminCard } from "./hub-company-join.js";
5
7
  // AgEnD Hub P1, slice 3: the Hub workspace's pages — the chats (/ui/hub, a room at /ui/hub?room=<id>; #3226 B), My
6
8
  // exposures and Administration (/ui/hub/exposures, /ui/hub/admin; reached from the session row's menu) — and its session row. Served only by a Hub's own listener at its own origin, over the Hub's /hub/v1/*
@@ -45,10 +47,29 @@ register("hubAccess", {
45
47
  "zh-TW": { tag: "需要確認權限", refused: "提問遭到拒絕。請先重新檢查權限,再試一次。", check: "重新檢查權限", limited: "提問遭到拒絕,先前的權限資訊需要重新確認。" },
46
48
  });
47
49
  const ha = key => t(`hubAccess.${key}`);
50
+ // Kept with the fresh renderer: retained owner dictionaries do not know this label.
51
+ register("hubGrantStatus", {
52
+ en: { grantNeverSignedIn: "Hasn't signed in to Hub yet", grantADGroup: "AD group", grantSubjects: "People and groups allowed: {0}" },
53
+ "zh-TW": { grantNeverSignedIn: "還沒登入過 Hub", grantADGroup: "AD 群組", grantSubjects: "已允許的個人與群組:{0}" },
54
+ });
55
+
56
+ // These words travel with the renderer; retained dictionaries need no new exports.
57
+ register("hubSharing", {
58
+ en: { pause: "Pause sharing", resume: "Resume sharing", paused: "Sharing paused", title: "Pause and resume sharing",
59
+ lead: "Stop new questions and keep the people and AD groups allowed to ask. Their expiry dates keep running while sharing is paused. A question already being handed to the Fleet may still start within a few seconds; work already in progress may finish.",
60
+ waiting: "Saving…", pausedChat: "The owner paused sharing {0}. New questions are stopped; a question already being handed to the Fleet may still start within a few seconds. You can still read this chat while your permission lasts. Sharing can resume; expiry dates keep running.",
61
+ },
62
+ "zh-TW": { pause: "暫停分享", resume: "繼續分享", paused: "分享已暫停", title: "暫停與繼續分享",
63
+ lead: "停止接受新提問,保留允許提問的個人與 AD 群組。暫停期間,授權的到期時間照常計算。已在傳送給 Fleet 的提問,可能仍會在幾秒內開始處理;已在處理的工作可能會完成。",
64
+ waiting: "儲存中…", pausedChat: "擁有者已暫停分享 {0}。不再接受新提問;已在傳送給 Fleet 的提問,可能仍會在幾秒內開始處理。權限有效期間,你仍可閱讀這段對話。之後可以繼續分享;授權的到期時間照常計算。",
65
+ },
66
+ });
48
67
 
49
68
  // #3298 S-89 (experimental): the group permissions editor and the signed-in welcome are their own LAZY modules, loaded only
50
69
  // when the Hub's session says "group-policy-v1" and this tab's client has the calls — a Hub without them never serves or loads them.
51
70
  // The one group-permissions sentence this module draws itself (shown when the lazy modules are NOT loaded: this Hub lacks them).
71
+ // Hub UX U2 (spec 1.2): the fleet list's own words (an older cached owner dictionary has none of them).
72
+ register("hubFleetList", { en: { revoked: "Revoked ({0})" }, "zh-TW": { revoked: "已撤銷({0})" } });
52
73
  register("hubGroupsNote", {
53
74
  en: { unavailable: "Group permissions aren't available on this Hub yet. Update the Hub, then try again." },
54
75
  "zh-TW": { unavailable: "這個 Hub 還沒有群組權限。請更新 Hub 後再試。" },
@@ -101,6 +122,8 @@ function useSession() {
101
122
  return s;
102
123
  }
103
124
  const when = (ms) => new Date(ms).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" });
125
+ // M-2988: words added after a release; a tab holding the older hub-strings dictionary falls back to the older sentence.
126
+ const newer = (key, args, older) => { const s = hw(key, ...args); return s === `hub.${key}` ? older() : s; };
104
127
  const errText = (r) => hw(r.code === "conflict" || r.code === "stale" ? "errConflictHub" : r.code === "not-found" ? "errNotFound"
105
128
  : r.code === "backpressure" ? "errBusyHub" : r.code === "revoked" || r.code === "denied" ? "errDenied" : r.code === "unreachable" ? "errUnreachableHub" : "errFailed");
106
129
 
@@ -176,6 +199,8 @@ function linkHubSigninCss(doc = typeof document !== "undefined" ? document : nul
176
199
  }
177
200
  function HubSignIn() {
178
201
  const company = useCompanyJoinContext();
202
+ const generation = useRef(0);
203
+ const approval = useJoinApproval({ requestId: company.requestId, deadline: company.view?.outerDeadline, approve: approveCompanyJoin, current: () => joinRequest() === company.requestId });
179
204
  useEffect(() => {
180
205
  linkHubSigninCss();
181
206
  // #3318 review F1: signed out from the phone drawer's session menu (or a session that ended while it was open), the
@@ -190,6 +215,7 @@ function HubSignIn() {
190
215
  const [form, setForm] = useState({ login: "", password: "" });
191
216
  const [busy, setBusy] = useState(false);
192
217
  const [msg, setMsg] = useState(null);
218
+ useEffect(() => { setBusy(false); setMsg(null); return () => { generation.current++; }; }, [company.requestId]);
193
219
  const submit = async (e) => {
194
220
  e.preventDefault();
195
221
  if (busy) return;
@@ -199,13 +225,16 @@ function HubSignIn() {
199
225
  doc?.getElementById(!form.login.trim() ? "hubLogin" : "hubPassword")?.focus();
200
226
  return;
201
227
  }
228
+ const mine = ++generation.current, requestId = company.requestId;
202
229
  setBusy(true); setMsg(null);
203
230
  const r = await hubClient().signIn(form.login.trim(), form.password);
231
+ if (mine !== generation.current || joinRequest() !== requestId) return;
204
232
  if (r.ok) {
205
233
  setForm({ login: "", password: "" });
206
234
  if (company.requestId) {
207
- const joined = await approveCompanyJoin(company.requestId, r.csrf);
208
- if (!joined.ok) { setBusy(false); setSession({ ...r, companyJoinFailure: { requestId: company.requestId, code: joined.code } }); return; }
235
+ const joined = await approval.run(r.csrf);
236
+ if (mine !== generation.current || joined.code === "retired") return;
237
+ if (!joined.ok) { setBusy(false); setSession({ ...r, companyJoinFailure: { requestId: company.requestId, code: joined.code, reason: joined.reason } }); return; }
209
238
  }
210
239
  setBusy(false); setSession(r); return;
211
240
  }
@@ -227,6 +256,7 @@ function HubSignIn() {
227
256
  value=${form.password} onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, password: v })); }} />
228
257
  <button type="submit" class="hub-signin-go" disabled=${busy || company.requestId && !company.view?.ok}>${company.requestId ? hj("signInConnect") : hw("signIn")}</button>
229
258
  </form>` : company.view?.ok ? html`<p role="status">${joinError(company.view.reason || company.view.state)}</p>` : null}
259
+ ${approval.queued ? html`<p class="note" role="status">${queueMessage(approval.retryAttempt)}</p>` : null}
230
260
  <p class="hub-signin-msg" role=${msg ? "alert" : undefined}>${msg || ""}</p>
231
261
  ${company.requestId && (msg || company.view?.state !== "pending") && company.view?.returnPath ? html`<a class="btn btn-sm" href=${company.view.returnPath} rel="noreferrer">${hj("return")}</a>` : null}
232
262
  </section></main>`;
@@ -477,7 +507,7 @@ function HubChats() {
477
507
  return html`<${PanelHeader} title=${hc("chats")} />
478
508
  <div class=${`hub-home${groupPolicyOn(s, hubClient()) ? " has-welcome" : ""}`}>
479
509
  <div class="hub-home-list"><${HubHomeList} /></div>
480
- ${groupPolicyOn(s, hubClient()) ? html`<div class="hub-home-pick hub-home-welcome"><${LazyGroups} pick=${(m) => m.HubWelcome} props=${{ name: s.displayName, quick: s.features.includes("quick-pairing-v1"), onChats: () => setPicking(true) }} /></div>`
510
+ ${groupPolicyOn(s, hubClient()) ? html`<div class="hub-home-pick hub-home-welcome"><${LazyGroups} pick=${(m) => m.HubWelcome} props=${{ name: s.displayName, quick: s.features.includes("quick-pairing-v1"), onChats: () => setPicking(true), admin: s.admin === true, features: s.features }} /></div>`
481
511
  : html`<div class="hub-home-pick center">${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : rs.error && !rs.rooms.length ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : !rs.rooms.length
482
512
  ? html`<${Empty} icon="chat" title=${hc("noChats")} />`
483
513
  : html`<${Empty} icon="chat" title=${hc("choose")} hint=${hc("chooseHint")} />`}</div>`}
@@ -576,7 +606,8 @@ function HubRoomView({ room: given }) {
576
606
  useEffect(() => {
577
607
  if (!denied) setMsg(current => current === errText({ code: "denied" }) ? null : current);
578
608
  }, [denied]);
579
- const frozen = !closed && room.exposureState === "frozen";
609
+ const paused = !closed && room.exposureState === "paused";
610
+ const frozen = !closed && (room.exposureState === "frozen" || paused);
580
611
  const working = store.working();
581
612
  const name = room.exposureName || "";
582
613
  const client = hubClient();
@@ -593,7 +624,7 @@ function HubRoomView({ room: given }) {
593
624
  setSending(true); setMsg(null);
594
625
  const r = await store.send(q, chosen.length ? { files: chosen.map((f) => f.id) } : {});
595
626
  setSending(false);
596
- if (!r.ok) { setMsg(errText(r)); return; }
627
+ if (!r.ok) { setMsg(r.code === "sharing-paused" ? null : errText(r)); return; }
597
628
  // Only the files this question carried; ones chosen while it was on its way stay for the next.
598
629
  const sent = new Set(chosen.map((f) => f.key));
599
630
  setDraft(""); setFiles(filesRef.current.filter((f) => !sent.has(f.key))); refreshRooms();
@@ -611,7 +642,7 @@ function HubRoomView({ room: given }) {
611
642
  if (panelOpen) { closePanel(); setRail(true); setRailPref(true); return; }
612
643
  setRail((v) => { setRailPref(!v); return !v; });
613
644
  };
614
- const tag = closed ? html`<span class="tag danger">${hc("tagClosed")}</span>` : frozen ? html`<span class="tag warn">${hc("tagFrozen")}</span>`
645
+ const tag = closed ? html`<span class="tag danger">${hc("tagClosed")}</span>` : frozen ? html`<span class="tag warn">${paused ? t("hubSharing.paused") : hc("tagFrozen")}</span>`
615
646
  : denied ? html`<span class="tag warn">${ha("tag")}</span>` : html`<${QuotaChip} room=${room} fallback=${html`<span class="tag ok">${hc("tagCanAsk")}</span>`} />`;
616
647
  const back = !wide ? html`<a class="icon-btn hub-back" href="/ui/hub" aria-label=${hc("back")} title=${hc("back")}><${Icon} name="back" /></a>` : null;
617
648
  const info = html`<${HubRoomInfo} room=${room} closed=${closed} denied=${denied} />`;
@@ -627,7 +658,7 @@ function HubRoomView({ room: given }) {
627
658
  <${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} />
628
659
  <div class="dock hub-dock" data-trust="composer"><div class="dock-col">
629
660
  ${closed ? html`<p class="hub-banner danger" role="status">${hc("closed")}</p>` : null}
630
- ${frozen ? html`<p class="hub-banner warn" role="status">${hc("frozen", name)}</p>` : null}
661
+ ${frozen ? html`<p class="hub-banner warn" role="status">${paused ? t("hubSharing.pausedChat", name) : hc("frozen", name)}</p>` : null}
631
662
  ${!closed ? html`<${QuotaBanner} room=${room} />` : null}
632
663
  ${denied && !closed ? html`<div class="hub-banner warn" role="status">${ha("refused")}<div class="n-actions"><button type="button" class="btn btn-sm" onClick=${() => store.refresh()}>${ha("check")}</button></div></div>` : null}
633
664
  ${working ? html`<${HubWorkBar} name=${name} since=${working.since} />` : null}
@@ -736,8 +767,10 @@ function HubRoomInfo({ room, closed = false, denied = false }) {
736
767
  // rows), a destructive step behind a row's menu and a confirmation ──
737
768
  const DAYS_LEFT = (ms) => daysLeft(ms);
738
769
  const stateTag = (state) => state === "published" ? html`<span class="tag ok">${ho("stateShared")}</span>`
770
+ : state === "paused" ? html`<span class="tag warn">${t("hubSharing.paused")}</span>`
739
771
  : state === "frozen" ? html`<span class="tag warn">${ho("statePaused")}</span>` : html`<span class="tag">${ho("stateWithdrawn")}</span>`;
740
772
  const mayAsk = (n) => (n === 0 ? ho("mayAskNone") : n === 1 ? ho("mayAskOne") : ho("mayAsk", n));
773
+ const grantSummary = (grants = []) => grants.some(g => g.subject?.kind === "group") ? t("hubGrantStatus.grantSubjects", grants.length) : mayAsk(grants.length);
741
774
  const agentParam = () => { try { const v = new URLSearchParams(location.search).get("agent"); return v && /^[a-f0-9-]{36}$/.test(v) ? v : null; } catch { return null; } };
742
775
 
743
776
  /**
@@ -756,7 +789,13 @@ function HubMine() {
756
789
  const [cat, reload] = useRead(() => hubClient().catalog());
757
790
  const [pairings, reloadPairings] = useRead(() => hubClient().pairings());
758
791
  const [msg, setMsg] = useState(null);
759
- useEffect(() => { linkHubChatCss(); linkHubOwnerCss(); }, []);
792
+ useEffect(() => {
793
+ linkHubChatCss(); linkHubOwnerCss();
794
+ if (!document.querySelector('link[data-hub-sharing-css="1"]')) {
795
+ const link = document.createElement("link"); link.rel = "stylesheet"; link.href = "/assets/hub-sharing.css";
796
+ link.setAttribute("data-hub-sharing-css", "1"); document.head.appendChild(link);
797
+ }
798
+ }, []);
760
799
  const act = async (fn, after = reload, refused = (r) => setMsg(errText(r))) => {
761
800
  setMsg(null);
762
801
  const r = await fn();
@@ -788,13 +827,21 @@ function HubMine() {
788
827
  ${cat && !cat.error && !mine.length ? html`<div class="center hub-empty"><${Empty} icon="globe" title=${hw("exposuresEmpty")} hint=${hw("exposuresHint")} /></div>` : null}
789
828
  ${mine.length ? html`<section class="card hub-shared"><h3>${ho("sharedCount", mine.length)}</h3>
790
829
  <div class="hub-rows">${mine.map((e) => html`<a key=${e.id} class="s-row hub-row hub-row-link" href=${`/ui/hub/exposures?agent=${encodeURIComponent(e.id)}`}>
791
- <${Avatar} name=${e.displayName} /><span class="hub-row-text"><strong>${e.displayName}</strong><small class="note">${mayAsk((e.grants || []).length)}</small></span>
830
+ <${Avatar} name=${e.displayName} /><span class="hub-row-text"><strong>${e.displayName}</strong><small class="note">${grantSummary(e.grants)}</small></span>
792
831
  ${stateTag(e.state)}<${Icon} name="next" size=${16} /></a>`)}</div></section>` : null}
793
832
  </div></div>`;
794
833
  }
795
834
 
796
835
  /** One shared agent: who may ask (allow, revoke), whether askers see its quota (G), who asked lately, pause. */
797
836
  function HubAgentPage({ x, act, msg }) {
837
+ const session = useSession(), client = hubClient();
838
+ const resumable = session?.features?.includes("sharing-pause-v1") && client?.sharingPauseV1 === true && typeof client.sharing === "function";
839
+ const [sharingBusy, setSharingBusy] = useState(false);
840
+ const sharing = async () => {
841
+ if (sharingBusy) return; setSharingBusy(true);
842
+ try { await act(() => client.sharing(x.id, x.revision, x.sharingEpoch ?? 0, x.state !== "paused")); }
843
+ finally { setSharingBusy(false); }
844
+ };
798
845
  // #3338: this page is reached only through catalog.mine; the link opens a form, never a grant.
799
846
  // Read the closed intent once on this keyed agent page, so cancel/save/reloads never reopen it.
800
847
  const [allowing, setAllowing] = useState(() => x.state === "published" && new URLSearchParams(location.search).get("grant") === "1");
@@ -813,13 +860,13 @@ function HubAgentPage({ x, act, msg }) {
813
860
  const acts = activity && activity.activity ? activity.activity : [];
814
861
  return html`<div class="col hub-owner">
815
862
  <a class="hub-crumb" href="/ui/hub/exposures"><${Icon} name="back" size=${14} />${ho("backToMine")}</a>
816
- <${PageHead} title=${x.displayName} scope=${stateTag(x.state)} lead=${mayAsk(grants.length)} />
863
+ <${PageHead} title=${x.displayName} scope=${stateTag(x.state)} lead=${grantSummary(grants)} />
817
864
  <div class="s-section-layout">
818
865
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
819
866
  <section class="card"><div class="hub-card-head"><h3>${ho("whoMayAsk")}</h3>${shared ? html`<button type="button" class="btn btn-sm" onClick=${() => setAllowing(true)}><${Icon} name="plus" size=${14} />${ho("allow")}</button>` : null}</div>
820
867
  ${grants.length ? html`<div class="hub-rows">${grants.map((g) => html`<div key=${g.id} class="s-row hub-row">
821
868
  <${Avatar} name=${g.subjectName || g.subjectLogin} size="sm" />
822
- <span class="hub-row-text"><strong>${g.subjectName || g.subjectLogin}</strong><small class="note">${g.subjectLogin ? html`<code>${g.subjectLogin}</code> · ` : null}${ho("untilLeft", dateOnly(g.expiresAt), DAYS_LEFT(g.expiresAt))}</small></span>
869
+ <span class="hub-row-text"><strong>${g.subjectName || g.subjectLogin}</strong><small class="note">${g.subjectLogin ? html`<code>${g.subjectLogin}</code> · ` : null}${ho("untilLeft", dateOnly(g.expiresAt), DAYS_LEFT(g.expiresAt))}</small>${g.subject?.kind === "group" ? html`<small class="tag">${t("hubGrantStatus.grantADGroup")}</small>` : g.subjectSignedIn === false ? html`<small class="tag warn">${t("hubGrantStatus.grantNeverSignedIn")}</small>` : null}</span>
823
870
  <${Menu} label=${ho("rowMenu", g.subjectName || g.subjectLogin)} items=${[{ key: "revoke", label: ho("revokeItem"), icon: "trash", danger: true, onSelect: () => revoke(g) }]} />
824
871
  </div>`)}</div>` : html`<p class="note">${hw("noGrants")}</p>`}
825
872
  </section>
@@ -832,7 +879,9 @@ function HubAgentPage({ x, act, msg }) {
832
879
  </div>`)}</div>` : null}
833
880
  <div class="field-row"><button type="button" class="btn btn-sm btn-ghost" onClick=${reloadActivity}>${ho("refresh")}</button></div>
834
881
  </section>
835
- ${shared ? html`<section class="card hub-danger"><h3>${ho("pauseTitle")}</h3><p class="note">${ho("pauseLead")}</p>
882
+ ${resumable && (shared || x.state === "paused") ? html`<section class="card hub-sharing-control"><h3>${t("hubSharing.title")}</h3><p class="note">${t("hubSharing.lead")}</p>
883
+ <div class="field-row"><button type="button" class="btn btn-sm btn-primary" disabled=${sharingBusy} onClick=${sharing}>${t(sharingBusy ? "hubSharing.waiting" : x.state === "paused" ? "hubSharing.resume" : "hubSharing.pause")}</button></div></section>` : null}
884
+ ${shared || x.state === "paused" ? html`<section class="card hub-danger"><h3>${ho("pauseTitle")}</h3><p class="note">${ho("pauseLead")}</p>
836
885
  <div class="field-row"><button type="button" class="btn btn-sm btn-danger" onClick=${freeze}>${ho("pauseGo")}</button></div></section>` : null}
837
886
  </div>
838
887
  ${allowing && shared ? html`<${AllowDialog} x=${x} act=${act} onClose=${() => setAllowing(false)} />` : null}
@@ -840,6 +889,19 @@ function HubAgentPage({ x, act, msg }) {
840
889
  }
841
890
 
842
891
  function AllowDialog({ x, act, onClose }) {
892
+ const s = useSession(), client = hubClient(), marked = s?.features?.includes("grant-subjects-v1") && client?.grantSubjectsV1 === true && typeof client.searchGrantSubjects === "function";
893
+ const [Picker, setPicker] = useState(null), [failed, setFailed] = useState(false);
894
+ useEffect(() => {
895
+ if (!marked) return; let live = true;
896
+ import("./hub-grant-picker.js").then(m => { if (live) { if (typeof m.HubGrantPicker === "function") setPicker(() => m.HubGrantPicker); else setFailed(true); } })
897
+ .catch(() => { if (live) setFailed(true); });
898
+ return () => { live = false; };
899
+ }, [marked]);
900
+ if (!marked || failed) return html`<${LegacyAllowDialog} x=${x} act=${act} onClose=${onClose} />`;
901
+ if (Picker) return html`<${Picker} x=${x} client=${client} act=${act} onClose=${onClose} />`;
902
+ return html`<${Dialog} title=${ho("allowTitle", x.displayName)} onClose=${onClose}><${Skeleton} rows=${2} /></${Dialog}>`;
903
+ }
904
+ function LegacyAllowDialog({ x, act, onClose }) {
843
905
  const [form, setForm] = useState({ login: "", days: 7 });
844
906
  const [busy, setBusy] = useState(false);
845
907
  const [error, setError] = useState(null);
@@ -914,11 +976,15 @@ function HubAdminPage({ groups = false, companyJoin = false, directory = false }
914
976
  if (!(await confirmDialog({ message: hw("approveAsk", compareGroups(p.fingerprint)), confirmLabel: hw("approve") }))) return;
915
977
  setMsg(null);
916
978
  const r = await hubClient().approvePairing(p.id, p.fingerprint);
917
- if (!r.ok) setMsg(errText(r));
979
+ // M-2988 #12: "denied" here is the owner — no longer eligible in the directory, or blocked from connecting a Fleet — not you.
980
+ if (!r.ok) setMsg(r.code === "denied" && p.owner && p.owner.name ? newer("approveOwnerDenied", [p.owner.name], () => errText(r)) : errText(r));
918
981
  reload();
919
982
  };
920
983
  const revoke = async (f) => {
921
- if (!(await confirmDialog({ message: hw("revokeFleetAsk", f.owner ? f.owner.name : f.id), confirmLabel: hw("revoke"), danger: true }))) return;
984
+ // M-2988 #16: name the Fleet as the list does, so one owner's two Fleets can be told apart.
985
+ const who = f.owner ? f.owner.name : f.id;
986
+ const message = typeof f.label === "string" && f.label ? newer("revokeFleetNamedAsk", [f.label, who], () => hw("revokeFleetAsk", who)) : hw("revokeFleetAsk", who);
987
+ if (!(await confirmDialog({ message, confirmLabel: hw("revoke"), danger: true }))) return;
922
988
  setMsg(null);
923
989
  const r = await hubClient().revokeFleet(f.id);
924
990
  if (!r.ok) setMsg(errText(r));
@@ -958,13 +1024,20 @@ function HubAdminPage({ groups = false, companyJoin = false, directory = false }
958
1024
  : html`<span class="tag warn">${ho("waitingOwner")}</span>`}
959
1025
  </div>`)}</div>` : null}
960
1026
  </section></${ManualFrame}>
961
- <section class="card"><h3>${ho("pairedFleets", fleets.length)}</h3>
962
- ${fleets.length ? html`<div class="hub-rows">${fleets.map((f) => html`<div key=${f.id} class="s-row hub-row">
963
- <${Avatar} name=${f.owner ? f.owner.name : "?"} size="sm" />
964
- <span class="hub-row-text"><strong>${ho("fleetOf", f.owner ? f.owner.name : "—")}</strong>${f.owner ? html`<small class="note"><code>${f.owner.login}</code></small>` : null}</span>
965
- ${f.status === "active" ? html`<span class="tag ok">${ho("active")}</span><${Menu} label=${ho("rowMenu", f.owner ? f.owner.name : f.id)} items=${[{ key: "revoke", label: ho("revokeItem"), icon: "trash", danger: true, onSelect: () => revoke(f) }]} />`
966
- : html`<span class="tag">${ho("revokedTag")}</span>`}
967
- </div>`)}</div>` : html`<p class="note">${ho("noFleets")}</p>`}
1027
+ <section class="card hub-fleet-list"><h3>${ho("pairedFleets", fleets.filter((f) => f.status !== "revoked").length)}</h3>
1028
+ ${fleets.length ? (() => {
1029
+ // Spec 1.2: the row's title is the Fleet's label (S1 overview), its subtitle the owner; active first, revoked folded.
1030
+ const row = (f) => html`<div key=${f.id} class="s-row hub-row" data-fleet=${f.id}>
1031
+ <${Avatar} name=${f.owner ? f.owner.name : "?"} size="sm" />
1032
+ <span class="hub-row-text"><strong>${typeof f.label === "string" && f.label ? f.label : ho("fleetOf", f.owner ? f.owner.name : "—")}</strong>${f.owner ? html`<small class="note">${f.owner.name}${f.owner.login ? html` · <code>${f.owner.login}</code>` : null}</small>` : null}</span>
1033
+ ${f.status === "active" ? html`<span class="tag ok">${ho("active")}</span><${Menu} label=${ho("rowMenu", f.label || (f.owner ? f.owner.name : f.id))} items=${[{ key: "revoke", label: ho("revokeItem"), icon: "trash", danger: true, onSelect: () => revoke(f) }]} />`
1034
+ : html`<span class="tag">${ho("revokedTag")}</span>`}
1035
+ </div>`;
1036
+ const current = fleets.filter((f) => f.status !== "revoked").sort((a, b) => (a.status === "active" ? 0 : 1) - (b.status === "active" ? 0 : 1));
1037
+ const revoked = fleets.filter((f) => f.status === "revoked");
1038
+ return html`${current.length ? html`<div class="hub-rows">${current.map(row)}</div>` : html`<p class="note">${ho("noFleets")}</p>`}
1039
+ ${revoked.length ? html`<details class="s-ui-disclosure hub-fleets-revoked"><summary>${t("hubFleetList.revoked", revoked.length)}</summary><div class="hub-rows">${revoked.map(row)}</div></details>` : null}`;
1040
+ })() : html`<p class="note">${ho("noFleets")}</p>`}
968
1041
  </section>
969
1042
  <${LazyThisHub} directory=${directory} />
970
1043
  </div></div>`;
@@ -1,6 +1,8 @@
1
- // #1218 phase 1: one instance's Log (紀錄) — its work step by step: what it was asked, what it answered (never its
2
- // thinking), each tool call with its arguments and result, errors, where each turn ended, and fleet events (a crash, a
3
- // restart, a prompt waiting). Between View and Details (/ui/log/<name>). Behind the session gate (/ui/js/); offered on
1
+ // #1218 phase 1: one instance's Log (紀錄) — its work step by step: what it was asked, what it answered, each tool call with its
2
+ // arguments and result, errors, where each turn ended, and fleet events (a crash, a restart, a prompt waiting). This page never asks
3
+ // for thinking (GET /ui/steps without `thinking`); the chat's activity timeline does, for an admin session on the local dashboard
4
+ // (AGEND-181, chat-activity.js) — the step row is the one they share (log-row.js), so the row can draw thinking, this page just never
5
+ // receives any. Between View and Details (/ui/log/<name>). Behind the session gate (/ui/js/); offered on
4
6
  // the public link too (the user's decision), read-only, with the same masking.
5
7
  //
6
8
  // On demand only (the user's decision on load): off by default (web.log_tab) — the tab says so, and offers to turn it
@@ -20,11 +22,11 @@ import { PanelHeader, setTitle, statusClass, statusLabel, openDrawer } from "/as
20
22
  import { InstanceSwitch } from "/assets/instance-switch.js";
21
23
  import { HeaderSlot, HeaderTools } from "/assets/header-tools.js";
22
24
  import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
23
- import { Icon } from "/assets/ui-icons.js";
24
25
  import { toast } from "/assets/ui-toast.js";
25
- import "/assets/chat-strings.js";
26
- import { chatTime, chatTimeFull } from "/assets/chat-time.js";
27
26
  import { confirmedWrite } from "./settings-confirm.js";
27
+ import { LogRow, mergeSteps, timeline, collapse, tl } from "./log-row.js";
28
+ // The step helpers live with the row (log-row.js, shared with the chat's timeline); the Log's own tests read them here.
29
+ export { mergeSteps, timeline, collapse };
28
30
 
29
31
  register("log", {
30
32
  en: {
@@ -47,15 +49,6 @@ register("log", {
47
49
  empty: "Nothing here yet.", olderLoad: "Load older steps", olderStart: "The start of what can be read.", loading: "Loading…",
48
50
  olderTrimmed: "Older steps were let go to keep this page light. Open the Log again to read further back.",
49
51
  all: "All", tools: "Tools", errors: "Errors", filter: "Show", live: "Live", reset: "A new conversation began: showing it from its latest steps.",
50
- user: "Asked", assistant: "Replied", error: "Error", errorCode: "Error {0}", turnEnd: "Turn ended", turnEndIn: "Turn ended · {0}",
51
- compacted: "Conversation compacted", turn: "Turn",
52
- running: "running", done: "done", failed: "failed", interrupted: "interrupted", exit: "exit {0}",
53
- showScreen: "Show what was on screen", hideScreen: "Hide what was on screen",
54
- showOutput: "Show output", hideOutput: "Hide output", args: "Arguments", output: "Output", noOutput: "No output.",
55
- showAll: "Show all", showLess: "Show less", cut: "… {0} more characters not shown.", tooLarge: "Output of {0}: only its start is shown.",
56
- times: "×{0}", newer: "{0} new",
57
- cat_read: "Read", cat_edit: "Edit", cat_search: "Search", cat_run: "Run", cat_web: "Web", cat_mcp: "MCP", cat_agent: "Sub-agent",
58
- cat_plan: "Plan", cat_message: "Message", cat_other: "Tool", plan_items: "{0} items",
59
52
  ev_crash_respawn: "Crashed and restarted", ev_crash_loop: "Keeps crashing", ev_hang_detected: "Looks stuck", ev_hang_action: "Stuck: acted on",
60
53
  ev_instance_paused: "Paused", ev_instance_resumed: "Resumed", ev_interactive_prompt: "Waiting at a prompt", ev_interactive_prompt_assist: "Prompt: asked for help", ev_remote_card: "Asked a question (posted to chat)", ev_remote_card_answer: "Question answered from chat",
61
54
  ev_dialog_parked: "A dialog waits", ev_model_failover: "Switched to another model", ev_model_recovered: "Model back",
@@ -86,15 +79,6 @@ register("log", {
86
79
  empty: "目前還沒有內容。", olderLoad: "載入更早的步驟", olderStart: "已經是能讀到的最早內容。", loading: "載入中…",
87
80
  olderTrimmed: "為了讓頁面保持輕快,較早的步驟已移出。重新開啟「紀錄」就能往前讀。",
88
81
  all: "全部", tools: "工具", errors: "錯誤", filter: "顯示", live: "即時", reset: "開始了新的對話:從它最新的步驟顯示。",
89
- user: "收到要求", assistant: "回覆", error: "錯誤", errorCode: "錯誤 {0}", turnEnd: "回合結束", turnEndIn: "回合結束 · {0}",
90
- compacted: "對話已壓縮", turn: "回合",
91
- running: "執行中", done: "完成", failed: "失敗", interrupted: "中斷", exit: "結束碼 {0}",
92
- showScreen: "顯示當時的畫面", hideScreen: "隱藏當時的畫面",
93
- showOutput: "顯示輸出", hideOutput: "隱藏輸出", args: "參數", output: "輸出", noOutput: "沒有輸出。",
94
- showAll: "顯示全部", showLess: "收合", cut: "… 還有 {0} 個字元沒有顯示。", tooLarge: "輸出共 {0},只顯示開頭。",
95
- times: "×{0}", newer: "{0} 則新的",
96
- cat_read: "讀取", cat_edit: "編輯", cat_search: "搜尋", cat_run: "執行", cat_web: "網頁", cat_mcp: "MCP", cat_agent: "子 agent",
97
- cat_plan: "計畫", cat_message: "訊息", cat_other: "工具", plan_items: "{0} 項",
98
82
  ev_crash_respawn: "當機後重新啟動", ev_crash_loop: "反覆當機", ev_hang_detected: "看起來卡住了", ev_hang_action: "卡住:已處理",
99
83
  ev_instance_paused: "已暫停", ev_instance_resumed: "已繼續", ev_interactive_prompt: "停在提示上等待", ev_interactive_prompt_assist: "提示:已請求協助", ev_remote_card: "提出問題(已貼到聊天)", ev_remote_card_answer: "問題已從聊天回答",
100
84
  ev_dialog_parked: "有對話框在等待", ev_model_failover: "改用另一個模型", ev_model_recovered: "模型恢復",
@@ -106,7 +90,6 @@ register("log", {
106
90
  ev_supervision_ended: "監督結束", ev_tmux_server_crash: "tmux 當掉", ev_malformed_tool_call: "格式錯誤的工具呼叫", ev_health_check_error: "健康檢查錯誤", ev_context_lost: "改用全新對話:context 遺失", ev_working_state: "工作狀態紀錄", ev_kiro_reconcile: "Kiro 對話接續處理",
107
91
  },
108
92
  });
109
- const tl = (key, ...a) => t(`log.${key}`, ...a);
110
93
  /** Why a kiro Log shows fleet events only (kiro-log-gate.ts): each is worded above. */
111
94
  export const KIRO_REASONS = new Set(["kiro_not_running", "kiro_v3", "kiro_engine_unknown", "kiro_legacy", "kiro_fresh", "kiro_v2_root", "kiro_no_profile", "kiro_session_unobservable"]);
112
95
 
@@ -116,87 +99,8 @@ export const POLL_MS = 4000;
116
99
  export const RENEW_MS = 30_000;
117
100
  /** Steps kept in the page; older ones beyond it are dropped from the top (the server still has them). */
118
101
  export const PAGE_MAX = 1000;
119
- /** A text longer than this many lines is folded until opened. */
120
- const FOLD_LINES = 8;
121
-
122
- // The app's own SVG icons (never emoji: a device without an emoji font shows boxes).
123
- const CAT_ICON = { read: "file", edit: "edit", search: "search", run: "code", web: "globe", mcp: "plug", agent: "team", plan: "tasks", message: "send", other: "sliders" };
124
- const KIND_ICON = { user: "user", assistant: "bot", error: "alert", turn_end: "stop", state: "info", event: "bell" };
125
-
126
- function size(bytes) {
127
- if (bytes >= 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
128
- if (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`;
129
- return `${bytes} B`;
130
- }
131
- function duration(ms) {
132
- if (!(ms >= 0)) return "";
133
- if (ms < 1000) return `${ms} ms`;
134
- const s = ms / 1000;
135
- if (s < 60) return `${s < 10 ? s.toFixed(1) : Math.round(s)} s`;
136
- const m = Math.floor(s / 60);
137
- return `${m} m ${Math.round(s - m * 60)} s`;
138
- }
139
- const eventLabel = (type) => { const k = `log.ev_${type}`; const v = t(k); return v === k ? String(type).replace(/_/g, " ") : v; };
140
-
141
- /**
142
- * Merge `incoming` steps into `list` (array, in order): one with an id already there replaces it in place (a result
143
- * completing its call); a new one is added — at the end, or before everything when `older`. Returns a new array.
144
- */
145
- export function mergeSteps(list, incoming, older = false) {
146
- const at = new Map(list.map((s, i) => [s.id, i]));
147
- const fresh = new Map();
148
- const next = list.slice();
149
- const added = [];
150
- for (const s of incoming) {
151
- const i = at.get(s.id);
152
- if (i !== undefined) {
153
- // An older page never overwrites what a newer read already said about the same step — except to name a call the
154
- // newer page knew only by its result (the call's record was older than that page): its tool, subject and input.
155
- // A newer read that saw only a call's result (the call was before where it read) never unnames the call: its tool,
156
- // category and start time stay; the outcome is the newer read's.
157
- if (!older) next[i] = s.kind === "tool" && !s.tool && next[i].tool
158
- ? { ...next[i], ...s, tool: next[i].tool, cat: next[i].cat, ts: next[i].ts }
159
- : { ...next[i], ...s };
160
- else if (next[i].kind === "tool" && !next[i].tool && s.tool) {
161
- const { tool, cat, subject, input, ts } = s;
162
- next[i] = { ...next[i], tool, cat, ...(subject !== undefined ? { subject } : {}), ...(input !== undefined ? { input } : {}), ...(ts ? { ts } : {}) };
163
- }
164
- } else if (fresh.has(s.id)) {
165
- // The same step twice in one answer (never from the server's parser, whose ids are unique): the later one wins.
166
- added[fresh.get(s.id)] = { ...added[fresh.get(s.id)], ...s };
167
- } else { fresh.set(s.id, added.length); added.push(s); }
168
- }
169
- return older ? [...added, ...next] : [...next, ...added];
170
- }
171
-
172
- /** Steps and fleet events in one timeline: events placed by time among the steps (steps keep their file order). */
173
- export function timeline(steps, events) {
174
- const evs = events.slice().sort((a, b) => a.ts - b.ts || a.id - b.id);
175
- const out = [];
176
- let e = 0;
177
- for (const s of steps) {
178
- while (e < evs.length && s.ts > 0 && evs[e].ts <= s.ts) out.push({ kind: "event", ...evs[e++] });
179
- out.push(s);
180
- }
181
- while (e < evs.length) out.push({ kind: "event", ...evs[e++] });
182
- return out;
183
- }
184
102
 
185
103
  const isError = (x) => x.kind === "error" || (x.kind === "event" && x.type !== "working_state") || x.status === "failed" || x.status === "interrupted";
186
- /** Consecutive identical finished tool steps (same tool, subject and status) as one row with a count: a loop shows. */
187
- export function collapse(items) {
188
- const out = [];
189
- for (const x of items) {
190
- const prev = out[out.length - 1];
191
- if (prev && x.kind === "tool" && prev.kind === "tool" && x.status !== "running" && prev.status === x.status
192
- && prev.tool === x.tool && (prev.subject || "") === (x.subject || "") && prev.turn === x.turn) {
193
- prev.repeat = (prev.repeat || 1) + 1;
194
- continue;
195
- }
196
- out.push({ ...x });
197
- }
198
- return out;
199
- }
200
104
 
201
105
  export function LogPanel({ route, navKey }) {
202
106
  const pane = paneContext.usePane?.();
@@ -373,7 +277,7 @@ function LogView({ name, inst, navKey, exec, awaiting }) {
373
277
  ? html`<div class="log-older"><button type="button" class="btn btn-sm" disabled=${older.busy} onClick=${loadOlder}>${older.busy ? tl("loading") : tl("olderLoad")}</button></div>`
374
278
  : cursor.current.trimmed ? html`<p class="note log-start">${tl("olderTrimmed")}</p>`
375
279
  : steps.length ? html`<p class="note log-start">${tl("olderStart")}</p>` : null}
376
- ${items.length ? html`<ol class="log-list" role="log" aria-label=${t("app.log")}>${items.map((x, i) => html`<${Row} key=${`${x.kind}:${x.id}`} x=${x} prev=${items[i - 1]} />`)}</ol>`
280
+ ${items.length ? html`<ol class="log-list" role="log" aria-label=${t("app.log")}>${items.map((x, i) => html`<${LogRow} key=${`${x.kind}:${x.id}`} x=${x} prev=${items[i - 1]} />`)}</ol>`
377
281
  : html`<p class="note log-empty">${tl("empty")}</p>`}`;
378
282
  }
379
283
  const tools = state.phase === "on" ? html`<div data-trust="panel-controls" class="log-bar" role="group" aria-label=${tl("filter")}>
@@ -385,53 +289,4 @@ function LogView({ name, inst, navKey, exec, awaiting }) {
385
289
  <div data-trust="panel-content" class="panel-body log-body" ref=${scroller} onScroll=${onScroll}><div class="col log-col">${content}</div></div>
386
290
  </div>`;
387
291
  }
388
-
389
- /** One line of the Log. */
390
- function Row({ x, prev }) {
391
- const [open, setOpen] = useState(false);
392
- const [full, setFull] = useState(false);
393
- const time = x.ts ? chatTime(x.ts, { yesterday: (hm) => t("chat.yesterdayAt", hm) }) : "";
394
- const title = x.ts ? chatTimeFull(x.ts) : "";
395
- const newTurn = x.kind === "user" && prev && prev.turn !== x.turn;
396
- const head = (icon, label, extra) => html`<div class="log-head"><span class="log-icon" aria-hidden="true"><${Icon} name=${icon} size=${14} /></span>
397
- <span class="log-label">${label}</span>${extra || null}<span class="grow"></span><span class="log-time" title=${title}>${time}</span></div>`;
398
- const text = (body, cut, bytes) => {
399
- if (!body) return null;
400
- const lines = body.split("\n").length;
401
- const folded = !full && lines > FOLD_LINES;
402
- return html`<div class=${`log-text${folded ? " folded" : ""}`}>${body}</div>
403
- ${lines > FOLD_LINES ? html`<button type="button" class="link-btn log-more" onClick=${() => setFull(!full)}>${full ? tl("showLess") : tl("showAll")}</button>` : null}
404
- ${cut ? html`<p class="note">${tl("cut", cut.toLocaleString())}</p>` : null}
405
- ${bytes ? html`<p class="note">${tl("tooLarge", size(bytes))}</p>` : null}`;
406
- };
407
- let row;
408
- if (x.kind === "event") {
409
- // M-2269: a dialog or prompt AgEnD saw (the CLI never writes it to its transcript): its text as it was on screen,
410
- // folded until asked for. Text only (a text node), masked by the server.
411
- row = html`${head(KIND_ICON.event, eventLabel(x.type))}${x.detail ? html`<div class="log-text muted">${x.detail}</div>` : null}
412
- ${x.screen ? html`<button type="button" class="link-btn log-toggle log-screen-toggle" aria-expanded=${open ? "true" : "false"} onClick=${() => setOpen(!open)}>${open ? tl("hideScreen") : tl("showScreen")}</button>` : null}
413
- ${x.screen && open ? html`<div class="log-detail"><div class="log-text mono log-screen">${x.screen}</div></div>` : null}`;
414
- } else if (x.kind === "user" || x.kind === "assistant") {
415
- row = html`${head(KIND_ICON[x.kind], tl(x.kind))}${text(x.body, x.bodyCut)}`;
416
- } else if (x.kind === "error") {
417
- row = html`${head(KIND_ICON.error, x.note ? tl("errorCode", x.note) : tl("error"))}${text(x.body, x.bodyCut)}`;
418
- } else if (x.kind === "turn_end") {
419
- row = head(KIND_ICON.turn_end, x.durationMs ? tl("turnEndIn", duration(x.durationMs)) : tl("turnEnd"),
420
- x.status && x.status !== "done" ? html`<span class=${`log-status ${x.status}`}>${tl(x.status)}</span>` : null);
421
- } else if (x.kind === "state") {
422
- row = head(KIND_ICON.state, x.note === "compacted" ? tl("compacted") : x.note || "");
423
- } else {
424
- const cat = x.cat || "other";
425
- const subject = cat === "plan" && x.subject ? tl("plan_items", x.subject) : x.subject || "";
426
- const status = html`<span class=${`log-status ${x.status || "done"}`}>${x.status === "running" ? html`<span class="spinner" aria-hidden="true"></span>` : null}${tl(x.status || "done")}${typeof x.exitCode === "number" && x.exitCode !== 0 ? ` · ${tl("exit", x.exitCode)}` : ""}${x.durationMs ? ` · ${duration(x.durationMs)}` : ""}</span>`;
427
- const label = html`<span class="log-cat">${tl(`cat_${cat}`)}</span>${subject ? html` <span class="log-subject mono">${subject}</span>` : null}${x.tool && !subject ? html` <span class="log-tool mono muted">${x.tool}</span>` : null}`;
428
- const has = !!(x.body || x.input || x.bodyBytes);
429
- row = html`${head(CAT_ICON[cat] || CAT_ICON.other, label, html`${x.repeat ? html`<span class="log-repeat">${tl("times", x.repeat)}</span>` : null}${status}`)}
430
- ${has ? html`<button type="button" class="link-btn log-toggle" aria-expanded=${open ? "true" : "false"} onClick=${() => setOpen(!open)}>${open ? tl("hideOutput") : tl("showOutput")}</button>` : null}
431
- ${open ? html`<div class="log-detail">
432
- ${x.input ? html`<div class="log-sec"><span class="log-sec-h">${tl("args")}</span><div class="log-text mono">${x.input}</div>${x.inputCut ? html`<p class="note">${tl("cut", x.inputCut.toLocaleString())}</p>` : null}</div>` : null}
433
- <div class="log-sec"><span class="log-sec-h">${tl("output")}</span>${x.body ? text(x.body, x.bodyCut, x.bodyBytes) : html`<p class="note">${tl("noOutput")}</p>`}</div></div>` : null}`;
434
- }
435
- return html`<li class=${`log-item k-${x.kind}${x.status ? ` s-${x.status}` : ""}${newTurn ? " turn-start" : ""}`}>${row}</li>`;
436
- }
437
292
  LogPanel.workspaceVersion = 1;