metheus-governance-mcp-cli 0.2.185 → 0.2.187
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/cli.mjs +25 -1
- package/lib/local-ai-adapters.mjs +73 -8
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -20,7 +20,9 @@ import {
|
|
|
20
20
|
planRoleExecutionWithAI,
|
|
21
21
|
repairRoleExecutionPlanWithAI,
|
|
22
22
|
buildLocalBotPrompt,
|
|
23
|
+
resolveIntentParserModelDisplayName,
|
|
23
24
|
resolveLocalAIExecutionModel,
|
|
25
|
+
resolveResponderAdjudicatorModelDisplayName,
|
|
24
26
|
resolveGeminiReasoningConfig,
|
|
25
27
|
suggestLocalAIModelDisplayName,
|
|
26
28
|
SUPPORTED_LOCAL_AI_CLIENTS,
|
|
@@ -2172,7 +2174,9 @@ function collectBotRunnerConversationSessionFacts(routeRaw, conversationIDRaw) {
|
|
|
2172
2174
|
}
|
|
2173
2175
|
const candidateRoute = normalizeRunnerRoute(candidateRouteRaw);
|
|
2174
2176
|
const routeKey = runnerRouteKey(candidateRoute);
|
|
2175
|
-
const session = safeObject(
|
|
2177
|
+
const session = safeObject(
|
|
2178
|
+
safeObject(safeObject(safeObject(runnerState.routes)[routeKey]).conversation_sessions)[conversationID],
|
|
2179
|
+
);
|
|
2176
2180
|
if (!Object.keys(session).length) {
|
|
2177
2181
|
continue;
|
|
2178
2182
|
}
|
|
@@ -11364,6 +11368,26 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
|
|
|
11364
11368
|
&& kakaotalkSupport.localTokenVerification === false,
|
|
11365
11369
|
summarizeProviderSupport("kakaotalk"),
|
|
11366
11370
|
);
|
|
11371
|
+
push(
|
|
11372
|
+
"intent_parser_default_model_uses_codex_spark_without_openai_api_key",
|
|
11373
|
+
resolveIntentParserModelDisplayName({ client: "gpt", env: {} }) === "gpt-5.3-codex-spark",
|
|
11374
|
+
resolveIntentParserModelDisplayName({ client: "gpt", env: {} }),
|
|
11375
|
+
);
|
|
11376
|
+
push(
|
|
11377
|
+
"intent_parser_prefers_gpt_5_mini_when_openai_api_key_present",
|
|
11378
|
+
resolveIntentParserModelDisplayName({ client: "gpt", env: { OPENAI_API_KEY: "sk-selftest" } }) === "gpt-5-mini",
|
|
11379
|
+
resolveIntentParserModelDisplayName({ client: "gpt", env: { OPENAI_API_KEY: "sk-selftest" } }),
|
|
11380
|
+
);
|
|
11381
|
+
push(
|
|
11382
|
+
"responder_adjudicator_default_model_uses_codex_spark_without_openai_api_key",
|
|
11383
|
+
resolveResponderAdjudicatorModelDisplayName({ client: "gpt", env: {} }) === "gpt-5.3-codex-spark",
|
|
11384
|
+
resolveResponderAdjudicatorModelDisplayName({ client: "gpt", env: {} }),
|
|
11385
|
+
);
|
|
11386
|
+
push(
|
|
11387
|
+
"responder_adjudicator_prefers_gpt_5_mini_when_openai_api_key_present",
|
|
11388
|
+
resolveResponderAdjudicatorModelDisplayName({ client: "gpt", env: { OPENAI_API_KEY: "sk-selftest" } }) === "gpt-5-mini",
|
|
11389
|
+
resolveResponderAdjudicatorModelDisplayName({ client: "gpt", env: { OPENAI_API_KEY: "sk-selftest" } }),
|
|
11390
|
+
);
|
|
11367
11391
|
const unsupportedProviderRouteDiagnostics = collectRunnerRouteDiagnostics(
|
|
11368
11392
|
{
|
|
11369
11393
|
enabled: true,
|
|
@@ -25,6 +25,11 @@ const LOCAL_AI_MODEL_MAPPINGS = {
|
|
|
25
25
|
execution: "gpt-5.4",
|
|
26
26
|
aliases: ["gpt-5.4", "gpt 5.4", "GPT-5.4"],
|
|
27
27
|
},
|
|
28
|
+
{
|
|
29
|
+
display: "gpt-5-mini",
|
|
30
|
+
execution: "gpt-5-mini",
|
|
31
|
+
aliases: ["gpt-5-mini", "gpt 5 mini", "GPT-5-mini", "gpt5-mini"],
|
|
32
|
+
},
|
|
28
33
|
{
|
|
29
34
|
display: "gpt-5.3-codex",
|
|
30
35
|
execution: "gpt-5.3-codex",
|
|
@@ -1055,6 +1060,64 @@ export function suggestLocalAIModelDisplayName(clientName, rawModelValue = "") {
|
|
|
1055
1060
|
return String(localAIModelMappingsForClient(clientName)[0]?.display || "").trim();
|
|
1056
1061
|
}
|
|
1057
1062
|
|
|
1063
|
+
function truthyEnvFlag(value) {
|
|
1064
|
+
const normalized = String(value || "").trim().toLowerCase();
|
|
1065
|
+
return ["1", "true", "yes", "on"].includes(normalized);
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
function defaultAdjudicationModelForClient(clientName, env = process.env) {
|
|
1069
|
+
const normalizedClient = normalizeLocalAIClientName(clientName, "");
|
|
1070
|
+
if (normalizedClient === "gpt") {
|
|
1071
|
+
const hasOpenAIAPIKey = String(env?.OPENAI_API_KEY || "").trim().length > 0;
|
|
1072
|
+
const prefersMini = truthyEnvFlag(env?.METHEUS_PREFER_GPT_5_MINI_ADJUDICATOR);
|
|
1073
|
+
if (hasOpenAIAPIKey || prefersMini) {
|
|
1074
|
+
return "gpt-5-mini";
|
|
1075
|
+
}
|
|
1076
|
+
return "gpt-5.3-codex-spark";
|
|
1077
|
+
}
|
|
1078
|
+
return suggestLocalAIModelDisplayName(normalizedClient, "");
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
export function resolveIntentParserModelDisplayName({
|
|
1082
|
+
client = "",
|
|
1083
|
+
model = "",
|
|
1084
|
+
env = process.env,
|
|
1085
|
+
} = {}) {
|
|
1086
|
+
const parserClient = normalizeLocalAIClientName(
|
|
1087
|
+
String(client || env?.METHEUS_INTENT_PARSER_CLIENT || "").trim(),
|
|
1088
|
+
"gpt",
|
|
1089
|
+
);
|
|
1090
|
+
return String(
|
|
1091
|
+
model
|
|
1092
|
+
|| env?.METHEUS_INTENT_PARSER_MODEL
|
|
1093
|
+
|| defaultAdjudicationModelForClient(parserClient, env)
|
|
1094
|
+
|| "",
|
|
1095
|
+
).trim();
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
export function resolveResponderAdjudicatorModelDisplayName({
|
|
1099
|
+
client = "",
|
|
1100
|
+
model = "",
|
|
1101
|
+
env = process.env,
|
|
1102
|
+
} = {}) {
|
|
1103
|
+
const adjudicatorClient = normalizeLocalAIClientName(
|
|
1104
|
+
String(
|
|
1105
|
+
client
|
|
1106
|
+
|| env?.METHEUS_RESPONDER_ADJUDICATOR_CLIENT
|
|
1107
|
+
|| env?.METHEUS_INTENT_PARSER_CLIENT
|
|
1108
|
+
|| "",
|
|
1109
|
+
).trim(),
|
|
1110
|
+
"gpt",
|
|
1111
|
+
);
|
|
1112
|
+
return String(
|
|
1113
|
+
model
|
|
1114
|
+
|| env?.METHEUS_RESPONDER_ADJUDICATOR_MODEL
|
|
1115
|
+
|| env?.METHEUS_INTENT_PARSER_MODEL
|
|
1116
|
+
|| defaultAdjudicationModelForClient(adjudicatorClient, env)
|
|
1117
|
+
|| "",
|
|
1118
|
+
).trim();
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1058
1121
|
export function resolveLocalAIExecutionModel(clientName, rawModelValue = "") {
|
|
1059
1122
|
const modelValue = String(rawModelValue || "").trim();
|
|
1060
1123
|
if (!modelValue) return "";
|
|
@@ -2230,7 +2293,11 @@ export function analyzeHumanConversationIntentWithAI({
|
|
|
2230
2293
|
String(client || env?.METHEUS_INTENT_PARSER_CLIENT || "").trim(),
|
|
2231
2294
|
"gpt",
|
|
2232
2295
|
);
|
|
2233
|
-
const parserModel =
|
|
2296
|
+
const parserModel = resolveIntentParserModelDisplayName({
|
|
2297
|
+
client: parserClient,
|
|
2298
|
+
model,
|
|
2299
|
+
env,
|
|
2300
|
+
});
|
|
2234
2301
|
const rawText = runLocalAIPromptRawText({
|
|
2235
2302
|
client: parserClient,
|
|
2236
2303
|
promptText: buildConversationIntentAnalysisPrompt({
|
|
@@ -2304,13 +2371,11 @@ export function adjudicateRunnerRespondersWithAI({
|
|
|
2304
2371
|
).trim(),
|
|
2305
2372
|
"gpt",
|
|
2306
2373
|
);
|
|
2307
|
-
const adjudicatorModel =
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|| "",
|
|
2313
|
-
).trim();
|
|
2374
|
+
const adjudicatorModel = resolveResponderAdjudicatorModelDisplayName({
|
|
2375
|
+
client: adjudicatorClient,
|
|
2376
|
+
model,
|
|
2377
|
+
env,
|
|
2378
|
+
});
|
|
2314
2379
|
const rawText = runLocalAIPromptRawText({
|
|
2315
2380
|
client: adjudicatorClient,
|
|
2316
2381
|
promptText: buildResponderAdjudicationPrompt({
|