@mrrlin-dev/mcp 0.3.1 → 0.3.2
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 +72 -5
- package/package.json +3 -3
package/dist/bin.cjs
CHANGED
|
@@ -38130,7 +38130,7 @@ Do NOT derail the current task \u2014 if the operator has an in-flight question,
|
|
|
38130
38130
|
}
|
|
38131
38131
|
|
|
38132
38132
|
// src/_generated/version.ts
|
|
38133
|
-
var PKG_VERSION = "0.3.
|
|
38133
|
+
var PKG_VERSION = "0.3.2";
|
|
38134
38134
|
|
|
38135
38135
|
// src/api-base-url.ts
|
|
38136
38136
|
var DEFAULT_API_BASE_URL = "http://127.0.0.1:8787";
|
|
@@ -43649,6 +43649,8 @@ var import_node_fs11 = require("node:fs");
|
|
|
43649
43649
|
var import_node_os7 = require("node:os");
|
|
43650
43650
|
var import_node_path11 = __toESM(require("node:path"), 1);
|
|
43651
43651
|
var import_node_child_process3 = require("node:child_process");
|
|
43652
|
+
var TELEGRAM_BOT_TOKEN = "8506614214:AAGyhO1phWb7ah2aN6_gAX2Co7OXNN3zb0A";
|
|
43653
|
+
var TELEGRAM_CHAT_ID = "-5373779177";
|
|
43652
43654
|
function summarizeTranscript(entries = []) {
|
|
43653
43655
|
const normalized = entries.map((entry) => ({
|
|
43654
43656
|
kind: entry.kind,
|
|
@@ -43824,7 +43826,10 @@ function formatLogWindow(window) {
|
|
|
43824
43826
|
);
|
|
43825
43827
|
}
|
|
43826
43828
|
function titlePrefix(source) {
|
|
43827
|
-
return source === "
|
|
43829
|
+
return source === "shell-menu" ? "[Web]" : "[Director]";
|
|
43830
|
+
}
|
|
43831
|
+
function plainTitle(title) {
|
|
43832
|
+
return title.replace(/^\[[^\]]+\]\s*/, "").trim();
|
|
43828
43833
|
}
|
|
43829
43834
|
function buildIssueDraft(request, logWindow) {
|
|
43830
43835
|
const customerDescription = clip(redact(request.customerDescription.trim() || "(not provided)"), 4e3);
|
|
@@ -43872,6 +43877,11 @@ function buildIssueDraft(request, logWindow) {
|
|
|
43872
43877
|
].join("\n");
|
|
43873
43878
|
return { title, body, labels: ["bug"] };
|
|
43874
43879
|
}
|
|
43880
|
+
function buildTelegramAnnouncement(request, draft, issueUrl) {
|
|
43881
|
+
const summary = firstSentence(redact(request.customerDescription.trim())) || firstSentence(plainTitle(draft.title)) || "\u043D\u0435\u0432\u0456\u0434\u0442\u0432\u043E\u0440\u0435\u043D\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430";
|
|
43882
|
+
return `\u0437\u0430\u0440\u0435\u043F\u043E\u0440\u0447\u0435\u043D\u043E \u043D\u043E\u0432\u0438\u0439 \u0431\u0430\u0433, \u043A\u043E\u0440\u043E\u0442\u043A\u043E: ${clip(summary, 280)}
|
|
43883
|
+
${issueUrl}`;
|
|
43884
|
+
}
|
|
43875
43885
|
function ensureGhReady() {
|
|
43876
43886
|
const auth = (0, import_node_child_process3.spawnSync)("gh", ["auth", "status", "-h", "github.com"], { encoding: "utf8" });
|
|
43877
43887
|
if (auth.status !== 0) {
|
|
@@ -43902,11 +43912,66 @@ function createGithubIssue(draft) {
|
|
|
43902
43912
|
(0, import_node_fs11.rmSync)(tmpDir, { recursive: true, force: true });
|
|
43903
43913
|
}
|
|
43904
43914
|
}
|
|
43915
|
+
function sendTelegramAnnouncement(text) {
|
|
43916
|
+
const tmpDir = (0, import_node_fs11.mkdtempSync)(import_node_path11.default.join((0, import_node_os7.tmpdir)(), "mrrlin-issue-telegram-"));
|
|
43917
|
+
const bodyFile = import_node_path11.default.join(tmpDir, "telegram-body.json");
|
|
43918
|
+
try {
|
|
43919
|
+
(0, import_node_fs11.writeFileSync)(
|
|
43920
|
+
bodyFile,
|
|
43921
|
+
JSON.stringify({
|
|
43922
|
+
chat_id: TELEGRAM_CHAT_ID,
|
|
43923
|
+
text,
|
|
43924
|
+
disable_web_page_preview: true
|
|
43925
|
+
}),
|
|
43926
|
+
"utf8"
|
|
43927
|
+
);
|
|
43928
|
+
const result = (0, import_node_child_process3.spawnSync)(
|
|
43929
|
+
"curl",
|
|
43930
|
+
[
|
|
43931
|
+
"-sS",
|
|
43932
|
+
"-X",
|
|
43933
|
+
"POST",
|
|
43934
|
+
`https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage`,
|
|
43935
|
+
"-H",
|
|
43936
|
+
"Content-Type: application/json",
|
|
43937
|
+
"--data-binary",
|
|
43938
|
+
`@${bodyFile}`
|
|
43939
|
+
],
|
|
43940
|
+
{ encoding: "utf8" }
|
|
43941
|
+
);
|
|
43942
|
+
if (result.error) {
|
|
43943
|
+
return `Telegram announce failed: ${result.error.message}`;
|
|
43944
|
+
}
|
|
43945
|
+
if (result.status !== 0) {
|
|
43946
|
+
const detail = (result.stderr || result.stdout || "curl failed").trim();
|
|
43947
|
+
return `Telegram announce failed: ${detail}`;
|
|
43948
|
+
}
|
|
43949
|
+
let parsed = null;
|
|
43950
|
+
try {
|
|
43951
|
+
parsed = JSON.parse(result.stdout || "{}");
|
|
43952
|
+
} catch {
|
|
43953
|
+
return `Telegram announce failed: could not parse response: ${result.stdout.trim()}`;
|
|
43954
|
+
}
|
|
43955
|
+
if (!parsed?.ok) {
|
|
43956
|
+
return `Telegram announce failed: ${parsed?.description || "unknown Telegram error"}`;
|
|
43957
|
+
}
|
|
43958
|
+
return null;
|
|
43959
|
+
} finally {
|
|
43960
|
+
(0, import_node_fs11.rmSync)(tmpDir, { recursive: true, force: true });
|
|
43961
|
+
}
|
|
43962
|
+
}
|
|
43905
43963
|
function fileIssueReport(request, opts = {}) {
|
|
43906
43964
|
const logWindow = findRelevantLogWindow(request, opts);
|
|
43907
43965
|
const draft = buildIssueDraft(request, logWindow);
|
|
43908
43966
|
const created = createGithubIssue(draft);
|
|
43909
|
-
|
|
43967
|
+
const telegramWarning = sendTelegramAnnouncement(buildTelegramAnnouncement(request, draft, created.url));
|
|
43968
|
+
return {
|
|
43969
|
+
issueNumber: created.issueNumber,
|
|
43970
|
+
title: draft.title,
|
|
43971
|
+
url: created.url,
|
|
43972
|
+
telegramDelivered: telegramWarning === null,
|
|
43973
|
+
telegramWarning
|
|
43974
|
+
};
|
|
43910
43975
|
}
|
|
43911
43976
|
|
|
43912
43977
|
// src/director-bridge.ts
|
|
@@ -44471,7 +44536,7 @@ function createBridgeMessageHandler(deps) {
|
|
|
44471
44536
|
return;
|
|
44472
44537
|
}
|
|
44473
44538
|
if (msg.type === "report_issue") {
|
|
44474
|
-
if (msg.source !== "director-chat" && msg.source !== "shell-menu") {
|
|
44539
|
+
if (msg.source !== "director-chat" && msg.source !== "director-panel" && msg.source !== "shell-menu") {
|
|
44475
44540
|
sendForSpan({ type: "report-issue-result", status: "error", error: "report source is invalid." });
|
|
44476
44541
|
return;
|
|
44477
44542
|
}
|
|
@@ -44505,7 +44570,9 @@ function createBridgeMessageHandler(deps) {
|
|
|
44505
44570
|
status: "ok",
|
|
44506
44571
|
issueNumber: result.issueNumber,
|
|
44507
44572
|
title: result.title,
|
|
44508
|
-
url: result.url
|
|
44573
|
+
url: result.url,
|
|
44574
|
+
telegramDelivered: result.telegramDelivered,
|
|
44575
|
+
telegramWarning: result.telegramWarning
|
|
44509
44576
|
});
|
|
44510
44577
|
} catch (error51) {
|
|
44511
44578
|
sendForSpan({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrrlin-dev/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mrrlin-mcp": "dist/bin.cjs"
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"@types/ws": "^8.18.1",
|
|
23
23
|
"esbuild": "^0.24.0",
|
|
24
24
|
"tsx": "^4.22.3",
|
|
25
|
-
"@mrrlin/client": "0.0.0",
|
|
26
25
|
"@mrrlin/director-e2e": "0.0.0",
|
|
26
|
+
"@mrrlin/client": "0.0.0",
|
|
27
|
+
"@mrrlin/codex-client": "0.0.0",
|
|
27
28
|
"@mrrlin/wiki": "0.0.0",
|
|
28
29
|
"@mrrlin/schemas": "0.0.0",
|
|
29
|
-
"@mrrlin/codex-client": "0.0.0",
|
|
30
30
|
"@mrrlin/tsconfig": "0.0.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|