metheus-governance-mcp-cli 0.2.62 → 0.2.64

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
@@ -10,6 +10,7 @@ Compatibility note: legacy command alias `metheus-governance-mcp` is still suppo
10
10
  - checks Codex/Claude/Gemini/Antigravity/Cursor MCP registration
11
11
  - registers only missing clients
12
12
  - `setup`: register `metheus-governance-mcp` into Codex/Claude/Gemini/Antigravity/Cursor (if installed)
13
+ - `bot`: local chat bot env setup/list/show/add/edit/remove/global/verify
13
14
  - `doctor`: run end-to-end health checks (auth/registration/gateway/project/ctxpack/tools)
14
15
  - `proxy`: stdio MCP bridge to Metheus HTTPS gateway
15
16
  - `auth`: save/check/clear local Metheus token used by proxy
@@ -27,10 +28,10 @@ Install creates local provider settings templates here:
27
28
  - `~/.metheus/kakaotalk.env`
28
29
  - `~/.metheus/bot-runner.json`
29
30
 
30
- These files are for local provider bot secrets only.
31
+ These files are for local provider bot secrets, local transport options, and optional per-bot local AI binding.
31
32
 
32
33
  - Store locally:
33
- - `TELEGRAM_BOT_TOKEN`
34
+ - `TELEGRAM_BOT_TOKEN` or named Telegram bot mappings such as `TELEGRAM_BOT_MAIN_TOKEN`
34
35
  - `SLACK_BOT_TOKEN`
35
36
  - `KAKAOTALK_BOT_TOKEN`
36
37
  - Server-side Metheus stores project chat destination metadata separately:
@@ -38,13 +39,30 @@ These files are for local provider bot secrets only.
38
39
  - `chat_id` / channel / room identifier
39
40
  - label / active state
40
41
  - Do not put project chat destination identifiers in local env files.
42
+ - Telegram env can also carry per-bot local AI binding fields.
41
43
 
42
44
  Example templates:
43
45
 
44
46
  ```env
45
47
  # ~/.metheus/telegram.env
48
+ TELEGRAM_API_BASE_URL=
49
+ TELEGRAM_AUTO_CLEAR_WEBHOOK=true
50
+ TELEGRAM_ALLOWED_UPDATES=message,edited_message
51
+ TELEGRAM_DEFAULT_BOT_KEY=main
52
+
53
+ # Legacy fallback
46
54
  TELEGRAM_BOT_TOKEN=
47
55
 
56
+ # Preferred named bot mapping
57
+ TELEGRAM_BOT_MAIN_SERVER_BOT_ID=
58
+ TELEGRAM_BOT_MAIN_USERNAME=<bot_username>
59
+ TELEGRAM_BOT_MAIN_TOKEN=
60
+ TELEGRAM_BOT_MAIN_ROLE_PROFILE=monitor
61
+ TELEGRAM_BOT_MAIN_AI_CLIENT=codex
62
+ TELEGRAM_BOT_MAIN_AI_MODEL=
63
+ TELEGRAM_BOT_MAIN_AI_PERMISSION_MODE=read_only
64
+ TELEGRAM_BOT_MAIN_AI_REASONING_EFFORT=low
65
+
48
66
  # ~/.metheus/slack.env
49
67
  SLACK_BOT_TOKEN=
50
68
 
@@ -72,6 +90,17 @@ Runner template:
72
90
  "reasoning_effort": "low"
73
91
  }
74
92
  },
93
+ "bot_bindings": {
94
+ "primary_monitor_bot": {
95
+ "bot_id": "<server_bot_uuid>",
96
+ "bot_name": "<bot_name>",
97
+ "role_profile": "monitor",
98
+ "client": "codex",
99
+ "model": "",
100
+ "permission_mode": "read_only",
101
+ "reasoning_effort": "low"
102
+ }
103
+ },
75
104
  "routes": [
76
105
  {
77
106
  "name": "telegram-monitor",
@@ -79,7 +108,7 @@ Runner template:
79
108
  "project_id": "<project_uuid>",
80
109
  "provider": "telegram",
81
110
  "role": "monitor",
82
- "role_profile": "monitor",
111
+ "bot_id": "<server_bot_uuid>",
83
112
  "trigger_policy": {
84
113
  "mentions_only": true,
85
114
  "direct_messages": true,
@@ -134,13 +163,14 @@ metheus-governance-mcp-cli setup --project-id <project_uuid> --ctxpack-key "<ctx
134
163
  - `~/.metheus/kakaotalk.env`
135
164
  - `~/.metheus/bot-runner.json`
136
165
 
137
- Fill only provider bot tokens 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.
166
+ 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.
138
167
 
139
168
  `~/.metheus/bot-runner.json` is the local automation profile for:
140
169
  - which project to watch
141
170
  - which provider/role bot profile to use
142
171
  - which `project_id -> workspace_dir` mapping to apply locally
143
172
  - which role profile maps to which local CLI/model/permission/reasoning policy
173
+ - which server bot maps to which local LLM execution profile via `telegram.env` or fallback `bot_bindings`
144
174
 
145
175
  Built-in helper command for legacy fallback/testing:
146
176
 
@@ -169,6 +199,65 @@ Guardrail note:
169
199
  - By default, CLI blocks reading/writing ctxpack sync metadata when workspace root resolves to the home directory.
170
200
  - Override only when intentional: `METHEUS_ALLOW_HOME_WORKSPACE=1`.
171
201
 
202
+ ## Bot
203
+
204
+ Interactive entry:
205
+
206
+ ```bash
207
+ metheus-governance-mcp-cli bot setup
208
+ ```
209
+
210
+ Direct commands:
211
+
212
+ ```bash
213
+ metheus-governance-mcp-cli bot list
214
+ metheus-governance-mcp-cli bot show --provider telegram --bot-key main
215
+ metheus-governance-mcp-cli bot add --provider telegram
216
+ metheus-governance-mcp-cli bot edit --provider telegram
217
+ metheus-governance-mcp-cli bot remove --provider telegram
218
+ metheus-governance-mcp-cli bot set-default --provider telegram --bot-key main
219
+ metheus-governance-mcp-cli bot migrate --provider telegram --bot-key main
220
+ metheus-governance-mcp-cli bot global --provider telegram
221
+ metheus-governance-mcp-cli bot verify --provider telegram --bot-key main
222
+ ```
223
+
224
+ Behavior:
225
+
226
+ - `bot setup` asks for `Telegram / Slack / KakaoTalk` first, then prompts with numbered actions.
227
+ - Telegram supports named local bot entries with:
228
+ - `SERVER_BOT_ID`
229
+ - `USERNAME`
230
+ - `TOKEN`
231
+ - `ROLE_PROFILE`
232
+ - `AI_CLIENT`
233
+ - `AI_MODEL`
234
+ - `AI_PERMISSION_MODE`
235
+ - `AI_REASONING_EFFORT`
236
+ - Slack and KakaoTalk currently use a single local token entry per provider in this command flow.
237
+ - `bot verify` checks the configured local token and prints the current AI binding summary.
238
+ - `bot show` prints one local bot entry in detail.
239
+ - `bot global` edits Telegram-wide local settings such as API base URL, allowed updates, and default bot key.
240
+ - `bot set-default` updates `TELEGRAM_DEFAULT_BOT_KEY`.
241
+ - `bot migrate` moves legacy `TELEGRAM_BOT_TOKEN` into a named Telegram bot entry.
242
+
243
+ Non-interactive examples:
244
+
245
+ ```bash
246
+ 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
247
+ metheus-governance-mcp-cli bot add --provider telegram --non-interactive true --bot-key main --bot-id <server_bot_uuid> --token <telegram_bot_token> --role-profile monitor --client codex --permission-mode read_only --reasoning-effort low --default true
248
+ metheus-governance-mcp-cli bot edit --provider telegram --bot-key main --non-interactive true --client claude --model claude-3.7-sonnet --permission-mode workspace_write --reasoning-effort medium
249
+ metheus-governance-mcp-cli bot set-default --provider telegram --bot-key main --non-interactive true
250
+ metheus-governance-mcp-cli bot migrate --provider telegram --bot-key main --bot-id <server_bot_uuid> --bot-name <telegram_username> --role-profile monitor --client codex --permission-mode read_only --reasoning-effort low --non-interactive true
251
+ metheus-governance-mcp-cli bot remove --provider telegram --bot-key main --non-interactive true
252
+ metheus-governance-mcp-cli bot verify --provider telegram --bot-key main --json true
253
+ ```
254
+
255
+ Current support status:
256
+
257
+ - Telegram: full local bot entry management, token verification, bot-to-AI binding, inbound runner support
258
+ - Slack: single local token entry, verification supported, inbound runner not supported
259
+ - KakaoTalk: single local token entry, local config only, remote verification not implemented
260
+
172
261
  ## Project ID behavior (verified)
173
262
 
174
263
  - `setup --project-id <A>` sets default proxy scope to project `A`.
@@ -193,6 +282,9 @@ Checks:
193
282
  - role profile -> local CLI availability
194
283
  - route dry-run / trigger-policy safety warnings
195
284
  - local provider token presence for active project destinations
285
+ - enabled runner route -> local bot env binding resolution
286
+ - enabled runner route -> server bot UUID cross-check
287
+ - legacy `TELEGRAM_BOT_TOKEN` fallback still in use
196
288
  - codex/claude/gemini/antigravity/cursor registration state
197
289
  - gateway `tools/list` reachability
198
290
  - `project.summary` access
@@ -266,6 +358,9 @@ Recommended production path:
266
358
  - keep `project_mappings.<project_id>.workspace_dir` aligned to that teammate's actual local project folder
267
359
  - let `ctxpack pull` or project connection refresh the mapping automatically
268
360
  - keep per-role execution policy under `role_profiles`
361
+ - keep per-bot LLM binding primarily in `~/.metheus/telegram.env`
362
+ - use `bot_bindings` in `bot-runner.json` only as local fallback/override
363
+ - runner resolution order is: explicit `route.role_profile` -> provider env bot binding -> `bot_bindings` -> server bot role -> `route.role`
269
364
 
270
365
  Why `workspace_dir` matters:
271
366
  - the server cannot know each project member's local folder path
@@ -329,7 +424,7 @@ Notes:
329
424
  - `local-bot-bridge` reads stdin JSON from the runner and can call Codex/Claude/Gemini for you
330
425
  - `route.command` fallback is disabled by default; enable it only temporarily with `METHEUS_ALLOW_LEGACY_RUNNER_COMMAND=1`
331
426
  - today this automation path is implemented for Telegram end-to-end
332
- - set `METHEUS_TELEGRAM_API_BASE_URL=http://127.0.0.1:<port>` only for local mock or regression testing; normal usage should keep the default Telegram API base
427
+ - prefer `TELEGRAM_API_BASE_URL=` inside `~/.metheus/telegram.env` for per-bot local Telegram API overrides; `METHEUS_TELEGRAM_API_BASE_URL` remains a process-level fallback mainly for mock/regression testing
333
428
  - Slack can use direct local send, but automatic inbound runner flow is not completed yet
334
429
  - KakaoTalk config can be stored now, but direct send/runner flow is not implemented yet
335
430
  - `doctor` now reports provider support for both enabled runner routes and active project chat destinations