@kenkaiiii/gg-core 5.82.0 → 5.83.1

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.
@@ -64,10 +64,35 @@ interface ModelInfo {
64
64
  * every MiMo model, so a Credits-only user still reaches these).
65
65
  * - `mimo-v2.6-pro-ultraspeed`: `[XIAOMI_CREDITS_KEY]` only — not served
66
66
  * over the Token Plan endpoint, so there's no fallback to it.
67
+ * - every Gemini model: `[GEMINI_API_KEY, "gemini"]` — an AI Studio API key
68
+ * first (the user chose to pay per token, and Code Assist OAuth now
69
+ * refuses personal accounts), then the Code Assist OAuth login.
67
70
  * Falls back to `[provider]` — the normal single-credential case — when
68
71
  * unset. Read via `getAuthStorageKeys()` / `getAuthStorageKey()`.
69
72
  */
70
73
  authStorageKeys?: string[];
74
+ /**
75
+ * How this model bills beyond the normal plan/API rate, shown wherever the
76
+ * model is picked or active. Only set where picking the model changes what
77
+ * the user pays: `paid` marks real money (Claude fast mode bills usage
78
+ * credits, never included plan usage), unset `paid` a plan-usage multiplier.
79
+ */
80
+ billing?: ModelBilling;
81
+ }
82
+ interface ModelBilling {
83
+ /** Short picker label, e.g. "bills usage credits". */
84
+ label: string;
85
+ /** One-sentence explanation for tooltips and notes. */
86
+ detail: string;
87
+ /** True when choosing the model spends real money, not just plan allowance. */
88
+ paid: boolean;
89
+ /**
90
+ * The same-provider model to run instead wherever a paid tier must not be
91
+ * carried silently (saved defaults, restored sessions, Ken, sub-agents, goal
92
+ * workers). Required when `paid` is true; registry tests enforce that it is
93
+ * registered, same-provider and itself not paid.
94
+ */
95
+ standardModel?: string;
71
96
  }
72
97
  declare const MODELS: ModelInfo[];
73
98
  /** Add (or replace) runtime-discovered models. Later registrations win by id. */
@@ -81,6 +106,21 @@ declare function clearRuntimeModels(predicate?: (model: ModelInfo) => boolean):
81
106
  declare function getAllModels(): ModelInfo[];
82
107
  declare function getModel(id: string): ModelInfo | undefined;
83
108
  declare function getModelsForProvider(provider: Provider): ModelInfo[];
109
+ /** True when running `modelId` spends real money (Claude fast mode, MiMo UltraSpeed). */
110
+ declare function isPaidModel(modelId: string): boolean;
111
+ /**
112
+ * The model to run instead of a paid tier: its `billing.standardModel`
113
+ * (`claude-opus-5-5-fast` → `claude-opus-5-5`, `mimo-v2.6-pro-ultraspeed` →
114
+ * `mimo-v2.6-pro`); every unpaid id is returned unchanged. A paid tier must be
115
+ * picked on purpose for the one session the user is watching, so everything
116
+ * that would otherwise carry it silently (saved defaults, restored sessions,
117
+ * Ken following GG, sub-agents, goal workers) runs through this instead.
118
+ *
119
+ * Fails closed: when the standard model is missing, unregistered or itself
120
+ * paid, it falls back to the provider's default, then the global default —
121
+ * never to the paid id.
122
+ */
123
+ declare function withoutPaidTier(modelId: string): string;
84
124
  /**
85
125
  * Ordered auth-storage keys to try resolving credentials from for
86
126
  * `(provider, model)`, first match wins. Almost every model just uses its
@@ -147,4 +187,4 @@ declare function getDefaultThinkingLevel(modelId: string, options?: {
147
187
  */
148
188
  declare function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo;
149
189
 
150
- export { type ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, MODELS, type ModelInfo, clearRuntimeModels, getAllModels, getAuthStorageKey, getAuthStorageKeys, getContextWindow, getDefaultModel, getDefaultThinkingLevel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getToolResultCharLimit, getVideoByteLimit, registerRuntimeModels, usesOpenAICodexTransport };
190
+ export { type ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, MODELS, type ModelBilling, type ModelInfo, clearRuntimeModels, getAllModels, getAuthStorageKey, getAuthStorageKeys, getContextWindow, getDefaultModel, getDefaultThinkingLevel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getToolResultCharLimit, getVideoByteLimit, isPaidModel, registerRuntimeModels, usesOpenAICodexTransport, withoutPaidTier };
@@ -64,10 +64,35 @@ interface ModelInfo {
64
64
  * every MiMo model, so a Credits-only user still reaches these).
65
65
  * - `mimo-v2.6-pro-ultraspeed`: `[XIAOMI_CREDITS_KEY]` only — not served
66
66
  * over the Token Plan endpoint, so there's no fallback to it.
67
+ * - every Gemini model: `[GEMINI_API_KEY, "gemini"]` — an AI Studio API key
68
+ * first (the user chose to pay per token, and Code Assist OAuth now
69
+ * refuses personal accounts), then the Code Assist OAuth login.
67
70
  * Falls back to `[provider]` — the normal single-credential case — when
68
71
  * unset. Read via `getAuthStorageKeys()` / `getAuthStorageKey()`.
69
72
  */
70
73
  authStorageKeys?: string[];
74
+ /**
75
+ * How this model bills beyond the normal plan/API rate, shown wherever the
76
+ * model is picked or active. Only set where picking the model changes what
77
+ * the user pays: `paid` marks real money (Claude fast mode bills usage
78
+ * credits, never included plan usage), unset `paid` a plan-usage multiplier.
79
+ */
80
+ billing?: ModelBilling;
81
+ }
82
+ interface ModelBilling {
83
+ /** Short picker label, e.g. "bills usage credits". */
84
+ label: string;
85
+ /** One-sentence explanation for tooltips and notes. */
86
+ detail: string;
87
+ /** True when choosing the model spends real money, not just plan allowance. */
88
+ paid: boolean;
89
+ /**
90
+ * The same-provider model to run instead wherever a paid tier must not be
91
+ * carried silently (saved defaults, restored sessions, Ken, sub-agents, goal
92
+ * workers). Required when `paid` is true; registry tests enforce that it is
93
+ * registered, same-provider and itself not paid.
94
+ */
95
+ standardModel?: string;
71
96
  }
72
97
  declare const MODELS: ModelInfo[];
73
98
  /** Add (or replace) runtime-discovered models. Later registrations win by id. */
@@ -81,6 +106,21 @@ declare function clearRuntimeModels(predicate?: (model: ModelInfo) => boolean):
81
106
  declare function getAllModels(): ModelInfo[];
82
107
  declare function getModel(id: string): ModelInfo | undefined;
83
108
  declare function getModelsForProvider(provider: Provider): ModelInfo[];
109
+ /** True when running `modelId` spends real money (Claude fast mode, MiMo UltraSpeed). */
110
+ declare function isPaidModel(modelId: string): boolean;
111
+ /**
112
+ * The model to run instead of a paid tier: its `billing.standardModel`
113
+ * (`claude-opus-5-5-fast` → `claude-opus-5-5`, `mimo-v2.6-pro-ultraspeed` →
114
+ * `mimo-v2.6-pro`); every unpaid id is returned unchanged. A paid tier must be
115
+ * picked on purpose for the one session the user is watching, so everything
116
+ * that would otherwise carry it silently (saved defaults, restored sessions,
117
+ * Ken following GG, sub-agents, goal workers) runs through this instead.
118
+ *
119
+ * Fails closed: when the standard model is missing, unregistered or itself
120
+ * paid, it falls back to the provider's default, then the global default —
121
+ * never to the paid id.
122
+ */
123
+ declare function withoutPaidTier(modelId: string): string;
84
124
  /**
85
125
  * Ordered auth-storage keys to try resolving credentials from for
86
126
  * `(provider, model)`, first match wins. Almost every model just uses its
@@ -147,4 +187,4 @@ declare function getDefaultThinkingLevel(modelId: string, options?: {
147
187
  */
148
188
  declare function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo;
149
189
 
150
- export { type ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, MODELS, type ModelInfo, clearRuntimeModels, getAllModels, getAuthStorageKey, getAuthStorageKeys, getContextWindow, getDefaultModel, getDefaultThinkingLevel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getToolResultCharLimit, getVideoByteLimit, registerRuntimeModels, usesOpenAICodexTransport };
190
+ export { type ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, MODELS, type ModelBilling, type ModelInfo, clearRuntimeModels, getAllModels, getAuthStorageKey, getAuthStorageKeys, getContextWindow, getDefaultModel, getDefaultThinkingLevel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getToolResultCharLimit, getVideoByteLimit, isPaidModel, registerRuntimeModels, usesOpenAICodexTransport, withoutPaidTier };
@@ -14,9 +14,11 @@ import {
14
14
  getSummaryModel,
15
15
  getToolResultCharLimit,
16
16
  getVideoByteLimit,
17
+ isPaidModel,
17
18
  registerRuntimeModels,
18
- usesOpenAICodexTransport
19
- } from "./chunk-6MT277JN.js";
19
+ usesOpenAICodexTransport,
20
+ withoutPaidTier
21
+ } from "./chunk-JJED477O.js";
20
22
  import "./chunk-EAIPT76S.js";
21
23
  export {
22
24
  DEFAULT_MAX_VIDEO_BYTES,
@@ -34,7 +36,9 @@ export {
34
36
  getSummaryModel,
35
37
  getToolResultCharLimit,
36
38
  getVideoByteLimit,
39
+ isPaidModel,
37
40
  registerRuntimeModels,
38
- usesOpenAICodexTransport
41
+ usesOpenAICodexTransport,
42
+ withoutPaidTier
39
43
  };
40
44
  //# sourceMappingURL=model-registry.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenkaiiii/gg-core",
3
- "version": "5.82.0",
3
+ "version": "5.83.1",
4
4
  "type": "module",
5
5
  "description": "Provider-agnostic, UI-free shared foundation: model registry, auth, paths, telegram, voice",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@kenkaiiii/gg-ai": "5.82.0"
39
+ "@kenkaiiii/gg-ai": "5.83.1"
40
40
  },
41
41
  "optionalDependencies": {
42
42
  "@huggingface/transformers": "4.2.0",