@namzu/cli 51.1.0 → 51.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{acp-YH3ORAMX.js → acp-HCVLUS7I.js} +106 -71
  4. package/dist/chunks/acp-HCVLUS7I.js.map +6 -0
  5. package/dist/chunks/{activity-command-6SLWX5O6.js → activity-command-I3OMRZ2T.js} +12 -12
  6. package/dist/chunks/{add-5DU7SP37.js → add-A65AU46H.js} +23 -23
  7. package/dist/chunks/{agent-IN76G7FR.js → agent-3A66KRCM.js} +39 -37
  8. package/dist/chunks/agent-session-LJZO5VIZ.js +71 -0
  9. package/dist/chunks/{archive-X5OO3HYU.js → archive-IWWDLSAO.js} +10 -10
  10. package/dist/chunks/{bin-main-MJURSFNJ.js → bin-main-CRX2U7A6.js} +8 -8
  11. package/dist/chunks/{binding-6EX5H32J.js → binding-4AMPOED7.js} +3 -3
  12. package/dist/chunks/{browser-UUSAOFML.js → browser-SAS7YPVD.js} +6 -6
  13. package/dist/chunks/{chat-J2DRST74.js → chat-ANHTX7D5.js} +15 -15
  14. package/dist/chunks/{chunk-BNIO5NNW.js → chunk-2HB47MDS.js} +57 -39
  15. package/dist/chunks/chunk-2HB47MDS.js.map +6 -0
  16. package/dist/chunks/{chunk-4MDH3G7P.js → chunk-3D52GNVJ.js} +4 -4
  17. package/dist/chunks/{chunk-DQGDG63U.js → chunk-3MJ3YKNV.js} +5 -5
  18. package/dist/chunks/chunk-3YM3IWPW.js +221 -0
  19. package/dist/chunks/chunk-3YM3IWPW.js.map +6 -0
  20. package/dist/chunks/{chunk-QN4WGK62.js → chunk-45Z4OPC6.js} +3 -3
  21. package/dist/chunks/{chunk-4GQ5ACCZ.js → chunk-52YXYXRG.js} +2 -2
  22. package/dist/chunks/{chunk-ASITCNWM.js → chunk-56ZS6OTK.js} +4 -4
  23. package/dist/chunks/{chunk-M3O7WEJF.js → chunk-57QGQNRI.js} +2 -2
  24. package/dist/chunks/{chunk-PYRMWOCP.js → chunk-5TPQGNYN.js} +4 -4
  25. package/dist/chunks/{chunk-N7COW4QY.js → chunk-5U42MB6F.js} +10 -10
  26. package/dist/chunks/{chunk-HSSTV5SF.js → chunk-5YMIK3VP.js} +3 -3
  27. package/dist/chunks/{chunk-YWKZQABS.js → chunk-6CKU4TCF.js} +2 -2
  28. package/dist/chunks/{chunk-KBLICB2N.js → chunk-6I4V7I5M.js} +2 -2
  29. package/dist/chunks/{chunk-VIJFICIC.js → chunk-6MI4Q5QQ.js} +4 -4
  30. package/dist/chunks/{chunk-76HAMOHW.js → chunk-6S4L4SAU.js} +6 -6
  31. package/dist/chunks/{chunk-CB7VORLS.js → chunk-AGC67H4M.js} +4 -4
  32. package/dist/chunks/{chunk-BZC5JPMB.js → chunk-ALXE3SUZ.js} +3 -3
  33. package/dist/chunks/{chunk-6J6AEQA4.js → chunk-ANVIYMV6.js} +3 -3
  34. package/dist/chunks/chunk-BBTPD3DU.js +19 -0
  35. package/dist/chunks/chunk-BBTPD3DU.js.map +6 -0
  36. package/dist/chunks/{chunk-S4HDKI6L.js → chunk-BC3IZXTY.js} +2 -2
  37. package/dist/chunks/{chunk-K4BMTUBH.js → chunk-BN32BPU6.js} +2 -2
  38. package/dist/chunks/chunk-BUP54TBX.js +214 -0
  39. package/dist/chunks/chunk-BUP54TBX.js.map +6 -0
  40. package/dist/chunks/{chunk-YUDCUW4N.js → chunk-CYCUJOAD.js} +3 -3
  41. package/dist/chunks/{chunk-ZJQYNG27.js → chunk-DLVHJFXI.js} +2 -2
  42. package/dist/chunks/{chunk-MJW6FQAW.js → chunk-DNOI4BL2.js} +2 -2
  43. package/dist/chunks/{chunk-FI5EMDFZ.js → chunk-DOPHHI6C.js} +3 -3
  44. package/dist/chunks/{chunk-NEKCM2HR.js → chunk-E5OETSRN.js} +6 -6
  45. package/dist/chunks/{chunk-HFLX3ZLT.js → chunk-E7IXVEOQ.js} +3 -3
  46. package/dist/chunks/{chunk-ZKOEUHCF.js → chunk-FKQOGEKL.js} +3 -3
  47. package/dist/chunks/{chunk-LNIM2TS3.js → chunk-FLPT7I7I.js} +4 -4
  48. package/dist/chunks/{chunk-DE4WWSBB.js → chunk-FMAUDMYL.js} +12 -12
  49. package/dist/chunks/{chunk-H32MIHLE.js → chunk-FSS72QJP.js} +2 -2
  50. package/dist/chunks/chunk-G4N43E6M.js +62 -0
  51. package/dist/chunks/chunk-G4N43E6M.js.map +6 -0
  52. package/dist/chunks/{chunk-VPIFXAL6.js → chunk-H56PLZHW.js} +2 -2
  53. package/dist/chunks/{chunk-2XXEIH7D.js → chunk-HHLWXGOG.js} +2 -2
  54. package/dist/chunks/{chunk-EK74R563.js → chunk-HQ4WFN7B.js} +732 -544
  55. package/dist/chunks/chunk-HQ4WFN7B.js.map +6 -0
  56. package/dist/chunks/{chunk-BGT2BABA.js → chunk-HXPRWMLH.js} +4 -4
  57. package/dist/chunks/{chunk-MPLS4I5N.js → chunk-ILPXZDTW.js} +116 -79
  58. package/dist/chunks/chunk-ILPXZDTW.js.map +6 -0
  59. package/dist/chunks/{chunk-UHYZ64ET.js → chunk-IPTWZUSV.js} +2 -2
  60. package/dist/chunks/{chunk-4DYB42HG.js → chunk-ITY5SBAS.js} +2 -2
  61. package/dist/chunks/{chunk-J4QN36GJ.js → chunk-JUN4VUC6.js} +64 -224
  62. package/dist/chunks/chunk-JUN4VUC6.js.map +6 -0
  63. package/dist/chunks/{chunk-ZYRABJ7J.js → chunk-K52DES57.js} +2 -2
  64. package/dist/chunks/chunk-KD6WL3W7.js +10 -0
  65. package/dist/chunks/chunk-KD6WL3W7.js.map +6 -0
  66. package/dist/chunks/{chunk-3KNUUOMF.js → chunk-KJ7Q3BC3.js} +2 -2
  67. package/dist/chunks/{chunk-AROJAFON.js → chunk-KJVRHBMX.js} +3 -3
  68. package/dist/chunks/{chunk-VDQQE3Q6.js → chunk-KZHMLRKY.js} +4 -4
  69. package/dist/chunks/{chunk-MFRWOJCD.js → chunk-LAXSPXNP.js} +4 -3
  70. package/dist/chunks/{chunk-MFRWOJCD.js.map → chunk-LAXSPXNP.js.map} +1 -1
  71. package/dist/chunks/{chunk-5HS5WIS3.js → chunk-LGH2T6KL.js} +2 -2
  72. package/dist/chunks/{chunk-2OGJPIGN.js → chunk-LQJ3TB5E.js} +14 -14
  73. package/dist/chunks/{chunk-TF6ZSM2M.js → chunk-LYPEV765.js} +2 -2
  74. package/dist/chunks/chunk-LYUY2FK2.js +141 -0
  75. package/dist/chunks/chunk-LYUY2FK2.js.map +6 -0
  76. package/dist/chunks/{chunk-YU65OZTC.js → chunk-M44I7P3H.js} +2 -2
  77. package/dist/chunks/{chunk-HAHNDC7N.js → chunk-NAWIOVUH.js} +3 -3
  78. package/dist/chunks/{chunk-WWC6L5WC.js → chunk-NGE7TNCY.js} +2 -2
  79. package/dist/chunks/{chunk-CSWUOY5K.js → chunk-NXJQTDVT.js} +17 -17
  80. package/dist/chunks/{chunk-QZDNCVK4.js → chunk-NY3I4WL7.js} +185 -363
  81. package/dist/chunks/chunk-NY3I4WL7.js.map +6 -0
  82. package/dist/chunks/{chunk-O6QJXKWZ.js → chunk-OEKCCZ7I.js} +5 -5
  83. package/dist/chunks/{chunk-3VKSD45U.js → chunk-OL5SKFPM.js} +4 -4
  84. package/dist/chunks/{chunk-MPUHBR73.js → chunk-OMP25UWR.js} +2 -2
  85. package/dist/chunks/{chunk-GTRG5VXA.js → chunk-P53E77KS.js} +3 -3
  86. package/dist/chunks/{chunk-P6CNFKJC.js → chunk-PI6KC5CD.js} +5 -5
  87. package/dist/chunks/{chunk-RZXNXGRE.js → chunk-Q5DW33F4.js} +2 -2
  88. package/dist/chunks/{chunk-RQKE2URW.js → chunk-QS65X7D6.js} +3 -3
  89. package/dist/chunks/{chunk-BIWDWFAK.js → chunk-QZ4V25KD.js} +3 -3
  90. package/dist/chunks/{chunk-JBQATPG3.js → chunk-RCLTSI6G.js} +2 -2
  91. package/dist/chunks/{chunk-ZRM2NW77.js → chunk-RDWVNVZS.js} +5 -5
  92. package/dist/chunks/{chunk-J267C5O6.js → chunk-SMX5YHRV.js} +2 -2
  93. package/dist/chunks/{chunk-YOCPU3WT.js → chunk-SQWFNFEX.js} +3 -3
  94. package/dist/chunks/{chunk-PR3HSIXG.js → chunk-SR75L2R5.js} +4 -4
  95. package/dist/chunks/{chunk-G2DGASUC.js → chunk-T5X3GYBF.js} +2 -2
  96. package/dist/chunks/{chunk-GN4BLP6C.js → chunk-TJSGSC2W.js} +9 -9
  97. package/dist/chunks/{chunk-B4M4IEOE.js → chunk-TTXZK3BR.js} +3 -3
  98. package/dist/chunks/{chunk-F2I6X667.js → chunk-U7AQ4OQJ.js} +4 -3
  99. package/dist/chunks/{chunk-VONTYDZ3.js → chunk-UPSI724V.js} +3 -3
  100. package/dist/chunks/{chunk-SRBCU3IJ.js → chunk-V23HHK5D.js} +2 -2
  101. package/dist/chunks/{chunk-R77WPUUF.js → chunk-VQHVH7X2.js} +3 -3
  102. package/dist/chunks/{chunk-FJZL4BJN.js → chunk-WJ4YRFPQ.js} +2 -2
  103. package/dist/chunks/{chunk-64CDTVEM.js → chunk-WJXVNXJZ.js} +12 -12
  104. package/dist/chunks/{chunk-DXFPBLQV.js → chunk-WOX4KI7C.js} +3 -3
  105. package/dist/chunks/{chunk-3MUNYBIF.js → chunk-X3L6N5RM.js} +11 -11
  106. package/dist/chunks/{chunk-JE2S7MW2.js → chunk-XFMGW2C5.js} +2 -2
  107. package/dist/chunks/{chunk-W5IR3SD3.js → chunk-XPCRLKFO.js} +6 -6
  108. package/dist/chunks/{chunk-XCDXSRY7.js → chunk-XYT53O3Z.js} +2 -2
  109. package/dist/chunks/{chunk-LJ4DIGHQ.js → chunk-YSV633T5.js} +9 -9
  110. package/dist/chunks/{chunk-LRLMZTZ3.js → chunk-ZXFEHB7N.js} +2 -2
  111. package/dist/chunks/{cli-runtime-YUFSSYYG.js → cli-runtime-5UE6P2QW.js} +19 -16
  112. package/dist/chunks/cli-runtime-5UE6P2QW.js.map +6 -0
  113. package/dist/chunks/{commands-J7XAMJC5.js → commands-IOHIM2PX.js} +5 -5
  114. package/dist/chunks/cost-MYSYQTT3.js +755 -0
  115. package/dist/chunks/cost-MYSYQTT3.js.map +6 -0
  116. package/dist/chunks/{crash-report-3GPFLNQX.js → crash-report-WLLGI2U4.js} +6 -6
  117. package/dist/chunks/day-CU5J7UAK.js +22 -0
  118. package/dist/chunks/{dist-2EQ3MAWA.js → dist-33QU2MGT.js} +2 -2
  119. package/dist/chunks/{dist-IS662MSA.js → dist-6G55RC27.js} +2 -2
  120. package/dist/chunks/{dist-5LXAFF2H.js → dist-CFPNJCLJ.js} +2 -2
  121. package/dist/chunks/{dist-CO47MPO4.js → dist-E2PF4PGO.js} +2 -2
  122. package/dist/chunks/{dist-4TO2X6U4.js → dist-FZYKXUR4.js} +2 -2
  123. package/dist/chunks/{dist-UXUFCGIX.js → dist-IXAUMLZH.js} +2 -2
  124. package/dist/chunks/{dist-EGCYKNFG.js → dist-MBVPANQB.js} +24 -2
  125. package/dist/chunks/{dist-F36KOHDP.js → dist-PKKDBDSA.js} +2 -2
  126. package/dist/chunks/{doctor-YC6Z7P3P.js → doctor-BXRPVVKL.js} +18 -18
  127. package/dist/chunks/{drain-5BQHD3KW.js → drain-EWKGL77B.js} +9 -9
  128. package/dist/chunks/{entry-ZJWR3CSL.js → entry-XPXHELKT.js} +6 -6
  129. package/dist/chunks/{eval-JHNFGVGA.js → eval-OLNNJGUO.js} +2 -2
  130. package/dist/chunks/{exec-YADZELFF.js → exec-XNMHHHTZ.js} +46 -42
  131. package/dist/chunks/exec-XNMHHHTZ.js.map +6 -0
  132. package/dist/chunks/{home-EBXWUU6C.js → home-T4ZVXIEX.js} +3 -3
  133. package/dist/chunks/{host-JU76NQJY.js → host-LQ6V4NJS.js} +10 -10
  134. package/dist/chunks/{host-queries-6TO7AIZE.js → host-queries-LEPTBKZK.js} +15 -15
  135. package/dist/chunks/{learn-YGTIACD6.js → learn-WOZKPYR4.js} +11 -11
  136. package/dist/chunks/{learn-builtin-FND7NEEV.js → learn-builtin-BVJFZF4R.js} +14 -14
  137. package/dist/chunks/{lifecycle-VBNEAO74.js → lifecycle-KKIDSRJV.js} +32 -32
  138. package/dist/chunks/{list-GQEKL3MC.js → list-ZWIXNGJV.js} +15 -15
  139. package/dist/chunks/{live-N3PPNKW6.js → live-4GQNVGPU.js} +17 -17
  140. package/dist/chunks/{login-KEFAKXJZ.js → login-MBXPJW6F.js} +13 -13
  141. package/dist/chunks/{logs-JZEIQMOQ.js → logs-7GVMBYAQ.js} +5 -5
  142. package/dist/chunks/{mcp-7CBDNNY3.js → mcp-45UUEZMF.js} +23 -23
  143. package/dist/chunks/{message-command-JAKH5U6B.js → message-command-YVAI3SLS.js} +47 -45
  144. package/dist/chunks/message-command-YVAI3SLS.js.map +6 -0
  145. package/dist/chunks/{open-Q63ZNCNO.js → open-UG6VAHDW.js} +8 -8
  146. package/dist/chunks/{operator-tools-SEK3DCMJ.js → operator-tools-M4SMIAYS.js} +13 -13
  147. package/dist/chunks/{output-schema-ROCYTWMQ.js → output-schema-MZ6X4WQ2.js} +3 -3
  148. package/dist/chunks/{pal-XOMURPYQ.js → pal-R4RSZP2U.js} +16 -16
  149. package/dist/chunks/{peers-GY5QNN5F.js → peers-6TIMGPGR.js} +7 -7
  150. package/dist/chunks/{peers-JILQNRCW.js → peers-T5SXNFYU.js} +6 -6
  151. package/dist/chunks/plugin-SAQJPDKX.js +1043 -0
  152. package/dist/chunks/plugin-SAQJPDKX.js.map +6 -0
  153. package/dist/chunks/{providers-NMMTLTEC.js → providers-CPHEQZCV.js} +11 -11
  154. package/dist/chunks/{pty-KR5RNX54.js → pty-YAFV4ZA6.js} +3 -3
  155. package/dist/chunks/render-QFCCPEEL.js +14 -0
  156. package/dist/chunks/resume-GZGHY4UR.js +23 -0
  157. package/dist/chunks/{resume-command-WOG47T6A.js → resume-command-WJH7SKYB.js} +5 -5
  158. package/dist/chunks/{schedule-V3OHZVHK.js → schedule-I7ZNWSN3.js} +8 -8
  159. package/dist/chunks/{service-XPJSCHPW.js → service-ZRXXXJW7.js} +36 -36
  160. package/dist/chunks/{skills-PGO6KGCD.js → skills-RIJBOCKN.js} +8 -8
  161. package/dist/chunks/{start-check-CLSVKYRW.js → start-check-5DQL76YU.js} +2 -2
  162. package/dist/chunks/{startup-failure-WN5PCOIE.js → startup-failure-7KMOAOXE.js} +2 -2
  163. package/dist/chunks/{state-W72YF7CF.js → state-QNSG3QWY.js} +2 -2
  164. package/dist/chunks/{store-4RNQ47OD.js → store-7NXFZTW7.js} +6 -6
  165. package/dist/chunks/{store-SQINHTJO.js → store-IDSNTJRG.js} +10 -10
  166. package/dist/chunks/{store-7SESBCUG.js → store-NE2I4H7E.js} +3 -3
  167. package/dist/chunks/store-NE2I4H7E.js.map +6 -0
  168. package/dist/chunks/{store-J4CYKAFS.js → store-TY2ZO2EP.js} +4 -4
  169. package/dist/chunks/store-TY2ZO2EP.js.map +6 -0
  170. package/dist/chunks/{tui-HYKE4V4J.js → tui-DLUH6HQ4.js} +78 -74
  171. package/dist/chunks/tui-DLUH6HQ4.js.map +6 -0
  172. package/dist/chunks/{upgrade-HE5NIE2M.js → upgrade-UZTPAIDF.js} +7 -7
  173. package/dist/chunks/{watch-C5YQJNHV.js → watch-AAZHSSIE.js} +71 -67
  174. package/dist/chunks/watch-AAZHSSIE.js.map +6 -0
  175. package/dist/chunks/{workspaces-CPOLSOKE.js → workspaces-KLYC5537.js} +16 -16
  176. package/dist/chunks/{worktree-TUBWOHUQ.js → worktree-4PKAJ7LT.js} +12 -12
  177. package/dist/cli.d.ts.map +1 -1
  178. package/dist/commands/acp.d.ts +20 -1
  179. package/dist/commands/acp.d.ts.map +1 -1
  180. package/dist/commands/cost.d.ts +26 -0
  181. package/dist/commands/cost.d.ts.map +1 -0
  182. package/dist/commands/desktop-host.d.ts.map +1 -1
  183. package/dist/commands/manifest.d.ts +2 -0
  184. package/dist/commands/manifest.d.ts.map +1 -1
  185. package/dist/commands/plugin.d.ts +18 -0
  186. package/dist/commands/plugin.d.ts.map +1 -0
  187. package/dist/desktop-contract.d.ts +21 -0
  188. package/dist/desktop-contract.d.ts.map +1 -0
  189. package/dist/index.d.ts +1 -0
  190. package/dist/index.d.ts.map +1 -1
  191. package/dist/index.js +31 -27
  192. package/dist/integrations/auto-update/install-kind.d.ts.map +1 -1
  193. package/dist/integrations/plugins/check-hint.d.ts +5 -0
  194. package/dist/integrations/plugins/check-hint.d.ts.map +1 -0
  195. package/dist/integrations/plugins/files.d.ts +17 -0
  196. package/dist/integrations/plugins/files.d.ts.map +1 -1
  197. package/dist/integrations/plugins/validate.d.ts +75 -0
  198. package/dist/integrations/plugins/validate.d.ts.map +1 -0
  199. package/dist/integrations/spend/day.d.ts +26 -0
  200. package/dist/integrations/spend/day.d.ts.map +1 -0
  201. package/dist/integrations/spend/fold.d.ts +136 -0
  202. package/dist/integrations/spend/fold.d.ts.map +1 -0
  203. package/dist/integrations/spend/ledger.d.ts +74 -0
  204. package/dist/integrations/spend/ledger.d.ts.map +1 -0
  205. package/dist/integrations/spend/render.d.ts +6 -0
  206. package/dist/integrations/spend/render.d.ts.map +1 -0
  207. package/dist/integrations/spend/report.d.ts +110 -0
  208. package/dist/integrations/spend/report.d.ts.map +1 -0
  209. package/dist/integrations/telemetry/otlp-export.d.ts +3 -0
  210. package/dist/integrations/telemetry/otlp-export.d.ts.map +1 -1
  211. package/dist/tui/App.d.ts.map +1 -1
  212. package/dist/tui/agent.d.ts.map +1 -1
  213. package/dist/tui/slashCommands.d.ts +5 -0
  214. package/dist/tui/slashCommands.d.ts.map +1 -1
  215. package/dist/user-commands/store.d.ts +14 -0
  216. package/dist/user-commands/store.d.ts.map +1 -1
  217. package/package.json +3 -3
  218. package/dist/chunks/acp-YH3ORAMX.js.map +0 -6
  219. package/dist/chunks/agent-session-5T4QOI6T.js +0 -69
  220. package/dist/chunks/chunk-BNIO5NNW.js.map +0 -6
  221. package/dist/chunks/chunk-EK74R563.js.map +0 -6
  222. package/dist/chunks/chunk-J4QN36GJ.js.map +0 -6
  223. package/dist/chunks/chunk-MPLS4I5N.js.map +0 -6
  224. package/dist/chunks/chunk-QZDNCVK4.js.map +0 -6
  225. package/dist/chunks/cli-runtime-YUFSSYYG.js.map +0 -6
  226. package/dist/chunks/exec-YADZELFF.js.map +0 -6
  227. package/dist/chunks/message-command-JAKH5U6B.js.map +0 -6
  228. package/dist/chunks/resume-A3XPV4Z5.js +0 -23
  229. package/dist/chunks/tui-HYKE4V4J.js.map +0 -6
  230. package/dist/chunks/watch-C5YQJNHV.js.map +0 -6
  231. /package/dist/chunks/{activity-command-6SLWX5O6.js.map → activity-command-I3OMRZ2T.js.map} +0 -0
  232. /package/dist/chunks/{add-5DU7SP37.js.map → add-A65AU46H.js.map} +0 -0
  233. /package/dist/chunks/{agent-IN76G7FR.js.map → agent-3A66KRCM.js.map} +0 -0
  234. /package/dist/chunks/{agent-session-5T4QOI6T.js.map → agent-session-LJZO5VIZ.js.map} +0 -0
  235. /package/dist/chunks/{archive-X5OO3HYU.js.map → archive-IWWDLSAO.js.map} +0 -0
  236. /package/dist/chunks/{bin-main-MJURSFNJ.js.map → bin-main-CRX2U7A6.js.map} +0 -0
  237. /package/dist/chunks/{binding-6EX5H32J.js.map → binding-4AMPOED7.js.map} +0 -0
  238. /package/dist/chunks/{browser-UUSAOFML.js.map → browser-SAS7YPVD.js.map} +0 -0
  239. /package/dist/chunks/{chat-J2DRST74.js.map → chat-ANHTX7D5.js.map} +0 -0
  240. /package/dist/chunks/{chunk-4MDH3G7P.js.map → chunk-3D52GNVJ.js.map} +0 -0
  241. /package/dist/chunks/{chunk-DQGDG63U.js.map → chunk-3MJ3YKNV.js.map} +0 -0
  242. /package/dist/chunks/{chunk-QN4WGK62.js.map → chunk-45Z4OPC6.js.map} +0 -0
  243. /package/dist/chunks/{chunk-4GQ5ACCZ.js.map → chunk-52YXYXRG.js.map} +0 -0
  244. /package/dist/chunks/{chunk-ASITCNWM.js.map → chunk-56ZS6OTK.js.map} +0 -0
  245. /package/dist/chunks/{chunk-M3O7WEJF.js.map → chunk-57QGQNRI.js.map} +0 -0
  246. /package/dist/chunks/{chunk-PYRMWOCP.js.map → chunk-5TPQGNYN.js.map} +0 -0
  247. /package/dist/chunks/{chunk-N7COW4QY.js.map → chunk-5U42MB6F.js.map} +0 -0
  248. /package/dist/chunks/{chunk-HSSTV5SF.js.map → chunk-5YMIK3VP.js.map} +0 -0
  249. /package/dist/chunks/{chunk-YWKZQABS.js.map → chunk-6CKU4TCF.js.map} +0 -0
  250. /package/dist/chunks/{chunk-KBLICB2N.js.map → chunk-6I4V7I5M.js.map} +0 -0
  251. /package/dist/chunks/{chunk-VIJFICIC.js.map → chunk-6MI4Q5QQ.js.map} +0 -0
  252. /package/dist/chunks/{chunk-76HAMOHW.js.map → chunk-6S4L4SAU.js.map} +0 -0
  253. /package/dist/chunks/{chunk-CB7VORLS.js.map → chunk-AGC67H4M.js.map} +0 -0
  254. /package/dist/chunks/{chunk-BZC5JPMB.js.map → chunk-ALXE3SUZ.js.map} +0 -0
  255. /package/dist/chunks/{chunk-6J6AEQA4.js.map → chunk-ANVIYMV6.js.map} +0 -0
  256. /package/dist/chunks/{chunk-S4HDKI6L.js.map → chunk-BC3IZXTY.js.map} +0 -0
  257. /package/dist/chunks/{chunk-K4BMTUBH.js.map → chunk-BN32BPU6.js.map} +0 -0
  258. /package/dist/chunks/{chunk-YUDCUW4N.js.map → chunk-CYCUJOAD.js.map} +0 -0
  259. /package/dist/chunks/{chunk-ZJQYNG27.js.map → chunk-DLVHJFXI.js.map} +0 -0
  260. /package/dist/chunks/{chunk-MJW6FQAW.js.map → chunk-DNOI4BL2.js.map} +0 -0
  261. /package/dist/chunks/{chunk-FI5EMDFZ.js.map → chunk-DOPHHI6C.js.map} +0 -0
  262. /package/dist/chunks/{chunk-NEKCM2HR.js.map → chunk-E5OETSRN.js.map} +0 -0
  263. /package/dist/chunks/{chunk-HFLX3ZLT.js.map → chunk-E7IXVEOQ.js.map} +0 -0
  264. /package/dist/chunks/{chunk-ZKOEUHCF.js.map → chunk-FKQOGEKL.js.map} +0 -0
  265. /package/dist/chunks/{chunk-LNIM2TS3.js.map → chunk-FLPT7I7I.js.map} +0 -0
  266. /package/dist/chunks/{chunk-DE4WWSBB.js.map → chunk-FMAUDMYL.js.map} +0 -0
  267. /package/dist/chunks/{chunk-H32MIHLE.js.map → chunk-FSS72QJP.js.map} +0 -0
  268. /package/dist/chunks/{chunk-VPIFXAL6.js.map → chunk-H56PLZHW.js.map} +0 -0
  269. /package/dist/chunks/{chunk-2XXEIH7D.js.map → chunk-HHLWXGOG.js.map} +0 -0
  270. /package/dist/chunks/{chunk-BGT2BABA.js.map → chunk-HXPRWMLH.js.map} +0 -0
  271. /package/dist/chunks/{chunk-UHYZ64ET.js.map → chunk-IPTWZUSV.js.map} +0 -0
  272. /package/dist/chunks/{chunk-4DYB42HG.js.map → chunk-ITY5SBAS.js.map} +0 -0
  273. /package/dist/chunks/{chunk-ZYRABJ7J.js.map → chunk-K52DES57.js.map} +0 -0
  274. /package/dist/chunks/{chunk-3KNUUOMF.js.map → chunk-KJ7Q3BC3.js.map} +0 -0
  275. /package/dist/chunks/{chunk-AROJAFON.js.map → chunk-KJVRHBMX.js.map} +0 -0
  276. /package/dist/chunks/{chunk-VDQQE3Q6.js.map → chunk-KZHMLRKY.js.map} +0 -0
  277. /package/dist/chunks/{chunk-5HS5WIS3.js.map → chunk-LGH2T6KL.js.map} +0 -0
  278. /package/dist/chunks/{chunk-2OGJPIGN.js.map → chunk-LQJ3TB5E.js.map} +0 -0
  279. /package/dist/chunks/{chunk-TF6ZSM2M.js.map → chunk-LYPEV765.js.map} +0 -0
  280. /package/dist/chunks/{chunk-YU65OZTC.js.map → chunk-M44I7P3H.js.map} +0 -0
  281. /package/dist/chunks/{chunk-HAHNDC7N.js.map → chunk-NAWIOVUH.js.map} +0 -0
  282. /package/dist/chunks/{chunk-WWC6L5WC.js.map → chunk-NGE7TNCY.js.map} +0 -0
  283. /package/dist/chunks/{chunk-CSWUOY5K.js.map → chunk-NXJQTDVT.js.map} +0 -0
  284. /package/dist/chunks/{chunk-O6QJXKWZ.js.map → chunk-OEKCCZ7I.js.map} +0 -0
  285. /package/dist/chunks/{chunk-3VKSD45U.js.map → chunk-OL5SKFPM.js.map} +0 -0
  286. /package/dist/chunks/{chunk-MPUHBR73.js.map → chunk-OMP25UWR.js.map} +0 -0
  287. /package/dist/chunks/{chunk-GTRG5VXA.js.map → chunk-P53E77KS.js.map} +0 -0
  288. /package/dist/chunks/{chunk-P6CNFKJC.js.map → chunk-PI6KC5CD.js.map} +0 -0
  289. /package/dist/chunks/{chunk-RZXNXGRE.js.map → chunk-Q5DW33F4.js.map} +0 -0
  290. /package/dist/chunks/{chunk-RQKE2URW.js.map → chunk-QS65X7D6.js.map} +0 -0
  291. /package/dist/chunks/{chunk-BIWDWFAK.js.map → chunk-QZ4V25KD.js.map} +0 -0
  292. /package/dist/chunks/{chunk-JBQATPG3.js.map → chunk-RCLTSI6G.js.map} +0 -0
  293. /package/dist/chunks/{chunk-ZRM2NW77.js.map → chunk-RDWVNVZS.js.map} +0 -0
  294. /package/dist/chunks/{chunk-J267C5O6.js.map → chunk-SMX5YHRV.js.map} +0 -0
  295. /package/dist/chunks/{chunk-YOCPU3WT.js.map → chunk-SQWFNFEX.js.map} +0 -0
  296. /package/dist/chunks/{chunk-PR3HSIXG.js.map → chunk-SR75L2R5.js.map} +0 -0
  297. /package/dist/chunks/{chunk-G2DGASUC.js.map → chunk-T5X3GYBF.js.map} +0 -0
  298. /package/dist/chunks/{chunk-GN4BLP6C.js.map → chunk-TJSGSC2W.js.map} +0 -0
  299. /package/dist/chunks/{chunk-B4M4IEOE.js.map → chunk-TTXZK3BR.js.map} +0 -0
  300. /package/dist/chunks/{chunk-F2I6X667.js.map → chunk-U7AQ4OQJ.js.map} +0 -0
  301. /package/dist/chunks/{chunk-VONTYDZ3.js.map → chunk-UPSI724V.js.map} +0 -0
  302. /package/dist/chunks/{chunk-SRBCU3IJ.js.map → chunk-V23HHK5D.js.map} +0 -0
  303. /package/dist/chunks/{chunk-R77WPUUF.js.map → chunk-VQHVH7X2.js.map} +0 -0
  304. /package/dist/chunks/{chunk-FJZL4BJN.js.map → chunk-WJ4YRFPQ.js.map} +0 -0
  305. /package/dist/chunks/{chunk-64CDTVEM.js.map → chunk-WJXVNXJZ.js.map} +0 -0
  306. /package/dist/chunks/{chunk-DXFPBLQV.js.map → chunk-WOX4KI7C.js.map} +0 -0
  307. /package/dist/chunks/{chunk-3MUNYBIF.js.map → chunk-X3L6N5RM.js.map} +0 -0
  308. /package/dist/chunks/{chunk-JE2S7MW2.js.map → chunk-XFMGW2C5.js.map} +0 -0
  309. /package/dist/chunks/{chunk-W5IR3SD3.js.map → chunk-XPCRLKFO.js.map} +0 -0
  310. /package/dist/chunks/{chunk-XCDXSRY7.js.map → chunk-XYT53O3Z.js.map} +0 -0
  311. /package/dist/chunks/{chunk-LJ4DIGHQ.js.map → chunk-YSV633T5.js.map} +0 -0
  312. /package/dist/chunks/{chunk-LRLMZTZ3.js.map → chunk-ZXFEHB7N.js.map} +0 -0
  313. /package/dist/chunks/{commands-J7XAMJC5.js.map → commands-IOHIM2PX.js.map} +0 -0
  314. /package/dist/chunks/{crash-report-3GPFLNQX.js.map → crash-report-WLLGI2U4.js.map} +0 -0
  315. /package/dist/chunks/{dist-EGCYKNFG.js.map → day-CU5J7UAK.js.map} +0 -0
  316. /package/dist/chunks/{dist-2EQ3MAWA.js.map → dist-33QU2MGT.js.map} +0 -0
  317. /package/dist/chunks/{dist-IS662MSA.js.map → dist-6G55RC27.js.map} +0 -0
  318. /package/dist/chunks/{dist-5LXAFF2H.js.map → dist-CFPNJCLJ.js.map} +0 -0
  319. /package/dist/chunks/{dist-CO47MPO4.js.map → dist-E2PF4PGO.js.map} +0 -0
  320. /package/dist/chunks/{dist-4TO2X6U4.js.map → dist-FZYKXUR4.js.map} +0 -0
  321. /package/dist/chunks/{dist-UXUFCGIX.js.map → dist-IXAUMLZH.js.map} +0 -0
  322. /package/dist/chunks/{doctor-YC6Z7P3P.js.map → dist-MBVPANQB.js.map} +0 -0
  323. /package/dist/chunks/{dist-F36KOHDP.js.map → dist-PKKDBDSA.js.map} +0 -0
  324. /package/dist/chunks/{home-EBXWUU6C.js.map → doctor-BXRPVVKL.js.map} +0 -0
  325. /package/dist/chunks/{drain-5BQHD3KW.js.map → drain-EWKGL77B.js.map} +0 -0
  326. /package/dist/chunks/{entry-ZJWR3CSL.js.map → entry-XPXHELKT.js.map} +0 -0
  327. /package/dist/chunks/{eval-JHNFGVGA.js.map → eval-OLNNJGUO.js.map} +0 -0
  328. /package/dist/chunks/{host-JU76NQJY.js.map → home-T4ZVXIEX.js.map} +0 -0
  329. /package/dist/chunks/{lifecycle-VBNEAO74.js.map → host-LQ6V4NJS.js.map} +0 -0
  330. /package/dist/chunks/{host-queries-6TO7AIZE.js.map → host-queries-LEPTBKZK.js.map} +0 -0
  331. /package/dist/chunks/{learn-YGTIACD6.js.map → learn-WOZKPYR4.js.map} +0 -0
  332. /package/dist/chunks/{learn-builtin-FND7NEEV.js.map → learn-builtin-BVJFZF4R.js.map} +0 -0
  333. /package/dist/chunks/{live-N3PPNKW6.js.map → lifecycle-KKIDSRJV.js.map} +0 -0
  334. /package/dist/chunks/{list-GQEKL3MC.js.map → list-ZWIXNGJV.js.map} +0 -0
  335. /package/dist/chunks/{login-KEFAKXJZ.js.map → live-4GQNVGPU.js.map} +0 -0
  336. /package/dist/chunks/{open-Q63ZNCNO.js.map → login-MBXPJW6F.js.map} +0 -0
  337. /package/dist/chunks/{logs-JZEIQMOQ.js.map → logs-7GVMBYAQ.js.map} +0 -0
  338. /package/dist/chunks/{mcp-7CBDNNY3.js.map → mcp-45UUEZMF.js.map} +0 -0
  339. /package/dist/chunks/{output-schema-ROCYTWMQ.js.map → open-UG6VAHDW.js.map} +0 -0
  340. /package/dist/chunks/{operator-tools-SEK3DCMJ.js.map → operator-tools-M4SMIAYS.js.map} +0 -0
  341. /package/dist/chunks/{peers-JILQNRCW.js.map → output-schema-MZ6X4WQ2.js.map} +0 -0
  342. /package/dist/chunks/{pal-XOMURPYQ.js.map → pal-R4RSZP2U.js.map} +0 -0
  343. /package/dist/chunks/{peers-GY5QNN5F.js.map → peers-6TIMGPGR.js.map} +0 -0
  344. /package/dist/chunks/{providers-NMMTLTEC.js.map → peers-T5SXNFYU.js.map} +0 -0
  345. /package/dist/chunks/{pty-KR5RNX54.js.map → providers-CPHEQZCV.js.map} +0 -0
  346. /package/dist/chunks/{resume-A3XPV4Z5.js.map → pty-YAFV4ZA6.js.map} +0 -0
  347. /package/dist/chunks/{resume-command-WOG47T6A.js.map → render-QFCCPEEL.js.map} +0 -0
  348. /package/dist/chunks/{start-check-CLSVKYRW.js.map → resume-GZGHY4UR.js.map} +0 -0
  349. /package/dist/chunks/{store-4RNQ47OD.js.map → resume-command-WJH7SKYB.js.map} +0 -0
  350. /package/dist/chunks/{schedule-V3OHZVHK.js.map → schedule-I7ZNWSN3.js.map} +0 -0
  351. /package/dist/chunks/{service-XPJSCHPW.js.map → service-ZRXXXJW7.js.map} +0 -0
  352. /package/dist/chunks/{skills-PGO6KGCD.js.map → skills-RIJBOCKN.js.map} +0 -0
  353. /package/dist/chunks/{store-7SESBCUG.js.map → start-check-5DQL76YU.js.map} +0 -0
  354. /package/dist/chunks/{startup-failure-WN5PCOIE.js.map → startup-failure-7KMOAOXE.js.map} +0 -0
  355. /package/dist/chunks/{state-W72YF7CF.js.map → state-QNSG3QWY.js.map} +0 -0
  356. /package/dist/chunks/{store-J4CYKAFS.js.map → store-7NXFZTW7.js.map} +0 -0
  357. /package/dist/chunks/{store-SQINHTJO.js.map → store-IDSNTJRG.js.map} +0 -0
  358. /package/dist/chunks/{upgrade-HE5NIE2M.js.map → upgrade-UZTPAIDF.js.map} +0 -0
  359. /package/dist/chunks/{workspaces-CPOLSOKE.js.map → workspaces-KLYC5537.js.map} +0 -0
  360. /package/dist/chunks/{worktree-TUBWOHUQ.js.map → worktree-4PKAJ7LT.js.map} +0 -0
@@ -325,7 +325,7 @@ var require_brace_expansion = __commonJS({
325
325
  });
326
326
 
327
327
  // ../sdk/dist/version.js
328
- var VERSION = "62.13.0";
328
+ var VERSION = "62.14.0";
329
329
 
330
330
  // ../sdk/dist/runtime/harness-session/index.js
331
331
  import { posix, win32 } from "node:path";
@@ -28976,7 +28976,16 @@ var STRUCTURED_OUTPUT_REPROMPT = "[SYSTEM] This task requires a structured resul
28976
28976
  // ../sdk/dist/constants/telemetry/index.js
28977
28977
  var GENAI = {
28978
28978
  OPERATION_NAME: "gen_ai.operation.name",
28979
+ /**
28980
+ * Namzu's own provider id. Not in the pinned
28981
+ * GenAI convention, which names the provider with {@link GENAI.PROVIDER_NAME}.
28982
+ * Kept because it is existing output.
28983
+ */
28979
28984
  SYSTEM: "gen_ai.system",
28985
+ /** Convention `gen_ai.provider.name`: set only when our provider id maps to a value the convention lists. */
28986
+ PROVIDER_NAME: "gen_ai.provider.name",
28987
+ /** `true` on a model call made in streaming mode. */
28988
+ REQUEST_STREAM: "gen_ai.request.stream",
28980
28989
  REQUEST_MODEL: "gen_ai.request.model",
28981
28990
  REQUEST_TEMPERATURE: "gen_ai.request.temperature",
28982
28991
  REQUEST_MAX_TOKENS: "gen_ai.request.max_tokens",
@@ -28985,6 +28994,9 @@ var GENAI = {
28985
28994
  RESPONSE_ID: "gen_ai.response.id",
28986
28995
  USAGE_INPUT_TOKENS: "gen_ai.usage.input_tokens",
28987
28996
  USAGE_OUTPUT_TOKENS: "gen_ai.usage.output_tokens",
28997
+ USAGE_CACHE_READ_INPUT_TOKENS: "gen_ai.usage.cache_read.input_tokens",
28998
+ USAGE_CACHE_CREATION_INPUT_TOKENS: "gen_ai.usage.cache_creation.input_tokens",
28999
+ USAGE_REASONING_OUTPUT_TOKENS: "gen_ai.usage.reasoning.output_tokens",
28988
29000
  /**
28989
29001
  * Which kind of token a usage measurement counts. The convention keys
28990
29002
  * one metric by this rather than minting a metric name per kind, so a
@@ -29174,6 +29186,9 @@ var LOG_SECRET_PATTERNS = [
29174
29186
  ["json-secret-field", /"(?:api[_-]?key|authorization|token|secret|password)"\s*:\s*"[^"]*"/gi]
29175
29187
  ];
29176
29188
 
29189
+ // ../sdk/dist/constants/data-epoch.js
29190
+ var DATA_EPOCH = 1;
29191
+
29177
29192
  // ../sdk/dist/registry/collision.js
29178
29193
  var RegistryCollisionError = class extends Error {
29179
29194
  static {
@@ -30199,9 +30214,637 @@ var TraceAPI = class _TraceAPI {
30199
30214
  // ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js
30200
30215
  var trace = TraceAPI.getInstance();
30201
30216
 
30217
+ // ../sdk/dist/provider/errors.js
30218
+ var PROVIDER_ERROR_KINDS = [
30219
+ "throttle",
30220
+ "network",
30221
+ "auth",
30222
+ "context_overflow",
30223
+ "bad_request",
30224
+ "server"
30225
+ ];
30226
+ var ProviderRequestError = class extends Error {
30227
+ static {
30228
+ __name(this, "ProviderRequestError");
30229
+ }
30230
+ kind;
30231
+ providerId;
30232
+ providerCode;
30233
+ status;
30234
+ retryAfterMs;
30235
+ /**
30236
+ * What the provider said was wrong, truncated and redacted.
30237
+ *
30238
+ * `ProviderRequestErrorInit` has declared this field all along and the
30239
+ * constructor never read it, so every caller that set it was writing to
30240
+ * nothing. That is not a cosmetic gap: a provider rejecting a request
30241
+ * usually names the exact offending field, and losing that sentence turns
30242
+ * a one-line diagnosis into hypothesis elimination against a live API. It
30243
+ * did — a tool schema in the wrong JSON Schema dialect cost a day of
30244
+ * production downtime while the wire had been saying
30245
+ * `tools.0.custom.input_schema: … must match JSON Schema draft 2020-12`
30246
+ * the whole time.
30247
+ *
30248
+ * See {@link vendorDetail} for what is kept and what is scrubbed.
30249
+ */
30250
+ detail;
30251
+ /** The provider's `x-should-retry` verdict, when it sent one; see {@link ProviderRequestErrorInit.shouldRetry}. */
30252
+ shouldRetry;
30253
+ /** The part of the network path the request tripped on, when known; see {@link ProviderRequestErrorInit.transport}. */
30254
+ transport;
30255
+ constructor(init) {
30256
+ super(buildProviderErrorMessage(init));
30257
+ this.name = "ProviderRequestError";
30258
+ this.kind = init.kind;
30259
+ this.providerId = init.providerId;
30260
+ const exactProviderCode = safeProviderCode(init.providerCode);
30261
+ if (exactProviderCode !== void 0)
30262
+ this.providerCode = exactProviderCode;
30263
+ if (init.status !== void 0)
30264
+ this.status = init.status;
30265
+ if (init.retryAfterMs !== void 0)
30266
+ this.retryAfterMs = init.retryAfterMs;
30267
+ if (init.detail !== void 0)
30268
+ this.detail = init.detail;
30269
+ if (init.shouldRetry !== void 0)
30270
+ this.shouldRetry = init.shouldRetry;
30271
+ if (init.transport !== void 0)
30272
+ this.transport = init.transport;
30273
+ }
30274
+ };
30275
+ var DETAIL_MAX = 400;
30276
+ var PROVIDER_CODE = /^[A-Za-z][A-Za-z0-9._-]{0,79}$/;
30277
+ function safeProviderCode(value) {
30278
+ if (typeof value !== "string" || !PROVIDER_CODE.test(value))
30279
+ return void 0;
30280
+ return redactSecrets(value) === value ? value : void 0;
30281
+ }
30282
+ __name(safeProviderCode, "safeProviderCode");
30283
+ function providerCode(value) {
30284
+ let decoded = value;
30285
+ if (typeof decoded === "string") {
30286
+ try {
30287
+ decoded = JSON.parse(decoded);
30288
+ } catch {
30289
+ return void 0;
30290
+ }
30291
+ }
30292
+ if (typeof decoded !== "object" || decoded === null)
30293
+ return void 0;
30294
+ const record4 = decoded;
30295
+ const nested = typeof record4.error === "object" && record4.error !== null ? record4.error.code : void 0;
30296
+ return safeProviderCode(record4.code ?? nested);
30297
+ }
30298
+ __name(providerCode, "providerCode");
30299
+ function usageLimitTypeOf(error62) {
30300
+ if (typeof error62 !== "object" || error62 === null)
30301
+ return void 0;
30302
+ const outer = error62;
30303
+ const inner = typeof outer.error === "object" && outer.error !== null ? outer.error : void 0;
30304
+ const innermost = typeof inner?.error === "object" && inner.error !== null ? inner.error : void 0;
30305
+ for (const candidate of [outer.type, inner?.type, innermost?.type]) {
30306
+ if (typeof candidate === "string" && isUsageLimitSignal(candidate, void 0)) {
30307
+ return safeProviderCode(candidate);
30308
+ }
30309
+ }
30310
+ return void 0;
30311
+ }
30312
+ __name(usageLimitTypeOf, "usageLimitTypeOf");
30313
+ function vendorDetail(body) {
30314
+ if (body === void 0 || body === null)
30315
+ return void 0;
30316
+ let text11;
30317
+ if (typeof body === "string") {
30318
+ try {
30319
+ text11 = pickMessage(JSON.parse(body)) ?? body;
30320
+ } catch {
30321
+ text11 = body;
30322
+ }
30323
+ } else {
30324
+ text11 = pickMessage(body) ?? "";
30325
+ }
30326
+ const cleaned2 = redactSecrets(text11.trim());
30327
+ if (cleaned2.length === 0)
30328
+ return void 0;
30329
+ return cleaned2.length > DETAIL_MAX ? `${cleaned2.slice(0, DETAIL_MAX)}\u2026` : cleaned2;
30330
+ }
30331
+ __name(vendorDetail, "vendorDetail");
30332
+ function redactSecrets(text11) {
30333
+ let out = text11;
30334
+ for (const [label5, pattern] of LOG_SECRET_PATTERNS) {
30335
+ out = out.replace(pattern, `[REDACTED:${label5}]`);
30336
+ }
30337
+ return out;
30338
+ }
30339
+ __name(redactSecrets, "redactSecrets");
30340
+ function pickMessage(value) {
30341
+ if (typeof value === "string")
30342
+ return value;
30343
+ if (typeof value !== "object" || value === null)
30344
+ return void 0;
30345
+ const node2 = value;
30346
+ const nested = node2.error;
30347
+ if (typeof nested === "string")
30348
+ return nested;
30349
+ if (typeof nested === "object" && nested !== null) {
30350
+ const message = nested.message;
30351
+ if (typeof message === "string")
30352
+ return message;
30353
+ }
30354
+ if (typeof node2.message === "string")
30355
+ return node2.message;
30356
+ return void 0;
30357
+ }
30358
+ __name(pickMessage, "pickMessage");
30359
+ function isProviderRequestError(err) {
30360
+ const exactProviderCode = err?.providerCode;
30361
+ return err instanceof Error && err.name === "ProviderRequestError" && typeof err.providerId === "string" && PROVIDER_ERROR_KINDS.includes(err.kind) && (exactProviderCode === void 0 || safeProviderCode(exactProviderCode) === exactProviderCode);
30362
+ }
30363
+ __name(isProviderRequestError, "isProviderRequestError");
30364
+ function isCallerAbortError(error62, signal) {
30365
+ if (!signal?.aborted)
30366
+ return false;
30367
+ if (error62 === signal.reason)
30368
+ return true;
30369
+ if (!(error62 instanceof Error))
30370
+ return false;
30371
+ return error62.name === "AbortError" || error62.name === "APIUserAbortError";
30372
+ }
30373
+ __name(isCallerAbortError, "isCallerAbortError");
30374
+ var KIND_SENTENCE = {
30375
+ throttle: "rate limited by the provider",
30376
+ network: "could not reach the provider",
30377
+ auth: "the provider rejected the request credentials",
30378
+ context_overflow: "the request exceeded the model context window",
30379
+ bad_request: "the provider rejected the request as invalid",
30380
+ server: "the provider failed to complete the request"
30381
+ };
30382
+ function buildProviderErrorMessage(init) {
30383
+ const status = init.status !== void 0 ? ` (HTTP ${init.status})` : "";
30384
+ const detail = init.detail ? `: ${init.detail}` : "";
30385
+ return `${init.providerId}${status} \u2014 ${KIND_SENTENCE[init.kind]}${detail}`;
30386
+ }
30387
+ __name(buildProviderErrorMessage, "buildProviderErrorMessage");
30388
+ var OVERFLOW_BODY_PATTERNS = [
30389
+ /prompt is too long/i,
30390
+ /context[_ ]length[_ ]exceeded/i,
30391
+ /maximum context length/i,
30392
+ /too long for requested model/i,
30393
+ /input is too long/i,
30394
+ /(?:input|prompt|context).{0,80}exceeds the maximum/i,
30395
+ /reduce the (?:input|prompt|context) length/i,
30396
+ // Ollama phrases it the other way round — "input length exceeds context
30397
+ // length" — so a pattern anchored on "exceeded" misses it entirely.
30398
+ /exceeds?\s+(?:the\s+)?(?:model'?s?\s+)?context\s+(?:length|window|size)/i,
30399
+ /context\s+(?:length|window|size)\s+exceed/i,
30400
+ // The bare phrase "context
30401
+ // window" is too broad on its own. Here it must sit next to a verb that says the request did not
30402
+ // fit ("larger than the model context window of N tokens"), so a 400 that
30403
+ // only names the window ("does not support this parameter with the 1M
30404
+ // context window beta") stays an invalid request. The same pattern lives in
30405
+ // `types/provider/errors.ts` (`codeFromMessage`), which also gates it on the
30406
+ // status; keep them equal.
30407
+ /(?:exceed\w*|too (?:long|large|big)|larger than|longer than|over the|beyond|maximum|overflow\w*)\b[^.]{0,60}context window|context window[^.]{0,60}\b(?:exceed\w*|too (?:long|large|big)|larger than|longer than|over the|beyond|maximum|overflow\w*)/i,
30408
+ // "input length and `max_tokens` exceed context limit: A + B > C". The
30409
+ // prompt may fit and only the requested output not; the loop tries a smaller
30410
+ // `max_tokens` first (readOutputOverflow) and falls back to shedding history
30411
+ // when there is no room for a useful reply, which needs this to classify.
30412
+ /input length and `?max_tokens`? exceed context limit/i
30413
+ ];
30414
+ function bodySaysContextOverflow(body) {
30415
+ if (!body)
30416
+ return false;
30417
+ return OVERFLOW_BODY_PATTERNS.some((re2) => re2.test(body));
30418
+ }
30419
+ __name(bodySaysContextOverflow, "bodySaysContextOverflow");
30420
+ function parseShouldRetry(value) {
30421
+ return value?.trim().toLowerCase() === "false" ? false : void 0;
30422
+ }
30423
+ __name(parseShouldRetry, "parseShouldRetry");
30424
+ function parseRetryAfterMs(headerValue2, now = Date.now()) {
30425
+ if (!headerValue2)
30426
+ return void 0;
30427
+ const trimmed = headerValue2.trim();
30428
+ if (trimmed === "")
30429
+ return void 0;
30430
+ if (/^\d+(\.\d+)?$/.test(trimmed)) {
30431
+ const seconds2 = Number(trimmed);
30432
+ if (!Number.isFinite(seconds2) || seconds2 < 0)
30433
+ return void 0;
30434
+ return Math.round(seconds2 * 1e3);
30435
+ }
30436
+ const at = Date.parse(trimmed);
30437
+ if (Number.isNaN(at))
30438
+ return void 0;
30439
+ const delta = at - now;
30440
+ return delta > 0 ? delta : void 0;
30441
+ }
30442
+ __name(parseRetryAfterMs, "parseRetryAfterMs");
30443
+ function classifyProviderHttpStatus(status, body) {
30444
+ if (status === 401 || status === 403)
30445
+ return "auth";
30446
+ if (status === 429)
30447
+ return "throttle";
30448
+ if (status === 408 || status === 425)
30449
+ return "network";
30450
+ if (status >= 500)
30451
+ return "server";
30452
+ if (status === 413) {
30453
+ return bodySaysContextOverflow(body) ? "context_overflow" : "bad_request";
30454
+ }
30455
+ if (status >= 400) {
30456
+ return bodySaysContextOverflow(body) ? "context_overflow" : "bad_request";
30457
+ }
30458
+ return "server";
30459
+ }
30460
+ __name(classifyProviderHttpStatus, "classifyProviderHttpStatus");
30461
+ var VENDOR_TYPE_KINDS = [
30462
+ [/overloaded_error|api_error|service_unavailable/i, "server"],
30463
+ [/rate_limit_error|rate_limit_exceeded/i, "throttle"],
30464
+ [/authentication_error|permission_error|invalid_api_key|unauthorized/i, "auth"],
30465
+ [/timeout_error|connection_error/i, "network"]
30466
+ ];
30467
+ function vendorTypeKind(message) {
30468
+ for (const [re2, kind] of VENDOR_TYPE_KINDS) {
30469
+ if (re2.test(message))
30470
+ return kind;
30471
+ }
30472
+ return void 0;
30473
+ }
30474
+ __name(vendorTypeKind, "vendorTypeKind");
30475
+ function vendorErrorStatus(err) {
30476
+ if (typeof err !== "object" || err === null)
30477
+ return void 0;
30478
+ const e = err;
30479
+ for (const candidate of [e.status, e.statusCode, e.status_code, e.$metadata?.httpStatusCode]) {
30480
+ if (typeof candidate === "number" && Number.isFinite(candidate))
30481
+ return candidate;
30482
+ }
30483
+ return void 0;
30484
+ }
30485
+ __name(vendorErrorStatus, "vendorErrorStatus");
30486
+ function vendorRetryAfter(err) {
30487
+ if (typeof err !== "object" || err === null)
30488
+ return void 0;
30489
+ const headers = err.headers ?? err.$response?.headers;
30490
+ if (!headers)
30491
+ return void 0;
30492
+ if (typeof headers.get === "function") {
30493
+ return headers.get("retry-after") ?? void 0;
30494
+ }
30495
+ const record4 = headers;
30496
+ for (const key6 of ["retry-after", "Retry-After", "retryAfter"]) {
30497
+ const value = record4[key6];
30498
+ if (typeof value === "string")
30499
+ return value;
30500
+ }
30501
+ return void 0;
30502
+ }
30503
+ __name(vendorRetryAfter, "vendorRetryAfter");
30504
+ var REQUEST_ID_HEADERS = ["x-request-id", "request-id", "x-goog-request-id"];
30505
+ function vendorHeader(err, names) {
30506
+ if (typeof err !== "object" || err === null)
30507
+ return void 0;
30508
+ const headers = err.headers ?? err.$response?.headers;
30509
+ if (!headers)
30510
+ return void 0;
30511
+ for (const name2 of names) {
30512
+ if (typeof headers.get === "function") {
30513
+ const value2 = headers.get(name2);
30514
+ if (value2)
30515
+ return value2;
30516
+ continue;
30517
+ }
30518
+ const value = headers[name2];
30519
+ if (typeof value === "string" && value)
30520
+ return value;
30521
+ }
30522
+ return void 0;
30523
+ }
30524
+ __name(vendorHeader, "vendorHeader");
30525
+ var FIELD_VALUE = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/;
30526
+ function fieldValue(value) {
30527
+ return typeof value === "string" && FIELD_VALUE.test(value) && redactSecrets(value) === value ? value : void 0;
30528
+ }
30529
+ __name(fieldValue, "fieldValue");
30530
+ function structuredVendorDetail(input2) {
30531
+ const message = vendorDetail(input2.message?.replace(/^\d{3}\s+/, ""));
30532
+ const type = fieldValue(input2.type);
30533
+ const code = fieldValue(input2.code);
30534
+ const param = fieldValue(input2.param);
30535
+ const requestId = fieldValue(input2.requestId);
30536
+ if (!type && !code && !param && !requestId)
30537
+ return message;
30538
+ if (!message)
30539
+ return void 0;
30540
+ return JSON.stringify({
30541
+ error: {
30542
+ message,
30543
+ ...type ? { type } : {},
30544
+ ...code ? { code } : {},
30545
+ ...param ? { param } : {}
30546
+ },
30547
+ ...requestId ? { request_id: requestId } : {}
30548
+ });
30549
+ }
30550
+ __name(structuredVendorDetail, "structuredVendorDetail");
30551
+ function providerVendorError(input2) {
30552
+ const { error: error62 } = input2;
30553
+ const status = vendorErrorStatus(error62);
30554
+ const exactProviderCode = providerCode(error62) ?? usageLimitTypeOf(error62);
30555
+ const name2 = error62 instanceof Error ? error62.name : "";
30556
+ const message = error62 instanceof Error ? error62.message : "";
30557
+ const transport = readTransportCause(error62);
30558
+ let kind;
30559
+ if (transport !== void 0) {
30560
+ kind = "network";
30561
+ } else if (/ThrottlingException|TooManyRequests|ServiceQuotaExceeded/i.test(name2)) {
30562
+ kind = "throttle";
30563
+ } else if (/AccessDenied|Unauthorized|Forbidden|Authentication/i.test(name2)) {
30564
+ kind = "auth";
30565
+ } else if (/ValidationException/i.test(name2)) {
30566
+ kind = bodySaysContextOverflow(message) ? "context_overflow" : "bad_request";
30567
+ } else if (/ServiceUnavailable|InternalServer|ModelTimeout|ModelStreamError|ModelError|ModelNotReady/i.test(name2)) {
30568
+ kind = "server";
30569
+ } else if (status !== void 0) {
30570
+ kind = classifyProviderHttpStatus(status, message);
30571
+ } else if (exactProviderCode === "invalid_image") {
30572
+ kind = "bad_request";
30573
+ } else if (bodySaysContextOverflow(message)) {
30574
+ kind = "context_overflow";
30575
+ } else {
30576
+ kind = vendorTypeKind(message) ?? "network";
30577
+ }
30578
+ const retryAfterMs = parseRetryAfterMs(input2.retryAfter ?? vendorRetryAfter(error62), input2.now ?? Date.now());
30579
+ const certificate = status === void 0 ? readCertificateFailure(error62) : void 0;
30580
+ const shouldRetry = transport !== void 0 || certificate !== void 0 ? false : parseShouldRetry(vendorHeader(error62, ["x-should-retry"]));
30581
+ const fields2 = error62;
30582
+ const detail = carriesBody(message) ? vendorDetail(message) : structuredVendorDetail({
30583
+ message,
30584
+ type: fields2?.type,
30585
+ code: exactProviderCode,
30586
+ param: fields2?.param,
30587
+ requestId: fields2?.requestID ?? vendorHeader(error62, REQUEST_ID_HEADERS)
30588
+ });
30589
+ return new ProviderRequestError({
30590
+ kind,
30591
+ providerId: input2.providerId,
30592
+ ...certificate !== void 0 ? { providerCode: certificate } : exactProviderCode !== void 0 ? { providerCode: exactProviderCode } : {},
30593
+ ...status !== void 0 ? { status } : {},
30594
+ ...retryAfterMs !== void 0 ? { retryAfterMs } : {},
30595
+ ...detail !== void 0 ? { detail } : {},
30596
+ ...shouldRetry !== void 0 ? { shouldRetry } : {},
30597
+ ...transport !== void 0 ? { transport } : {}
30598
+ });
30599
+ }
30600
+ __name(providerVendorError, "providerVendorError");
30601
+ function carriesBody(message) {
30602
+ const rest = message.replace(/^\d{3}\s+/, "").trim();
30603
+ if (!rest.startsWith("{"))
30604
+ return false;
30605
+ try {
30606
+ const parsed = JSON.parse(rest);
30607
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed);
30608
+ } catch {
30609
+ return false;
30610
+ }
30611
+ }
30612
+ __name(carriesBody, "carriesBody");
30613
+ function parsedBody(body) {
30614
+ let decoded = body;
30615
+ if (typeof decoded === "string") {
30616
+ try {
30617
+ decoded = JSON.parse(decoded);
30618
+ } catch {
30619
+ return void 0;
30620
+ }
30621
+ }
30622
+ return typeof decoded === "object" && decoded !== null && !Array.isArray(decoded) ? decoded : void 0;
30623
+ }
30624
+ __name(parsedBody, "parsedBody");
30625
+ function bodyErrorFields(body) {
30626
+ const inner = body && typeof body.error === "object" && body.error !== null ? body.error : void 0;
30627
+ if (!inner)
30628
+ return {};
30629
+ return {
30630
+ type: inner.type ?? (typeof inner.status === "string" ? inner.status : void 0),
30631
+ code: typeof inner.code === "string" ? inner.code : void 0,
30632
+ param: inner.param
30633
+ };
30634
+ }
30635
+ __name(bodyErrorFields, "bodyErrorFields");
30636
+ function providerHttpError(input2) {
30637
+ const kind = classifyProviderHttpStatus(input2.status, input2.body);
30638
+ const retryAfterMs = parseRetryAfterMs(input2.retryAfter, input2.now ?? Date.now());
30639
+ const body = parsedBody(input2.body);
30640
+ const bodyError = bodyErrorFields(body);
30641
+ const detail = body ? structuredVendorDetail({
30642
+ message: vendorDetail(input2.body),
30643
+ type: bodyError.type,
30644
+ code: bodyError.code,
30645
+ param: bodyError.param,
30646
+ requestId: input2.requestId
30647
+ }) : vendorDetail(input2.body);
30648
+ const exactProviderCode = providerCode(input2.body);
30649
+ const shouldRetry = parseShouldRetry(input2.shouldRetry);
30650
+ return new ProviderRequestError({
30651
+ kind,
30652
+ providerId: input2.providerId,
30653
+ ...exactProviderCode !== void 0 ? { providerCode: exactProviderCode } : {},
30654
+ status: input2.status,
30655
+ ...retryAfterMs !== void 0 ? { retryAfterMs } : {},
30656
+ ...detail !== void 0 ? { detail } : {},
30657
+ ...shouldRetry !== void 0 ? { shouldRetry } : {}
30658
+ });
30659
+ }
30660
+ __name(providerHttpError, "providerHttpError");
30661
+
30662
+ // ../sdk/dist/telemetry/attributes.js
30663
+ function agentTurnSpanName(agentName) {
30664
+ return `namzu.agent.turn ${agentName}`;
30665
+ }
30666
+ __name(agentTurnSpanName, "agentTurnSpanName");
30667
+ function agentIterationSpanName(iteration) {
30668
+ return `namzu.agent.iteration ${iteration}`;
30669
+ }
30670
+ __name(agentIterationSpanName, "agentIterationSpanName");
30671
+ function toolSpanName(toolName) {
30672
+ return `namzu.tool.execute ${toolName}`;
30673
+ }
30674
+ __name(toolSpanName, "toolSpanName");
30675
+ function chatSpanName(model) {
30676
+ return `chat ${model}`;
30677
+ }
30678
+ __name(chatSpanName, "chatSpanName");
30679
+ function parentContext(parent) {
30680
+ const active = context.active();
30681
+ if (!parent)
30682
+ return active;
30683
+ if (!isSerialized(parent))
30684
+ return trace.setSpan(active, parent);
30685
+ const context2 = toSpanContext(parent);
30686
+ if (!context2)
30687
+ return active;
30688
+ return trace.setSpan(active, trace.wrapSpanContext(context2));
30689
+ }
30690
+ __name(parentContext, "parentContext");
30691
+ function isSerialized(value) {
30692
+ return typeof value.traceId === "string";
30693
+ }
30694
+ __name(isSerialized, "isSerialized");
30695
+ var HEX_TRACE_ID = /^[0-9a-f]{32}$/;
30696
+ var HEX_SPAN_ID = /^[0-9a-f]{16}$/;
30697
+ function toSpanContext(serialized) {
30698
+ const { traceId, spanId } = serialized;
30699
+ if (!HEX_TRACE_ID.test(traceId) || !HEX_SPAN_ID.test(spanId))
30700
+ return void 0;
30701
+ if (/^0+$/.test(traceId) || /^0+$/.test(spanId))
30702
+ return void 0;
30703
+ return {
30704
+ traceId,
30705
+ spanId,
30706
+ traceFlags: serialized.traceFlags,
30707
+ // The parent was recorded in another process, whatever that process
30708
+ // was; saying otherwise makes a sampler treat it as locally sampled.
30709
+ isRemote: true
30710
+ };
30711
+ }
30712
+ __name(toSpanContext, "toSpanContext");
30713
+ function serializeSpan(span) {
30714
+ const context2 = span?.spanContext();
30715
+ if (!context2)
30716
+ return void 0;
30717
+ if (!HEX_TRACE_ID.test(context2.traceId) || /^0+$/.test(context2.traceId))
30718
+ return void 0;
30719
+ return {
30720
+ traceId: context2.traceId,
30721
+ spanId: context2.spanId,
30722
+ traceFlags: context2.traceFlags,
30723
+ isRemote: false
30724
+ };
30725
+ }
30726
+ __name(serializeSpan, "serializeSpan");
30727
+
30728
+ // ../sdk/dist/telemetry/genai.js
30729
+ var GENAI_SEMCONV_VERSION = "1.41.1";
30730
+ var GENAI_SEMCONV_SCHEMA_URL = `https://opentelemetry.io/schemas/${GENAI_SEMCONV_VERSION}`;
30731
+ var GENAI_OPERATION = {
30732
+ CHAT: "chat",
30733
+ EXECUTE_TOOL: "execute_tool",
30734
+ INVOKE_AGENT: "invoke_agent"
30735
+ };
30736
+ var ERROR_TYPE = "error.type";
30737
+ var ERROR_TYPE_OTHER = "_OTHER";
30738
+ var GENAI_SEMCONV_ATTRIBUTES = [
30739
+ GENAI.OPERATION_NAME,
30740
+ GENAI.PROVIDER_NAME,
30741
+ ERROR_TYPE,
30742
+ GENAI.CONVERSATION_ID,
30743
+ GENAI.AGENT_NAME,
30744
+ GENAI.AGENT_ID,
30745
+ GENAI.REQUEST_MODEL,
30746
+ GENAI.REQUEST_STREAM,
30747
+ GENAI.REQUEST_TEMPERATURE,
30748
+ GENAI.REQUEST_MAX_TOKENS,
30749
+ GENAI.RESPONSE_MODEL,
30750
+ GENAI.RESPONSE_ID,
30751
+ GENAI.RESPONSE_FINISH_REASONS,
30752
+ GENAI.USAGE_INPUT_TOKENS,
30753
+ GENAI.USAGE_OUTPUT_TOKENS,
30754
+ GENAI.USAGE_CACHE_READ_INPUT_TOKENS,
30755
+ GENAI.USAGE_CACHE_CREATION_INPUT_TOKENS,
30756
+ GENAI.USAGE_REASONING_OUTPUT_TOKENS,
30757
+ GENAI.TOOL_NAME,
30758
+ GENAI.TOOL_CALL_ID,
30759
+ GENAI.TOOL_TYPE
30760
+ ];
30761
+ var GENAI_NON_CONVENTION_NAMES = [GENAI.SYSTEM];
30762
+ var enabled = true;
30763
+ function setGenAiConventions(on) {
30764
+ enabled = on;
30765
+ }
30766
+ __name(setGenAiConventions, "setGenAiConventions");
30767
+ function genAiConventionsEnabled() {
30768
+ return enabled;
30769
+ }
30770
+ __name(genAiConventionsEnabled, "genAiConventionsEnabled");
30771
+ function genAiProviderName(providerId) {
30772
+ switch (providerId) {
30773
+ case "anthropic":
30774
+ return "anthropic";
30775
+ case "bedrock":
30776
+ return "aws.bedrock";
30777
+ case "deepseek":
30778
+ return "deepseek";
30779
+ case "google":
30780
+ return "gcp.gen_ai";
30781
+ case "openai":
30782
+ case "codex":
30783
+ return "openai";
30784
+ default: {
30785
+ const own2 = providerId?.trim().toLowerCase();
30786
+ return own2 ? own2 : void 0;
30787
+ }
30788
+ }
30789
+ }
30790
+ __name(genAiProviderName, "genAiProviderName");
30791
+ function genAiErrorType(err) {
30792
+ if (isProviderRequestError(err))
30793
+ return err.kind;
30794
+ if (err instanceof Error) {
30795
+ const name2 = err.name;
30796
+ return name2 && name2 !== "Error" ? name2 : ERROR_TYPE_OTHER;
30797
+ }
30798
+ return ERROR_TYPE_OTHER;
30799
+ }
30800
+ __name(genAiErrorType, "genAiErrorType");
30801
+ function agentRunAttributes(providerId) {
30802
+ if (!enabled)
30803
+ return {};
30804
+ const provider = genAiProviderName(providerId);
30805
+ return {
30806
+ [GENAI.OPERATION_NAME]: GENAI_OPERATION.INVOKE_AGENT,
30807
+ ...provider !== void 0 ? { [GENAI.PROVIDER_NAME]: provider } : {}
30808
+ };
30809
+ }
30810
+ __name(agentRunAttributes, "agentRunAttributes");
30811
+ function chatStartAttributes(providerId) {
30812
+ if (!enabled)
30813
+ return {};
30814
+ const provider = genAiProviderName(providerId);
30815
+ return {
30816
+ ...provider !== void 0 ? { [GENAI.PROVIDER_NAME]: provider } : {},
30817
+ [GENAI.REQUEST_STREAM]: true
30818
+ };
30819
+ }
30820
+ __name(chatStartAttributes, "chatStartAttributes");
30821
+ function chatUsageAttributes(usage) {
30822
+ if (!enabled)
30823
+ return {};
30824
+ return {
30825
+ ...usage.cachedTokens > 0 ? { [GENAI.USAGE_CACHE_READ_INPUT_TOKENS]: usage.cachedTokens } : {},
30826
+ ...usage.cacheWriteTokens > 0 ? { [GENAI.USAGE_CACHE_CREATION_INPUT_TOKENS]: usage.cacheWriteTokens } : {},
30827
+ ...usage.reasoningTokens !== void 0 && usage.reasoningTokens > 0 ? { [GENAI.USAGE_REASONING_OUTPUT_TOKENS]: usage.reasoningTokens } : {}
30828
+ };
30829
+ }
30830
+ __name(chatUsageAttributes, "chatUsageAttributes");
30831
+ function toolCallAttributes() {
30832
+ if (!enabled)
30833
+ return {};
30834
+ return { [GENAI.OPERATION_NAME]: GENAI_OPERATION.EXECUTE_TOOL };
30835
+ }
30836
+ __name(toolCallAttributes, "toolCallAttributes");
30837
+ var PERMISSION_DENIED = "permission_denied";
30838
+ function errorTypeAttributes(errorType) {
30839
+ if (!enabled)
30840
+ return {};
30841
+ return { [ERROR_TYPE]: errorType };
30842
+ }
30843
+ __name(errorTypeAttributes, "errorTypeAttributes");
30844
+
30202
30845
  // ../sdk/dist/telemetry/runtime-accessors.js
30203
30846
  function getTracer() {
30204
- return trace.getTracer("namzu");
30847
+ return genAiConventionsEnabled() ? trace.getTracerProvider().getTracer("namzu", void 0, { schemaUrl: GENAI_SEMCONV_SCHEMA_URL }) : trace.getTracer("namzu");
30205
30848
  }
30206
30849
  __name(getTracer, "getTracer");
30207
30850
  function getActiveSpanContext() {
@@ -33443,451 +34086,6 @@ function attributionHeaders(identity = NAMZU_APP_IDENTITY) {
33443
34086
  }
33444
34087
  __name(attributionHeaders, "attributionHeaders");
33445
34088
 
33446
- // ../sdk/dist/provider/errors.js
33447
- var PROVIDER_ERROR_KINDS = [
33448
- "throttle",
33449
- "network",
33450
- "auth",
33451
- "context_overflow",
33452
- "bad_request",
33453
- "server"
33454
- ];
33455
- var ProviderRequestError = class extends Error {
33456
- static {
33457
- __name(this, "ProviderRequestError");
33458
- }
33459
- kind;
33460
- providerId;
33461
- providerCode;
33462
- status;
33463
- retryAfterMs;
33464
- /**
33465
- * What the provider said was wrong, truncated and redacted.
33466
- *
33467
- * `ProviderRequestErrorInit` has declared this field all along and the
33468
- * constructor never read it, so every caller that set it was writing to
33469
- * nothing. That is not a cosmetic gap: a provider rejecting a request
33470
- * usually names the exact offending field, and losing that sentence turns
33471
- * a one-line diagnosis into hypothesis elimination against a live API. It
33472
- * did — a tool schema in the wrong JSON Schema dialect cost a day of
33473
- * production downtime while the wire had been saying
33474
- * `tools.0.custom.input_schema: … must match JSON Schema draft 2020-12`
33475
- * the whole time.
33476
- *
33477
- * See {@link vendorDetail} for what is kept and what is scrubbed.
33478
- */
33479
- detail;
33480
- /** The provider's `x-should-retry` verdict, when it sent one; see {@link ProviderRequestErrorInit.shouldRetry}. */
33481
- shouldRetry;
33482
- /** The part of the network path the request tripped on, when known; see {@link ProviderRequestErrorInit.transport}. */
33483
- transport;
33484
- constructor(init) {
33485
- super(buildProviderErrorMessage(init));
33486
- this.name = "ProviderRequestError";
33487
- this.kind = init.kind;
33488
- this.providerId = init.providerId;
33489
- const exactProviderCode = safeProviderCode(init.providerCode);
33490
- if (exactProviderCode !== void 0)
33491
- this.providerCode = exactProviderCode;
33492
- if (init.status !== void 0)
33493
- this.status = init.status;
33494
- if (init.retryAfterMs !== void 0)
33495
- this.retryAfterMs = init.retryAfterMs;
33496
- if (init.detail !== void 0)
33497
- this.detail = init.detail;
33498
- if (init.shouldRetry !== void 0)
33499
- this.shouldRetry = init.shouldRetry;
33500
- if (init.transport !== void 0)
33501
- this.transport = init.transport;
33502
- }
33503
- };
33504
- var DETAIL_MAX = 400;
33505
- var PROVIDER_CODE = /^[A-Za-z][A-Za-z0-9._-]{0,79}$/;
33506
- function safeProviderCode(value) {
33507
- if (typeof value !== "string" || !PROVIDER_CODE.test(value))
33508
- return void 0;
33509
- return redactSecrets(value) === value ? value : void 0;
33510
- }
33511
- __name(safeProviderCode, "safeProviderCode");
33512
- function providerCode(value) {
33513
- let decoded = value;
33514
- if (typeof decoded === "string") {
33515
- try {
33516
- decoded = JSON.parse(decoded);
33517
- } catch {
33518
- return void 0;
33519
- }
33520
- }
33521
- if (typeof decoded !== "object" || decoded === null)
33522
- return void 0;
33523
- const record4 = decoded;
33524
- const nested = typeof record4.error === "object" && record4.error !== null ? record4.error.code : void 0;
33525
- return safeProviderCode(record4.code ?? nested);
33526
- }
33527
- __name(providerCode, "providerCode");
33528
- function usageLimitTypeOf(error62) {
33529
- if (typeof error62 !== "object" || error62 === null)
33530
- return void 0;
33531
- const outer = error62;
33532
- const inner = typeof outer.error === "object" && outer.error !== null ? outer.error : void 0;
33533
- const innermost = typeof inner?.error === "object" && inner.error !== null ? inner.error : void 0;
33534
- for (const candidate of [outer.type, inner?.type, innermost?.type]) {
33535
- if (typeof candidate === "string" && isUsageLimitSignal(candidate, void 0)) {
33536
- return safeProviderCode(candidate);
33537
- }
33538
- }
33539
- return void 0;
33540
- }
33541
- __name(usageLimitTypeOf, "usageLimitTypeOf");
33542
- function vendorDetail(body) {
33543
- if (body === void 0 || body === null)
33544
- return void 0;
33545
- let text11;
33546
- if (typeof body === "string") {
33547
- try {
33548
- text11 = pickMessage(JSON.parse(body)) ?? body;
33549
- } catch {
33550
- text11 = body;
33551
- }
33552
- } else {
33553
- text11 = pickMessage(body) ?? "";
33554
- }
33555
- const cleaned2 = redactSecrets(text11.trim());
33556
- if (cleaned2.length === 0)
33557
- return void 0;
33558
- return cleaned2.length > DETAIL_MAX ? `${cleaned2.slice(0, DETAIL_MAX)}\u2026` : cleaned2;
33559
- }
33560
- __name(vendorDetail, "vendorDetail");
33561
- function redactSecrets(text11) {
33562
- let out = text11;
33563
- for (const [label5, pattern] of LOG_SECRET_PATTERNS) {
33564
- out = out.replace(pattern, `[REDACTED:${label5}]`);
33565
- }
33566
- return out;
33567
- }
33568
- __name(redactSecrets, "redactSecrets");
33569
- function pickMessage(value) {
33570
- if (typeof value === "string")
33571
- return value;
33572
- if (typeof value !== "object" || value === null)
33573
- return void 0;
33574
- const node2 = value;
33575
- const nested = node2.error;
33576
- if (typeof nested === "string")
33577
- return nested;
33578
- if (typeof nested === "object" && nested !== null) {
33579
- const message = nested.message;
33580
- if (typeof message === "string")
33581
- return message;
33582
- }
33583
- if (typeof node2.message === "string")
33584
- return node2.message;
33585
- return void 0;
33586
- }
33587
- __name(pickMessage, "pickMessage");
33588
- function isProviderRequestError(err) {
33589
- const exactProviderCode = err?.providerCode;
33590
- return err instanceof Error && err.name === "ProviderRequestError" && typeof err.providerId === "string" && PROVIDER_ERROR_KINDS.includes(err.kind) && (exactProviderCode === void 0 || safeProviderCode(exactProviderCode) === exactProviderCode);
33591
- }
33592
- __name(isProviderRequestError, "isProviderRequestError");
33593
- function isCallerAbortError(error62, signal) {
33594
- if (!signal?.aborted)
33595
- return false;
33596
- if (error62 === signal.reason)
33597
- return true;
33598
- if (!(error62 instanceof Error))
33599
- return false;
33600
- return error62.name === "AbortError" || error62.name === "APIUserAbortError";
33601
- }
33602
- __name(isCallerAbortError, "isCallerAbortError");
33603
- var KIND_SENTENCE = {
33604
- throttle: "rate limited by the provider",
33605
- network: "could not reach the provider",
33606
- auth: "the provider rejected the request credentials",
33607
- context_overflow: "the request exceeded the model context window",
33608
- bad_request: "the provider rejected the request as invalid",
33609
- server: "the provider failed to complete the request"
33610
- };
33611
- function buildProviderErrorMessage(init) {
33612
- const status = init.status !== void 0 ? ` (HTTP ${init.status})` : "";
33613
- const detail = init.detail ? `: ${init.detail}` : "";
33614
- return `${init.providerId}${status} \u2014 ${KIND_SENTENCE[init.kind]}${detail}`;
33615
- }
33616
- __name(buildProviderErrorMessage, "buildProviderErrorMessage");
33617
- var OVERFLOW_BODY_PATTERNS = [
33618
- /prompt is too long/i,
33619
- /context[_ ]length[_ ]exceeded/i,
33620
- /maximum context length/i,
33621
- /too long for requested model/i,
33622
- /input is too long/i,
33623
- /(?:input|prompt|context).{0,80}exceeds the maximum/i,
33624
- /reduce the (?:input|prompt|context) length/i,
33625
- // Ollama phrases it the other way round — "input length exceeds context
33626
- // length" — so a pattern anchored on "exceeded" misses it entirely.
33627
- /exceeds?\s+(?:the\s+)?(?:model'?s?\s+)?context\s+(?:length|window|size)/i,
33628
- /context\s+(?:length|window|size)\s+exceed/i,
33629
- // The bare phrase "context
33630
- // window" is too broad on its own. Here it must sit next to a verb that says the request did not
33631
- // fit ("larger than the model context window of N tokens"), so a 400 that
33632
- // only names the window ("does not support this parameter with the 1M
33633
- // context window beta") stays an invalid request. The same pattern lives in
33634
- // `types/provider/errors.ts` (`codeFromMessage`), which also gates it on the
33635
- // status; keep them equal.
33636
- /(?:exceed\w*|too (?:long|large|big)|larger than|longer than|over the|beyond|maximum|overflow\w*)\b[^.]{0,60}context window|context window[^.]{0,60}\b(?:exceed\w*|too (?:long|large|big)|larger than|longer than|over the|beyond|maximum|overflow\w*)/i,
33637
- // "input length and `max_tokens` exceed context limit: A + B > C". The
33638
- // prompt may fit and only the requested output not; the loop tries a smaller
33639
- // `max_tokens` first (readOutputOverflow) and falls back to shedding history
33640
- // when there is no room for a useful reply, which needs this to classify.
33641
- /input length and `?max_tokens`? exceed context limit/i
33642
- ];
33643
- function bodySaysContextOverflow(body) {
33644
- if (!body)
33645
- return false;
33646
- return OVERFLOW_BODY_PATTERNS.some((re2) => re2.test(body));
33647
- }
33648
- __name(bodySaysContextOverflow, "bodySaysContextOverflow");
33649
- function parseShouldRetry(value) {
33650
- return value?.trim().toLowerCase() === "false" ? false : void 0;
33651
- }
33652
- __name(parseShouldRetry, "parseShouldRetry");
33653
- function parseRetryAfterMs(headerValue2, now = Date.now()) {
33654
- if (!headerValue2)
33655
- return void 0;
33656
- const trimmed = headerValue2.trim();
33657
- if (trimmed === "")
33658
- return void 0;
33659
- if (/^\d+(\.\d+)?$/.test(trimmed)) {
33660
- const seconds2 = Number(trimmed);
33661
- if (!Number.isFinite(seconds2) || seconds2 < 0)
33662
- return void 0;
33663
- return Math.round(seconds2 * 1e3);
33664
- }
33665
- const at = Date.parse(trimmed);
33666
- if (Number.isNaN(at))
33667
- return void 0;
33668
- const delta = at - now;
33669
- return delta > 0 ? delta : void 0;
33670
- }
33671
- __name(parseRetryAfterMs, "parseRetryAfterMs");
33672
- function classifyProviderHttpStatus(status, body) {
33673
- if (status === 401 || status === 403)
33674
- return "auth";
33675
- if (status === 429)
33676
- return "throttle";
33677
- if (status === 408 || status === 425)
33678
- return "network";
33679
- if (status >= 500)
33680
- return "server";
33681
- if (status === 413) {
33682
- return bodySaysContextOverflow(body) ? "context_overflow" : "bad_request";
33683
- }
33684
- if (status >= 400) {
33685
- return bodySaysContextOverflow(body) ? "context_overflow" : "bad_request";
33686
- }
33687
- return "server";
33688
- }
33689
- __name(classifyProviderHttpStatus, "classifyProviderHttpStatus");
33690
- var VENDOR_TYPE_KINDS = [
33691
- [/overloaded_error|api_error|service_unavailable/i, "server"],
33692
- [/rate_limit_error|rate_limit_exceeded/i, "throttle"],
33693
- [/authentication_error|permission_error|invalid_api_key|unauthorized/i, "auth"],
33694
- [/timeout_error|connection_error/i, "network"]
33695
- ];
33696
- function vendorTypeKind(message) {
33697
- for (const [re2, kind] of VENDOR_TYPE_KINDS) {
33698
- if (re2.test(message))
33699
- return kind;
33700
- }
33701
- return void 0;
33702
- }
33703
- __name(vendorTypeKind, "vendorTypeKind");
33704
- function vendorErrorStatus(err) {
33705
- if (typeof err !== "object" || err === null)
33706
- return void 0;
33707
- const e = err;
33708
- for (const candidate of [e.status, e.statusCode, e.status_code, e.$metadata?.httpStatusCode]) {
33709
- if (typeof candidate === "number" && Number.isFinite(candidate))
33710
- return candidate;
33711
- }
33712
- return void 0;
33713
- }
33714
- __name(vendorErrorStatus, "vendorErrorStatus");
33715
- function vendorRetryAfter(err) {
33716
- if (typeof err !== "object" || err === null)
33717
- return void 0;
33718
- const headers = err.headers ?? err.$response?.headers;
33719
- if (!headers)
33720
- return void 0;
33721
- if (typeof headers.get === "function") {
33722
- return headers.get("retry-after") ?? void 0;
33723
- }
33724
- const record4 = headers;
33725
- for (const key6 of ["retry-after", "Retry-After", "retryAfter"]) {
33726
- const value = record4[key6];
33727
- if (typeof value === "string")
33728
- return value;
33729
- }
33730
- return void 0;
33731
- }
33732
- __name(vendorRetryAfter, "vendorRetryAfter");
33733
- var REQUEST_ID_HEADERS = ["x-request-id", "request-id", "x-goog-request-id"];
33734
- function vendorHeader(err, names) {
33735
- if (typeof err !== "object" || err === null)
33736
- return void 0;
33737
- const headers = err.headers ?? err.$response?.headers;
33738
- if (!headers)
33739
- return void 0;
33740
- for (const name2 of names) {
33741
- if (typeof headers.get === "function") {
33742
- const value2 = headers.get(name2);
33743
- if (value2)
33744
- return value2;
33745
- continue;
33746
- }
33747
- const value = headers[name2];
33748
- if (typeof value === "string" && value)
33749
- return value;
33750
- }
33751
- return void 0;
33752
- }
33753
- __name(vendorHeader, "vendorHeader");
33754
- var FIELD_VALUE = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/;
33755
- function fieldValue(value) {
33756
- return typeof value === "string" && FIELD_VALUE.test(value) && redactSecrets(value) === value ? value : void 0;
33757
- }
33758
- __name(fieldValue, "fieldValue");
33759
- function structuredVendorDetail(input2) {
33760
- const message = vendorDetail(input2.message?.replace(/^\d{3}\s+/, ""));
33761
- const type = fieldValue(input2.type);
33762
- const code = fieldValue(input2.code);
33763
- const param = fieldValue(input2.param);
33764
- const requestId = fieldValue(input2.requestId);
33765
- if (!type && !code && !param && !requestId)
33766
- return message;
33767
- if (!message)
33768
- return void 0;
33769
- return JSON.stringify({
33770
- error: {
33771
- message,
33772
- ...type ? { type } : {},
33773
- ...code ? { code } : {},
33774
- ...param ? { param } : {}
33775
- },
33776
- ...requestId ? { request_id: requestId } : {}
33777
- });
33778
- }
33779
- __name(structuredVendorDetail, "structuredVendorDetail");
33780
- function providerVendorError(input2) {
33781
- const { error: error62 } = input2;
33782
- const status = vendorErrorStatus(error62);
33783
- const exactProviderCode = providerCode(error62) ?? usageLimitTypeOf(error62);
33784
- const name2 = error62 instanceof Error ? error62.name : "";
33785
- const message = error62 instanceof Error ? error62.message : "";
33786
- const transport = readTransportCause(error62);
33787
- let kind;
33788
- if (transport !== void 0) {
33789
- kind = "network";
33790
- } else if (/ThrottlingException|TooManyRequests|ServiceQuotaExceeded/i.test(name2)) {
33791
- kind = "throttle";
33792
- } else if (/AccessDenied|Unauthorized|Forbidden|Authentication/i.test(name2)) {
33793
- kind = "auth";
33794
- } else if (/ValidationException/i.test(name2)) {
33795
- kind = bodySaysContextOverflow(message) ? "context_overflow" : "bad_request";
33796
- } else if (/ServiceUnavailable|InternalServer|ModelTimeout|ModelStreamError|ModelError|ModelNotReady/i.test(name2)) {
33797
- kind = "server";
33798
- } else if (status !== void 0) {
33799
- kind = classifyProviderHttpStatus(status, message);
33800
- } else if (exactProviderCode === "invalid_image") {
33801
- kind = "bad_request";
33802
- } else if (bodySaysContextOverflow(message)) {
33803
- kind = "context_overflow";
33804
- } else {
33805
- kind = vendorTypeKind(message) ?? "network";
33806
- }
33807
- const retryAfterMs = parseRetryAfterMs(input2.retryAfter ?? vendorRetryAfter(error62), input2.now ?? Date.now());
33808
- const certificate = status === void 0 ? readCertificateFailure(error62) : void 0;
33809
- const shouldRetry = transport !== void 0 || certificate !== void 0 ? false : parseShouldRetry(vendorHeader(error62, ["x-should-retry"]));
33810
- const fields2 = error62;
33811
- const detail = carriesBody(message) ? vendorDetail(message) : structuredVendorDetail({
33812
- message,
33813
- type: fields2?.type,
33814
- code: exactProviderCode,
33815
- param: fields2?.param,
33816
- requestId: fields2?.requestID ?? vendorHeader(error62, REQUEST_ID_HEADERS)
33817
- });
33818
- return new ProviderRequestError({
33819
- kind,
33820
- providerId: input2.providerId,
33821
- ...certificate !== void 0 ? { providerCode: certificate } : exactProviderCode !== void 0 ? { providerCode: exactProviderCode } : {},
33822
- ...status !== void 0 ? { status } : {},
33823
- ...retryAfterMs !== void 0 ? { retryAfterMs } : {},
33824
- ...detail !== void 0 ? { detail } : {},
33825
- ...shouldRetry !== void 0 ? { shouldRetry } : {},
33826
- ...transport !== void 0 ? { transport } : {}
33827
- });
33828
- }
33829
- __name(providerVendorError, "providerVendorError");
33830
- function carriesBody(message) {
33831
- const rest = message.replace(/^\d{3}\s+/, "").trim();
33832
- if (!rest.startsWith("{"))
33833
- return false;
33834
- try {
33835
- const parsed = JSON.parse(rest);
33836
- return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed);
33837
- } catch {
33838
- return false;
33839
- }
33840
- }
33841
- __name(carriesBody, "carriesBody");
33842
- function parsedBody(body) {
33843
- let decoded = body;
33844
- if (typeof decoded === "string") {
33845
- try {
33846
- decoded = JSON.parse(decoded);
33847
- } catch {
33848
- return void 0;
33849
- }
33850
- }
33851
- return typeof decoded === "object" && decoded !== null && !Array.isArray(decoded) ? decoded : void 0;
33852
- }
33853
- __name(parsedBody, "parsedBody");
33854
- function bodyErrorFields(body) {
33855
- const inner = body && typeof body.error === "object" && body.error !== null ? body.error : void 0;
33856
- if (!inner)
33857
- return {};
33858
- return {
33859
- type: inner.type ?? (typeof inner.status === "string" ? inner.status : void 0),
33860
- code: typeof inner.code === "string" ? inner.code : void 0,
33861
- param: inner.param
33862
- };
33863
- }
33864
- __name(bodyErrorFields, "bodyErrorFields");
33865
- function providerHttpError(input2) {
33866
- const kind = classifyProviderHttpStatus(input2.status, input2.body);
33867
- const retryAfterMs = parseRetryAfterMs(input2.retryAfter, input2.now ?? Date.now());
33868
- const body = parsedBody(input2.body);
33869
- const bodyError = bodyErrorFields(body);
33870
- const detail = body ? structuredVendorDetail({
33871
- message: vendorDetail(input2.body),
33872
- type: bodyError.type,
33873
- code: bodyError.code,
33874
- param: bodyError.param,
33875
- requestId: input2.requestId
33876
- }) : vendorDetail(input2.body);
33877
- const exactProviderCode = providerCode(input2.body);
33878
- const shouldRetry = parseShouldRetry(input2.shouldRetry);
33879
- return new ProviderRequestError({
33880
- kind,
33881
- providerId: input2.providerId,
33882
- ...exactProviderCode !== void 0 ? { providerCode: exactProviderCode } : {},
33883
- status: input2.status,
33884
- ...retryAfterMs !== void 0 ? { retryAfterMs } : {},
33885
- ...detail !== void 0 ? { detail } : {},
33886
- ...shouldRetry !== void 0 ? { shouldRetry } : {}
33887
- });
33888
- }
33889
- __name(providerHttpError, "providerHttpError");
33890
-
33891
34089
  // ../sdk/dist/provider/idle-timeout.js
33892
34090
  var DEFAULT_STREAM_IDLE_TIMEOUT_MS = 5 * 6e4;
33893
34091
  var MAX_TIMER_DELAY_MS2 = 2147483647;
@@ -47440,72 +47638,6 @@ function withTokenBudget(provider, budget) {
47440
47638
  }
47441
47639
  __name(withTokenBudget, "withTokenBudget");
47442
47640
 
47443
- // ../sdk/dist/telemetry/attributes.js
47444
- function agentTurnSpanName(agentName) {
47445
- return `namzu.agent.turn ${agentName}`;
47446
- }
47447
- __name(agentTurnSpanName, "agentTurnSpanName");
47448
- function agentIterationSpanName(iteration) {
47449
- return `namzu.agent.iteration ${iteration}`;
47450
- }
47451
- __name(agentIterationSpanName, "agentIterationSpanName");
47452
- function toolSpanName(toolName) {
47453
- return `namzu.tool.execute ${toolName}`;
47454
- }
47455
- __name(toolSpanName, "toolSpanName");
47456
- function chatSpanName(model) {
47457
- return `chat ${model}`;
47458
- }
47459
- __name(chatSpanName, "chatSpanName");
47460
- function parentContext(parent) {
47461
- const active = context.active();
47462
- if (!parent)
47463
- return active;
47464
- if (!isSerialized(parent))
47465
- return trace.setSpan(active, parent);
47466
- const context2 = toSpanContext(parent);
47467
- if (!context2)
47468
- return active;
47469
- return trace.setSpan(active, trace.wrapSpanContext(context2));
47470
- }
47471
- __name(parentContext, "parentContext");
47472
- function isSerialized(value) {
47473
- return typeof value.traceId === "string";
47474
- }
47475
- __name(isSerialized, "isSerialized");
47476
- var HEX_TRACE_ID = /^[0-9a-f]{32}$/;
47477
- var HEX_SPAN_ID = /^[0-9a-f]{16}$/;
47478
- function toSpanContext(serialized) {
47479
- const { traceId, spanId } = serialized;
47480
- if (!HEX_TRACE_ID.test(traceId) || !HEX_SPAN_ID.test(spanId))
47481
- return void 0;
47482
- if (/^0+$/.test(traceId) || /^0+$/.test(spanId))
47483
- return void 0;
47484
- return {
47485
- traceId,
47486
- spanId,
47487
- traceFlags: serialized.traceFlags,
47488
- // The parent was recorded in another process, whatever that process
47489
- // was; saying otherwise makes a sampler treat it as locally sampled.
47490
- isRemote: true
47491
- };
47492
- }
47493
- __name(toSpanContext, "toSpanContext");
47494
- function serializeSpan(span) {
47495
- const context2 = span?.spanContext();
47496
- if (!context2)
47497
- return void 0;
47498
- if (!HEX_TRACE_ID.test(context2.traceId) || /^0+$/.test(context2.traceId))
47499
- return void 0;
47500
- return {
47501
- traceId: context2.traceId,
47502
- spanId: context2.spanId,
47503
- traceFlags: context2.traceFlags,
47504
- isRemote: false
47505
- };
47506
- }
47507
- __name(serializeSpan, "serializeSpan");
47508
-
47509
47641
  // ../sdk/dist/tools/advisory/index.js
47510
47642
  function buildAdvisoryTools(opts) {
47511
47643
  const { advisoryCtx } = opts;
@@ -49047,6 +49179,8 @@ ${entries2}
49047
49179
  [GENAI.TOOL_TYPE]: "function",
49048
49180
  ...context2.toolUseId !== void 0 ? { [GENAI.TOOL_CALL_ID]: context2.toolUseId } : {},
49049
49181
  ...toolSpanIdentity(context2),
49182
+ ...toolCallAttributes(),
49183
+ ...errorTypeAttributes(genAiErrorType(err)),
49050
49184
  [NAMZU.TOOL_SUCCESS]: false,
49051
49185
  [NAMZU.TOOL_ERROR]: toErrorMessage(err)
49052
49186
  });
@@ -49070,7 +49204,8 @@ ${entries2}
49070
49204
  [GENAI.TOOL_NAME]: toolName,
49071
49205
  [GENAI.TOOL_TYPE]: "function",
49072
49206
  ...context2.toolUseId !== void 0 ? { [GENAI.TOOL_CALL_ID]: context2.toolUseId } : {},
49073
- ...toolSpanIdentity(context2)
49207
+ ...toolSpanIdentity(context2),
49208
+ ...toolCallAttributes()
49074
49209
  });
49075
49210
  const availability = this.availability(toolName);
49076
49211
  if (availability !== "active") {
@@ -49078,7 +49213,8 @@ ${entries2}
49078
49213
  this.log.warn(msg);
49079
49214
  span.setAttributes({
49080
49215
  [NAMZU.TOOL_SUCCESS]: false,
49081
- [NAMZU.TOOL_ERROR]: msg
49216
+ [NAMZU.TOOL_ERROR]: msg,
49217
+ ...errorTypeAttributes(ERROR_TYPE_OTHER)
49082
49218
  });
49083
49219
  span.setStatus({ code: SpanStatusCode.ERROR, message: msg });
49084
49220
  return {
@@ -49096,7 +49232,8 @@ ${entries2}
49096
49232
  });
49097
49233
  span.setAttributes({
49098
49234
  [NAMZU.TOOL_SUCCESS]: false,
49099
- [NAMZU.TOOL_ERROR]: msg
49235
+ [NAMZU.TOOL_ERROR]: msg,
49236
+ ...errorTypeAttributes(PERMISSION_DENIED)
49100
49237
  });
49101
49238
  span.setStatus({ code: SpanStatusCode.ERROR, message: msg });
49102
49239
  return {
@@ -49113,7 +49250,8 @@ ${entries2}
49113
49250
  const msg = `plan mode: non-read-only tool "${toolName}" blocked. ${PLAN_MODE_REFUSAL}`;
49114
49251
  span.setAttributes({
49115
49252
  [NAMZU.TOOL_SUCCESS]: false,
49116
- [NAMZU.TOOL_ERROR]: msg
49253
+ [NAMZU.TOOL_ERROR]: msg,
49254
+ ...errorTypeAttributes(PERMISSION_DENIED)
49117
49255
  });
49118
49256
  span.setStatus({ code: SpanStatusCode.ERROR, message: msg });
49119
49257
  return {
@@ -49145,6 +49283,7 @@ ${entries2}
49145
49283
  recordToolCall(toolName, result.success, result.success ? void 0 : result.error, durationMs);
49146
49284
  if (!result.success && result.error) {
49147
49285
  span.setAttribute(NAMZU.TOOL_ERROR, result.error);
49286
+ span.setAttributes(errorTypeAttributes("permissionDenied" in result && result.permissionDenied ? PERMISSION_DENIED : ERROR_TYPE_OTHER));
49148
49287
  span.setStatus({
49149
49288
  code: SpanStatusCode.ERROR,
49150
49289
  message: result.error
@@ -49157,7 +49296,8 @@ ${entries2}
49157
49296
  if (err instanceof ToolResultHalted) {
49158
49297
  span.setAttributes({
49159
49298
  [NAMZU.TOOL_SUCCESS]: false,
49160
- [NAMZU.TOOL_ERROR]: err.message
49299
+ [NAMZU.TOOL_ERROR]: err.message,
49300
+ ...errorTypeAttributes(genAiErrorType(err))
49161
49301
  });
49162
49302
  span.setStatus({
49163
49303
  code: SpanStatusCode.ERROR,
@@ -49172,7 +49312,8 @@ ${entries2}
49172
49312
  });
49173
49313
  span.setAttributes({
49174
49314
  [NAMZU.TOOL_SUCCESS]: false,
49175
- [NAMZU.TOOL_ERROR]: errorMessage
49315
+ [NAMZU.TOOL_ERROR]: errorMessage,
49316
+ ...errorTypeAttributes(genAiErrorType(err))
49176
49317
  });
49177
49318
  span.setStatus({
49178
49319
  code: SpanStatusCode.ERROR,
@@ -50230,7 +50371,8 @@ var ResultAssembler = class {
50230
50371
  yield* drainPending();
50231
50372
  rootSpan.setAttributes({
50232
50373
  [NAMZU.TURN_STATUS]: "error",
50233
- [NAMZU.ITERATION]: recorder.currentIteration
50374
+ [NAMZU.ITERATION]: recorder.currentIteration,
50375
+ ...errorTypeAttributes(genAiErrorType(err))
50234
50376
  });
50235
50377
  rootSpan.setStatus({ code: SpanStatusCode.ERROR, message: errorMessage });
50236
50378
  rootSpan.recordException(err instanceof Error ? err : new Error(errorMessage));
@@ -50290,7 +50432,8 @@ async function* settlePreStartCancellation(params, prepared) {
50290
50432
  [GENAI.AGENT_NAME]: params.agentName,
50291
50433
  [GENAI.AGENT_ID]: params.agentId,
50292
50434
  [GENAI.REQUEST_MODEL]: turnConfig.model,
50293
- [GENAI.SYSTEM]: params.provider.id
50435
+ [GENAI.SYSTEM]: params.provider.id,
50436
+ ...agentRunAttributes(params.provider.id)
50294
50437
  });
50295
50438
  const push = /* @__PURE__ */ __name((message, ids) => {
50296
50439
  const messageId4 = ids.get(message);
@@ -77108,7 +77251,8 @@ async function settleCancelledTurn(args) {
77108
77251
  [GENAI.USAGE_INPUT_TOKENS]: promptSizeOf(args.usage),
77109
77252
  [GENAI.USAGE_OUTPUT_TOKENS]: args.usage.completionTokens,
77110
77253
  [NAMZU.CACHE_READ_TOKENS]: args.usage.cachedTokens ?? 0,
77111
- [NAMZU.CACHE_WRITE_TOKENS]: args.usage.cacheWriteTokens ?? 0
77254
+ [NAMZU.CACHE_WRITE_TOKENS]: args.usage.cacheWriteTokens ?? 0,
77255
+ ...chatUsageAttributes(args.usage)
77112
77256
  });
77113
77257
  args.span.setStatus({ code: SpanStatusCode.OK });
77114
77258
  args.span.end();
@@ -77138,7 +77282,8 @@ async function* streamProviderTurn(provider, params, emitEvent, drainPending, tu
77138
77282
  ...sessionId5 !== void 0 ? { [GENAI.CONVERSATION_ID]: sessionId5 } : {},
77139
77283
  [NAMZU.TURN_ID]: turnId6,
77140
77284
  ...params.temperature !== void 0 ? { [GENAI.REQUEST_TEMPERATURE]: params.temperature } : {},
77141
- ...params.maxTokens !== void 0 ? { [GENAI.REQUEST_MAX_TOKENS]: params.maxTokens } : {}
77285
+ ...params.maxTokens !== void 0 ? { [GENAI.REQUEST_MAX_TOKENS]: params.maxTokens } : {},
77286
+ ...chatStartAttributes(provider.id)
77142
77287
  });
77143
77288
  const messageId4 = announceAs ?? generateMessageId();
77144
77289
  await emitEvent({ type: "message_started", turnId: turnId6, iteration, messageId: messageId4 });
@@ -77677,6 +77822,7 @@ async function* streamProviderTurn(provider, params, emitEvent, drainPending, tu
77677
77822
  });
77678
77823
  yield* drainPending();
77679
77824
  if (streamError && !recoveredToolInputFromStreamError) {
77825
+ chatSpan.setAttributes(errorTypeAttributes(genAiErrorType(streamCause)));
77680
77826
  chatSpan.setStatus({ code: SpanStatusCode.ERROR, message: streamError });
77681
77827
  chatSpan.end();
77682
77828
  if (streamCause instanceof ProviderError)
@@ -77725,7 +77871,8 @@ async function* streamProviderTurn(provider, params, emitEvent, drainPending, tu
77725
77871
  [GENAI.USAGE_INPUT_TOKENS]: promptSizeOf(usage),
77726
77872
  [GENAI.USAGE_OUTPUT_TOKENS]: usage.completionTokens,
77727
77873
  [NAMZU.CACHE_READ_TOKENS]: usage.cachedTokens ?? 0,
77728
- [NAMZU.CACHE_WRITE_TOKENS]: usage.cacheWriteTokens ?? 0
77874
+ [NAMZU.CACHE_WRITE_TOKENS]: usage.cacheWriteTokens ?? 0,
77875
+ ...chatUsageAttributes(usage)
77729
77876
  });
77730
77877
  chatSpan.setStatus({ code: SpanStatusCode.OK });
77731
77878
  chatSpan.end();
@@ -85896,7 +86043,8 @@ async function* query(params) {
85896
86043
  [GENAI.AGENT_NAME]: params.agentName,
85897
86044
  [GENAI.AGENT_ID]: params.agentId,
85898
86045
  [GENAI.REQUEST_MODEL]: turnConfig.model,
85899
- [GENAI.SYSTEM]: params.provider.id
86046
+ [GENAI.SYSTEM]: params.provider.id,
86047
+ ...agentRunAttributes(params.provider.id)
85900
86048
  });
85901
86049
  let sandbox;
85902
86050
  let deferredSandbox;
@@ -92139,17 +92287,22 @@ function estimateTokens2(text11) {
92139
92287
  return Math.ceil(text11.length / CHARS_PER_TOKEN3);
92140
92288
  }
92141
92289
  __name(estimateTokens2, "estimateTokens");
92290
+ function parseSkillMarkdown(raw, dirPath) {
92291
+ const parsed = parseFrontmatter(raw, sourceLabel(dirPath), SKILL_FRONTMATTER_OPTIONS);
92292
+ return { metadata: toSkillMetadata(parsed, dirPath), body: parsed.body };
92293
+ }
92294
+ __name(parseSkillMarkdown, "parseSkillMarkdown");
92142
92295
  async function loadSkill(dirPath, level = "metadata", log) {
92143
92296
  const skillMdPath = join28(dirPath, SKILL_FILENAME);
92144
92297
  const raw = await readFile14(skillMdPath, "utf-8");
92145
- const parsed = parseFrontmatter(raw, sourceLabel(dirPath), SKILL_FRONTMATTER_OPTIONS);
92146
- const metadata = toSkillMetadata(parsed, dirPath);
92298
+ const parsedSkill = parseSkillMarkdown(raw, dirPath);
92299
+ const metadata = parsedSkill.metadata;
92147
92300
  const skill = {
92148
92301
  metadata,
92149
92302
  dirPath
92150
92303
  };
92151
92304
  if (level === "full" || level === "assets") {
92152
- skill.body = parsed.body;
92305
+ skill.body = parsedSkill.body;
92153
92306
  }
92154
92307
  const metadataTokens = estimateTokens2(`${metadata.name}: ${metadata.description}`);
92155
92308
  const bodyTokens = skill.body ? estimateTokens2(skill.body) : 0;
@@ -95091,6 +95244,20 @@ var EFFORT_LEVELS = /* @__PURE__ */ new Set([
95091
95244
  "ultra"
95092
95245
  ]);
95093
95246
  var NAME_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
95247
+ var AGENT_FILE_KEYS = Object.freeze([
95248
+ "name",
95249
+ "description",
95250
+ "tools",
95251
+ "disallowedTools",
95252
+ "model",
95253
+ "effort",
95254
+ "maxTurns",
95255
+ "background",
95256
+ "isolation",
95257
+ "skills",
95258
+ "permissionMode",
95259
+ "readOnly"
95260
+ ]);
95094
95261
  async function discoverAgentDefinitions(roots, options = {}) {
95095
95262
  const logger = resolveLogger(options.log).child({ [SCOPE_ATTRIBUTE]: "agents/file-definitions" });
95096
95263
  const byName2 = /* @__PURE__ */ new Map();
@@ -98820,12 +98987,16 @@ async function loadPluginManifest(pluginDir, capabilities2 = {}) {
98820
98987
  throw new Error(`Plugin manifest must be a regular file, not a symlink: ${manifestPath}`);
98821
98988
  }
98822
98989
  const raw = await readFile19(manifestPath, "utf-8");
98823
- const parsed = JSON.parse(raw);
98824
- const manifest = PluginManifestSchema.parse(parsed);
98990
+ const manifest = parsePluginManifestText(raw);
98825
98991
  assertEnableable(manifest, capabilities2);
98826
98992
  return manifest;
98827
98993
  }
98828
98994
  __name(loadPluginManifest, "loadPluginManifest");
98995
+ function parsePluginManifestText(raw) {
98996
+ const parsed = JSON.parse(raw);
98997
+ return PluginManifestSchema.parse(parsed);
98998
+ }
98999
+ __name(parsePluginManifestText, "parsePluginManifestText");
98829
99000
  async function discoverScopedPlugins(authorityRoot, relativePluginDir, scope, log) {
98830
99001
  const logger = resolveLogger(log).child({
98831
99002
  [SCOPE_ATTRIBUTE]: "plugin/loader"
@@ -104244,8 +104415,8 @@ var PluginLifecycleManager = class {
104244
104415
  }, "render")
104245
104416
  });
104246
104417
  }
104247
- const enabled = this.definitionFrom(admission, "enabled", Date.now());
104248
- this.pluginRegistry.register(enabled);
104418
+ const enabled2 = this.definitionFrom(admission, "enabled", Date.now());
104419
+ this.pluginRegistry.register(enabled2);
104249
104420
  this.emit({
104250
104421
  type: "plugin_enabled",
104251
104422
  pluginId,
@@ -116194,6 +116365,12 @@ var ACPServer = class {
116194
116365
  this.clientCapabilities = params.capabilities ?? [];
116195
116366
  return {
116196
116367
  protocolVersion: ACP_PROTOCOL_VERSION,
116368
+ kernel: {
116369
+ engine: VERSION,
116370
+ dataEpoch: DATA_EPOCH,
116371
+ ...this.options.kernelFacts?.commandLine !== void 0 ? { commandLine: this.options.kernelFacts.commandLine } : {},
116372
+ ...this.options.kernelFacts?.desktopContract !== void 0 ? { desktopContract: this.options.kernelFacts.desktopContract } : {}
116373
+ },
116197
116374
  ...this.options.supportsPromptAttachments ? { promptAttachments: true } : {},
116198
116375
  ...this.options.supportsPromptOptions ? { promptOptions: true } : {},
116199
116376
  ...this.options.supportsPromptOptions && this.options.promptPermissionModes?.length ? { promptPermissionModes: [...this.options.promptPermissionModes] } : {},
@@ -129319,10 +129496,10 @@ var DiskPalMessagePolicy = class {
129319
129496
  async update(input2) {
129320
129497
  const source = addressSchema2.parse(input2.source);
129321
129498
  const recipient = addressSchema2.parse(input2.recipient);
129322
- const { expectedRevision, enabled, allowWake } = input2;
129499
+ const { expectedRevision, enabled: enabled2, allowWake } = input2;
129323
129500
  if (!Number.isSafeInteger(expectedRevision) || expectedRevision < 0)
129324
129501
  throw new Error("A nonnegative expected permission revision is required.");
129325
- if (typeof enabled !== "boolean" || typeof allowWake !== "boolean")
129502
+ if (typeof enabled2 !== "boolean" || typeof allowWake !== "boolean")
129326
129503
  throw new Error("Explicit Pal communication and wake consent are required.");
129327
129504
  return this.records.transact(this.location(source, recipient), (stored) => {
129328
129505
  const current = stored ? checked(stored, source, recipient) : null;
@@ -129333,7 +129510,7 @@ var DiskPalMessagePolicy = class {
129333
129510
  source,
129334
129511
  recipient,
129335
129512
  revision: expectedRevision + 1,
129336
- enabled,
129513
+ enabled: enabled2,
129337
129514
  allowWake
129338
129515
  });
129339
129516
  return { record: record4, result: record4 };
@@ -139158,9 +139335,24 @@ export {
139158
139335
  MAX_CUSTOM_PATTERN_LENGTH,
139159
139336
  OUTPUT_SECRET_PATTERNS,
139160
139337
  LOG_SECRET_PATTERNS,
139338
+ DATA_EPOCH,
139161
139339
  RegistryCollisionError,
139162
139340
  InMemoryConfigOverrideStore,
139163
139341
  DiskConfigOverrideStore,
139342
+ ProviderRequestError,
139343
+ isProviderRequestError,
139344
+ isCallerAbortError,
139345
+ bodySaysContextOverflow,
139346
+ parseRetryAfterMs,
139347
+ classifyProviderHttpStatus,
139348
+ providerVendorError,
139349
+ providerHttpError,
139350
+ GENAI_SEMCONV_VERSION,
139351
+ GENAI_SEMCONV_SCHEMA_URL,
139352
+ GENAI_SEMCONV_ATTRIBUTES,
139353
+ GENAI_NON_CONVENTION_NAMES,
139354
+ setGenAiConventions,
139355
+ genAiConventionsEnabled,
139164
139356
  NOOP_SINK,
139165
139357
  jsonLinesSink,
139166
139358
  prettySink,
@@ -139259,14 +139451,6 @@ export {
139259
139451
  createToolPresenter,
139260
139452
  NAMZU_APP_IDENTITY,
139261
139453
  attributionHeaders,
139262
- ProviderRequestError,
139263
- isProviderRequestError,
139264
- isCallerAbortError,
139265
- bodySaysContextOverflow,
139266
- parseRetryAfterMs,
139267
- classifyProviderHttpStatus,
139268
- providerVendorError,
139269
- providerHttpError,
139270
139454
  DEFAULT_STREAM_IDLE_TIMEOUT_MS,
139271
139455
  withStreamIdleTimeout,
139272
139456
  DEFAULT_MAX_REQUEST_RICH_CONTENT_BYTES,
@@ -139786,6 +139970,7 @@ export {
139786
139970
  parseFrontmatter,
139787
139971
  SKILL_FRONTMATTER_KEYS,
139788
139972
  SKILL_FRONTMATTER_TOLERATED_KEYS,
139973
+ parseSkillMarkdown,
139789
139974
  loadSkill,
139790
139975
  discoverSkills,
139791
139976
  SkillCollisionError,
@@ -139814,6 +139999,7 @@ export {
139814
139999
  defineAgent,
139815
140000
  MAX_AGENT_FILE_CHARS,
139816
140001
  DEFAULT_RESERVED_AGENT_NAMES,
140002
+ AGENT_FILE_KEYS,
139817
140003
  discoverAgentDefinitions,
139818
140004
  parseAgentFile,
139819
140005
  parseAgentMarkdown,
@@ -139866,6 +140052,8 @@ export {
139866
140052
  PluginManifestSchema,
139867
140053
  discoverPlugins,
139868
140054
  loadPluginManifest,
140055
+ parsePluginManifestText,
140056
+ assertEnableable,
139869
140057
  discoverAllPluginDirs,
139870
140058
  definePlugin,
139871
140059
  MCPProtocolError,
@@ -140343,4 +140531,4 @@ export {
140343
140531
  WakeBudget,
140344
140532
  wakeBudgetFromEnv
140345
140533
  };
140346
- //# sourceMappingURL=chunk-EK74R563.js.map
140534
+ //# sourceMappingURL=chunk-HQ4WFN7B.js.map