clikcode 1.0.3 → 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 +498 -112593
  319. package/dist/computer-tools.js +36642 -21258
  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,668 @@
1
+ import { createRequire as __clikcodeCreateRequire } from 'node:module';
2
+ const require = __clikcodeCreateRequire(import.meta.url);
3
+ import {
4
+ DEFAULT_GATEWAY_URL
5
+ } from "./chunk-TULAXS77.js";
6
+ import {
7
+ atomicWriteFile
8
+ } from "./chunk-F6F47QAY.js";
9
+ import {
10
+ diagnostic
11
+ } from "./chunk-RDDWQBEM.js";
12
+
13
+ // src/local-models/catalog-source.ts
14
+ import { readFileSync } from "node:fs";
15
+ import { mkdir } from "node:fs/promises";
16
+ import { dirname } from "node:path";
17
+
18
+ // src/local-models/catalog.snapshot.json
19
+ var catalog_snapshot_default = {
20
+ catalog: {
21
+ schema: 1,
22
+ version: 1,
23
+ publishedAt: "2026-10-25T00:00:00.000Z",
24
+ models: [
25
+ {
26
+ id: "qwen3.5-4b",
27
+ label: "Qwen3.5 4B",
28
+ weights: {
29
+ repo: "unsloth/Qwen3.5-4B-GGUF",
30
+ revision: "e87f176479d0855a907a41277aca2f8ee7a09523",
31
+ file: "Qwen3.5-4B-Q4_K_M.gguf",
32
+ sizeBytes: 2740937888,
33
+ sha256: "00fe7986ff5f6b463e62455821146049db6f9313603938a70800d1fb69ef11a4"
34
+ },
35
+ architecture: "qwen35",
36
+ totalParamsB: 4.21,
37
+ activeParamsB: 4.21,
38
+ quantization: "Q4_K_M",
39
+ defaultContext: 65536,
40
+ maxContext: 262144,
41
+ license: "apache-2.0",
42
+ kv: {
43
+ layers: 8,
44
+ kvHeads: 4,
45
+ keyLength: 256,
46
+ valueLength: 256,
47
+ recurrentStateBytes: 52690944
48
+ },
49
+ quality: 40,
50
+ qualityNote: "smallest tier; for machines with little memory",
51
+ projector: {
52
+ repo: "unsloth/Qwen3.5-4B-GGUF",
53
+ revision: "e87f176479d0855a907a41277aca2f8ee7a09523",
54
+ file: "mmproj-F16.gguf",
55
+ sizeBytes: 672423616,
56
+ sha256: "cd88edcf8d031894960bb0c9c5b9b7e1fea6ebee02b9f7ce925a00d12891f864"
57
+ },
58
+ activeWeightBytes: 2729969664
59
+ },
60
+ {
61
+ id: "qwen3.5-9b",
62
+ label: "Qwen3.5 9B",
63
+ weights: {
64
+ repo: "unsloth/Qwen3.5-9B-GGUF",
65
+ revision: "3885219b6810b007914f3a7950a8d1b469d598a5",
66
+ file: "Qwen3.5-9B-Q4_K_M.gguf",
67
+ sizeBytes: 5680522464,
68
+ sha256: "03b74727a860a56338e042c4420bb3f04b2fec5734175f4cb9fa853daf52b7e8"
69
+ },
70
+ architecture: "qwen35",
71
+ totalParamsB: 8.95,
72
+ activeParamsB: 8.95,
73
+ quantization: "Q4_K_M",
74
+ defaultContext: 65536,
75
+ maxContext: 262144,
76
+ license: "apache-2.0",
77
+ kv: {
78
+ layers: 8,
79
+ kvHeads: 4,
80
+ keyLength: 256,
81
+ valueLength: 256,
82
+ recurrentStateBytes: 52690944
83
+ },
84
+ quality: 55,
85
+ qualityNote: "the dense Qwen 3.5 step above 4B",
86
+ projector: {
87
+ repo: "unsloth/Qwen3.5-9B-GGUF",
88
+ revision: "3885219b6810b007914f3a7950a8d1b469d598a5",
89
+ file: "mmproj-F16.gguf",
90
+ sizeBytes: 918166080,
91
+ sha256: "f70dc3509053962b0d0d3ee8a7eacebf5d60aa560cad78254ae8698516ae029f"
92
+ },
93
+ activeWeightBytes: 5097424896
94
+ },
95
+ {
96
+ id: "gpt-oss-20b",
97
+ label: "gpt-oss 20B",
98
+ weights: {
99
+ repo: "ggml-org/gpt-oss-20b-GGUF",
100
+ revision: "ef9b12f2ff56c69cf32153a02784e7a3c88bf524",
101
+ file: "gpt-oss-20b-MXFP4.gguf",
102
+ sizeBytes: 12109566624,
103
+ sha256: "27cd6c432c7672cb812a92f611cf3ba7bbc35928262bb1e1253ff4ee6ae35901"
104
+ },
105
+ architecture: "gpt-oss",
106
+ totalParamsB: 20.9,
107
+ activeParamsB: 3.6,
108
+ quantization: "MXFP4",
109
+ defaultContext: 65536,
110
+ maxContext: 131072,
111
+ license: "apache-2.0",
112
+ kv: {
113
+ layers: 12,
114
+ kvHeads: 8,
115
+ keyLength: 64,
116
+ valueLength: 64,
117
+ sliding: {
118
+ layers: 12,
119
+ kvHeads: 8,
120
+ keyLength: 64,
121
+ valueLength: 64,
122
+ window: 128
123
+ }
124
+ },
125
+ quality: 62,
126
+ qualityNote: "OpenAI reports about 60 on SWE-bench Verified",
127
+ activeWeightBytes: 2574702336
128
+ },
129
+ {
130
+ id: "gemma-4-26b-a4b",
131
+ label: "Gemma 4 26B-A4B",
132
+ weights: {
133
+ repo: "ggml-org/gemma-4-26B-A4B-it-GGUF",
134
+ revision: "bb4531cda34d1ea09d9814959ed4d5833cf2a4c8",
135
+ file: "gemma-4-26B-A4B-it-Q4_0.gguf",
136
+ sizeBytes: 14618145824,
137
+ sha256: "d208665ab1cd3a69f7a9a4bc59430e8448c8093d9b06334f566ac59d6d504a03"
138
+ },
139
+ architecture: "gemma4",
140
+ totalParamsB: 25.2,
141
+ activeParamsB: 3.8,
142
+ quantization: "Q4_0",
143
+ defaultContext: 65536,
144
+ maxContext: 262144,
145
+ license: "apache-2.0",
146
+ kv: {
147
+ layers: 5,
148
+ kvHeads: 2,
149
+ keyLength: 512,
150
+ valueLength: 512,
151
+ sliding: {
152
+ layers: 25,
153
+ kvHeads: 8,
154
+ keyLength: 256,
155
+ valueLength: 256,
156
+ window: 1024
157
+ }
158
+ },
159
+ quality: 70,
160
+ qualityNote: "native function calling; 3.8B active of 25B",
161
+ projector: {
162
+ repo: "ggml-org/gemma-4-26B-A4B-it-GGUF",
163
+ revision: "bb4531cda34d1ea09d9814959ed4d5833cf2a4c8",
164
+ file: "mmproj-gemma-4-26B-A4B-it-Q8_0.gguf",
165
+ sizeBytes: 806408320,
166
+ sha256: "cc4e855736da450bf1e162d8cccfe0ad685727d0c9e04ef7dd8d884f3121039b"
167
+ },
168
+ activeWeightBytes: 2558837816
169
+ },
170
+ {
171
+ id: "qwen3.6-35b-a3b",
172
+ label: "Qwen3.6 35B-A3B",
173
+ weights: {
174
+ repo: "ggml-org/Qwen3.6-35B-A3B-GGUF",
175
+ revision: "baec3ebee244827cda0f4557eafa8b28f7545fa6",
176
+ file: "Qwen3.6-35B-A3B-Q4_K_M.gguf",
177
+ sizeBytes: 20419565568,
178
+ sha256: "671e47e0ec53c665d048b98c3ecbfd5236b5ca9c3e02ed19fc8f81f7b85140c7"
179
+ },
180
+ architecture: "qwen35moe",
181
+ totalParamsB: 34.7,
182
+ activeParamsB: 3,
183
+ quantization: "Q4_K_M",
184
+ defaultContext: 65536,
185
+ maxContext: 262144,
186
+ license: "apache-2.0",
187
+ kv: {
188
+ layers: 10,
189
+ kvHeads: 2,
190
+ keyLength: 256,
191
+ valueLength: 256,
192
+ recurrentStateBytes: 65863680
193
+ },
194
+ quality: 82,
195
+ qualityNote: "SWE-bench Verified 73.4",
196
+ projector: {
197
+ repo: "ggml-org/Qwen3.6-35B-A3B-GGUF",
198
+ revision: "baec3ebee244827cda0f4557eafa8b28f7545fa6",
199
+ file: "mmproj-Qwen3.6-35B-A3B-Q8_0.gguf",
200
+ sizeBytes: 614194304,
201
+ sha256: "904cbf8c8e876220066ab3bf676c7efa40f3da372276fdaf8b01d2fb2a37a51d"
202
+ },
203
+ activeWeightBytes: 2569349632
204
+ },
205
+ {
206
+ id: "ornith-1.5-35b-a3b",
207
+ label: "Ornith 1.5 35B-A3B",
208
+ weights: {
209
+ repo: "ornith-ai/Ornith-1.5-35B-A3B-GGUF",
210
+ revision: "63d07eca3c975d65e050192cf7429658bafb0ac9",
211
+ file: "Ornith-1.5-35B-Q4_K_M.gguf",
212
+ sizeBytes: 21713462848,
213
+ sha256: "ca6ea26329c88b78ffd90a85163be2e746c2fafd1024f56db47e499f117f9a7f"
214
+ },
215
+ architecture: "qwen35moe",
216
+ totalParamsB: 35.5,
217
+ activeParamsB: 3,
218
+ quantization: "Q4_K_M",
219
+ defaultContext: 65536,
220
+ maxContext: 262144,
221
+ license: "mit",
222
+ kv: {
223
+ layers: 10,
224
+ kvHeads: 2,
225
+ keyLength: 256,
226
+ valueLength: 256,
227
+ recurrentStateBytes: 68059136
228
+ },
229
+ quality: 88,
230
+ qualityNote: "SWE-bench Verified 79, Terminal-Bench 2.1 67.8 (its card)",
231
+ projector: {
232
+ repo: "ornith-ai/Ornith-1.5-35B-A3B-GGUF",
233
+ revision: "63d07eca3c975d65e050192cf7429658bafb0ac9",
234
+ file: "mmproj-Ornith-1.5-35B-BF16.gguf",
235
+ sizeBytes: 902822016,
236
+ sha256: "d9ce31026d1cb1f3f8d5152e2e2a014d9d2b302b6c93a7dc07bb0a0487f52837"
237
+ },
238
+ activeWeightBytes: 2016506368
239
+ },
240
+ {
241
+ id: "qwen3.8-27b",
242
+ label: "Qwen3.8 27B",
243
+ weights: {
244
+ repo: "ggml-org/Qwen3.8-27B-GGUF",
245
+ revision: "71bc7b627595dc8a91039addd9c791ae548d6747",
246
+ file: "Qwen3.8-27B-Q4_K_M.gguf",
247
+ sizeBytes: 18973870528,
248
+ sha256: "c600de0300ae8a0eb3a6c0b8b5561b8b96f16bd2c863c2a66c42de29d391a747"
249
+ },
250
+ architecture: "qwen35",
251
+ totalParamsB: 26.9,
252
+ activeParamsB: 26.9,
253
+ quantization: "Q4_K_M",
254
+ defaultContext: 65536,
255
+ maxContext: 262144,
256
+ license: "apache-2.0",
257
+ kv: {
258
+ layers: 16,
259
+ kvHeads: 4,
260
+ keyLength: 256,
261
+ valueLength: 256,
262
+ recurrentStateBytes: 156893184
263
+ },
264
+ quality: 92,
265
+ qualityNote: "Terminal-Bench 2.1 73.0 (its card)",
266
+ projector: {
267
+ repo: "ggml-org/Qwen3.8-27B-GGUF",
268
+ revision: "71bc7b627595dc8a91039addd9c791ae548d6747",
269
+ file: "mmproj-Qwen3.8-27B-Q8_0.gguf",
270
+ sizeBytes: 629247008,
271
+ sha256: "2e968a6af97ce35d8971890b257b9b7edabf20ad91450501fa53162a19ee33eb"
272
+ },
273
+ activeWeightBytes: 18247714816
274
+ },
275
+ {
276
+ id: "ornith-1.5-35b-a3b-q6",
277
+ label: "Ornith 1.5 35B-A3B Q6_K",
278
+ weights: {
279
+ repo: "ornith-ai/Ornith-1.5-35B-A3B-GGUF",
280
+ revision: "63d07eca3c975d65e050192cf7429658bafb0ac9",
281
+ file: "Ornith-1.5-35B-Q6_K.gguf",
282
+ sizeBytes: 29208731200,
283
+ sha256: "1c4e5bb98a74c89a5d93a2488b5748b7b331daf77f6dbb64bd9b2ff864b64eb3"
284
+ },
285
+ architecture: "qwen35moe",
286
+ totalParamsB: 35.5,
287
+ activeParamsB: 3,
288
+ quantization: "Q6_K",
289
+ defaultContext: 65536,
290
+ maxContext: 262144,
291
+ license: "mit",
292
+ kv: {
293
+ layers: 10,
294
+ kvHeads: 2,
295
+ keyLength: 256,
296
+ valueLength: 256,
297
+ recurrentStateBytes: 68059136
298
+ },
299
+ quality: 90,
300
+ qualityNote: "Ornith 1.5 35B-A3B at Q6_K; near-lossless against Q4_K_M",
301
+ projector: {
302
+ repo: "ornith-ai/Ornith-1.5-35B-A3B-GGUF",
303
+ revision: "63d07eca3c975d65e050192cf7429658bafb0ac9",
304
+ file: "mmproj-Ornith-1.5-35B-BF16.gguf",
305
+ sizeBytes: 902822016,
306
+ sha256: "d9ce31026d1cb1f3f8d5152e2e2a014d9d2b302b6c93a7dc07bb0a0487f52837"
307
+ }
308
+ },
309
+ {
310
+ id: "ornith-1.5-35b-a3b-q8",
311
+ label: "Ornith 1.5 35B-A3B Q8_0",
312
+ weights: {
313
+ repo: "ornith-ai/Ornith-1.5-35B-A3B-GGUF",
314
+ revision: "63d07eca3c975d65e050192cf7429658bafb0ac9",
315
+ file: "Ornith-1.5-35B-Q8_0.gguf",
316
+ sizeBytes: 37802149120,
317
+ sha256: "854cf83f80cd37a061ed86df1fa7201162e4e1fb820b91068cc12a11d2746c9e"
318
+ },
319
+ architecture: "qwen35moe",
320
+ totalParamsB: 35.5,
321
+ activeParamsB: 3,
322
+ quantization: "Q8_0",
323
+ defaultContext: 65536,
324
+ maxContext: 262144,
325
+ license: "mit",
326
+ kv: {
327
+ layers: 10,
328
+ kvHeads: 2,
329
+ keyLength: 256,
330
+ valueLength: 256,
331
+ recurrentStateBytes: 68059136
332
+ },
333
+ quality: 91,
334
+ qualityNote: "Ornith 1.5 35B-A3B at Q8_0",
335
+ projector: {
336
+ repo: "ornith-ai/Ornith-1.5-35B-A3B-GGUF",
337
+ revision: "63d07eca3c975d65e050192cf7429658bafb0ac9",
338
+ file: "mmproj-Ornith-1.5-35B-BF16.gguf",
339
+ sizeBytes: 902822016,
340
+ sha256: "d9ce31026d1cb1f3f8d5152e2e2a014d9d2b302b6c93a7dc07bb0a0487f52837"
341
+ }
342
+ },
343
+ {
344
+ id: "qwen3.8-27b-q8",
345
+ label: "Qwen3.8 27B Q8_0",
346
+ weights: {
347
+ repo: "ggml-org/Qwen3.8-27B-GGUF",
348
+ revision: "71bc7b627595dc8a91039addd9c791ae548d6747",
349
+ file: "Qwen3.8-27B-Q8_0.gguf",
350
+ sizeBytes: 28595763648,
351
+ sha256: "aab65c67ef0dad127960efef9247f1832bca105faa1c7a052cc039b223cf86a1"
352
+ },
353
+ architecture: "qwen35",
354
+ totalParamsB: 26.9,
355
+ activeParamsB: 26.9,
356
+ quantization: "Q8_0",
357
+ defaultContext: 65536,
358
+ maxContext: 262144,
359
+ license: "apache-2.0",
360
+ kv: {
361
+ layers: 16,
362
+ kvHeads: 4,
363
+ keyLength: 256,
364
+ valueLength: 256,
365
+ recurrentStateBytes: 156893184
366
+ },
367
+ quality: 95,
368
+ qualityNote: "Qwen3.8 27B at Q8_0",
369
+ projector: {
370
+ repo: "ggml-org/Qwen3.8-27B-GGUF",
371
+ revision: "71bc7b627595dc8a91039addd9c791ae548d6747",
372
+ file: "mmproj-Qwen3.8-27B-Q8_0.gguf",
373
+ sizeBytes: 629247008,
374
+ sha256: "2e968a6af97ce35d8971890b257b9b7edabf20ad91450501fa53162a19ee33eb"
375
+ }
376
+ }
377
+ ]
378
+ },
379
+ signature: {
380
+ algorithm: "ed25519",
381
+ keyId: "4a2621a6517c8923",
382
+ value: "/HwAklZ47ZwLNGMpjL0fTEiKdLaIGrmMdcoUwNaEok3hmSle5KYUZ/eZaYg+vFEY0akolvFD7U6U4i61VvAnBA=="
383
+ }
384
+ };
385
+
386
+ // src/local-models/paths.ts
387
+ import { homedir } from "node:os";
388
+ import { join } from "node:path";
389
+ function localModelsHome() {
390
+ return process.env.CLIKCODE_LOCAL_MODELS_HOME || join(homedir(), ".clikcode", "local-models");
391
+ }
392
+ function runtimesDir() {
393
+ return join(localModelsHome(), "runtimes");
394
+ }
395
+ function modelsDir() {
396
+ return join(localModelsHome(), "models");
397
+ }
398
+ function serversDir() {
399
+ return join(localModelsHome(), "servers");
400
+ }
401
+ function measurementsFile() {
402
+ return join(localModelsHome(), "measurements.json");
403
+ }
404
+ function footprintsFile(modelId) {
405
+ return join(serversDir(), safeName(modelId), "footprints.json");
406
+ }
407
+ function preferencesFile() {
408
+ return join(localModelsHome(), "preferences.json");
409
+ }
410
+ function discoveredModelsFile() {
411
+ return join(localModelsHome(), "discovered-models.json");
412
+ }
413
+ function tunedModelsFile() {
414
+ return join(localModelsHome(), "tuned-models.json");
415
+ }
416
+ function fineTuneDir() {
417
+ return join(localModelsHome(), "finetune");
418
+ }
419
+ function catalogCacheFile() {
420
+ return join(localModelsHome(), "catalog-cache.json");
421
+ }
422
+ function safeName(value) {
423
+ return value.replace(/[^\w.-]/g, "_");
424
+ }
425
+
426
+ // src/local-models/shared/catalog-signature.ts
427
+ import { createHash, createPrivateKey, createPublicKey, sign, verify } from "node:crypto";
428
+
429
+ // src/local-models/shared/catalog-schema.ts
430
+ var LOCAL_CATALOG_SCHEMA = 1;
431
+ var SHA256 = /^[0-9a-f]{64}$/;
432
+ var COMMIT = /^[0-9a-f]{40}$/;
433
+ function fail(path, expected) {
434
+ throw new Error(`Local model catalog: ${path} must be ${expected}.`);
435
+ }
436
+ function record(value, path) {
437
+ if (typeof value !== "object" || value === null || Array.isArray(value)) fail(path, "an object");
438
+ return value;
439
+ }
440
+ function text(value, path) {
441
+ if (typeof value !== "string" || !value) fail(path, "a non-empty string");
442
+ return value;
443
+ }
444
+ function positive(value, path) {
445
+ if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) fail(path, "a positive number");
446
+ return value;
447
+ }
448
+ function file(value, path) {
449
+ const item = record(value, path);
450
+ const sha256 = text(item.sha256, `${path}.sha256`);
451
+ const revision = text(item.revision, `${path}.revision`);
452
+ if (!SHA256.test(sha256)) fail(`${path}.sha256`, "a lowercase hex SHA-256");
453
+ if (!COMMIT.test(revision)) fail(`${path}.revision`, "a 40-character commit sha");
454
+ return { repo: text(item.repo, `${path}.repo`), revision, file: text(item.file, `${path}.file`), sizeBytes: positive(item.sizeBytes, `${path}.sizeBytes`), sha256 };
455
+ }
456
+ function kv(value, path) {
457
+ const item = record(value, path);
458
+ const geometry = {
459
+ layers: positive(item.layers, `${path}.layers`),
460
+ kvHeads: positive(item.kvHeads, `${path}.kvHeads`),
461
+ keyLength: positive(item.keyLength, `${path}.keyLength`),
462
+ valueLength: positive(item.valueLength, `${path}.valueLength`)
463
+ };
464
+ if (item.sliding !== void 0) {
465
+ const sliding = record(item.sliding, `${path}.sliding`);
466
+ geometry.sliding = {
467
+ layers: positive(sliding.layers, `${path}.sliding.layers`),
468
+ kvHeads: positive(sliding.kvHeads, `${path}.sliding.kvHeads`),
469
+ keyLength: positive(sliding.keyLength, `${path}.sliding.keyLength`),
470
+ valueLength: positive(sliding.valueLength, `${path}.sliding.valueLength`),
471
+ window: positive(sliding.window, `${path}.sliding.window`)
472
+ };
473
+ }
474
+ if (item.recurrentStateBytes !== void 0) geometry.recurrentStateBytes = positive(item.recurrentStateBytes, `${path}.recurrentStateBytes`);
475
+ return geometry;
476
+ }
477
+ function model(value, path) {
478
+ const item = record(value, path);
479
+ if (item.license !== "apache-2.0" && item.license !== "mit") fail(`${path}.license`, "'apache-2.0' or 'mit'");
480
+ const result = {
481
+ id: text(item.id, `${path}.id`),
482
+ label: text(item.label, `${path}.label`),
483
+ weights: file(item.weights, `${path}.weights`),
484
+ architecture: text(item.architecture, `${path}.architecture`),
485
+ totalParamsB: positive(item.totalParamsB, `${path}.totalParamsB`),
486
+ activeParamsB: positive(item.activeParamsB, `${path}.activeParamsB`),
487
+ quantization: text(item.quantization, `${path}.quantization`),
488
+ defaultContext: positive(item.defaultContext, `${path}.defaultContext`),
489
+ maxContext: positive(item.maxContext, `${path}.maxContext`),
490
+ license: item.license,
491
+ kv: kv(item.kv, `${path}.kv`),
492
+ quality: positive(item.quality, `${path}.quality`),
493
+ qualityNote: text(item.qualityNote, `${path}.qualityNote`)
494
+ };
495
+ if (item.projector !== void 0) result.projector = file(item.projector, `${path}.projector`);
496
+ if (item.activeWeightBytes !== void 0) result.activeWeightBytes = positive(item.activeWeightBytes, `${path}.activeWeightBytes`);
497
+ return result;
498
+ }
499
+ function parseLocalCatalog(value) {
500
+ const item = record(value, "catalog");
501
+ if (item.schema !== LOCAL_CATALOG_SCHEMA) fail("schema", `${LOCAL_CATALOG_SCHEMA}`);
502
+ const version = positive(item.version, "version");
503
+ if (!Number.isInteger(version)) fail("version", "an integer");
504
+ const publishedAt = text(item.publishedAt, "publishedAt");
505
+ if (Number.isNaN(Date.parse(publishedAt))) fail("publishedAt", "an ISO time");
506
+ if (!Array.isArray(item.models) || !item.models.length) fail("models", "a non-empty array");
507
+ const models = item.models.map((entry, index) => model(entry, `models[${index}]`));
508
+ const ids = /* @__PURE__ */ new Set();
509
+ for (const entry of models) {
510
+ if (ids.has(entry.id)) fail("models", `unique by id (${entry.id} repeats)`);
511
+ ids.add(entry.id);
512
+ }
513
+ return { schema: LOCAL_CATALOG_SCHEMA, version, publishedAt, models };
514
+ }
515
+
516
+ // src/local-models/shared/catalog-signature.ts
517
+ var SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
518
+ function canonicalJson(value) {
519
+ if (value === null || typeof value === "string" || typeof value === "boolean") return JSON.stringify(value);
520
+ if (typeof value === "number") {
521
+ if (!Number.isFinite(value)) throw new Error("Canonical JSON cannot hold a non-finite number.");
522
+ return JSON.stringify(value);
523
+ }
524
+ if (Array.isArray(value)) return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
525
+ if (typeof value === "object") {
526
+ const entries = Object.entries(value).filter(([, item]) => item !== void 0).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
527
+ return `{${entries.map(([key, item]) => `${JSON.stringify(key)}:${canonicalJson(item)}`).join(",")}}`;
528
+ }
529
+ throw new Error(`Canonical JSON cannot hold a ${typeof value}.`);
530
+ }
531
+ function verifySignedCatalog(document, trusted) {
532
+ if (typeof document !== "object" || document === null) throw new Error("The model catalog is not an object.");
533
+ const { catalog, signature } = document;
534
+ if (!signature || signature.algorithm !== "ed25519" || typeof signature.value !== "string" || typeof signature.keyId !== "string") {
535
+ throw new Error("The model catalog carries no Ed25519 signature.");
536
+ }
537
+ const key = trusted.find((candidate) => candidate.keyId === signature.keyId);
538
+ if (!key) throw new Error(`The model catalog is signed by an unknown key (${signature.keyId}).`);
539
+ const publicKey = createPublicKey({ key: Buffer.concat([SPKI_PREFIX, Buffer.from(key.publicKey, "base64")]), format: "der", type: "spki" });
540
+ if (!verify(null, Buffer.from(canonicalJson(catalog)), publicKey, Buffer.from(signature.value, "base64"))) {
541
+ throw new Error("The model catalog signature does not match its contents.");
542
+ }
543
+ return parseLocalCatalog(catalog);
544
+ }
545
+
546
+ // src/local-models/catalog-source.ts
547
+ var TRUSTED_CATALOG_KEYS = [
548
+ { keyId: "4a2621a6517c8923", publicKey: "u6QGJq3feNYedfQ7re8LTp9SoZ9EMWzbZhsNeCEHD9k=" }
549
+ ];
550
+ var CATALOG_URL = `${DEFAULT_GATEWAY_URL}/api/models/local/catalog`;
551
+ var REFRESH_INTERVAL_MS = 24 * 60 * 60 * 1e3;
552
+ var REFRESH_TIMEOUT_MS = 5e3;
553
+ function message(error) {
554
+ return error instanceof Error ? error.message : String(error);
555
+ }
556
+ function bundledCatalog(options) {
557
+ return verifySignedCatalog(options.bundled ?? catalog_snapshot_default, options.keys ?? TRUSTED_CATALOG_KEYS);
558
+ }
559
+ function accept(document, floor, keys) {
560
+ let catalog;
561
+ try {
562
+ catalog = verifySignedCatalog(document, keys);
563
+ } catch (error) {
564
+ return { refused: message(error) };
565
+ }
566
+ if (catalog.version < floor) return { refused: `The model catalog is version ${catalog.version}, older than the ${floor} already held.` };
567
+ return { catalog };
568
+ }
569
+ function readCache(file2) {
570
+ try {
571
+ const parsed = JSON.parse(readFileSync(file2, "utf8"));
572
+ if (typeof parsed !== "object" || parsed === null) return void 0;
573
+ const { checkedAt, etag, document } = parsed;
574
+ if (typeof checkedAt !== "number" || document === void 0) return void 0;
575
+ return { checkedAt, document, ...typeof etag === "string" ? { etag } : {} };
576
+ } catch {
577
+ return void 0;
578
+ }
579
+ }
580
+ function loadCatalog(options = {}) {
581
+ const keys = options.keys ?? TRUSTED_CATALOG_KEYS;
582
+ const bundled = bundledCatalog(options);
583
+ const diagnostics = [];
584
+ const cache = readCache(options.cacheFile ?? catalogCacheFile());
585
+ if (cache) {
586
+ const result = accept(cache.document, bundled.version, keys);
587
+ if ("catalog" in result) return { catalog: result.catalog, source: "cache", diagnostics };
588
+ diagnostics.push(`Cached model catalog refused: ${result.refused}`);
589
+ }
590
+ return { catalog: bundled, source: "bundled", diagnostics };
591
+ }
592
+ async function refreshCatalog(options = {}) {
593
+ const file2 = options.cacheFile ?? catalogCacheFile();
594
+ const keys = options.keys ?? TRUSTED_CATALOG_KEYS;
595
+ const now = options.now ?? Date.now();
596
+ const loaded = loadCatalog(options);
597
+ const cache = loaded.source === "cache" ? readCache(file2) : void 0;
598
+ if (cache && now - cache.checkedAt < REFRESH_INTERVAL_MS) return { status: "fresh" };
599
+ try {
600
+ const response = await (options.fetch ?? fetch)(options.url ?? CATALOG_URL, {
601
+ headers: { Accept: "application/json", ...cache?.etag ? { "If-None-Match": cache.etag } : {} },
602
+ signal: AbortSignal.timeout(options.timeoutMs ?? REFRESH_TIMEOUT_MS)
603
+ });
604
+ if (response.status === 304 && cache) {
605
+ await writeCache(file2, { ...cache, checkedAt: now });
606
+ return { status: "not-modified", version: loaded.catalog.version };
607
+ }
608
+ if (!response.ok) return { status: "offline", diagnostic: `The model catalog server answered ${response.status}.` };
609
+ const document = JSON.parse(await response.text());
610
+ const result = accept(document, loaded.catalog.version, keys);
611
+ if ("refused" in result) return { status: "refused", diagnostic: result.refused };
612
+ const etag = response.headers.get("etag");
613
+ await writeCache(file2, { checkedAt: now, document, ...etag ? { etag } : {} });
614
+ return { status: "updated", version: result.catalog.version };
615
+ } catch (error) {
616
+ return { status: "offline", diagnostic: `The model catalog could not be refreshed: ${message(error)}` };
617
+ }
618
+ }
619
+ async function writeCache(file2, cache) {
620
+ await mkdir(dirname(file2), { recursive: true });
621
+ await atomicWriteFile(file2, `${JSON.stringify(cache)}
622
+ `, { durable: false });
623
+ }
624
+ var current;
625
+ var refreshing;
626
+ var refreshProblem;
627
+ function catalogModels() {
628
+ current ??= loadCatalog();
629
+ return current.catalog.models;
630
+ }
631
+ function catalogDiagnostics() {
632
+ current ??= loadCatalog();
633
+ return refreshProblem ? [...current.diagnostics, refreshProblem] : current.diagnostics;
634
+ }
635
+ function startCatalogRefresh() {
636
+ if (process.env.CLIKCODE_LOCAL_CATALOG_REFRESH === "0") return;
637
+ refreshing ??= refreshCatalog().then(noteRefresh);
638
+ }
639
+ function noteRefresh(result) {
640
+ if (result.status === "updated") current = loadCatalog();
641
+ if (result.status === "offline" || result.status === "refused") {
642
+ refreshProblem = result.status === "refused" ? `Model catalog update refused: ${result.diagnostic}` : result.diagnostic;
643
+ diagnostic("local-models.catalog-refresh", refreshProblem);
644
+ } else refreshProblem = void 0;
645
+ }
646
+
647
+ export {
648
+ localModelsHome,
649
+ runtimesDir,
650
+ modelsDir,
651
+ serversDir,
652
+ measurementsFile,
653
+ footprintsFile,
654
+ preferencesFile,
655
+ discoveredModelsFile,
656
+ tunedModelsFile,
657
+ fineTuneDir,
658
+ safeName,
659
+ TRUSTED_CATALOG_KEYS,
660
+ CATALOG_URL,
661
+ REFRESH_INTERVAL_MS,
662
+ loadCatalog,
663
+ refreshCatalog,
664
+ catalogModels,
665
+ catalogDiagnostics,
666
+ startCatalogRefresh,
667
+ noteRefresh
668
+ };
@@ -0,0 +1,27 @@
1
+ import { createRequire as __clikcodeCreateRequire } from 'node:module';
2
+ const require = __clikcodeCreateRequire(import.meta.url);
3
+ import {
4
+ TUNED_ID_PREFIX,
5
+ TUNED_REPO_PREFIX,
6
+ allLocalModels,
7
+ catalogModel,
8
+ localModelLabel,
9
+ registerRemoteModels,
10
+ resolveLocalModelId
11
+ } from "./chunk-TQDKJHWX.js";
12
+ import "./chunk-PEWCDI2C.js";
13
+ import "./chunk-TULAXS77.js";
14
+ import "./chunk-F6F47QAY.js";
15
+ import "./chunk-RDDWQBEM.js";
16
+ import "./chunk-MPAJ446F.js";
17
+ import "./chunk-CBANJFBO.js";
18
+ import "./chunk-PWXII6HF.js";
19
+ export {
20
+ TUNED_ID_PREFIX,
21
+ TUNED_REPO_PREFIX,
22
+ allLocalModels,
23
+ catalogModel,
24
+ localModelLabel,
25
+ registerRemoteModels,
26
+ resolveLocalModelId
27
+ };