@goodandready/dsh-subscriptions 0.6.32 → 0.6.34

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/index.js CHANGED
@@ -65,7 +65,7 @@ const OK_HTML = `<!doctype html>
65
65
  </html>`
66
66
 
67
67
  export function apply(ctx, rawConfig) {
68
- const logger = typeof ctx.logger === 'function' ? ctx.logger('subscriptions') : (ctx.logger || ctx.log)
68
+ const logger = typeof ctx.logger === 'function' ? ctx.logger('subscriptions') : (ctx.logger || undefined)
69
69
  let settingsApi
70
70
 
71
71
  let cachedConfig = Config(rawConfig || {})
package/lib/updater.js CHANGED
@@ -172,7 +172,9 @@ export function readLockPid(lockPath) {
172
172
  try {
173
173
  const parsed = JSON.parse(content)
174
174
  if (parsed && typeof parsed.pid === "number") return parsed.pid
175
- } catch {}
175
+ } catch {
176
+ // Ignore invalid JSON lockfile format; fall through to numeric/regex parsing
177
+ }
176
178
  const num = parseInt(content, 10)
177
179
  if (!isNaN(num) && num > 0) return num
178
180
  const match = /\b(\d{1,8})\b/.exec(content)
@@ -220,7 +222,9 @@ export function checkAndCleanLock(profileDir, childPid) {
220
222
  try {
221
223
  rmSync(lockPath, { recursive: true, force: true })
222
224
  return { locked: false, cleaned: true }
223
- } catch {}
225
+ } catch {
226
+ // Ignore lockfile removal failure on fallback cleanup
227
+ }
224
228
  }
225
229
  return { locked: true }
226
230
  }
@@ -252,9 +256,9 @@ export async function installExactPackage(target, packageSpec, options = {}) {
252
256
  const timeoutMs = options.timeoutMs ?? UPDATE_TIMEOUT_MS
253
257
  const timer = setTimeout(() => {
254
258
  timedOut = true
255
- try { child.kill('SIGTERM') } catch {}
259
+ try { child.kill('SIGTERM') } catch { /* ignore if process is already terminated */ }
256
260
  setTimeout(() => {
257
- try { child.kill('SIGKILL') } catch {}
261
+ try { child.kill('SIGKILL') } catch { /* ignore if process is already terminated */ }
258
262
  checkAndCleanLock(target.profileDir, child.pid)
259
263
  }, 500).unref?.()
260
264
  reject(new Error('Update timed out; use the normal DSH update flow.'))
@@ -4,9 +4,9 @@ import { openaiChatStream, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'cody'
7
- export const CODY_API_BASE = 'https://sourcegraph.com/.api'
7
+ const CODY_API_BASE = 'https://sourcegraph.com/.api'
8
8
 
9
- export const CODY_MODELS = [
9
+ const CODY_MODELS = [
10
10
  {
11
11
  id: 'cody-claude-3.5-sonnet',
12
12
  name: 'Claude 3.5 Sonnet (Sourcegraph Cody)',
@@ -17,7 +17,7 @@ export const CODY_MODELS = [
17
17
  ]
18
18
 
19
19
  /** Catalog id -> Sourcegraph model name. */
20
- export const CODY_MODEL_ALIASES = {
20
+ const CODY_MODEL_ALIASES = {
21
21
  'cody-claude-3.5-sonnet': 'claude-3-5-sonnet',
22
22
  }
23
23
 
@@ -8,11 +8,11 @@ export const id = "copilot"
8
8
  export const COPILOT_CLIENT_ID = "Iv1.b507a08c87ecfe98"
9
9
  export const COPILOT_DEVICE_CODE_URL = "https://github.com/login/device/code"
10
10
  export const COPILOT_DEVICE_TOKEN_URL = "https://github.com/login/oauth/access_token"
11
- export const COPILOT_TOKEN_URL = "https://api.github.com/copilot_internal/v2/token"
12
- export const COPILOT_API_URL = "https://api.githubcopilot.com/chat/completions"
13
- export const COPILOT_USER_URL = "https://api.github.com/user"
11
+ const COPILOT_TOKEN_URL = "https://api.github.com/copilot_internal/v2/token"
12
+ const COPILOT_API_URL = "https://api.githubcopilot.com/chat/completions"
13
+ const COPILOT_USER_URL = "https://api.github.com/user"
14
14
 
15
- export const COPILOT_MODELS = [
15
+ const COPILOT_MODELS = [
16
16
  {
17
17
  id: "claude-3.7-sonnet",
18
18
  name: "Claude 3.7 Sonnet (Copilot)",
@@ -198,7 +198,7 @@ export async function refresh(cfg, blob, fetchImpl) {
198
198
  }
199
199
  }
200
200
 
201
- export async function exchangeCopilotToken(githubToken, fetchImpl) {
201
+ async function exchangeCopilotToken(githubToken, fetchImpl) {
202
202
  const impl = fetchImpl || fetch
203
203
  const res = await impl(COPILOT_TOKEN_URL, {
204
204
  method: "GET",
@@ -5,12 +5,12 @@ import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'cursor'
7
7
 
8
- export const CURSOR_API_BASE = 'https://api2.cursor.sh'
9
- export const CURSOR_USAGE_URL = 'https://api2.cursor.sh/aiserver.v1.DashboardService/GetCurrentPeriodUsage'
10
- export const CURSOR_AGENT_URL = 'https://agentn.us.api5.cursor.sh/agent.v1.AgentService/Run'
11
- export const CURSOR_CLIENT_VERSION = 'cli-2026.05.01-eea359f'
8
+ const CURSOR_API_BASE = 'https://api2.cursor.sh'
9
+ const CURSOR_USAGE_URL = 'https://api2.cursor.sh/aiserver.v1.DashboardService/GetCurrentPeriodUsage'
10
+ const CURSOR_AGENT_URL = 'https://agentn.us.api5.cursor.sh/agent.v1.AgentService/Run'
11
+ const CURSOR_CLIENT_VERSION = 'cli-2026.05.01-eea359f'
12
12
 
13
- export const CURSOR_MODELS = [
13
+ const CURSOR_MODELS = [
14
14
  {
15
15
  id: 'composer-2.5',
16
16
  name: 'Composer 2.5 Fast',
@@ -5,9 +5,9 @@ import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'ernie'
7
7
  export const ERNIE_OAUTH_URL = 'https://aip.baidubce.com/oauth/2.0/token'
8
- export const ERNIE_BASE_URL = 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat'
8
+ const ERNIE_BASE_URL = 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat'
9
9
 
10
- export const ERNIE_MODELS = [
10
+ const ERNIE_MODELS = [
11
11
  {
12
12
  id: 'ernie-speed-128k',
13
13
  name: 'ERNIE Speed 128K',
@@ -43,7 +43,7 @@ export async function listModels() {
43
43
  return ERNIE_MODELS
44
44
  }
45
45
 
46
- export async function refreshErnieToken(apiKey, secretKey, fetchImpl) {
46
+ async function refreshErnieToken(apiKey, secretKey, fetchImpl) {
47
47
  const impl = fetchImpl || fetch
48
48
  const url = `${ERNIE_OAUTH_URL}?grant_type=client_credentials&client_id=${encodeURIComponent(apiKey)}&client_secret=${encodeURIComponent(secretKey)}`
49
49
  const res = await impl(url, { method: 'POST' })
@@ -5,11 +5,11 @@ import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'glm'
7
7
 
8
- export const GLM_CODING_URL = 'https://api.z.ai/api/coding/paas/v4/chat/completions'
9
- export const GLM_QUOTA_URL = 'https://api.z.ai/api/monitor/usage/quota/limit'
10
- export const GLM_USER_AGENT = 'ZCode/3.10.1'
8
+ const GLM_CODING_URL = 'https://api.z.ai/api/coding/paas/v4/chat/completions'
9
+ const GLM_QUOTA_URL = 'https://api.z.ai/api/monitor/usage/quota/limit'
10
+ const GLM_USER_AGENT = 'ZCode/3.10.1'
11
11
 
12
- export const GLM_MODELS = [
12
+ const GLM_MODELS = [
13
13
  {
14
14
  id: 'glm-4-plus',
15
15
  name: 'GLM-4-Plus (Coding Plan)',
@@ -4,9 +4,9 @@ import { openaiChatStream, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'jetbrains'
7
- export const JETBRAINS_API_BASE = 'https://api.jetbrains.ai'
7
+ const JETBRAINS_API_BASE = 'https://api.jetbrains.ai'
8
8
 
9
- export const JETBRAINS_MODELS = [
9
+ const JETBRAINS_MODELS = [
10
10
  {
11
11
  id: 'jb-claude-3.5-sonnet',
12
12
  name: 'Claude 3.5 Sonnet (JetBrains AI)',
@@ -5,12 +5,12 @@ import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'kimi'
7
7
 
8
- export const KIMI_CLIENT_ID = '17e5f671-d194-4dfb-9706-5516cb48c098'
9
- export const KIMI_DEVICE_URL = 'https://auth.kimi.com/api/oauth/device_authorization'
10
- export const KIMI_TOKEN_URL = 'https://auth.kimi.com/api/oauth/token'
11
- export const KIMI_API_BASE = 'https://api.kimi.com/coding/v1'
8
+ const KIMI_CLIENT_ID = '17e5f671-d194-4dfb-9706-5516cb48c098'
9
+ const KIMI_DEVICE_URL = 'https://auth.kimi.com/api/oauth/device_authorization'
10
+ const KIMI_TOKEN_URL = 'https://auth.kimi.com/api/oauth/token'
11
+ const KIMI_API_BASE = 'https://api.kimi.com/coding/v1'
12
12
 
13
- export const KIMI_MODELS = [
13
+ const KIMI_MODELS = [
14
14
  {
15
15
  id: 'kimi-for-coding',
16
16
  name: 'Kimi for Coding (256k)',
@@ -5,9 +5,9 @@ import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'kiro'
7
7
 
8
- export const KIRO_PORTAL_URL = 'https://app.kiro.dev'
9
- export const KIRO_API_BASE = 'https://prod.us-east-1.auth.desktop.kiro.dev'
10
- export const KIRO_MODELS = [
8
+ const KIRO_PORTAL_URL = 'https://app.kiro.dev'
9
+ const KIRO_API_BASE = 'https://prod.us-east-1.auth.desktop.kiro.dev'
10
+ const KIRO_MODELS = [
11
11
  {
12
12
  id: 'claude-sonnet-5',
13
13
  name: 'Claude Sonnet 5 (Kiro)',
@@ -4,9 +4,9 @@ import { openaiChatStream, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'perplexity'
7
- export const PERPLEXITY_API_BASE = 'https://api.perplexity.ai'
7
+ const PERPLEXITY_API_BASE = 'https://api.perplexity.ai'
8
8
 
9
- export const PERPLEXITY_MODELS = [
9
+ const PERPLEXITY_MODELS = [
10
10
  {
11
11
  id: 'sonar-reasoning-pro',
12
12
  name: 'Sonar Reasoning Pro',
@@ -4,9 +4,9 @@ import { openaiChatStream, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'qwen'
7
- export const QWEN_API_BASE = 'https://dashscope.aliyuncs.com/compatible-mode/v1'
7
+ const QWEN_API_BASE = 'https://dashscope.aliyuncs.com/compatible-mode/v1'
8
8
 
9
- export const QWEN_MODELS = [
9
+ const QWEN_MODELS = [
10
10
  {
11
11
  id: 'qwen-2.5-coder-32b-instruct',
12
12
  name: 'Qwen 2.5 Coder 32B',
@@ -4,9 +4,9 @@ import { openaiChatStream, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'replit'
7
- export const REPLIT_API_BASE = 'https://replit.com/api/v1/ai'
7
+ const REPLIT_API_BASE = 'https://replit.com/api/v1/ai'
8
8
 
9
- export const REPLIT_MODELS = [
9
+ const REPLIT_MODELS = [
10
10
  {
11
11
  id: 'replit-code-v2',
12
12
  name: 'Replit Code Agent V2',
@@ -4,9 +4,9 @@ import { openaiChatStream, httpError } from '../wire.js'
4
4
  import { asUsageSnapshot } from '../usage.js'
5
5
 
6
6
  export const id = 'spark'
7
- export const SPARK_API_BASE = 'https://spark-api-open.xf-yun.com/v1'
7
+ const SPARK_API_BASE = 'https://spark-api-open.xf-yun.com/v1'
8
8
 
9
- export const SPARK_MODELS = [
9
+ const SPARK_MODELS = [
10
10
  {
11
11
  id: 'spark-max',
12
12
  name: 'iFlytek Spark Max',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-subscriptions",
3
- "version": "0.6.32",
3
+ "version": "0.6.34",
4
4
  "description": "Use ChatGPT Codex, Claude, Grok, Antigravity, Kimi, GLM, Cursor, Kiro, Copilot, Qwen, ERNIE, Spark, JetBrains, Perplexity, Replit, and Cody subscriptions as DeepSeek Harness LLM providers via OAuth.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@deepseek-ai/cordis": "^4.0.1",
57
- "@deepseek-ai/dsh-credentials": "^0.1.0-rc.6",
58
- "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.6",
59
- "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
60
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
57
+ "@deepseek-ai/dsh-credentials": "^0.1.7-rc.2 || ^0.2.0-rc.1",
58
+ "@deepseek-ai/dsh-host-webserver": "^0.1.7-rc.2 || ^0.2.0-rc.1",
59
+ "@deepseek-ai/dsh-llm": "^0.1.7-rc.2 || ^0.2.0-rc.1",
60
+ "@deepseek-ai/dsh-settings": "^0.1.7-rc.2 || ^0.2.0-rc.1",
61
61
  "@deepseek-ai/schemastery": "^3.18.1"
62
62
  },
63
63
  "publishConfig": {