dsh-plugin-subscription-oauth 0.8.10 → 0.8.12

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 isTierMarked(id: string): boolean;
19
+ /** The base family a tier-marked id belongs to (`gemini-3-flash-agent` → `gemini-3-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,20 @@ function modelInfo(raw) {
48
48
  ...raw.supportsImages === true ? { supportsImages: true } : {},
49
49
  };
50
50
  }
51
+ /** A model id whose suffix or infix names a fixed reasoning tier, folded into its base family. */
52
+ const TIER_MARKED = /(?:^|[-_])(?:extra-low|low|medium|high|max)(?:$|[-_])/i;
53
+ /** True when a model id names a specific tier of a family, not a model with a ladder. */
54
+ export function isTierMarked(id) {
55
+ return TIER_MARKED.test(id);
56
+ }
57
+ /** The base family a tier-marked id belongs to (`gemini-3-flash-agent` → `gemini-3-flash`). */
58
+ export function baseFamilyOf(id) {
59
+ // Remove the tier token wherever it sits (suffix or infix), then tidy any trailing
60
+ // separator the removal left behind.
61
+ return id
62
+ .replace(/[-_](?:extra-low|low|medium|high|max)(?=[-_]|$)/i, '')
63
+ .replace(/[-_]$/, '');
64
+ }
51
65
  /** Antigravity's own reasoning ladder, per model family. */
52
66
  export function antigravityEffortsFor(model) {
53
67
  if (/^claude-/.test(model))
@@ -166,8 +180,29 @@ export function parseAntigravityModels(payload) {
166
180
  }
167
181
  catch { /* diagnostics never break parsing */ }
168
182
  const entries = [];
183
+ const seenBase = new Set();
169
184
  for (const wireId of agentIds(payload)) {
170
185
  const info = modelInfo(models[wireId]);
186
+ // Tier-marked ids (gemini-3.5-flash-low, gemini-3-flash-agent, …) are the family's
187
+ // fixed tiers; they fold into the base family row so the picker shows one entry with
188
+ // a ladder, not one row per tier. The base row is inserted the first time a tier of
189
+ // it is seen.
190
+ if (isTierMarked(wireId)) {
191
+ const base = baseFamilyOf(wireId);
192
+ if (seenBase.has(base))
193
+ continue;
194
+ seenBase.add(base);
195
+ const baseInfo = modelInfo(models[base]) ?? info;
196
+ entries.push({
197
+ id: base,
198
+ name: displayNameOf(base, models[base] ?? {}),
199
+ contextWindow: baseInfo.maxTokens ?? baseInfo.maxInputTokens ?? baseInfo.inputTokenLimit ?? 1_048_576,
200
+ inputModalities: baseInfo.supportsImages === true ? ['text', 'image'] : ['text'],
201
+ reasoningEfforts: antigravityEffortsFor(base),
202
+ });
203
+ continue;
204
+ }
205
+ seenBase.add(wireId);
171
206
  const tiers = /-(?:low|medium|high)$/.test(wireId);
172
207
  const efforts = tiers ? [] : antigravityEffortsFor(wireId);
173
208
  const contextWindow = info.maxTokens ?? info.maxInputTokens ?? info.inputTokenLimit ?? 1_048_576;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-subscription-oauth",
3
- "version": "0.8.10",
3
+ "version": "0.8.12",
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",