@kenkaiiii/gg-core 5.100.3 → 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.d.cts
CHANGED
|
@@ -79,6 +79,8 @@ interface LocalEndpoint {
|
|
|
79
79
|
custom?: boolean;
|
|
80
80
|
/** User-pinned context window; wins over whatever the server reports. */
|
|
81
81
|
contextLength?: number;
|
|
82
|
+
/** User-pinned image support (vLLM and most gateways never report it); wins over the server. */
|
|
83
|
+
supportsImages?: boolean;
|
|
82
84
|
}
|
|
83
85
|
/** One model as reported (and enriched) by a local server. */
|
|
84
86
|
interface LocalModel {
|
|
@@ -180,6 +182,14 @@ declare function findProbedModel(probes: readonly LocalEndpointProbe[], modelId:
|
|
|
180
182
|
endpoint: LocalEndpoint;
|
|
181
183
|
} | undefined;
|
|
182
184
|
|
|
185
|
+
/** How a vision model writes screen coordinates when asked to point at something. */
|
|
186
|
+
type PointScale = "pixels" | "norm1000";
|
|
187
|
+
/**
|
|
188
|
+
* The coordinate scale a model answers in, from its id. Works on bare ids (`qwen3-vl:8b`),
|
|
189
|
+
* local ids (`local/lmstudio/qwen/qwen3.5-27b`) and OpenRouter ids (`qwen/qwen3-vl-32b-instruct`).
|
|
190
|
+
*/
|
|
191
|
+
declare function pointScale(modelId: string): PointScale;
|
|
192
|
+
|
|
183
193
|
type LogLevel = "INFO" | "ERROR" | "WARN" | "DEBUG";
|
|
184
194
|
/**
|
|
185
195
|
* Open the debug log in append mode, tagging this process with a session id and
|
|
@@ -1101,5 +1111,5 @@ interface AutoUpdater {
|
|
|
1101
1111
|
}
|
|
1102
1112
|
declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
|
|
1103
1113
|
|
|
1104
|
-
export { AUTH_PROVIDERS, AuthStorage, CHATGPT_PLAN_BASE_URL, CHATGPT_PLAN_NOT_ENABLED_MESSAGE, CHATGPT_PLAN_SCOPE, CHATGPT_USAGE_URL, CLAUDE_CODE_AUTH_KEY, CLAUDE_CODE_AUTH_MARKER, CLAUDE_CODE_MANIFEST, ChatGPTPlanNotEnabledError, ChatGPTSignInError, DEFAULT_LOCAL_ENDPOINTS, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, KIMI_CODE_DEFAULT_BASE_URL, KIMI_CODE_KEY, KIMI_CODE_OVERSEAS_BASE_URL, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, MINIMAX_CN_BASE_URL, MINIMAX_GLOBAL_BASE_URL, ModelInfo, NotLoggedInError, OPENAI_CHATGPT_KEY, OPENCODE_CATALOG_URLS, OPENCODE_PROVIDERS, OPENROUTER_DEFAULT_BASE_URL, PLAN_MODE_THINKING_CAP, RETIRED_SIGN_INS, SubscriptionUsageError, TelegramBot, XIAOMI_CREDITS_KEY, XIAOMI_TOKEN_PLAN_BASE_URLS, apiKeyStorageKeys, authPriorityNote, clampThinkingForPlanMode, claudeCodeAuthStatus, claudeCodeBinaryPath, claudeCodeCallbackUrl, claudeCodeConfigDir, claudeCodeEnv, claudeCodeHome, claudeCodePlatformKey, clearClaudeCodeUsage, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, detectKimiCodeBaseUrl, detectMiniMaxBaseUrl, detectXiaomiTokenPlanBaseUrl, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, ensureClaudeCodeBinary, fetchChatGPTPlanModels, fetchSubscriptionUsage, findProbedModel, formatClaudeCodeInstallProgress, formatLocalModelId, formatOpenCodeModelId, generatePKCE, getAuthProvider, getChatGPTHostId, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, isClaudeCodeAuthMarker, isKimiCodingEndpoint, isLegacyClaudeOAuth, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, localAuthStorageKey, localModelShortName, log, loginChatGPT, loginClaudeCode, logoutClaudeCode, mergeClaudeCodeRateLimit, oauthStorageKey, ollamaServedContext, openLog, parseCallbackInput, parseLocalModelId, parseOpenCodeCatalog, parseOpenRouterCatalog, probeEndpoint, providerStorageKeys, readClaudeCodeUsage, readStoredBaseUrlSync, recordClaudeCodeRateLimit, refreshChatGPTToken, registerLogCleanup, requiredKeyLabel, resample, resolveClaudeCodeBinary, revokeChatGPTSignIn, setProgressCallback, signInWithClaudeCode, signOutOfClaudeCode, storageKeyProvider, toModelInfo, transcribeVoice, verifyIdToken, withFileLock };
|
|
1105
|
-
export type { ApiKeyVariant, AuthMethod, AuthMethodMeta, AuthProviderMeta, AutoUpdateConfig, AutoUpdater, ChatGPTLoginOptions, ClaudeCodeAuthStatus, ClaudeCodeInstallProgress, ClaudeCodeManifest, ClaudeCodePlatformAsset, ClaudeCodeRateLimitInfo, ClaudeCodeRunOptions, ClaudeCodeRuntimeOptions, ClaudeCodeSignInOptions, DiscoverOptions, DiscoveryResult, DualAuthProvider, EnsureClaudeCodeOptions, FetchedSubscriptionUsageProvider, InlineButton, LocalEndpoint, LocalEndpointKind, LocalEndpointProbe, LocalModel, LogLevel, OAuthCredentials, OAuthLoginCallbacks, OpenCodeProvider, ParsedOpenCodeCatalog, ParsedOpenRouterCatalog, ProbeOptions, ProgressCallback, RetiredSignIn, SubscriptionUsageProvider, SubscriptionUsageSnapshot, SubscriptionUsageWindow, TelegramConfig, TelegramMessage, TelegramUpdate, TelegramVoiceMessage };
|
|
1114
|
+
export { AUTH_PROVIDERS, AuthStorage, CHATGPT_PLAN_BASE_URL, CHATGPT_PLAN_NOT_ENABLED_MESSAGE, CHATGPT_PLAN_SCOPE, CHATGPT_USAGE_URL, CLAUDE_CODE_AUTH_KEY, CLAUDE_CODE_AUTH_MARKER, CLAUDE_CODE_MANIFEST, ChatGPTPlanNotEnabledError, ChatGPTSignInError, DEFAULT_LOCAL_ENDPOINTS, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, KIMI_CODE_DEFAULT_BASE_URL, KIMI_CODE_KEY, KIMI_CODE_OVERSEAS_BASE_URL, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, MINIMAX_CN_BASE_URL, MINIMAX_GLOBAL_BASE_URL, ModelInfo, NotLoggedInError, OPENAI_CHATGPT_KEY, OPENCODE_CATALOG_URLS, OPENCODE_PROVIDERS, OPENROUTER_DEFAULT_BASE_URL, PLAN_MODE_THINKING_CAP, RETIRED_SIGN_INS, SubscriptionUsageError, TelegramBot, XIAOMI_CREDITS_KEY, XIAOMI_TOKEN_PLAN_BASE_URLS, apiKeyStorageKeys, authPriorityNote, clampThinkingForPlanMode, claudeCodeAuthStatus, claudeCodeBinaryPath, claudeCodeCallbackUrl, claudeCodeConfigDir, claudeCodeEnv, claudeCodeHome, claudeCodePlatformKey, clearClaudeCodeUsage, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, detectKimiCodeBaseUrl, detectMiniMaxBaseUrl, detectXiaomiTokenPlanBaseUrl, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, ensureClaudeCodeBinary, fetchChatGPTPlanModels, fetchSubscriptionUsage, findProbedModel, formatClaudeCodeInstallProgress, formatLocalModelId, formatOpenCodeModelId, generatePKCE, getAuthProvider, getChatGPTHostId, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, isClaudeCodeAuthMarker, isKimiCodingEndpoint, isLegacyClaudeOAuth, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, localAuthStorageKey, localModelShortName, log, loginChatGPT, loginClaudeCode, logoutClaudeCode, mergeClaudeCodeRateLimit, oauthStorageKey, ollamaServedContext, openLog, parseCallbackInput, parseLocalModelId, parseOpenCodeCatalog, parseOpenRouterCatalog, pointScale, probeEndpoint, providerStorageKeys, readClaudeCodeUsage, readStoredBaseUrlSync, recordClaudeCodeRateLimit, refreshChatGPTToken, registerLogCleanup, requiredKeyLabel, resample, resolveClaudeCodeBinary, revokeChatGPTSignIn, setProgressCallback, signInWithClaudeCode, signOutOfClaudeCode, storageKeyProvider, toModelInfo, transcribeVoice, verifyIdToken, withFileLock };
|
|
1115
|
+
export type { ApiKeyVariant, AuthMethod, AuthMethodMeta, AuthProviderMeta, AutoUpdateConfig, AutoUpdater, ChatGPTLoginOptions, ClaudeCodeAuthStatus, ClaudeCodeInstallProgress, ClaudeCodeManifest, ClaudeCodePlatformAsset, ClaudeCodeRateLimitInfo, ClaudeCodeRunOptions, ClaudeCodeRuntimeOptions, ClaudeCodeSignInOptions, DiscoverOptions, DiscoveryResult, DualAuthProvider, EnsureClaudeCodeOptions, FetchedSubscriptionUsageProvider, InlineButton, LocalEndpoint, LocalEndpointKind, LocalEndpointProbe, LocalModel, LogLevel, OAuthCredentials, OAuthLoginCallbacks, OpenCodeProvider, ParsedOpenCodeCatalog, ParsedOpenRouterCatalog, PointScale, ProbeOptions, ProgressCallback, RetiredSignIn, SubscriptionUsageProvider, SubscriptionUsageSnapshot, SubscriptionUsageWindow, TelegramConfig, TelegramMessage, TelegramUpdate, TelegramVoiceMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -79,6 +79,8 @@ interface LocalEndpoint {
|
|
|
79
79
|
custom?: boolean;
|
|
80
80
|
/** User-pinned context window; wins over whatever the server reports. */
|
|
81
81
|
contextLength?: number;
|
|
82
|
+
/** User-pinned image support (vLLM and most gateways never report it); wins over the server. */
|
|
83
|
+
supportsImages?: boolean;
|
|
82
84
|
}
|
|
83
85
|
/** One model as reported (and enriched) by a local server. */
|
|
84
86
|
interface LocalModel {
|
|
@@ -180,6 +182,14 @@ declare function findProbedModel(probes: readonly LocalEndpointProbe[], modelId:
|
|
|
180
182
|
endpoint: LocalEndpoint;
|
|
181
183
|
} | undefined;
|
|
182
184
|
|
|
185
|
+
/** How a vision model writes screen coordinates when asked to point at something. */
|
|
186
|
+
type PointScale = "pixels" | "norm1000";
|
|
187
|
+
/**
|
|
188
|
+
* The coordinate scale a model answers in, from its id. Works on bare ids (`qwen3-vl:8b`),
|
|
189
|
+
* local ids (`local/lmstudio/qwen/qwen3.5-27b`) and OpenRouter ids (`qwen/qwen3-vl-32b-instruct`).
|
|
190
|
+
*/
|
|
191
|
+
declare function pointScale(modelId: string): PointScale;
|
|
192
|
+
|
|
183
193
|
type LogLevel = "INFO" | "ERROR" | "WARN" | "DEBUG";
|
|
184
194
|
/**
|
|
185
195
|
* Open the debug log in append mode, tagging this process with a session id and
|
|
@@ -1101,5 +1111,5 @@ interface AutoUpdater {
|
|
|
1101
1111
|
}
|
|
1102
1112
|
declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
|
|
1103
1113
|
|
|
1104
|
-
export { AUTH_PROVIDERS, AuthStorage, CHATGPT_PLAN_BASE_URL, CHATGPT_PLAN_NOT_ENABLED_MESSAGE, CHATGPT_PLAN_SCOPE, CHATGPT_USAGE_URL, CLAUDE_CODE_AUTH_KEY, CLAUDE_CODE_AUTH_MARKER, CLAUDE_CODE_MANIFEST, ChatGPTPlanNotEnabledError, ChatGPTSignInError, DEFAULT_LOCAL_ENDPOINTS, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, KIMI_CODE_DEFAULT_BASE_URL, KIMI_CODE_KEY, KIMI_CODE_OVERSEAS_BASE_URL, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, MINIMAX_CN_BASE_URL, MINIMAX_GLOBAL_BASE_URL, ModelInfo, NotLoggedInError, OPENAI_CHATGPT_KEY, OPENCODE_CATALOG_URLS, OPENCODE_PROVIDERS, OPENROUTER_DEFAULT_BASE_URL, PLAN_MODE_THINKING_CAP, RETIRED_SIGN_INS, SubscriptionUsageError, TelegramBot, XIAOMI_CREDITS_KEY, XIAOMI_TOKEN_PLAN_BASE_URLS, apiKeyStorageKeys, authPriorityNote, clampThinkingForPlanMode, claudeCodeAuthStatus, claudeCodeBinaryPath, claudeCodeCallbackUrl, claudeCodeConfigDir, claudeCodeEnv, claudeCodeHome, claudeCodePlatformKey, clearClaudeCodeUsage, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, detectKimiCodeBaseUrl, detectMiniMaxBaseUrl, detectXiaomiTokenPlanBaseUrl, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, ensureClaudeCodeBinary, fetchChatGPTPlanModels, fetchSubscriptionUsage, findProbedModel, formatClaudeCodeInstallProgress, formatLocalModelId, formatOpenCodeModelId, generatePKCE, getAuthProvider, getChatGPTHostId, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, isClaudeCodeAuthMarker, isKimiCodingEndpoint, isLegacyClaudeOAuth, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, localAuthStorageKey, localModelShortName, log, loginChatGPT, loginClaudeCode, logoutClaudeCode, mergeClaudeCodeRateLimit, oauthStorageKey, ollamaServedContext, openLog, parseCallbackInput, parseLocalModelId, parseOpenCodeCatalog, parseOpenRouterCatalog, probeEndpoint, providerStorageKeys, readClaudeCodeUsage, readStoredBaseUrlSync, recordClaudeCodeRateLimit, refreshChatGPTToken, registerLogCleanup, requiredKeyLabel, resample, resolveClaudeCodeBinary, revokeChatGPTSignIn, setProgressCallback, signInWithClaudeCode, signOutOfClaudeCode, storageKeyProvider, toModelInfo, transcribeVoice, verifyIdToken, withFileLock };
|
|
1105
|
-
export type { ApiKeyVariant, AuthMethod, AuthMethodMeta, AuthProviderMeta, AutoUpdateConfig, AutoUpdater, ChatGPTLoginOptions, ClaudeCodeAuthStatus, ClaudeCodeInstallProgress, ClaudeCodeManifest, ClaudeCodePlatformAsset, ClaudeCodeRateLimitInfo, ClaudeCodeRunOptions, ClaudeCodeRuntimeOptions, ClaudeCodeSignInOptions, DiscoverOptions, DiscoveryResult, DualAuthProvider, EnsureClaudeCodeOptions, FetchedSubscriptionUsageProvider, InlineButton, LocalEndpoint, LocalEndpointKind, LocalEndpointProbe, LocalModel, LogLevel, OAuthCredentials, OAuthLoginCallbacks, OpenCodeProvider, ParsedOpenCodeCatalog, ParsedOpenRouterCatalog, ProbeOptions, ProgressCallback, RetiredSignIn, SubscriptionUsageProvider, SubscriptionUsageSnapshot, SubscriptionUsageWindow, TelegramConfig, TelegramMessage, TelegramUpdate, TelegramVoiceMessage };
|
|
1114
|
+
export { AUTH_PROVIDERS, AuthStorage, CHATGPT_PLAN_BASE_URL, CHATGPT_PLAN_NOT_ENABLED_MESSAGE, CHATGPT_PLAN_SCOPE, CHATGPT_USAGE_URL, CLAUDE_CODE_AUTH_KEY, CLAUDE_CODE_AUTH_MARKER, CLAUDE_CODE_MANIFEST, ChatGPTPlanNotEnabledError, ChatGPTSignInError, DEFAULT_LOCAL_ENDPOINTS, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, KIMI_CODE_DEFAULT_BASE_URL, KIMI_CODE_KEY, KIMI_CODE_OVERSEAS_BASE_URL, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, MINIMAX_CN_BASE_URL, MINIMAX_GLOBAL_BASE_URL, ModelInfo, NotLoggedInError, OPENAI_CHATGPT_KEY, OPENCODE_CATALOG_URLS, OPENCODE_PROVIDERS, OPENROUTER_DEFAULT_BASE_URL, PLAN_MODE_THINKING_CAP, RETIRED_SIGN_INS, SubscriptionUsageError, TelegramBot, XIAOMI_CREDITS_KEY, XIAOMI_TOKEN_PLAN_BASE_URLS, apiKeyStorageKeys, authPriorityNote, clampThinkingForPlanMode, claudeCodeAuthStatus, claudeCodeBinaryPath, claudeCodeCallbackUrl, claudeCodeConfigDir, claudeCodeEnv, claudeCodeHome, claudeCodePlatformKey, clearClaudeCodeUsage, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, detectKimiCodeBaseUrl, detectMiniMaxBaseUrl, detectXiaomiTokenPlanBaseUrl, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, ensureClaudeCodeBinary, fetchChatGPTPlanModels, fetchSubscriptionUsage, findProbedModel, formatClaudeCodeInstallProgress, formatLocalModelId, formatOpenCodeModelId, generatePKCE, getAuthProvider, getChatGPTHostId, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, isClaudeCodeAuthMarker, isKimiCodingEndpoint, isLegacyClaudeOAuth, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, localAuthStorageKey, localModelShortName, log, loginChatGPT, loginClaudeCode, logoutClaudeCode, mergeClaudeCodeRateLimit, oauthStorageKey, ollamaServedContext, openLog, parseCallbackInput, parseLocalModelId, parseOpenCodeCatalog, parseOpenRouterCatalog, pointScale, probeEndpoint, providerStorageKeys, readClaudeCodeUsage, readStoredBaseUrlSync, recordClaudeCodeRateLimit, refreshChatGPTToken, registerLogCleanup, requiredKeyLabel, resample, resolveClaudeCodeBinary, revokeChatGPTSignIn, setProgressCallback, signInWithClaudeCode, signOutOfClaudeCode, storageKeyProvider, toModelInfo, transcribeVoice, verifyIdToken, withFileLock };
|
|
1115
|
+
export type { ApiKeyVariant, AuthMethod, AuthMethodMeta, AuthProviderMeta, AutoUpdateConfig, AutoUpdater, ChatGPTLoginOptions, ClaudeCodeAuthStatus, ClaudeCodeInstallProgress, ClaudeCodeManifest, ClaudeCodePlatformAsset, ClaudeCodeRateLimitInfo, ClaudeCodeRunOptions, ClaudeCodeRuntimeOptions, ClaudeCodeSignInOptions, DiscoverOptions, DiscoveryResult, DualAuthProvider, EnsureClaudeCodeOptions, FetchedSubscriptionUsageProvider, InlineButton, LocalEndpoint, LocalEndpointKind, LocalEndpointProbe, LocalModel, LogLevel, OAuthCredentials, OAuthLoginCallbacks, OpenCodeProvider, ParsedOpenCodeCatalog, ParsedOpenRouterCatalog, PointScale, ProbeOptions, ProgressCallback, RetiredSignIn, SubscriptionUsageProvider, SubscriptionUsageSnapshot, SubscriptionUsageWindow, TelegramConfig, TelegramMessage, TelegramUpdate, TelegramVoiceMessage };
|
package/dist/index.js
CHANGED
|
@@ -434,7 +434,12 @@ async function probeEndpoint(endpoint, { timeoutMs = DEFAULT_PROBE_TIMEOUT_MS, s
|
|
|
434
434
|
);
|
|
435
435
|
const enriched = await enrich(endpoint, entries, { timeoutMs, signal });
|
|
436
436
|
const pinned = contextLength(endpoint.contextLength);
|
|
437
|
-
const
|
|
437
|
+
const images = typeof endpoint.supportsImages === "boolean" ? endpoint.supportsImages : void 0;
|
|
438
|
+
const models = enriched.map((m) => ({
|
|
439
|
+
...m,
|
|
440
|
+
...pinned === void 0 ? {} : { contextWindow: pinned, contextWindowKnown: true },
|
|
441
|
+
...images === void 0 ? {} : { supportsImages: images }
|
|
442
|
+
}));
|
|
438
443
|
log("INFO", "local-models", `Probed ${endpoint.label}`, {
|
|
439
444
|
baseUrl: endpoint.baseUrl,
|
|
440
445
|
models: String(models.length)
|
|
@@ -454,7 +459,7 @@ async function enrichCustom(endpoint, entries, options) {
|
|
|
454
459
|
const root = endpointRoot(endpoint.baseUrl);
|
|
455
460
|
const props = await fetchJson(`${root}/props`, endpoint, options);
|
|
456
461
|
const nCtx = contextLength(props?.default_generation_settings?.n_ctx);
|
|
457
|
-
if (nCtx !== void 0) return llamaCppModels(endpoint, entries, nCtx);
|
|
462
|
+
if (nCtx !== void 0) return llamaCppModels(endpoint, entries, nCtx, props);
|
|
458
463
|
const lmStudio = await fetchJson(`${root}/api/v1/models`, endpoint, options);
|
|
459
464
|
if (Array.isArray(lmStudio?.models)) return enrichLmStudio(endpoint, entries, options, lmStudio);
|
|
460
465
|
return generic;
|
|
@@ -597,14 +602,16 @@ async function enrichLlamaCpp(endpoint, entries, options) {
|
|
|
597
602
|
return llamaCppModels(
|
|
598
603
|
endpoint,
|
|
599
604
|
entries,
|
|
600
|
-
contextLength(props?.default_generation_settings?.n_ctx)
|
|
605
|
+
contextLength(props?.default_generation_settings?.n_ctx),
|
|
606
|
+
props
|
|
601
607
|
);
|
|
602
608
|
}
|
|
603
|
-
function llamaCppModels(endpoint, entries, nCtx) {
|
|
609
|
+
function llamaCppModels(endpoint, entries, nCtx, props) {
|
|
604
610
|
return entries.map((entry) => ({
|
|
605
611
|
...genericModel(endpoint, entry),
|
|
606
612
|
contextWindow: nCtx ?? FALLBACK_CONTEXT_WINDOW,
|
|
607
|
-
contextWindowKnown: nCtx !== void 0
|
|
613
|
+
contextWindowKnown: nCtx !== void 0,
|
|
614
|
+
supportsImages: props?.modalities?.vision === true
|
|
608
615
|
}));
|
|
609
616
|
}
|
|
610
617
|
async function mapLimited(items, limit, fn) {
|
|
@@ -640,7 +647,7 @@ function toModelInfo(model, endpoint) {
|
|
|
640
647
|
}
|
|
641
648
|
var cache;
|
|
642
649
|
function cacheKey(endpoints) {
|
|
643
|
-
return endpoints.map((e) => `${e.id}@${e.baseUrl}#${e.contextLength ?? ""}`).join("|");
|
|
650
|
+
return endpoints.map((e) => `${e.id}@${e.baseUrl}#${e.contextLength ?? ""}#${e.supportsImages ?? ""}`).join("|");
|
|
644
651
|
}
|
|
645
652
|
async function discoverLocalModels(endpoints = DEFAULT_LOCAL_ENDPOINTS, options = {}) {
|
|
646
653
|
const key = cacheKey(endpoints);
|
|
@@ -669,6 +676,12 @@ function findProbedModel(probes, modelId) {
|
|
|
669
676
|
return void 0;
|
|
670
677
|
}
|
|
671
678
|
|
|
679
|
+
// src/point-scale.ts
|
|
680
|
+
var NORM1000_PATTERN = /qwen3[-_.]?vl|qwen3[._]?[56](?![\d])/i;
|
|
681
|
+
function pointScale(modelId) {
|
|
682
|
+
return NORM1000_PATTERN.test(modelId) ? "norm1000" : "pixels";
|
|
683
|
+
}
|
|
684
|
+
|
|
672
685
|
// src/claude-code/usage.ts
|
|
673
686
|
import fsp from "fs/promises";
|
|
674
687
|
import path from "path";
|
|
@@ -1787,6 +1800,7 @@ export {
|
|
|
1787
1800
|
parseLocalModelId,
|
|
1788
1801
|
parseOpenCodeCatalog,
|
|
1789
1802
|
parseOpenRouterCatalog,
|
|
1803
|
+
pointScale,
|
|
1790
1804
|
probeEndpoint,
|
|
1791
1805
|
providerStorageKeys,
|
|
1792
1806
|
readClaudeCodeUsage,
|