@kenkaiiii/gg-core 5.101.0 → 5.102.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/dist/index.cjs +21 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -143,6 +143,7 @@ __export(index_exports, {
|
|
|
143
143
|
parseLocalModelId: () => parseLocalModelId,
|
|
144
144
|
parseOpenCodeCatalog: () => parseOpenCodeCatalog,
|
|
145
145
|
parseOpenRouterCatalog: () => parseOpenRouterCatalog,
|
|
146
|
+
pointScale: () => pointScale,
|
|
146
147
|
probeEndpoint: () => probeEndpoint,
|
|
147
148
|
providerStorageKeys: () => providerStorageKeys,
|
|
148
149
|
readClaudeCodeUsage: () => readClaudeCodeUsage,
|
|
@@ -3715,7 +3716,12 @@ async function probeEndpoint(endpoint, { timeoutMs = DEFAULT_PROBE_TIMEOUT_MS, s
|
|
|
3715
3716
|
);
|
|
3716
3717
|
const enriched = await enrich(endpoint, entries, { timeoutMs, signal });
|
|
3717
3718
|
const pinned = contextLength(endpoint.contextLength);
|
|
3718
|
-
const
|
|
3719
|
+
const images = typeof endpoint.supportsImages === "boolean" ? endpoint.supportsImages : void 0;
|
|
3720
|
+
const models = enriched.map((m) => ({
|
|
3721
|
+
...m,
|
|
3722
|
+
...pinned === void 0 ? {} : { contextWindow: pinned, contextWindowKnown: true },
|
|
3723
|
+
...images === void 0 ? {} : { supportsImages: images }
|
|
3724
|
+
}));
|
|
3719
3725
|
log("INFO", "local-models", `Probed ${endpoint.label}`, {
|
|
3720
3726
|
baseUrl: endpoint.baseUrl,
|
|
3721
3727
|
models: String(models.length)
|
|
@@ -3735,7 +3741,7 @@ async function enrichCustom(endpoint, entries, options) {
|
|
|
3735
3741
|
const root = endpointRoot(endpoint.baseUrl);
|
|
3736
3742
|
const props = await fetchJson(`${root}/props`, endpoint, options);
|
|
3737
3743
|
const nCtx = contextLength(props?.default_generation_settings?.n_ctx);
|
|
3738
|
-
if (nCtx !== void 0) return llamaCppModels(endpoint, entries, nCtx);
|
|
3744
|
+
if (nCtx !== void 0) return llamaCppModels(endpoint, entries, nCtx, props);
|
|
3739
3745
|
const lmStudio = await fetchJson(`${root}/api/v1/models`, endpoint, options);
|
|
3740
3746
|
if (Array.isArray(lmStudio?.models)) return enrichLmStudio(endpoint, entries, options, lmStudio);
|
|
3741
3747
|
return generic;
|
|
@@ -3878,14 +3884,16 @@ async function enrichLlamaCpp(endpoint, entries, options) {
|
|
|
3878
3884
|
return llamaCppModels(
|
|
3879
3885
|
endpoint,
|
|
3880
3886
|
entries,
|
|
3881
|
-
contextLength(props?.default_generation_settings?.n_ctx)
|
|
3887
|
+
contextLength(props?.default_generation_settings?.n_ctx),
|
|
3888
|
+
props
|
|
3882
3889
|
);
|
|
3883
3890
|
}
|
|
3884
|
-
function llamaCppModels(endpoint, entries, nCtx) {
|
|
3891
|
+
function llamaCppModels(endpoint, entries, nCtx, props) {
|
|
3885
3892
|
return entries.map((entry) => ({
|
|
3886
3893
|
...genericModel(endpoint, entry),
|
|
3887
3894
|
contextWindow: nCtx ?? FALLBACK_CONTEXT_WINDOW,
|
|
3888
|
-
contextWindowKnown: nCtx !== void 0
|
|
3895
|
+
contextWindowKnown: nCtx !== void 0,
|
|
3896
|
+
supportsImages: props?.modalities?.vision === true
|
|
3889
3897
|
}));
|
|
3890
3898
|
}
|
|
3891
3899
|
async function mapLimited(items, limit, fn) {
|
|
@@ -3921,7 +3929,7 @@ function toModelInfo(model, endpoint) {
|
|
|
3921
3929
|
}
|
|
3922
3930
|
var cache;
|
|
3923
3931
|
function cacheKey(endpoints) {
|
|
3924
|
-
return endpoints.map((e) => `${e.id}@${e.baseUrl}#${e.contextLength ?? ""}`).join("|");
|
|
3932
|
+
return endpoints.map((e) => `${e.id}@${e.baseUrl}#${e.contextLength ?? ""}#${e.supportsImages ?? ""}`).join("|");
|
|
3925
3933
|
}
|
|
3926
3934
|
async function discoverLocalModels(endpoints = DEFAULT_LOCAL_ENDPOINTS, options = {}) {
|
|
3927
3935
|
const key = cacheKey(endpoints);
|
|
@@ -3950,6 +3958,12 @@ function findProbedModel(probes, modelId) {
|
|
|
3950
3958
|
return void 0;
|
|
3951
3959
|
}
|
|
3952
3960
|
|
|
3961
|
+
// src/point-scale.ts
|
|
3962
|
+
var NORM1000_PATTERN = /qwen3[-_.]?vl|qwen3[._]?[56](?![\d])/i;
|
|
3963
|
+
function pointScale(modelId) {
|
|
3964
|
+
return NORM1000_PATTERN.test(modelId) ? "norm1000" : "pixels";
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3953
3967
|
// src/claude-code/usage.ts
|
|
3954
3968
|
var import_promises7 = __toESM(require("fs/promises"), 1);
|
|
3955
3969
|
var import_node_path5 = __toESM(require("path"), 1);
|
|
@@ -5069,6 +5083,7 @@ function createAutoUpdater(config) {
|
|
|
5069
5083
|
parseLocalModelId,
|
|
5070
5084
|
parseOpenCodeCatalog,
|
|
5071
5085
|
parseOpenRouterCatalog,
|
|
5086
|
+
pointScale,
|
|
5072
5087
|
probeEndpoint,
|
|
5073
5088
|
providerStorageKeys,
|
|
5074
5089
|
readClaudeCodeUsage,
|