@kenkaiiii/gg-core 5.87.2 → 5.87.3
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/{chunk-HMJZM62P.js → chunk-5ZYOOESD.js} +192 -300
- package/dist/chunk-5ZYOOESD.js.map +1 -0
- package/dist/index.cjs +197 -309
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -13
- package/dist/index.d.ts +2 -13
- package/dist/index.js +1 -1
- package/dist/model-registry.cjs +14 -18
- package/dist/model-registry.cjs.map +1 -1
- package/dist/model-registry.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-HMJZM62P.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModelInfo } from './model-registry.cjs';
|
|
2
2
|
export { ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, HIDDEN_PROVIDERS, MODELS, ModelBilling, clearRuntimeModels, getAllModels, getAuthStorageKey, getAuthStorageKeys, getContextWindow, getDefaultModel, getDefaultThinkingLevel, getListedModels, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getToolResultCharLimit, getVideoByteLimit, isHiddenProvider, isPaidModel, registerRuntimeModels, usesOpenAICodexTransport, withoutPaidTier } from './model-registry.cjs';
|
|
3
3
|
import { ThinkingLevel, Provider } from '@kenkaiiii/gg-ai';
|
|
4
|
+
export { getClaudeCliUserAgent, getClaudeCodeVersion, pendingClaudeCodeVersionRefresh } from '@kenkaiiii/gg-ai';
|
|
4
5
|
export { AppPaths, getAppPaths } from './paths.cjs';
|
|
5
6
|
|
|
6
7
|
declare function getSupportedThinkingLevels(provider: Provider, model: string): readonly ThinkingLevel[];
|
|
@@ -176,18 +177,6 @@ declare function closeLogger(opts?: {
|
|
|
176
177
|
*/
|
|
177
178
|
declare function withFileLock<T>(filePath: string, fn: () => Promise<T>): Promise<T>;
|
|
178
179
|
|
|
179
|
-
/** Test hook: the pending background refresh, if any. */
|
|
180
|
-
declare function pendingClaudeCodeVersionRefresh(): Promise<void> | null;
|
|
181
|
-
/**
|
|
182
|
-
* Resolve the current Claude Code release version for spoofing the claude-cli
|
|
183
|
-
* User-Agent on OAuth and inference requests. Cached in-memory for the process
|
|
184
|
-
* lifetime and on disk for 24h. Falls back to a hardcoded constant if the npm
|
|
185
|
-
* registry is unreachable and no cache exists.
|
|
186
|
-
*/
|
|
187
|
-
declare function getClaudeCodeVersion(): Promise<string>;
|
|
188
|
-
/** Build the User-Agent string Anthropic's OAuth + inference edges expect. */
|
|
189
|
-
declare function getClaudeCliUserAgent(): Promise<string>;
|
|
190
|
-
|
|
191
180
|
interface OAuthCredentials {
|
|
192
181
|
accessToken: string;
|
|
193
182
|
refreshToken: string;
|
|
@@ -847,4 +836,4 @@ interface AutoUpdater {
|
|
|
847
836
|
}
|
|
848
837
|
declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
|
|
849
838
|
|
|
850
|
-
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider,
|
|
839
|
+
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, grokCliBaseUrl, grokCliHeaders, isGrokCliEndpoint, isKimiCodingEndpoint, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, kimiCodeBaseUrl, kimiCodingHeaders, localAuthStorageKey, log, loginAnthropic, loginGemini, loginKimi, loginOpenAI, loginXai, oauthStorageKey, openLog, parseLocalModelId, probeEndpoint, providerStorageKeys, readStoredBaseUrlSync, refreshAnthropicToken, refreshGeminiToken, refreshKimiToken, refreshOpenAIToken, refreshXaiToken, registerLogCleanup, resample, setProgressCallback, toModelInfo, transcribeVoice, withFileLock };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModelInfo } from './model-registry.js';
|
|
2
2
|
export { ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, HIDDEN_PROVIDERS, MODELS, ModelBilling, clearRuntimeModels, getAllModels, getAuthStorageKey, getAuthStorageKeys, getContextWindow, getDefaultModel, getDefaultThinkingLevel, getListedModels, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getToolResultCharLimit, getVideoByteLimit, isHiddenProvider, isPaidModel, registerRuntimeModels, usesOpenAICodexTransport, withoutPaidTier } from './model-registry.js';
|
|
3
3
|
import { ThinkingLevel, Provider } from '@kenkaiiii/gg-ai';
|
|
4
|
+
export { getClaudeCliUserAgent, getClaudeCodeVersion, pendingClaudeCodeVersionRefresh } from '@kenkaiiii/gg-ai';
|
|
4
5
|
export { AppPaths, getAppPaths } from './paths.js';
|
|
5
6
|
|
|
6
7
|
declare function getSupportedThinkingLevels(provider: Provider, model: string): readonly ThinkingLevel[];
|
|
@@ -176,18 +177,6 @@ declare function closeLogger(opts?: {
|
|
|
176
177
|
*/
|
|
177
178
|
declare function withFileLock<T>(filePath: string, fn: () => Promise<T>): Promise<T>;
|
|
178
179
|
|
|
179
|
-
/** Test hook: the pending background refresh, if any. */
|
|
180
|
-
declare function pendingClaudeCodeVersionRefresh(): Promise<void> | null;
|
|
181
|
-
/**
|
|
182
|
-
* Resolve the current Claude Code release version for spoofing the claude-cli
|
|
183
|
-
* User-Agent on OAuth and inference requests. Cached in-memory for the process
|
|
184
|
-
* lifetime and on disk for 24h. Falls back to a hardcoded constant if the npm
|
|
185
|
-
* registry is unreachable and no cache exists.
|
|
186
|
-
*/
|
|
187
|
-
declare function getClaudeCodeVersion(): Promise<string>;
|
|
188
|
-
/** Build the User-Agent string Anthropic's OAuth + inference edges expect. */
|
|
189
|
-
declare function getClaudeCliUserAgent(): Promise<string>;
|
|
190
|
-
|
|
191
180
|
interface OAuthCredentials {
|
|
192
181
|
accessToken: string;
|
|
193
182
|
refreshToken: string;
|
|
@@ -847,4 +836,4 @@ interface AutoUpdater {
|
|
|
847
836
|
}
|
|
848
837
|
declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
|
|
849
838
|
|
|
850
|
-
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider,
|
|
839
|
+
export { AUTH_PROVIDERS, type ApiKeyVariant, type AuthMethod, type AuthMethodMeta, type AuthProviderMeta, AuthStorage, type AutoUpdateConfig, type AutoUpdater, DEFAULT_LOCAL_ENDPOINTS, type DiscoverOptions, type DiscoveryResult, type DualAuthProvider, FALLBACK_CONTEXT_WINDOW, GEMINI_API_KEY, GEMINI_API_KEY_BASE_URL, type InlineButton, LOCAL_API_KEY_PLACEHOLDER, LOCAL_AUTH_KEY_PREFIX, type LocalEndpoint, type LocalEndpointKind, type LocalEndpointProbe, type LocalModel, type LogLevel, MOONSHOT_OAUTH_KEY, ModelInfo, NotLoggedInError, type OAuthCredentials, type OAuthLoginCallbacks, PLAN_MODE_THINKING_CAP, type ProbeOptions, type ProgressCallback, SubscriptionUsageError, type SubscriptionUsageProvider, type SubscriptionUsageSnapshot, type SubscriptionUsageWindow, TelegramBot, type TelegramConfig, type TelegramMessage, type TelegramUpdate, type TelegramVoiceMessage, XAI_OAUTH_KEY, XIAOMI_CREDITS_KEY, authPriorityNote, clampThinkingForPlanMode, clearLocalDiscoveryCache, closeLogger, createAutoUpdater, decodeOggOpus, describeAuthMethods, discoverLocalModels, downmixToMono, dualAuthProvider, dualAuthProviderByOAuthKey, endpointRoot, fetchSubscriptionUsage, findProbedModel, formatLocalModelId, generatePKCE, getAuthProvider, getLowestThinkingLevel, getNextThinkingLevel, getSessionId, getSupportedThinkingLevels, grokCliBaseUrl, grokCliHeaders, isGrokCliEndpoint, isKimiCodingEndpoint, isLocalModelId, isLoggerOpen, isModelLoaded, isThinkingLevelSupported, kimiCodeBaseUrl, kimiCodingHeaders, localAuthStorageKey, log, loginAnthropic, loginGemini, loginKimi, loginOpenAI, loginXai, oauthStorageKey, openLog, parseLocalModelId, probeEndpoint, providerStorageKeys, readStoredBaseUrlSync, refreshAnthropicToken, refreshGeminiToken, refreshKimiToken, refreshOpenAIToken, refreshXaiToken, registerLogCleanup, resample, setProgressCallback, toModelInfo, transcribeVoice, withFileLock };
|
package/dist/index.js
CHANGED
package/dist/model-registry.cjs
CHANGED
|
@@ -79,38 +79,26 @@ function isKimiCodingEndpoint(baseUrl) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// src/auth-storage.ts
|
|
82
|
-
var
|
|
82
|
+
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
83
83
|
var import_node_fs3 = require("fs");
|
|
84
84
|
var import_node_crypto6 = __toESM(require("crypto"), 1);
|
|
85
85
|
|
|
86
86
|
// src/oauth/anthropic.ts
|
|
87
|
-
var
|
|
87
|
+
var import_node_crypto2 = __toESM(require("crypto"), 1);
|
|
88
88
|
|
|
89
89
|
// src/claude-code-version.ts
|
|
90
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
91
|
-
var import_node_path4 = __toESM(require("path"), 1);
|
|
92
|
-
|
|
93
|
-
// src/logger.ts
|
|
94
|
-
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
95
|
-
var import_node_path3 = __toESM(require("path"), 1);
|
|
96
|
-
var import_node_crypto2 = require("crypto");
|
|
97
90
|
var import_gg_ai = require("@kenkaiiii/gg-ai");
|
|
98
|
-
var MAX_BYTES = 10 * 1024 * 1024;
|
|
99
|
-
var MIN_HEADROOM_BYTES = 64 * 1024;
|
|
100
|
-
|
|
101
|
-
// src/claude-code-version.ts
|
|
102
|
-
var CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
103
91
|
|
|
104
92
|
// src/oauth/anthropic.ts
|
|
105
93
|
var CLIENT_ID = atob("OWQxYzI1MGEtZTYxYi00NGQ5LTg4ZWQtNTk0NGQxOTYyZjVl");
|
|
106
94
|
|
|
107
95
|
// src/oauth/openai.ts
|
|
108
96
|
var import_node_http = __toESM(require("http"), 1);
|
|
109
|
-
var
|
|
97
|
+
var import_node_crypto3 = __toESM(require("crypto"), 1);
|
|
110
98
|
|
|
111
99
|
// src/oauth/gemini.ts
|
|
112
100
|
var import_node_http2 = __toESM(require("http"), 1);
|
|
113
|
-
var
|
|
101
|
+
var import_node_crypto4 = __toESM(require("crypto"), 1);
|
|
114
102
|
var SCOPE = [
|
|
115
103
|
"https://www.googleapis.com/auth/cloud-platform",
|
|
116
104
|
"https://www.googleapis.com/auth/userinfo.email",
|
|
@@ -121,8 +109,16 @@ var SCOPE = [
|
|
|
121
109
|
var DEVICE_TIMEOUT_FALLBACK_MS = 10 * 60 * 1e3;
|
|
122
110
|
|
|
123
111
|
// src/file-lock.ts
|
|
124
|
-
var
|
|
125
|
-
var
|
|
112
|
+
var import_promises = __toESM(require("fs/promises"), 1);
|
|
113
|
+
var import_promises2 = require("timers/promises");
|
|
114
|
+
|
|
115
|
+
// src/logger.ts
|
|
116
|
+
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
117
|
+
var import_node_path3 = __toESM(require("path"), 1);
|
|
118
|
+
var import_node_crypto5 = require("crypto");
|
|
119
|
+
var import_gg_ai2 = require("@kenkaiiii/gg-ai");
|
|
120
|
+
var MAX_BYTES = 10 * 1024 * 1024;
|
|
121
|
+
var MIN_HEADROOM_BYTES = 64 * 1024;
|
|
126
122
|
|
|
127
123
|
// src/hidden-providers.ts
|
|
128
124
|
var HIDDEN_PROVIDERS = ["gemini"];
|