dsh-plugin-subscription-oauth 0.8.9 → 0.8.11
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.
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { UsageWindow } from '../protocol.js';
|
|
16
16
|
import type { CatalogEntry } from './catalog.js';
|
|
17
|
+
/** True when a model id names a specific tier of a family, not a model with a ladder. */
|
|
18
|
+
export declare function isTierSuffixed(id: string): boolean;
|
|
19
|
+
/** The base family a tier-suffixed id belongs to (`gemini-3.5-flash-low` → `gemini-3.5-flash`). */
|
|
20
|
+
export declare function baseFamilyOf(id: string): string;
|
|
17
21
|
/** Antigravity's own reasoning ladder, per model family. */
|
|
18
22
|
export declare function antigravityEffortsFor(model: string): readonly string[];
|
|
19
23
|
/**
|
|
@@ -48,6 +48,16 @@ function modelInfo(raw) {
|
|
|
48
48
|
...raw.supportsImages === true ? { supportsImages: true } : {},
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
/** A model id whose suffix fixes its reasoning tier, not a ladder the picker offers. */
|
|
52
|
+
const TIER_SUFFIXED = /-(?:low|medium|high|extra-low|max)$/i;
|
|
53
|
+
/** True when a model id names a specific tier of a family, not a model with a ladder. */
|
|
54
|
+
export function isTierSuffixed(id) {
|
|
55
|
+
return TIER_SUFFIXED.test(id);
|
|
56
|
+
}
|
|
57
|
+
/** The base family a tier-suffixed id belongs to (`gemini-3.5-flash-low` → `gemini-3.5-flash`). */
|
|
58
|
+
export function baseFamilyOf(id) {
|
|
59
|
+
return id.replace(/-(?:extra-low|low|medium|high|max)$/i, '');
|
|
60
|
+
}
|
|
51
61
|
/** Antigravity's own reasoning ladder, per model family. */
|
|
52
62
|
export function antigravityEffortsFor(model) {
|
|
53
63
|
if (/^claude-/.test(model))
|
|
@@ -166,8 +176,28 @@ export function parseAntigravityModels(payload) {
|
|
|
166
176
|
}
|
|
167
177
|
catch { /* diagnostics never break parsing */ }
|
|
168
178
|
const entries = [];
|
|
179
|
+
const seenBase = new Set();
|
|
169
180
|
for (const wireId of agentIds(payload)) {
|
|
170
181
|
const info = modelInfo(models[wireId]);
|
|
182
|
+
// Tier-suffixed ids (gemini-3.5-flash-low, …-high) are the family's fixed tiers;
|
|
183
|
+
// they fold into the base family row so the picker shows one entry with a ladder,
|
|
184
|
+
// not one row per tier. The base row is inserted the first time a tier of it is seen.
|
|
185
|
+
if (isTierSuffixed(wireId)) {
|
|
186
|
+
const base = baseFamilyOf(wireId);
|
|
187
|
+
if (seenBase.has(base))
|
|
188
|
+
continue;
|
|
189
|
+
seenBase.add(base);
|
|
190
|
+
const baseInfo = modelInfo(models[base]) ?? info;
|
|
191
|
+
entries.push({
|
|
192
|
+
id: base,
|
|
193
|
+
name: displayNameOf(base, models[base] ?? {}),
|
|
194
|
+
contextWindow: baseInfo.maxTokens ?? baseInfo.maxInputTokens ?? baseInfo.inputTokenLimit ?? 1_048_576,
|
|
195
|
+
inputModalities: baseInfo.supportsImages === true ? ['text', 'image'] : ['text'],
|
|
196
|
+
reasoningEfforts: antigravityEffortsFor(base),
|
|
197
|
+
});
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
seenBase.add(wireId);
|
|
171
201
|
const tiers = /-(?:low|medium|high)$/.test(wireId);
|
|
172
202
|
const efforts = tiers ? [] : antigravityEffortsFor(wireId);
|
|
173
203
|
const contextWindow = info.maxTokens ?? info.maxInputTokens ?? info.inputTokenLimit ?? 1_048_576;
|
package/lib/providers/grok.d.ts
CHANGED
|
@@ -112,6 +112,10 @@ interface GrokCliMetadata {
|
|
|
112
112
|
reasoningEfforts?: readonly string[];
|
|
113
113
|
defaultEffort?: string;
|
|
114
114
|
}
|
|
115
|
+
/** True when a model id names a fast/lightspeed variant of a base model. */
|
|
116
|
+
export declare function isFastVariant(id: string): boolean;
|
|
117
|
+
/** The base model id a fast variant belongs to (`grok-4.7-fast` → `grok-4.7`). */
|
|
118
|
+
export declare function baseModelOf(id: string): string;
|
|
115
119
|
/** Constructor dependencies for {@link GrokAdapter}. */
|
|
116
120
|
export interface GrokAdapterOptions {
|
|
117
121
|
/** API base; `<base>/responses` and `<base>/models`. */
|
package/lib/providers/grok.js
CHANGED
|
@@ -262,6 +262,16 @@ export async function refreshGrokToken(input) {
|
|
|
262
262
|
}
|
|
263
263
|
/** Model ids that are clearly not chat models. */
|
|
264
264
|
const NON_CHAT_ID = /(?:^|[-_/])(?:image|video|imagine|embed|embedding|whisper|tts|vision-only)/i;
|
|
265
|
+
/** Model ids that are the fast/lightspeed variant of a base model, matched per base. */
|
|
266
|
+
const FAST_VARIANT = /(?:^|[-_])(?:fast|lightspeed|turbo|quick)$/i;
|
|
267
|
+
/** True when a model id names a fast/lightspeed variant of a base model. */
|
|
268
|
+
export function isFastVariant(id) {
|
|
269
|
+
return FAST_VARIANT.test(id);
|
|
270
|
+
}
|
|
271
|
+
/** The base model id a fast variant belongs to (`grok-4.7-fast` → `grok-4.7`). */
|
|
272
|
+
export function baseModelOf(id) {
|
|
273
|
+
return id.replace(FAST_VARIANT, '');
|
|
274
|
+
}
|
|
265
275
|
/** Grok wire adapter: one instance serves the `grok` provider route. */
|
|
266
276
|
export class GrokAdapter extends LlmAdapter {
|
|
267
277
|
options;
|
|
@@ -514,13 +524,18 @@ export class GrokAdapter extends LlmAdapter {
|
|
|
514
524
|
return undefined;
|
|
515
525
|
}
|
|
516
526
|
const payload = await response.json();
|
|
527
|
+
// Fast/lightspeed variants ride with their base model: they share the base's
|
|
528
|
+
// visibility switch and are reached by a picker button, not a separate row.
|
|
517
529
|
const ids = (payload.data ?? [])
|
|
518
530
|
.map((entry) => entry.id)
|
|
519
|
-
.filter((id) => typeof id === 'string' && id.length > 0 && !NON_CHAT_ID.test(id))
|
|
531
|
+
.filter((id) => typeof id === 'string' && id.length > 0 && !NON_CHAT_ID.test(id))
|
|
532
|
+
.map((id) => (isFastVariant(id) ? baseModelOf(id) : id))
|
|
533
|
+
.filter((id, index, list) => list.indexOf(id) === index);
|
|
520
534
|
if (ids.length === 0) {
|
|
521
535
|
this.options.onWarn?.('xAI model discovery returned an empty catalog; using the built-in catalog');
|
|
522
536
|
return undefined;
|
|
523
537
|
}
|
|
538
|
+
// Keep the fast-variant ids discoverable for the picker button, keyed by their base.
|
|
524
539
|
const metadata = await this.fetchCliMetadata(fetchFn, signal);
|
|
525
540
|
for (const [id, meta] of metadata)
|
|
526
541
|
this.metadata.set(id, meta);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-subscription-oauth",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.11",
|
|
4
4
|
"description": "Use subscription accounts as DeepSeek Harness LLM providers — Kimi Code (OAuth device flow), Grok / X Premium (OIDC + PKCE), Google Antigravity (Google OAuth + Cloud Code Assist) and GLM / BigModel (ZCode's browser sign-in) — with per-model visibility, drag-to-reorder Auto fallback and plan quotas from the web Settings page",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "EricFL1998",
|