@mrrlin-dev/mcp 0.2.5 → 0.3.0

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.
@@ -105,31 +105,51 @@ short, ask **once**, and **skip any question the hint + log already answered**:
105
105
  If the user gives short or partial answers, accept them and move on. Never block
106
106
  the report on a perfect answer.
107
107
 
108
- ### 4. Package the report (in ENGLISH)
108
+ ### 4. Package the report (in ENGLISH) — every string passes through `mrrlin-mcp redact`
109
109
 
110
110
  Translate the user's answers to English. Build a plain-text report. Keep the whole
111
111
  thing under **4096 characters** (Telegram's per-message limit) — trim the log
112
112
  excerpt first if needed, keeping the error lines over the context lines.
113
113
 
114
+ **Hard rule:** every free-form string going into the report — the user's hint,
115
+ their answers, the log excerpt — passes through the shipped scrubber first.
116
+ There is no "but the log is already redacted by the logger" exception: the hint
117
+ and the user's answers come from outside the logger, so they MUST be scrubbed
118
+ here. Run each through:
119
+
120
+ ```bash
121
+ HINT_REDACTED=$(printf %s "$USER_HINT_RAW" | mrrlin-mcp redact)
122
+ EXCERPT_REDACTED=$(mrrlin-mcp redact < /tmp/excerpt-raw.txt)
123
+ # (repeat for each user answer)
124
+ ```
125
+
126
+ `mrrlin-mcp redact` reads stdin and writes the redacted bytes to stdout
127
+ (empty input → empty output, exit 0). It uses the same regex set as the
128
+ bridge logger (Bearer/JWT/GitHub-PAT/long-hex/long-base64). It is best-effort,
129
+ not a guarantee — but it is the floor below which raw text is never allowed.
130
+
131
+ Use the redacted versions to fill the template:
132
+
114
133
  ```
115
134
  🛠️ Mrrlin issue report
116
135
  When (UTC): <iso timestamp of the report>
117
136
  Mrrlin MCP: v<version if known> | OS: <platform> | Node: <version>
118
137
 
119
- ▶ User hint (verbatim):
120
- <the text the operator passed with /report-issue, untranslated; "(none)" if absent>
138
+ ▶ User hint (verbatim, post-redaction):
139
+ <HINT_REDACTED; "(none)" if absent>
121
140
 
122
141
  ▶ What the user was doing:
123
- <their answer, in English>
142
+ <their answer, in English, post-redaction>
124
143
 
125
144
  ▶ Expected result:
126
- <their answer, or "(obvious from context: ...)", or "(not provided)">
145
+ <their answer, post-redaction; or "(obvious from context: ...)"; or "(not provided)">
127
146
 
128
147
  ▶ Actual result / symptom:
129
- <their answer, in English>
148
+ <their answer, in English, post-redaction>
130
149
 
131
- ▶ Errors from bridge log (<filename>, matched by: <hint substring | sessionId | tail-fallback>):
132
- <the extracted error lines, verbatim already redacted>
150
+ ▶ Errors from bridge log (<filename>, search strategy: <hint-driven | tail-fallback>):
151
+ matched on: "<the exact line that triggered the cluster, truncated to 80 chars; or '(no hint provided)' for tail-fallback>"
152
+ <EXCERPT_REDACTED — first the error lines, then the surrounding context>
133
153
 
134
154
  ▶ Context:
135
155
  session=<sessionId> spanIds=<...> window=<first ts>..<last ts>
@@ -180,10 +200,10 @@ why). Don't dump the raw report or the token back at them — just confirm.
180
200
 
181
201
  ## Rules
182
202
 
183
- - The operator's hint drives log search. Tail-only mode is the **fallback**, not the default.
184
- - Always include the verbatim hint in the report (under "User hint"), so the channel reader can see what was originally pasted before any translation.
203
+ - **Every string going into the Telegram body comes out of `mrrlin-mcp redact`** — the user's hint, every translated user answer, the log excerpt. If your pipeline has a path that builds the body from raw text, you are doing it wrong. The bridge logger already redacts what it writes; the hint and the user's answers do NOT come from the logger and must be scrubbed here.
204
+ - The operator's hint drives log search. Tail-fallback is the explicit fallback when no hint is provided.
205
+ - `matched on:` must contain the literal line that triggered the cluster (truncated to 80 chars), so the channel reader can verify the match instead of trusting an LLM assertion.
185
206
  - Ask the user in their language; write the report in English. Skip any question the hint + log already answered.
186
207
  - Hide the mechanics: never surface the token, the log path, or the curl command to the user.
187
- - Forward log lines as-is — they're already secret-redacted. Do not paste anything that looks like a live token even if you see one.
188
208
  - One report = one `sendMessage` POST. Keep it under 4096 chars; use `sendDocument` only for the optional full log.
189
- - If anything is missing (no log match, vague answers), still send the best report you can rather than giving up — and say in the report which signal you actually matched on.
209
+ - If anything is missing (no log match, vague answers), still send the best report you can rather than giving up — and say in the report which search strategy you used and what `matched on:` you found.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.2.5",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"
@@ -20,12 +20,12 @@
20
20
  "@types/ws": "^8.18.1",
21
21
  "esbuild": "^0.24.0",
22
22
  "tsx": "^4.22.3",
23
- "@mrrlin/client": "0.0.0",
24
23
  "@mrrlin/director-e2e": "0.0.0",
24
+ "@mrrlin/client": "0.0.0",
25
+ "@mrrlin/wiki": "0.0.0",
25
26
  "@mrrlin/codex-client": "0.0.0",
26
27
  "@mrrlin/schemas": "0.0.0",
27
- "@mrrlin/tsconfig": "0.0.0",
28
- "@mrrlin/wiki": "0.0.0"
28
+ "@mrrlin/tsconfig": "0.0.0"
29
29
  },
30
30
  "dependencies": {
31
31
  "@iarna/toml": "^2.2.5",