metheus-governance-mcp-cli 0.2.53 → 0.2.54
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 +85 -0
- package/cli.mjs +1375 -70
- package/package.json +3 -2
- package/postinstall.mjs +50 -0
- package/scripts/local-bot-ai-bridge.mjs +244 -0
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ Install creates local provider settings templates here:
|
|
|
25
25
|
- `~/.metheus/telegram.env`
|
|
26
26
|
- `~/.metheus/slack.env`
|
|
27
27
|
- `~/.metheus/kakaotalk.env`
|
|
28
|
+
- `~/.metheus/bot-runner.json`
|
|
28
29
|
|
|
29
30
|
These files are for local provider bot secrets only.
|
|
30
31
|
|
|
@@ -51,6 +52,24 @@ SLACK_BOT_TOKEN=
|
|
|
51
52
|
KAKAOTALK_BOT_TOKEN=
|
|
52
53
|
```
|
|
53
54
|
|
|
55
|
+
Runner template:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"version": 1,
|
|
60
|
+
"routes": [
|
|
61
|
+
{
|
|
62
|
+
"name": "telegram-monitor",
|
|
63
|
+
"enabled": false,
|
|
64
|
+
"project_id": "<project_uuid>",
|
|
65
|
+
"provider": "telegram",
|
|
66
|
+
"role": "monitor",
|
|
67
|
+
"command": "metheus-governance-mcp-cli local-bot-bridge --client codex --no-update"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
54
73
|
## One command bootstrap (recommended)
|
|
55
74
|
|
|
56
75
|
Run in your project folder:
|
|
@@ -86,9 +105,29 @@ metheus-governance-mcp-cli setup --project-id <project_uuid> --ctxpack-key "<ctx
|
|
|
86
105
|
- `~/.metheus/telegram.env`
|
|
87
106
|
- `~/.metheus/slack.env`
|
|
88
107
|
- `~/.metheus/kakaotalk.env`
|
|
108
|
+
- `~/.metheus/bot-runner.json`
|
|
89
109
|
|
|
90
110
|
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.
|
|
91
111
|
|
|
112
|
+
`~/.metheus/bot-runner.json` is the local automation profile for:
|
|
113
|
+
- which project to watch
|
|
114
|
+
- which provider/role bot profile to use
|
|
115
|
+
- which local AI command to run on new archived chat messages
|
|
116
|
+
|
|
117
|
+
Built-in helper command:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
metheus-governance-mcp-cli local-bot-bridge --client codex --no-update
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Supported `--client` values:
|
|
124
|
+
- `codex`
|
|
125
|
+
- `claude`
|
|
126
|
+
- `gemini`
|
|
127
|
+
- `sample`
|
|
128
|
+
|
|
129
|
+
Use `sample` first for smoke tests before switching to a real AI client.
|
|
130
|
+
|
|
92
131
|
Gemini CLI note:
|
|
93
132
|
- `gemini mcp` commands require Gemini auth to be configured first (`GEMINI_API_KEY` or `~/.gemini/settings.json` auth).
|
|
94
133
|
- `setup` registers Gemini in both `user` and `project` scopes to improve auto-discovery across folders.
|
|
@@ -137,6 +176,52 @@ Direct bot posting:
|
|
|
137
176
|
- Slack
|
|
138
177
|
- KakaoTalk profiles and destinations can be stored now, but direct local delivery is not implemented yet
|
|
139
178
|
|
|
179
|
+
## Local bot runner
|
|
180
|
+
|
|
181
|
+
The local runner closes the loop:
|
|
182
|
+
|
|
183
|
+
1. provider bot receives a room message
|
|
184
|
+
2. Metheus archives the message into Governance discussion comments
|
|
185
|
+
3. local runner reads new archived comments
|
|
186
|
+
4. local AI command generates a reply
|
|
187
|
+
5. CLI sends the reply back through `me.send-bot-message`
|
|
188
|
+
6. the sent reply is mirrored back into the archive
|
|
189
|
+
|
|
190
|
+
Commands:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
metheus-governance-mcp-cli runner once
|
|
194
|
+
metheus-governance-mcp-cli runner start
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Common flags:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
metheus-governance-mcp-cli runner once --project-id <project_uuid> --provider telegram --role monitor --command "node C:\\path\\to\\my-runner.js"
|
|
201
|
+
metheus-governance-mcp-cli runner start --project-id <project_uuid> --provider telegram --role monitor --command "python C:\\path\\to\\reply.py" --poll-interval-ms 5000
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Recommended production path:
|
|
205
|
+
- keep provider bot token in `~/.metheus/<provider>.env`
|
|
206
|
+
- keep project room identifier in server-side Chat Destinations
|
|
207
|
+
- keep automation route config in `~/.metheus/bot-runner.json`
|
|
208
|
+
|
|
209
|
+
Runner command contract:
|
|
210
|
+
- stdin: JSON payload containing project, destination, trigger message, and recent context comments
|
|
211
|
+
- stdout:
|
|
212
|
+
- plain text reply, or
|
|
213
|
+
- JSON object like `{"reply":"...","reply_to_message_id":123}`, or
|
|
214
|
+
- JSON skip result like `{"skip":true,"reason":"not actionable"}`
|
|
215
|
+
|
|
216
|
+
Notes:
|
|
217
|
+
- `runner once` processes the most recent pending archived inbound message
|
|
218
|
+
- `runner start` keeps polling and stores per-route cursor state in `~/.metheus/bot-runner-state.json`
|
|
219
|
+
- first start primes the cursor to the latest inbound message and does not reply to old backlog
|
|
220
|
+
- `local-bot-bridge` reads stdin JSON from the runner and can call Codex/Claude/Gemini for you
|
|
221
|
+
- today this automation path is implemented for Telegram end-to-end
|
|
222
|
+
- Slack can use direct local send, but automatic inbound runner flow is not completed yet
|
|
223
|
+
- KakaoTalk config can be stored now, but direct send/runner flow is not implemented yet
|
|
224
|
+
|
|
140
225
|
## Use in MCP
|
|
141
226
|
|
|
142
227
|
`setup` auto-registers this server for `codex`, `claude`, `gemini`, `antigravity`, and `cursor` when those CLIs are available.
|