@nextclaw/nextclaw-ncp-runtime-plugin-codex-sdk 0.1.23 → 0.1.24
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.js +17 -16
- package/openclaw.plugin.json +11 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1062,34 +1062,31 @@ function readStringArray(value) {
|
|
|
1062
1062
|
function dedupeStrings(values) {
|
|
1063
1063
|
return Array.from(new Set(values));
|
|
1064
1064
|
}
|
|
1065
|
-
function resolveConfiguredCodexModels(
|
|
1066
|
-
const explicitSupportedModels = readStringArray(
|
|
1067
|
-
if (explicitSupportedModels) {
|
|
1068
|
-
return
|
|
1069
|
-
}
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
const fallbackModels = fallbackModel ? [fallbackModel] : [];
|
|
1076
|
-
return dedupeStrings(configuredModels.length > 0 ? configuredModels : fallbackModels);
|
|
1065
|
+
function resolveConfiguredCodexModels(pluginConfig) {
|
|
1066
|
+
const explicitSupportedModels = readStringArray(pluginConfig.supportedModels);
|
|
1067
|
+
if (!explicitSupportedModels) {
|
|
1068
|
+
return void 0;
|
|
1069
|
+
}
|
|
1070
|
+
const normalizedModels = dedupeStrings(explicitSupportedModels);
|
|
1071
|
+
if (normalizedModels.includes("*")) {
|
|
1072
|
+
return void 0;
|
|
1073
|
+
}
|
|
1074
|
+
return normalizedModels;
|
|
1077
1075
|
}
|
|
1078
1076
|
function resolveRecommendedCodexModel(params) {
|
|
1079
1077
|
const configuredModel = readString3(params.pluginConfig.model) ?? params.config.agents.defaults.model;
|
|
1080
|
-
if (params.supportedModels.includes(configuredModel)) {
|
|
1078
|
+
if (!params.supportedModels || params.supportedModels.includes(configuredModel)) {
|
|
1081
1079
|
return configuredModel;
|
|
1082
1080
|
}
|
|
1083
1081
|
return params.supportedModels[0] ?? configuredModel ?? null;
|
|
1084
1082
|
}
|
|
1085
1083
|
function createDescribeCodexSessionType(params) {
|
|
1086
1084
|
return () => {
|
|
1087
|
-
const supportedModels = resolveConfiguredCodexModels(params);
|
|
1088
|
-
|
|
1085
|
+
const supportedModels = resolveConfiguredCodexModels(params.pluginConfig);
|
|
1086
|
+
const descriptor = {
|
|
1089
1087
|
ready: true,
|
|
1090
1088
|
reason: null,
|
|
1091
1089
|
reasonMessage: null,
|
|
1092
|
-
supportedModels,
|
|
1093
1090
|
recommendedModel: resolveRecommendedCodexModel({
|
|
1094
1091
|
config: params.config,
|
|
1095
1092
|
pluginConfig: params.pluginConfig,
|
|
@@ -1097,6 +1094,10 @@ function createDescribeCodexSessionType(params) {
|
|
|
1097
1094
|
}),
|
|
1098
1095
|
cta: null
|
|
1099
1096
|
};
|
|
1097
|
+
if (supportedModels) {
|
|
1098
|
+
descriptor.supportedModels = supportedModels;
|
|
1099
|
+
}
|
|
1100
|
+
return descriptor;
|
|
1100
1101
|
};
|
|
1101
1102
|
}
|
|
1102
1103
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
"model": {
|
|
18
18
|
"type": "string"
|
|
19
19
|
},
|
|
20
|
+
"supportedModels": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
20
26
|
"modelProvider": {
|
|
21
27
|
"type": "string"
|
|
22
28
|
},
|
|
@@ -74,6 +80,11 @@
|
|
|
74
80
|
"model": {
|
|
75
81
|
"label": "Default Model"
|
|
76
82
|
},
|
|
83
|
+
"supportedModels": {
|
|
84
|
+
"label": "Supported Models",
|
|
85
|
+
"help": "Optional advanced allowlist. Leave empty for no model restriction. Use [\"*\"] to explicitly allow any model.",
|
|
86
|
+
"advanced": true
|
|
87
|
+
},
|
|
77
88
|
"modelProvider": {
|
|
78
89
|
"label": "External Model Provider",
|
|
79
90
|
"help": "Optional override for the provider id exposed to Codex SDK. Recommended for custom providers whose display name is not the actual upstream provider id.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/nextclaw-ncp-runtime-plugin-codex-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "NextClaw plugin that registers Codex SDK as an optional NCP runtime.",
|
|
6
6
|
"type": "module",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@nextclaw/core": "0.11.2",
|
|
25
|
-
"@nextclaw/ncp": "0.
|
|
26
|
-
"@nextclaw/ncp-toolkit": "0.4.
|
|
27
|
-
"@nextclaw/nextclaw-ncp-runtime-codex-sdk": "0.1.
|
|
25
|
+
"@nextclaw/ncp": "0.4.0",
|
|
26
|
+
"@nextclaw/ncp-toolkit": "0.4.4",
|
|
27
|
+
"@nextclaw/nextclaw-ncp-runtime-codex-sdk": "0.1.5"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^20.17.6",
|