dsh-plugin-subscription-oauth 0.8.6 → 0.8.7

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,19 @@ 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
+ for (const [id, value] of Object.entries(models)) {
123
+ if (NON_AGENT.test(id))
124
+ continue;
125
+ if (!isRecord(value))
126
+ continue;
127
+ const api = value.apiProvider;
128
+ if (api === 'API_PROVIDER_GOOGLE_GEMINI' || api === 'API_PROVIDER_ANTHROPIC_VERTEX' || api === 'API_PROVIDER_OPENAI_VERTEX') {
129
+ push(id);
130
+ }
131
+ }
119
132
  return ids;
120
133
  }
121
134
  /** Surfaces the agent envelope cannot call. */
@@ -136,6 +149,18 @@ export function parseAntigravityModels(payload) {
136
149
  if (!isRecord(payload) || !isRecord(payload.models))
137
150
  return [];
138
151
  const models = payload.models;
152
+ // TEMP diagnostics: write the raw model-id list to a file so an over-eager filter is
153
+ // inspectable after a discovery run, since the node half's stdout is unreachable in
154
+ // the desktop shell.
155
+ try {
156
+ const all = Object.keys(models);
157
+ const kept = agentIds(payload);
158
+ const { writeFileSync } = require('node:fs');
159
+ const { homedir } = require('node:os');
160
+ const { join } = require('node:path');
161
+ writeFileSync(join(homedir(), '.dsh', 'antigravity-models-debug.json'), JSON.stringify({ all, kept, dropped: all.filter((id) => !kept.includes(id)) }, null, 2), 'utf8');
162
+ }
163
+ catch { /* diagnostics never break parsing */ }
139
164
  const entries = [];
140
165
  for (const wireId of agentIds(payload)) {
141
166
  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.7",
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",