@bendyline/gezel-inference 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -2
- package/dist/cache/adapter.d.ts +115 -0
- package/dist/cache/adapter.js +23 -0
- package/dist/cache/budget.d.ts +15 -0
- package/dist/cache/budget.js +31 -0
- package/dist/cache/controller.d.ts +205 -0
- package/dist/cache/controller.js +377 -0
- package/dist/catalog/LICENSE +21 -0
- package/dist/catalog/chat-models/bt/btl4-35b-q4/manifest.json +146 -0
- package/dist/catalog/chat-models/bt/btl4-35b-q4/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-35b-q4/versions/1.0.1/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/manifest.json +146 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.1/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.2/manifest.json +15 -0
- package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/manifest.json +166 -0
- package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/versions/1.1.0/manifest.json +62 -0
- package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/versions/1.1.1/manifest.json +61 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-mxfp4/manifest.json +125 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-mxfp4/versions/1.0.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/manifest.json +125 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/versions/1.0.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/versions/1.1.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2q4/manifest.json +126 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2q4/versions/1.0.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/manifest.json +318 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/versions/1.0.0/manifest.json +225 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/versions/1.1.0/manifest.json +225 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/manifest.json +249 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.0.0/manifest.json +70 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.0/manifest.json +72 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.2/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.3/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.2.0/manifest.json +98 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/manifest.json +228 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.0/manifest.json +72 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.2/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.3/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.1.0/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/manifest.json +220 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.1.0/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.0/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.1/manifest.json +80 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.2/manifest.json +80 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.3.0/manifest.json +81 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/manifest.json +226 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.1.0/manifest.json +80 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.1.1/manifest.json +82 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.0/manifest.json +82 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.1/manifest.json +95 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.2/manifest.json +95 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.3.0/manifest.json +86 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/manifest.json +213 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.1.0/manifest.json +67 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.1.2/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.2.0/manifest.json +71 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.2.1/manifest.json +71 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.3.0/manifest.json +71 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/manifest.json +205 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.1.0/manifest.json +72 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.1.2/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.2.0/manifest.json +76 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.2.1/manifest.json +76 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.3.0/manifest.json +76 -0
- package/dist/catalog/chat-models/gl/glm-5.2-754b-q2/manifest.json +127 -0
- package/dist/catalog/chat-models/gl/glm-5.2-754b-q2/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/manifest.json +140 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.0/manifest.json +23 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.1/manifest.json +26 -0
- package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/manifest.json +247 -0
- package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/versions/1.0.0/manifest.json +137 -0
- package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/versions/1.1.0/manifest.json +135 -0
- package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/manifest.json +195 -0
- package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/versions/1.1.0/manifest.json +72 -0
- package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/versions/1.1.1/manifest.json +71 -0
- package/dist/catalog/chat-models/gr/granite4.2-30b-q4/manifest.json +200 -0
- package/dist/catalog/chat-models/gr/granite4.2-30b-q4/versions/1.0.0/manifest.json +72 -0
- package/dist/catalog/chat-models/gr/granite4.2-3b-q4/manifest.json +196 -0
- package/dist/catalog/chat-models/gr/granite4.2-3b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/gr/granite4.2-8b-q4/manifest.json +189 -0
- package/dist/catalog/chat-models/gr/granite4.2-8b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/index.json +1 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/manifest.json +235 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.0/manifest.json +124 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.1/manifest.json +124 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.2/manifest.json +123 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/manifest.json +257 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/versions/1.0.0/manifest.json +145 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/versions/1.0.1/manifest.json +145 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/manifest.json +285 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.0/manifest.json +174 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.1/manifest.json +174 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.2/manifest.json +173 -0
- package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/manifest.json +162 -0
- package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/versions/1.0.0/manifest.json +59 -0
- package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/versions/1.0.1/manifest.json +58 -0
- package/dist/catalog/chat-models/ll/llama3.2-3b-q4/manifest.json +134 -0
- package/dist/catalog/chat-models/ll/llama3.2-3b-q4/versions/1.1.0/manifest.json +57 -0
- package/dist/catalog/chat-models/ll/llama3.2-3b-q4/versions/1.1.1/manifest.json +56 -0
- package/dist/catalog/chat-models/mi/minicpm5-1b-q4/manifest.json +156 -0
- package/dist/catalog/chat-models/mi/minicpm5-1b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/mi/minicpm5-2b-q4/manifest.json +161 -0
- package/dist/catalog/chat-models/mi/minicpm5-2b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/mi/mistral-7b-q4/manifest.json +159 -0
- package/dist/catalog/chat-models/mi/mistral-7b-q4/versions/1.1.0/manifest.json +62 -0
- package/dist/catalog/chat-models/mi/mistral-7b-q4/versions/1.1.1/manifest.json +61 -0
- package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/manifest.json +275 -0
- package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/versions/1.0.0/manifest.json +154 -0
- package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/versions/1.0.1/manifest.json +153 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/manifest.json +135 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.1/manifest.json +20 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.2/manifest.json +20 -0
- package/dist/catalog/chat-models/na/nanbeige4.2-3b-q4/manifest.json +138 -0
- package/dist/catalog/chat-models/na/nanbeige4.2-3b-q4/versions/1.0.0/manifest.json +14 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/manifest.json +212 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.0/manifest.json +94 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.1/manifest.json +94 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.2/manifest.json +93 -0
- package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/manifest.json +135 -0
- package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/versions/1.0.0/manifest.json +30 -0
- package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/versions/1.0.1/manifest.json +30 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/manifest.json +192 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/versions/1.0.0/manifest.json +74 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/versions/1.0.1/manifest.json +73 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/manifest.json +207 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/versions/1.0.0/manifest.json +89 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/versions/1.0.1/manifest.json +88 -0
- package/dist/catalog/chat-models/or/ornith-35b-q4/manifest.json +224 -0
- package/dist/catalog/chat-models/or/ornith-35b-q4/versions/1.0.0/manifest.json +94 -0
- package/dist/catalog/chat-models/or/ornith-35b-q4/versions/1.0.1/manifest.json +93 -0
- package/dist/catalog/chat-models/or/ornith-35b-q8/manifest.json +244 -0
- package/dist/catalog/chat-models/or/ornith-35b-q8/versions/1.0.0/manifest.json +114 -0
- package/dist/catalog/chat-models/or/ornith-35b-q8/versions/1.0.1/manifest.json +113 -0
- package/dist/catalog/chat-models/or/ornith-9b-q4/manifest.json +215 -0
- package/dist/catalog/chat-models/or/ornith-9b-q4/versions/1.0.0/manifest.json +84 -0
- package/dist/catalog/chat-models/or/ornith-9b-q4/versions/1.0.1/manifest.json +83 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q4/manifest.json +208 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q4/versions/1.0.0/manifest.json +74 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q8/manifest.json +223 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q8/versions/1.0.0/manifest.json +89 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q4/manifest.json +187 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q4/versions/1.0.0/manifest.json +53 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q4/versions/1.0.1/manifest.json +77 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q8/manifest.json +192 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q8/versions/1.0.0/manifest.json +58 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q8/versions/1.0.1/manifest.json +82 -0
- package/dist/catalog/chat-models/qw/qwen3.5-0.8b-q4/manifest.json +192 -0
- package/dist/catalog/chat-models/qw/qwen3.5-0.8b-q4/versions/1.0.0/manifest.json +75 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/manifest.json +315 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.0/manifest.json +164 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.1/manifest.json +164 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.2/manifest.json +164 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.3/manifest.json +163 -0
- package/dist/catalog/chat-models/qw/qwen3.5-27b-q4/manifest.json +217 -0
- package/dist/catalog/chat-models/qw/qwen3.5-27b-q4/versions/1.0.0/manifest.json +90 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/manifest.json +194 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.0/manifest.json +77 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.2/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.3/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/manifest.json +188 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.0/manifest.json +77 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.2/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.3/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/manifest.json +205 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.0/manifest.json +82 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.2/manifest.json +81 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.3/manifest.json +81 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/manifest.json +230 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.0/manifest.json +92 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.4/manifest.json +91 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.5/manifest.json +91 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.6/manifest.json +115 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/manifest.json +240 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.0/manifest.json +102 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.2/manifest.json +103 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.3/manifest.json +103 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.4/manifest.json +127 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/manifest.json +233 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.0/manifest.json +92 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.1/manifest.json +93 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.2/manifest.json +93 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.3/manifest.json +117 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/manifest.json +252 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.0/manifest.json +112 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.1/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.2/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.3/manifest.json +137 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-iq1-s/manifest.json +195 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-iq1-s/versions/1.0.0/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q2/manifest.json +194 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q2/versions/1.0.0/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/manifest.json +194 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/versions/1.0.0/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/versions/1.0.1/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/manifest.json +291 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.1/manifest.json +93 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.2/manifest.json +92 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.3/manifest.json +116 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.4/manifest.json +116 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.5/manifest.json +116 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/manifest.json +278 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.1/manifest.json +104 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.2/manifest.json +103 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.3/manifest.json +127 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/manifest.json +278 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.0/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.1/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.2/manifest.json +137 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq3/manifest.json +221 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq3/versions/1.0.0/manifest.json +36 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/manifest.json +429 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.0.0/manifest.json +36 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.1.0/manifest.json +205 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.1.1/manifest.json +244 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/manifest.json +203 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.0/manifest.json +21 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.1/manifest.json +31 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.2/manifest.json +30 -0
- package/dist/catalog/chat-models/raw-index.json +1 -0
- package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/manifest.json +79 -0
- package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/versions/1.0.1/manifest.json +15 -0
- package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/manifest.json +204 -0
- package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/versions/1.0.0/manifest.json +70 -0
- package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/versions/1.0.1/manifest.json +70 -0
- package/dist/catalog/chat-models/un/underdog-saluki-27b-iq2-mix/manifest.json +164 -0
- package/dist/catalog/chat-models/un/underdog-saluki-27b-iq2-mix/versions/1.0.0/manifest.json +14 -0
- package/dist/catalog/knowledge-catalogs/be/bendyline-how-to-books/manifest.json +26 -0
- package/dist/catalog/knowledge-catalogs/be/bendyline-how-to-books/versions/2026.10.8/manifest.json +8950 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-alaska-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-alaska-part-0001/versions/2026.10.1/manifest.json +658 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-nevada-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-nevada-part-0001/versions/2026.10.1/manifest.json +666 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-300-399-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-300-399-part-0001/versions/2026.10.2/manifest.json +182 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-347-349/manifest.json +25 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-347-349/versions/2026.10.5/manifest.json +38 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0001/versions/2026.10.1/manifest.json +558 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0002/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0002/versions/2026.10.1/manifest.json +258 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0001/versions/2026.10.1/manifest.json +318 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0002/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0002/versions/2026.10.1/manifest.json +266 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0003/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0003/versions/2026.10.1/manifest.json +186 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0004/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0004/versions/2026.10.1/manifest.json +138 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0005/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0005/versions/2026.10.1/manifest.json +138 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-wyoming-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-wyoming-part-0001/versions/2026.10.3/manifest.json +626 -0
- package/dist/catalog/knowledge-catalogs/index.json +1 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-aspnet-core-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-aspnet-core-en/versions/2026.10.16/manifest.json +18270 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-ai-platform-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-ai-platform-en/versions/2026.10.16/manifest.json +1098 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-apps-compute-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-apps-compute-en/versions/2026.10.16/manifest.json +722 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-data-aiot-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-data-aiot-en/versions/2026.10.16/manifest.json +530 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-management-hybrid-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-management-hybrid-en/versions/2026.10.16/manifest.json +602 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-network-security-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-network-security-en/versions/2026.10.16/manifest.json +250 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-dotnet-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-dotnet-en/versions/2026.10.16/manifest.json +16794 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-entity-framework-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-entity-framework-en/versions/2026.10.16/manifest.json +1106 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-microsoft-365-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-microsoft-365-en/versions/2026.10.16/manifest.json +234 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-powershell-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-powershell-en/versions/2026.10.16/manifest.json +522 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-sql-server-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-sql-server-en/versions/2026.10.16/manifest.json +1850 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-apps-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-apps-en/versions/2026.10.16/manifest.json +1734 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-server-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-server-en/versions/2026.10.16/manifest.json +774 -0
- package/dist/catalog/knowledge-catalogs/raw-index.json +1 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/manifest.json +28 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.2/manifest.json +53 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.3/manifest.json +885 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.5/manifest.json +157 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/manifest.json +32 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.2/manifest.json +69 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.3/manifest.json +741 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.5/manifest.json +173 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/manifest.json +69 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.4.4/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.4.5/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.4.4/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.3/manifest.json +925 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/manifest.json +28 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.2/manifest.json +53 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.3/manifest.json +1665 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.3/manifest.json +1233 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.5/manifest.json +141 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.3/manifest.json +493 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/manifest.json +63 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.4.4/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.4.5/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/manifest.json +30 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.2/manifest.json +61 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.3/manifest.json +665 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.5/manifest.json +177 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.3/manifest.json +745 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/manifest.json +62 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.4.4/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.4.5/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.4.4/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/manifest.json +30 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.2/manifest.json +61 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.3/manifest.json +1253 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.5/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.3/manifest.json +1957 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/manifest.json +63 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/versions/2026.4.5/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/manifest.json +45 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.4.4/manifest.json +121 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.4.5/manifest.json +173 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/manifest.json +62 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.4.4/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.4.5/manifest.json +189 -0
- package/dist/catalog/provenance.json +8 -0
- package/dist/chat/catalog-model-lookup.d.ts +21 -0
- package/dist/chat/catalog-model-lookup.js +48 -0
- package/dist/chat/local-model-tier.d.ts +1 -0
- package/dist/chat/local-model-tier.js +2 -0
- package/dist/chat/vision-capability.d.ts +1 -0
- package/dist/chat/vision-capability.js +3 -0
- package/dist/engine-components.d.ts +30 -0
- package/dist/engine-components.js +144 -0
- package/dist/engines/electron-native-reuse.d.ts +65 -0
- package/dist/engines/electron-native-reuse.js +305 -0
- package/dist/engines/native-file-manifest.json +1320 -0
- package/dist/engines/native-manifest.d.ts +70 -0
- package/dist/engines/native-manifest.js +98 -0
- package/dist/engines/registry.d.ts +88 -0
- package/dist/engines/registry.js +217 -0
- package/dist/engines/resolver.d.ts +121 -0
- package/dist/engines/resolver.js +894 -0
- package/dist/engines/signature.d.ts +85 -0
- package/dist/engines/signature.js +231 -0
- package/dist/fs/atomic.d.ts +53 -0
- package/dist/fs/atomic.js +202 -0
- package/dist/fs/config-store.d.ts +14 -0
- package/dist/fs/config-store.js +101 -0
- package/dist/fs/home-permissions.d.ts +18 -0
- package/dist/fs/home-permissions.js +27 -0
- package/dist/fs/safe-paths.d.ts +107 -0
- package/dist/fs/safe-paths.js +264 -0
- package/dist/fs/security-json.d.ts +13 -0
- package/dist/fs/security-json.js +67 -0
- package/dist/http/auth-context.d.ts +23 -0
- package/dist/http/auth-context.js +1 -0
- package/dist/http/engine-runtime-context.d.ts +30 -0
- package/dist/http/engine-runtime-context.js +1 -0
- package/dist/http/external-conversation-contract.d.ts +49 -0
- package/dist/http/external-conversation-contract.js +1 -0
- package/dist/http/external-conversation-headers.d.ts +11 -0
- package/dist/http/external-conversation-headers.js +11 -0
- package/dist/http/inference-context.d.ts +36 -0
- package/dist/http/inference-context.js +1 -0
- package/dist/http/model-inventory-cache.d.ts +8 -0
- package/dist/http/model-inventory-cache.js +8 -0
- package/dist/http/openai-compat/action-ledger.d.ts +15 -0
- package/dist/http/openai-compat/action-ledger.js +119 -0
- package/dist/http/openai-compat/apple-model.d.ts +3 -0
- package/dist/http/openai-compat/apple-model.js +44 -0
- package/dist/http/openai-compat/caller-owned-profile.d.ts +7 -0
- package/dist/http/openai-compat/caller-owned-profile.js +18 -0
- package/dist/http/openai-compat/chat-progress.d.ts +9 -0
- package/dist/http/openai-compat/chat-progress.js +69 -0
- package/dist/http/openai-compat/chat-target.d.ts +76 -0
- package/dist/http/openai-compat/chat-target.js +97 -0
- package/dist/http/openai-compat/embeddings.d.ts +37 -0
- package/dist/http/openai-compat/embeddings.js +86 -0
- package/dist/http/openai-compat/request-tuning.d.ts +35 -0
- package/dist/http/openai-compat/request-tuning.js +87 -0
- package/dist/http/openai-compat/responses-streaming.d.ts +351 -0
- package/dist/http/openai-compat/responses-streaming.js +717 -0
- package/dist/http/openai-compat/responses-translate.d.ts +215 -0
- package/dist/http/openai-compat/responses-translate.js +377 -0
- package/dist/http/openai-compat/streaming-telemetry.d.ts +30 -0
- package/dist/http/openai-compat/streaming-telemetry.js +88 -0
- package/dist/http/openai-compat/streaming.d.ts +141 -0
- package/dist/http/openai-compat/streaming.js +687 -0
- package/dist/http/openai-compat/tool-call-stream-filter.d.ts +33 -0
- package/dist/http/openai-compat/tool-call-stream-filter.js +110 -0
- package/dist/http/openai-compat/translate.d.ts +254 -0
- package/dist/http/openai-compat/translate.js +485 -0
- package/dist/http/routes/engines.d.ts +13 -0
- package/dist/http/routes/engines.js +366 -0
- package/dist/http/routes/machine-engine-proxy.d.ts +26 -0
- package/dist/http/routes/machine-engine-proxy.js +43 -0
- package/dist/http/routes/model-bundles.d.ts +4 -0
- package/dist/http/routes/model-bundles.js +190 -0
- package/dist/http/routes/v1-chat.d.ts +72 -0
- package/dist/http/routes/v1-chat.js +645 -0
- package/dist/http/routes/v1-embeddings.d.ts +3 -0
- package/dist/http/routes/v1-embeddings.js +82 -0
- package/dist/http/routes/v1-knowledge.d.ts +4 -0
- package/dist/http/routes/v1-knowledge.js +304 -0
- package/dist/http/routes/v1-models-ensure.d.ts +32 -0
- package/dist/http/routes/v1-models-ensure.js +122 -0
- package/dist/http/routes/v1-models.d.ts +8 -0
- package/dist/http/routes/v1-models.js +189 -0
- package/dist/http/routes/v1-responses.d.ts +20 -0
- package/dist/http/routes/v1-responses.js +327 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/inference-service.d.ts +28 -0
- package/dist/inference-service.js +275 -0
- package/dist/knowledge/admission.d.ts +3 -0
- package/dist/knowledge/admission.js +22 -0
- package/dist/knowledge/bundled-catalog.d.ts +2 -0
- package/dist/knowledge/bundled-catalog.js +2 -0
- package/dist/knowledge/catalog-host.d.ts +103 -0
- package/dist/knowledge/catalog-host.js +180 -0
- package/dist/knowledge/catalog-source.d.ts +22 -0
- package/dist/knowledge/catalog-source.js +35 -0
- package/dist/knowledge/install.d.ts +55 -0
- package/dist/knowledge/install.js +274 -0
- package/dist/knowledge/manager.d.ts +287 -0
- package/dist/knowledge/manager.js +1540 -0
- package/dist/knowledge/registry.d.ts +35 -0
- package/dist/knowledge/registry.js +123 -0
- package/dist/knowledge/search-worker.d.ts +17 -0
- package/dist/knowledge/search-worker.js +36 -0
- package/dist/knowledge/shared-install-contract.d.ts +19 -0
- package/dist/knowledge/shared-install-contract.js +1 -0
- package/dist/knowledge/spatial-query.d.ts +11 -0
- package/dist/knowledge/spatial-query.js +33 -0
- package/dist/knowledge/trust-anchors.d.ts +11 -0
- package/dist/knowledge/trust-anchors.js +51 -0
- package/dist/knowledge/vector-floors.d.ts +44 -0
- package/dist/knowledge/vector-floors.js +92 -0
- package/dist/knowledge/worker-host.d.ts +9 -0
- package/dist/knowledge/worker-host.js +179 -0
- package/dist/kokoro-lexicon/LICENSE +202 -0
- package/dist/kokoro-lexicon/lexicon-gb-en.txt.gz +0 -0
- package/dist/kokoro-lexicon/lexicon-us-en.txt.gz +0 -0
- package/dist/kokoro-lexicon/manifest.json +23 -0
- package/dist/machine-engine/inspect-runtime.d.ts +3 -0
- package/dist/machine-engine/inspect-runtime.js +48 -0
- package/dist/machine-engine/knowledge-assets.d.ts +79 -0
- package/dist/machine-engine/knowledge-assets.js +505 -0
- package/dist/memory/embed-core.d.ts +131 -0
- package/dist/memory/embed-core.js +398 -0
- package/dist/memory/embed-worker.d.ts +23 -0
- package/dist/memory/embed-worker.js +49 -0
- package/dist/memory/embeddings.d.ts +105 -0
- package/dist/memory/embeddings.js +467 -0
- package/dist/model-profile/behaviors/tools-mlx-template-fix.d.ts +1 -0
- package/dist/model-profile/behaviors/tools-mlx-template-fix.js +2 -0
- package/dist/model-profile/behaviors/turn-ramble-detection.d.ts +1 -0
- package/dist/model-profile/behaviors/turn-ramble-detection.js +2 -0
- package/dist/model-profile/defaults.d.ts +1 -0
- package/dist/model-profile/defaults.js +2 -0
- package/dist/model-profile/index.d.ts +9 -0
- package/dist/model-profile/index.js +7 -0
- package/dist/model-profile/registry.d.ts +15 -0
- package/dist/model-profile/registry.js +18 -0
- package/dist/model-profile/runtime.d.ts +48 -0
- package/dist/model-profile/runtime.js +131 -0
- package/dist/model-profile/tool-grammar.d.ts +1 -0
- package/dist/model-profile/tool-grammar.js +2 -0
- package/dist/model-profile/tuning.d.ts +19 -0
- package/dist/model-profile/tuning.js +21 -0
- package/dist/model-profile/types.d.ts +1 -0
- package/dist/model-profile/types.js +2 -0
- package/dist/models/bundle-storage.d.ts +28 -0
- package/dist/models/bundle-storage.js +80 -0
- package/dist/models/catalog-drift.d.ts +48 -0
- package/dist/models/catalog-drift.js +94 -0
- package/dist/models/catalog-payload-identity.d.ts +107 -0
- package/dist/models/catalog-payload-identity.js +254 -0
- package/dist/models/ensure.d.ts +125 -0
- package/dist/models/ensure.js +205 -0
- package/dist/models/gezmodel.d.ts +47 -0
- package/dist/models/gezmodel.js +742 -0
- package/dist/models/install-registry.d.ts +101 -0
- package/dist/models/install-registry.js +216 -0
- package/dist/models/model-id.d.ts +22 -0
- package/dist/models/model-id.js +40 -0
- package/dist/models/storage-roots.d.ts +274 -0
- package/dist/models/storage-roots.js +865 -0
- package/dist/native-release-entry.d.ts +16 -0
- package/dist/native-release-entry.js +16 -0
- package/dist/perf/redact-path.d.ts +2 -0
- package/dist/perf/redact-path.js +27 -0
- package/dist/perf/responsiveness.d.ts +70 -0
- package/dist/perf/responsiveness.js +560 -0
- package/dist/providers/active-install-message.d.ts +42 -0
- package/dist/providers/active-install-message.js +49 -0
- package/dist/providers/apple-foundation-models/binary.d.ts +4 -0
- package/dist/providers/apple-foundation-models/binary.js +18 -0
- package/dist/providers/apple-foundation-models/helper.d.ts +66 -0
- package/dist/providers/apple-foundation-models/helper.js +262 -0
- package/dist/providers/apple-foundation-models/provider.d.ts +82 -0
- package/dist/providers/apple-foundation-models/provider.js +389 -0
- package/dist/providers/apple-foundation-models/status.d.ts +9 -0
- package/dist/providers/apple-foundation-models/status.js +49 -0
- package/dist/providers/audio/kokoro-frontend.d.ts +50 -0
- package/dist/providers/audio/kokoro-frontend.js +113 -0
- package/dist/providers/audio/managed-speech-model.d.ts +9 -0
- package/dist/providers/audio/managed-speech-model.js +86 -0
- package/dist/providers/audio/types.d.ts +202 -0
- package/dist/providers/audio/types.js +17 -0
- package/dist/providers/audio/whisper-cpp.d.ts +99 -0
- package/dist/providers/audio/whisper-cpp.js +420 -0
- package/dist/providers/audio-persister-contract.d.ts +13 -0
- package/dist/providers/audio-persister-contract.js +1 -0
- package/dist/providers/catalog-model-config.d.ts +63 -0
- package/dist/providers/catalog-model-config.js +95 -0
- package/dist/providers/code-block-salvage.d.ts +1 -0
- package/dist/providers/code-block-salvage.js +2 -0
- package/dist/providers/codex-cli/reasoning.d.ts +8 -0
- package/dist/providers/codex-cli/reasoning.js +17 -0
- package/dist/providers/complete-tool-call.d.ts +16 -0
- package/dist/providers/complete-tool-call.js +25 -0
- package/dist/providers/constrained-turn.d.ts +1 -0
- package/dist/providers/constrained-turn.js +2 -0
- package/dist/providers/deliverable-read-pacing.d.ts +1 -0
- package/dist/providers/deliverable-read-pacing.js +2 -0
- package/dist/providers/direct-file-work-prompt.d.ts +1 -0
- package/dist/providers/direct-file-work-prompt.js +2 -0
- package/dist/providers/ds4/build-provider.d.ts +100 -0
- package/dist/providers/ds4/build-provider.js +539 -0
- package/dist/providers/ds4/cache-adapter.d.ts +42 -0
- package/dist/providers/ds4/cache-adapter.js +110 -0
- package/dist/providers/ds4/dspark.d.ts +83 -0
- package/dist/providers/ds4/dspark.js +107 -0
- package/dist/providers/ds4/mtp.d.ts +32 -0
- package/dist/providers/ds4/mtp.js +46 -0
- package/dist/providers/ds4/provider.d.ts +67 -0
- package/dist/providers/ds4/provider.js +104 -0
- package/dist/providers/ds4/residency.d.ts +143 -0
- package/dist/providers/ds4/residency.js +139 -0
- package/dist/providers/ds4/stdout-parser.d.ts +47 -0
- package/dist/providers/ds4/stdout-parser.js +134 -0
- package/dist/providers/duplicate-tool-calls.d.ts +1 -0
- package/dist/providers/duplicate-tool-calls.js +2 -0
- package/dist/providers/file-repair-policy.d.ts +1 -0
- package/dist/providers/file-repair-policy.js +2 -0
- package/dist/providers/gpu-arbiter.d.ts +159 -0
- package/dist/providers/gpu-arbiter.js +301 -0
- package/dist/providers/image-persister-contract.d.ts +15 -0
- package/dist/providers/image-persister-contract.js +1 -0
- package/dist/providers/llama-cpp/build-metadata.d.ts +13 -0
- package/dist/providers/llama-cpp/build-metadata.js +39 -0
- package/dist/providers/llama-cpp/build-provider.d.ts +66 -0
- package/dist/providers/llama-cpp/build-provider.js +1491 -0
- package/dist/providers/llama-cpp/cache-adapter.d.ts +242 -0
- package/dist/providers/llama-cpp/cache-adapter.js +689 -0
- package/dist/providers/llama-cpp/devices.d.ts +130 -0
- package/dist/providers/llama-cpp/devices.js +256 -0
- package/dist/providers/llama-cpp/disk-cache.d.ts +8 -0
- package/dist/providers/llama-cpp/disk-cache.js +112 -0
- package/dist/providers/llama-cpp/engine-flags.d.ts +181 -0
- package/dist/providers/llama-cpp/engine-flags.js +279 -0
- package/dist/providers/llama-cpp/gguf-metadata-async.d.ts +11 -0
- package/dist/providers/llama-cpp/gguf-metadata-async.js +180 -0
- package/dist/providers/llama-cpp/gguf-metadata-worker.d.ts +7 -0
- package/dist/providers/llama-cpp/gguf-metadata-worker.js +27 -0
- package/dist/providers/llama-cpp/gguf-metadata.d.ts +198 -0
- package/dist/providers/llama-cpp/gguf-metadata.js +615 -0
- package/dist/providers/llama-cpp/gguf-quantization-backfill.d.ts +32 -0
- package/dist/providers/llama-cpp/gguf-quantization-backfill.js +75 -0
- package/dist/providers/llama-cpp/index.d.ts +10 -0
- package/dist/providers/llama-cpp/index.js +13 -0
- package/dist/providers/llama-cpp/kv-cache-type.d.ts +118 -0
- package/dist/providers/llama-cpp/kv-cache-type.js +140 -0
- package/dist/providers/llama-cpp/log.d.ts +92 -0
- package/dist/providers/llama-cpp/log.js +280 -0
- package/dist/providers/llama-cpp/models.d.ts +389 -0
- package/dist/providers/llama-cpp/models.js +1011 -0
- package/dist/providers/llama-cpp/offload-planner.d.ts +339 -0
- package/dist/providers/llama-cpp/offload-planner.js +524 -0
- package/dist/providers/llama-cpp/provider.d.ts +493 -0
- package/dist/providers/llama-cpp/provider.js +862 -0
- package/dist/providers/llama-cpp/reasoning-launch.d.ts +7 -0
- package/dist/providers/llama-cpp/reasoning-launch.js +14 -0
- package/dist/providers/llama-cpp/spec-draft.d.ts +44 -0
- package/dist/providers/llama-cpp/spec-draft.js +44 -0
- package/dist/providers/llama-cpp/stdout-parser.d.ts +70 -0
- package/dist/providers/llama-cpp/stdout-parser.js +197 -0
- package/dist/providers/local-tool-call-salvage.d.ts +1 -0
- package/dist/providers/local-tool-call-salvage.js +2 -0
- package/dist/providers/local-turn-policy.d.ts +1 -0
- package/dist/providers/local-turn-policy.js +2 -0
- package/dist/providers/mlx/async-file-handoff.d.ts +11 -0
- package/dist/providers/mlx/async-file-handoff.js +25 -0
- package/dist/providers/mlx/build-provider.d.ts +65 -0
- package/dist/providers/mlx/build-provider.js +717 -0
- package/dist/providers/mlx/cache-adapter.d.ts +161 -0
- package/dist/providers/mlx/cache-adapter.js +445 -0
- package/dist/providers/mlx/chat-protocol.d.ts +48 -0
- package/dist/providers/mlx/chat-protocol.js +8 -0
- package/dist/providers/mlx/config-parser.d.ts +29 -0
- package/dist/providers/mlx/config-parser.js +81 -0
- package/dist/providers/mlx/engine-gate.d.ts +51 -0
- package/dist/providers/mlx/engine-gate.js +207 -0
- package/dist/providers/mlx/engine-hold.d.ts +41 -0
- package/dist/providers/mlx/engine-hold.js +59 -0
- package/dist/providers/mlx/engine-log-router.d.ts +84 -0
- package/dist/providers/mlx/engine-log-router.js +137 -0
- package/dist/providers/mlx/engine-stats-sampler.d.ts +36 -0
- package/dist/providers/mlx/engine-stats-sampler.js +59 -0
- package/dist/providers/mlx/index.d.ts +10 -0
- package/dist/providers/mlx/index.js +10 -0
- package/dist/providers/mlx/log.d.ts +55 -0
- package/dist/providers/mlx/log.js +157 -0
- package/dist/providers/mlx/model-geometry.d.ts +35 -0
- package/dist/providers/mlx/model-geometry.js +118 -0
- package/dist/providers/mlx/models.d.ts +289 -0
- package/dist/providers/mlx/models.js +1079 -0
- package/dist/providers/mlx/provider.d.ts +404 -0
- package/dist/providers/mlx/provider.js +3017 -0
- package/dist/providers/mlx/python/cache_persist.py +348 -0
- package/dist/providers/mlx/python/cache_seed.py +402 -0
- package/dist/providers/mlx/python/gezel_mlx_server.py +4491 -0
- package/dist/providers/mlx/python/lfm2_compat.py +55 -0
- package/dist/providers/mlx/python/qwen3_5_text_compat.py +60 -0
- package/dist/providers/mlx/python/qwen4_ple.py +159 -0
- package/dist/providers/mlx/python/spec_decode.py +775 -0
- package/dist/providers/mlx/python/template_stability.py +133 -0
- package/dist/providers/mlx/python/think_budget.py +113 -0
- package/dist/providers/mlx/python/tool_args_json.py +297 -0
- package/dist/providers/mlx/python/tool_call_stream.py +265 -0
- package/dist/providers/mlx/python/tool_grammar.py +794 -0
- package/dist/providers/mlx/python/vision_inputs.py +64 -0
- package/dist/providers/mlx/python/wave_policy.py +147 -0
- package/dist/providers/mlx/reasoning-stream.d.ts +85 -0
- package/dist/providers/mlx/reasoning-stream.js +196 -0
- package/dist/providers/mlx/request-shape.d.ts +34 -0
- package/dist/providers/mlx/request-shape.js +42 -0
- package/dist/providers/mlx/runtime-diagnostics.d.ts +29 -0
- package/dist/providers/mlx/runtime-diagnostics.js +162 -0
- package/dist/providers/mlx/spec-drafter.d.ts +25 -0
- package/dist/providers/mlx/spec-drafter.js +73 -0
- package/dist/providers/mlx/stdout-parser.d.ts +60 -0
- package/dist/providers/mlx/stdout-parser.js +254 -0
- package/dist/providers/mlx/textual-tool-call-salvage.d.ts +46 -0
- package/dist/providers/mlx/textual-tool-call-salvage.js +396 -0
- package/dist/providers/mlx/tool-call-protocol.d.ts +65 -0
- package/dist/providers/mlx/tool-call-protocol.js +140 -0
- package/dist/providers/mlx/tool-call-stripper.d.ts +68 -0
- package/dist/providers/mlx/tool-call-stripper.js +153 -0
- package/dist/providers/mlx/tool-image-retention.d.ts +23 -0
- package/dist/providers/mlx/tool-image-retention.js +43 -0
- package/dist/providers/mlx/turn-telemetry.d.ts +22 -0
- package/dist/providers/mlx/turn-telemetry.js +45 -0
- package/dist/providers/mlx/venv.d.ts +91 -0
- package/dist/providers/mlx/venv.js +111 -0
- package/dist/providers/mlx/vision-mode.d.ts +92 -0
- package/dist/providers/mlx/vision-mode.js +187 -0
- package/dist/providers/mlx/vision.d.ts +2 -0
- package/dist/providers/mlx/vision.js +12 -0
- package/dist/providers/mlx/wire-transcript.d.ts +14 -0
- package/dist/providers/mlx/wire-transcript.js +43 -0
- package/dist/providers/native/capacity-broker.d.ts +812 -0
- package/dist/providers/native/capacity-broker.js +1058 -0
- package/dist/providers/native/capacity-budget.d.ts +133 -0
- package/dist/providers/native/capacity-budget.js +265 -0
- package/dist/providers/native/device-capacity-ledger.d.ts +31 -0
- package/dist/providers/native/device-capacity-ledger.js +196 -0
- package/dist/providers/native/device-capacity.d.ts +84 -0
- package/dist/providers/native/device-capacity.js +431 -0
- package/dist/providers/native/engine-api-key.d.ts +57 -0
- package/dist/providers/native/engine-api-key.js +72 -0
- package/dist/providers/native/engine-key.d.ts +18 -0
- package/dist/providers/native/engine-key.js +41 -0
- package/dist/providers/native/engine-router.d.ts +145 -0
- package/dist/providers/native/engine-router.js +191 -0
- package/dist/providers/native/gpu-panic-guard.d.ts +54 -0
- package/dist/providers/native/gpu-panic-guard.js +59 -0
- package/dist/providers/native/inference.d.ts +33 -0
- package/dist/providers/native/inference.js +49 -0
- package/dist/providers/native/local-engine-runtime.d.ts +412 -0
- package/dist/providers/native/local-engine-runtime.js +1714 -0
- package/dist/providers/native/measured-budget.d.ts +32 -0
- package/dist/providers/native/measured-budget.js +54 -0
- package/dist/providers/native/port.d.ts +11 -0
- package/dist/providers/native/port.js +29 -0
- package/dist/providers/native/provider-pool.d.ts +474 -0
- package/dist/providers/native/provider-pool.js +1166 -0
- package/dist/providers/native/supervisor.d.ts +503 -0
- package/dist/providers/native/supervisor.js +1466 -0
- package/dist/providers/observation-context.d.ts +16 -0
- package/dist/providers/observation-context.js +1 -0
- package/dist/providers/openai-compatible/sse.d.ts +1 -0
- package/dist/providers/openai-compatible/sse.js +2 -0
- package/dist/providers/patient-fetch.d.ts +36 -0
- package/dist/providers/patient-fetch.js +44 -0
- package/dist/providers/project-macro-loop-bail.d.ts +7 -0
- package/dist/providers/project-macro-loop-bail.js +21 -0
- package/dist/providers/prose-document-salvage.d.ts +1 -0
- package/dist/providers/prose-document-salvage.js +2 -0
- package/dist/providers/provider-disposal.d.ts +1 -0
- package/dist/providers/provider-disposal.js +2 -0
- package/dist/providers/queue.d.ts +15 -0
- package/dist/providers/queue.js +23 -0
- package/dist/providers/ramble-abort-message.d.ts +1 -0
- package/dist/providers/ramble-abort-message.js +2 -0
- package/dist/providers/ramble-detector.d.ts +1 -0
- package/dist/providers/ramble-detector.js +2 -0
- package/dist/providers/reasoning-depth.d.ts +1 -0
- package/dist/providers/reasoning-depth.js +2 -0
- package/dist/providers/required-input-reads.d.ts +1 -0
- package/dist/providers/required-input-reads.js +2 -0
- package/dist/providers/session-defaults.d.ts +13 -0
- package/dist/providers/session-defaults.js +49 -0
- package/dist/providers/session-hooks.d.ts +26 -0
- package/dist/providers/session-hooks.js +1 -0
- package/dist/providers/streaming-session.d.ts +1 -0
- package/dist/providers/streaming-session.js +2 -0
- package/dist/providers/terminal-tool-policy.d.ts +1 -0
- package/dist/providers/terminal-tool-policy.js +2 -0
- package/dist/providers/tool-arg-schema-coercion.d.ts +1 -0
- package/dist/providers/tool-arg-schema-coercion.js +2 -0
- package/dist/providers/tool-executor.d.ts +12 -0
- package/dist/providers/tool-executor.js +20 -0
- package/dist/providers/tool-failure-tracker.d.ts +1 -0
- package/dist/providers/tool-failure-tracker.js +2 -0
- package/dist/providers/tool-repeat-tracker.d.ts +1 -0
- package/dist/providers/tool-repeat-tracker.js +2 -0
- package/dist/providers/turn-timeout.d.ts +1 -0
- package/dist/providers/turn-timeout.js +1 -0
- package/dist/providers/types.d.ts +834 -0
- package/dist/providers/types.js +42 -0
- package/dist/providers/usage-builder.d.ts +1 -0
- package/dist/providers/usage-builder.js +2 -0
- package/dist/providers/vision-capability.d.ts +109 -0
- package/dist/providers/vision-capability.js +137 -0
- package/dist/python/mlx-runtime-status-bus.d.ts +39 -0
- package/dist/python/mlx-runtime-status-bus.js +27 -0
- package/dist/python/uv-runtime.d.ts +176 -0
- package/dist/python/uv-runtime.js +492 -0
- package/dist/relevance/install.d.ts +28 -0
- package/dist/relevance/install.js +114 -0
- package/dist/relevance/manager.d.ts +79 -0
- package/dist/relevance/manager.js +211 -0
- package/dist/relevance/registry.d.ts +11 -0
- package/dist/relevance/registry.js +158 -0
- package/dist/relevance/relevance-core.d.ts +67 -0
- package/dist/relevance/relevance-core.js +189 -0
- package/dist/relevance/relevance-model.d.ts +42 -0
- package/dist/relevance/relevance-model.js +292 -0
- package/dist/relevance/relevance-worker.d.ts +20 -0
- package/dist/relevance/relevance-worker.js +57 -0
- package/dist/relevance/settings.d.ts +30 -0
- package/dist/relevance/settings.js +81 -0
- package/dist/remotes/identity.d.ts +121 -0
- package/dist/remotes/identity.js +348 -0
- package/dist/remotes/pinned-fetch.d.ts +45 -0
- package/dist/remotes/pinned-fetch.js +193 -0
- package/dist/remotes/types.d.ts +54 -0
- package/dist/remotes/types.js +1 -0
- package/dist/runtime-lock.d.ts +29 -0
- package/dist/runtime-lock.js +85 -0
- package/dist/search/relevance-stage.d.ts +81 -0
- package/dist/search/relevance-stage.js +177 -0
- package/dist/secrets/types.d.ts +63 -0
- package/dist/secrets/types.js +64 -0
- package/dist/speech.d.ts +1 -0
- package/dist/speech.js +1 -0
- package/dist/system/darwin-memory.d.ts +26 -0
- package/dist/system/darwin-memory.js +81 -0
- package/dist/system/gezel-process-memory.d.ts +55 -0
- package/dist/system/gezel-process-memory.js +156 -0
- package/dist/system/memory.d.ts +154 -0
- package/dist/system/memory.js +501 -0
- package/dist/transformers-cache.d.ts +112 -0
- package/dist/transformers-cache.js +392 -0
- package/dist/utils/disk-space.d.ts +55 -0
- package/dist/utils/disk-space.js +72 -0
- package/dist/utils/download-common.d.ts +138 -0
- package/dist/utils/download-common.js +196 -0
- package/dist/utils/download-with-retry.d.ts +85 -0
- package/dist/utils/download-with-retry.js +522 -0
- package/dist/utils/extract-zip.d.ts +22 -0
- package/dist/utils/extract-zip.js +103 -0
- package/dist/utils/retire-model-worker.d.ts +15 -0
- package/dist/utils/retire-model-worker.js +24 -0
- package/dist/utils/service-worker-entry.d.ts +59 -0
- package/dist/utils/service-worker-entry.js +69 -0
- package/dist/utils/xet-download.d.ts +40 -0
- package/dist/utils/xet-download.js +526 -0
- package/dist/utils/xet.d.ts +86 -0
- package/dist/utils/xet.js +201 -0
- package/package.json +103 -3
- package/scripts/embedding-packaging.cjs +264 -0
- package/scripts/embedding-packaging.d.cts +16 -0
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { createReadStream, createWriteStream } from 'node:fs';
|
|
3
|
+
import { mkdir, open, readFile, readdir, rm, stat, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { basename, dirname, extname, join } from 'node:path';
|
|
5
|
+
import { Transform } from 'node:stream';
|
|
6
|
+
import { pipeline } from 'node:stream/promises';
|
|
7
|
+
import { ChatModelIdentitySchema, ChatModelManifestSchema, ChatModelVersionManifestSchema, GezmodelBundleManifestSchema, GezmodelImportReviewSchema, } from '@bendyline/gezel';
|
|
8
|
+
import * as yauzl from 'yauzl';
|
|
9
|
+
import * as yazl from 'yazl';
|
|
10
|
+
import { safeJoin } from '../fs/safe-paths.js';
|
|
11
|
+
import { safeBundleModelPath } from './bundle-storage.js';
|
|
12
|
+
import { MODEL_HASH_READ_BUFFER_BYTES } from './storage-roots.js';
|
|
13
|
+
const MAX_ARCHIVE_BYTES = 2 * 1024 ** 4; // 2 TiB compressed upload ceiling.
|
|
14
|
+
const MAX_ENTRIES = 16_384;
|
|
15
|
+
const MAX_TOTAL_UNCOMPRESSED_BYTES = 2 * 1024 ** 4;
|
|
16
|
+
const MAX_ENTRY_UNCOMPRESSED_BYTES = 2 * 1024 ** 4;
|
|
17
|
+
const MAX_COMPRESSION_RATIO = 200;
|
|
18
|
+
const MAX_MANIFEST_BYTES = 4 * 1024 * 1024;
|
|
19
|
+
const IMPORT_TTL_MS = 24 * 60 * 60_000;
|
|
20
|
+
const SCAN_YIELD_BYTES = 16 * 1024 * 1024;
|
|
21
|
+
const BLOCKED_EXTENSIONS = new Set([
|
|
22
|
+
'.app',
|
|
23
|
+
'.bat',
|
|
24
|
+
'.bin',
|
|
25
|
+
'.cmd',
|
|
26
|
+
'.com',
|
|
27
|
+
'.cpl',
|
|
28
|
+
'.dll',
|
|
29
|
+
'.dylib',
|
|
30
|
+
'.exe',
|
|
31
|
+
'.js',
|
|
32
|
+
'.mjs',
|
|
33
|
+
'.cjs',
|
|
34
|
+
'.msi',
|
|
35
|
+
'.ps1',
|
|
36
|
+
'.py',
|
|
37
|
+
'.scr',
|
|
38
|
+
'.sh',
|
|
39
|
+
'.so',
|
|
40
|
+
'.vbs',
|
|
41
|
+
]);
|
|
42
|
+
export class GezmodelManager {
|
|
43
|
+
importsRoot;
|
|
44
|
+
catalog;
|
|
45
|
+
owners;
|
|
46
|
+
constructor(opts) {
|
|
47
|
+
this.importsRoot = join(opts.home, '.transactions', 'gezmodel-imports');
|
|
48
|
+
this.catalog = opts.catalog;
|
|
49
|
+
this.owners = {
|
|
50
|
+
'llama-cpp': opts.llamaCpp,
|
|
51
|
+
mlx: opts.mlx,
|
|
52
|
+
ds4: opts.ds4,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** Hash model files, buffer the small manifests, then stream the ZIP payload. */
|
|
56
|
+
async export(engine, id) {
|
|
57
|
+
const owner = this.owner(engine);
|
|
58
|
+
const source = await owner.getModelBundleSource(id);
|
|
59
|
+
const detail = (source.catalogVersion
|
|
60
|
+
? await this.catalog.get('chat-model', id, undefined, source.catalogVersion)
|
|
61
|
+
: null) ?? (await this.catalog.get('chat-model', id));
|
|
62
|
+
if (!detail || detail.manifest.kind !== 'chat-model') {
|
|
63
|
+
throw new Error(`catalog manifest for model "${id}" is unavailable`);
|
|
64
|
+
}
|
|
65
|
+
const buffers = new Map();
|
|
66
|
+
buffers.set('manifests/installed.json', Buffer.from(`${JSON.stringify(source.installedManifest, null, 2)}\n`, 'utf8'));
|
|
67
|
+
buffers.set('manifests/catalog.json', Buffer.from(`${JSON.stringify(detail.manifest, null, 2)}\n`, 'utf8'));
|
|
68
|
+
// Preserve Gezel's exact identity + selected-version manifest files when
|
|
69
|
+
// the catalog source exposes them. The resolved snapshot above remains the
|
|
70
|
+
// authoritative import/review shape when a synthetic source has no files.
|
|
71
|
+
const wantedCatalogRels = new Set([
|
|
72
|
+
'manifest.json',
|
|
73
|
+
`versions/${source.catalogVersion ?? detail.manifest.version}/manifest.json`,
|
|
74
|
+
]);
|
|
75
|
+
const catalogRels = await this.catalog.listItemFiles('chat-model', id, detail.sourceId);
|
|
76
|
+
for (const rel of catalogRels) {
|
|
77
|
+
if (!wantedCatalogRels.has(rel))
|
|
78
|
+
continue;
|
|
79
|
+
const content = await this.catalog.readItemFile('chat-model', id, rel, detail.sourceId);
|
|
80
|
+
if (!content)
|
|
81
|
+
continue;
|
|
82
|
+
buffers.set(`catalog/chat-models/${id.slice(0, 2).toLowerCase()}/${id}/${rel}`, content);
|
|
83
|
+
}
|
|
84
|
+
const files = [];
|
|
85
|
+
for (const rel of source.modelFiles) {
|
|
86
|
+
const full = safeBundleModelPath(source.modelDir, rel);
|
|
87
|
+
const info = await stat(full);
|
|
88
|
+
if (!info.isFile())
|
|
89
|
+
throw new Error(`model entry is not a regular file: ${rel}`);
|
|
90
|
+
files.push({
|
|
91
|
+
path: `model/${rel}`,
|
|
92
|
+
sizeBytes: info.size,
|
|
93
|
+
sha256: await hashFile(full),
|
|
94
|
+
role: 'model',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
for (const [path, content] of buffers) {
|
|
98
|
+
files.push({
|
|
99
|
+
path,
|
|
100
|
+
sizeBytes: content.byteLength,
|
|
101
|
+
sha256: createHash('sha256').update(content).digest('hex'),
|
|
102
|
+
role: path === 'manifests/installed.json'
|
|
103
|
+
? 'installed-manifest'
|
|
104
|
+
: path === 'manifests/catalog.json'
|
|
105
|
+
? 'catalog-manifest'
|
|
106
|
+
: 'catalog-file',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
files.sort((a, b) => a.path.localeCompare(b.path));
|
|
110
|
+
const modelBytes = files
|
|
111
|
+
.filter((file) => file.role === 'model')
|
|
112
|
+
.reduce((sum, file) => sum + file.sizeBytes, 0);
|
|
113
|
+
const manifest = {
|
|
114
|
+
schemaVersion: 1,
|
|
115
|
+
kind: 'gezel-model',
|
|
116
|
+
id,
|
|
117
|
+
name: source.name,
|
|
118
|
+
engine,
|
|
119
|
+
createdAt: new Date().toISOString(),
|
|
120
|
+
createdBy: 'gezel',
|
|
121
|
+
catalogVersion: source.catalogVersion ?? detail.manifest.version,
|
|
122
|
+
approxSizeBytes: modelBytes,
|
|
123
|
+
...(detail.manifest.license
|
|
124
|
+
? {
|
|
125
|
+
license: {
|
|
126
|
+
name: detail.manifest.license,
|
|
127
|
+
...(detail.manifest.licenseShortName
|
|
128
|
+
? { shortName: detail.manifest.licenseShortName }
|
|
129
|
+
: {}),
|
|
130
|
+
...(detail.manifest.licenseClass ? { class: detail.manifest.licenseClass } : {}),
|
|
131
|
+
...(detail.manifest.licenseUrl ? { url: detail.manifest.licenseUrl } : {}),
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
: {}),
|
|
135
|
+
files,
|
|
136
|
+
};
|
|
137
|
+
GezmodelBundleManifestSchema.parse(manifest);
|
|
138
|
+
const zip = new yazl.ZipFile();
|
|
139
|
+
zip.addBuffer(Buffer.from(`${JSON.stringify(manifest, null, 2)}\n`), 'manifest.json');
|
|
140
|
+
for (const file of files) {
|
|
141
|
+
if (file.role === 'model') {
|
|
142
|
+
zip.addFile(safeBundleModelPath(source.modelDir, file.path.slice('model/'.length)), file.path, {
|
|
143
|
+
compress: false,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
const content = buffers.get(file.path);
|
|
148
|
+
if (!content)
|
|
149
|
+
throw new Error(`missing prepared bundle entry: ${file.path}`);
|
|
150
|
+
zip.addBuffer(content, file.path, { compress: true });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
zip.end({
|
|
154
|
+
forceZip64Format: files.some((file) => file.sizeBytes >= 0xffff_ffff),
|
|
155
|
+
comment: '',
|
|
156
|
+
});
|
|
157
|
+
return {
|
|
158
|
+
stream: zip.outputStream,
|
|
159
|
+
filename: `${portableFilename(id)}.gezmodel`,
|
|
160
|
+
manifest,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Stream an uploaded archive into private transaction staging, inspect its
|
|
165
|
+
* central directory, extract through hash-verifying streams, then return a
|
|
166
|
+
* review token. No engine directory is touched here.
|
|
167
|
+
*/
|
|
168
|
+
async scanUpload(input, opts = {}) {
|
|
169
|
+
await mkdir(this.importsRoot, { recursive: true });
|
|
170
|
+
await this.cleanupExpired();
|
|
171
|
+
const importId = opts.importId ?? randomUUID();
|
|
172
|
+
const stage = this.stagePath(importId);
|
|
173
|
+
const archivePath = join(stage, 'bundle.gezmodel');
|
|
174
|
+
await mkdir(stage, { recursive: true });
|
|
175
|
+
try {
|
|
176
|
+
opts.signal?.throwIfAborted();
|
|
177
|
+
let uploaded = 0;
|
|
178
|
+
opts.onProgress?.({
|
|
179
|
+
phase: 'receiving',
|
|
180
|
+
bytesCompleted: 0,
|
|
181
|
+
...(opts.bytesTotal === undefined ? {} : { bytesTotal: opts.bytesTotal }),
|
|
182
|
+
});
|
|
183
|
+
let uploadedSinceYield = 0;
|
|
184
|
+
const limiter = new Transform({
|
|
185
|
+
transform(chunk, _encoding, callback) {
|
|
186
|
+
uploaded += chunk.byteLength;
|
|
187
|
+
if (uploaded > MAX_ARCHIVE_BYTES) {
|
|
188
|
+
callback(new Error('model bundle exceeds the 2 TiB archive limit'));
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
opts.onProgress?.({
|
|
192
|
+
phase: 'receiving',
|
|
193
|
+
bytesCompleted: uploaded,
|
|
194
|
+
...(opts.bytesTotal === undefined ? {} : { bytesTotal: opts.bytesTotal }),
|
|
195
|
+
});
|
|
196
|
+
uploadedSinceYield += chunk.byteLength;
|
|
197
|
+
if (uploadedSinceYield >= SCAN_YIELD_BYTES) {
|
|
198
|
+
uploadedSinceYield = 0;
|
|
199
|
+
setImmediate(callback, null, chunk);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
callback(null, chunk);
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
const archiveWriter = createWriteStream(archivePath, { flags: 'wx' });
|
|
206
|
+
if (opts.signal)
|
|
207
|
+
await pipeline(input, limiter, archiveWriter, { signal: opts.signal });
|
|
208
|
+
else
|
|
209
|
+
await pipeline(input, limiter, archiveWriter);
|
|
210
|
+
opts.onUploadComplete?.();
|
|
211
|
+
opts.signal?.throwIfAborted();
|
|
212
|
+
opts.onProgress?.({ phase: 'inspecting' });
|
|
213
|
+
const entries = await inspectArchive(archivePath, opts.signal);
|
|
214
|
+
const root = entries.get('manifest.json');
|
|
215
|
+
if (!root)
|
|
216
|
+
throw new Error('not a .gezmodel bundle: root manifest.json is missing');
|
|
217
|
+
if (root.entry.uncompressedSize > MAX_MANIFEST_BYTES) {
|
|
218
|
+
throw new Error('bundle manifest is too large');
|
|
219
|
+
}
|
|
220
|
+
const manifest = GezmodelBundleManifestSchema.parse(JSON.parse((await readZipEntry(archivePath, root.entry, MAX_MANIFEST_BYTES, opts.signal)).toString('utf8')));
|
|
221
|
+
validateEntryTable(manifest, entries);
|
|
222
|
+
const extractedRoot = join(stage, 'extracted');
|
|
223
|
+
await mkdir(extractedRoot, { recursive: true });
|
|
224
|
+
const bytesTotal = manifest.files.reduce((sum, file) => sum + file.sizeBytes, 0);
|
|
225
|
+
let bytesCompleted = 0;
|
|
226
|
+
opts.onProgress?.({ phase: 'verifying', bytesCompleted, bytesTotal });
|
|
227
|
+
await extractVerified(archivePath, entries, manifest, extractedRoot, opts.signal, (bytes) => {
|
|
228
|
+
bytesCompleted += bytes;
|
|
229
|
+
opts.onProgress?.({ phase: 'verifying', bytesCompleted, bytesTotal });
|
|
230
|
+
});
|
|
231
|
+
opts.signal?.throwIfAborted();
|
|
232
|
+
opts.onProgress?.({ phase: 'validating' });
|
|
233
|
+
const installedManifest = await readJsonObject(join(extractedRoot, 'manifests', 'installed.json'));
|
|
234
|
+
const catalogManifest = ChatModelManifestSchema.parse(JSON.parse(await readFile(join(extractedRoot, 'manifests', 'catalog.json'), 'utf8')));
|
|
235
|
+
if (catalogManifest.kind !== 'chat-model' ||
|
|
236
|
+
catalogManifest.id !== manifest.id ||
|
|
237
|
+
catalogManifest.name !== manifest.name) {
|
|
238
|
+
throw new Error('catalog manifest identity does not match the bundle manifest');
|
|
239
|
+
}
|
|
240
|
+
if (installedManifest.id !== manifest.id) {
|
|
241
|
+
throw new Error('installed manifest identity does not match the bundle manifest');
|
|
242
|
+
}
|
|
243
|
+
await validateRawCatalogFiles(extractedRoot, manifest);
|
|
244
|
+
opts.signal?.throwIfAborted();
|
|
245
|
+
await validateModelPayload(join(extractedRoot, 'model'), manifest);
|
|
246
|
+
opts.signal?.throwIfAborted();
|
|
247
|
+
await rm(archivePath, { force: true });
|
|
248
|
+
const alreadyInstalled = Boolean(await this.owner(manifest.engine).resolveModel(manifest.id));
|
|
249
|
+
const warnings = [];
|
|
250
|
+
if (!manifest.license)
|
|
251
|
+
warnings.push('No model license was included in this bundle.');
|
|
252
|
+
if (manifest.engine === 'mlx' && process.platform !== 'darwin') {
|
|
253
|
+
warnings.push('MLX models can only run on Apple Silicon Macs.');
|
|
254
|
+
}
|
|
255
|
+
const review = {
|
|
256
|
+
importId,
|
|
257
|
+
manifest,
|
|
258
|
+
alreadyInstalled,
|
|
259
|
+
warnings,
|
|
260
|
+
stagedAt: new Date().toISOString(),
|
|
261
|
+
};
|
|
262
|
+
await writeFile(join(stage, 'review.json'), `${JSON.stringify(review, null, 2)}\n`, 'utf8');
|
|
263
|
+
return GezmodelImportReviewSchema.parse(review);
|
|
264
|
+
}
|
|
265
|
+
catch (err) {
|
|
266
|
+
await rm(stage, { recursive: true, force: true }).catch(() => { });
|
|
267
|
+
throw err;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/** Re-verify staged bytes after the review pause, then atomically install. */
|
|
271
|
+
async confirmImport(importId, replace) {
|
|
272
|
+
const { stage, review } = await this.loadReview(importId);
|
|
273
|
+
const owner = this.owner(review.manifest.engine);
|
|
274
|
+
const alreadyInstalled = Boolean(await owner.resolveModel(review.manifest.id));
|
|
275
|
+
if (alreadyInstalled && !replace)
|
|
276
|
+
throw new Error(`model "${review.manifest.id}" already exists locally`);
|
|
277
|
+
const extractedRoot = join(stage, 'extracted');
|
|
278
|
+
await verifyExtractedFiles(extractedRoot, review.manifest);
|
|
279
|
+
const installedManifest = await readJsonObject(join(extractedRoot, 'manifests', 'installed.json'));
|
|
280
|
+
await owner.importModelBundle({
|
|
281
|
+
id: review.manifest.id,
|
|
282
|
+
stagedModelDir: join(extractedRoot, 'model'),
|
|
283
|
+
installedManifest,
|
|
284
|
+
replace,
|
|
285
|
+
});
|
|
286
|
+
await rm(stage, { recursive: true, force: true }).catch(() => { });
|
|
287
|
+
return { engine: review.manifest.engine, id: review.manifest.id };
|
|
288
|
+
}
|
|
289
|
+
async cancelImport(importId) {
|
|
290
|
+
const stage = this.stagePath(importId);
|
|
291
|
+
await rm(stage, { recursive: true, force: true });
|
|
292
|
+
}
|
|
293
|
+
owner(engine) {
|
|
294
|
+
const owner = this.owners[engine];
|
|
295
|
+
if (!owner)
|
|
296
|
+
throw new Error(`unsupported model bundle engine: ${engine}`);
|
|
297
|
+
return owner;
|
|
298
|
+
}
|
|
299
|
+
stagePath(importId) {
|
|
300
|
+
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(importId)) {
|
|
301
|
+
throw new Error('invalid model import id');
|
|
302
|
+
}
|
|
303
|
+
const stage = safeJoin(this.importsRoot, importId);
|
|
304
|
+
if (!stage)
|
|
305
|
+
throw new Error('invalid model import path');
|
|
306
|
+
return stage;
|
|
307
|
+
}
|
|
308
|
+
async loadReview(importId) {
|
|
309
|
+
const stage = this.stagePath(importId);
|
|
310
|
+
const raw = JSON.parse(await readFile(join(stage, 'review.json'), 'utf8'));
|
|
311
|
+
const parsed = GezmodelImportReviewSchema.parse(raw);
|
|
312
|
+
const stagedAt = typeof raw.stagedAt === 'string' ? Date.parse(raw.stagedAt) : Number.NaN;
|
|
313
|
+
if (!Number.isFinite(stagedAt) || Date.now() - stagedAt > IMPORT_TTL_MS) {
|
|
314
|
+
await rm(stage, { recursive: true, force: true }).catch(() => { });
|
|
315
|
+
throw new Error('model import review expired; scan the bundle again');
|
|
316
|
+
}
|
|
317
|
+
return { stage, review: { ...parsed, stagedAt: raw.stagedAt } };
|
|
318
|
+
}
|
|
319
|
+
async cleanupExpired() {
|
|
320
|
+
let ids = [];
|
|
321
|
+
try {
|
|
322
|
+
ids = await readdir(this.importsRoot);
|
|
323
|
+
}
|
|
324
|
+
catch {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
await Promise.all(ids.map(async (id) => {
|
|
328
|
+
const path = safeJoin(this.importsRoot, id);
|
|
329
|
+
if (!path)
|
|
330
|
+
return;
|
|
331
|
+
try {
|
|
332
|
+
const info = await stat(path);
|
|
333
|
+
if (Date.now() - info.mtimeMs > IMPORT_TTL_MS) {
|
|
334
|
+
await rm(path, { recursive: true, force: true });
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
// Best-effort cleanup; the active scan/confirm path remains authoritative.
|
|
339
|
+
}
|
|
340
|
+
}));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
async function hashFile(path) {
|
|
344
|
+
const hash = createHash('sha256');
|
|
345
|
+
// Big read buffer so hashing a multi-GB bundle doesn't starve inside the
|
|
346
|
+
// busy daemon event loop. See MODEL_HASH_READ_BUFFER_BYTES.
|
|
347
|
+
const stream = createReadStream(path, { highWaterMark: MODEL_HASH_READ_BUFFER_BYTES });
|
|
348
|
+
for await (const chunk of stream)
|
|
349
|
+
hash.update(chunk);
|
|
350
|
+
return hash.digest('hex');
|
|
351
|
+
}
|
|
352
|
+
function portableFilename(id) {
|
|
353
|
+
return id.replace(/[^a-z0-9._-]+/gi, '-').replace(/^[.-]+/, '') || 'model';
|
|
354
|
+
}
|
|
355
|
+
function inspectArchive(path, signal) {
|
|
356
|
+
return new Promise((resolve, reject) => {
|
|
357
|
+
signal?.throwIfAborted();
|
|
358
|
+
yauzl.open(path, { lazyEntries: true, decodeStrings: true, validateEntrySizes: true }, (err, zip) => {
|
|
359
|
+
if (err || !zip) {
|
|
360
|
+
reject(new Error(`not a readable ZIP archive: ${err?.message ?? 'unknown error'}`));
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
const entries = new Map();
|
|
364
|
+
const portableNames = new Set();
|
|
365
|
+
let totalCompressed = 0;
|
|
366
|
+
let totalUncompressed = 0;
|
|
367
|
+
let count = 0;
|
|
368
|
+
let settled = false;
|
|
369
|
+
const cleanup = () => signal?.removeEventListener('abort', abort);
|
|
370
|
+
const fail = (error) => {
|
|
371
|
+
if (settled)
|
|
372
|
+
return;
|
|
373
|
+
settled = true;
|
|
374
|
+
cleanup();
|
|
375
|
+
zip.close();
|
|
376
|
+
reject(error);
|
|
377
|
+
};
|
|
378
|
+
const abort = () => fail(abortReason(signal));
|
|
379
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
380
|
+
if (signal?.aborted)
|
|
381
|
+
return abort();
|
|
382
|
+
zip.on('error', fail);
|
|
383
|
+
zip.on('entry', (entry) => {
|
|
384
|
+
try {
|
|
385
|
+
signal?.throwIfAborted();
|
|
386
|
+
count += 1;
|
|
387
|
+
if (count > MAX_ENTRIES)
|
|
388
|
+
throw new Error(`archive has more than ${MAX_ENTRIES} entries`);
|
|
389
|
+
const name = entry.fileName;
|
|
390
|
+
if (name.endsWith('/'))
|
|
391
|
+
throw new Error(`directory entries are not allowed: ${name}`);
|
|
392
|
+
if (!isSafeArchivePath(name))
|
|
393
|
+
throw new Error(`unsafe archive path: ${name}`);
|
|
394
|
+
const portable = name.toLowerCase();
|
|
395
|
+
if (portableNames.has(portable))
|
|
396
|
+
throw new Error(`duplicate archive path: ${name}`);
|
|
397
|
+
portableNames.add(portable);
|
|
398
|
+
if ((entry.generalPurposeBitFlag & 0x1) !== 0) {
|
|
399
|
+
throw new Error(`encrypted archive entries are not allowed: ${name}`);
|
|
400
|
+
}
|
|
401
|
+
const unixMode = (entry.externalFileAttributes >>> 16) & 0xffff;
|
|
402
|
+
if ((unixMode & 0o170000) === 0o120000) {
|
|
403
|
+
throw new Error(`symbolic links are not allowed: ${name}`);
|
|
404
|
+
}
|
|
405
|
+
if (entry.uncompressedSize > MAX_ENTRY_UNCOMPRESSED_BYTES) {
|
|
406
|
+
throw new Error(`archive entry is larger than the 2 TiB limit: ${name}`);
|
|
407
|
+
}
|
|
408
|
+
totalCompressed += entry.compressedSize;
|
|
409
|
+
totalUncompressed += entry.uncompressedSize;
|
|
410
|
+
if (totalUncompressed > MAX_TOTAL_UNCOMPRESSED_BYTES) {
|
|
411
|
+
throw new Error('archive expands beyond the 2 TiB total limit');
|
|
412
|
+
}
|
|
413
|
+
entries.set(name, { entry, name });
|
|
414
|
+
zip.readEntry();
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
fail(error instanceof Error ? error : new Error(String(error)));
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
zip.on('end', () => {
|
|
421
|
+
if (settled)
|
|
422
|
+
return;
|
|
423
|
+
if (totalCompressed > 1024 &&
|
|
424
|
+
totalUncompressed / Math.max(totalCompressed, 1) > MAX_COMPRESSION_RATIO) {
|
|
425
|
+
settled = true;
|
|
426
|
+
cleanup();
|
|
427
|
+
reject(new Error(`archive compression ratio exceeds ${MAX_COMPRESSION_RATIO}:1`));
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
settled = true;
|
|
431
|
+
cleanup();
|
|
432
|
+
resolve(entries);
|
|
433
|
+
});
|
|
434
|
+
zip.readEntry();
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
function readZipEntry(path, wanted, maxBytes, signal) {
|
|
439
|
+
return new Promise((resolve, reject) => {
|
|
440
|
+
signal?.throwIfAborted();
|
|
441
|
+
yauzl.open(path, { lazyEntries: true, decodeStrings: true, validateEntrySizes: true }, (err, zip) => {
|
|
442
|
+
if (err || !zip)
|
|
443
|
+
return reject(err ?? new Error('could not open ZIP'));
|
|
444
|
+
let settled = false;
|
|
445
|
+
const cleanup = () => signal?.removeEventListener('abort', abort);
|
|
446
|
+
const fail = (error) => {
|
|
447
|
+
if (settled)
|
|
448
|
+
return;
|
|
449
|
+
settled = true;
|
|
450
|
+
cleanup();
|
|
451
|
+
zip.close();
|
|
452
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
453
|
+
};
|
|
454
|
+
const abort = () => fail(abortReason(signal));
|
|
455
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
456
|
+
if (signal?.aborted)
|
|
457
|
+
return abort();
|
|
458
|
+
zip.on('error', fail);
|
|
459
|
+
zip.on('entry', (entry) => {
|
|
460
|
+
if (signal?.aborted)
|
|
461
|
+
return fail(abortReason(signal));
|
|
462
|
+
if (entry.fileName !== wanted.fileName) {
|
|
463
|
+
zip.readEntry();
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
zip.openReadStream(entry, (streamErr, stream) => {
|
|
467
|
+
if (streamErr || !stream)
|
|
468
|
+
return fail(streamErr ?? new Error('could not read ZIP entry'));
|
|
469
|
+
const chunks = [];
|
|
470
|
+
let bytes = 0;
|
|
471
|
+
stream.on('data', (chunk) => {
|
|
472
|
+
bytes += chunk.byteLength;
|
|
473
|
+
if (bytes > maxBytes)
|
|
474
|
+
stream.destroy(new Error('ZIP entry exceeds read limit'));
|
|
475
|
+
else
|
|
476
|
+
chunks.push(chunk);
|
|
477
|
+
});
|
|
478
|
+
stream.on('error', fail);
|
|
479
|
+
stream.on('end', () => {
|
|
480
|
+
if (settled)
|
|
481
|
+
return;
|
|
482
|
+
settled = true;
|
|
483
|
+
cleanup();
|
|
484
|
+
zip.close();
|
|
485
|
+
resolve(Buffer.concat(chunks));
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
zip.on('end', () => fail(new Error(`ZIP entry is missing: ${wanted.fileName}`)));
|
|
490
|
+
zip.readEntry();
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
function validateEntryTable(manifest, entries) {
|
|
495
|
+
const declared = new Map(manifest.files.map((file) => [file.path, file]));
|
|
496
|
+
if (declared.size !== manifest.files.length)
|
|
497
|
+
throw new Error('bundle manifest has duplicate files');
|
|
498
|
+
if (!manifest.files.some((file) => file.role === 'model')) {
|
|
499
|
+
throw new Error('bundle manifest contains no model files');
|
|
500
|
+
}
|
|
501
|
+
const installed = manifest.files.filter((file) => file.role === 'installed-manifest');
|
|
502
|
+
const catalog = manifest.files.filter((file) => file.role === 'catalog-manifest');
|
|
503
|
+
if (installed.length !== 1 || installed[0]?.path !== 'manifests/installed.json') {
|
|
504
|
+
throw new Error('bundle must contain exactly one manifests/installed.json');
|
|
505
|
+
}
|
|
506
|
+
if (catalog.length !== 1 || catalog[0]?.path !== 'manifests/catalog.json') {
|
|
507
|
+
throw new Error('bundle must contain exactly one manifests/catalog.json');
|
|
508
|
+
}
|
|
509
|
+
const expectedBytes = manifest.files
|
|
510
|
+
.filter((file) => file.role === 'model')
|
|
511
|
+
.reduce((sum, file) => sum + file.sizeBytes, 0);
|
|
512
|
+
if (expectedBytes !== manifest.approxSizeBytes) {
|
|
513
|
+
throw new Error('bundle model size does not match its manifest');
|
|
514
|
+
}
|
|
515
|
+
for (const file of manifest.files) {
|
|
516
|
+
if (!pathMatchesRole(file))
|
|
517
|
+
throw new Error(`bundle role/path mismatch: ${file.path}`);
|
|
518
|
+
if (BLOCKED_EXTENSIONS.has(extname(file.path).toLowerCase())) {
|
|
519
|
+
throw new Error(`executable or script content is not allowed: ${file.path}`);
|
|
520
|
+
}
|
|
521
|
+
const actual = entries.get(file.path)?.entry;
|
|
522
|
+
if (!actual)
|
|
523
|
+
throw new Error(`bundle is missing declared file: ${file.path}`);
|
|
524
|
+
if (actual.uncompressedSize !== file.sizeBytes) {
|
|
525
|
+
throw new Error(`size mismatch for ${file.path}`);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
for (const name of entries.keys()) {
|
|
529
|
+
if (name !== 'manifest.json' && !declared.has(name)) {
|
|
530
|
+
throw new Error(`bundle contains an undeclared file: ${name}`);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function pathMatchesRole(file) {
|
|
535
|
+
if (file.role === 'model')
|
|
536
|
+
return file.path.startsWith('model/');
|
|
537
|
+
if (file.role === 'installed-manifest')
|
|
538
|
+
return file.path === 'manifests/installed.json';
|
|
539
|
+
if (file.role === 'catalog-manifest')
|
|
540
|
+
return file.path === 'manifests/catalog.json';
|
|
541
|
+
return file.path.startsWith('catalog/chat-models/');
|
|
542
|
+
}
|
|
543
|
+
async function extractVerified(archivePath, entries, manifest, extractedRoot, signal, onBytes) {
|
|
544
|
+
for (const file of manifest.files) {
|
|
545
|
+
signal?.throwIfAborted();
|
|
546
|
+
const scanned = entries.get(file.path);
|
|
547
|
+
if (!scanned)
|
|
548
|
+
throw new Error(`missing ZIP entry: ${file.path}`);
|
|
549
|
+
const dest = safeJoin(extractedRoot, file.path);
|
|
550
|
+
if (!dest)
|
|
551
|
+
throw new Error(`unsafe extraction path: ${file.path}`);
|
|
552
|
+
await mkdir(dirname(dest), { recursive: true });
|
|
553
|
+
await extractOne(archivePath, scanned.entry, dest, file, signal, onBytes);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
function extractOne(archivePath, wanted, dest, expected, signal, onBytes) {
|
|
557
|
+
return new Promise((resolve, reject) => {
|
|
558
|
+
signal?.throwIfAborted();
|
|
559
|
+
yauzl.open(archivePath, { lazyEntries: true, decodeStrings: true, validateEntrySizes: true }, (err, zip) => {
|
|
560
|
+
if (err || !zip)
|
|
561
|
+
return reject(err ?? new Error('could not open ZIP'));
|
|
562
|
+
let settled = false;
|
|
563
|
+
const cleanup = () => signal?.removeEventListener('abort', abort);
|
|
564
|
+
const fail = (error) => {
|
|
565
|
+
if (settled)
|
|
566
|
+
return;
|
|
567
|
+
settled = true;
|
|
568
|
+
cleanup();
|
|
569
|
+
zip.close();
|
|
570
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
571
|
+
};
|
|
572
|
+
const abort = () => fail(abortReason(signal));
|
|
573
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
574
|
+
if (signal?.aborted)
|
|
575
|
+
return abort();
|
|
576
|
+
zip.on('error', fail);
|
|
577
|
+
zip.on('entry', (entry) => {
|
|
578
|
+
if (signal?.aborted)
|
|
579
|
+
return fail(abortReason(signal));
|
|
580
|
+
if (entry.fileName !== wanted.fileName) {
|
|
581
|
+
zip.readEntry();
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
zip.openReadStream(entry, (streamErr, stream) => {
|
|
585
|
+
if (streamErr || !stream)
|
|
586
|
+
return fail(streamErr ?? new Error('could not read ZIP entry'));
|
|
587
|
+
const hash = createHash('sha256');
|
|
588
|
+
let bytes = 0;
|
|
589
|
+
let bytesSinceYield = 0;
|
|
590
|
+
const verifier = new Transform({
|
|
591
|
+
transform(chunk, _encoding, callback) {
|
|
592
|
+
bytes += chunk.byteLength;
|
|
593
|
+
bytesSinceYield += chunk.byteLength;
|
|
594
|
+
hash.update(chunk);
|
|
595
|
+
onBytes?.(chunk.byteLength);
|
|
596
|
+
if (bytesSinceYield >= SCAN_YIELD_BYTES) {
|
|
597
|
+
bytesSinceYield = 0;
|
|
598
|
+
setImmediate(callback, null, chunk);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
callback(null, chunk);
|
|
602
|
+
},
|
|
603
|
+
});
|
|
604
|
+
const extraction = signal
|
|
605
|
+
? pipeline(stream, verifier, createWriteStream(dest, { flags: 'wx' }), { signal })
|
|
606
|
+
: pipeline(stream, verifier, createWriteStream(dest, { flags: 'wx' }));
|
|
607
|
+
extraction
|
|
608
|
+
.then(() => {
|
|
609
|
+
if (bytes !== expected.sizeBytes || hash.digest('hex') !== expected.sha256) {
|
|
610
|
+
throw new Error(`checksum verification failed for ${expected.path}`);
|
|
611
|
+
}
|
|
612
|
+
if (settled)
|
|
613
|
+
return;
|
|
614
|
+
settled = true;
|
|
615
|
+
cleanup();
|
|
616
|
+
zip.close();
|
|
617
|
+
resolve();
|
|
618
|
+
})
|
|
619
|
+
.catch(fail);
|
|
620
|
+
});
|
|
621
|
+
});
|
|
622
|
+
zip.on('end', () => fail(new Error(`ZIP entry is missing: ${wanted.fileName}`)));
|
|
623
|
+
zip.readEntry();
|
|
624
|
+
});
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
function abortReason(signal) {
|
|
628
|
+
if (signal?.reason instanceof Error)
|
|
629
|
+
return signal.reason;
|
|
630
|
+
const error = new Error('model bundle scan canceled');
|
|
631
|
+
error.name = 'AbortError';
|
|
632
|
+
return error;
|
|
633
|
+
}
|
|
634
|
+
async function verifyExtractedFiles(root, manifest) {
|
|
635
|
+
for (const file of manifest.files) {
|
|
636
|
+
const path = safeJoin(root, file.path);
|
|
637
|
+
if (!path)
|
|
638
|
+
throw new Error(`unsafe staged path: ${file.path}`);
|
|
639
|
+
const info = await stat(path);
|
|
640
|
+
if (!info.isFile() || info.size !== file.sizeBytes || (await hashFile(path)) !== file.sha256) {
|
|
641
|
+
throw new Error(`staged model file changed after scanning: ${file.path}`);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
async function validateModelPayload(modelRoot, manifest) {
|
|
646
|
+
const modelFiles = manifest.files.filter((file) => file.role === 'model');
|
|
647
|
+
if (manifest.engine === 'llama-cpp' || manifest.engine === 'ds4') {
|
|
648
|
+
for (const file of modelFiles) {
|
|
649
|
+
if (!file.path.toLowerCase().endsWith('.gguf')) {
|
|
650
|
+
throw new Error(`${manifest.engine} bundles may contain only GGUF model files`);
|
|
651
|
+
}
|
|
652
|
+
const path = safeJoin(modelRoot, file.path.slice('model/'.length));
|
|
653
|
+
if (!path)
|
|
654
|
+
throw new Error(`unsafe model path: ${file.path}`);
|
|
655
|
+
const handle = await open(path, 'r');
|
|
656
|
+
try {
|
|
657
|
+
const magic = Buffer.alloc(4);
|
|
658
|
+
await handle.read(magic, 0, 4, 0);
|
|
659
|
+
if (magic.toString('ascii') !== 'GGUF')
|
|
660
|
+
throw new Error(`invalid GGUF header: ${file.path}`);
|
|
661
|
+
}
|
|
662
|
+
finally {
|
|
663
|
+
await handle.close();
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
const weights = modelFiles.filter((file) => file.path.toLowerCase().endsWith('.safetensors'));
|
|
669
|
+
if (weights.length === 0)
|
|
670
|
+
throw new Error('MLX bundle has no safetensors weights');
|
|
671
|
+
if (!modelFiles.some((file) => file.path === 'model/config.json')) {
|
|
672
|
+
throw new Error('MLX bundle has no config.json');
|
|
673
|
+
}
|
|
674
|
+
for (const file of weights) {
|
|
675
|
+
const path = safeJoin(modelRoot, file.path.slice('model/'.length));
|
|
676
|
+
if (!path)
|
|
677
|
+
throw new Error(`unsafe model path: ${file.path}`);
|
|
678
|
+
await validateSafetensorsHeader(path, file.sizeBytes);
|
|
679
|
+
}
|
|
680
|
+
JSON.parse(await readFile(join(modelRoot, 'config.json'), 'utf8'));
|
|
681
|
+
}
|
|
682
|
+
async function validateSafetensorsHeader(path, sizeBytes) {
|
|
683
|
+
const handle = await open(path, 'r');
|
|
684
|
+
try {
|
|
685
|
+
const prefix = Buffer.alloc(8);
|
|
686
|
+
const read = await handle.read(prefix, 0, 8, 0);
|
|
687
|
+
if (read.bytesRead !== 8)
|
|
688
|
+
throw new Error(`truncated safetensors file: ${basename(path)}`);
|
|
689
|
+
const headerBytes = Number(prefix.readBigUInt64LE(0));
|
|
690
|
+
if (!Number.isSafeInteger(headerBytes) || headerBytes <= 1 || headerBytes > 16 * 1024 * 1024) {
|
|
691
|
+
throw new Error(`invalid safetensors header length: ${basename(path)}`);
|
|
692
|
+
}
|
|
693
|
+
if (headerBytes + 8 > sizeBytes)
|
|
694
|
+
throw new Error(`truncated safetensors header: ${basename(path)}`);
|
|
695
|
+
const header = Buffer.alloc(headerBytes);
|
|
696
|
+
await handle.read(header, 0, headerBytes, 8);
|
|
697
|
+
const parsed = JSON.parse(header.toString('utf8'));
|
|
698
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
699
|
+
throw new Error(`invalid safetensors metadata: ${basename(path)}`);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
finally {
|
|
703
|
+
await handle.close();
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
async function validateRawCatalogFiles(root, manifest) {
|
|
707
|
+
for (const file of manifest.files.filter((entry) => entry.role === 'catalog-file')) {
|
|
708
|
+
const full = safeJoin(root, file.path);
|
|
709
|
+
if (!full)
|
|
710
|
+
throw new Error(`unsafe catalog manifest path: ${file.path}`);
|
|
711
|
+
const json = JSON.parse(await readFile(full, 'utf8'));
|
|
712
|
+
if (/\/versions\/[^/]+\/manifest\.json$/.test(file.path)) {
|
|
713
|
+
const version = ChatModelVersionManifestSchema.parse(json);
|
|
714
|
+
if (manifest.catalogVersion && version.version !== manifest.catalogVersion) {
|
|
715
|
+
throw new Error('catalog version manifest does not match the bundle version');
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
else if (file.path.endsWith('/manifest.json')) {
|
|
719
|
+
const identity = ChatModelIdentitySchema.parse(json);
|
|
720
|
+
if (identity.id !== manifest.id)
|
|
721
|
+
throw new Error('catalog identity manifest id mismatch');
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
async function readJsonObject(path) {
|
|
726
|
+
const parsed = JSON.parse(await readFile(path, 'utf8'));
|
|
727
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
728
|
+
throw new Error(`${basename(path)} must contain a JSON object`);
|
|
729
|
+
}
|
|
730
|
+
return parsed;
|
|
731
|
+
}
|
|
732
|
+
function isSafeArchivePath(path) {
|
|
733
|
+
if (path.length === 0 ||
|
|
734
|
+
path.length > 1024 ||
|
|
735
|
+
path.includes('\\') ||
|
|
736
|
+
path.includes('\0') ||
|
|
737
|
+
path.startsWith('/')) {
|
|
738
|
+
return false;
|
|
739
|
+
}
|
|
740
|
+
const scratch = safeJoin('gezel-bundle-root', path);
|
|
741
|
+
return scratch !== null;
|
|
742
|
+
}
|