metheus-governance-mcp-cli 0.2.104 → 0.2.105
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 +10 -6
- package/cli.mjs +13 -5
- package/lib/bot-commands.mjs +2 -2
- package/lib/local-ai-adapters.mjs +6 -6
- package/lib/selftest-bot-commands.mjs +14 -14
- package/package.json +1 -1
- package/postinstall.mjs +3 -3
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ Runner template:
|
|
|
95
95
|
},
|
|
96
96
|
"role_profiles": {
|
|
97
97
|
"monitor": {
|
|
98
|
-
"client": "
|
|
98
|
+
"client": "gpt",
|
|
99
99
|
"model": "",
|
|
100
100
|
"permission_mode": "read_only",
|
|
101
101
|
"reasoning_effort": "low"
|
|
@@ -106,7 +106,7 @@ Runner template:
|
|
|
106
106
|
"bot_id": "<server_bot_uuid>",
|
|
107
107
|
"bot_name": "<bot_name>",
|
|
108
108
|
"role_profile": "monitor",
|
|
109
|
-
"client": "
|
|
109
|
+
"client": "gpt",
|
|
110
110
|
"model": "",
|
|
111
111
|
"permission_mode": "read_only",
|
|
112
112
|
"reasoning_effort": "low"
|
|
@@ -194,15 +194,18 @@ Fill provider bot secrets and provider-local transport options locally. Project
|
|
|
194
194
|
Built-in helper command for legacy fallback/testing:
|
|
195
195
|
|
|
196
196
|
```bash
|
|
197
|
-
metheus-governance-mcp-cli local-bot-bridge --client
|
|
197
|
+
metheus-governance-mcp-cli local-bot-bridge --client gpt --no-update
|
|
198
198
|
```
|
|
199
199
|
|
|
200
200
|
Supported `--client` values:
|
|
201
|
-
- `
|
|
201
|
+
- `gpt`
|
|
202
202
|
- `claude`
|
|
203
203
|
- `gemini`
|
|
204
204
|
- `sample`
|
|
205
205
|
|
|
206
|
+
Compatibility note:
|
|
207
|
+
- `codex` is still accepted as an alias for `gpt` because the GPT adapter runs through the Codex CLI binary.
|
|
208
|
+
|
|
206
209
|
Use `sample` first for smoke tests before switching to a real AI client.
|
|
207
210
|
|
|
208
211
|
Gemini CLI note:
|
|
@@ -378,7 +381,7 @@ Execution model:
|
|
|
378
381
|
- local runner stores workspace mapping and role profiles
|
|
379
382
|
- runner resolves `project_id -> workspace_dir`
|
|
380
383
|
- runner resolves server bot role to a local `role_profile`
|
|
381
|
-
- runner executes the mapped client adapter (`
|
|
384
|
+
- runner executes the mapped client adapter (`gpt` / `claude` / `gemini`)
|
|
382
385
|
- legacy `command` remains readable for migration, but execution is disabled by default unless `METHEUS_ALLOW_LEGACY_RUNNER_COMMAND=1`
|
|
383
386
|
|
|
384
387
|
Commands:
|
|
@@ -421,7 +424,8 @@ Why `workspace_dir` matters:
|
|
|
421
424
|
- without a valid project mapping, bots may answer with a generic local root instead of the real project workspace
|
|
422
425
|
|
|
423
426
|
Role profile fields:
|
|
424
|
-
- `client`: `
|
|
427
|
+
- `client`: `gpt`, `claude`, `gemini`, or `sample`
|
|
428
|
+
- `codex` is still accepted as a compatibility alias for `gpt`
|
|
425
429
|
- `model`: optional CLI-specific model name
|
|
426
430
|
- `permission_mode`: `read_only`, `workspace_write`, `danger_full_access`
|
|
427
431
|
- `reasoning_effort`: `low`, `medium`, `high`
|
package/cli.mjs
CHANGED
|
@@ -185,7 +185,7 @@ const CTXPACK_PUSH_TOOL_NAMES = ["ctxpack.push", "ctxpack.update", "ctxpack.save
|
|
|
185
185
|
const CLI_META = loadCLIMeta();
|
|
186
186
|
const CLI_NAME = CLI_META.name || "metheus-governance-mcp-cli";
|
|
187
187
|
const CLI_VERSION = CLI_META.version || "0.0.0";
|
|
188
|
-
const DEFAULT_BOT_RUNNER_CLIENT =
|
|
188
|
+
const DEFAULT_BOT_RUNNER_CLIENT = "gpt";
|
|
189
189
|
const SELF_UPDATE_CHECK_INTERVAL_MS = 6 * 60 * 60 * 1000;
|
|
190
190
|
const SELF_UPDATE_TIMEOUT_SECONDS = 6;
|
|
191
191
|
const SELF_UPDATE_ENV_KEY = "METHEUS_CLI_AUTO_UPDATE";
|
|
@@ -253,7 +253,7 @@ function printUsage() {
|
|
|
253
253
|
` ${cmd} doctor [--project-id <uuid>] [--ctxpack-key <key>] [--base-url <url>] [--timeout-seconds <n>] [--strict <true|false>]`,
|
|
254
254
|
` ${cmd} proxy [--project-id <uuid>] [--ctxpack-key <key>] [--base-url <url>] [--workspace-dir <path|auto>] [--include-drafts <true|false>] [--auto-pull-on-conflict <true|false>] [--timeout-seconds <n>]`,
|
|
255
255
|
` ${cmd} selftest [--json <true|false>]`,
|
|
256
|
-
` ${cmd} local-bot-bridge [--client <
|
|
256
|
+
` ${cmd} local-bot-bridge [--client <gpt|claude|gemini|sample>] [--cwd <path>] [--model <name>] [--permission-mode <read_only|workspace_write|danger_full_access>] [--reasoning-effort <low|medium|high>]`,
|
|
257
257
|
` ${cmd} runner list [--json <true|false>]`,
|
|
258
258
|
` ${cmd} runner once [--route-name <name> | --bot-name <server_name> | --bot-id <uuid>] [--project-id <uuid>] [--provider <telegram|slack|kakaotalk>] [--role <monitor|review|worker|approval>] [--role-profile <name>] [--mentions-only <true|false>] [--reply-to-bot-messages <true|false>] [--direct-messages <true|false>] [--ignore-edited-messages <true|false>] [--dry-run-delivery <true|false>] [--context-comments <n>] [--archive-replies <true|false>]`,
|
|
259
259
|
` ${cmd} runner start [--route-name <name> | --bot-name <server_name> | --bot-id <uuid>] [--project-id <uuid>] [--provider <telegram|slack|kakaotalk>] [--role <monitor|review|worker|approval>] [--role-profile <name>] [--mentions-only <true|false>] [--reply-to-bot-messages <true|false>] [--direct-messages <true|false>] [--ignore-edited-messages <true|false>] [--dry-run-delivery <true|false>] [--poll-interval-ms <n>] [--context-comments <n>] [--archive-replies <true|false>]`,
|
|
@@ -832,7 +832,7 @@ function defaultLocalBotBridgeCommand(client = DEFAULT_BOT_RUNNER_CLIENT) {
|
|
|
832
832
|
function defaultBotRunnerRoleProfiles() {
|
|
833
833
|
return {
|
|
834
834
|
monitor: {
|
|
835
|
-
client: "
|
|
835
|
+
client: "gpt",
|
|
836
836
|
model: "",
|
|
837
837
|
permission_mode: "read_only",
|
|
838
838
|
reasoning_effort: "low",
|
|
@@ -844,7 +844,7 @@ function defaultBotRunnerRoleProfiles() {
|
|
|
844
844
|
reasoning_effort: "medium",
|
|
845
845
|
},
|
|
846
846
|
worker: {
|
|
847
|
-
client: "
|
|
847
|
+
client: "gpt",
|
|
848
848
|
model: "",
|
|
849
849
|
permission_mode: "danger_full_access",
|
|
850
850
|
reasoning_effort: "medium",
|
|
@@ -1243,6 +1243,7 @@ function normalizeBotRunnerConfigContents(parsed, filePath) {
|
|
|
1243
1243
|
const defaults = defaultBotRunnerRoleProfiles();
|
|
1244
1244
|
const rawRoleProfiles = safeObject(raw.role_profiles || raw.roleProfiles);
|
|
1245
1245
|
const roleProfiles = {};
|
|
1246
|
+
let migrated = rawVersion < BOT_RUNNER_CONFIG_VERSION;
|
|
1246
1247
|
const roleProfileNames = new Set([
|
|
1247
1248
|
...Object.keys(defaults),
|
|
1248
1249
|
...Object.keys(rawRoleProfiles).map((name) => normalizeRunnerRoleProfileName(name)).filter(Boolean),
|
|
@@ -1253,6 +1254,10 @@ function normalizeBotRunnerConfigContents(parsed, filePath) {
|
|
|
1253
1254
|
rawRoleProfiles[profileName],
|
|
1254
1255
|
defaults[profileName] || {},
|
|
1255
1256
|
);
|
|
1257
|
+
const rawClient = String(safeObject(rawRoleProfiles[profileName]).client || safeObject(rawRoleProfiles[profileName]).cli || "").trim().toLowerCase();
|
|
1258
|
+
if (rawClient === "codex") {
|
|
1259
|
+
migrated = true;
|
|
1260
|
+
}
|
|
1256
1261
|
}
|
|
1257
1262
|
|
|
1258
1263
|
const botBindings = {};
|
|
@@ -1262,6 +1267,10 @@ function normalizeBotRunnerConfigContents(parsed, filePath) {
|
|
|
1262
1267
|
if (!binding.name || (!binding.botID && !binding.botName)) continue;
|
|
1263
1268
|
if (!binding.roleProfile && !binding.client && !binding.model && !binding.permissionMode && !binding.reasoningEffort) continue;
|
|
1264
1269
|
botBindings[binding.name] = binding;
|
|
1270
|
+
const rawClient = String(safeObject(rawBinding).client || "").trim().toLowerCase();
|
|
1271
|
+
if (rawClient === "codex") {
|
|
1272
|
+
migrated = true;
|
|
1273
|
+
}
|
|
1265
1274
|
}
|
|
1266
1275
|
|
|
1267
1276
|
const projectMappings = {};
|
|
@@ -1274,7 +1283,6 @@ function normalizeBotRunnerConfigContents(parsed, filePath) {
|
|
|
1274
1283
|
}
|
|
1275
1284
|
|
|
1276
1285
|
const routes = [];
|
|
1277
|
-
let migrated = rawVersion < BOT_RUNNER_CONFIG_VERSION;
|
|
1278
1286
|
for (const rawRoute of ensureArray(raw.routes)) {
|
|
1279
1287
|
const routeSource = safeObject(rawRoute);
|
|
1280
1288
|
const route = normalizeRunnerRoute(routeSource);
|
package/lib/bot-commands.mjs
CHANGED
|
@@ -813,7 +813,7 @@ function telegramEntryDisplayName(entry) {
|
|
|
813
813
|
|
|
814
814
|
function displayLocalAIClientName(clientName) {
|
|
815
815
|
const normalized = String(clientName || "").trim().toLowerCase();
|
|
816
|
-
if (normalized === "
|
|
816
|
+
if (normalized === "gpt" || normalized === "codex") return "GPT";
|
|
817
817
|
if (normalized === "claude") return "Claude";
|
|
818
818
|
if (normalized === "gemini") return "Gemini";
|
|
819
819
|
if (normalized === "sample") return "Sample";
|
|
@@ -1758,7 +1758,7 @@ async function promptAIClient(ui, deps, defaultValue = "") {
|
|
|
1758
1758
|
|
|
1759
1759
|
function suggestedAIModelsForClient(clientName) {
|
|
1760
1760
|
const normalizedClient = String(clientName || "").trim().toLowerCase();
|
|
1761
|
-
if (normalizedClient === "
|
|
1761
|
+
if (normalizedClient === "gpt") {
|
|
1762
1762
|
return [
|
|
1763
1763
|
{ value: "gpt-5.4", label: "gpt-5.4", description: "recommended GPT model" },
|
|
1764
1764
|
{ value: "gpt-5.3-codex", label: "gpt-5.3-codex", description: "stable GPT codex model" },
|
|
@@ -3,8 +3,8 @@ import os from "node:os";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
|
|
6
|
-
export const SUPPORTED_LOCAL_AI_CLIENTS = ["
|
|
7
|
-
export const DEFAULT_LOCAL_AI_CLIENT = "
|
|
6
|
+
export const SUPPORTED_LOCAL_AI_CLIENTS = ["gpt", "claude", "gemini", "sample"];
|
|
7
|
+
export const DEFAULT_LOCAL_AI_CLIENT = "gpt";
|
|
8
8
|
|
|
9
9
|
const SUPPORTED_PERMISSION_MODES = ["read_only", "workspace_write", "danger_full_access"];
|
|
10
10
|
const SUPPORTED_REASONING_EFFORTS = ["low", "medium", "high"];
|
|
@@ -18,7 +18,7 @@ const GEMINI_HOME_SYNC_FILES = [
|
|
|
18
18
|
"settings.json",
|
|
19
19
|
];
|
|
20
20
|
const LOCAL_AI_MODEL_MAPPINGS = {
|
|
21
|
-
|
|
21
|
+
gpt: [
|
|
22
22
|
{
|
|
23
23
|
display: "gpt-5.4",
|
|
24
24
|
execution: "gpt-5.4",
|
|
@@ -589,8 +589,8 @@ function runSampleAdapter(payload) {
|
|
|
589
589
|
|
|
590
590
|
export function normalizeLocalAIClientName(rawValue, fallback = DEFAULT_LOCAL_AI_CLIENT) {
|
|
591
591
|
const value = String(rawValue || "").trim().toLowerCase();
|
|
592
|
-
if (["gpt", "openai-gpt", "openai"].includes(value)) {
|
|
593
|
-
return "
|
|
592
|
+
if (["gpt", "openai-gpt", "openai", "codex"].includes(value)) {
|
|
593
|
+
return "gpt";
|
|
594
594
|
}
|
|
595
595
|
if (SUPPORTED_LOCAL_AI_CLIENTS.includes(value)) {
|
|
596
596
|
return value;
|
|
@@ -734,7 +734,7 @@ export function runLocalAIClient({
|
|
|
734
734
|
METHEUS_AI_RUNNER_REASONING_EFFORT: normalizedReasoningEffort,
|
|
735
735
|
METHEUS_RUNNER_WORKSPACE_DIR: resolvedWorkspaceDir,
|
|
736
736
|
};
|
|
737
|
-
if (normalizedClient === "
|
|
737
|
+
if (normalizedClient === "gpt") {
|
|
738
738
|
return runCodexAdapter({
|
|
739
739
|
promptText,
|
|
740
740
|
workspaceDir: resolvedWorkspaceDir,
|
|
@@ -236,20 +236,20 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
236
236
|
try {
|
|
237
237
|
push(
|
|
238
238
|
"display_model_labels_map_to_tested_execution_ids",
|
|
239
|
-
resolveLocalAIExecutionModel("
|
|
240
|
-
&& resolveLocalAIExecutionModel("
|
|
241
|
-
&& resolveLocalAIExecutionModel("
|
|
242
|
-
&& resolveLocalAIExecutionModel("
|
|
243
|
-
&& resolveLocalAIExecutionModel("
|
|
244
|
-
&& resolveLocalAIExecutionModel("
|
|
239
|
+
resolveLocalAIExecutionModel("gpt", "gpt-5.4") === "gpt-5.4"
|
|
240
|
+
&& resolveLocalAIExecutionModel("gpt", "gpt-5.3-codex") === "gpt-5.3-codex"
|
|
241
|
+
&& resolveLocalAIExecutionModel("gpt", "gpt-5.3-codex-spark") === "gpt-5.3-codex-spark"
|
|
242
|
+
&& resolveLocalAIExecutionModel("gpt", "GPT-5.4") === "gpt-5.4"
|
|
243
|
+
&& resolveLocalAIExecutionModel("gpt", "GPT-5.3-CODEX") === "gpt-5.3-codex"
|
|
244
|
+
&& resolveLocalAIExecutionModel("gpt", "GPT-5.3-CODEX-Spark") === "gpt-5.3-codex-spark"
|
|
245
245
|
&& resolveLocalAIExecutionModel("claude", "Sonnet 4.6r") === "sonnet"
|
|
246
246
|
&& resolveLocalAIExecutionModel("claude", "Haiku 4.5") === "haiku"
|
|
247
247
|
&& resolveLocalAIExecutionModel("claude", "Opus 4.6") === "opus"
|
|
248
248
|
&& resolveLocalAIExecutionModel("gemini", "gemini-3.1-pro") === "auto-gemini-3",
|
|
249
249
|
[
|
|
250
|
-
`gpt54=${resolveLocalAIExecutionModel("
|
|
251
|
-
`gpt53codex=${resolveLocalAIExecutionModel("
|
|
252
|
-
`spark=${resolveLocalAIExecutionModel("
|
|
250
|
+
`gpt54=${resolveLocalAIExecutionModel("gpt", "gpt-5.4")}`,
|
|
251
|
+
`gpt53codex=${resolveLocalAIExecutionModel("gpt", "gpt-5.3-codex")}`,
|
|
252
|
+
`spark=${resolveLocalAIExecutionModel("gpt", "gpt-5.3-codex-spark")}`,
|
|
253
253
|
`claude=${resolveLocalAIExecutionModel("claude", "Sonnet 4.6r")}`,
|
|
254
254
|
`gemini=${resolveLocalAIExecutionModel("gemini", "gemini-3.1-pro")}`,
|
|
255
255
|
].join(" "),
|
|
@@ -257,11 +257,11 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
257
257
|
|
|
258
258
|
push(
|
|
259
259
|
"blank_model_defaults_to_first_display_model_for_each_client",
|
|
260
|
-
suggestLocalAIModelDisplayName("
|
|
260
|
+
suggestLocalAIModelDisplayName("gpt", "") === "gpt-5.4"
|
|
261
261
|
&& suggestLocalAIModelDisplayName("claude", "") === "Sonnet 4.6r"
|
|
262
262
|
&& suggestLocalAIModelDisplayName("gemini", "") === "gemini-3.1-pro",
|
|
263
263
|
[
|
|
264
|
-
`
|
|
264
|
+
`gpt=${suggestLocalAIModelDisplayName("gpt", "")}`,
|
|
265
265
|
`claude=${suggestLocalAIModelDisplayName("claude", "")}`,
|
|
266
266
|
`gemini=${suggestLocalAIModelDisplayName("gemini", "")}`,
|
|
267
267
|
].join(" "),
|
|
@@ -367,7 +367,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
367
367
|
&& String(addState.TELEGRAM_BOT_SERVER_ROLES || "") === "monitor"
|
|
368
368
|
&& String(addState.TELEGRAM_BOT_TOKEN || "") === "selftest-main-token"
|
|
369
369
|
&& String(addState.TELEGRAM_BOT_ROLE_PROFILE || "") === "monitor"
|
|
370
|
-
&& String(addState.TELEGRAM_BOT_AI_CLIENT || "") === "
|
|
370
|
+
&& String(addState.TELEGRAM_BOT_AI_CLIENT || "") === "gpt"
|
|
371
371
|
&& String(addState.TELEGRAM_BOT_AI_PERMISSION_MODE || "") === "read_only"
|
|
372
372
|
&& String(addState.TELEGRAM_BOT_AI_REASONING_EFFORT || "") === "low"
|
|
373
373
|
&& String(addGlobals.TELEGRAM_DEFAULT_BOT_KEY || "") === "monitorselftestbot",
|
|
@@ -553,7 +553,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
553
553
|
push(
|
|
554
554
|
"bot_show_returns_selected_telegram_entry",
|
|
555
555
|
safeObject(showPayload.entry).key === "monitorselftestbot"
|
|
556
|
-
&& safeObject(showPayload.entry).client === "
|
|
556
|
+
&& safeObject(showPayload.entry).client === "gpt"
|
|
557
557
|
&& safeObject(showPayload.serverBinding).mode === "single",
|
|
558
558
|
`key=${String(safeObject(showPayload.entry).key || "")} client=${String(safeObject(showPayload.entry).client || "")} mode=${String(safeObject(showPayload.serverBinding).mode || "")}`,
|
|
559
559
|
);
|
|
@@ -773,7 +773,7 @@ export async function runSelftestBotCommands(push, deps) {
|
|
|
773
773
|
String(aliasAddState.TELEGRAM_BOT_SERVER_BOT_ID || "") === mock.bots[0].id
|
|
774
774
|
&& String(aliasAddState.TELEGRAM_BOT_SERVER_NAME || "") === "MonitorSelftestBot"
|
|
775
775
|
&& String(aliasAddState.TELEGRAM_BOT_SERVER_ROLES || "") === "monitor"
|
|
776
|
-
&& String(aliasAddState.TELEGRAM_BOT_AI_CLIENT || "") === "
|
|
776
|
+
&& String(aliasAddState.TELEGRAM_BOT_AI_CLIENT || "") === "gpt"
|
|
777
777
|
&& String(aliasAddState.TELEGRAM_BOT_AI_MODEL || "") === "gpt-5.4"
|
|
778
778
|
&& String(aliasAddState.TELEGRAM_BOT_AI_PERMISSION_MODE || "") === "read_only"
|
|
779
779
|
&& String(aliasAddState.TELEGRAM_BOT_AI_REASONING_EFFORT || "") === "low",
|
package/package.json
CHANGED
package/postinstall.mjs
CHANGED
|
@@ -75,7 +75,7 @@ function botRunnerTemplate() {
|
|
|
75
75
|
},
|
|
76
76
|
role_profiles: {
|
|
77
77
|
monitor: {
|
|
78
|
-
client: "
|
|
78
|
+
client: "gpt",
|
|
79
79
|
model: "",
|
|
80
80
|
permission_mode: "read_only",
|
|
81
81
|
reasoning_effort: "low",
|
|
@@ -87,7 +87,7 @@ function botRunnerTemplate() {
|
|
|
87
87
|
reasoning_effort: "medium",
|
|
88
88
|
},
|
|
89
89
|
worker: {
|
|
90
|
-
client: "
|
|
90
|
+
client: "gpt",
|
|
91
91
|
model: "",
|
|
92
92
|
permission_mode: "danger_full_access",
|
|
93
93
|
reasoning_effort: "medium",
|
|
@@ -104,7 +104,7 @@ function botRunnerTemplate() {
|
|
|
104
104
|
bot_id: "<server_bot_uuid>",
|
|
105
105
|
bot_name: "<bot_name>",
|
|
106
106
|
role_profile: "monitor",
|
|
107
|
-
client: "
|
|
107
|
+
client: "gpt",
|
|
108
108
|
model: "",
|
|
109
109
|
permission_mode: "read_only",
|
|
110
110
|
reasoning_effort: "low",
|