metheus-governance-mcp-cli 0.2.88 → 0.2.90

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_MAIN_TOKEN`
34
+ - `TELEGRAM_BOT_TOKEN` or named Telegram bot mappings such as `TELEGRAM_BOT_RYOAI_BOT_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=main
51
+ TELEGRAM_DEFAULT_BOT_KEY=ryoai_bot
52
52
 
53
53
  # Legacy fallback
54
54
  TELEGRAM_BOT_TOKEN=
55
55
 
56
56
  # Preferred named bot mapping
57
- TELEGRAM_BOT_MAIN_SERVER_BOT_ID=
57
+ TELEGRAM_BOT_RYOAI_BOT_SERVER_BOT_ID=
58
58
  # Optional fallback only when server bot binding is unavailable
59
- # TELEGRAM_BOT_MAIN_USERNAME=<bot_username>
60
- TELEGRAM_BOT_MAIN_TOKEN=
61
- TELEGRAM_BOT_MAIN_ROLE_PROFILE=monitor
62
- TELEGRAM_BOT_MAIN_AI_CLIENT=codex
63
- TELEGRAM_BOT_MAIN_AI_MODEL=
64
- TELEGRAM_BOT_MAIN_AI_PERMISSION_MODE=read_only
65
- TELEGRAM_BOT_MAIN_AI_REASONING_EFFORT=low
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
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 main
215
+ metheus-governance-mcp-cli bot show --provider telegram --bot-key ryoai_bot
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 main
221
- metheus-governance-mcp-cli bot migrate --provider telegram --bot-key main
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
222
222
  metheus-governance-mcp-cli bot global --provider telegram
223
- metheus-governance-mcp-cli bot verify --provider telegram --bot-key main
223
+ metheus-governance-mcp-cli bot verify --provider telegram --bot-key ryoai_bot
224
224
  ```
225
225
 
226
226
  Behavior:
@@ -270,10 +270,10 @@ metheus-governance-mcp-cli bot global --provider telegram --non-interactive true
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
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 main --non-interactive true
274
- 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
275
- metheus-governance-mcp-cli bot remove --provider telegram --bot-key main --non-interactive true
276
- metheus-governance-mcp-cli bot verify --provider telegram --bot-key main --json true
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
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=main",
753
- "# TELEGRAM_BOT_MAIN_SERVER_BOT_ID=<server bot uuid>",
754
- "# TELEGRAM_BOT_MAIN_USERNAME=<optional fallback username when server binding is unavailable>",
755
- "# TELEGRAM_BOT_MAIN_TOKEN=<bot token>",
756
- "# TELEGRAM_BOT_MAIN_ROLE_PROFILE=monitor",
757
- "# TELEGRAM_BOT_MAIN_AI_CLIENT=codex",
758
- "# TELEGRAM_BOT_MAIN_AI_MODEL=",
759
- "# TELEGRAM_BOT_MAIN_AI_PERMISSION_MODE=read_only",
760
- "# TELEGRAM_BOT_MAIN_AI_REASONING_EFFORT=low",
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",
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=main",
765
+ "TELEGRAM_DEFAULT_BOT_KEY=ryoai_bot",
766
766
  "",
767
767
  "# Legacy fallback (still supported)",
768
768
  "TELEGRAM_BOT_TOKEN=",
769
769
  "",
770
770
  "# Preferred named bot entry",
771
- "TELEGRAM_BOT_MAIN_SERVER_BOT_ID=",
772
- "TELEGRAM_BOT_MAIN_TOKEN=",
773
- "TELEGRAM_BOT_MAIN_ROLE_PROFILE=",
774
- "TELEGRAM_BOT_MAIN_AI_CLIENT=",
775
- "TELEGRAM_BOT_MAIN_AI_MODEL=",
776
- "TELEGRAM_BOT_MAIN_AI_PERMISSION_MODE=",
777
- "TELEGRAM_BOT_MAIN_AI_REASONING_EFFORT=",
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=",
778
778
  "",
779
779
  ].join("\n");
780
780
  }
@@ -5078,8 +5078,8 @@ TELEGRAM_API_BASE_URL=http://127.0.0.1:8999/api
5078
5078
  TELEGRAM_AUTO_CLEAR_WEBHOOK=false
5079
5079
  TELEGRAM_ALLOWED_UPDATES=message,edited_message,channel_post
5080
5080
  TELEGRAM_DEFAULT_BOT_KEY=review
5081
- TELEGRAM_BOT_MAIN_USERNAME=RyoAI_bot
5082
- TELEGRAM_BOT_MAIN_TOKEN=main-token
5081
+ TELEGRAM_BOT_RYOAI_BOT_USERNAME=RyoAI_bot
5082
+ TELEGRAM_BOT_RYOAI_BOT_TOKEN=ryoai-token
5083
5083
  TELEGRAM_BOT_REVIEW_SERVER_BOT_ID=bot-review
5084
5084
  TELEGRAM_BOT_REVIEW_USERNAME=ReviewBot
5085
5085
  TELEGRAM_BOT_REVIEW_TOKEN=review-token
@@ -5107,8 +5107,8 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
5107
5107
  push(
5108
5108
  "telegram_env_v2_bot_name_override_selects_matching_token",
5109
5109
  telegramEnvV2ByUsername.ok
5110
- && telegramEnvV2ByUsername.token === "main-token"
5111
- && telegramEnvV2ByUsername.botKey === "main"
5110
+ && telegramEnvV2ByUsername.token === "ryoai-token"
5111
+ && telegramEnvV2ByUsername.botKey === "ryoai_bot"
5112
5112
  && Array.isArray(telegramEnvV2ByUsername.allowedUpdates)
5113
5113
  && telegramEnvV2ByUsername.allowedUpdates.includes("channel_post"),
5114
5114
  `bot=${String(telegramEnvV2ByUsername.botKey || "(none)")} updates=${String((telegramEnvV2ByUsername.allowedUpdates || []).join(","))}`,
@@ -724,12 +724,12 @@ function buildDerivedTelegramBotKey(parsedEnv, deps, preferredValues, { excludeK
724
724
  const candidates = uniqueNormalizedValues(
725
725
  [
726
726
  ...ensureArray(preferredValues),
727
- "main",
727
+ "telegram_bot",
728
728
  ],
729
729
  deps,
730
- "main",
730
+ "telegram_bot",
731
731
  );
732
- const baseKey = candidates[0] || normalizeBotKey("main", "main") || "main";
732
+ const baseKey = candidates[0] || normalizeBotKey("telegram_bot", "telegram_bot") || "telegram_bot";
733
733
  for (const candidate of candidates) {
734
734
  if (!existingKeys.has(candidate)) {
735
735
  return candidate;
@@ -748,9 +748,24 @@ async function editTelegramBotGuided(ui, parsed, selected, current, flags, deps)
748
748
  let groupedServerName = "";
749
749
  let serverManagedIdentity = Boolean(current.serverBotID || current.__preferServerIdentity);
750
750
  if (!serverManagedIdentity) {
751
- const initialServerBot = await autoResolveTelegramServerBot(current, flags, deps);
752
- if (String(initialServerBot.botID || "").trim() || initialServerBot.matchMode === "group") {
751
+ const initialBinding = await resolveTelegramServerBindingDetails(
752
+ {
753
+ serverBotID: current.serverBotID,
754
+ botUsername: current.username,
755
+ botKey: current.key,
756
+ roleProfile: current.roleProfile,
757
+ },
758
+ flags,
759
+ deps,
760
+ );
761
+ if (initialBinding.ok && (String(initialBinding.serverBotID || "").trim() || initialBinding.mode === "group")) {
753
762
  serverManagedIdentity = true;
763
+ current.__preferServerIdentity = true;
764
+ if (initialBinding.mode === "single") {
765
+ current.serverBotID = String(initialBinding.serverBotID || "").trim();
766
+ current.roleProfile = String(initialBinding.role || current.roleProfile || "").trim();
767
+ applyRoleProfileDefaults(current, resolveRoleProfileDefaults(current.roleProfile, deps));
768
+ }
754
769
  }
755
770
  }
756
771
  let usernameAction = "keep";
@@ -2046,7 +2061,7 @@ async function addTelegramBot(ui, flags, deps) {
2046
2061
  const nonInteractive = boolFromRaw(flags["non-interactive"] ?? flags.yes, false);
2047
2062
  const normalizeBotKey = requireDependency(deps, "normalizeTelegramBotEnvKey");
2048
2063
  const existingKeys = new Set(telegramEntriesForDisplay(parsed, deps).map((entry) => entry.key));
2049
- const defaultKeyHint = normalizeBotKey(flags["bot-key"] || "main", "main");
2064
+ const defaultKeyHint = normalizeBotKey(flags["bot-key"] || "telegram_bot", "telegram_bot");
2050
2065
 
2051
2066
  const token = nonInteractive
2052
2067
  ? String(flags.token || "").trim()
@@ -2783,7 +2798,7 @@ async function runBotMigrate(ui, flags, deps) {
2783
2798
  const nonInteractive = boolFromRaw(flags["non-interactive"] ?? flags.yes, false);
2784
2799
  const normalizeBotKey = requireDependency(deps, "normalizeTelegramBotEnvKey");
2785
2800
  const existingKeys = new Set(telegramEntriesForDisplay(parsed, deps).map((entry) => entry.key));
2786
- const defaultKeyHint = normalizeBotKey(flags["bot-key"] || parsed.TELEGRAM_DEFAULT_BOT_KEY || "main", "main");
2801
+ const defaultKeyHint = normalizeBotKey(flags["bot-key"] || parsed.TELEGRAM_DEFAULT_BOT_KEY || "telegram_bot", "telegram_bot");
2787
2802
  const botKey = normalizeBotKey(
2788
2803
  nonInteractive
2789
2804
  ? String(flags["bot-key"] || defaultKeyHint).trim()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metheus-governance-mcp-cli",
3
- "version": "0.2.88",
3
+ "version": "0.2.90",
4
4
  "description": "Metheus Governance MCP CLI (setup + stdio proxy)",
5
5
  "type": "module",
6
6
  "files": [