@songsid/agend 2.3.3-beta.1 → 2.3.3-beta.10

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 (355) hide show
  1. package/dist/agent-cli.js +13 -112
  2. package/dist/agent-cli.js.map +1 -1
  3. package/dist/agent-endpoint.d.ts +0 -1
  4. package/dist/agent-endpoint.js +1 -9
  5. package/dist/agent-endpoint.js.map +1 -1
  6. package/dist/agent-whats-new.d.ts +3 -6
  7. package/dist/agent-whats-new.js +7 -18
  8. package/dist/agent-whats-new.js.map +1 -1
  9. package/dist/auth-api.d.ts +0 -7
  10. package/dist/auth-api.js +1 -15
  11. package/dist/auth-api.js.map +1 -1
  12. package/dist/authority/authority-state.js +1 -1
  13. package/dist/authority/authority-state.js.map +1 -1
  14. package/dist/authority/web-authority.d.ts +9 -4
  15. package/dist/authority/web-authority.js +10 -5
  16. package/dist/authority/web-authority.js.map +1 -1
  17. package/dist/backend/antigravity.js +6 -1
  18. package/dist/backend/antigravity.js.map +1 -1
  19. package/dist/backend/claude-code.d.ts +7 -0
  20. package/dist/backend/claude-code.js +34 -28
  21. package/dist/backend/claude-code.js.map +1 -1
  22. package/dist/backend/claude-transcript-errors.d.ts +18 -0
  23. package/dist/backend/claude-transcript-errors.js +19 -0
  24. package/dist/backend/claude-transcript-errors.js.map +1 -0
  25. package/dist/backend/codex-session-lookup.d.ts +16 -3
  26. package/dist/backend/codex-session-lookup.js +45 -11
  27. package/dist/backend/codex-session-lookup.js.map +1 -1
  28. package/dist/backend/codex.d.ts +16 -0
  29. package/dist/backend/codex.js +184 -35
  30. package/dist/backend/codex.js.map +1 -1
  31. package/dist/backend/grok.js +58 -12
  32. package/dist/backend/grok.js.map +1 -1
  33. package/dist/backend/kiro.js +2 -0
  34. package/dist/backend/kiro.js.map +1 -1
  35. package/dist/backend/muse.js +2 -1
  36. package/dist/backend/muse.js.map +1 -1
  37. package/dist/backend/types.d.ts +46 -0
  38. package/dist/backend/types.js.map +1 -1
  39. package/dist/bundled-skills.d.ts +4 -6
  40. package/dist/bundled-skills.js +10 -14
  41. package/dist/bundled-skills.js.map +1 -1
  42. package/dist/channel/adapters/discord.js +60 -17
  43. package/dist/channel/adapters/discord.js.map +1 -1
  44. package/dist/channel/mcp-server.js +5 -5
  45. package/dist/channel/mcp-server.js.map +1 -1
  46. package/dist/channel/mcp-tools.d.ts +1 -3
  47. package/dist/channel/mcp-tools.js +4 -58
  48. package/dist/channel/mcp-tools.js.map +1 -1
  49. package/dist/classic-channel-manager.d.ts +4 -1
  50. package/dist/classic-channel-manager.js +21 -7
  51. package/dist/classic-channel-manager.js.map +1 -1
  52. package/dist/cli.js +21 -4
  53. package/dist/cli.js.map +1 -1
  54. package/dist/config-history.d.ts +50 -0
  55. package/dist/config-history.js +263 -0
  56. package/dist/config-history.js.map +1 -0
  57. package/dist/config-validator.js +7 -7
  58. package/dist/config-validator.js.map +1 -1
  59. package/dist/config.d.ts +3 -0
  60. package/dist/config.js +11 -4
  61. package/dist/config.js.map +1 -1
  62. package/dist/daemon.d.ts +73 -3
  63. package/dist/daemon.js +334 -121
  64. package/dist/daemon.js.map +1 -1
  65. package/dist/daily-summary.d.ts +8 -1
  66. package/dist/daily-summary.js +8 -5
  67. package/dist/daily-summary.js.map +1 -1
  68. package/dist/dashboard-live.d.ts +1 -1
  69. package/dist/dashboard-live.js +3 -3
  70. package/dist/dashboard-live.js.map +1 -1
  71. package/dist/dashboard-permissions.d.ts +1 -1
  72. package/dist/dashboard-permissions.js +1 -3
  73. package/dist/dashboard-permissions.js.map +1 -1
  74. package/dist/delivery-outbox.d.ts +4 -0
  75. package/dist/delivery-outbox.js +12 -2
  76. package/dist/delivery-outbox.js.map +1 -1
  77. package/dist/doctor.d.ts +4 -0
  78. package/dist/doctor.js +16 -1
  79. package/dist/doctor.js.map +1 -1
  80. package/dist/fleet-level-config.js +1 -1
  81. package/dist/fleet-level-config.js.map +1 -1
  82. package/dist/fleet-manager.d.ts +70 -54
  83. package/dist/fleet-manager.js +257 -322
  84. package/dist/fleet-manager.js.map +1 -1
  85. package/dist/fleet-process-handlers.d.ts +5 -0
  86. package/dist/fleet-process-handlers.js +21 -0
  87. package/dist/fleet-process-handlers.js.map +1 -1
  88. package/dist/fleet-service-owner.d.ts +11 -0
  89. package/dist/fleet-service-owner.js +3 -0
  90. package/dist/fleet-service-owner.js.map +1 -0
  91. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +11 -1
  92. package/dist/general-knowledge/skills/session-management/SKILL.md +6 -0
  93. package/dist/general-knowledge/skills/web-appearance/SKILL.md +13 -204
  94. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +29 -67
  95. package/dist/instance-lifecycle.d.ts +19 -0
  96. package/dist/instance-lifecycle.js +52 -10
  97. package/dist/instance-lifecycle.js.map +1 -1
  98. package/dist/locale.js +92 -42
  99. package/dist/locale.js.map +1 -1
  100. package/dist/needs-you-hub.d.ts +1 -0
  101. package/dist/needs-you-hub.js +6 -3
  102. package/dist/needs-you-hub.js.map +1 -1
  103. package/dist/needs-you-live.d.ts +3 -1
  104. package/dist/needs-you-live.js +24 -2
  105. package/dist/needs-you-live.js.map +1 -1
  106. package/dist/needs-you.d.ts +13 -2
  107. package/dist/needs-you.js +11 -1
  108. package/dist/needs-you.js.map +1 -1
  109. package/dist/notify-socket.d.ts +10 -0
  110. package/dist/notify-socket.js +45 -0
  111. package/dist/notify-socket.js.map +1 -0
  112. package/dist/outbound-handlers.js +19 -7
  113. package/dist/outbound-handlers.js.map +1 -1
  114. package/dist/outbound-schemas.d.ts +0 -62
  115. package/dist/outbound-schemas.js +3 -42
  116. package/dist/outbound-schemas.js.map +1 -1
  117. package/dist/parked-notices.d.ts +87 -0
  118. package/dist/parked-notices.js +194 -0
  119. package/dist/parked-notices.js.map +1 -0
  120. package/dist/public-link-progress.d.ts +5 -2
  121. package/dist/public-link-progress.js +4 -3
  122. package/dist/public-link-progress.js.map +1 -1
  123. package/dist/public-web-gateway.js +0 -9
  124. package/dist/public-web-gateway.js.map +1 -1
  125. package/dist/public-web-link.d.ts +12 -0
  126. package/dist/public-web-link.js +29 -5
  127. package/dist/public-web-link.js.map +1 -1
  128. package/dist/quota-notice.d.ts +23 -0
  129. package/dist/quota-notice.js +22 -0
  130. package/dist/quota-notice.js.map +1 -0
  131. package/dist/scheduler/task-board.d.ts +0 -13
  132. package/dist/scheduler/task-board.js +0 -14
  133. package/dist/scheduler/task-board.js.map +1 -1
  134. package/dist/sd-notify.d.ts +10 -1
  135. package/dist/sd-notify.js +27 -2
  136. package/dist/sd-notify.js.map +1 -1
  137. package/dist/search/search-docs.d.ts +1 -1
  138. package/dist/search/search-docs.js +2 -2
  139. package/dist/search/search-docs.js.map +1 -1
  140. package/dist/settings-api.d.ts +16 -0
  141. package/dist/settings-api.js +55 -2
  142. package/dist/settings-api.js.map +1 -1
  143. package/dist/settings-change.js +3 -1
  144. package/dist/settings-change.js.map +1 -1
  145. package/dist/settings-confirmation.d.ts +17 -3
  146. package/dist/settings-confirmation.js +8 -5
  147. package/dist/settings-confirmation.js.map +1 -1
  148. package/dist/settings-http-confirmation.js +31 -1
  149. package/dist/settings-http-confirmation.js.map +1 -1
  150. package/dist/setup-wizard.d.ts +3 -0
  151. package/dist/setup-wizard.js +4 -2
  152. package/dist/setup-wizard.js.map +1 -1
  153. package/dist/task-board-waker.d.ts +4 -1
  154. package/dist/task-board-waker.js +13 -2
  155. package/dist/task-board-waker.js.map +1 -1
  156. package/dist/tool-permissions.js +3 -10
  157. package/dist/tool-permissions.js.map +1 -1
  158. package/dist/topic-commands.d.ts +27 -7
  159. package/dist/topic-commands.js +95 -36
  160. package/dist/topic-commands.js.map +1 -1
  161. package/dist/transcript-monitor.d.ts +7 -0
  162. package/dist/transcript-monitor.js +48 -3
  163. package/dist/transcript-monitor.js.map +1 -1
  164. package/dist/tunnel/cloudflared.d.ts +5 -0
  165. package/dist/tunnel/cloudflared.js +32 -1
  166. package/dist/tunnel/cloudflared.js.map +1 -1
  167. package/dist/tunnel/named-diagnostics.d.ts +2 -1
  168. package/dist/tunnel/named-diagnostics.js +4 -1
  169. package/dist/tunnel/named-diagnostics.js.map +1 -1
  170. package/dist/tunnel/named-link-test.d.ts +90 -0
  171. package/dist/tunnel/named-link-test.js +270 -0
  172. package/dist/tunnel/named-link-test.js.map +1 -0
  173. package/dist/tunnel/purpose-lane.d.ts +3 -1
  174. package/dist/tunnel/purpose-lane.js +2 -0
  175. package/dist/tunnel/purpose-lane.js.map +1 -1
  176. package/dist/types.d.ts +8 -6
  177. package/dist/ui/chat-ambient.js +4 -4
  178. package/dist/ui/chat-commands.js +3 -2
  179. package/dist/ui/chat-store.js +4 -1
  180. package/dist/ui/chat-strings.js +12 -46
  181. package/dist/ui/chat-thread.js +51 -59
  182. package/dist/ui/fleet-office-skin.js +37 -14
  183. package/dist/ui/fleet-office.js +31 -7
  184. package/dist/ui/html-attachment.js +22 -8
  185. package/dist/ui/panel-chat.js +21 -50
  186. package/dist/ui/panel-needs.js +11 -9
  187. package/dist/ui/panel-settings.js +5 -3
  188. package/dist/ui/preview-panel.js +12 -21
  189. package/dist/ui/preview.js +10 -3
  190. package/dist/ui/search-dialog.js +30 -14
  191. package/dist/ui/settings-appearance.js +1 -3
  192. package/dist/ui/settings-confirm.js +18 -0
  193. package/dist/ui/settings-guests.js +13 -4
  194. package/dist/ui/settings-learn.js +1 -1
  195. package/dist/ui/settings-mods.js +5 -12
  196. package/dist/ui/settings-named-test.js +144 -0
  197. package/dist/ui/settings-registry.js +0 -1
  198. package/dist/ui/settings-strings.js +14 -14
  199. package/dist/ui/settings-web-authority.js +4 -3
  200. package/dist/ui/shared/app-i18n.js +15 -4
  201. package/dist/ui/shared/app-needs.js +5 -1
  202. package/dist/ui/shared/app-prefs.js +17 -17
  203. package/dist/ui/shared/app-shell.js +47 -9
  204. package/dist/ui/shared/app-store.js +6 -2
  205. package/dist/ui/shared/app.css +33 -39
  206. package/dist/ui/shared/app.js +5 -4
  207. package/dist/ui/shared/instance-nav.js +9 -9
  208. package/dist/ui/shared/instance-switch.js +8 -2
  209. package/dist/ui/shared/panel-view.js +22 -8
  210. package/dist/ui/shared/view-strings.js +6 -0
  211. package/dist/ui/shared/web-authorize.js +35 -13
  212. package/dist/usage/usage-api.d.ts +3 -0
  213. package/dist/usage/usage-api.js +5 -1
  214. package/dist/usage/usage-api.js.map +1 -1
  215. package/dist/view-api.d.ts +2 -0
  216. package/dist/view-api.js +64 -0
  217. package/dist/view-api.js.map +1 -1
  218. package/dist/web-api.d.ts +9 -17
  219. package/dist/web-api.js +257 -371
  220. package/dist/web-api.js.map +1 -1
  221. package/dist/web-appearance-tools.d.ts +0 -2
  222. package/dist/web-appearance-tools.js +2 -5
  223. package/dist/web-appearance-tools.js.map +1 -1
  224. package/dist/web-appearance-view.d.ts +0 -6
  225. package/dist/web-appearance-view.js +0 -1
  226. package/dist/web-appearance-view.js.map +1 -1
  227. package/dist/web-appearance.d.ts +14 -7
  228. package/dist/web-appearance.js +5 -6
  229. package/dist/web-appearance.js.map +1 -1
  230. package/dist/web-asset-parts.d.ts +1 -17
  231. package/dist/web-asset-parts.js +1 -15
  232. package/dist/web-asset-parts.js.map +1 -1
  233. package/dist/web-auth.js +1 -7
  234. package/dist/web-auth.js.map +1 -1
  235. package/dist/web-chat-history.d.ts +3 -7
  236. package/dist/web-chat-history.js +10 -17
  237. package/dist/web-chat-history.js.map +1 -1
  238. package/dist/web-commands.d.ts +9 -1
  239. package/dist/web-commands.js +13 -0
  240. package/dist/web-commands.js.map +1 -1
  241. package/dist/web-experimental.d.ts +2 -11
  242. package/dist/web-experimental.js +8 -36
  243. package/dist/web-experimental.js.map +1 -1
  244. package/dist/web-guest-access.d.ts +40 -2
  245. package/dist/web-guest-access.js +50 -14
  246. package/dist/web-guest-access.js.map +1 -1
  247. package/dist/web-mod-bundle.d.ts +2 -45
  248. package/dist/web-mod-bundle.js +15 -63
  249. package/dist/web-mod-bundle.js.map +1 -1
  250. package/dist/web-mod-store.d.ts +3 -48
  251. package/dist/web-mod-store.js +30 -97
  252. package/dist/web-mod-store.js.map +1 -1
  253. package/dist/web-prefs.d.ts +13 -0
  254. package/dist/web-prefs.js +38 -0
  255. package/dist/web-prefs.js.map +1 -1
  256. package/dist/web-preview.d.ts +6 -13
  257. package/dist/web-preview.js +12 -23
  258. package/dist/web-preview.js.map +1 -1
  259. package/dist/web-session.d.ts +11 -3
  260. package/dist/web-session.js +22 -11
  261. package/dist/web-session.js.map +1 -1
  262. package/dist/web-settings-patch.d.ts +1 -0
  263. package/dist/web-settings-patch.js +6 -3
  264. package/dist/web-settings-patch.js.map +1 -1
  265. package/dist/web-settings-tools.d.ts +0 -13
  266. package/dist/web-settings-tools.js +12 -84
  267. package/dist/web-settings-tools.js.map +1 -1
  268. package/launcher/agend-install.cjs +7 -1
  269. package/launcher/fleet-service-owner.cjs +150 -0
  270. package/package.json +1 -1
  271. package/dist/general-knowledge/skills/web-appearance/SKILL.canvas-worker-off.md +0 -376
  272. package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +0 -673
  273. package/dist/task-board-summary.d.ts +0 -101
  274. package/dist/task-board-summary.js +0 -177
  275. package/dist/task-board-summary.js.map +0 -1
  276. package/dist/ui/app-effects.js +0 -251
  277. package/dist/ui/chat-effect-posters.js +0 -42
  278. package/dist/ui/chat-effects.js +0 -167
  279. package/dist/ui/effect-trial-controller.js +0 -124
  280. package/dist/ui/effect-trial-offer.js +0 -2
  281. package/dist/ui/effect-trial-panel.js +0 -40
  282. package/dist/ui/effects-waker.js +0 -2
  283. package/dist/ui/settings-effects.js +0 -202
  284. package/dist/ui/settings-owner-effects.js +0 -82
  285. package/dist/ui/shared/effect-app-runtime.js +0 -299
  286. package/dist/ui/shared/effect-baseline.js +0 -64
  287. package/dist/ui/shared/effect-chat-runtime.js +0 -162
  288. package/dist/ui/shared/effect-cursor.js +0 -126
  289. package/dist/ui/shared/effect-display-metadata.js +0 -39
  290. package/dist/ui/shared/effect-frame.js +0 -146
  291. package/dist/ui/shared/effect-geometry.js +0 -137
  292. package/dist/ui/shared/effect-host-style.js +0 -10
  293. package/dist/ui/shared/effect-owner-regions.js +0 -74
  294. package/dist/ui/shared/effect-owner-source.js +0 -122
  295. package/dist/ui/shared/effect-policy.js +0 -151
  296. package/dist/ui/shared/effect-poster-reader.js +0 -98
  297. package/dist/ui/shared/effect-posters.js +0 -117
  298. package/dist/ui/shared/effect-profiler.js +0 -184
  299. package/dist/ui/shared/effect-profiles.js +0 -65
  300. package/dist/ui/shared/effect-registry.js +0 -545
  301. package/dist/ui/shared/effect-runtime-loader.js +0 -236
  302. package/dist/ui/shared/effect-safety.js +0 -153
  303. package/dist/ui/shared/effect-stock-snapshot.js +0 -43
  304. package/dist/ui/shared/effect-stock-trust.js +0 -217
  305. package/dist/ui/shared/effect-trial-shadow.js +0 -62
  306. package/dist/ui/shared/effect-trial-source.js +0 -103
  307. package/dist/ui/shared/effect-trial-stage.js +0 -170
  308. package/dist/ui/shared/effect-trial.css +0 -40
  309. package/dist/ui/shared/feature-flags.js +0 -127
  310. package/dist/ui/shared/owner-effect-prefs.js +0 -117
  311. package/dist/web-effect-bootstrap.d.ts +0 -12
  312. package/dist/web-effect-bootstrap.js +0 -49
  313. package/dist/web-effect-bootstrap.js.map +0 -1
  314. package/dist/web-effect-bundle.d.ts +0 -28
  315. package/dist/web-effect-bundle.js +0 -171
  316. package/dist/web-effect-bundle.js.map +0 -1
  317. package/dist/web-effect-canonical.d.ts +0 -8
  318. package/dist/web-effect-canonical.js +0 -27
  319. package/dist/web-effect-canonical.js.map +0 -1
  320. package/dist/web-effect-library.d.ts +0 -114
  321. package/dist/web-effect-library.js +0 -530
  322. package/dist/web-effect-library.js.map +0 -1
  323. package/dist/web-effect-playback.d.ts +0 -30
  324. package/dist/web-effect-playback.js +0 -71
  325. package/dist/web-effect-playback.js.map +0 -1
  326. package/dist/web-effect-poster.d.ts +0 -8
  327. package/dist/web-effect-poster.js +0 -52
  328. package/dist/web-effect-poster.js.map +0 -1
  329. package/dist/web-effect-profiles.d.ts +0 -118
  330. package/dist/web-effect-profiles.js +0 -181
  331. package/dist/web-effect-profiles.js.map +0 -1
  332. package/dist/web-effect-service.d.ts +0 -93
  333. package/dist/web-effect-service.js +0 -335
  334. package/dist/web-effect-service.js.map +0 -1
  335. package/dist/web-effect-tools.d.ts +0 -48
  336. package/dist/web-effect-tools.js +0 -129
  337. package/dist/web-effect-tools.js.map +0 -1
  338. package/dist/web-effect-trials.d.ts +0 -86
  339. package/dist/web-effect-trials.js +0 -204
  340. package/dist/web-effect-trials.js.map +0 -1
  341. package/dist/web-effect-upload.d.ts +0 -27
  342. package/dist/web-effect-upload.js +0 -185
  343. package/dist/web-effect-upload.js.map +0 -1
  344. package/dist/web-effect-worker.d.ts +0 -8
  345. package/dist/web-effect-worker.js +0 -170
  346. package/dist/web-effect-worker.js.map +0 -1
  347. package/dist/web-effect.d.ts +0 -103
  348. package/dist/web-effect.js +0 -153
  349. package/dist/web-effect.js.map +0 -1
  350. package/dist/web-experimental-http.d.ts +0 -2
  351. package/dist/web-experimental-http.js +0 -12
  352. package/dist/web-experimental-http.js.map +0 -1
  353. package/dist/web-mod-agent.d.ts +0 -50
  354. package/dist/web-mod-agent.js +0 -207
  355. package/dist/web-mod-agent.js.map +0 -1
@@ -14,6 +14,7 @@ import { codexEffort } from "./launch-effort.js";
14
14
  import { appendWithMarker, removeMarker } from "./marker-utils.js";
15
15
  import { codexSiblingState, codexStateDbAbsent, cwdRolloutsProvenAbsent, findExactCwdCodexSession, planCodexResume, newestMissedCwdRollout } from "./codex-session-lookup.js";
16
16
  import { t } from "../locale.js";
17
+ import { quotaLine, quotaLowLine, quotaPausedLine } from "../quota-notice.js";
17
18
  import { parse as parseToml } from "smol-toml";
18
19
  const CODEX_PROJECT_DOC_MAX_BYTES = 32_768;
19
20
  const SAFE_MODEL_ID_RE = /^[A-Za-z0-9._:/-]+$/;
@@ -296,7 +297,7 @@ function setProjectTrusted(content, root) {
296
297
  }
297
298
  /** Only the bottom, live Codex 0.156 folder-access screen can own stdin. */
298
299
  function codexTrustPromptState(pane) {
299
- const noPrompt = { active: false, folder: null, root: null, rootNote: "absent", safeChoice: false };
300
+ const noPrompt = { active: false, folder: null, root: null, rootNote: "absent", safeChoice: false, trustCursor: false };
300
301
  const rows = pane.replace(/\r/g, "").split("\n");
301
302
  let last = rows.length - 1;
302
303
  while (last >= 0 && rows[last].trim() === "")
@@ -343,7 +344,16 @@ function codexTrustPromptState(pane) {
343
344
  && choices[0].cursor === "›" && choices[0].number === "1" && choices[0].text === "Trust and continue"
344
345
  && choices[1].cursor === "" && choices[1].number === "2" && choices[1].text === "Quit"
345
346
  && /^\s*enter continue\s*·\s*esc quit\s*$/i.test(rows[last]);
346
- return { active: true, folder, root, rootNote, safeChoice };
347
+ const known = new Set(["Trust and continue", "Open restricted", "Quit"]);
348
+ // Exactly one selection marker, whichever form (› ❯ >), and it is on Trust; the footer is the one both 0.160 and 0.166
349
+ // show. Two markers, another footer mapping or an unknown option is held — never a guess where Enter lands (#2896 review).
350
+ const atCursor = choices.filter(choice => choice.cursor !== "");
351
+ const trustCursor = choices.length >= 2 && choices.every(choice => known.has(choice.text))
352
+ && choices.every((choice, index) => index === 0 || choice.row === choices[index - 1].row + 1)
353
+ && rows.slice(choices[choices.length - 1].row + 1, last).every(row => row.trim() === "")
354
+ && atCursor.length === 1 && atCursor[0].cursor === "›" && atCursor[0].text === "Trust and continue"
355
+ && /^\s*enter continue\s*·\s*esc quit\s*$/i.test(rows[last]);
356
+ return { active: true, folder, root, rootNote, safeChoice, trustCursor };
347
357
  }
348
358
  /** Unknown/older trust layouts are still input-blocking, never auto-answered. */
349
359
  function codexTrustVariantActive(pane) {
@@ -538,6 +548,55 @@ function codexRateSwitchPickerVisible(pane) {
538
548
  && take(/^\s*Switch to \S.{0,120} for lower credit usage\?\s*$/, false)
539
549
  && take(/^\s*Approaching rate limits\s*$/, false);
540
550
  }
551
+ /**
552
+ * The workspace-member limit prompt (#2844), as codex 0.160.0–0.165.0 paint it
553
+ * (`open_workspace_owner_nudge_prompt`, codex-rs/tui chatwidget/rate_limits.rs),
554
+ * captured live on 0.165.0 against the mock's wscredits/wsspend modes:
555
+ *
556
+ * ■ Your workspace is out of credits. Ask your workspace owner to refill in order to continue.
557
+ * Usage limit reached
558
+ * Request a limit increase from your owner to continue using codex. Request increase?
559
+ *
560
+ * 1. Yes (y)
561
+ * › 2. No (default) (n)
562
+ *
563
+ * enter select · esc back
564
+ *
565
+ * The other title is "You've reached your workspace credit limit" with "…Ask your
566
+ * workspace owner to add more. Notify owner?". Yes emails the workspace owner;
567
+ * Escape (the prompt's cancel) and No only close it, send nothing, and leave the
568
+ * error row above the composer, where the quota pause reads it.
569
+ *
570
+ * Bottom-anchored, every row exact: the hint last, the two options directly
571
+ * above it, the question (wrapped onto up to three rows on a narrow pane) and its
572
+ * own title above those. A quote in the transcript is followed by the composer
573
+ * and never matches.
574
+ */
575
+ const WORKSPACE_LIMIT_PROMPTS = [
576
+ [/^\s*Usage limit reached\s*$/, "Request a limit increase from your owner to continue using codex. Request increase?"],
577
+ [/^\s*You['’]ve reached your workspace credit limit\s*$/, "Your workspace is out of credits. Ask your workspace owner to add more. Notify owner?"],
578
+ ];
579
+ function codexWorkspaceLimitPromptVisible(pane) {
580
+ const rows = pane.replace(/\r/g, "").split("\n").filter(row => row.trim() !== "");
581
+ let i = rows.length - 1;
582
+ const take = (shape) => {
583
+ if (i < 0 || !shape.test(rows[i]))
584
+ return false;
585
+ i--;
586
+ return true;
587
+ };
588
+ if (!(take(/^\s*enter select\s*[·•]\s*esc back\s*$/i)
589
+ && take(/^\s*[›❯>]?\s*2\.\s+No \(default\)\s+\(n\)\s*$/)
590
+ && take(/^\s*[›❯>]?\s*1\.\s+Yes\s+\(y\)\s*$/)))
591
+ return false;
592
+ for (let lines = 1; lines <= 3 && i - lines >= 0; lines++) {
593
+ const question = rows.slice(i - lines + 1, i + 1).map(row => row.trim()).join(" ");
594
+ const title = rows[i - lines];
595
+ if (WORKSPACE_LIMIT_PROMPTS.some(([shape, text]) => question === text && shape.test(title)))
596
+ return true;
597
+ }
598
+ return false;
599
+ }
541
600
  /** Unknown pickers own stdin too; never type or press Enter into one. */
542
601
  function codexUnknownSelectionVisible(pane) {
543
602
  const rows = pane.replace(/\r/g, "").split("\n");
@@ -1169,9 +1228,11 @@ export class CodexBackend {
1169
1228
  buildCommand(config) {
1170
1229
  this.lastKnownModel = config.model?.trim() || null;
1171
1230
  this.credentialProfile = this.readProfile(config);
1231
+ // #2886: `--full-auto` is gone from codex (no supported version, 0.155 on, accepts it: the instance never started);
1232
+ // spelled out, it was a workspace-write sandbox that asks for approval on request.
1172
1233
  const approvalFlag = config.skipPermissions !== false
1173
1234
  ? "--dangerously-bypass-approvals-and-sandbox"
1174
- : "--full-auto";
1235
+ : "--sandbox workspace-write --ask-for-approval on-request";
1175
1236
  // #984: never trust `codex resume --last` to pick this instance's session.
1176
1237
  // Codex 0.157 scopes it to the git REPOSITORY, so in a worktree it resumes
1177
1238
  // the newest session of any sibling worktree (a lock screen while that
@@ -1894,6 +1955,7 @@ export class CodexBackend {
1894
1955
  type: "quota",
1895
1956
  action: "pause",
1896
1957
  message: "OpenAI quota exceeded",
1958
+ notice: () => quotaPausedLine("OpenAI", "api_quota"),
1897
1959
  },
1898
1960
  {
1899
1961
  // Codex already exhausted HTTP retries and returned to its composer.
@@ -1929,7 +1991,8 @@ export class CodexBackend {
1929
1991
  // Codex writes the apostrophe as U+2019 ("You’ve hit your usage limit.") since
1930
1992
  // 0.156 and as ASCII before (0.153.4): both must match, or no usage limit
1931
1993
  // ever pauses the instance (#1098).
1932
- { pattern: /you['’]ve hit your usage limit/i, type: "quota", action: "pause", message: "Codex usage limit reached — upgrade plan required" },
1994
+ { pattern: /you['’]ve hit your usage limit/i, type: "quota", action: "pause", message: "Codex usage limit reached — upgrade plan required",
1995
+ notice: () => quotaPausedLine("Codex", "usage") },
1933
1996
  {
1934
1997
  // The terminal stage of a lost app-server (#1099): Codex has given up
1935
1998
  // reconnecting and says so, with a counter that never stops. Nothing
@@ -1982,27 +2045,53 @@ export class CodexBackend {
1982
2045
  skipCooldown: true,
1983
2046
  skipRecoveryWait: true,
1984
2047
  },
1985
- // Workspace (team) accounts report exhaustion differently from personal
1986
- // ones — the full line is:
1987
- // "■ Your workspace is out of credits. Ask your workspace owner to
1988
- // refill in order to continue."
2048
+ // Workspace (business) accounts report exhaustion differently from personal
2049
+ // ones, with codex's own rows (codex-rs/protocol error.rs and tui
2050
+ // turn_runtime.rs, unchanged 0.160.0–0.165.0):
2051
+ // member: "■ Your workspace is out of credits. Ask your workspace owner to refill in order to continue."
2052
+ // "■ You hit your spend cap set by the owner of your workspace. Ask an owner to increase your spend cap to continue."
2053
+ // owner: "■ You're out of credits. Your workspace is out of credits. Add credits to continue using Codex."
2054
+ // "■ Your workspace is out of credits. Add credits to continue."
2055
+ // "■ You hit your spend cap set in your workspace. Increase your spend cap to continue."
2056
+ // "■ Usage limit reached. You've reached your usage limit. Increase your limits to continue using codex."
1989
2057
  // Neither `insufficient_quota|billing` nor `you've hit your usage limit`
1990
- // matches it, so this state went unreported.
2058
+ // matches them.
1991
2059
  //
1992
- // `\s+` at each word gap: capture-pane runs without -J, so tmux's hard
1993
- // wrap can land a newline anywhere in the phrase. The `■` prefix and the
1994
- // "Ask your workspace owner…" tail are deliberately left out — the prefix
1995
- // is decoration and the tail is what would wrap.
2060
+ // pause, not notify: nothing works until someone refills or raises the cap.
2061
+ // Anchored to the status glyph in COLUMN 0, because these skip the
2062
+ // usage-window check (a workspace limit is not one of those windows, so the
2063
+ // check would call it "available"): codex draws its own error cells there,
2064
+ // while an agent's message, quote or code block is indented under its `•`
2065
+ // (captured live, tests/fixtures/codex-0165-workspace-quoted.pane.txt).
2066
+ // `\s+` at each word gap: capture-pane runs without -J, so tmux's hard wrap
2067
+ // can land a newline anywhere in the sentence. A resumed transcript reprints
2068
+ // these rows, and the first live composer of a spawn takes them as history.
1996
2069
  {
1997
- pattern: /workspace\s+is\s+out\s+of\s+credits/i,
2070
+ pattern: new RegExp(String.raw `^(?:${CODEX_STATUS_GLYPH})[ \t]+(?:You['’]re\s+out\s+of\s+credits\.\s+)?Your\s+workspace\s+is\s+out\s+of\s+credits\.`, "m"),
1998
2071
  type: "quota",
1999
- // pause, not notify: exhausted credits are a dead end until someone
2000
- // refills, so leaving the instance running just burns cycles failing.
2001
- // Matches how the other terminal quota states behave (claude-code's
2002
- // "credit balance is too low", codex's own "you've hit your usage
2003
- // limit"). Costs a manual resume after the refill.
2004
2072
  action: "pause",
2005
2073
  message: "Codex workspace credits exhausted — workspace owner must refill",
2074
+ notice: () => quotaPausedLine("Codex", "workspace_credits"),
2075
+ skipUsageVerify: true,
2076
+ historyUntilLiveComposer: true,
2077
+ },
2078
+ {
2079
+ pattern: new RegExp(String.raw `^(?:${CODEX_STATUS_GLYPH})[ \t]+You\s+hit\s+your\s+spend\s+cap\s+set\s+(?:by\s+the\s+owner\s+of|in)\s+your\s+workspace\.`, "m"),
2080
+ type: "quota",
2081
+ action: "pause",
2082
+ message: "Codex workspace spend cap reached — workspace owner must raise it",
2083
+ notice: () => t("inst.quota_spend_cap"),
2084
+ skipUsageVerify: true,
2085
+ historyUntilLiveComposer: true,
2086
+ },
2087
+ {
2088
+ pattern: new RegExp(String.raw `^(?:${CODEX_STATUS_GLYPH})[ \t]+Usage\s+limit\s+reached\.\s+You['’]ve\s+reached\s+your\s+usage\s+limit\.\s+Increase\s+your\s+limits`, "m"),
2089
+ type: "quota",
2090
+ action: "pause",
2091
+ message: "Codex workspace usage limit reached — increase the workspace limits to continue",
2092
+ notice: () => quotaPausedLine("Codex", "workspace_usage"),
2093
+ skipUsageVerify: true,
2094
+ historyUntilLiveComposer: true,
2006
2095
  },
2007
2096
  // Codex warns at 10% and 5% remaining, and scopes the limit by period —
2008
2097
  // "weekly" alone missed every `monthly limit` warning.
@@ -2021,28 +2110,14 @@ export class CodexBackend {
2021
2110
  action: "notify",
2022
2111
  message: "Codex usage limit running low",
2023
2112
  formatMessage: (m) => `Codex ${m[2].toLowerCase()} limit: less than ${m[1]}% left`,
2113
+ notice: (m) => (m ? quotaLowLine(m[2], m[1]) : quotaLine("Codex", "usage")),
2024
2114
  },
2025
2115
  ];
2026
2116
  }
2027
2117
  getStartupDialogs() {
2028
2118
  const trustHold = this.trustHoldDialog();
2029
2119
  return [
2030
- {
2031
- pattern: /^\s*Trust this folder\?/m,
2032
- keys: ["Enter"],
2033
- description: "Codex authorized folder trust dialog",
2034
- blocksDelivery: true,
2035
- inputBlocked: true,
2036
- autoResolutionKey: "codex-authorized-folder-trust",
2037
- isActive: pane => {
2038
- const state = codexTrustPromptState(pane);
2039
- const authorized = this.authorizedTrust;
2040
- return state.active && state.safeChoice && authorized !== null
2041
- && state.folder === authorized.cwd
2042
- && (state.rootNote === "absent" ? authorized.root === authorized.cwd
2043
- : state.rootNote === "parsed" && state.root === authorized.root);
2044
- },
2045
- },
2120
+ this.autoTrustDialog(),
2046
2121
  trustHold,
2047
2122
  this.updatePickerDialog(),
2048
2123
  this.rateSwitchPickerDialog(),
@@ -2077,6 +2152,26 @@ export class CodexBackend {
2077
2152
  },
2078
2153
  ];
2079
2154
  }
2155
+ /**
2156
+ * The user's decision (hmsg-53600a2c): codex's folder-trust prompt in an AgEnD session is always answered Trust — the
2157
+ * workspace is the agent's own, whatever preTrust covered (preTrust stays, so the prompt rarely shows at all). Enter,
2158
+ * only with the cursor on "Trust and continue" among the known options (trustCursor); any other layout or row is
2159
+ * held (trustHoldDialog). It trusts the folder only: per-action approvals are separate dialogs and are not touched.
2160
+ */
2161
+ autoTrustDialog() {
2162
+ return {
2163
+ pattern: /^\s*Trust this folder\?/m,
2164
+ keys: ["Enter"],
2165
+ description: "Codex folder trust — trusting the agent's own folder",
2166
+ blocksDelivery: true,
2167
+ inputBlocked: true,
2168
+ autoResolutionKey: "codex-folder-auto-trust",
2169
+ // One Enter per prompt (claimed, then checked): a prompt still up after it is held, never pressed again (#2896 review).
2170
+ verifyAfterKeys: true,
2171
+ isActive: pane => codexTrustPromptState(pane).trustCursor,
2172
+ answerDetail: pane => ({ autoTrusted: true, ...this.trustPaneFields(pane) }),
2173
+ };
2174
+ }
2080
2175
  trustHoldDialog() {
2081
2176
  return {
2082
2177
  pattern: /^\s*(?:Folder access|Trust this folder\?|Do you trust the files in this folder\?)/im,
@@ -2086,8 +2181,42 @@ export class CodexBackend {
2086
2181
  blocksDelivery: true,
2087
2182
  inputBlocked: true,
2088
2183
  isActive: codexTrustVariantActive,
2184
+ heldReason: pane => this.trustHoldReason(pane),
2089
2185
  };
2090
2186
  }
2187
+ /**
2188
+ * #2893: why the authorized folder-trust answer did not take this prompt (log only): what the pane shows against what
2189
+ * preTrust authorized for this launch, and whether the instance's config trusts the folder codex is asking about. A
2190
+ * field case of a held trust prompt then explains itself in daemon.log.
2191
+ */
2192
+ trustHoldReason(pane) {
2193
+ const state = codexTrustPromptState(pane), authorized = this.authorizedTrust;
2194
+ const configPath = join(this.isolatedCodexHome, "config.toml");
2195
+ let configTrust = "unreadable";
2196
+ if (state.folder) {
2197
+ try {
2198
+ configTrust = effectiveProjectTrust(readFileSync(configPath, "utf-8"), state.root ?? state.folder) ?? "absent";
2199
+ }
2200
+ catch { /* unreadable */ }
2201
+ }
2202
+ // The same test as the startup entry's authorized answer: when it holds, nothing differs — say so, never a mismatch.
2203
+ const rootMatches = authorized !== null && (state.rootNote === "absent" ? authorized.root === authorized.cwd
2204
+ : state.rootNote === "parsed" && state.root === authorized.root);
2205
+ const authorizedMatch = state.active && state.safeChoice && authorized !== null && state.folder === authorized.cwd && rootMatches;
2206
+ // hmsg-53600a2c: Trust is pressed whenever the cursor is on it; a hold is a layout, a row, or a press that did not take.
2207
+ const reason = !state.active ? "a trust layout AgEnD never answers (Folder access options, or Do you trust the files…)"
2208
+ : !state.trustCursor ? "the cursor is not on Trust and continue, or the options are not the known ones"
2209
+ : "Trust was already pressed for this prompt and it is still up";
2210
+ return { trustHoldReason: reason, authorizedMatch, promptFolder: state.folder, promptRoot: state.root, rootNote: state.rootNote,
2211
+ authorizedCwd: authorized?.cwd ?? null, authorizedRoot: authorized?.root ?? null, configPath, configTrust };
2212
+ }
2213
+ /** What an auto-trust answered (log only): the folder and root on the prompt, what preTrust covered, and the config path. */
2214
+ trustPaneFields(pane) {
2215
+ const state = codexTrustPromptState(pane), authorized = this.authorizedTrust;
2216
+ return { promptFolder: state.folder, promptRoot: state.root, rootNote: state.rootNote,
2217
+ authorizedCwd: authorized?.cwd ?? null, authorizedRoot: authorized?.root ?? null,
2218
+ configPath: join(this.isolatedCodexHome, "config.toml") };
2219
+ }
2091
2220
  /**
2092
2221
  * #1008: the rate-limit model-switch picker parked unattended instances (it
2093
2222
  * waits forever and its default option changes the model). Prevention is
@@ -2163,6 +2292,24 @@ export class CodexBackend {
2163
2292
  },
2164
2293
  };
2165
2294
  }
2295
+ workspaceLimitPromptDialog() {
2296
+ // Escape via sendSpecialKey, the same as the Luna Reserve menu: never a paste
2297
+ // (its implicit Enter would confirm the cursor's row) and never "y". The error
2298
+ // row codex printed above the prompt stays, and the quota pause takes it from
2299
+ // there: one notice, no parked dialog.
2300
+ return {
2301
+ pattern: /^\s*enter select\s*[·•]\s*esc back\s*$/im,
2302
+ keys: ["Escape"],
2303
+ description: "Codex workspace limit prompt — pressing Escape (never asking the owner)",
2304
+ blocksDelivery: true,
2305
+ inputBlocked: true,
2306
+ isActive: codexWorkspaceLimitPromptVisible,
2307
+ verifyAfterKeys: true,
2308
+ autoResolutionKey: "codex-workspace-limit-prompt",
2309
+ answeredByAgend: true,
2310
+ marksLiveIncident: true,
2311
+ };
2312
+ }
2166
2313
  unknownSelectionHoldDialog() {
2167
2314
  return {
2168
2315
  pattern: /^\s*[›❯>]\s+\S/m,
@@ -2176,6 +2323,7 @@ export class CodexBackend {
2176
2323
  }
2177
2324
  getRuntimeDialogs() {
2178
2325
  return [
2326
+ this.autoTrustDialog(),
2179
2327
  this.trustHoldDialog(),
2180
2328
  this.rateSwitchPickerDialog(),
2181
2329
  {
@@ -2193,6 +2341,7 @@ export class CodexBackend {
2193
2341
  },
2194
2342
  this.updatePickerDialog(),
2195
2343
  this.usageLimitLunaReserveDialog(),
2344
+ this.workspaceLimitPromptDialog(),
2196
2345
  ...this.sessionHoldDialogs(),
2197
2346
  this.unknownSelectionHoldDialog(),
2198
2347
  ];