@goodandready/dsh-subscriptions 0.6.55 → 0.6.56
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-manager.js +8 -4
- package/lib/config-schema.js +14 -0
- package/lib/index.js +5 -1
- package/lib/vendor-factory.js +10 -0
- package/package.json +1 -1
package/lib/adapter-manager.js
CHANGED
|
@@ -114,8 +114,10 @@ export function createAdapterManager({
|
|
|
114
114
|
|
|
115
115
|
if (adapterDisposed) return
|
|
116
116
|
if (!handle && claimable.length) {
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
if (ctx.llm && typeof ctx.llm.registerAdapter === 'function') {
|
|
118
|
+
handle = ctx.llm.registerAdapter(claimable, adapter)
|
|
119
|
+
registeredByUs = new Set(claimable)
|
|
120
|
+
}
|
|
119
121
|
return
|
|
120
122
|
}
|
|
121
123
|
if (!handle) {
|
|
@@ -148,8 +150,10 @@ export function createAdapterManager({
|
|
|
148
150
|
const currentGlobal = new Set((ctx.llm && typeof ctx.llm.listProviders === 'function' ? ctx.llm.listProviders() : []).map((p) => p.id))
|
|
149
151
|
const reClaimable = desired.filter((p) => !currentGlobal.has(p))
|
|
150
152
|
if (reClaimable.length) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
if (ctx.llm && typeof ctx.llm.registerAdapter === 'function') {
|
|
154
|
+
handle = ctx.llm.registerAdapter(reClaimable, adapter)
|
|
155
|
+
registeredByUs = new Set(reClaimable)
|
|
156
|
+
}
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
|
package/lib/config-schema.js
CHANGED
|
@@ -84,6 +84,20 @@ export const Config = z.object({
|
|
|
84
84
|
.description('Grok CLI identity version header. Empty uses the built-in default.'),
|
|
85
85
|
antigravityClientId: z.string().volatile().default(''),
|
|
86
86
|
antigravityRedirectUri: z.string().volatile().default(''),
|
|
87
|
+
antigravityModels: z.array(z.any()).volatile().default([])
|
|
88
|
+
.description('Custom model catalog for Antigravity.'),
|
|
89
|
+
codexOriginator: z.string().volatile().default('')
|
|
90
|
+
.description('Originator header for Codex API requests (e.g. codex_cli_rs).'),
|
|
91
|
+
codexSystemPrefix: z.string().volatile().default('')
|
|
92
|
+
.description('System prompt prefix for Codex.'),
|
|
93
|
+
codexModels: z.array(z.any()).volatile().default([])
|
|
94
|
+
.description('Custom model catalog for Codex.'),
|
|
95
|
+
claudeSystemPrefix: z.string().volatile().default('')
|
|
96
|
+
.description('System prompt prefix for Claude.'),
|
|
97
|
+
claudeModels: z.array(z.any()).volatile().default([])
|
|
98
|
+
.description('Custom model catalog for Claude.'),
|
|
99
|
+
grokModels: z.array(z.any()).volatile().default([])
|
|
100
|
+
.description('Custom model catalog for Grok.'),
|
|
87
101
|
cascadingFallback: z.boolean().volatile().default(false)
|
|
88
102
|
.description('#349 Opt-in cross-vendor fallback when all accounts of a provider are exhausted or rate limited.'),
|
|
89
103
|
cascadingChain: z.any().volatile().default({})
|
package/lib/index.js
CHANGED
|
@@ -260,7 +260,11 @@ export function apply(ctx, rawConfig) {
|
|
|
260
260
|
const cfg = live()
|
|
261
261
|
const alive = !!cfg.ollamaFallback && await ollamaAlive(ollamaBase(cfg), fetch)
|
|
262
262
|
if (alive && !ollamaHandle) {
|
|
263
|
-
try {
|
|
263
|
+
try {
|
|
264
|
+
if (ctx.llm && typeof ctx.llm.registerAdapter === 'function') {
|
|
265
|
+
ollamaHandle = ctx.llm.registerAdapter(['ollama'], ollamaAdapter)
|
|
266
|
+
}
|
|
267
|
+
} catch { /* already registered elsewhere */ }
|
|
264
268
|
} else if (!alive && ollamaHandle) {
|
|
265
269
|
try { ollamaHandle() } catch { /* already gone */ }
|
|
266
270
|
ollamaHandle = undefined
|
package/lib/vendor-factory.js
CHANGED
|
@@ -139,6 +139,16 @@ export function validateProfile(raw) {
|
|
|
139
139
|
}
|
|
140
140
|
if (!/^[a-z][a-z0-9_]*$/.test(p.id)) throw new Error(`customVendors: id "${p.id}" must match [a-z][a-z0-9_]*`)
|
|
141
141
|
if (p.tokenStyle && !["form", "json"].includes(p.tokenStyle)) throw new Error(`customVendors[${p.id}]: tokenStyle must be form|json`)
|
|
142
|
+
for (const key of ["authUrl", "tokenUrl", "baseUrl"]) {
|
|
143
|
+
try {
|
|
144
|
+
const u = new URL(p[key])
|
|
145
|
+
if (u.protocol !== "https:" && u.protocol !== "http:") {
|
|
146
|
+
throw new Error("protocol must be http: or https:")
|
|
147
|
+
}
|
|
148
|
+
} catch (e) {
|
|
149
|
+
throw new Error(`customVendors[${p.id}]: field ${key} must be a valid http(s) URL (${e.message || e})`)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
142
152
|
return {
|
|
143
153
|
id: p.id,
|
|
144
154
|
displayName: p.displayName || p.id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-subscriptions",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.56",
|
|
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",
|