@moxxy/plugin-provider-admin 0.33.0 → 0.35.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/dist/key-name.d.ts.map +1 -1
- package/dist/key-name.js +11 -0
- package/dist/key-name.js.map +1 -1
- package/package.json +8 -4
- package/src/key-name.ts +11 -0
- package/src/store.test.ts +4 -4
package/dist/key-name.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-name.d.ts","sourceRoot":"","sources":["../src/key-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key-name.d.ts","sourceRoot":"","sources":["../src/key-name.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACrE,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB"}
|
package/dist/key-name.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exported as its own entry point (`@moxxy/plugin-provider-admin/key-name`),
|
|
3
|
+
* NOT only through the package barrel.
|
|
4
|
+
*
|
|
5
|
+
* The barrel also loads `factory.ts`, which imports
|
|
6
|
+
* `@moxxy/plugin-provider-openai` and therefore the ~1 MB `openai` SDK. The CLI
|
|
7
|
+
* needs nothing from this module but two pure name helpers, so importing them
|
|
8
|
+
* through the barrel inlined that entire SDK into the published binary. Keep
|
|
9
|
+
* this file's imports confined to the local store and `@moxxy/sdk` so the
|
|
10
|
+
* subpath stays cheap.
|
|
11
|
+
*/
|
|
1
12
|
import { readProvidersConfig } from './store.js';
|
|
2
13
|
/**
|
|
3
14
|
* THE canonical derivation of the vault/env key name that holds a
|
package/dist/key-name.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-name.js","sourceRoot":"","sources":["../src/key-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAsE;IAEtE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC,MAAM,CAAC;IAC5E,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IACrE,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,YAAoB,EACpB,UAAmB;IAEnB,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;IACjE,OAAO,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC"}
|
|
1
|
+
{"version":3,"file":"key-name.js","sourceRoot":"","sources":["../src/key-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAsE;IAEtE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC,MAAM,CAAC;IAC5E,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IACrE,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,YAAoB,EACpB,UAAmB;IAEnB,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;IACjE,OAAO,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moxxy/plugin-provider-admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Model-callable provider admin: provider_add / provider_list / provider_remove / provider_test. Persists user-registered providers to ~/.moxxy/providers.json and hot-registers them in the live session by wrapping the OpenAI-compatible client with a vendor baseURL.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"moxxy",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"import": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./key-name": {
|
|
35
|
+
"types": "./dist/key-name.d.ts",
|
|
36
|
+
"import": "./dist/key-name.js"
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
"files": [
|
|
@@ -45,9 +49,9 @@
|
|
|
45
49
|
"dependencies": {
|
|
46
50
|
"openai": "^4.80.0",
|
|
47
51
|
"zod": "^3.24.0",
|
|
48
|
-
"@moxxy/
|
|
49
|
-
"@moxxy/
|
|
50
|
-
"@moxxy/
|
|
52
|
+
"@moxxy/config": "0.35.0",
|
|
53
|
+
"@moxxy/plugin-provider-openai": "0.35.0",
|
|
54
|
+
"@moxxy/sdk": "0.35.0"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@types/node": "^22.10.0",
|
package/src/key-name.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exported as its own entry point (`@moxxy/plugin-provider-admin/key-name`),
|
|
3
|
+
* NOT only through the package barrel.
|
|
4
|
+
*
|
|
5
|
+
* The barrel also loads `factory.ts`, which imports
|
|
6
|
+
* `@moxxy/plugin-provider-openai` and therefore the ~1 MB `openai` SDK. The CLI
|
|
7
|
+
* needs nothing from this module but two pure name helpers, so importing them
|
|
8
|
+
* through the barrel inlined that entire SDK into the published binary. Keep
|
|
9
|
+
* this file's imports confined to the local store and `@moxxy/sdk` so the
|
|
10
|
+
* subpath stays cheap.
|
|
11
|
+
*/
|
|
1
12
|
import { readProvidersConfig } from './store.js';
|
|
2
13
|
|
|
3
14
|
/**
|
package/src/store.test.ts
CHANGED
|
@@ -85,17 +85,17 @@ describe('stored-provider tree store (plugins.provider.items)', () => {
|
|
|
85
85
|
// NOT a stored vendor; provider_remove must never delete those prefs.
|
|
86
86
|
await fs.writeFile(
|
|
87
87
|
cfgPath,
|
|
88
|
-
'plugins:\n provider:\n items:\n anthropic:\n model: claude-opus-
|
|
88
|
+
'plugins:\n provider:\n items:\n anthropic:\n model: claude-opus-5\n',
|
|
89
89
|
);
|
|
90
90
|
expect(await removeStoredProvider('anthropic', cfgPath)).toBe(false);
|
|
91
91
|
const text = await fs.readFile(cfgPath, 'utf8');
|
|
92
|
-
expect(text).toContain('claude-opus-
|
|
92
|
+
expect(text).toContain('claude-opus-5');
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
it('coexists with picker-written model/enabled prefs on OTHER items', async () => {
|
|
96
96
|
await fs.writeFile(
|
|
97
97
|
cfgPath,
|
|
98
|
-
'plugins:\n provider:\n default: anthropic\n items:\n anthropic:\n model: claude-opus-
|
|
98
|
+
'plugins:\n provider:\n default: anthropic\n items:\n anthropic:\n model: claude-opus-5\n',
|
|
99
99
|
);
|
|
100
100
|
await upsertStoredProvider(sampleEntry, cfgPath);
|
|
101
101
|
const cfg = await readProvidersConfig(cfgPath);
|
|
@@ -103,7 +103,7 @@ describe('stored-provider tree store (plugins.provider.items)', () => {
|
|
|
103
103
|
expect(cfg.providers.map((p) => p.name)).toEqual(['zai']);
|
|
104
104
|
// …and the built-in's prefs survive untouched.
|
|
105
105
|
const text = await fs.readFile(cfgPath, 'utf8');
|
|
106
|
-
expect(text).toContain('claude-opus-
|
|
106
|
+
expect(text).toContain('claude-opus-5');
|
|
107
107
|
expect(text).toContain('default: anthropic');
|
|
108
108
|
});
|
|
109
109
|
|