nolo-cli 0.149.0-alpha.1 → 0.151.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/{_executeModel-OW3H7ICR.js → _executeModel-T7ANHTUW.js} +134 -91
  2. package/accountResolver-7RYB4D2P.js +300 -0
  3. package/action-SXJD5N5R.js +23 -0
  4. package/{addContentAction-B2DRF7P6.js → addContentAction-ZV774PHH.js} +20 -14
  5. package/{addDialogAgentAction-2P2FLTLD.js → addDialogAgentAction-A6SMKAGH.js} +26 -22
  6. package/{agentDeleteCommand-7IDWF6E3.js → agentDeleteCommand-4L5KCKFY.js} +181 -93
  7. package/{agentEmailCommands-A6XBQZBN.js → agentEmailCommands-2IMMIRO2.js} +132 -112
  8. package/{agentGrantCommands-M3XFO6EN.js → agentGrantCommands-HOJ3JBBQ.js} +3 -3
  9. package/agentListCommands-TWFLUYIZ.js +802 -0
  10. package/{agentMachineCommands-DQPUIMAC.js → agentMachineCommands-KIWXWT6L.js} +58 -62
  11. package/{agentProviderCommands-YK2BIIXZ.js → agentProviderCommands-HL6MBLCL.js} +149 -2
  12. package/{agentPullCommand-HF4A42D4.js → agentPullCommand-FA43RBRU.js} +7 -7
  13. package/agentRecordCommands-727NPCRW.js +154 -0
  14. package/agentRunCommand-JASIG3FZ.js +183 -0
  15. package/{agentRunControl-2SKCR4SB.js → agentRunControl-IFM7IGMG.js} +10 -2
  16. package/{agentRuntimeLocal-AK2QVJHY.js → agentRuntimeLocal-KKSQJMTE.js} +47 -50
  17. package/{agentSlice-O4RUQUMT.js → agentSlice-SLV57QGU.js} +23 -16
  18. package/{appDeleteCommands-N3XEVVYC.js → appDeleteCommands-4PL4KYRN.js} +58 -59
  19. package/{appDeployCommands-AWFIXYVW.js → appDeployCommands-EEEXCEB6.js} +67 -63
  20. package/{appDeployStatusCommands-CZRON2FO.js → appDeployStatusCommands-35ZX7T66.js} +56 -56
  21. package/{appGetCommands-XQIUY4TD.js → appGetCommands-WFCHXJWF.js} +56 -56
  22. package/{appListCommands-NNG4H36Y.js → appListCommands-XY2U6DPF.js} +57 -59
  23. package/{authCommand-UBJ4EWYZ.js → authCommand-QYN47CQD.js} +371 -68
  24. package/{authCommands-H6WKKCRW.js → authCommands-77CHYBGF.js} +12 -9
  25. package/{builtinSkillRegistry-ZMF6YGNO.js → builtinSkillRegistry-TDQ6JB2E.js} +13 -11
  26. package/{chromeCommands-2N6MEWRU.js → chromeCommands-OBBNJCLS.js} +314 -13
  27. package/chromeOpsCommands-3Z34RKSE.js +472 -0
  28. package/{chunk-ALXHV7NK.js → chunk-2GGXHQIW.js} +43 -4
  29. package/{localRuntimeAuthority-5W6IJRAD.js → chunk-2IXDJNZI.js} +154 -75
  30. package/{chunk-IVZJWTDI.js → chunk-36OMEXXR.js} +89 -21
  31. package/{chunk-H6A6X4EK.js → chunk-3MZAGMYY.js} +16 -0
  32. package/chunk-3PVYUPXK.js +40 -0
  33. package/chunk-3SZA4U64.js +1192 -0
  34. package/{chunk-ID7LNBWR.js → chunk-3T4ZG6AC.js} +1920 -644
  35. package/{chunk-GNMAFAIS.js → chunk-44WXLHFI.js} +1 -1
  36. package/{chunk-AGGIDPCZ.js → chunk-4JH2UMJR.js} +6 -0
  37. package/chunk-4LCOCOR5.js +50 -0
  38. package/chunk-4YRTZIVN.js +871 -0
  39. package/{chunk-N7J63Q6C.js → chunk-56GBUMO5.js} +10 -1
  40. package/{chunk-W7XHHYWM.js → chunk-5BHQICF2.js} +5 -1
  41. package/{chunk-XUWRURDF.js → chunk-5EBLANFT.js} +1 -1
  42. package/{chunk-3AH7LNUB.js → chunk-5EMSBTQ6.js} +33 -14
  43. package/{chunk-YRRASA5Q.js → chunk-5MM7NNO6.js} +113 -52
  44. package/chunk-5MMAK75Q.js +15 -0
  45. package/{chunk-TXH4IWJL.js → chunk-626KHJNX.js} +20 -11
  46. package/{chunk-M5PVFLD4.js → chunk-64K7WX26.js} +90 -21
  47. package/{chunk-AKG5W4LG.js → chunk-6CCFTVBP.js} +76 -221
  48. package/chunk-6MJNEXUU.js +614 -0
  49. package/{chunk-62IL3KQV.js → chunk-6MXDOUMH.js} +15 -3
  50. package/{chunk-QOKAKDPE.js → chunk-6Q7UTJKR.js} +6 -94
  51. package/chunk-6QDYSCPW.js +223 -0
  52. package/{chunk-HYZIYH2H.js → chunk-74RAWNQN.js} +56 -63
  53. package/chunk-7DPNBQSV.js +9 -0
  54. package/{chunk-IAESIMK7.js → chunk-A4MW3YZL.js} +10 -14
  55. package/{chunk-OMRJYNCI.js → chunk-AG7MCDLR.js} +26 -31
  56. package/chunk-AGIM7IMJ.js +147 -0
  57. package/{chunk-7CHC4W22.js → chunk-AIZE5TDM.js} +3 -3
  58. package/chunk-AJ3G7X2K.js +7012 -0
  59. package/{chunk-5GVBDNTO.js → chunk-AU7AXHUL.js} +1 -1
  60. package/{chunk-4H22P2JV.js → chunk-AUIJZACN.js} +2073 -1275
  61. package/{chunk-CIF4X6ZM.js → chunk-AWVFQMOV.js} +25 -3
  62. package/{chunk-YAQJJDC2.js → chunk-BJEZC5RA.js} +214 -51
  63. package/{chunk-RYZINGPM.js → chunk-BPMPOFWP.js} +347 -235
  64. package/{chunk-YUNJN43V.js → chunk-BU2YQBV4.js} +215 -28
  65. package/{chunk-XPRWFQQK.js → chunk-CBHGZRCE.js} +38 -12
  66. package/{chunk-Y3PMXGLH.js → chunk-CHCS6XPJ.js} +365 -144
  67. package/chunk-CHOZJMJS.js +78 -0
  68. package/chunk-CYJWI3NH.js +119 -0
  69. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  70. package/{chunk-3SV7RM24.js → chunk-D2QN6CTI.js} +117 -72
  71. package/{chunk-TZZ2WRBL.js → chunk-DFDXM2Y4.js} +20 -16
  72. package/{chunk-5TEEECZM.js → chunk-E2AKSW7L.js} +10 -7
  73. package/{chunk-RSEEDUMS.js → chunk-EDX5XSJM.js} +2 -2
  74. package/{chunk-QDSINZM3.js → chunk-EUGTFFO6.js} +2 -23
  75. package/{chunk-UNYJU5L6.js → chunk-EYLGAEB4.js} +5 -1
  76. package/{chunk-CU3QB4HW.js → chunk-EYWJT7A2.js} +12 -12
  77. package/{chunk-BNGW5ASC.js → chunk-EZVK3N5L.js} +66 -18
  78. package/{chunk-6FGTMQCL.js → chunk-F32Z66T4.js} +6 -10
  79. package/{chunk-ZOVKKMF6.js → chunk-FY4SDK2E.js} +1 -1
  80. package/chunk-G6OOUQWJ.js +417 -0
  81. package/{chunk-PQWU42UQ.js → chunk-GCKHQECX.js} +6 -6
  82. package/chunk-GKXCHNTE.js +15 -0
  83. package/{chunk-P6GMCCAT.js → chunk-GQV5KHJU.js} +78 -12
  84. package/{chunk-B2XUQXQX.js → chunk-HIQ4GF53.js} +191 -68
  85. package/{chunk-GMZLP5DV.js → chunk-HNUWUO75.js} +30 -19
  86. package/{chunk-UASIEDKM.js → chunk-I2XLRXVX.js} +36 -31
  87. package/{chunk-5UTFL4QJ.js → chunk-I2ZMGXXF.js} +10 -5
  88. package/chunk-I42VC5KR.js +15 -0
  89. package/{chunk-3BXNTXYI.js → chunk-I4SN4NUQ.js} +1199 -56
  90. package/chunk-IA7TRNNR.js +11 -0
  91. package/{chunk-WIWM4FE3.js → chunk-IJERIUXS.js} +55 -748
  92. package/{chunk-BIDGLJQ3.js → chunk-IK2TSJQA.js} +45 -8
  93. package/{chunk-CPUFH46E.js → chunk-ILU2NPWY.js} +10 -10
  94. package/{chunk-SLLGJZDT.js → chunk-ISQL4V7C.js} +4 -4
  95. package/chunk-IT3ZZRJE.js +12 -0
  96. package/{chunk-DY7ANLKG.js → chunk-JKMLSTZK.js} +43 -12
  97. package/{chunk-6TPOEJMQ.js → chunk-JZX2XLKC.js} +64 -23
  98. package/{chunk-27ONFIEY.js → chunk-K2AER7RX.js} +19 -12
  99. package/{chunk-O2OWEFII.js → chunk-KFHQQ3NO.js} +1 -1
  100. package/{chunk-QXGPFY6J.js → chunk-LGN377P3.js} +27 -17
  101. package/{chunk-L36OWPP3.js → chunk-LIQJTQRN.js} +118 -139
  102. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  103. package/{chunk-5J3PYNUP.js → chunk-NYYFIKHI.js} +17 -3
  104. package/{chunk-6O4IK4V2.js → chunk-OFFL4DCR.js} +1 -1
  105. package/{chunk-B6SAMB33.js → chunk-OWYYDMGJ.js} +209 -9
  106. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  107. package/{chunk-CTUQJVQM.js → chunk-P5QACQDK.js} +1 -1
  108. package/{chunk-TB3MIBRC.js → chunk-PIDUNDFS.js} +572 -430
  109. package/{chunk-4JMDLJAD.js → chunk-PJNFNEJE.js} +114 -37
  110. package/chunk-PKZKOVA5.js +11507 -0
  111. package/{chunk-Z4CSIXYP.js → chunk-PLSVXHSA.js} +3 -3
  112. package/chunk-PWTNI4N7.js +47 -0
  113. package/chunk-QFEW2ULV.js +42 -0
  114. package/{chunk-RGNEEJ3Y.js → chunk-QLQ573SU.js} +35 -9
  115. package/chunk-QQ56R7KS.js +88 -0
  116. package/chunk-QYPE3TS3.js +43 -0
  117. package/{chunk-HTVYCXBP.js → chunk-RN2GPWN6.js} +354 -120
  118. package/{chunk-ATLTFRYJ.js → chunk-ROCUB2H2.js} +280 -98
  119. package/{chunk-4DPP773Q.js → chunk-RSHPU4PD.js} +59 -11
  120. package/chunk-RVWMAFIT.js +134 -0
  121. package/{chunk-ESHYE7WU.js → chunk-S73EPYNC.js} +10 -7
  122. package/{chunk-UQNS32WZ.js → chunk-SCMHQUMK.js} +1 -1
  123. package/chunk-SW4S4XYB.js +1794 -0
  124. package/{chunk-ZUEK6A6C.js → chunk-TTH4HOJD.js} +1973 -754
  125. package/chunk-TY3TIUJK.js +89 -0
  126. package/{chunk-X2QRZXZH.js → chunk-TYJ5XFEA.js} +4 -4
  127. package/{chunk-ALFH24P3.js → chunk-TYYRSFBG.js} +197 -155
  128. package/{chunk-MST6R3E4.js → chunk-U5GPBQDG.js} +34 -22
  129. package/chunk-U5ICMAFV.js +14110 -0
  130. package/{chunk-7KVZ5LDQ.js → chunk-UBUH2TCC.js} +18 -4
  131. package/chunk-UEILX4EV.js +15 -0
  132. package/chunk-UHTDNB5Y.js +140 -0
  133. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  134. package/{chunk-OHOVNO7I.js → chunk-UOKFKFPO.js} +6 -3
  135. package/{chunk-XISEYOGH.js → chunk-USHQX6VT.js} +5 -5
  136. package/chunk-UUPR3TD7.js +53 -0
  137. package/{chunk-3DAVPNFT.js → chunk-V4EE3D54.js} +122 -107
  138. package/{chunk-HDLLCBRF.js → chunk-VEA7H5FG.js} +2 -2
  139. package/chunk-VHGD6FHV.js +116 -0
  140. package/chunk-VIWDGTDA.js +8 -0
  141. package/{chunk-GOH6RW6F.js → chunk-VJXHL6MH.js} +34 -11
  142. package/{chunk-4XEYAFLY.js → chunk-VL5KOY2C.js} +623 -94
  143. package/{chunk-EADNWBAZ.js → chunk-VP3BINY7.js} +13 -0
  144. package/{chunk-DXHL7G2L.js → chunk-VWW6O2TL.js} +274 -93
  145. package/{chunk-EOARMOVD.js → chunk-W4S6OTSC.js} +6 -3
  146. package/chunk-WD4XYDYC.js +567 -0
  147. package/chunk-WJZOQR2J.js +151 -0
  148. package/{chunk-AUDNYVRC.js → chunk-XETG4RIX.js} +5 -5
  149. package/{chunk-MX574M24.js → chunk-XI7DGLUK.js} +4 -4
  150. package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
  151. package/chunk-XRUSXPCQ.js +514 -0
  152. package/{chunk-I4OPU5TK.js → chunk-XS47QOFV.js} +273 -11
  153. package/{chunk-S5XGT6GB.js → chunk-XZNCX52W.js} +30 -9
  154. package/{chunk-5OA5HMTL.js → chunk-YLMMECCH.js} +1 -1
  155. package/{chunk-CFT5HBGW.js → chunk-YVLQXTUB.js} +448 -12
  156. package/chunk-YVPQATSC.js +709 -0
  157. package/chunk-ZEZC7IIM.js +126 -0
  158. package/{chunk-ALGORS6Y.js → chunk-ZF6526IQ.js} +43 -8
  159. package/chunk-ZIWPQEFU.js +165 -0
  160. package/chunk-ZRAU6T47.js +56 -0
  161. package/{cliExecutor-AWYR3T33.js → cliExecutor-BWBF2MTI.js} +4 -3
  162. package/{clipboardy-BX4NMYHE.js → clipboardy-GCO3GT3I.js} +3 -8
  163. package/{commandRegistry-2KBOXZQC.js → commandRegistry-NBLZEMCW.js} +183 -107
  164. package/contentThunks-6AIWNSGO.js +84 -0
  165. package/{cooldownCommands-ZLEPIB4A.js → cooldownCommands-JFKTYS2D.js} +2 -2
  166. package/{createAgentAutomationAction-5UGTB26P.js → createAgentAutomationAction-4BUS65DZ.js} +53 -44
  167. package/createDialogAction-QAIKSCG4.js +76 -0
  168. package/{createPageAction-CDLDKPRM.js → createPageAction-DXCZ334C.js} +65 -54
  169. package/cursorProvider-YGGNMVWX.js +6123 -0
  170. package/{db-VQSAOWAO.js → db-2QOTXYGH.js} +11 -5
  171. package/{dbSlice-DQ32LYTJ.js → dbSlice-J37OGIXH.js} +19 -13
  172. package/{deleteFile-NX6QHCWZ.js → deleteFile-6JWDDRVP.js} +10 -6
  173. package/dialogCommands-YZLSJB6X.js +113 -0
  174. package/{dialogSlice-N3YB65G5.js → dialogSlice-PVUSMKFW.js} +53 -39
  175. package/{docCreateCommands-ZSLGVBZT.js → docCreateCommands-JB2RRMRJ.js} +54 -57
  176. package/{docDeleteCommands-5N4GVZBG.js → docDeleteCommands-AQENULNM.js} +56 -58
  177. package/{docReadCommands-YJSAA7AV.js → docReadCommands-DYD25YLQ.js} +53 -56
  178. package/{docStore-E3CEOV5Q.js → docStore-CSEBEMKP.js} +25 -16
  179. package/{docUpdateCommands-WEMLSW6W.js → docUpdateCommands-3GVS23QL.js} +54 -57
  180. package/{fetchMessages-67MEFPZR.js → fetchMessages-IIJWQ3HR.js} +5 -4
  181. package/{getPricing-NMMFT3YI.js → getPricing-FKK3F5EJ.js} +11 -9
  182. package/{handleSendMessageAction-DQAD5ERJ.js → handleSendMessageAction-G2TLYGC4.js} +422 -118
  183. package/index.js +11 -7
  184. package/{lib-FRRS27KN.js → lib-4YTWAGY7.js} +581 -248
  185. package/{localDialogRead-EBRS242U.js → localDialogRead-FSOMOPDZ.js} +2 -2
  186. package/localRuntimeAdapter-B4TAYYA7.js +244 -0
  187. package/localRuntimeAuthority-JDAD7CB6.js +16 -0
  188. package/{localRuntimeDb-3LRMNLCM.js → localRuntimeDb-CVC62PM5.js} +1 -1
  189. package/{machineCommands-HAP75VSG.js → machineCommands-6OBFD3XF.js} +503 -161
  190. package/{machineInfo-66ZFUMLE.js → machineInfo-UKPTZO5Y.js} +2 -2
  191. package/machineWsRunDispatch-OO7N3O3Y.js +169 -0
  192. package/{memberThunks-5ZXPR63F.js → memberThunks-66DH6ABQ.js} +25 -18
  193. package/{models-ZPU5EDF4.js → models-LAS4B2B5.js} +2 -2
  194. package/package.json +1 -1
  195. package/{providerPresetApply-DD6NGWW6.js → providerPresetApply-MY66I6NT.js} +10 -10
  196. package/{providerRegistry-XDRLMYGJ.js → providerRegistry-QOE2FT57.js} +13 -9
  197. package/{read-EPTJRAEF.js → read-DC4NUGN6.js} +12 -8
  198. package/{readDocTool-W4NDXNEX.js → readDocTool-NCJ5NT25.js} +1 -1
  199. package/{readlineWorkspace-7BC66QSX.js → readlineWorkspace-UIQN7JUR.js} +5017 -915
  200. package/{removeDialogAgentAction-OSYNZRX7.js → removeDialogAgentAction-E2H3OZU6.js} +29 -28
  201. package/{runAgentClientLoop-6E6UC3CE.js → runAgentClientLoop-GS3SGG37.js} +154 -97
  202. package/{runtimeDoctorCommands-ID23PNNZ.js → runtimeDoctorCommands-GIOGC5SC.js} +17 -17
  203. package/secretCommands-ZXZRLR3R.js +700 -0
  204. package/setDialogExtraReferencesAction-SITRPMYU.js +37 -0
  205. package/{setPrimaryDialogAgentAction-WZ7KI3YA.js → setPrimaryDialogAgentAction-U7N45TGC.js} +30 -29
  206. package/{chunk-SONWNI3L.js → settingThunks-Y7SVJOMZ.js} +223 -928
  207. package/{skillDiscovery-ZBU76COE.js → skillDiscovery-QC35EQY4.js} +2 -2
  208. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  209. package/{spaceCommands-UJOVU4XI.js → spaceCommands-ZR5BR3GX.js} +59 -59
  210. package/{streamAgentChatTurn-3UXPYFNX.js → streamAgentChatTurn-4XYC33KE.js} +309 -165
  211. package/{switchDialogAgentAction-GMR7WN3P.js → switchDialogAgentAction-OMGBD3N2.js} +26 -22
  212. package/{tableCommands-G7RV3RU3.js → tableCommands-U3QDY4L6.js} +19 -17
  213. package/{toolApiClient-CVGWM4PN.js → toolApiClient-7WSJJJBV.js} +6 -5
  214. package/tools-P77EE7Q4.js +124 -0
  215. package/tuiSummaryLlmCaller-BM3VSTBU.js +130 -0
  216. package/{updateCommands-4EHDLF5J.js → updateCommands-NQXAGFM7.js} +3 -3
  217. package/{updateDialogTitleAction-UPFV7TDT.js → updateDialogTitleAction-CIANVPZC.js} +102 -57
  218. package/workloadLifecycle-36DXRZKU.js +320 -0
  219. package/action-GI44T4DR.js +0 -31
  220. package/agentListCommands-IW3GQVUP.js +0 -427
  221. package/agentRecordCommands-VCA76W6B.js +0 -134
  222. package/agentRunCommand-YNLDKVR7.js +0 -161
  223. package/browser-image-compression-MFDTD7K6.js +0 -1763
  224. package/chatQueueReduxAdapter-TJRMXMYA.js +0 -186
  225. package/chromeOpsCommands-IXRLN57H.js +0 -289
  226. package/chunk-36KZDDO5.js +0 -2415
  227. package/chunk-ACQD6YI2.js +0 -25363
  228. package/chunk-CQ3WA2NE.js +0 -299
  229. package/chunk-CYSYR67N.js +0 -93
  230. package/chunk-JBTJAPUF.js +0 -35
  231. package/chunk-K2CSUCHJ.js +0 -620
  232. package/chunk-LTRXGFMS.js +0 -83
  233. package/chunk-M76ECQRD.js +0 -13658
  234. package/chunk-MEYIRKDN.js +0 -8967
  235. package/chunk-OCZKATRC.js +0 -129
  236. package/chunk-OTGFTBLI.js +0 -13
  237. package/chunk-PUOC4YRO.js +0 -394
  238. package/chunk-PZZTFEKK.js +0 -34
  239. package/chunk-URMS4XY2.js +0 -10
  240. package/chunk-UV6VISQJ.js +0 -20
  241. package/chunk-VJVNU77E.js +0 -83
  242. package/chunk-XYJSY4KG.js +0 -13807
  243. package/chunk-Y5GCAMGP.js +0 -9
  244. package/chunk-YPREESF4.js +0 -225
  245. package/contentThunks-BDIQRZR6.js +0 -73
  246. package/createDialogAction-B7VGVEVU.js +0 -66
  247. package/dialogCommands-G7YBVAMC.js +0 -102
  248. package/levelLazyShim-GZBKODGI.js +0 -7
  249. package/machineWsRunDispatch-L32G7C4P.js +0 -149
  250. package/serverStoreFactory-YMXDF4NI.js +0 -20
  251. package/setDialogExtraReferencesAction-M32UYNCG.js +0 -30
  252. package/settingSlice-Q6EKL7EQ.js +0 -204
  253. package/syncMapping-N6RGXGBW.js +0 -437
  254. package/tools-MKYDMWA4.js +0 -111
  255. package/tuiSummaryLlmCaller-3YFNHCTW.js +0 -128
  256. package/{chunk-SV5IJK6K.js → chunk-NBTY7YJF.js} +3 -3
  257. package/{chunk-2SYTUTLI.js → chunk-YBNHPX4S.js} +3 -3
  258. package/{offlineMarxistsAgentCommand-HGXZV4XJ.js → offlineMarxistsAgentCommand-2QTHJCHV.js} +4 -4
@@ -0,0 +1,417 @@
1
+ import {
2
+ describeAttachmentForModel
3
+ } from "./chunk-WJZOQR2J.js";
4
+
5
+ // packages/ai/attachments/projectUserPart.ts
6
+ var isRecord = (value) => typeof value === "object" && value !== null;
7
+ var projectUserPartForModel = (part) => {
8
+ if (!isRecord(part) || typeof part.type !== "string") return [];
9
+ if (part.type === "text") {
10
+ return typeof part.text === "string" && part.text.trim() ? [part] : [];
11
+ }
12
+ if (part.type === "image_url") {
13
+ return isRecord(part.image_url) && typeof part.image_url.url === "string" && part.image_url.url.trim() ? [part] : [];
14
+ }
15
+ if (part.type === "attachment") return [{ type: "text", text: describeAttachmentForModel(part) }];
16
+ if (part.type === "media_job") {
17
+ const name = typeof part.name === "string" && part.name.trim() ? part.name.trim() : "\u672A\u547D\u540D\u6587\u4EF6";
18
+ const jobId = typeof part.jobId === "string" ? part.jobId : typeof part.id === "string" ? part.id : "";
19
+ return [{ type: "text", text: `[\u5A92\u4F53\u9644\u4EF6] \u6587\u4EF6=${name}${jobId ? ` jobId=${jobId}` : ""}` }];
20
+ }
21
+ if (typeof part.pageKey === "string" && ["page", "pdf", "docx"].includes(part.type)) return [];
22
+ return [{ type: "text", text: `[\u672A\u8BC6\u522B\u7684\u9644\u4EF6\u7C7B\u578B: ${part.type}]` }];
23
+ };
24
+
25
+ // packages/agent-runtime/outboundRequestDiagnostics.ts
26
+ var OUTBOUND_DIAGNOSTIC_PREFIX = "[outbound-diagnostic]";
27
+ var OUTBOUND_DIAGNOSTICS_ENV = "NOLO_OUTBOUND_DIAGNOSTICS";
28
+ var MAX_PROVIDER_TOKEN_LENGTH = 96;
29
+ var MAX_CALL_ID_LENGTH = 128;
30
+ var MAX_UPSTREAM_REQUEST_ID_LENGTH = 128;
31
+ var IDENTIFIER_PATTERN = /^[A-Za-z0-9._:@+/~-]+$/;
32
+ var REQUEST_ID_PATTERN = /^[A-Za-z0-9._:-]+$/;
33
+ var CONTROL_CHAR_PATTERN = /[\u0000-\u001f\u007f]/;
34
+ var UPSTREAM_REQUEST_ID_HEADERS = ["x-request-id", "request-id"];
35
+ var THINKING_VALUES = /* @__PURE__ */ new Set([
36
+ "enabled",
37
+ "disabled",
38
+ "unspecified",
39
+ "other"
40
+ ]);
41
+ var REASONING_EFFORT_VALUES = /* @__PURE__ */ new Set([
42
+ "none",
43
+ "minimal",
44
+ "low",
45
+ "medium",
46
+ "high",
47
+ "xhigh",
48
+ "unspecified",
49
+ "other"
50
+ ]);
51
+ var ERROR_CATEGORY_VALUES = /* @__PURE__ */ new Set([
52
+ "none",
53
+ "reasoning-contract",
54
+ "invalid-request",
55
+ "authentication",
56
+ "rate-limit",
57
+ "upstream",
58
+ "other"
59
+ ]);
60
+ var TERMINAL_OUTCOME_VALUES = /* @__PURE__ */ new Set([
61
+ "completed",
62
+ "http-error",
63
+ "network-error",
64
+ "aborted",
65
+ "stream-error"
66
+ ]);
67
+ var SEAM_VALUES = /* @__PURE__ */ new Set([
68
+ "local-runtime",
69
+ "chat",
70
+ "server-loop"
71
+ ]);
72
+ var WIRE_VALUES = /* @__PURE__ */ new Set(["chat.completions", "responses"]);
73
+ var HOST_VALUES = /* @__PURE__ */ new Set(["client", "server"]);
74
+ function isRawIdentifierAcceptable(value, maxLength) {
75
+ if (typeof value !== "string") return false;
76
+ if (value.length === 0) return false;
77
+ if (value.length > maxLength) return false;
78
+ if (CONTROL_CHAR_PATTERN.test(value)) return false;
79
+ return true;
80
+ }
81
+ function sanitizeProviderModelToken(value) {
82
+ if (!isRawIdentifierAcceptable(value, MAX_PROVIDER_TOKEN_LENGTH)) return "other";
83
+ const normalized = value.trim();
84
+ if (!normalized || !IDENTIFIER_PATTERN.test(normalized)) return "other";
85
+ return normalized;
86
+ }
87
+ function sanitizeCallId(value) {
88
+ if (!isRawIdentifierAcceptable(value, MAX_CALL_ID_LENGTH)) return void 0;
89
+ const normalized = value.trim();
90
+ if (!normalized || !REQUEST_ID_PATTERN.test(normalized)) return void 0;
91
+ return normalized;
92
+ }
93
+ function sanitizeUpstreamRequestId(value) {
94
+ if (!isRawIdentifierAcceptable(value, MAX_UPSTREAM_REQUEST_ID_LENGTH)) return void 0;
95
+ const normalized = value.trim();
96
+ if (!normalized || !REQUEST_ID_PATTERN.test(normalized)) return void 0;
97
+ return normalized;
98
+ }
99
+ function pickUpstreamRequestId(headers) {
100
+ if (!headers || typeof headers.get !== "function") return void 0;
101
+ try {
102
+ for (const name of UPSTREAM_REQUEST_ID_HEADERS) {
103
+ const raw = headers.get(name);
104
+ const safe = sanitizeUpstreamRequestId(raw);
105
+ if (safe) return safe;
106
+ }
107
+ } catch {
108
+ return void 0;
109
+ }
110
+ return void 0;
111
+ }
112
+ function classifyOutboundErrorCategory(status, errorText) {
113
+ const numeric = typeof status === "number" && Number.isFinite(status) ? status : 0;
114
+ if (numeric === 401 || numeric === 403) return "authentication";
115
+ if (numeric === 429) return "rate-limit";
116
+ if (numeric >= 500) return "upstream";
117
+ const text = typeof errorText === "string" ? errorText : "";
118
+ if (numeric >= 400) {
119
+ if (looksLikeReasoningContractError(text)) return "reasoning-contract";
120
+ return "invalid-request";
121
+ }
122
+ if (numeric === 0) return "other";
123
+ return numeric >= 200 && numeric < 300 ? "none" : "other";
124
+ }
125
+ function looksLikeReasoningContractError(text) {
126
+ if (!text) return false;
127
+ if (!/reasoning_content|reasoning/i.test(text)) return false;
128
+ return /expected a sequence|invalid type|serde|deserializ|type error|missing field/i.test(text);
129
+ }
130
+ function createRequestShapingCounts() {
131
+ return {
132
+ assistantToolTurns: 0,
133
+ missingReasoningTurns: 0,
134
+ placeholderInjectedTurns: 0,
135
+ reasoningStrippedTurns: 0
136
+ };
137
+ }
138
+ function createRequestFacts() {
139
+ return {
140
+ assistantToolTurns: 0,
141
+ missingReasoningTurns: 0,
142
+ // 未观测:只有塑形直连点(collector)能给出「本次注入」。
143
+ placeholderInjectedTurns: null,
144
+ reasoningStrippedTurns: null,
145
+ thinking: "unspecified",
146
+ reasoningEffort: "unspecified",
147
+ projection: { observed: false }
148
+ };
149
+ }
150
+ function applyShapingCounts(facts, counts) {
151
+ if (!counts) return facts;
152
+ facts.assistantToolTurns = toCount(counts.assistantToolTurns);
153
+ facts.missingReasoningTurns = toCount(counts.missingReasoningTurns);
154
+ facts.placeholderInjectedTurns = toCount(counts.placeholderInjectedTurns);
155
+ facts.reasoningStrippedTurns = toCount(counts.reasoningStrippedTurns);
156
+ return facts;
157
+ }
158
+ function attachProjectionFacts(facts, stats) {
159
+ if (!stats) {
160
+ facts.projection = { observed: false };
161
+ return facts;
162
+ }
163
+ facts.projection = {
164
+ observed: true,
165
+ badArguments: {
166
+ truncated: toCount(stats.badArguments?.truncated),
167
+ malformed: toCount(stats.badArguments?.malformed)
168
+ },
169
+ rewrittenToolCalls: toCount(stats.rewrittenToolCalls),
170
+ rewrittenAssistantMessages: toCount(stats.rewrittenAssistantMessages),
171
+ rewrittenToolMessages: toCount(stats.rewrittenToolMessages)
172
+ };
173
+ return facts;
174
+ }
175
+ function writeThinkingFacts(facts, body) {
176
+ const record = asRecord(body);
177
+ facts.thinking = resolveThinkingEnum(record);
178
+ facts.reasoningEffort = resolveReasoningEffortEnum(record);
179
+ return facts;
180
+ }
181
+ function resolveThinkingEnum(body) {
182
+ const thinking = asRecord(body.thinking);
183
+ if (typeof thinking.type === "string") {
184
+ const type = thinking.type.trim().toLowerCase();
185
+ if (type === "enabled") return "enabled";
186
+ if (type === "disabled") return "disabled";
187
+ return "other";
188
+ }
189
+ const chatTemplateKwargs = asRecord(body.chat_template_kwargs);
190
+ const enableThinking = body.enable_thinking ?? chatTemplateKwargs.enable_thinking;
191
+ if (typeof enableThinking === "boolean") return enableThinking ? "enabled" : "disabled";
192
+ return "unspecified";
193
+ }
194
+ function resolveReasoningEffortEnum(body) {
195
+ const raw = body.reasoning_effort;
196
+ if (typeof raw === "string") {
197
+ const value = raw.trim().toLowerCase();
198
+ if (REASONING_EFFORT_VALUES.has(value)) return value;
199
+ return "other";
200
+ }
201
+ const reasoning = asRecord(body.reasoning);
202
+ if (reasoning.enabled === false) return "none";
203
+ return "unspecified";
204
+ }
205
+ function deriveRequestFactsFromBody(body, shapingCounts) {
206
+ const facts = createRequestFacts();
207
+ writeThinkingFacts(facts, body);
208
+ const messages = extractMessages(body);
209
+ if (messages) {
210
+ for (const message of messages) {
211
+ const record = asRecord(message);
212
+ if (record.role !== "assistant") continue;
213
+ const toolCalls = record.tool_calls;
214
+ if (!Array.isArray(toolCalls) || toolCalls.length === 0) continue;
215
+ facts.assistantToolTurns += 1;
216
+ const reasoning = typeof record.reasoning_content === "string" ? record.reasoning_content : "";
217
+ if (reasoning.length === 0) {
218
+ facts.missingReasoningTurns += 1;
219
+ }
220
+ }
221
+ }
222
+ return applyShapingCounts(facts, shapingCounts);
223
+ }
224
+ function extractMessages(body) {
225
+ const record = asRecord(body);
226
+ if (Array.isArray(record.messages)) return record.messages;
227
+ if (Array.isArray(record.input)) return record.input;
228
+ return void 0;
229
+ }
230
+ function resolveOutboundWire(value, explicit) {
231
+ if (explicit) return explicit;
232
+ const text = typeof value === "string" ? value : "";
233
+ return /\/responses(?:[/?#]|$)/.test(text) ? "responses" : "chat.completions";
234
+ }
235
+ function isOutboundDiagnosticsEnabled(env = readProcessEnv()) {
236
+ return env?.[OUTBOUND_DIAGNOSTICS_ENV] === "1";
237
+ }
238
+ function readProcessEnv() {
239
+ if (typeof process === "undefined") return void 0;
240
+ return process.env;
241
+ }
242
+ function createConsoleOutboundDiagnosticSink(log = defaultLog) {
243
+ return (event) => {
244
+ try {
245
+ const serialized = serializeOutboundDiagnosticEvent(event);
246
+ log(`${OUTBOUND_DIAGNOSTIC_PREFIX} ${JSON.stringify(serialized)}`);
247
+ } catch {
248
+ }
249
+ };
250
+ }
251
+ function defaultLog(...args) {
252
+ console.log(...args);
253
+ }
254
+ function resolveOutboundDiagnosticSink(option) {
255
+ if (option?.sink) return option.sink;
256
+ if (option?.enabled === false) return void 0;
257
+ if (option?.enabled === true) return createConsoleOutboundDiagnosticSink();
258
+ if (isOutboundDiagnosticsEnabled()) return createConsoleOutboundDiagnosticSink();
259
+ return void 0;
260
+ }
261
+ function createOutboundDiagnosticCallId() {
262
+ return `obd_${Math.random().toString(36).slice(2, 10)}${Date.now().toString(36)}`;
263
+ }
264
+ function createOutboundDiagnosticCall(args) {
265
+ const callId = sanitizeCallId(args.callId) ?? createOutboundDiagnosticCallId();
266
+ const base = {
267
+ callId,
268
+ seam: args.seam,
269
+ host: args.host,
270
+ wire: args.wire,
271
+ provider: sanitizeProviderModelToken(args.provider),
272
+ model: sanitizeProviderModelToken(args.model)
273
+ };
274
+ return {
275
+ callId,
276
+ dispatch(attempt, facts) {
277
+ emitOutboundDiagnostic(args.sink, {
278
+ ...base,
279
+ version: 1,
280
+ phase: "dispatch",
281
+ attempt: toAttempt(attempt),
282
+ facts
283
+ });
284
+ },
285
+ httpResult(attempt, result) {
286
+ const upstreamRequestId = pickUpstreamRequestId(result.headers);
287
+ const providerCallId = sanitizeCallId(result.providerCallId);
288
+ emitOutboundDiagnostic(args.sink, {
289
+ ...base,
290
+ version: 1,
291
+ phase: "http-result",
292
+ attempt: toAttempt(attempt),
293
+ status: toStatus(result.status),
294
+ errorCategory: result.errorCategory ?? classifyOutboundErrorCategory(result.status),
295
+ ...providerCallId ? { providerCallId } : {},
296
+ ...upstreamRequestId ? { upstreamRequestId } : {}
297
+ });
298
+ },
299
+ terminal(attempt, outcome, providerCallId) {
300
+ const safeProviderCallId = sanitizeCallId(providerCallId);
301
+ emitOutboundDiagnostic(args.sink, {
302
+ ...base,
303
+ version: 1,
304
+ phase: "terminal",
305
+ attempt: toAttempt(attempt),
306
+ outcome,
307
+ ...safeProviderCallId ? { providerCallId: safeProviderCallId } : {}
308
+ });
309
+ }
310
+ };
311
+ }
312
+ function emitOutboundDiagnostic(sink, event) {
313
+ if (!sink) return;
314
+ try {
315
+ sink(event);
316
+ } catch {
317
+ }
318
+ }
319
+ function serializeOutboundDiagnosticEvent(event) {
320
+ const record = event;
321
+ const out = {
322
+ version: 1,
323
+ phase: toEnum(record.phase, /* @__PURE__ */ new Set(["dispatch", "http-result", "terminal"]), "dispatch"),
324
+ callId: sanitizeCallId(record.callId) ?? "unknown",
325
+ attempt: toAttempt(record.attempt),
326
+ seam: toEnum(record.seam, SEAM_VALUES, void 0) ?? void 0,
327
+ host: toEnum(record.host, HOST_VALUES, void 0) ?? void 0,
328
+ wire: toEnum(record.wire, WIRE_VALUES, void 0) ?? void 0,
329
+ provider: sanitizeProviderModelToken(record.provider),
330
+ model: sanitizeProviderModelToken(record.model)
331
+ };
332
+ const providerCallId = sanitizeCallId(record.providerCallId);
333
+ if (providerCallId) out.providerCallId = providerCallId;
334
+ if (out.phase === "dispatch") {
335
+ out.facts = serializeRequestFacts(record.facts);
336
+ } else if (out.phase === "http-result") {
337
+ out.status = toStatus(record.status);
338
+ out.errorCategory = toEnum(
339
+ record.errorCategory,
340
+ ERROR_CATEGORY_VALUES,
341
+ "other"
342
+ );
343
+ const upstreamRequestId = sanitizeUpstreamRequestId(record.upstreamRequestId);
344
+ if (upstreamRequestId) out.upstreamRequestId = upstreamRequestId;
345
+ } else {
346
+ out.outcome = toEnum(record.outcome, TERMINAL_OUTCOME_VALUES, "other");
347
+ }
348
+ for (const key of Object.keys(out)) {
349
+ if (out[key] === void 0) delete out[key];
350
+ }
351
+ return out;
352
+ }
353
+ function serializeRequestFacts(value) {
354
+ const record = asRecord(value);
355
+ const projection = asRecord(record.projection);
356
+ const output = {
357
+ assistantToolTurns: toCount(record.assistantToolTurns),
358
+ missingReasoningTurns: toCount(record.missingReasoningTurns),
359
+ placeholderInjectedTurns: typeof record.placeholderInjectedTurns === "number" ? toCount(record.placeholderInjectedTurns) : null,
360
+ reasoningStrippedTurns: typeof record.reasoningStrippedTurns === "number" ? toCount(record.reasoningStrippedTurns) : null,
361
+ thinking: toEnum(record.thinking, THINKING_VALUES, "unspecified"),
362
+ reasoningEffort: toEnum(
363
+ record.reasoningEffort,
364
+ REASONING_EFFORT_VALUES,
365
+ "unspecified"
366
+ )
367
+ };
368
+ if (projection.observed === true) {
369
+ const bad = asRecord(projection.badArguments);
370
+ output.projection = {
371
+ observed: true,
372
+ badArguments: {
373
+ truncated: toCount(bad.truncated),
374
+ malformed: toCount(bad.malformed)
375
+ },
376
+ rewrittenToolCalls: toCount(projection.rewrittenToolCalls),
377
+ rewrittenAssistantMessages: toCount(projection.rewrittenAssistantMessages),
378
+ rewrittenToolMessages: toCount(projection.rewrittenToolMessages)
379
+ };
380
+ } else {
381
+ output.projection = { observed: false };
382
+ }
383
+ return output;
384
+ }
385
+ function toCount(value) {
386
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0) return 0;
387
+ return Math.floor(value);
388
+ }
389
+ function toAttempt(value) {
390
+ const count = toCount(value);
391
+ return count > 0 ? count : 1;
392
+ }
393
+ function toStatus(value) {
394
+ if (typeof value !== "number" || !Number.isFinite(value)) return 0;
395
+ return Math.floor(value);
396
+ }
397
+ function toEnum(value, allowed, fallback) {
398
+ if (typeof value === "string" && allowed.has(value)) return value;
399
+ return fallback;
400
+ }
401
+ function asRecord(value) {
402
+ return value && typeof value === "object" ? value : {};
403
+ }
404
+
405
+ export {
406
+ projectUserPartForModel,
407
+ classifyOutboundErrorCategory,
408
+ createRequestShapingCounts,
409
+ createRequestFacts,
410
+ applyShapingCounts,
411
+ attachProjectionFacts,
412
+ writeThinkingFacts,
413
+ deriveRequestFactsFromBody,
414
+ resolveOutboundWire,
415
+ resolveOutboundDiagnosticSink,
416
+ createOutboundDiagnosticCall
417
+ };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  findModelConfig,
3
3
  getProviderByModelName
4
- } from "./chunk-3BXNTXYI.js";
5
- import {
6
- asTrimmedLowercaseString
7
- } from "./chunk-QSJ3HFEF.js";
4
+ } from "./chunk-I4SN4NUQ.js";
8
5
  import {
9
6
  asOptionalTrimmedString
10
7
  } from "./chunk-G3SUCT4W.js";
8
+ import {
9
+ asTrimmedLowercaseString
10
+ } from "./chunk-QSJ3HFEF.js";
11
11
 
12
12
  // packages/ai/agent/toolOutputPolicy.ts
13
13
  var MAX_IN_TURN_TOOL_CONTENT_CHARS = 4e3;
@@ -23,8 +23,8 @@ var TOOL_OUTPUT_PROFILES = {
23
23
  execShell: { maxChars: 4e3, headRatio: 0.35 },
24
24
  runCommand: { maxChars: 4e3, headRatio: 0.35 },
25
25
  launchProcess: { maxChars: 2800, headRatio: 0.35 },
26
- editFile: { maxChars: 2800, headRatio: 0.62 },
27
- writeFile: { maxChars: 2400, headRatio: 0.62 },
26
+ editFile: { maxChars: 1200, headRatio: 0.62 },
27
+ writeFile: { maxChars: 1e3, headRatio: 0.62 },
28
28
  readPastedText: { maxChars: 4800, headRatio: 0.5, historicalMaxChars: 4800 }
29
29
  };
30
30
  function resolveToolOutputProfile(toolName) {
@@ -0,0 +1,15 @@
1
+ import {
2
+ BUILTIN_NOLO_AGENT_KEY
3
+ } from "./chunk-EZVK3N5L.js";
4
+
5
+ // packages/core/init.ts
6
+ var nolotusId = "0e95801d90";
7
+ var ADMIN_IDS = /* @__PURE__ */ new Set([nolotusId]);
8
+ var isSystemAdmin = (userId) => userId != null && ADMIN_IDS.has(userId);
9
+ var noloAgentId = BUILTIN_NOLO_AGENT_KEY;
10
+
11
+ export {
12
+ nolotusId,
13
+ isSystemAdmin,
14
+ noloAgentId
15
+ };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  streamSseDataValues
3
- } from "./chunk-GMZLP5DV.js";
3
+ } from "./chunk-HNUWUO75.js";
4
4
  import {
5
5
  getAntigravityUserAgent,
6
6
  readAntigravityProjectId,
7
7
  resolveAntigravityCloudCodeBaseUrl
8
- } from "./chunk-S5XGT6GB.js";
8
+ } from "./chunk-XZNCX52W.js";
9
9
  import {
10
10
  asOptionalTrimmedString
11
11
  } from "./chunk-G3SUCT4W.js";
@@ -40,6 +40,16 @@ var WIRE_PROFILES = {
40
40
  // 证据确认 3.8 的 wire modelEnum,禁止虚构,先只声明同档输出上限;enum 待
41
41
  // discovery 证据到位后补齐。
42
42
  "gemini-3.8-flash-tiered": { maxOutputTokens: 65536 },
43
+ // Gemini 4 Argon:fetchAvailableModels(2026-10 实测)仅返回键 `gemini-4-argon-disabled`
44
+ // (MODEL_PLACEHOLDER_M421,maxOutputTokens 65536,disabled=true,提示「仅 Ultra 订阅可用」)。
45
+ // 该键名带 -disabled 后缀,不是已验证可调用的 wire id:对 streamGenerateContent 用
46
+ // gemini-4-argon / -disabled / -tiered / -low 均返回 404。因此这里以 logical id 作为
47
+ // 透传 wire id(开放后若 discovery 给出真实 id,只需改这一行与 resolve 分支),
48
+ // enum 取自 discovery 的 M421,不凭空推测 low/medium/high 档位 id。
49
+ // 2026-10-13 实测:UA 升到官方 2.23.1 后 discovery 与 2.18.1 完全一致(仍仅 gemini-4-argon-disabled,
50
+ // disabled=true,tagTitle "Unavailable",tagDescription "currently available to Ultra plan subscribers"),
51
+ // streamGenerateContent 仍 404;loadCodeAssist currentTier=free-tier,账号非 Ultra,故保持占位映射。
52
+ "gemini-4-argon": { modelEnum: "MODEL_PLACEHOLDER_M421", maxOutputTokens: 65536 },
43
53
  "gemini-3.6-flash-low": { maxOutputTokens: 65536 },
44
54
  "gemini-3.6-flash-medium": { maxOutputTokens: 65536 },
45
55
  "gemini-3.6-flash-high": { maxOutputTokens: 65536 },
@@ -70,6 +80,10 @@ function resolveAntigravityWireModel(logicalModelId) {
70
80
  const wireModelId = "gemini-3.8-flash-tiered";
71
81
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
72
82
  }
83
+ if (lower === "gemini-4-argon" || ["gemini-4-argon-low", "gemini-4-argon-medium", "gemini-4-argon-high"].includes(lower)) {
84
+ const wireModelId = "gemini-4-argon";
85
+ return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
86
+ }
73
87
  if (lower === "gemini-3.6-flash") {
74
88
  const wireModelId = "gemini-3.6-flash-low";
75
89
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
@@ -295,6 +309,43 @@ function sanitizeGeminiSchemaNode(node, active) {
295
309
  seen.delete(node);
296
310
  }
297
311
  }
312
+ var enumMetaByNode = /* @__PURE__ */ new WeakMap();
313
+ function enumMetaOf(node) {
314
+ return node && typeof node === "object" ? enumMetaByNode.get(node) : void 0;
315
+ }
316
+ function rawEnumValues(src) {
317
+ if (Array.isArray(src.enum) && src.enum.length > 0) return src.enum;
318
+ if ("const" in src && src.const !== void 0) return [src.const];
319
+ return void 0;
320
+ }
321
+ function geminiEnumFields(values, baseDescription) {
322
+ if (values.every((v) => typeof v === "string")) {
323
+ return {
324
+ enum: [...new Set(values)],
325
+ description: baseDescription
326
+ };
327
+ }
328
+ if (values.every((v) => typeof v === "number" || typeof v === "boolean")) {
329
+ const allowed2 = [...new Set(values.map((v) => String(v)))].join(", ");
330
+ const note2 = `(allowed: ${allowed2})`;
331
+ return {
332
+ description: baseDescription ? `${baseDescription} ${note2}` : note2
333
+ };
334
+ }
335
+ const allowed = [...new Set(values.map(geminiEnumLiteral))].join(", ");
336
+ const note = `(allowed: ${allowed})`;
337
+ return {
338
+ description: baseDescription ? `${baseDescription} ${note}` : note
339
+ };
340
+ }
341
+ function geminiEnumLiteral(value) {
342
+ const json = JSON.stringify(value);
343
+ return json === void 0 ? String(value) : json;
344
+ }
345
+ function applyGeminiEnum(out, fields) {
346
+ if (fields.enum) out.enum = fields.enum;
347
+ if (fields.description !== void 0) out.description = fields.description;
348
+ }
298
349
  function sanitizeGeminiSchemaNodeInner(src, out, seen) {
299
350
  if (Array.isArray(src.type)) {
300
351
  const firstNonNull = src.type.find((t) => t !== "null");
@@ -306,10 +357,12 @@ function sanitizeGeminiSchemaNodeInner(src, out, seen) {
306
357
  if (typeof src.description === "string") out.description = src.description;
307
358
  if (typeof src.minimum === "number") out.minimum = src.minimum;
308
359
  if (typeof src.maximum === "number") out.maximum = src.maximum;
309
- if (Array.isArray(src.enum) && src.enum.length > 0) out.enum = src.enum;
310
360
  if (src.nullable === true) out.nullable = true;
311
- if ("const" in src && src.const !== void 0 && !out.enum) {
312
- out.enum = [src.const];
361
+ const enumValues = rawEnumValues(src);
362
+ if (enumValues) {
363
+ const baseDescription = typeof src.description === "string" ? src.description : void 0;
364
+ enumMetaByNode.set(out, { values: enumValues, baseDescription });
365
+ applyGeminiEnum(out, geminiEnumFields(enumValues, baseDescription));
313
366
  }
314
367
  const variantBranches = [
315
368
  ...Array.isArray(src.oneOf) ? src.oneOf : [],
@@ -323,13 +376,19 @@ function sanitizeGeminiSchemaNodeInner(src, out, seen) {
323
376
  const branchProperties = sanitized.properties ?? {};
324
377
  for (const [key, value] of Object.entries(branchProperties)) {
325
378
  const previous = mergedProperties[key];
326
- const prevEnum = previous?.enum;
327
- const nextEnum = value?.enum;
328
- if (prevEnum && nextEnum) {
329
- mergedProperties[key] = {
330
- ...value,
331
- enum: [.../* @__PURE__ */ new Set([...prevEnum, ...nextEnum])]
379
+ const prevMeta = enumMetaOf(previous);
380
+ const nextMeta = enumMetaOf(value);
381
+ if (prevMeta && nextMeta) {
382
+ const values = [...prevMeta.values, ...nextMeta.values];
383
+ const baseDescription = nextMeta.baseDescription ?? prevMeta.baseDescription;
384
+ const node = {
385
+ ...value
332
386
  };
387
+ delete node.enum;
388
+ delete node.description;
389
+ applyGeminiEnum(node, geminiEnumFields(values, baseDescription));
390
+ enumMetaByNode.set(node, { values, baseDescription });
391
+ mergedProperties[key] = node;
333
392
  } else {
334
393
  mergedProperties[key] = value;
335
394
  }
@@ -427,11 +486,17 @@ function applyGeminiChunk(chunk, state, options) {
427
486
  // cached ⊆ prompt;对畸形上游防御性钳位,避免 cache_read > input 破坏归一化与计费
428
487
  Math.min(Math.max(0, Math.floor(meta.cachedContentTokenCount)), prompt)
429
488
  ) : 0;
489
+ const thoughts = typeof meta.thoughtsTokenCount === "number" ? meta.thoughtsTokenCount : Array.isArray(meta.candidatesTokensDetails) && typeof meta.candidatesTokensDetails[0]?.tokensCount === "number" ? meta.candidatesTokensDetails[0].tokensCount : void 0;
430
490
  state.usage = {
431
491
  prompt_tokens: prompt,
432
492
  completion_tokens: candidates2,
433
493
  total_tokens: total,
434
- ...cached > 0 ? { cache_read_input_tokens: cached } : {}
494
+ ...cached > 0 ? { cache_read_input_tokens: cached } : {},
495
+ ...thoughts !== void 0 ? {
496
+ completion_tokens_details: {
497
+ reasoning_tokens: thoughts
498
+ }
499
+ } : {}
435
500
  };
436
501
  state.events.push({ kind: "usage", usage: state.usage });
437
502
  }
@@ -856,6 +921,7 @@ export {
856
921
  parseSseDataLineJson,
857
922
  parseSseDataLineObject,
858
923
  parseUpstreamErrorBody,
924
+ resolveGeminiModelQuirks,
859
925
  isGemini3Model,
860
926
  accumulateGeminiChunks,
861
927
  shouldUseGeminiNativeToolRoute,