omni-notify-mcp 1.3.318 → 1.3.320
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.
|
@@ -906,6 +906,7 @@ class JsonlCliTurn {
|
|
|
906
906
|
sink;
|
|
907
907
|
lineBuffer = "";
|
|
908
908
|
stderr = "";
|
|
909
|
+
stderrLines = "";
|
|
909
910
|
turnSpec;
|
|
910
911
|
cliName;
|
|
911
912
|
constructor(turnSpec, cliName) {
|
|
@@ -919,6 +920,9 @@ class JsonlCliTurn {
|
|
|
919
920
|
return undefined;
|
|
920
921
|
return child.pid;
|
|
921
922
|
}
|
|
923
|
+
diagnostic(_line) {
|
|
924
|
+
return false;
|
|
925
|
+
}
|
|
922
926
|
read(line) {
|
|
923
927
|
this.sink?.stdout();
|
|
924
928
|
if (!line.startsWith("{") || !line.endsWith("}"))
|
|
@@ -945,6 +949,7 @@ class JsonlCliTurn {
|
|
|
945
949
|
this.sink = sink;
|
|
946
950
|
this.lineBuffer = "";
|
|
947
951
|
this.stderr = "";
|
|
952
|
+
this.stderrLines = "";
|
|
948
953
|
const launch = ownerBoundLaunch({ cmd: spec.cli.cmd, args: [...spec.cli.args, ...args] }, spec.ownerPid, spec.project, spec.guardDir);
|
|
949
954
|
return new Promise((resolve, reject) => {
|
|
950
955
|
let settled = false;
|
|
@@ -981,6 +986,14 @@ class JsonlCliTurn {
|
|
|
981
986
|
child.stderr.on("data", (chunk) => {
|
|
982
987
|
this.stderr = (this.stderr + chunk).slice(-4000);
|
|
983
988
|
this.sink?.alive?.();
|
|
989
|
+
this.stderrLines += chunk;
|
|
990
|
+
for (let i = this.stderrLines.indexOf("\n"); i >= 0; i = this.stderrLines.indexOf("\n")) {
|
|
991
|
+
const line = this.stderrLines.slice(0, i).trim();
|
|
992
|
+
this.stderrLines = this.stderrLines.slice(i + 1);
|
|
993
|
+
if (this.diagnostic(line))
|
|
994
|
+
stop();
|
|
995
|
+
}
|
|
996
|
+
this.stderrLines = this.stderrLines.slice(-4000);
|
|
984
997
|
});
|
|
985
998
|
child.stdout.on("data", (chunk) => {
|
|
986
999
|
this.lineBuffer += chunk;
|
|
@@ -1105,7 +1118,7 @@ export class CodexTurn extends JsonlCliTurn {
|
|
|
1105
1118
|
}
|
|
1106
1119
|
}
|
|
1107
1120
|
export function opencodeRunArgs(spec) {
|
|
1108
|
-
return ["run", "--format", "json", "--auto", ...(spec.session === undefined ? [] : ["-s", spec.session]), "-m", spec.model];
|
|
1121
|
+
return ["run", "--print-logs", "--log-level", "ERROR", "--format", "json", "--auto", ...(spec.session === undefined ? [] : ["-s", spec.session]), "-m", spec.model];
|
|
1109
1122
|
}
|
|
1110
1123
|
function opencodeToolActivity(tool) {
|
|
1111
1124
|
if (tool === "read")
|
|
@@ -1125,6 +1138,8 @@ function opencodeToolActivity(tool) {
|
|
|
1125
1138
|
// GATE: the HTTP statuses on which the provider refused THIS key (unauthorized, payment, forbidden, rate-limited) — the turn moves to the next key; any other failure is the turn's own and moves nothing
|
|
1126
1139
|
const KEY_REFUSAL_STATUSES = new Set([401, 402, 403, 429]);
|
|
1127
1140
|
const KEY_REFUSAL_WORDS = /credit balance is too low|insufficient (?:balance|funds|credit|quota)|out of (?:funds|credit)|invalid x-api-key/i;
|
|
1141
|
+
// GATE: OpenCode's own log line for a call of the turn's main agent that the provider rate-limited — the CLI then retries it in silence for as long as the provider's retry-after says, so the turn ends this attempt and moves to the next key
|
|
1142
|
+
const RETRIED_RATE_LIMIT = /level=ERROR .*message="stream error" .*session\.id=(ses_[A-Za-z0-9]+) .*small=false .*mode=primary .*error\.error="(?:AI_APICallError: )?([^"]*(?:rate.?limit|too many requests)[^"]*)"/i;
|
|
1128
1143
|
const KEY_RETRY_PROMPT = "The provider refused the key your last reply was being written on, so that reply never arrived. Carry on from the last message.";
|
|
1129
1144
|
export class OpenCodeTurn extends JsonlCliTurn {
|
|
1130
1145
|
spec;
|
|
@@ -1169,6 +1184,18 @@ export class OpenCodeTurn extends JsonlCliTurn {
|
|
|
1169
1184
|
this.keyRefusal = this.failure;
|
|
1170
1185
|
}
|
|
1171
1186
|
}
|
|
1187
|
+
diagnostic(line) {
|
|
1188
|
+
if (!RETRIED_RATE_LIMIT.test(line))
|
|
1189
|
+
return false;
|
|
1190
|
+
const [, session, said] = RETRIED_RATE_LIMIT.exec(line);
|
|
1191
|
+
if (this.session === undefined) {
|
|
1192
|
+
this.session = session;
|
|
1193
|
+
this.sink?.sessionId(session, true);
|
|
1194
|
+
}
|
|
1195
|
+
this.failure = `${said} (HTTP 429, being retried by the CLI)`;
|
|
1196
|
+
this.keyRefusal = this.failure;
|
|
1197
|
+
return true;
|
|
1198
|
+
}
|
|
1172
1199
|
verdict(exitCode) {
|
|
1173
1200
|
// NULL-OK: field failure is OPTIONAL and therefore it is ok to check for NULL
|
|
1174
1201
|
if (this.failure !== undefined)
|
|
@@ -724,7 +724,8 @@ function opencodeRoute(home, wanted, now = Date.now(), identities = identitiesHe
|
|
|
724
724
|
passed.push(`${named}: ${bare === undefined ? "DeepAgent allows it no model" : `DeepAgent does not allow it ${wanted}`}`);
|
|
725
725
|
continue;
|
|
726
726
|
}
|
|
727
|
-
|
|
727
|
+
const store = path.join(home, ".bullseye", "opencode");
|
|
728
|
+
return { identityId: id, named, model: `${kind.provider}/${model}`, env: { [kind.env]: key, [kind.baseEnv]: kind.base, XDG_DATA_HOME: path.join(store, "data"), XDG_STATE_HOME: path.join(store, "state") } };
|
|
728
729
|
}
|
|
729
730
|
throw new NoOpenCodeKey(`no key DeepAgent holds can run OpenCode now — ${passed.join("; ") || "its OpenCode key plan names no key"}`);
|
|
730
731
|
}
|
|
@@ -1529,6 +1530,19 @@ function claudeSubscriptions(identities, Failure = Error) {
|
|
|
1529
1530
|
return { id: String(row.id), label, token: text(row, 'credential') };
|
|
1530
1531
|
});
|
|
1531
1532
|
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Every Claude subscription this box's DeepAgent holds, read from VS Code's user settings (`deepagent.identities`). A box with
|
|
1535
|
+
* no VS Code user directory throws `vscodeUserDir`'s own words naming every path tried; a missing settings file is named here.
|
|
1536
|
+
* `[]` is settings that name no Claude subscription, never a failed read.
|
|
1537
|
+
* @returns {{ id: string, label: string, token: string }[]}
|
|
1538
|
+
*/
|
|
1539
|
+
function boxClaudeSubscriptions() {
|
|
1540
|
+
const file = path.join(vscodeUserDir(), 'settings.json');
|
|
1541
|
+
const text = unlessErr('ENOENT', () => fs.readFileSync(file, 'utf8'));
|
|
1542
|
+
if (text === undefined)
|
|
1543
|
+
throw new Error('VS Code user settings ' + file + ' does not exist, so DeepAgent names no Claude subscription');
|
|
1544
|
+
return claudeSubscriptions(settingsIdentities(text, file));
|
|
1545
|
+
}
|
|
1532
1546
|
module.exports = {
|
|
1533
1547
|
VSCODE_VARIANTS,
|
|
1534
1548
|
vscodeDataRoot,
|
|
@@ -1536,6 +1550,7 @@ module.exports = {
|
|
|
1536
1550
|
jsoncToJson,
|
|
1537
1551
|
settingsIdentities,
|
|
1538
1552
|
claudeSubscriptions,
|
|
1553
|
+
boxClaudeSubscriptions,
|
|
1539
1554
|
chosenSubscriptionOf,
|
|
1540
1555
|
settingsTokens,
|
|
1541
1556
|
deepagentMirror,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.320",
|
|
4
4
|
"description": "Reach your AI agents from anywhere — and let them reach you. One stdio process serves the whole tool surface to Claude Code, GitHub Copilot Chat and Codex: desktop, Telegram, Slack, ntfy, Discord, Teams and SMS are configured in one file, and agents notify you when long work finishes or a decision is needed, ask you a question and wait for your answer, and receive and reply to the messages you send them — with Do Not Disturb and idle detection deciding what actually gets through.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,13 @@ const caret = (text) => `"${text.replace(/(\\*)"/g, '$1$1""').replace(/(\\+)$/,
|
|
|
28
28
|
|
|
29
29
|
// The guard itself runs as Node through ELECTRON_RUN_AS_NODE; the target must not inherit it.
|
|
30
30
|
const { ELECTRON_RUN_AS_NODE: _runAsNode, ...targetEnv } = process.env;
|
|
31
|
-
const
|
|
31
|
+
const named = decode(exeB64);
|
|
32
|
+
const dirs = process.env.PATH.split(";").map((dir) => dir.replace(/^"(.*)"$/, "$1")).filter((dir) => dir !== "");
|
|
33
|
+
const onPath = /[\\/]/.test(named) || /\.[a-z0-9]+$/i.test(named)
|
|
34
|
+
? undefined
|
|
35
|
+
: dirs.flatMap((dir) => [".com", ".exe", ".bat", ".cmd"].map((ext) => `${dir}\\${named}${ext}`)).find((file) => fs.existsSync(file));
|
|
36
|
+
// NULL-OK: field onPath is OPTIONAL and therefore it is ok to check for NULL
|
|
37
|
+
const exe = onPath ?? named;
|
|
32
38
|
const args = JSON.parse(decode(argsB64));
|
|
33
39
|
const cwd = decode(cwdB64);
|
|
34
40
|
if (cwd !== "" && !fs.existsSync(cwd)) {
|