metheus-governance-mcp-cli 0.2.90 → 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 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 `TELEGRAM_BOT_RYOAI_BOT_TOKEN`
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=ryoai_bot
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
- TELEGRAM_BOT_RYOAI_BOT_SERVER_BOT_ID=
57
+ TELEGRAM_BOT_RYOAI_SERVER_BOT_ID=
58
58
  # Optional fallback only when server bot binding is unavailable
59
- # TELEGRAM_BOT_RYOAI_BOT_USERNAME=<bot_username>
60
- TELEGRAM_BOT_RYOAI_BOT_TOKEN=
61
- TELEGRAM_BOT_RYOAI_BOT_ROLE_PROFILE=monitor
62
- TELEGRAM_BOT_RYOAI_BOT_AI_CLIENT=gpt
63
- TELEGRAM_BOT_RYOAI_BOT_AI_MODEL=gpt-5.4
64
- TELEGRAM_BOT_RYOAI_BOT_AI_PERMISSION_MODE=read_only
65
- TELEGRAM_BOT_RYOAI_BOT_AI_REASONING_EFFORT=low
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 ryoai_bot
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 ryoai_bot
221
- metheus-governance-mcp-cli bot migrate --provider telegram --bot-key ryoai_bot
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 ryoai_bot
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 ryoai_bot --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_bot --non-interactive true
274
- metheus-governance-mcp-cli bot migrate --provider telegram --bot-key ryoai_bot --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_bot --non-interactive true
276
- metheus-governance-mcp-cli bot verify --provider telegram --bot-key ryoai_bot --json true
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=ryoai_bot",
753
- "# TELEGRAM_BOT_RYOAI_BOT_SERVER_BOT_ID=<server bot uuid>",
754
- "# TELEGRAM_BOT_RYOAI_BOT_USERNAME=<optional fallback username when server binding is unavailable>",
755
- "# TELEGRAM_BOT_RYOAI_BOT_TOKEN=<bot token>",
756
- "# TELEGRAM_BOT_RYOAI_BOT_ROLE_PROFILE=monitor",
757
- "# TELEGRAM_BOT_RYOAI_BOT_AI_CLIENT=gpt",
758
- "# TELEGRAM_BOT_RYOAI_BOT_AI_MODEL=gpt-5.4",
759
- "# TELEGRAM_BOT_RYOAI_BOT_AI_PERMISSION_MODE=read_only",
760
- "# TELEGRAM_BOT_RYOAI_BOT_AI_REASONING_EFFORT=low",
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=ryoai_bot",
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
- "TELEGRAM_BOT_RYOAI_BOT_SERVER_BOT_ID=",
772
- "TELEGRAM_BOT_RYOAI_BOT_TOKEN=",
773
- "TELEGRAM_BOT_RYOAI_BOT_ROLE_PROFILE=",
774
- "TELEGRAM_BOT_RYOAI_BOT_AI_CLIENT=",
775
- "TELEGRAM_BOT_RYOAI_BOT_AI_MODEL=",
776
- "TELEGRAM_BOT_RYOAI_BOT_AI_PERMISSION_MODE=",
777
- "TELEGRAM_BOT_RYOAI_BOT_AI_REASONING_EFFORT=",
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
- TELEGRAM_BOT_RYOAI_BOT_USERNAME=RyoAI_bot
5082
- TELEGRAM_BOT_RYOAI_BOT_TOKEN=ryoai-token
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 === "ryoai_bot"
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(","))}`,
@@ -67,7 +67,11 @@ function suggestDisplayedAIModel(deps, clientName, rawModelValue = "") {
67
67
  }
68
68
 
69
69
  function normalizeServerBotIdentityText(rawValue) {
70
- return String(rawValue || "").trim().replace(/^@+/, "").toLowerCase();
70
+ return String(rawValue || "")
71
+ .trim()
72
+ .replace(/^@+/, "")
73
+ .toLowerCase()
74
+ .replace(/_bot$/g, "");
71
75
  }
72
76
 
73
77
  function summarizeServerBotRoles(bots) {
@@ -2151,8 +2155,8 @@ async function addTelegramBot(ui, flags, deps) {
2151
2155
  if (nonInteractive && existingKeys.has(botKey)) {
2152
2156
  throw new Error(`Telegram bot key "${botKey}" already exists`);
2153
2157
  }
2154
- const serverGroupMatched = !nonInteractive && serverBot.matchMode === "group";
2155
- if (serverGroupMatched) {
2158
+ const serverGroupMatched = serverBot.matchMode === "group";
2159
+ if (serverGroupMatched && !nonInteractive) {
2156
2160
  process.stdout.write(
2157
2161
  `Matched server Telegram bot "${serverBot.name || username || botKey}" with roles: ${ensureArray(serverBot.roles).join(", ")}. Runtime will use the server role, so local role/AI fields can stay empty.\n`,
2158
2162
  );
@@ -2176,8 +2180,7 @@ async function addTelegramBot(ui, flags, deps) {
2176
2180
  || hasOwnFlag(flags, "reasoning-effort")
2177
2181
  || hasOwnFlag(flags, "ai-reasoning-effort");
2178
2182
  const autoApplyRoleDefaults = !nonInteractive && roleProfileAutoResolved && !aiFlagOverrides;
2179
- const autoUseServerRoleRouting = !nonInteractive
2180
- && serverGroupMatched
2183
+ const autoUseServerRoleRouting = serverGroupMatched
2181
2184
  && !String(flags["role-profile"] || "").trim()
2182
2185
  && !aiFlagOverrides;
2183
2186
  const client = requireDependency(deps, "normalizeLocalAIClientName")(
@@ -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.TELEGRAM_BOT_RYOAI_BOT_USERNAME || "").trim() === ""
395
- && String(groupedState.TELEGRAM_BOT_RYOAI_BOT_SERVER_BOT_ID || "") === ""
396
- && String(groupedState.TELEGRAM_BOT_RYOAI_BOT_ROLE_PROFILE || "") === ""
397
- && String(groupedState.TELEGRAM_BOT_RYOAI_BOT_AI_CLIENT || "") === ""
398
- && String(groupedState.TELEGRAM_BOT_RYOAI_BOT_AI_PERMISSION_MODE || "") === "",
399
- `username=${String(groupedState.TELEGRAM_BOT_RYOAI_BOT_USERNAME || "")} server_bot_id=${String(groupedState.TELEGRAM_BOT_RYOAI_BOT_SERVER_BOT_ID || "")} role=${String(groupedState.TELEGRAM_BOT_RYOAI_BOT_ROLE_PROFILE || "")}`,
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: ryoai_bot
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", "ryoai_bot",
458
+ "--bot-key", "ryoai",
459
459
  "--base-url", `http://127.0.0.1:${groupedMock.port}`,
460
460
  "--json", "true",
461
461
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metheus-governance-mcp-cli",
3
- "version": "0.2.90",
3
+ "version": "0.2.92",
4
4
  "description": "Metheus Governance MCP CLI (setup + stdio proxy)",
5
5
  "type": "module",
6
6
  "files": [