@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
@@ -10,18 +10,23 @@
10
10
  * Built-ins and shared Runtime modules only: part of the Runtime bundle.
11
11
  */
12
12
  import { isNativeProviderId, nativeProvider } from "./windows-cli-providers.js";
13
- import { existsSync } from "node:fs";
13
+ import { existsSync, lstatSync, unlinkSync } from "node:fs";
14
+ import { fingerprintStore, storeWrittenSince } from "./credential-store-proof.js";
15
+ import { join } from "node:path";
14
16
  import { CliInstallError } from "./runtime-cli-install.js";
15
17
  import { parseAccountIdentity } from "./claude-auth-status.js";
16
- import { CredentialProfileRefusal, credentialProfileCaseClash, credentialProfileDirectory, isCredentialProfileCli, rememberCredentialStatus, withCredentialProfile } from "./runtime-credential-profiles.js";
18
+ import { CredentialProfileRefusal, PROFILE_CLI_NAMES, credentialProfileCaseClash, credentialProfileDirectory, credentialProfileLaunch, credentialProfileStore, isCredentialProfileCli, rememberCredentialStatus, withCredentialProfile } from "./runtime-credential-profiles.js";
17
19
  import { ProfileOwnershipRefusal, createRuntimeProfile, deleteProfileBackups, removeOwnedProfile, requireOwnedProfile, withIsolatedOwnedProfile } from "./runtime-profile-ownership.js";
18
20
  import { AuditLog, RemoteSetupRefusal, readRemoteSwitches, requireRemoteSwitch, validAuditActor } from "./runtime-remote-setup.js";
19
21
  import { ProcessNotConfirmedEnded, RuntimeSignIn, RuntimeSignInSlot, SignInRefusal } from "./runtime-signin.js";
22
+ import { isRuntimeDefaultLoginCli, runtimeFacts } from "./cli-registry.js";
20
23
  import { isRuntimeRemoteOperation, parseRuntimeRemotePayload } from "./runtime-protocol.js";
21
24
  // Defined next to `killTree` (the installer needs it too, and this module imports the installer's error): re-exported here for the existing importers.
22
25
  export { ProcessNotConfirmedEnded };
23
26
  /** The key under which an install that could not be confirmed ended keeps the Runtime busy (no profile name can be this: it holds a NUL). */
24
27
  const INSTALL_KEY = "\0cli-install";
28
+ /** What a CLI is called in a refusal (the registry's Runtime name for it). */
29
+ const cliName = (cli) => runtimeFacts(cli, "provider")?.name ?? cli;
25
30
  const NOT_AVAILABLE = "This computer's Runtime is stopping or its connection changed, so nothing was done";
26
31
  /** At most this many `accounts.check` at a time on the computer: each one can start PowerShell and the CLI. */
27
32
  export const MAX_CONCURRENT_CHECKS = 2;
@@ -40,8 +45,28 @@ function reasonOf(error) {
40
45
  return "failed";
41
46
  }
42
47
  const NEEDS_ACCOUNTS = ["models.refresh", "signin.start", "signin.capture", "signin.status", "signin.write", "accounts.check", "accounts.signout", "accounts.remove"];
48
+ /** The key of "a CLI's own login" in the pace table (no profile name can hold a NUL). */
49
+ const DEFAULT_KEY = "\0default-login:";
50
+ /** Deletes one plain file of an account's folder, by the registry's exact name: not a link, not a folder, and nothing else. A file that is not there is already signed out. */
51
+ function removeSignInFile(directory, name) {
52
+ const path = join(directory, name);
53
+ let stat;
54
+ try {
55
+ stat = lstatSync(path);
56
+ }
57
+ catch (error) {
58
+ if (error.code === "ENOENT")
59
+ return;
60
+ throw error;
61
+ }
62
+ if (!stat.isFile() || stat.isSymbolicLink())
63
+ throw new ProfileOwnershipRefusal("The account's sign-in file is not a plain file, so nothing is changed there", "link");
64
+ unlinkSync(path);
65
+ }
43
66
  /** The least time between two sign-outs or removes of one profile. It only slows a server that keeps asking; the switch and its time window are what bound the risk. */
44
67
  export const PROFILE_OP_MIN_GAP_MS = 5_000;
68
+ /** Under this pairing's folder (never under a CLI's profile folder, so it is never listed as an account): where the isolation probe's empty scratch folders are made. */
69
+ export const ISOLATION_SCRATCH = "isolation-scratch";
45
70
  const SUBSCRIPTION_ONLY = "Signing in with an Anthropic Console account is not supported from AgEnD, because that sign-in is kept outside the profile's folder. On that computer run: agend-runtime login claude-code NAME";
46
71
  export class RemoteAccounts {
47
72
  deps;
@@ -53,6 +78,8 @@ export class RemoteAccounts {
53
78
  busy = new Set();
54
79
  /** Operations of which only one may be in progress on the whole computer (its `check` and `run` are separated by awaits). */
55
80
  exclusive = new Set();
81
+ /** AGEND-250 (#3771 review P2-4): credentials held against new task admission (the computer's own login of a CLI, while a Disconnect deletes and verifies it). Read synchronously by `defaultReserved`. */
82
+ held = new Set();
56
83
  /** When a sign-out or remove of a profile (lower-case name) last passed its checks. Only profiles this Runtime created get here. */
57
84
  lastChange = new Map();
58
85
  /** Closed to new work by `stop()`; and the connection the requests in flight belong to (a change ends the old ones' right to start anything). */
@@ -110,8 +137,10 @@ export class RemoteAccounts {
110
137
  this.endWithRetry(this.meta.id, "closed");
111
138
  }
112
139
  /** Nothing of this module is running or being held: the update fence may ask. */
113
- idle() { return this.pending.size === 0 && !this.slot.current() && this.busy.size === 0 && this.retained.size === 0 && this.activeChecks === 0 && this.exclusive.size === 0; }
140
+ idle() { return this.pending.size === 0 && !this.slot.current() && this.busy.size === 0 && this.retained.size === 0 && this.activeChecks === 0 && this.exclusive.size === 0 && this.held.size === 0; }
114
141
  /** A change to this profile has been reserved or is under way: a task or terminal must not start under it now. */
142
+ /** Whether the computer's OWN login of this CLI is being changed by a Disconnect (from its first check until its verification has finished): a run or terminal that would use it is refused. */
143
+ defaultReserved(cli) { return this.held.has(`${DEFAULT_KEY}${cli}`); }
115
144
  profileReserved(name) { const key = name.toLowerCase(); return this.busy.has(key) || this.retained.has(key); }
116
145
  refreshHold() { if (this.hold && !this.slot.current()) {
117
146
  const leave = this.hold;
@@ -126,9 +155,9 @@ export class RemoteAccounts {
126
155
  requireRemoteSwitch(this.deps.pairingDirectory, switchName, this.now());
127
156
  }
128
157
  /** The last, synchronous look before a profile is renamed: the switch, the default, tasks and terminals, and a sign-in, all as they are at this instant. */
129
- finalLook(ctx, name, forRemove) {
158
+ finalLook(ctx, name, forRemove, cli = "claude-code") {
130
159
  this.gate(ctx, "accounts");
131
- if (forRemove) {
160
+ if (forRemove && cli === "claude-code") {
132
161
  let fallback;
133
162
  try {
134
163
  fallback = this.deps.defaultProfile();
@@ -208,6 +237,9 @@ export class RemoteAccounts {
208
237
  }
209
238
  this.exclusive.add(taken);
210
239
  }
240
+ const hold = steps.hold;
241
+ if (hold !== undefined)
242
+ this.held.add(hold);
211
243
  try {
212
244
  // The switch and the connection are looked at again after the checks, which can wait a long time (PowerShell, a CLI lookup): a switch turned off or
213
245
  // run out meanwhile, or a connection that has gone, stops the operation here, before anything is recorded as started.
@@ -234,13 +266,30 @@ export class RemoteAccounts {
234
266
  this.busy.delete(key);
235
267
  if (taken !== undefined)
236
268
  this.exclusive.delete(taken);
269
+ if (hold !== undefined)
270
+ this.held.delete(hold);
237
271
  }
238
272
  }
239
273
  cliOf(value) {
240
274
  if (!isCredentialProfileCli(value))
241
- throw new ProfileOwnershipRefusal("Only Claude Code accounts can be managed on a computer. Codex may keep its sign-in in the Windows Credential Manager, which a profile folder cannot hold or remove, so it is not offered yet", "unsupported");
275
+ throw new ProfileOwnershipRefusal(`Only ${PROFILE_CLI_NAMES()} accounts can be managed on a computer. Codex may keep its sign-in in the Windows Credential Manager, which a profile folder cannot hold or remove, so it is not offered yet`, "unsupported");
242
276
  return value;
243
277
  }
278
+ /** Whether a CLI is told its named account by an argument (Antigravity), which is why its sign-in is proven isolated first and its sign-out removes a file. */
279
+ static byArgument(cli) { const facts = runtimeFacts(cli, "namedAccounts"); return !!facts && "arg" in facts; }
280
+ /**
281
+ * AGEND-124: before a NAMED account of a CLI told its account by an argument is signed in, two things that need no change to be refused: the folder has a path the CLI can be given (a relative one: not
282
+ * across drives), and an empty scratch folder answers "signed out" under that launch (the CLI keeps a folder's sign-in in that folder, not in the Credential Manager that every folder shares). Anything
283
+ * else is `not_isolated`, and nothing is started. A CLI that moves its home with a variable needs neither.
284
+ */
285
+ async proveIsolated(cli, directory) {
286
+ if (!RemoteAccounts.byArgument(cli))
287
+ return;
288
+ credentialProfileLaunch(this.deps.environment(), cli, directory); // throws a refusal of our own when there is no relative path
289
+ const scratch = join(this.deps.pairingDirectory, ISOLATION_SCRATCH);
290
+ if (!this.deps.isolated || !(await this.deps.isolated(cli, scratch)))
291
+ throw new ProfileOwnershipRefusal(`not_isolated: ${cliName(cli)} could not be shown to keep this account's sign-in in its own folder on this computer, so nothing was started (signing in would replace this Windows user's own login)`, "not_isolated");
292
+ }
244
293
  async busyProfile(name) {
245
294
  if (this.signInProfile()?.toLowerCase() === name.toLowerCase())
246
295
  throw new SignInRefusal(`A sign-in for "${name}" is running; end it first`, "busy");
@@ -387,7 +436,7 @@ export class RemoteAccounts {
387
436
  case "signin.status": {
388
437
  const input = this.parse(operation, payload);
389
438
  this.needSwitch();
390
- return this.slot.find(input.sessionId).status();
439
+ return this.signInStatus(input.sessionId);
391
440
  }
392
441
  case "signin.write": return this.writeCode(this.parse(operation, payload), ctx);
393
442
  case "signin.start": return this.startSignIn(this.parse(operation, payload), ctx);
@@ -413,9 +462,71 @@ export class RemoteAccounts {
413
462
  throw new RemoteSetupRefusal("The request does not say who asked", "invalid_request");
414
463
  return actor;
415
464
  }
465
+ /**
466
+ * The one place that says which sign-in a request is. A request with a profile name is a NAMED account's: a CLI with named accounts here (Claude Code, Antigravity), in a folder this Runtime
467
+ * creates or created. A request without one is the computer's OWN login, and only a CLI whose spec says it has one (`runtime.signIn` `none` or `both`: Antigravity) is signed in that way; every
468
+ * other CLI needs a name, and a request without it is refused.
469
+ */
416
470
  async startSignIn(input, ctx) {
417
- const actor = this.actorOf(input.actor), cli = this.cliOf(input.cli);
471
+ if (input.profile === undefined && isRuntimeDefaultLoginCli(input.cli))
472
+ return this.startDefaultSignIn(input.cli, input, ctx);
473
+ if (input.profile === undefined) {
474
+ this.actorOf(input.actor);
475
+ this.cliOf(input.cli);
476
+ throw new RemoteSetupRefusal("A sign-in names the credential profile it is for", "invalid_request");
477
+ }
478
+ return this.startProfileSignIn({ ...input, profile: input.profile }, ctx);
479
+ }
480
+ /** Common to both: the child is the Runtime's work while it lives, so the update fence waits for it; the watch ends it if the switch goes off. */
481
+ holdSignIn(session, ctx) {
482
+ // The sign-in is the Runtime's work for as long as its child lives: the update fence waits for it. If the Runtime stopped or the connection went
483
+ // while the child was being started, it is ended at once, over the same path as any other end.
484
+ try {
485
+ if (!ctx.alive())
486
+ throw new RemoteSetupRefusal(NOT_AVAILABLE, "failed");
487
+ this.hold = this.deps.enter?.() ?? null;
488
+ }
489
+ catch (error) {
490
+ return this.endSignIn(session.id, "closed").catch(() => { }).then(() => { throw error; });
491
+ }
492
+ this.watchSwitch(session.id);
493
+ }
494
+ /**
495
+ * AGEND-113: Antigravity's default login. `agy acp --login` under the Windows user's own login, with no profile, no folder and no ownership record: the one exception to "named
496
+ * profiles only", and only for this CLI. Everything else is the same as a profile's sign-in, because it is the same `audited` path: the local `accounts` switch, one sign-in at a
497
+ * time on this computer (`exclusive` and the slot), the start-rate limit, the ten-minute timeout and the switch watch, and a record in `audit.jsonl` before and after.
498
+ */
499
+ async startDefaultSignIn(cli, input, ctx) {
500
+ const actor = this.actorOf(input.actor);
418
501
  let executable = null;
502
+ return this.audited("signin", "accounts", actor, { cli }, ctx, {
503
+ exclusive: "signin-start",
504
+ check: async () => {
505
+ // A Google account (subscription) only: no Google Cloud project, no API key.
506
+ if (input.method !== "subscription")
507
+ throw new ProfileOwnershipRefusal(`Only a subscription sign-in is supported for ${cliName(cli)} from AgEnD`, "unsupported");
508
+ await this.settleEndedSignIn();
509
+ this.slot.check();
510
+ executable = await this.deps.find(cli);
511
+ if (!executable)
512
+ throw new SignInRefusal(`${cliName(cli)} is not installed on this computer`, "failed");
513
+ },
514
+ run: async () => {
515
+ const session = await this.slot.start(() => {
516
+ this.gate(ctx, "accounts");
517
+ return new RuntimeSignIn({ command: executable.command, args: executable.args, method: "subscription", cli,
518
+ env: this.deps.environment() }, { ...this.deps.signIn, now: this.deps.now, onTimeout: () => { this.endWithRetry(session.id, "timeout"); } });
519
+ });
520
+ this.meta = { id: session.id, actor, cli };
521
+ await this.holdSignIn(session, ctx);
522
+ return { sessionId: session.id };
523
+ },
524
+ openEnded: true,
525
+ });
526
+ }
527
+ async startProfileSignIn(input, ctx) {
528
+ const actor = this.actorOf(input.actor), cli = this.cliOf(input.cli);
529
+ let executable = null, directory;
419
530
  // A sign-in begins by creating the profile when it is new: this is "Add account". The record says so. Nothing is created until every refusal
420
531
  // that does not need a change has been made (the slot, the profile's state, the CLI), so refused requests leave no folder behind.
421
532
  return this.audited("signin", "accounts", actor, { cli, profile: input.profile }, ctx, {
@@ -424,10 +535,9 @@ export class RemoteAccounts {
424
535
  check: async () => {
425
536
  // Only a subscription sign-in: a Console sign-in may be kept outside the profile's folder, so a profile could not hold or remove it.
426
537
  if (input.method !== "subscription")
427
- throw new ProfileOwnershipRefusal(SUBSCRIPTION_ONLY, "unsupported");
538
+ throw new ProfileOwnershipRefusal(cli === "claude-code" ? SUBSCRIPTION_ONLY : `Only a subscription sign-in is supported for ${cliName(cli)} from AgEnD`, "unsupported");
428
539
  await this.settleEndedSignIn();
429
540
  this.slot.check();
430
- let directory;
431
541
  try {
432
542
  directory = credentialProfileDirectory(this.deps.credentialRoot, cli, input.profile);
433
543
  }
@@ -445,7 +555,8 @@ export class RemoteAccounts {
445
555
  }
446
556
  executable = await this.deps.find(cli);
447
557
  if (!executable)
448
- throw new SignInRefusal("Claude Code is not installed on this computer", "failed");
558
+ throw new SignInRefusal(`${cliName(cli)} is not installed on this computer`, "failed");
559
+ await this.proveIsolated(cli, directory);
449
560
  },
450
561
  run: async () => {
451
562
  const { credentialRoot, pairingDirectory } = this.deps;
@@ -462,25 +573,19 @@ export class RemoteAccounts {
462
573
  }
463
574
  const directory = await requireOwnedProfile(pairingDirectory, credentialRoot, cli, input.profile, this.deps.ownership);
464
575
  // The switch and the connection once more, in the same synchronous step as the child is started (the slot waits before it calls this).
576
+ // The launch of this account: its variable (Claude Code), or the pin and `--app_data_dir <folder>` that go with the sign-in command (Antigravity).
577
+ const launch = credentialProfileLaunch(this.deps.environment(), cli, directory);
578
+ // AGEND-250 (review P2-1): the file an earlier attempt may have left, fingerprinted before this login starts; only a file that differs from it counts as this attempt's sign-in.
579
+ const storeName = RemoteAccounts.byArgument(cli) ? credentialProfileStore(cli) : null;
580
+ const storeBefore = storeName ? fingerprintStore(join(credentialProfileDirectory(credentialRoot, cli, input.profile), storeName)) : null;
465
581
  const session = await this.slot.start(() => {
466
582
  this.gate(ctx, "accounts");
467
- return new RuntimeSignIn({ command: executable.command, args: executable.args, method: input.method,
468
- env: withCredentialProfile(this.deps.environment(), cli, directory) }, { ...this.deps.signIn, now: this.deps.now,
583
+ return new RuntimeSignIn({ command: executable.command, args: executable.args, profileArgs: launch.args, method: input.method, cli,
584
+ env: launch.env }, { ...this.deps.signIn, now: this.deps.now,
469
585
  onTimeout: () => { this.endWithRetry(session.id, "timeout"); } });
470
586
  });
471
- this.meta = { id: session.id, actor, cli, profile: input.profile };
472
- // The sign-in is the Runtime's work for as long as its child lives: the update fence waits for it. If the Runtime stopped or the connection went
473
- // while the child was being started, it is ended at once, over the same path as any other end.
474
- try {
475
- if (!ctx.alive())
476
- throw new RemoteSetupRefusal(NOT_AVAILABLE, "failed");
477
- this.hold = this.deps.enter?.() ?? null;
478
- }
479
- catch (error) {
480
- await this.endSignIn(session.id, "closed").catch(() => { });
481
- throw error;
482
- }
483
- this.watchSwitch(session.id);
587
+ this.meta = { id: session.id, actor, cli, profile: input.profile, storeBefore };
588
+ await this.holdSignIn(session, ctx);
484
589
  return { sessionId: session.id };
485
590
  },
486
591
  openEnded: true,
@@ -500,6 +605,25 @@ export class RemoteAccounts {
500
605
  run: async () => { this.gate(ctx, "accounts"); await session.write(input.input); return { accepted: true }; },
501
606
  });
502
607
  }
608
+ /**
609
+ * `signin.status`, and (AGEND-124) the proof after the fact for a NAMED account of a CLI told its account by an argument: when its command has ended with exit 0, the account's own folder must hold the CLI's
610
+ * sign-in file as a plain file. The pre-flight probe only shows the pin worked for an EMPTY folder while the Windows user was signed in; a CLI that stopped honouring the pin would have kept this login in the
611
+ * Credential Manager, as the Windows user's OWN login. Then the answer carries `isolated: false`, the dashboard ends the sign-in as `not_isolated`, and the record says so.
612
+ */
613
+ signInStatus(sessionId) {
614
+ const session = this.slot.find(sessionId), status = session.status(), meta = this.meta;
615
+ if (meta && meta.id === sessionId && meta.profile !== undefined && !status.alive && status.exitCode === 0 && isCredentialProfileCli(meta.cli) && RemoteAccounts.byArgument(meta.cli)) {
616
+ const store = credentialProfileStore(meta.cli);
617
+ // AGEND-250 (review P2-1): a plain file that is not the one the attempt began with; an old file left in the folder proves nothing about where this login went.
618
+ const kept = !!store && storeWrittenSince(join(credentialProfileDirectory(this.deps.credentialRoot, meta.cli, meta.profile), store), meta.storeBefore ?? null);
619
+ if (!kept) {
620
+ meta.notIsolated = true;
621
+ meta.signedIn = false;
622
+ return { ...status, isolated: false };
623
+ }
624
+ }
625
+ return status;
626
+ }
503
627
  /** While a sign-in is open, look at its switch every few seconds: a switch that was turned off, or that ran out, ends it and says so in the record. */
504
628
  watchSwitch(id) {
505
629
  this.stopWatching();
@@ -540,7 +664,7 @@ export class RemoteAccounts {
540
664
  if (meta && meta.id === sessionId) {
541
665
  this.meta = null;
542
666
  this.record({ actor: meta.actor, action: "signin", cli: meta.cli, profile: meta.profile, outcome: how === "closed" && meta.signedIn === true ? "ok" : "failed",
543
- ...(how === "closed" ? (meta.signedIn === true ? {} : { reason: "failed" }) : { reason: how === "timeout" ? "timeout" : "switch_off" }) }, false);
667
+ ...(how === "closed" ? (meta.signedIn === true ? {} : { reason: meta.notIsolated ? "not_isolated" : "failed" }) : { reason: how === "timeout" ? "timeout" : "switch_off" }) }, false);
544
668
  }
545
669
  return { closed: true };
546
670
  }
@@ -612,6 +736,46 @@ export class RemoteAccounts {
612
736
  }
613
737
  }
614
738
  async check(input, ctx) {
739
+ if (input.profile === undefined && isRuntimeDefaultLoginCli(input.cli))
740
+ return this.checkDefault(input.cli, input, ctx);
741
+ this.gate(ctx, "accounts");
742
+ this.cliOf(input.cli);
743
+ if (input.profile === undefined)
744
+ throw new RemoteSetupRefusal("A check names the credential profile it is for", "invalid_request");
745
+ return this.checkProfile({ cli: input.cli, profile: input.profile }, ctx);
746
+ }
747
+ /**
748
+ * Antigravity's own login: `agy models` read by its exit code, nothing else (no e-mail, no plan). Not recorded, like a profile's check, and bounded the same way. Asked only
749
+ * because a person's request says so: the dashboard's page reads the last detection instead (agy is never started on a read).
750
+ */
751
+ async checkDefault(cli, input, ctx) {
752
+ this.gate(ctx, "accounts");
753
+ if (this.activeChecks >= MAX_CONCURRENT_CHECKS)
754
+ throw new SignInRefusal("Other account checks are running on this computer; try again in a moment", "busy");
755
+ if (!this.deps.defaultStatus)
756
+ return { loggedIn: null };
757
+ this.activeChecks++;
758
+ try {
759
+ const loggedIn = await this.deps.defaultStatus(cli);
760
+ this.gate(ctx, "accounts");
761
+ if (this.meta && this.meta.cli === cli)
762
+ this.meta.signedIn = loggedIn === true;
763
+ // A yes or a no is the newest word on this login: the Runtime's inventory carries it, and is re-sent BEFORE the answer (as for a profile's check), so that a later report of the cached
764
+ // inventory (a reconnect, another account's change) does not bring back what was true before. "Could not be asked" says nothing and changes nothing.
765
+ if (loggedIn !== null) {
766
+ try {
767
+ this.deps.noteLogin?.(cli, loggedIn);
768
+ }
769
+ catch { /* the answer is still given */ }
770
+ await this.refreshed(ctx);
771
+ }
772
+ return { loggedIn };
773
+ }
774
+ finally {
775
+ this.activeChecks--;
776
+ }
777
+ }
778
+ async checkProfile(input, ctx) {
615
779
  this.gate(ctx, "accounts");
616
780
  const cli = this.cliOf(input.cli), key = input.profile.toLowerCase();
617
781
  if (this.busy.has(key) || this.retained.has(key))
@@ -627,7 +791,8 @@ export class RemoteAccounts {
627
791
  // The shared parser already masked the address; check the masked form once more before anything is stored or sent.
628
792
  const identity = answer.loggedIn === true && answer.identity ? parseAccountIdentity(answer.identity) : undefined;
629
793
  rememberCredentialStatus(this.deps.credentialRoot, cli, input.profile, { loggedIn: answer.loggedIn, ...(identity ? { identity } : {}) });
630
- if (this.meta && this.meta.profile === input.profile)
794
+ // A sign-in that ended without leaving its file in the account's folder (`notIsolated`) stays failed: a later check that reads "signed in" from a store every folder shares must not turn it into a success.
795
+ if (this.meta && this.meta.profile === input.profile && !this.meta.notIsolated)
631
796
  this.meta.signedIn = answer.loggedIn === true;
632
797
  await this.refreshed(ctx);
633
798
  return { loggedIn: answer.loggedIn, ...(identity ? { identity } : {}) };
@@ -637,29 +802,43 @@ export class RemoteAccounts {
637
802
  }
638
803
  }
639
804
  /**
640
- * Sign-out. The checks come first (ownership, in use, the CLI, the pace); then, with the folder taken out of reach of a swap (renamed and re-checked, as for a
641
- * removal), `claude auth logout` runs against the renamed folder, the folder is verified again, its backups are deleted, and the name is put back. So a
642
- * folder replaced by a junction to the user's own sign-in after the checks is found before anything is run against it. The switch and the connection are
643
- * looked at again immediately before the logout starts and before the backups go.
805
+ * Sign-out. A request with a profile name signs that NAMED account out; one without signs the computer's OWN login out (`signOutDefault`).
806
+ * A named account: the checks come first (ownership, in use, the CLI, the pace); then, with the folder taken out of reach of a swap (renamed and re-checked, as for a
807
+ * removal), the CLI's own logout runs against the renamed folder (`claude auth logout`) or — for a CLI with none (Antigravity) — the account's token file is removed, the folder is
808
+ * verified again, and the answer is the CLI's own status probe under that folder. So a folder replaced by a junction to the user's own sign-in after the checks is found before anything is
809
+ * run against it or deleted in it. The switch and the connection are looked at again immediately before the logout starts and before the backups or the file go.
644
810
  */
645
811
  async signOut(input, ctx) {
646
- const actor = this.actorOf(input.actor), cli = this.cliOf(input.cli), key = input.profile.toLowerCase();
812
+ if (input.profile === undefined)
813
+ return this.signOutDefault(input.cli, input.actor, ctx);
814
+ const profile = input.profile, actor = this.actorOf(input.actor), cli = this.cliOf(input.cli), key = profile.toLowerCase();
815
+ const facts = runtimeFacts(cli, "signOut");
816
+ if (!facts)
817
+ throw new ProfileOwnershipRefusal(`${cliName(cli)} accounts cannot be signed out from AgEnD`, "unsupported");
647
818
  let executable = null;
648
- return this.audited("profile.signout", "accounts", actor, { cli, profile: input.profile }, ctx, {
819
+ return this.audited("profile.signout", "accounts", actor, { cli, profile }, ctx, {
649
820
  check: async () => {
650
- this.paceCheck(input.profile);
651
- await requireOwnedProfile(this.deps.pairingDirectory, this.deps.credentialRoot, cli, input.profile, this.deps.ownership);
652
- await this.busyProfile(input.profile);
821
+ this.paceCheck(profile);
822
+ await requireOwnedProfile(this.deps.pairingDirectory, this.deps.credentialRoot, cli, profile, this.deps.ownership);
823
+ await this.busyProfile(profile);
653
824
  executable = await this.deps.find(cli);
654
825
  if (!executable)
655
- throw new SignInRefusal("Claude Code is not installed on this computer", "failed");
656
- this.paceMark(input.profile);
826
+ throw new SignInRefusal(`${cliName(cli)} is not installed on this computer`, "failed");
827
+ this.paceMark(profile);
657
828
  },
658
829
  run: async () => {
659
- const answer = await withIsolatedOwnedProfile(this.deps.pairingDirectory, this.deps.credentialRoot, cli, input.profile, { ...this.deps.ownership, ...(this.deps.report ? { report: this.deps.report } : {}), beforeCommit: () => this.finalLook(ctx, input.profile, false) }, async (directory, verify) => {
830
+ const answer = await withIsolatedOwnedProfile(this.deps.pairingDirectory, this.deps.credentialRoot, cli, profile, { ...this.deps.ownership, ...(this.deps.report ? { report: this.deps.report } : {}), beforeCommit: () => this.finalLook(ctx, profile, false) }, async (directory, verify) => {
660
831
  this.gate(ctx, "accounts");
832
+ if ("remove" in facts) {
833
+ // The sign-in is a file in the account's folder: proven to be this folder (verify), then removed (only a plain file of that exact name), and the CLI is asked.
834
+ await verify();
835
+ this.gate(ctx, "accounts");
836
+ for (const name of facts.remove)
837
+ removeSignInFile(directory, name);
838
+ return this.deps.status(cli, directory);
839
+ }
661
840
  try {
662
- await this.deps.runLogout(executable, ["auth", "logout"], withCredentialProfile(this.deps.environment(), cli, directory));
841
+ await this.deps.runLogout(executable, [...facts.args], withCredentialProfile(this.deps.environment(), cli, directory));
663
842
  }
664
843
  catch (error) {
665
844
  if (error instanceof ProcessNotConfirmedEnded) {
@@ -675,10 +854,69 @@ export class RemoteAccounts {
675
854
  deleteProfileBackups(directory);
676
855
  return this.deps.status(cli, directory);
677
856
  });
678
- rememberCredentialStatus(this.deps.credentialRoot, cli, input.profile, { loggedIn: answer.loggedIn });
857
+ rememberCredentialStatus(this.deps.credentialRoot, cli, profile, { loggedIn: answer.loggedIn });
679
858
  await this.refreshed(ctx);
680
859
  if (answer.loggedIn !== false)
681
- throw new SignInRefusal(`Credential profile "${input.profile}" is still signed in after sign-out`, "failed");
860
+ throw new SignInRefusal(`Credential profile "${profile}" is still signed in after sign-out`, "failed");
861
+ return { loggedIn: false };
862
+ },
863
+ });
864
+ }
865
+ /**
866
+ * AGEND-124: the computer's OWN login of a CLI that has one (Antigravity), signed out: the Credential Manager entry the registry names (`runtime.signOut.credential`; `cmdkey /delete:<name>` deletes the
867
+ * entry agy's own `/logout` does, measured on a decoy entry), then `agy models` says whether it took. Everything a sign-in of that login needs applies: the local `accounts` switch, no sign-in under way on
868
+ * this computer, one at a time, a pause between two, a record in `audit.jsonl`; and no native task running (it would lose its login under it). The entry's name is the registry's, never the request's.
869
+ */
870
+ async signOutDefault(cliId, actorId, ctx) {
871
+ const actor = this.actorOf(actorId);
872
+ if (!isRuntimeDefaultLoginCli(cliId)) {
873
+ this.cliOf(cliId);
874
+ throw new RemoteSetupRefusal("A sign-out names the credential profile it is for", "invalid_request");
875
+ }
876
+ const cli = cliId, facts = runtimeFacts(cli, "signOut");
877
+ if (!facts || !("credential" in facts))
878
+ throw new ProfileOwnershipRefusal(`${cliName(cli)}'s own login on a computer cannot be signed out from AgEnD`, "unsupported");
879
+ const paceKey = `${DEFAULT_KEY}${cli}`;
880
+ return this.audited("login.signout", "accounts", actor, { cli }, ctx, {
881
+ exclusive: "signin-start",
882
+ hold: paceKey,
883
+ check: async () => {
884
+ await this.settleEndedSignIn();
885
+ if (this.slot.current())
886
+ throw new SignInRefusal("A sign-in is running on this computer; end it first", "busy");
887
+ if (!this.deps.deleteCredential || !this.deps.defaultStatus)
888
+ throw new ProfileOwnershipRefusal("This Runtime cannot sign this computer's own login out", "unsupported");
889
+ // Asked with `await`: the Runtime reads the computer's boot identity first, so a terminal recorded under an earlier boot is not counted as running.
890
+ if ((await this.deps.taskRunning?.()) !== false)
891
+ throw new ProfileOwnershipRefusal(`A task is running on this computer (or this Runtime could not tell), and it would lose its ${cliName(cli)} login; wait for it to finish`, "in_use");
892
+ const last = this.lastChange.get(paceKey);
893
+ if (last !== undefined && this.now() - last < PROFILE_OP_MIN_GAP_MS)
894
+ throw new SignInRefusal(`${cliName(cli)} was just signed out here; wait a few seconds`, "rate_limited");
895
+ this.lastChange.set(paceKey, this.now());
896
+ },
897
+ run: async () => {
898
+ this.gate(ctx, "accounts");
899
+ if (this.slot.current() || (await this.deps.taskRunning?.()) !== false)
900
+ throw new ProfileOwnershipRefusal("A sign-in or a task started on this computer; nothing was changed", "in_use");
901
+ // 0: deleted. 1: no such entry (already signed out). AGEND-250 (#3771 review P2-3): anything else (could not run, access denied, another exit) is a deletion that did not happen, and is not ignored:
902
+ // `agy models` below could then say "signed out" for a credential that is still there. The ONE reading that proves a sign-out is the explicit "Please sign in" (`defaultStatus`: false).
903
+ const deleted = await this.deps.deleteCredential(facts.credential);
904
+ if (deleted !== 0 && deleted !== 1)
905
+ throw new SignInRefusal(`${cliName(cli)}'s saved sign-in could not be removed from this computer, so it was not signed out`, "failed");
906
+ this.gate(ctx, "accounts");
907
+ const loggedIn = await this.deps.defaultStatus(cli);
908
+ this.gate(ctx, "accounts");
909
+ if (loggedIn !== null) {
910
+ try {
911
+ this.deps.noteLogin?.(cli, loggedIn);
912
+ }
913
+ catch { /* the answer is still given */ }
914
+ }
915
+ await this.refreshed(ctx);
916
+ if (loggedIn === null)
917
+ throw new SignInRefusal(`${cliName(cli)}'s sign-out could not be confirmed (the check did not say it is signed out; is the computer offline?), so it is not reported as signed out`, "failed");
918
+ if (loggedIn !== false)
919
+ throw new SignInRefusal(`${cliName(cli)} is still signed in on this computer after sign-out`, "failed");
682
920
  return { loggedIn: false };
683
921
  },
684
922
  });
@@ -689,22 +927,25 @@ export class RemoteAccounts {
689
927
  check: async () => {
690
928
  this.paceCheck(input.profile);
691
929
  await requireOwnedProfile(this.deps.pairingDirectory, this.deps.credentialRoot, cli, input.profile, this.deps.ownership);
692
- let fallback;
693
- try {
694
- fallback = this.deps.defaultProfile();
695
- }
696
- catch {
697
- throw new ProfileOwnershipRefusal("This computer could not confirm which credential profile is the default, so nothing was changed. Check that computer's Runtime folder", "unconfirmed");
930
+ // The pairing's default profile is Claude Code's (an Antigravity account has none), so only a Claude profile is held back by it.
931
+ if (cli === "claude-code") {
932
+ let fallback;
933
+ try {
934
+ fallback = this.deps.defaultProfile();
935
+ }
936
+ catch {
937
+ throw new ProfileOwnershipRefusal("This computer could not confirm which credential profile is the default, so nothing was changed. Check that computer's Runtime folder", "unconfirmed");
938
+ }
939
+ if (fallback && fallback.toLowerCase() === input.profile.toLowerCase())
940
+ throw new ProfileOwnershipRefusal(`Credential profile "${input.profile}" is this computer's default for agents; change it there first: agend-runtime profile default NAME`, "default_profile");
698
941
  }
699
- if (fallback && fallback.toLowerCase() === input.profile.toLowerCase())
700
- throw new ProfileOwnershipRefusal(`Credential profile "${input.profile}" is this computer's default for agents; change it there first: agend-runtime profile default NAME`, "default_profile");
701
942
  await this.busyProfile(input.profile);
702
943
  this.paceMark(input.profile);
703
944
  },
704
945
  run: async () => {
705
946
  this.gate(ctx, "accounts");
706
947
  // The protection (the default profile, tasks, terminals, the switch) is asked again, synchronously, immediately before the rename: `beforeCommit`.
707
- await removeOwnedProfile(this.deps.pairingDirectory, this.deps.credentialRoot, cli, input.profile, { ...this.deps.ownership, ...(this.deps.report ? { report: this.deps.report } : {}), beforeCommit: () => this.finalLook(ctx, input.profile, true), beforeDelete: () => this.finalLook(ctx, input.profile, true) });
948
+ await removeOwnedProfile(this.deps.pairingDirectory, this.deps.credentialRoot, cli, input.profile, { ...this.deps.ownership, ...(this.deps.report ? { report: this.deps.report } : {}), beforeCommit: () => this.finalLook(ctx, input.profile, true, cli), beforeDelete: () => this.finalLook(ctx, input.profile, true, cli) });
708
949
  await this.refreshed(ctx);
709
950
  return { removed: true };
710
951
  },