metheus-governance-mcp-cli 0.2.98 → 0.2.100
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 +14 -14
- package/cli.mjs +46 -16
- package/lib/bot-commands.mjs +29 -17
- package/lib/selftest-bot-commands.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ These files are for local provider bot secrets, local transport options, and opt
|
|
|
33
33
|
- Store locally:
|
|
34
34
|
- Telegram-wide settings in `~/.metheus/telegram-bots/_global.env`
|
|
35
35
|
- `TELEGRAM_BOT_TOKEN` as a legacy Telegram fallback in `_global.env`
|
|
36
|
-
- one Telegram bot file per entry in `~/.metheus/telegram-bots/<bot-
|
|
36
|
+
- one Telegram bot file per entry in `~/.metheus/telegram-bots/<server-bot-name>.env`
|
|
37
37
|
- `SLACK_BOT_TOKEN`
|
|
38
38
|
- `KAKAOTALK_BOT_TOKEN`
|
|
39
39
|
- Server-side Metheus stores project chat destination metadata separately:
|
|
@@ -50,14 +50,14 @@ Example templates:
|
|
|
50
50
|
TELEGRAM_API_BASE_URL=
|
|
51
51
|
TELEGRAM_AUTO_CLEAR_WEBHOOK=true
|
|
52
52
|
TELEGRAM_ALLOWED_UPDATES=message,edited_message
|
|
53
|
-
TELEGRAM_DEFAULT_BOT_KEY=
|
|
53
|
+
TELEGRAM_DEFAULT_BOT_KEY=ryoai_bot
|
|
54
54
|
|
|
55
55
|
# Legacy fallback
|
|
56
56
|
TELEGRAM_BOT_TOKEN=
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
```env
|
|
60
|
-
# ~/.metheus/telegram-bots/
|
|
60
|
+
# ~/.metheus/telegram-bots/ryoai_bot.env
|
|
61
61
|
TELEGRAM_BOT_NAME=ryoai_bot
|
|
62
62
|
TELEGRAM_BOT_SERVER_BOT_ID=
|
|
63
63
|
TELEGRAM_BOT_TOKEN=
|
|
@@ -172,7 +172,7 @@ metheus-governance-mcp-cli setup --project-id <project_uuid> --ctxpack-key "<ctx
|
|
|
172
172
|
When Telegram local config already exists, bootstrap/setup keeps your secrets but auto-normalizes the layout to the latest split structure:
|
|
173
173
|
|
|
174
174
|
- Telegram-wide settings stay in `~/.metheus/telegram-bots/_global.env`
|
|
175
|
-
- per-bot secrets move to `~/.metheus/telegram-bots/<bot-
|
|
175
|
+
- per-bot secrets move to `~/.metheus/telegram-bots/<server-bot-name>.env`
|
|
176
176
|
- stale inline keys such as `TELEGRAM_BOT_<NAME>_BOT_*` are rewritten into generic per-bot keys
|
|
177
177
|
|
|
178
178
|
Fill provider bot secrets and provider-local transport options locally. Project chat destination identifiers should be managed on the Metheus server as project chat destinations, not as local env values and not inside legacy Chat Hooks/webhooks.
|
|
@@ -223,15 +223,15 @@ Direct commands:
|
|
|
223
223
|
|
|
224
224
|
```bash
|
|
225
225
|
metheus-governance-mcp-cli bot list
|
|
226
|
-
metheus-governance-mcp-cli bot show --provider telegram --bot-key
|
|
226
|
+
metheus-governance-mcp-cli bot show --provider telegram --bot-key ryoai_bot
|
|
227
227
|
metheus-governance-mcp-cli bot add --provider telegram
|
|
228
228
|
metheus-governance-mcp-cli bot edit
|
|
229
229
|
metheus-governance-mcp-cli bot edit --provider telegram
|
|
230
230
|
metheus-governance-mcp-cli bot remove --provider telegram
|
|
231
|
-
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key
|
|
232
|
-
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key
|
|
231
|
+
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key ryoai_bot
|
|
232
|
+
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key ryoai_bot
|
|
233
233
|
metheus-governance-mcp-cli bot global --provider telegram
|
|
234
|
-
metheus-governance-mcp-cli bot verify --provider telegram --bot-key
|
|
234
|
+
metheus-governance-mcp-cli bot verify --provider telegram --bot-key ryoai_bot
|
|
235
235
|
```
|
|
236
236
|
|
|
237
237
|
Behavior:
|
|
@@ -258,7 +258,7 @@ Behavior:
|
|
|
258
258
|
- `bot set-default` without flags starts a guided numbered flow: provider -> bot entry -> confirm default change.
|
|
259
259
|
- `bot verify` without flags starts a guided numbered flow: provider -> bot entry -> output format.
|
|
260
260
|
- `bot remove` without flags starts a guided numbered flow: provider -> bot entry -> confirm removal.
|
|
261
|
-
- Telegram stores one bot file per entry under `~/.metheus/telegram-bots/<bot-
|
|
261
|
+
- Telegram stores one bot file per entry under `~/.metheus/telegram-bots/<server-bot-name>.env` with generic fields:
|
|
262
262
|
- `TELEGRAM_BOT_NAME`
|
|
263
263
|
- `TELEGRAM_BOT_SERVER_BOT_ID`
|
|
264
264
|
- `TELEGRAM_BOT_TOKEN`
|
|
@@ -280,11 +280,11 @@ Non-interactive examples:
|
|
|
280
280
|
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
|
|
281
281
|
metheus-governance-mcp-cli bot add --provider telegram --non-interactive true --server-bot-id <server_bot_uuid> --token <telegram_bot_token> --default true
|
|
282
282
|
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
|
|
283
|
-
metheus-governance-mcp-cli bot edit --provider telegram --bot-key
|
|
284
|
-
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key
|
|
285
|
-
metheus-governance-mcp-cli bot migrate --provider telegram --bot-key
|
|
286
|
-
metheus-governance-mcp-cli bot remove --provider telegram --bot-key
|
|
287
|
-
metheus-governance-mcp-cli bot verify --provider telegram --bot-key
|
|
283
|
+
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
|
|
284
|
+
metheus-governance-mcp-cli bot set-default --provider telegram --bot-key ryoai_bot --non-interactive true
|
|
285
|
+
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
|
|
286
|
+
metheus-governance-mcp-cli bot remove --provider telegram --bot-key ryoai_bot --non-interactive true
|
|
287
|
+
metheus-governance-mcp-cli bot verify --provider telegram --bot-key ryoai_bot --json true
|
|
288
288
|
```
|
|
289
289
|
|
|
290
290
|
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
|
@@ -2666,7 +2666,6 @@ function normalizeTelegramBotEnvKey(rawValue, fallback = "") {
|
|
|
2666
2666
|
.trim()
|
|
2667
2667
|
.toLowerCase()
|
|
2668
2668
|
.replace(/[^a-z0-9]+/g, "_")
|
|
2669
|
-
.replace(/_bot$/g, "")
|
|
2670
2669
|
.replace(/^_+|_+$/g, "");
|
|
2671
2670
|
return normalized || fallback;
|
|
2672
2671
|
}
|
|
@@ -2727,24 +2726,30 @@ function collectTelegramEnvBotEntries(parsedEnv) {
|
|
|
2727
2726
|
}
|
|
2728
2727
|
entries.set(botKey, entry);
|
|
2729
2728
|
}
|
|
2730
|
-
return Array.from(entries.values())
|
|
2729
|
+
return Array.from(entries.values()).map((entryRaw) => {
|
|
2730
|
+
const entry = { ...safeObject(entryRaw) };
|
|
2731
|
+
const preferredKey = normalizeTelegramBotEnvKey(entry.username || "", "");
|
|
2732
|
+
if (preferredKey) {
|
|
2733
|
+
entry.key = preferredKey;
|
|
2734
|
+
}
|
|
2735
|
+
return entry;
|
|
2736
|
+
});
|
|
2731
2737
|
}
|
|
2732
2738
|
|
|
2733
2739
|
function telegramBotEntryDisplayNameForState(entry) {
|
|
2734
2740
|
const current = safeObject(entry);
|
|
2735
2741
|
const username = normalizeTelegramBotUsername(current.username || "");
|
|
2736
2742
|
if (username) return username;
|
|
2737
|
-
|
|
2738
|
-
if (!key) return "telegram_bot";
|
|
2739
|
-
return key.endsWith("_bot") ? key : `${key}_bot`;
|
|
2743
|
+
return normalizeTelegramBotEnvKey(current.key || "", "telegram_bot");
|
|
2740
2744
|
}
|
|
2741
2745
|
|
|
2742
2746
|
function parseTelegramBotEntryFile(filePath) {
|
|
2743
2747
|
const raw = fs.readFileSync(filePath, "utf8");
|
|
2744
2748
|
const parsed = parseSimpleEnvText(raw);
|
|
2745
2749
|
const keyFromFile = normalizeTelegramBotEnvKey(path.basename(filePath, path.extname(filePath)), "telegram_bot");
|
|
2750
|
+
const keyFromName = normalizeTelegramBotEnvKey(parsed.TELEGRAM_BOT_NAME || parsed.TELEGRAM_BOT_USERNAME || "", "");
|
|
2746
2751
|
return {
|
|
2747
|
-
key: keyFromFile,
|
|
2752
|
+
key: keyFromName || keyFromFile,
|
|
2748
2753
|
username: normalizeTelegramBotUsername(parsed.TELEGRAM_BOT_NAME || parsed.TELEGRAM_BOT_USERNAME || ""),
|
|
2749
2754
|
serverBotID: String(parsed.TELEGRAM_BOT_SERVER_BOT_ID || "").trim(),
|
|
2750
2755
|
token: String(parsed.TELEGRAM_BOT_TOKEN || "").trim(),
|
|
@@ -2757,6 +2762,28 @@ function parseTelegramBotEntryFile(filePath) {
|
|
|
2757
2762
|
};
|
|
2758
2763
|
}
|
|
2759
2764
|
|
|
2765
|
+
function remapTelegramDefaultBotKey(defaultKeyRaw, entries) {
|
|
2766
|
+
const defaultKey = normalizeTelegramBotEnvKey(defaultKeyRaw || "", "");
|
|
2767
|
+
if (!defaultKey) return "";
|
|
2768
|
+
const rows = ensureArray(entries).map((entry) => safeObject(entry));
|
|
2769
|
+
if (rows.some((entry) => String(entry.key || "").trim() === defaultKey)) {
|
|
2770
|
+
return defaultKey;
|
|
2771
|
+
}
|
|
2772
|
+
const directBotMatch = rows.find((entry) => String(entry.key || "").trim() === `${defaultKey}_bot`);
|
|
2773
|
+
if (directBotMatch) {
|
|
2774
|
+
return String(directBotMatch.key || "").trim();
|
|
2775
|
+
}
|
|
2776
|
+
const compactBotMatch = rows.find((entry) => String(entry.key || "").trim() === `${defaultKey}bot`);
|
|
2777
|
+
if (compactBotMatch) {
|
|
2778
|
+
return String(compactBotMatch.key || "").trim();
|
|
2779
|
+
}
|
|
2780
|
+
const byUsername = rows.find((entry) => normalizeTelegramBotUsername(entry.username || "") === defaultKey);
|
|
2781
|
+
if (byUsername) {
|
|
2782
|
+
return String(byUsername.key || "").trim();
|
|
2783
|
+
}
|
|
2784
|
+
return defaultKey;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2760
2787
|
function loadTelegramBotEntriesFromFiles() {
|
|
2761
2788
|
const dirPath = telegramBotEntriesDirPath();
|
|
2762
2789
|
if (!fs.existsSync(dirPath)) return [];
|
|
@@ -2834,6 +2861,7 @@ function readTelegramEnvState() {
|
|
|
2834
2861
|
}
|
|
2835
2862
|
});
|
|
2836
2863
|
const entries = Array.from(mergedEntries.values());
|
|
2864
|
+
globalParsed.TELEGRAM_DEFAULT_BOT_KEY = remapTelegramDefaultBotKey(globalParsed.TELEGRAM_DEFAULT_BOT_KEY || "", entries);
|
|
2837
2865
|
return {
|
|
2838
2866
|
filePath,
|
|
2839
2867
|
legacyFilePath,
|
|
@@ -2854,14 +2882,15 @@ function telegramEntryCommentNameForEnv(entry) {
|
|
|
2854
2882
|
const current = safeObject(entry);
|
|
2855
2883
|
const username = normalizeTelegramBotUsername(current.username || "");
|
|
2856
2884
|
if (username) return username;
|
|
2857
|
-
|
|
2858
|
-
if (!key) return "telegram_bot";
|
|
2859
|
-
return key.endsWith("_bot") ? key : `${key}_bot`;
|
|
2885
|
+
return normalizeTelegramBotEnvKey(current.key || "", "telegram_bot");
|
|
2860
2886
|
}
|
|
2861
2887
|
|
|
2862
2888
|
function renderNormalizedTelegramEnv(parsedEnv) {
|
|
2863
2889
|
const parsed = safeObject(parsedEnv);
|
|
2864
|
-
const defaultBotKey =
|
|
2890
|
+
const defaultBotKey = remapTelegramDefaultBotKey(
|
|
2891
|
+
parsed.TELEGRAM_DEFAULT_BOT_KEY || "",
|
|
2892
|
+
collectTelegramEnvBotEntries(parsed),
|
|
2893
|
+
);
|
|
2865
2894
|
const lines = [
|
|
2866
2895
|
"# Metheus local Telegram bot settings",
|
|
2867
2896
|
"# Keep this file on your machine only. Do not commit it.",
|
|
@@ -3001,7 +3030,7 @@ function resolveTelegramEnvConfig(parsedEnv, filePath, config, selectors = {}) {
|
|
|
3001
3030
|
selectors.route?.telegramBotKey,
|
|
3002
3031
|
selectors.route?.telegram_bot_key,
|
|
3003
3032
|
]), "");
|
|
3004
|
-
const defaultBotKey =
|
|
3033
|
+
const defaultBotKey = remapTelegramDefaultBotKey(parsed.TELEGRAM_DEFAULT_BOT_KEY || "", entries);
|
|
3005
3034
|
let selected = null;
|
|
3006
3035
|
if (desiredBotID) {
|
|
3007
3036
|
selected = entries.find((entry) => entry.serverBotID === desiredBotID) || null;
|
|
@@ -5384,7 +5413,7 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
|
|
|
5384
5413
|
"telegram_env_v2_default_bot_key_selects_named_token",
|
|
5385
5414
|
telegramEnvV2Default.ok
|
|
5386
5415
|
&& telegramEnvV2Default.token === "review-token"
|
|
5387
|
-
&& telegramEnvV2Default.botKey === "
|
|
5416
|
+
&& telegramEnvV2Default.botKey === "reviewbot"
|
|
5388
5417
|
&& telegramEnvV2Default.autoClearWebhook === false,
|
|
5389
5418
|
`bot=${String(telegramEnvV2Default.botKey || "(none)")} token=${String(telegramEnvV2Default.token || "(missing)")}`,
|
|
5390
5419
|
);
|
|
@@ -5398,7 +5427,7 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
|
|
|
5398
5427
|
"telegram_env_v2_bot_name_override_selects_matching_token",
|
|
5399
5428
|
telegramEnvV2ByUsername.ok
|
|
5400
5429
|
&& telegramEnvV2ByUsername.token === "ryoai-token"
|
|
5401
|
-
&& telegramEnvV2ByUsername.botKey === "
|
|
5430
|
+
&& telegramEnvV2ByUsername.botKey === "ryoai_bot"
|
|
5402
5431
|
&& Array.isArray(telegramEnvV2ByUsername.allowedUpdates)
|
|
5403
5432
|
&& telegramEnvV2ByUsername.allowedUpdates.includes("channel_post"),
|
|
5404
5433
|
`bot=${String(telegramEnvV2ByUsername.botKey || "(none)")} updates=${String((telegramEnvV2ByUsername.allowedUpdates || []).join(","))}`,
|
|
@@ -5423,9 +5452,10 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
|
|
|
5423
5452
|
].join("\n"),
|
|
5424
5453
|
"utf8",
|
|
5425
5454
|
);
|
|
5426
|
-
|
|
5455
|
+
const normalizedState = readTelegramEnvState();
|
|
5456
|
+
writeTelegramEnvState(normalizedState.parsed);
|
|
5427
5457
|
normalizedGlobalText = fs.readFileSync(providerEnvFilePath("telegram"), "utf8");
|
|
5428
|
-
normalizedBotText = fs.readFileSync(telegramBotEntryFilePath("
|
|
5458
|
+
normalizedBotText = fs.readFileSync(telegramBotEntryFilePath("ryoai_bot"), "utf8");
|
|
5429
5459
|
} finally {
|
|
5430
5460
|
if (previousUserProfile === undefined) delete process.env.USERPROFILE;
|
|
5431
5461
|
else process.env.USERPROFILE = previousUserProfile;
|
|
@@ -5434,7 +5464,7 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
|
|
|
5434
5464
|
}
|
|
5435
5465
|
push(
|
|
5436
5466
|
"telegram_env_existing_file_auto_normalizes_named_keys",
|
|
5437
|
-
normalizedGlobalText.includes("TELEGRAM_DEFAULT_BOT_KEY=
|
|
5467
|
+
normalizedGlobalText.includes("TELEGRAM_DEFAULT_BOT_KEY=ryoai_bot")
|
|
5438
5468
|
&& !normalizedGlobalText.includes("TELEGRAM_BOT_RYOAI_BOT_TOKEN")
|
|
5439
5469
|
&& !normalizedGlobalText.includes("TELEGRAM_BOT_RYOAI_TOKEN")
|
|
5440
5470
|
&& normalizedBotText.includes("TELEGRAM_BOT_NAME=ryoai_bot")
|
package/lib/bot-commands.mjs
CHANGED
|
@@ -1475,6 +1475,18 @@ async function resolveServerBotForNonInteractive(provider, flags, deps, options
|
|
|
1475
1475
|
if (!match) {
|
|
1476
1476
|
throw new Error(`server bot ${requestedBotID} not found`);
|
|
1477
1477
|
}
|
|
1478
|
+
const sameNameMatches = bots.filter(
|
|
1479
|
+
(bot) => normalizeServerBotIdentityText(bot.name) === normalizeServerBotIdentityText(match.name),
|
|
1480
|
+
);
|
|
1481
|
+
if (sameNameMatches.length > 1) {
|
|
1482
|
+
return {
|
|
1483
|
+
botID: match.id,
|
|
1484
|
+
role: "",
|
|
1485
|
+
name: match.name,
|
|
1486
|
+
roles: summarizeServerBotRoles(sameNameMatches),
|
|
1487
|
+
matchMode: "group",
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1478
1490
|
return {
|
|
1479
1491
|
botID: match.id,
|
|
1480
1492
|
role: match.role,
|
|
@@ -2189,16 +2201,6 @@ async function addTelegramBot(ui, flags, deps) {
|
|
|
2189
2201
|
`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`,
|
|
2190
2202
|
);
|
|
2191
2203
|
}
|
|
2192
|
-
const defaultRoleProfile = firstNonEmptyString([flags["role-profile"], serverBot.role, ""]);
|
|
2193
|
-
const roleProfileAutoResolved = !nonInteractive && !String(flags["role-profile"] || "").trim() && Boolean(defaultRoleProfile);
|
|
2194
|
-
const roleProfile = requireDependency(deps, "normalizeRunnerRoleProfileName")(
|
|
2195
|
-
nonInteractive
|
|
2196
|
-
? String(flags["role-profile"] || defaultRoleProfile).trim()
|
|
2197
|
-
: (serverGroupMatched && !String(flags["role-profile"] || "").trim()
|
|
2198
|
-
? ""
|
|
2199
|
-
: (roleProfileAutoResolved ? defaultRoleProfile : await promptTelegramRoleProfile(ui, deps, defaultRoleProfile))),
|
|
2200
|
-
);
|
|
2201
|
-
const roleProfileDefaults = resolveRoleProfileDefaults(roleProfile, deps);
|
|
2202
2204
|
const aiFlagOverrides = hasOwnFlag(flags, "client")
|
|
2203
2205
|
|| hasOwnFlag(flags, "ai-client")
|
|
2204
2206
|
|| hasOwnFlag(flags, "model")
|
|
@@ -2207,13 +2209,23 @@ async function addTelegramBot(ui, flags, deps) {
|
|
|
2207
2209
|
|| hasOwnFlag(flags, "ai-permission-mode")
|
|
2208
2210
|
|| hasOwnFlag(flags, "reasoning-effort")
|
|
2209
2211
|
|| hasOwnFlag(flags, "ai-reasoning-effort");
|
|
2210
|
-
const
|
|
2212
|
+
const defaultRoleProfile = firstNonEmptyString([flags["role-profile"], serverBot.role, ""]);
|
|
2213
|
+
const roleProfileAutoResolved = !nonInteractive && !String(flags["role-profile"] || "").trim() && Boolean(defaultRoleProfile);
|
|
2211
2214
|
const autoUseServerRoleRouting = serverGroupMatched
|
|
2212
2215
|
&& !String(flags["role-profile"] || "").trim()
|
|
2213
2216
|
&& !aiFlagOverrides;
|
|
2217
|
+
const roleProfile = requireDependency(deps, "normalizeRunnerRoleProfileName")(
|
|
2218
|
+
nonInteractive
|
|
2219
|
+
? (autoUseServerRoleRouting ? "" : String(flags["role-profile"] || defaultRoleProfile).trim())
|
|
2220
|
+
: (serverGroupMatched && !String(flags["role-profile"] || "").trim()
|
|
2221
|
+
? ""
|
|
2222
|
+
: (roleProfileAutoResolved ? defaultRoleProfile : await promptTelegramRoleProfile(ui, deps, defaultRoleProfile))),
|
|
2223
|
+
);
|
|
2224
|
+
const roleProfileDefaults = resolveRoleProfileDefaults(roleProfile, deps);
|
|
2225
|
+
const autoApplyRoleDefaults = !nonInteractive && roleProfileAutoResolved && !aiFlagOverrides;
|
|
2214
2226
|
const client = requireDependency(deps, "normalizeLocalAIClientName")(
|
|
2215
2227
|
nonInteractive
|
|
2216
|
-
? firstNonEmptyString([getAIClientFlag(flags), roleProfileDefaults.client])
|
|
2228
|
+
? (autoUseServerRoleRouting ? getAIClientFlag(flags) : firstNonEmptyString([getAIClientFlag(flags), roleProfileDefaults.client]))
|
|
2217
2229
|
: (autoUseServerRoleRouting
|
|
2218
2230
|
? getAIClientFlag(flags)
|
|
2219
2231
|
: (autoApplyRoleDefaults
|
|
@@ -2222,15 +2234,15 @@ async function addTelegramBot(ui, flags, deps) {
|
|
|
2222
2234
|
"",
|
|
2223
2235
|
);
|
|
2224
2236
|
const model = nonInteractive
|
|
2225
|
-
? firstNonEmptyString([getAIModelFlag(flags), roleProfileDefaults.model])
|
|
2237
|
+
? (autoUseServerRoleRouting ? getAIModelFlag(flags) : firstNonEmptyString([getAIModelFlag(flags), roleProfileDefaults.model]))
|
|
2226
2238
|
: (autoUseServerRoleRouting
|
|
2227
2239
|
? getAIModelFlag(flags)
|
|
2228
2240
|
: (autoApplyRoleDefaults
|
|
2229
|
-
|
|
2230
|
-
|
|
2241
|
+
? await promptAIModel(ui, deps, client, firstNonEmptyString([getAIModelFlag(flags), roleProfileDefaults.model]))
|
|
2242
|
+
: await promptAIModel(ui, deps, client, firstNonEmptyString([getAIModelFlag(flags), roleProfileDefaults.model]))));
|
|
2231
2243
|
const permissionMode = requireDependency(deps, "normalizeLocalAIPermissionMode")(
|
|
2232
2244
|
nonInteractive
|
|
2233
|
-
? firstNonEmptyString([getAIPermissionModeFlag(flags), roleProfileDefaults.permissionMode])
|
|
2245
|
+
? (autoUseServerRoleRouting ? getAIPermissionModeFlag(flags) : firstNonEmptyString([getAIPermissionModeFlag(flags), roleProfileDefaults.permissionMode]))
|
|
2234
2246
|
: (autoUseServerRoleRouting
|
|
2235
2247
|
? getAIPermissionModeFlag(flags)
|
|
2236
2248
|
: (autoApplyRoleDefaults
|
|
@@ -2240,7 +2252,7 @@ async function addTelegramBot(ui, flags, deps) {
|
|
|
2240
2252
|
);
|
|
2241
2253
|
const reasoningEffort = requireDependency(deps, "normalizeLocalAIReasoningEffort")(
|
|
2242
2254
|
nonInteractive
|
|
2243
|
-
? firstNonEmptyString([getAIReasoningEffortFlag(flags), roleProfileDefaults.reasoningEffort])
|
|
2255
|
+
? (autoUseServerRoleRouting ? getAIReasoningEffortFlag(flags) : firstNonEmptyString([getAIReasoningEffortFlag(flags), roleProfileDefaults.reasoningEffort]))
|
|
2244
2256
|
: (autoUseServerRoleRouting
|
|
2245
2257
|
? getAIReasoningEffortFlag(flags)
|
|
2246
2258
|
: (autoApplyRoleDefaults
|
|
@@ -398,7 +398,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
398
398
|
]),
|
|
399
399
|
},
|
|
400
400
|
});
|
|
401
|
-
const groupedState = readTelegramBotEntry("
|
|
401
|
+
const groupedState = readTelegramBotEntry("ryoai_bot");
|
|
402
402
|
push(
|
|
403
403
|
"bot_add_guided_autoresolves_server_bot_group_without_role_prompt",
|
|
404
404
|
String(groupedState.TELEGRAM_BOT_NAME || "").toLowerCase() === "ryoai_bot"
|
|
@@ -420,7 +420,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
420
420
|
...env,
|
|
421
421
|
METHEUS_SCRIPTED_PROMPT_ANSWERS: JSON.stringify([
|
|
422
422
|
"1", // provider: telegram
|
|
423
|
-
"2", // bot entry:
|
|
423
|
+
"2", // bot entry: ryoai_bot
|
|
424
424
|
"1", // keep token
|
|
425
425
|
"2", // grouped role settings: edit one role
|
|
426
426
|
"3", // select role to edit: worker
|
|
@@ -465,7 +465,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
465
465
|
args: [
|
|
466
466
|
"bot", "show",
|
|
467
467
|
"--provider", "telegram",
|
|
468
|
-
"--bot-key", "
|
|
468
|
+
"--bot-key", "ryoai_bot",
|
|
469
469
|
"--base-url", `http://127.0.0.1:${groupedMock.port}`,
|
|
470
470
|
"--json", "true",
|
|
471
471
|
],
|