@wirecat/drive-cli 0.71.0 → 0.72.1

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/README.md +150 -71
  2. package/contracts/wirecat.json +77 -8
  3. package/dist/bin/drive.js +2 -2
  4. package/dist/bundle/agent-GOCD4ZW2.js +46 -0
  5. package/dist/bundle/{all-profiles-3QJG2NAN.js → all-profiles-PZVP3G73.js} +67 -25
  6. package/dist/bundle/{anthropic-PSWTEU6G.js → anthropic-PUOTKSYV.js} +9 -9
  7. package/dist/bundle/{app-server-PVTA6ABR.js → app-server-MKDCXRZM.js} +97 -79
  8. package/dist/bundle/{bun-LU5LP3JI.js → bun-NS5YLOQT.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-PYMKLBRU.js → bun-sqlite-KSKWRLLO.js} +9 -9
  10. package/dist/bundle/{chunk-COOOO5B3.js → chunk-2CG3LUQS.js} +4 -4
  11. package/dist/bundle/{chunk-YVI5SQPY.js → chunk-2TVHFJKV.js} +1 -1
  12. package/dist/bundle/chunk-35FIJGTT.js +52 -0
  13. package/dist/bundle/chunk-35GROSBS.js +3233 -0
  14. package/dist/bundle/{chunk-D5TGYUVU.js → chunk-3CH7I452.js} +9 -60
  15. package/dist/bundle/{chunk-ICDCAQ6K.js → chunk-3QBRS3JT.js} +13 -9
  16. package/dist/bundle/chunk-3T7JIHSO.js +353 -0
  17. package/dist/bundle/{chunk-Q7DOMFJ4.js → chunk-3VIEGRBA.js} +6 -6
  18. package/dist/bundle/chunk-3YCUYFTD.js +2159 -0
  19. package/dist/bundle/{chunk-CJLVYIOP.js → chunk-3ZGWJYSG.js} +30 -21
  20. package/dist/bundle/{chunk-YPFWNVHV.js → chunk-43PCMVTZ.js} +2 -100
  21. package/dist/bundle/{chunk-OF422U5D.js → chunk-4DK55MLP.js} +402 -402
  22. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  23. package/dist/bundle/chunk-4P6D6CUS.js +282 -0
  24. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  25. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  26. package/dist/bundle/{chunk-6W763DZN.js → chunk-54O5NJRC.js} +14 -13
  27. package/dist/bundle/{chunk-MNLL5YLM.js → chunk-5BHP4FVM.js} +2 -2
  28. package/dist/bundle/{chunk-ACUAV6VX.js → chunk-6JU4KLAZ.js} +108 -72
  29. package/dist/bundle/{chunk-YMJ6IDGT.js → chunk-6KND2DYT.js} +38 -8
  30. package/dist/bundle/{chunk-4HWJOU7N.js → chunk-7YPZPJTB.js} +1 -1
  31. package/dist/bundle/chunk-A5XNUMW7.js +108 -0
  32. package/dist/bundle/{chunk-X4TIMMKJ.js → chunk-AG34MPVN.js} +1 -1
  33. package/dist/bundle/chunk-B5V2U7IS.js +221 -0
  34. package/dist/bundle/chunk-B6JC5RS3.js +696 -0
  35. package/dist/bundle/chunk-BDZXGDGI.js +80 -0
  36. package/dist/bundle/{chunk-B5KSXHJ7.js → chunk-BMTMGMGE.js} +1 -1
  37. package/dist/bundle/{chunk-ZCR3IRZ2.js → chunk-CP2TZXAG.js} +16 -9
  38. package/dist/bundle/{chunk-TAUBRNC5.js → chunk-DOEP4EPW.js} +72 -59
  39. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  40. package/dist/bundle/{chunk-QETR5HIZ.js → chunk-E2TMWONO.js} +4385 -2684
  41. package/dist/bundle/chunk-E5EYJU5R.js +7 -0
  42. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  43. package/dist/bundle/{chunk-HL52XXZX.js → chunk-EXHTGQR2.js} +3 -4
  44. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  45. package/dist/bundle/{chunk-ASMMG72J.js → chunk-FJQO5OHR.js} +261 -565
  46. package/dist/bundle/{chunk-RJOQH5YY.js → chunk-FKP4T7A4.js} +111 -859
  47. package/dist/bundle/{chunk-JDV7HNNQ.js → chunk-FTL3WXZB.js} +13 -26
  48. package/dist/bundle/{chunk-FP54WSIR.js → chunk-G2CH4FRW.js} +4 -4
  49. package/dist/bundle/chunk-G2KKMQRN.js +30 -0
  50. package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
  51. package/dist/bundle/{chunk-Y2NWGNUB.js → chunk-G7SKXAVZ.js} +5 -5
  52. package/dist/bundle/{chunk-FT3LN3HP.js → chunk-GFI3UUIU.js} +1 -1
  53. package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
  54. package/dist/bundle/{chunk-QFR2PNJN.js → chunk-GTROGY74.js} +12 -12
  55. package/dist/bundle/{chunk-UTO2GO4P.js → chunk-GYAPDUF5.js} +45 -66
  56. package/dist/bundle/{chunk-GBKNJWOZ.js → chunk-HCMEU7AF.js} +8 -8
  57. package/dist/bundle/{chunk-FJH7DJWK.js → chunk-HDGJ7IDE.js} +6 -6
  58. package/dist/bundle/{chunk-Z3KUSRCF.js → chunk-HMN26CVU.js} +2 -2
  59. package/dist/bundle/{chunk-I4RWW3UD.js → chunk-HOICQNJX.js} +20 -5
  60. package/dist/bundle/{chunk-P7CUM5IB.js → chunk-HPS2YGSZ.js} +1 -1
  61. package/dist/bundle/{chunk-HMS6EEQL.js → chunk-HSASPXRW.js} +3 -3
  62. package/dist/bundle/{chunk-KGYVHPGE.js → chunk-IABPGOMT.js} +2 -2
  63. package/dist/bundle/{chunk-4QNW4NK6.js → chunk-IBQZT2YD.js} +1 -1
  64. package/dist/bundle/{chunk-PRW6SYA3.js → chunk-IE3R46YN.js} +313 -257
  65. package/dist/bundle/{chunk-7PDHGZN4.js → chunk-IE6O7463.js} +4 -4
  66. package/dist/bundle/{chunk-3UGYFXH6.js → chunk-IPBYU43F.js} +192 -379
  67. package/dist/bundle/{chunk-RWDKMU74.js → chunk-IS7STZEB.js} +3 -3
  68. package/dist/bundle/{chunk-GOWXXYEF.js → chunk-IV77ZFF4.js} +4 -4
  69. package/dist/bundle/{chunk-6XFIITOG.js → chunk-JDGF3YYS.js} +4811 -3486
  70. package/dist/bundle/{chunk-GPQ44Y2R.js → chunk-JHAACT4I.js} +2 -2
  71. package/dist/bundle/{chunk-SERXSCN3.js → chunk-JRED7BNX.js} +337 -390
  72. package/dist/bundle/{chunk-MIA7P6FZ.js → chunk-JSYUB4SM.js} +6 -6
  73. package/dist/bundle/{chunk-RESDD3Q4.js → chunk-JVM75M4H.js} +16 -3
  74. package/dist/bundle/{chunk-XF4EXO2C.js → chunk-JZ65CQWK.js} +6 -6
  75. package/dist/bundle/{chunk-QNRRK3CN.js → chunk-KBR7OC5S.js} +2 -2
  76. package/dist/bundle/chunk-KI6OOW6D.js +123 -0
  77. package/dist/bundle/chunk-KOI5G7NM.js +388 -0
  78. package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-KPBUJQKT.js} +1 -1
  79. package/dist/bundle/{chunk-2LHAVY4U.js → chunk-KVBGIZ2C.js} +1 -1
  80. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  81. package/dist/bundle/{chunk-SAKO3P4H.js → chunk-LKUWH6KU.js} +1 -1
  82. package/dist/bundle/chunk-MA6U4XH2.js +36 -0
  83. package/dist/bundle/{chunk-TAFHYHKA.js → chunk-MA7ETVTZ.js} +43 -186
  84. package/dist/bundle/{chunk-KYKW2W6X.js → chunk-MDJUYCHT.js} +1 -1
  85. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  86. package/dist/bundle/{chunk-Z56QFOBR.js → chunk-MGC2BAD2.js} +1 -1
  87. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  88. package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
  89. package/dist/bundle/{chunk-OJSBWP3F.js → chunk-OBDPKDGB.js} +69 -7
  90. package/dist/bundle/{chunk-WVDCCYS3.js → chunk-ODTBJGWQ.js} +17 -17
  91. package/dist/bundle/chunk-PB6ACIME.js +80 -0
  92. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  93. package/dist/bundle/{chunk-72C4YOCH.js → chunk-PMAV3RNP.js} +7 -7
  94. package/dist/bundle/chunk-PSY67L73.js +783 -0
  95. package/dist/bundle/{chunk-6TNNT2MQ.js → chunk-PUVQOZ2N.js} +483 -176
  96. package/dist/bundle/{chunk-SDKQNOL5.js → chunk-QB7K6PIP.js} +6 -6
  97. package/dist/bundle/chunk-QK7GKFKB.js +188 -0
  98. package/dist/bundle/{chunk-4PA4DHYV.js → chunk-QMUWHKP5.js} +6 -6
  99. package/dist/bundle/chunk-QURQ2OU2.js +250 -0
  100. package/dist/bundle/{chunk-LXKYKRHD.js → chunk-R3EDZWXF.js} +8 -227
  101. package/dist/bundle/{chunk-KGERXYTV.js → chunk-RM4DO2WZ.js} +1 -1
  102. package/dist/bundle/chunk-S27UKJVL.js +730 -0
  103. package/dist/bundle/{chunk-22QQUKWA.js → chunk-S3SLDYTU.js} +1 -1
  104. package/dist/bundle/{chunk-FCS26CYQ.js → chunk-SAEBHENE.js} +4 -4
  105. package/dist/bundle/chunk-SM7Z2BQF.js +561 -0
  106. package/dist/bundle/{chunk-QXC6IEH6.js → chunk-SODB63MR.js} +201 -423
  107. package/dist/bundle/{chunk-2PUNKUYJ.js → chunk-SSFGSY77.js} +10320 -9907
  108. package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
  109. package/dist/bundle/{chunk-BKSQBBYG.js → chunk-SUQT4KI2.js} +9 -9
  110. package/dist/bundle/{chunk-YPNWIB6H.js → chunk-SWQDKO6D.js} +3 -3
  111. package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
  112. package/dist/bundle/{chunk-3N2OFXB5.js → chunk-T3OK6AYZ.js} +5 -5
  113. package/dist/bundle/{chunk-HKY7X6NY.js → chunk-TFIAD57H.js} +4 -4
  114. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  115. package/dist/bundle/{chunk-XMMFBPGC.js → chunk-TUL6MCTY.js} +3 -3
  116. package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
  117. package/dist/bundle/{chunk-YJIGGUPI.js → chunk-UL5HSHFU.js} +4 -4
  118. package/dist/bundle/{chunk-3EBBLKIT.js → chunk-UT64BBEP.js} +4 -4
  119. package/dist/bundle/{chunk-26DHFMGZ.js → chunk-VBIZD5V5.js} +2 -2
  120. package/dist/bundle/chunk-VHTELRUA.js +50 -0
  121. package/dist/bundle/chunk-VOQICE3G.js +340 -0
  122. package/dist/bundle/{chunk-GZ2D4KXG.js → chunk-WDJRUNQN.js} +35 -12
  123. package/dist/bundle/{chunk-2UUWXPOB.js → chunk-X5CXANSA.js} +3 -3
  124. package/dist/bundle/{chunk-35SCQ4VI.js → chunk-X6HPQKAI.js} +43 -35
  125. package/dist/bundle/{chunk-COJSWDNU.js → chunk-XKWQDQ4B.js} +3 -3
  126. package/dist/bundle/{chunk-6SJOTNHF.js → chunk-XZEVHUKI.js} +6 -28
  127. package/dist/bundle/{chunk-JZHBZOJR.js → chunk-YE7DJB3F.js} +3 -3
  128. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  129. package/dist/bundle/{chunk-2BVVU7GG.js → chunk-YJVQ5GST.js} +1 -1
  130. package/dist/bundle/{chunk-ZM63SUHG.js → chunk-YRCGFSRR.js} +2 -2
  131. package/dist/bundle/{chunk-EOEU3AZN.js → chunk-ZNFXKFGF.js} +13 -13
  132. package/dist/bundle/{cli-556DERZL.js → cli-KXRWXGTS.js} +217 -114
  133. package/dist/bundle/command-contract-BGNT7MTQ.js +45 -0
  134. package/dist/bundle/{command-server-entry-AYLGNZWD.js → command-server-entry-7FZX74T6.js} +36 -34
  135. package/dist/bundle/{decode-QU24MWMN.js → decode-SZ6W34U3.js} +10 -10
  136. package/dist/bundle/{dispatch-4KODNOXV.js → dispatch-4KNSZ3PI.js} +10 -10
  137. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  138. package/dist/bundle/drive.js +11 -11
  139. package/dist/bundle/{echarts-BXX4OQWC.js → echarts-ISH62J4E.js} +2 -2
  140. package/dist/bundle/{embed-KG27KG3D.js → embed-6ODGTZPK.js} +10 -10
  141. package/dist/bundle/{embedder-IPAVUQUV.js → embedder-6FY67FTQ.js} +15 -15
  142. package/dist/bundle/entry-2SA6ZX7E.js +25 -0
  143. package/dist/bundle/{failure-ESL7ETL4.js → failure-V3ILKUTX.js} +4 -4
  144. package/dist/bundle/first-run-ZNKPPD6M.js +31 -0
  145. package/dist/bundle/first-screen-WF6GYLPN.js +45 -0
  146. package/dist/bundle/google-QCADNPCQ.js +46 -0
  147. package/dist/bundle/{google-api-VCDBSNOW.js → google-api-ZTI3NKZX.js} +88 -73
  148. package/dist/bundle/grants-BPN5AGDK.js +133 -0
  149. package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
  150. package/dist/bundle/hast-util-to-html-VP6XLPKJ.js +998 -0
  151. package/dist/bundle/hast-util-to-mdast-IZ5PRX72.js +2272 -0
  152. package/dist/bundle/{identity-LOWMVGZY.js → identity-YX4IPGOO.js} +7 -6
  153. package/dist/bundle/{instructions-2VECIDXF.js → instructions-G5ZGHVFB.js} +1 -1
  154. package/dist/bundle/{login-7GBONT7V.js → login-CVX5VJX6.js} +96 -81
  155. package/dist/bundle/{mcp-O6ACR2DX.js → mcp-MQ2L5IIM.js} +2 -2
  156. package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-HEZF7KJ4.js} +137 -195
  157. package/dist/bundle/mdast-util-gfm-AQW6R6MG.js +925 -0
  158. package/dist/bundle/mdast-util-to-hast-DF2QVIRV.js +879 -0
  159. package/dist/bundle/mdast-util-to-markdown-XYLXB3Z3.js +18 -0
  160. package/dist/bundle/meeting-combined-HKZJMJ6Q.js +28 -0
  161. package/dist/bundle/meeting-model-DSE4GRVE.js +29 -0
  162. package/dist/bundle/{meeting-semantic-G7PFOKU7.js → meeting-semantic-OHG2QN2G.js} +10 -10
  163. package/dist/bundle/{micromark-extension-gfm-GRL24TU6.js → micromark-extension-gfm-OE2GBORZ.js} +11 -78
  164. package/dist/bundle/{node-MPEQSFI3.js → node-NLJINXVQ.js} +2 -2
  165. package/dist/bundle/{node-sqlite-OLQMAYB4.js → node-sqlite-KDFQDYVZ.js} +10 -10
  166. package/dist/bundle/notes-search-3VBVSQ3R.js +70 -0
  167. package/dist/bundle/oauth-M3E62ZHC.js +22 -0
  168. package/dist/bundle/{open-OXTE672W.js → open-WVRUVBIZ.js} +8 -8
  169. package/dist/bundle/{openai-EB3TPIZY.js → openai-JJWOSJMV.js} +22 -21
  170. package/dist/bundle/{process-F6TKXWWA.js → process-LPVAYRO7.js} +1 -1
  171. package/dist/bundle/{program-4IFDZ7FM.js → program-ZJRIP25J.js} +276 -1149
  172. package/dist/bundle/{prompt-F5RRHPN2.js → prompt-XCDHTEAO.js} +8 -8
  173. package/dist/bundle/{reasons-UORHJDHK.js → reasons-REEEQDAZ.js} +6 -5
  174. package/dist/bundle/{recognize-DAVNZND3.js → recognize-OZLFDJAT.js} +7 -7
  175. package/dist/bundle/remote-MDPYVCZB.js +35 -0
  176. package/dist/bundle/{rerank-CND2GVLZ.js → rerank-FLZWJNHA.js} +11 -11
  177. package/dist/bundle/{serve-ZHSPUIGX.js → serve-5UV5VLRV.js} +19 -19
  178. package/dist/bundle/{server-YMAK4LHC.js → server-53A2X2MK.js} +89 -70
  179. package/dist/bundle/server-5GMURMDE.js +97 -0
  180. package/dist/bundle/{services-ZILSFJ6E.js → services-XSMH7BXB.js} +109 -89
  181. package/dist/bundle/{sqlite-runtime-S5VPMZQH.js → sqlite-runtime-E3L7ENFU.js} +9 -9
  182. package/dist/bundle/{start-CR6X25RT.js → start-4S2VNR4J.js} +7 -7
  183. package/dist/bundle/{state-YFPHVIIJ.js → state-TQI4JSH7.js} +9 -9
  184. package/dist/bundle/{store-CL4ZJZRI.js → store-GS7PU6PJ.js} +38 -23
  185. package/dist/bundle/{store-UODRT6X4.js → store-VYJPL7MW.js} +36 -25
  186. package/dist/bundle/store-maintenance-command-JJVYUZMG.js +85 -0
  187. package/dist/bundle/surface-JC4XVMZR.js +83 -0
  188. package/dist/bundle/tokens-KJQ5EAPW.js +133 -0
  189. package/dist/commands/documents.d.ts.map +1 -1
  190. package/dist/commands/documents.js +11 -1
  191. package/dist/commands/documents.js.map +1 -1
  192. package/dist/commands/remote.d.ts.map +1 -1
  193. package/dist/commands/remote.js +8 -22
  194. package/dist/commands/remote.js.map +1 -1
  195. package/dist/commands/sync.d.ts.map +1 -1
  196. package/dist/commands/sync.js +14 -4
  197. package/dist/commands/sync.js.map +1 -1
  198. package/dist/config.d.ts +5 -0
  199. package/dist/config.d.ts.map +1 -1
  200. package/dist/config.js +5 -0
  201. package/dist/config.js.map +1 -1
  202. package/dist/first-screen.d.ts.map +1 -1
  203. package/dist/first-screen.js +2 -1
  204. package/dist/first-screen.js.map +1 -1
  205. package/dist/generated/manifest.d.ts +2 -1
  206. package/dist/generated/manifest.d.ts.map +1 -1
  207. package/dist/generated/manifest.js +782 -0
  208. package/dist/generated/manifest.js.map +1 -1
  209. package/dist/generated/types.d.ts +262 -58
  210. package/dist/generated/types.d.ts.map +1 -1
  211. package/dist/google.d.ts.map +1 -1
  212. package/dist/google.js +5 -5
  213. package/dist/google.js.map +1 -1
  214. package/dist/model.d.ts +5 -2
  215. package/dist/model.d.ts.map +1 -1
  216. package/dist/model.js.map +1 -1
  217. package/dist/policy-keys.js +1 -1
  218. package/dist/policy-keys.js.map +1 -1
  219. package/dist/program.d.ts.map +1 -1
  220. package/dist/program.js +9 -4
  221. package/dist/program.js.map +1 -1
  222. package/dist/state.d.ts.map +1 -1
  223. package/dist/state.js +6 -1
  224. package/dist/state.js.map +1 -1
  225. package/dist/store.d.ts.map +1 -1
  226. package/dist/store.js +2 -7
  227. package/dist/store.js.map +1 -1
  228. package/dist/supported.d.ts +2 -2
  229. package/dist/supported.d.ts.map +1 -1
  230. package/dist/supported.js +2 -3
  231. package/dist/supported.js.map +1 -1
  232. package/dist/sync.d.ts +2 -1
  233. package/dist/sync.d.ts.map +1 -1
  234. package/dist/sync.js +5 -2
  235. package/dist/sync.js.map +1 -1
  236. package/dist/version.d.ts +1 -1
  237. package/dist/version.js +1 -1
  238. package/package.json +3 -3
  239. package/scenarios/find-decision.md +1 -1
  240. package/skills/drive-cli/SKILL.md +4 -2
  241. package/dist/bundle/chunk-J5Q5FS2N.js +0 -593
  242. package/dist/bundle/chunk-L46C6HQ7.js +0 -729
  243. package/dist/bundle/chunk-UDMNY63V.js +0 -899
  244. package/dist/bundle/chunk-VKE77B3F.js +0 -2
  245. package/dist/bundle/command-contract-VRTOAV6W.js +0 -43
  246. package/dist/bundle/entry-MVXQETWS.js +0 -25
  247. package/dist/bundle/first-run-4UVLW2WR.js +0 -31
  248. package/dist/bundle/first-screen-JAKAIINI.js +0 -41
  249. package/dist/bundle/google-22NXXJX5.js +0 -45
  250. package/dist/bundle/grants-MQMTVCRQ.js +0 -118
  251. package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
  252. package/dist/bundle/meeting-combined-LVP4AZKA.js +0 -27
  253. package/dist/bundle/meeting-model-RAY5XDXZ.js +0 -29
  254. package/dist/bundle/oauth-SGH2I2BY.js +0 -22
  255. package/dist/bundle/remote-D5EYYIAU.js +0 -35
  256. package/dist/bundle/server-DUVJWP3Q.js +0 -80
  257. package/dist/bundle/store-maintenance-command-DY5XIBWR.js +0 -72
  258. package/dist/bundle/tokens-AF7QOFOF.js +0 -118
@@ -4,15 +4,15 @@ import {
4
4
  PLAIN_HTTP_REFUSED,
5
5
  modelAddressAllowed,
6
6
  onThisComputer
7
- } from "./chunk-YMJ6IDGT.js";
7
+ } from "./chunk-6KND2DYT.js";
8
8
  import {
9
9
  readSharedSection,
10
10
  sharedConfigPath,
11
11
  writeSharedSection
12
- } from "./chunk-GBKNJWOZ.js";
12
+ } from "./chunk-HCMEU7AF.js";
13
13
  import {
14
14
  storePath
15
- } from "./chunk-Z3KUSRCF.js";
15
+ } from "./chunk-HMN26CVU.js";
16
16
  import {
17
17
  boolean,
18
18
  isoTimestamp,
@@ -20,15 +20,15 @@ import {
20
20
  safeParse,
21
21
  strictObject,
22
22
  string
23
- } from "./chunk-OJSBWP3F.js";
23
+ } from "./chunk-OBDPKDGB.js";
24
24
  import {
25
25
  CliError
26
- } from "./chunk-4QNW4NK6.js";
26
+ } from "./chunk-IBQZT2YD.js";
27
27
  import {
28
28
  __name
29
29
  } from "./chunk-ZVVMGPBJ.js";
30
30
 
31
- // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/models/local-only.js
31
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/models/local-only.js
32
32
  var SECTION = "local_only";
33
33
  var Setting = strictObject({
34
34
  on: boolean(),
@@ -0,0 +1,188 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ filesPresent,
5
+ sharedModelsDirectory
6
+ } from "./chunk-2CG3LUQS.js";
7
+ import {
8
+ CliError,
9
+ isCliError
10
+ } from "./chunk-IBQZT2YD.js";
11
+ import {
12
+ __name
13
+ } from "./chunk-ZVVMGPBJ.js";
14
+
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/images/picture/models.js
16
+ import { join } from "node:path";
17
+ var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
18
+ var IMAGE_MODELS = [
19
+ {
20
+ id: "clip-b32",
21
+ title: "CLIP ViT-B/32, 8-bit",
22
+ languages: "English only: translate a query before searching",
23
+ licence: "MIT",
24
+ dims: 512,
25
+ key: "local:clip-b32:512",
26
+ maxTokens: 77,
27
+ vision: "onnx/vision_model_quantized.onnx",
28
+ text: "onnx/text_model_quantized.onnx",
29
+ files: [
30
+ {
31
+ name: "onnx/vision_model_quantized.onnx",
32
+ url: clip("onnx/vision_model_quantized.onnx"),
33
+ sha256: "583fd1110a514667812fee7d684952aaf82a99b959760c8d7dca7e0ab9839299",
34
+ bytes: 89117001
35
+ },
36
+ {
37
+ name: "onnx/text_model_quantized.onnx",
38
+ url: clip("onnx/text_model_quantized.onnx"),
39
+ sha256: "73baab855d406190da9faa498cfedf65f15cf309f4cc7385b7b032e6d08e5c3a",
40
+ bytes: 64504507
41
+ },
42
+ {
43
+ name: "tokenizer.json",
44
+ url: clip("tokenizer.json"),
45
+ sha256: "f7f3b7af117d467b58374797691a6438d3e6b9e9cef800dfd5dced7f697a90cd",
46
+ bytes: 2224119
47
+ },
48
+ {
49
+ name: "tokenizer_config.json",
50
+ url: clip("tokenizer_config.json"),
51
+ sha256: "60ba2912bc6344c94bc16bbdec27fa1209409167b6f2fdf3cfe9e65462ea3967",
52
+ bytes: 775
53
+ }
54
+ ]
55
+ }
56
+ ];
57
+ var DEFAULT_IMAGE_MODEL = "clip-b32";
58
+ var imageModel = /* @__PURE__ */ __name((id) => {
59
+ const found = IMAGE_MODELS.find((model) => model.id === id);
60
+ if (!found) {
61
+ throw new CliError("validation_error", `no image model ${id} \u2014 one of: ${IMAGE_MODELS.map((model) => model.id).join(", ")}`);
62
+ }
63
+ return found;
64
+ }, "imageModel");
65
+ var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("image", env), "imageModelsDirectory");
66
+ var placedImage = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join(directory, model.id, file.name)]), "placedImage");
67
+ var isImageModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedImage(model, directory)), "isImageModelInstalled");
68
+
69
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/sends/guarded.js
70
+ import { AsyncLocalStorage } from "node:async_hooks";
71
+ var sentIds = /* @__PURE__ */ __name((typed, message) => ({
72
+ messageId: message.id,
73
+ ...message.chatId && message.chatId !== typed ? { resultChatId: message.chatId } : {}
74
+ }), "sentIds");
75
+ var current = new AsyncLocalStorage();
76
+ var writesInFlight = new AsyncLocalStorage();
77
+ var parents = /* @__PURE__ */ new WeakMap();
78
+ var stopped = /* @__PURE__ */ new WeakMap();
79
+ var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
80
+ const result = [];
81
+ for (let at = scope; at; at = parents.get(at))
82
+ result.push(at);
83
+ return result;
84
+ }, "scopesFor");
85
+ var withWriteScope = /* @__PURE__ */ __name((scope, body) => {
86
+ const parent = writesInFlight.getStore();
87
+ if (parent && parent !== scope)
88
+ parents.set(scope, parent);
89
+ return writesInFlight.run(scope, body);
90
+ }, "withWriteScope");
91
+ var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
92
+ stopped.set(scope, reason);
93
+ for (const write of scope)
94
+ write.cut();
95
+ }, "stopWrites");
96
+ var refuseStopped = /* @__PURE__ */ __name((scopes) => {
97
+ for (const scope of scopes)
98
+ if (stopped.has(scope))
99
+ throw stopped.get(scope);
100
+ }, "refuseStopped");
101
+ var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
102
+ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled = () => ({}), prepare) => {
103
+ const scopes = scopesFor();
104
+ refuseStopped(scopes);
105
+ try {
106
+ await guard.ask?.(attempt);
107
+ refuseStopped(scopes);
108
+ if (guard.reserve) {
109
+ guard.check(attempt, { reserve: false });
110
+ await guard.reserve(attempt);
111
+ } else
112
+ guard.check(attempt);
113
+ } catch (error) {
114
+ guard.record({ ...attempt, outcome: "refused", errorCode: codeOf(error) });
115
+ throw error;
116
+ }
117
+ try {
118
+ refuseStopped(scopes);
119
+ } catch (error) {
120
+ guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
121
+ throw error;
122
+ }
123
+ let recorded = false;
124
+ const once = /* @__PURE__ */ __name((entry) => {
125
+ if (recorded)
126
+ return;
127
+ recorded = true;
128
+ guard.record(entry);
129
+ }, "once");
130
+ let cancelled = false;
131
+ const flight = {
132
+ operationId: attempt.operationId,
133
+ preparing: prepare !== void 0,
134
+ cut: /* @__PURE__ */ __name(() => {
135
+ cancelled = true;
136
+ once({
137
+ ...attempt,
138
+ outcome: flight.preparing ? "failed" : "outcome_unknown",
139
+ errorCode: flight.preparing ? "timeout" : "outcome_unknown"
140
+ });
141
+ }, "cut")
142
+ };
143
+ for (const scope of scopes)
144
+ scope.add(flight);
145
+ try {
146
+ if (prepare !== void 0)
147
+ await prepare();
148
+ if (cancelled)
149
+ throw new CliError("timeout", "the command ended before sending; nothing was sent", { sent: false });
150
+ flight.preparing = false;
151
+ const done = await current.run(attempt.operationId, act);
152
+ if (cancelled)
153
+ throw new CliError("outcome_unknown", "the command ended with a write in flight; check its result before continuing", { operation_id: attempt.operationId });
154
+ once({ ...attempt, ...settled(done), outcome: "sent" });
155
+ return done;
156
+ } catch (error) {
157
+ const code = codeOf(error);
158
+ once({ ...attempt, outcome: code === "outcome_unknown" ? "outcome_unknown" : "failed", errorCode: code });
159
+ if (code === "outcome_unknown" && error instanceof Error)
160
+ throw new CliError("outcome_unknown", error.message, {
161
+ ...error.details,
162
+ operation_id: attempt.operationId,
163
+ retryable: false
164
+ });
165
+ if (flight.preparing && isCliError(error) && error.details.sent === void 0)
166
+ throw new CliError(error.code, error.message, { ...error.details, sent: false });
167
+ throw error;
168
+ } finally {
169
+ for (const scope of scopes)
170
+ scope.delete(flight);
171
+ }
172
+ }, "guardedWrite");
173
+ var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
174
+
175
+ export {
176
+ sentIds,
177
+ withWriteScope,
178
+ stopWrites,
179
+ currentOperation,
180
+ guardedWrite,
181
+ codeOf,
182
+ IMAGE_MODELS,
183
+ DEFAULT_IMAGE_MODEL,
184
+ imageModel,
185
+ imageModelsDirectory,
186
+ placedImage,
187
+ isImageModelInstalled
188
+ };
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  PRAGMAS
5
- } from "./chunk-4HWJOU7N.js";
5
+ } from "./chunk-7YPZPJTB.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-4QNW4NK6.js";
8
+ } from "./chunk-IBQZT2YD.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/store/sqlite-warning.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite-warning.js
14
14
  var SQLITE_WARNING = "SQLite is an experimental feature";
15
15
  var quieted = /* @__PURE__ */ new WeakSet();
16
16
  var quietSqliteWarning = /* @__PURE__ */ __name((host = process) => {
@@ -31,7 +31,7 @@ var isSqliteWarning = /* @__PURE__ */ __name((warning, options) => {
31
31
  return name === "ExperimentalWarning" && message.startsWith(SQLITE_WARNING);
32
32
  }, "isSqliteWarning");
33
33
 
34
- // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/store/open.js
34
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/open.js
35
35
  var openCache = /* @__PURE__ */ __name(async (path) => {
36
36
  const database = await openFile(path);
37
37
  try {
@@ -44,12 +44,12 @@ var openCache = /* @__PURE__ */ __name(async (path) => {
44
44
  }, "openCache");
45
45
  var openFile = /* @__PURE__ */ __name((path) => "Bun" in globalThis ? openUnderBun(path) : openUnderNode(path), "openFile");
46
46
  var openUnderBun = /* @__PURE__ */ __name(async (path) => {
47
- const { openWithBunSqlite } = await import("./bun-sqlite-PYMKLBRU.js");
47
+ const { openWithBunSqlite } = await import("./bun-sqlite-KSKWRLLO.js");
48
48
  return await openWithBunSqlite(path);
49
49
  }, "openUnderBun");
50
50
  var openUnderNode = /* @__PURE__ */ __name(async (path) => {
51
51
  quietSqliteWarning();
52
- const { openWithNodeSqlite } = await import("./node-sqlite-OLQMAYB4.js");
52
+ const { openWithNodeSqlite } = await import("./node-sqlite-KDFQDYVZ.js");
53
53
  return openWithNodeSqlite(path);
54
54
  }, "openUnderNode");
55
55
  var runtime = /* @__PURE__ */ __name(() => {
@@ -0,0 +1,250 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ EmptyAnswer,
5
+ checkedOptions,
6
+ messagesFor,
7
+ range,
8
+ systemFor,
9
+ validateImages
10
+ } from "./chunk-UT64BBEP.js";
11
+ import {
12
+ refuseOffComputer
13
+ } from "./chunk-QB7K6PIP.js";
14
+ import {
15
+ envName
16
+ } from "./chunk-5BHP4FVM.js";
17
+ import {
18
+ PLAIN_HTTP_REFUSED,
19
+ endpoint,
20
+ endpointFetch,
21
+ modelAddressAllowed,
22
+ onThisComputer
23
+ } from "./chunk-6KND2DYT.js";
24
+ import {
25
+ Credentials,
26
+ pathsAreOverridden,
27
+ resolvePaths
28
+ } from "./chunk-3ZGWJYSG.js";
29
+ import {
30
+ array,
31
+ integer,
32
+ number,
33
+ optional,
34
+ picklist,
35
+ pipe,
36
+ strictObject,
37
+ string,
38
+ union
39
+ } from "./chunk-OBDPKDGB.js";
40
+ import {
41
+ CliError
42
+ } from "./chunk-IBQZT2YD.js";
43
+ import {
44
+ __name
45
+ } from "./chunk-ZVVMGPBJ.js";
46
+
47
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/http/time-limit.js
48
+ var timeLimit = /* @__PURE__ */ __name((ms) => {
49
+ const controller = new AbortController();
50
+ const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
51
+ timer.unref();
52
+ return { signal: controller.signal, clear: /* @__PURE__ */ __name(() => clearTimeout(timer), "clear") };
53
+ }, "timeLimit");
54
+ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run) => {
55
+ const limit = timeLimit(ms);
56
+ try {
57
+ return await run(limit.signal);
58
+ } finally {
59
+ limit.clear();
60
+ }
61
+ }, "withTimeLimit");
62
+
63
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/models/openai.js
64
+ var options = strictObject({
65
+ temperature: range(0, 2),
66
+ top_p: range(0, 1),
67
+ presence_penalty: range(-2, 2),
68
+ frequency_penalty: range(-2, 2),
69
+ seed: optional(pipe(number(), integer())),
70
+ stop: optional(union([string(), array(string())])),
71
+ response_format: optional(strictObject({ type: picklist(["text", "json_object"]) }))
72
+ });
73
+ var openai = {
74
+ images: true,
75
+ baseUrl: "https://api.openai.com/v1",
76
+ validate: /* @__PURE__ */ __name((given) => checkedOptions("openai", options, given), "validate"),
77
+ complete: /* @__PURE__ */ __name((target, request, checked, apiKey, fetcher) => withTimeLimit(12e4, async (deadline) => {
78
+ const response = await fetcher(`${target.baseUrl.replace(/\/+$/, "")}/chat/completions`, {
79
+ method: "POST",
80
+ headers: { "Content-Type": "application/json", ...apiKey ? { Authorization: `Bearer ${apiKey}` } : {} },
81
+ body: JSON.stringify({
82
+ ...checked,
83
+ model: target.model,
84
+ messages: [
85
+ { role: "system", content: systemFor(request) },
86
+ ...messagesFor(request),
87
+ ...request.images === void 0 ? [] : [
88
+ {
89
+ role: "user",
90
+ content: [
91
+ { type: "text", text: request.prompt },
92
+ ...request.images.map((image) => ({
93
+ type: "image_url",
94
+ image_url: { url: `data:${image.mimeType};base64,${image.data}`, detail: "high" }
95
+ }))
96
+ ]
97
+ }
98
+ ]
99
+ ],
100
+ ...new URL(target.baseUrl).hostname === "api.openai.com" ? { max_completion_tokens: request.maxTokens } : { max_tokens: request.maxTokens }
101
+ }),
102
+ signal: deadline,
103
+ redirect: "error"
104
+ });
105
+ if (!response.ok)
106
+ throw new Error("provider rejected request");
107
+ const body = await response.json();
108
+ const choice = body.choices?.[0];
109
+ const content = choice?.message?.content;
110
+ const total = body.usage?.total_tokens;
111
+ const counted = Number.isInteger(total) && (total ?? 0) >= 1;
112
+ const local = onThisComputer(target.baseUrl);
113
+ const finish = choice?.finish_reason ?? null;
114
+ if (finish !== "stop" && !(local && finish === null))
115
+ throw new Error("incomplete response");
116
+ if (typeof content !== "string" || content.trim() === "")
117
+ throw new EmptyAnswer();
118
+ if (!counted && !local)
119
+ throw new Error("incomplete response");
120
+ const { prompt_tokens: input, completion_tokens: output } = body.usage ?? {};
121
+ return {
122
+ text: content,
123
+ // No count from a server on this computer costs nothing; a rough one keeps the gateway's check meaningful.
124
+ tokens: counted ? total : Math.max(1, Math.ceil(content.length / 4)),
125
+ ...Number.isInteger(input) && Number.isInteger(output) ? { usage: { input, output } } : {}
126
+ };
127
+ }), "complete")
128
+ };
129
+
130
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/models/index.js
131
+ var modelGateway = /* @__PURE__ */ __name((deps) => ({
132
+ complete: /* @__PURE__ */ __name(async (request) => {
133
+ if (deps.signal?.aborted)
134
+ throw new CliError("cancelled", "model request cancelled");
135
+ const target = deps.resolve(request.purpose);
136
+ if (!target || target.provider === "off")
137
+ throw new CliError("configuration_error", `models.${request.purpose}.provider is not configured; no model was called`);
138
+ if (!request.purpose || !Number.isSafeInteger(request.maxTokens) || request.maxTokens < 1 || typeof request.prompt !== "string")
139
+ throw new CliError("validation_error", "a model request needs a purpose, prompt and positive whole maxTokens");
140
+ validateImages(request.images);
141
+ let adapter = deps.adapters?.[target.provider];
142
+ if (!adapter && target.provider === "openai")
143
+ adapter = openai;
144
+ if (!adapter && target.provider === "anthropic")
145
+ adapter = (await import("./anthropic-PUOTKSYV.js")).anthropic;
146
+ if (!adapter)
147
+ throw new CliError("validation_error", `no model adapter for ${target.provider}`);
148
+ if (request.images !== void 0 && adapter.images !== true)
149
+ throw new CliError("validation_error", "the model adapter does not support image inputs");
150
+ const options2 = adapter.validate(request.options ?? {});
151
+ const baseUrl = target.baseUrl ?? adapter.baseUrl;
152
+ if (!target.model.trim() || !endpoint(baseUrl))
153
+ throw new CliError("validation_error", "a model target needs a model and an HTTP/S endpoint without credentials, query or fragment");
154
+ if (!modelAddressAllowed(baseUrl))
155
+ throw new CliError("validation_error", `${PLAIN_HTTP_REFUSED}; no data was sent`, {
156
+ reason: "model.address-refused"
157
+ });
158
+ refuseOffComputer(deps.env ?? process.env, baseUrl, `${request.purpose} data`);
159
+ if (!await deps.consent(request, { ...target, baseUrl }))
160
+ throw new CliError("permission_error", `model consent for ${request.purpose} is missing; no data was sent`);
161
+ const apiKey = await deps.key?.(target.provider, target);
162
+ if (deps.signal?.aborted)
163
+ throw new CliError("cancelled", "model request cancelled");
164
+ const fetcher = deps.fetch ?? endpointFetch(baseUrl, 12e4);
165
+ let limited = false;
166
+ let unreachable = false;
167
+ let refused = false;
168
+ let status;
169
+ const cancellable = /* @__PURE__ */ __name(async (input, init) => {
170
+ const signal = init?.signal ?? (input instanceof Request ? input.signal : void 0);
171
+ let response;
172
+ try {
173
+ response = await fetcher(input, {
174
+ ...init,
175
+ signal: deps.signal ? AbortSignal.any([deps.signal, ...signal ? [signal] : []]) : signal
176
+ });
177
+ } catch (error) {
178
+ unreachable = true;
179
+ throw error;
180
+ }
181
+ if (!response.ok)
182
+ status = response.status;
183
+ if (response.status === 429)
184
+ limited = true;
185
+ if (response.status === 401 || response.status === 403)
186
+ refused = true;
187
+ return response;
188
+ }, "cancellable");
189
+ try {
190
+ const answer = await adapter.complete({ ...target, baseUrl }, request, options2, apiKey, cancellable);
191
+ if (deps.signal?.aborted)
192
+ throw new Error("cancelled");
193
+ if (typeof answer.text !== "string" || !Number.isSafeInteger(answer.tokens) || answer.tokens < 1)
194
+ throw new Error("incomplete");
195
+ return { ...answer, provider: target.provider, model: target.model };
196
+ } catch (error) {
197
+ if (limited)
198
+ throw new CliError("rate_limited", `${request.purpose} provider rate limit reached; no result was stored`);
199
+ const reason = refused ? "model.key-rejected" : unreachable && !deps.signal?.aborted ? "model.unreachable" : error instanceof EmptyAnswer ? "model.empty-answer" : void 0;
200
+ throw new CliError("invalid_response", `${request.purpose} provider failed or returned an incomplete response; no result was stored`, reason === void 0 && status === void 0 ? void 0 : { ...reason === void 0 ? {} : { reason }, ...status === void 0 ? {} : { status } });
201
+ }
202
+ }, "complete")
203
+ }), "modelGateway");
204
+
205
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
206
+ var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
207
+ const host = new URL(baseUrl).host;
208
+ return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
209
+ }, "endpointKeyName");
210
+ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) => {
211
+ const where = { appName: app.appName, prefix: app.envPrefix, env };
212
+ const credentials = /* @__PURE__ */ __name((provider) => new Credentials({
213
+ configDir: resolvePaths(where).config,
214
+ service: app.appName,
215
+ ...["openai", "anthropic"].includes(provider) ? { envVar: envName(app, `${provider.toUpperCase()}_API_KEY`) } : {},
216
+ isolated: pathsAreOverridden(where),
217
+ env,
218
+ ...keyring ? { keyring } : {},
219
+ warn: /* @__PURE__ */ __name((message) => process.stderr.write(`${message}
220
+ `), "warn")
221
+ }), "credentials");
222
+ const account = /* @__PURE__ */ __name((provider) => `embeddings:${provider}`, "account");
223
+ return {
224
+ read: /* @__PURE__ */ __name((provider) => {
225
+ const stored = credentials(provider).read(account(provider));
226
+ if (stored)
227
+ return { key: stored.secret, source: stored.source };
228
+ const shared = ["openai", "anthropic"].includes(provider) ? env[`${provider.toUpperCase()}_API_KEY`]?.trim() : void 0;
229
+ return shared ? { key: shared, source: "env" } : void 0;
230
+ }, "read"),
231
+ /** A key kept under the provider's own name, as an owner may have stored it by hand for the whole tool. */
232
+ readPlain: /* @__PURE__ */ __name((provider) => credentials(provider).read(provider)?.secret, "readPlain"),
233
+ write: /* @__PURE__ */ __name((provider, key) => credentials(provider).write(account(provider), key, { signIn: true }), "write"),
234
+ remove: /* @__PURE__ */ __name((provider) => credentials(provider).remove(account(provider)), "remove")
235
+ };
236
+ }, "embeddingKeys");
237
+
238
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/recovery.js
239
+ var withRecovery = /* @__PURE__ */ __name((error) => ({
240
+ ...error,
241
+ retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
242
+ }), "withRecovery");
243
+
244
+ export {
245
+ withTimeLimit,
246
+ modelGateway,
247
+ endpointKeyName,
248
+ embeddingKeys,
249
+ withRecovery
250
+ };