@goodandready/dsh-subscriptions 0.5.21 → 0.5.22

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.
package/lib/adapter.js CHANGED
@@ -57,6 +57,8 @@ export class SubscriptionAdapter extends LlmAdapter {
57
57
  if (typeof this.deps.hideDeprecatedModels === 'function' && this.deps.hideDeprecatedModels()) {
58
58
  models = models.filter((m) => !isDeprecatedId(String((m && m.id) || '')))
59
59
  }
60
+ // Defensive: ensure every model has the provider field set
61
+ models = models.map((m) => (m && !m.provider ? { ...m, provider } : m))
60
62
  return models
61
63
  }
62
64
 
@@ -32,8 +32,8 @@ export function providerInfo() {
32
32
 
33
33
  export function defaults() {
34
34
  return {
35
- clientId: '884354919052-36trc1jjb3tguiac32ov6cod268c5blh.apps.googleusercontent.com',
36
- clientSecret: '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',
35
+ clientId: '',
36
+ clientSecret: '',
37
37
  redirectUri: 'http://localhost:8085/oauth/callback',
38
38
  models: [
39
39
  'gemini-3.8-flash-medium',
@@ -1,5 +1,5 @@
1
1
  import { LlmError } from '@deepseek-ai/dsh-llm'
2
- import { openaiMessages, openaiTools } from '../messages.js'
2
+ import { openaiMessages, openaiTools, modelCatalog } from '../messages.js'
3
3
  import { openaiChatStream, readJson, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
@@ -64,8 +64,8 @@ export function authorizeUrl() {
64
64
  return 'https://cursor.com/settings'
65
65
  }
66
66
 
67
- export async function listModels() {
68
- return CURSOR_MODELS
67
+ export async function listModels(_blob, cfg) {
68
+ return modelCatalog(id, cfg && cfg.models ? cfg.models.map((m) => typeof m === "string" ? CURSOR_MODELS.find((c) => c.id === m) || m : m) : CURSOR_MODELS)
69
69
  }
70
70
 
71
71
  export async function usage(blob, config, fetchImpl) {
@@ -1,5 +1,5 @@
1
1
  import { LlmError } from '@deepseek-ai/dsh-llm'
2
- import { openaiMessages, openaiTools } from '../messages.js'
2
+ import { openaiMessages, openaiTools, modelCatalog } from '../messages.js'
3
3
  import { openaiChatStream, readJson, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
@@ -50,8 +50,8 @@ export function authorizeUrl() {
50
50
  return 'https://open.bigmodel.cn/usercenter/apikeys'
51
51
  }
52
52
 
53
- export async function listModels() {
54
- return GLM_MODELS
53
+ export async function listModels(_blob, cfg) {
54
+ return modelCatalog(id, cfg && cfg.models ? cfg.models : GLM_MODELS)
55
55
  }
56
56
 
57
57
  export async function usage(blob, config, fetchImpl) {
@@ -1,5 +1,5 @@
1
1
  import { LlmError } from '@deepseek-ai/dsh-llm'
2
- import { openaiMessages, openaiTools } from '../messages.js'
2
+ import { openaiMessages, openaiTools, modelCatalog } from '../messages.js'
3
3
  import { openaiChatStream, readJson, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
@@ -53,8 +53,8 @@ export function authorizeUrl() {
53
53
  return 'https://platform.moonshot.cn/console/api-keys'
54
54
  }
55
55
 
56
- export async function listModels() {
57
- return KIMI_MODELS
56
+ export async function listModels(_blob, cfg) {
57
+ return modelCatalog(id, cfg && cfg.models ? cfg.models : KIMI_MODELS)
58
58
  }
59
59
 
60
60
  export async function usage(blob, config, fetchImpl) {
@@ -1,5 +1,5 @@
1
1
  import { LlmError } from '@deepseek-ai/dsh-llm'
2
- import { openaiMessages, openaiTools } from '../messages.js'
2
+ import { openaiMessages, openaiTools, modelCatalog } from '../messages.js'
3
3
  import { openaiChatStream, readJson, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
@@ -54,8 +54,8 @@ export function authorizeUrl() {
54
54
  return `${KIRO_PORTAL_URL}/oauth/authorize`
55
55
  }
56
56
 
57
- export async function listModels() {
58
- return KIRO_MODELS
57
+ export async function listModels(_blob, cfg) {
58
+ return modelCatalog(id, cfg && cfg.models ? cfg.models : KIRO_MODELS)
59
59
  }
60
60
 
61
61
  export async function usage(blob, config, fetchImpl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-subscriptions",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "description": "Use ChatGPT Codex, Claude, Grok, and Antigravity subscriptions as DeepSeek Harness LLM providers via OAuth.",
5
5
  "license": "MIT",
6
6
  "type": "module",