metheus-governance-mcp-cli 0.2.287 → 0.2.289

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
@@ -379,7 +379,7 @@ Behavior:
379
379
  - `bot room-audit` now suggests executable runner routes for the managed server+local intersection. Room visibility is still reported, but a bot no longer has to appear in the admin list before route automation can prepare it.
380
380
  - `bot room-audit` defaults to `monitor` only unless you pass `--role` or `--roles`.
381
381
  - `bot room-audit --apply true` writes missing suggested routes into `~/.metheus/bot-runner.json` and disables overlapping enabled routes in the same project/provider/destination/bot scope that are outside the selected role set.
382
- - `runner project up` is the route preparation path for Telegram project operations: it runs the same room audit, applies the selected role routes, and starts polling only when you explicitly pass `--start true` or `--start-detached true`.
382
+ - `runner project up` is the one-command direct CLI path for Telegram project operations: it runs the same room audit, applies the selected role routes, and starts detached polling by default unless you explicitly pass `--start false`.
383
383
  - `runner project up` can be narrowed with `--bot-name`, `--bot-id`, `--role`, or `--roles <csv>` when you do not want every suggested role route for that room.
384
384
  - `bot remove` without flags starts a guided numbered flow: provider -> bot entry -> confirm removal.
385
385
  - Telegram stores one bot file per entry under `~/.metheus/telegram-bots/<ServerBotName>.env` with generic fields:
@@ -421,6 +421,7 @@ metheus-governance-mcp-cli bot remove --provider telegram --bot-name <server_bot
421
421
  metheus-governance-mcp-cli bot verify --provider telegram --bot-name <server_bot_name> --json true
422
422
  metheus-governance-mcp-cli bot room-audit --provider telegram --project-id <project_uuid> --destination-label <room_label> --json true
423
423
  metheus-governance-mcp-cli bot room-audit --provider telegram --project-id <project_uuid> --destination-label <room_label> --apply true --json true
424
+ metheus-governance-mcp-cli runner project up --project-id <project_uuid> --provider telegram --destination-label <room_label>
424
425
  metheus-governance-mcp-cli runner project up --project-id <project_uuid> --provider telegram --destination-label <room_label> --start false
425
426
  metheus-governance-mcp-cli runner start-detached --project-id <project_uuid> --provider telegram --destination-label <room_label>
426
427
  metheus-governance-mcp-cli runner project up --project-id <project_uuid> --provider telegram --destination-label <room_label> --bot-name <server_bot_name> --roles monitor,review --start false
@@ -555,7 +556,7 @@ metheus-governance-mcp-cli runner start --route-name telegram-monitor --concurre
555
556
  Route management:
556
557
  - `runner route add` creates one executable route by selecting the project, provider, role, server bot, and project chat destination in order.
557
558
  - `runner route add` now auto-uses the suggested route name, `5000` ms poll interval, and `enabled=true` unless you pass explicit flags or edit the route later.
558
- - `runner project up` is the shortest practical route bootstrap path for Telegram: it audits one project destination, writes any missing suggested routes, and prepares that destination for later launch. It starts polling only when you explicitly pass `--start true` or `--start-detached true`.
559
+ - `runner project up` is the shortest practical route bootstrap path for Telegram: it audits one project destination, writes any missing suggested routes, and starts detached polling by default unless you explicitly pass `--start false`.
559
560
  - if room visibility probe fails but one or more enabled routes already exist for that project destination, `runner project up` now treats the probe failure as a warning and can still start those existing routes.
560
561
  - `runner project up --dry-run-delivery true` lets the started runner validate route execution without sending a real provider message.
561
562
  - In public Telegram bot conversations, the stored route role is treated as a hint only. Live room context, the current human request, and recent bot replies take priority over the stored route role hint when the local AI client decides how to answer.
@@ -568,6 +569,7 @@ Route management:
568
569
  Recommended operational path:
569
570
 
570
571
  ```bash
572
+ metheus-governance-mcp-cli runner project up --project-id <project_uuid> --provider telegram --destination-label <room_label>
571
573
  metheus-governance-mcp-cli runner project up --project-id <project_uuid> --provider telegram --destination-label <room_label> --start false
572
574
  metheus-governance-mcp-cli runner start-detached --project-id <project_uuid> --provider telegram --destination-label <room_label>
573
575
  metheus-governance-mcp-cli runner project up --project-id <project_uuid> --provider telegram --destination-label <room_label> --bot-name <server_bot_name> --roles monitor,review --start false
package/cli.mjs CHANGED
@@ -12292,12 +12292,21 @@ function resolveRunnerProjectUpExecutionPolicy(flags = {}) {
12292
12292
  const applyRequested = Object.prototype.hasOwnProperty.call(flags, "apply")
12293
12293
  ? boolFromRaw(flags.apply, true)
12294
12294
  : true;
12295
- const startDetachedRequested = Object.prototype.hasOwnProperty.call(flags, "start-detached")
12296
- ? boolFromRaw(flags["start-detached"], true)
12297
- : boolFromRaw(flags.detached, false);
12298
- const startRequested = Object.prototype.hasOwnProperty.call(flags, "start")
12295
+ const explicitStartDetachedRequested = Object.prototype.hasOwnProperty.call(flags, "start-detached")
12296
+ || Object.prototype.hasOwnProperty.call(flags, "start_detached");
12297
+ const explicitDetachedAliasRequested = Object.prototype.hasOwnProperty.call(flags, "detached");
12298
+ const explicitStartRequested = Object.prototype.hasOwnProperty.call(flags, "start");
12299
+ const startRequested = explicitStartRequested
12299
12300
  ? boolFromRaw(flags.start, true)
12300
12301
  : false;
12302
+ const startDetachedRaw = Object.prototype.hasOwnProperty.call(flags, "start-detached")
12303
+ ? flags["start-detached"]
12304
+ : flags.start_detached;
12305
+ const startDetachedRequested = explicitStartDetachedRequested
12306
+ ? boolFromRaw(startDetachedRaw, true)
12307
+ : (explicitDetachedAliasRequested
12308
+ ? boolFromRaw(flags.detached, false)
12309
+ : !explicitStartRequested);
12301
12310
  const shouldStartRunner = startRequested || startDetachedRequested;
12302
12311
  return {
12303
12312
  applyRequested,
@@ -12345,7 +12354,7 @@ async function buildRunnerProjectUpResult(flags = {}) {
12345
12354
  const ui = createPrompter();
12346
12355
  try {
12347
12356
  if (shouldRenderPromptChrome(flags)) {
12348
- ui.setFlow("RUNNER PROJECT UP", "Audit one project destination, create missing runner routes, and optionally start polling when explicitly requested");
12357
+ ui.setFlow("RUNNER PROJECT UP", "Audit one project destination, create missing runner routes, and start detached polling by default unless --start false is passed");
12349
12358
  }
12350
12359
  const provider = String(flags.provider || "").trim()
12351
12360
  ? normalizeBotProvider(flags.provider)
@@ -16965,7 +16974,7 @@ function buildLocalToolSpecs() {
16965
16974
  {
16966
16975
  name: "runner.project_up",
16967
16976
  description:
16968
- "Audit one project destination, create missing runner routes, and optionally start polling only when explicitly requested. Use this before runner.start_detached when the route is not ready yet.",
16977
+ "Audit one project destination, create missing runner routes, and let front-end/TUI flows bootstrap detached polling in one step. Pass start=false and start_detached=false for prepare-only mode, or use runner.start_detached directly when routes are already ready.",
16969
16978
  inputSchema: buildRunnerProjectUpInputSchema(),
16970
16979
  },
16971
16980
  {
@@ -19325,7 +19334,21 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
19325
19334
  try {
19326
19335
  const projectUpPolicy = resolveRunnerProjectUpExecutionPolicy({});
19327
19336
  push(
19328
- "runner_project_up_default_policy_is_prepare_only",
19337
+ "runner_project_up_default_policy_prefers_detached_start",
19338
+ projectUpPolicy.applyRequested === true
19339
+ && projectUpPolicy.startRequested === false
19340
+ && projectUpPolicy.startDetachedRequested === true
19341
+ && projectUpPolicy.shouldStartRunner === true,
19342
+ `apply=${projectUpPolicy.applyRequested} start=${projectUpPolicy.startRequested} detached=${projectUpPolicy.startDetachedRequested} shouldStart=${projectUpPolicy.shouldStartRunner}`,
19343
+ );
19344
+ } catch (err) {
19345
+ push("runner_project_up_default_policy_prefers_detached_start", false, String(err?.message || err));
19346
+ }
19347
+
19348
+ try {
19349
+ const projectUpPolicy = resolveRunnerProjectUpExecutionPolicy({ start: false });
19350
+ push(
19351
+ "runner_project_up_explicit_start_false_keeps_prepare_only",
19329
19352
  projectUpPolicy.applyRequested === true
19330
19353
  && projectUpPolicy.startRequested === false
19331
19354
  && projectUpPolicy.startDetachedRequested === false
@@ -19333,7 +19356,7 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
19333
19356
  `apply=${projectUpPolicy.applyRequested} start=${projectUpPolicy.startRequested} detached=${projectUpPolicy.startDetachedRequested} shouldStart=${projectUpPolicy.shouldStartRunner}`,
19334
19357
  );
19335
19358
  } catch (err) {
19336
- push("runner_project_up_default_policy_is_prepare_only", false, String(err?.message || err));
19359
+ push("runner_project_up_explicit_start_false_keeps_prepare_only", false, String(err?.message || err));
19337
19360
  }
19338
19361
 
19339
19362
  try {
@@ -19388,10 +19411,24 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
19388
19411
  push("runner_project_up_probe_failure_blocks_without_existing_route", false, String(err?.message || err));
19389
19412
  }
19390
19413
 
19391
- try {
19392
- const projectUpResponse = await handleLocalProjectToolDispatchImpl(
19393
- {
19394
- requestObj: {
19414
+ try {
19415
+ const projectUpPolicy = resolveRunnerProjectUpExecutionPolicy({ start_detached: true });
19416
+ push(
19417
+ "runner_project_up_tool_flag_accepts_start_detached_snake_case",
19418
+ projectUpPolicy.applyRequested === true
19419
+ && projectUpPolicy.startRequested === false
19420
+ && projectUpPolicy.startDetachedRequested === true
19421
+ && projectUpPolicy.shouldStartRunner === true,
19422
+ `apply=${projectUpPolicy.applyRequested} start=${projectUpPolicy.startRequested} detached=${projectUpPolicy.startDetachedRequested} shouldStart=${projectUpPolicy.shouldStartRunner}`,
19423
+ );
19424
+ } catch (err) {
19425
+ push("runner_project_up_tool_flag_accepts_start_detached_snake_case", false, String(err?.message || err));
19426
+ }
19427
+
19428
+ try {
19429
+ const projectUpResponse = await handleLocalProjectToolDispatchImpl(
19430
+ {
19431
+ requestObj: {
19395
19432
  jsonrpc: "2.0",
19396
19433
  id: 8,
19397
19434
  method: "tools/call",
@@ -19417,36 +19454,56 @@ TELEGRAM_BOT_REVIEW_TOKEN=review-token
19417
19454
  workspaceSignalTrusted: true,
19418
19455
  },
19419
19456
  {
19420
- ...buildLocalProjectDispatchDeps(),
19421
- buildRunnerProjectUpResult: async () => ({
19422
- summaryPayload: {
19457
+ ...buildLocalProjectDispatchDeps(),
19458
+ buildRunnerProjectUpResult: async () => ({
19459
+ summaryPayload: {
19423
19460
  ok: true,
19424
19461
  project_id: selftestProjectID,
19425
19462
  destination_label: "Selftest Room",
19426
- destination_id: "dest-1",
19427
- route_apply_requested: true,
19428
- route_apply_changed: true,
19429
- enabled_routes_for_selection: ["telegram-monitor-selftest"],
19430
- next_steps: [`${CLI_NAME} runner show --route-name telegram-monitor-selftest`],
19431
- },
19432
- matchingRoutes: [{ name: "telegram-monitor-selftest" }],
19433
- applyRequested: true,
19434
- applyResult: { ok: true, changed: true },
19435
- shouldStartRunner: false,
19436
- startDetachedRequested: false,
19437
- startFlags: {},
19438
- }),
19439
- },
19440
- );
19441
- const projectUpStructured = safeObject(safeObject(projectUpResponse).result)?.structuredContent || {};
19442
- push(
19443
- "local_runner_project_up_tool_dispatches",
19444
- projectUpStructured.ok === true
19445
- && ensureArray(projectUpStructured.enabled_routes_for_selection).includes("telegram-monitor-selftest"),
19446
- `routes=${ensureArray(projectUpStructured.enabled_routes_for_selection).join(",")} next=${ensureArray(projectUpStructured.next_steps).join(" | ")}`,
19447
- );
19448
- } catch (err) {
19449
- push("local_runner_project_up_tool_dispatches", false, String(err?.message || err));
19463
+ destination_id: "dest-1",
19464
+ route_apply_requested: true,
19465
+ route_apply_changed: true,
19466
+ enabled_routes_for_selection: ["telegram-monitor-selftest"],
19467
+ next_steps: [`${CLI_NAME} runner show --route-name telegram-monitor-selftest`],
19468
+ start_detached_requested: true,
19469
+ },
19470
+ matchingRoutes: [{ name: "telegram-monitor-selftest" }],
19471
+ applyRequested: true,
19472
+ applyResult: { ok: true, changed: true },
19473
+ shouldStartRunner: true,
19474
+ startDetachedRequested: true,
19475
+ startFlags: {
19476
+ "project-id": selftestProjectID,
19477
+ provider: "telegram",
19478
+ "destination-id": "dest-1",
19479
+ },
19480
+ applyFailureBlocksStart: false,
19481
+ }),
19482
+ startDetachedRunnerWithFlags: async () => ({
19483
+ ok: true,
19484
+ already_running: true,
19485
+ registry_file: "registry.json",
19486
+ launch: {
19487
+ launch_id: "launch-project-up-1",
19488
+ pid: 4242,
19489
+ project_ids: [selftestProjectID],
19490
+ route_names: ["telegram-monitor-selftest"],
19491
+ destination_labels: ["Selftest Room"],
19492
+ },
19493
+ }),
19494
+ },
19495
+ );
19496
+ const projectUpStructured = safeObject(safeObject(projectUpResponse).result)?.structuredContent || {};
19497
+ push(
19498
+ "local_runner_project_up_tool_dispatches",
19499
+ projectUpStructured.ok === true
19500
+ && ensureArray(projectUpStructured.enabled_routes_for_selection).includes("telegram-monitor-selftest")
19501
+ && projectUpStructured.already_running === true
19502
+ && String(safeObject(projectUpStructured.launch).launch_id || "").trim() === "launch-project-up-1",
19503
+ `routes=${ensureArray(projectUpStructured.enabled_routes_for_selection).join(",")} launch=${String(safeObject(projectUpStructured.launch).launch_id || "").trim() || "-"} already_running=${projectUpStructured.already_running ? "true" : "false"}`,
19504
+ );
19505
+ } catch (err) {
19506
+ push("local_runner_project_up_tool_dispatches", false, String(err?.message || err));
19450
19507
  }
19451
19508
 
19452
19509
  try {
@@ -629,13 +629,20 @@ export async function handleLocalProjectToolDispatch(
629
629
  ...toolArgs,
630
630
  ...(Object.prototype.hasOwnProperty.call(toolArgs, "project_id") ? {} : { project_id: resolveProjectID(toolArgs, args, workspaceDir, deps) }),
631
631
  ...(Object.prototype.hasOwnProperty.call(toolArgs, "start") ? {} : { start: false }),
632
- ...(Object.prototype.hasOwnProperty.call(toolArgs, "start_detached") ? {} : { start_detached: false }),
632
+ ...(Object.prototype.hasOwnProperty.call(toolArgs, "start_detached") ? {} : { start_detached: true }),
633
633
  ...(Object.prototype.hasOwnProperty.call(toolArgs, "json") ? {} : { json: true }),
634
634
  };
635
635
  const result = await buildRunnerProjectUpResult(normalizedFlags);
636
+ let launchPayload = null;
637
+ if (result.shouldStartRunner && result.startDetachedRequested && !result.applyFailureBlocksStart) {
638
+ launchPayload = await startDetachedRunnerWithFlags(result.startFlags, "runner.project_up");
639
+ }
636
640
  const payload = {
637
641
  ...safeObject(result.summaryPayload),
638
642
  matching_routes: ensureArray(result.matchingRoutes).map((route) => String(safeObject(route).name || "").trim()).filter(Boolean),
643
+ launch: safeObject(launchPayload?.launch),
644
+ already_running: Boolean(launchPayload?.already_running),
645
+ registry_file: String(launchPayload?.registry_file || safeObject(result.summaryPayload).registry_file || "").trim(),
639
646
  };
640
647
  const text = [
641
648
  `ok: ${payload.ok ? "true" : "false"}`,
@@ -644,6 +651,10 @@ export async function handleLocalProjectToolDispatch(
644
651
  `destination_id: ${String(payload.destination_id || "").trim() || "-"}`,
645
652
  `route_apply_requested: ${payload.route_apply_requested ? "true" : "false"}`,
646
653
  `route_apply_changed: ${payload.route_apply_changed ? "true" : "false"}`,
654
+ `start_detached_requested: ${payload.start_detached_requested ? "true" : "false"}`,
655
+ `already_running: ${payload.already_running ? "true" : "false"}`,
656
+ `launch_id: ${String(safeObject(payload.launch).launch_id || "").trim() || "-"}`,
657
+ `pid: ${String(safeObject(payload.launch).pid || "").trim() || "-"}`,
647
658
  `enabled_routes_for_selection: ${ensureArray(payload.enabled_routes_for_selection).join(", ") || "-"}`,
648
659
  `next_steps: ${ensureArray(payload.next_steps).join(" | ") || "-"}`,
649
660
  ].join("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metheus-governance-mcp-cli",
3
- "version": "0.2.287",
3
+ "version": "0.2.289",
4
4
  "description": "Metheus Governance MCP CLI (setup + stdio proxy)",
5
5
  "type": "module",
6
6
  "files": [