@bryanhu/codexly 0.17.0 → 0.19.0

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 (256) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +6 -2
  3. package/README.zh-CN.md +5 -1
  4. package/dist/chunk-B2673ODM.js +260 -0
  5. package/dist/chunk-GT7XTSEG.js +56 -0
  6. package/dist/{chunk-5VUCBET3.js → chunk-HMXTAIDF.js} +2858 -4039
  7. package/dist/{chunk-P3ZQ3QOJ.js → chunk-X5JZ3VOF.js} +369 -32
  8. package/dist/{chunk-PJNYCTFC.js → chunk-YFWMYA6X.js} +884 -123
  9. package/dist/{chunk-I74DBIGI.js → chunk-ZUECHB6L.js} +1 -1
  10. package/dist/cli.js +114 -39
  11. package/dist/client/index.js +268 -11
  12. package/dist/core/index.js +1 -1
  13. package/dist/protocol/index.js +2 -1
  14. package/dist/providers/codex/index.js +4 -3
  15. package/dist/runtime-instance-worker.js +19 -0
  16. package/dist/scheduled-task-recurrence-worker.js +2969 -0
  17. package/dist/server/index.js +6 -5
  18. package/dist/sqlite-state-worker.js +156 -13
  19. package/dist/web/.vite/manifest.json +300 -126
  20. package/dist/web/.vite/manifest.json.br +0 -0
  21. package/dist/web/.vite/manifest.json.gz +0 -0
  22. package/dist/web/assets/agent-settings-panel-B3hoqvYI.js +1 -0
  23. package/dist/web/assets/agent-settings-panel-B3hoqvYI.js.br +0 -0
  24. package/dist/web/assets/agent-settings-panel-B3hoqvYI.js.gz +0 -0
  25. package/dist/web/assets/approval-mode-CKJY6q52.js +1 -0
  26. package/dist/web/assets/approval-mode-CKJY6q52.js.br +0 -0
  27. package/dist/web/assets/approval-mode-CKJY6q52.js.gz +0 -0
  28. package/dist/web/assets/background-image-picker-DV18Olkx.js +1 -0
  29. package/dist/web/assets/background-image-picker-DV18Olkx.js.br +0 -0
  30. package/dist/web/assets/background-image-picker-DV18Olkx.js.gz +0 -0
  31. package/dist/web/assets/bing-wallpaper-queries-CybCDdtr.js +1 -0
  32. package/dist/web/assets/bing-wallpaper-queries-CybCDdtr.js.br +0 -0
  33. package/dist/web/assets/bing-wallpaper-queries-CybCDdtr.js.gz +0 -0
  34. package/dist/web/assets/bot-nsMcDaYk.js +1 -0
  35. package/dist/web/assets/bot-nsMcDaYk.js.br +0 -0
  36. package/dist/web/assets/bot-nsMcDaYk.js.gz +0 -0
  37. package/dist/web/assets/{button-group-DxqOhlVt.js → button-group-DLm5MGrs.js} +1 -1
  38. package/dist/web/assets/button-group-DLm5MGrs.js.br +0 -0
  39. package/dist/web/assets/button-group-DLm5MGrs.js.gz +0 -0
  40. package/dist/web/assets/commit-settings-panel-RS1ax2vB.js +1 -0
  41. package/dist/web/assets/commit-settings-panel-RS1ax2vB.js.br +0 -0
  42. package/dist/web/assets/commit-settings-panel-RS1ax2vB.js.gz +0 -0
  43. package/dist/web/assets/{context-menu-D6mhhPGo.js → context-menu-DP6ii80r.js} +1 -1
  44. package/dist/web/assets/context-menu-DP6ii80r.js.br +0 -0
  45. package/dist/web/assets/context-menu-DP6ii80r.js.gz +0 -0
  46. package/dist/web/assets/{dist-Czw-hil0.js → dist-ClwyqJQu.js} +1 -1
  47. package/dist/web/assets/dist-ClwyqJQu.js.br +0 -0
  48. package/dist/web/assets/dist-ClwyqJQu.js.gz +0 -0
  49. package/dist/web/assets/file-review-dialog-C3to4N_J.js +2 -0
  50. package/dist/web/assets/file-review-dialog-C3to4N_J.js.br +0 -0
  51. package/dist/web/assets/file-review-dialog-C3to4N_J.js.gz +0 -0
  52. package/dist/web/assets/git-fork-D0BPqh18.js +1 -0
  53. package/dist/web/assets/git-fork-D0BPqh18.js.br +2 -0
  54. package/dist/web/assets/git-fork-D0BPqh18.js.gz +0 -0
  55. package/dist/web/assets/git-history-panel-D2OdQ1Pg.js +2 -0
  56. package/dist/web/assets/git-history-panel-D2OdQ1Pg.js.br +0 -0
  57. package/dist/web/assets/git-history-panel-D2OdQ1Pg.js.gz +0 -0
  58. package/dist/web/assets/global-settings-about-DYd77AOa.js +1 -0
  59. package/dist/web/assets/global-settings-about-DYd77AOa.js.br +0 -0
  60. package/dist/web/assets/global-settings-about-DYd77AOa.js.gz +0 -0
  61. package/dist/web/assets/global-settings-fields-C0IfL3RQ.js +1 -0
  62. package/dist/web/assets/global-settings-fields-C0IfL3RQ.js.br +0 -0
  63. package/dist/web/assets/global-settings-fields-C0IfL3RQ.js.gz +0 -0
  64. package/dist/web/assets/global-settings-model-dAGHIcU5.js +1 -0
  65. package/dist/web/assets/global-settings-model-dAGHIcU5.js.br +0 -0
  66. package/dist/web/assets/global-settings-model-dAGHIcU5.js.gz +0 -0
  67. package/dist/web/assets/global-settings-page-746-HK5D.js +2 -0
  68. package/dist/web/assets/global-settings-page-746-HK5D.js.br +0 -0
  69. package/dist/web/assets/global-settings-page-746-HK5D.js.gz +0 -0
  70. package/dist/web/assets/global-settings-page-BqzYrF2U.css +1 -0
  71. package/dist/web/assets/global-settings-page-BqzYrF2U.css.br +0 -0
  72. package/dist/web/assets/global-settings-page-BqzYrF2U.css.gz +0 -0
  73. package/dist/web/assets/global-settings-pets-8bzx8OFf.css +1 -0
  74. package/dist/web/assets/global-settings-pets-8bzx8OFf.css.br +0 -0
  75. package/dist/web/assets/global-settings-pets-8bzx8OFf.css.gz +0 -0
  76. package/dist/web/assets/global-settings-pets-B6HRYnYq.js +1 -0
  77. package/dist/web/assets/global-settings-pets-B6HRYnYq.js.br +0 -0
  78. package/dist/web/assets/global-settings-pets-B6HRYnYq.js.gz +0 -0
  79. package/dist/web/assets/index-DGp-a5pq.css +2 -0
  80. package/dist/web/assets/index-DGp-a5pq.css.br +0 -0
  81. package/dist/web/assets/index-DGp-a5pq.css.gz +0 -0
  82. package/dist/web/assets/index-DwEl9mCY.js +4 -0
  83. package/dist/web/assets/index-DwEl9mCY.js.br +0 -0
  84. package/dist/web/assets/index-DwEl9mCY.js.gz +0 -0
  85. package/dist/web/assets/initial-deps-Bk3GSWTk.js +1 -0
  86. package/dist/web/assets/initial-deps-Bk3GSWTk.js.br +0 -0
  87. package/dist/web/assets/initial-deps-Bk3GSWTk.js.gz +0 -0
  88. package/dist/web/assets/{initial-deps-CQxWMuPh.js → initial-deps-DeVnmDFC.js} +1 -1
  89. package/dist/web/assets/initial-deps-DeVnmDFC.js.br +0 -0
  90. package/dist/web/assets/initial-deps-DeVnmDFC.js.gz +0 -0
  91. package/dist/web/assets/installed-skills-pane-Gzaol8-B.js +1 -0
  92. package/dist/web/assets/installed-skills-pane-Gzaol8-B.js.br +0 -0
  93. package/dist/web/assets/installed-skills-pane-Gzaol8-B.js.gz +0 -0
  94. package/dist/web/assets/lazy-message-response-CZT51-go.js +2 -0
  95. package/dist/web/assets/lazy-message-response-CZT51-go.js.br +0 -0
  96. package/dist/web/assets/lazy-message-response-CZT51-go.js.gz +0 -0
  97. package/dist/web/assets/mcp-management-pane-C0g0wk8t.js +1 -0
  98. package/dist/web/assets/mcp-management-pane-C0g0wk8t.js.br +0 -0
  99. package/dist/web/assets/mcp-management-pane-C0g0wk8t.js.gz +0 -0
  100. package/dist/web/assets/{message-response-KFxzclWt.js → message-response-CA2hanqw.js} +1 -1
  101. package/dist/web/assets/message-response-CA2hanqw.js.br +0 -0
  102. package/dist/web/assets/message-response-CA2hanqw.js.gz +0 -0
  103. package/dist/web/assets/{official-plugins-pane-CFbYqeRf.js → official-plugins-pane-D6kbUBEm.js} +1 -1
  104. package/dist/web/assets/official-plugins-pane-D6kbUBEm.js.br +0 -0
  105. package/dist/web/assets/official-plugins-pane-D6kbUBEm.js.gz +0 -0
  106. package/dist/web/assets/paw-print-9SfXKttW.js +1 -0
  107. package/dist/web/assets/paw-print-9SfXKttW.js.br +0 -0
  108. package/dist/web/assets/paw-print-9SfXKttW.js.gz +0 -0
  109. package/dist/web/assets/personalization-settings-panel-DnWZEv6V.js +1 -0
  110. package/dist/web/assets/personalization-settings-panel-DnWZEv6V.js.br +0 -0
  111. package/dist/web/assets/personalization-settings-panel-DnWZEv6V.js.gz +0 -0
  112. package/dist/web/assets/{project-file-popup-page-9jdg_OXD.js → project-file-popup-page-C8zcwgkf.js} +1 -1
  113. package/dist/web/assets/project-file-popup-page-C8zcwgkf.js.br +0 -0
  114. package/dist/web/assets/project-file-popup-page-C8zcwgkf.js.gz +0 -0
  115. package/dist/web/assets/{project-source-panel-B-xuo6G6.js → project-source-panel-ChVlP72p.js} +2 -2
  116. package/dist/web/assets/project-source-panel-ChVlP72p.js.br +0 -0
  117. package/dist/web/assets/project-source-panel-ChVlP72p.js.gz +0 -0
  118. package/dist/web/assets/prompt-input-CcovKFMj.js +1 -0
  119. package/dist/web/assets/prompt-input-CcovKFMj.js.br +0 -0
  120. package/dist/web/assets/prompt-input-CcovKFMj.js.gz +0 -0
  121. package/dist/web/assets/{prompt-input-controls-CuE9VrWA.js → prompt-input-controls-j_r9SnuL.js} +1 -1
  122. package/dist/web/assets/prompt-input-controls-j_r9SnuL.js.br +0 -0
  123. package/dist/web/assets/prompt-input-controls-j_r9SnuL.js.gz +0 -0
  124. package/dist/web/assets/scheduled-task-date-time-picker-CkLwYwGu.js +1 -0
  125. package/dist/web/assets/scheduled-task-date-time-picker-CkLwYwGu.js.br +0 -0
  126. package/dist/web/assets/scheduled-task-date-time-picker-CkLwYwGu.js.gz +0 -0
  127. package/dist/web/assets/{scheduled-task-floating-ui~scheduled-task-date-time-picker-BischM2-.js → scheduled-task-floating-ui~scheduled-task-date-time-picker-Bz9LiWta.js} +1 -1
  128. package/dist/web/assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-Bz9LiWta.js.br +0 -0
  129. package/dist/web/assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-Bz9LiWta.js.gz +0 -0
  130. package/dist/web/assets/scheduled-task-schedule-f0nylWUa.js +1 -0
  131. package/dist/web/assets/scheduled-task-schedule-f0nylWUa.js.br +0 -0
  132. package/dist/web/assets/scheduled-task-schedule-f0nylWUa.js.gz +0 -0
  133. package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css +1 -0
  134. package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css.br +0 -0
  135. package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css.gz +0 -0
  136. package/dist/web/assets/scheduled-tasks-container-DxM30EEY.js +2 -0
  137. package/dist/web/assets/scheduled-tasks-container-DxM30EEY.js.br +0 -0
  138. package/dist/web/assets/scheduled-tasks-container-DxM30EEY.js.gz +0 -0
  139. package/dist/web/assets/settings-personalization-CPFvvwt7.js +1 -0
  140. package/dist/web/assets/settings-personalization-CPFvvwt7.js.br +0 -0
  141. package/dist/web/assets/settings-personalization-CPFvvwt7.js.gz +0 -0
  142. package/dist/web/assets/{sheet-DTJIZQHt.js → sheet-Co357cup.js} +1 -1
  143. package/dist/web/assets/sheet-Co357cup.js.br +0 -0
  144. package/dist/web/assets/sheet-Co357cup.js.gz +0 -0
  145. package/dist/web/assets/{skills-market-container-8VwHWKJN.js → skills-market-container-CJ8k5fIO.js} +2 -2
  146. package/dist/web/assets/skills-market-container-CJ8k5fIO.js.br +0 -0
  147. package/dist/web/assets/skills-market-container-CJ8k5fIO.js.gz +0 -0
  148. package/dist/web/assets/sliders-horizontal-DfoeSLtp.js +1 -0
  149. package/dist/web/assets/sliders-horizontal-DfoeSLtp.js.br +0 -0
  150. package/dist/web/assets/sliders-horizontal-DfoeSLtp.js.gz +0 -0
  151. package/dist/web/assets/{third-party-marketplace-pane-BtZYBzru.js → third-party-marketplace-pane-BrosEBTn.js} +1 -1
  152. package/dist/web/assets/third-party-marketplace-pane-BrosEBTn.js.br +0 -0
  153. package/dist/web/assets/third-party-marketplace-pane-BrosEBTn.js.gz +0 -0
  154. package/dist/web/assets/workbench-composer-CxDyu4IJ.js +8 -0
  155. package/dist/web/assets/workbench-composer-CxDyu4IJ.js.br +0 -0
  156. package/dist/web/assets/workbench-composer-CxDyu4IJ.js.gz +0 -0
  157. package/dist/web/assets/workbench-inspector-changes-DXrYXxmV.js +2 -0
  158. package/dist/web/assets/workbench-inspector-changes-DXrYXxmV.js.br +0 -0
  159. package/dist/web/assets/workbench-inspector-changes-DXrYXxmV.js.gz +0 -0
  160. package/dist/web/assets/workbench-pet-canvas-C5NL9nOc.js +1 -0
  161. package/dist/web/assets/workbench-pet-canvas-C5NL9nOc.js.br +0 -0
  162. package/dist/web/assets/workbench-pet-canvas-C5NL9nOc.js.gz +0 -0
  163. package/dist/web/assets/workbench-shell-C3Zu4F9x.js +8 -0
  164. package/dist/web/assets/workbench-shell-C3Zu4F9x.js.br +0 -0
  165. package/dist/web/assets/workbench-shell-C3Zu4F9x.js.gz +0 -0
  166. package/dist/web/index.html +5 -5
  167. package/dist/web/index.html.br +0 -0
  168. package/dist/web/index.html.gz +0 -0
  169. package/package.json +2 -2
  170. package/dist/chunk-RNTA4MFS.js +0 -23
  171. package/dist/web/assets/button-group-DxqOhlVt.js.br +0 -0
  172. package/dist/web/assets/button-group-DxqOhlVt.js.gz +0 -0
  173. package/dist/web/assets/context-menu-D6mhhPGo.js.br +0 -0
  174. package/dist/web/assets/context-menu-D6mhhPGo.js.gz +0 -0
  175. package/dist/web/assets/dist-Czw-hil0.js.br +0 -0
  176. package/dist/web/assets/dist-Czw-hil0.js.gz +0 -0
  177. package/dist/web/assets/file-review-dialog-CX8yGcaF.js +0 -2
  178. package/dist/web/assets/file-review-dialog-CX8yGcaF.js.br +0 -0
  179. package/dist/web/assets/file-review-dialog-CX8yGcaF.js.gz +0 -0
  180. package/dist/web/assets/git-commit-horizontal-CV-KjCHw.js +0 -1
  181. package/dist/web/assets/git-commit-horizontal-CV-KjCHw.js.br +0 -0
  182. package/dist/web/assets/git-commit-horizontal-CV-KjCHw.js.gz +0 -0
  183. package/dist/web/assets/git-history-panel-ChKO0MmG.js +0 -2
  184. package/dist/web/assets/git-history-panel-ChKO0MmG.js.br +0 -0
  185. package/dist/web/assets/git-history-panel-ChKO0MmG.js.gz +0 -0
  186. package/dist/web/assets/global-settings-dialog-Dmjldruk.js +0 -1
  187. package/dist/web/assets/global-settings-dialog-Dmjldruk.js.br +0 -0
  188. package/dist/web/assets/global-settings-dialog-Dmjldruk.js.gz +0 -0
  189. package/dist/web/assets/index-C1q8rvrB.css +0 -2
  190. package/dist/web/assets/index-C1q8rvrB.css.br +0 -0
  191. package/dist/web/assets/index-C1q8rvrB.css.gz +0 -0
  192. package/dist/web/assets/index-Dc0FOD_M.js +0 -4
  193. package/dist/web/assets/index-Dc0FOD_M.js.br +0 -0
  194. package/dist/web/assets/index-Dc0FOD_M.js.gz +0 -0
  195. package/dist/web/assets/initial-deps-CQxWMuPh.js.br +0 -0
  196. package/dist/web/assets/initial-deps-CQxWMuPh.js.gz +0 -0
  197. package/dist/web/assets/initial-deps-Dr1AWuHB.js +0 -1
  198. package/dist/web/assets/initial-deps-Dr1AWuHB.js.br +0 -0
  199. package/dist/web/assets/initial-deps-Dr1AWuHB.js.gz +0 -0
  200. package/dist/web/assets/installed-skills-pane-BfNddwjn.js +0 -1
  201. package/dist/web/assets/installed-skills-pane-BfNddwjn.js.br +0 -0
  202. package/dist/web/assets/installed-skills-pane-BfNddwjn.js.gz +0 -0
  203. package/dist/web/assets/lazy-message-response-BpXGmE9E.js +0 -2
  204. package/dist/web/assets/lazy-message-response-BpXGmE9E.js.br +0 -0
  205. package/dist/web/assets/lazy-message-response-BpXGmE9E.js.gz +0 -0
  206. package/dist/web/assets/mcp-management-pane-Ch_kUuam.js +0 -1
  207. package/dist/web/assets/mcp-management-pane-Ch_kUuam.js.br +0 -0
  208. package/dist/web/assets/mcp-management-pane-Ch_kUuam.js.gz +0 -0
  209. package/dist/web/assets/message-response-KFxzclWt.js.br +0 -0
  210. package/dist/web/assets/message-response-KFxzclWt.js.gz +0 -0
  211. package/dist/web/assets/official-plugins-pane-CFbYqeRf.js.br +0 -0
  212. package/dist/web/assets/official-plugins-pane-CFbYqeRf.js.gz +0 -0
  213. package/dist/web/assets/project-file-popup-page-9jdg_OXD.js.br +0 -0
  214. package/dist/web/assets/project-file-popup-page-9jdg_OXD.js.gz +0 -0
  215. package/dist/web/assets/project-source-panel-B-xuo6G6.js.br +0 -0
  216. package/dist/web/assets/project-source-panel-B-xuo6G6.js.gz +0 -0
  217. package/dist/web/assets/prompt-input-CS22f1Yj.js +0 -1
  218. package/dist/web/assets/prompt-input-CS22f1Yj.js.br +0 -0
  219. package/dist/web/assets/prompt-input-CS22f1Yj.js.gz +0 -0
  220. package/dist/web/assets/prompt-input-controls-CuE9VrWA.js.br +0 -0
  221. package/dist/web/assets/prompt-input-controls-CuE9VrWA.js.gz +0 -0
  222. package/dist/web/assets/scheduled-task-date-time-picker-DbgzJnvY.js +0 -1
  223. package/dist/web/assets/scheduled-task-date-time-picker-DbgzJnvY.js.br +0 -0
  224. package/dist/web/assets/scheduled-task-date-time-picker-DbgzJnvY.js.gz +0 -0
  225. package/dist/web/assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-BischM2-.js.br +0 -0
  226. package/dist/web/assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-BischM2-.js.gz +0 -0
  227. package/dist/web/assets/scheduled-task-schedule-Cfuv_Kyf.js +0 -1
  228. package/dist/web/assets/scheduled-task-schedule-Cfuv_Kyf.js.br +0 -0
  229. package/dist/web/assets/scheduled-task-schedule-Cfuv_Kyf.js.gz +0 -0
  230. package/dist/web/assets/scheduled-tasks-container-Cikmo6YE.js +0 -2
  231. package/dist/web/assets/scheduled-tasks-container-Cikmo6YE.js.br +0 -0
  232. package/dist/web/assets/scheduled-tasks-container-Cikmo6YE.js.gz +0 -0
  233. package/dist/web/assets/scheduled-tasks-container-xtJWjMjU.css +0 -1
  234. package/dist/web/assets/scheduled-tasks-container-xtJWjMjU.css.br +0 -0
  235. package/dist/web/assets/scheduled-tasks-container-xtJWjMjU.css.gz +0 -0
  236. package/dist/web/assets/sheet-DTJIZQHt.js.br +0 -0
  237. package/dist/web/assets/sheet-DTJIZQHt.js.gz +0 -0
  238. package/dist/web/assets/skills-market-container-8VwHWKJN.js.br +0 -0
  239. package/dist/web/assets/skills-market-container-8VwHWKJN.js.gz +0 -0
  240. package/dist/web/assets/third-party-marketplace-pane-BtZYBzru.js.br +0 -0
  241. package/dist/web/assets/third-party-marketplace-pane-BtZYBzru.js.gz +0 -0
  242. package/dist/web/assets/workbench-composer-Dfa3le3p.js +0 -10
  243. package/dist/web/assets/workbench-composer-Dfa3le3p.js.br +0 -0
  244. package/dist/web/assets/workbench-composer-Dfa3le3p.js.gz +0 -0
  245. package/dist/web/assets/workbench-inspector-changes-Be75nN9Z.js +0 -2
  246. package/dist/web/assets/workbench-inspector-changes-Be75nN9Z.js.br +0 -0
  247. package/dist/web/assets/workbench-inspector-changes-Be75nN9Z.js.gz +0 -0
  248. package/dist/web/assets/workbench-pet-canvas-gckmllUf.js +0 -1
  249. package/dist/web/assets/workbench-pet-canvas-gckmllUf.js.br +0 -0
  250. package/dist/web/assets/workbench-pet-canvas-gckmllUf.js.gz +0 -0
  251. package/dist/web/assets/workbench-shell-0X1Ehypo.js +0 -8
  252. package/dist/web/assets/workbench-shell-0X1Ehypo.js.br +0 -0
  253. package/dist/web/assets/workbench-shell-0X1Ehypo.js.gz +0 -0
  254. /package/dist/web/assets/{scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~olri0nvu-DAfditVv.js → scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~egzauog4-DAfditVv.js} +0 -0
  255. /package/dist/web/assets/{scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~olri0nvu-DAfditVv.js.br → scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~egzauog4-DAfditVv.js.br} +0 -0
  256. /package/dist/web/assets/{scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~olri0nvu-DAfditVv.js.gz → scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-file-p~egzauog4-DAfditVv.js.gz} +0 -0
@@ -1,16 +1,16 @@
1
1
  import { createRequire } from 'node:module';
2
- import { WorkbenchPetProviderError, PendingRequestResolutionError } from './chunk-RNTA4MFS.js';
3
- import { TEMPORARY_TASK_SCOPE_ID, MAX_AGENT_HISTORY_IMAGE_TOTAL_BYTES, isAgentFastModeAvailable, MAX_REALTIME_FILE_CHANGES, MAX_REALTIME_DIFF_BYTES, stripLeadingAgentSkillReferences, MAX_AGENT_HISTORY_IMAGES, MAX_AGENT_TEXT_BYTES } from './chunk-P3ZQ3QOJ.js';
2
+ import { WorkbenchPetProviderError, PendingRequestResolutionError } from './chunk-B2673ODM.js';
3
+ import { TEMPORARY_TASK_SCOPE_ID, MAX_AGENT_HISTORY_IMAGE_TOTAL_BYTES, isAgentFastModeAvailable, MAX_REALTIME_FILE_CHANGES, MAX_REALTIME_DIFF_BYTES, stripLeadingAgentSkillReferences, MAX_AGENT_HISTORY_IMAGES, MAX_AGENT_TEXT_BYTES } from './chunk-X5JZ3VOF.js';
4
4
  import { __commonJS, __require, __toESM } from './chunk-K6J42667.js';
5
5
  import { execFile, spawn } from 'child_process';
6
6
  import { constants, mkdtempSync, rmSync, createReadStream, mkdirSync, unlinkSync, renameSync, writeFileSync, openSync, readSync, closeSync, statSync } from 'fs';
7
- import { readFile, mkdir, writeFile, rename, rm, readdir, realpath, stat, access, lstat, opendir } from 'fs/promises';
7
+ import { readFile, mkdir, writeFile, rename, rm, readdir, realpath, stat, access, open, unlink, lstat, opendir } from 'fs/promises';
8
8
  import { createRequire as createRequire$1 } from 'module';
9
9
  import { resolve, basename, dirname, join, relative, sep, win32, posix, isAbsolute, extname } from 'path';
10
10
  import { promisify } from 'util';
11
11
  import { randomUUID, createHash } from 'crypto';
12
12
  import { Buffer as Buffer$1 } from 'buffer';
13
- import { tmpdir, homedir } from 'os';
13
+ import { homedir, tmpdir } from 'os';
14
14
  import { StringDecoder } from 'string_decoder';
15
15
  import { Worker } from 'worker_threads';
16
16
 
@@ -1250,7 +1250,7 @@ var require_sonic_boom = __commonJS({
1250
1250
  if (!(this instanceof SonicBoom)) {
1251
1251
  return new SonicBoom(opts);
1252
1252
  }
1253
- let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir: mkdir2, retryEAGAIN, fsync, contentMode, mode } = opts || {};
1253
+ let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir: mkdir3, retryEAGAIN, fsync, contentMode, mode } = opts || {};
1254
1254
  fd = fd || dest;
1255
1255
  this._len = 0;
1256
1256
  this.fd = -1;
@@ -1275,7 +1275,7 @@ var require_sonic_boom = __commonJS({
1275
1275
  this.append = append || false;
1276
1276
  this.mode = mode;
1277
1277
  this.retryEAGAIN = retryEAGAIN || (() => true);
1278
- this.mkdir = mkdir2 || false;
1278
+ this.mkdir = mkdir3 || false;
1279
1279
  let fsWriteSync;
1280
1280
  let fsWrite;
1281
1281
  if (contentMode === kContentModeBuffer) {
@@ -1983,7 +1983,7 @@ var require_thread_stream = __commonJS({
1983
1983
  var { version } = require_package();
1984
1984
  var { EventEmitter } = __require("events");
1985
1985
  var { Worker: Worker2 } = __require("worker_threads");
1986
- var { join: join6 } = __require("path");
1986
+ var { join: join7 } = __require("path");
1987
1987
  var { pathToFileURL } = __require("url");
1988
1988
  var { wait } = require_wait();
1989
1989
  var {
@@ -2034,7 +2034,7 @@ var require_thread_stream = __commonJS({
2034
2034
  function createWorker(stream, opts) {
2035
2035
  const { filename, workerData } = opts;
2036
2036
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
2037
- const toExecute = bundlerOverrides["thread-stream-worker"] || join6(__dirname, "lib", "worker.js");
2037
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join7(__dirname, "lib", "worker.js");
2038
2038
  const worker = new Worker2(toExecute, {
2039
2039
  ...opts.workerOpts,
2040
2040
  name: opts.workerOpts?.name || "thread-stream",
@@ -2501,7 +2501,7 @@ var require_transport = __commonJS({
2501
2501
  var { createRequire: createRequire2 } = __require("module");
2502
2502
  var { existsSync } = __require("fs");
2503
2503
  var getCallers = require_caller();
2504
- var { join: join6, isAbsolute: isAbsolute7, sep: sep3 } = __require("path");
2504
+ var { join: join7, isAbsolute: isAbsolute7, sep: sep3 } = __require("path");
2505
2505
  var { fileURLToPath } = __require("url");
2506
2506
  var sleep = require_atomic_sleep();
2507
2507
  var onExit = require_on_exit_leak_free();
@@ -2654,7 +2654,7 @@ var require_transport = __commonJS({
2654
2654
  throw new Error("only one of target or targets can be specified");
2655
2655
  }
2656
2656
  if (targets) {
2657
- target = bundlerOverrides["pino-worker"] || join6(__dirname, "worker.js");
2657
+ target = bundlerOverrides["pino-worker"] || join7(__dirname, "worker.js");
2658
2658
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
2659
2659
  return {
2660
2660
  ...dest,
@@ -2672,7 +2672,7 @@ var require_transport = __commonJS({
2672
2672
  });
2673
2673
  });
2674
2674
  } else if (pipeline) {
2675
- target = bundlerOverrides["pino-worker"] || join6(__dirname, "worker.js");
2675
+ target = bundlerOverrides["pino-worker"] || join7(__dirname, "worker.js");
2676
2676
  options.pipelines = [pipeline.map((dest) => {
2677
2677
  return {
2678
2678
  ...dest,
@@ -2695,7 +2695,7 @@ var require_transport = __commonJS({
2695
2695
  return origin;
2696
2696
  }
2697
2697
  if (origin === "pino/file") {
2698
- return join6(__dirname, "..", "file.js");
2698
+ return join7(__dirname, "..", "file.js");
2699
2699
  }
2700
2700
  let fixTarget2;
2701
2701
  for (const filePath of callers) {
@@ -3670,7 +3670,7 @@ var require_safe_stable_stringify = __commonJS({
3670
3670
  return circularValue;
3671
3671
  }
3672
3672
  let res = "";
3673
- let join6 = ",";
3673
+ let join7 = ",";
3674
3674
  const originalIndentation = indentation;
3675
3675
  if (Array.isArray(value)) {
3676
3676
  if (value.length === 0) {
@@ -3684,7 +3684,7 @@ var require_safe_stable_stringify = __commonJS({
3684
3684
  indentation += spacer;
3685
3685
  res += `
3686
3686
  ${indentation}`;
3687
- join6 = `,
3687
+ join7 = `,
3688
3688
  ${indentation}`;
3689
3689
  }
3690
3690
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -3692,13 +3692,13 @@ ${indentation}`;
3692
3692
  for (; i < maximumValuesToStringify - 1; i++) {
3693
3693
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
3694
3694
  res += tmp2 !== void 0 ? tmp2 : "null";
3695
- res += join6;
3695
+ res += join7;
3696
3696
  }
3697
3697
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
3698
3698
  res += tmp !== void 0 ? tmp : "null";
3699
3699
  if (value.length - 1 > maximumBreadth) {
3700
3700
  const removedKeys = value.length - maximumBreadth - 1;
3701
- res += `${join6}"... ${getItemCount(removedKeys)} not stringified"`;
3701
+ res += `${join7}"... ${getItemCount(removedKeys)} not stringified"`;
3702
3702
  }
3703
3703
  if (spacer !== "") {
3704
3704
  res += `
@@ -3719,7 +3719,7 @@ ${originalIndentation}`;
3719
3719
  let separator = "";
3720
3720
  if (spacer !== "") {
3721
3721
  indentation += spacer;
3722
- join6 = `,
3722
+ join7 = `,
3723
3723
  ${indentation}`;
3724
3724
  whitespace = " ";
3725
3725
  }
@@ -3733,13 +3733,13 @@ ${indentation}`;
3733
3733
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
3734
3734
  if (tmp !== void 0) {
3735
3735
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
3736
- separator = join6;
3736
+ separator = join7;
3737
3737
  }
3738
3738
  }
3739
3739
  if (keyLength > maximumBreadth) {
3740
3740
  const removedKeys = keyLength - maximumBreadth;
3741
3741
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
3742
- separator = join6;
3742
+ separator = join7;
3743
3743
  }
3744
3744
  if (spacer !== "" && separator.length > 1) {
3745
3745
  res = `
@@ -3780,7 +3780,7 @@ ${originalIndentation}`;
3780
3780
  }
3781
3781
  const originalIndentation = indentation;
3782
3782
  let res = "";
3783
- let join6 = ",";
3783
+ let join7 = ",";
3784
3784
  if (Array.isArray(value)) {
3785
3785
  if (value.length === 0) {
3786
3786
  return "[]";
@@ -3793,7 +3793,7 @@ ${originalIndentation}`;
3793
3793
  indentation += spacer;
3794
3794
  res += `
3795
3795
  ${indentation}`;
3796
- join6 = `,
3796
+ join7 = `,
3797
3797
  ${indentation}`;
3798
3798
  }
3799
3799
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -3801,13 +3801,13 @@ ${indentation}`;
3801
3801
  for (; i < maximumValuesToStringify - 1; i++) {
3802
3802
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
3803
3803
  res += tmp2 !== void 0 ? tmp2 : "null";
3804
- res += join6;
3804
+ res += join7;
3805
3805
  }
3806
3806
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
3807
3807
  res += tmp !== void 0 ? tmp : "null";
3808
3808
  if (value.length - 1 > maximumBreadth) {
3809
3809
  const removedKeys = value.length - maximumBreadth - 1;
3810
- res += `${join6}"... ${getItemCount(removedKeys)} not stringified"`;
3810
+ res += `${join7}"... ${getItemCount(removedKeys)} not stringified"`;
3811
3811
  }
3812
3812
  if (spacer !== "") {
3813
3813
  res += `
@@ -3820,7 +3820,7 @@ ${originalIndentation}`;
3820
3820
  let whitespace = "";
3821
3821
  if (spacer !== "") {
3822
3822
  indentation += spacer;
3823
- join6 = `,
3823
+ join7 = `,
3824
3824
  ${indentation}`;
3825
3825
  whitespace = " ";
3826
3826
  }
@@ -3829,7 +3829,7 @@ ${indentation}`;
3829
3829
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
3830
3830
  if (tmp !== void 0) {
3831
3831
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
3832
- separator = join6;
3832
+ separator = join7;
3833
3833
  }
3834
3834
  }
3835
3835
  if (spacer !== "" && separator.length > 1) {
@@ -3887,20 +3887,20 @@ ${originalIndentation}`;
3887
3887
  indentation += spacer;
3888
3888
  let res2 = `
3889
3889
  ${indentation}`;
3890
- const join7 = `,
3890
+ const join8 = `,
3891
3891
  ${indentation}`;
3892
3892
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
3893
3893
  let i = 0;
3894
3894
  for (; i < maximumValuesToStringify - 1; i++) {
3895
3895
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
3896
3896
  res2 += tmp2 !== void 0 ? tmp2 : "null";
3897
- res2 += join7;
3897
+ res2 += join8;
3898
3898
  }
3899
3899
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
3900
3900
  res2 += tmp !== void 0 ? tmp : "null";
3901
3901
  if (value.length - 1 > maximumBreadth) {
3902
3902
  const removedKeys = value.length - maximumBreadth - 1;
3903
- res2 += `${join7}"... ${getItemCount(removedKeys)} not stringified"`;
3903
+ res2 += `${join8}"... ${getItemCount(removedKeys)} not stringified"`;
3904
3904
  }
3905
3905
  res2 += `
3906
3906
  ${originalIndentation}`;
@@ -3916,16 +3916,16 @@ ${originalIndentation}`;
3916
3916
  return '"[Object]"';
3917
3917
  }
3918
3918
  indentation += spacer;
3919
- const join6 = `,
3919
+ const join7 = `,
3920
3920
  ${indentation}`;
3921
3921
  let res = "";
3922
3922
  let separator = "";
3923
3923
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
3924
3924
  if (isTypedArrayWithEntries(value)) {
3925
- res += stringifyTypedArray(value, join6, maximumBreadth);
3925
+ res += stringifyTypedArray(value, join7, maximumBreadth);
3926
3926
  keys = keys.slice(value.length);
3927
3927
  maximumPropertiesToStringify -= value.length;
3928
- separator = join6;
3928
+ separator = join7;
3929
3929
  }
3930
3930
  if (deterministic) {
3931
3931
  keys = sort(keys, comparator);
@@ -3936,13 +3936,13 @@ ${indentation}`;
3936
3936
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
3937
3937
  if (tmp !== void 0) {
3938
3938
  res += `${separator}${strEscape(key2)}: ${tmp}`;
3939
- separator = join6;
3939
+ separator = join7;
3940
3940
  }
3941
3941
  }
3942
3942
  if (keyLength > maximumBreadth) {
3943
3943
  const removedKeys = keyLength - maximumBreadth;
3944
3944
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
3945
- separator = join6;
3945
+ separator = join7;
3946
3946
  }
3947
3947
  if (separator !== "") {
3948
3948
  res = `
@@ -4466,8 +4466,8 @@ var require_pino = __commonJS({
4466
4466
  }
4467
4467
  });
4468
4468
  var execFileAsync = promisify(execFile);
4469
- var SUPPORTED_CODEX_VERSION = "0.153.4";
4470
- var SUPPORTED_CODEX_VERSION_RANGE = ">=0.153.4,<0.154.0";
4469
+ var SUPPORTED_CODEX_VERSION = "0.154.0";
4470
+ var SUPPORTED_CODEX_VERSION_RANGE = ">=0.154.0,<0.155.0";
4471
4471
  var BUNDLED_CODEX_TARGETS = {
4472
4472
  "darwin-arm64": {
4473
4473
  executableName: "codex",
@@ -4609,7 +4609,7 @@ async function checkCodexVersion(binaryPath, options = {}) {
4609
4609
  }
4610
4610
  const [major, minor, patch] = version.split("-", 1)[0]?.split(".").map(Number) ?? [];
4611
4611
  const isPrerelease = version.includes("-");
4612
- if (major !== 0 || minor !== 153 || patch === void 0 || patch < 4 || isPrerelease) {
4612
+ if (major !== 0 || minor !== 154 || patch === void 0 || isPrerelease) {
4613
4613
  throw new Error(
4614
4614
  `Unsupported Codex version ${version}; expected ${SUPPORTED_CODEX_VERSION_RANGE}`
4615
4615
  );
@@ -5145,10 +5145,10 @@ function fieldValueMatches(field, value) {
5145
5145
  function mcpElicitationContentMatchesRequest(request, content) {
5146
5146
  if (request.mode === "unsupported") return false;
5147
5147
  if (request.mode === "url") return Object.keys(content).length === 0;
5148
- const fields = new Map(request.fields.map((field) => [field.id, field]));
5148
+ const fields2 = new Map(request.fields.map((field) => [field.id, field]));
5149
5149
  const entries = Object.entries(content);
5150
5150
  return entries.every(([id, value]) => {
5151
- const field = fields.get(id);
5151
+ const field = fields2.get(id);
5152
5152
  return field !== void 0 && fieldValueMatches(field, value);
5153
5153
  }) && request.fields.every((field) => !field.required || Object.hasOwn(content, field.id));
5154
5154
  }
@@ -6193,25 +6193,24 @@ function mapUserMessageContent(value, mapImage, mapText) {
6193
6193
  }
6194
6194
  return { attachments, skills, text: textParts.join("\n") };
6195
6195
  }
6196
+ function mergeMessageSkills(message, incoming) {
6197
+ const skills = [...message.skills ?? []];
6198
+ const names = new Set(skills.map((skill) => skill.name));
6199
+ for (const skill of incoming) {
6200
+ if (!names.has(skill.name)) {
6201
+ names.add(skill.name);
6202
+ skills.push(skill);
6203
+ }
6204
+ }
6205
+ return { ...message, skills, text: stripLeadingAgentSkillReferences(message.text, skills) };
6206
+ }
6196
6207
  function mergeExpandedSkillMessages(items) {
6197
6208
  const mergedItems = [];
6198
6209
  for (const item of items) {
6199
- const isSkillOnlyMessage = item.type === "message" && item.role === "user" && item.text.length === 0 && (item.skills?.length ?? 0) > 0;
6210
+ const isSkillOnlyMessage = item.type === "message" && item.role === "user" && item.text.length === 0 && (item.attachments?.length ?? 0) === 0 && (item.skills?.length ?? 0) > 0;
6200
6211
  const previousItem = mergedItems.at(-1);
6201
6212
  if (isSkillOnlyMessage && previousItem?.type === "message" && previousItem.role === "user") {
6202
- const skillNames = new Set((previousItem.skills ?? []).map((skill) => skill.name));
6203
- const mergedSkills = [...previousItem.skills ?? []];
6204
- for (const skill of item.skills ?? []) {
6205
- if (!skillNames.has(skill.name)) {
6206
- skillNames.add(skill.name);
6207
- mergedSkills.push(skill);
6208
- }
6209
- }
6210
- mergedItems[mergedItems.length - 1] = {
6211
- ...previousItem,
6212
- skills: mergedSkills,
6213
- text: stripLeadingAgentSkillReferences(previousItem.text, mergedSkills)
6214
- };
6213
+ mergedItems[mergedItems.length - 1] = mergeMessageSkills(previousItem, item.skills ?? []);
6215
6214
  continue;
6216
6215
  }
6217
6216
  mergedItems.push(item);
@@ -6528,10 +6527,10 @@ function normalizedTitle(thread) {
6528
6527
  var CODEX_PINNED_THREAD_SECTION_ID = "01984de2-8f74-7c91-a3b2-5c5e937cf318";
6529
6528
  function isPinnedThreadSection(value) {
6530
6529
  if (value === null) return false;
6531
- const section = expectRecord(value, "Codex thread section");
6532
- const sectionId = expectString(section["id"], "Codex thread section id");
6533
- expectString(section["name"], "Codex thread section name");
6534
- const appearance = section["appearance"];
6530
+ const section2 = expectRecord(value, "Codex thread section");
6531
+ const sectionId = expectString(section2["id"], "Codex thread section id");
6532
+ expectString(section2["name"], "Codex thread section name");
6533
+ const appearance = section2["appearance"];
6535
6534
  if (appearance !== null && (!isRecord(appearance) || appearance["icon"] !== null && typeof appearance["icon"] !== "string" || appearance["color"] !== null && typeof appearance["color"] !== "string")) {
6536
6535
  throw new CodexProtocolMappingError("Codex thread section appearance is invalid");
6537
6536
  }
@@ -7477,7 +7476,7 @@ var RpcPendingRequest = class {
7477
7476
  };
7478
7477
 
7479
7478
  // packages/provider-codex/src/jsonl-rpc-client.ts
7480
- var DEFAULT_MAX_JSONL_BYTES = 64 * 1024 * 1024;
7479
+ var DEFAULT_MAX_JSONL_BYTES = 80 * 1024 * 1024;
7481
7480
  var DEFAULT_LARGE_FRAME_THRESHOLD_BYTES = 1 * 1024 * 1024;
7482
7481
  var JsonlRpcClient = class {
7483
7482
  #defaultTimeoutMs;
@@ -8656,6 +8655,10 @@ async function listCodexMcpServers(client, taskId) {
8656
8655
  const serverInfoValue = server["serverInfo"];
8657
8656
  const serverInfo = serverInfoValue === null || serverInfoValue === void 0 ? null : expectRecord(serverInfoValue, "mcpServerStatus/list serverInfo");
8658
8657
  const tools = expectRecord(server["tools"], "mcpServerStatus/list tools");
8658
+ const toolsError = server["toolsError"];
8659
+ if (toolsError !== null && typeof toolsError !== "string") {
8660
+ throw new CodexProtocolMappingError("mcpServerStatus/list toolsError is invalid");
8661
+ }
8659
8662
  const authStatus = mapMcpAuthStatus(server["authStatus"]);
8660
8663
  let displayName = name;
8661
8664
  if (serverInfo !== null) {
@@ -8669,10 +8672,12 @@ async function listCodexMcpServers(client, taskId) {
8669
8672
  if (servers.has(name)) {
8670
8673
  continue;
8671
8674
  }
8675
+ const runtimeStatus = mapMcpRuntimeStatus(server["runtimeStatus"], authStatus);
8676
+ const status = toolsError !== null && (runtimeStatus === "connected" || runtimeStatus === "unknown") ? "failed" : runtimeStatus;
8672
8677
  servers.set(name, {
8673
8678
  displayName,
8674
8679
  name,
8675
- status: mapMcpRuntimeStatus(server["runtimeStatus"], authStatus),
8680
+ status,
8676
8681
  toolCount: Object.keys(tools).length
8677
8682
  });
8678
8683
  }
@@ -8700,8 +8705,292 @@ async function reloadCodexMcpServers(client, taskId) {
8700
8705
  return listCodexMcpServers(client, taskId);
8701
8706
  }
8702
8707
 
8708
+ // packages/provider-codex/src/message-identity-matching.ts
8709
+ function matchesMessageIdentity(current, incoming) {
8710
+ if (current.role !== incoming.role) return false;
8711
+ if (current.phase !== void 0 && incoming.phase !== void 0 && current.phase !== incoming.phase)
8712
+ return false;
8713
+ if (current.text.length > 0 && incoming.text.length > 0) {
8714
+ return current.text.startsWith(incoming.text) || incoming.text.startsWith(current.text);
8715
+ }
8716
+ if (current.role !== "user" || current.text.length > 0 || incoming.text.length > 0) return false;
8717
+ const attachments = current.attachments ?? [];
8718
+ const other = incoming.attachments ?? [];
8719
+ return attachments.length > 0 && attachments.length === other.length && attachments.every(
8720
+ (item, index) => item.kind === "image" && other[index]?.kind === "image" && item.mediaType === other[index].mediaType && item.size === other[index].size
8721
+ );
8722
+ }
8723
+
8724
+ // packages/provider-codex/src/message-identity.ts
8725
+ var MAX_TURNS = 128;
8726
+ var MAX_MESSAGES = 256;
8727
+ var MAX_TEXT = 16384;
8728
+ var MAX_RETAINED_TEXT = 1048576;
8729
+ var MessageIdentityRegistry = class {
8730
+ #turns = /* @__PURE__ */ new Map();
8731
+ #textSize = 0;
8732
+ #order = 0;
8733
+ turn(taskId, turnId) {
8734
+ const key = JSON.stringify([taskId, turnId]);
8735
+ const value = this.#turns.get(key) ?? {
8736
+ taskId,
8737
+ entries: /* @__PURE__ */ new Map(),
8738
+ running: false
8739
+ };
8740
+ this.#turns.delete(key);
8741
+ this.#turns.set(key, value);
8742
+ if (this.#turns.size > MAX_TURNS) {
8743
+ const oldest = [...this.#turns].find(([candidateKey, turn]) => candidateKey !== key && !turn.running) ?? this.#turns.entries().next().value;
8744
+ if (oldest !== void 0) {
8745
+ this.release(oldest[1]);
8746
+ this.#turns.delete(oldest[0]);
8747
+ }
8748
+ }
8749
+ return value;
8750
+ }
8751
+ find(turn, id) {
8752
+ return turn.entries.get(id) ?? [...turn.entries.values()].find((entry) => entry.aliases.has(id));
8753
+ }
8754
+ remember(turn, item, live, snapshot) {
8755
+ let entry = this.find(turn, item.id);
8756
+ if (entry === void 0) {
8757
+ if (turn.entries.size >= MAX_MESSAGES) return void 0;
8758
+ entry = {
8759
+ message: { id: item.id, type: "message", role: item.role, text: "" },
8760
+ aliases: /* @__PURE__ */ new Set(),
8761
+ live: false,
8762
+ snapshot: false,
8763
+ comparable: true,
8764
+ order: this.#order++
8765
+ };
8766
+ turn.entries.set(item.id, entry);
8767
+ }
8768
+ this.#textSize -= entry.message.text.length;
8769
+ entry.comparable = item.text.length <= MAX_TEXT && this.#textSize + item.text.length <= MAX_RETAINED_TEXT;
8770
+ const phase = item.phase ?? entry.message.phase;
8771
+ entry.message = {
8772
+ id: entry.message.id,
8773
+ type: "message",
8774
+ role: item.role,
8775
+ text: entry.comparable ? item.text : "",
8776
+ ...phase === void 0 ? {} : { phase },
8777
+ ...item.attachments === void 0 ? {} : { attachments: item.attachments }
8778
+ };
8779
+ this.#textSize += entry.message.text.length;
8780
+ entry.live ||= live;
8781
+ entry.snapshot ||= snapshot;
8782
+ return entry;
8783
+ }
8784
+ alias(entry, id) {
8785
+ if (entry.message.id === id || entry.aliases.has(id)) return true;
8786
+ if (entry.aliases.size >= 256) return false;
8787
+ entry.aliases.add(id);
8788
+ return true;
8789
+ }
8790
+ render(item, entry) {
8791
+ return {
8792
+ ...item,
8793
+ id: entry.message.id,
8794
+ ...entry.aliases.size === 0 ? {} : { identityAliases: [...entry.aliases] }
8795
+ };
8796
+ }
8797
+ snapshot(taskId, turns) {
8798
+ return turns.map((turn) => {
8799
+ const messages = turn.items.filter(
8800
+ (item) => item.type === "message"
8801
+ );
8802
+ if (messages.length === 0) return turn;
8803
+ const state = this.turn(taskId, turn.id);
8804
+ state.running = turn.status === "running";
8805
+ const matches = /* @__PURE__ */ new Map();
8806
+ const used = /* @__PURE__ */ new Set();
8807
+ for (const item of messages) {
8808
+ const known = this.find(state, item.id);
8809
+ if (known !== void 0) {
8810
+ matches.set(item.id, known);
8811
+ used.add(known);
8812
+ }
8813
+ }
8814
+ const candidates = /* @__PURE__ */ new Map();
8815
+ const counts = /* @__PURE__ */ new Map();
8816
+ for (const item of messages) {
8817
+ if (matches.has(item.id)) continue;
8818
+ const options = [...state.entries.values()].filter(
8819
+ (entry) => entry.live && entry.comparable && !used.has(entry) && matchesMessageIdentity(entry.message, item)
8820
+ );
8821
+ candidates.set(item.id, options);
8822
+ for (const entry of options) counts.set(entry, (counts.get(entry) ?? 0) + 1);
8823
+ }
8824
+ for (const [id, options] of candidates) {
8825
+ const entry = options.length === 1 ? options[0] : void 0;
8826
+ if (entry !== void 0 && counts.get(entry) === 1 && this.alias(entry, id))
8827
+ matches.set(id, entry);
8828
+ }
8829
+ return {
8830
+ ...turn,
8831
+ items: turn.items.map((item) => {
8832
+ if (item.type !== "message") return item;
8833
+ const entry = matches.get(item.id);
8834
+ const normalized = entry === void 0 ? item : this.render(item, entry);
8835
+ this.remember(state, normalized, false, true);
8836
+ return normalized;
8837
+ })
8838
+ };
8839
+ });
8840
+ }
8841
+ event(event) {
8842
+ if (event.type === "turn.started" || event.type === "turn.completed") {
8843
+ const items = event.payload.turn.items.map(
8844
+ (item) => item.type === "message" ? this.completed(event.taskId, event.turnId, item, event.payload.turn.items) : item
8845
+ );
8846
+ this.turn(event.taskId, event.turnId).running = event.type === "turn.started";
8847
+ return { ...event, payload: { ...event.payload, turn: { ...event.payload.turn, items } } };
8848
+ }
8849
+ if (event.type === "item.started" || event.type === "item.completed") {
8850
+ if (event.payload.item.type !== "message") return event;
8851
+ const item = this.completed(event.taskId, event.turnId, event.payload.item);
8852
+ return { ...event, itemId: item.id, payload: { item } };
8853
+ }
8854
+ if (event.type !== "message.delta") return event;
8855
+ const state = this.turn(event.taskId, event.turnId);
8856
+ state.running = true;
8857
+ const entry = this.find(state, event.itemId);
8858
+ const id = entry?.message.id ?? event.itemId;
8859
+ if (entry?.comparable !== false)
8860
+ this.remember(
8861
+ state,
8862
+ {
8863
+ id,
8864
+ type: "message",
8865
+ role: "assistant",
8866
+ text: (entry?.message.text ?? "") + event.payload.delta
8867
+ },
8868
+ true,
8869
+ false
8870
+ );
8871
+ return id === event.itemId ? event : { ...event, itemId: id };
8872
+ }
8873
+ completed(taskId, turnId, item, batch = [item]) {
8874
+ const state = this.turn(taskId, turnId);
8875
+ let entry = this.find(state, item.id);
8876
+ if (entry?.snapshot !== true) {
8877
+ const candidates = [...state.entries.values()].filter(
8878
+ (candidate2) => candidate2 !== entry && candidate2.snapshot && !candidate2.live && candidate2.comparable && matchesMessageIdentity(candidate2.message, item) && // 批量终态也要求反向唯一;其他消息已占用或同样匹配时禁止贪心归并。
8879
+ !batch.some(
8880
+ (other) => other.type === "message" && other.id !== item.id && (this.find(state, other.id) === candidate2 || matchesMessageIdentity(candidate2.message, other))
8881
+ )
8882
+ );
8883
+ const candidate = candidates.length === 1 ? candidates[0] : void 0;
8884
+ if (candidate !== void 0) {
8885
+ const keep = entry !== void 0 && entry.order < candidate.order ? entry : candidate;
8886
+ const remove = keep === entry ? candidate : entry;
8887
+ const aliases = /* @__PURE__ */ new Set([
8888
+ ...keep.aliases,
8889
+ item.id,
8890
+ ...remove === void 0 ? [] : [remove.message.id, ...remove.aliases]
8891
+ ]);
8892
+ aliases.delete(keep.message.id);
8893
+ if (aliases.size <= 256) {
8894
+ keep.aliases = aliases;
8895
+ keep.snapshot = true;
8896
+ if (remove !== void 0) {
8897
+ state.entries.delete(remove.message.id);
8898
+ this.#textSize -= remove.message.text.length;
8899
+ }
8900
+ entry = keep;
8901
+ }
8902
+ }
8903
+ }
8904
+ const normalized = entry === void 0 ? item : this.render(item, entry);
8905
+ this.remember(state, normalized, true, false);
8906
+ return normalized;
8907
+ }
8908
+ release(turn) {
8909
+ for (const entry of turn.entries.values()) this.#textSize -= entry.message.text.length;
8910
+ }
8911
+ clearTask(taskId) {
8912
+ for (const [key, turn] of this.#turns)
8913
+ if (turn.taskId === taskId) {
8914
+ this.release(turn);
8915
+ this.#turns.delete(key);
8916
+ }
8917
+ }
8918
+ clear() {
8919
+ this.#turns.clear();
8920
+ this.#textSize = 0;
8921
+ }
8922
+ };
8923
+
8924
+ // packages/provider-codex/src/realtime-skill-messages.ts
8925
+ var RealtimeSkillMessages = class {
8926
+ #tails = /* @__PURE__ */ new Map();
8927
+ #size = 0;
8928
+ key(taskId, turnId) {
8929
+ return JSON.stringify([taskId, turnId]);
8930
+ }
8931
+ remove(key) {
8932
+ this.#size -= this.#tails.get(key)?.size ?? 0;
8933
+ this.#tails.delete(key);
8934
+ }
8935
+ remember(taskId, turnId, item) {
8936
+ const key = this.key(taskId, turnId);
8937
+ this.remove(key);
8938
+ let retained = item?.type === "message" && item.role === "user" ? item : void 0;
8939
+ let size = retained === void 0 ? 0 : JSON.stringify(retained).length;
8940
+ if (size > 65536) {
8941
+ retained = void 0;
8942
+ size = 0;
8943
+ }
8944
+ this.#tails.set(key, { taskId, item: retained, size });
8945
+ this.#size += size;
8946
+ while (this.#tails.size > 128 || this.#size > 1048576) {
8947
+ const oldest = this.#tails.keys().next().value;
8948
+ if (oldest === void 0) break;
8949
+ this.remove(oldest);
8950
+ }
8951
+ }
8952
+ seed(taskId, turns) {
8953
+ for (const turn of turns) {
8954
+ if (turn.status === "running" && !this.#tails.has(this.key(taskId, turn.id)))
8955
+ this.remember(taskId, turn.id, turn.items.at(-1));
8956
+ }
8957
+ }
8958
+ event(event) {
8959
+ if (event.type === "turn.started") {
8960
+ this.remember(event.taskId, event.turnId, event.payload.turn.items.at(-1));
8961
+ return event;
8962
+ }
8963
+ if (event.type === "turn.completed") {
8964
+ this.remove(this.key(event.taskId, event.turnId));
8965
+ return event;
8966
+ }
8967
+ if (event.type === "message.delta") {
8968
+ this.remember(event.taskId, event.turnId, void 0);
8969
+ return event;
8970
+ }
8971
+ if (event.type !== "item.started" && event.type !== "item.completed") return event;
8972
+ const incoming = event.payload.item;
8973
+ const previous = this.#tails.get(this.key(event.taskId, event.turnId))?.item;
8974
+ const [first, second] = previous === void 0 ? [incoming] : mergeExpandedSkillMessages([previous, incoming]);
8975
+ let item = second ?? first ?? incoming;
8976
+ if (second !== void 0 && previous?.type === "message" && incoming.type === "message" && previous.id === incoming.id && incoming.role === "user" && previous.skills !== void 0)
8977
+ item = mergeMessageSkills(incoming, previous.skills);
8978
+ this.remember(event.taskId, event.turnId, item);
8979
+ return item === incoming ? event : { ...event, itemId: item.id, payload: { item } };
8980
+ }
8981
+ clearTask(taskId) {
8982
+ for (const [key, tail] of this.#tails) if (tail.taskId === taskId) this.remove(key);
8983
+ }
8984
+ clear() {
8985
+ this.#tails.clear();
8986
+ this.#size = 0;
8987
+ }
8988
+ };
8989
+
8703
8990
  // packages/provider-codex/src/task-runtime-state.ts
8704
8991
  var TaskRuntimeState = class {
8992
+ messageIdentities = new MessageIdentityRegistry();
8993
+ skillMessages = new RealtimeSkillMessages();
8705
8994
  activeReviewTargets = /* @__PURE__ */ new Map();
8706
8995
  activeReviewTurnIds = /* @__PURE__ */ new Map();
8707
8996
  activeReviewWorkerTaskIds = /* @__PURE__ */ new Set();
@@ -8739,6 +9028,8 @@ var TaskRuntimeState = class {
8739
9028
  return this.runningTaskIds.has(taskId) || this.pendingTaskReads.has(taskId) || this.resumePromises.has(taskId) || (this.pendingTaskServerRequests.get(taskId)?.length ?? 0) > 0 || hasPendingRequest;
8740
9029
  }
8741
9030
  clearTask(taskId) {
9031
+ this.messageIdentities.clearTask(taskId);
9032
+ this.skillMessages.clearTask(taskId);
8742
9033
  this.activeReviewTargets.delete(taskId);
8743
9034
  this.activeReviewTurnIds.delete(taskId);
8744
9035
  this.activeReviewWorkerTaskIds.delete(taskId);
@@ -8765,6 +9056,8 @@ var TaskRuntimeState = class {
8765
9056
  this.unmaterializedTasks.delete(taskId);
8766
9057
  }
8767
9058
  clear() {
9059
+ this.messageIdentities.clear();
9060
+ this.skillMessages.clear();
8768
9061
  this.activeReviewTargets.clear();
8769
9062
  this.activeReviewTurnIds.clear();
8770
9063
  this.activeReviewWorkerTaskIds.clear();
@@ -9129,6 +9422,7 @@ function createUnmaterializedTaskSnapshot(task) {
9129
9422
  }
9130
9423
  var CodexAgentProviderBase = class {
9131
9424
  client;
9425
+ taskTitles;
9132
9426
  eventListenersIncludingEphemeral = /* @__PURE__ */ new Set();
9133
9427
  eventListeners = /* @__PURE__ */ new Set();
9134
9428
  historicalAttachments = new CodexHistoricalAttachmentStore();
@@ -9169,6 +9463,7 @@ var CodexAgentProviderBase = class {
9169
9463
  }
9170
9464
  constructor(client, project, options = {}) {
9171
9465
  this.client = client;
9466
+ this.taskTitles = options.taskTitles;
9172
9467
  this.logger = options.logger ?? DEFAULT_PROVIDER_LOGGER;
9173
9468
  this.project = project;
9174
9469
  this.pendingLifecycle = new PendingRequestLifecycle({
@@ -9205,6 +9500,7 @@ var CodexAgentProviderBase = class {
9205
9500
  });
9206
9501
  }
9207
9502
  async releaseProject() {
9503
+ await this.taskTitles?.releaseProject(this.project.id);
9208
9504
  await releaseCodexProjectThreads(this.client, this.logger, this.project.id, [
9209
9505
  ...this.runtime.projectTaskIds
9210
9506
  ]);
@@ -9272,10 +9568,14 @@ var CodexAgentProviderBase = class {
9272
9568
  }
9273
9569
  async renameTask(taskId, title) {
9274
9570
  this.assertKnownProjectTask(taskId);
9275
- expectRecord(
9276
- await this.client.request("thread/name/set", { name: title, threadId: taskId }),
9277
- "thread/name/set response"
9278
- );
9571
+ const rename3 = async () => {
9572
+ expectRecord(
9573
+ await this.client.request("thread/name/set", { name: title, threadId: taskId }),
9574
+ "thread/name/set response"
9575
+ );
9576
+ };
9577
+ if (this.taskTitles === void 0) await rename3();
9578
+ else await this.taskTitles.mutate(taskId, rename3);
9279
9579
  }
9280
9580
  async pinTask(taskId, pinned) {
9281
9581
  this.assertKnownProjectTask(taskId);
@@ -9446,12 +9746,19 @@ var CodexAgentProviderQueue = class extends CodexAgentProviderBase {
9446
9746
  }
9447
9747
  return { name: skill.name, path: skill.path, type: "skill" };
9448
9748
  });
9449
- const images = input.images.map((image) => {
9450
- if (image.path.length === 0) {
9451
- throw new CodexProtocolMappingError("Provider image path must not be empty");
9452
- }
9453
- return { detail: image.detail, path: image.path, type: "localImage" };
9454
- });
9749
+ const images = await Promise.all(
9750
+ input.images.map(async (image) => {
9751
+ if (image.path.length === 0) {
9752
+ throw new CodexProtocolMappingError("Provider image path must not be empty");
9753
+ }
9754
+ const content = await readFile(image.path);
9755
+ return {
9756
+ detail: image.detail,
9757
+ type: "image",
9758
+ url: `data:${image.mediaType};base64,${content.toString("base64")}`
9759
+ };
9760
+ })
9761
+ );
9455
9762
  const files = input.files.map(createCodexFileTextInput);
9456
9763
  const textAttachments = input.textAttachments.map((attachment) => ({
9457
9764
  text: attachment.text,
@@ -9642,6 +9949,10 @@ var CodexAgentProviderTurns = class extends CodexAgentProviderQueue {
9642
9949
  this.runtime.ephemeralTaskIds.add(task.id);
9643
9950
  } else {
9644
9951
  this.runtime.unmaterializedTasks.set(task.id, task);
9952
+ const thread = expectRecord(response["thread"], "thread/start thread");
9953
+ if (typeof thread["name"] !== "string" || !thread["name"].trim()) {
9954
+ this.taskTitles?.register(task.id, this.project, expectString(thread["cwd"], "thread cwd"));
9955
+ }
9645
9956
  }
9646
9957
  return task;
9647
9958
  }
@@ -9697,7 +10008,9 @@ var CodexAgentProviderTurns = class extends CodexAgentProviderQueue {
9697
10008
  }, 3e4);
9698
10009
  timeout.unref();
9699
10010
  });
9700
- return await Promise.race([startedTurn, timeoutTurn]);
10011
+ const turn2 = await Promise.race([startedTurn, timeoutTurn]);
10012
+ this.taskTitles?.start(taskId, input);
10013
+ return turn2;
9701
10014
  } finally {
9702
10015
  this.eventListeners.delete(listener);
9703
10016
  if (timeout !== void 0) {
@@ -9724,7 +10037,10 @@ var CodexAgentProviderTurns = class extends CodexAgentProviderQueue {
9724
10037
  if (turn.status === "running") {
9725
10038
  this.runtime.runningTaskIds.add(taskId);
9726
10039
  }
9727
- return turn;
10040
+ const normalized = this.runtime.messageIdentities.snapshot(taskId, [turn])[0] ?? turn;
10041
+ this.runtime.skillMessages.seed(taskId, [normalized]);
10042
+ this.taskTitles?.start(taskId, input);
10043
+ return normalized;
9728
10044
  }
9729
10045
  async readGoalResponse(taskId) {
9730
10046
  const response = expectRecord(
@@ -9806,7 +10122,9 @@ var CodexAgentProviderTurns = class extends CodexAgentProviderQueue {
9806
10122
  this.runtime.activeReviewWorkerTaskIds.delete(taskId);
9807
10123
  this.runtime.reviewWorkerOutputTaskIds.delete(taskId);
9808
10124
  }
9809
- return turn;
10125
+ const normalized = this.runtime.messageIdentities.snapshot(taskId, [turn])[0] ?? turn;
10126
+ this.runtime.skillMessages.seed(taskId, [normalized]);
10127
+ return normalized;
9810
10128
  }
9811
10129
  async interruptTurn(taskId, turnId) {
9812
10130
  this.assertKnownProjectTask(taskId);
@@ -10202,12 +10520,16 @@ var CodexAgentProviderTasks = class extends CodexAgentProviderTurns {
10202
10520
  cursor.reviewCursor
10203
10521
  );
10204
10522
  const transcriptSkillsByTurnId = await readCodexTranscriptTurnSkills(taskId);
10205
- const turns = mapAgentTurns(
10206
- reviewPage.turns,
10207
- (part, imageIndex) => this.mapMessageImage(taskId, part, imageIndex),
10208
- (input2, textIndex) => this.mapMessageText(taskId, input2, textIndex)
10209
- ).map((turn) => attachTranscriptSkills(turn, transcriptSkillsByTurnId.get(turn.id) ?? []));
10523
+ const turns = this.runtime.messageIdentities.snapshot(
10524
+ taskId,
10525
+ mapAgentTurns(
10526
+ reviewPage.turns,
10527
+ (part, imageIndex) => this.mapMessageImage(taskId, part, imageIndex),
10528
+ (input2, textIndex) => this.mapMessageText(taskId, input2, textIndex)
10529
+ ).map((turn) => attachTranscriptSkills(turn, transcriptSkillsByTurnId.get(turn.id) ?? []))
10530
+ );
10210
10531
  const status = turns.some((turn) => turn.status === "running") ? "running" : mapThreadStatus(thread["status"]);
10532
+ this.runtime.skillMessages.seed(taskId, turns);
10211
10533
  const runningReviewTurn = turns.findLast(
10212
10534
  (turn) => turn.status === "running" && turn.items.some((item) => item.type === "review")
10213
10535
  );
@@ -10524,6 +10846,7 @@ var CodexAgentProviderEvents = class extends CodexAgentProviderTasks {
10524
10846
  return this.runtime.hasLifecycleObligations(taskId, this.pendingLifecycle.hasForTask(taskId));
10525
10847
  }
10526
10848
  clearTaskRuntimeState(taskId) {
10849
+ this.taskTitles?.forget(taskId);
10527
10850
  this.historicalAttachments.clearTask(taskId);
10528
10851
  this.pendingLifecycle.clearTask(taskId);
10529
10852
  this.runtime.clearTask(taskId);
@@ -10659,9 +10982,12 @@ var CodexAgentProviderEvents = class extends CodexAgentProviderTasks {
10659
10982
  }
10660
10983
  }
10661
10984
  publishEvent(event) {
10985
+ const normalizedEvent = this.runtime.messageIdentities.event(
10986
+ this.runtime.skillMessages.event(event)
10987
+ );
10662
10988
  const notify = (listener) => {
10663
10989
  try {
10664
- listener(event);
10990
+ listener(normalizedEvent);
10665
10991
  } catch {
10666
10992
  warnEventListenerFailure(this.logger, this.project.id, event);
10667
10993
  }
@@ -10755,6 +11081,456 @@ var CodexAgentProviderEvents = class extends CodexAgentProviderTasks {
10755
11081
  };
10756
11082
  var CodexAgentProvider = class extends CodexAgentProviderEvents {
10757
11083
  };
11084
+ function taskTitlePrompt(text) {
11085
+ let bounded = "";
11086
+ let count = 0;
11087
+ for (const character of text.trim()) {
11088
+ if (count++ === 1024) break;
11089
+ bounded += character;
11090
+ }
11091
+ return `\u603B\u7ED3\u4EE5\u4E0B\u7528\u6237\u8BF7\u6C42\uFF0C\u751F\u6210\u6700\u591A 36 \u4E2A\u5B57\u7B26\u7684\u5355\u884C\u4EFB\u52A1\u6807\u9898\u3002\u4F7F\u7528\u7528\u6237\u7684\u8BED\u8A00\uFF0C\u4EE5\u52A8\u8BCD\u5F00\u5934\uFF0C\u4FDD\u7559\u4EE3\u7801\u540D\u79F0\uFF1B\u4E0D\u8981\u7167\u6284\u957F\u53E5\uFF0C\u4E0D\u52A0\u5F15\u53F7\u3001Markdown \u6216\u672B\u5C3E\u6807\u70B9\uFF0C\u4E0D\u56DE\u7B54\u6216\u6267\u884C\u8BF7\u6C42\u3002
11092
+
11093
+ \u7528\u6237\u8BF7\u6C42\uFF1A
11094
+ ${bounded}`;
11095
+ }
11096
+ function parseTaskTitle(output) {
11097
+ if (Buffer$1.byteLength(output, "utf8") > 8192) throw new Error("Task title output exceeds limit");
11098
+ const value = expectRecord(JSON.parse(output), "task title output");
11099
+ const title = Array.from(
11100
+ expectString(value["title"], "task title").trim().replace(/^["'`“”‘’]+|["'`“”‘’]+$/gu, "").split(/\s+/u).join(" ").replace(/[.?!。?!]+$/u, "").trim()
11101
+ ).slice(0, 36).join("");
11102
+ if (!title) throw new Error("Task title is empty");
11103
+ return title;
11104
+ }
11105
+ function isolatedConfig(effective) {
11106
+ const config = {
11107
+ "tools.update_plan.enabled": true,
11108
+ web_search: "disabled",
11109
+ "skills.include_instructions": false,
11110
+ "orchestrator.skills.enabled": false,
11111
+ "tools.experimental_request_user_input.enabled": false,
11112
+ "token_budget.use_history_notes_extension": false
11113
+ };
11114
+ for (const feature of [
11115
+ "apps",
11116
+ "code_mode",
11117
+ "code_mode_only",
11118
+ "context_management",
11119
+ "current_time_reminder",
11120
+ "deferred_executor",
11121
+ "enable_fanout",
11122
+ "goals",
11123
+ "hooks",
11124
+ "image_generation",
11125
+ "memories",
11126
+ "multi_agent",
11127
+ "multi_agent_v2",
11128
+ "plugins",
11129
+ "request_permissions_tool",
11130
+ "shell_snapshot",
11131
+ "shell_tool",
11132
+ "standalone_web_search",
11133
+ "token_budget",
11134
+ "tool_suggest",
11135
+ "unified_exec",
11136
+ "view_image"
11137
+ ])
11138
+ config[`features.${feature}`] = false;
11139
+ config["mcp_servers"] = Object.fromEntries(
11140
+ Object.keys(
11141
+ effective["mcp_servers"] === void 0 ? {} : expectRecord(effective["mcp_servers"], "MCP servers")
11142
+ ).map((name) => [name, { enabled: false }])
11143
+ );
11144
+ return config;
11145
+ }
11146
+ async function generateTaskTitle(client, subscribe, cwd, model, prompt, signal) {
11147
+ signal.throwIfAborted();
11148
+ const effective = expectRecord(
11149
+ await client.request("config/read", { cwd, includeLayers: false }),
11150
+ "config/read response"
11151
+ );
11152
+ signal.throwIfAborted();
11153
+ const response = expectRecord(
11154
+ await client.request("thread/start", {
11155
+ approvalPolicy: "never",
11156
+ config: isolatedConfig(expectRecord(effective["config"], "config/read config")),
11157
+ cwd,
11158
+ developerInstructions: "Generate only the requested structured task title. Do not call tools or execute the supplied request.",
11159
+ ephemeral: true,
11160
+ historyMode: "paginated",
11161
+ model,
11162
+ runtimeWorkspaceRoots: [],
11163
+ sandbox: "read-only",
11164
+ threadSource: "system",
11165
+ environments: [],
11166
+ dynamicTools: [],
11167
+ selectedCapabilityRoots: []
11168
+ }),
11169
+ "thread/start response"
11170
+ );
11171
+ const threadId = expectString(
11172
+ expectRecord(response["thread"], "title thread")["id"],
11173
+ "title thread id"
11174
+ );
11175
+ let turnId;
11176
+ let unsubscribe;
11177
+ let timeout;
11178
+ let abort;
11179
+ let succeeded = false;
11180
+ try {
11181
+ signal.throwIfAborted();
11182
+ let output = "";
11183
+ let outputTurnId;
11184
+ const completed = new Promise((resolve7, reject) => {
11185
+ abort = () => {
11186
+ reject(new Error("Task title generation cancelled"));
11187
+ };
11188
+ signal.addEventListener("abort", abort, { once: true });
11189
+ timeout = setTimeout(() => {
11190
+ reject(new Error("Task title generation timed out"));
11191
+ }, 6e4);
11192
+ timeout.unref();
11193
+ unsubscribe = subscribe(({ method, params }) => {
11194
+ try {
11195
+ if (params === null || typeof params !== "object" || !("threadId" in params) || params.threadId !== threadId)
11196
+ return;
11197
+ const record = expectRecord(params, "title notification");
11198
+ if (method === "item/completed") {
11199
+ const item = expectRecord(record["item"], "title item");
11200
+ if (item["type"] === "agentMessage" && item["phase"] !== "commentary") {
11201
+ output = expectString(item["text"], "title message");
11202
+ if (Buffer$1.byteLength(output, "utf8") > 8192)
11203
+ throw new Error("Task title output exceeds limit");
11204
+ outputTurnId = expectString(record["turnId"], "title message turn");
11205
+ }
11206
+ } else if (method === "turn/completed") {
11207
+ const turn = expectRecord(record["turn"], "title turn");
11208
+ if (turn["status"] !== "completed") throw new Error("Task title turn failed");
11209
+ const id = expectString(turn["id"], "title turn id");
11210
+ if (outputTurnId !== id) throw new Error("Task title output is missing");
11211
+ resolve7({ id, output });
11212
+ } else if (method === "error" && record["willRetry"] !== true) {
11213
+ throw new Error("Task title provider failed");
11214
+ }
11215
+ } catch (error) {
11216
+ reject(error instanceof Error ? error : new Error("Invalid task title notification"));
11217
+ }
11218
+ });
11219
+ });
11220
+ void completed.catch(() => void 0);
11221
+ const started = expectRecord(
11222
+ await client.request("turn/start", {
11223
+ threadId,
11224
+ input: [{ type: "text", text: prompt, text_elements: [] }],
11225
+ outputSchema: {
11226
+ type: "object",
11227
+ additionalProperties: false,
11228
+ required: ["title"],
11229
+ properties: { title: { type: "string", minLength: 1, maxLength: 36 } }
11230
+ }
11231
+ }),
11232
+ "turn/start response"
11233
+ );
11234
+ turnId = expectString(
11235
+ expectRecord(started["turn"], "started title turn")["id"],
11236
+ "started title turn id"
11237
+ );
11238
+ const result = await completed;
11239
+ signal.throwIfAborted();
11240
+ if (result.id !== turnId) throw new Error("Task title turn identity mismatch");
11241
+ const title = parseTaskTitle(result.output);
11242
+ succeeded = true;
11243
+ return title;
11244
+ } finally {
11245
+ if (timeout !== void 0) clearTimeout(timeout);
11246
+ if (abort !== void 0) signal.removeEventListener("abort", abort);
11247
+ unsubscribe?.();
11248
+ if (!succeeded && turnId !== void 0) {
11249
+ await client.request("turn/interrupt", { threadId, turnId }).catch(() => void 0);
11250
+ }
11251
+ await client.request("thread/unsubscribe", { threadId }).catch(() => void 0);
11252
+ }
11253
+ }
11254
+
11255
+ // packages/provider-codex/src/task-titles.ts
11256
+ var CodexTaskTitles = class {
11257
+ constructor(client, readModel, logger) {
11258
+ this.client = client;
11259
+ this.readModel = readModel;
11260
+ this.logger = logger;
11261
+ }
11262
+ client;
11263
+ readModel;
11264
+ logger;
11265
+ #pending = /* @__PURE__ */ new Map();
11266
+ #active = /* @__PURE__ */ new Map();
11267
+ #mutations = /* @__PURE__ */ new Map();
11268
+ #listeners = /* @__PURE__ */ new Set();
11269
+ receiveNotification(notification) {
11270
+ for (const listener of this.#listeners) listener(notification);
11271
+ }
11272
+ register(taskId, project, cwd) {
11273
+ this.#pending.set(taskId, { project, cwd });
11274
+ }
11275
+ start(taskId, input) {
11276
+ const pending = this.#pending.get(taskId);
11277
+ if (pending === void 0) return;
11278
+ this.#pending.delete(taskId);
11279
+ const fallback = [...input.skills, ...input.files, ...input.textAttachments].map((item) => item.name.trim()).find(Boolean) ?? "\u65B0\u4EFB\u52A1";
11280
+ const prompt = taskTitlePrompt(input.text.trim() || fallback);
11281
+ const controller = new AbortController();
11282
+ const active = { ...pending, controller, done: Promise.resolve() };
11283
+ this.#active.set(taskId, active);
11284
+ active.done = Promise.resolve().then(async () => {
11285
+ const model = await this.readModel();
11286
+ controller.signal.throwIfAborted();
11287
+ const title = await generateTaskTitle(
11288
+ this.client,
11289
+ (listener) => {
11290
+ this.#listeners.add(listener);
11291
+ return () => {
11292
+ this.#listeners.delete(listener);
11293
+ };
11294
+ },
11295
+ pending.cwd,
11296
+ model,
11297
+ prompt,
11298
+ controller.signal
11299
+ );
11300
+ await this.mutate(taskId, async () => {
11301
+ controller.signal.throwIfAborted();
11302
+ const response = expectRecord(
11303
+ await this.client.request("thread/read", {
11304
+ threadId: taskId,
11305
+ includeTurns: false
11306
+ }),
11307
+ "thread/read response"
11308
+ );
11309
+ const thread = expectRecord(response["thread"], "task title thread");
11310
+ const projectId = pending.project.kind === "temporary" ? null : pending.project.id;
11311
+ if (thread["id"] !== taskId || thread["projectId"] !== projectId) {
11312
+ throw new Error("Task title ownership mismatch");
11313
+ }
11314
+ if (typeof thread["name"] === "string" && thread["name"].trim()) return;
11315
+ controller.signal.throwIfAborted();
11316
+ await this.client.request("thread/name/set", { threadId: taskId, name: title });
11317
+ });
11318
+ }).catch(() => {
11319
+ if (!controller.signal.aborted) {
11320
+ this.logger.warn(
11321
+ { diagnosticCode: "task_title_generation_failed" },
11322
+ "Automatic task title unavailable"
11323
+ );
11324
+ }
11325
+ }).finally(() => {
11326
+ if (this.#active.get(taskId) === active) this.#active.delete(taskId);
11327
+ });
11328
+ }
11329
+ async mutate(taskId, action) {
11330
+ const previous = this.#mutations.get(taskId) ?? Promise.resolve();
11331
+ const current = previous.catch(() => void 0).then(action);
11332
+ this.#mutations.set(taskId, current);
11333
+ try {
11334
+ return await current;
11335
+ } finally {
11336
+ if (this.#mutations.get(taskId) === current) this.#mutations.delete(taskId);
11337
+ }
11338
+ }
11339
+ forget(taskId) {
11340
+ this.#pending.delete(taskId);
11341
+ this.#active.get(taskId)?.controller.abort();
11342
+ }
11343
+ async releaseProject(projectId) {
11344
+ for (const [taskId, pending] of this.#pending) {
11345
+ if (pending.project.id === projectId) this.#pending.delete(taskId);
11346
+ }
11347
+ const active = [...this.#active.values()].filter((entry) => entry.project.id === projectId);
11348
+ for (const entry of active) entry.controller.abort();
11349
+ await Promise.all(active.map((entry) => entry.done));
11350
+ }
11351
+ };
11352
+
11353
+ // packages/provider-codex/src/runtime-default-settings.ts
11354
+ var fields = {
11355
+ approvalPolicy: "approval_policy",
11356
+ approvalsReviewer: "approvals_reviewer",
11357
+ model: "model",
11358
+ reasoningEffort: "model_reasoning_effort",
11359
+ sandboxMode: "sandbox_mode",
11360
+ fastMode: "service_tier"
11361
+ };
11362
+ async function writeRuntimeDefaultSettings(client, settings) {
11363
+ const edits = Object.keys(fields).filter((key) => settings[key] !== void 0).map((key) => ({
11364
+ keyPath: fields[key],
11365
+ // default 显式关闭快速档位;不删除键,避免重新继承模型的默认档位。
11366
+ value: key === "fastMode" ? settings.fastMode ? "priority" : "default" : settings[key],
11367
+ mergeStrategy: "replace"
11368
+ }));
11369
+ if (edits.length === 0) return;
11370
+ await client.request("config/batchWrite", { edits, reloadUserConfig: true });
11371
+ }
11372
+ function optionalNonEmptyString(value) {
11373
+ return typeof value === "string" && value.length > 0 ? value : void 0;
11374
+ }
11375
+ function optionalApprovalPolicy(value) {
11376
+ if (value === "on-request" || value === "never") {
11377
+ return value;
11378
+ }
11379
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
11380
+ return void 0;
11381
+ }
11382
+ const record = value;
11383
+ if (Object.keys(record).length !== 1 || !("granular" in record)) {
11384
+ return void 0;
11385
+ }
11386
+ const granular = record["granular"];
11387
+ if (typeof granular !== "object" || granular === null || Array.isArray(granular)) {
11388
+ return void 0;
11389
+ }
11390
+ const fields2 = granular;
11391
+ const knownFields = /* @__PURE__ */ new Set([
11392
+ "mcp_elicitations",
11393
+ "request_permissions",
11394
+ "rules",
11395
+ "sandbox_approval",
11396
+ "skill_approval"
11397
+ ]);
11398
+ if (Object.keys(fields2).some((key) => !knownFields.has(key)) || typeof fields2["mcp_elicitations"] !== "boolean" || typeof fields2["rules"] !== "boolean" || typeof fields2["sandbox_approval"] !== "boolean" || fields2["request_permissions"] !== void 0 && typeof fields2["request_permissions"] !== "boolean" || fields2["skill_approval"] !== void 0 && typeof fields2["skill_approval"] !== "boolean") {
11399
+ return void 0;
11400
+ }
11401
+ return {
11402
+ granular: {
11403
+ mcp_elicitations: fields2["mcp_elicitations"],
11404
+ request_permissions: fields2["request_permissions"] ?? false,
11405
+ rules: fields2["rules"],
11406
+ sandbox_approval: fields2["sandbox_approval"],
11407
+ skill_approval: fields2["skill_approval"] ?? false
11408
+ }
11409
+ };
11410
+ }
11411
+ function optionalSandboxMode(value) {
11412
+ return value === "read-only" || value === "workspace-write" || value === "danger-full-access" ? value : void 0;
11413
+ }
11414
+ async function readOptional(path) {
11415
+ try {
11416
+ return await readFile(path, "utf8");
11417
+ } catch (error) {
11418
+ if (error.code === "ENOENT") return "";
11419
+ throw error;
11420
+ }
11421
+ }
11422
+ function createGlobalInstructionsStore(home) {
11423
+ let pending = Promise.resolve();
11424
+ const read = async () => ({
11425
+ content: await readOptional(join(home, "AGENTS.md")),
11426
+ path: join(home, "AGENTS.md"),
11427
+ overrideActive: (await readOptional(join(home, "AGENTS.override.md"))).trim().length > 0
11428
+ });
11429
+ return {
11430
+ read,
11431
+ save(input) {
11432
+ const result = pending.then(async () => {
11433
+ const path = join(home, "AGENTS.md");
11434
+ if (await readOptional(path) !== input.expectedContent) {
11435
+ throw Object.assign(new Error("Global instructions changed; reload before saving"), {
11436
+ code: "GLOBAL_INSTRUCTIONS_CHANGED"
11437
+ });
11438
+ }
11439
+ await mkdir(home, { recursive: true });
11440
+ let target = path;
11441
+ try {
11442
+ target = await realpath(path);
11443
+ } catch (error) {
11444
+ if (error.code !== "ENOENT") throw error;
11445
+ }
11446
+ const temporary = join(dirname(target), `.AGENTS-${randomUUID()}.tmp`);
11447
+ const file = await open(temporary, "wx", 384);
11448
+ try {
11449
+ try {
11450
+ await file.chmod((await stat(target)).mode);
11451
+ } catch (error) {
11452
+ if (error.code !== "ENOENT") throw error;
11453
+ }
11454
+ await file.writeFile(input.content, "utf8");
11455
+ await file.sync();
11456
+ await file.close();
11457
+ if (await readOptional(path) !== input.expectedContent)
11458
+ throw Object.assign(new Error("Global instructions changed; reload before saving"), {
11459
+ code: "GLOBAL_INSTRUCTIONS_CHANGED"
11460
+ });
11461
+ await rename(temporary, target);
11462
+ } finally {
11463
+ await file.close();
11464
+ await unlink(temporary).catch((error) => {
11465
+ if (error.code !== "ENOENT") throw error;
11466
+ });
11467
+ }
11468
+ return read();
11469
+ });
11470
+ pending = result.then(
11471
+ () => void 0,
11472
+ () => void 0
11473
+ );
11474
+ return result;
11475
+ }
11476
+ };
11477
+ }
11478
+
11479
+ // packages/provider-codex/src/personalization.ts
11480
+ async function readConfig(client) {
11481
+ const response = expectRecord(
11482
+ await client.request("config/read", { includeLayers: false }),
11483
+ "config/read response"
11484
+ );
11485
+ return expectRecord(response["config"], "config/read config");
11486
+ }
11487
+ function section(config, key) {
11488
+ return config[key] === void 0 ? {} : expectRecord(config[key], key);
11489
+ }
11490
+ var edit = (keyPath, value) => ({ keyPath, value, mergeStrategy: "replace" });
11491
+ async function readMemorySettings(client) {
11492
+ const config = await readConfig(client);
11493
+ const features = section(config, "features");
11494
+ const memories = section(config, "memories");
11495
+ return {
11496
+ enabled: features["memories"] === true && memories["generate_memories"] !== false && memories["use_memories"] !== false,
11497
+ allowExternalContext: !(memories["disable_on_external_context"] ?? memories["no_memories_if_mcp_or_web_search"] ?? false)
11498
+ };
11499
+ }
11500
+ async function updateMemorySettings(client, update) {
11501
+ const edits = [];
11502
+ if (update.enabled !== void 0)
11503
+ for (const key of ["features.memories", "memories.generate_memories", "memories.use_memories"])
11504
+ edits.push(edit(key, update.enabled));
11505
+ if (update.allowExternalContext !== void 0) {
11506
+ edits.push(edit("memories.no_memories_if_mcp_or_web_search", null));
11507
+ edits.push(edit("memories.disable_on_external_context", !update.allowExternalContext));
11508
+ }
11509
+ if (edits.length) await client.request("config/batchWrite", { edits, reloadUserConfig: true });
11510
+ return readMemorySettings(client);
11511
+ }
11512
+ async function resetMemories(client) {
11513
+ await client.request("memory/reset", null);
11514
+ }
11515
+ async function readAgentPreferences(client) {
11516
+ const config = await readConfig(client);
11517
+ const verbosity = config["model_verbosity"];
11518
+ const search = config["web_search"];
11519
+ return {
11520
+ webSearch: search === "disabled" || search === "live" ? search : "cached",
11521
+ modelVerbosity: verbosity === "low" || verbosity === "medium" || verbosity === "high" ? verbosity : null
11522
+ };
11523
+ }
11524
+ async function updateAgentPreferences(client, settings) {
11525
+ await client.request("config/batchWrite", {
11526
+ edits: [
11527
+ edit("web_search", settings.webSearch),
11528
+ edit("model_verbosity", settings.modelVerbosity)
11529
+ ],
11530
+ reloadUserConfig: true
11531
+ });
11532
+ return readAgentPreferences(client);
11533
+ }
10758
11534
 
10759
11535
  // packages/provider-codex/src/custom-model-catalog.ts
10760
11536
  var DEFAULT_REASONING_EFFORTS = [
@@ -11084,7 +11860,7 @@ function mapAccount(value) {
11084
11860
  }
11085
11861
  return null;
11086
11862
  }
11087
- function readConfig(response) {
11863
+ function readConfig2(response) {
11088
11864
  if (!isRecord7(response) || !isRecord7(response["config"])) {
11089
11865
  throw new CodexProviderConnectionError("Codex returned an invalid config response");
11090
11866
  }
@@ -11131,7 +11907,7 @@ var CodexProviderConnectionService = class {
11131
11907
  this.#modelResponseMaxBytes = options.modelResponseMaxBytes ?? DEFAULT_MODEL_RESPONSE_MAX_BYTES;
11132
11908
  this.#nativeState = new CodexNativeStateSnapshot({
11133
11909
  account: async () => readAccountResponse(await client.request("account/read", { refreshToken: false })),
11134
- config: async () => readConfig(await client.request("config/read", { includeLayers: false }))
11910
+ config: async () => readConfig2(await client.request("config/read", { includeLayers: false }))
11135
11911
  });
11136
11912
  }
11137
11913
  receiveNotification(method, params) {
@@ -11201,6 +11977,9 @@ var CodexProviderConnectionService = class {
11201
11977
  async readConfig() {
11202
11978
  return this.#nativeState.readConfig();
11203
11979
  }
11980
+ invalidateConfig() {
11981
+ this.#nativeState.clear();
11982
+ }
11204
11983
  async configureCustom(input, persistedModels) {
11205
11984
  const baseUrl = normalizeBaseUrl(input.baseUrl);
11206
11985
  const apiKey = input.apiKey;
@@ -11226,7 +12005,7 @@ var CodexProviderConnectionService = class {
11226
12005
  this.#client.request("config/read", { includeLayers: false }),
11227
12006
  this.#client.request("account/read", { refreshToken: false })
11228
12007
  ]);
11229
- const previousConfig = readConfig(configResponse);
12008
+ const previousConfig = readConfig2(configResponse);
11230
12009
  const previousAccountState = readAccountResponse(accountResponse);
11231
12010
  const configUpdate = createCustomProviderConfigUpdate(
11232
12011
  previousConfig,
@@ -12279,51 +13058,11 @@ async function setCodexMcpServerEnabled(client, name, enabled) {
12279
13058
  }
12280
13059
 
12281
13060
  // packages/provider-codex/src/runtime-provider.ts
12282
- function optionalNonEmptyString(value) {
12283
- return typeof value === "string" && value.length > 0 ? value : void 0;
12284
- }
12285
- function optionalApprovalPolicy(value) {
12286
- if (value === "on-request" || value === "never") {
12287
- return value;
12288
- }
12289
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
12290
- return void 0;
12291
- }
12292
- const record = value;
12293
- if (Object.keys(record).length !== 1 || !("granular" in record)) {
12294
- return void 0;
12295
- }
12296
- const granular = record["granular"];
12297
- if (typeof granular !== "object" || granular === null || Array.isArray(granular)) {
12298
- return void 0;
12299
- }
12300
- const fields = granular;
12301
- const knownFields = /* @__PURE__ */ new Set([
12302
- "mcp_elicitations",
12303
- "request_permissions",
12304
- "rules",
12305
- "sandbox_approval",
12306
- "skill_approval"
12307
- ]);
12308
- if (Object.keys(fields).some((key) => !knownFields.has(key)) || typeof fields["mcp_elicitations"] !== "boolean" || typeof fields["rules"] !== "boolean" || typeof fields["sandbox_approval"] !== "boolean" || fields["request_permissions"] !== void 0 && typeof fields["request_permissions"] !== "boolean" || fields["skill_approval"] !== void 0 && typeof fields["skill_approval"] !== "boolean") {
12309
- return void 0;
12310
- }
12311
- return {
12312
- granular: {
12313
- mcp_elicitations: fields["mcp_elicitations"],
12314
- request_permissions: fields["request_permissions"] ?? false,
12315
- rules: fields["rules"],
12316
- sandbox_approval: fields["sandbox_approval"],
12317
- skill_approval: fields["skill_approval"] ?? false
12318
- }
12319
- };
12320
- }
12321
- function optionalSandboxMode(value) {
12322
- return value === "read-only" || value === "workspace-write" || value === "danger-full-access" ? value : void 0;
12323
- }
12324
13061
  var CodexRuntimeProvider = class {
13062
+ personalization;
12325
13063
  fileSearch;
12326
13064
  #client;
13065
+ #taskTitles;
12327
13066
  #logger;
12328
13067
  #gitMetadataWatch;
12329
13068
  #providerConnection;
@@ -12334,6 +13073,19 @@ var CodexRuntimeProvider = class {
12334
13073
  #reviewWorkerOwners = /* @__PURE__ */ new Map();
12335
13074
  constructor(client, logger = DEFAULT_PROVIDER_LOGGER, options = {}) {
12336
13075
  this.#client = client;
13076
+ this.#taskTitles = options.readTaskTitleModel === void 0 ? void 0 : new CodexTaskTitles(client, options.readTaskTitleModel, logger);
13077
+ const instructions = createGlobalInstructionsStore(
13078
+ options.codexHome ?? process.env["CODEX_HOME"] ?? resolve(homedir(), ".codex")
13079
+ );
13080
+ this.personalization = {
13081
+ getGlobalInstructions: instructions.read,
13082
+ saveGlobalInstructions: (input) => instructions.save(input),
13083
+ getMemorySettings: () => readMemorySettings(client),
13084
+ updateMemorySettings: (input) => updateMemorySettings(client, input),
13085
+ resetMemories: () => resetMemories(client),
13086
+ getAgentPreferences: () => readAgentPreferences(client),
13087
+ updateAgentPreferences: (input) => updateAgentPreferences(client, input)
13088
+ };
12337
13089
  this.#logger = logger;
12338
13090
  this.#providerConnection = new CodexProviderConnectionService(client, options);
12339
13091
  this.fileSearch = new CodexFuzzyFileSearchService(client);
@@ -12344,6 +13096,7 @@ var CodexRuntimeProvider = class {
12344
13096
  }
12345
13097
  });
12346
13098
  client.onNotification((notification) => {
13099
+ this.#taskTitles?.receiveNotification(notification);
12347
13100
  this.#gitMetadataWatch.receiveNotification(notification.method, notification.params);
12348
13101
  if (notification.method === "fs/changed") return;
12349
13102
  this.fileSearch.receiveNotification(notification.method, notification.params);
@@ -12432,6 +13185,7 @@ var CodexRuntimeProvider = class {
12432
13185
  }
12433
13186
  const rawProvider = new CodexAgentProvider(this.#client, project, {
12434
13187
  logger: this.#logger,
13188
+ ...this.#taskTitles === void 0 ? {} : { taskTitles: this.#taskTitles },
12435
13189
  subscribeRpc: false
12436
13190
  });
12437
13191
  const provider = new CodexRuntimeProjectProvider(this, rawProvider, project);
@@ -12515,6 +13269,7 @@ var CodexRuntimeProvider = class {
12515
13269
  const sandboxMode = optionalSandboxMode(config["sandbox_mode"]);
12516
13270
  return {
12517
13271
  ...approvalDefaults,
13272
+ fastMode: config["service_tier"] === "priority" || config["service_tier"] === "fast",
12518
13273
  ...model === void 0 ? {} : { model },
12519
13274
  ...reasoningEffort === void 0 ? {} : { reasoningEffort },
12520
13275
  ...sandboxMode === void 0 ? {} : { sandboxMode }
@@ -12523,6 +13278,10 @@ var CodexRuntimeProvider = class {
12523
13278
  readProviderConnection() {
12524
13279
  return this.#providerConnection.readStatus();
12525
13280
  }
13281
+ async updateDefaultSettings(settings) {
13282
+ await writeRuntimeDefaultSettings(this.#client, settings);
13283
+ this.#providerConnection.invalidateConfig();
13284
+ }
12526
13285
  async releaseProject(projectId, expectedProvider) {
12527
13286
  const projectProvider = this.#projectProviders.get(projectId);
12528
13287
  if (expectedProvider !== void 0 && projectProvider !== expectedProvider) {
@@ -12580,7 +13339,9 @@ var CodexRuntimeProvider = class {
12580
13339
  };
12581
13340
  function createCodexRuntimeProvider(options) {
12582
13341
  return new CodexRuntimeProvider(options.client, options.logger, {
12583
- ...options.fetch === void 0 ? {} : { fetch: options.fetch }
13342
+ ...options.codexHome === void 0 ? {} : { codexHome: options.codexHome },
13343
+ ...options.fetch === void 0 ? {} : { fetch: options.fetch },
13344
+ ...options.readTaskTitleModel === void 0 ? {} : { readTaskTitleModel: options.readTaskTitleModel }
12584
13345
  });
12585
13346
  }
12586
13347
  var APP_SERVER_ARGUMENTS = ["app-server", "--enable", "plugins", "--listen", "stdio://"];