clikcode 1.0.4 → 1.0.5

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 (323) hide show
  1. package/README.md +25 -14
  2. package/dist/chunk-23TDEBGZ.js +71 -0
  3. package/dist/chunk-25T3GVS7.js +425 -0
  4. package/dist/chunk-2BBELGHY.js +11 -0
  5. package/dist/chunk-2EOL5PZL.js +208 -0
  6. package/dist/chunk-2GAB36IE.js +26 -0
  7. package/dist/chunk-2OLS7V66.js +2440 -0
  8. package/dist/chunk-2QFO2URB.js +179 -0
  9. package/dist/chunk-2QWPQRSU.js +254 -0
  10. package/dist/chunk-2YPAPAR3.js +184 -0
  11. package/dist/chunk-2ZAG5372.js +33 -0
  12. package/dist/chunk-32IKAIZC.js +12507 -0
  13. package/dist/chunk-34AZEGYW.js +95 -0
  14. package/dist/chunk-34JQYQCA.js +175 -0
  15. package/dist/chunk-34ZISPAO.js +67 -0
  16. package/dist/chunk-3AAAARE6.js +46 -0
  17. package/dist/chunk-3AJ6Q3OY.js +510 -0
  18. package/dist/chunk-3B2CHX7M.js +884 -0
  19. package/dist/chunk-3BUFORRX.js +59 -0
  20. package/dist/chunk-3QLHYYFK.js +30 -0
  21. package/dist/chunk-3RXBMYKZ.js +140 -0
  22. package/dist/chunk-3TFNIJWS.js +52 -0
  23. package/dist/chunk-3W3IPDFP.js +119 -0
  24. package/dist/chunk-3WMS7SEE.js +417 -0
  25. package/dist/chunk-435ZNSZ3.js +23 -0
  26. package/dist/chunk-4AQ5NINV.js +39 -0
  27. package/dist/chunk-4GVEJ5FK.js +168 -0
  28. package/dist/chunk-4GXAO3UY.js +262 -0
  29. package/dist/chunk-4L2ZZM4Q.js +332 -0
  30. package/dist/chunk-4LPDG57B.js +17 -0
  31. package/dist/chunk-4NN3XQQT.js +223 -0
  32. package/dist/chunk-4QZEZME7.js +54 -0
  33. package/dist/chunk-4R6CSC3S.js +38 -0
  34. package/dist/chunk-4RHXTL3W.js +514 -0
  35. package/dist/chunk-4SJMPTVQ.js +18 -0
  36. package/dist/chunk-4VY7G6TX.js +114 -0
  37. package/dist/chunk-5642PBF7.js +124 -0
  38. package/dist/chunk-5B6TVO4A.js +33 -0
  39. package/dist/chunk-5BJLDUPL.js +62 -0
  40. package/dist/chunk-5HMFFJWU.js +19 -0
  41. package/dist/chunk-5IKLK33T.js +69 -0
  42. package/dist/chunk-5NQ5FFMX.js +44 -0
  43. package/dist/chunk-5QNNW5L6.js +176 -0
  44. package/dist/chunk-5SM5UAWN.js +239 -0
  45. package/dist/chunk-5WYJTA6O.js +74 -0
  46. package/dist/chunk-5ZSR2Y5T.js +227 -0
  47. package/dist/chunk-5ZWUM5GH.js +39 -0
  48. package/dist/chunk-64E7D4HY.js +364 -0
  49. package/dist/chunk-6CK466BC.js +99 -0
  50. package/dist/chunk-6ES45HHO.js +138 -0
  51. package/dist/chunk-6HYEZFGL.js +277 -0
  52. package/dist/chunk-6Y7HLXGW.js +29 -0
  53. package/dist/chunk-6YKK4FYR.js +258 -0
  54. package/dist/chunk-74WNMLMS.js +117 -0
  55. package/dist/chunk-7AULZ7OD.js +55 -0
  56. package/dist/chunk-7DOKGSUN.js +101 -0
  57. package/dist/chunk-7IH5LTIZ.js +195 -0
  58. package/dist/chunk-7ISTS5NS.js +21 -0
  59. package/dist/chunk-7NMUTGOW.js +527 -0
  60. package/dist/chunk-7PNHUZEL.js +153 -0
  61. package/dist/chunk-7TSQLONI.js +88 -0
  62. package/dist/chunk-AE7TOLD5.js +30 -0
  63. package/dist/chunk-AEMHSXKA.js +130 -0
  64. package/dist/chunk-AKRYTS2D.js +211 -0
  65. package/dist/chunk-AMNSE36L.js +59 -0
  66. package/dist/chunk-AZVD74ZV.js +23 -0
  67. package/dist/chunk-B35DVOTK.js +1981 -0
  68. package/dist/chunk-B4HNJRAH.js +626 -0
  69. package/dist/chunk-B5WYPPHS.js +13 -0
  70. package/dist/chunk-BBOVDXQM.js +59 -0
  71. package/dist/chunk-BD3ECZLK.js +62 -0
  72. package/dist/chunk-BDGSOT74.js +4578 -0
  73. package/dist/chunk-BF5VEOPK.js +31 -0
  74. package/dist/chunk-BFFRW4XH.js +47 -0
  75. package/dist/chunk-BFPC6PEW.js +208 -0
  76. package/dist/chunk-BGEMY2JJ.js +376 -0
  77. package/dist/chunk-BISGNHKD.js +35 -0
  78. package/dist/chunk-BMRAEBRY.js +21 -0
  79. package/dist/chunk-BNTXAZXW.js +127 -0
  80. package/dist/chunk-BOQBXGSN.js +75 -0
  81. package/dist/chunk-BTJDSTQP.js +213 -0
  82. package/dist/chunk-BUOPJQP5.js +218 -0
  83. package/dist/chunk-BXFJS65Q.js +52 -0
  84. package/dist/chunk-BXPQFSX5.js +59 -0
  85. package/dist/chunk-C57LIWNY.js +1269 -0
  86. package/dist/chunk-C6YVCCWR.js +74 -0
  87. package/dist/chunk-CAADDF6M.js +167 -0
  88. package/dist/chunk-CBANJFBO.js +69 -0
  89. package/dist/chunk-CERF3RIB.js +597 -0
  90. package/dist/chunk-COAS5ETR.js +46 -0
  91. package/dist/chunk-CQ7J6UQ7.js +78 -0
  92. package/dist/chunk-CRUVYGO2.js +26 -0
  93. package/dist/chunk-CVFVFRGN.js +58 -0
  94. package/dist/chunk-D2UK66HM.js +37 -0
  95. package/dist/chunk-D2W7SA4R.js +18 -0
  96. package/dist/chunk-DA44ZENT.js +501 -0
  97. package/dist/chunk-DAJ76TOC.js +99 -0
  98. package/dist/chunk-DCZ6CIUM.js +147 -0
  99. package/dist/chunk-DF35KMXM.js +1314 -0
  100. package/dist/chunk-DGASQT26.js +151 -0
  101. package/dist/chunk-DJT57C5P.js +55 -0
  102. package/dist/chunk-DKDPZTD3.js +44 -0
  103. package/dist/chunk-DQYVQ2N7.js +77 -0
  104. package/dist/chunk-DRTP2RTY.js +266 -0
  105. package/dist/chunk-DW2BMUKY.js +61 -0
  106. package/dist/chunk-DW5T5ZVU.js +307 -0
  107. package/dist/chunk-DXKNDNFC.js +164 -0
  108. package/dist/chunk-DZEQ7UYR.js +291 -0
  109. package/dist/chunk-E4F4OUAC.js +463 -0
  110. package/dist/chunk-EE4B6A7W.js +69 -0
  111. package/dist/chunk-EISKIYWG.js +23 -0
  112. package/dist/chunk-EKAQK7UQ.js +235 -0
  113. package/dist/chunk-EOBTJV32.js +123 -0
  114. package/dist/chunk-ESF3DIZY.js +325 -0
  115. package/dist/chunk-EVOHOZ4U.js +45 -0
  116. package/dist/chunk-EXN4KHLB.js +110 -0
  117. package/dist/chunk-F252T6Y3.js +78 -0
  118. package/dist/chunk-F3DP4ZA2.js +40 -0
  119. package/dist/chunk-F6F47QAY.js +58 -0
  120. package/dist/chunk-FA3Y23ZW.js +57 -0
  121. package/dist/chunk-FBKXE4EJ.js +640 -0
  122. package/dist/chunk-FCGEB3H6.js +23 -0
  123. package/dist/chunk-FF7ZVYJF.js +3732 -0
  124. package/dist/chunk-FFGKN6L3.js +39 -0
  125. package/dist/chunk-FFGU4GCC.js +94 -0
  126. package/dist/chunk-FSFDAOVP.js +74 -0
  127. package/dist/chunk-FT5TX7OX.js +1573 -0
  128. package/dist/chunk-G3QP67Z7.js +232 -0
  129. package/dist/chunk-G5ORJKV2.js +179 -0
  130. package/dist/chunk-GFNC62PE.js +111 -0
  131. package/dist/chunk-GGK43Q3N.js +67 -0
  132. package/dist/chunk-GGYKY4GF.js +11537 -0
  133. package/dist/chunk-GGYNHGNJ.js +55 -0
  134. package/dist/chunk-GLY7RM3C.js +354 -0
  135. package/dist/chunk-GQBZU6EO.js +20 -0
  136. package/dist/chunk-GSXENUZL.js +9 -0
  137. package/dist/chunk-GTOAT5D3.js +40 -0
  138. package/dist/chunk-GWCMDPQU.js +1007 -0
  139. package/dist/chunk-GXYSMYHJ.js +152 -0
  140. package/dist/chunk-GYMAI5NY.js +14 -0
  141. package/dist/chunk-H2VZMKPE.js +30 -0
  142. package/dist/chunk-H4THUNBM.js +2091 -0
  143. package/dist/chunk-HGRVSNUZ.js +361 -0
  144. package/dist/chunk-HI4VY473.js +27 -0
  145. package/dist/chunk-HOJRSD3Q.js +447 -0
  146. package/dist/chunk-HRX25W35.js +82 -0
  147. package/dist/chunk-HSE4AQYV.js +55 -0
  148. package/dist/chunk-HU5SSUFX.js +383 -0
  149. package/dist/chunk-I3GDBJLH.js +196 -0
  150. package/dist/chunk-I75EDU75.js +684 -0
  151. package/dist/chunk-IBA7DMIO.js +20 -0
  152. package/dist/chunk-IC6N4NZA.js +231 -0
  153. package/dist/chunk-IF43HIGV.js +284 -0
  154. package/dist/chunk-IGZ6C2MC.js +439 -0
  155. package/dist/chunk-IMLTL2MY.js +192 -0
  156. package/dist/chunk-IMZL6SGR.js +33 -0
  157. package/dist/chunk-IS4USJPY.js +516 -0
  158. package/dist/chunk-ISFSPN2F.js +82 -0
  159. package/dist/chunk-IXE7GTFI.js +55 -0
  160. package/dist/chunk-IZ77QJQG.js +36 -0
  161. package/dist/chunk-J2PACWRQ.js +34 -0
  162. package/dist/chunk-J6EGFVQX.js +180 -0
  163. package/dist/chunk-JEKOD43D.js +22 -0
  164. package/dist/chunk-JGIWATSG.js +30 -0
  165. package/dist/chunk-JYBONKD4.js +43 -0
  166. package/dist/chunk-K2NLG2HK.js +454 -0
  167. package/dist/chunk-KCQ4TBLS.js +164 -0
  168. package/dist/chunk-KD5KIVMS.js +176 -0
  169. package/dist/chunk-KHW6TX6I.js +63 -0
  170. package/dist/chunk-KI5GZFCE.js +520 -0
  171. package/dist/chunk-KN34B7NO.js +105 -0
  172. package/dist/chunk-KYUHIFP3.js +136 -0
  173. package/dist/chunk-KZL5VS4B.js +300 -0
  174. package/dist/chunk-L3VW3QIH.js +48 -0
  175. package/dist/chunk-LA6MG4ET.js +2110 -0
  176. package/dist/chunk-LAVFOA3S.js +66 -0
  177. package/dist/chunk-LB4OA77N.js +13 -0
  178. package/dist/chunk-LBFRF2K4.js +196 -0
  179. package/dist/chunk-LM6EIA4B.js +93 -0
  180. package/dist/chunk-LPCNRGJ7.js +692 -0
  181. package/dist/chunk-LSLNL5T3.js +168 -0
  182. package/dist/chunk-LVRRWP4W.js +568 -0
  183. package/dist/chunk-LWCFBRHL.js +33 -0
  184. package/dist/chunk-LXFTMGZZ.js +166 -0
  185. package/dist/chunk-M33LVA4M.js +151 -0
  186. package/dist/chunk-M3FO5UMK.js +4944 -0
  187. package/dist/chunk-M5QNDBAY.js +66 -0
  188. package/dist/chunk-M6ND6KBE.js +1291 -0
  189. package/dist/chunk-M7H3WQTE.js +76 -0
  190. package/dist/chunk-MCBRVPA7.js +191 -0
  191. package/dist/chunk-MCSDWZET.js +91 -0
  192. package/dist/chunk-MDT5XDXL.js +289 -0
  193. package/dist/chunk-MJG3IQY4.js +91 -0
  194. package/dist/chunk-MOU3N2UL.js +44 -0
  195. package/dist/chunk-MP4KZOQC.js +3451 -0
  196. package/dist/chunk-MPAJ446F.js +66 -0
  197. package/dist/chunk-MVJZZ6AL.js +16 -0
  198. package/dist/chunk-MXS6S2PY.js +253 -0
  199. package/dist/chunk-N3SFDYM7.js +291 -0
  200. package/dist/chunk-NAOX3JUB.js +13 -0
  201. package/dist/chunk-NEKKIBCX.js +283 -0
  202. package/dist/chunk-NKDATMEM.js +133 -0
  203. package/dist/chunk-NR4FMC4K.js +395 -0
  204. package/dist/chunk-NSOHOJBR.js +221 -0
  205. package/dist/chunk-NTDB6QKF.js +29 -0
  206. package/dist/chunk-NWEYRBWK.js +25 -0
  207. package/dist/chunk-O2YSNYWD.js +23 -0
  208. package/dist/chunk-O3EW7LAY.js +54 -0
  209. package/dist/chunk-O7BNJIXU.js +366 -0
  210. package/dist/chunk-OARL2NXZ.js +116 -0
  211. package/dist/chunk-OHKZUEJW.js +351 -0
  212. package/dist/chunk-OKU45BXA.js +647 -0
  213. package/dist/chunk-OL4JBD3J.js +59 -0
  214. package/dist/chunk-OLUO5DDR.js +192 -0
  215. package/dist/chunk-OQ245JLA.js +196 -0
  216. package/dist/chunk-P72UZAQI.js +289 -0
  217. package/dist/chunk-PAL2ENB6.js +20 -0
  218. package/dist/chunk-PAXYQZH7.js +53 -0
  219. package/dist/chunk-PDPEM5VW.js +51 -0
  220. package/dist/chunk-PEWCDI2C.js +668 -0
  221. package/dist/chunk-PGZ54EDX.js +27 -0
  222. package/dist/chunk-PRWVLDZF.js +73 -0
  223. package/dist/chunk-PSQQ75VJ.js +52 -0
  224. package/dist/chunk-PUOVIFHW.js +118 -0
  225. package/dist/chunk-PWBF2X3V.js +107 -0
  226. package/dist/chunk-PWXII6HF.js +43 -0
  227. package/dist/chunk-Q35VLJRT.js +80 -0
  228. package/dist/chunk-QJP7EYGL.js +128 -0
  229. package/dist/chunk-QPQKX2MK.js +8836 -0
  230. package/dist/chunk-QQRLPY25.js +1053 -0
  231. package/dist/chunk-QUS4ER2W.js +407 -0
  232. package/dist/chunk-QYHI3YET.js +29 -0
  233. package/dist/chunk-QYRU2UQI.js +32 -0
  234. package/dist/chunk-R6XVVQGC.js +13 -0
  235. package/dist/chunk-R7QN6ONS.js +483 -0
  236. package/dist/chunk-RD23MPGC.js +221 -0
  237. package/dist/chunk-RDDWQBEM.js +185 -0
  238. package/dist/chunk-RDLLDYFO.js +104 -0
  239. package/dist/chunk-RE4TGORR.js +84 -0
  240. package/dist/chunk-RJLHVYQY.js +217 -0
  241. package/dist/chunk-RJLPTWHW.js +905 -0
  242. package/dist/chunk-RKUVLRZI.js +295 -0
  243. package/dist/chunk-ROGXPGYR.js +37 -0
  244. package/dist/chunk-RSZGEL5U.js +163 -0
  245. package/dist/chunk-RVUOIJXN.js +909 -0
  246. package/dist/chunk-RW7F4JRP.js +11 -0
  247. package/dist/chunk-S4UO3AO3.js +53 -0
  248. package/dist/chunk-S5JAAF6S.js +585 -0
  249. package/dist/chunk-SNU37TQI.js +56 -0
  250. package/dist/chunk-SQVUDO2O.js +31 -0
  251. package/dist/chunk-SYVHIYQT.js +66 -0
  252. package/dist/chunk-SZBQMTG2.js +85 -0
  253. package/dist/chunk-T5VCXA3J.js +25 -0
  254. package/dist/chunk-TK6NSP56.js +30 -0
  255. package/dist/chunk-TKWVMA6L.js +22 -0
  256. package/dist/chunk-TQDKJHWX.js +59 -0
  257. package/dist/chunk-TQDM7S5N.js +127 -0
  258. package/dist/chunk-TULAXS77.js +23 -0
  259. package/dist/chunk-TVT45XNH.js +4625 -0
  260. package/dist/chunk-TWCVV2JO.js +467 -0
  261. package/dist/chunk-U4DKAD6S.js +47 -0
  262. package/dist/chunk-UA5K2BTI.js +564 -0
  263. package/dist/chunk-UAMKCMOK.js +40 -0
  264. package/dist/chunk-UBMVADBF.js +51 -0
  265. package/dist/chunk-UFQ5A5PW.js +645 -0
  266. package/dist/chunk-UOD2SOLL.js +1301 -0
  267. package/dist/chunk-UTSB4LOW.js +156 -0
  268. package/dist/chunk-UVXNIUTN.js +412 -0
  269. package/dist/chunk-UXVPXYPE.js +90 -0
  270. package/dist/chunk-UYEEMIWR.js +374 -0
  271. package/dist/chunk-VBGM5ZBW.js +54 -0
  272. package/dist/chunk-VEWPCZPG.js +762 -0
  273. package/dist/chunk-VIRDLZ5E.js +108 -0
  274. package/dist/chunk-VMPO7WKN.js +52 -0
  275. package/dist/chunk-W2NVSDO5.js +5122 -0
  276. package/dist/chunk-W3YYPBEA.js +176 -0
  277. package/dist/chunk-W5AYOICN.js +280 -0
  278. package/dist/chunk-W5GZOIUF.js +27 -0
  279. package/dist/chunk-WHKNLZ3C.js +76 -0
  280. package/dist/chunk-WKBEPPQ5.js +1409 -0
  281. package/dist/chunk-WM3Z6QKQ.js +151 -0
  282. package/dist/chunk-WMI2TPMA.js +31 -0
  283. package/dist/chunk-WNX5VD7S.js +150 -0
  284. package/dist/chunk-WOVTYST3.js +60 -0
  285. package/dist/chunk-WPB5WEZJ.js +546 -0
  286. package/dist/chunk-WUO5EOAT.js +44 -0
  287. package/dist/chunk-WWLJMP6D.js +133 -0
  288. package/dist/chunk-WZMLH3XP.js +58 -0
  289. package/dist/chunk-WZYVLUVQ.js +79 -0
  290. package/dist/chunk-X2OCPVU5.js +135 -0
  291. package/dist/chunk-X3CL6DTR.js +95 -0
  292. package/dist/chunk-X6WF7JEV.js +354 -0
  293. package/dist/chunk-XAHGBPWT.js +44 -0
  294. package/dist/chunk-XCKQ5BM2.js +228 -0
  295. package/dist/chunk-XIBYREEY.js +106 -0
  296. package/dist/chunk-XKW5NDMR.js +378 -0
  297. package/dist/chunk-XRDALAO3.js +100 -0
  298. package/dist/chunk-XUP22EAS.js +41 -0
  299. package/dist/chunk-XWAC3MKW.js +243 -0
  300. package/dist/chunk-Y3R7JMXB.js +59 -0
  301. package/dist/chunk-Y54LTP4W.js +82 -0
  302. package/dist/chunk-Y7UECI4M.js +99 -0
  303. package/dist/chunk-YACGDFHC.js +47 -0
  304. package/dist/chunk-YHNIQPKY.js +71 -0
  305. package/dist/chunk-YMBR6HYP.js +111 -0
  306. package/dist/chunk-YMCH3L2S.js +26 -0
  307. package/dist/chunk-Z4ZU6T7V.js +99 -0
  308. package/dist/chunk-ZDPF67ZZ.js +173 -0
  309. package/dist/chunk-ZFC2Q67K.js +101 -0
  310. package/dist/chunk-ZGHNNSCT.js +114 -0
  311. package/dist/chunk-ZGX3ERAT.js +173 -0
  312. package/dist/chunk-ZI3YHEBY.js +37 -0
  313. package/dist/chunk-ZN7G6JLS.js +639 -0
  314. package/dist/chunk-ZNPFQMXT.js +47 -0
  315. package/dist/chunk-ZOU3LV4U.js +63 -0
  316. package/dist/chunk-ZT7B4H2V.js +117 -0
  317. package/dist/chunk-ZZCBDNZI.js +58 -0
  318. package/dist/cli.js +494 -112923
  319. package/dist/computer-tools.js +36642 -21259
  320. package/dist/harness-catalog.cjs +88 -43
  321. package/dist/index.js +1 -1
  322. package/dist/local-model-supervisor.cjs +555 -0
  323. package/package.json +3 -4
@@ -0,0 +1,11 @@
1
+ import { createRequire as __clikcodeCreateRequire } from 'node:module';
2
+ const require = __clikcodeCreateRequire(import.meta.url);
3
+
4
+ // src/worker/build-retire.ts
5
+ var BUILD_WATCH_MS = Number(process.env.CLIKCODE_WORKER_BUILD_WATCH_MS) > 0 ? Number(process.env.CLIKCODE_WORKER_BUILD_WATCH_MS) : 15e3;
6
+ var RETIRE_QUIET_MS = Number(process.env.CLIKCODE_WORKER_RETIRE_QUIET_MS) >= 0 && process.env.CLIKCODE_WORKER_RETIRE_QUIET_MS ? Number(process.env.CLIKCODE_WORKER_RETIRE_QUIET_MS) : 3e4;
7
+
8
+ export {
9
+ BUILD_WATCH_MS,
10
+ RETIRE_QUIET_MS
11
+ };
@@ -0,0 +1,53 @@
1
+ import { createRequire as __clikcodeCreateRequire } from 'node:module';
2
+ const require = __clikcodeCreateRequire(import.meta.url);
3
+ import {
4
+ GOOSE_DRIVEN_HARNESSES,
5
+ discoverGooseProviders,
6
+ gooseConnect,
7
+ gooseModelsDevModels,
8
+ gooseProviders,
9
+ modelsDevCache,
10
+ modelsDevFiles,
11
+ modelsDevProvider,
12
+ providerKeyNames
13
+ } from "./chunk-QJP7EYGL.js";
14
+ import "./chunk-ESF3DIZY.js";
15
+ import "./chunk-R7QN6ONS.js";
16
+ import "./chunk-DQYVQ2N7.js";
17
+ import "./chunk-KYUHIFP3.js";
18
+ import "./chunk-RSZGEL5U.js";
19
+ import "./chunk-DF35KMXM.js";
20
+ import "./chunk-ZT7B4H2V.js";
21
+ import "./chunk-OL4JBD3J.js";
22
+ import "./chunk-IGZ6C2MC.js";
23
+ import "./chunk-4NN3XQQT.js";
24
+ import "./chunk-4AQ5NINV.js";
25
+ import "./chunk-WPB5WEZJ.js";
26
+ import "./chunk-GYMAI5NY.js";
27
+ import "./chunk-CQ7J6UQ7.js";
28
+ import "./chunk-XKW5NDMR.js";
29
+ import "./chunk-W3YYPBEA.js";
30
+ import "./chunk-XIBYREEY.js";
31
+ import "./chunk-EE4B6A7W.js";
32
+ import "./chunk-WZYVLUVQ.js";
33
+ import "./chunk-O3EW7LAY.js";
34
+ import "./chunk-KHW6TX6I.js";
35
+ import "./chunk-YMCH3L2S.js";
36
+ import "./chunk-G3QP67Z7.js";
37
+ import "./chunk-4L2ZZM4Q.js";
38
+ import "./chunk-F6F47QAY.js";
39
+ import "./chunk-RDDWQBEM.js";
40
+ import "./chunk-MPAJ446F.js";
41
+ import "./chunk-CBANJFBO.js";
42
+ import "./chunk-PWXII6HF.js";
43
+ export {
44
+ GOOSE_DRIVEN_HARNESSES,
45
+ discoverGooseProviders,
46
+ gooseConnect,
47
+ gooseModelsDevModels,
48
+ gooseProviders,
49
+ modelsDevCache,
50
+ modelsDevFiles,
51
+ modelsDevProvider,
52
+ providerKeyNames
53
+ };
@@ -0,0 +1,585 @@
1
+ import { createRequire as __clikcodeCreateRequire } from 'node:module';
2
+ const require = __clikcodeCreateRequire(import.meta.url);
3
+ import {
4
+ withSlowWait
5
+ } from "./chunk-COAS5ETR.js";
6
+ import {
7
+ aiSessionCommand
8
+ } from "./chunk-H4THUNBM.js";
9
+ import {
10
+ providerConversationKey
11
+ } from "./chunk-M7H3WQTE.js";
12
+ import {
13
+ selectProviderConversation
14
+ } from "./chunk-QPQKX2MK.js";
15
+ import {
16
+ chooseOption
17
+ } from "./chunk-ROGXPGYR.js";
18
+ import {
19
+ GATEWAY_ID
20
+ } from "./chunk-J6EGFVQX.js";
21
+ import {
22
+ gatewayAgents,
23
+ selectGatewayAgent
24
+ } from "./chunk-RJLPTWHW.js";
25
+ import {
26
+ sessionOrProviderHarness
27
+ } from "./chunk-2EOL5PZL.js";
28
+ import {
29
+ loginNativeHarness,
30
+ withSignIn
31
+ } from "./chunk-LA6MG4ET.js";
32
+ import {
33
+ alwaysStartOwnModels,
34
+ setAlwaysStartOwnModels
35
+ } from "./chunk-X3CL6DTR.js";
36
+ import {
37
+ emitHarnessOutput
38
+ } from "./chunk-4RHXTL3W.js";
39
+ import {
40
+ gatewayMakerName,
41
+ gatewayModelDetail,
42
+ gatewayModelLabel,
43
+ gatewayModels,
44
+ gatewayModelsByMaker,
45
+ savedGatewayModels
46
+ } from "./chunk-W5AYOICN.js";
47
+ import {
48
+ gatewayConnection,
49
+ localModelChoices
50
+ } from "./chunk-2OLS7V66.js";
51
+ import {
52
+ discoveryRefresh,
53
+ formatBytes
54
+ } from "./chunk-IS4USJPY.js";
55
+ import {
56
+ gatewaySubscriptionsOn,
57
+ setGatewaySubscriptions
58
+ } from "./chunk-GQBZU6EO.js";
59
+ import {
60
+ harnessModelLabel,
61
+ modelIdFromLabel,
62
+ modelSettingsDetail,
63
+ nativeModelCatalogForPicker
64
+ } from "./chunk-QQRLPY25.js";
65
+ import {
66
+ freePlanModels
67
+ } from "./chunk-DA44ZENT.js";
68
+ import {
69
+ nativeProfileEnvironment
70
+ } from "./chunk-ZGX3ERAT.js";
71
+ import {
72
+ readState
73
+ } from "./chunk-MXS6S2PY.js";
74
+ import {
75
+ isGatewayService
76
+ } from "./chunk-CRUVYGO2.js";
77
+ import {
78
+ modelIdFromDisplay
79
+ } from "./chunk-KYUHIFP3.js";
80
+ import {
81
+ TERMINAL
82
+ } from "./chunk-DF35KMXM.js";
83
+ import {
84
+ CLIKCODE_USER_AGENT
85
+ } from "./chunk-NAOX3JUB.js";
86
+ import {
87
+ Conf
88
+ } from "./chunk-GGYKY4GF.js";
89
+ import {
90
+ diagnostic,
91
+ quiet
92
+ } from "./chunk-RDDWQBEM.js";
93
+
94
+ // src/gateway/private-models.ts
95
+ function quoteSummary(model, quote) {
96
+ const gb = (n) => `${Math.ceil(n)} GB`;
97
+ const model_ = [quote.quant?.label, quote.runtime?.name, quote.vram?.totalGb ? `needs about ${gb(quote.vram.totalGb)} of GPU memory` : void 0].filter(Boolean).join(" \xB7 ");
98
+ const lines = [
99
+ `GPU: ${quote.sku.displayName}`,
100
+ `Price: $${quote.pricePerHour.toFixed(2)} per hour while it runs; nothing once it is stopped`,
101
+ ...model_ ? [`Model: ${model_}`] : [],
102
+ ...quote.throughput?.decodeTokensPerSec ? [`Speed: about ${Math.round(quote.throughput.decodeTokensPerSec)} tokens per second (estimate)`] : [],
103
+ ...quote.servingContext?.tokens ? [`Context: ${quote.servingContext.tokens.toLocaleString("en-US")} tokens`] : [],
104
+ ...(quote.warnings ?? []).map((warning) => `Note: ${warning}`)
105
+ ];
106
+ return { title: `${model.displayName || model.modelId} on ClikDeploy`, body: lines.join("\n") };
107
+ }
108
+ async function request(path, init = {}) {
109
+ const { baseUrl, apiKey } = gatewayConnection(new Conf({ projectName: "clikcode", configFileMode: 384 }));
110
+ const response = await fetch(`${baseUrl}${path}`, {
111
+ method: init.method ?? "GET",
112
+ headers: {
113
+ authorization: `Bearer ${apiKey}`,
114
+ accept: "application/json",
115
+ "user-agent": CLIKCODE_USER_AGENT,
116
+ ...init.body !== void 0 ? { "content-type": "application/json" } : {}
117
+ },
118
+ ...init.body !== void 0 ? { body: JSON.stringify(init.body) } : {},
119
+ signal: init.signal ? AbortSignal.any([init.signal, AbortSignal.timeout(6e4)]) : AbortSignal.timeout(6e4)
120
+ });
121
+ const payload = await response.json().catch(quiet("gateway/private-models"));
122
+ if (!response.ok) {
123
+ const message = typeof payload?.error === "string" ? payload.error : payload?.error?.message ?? payload?.message;
124
+ throw new Error(message || `ClikDeploy model request failed (HTTP ${response.status})`);
125
+ }
126
+ if (!payload || !("data" in payload)) throw new Error("ClikDeploy returned an invalid model response.");
127
+ return payload.data;
128
+ }
129
+ async function searchDeployableModels(query = "") {
130
+ const params = new URLSearchParams({ q: query, source: "huggingface" });
131
+ return request(`/api/models/search?${params}`);
132
+ }
133
+ async function quotePrivateModel(modelId, signal) {
134
+ const params = new URLSearchParams({ source: "huggingface", modelId });
135
+ return request(`/api/models/resolve?${params}`, signal ? { signal } : {});
136
+ }
137
+ async function deployPrivateModel(model, quote) {
138
+ const deployment = await request("/api/models/deployments", {
139
+ method: "POST",
140
+ body: {
141
+ sourceId: model.sourceId,
142
+ modelId: model.modelId,
143
+ ...quote.quant?.label ? { quantLabel: quote.quant.label } : {}
144
+ }
145
+ });
146
+ if (typeof deployment?.id !== "string" || !deployment.id.trim()) {
147
+ throw new Error("ClikDeploy returned a deployment without an ID.");
148
+ }
149
+ return { ...deployment, gatewayModelId: `private-deployment:${deployment.id}` };
150
+ }
151
+
152
+ // src/hosted-models/clikdeploy.ts
153
+ function parameters(count) {
154
+ if (!count) return "";
155
+ if (count >= 1e9) return `${(count / 1e9).toFixed(count >= 1e10 ? 0 : 1).replace(/\.0$/, "")}B params`;
156
+ return `${Math.round(count / 1e6)}M params`;
157
+ }
158
+ function perHour(price) {
159
+ return `$${price < 0.1 ? price.toFixed(3).replace(/0$/, "") : price.toFixed(2)}/hour`;
160
+ }
161
+ var quoted = /* @__PURE__ */ new Map();
162
+ var models = /* @__PURE__ */ new Map();
163
+ var clikdeploy = {
164
+ target: "clikdeploy",
165
+ async list(query) {
166
+ const found = await searchDeployableModels(query.trim());
167
+ const rows = [];
168
+ for (const model of found) {
169
+ if (model.modality && model.modality !== "llm") continue;
170
+ models.set(model.modelId, model);
171
+ rows.push({
172
+ target: "clikdeploy",
173
+ id: model.modelId,
174
+ label: model.modelId,
175
+ detail: [parameters(model.parameterCount), model.gated ? "restricted access" : "", "price shown before it starts"].filter(Boolean).join(" \xB7 "),
176
+ ...model.gated ? { gated: true } : {}
177
+ });
178
+ }
179
+ return rows;
180
+ },
181
+ async plan(row, signal) {
182
+ const model = models.get(row.id) ?? { sourceId: "huggingface", modelId: row.id, displayName: row.label, gated: row.gated === true };
183
+ let quote;
184
+ try {
185
+ quote = await quotePrivateModel(row.id, signal);
186
+ } catch (error) {
187
+ const message = error instanceof Error ? error.message : String(error);
188
+ throw new Error(model.gated ? `${message} Connect Hugging Face in ClikDeploy, then try again.` : message);
189
+ }
190
+ quoted.set(row.id, { quote, model });
191
+ const summary = quoteSummary(model, quote);
192
+ return {
193
+ title: summary.title,
194
+ lines: summary.body.split("\n"),
195
+ confirm: `Start \xB7 ${perHour(quote.pricePerHour)}`,
196
+ costly: true,
197
+ // The price, what it runs on, and the speed as the planner estimates it: what a choice between here and there turns on.
198
+ summary: [perHour(quote.pricePerHour), quote.sku?.displayName, quote.throughput?.decodeTokensPerSec ? `~${Math.round(quote.throughput.decodeTokensPerSec)} tok/s` : ""].filter(Boolean).join(" \xB7 ")
199
+ };
200
+ },
201
+ async start(row) {
202
+ const shown = quoted.get(row.id) ?? { quote: await quotePrivateModel(row.id), model: models.get(row.id) ?? { sourceId: "huggingface", modelId: row.id, displayName: row.label, gated: row.gated === true } };
203
+ quoted.delete(row.id);
204
+ const deployment = await deployPrivateModel(shown.model, shown.quote);
205
+ return { route: "gateway", model: deployment.gatewayModelId, any: true };
206
+ }
207
+ };
208
+
209
+ // src/hosted-models/this-computer.ts
210
+ var thisComputer = {
211
+ target: "this-computer",
212
+ async list(query) {
213
+ const needle = query.trim().toLowerCase();
214
+ const choices = await localModelChoices(needle || void 0);
215
+ return choices.filter((choice) => !needle || `${choice.label} ${choice.id}`.toLowerCase().includes(needle)).map((choice) => ({
216
+ target: "this-computer",
217
+ id: choice.id,
218
+ label: choice.label,
219
+ detail: choice.brief || choice.detail,
220
+ downloadBytes: choice.downloadBytes,
221
+ recommended: choice.recommended,
222
+ repo: choice.repo
223
+ }));
224
+ },
225
+ async plan(row) {
226
+ if (!row.downloadBytes) return { title: row.label, lines: [], confirm: "Use it", costly: false, consent: false, summary: "downloaded \xB7 free, works offline" };
227
+ const size = formatBytes(row.downloadBytes);
228
+ return {
229
+ title: `Download ${row.label} (${size})?`,
230
+ lines: ["Runs on this computer, free and offline. It downloads in the background; this chat moves to it when it is ready."],
231
+ confirm: "Download",
232
+ costly: false,
233
+ consent: true,
234
+ summary: `${size} download \xB7 free after, works offline`
235
+ };
236
+ },
237
+ async start(row) {
238
+ return { route: "clikcode-local", model: row.id, download: true };
239
+ }
240
+ };
241
+
242
+ // src/hosted-models/types.ts
243
+ function hostedSelectionCommand(selection) {
244
+ return `/model ${selection.download ? "--download " : ""}${selection.any ? "--any " : ""}${selection.model}`;
245
+ }
246
+
247
+ // src/hosted-models/index.ts
248
+ var HOSTED_ADAPTERS = [thisComputer, clikdeploy];
249
+ var TARGET_WORDS = {
250
+ local: "this-computer",
251
+ offline: "this-computer",
252
+ computer: "this-computer",
253
+ here: "this-computer",
254
+ cloud: "clikdeploy",
255
+ gpu: "clikdeploy",
256
+ clikdeploy: "clikdeploy",
257
+ hosted: "clikdeploy"
258
+ };
259
+ function parseHostedQuery(query) {
260
+ const targets = /* @__PURE__ */ new Set();
261
+ const rest = [];
262
+ for (const word of query.trim().split(/\s+/).filter(Boolean)) {
263
+ const target = TARGET_WORDS[word.toLowerCase()];
264
+ if (target) targets.add(target);
265
+ else rest.push(word);
266
+ }
267
+ return { targets, text: rest.join(" ") };
268
+ }
269
+ function ordered(rows) {
270
+ const rank = (row) => row.target === "this-computer" ? row.recommended ? 0 : 1 : 2;
271
+ return rows.map((row, index) => ({ row, index })).sort((a, b) => rank(a.row) - rank(b.row) || a.index - b.index).map((item) => item.row);
272
+ }
273
+ async function hostedList(query, adapters = HOSTED_ADAPTERS, signal) {
274
+ const { targets, text } = parseHostedQuery(query);
275
+ const wanted = adapters.filter((adapter) => !targets.size || targets.has(adapter.target));
276
+ const answers = await Promise.allSettled(wanted.map((adapter) => adapter.list(text, signal)));
277
+ const rows = [];
278
+ const unavailable = [];
279
+ answers.forEach((answer, index) => {
280
+ if (answer.status === "fulfilled") rows.push(...answer.value);
281
+ else unavailable.push({ target: wanted[index].target, message: answer.reason instanceof Error ? answer.reason.message : String(answer.reason) });
282
+ });
283
+ const local = new Set(rows.flatMap((row) => row.target === "this-computer" && row.repo ? [row.repo] : []));
284
+ const merged = rows.filter((row) => !(row.target === "clikdeploy" && local.has(row.id)));
285
+ return { rows: ordered(merged), unavailable, ...discoveryRefresh() ? { refreshing: true } : {} };
286
+ }
287
+ var ALTERNATIVE_MS = 6e3;
288
+ async function hostedPlan(row, adapters = HOSTED_ADAPTERS) {
289
+ const plan = await hostedAdapter(row.target, adapters).plan(row);
290
+ const cloud = adapters.find((adapter) => adapter.target === "clikdeploy");
291
+ if (row.target !== "this-computer" || !row.repo || !cloud) return plan;
292
+ const cloudRow = { target: "clikdeploy", id: row.repo, label: row.label, detail: "" };
293
+ const deadline = new AbortController();
294
+ const timer = setTimeout(() => deadline.abort(), ALTERNATIVE_MS);
295
+ try {
296
+ return { ...plan, alternative: { row: cloudRow, plan: await cloud.plan(cloudRow, deadline.signal) } };
297
+ } catch (error) {
298
+ quiet("hosted-models")(error);
299
+ return plan;
300
+ } finally {
301
+ clearTimeout(timer);
302
+ }
303
+ }
304
+ function hostedAdapter(target, adapters = HOSTED_ADAPTERS) {
305
+ const adapter = adapters.find((item) => item.target === target);
306
+ if (!adapter) throw new Error(`unknown hosted target "${target}"`);
307
+ return adapter;
308
+ }
309
+
310
+ // src/tui/pickers/model.ts
311
+ function modelRow(harness, catalog, model, current, providerConfigured = false, free) {
312
+ const shown = harness ? harnessModelLabel(harness, model) : model;
313
+ const name = catalog.labels?.[model];
314
+ const bare = (text) => text.toLowerCase().replace(/[^a-z0-9]/g, "");
315
+ const respells = name !== void 0 && [shown, shown.slice(shown.indexOf("/") + 1)].some((id) => bare(id) === bare(name));
316
+ const parts = [
317
+ // First: a narrow screen cuts the end of a row, and this is what it is for.
318
+ model === current ? "current" : void 0,
319
+ name && !respells ? name : void 0,
320
+ modelSettingsDetail(model),
321
+ free?.has(model) ? "free plan" : void 0,
322
+ model === current && providerConfigured ? "provider configured" : void 0
323
+ ].filter((part) => Boolean(part));
324
+ return { label: shown, detail: parts.length ? `\xB7 ${parts.join(" \xB7 ")}` : void 0, value: model };
325
+ }
326
+ async function interactiveModelPicker(rl, id) {
327
+ const state = await readState({ transcripts: [id] });
328
+ const session = state.sessions.find((item) => item.id === id);
329
+ if (!session) throw new Error(`AI session "${id}" was not found`);
330
+ if (isGatewayService(session)) return gatewayModelPicker(rl, id, session.model ?? null, session.gatewayAgentId);
331
+ if (session.route === "clikcode-local") return interactiveHostedPicker(rl, id);
332
+ const account = session.accountId ? state.accounts.find((item) => item.id === session.accountId) : void 0;
333
+ const harness = sessionOrProviderHarness(session);
334
+ let catalog = { models: account?.models ?? [] };
335
+ if (harness) {
336
+ const waiting = TERMINAL.active === rl ? TERMINAL.active : void 0;
337
+ catalog = await withSlowWait(waiting, `finding ${harness.displayName} models\u2026`, () => nativeModelCatalogForPicker(harness, account));
338
+ }
339
+ const effective = session.model ?? catalog.configured;
340
+ const free = freePlanModels(harness, account, catalog);
341
+ const discoveredModels = [...catalog.models].sort((left, right) => left === effective ? -1 : right === effective ? 1 : left.localeCompare(right));
342
+ const options = [
343
+ ...discoveredModels.map((model) => modelRow(harness, catalog, model, effective, !session.model && model === catalog.configured, free)),
344
+ // A multi-provider harness (Hermes) lists providers it can reach but is
345
+ // not signed in to. Signing in here is the whole connection flow: no
346
+ // command to know, and the picker comes back with that provider's models.
347
+ ...catalog.connect?.length ? [{ label: "Connect a provider\u2026", detail: `\xB7 ${catalog.connect.length} more in ${harness?.displayName ?? "this harness"}`, value: "__connect__" }] : [],
348
+ { label: "Enter a model ID\u2026", value: "__custom__" }
349
+ ];
350
+ const selected = !discoveredModels.length && !catalog.connect?.length ? "__custom__" : await chooseOption(rl, discoveredModels.length ? "Choose a model" : `${harness?.displayName ?? "This provider"} reported no models \u2014 enter one`, options);
351
+ if (!selected) return;
352
+ if (selected === "__connect__" && harness && catalog.connect?.length) {
353
+ const target = await chooseOption(rl, `Connect ${harness.displayName} to`, catalog.connect.map((item) => ({
354
+ label: item.label,
355
+ detail: item.detail ? `\xB7 ${item.detail}` : void 0,
356
+ value: item.id
357
+ })));
358
+ const connect = catalog.connect.find((item) => item.id === target);
359
+ if (!connect) return;
360
+ const signIn = { ...harness, loginArgv: connect.argv };
361
+ const environment = nativeProfileEnvironment(account?.nativeProfile);
362
+ await withSignIn(rl, `${harness.displayName} \u203A ${connect.label}`, () => loginNativeHarness(signIn, environment));
363
+ return interactiveModelPicker(rl, id);
364
+ }
365
+ let typed;
366
+ if (selected === "__custom__") {
367
+ try {
368
+ typed = (await rl.question(discoveredModels.length ? "Model ID \u203A " : `${harness?.displayName ?? "This provider"} lists no models \u2014 model ID \u203A `, void 0, { cancellable: true })).trim();
369
+ } catch (error) {
370
+ if (error.code === "ERR_PROMPT_CANCELLED") return;
371
+ throw error;
372
+ }
373
+ }
374
+ const value = typed !== void 0 ? harness && typed ? modelIdFromLabel(harness, catalog.models, modelIdFromDisplay(harness, typed)) : typed : selected;
375
+ if (value) {
376
+ await aiSessionCommand(id, typed !== void 0 ? `/model --any ${value}` : `/model ${value}`);
377
+ }
378
+ }
379
+ async function chooseWhereToRun(rl, config, row, plan) {
380
+ if (plan.alternative) {
381
+ return chooseOption(rl, row.label, [
382
+ { label: "Run on this computer", detail: `\xB7 ${plan.summary}`, value: row },
383
+ { label: "Run on ClikDeploy", detail: `\xB7 ${plan.alternative.plan.summary}`, value: plan.alternative.row }
384
+ ]);
385
+ }
386
+ if (plan.costly) {
387
+ if (alwaysStartOwnModels(config)) return row;
388
+ const answer2 = await chooseOption(rl, `Start ${row.label} on ClikDeploy?`, [
389
+ { label: "Start", detail: `\xB7 ${plan.summary}`, value: "start" },
390
+ { label: "Always start hosted AI models", detail: "\xB7 remember this on this machine", value: "always" }
391
+ ]);
392
+ if (answer2 === "always") setAlwaysStartOwnModels(true, config);
393
+ return answer2 ? row : void 0;
394
+ }
395
+ if (plan.consent === false) return row;
396
+ const answer = await chooseOption(rl, plan.title, [
397
+ { label: plan.confirm, ...plan.lines[0] ? { detail: `\xB7 ${plan.lines[0]}` } : {}, value: "start" },
398
+ { label: "Choose another model", value: "back" }
399
+ ]);
400
+ return answer === "start" ? row : void 0;
401
+ }
402
+ async function interactiveHostedPicker(rl, id) {
403
+ const waiting = TERMINAL.active === rl ? TERMINAL.active : void 0;
404
+ const open = (await readState({ transcripts: [id] })).sessions.find((item) => item.id === id);
405
+ const onThisComputer = open?.route === "clikcode-local" ? open.model : void 0;
406
+ const rows = (rowsOf) => rowsOf.map((row) => ({
407
+ label: row.label,
408
+ // Where it runs is the group it is under, not a tag on every row.
409
+ detail: `\xB7 ${[row.target === "this-computer" && row.id === onThisComputer ? "current" : "", row.recommended ? "recommended" : "", row.detail].filter(Boolean).join(" \xB7 ")}`,
410
+ value: row,
411
+ group: row.target === "this-computer" ? "Fits this computer" : "On ClikDeploy"
412
+ }));
413
+ const initial = await withSlowWait(waiting, "finding hosted AI models\u2026", () => hostedList(""));
414
+ for (const note of initial.unavailable) {
415
+ if (note.target === "clikdeploy") rl.panel?.("Hosted AI", "ClikDeploy GPUs need an internet connection and a Gateway sign-in; models for this computer are listed.");
416
+ }
417
+ const gatewayRow = open?.route === "clikcode-local" ? [{ label: "ClikDeploy Gateway models\u2026", detail: "\xB7 billed by the token, from every lab", value: GATEWAY_MODELS, group: "ClikDeploy Gateway" }] : [];
418
+ const picked = await chooseOption(rl, "Hosted AI", [...rows(initial.rows), ...gatewayRow], void 0, {
419
+ onFilter: async (query) => rows((await withSlowWait(waiting, "searching\u2026", () => hostedList(query))).rows)
420
+ });
421
+ if (picked === GATEWAY_MODELS) {
422
+ const moved = await selectProviderConversation(new Conf({ projectName: "clikcode", configFileMode: 384 }), rl, id, "__gateway__");
423
+ return interactiveModelPicker(rl, moved);
424
+ }
425
+ const selected = picked;
426
+ if (!selected) return;
427
+ const plan = await withSlowWait(waiting, selected.target === "clikdeploy" ? `checking ${selected.label} and matching compute\u2026` : `checking ${selected.label}\u2026`, () => hostedPlan(selected));
428
+ const config = new Conf({ projectName: "clikcode", configFileMode: 384 });
429
+ const start = await chooseWhereToRun(rl, config, selected, plan);
430
+ if (!start) return interactiveHostedPicker(rl, id);
431
+ const adapter = hostedAdapter(start.target);
432
+ const selection = await withSlowWait(waiting, start.target === "clikdeploy" ? `starting ${start.label} on ClikDeploy\u2026` : `preparing ${start.label}\u2026`, () => adapter.start(start));
433
+ const state = await readState({ transcripts: [id] });
434
+ const session = state.sessions.find((item) => item.id === id);
435
+ let target = id;
436
+ if (selection.route === "gateway" && session?.route !== selection.route) target = await selectProviderConversation(config, rl, id, providerConversationKey(GATEWAY_ID));
437
+ await aiSessionCommand(target, hostedSelectionCommand(selection));
438
+ }
439
+ var GATEWAY_MODELS = "__gateway_models__";
440
+ function gatewayPickerRows(list, agents, current, currentAgent) {
441
+ const subscriptions = list.subscriptions === void 0 ? [] : [{
442
+ label: `${list.subscriptions ? "\u2713" : "\u25CB"} Use subscriptions`,
443
+ detail: list.subscriptions ? "\xB7 on: your ClikCode turns may use the platform's subscriptions \xB7 enter turns off" : "\xB7 off: your ClikCode turns use customer accounts only \xB7 enter turns on",
444
+ value: { kind: "subscriptions" },
445
+ group: "Gateway"
446
+ }];
447
+ const agentRows = [
448
+ ...agents.length || currentAgent ? [{ label: currentAgent ? "No agent" : "\u2713 No agent", detail: "\xB7 use ClikCode with the Gateway model", value: { kind: "agent" }, group: "Your agents (remote)" }] : [],
449
+ ...agents.map((agent) => ({
450
+ label: `${agent.id === currentAgent ? "\u2713 " : ""}${agent.name}`,
451
+ detail: `\xB7 runs on ClikDeploy${agent.description ? ` \xB7 ${agent.description}` : ""}`,
452
+ value: { kind: "agent", id: agent.id },
453
+ group: "Your agents (remote)"
454
+ }))
455
+ ];
456
+ return [
457
+ ...subscriptions,
458
+ { label: "Hosted AI\u2026", detail: "\xB7 run a model on this computer (free, works offline) or on a ClikDeploy GPU", value: { kind: "hosted" }, group: "Hosted AI" },
459
+ ...agentRows,
460
+ {
461
+ label: currentAgent ? "Agent default" : "Automatic",
462
+ detail: currentAgent ? `${current ? "" : "\xB7 current "}\xB7 use this agent's configured pin or router` : `${current ? "" : "\xB7 current "}\xB7 the Gateway chooses`,
463
+ value: { kind: "model", id: "auto" },
464
+ group: "Automatic"
465
+ },
466
+ ...gatewayModelsByMaker(list.models).map((model) => {
467
+ const price = gatewayModelDetail(model);
468
+ return {
469
+ label: gatewayModelLabel(model),
470
+ detail: [model.id === current ? "\xB7 current" : "", price ? `\xB7 ${price}` : ""].filter(Boolean).join(" "),
471
+ value: { kind: "model", id: model.id },
472
+ group: gatewayMakerName(model)
473
+ };
474
+ })
475
+ ];
476
+ }
477
+ async function gatewayModelPicker(rl, id, current, currentAgent) {
478
+ let list = await savedGatewayModels();
479
+ const fresh = gatewayModels({ fresh: true }).then((latest) => {
480
+ list = latest;
481
+ return latest;
482
+ });
483
+ void fresh.catch(quiet("tui/pickers/model"));
484
+ const agents = await gatewayAgents().catch((error) => {
485
+ diagnostic("gateway.agents-unavailable", error instanceof Error ? error.message : String(error));
486
+ return [];
487
+ });
488
+ if (!list) {
489
+ const waiting = TERMINAL.active === rl ? TERMINAL.active : void 0;
490
+ list = await withSlowWait(waiting, "finding ClikDeploy Gateway models\u2026", () => fresh);
491
+ }
492
+ const options = () => gatewayPickerRows(list, agents, current, currentAgent);
493
+ for (; ; ) {
494
+ const selected = await chooseOption(rl, "Choose an agent or ClikDeploy Gateway model (price per 1M tokens, in/out)", options(), void 0, { refreshedOptions: options, refresh: fresh });
495
+ if (!selected) return;
496
+ if (selected.kind === "subscriptions") {
497
+ const config = new Conf({ projectName: "clikcode", configFileMode: 384 });
498
+ const on = !gatewaySubscriptionsOn(config);
499
+ setGatewaySubscriptions(config, on);
500
+ const waiting = TERMINAL.active === rl ? TERMINAL.active : void 0;
501
+ try {
502
+ list = await withSlowWait(waiting, "finding ClikDeploy Gateway models\u2026", () => gatewayModels({ fresh: true, config }));
503
+ } catch (error) {
504
+ diagnostic("gateway.models-unavailable", error instanceof Error ? error.message : String(error));
505
+ }
506
+ continue;
507
+ }
508
+ if (selected.kind === "hosted") return interactiveHostedPicker(rl, id);
509
+ if (selected.kind === "agent") {
510
+ currentAgent = selected.id === currentAgent ? void 0 : selected.id;
511
+ await selectGatewayAgent(id, currentAgent, agents.find((agent) => agent.id === currentAgent)?.name);
512
+ continue;
513
+ }
514
+ const selectedModel = list.models.find((model) => model.id === selected.id);
515
+ if (selectedModel?.tags?.includes("uncensored")) {
516
+ try {
517
+ if (!await (await import("./chunk-HSE4AQYV.js")).reviewGatewayModelAgreement(selected.id, rl)) continue;
518
+ } catch (error) {
519
+ emitHarnessOutput({ panel: "error", message: `Uncensored model agreement: ${error instanceof Error ? error.message : String(error)}` });
520
+ continue;
521
+ }
522
+ }
523
+ const own = list.models.find((model) => model.id === selected.id)?.own;
524
+ if (own?.state === "asleep") {
525
+ const config = new Conf({ projectName: "clikcode", configFileMode: 384 });
526
+ if (!alwaysStartOwnModels(config)) {
527
+ const answer = await chooseOption(rl, `Start ${selected.id} on ClikDeploy?`, [
528
+ {
529
+ label: "Yes, start private model",
530
+ detail: "Uses credits by the hour while it runs; it may take a few minutes to start.",
531
+ value: "start"
532
+ },
533
+ {
534
+ label: "No, use a token-billed model",
535
+ detail: "Choose a pay-per-token Gateway model instead.",
536
+ value: "hosted"
537
+ },
538
+ {
539
+ label: "Always start hosted AI models",
540
+ detail: "Remember this choice on this machine.",
541
+ value: "always"
542
+ }
543
+ ]);
544
+ if (answer === "hosted") {
545
+ const tokenModels = list.models.filter((model) => !model.own && model.price && model.access !== "subscription" && model.access !== "free").map((model) => ({
546
+ label: gatewayModelLabel(model),
547
+ detail: gatewayModelDetail(model),
548
+ value: model.id
549
+ }));
550
+ const hosted = await chooseOption(rl, "Choose a token-billed Gateway model", tokenModels);
551
+ if (hosted) {
552
+ await aiSessionCommand(id, `/model ${hosted}`);
553
+ return;
554
+ }
555
+ continue;
556
+ }
557
+ if (answer === "always") setAlwaysStartOwnModels(true, config);
558
+ else if (answer !== "start") continue;
559
+ }
560
+ }
561
+ const source = selectedModel && (selectedModel.sources?.length ?? 0) > 1 ? await chooseModelSource(rl, selectedModel) : void 0;
562
+ if (source === null) continue;
563
+ await aiSessionCommand(id, `/model ${selected.id}${source ? ` --source ${source}` : ""}`);
564
+ return;
565
+ }
566
+ }
567
+ async function chooseModelSource(rl, model) {
568
+ const picked = await chooseOption(rl, `Choose a source for ${gatewayModelLabel(model)}`, [
569
+ { label: "Automatic", detail: "\xB7 the Gateway routes it", value: "auto" },
570
+ ...(model.sources ?? []).map((source) => ({ label: source.id, detail: `\xB7 ${source.access}`, value: source.id }))
571
+ ]);
572
+ if (picked === void 0 || picked === null) return null;
573
+ return picked === "auto" ? void 0 : picked;
574
+ }
575
+
576
+ export {
577
+ hostedSelectionCommand,
578
+ hostedList,
579
+ hostedPlan,
580
+ hostedAdapter,
581
+ modelRow,
582
+ interactiveModelPicker,
583
+ interactiveHostedPicker,
584
+ gatewayPickerRows
585
+ };