@mrrlin-dev/mcp 0.2.4 → 0.2.5

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/dist/bin.cjs CHANGED
@@ -48750,9 +48750,15 @@ Usage:
48750
48750
  mrrlin-mcp report-issue Print the bundled support-report prompt to
48751
48751
  stdout. Normal users don't need this \u2014 install-codex
48752
48752
  already drops it as a /report-issue slash command.
48753
- Useful for: piping it ad-hoc to a non-Codex client,
48754
- inspecting the shipped contents, or repairing a
48755
- deleted prompt file:
48753
+ Operator usage from inside Codex (paste a hint \u2014
48754
+ pasted error blurb, weird output quote, one-line
48755
+ description, or sessionId):
48756
+ /report-issue Codex hung after sending a turn
48757
+ /report-issue [paste failing stack here]
48758
+ The prompt greps the bridge log for that hint
48759
+ and only asks follow-ups the log doesn't already
48760
+ answer. Useful for: piping ad-hoc, inspecting
48761
+ shipped contents, repairing a deleted file:
48756
48762
  codex "$(mrrlin-mcp report-issue)"
48757
48763
  mrrlin-mcp report-issue > ~/.codex/prompts/report-issue.md
48758
48764
 
@@ -34,16 +34,32 @@ below, so leaking the token costs at most some spam in that chat — rotate via
34
34
 
35
35
  ## What to do
36
36
 
37
- ### 1. Read the Director bridge log
37
+ ### 1. Take the user's hint as the search key
38
38
 
39
- The bridge writes one JSON object per line to a daily file. Find the log dir, in
40
- this order, and use the first that exists:
39
+ When the operator invokes `/report-issue`, they typically include a hint along
40
+ with the command — a pasted error blurb, a quote of weird output, a one-line
41
+ description, or a `sessionId`/`spanId` they copied. **That hint is your primary
42
+ search key.** Do not blindly read the tail of the latest log.
43
+
44
+ Extract candidate signals from the hint:
45
+
46
+ - **Quoted substrings** — verbatim text from the failure (highest priority).
47
+ - **Error words** — "error", "failed", "timeout", "401", "500", "ENOENT", stack-trace fragments.
48
+ - **Identifiers** — `sessionId` (uuid-shaped) or `spanId` if pasted.
49
+ - **Time hints** — "just now", "5 minutes ago", "today around 14:00".
50
+
51
+ If the operator gave no hint at all, fall back to the tail (see below) — but
52
+ say so plainly when you confirm, so they know the report may have grabbed the
53
+ wrong incident.
54
+
55
+ ### 2. Find the relevant log window
56
+
57
+ Logs live at the first existing dir:
41
58
 
42
59
  1. `$CODEX_HOME/mrrlin/director-bridge/logs/` (only if `CODEX_HOME` is set)
43
60
  2. `~/.mrrlin/director-bridge/logs/`
44
61
 
45
- Pick the **most recent** `bridge-YYYY-MM-DD.jsonl` file (filenames are UTC dates;
46
- sort descending). Read roughly the **last 200 lines**. Each line looks like:
62
+ Files are `bridge-YYYY-MM-DD.jsonl` (UTC dates). Sort newest-first. Each line:
47
63
 
48
64
  ```json
49
65
  {"ts":"...","dir":"in|out","spanId":"...","sessionId":"...","type":"turn|event|error|...","ms":123,"payload":{...}}
@@ -52,31 +68,44 @@ sort descending). Read roughly the **last 200 lines**. Each line looks like:
52
68
  Secrets are already redacted by the logger (tokens show as `[REDACTED]`), so the
53
69
  log lines are safe to forward as-is.
54
70
 
55
- From the tail, extract:
71
+ **With a hint** — grep across the **3 most recent files** (today + last 2 days)
72
+ in this signal order, stopping at the first that matches:
56
73
 
57
- - Every line with `type:"error"` (and any `dir:"out"` payload that looks like a failure — non-2xx HTTP, stack traces, "failed", "timeout").
58
- - The last few `type:"turn"` lines for context on what the user was doing.
59
- - The latest `sessionId` and the `spanId`s tied to the errors.
60
- - `ts` of the first and last relevant lines (the time window).
74
+ 1. The literal quoted substring from the hint (case-insensitive).
75
+ 2. The `sessionId` or `spanId` from the hint.
76
+ 3. Error-word lines clustered near any time hint the user gave.
61
77
 
62
- If no log dir or file exists, or the tail has no errors, say so plainly and rely
63
- on what the user tells you in step 2 still send the report.
78
+ Pick the **most recent** matching cluster. The "relevant window" = the matching
79
+ line + ~10 lines before and ~30 lines after. If the matching line has a
80
+ `sessionId`, bound the window to that session.
64
81
 
65
- ### 2. Ask the user in THEIR language
82
+ **Without a hint** — read the last ~200 lines of the newest file. The window is
83
+ the last contiguous cluster of `type:"error"` lines (or, if none, the last few
84
+ `type:"turn"` lines).
66
85
 
67
- Detect the language the user is writing in and ask in that language. Keep it to a
68
- few short questions, ask them **once**, don't interrogate. Cover:
86
+ From the relevant window extract:
69
87
 
70
- - **What were you doing** when it broke?
71
- - **What actually happened** (the symptom they saw)?
72
- - **What did you expect to happen instead?** — ask this **only if the expected
73
- result is not already obvious** from the log or from what they described. If
74
- it's obvious, infer it and skip the question.
88
+ - Every `type:"error"` line and any `dir:"out"` payload that looks like a failure (non-2xx HTTP, stack traces, "failed", "timeout").
89
+ - The last few `type:"turn"` lines before the failure (what the user was doing).
90
+ - The `sessionId` and `spanId`s tied to the failure.
91
+ - `ts` of the first and last lines in the window.
92
+
93
+ If the log dir doesn't exist, or the hint matches nothing in the last 3 days,
94
+ say so plainly and lean on the user's answers in step 3 — still send the report.
95
+
96
+ ### 3. Ask the user — in THEIR language — only what the log doesn't already tell you
97
+
98
+ Detect the language the user is writing in and ask in that language. Keep it
99
+ short, ask **once**, and **skip any question the hint + log already answered**:
100
+
101
+ - **What were you doing** when it broke? — skip if the hint or the preceding `type:"turn"` lines make this obvious.
102
+ - **What actually happened (the symptom)?** — skip if the hint is itself a verbatim error/output.
103
+ - **What did you expect to happen instead?** — ask only if the expected result is not obvious from the log or hint.
75
104
 
76
105
  If the user gives short or partial answers, accept them and move on. Never block
77
106
  the report on a perfect answer.
78
107
 
79
- ### 3. Package the report (in ENGLISH)
108
+ ### 4. Package the report (in ENGLISH)
80
109
 
81
110
  Translate the user's answers to English. Build a plain-text report. Keep the whole
82
111
  thing under **4096 characters** (Telegram's per-message limit) — trim the log
@@ -87,6 +116,9 @@ excerpt first if needed, keeping the error lines over the context lines.
87
116
  When (UTC): <iso timestamp of the report>
88
117
  Mrrlin MCP: v<version if known> | OS: <platform> | Node: <version>
89
118
 
119
+ ▶ User hint (verbatim):
120
+ <the text the operator passed with /report-issue, untranslated; "(none)" if absent>
121
+
90
122
  ▶ What the user was doing:
91
123
  <their answer, in English>
92
124
 
@@ -96,14 +128,14 @@ Mrrlin MCP: v<version if known> | OS: <platform> | Node: <version>
96
128
  ▶ Actual result / symptom:
97
129
  <their answer, in English>
98
130
 
99
- ▶ Errors from bridge log (<filename>):
131
+ ▶ Errors from bridge log (<filename>, matched by: <hint substring | sessionId | tail-fallback>):
100
132
  <the extracted error lines, verbatim — already redacted>
101
133
 
102
134
  ▶ Context:
103
135
  session=<sessionId> spanIds=<...> window=<first ts>..<last ts>
104
136
  ```
105
137
 
106
- ### 4. Send it — a single POST to Telegram
138
+ ### 5. Send it — a single POST to Telegram
107
139
 
108
140
  This is **just one HTTP POST** to the Telegram Bot API `sendMessage` method.
109
141
  Endpoint and shape:
@@ -141,15 +173,17 @@ curl -sS -X POST \
141
173
  -F "document=@<path-to-bridge-YYYY-MM-DD.jsonl>"
142
174
  ```
143
175
 
144
- ### 5. Confirm
176
+ ### 6. Confirm
145
177
 
146
178
  Tell the user, in their language, that the report was sent (or that it failed and
147
179
  why). Don't dump the raw report or the token back at them — just confirm.
148
180
 
149
181
  ## Rules
150
182
 
151
- - Ask the user in their language; write the report in English.
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.
185
+ - Ask the user in their language; write the report in English. Skip any question the hint + log already answered.
152
186
  - Hide the mechanics: never surface the token, the log path, or the curl command to the user.
153
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.
154
188
  - One report = one `sendMessage` POST. Keep it under 4096 chars; use `sendDocument` only for the optional full log.
155
- - If anything is missing (no log, vague answers), still send the best report you can rather than giving up.
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"
@@ -21,8 +21,8 @@
21
21
  "esbuild": "^0.24.0",
22
22
  "tsx": "^4.22.3",
23
23
  "@mrrlin/client": "0.0.0",
24
- "@mrrlin/codex-client": "0.0.0",
25
24
  "@mrrlin/director-e2e": "0.0.0",
25
+ "@mrrlin/codex-client": "0.0.0",
26
26
  "@mrrlin/schemas": "0.0.0",
27
27
  "@mrrlin/tsconfig": "0.0.0",
28
28
  "@mrrlin/wiki": "0.0.0"