omni-notify-mcp 1.3.409 → 1.3.412
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.
|
@@ -3115,7 +3115,7 @@ function forceEntry(e, now, by, eventAt = now) {
|
|
|
3115
3115
|
e.forcedBy = by;
|
|
3116
3116
|
if (by === HIS_PRESS)
|
|
3117
3117
|
e.startPressedAt = Math.max(e.startPressedAt ?? 0, eventAt);
|
|
3118
|
-
e.why = `${by} ⚡ Force start starts it on the next pass, past a ⏸ Stop`;
|
|
3118
|
+
e.why = `${by} ⚡ Force start starts it on the next pass, past a ⏸ Stop and this workspace's lane limit`;
|
|
3119
3119
|
step(e, now, "placed", e.why);
|
|
3120
3120
|
}
|
|
3121
3121
|
/** The provider refused to start a story's worker: its own words, which the entry carries and the queue starts again on its backoff. */
|
|
@@ -3178,6 +3178,49 @@ export function fenceStart(provider, what) {
|
|
|
3178
3178
|
export const WAKE_BASE_MS = 60_000;
|
|
3179
3179
|
// GATE: how many times the wait doubles — past it a parked worker is woken every WAKE_BASE_MS * 2^WAKE_DOUBLINGS (32 min)
|
|
3180
3180
|
export const WAKE_DOUBLINGS = 5;
|
|
3181
|
+
// GATE: the free physical memory below which no story worker is started or woken — the story waits in line and starts on the first pass the box has this much free again; it leaves the trade JVM room for its whole -Xmx2048m heap, one more agent's tree and the servers on 7470-7481 room to grow
|
|
3182
|
+
export const START_MEMORY_FLOOR_BYTES = 4 * 2 ** 30;
|
|
3183
|
+
// GATE: the memory one started worker's process tree is taken to reach (the largest working tree measured), reserved out of the free reading for each worker started or woken within START_MEMORY_GROWTH_MS, whose growth that reading cannot see yet
|
|
3184
|
+
export const AGENT_TREE_BYTES = 830 * 2 ** 20;
|
|
3185
|
+
// GATE: how long a started worker's growth is reserved before the free reading is trusted to carry it
|
|
3186
|
+
export const START_MEMORY_GROWTH_MS = 2 * 60_000;
|
|
3187
|
+
/** 🔴 #4460 — the short word a story's row reads while the box's free memory holds its start; the numbers are its why, the row's tooltip. */
|
|
3188
|
+
export const MEMORY_WAIT_WORD = "⏳ waiting for memory";
|
|
3189
|
+
/** 🔴 #4460 — when this process started or woke a story worker, on every board it drives. */
|
|
3190
|
+
const recentStarts = [];
|
|
3191
|
+
const gib = (bytes) => (bytes / 2 ** 30).toFixed(1);
|
|
3192
|
+
/** 🔴 #4460 — why the box's memory holds a start or wake now — its free reading, less {@link AGENT_TREE_BYTES} for each worker started within {@link START_MEMORY_GROWTH_MS}, is below {@link START_MEMORY_FLOOR_BYTES} — or undefined when it is not. `trace` carries no figure that changes pass to pass. */
|
|
3193
|
+
function memoryHeldWhy(world, now) {
|
|
3194
|
+
// NULL-OK: field freeMemory is OPTIONAL and therefore it is ok to check for NULL
|
|
3195
|
+
if (world.freeMemory === undefined)
|
|
3196
|
+
return undefined;
|
|
3197
|
+
recentStarts.splice(0, recentStarts.length, ...recentStarts.filter((at) => at > now - START_MEMORY_GROWTH_MS));
|
|
3198
|
+
const growing = recentStarts.length;
|
|
3199
|
+
const free = world.freeMemory();
|
|
3200
|
+
if (free - growing * AGENT_TREE_BYTES >= START_MEMORY_FLOOR_BYTES)
|
|
3201
|
+
return undefined;
|
|
3202
|
+
const trace = `${MEMORY_WAIT_WORD}: the box's free memory is below the ${gib(START_MEMORY_FLOOR_BYTES)} GB floor, so no worker is started or woken until it frees`;
|
|
3203
|
+
const reserved = growing === 0 ? "" : `, less ${gib(growing * AGENT_TREE_BYTES)} GB still to grow in the ${growing} worker${growing === 1 ? "" : "s"} started in the last ${START_MEMORY_GROWTH_MS / 60_000} min`;
|
|
3204
|
+
return { trace, why: `${MEMORY_WAIT_WORD} — ${gib(free)} GB free${reserved}, below the ${gib(START_MEMORY_FLOOR_BYTES)} GB floor; it starts on the first pass the box has that much free again` };
|
|
3205
|
+
}
|
|
3206
|
+
/** 🔴 #4460 — the release the step of a start or wake carries when free memory was what last held it; a hold that another reason took over since carries none. */
|
|
3207
|
+
function memoryReleased(e, now) {
|
|
3208
|
+
const held = e.memoryHeld;
|
|
3209
|
+
// NULL-OK: field memoryHeld is OPTIONAL and therefore it is ok to check for NULL
|
|
3210
|
+
if (held === undefined)
|
|
3211
|
+
return "";
|
|
3212
|
+
delete e.memoryHeld;
|
|
3213
|
+
return held.why === e.why ? ` — free memory is back above the ${gib(START_MEMORY_FLOOR_BYTES)} GB floor after ${Math.round((now - held.since) / 60_000)}m held` : "";
|
|
3214
|
+
}
|
|
3215
|
+
/** 🔴 #4460 — holds `e` on the box's memory: {@link holdBack} puts its why on it and its trace once per hold, and `memoryHeld` keeps since when and that why; a hold that follows another reason is a new one. */
|
|
3216
|
+
function holdOnMemory(e, now, stage, why, trace, moved = false) {
|
|
3217
|
+
// NULL-OK: field memoryHeld is OPTIONAL and therefore it is ok to check for NULL
|
|
3218
|
+
const since = e.memoryHeld !== undefined && e.memoryHeld.why === e.why ? e.memoryHeld.since : undefined;
|
|
3219
|
+
// NULL-OK: field since is OPTIONAL and therefore it is ok to check for NULL
|
|
3220
|
+
holdBack(e, now, stage, why, moved || since === undefined, trace);
|
|
3221
|
+
// NULL-OK: field since is OPTIONAL and therefore it is ok to check for NULL
|
|
3222
|
+
e.memoryHeld = { since: since ?? now, why };
|
|
3223
|
+
}
|
|
3181
3224
|
// GATE: how long a 🛑 Stop waits for its worker to reach a step boundary (end its turn) before its row says plainly that it has not — it is never killed by the wait, and keeps being asked
|
|
3182
3225
|
export const STOP_STEP_BOUND_MS = 10 * 60_000;
|
|
3183
3226
|
/** 🔴 #4216 — where a 🛑 Stop's ask for one session waits for that session's next tool call, which hands the agent the order (the PreToolUse hook reads this file). */
|
|
@@ -3978,6 +4021,18 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3978
4021
|
// NULL-OK: field halted is OPTIONAL and therefore it is ok to check for NULL
|
|
3979
4022
|
return e.forced === true ? manual : halted ?? manual;
|
|
3980
4023
|
};
|
|
4024
|
+
// NULL-OK: field laneLimit is OPTIONAL and therefore it is ok to check for NULL
|
|
4025
|
+
const lanes = world.laneLimit?.();
|
|
4026
|
+
// NULL-OK: field lanes is OPTIONAL and therefore it is ok to check for NULL
|
|
4027
|
+
let running = lanes?.running ?? 0;
|
|
4028
|
+
/** 🔴 #4460 — a worker this pass started or woke, or whose start may have made one: it takes a lane, and its growth is reserved out of the free reading. */
|
|
4029
|
+
const workerMade = () => {
|
|
4030
|
+
recentStarts.push(now);
|
|
4031
|
+
running += 1;
|
|
4032
|
+
};
|
|
4033
|
+
/** 🔴 #4460 — why this workspace's lane limit holds the entry's start or wake now, or undefined: no limit is set, a lane is free, or his ⚡ Force start passes it. */
|
|
4034
|
+
// NULL-OK: field lanes is OPTIONAL and therefore it is ok to check for NULL
|
|
4035
|
+
const laneHeld = (e) => (lanes === undefined || e.forced === true || running < lanes.limit ? undefined : `⏳ ${running} lanes run, this workspace's limit is ${lanes.limit}`);
|
|
3981
4036
|
for (const e of queueOrder(store)) {
|
|
3982
4037
|
try {
|
|
3983
4038
|
const sessionId = wakeable.get(e);
|
|
@@ -4016,9 +4071,25 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4016
4071
|
save();
|
|
4017
4072
|
continue;
|
|
4018
4073
|
}
|
|
4074
|
+
const full = laneHeld(e);
|
|
4075
|
+
// NULL-OK: field full is OPTIONAL and therefore it is ok to check for NULL
|
|
4076
|
+
if (full !== undefined) {
|
|
4077
|
+
unwoken(`its worker ${parked.jobId} is parked, and ${full}`);
|
|
4078
|
+
continue;
|
|
4079
|
+
}
|
|
4080
|
+
const lowMemory = memoryHeldWhy(world, now);
|
|
4081
|
+
// NULL-OK: field lowMemory is OPTIONAL and therefore it is ok to check for NULL
|
|
4082
|
+
if (lowMemory !== undefined) {
|
|
4083
|
+
const moved = e.state !== "queued";
|
|
4084
|
+
e.state = "queued";
|
|
4085
|
+
holdOnMemory(e, now, "parked", `its worker ${parked.jobId} is parked, and ${lowMemory.why}`, `its worker is parked, and ${lowMemory.trace}`, moved);
|
|
4086
|
+
continue;
|
|
4087
|
+
}
|
|
4088
|
+
const released = memoryReleased(e, now);
|
|
4019
4089
|
const wakes = (parked.wakes ?? 0) + 1;
|
|
4020
4090
|
try {
|
|
4021
4091
|
const woken = await world.wake(e, board, sessionId, wakeMessage(e.storyId), worker => { e.worker = worker; save(); });
|
|
4092
|
+
workerMade();
|
|
4022
4093
|
e.landedAt = now;
|
|
4023
4094
|
// NULL-OK: field cwd is OPTIONAL and therefore it is ok to check for NULL
|
|
4024
4095
|
e.worker = { ...woken, wakes, ...(woken.provider === parked.provider && woken.jobId === parked.jobId ? keptSession(parked) : {}), ...(parked.cwd === undefined ? {} : { cwd: parked.cwd }) };
|
|
@@ -4030,7 +4101,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4030
4101
|
}
|
|
4031
4102
|
e.state = "running";
|
|
4032
4103
|
e.why = `its ${woken.provider} worker ${woken.jobId} was woken in its own session (wake ${wakes})`;
|
|
4033
|
-
step(e, now, "woken", e.why);
|
|
4104
|
+
step(e, now, "woken", e.why + released);
|
|
4034
4105
|
}
|
|
4035
4106
|
catch (err) {
|
|
4036
4107
|
if (!(err instanceof WorkerNotStarted))
|
|
@@ -4043,6 +4114,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4043
4114
|
continue;
|
|
4044
4115
|
}
|
|
4045
4116
|
if (err instanceof WorkerStartUnconfirmed) {
|
|
4117
|
+
workerMade();
|
|
4046
4118
|
e.worker = { ...(e.worker ?? parked), startedAt: now, wakes };
|
|
4047
4119
|
delete e.worker.parkedAt;
|
|
4048
4120
|
noteStartUnconfirmed(e, e.worker, err.message, err.deadlineAt, Date.now());
|
|
@@ -4076,6 +4148,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4076
4148
|
// NULL-OK: field after is OPTIONAL and therefore it is ok to check for NULL
|
|
4077
4149
|
if (after !== undefined && after.alive && (after.parked === undefined || after.parked.live)) {
|
|
4078
4150
|
// OWNER: ITER/LOOP — the wake's answer was lost (a timeout on a busy box) but a process now runs the worker's session, so the wake landed: the entry keeps that worker and no second one is started; the next entry is read.
|
|
4151
|
+
workerMade();
|
|
4079
4152
|
e.worker = { provider: parked.provider, startedAt: now, jobId: parked.jobId, wakes, ...keptSession(parked) };
|
|
4080
4153
|
e.landedAt = now;
|
|
4081
4154
|
e.state = "running";
|
|
@@ -4086,6 +4159,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4086
4159
|
}
|
|
4087
4160
|
else if (!err.unsent) {
|
|
4088
4161
|
// OWNER: ITER/LOOP — the wake's answer was lost and no process is known to run the session (none has recorded it, or its transcript could not be read), so the worker stays parked and is read again next pass; it is never ended on a missing answer, which would start a second worker beside a wake that landed late; the next entry is read.
|
|
4162
|
+
workerMade();
|
|
4089
4163
|
e.worker = { ...parked, startedAt: now, parkedAt: now, wakes };
|
|
4090
4164
|
e.state = "queued";
|
|
4091
4165
|
delete e.forced;
|
|
@@ -4167,6 +4241,19 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4167
4241
|
const forced = e.forced === true && (halted !== undefined || unscheduled !== undefined);
|
|
4168
4242
|
// NULL-OK: field halted is OPTIONAL and therefore it is ok to check for NULL
|
|
4169
4243
|
const forcedPast = halted !== undefined ? "the queue's ⏸ Stop" : "AUTO START being off";
|
|
4244
|
+
const full = laneHeld(e);
|
|
4245
|
+
// NULL-OK: field full is OPTIONAL and therefore it is ok to check for NULL
|
|
4246
|
+
if (full !== undefined) {
|
|
4247
|
+
holdBack(e, now, "held-back", full);
|
|
4248
|
+
continue;
|
|
4249
|
+
}
|
|
4250
|
+
const lowMemory = memoryHeldWhy(world, now);
|
|
4251
|
+
// NULL-OK: field lowMemory is OPTIONAL and therefore it is ok to check for NULL
|
|
4252
|
+
if (lowMemory !== undefined) {
|
|
4253
|
+
holdOnMemory(e, now, "held-back", lowMemory.why, lowMemory.trace);
|
|
4254
|
+
continue;
|
|
4255
|
+
}
|
|
4256
|
+
const released = memoryReleased(e, now);
|
|
4170
4257
|
if (e.forced === true)
|
|
4171
4258
|
delete e.accountRefusals;
|
|
4172
4259
|
delete e.forced;
|
|
@@ -4175,13 +4262,14 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4175
4262
|
e.attempts += 1;
|
|
4176
4263
|
delete e.accountRefused;
|
|
4177
4264
|
dropWorker(e);
|
|
4178
|
-
step(e, now, "selected", `start ${e.attempts}${e.attempts > WORKER_ATTEMPTS ? ", past the attempts a story is given" : ` of ${WORKER_ATTEMPTS}`}${forced ? ` — ${forcer} ⚡ Force start, past ${forcedPast}` : ""}`);
|
|
4265
|
+
step(e, now, "selected", `start ${e.attempts}${e.attempts > WORKER_ATTEMPTS ? ", past the attempts a story is given" : ` of ${WORKER_ATTEMPTS}`}${forced ? ` — ${forcer} ⚡ Force start, past ${forcedPast}` : ""}${released}`);
|
|
4179
4266
|
save();
|
|
4180
4267
|
try {
|
|
4181
4268
|
e.worker = await world.launch(e, board, (sent) => {
|
|
4182
4269
|
e.worker = sent;
|
|
4183
4270
|
save();
|
|
4184
4271
|
});
|
|
4272
|
+
workerMade();
|
|
4185
4273
|
e.provider = "auto";
|
|
4186
4274
|
e.landedAt = now;
|
|
4187
4275
|
if (noteCarried(e, { alive: true, why: "", carried: e.worker.carried }, now)) {
|
|
@@ -4195,6 +4283,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4195
4283
|
if (!(err instanceof WorkerNotStarted))
|
|
4196
4284
|
throw err;
|
|
4197
4285
|
if (err instanceof WorkerStartUnconfirmed && e.worker !== undefined) {
|
|
4286
|
+
workerMade();
|
|
4198
4287
|
noteStartUnconfirmed(e, e.worker, err.message, err.deadlineAt, Date.now());
|
|
4199
4288
|
continue;
|
|
4200
4289
|
}
|
|
@@ -4210,6 +4299,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4210
4299
|
// NULL-OK: field found is OPTIONAL and therefore it is ok to check for NULL
|
|
4211
4300
|
if (made.alive && made.found !== undefined) {
|
|
4212
4301
|
// OWNER: ITER/LOOP — the start answered no job id, yet the provider made the story's job: that job is the entry's worker, so no second one is started.
|
|
4302
|
+
workerMade();
|
|
4213
4303
|
e.worker = made.found;
|
|
4214
4304
|
e.landedAt = now;
|
|
4215
4305
|
e.why = `its ${made.found.provider} worker ${made.found.jobId} runs, though its start answered: ${err.message}`;
|
|
@@ -4297,7 +4387,7 @@ export async function pressStory(board, storyId, press, now, by, requestHandledB
|
|
|
4297
4387
|
if (working)
|
|
4298
4388
|
throw new StoryPressRefused(`#${storyId} already has a worker at work, so there is nothing to force`);
|
|
4299
4389
|
forceEntry(e, now, by);
|
|
4300
|
-
did = `#${storyId} starts on the next pass, past a ⏸ Stop`;
|
|
4390
|
+
did = `#${storyId} starts on the next pass, past a ⏸ Stop and this workspace's lane limit`;
|
|
4301
4391
|
}
|
|
4302
4392
|
else if (press === "stop" || press === "kill") {
|
|
4303
4393
|
if (e.worker === undefined || !(working || parkedInLine(e) || e.worker.carried !== undefined || ownerAction !== undefined))
|
|
@@ -144,7 +144,7 @@ export function createClaudeDriver(runtime) {
|
|
|
144
144
|
throw spec.failures.fail(`Claude Code has not been trusted in ${spec.project}, so its CLI would stop on "Do you trust this folder?" before reading any message — run claude in that folder once and answer "Yes, I trust this folder", then send the message again`);
|
|
145
145
|
super(spec, claudeProvider, spec.started || transcriptWritten(spec.sessionId), runtime);
|
|
146
146
|
const hook = [{ hooks: [{ type: "http", url: `http://127.0.0.1:${hookPort()}${CLAUDE_HOOK_PATH}${this.key}` }] }];
|
|
147
|
-
const settings = JSON.stringify({ hooks: Object.fromEntries(HOOKED.map((name) => [name, hook])) });
|
|
147
|
+
const settings = JSON.stringify({ viewMode: "focus", hooks: Object.fromEntries(HOOKED.map((name) => [name, hook])) });
|
|
148
148
|
sessions.set(this.key, (event) => this.hook(event));
|
|
149
149
|
// #4157 — at the workspace root no project's CLAUDE.md sits in the CLI's own folder chain, so every listed project is added and its rules loaded: the root session then routes each prompt as the project's own rules say.
|
|
150
150
|
const atRoot = runtime.store.isRootFolder(spec.project);
|
|
@@ -154,7 +154,7 @@ export function createClaudeDriver(runtime) {
|
|
|
154
154
|
...(spec.title === undefined ? [] : ["--name", spec.title]),
|
|
155
155
|
...(this.resumes ? ["--resume", spec.sessionId] : ["--session-id", spec.sessionId]),
|
|
156
156
|
"--permission-mode", "bypassPermissions", "--disallowedTools", BN_REACHES_HIM_ON_THE_PAGE, "--settings", settings,
|
|
157
|
-
], atRoot ? { CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: "1" } :
|
|
157
|
+
], { CLAUDE_CODE_NO_FLICKER: "1", ...(atRoot ? { CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: "1" } : {}) });
|
|
158
158
|
let draw;
|
|
159
159
|
this.drawn = new Promise((resolve) => { draw = resolve; });
|
|
160
160
|
this.terminal.onOutput(() => draw());
|
|
@@ -987,7 +987,8 @@ class WebHost {
|
|
|
987
987
|
}
|
|
988
988
|
// NULL-OK: field remembered is OPTIONAL and therefore it is ok to check for NULL
|
|
989
989
|
if (remembered !== undefined && new URL(remembered, "http://localhost").searchParams.get("scope") !== "all") {
|
|
990
|
-
|
|
990
|
+
const moved = url.searchParams.has("bullseye-framed") ? `${remembered}${remembered.includes("?") ? "&" : "?"}bullseye-framed=1` : remembered;
|
|
991
|
+
return send(response, 302, MIME[".txt"], `moved to ${moved}`, { Location: moved, "Cache-Control": "no-store" });
|
|
991
992
|
}
|
|
992
993
|
return this.serveDocument(page, response);
|
|
993
994
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.412",
|
|
4
4
|
"description": "Reach your AI agents from anywhere — and let them reach you. One resident process on 127.0.0.1:7475 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/daemon.js",
|
|
6
6
|
"type": "module",
|