@nextclaw/server 0.10.13 → 0.10.16
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/index.d.ts +2 -0
- package/dist/index.js +20 -20
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -381,6 +381,7 @@ type AppMetaView = {
|
|
|
381
381
|
productVersion: string;
|
|
382
382
|
};
|
|
383
383
|
type ProviderConfigView = {
|
|
384
|
+
enabled: boolean;
|
|
384
385
|
displayName?: string;
|
|
385
386
|
apiKeySet: boolean;
|
|
386
387
|
apiKeyMasked?: string;
|
|
@@ -394,6 +395,7 @@ type ProviderConfigView = {
|
|
|
394
395
|
}>;
|
|
395
396
|
};
|
|
396
397
|
type ProviderConfigUpdate = {
|
|
398
|
+
enabled?: boolean;
|
|
397
399
|
displayName?: string | null;
|
|
398
400
|
apiKey?: string | null;
|
|
399
401
|
apiBase?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -570,6 +570,20 @@ import {
|
|
|
570
570
|
parseThinkingLevel as parseThinkingLevel3
|
|
571
571
|
} from "@nextclaw/core";
|
|
572
572
|
|
|
573
|
+
// src/ui/provider-config.factory.ts
|
|
574
|
+
function createDefaultProviderConfig(defaultWireApi = "auto") {
|
|
575
|
+
return {
|
|
576
|
+
enabled: true,
|
|
577
|
+
displayName: "",
|
|
578
|
+
apiKey: "",
|
|
579
|
+
apiBase: null,
|
|
580
|
+
extraHeaders: null,
|
|
581
|
+
wireApi: defaultWireApi,
|
|
582
|
+
models: [],
|
|
583
|
+
modelThinking: {}
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
|
|
573
587
|
// src/ui/provider-overrides.ts
|
|
574
588
|
import { findBuiltinProviderByName, listBuiltinProviders } from "@nextclaw/runtime";
|
|
575
589
|
var MINIMAX_PORTAL_PROVIDER_SPEC = {
|
|
@@ -766,17 +780,6 @@ function findNextCustomProviderName(config) {
|
|
|
766
780
|
}
|
|
767
781
|
return `${CUSTOM_PROVIDER_PREFIX}${index}`;
|
|
768
782
|
}
|
|
769
|
-
function createDefaultProviderConfig(defaultWireApi = "auto") {
|
|
770
|
-
return {
|
|
771
|
-
displayName: "",
|
|
772
|
-
apiKey: "",
|
|
773
|
-
apiBase: null,
|
|
774
|
-
extraHeaders: null,
|
|
775
|
-
wireApi: defaultWireApi,
|
|
776
|
-
models: [],
|
|
777
|
-
modelThinking: {}
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
783
|
function ensureProviderConfig(config, providerName) {
|
|
781
784
|
const providers = config.providers;
|
|
782
785
|
const existing = providers[providerName];
|
|
@@ -1077,6 +1080,7 @@ function toProviderView(config, provider, providerName, uiHints, spec) {
|
|
|
1077
1080
|
uiHints
|
|
1078
1081
|
) : null;
|
|
1079
1082
|
const view = {
|
|
1083
|
+
enabled: provider.enabled !== false,
|
|
1080
1084
|
displayName: resolveProviderDisplayName(providerName, provider, spec),
|
|
1081
1085
|
apiKeySet: masked.apiKeySet || apiKeyRefSet,
|
|
1082
1086
|
apiKeyMasked: masked.apiKeyMasked ?? (apiKeyRefSet ? "****" : void 0),
|
|
@@ -1374,6 +1378,9 @@ function updateProvider(configPath, providerName, patch) {
|
|
|
1374
1378
|
if (Object.prototype.hasOwnProperty.call(patch, "displayName") && isCustom) {
|
|
1375
1379
|
provider.displayName = normalizeOptionalDisplayName(patch.displayName) ?? "";
|
|
1376
1380
|
}
|
|
1381
|
+
if (Object.prototype.hasOwnProperty.call(patch, "enabled")) {
|
|
1382
|
+
provider.enabled = patch.enabled !== false;
|
|
1383
|
+
}
|
|
1377
1384
|
if (Object.prototype.hasOwnProperty.call(patch, "apiKey")) {
|
|
1378
1385
|
provider.apiKey = patch.apiKey ?? "";
|
|
1379
1386
|
clearSecretRef(config, `providers.${providerName}.apiKey`);
|
|
@@ -1405,6 +1412,7 @@ function createCustomProvider(configPath, patch = {}) {
|
|
|
1405
1412
|
const providers = config.providers;
|
|
1406
1413
|
const generatedDisplayName = resolveCustomProviderFallbackDisplayName(providerName);
|
|
1407
1414
|
providers[providerName] = {
|
|
1415
|
+
enabled: patch.enabled !== false,
|
|
1408
1416
|
displayName: normalizeOptionalDisplayName(patch.displayName) ?? generatedDisplayName,
|
|
1409
1417
|
apiKey: normalizeOptionalString(patch.apiKey) ?? "",
|
|
1410
1418
|
apiBase: normalizeOptionalString(patch.apiBase),
|
|
@@ -2700,15 +2708,7 @@ function setProviderApiKey(params) {
|
|
|
2700
2708
|
const config = loadConfig3(params.configPath);
|
|
2701
2709
|
const providers = config.providers;
|
|
2702
2710
|
if (!providers[params.provider]) {
|
|
2703
|
-
providers[params.provider] =
|
|
2704
|
-
displayName: "",
|
|
2705
|
-
apiKey: "",
|
|
2706
|
-
apiBase: null,
|
|
2707
|
-
extraHeaders: null,
|
|
2708
|
-
wireApi: "auto",
|
|
2709
|
-
models: [],
|
|
2710
|
-
modelThinking: {}
|
|
2711
|
-
};
|
|
2711
|
+
providers[params.provider] = createDefaultProviderConfig();
|
|
2712
2712
|
}
|
|
2713
2713
|
const target = providers[params.provider];
|
|
2714
2714
|
target.apiKey = params.accessToken;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/server",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Nextclaw UI/API server.",
|
|
6
6
|
"type": "module",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"@hono/node-server": "^1.13.3",
|
|
19
19
|
"hono": "^4.6.2",
|
|
20
20
|
"ws": "^8.18.0",
|
|
21
|
+
"@nextclaw/mcp": "0.1.16",
|
|
21
22
|
"@nextclaw/ncp": "0.3.1",
|
|
22
|
-
"@nextclaw/
|
|
23
|
-
"@nextclaw/
|
|
24
|
-
"@nextclaw/
|
|
25
|
-
"@nextclaw/
|
|
26
|
-
"@nextclaw/openclaw-compat": "0.3.8"
|
|
23
|
+
"@nextclaw/openclaw-compat": "0.3.9",
|
|
24
|
+
"@nextclaw/runtime": "0.2.6",
|
|
25
|
+
"@nextclaw/core": "0.9.6",
|
|
26
|
+
"@nextclaw/ncp-http-agent-server": "0.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^20.17.6",
|