@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
@@ -73,6 +73,8 @@ export function createChatStore(deps) {
73
73
  };
74
74
  }
75
75
  const pastedTexts = new WeakMap();
76
+ const draftVersions = new Map(), draftTickets = new WeakSet();
77
+ const editDraft = name => draftVersions.set(name, (draftVersions.get(name) || 0) + 1);
76
78
  const now = deps.now || (() => (typeof performance !== "undefined" ? performance.now() : Date.now()));
77
79
  const t = deps.t, tf = deps.t;
78
80
  const liveReplies = createLiveAgentReplies(now);
@@ -359,6 +361,7 @@ export function createChatStore(deps) {
359
361
  files: files.map((f) => ({ file: f, name: f.name || "file", size: f.size || 0, type: f.type || "", url: objectUrl(f), loaded: 0, total: f.size || 0, state: "waiting", id: null })),
360
362
  };
361
363
  (s.outgoing[target] = s.outgoing[target] || []).push(e);
364
+ editDraft(target);
362
365
  s.drafts[target] = "";
363
366
  s.pendingFiles[target] = [];
364
367
  if (quote) delete s.replies[target];
@@ -456,6 +459,7 @@ export function createChatStore(deps) {
456
459
  const e = list.find((x) => x.clientId === clientId);
457
460
  if (!e || e.outgoing.state !== "failed") return;
458
461
  const draft = s.drafts[target] || "";
462
+ editDraft(target);
459
463
  s.drafts[target] = e.text ? (draft ? e.text + "\n" + draft : e.text) : draft;
460
464
  for (const f of e.files) freeUrl(f.url);
461
465
  s.outgoing[target] = list.filter((x) => x !== e);
@@ -466,11 +470,12 @@ export function createChatStore(deps) {
466
470
  function addFiles(target, list) {
467
471
  if (!target) return;
468
472
  const res = R().checkFiles(s.pendingFiles[target] || [], [...(list || [])]);
473
+ editDraft(target);
469
474
  s.pendingFiles[target] = res.kept;
470
475
  for (const x of res.rejected) { const why = R().fileRejection(x.reason); deps.toast(`${x.name}: ${t(why.key, ...why.values)}`, false); }
471
476
  changed(target);
472
477
  }
473
- function removeFile(target, index) { (s.pendingFiles[target] || []).splice(index, 1); changed(target); }
478
+ function removeFile(target, index) { editDraft(target); (s.pendingFiles[target] || []).splice(index, 1); changed(target); }
474
479
  /** A long paste as a .txt file when it fits beside what is attached; true when it was attached. */
475
480
  function attachPastedText(target, text) {
476
481
  if (!target) return false;
@@ -487,6 +492,7 @@ export function createChatStore(deps) {
487
492
  function fileBackAsText(target, index) {
488
493
  const f = (s.pendingFiles[target] || [])[index];
489
494
  if (!f || !pastedTexts.has(f)) return;
495
+ editDraft(target);
490
496
  s.pendingFiles[target].splice(index, 1);
491
497
  const draft = s.drafts[target] || "";
492
498
  s.drafts[target] = draft ? `${draft}\n${pastedTexts.get(f)}` : pastedTexts.get(f);
@@ -494,11 +500,45 @@ export function createChatStore(deps) {
494
500
  }
495
501
  const isPasted = (f) => pastedTexts.has(f);
496
502
  /** Typing stays local. */
497
- function setDraft(target, value) { s.drafts[target] = value; }
503
+ function setDraft(target, value) { editDraft(target); s.drafts[target] = value; }
504
+ /** #3637: one page-local, compare-and-clear ticket. No outgoing requests or persistent storage. */
505
+ function captureDraft(name) {
506
+ const ticket = { name, version: draftVersions.get(name) || 0, reply: s.replies[name],
507
+ payload: { text: s.drafts[name] || "", files: [...(s.pendingFiles[name] || [])], reply: s.replies[name] ? { ...s.replies[name] } : null } };
508
+ draftTickets.add(ticket); return ticket;
509
+ }
510
+ function draftCurrent(ticket) {
511
+ return draftTickets.has(ticket) && ticket.version === (draftVersions.get(ticket.name) || 0)
512
+ && ticket.payload.text === (s.drafts[ticket.name] || "") && ticket.reply === s.replies[ticket.name]
513
+ && ticket.payload.files.length === (s.pendingFiles[ticket.name] || []).length
514
+ && ticket.payload.files.every((file, i) => file === s.pendingFiles[ticket.name][i]);
515
+ }
516
+ function clearCapturedDraft(ticket) {
517
+ if (!draftCurrent(ticket)) return false;
518
+ draftTickets.delete(ticket); editDraft(ticket.name);
519
+ s.drafts[ticket.name] = ""; s.pendingFiles[ticket.name] = []; delete s.replies[ticket.name]; changed(ticket.name); return true;
520
+ }
521
+ function acceptDraft(name, data) {
522
+ if (!data || Object.keys(data).sort().join(",") !== "files,reply,text" || typeof data.text !== "string" || data.text.length > 1_000_000
523
+ || !Array.isArray(data.files) || data.files.length > R().fileLimits().maxFiles
524
+ || data.files.some(file => typeof File !== "function" || !(file instanceof File))
525
+ || (s.drafts[name] || "") || (s.pendingFiles[name] || []).length || s.replies[name]) return false;
526
+ const reply = data.reply;
527
+ if (reply !== null && (!reply || Object.keys(reply).some(key => !["boot", "id", "sender", "text", "media"].includes(key))
528
+ || typeof reply.boot !== "string" || reply.boot.length > 128 || !Number.isSafeInteger(reply.id) || reply.id < 0
529
+ || typeof reply.sender !== "string" || reply.sender.length > 1000 || typeof reply.text !== "string" || reply.text.length > 160
530
+ || (reply.media !== undefined && !["photo", "document"].includes(reply.media)))) return false;
531
+ const files = R().checkFiles([], data.files);
532
+ if (files.rejected.length || files.kept.length !== data.files.length) return false;
533
+ editDraft(name); s.drafts[name] = data.text; s.pendingFiles[name] = files.kept;
534
+ if (reply) s.replies[name] = { ...reply };
535
+ changed(name); return true;
536
+ }
498
537
  /** #2911: a line added to the composer for the person to edit (after what is typed, on its own line; never twice). */
499
538
  function addToDraft(target, line) {
500
539
  const d = s.drafts[target] || "";
501
540
  if (!target || !line || d.split("\n").includes(line)) return;
541
+ editDraft(target);
502
542
  s.drafts[target] = d ? `${d.replace(/\n+$/, "")}\n${line}` : line;
503
543
  changed(target);
504
544
  }
@@ -508,11 +548,12 @@ export function createChatStore(deps) {
508
548
  */
509
549
  function startReply(target, m) {
510
550
  if (!target || !m || typeof m.boot !== "string" || typeof m.id !== "number") return;
551
+ editDraft(target);
511
552
  s.replies[target] = { boot: m.boot, id: m.id, sender: String(m.sender || ""), text: String(m.click?.label ?? m.text ?? "").replace(/\s+/g, " ").trim().slice(0, 160),
512
553
  media: (m.attachments || []).length ? ((m.attachments || []).some(a => a.kind === "photo") ? "photo" : "document") : undefined };
513
554
  changed(target);
514
555
  }
515
- function clearReply(target) { if (s.replies[target]) { delete s.replies[target]; changed(target); } }
556
+ function clearReply(target) { if (s.replies[target]) { editDraft(target); delete s.replies[target]; changed(target); } }
516
557
  /**
517
558
  * #2272: the quoted message, drawn for a jump: in what this chat holds, or after reading the longest history the
518
559
  * server keeps for it (the newest 500). false: no longer kept.
@@ -636,7 +677,7 @@ export function createChatStore(deps) {
636
677
  onPrompt, applyPrompts, resolvePrompt, answerPrompt, answerByNonce, holdPrompt, releasePrompt, promptsFor,
637
678
  applyReplyButtons, clickReplyButton,
638
679
  uploadFile, send, retryOutgoing, deleteOutgoing, putBackOutgoing, threadRows, addFiles, removeFile, attachPastedText, fileBackAsText, isPasted, setDraft,
639
- startReply, clearReply, findQuoted, addToDraft,
680
+ startReply, clearReply, findQuoted, addToDraft, captureDraft, draftCurrent, clearCapturedDraft, acceptDraft,
640
681
  cancelReply, isUser, runCommand, dismissCommand, commandFree,
641
682
  allHidden: (name) => s.allHidden.has(name),
642
683
  };
@@ -0,0 +1,177 @@
1
+ import { createStore } from "/assets/app-store.js";
2
+ import { register, t } from "/assets/app-i18n.js";
3
+ import { isSafeInstanceName } from "/assets/app-route.js";
4
+ import { dropBox, dropZone, floatBox, splitSize } from "/assets/pane-geometry.js";
5
+
6
+ register("paneGeometry", {
7
+ en: { float: "Free floating pane", move: "Move floating pane", resize: "Resize floating pane", sash: "Resize chat panes", reset: "Reset to equal halves",
8
+ left: "Dock left", right: "Dock right", top: "Dock above", bottom: "Dock below", center: "Replace this pane", help: "Arrow keys move or resize; Shift makes larger steps. Enter applies, Esc cancels.", changed: "Pane arrangement updated.", resized: "Pane size updated." },
9
+ "zh-TW": { float: "自訂移動", move: "移動浮窗", resize: "調整浮窗大小", sash: "調整對話窗格大小", reset: "重設為各半",
10
+ left: "停靠左側", right: "停靠右側", top: "停靠上方", bottom: "停靠下方", center: "取代此格", help: "用方向鍵移動或調整大小,Shift 加大幅度;Enter 套用,Esc 取消。", changed: "已更新窗格排列。", resized: "已更新窗格大小。" },
11
+ });
12
+ export const geometryText = key => t(`paneGeometry.${key}`);
13
+ const modified = e => e.ctrlKey || e.metaKey || e.altKey || e.isComposing || e.getModifierState?.("AltGraph");
14
+ const sameBounds = (a, b) => ["left", "top", "width", "height"].every(key => a[key] === b[key]);
15
+
16
+ /** Page-local gestures only. One owned native drag or pointer/keyboard operation; never a transport or write runner. */
17
+ export function createWorkspaceGestures({ controller, getRoot, onDrop = (name, target, zone) => controller.dock(name, target, zone) }) {
18
+ const doc = document, win = window;
19
+ const store = createStore({ transient: null, keyboard: null, announcement: "" });
20
+ let alive = true, active = null, overlay = null;
21
+ const usable = () => {
22
+ const root = getRoot(), rect = root?.getBoundingClientRect();
23
+ return alive && root?.isConnected && rect?.width >= 760 && win.innerWidth >= 1200 && !root.classList.contains("ws-compact")
24
+ && !doc.querySelector('dialog[open], [role="dialog"][aria-modal="true"]');
25
+ };
26
+ const valid = a => alive && active === a && controller.stamp() === a.stamp && getRoot() === a.root && usable() && sameBounds(a.bounds, a.root.getBoundingClientRect());
27
+ const hideOverlay = () => { overlay?.remove(); overlay = null; };
28
+ const locate = (x, y) => {
29
+ const w = controller.current(), root = getRoot();
30
+ const ids = w?.layout === "float" ? [w.floating, w.floating === "a" ? "b" : "a"] : ["a", "b"];
31
+ if (!w) return { id: "a", rect: root.getBoundingClientRect() };
32
+ for (const id of ids) {
33
+ const rect = root.querySelector(`[data-pane="${id}"]`)?.getBoundingClientRect();
34
+ if (rect && dropZone(rect, x, y)) return { id, rect };
35
+ }
36
+ return null;
37
+ };
38
+ const preview = (a, x, y, floating = false) => {
39
+ a.target = null;
40
+ const hit = floating ? { id: a.id === "a" ? "b" : "a", rect: a.bounds } : locate(x, y);
41
+ if (!hit) { hideOverlay(); return; }
42
+ const zone = dropZone(hit.rect, x, y);
43
+ if (!zone || (floating && zone === "center")) { hideOverlay(); return; }
44
+ a.target = { id: hit.id, zone };
45
+ // Keep the browser's native drop target alive between dragover and drop.
46
+ if (!overlay) {
47
+ overlay = doc.createElement("div"); overlay.className = "ws-drop-overlay"; overlay.setAttribute("aria-hidden", "true");
48
+ const box = doc.createElement("div"); box.className = "ws-drop-target"; box.appendChild(doc.createElement("span")); overlay.appendChild(box); doc.body.appendChild(overlay);
49
+ }
50
+ const box = overlay.firstElementChild, label = box.firstElementChild, rect = dropBox(hit.rect, zone);
51
+ box.setAttribute("data-zone", zone); box.setAttribute("data-target", hit.id); label.textContent = geometryText(zone);
52
+ // CSSOM follows the preview/sidebar resizers; no CSP-blocked style attribute or user-controlled CSS text.
53
+ for (const [key, value] of Object.entries(a.bounds)) if (["left", "top", "width", "height"].includes(key)) overlay.style.setProperty(key, `${value}px`);
54
+ for (const [key, value] of Object.entries(rect)) box.style.setProperty(key, `${value - (key === "left" ? a.bounds.left : key === "top" ? a.bounds.top : 0)}px`);
55
+ };
56
+ const finish = (commit = false) => {
57
+ const a = active; if (!a) return;
58
+ const accepted = commit && valid(a);
59
+ active = null; a.off?.(); hideOverlay(); a.root.classList.remove("ws-resizing");
60
+ store.set({ transient: null, keyboard: null });
61
+ if (!accepted) return;
62
+ if (a.target) { onDrop(a.name, a.target.id, a.target.zone); store.set({ announcement: geometryText("changed") }); }
63
+ else if (a.change) { controller.geometry(a.change); store.set({ announcement: geometryText("resized") }); }
64
+ };
65
+ const cancel = () => finish(false);
66
+ const make = (kind, id) => {
67
+ if (!usable() || active) return null;
68
+ const root = getRoot(), w = controller.current(), { left, top, width, height } = root.getBoundingClientRect();
69
+ return active = { kind, id, name: w?.[id]?.route.instance, root, bounds: { left, top, width, height }, stamp: controller.stamp(), target: null, change: null };
70
+ };
71
+ const resizeFloat = (bounds, box, dx, dy) => {
72
+ const fit = floatBox(bounds.width - box.x, bounds.height - box.y, { x: 0, y: 0, width: box.width + dx, height: box.height + dy });
73
+ return { ...fit, x: box.x, y: box.y };
74
+ };
75
+ const down = (kind, id, e) => {
76
+ if (e.button !== 0 || modified(e)) return;
77
+ const w = controller.current();
78
+ if (!w || (kind !== "sash" && (w.layout !== "float" || w.floating !== id))) return;
79
+ controller.focus(id || w.focus);
80
+ const a = make(kind, id); if (!a) return;
81
+ e.preventDefault();
82
+ if (kind !== "move") a.root.classList.add("ws-resizing");
83
+ const el = e.currentTarget, pointerId = e.pointerId, x = e.clientX, y = e.clientY;
84
+ const split = splitSize(a.bounds.width, a.bounds.height, w.layout, w.ratio), box = floatBox(a.bounds.width, a.bounds.height, w.rect);
85
+ const owns = ev => ev.pointerId === undefined || ev.pointerId === pointerId;
86
+ const move = ev => {
87
+ if (!owns(ev) || active !== a) return;
88
+ if (!valid(a)) { cancel(); return; }
89
+ const dx = ev.clientX - x, dy = ev.clientY - y;
90
+ if (kind === "move" && !a.change && Math.hypot(dx, dy) < 6) return;
91
+ a.root.classList.add("ws-resizing");
92
+ if (kind === "sash") {
93
+ const total = (w.layout === "stack" ? a.bounds.height : a.bounds.width) - 8;
94
+ a.change = { ratio: splitSize(a.bounds.width, a.bounds.height, w.layout, (split.first + (w.layout === "stack" ? dy : dx)) / total).ratio };
95
+ } else {
96
+ a.change = { rect: kind === "move" ? floatBox(a.bounds.width, a.bounds.height, { ...box, x: box.x + dx, y: box.y + dy }) : resizeFloat(a.bounds, box, dx, dy) };
97
+ if (kind === "move") preview(a, ev.clientX, ev.clientY, true);
98
+ }
99
+ store.set({ transient: a.change });
100
+ };
101
+ const up = ev => { if (owns(ev) && active === a) finish(true); }, stop = ev => { if (owns(ev) && active === a) cancel(); };
102
+ win.addEventListener("pointermove", move); win.addEventListener("pointerup", up); win.addEventListener("pointercancel", stop); el.addEventListener("lostpointercapture", stop);
103
+ a.off = () => {
104
+ win.removeEventListener("pointermove", move); win.removeEventListener("pointerup", up); win.removeEventListener("pointercancel", stop); el.removeEventListener("lostpointercapture", stop);
105
+ try { el.releasePointerCapture(pointerId); } catch { /* not captured */ }
106
+ };
107
+ try { el.setPointerCapture(pointerId); } catch { /* window listeners still own the physical drag */ }
108
+ };
109
+ const over = e => {
110
+ const a = active; if (!a || a.kind !== "dock") return;
111
+ if (!valid(a)) { cancel(); return; }
112
+ preview(a, e.clientX, e.clientY);
113
+ if (a.target) { e.preventDefault(); if (e.dataTransfer) e.dataTransfer.dropEffect = "move"; }
114
+ };
115
+ const dropped = e => {
116
+ const a = active; if (!a || a.kind !== "dock") return;
117
+ over(e);
118
+ if (active !== a) return;
119
+ if (a.target) { e.preventDefault(); e.stopPropagation(); finish(true); } else cancel();
120
+ };
121
+ const key = e => {
122
+ const a = active; if (!a || e.isComposing || modified(e)) return;
123
+ if (!valid(a)) { cancel(); return; }
124
+ if (e.key === "Escape") { e.preventDefault(); e.stopImmediatePropagation(); cancel(); return; }
125
+ if (a.kind !== "keyboard") return;
126
+ if (e.key === "Tab") { cancel(); return; }
127
+ if (e.key === "Enter") { e.preventDefault(); e.stopPropagation(); finish(true); return; }
128
+ const step = e.shiftKey ? 64 : 16;
129
+ const dx = e.key === "ArrowRight" ? step : e.key === "ArrowLeft" ? -step : 0, dy = e.key === "ArrowDown" ? step : e.key === "ArrowUp" ? -step : 0;
130
+ if (!dx && !dy) return;
131
+ e.preventDefault(); e.stopPropagation();
132
+ const box = a.change?.rect || a.box;
133
+ a.change = { rect: a.mode === "move" ? floatBox(a.bounds.width, a.bounds.height, { ...box, x: box.x + dx, y: box.y + dy }) : resizeFloat(a.bounds, box, dx, dy) };
134
+ store.set({ transient: a.change });
135
+ };
136
+ const outside = () => { if (active?.kind === "keyboard") cancel(); };
137
+ const focus = e => { if (active?.kind === "keyboard" && !active.root.querySelector(`[data-pane="${active.id}"]`)?.contains(e.target)) cancel(); };
138
+ const off = controller.subscribe(() => { if (active && !valid(active)) cancel(); });
139
+ doc.addEventListener("dragover", over, true); doc.addEventListener("drop", dropped, true); doc.addEventListener("dragend", cancel, true); doc.addEventListener("keydown", key, true); doc.addEventListener("pointerdown", outside, true); doc.addEventListener("focusin", focus, true);
140
+ win.addEventListener("blur", cancel); win.addEventListener("resize", cancel);
141
+ return {
142
+ store, cancel,
143
+ dragStart(name, e, id) {
144
+ if (!isSafeInstanceName(name) || !e.dataTransfer) return false;
145
+ if (id) controller.focus(id);
146
+ const a = make("dock", id); if (!a) return false;
147
+ a.name = name;
148
+ try { e.dataTransfer.effectAllowed = "move"; e.dataTransfer.setData("application/x-agend-pane", name); } catch { /* source ownership is local, not read from the transfer */ }
149
+ return true;
150
+ },
151
+ dragEnd: cancel,
152
+ sashDown: e => down("sash", null, e),
153
+ floatDown: (kind, id, e) => down(kind, id, e),
154
+ sashKey(e) {
155
+ const w = controller.current(), rect = getRoot()?.getBoundingClientRect();
156
+ if (!w || !rect || modified(e) || !usable() || w.layout === "float") return;
157
+ const size = splitSize(rect.width, rect.height, w.layout, w.ratio), total = size.first + size.second, step = e.shiftKey ? 64 : 16;
158
+ let first;
159
+ if (e.key === "Home") first = size.min; else if (e.key === "End") first = size.max; else if (e.key === "Enter") first = total / 2;
160
+ else if (e.key === (w.layout === "stack" ? "ArrowDown" : "ArrowRight")) first = size.first + step;
161
+ else if (e.key === (w.layout === "stack" ? "ArrowUp" : "ArrowLeft")) first = size.first - step;
162
+ else return;
163
+ e.preventDefault(); controller.geometry({ ratio: splitSize(rect.width, rect.height, w.layout, first / total).ratio }); store.set({ announcement: geometryText("resized") });
164
+ },
165
+ keyboard(mode, id) {
166
+ const w = controller.current(); if (!w || w.layout !== "float" || w.floating !== id || !["move", "resize"].includes(mode)) return;
167
+ controller.focus(id); const a = make("keyboard", id); if (!a) return;
168
+ a.mode = mode; a.box = floatBox(a.bounds.width, a.bounds.height, w.rect);
169
+ store.set({ keyboard: { mode, id } }); a.root.querySelector(`[data-pane="${id}"] h1`)?.focus();
170
+ },
171
+ close() {
172
+ if (!alive) return; cancel(); alive = false; off();
173
+ doc.removeEventListener("dragover", over, true); doc.removeEventListener("drop", dropped, true); doc.removeEventListener("dragend", cancel, true); doc.removeEventListener("keydown", key, true); doc.removeEventListener("pointerdown", outside, true); doc.removeEventListener("focusin", focus, true);
174
+ win.removeEventListener("blur", cancel); win.removeEventListener("resize", cancel);
175
+ },
176
+ };
177
+ }
@@ -1,8 +1,10 @@
1
1
  // #3637: an optional adapter to app-nav, never a second router, popstate listener or history owner.
2
2
  import { parseRoute, routePath } from "/assets/app-route.js";
3
- import { agentRoute, navigatePane, openBeside, readWorkspace, workspacePath } from "/assets/chat-workspace-model.js";
3
+ import { agentRoute, dockWorkspace, navigatePane, openBeside, readWorkspace, workspacePath } from "/assets/chat-workspace-model.js";
4
4
 
5
- export function installWorkspaceNavigation(nav, { beforeLayout = () => {}, onWorkspace = () => {} } = {}) {
5
+ export const workspaceGeometryVersion = 1;
6
+
7
+ export function installWorkspaceNavigation(nav, { beforeLayout = () => {}, onWorkspace = () => {}, geometry = false } = {}) {
6
8
  const guards = new Map(), panes = new Map(), retained = new Map();
7
9
  const dispose = record => {
8
10
  record.alive = false;
@@ -32,13 +34,13 @@ export function installWorkspaceNavigation(nav, { beforeLayout = () => {}, onWor
32
34
  if (!route || route.panel !== record.route.panel || route.instance !== record.route.instance) { dispose(record); retained.delete(key); }
33
35
  }
34
36
  if (b) onWorkspace();
35
- if (a && b && (a.layout !== b.layout || a.flipped !== b.flipped)) beforeLayout();
37
+ if (!!a !== !!b || (a && b && (a.layout !== b.layout || a.flipped !== b.flipped || a.floating !== b.floating))) beforeLayout();
36
38
  },
37
39
  resolve(url, before, { mode, opts }) {
38
40
  let w = null;
39
41
  if (mode === "navigate" && !opts.workspace && before.workspace && agentRoute(parseRoute(url.pathname)) && !url.searchParams.has("compare")) {
40
42
  w = navigatePane(before.workspace, before.workspace.focus, url);
41
- } else w = readWorkspace(url, before.workspace);
43
+ } else w = readWorkspace(url, before.workspace, geometry);
42
44
  return w ? target(w) : { route: parseRoute(url.pathname), workspace: null, path: url.pathname + url.search + url.hash };
43
45
  },
44
46
  refresh(s) {
@@ -85,6 +87,27 @@ export function installWorkspaceNavigation(nav, { beforeLayout = () => {}, onWor
85
87
  }
86
88
  return {
87
89
  current, pane,
90
+ stamp: () => nav.navStore.get(),
91
+ subscribe: fn => nav.navStore.subscribe(fn),
92
+ dock(name, target, zone) {
93
+ if (!["left", "right", "top", "bottom", "center"].includes(zone)) return;
94
+ const w = current();
95
+ if (w) { const next = dockWorkspace(w, target, zone, name); if (next !== w) go(next); return; }
96
+ const route = nav.navStore.get().route;
97
+ if (!agentRoute(route) || name === route.instance) return;
98
+ const next = openBeside(null, route, name, ["top", "bottom"].includes(zone) ? "stack" : "right");
99
+ if (!next) return;
100
+ if (zone === "center") { nav.navigate(routePath({ panel: "chat", instance: name })); return; }
101
+ const url = address(); next.a = { ...next.a, search: url.search, hash: url.hash };
102
+ next.flipped = ["left", "top"].includes(zone); go(next);
103
+ },
104
+ geometry(change) {
105
+ const w = current(); if (!w || !change) return;
106
+ const next = { ...w };
107
+ if (typeof change.ratio === "number" && Number.isFinite(change.ratio)) next.ratio = change.ratio;
108
+ if (w.layout === "float" && change.rect) { const { x, y, width, height } = change.rect; next.rect = { x, y, width, height }; }
109
+ go(next, { replace: true });
110
+ },
88
111
  focusedName: () => nav.navStore.get().route?.instance,
89
112
  open(name, layout = "right") {
90
113
  const before = current(), w = openBeside(before, nav.navStore.get().route, name, layout);
@@ -105,11 +128,12 @@ export function installWorkspaceNavigation(nav, { beforeLayout = () => {}, onWor
105
128
  });
106
129
  }
107
130
  },
108
- layout(layout) {
109
- const w = current(); if (!w || !["right", "stack"].includes(layout) || w.layout === layout) return;
110
- go({ ...w, layout });
131
+ layout(layout, floating = "b") {
132
+ const w = current(); if (!w || !["right", "stack", "float"].includes(layout) || (layout === "float" && !geometry) || (w.layout === layout && (layout !== "float" || w.floating === floating))) return;
133
+ const { floating: oldFloating, rect, ...docked } = w;
134
+ go({ ...docked, layout, ...(layout === "float" ? { floating: floating === "a" ? "a" : "b", rect: rect || null } : {}) });
111
135
  },
112
- swap() { const w = current(); if (w) go({ ...w, flipped: !w.flipped }); },
136
+ swap() { const w = current(); if (w) go({ ...w, ...(w.layout === "float" ? { floating: w.floating === "a" ? "b" : "a" } : { flipped: !w.flipped }) }); },
113
137
  closePane(id) {
114
138
  const w = current(); if (!w) return;
115
139
  const kept = w[id === "a" ? "b" : "a"];
@@ -118,8 +142,8 @@ export function installWorkspaceNavigation(nav, { beforeLayout = () => {}, onWor
118
142
  if (next.workspace || next.route?.instance !== kept.route.instance) return;
119
143
  schedule(() => { if (nav.navStore.get() === next) doc.querySelector("#main .panel-head h1")?.focus(); });
120
144
  },
121
- restore(w) { if (w) go(w, { replace: true }); },
122
- restoreAddress() { const w = readWorkspace(address()); if (w) go(w, { replace: true }); },
145
+ restore(w) { if (w && (w.layout !== "float" || geometry)) go(w, { replace: true }); },
146
+ restoreAddress() { const w = readWorkspace(address(), null, geometry); if (w) go(w, { replace: true }); },
123
147
  close() { if (!alive) return; alive = false; for (const cancel of pending) cancel(); pending.clear(); for (const record of retained.values()) dispose(record); retained.clear(); off(); },
124
148
  };
125
149
  }