metheus-governance-mcp-cli 0.2.80 → 0.2.81
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 +2 -2
- package/lib/bot-commands.mjs +21 -9
- package/lib/local-ai-adapters.mjs +3 -0
- package/lib/selftest-bot-commands.mjs +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -259,8 +259,8 @@ Non-interactive examples:
|
|
|
259
259
|
```bash
|
|
260
260
|
metheus-governance-mcp-cli bot global --provider telegram --non-interactive true --api-base-url http://127.0.0.1:8999/telegram --auto-clear-webhook false --allowed-updates message,edited_message,channel_post
|
|
261
261
|
metheus-governance-mcp-cli bot add --provider telegram --non-interactive true --server-bot-id <server_bot_uuid> --token <telegram_bot_token> --default true
|
|
262
|
-
metheus-governance-mcp-cli bot add --provider telegram --non-interactive true --server-bot-id <server_bot_uuid> --token <telegram_bot_token> --ai-client
|
|
263
|
-
metheus-governance-mcp-cli bot edit --provider telegram --bot-key ryoai_bot --non-interactive true --ai-client claude --ai-model
|
|
262
|
+
metheus-governance-mcp-cli bot add --provider telegram --non-interactive true --server-bot-id <server_bot_uuid> --token <telegram_bot_token> --ai-client gpt --ai-model "GPT-5.4" --ai-permission-mode read_only --ai-reasoning-effort low
|
|
263
|
+
metheus-governance-mcp-cli bot edit --provider telegram --bot-key ryoai_bot --non-interactive true --ai-client claude --ai-model "Sonnet 4.6r" --ai-permission-mode danger_full_access --ai-reasoning-effort high
|
|
264
264
|
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key main --non-interactive true
|
|
265
265
|
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key main --server-bot-id <server_bot_uuid> --bot-name <telegram_username> --role-profile monitor --ai-client codex --ai-permission-mode read_only --ai-reasoning-effort low --non-interactive true
|
|
266
266
|
metheus-governance-mcp-cli bot remove --provider telegram --bot-key main --non-interactive true
|
package/lib/bot-commands.mjs
CHANGED
|
@@ -624,12 +624,21 @@ function telegramEntryDisplayName(entry) {
|
|
|
624
624
|
return String(current.key || "").trim() || "(unnamed)";
|
|
625
625
|
}
|
|
626
626
|
|
|
627
|
+
function displayLocalAIClientName(clientName) {
|
|
628
|
+
const normalized = String(clientName || "").trim().toLowerCase();
|
|
629
|
+
if (normalized === "codex" || normalized === "gpt") return "GPT";
|
|
630
|
+
if (normalized === "claude") return "Claude";
|
|
631
|
+
if (normalized === "gemini") return "Gemini";
|
|
632
|
+
if (normalized === "sample") return "Sample";
|
|
633
|
+
return String(clientName || "").trim();
|
|
634
|
+
}
|
|
635
|
+
|
|
627
636
|
function telegramEntryDisplayDescription(entry) {
|
|
628
637
|
const current = safeObject(entry);
|
|
629
638
|
const detail = [
|
|
630
639
|
current.key ? `key:${current.key}` : "",
|
|
631
640
|
current.serverBotID ? `server:${current.serverBotID}` : "",
|
|
632
|
-
current.client ? `AI:${current.client}` : "",
|
|
641
|
+
current.client ? `AI:${displayLocalAIClientName(current.client)}` : "",
|
|
633
642
|
].filter(Boolean);
|
|
634
643
|
return detail.join(" ");
|
|
635
644
|
}
|
|
@@ -936,7 +945,7 @@ function renderBotListPayload(provider, state, deps) {
|
|
|
936
945
|
function formatRoleProfileOutputLine(profile) {
|
|
937
946
|
const current = safeObject(profile);
|
|
938
947
|
return [
|
|
939
|
-
current.client ? `client=${current.client}` : "client=(blank)",
|
|
948
|
+
current.client ? `client=${displayLocalAIClientName(current.client)}` : "client=(blank)",
|
|
940
949
|
current.model ? `model=${current.model}` : "model=(blank)",
|
|
941
950
|
current.permissionMode ? `permission=${current.permissionMode}` : "permission=(blank)",
|
|
942
951
|
current.reasoningEffort ? `reasoning=${current.reasoningEffort}` : "reasoning=(blank)",
|
|
@@ -1084,7 +1093,7 @@ function printBotShow(provider, state, entry, deps, extras = {}) {
|
|
|
1084
1093
|
process.stdout.write(` username: ${selectedEntry.username ? `@${selectedEntry.username}` : "-"}\n`);
|
|
1085
1094
|
process.stdout.write(` token: ${selectedEntry.token ? maskSecret(selectedEntry.token) : "(not configured)"}\n`);
|
|
1086
1095
|
process.stdout.write(` role_profile: ${selectedEntry.roleProfile || "-"}\n`);
|
|
1087
|
-
process.stdout.write(` ai_client: ${selectedEntry.client
|
|
1096
|
+
process.stdout.write(` ai_client: ${selectedEntry.client ? displayLocalAIClientName(selectedEntry.client) : "-"}\n`);
|
|
1088
1097
|
process.stdout.write(` ai_model: ${selectedEntry.model || "-"}\n`);
|
|
1089
1098
|
process.stdout.write(` permission_mode: ${selectedEntry.permissionMode || "-"}\n`);
|
|
1090
1099
|
process.stdout.write(` reasoning_effort: ${selectedEntry.reasoningEffort || "-"}\n`);
|
|
@@ -1442,7 +1451,7 @@ async function promptAIClient(ui, deps, defaultValue = "") {
|
|
|
1442
1451
|
const clients = ensureArray(deps.supportedLocalAIClients || []);
|
|
1443
1452
|
const options = [
|
|
1444
1453
|
{ value: "", label: "(blank)", description: "leave AI client empty" },
|
|
1445
|
-
...clients.map((client) => ({ value: client, label: client })),
|
|
1454
|
+
...clients.map((client) => ({ value: client, label: displayLocalAIClientName(client) || client })),
|
|
1446
1455
|
];
|
|
1447
1456
|
const selectedIndex = Math.max(0, options.findIndex((item) => item.value === String(defaultValue || "").trim()));
|
|
1448
1457
|
const selected = await promptChoice(ui, "Select AI client", options, { defaultIndex: selectedIndex });
|
|
@@ -1453,18 +1462,21 @@ function suggestedAIModelsForClient(clientName) {
|
|
|
1453
1462
|
const normalizedClient = String(clientName || "").trim().toLowerCase();
|
|
1454
1463
|
if (normalizedClient === "codex") {
|
|
1455
1464
|
return [
|
|
1456
|
-
{ value: "
|
|
1465
|
+
{ value: "GPT-5.4", label: "GPT-5.4", description: "recommended GPT model" },
|
|
1466
|
+
{ value: "GPT-5.3-CODEX", label: "GPT-5.3-CODEX", description: "stable GPT codex-style model" },
|
|
1467
|
+
{ value: "GPT-5.3-CODEX-Spark", label: "GPT-5.3-CODEX-Spark", description: "faster GPT codex-style model" },
|
|
1457
1468
|
];
|
|
1458
1469
|
}
|
|
1459
1470
|
if (normalizedClient === "claude") {
|
|
1460
1471
|
return [
|
|
1461
|
-
{ value: "
|
|
1462
|
-
{ value: "
|
|
1472
|
+
{ value: "Sonnet 4.6r", label: "Sonnet 4.6r", description: "recommended Claude Sonnet model" },
|
|
1473
|
+
{ value: "Haiku 4.5", label: "Haiku 4.5", description: "faster Claude Haiku model" },
|
|
1474
|
+
{ value: "Opus 4.6", label: "Opus 4.6", description: "highest-capability Claude model" },
|
|
1463
1475
|
];
|
|
1464
1476
|
}
|
|
1465
1477
|
if (normalizedClient === "gemini") {
|
|
1466
1478
|
return [
|
|
1467
|
-
{ value: "
|
|
1479
|
+
{ value: "Gemini 3.1 Pro", label: "Gemini 3.1 Pro", description: "recommended Gemini model" },
|
|
1468
1480
|
];
|
|
1469
1481
|
}
|
|
1470
1482
|
if (normalizedClient === "sample") {
|
|
@@ -1607,7 +1619,7 @@ function currentRoleProfileState(roleName, deps) {
|
|
|
1607
1619
|
function formatRoleProfileSummary(profile) {
|
|
1608
1620
|
const current = safeObject(profile);
|
|
1609
1621
|
return [
|
|
1610
|
-
current.client ? `client:${current.client}` : "client:(blank)",
|
|
1622
|
+
current.client ? `client:${displayLocalAIClientName(current.client)}` : "client:(blank)",
|
|
1611
1623
|
current.model ? `model:${current.model}` : "model:(blank)",
|
|
1612
1624
|
current.permissionMode ? `permission:${current.permissionMode}` : "permission:(blank)",
|
|
1613
1625
|
current.reasoningEffort ? `reasoning:${current.reasoningEffort}` : "reasoning:(blank)",
|
|
@@ -358,6 +358,9 @@ function runSampleAdapter(payload) {
|
|
|
358
358
|
|
|
359
359
|
export function normalizeLocalAIClientName(rawValue, fallback = DEFAULT_LOCAL_AI_CLIENT) {
|
|
360
360
|
const value = String(rawValue || "").trim().toLowerCase();
|
|
361
|
+
if (["gpt", "openai-gpt", "openai"].includes(value)) {
|
|
362
|
+
return "codex";
|
|
363
|
+
}
|
|
361
364
|
if (SUPPORTED_LOCAL_AI_CLIENTS.includes(value)) {
|
|
362
365
|
return value;
|
|
363
366
|
}
|
|
@@ -364,14 +364,14 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
364
364
|
"3", // select role to edit: worker
|
|
365
365
|
"2", // worker: edit settings
|
|
366
366
|
"3", // worker AI client: claude
|
|
367
|
-
"2", // worker AI model:
|
|
367
|
+
"2", // worker AI model: Sonnet 4.6r
|
|
368
368
|
"4", // worker permission: danger_full_access
|
|
369
369
|
"4", // worker reasoning: high
|
|
370
370
|
"y", // edit another role
|
|
371
371
|
"3", // select role to edit: approval
|
|
372
372
|
"2", // approval: edit settings
|
|
373
373
|
"4", // approval AI client: gemini
|
|
374
|
-
"2", // approval AI model:
|
|
374
|
+
"2", // approval AI model: Gemini 3.1 Pro
|
|
375
375
|
"4", // approval permission: danger_full_access
|
|
376
376
|
"4", // approval reasoning: high
|
|
377
377
|
"n", // stop editing roles
|
|
@@ -388,13 +388,13 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
388
388
|
const groupedRunnerConfigPath = path.join(tempHome, ".metheus", "bot-runner.json");
|
|
389
389
|
const groupedRunnerConfig = readJSON(fs.readFileSync(groupedRunnerConfigPath, "utf8"));
|
|
390
390
|
push(
|
|
391
|
-
|
|
391
|
+
"bot_edit_grouped_server_roles_updates_role_profiles",
|
|
392
392
|
String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).worker).client || "") === "claude"
|
|
393
|
-
&& String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).worker).model || "") === "
|
|
393
|
+
&& String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).worker).model || "") === "Sonnet 4.6r"
|
|
394
394
|
&& String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).worker).permission_mode || "") === "danger_full_access"
|
|
395
395
|
&& String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).worker).reasoning_effort || "") === "high"
|
|
396
396
|
&& String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).approval).client || "") === "gemini"
|
|
397
|
-
&& String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).approval).model || "") === "
|
|
397
|
+
&& String(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).approval).model || "") === "Gemini 3.1 Pro",
|
|
398
398
|
`worker=${JSON.stringify(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).worker))} approval=${JSON.stringify(safeObject(safeObject(groupedRunnerConfig.role_profiles || {}).approval))}`,
|
|
399
399
|
);
|
|
400
400
|
|
|
@@ -503,7 +503,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
503
503
|
"2", // change AI client
|
|
504
504
|
"4", // gemini
|
|
505
505
|
"2", // change AI model
|
|
506
|
-
"2", // gemini model:
|
|
506
|
+
"2", // gemini model: Gemini 3.1 Pro
|
|
507
507
|
"2", // change permission mode
|
|
508
508
|
"3", // workspace_write
|
|
509
509
|
"2", // change reasoning effort
|
|
@@ -522,7 +522,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
522
522
|
push(
|
|
523
523
|
"bot_edit_guided_prompts_update_ai_binding_fields",
|
|
524
524
|
String(guidedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_CLIENT || "") === "gemini"
|
|
525
|
-
&& String(guidedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "") === "
|
|
525
|
+
&& String(guidedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "") === "Gemini 3.1 Pro"
|
|
526
526
|
&& String(guidedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_PERMISSION_MODE || "") === "workspace_write"
|
|
527
527
|
&& String(guidedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_REASONING_EFFORT || "") === "medium",
|
|
528
528
|
`client=${String(guidedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_CLIENT || "")} model=${String(guidedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "")}`,
|
|
@@ -537,7 +537,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
537
537
|
"--non-interactive", "true",
|
|
538
538
|
"--token", "selftest-edited-token",
|
|
539
539
|
"--client", "claude",
|
|
540
|
-
"--model", "
|
|
540
|
+
"--model", "Sonnet 4.6r",
|
|
541
541
|
"--permission-mode", "workspace_write",
|
|
542
542
|
"--reasoning-effort", "medium",
|
|
543
543
|
],
|
|
@@ -548,7 +548,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
548
548
|
"bot_edit_updates_ai_binding_fields",
|
|
549
549
|
String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_TOKEN || "") === "selftest-edited-token"
|
|
550
550
|
&& String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_CLIENT || "") === "claude"
|
|
551
|
-
&& String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "") === "
|
|
551
|
+
&& String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "") === "Sonnet 4.6r"
|
|
552
552
|
&& String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_PERMISSION_MODE || "") === "workspace_write"
|
|
553
553
|
&& String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_REASONING_EFFORT || "") === "medium",
|
|
554
554
|
`client=${String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_CLIENT || "")} model=${String(editedState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "")}`,
|
|
@@ -683,8 +683,8 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
683
683
|
"--timeout-seconds", "5",
|
|
684
684
|
"--server-bot-id", mock.bots[0].id,
|
|
685
685
|
"--token", "selftest-main-token",
|
|
686
|
-
"--ai-client", "
|
|
687
|
-
"--ai-model", "
|
|
686
|
+
"--ai-client", "gpt",
|
|
687
|
+
"--ai-model", "GPT-5.4",
|
|
688
688
|
"--ai-permission-mode", "read_only",
|
|
689
689
|
"--ai-reasoning-effort", "low",
|
|
690
690
|
"--verify", "true",
|
|
@@ -697,7 +697,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
697
697
|
String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_SERVER_BOT_ID || "") === mock.bots[0].id
|
|
698
698
|
&& String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_USERNAME || "") === ""
|
|
699
699
|
&& String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_CLIENT || "") === "codex"
|
|
700
|
-
&& String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "") === "
|
|
700
|
+
&& String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "") === "GPT-5.4"
|
|
701
701
|
&& String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_PERMISSION_MODE || "") === "read_only"
|
|
702
702
|
&& String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_REASONING_EFFORT || "") === "low",
|
|
703
703
|
`client=${String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_CLIENT || "")} model=${String(aliasAddState.TELEGRAM_BOT_MONITORSELFTESTBOT_AI_MODEL || "")}`,
|