@kenkaiiii/gg-core 5.106.0 → 5.107.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.d.cts CHANGED
@@ -424,9 +424,8 @@ declare function providerStorageKeys(provider: string): string[];
424
424
  /**
425
425
  * Storage key for the Xiaomi API Credits credential (`https://api.xiaomimimo.com/v1`).
426
426
  * Kept distinct from the `xiaomi` Token Plan entry (`token-plan-sgp.xiaomimimo.com`)
427
- * so a user can configure BOTH — `mimo-v2.6-pro-ultraspeed` is API Credits-only,
428
- * while `mimo-v2.6-pro`/`mimo-v2.6-flash` prefer the Token Plan but fall back to API
429
- * Credits when only that's configured. Which key(s) a model tries, and in what
427
+ * so a user can configure BOTH — every MiMo model prefers the Token Plan but falls
428
+ * back to API Credits when only that's configured. Which key(s) a model tries, and in what
430
429
  * order, is decided per-model via `getAuthStorageKeys()` in model-registry.ts.
431
430
  */
432
431
  declare const XIAOMI_CREDITS_KEY = "xiaomi-credits";
@@ -893,13 +892,22 @@ interface ChatGPTLoginOptions {
893
892
  hostIdFile?: string;
894
893
  /** Defaults to `~/.gg/openai-chatgpt-client.json`. */
895
894
  registrationFile?: string;
896
- /** The current sign-in, if any: its ID token skips the account picker. */
897
- previous?: Pick<OAuthCredentials, "idToken">;
895
+ /** The current sign-in, if any: its registration is reused and its ID token skips the account picker. */
896
+ previous?: Pick<OAuthCredentials, "idToken" | "clientId">;
897
+ /**
898
+ * Register afresh for another ChatGPT account or workspace instead of
899
+ * reusing a saved registration. A saved one only works for the workspace it
900
+ * was registered in; OpenAI shows "only available to members of its
901
+ * workspace" for any other, without coming back to the app.
902
+ */
903
+ newAccount?: boolean;
898
904
  /** Aborting closes the callback listener at once and rejects with an `AbortError`. */
899
905
  signal?: AbortSignal;
900
906
  }
901
907
  /** This machine's stable `ext_agent_host_id`, created on first use. */
902
908
  declare function getChatGPTHostId(file?: string): Promise<string>;
909
+ /** Emails of the ChatGPT accounts this machine has signed in with, newest first. */
910
+ declare function savedChatGPTAccounts(file?: string): Promise<string[]>;
903
911
  /**
904
912
  * Continue with ChatGPT. Registers GG Coder for this ChatGPT account on first
905
913
  * use (the user names and approves it in the browser), then reuses the issued
@@ -1111,5 +1119,5 @@ interface AutoUpdater {
1111
1119
  }
1112
1120
  declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
1113
1121
 
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 };
1122
+ 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, savedChatGPTAccounts, setProgressCallback, signInWithClaudeCode, signOutOfClaudeCode, storageKeyProvider, toModelInfo, transcribeVoice, verifyIdToken, withFileLock };
1115
1123
  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
@@ -424,9 +424,8 @@ declare function providerStorageKeys(provider: string): string[];
424
424
  /**
425
425
  * Storage key for the Xiaomi API Credits credential (`https://api.xiaomimimo.com/v1`).
426
426
  * Kept distinct from the `xiaomi` Token Plan entry (`token-plan-sgp.xiaomimimo.com`)
427
- * so a user can configure BOTH — `mimo-v2.6-pro-ultraspeed` is API Credits-only,
428
- * while `mimo-v2.6-pro`/`mimo-v2.6-flash` prefer the Token Plan but fall back to API
429
- * Credits when only that's configured. Which key(s) a model tries, and in what
427
+ * so a user can configure BOTH — every MiMo model prefers the Token Plan but falls
428
+ * back to API Credits when only that's configured. Which key(s) a model tries, and in what
430
429
  * order, is decided per-model via `getAuthStorageKeys()` in model-registry.ts.
431
430
  */
432
431
  declare const XIAOMI_CREDITS_KEY = "xiaomi-credits";
@@ -893,13 +892,22 @@ interface ChatGPTLoginOptions {
893
892
  hostIdFile?: string;
894
893
  /** Defaults to `~/.gg/openai-chatgpt-client.json`. */
895
894
  registrationFile?: string;
896
- /** The current sign-in, if any: its ID token skips the account picker. */
897
- previous?: Pick<OAuthCredentials, "idToken">;
895
+ /** The current sign-in, if any: its registration is reused and its ID token skips the account picker. */
896
+ previous?: Pick<OAuthCredentials, "idToken" | "clientId">;
897
+ /**
898
+ * Register afresh for another ChatGPT account or workspace instead of
899
+ * reusing a saved registration. A saved one only works for the workspace it
900
+ * was registered in; OpenAI shows "only available to members of its
901
+ * workspace" for any other, without coming back to the app.
902
+ */
903
+ newAccount?: boolean;
898
904
  /** Aborting closes the callback listener at once and rejects with an `AbortError`. */
899
905
  signal?: AbortSignal;
900
906
  }
901
907
  /** This machine's stable `ext_agent_host_id`, created on first use. */
902
908
  declare function getChatGPTHostId(file?: string): Promise<string>;
909
+ /** Emails of the ChatGPT accounts this machine has signed in with, newest first. */
910
+ declare function savedChatGPTAccounts(file?: string): Promise<string[]>;
903
911
  /**
904
912
  * Continue with ChatGPT. Registers GG Coder for this ChatGPT account on first
905
913
  * use (the user names and approves it in the browser), then reuses the issued
@@ -1111,5 +1119,5 @@ interface AutoUpdater {
1111
1119
  }
1112
1120
  declare function createAutoUpdater(config: AutoUpdateConfig): AutoUpdater;
1113
1121
 
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 };
1122
+ 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, savedChatGPTAccounts, setProgressCallback, signInWithClaudeCode, signOutOfClaudeCode, storageKeyProvider, toModelInfo, transcribeVoice, verifyIdToken, withFileLock };
1115
1123
  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
@@ -80,13 +80,14 @@ import {
80
80
  registerRuntimeModels,
81
81
  resolveClaudeCodeBinary,
82
82
  revokeChatGPTSignIn,
83
+ savedChatGPTAccounts,
83
84
  setProviderCatalog,
84
85
  storageKeyProvider,
85
86
  usesOpenAICodexTransport,
86
87
  verifyIdToken,
87
88
  withFileLock,
88
89
  withoutPaidTier
89
- } from "./chunk-757P7L4T.js";
90
+ } from "./chunk-T367MVTP.js";
90
91
  import {
91
92
  getAppPaths
92
93
  } from "./chunk-GXOFTHM5.js";
@@ -934,7 +935,7 @@ var ALL_AUTH_PROVIDERS = [
934
935
  key: XIAOMI_CREDITS_KEY,
935
936
  label: "API Credits",
936
937
  kind: "payg",
937
- billing: "Pay-per-token from MiMo API Credits. Required for UltraSpeed.",
938
+ billing: "Pay-per-token from MiMo API Credits.",
938
939
  baseUrl: "https://api.xiaomimimo.com/v1"
939
940
  }
940
941
  ],
@@ -1813,6 +1814,7 @@ export {
1813
1814
  resample,
1814
1815
  resolveClaudeCodeBinary,
1815
1816
  revokeChatGPTSignIn,
1817
+ savedChatGPTAccounts,
1816
1818
  setProgressCallback,
1817
1819
  setProviderCatalog,
1818
1820
  signInWithClaudeCode,