anycodex 0.0.9 → 0.0.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 (334) hide show
  1. package/dist/app/assets/abap-BdImnpbu.js +1 -0
  2. package/dist/app/assets/actionscript-3-CoDkCxhg.js +1 -0
  3. package/dist/app/assets/ada-bCR0ucgS.js +1 -0
  4. package/dist/app/assets/andromeeda-C4gqWexZ.js +1 -0
  5. package/dist/app/assets/angular-html-DA-rfuFy.js +1 -0
  6. package/dist/app/assets/angular-ts-BrjP3tb8.js +1 -0
  7. package/dist/app/assets/apache-Pmp26Uib.js +1 -0
  8. package/dist/app/assets/apex-D8_7TLub.js +1 -0
  9. package/dist/app/assets/apl-CORt7UWP.js +1 -0
  10. package/dist/app/assets/applescript-Co6uUVPk.js +1 -0
  11. package/dist/app/assets/ara-BRHolxvo.js +1 -0
  12. package/dist/app/assets/asciidoc-Ve4PFQV2.js +1 -0
  13. package/dist/app/assets/asm-D_Q5rh1f.js +1 -0
  14. package/dist/app/assets/astro-HNnZUWAn.js +1 -0
  15. package/dist/app/assets/aurora-x-D-2ljcwZ.js +1 -0
  16. package/dist/app/assets/awk-DMzUqQB5.js +1 -0
  17. package/dist/app/assets/ayu-dark-DYE7WIF3.js +1 -0
  18. package/dist/app/assets/ayu-light-BA47KaF1.js +1 -0
  19. package/dist/app/assets/ayu-mirage-32ctXXKs.js +1 -0
  20. package/dist/app/assets/ballerina-BFfxhgS-.js +1 -0
  21. package/dist/app/assets/bat-BkioyH1T.js +1 -0
  22. package/dist/app/assets/beancount-k_qm7-4y.js +1 -0
  23. package/dist/app/assets/berry-uYugtg8r.js +1 -0
  24. package/dist/app/assets/bibtex-CHM0blh-.js +1 -0
  25. package/dist/app/assets/bicep-Bmn6On1c.js +1 -0
  26. package/dist/app/assets/bird2-BIv1doCn.js +1 -0
  27. package/dist/app/assets/blade-BjGOyj-B.js +1 -0
  28. package/dist/app/assets/bsl-BO_Y6i37.js +1 -0
  29. package/dist/app/assets/c-BIGW1oBm.js +1 -0
  30. package/dist/app/assets/c3-eo99z4R2.js +1 -0
  31. package/dist/app/assets/cadence-Bv_4Rxtq.js +1 -0
  32. package/dist/app/assets/cairo-KRGpt6FW.js +1 -0
  33. package/dist/app/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  34. package/dist/app/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  35. package/dist/app/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  36. package/dist/app/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  37. package/dist/app/assets/clarity-D53aC0YG.js +1 -0
  38. package/dist/app/assets/clojure-P80f7IUj.js +1 -0
  39. package/dist/app/assets/cmake-D1j8_8rp.js +1 -0
  40. package/dist/app/assets/cobol-nBiQ_Alo.js +1 -0
  41. package/dist/app/assets/codeowners-Bp6g37R7.js +1 -0
  42. package/dist/app/assets/codeql-DsOJ9woJ.js +1 -0
  43. package/dist/app/assets/coffee-Ch7k5sss.js +1 -0
  44. package/dist/app/assets/common-lisp-Cg-RD9OK.js +1 -0
  45. package/dist/app/assets/coq-DkFqJrB1.js +1 -0
  46. package/dist/app/assets/cpp-CofmeUqb.js +1 -0
  47. package/dist/app/assets/crystal-DNxU26gB.js +1 -0
  48. package/dist/app/assets/csharp-COcwbKMJ.js +1 -0
  49. package/dist/app/assets/css-CLj8gQPS.js +1 -0
  50. package/dist/app/assets/csv-fuZLfV_i.js +1 -0
  51. package/dist/app/assets/cue-D82EKSYY.js +1 -0
  52. package/dist/app/assets/cypher-COkxafJQ.js +1 -0
  53. package/dist/app/assets/d-85-TOEBH.js +1 -0
  54. package/dist/app/assets/dark-plus-C3mMm8J8.js +1 -0
  55. package/dist/app/assets/dart-bE4Kk8sk.js +1 -0
  56. package/dist/app/assets/dax-CEL-wOlO.js +1 -0
  57. package/dist/app/assets/desktop-BmXAJ9_W.js +1 -0
  58. package/dist/app/assets/diff-D97Zzqfu.js +1 -0
  59. package/dist/app/assets/docker-BcOcwvcX.js +1 -0
  60. package/dist/app/assets/dotenv-Da5cRb03.js +1 -0
  61. package/dist/app/assets/dracula-BzJJZx-M.js +1 -0
  62. package/dist/app/assets/dracula-soft-BXkSAIEj.js +1 -0
  63. package/dist/app/assets/dream-maker-BtqSS_iP.js +1 -0
  64. package/dist/app/assets/edge-FbVlp4U3.js +1 -0
  65. package/dist/app/assets/elixir-CkH2-t6x.js +1 -0
  66. package/dist/app/assets/elm-DbKCFpqz.js +1 -0
  67. package/dist/app/assets/emacs-lisp-CXvaQtF9.js +1 -0
  68. package/dist/app/assets/erb-BYCe7drp.js +1 -0
  69. package/dist/app/assets/erlang-DsQrWhSR.js +1 -0
  70. package/dist/app/assets/everforest-dark-BgDCqdQA.js +1 -0
  71. package/dist/app/assets/everforest-light-C8M2exoo.js +1 -0
  72. package/dist/app/assets/fennel-BYunw83y.js +1 -0
  73. package/dist/app/assets/fish-BvzEVeQv.js +1 -0
  74. package/dist/app/assets/fluent-C4IJs8-o.js +1 -0
  75. package/dist/app/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
  76. package/dist/app/assets/fortran-free-form-BxgE0vQu.js +1 -0
  77. package/dist/app/assets/fsharp-CXgrBDvD.js +1 -0
  78. package/dist/app/assets/gdresource-BOOCDP_w.js +1 -0
  79. package/dist/app/assets/gdscript-C5YyOfLZ.js +1 -0
  80. package/dist/app/assets/gdshader-DkwncUOv.js +1 -0
  81. package/dist/app/assets/genie-D0YGMca9.js +1 -0
  82. package/dist/app/assets/gherkin-DyxjwDmM.js +1 -0
  83. package/dist/app/assets/git-commit-F4YmCXRG.js +1 -0
  84. package/dist/app/assets/git-rebase-r7XF79zn.js +1 -0
  85. package/dist/app/assets/github-dark-DHJKELXO.js +1 -0
  86. package/dist/app/assets/github-dark-default-Cuk6v7N8.js +1 -0
  87. package/dist/app/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  88. package/dist/app/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  89. package/dist/app/assets/github-light-DAi9KRSo.js +1 -0
  90. package/dist/app/assets/github-light-default-D7oLnXFd.js +1 -0
  91. package/dist/app/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  92. package/dist/app/assets/gleam-BspZqrRM.js +1 -0
  93. package/dist/app/assets/glimmer-js-ByusRIyA.js +1 -0
  94. package/dist/app/assets/glimmer-ts-BfAWNZQY.js +1 -0
  95. package/dist/app/assets/glsl-DplSGwfg.js +1 -0
  96. package/dist/app/assets/gn-n2N0HUVH.js +1 -0
  97. package/dist/app/assets/gnuplot-DdkO51Og.js +1 -0
  98. package/dist/app/assets/go-C27-OAKa.js +1 -0
  99. package/dist/app/assets/graphql-ChdNCCLP.js +1 -0
  100. package/dist/app/assets/groovy-gcz8RCvz.js +1 -0
  101. package/dist/app/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  102. package/dist/app/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  103. package/dist/app/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  104. package/dist/app/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  105. package/dist/app/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  106. package/dist/app/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  107. package/dist/app/assets/hack-i7_Ulhet.js +1 -0
  108. package/dist/app/assets/haml-D5jkg6IW.js +1 -0
  109. package/dist/app/assets/handlebars-BpdQsYii.js +1 -0
  110. package/dist/app/assets/haskell-Df6bDoY_.js +1 -0
  111. package/dist/app/assets/haxe-CzTSHFRz.js +1 -0
  112. package/dist/app/assets/hcl-BWvSN4gD.js +1 -0
  113. package/dist/app/assets/hjson-D5-asLiD.js +1 -0
  114. package/dist/app/assets/hlsl-D3lLCCz7.js +1 -0
  115. package/dist/app/assets/horizon-BUw7H-hv.js +1 -0
  116. package/dist/app/assets/horizon-bright-CUuTKBJd.js +1 -0
  117. package/dist/app/assets/houston-DnULxvSX.js +1 -0
  118. package/dist/app/assets/html-derivative-DlHx6ybY.js +1 -0
  119. package/dist/app/assets/html-pp8916En.js +1 -0
  120. package/dist/app/assets/http-jrhK8wxY.js +1 -0
  121. package/dist/app/assets/hurl-irOxFIW8.js +1 -0
  122. package/dist/app/assets/hxml-Bvhsp5Yf.js +1 -0
  123. package/dist/app/assets/hy-DFXneXwc.js +1 -0
  124. package/dist/app/assets/imba-DGztddWO.js +1 -0
  125. package/dist/app/assets/index-BBYiZjoU.js +238 -0
  126. package/dist/app/assets/index-DU8KNBjo.css +32 -0
  127. package/dist/app/assets/ini-BEwlwnbL.js +1 -0
  128. package/dist/app/assets/java-CylS5w8V.js +1 -0
  129. package/dist/app/assets/javascript-wDzz0qaB.js +1 -0
  130. package/dist/app/assets/jinja-f2NsQr07.js +1 -0
  131. package/dist/app/assets/jison-wvAkD_A8.js +1 -0
  132. package/dist/app/assets/json-Cp-IABpG.js +1 -0
  133. package/dist/app/assets/json5-C9tS-k6U.js +1 -0
  134. package/dist/app/assets/jsonc-Des-eS-w.js +1 -0
  135. package/dist/app/assets/jsonl-DcaNXYhu.js +1 -0
  136. package/dist/app/assets/jsonnet-DFQXde-d.js +1 -0
  137. package/dist/app/assets/jssm-C2t-YnRu.js +1 -0
  138. package/dist/app/assets/jsx-g9-lgVsj.js +1 -0
  139. package/dist/app/assets/julia-CxzCAyBv.js +1 -0
  140. package/dist/app/assets/just-VxiPbLrw.js +1 -0
  141. package/dist/app/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  142. package/dist/app/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  143. package/dist/app/assets/kanagawa-wave-DWedfzmr.js +1 -0
  144. package/dist/app/assets/kdl-DV7GczEv.js +1 -0
  145. package/dist/app/assets/kotlin-BdnUsdx6.js +1 -0
  146. package/dist/app/assets/kusto-wEQ09or8.js +1 -0
  147. package/dist/app/assets/laserwave-DUszq2jm.js +1 -0
  148. package/dist/app/assets/latex-CWtU0Tv5.js +1 -0
  149. package/dist/app/assets/lean-BZvkOJ9d.js +1 -0
  150. package/dist/app/assets/less-B1dDrJ26.js +1 -0
  151. package/dist/app/assets/light-plus-B7mTdjB0.js +1 -0
  152. package/dist/app/assets/liquid-C0sCDyMI.js +1 -0
  153. package/dist/app/assets/llvm-DjAJT7YJ.js +1 -0
  154. package/dist/app/assets/log-2UxHyX5q.js +1 -0
  155. package/dist/app/assets/logo-BtOb2qkB.js +1 -0
  156. package/dist/app/assets/lua-BaeVxFsk.js +1 -0
  157. package/dist/app/assets/luau-C-HG3fhB.js +1 -0
  158. package/dist/app/assets/make-CHLpvVh8.js +1 -0
  159. package/dist/app/assets/markdown-Cvjx9yec.js +1 -0
  160. package/dist/app/assets/marko-DjSrsDqO.js +1 -0
  161. package/dist/app/assets/material-theme-D5KoaKCx.js +1 -0
  162. package/dist/app/assets/material-theme-darker-BfHTSMKl.js +1 -0
  163. package/dist/app/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  164. package/dist/app/assets/material-theme-ocean-CyktbL80.js +1 -0
  165. package/dist/app/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  166. package/dist/app/assets/matlab-D7o27uSR.js +1 -0
  167. package/dist/app/assets/mdc-DTYItulj.js +1 -0
  168. package/dist/app/assets/mdx-Cmh6b_Ma.js +1 -0
  169. package/dist/app/assets/mermaid-mWjccvbQ.js +1 -0
  170. package/dist/app/assets/min-dark-CafNBF8u.js +1 -0
  171. package/dist/app/assets/min-light-CTRr51gU.js +1 -0
  172. package/dist/app/assets/mipsasm-CKIfxQSi.js +1 -0
  173. package/dist/app/assets/mojo-rZm6bMo-.js +1 -0
  174. package/dist/app/assets/monokai-D4h5O-jR.js +1 -0
  175. package/dist/app/assets/moonbit-_H4v1dQx.js +1 -0
  176. package/dist/app/assets/move-IF9eRakj.js +1 -0
  177. package/dist/app/assets/narrat-DRg8JJMk.js +1 -0
  178. package/dist/app/assets/nextflow-C-mBbutL.js +1 -0
  179. package/dist/app/assets/nextflow-groovy-vE_lwT2v.js +1 -0
  180. package/dist/app/assets/nginx-BpAMiNFr.js +1 -0
  181. package/dist/app/assets/night-owl-C39BiMTA.js +1 -0
  182. package/dist/app/assets/night-owl-light-CMTm3GFP.js +1 -0
  183. package/dist/app/assets/nim-BIad80T-.js +1 -0
  184. package/dist/app/assets/nix-CwoSXNpI.js +1 -0
  185. package/dist/app/assets/nord-Ddv68eIx.js +1 -0
  186. package/dist/app/assets/nushell-Cz2AlsmD.js +1 -0
  187. package/dist/app/assets/objective-c-DXmwc3jG.js +1 -0
  188. package/dist/app/assets/objective-cpp-CLxacb5B.js +1 -0
  189. package/dist/app/assets/ocaml-C0hk2d4L.js +1 -0
  190. package/dist/app/assets/odin-BBf5iR-q.js +1 -0
  191. package/dist/app/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  192. package/dist/app/assets/one-light-C3Wv6jpd.js +1 -0
  193. package/dist/app/assets/openscad-C4EeE6gA.js +1 -0
  194. package/dist/app/assets/pascal-D93ZcfNL.js +1 -0
  195. package/dist/app/assets/perl-NvoQZIq0.js +1 -0
  196. package/dist/app/assets/php-R6g_5hLQ.js +1 -0
  197. package/dist/app/assets/pkl-u5AG7uiY.js +1 -0
  198. package/dist/app/assets/plastic-3e1v2bzS.js +1 -0
  199. package/dist/app/assets/plsql-ChMvpjG-.js +1 -0
  200. package/dist/app/assets/po-BTJTHyun.js +1 -0
  201. package/dist/app/assets/poimandres-CS3Unz2-.js +1 -0
  202. package/dist/app/assets/polar-C0HS_06l.js +1 -0
  203. package/dist/app/assets/postcss-CXtECtnM.js +1 -0
  204. package/dist/app/assets/powerquery-CEu0bR-o.js +1 -0
  205. package/dist/app/assets/powershell-Dpen1YoG.js +1 -0
  206. package/dist/app/assets/prisma-Dd19v3D-.js +1 -0
  207. package/dist/app/assets/prolog-CbFg5uaA.js +1 -0
  208. package/dist/app/assets/proto-C7zT0LnQ.js +1 -0
  209. package/dist/app/assets/pug-DKIMFp6K.js +1 -0
  210. package/dist/app/assets/puppet-BMWR74SV.js +1 -0
  211. package/dist/app/assets/purescript-CklMAg4u.js +1 -0
  212. package/dist/app/assets/python-B6aJPvgy.js +1 -0
  213. package/dist/app/assets/qml-3beO22l8.js +1 -0
  214. package/dist/app/assets/qmldir-C8lEn-DE.js +1 -0
  215. package/dist/app/assets/qss-IeuSbFQv.js +1 -0
  216. package/dist/app/assets/r-Dspwwk_N.js +1 -0
  217. package/dist/app/assets/racket-BqYA7rlc.js +1 -0
  218. package/dist/app/assets/raku-DXvB9xmW.js +1 -0
  219. package/dist/app/assets/razor-BDqjjVU7.js +1 -0
  220. package/dist/app/assets/red-bN70gL4F.js +1 -0
  221. package/dist/app/assets/reg-C-SQnVFl.js +1 -0
  222. package/dist/app/assets/regexp-CDVJQ6XC.js +1 -0
  223. package/dist/app/assets/rel-C3B-1QV4.js +1 -0
  224. package/dist/app/assets/riscv-BM1_JUlF.js +1 -0
  225. package/dist/app/assets/ron-D8l8udqQ.js +1 -0
  226. package/dist/app/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  227. package/dist/app/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  228. package/dist/app/assets/rose-pine-qdsjHGoJ.js +1 -0
  229. package/dist/app/assets/rosmsg-BJDFO7_C.js +1 -0
  230. package/dist/app/assets/rst-CRjBmOyv.js +1 -0
  231. package/dist/app/assets/ruby-Wjq7vjNf.js +1 -0
  232. package/dist/app/assets/rust-B1yitclQ.js +1 -0
  233. package/dist/app/assets/sas-cz2c8ADy.js +1 -0
  234. package/dist/app/assets/sass-Cj5Yp3dK.js +1 -0
  235. package/dist/app/assets/scala-C151Ov-r.js +1 -0
  236. package/dist/app/assets/scheme-C98Dy4si.js +1 -0
  237. package/dist/app/assets/scss-D5BDwBP9.js +1 -0
  238. package/dist/app/assets/sdbl-DVxCFoDh.js +1 -0
  239. package/dist/app/assets/shaderlab-Dg9Lc6iA.js +1 -0
  240. package/dist/app/assets/shellscript-Yzrsuije.js +1 -0
  241. package/dist/app/assets/shellsession-BADoaaVG.js +1 -0
  242. package/dist/app/assets/slack-dark-BthQWCQV.js +1 -0
  243. package/dist/app/assets/slack-ochin-DqwNpetd.js +1 -0
  244. package/dist/app/assets/smalltalk-BERRCDM3.js +1 -0
  245. package/dist/app/assets/snazzy-light-Bw305WKR.js +1 -0
  246. package/dist/app/assets/solarized-dark-DXbdFlpD.js +1 -0
  247. package/dist/app/assets/solarized-light-L9t79GZl.js +1 -0
  248. package/dist/app/assets/solidity-rGO070M0.js +1 -0
  249. package/dist/app/assets/soy-8wufbnw4.js +1 -0
  250. package/dist/app/assets/sparql-rVzFXLq3.js +1 -0
  251. package/dist/app/assets/splunk-BtCnVYZw.js +1 -0
  252. package/dist/app/assets/sql-BLtJtn59.js +1 -0
  253. package/dist/app/assets/ssh-config-_ykCGR6B.js +1 -0
  254. package/dist/app/assets/stata-BH5u7GGu.js +1 -0
  255. package/dist/app/assets/stylus-BEDo0Tqx.js +1 -0
  256. package/dist/app/assets/surrealql-Bq5Q-fJD.js +1 -0
  257. package/dist/app/assets/svelte-Cy7k_4gC.js +1 -0
  258. package/dist/app/assets/swift-D82vCrfD.js +1 -0
  259. package/dist/app/assets/synthwave-84-CbfX1IO0.js +1 -0
  260. package/dist/app/assets/system-verilog-CnnmHF94.js +1 -0
  261. package/dist/app/assets/systemd-4A_iFExJ.js +1 -0
  262. package/dist/app/assets/talonscript-CkByrt1z.js +1 -0
  263. package/dist/app/assets/tasl-QIJgUcNo.js +1 -0
  264. package/dist/app/assets/tcl-dwOrl1Do.js +1 -0
  265. package/dist/app/assets/templ-DhtptRzy.js +1 -0
  266. package/dist/app/assets/terraform-BETggiCN.js +1 -0
  267. package/dist/app/assets/tex-idrVyKtj.js +1 -0
  268. package/dist/app/assets/tokyo-night-hegEt444.js +1 -0
  269. package/dist/app/assets/toml-vGWfd6FD.js +1 -0
  270. package/dist/app/assets/ts-tags-DQrlYJgV.js +1 -0
  271. package/dist/app/assets/tsv-B_m7g4N7.js +1 -0
  272. package/dist/app/assets/tsx-COt5Ahok.js +1 -0
  273. package/dist/app/assets/turtle-BsS91CYL.js +1 -0
  274. package/dist/app/assets/twig-xg9kU7Mw.js +1 -0
  275. package/dist/app/assets/typescript-BPQ3VLAy.js +1 -0
  276. package/dist/app/assets/typespec-CAFt9gP4.js +1 -0
  277. package/dist/app/assets/typst-DHCkPAjA.js +1 -0
  278. package/dist/app/assets/v-BcVCzyr7.js +1 -0
  279. package/dist/app/assets/vala-CsfeWuGM.js +1 -0
  280. package/dist/app/assets/vb-D17OF-Vu.js +1 -0
  281. package/dist/app/assets/verilog-BQ8w6xss.js +1 -0
  282. package/dist/app/assets/vesper-DU1UobuO.js +1 -0
  283. package/dist/app/assets/vhdl-CeAyd5Ju.js +1 -0
  284. package/dist/app/assets/viml-CJc9bBzg.js +1 -0
  285. package/dist/app/assets/vitesse-black-Bkuqu6BP.js +1 -0
  286. package/dist/app/assets/vitesse-dark-D0r3Knsf.js +1 -0
  287. package/dist/app/assets/vitesse-light-CVO1_9PV.js +1 -0
  288. package/dist/app/assets/vue-D2xRrEX4.js +1 -0
  289. package/dist/app/assets/vue-html-AaS7Mt5G.js +1 -0
  290. package/dist/app/assets/vue-vine-BoDAl6tE.js +1 -0
  291. package/dist/app/assets/vyper-CDx5xZoG.js +1 -0
  292. package/dist/app/assets/wasm-CG6Dc4jp.js +1 -0
  293. package/dist/app/assets/wasm-MzD3tlZU.js +1 -0
  294. package/dist/app/assets/wenyan-BV7otONQ.js +1 -0
  295. package/dist/app/assets/wgsl-Dx-B1_4e.js +1 -0
  296. package/dist/app/assets/wikitext-BhOHFoWU.js +1 -0
  297. package/dist/app/assets/wit-5i3qLPDT.js +1 -0
  298. package/dist/app/assets/wolfram-lXgVvXCa.js +1 -0
  299. package/dist/app/assets/xml-sdJ4AIDG.js +1 -0
  300. package/dist/app/assets/xsl-CtQFsRM5.js +1 -0
  301. package/dist/app/assets/yaml-Buea-lGh.js +1 -0
  302. package/dist/app/assets/zenscript-DVFEvuxE.js +1 -0
  303. package/dist/app/assets/zig-VOosw3JB.js +1 -0
  304. package/dist/app/index.html +13 -0
  305. package/dist/bin.js +46 -34
  306. package/dist/{chunk-HGHQOBPB.js → chunk-3KUWIT4H.js} +1 -3
  307. package/dist/{chunk-3M7ZT7ND.js → chunk-5UMV2W7N.js} +2 -4
  308. package/dist/{chunk-X2APBVZP.js → chunk-6SEC53MI.js} +7 -9
  309. package/dist/{chunk-BU272CMB.js → chunk-77HVPD4G.js} +0 -2
  310. package/dist/{chunk-DUYFGYX6.js → chunk-DU4BGORD.js} +1 -3
  311. package/dist/{chunk-5WPHGERF.js → chunk-H3TAXRCT.js} +0 -2
  312. package/dist/{chunk-DWZ54BRP.js → chunk-LAUSNF7V.js} +1013 -803
  313. package/dist/{chunk-TXOREVF3.js → chunk-LD436475.js} +1 -3
  314. package/dist/{chunk-52L2IFLQ.js → chunk-RKQHI4QK.js} +4 -6
  315. package/dist/{chunk-PJTTX6EZ.js → chunk-U6O7ENPZ.js} +327 -3821
  316. package/dist/{chunk-CPXZVSHE.js → chunk-XXVDY7BO.js} +0 -2
  317. package/dist/{dist-OHIHFX4C.js → dist-KUMFR56P.js} +10 -12
  318. package/dist/glob-RMMK6FVW-WWQVXLWS.js +9 -0
  319. package/dist/{mime-types-RCGCEXVB.js → mime-types-5YOYBSSJ.js} +1 -3
  320. package/dist/registry-K2RSCRJJ-NU43ZZLZ.js +15 -0
  321. package/dist/schema-SOLWPA3E-PNTUZRDK.js +14 -0
  322. package/dist/session-Q7S3ITUV-S7F6XEPQ.js +20 -0
  323. package/dist/{storage-YSEEBFV7-EEWVBKOJ.js → storage-YSEEBFV7-IJTIS3MG.js} +5 -7
  324. package/dist/{token-G4PDHD7H.js → token-PRJUKXYG.js} +3 -5
  325. package/dist/token-util-NX2T2YVY.js +7 -0
  326. package/package.json +5 -2
  327. package/dist/glob-RMMK6FVW-AWD4KFLI.js +0 -11
  328. package/dist/registry-VQVHAEPP-NPWMJLMK.js +0 -17
  329. package/dist/schema-SOLWPA3E-JTA6UT3V.js +0 -16
  330. package/dist/session-Q7S3ITUV-55IIKQTZ.js +0 -22
  331. package/dist/token-util-KVNYSCKU.js +0 -9
  332. package/src/bin.ts +0 -654
  333. package/tsconfig.json +0 -8
  334. package/tsup.config.ts +0 -15
@@ -1,13 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire } from 'module';
3
- const require = createRequire(import.meta.url);
4
2
  import {
5
3
  ConfigMarkdown,
6
4
  ReadTool,
7
5
  SchedulerService,
8
6
  Skill,
9
7
  ToolRegistry
10
- } from "./chunk-PJTTX6EZ.js";
8
+ } from "./chunk-U6O7ENPZ.js";
11
9
  import {
12
10
  AISDKError,
13
11
  APICallError,
@@ -62,7 +60,7 @@ import {
62
60
  withoutTrailingSlash,
63
61
  wrapLanguageModel,
64
62
  zodSchema
65
- } from "./chunk-X2APBVZP.js";
63
+ } from "./chunk-6SEC53MI.js";
66
64
  import {
67
65
  Database,
68
66
  FileTimeService,
@@ -73,26 +71,26 @@ import {
73
71
  dirname,
74
72
  join,
75
73
  resolve
76
- } from "./chunk-52L2IFLQ.js";
74
+ } from "./chunk-RKQHI4QK.js";
77
75
  import {
78
76
  MessageID,
79
77
  PartID,
80
78
  SessionID
81
- } from "./chunk-TXOREVF3.js";
79
+ } from "./chunk-LD436475.js";
82
80
  import {
83
81
  external_exports,
84
82
  safeParseAsync,
85
83
  toJSONSchema,
86
84
  zod_default
87
- } from "./chunk-HGHQOBPB.js";
85
+ } from "./chunk-3KUWIT4H.js";
88
86
  import {
89
87
  __callDispose,
90
88
  __using
91
- } from "./chunk-CPXZVSHE.js";
89
+ } from "./chunk-XXVDY7BO.js";
92
90
  import {
93
91
  __commonJS,
94
92
  __toESM
95
- } from "./chunk-BU272CMB.js";
93
+ } from "./chunk-77HVPD4G.js";
96
94
 
97
95
  // ../../node_modules/.pnpm/fuzzysort@3.1.0/node_modules/fuzzysort/fuzzysort.js
98
96
  var require_fuzzysort = __commonJS({
@@ -910,12 +908,6 @@ function o(e, r3) {
910
908
  return a3;
911
909
  }
912
910
 
913
- // ../agent/dist/index.js
914
- import { spawn } from "child_process";
915
- import { pathToFileURL, fileURLToPath } from "url";
916
- var import_fuzzysort = __toESM(require_fuzzysort(), 1);
917
- import { createHash } from "crypto";
918
-
919
911
  // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.21_zod@4.1.8/node_modules/@ai-sdk/provider-utils/dist/index.mjs
920
912
  function combineHeaders2(...headers) {
921
913
  return headers.reduce(
@@ -6266,6 +6258,9 @@ function createAnthropic(options = {}) {
6266
6258
  }
6267
6259
  var anthropic = createAnthropic();
6268
6260
 
6261
+ // ../agent/dist/index.js
6262
+ import { createHash } from "crypto";
6263
+
6269
6264
  // ../../node_modules/.pnpm/@ai-sdk+google@2.0.54_zod@4.1.8/node_modules/@ai-sdk/google/dist/index.mjs
6270
6265
  var VERSION3 = true ? "2.0.54" : "0.0.0-test";
6271
6266
  var googleErrorDataSchema = lazySchema2(
@@ -13909,6 +13904,9 @@ function createOpenAICompatible(options) {
13909
13904
  }
13910
13905
 
13911
13906
  // ../agent/dist/index.js
13907
+ import { spawn } from "child_process";
13908
+ import { pathToFileURL, fileURLToPath } from "url";
13909
+ var import_fuzzysort = __toESM(require_fuzzysort(), 1);
13912
13910
  import fs from "fs/promises";
13913
13911
  import { existsSync, statSync, readdirSync } from "fs";
13914
13912
  import path from "path";
@@ -13957,440 +13955,190 @@ var Env;
13957
13955
  }
13958
13956
  Env2.remove = remove;
13959
13957
  })(Env || (Env = {}));
13960
- function mimeToModality(mime) {
13961
- if (mime.startsWith("image/")) return "image";
13962
- if (mime.startsWith("audio/")) return "audio";
13963
- if (mime.startsWith("video/")) return "video";
13964
- if (mime === "application/pdf") return "pdf";
13965
- return void 0;
13966
- }
13967
- var ProviderTransform;
13968
- ((ProviderTransform2) => {
13969
- ProviderTransform2.OUTPUT_TOKEN_MAX = Flag.OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX || 32e3;
13970
- function sdkKey(npm) {
13971
- switch (npm) {
13972
- case "@ai-sdk/openai":
13973
- return "openai";
13974
- case "@ai-sdk/anthropic":
13975
- return "anthropic";
13976
- case "@ai-sdk/google":
13977
- return "google";
13978
- }
13979
- return void 0;
13958
+ var Hash;
13959
+ ((Hash2) => {
13960
+ function fast(input) {
13961
+ return createHash("sha1").update(input).digest("hex");
13980
13962
  }
13981
- function normalizeMessages(msgs, model, _options) {
13982
- if (model.api.npm === "@ai-sdk/anthropic") {
13983
- msgs = msgs.map((msg) => {
13984
- if (typeof msg.content === "string") {
13985
- if (msg.content === "") return void 0;
13986
- return msg;
13963
+ Hash2.fast = fast;
13964
+ function sha256(input) {
13965
+ return createHash("sha256").update(input).digest("hex");
13966
+ }
13967
+ Hash2.sha256 = sha256;
13968
+ function hexToUUID(hex) {
13969
+ return [
13970
+ hex.slice(0, 8),
13971
+ hex.slice(8, 12),
13972
+ hex.slice(12, 16),
13973
+ hex.slice(16, 20),
13974
+ hex.slice(20, 32)
13975
+ ].join("-");
13976
+ }
13977
+ Hash2.hexToUUID = hexToUUID;
13978
+ })(Hash || (Hash = {}));
13979
+ var anthropicVendor = {
13980
+ id: "anthropic",
13981
+ npms: ["@ai-sdk/anthropic"],
13982
+ bundled: {
13983
+ "@ai-sdk/anthropic": createAnthropic
13984
+ },
13985
+ sdkKeys: {
13986
+ "@ai-sdk/anthropic": "anthropic"
13987
+ },
13988
+ async customLoader() {
13989
+ return {
13990
+ autoload: false,
13991
+ options: {
13992
+ headers: {
13993
+ "anthropic-beta": "claude-code-20250219,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14",
13994
+ "X-App": "cli",
13995
+ "X-Stainless-Lang": "js",
13996
+ "X-Stainless-Package-Version": "0.70.0",
13997
+ "X-Stainless-OS": process.platform === "darwin" ? "MacOS" : process.platform === "win32" ? "Windows" : "Linux",
13998
+ "X-Stainless-Arch": process.arch === "arm64" ? "arm64" : "x64",
13999
+ "X-Stainless-Runtime": "node",
14000
+ "X-Stainless-Runtime-Version": process.version,
14001
+ "X-Stainless-Retry-Count": "0",
14002
+ "X-Stainless-Timeout": "600",
14003
+ "Anthropic-Dangerous-Direct-Browser-Access": "true"
13987
14004
  }
13988
- if (!Array.isArray(msg.content)) return msg;
13989
- const filtered = msg.content.filter((part) => {
13990
- if (part.type === "text" || part.type === "reasoning") {
13991
- return part.text !== "";
13992
- }
13993
- return true;
13994
- });
13995
- if (filtered.length === 0) return void 0;
13996
- return { ...msg, content: filtered };
13997
- }).filter((msg) => msg !== void 0 && msg.content !== "");
14005
+ }
14006
+ };
14007
+ },
14008
+ patchRequest({ opts, model, provider }) {
14009
+ if (opts.headers) {
14010
+ const headers = new Headers(opts.headers);
14011
+ headers.set("user-agent", "claude-cli/2.1.77");
14012
+ opts.headers = Object.fromEntries(headers.entries());
14013
+ } else {
14014
+ opts.headers = { "user-agent": "claude-cli/2.1.77" };
13998
14015
  }
13999
- if (model.api.id.includes("claude")) {
14000
- return msgs.map((msg) => {
14001
- if ((msg.role === "assistant" || msg.role === "tool") && Array.isArray(msg.content)) {
14002
- msg.content = msg.content.map((part) => {
14003
- if ((part.type === "tool-call" || part.type === "tool-result") && "toolCallId" in part) {
14004
- return {
14005
- ...part,
14006
- toolCallId: part.toolCallId.replace(/[^a-zA-Z0-9_-]/g, "_")
14007
- };
14008
- }
14009
- return part;
14010
- });
14016
+ if (opts.body && opts.method === "POST") {
14017
+ try {
14018
+ const body = JSON.parse(opts.body);
14019
+ if (!body.metadata?.user_id) {
14020
+ if (!body.metadata) body.metadata = {};
14021
+ const seed = [model.providerID ?? "", provider.key ?? ""].join(":");
14022
+ const clientId = Hash.sha256(seed + ":claude-code-client");
14023
+ const uuid = Hash.hexToUUID(Hash.sha256(seed + ":session"));
14024
+ body.metadata.user_id = `user_${clientId}_account__session_${uuid}`;
14011
14025
  }
14012
- return msg;
14013
- });
14014
- }
14015
- if (typeof model.capabilities.interleaved === "object" && model.capabilities.interleaved.field) {
14016
- const field = model.capabilities.interleaved.field;
14017
- return msgs.map((msg) => {
14018
- if (msg.role === "assistant" && Array.isArray(msg.content)) {
14019
- const reasoningParts = msg.content.filter((part) => part.type === "reasoning");
14020
- const reasoningText = reasoningParts.map((part) => part.text).join("");
14021
- const filteredContent = msg.content.filter((part) => part.type !== "reasoning");
14022
- if (reasoningText) {
14023
- return {
14024
- ...msg,
14025
- content: filteredContent,
14026
- providerOptions: {
14027
- ...msg.providerOptions,
14028
- openaiCompatible: {
14029
- ...msg.providerOptions?.openaiCompatible,
14030
- [field]: reasoningText
14031
- }
14032
- }
14033
- };
14026
+ if (Array.isArray(body.system)) {
14027
+ const alreadyPresent = body.system.some(
14028
+ (entry) => typeof entry.text === "string" && entry.text.startsWith(CLAUDE_CODE_SYSTEM)
14029
+ );
14030
+ if (!alreadyPresent) {
14031
+ body.system.unshift({
14032
+ type: "text",
14033
+ text: CLAUDE_CODE_SYSTEM,
14034
+ cache_control: { type: "ephemeral" }
14035
+ });
14034
14036
  }
14035
- return { ...msg, content: filteredContent };
14036
14037
  }
14037
- return msg;
14038
- });
14039
- }
14040
- return msgs;
14041
- }
14042
- function applyCaching(msgs, _model) {
14043
- const system = msgs.filter((msg) => msg.role === "system").slice(0, 2);
14044
- const final = msgs.filter((msg) => msg.role !== "system").slice(-2);
14045
- const providerOptions2 = {
14046
- anthropic: {
14047
- cacheControl: { type: "ephemeral" }
14038
+ opts.body = JSON.stringify(body);
14039
+ } catch {
14048
14040
  }
14049
- };
14050
- for (const msg of i([...system, ...final])) {
14051
- msg.providerOptions = D(msg.providerOptions ?? {}, providerOptions2);
14052
14041
  }
14053
- return msgs;
14054
- }
14055
- function unsupportedParts(msgs, model) {
14056
- return msgs.map((msg) => {
14057
- if (msg.role !== "user" || !Array.isArray(msg.content)) return msg;
14058
- const filtered = msg.content.map((part) => {
14059
- if (part.type !== "file" && part.type !== "image") return part;
14060
- if (part.type === "image") {
14061
- const imageStr = part.image.toString();
14062
- if (imageStr.startsWith("data:")) {
14063
- const match = imageStr.match(/^data:([^;]+);base64,(.*)$/);
14064
- if (match && (!match[2] || match[2].length === 0)) {
14065
- return {
14066
- type: "text",
14067
- text: "ERROR: Image file is empty or corrupted. Please provide a valid image."
14068
- };
14042
+ },
14043
+ transform: {
14044
+ message(msgs, model) {
14045
+ if (model.api.npm === "@ai-sdk/anthropic") {
14046
+ msgs = msgs.map((msg) => {
14047
+ if (typeof msg.content === "string") {
14048
+ if (msg.content === "") return void 0;
14049
+ return msg;
14050
+ }
14051
+ if (!Array.isArray(msg.content)) return msg;
14052
+ const filtered = msg.content.filter((part) => {
14053
+ if (part.type === "text" || part.type === "reasoning") {
14054
+ return part.text !== "";
14069
14055
  }
14056
+ return true;
14057
+ });
14058
+ if (filtered.length === 0) return void 0;
14059
+ return { ...msg, content: filtered };
14060
+ }).filter((msg) => msg !== void 0 && msg.content !== "");
14061
+ }
14062
+ if (model.api.id.includes("claude")) {
14063
+ msgs = msgs.map((msg) => {
14064
+ if ((msg.role === "assistant" || msg.role === "tool") && Array.isArray(msg.content)) {
14065
+ msg.content = msg.content.map((part) => {
14066
+ if ((part.type === "tool-call" || part.type === "tool-result") && "toolCallId" in part) {
14067
+ return {
14068
+ ...part,
14069
+ toolCallId: part.toolCallId.replace(/[^a-zA-Z0-9_-]/g, "_")
14070
+ };
14071
+ }
14072
+ return part;
14073
+ });
14074
+ }
14075
+ return msg;
14076
+ });
14077
+ }
14078
+ if (model.providerID === "anthropic" || model.api.id.includes("claude") || model.api.npm === "@ai-sdk/anthropic") {
14079
+ const system = msgs.filter((msg) => msg.role === "system").slice(0, 2);
14080
+ const final = msgs.filter((msg) => msg.role !== "system").slice(-2);
14081
+ const providerOptions = {
14082
+ anthropic: {
14083
+ cacheControl: { type: "ephemeral" }
14070
14084
  }
14071
- }
14072
- const mime = part.type === "image" ? part.image.toString().split(";")[0].replace("data:", "") : part.mediaType;
14073
- const filename = part.type === "file" ? part.filename : void 0;
14074
- const modality = mimeToModality(mime);
14075
- if (!modality) return part;
14076
- if (model.capabilities.input[modality]) return part;
14077
- const name2 = filename ? `"${filename}"` : modality;
14078
- return {
14079
- type: "text",
14080
- text: `ERROR: Cannot read ${name2} (this model does not support ${modality} input). Inform the user.`
14081
- };
14082
- });
14083
- return { ...msg, content: filtered };
14084
- });
14085
- }
14086
- function message(msgs, model, options2) {
14087
- msgs = unsupportedParts(msgs, model);
14088
- msgs = normalizeMessages(msgs, model, options2);
14089
- if (model.providerID === "anthropic" || model.api.id.includes("claude") || model.api.npm === "@ai-sdk/anthropic") {
14090
- msgs = applyCaching(msgs, model);
14091
- }
14092
- const key = sdkKey(model.api.npm);
14093
- if (key && key !== model.providerID) {
14094
- const remap = (opts) => {
14095
- if (!opts) return opts;
14096
- if (!(model.providerID in opts)) return opts;
14097
- const result = { ...opts };
14098
- result[key] = result[model.providerID];
14099
- delete result[model.providerID];
14100
- return result;
14101
- };
14102
- msgs = msgs.map((msg) => {
14103
- if (!Array.isArray(msg.content)) return { ...msg, providerOptions: remap(msg.providerOptions) };
14104
- return {
14105
- ...msg,
14106
- providerOptions: remap(msg.providerOptions),
14107
- content: msg.content.map((part) => ({ ...part, providerOptions: remap(part.providerOptions) }))
14108
14085
  };
14109
- });
14110
- }
14111
- return msgs;
14112
- }
14113
- ProviderTransform2.message = message;
14114
- function temperature(model) {
14115
- const id = model.id.toLowerCase();
14116
- if (id.includes("claude")) return void 0;
14117
- if (id.includes("gemini")) return 1;
14118
- return void 0;
14119
- }
14120
- ProviderTransform2.temperature = temperature;
14121
- function topP(_model) {
14122
- return void 0;
14123
- }
14124
- ProviderTransform2.topP = topP;
14125
- function topK(model) {
14126
- const id = model.id.toLowerCase();
14127
- if (id.includes("gemini")) return 64;
14128
- return void 0;
14129
- }
14130
- ProviderTransform2.topK = topK;
14131
- function options(input) {
14132
- const result = {};
14133
- const model = input.model;
14134
- if (model.providerID === "openai" || model.api.npm === "@ai-sdk/openai") {
14135
- result["store"] = false;
14136
- }
14137
- if (model.providerID === "openai" || input.providerOptions?.setCacheKey) {
14138
- result["promptCacheKey"] = input.sessionID;
14139
- }
14140
- if (model.api.npm === "@ai-sdk/anthropic") {
14086
+ for (const msg of i([...system, ...final])) {
14087
+ msg.providerOptions = D(msg.providerOptions ?? {}, providerOptions);
14088
+ }
14089
+ }
14090
+ return msgs;
14091
+ },
14092
+ options({ model }) {
14093
+ if (model.api.npm !== "@ai-sdk/anthropic") return {};
14141
14094
  const isAdaptive = ["opus-4-6", "opus-4.6", "sonnet-4-6", "sonnet-4.6"].some(
14142
14095
  (v) => model.api.id.includes(v)
14143
14096
  );
14144
14097
  if (isAdaptive) {
14145
- result["thinking"] = { type: "adaptive" };
14146
- } else {
14147
- result["thinking"] = {
14098
+ return { thinking: { type: "adaptive" } };
14099
+ }
14100
+ return {
14101
+ thinking: {
14148
14102
  type: "enabled",
14149
14103
  budgetTokens: model.limit.output - 1
14150
- };
14151
- }
14152
- }
14153
- if (model.api.npm === "@ai-sdk/google") {
14154
- result["thinkingConfig"] = { includeThoughts: true };
14155
- if (model.api.id.includes("gemini-3")) {
14156
- result["thinkingConfig"]["thinkingLevel"] = "high";
14157
- }
14158
- }
14159
- if (model.api.id.includes("gpt-5") && !model.api.id.includes("gpt-5-chat")) {
14160
- if (!model.api.id.includes("gpt-5-pro")) {
14161
- result["reasoningEffort"] = "medium";
14162
- result["reasoningSummary"] = "auto";
14163
- }
14164
- if (model.api.id.includes("gpt-5.") && !model.api.id.includes("codex") && !model.api.id.includes("-chat")) {
14165
- result["textVerbosity"] = "low";
14166
- }
14167
- }
14168
- return result;
14169
- }
14170
- ProviderTransform2.options = options;
14171
- function smallOptions(model) {
14172
- if (model.providerID === "openai" || model.api.npm === "@ai-sdk/openai") {
14173
- if (model.api.id.includes("gpt-5")) {
14174
- if (model.api.id.includes("5.")) return { store: false, reasoningEffort: "low" };
14175
- return { store: false, reasoningEffort: "minimal" };
14176
- }
14177
- return { store: false };
14178
- }
14179
- if (model.providerID === "google") {
14180
- if (model.api.id.includes("gemini-3")) {
14181
- return { thinkingConfig: { thinkingLevel: "minimal" } };
14182
- }
14183
- return { thinkingConfig: { thinkingBudget: 0 } };
14184
- }
14185
- return {};
14186
- }
14187
- ProviderTransform2.smallOptions = smallOptions;
14188
- function providerOptions(model, options2) {
14189
- const key = sdkKey(model.api.npm) ?? model.providerID;
14190
- return { [key]: options2 };
14191
- }
14192
- ProviderTransform2.providerOptions = providerOptions;
14193
- function maxOutputTokens(model) {
14194
- return Math.min(model.limit.output, ProviderTransform2.OUTPUT_TOKEN_MAX) || ProviderTransform2.OUTPUT_TOKEN_MAX;
14195
- }
14196
- ProviderTransform2.maxOutputTokens = maxOutputTokens;
14197
- function schema(model, schema2) {
14198
- if (model.providerID === "google" || model.api.id.includes("gemini")) {
14199
- const isPlainObject = (node) => typeof node === "object" && node !== null && !Array.isArray(node);
14200
- const hasCombiner = (node) => isPlainObject(node) && (Array.isArray(node.anyOf) || Array.isArray(node.oneOf) || Array.isArray(node.allOf));
14201
- const hasSchemaIntent = (node) => {
14202
- if (!isPlainObject(node)) return false;
14203
- if (hasCombiner(node)) return true;
14204
- return [
14205
- "type",
14206
- "properties",
14207
- "items",
14208
- "prefixItems",
14209
- "enum",
14210
- "const",
14211
- "$ref",
14212
- "additionalProperties",
14213
- "patternProperties",
14214
- "required",
14215
- "not",
14216
- "if",
14217
- "then",
14218
- "else"
14219
- ].some((key) => key in node);
14220
- };
14221
- const sanitizeGemini = (obj) => {
14222
- if (obj === null || typeof obj !== "object") return obj;
14223
- if (Array.isArray(obj)) return obj.map(sanitizeGemini);
14224
- const result = {};
14225
- for (const [key, value] of Object.entries(obj)) {
14226
- if (key === "enum" && Array.isArray(value)) {
14227
- result[key] = value.map((v) => String(v));
14228
- if (result.type === "integer" || result.type === "number") result.type = "string";
14229
- } else if (typeof value === "object" && value !== null) {
14230
- result[key] = sanitizeGemini(value);
14231
- } else {
14232
- result[key] = value;
14233
- }
14234
- }
14235
- if (result.type === "object" && result.properties && Array.isArray(result.required)) {
14236
- result.required = result.required.filter((field) => field in result.properties);
14237
- }
14238
- if (result.type === "array" && !hasCombiner(result)) {
14239
- if (result.items == null) result.items = {};
14240
- if (isPlainObject(result.items) && !hasSchemaIntent(result.items)) result.items.type = "string";
14241
- }
14242
- if (result.type && result.type !== "object" && !hasCombiner(result)) {
14243
- delete result.properties;
14244
- delete result.required;
14245
14104
  }
14246
- return result;
14247
14105
  };
14248
- schema2 = sanitizeGemini(schema2);
14249
14106
  }
14250
- return schema2;
14107
+ },
14108
+ prompt: {
14109
+ provider(model) {
14110
+ if (!model.api.id.includes("claude")) return void 0;
14111
+ return [PROMPT_ANTHROPIC];
14112
+ }
14251
14113
  }
14252
- ProviderTransform2.schema = schema;
14253
- })(ProviderTransform || (ProviderTransform = {}));
14254
- var plan_txt_default = `<system-reminder>
14255
- # Plan Mode - System Reminder
14114
+ };
14115
+ var PROMPT_ANTHROPIC = `You are AnyCode, the best coding agent on the planet.
14256
14116
 
14257
- CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY FORBIDDEN:
14258
- ANY file edits, modifications, or system changes. Do NOT use sed, tee, echo, cat,
14259
- or ANY other bash command to manipulate files - commands may ONLY read/inspect.
14260
- This ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user
14261
- edit requests. You may ONLY observe, analyze, and plan. Any modification attempt
14262
- is a critical violation. ZERO exceptions.
14117
+ You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
14263
14118
 
14264
- ---
14119
+ IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
14265
14120
 
14266
- ## Responsibility
14121
+ If the user asks for help or wants to give feedback inform them of the following:
14122
+ - ctrl+p to list available actions
14123
+ - To give feedback, users should report the issue at
14124
+ https://github.com/wyattzheng/anycode
14267
14125
 
14268
- Your current responsibility is to think, read, search, and delegate explore agents to construct a well-formed plan that accomplishes the goal the user wants to achieve. Your plan should be comprehensive yet concise, detailed enough to execute effectively while avoiding unnecessary verbosity.
14126
+ When the user directly asks about AnyCode (eg. "can AnyCode do...", "does AnyCode have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific AnyCode feature (eg. implement a hook, write a slash command, or install an MCP server), use the WebFetch tool to gather information to answer the question from AnyCode docs. The list of available docs is available at https://anycode.ai/docs
14269
14127
 
14270
- Ask the user clarifying questions or ask for their opinion when weighing tradeoffs.
14128
+ # Tone and style
14129
+ - Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
14130
+ - Your output will be displayed on a command line interface. Your responses should be short and concise. You can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
14131
+ - Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
14132
+ - NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one. This includes markdown files.
14271
14133
 
14272
- **NOTE:** At any point in time through this workflow you should feel free to ask the user questions or clarifications. Don't make large assumptions about user intent. The goal is to present a well researched plan to the user, and tie any loose ends before implementation begins.
14134
+ # Professional objectivity
14135
+ Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving, providing direct, objective technical info without any unnecessary superlatives, praise, or emotional validation. It is best for the user if AnyCode honestly applies the same rigorous standards to all ideas and disagrees when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.
14273
14136
 
14274
- ---
14137
+ # Task Management
14138
+ You have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
14139
+ These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.
14275
14140
 
14276
- ## Important
14277
-
14278
- The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supersedes any other instructions you have received.
14279
- </system-reminder>
14280
- `;
14281
- var build_switch_txt_default = `<system-reminder>
14282
- Your operational mode has changed from plan to build.
14283
- You are no longer in read-only mode.
14284
- You are permitted to make file changes, run shell commands, and utilize your arsenal of tools as needed.
14285
- </system-reminder>
14286
- `;
14287
- var log = Log.create({ module: "hooks" });
14288
- var Hooks;
14289
- ((Hooks2) => {
14290
- const DEFAULT_TIMEOUT = 15;
14291
- function toSnakeCase(key) {
14292
- return key.replace(/[A-Z]/g, (ch) => "_" + ch.toLowerCase());
14293
- }
14294
- function keysToSnakeCase(obj) {
14295
- if (obj === null || obj === void 0 || typeof obj !== "object") return obj;
14296
- if (Array.isArray(obj)) return obj.map(keysToSnakeCase);
14297
- const out = {};
14298
- for (const [key, value] of Object.entries(obj)) {
14299
- out[toSnakeCase(key)] = keysToSnakeCase(value);
14300
- }
14301
- return out;
14302
- }
14303
- function matchTool(rules, toolName, filePath) {
14304
- const matched = [];
14305
- for (const rule of rules) {
14306
- try {
14307
- if (!new RegExp(rule.matcher, "i").test(toolName)) continue;
14308
- if (filePath && rule.ignore?.some((pat) => {
14309
- try {
14310
- return new RegExp(pat, "i").test(filePath);
14311
- } catch {
14312
- return false;
14313
- }
14314
- })) continue;
14315
- matched.push(...rule.hooks);
14316
- } catch {
14317
- }
14318
- }
14319
- return matched;
14320
- }
14321
- Hooks2.matchTool = matchTool;
14322
- function execute(hook, payload, cwd) {
14323
- const timeout = (hook.timeout ?? DEFAULT_TIMEOUT) * 1e3;
14324
- const payloadStr = JSON.stringify(payload);
14325
- try {
14326
- const proc = spawn("bash", ["-c", hook.command], {
14327
- cwd,
14328
- stdio: ["pipe", "ignore", "ignore"],
14329
- env: process.env,
14330
- detached: true
14331
- });
14332
- proc.unref();
14333
- proc.stdin?.write(payloadStr);
14334
- proc.stdin?.end();
14335
- const timer = setTimeout(() => {
14336
- try {
14337
- proc.kill("SIGTERM");
14338
- } catch {
14339
- }
14340
- }, timeout);
14341
- proc.on("exit", () => clearTimeout(timer));
14342
- proc.on("error", () => clearTimeout(timer));
14343
- } catch (err) {
14344
- log.info(`Hook execution failed: ${err}`);
14345
- }
14346
- }
14347
- function runPostToolUse(hooksConfig, toolName, toolInput, toolResponse, sessionID, cwd) {
14348
- const rules = hooksConfig["PostToolUse"];
14349
- if (!rules || rules.length === 0) return;
14350
- const filePath = toolInput?.filePath ?? toolInput?.file_path;
14351
- const hooks = matchTool(rules, toolName, filePath);
14352
- if (hooks.length === 0) return;
14353
- const payload = {
14354
- session_id: sessionID,
14355
- cwd,
14356
- hook_event_name: "PostToolUse",
14357
- tool_name: toolName,
14358
- tool_input: keysToSnakeCase(toolInput),
14359
- tool_response: keysToSnakeCase(toolResponse)
14360
- };
14361
- for (const hook of hooks) {
14362
- execute(hook, payload, cwd);
14363
- }
14364
- }
14365
- Hooks2.runPostToolUse = runPostToolUse;
14366
- })(Hooks || (Hooks = {}));
14367
- var anthropic_txt_default = `You are AnyCode, the best coding agent on the planet.
14368
-
14369
- You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
14370
-
14371
- IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
14372
-
14373
- If the user asks for help or wants to give feedback inform them of the following:
14374
- - ctrl+p to list available actions
14375
- - To give feedback, users should report the issue at
14376
- https://github.com/wyattzheng/anycode
14377
-
14378
- When the user directly asks about AnyCode (eg. "can AnyCode do...", "does AnyCode have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific AnyCode feature (eg. implement a hook, write a slash command, or install an MCP server), use the WebFetch tool to gather information to answer the question from AnyCode docs. The list of available docs is available at https://anycode.ai/docs
14379
-
14380
- # Tone and style
14381
- - Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
14382
- - Your output will be displayed on a command line interface. Your responses should be short and concise. You can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
14383
- - Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
14384
- - NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one. This includes markdown files.
14385
-
14386
- # Professional objectivity
14387
- Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving, providing direct, objective technical info without any unnecessary superlatives, praise, or emotional validation. It is best for the user if AnyCode honestly applies the same rigorous standards to all ideas and disagrees when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.
14388
-
14389
- # Task Management
14390
- You have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
14391
- These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.
14392
-
14393
- It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.
14141
+ It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.
14394
14142
 
14395
14143
  Examples:
14396
14144
 
@@ -14471,117 +14219,401 @@ assistant: Clients are marked as failed in the \`connectToServer\` function in s
14471
14219
  </example>
14472
14220
  `;
14473
14221
  var CLAUDE_CODE_SYSTEM = "You are Claude Code, Anthropic's official CLI for Claude.";
14474
- var qwen_txt_default = `You are anycode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
14222
+ var githubCopilotVendor = {
14223
+ id: "github-copilot",
14224
+ matchesRuntime({ model, provider }) {
14225
+ return provider.id?.includes("github-copilot") === true || model.providerID?.includes("github-copilot") === true;
14226
+ },
14227
+ llm: {
14228
+ disableMaxOutputTokens() {
14229
+ return true;
14230
+ }
14231
+ }
14232
+ };
14233
+ var googleVendor = {
14234
+ id: "google",
14235
+ npms: ["@ai-sdk/google"],
14236
+ bundled: {
14237
+ "@ai-sdk/google": createGoogleGenerativeAI
14238
+ },
14239
+ sdkKeys: {
14240
+ "@ai-sdk/google": "google"
14241
+ },
14242
+ transform: {
14243
+ options({ model }) {
14244
+ if (model.api.npm !== "@ai-sdk/google") return {};
14245
+ const thinkingConfig = { includeThoughts: true };
14246
+ if (model.api.id.includes("gemini-3")) {
14247
+ thinkingConfig["thinkingLevel"] = "high";
14248
+ }
14249
+ return { thinkingConfig };
14250
+ },
14251
+ smallOptions(model) {
14252
+ if (model.providerID !== "google") return {};
14253
+ if (model.api.id.includes("gemini-3")) {
14254
+ return { thinkingConfig: { thinkingLevel: "minimal" } };
14255
+ }
14256
+ return { thinkingConfig: { thinkingBudget: 0 } };
14257
+ },
14258
+ temperature(model) {
14259
+ return model.id.toLowerCase().includes("gemini") ? 1 : void 0;
14260
+ },
14261
+ topK(model) {
14262
+ return model.id.toLowerCase().includes("gemini") ? 64 : void 0;
14263
+ },
14264
+ schema(model, schema) {
14265
+ if (!(model.providerID === "google" || model.api.id.includes("gemini"))) return schema;
14266
+ const isPlainObject = (node) => typeof node === "object" && node !== null && !Array.isArray(node);
14267
+ const hasCombiner = (node) => isPlainObject(node) && (Array.isArray(node.anyOf) || Array.isArray(node.oneOf) || Array.isArray(node.allOf));
14268
+ const hasSchemaIntent = (node) => {
14269
+ if (!isPlainObject(node)) return false;
14270
+ if (hasCombiner(node)) return true;
14271
+ return [
14272
+ "type",
14273
+ "properties",
14274
+ "items",
14275
+ "prefixItems",
14276
+ "enum",
14277
+ "const",
14278
+ "$ref",
14279
+ "additionalProperties",
14280
+ "patternProperties",
14281
+ "required",
14282
+ "not",
14283
+ "if",
14284
+ "then",
14285
+ "else"
14286
+ ].some((key) => key in node);
14287
+ };
14288
+ const sanitize = (obj) => {
14289
+ if (obj === null || typeof obj !== "object") return obj;
14290
+ if (Array.isArray(obj)) return obj.map(sanitize);
14291
+ const result = {};
14292
+ for (const [key, value] of Object.entries(obj)) {
14293
+ if (key === "enum" && Array.isArray(value)) {
14294
+ result[key] = value.map((v) => String(v));
14295
+ if (result.type === "integer" || result.type === "number") result.type = "string";
14296
+ } else if (typeof value === "object" && value !== null) {
14297
+ result[key] = sanitize(value);
14298
+ } else {
14299
+ result[key] = value;
14300
+ }
14301
+ }
14302
+ if (result.type === "object" && result.properties && Array.isArray(result.required)) {
14303
+ result.required = result.required.filter((field) => field in result.properties);
14304
+ }
14305
+ if (result.type === "array" && !hasCombiner(result)) {
14306
+ if (result.items == null) result.items = {};
14307
+ if (isPlainObject(result.items) && !hasSchemaIntent(result.items)) result.items.type = "string";
14308
+ }
14309
+ if (result.type && result.type !== "object" && !hasCombiner(result)) {
14310
+ delete result.properties;
14311
+ delete result.required;
14312
+ }
14313
+ return result;
14314
+ };
14315
+ return sanitize(schema);
14316
+ }
14317
+ },
14318
+ prompt: {
14319
+ provider(model) {
14320
+ if (!model.api.id.includes("gemini-")) return void 0;
14321
+ return [PROMPT_GEMINI];
14322
+ }
14323
+ }
14324
+ };
14325
+ var PROMPT_GEMINI = `You are anycode, an interactive CLI agent specializing in software engineering tasks. Your primary goal is to help users safely and efficiently, adhering strictly to the following instructions and utilizing your available tools.
14475
14326
 
14476
- IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
14477
- IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
14478
- IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
14327
+ # Core Mandates
14479
14328
 
14480
- If the user asks for help or wants to give feedback inform them of the following:
14481
- - /help: Get help with using anycode
14482
- - To give feedback, users should report the issue at https://github.com/wyattzheng/anycode/issues
14329
+ - **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first.
14330
+ - **Libraries/Frameworks:** NEVER assume a library/framework is available or appropriate. Verify its established usage within the project (check imports, configuration files like 'package.json', 'Cargo.toml', 'requirements.txt', 'build.gradle', etc., or observe neighboring files) before employing it.
14331
+ - **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code in the project.
14332
+ - **Idiomatic Changes:** When editing, understand the local context (imports, functions/classes) to ensure your changes integrate naturally and idiomatically.
14333
+ - **Comments:** Add code comments sparingly. Focus on *why* something is done, especially for complex logic, rather than *what* is done. Only add high-value comments if necessary for clarity or if requested by the user. Do not edit comments that are separate from the code you are changing. *NEVER* talk to the user or describe your changes through comments.
14334
+ - **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
14335
+ - **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.
14336
+ - **Explaining Changes:** After completing a code modification or file operation *do not* provide summaries unless asked.
14337
+ - **Path Construction:** Before using any file system tool (e.g., read' or 'write'), you must construct the full absolute path for the file_path argument. Always combine the absolute path of the project's root directory with the file's path relative to the root. For example, if the project root is /path/to/project/ and the file is foo/bar/baz.txt, the final path you must use is /path/to/project/foo/bar/baz.txt. If the user provides a relative path, you must resolve it against the root directory to create an absolute path.
14338
+ - **Do Not revert changes:** Do not revert changes to the codebase unless asked to do so by the user. Only revert changes made by you if they have resulted in an error or if the user has explicitly asked you to revert the changes.
14483
14339
 
14484
- When the user directly asks about anycode (eg 'can anycode do...', 'does anycode have...') or asks in second person (eg 'are you able...', 'can you do...'), first use the WebFetch tool to gather information to answer the question from anycode docs at https://anycode.ai
14340
+ # Primary Workflows
14485
14341
 
14486
- # Tone and style
14487
- You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
14488
- Remember that your output will be displayed on a command line interface. Your responses can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
14489
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
14490
- If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
14491
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
14492
- IMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.
14493
- IMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.
14494
- IMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...". Here are some examples to demonstrate appropriate verbosity:
14342
+ ## Software Engineering Tasks
14343
+ When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
14344
+ 1. **Understand:** Think about the user's request and the relevant codebase context. Use 'grep' and 'glob' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use 'read' to understand context and validate any assumptions you may have.
14345
+ 2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should try to use a self-verification loop by writing unit tests if relevant to the task. Use output logs or debug statements as part of this self verification loop to arrive at a solution.
14346
+ 3. **Implement:** Use the available tools (e.g., 'edit', 'write' 'bash' ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core Mandates').
14347
+ 4. **Verify (Tests):** If applicable and feasible, verify the changes using the project's testing procedures. Identify the correct test commands and frameworks by examining 'README' files, build/package configuration (e.g., 'package.json'), or existing test execution patterns. NEVER assume standard test commands.
14348
+ 5. **Verify (Standards):** VERY IMPORTANT: After making code changes, execute the project-specific build, linting and type-checking commands (e.g., 'tsc', 'npm run lint', 'ruff check .') that you have identified for this project (or obtained from the user). This ensures code quality and adherence to standards. If unsure about these commands, you can ask the user if they'd like you to run them and if so how to.
14349
+
14350
+ ## New Applications
14351
+
14352
+ **Goal:** Autonomously implement and deliver a visually appealing, substantially complete, and functional prototype. Utilize all tools at your disposal to implement the application. Some tools you may especially find useful are 'write', 'edit' and 'bash'.
14353
+
14354
+ 1. **Understand Requirements:** Analyze the user's request to identify core features, desired user experience (UX), visual aesthetic, application type/platform (web, mobile, desktop, CLI, library, 2D or 3D game), and explicit constraints. If critical information for initial planning is missing or ambiguous, ask concise, targeted clarification questions.
14355
+ 2. **Propose Plan:** Formulate an internal development plan. Present a clear, concise, high-level summary to the user. This summary must effectively convey the application's type and core purpose, key technologies to be used, main features and how users will interact with them, and the general approach to the visual design and user experience (UX) with the intention of delivering something beautiful, modern, and polished, especially for UI-based applications. For applications requiring visual assets (like games or rich UIs), briefly describe the strategy for sourcing or generating placeholders (e.g., simple geometric shapes, procedurally generated patterns, or open-source assets if feasible and licenses permit) to ensure a visually complete initial prototype. Ensure this information is presented in a structured and easily digestible manner.
14356
+ 3. **User Approval:** Obtain user approval for the proposed plan.
14357
+ 4. **Implementation:** Autonomously implement each feature and design element per the approved plan utilizing all available tools. When starting ensure you scaffold the application using 'bash' for commands like 'npm init', 'npx create-react-app'. Aim for full scope completion. Proactively create or source necessary placeholder assets (e.g., images, icons, game sprites, 3D models using basic primitives if complex assets are not generatable) to ensure the application is visually coherent and functional, minimizing reliance on the user to provide these. If the model can generate simple assets (e.g., a uniformly colored square sprite, a simple 3D cube), it should do so. Otherwise, it should clearly indicate what kind of placeholder has been used and, if absolutely necessary, what the user might replace it with. Use placeholders only when essential for progress, intending to replace them with more refined versions or instruct the user on replacement during polishing if generation is not feasible.
14358
+ 5. **Verify:** Review work against the original request, the approved plan. Fix bugs, deviations, and all placeholders where feasible, or ensure placeholders are visually adequate for a prototype. Ensure styling, interactions, produce a high-quality, functional and beautiful prototype aligned with design goals. Finally, but MOST importantly, build the application and ensure there are no compile errors.
14359
+ 6. **Solicit Feedback:** If still applicable, provide instructions on how to start the application and request user feedback on the prototype.
14360
+
14361
+ # Operational Guidelines
14362
+
14363
+ ## Tone and Style (CLI Interaction)
14364
+ - **Concise & Direct:** Adopt a professional, direct, and concise tone suitable for a CLI environment.
14365
+ - **Minimal Output:** Aim for fewer than 3 lines of text output (excluding tool use/code generation) per response whenever practical. Focus strictly on the user's query.
14366
+ - **Clarity over Brevity (When Needed):** While conciseness is key, prioritize clarity for essential explanations or when seeking necessary clarification if a request is ambiguous.
14367
+ - **No Chitchat:** Avoid conversational filler, preambles ("Okay, I will now..."), or postambles ("I have finished the changes..."). Get straight to the action or answer.
14368
+ - **Formatting:** Use GitHub-flavored Markdown. Responses will be rendered in monospace.
14369
+ - **Tools vs. Text:** Use tools for actions, text output *only* for communication. Do not add explanatory comments within tool calls or code blocks unless specifically part of the required code/command itself.
14370
+ - **Handling Inability:** If unable/unwilling to fulfill a request, state so briefly (1-2 sentences) without excessive justification. Offer alternatives if appropriate.
14371
+
14372
+ ## Security and Safety Rules
14373
+ - **Explain Critical Commands:** Before executing commands with 'bash' that modify the file system, codebase, or system state, you *must* provide a brief explanation of the command's purpose and potential impact. Prioritize user understanding and safety. You should not ask permission to use the tool; the user will be presented with a confirmation dialogue upon use (you do not need to tell them this).
14374
+ - **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
14375
+
14376
+ ## Tool Usage
14377
+ - **File Paths:** Always use absolute paths when referring to files with tools like 'read' or 'write'. Relative paths are not supported. You must provide an absolute path.
14378
+ - **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
14379
+ - **Command Execution:** Use the 'bash' tool for running shell commands, remembering the safety rule to explain modifying commands first.
14380
+ - **Background Processes:** Use background processes (via \\\`&\\\`) for commands that are unlikely to stop on their own, e.g. \\\`node server.js &\\\`. If unsure, ask the user.
14381
+ - **Interactive Commands:** Try to avoid shell commands that are likely to require user interaction (e.g. \\\`git rebase -i\\\`). Use non-interactive versions of commands (e.g. \\\`npm init -y\\\` instead of \\\`npm init\\\`) when available, and otherwise remind the user that interactive shell commands are not supported and may cause hangs until canceled by the user.
14382
+ - **Respect User Confirmations:** Most tool calls (also denoted as 'function calls') will first require confirmation from the user, where they will either approve or cancel the function call. If a user cancels a function call, respect their choice and do _not_ try to make the function call again. It is okay to request the tool call again _only_ if the user requests that same tool call on a subsequent prompt. When a user cancels a function call, assume best intentions from the user and consider inquiring if they prefer any alternative paths forward.
14383
+
14384
+ ## Interaction Details
14385
+ - **Help Command:** The user can use '/help' to display help information.
14386
+ - **Feedback:** To report a bug or provide feedback, please use the /bug command.
14387
+
14388
+ # Examples (Illustrating Tone and Workflow)
14495
14389
  <example>
14496
- user: 2 + 2
14497
- assistant: 4
14390
+ user: 1 + 2
14391
+ model: 3
14498
14392
  </example>
14499
14393
 
14500
14394
  <example>
14501
- user: what is 2+2?
14502
- assistant: 4
14395
+ user: is 13 a prime number?
14396
+ model: true
14503
14397
  </example>
14504
14398
 
14505
14399
  <example>
14506
- user: is 11 a prime number?
14507
- assistant: Yes
14400
+ user: list files here.
14401
+ model: [tool_call: ls for path '/path/to/project']
14508
14402
  </example>
14509
14403
 
14510
14404
  <example>
14511
- user: what command should I run to list files in the current directory?
14512
- assistant: ls
14405
+ user: start the server implemented in server.js
14406
+ model: [tool_call: bash for 'node server.js &' because it must run in the background]
14513
14407
  </example>
14514
14408
 
14515
14409
  <example>
14516
- user: what command should I run to watch files in the current directory?
14517
- assistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]
14518
- npm run dev
14519
- </example>
14410
+ user: Refactor the auth logic in src/auth.py to use the requests library instead of urllib.
14411
+ model: Okay, I can refactor 'src/auth.py'.
14412
+ First, I'll analyze the code and check for a test safety net before planning any changes.
14413
+ [tool_call: glob for path 'tests/test_auth.py']
14414
+ [tool_call: read for absolute_path '/path/to/tests/test_auth.py']
14415
+ (After analysis)
14416
+ Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
14417
+ I'll also confirm 'requests' is a dependency.
14418
+ [tool_call: read for absolute_path '/path/to/requirements.txt']
14419
+ (After analysis)
14420
+ Looks good, 'requests' is available.
14421
+
14422
+ Here's the plan:
14423
+ 1. Replace the 'urllib' calls with 'requests'.
14424
+ 2. Add proper 'try...except' error handling for the new network calls.
14425
+ 3. Remove the old 'urllib' import.
14426
+ 4. Run the project's linter and tests to verify the changes.
14427
+
14428
+ Should I proceed?
14429
+ user: Yes
14430
+ model:
14431
+ [tool_call: write or edit to apply the refactoring to 'src/auth.py']
14432
+ Refactoring complete. Running verification...
14433
+ [tool_call: bash for 'ruff check src/auth.py && pytest']
14434
+ (After verification passes)
14435
+ All checks passed. This is a stable checkpoint.
14520
14436
 
14521
14437
  <example>
14522
- user: How many golf balls fit inside a jetta?
14523
- assistant: 150000
14438
+ user: Delete the temp directory.
14439
+ model: I can run \\\`rm -rf /path/to/project/temp\\\`. This will permanently delete the directory and all its contents.
14524
14440
  </example>
14525
14441
 
14526
14442
  <example>
14527
- user: what files are in the directory src/?
14528
- assistant: [runs ls and sees foo.c, bar.c, baz.c]
14529
- user: which file contains the implementation of foo?
14530
- assistant: src/foo.c
14443
+ user: Write tests for someFile.ts
14444
+ model:
14445
+ Okay, I can write those tests. First, I'll read \\\`someFile.ts\\\` to understand its functionality.
14446
+ [tool_call: read for absolute_path '/path/to/someFile.ts' or use glob to find \\\`someFile.ts\\\` if its location is unknown]
14447
+ Now I'll look for existing or related test files to understand current testing conventions and dependencies.
14448
+ [tool_call: glob for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
14449
+ (After reviewing existing tests and the file content)
14450
+ [tool_call: write to create /path/to/someFile.test.ts with the test code]
14451
+ I've written the tests. Now I'll run the project's test command to verify them.
14452
+ [tool_call: bash for 'npm run test']
14531
14453
  </example>
14532
14454
 
14533
14455
  <example>
14534
- user: write tests for new feature
14535
- assistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]
14456
+ user: How do I update the user's profile information in this system?
14457
+ model:
14458
+ I'm not immediately sure how user profile information is updated. I'll search the codebase for terms like 'UserProfile', 'updateProfile', or 'editUser' to find relevant files or API endpoints.
14459
+ [tool_call: grep for pattern 'UserProfile|updateProfile|editUser']
14460
+ (After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
14461
+ Okay, \\\`/path/to/UserProfileService.java\\\` seems like the most relevant file. I'll read its content to understand how updates are handled.
14462
+ [tool_call: read for absolute_path '/path/to/UserProfileService.java']
14463
+ (After reading the file)
14464
+ It appears the \\\`updateUserProfile\\\` method in \\\`UserProfileService.java\\\` is responsible for this. It expects a user ID and a \\\`UserProfileDTO\\\` object...
14536
14465
  </example>
14537
14466
 
14538
- # Proactiveness
14539
- You are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:
14540
- 1. Doing the right thing when asked, including taking actions and follow-up actions
14541
- 2. Not surprising the user with actions you take without asking
14542
- For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.
14543
- 3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.
14544
-
14545
- # Following conventions
14546
- When making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.
14547
- - NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).
14548
- - When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.
14549
- - When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.
14550
- - Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.
14551
-
14552
- # Code style
14553
- - IMPORTANT: DO NOT ADD ***ANY*** COMMENTS unless asked
14554
-
14555
- # Doing tasks
14556
- The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
14557
- - Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.
14558
- - Implement the solution using all tools available to you
14559
- - Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.
14560
- - VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (e.g. npm run lint, npm run typecheck, ruff, etc.) with Bash if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to AGENTS.md so that you will know to run it next time.
14561
- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
14562
-
14563
- - Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.
14564
-
14565
- # Tool usage policy
14566
- - When doing file search, prefer to use the Task tool in order to reduce context usage.
14567
- - You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run "git status" and "git diff", send a single message with two tool calls to run the calls in parallel.
14568
-
14569
- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.
14570
-
14571
- IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
14572
- IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
14573
-
14574
- # Code References
14575
-
14576
- When referencing specific functions or pieces of code include the pattern \`file_path:line_number\` to allow the user to easily navigate to the source code location.
14577
-
14578
14467
  <example>
14579
- user: Where are errors from the client handled?
14580
- assistant: Clients are marked as failed in the \`connectToServer\` function in src/services/process.ts:712.
14468
+ user: Where are all the 'app.config' files in this project? I need to check their settings.
14469
+ model:
14470
+ [tool_call: glob for pattern '**/app.config']
14471
+ (Assuming GlobTool returns a list of paths like ['/path/to/moduleA/app.config', '/path/to/moduleB/app.config'])
14472
+ I found the following 'app.config' files:
14473
+ - /path/to/moduleA/app.config
14474
+ - /path/to/moduleB/app.config
14475
+ To help you check their settings, I can read their contents. Which one would you like to start with, or should I read all of them?
14581
14476
  </example>
14582
14477
 
14478
+ # Final Reminder
14479
+ Your core function is efficient and safe assistance. Balance extreme conciseness with the crucial need for clarity, especially regarding safety and potential system modifications. Always prioritize user control and project conventions. Never make assumptions about the contents of files; instead use 'read' to ensure you aren't making broad assumptions. Finally, you are an agent - please keep going until the user's query is completely resolved.
14583
14480
  `;
14584
- var beast_txt_default = `You are anycode, an agent - please keep going until the user\u2019s query is completely resolved, before ending your turn and yielding back to the user.
14481
+ var liteLLMVendor = {
14482
+ id: "litellm",
14483
+ matchesRuntime({ model, provider }) {
14484
+ return provider.options?.["litellmProxy"] === true || provider.id?.toLowerCase().includes("litellm") === true || model.providerID?.toLowerCase().includes("litellm") === true || model.api.id.toLowerCase().includes("litellm");
14485
+ },
14486
+ llm: {
14487
+ needsNoopToolFallback() {
14488
+ return true;
14489
+ }
14490
+ }
14491
+ };
14492
+ var openAIVendor = {
14493
+ id: "openai",
14494
+ npms: ["@ai-sdk/openai", "@ai-sdk/openai-compatible"],
14495
+ bundled: {
14496
+ "@ai-sdk/openai": createOpenAI,
14497
+ "@ai-sdk/openai-compatible": createOpenAICompatible
14498
+ },
14499
+ sdkKeys: {
14500
+ "@ai-sdk/openai": "openai",
14501
+ "@ai-sdk/openai-compatible": "openaiCompatible"
14502
+ },
14503
+ async customLoader() {
14504
+ return {
14505
+ autoload: false,
14506
+ async getModel(sdk, modelID, _options) {
14507
+ if (typeof sdk.responses === "function") {
14508
+ return sdk.responses(modelID);
14509
+ }
14510
+ return sdk.languageModel(modelID);
14511
+ },
14512
+ options: {}
14513
+ };
14514
+ },
14515
+ patchRequest({ opts, model }) {
14516
+ if (opts.body && opts.method === "POST") {
14517
+ try {
14518
+ const body = JSON.parse(opts.body);
14519
+ const isAzure = model.providerID?.includes("azure");
14520
+ const keepIds = isAzure && body.store === true;
14521
+ if (!keepIds && Array.isArray(body.input)) {
14522
+ for (const item of body.input) {
14523
+ if ("id" in item) delete item.id;
14524
+ }
14525
+ opts.body = JSON.stringify(body);
14526
+ }
14527
+ } catch {
14528
+ }
14529
+ }
14530
+ },
14531
+ transform: {
14532
+ message(msgs, model) {
14533
+ if (!(model.api.npm === "@ai-sdk/openai-compatible" && typeof model.capabilities.interleaved === "object" && model.capabilities.interleaved.field)) {
14534
+ return msgs;
14535
+ }
14536
+ const field = model.capabilities.interleaved.field;
14537
+ return msgs.map((msg) => {
14538
+ if (msg.role === "assistant" && Array.isArray(msg.content)) {
14539
+ const reasoningParts = msg.content.filter((part) => part.type === "reasoning");
14540
+ const reasoningText = reasoningParts.map((part) => part.text).join("");
14541
+ const filteredContent = msg.content.filter((part) => part.type !== "reasoning");
14542
+ if (reasoningText) {
14543
+ return {
14544
+ ...msg,
14545
+ content: filteredContent,
14546
+ providerOptions: {
14547
+ ...msg.providerOptions,
14548
+ openaiCompatible: {
14549
+ ...msg.providerOptions?.openaiCompatible,
14550
+ [field]: reasoningText
14551
+ }
14552
+ }
14553
+ };
14554
+ }
14555
+ return { ...msg, content: filteredContent };
14556
+ }
14557
+ return msg;
14558
+ });
14559
+ },
14560
+ options({ model, sessionID, providerOptions }) {
14561
+ const result = {};
14562
+ if (model.providerID === "openai" || model.api.npm === "@ai-sdk/openai") {
14563
+ result["store"] = false;
14564
+ }
14565
+ if (model.providerID === "openai" || providerOptions?.setCacheKey) {
14566
+ result["promptCacheKey"] = sessionID;
14567
+ }
14568
+ if (model.api.id.includes("gpt-5") && !model.api.id.includes("gpt-5-chat")) {
14569
+ if (!model.api.id.includes("gpt-5-pro")) {
14570
+ result["reasoningEffort"] = "high";
14571
+ result["reasoningSummary"] = "auto";
14572
+ }
14573
+ if (model.api.id.includes("gpt-5.") && !model.api.id.includes("codex") && !model.api.id.includes("-chat")) {
14574
+ result["textVerbosity"] = "low";
14575
+ }
14576
+ }
14577
+ return result;
14578
+ },
14579
+ smallOptions(model) {
14580
+ if (!(model.providerID === "openai" || model.api.npm === "@ai-sdk/openai")) return {};
14581
+ if (model.api.id.includes("gpt-5")) {
14582
+ if (model.api.id.includes("5.")) return { store: false, reasoningEffort: "low" };
14583
+ return { store: false, reasoningEffort: "minimal" };
14584
+ }
14585
+ return { store: false };
14586
+ }
14587
+ },
14588
+ llm: {
14589
+ useInstructionPrompt({ provider, auth }) {
14590
+ return provider.id === "openai" && auth?.type === "oauth";
14591
+ },
14592
+ includeProviderSystemPrompt({ provider, auth }) {
14593
+ return !(provider.id === "openai" && auth?.type === "oauth");
14594
+ },
14595
+ disableMaxOutputTokens({ provider, auth }) {
14596
+ return provider.id === "openai" && auth?.type === "oauth";
14597
+ }
14598
+ },
14599
+ prompt: {
14600
+ provider(model) {
14601
+ if (model.api.id.toLowerCase().includes("trinity")) return [PROMPT_TRINITY];
14602
+ if (model.api.id.includes("gpt-5")) return [PROMPT_CODEX];
14603
+ if (model.api.id.includes("gpt-") || model.api.id.includes("o1") || model.api.id.includes("o3")) {
14604
+ return [PROMPT_BEAST];
14605
+ }
14606
+ if (model.api.id.includes("gemini-") || model.api.id.includes("claude")) return void 0;
14607
+ if (model.api.npm === "@ai-sdk/openai-compatible") return [PROMPT_ANTHROPIC_WITHOUT_TODO];
14608
+ return void 0;
14609
+ },
14610
+ instructions(model) {
14611
+ if (!model.api.id.includes("gpt-5")) return void 0;
14612
+ return PROMPT_CODEX.trim();
14613
+ }
14614
+ }
14615
+ };
14616
+ var PROMPT_BEAST = `You are anycode, an agent - please keep going until the user\u2019s query is completely resolved, before ending your turn and yielding back to the user.
14585
14617
 
14586
14618
  Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.
14587
14619
 
@@ -14729,163 +14761,7 @@ If the user tells you to stage and commit, you may do so.
14729
14761
 
14730
14762
  You are NEVER allowed to stage and commit files automatically.
14731
14763
  `;
14732
- var gemini_txt_default = `You are anycode, an interactive CLI agent specializing in software engineering tasks. Your primary goal is to help users safely and efficiently, adhering strictly to the following instructions and utilizing your available tools.
14733
-
14734
- # Core Mandates
14735
-
14736
- - **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first.
14737
- - **Libraries/Frameworks:** NEVER assume a library/framework is available or appropriate. Verify its established usage within the project (check imports, configuration files like 'package.json', 'Cargo.toml', 'requirements.txt', 'build.gradle', etc., or observe neighboring files) before employing it.
14738
- - **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code in the project.
14739
- - **Idiomatic Changes:** When editing, understand the local context (imports, functions/classes) to ensure your changes integrate naturally and idiomatically.
14740
- - **Comments:** Add code comments sparingly. Focus on *why* something is done, especially for complex logic, rather than *what* is done. Only add high-value comments if necessary for clarity or if requested by the user. Do not edit comments that are separate from the code you are changing. *NEVER* talk to the user or describe your changes through comments.
14741
- - **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
14742
- - **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.
14743
- - **Explaining Changes:** After completing a code modification or file operation *do not* provide summaries unless asked.
14744
- - **Path Construction:** Before using any file system tool (e.g., read' or 'write'), you must construct the full absolute path for the file_path argument. Always combine the absolute path of the project's root directory with the file's path relative to the root. For example, if the project root is /path/to/project/ and the file is foo/bar/baz.txt, the final path you must use is /path/to/project/foo/bar/baz.txt. If the user provides a relative path, you must resolve it against the root directory to create an absolute path.
14745
- - **Do Not revert changes:** Do not revert changes to the codebase unless asked to do so by the user. Only revert changes made by you if they have resulted in an error or if the user has explicitly asked you to revert the changes.
14746
-
14747
- # Primary Workflows
14748
-
14749
- ## Software Engineering Tasks
14750
- When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
14751
- 1. **Understand:** Think about the user's request and the relevant codebase context. Use 'grep' and 'glob' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use 'read' to understand context and validate any assumptions you may have.
14752
- 2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should try to use a self-verification loop by writing unit tests if relevant to the task. Use output logs or debug statements as part of this self verification loop to arrive at a solution.
14753
- 3. **Implement:** Use the available tools (e.g., 'edit', 'write' 'bash' ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core Mandates').
14754
- 4. **Verify (Tests):** If applicable and feasible, verify the changes using the project's testing procedures. Identify the correct test commands and frameworks by examining 'README' files, build/package configuration (e.g., 'package.json'), or existing test execution patterns. NEVER assume standard test commands.
14755
- 5. **Verify (Standards):** VERY IMPORTANT: After making code changes, execute the project-specific build, linting and type-checking commands (e.g., 'tsc', 'npm run lint', 'ruff check .') that you have identified for this project (or obtained from the user). This ensures code quality and adherence to standards. If unsure about these commands, you can ask the user if they'd like you to run them and if so how to.
14756
-
14757
- ## New Applications
14758
-
14759
- **Goal:** Autonomously implement and deliver a visually appealing, substantially complete, and functional prototype. Utilize all tools at your disposal to implement the application. Some tools you may especially find useful are 'write', 'edit' and 'bash'.
14760
-
14761
- 1. **Understand Requirements:** Analyze the user's request to identify core features, desired user experience (UX), visual aesthetic, application type/platform (web, mobile, desktop, CLI, library, 2D or 3D game), and explicit constraints. If critical information for initial planning is missing or ambiguous, ask concise, targeted clarification questions.
14762
- 2. **Propose Plan:** Formulate an internal development plan. Present a clear, concise, high-level summary to the user. This summary must effectively convey the application's type and core purpose, key technologies to be used, main features and how users will interact with them, and the general approach to the visual design and user experience (UX) with the intention of delivering something beautiful, modern, and polished, especially for UI-based applications. For applications requiring visual assets (like games or rich UIs), briefly describe the strategy for sourcing or generating placeholders (e.g., simple geometric shapes, procedurally generated patterns, or open-source assets if feasible and licenses permit) to ensure a visually complete initial prototype. Ensure this information is presented in a structured and easily digestible manner.
14763
- 3. **User Approval:** Obtain user approval for the proposed plan.
14764
- 4. **Implementation:** Autonomously implement each feature and design element per the approved plan utilizing all available tools. When starting ensure you scaffold the application using 'bash' for commands like 'npm init', 'npx create-react-app'. Aim for full scope completion. Proactively create or source necessary placeholder assets (e.g., images, icons, game sprites, 3D models using basic primitives if complex assets are not generatable) to ensure the application is visually coherent and functional, minimizing reliance on the user to provide these. If the model can generate simple assets (e.g., a uniformly colored square sprite, a simple 3D cube), it should do so. Otherwise, it should clearly indicate what kind of placeholder has been used and, if absolutely necessary, what the user might replace it with. Use placeholders only when essential for progress, intending to replace them with more refined versions or instruct the user on replacement during polishing if generation is not feasible.
14765
- 5. **Verify:** Review work against the original request, the approved plan. Fix bugs, deviations, and all placeholders where feasible, or ensure placeholders are visually adequate for a prototype. Ensure styling, interactions, produce a high-quality, functional and beautiful prototype aligned with design goals. Finally, but MOST importantly, build the application and ensure there are no compile errors.
14766
- 6. **Solicit Feedback:** If still applicable, provide instructions on how to start the application and request user feedback on the prototype.
14767
-
14768
- # Operational Guidelines
14769
-
14770
- ## Tone and Style (CLI Interaction)
14771
- - **Concise & Direct:** Adopt a professional, direct, and concise tone suitable for a CLI environment.
14772
- - **Minimal Output:** Aim for fewer than 3 lines of text output (excluding tool use/code generation) per response whenever practical. Focus strictly on the user's query.
14773
- - **Clarity over Brevity (When Needed):** While conciseness is key, prioritize clarity for essential explanations or when seeking necessary clarification if a request is ambiguous.
14774
- - **No Chitchat:** Avoid conversational filler, preambles ("Okay, I will now..."), or postambles ("I have finished the changes..."). Get straight to the action or answer.
14775
- - **Formatting:** Use GitHub-flavored Markdown. Responses will be rendered in monospace.
14776
- - **Tools vs. Text:** Use tools for actions, text output *only* for communication. Do not add explanatory comments within tool calls or code blocks unless specifically part of the required code/command itself.
14777
- - **Handling Inability:** If unable/unwilling to fulfill a request, state so briefly (1-2 sentences) without excessive justification. Offer alternatives if appropriate.
14778
-
14779
- ## Security and Safety Rules
14780
- - **Explain Critical Commands:** Before executing commands with 'bash' that modify the file system, codebase, or system state, you *must* provide a brief explanation of the command's purpose and potential impact. Prioritize user understanding and safety. You should not ask permission to use the tool; the user will be presented with a confirmation dialogue upon use (you do not need to tell them this).
14781
- - **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
14782
-
14783
- ## Tool Usage
14784
- - **File Paths:** Always use absolute paths when referring to files with tools like 'read' or 'write'. Relative paths are not supported. You must provide an absolute path.
14785
- - **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
14786
- - **Command Execution:** Use the 'bash' tool for running shell commands, remembering the safety rule to explain modifying commands first.
14787
- - **Background Processes:** Use background processes (via \\\`&\\\`) for commands that are unlikely to stop on their own, e.g. \\\`node server.js &\\\`. If unsure, ask the user.
14788
- - **Interactive Commands:** Try to avoid shell commands that are likely to require user interaction (e.g. \\\`git rebase -i\\\`). Use non-interactive versions of commands (e.g. \\\`npm init -y\\\` instead of \\\`npm init\\\`) when available, and otherwise remind the user that interactive shell commands are not supported and may cause hangs until canceled by the user.
14789
- - **Respect User Confirmations:** Most tool calls (also denoted as 'function calls') will first require confirmation from the user, where they will either approve or cancel the function call. If a user cancels a function call, respect their choice and do _not_ try to make the function call again. It is okay to request the tool call again _only_ if the user requests that same tool call on a subsequent prompt. When a user cancels a function call, assume best intentions from the user and consider inquiring if they prefer any alternative paths forward.
14790
-
14791
- ## Interaction Details
14792
- - **Help Command:** The user can use '/help' to display help information.
14793
- - **Feedback:** To report a bug or provide feedback, please use the /bug command.
14794
-
14795
- # Examples (Illustrating Tone and Workflow)
14796
- <example>
14797
- user: 1 + 2
14798
- model: 3
14799
- </example>
14800
-
14801
- <example>
14802
- user: is 13 a prime number?
14803
- model: true
14804
- </example>
14805
-
14806
- <example>
14807
- user: list files here.
14808
- model: [tool_call: ls for path '/path/to/project']
14809
- </example>
14810
-
14811
- <example>
14812
- user: start the server implemented in server.js
14813
- model: [tool_call: bash for 'node server.js &' because it must run in the background]
14814
- </example>
14815
-
14816
- <example>
14817
- user: Refactor the auth logic in src/auth.py to use the requests library instead of urllib.
14818
- model: Okay, I can refactor 'src/auth.py'.
14819
- First, I'll analyze the code and check for a test safety net before planning any changes.
14820
- [tool_call: glob for path 'tests/test_auth.py']
14821
- [tool_call: read for absolute_path '/path/to/tests/test_auth.py']
14822
- (After analysis)
14823
- Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
14824
- I'll also confirm 'requests' is a dependency.
14825
- [tool_call: read for absolute_path '/path/to/requirements.txt']
14826
- (After analysis)
14827
- Looks good, 'requests' is available.
14828
-
14829
- Here's the plan:
14830
- 1. Replace the 'urllib' calls with 'requests'.
14831
- 2. Add proper 'try...except' error handling for the new network calls.
14832
- 3. Remove the old 'urllib' import.
14833
- 4. Run the project's linter and tests to verify the changes.
14834
-
14835
- Should I proceed?
14836
- user: Yes
14837
- model:
14838
- [tool_call: write or edit to apply the refactoring to 'src/auth.py']
14839
- Refactoring complete. Running verification...
14840
- [tool_call: bash for 'ruff check src/auth.py && pytest']
14841
- (After verification passes)
14842
- All checks passed. This is a stable checkpoint.
14843
-
14844
- <example>
14845
- user: Delete the temp directory.
14846
- model: I can run \\\`rm -rf /path/to/project/temp\\\`. This will permanently delete the directory and all its contents.
14847
- </example>
14848
-
14849
- <example>
14850
- user: Write tests for someFile.ts
14851
- model:
14852
- Okay, I can write those tests. First, I'll read \\\`someFile.ts\\\` to understand its functionality.
14853
- [tool_call: read for absolute_path '/path/to/someFile.ts' or use glob to find \\\`someFile.ts\\\` if its location is unknown]
14854
- Now I'll look for existing or related test files to understand current testing conventions and dependencies.
14855
- [tool_call: glob for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
14856
- (After reviewing existing tests and the file content)
14857
- [tool_call: write to create /path/to/someFile.test.ts with the test code]
14858
- I've written the tests. Now I'll run the project's test command to verify them.
14859
- [tool_call: bash for 'npm run test']
14860
- </example>
14861
-
14862
- <example>
14863
- user: How do I update the user's profile information in this system?
14864
- model:
14865
- I'm not immediately sure how user profile information is updated. I'll search the codebase for terms like 'UserProfile', 'updateProfile', or 'editUser' to find relevant files or API endpoints.
14866
- [tool_call: grep for pattern 'UserProfile|updateProfile|editUser']
14867
- (After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
14868
- Okay, \\\`/path/to/UserProfileService.java\\\` seems like the most relevant file. I'll read its content to understand how updates are handled.
14869
- [tool_call: read for absolute_path '/path/to/UserProfileService.java']
14870
- (After reading the file)
14871
- It appears the \\\`updateUserProfile\\\` method in \\\`UserProfileService.java\\\` is responsible for this. It expects a user ID and a \\\`UserProfileDTO\\\` object...
14872
- </example>
14873
-
14874
- <example>
14875
- user: Where are all the 'app.config' files in this project? I need to check their settings.
14876
- model:
14877
- [tool_call: glob for pattern '**/app.config']
14878
- (Assuming GlobTool returns a list of paths like ['/path/to/moduleA/app.config', '/path/to/moduleB/app.config'])
14879
- I found the following 'app.config' files:
14880
- - /path/to/moduleA/app.config
14881
- - /path/to/moduleB/app.config
14882
- To help you check their settings, I can read their contents. Which one would you like to start with, or should I read all of them?
14883
- </example>
14884
-
14885
- # Final Reminder
14886
- Your core function is efficient and safe assistance. Balance extreme conciseness with the crucial need for clarity, especially regarding safety and potential system modifications. Always prioritize user control and project conventions. Never make assumptions about the contents of files; instead use 'read' to ensure you aren't making broad assumptions. Finally, you are an agent - please keep going until the user's query is completely resolved.
14887
- `;
14888
- var codex_header_txt_default = `You are AnyCode, the best coding agent on the planet.
14764
+ var PROMPT_CODEX = `You are AnyCode, the best coding agent on the planet.
14889
14765
 
14890
14766
  You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
14891
14767
 
@@ -14965,7 +14841,117 @@ You are producing plain text that will later be styled by the CLI. Follow these
14965
14841
  * Do not provide range of lines
14966
14842
  * Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\\repo\\project\\main.rs:12:5
14967
14843
  `;
14968
- var trinity_txt_default = `You are anycode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
14844
+ var PROMPT_ANTHROPIC_WITHOUT_TODO = `You are anycode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
14845
+
14846
+ IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
14847
+ IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
14848
+ IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
14849
+
14850
+ If the user asks for help or wants to give feedback inform them of the following:
14851
+ - /help: Get help with using anycode
14852
+ - To give feedback, users should report the issue at https://github.com/wyattzheng/anycode/issues
14853
+
14854
+ When the user directly asks about anycode (eg 'can anycode do...', 'does anycode have...') or asks in second person (eg 'are you able...', 'can you do...'), first use the WebFetch tool to gather information to answer the question from anycode docs at https://anycode.ai
14855
+
14856
+ # Tone and style
14857
+ You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
14858
+ Remember that your output will be displayed on a command line interface. Your responses can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
14859
+ Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
14860
+ If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
14861
+ Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
14862
+ IMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.
14863
+ IMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.
14864
+ IMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...". Here are some examples to demonstrate appropriate verbosity:
14865
+ <example>
14866
+ user: 2 + 2
14867
+ assistant: 4
14868
+ </example>
14869
+
14870
+ <example>
14871
+ user: what is 2+2?
14872
+ assistant: 4
14873
+ </example>
14874
+
14875
+ <example>
14876
+ user: is 11 a prime number?
14877
+ assistant: Yes
14878
+ </example>
14879
+
14880
+ <example>
14881
+ user: what command should I run to list files in the current directory?
14882
+ assistant: ls
14883
+ </example>
14884
+
14885
+ <example>
14886
+ user: what command should I run to watch files in the current directory?
14887
+ assistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]
14888
+ npm run dev
14889
+ </example>
14890
+
14891
+ <example>
14892
+ user: How many golf balls fit inside a jetta?
14893
+ assistant: 150000
14894
+ </example>
14895
+
14896
+ <example>
14897
+ user: what files are in the directory src/?
14898
+ assistant: [runs ls and sees foo.c, bar.c, baz.c]
14899
+ user: which file contains the implementation of foo?
14900
+ assistant: src/foo.c
14901
+ </example>
14902
+
14903
+ <example>
14904
+ user: write tests for new feature
14905
+ assistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]
14906
+ </example>
14907
+
14908
+ # Proactiveness
14909
+ You are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:
14910
+ 1. Doing the right thing when asked, including taking actions and follow-up actions
14911
+ 2. Not surprising the user with actions you take without asking
14912
+ For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.
14913
+ 3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.
14914
+
14915
+ # Following conventions
14916
+ When making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.
14917
+ - NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).
14918
+ - When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.
14919
+ - When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.
14920
+ - Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.
14921
+
14922
+ # Code style
14923
+ - IMPORTANT: DO NOT ADD ***ANY*** COMMENTS unless asked
14924
+
14925
+ # Doing tasks
14926
+ The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
14927
+ - Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.
14928
+ - Implement the solution using all tools available to you
14929
+ - Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.
14930
+ - VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (e.g. npm run lint, npm run typecheck, ruff, etc.) with Bash if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to AGENTS.md so that you will know to run it next time.
14931
+ NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
14932
+
14933
+ - Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.
14934
+
14935
+ # Tool usage policy
14936
+ - When doing file search, prefer to use the Task tool in order to reduce context usage.
14937
+ - You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run "git status" and "git diff", send a single message with two tool calls to run the calls in parallel.
14938
+
14939
+ You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.
14940
+
14941
+ IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
14942
+ IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
14943
+
14944
+ # Code References
14945
+
14946
+ When referencing specific functions or pieces of code include the pattern \`file_path:line_number\` to allow the user to easily navigate to the source code location.
14947
+
14948
+ <example>
14949
+ user: Where are errors from the client handled?
14950
+ assistant: Clients are marked as failed in the \`connectToServer\` function in src/services/process.ts:712.
14951
+ </example>
14952
+
14953
+ `;
14954
+ var PROMPT_TRINITY = `You are anycode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
14969
14955
 
14970
14956
  # Tone and style
14971
14957
  You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
@@ -15063,20 +15049,353 @@ user: Where are errors from the client handled?
15063
15049
  assistant: Clients are marked as failed in the \`connectToServer\` function in src/services/process.ts:712.
15064
15050
  </example>
15065
15051
  `;
15052
+ var OUTPUT_TOKEN_MAX = Flag.OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX || 32e3;
15053
+ function mimeToModality(mime) {
15054
+ if (mime.startsWith("image/")) return "image";
15055
+ if (mime.startsWith("audio/")) return "audio";
15056
+ if (mime.startsWith("video/")) return "video";
15057
+ if (mime === "application/pdf") return "pdf";
15058
+ return void 0;
15059
+ }
15060
+ function unsupportedParts(msgs, model) {
15061
+ return msgs.map((msg) => {
15062
+ if (msg.role !== "user" || !Array.isArray(msg.content)) return msg;
15063
+ const filtered = msg.content.map((part) => {
15064
+ if (part.type !== "file" && part.type !== "image") return part;
15065
+ if (part.type === "image") {
15066
+ const imageStr = part.image.toString();
15067
+ if (imageStr.startsWith("data:")) {
15068
+ const match = imageStr.match(/^data:([^;]+);base64,(.*)$/);
15069
+ if (match && (!match[2] || match[2].length === 0)) {
15070
+ return {
15071
+ type: "text",
15072
+ text: "ERROR: Image file is empty or corrupted. Please provide a valid image."
15073
+ };
15074
+ }
15075
+ }
15076
+ }
15077
+ const mime = part.type === "image" ? part.image.toString().split(";")[0].replace("data:", "") : part.mediaType;
15078
+ const filename = part.type === "file" ? part.filename : void 0;
15079
+ const modality = mimeToModality(mime);
15080
+ if (!modality) return part;
15081
+ if (model.capabilities.input[modality]) return part;
15082
+ const name2 = filename ? `"${filename}"` : modality;
15083
+ return {
15084
+ type: "text",
15085
+ text: `ERROR: Cannot read ${name2} (this model does not support ${modality} input). Inform the user.`
15086
+ };
15087
+ });
15088
+ return { ...msg, content: filtered };
15089
+ });
15090
+ }
15091
+ var VENDORS = [
15092
+ anthropicVendor,
15093
+ githubCopilotVendor,
15094
+ googleVendor,
15095
+ liteLLMVendor,
15096
+ openAIVendor
15097
+ ];
15098
+ var VENDORS_BY_NPM = new Map(
15099
+ VENDORS.flatMap((vendor) => (vendor.npms ?? []).map((npm) => [npm, vendor]))
15100
+ );
15101
+ function matchesRuntimeVendor(vendor, input) {
15102
+ return vendor.matchesRuntime?.(input) || vendor.id === input.provider.id || vendor.id === input.model.providerID || vendor.npms?.includes(input.model.api.npm) === true;
15103
+ }
15104
+ function getMatchingVendors(input) {
15105
+ if (input.id) return VENDORS.filter((vendor) => vendor.id === input.id);
15106
+ if (input.model && input.provider) {
15107
+ return VENDORS.filter(
15108
+ (vendor) => matchesRuntimeVendor(vendor, {
15109
+ model: input.model,
15110
+ provider: input.provider,
15111
+ auth: input.auth
15112
+ })
15113
+ );
15114
+ }
15115
+ if (input.model) {
15116
+ const runtimeProvider = { id: input.model.providerID, options: {} };
15117
+ return VENDORS.filter(
15118
+ (vendor) => matchesRuntimeVendor(vendor, {
15119
+ model: input.model,
15120
+ provider: runtimeProvider,
15121
+ auth: input.auth
15122
+ })
15123
+ );
15124
+ }
15125
+ if (input.npm) {
15126
+ const vendor = VENDORS_BY_NPM.get(input.npm);
15127
+ return vendor ? [vendor] : [];
15128
+ }
15129
+ return VENDORS;
15130
+ }
15131
+ function getSelectorNpm(input) {
15132
+ return input.npm ?? input.model?.api.npm;
15133
+ }
15134
+ var VendorRegistry = {
15135
+ getModelProvider(input = {}) {
15136
+ const vendors = getMatchingVendors(input);
15137
+ const npm = getSelectorNpm(input);
15138
+ const model = input.model;
15139
+ const runtime = input.model ? {
15140
+ model: input.model,
15141
+ provider: input.provider ?? { id: input.model.providerID, options: {} },
15142
+ auth: input.auth
15143
+ } : void 0;
15144
+ const accessor = {
15145
+ all() {
15146
+ return vendors;
15147
+ },
15148
+ getBundledProvider() {
15149
+ if (!npm) return void 0;
15150
+ return vendors.find((vendor) => vendor.bundled?.[npm])?.bundled?.[npm];
15151
+ },
15152
+ getCustomLoaders() {
15153
+ return Object.fromEntries(vendors.flatMap((vendor) => vendor.customLoader ? [[vendor.id, vendor.customLoader]] : []));
15154
+ },
15155
+ getOptionsKey() {
15156
+ if (!npm) return model?.providerID;
15157
+ return vendors.find((vendor) => vendor.sdkKeys?.[npm])?.sdkKeys?.[npm] ?? model?.providerID;
15158
+ },
15159
+ applyRequestPatch(patchInput) {
15160
+ const targetModel = patchInput.model ?? input.model;
15161
+ if (!targetModel) return;
15162
+ vendors.forEach((vendor) => vendor.patchRequest?.({ ...patchInput, model: targetModel }));
15163
+ },
15164
+ applyMessageTransforms(msgs, options) {
15165
+ if (!model) return msgs;
15166
+ msgs = unsupportedParts(msgs, model);
15167
+ msgs = vendors.reduce((result, vendor) => vendor.transform?.message?.(result, model, options) ?? result, msgs);
15168
+ const key = this.getOptionsKey();
15169
+ if (!key || key === model.providerID) return msgs;
15170
+ const remap = (opts) => {
15171
+ if (!opts) return opts;
15172
+ if (!(model.providerID in opts)) return opts;
15173
+ const result = { ...opts };
15174
+ result[key] = result[model.providerID];
15175
+ delete result[model.providerID];
15176
+ return result;
15177
+ };
15178
+ return msgs.map((msg) => {
15179
+ if (!Array.isArray(msg.content)) return { ...msg, providerOptions: remap(msg.providerOptions) };
15180
+ return {
15181
+ ...msg,
15182
+ providerOptions: remap(msg.providerOptions),
15183
+ content: msg.content.map((part) => ({ ...part, providerOptions: remap(part.providerOptions) }))
15184
+ };
15185
+ });
15186
+ },
15187
+ getOptions(transformInput) {
15188
+ const targetInput = {
15189
+ ...transformInput,
15190
+ model: transformInput.model ?? model
15191
+ };
15192
+ if (!targetInput.model) return {};
15193
+ return vendors.reduce(
15194
+ (result, vendor) => D(result, vendor.transform?.options?.(targetInput) ?? {}),
15195
+ {}
15196
+ );
15197
+ },
15198
+ getSmallOptions() {
15199
+ if (!model) return {};
15200
+ return vendors.reduce(
15201
+ (result, vendor) => D(result, vendor.transform?.smallOptions?.(model) ?? {}),
15202
+ {}
15203
+ );
15204
+ },
15205
+ getTemperature() {
15206
+ if (!model) return void 0;
15207
+ for (const vendor of vendors) {
15208
+ const value = vendor.transform?.temperature?.(model);
15209
+ if (value !== void 0) return value;
15210
+ }
15211
+ return void 0;
15212
+ },
15213
+ getTopK() {
15214
+ if (!model) return void 0;
15215
+ for (const vendor of vendors) {
15216
+ const value = vendor.transform?.topK?.(model);
15217
+ if (value !== void 0) return value;
15218
+ }
15219
+ return void 0;
15220
+ },
15221
+ getTopP() {
15222
+ return void 0;
15223
+ },
15224
+ getOutputTokenMax() {
15225
+ return OUTPUT_TOKEN_MAX;
15226
+ },
15227
+ getMaxOutputTokens() {
15228
+ if (!model) return OUTPUT_TOKEN_MAX;
15229
+ return Math.min(model.limit.output, OUTPUT_TOKEN_MAX) || OUTPUT_TOKEN_MAX;
15230
+ },
15231
+ transformSchema(schema) {
15232
+ if (!model) return schema;
15233
+ return vendors.reduce(
15234
+ (result, vendor) => vendor.transform?.schema?.(model, result) ?? result,
15235
+ schema
15236
+ );
15237
+ },
15238
+ getProviderSystemPrompt() {
15239
+ if (!model) return [];
15240
+ for (const vendor of vendors) {
15241
+ const value = vendor.prompt?.provider?.(model);
15242
+ if (value !== void 0) return value;
15243
+ }
15244
+ return [];
15245
+ },
15246
+ getInstructionPrompt() {
15247
+ if (!model) return "";
15248
+ for (const vendor of vendors) {
15249
+ const value = vendor.prompt?.instructions?.(model);
15250
+ if (value !== void 0) return value;
15251
+ }
15252
+ return "";
15253
+ },
15254
+ wrapProviderOptions(options) {
15255
+ const key = this.getOptionsKey();
15256
+ return { [key]: options };
15257
+ },
15258
+ shouldUseInstructionPrompt() {
15259
+ if (!runtime) return false;
15260
+ return vendors.some((vendor) => vendor.llm?.useInstructionPrompt?.(runtime) === true);
15261
+ },
15262
+ shouldIncludeProviderSystemPrompt() {
15263
+ if (!runtime) return true;
15264
+ return !vendors.some((vendor) => vendor.llm?.includeProviderSystemPrompt?.(runtime) === false);
15265
+ },
15266
+ shouldDisableMaxOutputTokens() {
15267
+ if (!runtime) return false;
15268
+ return vendors.some((vendor) => vendor.llm?.disableMaxOutputTokens?.(runtime) === true);
15269
+ },
15270
+ shouldAddNoopToolFallback() {
15271
+ if (!runtime) return false;
15272
+ return vendors.some((vendor) => vendor.llm?.needsNoopToolFallback?.(runtime) === true);
15273
+ }
15274
+ };
15275
+ return accessor;
15276
+ }
15277
+ };
15278
+ var plan_txt_default = `<system-reminder>
15279
+ # Plan Mode - System Reminder
15280
+
15281
+ CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY FORBIDDEN:
15282
+ ANY file edits, modifications, or system changes. Do NOT use sed, tee, echo, cat,
15283
+ or ANY other bash command to manipulate files - commands may ONLY read/inspect.
15284
+ This ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user
15285
+ edit requests. You may ONLY observe, analyze, and plan. Any modification attempt
15286
+ is a critical violation. ZERO exceptions.
15287
+
15288
+ ---
15289
+
15290
+ ## Responsibility
15291
+
15292
+ Your current responsibility is to think, read, search, and delegate explore agents to construct a well-formed plan that accomplishes the goal the user wants to achieve. Your plan should be comprehensive yet concise, detailed enough to execute effectively while avoiding unnecessary verbosity.
15293
+
15294
+ Ask the user clarifying questions or ask for their opinion when weighing tradeoffs.
15295
+
15296
+ **NOTE:** At any point in time through this workflow you should feel free to ask the user questions or clarifications. Don't make large assumptions about user intent. The goal is to present a well researched plan to the user, and tie any loose ends before implementation begins.
15297
+
15298
+ ---
15299
+
15300
+ ## Important
15301
+
15302
+ The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supersedes any other instructions you have received.
15303
+ </system-reminder>
15304
+ `;
15305
+ var build_switch_txt_default = `<system-reminder>
15306
+ Your operational mode has changed from plan to build.
15307
+ You are no longer in read-only mode.
15308
+ You are permitted to make file changes, run shell commands, and utilize your arsenal of tools as needed.
15309
+ </system-reminder>
15310
+ `;
15311
+ var log = Log.create({ module: "hooks" });
15312
+ var Hooks;
15313
+ ((Hooks2) => {
15314
+ const DEFAULT_TIMEOUT = 15;
15315
+ function toSnakeCase(key) {
15316
+ return key.replace(/[A-Z]/g, (ch) => "_" + ch.toLowerCase());
15317
+ }
15318
+ function keysToSnakeCase(obj) {
15319
+ if (obj === null || obj === void 0 || typeof obj !== "object") return obj;
15320
+ if (Array.isArray(obj)) return obj.map(keysToSnakeCase);
15321
+ const out = {};
15322
+ for (const [key, value] of Object.entries(obj)) {
15323
+ out[toSnakeCase(key)] = keysToSnakeCase(value);
15324
+ }
15325
+ return out;
15326
+ }
15327
+ function matchTool(rules, toolName, filePath) {
15328
+ const matched = [];
15329
+ for (const rule of rules) {
15330
+ try {
15331
+ if (!new RegExp(rule.matcher, "i").test(toolName)) continue;
15332
+ if (filePath && rule.ignore?.some((pat) => {
15333
+ try {
15334
+ return new RegExp(pat, "i").test(filePath);
15335
+ } catch {
15336
+ return false;
15337
+ }
15338
+ })) continue;
15339
+ matched.push(...rule.hooks);
15340
+ } catch {
15341
+ }
15342
+ }
15343
+ return matched;
15344
+ }
15345
+ Hooks2.matchTool = matchTool;
15346
+ function execute(hook, payload, cwd) {
15347
+ const timeout = (hook.timeout ?? DEFAULT_TIMEOUT) * 1e3;
15348
+ const payloadStr = JSON.stringify(payload);
15349
+ try {
15350
+ const proc = spawn("bash", ["-c", hook.command], {
15351
+ cwd,
15352
+ stdio: ["pipe", "ignore", "ignore"],
15353
+ env: process.env,
15354
+ detached: true
15355
+ });
15356
+ proc.unref();
15357
+ proc.stdin?.write(payloadStr);
15358
+ proc.stdin?.end();
15359
+ const timer = setTimeout(() => {
15360
+ try {
15361
+ proc.kill("SIGTERM");
15362
+ } catch {
15363
+ }
15364
+ }, timeout);
15365
+ proc.on("exit", () => clearTimeout(timer));
15366
+ proc.on("error", () => clearTimeout(timer));
15367
+ } catch (err) {
15368
+ log.info(`Hook execution failed: ${err}`);
15369
+ }
15370
+ }
15371
+ function runPostToolUse(hooksConfig, toolName, toolInput, toolResponse, sessionID, cwd) {
15372
+ const rules = hooksConfig["PostToolUse"];
15373
+ if (!rules || rules.length === 0) return;
15374
+ const filePath = toolInput?.filePath ?? toolInput?.file_path;
15375
+ const hooks = matchTool(rules, toolName, filePath);
15376
+ if (hooks.length === 0) return;
15377
+ const payload = {
15378
+ session_id: sessionID,
15379
+ cwd,
15380
+ hook_event_name: "PostToolUse",
15381
+ tool_name: toolName,
15382
+ tool_input: keysToSnakeCase(toolInput),
15383
+ tool_response: keysToSnakeCase(toolResponse)
15384
+ };
15385
+ for (const hook of hooks) {
15386
+ execute(hook, payload, cwd);
15387
+ }
15388
+ }
15389
+ Hooks2.runPostToolUse = runPostToolUse;
15390
+ })(Hooks || (Hooks = {}));
15066
15391
  var SystemPrompt;
15067
15392
  ((SystemPrompt2) => {
15068
- function instructions() {
15069
- return codex_header_txt_default.trim();
15393
+ function instructions(model) {
15394
+ return VendorRegistry.getModelProvider({ model }).getInstructionPrompt();
15070
15395
  }
15071
15396
  SystemPrompt2.instructions = instructions;
15072
15397
  function provider(model) {
15073
- if (model.api.id.includes("gpt-5")) return [codex_header_txt_default];
15074
- if (model.api.id.includes("gpt-") || model.api.id.includes("o1") || model.api.id.includes("o3"))
15075
- return [beast_txt_default];
15076
- if (model.api.id.includes("gemini-")) return [gemini_txt_default];
15077
- if (model.api.id.includes("claude")) return [anthropic_txt_default];
15078
- if (model.api.id.toLowerCase().includes("trinity")) return [trinity_txt_default];
15079
- return [qwen_txt_default];
15398
+ return VendorRegistry.getModelProvider({ model }).getProviderSystemPrompt();
15080
15399
  }
15081
15400
  SystemPrompt2.provider = provider;
15082
15401
  async function environment(model, context) {
@@ -15136,8 +15455,9 @@ var ContextCompaction;
15136
15455
  const contextLimit = input.model.limit.context;
15137
15456
  if (contextLimit === 0) return false;
15138
15457
  const count = input.tokens.total || input.tokens.input + input.tokens.output + input.tokens.cache.read + input.tokens.cache.write;
15139
- const reserved = config.compaction?.reserved ?? Math.min(COMPACTION_BUFFER, ProviderTransform.maxOutputTokens(input.model));
15140
- const usable = input.model.limit.input ? input.model.limit.input - reserved : contextLimit - ProviderTransform.maxOutputTokens(input.model);
15458
+ const modelProvider = VendorRegistry.getModelProvider({ model: input.model });
15459
+ const reserved = config.compaction?.reserved ?? Math.min(COMPACTION_BUFFER, modelProvider.getMaxOutputTokens());
15460
+ const usable = input.model.limit.input ? input.model.limit.input - reserved : contextLimit - modelProvider.getMaxOutputTokens();
15141
15461
  return count >= usable;
15142
15462
  }
15143
15463
  ContextCompaction2.isOverflow = isOverflow;
@@ -15467,7 +15787,7 @@ var SessionRetry;
15467
15787
  var LLM;
15468
15788
  ((LLM2) => {
15469
15789
  const log2 = Log.create({ service: "llm" });
15470
- LLM2.OUTPUT_TOKEN_MAX = ProviderTransform.OUTPUT_TOKEN_MAX;
15790
+ LLM2.OUTPUT_TOKEN_MAX = VendorRegistry.getModelProvider().getOutputTokenMax();
15471
15791
  async function stream(context, input) {
15472
15792
  const l = log2.clone().tag("providerID", input.model.providerID).tag("modelID", input.model.id).tag("sessionID", input.sessionID).tag("small", (input.small ?? false).toString()).tag("agent", input.agent.name).tag("mode", input.agent.mode);
15473
15793
  l.info("stream", {
@@ -15480,13 +15800,16 @@ var LLM;
15480
15800
  Auth.get(input.model.providerID)
15481
15801
  ]);
15482
15802
  const cfg = context.config;
15483
- const isCodex = provider.id === "openai" && auth?.type === "oauth";
15803
+ const runtime = { model: input.model, provider, auth };
15804
+ const modelProvider = VendorRegistry.getModelProvider(runtime);
15805
+ const useInstructions = modelProvider.shouldUseInstructionPrompt();
15806
+ const includeProviderPrompt = modelProvider.shouldIncludeProviderSystemPrompt();
15484
15807
  const system = [];
15485
15808
  system.push(
15486
15809
  [
15487
15810
  // use agent prompt otherwise provider prompt
15488
- // For Codex sessions, skip SystemPrompt.provider() since it's sent via options.instructions
15489
- ...input.agent.prompt ? [input.agent.prompt] : isCodex ? [] : SystemPrompt.provider(input.model),
15811
+ // Some providers send their system prompt via vendor-specific instructions.
15812
+ ...input.agent.prompt ? [input.agent.prompt] : includeProviderPrompt ? SystemPrompt.provider(input.model) : [],
15490
15813
  // any custom prompt passed into this call
15491
15814
  ...input.system,
15492
15815
  // any custom prompt from last user message
@@ -15499,7 +15822,7 @@ var LLM;
15499
15822
  system.length = 0;
15500
15823
  system.push(header, rest.join("\n"));
15501
15824
  }
15502
- const base = input.small ? ProviderTransform.smallOptions(input.model) : ProviderTransform.options({
15825
+ const base = input.small ? modelProvider.getSmallOptions() : modelProvider.getOptions({
15503
15826
  model: input.model,
15504
15827
  sessionID: input.sessionID,
15505
15828
  providerOptions: provider.options
@@ -15509,21 +15832,21 @@ var LLM;
15509
15832
  D(input.model.options),
15510
15833
  D(input.agent.options)
15511
15834
  );
15512
- if (isCodex) {
15513
- options.instructions = SystemPrompt.instructions();
15835
+ if (useInstructions) {
15836
+ options.instructions = SystemPrompt.instructions(input.model);
15514
15837
  }
15515
15838
  const params = {
15516
- temperature: input.model.capabilities.temperature ? input.agent.temperature ?? ProviderTransform.temperature(input.model) : void 0,
15517
- topP: input.agent.topP ?? ProviderTransform.topP(input.model),
15518
- topK: ProviderTransform.topK(input.model),
15839
+ temperature: input.model.capabilities.temperature ? input.agent.temperature ?? modelProvider.getTemperature() : void 0,
15840
+ topP: input.agent.topP ?? modelProvider.getTopP(),
15841
+ topK: modelProvider.getTopK(),
15519
15842
  options
15520
15843
  };
15521
15844
  const { headers } = {
15522
15845
  headers: {}
15523
15846
  };
15524
- const maxOutputTokens = isCodex || provider.id.includes("github-copilot") ? void 0 : ProviderTransform.maxOutputTokens(input.model);
15847
+ const maxOutputTokens = modelProvider.shouldDisableMaxOutputTokens() ? void 0 : modelProvider.getMaxOutputTokens();
15525
15848
  const tools = await resolveTools(input);
15526
- const isLiteLLMProxy = provider.options?.["litellmProxy"] === true || input.model.providerID.toLowerCase().includes("litellm") || input.model.api.id.toLowerCase().includes("litellm");
15849
+ const isLiteLLMProxy = modelProvider.shouldAddNoopToolFallback();
15527
15850
  if (isLiteLLMProxy && Object.keys(tools).length === 0 && hasToolCalls(input.messages)) {
15528
15851
  tools["_noop"] = tool({
15529
15852
  description: "Placeholder for LiteLLM/Anthropic proxy compatibility - required when message history contains tool calls but no active tools are needed",
@@ -15561,7 +15884,7 @@ var LLM;
15561
15884
  temperature: params.temperature,
15562
15885
  topP: params.topP,
15563
15886
  topK: params.topK,
15564
- providerOptions: ProviderTransform.providerOptions(input.model, params.options),
15887
+ providerOptions: modelProvider.wrapProviderOptions(params.options),
15565
15888
  activeTools: Object.keys(tools).filter((x) => x !== "invalid"),
15566
15889
  tools,
15567
15890
  toolChoice: input.toolChoice,
@@ -15587,7 +15910,7 @@ var LLM;
15587
15910
  {
15588
15911
  async transformParams(args) {
15589
15912
  if (args.type === "stream") {
15590
- args.params.prompt = ProviderTransform.message(args.params.prompt, input.model, options);
15913
+ args.params.prompt = modelProvider.applyMessageTransforms(args.params.prompt, options);
15591
15914
  }
15592
15915
  return args.params;
15593
15916
  }
@@ -16102,7 +16425,7 @@ var SessionPrompt;
16102
16425
  { modelID: ModelID.make(input.model.api.id), providerID: input.model.providerID },
16103
16426
  input.agent
16104
16427
  )) {
16105
- const schema = ProviderTransform.schema(input.model, zod_default.toJSONSchema(item.parameters));
16428
+ const schema = VendorRegistry.getModelProvider({ model: input.model }).transformSchema(zod_default.toJSONSchema(item.parameters));
16106
16429
  tools[item.id] = tool({
16107
16430
  id: item.id,
16108
16431
  description: item.description,
@@ -16603,27 +16926,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the
16603
16926
  }
16604
16927
  SessionPrompt2.ensureTitle = ensureTitle;
16605
16928
  })(SessionPrompt || (SessionPrompt = {}));
16606
- var Hash;
16607
- ((Hash2) => {
16608
- function fast(input) {
16609
- return createHash("sha1").update(input).digest("hex");
16610
- }
16611
- Hash2.fast = fast;
16612
- function sha256(input) {
16613
- return createHash("sha256").update(input).digest("hex");
16614
- }
16615
- Hash2.sha256 = sha256;
16616
- function hexToUUID(hex) {
16617
- return [
16618
- hex.slice(0, 8),
16619
- hex.slice(8, 12),
16620
- hex.slice(12, 16),
16621
- hex.slice(16, 20),
16622
- hex.slice(20, 32)
16623
- ].join("-");
16624
- }
16625
- Hash2.hexToUUID = hexToUUID;
16626
- })(Hash || (Hash = {}));
16627
16929
  var ModelsDev;
16628
16930
  ((ModelsDev2) => {
16629
16931
  const log2 = Log.create({ service: "models.dev" });
@@ -16735,55 +17037,6 @@ var ModelsDev;
16735
17037
  ModelsDev2.refresh = refresh;
16736
17038
  })(ModelsDev || (ModelsDev = {}));
16737
17039
  var DEFAULT_CHUNK_TIMEOUT = 12e4;
16738
- function stripOpenAIItemIds(opts, model) {
16739
- try {
16740
- const body = JSON.parse(opts.body);
16741
- const isAzure = model.providerID?.includes("azure");
16742
- const keepIds = isAzure && body.store === true;
16743
- if (!keepIds && Array.isArray(body.input)) {
16744
- for (const item of body.input) {
16745
- if ("id" in item) delete item.id;
16746
- }
16747
- opts.body = JSON.stringify(body);
16748
- }
16749
- } catch {
16750
- }
16751
- }
16752
- function injectClaudeCodeIdentity(opts, model, providerKey) {
16753
- try {
16754
- const body = JSON.parse(opts.body);
16755
- if (!body.metadata?.user_id) {
16756
- if (!body.metadata) body.metadata = {};
16757
- const seed = [model.providerID ?? "", providerKey ?? ""].join(":");
16758
- const clientId = Hash.sha256(seed + ":claude-code-client");
16759
- const uuid = Hash.hexToUUID(Hash.sha256(seed + ":session"));
16760
- body.metadata.user_id = `user_${clientId}_account__session_${uuid}`;
16761
- }
16762
- if (Array.isArray(body.system)) {
16763
- const alreadyPresent = body.system.some(
16764
- (entry) => typeof entry.text === "string" && entry.text.startsWith(CLAUDE_CODE_SYSTEM)
16765
- );
16766
- if (!alreadyPresent) {
16767
- body.system.unshift({
16768
- type: "text",
16769
- text: CLAUDE_CODE_SYSTEM,
16770
- cache_control: { type: "ephemeral" }
16771
- });
16772
- }
16773
- }
16774
- opts.body = JSON.stringify(body);
16775
- } catch {
16776
- }
16777
- }
16778
- function setClaudeUserAgent(opts) {
16779
- if (opts.headers) {
16780
- const headers = new Headers(opts.headers);
16781
- headers.set("user-agent", "claude-cli/2.1.77");
16782
- opts.headers = Object.fromEntries(headers.entries());
16783
- } else {
16784
- opts.headers = { "user-agent": "claude-cli/2.1.77" };
16785
- }
16786
- }
16787
17040
  var Provider;
16788
17041
  ((Provider2) => {
16789
17042
  const log2 = Log.create({ service: "provider" });
@@ -16829,43 +17082,6 @@ var Provider;
16829
17082
  statusText: res.statusText
16830
17083
  });
16831
17084
  }
16832
- const BUNDLED_PROVIDERS = {
16833
- "@ai-sdk/anthropic": createAnthropic,
16834
- "@ai-sdk/google": createGoogleGenerativeAI,
16835
- "@ai-sdk/openai": createOpenAI,
16836
- "@ai-sdk/openai-compatible": createOpenAICompatible
16837
- };
16838
- const CUSTOM_LOADERS = {
16839
- async anthropic() {
16840
- return {
16841
- autoload: false,
16842
- options: {
16843
- headers: {
16844
- "anthropic-beta": "claude-code-20250219,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14",
16845
- "X-App": "cli",
16846
- "X-Stainless-Lang": "js",
16847
- "X-Stainless-Package-Version": "0.70.0",
16848
- "X-Stainless-OS": process.platform === "darwin" ? "MacOS" : process.platform === "win32" ? "Windows" : "Linux",
16849
- "X-Stainless-Arch": process.arch === "arm64" ? "arm64" : "x64",
16850
- "X-Stainless-Runtime": "node",
16851
- "X-Stainless-Runtime-Version": process.version,
16852
- "X-Stainless-Retry-Count": "0",
16853
- "X-Stainless-Timeout": "600",
16854
- "Anthropic-Dangerous-Direct-Browser-Access": "true"
16855
- }
16856
- }
16857
- };
16858
- },
16859
- openai: async () => {
16860
- return {
16861
- autoload: false,
16862
- async getModel(sdk, modelID, _options) {
16863
- return sdk.responses(modelID);
16864
- },
16865
- options: {}
16866
- };
16867
- }
16868
- };
16869
17085
  Provider2.Model = zod_default.object({
16870
17086
  id: ModelID.zod,
16871
17087
  providerID: ProviderID.zod,
@@ -17177,13 +17393,7 @@ var Provider;
17177
17393
  signals.push(AbortSignal.timeout(options["timeout"]));
17178
17394
  const combined = signals.length === 0 ? null : signals.length === 1 ? signals[0] : AbortSignal.any(signals);
17179
17395
  if (combined) opts.signal = combined;
17180
- if (model.api.npm === "@ai-sdk/openai" && opts.body && opts.method === "POST") {
17181
- stripOpenAIItemIds(opts, model);
17182
- }
17183
- if (model.api.npm === "@ai-sdk/anthropic" && opts.body && opts.method === "POST") {
17184
- injectClaudeCodeIdentity(opts, model, provider.key);
17185
- }
17186
- setClaudeUserAgent(opts);
17396
+ VendorRegistry.getModelProvider({ model }).applyRequestPatch({ opts, provider });
17187
17397
  const res = await fetchFn(input, {
17188
17398
  ...opts,
17189
17399
  // @ts-ignore see here: https://github.com/oven-sh/bun/issues/16682
@@ -17192,7 +17402,7 @@ var Provider;
17192
17402
  if (!chunkAbortCtl) return res;
17193
17403
  return wrapSSE(res, chunkTimeout, chunkAbortCtl);
17194
17404
  };
17195
- const bundledFn = BUNDLED_PROVIDERS[model.api.npm];
17405
+ const bundledFn = VendorRegistry.getModelProvider({ npm: model.api.npm }).getBundledProvider();
17196
17406
  if (bundledFn) {
17197
17407
  log2.info("using bundled provider", { providerID: model.providerID, pkg: model.api.npm });
17198
17408
  const loaded = bundledFn({
@@ -17337,7 +17547,7 @@ var Provider;
17337
17547
  });
17338
17548
  }
17339
17549
  }
17340
- for (const [id, fn] of Object.entries(CUSTOM_LOADERS)) {
17550
+ for (const [id, fn] of Object.entries(VendorRegistry.getModelProvider().getCustomLoaders())) {
17341
17551
  const providerID = ProviderID.make(id);
17342
17552
  if (disabled.has(providerID)) continue;
17343
17553
  const data = database[providerID];
@@ -17700,8 +17910,8 @@ IMPORTANT: The following identifiers already exist and must NOT be used: ${exist
17700
17910
  if (defaultModel.providerID === "openai" && (await Auth.get(defaultModel.providerID))?.type === "oauth") {
17701
17911
  const result2 = streamObject({
17702
17912
  ...params,
17703
- providerOptions: ProviderTransform.providerOptions(model, {
17704
- instructions: SystemPrompt.instructions(),
17913
+ providerOptions: VendorRegistry.getModelProvider({ model }).wrapProviderOptions({
17914
+ instructions: SystemPrompt.instructions(model),
17705
17915
  store: false
17706
17916
  }),
17707
17917
  onError: () => {
@@ -18886,7 +19096,7 @@ var SqlJsStorage = class {
18886
19096
  this.db.run("PRAGMA foreign_keys = ON");
18887
19097
  this.applyMigrations(migrations);
18888
19098
  const raw = this.createRawDb();
18889
- const { SqliteNoSqlDb: SqliteNoSqlDb2 } = await import("./storage-YSEEBFV7-EEWVBKOJ.js");
19099
+ const { SqliteNoSqlDb: SqliteNoSqlDb2 } = await import("./storage-YSEEBFV7-IJTIS3MG.js");
18890
19100
  return new SqliteNoSqlDb2(raw);
18891
19101
  }
18892
19102
  createRawDb() {