@sagmans/dsh-provider-extra 0.5.0 → 0.6.0
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/README.md +5 -5
- package/dist/catalog-routes.js +9 -4
- package/dist/index.js +16 -2
- package/dist/login-host.js +3 -3
- package/dist/login-route.js +19 -0
- package/docs/catalog.md +7 -1
- package/package.json +25 -21
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Catalog presence does not prove endpoint availability, pricing, or metadata accu
|
|
|
28
28
|
|
|
29
29
|
- Node.js 24 LTS (verified with 24.20.0).
|
|
30
30
|
- pnpm 11.21.0 for this repository.
|
|
31
|
-
- A DeepSeek Harness install on the supported line: `>=0.1.5-rc.1 <0.
|
|
31
|
+
- A DeepSeek Harness install on the supported line: `>=0.1.5-rc.1 <0.3.0`, verified against `0.1.5-rc.2`, `0.1.5-rc.3`, `0.1.7-rc.2`, and `0.2.0-rc.2` (see [RELEASE.md](RELEASE.md#harness-matrix)). The plugin's harness peers stay open, so a profile resolves the host copy it already has rather than a second framework instance; the range itself is declared in `dsh.compatibility.dsh`.
|
|
32
32
|
|
|
33
33
|
## Install
|
|
34
34
|
|
|
@@ -42,7 +42,7 @@ dsh plugin --profile tui add @sagmans/dsh-provider-extra
|
|
|
42
42
|
A release of the harness CLI is installable without a launcher already on `PATH`:
|
|
43
43
|
|
|
44
44
|
```sh
|
|
45
|
-
pnpm dlx @deepseek-ai/dsh@0.
|
|
45
|
+
pnpm dlx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add @sagmans/dsh-provider-extra
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
The package declares `dsh.bundle.patch`. The CLI adds it to the profile's bundle list, and its patch loads the compiled plugin automatically. A bare `pnpm link` is not the registration procedure.
|
|
@@ -219,13 +219,13 @@ pnpm run check
|
|
|
219
219
|
pnpm audit --audit-level high
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
`check` runs type checking, source tests, the build, integration tests, release guards, and the package smoke.
|
|
222
|
+
`check` runs type checking, source tests, the harness matrix guard, the build, integration tests, release guards, and the package smoke. `node tools/harness-matrix.mjs` reads the declared range, the verified releases, and what every harness package declares, and fails when the three disagree; `pnpm run matrix` is the same check.
|
|
223
223
|
Package checks reject non-synthetic catalog/model declarations in shipped configuration and documentation.
|
|
224
|
-
Development setup tests use synthetic credentials-free profiles; the setup helper stays outside the npm package. The plain-Node smoke test mounts both compiled routes in the real Cordis/LLM runtime. Two CLI tests exercise add, repeated add, profile overrides, and remove in disposable web/TUI profiles; they drive the registry CLI this repository develops against (`@deepseek-ai/dsh@0.
|
|
224
|
+
Development setup tests use synthetic credentials-free profiles; the setup helper stays outside the npm package. The plain-Node smoke test mounts both compiled routes in the real Cordis/LLM runtime. Two CLI tests exercise add, repeated add, profile overrides, and remove in disposable web/TUI profiles; they drive the registry CLI this repository develops against (`@deepseek-ai/dsh@0.2.0-rc.2`), so no harness checkout is needed.
|
|
225
225
|
|
|
226
226
|
Tests use a local mock gateway or seeded grants. They require no API key, OAuth login, or paid provider requests.
|
|
227
227
|
|
|
228
|
-
CI installs from the registry with read-only permissions and no account credentials, verifies dependency signatures and attestations, and runs the same checks. New dependency releases must be at least seven days old, and `pnpm-workspace.yaml` limits which lifecycle scripts may run.
|
|
228
|
+
CI installs from the registry with read-only permissions and no account credentials, verifies dependency signatures and attestations, and runs the same checks. New dependency releases must be at least seven days old, and `pnpm-workspace.yaml` limits which lifecycle scripts may run; the harness vendor's own scope is excluded from that window, because a verified release is published inside it and the mount resolves that same vendor's packages (see [RELEASE.md](RELEASE.md#harness-matrix)).
|
|
229
229
|
|
|
230
230
|
The package smoke test does not prove a real account can authenticate or a remote provider is available. To verify those, install a candidate into a profile built on the supported harness line and send one message through each configured route.
|
|
231
231
|
|
package/dist/catalog-routes.js
CHANGED
|
@@ -291,10 +291,15 @@ export function buildCatalogProfile(input) {
|
|
|
291
291
|
const models = declarations === undefined
|
|
292
292
|
? filteredModels(raw.filter, source, input, path + '.filter')
|
|
293
293
|
: declarations.map((entry, index) => {
|
|
294
|
-
const
|
|
295
|
-
const spec = catalogRecord(entry, MODEL_FIELDS,
|
|
296
|
-
catalogString(spec.id,
|
|
297
|
-
catalogString(spec.name,
|
|
294
|
+
const declaration = path + ' "' + raw.id + '".models[' + index + ']';
|
|
295
|
+
const spec = catalogRecord(entry, MODEL_FIELDS, declaration);
|
|
296
|
+
catalogString(spec.id, declaration + '.id');
|
|
297
|
+
catalogString(spec.name, declaration + '.name');
|
|
298
|
+
// One refused declaration must be repairable from the message alone: an
|
|
299
|
+
// index into a catalog that runs to dozens of entries names neither the
|
|
300
|
+
// route nor the model, which is how a stale id a newer line's vendor
|
|
301
|
+
// dropped reached a reader as provider.models[5].
|
|
302
|
+
const location = declaration + ' "' + spec.id + '"';
|
|
298
303
|
const aliases = 'aliases' in spec ? strings(spec.aliases, location + '.aliases') : [];
|
|
299
304
|
for (const name of [spec.id, ...aliases]) {
|
|
300
305
|
if (names.has(name))
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,11 @@ export { buildCatalogProfile } from "./catalog-routes.js";
|
|
|
43
43
|
/** Settings namespace configuration surfaces address this plugin's section by. */
|
|
44
44
|
const SETTINGS_NS = 'dsh-provider-extra';
|
|
45
45
|
// Declared extra models: the composition entry and the settings section share
|
|
46
|
-
// these two shapes, so one document's declaration is valid in the other.
|
|
46
|
+
// these two shapes, so one document's declaration is valid in the other. Both
|
|
47
|
+
// are left to inference rather than annotated with the interfaces below: a
|
|
48
|
+
// schemastery release on a verified line widens a required field's output to
|
|
49
|
+
// `string | Volatile<string>` for a value a loader may pass as a getter, and an
|
|
50
|
+
// annotation in the declaration's own shape then fails to compile on that line.
|
|
47
51
|
const goExtraModelSchema = Schema.object({
|
|
48
52
|
id: Schema.string().required(),
|
|
49
53
|
name: Schema.string(),
|
|
@@ -97,6 +101,8 @@ function selection(declared) {
|
|
|
97
101
|
}
|
|
98
102
|
export const name = 'dsh-provider-extra';
|
|
99
103
|
export const inject = ['llm'];
|
|
104
|
+
// Inferred for the reason above; the section and the entry still read the same
|
|
105
|
+
// declaration form, because both are built from these two schema values.
|
|
100
106
|
const SectionSchema = Schema.object({
|
|
101
107
|
extraModels: Schema.array(goExtraModelSchema).default([]),
|
|
102
108
|
codexExtraModels: Schema.array(codexExtraModelSchema).default([]),
|
|
@@ -255,10 +261,18 @@ export function apply(ctx, config) {
|
|
|
255
261
|
ctx.logger.warn(error);
|
|
256
262
|
}
|
|
257
263
|
ctx.inject(['settings'], (settingsCtx) => {
|
|
264
|
+
const settings = settingsCtx.settings;
|
|
265
|
+
// A line with no section API publishes forms from this entry's own Config
|
|
266
|
+
// instead, and a committed form edit restarts the entry, so that line's
|
|
267
|
+
// extras arrive as a fresh mount of this apply() rather than as a
|
|
268
|
+
// notification. Installing a section there would fail on the missing
|
|
269
|
+
// method; leaving this line's Config alone would ignore every later edit.
|
|
270
|
+
if (typeof settings.installSection !== 'function')
|
|
271
|
+
return;
|
|
258
272
|
// The section overrides the entry where a settings document exists and
|
|
259
273
|
// stands in for it where none does; the settings service falls back to this
|
|
260
274
|
// same value when it detaches.
|
|
261
|
-
|
|
275
|
+
settings.installSection(ctx, SETTINGS_NS, SectionSchema, entry, {
|
|
262
276
|
setSource: (source) => { currentSection = source; },
|
|
263
277
|
// No registration facts derive from the section: the route set is fixed
|
|
264
278
|
// at composition and the adapter rebuilds its snapshot on every
|
package/dist/login-host.js
CHANGED
|
@@ -5,7 +5,7 @@ import { builtinProviders } from '@earendil-works/pi-ai/providers/all';
|
|
|
5
5
|
import { codexAuth, recordKeyFor } from "./codex.js";
|
|
6
6
|
import { createLoginCommand } from "./login-command.js";
|
|
7
7
|
import { StoredCredentialError } from "./login-contract.js";
|
|
8
|
-
import { declareProviderRoute, declaredCredentialRef } from "./login-route.js";
|
|
8
|
+
import { declareProviderRoute, declaredCredentialRef, legacySettings } from "./login-route.js";
|
|
9
9
|
import { PendingCredentialStore, proveApiKey } from "./login-verify.js";
|
|
10
10
|
const PLUGIN_NAME = 'dsh-provider-extra';
|
|
11
11
|
const GO_SOURCE = 'opencode-go';
|
|
@@ -34,7 +34,7 @@ function loginTargets(ctx, config, routes) {
|
|
|
34
34
|
: source.id === CODEX_SOURCE ? profiles.get(config.codexRouteId) : undefined;
|
|
35
35
|
// The plugin's Go adapter resolves its Config reference before considering any provider record.
|
|
36
36
|
const ref = source.id === GO_SOURCE ? config.apiKeyEnv
|
|
37
|
-
: source.id === CODEX_SOURCE && profile !== undefined ? undefined : declaredCredentialRef(ctx.get('settings'), source.id);
|
|
37
|
+
: source.id === CODEX_SOURCE && profile !== undefined ? undefined : declaredCredentialRef(legacySettings(ctx.get('settings')), source.id);
|
|
38
38
|
// Legacy Codex aliases intentionally own a separate record; their command must use that same address.
|
|
39
39
|
const credentialProvider = source.id === CODEX_SOURCE && profile !== undefined ? profile.provider : source.id;
|
|
40
40
|
return { id: source.id, provider: loginProvider(profile, source), served: profile !== undefined,
|
|
@@ -158,7 +158,7 @@ export function mountLoginCommand(ctx, config, routes) {
|
|
|
158
158
|
return 'present';
|
|
159
159
|
if (interaction.signal?.aborted)
|
|
160
160
|
return 'unavailable';
|
|
161
|
-
return declareProviderRoute(ctx.get('settings'), target.id);
|
|
161
|
+
return declareProviderRoute(legacySettings(ctx.get('settings')), target.id);
|
|
162
162
|
},
|
|
163
163
|
stored: async (id) => {
|
|
164
164
|
const target = targetFor(id);
|
package/dist/login-route.js
CHANGED
|
@@ -23,6 +23,25 @@ const API_KEY_ENV_FIELD = 'apiKeyEnv';
|
|
|
23
23
|
* this command already wrote, so an empty profile is the whole declaration.
|
|
24
24
|
*/
|
|
25
25
|
const CATALOG_ROUTE_OVERRIDES = {};
|
|
26
|
+
/**
|
|
27
|
+
* The same slice, but only when the running line still owns a per-namespace
|
|
28
|
+
* settings document.
|
|
29
|
+
*
|
|
30
|
+
* The 0.1.7 line publishes forms derived from each entry's own Config, and its
|
|
31
|
+
* service has neither reader nor writer for a namespace: the declaration this
|
|
32
|
+
* seam used to write is a profile-patch edit there. Reporting that as
|
|
33
|
+
* unavailable is the truth, where handing the service through would fail on the
|
|
34
|
+
* first read and read as a broken sign-in rather than a moved seam.
|
|
35
|
+
*
|
|
36
|
+
* @param service - whatever the composition publishes under the settings name.
|
|
37
|
+
* @returns the readable-and-writable seam, or nothing on a line without one.
|
|
38
|
+
*/
|
|
39
|
+
export function legacySettings(service) {
|
|
40
|
+
const settings = service;
|
|
41
|
+
return settings !== undefined && typeof settings.get === 'function' && typeof settings.update === 'function'
|
|
42
|
+
? settings
|
|
43
|
+
: undefined;
|
|
44
|
+
}
|
|
26
45
|
/** The configured routes, or nothing when no pi-ai service registered the namespace. */
|
|
27
46
|
function configuredProviders(value) {
|
|
28
47
|
if (typeof value !== 'object' || value === null)
|
package/docs/catalog.md
CHANGED
|
@@ -24,11 +24,16 @@ For example, a profile with these row IDs needs these overrides:
|
|
|
24
24
|
disabled: true
|
|
25
25
|
- id: llm-pi-ai
|
|
26
26
|
disabled: true
|
|
27
|
+
- id: llm-deepseek-account
|
|
28
|
+
disabled: true
|
|
29
|
+
- id: deepseek-account
|
|
30
|
+
disabled: true
|
|
27
31
|
- id: agent-default-model
|
|
28
32
|
disabled: true
|
|
29
33
|
```
|
|
30
34
|
|
|
31
35
|
Inspect the composed profile for additional provider rows or different IDs.
|
|
36
|
+
From 0.1.7 on, the base adds two more: it registers the signed-in DeepSeek account as a provider, so a catalog profile on the 0.1.7 or 0.2.0 line reports `CATALOG_OWNER_COLLISION` until `llm-deepseek-account` and `deepseek-account` carry the same override.
|
|
32
37
|
Mount provider-extra after those rows so its preflight can detect existing owners.
|
|
33
38
|
Preflight rejects any existing adapter, provider directory, or default owner before registering managed routes.
|
|
34
39
|
It never disables another plugin. The public registry cannot veto a later unrelated adapter or directory registration.
|
|
@@ -88,6 +93,7 @@ The plugin reads the profile Config, not this example or another catalog file.
|
|
|
88
93
|
- Provider `fallbackSessionId`: optional OpenCode Go identity for requests without a session ID.
|
|
89
94
|
|
|
90
95
|
Unknown fields, duplicate IDs or aliases, unknown sources or protocols, missing endpoints, malformed metadata and patterns, and unsupported default effort reject the whole candidate.
|
|
96
|
+
The refusal names the route and the model it belongs to, because one stale declaration takes the profile's whole model selection down with it: a model id a newer line's vendor dropped reads as `catalog provider "<route>".models[<index>] "<model>": unknown model requires complete metadata: missing <field>`, and the repair is an installed sibling through `template` or the complete metadata below.
|
|
91
97
|
Omitting `catalog` differs from `providers: []`. Empty provider or model arrays select nothing; they never expand a source catalog.
|
|
92
98
|
An empty provider list requires `default: null`. A nonempty model selection requires one valid default.
|
|
93
99
|
A selected route with `models: []` remains empty even when pi-ai ships models for its source.
|
|
@@ -134,7 +140,7 @@ The updater preserves other fields and revalidates membership against the editor
|
|
|
134
140
|
The promise awaits the editor's validation, persistence, and reconciliation.
|
|
135
141
|
Failures propagate without publishing a local-only default.
|
|
136
142
|
Hosts without an addressable entry and that editor reject with `CONFIG_PERSISTENCE_UNAVAILABLE`.
|
|
137
|
-
The
|
|
143
|
+
The verified `0.1.5` line has no canonical editor; edit its profile patch explicitly.
|
|
138
144
|
No fallback writes legacy `agent-default-model` settings or another file.
|
|
139
145
|
|
|
140
146
|
The catalog is nonvolatile. Successful edits follow the host's normal plugin restart lifecycle.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sagmans/dsh-provider-extra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Extra LLM provider routes for DeepSeek Harness: OpenCode Go with per-session x-opencode-session routing, and OpenAI Codex over ChatGPT-subscription OAuth.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -49,9 +49,12 @@
|
|
|
49
49
|
"patch": "./cordis.patch.yml"
|
|
50
50
|
},
|
|
51
51
|
"compatibility": {
|
|
52
|
-
"dsh": ">=0.1.5-rc.1 <0.
|
|
52
|
+
"dsh": ">=0.1.5-rc.1 <0.3.0",
|
|
53
53
|
"dshReleases": {
|
|
54
|
-
"0.1.5-rc.2": "compatible"
|
|
54
|
+
"0.1.5-rc.2": "compatible",
|
|
55
|
+
"0.1.5-rc.3": "compatible",
|
|
56
|
+
"0.1.7-rc.2": "compatible",
|
|
57
|
+
"0.2.0-rc.2": "compatible"
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
},
|
|
@@ -64,21 +67,22 @@
|
|
|
64
67
|
"test:build": "node --test \"tests/*.test.mjs\"",
|
|
65
68
|
"test:release": "python3 -m unittest discover -s tests/release -p 'test_*.py'",
|
|
66
69
|
"pack-smoke": "node tools/pack-smoke.mjs",
|
|
67
|
-
"
|
|
70
|
+
"matrix": "node tools/harness-matrix.mjs",
|
|
71
|
+
"check": "pnpm run typecheck && pnpm test && node tools/harness-matrix.mjs && pnpm run build && pnpm run test:build && pnpm run test:release && pnpm run pack-smoke",
|
|
68
72
|
"prepack": "pnpm run build",
|
|
69
73
|
"prepublishOnly": "pnpm run typecheck && pnpm test && pnpm run test:release"
|
|
70
74
|
},
|
|
71
75
|
"peerDependencies": {
|
|
72
76
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
73
|
-
"@deepseek-ai/dsh-commands": "
|
|
74
|
-
"@deepseek-ai/dsh-credentials": "
|
|
75
|
-
"@deepseek-ai/dsh-credentials-local": "
|
|
76
|
-
"@deepseek-ai/dsh-llm": "
|
|
77
|
-
"@deepseek-ai/dsh-llm-pi-ai": "
|
|
78
|
-
"@deepseek-ai/dsh-settings": "
|
|
79
|
-
"@deepseek-ai/dsh-user-questions": "
|
|
77
|
+
"@deepseek-ai/dsh-commands": "*",
|
|
78
|
+
"@deepseek-ai/dsh-credentials": "*",
|
|
79
|
+
"@deepseek-ai/dsh-credentials-local": "*",
|
|
80
|
+
"@deepseek-ai/dsh-llm": "*",
|
|
81
|
+
"@deepseek-ai/dsh-llm-pi-ai": "*",
|
|
82
|
+
"@deepseek-ai/dsh-settings": "*",
|
|
83
|
+
"@deepseek-ai/dsh-user-questions": "*",
|
|
80
84
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
81
|
-
"@earendil-works/pi-ai": "^0.85.1"
|
|
85
|
+
"@earendil-works/pi-ai": "^0.85.1 || ^0.87.1"
|
|
82
86
|
},
|
|
83
87
|
"peerDependenciesMeta": {
|
|
84
88
|
"@deepseek-ai/dsh-commands": {
|
|
@@ -90,16 +94,16 @@
|
|
|
90
94
|
},
|
|
91
95
|
"devDependencies": {
|
|
92
96
|
"@deepseek-ai/cordis": "4.0.2",
|
|
93
|
-
"@deepseek-ai/dsh-commands": "0.
|
|
94
|
-
"@deepseek-ai/dsh": "0.
|
|
95
|
-
"@deepseek-ai/dsh-credentials": "0.
|
|
96
|
-
"@deepseek-ai/dsh-credentials-local": "0.
|
|
97
|
-
"@deepseek-ai/dsh-llm": "0.
|
|
98
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.
|
|
99
|
-
"@deepseek-ai/dsh-settings": "0.
|
|
100
|
-
"@deepseek-ai/dsh-user-questions": "0.
|
|
97
|
+
"@deepseek-ai/dsh-commands": "0.2.0-rc.2",
|
|
98
|
+
"@deepseek-ai/dsh": "0.2.0-rc.2",
|
|
99
|
+
"@deepseek-ai/dsh-credentials": "0.2.0-rc.2",
|
|
100
|
+
"@deepseek-ai/dsh-credentials-local": "0.2.0-rc.2",
|
|
101
|
+
"@deepseek-ai/dsh-llm": "0.2.0-rc.2",
|
|
102
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2",
|
|
103
|
+
"@deepseek-ai/dsh-settings": "0.2.0-rc.2",
|
|
104
|
+
"@deepseek-ai/dsh-user-questions": "0.2.0-rc.2",
|
|
101
105
|
"@deepseek-ai/schemastery": "3.18.2",
|
|
102
|
-
"@earendil-works/pi-ai": "0.
|
|
106
|
+
"@earendil-works/pi-ai": "0.87.1",
|
|
103
107
|
"@types/node": "22.20.0",
|
|
104
108
|
"tsx": "4.22.4",
|
|
105
109
|
"typescript": "6.0.3"
|