metheus-governance-mcp-cli 0.2.91 → 0.2.92
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 +19 -19
- package/cli.mjs +21 -20
- package/lib/bot-commands.mjs +5 -1
- package/lib/selftest-bot-commands.mjs +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Install creates local provider settings templates here:
|
|
|
31
31
|
These files are for local provider bot secrets, local transport options, and optional per-bot local AI binding.
|
|
32
32
|
|
|
33
33
|
- Store locally:
|
|
34
|
-
- `TELEGRAM_BOT_TOKEN` or named Telegram bot mappings such as `
|
|
34
|
+
- `TELEGRAM_BOT_TOKEN` or named Telegram bot mappings such as `TELEGRAM_BOT_RYOAI_TOKEN`
|
|
35
35
|
- `SLACK_BOT_TOKEN`
|
|
36
36
|
- `KAKAOTALK_BOT_TOKEN`
|
|
37
37
|
- Server-side Metheus stores project chat destination metadata separately:
|
|
@@ -48,21 +48,21 @@ Example templates:
|
|
|
48
48
|
TELEGRAM_API_BASE_URL=
|
|
49
49
|
TELEGRAM_AUTO_CLEAR_WEBHOOK=true
|
|
50
50
|
TELEGRAM_ALLOWED_UPDATES=message,edited_message
|
|
51
|
-
TELEGRAM_DEFAULT_BOT_KEY=
|
|
51
|
+
TELEGRAM_DEFAULT_BOT_KEY=ryoai
|
|
52
52
|
|
|
53
53
|
# Legacy fallback
|
|
54
54
|
TELEGRAM_BOT_TOKEN=
|
|
55
55
|
|
|
56
56
|
# Preferred named bot mapping
|
|
57
|
-
|
|
57
|
+
TELEGRAM_BOT_RYOAI_SERVER_BOT_ID=
|
|
58
58
|
# Optional fallback only when server bot binding is unavailable
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
# TELEGRAM_BOT_RYOAI_USERNAME=<bot_username>
|
|
60
|
+
TELEGRAM_BOT_RYOAI_TOKEN=
|
|
61
|
+
TELEGRAM_BOT_RYOAI_ROLE_PROFILE=monitor
|
|
62
|
+
TELEGRAM_BOT_RYOAI_AI_CLIENT=gpt
|
|
63
|
+
TELEGRAM_BOT_RYOAI_AI_MODEL=gpt-5.4
|
|
64
|
+
TELEGRAM_BOT_RYOAI_AI_PERMISSION_MODE=read_only
|
|
65
|
+
TELEGRAM_BOT_RYOAI_AI_REASONING_EFFORT=low
|
|
66
66
|
|
|
67
67
|
# ~/.metheus/slack.env
|
|
68
68
|
SLACK_BOT_TOKEN=
|
|
@@ -212,15 +212,15 @@ Direct commands:
|
|
|
212
212
|
|
|
213
213
|
```bash
|
|
214
214
|
metheus-governance-mcp-cli bot list
|
|
215
|
-
metheus-governance-mcp-cli bot show --provider telegram --bot-key
|
|
215
|
+
metheus-governance-mcp-cli bot show --provider telegram --bot-key ryoai
|
|
216
216
|
metheus-governance-mcp-cli bot add --provider telegram
|
|
217
217
|
metheus-governance-mcp-cli bot edit
|
|
218
218
|
metheus-governance-mcp-cli bot edit --provider telegram
|
|
219
219
|
metheus-governance-mcp-cli bot remove --provider telegram
|
|
220
|
-
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key
|
|
221
|
-
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key
|
|
220
|
+
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key ryoai
|
|
221
|
+
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key ryoai
|
|
222
222
|
metheus-governance-mcp-cli bot global --provider telegram
|
|
223
|
-
metheus-governance-mcp-cli bot verify --provider telegram --bot-key
|
|
223
|
+
metheus-governance-mcp-cli bot verify --provider telegram --bot-key ryoai
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
Behavior:
|
|
@@ -269,11 +269,11 @@ Non-interactive examples:
|
|
|
269
269
|
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
|
|
270
270
|
metheus-governance-mcp-cli bot add --provider telegram --non-interactive true --server-bot-id <server_bot_uuid> --token <telegram_bot_token> --default true
|
|
271
271
|
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
|
|
272
|
-
metheus-governance-mcp-cli bot edit --provider telegram --bot-key
|
|
273
|
-
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key
|
|
274
|
-
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key
|
|
275
|
-
metheus-governance-mcp-cli bot remove --provider telegram --bot-key
|
|
276
|
-
metheus-governance-mcp-cli bot verify --provider telegram --bot-key
|
|
272
|
+
metheus-governance-mcp-cli bot edit --provider telegram --bot-key ryoai --non-interactive true --ai-client claude --ai-model "Sonnet 4.6r" --ai-permission-mode danger_full_access --ai-reasoning-effort high
|
|
273
|
+
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key ryoai --non-interactive true
|
|
274
|
+
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key ryoai --server-bot-id <server_bot_uuid> --bot-name <telegram_username> --role-profile monitor --ai-client gpt --ai-permission-mode read_only --ai-reasoning-effort low --non-interactive true
|
|
275
|
+
metheus-governance-mcp-cli bot remove --provider telegram --bot-key ryoai --non-interactive true
|
|
276
|
+
metheus-governance-mcp-cli bot verify --provider telegram --bot-key ryoai --json true
|
|
277
277
|
```
|
|
278
278
|
|
|
279
279
|
For direct Telegram adds, the CLI can derive the local entry key from the matched server bot name. You no longer need `--bot-key` or `--username` in the normal server-bound path. Treat `--bot-key` as an advanced override only when you intentionally want a different local suffix.
|
package/cli.mjs
CHANGED
|
@@ -749,32 +749,32 @@ function providerEnvTemplate(provider) {
|
|
|
749
749
|
"# TELEGRAM_BOT_TOKEN=<bot token>",
|
|
750
750
|
"#",
|
|
751
751
|
"# Preferred v2 multi-bot mapping:",
|
|
752
|
-
"# TELEGRAM_DEFAULT_BOT_KEY=
|
|
753
|
-
"#
|
|
754
|
-
"#
|
|
755
|
-
"#
|
|
756
|
-
"#
|
|
757
|
-
"#
|
|
758
|
-
"#
|
|
759
|
-
"#
|
|
760
|
-
"#
|
|
752
|
+
"# TELEGRAM_DEFAULT_BOT_KEY=ryoai",
|
|
753
|
+
"# TELEGRAM_BOT_RYOAI_SERVER_BOT_ID=<server bot uuid>",
|
|
754
|
+
"# TELEGRAM_BOT_RYOAI_USERNAME=<optional fallback username when server binding is unavailable>",
|
|
755
|
+
"# TELEGRAM_BOT_RYOAI_TOKEN=<bot token>",
|
|
756
|
+
"# TELEGRAM_BOT_RYOAI_ROLE_PROFILE=monitor",
|
|
757
|
+
"# TELEGRAM_BOT_RYOAI_AI_CLIENT=gpt",
|
|
758
|
+
"# TELEGRAM_BOT_RYOAI_AI_MODEL=gpt-5.4",
|
|
759
|
+
"# TELEGRAM_BOT_RYOAI_AI_PERMISSION_MODE=read_only",
|
|
760
|
+
"# TELEGRAM_BOT_RYOAI_AI_REASONING_EFFORT=low",
|
|
761
761
|
"",
|
|
762
762
|
"TELEGRAM_API_BASE_URL=",
|
|
763
763
|
"TELEGRAM_AUTO_CLEAR_WEBHOOK=true",
|
|
764
764
|
"TELEGRAM_ALLOWED_UPDATES=message,edited_message",
|
|
765
|
-
"TELEGRAM_DEFAULT_BOT_KEY=
|
|
765
|
+
"TELEGRAM_DEFAULT_BOT_KEY=ryoai",
|
|
766
766
|
"",
|
|
767
767
|
"# Legacy fallback (still supported)",
|
|
768
768
|
"TELEGRAM_BOT_TOKEN=",
|
|
769
769
|
"",
|
|
770
770
|
"# Preferred named bot entry",
|
|
771
|
-
"
|
|
772
|
-
"
|
|
773
|
-
"
|
|
774
|
-
"
|
|
775
|
-
"
|
|
776
|
-
"
|
|
777
|
-
"
|
|
771
|
+
"TELEGRAM_BOT_RYOAI_SERVER_BOT_ID=",
|
|
772
|
+
"TELEGRAM_BOT_RYOAI_TOKEN=",
|
|
773
|
+
"TELEGRAM_BOT_RYOAI_ROLE_PROFILE=",
|
|
774
|
+
"TELEGRAM_BOT_RYOAI_AI_CLIENT=",
|
|
775
|
+
"TELEGRAM_BOT_RYOAI_AI_MODEL=",
|
|
776
|
+
"TELEGRAM_BOT_RYOAI_AI_PERMISSION_MODE=",
|
|
777
|
+
"TELEGRAM_BOT_RYOAI_AI_REASONING_EFFORT=",
|
|
778
778
|
"",
|
|
779
779
|
].join("\n");
|
|
780
780
|
}
|
|
@@ -2641,6 +2641,7 @@ function normalizeTelegramBotEnvKey(rawValue, fallback = "") {
|
|
|
2641
2641
|
.trim()
|
|
2642
2642
|
.toLowerCase()
|
|
2643
2643
|
.replace(/[^a-z0-9]+/g, "_")
|
|
2644
|
+
.replace(/_bot$/g, "")
|
|
2644
2645
|
.replace(/^_+|_+$/g, "");
|
|
2645
2646
|
return normalized || fallback;
|
|
2646
2647
|
}
|
|
@@ -5078,8 +5079,8 @@ TELEGRAM_API_BASE_URL=http://127.0.0.1:8999/api
|
|
|
5078
5079
|
TELEGRAM_AUTO_CLEAR_WEBHOOK=false
|
|
5079
5080
|
TELEGRAM_ALLOWED_UPDATES=message,edited_message,channel_post
|
|
5080
5081
|
TELEGRAM_DEFAULT_BOT_KEY=review
|
|
5081
|
-
|
|
5082
|
-
|
|
5082
|
+
TELEGRAM_BOT_RYOAI_USERNAME=RyoAI_bot
|
|
5083
|
+
TELEGRAM_BOT_RYOAI_TOKEN=ryoai-token
|
|
5083
5084
|
TELEGRAM_BOT_REVIEW_SERVER_BOT_ID=bot-review
|
|
5084
5085
|
TELEGRAM_BOT_REVIEW_USERNAME=ReviewBot
|
|
5085
5086
|
TELEGRAM_BOT_REVIEW_TOKEN=review-token
|
|
@@ -5108,7 +5109,7 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
|
|
|
5108
5109
|
"telegram_env_v2_bot_name_override_selects_matching_token",
|
|
5109
5110
|
telegramEnvV2ByUsername.ok
|
|
5110
5111
|
&& telegramEnvV2ByUsername.token === "ryoai-token"
|
|
5111
|
-
&& telegramEnvV2ByUsername.botKey === "
|
|
5112
|
+
&& telegramEnvV2ByUsername.botKey === "ryoai"
|
|
5112
5113
|
&& Array.isArray(telegramEnvV2ByUsername.allowedUpdates)
|
|
5113
5114
|
&& telegramEnvV2ByUsername.allowedUpdates.includes("channel_post"),
|
|
5114
5115
|
`bot=${String(telegramEnvV2ByUsername.botKey || "(none)")} updates=${String((telegramEnvV2ByUsername.allowedUpdates || []).join(","))}`,
|
package/lib/bot-commands.mjs
CHANGED
|
@@ -67,7 +67,11 @@ function suggestDisplayedAIModel(deps, clientName, rawModelValue = "") {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function normalizeServerBotIdentityText(rawValue) {
|
|
70
|
-
return String(rawValue || "")
|
|
70
|
+
return String(rawValue || "")
|
|
71
|
+
.trim()
|
|
72
|
+
.replace(/^@+/, "")
|
|
73
|
+
.toLowerCase()
|
|
74
|
+
.replace(/_bot$/g, "");
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
function summarizeServerBotRoles(bots) {
|
|
@@ -391,12 +391,12 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
391
391
|
const groupedState = parseSimpleEnvText(fs.readFileSync(telegramEnvPath, "utf8"));
|
|
392
392
|
push(
|
|
393
393
|
"bot_add_guided_autoresolves_server_bot_group_without_role_prompt",
|
|
394
|
-
String(groupedState.
|
|
395
|
-
&& String(groupedState.
|
|
396
|
-
&& String(groupedState.
|
|
397
|
-
&& String(groupedState.
|
|
398
|
-
&& String(groupedState.
|
|
399
|
-
`username=${String(groupedState.
|
|
394
|
+
String(groupedState.TELEGRAM_BOT_RYOAI_USERNAME || "").trim() === ""
|
|
395
|
+
&& String(groupedState.TELEGRAM_BOT_RYOAI_SERVER_BOT_ID || "") === ""
|
|
396
|
+
&& String(groupedState.TELEGRAM_BOT_RYOAI_ROLE_PROFILE || "") === ""
|
|
397
|
+
&& String(groupedState.TELEGRAM_BOT_RYOAI_AI_CLIENT || "") === ""
|
|
398
|
+
&& String(groupedState.TELEGRAM_BOT_RYOAI_AI_PERMISSION_MODE || "") === "",
|
|
399
|
+
`username=${String(groupedState.TELEGRAM_BOT_RYOAI_USERNAME || "")} server_bot_id=${String(groupedState.TELEGRAM_BOT_RYOAI_SERVER_BOT_ID || "")} role=${String(groupedState.TELEGRAM_BOT_RYOAI_ROLE_PROFILE || "")}`,
|
|
400
400
|
);
|
|
401
401
|
|
|
402
402
|
const groupedEditResult = await runCLI({
|
|
@@ -410,7 +410,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
410
410
|
...env,
|
|
411
411
|
METHEUS_SCRIPTED_PROMPT_ANSWERS: JSON.stringify([
|
|
412
412
|
"1", // provider: telegram
|
|
413
|
-
"2", // bot entry:
|
|
413
|
+
"2", // bot entry: ryoai
|
|
414
414
|
"1", // keep token
|
|
415
415
|
"2", // grouped role settings: edit one role
|
|
416
416
|
"3", // select role to edit: worker
|
|
@@ -455,7 +455,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
455
455
|
args: [
|
|
456
456
|
"bot", "show",
|
|
457
457
|
"--provider", "telegram",
|
|
458
|
-
"--bot-key", "
|
|
458
|
+
"--bot-key", "ryoai",
|
|
459
459
|
"--base-url", `http://127.0.0.1:${groupedMock.port}`,
|
|
460
460
|
"--json", "true",
|
|
461
461
|
],
|