dsh-plugin-subscription-oauth 0.8.6 → 0.8.8

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.
@@ -116,6 +116,23 @@ function agentIds(payload) {
116
116
  push(id);
117
117
  }
118
118
  }
119
+ // The response also carries models under API_PROVIDER_GOOGLE_GEMINI /
120
+ // ANTHROPIC_VERTEX / OPENAI_VERTEX that the agent grouping does not name (3.1 Pro,
121
+ // 3 Flash, the flash family). Keep every one of those; NON_AGENT surfaces stay out.
122
+ // Old generations (2.5) are dropped: the picker is for the current models.
123
+ const OLD_GENERATION = /gemini-2\./;
124
+ for (const [id, value] of Object.entries(models)) {
125
+ if (NON_AGENT.test(id))
126
+ continue;
127
+ if (OLD_GENERATION.test(id))
128
+ continue;
129
+ if (!isRecord(value))
130
+ continue;
131
+ const api = value.apiProvider;
132
+ if (api === 'API_PROVIDER_GOOGLE_GEMINI' || api === 'API_PROVIDER_ANTHROPIC_VERTEX' || api === 'API_PROVIDER_OPENAI_VERTEX') {
133
+ push(id);
134
+ }
135
+ }
119
136
  return ids;
120
137
  }
121
138
  /** Surfaces the agent envelope cannot call. */
@@ -136,6 +153,18 @@ export function parseAntigravityModels(payload) {
136
153
  if (!isRecord(payload) || !isRecord(payload.models))
137
154
  return [];
138
155
  const models = payload.models;
156
+ // TEMP diagnostics: write the raw model-id list to a file so an over-eager filter is
157
+ // inspectable after a discovery run, since the node half's stdout is unreachable in
158
+ // the desktop shell.
159
+ try {
160
+ const all = Object.keys(models);
161
+ const kept = agentIds(payload);
162
+ const { writeFileSync } = require('node:fs');
163
+ const { homedir } = require('node:os');
164
+ const { join } = require('node:path');
165
+ writeFileSync(join(homedir(), '.dsh', 'antigravity-models-debug.json'), JSON.stringify({ all, kept, dropped: all.filter((id) => !kept.includes(id)) }, null, 2), 'utf8');
166
+ }
167
+ catch { /* diagnostics never break parsing */ }
139
168
  const entries = [];
140
169
  for (const wireId of agentIds(payload)) {
141
170
  const info = modelInfo(models[wireId]);
@@ -170,6 +170,7 @@ export declare function fetchAntigravityModels(input: {
170
170
  remainingFraction?: number;
171
171
  resetTime?: string;
172
172
  }>;
173
+ raw: Record<string, unknown>;
173
174
  }>;
174
175
  /** Constructor dependencies for {@link AntigravityAdapter}. */
175
176
  export interface AntigravityAdapterOptions {
@@ -329,6 +329,16 @@ export async function fetchAntigravityModels(input) {
329
329
  if (typeof models !== 'object' || models === null) {
330
330
  throw new LlmError('Antigravity models endpoint returned no models object', 'MALFORMED_RESPONSE');
331
331
  }
332
+ // TEMP diagnostics: write the raw model-id list to a file so an over-eager filter is
333
+ // inspectable after a discovery run, since the node half's stdout is unreachable in
334
+ // the desktop shell.
335
+ try {
336
+ const { writeFileSync } = require('node:fs');
337
+ const { homedir } = require('node:os');
338
+ const { join } = require('node:path');
339
+ writeFileSync(join(homedir(), '.dsh', 'antigravity-raw-models.json'), JSON.stringify(Object.keys(models), null, 2), 'utf8');
340
+ }
341
+ catch { /* diagnostics never break parsing */ }
332
342
  // The response names far more than the agent may call; the filter keeps the
333
343
  // callable grouping and reports the per-model quota for the fallback path.
334
344
  const entries = parseAntigravityModels(payload);
@@ -341,7 +351,7 @@ export async function fetchAntigravityModels(input) {
341
351
  if (quota !== undefined)
342
352
  quotas.set(id, quota);
343
353
  }
344
- return { entries, quotas };
354
+ return { entries, quotas, raw: models };
345
355
  }
346
356
  /** One quota window in the shape the protocol uses. */
347
357
  function quotaWindow(scope, quota) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-subscription-oauth",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
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",